@realsee/dnalogel 2.6.7-dev.11 → 2.6.7-dev.12

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 (266) hide show
  1. package/dist/index.cjs.js +2 -2
  2. package/dist/index.js +5 -5
  3. package/dist/index.umd.js +2 -2
  4. package/docs/classes/CSS3DRender.html +31 -31
  5. package/docs/classes/CruisePluginController.html +24 -24
  6. package/docs/classes/Magnifier.html +20 -20
  7. package/docs/classes/ModelRoomLabelController.html +11 -11
  8. package/docs/classes/Object3DHelperController.html +24 -24
  9. package/docs/classes/PaintBrush.html +15 -15
  10. package/docs/classes/PanoMeasurePluginLine.html +23 -23
  11. package/docs/classes/PanoMeasurePluginModel.html +22 -22
  12. package/docs/classes/PanoMeasurePluginPoint.html +14 -14
  13. package/docs/classes/PanoMeasurePluginPolyline.html +26 -26
  14. package/docs/classes/PanoTagPluginController.html +47 -47
  15. package/docs/classes/Util.BetterTween.html +8 -8
  16. package/docs/classes/Util.FivePointSelector.html +12 -12
  17. package/docs/classes/Util.Interval.html +12 -12
  18. package/docs/classes/Util.Magnifier.html +17 -17
  19. package/docs/classes/Util.PointDomHelper.html +11 -11
  20. package/docs/classes/Util.PointHelper.html +11 -11
  21. package/docs/classes/Util.Rectangle.html +13 -13
  22. package/docs/enums/CameraMovementEffect.html +7 -7
  23. package/docs/enums/ContentType.html +18 -18
  24. package/docs/enums/DIRECTION.html +9 -9
  25. package/docs/enums/DISPLAY_STRATEGY_TYPE.html +9 -9
  26. package/docs/enums/DimensionType.html +7 -7
  27. package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +8 -8
  28. package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +9 -9
  29. package/docs/enums/PaintBrushTypeEnum.html +8 -8
  30. package/docs/enums/PointType.html +7 -7
  31. package/docs/enums/Rotation.html +8 -8
  32. package/docs/functions/CSS3DRenderPlugin.html +4 -4
  33. package/docs/functions/CameraMovementPlugin.html +4 -4
  34. package/docs/functions/CruisePlugin.html +4 -4
  35. package/docs/functions/GuideLinePlugin.html +5 -5
  36. package/docs/functions/ItemLabelPlugin.html +4 -4
  37. package/docs/functions/MapviewFloorplanPlugin.html +4 -4
  38. package/docs/functions/ModelChassisCompassPlugin.html +4 -4
  39. package/docs/functions/ModelEntryDoorGuidePlugin.html +4 -4
  40. package/docs/functions/ModelFloorplanPlugin.html +4 -4
  41. package/docs/functions/ModelItemLabelPlugin.html +4 -4
  42. package/docs/functions/ModelRoomLabelPlugin.html +4 -4
  43. package/docs/functions/ModelTVVideoPlugin.html +4 -4
  44. package/docs/functions/ModelViewPlugin.html +4 -4
  45. package/docs/functions/Object3DHelperPlugin.html +4 -4
  46. package/docs/functions/PanoCompassPlugin.html +4 -4
  47. package/docs/functions/PanoCursorRaycasterPlugin.html +4 -4
  48. package/docs/functions/PanoDoorLabelPlugin.html +4 -4
  49. package/docs/functions/PanoFloorplanRadarPlugin.html +4 -4
  50. package/docs/functions/PanoMeasurePlugin.html +4 -4
  51. package/docs/functions/PanoRulerPlugin.html +4 -4
  52. package/docs/functions/PanoRulerProPlugin.html +4 -4
  53. package/docs/functions/PanoSpatialTagPlugin.html +4 -4
  54. package/docs/functions/PanoTagPlugin.html +4 -4
  55. package/docs/functions/TopviewFloorplanPlugin.html +4 -4
  56. package/docs/functions/Util.getCoordsFromClient.html +5 -5
  57. package/docs/functions/Util.getCoordsFromElement.html +5 -5
  58. package/docs/functions/Util.getFrameTime.html +5 -5
  59. package/docs/functions/Util.getIntersectFromRelativePosition.html +5 -5
  60. package/docs/functions/Util.getRaycasterFromFivePointer.html +5 -5
  61. package/docs/functions/Util.isNil.html +5 -5
  62. package/docs/functions/Util.nextFrame.html +5 -5
  63. package/docs/functions/Util.notNil.html +5 -5
  64. package/docs/functions/Util.requestAnimationFrameInterval.html +5 -5
  65. package/docs/functions/Util.tweenProgress.html +5 -5
  66. package/docs/functions/pluginFlag.html +5 -5
  67. package/docs/index.html +4 -4
  68. package/docs/interfaces/AddTagConfig.html +6 -6
  69. package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -11
  70. package/docs/interfaces/CSS3DRenderPluginState.html +8 -8
  71. package/docs/interfaces/CameraMovementPluginExportType.html +7 -7
  72. package/docs/interfaces/EventMap.html +15 -15
  73. package/docs/interfaces/FloorplanBounding.html +8 -8
  74. package/docs/interfaces/FloorplanData.html +10 -10
  75. package/docs/interfaces/FloorplanEntrance.html +11 -11
  76. package/docs/interfaces/FloorplanExtraObject.html +10 -10
  77. package/docs/interfaces/FloorplanExtraObject3D.html +8 -8
  78. package/docs/interfaces/FloorplanFloorData.html +9 -9
  79. package/docs/interfaces/FloorplanImagePosition.html +7 -7
  80. package/docs/interfaces/FloorplanObserver.html +9 -9
  81. package/docs/interfaces/FloorplanOutlineItem.html +9 -9
  82. package/docs/interfaces/FloorplanPosition.html +7 -7
  83. package/docs/interfaces/FloorplanRoomItem.html +13 -13
  84. package/docs/interfaces/FloorplanRoomLabelItem.html +7 -7
  85. package/docs/interfaces/FloorplanServerBounding.html +8 -8
  86. package/docs/interfaces/FloorplanServerComputedData.html +10 -10
  87. package/docs/interfaces/FloorplanServerData.html +7 -7
  88. package/docs/interfaces/FloorplanServerDoorItem.html +10 -10
  89. package/docs/interfaces/FloorplanServerDoorPosition.html +8 -8
  90. package/docs/interfaces/FloorplanServerEntrance.html +11 -11
  91. package/docs/interfaces/FloorplanServerFloorData.html +9 -9
  92. package/docs/interfaces/FloorplanServerImagePosition.html +7 -7
  93. package/docs/interfaces/FloorplanServerObserver.html +9 -9
  94. package/docs/interfaces/FloorplanServerOutlineItem.html +9 -9
  95. package/docs/interfaces/FloorplanServerPosition.html +7 -7
  96. package/docs/interfaces/FloorplanServerRoomItem.html +14 -14
  97. package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -7
  98. package/docs/interfaces/HelperOffset.html +8 -8
  99. package/docs/interfaces/ItemLabelPluginData.html +6 -6
  100. package/docs/interfaces/ItemLabelPluginExportReturnsType.html +11 -11
  101. package/docs/interfaces/ItemLabelPluginParametersType.html +9 -9
  102. package/docs/interfaces/MinMax.html +7 -7
  103. package/docs/interfaces/ModelChassisCompassPluginData.html +7 -7
  104. package/docs/interfaces/ModelChassisCompassPluginExportType.html +8 -8
  105. package/docs/interfaces/ModelChassisCompassPluginParameterType.html +7 -7
  106. package/docs/interfaces/ModelEntryDoorGuidePluginData.html +8 -8
  107. package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +8 -8
  108. package/docs/interfaces/ModelItemLabelPluginData.html +6 -6
  109. package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +11 -11
  110. package/docs/interfaces/ModelItemLabelPluginParametersType.html +7 -7
  111. package/docs/interfaces/ModelRoomLabelPluginData.html +6 -6
  112. package/docs/interfaces/ModelTVVideoPluginData.html +9 -9
  113. package/docs/interfaces/ModelTVVideoPluginExportType.html +8 -8
  114. package/docs/interfaces/ModelTVVideoPluginParameterType.html +6 -6
  115. package/docs/interfaces/ModelViewPluginExportType.html +11 -11
  116. package/docs/interfaces/Object3DHelperState.html +8 -8
  117. package/docs/interfaces/ObjectHelperControllers.html +9 -9
  118. package/docs/interfaces/PaintBrushAction.html +12 -12
  119. package/docs/interfaces/PaintBrushConfigs.html +12 -12
  120. package/docs/interfaces/PaintBrushState.html +10 -10
  121. package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +10 -10
  122. package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +5 -5
  123. package/docs/interfaces/PanoMeasureParameterType.html +12 -12
  124. package/docs/interfaces/PanoMeasurePluginLineJson.html +8 -8
  125. package/docs/interfaces/PanoMeasurePluginOpenParameter.html +7 -7
  126. package/docs/interfaces/PanoMeasurePluginPointJson.html +7 -7
  127. package/docs/interfaces/PanoMeasurePluginPolylineJson.html +8 -8
  128. package/docs/interfaces/PanoRulerPluginExportType.html +10 -10
  129. package/docs/interfaces/PanoRulerPluginOptions.html +7 -7
  130. package/docs/interfaces/PanoRulerPluginParameterType.html +8 -8
  131. package/docs/interfaces/PanoRulerProPluginExportType.html +9 -9
  132. package/docs/interfaces/PanoRulerProPluginOptions.html +7 -7
  133. package/docs/interfaces/PanoRulerProPluginParameterType.html +7 -7
  134. package/docs/interfaces/PanoRulerProPluginState.html +8 -8
  135. package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +5 -5
  136. package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +5 -5
  137. package/docs/interfaces/PanoSpatialTagPluginData.html +11 -11
  138. package/docs/interfaces/PanoSpatialTagPluginDataElement.html +10 -10
  139. package/docs/interfaces/PanoSpatialTagPluginExportType.html +13 -13
  140. package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +10 -10
  141. package/docs/interfaces/PanoSpatialTagPluginParameterType.html +13 -13
  142. package/docs/interfaces/PanoSpatialTagPluginPointElement.html +11 -11
  143. package/docs/interfaces/PanoSpatialTagPluginTagElement.html +10 -10
  144. package/docs/interfaces/Point.html +8 -8
  145. package/docs/interfaces/Room.html +9 -9
  146. package/docs/interfaces/RoomInfo.html +7 -7
  147. package/docs/interfaces/RoomLabel.html +14 -14
  148. package/docs/interfaces/RoomRules.html +5 -5
  149. package/docs/interfaces/Rooms.html +5 -5
  150. package/docs/interfaces/Scissor.html +9 -9
  151. package/docs/interfaces/State.html +8 -8
  152. package/docs/interfaces/TagCache.html +12 -12
  153. package/docs/interfaces/TagConfig.html +10 -10
  154. package/docs/interfaces/TagIconUrl.html +9 -9
  155. package/docs/interfaces/Tags.html +9 -9
  156. package/docs/interfaces/TemporaryState.html +6 -6
  157. package/docs/interfaces/Util.MagnifierParameter.html +11 -11
  158. package/docs/interfaces/Util.MouseGroupParameter.html +8 -8
  159. package/docs/modules/Util.html +5 -5
  160. package/docs/modules.html +4 -4
  161. package/docs/types/ArrayPosition.html +5 -5
  162. package/docs/types/AudioAppearance.html +5 -5
  163. package/docs/types/AudioTagTypeConfigKey.html +5 -5
  164. package/docs/types/CSS3DRenderExportType.html +5 -5
  165. package/docs/types/CSS3DRenderPluginExportType.html +5 -5
  166. package/docs/types/CSS3DRenderPluginParameterType.html +5 -5
  167. package/docs/types/ClassFunctionParameters.html +5 -5
  168. package/docs/types/Color.html +5 -5
  169. package/docs/types/ContentTypeConfigKey.html +5 -5
  170. package/docs/types/ContentTypeConfigKeySplit.html +5 -5
  171. package/docs/types/ContentTypeMap.html +5 -5
  172. package/docs/types/Create3DDomContainerReturnType.html +5 -5
  173. package/docs/types/Create3DElementReturnType.html +5 -5
  174. package/docs/types/CruisePluginExportType.html +5 -5
  175. package/docs/types/Direction-1.html +5 -5
  176. package/docs/types/Direction4.html +5 -5
  177. package/docs/types/FloorplanRuleLabels.html +5 -5
  178. package/docs/types/FloorplanServerRuleLabels.html +5 -5
  179. package/docs/types/GuideLinePluginExportType.html +5 -5
  180. package/docs/types/HelperEventMap.html +5 -5
  181. package/docs/types/LoadTagConfig.html +5 -5
  182. package/docs/types/MapviewFloorplanPluginParameterType.html +5 -5
  183. package/docs/types/MapviewFloorplanPluginReturnType.html +5 -5
  184. package/docs/types/MediaData.html +5 -5
  185. package/docs/types/MediaStore.html +5 -5
  186. package/docs/types/ModelElement.html +5 -5
  187. package/docs/types/ModelEntryDoorGuidePluginParameterType.html +5 -5
  188. package/docs/types/ModelFloorplanPluginParameterType.html +5 -5
  189. package/docs/types/ModelFloorplanPluginReturnType.html +5 -5
  190. package/docs/types/ModelRoomLabelPluginParameters.html +5 -5
  191. package/docs/types/ModelRoomLabelPluginReturnType.html +5 -5
  192. package/docs/types/MoveArgs.html +5 -5
  193. package/docs/types/MoveOpts.html +5 -5
  194. package/docs/types/Object3DHelperEventMap.html +5 -5
  195. package/docs/types/ObjectFit.html +5 -5
  196. package/docs/types/PaintBrushEventMap.html +5 -5
  197. package/docs/types/PanoCompassPluginData.html +5 -5
  198. package/docs/types/PanoCompassPluginExportType.html +5 -5
  199. package/docs/types/PanoCompassPluginParameterType.html +5 -5
  200. package/docs/types/PanoFloorplanRadarPluginParameterType.html +5 -5
  201. package/docs/types/PanoFloorplanRadarPluginReturnType.html +5 -5
  202. package/docs/types/PanoIndex.html +5 -5
  203. package/docs/types/PanoMeasurePluginEvent.html +5 -5
  204. package/docs/types/PanoMeasureReturnType.html +5 -5
  205. package/docs/types/PanoSpatialTagPluginId.html +5 -5
  206. package/docs/types/PanoTagPluginExportInterface.html +5 -5
  207. package/docs/types/PanoTagPluginParamsInterface.html +5 -5
  208. package/docs/types/PlaneTag.html +5 -5
  209. package/docs/types/PlaneTagElement.html +5 -5
  210. package/docs/types/Point2DElement.html +5 -5
  211. package/docs/types/Point2DTag.html +5 -5
  212. package/docs/types/Point3DElement.html +5 -5
  213. package/docs/types/Point3DTag.html +5 -5
  214. package/docs/types/PointTag.html +5 -5
  215. package/docs/types/PointTagElement.html +5 -5
  216. package/docs/types/Position.html +5 -5
  217. package/docs/types/RotateArgs.html +5 -5
  218. package/docs/types/RotateOpts.html +5 -5
  219. package/docs/types/RuleLabelsKey.html +5 -5
  220. package/docs/types/RuleLabelsValue.html +5 -5
  221. package/docs/types/StickType.html +5 -5
  222. package/docs/types/Tag.html +5 -5
  223. package/docs/types/Tag2D.html +5 -5
  224. package/docs/types/Tag3D.html +5 -5
  225. package/docs/types/TagContentType.html +5 -5
  226. package/docs/types/TagDimensionType.html +5 -5
  227. package/docs/types/TagElement.html +5 -5
  228. package/docs/types/TagEvents.html +5 -5
  229. package/docs/types/TagGLTFObject.html +5 -5
  230. package/docs/types/TagHooks.html +5 -5
  231. package/docs/types/TagIconSize.html +5 -5
  232. package/docs/types/TagId.html +5 -5
  233. package/docs/types/TagPointType.html +5 -5
  234. package/docs/types/TopviewFloorplanPluginParameterType.html +5 -5
  235. package/docs/types/TopviewFloorplanPluginReturnType.html +5 -5
  236. package/docs/types/WorkCode.html +5 -5
  237. package/docs/variables/FLOOR_TYPE_MAP.html +5 -5
  238. package/docs/variables/PLUGIN.html +5 -5
  239. package/docs/variables/ROOM_FETILE_TYPE_MAP.html +5 -5
  240. package/docs/variables/ROOM_TYPE_MAP.html +5 -5
  241. package/docs/variables/VERSION.html +5 -5
  242. package/docs/variables/itemLabelPluginServerParams.html +5 -5
  243. package/docs/variables/modelItemLabelPluginServerParams.html +5 -5
  244. package/docs/variables/modelRoomLabelPluginServerParams.html +5 -5
  245. package/libs/PanoTagPlugin/controller/TagComputer.js +5 -5
  246. package/libs/shared-utils/Object3DHelper/utils/boundingBox.js +15 -15
  247. package/package.json +1 -1
  248. package/libs/PanoTagPlugin/mocks/v1/mock-80P6A03eQRQKY3oqLj.d.ts +0 -4
  249. package/libs/PanoTagPlugin/mocks/v1/mock-80P6A03eQRQKY3oqLj.js +0 -6
  250. package/libs/PanoTagPlugin/mocks/v1/mock-80QG2vMPboNv5DWrom.d.ts +0 -93
  251. package/libs/PanoTagPlugin/mocks/v1/mock-80QG2vMPboNv5DWrom.js +0 -5622
  252. package/libs/PanoTagPlugin/mocks/v1/mock-test3-realsee-cn-4zr0A5.js +0 -1325
  253. package/libs/PanoTagPlugin/mocks/v1/mock1.d.ts +0 -173
  254. package/libs/PanoTagPlugin/mocks/v1/mock1.js +0 -122
  255. package/libs/PanoTagPlugin/mocks/v1/mock2.d.ts +0 -233
  256. package/libs/PanoTagPlugin/mocks/v1/mock2.js +0 -296
  257. package/libs/PanoTagPlugin/mocks/v1/mock3.d.ts +0 -22
  258. package/libs/PanoTagPlugin/mocks/v1/mock3.js +0 -32
  259. package/libs/PanoTagPlugin/mocks/v1/mock4.d.ts +0 -56
  260. package/libs/PanoTagPlugin/mocks/v1/mock4.js +0 -60
  261. package/libs/PanoTagPlugin/mocks/v1/mock5.d.ts +0 -13
  262. package/libs/PanoTagPlugin/mocks/v1/mock5.js +0 -17
  263. package/libs/PanoTagPlugin/mocks/v1/mock6.d.ts +0 -16
  264. package/libs/PanoTagPlugin/mocks/v1/mock6.js +0 -27
  265. package/libs/PanoTagPlugin/mocks/v1/mock7.d.ts +0 -22
  266. package/libs/PanoTagPlugin/mocks/v1/mock7.js +0 -228
package/dist/index.cjs.js CHANGED
@@ -558,5 +558,5 @@ void main() {
558
558
  float match = 1.0 - uv.x;
559
559
  gl_FragColor = vec4(1.0,1.0,1.0,match);
560
560
  }
561
- `;function q0(){const i=new E.PlaneGeometry(.4,.4),t=U0,e=new E.TextureLoader().load(t);e.encoding=E.sRGBEncoding;const n=new E.MeshBasicMaterial({map:e,transparent:!0,depthTest:!1});return new E.Mesh(i,n)}function K0(){const i=new E.CurvePath;i.add(new E.LineCurve3(new E.Vector3(0,0,0),new E.Vector3(0,0,.1)));const t=new E.TubeGeometry(i,8,.003),e=new E.ShaderMaterial({vertexShader:J0,fragmentShader:Z0,depthTest:!1,transparent:!0});return new E.Mesh(t,e)}function $0(){const i=new E.SphereGeometry(.01,20,20),t=new E.MeshBasicMaterial({color:10349931,depthTest:!1,transparent:!0,side:E.DoubleSide}),e=new E.Mesh(i,t);return e.position.set(0,0,.1),e}class Al extends E.Object3D{constructor(){super();m(this,"planeMesh");m(this,"lineMesh");m(this,"ballMesh");this.planeMesh=q0(),this.lineMesh=K0(),this.ballMesh=$0(),this.add(this.planeMesh,this.lineMesh,this.ballMesh)}updateWithIntersect(e){if(!e.face)return;const n=new E.Vector3().addVectors(e.point,e.face.normal);this.position.copy(e.point),this.lookAt(n)}dispose(){var e;(e=this.planeMesh.material.map)==null||e.dispose()}}class vl{constructor(t){m(this,"five");m(this,"contentElement",document.createElement("div"));m(this,"animeIns");m(this,"container");m(this,"css3DObject");m(this,"disposeCss3DObject");m(this,"state",{enabled:!1});this.five=t;const n=.4/2,s=qt(t).create3DDomContainer([[-n,n,0],[-n,-n,0],[n,-n,0],[n,n,0]].map(r=>new E.Vector3().fromArray(r)));if(s){const{container:r,dispose:a,css3DObject:l}=s;this.container=r,this.css3DObject=l,this.disposeCss3DObject=a}this.contentElement.style.width="100%",this.contentElement.style.height="100%",this.contentElement.style.backgroundImage=`url(${_a})`,this.contentElement.style.backgroundSize="100%",this.contentElement.style.backgroundRepeat="no-repeat"}enable(){var t;this.state.enabled||(this.state.enabled=!0,(t=this.container)==null||t.appendChild(this.contentElement))}disable(){!this.state.enabled||(this.state.enabled=!1,this.contentElement.remove())}updateWithIntersect(t){if(!t.face||!this.css3DObject)return;const e=new E.Vector3().addVectors(t.point,t.face.normal);this.css3DObject.position.copy(t.point),this.css3DObject.lookAt(e),this.five.needsRender=!0}doAnimation(){var t;(t=this.animeIns)==null||t.dispose(),new mo({progress:0}).to({progress:[1,0]}).duration(500).easing(si.Easing.Quadratic.InOut).onUpdate(({progress:e})=>{}).play()}dispose(){var t;(t=this.disposeCss3DObject)==null||t.call(this)}}class eA{constructor(t,e){m(this,"five");m(this,"hooks",new Ce.Subscribe);m(this,"magnifier",null);m(this,"pointHelper",null);m(this,"pointDomHelper",null);m(this,"contentDom",document.createElement("div"));m(this,"state",{enabled:!1});m(this,"group",new E.Group);this.five=t,this.magnifier=(e==null?void 0:e.magnifier)===void 0?new pl(t,{dragEnabled:!0}):null,this.pointHelper=(e==null?void 0:e.pointHelper)===void 0?new Al:null,this.pointDomHelper=(e==null?void 0:e.pointDomHelper)===void 0?new vl(t):null,this.group.name="five-point-selector",this.five.scene.add(this.group),this.contentDom.classList.add("five-point-selector-content"),this.contentDom.style.position="absolute",this.contentDom.style.top="0",this.contentDom.style.left="0",this.contentDom.style.width="100%",this.contentDom.style.height="100%",this.contentDom.style.pointerEvents="none"}enable(){var t,e;this.state.enabled||(this.state.enabled=!0,this.pointHelper&&this.group.add(this.pointHelper),(t=this.magnifier)==null||t.enable(),(e=this.pointDomHelper)==null||e.enable(),this.five.needsRender=!0,this.hooks.emit("enabled"))}disable(){var t,e;!this.state.enabled||(this.state.enabled=!1,this.pointHelper&&this.group.remove(this.pointHelper),(t=this.magnifier)==null||t.disable(),(e=this.pointDomHelper)==null||e.disable(),this.hooks.emit("disabled"))}dispose(){this.hooks.off(),this.disable(),this.magnifier=null,this.pointHelper=null,this.pointDomHelper=null}updateWithIntersect(t){var s;this.hooks.emit("pointChanged",{panoIndex:this.five.getCurrentState().panoIndex,position:t.point.toArray(),normal:(s=t.face)==null?void 0:s.normal.toArray()});const e=this.magnifier;e&&e.renderWithPoint(t.point);const n=this.pointHelper;n&&n.updateWithIntersect(t);const o=this.pointDomHelper;o&&o.updateWithIntersect(t),this.five.needsRender=!0}}const tA=Object.freeze(Object.defineProperty({__proto__:null,Interval:Ki,Rectangle:W0,Magnifier:pl,getCoordsFromClient:_0,getCoordsFromElement:gl,getRaycasterFromFivePointer:X0,getIntersectFromRelativePosition:Y0,PointHelper:Al,PointDomHelper:vl,FivePointSelector:eA,isNil:np,notNil:Ye,BetterTween:mo,tweenProgress:ja,nextFrame:ui,requestAnimationFrameInterval:di,getFrameTime:Ch},Symbol.toStringTag,{value:"Module"}));function nA(i){le(i,"svelte-8mby9k",".svelte-8mby9k.svelte-8mby9k{box-sizing:border-box}.marketing.svelte-8mby9k.svelte-8mby9k{transform:translateY(-100%)}.content.svelte-8mby9k .headerImage.svelte-8mby9k{position:absolute;width:100%;top:0.25rem;transform:translateY(-100%);border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.line.svelte-8mby9k.svelte-8mby9k{position:absolute;height:2.0625rem;width:0.0625rem;left:50%;transform:translateX(-50%);background-color:white;bottom:0;transform-origin:bottom;transition:all 500ms}.content.svelte-8mby9k.svelte-8mby9k{background-color:white;position:relative;display:flex;flex-direction:column;min-width:11.125rem;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;border-radius:0.25rem;top:-1.875rem;left:-1rem;padding:0.5rem 0rem 0.5625rem;transition:all 500ms}.title.svelte-8mby9k.svelte-8mby9k{position:absolute;background-color:white;border-radius:0.25rem;width:100%;top:0.5rem;padding-left:0.75rem;padding-right:0.75rem}.title.svelte-8mby9k .text.svelte-8mby9k{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;font-weight:bold;line-height:1.125rem;color:#000}.footer.svelte-8mby9k.svelte-8mby9k{position:relative;padding-left:0.75rem;padding-right:0.75rem;width:100%;height:1.375rem;display:flex;align-items:center}.footer.svelte-8mby9k .goto-button.svelte-8mby9k{flex-shrink:0;white-space:nowrap;background-image:linear-gradient(to right, rgba(87, 144, 253, 1) 0, rgba(42, 114, 254, 1) 100%);color:#fff;font-size:0.625rem;border-radius:0.875rem;font-weight:bold;padding-left:0.5rem;padding-right:0.5rem;height:1.25rem;margin-left:auto;display:flex;align-items:center}.footer.svelte-8mby9k .goto-icon.svelte-8mby9k::after{content:'';display:inline-block;width:0.75rem;height:0.75rem;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAeFBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////GqOSsAAAAJ3RSTlMAFNO2pYt4bErz8uP6ysawgVtBPDcR5C4s2L6ZmJBzZGJXUyEeDws/0G2zAAAAkklEQVQ4y+3TRw6DMBAF0OAeJ3QCpCe0uf8NwRILLBYfiS1/aT3JoymnI+sERZ5VCH0iVto3QDfBLmeSSMUTogRV9bBEpJAKaYpGijn13aTSLeraeG9D0NZFZv4/rRL5FDHnITlllqjv6tykWsmX4JHr05y7j6oFKq2P8He48B0tAM0EY0EDxquClw6vLz6EI35GmwwSZpe+WOgAAAAASUVORK5CYII=);background-size:100% auto;background-repeat:no-repeat}.price.svelte-8mby9k.svelte-8mby9k{flex-shrink:0;margin-right:0.75rem;white-space:nowrap;color:#ff6600;display:flex;align-items:baseline}.price.svelte-8mby9k .value.svelte-8mby9k{position:relative;top:0.0625rem;font-size:1.125rem;line-height:1.375rem;font-family:TG-TYPE, PingFangSC, Segoe UI, Rototo, sans-serif;letter-spacing:0rem}.price.svelte-8mby9k .unit.svelte-8mby9k{padding-left:0.125rem;font-size:0.625rem}.tag.svelte-8mby9k.svelte-8mby9k{position:relative;background-color:white;display:flex;width:-moz-max-content;width:max-content;padding-left:0.75rem;padding-right:0.75rem;min-height:1.75rem}.tag.svelte-8mby9k .base-tag.svelte-8mby9k{height:1rem;margin-top:1.375rem;margin-bottom:0.5rem;margin-right:0.25rem;font-size:0.625rem;line-height:0.875rem;padding:0.0625rem 0.25rem;border-radius:0.125rem;overflow:hidden}.tag.svelte-8mby9k .primary-tag.svelte-8mby9k{background:#e5eefe;color:#0055ff}.tag.svelte-8mby9k .secondary-tag.svelte-8mby9k{background:rgba(255, 102, 0, 0.08);color:rgba(255, 102, 0, 1)}.unfolded.svelte-8mby9k .line.svelte-8mby9k{transform:translateX(-50%) scale(1, 1)}.folded.svelte-8mby9k .line.svelte-8mby9k{transform:translateX(-50%) scale(1, 0);transition-timing-function:ease-in}.unfolded.svelte-8mby9k .content.svelte-8mby9k{opacity:1}.folded.svelte-8mby9k .content.svelte-8mby9k{opacity:0;transform:translateY(0.425rem);transition-timing-function:ease-in}")}function Mr(i,t,e){const n=i.slice();return n[0]=t[e],n}function Tr(i,t,e){const n=i.slice();return n[0]=t[e],n}function zr(i){let t,e=i[0]+"",n;return{c(){t=z("div"),n=ke(e),b(t,"class","base-tag primary-tag svelte-8mby9k")},m(o,s){T(o,t,s),R(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&Se(n,e)},d(o){o&&M(t)}}}function Br(i){let t,e=i[0]&&zr(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),T(n,t,o)},p(n,o){n[0]?e?e.p(n,o):(e=zr(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},d(n){e&&e.d(n),n&&M(t)}}}function jr(i){let t,e=i[0]+"",n;return{c(){t=z("div"),n=ke(e),b(t,"class","base-tag secondary-tag svelte-8mby9k")},m(o,s){T(o,t,s),R(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&Se(n,e)},d(o){o&&M(t)}}}function Vr(i){let t,e=i[0]&&jr(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),T(n,t,o)},p(n,o){n[0]?e?e.p(n,o):(e=jr(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},d(n){e&&e.d(n),n&&M(t)}}}function Rr(i){let t,e,n=i[2].price.value+"",o,s,r=i[2].price.unit&&Qr(i);return{c(){t=z("div"),e=z("span"),o=ke(n),s=ne(),r&&r.c(),b(e,"class","value svelte-8mby9k"),b(t,"class","price svelte-8mby9k")},m(a,l){T(a,t,l),R(t,e),R(e,o),R(t,s),r&&r.m(t,null)},p(a,l){l&4&&n!==(n=a[2].price.value+"")&&Se(o,n),a[2].price.unit?r?r.p(a,l):(r=Qr(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&M(t),r&&r.d()}}}function Qr(i){let t,e=i[2].price.unit+"",n;return{c(){t=z("span"),n=ke(e),b(t,"class","unit svelte-8mby9k")},m(o,s){T(o,t,s),R(t,n)},p(o,s){s&4&&e!==(e=o[2].price.unit+"")&&Se(n,e)},d(o){o&&M(t)}}}function Or(i){let t,e=i[2].highlightText+"",n;return{c(){t=z("div"),n=ke(e),b(t,"class","goto-button goto-icon svelte-8mby9k")},m(o,s){T(o,t,s),R(t,n)},p(o,s){s&4&&e!==(e=o[2].highlightText+"")&&Se(n,e)},d(o){o&&M(t)}}}function iA(i){var J,V;let t,e,n,o,s,r,a,l,c,u,h,d,f,p,v=i[2].title+"",g,A,y,w=Ye((J=i[2].price)==null?void 0:J.value)&&((V=i[2].price)==null?void 0:V.value)!=="",C,x;e=new nt({props:{visible:i[1],outDelay:500,left:61,bottom:87,blurRadius:150,spreadRadius:75}});let I=i[2].brandTags||[],S=[];for(let B=0;B<I.length;B+=1)S[B]=Br(Tr(i,I,B));let k=i[2].tags||[],j=[];for(let B=0;B<k.length;B+=1)j[B]=Vr(Mr(i,k,B));let _=w&&Rr(i),F=i[2].highlightText&&Or(i);return{c(){var B;t=z("div"),$(e.$$.fragment),n=ne(),o=z("div"),s=ne(),r=z("div"),a=z("img"),c=ne(),u=z("div");for(let O=0;O<S.length;O+=1)S[O].c();h=ne();for(let O=0;O<j.length;O+=1)j[O].c();d=ne(),f=z("div"),p=z("div"),g=ke(v),A=ne(),y=z("div"),_&&_.c(),C=ne(),F&&F.c(),b(o,"class","line svelte-8mby9k"),L(o,"transition-delay",i[1]?Fn+"ms":Gn+Fr-Hr-40+"ms"),b(a,"class","headerImage svelte-8mby9k"),_e(a.src,l=i[2].headerPictureUrl)||b(a,"src",l),b(a,"alt",""),b(u,"class","tag svelte-8mby9k"),b(p,"class","text svelte-8mby9k"),b(f,"class","title svelte-8mby9k"),b(y,"class","footer svelte-8mby9k"),L(y,"height",Ye((B=i[2].price)==null?void 0:B.value)&&i[2].highlightText?void 0:"1rem"),b(r,"class","content svelte-8mby9k"),L(r,"transition-delay",i[1]?Fn+Gn+"ms":"0ms"),b(t,"class","marketing svelte-8mby9k"),Z(t,"unfolded",i[1]),Z(t,"folded",i[3])},m(B,O){T(B,t,O),q(e,t,null),R(t,n),R(t,o),R(t,s),R(t,r),R(r,a),R(r,c),R(r,u);for(let W=0;W<S.length;W+=1)S[W].m(u,null);R(u,h);for(let W=0;W<j.length;W+=1)j[W].m(u,null);R(r,d),R(r,f),R(f,p),R(p,g),R(r,A),R(r,y),_&&_.m(y,null),R(y,C),F&&F.m(y,null),x=!0},p(B,[O]){var G,ee,X;const W={};if(O&2&&(W.visible=B[1]),e.$set(W),O&2&&L(o,"transition-delay",B[1]?Fn+"ms":Gn+Fr-Hr-40+"ms"),(!x||O&4&&!_e(a.src,l=B[2].headerPictureUrl))&&b(a,"src",l),O&4){I=B[2].brandTags||[];let U;for(U=0;U<I.length;U+=1){const de=Tr(B,I,U);S[U]?S[U].p(de,O):(S[U]=Br(de),S[U].c(),S[U].m(u,h))}for(;U<S.length;U+=1)S[U].d(1);S.length=I.length}if(O&4){k=B[2].tags||[];let U;for(U=0;U<k.length;U+=1){const de=Mr(B,k,U);j[U]?j[U].p(de,O):(j[U]=Vr(de),j[U].c(),j[U].m(u,null))}for(;U<j.length;U+=1)j[U].d(1);j.length=k.length}(!x||O&4)&&v!==(v=B[2].title+"")&&Se(g,v),O&4&&(w=Ye((G=B[2].price)==null?void 0:G.value)&&((ee=B[2].price)==null?void 0:ee.value)!==""),w?_?_.p(B,O):(_=Rr(B),_.c(),_.m(y,C)):_&&(_.d(1),_=null),B[2].highlightText?F?F.p(B,O):(F=Or(B),F.c(),F.m(y,null)):F&&(F.d(1),F=null),O&4&&L(y,"height",Ye((X=B[2].price)==null?void 0:X.value)&&B[2].highlightText?void 0:"1rem"),O&2&&L(r,"transition-delay",B[1]?Fn+Gn+"ms":"0ms"),(!x||O&2)&&Z(t,"unfolded",B[1]),(!x||O&8)&&Z(t,"folded",B[3])},i(B){x||(P(e.$$.fragment,B),x=!0)},o(B){D(e.$$.fragment,B),x=!1},d(B){B&&M(t),K(e),ct(S,B),ct(j,B),_&&_.d(),F&&F.d()}}}const Fn=400,Hr=500,Gn=180,Fr=500;function oA(i,t,e){let n,o,s,{tag:r}=t;return i.$$set=a=>{"tag"in a&&e(0,r=a.tag)},i.$$.update=()=>{var a,l;i.$$.dirty&1&&e(1,n=(l=(a=r.state)==null?void 0:a.unfolded)!=null?l:!1),i.$$.dirty&2&&e(3,o=!n),i.$$.dirty&1&&e(2,s=r.data)},[r,n,s,o]}class sA extends se{constructor(t){super(),oe(this,t,oA,iA,ie,{tag:0},nA)}}const Jt="data:audio/mpeg;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAADAAAGhgBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////////////////////////////////////8AAAA5TEFNRTMuOThyAc0AAAAAAAAAABSAJAiqQgAAgAAABobxtI73AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//uQxAACFEII9ACZ/sJZwWEoEb8w/////N//////JcxjHjf+7/v/H2PzCCFAiDtGeyBCIx7bJJ1mmEEMy6g8mm2c8nrGABB4h2Mkmn//4z/73u773R5qHHu/j/w7Kxkzh5lWRWdsifCkNAnY9Zc1HvDAhjhSHdFkHFzLmabt/AQxSg2wwzLhHIJOBnAWwVY4zrhIYhhc2kvhYDfQ4hDi2Gmh5KyFn8EcGIrHAngNgIwVIEMf5bzbAiTRoAD///8z/KVhkkWEle6IX+d/z4fvH3BShK1e5kmjkCMoxVmXhd4ROlTKo3iipasvTilY21q19ta30/v/0/idPX1v8PNxJL6ramnOVsdvMv2akO0iSYIzdJFirtzWXCZicS9vHqvSKyqm5XJBdqBwPxyfJdykhWTZ0G0ZyTZGpLKxsNwwoRhsx3tZfhwmeOBVISm3impAC/IT/8hP/EKEM1KMdVdVKM2rHV4x7HVXZvbVVKN/qq8CiV9VL9jjH/6l6qf7MBCjZmOqsAibjcP+qqqv0oxqpa/NVW286hPo1nz2L/h8+jXt//uSxCmDU2IK/ECN98KKtE5IYzNoCfbw+u9i5r8PoadUMFPKqWL4LK3T/LCraMSHGkW4bpLXR/E6LlHOVQxmslKVJ8IULktMN06N0FKCpHCoYsjC4F+Z0NVqdNFoGSTjSiyjzLdnZ2fNqTi2eHKONONKLMPMKLONKLMPQRJGlFxZRoKcJFAYEeIFiRQkUWUeYfef//Ko04soswso40UJAgMw8wosososy0EalnZyjQUGBRQGIFggOWUacWUeYmuadrZziQKKEgQsQLAhQkUJAgMQDghltLO1onp0cpkNInSFMqlYeSEJ5AHsqFdOwy1DA2sRmRJKxdKRfLhfLw5BzUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7ksRRA8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=",pn={};var oi=(i=>(i.Default="default",i.GetAudioDuration="getAudioDuration",i.PlayAudio="playAudio",i))(oi||{});function bl(i,t){const e=(t==null?void 0:t.namespace)||"default",n=pn[e]||(pn[e]=[]);let o=n.find(s=>!s.realSrc||s.realSrc===Jt);return o||(console.warn("\u672A\u627E\u5230\u7F13\u5B58\u97F3\u9891\uFF0C\u5DF2\u65B0\u5EFA",pn),o=new bo(Jt),n.push(o)),i&&(o.src=i),o}function rA(i){return N(this,null,function*(){const t=(()=>i instanceof bo?i:bl(i,{namespace:"getAudioDuration"}))(),e=yield new Promise(n=>{t.duration?t.isBlankAudio?n(0):n(t.duration):(t.addEventListener("loadedmetadata",()=>{t.isBlankAudio?n(0):n(t.duration)}),t.addEventListener("canplaythrough",()=>{t.isBlankAudio?n(0):n(t.duration)}))});return typeof i=="string"&&t.clear(),e})}function Gr(i,t){const e=(t==null?void 0:t.namespace)||"default",n=pn[e]||(pn[e]=[]),o=i-n.length;if(!(o<=0))for(let s=0;s<o;s++)n.push(new bo(Jt))}class bo extends Audio{constructor(e){super(e);m(this,"preload","auto");m(this,"realSrc","");m(this,"inited",!1);m(this,"removeDocumentEventListener");this.realSrc=e!=null?e:"",super.addEventListener("ended",()=>{this.src=""});const n=()=>aA(this);document.addEventListener("click",n),document.addEventListener("touchend",n),this.removeDocumentEventListener=()=>{document.removeEventListener("click",n),document.removeEventListener("touchend",n)}}get isBlankAudio(){return this.realSrc===Jt||!this.realSrc}get src(){return super.src}set src(e){super.src=e,this.realSrc=e}clear(){this.src=Jt,this.currentTime=0}}function aA(i){!i||i.inited||(i.src&&(i.inited=!0,i.removeDocumentEventListener()),i.src===Jt&&i.play())}class lA extends Audio{constructor(e){super();m(this,"sharedAudioSrc");m(this,"sharedAudioPaused",!0);m(this,"sharedAudioCurrentTime",0);m(this,"tryplaying",!1);m(this,"audioInstance");m(this,"eventListenerDisposer");this.sharedAudioSrc=e}get paused(){var e;return(e=this.sharedAudioPaused)!=null?e:!0}get currentTime(){return this.sharedAudioCurrentTime}play(){return N(this,null,function*(){var e,n,o;this.tryplaying||(this.tryplaying=!0,(!this.audioInstance||((e=this.audioInstance)==null?void 0:e.realSrc)!==this.sharedAudioSrc)&&(this.audioInstance=bl(this.sharedAudioSrc,{namespace:oi.PlayAudio})),this.audioInstance.currentTime=(n=this.currentTime)!=null?n:0,(o=this.eventListenerDisposer)==null||o.call(this),this.eventListenerDisposer=this.addEventListeners(),this.audioInstance.play().then(()=>{this.sharedAudioPaused=!1}).catch(s=>{this.pause(),console.warn(s)}).finally(()=>{this.tryplaying=!1}))})}pause(){!this.audioInstance||this.paused||(this.sharedAudioPaused=!0,this.audioInstance.addEventListener("pause",()=>{var e;(e=this.eventListenerDisposer)==null||e.call(this)},{once:!0}),this.audioInstance.pause())}dispose(){this.clear(),this.audioInstance=void 0}clear(){var e;(e=this.audioInstance)==null||e.clear()}addEventListeners(){const e=this.audioInstance;if(!e)return;const n=d=>{var f;this.sharedAudioCurrentTime=e.currentTime,(f=this.ontimeupdate)==null||f.call(this,d)},o=d=>{var f;return(f=this.onplay)==null?void 0:f.call(this,d)},s=d=>{var f;(f=this.onpause)==null||f.call(this,d),this.clear()},r=d=>{var f;(f=this.onended)==null||f.call(this,d),this.sharedAudioCurrentTime=0},a=d=>{var f;return(f=this.onerror)==null?void 0:f.call(this,d)},l=d=>{var f;return(f=this.oncanplay)==null?void 0:f.call(this,d)},c=d=>{var f;return(f=this.oncanplaythrough)==null?void 0:f.call(this,d)},u=d=>{var f;return(f=this.onloadeddata)==null?void 0:f.call(this,d)},h=d=>{var f;return(f=this.onloadedmetadata)==null?void 0:f.call(this,d)};return e.addEventListener("timeupdate",n),e.addEventListener("play",o),e.addEventListener("pause",s),e.addEventListener("ended",r),e.addEventListener("error",a),e.addEventListener("canplay",l),e.addEventListener("canplaythrough",c),e.addEventListener("loadeddata",u),e.addEventListener("loadedmetadata",h),()=>{e.removeEventListener("timeupdate",n),e.removeEventListener("play",o),e.removeEventListener("pause",s),e.removeEventListener("ended",r),e.removeEventListener("error",a),e.removeEventListener("canplay",l),e.removeEventListener("canplaythrough",c),e.removeEventListener("loadeddata",u),e.removeEventListener("loadedmetadata",h)}}}function cA(i){le(i,"svelte-13e7hxv",".audio.svelte-13e7hxv{pointer-events:auto;cursor:pointer;width:100%;height:100%}")}function uA(i){let t,e,n,o;const s=i[8].default,r=$t(s,i,i[7],null);return{c(){t=z("div"),r&&r.c(),b(t,"class","audio svelte-13e7hxv"),b(t,"style",i[0])},m(a,l){T(a,t,l),r&&r.m(t,null),e=!0,n||(o=we(t,"click",va(i[1])),n=!0)},p(a,[l]){r&&r.p&&(!e||l&128)&&tn(r,s,a,a[7],e?en(s,a[7],l,null):nn(a[7]),null),(!e||l&1)&&b(t,"style",a[0])},i(a){e||(P(r,a),e=!0)},o(a){D(r,a),e=!1},d(a){a&&M(t),r&&r.d(a),n=!1,o()}}}function dA(i,t,e){let{$$slots:n={},$$scope:o}=t,{url:s}=t,{enable:r=!0}=t,{style:a=""}=t,{hooksInfo:l}=t;const c=wn(),u=Tt("hooks"),h=Tt("mediaStore");let d,f=!0;function p(){e(5,d.onplay=g=>{u.emit("playStateChange",H({event:g,state:"playing",mediaInstance:d},l)),c("play"),e(6,f=!1)},d),e(5,d.onpause=g=>{u.emit("playStateChange",H({event:g,state:"paused",mediaInstance:d},l)),c("pause"),e(6,f=!0)},d),e(5,d.onloadedmetadata=g=>{typeof d.duration=="number"&&!Number.isNaN(d.duration)&&c("duration",d.duration)},d),e(5,d.ontimeupdate=g=>{c("timeupdate",d.currentTime)},d)}h.subscribe(({currentMediaElement:g})=>{g!==d&&(f||d==null||d.pause())});function v(g){!d||(u.emit("click",H({event:g,target:"AudioTagPlayIcon",audioInstance:d},l)),h.set({currentMediaElement:d}),u.emit("playStateChange",H({event:g,state:d.paused?"playing":"paused",mediaInstance:d},l)),d.paused?d.play():d.pause())}return i.$$set=g=>{"url"in g&&e(2,s=g.url),"enable"in g&&e(3,r=g.enable),"style"in g&&e(0,a=g.style),"hooksInfo"in g&&e(4,l=g.hooksInfo),"$$scope"in g&&e(7,o=g.$$scope)},i.$$.update=()=>{i.$$.dirty&4&&(s||c("duration",0)),i.$$.dirty&36&&(d==null||d.dispose(),e(5,d=new lA(s)),c("audioRef",d),setTimeout(()=>c("audioRef",d),200),rA(s).then(g=>c("duration",g)),p()),i.$$.dirty&40&&(r||d==null||d.pause()),i.$$.dirty&72&&c(r&&!f?"play":"pause")},[a,v,s,r,l,d,f,o,n]}class yl extends se{constructor(t){super(),oe(this,t,dA,uA,ie,{url:2,enable:3,style:0,hooksInfo:4},cA)}}function hA(i){le(i,"svelte-srt2pi",".audio-icon__wrapper.svelte-srt2pi.svelte-srt2pi{display:inline-block}.audio-icon.svelte-srt2pi.svelte-srt2pi{display:flex;justify-content:center;align-items:center;position:relative;width:100%;height:100%;border-radius:50%;background-color:rgba(255, 255, 255, 0.8)}.audio-icon.svelte-srt2pi .sound-wave__container.svelte-srt2pi{position:absolute;pointer-events:none;width:60%;height:60%}.sound-wave.svelte-srt2pi.svelte-srt2pi{animation-duration:2s;animation-iteration-count:infinite;animation-play-state:paused;transition:opacity 0}.playing.svelte-srt2pi .sound-wave.svelte-srt2pi{animation-play-state:running}.playing.svelte-srt2pi .sound-wave-1.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_1_animation}.playing.svelte-srt2pi .sound-wave-2.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_2_animation}.playing.svelte-srt2pi .sound-wave-3.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_3_animation}@keyframes svelte-srt2pi-sound_wave_1_animation{0%,10%{opacity:0}25%,100%{opacity:1}}@keyframes svelte-srt2pi-sound_wave_2_animation{0%,35%{opacity:0}50%,100%{opacity:1}}@keyframes svelte-srt2pi-sound_wave_3_animation{0%,60%{opacity:0}75%,100%{opacity:1}}")}function Wr(i){let t,e;return t=new nt({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function fA(i){let t,e,n,o,s,r=i[1]&&Wr();return{c(){t=z("div"),r&&r.c(),e=ne(),n=z("div"),o=z("div"),o.innerHTML='<svg width="100%" height="100%" viewBox="0 0 128 128"><g transform="rotate(-45 12 64) translate(12 64)" fill="black" stroke="black" fill-opacity="0.6" stroke-opacity="0.6"><path stroke="none" class="sound-wave sound-wave-1 svelte-srt2pi" d="M0,23 A23,23 0 0,0 23,0 L0,0"></path><path fill="none" stroke-width="15" class="sound-wave sound-wave-2 svelte-srt2pi" d="M0,46 A46,46 0 0,0 46,0"></path><path fill="none" stroke-width="15" class="sound-wave sound-wave-3 svelte-srt2pi" d="M0,80 A80,80 0 0,0 80,0"></path></g></svg>',b(o,"class","sound-wave__container svelte-srt2pi"),b(n,"class","audio-icon svelte-srt2pi"),Z(n,"playing",i[0]),b(t,"class","audio-icon__wrapper svelte-srt2pi"),b(t,"style",i[2]),L(t,"width",i[5]),L(t,"height",i[5])},m(a,l){T(a,t,l),r&&r.m(t,null),R(t,e),R(t,n),R(n,o),i[7](o),i[8](t),s=!0},p(a,[l]){a[1]?r?l&2&&P(r,1):(r=Wr(),r.c(),P(r,1),r.m(t,e)):r&&(re(),D(r,1,1,()=>{r=null}),ae()),(!s||l&1)&&Z(n,"playing",a[0]),(!s||l&4)&&b(t,"style",a[2]),l&32&&L(t,"width",a[5]),l&32&&L(t,"height",a[5])},i(a){s||(P(r),s=!0)},o(a){D(r),s=!1},d(a){a&&M(t),r&&r.d(),i[7](null),i[8](null)}}}function mA(i,t,e){let n,{playing:o}=t,{shadow:s=!1}=t,{style:r=null}=t,{width:a="100%"}=t,l,c;function u(d){Be[d?"unshift":"push"](()=>{c=d,e(4,c)})}function h(d){Be[d?"unshift":"push"](()=>{l=d,e(3,l)})}return i.$$set=d=>{"playing"in d&&e(0,o=d.playing),"shadow"in d&&e(1,s=d.shadow),"style"in d&&e(2,r=d.style),"width"in d&&e(6,a=d.width)},i.$$.update=()=>{i.$$.dirty&64&&e(5,n=typeof a=="number"?Ie(a):a)},[o,s,r,l,c,n,a,u,h]}class wl extends se{constructor(t){super(),oe(this,t,mA,fA,ie,{playing:0,shadow:1,style:2,width:6},hA)}}function pA(i){le(i,"svelte-1s6gk4a",".audio-tag.svelte-1s6gk4a{position:absolute;left:0;top:0;width:0;height:0;overflow:visible}.audio-icon__wrapper.svelte-1s6gk4a{position:relative;vertical-align:top;width:100%;height:100%}.content.svelte-1s6gk4a{width:-moz-max-content;width:max-content;height:3.375rem;padding:2.25rem 0.25rem 0 1rem;position:absolute;left:0;bottom:0.125rem;overflow:hidden;box-sizing:border-box;font-size:0;white-space:nowrap;font-weight:600}.wrapper.svelte-1s6gk4a{position:relative;width:100%;height:100%}.audio-icon.svelte-1s6gk4a{pointer-events:none;vertical-align:top;display:inline-block;width:1rem;height:1rem;margin-right:0.25rem;margin-top:0.0625rem}.audio.svelte-1s6gk4a{position:relative;width:100%;height:100%}")}function Nr(i){var A,y;let t,e,n,o,s,r,a,l,c,u,h,d,f,p,v;e=new nt({props:{visible:i[6],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}});let g=i[6]&&_r(i);return c=new cl({props:{visible:i[6],textUnfolded:i[1],content:i[5]}}),d=new go({props:{unfolded:i[6],length:i[3],outDelay:i[4]+20*Math.min((y=(A=i[5])==null?void 0:A.length)!=null?y:10,15),useLinearColor:!0}}),{c(){t=z("div"),$(e.$$.fragment),n=ne(),o=z("div"),s=z("div"),r=z("div"),g&&g.c(),a=ne(),l=z("div"),$(c.$$.fragment),h=ne(),$(d.$$.fragment),b(r,"class","audio-icon svelte-1s6gk4a"),Me(()=>i[11].call(l)),L(l,"display","inline-block"),b(s,"class","wrapper svelte-1s6gk4a"),b(o,"class","content svelte-1s6gk4a"),b(t,"class","audio-tag svelte-1s6gk4a"),Z(t,"unfolded",i[6])},m(w,C){T(w,t,C),q(e,t,null),R(t,n),R(t,o),R(o,s),R(s,r),g&&g.m(r,null),R(s,a),R(s,l),q(c,l,null),u=Pt(l,i[11].bind(l)),R(t,h),q(d,t,null),f=!0,p||(v=we(l,"click",i[7]),p=!0)},p(w,C){var k,j;const x={};C&64&&(x.visible=w[6]),C&8&&(x.left=w[3]/2+"px"),e.$set(x),w[6]?g?(g.p(w,C),C&64&&P(g,1)):(g=_r(w),g.c(),P(g,1),g.m(r,null)):g&&(re(),D(g,1,1,()=>{g=null}),ae());const I={};C&64&&(I.visible=w[6]),C&2&&(I.textUnfolded=w[1]),C&32&&(I.content=w[5]),c.$set(I);const S={};C&64&&(S.unfolded=w[6]),C&8&&(S.length=w[3]),C&48&&(S.outDelay=w[4]+20*Math.min((j=(k=w[5])==null?void 0:k.length)!=null?j:10,15)),d.$set(S),(!f||C&64)&&Z(t,"unfolded",w[6])},i(w){f||(P(e.$$.fragment,w),P(g),P(c.$$.fragment,w),P(d.$$.fragment,w),f=!0)},o(w){D(e.$$.fragment,w),D(g),D(c.$$.fragment,w),D(d.$$.fragment,w),f=!1},d(w){w&&M(t),K(e),g&&g.d(),K(c),u(),K(d),p=!1,v()}}}function _r(i){let t,e,n,o,s,r,a;return e=new nt({props:{center:!0,blurRadius:15,spreadRadius:6}}),o=new yl({props:{enable:i[6],url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[gA]},$$scope:{ctx:i}}}),o.$on("play",i[8]),o.$on("pause",i[9]),o.$on("audioRef",i[10]),{c(){t=z("div"),$(e.$$.fragment),n=ne(),$(o.$$.fragment),b(t,"class","audio svelte-1s6gk4a")},m(l,c){T(l,t,c),q(e,t,null),R(t,n),q(o,t,null),a=!0},p(l,c){i=l;const u={};c&64&&(u.enable=i[6]),c&1&&(u.url=i[0].data.audioUrl),c&1&&(u.hooksInfo={tag:i[0]}),c&4100&&(u.$$scope={dirty:c,ctx:i}),o.$set(u)},i(l){a||(P(e.$$.fragment,l),P(o.$$.fragment,l),l&&Me(()=>{r&&r.end(1),s=Bt(t,zt,{duration:1e3,delay:0,easing:Xt}),s.start()}),a=!0)},o(l){var c,u;D(e.$$.fragment,l),D(o.$$.fragment,l),s&&s.invalidate(),l&&(r=on(t,zt,{duration:1e3,delay:20*Math.min((u=(c=i[5])==null?void 0:c.length)!=null?u:10,15),easing:Xt})),a=!1},d(l){l&&M(t),K(e),K(o),l&&r&&r.end()}}}function gA(i){let t,e,n;return e=new wl({props:{playing:i[2]}}),{c(){t=z("div"),$(e.$$.fragment),b(t,"class","audio-icon__wrapper svelte-1s6gk4a")},m(o,s){T(o,t,s),q(e,t,null),n=!0},p(o,s){const r={};s&4&&(r.playing=o[2]),e.$set(r)},i(o){n||(P(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),K(e)}}}function AA(i){let t,e,n=i[0].state&&Nr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&P(n,1)):(n=Nr(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(re(),D(n,1,1,()=>{n=null}),ae())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function vA(i,t,e){let n,o,s,{tag:r}=t,a=!1,l=!1,c;function u(){e(1,a=!a)}const h=()=>{e(2,l=!0)},d=()=>{e(2,l=!1)};function f(v){Cn.call(this,i,v)}function p(){c=this.clientWidth,e(3,c)}return i.$$set=v=>{"tag"in v&&e(0,r=v.tag)},i.$$.update=()=>{var v,g,A;i.$$.dirty&1&&e(6,n=!!((v=r.state)!=null&&v.unfolded)),i.$$.dirty&1&&e(5,o=(A=(g=r.data.title)!=null?g:r.data.text)!=null?A:""),i.$$.dirty&2&&e(4,s=a?450:0)},[r,a,l,c,s,o,n,u,h,d,f,p]}class bA extends se{constructor(t){super(),oe(this,t,vA,AA,ie,{tag:0},pA)}}function yA(i){const t=document.createElement("div");t.style.color=i,document.body.appendChild(t);const e=window.getComputedStyle(t).color;t.remove();const n=(()=>e.search("rgba")===-1?e.replace("rgb","rgba").replace(")",", 1)"):e)(),o=n.replace("rgba","").replace("(","").replace(")","").split(",").map(s=>Number(s.trim()));return{rgba:n,r:o[0],g:o[1],b:o[2],a:o[3]}}function wA(i){le(i,"svelte-58hfjf",".audio-tag__wrapper.svelte-58hfjf{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.audio-tag.svelte-58hfjf{position:relative;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;padding:0.1875rem;padding-right:0.625rem;border-radius:624999.9375rem;border:0.03125rem solid rgba(255, 255, 255, 0.2)}.audio__inner.svelte-58hfjf{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.text.svelte-58hfjf{font-weight:bold;font-size:0.75rem;margin-left:0.25rem}.audio-icon__wrapper.svelte-58hfjf{position:relative;vertical-align:top;pointer-events:none;width:1.375rem;height:1.375rem}")}function Xr(i){let t,e,n,o;return n=new yl({props:{style:"width: max-content; height: max-content;",enable:i[0].state.visible,url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[PA]},$$scope:{ctx:i}}}),n.$on("play",i[7]),n.$on("pause",i[8]),n.$on("timeupdate",i[9]),n.$on("duration",i[10]),n.$on("audioRef",i[11]),{c(){t=z("div"),e=z("div"),$(n.$$.fragment),b(e,"class","audio-tag svelte-58hfjf"),L(e,"background-color",i[1]),L(e,"color",i[5]),b(t,"class","audio-tag__wrapper svelte-58hfjf")},m(s,r){T(s,t,r),R(t,e),q(n,e,null),o=!0},p(s,r){const a={};r&1&&(a.enable=s[0].state.visible),r&1&&(a.url=s[0].data.audioUrl),r&1&&(a.hooksInfo={tag:s[0]}),r&8260&&(a.$$scope={dirty:r,ctx:s}),n.$set(a),r&2&&L(e,"background-color",s[1]),r&32&&L(e,"color",s[5])},i(s){o||(P(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&M(t),K(n)}}}function CA(i){let t;return{c(){t=ke(i[6])},m(e,n){T(e,t,n)},p(e,n){n&64&&Se(t,e[6])},d(e){e&&M(t)}}}function PA(i){let t,e,n,o,s,r,a;return n=new wl({props:{playing:i[2]}}),r=new Ao({props:{maxWidth:72,$$slots:{default:[CA]},$$scope:{ctx:i}}}),{c(){t=z("div"),e=z("div"),$(n.$$.fragment),o=ne(),s=z("div"),$(r.$$.fragment),b(e,"class","audio-icon__wrapper svelte-58hfjf"),b(s,"class","text svelte-58hfjf"),b(t,"class","audio__inner svelte-58hfjf")},m(l,c){T(l,t,c),R(t,e),q(n,e,null),R(t,o),R(t,s),q(r,s,null),a=!0},p(l,c){const u={};c&4&&(u.playing=l[2]),n.$set(u);const h={};c&8256&&(h.$$scope={dirty:c,ctx:l}),r.$set(h)},i(l){a||(P(n.$$.fragment,l),P(r.$$.fragment,l),a=!0)},o(l){D(n.$$.fragment,l),D(r.$$.fragment,l),a=!1},d(l){l&&M(t),K(n),K(r)}}}function EA(i){let t,e,n=i[0].state&&Xr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&P(n,1)):(n=Xr(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(re(),D(n,1,1,()=>{n=null}),ae())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function IA(i,t,e){let n,o,s,{tag:r}=t;wn();let a=!1,l=0,c=0;const u=()=>{e(2,a=!0)},h=()=>{e(2,a=!1)},d=v=>{e(3,l=v.detail)},f=v=>{e(4,c=v.detail)};function p(v){Cn.call(this,i,v)}return i.$$set=v=>{"tag"in v&&e(0,r=v.tag)},i.$$.update=()=>{var v,g;i.$$.dirty&1&&e(6,n=(g=(v=r.data.title)!=null?v:r.data.text)!=null?g:""),i.$$.dirty&1&&e(1,o=(()=>{var A;return r.data.backgroundColor==="dark"?"rgba(0, 0, 0, 0.3)":r.data.backgroundColor==="light"?"rgba(255, 255, 255, 0.3)":(A=r.data.backgroundColor)!=null?A:"rgba(0, 0, 0, 0.3)"})()),i.$$.dirty&2&&e(5,s=(()=>{const{r:A,g:y,b:w}=yA(o);return(A*299+y*587+w*114)/1e3>=128?"rgba(0, 0, 0, 0.6)":"white"})())},[r,o,a,l,c,s,n,u,h,d,f,p]}class kA extends se{constructor(t){super(),oe(this,t,IA,EA,ie,{tag:0},wA)}}function xA(i){let t,e;return t=new kA({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function DA(i){let t,e;return t=new bA({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function LA(i){let t,e,n,o;const s=[DA,xA],r=[];function a(l,c){return l[1]==="line"?0:l[1]==="plane"?1:-1}return~(t=a(i))&&(e=r[t]=s[t](i)),{c(){e&&e.c(),n=fe()},m(l,c){~t&&r[t].m(l,c),T(l,n,c),o=!0},p(l,[c]){let u=t;t=a(l),t===u?~t&&r[t].p(l,c):(e&&(re(),D(r[u],1,1,()=>{r[u]=null}),ae()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),P(e,1),e.m(n.parentNode,n)):e=null)},i(l){o||(P(e),o=!0)},o(l){D(e),o=!1},d(l){~t&&r[t].d(l),l&&M(n)}}}function SA(i,t,e){let n,{tag:o}=t,s;function r(a){s=a.detail}return o.play=()=>s.play(),o.pause=()=>s.pause(),i.$$set=a=>{"tag"in a&&e(0,o=a.tag)},i.$$.update=()=>{var a;i.$$.dirty&1&&e(1,n=(a=o.data.appearance)!=null?a:"line")},[o,n,r]}class MA extends se{constructor(t){super(),oe(this,t,SA,LA,ie,{tag:0})}}function TA(i){le(i,"svelte-10cw0el",".media-wrapper.svelte-10cw0el{position:absolute;width:100%;height:100%}")}function Yr(i){var o;let t,e,n;return e=new ml({props:{mediaItemConfig:{canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(o=i[4])!=null?o:"withText",disableVideoIfHavePoster:!1,objectFit:i[2]},unfolded:i[6],mediaData:i[5],enableCarousel:i[1],autoplayConfig:i[3],tag:i[0],inDelay:500,duration:500}}),{c(){t=z("div"),$(e.$$.fragment),b(t,"class","media-wrapper svelte-10cw0el")},m(s,r){T(s,t,r),q(e,t,null),n=!0},p(s,r){var l;const a={};r&20&&(a.mediaItemConfig={canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(l=s[4])!=null?l:"withText",disableVideoIfHavePoster:!1,objectFit:s[2]}),r&64&&(a.unfolded=s[6]),r&32&&(a.mediaData=s[5]),r&2&&(a.enableCarousel=s[1]),r&8&&(a.autoplayConfig=s[3]),r&1&&(a.tag=s[0]),e.$set(a)},i(s){n||(P(e.$$.fragment,s),n=!0)},o(s){D(e.$$.fragment,s),n=!1},d(s){s&&M(t),K(e)}}}function zA(i){let t,e,n=i[0].state&&i[5]&&Yr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[0].state&&o[5]?n?(n.p(o,s),s&33&&P(n,1)):(n=Yr(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(re(),D(n,1,1,()=>{n=null}),ae())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function BA(i,t,e){let n,o,s,r,a,l,{tag:c}=t;return i.$$set=u=>{"tag"in u&&e(0,c=u.tag)},i.$$.update=()=>{var u,h;i.$$.dirty&1&&e(6,n=c.state?c.state.unfolded:!1),i.$$.dirty&1&&e(5,o=c.data.mediaData),i.$$.dirty&1&&e(1,s=c.data.enableCarousel),i.$$.dirty&1&&e(4,r=c.data.playIcon),i.$$.dirty&3&&e(3,a=(u=c.data.autoplayConfig)!=null?u:{autoplay:s!=null?s:!0,autoplayVideo:!0}),i.$$.dirty&1&&e(2,l=(h=c.data.objectFit)!=null?h:(()=>c.data.adaptationMode==="stretch"?"fill":c.data.adaptationMode==="proportional"?"contain":void 0)())},[c,s,l,a,r,o,n]}class jA extends se{constructor(t){super(),oe(this,t,BA,zA,ie,{tag:0},TA)}}function VA(i){return N(this,null,function*(){return new Promise((t,e)=>{if(!i){e(Error("url is empty"));return}const n=new Image;n.src=i,n.onload=()=>t({width:n.width,height:n.height}),n.onerror=e})})}function RA(i){return N(this,null,function*(){const{steps:t,url:e,ratio:n=3,fps:o=24}=i;if(!t)throw new Error("KeyframeIcon requires steps");const{width:s,height:r}=yield VA(e),a=s/n,l=r/n,c=a/t,u=l,h=1/o*t+"s",d=a/t-a;return{url:e,keyframesWidth:a,keyframesHeight:l,wrapperWidth:c,wrapperHeight:u,steps:t,duration:h,offsetX:d,offsetY:0}})}function QA(i){le(i,"svelte-mhs8j5","@keyframes svelte-mhs8j5-sprites-animation{0%{background-position:0 0}100%{background-position:var(--keyframe_offset_x) 0}}.icon-image.svelte-mhs8j5{display:block;width:100%}.icon-keyframe-container.svelte-mhs8j5{overflow:hidden}.icon-keyframe-wrapper.svelte-mhs8j5{transform-origin:0 0}.icon-keyframe.svelte-mhs8j5{background-repeat:no-repeat;animation-direction:normal;animation-iteration-count:infinite;animation-name:svelte-mhs8j5-sprites-animation}")}function Ur(i){i[6]=i[14].url,i[7]=i[14].keyframesWidth,i[8]=i[14].keyframesHeight,i[9]=i[14].wrapperWidth,i[10]=i[14].wrapperHeight,i[11]=i[14].steps,i[12]=i[14].duration,i[13]=i[14].offsetX}function Jr(i){let t,e,n,o=i[2]&&Zr();function s(l,c){return l[3]?HA:OA}let r=s(i),a=r(i);return{c(){t=z("div"),o&&o.c(),e=ne(),a.c(),b(t,"class","icon"),L(t,"width",typeof i[0]=="number"?Ie(i[0]):i[0])},m(l,c){T(l,t,c),o&&o.m(t,null),R(t,e),a.m(t,null),n=!0},p(l,c){l[2]?o?c&4&&P(o,1):(o=Zr(),o.c(),P(o,1),o.m(t,e)):o&&(re(),D(o,1,1,()=>{o=null}),ae()),r===(r=s(l))&&a?a.p(l,c):(a.d(1),a=r(l),a&&(a.c(),a.m(t,null))),c&1&&L(t,"width",typeof l[0]=="number"?Ie(l[0]):l[0])},i(l){n||(P(o),n=!0)},o(l){D(o),n=!1},d(l){l&&M(t),o&&o.d(),a.d()}}}function Zr(i){let t,e;return t=new nt({props:{center:!0,blurRadius:24,spreadRadius:16}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function OA(i){let t,e;return{c(){t=z("img"),b(t,"class","icon-image svelte-mhs8j5"),_e(t.src,e=i[1].url)||b(t,"src",e),b(t,"alt","icon")},m(n,o){T(n,t,o)},p(n,o){o&2&&!_e(t.src,e=n[1].url)&&b(t,"src",e)},d(n){n&&M(t)}}}function HA(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:WA,then:GA,catch:FA,value:14};return zo(e=i[4](i[1]),n),{c(){t=fe(),n.block.c()},m(o,s){T(o,t,s),n.block.m(o,n.anchor=s),n.mount=()=>t.parentNode,n.anchor=t},p(o,s){i=o,n.ctx=i,s&2&&e!==(e=i[4](i[1]))&&zo(e,n)||Qc(n,i,s)},d(o){o&&M(t),n.block.d(o),n.token=null,n=null}}}function FA(i){return{c:Y,m:Y,p:Y,d:Y}}function GA(i){Ur(i);let t,e,n,o=`url(${i[6]})`,s=`steps(${i[11]-1})`;return{c(){t=z("div"),e=z("div"),n=z("div"),b(n,"class","icon-keyframe svelte-mhs8j5"),L(n,"width",Ie(i[7])),L(n,"height",Ie(i[8])),L(n,"background-image",o),L(n,"animation-duration",i[12]),L(n,"animation-timing-function",s),L(n,"animation-delay",0),L(n,"background-size","100% 100%"),L(n,"--keyframe_offset_x",Ie(i[13])),b(e,"class","icon-keyframe-wrapper svelte-mhs8j5"),L(e,"transform",typeof i[0]=="number"?`scale(${i[0]/i[9]})`:void 0),b(t,"class","icon-keyframe-container svelte-mhs8j5"),L(t,"width",typeof i[0]=="number"?Ie(i[0]):Ie(i[9])),L(t,"height",typeof i[0]=="number"?Ie(i[10]*(i[0]/i[9])):Ie(i[10]))},m(r,a){T(r,t,a),R(t,e),R(e,n)},p(r,a){Ur(r),a&2&&L(n,"width",Ie(r[7])),a&2&&L(n,"height",Ie(r[8])),a&2&&o!==(o=`url(${r[6]})`)&&L(n,"background-image",o),a&2&&L(n,"animation-duration",r[12]),a&2&&s!==(s=`steps(${r[11]-1})`)&&L(n,"animation-timing-function",s),a&2&&L(n,"--keyframe_offset_x",Ie(r[13])),a&3&&L(e,"transform",typeof r[0]=="number"?`scale(${r[0]/r[9]})`:void 0),a&3&&L(t,"width",typeof r[0]=="number"?Ie(r[0]):Ie(r[9])),a&3&&L(t,"height",typeof r[0]=="number"?Ie(r[10]*(r[0]/r[9])):Ie(r[10]))},d(r){r&&M(t)}}}function WA(i){return{c:Y,m:Y,p:Y,d:Y}}function NA(i){let t,e,n=i[1]&&Jr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&P(n,1)):(n=Jr(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(re(),D(n,1,1,()=>{n=null}),ae())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function _A(i,t,e){let n,{width:o=null}=t,{icon:s=null}=t,{shadow:r=!1}=t;const a=wn();function l(c){return N(this,null,function*(){const u=yield RA(c);return a("iconLoaded"),u})}return i.$$set=c=>{"width"in c&&e(0,o=c.width),"icon"in c&&e(1,s=c.icon),"shadow"in c&&e(2,r=c.shadow)},i.$$.update=()=>{i.$$.dirty&2&&e(3,n=(s==null?void 0:s.steps)>=2),i.$$.dirty&8&&!n&&a("iconLoaded")},[o,s,r,n,l]}class Cl extends se{constructor(t){super(),oe(this,t,_A,NA,ie,{width:0,icon:1,shadow:2},QA)}}function XA(i){le(i,"svelte-e58ijk",".wrapper.svelte-e58ijk{font-weight:600;cursor:pointer;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);display:flex;align-items:center;justify-content:center;flex-direction:column;pointer-events:auto}.text-wrapper.svelte-e58ijk{position:relative;display:flex;align-items:center;justify-content:center}.text.svelte-e58ijk{position:absolute;top:0;font-size:0.875rem;color:#ffffff;letter-spacing:0;text-align:center;max-width:8.75rem;width:-moz-max-content;width:max-content;line-height:1.125rem;text-shadow:0.125rem 0rem 0.5rem rgba(0, 0, 0, 0.15)}")}function qr(i){let t,e,n,o,s,r;return e=new nt({props:{outDelay:0,inDelay:0,center:!0,width:"80%",blurRadius:40,spreadRadius:16,opacity:.08}}),{c(){t=z("div"),$(e.$$.fragment),n=ne(),o=z("div"),s=ke(i[1]),b(o,"class","text svelte-e58ijk"),b(t,"class","text-wrapper svelte-e58ijk")},m(a,l){T(a,t,l),q(e,t,null),R(t,n),R(t,o),R(o,s),r=!0},p(a,l){(!r||l&2)&&Se(s,a[1])},i(a){r||(P(e.$$.fragment,a),r=!0)},o(a){D(e.$$.fragment,a),r=!1},d(a){a&&M(t),K(e)}}}function YA(i){let t,e,n,o;e=new Cl({props:{icon:i[0],shadow:!0}}),e.$on("iconLoaded",i[9]);let s=i[1]&&i[2]&&qr(i);return{c(){t=z("div"),$(e.$$.fragment),n=ne(),s&&s.c(),b(t,"class","wrapper svelte-e58ijk")},m(r,a){T(r,t,a),q(e,t,null),R(t,n),s&&s.m(t,null),o=!0},p(r,[a]){const l={};a&1&&(l.icon=r[0]),e.$set(l),r[1]&&r[2]?s?(s.p(r,a),a&6&&P(s,1)):(s=qr(r),s.c(),P(s,1),s.m(t,null)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(r){o||(P(e.$$.fragment,r),P(s),o=!0)},o(r){D(e.$$.fragment,r),D(s),o=!1},d(r){r&&M(t),K(e),s&&s.d()}}}function UA(i,t,e){let n,o,s,r,a,l,c,u,{tag:h}=t;const d=()=>{e(2,n=!0)};return i.$$set=f=>{"tag"in f&&e(3,h=f.tag)},i.$$.update=()=>{var f,p;i.$$.dirty&8&&e(1,o=(f=h.data.title)!=null?f:h.data.text),i.$$.dirty&8&&e(8,s=(p=h.data.icon)!=null?p:h.style.point),i.$$.dirty&256&&e(7,r=s.url),i.$$.dirty&256&&e(6,a=s.steps),i.$$.dirty&256&&e(5,l=s.fps),i.$$.dirty&256&&e(4,c=s.ratio),i.$$.dirty&240&&e(0,u={url:r,steps:a,fps:l,ratio:c})},e(2,n=!1),[u,o,n,h,c,l,a,r,s,d]}class JA extends se{constructor(t){super(),oe(this,t,UA,YA,ie,{tag:3},XA)}}function ZA(i){le(i,"svelte-kzl2aj",".customElement__container.svelte-kzl2aj{position:relative}")}function Kr(i){let t,e=i[0].element+"",n;return{c(){t=new Zn(!1),n=fe(),t.a=n},m(o,s){t.m(e,o,s),T(o,n,s)},p(o,s){s&1&&e!==(e=o[0].element+"")&&t.p(e)},d(o){o&&M(n),o&&t.d()}}}function qA(i){let t,e=typeof i[0].element=="string"&&Kr(i);return{c(){t=z("div"),e&&e.c(),b(t,"class","customElement__container svelte-kzl2aj")},m(n,o){T(n,t,o),e&&e.m(t,null),i[2](t)},p(n,[o]){typeof n[0].element=="string"?e?e.p(n,o):(e=Kr(n),e.c(),e.m(t,null)):e&&(e.d(1),e=null)},i:Y,o:Y,d(n){n&&M(t),e&&e.d(),i[2](null)}}}function KA(i,t,e){let{tag:n}=t,o,s;Je(()=>{if(o){if(n.element instanceof Element){const a=n.element;o.appendChild(a),s=()=>a.remove()}else if(typeof n.element=="function"){const a=n.element;s=a(o)}}}),It(()=>{s==null||s()});function r(a){Be[a?"unshift":"push"](()=>{o=a,e(1,o)})}return i.$$set=a=>{"tag"in a&&e(0,n=a.tag)},[n,o,r]}class $A extends se{constructor(t){super(),oe(this,t,KA,qA,ie,{tag:0},ZA)}}function ev(i){le(i,"svelte-1pomljv",'@font-face{font-family:"TG-TYPE";font-style:normal;font-weight:400;src:local("TG-TYPE-Bold"), url(data:application/font-woff2;charset=utf-8;base64,T1RUTwAKAIAAAwAgQ0ZGINFD4CEAAAaQAAAHC0dTVUIAAQAAAAANnAAAAApPUy8yaB5pEwAAAjQAAABgY21hcEItjGUAAAT0AAABfGhlYWQS1WWOAAAAtAAAADZoaGVhBfMBxwAAAhAAAAAkaG10eJ9gBO8AAADsAAABJG1heHAASVAAAAAArAAAAAZuYW1lqczkZQAAApQAAAJecG9zdP+4ADIAAAZwAAAAIAAAUAAASQAAAAEAAAABAADkeHeyXw889QADA+gAAAAA2NoRKwAAAADY2hErACn/OAHgAyAAAQADAAIAAAAAAAAB9ABdAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACCAA7AcwAdwIIADMCCAA0AhwAMwISADkCCAAuAfQANAH+ACsB/gApAggANAEeAFABHgBQAR4AUAIIADQCCAAuAR4AUAEeAFABfAAxAAEAAAPo/zgAAAIcACkAKQHgAAEAAAAAAAAAAAAAAAAAAABJAAMCLgGQAAUACAKKAlgAAABLAooCWAAAAV4AMgEsAAAAAAgAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFVLV04AIAAg/xsDIP84AMgD6ADIAAAAAQAAAAAB9AK8AAAAIAAAAAAAEADGAAEAAAAAAAEADAAAAAEAAAAAAAIABAAMAAEAAAAAAAMAGwAQAAEAAAAAAAQAEQArAAEAAAAAAAUAPAA8AAEAAAAAAAYAEAB4AAEAAAAAAAgADAAAAAEAAAAAAAkADAAAAAMAAQQJAAEAGACIAAMAAQQJAAIACACgAAMAAQQJAAMANgCoAAMAAQQJAAQAIgDeAAMAAQQJAAUAeAEAAAMAAQQJAAYAIAF4AAMAAQQJAAgAGACIAAMAAQQJAAkAGACIQUxJQkFCQSBGb250Qm9sZDEuMDAwO1VLV047QUxJQkFCQUZvbnQtQm9sZEFMSUJBQkEgRm9udCBCb2xkVmVyc2lvbiAxLjAwMDtQUyAwMDEuMDAwO2hvdGNvbnYgMS4wLjg4O21ha2VvdGYubGliMi41LjY0Nzc1QUxJQkFCQUZvbnQtQm9sZABBAEwASQBCAEEAQgBBACAARgBvAG4AdABCAG8AbABkADEALgAwADAAMAA7AFUASwBXAE4AOwBBAEwASQBCAEEAQgBBAEYAbwBuAHQALQBCAG8AbABkAEEATABJAEIAQQBCAEEAIABGAG8AbgB0ACAAQgBvAGwAZABWAGUAcgBzAGkAbwBuACAAMQAuADAAMAAwADsAUABTACAAMAAwADEALgAwADAAMAA7AGgAbwB0AGMAbwBuAHYAIAAxAC4AMAAuADgAOAA7AG0AYQBrAGUAbwB0AGYALgBsAGkAYgAyAC4ANQAuADYANAA3ADcANQBBAEwASQBCAEEAQgBBAEYAbwBuAHQALQBCAG8AbABkAAAAAAADAAAAAwAAASIAAQAAAAAAHAADAAEAAAEiAAABBgAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAABCSEMANjc4OTo7PD0+PwAAAAAAAAACAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGwAAAAAAABwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAFoAAAAQABAAAwAAACAALgA5AFoAegCl/xv//wAAACAALAAwAEEAYQCl/xr////hAAAABv/B/7v/nwAAAAEAAAAOAAAAAAAAAAAACgAAAEIASABDAEYARwADAAAAAAAA/7UAMgAAAAAAAAAAAAAAAAAAAAAAAAAAAQAEAgABAQERQUxJQkFCQUZvbnQtQm9sZAABAQEg+A8A+CAB+CEC+BgEtPtc+HT5tAX3KA/3UBGcHAZWEgAHAQENExoiKTpLbmluZS4wMDEuMDAxbW9uZXkudW5pRkYxQm5pbmUuMDAxdW5pRkYxQWNvcHlyaWdodCBtaXNzaW5nQUxJQkFCQSBGb250IEJvbGQAAAEAAQAAIhkAQhkAEQkBhwABigAADQAADwAAZAABiAABiwABiQAADgAASQIAAQCtAK4ArwCwALEAsgCzALQAtQC2ALcAuAC5ALoAuwC8AL0AvgC/AMAAwQDCAMMAxADFAMYAxwDIAMkAygDLAMwAzQDOAM8A0ADRANIA0wDUANUA1gDXANgA2QDaANsA3ADdAN4A3wDgAOEA4gFDAVoBqwIsAloCuAMcAzkDzwQ4BDoEPARRBFMEVQTNBOIE8QUEmPtc0Ky6rKKsuqzHrKPDoa2irLCspq2vraWssKzOAejVrKytrKzYA/gu+bQV+9H+fPfRBj76ORVqSWbNavs6rM2wSqwH7vsVFUXNafs68wfNaRVqZ6wG704VaklFJ6zNsEmsB/c6TxUn+zqt9xnNB6z7DhX7Bfs69wWsO++6anRpwwfv+0EV+wX7OvcFB/cZahUnXO8GrFMVamsHRVwF8Wr7OqwG0boFRawGDg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4OrIr5UQH3OPdUA/ebihVmaZSdbB9Mr2TL0xr3vgewlK2eqh7Kr86y1BuvrIJ5qh/HZrJIQhr7vgdngmp5bR5OZ0tkQxv46ARUX2FSH/u+B1a5YMDAs7TCHve+B8RjtVYeDnD4utkB93HzA/cL+QgVPfH8vPP5UgcOrIn5UgG++DYD+GmJFfw28wb3svfUBZ2glKSnGsNduFBWXF1UiB4ijgaMsJWsnqoIyLHMstYbsa6Ceawfy2ezSUAaVndXZ2Me+2/7jQX3pwYOrIvy92Tz90ryEr/zM/L3SvMu8hPy+B/3/xUT7LCwpMDDGq6CrHqoHsZnTK5DG2lrg3puH09pZk5EGobykAe4tba6vrViXFZiYlcedyOfBhPyxLpdUlJcW1JSXLvEH5ojfAdllGiebB5LsM5j1xuwrpSeqx/KsLPO1xrKcMNerx4OwPL1Affi8gP4dPdlFWD4fPshBvuJ/HkF+wH3ryPy87YH+8z1Ffc69+QF++QHDrb3ZNf3ZfAB9zX3YwP3nRZlaJSebB9LsGPO1xrzBlK6XMTEubrEHtcHxF26UlJcXFIeI/g0+BYh+677JAaorK2ZsBuwroJ4qx/LZrNHPxo/B2aCaHhrHktmR2NAGw6si/X3b/IBufX3b/ID95n4QBWAg4uKhh/3EfelBfsHBvtK/CMFfnCFbm0aZJVnnmoeSrLPYdobsq6Vnqwfy7K10dgasoGueKwey2RHtT4b+9YETlu7yMe8vcfHvVlPT1laTx8OmIr5UQG/+B8D93iKFfsIBvdo+OYF+6T2+B8oBg6iifL3bPX3QPEStvNB8vc/8jXxE/L4EvgHFRPss7Cnu78arYOreqgexWpNr0YbaWyDem4fUmlmTUcaXqBftGAeE/JWYmROSxpklWieax5Ksc9i2BuxrpWerB/LsbTP2BrHaMVath4T7PsN93QVu7FjXFtlZltcZbC7urGzuh8T8oX8ghVPW7zHx7q6yMa9W1BPWVpQHw6i96Tz92/0AbTz93DzA/hp+HkVsIGveKwezmNFtUAbZGeBeGofSmNiRT8aZJVnnmseSrHPYtoboAb7EvukBfcHBvdL+CEFmaySqaQa+9gWxry+yJ6dhoGcHq12oWZmGk5YW1BMXLnKHg4gCiEK+11L91IlCvdiyhWtb6hpJgoeJAoOIQogCqz3pe/3b/UBufX3bfQD+G74dxWyga94rB7NZEW0PhtlaIF4ah9KY2FFPxo7tkTPZh6MjIqKjB+TiJCIjYoIjgaCoKGHoRuanY6QoB+IgfsB+6QF9wcG9y/4IgWYppGnqhr7a/sCFVBbvMjHu7zGyLxbTk5aWk4fDvtd+AojCoz7jBUmCh8kCq1vqGkeDvtdi/cS94wjCvwKBCIKDiD3ru8BvPeuA7z4EhUn967vBw4eoDf/DAmLDAv47BT4exWcEwAHAQFBXW97ipCarPcv8+7yAfdl8gP4aPf6FfIjB+r3gwUiBi77gwWHBjH3gwUkBuP7gwUnJPcxKPsxI/cx+y/y9y/3MPP7MO4GDvtdi/cSJQr3JBZkcqOzsKSksrCkcWdlcnFmHw6up6eurm+naGhvb2hop2+uHwv3EiUK9yP4ChUiCgt3SgWxBrnmBZGVj5eZGgsB2/cSAwtobm5paqBzqoYLAAABAAAAAAAAAAAAAA==) format("woff2")}*{-webkit-tap-highlight-color:transparent}.content__container.svelte-1pomljv{position:relative;left:50%;top:50%;transform:translate(-50%, -50%);font-family:PingFangSC, Segoe UI, Rototo, sans-serif}.content__container.withAnimation.svelte-1pomljv{transition:opacity 0.3s linear}.content__container.unClickable.svelte-1pomljv{pointer-events:none !important}.content__container.unClickable.svelte-1pomljv *{pointer-events:none !important}.content__wrapper.svelte-1pomljv{pointer-events:none;width:100%;height:100%}.content__container.hide.svelte-1pomljv{opacity:0;pointer-events:none}.content__container.hide.svelte-1pomljv *{pointer-events:none !important}.content__container.disable.svelte-1pomljv{display:none}.content.svelte-1pomljv{position:relative;width:100%;height:100%;font-size:0.75rem;line-height:1.125rem;color:#fff}.content.svelte-1pomljv:not(.unfolded){pointer-events:none}.content.svelte-1pomljv:not(.unfolded) *{pointer-events:none !important}')}function tv(i){let t,e;return{c(){t=z("div"),b(t,"data-info","tag content is keep folded"),b(t,"data-id",e=i[1].id)},m(n,o){T(n,t,o)},p(n,o){o&2&&e!==(e=n[1].id)&&b(t,"data-id",e)},i:Y,o:Y,d(n){n&&M(t)}}}function nv(i){let t,e,n,o,s,r,a,l,c;const u=[cv,lv,av,rv,sv,ov,iv],h=[];function d(f,p){return f[1].element?0:f[1].contentType==="Text"?1:f[1].contentType==="ImageText"||f[1].contentType==="Image"||f[1].contentType==="Video"?2:f[1].contentType==="Audio"?3:f[1].contentType==="Marketing"?4:f[1].contentType==="Link"||f[1].contentType==="VRLink"||f[1].contentType==="PanoLink"?5:f[1].contentType==="MediaPlane"||f[1].contentType==="MediaModel"?6:-1}return~(o=d(i))&&(s=h[o]=u[o](i)),{c(){var f;t=z("div"),e=z("div"),n=z("div"),s&&s.c(),b(n,"class","content svelte-1pomljv"),Z(n,"unfolded",(f=i[1].state)==null?void 0:f.unfolded),b(e,"class","content__wrapper svelte-1pomljv"),b(t,"class","content__container svelte-1pomljv"),b(t,"data-id",r=i[1].id),Z(t,"disable",i[1].enabled===!1),Z(t,"hide",i[4]),Z(t,"withAnimation",i[0]),Z(t,"unClickable",i[1].clickable===!1),L(t,"width",i[1].stickType==="Plane"||i[1].contentType==="MediaModel"?"100%":0),L(t,"height",i[1].stickType==="Plane"||i[1].contentType==="MediaModel"?"100%":0)},m(f,p){T(f,t,p),R(t,e),R(e,n),~o&&h[o].m(n,null),a=!0,l||(c=we(t,"click",va(i[13])),l=!0)},p(f,p){var g;let v=o;o=d(f),o===v?~o&&h[o].p(f,p):(s&&(re(),D(h[v],1,1,()=>{h[v]=null}),ae()),~o?(s=h[o],s?s.p(f,p):(s=h[o]=u[o](f),s.c()),P(s,1),s.m(n,null)):s=null),(!a||p&2)&&Z(n,"unfolded",(g=f[1].state)==null?void 0:g.unfolded),(!a||p&2&&r!==(r=f[1].id))&&b(t,"data-id",r),(!a||p&2)&&Z(t,"disable",f[1].enabled===!1),(!a||p&16)&&Z(t,"hide",f[4]),(!a||p&1)&&Z(t,"withAnimation",f[0]),(!a||p&2)&&Z(t,"unClickable",f[1].clickable===!1),p&2&&L(t,"width",f[1].stickType==="Plane"||f[1].contentType==="MediaModel"?"100%":0),p&2&&L(t,"height",f[1].stickType==="Plane"||f[1].contentType==="MediaModel"?"100%":0)},i(f){a||(P(s),a=!0)},o(f){D(s),a=!1},d(f){f&&M(t),~o&&h[o].d(),l=!1,c()}}}function iv(i){let t,e;return t=new jA({props:{tag:He(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=He(n[1])),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function ov(i){let t,e;return t=new JA({props:{tag:He(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=He(n[1])),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function sv(i){let t,e;return t=new sA({props:{tag:He(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=He(n[1])),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function rv(i){let t,e;return t=new MA({props:{tag:He(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=He(n[1])),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function av(i){let t,e;return t=new G0({props:{tag:He(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=He(n[1])),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function lv(i){let t,e;return t=new ag({props:{tag:He(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=He(n[1])),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function cv(i){let t,e;return t=new $A({props:{tag:He(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=He(n[1])),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function uv(i){let t,e,n,o;const s=[nv,tv],r=[];function a(l,c){return l[3]?0:1}return t=a(i),e=r[t]=s[t](i),{c(){e.c(),n=fe()},m(l,c){r[t].m(l,c),T(l,n,c),o=!0},p(l,[c]){let u=t;t=a(l),t===u?r[t].p(l,c):(re(),D(r[u],1,1,()=>{r[u]=null}),ae(),e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),P(e,1),e.m(n.parentNode,n))},i(l){o||(P(e),o=!0)},o(l){D(e),o=!1},d(l){r[t].d(l),l&&M(n)}}}function dv(i,t,e){let n,o,s,r,a,l,{withAnimation:c=!1}=t,{tag:u}=t,{hooks:h}=t,{state:d}=t,{mediaStore:f}=t,{temporaryState:p}=t;Fi("hooks",h),Fi("mediaStore",f);let v,g;function A(C){C?h.emit("exposure",{id:r,type:"start"}):h.emit("exposure",{id:r,type:"end"})}function y(C,x,I){var S,k;return!(!x.visible||!x.enabled||!I.visible||!((S=C.state)!=null&&S.visible)||((k=C.temporaryState)==null?void 0:k.visible)===!1||Re(C)&&C.mediaVisible===!1)}const w=C=>h.emit("click",{event:C,target:"TagContent",tag:u});return i.$$set=C=>{"withAnimation"in C&&e(0,c=C.withAnimation),"tag"in C&&e(1,u=C.tag),"hooks"in C&&e(2,h=C.hooks),"state"in C&&e(5,d=C.state),"mediaStore"in C&&e(6,f=C.mediaStore),"temporaryState"in C&&e(7,p=C.temporaryState)},i.$$.update=()=>{var C,x,I,S,k,j,_,F,J,V,B;i.$$.dirty&2&&e(11,n=(C=u.state)==null?void 0:C.unfolded),i.$$.dirty&2&&e(10,o=(x=u.state)==null?void 0:x.visible),i.$$.dirty&162&&e(12,s=d.visible&&p.visible&&((I=u.state)==null?void 0:I.visible)),i.$$.dirty&2&&(r=u.id),i.$$.dirty&162&&e(4,a=!y(u,d,p)),i.$$.dirty&4096&&A(s),i.$$.dirty&3842&&u.hooks&&(n!==void 0&&n!==g&&(e(9,g=n),n?(k=(S=u.hooks).emit)==null||k.call(S,"unfolded"):(_=u==null?void 0:(j=u.hooks).emit)==null||_.call(j,"folded")),o!==void 0&&o!==v&&(e(8,v=o),o?(J=(F=u.hooks).emit)==null||J.call(F,"show"):(B=(V=u.hooks).emit)==null||B.call(V,"hide"))),i.$$.dirty&2&&e(3,l=(()=>!(typeof u.mergedConfig.unfoldedConfig=="object"&&u.mergedConfig.unfoldedConfig.keep==="folded"))())},[c,u,h,l,a,d,f,p,v,g,o,n,s,w]}class Pl extends se{constructor(t){super(),oe(this,t,dv,uv,ie,{withAnimation:0,tag:1,hooks:2,state:5,mediaStore:6,temporaryState:7},ev)}}function hv(i){le(i,"svelte-yex9rb",'@charset "UTF-8";.tag-point-click-helper.svelte-yex9rb.svelte-yex9rb{position:absolute;pointer-events:auto;cursor:pointer;width:2.5rem;height:2.5rem;left:50%;top:50%;transform:translate(-50%, -50%)}.tag-point-wrapper.svelte-yex9rb.svelte-yex9rb{pointer-events:none;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);z-index:-1}.tag-folded-point.svelte-yex9rb.svelte-yex9rb,.tag-unfolded-point.svelte-yex9rb.svelte-yex9rb{transition:all 0.5s}.tag-point-wrapper.svelte-yex9rb .tag-unfolded-point.svelte-yex9rb{display:flex;justify-content:center;align-items:center;position:absolute;width:100%;height:100%;border-radius:50%}.tag-point-wrapper.svelte-yex9rb .tag-unfolded-point.svelte-yex9rb:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:0.3125rem;height:0.3125rem;border-radius:50%;background-color:white}.tag-point-wrapper.svelte-yex9rb .tag-unfolded-point.svelte-yex9rb:before{content:"";position:absolute;width:0.875rem;height:0.875rem;border-radius:50%;background-color:rgba(0, 0, 0, 0.2)}.tag-point-wrapper.folded.svelte-yex9rb .tag-folded-point.svelte-yex9rb{opacity:1;scale:1}.tag-point-wrapper.folded.svelte-yex9rb .tag-unfolded-point.svelte-yex9rb{opacity:0;scale:1}.tag-point-wrapper.unfolded.svelte-yex9rb .tag-folded-point.svelte-yex9rb{opacity:0;scale:0.2}.tag-point-wrapper.unfolded.svelte-yex9rb .tag-unfolded-point.svelte-yex9rb{opacity:1;scale:1}')}function fv(i){let t,e,n,o,s,r,a,l,c,u,h,d;return o=new nt({props:{center:!0,blurRadius:15,spreadRadius:5,opacity:.3}}),c=new Cl({props:{icon:i[2],width:i[1]}}),{c(){t=z("div"),e=ne(),n=z("div"),$(o.$$.fragment),s=ne(),r=z("div"),a=ne(),l=z("div"),$(c.$$.fragment),b(t,"class","tag-point-click-helper svelte-yex9rb"),b(r,"class","tag-unfolded-point svelte-yex9rb"),L(r,"transition-delay",(i[3]?i[5]:0)+"ms"),b(l,"class","tag-folded-point svelte-yex9rb"),L(l,"transition-delay",(i[3]?i[5]:0)+"ms"),b(n,"class","tag-point-wrapper svelte-yex9rb"),Z(n,"unfolded",i[0]),Z(n,"folded",i[3]),L(n,"width",Ie(i[1])),L(n,"height",Ie(i[1]))},m(f,p){T(f,t,p),T(f,e,p),T(f,n,p),q(o,n,null),R(n,s),R(n,r),R(n,a),R(n,l),q(c,l,null),u=!0,h||(d=we(t,"click",i[4]),h=!0)},p(f,[p]){p&8&&L(r,"transition-delay",(f[3]?f[5]:0)+"ms");const v={};p&4&&(v.icon=f[2]),p&2&&(v.width=f[1]),c.$set(v),p&8&&L(l,"transition-delay",(f[3]?f[5]:0)+"ms"),(!u||p&1)&&Z(n,"unfolded",f[0]),(!u||p&8)&&Z(n,"folded",f[3]),p&2&&L(n,"width",Ie(f[1])),p&2&&L(n,"height",Ie(f[1]))},i(f){u||(P(o.$$.fragment,f),P(c.$$.fragment,f),u=!0)},o(f){D(o.$$.fragment,f),D(c.$$.fragment,f),u=!1},d(f){f&&M(t),f&&M(e),f&&M(n),K(o),K(c),h=!1,d()}}}function mv(i,t,e){let n,o,s,r;const a=Tt("hooks");let{tag:l}=t,c,u=!1;const h=()=>{c!==void 0&&clearTimeout(c),u=!0,c=setTimeout(()=>{u=!1},800)},d=p=>{u||a.emit("click",{event:p,target:"TagPoint",tag:l})},f=(()=>l.contentType==="Text"&&l.data.appearance==="plane"?500:800)();return i.$$set=p=>{"tag"in p&&e(6,l=p.tag)},i.$$.update=()=>{var p,v,g,A;i.$$.dirty&64&&e(0,n=(p=l.state)==null?void 0:p.unfolded),i.$$.dirty&1&&e(3,o=!n),i.$$.dirty&64&&e(2,s=(g=(v=l.style)==null?void 0:v.point)!=null&&g.url?(A=l.style)==null?void 0:A.point:{url:Bp}),i.$$.dirty&64&&e(1,r=(()=>{var w,C,x;const y=(x=(C=(w=l.style)==null?void 0:w.point)==null?void 0:C.size)!=null?x:"S";return typeof y=="number"?y:y==="S"?18:y==="M"?20:y==="L"?24:y==="XL"?28:18})())},h(),[n,r,s,o,d,f,l]}class pv extends se{constructor(t){super(),oe(this,t,mv,fv,ie,{tag:6},hv)}}function gv(i){le(i,"svelte-pzwdws",".tag.withAnimation.svelte-pzwdws{transition:opacity 0.3s linear}.tag.hide.svelte-pzwdws{opacity:0;pointer-events:none}.tag.hide.svelte-pzwdws *{pointer-events:none !important}.tag.unClickable.svelte-pzwdws{pointer-events:none !important}.tag.unClickable.svelte-pzwdws *{pointer-events:none !important}.tag.disable.svelte-pzwdws{display:none}.wrapper.svelte-pzwdws{position:absolute;width:0rem;height:0rem;overflow:visible;pointer-events:auto}")}function Av(i){let t;return{c(){t=z("div"),b(t,"data-info","tag content is disable")},m(e,n){T(e,t,n)},p:Y,i:Y,o:Y,d(e){e&&M(t)}}}function vv(i){let t,e;return t=new Pl({props:{mediaStore:i[2],withAnimation:i[0],tag:He(i[1]),hooks:i[14],state:i[3],temporaryState:i[4]}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&4&&(s.mediaStore=n[2]),o&1&&(s.withAnimation=n[0]),o&2&&(s.tag=He(n[1])),o&8&&(s.state=n[3]),o&16&&(s.temporaryState=n[4]),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function bv(i){let t;return{c(){t=z("div"),b(t,"data-info","tag point is disable")},m(e,n){T(e,t,n)},p:Y,i:Y,o:Y,d(e){e&&M(t)}}}function yv(i){let t,e;return t=new pv({props:{tag:i[1]}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=n[1]),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function wv(i){let t,e,n,o,s,r,a,l,c;const u=[vv,Av],h=[];function d(g,A){return g[12]?0:1}n=d(i),o=h[n]=u[n](i);const f=[yv,bv],p=[];function v(g,A){return g[13]?0:1}return r=v(i),a=p[r]=f[r](i),{c(){t=z("div"),e=z("div"),o.c(),s=ne(),a.c(),b(e,"class","wrapper svelte-pzwdws"),b(e,"data-tag-unfolded",i[8]),b(e,"data-tag-id",i[11]),b(e,"data-content-type",l=i[1].contentType),L(e,"left",i[7]),L(e,"top",i[6]),L(e,"z-index",i[5]),b(t,"class","tag svelte-pzwdws"),b(t,"data-tag-id",i[11]),Z(t,"unClickable",i[1].clickable===!1),Z(t,"disable",i[10]),Z(t,"hide",i[9]),Z(t,"withAnimation",i[0])},m(g,A){T(g,t,A),R(t,e),h[n].m(e,null),R(e,s),p[r].m(e,null),c=!0},p(g,[A]){let y=n;n=d(g),n===y?h[n].p(g,A):(re(),D(h[y],1,1,()=>{h[y]=null}),ae(),o=h[n],o?o.p(g,A):(o=h[n]=u[n](g),o.c()),P(o,1),o.m(e,s));let w=r;r=v(g),r===w?p[r].p(g,A):(re(),D(p[w],1,1,()=>{p[w]=null}),ae(),a=p[r],a?a.p(g,A):(a=p[r]=f[r](g),a.c()),P(a,1),a.m(e,null)),(!c||A&256)&&b(e,"data-tag-unfolded",g[8]),(!c||A&2048)&&b(e,"data-tag-id",g[11]),(!c||A&2&&l!==(l=g[1].contentType))&&b(e,"data-content-type",l),A&128&&L(e,"left",g[7]),A&64&&L(e,"top",g[6]),A&32&&L(e,"z-index",g[5]),(!c||A&2048)&&b(t,"data-tag-id",g[11]),(!c||A&2)&&Z(t,"unClickable",g[1].clickable===!1),(!c||A&1024)&&Z(t,"disable",g[10]),(!c||A&512)&&Z(t,"hide",g[9]),(!c||A&1)&&Z(t,"withAnimation",g[0])},i(g){c||(P(o),P(a),c=!0)},o(g){D(o),D(a),c=!1},d(g){g&&M(t),h[n].d(),p[r].d()}}}function Cv(i,t,e){let n,o,s,r,a,l,c,u,h,{withAnimation:d=!1}=t,{tag:f}=t,{mediaStore:p}=t,{state:v}=t,{temporaryState:g}=t;const A=Tt("hooks");return i.$$set=y=>{"withAnimation"in y&&e(0,d=y.withAnimation),"tag"in y&&e(1,f=y.tag),"mediaStore"in y&&e(2,p=y.mediaStore),"state"in y&&e(3,v=y.state),"temporaryState"in y&&e(4,g=y.temporaryState)},i.$$.update=()=>{var y,w,C,x,I,S,k,j;i.$$.dirty&2&&e(13,n=(()=>!(f.contentType==="Link"||f.contentType==="VRLink"||f.contentType==="PanoLink"||f.contentType==="Audio"&&f.data.appearance==="plane"))()),i.$$.dirty&2&&e(12,o=(()=>f.stickType==="2DPoint")()),i.$$.dirty&2&&e(11,s=f.id),i.$$.dirty&2&&e(10,r=!((y=f.pointTagStyle)!=null&&y.leftPercent)||!((w=f.pointTagStyle)!=null&&w.topPercent)||f.enabled===!1||!f.state),i.$$.dirty&2&&e(9,a=!((C=f.state)!=null&&C.visible)||((x=f.temporaryState)==null?void 0:x.visible)===!1),i.$$.dirty&2&&e(8,l=(I=f.state)==null?void 0:I.unfolded),i.$$.dirty&2&&e(7,c=((S=f.pointTagStyle)==null?void 0:S.leftPercent)+"%"),i.$$.dirty&2&&e(6,u=((k=f.pointTagStyle)==null?void 0:k.topPercent)+"%"),i.$$.dirty&2&&e(5,h=(j=f.state)!=null&&j.unfolded?1:0)},[d,f,p,v,g,h,u,c,l,a,r,s,o,n,A]}class Pv extends se{constructor(t){super(),oe(this,t,Cv,wv,ie,{withAnimation:0,tag:1,mediaStore:2,state:3,temporaryState:4},gv)}}function Ev(i){le(i,"svelte-uq11d5",".tag--container.svelte-uq11d5{box-sizing:border-box;position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;opacity:1;-webkit-user-select:none;-moz-user-select:none;user-select:none;transform:translate3d(0, 0, 0)}.withAnimation.svelte-uq11d5{transition:opacity 0.3s linear}.tag--container.hide.svelte-uq11d5{opacity:0;pointer-events:none}.tag--container.hide.svelte-uq11d5 *{pointer-events:none !important}")}function $r(i,t,e){const n=i.slice();return n[6]=t[e],n}function ea(i){let t,e=[],n=new Map,o,s=i[1];const r=a=>a[6].id;for(let a=0;a<s.length;a+=1){let l=$r(i,s,a),c=r(l);n.set(c,e[a]=ta(c,l))}return{c(){t=z("div");for(let a=0;a<e.length;a+=1)e[a].c();b(t,"class","tag--container svelte-uq11d5"),Z(t,"hide",!i[3].visible||!i[4].visible),Z(t,"withAnimation",i[0])},m(a,l){T(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,l){l&31&&(s=a[1],re(),e=Ze(e,l,r,1,a,s,n,t,kt,ta,null,$r),ae()),(!o||l&24)&&Z(t,"hide",!a[3].visible||!a[4].visible),(!o||l&1)&&Z(t,"withAnimation",a[0])},i(a){if(!o){for(let l=0;l<s.length;l+=1)P(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)D(e[l]);o=!1},d(a){a&&M(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function ta(i,t){let e,n,o;return n=new Pv({props:{state:t[3],temporaryState:t[4],withAnimation:t[0],tag:t[6],mediaStore:t[2]}}),{key:i,first:null,c(){e=fe(),$(n.$$.fragment),this.first=e},m(s,r){T(s,e,r),q(n,s,r),o=!0},p(s,r){t=s;const a={};r&8&&(a.state=t[3]),r&16&&(a.temporaryState=t[4]),r&1&&(a.withAnimation=t[0]),r&2&&(a.tag=t[6]),r&4&&(a.mediaStore=t[2]),n.$set(a)},i(s){o||(P(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&M(e),K(n,s)}}}function Iv(i){let t,e,n=i[3].enabled&&ea(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[3].enabled?n?(n.p(o,s),s&8&&P(n,1)):(n=ea(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(re(),D(n,1,1,()=>{n=null}),ae())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function kv(i,t,e){let{withAnimation:n=!1}=t,{tags:o=[]}=t,{hooks:s}=t,{mediaStore:r}=t,{state:a}=t,{temporaryState:l}=t;return Fi("hooks",s),i.$$set=c=>{"withAnimation"in c&&e(0,n=c.withAnimation),"tags"in c&&e(1,o=c.tags),"hooks"in c&&e(5,s=c.hooks),"mediaStore"in c&&e(2,r=c.mediaStore),"state"in c&&e(3,a=c.state),"temporaryState"in c&&e(4,l=c.temporaryState)},[n,o,r,a,l,s]}class xv extends se{constructor(t){super(),oe(this,t,kv,Iv,ie,{withAnimation:0,tags:1,hooks:5,mediaStore:2,state:3,temporaryState:4},Ev)}}const Dv={globalConfig:{unfoldedConfig:{autoUnfold:{strategy:"MinimumDistance",distance:{max:5}}},tag3DConfig:{ratio:.0035}},contentTypeConfig:{"Any-Audio-plane":{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},Link:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},VRLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},PanoLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},MediaPlane:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{alwaysShowWhenMovePano:!0}},MediaModel:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{keep:"visible",visibleFiveMode:["Panorama","Floorplan","Model","Mapview"],alwaysShowWhenMovePano:!0}}}};class Lv extends ci{constructor(e){super(e);m(this,"tagCacheByPanoIndex",{})}getCache({panoIndex:e,id:n,key:o}){var c,u,h,d;const{five:s}=this,r=(c=s.panoIndex)!=null?c:e;if(r===void 0)throw new Error(`TagCacheController getCache(): fivePanoIndex is ${r}`);const a=`${(h=(u=s.work)==null?void 0:u.workCode)!=null?h:s.model.uuid}-${r}`;let l=this.tagCacheByPanoIndex[a];if(l||(l=new Map,this.tagCacheByPanoIndex[a]=l),n===void 0)return l;if(o===void 0){const f=l.get(n);return f||(l.set(n,{}),l.get(n))}return(d=l.get(n))==null?void 0:d[o]}clearCache(){this.tagCacheByPanoIndex={}}removeCache(){}}class Sv extends Lv{constructor(e){super(e);m(this,"tags",[]);m(this,"config",Dv);m(this,"raycaster",new E.Raycaster)}get isPanorama(){return this.five.currentMode==="Panorama"}getTagById(e){const n=this.tags.find(o=>o.id===e);if(!n){console.error(`getTagById(): tag is ${n}, id is ${e}`);return}return n}changeContentTypeConfig(e,n,o=!0){this.config.contentTypeConfig||(this.config.contentTypeConfig={}),o?this.config.contentTypeConfig[e]=mt.default({},this.config.contentTypeConfig[e],n):this.config.contentTypeConfig[e]=n,this.clearCache()}getVisibleByPanoIndex(e,n){var r;const o=this.getCache({panoIndex:n,id:e.id}),s=(r=this.five.panoIndex)!=null?r:n;if(Re(e))return!0;if(o.visible!==void 0)return o.visible;{const a=(()=>{var u,h,d;const l=(u=this.getTagConfig(e).visibleConfig)!=null?u:{},c=this.getDistance(e);if(typeof l=="function")return{value:l(this.five,{tag:e,distance:c}),reason:"config function result"};if(l.keep==="hidden")return{value:!1,reason:"config.keep is hidden"};if(l.keep==="visible")return{value:!0,reason:"config.keep is visible"};if(l.visiblePanoIndex!==void 0&&l.visiblePanoIndex!=="all"&&s!==void 0){if(Array.isArray(l.visiblePanoIndex)&&!l.visiblePanoIndex.includes(s))return{value:!1,reason:`current panoIndex is not included in visiblePano. currentPanoIndex: ${s}, visiblePanoIndex: ${l.visiblePanoIndex}`};if(l.visiblePanoIndex==="current"&&s!==((h=e.fiveState)==null?void 0:h.panoIndex))return{value:!1,reason:`current panoIndex is not equal to tag.panoIndex. currentPanoIndex: ${s}, tag.panoIndex: ${(d=e.fiveState)==null?void 0:d.panoIndex}`}}if(l.visibleDistance!==void 0&&l.visibleDistance!=="unLimited"&&ln(c,l.visibleDistance)===!1)return{value:!1,reason:`distance is not in visibleDistance. distance: ${c}, visibleDistance: ${l.visibleDistance}`};if(l.intersectRaycaster!==!1&&(typeof l.intersectRaycaster!="object"||l.intersectRaycaster.enabled!==!1)){if(s===void 0)return{value:!1,reason:`intersectRaycaster check failed: fivePanoIndex is ${s}`};const f=this.getRaycasterFromPanoIndex(e,s),p=this.getTagEnableByIntersect(e,f);if(p.value===!1)return p}if(l.angleRange&&yp(e)){const f=this.getAngle(e);if(ln(f,l.angleRange)===!1)return{value:!1,reason:`angle is not in angleRange. angle: ${f}, angleRange: ${l.angleRange}`}}return{value:!0,reason:"all check passed"}})();return o.visible=a.value,o.__debug_visible_reason__=a,o.visible}}getVisibleByFiveMode(e,n){var r;const o=(r=this.getTagConfig(e).visibleConfig)!=null?r:{};if(typeof o=="function")return n==="Panorama";const s=o==null?void 0:o.visibleFiveMode;return s?s.includes(n):n==="Panorama"}getVisibleByFloorIndex(e){var a;const n=e.fiveState;if(!n)return!0;const o=n.panoIndex,s=(a=this.five.work.observers[o])==null?void 0:a.floorIndex,r=this.five.model.shownFloor;return r===null||r===s}getVisible(e){const n=this.five.getCurrentState(),o=this.getVisibleByFiveMode(e,n.mode),s=Re(e)?this.getVisibleByFloorIndex(e):!0,r=n.mode==="Panorama"?this.getVisibleByPanoIndex(e,n.panoIndex):!0;return o&&r&&s}getModelMedialVisibleByPanoIndex(e){const n=this.five.getCurrentState().panoIndex,o=this.getCache({panoIndex:n,id:e.id});if(o.modelMedialVisible!==void 0)return o.modelMedialVisible;const s=this.getRaycasterFromPanoIndex(e,n),r=this.getTagEnableByIntersect(e,s);return o.modelMedialVisible=r.value,o.__debug_visible_reason__=r,r.value!==!1}getUnfoldedByPanoIndex(e,n){if(!this.getVisibleByPanoIndex(e))return;const s=this.getCache({panoIndex:n,id:e.id});if(s.unfolded!==void 0)return s.unfolded;{const r=this.getTagConfig(e).unfoldedConfig;if(!r)return;const a=(()=>{const c=this.getDistance(e);if(typeof r=="function")return r(this.five,{tag:e,distance:c});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.unfoldDistance&&ln(c,r.unfoldDistance)===!1)return!1})();s.unfolded=a;const l=this.getUnfoldedByCamera(e);return l!==void 0?l:s.unfolded}}getUnfoldedByCamera(e){return this.getVisibleByPanoIndex(e)?(()=>{var a;const s=this.getDistance(e),r=this.getTagConfig(e).unfoldedConfig;if(!!r){if(typeof r=="function")return r(this.five,{tag:e,distance:s});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.autoUnfold===void 0||r.autoUnfold===!1||r.autoUnfold.enable===!1)return;if(r.autoUnfold.strategy==="ScreenPostion"){const l=this.getTagProject(e);if(l&&ln(l.x,r.autoUnfold.autoUnfoldProjectX)===!1)return!1}if(r.autoUnfold.strategy==="MinimumDistance"){const u=this.filterPointTag().filter(d=>this.getVisibleByPanoIndex(d)).filter(d=>{const f=this.getTagProject(d);if(!f)return!1;const{x:p,y:v,z:g}=f;return!(Math.abs(g)>1||Math.abs(p)>1||Math.abs(v)>1)}).map(d=>({tag:d,id:d.id,tagConfig:this.getTagConfig(d).unfoldedConfig})).filter(({tag:d,tagConfig:f})=>{var p,v;return!(typeof f!="object"||f.keep||f.autoUnfold===!1||((p=f.autoUnfold)==null?void 0:p.enable)===!1||((v=f.autoUnfold)==null?void 0:v.strategy)!=="MinimumDistance")}).map(d=>me(H({},d),{distance:this.getDistance(d.tag)})).filter(({distance:d,tagConfig:f})=>{var p,v;return!(d===void 0||typeof f!="object"||f.autoUnfold===!1||((p=f.autoUnfold)==null?void 0:p.enable)===!1||((v=f.autoUnfold)==null?void 0:v.strategy)!=="MinimumDistance"||f.autoUnfold.distance&&ln(d,f.autoUnfold.distance)===!1)}).sort((d,f)=>d.distance-f.distance).findIndex(d=>d.id===e.id);if(u===-1||u<=((a=r.autoUnfold.maxNumber)!=null?a:1)-1===!1)return!1}return!0}})():void 0}getDistance(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCache({panoIndex:n,id:e.id});if(s.distance!==void 0)return s.distance;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getDistance(): observerPosition is ${c}`);const u=Us(e),h=c.distanceTo(u);return s.distance=h,h}}getAngle(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCache({panoIndex:n,id:e.id});if(s.angle!==void 0)return s.angle;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getAngleRange(): observerPosition is ${c}`);const u=(()=>e.stickType==="3DPoint"?An(e.normal):Ji(e.position))();if(!u)return;const h=new E.Vector3().copy(c).sub(Zi(e.position)),d=u.angleTo(h)*180/Math.PI;return s.angle=d,s.angle}}getTagConfig(e){var s,r;if(!e)return(s=this.config.globalConfig)!=null?s:{};const n={};this.config.contentTypeConfig&&Object.keys(this.config.contentTypeConfig).forEach(a=>{const l=a;if(n[l])return;const c=l.split("-");if(c.length===1){const[u]=c;e.contentType===u&&(n[l]=this.config.contentTypeConfig[l])}if(c.length===2){const[u="Any",h="Any"]=c;(e.stickType===u||u==="Any")&&(e.contentType===h||h==="Any")&&(n[l]=this.config.contentTypeConfig[l])}if(c.length===3){const[u="Any",h,d]=c;if(h==="Audio"&&e.contentType==="Audio"){const f=e;(f.stickType===u||u==="Any")&&f.data.appearance===d&&(n[l]=this.config.contentTypeConfig[l])}}});const o=mt.default({},this.config.globalConfig,...Object.values(n),e.config);return typeof o.unfoldedConfig=="object"&&(o.unfoldedConfig.disableFold&&(o.unfoldedConfig={keep:"unfolded"}),o.unfoldedConfig.disableUnfold&&(o.unfoldedConfig={keep:"folded"}),o.unfoldedConfig.keep&&(o.unfoldedConfig={keep:o.unfoldedConfig.keep})),typeof o.visibleConfig=="object"&&o.visibleConfig.keep&&(o.visibleConfig={keep:o.visibleConfig.keep,visibleFiveMode:(r=o.visibleConfig)==null?void 0:r.visibleFiveMode}),o}can(e,n){const o=this.getTagConfig(n);if(!o||typeof o!="object")return!0;if(e==="show"||e==="hide"){if(!o.visibleConfig||typeof o.visibleConfig!="object")return!0;if(e==="show"&&o.visibleConfig.keep==="hidden"||e==="hide"&&(o.visibleConfig.keep==="visible"||o.visibleConfig.alwaysShowWhenMovePano))return!1}if(e==="fold"||e==="unfold"){if(!o.unfoldedConfig||typeof o.unfoldedConfig!="object")return!0;if(e==="fold"&&o.unfoldedConfig.keep==="unfolded"||e==="unfold"&&o.unfoldedConfig.keep==="folded")return!1}return!0}sort(e){return e.sort((n,o)=>{const s=this.getDistance(n),r=this.getDistance(o);return s===void 0||r===void 0?0:r-s})}setPointTagPosition(){const e=this.filterPointTag();e.length!==0&&e.forEach(n=>{var s;if(!((s=n.state)!=null&&s.visible)){n.pointTagStyle=null;return}const o=this.getTagProject(n);if(!o){n.pointTagStyle=null;return}n.pointTagStyle={leftPercent:(o.x+1)/2*100,topPercent:(-o.y+1)/2*100}})}setVisibleByPanoIndex(){this.tags.forEach(e=>{const n=this.getVisibleByPanoIndex(e);e.state&&(e.state.visible=n)})}setModelMedialVisibleByPanoIndex(){this.tags.forEach(e=>{if(!Re(e))return;const n=this.getModelMedialVisibleByPanoIndex(e);e.mediaVisible=n})}setUnfoldedByPanoIndex(){this.tags.forEach(e=>{const n=this.getUnfoldedByPanoIndex(e);if(!!e.state&&(n!==void 0&&(e.state.unfolded=n),n&&!e.state.visible)){const o=this.getTagConfig(e);typeof o.unfoldedConfig=="object"&&o.unfoldedConfig.autoUnfoldWhenHide!==!1&&(e.state.unfolded=!1)}})}getTagProject(e){if(!this.getVisibleByPanoIndex(e))return;const o=Zi(e.position),{x:s,y:r,z:a}=o.project(this.five.camera);if(!(a>1))return{x:s,y:r,z:a}}filterPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint"||e.stickType==="3DPoint")}filter2DPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint")}filter3DPointTag(){return this.tags.filter(e=>e.stickType==="3DPoint")}filterModelTag(){return this.tags.filter(e=>e.stickType==="Model")}filter3DTag(){return this.tags.filter(e=>e.stickType==="3DPoint"||e.stickType==="Plane")}filterPlaneTag(){return this.tags.filter(e=>e.stickType==="Plane")}updateTagConfig(e){e!=null&&e.force&&this.clearCache(),this.tags.forEach(n=>{const o=this.getTagConfig(n);n.mergedConfig=o})}getTagEnableByIntersect(e,n){var u,h,d;const o=(u=this.getTagConfig(e).visibleConfig)!=null?u:{},s=this.getDistance(e),[r]=this.five.model.intersectRaycaster(n),a=(()=>{if(!Re(e))return;const f=this.tags.filter(Re).map(v=>{var g;return(g=v.model)==null?void 0:g.object}).filter(Ye);return n.intersectObjects(f,!0)[0]})(),l=(()=>{var f;return typeof o=="object"&&typeof o.intersectRaycaster=="object"&&(f=o.intersectRaycaster.distanceAccuracy)!=null?f:.01})();return Math.min((h=r==null?void 0:r.distance)!=null?h:1/0,(d=a==null?void 0:a.distance)!=null?d:1/0)+l<s?{value:!1,reason:`intersectRaycaster check failed: distance is ${s}, intersection.point is ${r.point.toArray()},
562
- customModelIntersection.point is ${a==null?void 0:a.point.toArray()} distanceError is ${l}`}:{value:!0,reason:""}}getRaycasterFromPanoIndex(e,n){var r;const o=(r=this.five.work.observers[n])==null?void 0:r.position;if(o===void 0)throw new Error(`getVisible(): observerPosition is ${o}`);const s=Us(e).sub(o).normalize();return this.raycaster.set(o,s),this.raycaster}}function Mv(i){var t,e,n,o;if(!i.stickType){const s=(()=>i.pointType==="PointTag"&&i.dimensionType==="3D"?"3DPoint":i.pointType==="PlaneTag"?"Plane":"2DPoint")();i.stickType=s}if(i.contentType==="VRLink"||i.contentType==="PanoLink"||i.contentType==="Link"){const s=i;!((e=(t=s.data)==null?void 0:t.icon)!=null&&e.url)&&!((o=(n=s.style)==null?void 0:n.point)!=null&&o.url)&&(s.data.icon={url:"//vrlab-static.ljcdn.com/release/web/test.09dee741.png",steps:28})}return i}const Tv=new _l.GLTFLoader;function zv(i){return new Promise((t,e)=>{function n(s){t(s)}function o(s){e(s)}Tv.load(i,n,void 0,o)})}const El="2.0.10",$i=`DnalogelPlugin-PanoTagPlugin@${El}`,Bv=!1,jv=i=>`${$i}--${i}`;class Il extends Sv{constructor(e,n){super(e);m(this,"version",El);m(this,"state",{enabled:!0,visible:!0});m(this,"params");m(this,"debug");m(this,"css3DRenderPlugin");m(this,"TagContainerSvelte");m(this,"temporaryState",{visible:!0});m(this,"mediaStore",ao({currentMediaElement:null}));m(this,"group",new Q.Group);m(this,"gltfObjectGroup",new Q.Group);m(this,"isIOSWX",navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1&&navigator.userAgent.toLowerCase().indexOf("iphone")!==-1);m(this,"store",{disposers:[],disposed:!1,resizeObserverDisposerAdding:!1,css3DRenderDisposer:new Map});m(this,"enabledModelTagSet",new Set);m(this,"changeTagModel",(e,n)=>N(this,null,function*(){e.data=mt.default({},e.data,n),yield this.loadModel(e),this.updateRenderAllTags()}));m(this,"disposedErrorLog",()=>{console.error(`${$i} is disposed`)});m(this,"handleFiveInitAnimationEnded",()=>{const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{Re(n)&&e==="Panorama"&&this.changeTagMode(n,"front"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags(),this.updateRenderAllTags()});m(this,"handleFiveModelShownFloorChange",()=>{this.tags.forEach(e=>{!Re(e)||(e.state.visible=this.getVisible(e))}),this.updateRenderAllTags()});m(this,"loadModel",e=>N(this,null,function*(){var l;const n=e.data.modelUrl;if(!n)return;const o=zv(n).then(c=>Object.assign(c.scene,{customID:e.id,isTagModel:!0}));e.model={promise:o};const s=yield o;if(((l=e.model)==null?void 0:l.promise)!==o||(e.model.object=s,!this.tags.includes(e)))return;s.visible=e.state.visible,new Q.Matrix4().fromArray(e.matrix).decompose(s.position,s.quaternion,s.scale),s.updateWorldMatrix(!0,!0),this.getVisibleByFloorIndex(e)||(s.visible=!1);const a=this.gltfObjectGroup.children.find(c=>c.customID===e.id);return a&&this.gltfObjectGroup.remove(a),this.gltfObjectGroup.add(s),this.updateTagCss3DObjectMatrix(e,s),s}));this.group.name="PanoTagPluginModelGroup",this.gltfObjectGroup.name="PanoTagPluginGLTFObjectGroup",this.group.add(this.gltfObjectGroup),this.params=H({debug:!1,config:this.config},n),this.debug=this.params.debug,this.config=this.params.config,Gr(1,{namespace:oi.GetAudioDuration}),Gr(1,{namespace:oi.PlayAudio}),Object.assign(window,{[`__PANOTAGPLUGIN_DEBUG_${Date.now()}__`]:this}),Object.assign(window,{__PANOTAGPLUGIN_DEBUG__:this}),this.state.enabled&&this.five.scene.add(this.group)}load(e,n){return N(this,null,function*(){var s,r;this.clearTags(),console.info($i," load:",{data:JSON.parse(JSON.stringify(e))}),this.config=mt.default({},this.config,{globalConfig:(s=e.globalConfig)!=null?s:{},contentTypeConfig:(r=e.contentTypeConfig)!=null?r:{}});const o=yield this.addTag(e.tagList,n);if(this.debug)try{vp(this.five,this.tags)}catch(a){console.error(a)}return o})}addTag(e,n){return N(this,null,function*(){const s=(Array.isArray(e)?e:[e]).map(r=>{const a=this.getTagConfig(r),l=me(H({},r),{state:H({visible:void 0,unfolded:Bv},a.initialState),hooks:new Ce.Subscribe,clickable:a.clickable,mergedConfig:a});return Re(r)&&(l.temporaryState={visible:!1}),l}).filter(r=>r.position);return s.forEach(Mv),this.tags.push(...s),wp(this.five).then(()=>{var r,a,l;return this.store.eventListenerDisposer&&((a=(r=this.store).eventListenerDisposer)==null||a.call(r)),this.state.enabled&&(this.store.eventListenerDisposer=this.addEventListener()),this.addResizeListener(),this.checkPanelTag(),this.setVisibleAndUnfolded({withAnimation:(l=n==null?void 0:n.withAnimation)!=null?l:!0}).then(()=>this.updateRenderAllTags()),this.updateRenderAllTags(),this.addMediaModelTag(s)})})}changeConfig(e,n=!0){n?this.config=mt.default({},this.config,e):this.config=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeGlobalConfig(e,n=!0){n?this.config.globalConfig=mt.default({},this.config.globalConfig,e):this.config.globalConfig=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}clearTags(){this.tags=[],this.enabledModelTagSet.clear(),this.clearCache(),this.disposeAllCSS3DContainer(),this.updateRenderAllTags()}show(e){return N(this,null,function*(){const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({visible:!0},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("show",{userAction:n,withAnimation:o})})}hide(e){return N(this,null,function*(){const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({visible:!1},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("hide",{userAction:n,withAnimation:o})})}enable(e){const{userAction:n=!0}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.five.scene.children.includes(this.group)||this.five.scene.add(this.group),this.setState({enabled:!0},{userAction:n}),this.hooks.emit("enable",{userAction:n}),this.five.needsRender=!0}disable(e){const{userAction:n=!0}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({enabled:!1},{userAction:n}),this.five.scene.remove(this.group),this.hooks.emit("disable",{userAction:n}),this.five.needsRender=!0}dispose(){var e,n,o,s,r,a;this.pauseCurrentMedia(),this.disposeAllCSS3DContainer(),(e=this.TagContainerSvelte)==null||e.$destroy(),this.filter3DTag().forEach(l=>{var c;return(c=l.tag3DContentSvelte)==null?void 0:c.svelteApp.$destroy()}),this.tags=[],(n=this.store.disposers)==null||n.forEach(l=>l==null?void 0:l()),this.store.disposers=[],this.store.disposed=!0,(s=(o=this.store).eventListenerDisposer)==null||s.call(o),this.store.eventListenerDisposer=void 0,(a=(r=this.store).resizeObserverDisposer)==null||a.call(r),this.store.resizeObserverDisposer=void 0,this.store.resizeObserverDisposerAdding=!1,this.five.scene.remove(this.group),this.group.remove(...this.group.children),this.gltfObjectGroup.remove(...this.gltfObjectGroup.children),this.clearCache(),this.five.needsRender=!0,this.hooks.emit("dispose")}setState(e,n){if(this.store.disposed)return this.disposedErrorLog();const{userAction:o=!0,visibleWithAnimation:s=!1}=n,r=H({},this.state);this.state=Object.assign(this.state,e),this.store.visibleWithAnimation=s,r.visible!==this.state.visible&&(e.visible?this.handleShow():this.handleHide()),r.enabled!==this.state.enabled&&(e.enabled?this.handleEnable():this.handleDisable()),this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:o})}changeUnfoldedById(e,n){var r;const o=this.getTagById(e);if(!o)return;o.state.unfolded=n;const s=this.filterPointTag();(r=this.TagContainerSvelte)==null||r.$set({tags:s})}changeTagNormalById(e,n){const o=this.getTagById(e);!o||!o.tag3DContentSvelte||(o.tag3DContentSvelte.currentNormal=rt(n),this.updateRenderPlaneTag())}changeDataById(e,n,o=!0){const s=this.getTagById(e);!s||(o?s.data=mt.default({},s.data,n):s.data=H(H({},s.data),n),this.checkPanelTag(),this.updateRenderAllTags())}changeStickTypeById(e,n,o=!0){this.changeTagById(e,n,o)}changeTagById(e,n,o=!0){const s=this.getTagById(e);!n||(o?mt.default(s,n):Object.assign(s,n),(s==null?void 0:s.tag3DContentSvelte)&&(n==null?void 0:n.normal)&&(s.tag3DContentSvelte.currentNormal=rt(n.normal)),this.updateRenderAllTags(),this.checkPanelTag())}destroyTagById(e){(Array.isArray(e)?e:[e]).forEach(o=>{const s=this.tags.findIndex(r=>r.id===o);s!==-1&&this.tags.splice(s,1)}),this.updateRenderAllTags()}pauseCurrentMedia(){this.mediaStore.set({currentMediaElement:null})}updateTagCss3DObjectMatrix(e,n){var v,g,A,y;const o=(A=(g=(v=e.mergedConfig)==null?void 0:v.tag3DConfig)==null?void 0:g.ratio)!=null?A:.00216,s=(y=e.tag3DContentSvelte)==null?void 0:y.domContainer.css3DObject;if(!s)return;const r=Re(e)?e.data.mediaPosition:e.position;n.updateWorldMatrix(!1,!1);const a=n.matrixWorld,l=new Q.Vector3().fromArray(r[0]),c=new Q.Vector3().fromArray(r[2]),u=new Q.Vector3().lerpVectors(l,c,.5).add(new Q.Vector3(0,0,5e-4)),h=new Q.Matrix4().setPosition(u),d=new Q.Matrix4().makeScale(o,o,o),f=new Q.Matrix4().multiply(a).multiply(h).multiply(d);f.decompose(s.position,s.quaternion,s.scale);const p=s.opacityMesh;!p||f.decompose(p.position,p.quaternion,p.scale)}updateTagCss3DObjectVisible(e){var s,r,a,l,c;const n=(s=e.tag3DContentSvelte)==null?void 0:s.domContainer.css3DObject;if(!n)return;n.visible=(a=(r=e.state)==null?void 0:r.visible)!=null?a:!0;const o=n.opacityMesh;!o||(o.visible=(c=(l=e.state)==null?void 0:l.visible)!=null?c:!0)}setVisibleAndUnfolded(){return N(this,arguments,function*({withAnimation:e}={withAnimation:!1}){if(!!this.isPanorama)return this.setVisibleByPanoIndex(),e?new Promise((n,o)=>{setTimeout(()=>{this.setUnfoldedByPanoIndex(),n()},10)}):(this.setUnfoldedByPanoIndex(),Promise.resolve())})}handleShow(){this.state.visible=!0,this.updateTagContainerVisible()}handleHide(){this.pauseCurrentMedia(),this.state.visible=!1,this.updateTagContainerVisible()}handleEnable(){this.state.enabled=!0,this.store.eventListenerDisposer=this.addEventListener(),this.updateRenderAllTags()}handleDisable(){var e,n,o;this.pauseCurrentMedia(),this.state.enabled=!1,(n=(e=this.store).eventListenerDisposer)==null||n.call(e),(o=this.TagContainerSvelte)==null||o.$set({tags:[]}),this.filter3DTag().forEach(s=>{var r;(r=s.tag3DContentSvelte)==null||r.svelteApp.$destroy(),s.tag3DContentSvelte=void 0})}addEventListener(){const{five:e,hooks:n}=this,o=this.handleFiveWantsMoveToPano.bind(this),s=this.handleFiveModeChange.bind(this),r=this.handleFiveCameraUpdate.bind(this),a=this.handleFiveCameraUpdateDebounce(),l=this.handleFivePanoArrived.bind(this),c=this.loadVideoFirstFrame.bind(this),u=this.clickhandler.bind(this),h=this.five.currentMode;return this.handleFiveModeChange(h),this.handleFivePanoArrived(),e.on("wantsMoveToPano",o),e.on("modeChange",s),e.on("initAnimationEnded",this.handleFiveInitAnimationEnded),e.on("modelShownFloorChange",this.handleFiveModelShownFloorChange),e.on("cameraUpdate",r),e.on("cameraUpdate",a),e.on("panoArrived",l),e.on("panoArrived",c),n.on("click",u),()=>{e.off("wantsMoveToPano",o),e.off("modeChange",s),e.off("initAnimationEnded",this.handleFiveInitAnimationEnded),e.off("modelShownFloorChange",this.handleFiveModelShownFloorChange),e.off("cameraUpdate",r),e.off("cameraUpdate",a),e.off("panoArrived",l),e.off("panoArrived",c),n.off("click",u),this.store.eventListenerDisposer=void 0}}loadVideoFirstFrame(){this.isIOSWX&&this.hooks.emit("loadVideoFirstFrame")}addResizeListener(){if(!this.store.resizeObserverDisposer&&!this.store.resizeObserverDisposerAdding){const e=this.addResizeObserver();this.store.resizeObserverDisposerAdding=!0,setTimeout(()=>{this.store.resizeObserverDisposer=e,this.store.resizeObserverDisposerAdding=!1},200)}}addResizeObserver(){if(!this.store.disposed)return;const e=this.five.getElement(),n=()=>{!this.state.enabled||(this.show(),this.updateRenderAllTags())},o=()=>{!this.state.enabled||this.hide()},{observe:s,unobserve:r}=Zs(Pp(()=>{!this.store.resizeObserverDisposer||o()},500),e),{observe:a,unobserve:l}=Zs(Js(()=>n(),400),e);return s(),a(),()=>{r(),l()}}handleFiveModeChange(e){this.tags.forEach(n=>{Re(n)&&e!=="Panorama"&&this.changeTagMode(n,"behind"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags(),this.updateRenderAllTags()}handleFiveWantsMoveToPano(){this.tags.forEach(e=>{const n=this.getTagConfig(e);typeof n.visibleConfig=="object"&&(n.visibleConfig.keep?e.temporaryState=me(H({},e.temporaryState),{visible:n.visibleConfig.keep==="visible"}):e.temporaryState=me(H({},e.temporaryState),{visible:Boolean(n.visibleConfig.alwaysShowWhenMovePano)}))}),this.updateTagContainerVisible()}temporaryShow({withAnimation:e}={withAnimation:!1}){this.store.visibleWithAnimation=e,this.temporaryState.visible=!0,this.updateTagContainerVisible()}temporaryHide({withAnimation:e}={withAnimation:!1}){this.store.visibleWithAnimation=e,this.temporaryState.visible=!1,this.updateTagContainerVisible()}clickhandler(e){if(e.target!=="TagPoint")return;if(!e.tag.state)return console.warn("Clickhandler: params.tag.state is undefined");const n=this.can("fold",e.tag),o=this.can("unfold",e.tag);n&&o&&(e.tag.state.unfolded=!e.tag.state.unfolded,e.tag.state.unfolded&&this.tags.forEach(s=>{s.id!==e.tag.id&&s.state&&this.can("fold",s)&&(s.state.unfolded=!1)}),this.updateRenderAllTags())}updateRenderAllTags(){this.enabledModelTagSet.clear(),this.tags.forEach(e=>e.stickType==="Model"&&this.enabledModelTagSet.add(e.id)),this.updateRenderPointTag(),this.updateRenderPlaneTag(),this.updateRenderModelTag()}updateTagContainerVisible(){var e;(e=this.TagContainerSvelte)==null||e.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation}),this.filter3DTag().forEach(n=>{var o;(o=n.tag3DContentSvelte)==null||o.svelteApp.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation})})}handleFiveCameraUpdateDebounce(){return Js(()=>{this.setUnfoldedByCamera(),this.updateRenderAllTags()},100)}handleFiveCameraUpdate(){this.updateRenderPointTag()}handleFivePanoArrived(){return N(this,null,function*(){yield this.setVisibleAndUnfolded(),this.setModelMedialVisibleByPanoIndex(),this.tags.forEach(e=>{e.temporaryState=me(H({},e.temporaryState),{visible:!0})}),this.store.visibleWithAnimation=!0,this.updateTagContainerVisible()})}setUnfoldedByCamera(){let e=!1;this.tags.forEach(n=>{const o=this.getUnfoldedByCamera(n);!n.state||o!==void 0&&(o===!0&&(e=!0),n.state.unfolded=o)}),e&&this.tags.forEach(n=>{const o=this.getTagConfig(n).unfoldedConfig;typeof o=="object"&&(o.autoUnfold||o.keep)||n.state&&(n.state.unfolded=!1)})}updateRenderPointTag(){var n;const e=this.sort(this.filterPointTag());if(this.setPointTagPosition(),this.TagContainerSvelte)this.TagContainerSvelte.$set({tags:e,state:this.state,temporaryState:this.temporaryState});else{const o=(n=this.five.getElement())==null?void 0:n.parentElement;if(!o)return console.error("updateRenderPlaneTag: tag2DContainer not found");this.TagContainerSvelte=new xv({target:o,props:{hooks:this.hooks,tags:e,state:this.state,temporaryState:this.temporaryState,mediaStore:this.mediaStore}})}}updateRenderPlaneTag(){this.sort([...this.filterPlaneTag(),...this.filter3DPointTag(),...this.filterModelTag()]).forEach(n=>{var l,c,u;if(n.tag3DContentSvelte){const{svelteApp:h,domContainer:d,initialNormal:f,currentNormal:p}=n.tag3DContentSvelte;if(this.updateTagCss3DObjectVisible(n),h.$set({tag:n,hooks:this.hooks,state:this.state,temporaryState:this.temporaryState}),!f.equals(p)){const v=new Q.Quaternion().setFromUnitVectors(f,p);d.css3DObject.setRotationFromQuaternion(v)}return}if(((l=n.state)==null?void 0:l.visible)===!1)return;if(this.css3DRenderPlugin||(this.css3DRenderPlugin=qt(this.five)),n.stickType==="3DPoint"&&!n.normal)return console.error("updateRenderPlaneTag: \u4E09\u7EF4\u70B9\u6807\u7B7E\u7F3A\u5C11\u6CD5\u5411\u91CF\uFF01");const o=(()=>n.stickType==="Plane"?n.position:Re(n)?n.data.mediaPosition:Cp(this.five.camera.position,rt(n.position),rt(n.normal)))();if(!o)return;const s=function(){if(n.normal)return rt(n.normal);if(n.stickType==="Plane")return Ji(n.position);if(n.contentType==="MediaModel")return Ji(o)}();if(!s)return;const r=this.getTagConfig(n).tag3DConfig,a=this.css3DRenderPlugin.create3DDomContainer(o,r);!a||(this.updateTagCss3DObjectVisible(n),this.store.css3DRenderDisposer.set(n.id,a.dispose),n.tag3DContentSvelte={svelteApp:new Pl({target:a.container,props:{tag:n,hooks:this.hooks,state:n.contentType==="MediaModel"?me(H({},this.state),{visible:!1}):this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}}),domContainer:a,initialNormal:s,currentNormal:s},Re(n)&&((c=n.model)==null?void 0:c.object)&&this.updateTagCss3DObjectMatrix(n,(u=n.model)==null?void 0:u.object))}),this.checkPanelTag()}updateRenderModelTag(){const e=o=>!this.enabledModelTagSet.has(o.customID);this.gltfObjectGroup.remove(...this.gltfObjectGroup.children.filter(e)),this.tags.filter(Re).forEach(o=>{var s;(s=o.model)==null||s.promise.then(r=>{r.visible=o.state.visible})})}disposeAllCSS3DContainer(){for(const[e,n]of this.store.css3DRenderDisposer)n==null||n();this.store.css3DRenderDisposer=new Map}checkPanelTag(){this.filter2DPointTag().forEach(e=>{var n;(n=e.tag3DContentSvelte)==null||n.domContainer.dispose(),e.tag3DContentSvelte=void 0});for(const[e,n]of this.store.css3DRenderDisposer){const o=this.getTagById(e);(!o||o.stickType==="2DPoint")&&(n==null||n(),this.store.css3DRenderDisposer.delete(e))}}addMediaModelTag(e){return N(this,null,function*(){const n=e.filter(Re).map(this.loadModel);yield Promise.all(n),this.five.getCurrentState().mode==="Panorama"&&this.setModelMedialVisibleByPanoIndex(),this.updateRenderAllTags()})}changeTagMode(e,n){var o,s,r,a,l;((r=(s=(o=e.tag3DContentSvelte)==null?void 0:o.domContainer)==null?void 0:s.css3DObject)==null?void 0:r.mode)!==n&&((a=e.config)!=null&&a.tag3DConfig?e.config.tag3DConfig.mode=n:e.config?e.config.tag3DConfig={mode:n}:e.config={tag3DConfig:{mode:n}},(l=this.store.css3DRenderDisposer.get(e.id))==null||l(),e.tag3DContentSvelte=void 0)}}const Vv=(i,t)=>new Il(i,t);function ve(i,t){this._camera=i||null,this._domElement=t||document,this._raycaster=new E.Raycaster,this._selected=null,this._boundObjs={};var e=this;this._$onClick=function(){e._onClick.apply(e,arguments)},this._$onDblClick=function(){e._onDblClick.apply(e,arguments)},this._$onMouseMove=function(){e._onMouseMove.apply(e,arguments)},this._$onMouseDown=function(){e._onMouseDown.apply(e,arguments)},this._$onMouseUp=function(){e._onMouseUp.apply(e,arguments)},this._$onTouchMove=function(){e._onTouchMove.apply(e,arguments)},this._$onTouchStart=function(){e._onTouchStart.apply(e,arguments)},this._$onTouchEnd=function(){e._onTouchEnd.apply(e,arguments)},this._$onContextmenu=function(){e._onContextmenu.apply(e,arguments)},this._domElement.addEventListener("click",this._$onClick,!1),this._domElement.addEventListener("dblclick",this._$onDblClick,!1),this._domElement.addEventListener("mousemove",this._$onMouseMove,!1),this._domElement.addEventListener("mousedown",this._$onMouseDown,!1),this._domElement.addEventListener("mouseup",this._$onMouseUp,!1),this._domElement.addEventListener("touchmove",this._$onTouchMove,!1),this._domElement.addEventListener("touchstart",this._$onTouchStart,!1),this._domElement.addEventListener("touchend",this._$onTouchEnd,!1),this._domElement.addEventListener("contextmenu",this._$onContextmenu,!1)}ve.prototype.destroy=function(){this._domElement.removeEventListener("click",this._$onClick,!1),this._domElement.removeEventListener("dblclick",this._$onDblClick,!1),this._domElement.removeEventListener("mousemove",this._$onMouseMove,!1),this._domElement.removeEventListener("mousedown",this._$onMouseDown,!1),this._domElement.removeEventListener("mouseup",this._$onMouseUp,!1),this._domElement.removeEventListener("touchmove",this._$onTouchMove,!1),this._domElement.removeEventListener("touchstart",this._$onTouchStart,!1),this._domElement.removeEventListener("touchend",this._$onTouchEnd,!1),this._domElement.removeEventListener("contextmenu",this._$onContextmenu,!1)};ve.eventNames=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu","touchstart","touchend"];ve.prototype._getRelativeMouseXY=function(i){var t=i.target||i.srcElement;t.nodeType===3&&(t=t.parentNode);var e={x:0,y:0},n=t,o=getComputedStyle(n,null);e.y+=parseInt(o.getPropertyValue("padding-top"),10),e.x+=parseInt(o.getPropertyValue("padding-left"),10);do e.x+=n.offsetLeft,e.y+=n.offsetTop,o=getComputedStyle(n,null),e.x+=parseInt(o.getPropertyValue("border-left-width"),10),e.y+=parseInt(o.getPropertyValue("border-top-width"),10);while(n=n.offsetParent);var s={width:t===window?window.innerWidth:t.offsetWidth,height:t===window?window.innerHeight:t.offsetHeight};return{x:Number((i.pageX-e.x)/s.width)*2-1,y:-((i.pageY-e.y)/s.height)*2+1}};ve.prototype._objectCtxInit=function(i){i._3xDomEvent={}};ve.prototype._objectCtxDeinit=function(i){delete i._3xDomEvent};ve.prototype._objectCtxIsInit=function(i){return!!i._3xDomEvent};ve.prototype._objectCtxGet=function(i){return i._3xDomEvent};ve.prototype.camera=function(i){return i&&(this._camera=i),this._camera};ve.prototype.bind=function(i,t,e,n){console.assert(ve.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]),o[t+"Handlers"].push({callback:e,useCapture:n}),this._boundObjs[t]===void 0&&(this._boundObjs[t]=[]),this._boundObjs[t].push(i)};ve.prototype.addEventListener=ve.prototype.bind;ve.prototype.unbind=function(i,t,e,n){console.assert(ve.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]);for(var s=o[t+"Handlers"],r=0;r<s.length;r++){var a=s[r];if(e==a.callback&&n==a.useCapture){s.splice(r,1);break}}var l=this._boundObjs[t].indexOf(i);this._boundObjs[t].splice(l,1)};ve.prototype.removeEventListener=ve.prototype.unbind;ve.prototype._bound=function(i,t){var e=this._objectCtxGet(t);return e?!!e[i+"Handlers"]:!1};ve.prototype._onMove=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new E.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o),a=this._selected;if(r.length>0){var l,c,u,h=r[0],d=h.object;this._selected=d,u=this._bound("mousemove",d),a!=d&&(l=this._bound("mouseover",d),c=a&&this._bound("mouseout",a))}else c=a&&this._bound("mouseout",a),this._selected=null;u&&this._notify("mousemove",d,n,h),l&&this._notify("mouseover",d,n,h),c&&this._notify("mouseout",a,n,h)}};ve.prototype._onEvent=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new E.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o,!0);if(r.length!==0){for(var a=r[0],l=a.object,c=this._objectCtxGet(l),u=l.parent;typeof c=="undefined"&&u;)c=this._objectCtxGet(u),u=u.parent;!c||this._notify(i,l,n,a)}}};ve.prototype._notify=function(i,t,e,n){var o=this._objectCtxGet(t),s=o?o[i+"Handlers"]:null;if(!o||!s||s.length===0){t.parent&&this._notify(i,t.parent,e,n);return}for(var s=o[i+"Handlers"],r=0;r<s.length;r++){var a=s[r],l=!0;a.callback({type:i,target:t,origDomEvent:e,intersect:n,stopPropagation:function(){l=!1}}),!!l&&a.useCapture===!1&&t.parent&&this._notify(i,t.parent,e,n)}};ve.prototype._onMouseDown=function(i){return this._onMouseEvent("mousedown",i)};ve.prototype._onMouseUp=function(i){return this._onMouseEvent("mouseup",i)};ve.prototype._onMouseEvent=function(i,t){var e=this._getRelativeMouseXY(t);this._onEvent(i,e.x,e.y,t)};ve.prototype._onMouseMove=function(i){var t=this._getRelativeMouseXY(i);this._onMove("mousemove",t.x,t.y,i),this._onMove("mouseover",t.x,t.y,i),this._onMove("mouseout",t.x,t.y,i)};ve.prototype._onClick=function(i){this._onMouseEvent("click",i)};ve.prototype._onDblClick=function(i){this._onMouseEvent("dblclick",i)};ve.prototype._onContextmenu=function(i){this._onMouseEvent("contextmenu",i)};ve.prototype._onTouchStart=function(i){return this._onTouchEvent("touchstart",i)};ve.prototype._onTouchEnd=function(i){return this._onTouchEvent("touchend",i)};ve.prototype._onTouchMove=function(i){if(i.touches.length==1){i.preventDefault();var t=Number(i.touches[0].pageX/window.innerWidth)*2-1,e=-(i.touches[0].pageY/window.innerHeight)*2+1;this._onMove("mousemove",t,e,i),this._onMove("mouseover",t,e,i),this._onMove("mouseout",t,e,i)}};ve.prototype._onTouchEvent=function(i,t){if(t.touches.length==1){t.preventDefault();var e=Number(t.touches[0].pageX/window.innerWidth)*2-1,n=-(t.touches[0].pageY/window.innerHeight)*2+1;this._onEvent(i,e,n,t)}};function kl(i){const t=new E.Box3,e=new E.Vector3;if(i.updateMatrixWorld(!1),i.traverse(n=>{var s;if(n.name==="shadow")return;const o=n.geometry;if(o!==void 0)if((s=o==null?void 0:o.attributes)!=null&&s.position){const r=o.attributes.position;for(let a=0,l=r.count;a<l;a++)e.fromBufferAttribute(r,a).applyMatrix4(n.matrixWorld),t.expandByPoint(e)}else o.vertices.forEach(r=>{const a=r.clone().applyMatrix4(n.matrixWorld);t.expandByPoint(a)})}),!t.isEmpty())return t.translate(i.position.clone().negate()),t}class Pn{constructor(t,e){m(this,"originObject3D");m(this,"hooks");m(this,"disposers",[]);m(this,"helperObject3D");m(this,"camera");m(this,"model");m(this,"scene");m(this,"container");m(this,"domEvents");m(this,"isDragging",!1);m(this,"enabled",!1);m(this,"name","BaseController");m(this,"boundingBox");m(this,"offset");m(this,"onRender");m(this,"onWantsTapGesture",t=>{if(this.getIntersectObject(t))return!1});var c,u;this.hooks=(c=t.sharedHooks)!=null?c:new Zt,this.camera=t.camera,this.model=t.model,this.originObject3D=t.originObject3D,this.helperObject3D=t.helperObject3D,this.container=t.container,this.scene=t.scene,this.domEvents=new ve(t.camera,t.container),this.onRender=(u=t.onRender)!=null?u:()=>{},this.offset=e==null?void 0:e.offset,this.initialHelperPosition(),this.initialHelperQuaternion(),this.enable();const n=(...h)=>this.onSetOriginObjectScale(...h),o=(...h)=>this.onSetOriginObjectRotate(...h),s=(...h)=>this.onSetOriginObjectPosition(...h),r=(...h)=>this.onApplyOriginObjectScale(...h),a=(...h)=>this.onApplyOriginObjectRotate(...h),l=(...h)=>this.onApplyOriginObjectPosition(...h);this.hooks.on("setObjectScale",n),this.hooks.on("setObjectRotate",o),this.hooks.on("setObjectPosition",s),this.hooks.on("applyObjectPosition",l),this.hooks.on("applyObjectRotate",a),this.hooks.on("applyObjectScale",r),this.disposers.push(()=>{this.hooks.off("setObjectScale",n),this.hooks.off("setObjectRotate",o),this.hooks.off("setObjectPosition",s),this.hooks.off("applyObjectPosition",l),this.hooks.off("applyObjectRotate",a),this.hooks.off("applyObjectScale",r)})}initialHelperPosition(){this.helperObject3D.position.add(this.calculateOffset(this.offset)),this.helperObject3D.initialPosition()}initialHelperQuaternion(){this.helperObject3D.initQuaternion()}enable(){this.enabled||(this.enabled=!0,this.scene.add(this.helperObject3D),this.helperObject3D.enable(),this.render())}disable(){!this.enabled||(this.enabled=!1,this.helperObject3D.disable(),this.render())}show(){this.helperObject3D.show(),this.render()}hide(){this.helperObject3D.hide(),this.render()}dispose(){var t;(t=this.disposers)==null||t.forEach(e=>e==null?void 0:e()),this.helperObject3D.dispose(),this.render()}applyHelperMatrix4(t){this.helperObject3D.applyMatrix4(t)}applyHelperQuaternion(t,e){this.helperObject3D.applyHelperQuaternion(t,e)}applyHelperScaleMatrix4(t,e){this.helperObject3D.applyHelperScaleMatrix4(t,e)}onWantsGesture(t,e,n){if(this.isDragging)return!1}onIntersectionOnModelUpdate(t){}onApplyOriginObjectScale(t){this.applyHelperScaleMatrix4(t.matrix4,t.origin)}onApplyOriginObjectRotate(t){this.applyHelperQuaternion(t.quaternion,t.origin)}onApplyOriginObjectPosition(t){this.applyHelperMatrix4(t.matrix4)}onSetOriginObjectScale(t){this.helperObject3D.scale.copy(t),this.updateOffsetByScale(t)}onSetOriginObjectRotate(t,e){this.helperObject3D.quaternion.copy(t)}onSetOriginObjectPosition(t){this.helperObject3D.position.copy(t.clone().add(this.calculateOffset(this.offset)))}render(){this.onRender()}updateOffsetByScale(t){if(this.boundingBox&&this.offset){const e=this.originObject3D.position,n=new E.Vector3().subVectors(this.boundingBox.max,e).multiply(t).add(e),o=new E.Vector3().subVectors(this.boundingBox.min,e).multiply(t).add(e),s=this.calculateOffset(this.offset,{min:o,max:n});this.helperObject3D.position.copy(s),this.helperObject3D.initialPosition()}}hoverListener(t,e=16777215,n=1){const o=(Array.isArray(t)?t:[t]).filter(Ye),s=[];for(const r of o)if(r instanceof E.Mesh||r instanceof E.Group){const a=r instanceof E.Group?r.children.filter(d=>d instanceof E.Mesh):[r];a.forEach(d=>{d.__originalColor__=d.material.color.clone(),d.__originalOpacity__=d.material.opacity});const l=()=>{a.forEach(d=>{d.material.color.set(e),d.material.opacity=n}),this.render()},c=()=>{a.forEach(d=>{d.material.color.copy(d.__originalColor__),d.material.opacity=d.__originalOpacity__}),this.render()},u=()=>{this.isDragging||l()},h=()=>{this.isDragging||c()};for(const d of a)this.domEvents.addEventListener(d,"mouseover",u),this.domEvents.addEventListener(d,"mouseout",h),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",c),this.hooks.on("rotateEnd",c),s.push(()=>{this.domEvents.removeEventListener(d,"mouseover",u),this.domEvents.removeEventListener(d,"mouseout",h),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",c),this.hooks.off("rotateEnd",c)})}return()=>s.forEach(r=>r==null?void 0:r())}getIntersectObject(t){const e=this.camera.position,n=this.helperObject3D;if(!n)return;const o=this.helperObject3D.raycasterIntersectObject(t)[0];if(!o)return;const s=o;if(s.object=n,this.model.intersectRaycaster){const r=this.model.intersectRaycaster(t)[0];if(r&&r.point.distanceTo(e)<s.point.distanceTo(e))return}return s.object}calculateOffset(t,e){const n=this.originObject3D,o=new E.Vector3(0,0,0);if(!t)return o;const s=()=>e||(this.boundingBox?this.boundingBox:(this.boundingBox=kl(n),this.boundingBox));if(typeof t.x=="number")o.setX(t.x);else if(typeof t.x=="object"){const r=s();o.setX((r.max.x-r.min.x)*t.x.percents)}if(typeof t.y=="number")o.setY(t.y);else if(typeof t.y=="object"){const r=s();o.setY((r.max.y-r.min.y)*t.y.percents)}if(typeof t.z=="number")o.setZ(t.z);else if(typeof t.z=="object"){const r=s();o.setZ((r.max.z-r.min.z)*t.z.percents)}return o}}class Rv extends Pn{constructor(...e){super(...e);m(this,"name","ScaleController")}setScale(e){var l,c,u;let n=1,o=1,s=1;typeof e=="number"?(n=e,o=e,s=e):typeof e=="object"&&(n=(l=e.x)!=null?l:1,o=(c=e.y)!=null?c:1,s=(u=e.z)!=null?u:1);const r=new E.Vector3(n,o,s);this.hooks.emit("wantToScale",r)||(this.originObject3D.scale.copy(r),this.hooks.emit("setObjectScale",r),this.hooks.emit("scale",r),this.render())}}class Qv extends Q.Object3D{constructor(){super()}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}}class gi extends Qv{constructor(e,n){var o;super();m(this,"originObject3D");m(this,"onRender");this.originObject3D=e,this.onRender=(o=n==null?void 0:n.onRender)!=null?o:()=>{}}get helperObject(){return this}render(){this.onRender()}enable(){this.parent.children.includes(this)||this.parent.add(this)}disable(){this.removeFromParent()}show(){this.visible=!0,this.render()}hide(){this.visible=!1,this.render()}raycasterIntersectObject(e,n=[]){return e.intersectObject(this,!0,n)}initialPosition(){this.position.add(this.originObject3D.position)}initQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}applyHelperScaleMatrix4(e,n){this.scale.applyMatrix4(e)}setHelperQuaternion(e,n){if(n){const o=new Q.Vector3().subVectors(this.position,n).applyQuaternion(e).add(n);this.position.copy(o)}this.quaternion.copy(e)}applyHelperQuaternion(e,n){if(n){const o=new Q.Vector3().subVectors(this.position,n).applyQuaternion(e).add(n);this.position.copy(o)}this.applyQuaternion(e)}dispose(){this.removeFromParent()}}class Ov extends gi{}class Hv extends gi{}class Fv extends gi{}class xl extends gi{}class Gv extends xl{}class Wv extends E.Group{constructor(e){super();m(this,"direction");this.direction=e||"x"}}class na extends E.Mesh{constructor(e,n,o){super(e,n);m(this,"direction");this.direction=o||"x"}}function Nv(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return Object.assign(new E.Vector2,{x:(i.x-s)/e*2-1,y:-(i.y-o)/n*2+1})}function yo(i,t,e){if(!t||!e||!i)return;const n=Nv(t,e);if(Math.abs(n.x)===1||Math.abs(n.y)===1)return;const o=new E.Raycaster;return o.setFromCamera(n,i),o}function _v(i,t){return!(Math.abs(i.x-t.x)>1e-5||Math.abs(i.y-t.y)>1e-5||Math.abs(i.z-t.z)>1e-5)}class Bi extends Wv{constructor(e){var u;super(e.direction);m(this,"line");m(this,"arrow");m(this,"lineHeight",.4);m(this,"arrowHeight",.1);this.name="ArrowGroup";const n=new E.Color((u=e.color)!=null?u:16214315),o=new E.MeshBasicMaterial({color:n,depthTest:!1,opacity:1,transparent:!0,side:E.DoubleSide}),s=new E.ConeGeometry(.04,.1,32),r=new na(s,o.clone(),e.direction);r.name=`arrow-${e.direction}`,this.arrow=r;const a=.004,l=new E.CylinderGeometry(a,a,.4,32),c=new na(l,o.clone(),e.direction);c.name=`line-${e.direction}`,this.line=c,this.formatArrow(),this.formatLine(),this.add(this.arrow,this.line)}formatArrow(){this.arrow.geometry.translate(0,this.lineHeight+this.arrowHeight/2,0),this.direction==="x"?(this.arrow.geometry.rotateX(Math.PI/2),this.arrow.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.arrow.geometry.rotateX(Math.PI/2)}formatLine(){this.line.geometry.translate(0,this.lineHeight/2,0),this.direction==="x"?(this.line.geometry.rotateX(Math.PI/2),this.line.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.line.geometry.rotateX(Math.PI/2)}}const ji={X:15618642,Y:4765519,Z:4227839};class st{static get X(){return new E.Color(ji.X).convertSRGBToLinear().clone()}static get Y(){return new E.Color(ji.Y).convertSRGBToLinear().clone()}static get Z(){return new E.Color(ji.Z).convertSRGBToLinear().clone()}}class Xv extends Ov{constructor(e){super(e);m(this,"xArrow",new Bi({direction:"x",color:st.X}));m(this,"yArrow",new Bi({direction:"y",color:st.Y}));m(this,"zArrow",new Bi({direction:"z",color:st.Z}));this.add(this.xArrow),this.add(this.yArrow),this.add(this.zArrow)}show(){super.show(),this.xArrow.visible=!0,this.yArrow.visible=!0,this.zArrow.visible=!0}showDraggingHelper(e){this.xArrow.visible=e.includes("x"),this.yArrow.visible=e.includes("y"),this.zArrow.visible=e.includes("z")}dispose(){this.remove(this.xArrow,this.yArrow,this.zArrow)}}function Mt(i,t){return Yv(document.createElement(t!=null?t:"div"),i)}function Yv(i,t){if(!t)return i;for(const e in t)e&&t[e]&&(i.style[e]=t[e]);return i}function Uv(i){const t=Mt(H({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},i)),e=()=>{t.style.display!=="block"&&(!t.style.top||!t.style.left||(t.style.display="block"))};return{element:t,show:e,hide:()=>{t.style.display="none",t.style.top="",t.style.left=""},setLeftTop:(s,r)=>{t.style.left=s,t.style.top=r,e()}}}class Jv extends Fv{constructor(e,n){var o;super(e);m(this,"yzCircle");m(this,"xzCircle");m(this,"xyCircle");m(this,"xRingHelper");m(this,"yRingHelper");m(this,"zRingHelper");m(this,"xAngleHelper");m(this,"yAngleHelper");m(this,"zAngleHelper");m(this,"angleTips");m(this,"container");(n==null?void 0:n.yzCircleEnable)!==!1&&(this.yzCircle=new Vi({direction:"x",color:st.X}),this.xRingHelper=new Ri({direction:"x"}),this.xAngleHelper=new Qi({direction:"x",color:st.X})),(n==null?void 0:n.xzCircleEnable)!==!1&&(this.xzCircle=new Vi({direction:"y",color:st.Y}),this.yRingHelper=new Ri({direction:"y"}),this.yAngleHelper=new Qi({direction:"y",color:st.Y})),(n==null?void 0:n.xyCircleEnable)!==!1&&(this.xyCircle=new Vi({direction:"z",color:st.Z}),this.zRingHelper=new Ri({direction:"z"}),this.zAngleHelper=new Qi({direction:"z",color:st.Z})),n!=null&&n.container&&(this.container=n==null?void 0:n.container,this.angleTips=Uv({display:"none"}),(o=this.container)==null||o.appendChild(this.angleTips.element)),this.show()}updateAngleHelperQuaternion(){var e,n,o,s,r,a,l,c,u,h,d,f;(n=this.xAngleHelper)==null||n.quaternion.copy((e=this.yzCircle)==null?void 0:e.quaternion),(s=this.yAngleHelper)==null||s.quaternion.copy((o=this.xzCircle)==null?void 0:o.quaternion),(a=this.zAngleHelper)==null||a.quaternion.copy((r=this.xyCircle)==null?void 0:r.quaternion),(c=this.xRingHelper)==null||c.quaternion.copy((l=this.yzCircle)==null?void 0:l.quaternion),(h=this.yRingHelper)==null||h.quaternion.copy((u=this.xzCircle)==null?void 0:u.quaternion),(f=this.zRingHelper)==null||f.quaternion.copy((d=this.xyCircle)==null?void 0:d.quaternion)}applyHelperQuaternion(e,n){var o,s,r,a,l,c;(o=this.yzCircle)==null||o.applyQuaternion(e),(s=this.xzCircle)==null||s.applyQuaternion(e),(r=this.xyCircle)==null||r.applyQuaternion(e),(a=this.xAngleHelper)==null||a.baseAxes.applyQuaternion(e),(l=this.yAngleHelper)==null||l.baseAxes.applyQuaternion(e),(c=this.zAngleHelper)==null||c.baseAxes.applyQuaternion(e)}hide(){this.remove(this.yzCircle,this.xzCircle,this.xyCircle,this.xRingHelper,this.yRingHelper,this.zRingHelper,this.xAngleHelper,this.yAngleHelper,this.zAngleHelper)}show(){var e;this.add(...[this.xyCircle,this.xzCircle,this.yzCircle].filter(Boolean)),this.remove(...[this.xRingHelper,this.yRingHelper,this.zRingHelper,this.xAngleHelper,this.yAngleHelper,this.zAngleHelper].filter(Boolean)),(e=this.angleTips)==null||e.hide()}showDraggingHelper(e){var n;this.hide(),this.add(...this.filterRingHelper(e)),this.add(...this.filterAngleHelper(e)),(n=this.angleTips)==null||n.show()}dispose(){var e,n;this.remove(...[this.yzCircle,this.xzCircle,this.xyCircle,this.xRingHelper,this.yRingHelper,this.zRingHelper,this.xAngleHelper,this.yAngleHelper,this.zAngleHelper].filter(Boolean)),(n=(e=this.angleTips)==null?void 0:e.element)==null||n.remove()}filterRingHelper(e){return[this.xRingHelper,this.yRingHelper,this.zRingHelper].filter(n=>e.includes(n==null?void 0:n.direction)).filter(Boolean)}filterAngleHelper(e){return[this.xAngleHelper,this.yAngleHelper,this.zAngleHelper].filter(n=>e.includes(n==null?void 0:n.direction)).filter(Boolean)}}class Vi extends E.Mesh{constructor(e){var n;super();m(this,"direction");m(this,"gapAngle",.02);m(this,"geometry",new E.RingGeometry(.25,.3,20,8,this.gapAngle,Math.PI/2-this.gapAngle*2));this.material=new E.MeshBasicMaterial({opacity:.6,color:(n=e.color)!=null?n:16777215,transparent:!0,side:E.DoubleSide,depthTest:!1}),this.direction=e.direction,this.geometry.name=`RotateHelperCircleGeometry-${this.direction}`,this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}class Ri extends E.Group{constructor(e){super();m(this,"direction");this.direction=e.direction;const n=.015,o=new Array(8).fill(null).map((s,r)=>{const a=new E.RingGeometry(.25,.3,20,8,Math.PI/4*r+n,Math.PI/4-n*2),l=new E.MeshBasicMaterial({opacity:1,color:16777215,depthTest:!1,transparent:!0,side:E.DoubleSide}),c=new E.Mesh(a,l);return c.name=`AxesDashedRing-${this.direction}-${r}`,c});this.add(...o),this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}class Qi extends E.Mesh{constructor(e){var o;super();m(this,"direction");m(this,"baseAxes");switch(e.direction){case"x":this.baseAxes=new E.Vector3(0,0,1);break;case"y":this.baseAxes=new E.Vector3(1,0,0);break;case"z":this.baseAxes=new E.Vector3(1,0,0);break}const n=.3+5e-4;this.geometry=new E.CircleGeometry(n,48,0,1e-4),this.material=new E.MeshBasicMaterial({opacity:.4,color:(o=e.color)!=null?o:16777215,depthTest:!1,transparent:!0,side:E.DoubleSide}),this.direction=e.direction,this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}function Zv(){const i=Mt({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=Mt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=Mt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"absolute",border:"1px solid rgba(255,255,255,0.4)"});i.appendChild(t),t.appendChild(e);const n="-4px",o={direction:"nesw",element:ft({cursor:"nesw-resize",left:n,bottom:n})},s={direction:"ns",element:ft({cursor:"ns-resize",bottom:n})},r={direction:"nwse",element:ft({cursor:"nwse-resize",right:n,bottom:n})},a={direction:"ew",element:ft({cursor:"ew-resize",right:n})},l={direction:"nesw",element:ft({cursor:"nesw-resize",right:n,top:n})},c={direction:"ns",element:ft({cursor:"ns-resize",top:n})},u={direction:"nwse",element:ft({cursor:"nwse-resize",left:n,top:n})},h={direction:"ew",element:ft({cursor:"ew-resize",left:n})};return new Array(s,a,c,h,o,r,l,u).forEach(f=>t.appendChild(f.element)),{container:i,squares:[o,s,r,a,l,c,u,h]}}function ft(i){const t=Mt(H({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},i)),e=Mt({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),n=Mt({width:"15px",height:"15px",cursor:i==null?void 0:i.cursor,pointerEvents:"auto",background:"transparent"});return n.draggable=!0,e.appendChild(n),t.appendChild(e),t}class qv extends Gv{constructor(e,n,o,s){super(e);m(this,"points",[]);m(this,"cornerPositions",[]);m(this,"css3DInstance");m(this,"plane");m(this,"css3DRenderer",new _t);m(this,"camera");m(this,"scene");m(this,"container");m(this,"enabled",!1);this.camera=o,this.scene=s,this.container=n,this.initRectangleScaleHelper()}get helperObject(){var e;if(!((e=this.css3DInstance)!=null&&e.css3DObject))throw new Error("css3DInstance is not initialized");return this.css3DInstance.css3DObject}updatePosition(){var e;this.helperObject.position.copy(this.originObject3D.position),(e=this.plane)==null||e.position.copy(this.originObject3D.position)}updateQuaternion(){var e;(e=this.plane)==null||e.quaternion.copy(this.originObject3D.quaternion)}applyMatrix4(e){var n;super.applyMatrix4(e),this.helperObject.applyMatrix4(e),(n=this.plane)==null||n.applyMatrix4(e),this.cornerPositions.forEach(o=>o.applyMatrix4(e))}showDraggingHelper(){}applyHelperScaleMatrix4(e,n){var o;(o=this.plane)==null||o.scale.applyMatrix4(e),this.helperObject.applyScaleMatrix4(e)}updatePoints(){const e=this.calculatePointPosition(this.cornerPositions);this.points.forEach((n,o)=>{n.position.copy(e[o])})}applyHelperQuaternion(e,n){var s;const o=(s=this.css3DInstance)==null?void 0:s.css3DObject;if(o){const r=new E.Vector3().subVectors(o.position,n).applyQuaternion(e).add(n);o.position.copy(r),o.applyQuaternion(e)}if(this.plane){const r=new E.Vector3().subVectors(this.plane.position,n).applyQuaternion(e).add(n);this.plane.position.copy(r),this.plane.applyQuaternion(e)}this.cornerPositions.forEach(r=>{const a=new E.Vector3().subVectors(r,n).applyQuaternion(e).add(n);r.copy(a)})}enable(){var e;this.enabled||(this.enabled=!0,(e=this.css3DInstance)==null||e.enable(),this.plane&&this.scene.add(this.plane))}disable(){var e;!this.enabled||(this.enabled=!1,(e=this.css3DInstance)==null||e.disable(),this.plane&&this.scene.remove(this.plane))}show(){var e;(e=this.css3DInstance)==null||e.show(),this.plane&&(this.plane.visible=!0)}hide(){var e;(e=this.css3DInstance)==null||e.hide(),this.plane&&(this.plane.visible=!1)}dispose(){this.disable(),this.css3DRenderer.dispose()}initRectangleScaleHelper(){var a;const e=this.getCornerPositions();if(!e)return;this.cornerPositions=e;const n=this.css3DRenderer.create3DElement(this.camera,e,{ratio:.003});if(!n)return;this.css3DInstance=n,n.appendToElement(this.container);const o=n.css3DObject.container,{container:s,squares:r}=Zv();this.points=r.map((l,c)=>({direction:l.direction,point:l.element,position:this.calculatePointPosition(e)[c]})),o.insertBefore(s,(a=o.children[0])!=null?a:null),this.updatePosition()}getCornerPositions(){const{originObject3D:e}=this;if(e.isCSS3DObjectPlus)return e.cornerPoints;console.error("\u5F53\u524D\u7269\u4F53\u6682\u65F6\u4E0D\u652F\u6301 ScaleHelper")}calculatePointPosition(e){return[e[0].clone(),e[0].clone().add(e[1]).divideScalar(2),e[1].clone(),e[1].clone().add(e[2]).divideScalar(2),e[2].clone(),e[2].clone().add(e[3]).divideScalar(2),e[3].clone(),e[3].clone().add(e[0]).divideScalar(2)]}}class Kv extends Hv{constructor(e){super(e);m(this,"box");m(this,"outline");m(this,"originObject");m(this,"positionAttribute");this.originObject=e,this.positionAttribute=new E.BufferAttribute(new Float32Array(8*3),3),this.box=this.createBox(),this.outline=this.createOutline(),this.add(this.box,this.outline),this.update()}raycasterIntersectObject(e,n){return e.intersectObject(this,!1,n)}raycast(e,n){this.box.raycast(e,n)}update(){const e=kl(this.originObject);if(!e)return;const{min:n,max:o}=e;this.positionAttribute.setXYZ(0,o.x,o.y,o.z),this.positionAttribute.setXYZ(1,n.x,o.y,o.z),this.positionAttribute.setXYZ(2,n.x,n.y,o.z),this.positionAttribute.setXYZ(3,o.x,n.y,o.z),this.positionAttribute.setXYZ(4,o.x,o.y,n.z),this.positionAttribute.setXYZ(5,n.x,o.y,n.z),this.positionAttribute.setXYZ(6,n.x,n.y,n.z),this.positionAttribute.setXYZ(7,o.x,n.y,n.z),this.positionAttribute.needsUpdate=!0}createOutline(){const e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new E.BufferGeometry;n.setIndex(new E.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const o=new E.LineBasicMaterial({color:64767,linewidth:1,opacity:1,depthTest:!1,transparent:!0,toneMapped:!1}),s=new E.LineSegments(n,o);return s.matrixAutoUpdate=!1,s}createBox(){const e=new Uint16Array([0,1,2,0,2,3,0,3,7,0,7,4,0,4,5,0,5,1,6,1,5,6,2,1,6,5,4,6,4,7,6,3,2,6,7,3]),n=new E.BufferGeometry;n.setIndex(new E.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const o=new E.MeshBasicMaterial({color:64767,opacity:.1,depthTest:!1,transparent:!0});return new E.Mesh(n,o)}}class $v extends Pn{constructor(...e){super(...e);m(this,"name","MoveController");m(this,"startInfo");m(this,"_moveByMouseEnable",!1);m(this,"mouseInfo");m(this,"mousedownEventListenerDisposer");const n=this.helperObject3D;this.hoverListener([n.xArrow,n.yArrow,n.zArrow]);const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r),this.hooks.on("rotateStart",l),this.hooks.on("rotateEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.disposers.push(()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",o),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r),this.hooks.off("rotateStart",l),this.hooks.off("rotateEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}),this.moveByMouseEnable&&this.moveByMouse()}get moveByMouseEnable(){return this._moveByMouseEnable}dispose(){var e;super.dispose(),(e=this.disposers)==null||e.forEach(n=>n==null?void 0:n())}moveByMouse(){this._moveByMouseEnable=!0;const e=this.handleMouseDown.bind(this),n=this.handleMouseUp.bind(this);this.hooks.emit("moveByMouseEnable"),setTimeout(()=>{this.container.addEventListener("mousedown",e),this.container.addEventListener("mouseup",n)}),this.mousedownEventListenerDisposer=()=>{this.container.removeEventListener("mousedown",e),this.container.removeEventListener("mouseup",n)}}disableMoveByMouse(){var e;this._moveByMouseEnable=!1,this.hooks.emit("moveByMouseDisable"),(e=this.mousedownEventListenerDisposer)==null||e.call(this)}onIntersectionOnModelUpdate(e){!this.moveByMouseEnable||this.hooks.emit("wantToMove",e.point)||(this.originObject3D.position.copy(e.point),this.hooks.emit("setObjectPosition",e.point),this.hooks.emit("move",e.point))}onApplyOriginObjectScale(e){}handleMouseDown(e){const{x:n,y:o}=e;this.mouseInfo={x:n,y:o,mouseDownTimestamp:Date.now()}}handleMouseUp(e){if(!this.mouseInfo)return;const{x:n,y:o}=e;this.mouseInfo.x===n&&this.mouseInfo.y===o&&Date.now()-this.mouseInfo.mouseDownTimestamp<500&&(this.disableMoveByMouse(),this.mouseInfo=void 0)}dragStart(e){if(this._moveByMouseEnable||this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();const s=new E.Vector3(1,0,0).applyQuaternion(this.helperObject3D.quaternion),r=new E.Vector3(0,1,0).applyQuaternion(this.helperObject3D.quaternion),a=new E.Vector3(0,0,1).applyQuaternion(this.helperObject3D.quaternion),l=(()=>{switch(o){case"x":return s;case"y":return r;case"z":return a}})(),c=(()=>{switch(o){case"x":case"y":return a;case"z":return s}})(),u=n.point.clone(),h=new E.Plane;h.setFromNormalAndCoplanarPoint(c,u),this.startInfo={startVectorProject:u.clone().projectOnVector(l),directionVector:l,plane:h},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("moveStart"),this.isDragging=!0,console.log("%c MoveController dragStart","color: #e5af2e")}dragging(e){if(!this.isDragging||!this.startInfo)return;const n=yo(this.camera,e,this.container);return n?(console.log("%c MoveController dragging","color: #49de1b"),this.move(n),!1):this.dragEnd()}move(e){if(!this.startInfo)return this.dragEnd();const{plane:n,directionVector:o,startVectorProject:s}=this.startInfo,r=this.originObject3D,a=e.ray.intersectPlane(n,new E.Vector3);if(!a)return;const l=a.clone().projectOnVector(o),c=l.clone().sub(s),u=new E.Matrix4;u.setPosition(c);const h=r.position.clone().applyMatrix4(u);this.hooks.emit("wantToMove",h)||(r.applyMatrix4(u),s.copy(l),this.hooks.emit("applyObjectPosition",{matrix4:u}),this.hooks.emit("move",h))}dragEnd(){!this.isDragging||(console.log("%c MoveController dragEnd","color: #e94e4e"),this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("moveEnd"))}}class cn{constructor(t,e,n,o,s,r){m(this,"helperController");m(this,"five");m(this,"onFiveWantsTapGesture",t=>{if(!this.helperController)return;const e=this.helperController.onWantsTapGesture(t);return this.five.needsRender=!0,e});m(this,"onFiveWantsGesture",(...t)=>{if(!this.helperController)return;const e=this.helperController.onWantsGesture(...t);return this.five.needsRender=!0,e});m(this,"onFiveIntersectionOnModelUpdate",(...t)=>{!this.helperController||this.helperController.onIntersectionOnModelUpdate(...t)});const{camera:a,model:l,scene:c}=t,u=t.getElement();if(this.five=t,!a||!l||!u||!c)return;const h=()=>{t.needsRender=!0};this.helperController=new e({camera:a,model:l,originObject3D:n,helperObject3D:o,container:u,scene:c,onRender:h,sharedHooks:r},s),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsGesture",this.onFiveWantsGesture),t.on("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate)}dispose(){var t;this.five.off("wantsTapGesture",this.onFiveWantsTapGesture),this.five.off("wantsGesture",this.onFiveWantsGesture),this.five.off("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate),(t=this.helperController)==null||t.dispose()}}const eb="v1.0.1",tb="Object3DHelper",wo=`${tb}@${eb}`,nb=()=>{console.error(`${wo} is disposed`)},ib=()=>{console.warn(`${wo} is disabled`)},ob=()=>{console.error(`${wo} is disabled`)};class sb{constructor(t){m(this,"controllers",{});m(this,"state",{visible:!0,enabled:!0,disposed:!1});m(this,"hooks",new Zt);m(this,"eventListener",{});t&&this.addControllers(t),this.setState(this.state)}show(t){return N(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return N(this,null,function*(){this.setState({visible:!1},t)})}enable(t){this.setState({enabled:!0},t)}disable(t){this.setState({enabled:!1},t)}dispose(){this.setState({disposed:!0})}setState(t,e){if(this.state.disposed)return nb();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return ob();const n=H({},this.state);this.state=H(H({},this.state),t),t.disposed!==void 0&&t.disposed!==n.disposed&&t.disposed&&this.handleDispose(),t.visible!==void 0&&this.handleVisible(t.visible),t.enabled!==void 0&&this.handleEnable(t.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:n})}addControllers(t){this.controllers=H(H({},this.controllers),t),this.setState(this.state)}getCurrentState(){return this.state}handleEnable(t,e=!0){t?(this.everyControllerDo(n=>{n.enable()}),this.hooks.emit("enable",{userAction:e})):(this.everyControllerDo(n=>{n.disable()}),this.hooks.emit("disable",{userAction:e})),this.state.enabled=t}handleVisible(t,e=!0){t?(this.everyControllerDo(n=>{n.show()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:e}))):(this.everyControllerDo(n=>{n.hide()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:e}))),this.state.visible=t}everyControllerDo(t){Object.values(this.controllers).forEach(e=>{e&&t(e)})}handleDispose(){var t,e;Object.values(this.controllers).forEach(n=>{n==null||n.dispose()});for(const n in this.controllers){if(!n)continue;const o=n;(e=(t=this.eventListener)[o])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&ib()}}class rb extends Pn{constructor(...e){super(...e);m(this,"name","RotateController");m(this,"startInfo");m(this,"lastRotation");m(this,"rotations",[]);m(this,"helperObject3DQuaternion",this.originObject3D.quaternion.clone());m(this,"removeListener");const n=this.helperObject3D;this.hoverListener([n.xyCircle,n.xzCircle,n.yzCircle]);const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.removeListener=()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",o),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}}get rotateCenter(){return this.helperObject3D.position.clone()}initialHelperQuaternion(){this.helperObject3D.updateAngleHelperQuaternion(),this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion)}setRotateAngle(e){const{x:n=0,y:o=0,z:s=0}=e,r=new E.Euler(Math.PI*n/180,Math.PI*o/180,Math.PI*s/180),a=new E.Quaternion().setFromEuler(r);if(this.hooks.emit("wantToRotate",a))return;const{originObject3D:c,rotateCenter:u}=this;if(u){const h=new E.Vector3().subVectors(c.position,u).applyQuaternion(a).add(u);c.position.copy(h)}c.quaternion.copy(a),this.helperObject3DQuaternion.copy(a),this.hooks.emit("setObjectRotate",a,u),this.hooks.emit("rotate",a),this.render()}dispose(){this.removeListener(),super.dispose()}onApplyOriginObjectScale(e){}dragStart(e){if(this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();this.helperObject3D.updateAngleHelperQuaternion();const s=n.point,r=this.getAngleHelper(o);this.setTipsAngle(0);const a=s.clone();a.y+=.2,this.setTipsPosition(a);const l=new E.Vector3(1,0,0).applyQuaternion(this.helperObject3DQuaternion),c=new E.Vector3(0,1,0).applyQuaternion(this.helperObject3DQuaternion),u=new E.Vector3(0,0,1).applyQuaternion(this.helperObject3DQuaternion),h=(()=>{switch(o){case"x":return l;case"y":return c;case"z":return u}})(),d=new E.Plane().setFromNormalAndCoplanarPoint(h,s),f=new E.Vector3;d.projectPoint(s.clone(),f);const p=f.clone().sub(this.rotateCenter),v=p.clone(),g=p.angleTo(r.baseAxes);this.setAngleHelperStart(o,g),this.setAngleHelperLength(o,0),this.rotations.push({vector:p.clone(),direction:!0}),this.startInfo={direction:o,startVector:p,staticStartVector:v,plane:d,angleHelper:r},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("rotateStart"),this.isDragging=!0,console.log(`%c RotateController dragStart ${o}`,"color: #e5af2e")}dragging(e){var o;if(!this.isDragging)return;const n=yo(this.camera,e,this.container);return n?(console.log(`%c RotateController dragging ${(o=this.startInfo)==null?void 0:o.direction}`,"color: #49de1b"),this.rotate(n),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:n,plane:o,angleHelper:s,staticStartVector:r,direction:a}=this.startInfo,l=e.ray.intersectPlane(o,new E.Vector3);if(!l)return;const c=this.rotateCenter,u=new E.Vector3;o.projectPoint(l.clone(),u);const h=u.clone().sub(c);if(n.angleTo(h)===0||(this.lastRotation===void 0&&(this.lastRotation={angle:0}),this.rotations.length===0))return;const d=(()=>{if(this.rotations.length===1)return h.angleTo(s.baseAxes)>r.angleTo(s.baseAxes);{const A=this.rotations[this.rotations.length-1],y=this.rotations[this.rotations.length-2],w=h.angleTo(y.vector),C=h.angleTo(A.vector),x=A.vector.angleTo(y.vector);if(x===0||C===0||w===0)return;if(w>C&&w>x)return A.direction;if(w<x&&C<x||w<C&&C>x)return!A.direction}})();if(d===void 0)return console.warn("rotationDirection is undefined");const f=new E.Quaternion().setFromUnitVectors(n.clone().normalize(),h.clone().normalize()),{originObject3D:p}=this,v=p.quaternion.clone().premultiply(f);if(!this.hooks.emit("wantToRotate",v)){if(this.rotations.push({vector:h,direction:d}),this.rotations=this.rotations.slice(-2),this.lastRotation.angle=this.lastRotation.angle+h.angleTo(n)*(d?1:-1),this.setAngleHelperLength(a,this.lastRotation.angle),this.setTipsAngle(this.lastRotation.angle/Math.PI*180),c){const A=new E.Vector3().subVectors(p.position,c).applyQuaternion(f).add(c);p.position.copy(A)}p.applyQuaternion(f),this.helperObject3DQuaternion.premultiply(f),this.hooks.emit("applyObjectRotate",{quaternion:f,origin:c}),this.hooks.emit("rotate",p.quaternion),this.startInfo.startVector=h}}dragEnd(){!this.isDragging||(console.log("%c RotateController dragEnd","color: #e94e4e"),this.startInfo=void 0,this.isDragging=!1,this.lastRotation=void 0,this.rotations=[],this.helperObject3D.show(),this.hooks.emit("rotateEnd"))}getAngleHelper(e){switch(e){case"x":return this.helperObject3D.xAngleHelper;case"y":return this.helperObject3D.yAngleHelper;case"z":return this.helperObject3D.zAngleHelper}}setAngleHelperStart(e,n){const o=this.getAngleHelper(e);if(o instanceof E.Mesh&&o.geometry instanceof E.CircleGeometry){const{radius:s,segments:r,thetaLength:a}=o.geometry.parameters;o.geometry=new E.CircleGeometry(s,r,n,a)}else console.warn("only support THREE.CircleGeometry")}setAngleHelperLength(e,n){const s=n>=0?Math.max(n,.001):Math.min(n,-.001),r=this.getAngleHelper(e);if(r instanceof E.Mesh&&r.geometry instanceof E.CircleGeometry){const{radius:a,thetaStart:l}=r.geometry.parameters,c=Math.ceil(Math.abs(s)*(40/(2*Math.PI)));r.geometry=new E.CircleGeometry(a,c,l,s)}else console.warn("only support THREE.CircleGeometry")}setTipsAngle(e){var o;const n=(o=this.helperObject3D.angleTips)==null?void 0:o.element;!n||(n.innerText=`${e.toFixed(0)}\xB0`)}setTipsPosition(e){const n=this.helperObject3D.angleTips;if(!n)return;const o=e.project(this.camera),{x:s,y:r,z:a}=o;if(a>1)return;const l=(s+1)/2*100+"%",c=(-r+1)/2*100+"%";n.setLeftTop(l,c)}}class ab extends Pn{constructor(...e){super(...e);m(this,"startInfo");m(this,"name","RectangleScaleController")}enable(){this.helperObject3D.enable(),super.enable()}disable(){this.helperObject3D.disable(),super.disable()}show(){this.helperObject3D.show(),super.show()}hide(){this.helperObject3D.hide(),super.hide()}onApplyOriginObjectScale(e){}getDragPlane(){const e=new E.Plane,n=this.helperObject3D.cornerPositions;if(n.length!==0)return n.length<3?e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new Q.Vector3),n[0]):e.setFromCoplanarPoints(n[0],n[1],n[2]),e}dragStart(e,n){var s,r;(r=(s=this.helperObject3D).updatePoints)==null||r.call(s);const o=this.getDragPlane();if(!o)return this.dragEnd();this.startInfo={startPoint:{position:n.position.clone(),direction:n.direction},plane:o},this.hooks.emit("scaleStart"),this.render(),this.isDragging=!0,console.log("%c RectangleScaleController dragStart","color: #e5af2e")}dragging(e){if(!this.isDragging)return;const n=yo(this.camera,e,this.container);if(!n)return this.dragEnd();this.scale(n),console.log("%c RectangleScaleController dragging","color: #49de1b")}scale(e){var j,_;if(!this.startInfo)return;const n=this.originObject3D,{startPoint:o,plane:s}=this.startInfo,r=this.helperObject3D.cornerPositions;if(r.length<4)return this.dragEnd();const a=e.ray.intersectPlane(s,new Q.Vector3);if(!a||_v(a,this.camera.position))return;const l=new Q.Vector3().addVectors(r[0],r[2]).divideScalar(2),{position:c,direction:u}=o,h=new Q.Vector3().subVectors(r[1],r[0]),d=new Q.Vector3().subVectors(r[3],r[0]),f=F=>{const J=new Q.Vector3(0,0,0);if(!this.startInfo)return J;const V=(F==="ew"?h:d).clone(),B=c.clone().projectOnVector(V),O=a.clone().projectOnVector(V),W=l.clone().projectOnVector(V);if(O.equals(B))return J;if(F==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const X=new Q.Vector3().subVectors(O,W),U=X.x<0&&V.x>=0,de=X.y<0&&V.y>=0,he=X.z<0&&V.z>=0;this.startInfo.dragPointInCenterBottom=U||de||he}if(F==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const X=new Q.Vector3().subVectors(O,W),U=X.x<0&&V.x>=0,de=X.y<0&&V.y>=0,he=X.z<0&&V.z>=0;this.startInfo.dragPointInCenterLeft=U||de||he}const G=new Q.Vector3().subVectors(O,B),ee=G.length();return ee>.3?(console.warn("offset.length() > 0.3, skipped",ee),J):G},p=f("ew"),v=f("ns"),g=()=>{const F=p;this.helperObject3D.cornerPositions.forEach((J,V)=>{var B;(B=this.startInfo)!=null&&B.dragPointInCenterLeft?(V===0||V===3)&&J.add(F):(V===1||V===2)&&J.add(F)})},A=()=>{const F=v;this.helperObject3D.cornerPositions.forEach((J,V)=>{var B;(B=this.startInfo)!=null&&B.dragPointInCenterBottom?(V===0||V===1)&&J.add(F):(V===2||V===3)&&J.add(F)})};switch(u){case"ew":g();break;case"ns":A();break;case"nesw":case"nwse":g(),A()}const y=new Q.Vector3().subVectors(r[1],r[0]).length()/h.length(),w=new Q.Vector3().subVectors(r[3],r[0]).length()/d.length(),C=new Q.Vector3(y,w,1),x=new E.Matrix4().scale(C);n.isCSS3DObjectPlus?n.applyScaleMatrix4(x):n.scale.applyMatrix4(x),o.position.copy(a);const I=new Q.Vector3().addVectors(r[0],r[2]).divideScalar(2),S=new Q.Vector3().subVectors(I,l),k=new E.Matrix4().setPosition(S);n.applyMatrix4(k),(j=this.helperObject3D.css3DInstance)==null||j.css3DObject.applyMatrix4(k),(_=this.helperObject3D.plane)==null||_.applyMatrix4(k),this.hooks.emit("applyObjectScale",{matrix4:x}),this.hooks.emit("applyObjectPosition",{matrix4:k}),this.render()}dragEnd(){!this.isDragging||(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render(),console.log("%c RectangleScaleController dragEnd","color: #e94e4e"))}}class lb extends ab{constructor(...e){super(...e);m(this,"name","CSS3DScaleController");this.addHTMLEventListener()}addHTMLEventListener(){this.helperObject3D.points.forEach(e=>{if(!e)return;const n=e.point,o=a=>this.dragStart(a,e),s=this.dragging.bind(this),r=this.dragEnd.bind(this);n.addEventListener("dragstart",o),n.addEventListener("drag",s),n.addEventListener("dragend",r)})}}class cb extends Pn{constructor(...e){super(...e);m(this,"name","BoundingBoxController")}}class ub extends xl{constructor(t){super(t)}}const Co="v1.0.0",eo="Object3DHelperPlugin",Ai=`${eo}@${Co}`,db=()=>{console.error(`${Ai} is disposed`)},hb=()=>{console.warn(`${Ai} is disabled`)},fb=()=>{console.error(`${Ai} is disabled`)};class Dl extends ci{constructor(e){super(e);m(this,"version",Co);m(this,"name",eo);m(this,"state",{visible:!0,enabled:!0,disposed:!1});m(this,"objectHelperMap",new Map);m(this,"css3DObjectParentMap",new Map);m(this,"css3DRender");this.five=e,this.css3DRender=new _t(this.five.scene),console.warn("Object3DHelper: \u4F7F\u7528\u6B64\u63D2\u4EF6\uFF0C\u9700\u8981\u5728\u521D\u59CB\u5316five\u65F6\uFF0C\u8BBE\u7F6Efive\u53C2\u6570: { backgroundAlpha: 0, backgroundColor: 0x000000 }"),Object.assign(window,{[`__${eo.toUpperCase()}_DEBUG__`]:this})}show(e){return N(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return N(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){if(this.state.disposed)return db();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return fb();const o=H({},this.state);this.state=H(H({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:o})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,n={}){var f;if(!e)return console.error("Object3D is undefined");if(this.objectHelperMap.has(e)){console.warn(`Object3DHelperPlugin: object3D ${e.name} is already has helper`);return}const o=new sb,s=[],r=(f=this.five.getElement())==null?void 0:f.parentElement,a=this.five.camera,{moveHelper:l=!0,rotateHelper:c=!0,scaleHelper:u=!0,boundingBoxHelper:h=!1}=n,d=new Ce.Subscribe;if(l){const p=new Xv(e),v=this.getConfig(n.moveHelper),g=new cn(this.five,$v,e,p,v,d);o.addControllers({moveController:g.helperController}),s.push(()=>g.dispose())}if(c){const p=this.getConfig(n.rotateHelper),v=new Jv(e,H({container:r},p)),g=new cn(this.five,rb,e,v,p,d);o.addControllers({rotateController:g.helperController}),s.push(()=>g.dispose())}if(h){const p=new Kv(e),v=new cn(this.five,cb,e,p,void 0,d);o.addControllers({boundingBoxController:v.helperController})}if(u)if(e.isCSS3DObjectPlus&&r){const p=new qv(e,r,a,this.five.scene),v=new cn(this.five,lb,e,p,void 0,d);o.addControllers({scaleController:v.helperController}),s.push(()=>v.dispose()),ca(this.five).then(()=>{var g,A;if(e.isCSS3DObjectPlus){const y=e;if(!y||y.mode!=="front")return;const w=(g=this.css3DRender.behindModeCSS3DRenderer.wrapper)!=null?g:ua(this.five);w&&(this.css3DObjectParentMap.set(y,y.parent),y.removeFromParent(),this.css3DRender.behindModeCSS3DRenderer.setWrapper(w),(A=this.css3DRender.getBehindCSS3DObjectGroup())==null||A.add(y),this.css3DRender.render(this.five.camera))}})}else{const p=new ub(e),v=new cn(this.five,Rv,e,p,void 0,d);o.addControllers({scaleController:v.helperController}),s.push(()=>v.dispose())}return this.objectHelperMap.set(e,{helper:o,disposers:s}),o.controllers}removeObject3DHelper(e){if(!this.objectHelperMap.has(e))return;const{helper:n,disposers:o}=this.objectHelperMap.get(e);if(!!n){if(e.isCSS3DObjectPlus){const s=e,r=this.css3DObjectParentMap.get(s);r&&r.add(s),this.css3DRender.render(this.five.camera)}this.objectHelperMap.delete(e),n.dispose(),o==null||o.forEach(s=>s==null?void 0:s())}}handleEnable(e,n=!0){e?(this.everyHelperDo(o=>o.enable()),this.hooks.emit("enable",{userAction:n})):(this.everyHelperDo(o=>o.disable()),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){e?(this.everyHelperDo(o=>o.show()),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.everyHelperDo(o=>o.hide()),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}handleDispose(){this.objectHelperMap.forEach(({helper:e,disposers:n})=>{e.dispose(),n==null||n.forEach(o=>o==null?void 0:o())})}everyHelperDo(e){this.objectHelperMap.forEach(({helper:n,disposers:o})=>{n&&e(n)})}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&hb()}getConfig(e){if(!!e&&typeof e!="boolean"&&e.enable)return e}}const mb=i=>new Dl(i);exports.CSS3DRender=_t;exports.CSS3DRenderPlugin=qt;exports.CameraMovementEffect=Va;exports.CameraMovementPlugin=kh;exports.ContentType=sl;exports.CruisePlugin=dp;exports.CruisePluginController=po;exports.DIRECTION=Gt;exports.DISPLAY_STRATEGY_TYPE=Lt;exports.DimensionType=rl;exports.FLOOR_PLAN_ATTACHED_TO=gt;exports.FLOOR_TYPE_MAP=mh;exports.GuideLinePlugin=nl;exports.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE=St;exports.ItemLabelPlugin=Vm;exports.Magnifier=Ha;exports.MapviewFloorplanPlugin=Xd;exports.ModelChassisCompassPlugin=Ah;exports.ModelEntryDoorGuidePlugin=yh;exports.ModelFloorplanPlugin=Gd;exports.ModelItemLabelPlugin=gm;exports.ModelRoomLabelPlugin=eu;exports.ModelTVVideoPlugin=bm;exports.ModelViewPlugin=ac;exports.Object3DHelperController=Dl;exports.Object3DHelperPlugin=mb;exports.PLUGIN=Ai;exports.PaintBrush=rc;exports.PaintBrushTypeEnum=ot;exports.PanoCompassPlugin=Yh;exports.PanoCursorRaycasterPlugin=kc;exports.PanoDoorLabelPlugin=Jm;exports.PanoFloorplanRadarPlugin=hh;exports.PanoMeasurePlugin=Nf;exports.PanoMeasurePluginLine=Vt;exports.PanoMeasurePluginModel=fi;exports.PanoMeasurePluginPoint=Ue;exports.PanoMeasurePluginPolyline=hi;exports.PanoRulerPlugin=Mh;exports.PanoRulerProPlugin=Gh;exports.PanoSpatialTagPlugin=sm;exports.PanoTagPlugin=Vv;exports.PanoTagPluginController=Il;exports.PointType=al;exports.ROOM_FETILE_TYPE_MAP=fh;exports.ROOM_TYPE_MAP=ph;exports.Rotation=et;exports.TopviewFloorplanPlugin=Ud;exports.Util=tA;exports.VERSION=Co;exports.itemLabelPluginServerParams=Rm;exports.modelItemLabelPluginServerParams=Am;exports.modelRoomLabelPluginServerParams=tu;exports.pluginFlag=jv;
561
+ `;function q0(){const i=new E.PlaneGeometry(.4,.4),t=U0,e=new E.TextureLoader().load(t);e.encoding=E.sRGBEncoding;const n=new E.MeshBasicMaterial({map:e,transparent:!0,depthTest:!1});return new E.Mesh(i,n)}function K0(){const i=new E.CurvePath;i.add(new E.LineCurve3(new E.Vector3(0,0,0),new E.Vector3(0,0,.1)));const t=new E.TubeGeometry(i,8,.003),e=new E.ShaderMaterial({vertexShader:J0,fragmentShader:Z0,depthTest:!1,transparent:!0});return new E.Mesh(t,e)}function $0(){const i=new E.SphereGeometry(.01,20,20),t=new E.MeshBasicMaterial({color:10349931,depthTest:!1,transparent:!0,side:E.DoubleSide}),e=new E.Mesh(i,t);return e.position.set(0,0,.1),e}class Al extends E.Object3D{constructor(){super();m(this,"planeMesh");m(this,"lineMesh");m(this,"ballMesh");this.planeMesh=q0(),this.lineMesh=K0(),this.ballMesh=$0(),this.add(this.planeMesh,this.lineMesh,this.ballMesh)}updateWithIntersect(e){if(!e.face)return;const n=new E.Vector3().addVectors(e.point,e.face.normal);this.position.copy(e.point),this.lookAt(n)}dispose(){var e;(e=this.planeMesh.material.map)==null||e.dispose()}}class vl{constructor(t){m(this,"five");m(this,"contentElement",document.createElement("div"));m(this,"animeIns");m(this,"container");m(this,"css3DObject");m(this,"disposeCss3DObject");m(this,"state",{enabled:!1});this.five=t;const n=.4/2,s=qt(t).create3DDomContainer([[-n,n,0],[-n,-n,0],[n,-n,0],[n,n,0]].map(r=>new E.Vector3().fromArray(r)));if(s){const{container:r,dispose:a,css3DObject:l}=s;this.container=r,this.css3DObject=l,this.disposeCss3DObject=a}this.contentElement.style.width="100%",this.contentElement.style.height="100%",this.contentElement.style.backgroundImage=`url(${_a})`,this.contentElement.style.backgroundSize="100%",this.contentElement.style.backgroundRepeat="no-repeat"}enable(){var t;this.state.enabled||(this.state.enabled=!0,(t=this.container)==null||t.appendChild(this.contentElement))}disable(){!this.state.enabled||(this.state.enabled=!1,this.contentElement.remove())}updateWithIntersect(t){if(!t.face||!this.css3DObject)return;const e=new E.Vector3().addVectors(t.point,t.face.normal);this.css3DObject.position.copy(t.point),this.css3DObject.lookAt(e),this.five.needsRender=!0}doAnimation(){var t;(t=this.animeIns)==null||t.dispose(),new mo({progress:0}).to({progress:[1,0]}).duration(500).easing(si.Easing.Quadratic.InOut).onUpdate(({progress:e})=>{}).play()}dispose(){var t;(t=this.disposeCss3DObject)==null||t.call(this)}}class eA{constructor(t,e){m(this,"five");m(this,"hooks",new Ce.Subscribe);m(this,"magnifier",null);m(this,"pointHelper",null);m(this,"pointDomHelper",null);m(this,"contentDom",document.createElement("div"));m(this,"state",{enabled:!1});m(this,"group",new E.Group);this.five=t,this.magnifier=(e==null?void 0:e.magnifier)===void 0?new pl(t,{dragEnabled:!0}):null,this.pointHelper=(e==null?void 0:e.pointHelper)===void 0?new Al:null,this.pointDomHelper=(e==null?void 0:e.pointDomHelper)===void 0?new vl(t):null,this.group.name="five-point-selector",this.five.scene.add(this.group),this.contentDom.classList.add("five-point-selector-content"),this.contentDom.style.position="absolute",this.contentDom.style.top="0",this.contentDom.style.left="0",this.contentDom.style.width="100%",this.contentDom.style.height="100%",this.contentDom.style.pointerEvents="none"}enable(){var t,e;this.state.enabled||(this.state.enabled=!0,this.pointHelper&&this.group.add(this.pointHelper),(t=this.magnifier)==null||t.enable(),(e=this.pointDomHelper)==null||e.enable(),this.five.needsRender=!0,this.hooks.emit("enabled"))}disable(){var t,e;!this.state.enabled||(this.state.enabled=!1,this.pointHelper&&this.group.remove(this.pointHelper),(t=this.magnifier)==null||t.disable(),(e=this.pointDomHelper)==null||e.disable(),this.hooks.emit("disabled"))}dispose(){this.hooks.off(),this.disable(),this.magnifier=null,this.pointHelper=null,this.pointDomHelper=null}updateWithIntersect(t){var s;this.hooks.emit("pointChanged",{panoIndex:this.five.getCurrentState().panoIndex,position:t.point.toArray(),normal:(s=t.face)==null?void 0:s.normal.toArray()});const e=this.magnifier;e&&e.renderWithPoint(t.point);const n=this.pointHelper;n&&n.updateWithIntersect(t);const o=this.pointDomHelper;o&&o.updateWithIntersect(t),this.five.needsRender=!0}}const tA=Object.freeze(Object.defineProperty({__proto__:null,Interval:Ki,Rectangle:W0,Magnifier:pl,getCoordsFromClient:_0,getCoordsFromElement:gl,getRaycasterFromFivePointer:X0,getIntersectFromRelativePosition:Y0,PointHelper:Al,PointDomHelper:vl,FivePointSelector:eA,isNil:np,notNil:Ye,BetterTween:mo,tweenProgress:ja,nextFrame:ui,requestAnimationFrameInterval:di,getFrameTime:Ch},Symbol.toStringTag,{value:"Module"}));function nA(i){le(i,"svelte-8mby9k",".svelte-8mby9k.svelte-8mby9k{box-sizing:border-box}.marketing.svelte-8mby9k.svelte-8mby9k{transform:translateY(-100%)}.content.svelte-8mby9k .headerImage.svelte-8mby9k{position:absolute;width:100%;top:0.25rem;transform:translateY(-100%);border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.line.svelte-8mby9k.svelte-8mby9k{position:absolute;height:2.0625rem;width:0.0625rem;left:50%;transform:translateX(-50%);background-color:white;bottom:0;transform-origin:bottom;transition:all 500ms}.content.svelte-8mby9k.svelte-8mby9k{background-color:white;position:relative;display:flex;flex-direction:column;min-width:11.125rem;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;border-radius:0.25rem;top:-1.875rem;left:-1rem;padding:0.5rem 0rem 0.5625rem;transition:all 500ms}.title.svelte-8mby9k.svelte-8mby9k{position:absolute;background-color:white;border-radius:0.25rem;width:100%;top:0.5rem;padding-left:0.75rem;padding-right:0.75rem}.title.svelte-8mby9k .text.svelte-8mby9k{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;font-weight:bold;line-height:1.125rem;color:#000}.footer.svelte-8mby9k.svelte-8mby9k{position:relative;padding-left:0.75rem;padding-right:0.75rem;width:100%;height:1.375rem;display:flex;align-items:center}.footer.svelte-8mby9k .goto-button.svelte-8mby9k{flex-shrink:0;white-space:nowrap;background-image:linear-gradient(to right, rgba(87, 144, 253, 1) 0, rgba(42, 114, 254, 1) 100%);color:#fff;font-size:0.625rem;border-radius:0.875rem;font-weight:bold;padding-left:0.5rem;padding-right:0.5rem;height:1.25rem;margin-left:auto;display:flex;align-items:center}.footer.svelte-8mby9k .goto-icon.svelte-8mby9k::after{content:'';display:inline-block;width:0.75rem;height:0.75rem;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAeFBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////GqOSsAAAAJ3RSTlMAFNO2pYt4bErz8uP6ysawgVtBPDcR5C4s2L6ZmJBzZGJXUyEeDws/0G2zAAAAkklEQVQ4y+3TRw6DMBAF0OAeJ3QCpCe0uf8NwRILLBYfiS1/aT3JoymnI+sERZ5VCH0iVto3QDfBLmeSSMUTogRV9bBEpJAKaYpGijn13aTSLeraeG9D0NZFZv4/rRL5FDHnITlllqjv6tykWsmX4JHr05y7j6oFKq2P8He48B0tAM0EY0EDxquClw6vLz6EI35GmwwSZpe+WOgAAAAASUVORK5CYII=);background-size:100% auto;background-repeat:no-repeat}.price.svelte-8mby9k.svelte-8mby9k{flex-shrink:0;margin-right:0.75rem;white-space:nowrap;color:#ff6600;display:flex;align-items:baseline}.price.svelte-8mby9k .value.svelte-8mby9k{position:relative;top:0.0625rem;font-size:1.125rem;line-height:1.375rem;font-family:TG-TYPE, PingFangSC, Segoe UI, Rototo, sans-serif;letter-spacing:0rem}.price.svelte-8mby9k .unit.svelte-8mby9k{padding-left:0.125rem;font-size:0.625rem}.tag.svelte-8mby9k.svelte-8mby9k{position:relative;background-color:white;display:flex;width:-moz-max-content;width:max-content;padding-left:0.75rem;padding-right:0.75rem;min-height:1.75rem}.tag.svelte-8mby9k .base-tag.svelte-8mby9k{height:1rem;margin-top:1.375rem;margin-bottom:0.5rem;margin-right:0.25rem;font-size:0.625rem;line-height:0.875rem;padding:0.0625rem 0.25rem;border-radius:0.125rem;overflow:hidden}.tag.svelte-8mby9k .primary-tag.svelte-8mby9k{background:#e5eefe;color:#0055ff}.tag.svelte-8mby9k .secondary-tag.svelte-8mby9k{background:rgba(255, 102, 0, 0.08);color:rgba(255, 102, 0, 1)}.unfolded.svelte-8mby9k .line.svelte-8mby9k{transform:translateX(-50%) scale(1, 1)}.folded.svelte-8mby9k .line.svelte-8mby9k{transform:translateX(-50%) scale(1, 0);transition-timing-function:ease-in}.unfolded.svelte-8mby9k .content.svelte-8mby9k{opacity:1}.folded.svelte-8mby9k .content.svelte-8mby9k{opacity:0;transform:translateY(0.425rem);transition-timing-function:ease-in}")}function Mr(i,t,e){const n=i.slice();return n[0]=t[e],n}function Tr(i,t,e){const n=i.slice();return n[0]=t[e],n}function zr(i){let t,e=i[0]+"",n;return{c(){t=z("div"),n=ke(e),b(t,"class","base-tag primary-tag svelte-8mby9k")},m(o,s){T(o,t,s),R(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&Se(n,e)},d(o){o&&M(t)}}}function Br(i){let t,e=i[0]&&zr(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),T(n,t,o)},p(n,o){n[0]?e?e.p(n,o):(e=zr(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},d(n){e&&e.d(n),n&&M(t)}}}function jr(i){let t,e=i[0]+"",n;return{c(){t=z("div"),n=ke(e),b(t,"class","base-tag secondary-tag svelte-8mby9k")},m(o,s){T(o,t,s),R(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&Se(n,e)},d(o){o&&M(t)}}}function Vr(i){let t,e=i[0]&&jr(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),T(n,t,o)},p(n,o){n[0]?e?e.p(n,o):(e=jr(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},d(n){e&&e.d(n),n&&M(t)}}}function Rr(i){let t,e,n=i[2].price.value+"",o,s,r=i[2].price.unit&&Qr(i);return{c(){t=z("div"),e=z("span"),o=ke(n),s=ne(),r&&r.c(),b(e,"class","value svelte-8mby9k"),b(t,"class","price svelte-8mby9k")},m(a,l){T(a,t,l),R(t,e),R(e,o),R(t,s),r&&r.m(t,null)},p(a,l){l&4&&n!==(n=a[2].price.value+"")&&Se(o,n),a[2].price.unit?r?r.p(a,l):(r=Qr(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&M(t),r&&r.d()}}}function Qr(i){let t,e=i[2].price.unit+"",n;return{c(){t=z("span"),n=ke(e),b(t,"class","unit svelte-8mby9k")},m(o,s){T(o,t,s),R(t,n)},p(o,s){s&4&&e!==(e=o[2].price.unit+"")&&Se(n,e)},d(o){o&&M(t)}}}function Or(i){let t,e=i[2].highlightText+"",n;return{c(){t=z("div"),n=ke(e),b(t,"class","goto-button goto-icon svelte-8mby9k")},m(o,s){T(o,t,s),R(t,n)},p(o,s){s&4&&e!==(e=o[2].highlightText+"")&&Se(n,e)},d(o){o&&M(t)}}}function iA(i){var J,V;let t,e,n,o,s,r,a,l,c,u,h,d,f,p,v=i[2].title+"",g,A,y,w=Ye((J=i[2].price)==null?void 0:J.value)&&((V=i[2].price)==null?void 0:V.value)!=="",C,x;e=new nt({props:{visible:i[1],outDelay:500,left:61,bottom:87,blurRadius:150,spreadRadius:75}});let I=i[2].brandTags||[],S=[];for(let B=0;B<I.length;B+=1)S[B]=Br(Tr(i,I,B));let k=i[2].tags||[],j=[];for(let B=0;B<k.length;B+=1)j[B]=Vr(Mr(i,k,B));let _=w&&Rr(i),F=i[2].highlightText&&Or(i);return{c(){var B;t=z("div"),$(e.$$.fragment),n=ne(),o=z("div"),s=ne(),r=z("div"),a=z("img"),c=ne(),u=z("div");for(let O=0;O<S.length;O+=1)S[O].c();h=ne();for(let O=0;O<j.length;O+=1)j[O].c();d=ne(),f=z("div"),p=z("div"),g=ke(v),A=ne(),y=z("div"),_&&_.c(),C=ne(),F&&F.c(),b(o,"class","line svelte-8mby9k"),L(o,"transition-delay",i[1]?Fn+"ms":Gn+Fr-Hr-40+"ms"),b(a,"class","headerImage svelte-8mby9k"),_e(a.src,l=i[2].headerPictureUrl)||b(a,"src",l),b(a,"alt",""),b(u,"class","tag svelte-8mby9k"),b(p,"class","text svelte-8mby9k"),b(f,"class","title svelte-8mby9k"),b(y,"class","footer svelte-8mby9k"),L(y,"height",Ye((B=i[2].price)==null?void 0:B.value)&&i[2].highlightText?void 0:"1rem"),b(r,"class","content svelte-8mby9k"),L(r,"transition-delay",i[1]?Fn+Gn+"ms":"0ms"),b(t,"class","marketing svelte-8mby9k"),Z(t,"unfolded",i[1]),Z(t,"folded",i[3])},m(B,O){T(B,t,O),q(e,t,null),R(t,n),R(t,o),R(t,s),R(t,r),R(r,a),R(r,c),R(r,u);for(let W=0;W<S.length;W+=1)S[W].m(u,null);R(u,h);for(let W=0;W<j.length;W+=1)j[W].m(u,null);R(r,d),R(r,f),R(f,p),R(p,g),R(r,A),R(r,y),_&&_.m(y,null),R(y,C),F&&F.m(y,null),x=!0},p(B,[O]){var G,ee,X;const W={};if(O&2&&(W.visible=B[1]),e.$set(W),O&2&&L(o,"transition-delay",B[1]?Fn+"ms":Gn+Fr-Hr-40+"ms"),(!x||O&4&&!_e(a.src,l=B[2].headerPictureUrl))&&b(a,"src",l),O&4){I=B[2].brandTags||[];let U;for(U=0;U<I.length;U+=1){const de=Tr(B,I,U);S[U]?S[U].p(de,O):(S[U]=Br(de),S[U].c(),S[U].m(u,h))}for(;U<S.length;U+=1)S[U].d(1);S.length=I.length}if(O&4){k=B[2].tags||[];let U;for(U=0;U<k.length;U+=1){const de=Mr(B,k,U);j[U]?j[U].p(de,O):(j[U]=Vr(de),j[U].c(),j[U].m(u,null))}for(;U<j.length;U+=1)j[U].d(1);j.length=k.length}(!x||O&4)&&v!==(v=B[2].title+"")&&Se(g,v),O&4&&(w=Ye((G=B[2].price)==null?void 0:G.value)&&((ee=B[2].price)==null?void 0:ee.value)!==""),w?_?_.p(B,O):(_=Rr(B),_.c(),_.m(y,C)):_&&(_.d(1),_=null),B[2].highlightText?F?F.p(B,O):(F=Or(B),F.c(),F.m(y,null)):F&&(F.d(1),F=null),O&4&&L(y,"height",Ye((X=B[2].price)==null?void 0:X.value)&&B[2].highlightText?void 0:"1rem"),O&2&&L(r,"transition-delay",B[1]?Fn+Gn+"ms":"0ms"),(!x||O&2)&&Z(t,"unfolded",B[1]),(!x||O&8)&&Z(t,"folded",B[3])},i(B){x||(P(e.$$.fragment,B),x=!0)},o(B){D(e.$$.fragment,B),x=!1},d(B){B&&M(t),K(e),ct(S,B),ct(j,B),_&&_.d(),F&&F.d()}}}const Fn=400,Hr=500,Gn=180,Fr=500;function oA(i,t,e){let n,o,s,{tag:r}=t;return i.$$set=a=>{"tag"in a&&e(0,r=a.tag)},i.$$.update=()=>{var a,l;i.$$.dirty&1&&e(1,n=(l=(a=r.state)==null?void 0:a.unfolded)!=null?l:!1),i.$$.dirty&2&&e(3,o=!n),i.$$.dirty&1&&e(2,s=r.data)},[r,n,s,o]}class sA extends se{constructor(t){super(),oe(this,t,oA,iA,ie,{tag:0},nA)}}const Jt="data:audio/mpeg;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAADAAAGhgBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////////////////////////////////////8AAAA5TEFNRTMuOThyAc0AAAAAAAAAABSAJAiqQgAAgAAABobxtI73AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//uQxAACFEII9ACZ/sJZwWEoEb8w/////N//////JcxjHjf+7/v/H2PzCCFAiDtGeyBCIx7bJJ1mmEEMy6g8mm2c8nrGABB4h2Mkmn//4z/73u773R5qHHu/j/w7Kxkzh5lWRWdsifCkNAnY9Zc1HvDAhjhSHdFkHFzLmabt/AQxSg2wwzLhHIJOBnAWwVY4zrhIYhhc2kvhYDfQ4hDi2Gmh5KyFn8EcGIrHAngNgIwVIEMf5bzbAiTRoAD///8z/KVhkkWEle6IX+d/z4fvH3BShK1e5kmjkCMoxVmXhd4ROlTKo3iipasvTilY21q19ta30/v/0/idPX1v8PNxJL6ramnOVsdvMv2akO0iSYIzdJFirtzWXCZicS9vHqvSKyqm5XJBdqBwPxyfJdykhWTZ0G0ZyTZGpLKxsNwwoRhsx3tZfhwmeOBVISm3impAC/IT/8hP/EKEM1KMdVdVKM2rHV4x7HVXZvbVVKN/qq8CiV9VL9jjH/6l6qf7MBCjZmOqsAibjcP+qqqv0oxqpa/NVW286hPo1nz2L/h8+jXt//uSxCmDU2IK/ECN98KKtE5IYzNoCfbw+u9i5r8PoadUMFPKqWL4LK3T/LCraMSHGkW4bpLXR/E6LlHOVQxmslKVJ8IULktMN06N0FKCpHCoYsjC4F+Z0NVqdNFoGSTjSiyjzLdnZ2fNqTi2eHKONONKLMPMKLONKLMPQRJGlFxZRoKcJFAYEeIFiRQkUWUeYfef//Ko04soswso40UJAgMw8wosososy0EalnZyjQUGBRQGIFggOWUacWUeYmuadrZziQKKEgQsQLAhQkUJAgMQDghltLO1onp0cpkNInSFMqlYeSEJ5AHsqFdOwy1DA2sRmRJKxdKRfLhfLw5BzUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7ksRRA8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=",pn={};var oi=(i=>(i.Default="default",i.GetAudioDuration="getAudioDuration",i.PlayAudio="playAudio",i))(oi||{});function bl(i,t){const e=(t==null?void 0:t.namespace)||"default",n=pn[e]||(pn[e]=[]);let o=n.find(s=>!s.realSrc||s.realSrc===Jt);return o||(console.warn("\u672A\u627E\u5230\u7F13\u5B58\u97F3\u9891\uFF0C\u5DF2\u65B0\u5EFA",pn),o=new bo(Jt),n.push(o)),i&&(o.src=i),o}function rA(i){return N(this,null,function*(){const t=(()=>i instanceof bo?i:bl(i,{namespace:"getAudioDuration"}))(),e=yield new Promise(n=>{t.duration?t.isBlankAudio?n(0):n(t.duration):(t.addEventListener("loadedmetadata",()=>{t.isBlankAudio?n(0):n(t.duration)}),t.addEventListener("canplaythrough",()=>{t.isBlankAudio?n(0):n(t.duration)}))});return typeof i=="string"&&t.clear(),e})}function Gr(i,t){const e=(t==null?void 0:t.namespace)||"default",n=pn[e]||(pn[e]=[]),o=i-n.length;if(!(o<=0))for(let s=0;s<o;s++)n.push(new bo(Jt))}class bo extends Audio{constructor(e){super(e);m(this,"preload","auto");m(this,"realSrc","");m(this,"inited",!1);m(this,"removeDocumentEventListener");this.realSrc=e!=null?e:"",super.addEventListener("ended",()=>{this.src=""});const n=()=>aA(this);document.addEventListener("click",n),document.addEventListener("touchend",n),this.removeDocumentEventListener=()=>{document.removeEventListener("click",n),document.removeEventListener("touchend",n)}}get isBlankAudio(){return this.realSrc===Jt||!this.realSrc}get src(){return super.src}set src(e){super.src=e,this.realSrc=e}clear(){this.src=Jt,this.currentTime=0}}function aA(i){!i||i.inited||(i.src&&(i.inited=!0,i.removeDocumentEventListener()),i.src===Jt&&i.play())}class lA extends Audio{constructor(e){super();m(this,"sharedAudioSrc");m(this,"sharedAudioPaused",!0);m(this,"sharedAudioCurrentTime",0);m(this,"tryplaying",!1);m(this,"audioInstance");m(this,"eventListenerDisposer");this.sharedAudioSrc=e}get paused(){var e;return(e=this.sharedAudioPaused)!=null?e:!0}get currentTime(){return this.sharedAudioCurrentTime}play(){return N(this,null,function*(){var e,n,o;this.tryplaying||(this.tryplaying=!0,(!this.audioInstance||((e=this.audioInstance)==null?void 0:e.realSrc)!==this.sharedAudioSrc)&&(this.audioInstance=bl(this.sharedAudioSrc,{namespace:oi.PlayAudio})),this.audioInstance.currentTime=(n=this.currentTime)!=null?n:0,(o=this.eventListenerDisposer)==null||o.call(this),this.eventListenerDisposer=this.addEventListeners(),this.audioInstance.play().then(()=>{this.sharedAudioPaused=!1}).catch(s=>{this.pause(),console.warn(s)}).finally(()=>{this.tryplaying=!1}))})}pause(){!this.audioInstance||this.paused||(this.sharedAudioPaused=!0,this.audioInstance.addEventListener("pause",()=>{var e;(e=this.eventListenerDisposer)==null||e.call(this)},{once:!0}),this.audioInstance.pause())}dispose(){this.clear(),this.audioInstance=void 0}clear(){var e;(e=this.audioInstance)==null||e.clear()}addEventListeners(){const e=this.audioInstance;if(!e)return;const n=d=>{var f;this.sharedAudioCurrentTime=e.currentTime,(f=this.ontimeupdate)==null||f.call(this,d)},o=d=>{var f;return(f=this.onplay)==null?void 0:f.call(this,d)},s=d=>{var f;(f=this.onpause)==null||f.call(this,d),this.clear()},r=d=>{var f;(f=this.onended)==null||f.call(this,d),this.sharedAudioCurrentTime=0},a=d=>{var f;return(f=this.onerror)==null?void 0:f.call(this,d)},l=d=>{var f;return(f=this.oncanplay)==null?void 0:f.call(this,d)},c=d=>{var f;return(f=this.oncanplaythrough)==null?void 0:f.call(this,d)},u=d=>{var f;return(f=this.onloadeddata)==null?void 0:f.call(this,d)},h=d=>{var f;return(f=this.onloadedmetadata)==null?void 0:f.call(this,d)};return e.addEventListener("timeupdate",n),e.addEventListener("play",o),e.addEventListener("pause",s),e.addEventListener("ended",r),e.addEventListener("error",a),e.addEventListener("canplay",l),e.addEventListener("canplaythrough",c),e.addEventListener("loadeddata",u),e.addEventListener("loadedmetadata",h),()=>{e.removeEventListener("timeupdate",n),e.removeEventListener("play",o),e.removeEventListener("pause",s),e.removeEventListener("ended",r),e.removeEventListener("error",a),e.removeEventListener("canplay",l),e.removeEventListener("canplaythrough",c),e.removeEventListener("loadeddata",u),e.removeEventListener("loadedmetadata",h)}}}function cA(i){le(i,"svelte-13e7hxv",".audio.svelte-13e7hxv{pointer-events:auto;cursor:pointer;width:100%;height:100%}")}function uA(i){let t,e,n,o;const s=i[8].default,r=$t(s,i,i[7],null);return{c(){t=z("div"),r&&r.c(),b(t,"class","audio svelte-13e7hxv"),b(t,"style",i[0])},m(a,l){T(a,t,l),r&&r.m(t,null),e=!0,n||(o=we(t,"click",va(i[1])),n=!0)},p(a,[l]){r&&r.p&&(!e||l&128)&&tn(r,s,a,a[7],e?en(s,a[7],l,null):nn(a[7]),null),(!e||l&1)&&b(t,"style",a[0])},i(a){e||(P(r,a),e=!0)},o(a){D(r,a),e=!1},d(a){a&&M(t),r&&r.d(a),n=!1,o()}}}function dA(i,t,e){let{$$slots:n={},$$scope:o}=t,{url:s}=t,{enable:r=!0}=t,{style:a=""}=t,{hooksInfo:l}=t;const c=wn(),u=Tt("hooks"),h=Tt("mediaStore");let d,f=!0;function p(){e(5,d.onplay=g=>{u.emit("playStateChange",H({event:g,state:"playing",mediaInstance:d},l)),c("play"),e(6,f=!1)},d),e(5,d.onpause=g=>{u.emit("playStateChange",H({event:g,state:"paused",mediaInstance:d},l)),c("pause"),e(6,f=!0)},d),e(5,d.onloadedmetadata=g=>{typeof d.duration=="number"&&!Number.isNaN(d.duration)&&c("duration",d.duration)},d),e(5,d.ontimeupdate=g=>{c("timeupdate",d.currentTime)},d)}h.subscribe(({currentMediaElement:g})=>{g!==d&&(f||d==null||d.pause())});function v(g){!d||(u.emit("click",H({event:g,target:"AudioTagPlayIcon",audioInstance:d},l)),h.set({currentMediaElement:d}),u.emit("playStateChange",H({event:g,state:d.paused?"playing":"paused",mediaInstance:d},l)),d.paused?d.play():d.pause())}return i.$$set=g=>{"url"in g&&e(2,s=g.url),"enable"in g&&e(3,r=g.enable),"style"in g&&e(0,a=g.style),"hooksInfo"in g&&e(4,l=g.hooksInfo),"$$scope"in g&&e(7,o=g.$$scope)},i.$$.update=()=>{i.$$.dirty&4&&(s||c("duration",0)),i.$$.dirty&36&&(d==null||d.dispose(),e(5,d=new lA(s)),c("audioRef",d),setTimeout(()=>c("audioRef",d),200),rA(s).then(g=>c("duration",g)),p()),i.$$.dirty&40&&(r||d==null||d.pause()),i.$$.dirty&72&&c(r&&!f?"play":"pause")},[a,v,s,r,l,d,f,o,n]}class yl extends se{constructor(t){super(),oe(this,t,dA,uA,ie,{url:2,enable:3,style:0,hooksInfo:4},cA)}}function hA(i){le(i,"svelte-srt2pi",".audio-icon__wrapper.svelte-srt2pi.svelte-srt2pi{display:inline-block}.audio-icon.svelte-srt2pi.svelte-srt2pi{display:flex;justify-content:center;align-items:center;position:relative;width:100%;height:100%;border-radius:50%;background-color:rgba(255, 255, 255, 0.8)}.audio-icon.svelte-srt2pi .sound-wave__container.svelte-srt2pi{position:absolute;pointer-events:none;width:60%;height:60%}.sound-wave.svelte-srt2pi.svelte-srt2pi{animation-duration:2s;animation-iteration-count:infinite;animation-play-state:paused;transition:opacity 0}.playing.svelte-srt2pi .sound-wave.svelte-srt2pi{animation-play-state:running}.playing.svelte-srt2pi .sound-wave-1.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_1_animation}.playing.svelte-srt2pi .sound-wave-2.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_2_animation}.playing.svelte-srt2pi .sound-wave-3.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_3_animation}@keyframes svelte-srt2pi-sound_wave_1_animation{0%,10%{opacity:0}25%,100%{opacity:1}}@keyframes svelte-srt2pi-sound_wave_2_animation{0%,35%{opacity:0}50%,100%{opacity:1}}@keyframes svelte-srt2pi-sound_wave_3_animation{0%,60%{opacity:0}75%,100%{opacity:1}}")}function Wr(i){let t,e;return t=new nt({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function fA(i){let t,e,n,o,s,r=i[1]&&Wr();return{c(){t=z("div"),r&&r.c(),e=ne(),n=z("div"),o=z("div"),o.innerHTML='<svg width="100%" height="100%" viewBox="0 0 128 128"><g transform="rotate(-45 12 64) translate(12 64)" fill="black" stroke="black" fill-opacity="0.6" stroke-opacity="0.6"><path stroke="none" class="sound-wave sound-wave-1 svelte-srt2pi" d="M0,23 A23,23 0 0,0 23,0 L0,0"></path><path fill="none" stroke-width="15" class="sound-wave sound-wave-2 svelte-srt2pi" d="M0,46 A46,46 0 0,0 46,0"></path><path fill="none" stroke-width="15" class="sound-wave sound-wave-3 svelte-srt2pi" d="M0,80 A80,80 0 0,0 80,0"></path></g></svg>',b(o,"class","sound-wave__container svelte-srt2pi"),b(n,"class","audio-icon svelte-srt2pi"),Z(n,"playing",i[0]),b(t,"class","audio-icon__wrapper svelte-srt2pi"),b(t,"style",i[2]),L(t,"width",i[5]),L(t,"height",i[5])},m(a,l){T(a,t,l),r&&r.m(t,null),R(t,e),R(t,n),R(n,o),i[7](o),i[8](t),s=!0},p(a,[l]){a[1]?r?l&2&&P(r,1):(r=Wr(),r.c(),P(r,1),r.m(t,e)):r&&(re(),D(r,1,1,()=>{r=null}),ae()),(!s||l&1)&&Z(n,"playing",a[0]),(!s||l&4)&&b(t,"style",a[2]),l&32&&L(t,"width",a[5]),l&32&&L(t,"height",a[5])},i(a){s||(P(r),s=!0)},o(a){D(r),s=!1},d(a){a&&M(t),r&&r.d(),i[7](null),i[8](null)}}}function mA(i,t,e){let n,{playing:o}=t,{shadow:s=!1}=t,{style:r=null}=t,{width:a="100%"}=t,l,c;function u(d){Be[d?"unshift":"push"](()=>{c=d,e(4,c)})}function h(d){Be[d?"unshift":"push"](()=>{l=d,e(3,l)})}return i.$$set=d=>{"playing"in d&&e(0,o=d.playing),"shadow"in d&&e(1,s=d.shadow),"style"in d&&e(2,r=d.style),"width"in d&&e(6,a=d.width)},i.$$.update=()=>{i.$$.dirty&64&&e(5,n=typeof a=="number"?Ie(a):a)},[o,s,r,l,c,n,a,u,h]}class wl extends se{constructor(t){super(),oe(this,t,mA,fA,ie,{playing:0,shadow:1,style:2,width:6},hA)}}function pA(i){le(i,"svelte-1s6gk4a",".audio-tag.svelte-1s6gk4a{position:absolute;left:0;top:0;width:0;height:0;overflow:visible}.audio-icon__wrapper.svelte-1s6gk4a{position:relative;vertical-align:top;width:100%;height:100%}.content.svelte-1s6gk4a{width:-moz-max-content;width:max-content;height:3.375rem;padding:2.25rem 0.25rem 0 1rem;position:absolute;left:0;bottom:0.125rem;overflow:hidden;box-sizing:border-box;font-size:0;white-space:nowrap;font-weight:600}.wrapper.svelte-1s6gk4a{position:relative;width:100%;height:100%}.audio-icon.svelte-1s6gk4a{pointer-events:none;vertical-align:top;display:inline-block;width:1rem;height:1rem;margin-right:0.25rem;margin-top:0.0625rem}.audio.svelte-1s6gk4a{position:relative;width:100%;height:100%}")}function Nr(i){var A,y;let t,e,n,o,s,r,a,l,c,u,h,d,f,p,v;e=new nt({props:{visible:i[6],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}});let g=i[6]&&_r(i);return c=new cl({props:{visible:i[6],textUnfolded:i[1],content:i[5]}}),d=new go({props:{unfolded:i[6],length:i[3],outDelay:i[4]+20*Math.min((y=(A=i[5])==null?void 0:A.length)!=null?y:10,15),useLinearColor:!0}}),{c(){t=z("div"),$(e.$$.fragment),n=ne(),o=z("div"),s=z("div"),r=z("div"),g&&g.c(),a=ne(),l=z("div"),$(c.$$.fragment),h=ne(),$(d.$$.fragment),b(r,"class","audio-icon svelte-1s6gk4a"),Me(()=>i[11].call(l)),L(l,"display","inline-block"),b(s,"class","wrapper svelte-1s6gk4a"),b(o,"class","content svelte-1s6gk4a"),b(t,"class","audio-tag svelte-1s6gk4a"),Z(t,"unfolded",i[6])},m(w,C){T(w,t,C),q(e,t,null),R(t,n),R(t,o),R(o,s),R(s,r),g&&g.m(r,null),R(s,a),R(s,l),q(c,l,null),u=Pt(l,i[11].bind(l)),R(t,h),q(d,t,null),f=!0,p||(v=we(l,"click",i[7]),p=!0)},p(w,C){var k,j;const x={};C&64&&(x.visible=w[6]),C&8&&(x.left=w[3]/2+"px"),e.$set(x),w[6]?g?(g.p(w,C),C&64&&P(g,1)):(g=_r(w),g.c(),P(g,1),g.m(r,null)):g&&(re(),D(g,1,1,()=>{g=null}),ae());const I={};C&64&&(I.visible=w[6]),C&2&&(I.textUnfolded=w[1]),C&32&&(I.content=w[5]),c.$set(I);const S={};C&64&&(S.unfolded=w[6]),C&8&&(S.length=w[3]),C&48&&(S.outDelay=w[4]+20*Math.min((j=(k=w[5])==null?void 0:k.length)!=null?j:10,15)),d.$set(S),(!f||C&64)&&Z(t,"unfolded",w[6])},i(w){f||(P(e.$$.fragment,w),P(g),P(c.$$.fragment,w),P(d.$$.fragment,w),f=!0)},o(w){D(e.$$.fragment,w),D(g),D(c.$$.fragment,w),D(d.$$.fragment,w),f=!1},d(w){w&&M(t),K(e),g&&g.d(),K(c),u(),K(d),p=!1,v()}}}function _r(i){let t,e,n,o,s,r,a;return e=new nt({props:{center:!0,blurRadius:15,spreadRadius:6}}),o=new yl({props:{enable:i[6],url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[gA]},$$scope:{ctx:i}}}),o.$on("play",i[8]),o.$on("pause",i[9]),o.$on("audioRef",i[10]),{c(){t=z("div"),$(e.$$.fragment),n=ne(),$(o.$$.fragment),b(t,"class","audio svelte-1s6gk4a")},m(l,c){T(l,t,c),q(e,t,null),R(t,n),q(o,t,null),a=!0},p(l,c){i=l;const u={};c&64&&(u.enable=i[6]),c&1&&(u.url=i[0].data.audioUrl),c&1&&(u.hooksInfo={tag:i[0]}),c&4100&&(u.$$scope={dirty:c,ctx:i}),o.$set(u)},i(l){a||(P(e.$$.fragment,l),P(o.$$.fragment,l),l&&Me(()=>{r&&r.end(1),s=Bt(t,zt,{duration:1e3,delay:0,easing:Xt}),s.start()}),a=!0)},o(l){var c,u;D(e.$$.fragment,l),D(o.$$.fragment,l),s&&s.invalidate(),l&&(r=on(t,zt,{duration:1e3,delay:20*Math.min((u=(c=i[5])==null?void 0:c.length)!=null?u:10,15),easing:Xt})),a=!1},d(l){l&&M(t),K(e),K(o),l&&r&&r.end()}}}function gA(i){let t,e,n;return e=new wl({props:{playing:i[2]}}),{c(){t=z("div"),$(e.$$.fragment),b(t,"class","audio-icon__wrapper svelte-1s6gk4a")},m(o,s){T(o,t,s),q(e,t,null),n=!0},p(o,s){const r={};s&4&&(r.playing=o[2]),e.$set(r)},i(o){n||(P(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),K(e)}}}function AA(i){let t,e,n=i[0].state&&Nr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&P(n,1)):(n=Nr(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(re(),D(n,1,1,()=>{n=null}),ae())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function vA(i,t,e){let n,o,s,{tag:r}=t,a=!1,l=!1,c;function u(){e(1,a=!a)}const h=()=>{e(2,l=!0)},d=()=>{e(2,l=!1)};function f(v){Cn.call(this,i,v)}function p(){c=this.clientWidth,e(3,c)}return i.$$set=v=>{"tag"in v&&e(0,r=v.tag)},i.$$.update=()=>{var v,g,A;i.$$.dirty&1&&e(6,n=!!((v=r.state)!=null&&v.unfolded)),i.$$.dirty&1&&e(5,o=(A=(g=r.data.title)!=null?g:r.data.text)!=null?A:""),i.$$.dirty&2&&e(4,s=a?450:0)},[r,a,l,c,s,o,n,u,h,d,f,p]}class bA extends se{constructor(t){super(),oe(this,t,vA,AA,ie,{tag:0},pA)}}function yA(i){const t=document.createElement("div");t.style.color=i,document.body.appendChild(t);const e=window.getComputedStyle(t).color;t.remove();const n=(()=>e.search("rgba")===-1?e.replace("rgb","rgba").replace(")",", 1)"):e)(),o=n.replace("rgba","").replace("(","").replace(")","").split(",").map(s=>Number(s.trim()));return{rgba:n,r:o[0],g:o[1],b:o[2],a:o[3]}}function wA(i){le(i,"svelte-58hfjf",".audio-tag__wrapper.svelte-58hfjf{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.audio-tag.svelte-58hfjf{position:relative;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;padding:0.1875rem;padding-right:0.625rem;border-radius:624999.9375rem;border:0.03125rem solid rgba(255, 255, 255, 0.2)}.audio__inner.svelte-58hfjf{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.text.svelte-58hfjf{font-weight:bold;font-size:0.75rem;margin-left:0.25rem}.audio-icon__wrapper.svelte-58hfjf{position:relative;vertical-align:top;pointer-events:none;width:1.375rem;height:1.375rem}")}function Xr(i){let t,e,n,o;return n=new yl({props:{style:"width: max-content; height: max-content;",enable:i[0].state.visible,url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[PA]},$$scope:{ctx:i}}}),n.$on("play",i[7]),n.$on("pause",i[8]),n.$on("timeupdate",i[9]),n.$on("duration",i[10]),n.$on("audioRef",i[11]),{c(){t=z("div"),e=z("div"),$(n.$$.fragment),b(e,"class","audio-tag svelte-58hfjf"),L(e,"background-color",i[1]),L(e,"color",i[5]),b(t,"class","audio-tag__wrapper svelte-58hfjf")},m(s,r){T(s,t,r),R(t,e),q(n,e,null),o=!0},p(s,r){const a={};r&1&&(a.enable=s[0].state.visible),r&1&&(a.url=s[0].data.audioUrl),r&1&&(a.hooksInfo={tag:s[0]}),r&8260&&(a.$$scope={dirty:r,ctx:s}),n.$set(a),r&2&&L(e,"background-color",s[1]),r&32&&L(e,"color",s[5])},i(s){o||(P(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&M(t),K(n)}}}function CA(i){let t;return{c(){t=ke(i[6])},m(e,n){T(e,t,n)},p(e,n){n&64&&Se(t,e[6])},d(e){e&&M(t)}}}function PA(i){let t,e,n,o,s,r,a;return n=new wl({props:{playing:i[2]}}),r=new Ao({props:{maxWidth:72,$$slots:{default:[CA]},$$scope:{ctx:i}}}),{c(){t=z("div"),e=z("div"),$(n.$$.fragment),o=ne(),s=z("div"),$(r.$$.fragment),b(e,"class","audio-icon__wrapper svelte-58hfjf"),b(s,"class","text svelte-58hfjf"),b(t,"class","audio__inner svelte-58hfjf")},m(l,c){T(l,t,c),R(t,e),q(n,e,null),R(t,o),R(t,s),q(r,s,null),a=!0},p(l,c){const u={};c&4&&(u.playing=l[2]),n.$set(u);const h={};c&8256&&(h.$$scope={dirty:c,ctx:l}),r.$set(h)},i(l){a||(P(n.$$.fragment,l),P(r.$$.fragment,l),a=!0)},o(l){D(n.$$.fragment,l),D(r.$$.fragment,l),a=!1},d(l){l&&M(t),K(n),K(r)}}}function EA(i){let t,e,n=i[0].state&&Xr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&P(n,1)):(n=Xr(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(re(),D(n,1,1,()=>{n=null}),ae())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function IA(i,t,e){let n,o,s,{tag:r}=t;wn();let a=!1,l=0,c=0;const u=()=>{e(2,a=!0)},h=()=>{e(2,a=!1)},d=v=>{e(3,l=v.detail)},f=v=>{e(4,c=v.detail)};function p(v){Cn.call(this,i,v)}return i.$$set=v=>{"tag"in v&&e(0,r=v.tag)},i.$$.update=()=>{var v,g;i.$$.dirty&1&&e(6,n=(g=(v=r.data.title)!=null?v:r.data.text)!=null?g:""),i.$$.dirty&1&&e(1,o=(()=>{var A;return r.data.backgroundColor==="dark"?"rgba(0, 0, 0, 0.3)":r.data.backgroundColor==="light"?"rgba(255, 255, 255, 0.3)":(A=r.data.backgroundColor)!=null?A:"rgba(0, 0, 0, 0.3)"})()),i.$$.dirty&2&&e(5,s=(()=>{const{r:A,g:y,b:w}=yA(o);return(A*299+y*587+w*114)/1e3>=128?"rgba(0, 0, 0, 0.6)":"white"})())},[r,o,a,l,c,s,n,u,h,d,f,p]}class kA extends se{constructor(t){super(),oe(this,t,IA,EA,ie,{tag:0},wA)}}function xA(i){let t,e;return t=new kA({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function DA(i){let t,e;return t=new bA({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function LA(i){let t,e,n,o;const s=[DA,xA],r=[];function a(l,c){return l[1]==="line"?0:l[1]==="plane"?1:-1}return~(t=a(i))&&(e=r[t]=s[t](i)),{c(){e&&e.c(),n=fe()},m(l,c){~t&&r[t].m(l,c),T(l,n,c),o=!0},p(l,[c]){let u=t;t=a(l),t===u?~t&&r[t].p(l,c):(e&&(re(),D(r[u],1,1,()=>{r[u]=null}),ae()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),P(e,1),e.m(n.parentNode,n)):e=null)},i(l){o||(P(e),o=!0)},o(l){D(e),o=!1},d(l){~t&&r[t].d(l),l&&M(n)}}}function SA(i,t,e){let n,{tag:o}=t,s;function r(a){s=a.detail}return o.play=()=>s.play(),o.pause=()=>s.pause(),i.$$set=a=>{"tag"in a&&e(0,o=a.tag)},i.$$.update=()=>{var a;i.$$.dirty&1&&e(1,n=(a=o.data.appearance)!=null?a:"line")},[o,n,r]}class MA extends se{constructor(t){super(),oe(this,t,SA,LA,ie,{tag:0})}}function TA(i){le(i,"svelte-10cw0el",".media-wrapper.svelte-10cw0el{position:absolute;width:100%;height:100%}")}function Yr(i){var o;let t,e,n;return e=new ml({props:{mediaItemConfig:{canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(o=i[4])!=null?o:"withText",disableVideoIfHavePoster:!1,objectFit:i[2]},unfolded:i[6],mediaData:i[5],enableCarousel:i[1],autoplayConfig:i[3],tag:i[0],inDelay:500,duration:500}}),{c(){t=z("div"),$(e.$$.fragment),b(t,"class","media-wrapper svelte-10cw0el")},m(s,r){T(s,t,r),q(e,t,null),n=!0},p(s,r){var l;const a={};r&20&&(a.mediaItemConfig={canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(l=s[4])!=null?l:"withText",disableVideoIfHavePoster:!1,objectFit:s[2]}),r&64&&(a.unfolded=s[6]),r&32&&(a.mediaData=s[5]),r&2&&(a.enableCarousel=s[1]),r&8&&(a.autoplayConfig=s[3]),r&1&&(a.tag=s[0]),e.$set(a)},i(s){n||(P(e.$$.fragment,s),n=!0)},o(s){D(e.$$.fragment,s),n=!1},d(s){s&&M(t),K(e)}}}function zA(i){let t,e,n=i[0].state&&i[5]&&Yr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[0].state&&o[5]?n?(n.p(o,s),s&33&&P(n,1)):(n=Yr(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(re(),D(n,1,1,()=>{n=null}),ae())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function BA(i,t,e){let n,o,s,r,a,l,{tag:c}=t;return i.$$set=u=>{"tag"in u&&e(0,c=u.tag)},i.$$.update=()=>{var u,h;i.$$.dirty&1&&e(6,n=c.state?c.state.unfolded:!1),i.$$.dirty&1&&e(5,o=c.data.mediaData),i.$$.dirty&1&&e(1,s=c.data.enableCarousel),i.$$.dirty&1&&e(4,r=c.data.playIcon),i.$$.dirty&3&&e(3,a=(u=c.data.autoplayConfig)!=null?u:{autoplay:s!=null?s:!0,autoplayVideo:!0}),i.$$.dirty&1&&e(2,l=(h=c.data.objectFit)!=null?h:(()=>c.data.adaptationMode==="stretch"?"fill":c.data.adaptationMode==="proportional"?"contain":void 0)())},[c,s,l,a,r,o,n]}class jA extends se{constructor(t){super(),oe(this,t,BA,zA,ie,{tag:0},TA)}}function VA(i){return N(this,null,function*(){return new Promise((t,e)=>{if(!i){e(Error("url is empty"));return}const n=new Image;n.src=i,n.onload=()=>t({width:n.width,height:n.height}),n.onerror=e})})}function RA(i){return N(this,null,function*(){const{steps:t,url:e,ratio:n=3,fps:o=24}=i;if(!t)throw new Error("KeyframeIcon requires steps");const{width:s,height:r}=yield VA(e),a=s/n,l=r/n,c=a/t,u=l,h=1/o*t+"s",d=a/t-a;return{url:e,keyframesWidth:a,keyframesHeight:l,wrapperWidth:c,wrapperHeight:u,steps:t,duration:h,offsetX:d,offsetY:0}})}function QA(i){le(i,"svelte-mhs8j5","@keyframes svelte-mhs8j5-sprites-animation{0%{background-position:0 0}100%{background-position:var(--keyframe_offset_x) 0}}.icon-image.svelte-mhs8j5{display:block;width:100%}.icon-keyframe-container.svelte-mhs8j5{overflow:hidden}.icon-keyframe-wrapper.svelte-mhs8j5{transform-origin:0 0}.icon-keyframe.svelte-mhs8j5{background-repeat:no-repeat;animation-direction:normal;animation-iteration-count:infinite;animation-name:svelte-mhs8j5-sprites-animation}")}function Ur(i){i[6]=i[14].url,i[7]=i[14].keyframesWidth,i[8]=i[14].keyframesHeight,i[9]=i[14].wrapperWidth,i[10]=i[14].wrapperHeight,i[11]=i[14].steps,i[12]=i[14].duration,i[13]=i[14].offsetX}function Jr(i){let t,e,n,o=i[2]&&Zr();function s(l,c){return l[3]?HA:OA}let r=s(i),a=r(i);return{c(){t=z("div"),o&&o.c(),e=ne(),a.c(),b(t,"class","icon"),L(t,"width",typeof i[0]=="number"?Ie(i[0]):i[0])},m(l,c){T(l,t,c),o&&o.m(t,null),R(t,e),a.m(t,null),n=!0},p(l,c){l[2]?o?c&4&&P(o,1):(o=Zr(),o.c(),P(o,1),o.m(t,e)):o&&(re(),D(o,1,1,()=>{o=null}),ae()),r===(r=s(l))&&a?a.p(l,c):(a.d(1),a=r(l),a&&(a.c(),a.m(t,null))),c&1&&L(t,"width",typeof l[0]=="number"?Ie(l[0]):l[0])},i(l){n||(P(o),n=!0)},o(l){D(o),n=!1},d(l){l&&M(t),o&&o.d(),a.d()}}}function Zr(i){let t,e;return t=new nt({props:{center:!0,blurRadius:24,spreadRadius:16}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function OA(i){let t,e;return{c(){t=z("img"),b(t,"class","icon-image svelte-mhs8j5"),_e(t.src,e=i[1].url)||b(t,"src",e),b(t,"alt","icon")},m(n,o){T(n,t,o)},p(n,o){o&2&&!_e(t.src,e=n[1].url)&&b(t,"src",e)},d(n){n&&M(t)}}}function HA(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:WA,then:GA,catch:FA,value:14};return zo(e=i[4](i[1]),n),{c(){t=fe(),n.block.c()},m(o,s){T(o,t,s),n.block.m(o,n.anchor=s),n.mount=()=>t.parentNode,n.anchor=t},p(o,s){i=o,n.ctx=i,s&2&&e!==(e=i[4](i[1]))&&zo(e,n)||Qc(n,i,s)},d(o){o&&M(t),n.block.d(o),n.token=null,n=null}}}function FA(i){return{c:Y,m:Y,p:Y,d:Y}}function GA(i){Ur(i);let t,e,n,o=`url(${i[6]})`,s=`steps(${i[11]-1})`;return{c(){t=z("div"),e=z("div"),n=z("div"),b(n,"class","icon-keyframe svelte-mhs8j5"),L(n,"width",Ie(i[7])),L(n,"height",Ie(i[8])),L(n,"background-image",o),L(n,"animation-duration",i[12]),L(n,"animation-timing-function",s),L(n,"animation-delay",0),L(n,"background-size","100% 100%"),L(n,"--keyframe_offset_x",Ie(i[13])),b(e,"class","icon-keyframe-wrapper svelte-mhs8j5"),L(e,"transform",typeof i[0]=="number"?`scale(${i[0]/i[9]})`:void 0),b(t,"class","icon-keyframe-container svelte-mhs8j5"),L(t,"width",typeof i[0]=="number"?Ie(i[0]):Ie(i[9])),L(t,"height",typeof i[0]=="number"?Ie(i[10]*(i[0]/i[9])):Ie(i[10]))},m(r,a){T(r,t,a),R(t,e),R(e,n)},p(r,a){Ur(r),a&2&&L(n,"width",Ie(r[7])),a&2&&L(n,"height",Ie(r[8])),a&2&&o!==(o=`url(${r[6]})`)&&L(n,"background-image",o),a&2&&L(n,"animation-duration",r[12]),a&2&&s!==(s=`steps(${r[11]-1})`)&&L(n,"animation-timing-function",s),a&2&&L(n,"--keyframe_offset_x",Ie(r[13])),a&3&&L(e,"transform",typeof r[0]=="number"?`scale(${r[0]/r[9]})`:void 0),a&3&&L(t,"width",typeof r[0]=="number"?Ie(r[0]):Ie(r[9])),a&3&&L(t,"height",typeof r[0]=="number"?Ie(r[10]*(r[0]/r[9])):Ie(r[10]))},d(r){r&&M(t)}}}function WA(i){return{c:Y,m:Y,p:Y,d:Y}}function NA(i){let t,e,n=i[1]&&Jr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&P(n,1)):(n=Jr(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(re(),D(n,1,1,()=>{n=null}),ae())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function _A(i,t,e){let n,{width:o=null}=t,{icon:s=null}=t,{shadow:r=!1}=t;const a=wn();function l(c){return N(this,null,function*(){const u=yield RA(c);return a("iconLoaded"),u})}return i.$$set=c=>{"width"in c&&e(0,o=c.width),"icon"in c&&e(1,s=c.icon),"shadow"in c&&e(2,r=c.shadow)},i.$$.update=()=>{i.$$.dirty&2&&e(3,n=(s==null?void 0:s.steps)>=2),i.$$.dirty&8&&!n&&a("iconLoaded")},[o,s,r,n,l]}class Cl extends se{constructor(t){super(),oe(this,t,_A,NA,ie,{width:0,icon:1,shadow:2},QA)}}function XA(i){le(i,"svelte-e58ijk",".wrapper.svelte-e58ijk{font-weight:600;cursor:pointer;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);display:flex;align-items:center;justify-content:center;flex-direction:column;pointer-events:auto}.text-wrapper.svelte-e58ijk{position:relative;display:flex;align-items:center;justify-content:center}.text.svelte-e58ijk{position:absolute;top:0;font-size:0.875rem;color:#ffffff;letter-spacing:0;text-align:center;max-width:8.75rem;width:-moz-max-content;width:max-content;line-height:1.125rem;text-shadow:0.125rem 0rem 0.5rem rgba(0, 0, 0, 0.15)}")}function qr(i){let t,e,n,o,s,r;return e=new nt({props:{outDelay:0,inDelay:0,center:!0,width:"80%",blurRadius:40,spreadRadius:16,opacity:.08}}),{c(){t=z("div"),$(e.$$.fragment),n=ne(),o=z("div"),s=ke(i[1]),b(o,"class","text svelte-e58ijk"),b(t,"class","text-wrapper svelte-e58ijk")},m(a,l){T(a,t,l),q(e,t,null),R(t,n),R(t,o),R(o,s),r=!0},p(a,l){(!r||l&2)&&Se(s,a[1])},i(a){r||(P(e.$$.fragment,a),r=!0)},o(a){D(e.$$.fragment,a),r=!1},d(a){a&&M(t),K(e)}}}function YA(i){let t,e,n,o;e=new Cl({props:{icon:i[0],shadow:!0}}),e.$on("iconLoaded",i[9]);let s=i[1]&&i[2]&&qr(i);return{c(){t=z("div"),$(e.$$.fragment),n=ne(),s&&s.c(),b(t,"class","wrapper svelte-e58ijk")},m(r,a){T(r,t,a),q(e,t,null),R(t,n),s&&s.m(t,null),o=!0},p(r,[a]){const l={};a&1&&(l.icon=r[0]),e.$set(l),r[1]&&r[2]?s?(s.p(r,a),a&6&&P(s,1)):(s=qr(r),s.c(),P(s,1),s.m(t,null)):s&&(re(),D(s,1,1,()=>{s=null}),ae())},i(r){o||(P(e.$$.fragment,r),P(s),o=!0)},o(r){D(e.$$.fragment,r),D(s),o=!1},d(r){r&&M(t),K(e),s&&s.d()}}}function UA(i,t,e){let n,o,s,r,a,l,c,u,{tag:h}=t;const d=()=>{e(2,n=!0)};return i.$$set=f=>{"tag"in f&&e(3,h=f.tag)},i.$$.update=()=>{var f,p;i.$$.dirty&8&&e(1,o=(f=h.data.title)!=null?f:h.data.text),i.$$.dirty&8&&e(8,s=(p=h.data.icon)!=null?p:h.style.point),i.$$.dirty&256&&e(7,r=s.url),i.$$.dirty&256&&e(6,a=s.steps),i.$$.dirty&256&&e(5,l=s.fps),i.$$.dirty&256&&e(4,c=s.ratio),i.$$.dirty&240&&e(0,u={url:r,steps:a,fps:l,ratio:c})},e(2,n=!1),[u,o,n,h,c,l,a,r,s,d]}class JA extends se{constructor(t){super(),oe(this,t,UA,YA,ie,{tag:3},XA)}}function ZA(i){le(i,"svelte-kzl2aj",".customElement__container.svelte-kzl2aj{position:relative}")}function Kr(i){let t,e=i[0].element+"",n;return{c(){t=new Zn(!1),n=fe(),t.a=n},m(o,s){t.m(e,o,s),T(o,n,s)},p(o,s){s&1&&e!==(e=o[0].element+"")&&t.p(e)},d(o){o&&M(n),o&&t.d()}}}function qA(i){let t,e=typeof i[0].element=="string"&&Kr(i);return{c(){t=z("div"),e&&e.c(),b(t,"class","customElement__container svelte-kzl2aj")},m(n,o){T(n,t,o),e&&e.m(t,null),i[2](t)},p(n,[o]){typeof n[0].element=="string"?e?e.p(n,o):(e=Kr(n),e.c(),e.m(t,null)):e&&(e.d(1),e=null)},i:Y,o:Y,d(n){n&&M(t),e&&e.d(),i[2](null)}}}function KA(i,t,e){let{tag:n}=t,o,s;Je(()=>{if(o){if(n.element instanceof Element){const a=n.element;o.appendChild(a),s=()=>a.remove()}else if(typeof n.element=="function"){const a=n.element;s=a(o)}}}),It(()=>{s==null||s()});function r(a){Be[a?"unshift":"push"](()=>{o=a,e(1,o)})}return i.$$set=a=>{"tag"in a&&e(0,n=a.tag)},[n,o,r]}class $A extends se{constructor(t){super(),oe(this,t,KA,qA,ie,{tag:0},ZA)}}function ev(i){le(i,"svelte-1pomljv",'@font-face{font-family:"TG-TYPE";font-style:normal;font-weight:400;src:local("TG-TYPE-Bold"), url(data:application/font-woff2;charset=utf-8;base64,T1RUTwAKAIAAAwAgQ0ZGINFD4CEAAAaQAAAHC0dTVUIAAQAAAAANnAAAAApPUy8yaB5pEwAAAjQAAABgY21hcEItjGUAAAT0AAABfGhlYWQS1WWOAAAAtAAAADZoaGVhBfMBxwAAAhAAAAAkaG10eJ9gBO8AAADsAAABJG1heHAASVAAAAAArAAAAAZuYW1lqczkZQAAApQAAAJecG9zdP+4ADIAAAZwAAAAIAAAUAAASQAAAAEAAAABAADkeHeyXw889QADA+gAAAAA2NoRKwAAAADY2hErACn/OAHgAyAAAQADAAIAAAAAAAAB9ABdAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACCAA7AcwAdwIIADMCCAA0AhwAMwISADkCCAAuAfQANAH+ACsB/gApAggANAEeAFABHgBQAR4AUAIIADQCCAAuAR4AUAEeAFABfAAxAAEAAAPo/zgAAAIcACkAKQHgAAEAAAAAAAAAAAAAAAAAAABJAAMCLgGQAAUACAKKAlgAAABLAooCWAAAAV4AMgEsAAAAAAgAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFVLV04AIAAg/xsDIP84AMgD6ADIAAAAAQAAAAAB9AK8AAAAIAAAAAAAEADGAAEAAAAAAAEADAAAAAEAAAAAAAIABAAMAAEAAAAAAAMAGwAQAAEAAAAAAAQAEQArAAEAAAAAAAUAPAA8AAEAAAAAAAYAEAB4AAEAAAAAAAgADAAAAAEAAAAAAAkADAAAAAMAAQQJAAEAGACIAAMAAQQJAAIACACgAAMAAQQJAAMANgCoAAMAAQQJAAQAIgDeAAMAAQQJAAUAeAEAAAMAAQQJAAYAIAF4AAMAAQQJAAgAGACIAAMAAQQJAAkAGACIQUxJQkFCQSBGb250Qm9sZDEuMDAwO1VLV047QUxJQkFCQUZvbnQtQm9sZEFMSUJBQkEgRm9udCBCb2xkVmVyc2lvbiAxLjAwMDtQUyAwMDEuMDAwO2hvdGNvbnYgMS4wLjg4O21ha2VvdGYubGliMi41LjY0Nzc1QUxJQkFCQUZvbnQtQm9sZABBAEwASQBCAEEAQgBBACAARgBvAG4AdABCAG8AbABkADEALgAwADAAMAA7AFUASwBXAE4AOwBBAEwASQBCAEEAQgBBAEYAbwBuAHQALQBCAG8AbABkAEEATABJAEIAQQBCAEEAIABGAG8AbgB0ACAAQgBvAGwAZABWAGUAcgBzAGkAbwBuACAAMQAuADAAMAAwADsAUABTACAAMAAwADEALgAwADAAMAA7AGgAbwB0AGMAbwBuAHYAIAAxAC4AMAAuADgAOAA7AG0AYQBrAGUAbwB0AGYALgBsAGkAYgAyAC4ANQAuADYANAA3ADcANQBBAEwASQBCAEEAQgBBAEYAbwBuAHQALQBCAG8AbABkAAAAAAADAAAAAwAAASIAAQAAAAAAHAADAAEAAAEiAAABBgAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAABCSEMANjc4OTo7PD0+PwAAAAAAAAACAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGwAAAAAAABwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAFoAAAAQABAAAwAAACAALgA5AFoAegCl/xv//wAAACAALAAwAEEAYQCl/xr////hAAAABv/B/7v/nwAAAAEAAAAOAAAAAAAAAAAACgAAAEIASABDAEYARwADAAAAAAAA/7UAMgAAAAAAAAAAAAAAAAAAAAAAAAAAAQAEAgABAQERQUxJQkFCQUZvbnQtQm9sZAABAQEg+A8A+CAB+CEC+BgEtPtc+HT5tAX3KA/3UBGcHAZWEgAHAQENExoiKTpLbmluZS4wMDEuMDAxbW9uZXkudW5pRkYxQm5pbmUuMDAxdW5pRkYxQWNvcHlyaWdodCBtaXNzaW5nQUxJQkFCQSBGb250IEJvbGQAAAEAAQAAIhkAQhkAEQkBhwABigAADQAADwAAZAABiAABiwABiQAADgAASQIAAQCtAK4ArwCwALEAsgCzALQAtQC2ALcAuAC5ALoAuwC8AL0AvgC/AMAAwQDCAMMAxADFAMYAxwDIAMkAygDLAMwAzQDOAM8A0ADRANIA0wDUANUA1gDXANgA2QDaANsA3ADdAN4A3wDgAOEA4gFDAVoBqwIsAloCuAMcAzkDzwQ4BDoEPARRBFMEVQTNBOIE8QUEmPtc0Ky6rKKsuqzHrKPDoa2irLCspq2vraWssKzOAejVrKytrKzYA/gu+bQV+9H+fPfRBj76ORVqSWbNavs6rM2wSqwH7vsVFUXNafs68wfNaRVqZ6wG704VaklFJ6zNsEmsB/c6TxUn+zqt9xnNB6z7DhX7Bfs69wWsO++6anRpwwfv+0EV+wX7OvcFB/cZahUnXO8GrFMVamsHRVwF8Wr7OqwG0boFRawGDg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4OrIr5UQH3OPdUA/ebihVmaZSdbB9Mr2TL0xr3vgewlK2eqh7Kr86y1BuvrIJ5qh/HZrJIQhr7vgdngmp5bR5OZ0tkQxv46ARUX2FSH/u+B1a5YMDAs7TCHve+B8RjtVYeDnD4utkB93HzA/cL+QgVPfH8vPP5UgcOrIn5UgG++DYD+GmJFfw28wb3svfUBZ2glKSnGsNduFBWXF1UiB4ijgaMsJWsnqoIyLHMstYbsa6Ceawfy2ezSUAaVndXZ2Me+2/7jQX3pwYOrIvy92Tz90ryEr/zM/L3SvMu8hPy+B/3/xUT7LCwpMDDGq6CrHqoHsZnTK5DG2lrg3puH09pZk5EGobykAe4tba6vrViXFZiYlcedyOfBhPyxLpdUlJcW1JSXLvEH5ojfAdllGiebB5LsM5j1xuwrpSeqx/KsLPO1xrKcMNerx4OwPL1Affi8gP4dPdlFWD4fPshBvuJ/HkF+wH3ryPy87YH+8z1Ffc69+QF++QHDrb3ZNf3ZfAB9zX3YwP3nRZlaJSebB9LsGPO1xrzBlK6XMTEubrEHtcHxF26UlJcXFIeI/g0+BYh+677JAaorK2ZsBuwroJ4qx/LZrNHPxo/B2aCaHhrHktmR2NAGw6si/X3b/IBufX3b/ID95n4QBWAg4uKhh/3EfelBfsHBvtK/CMFfnCFbm0aZJVnnmoeSrLPYdobsq6Vnqwfy7K10dgasoGueKwey2RHtT4b+9YETlu7yMe8vcfHvVlPT1laTx8OmIr5UQG/+B8D93iKFfsIBvdo+OYF+6T2+B8oBg6iifL3bPX3QPEStvNB8vc/8jXxE/L4EvgHFRPss7Cnu78arYOreqgexWpNr0YbaWyDem4fUmlmTUcaXqBftGAeE/JWYmROSxpklWieax5Ksc9i2BuxrpWerB/LsbTP2BrHaMVath4T7PsN93QVu7FjXFtlZltcZbC7urGzuh8T8oX8ghVPW7zHx7q6yMa9W1BPWVpQHw6i96Tz92/0AbTz93DzA/hp+HkVsIGveKwezmNFtUAbZGeBeGofSmNiRT8aZJVnnmseSrHPYtoboAb7EvukBfcHBvdL+CEFmaySqaQa+9gWxry+yJ6dhoGcHq12oWZmGk5YW1BMXLnKHg4gCiEK+11L91IlCvdiyhWtb6hpJgoeJAoOIQogCqz3pe/3b/UBufX3bfQD+G74dxWyga94rB7NZEW0PhtlaIF4ah9KY2FFPxo7tkTPZh6MjIqKjB+TiJCIjYoIjgaCoKGHoRuanY6QoB+IgfsB+6QF9wcG9y/4IgWYppGnqhr7a/sCFVBbvMjHu7zGyLxbTk5aWk4fDvtd+AojCoz7jBUmCh8kCq1vqGkeDvtdi/cS94wjCvwKBCIKDiD3ru8BvPeuA7z4EhUn967vBw4eoDf/DAmLDAv47BT4exWcEwAHAQFBXW97ipCarPcv8+7yAfdl8gP4aPf6FfIjB+r3gwUiBi77gwWHBjH3gwUkBuP7gwUnJPcxKPsxI/cx+y/y9y/3MPP7MO4GDvtdi/cSJQr3JBZkcqOzsKSksrCkcWdlcnFmHw6up6eurm+naGhvb2hop2+uHwv3EiUK9yP4ChUiCgt3SgWxBrnmBZGVj5eZGgsB2/cSAwtobm5paqBzqoYLAAABAAAAAAAAAAAAAA==) format("woff2")}*{-webkit-tap-highlight-color:transparent}.content__container.svelte-1pomljv{position:relative;left:50%;top:50%;transform:translate(-50%, -50%);font-family:PingFangSC, Segoe UI, Rototo, sans-serif}.content__container.withAnimation.svelte-1pomljv{transition:opacity 0.3s linear}.content__container.unClickable.svelte-1pomljv{pointer-events:none !important}.content__container.unClickable.svelte-1pomljv *{pointer-events:none !important}.content__wrapper.svelte-1pomljv{pointer-events:none;width:100%;height:100%}.content__container.hide.svelte-1pomljv{opacity:0;pointer-events:none}.content__container.hide.svelte-1pomljv *{pointer-events:none !important}.content__container.disable.svelte-1pomljv{display:none}.content.svelte-1pomljv{position:relative;width:100%;height:100%;font-size:0.75rem;line-height:1.125rem;color:#fff}.content.svelte-1pomljv:not(.unfolded){pointer-events:none}.content.svelte-1pomljv:not(.unfolded) *{pointer-events:none !important}')}function tv(i){let t,e;return{c(){t=z("div"),b(t,"data-info","tag content is keep folded"),b(t,"data-id",e=i[1].id)},m(n,o){T(n,t,o)},p(n,o){o&2&&e!==(e=n[1].id)&&b(t,"data-id",e)},i:Y,o:Y,d(n){n&&M(t)}}}function nv(i){let t,e,n,o,s,r,a,l,c;const u=[cv,lv,av,rv,sv,ov,iv],h=[];function d(f,p){return f[1].element?0:f[1].contentType==="Text"?1:f[1].contentType==="ImageText"||f[1].contentType==="Image"||f[1].contentType==="Video"?2:f[1].contentType==="Audio"?3:f[1].contentType==="Marketing"?4:f[1].contentType==="Link"||f[1].contentType==="VRLink"||f[1].contentType==="PanoLink"?5:f[1].contentType==="MediaPlane"||f[1].contentType==="MediaModel"?6:-1}return~(o=d(i))&&(s=h[o]=u[o](i)),{c(){var f;t=z("div"),e=z("div"),n=z("div"),s&&s.c(),b(n,"class","content svelte-1pomljv"),Z(n,"unfolded",(f=i[1].state)==null?void 0:f.unfolded),b(e,"class","content__wrapper svelte-1pomljv"),b(t,"class","content__container svelte-1pomljv"),b(t,"data-id",r=i[1].id),Z(t,"disable",i[1].enabled===!1),Z(t,"hide",i[4]),Z(t,"withAnimation",i[0]),Z(t,"unClickable",i[1].clickable===!1),L(t,"width",i[1].stickType==="Plane"||i[1].contentType==="MediaModel"?"100%":0),L(t,"height",i[1].stickType==="Plane"||i[1].contentType==="MediaModel"?"100%":0)},m(f,p){T(f,t,p),R(t,e),R(e,n),~o&&h[o].m(n,null),a=!0,l||(c=we(t,"click",va(i[13])),l=!0)},p(f,p){var g;let v=o;o=d(f),o===v?~o&&h[o].p(f,p):(s&&(re(),D(h[v],1,1,()=>{h[v]=null}),ae()),~o?(s=h[o],s?s.p(f,p):(s=h[o]=u[o](f),s.c()),P(s,1),s.m(n,null)):s=null),(!a||p&2)&&Z(n,"unfolded",(g=f[1].state)==null?void 0:g.unfolded),(!a||p&2&&r!==(r=f[1].id))&&b(t,"data-id",r),(!a||p&2)&&Z(t,"disable",f[1].enabled===!1),(!a||p&16)&&Z(t,"hide",f[4]),(!a||p&1)&&Z(t,"withAnimation",f[0]),(!a||p&2)&&Z(t,"unClickable",f[1].clickable===!1),p&2&&L(t,"width",f[1].stickType==="Plane"||f[1].contentType==="MediaModel"?"100%":0),p&2&&L(t,"height",f[1].stickType==="Plane"||f[1].contentType==="MediaModel"?"100%":0)},i(f){a||(P(s),a=!0)},o(f){D(s),a=!1},d(f){f&&M(t),~o&&h[o].d(),l=!1,c()}}}function iv(i){let t,e;return t=new jA({props:{tag:He(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=He(n[1])),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function ov(i){let t,e;return t=new JA({props:{tag:He(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=He(n[1])),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function sv(i){let t,e;return t=new sA({props:{tag:He(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=He(n[1])),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function rv(i){let t,e;return t=new MA({props:{tag:He(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=He(n[1])),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function av(i){let t,e;return t=new G0({props:{tag:He(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=He(n[1])),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function lv(i){let t,e;return t=new ag({props:{tag:He(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=He(n[1])),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function cv(i){let t,e;return t=new $A({props:{tag:He(i[1])}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=He(n[1])),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function uv(i){let t,e,n,o;const s=[nv,tv],r=[];function a(l,c){return l[3]?0:1}return t=a(i),e=r[t]=s[t](i),{c(){e.c(),n=fe()},m(l,c){r[t].m(l,c),T(l,n,c),o=!0},p(l,[c]){let u=t;t=a(l),t===u?r[t].p(l,c):(re(),D(r[u],1,1,()=>{r[u]=null}),ae(),e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),P(e,1),e.m(n.parentNode,n))},i(l){o||(P(e),o=!0)},o(l){D(e),o=!1},d(l){r[t].d(l),l&&M(n)}}}function dv(i,t,e){let n,o,s,r,a,l,{withAnimation:c=!1}=t,{tag:u}=t,{hooks:h}=t,{state:d}=t,{mediaStore:f}=t,{temporaryState:p}=t;Fi("hooks",h),Fi("mediaStore",f);let v,g;function A(C){C?h.emit("exposure",{id:r,type:"start"}):h.emit("exposure",{id:r,type:"end"})}function y(C,x,I){var S,k;return!(!x.visible||!x.enabled||!I.visible||!((S=C.state)!=null&&S.visible)||((k=C.temporaryState)==null?void 0:k.visible)===!1||Re(C)&&C.mediaVisible===!1)}const w=C=>h.emit("click",{event:C,target:"TagContent",tag:u});return i.$$set=C=>{"withAnimation"in C&&e(0,c=C.withAnimation),"tag"in C&&e(1,u=C.tag),"hooks"in C&&e(2,h=C.hooks),"state"in C&&e(5,d=C.state),"mediaStore"in C&&e(6,f=C.mediaStore),"temporaryState"in C&&e(7,p=C.temporaryState)},i.$$.update=()=>{var C,x,I,S,k,j,_,F,J,V,B;i.$$.dirty&2&&e(11,n=(C=u.state)==null?void 0:C.unfolded),i.$$.dirty&2&&e(10,o=(x=u.state)==null?void 0:x.visible),i.$$.dirty&162&&e(12,s=d.visible&&p.visible&&((I=u.state)==null?void 0:I.visible)),i.$$.dirty&2&&(r=u.id),i.$$.dirty&162&&e(4,a=!y(u,d,p)),i.$$.dirty&4096&&A(s),i.$$.dirty&3842&&u.hooks&&(n!==void 0&&n!==g&&(e(9,g=n),n?(k=(S=u.hooks).emit)==null||k.call(S,"unfolded"):(_=u==null?void 0:(j=u.hooks).emit)==null||_.call(j,"folded")),o!==void 0&&o!==v&&(e(8,v=o),o?(J=(F=u.hooks).emit)==null||J.call(F,"show"):(B=(V=u.hooks).emit)==null||B.call(V,"hide"))),i.$$.dirty&2&&e(3,l=(()=>!(typeof u.mergedConfig.unfoldedConfig=="object"&&u.mergedConfig.unfoldedConfig.keep==="folded"))())},[c,u,h,l,a,d,f,p,v,g,o,n,s,w]}class Pl extends se{constructor(t){super(),oe(this,t,dv,uv,ie,{withAnimation:0,tag:1,hooks:2,state:5,mediaStore:6,temporaryState:7},ev)}}function hv(i){le(i,"svelte-yex9rb",'@charset "UTF-8";.tag-point-click-helper.svelte-yex9rb.svelte-yex9rb{position:absolute;pointer-events:auto;cursor:pointer;width:2.5rem;height:2.5rem;left:50%;top:50%;transform:translate(-50%, -50%)}.tag-point-wrapper.svelte-yex9rb.svelte-yex9rb{pointer-events:none;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);z-index:-1}.tag-folded-point.svelte-yex9rb.svelte-yex9rb,.tag-unfolded-point.svelte-yex9rb.svelte-yex9rb{transition:all 0.5s}.tag-point-wrapper.svelte-yex9rb .tag-unfolded-point.svelte-yex9rb{display:flex;justify-content:center;align-items:center;position:absolute;width:100%;height:100%;border-radius:50%}.tag-point-wrapper.svelte-yex9rb .tag-unfolded-point.svelte-yex9rb:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:0.3125rem;height:0.3125rem;border-radius:50%;background-color:white}.tag-point-wrapper.svelte-yex9rb .tag-unfolded-point.svelte-yex9rb:before{content:"";position:absolute;width:0.875rem;height:0.875rem;border-radius:50%;background-color:rgba(0, 0, 0, 0.2)}.tag-point-wrapper.folded.svelte-yex9rb .tag-folded-point.svelte-yex9rb{opacity:1;scale:1}.tag-point-wrapper.folded.svelte-yex9rb .tag-unfolded-point.svelte-yex9rb{opacity:0;scale:1}.tag-point-wrapper.unfolded.svelte-yex9rb .tag-folded-point.svelte-yex9rb{opacity:0;scale:0.2}.tag-point-wrapper.unfolded.svelte-yex9rb .tag-unfolded-point.svelte-yex9rb{opacity:1;scale:1}')}function fv(i){let t,e,n,o,s,r,a,l,c,u,h,d;return o=new nt({props:{center:!0,blurRadius:15,spreadRadius:5,opacity:.3}}),c=new Cl({props:{icon:i[2],width:i[1]}}),{c(){t=z("div"),e=ne(),n=z("div"),$(o.$$.fragment),s=ne(),r=z("div"),a=ne(),l=z("div"),$(c.$$.fragment),b(t,"class","tag-point-click-helper svelte-yex9rb"),b(r,"class","tag-unfolded-point svelte-yex9rb"),L(r,"transition-delay",(i[3]?i[5]:0)+"ms"),b(l,"class","tag-folded-point svelte-yex9rb"),L(l,"transition-delay",(i[3]?i[5]:0)+"ms"),b(n,"class","tag-point-wrapper svelte-yex9rb"),Z(n,"unfolded",i[0]),Z(n,"folded",i[3]),L(n,"width",Ie(i[1])),L(n,"height",Ie(i[1]))},m(f,p){T(f,t,p),T(f,e,p),T(f,n,p),q(o,n,null),R(n,s),R(n,r),R(n,a),R(n,l),q(c,l,null),u=!0,h||(d=we(t,"click",i[4]),h=!0)},p(f,[p]){p&8&&L(r,"transition-delay",(f[3]?f[5]:0)+"ms");const v={};p&4&&(v.icon=f[2]),p&2&&(v.width=f[1]),c.$set(v),p&8&&L(l,"transition-delay",(f[3]?f[5]:0)+"ms"),(!u||p&1)&&Z(n,"unfolded",f[0]),(!u||p&8)&&Z(n,"folded",f[3]),p&2&&L(n,"width",Ie(f[1])),p&2&&L(n,"height",Ie(f[1]))},i(f){u||(P(o.$$.fragment,f),P(c.$$.fragment,f),u=!0)},o(f){D(o.$$.fragment,f),D(c.$$.fragment,f),u=!1},d(f){f&&M(t),f&&M(e),f&&M(n),K(o),K(c),h=!1,d()}}}function mv(i,t,e){let n,o,s,r;const a=Tt("hooks");let{tag:l}=t,c,u=!1;const h=()=>{c!==void 0&&clearTimeout(c),u=!0,c=setTimeout(()=>{u=!1},800)},d=p=>{u||a.emit("click",{event:p,target:"TagPoint",tag:l})},f=(()=>l.contentType==="Text"&&l.data.appearance==="plane"?500:800)();return i.$$set=p=>{"tag"in p&&e(6,l=p.tag)},i.$$.update=()=>{var p,v,g,A;i.$$.dirty&64&&e(0,n=(p=l.state)==null?void 0:p.unfolded),i.$$.dirty&1&&e(3,o=!n),i.$$.dirty&64&&e(2,s=(g=(v=l.style)==null?void 0:v.point)!=null&&g.url?(A=l.style)==null?void 0:A.point:{url:Bp}),i.$$.dirty&64&&e(1,r=(()=>{var w,C,x;const y=(x=(C=(w=l.style)==null?void 0:w.point)==null?void 0:C.size)!=null?x:"S";return typeof y=="number"?y:y==="S"?18:y==="M"?20:y==="L"?24:y==="XL"?28:18})())},h(),[n,r,s,o,d,f,l]}class pv extends se{constructor(t){super(),oe(this,t,mv,fv,ie,{tag:6},hv)}}function gv(i){le(i,"svelte-pzwdws",".tag.withAnimation.svelte-pzwdws{transition:opacity 0.3s linear}.tag.hide.svelte-pzwdws{opacity:0;pointer-events:none}.tag.hide.svelte-pzwdws *{pointer-events:none !important}.tag.unClickable.svelte-pzwdws{pointer-events:none !important}.tag.unClickable.svelte-pzwdws *{pointer-events:none !important}.tag.disable.svelte-pzwdws{display:none}.wrapper.svelte-pzwdws{position:absolute;width:0rem;height:0rem;overflow:visible;pointer-events:auto}")}function Av(i){let t;return{c(){t=z("div"),b(t,"data-info","tag content is disable")},m(e,n){T(e,t,n)},p:Y,i:Y,o:Y,d(e){e&&M(t)}}}function vv(i){let t,e;return t=new Pl({props:{mediaStore:i[2],withAnimation:i[0],tag:He(i[1]),hooks:i[14],state:i[3],temporaryState:i[4]}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&4&&(s.mediaStore=n[2]),o&1&&(s.withAnimation=n[0]),o&2&&(s.tag=He(n[1])),o&8&&(s.state=n[3]),o&16&&(s.temporaryState=n[4]),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function bv(i){let t;return{c(){t=z("div"),b(t,"data-info","tag point is disable")},m(e,n){T(e,t,n)},p:Y,i:Y,o:Y,d(e){e&&M(t)}}}function yv(i){let t,e;return t=new pv({props:{tag:i[1]}}),{c(){$(t.$$.fragment)},m(n,o){q(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=n[1]),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){K(t,n)}}}function wv(i){let t,e,n,o,s,r,a,l,c;const u=[vv,Av],h=[];function d(g,A){return g[12]?0:1}n=d(i),o=h[n]=u[n](i);const f=[yv,bv],p=[];function v(g,A){return g[13]?0:1}return r=v(i),a=p[r]=f[r](i),{c(){t=z("div"),e=z("div"),o.c(),s=ne(),a.c(),b(e,"class","wrapper svelte-pzwdws"),b(e,"data-tag-unfolded",i[8]),b(e,"data-tag-id",i[11]),b(e,"data-content-type",l=i[1].contentType),L(e,"left",i[7]),L(e,"top",i[6]),L(e,"z-index",i[5]),b(t,"class","tag svelte-pzwdws"),b(t,"data-tag-id",i[11]),Z(t,"unClickable",i[1].clickable===!1),Z(t,"disable",i[10]),Z(t,"hide",i[9]),Z(t,"withAnimation",i[0])},m(g,A){T(g,t,A),R(t,e),h[n].m(e,null),R(e,s),p[r].m(e,null),c=!0},p(g,[A]){let y=n;n=d(g),n===y?h[n].p(g,A):(re(),D(h[y],1,1,()=>{h[y]=null}),ae(),o=h[n],o?o.p(g,A):(o=h[n]=u[n](g),o.c()),P(o,1),o.m(e,s));let w=r;r=v(g),r===w?p[r].p(g,A):(re(),D(p[w],1,1,()=>{p[w]=null}),ae(),a=p[r],a?a.p(g,A):(a=p[r]=f[r](g),a.c()),P(a,1),a.m(e,null)),(!c||A&256)&&b(e,"data-tag-unfolded",g[8]),(!c||A&2048)&&b(e,"data-tag-id",g[11]),(!c||A&2&&l!==(l=g[1].contentType))&&b(e,"data-content-type",l),A&128&&L(e,"left",g[7]),A&64&&L(e,"top",g[6]),A&32&&L(e,"z-index",g[5]),(!c||A&2048)&&b(t,"data-tag-id",g[11]),(!c||A&2)&&Z(t,"unClickable",g[1].clickable===!1),(!c||A&1024)&&Z(t,"disable",g[10]),(!c||A&512)&&Z(t,"hide",g[9]),(!c||A&1)&&Z(t,"withAnimation",g[0])},i(g){c||(P(o),P(a),c=!0)},o(g){D(o),D(a),c=!1},d(g){g&&M(t),h[n].d(),p[r].d()}}}function Cv(i,t,e){let n,o,s,r,a,l,c,u,h,{withAnimation:d=!1}=t,{tag:f}=t,{mediaStore:p}=t,{state:v}=t,{temporaryState:g}=t;const A=Tt("hooks");return i.$$set=y=>{"withAnimation"in y&&e(0,d=y.withAnimation),"tag"in y&&e(1,f=y.tag),"mediaStore"in y&&e(2,p=y.mediaStore),"state"in y&&e(3,v=y.state),"temporaryState"in y&&e(4,g=y.temporaryState)},i.$$.update=()=>{var y,w,C,x,I,S,k,j;i.$$.dirty&2&&e(13,n=(()=>!(f.contentType==="Link"||f.contentType==="VRLink"||f.contentType==="PanoLink"||f.contentType==="Audio"&&f.data.appearance==="plane"))()),i.$$.dirty&2&&e(12,o=(()=>f.stickType==="2DPoint")()),i.$$.dirty&2&&e(11,s=f.id),i.$$.dirty&2&&e(10,r=!((y=f.pointTagStyle)!=null&&y.leftPercent)||!((w=f.pointTagStyle)!=null&&w.topPercent)||f.enabled===!1||!f.state),i.$$.dirty&2&&e(9,a=!((C=f.state)!=null&&C.visible)||((x=f.temporaryState)==null?void 0:x.visible)===!1),i.$$.dirty&2&&e(8,l=(I=f.state)==null?void 0:I.unfolded),i.$$.dirty&2&&e(7,c=((S=f.pointTagStyle)==null?void 0:S.leftPercent)+"%"),i.$$.dirty&2&&e(6,u=((k=f.pointTagStyle)==null?void 0:k.topPercent)+"%"),i.$$.dirty&2&&e(5,h=(j=f.state)!=null&&j.unfolded?1:0)},[d,f,p,v,g,h,u,c,l,a,r,s,o,n,A]}class Pv extends se{constructor(t){super(),oe(this,t,Cv,wv,ie,{withAnimation:0,tag:1,mediaStore:2,state:3,temporaryState:4},gv)}}function Ev(i){le(i,"svelte-uq11d5",".tag--container.svelte-uq11d5{box-sizing:border-box;position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;opacity:1;-webkit-user-select:none;-moz-user-select:none;user-select:none;transform:translate3d(0, 0, 0)}.withAnimation.svelte-uq11d5{transition:opacity 0.3s linear}.tag--container.hide.svelte-uq11d5{opacity:0;pointer-events:none}.tag--container.hide.svelte-uq11d5 *{pointer-events:none !important}")}function $r(i,t,e){const n=i.slice();return n[6]=t[e],n}function ea(i){let t,e=[],n=new Map,o,s=i[1];const r=a=>a[6].id;for(let a=0;a<s.length;a+=1){let l=$r(i,s,a),c=r(l);n.set(c,e[a]=ta(c,l))}return{c(){t=z("div");for(let a=0;a<e.length;a+=1)e[a].c();b(t,"class","tag--container svelte-uq11d5"),Z(t,"hide",!i[3].visible||!i[4].visible),Z(t,"withAnimation",i[0])},m(a,l){T(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,l){l&31&&(s=a[1],re(),e=Ze(e,l,r,1,a,s,n,t,kt,ta,null,$r),ae()),(!o||l&24)&&Z(t,"hide",!a[3].visible||!a[4].visible),(!o||l&1)&&Z(t,"withAnimation",a[0])},i(a){if(!o){for(let l=0;l<s.length;l+=1)P(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)D(e[l]);o=!1},d(a){a&&M(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function ta(i,t){let e,n,o;return n=new Pv({props:{state:t[3],temporaryState:t[4],withAnimation:t[0],tag:t[6],mediaStore:t[2]}}),{key:i,first:null,c(){e=fe(),$(n.$$.fragment),this.first=e},m(s,r){T(s,e,r),q(n,s,r),o=!0},p(s,r){t=s;const a={};r&8&&(a.state=t[3]),r&16&&(a.temporaryState=t[4]),r&1&&(a.withAnimation=t[0]),r&2&&(a.tag=t[6]),r&4&&(a.mediaStore=t[2]),n.$set(a)},i(s){o||(P(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&M(e),K(n,s)}}}function Iv(i){let t,e,n=i[3].enabled&&ea(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[3].enabled?n?(n.p(o,s),s&8&&P(n,1)):(n=ea(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(re(),D(n,1,1,()=>{n=null}),ae())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function kv(i,t,e){let{withAnimation:n=!1}=t,{tags:o=[]}=t,{hooks:s}=t,{mediaStore:r}=t,{state:a}=t,{temporaryState:l}=t;return Fi("hooks",s),i.$$set=c=>{"withAnimation"in c&&e(0,n=c.withAnimation),"tags"in c&&e(1,o=c.tags),"hooks"in c&&e(5,s=c.hooks),"mediaStore"in c&&e(2,r=c.mediaStore),"state"in c&&e(3,a=c.state),"temporaryState"in c&&e(4,l=c.temporaryState)},[n,o,r,a,l,s]}class xv extends se{constructor(t){super(),oe(this,t,kv,Iv,ie,{withAnimation:0,tags:1,hooks:5,mediaStore:2,state:3,temporaryState:4},Ev)}}const Dv={globalConfig:{unfoldedConfig:{autoUnfold:{strategy:"MinimumDistance",distance:{max:5}}},tag3DConfig:{ratio:.0035}},contentTypeConfig:{"Any-Audio-plane":{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},Link:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},VRLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},PanoLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},MediaPlane:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{alwaysShowWhenMovePano:!0}},MediaModel:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{keep:"visible",visibleFiveMode:["Panorama","Floorplan","Model","Mapview"],alwaysShowWhenMovePano:!0}}}};class Lv extends ci{constructor(e){super(e);m(this,"tagCacheByPanoIndex",{})}getCache({panoIndex:e,id:n,key:o}){var c,u,h,d;const{five:s}=this,r=(c=s.panoIndex)!=null?c:e;if(r===void 0)throw new Error(`TagCacheController getCache(): fivePanoIndex is ${r}`);const a=`${(h=(u=s.work)==null?void 0:u.workCode)!=null?h:s.model.uuid}-${r}`;let l=this.tagCacheByPanoIndex[a];if(l||(l=new Map,this.tagCacheByPanoIndex[a]=l),n===void 0)return l;if(o===void 0){const f=l.get(n);return f||(l.set(n,{}),l.get(n))}return(d=l.get(n))==null?void 0:d[o]}clearCache(){this.tagCacheByPanoIndex={}}removeCache(){}}class Sv extends Lv{constructor(e){super(e);m(this,"tags",[]);m(this,"config",Dv);m(this,"raycaster",new E.Raycaster)}get isPanorama(){return this.five.currentMode==="Panorama"}getTagById(e){const n=this.tags.find(o=>o.id===e);if(!n){console.warn(`error: can not find tag id ${e} by getTagById()`);return}return n}changeContentTypeConfig(e,n,o=!0){this.config.contentTypeConfig||(this.config.contentTypeConfig={}),o?this.config.contentTypeConfig[e]=mt.default({},this.config.contentTypeConfig[e],n):this.config.contentTypeConfig[e]=n,this.clearCache()}getVisibleByPanoIndex(e,n){var r;const o=this.getCache({panoIndex:n,id:e.id}),s=(r=this.five.panoIndex)!=null?r:n;if(Re(e))return!0;if(o.visible!==void 0)return o.visible;{const a=(()=>{var u,h,d;const l=(u=this.getTagConfig(e).visibleConfig)!=null?u:{},c=this.getDistance(e);if(typeof l=="function")return{value:l(this.five,{tag:e,distance:c}),reason:"config function result"};if(l.keep==="hidden")return{value:!1,reason:"config.keep is hidden"};if(l.keep==="visible")return{value:!0,reason:"config.keep is visible"};if(l.visiblePanoIndex!==void 0&&l.visiblePanoIndex!=="all"&&s!==void 0){if(Array.isArray(l.visiblePanoIndex)&&!l.visiblePanoIndex.includes(s))return{value:!1,reason:`current panoIndex is not included in visiblePano. currentPanoIndex: ${s}, visiblePanoIndex: ${l.visiblePanoIndex}`};if(l.visiblePanoIndex==="current"&&s!==((h=e.fiveState)==null?void 0:h.panoIndex))return{value:!1,reason:`current panoIndex is not equal to tag.panoIndex. currentPanoIndex: ${s}, tag.panoIndex: ${(d=e.fiveState)==null?void 0:d.panoIndex}`}}if(l.visibleDistance!==void 0&&l.visibleDistance!=="unLimited"&&ln(c,l.visibleDistance)===!1)return{value:!1,reason:`distance is not in visibleDistance. distance: ${c}, visibleDistance: ${l.visibleDistance}`};if(l.intersectRaycaster!==!1&&(typeof l.intersectRaycaster!="object"||l.intersectRaycaster.enabled!==!1)){if(s===void 0)return{value:!1,reason:`intersectRaycaster check failed: fivePanoIndex is ${s}`};const f=this.getRaycasterFromPanoIndex(e,s),p=this.getTagEnableByIntersect(e,f);if(p.value===!1)return p}if(l.angleRange&&yp(e)){const f=this.getAngle(e);if(ln(f,l.angleRange)===!1)return{value:!1,reason:`angle is not in angleRange. angle: ${f}, angleRange: ${l.angleRange}`}}return{value:!0,reason:"all check passed"}})();return o.visible=a.value,o.__debug_visible_reason__=a,o.visible}}getVisibleByFiveMode(e,n){var r;const o=(r=this.getTagConfig(e).visibleConfig)!=null?r:{};if(typeof o=="function")return n==="Panorama";const s=o==null?void 0:o.visibleFiveMode;return s?s.includes(n):n==="Panorama"}getVisibleByFloorIndex(e){var a;const n=e.fiveState;if(!n)return!0;const o=n.panoIndex,s=(a=this.five.work.observers[o])==null?void 0:a.floorIndex,r=this.five.model.shownFloor;return r===null||r===s}getVisible(e){const n=this.five.getCurrentState(),o=this.getVisibleByFiveMode(e,n.mode),s=Re(e)?this.getVisibleByFloorIndex(e):!0,r=n.mode==="Panorama"?this.getVisibleByPanoIndex(e,n.panoIndex):!0;return o&&r&&s}getModelMedialVisibleByPanoIndex(e){const n=this.five.getCurrentState().panoIndex,o=this.getCache({panoIndex:n,id:e.id});if(o.modelMedialVisible!==void 0)return o.modelMedialVisible;const s=this.getRaycasterFromPanoIndex(e,n),r=this.getTagEnableByIntersect(e,s);return o.modelMedialVisible=r.value,o.__debug_visible_reason__=r,r.value!==!1}getUnfoldedByPanoIndex(e,n){if(!this.getVisibleByPanoIndex(e))return;const s=this.getCache({panoIndex:n,id:e.id});if(s.unfolded!==void 0)return s.unfolded;{const r=this.getTagConfig(e).unfoldedConfig;if(!r)return;const a=(()=>{const c=this.getDistance(e);if(typeof r=="function")return r(this.five,{tag:e,distance:c});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.unfoldDistance&&ln(c,r.unfoldDistance)===!1)return!1})();s.unfolded=a;const l=this.getUnfoldedByCamera(e);return l!==void 0?l:s.unfolded}}getUnfoldedByCamera(e){return this.getVisibleByPanoIndex(e)?(()=>{var a;const s=this.getDistance(e),r=this.getTagConfig(e).unfoldedConfig;if(!!r){if(typeof r=="function")return r(this.five,{tag:e,distance:s});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.autoUnfold===void 0||r.autoUnfold===!1||r.autoUnfold.enable===!1)return;if(r.autoUnfold.strategy==="ScreenPostion"){const l=this.getTagProject(e);if(l&&ln(l.x,r.autoUnfold.autoUnfoldProjectX)===!1)return!1}if(r.autoUnfold.strategy==="MinimumDistance"){const u=this.filterPointTag().filter(d=>this.getVisibleByPanoIndex(d)).filter(d=>{const f=this.getTagProject(d);if(!f)return!1;const{x:p,y:v,z:g}=f;return!(Math.abs(g)>1||Math.abs(p)>1||Math.abs(v)>1)}).map(d=>({tag:d,id:d.id,tagConfig:this.getTagConfig(d).unfoldedConfig})).filter(({tag:d,tagConfig:f})=>{var p,v;return!(typeof f!="object"||f.keep||f.autoUnfold===!1||((p=f.autoUnfold)==null?void 0:p.enable)===!1||((v=f.autoUnfold)==null?void 0:v.strategy)!=="MinimumDistance")}).map(d=>me(H({},d),{distance:this.getDistance(d.tag)})).filter(({distance:d,tagConfig:f})=>{var p,v;return!(d===void 0||typeof f!="object"||f.autoUnfold===!1||((p=f.autoUnfold)==null?void 0:p.enable)===!1||((v=f.autoUnfold)==null?void 0:v.strategy)!=="MinimumDistance"||f.autoUnfold.distance&&ln(d,f.autoUnfold.distance)===!1)}).sort((d,f)=>d.distance-f.distance).findIndex(d=>d.id===e.id);if(u===-1||u<=((a=r.autoUnfold.maxNumber)!=null?a:1)-1===!1)return!1}return!0}})():void 0}getDistance(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCache({panoIndex:n,id:e.id});if(s.distance!==void 0)return s.distance;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getDistance(): observerPosition is ${c}`);const u=Us(e),h=c.distanceTo(u);return s.distance=h,h}}getAngle(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCache({panoIndex:n,id:e.id});if(s.angle!==void 0)return s.angle;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getAngleRange(): observerPosition is ${c}`);const u=(()=>e.stickType==="3DPoint"?An(e.normal):Ji(e.position))();if(!u)return;const h=new E.Vector3().copy(c).sub(Zi(e.position)),d=u.angleTo(h)*180/Math.PI;return s.angle=d,s.angle}}getTagConfig(e){var s,r;if(!e)return(s=this.config.globalConfig)!=null?s:{};const n={};this.config.contentTypeConfig&&Object.keys(this.config.contentTypeConfig).forEach(a=>{const l=a;if(n[l])return;const c=l.split("-");if(c.length===1){const[u]=c;e.contentType===u&&(n[l]=this.config.contentTypeConfig[l])}if(c.length===2){const[u="Any",h="Any"]=c;(e.stickType===u||u==="Any")&&(e.contentType===h||h==="Any")&&(n[l]=this.config.contentTypeConfig[l])}if(c.length===3){const[u="Any",h,d]=c;if(h==="Audio"&&e.contentType==="Audio"){const f=e;(f.stickType===u||u==="Any")&&f.data.appearance===d&&(n[l]=this.config.contentTypeConfig[l])}}});const o=mt.default({},this.config.globalConfig,...Object.values(n),e.config);return typeof o.unfoldedConfig=="object"&&(o.unfoldedConfig.disableFold&&(o.unfoldedConfig={keep:"unfolded"}),o.unfoldedConfig.disableUnfold&&(o.unfoldedConfig={keep:"folded"}),o.unfoldedConfig.keep&&(o.unfoldedConfig={keep:o.unfoldedConfig.keep})),typeof o.visibleConfig=="object"&&o.visibleConfig.keep&&(o.visibleConfig={keep:o.visibleConfig.keep,visibleFiveMode:(r=o.visibleConfig)==null?void 0:r.visibleFiveMode}),o}can(e,n){const o=this.getTagConfig(n);if(!o||typeof o!="object")return!0;if(e==="show"||e==="hide"){if(!o.visibleConfig||typeof o.visibleConfig!="object")return!0;if(e==="show"&&o.visibleConfig.keep==="hidden"||e==="hide"&&(o.visibleConfig.keep==="visible"||o.visibleConfig.alwaysShowWhenMovePano))return!1}if(e==="fold"||e==="unfold"){if(!o.unfoldedConfig||typeof o.unfoldedConfig!="object")return!0;if(e==="fold"&&o.unfoldedConfig.keep==="unfolded"||e==="unfold"&&o.unfoldedConfig.keep==="folded")return!1}return!0}sort(e){return e.sort((n,o)=>{const s=this.getDistance(n),r=this.getDistance(o);return s===void 0||r===void 0?0:r-s})}setPointTagPosition(){const e=this.filterPointTag();e.length!==0&&e.forEach(n=>{var s;if(!((s=n.state)!=null&&s.visible)){n.pointTagStyle=null;return}const o=this.getTagProject(n);if(!o){n.pointTagStyle=null;return}n.pointTagStyle={leftPercent:(o.x+1)/2*100,topPercent:(-o.y+1)/2*100}})}setVisibleByPanoIndex(){this.tags.forEach(e=>{const n=this.getVisibleByPanoIndex(e);e.state&&(e.state.visible=n)})}setModelMedialVisibleByPanoIndex(){this.tags.forEach(e=>{if(!Re(e))return;const n=this.getModelMedialVisibleByPanoIndex(e);e.mediaVisible=n})}setUnfoldedByPanoIndex(){this.tags.forEach(e=>{const n=this.getUnfoldedByPanoIndex(e);if(!!e.state&&(n!==void 0&&(e.state.unfolded=n),n&&!e.state.visible)){const o=this.getTagConfig(e);typeof o.unfoldedConfig=="object"&&o.unfoldedConfig.autoUnfoldWhenHide!==!1&&(e.state.unfolded=!1)}})}getTagProject(e){if(!this.getVisibleByPanoIndex(e))return;const o=Zi(e.position),{x:s,y:r,z:a}=o.project(this.five.camera);if(!(a>1))return{x:s,y:r,z:a}}filterPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint"||e.stickType==="3DPoint")}filter2DPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint")}filter3DPointTag(){return this.tags.filter(e=>e.stickType==="3DPoint")}filterModelTag(){return this.tags.filter(e=>e.stickType==="Model")}filter3DTag(){return this.tags.filter(e=>e.stickType==="3DPoint"||e.stickType==="Plane")}filterPlaneTag(){return this.tags.filter(e=>e.stickType==="Plane")}updateTagConfig(e){e!=null&&e.force&&this.clearCache(),this.tags.forEach(n=>{const o=this.getTagConfig(n);n.mergedConfig=o})}getTagEnableByIntersect(e,n){var u,h,d;const o=(u=this.getTagConfig(e).visibleConfig)!=null?u:{},s=this.getDistance(e),[r]=this.five.model.intersectRaycaster(n),a=(()=>{if(!Re(e))return;const f=this.tags.filter(Re).map(v=>{var g;return(g=v.model)==null?void 0:g.object}).filter(Ye);return n.intersectObjects(f,!0)[0]})(),l=(()=>{var f;return typeof o=="object"&&typeof o.intersectRaycaster=="object"&&(f=o.intersectRaycaster.distanceAccuracy)!=null?f:.01})();return Math.min((h=r==null?void 0:r.distance)!=null?h:1/0,(d=a==null?void 0:a.distance)!=null?d:1/0)+l<s?{value:!1,reason:`intersectRaycaster check failed: distance is ${s}, intersection.point is ${r.point.toArray()},
562
+ customModelIntersection.point is ${a==null?void 0:a.point.toArray()} distanceError is ${l}`}:{value:!0,reason:""}}getRaycasterFromPanoIndex(e,n){var r;const o=(r=this.five.work.observers[n])==null?void 0:r.position;if(o===void 0)throw new Error(`getVisible(): observerPosition is ${o}`);const s=Us(e).sub(o).normalize();return this.raycaster.set(o,s),this.raycaster}}function Mv(i){var t,e,n,o;if(!i.stickType){const s=(()=>i.pointType==="PointTag"&&i.dimensionType==="3D"?"3DPoint":i.pointType==="PlaneTag"?"Plane":"2DPoint")();i.stickType=s}if(i.contentType==="VRLink"||i.contentType==="PanoLink"||i.contentType==="Link"){const s=i;!((e=(t=s.data)==null?void 0:t.icon)!=null&&e.url)&&!((o=(n=s.style)==null?void 0:n.point)!=null&&o.url)&&(s.data.icon={url:"//vrlab-static.ljcdn.com/release/web/test.09dee741.png",steps:28})}return i}const Tv=new _l.GLTFLoader;function zv(i){return new Promise((t,e)=>{function n(s){t(s)}function o(s){e(s)}Tv.load(i,n,void 0,o)})}const El="2.0.10",$i=`DnalogelPlugin-PanoTagPlugin@${El}`,Bv=!1,jv=i=>`${$i}--${i}`;class Il extends Sv{constructor(e,n){super(e);m(this,"version",El);m(this,"state",{enabled:!0,visible:!0});m(this,"params");m(this,"debug");m(this,"css3DRenderPlugin");m(this,"TagContainerSvelte");m(this,"temporaryState",{visible:!0});m(this,"mediaStore",ao({currentMediaElement:null}));m(this,"group",new Q.Group);m(this,"gltfObjectGroup",new Q.Group);m(this,"isIOSWX",navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1&&navigator.userAgent.toLowerCase().indexOf("iphone")!==-1);m(this,"store",{disposers:[],disposed:!1,resizeObserverDisposerAdding:!1,css3DRenderDisposer:new Map});m(this,"enabledModelTagSet",new Set);m(this,"changeTagModel",(e,n)=>N(this,null,function*(){e.data=mt.default({},e.data,n),yield this.loadModel(e),this.updateRenderAllTags()}));m(this,"disposedErrorLog",()=>{console.error(`${$i} is disposed`)});m(this,"handleFiveInitAnimationEnded",()=>{const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{Re(n)&&e==="Panorama"&&this.changeTagMode(n,"front"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags(),this.updateRenderAllTags()});m(this,"handleFiveModelShownFloorChange",()=>{this.tags.forEach(e=>{!Re(e)||(e.state.visible=this.getVisible(e))}),this.updateRenderAllTags()});m(this,"loadModel",e=>N(this,null,function*(){var l;const n=e.data.modelUrl;if(!n)return;const o=zv(n).then(c=>Object.assign(c.scene,{customID:e.id,isTagModel:!0}));e.model={promise:o};const s=yield o;if(((l=e.model)==null?void 0:l.promise)!==o||(e.model.object=s,!this.tags.includes(e)))return;s.visible=e.state.visible,new Q.Matrix4().fromArray(e.matrix).decompose(s.position,s.quaternion,s.scale),s.updateWorldMatrix(!0,!0),this.getVisibleByFloorIndex(e)||(s.visible=!1);const a=this.gltfObjectGroup.children.find(c=>c.customID===e.id);return a&&this.gltfObjectGroup.remove(a),this.gltfObjectGroup.add(s),this.updateTagCss3DObjectMatrix(e,s),s}));this.group.name="PanoTagPluginModelGroup",this.gltfObjectGroup.name="PanoTagPluginGLTFObjectGroup",this.group.add(this.gltfObjectGroup),this.params=H({debug:!1,config:this.config},n),this.debug=this.params.debug,this.config=this.params.config,Gr(1,{namespace:oi.GetAudioDuration}),Gr(1,{namespace:oi.PlayAudio}),Object.assign(window,{[`__PANOTAGPLUGIN_DEBUG_${Date.now()}__`]:this}),Object.assign(window,{__PANOTAGPLUGIN_DEBUG__:this}),this.state.enabled&&this.five.scene.add(this.group)}load(e,n){return N(this,null,function*(){var s,r;this.clearTags(),console.info($i," load:",{data:JSON.parse(JSON.stringify(e))}),this.config=mt.default({},this.config,{globalConfig:(s=e.globalConfig)!=null?s:{},contentTypeConfig:(r=e.contentTypeConfig)!=null?r:{}});const o=yield this.addTag(e.tagList,n);if(this.debug)try{vp(this.five,this.tags)}catch(a){console.error(a)}return o})}addTag(e,n){return N(this,null,function*(){const s=(Array.isArray(e)?e:[e]).map(r=>{const a=this.getTagConfig(r),l=me(H({},r),{state:H({visible:void 0,unfolded:Bv},a.initialState),hooks:new Ce.Subscribe,clickable:a.clickable,mergedConfig:a});return Re(r)&&(l.temporaryState={visible:!1}),l}).filter(r=>r.position);return s.forEach(Mv),this.tags.push(...s),wp(this.five).then(()=>{var r,a,l;return this.store.eventListenerDisposer&&((a=(r=this.store).eventListenerDisposer)==null||a.call(r)),this.state.enabled&&(this.store.eventListenerDisposer=this.addEventListener()),this.addResizeListener(),this.checkPanelTag(),this.setVisibleAndUnfolded({withAnimation:(l=n==null?void 0:n.withAnimation)!=null?l:!0}).then(()=>this.updateRenderAllTags()),this.updateRenderAllTags(),this.addMediaModelTag(s)})})}changeConfig(e,n=!0){n?this.config=mt.default({},this.config,e):this.config=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeGlobalConfig(e,n=!0){n?this.config.globalConfig=mt.default({},this.config.globalConfig,e):this.config.globalConfig=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}clearTags(){this.tags=[],this.enabledModelTagSet.clear(),this.clearCache(),this.disposeAllCSS3DContainer(),this.updateRenderAllTags()}show(e){return N(this,null,function*(){const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({visible:!0},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("show",{userAction:n,withAnimation:o})})}hide(e){return N(this,null,function*(){const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({visible:!1},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("hide",{userAction:n,withAnimation:o})})}enable(e){const{userAction:n=!0}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.five.scene.children.includes(this.group)||this.five.scene.add(this.group),this.setState({enabled:!0},{userAction:n}),this.hooks.emit("enable",{userAction:n}),this.five.needsRender=!0}disable(e){const{userAction:n=!0}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({enabled:!1},{userAction:n}),this.five.scene.remove(this.group),this.hooks.emit("disable",{userAction:n}),this.five.needsRender=!0}dispose(){var e,n,o,s,r,a;this.pauseCurrentMedia(),this.disposeAllCSS3DContainer(),(e=this.TagContainerSvelte)==null||e.$destroy(),this.filter3DTag().forEach(l=>{var c;return(c=l.tag3DContentSvelte)==null?void 0:c.svelteApp.$destroy()}),this.tags=[],(n=this.store.disposers)==null||n.forEach(l=>l==null?void 0:l()),this.store.disposers=[],this.store.disposed=!0,(s=(o=this.store).eventListenerDisposer)==null||s.call(o),this.store.eventListenerDisposer=void 0,(a=(r=this.store).resizeObserverDisposer)==null||a.call(r),this.store.resizeObserverDisposer=void 0,this.store.resizeObserverDisposerAdding=!1,this.five.scene.remove(this.group),this.group.remove(...this.group.children),this.gltfObjectGroup.remove(...this.gltfObjectGroup.children),this.clearCache(),this.five.needsRender=!0,this.hooks.emit("dispose")}setState(e,n){if(this.store.disposed)return this.disposedErrorLog();const{userAction:o=!0,visibleWithAnimation:s=!1}=n,r=H({},this.state);this.state=Object.assign(this.state,e),this.store.visibleWithAnimation=s,r.visible!==this.state.visible&&(e.visible?this.handleShow():this.handleHide()),r.enabled!==this.state.enabled&&(e.enabled?this.handleEnable():this.handleDisable()),this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:o})}changeUnfoldedById(e,n){var r;const o=this.getTagById(e);if(!o)return;o.state.unfolded=n;const s=this.filterPointTag();(r=this.TagContainerSvelte)==null||r.$set({tags:s})}changeTagNormalById(e,n){const o=this.getTagById(e);!o||!o.tag3DContentSvelte||(o.tag3DContentSvelte.currentNormal=rt(n),this.updateRenderPlaneTag())}changeDataById(e,n,o=!0){const s=this.getTagById(e);!s||(o?s.data=mt.default({},s.data,n):s.data=H(H({},s.data),n),this.checkPanelTag(),this.updateRenderAllTags())}changeStickTypeById(e,n,o=!0){this.changeTagById(e,n,o)}changeTagById(e,n,o=!0){const s=this.getTagById(e);!n||(o?mt.default(s,n):Object.assign(s,n),(s==null?void 0:s.tag3DContentSvelte)&&(n==null?void 0:n.normal)&&(s.tag3DContentSvelte.currentNormal=rt(n.normal)),this.updateRenderAllTags(),this.checkPanelTag())}destroyTagById(e){(Array.isArray(e)?e:[e]).forEach(o=>{const s=this.tags.findIndex(r=>r.id===o);s!==-1&&this.tags.splice(s,1)}),this.updateRenderAllTags()}pauseCurrentMedia(){this.mediaStore.set({currentMediaElement:null})}updateTagCss3DObjectMatrix(e,n){var v,g,A,y;const o=(A=(g=(v=e.mergedConfig)==null?void 0:v.tag3DConfig)==null?void 0:g.ratio)!=null?A:.00216,s=(y=e.tag3DContentSvelte)==null?void 0:y.domContainer.css3DObject;if(!s)return;const r=Re(e)?e.data.mediaPosition:e.position;n.updateWorldMatrix(!1,!1);const a=n.matrixWorld,l=new Q.Vector3().fromArray(r[0]),c=new Q.Vector3().fromArray(r[2]),u=new Q.Vector3().lerpVectors(l,c,.5).add(new Q.Vector3(0,0,5e-4)),h=new Q.Matrix4().setPosition(u),d=new Q.Matrix4().makeScale(o,o,o),f=new Q.Matrix4().multiply(a).multiply(h).multiply(d);f.decompose(s.position,s.quaternion,s.scale);const p=s.opacityMesh;!p||f.decompose(p.position,p.quaternion,p.scale)}updateTagCss3DObjectVisible(e){var s,r,a,l,c;const n=(s=e.tag3DContentSvelte)==null?void 0:s.domContainer.css3DObject;if(!n)return;n.visible=(a=(r=e.state)==null?void 0:r.visible)!=null?a:!0;const o=n.opacityMesh;!o||(o.visible=(c=(l=e.state)==null?void 0:l.visible)!=null?c:!0)}setVisibleAndUnfolded(){return N(this,arguments,function*({withAnimation:e}={withAnimation:!1}){if(!!this.isPanorama)return this.setVisibleByPanoIndex(),e?new Promise((n,o)=>{setTimeout(()=>{this.setUnfoldedByPanoIndex(),n()},10)}):(this.setUnfoldedByPanoIndex(),Promise.resolve())})}handleShow(){this.state.visible=!0,this.updateTagContainerVisible()}handleHide(){this.pauseCurrentMedia(),this.state.visible=!1,this.updateTagContainerVisible()}handleEnable(){this.state.enabled=!0,this.store.eventListenerDisposer=this.addEventListener(),this.updateRenderAllTags()}handleDisable(){var e,n,o;this.pauseCurrentMedia(),this.state.enabled=!1,(n=(e=this.store).eventListenerDisposer)==null||n.call(e),(o=this.TagContainerSvelte)==null||o.$set({tags:[]}),this.filter3DTag().forEach(s=>{var r;(r=s.tag3DContentSvelte)==null||r.svelteApp.$destroy(),s.tag3DContentSvelte=void 0})}addEventListener(){const{five:e,hooks:n}=this,o=this.handleFiveWantsMoveToPano.bind(this),s=this.handleFiveModeChange.bind(this),r=this.handleFiveCameraUpdate.bind(this),a=this.handleFiveCameraUpdateDebounce(),l=this.handleFivePanoArrived.bind(this),c=this.loadVideoFirstFrame.bind(this),u=this.clickhandler.bind(this),h=this.five.currentMode;return this.handleFiveModeChange(h),this.handleFivePanoArrived(),e.on("wantsMoveToPano",o),e.on("modeChange",s),e.on("initAnimationEnded",this.handleFiveInitAnimationEnded),e.on("modelShownFloorChange",this.handleFiveModelShownFloorChange),e.on("cameraUpdate",r),e.on("cameraUpdate",a),e.on("panoArrived",l),e.on("panoArrived",c),n.on("click",u),()=>{e.off("wantsMoveToPano",o),e.off("modeChange",s),e.off("initAnimationEnded",this.handleFiveInitAnimationEnded),e.off("modelShownFloorChange",this.handleFiveModelShownFloorChange),e.off("cameraUpdate",r),e.off("cameraUpdate",a),e.off("panoArrived",l),e.off("panoArrived",c),n.off("click",u),this.store.eventListenerDisposer=void 0}}loadVideoFirstFrame(){this.isIOSWX&&this.hooks.emit("loadVideoFirstFrame")}addResizeListener(){if(!this.store.resizeObserverDisposer&&!this.store.resizeObserverDisposerAdding){const e=this.addResizeObserver();this.store.resizeObserverDisposerAdding=!0,setTimeout(()=>{this.store.resizeObserverDisposer=e,this.store.resizeObserverDisposerAdding=!1},200)}}addResizeObserver(){if(!this.store.disposed)return;const e=this.five.getElement(),n=()=>{!this.state.enabled||(this.show(),this.updateRenderAllTags())},o=()=>{!this.state.enabled||this.hide()},{observe:s,unobserve:r}=Zs(Pp(()=>{!this.store.resizeObserverDisposer||o()},500),e),{observe:a,unobserve:l}=Zs(Js(()=>n(),400),e);return s(),a(),()=>{r(),l()}}handleFiveModeChange(e){this.tags.forEach(n=>{Re(n)&&e!=="Panorama"&&this.changeTagMode(n,"behind"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags(),this.updateRenderAllTags()}handleFiveWantsMoveToPano(){this.tags.forEach(e=>{const n=this.getTagConfig(e);typeof n.visibleConfig=="object"&&(n.visibleConfig.keep?e.temporaryState=me(H({},e.temporaryState),{visible:n.visibleConfig.keep==="visible"}):e.temporaryState=me(H({},e.temporaryState),{visible:Boolean(n.visibleConfig.alwaysShowWhenMovePano)}))}),this.updateTagContainerVisible()}temporaryShow({withAnimation:e}={withAnimation:!1}){this.store.visibleWithAnimation=e,this.temporaryState.visible=!0,this.updateTagContainerVisible()}temporaryHide({withAnimation:e}={withAnimation:!1}){this.store.visibleWithAnimation=e,this.temporaryState.visible=!1,this.updateTagContainerVisible()}clickhandler(e){if(e.target!=="TagPoint")return;if(!e.tag.state)return console.warn("Clickhandler: params.tag.state is undefined");const n=this.can("fold",e.tag),o=this.can("unfold",e.tag);n&&o&&(e.tag.state.unfolded=!e.tag.state.unfolded,e.tag.state.unfolded&&this.tags.forEach(s=>{s.id!==e.tag.id&&s.state&&this.can("fold",s)&&(s.state.unfolded=!1)}),this.updateRenderAllTags())}updateRenderAllTags(){this.enabledModelTagSet.clear(),this.tags.forEach(e=>e.stickType==="Model"&&this.enabledModelTagSet.add(e.id)),this.updateRenderPointTag(),this.updateRenderPlaneTag(),this.updateRenderModelTag()}updateTagContainerVisible(){var e;(e=this.TagContainerSvelte)==null||e.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation}),this.filter3DTag().forEach(n=>{var o;(o=n.tag3DContentSvelte)==null||o.svelteApp.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation})})}handleFiveCameraUpdateDebounce(){return Js(()=>{this.setUnfoldedByCamera(),this.updateRenderAllTags()},100)}handleFiveCameraUpdate(){this.updateRenderPointTag()}handleFivePanoArrived(){return N(this,null,function*(){yield this.setVisibleAndUnfolded(),this.setModelMedialVisibleByPanoIndex(),this.tags.forEach(e=>{e.temporaryState=me(H({},e.temporaryState),{visible:!0})}),this.store.visibleWithAnimation=!0,this.updateTagContainerVisible()})}setUnfoldedByCamera(){let e=!1;this.tags.forEach(n=>{const o=this.getUnfoldedByCamera(n);!n.state||o!==void 0&&(o===!0&&(e=!0),n.state.unfolded=o)}),e&&this.tags.forEach(n=>{const o=this.getTagConfig(n).unfoldedConfig;typeof o=="object"&&(o.autoUnfold||o.keep)||n.state&&(n.state.unfolded=!1)})}updateRenderPointTag(){var n;const e=this.sort(this.filterPointTag());if(this.setPointTagPosition(),this.TagContainerSvelte)this.TagContainerSvelte.$set({tags:e,state:this.state,temporaryState:this.temporaryState});else{const o=(n=this.five.getElement())==null?void 0:n.parentElement;if(!o)return console.error("updateRenderPlaneTag: tag2DContainer not found");this.TagContainerSvelte=new xv({target:o,props:{hooks:this.hooks,tags:e,state:this.state,temporaryState:this.temporaryState,mediaStore:this.mediaStore}})}}updateRenderPlaneTag(){this.sort([...this.filterPlaneTag(),...this.filter3DPointTag(),...this.filterModelTag()]).forEach(n=>{var l,c,u;if(n.tag3DContentSvelte){const{svelteApp:h,domContainer:d,initialNormal:f,currentNormal:p}=n.tag3DContentSvelte;if(this.updateTagCss3DObjectVisible(n),h.$set({tag:n,hooks:this.hooks,state:this.state,temporaryState:this.temporaryState}),!f.equals(p)){const v=new Q.Quaternion().setFromUnitVectors(f,p);d.css3DObject.setRotationFromQuaternion(v)}return}if(((l=n.state)==null?void 0:l.visible)===!1)return;if(this.css3DRenderPlugin||(this.css3DRenderPlugin=qt(this.five)),n.stickType==="3DPoint"&&!n.normal)return console.error("updateRenderPlaneTag: \u4E09\u7EF4\u70B9\u6807\u7B7E\u7F3A\u5C11\u6CD5\u5411\u91CF\uFF01");const o=(()=>n.stickType==="Plane"?n.position:Re(n)?n.data.mediaPosition:Cp(this.five.camera.position,rt(n.position),rt(n.normal)))();if(!o)return;const s=function(){if(n.normal)return rt(n.normal);if(n.stickType==="Plane")return Ji(n.position);if(n.contentType==="MediaModel")return Ji(o)}();if(!s)return;const r=this.getTagConfig(n).tag3DConfig,a=this.css3DRenderPlugin.create3DDomContainer(o,r);!a||(this.updateTagCss3DObjectVisible(n),this.store.css3DRenderDisposer.set(n.id,a.dispose),n.tag3DContentSvelte={svelteApp:new Pl({target:a.container,props:{tag:n,hooks:this.hooks,state:n.contentType==="MediaModel"?me(H({},this.state),{visible:!1}):this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}}),domContainer:a,initialNormal:s,currentNormal:s},Re(n)&&((c=n.model)==null?void 0:c.object)&&this.updateTagCss3DObjectMatrix(n,(u=n.model)==null?void 0:u.object))}),this.checkPanelTag()}updateRenderModelTag(){const e=o=>!this.enabledModelTagSet.has(o.customID);this.gltfObjectGroup.remove(...this.gltfObjectGroup.children.filter(e)),this.tags.filter(Re).forEach(o=>{var s;(s=o.model)==null||s.promise.then(r=>{r.visible=o.state.visible})})}disposeAllCSS3DContainer(){for(const[e,n]of this.store.css3DRenderDisposer)n==null||n();this.store.css3DRenderDisposer=new Map}checkPanelTag(){this.filter2DPointTag().forEach(e=>{var n;(n=e.tag3DContentSvelte)==null||n.domContainer.dispose(),e.tag3DContentSvelte=void 0});for(const[e,n]of this.store.css3DRenderDisposer){const o=this.getTagById(e);(!o||o.stickType==="2DPoint")&&(n==null||n(),this.store.css3DRenderDisposer.delete(e))}}addMediaModelTag(e){return N(this,null,function*(){const n=e.filter(Re).map(this.loadModel);yield Promise.all(n),this.five.getCurrentState().mode==="Panorama"&&this.setModelMedialVisibleByPanoIndex(),this.updateRenderAllTags()})}changeTagMode(e,n){var o,s,r,a,l;((r=(s=(o=e.tag3DContentSvelte)==null?void 0:o.domContainer)==null?void 0:s.css3DObject)==null?void 0:r.mode)!==n&&((a=e.config)!=null&&a.tag3DConfig?e.config.tag3DConfig.mode=n:e.config?e.config.tag3DConfig={mode:n}:e.config={tag3DConfig:{mode:n}},(l=this.store.css3DRenderDisposer.get(e.id))==null||l(),e.tag3DContentSvelte=void 0)}}const Vv=(i,t)=>new Il(i,t);function ve(i,t){this._camera=i||null,this._domElement=t||document,this._raycaster=new E.Raycaster,this._selected=null,this._boundObjs={};var e=this;this._$onClick=function(){e._onClick.apply(e,arguments)},this._$onDblClick=function(){e._onDblClick.apply(e,arguments)},this._$onMouseMove=function(){e._onMouseMove.apply(e,arguments)},this._$onMouseDown=function(){e._onMouseDown.apply(e,arguments)},this._$onMouseUp=function(){e._onMouseUp.apply(e,arguments)},this._$onTouchMove=function(){e._onTouchMove.apply(e,arguments)},this._$onTouchStart=function(){e._onTouchStart.apply(e,arguments)},this._$onTouchEnd=function(){e._onTouchEnd.apply(e,arguments)},this._$onContextmenu=function(){e._onContextmenu.apply(e,arguments)},this._domElement.addEventListener("click",this._$onClick,!1),this._domElement.addEventListener("dblclick",this._$onDblClick,!1),this._domElement.addEventListener("mousemove",this._$onMouseMove,!1),this._domElement.addEventListener("mousedown",this._$onMouseDown,!1),this._domElement.addEventListener("mouseup",this._$onMouseUp,!1),this._domElement.addEventListener("touchmove",this._$onTouchMove,!1),this._domElement.addEventListener("touchstart",this._$onTouchStart,!1),this._domElement.addEventListener("touchend",this._$onTouchEnd,!1),this._domElement.addEventListener("contextmenu",this._$onContextmenu,!1)}ve.prototype.destroy=function(){this._domElement.removeEventListener("click",this._$onClick,!1),this._domElement.removeEventListener("dblclick",this._$onDblClick,!1),this._domElement.removeEventListener("mousemove",this._$onMouseMove,!1),this._domElement.removeEventListener("mousedown",this._$onMouseDown,!1),this._domElement.removeEventListener("mouseup",this._$onMouseUp,!1),this._domElement.removeEventListener("touchmove",this._$onTouchMove,!1),this._domElement.removeEventListener("touchstart",this._$onTouchStart,!1),this._domElement.removeEventListener("touchend",this._$onTouchEnd,!1),this._domElement.removeEventListener("contextmenu",this._$onContextmenu,!1)};ve.eventNames=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu","touchstart","touchend"];ve.prototype._getRelativeMouseXY=function(i){var t=i.target||i.srcElement;t.nodeType===3&&(t=t.parentNode);var e={x:0,y:0},n=t,o=getComputedStyle(n,null);e.y+=parseInt(o.getPropertyValue("padding-top"),10),e.x+=parseInt(o.getPropertyValue("padding-left"),10);do e.x+=n.offsetLeft,e.y+=n.offsetTop,o=getComputedStyle(n,null),e.x+=parseInt(o.getPropertyValue("border-left-width"),10),e.y+=parseInt(o.getPropertyValue("border-top-width"),10);while(n=n.offsetParent);var s={width:t===window?window.innerWidth:t.offsetWidth,height:t===window?window.innerHeight:t.offsetHeight};return{x:Number((i.pageX-e.x)/s.width)*2-1,y:-((i.pageY-e.y)/s.height)*2+1}};ve.prototype._objectCtxInit=function(i){i._3xDomEvent={}};ve.prototype._objectCtxDeinit=function(i){delete i._3xDomEvent};ve.prototype._objectCtxIsInit=function(i){return!!i._3xDomEvent};ve.prototype._objectCtxGet=function(i){return i._3xDomEvent};ve.prototype.camera=function(i){return i&&(this._camera=i),this._camera};ve.prototype.bind=function(i,t,e,n){console.assert(ve.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]),o[t+"Handlers"].push({callback:e,useCapture:n}),this._boundObjs[t]===void 0&&(this._boundObjs[t]=[]),this._boundObjs[t].push(i)};ve.prototype.addEventListener=ve.prototype.bind;ve.prototype.unbind=function(i,t,e,n){console.assert(ve.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]);for(var s=o[t+"Handlers"],r=0;r<s.length;r++){var a=s[r];if(e==a.callback&&n==a.useCapture){s.splice(r,1);break}}var l=this._boundObjs[t].indexOf(i);this._boundObjs[t].splice(l,1)};ve.prototype.removeEventListener=ve.prototype.unbind;ve.prototype._bound=function(i,t){var e=this._objectCtxGet(t);return e?!!e[i+"Handlers"]:!1};ve.prototype._onMove=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new E.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o),a=this._selected;if(r.length>0){var l,c,u,h=r[0],d=h.object;this._selected=d,u=this._bound("mousemove",d),a!=d&&(l=this._bound("mouseover",d),c=a&&this._bound("mouseout",a))}else c=a&&this._bound("mouseout",a),this._selected=null;u&&this._notify("mousemove",d,n,h),l&&this._notify("mouseover",d,n,h),c&&this._notify("mouseout",a,n,h)}};ve.prototype._onEvent=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new E.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o,!0);if(r.length!==0){for(var a=r[0],l=a.object,c=this._objectCtxGet(l),u=l.parent;typeof c=="undefined"&&u;)c=this._objectCtxGet(u),u=u.parent;!c||this._notify(i,l,n,a)}}};ve.prototype._notify=function(i,t,e,n){var o=this._objectCtxGet(t),s=o?o[i+"Handlers"]:null;if(!o||!s||s.length===0){t.parent&&this._notify(i,t.parent,e,n);return}for(var s=o[i+"Handlers"],r=0;r<s.length;r++){var a=s[r],l=!0;a.callback({type:i,target:t,origDomEvent:e,intersect:n,stopPropagation:function(){l=!1}}),!!l&&a.useCapture===!1&&t.parent&&this._notify(i,t.parent,e,n)}};ve.prototype._onMouseDown=function(i){return this._onMouseEvent("mousedown",i)};ve.prototype._onMouseUp=function(i){return this._onMouseEvent("mouseup",i)};ve.prototype._onMouseEvent=function(i,t){var e=this._getRelativeMouseXY(t);this._onEvent(i,e.x,e.y,t)};ve.prototype._onMouseMove=function(i){var t=this._getRelativeMouseXY(i);this._onMove("mousemove",t.x,t.y,i),this._onMove("mouseover",t.x,t.y,i),this._onMove("mouseout",t.x,t.y,i)};ve.prototype._onClick=function(i){this._onMouseEvent("click",i)};ve.prototype._onDblClick=function(i){this._onMouseEvent("dblclick",i)};ve.prototype._onContextmenu=function(i){this._onMouseEvent("contextmenu",i)};ve.prototype._onTouchStart=function(i){return this._onTouchEvent("touchstart",i)};ve.prototype._onTouchEnd=function(i){return this._onTouchEvent("touchend",i)};ve.prototype._onTouchMove=function(i){if(i.touches.length==1){i.preventDefault();var t=Number(i.touches[0].pageX/window.innerWidth)*2-1,e=-(i.touches[0].pageY/window.innerHeight)*2+1;this._onMove("mousemove",t,e,i),this._onMove("mouseover",t,e,i),this._onMove("mouseout",t,e,i)}};ve.prototype._onTouchEvent=function(i,t){if(t.touches.length==1){t.preventDefault();var e=Number(t.touches[0].pageX/window.innerWidth)*2-1,n=-(t.touches[0].pageY/window.innerHeight)*2+1;this._onEvent(i,e,n,t)}};function kl(i){const t=new E.Box3,e=new E.Vector3;if(i.traverse(n=>{var s;if(n.name==="shadow")return;const o=n.geometry;if(o!==void 0)if((s=o==null?void 0:o.attributes)!=null&&s.position){const r=o.attributes.position;for(let a=0,l=r.count;a<l;a++)e.fromBufferAttribute(r,a).applyMatrix4(n.matrix),t.expandByPoint(e)}else o.vertices.forEach(r=>{const a=r.clone().applyMatrix4(n.matrix);t.expandByPoint(a)})}),!t.isEmpty())return t}class Pn{constructor(t,e){m(this,"originObject3D");m(this,"hooks");m(this,"disposers",[]);m(this,"helperObject3D");m(this,"camera");m(this,"model");m(this,"scene");m(this,"container");m(this,"domEvents");m(this,"isDragging",!1);m(this,"enabled",!1);m(this,"name","BaseController");m(this,"boundingBox");m(this,"offset");m(this,"onRender");m(this,"onWantsTapGesture",t=>{if(this.getIntersectObject(t))return!1});var c,u;this.hooks=(c=t.sharedHooks)!=null?c:new Zt,this.camera=t.camera,this.model=t.model,this.originObject3D=t.originObject3D,this.helperObject3D=t.helperObject3D,this.container=t.container,this.scene=t.scene,this.domEvents=new ve(t.camera,t.container),this.onRender=(u=t.onRender)!=null?u:()=>{},this.offset=e==null?void 0:e.offset,this.initialHelperPosition(),this.initialHelperQuaternion(),this.enable();const n=(...h)=>this.onSetOriginObjectScale(...h),o=(...h)=>this.onSetOriginObjectRotate(...h),s=(...h)=>this.onSetOriginObjectPosition(...h),r=(...h)=>this.onApplyOriginObjectScale(...h),a=(...h)=>this.onApplyOriginObjectRotate(...h),l=(...h)=>this.onApplyOriginObjectPosition(...h);this.hooks.on("setObjectScale",n),this.hooks.on("setObjectRotate",o),this.hooks.on("setObjectPosition",s),this.hooks.on("applyObjectPosition",l),this.hooks.on("applyObjectRotate",a),this.hooks.on("applyObjectScale",r),this.disposers.push(()=>{this.hooks.off("setObjectScale",n),this.hooks.off("setObjectRotate",o),this.hooks.off("setObjectPosition",s),this.hooks.off("applyObjectPosition",l),this.hooks.off("applyObjectRotate",a),this.hooks.off("applyObjectScale",r)})}initialHelperPosition(){this.helperObject3D.position.add(this.calculateOffset(this.offset)),this.helperObject3D.initialPosition()}initialHelperQuaternion(){this.helperObject3D.initQuaternion()}enable(){this.enabled||(this.enabled=!0,this.scene.add(this.helperObject3D),this.helperObject3D.enable(),this.render())}disable(){!this.enabled||(this.enabled=!1,this.helperObject3D.disable(),this.render())}show(){this.helperObject3D.show(),this.render()}hide(){this.helperObject3D.hide(),this.render()}dispose(){var t;(t=this.disposers)==null||t.forEach(e=>e==null?void 0:e()),this.helperObject3D.dispose(),this.render()}applyHelperMatrix4(t){this.helperObject3D.applyMatrix4(t)}applyHelperQuaternion(t,e){this.helperObject3D.applyHelperQuaternion(t,e)}applyHelperScaleMatrix4(t,e){this.helperObject3D.applyHelperScaleMatrix4(t,e)}onWantsGesture(t,e,n){if(this.isDragging)return!1}onIntersectionOnModelUpdate(t){}onApplyOriginObjectScale(t){this.applyHelperScaleMatrix4(t.matrix4,t.origin)}onApplyOriginObjectRotate(t){this.applyHelperQuaternion(t.quaternion,t.origin)}onApplyOriginObjectPosition(t){this.applyHelperMatrix4(t.matrix4)}onSetOriginObjectScale(t){this.helperObject3D.scale.copy(t),this.updateOffsetByScale(t)}onSetOriginObjectRotate(t,e){this.helperObject3D.quaternion.copy(t)}onSetOriginObjectPosition(t){this.helperObject3D.position.copy(t.clone().add(this.calculateOffset(this.offset)))}render(){this.onRender()}updateOffsetByScale(t){if(this.boundingBox&&this.offset){const e=this.originObject3D.position,n=new E.Vector3().subVectors(this.boundingBox.max,e).multiply(t).add(e),o=new E.Vector3().subVectors(this.boundingBox.min,e).multiply(t).add(e),s=this.calculateOffset(this.offset,{min:o,max:n});this.helperObject3D.position.copy(s),this.helperObject3D.initialPosition()}}hoverListener(t,e=16777215,n=1){const o=(Array.isArray(t)?t:[t]).filter(Ye),s=[];for(const r of o)if(r instanceof E.Mesh||r instanceof E.Group){const a=r instanceof E.Group?r.children.filter(d=>d instanceof E.Mesh):[r];a.forEach(d=>{d.__originalColor__=d.material.color.clone(),d.__originalOpacity__=d.material.opacity});const l=()=>{a.forEach(d=>{d.material.color.set(e),d.material.opacity=n}),this.render()},c=()=>{a.forEach(d=>{d.material.color.copy(d.__originalColor__),d.material.opacity=d.__originalOpacity__}),this.render()},u=()=>{this.isDragging||l()},h=()=>{this.isDragging||c()};for(const d of a)this.domEvents.addEventListener(d,"mouseover",u),this.domEvents.addEventListener(d,"mouseout",h),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",c),this.hooks.on("rotateEnd",c),s.push(()=>{this.domEvents.removeEventListener(d,"mouseover",u),this.domEvents.removeEventListener(d,"mouseout",h),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",c),this.hooks.off("rotateEnd",c)})}return()=>s.forEach(r=>r==null?void 0:r())}getIntersectObject(t){const e=this.camera.position,n=this.helperObject3D;if(!n)return;const o=this.helperObject3D.raycasterIntersectObject(t)[0];if(!o)return;const s=o;if(s.object=n,this.model.intersectRaycaster){const r=this.model.intersectRaycaster(t)[0];if(r&&r.point.distanceTo(e)<s.point.distanceTo(e))return}return s.object}calculateOffset(t,e){const n=this.originObject3D,o=new E.Vector3(0,0,0);if(!t)return o;const s=()=>e||(this.boundingBox?this.boundingBox:(this.boundingBox=kl(n),this.boundingBox));if(typeof t.x=="number")o.setX(t.x);else if(typeof t.x=="object"){const r=s();o.setX((r.max.x-r.min.x)*t.x.percents)}if(typeof t.y=="number")o.setY(t.y);else if(typeof t.y=="object"){const r=s();o.setY((r.max.y-r.min.y)*t.y.percents)}if(typeof t.z=="number")o.setZ(t.z);else if(typeof t.z=="object"){const r=s();o.setZ((r.max.z-r.min.z)*t.z.percents)}return o}}class Rv extends Pn{constructor(...e){super(...e);m(this,"name","ScaleController")}setScale(e){var l,c,u;let n=1,o=1,s=1;typeof e=="number"?(n=e,o=e,s=e):typeof e=="object"&&(n=(l=e.x)!=null?l:1,o=(c=e.y)!=null?c:1,s=(u=e.z)!=null?u:1);const r=new E.Vector3(n,o,s);this.hooks.emit("wantToScale",r)||(this.originObject3D.scale.copy(r),this.hooks.emit("setObjectScale",r),this.hooks.emit("scale",r),this.render())}}class Qv extends Q.Object3D{constructor(){super()}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}}class gi extends Qv{constructor(e,n){var o;super();m(this,"originObject3D");m(this,"onRender");this.originObject3D=e,this.onRender=(o=n==null?void 0:n.onRender)!=null?o:()=>{}}get helperObject(){return this}render(){this.onRender()}enable(){this.parent.children.includes(this)||this.parent.add(this)}disable(){this.removeFromParent()}show(){this.visible=!0,this.render()}hide(){this.visible=!1,this.render()}raycasterIntersectObject(e,n=[]){return e.intersectObject(this,!0,n)}initialPosition(){this.position.add(this.originObject3D.position)}initQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}applyHelperScaleMatrix4(e,n){this.scale.applyMatrix4(e)}setHelperQuaternion(e,n){if(n){const o=new Q.Vector3().subVectors(this.position,n).applyQuaternion(e).add(n);this.position.copy(o)}this.quaternion.copy(e)}applyHelperQuaternion(e,n){if(n){const o=new Q.Vector3().subVectors(this.position,n).applyQuaternion(e).add(n);this.position.copy(o)}this.applyQuaternion(e)}dispose(){this.removeFromParent()}}class Ov extends gi{}class Hv extends gi{}class Fv extends gi{}class xl extends gi{}class Gv extends xl{}class Wv extends E.Group{constructor(e){super();m(this,"direction");this.direction=e||"x"}}class na extends E.Mesh{constructor(e,n,o){super(e,n);m(this,"direction");this.direction=o||"x"}}function Nv(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return Object.assign(new E.Vector2,{x:(i.x-s)/e*2-1,y:-(i.y-o)/n*2+1})}function yo(i,t,e){if(!t||!e||!i)return;const n=Nv(t,e);if(Math.abs(n.x)===1||Math.abs(n.y)===1)return;const o=new E.Raycaster;return o.setFromCamera(n,i),o}function _v(i,t){return!(Math.abs(i.x-t.x)>1e-5||Math.abs(i.y-t.y)>1e-5||Math.abs(i.z-t.z)>1e-5)}class Bi extends Wv{constructor(e){var u;super(e.direction);m(this,"line");m(this,"arrow");m(this,"lineHeight",.4);m(this,"arrowHeight",.1);this.name="ArrowGroup";const n=new E.Color((u=e.color)!=null?u:16214315),o=new E.MeshBasicMaterial({color:n,depthTest:!1,opacity:1,transparent:!0,side:E.DoubleSide}),s=new E.ConeGeometry(.04,.1,32),r=new na(s,o.clone(),e.direction);r.name=`arrow-${e.direction}`,this.arrow=r;const a=.004,l=new E.CylinderGeometry(a,a,.4,32),c=new na(l,o.clone(),e.direction);c.name=`line-${e.direction}`,this.line=c,this.formatArrow(),this.formatLine(),this.add(this.arrow,this.line)}formatArrow(){this.arrow.geometry.translate(0,this.lineHeight+this.arrowHeight/2,0),this.direction==="x"?(this.arrow.geometry.rotateX(Math.PI/2),this.arrow.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.arrow.geometry.rotateX(Math.PI/2)}formatLine(){this.line.geometry.translate(0,this.lineHeight/2,0),this.direction==="x"?(this.line.geometry.rotateX(Math.PI/2),this.line.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.line.geometry.rotateX(Math.PI/2)}}const ji={X:15618642,Y:4765519,Z:4227839};class st{static get X(){return new E.Color(ji.X).convertSRGBToLinear().clone()}static get Y(){return new E.Color(ji.Y).convertSRGBToLinear().clone()}static get Z(){return new E.Color(ji.Z).convertSRGBToLinear().clone()}}class Xv extends Ov{constructor(e){super(e);m(this,"xArrow",new Bi({direction:"x",color:st.X}));m(this,"yArrow",new Bi({direction:"y",color:st.Y}));m(this,"zArrow",new Bi({direction:"z",color:st.Z}));this.add(this.xArrow),this.add(this.yArrow),this.add(this.zArrow)}show(){super.show(),this.xArrow.visible=!0,this.yArrow.visible=!0,this.zArrow.visible=!0}showDraggingHelper(e){this.xArrow.visible=e.includes("x"),this.yArrow.visible=e.includes("y"),this.zArrow.visible=e.includes("z")}dispose(){this.remove(this.xArrow,this.yArrow,this.zArrow)}}function Mt(i,t){return Yv(document.createElement(t!=null?t:"div"),i)}function Yv(i,t){if(!t)return i;for(const e in t)e&&t[e]&&(i.style[e]=t[e]);return i}function Uv(i){const t=Mt(H({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},i)),e=()=>{t.style.display!=="block"&&(!t.style.top||!t.style.left||(t.style.display="block"))};return{element:t,show:e,hide:()=>{t.style.display="none",t.style.top="",t.style.left=""},setLeftTop:(s,r)=>{t.style.left=s,t.style.top=r,e()}}}class Jv extends Fv{constructor(e,n){var o;super(e);m(this,"yzCircle");m(this,"xzCircle");m(this,"xyCircle");m(this,"xRingHelper");m(this,"yRingHelper");m(this,"zRingHelper");m(this,"xAngleHelper");m(this,"yAngleHelper");m(this,"zAngleHelper");m(this,"angleTips");m(this,"container");(n==null?void 0:n.yzCircleEnable)!==!1&&(this.yzCircle=new Vi({direction:"x",color:st.X}),this.xRingHelper=new Ri({direction:"x"}),this.xAngleHelper=new Qi({direction:"x",color:st.X})),(n==null?void 0:n.xzCircleEnable)!==!1&&(this.xzCircle=new Vi({direction:"y",color:st.Y}),this.yRingHelper=new Ri({direction:"y"}),this.yAngleHelper=new Qi({direction:"y",color:st.Y})),(n==null?void 0:n.xyCircleEnable)!==!1&&(this.xyCircle=new Vi({direction:"z",color:st.Z}),this.zRingHelper=new Ri({direction:"z"}),this.zAngleHelper=new Qi({direction:"z",color:st.Z})),n!=null&&n.container&&(this.container=n==null?void 0:n.container,this.angleTips=Uv({display:"none"}),(o=this.container)==null||o.appendChild(this.angleTips.element)),this.show()}updateAngleHelperQuaternion(){var e,n,o,s,r,a,l,c,u,h,d,f;(n=this.xAngleHelper)==null||n.quaternion.copy((e=this.yzCircle)==null?void 0:e.quaternion),(s=this.yAngleHelper)==null||s.quaternion.copy((o=this.xzCircle)==null?void 0:o.quaternion),(a=this.zAngleHelper)==null||a.quaternion.copy((r=this.xyCircle)==null?void 0:r.quaternion),(c=this.xRingHelper)==null||c.quaternion.copy((l=this.yzCircle)==null?void 0:l.quaternion),(h=this.yRingHelper)==null||h.quaternion.copy((u=this.xzCircle)==null?void 0:u.quaternion),(f=this.zRingHelper)==null||f.quaternion.copy((d=this.xyCircle)==null?void 0:d.quaternion)}applyHelperQuaternion(e,n){var o,s,r,a,l,c;(o=this.yzCircle)==null||o.applyQuaternion(e),(s=this.xzCircle)==null||s.applyQuaternion(e),(r=this.xyCircle)==null||r.applyQuaternion(e),(a=this.xAngleHelper)==null||a.baseAxes.applyQuaternion(e),(l=this.yAngleHelper)==null||l.baseAxes.applyQuaternion(e),(c=this.zAngleHelper)==null||c.baseAxes.applyQuaternion(e)}hide(){this.remove(this.yzCircle,this.xzCircle,this.xyCircle,this.xRingHelper,this.yRingHelper,this.zRingHelper,this.xAngleHelper,this.yAngleHelper,this.zAngleHelper)}show(){var e;this.add(...[this.xyCircle,this.xzCircle,this.yzCircle].filter(Boolean)),this.remove(...[this.xRingHelper,this.yRingHelper,this.zRingHelper,this.xAngleHelper,this.yAngleHelper,this.zAngleHelper].filter(Boolean)),(e=this.angleTips)==null||e.hide()}showDraggingHelper(e){var n;this.hide(),this.add(...this.filterRingHelper(e)),this.add(...this.filterAngleHelper(e)),(n=this.angleTips)==null||n.show()}dispose(){var e,n;this.remove(...[this.yzCircle,this.xzCircle,this.xyCircle,this.xRingHelper,this.yRingHelper,this.zRingHelper,this.xAngleHelper,this.yAngleHelper,this.zAngleHelper].filter(Boolean)),(n=(e=this.angleTips)==null?void 0:e.element)==null||n.remove()}filterRingHelper(e){return[this.xRingHelper,this.yRingHelper,this.zRingHelper].filter(n=>e.includes(n==null?void 0:n.direction)).filter(Boolean)}filterAngleHelper(e){return[this.xAngleHelper,this.yAngleHelper,this.zAngleHelper].filter(n=>e.includes(n==null?void 0:n.direction)).filter(Boolean)}}class Vi extends E.Mesh{constructor(e){var n;super();m(this,"direction");m(this,"gapAngle",.02);m(this,"geometry",new E.RingGeometry(.25,.3,20,8,this.gapAngle,Math.PI/2-this.gapAngle*2));this.material=new E.MeshBasicMaterial({opacity:.6,color:(n=e.color)!=null?n:16777215,transparent:!0,side:E.DoubleSide,depthTest:!1}),this.direction=e.direction,this.geometry.name=`RotateHelperCircleGeometry-${this.direction}`,this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}class Ri extends E.Group{constructor(e){super();m(this,"direction");this.direction=e.direction;const n=.015,o=new Array(8).fill(null).map((s,r)=>{const a=new E.RingGeometry(.25,.3,20,8,Math.PI/4*r+n,Math.PI/4-n*2),l=new E.MeshBasicMaterial({opacity:1,color:16777215,depthTest:!1,transparent:!0,side:E.DoubleSide}),c=new E.Mesh(a,l);return c.name=`AxesDashedRing-${this.direction}-${r}`,c});this.add(...o),this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}class Qi extends E.Mesh{constructor(e){var o;super();m(this,"direction");m(this,"baseAxes");switch(e.direction){case"x":this.baseAxes=new E.Vector3(0,0,1);break;case"y":this.baseAxes=new E.Vector3(1,0,0);break;case"z":this.baseAxes=new E.Vector3(1,0,0);break}const n=.3+5e-4;this.geometry=new E.CircleGeometry(n,48,0,1e-4),this.material=new E.MeshBasicMaterial({opacity:.4,color:(o=e.color)!=null?o:16777215,depthTest:!1,transparent:!0,side:E.DoubleSide}),this.direction=e.direction,this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}function Zv(){const i=Mt({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=Mt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=Mt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"absolute",border:"1px solid rgba(255,255,255,0.4)"});i.appendChild(t),t.appendChild(e);const n="-4px",o={direction:"nesw",element:ft({cursor:"nesw-resize",left:n,bottom:n})},s={direction:"ns",element:ft({cursor:"ns-resize",bottom:n})},r={direction:"nwse",element:ft({cursor:"nwse-resize",right:n,bottom:n})},a={direction:"ew",element:ft({cursor:"ew-resize",right:n})},l={direction:"nesw",element:ft({cursor:"nesw-resize",right:n,top:n})},c={direction:"ns",element:ft({cursor:"ns-resize",top:n})},u={direction:"nwse",element:ft({cursor:"nwse-resize",left:n,top:n})},h={direction:"ew",element:ft({cursor:"ew-resize",left:n})};return new Array(s,a,c,h,o,r,l,u).forEach(f=>t.appendChild(f.element)),{container:i,squares:[o,s,r,a,l,c,u,h]}}function ft(i){const t=Mt(H({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},i)),e=Mt({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),n=Mt({width:"15px",height:"15px",cursor:i==null?void 0:i.cursor,pointerEvents:"auto",background:"transparent"});return n.draggable=!0,e.appendChild(n),t.appendChild(e),t}class qv extends Gv{constructor(e,n,o,s){super(e);m(this,"points",[]);m(this,"cornerPositions",[]);m(this,"css3DInstance");m(this,"plane");m(this,"css3DRenderer",new _t);m(this,"camera");m(this,"scene");m(this,"container");m(this,"enabled",!1);this.camera=o,this.scene=s,this.container=n,this.initRectangleScaleHelper()}get helperObject(){var e;if(!((e=this.css3DInstance)!=null&&e.css3DObject))throw new Error("css3DInstance is not initialized");return this.css3DInstance.css3DObject}updatePosition(){var e;this.helperObject.position.copy(this.originObject3D.position),(e=this.plane)==null||e.position.copy(this.originObject3D.position)}updateQuaternion(){var e;(e=this.plane)==null||e.quaternion.copy(this.originObject3D.quaternion)}applyMatrix4(e){var n;super.applyMatrix4(e),this.helperObject.applyMatrix4(e),(n=this.plane)==null||n.applyMatrix4(e),this.cornerPositions.forEach(o=>o.applyMatrix4(e))}showDraggingHelper(){}applyHelperScaleMatrix4(e,n){var o;(o=this.plane)==null||o.scale.applyMatrix4(e),this.helperObject.applyScaleMatrix4(e)}updatePoints(){const e=this.calculatePointPosition(this.cornerPositions);this.points.forEach((n,o)=>{n.position.copy(e[o])})}applyHelperQuaternion(e,n){var s;const o=(s=this.css3DInstance)==null?void 0:s.css3DObject;if(o){const r=new E.Vector3().subVectors(o.position,n).applyQuaternion(e).add(n);o.position.copy(r),o.applyQuaternion(e)}if(this.plane){const r=new E.Vector3().subVectors(this.plane.position,n).applyQuaternion(e).add(n);this.plane.position.copy(r),this.plane.applyQuaternion(e)}this.cornerPositions.forEach(r=>{const a=new E.Vector3().subVectors(r,n).applyQuaternion(e).add(n);r.copy(a)})}enable(){var e;this.enabled||(this.enabled=!0,(e=this.css3DInstance)==null||e.enable(),this.plane&&this.scene.add(this.plane))}disable(){var e;!this.enabled||(this.enabled=!1,(e=this.css3DInstance)==null||e.disable(),this.plane&&this.scene.remove(this.plane))}show(){var e;(e=this.css3DInstance)==null||e.show(),this.plane&&(this.plane.visible=!0)}hide(){var e;(e=this.css3DInstance)==null||e.hide(),this.plane&&(this.plane.visible=!1)}dispose(){this.disable(),this.css3DRenderer.dispose()}initRectangleScaleHelper(){var a;const e=this.getCornerPositions();if(!e)return;this.cornerPositions=e;const n=this.css3DRenderer.create3DElement(this.camera,e,{ratio:.003});if(!n)return;this.css3DInstance=n,n.appendToElement(this.container);const o=n.css3DObject.container,{container:s,squares:r}=Zv();this.points=r.map((l,c)=>({direction:l.direction,point:l.element,position:this.calculatePointPosition(e)[c]})),o.insertBefore(s,(a=o.children[0])!=null?a:null),this.updatePosition()}getCornerPositions(){const{originObject3D:e}=this;if(e.isCSS3DObjectPlus)return e.cornerPoints;console.error("\u5F53\u524D\u7269\u4F53\u6682\u65F6\u4E0D\u652F\u6301 ScaleHelper")}calculatePointPosition(e){return[e[0].clone(),e[0].clone().add(e[1]).divideScalar(2),e[1].clone(),e[1].clone().add(e[2]).divideScalar(2),e[2].clone(),e[2].clone().add(e[3]).divideScalar(2),e[3].clone(),e[3].clone().add(e[0]).divideScalar(2)]}}class Kv extends Hv{constructor(e){super(e);m(this,"box");m(this,"outline");m(this,"originObject");m(this,"positionAttribute");this.originObject=e,this.positionAttribute=new E.BufferAttribute(new Float32Array(8*3),3),this.box=this.createBox(),this.outline=this.createOutline(),this.add(this.box,this.outline),this.update()}raycasterIntersectObject(e,n){return e.intersectObject(this,!1,n)}raycast(e,n){this.box.raycast(e,n)}update(){const e=kl(this.originObject);if(!e)return;const{min:n,max:o}=e;this.positionAttribute.setXYZ(0,o.x,o.y,o.z),this.positionAttribute.setXYZ(1,n.x,o.y,o.z),this.positionAttribute.setXYZ(2,n.x,n.y,o.z),this.positionAttribute.setXYZ(3,o.x,n.y,o.z),this.positionAttribute.setXYZ(4,o.x,o.y,n.z),this.positionAttribute.setXYZ(5,n.x,o.y,n.z),this.positionAttribute.setXYZ(6,n.x,n.y,n.z),this.positionAttribute.setXYZ(7,o.x,n.y,n.z),this.positionAttribute.needsUpdate=!0}createOutline(){const e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new E.BufferGeometry;n.setIndex(new E.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const o=new E.LineBasicMaterial({color:64767,linewidth:1,opacity:1,depthTest:!1,transparent:!0,toneMapped:!1}),s=new E.LineSegments(n,o);return s.matrixAutoUpdate=!1,s}createBox(){const e=new Uint16Array([0,1,2,0,2,3,0,3,7,0,7,4,0,4,5,0,5,1,6,1,5,6,2,1,6,5,4,6,4,7,6,3,2,6,7,3]),n=new E.BufferGeometry;n.setIndex(new E.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const o=new E.MeshBasicMaterial({color:64767,opacity:.1,depthTest:!1,transparent:!0});return new E.Mesh(n,o)}}class $v extends Pn{constructor(...e){super(...e);m(this,"name","MoveController");m(this,"startInfo");m(this,"_moveByMouseEnable",!1);m(this,"mouseInfo");m(this,"mousedownEventListenerDisposer");const n=this.helperObject3D;this.hoverListener([n.xArrow,n.yArrow,n.zArrow]);const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r),this.hooks.on("rotateStart",l),this.hooks.on("rotateEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.disposers.push(()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",o),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r),this.hooks.off("rotateStart",l),this.hooks.off("rotateEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}),this.moveByMouseEnable&&this.moveByMouse()}get moveByMouseEnable(){return this._moveByMouseEnable}dispose(){var e;super.dispose(),(e=this.disposers)==null||e.forEach(n=>n==null?void 0:n())}moveByMouse(){this._moveByMouseEnable=!0;const e=this.handleMouseDown.bind(this),n=this.handleMouseUp.bind(this);this.hooks.emit("moveByMouseEnable"),setTimeout(()=>{this.container.addEventListener("mousedown",e),this.container.addEventListener("mouseup",n)}),this.mousedownEventListenerDisposer=()=>{this.container.removeEventListener("mousedown",e),this.container.removeEventListener("mouseup",n)}}disableMoveByMouse(){var e;this._moveByMouseEnable=!1,this.hooks.emit("moveByMouseDisable"),(e=this.mousedownEventListenerDisposer)==null||e.call(this)}onIntersectionOnModelUpdate(e){!this.moveByMouseEnable||this.hooks.emit("wantToMove",e.point)||(this.originObject3D.position.copy(e.point),this.hooks.emit("setObjectPosition",e.point),this.hooks.emit("move",e.point))}onApplyOriginObjectScale(e){}handleMouseDown(e){const{x:n,y:o}=e;this.mouseInfo={x:n,y:o,mouseDownTimestamp:Date.now()}}handleMouseUp(e){if(!this.mouseInfo)return;const{x:n,y:o}=e;this.mouseInfo.x===n&&this.mouseInfo.y===o&&Date.now()-this.mouseInfo.mouseDownTimestamp<500&&(this.disableMoveByMouse(),this.mouseInfo=void 0)}dragStart(e){if(this._moveByMouseEnable||this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();const s=new E.Vector3(1,0,0).applyQuaternion(this.helperObject3D.quaternion),r=new E.Vector3(0,1,0).applyQuaternion(this.helperObject3D.quaternion),a=new E.Vector3(0,0,1).applyQuaternion(this.helperObject3D.quaternion),l=(()=>{switch(o){case"x":return s;case"y":return r;case"z":return a}})(),c=(()=>{switch(o){case"x":case"y":return a;case"z":return s}})(),u=n.point.clone(),h=new E.Plane;h.setFromNormalAndCoplanarPoint(c,u),this.startInfo={startVectorProject:u.clone().projectOnVector(l),directionVector:l,plane:h},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("moveStart"),this.isDragging=!0,console.log("%c MoveController dragStart","color: #e5af2e")}dragging(e){if(!this.isDragging||!this.startInfo)return;const n=yo(this.camera,e,this.container);return n?(console.log("%c MoveController dragging","color: #49de1b"),this.move(n),!1):this.dragEnd()}move(e){if(!this.startInfo)return this.dragEnd();const{plane:n,directionVector:o,startVectorProject:s}=this.startInfo,r=this.originObject3D,a=e.ray.intersectPlane(n,new E.Vector3);if(!a)return;const l=a.clone().projectOnVector(o),c=l.clone().sub(s),u=new E.Matrix4;u.setPosition(c);const h=r.position.clone().applyMatrix4(u);this.hooks.emit("wantToMove",h)||(r.applyMatrix4(u),s.copy(l),this.hooks.emit("applyObjectPosition",{matrix4:u}),this.hooks.emit("move",h))}dragEnd(){!this.isDragging||(console.log("%c MoveController dragEnd","color: #e94e4e"),this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("moveEnd"))}}class cn{constructor(t,e,n,o,s,r){m(this,"helperController");m(this,"five");m(this,"onFiveWantsTapGesture",t=>{if(!this.helperController)return;const e=this.helperController.onWantsTapGesture(t);return this.five.needsRender=!0,e});m(this,"onFiveWantsGesture",(...t)=>{if(!this.helperController)return;const e=this.helperController.onWantsGesture(...t);return this.five.needsRender=!0,e});m(this,"onFiveIntersectionOnModelUpdate",(...t)=>{!this.helperController||this.helperController.onIntersectionOnModelUpdate(...t)});const{camera:a,model:l,scene:c}=t,u=t.getElement();if(this.five=t,!a||!l||!u||!c)return;const h=()=>{t.needsRender=!0};this.helperController=new e({camera:a,model:l,originObject3D:n,helperObject3D:o,container:u,scene:c,onRender:h,sharedHooks:r},s),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsGesture",this.onFiveWantsGesture),t.on("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate)}dispose(){var t;this.five.off("wantsTapGesture",this.onFiveWantsTapGesture),this.five.off("wantsGesture",this.onFiveWantsGesture),this.five.off("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate),(t=this.helperController)==null||t.dispose()}}const eb="v1.0.1",tb="Object3DHelper",wo=`${tb}@${eb}`,nb=()=>{console.error(`${wo} is disposed`)},ib=()=>{console.warn(`${wo} is disabled`)},ob=()=>{console.error(`${wo} is disabled`)};class sb{constructor(t){m(this,"controllers",{});m(this,"state",{visible:!0,enabled:!0,disposed:!1});m(this,"hooks",new Zt);m(this,"eventListener",{});t&&this.addControllers(t),this.setState(this.state)}show(t){return N(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return N(this,null,function*(){this.setState({visible:!1},t)})}enable(t){this.setState({enabled:!0},t)}disable(t){this.setState({enabled:!1},t)}dispose(){this.setState({disposed:!0})}setState(t,e){if(this.state.disposed)return nb();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return ob();const n=H({},this.state);this.state=H(H({},this.state),t),t.disposed!==void 0&&t.disposed!==n.disposed&&t.disposed&&this.handleDispose(),t.visible!==void 0&&this.handleVisible(t.visible),t.enabled!==void 0&&this.handleEnable(t.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:n})}addControllers(t){this.controllers=H(H({},this.controllers),t),this.setState(this.state)}getCurrentState(){return this.state}handleEnable(t,e=!0){t?(this.everyControllerDo(n=>{n.enable()}),this.hooks.emit("enable",{userAction:e})):(this.everyControllerDo(n=>{n.disable()}),this.hooks.emit("disable",{userAction:e})),this.state.enabled=t}handleVisible(t,e=!0){t?(this.everyControllerDo(n=>{n.show()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:e}))):(this.everyControllerDo(n=>{n.hide()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:e}))),this.state.visible=t}everyControllerDo(t){Object.values(this.controllers).forEach(e=>{e&&t(e)})}handleDispose(){var t,e;Object.values(this.controllers).forEach(n=>{n==null||n.dispose()});for(const n in this.controllers){if(!n)continue;const o=n;(e=(t=this.eventListener)[o])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&ib()}}class rb extends Pn{constructor(...e){super(...e);m(this,"name","RotateController");m(this,"startInfo");m(this,"lastRotation");m(this,"rotations",[]);m(this,"helperObject3DQuaternion",this.originObject3D.quaternion.clone());m(this,"removeListener");const n=this.helperObject3D;this.hoverListener([n.xyCircle,n.xzCircle,n.yzCircle]);const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.removeListener=()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",o),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}}get rotateCenter(){return this.helperObject3D.position.clone()}initialHelperQuaternion(){this.helperObject3D.updateAngleHelperQuaternion(),this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion)}setRotateAngle(e){const{x:n=0,y:o=0,z:s=0}=e,r=new E.Euler(Math.PI*n/180,Math.PI*o/180,Math.PI*s/180),a=new E.Quaternion().setFromEuler(r);if(this.hooks.emit("wantToRotate",a))return;const{originObject3D:c,rotateCenter:u}=this;if(u){const h=new E.Vector3().subVectors(c.position,u).applyQuaternion(a).add(u);c.position.copy(h)}c.quaternion.copy(a),this.helperObject3DQuaternion.copy(a),this.hooks.emit("setObjectRotate",a,u),this.hooks.emit("rotate",a),this.render()}dispose(){this.removeListener(),super.dispose()}onApplyOriginObjectScale(e){}dragStart(e){if(this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();this.helperObject3D.updateAngleHelperQuaternion();const s=n.point,r=this.getAngleHelper(o);this.setTipsAngle(0);const a=s.clone();a.y+=.2,this.setTipsPosition(a);const l=new E.Vector3(1,0,0).applyQuaternion(this.helperObject3DQuaternion),c=new E.Vector3(0,1,0).applyQuaternion(this.helperObject3DQuaternion),u=new E.Vector3(0,0,1).applyQuaternion(this.helperObject3DQuaternion),h=(()=>{switch(o){case"x":return l;case"y":return c;case"z":return u}})(),d=new E.Plane().setFromNormalAndCoplanarPoint(h,s),f=new E.Vector3;d.projectPoint(s.clone(),f);const p=f.clone().sub(this.rotateCenter),v=p.clone(),g=p.angleTo(r.baseAxes);this.setAngleHelperStart(o,g),this.setAngleHelperLength(o,0),this.rotations.push({vector:p.clone(),direction:!0}),this.startInfo={direction:o,startVector:p,staticStartVector:v,plane:d,angleHelper:r},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("rotateStart"),this.isDragging=!0,console.log(`%c RotateController dragStart ${o}`,"color: #e5af2e")}dragging(e){var o;if(!this.isDragging)return;const n=yo(this.camera,e,this.container);return n?(console.log(`%c RotateController dragging ${(o=this.startInfo)==null?void 0:o.direction}`,"color: #49de1b"),this.rotate(n),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:n,plane:o,angleHelper:s,staticStartVector:r,direction:a}=this.startInfo,l=e.ray.intersectPlane(o,new E.Vector3);if(!l)return;const c=this.rotateCenter,u=new E.Vector3;o.projectPoint(l.clone(),u);const h=u.clone().sub(c);if(n.angleTo(h)===0||(this.lastRotation===void 0&&(this.lastRotation={angle:0}),this.rotations.length===0))return;const d=(()=>{if(this.rotations.length===1)return h.angleTo(s.baseAxes)>r.angleTo(s.baseAxes);{const A=this.rotations[this.rotations.length-1],y=this.rotations[this.rotations.length-2],w=h.angleTo(y.vector),C=h.angleTo(A.vector),x=A.vector.angleTo(y.vector);if(x===0||C===0||w===0)return;if(w>C&&w>x)return A.direction;if(w<x&&C<x||w<C&&C>x)return!A.direction}})();if(d===void 0)return console.warn("rotationDirection is undefined");const f=new E.Quaternion().setFromUnitVectors(n.clone().normalize(),h.clone().normalize()),{originObject3D:p}=this,v=p.quaternion.clone().premultiply(f);if(!this.hooks.emit("wantToRotate",v)){if(this.rotations.push({vector:h,direction:d}),this.rotations=this.rotations.slice(-2),this.lastRotation.angle=this.lastRotation.angle+h.angleTo(n)*(d?1:-1),this.setAngleHelperLength(a,this.lastRotation.angle),this.setTipsAngle(this.lastRotation.angle/Math.PI*180),c){const A=new E.Vector3().subVectors(p.position,c).applyQuaternion(f).add(c);p.position.copy(A)}p.applyQuaternion(f),this.helperObject3DQuaternion.premultiply(f),this.hooks.emit("applyObjectRotate",{quaternion:f,origin:c}),this.hooks.emit("rotate",p.quaternion),this.startInfo.startVector=h}}dragEnd(){!this.isDragging||(console.log("%c RotateController dragEnd","color: #e94e4e"),this.startInfo=void 0,this.isDragging=!1,this.lastRotation=void 0,this.rotations=[],this.helperObject3D.show(),this.hooks.emit("rotateEnd"))}getAngleHelper(e){switch(e){case"x":return this.helperObject3D.xAngleHelper;case"y":return this.helperObject3D.yAngleHelper;case"z":return this.helperObject3D.zAngleHelper}}setAngleHelperStart(e,n){const o=this.getAngleHelper(e);if(o instanceof E.Mesh&&o.geometry instanceof E.CircleGeometry){const{radius:s,segments:r,thetaLength:a}=o.geometry.parameters;o.geometry=new E.CircleGeometry(s,r,n,a)}else console.warn("only support THREE.CircleGeometry")}setAngleHelperLength(e,n){const s=n>=0?Math.max(n,.001):Math.min(n,-.001),r=this.getAngleHelper(e);if(r instanceof E.Mesh&&r.geometry instanceof E.CircleGeometry){const{radius:a,thetaStart:l}=r.geometry.parameters,c=Math.ceil(Math.abs(s)*(40/(2*Math.PI)));r.geometry=new E.CircleGeometry(a,c,l,s)}else console.warn("only support THREE.CircleGeometry")}setTipsAngle(e){var o;const n=(o=this.helperObject3D.angleTips)==null?void 0:o.element;!n||(n.innerText=`${e.toFixed(0)}\xB0`)}setTipsPosition(e){const n=this.helperObject3D.angleTips;if(!n)return;const o=e.project(this.camera),{x:s,y:r,z:a}=o;if(a>1)return;const l=(s+1)/2*100+"%",c=(-r+1)/2*100+"%";n.setLeftTop(l,c)}}class ab extends Pn{constructor(...e){super(...e);m(this,"startInfo");m(this,"name","RectangleScaleController")}enable(){this.helperObject3D.enable(),super.enable()}disable(){this.helperObject3D.disable(),super.disable()}show(){this.helperObject3D.show(),super.show()}hide(){this.helperObject3D.hide(),super.hide()}onApplyOriginObjectScale(e){}getDragPlane(){const e=new E.Plane,n=this.helperObject3D.cornerPositions;if(n.length!==0)return n.length<3?e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new Q.Vector3),n[0]):e.setFromCoplanarPoints(n[0],n[1],n[2]),e}dragStart(e,n){var s,r;(r=(s=this.helperObject3D).updatePoints)==null||r.call(s);const o=this.getDragPlane();if(!o)return this.dragEnd();this.startInfo={startPoint:{position:n.position.clone(),direction:n.direction},plane:o},this.hooks.emit("scaleStart"),this.render(),this.isDragging=!0,console.log("%c RectangleScaleController dragStart","color: #e5af2e")}dragging(e){if(!this.isDragging)return;const n=yo(this.camera,e,this.container);if(!n)return this.dragEnd();this.scale(n),console.log("%c RectangleScaleController dragging","color: #49de1b")}scale(e){var j,_;if(!this.startInfo)return;const n=this.originObject3D,{startPoint:o,plane:s}=this.startInfo,r=this.helperObject3D.cornerPositions;if(r.length<4)return this.dragEnd();const a=e.ray.intersectPlane(s,new Q.Vector3);if(!a||_v(a,this.camera.position))return;const l=new Q.Vector3().addVectors(r[0],r[2]).divideScalar(2),{position:c,direction:u}=o,h=new Q.Vector3().subVectors(r[1],r[0]),d=new Q.Vector3().subVectors(r[3],r[0]),f=F=>{const J=new Q.Vector3(0,0,0);if(!this.startInfo)return J;const V=(F==="ew"?h:d).clone(),B=c.clone().projectOnVector(V),O=a.clone().projectOnVector(V),W=l.clone().projectOnVector(V);if(O.equals(B))return J;if(F==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const X=new Q.Vector3().subVectors(O,W),U=X.x<0&&V.x>=0,de=X.y<0&&V.y>=0,he=X.z<0&&V.z>=0;this.startInfo.dragPointInCenterBottom=U||de||he}if(F==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const X=new Q.Vector3().subVectors(O,W),U=X.x<0&&V.x>=0,de=X.y<0&&V.y>=0,he=X.z<0&&V.z>=0;this.startInfo.dragPointInCenterLeft=U||de||he}const G=new Q.Vector3().subVectors(O,B),ee=G.length();return ee>.3?(console.warn("offset.length() > 0.3, skipped",ee),J):G},p=f("ew"),v=f("ns"),g=()=>{const F=p;this.helperObject3D.cornerPositions.forEach((J,V)=>{var B;(B=this.startInfo)!=null&&B.dragPointInCenterLeft?(V===0||V===3)&&J.add(F):(V===1||V===2)&&J.add(F)})},A=()=>{const F=v;this.helperObject3D.cornerPositions.forEach((J,V)=>{var B;(B=this.startInfo)!=null&&B.dragPointInCenterBottom?(V===0||V===1)&&J.add(F):(V===2||V===3)&&J.add(F)})};switch(u){case"ew":g();break;case"ns":A();break;case"nesw":case"nwse":g(),A()}const y=new Q.Vector3().subVectors(r[1],r[0]).length()/h.length(),w=new Q.Vector3().subVectors(r[3],r[0]).length()/d.length(),C=new Q.Vector3(y,w,1),x=new E.Matrix4().scale(C);n.isCSS3DObjectPlus?n.applyScaleMatrix4(x):n.scale.applyMatrix4(x),o.position.copy(a);const I=new Q.Vector3().addVectors(r[0],r[2]).divideScalar(2),S=new Q.Vector3().subVectors(I,l),k=new E.Matrix4().setPosition(S);n.applyMatrix4(k),(j=this.helperObject3D.css3DInstance)==null||j.css3DObject.applyMatrix4(k),(_=this.helperObject3D.plane)==null||_.applyMatrix4(k),this.hooks.emit("applyObjectScale",{matrix4:x}),this.hooks.emit("applyObjectPosition",{matrix4:k}),this.render()}dragEnd(){!this.isDragging||(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render(),console.log("%c RectangleScaleController dragEnd","color: #e94e4e"))}}class lb extends ab{constructor(...e){super(...e);m(this,"name","CSS3DScaleController");this.addHTMLEventListener()}addHTMLEventListener(){this.helperObject3D.points.forEach(e=>{if(!e)return;const n=e.point,o=a=>this.dragStart(a,e),s=this.dragging.bind(this),r=this.dragEnd.bind(this);n.addEventListener("dragstart",o),n.addEventListener("drag",s),n.addEventListener("dragend",r)})}}class cb extends Pn{constructor(...e){super(...e);m(this,"name","BoundingBoxController")}}class ub extends xl{constructor(t){super(t)}}const Co="v1.0.0",eo="Object3DHelperPlugin",Ai=`${eo}@${Co}`,db=()=>{console.error(`${Ai} is disposed`)},hb=()=>{console.warn(`${Ai} is disabled`)},fb=()=>{console.error(`${Ai} is disabled`)};class Dl extends ci{constructor(e){super(e);m(this,"version",Co);m(this,"name",eo);m(this,"state",{visible:!0,enabled:!0,disposed:!1});m(this,"objectHelperMap",new Map);m(this,"css3DObjectParentMap",new Map);m(this,"css3DRender");this.five=e,this.css3DRender=new _t(this.five.scene),console.warn("Object3DHelper: \u4F7F\u7528\u6B64\u63D2\u4EF6\uFF0C\u9700\u8981\u5728\u521D\u59CB\u5316five\u65F6\uFF0C\u8BBE\u7F6Efive\u53C2\u6570: { backgroundAlpha: 0, backgroundColor: 0x000000 }"),Object.assign(window,{[`__${eo.toUpperCase()}_DEBUG__`]:this})}show(e){return N(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return N(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){if(this.state.disposed)return db();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return fb();const o=H({},this.state);this.state=H(H({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:o})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,n={}){var f;if(!e)return console.error("Object3D is undefined");if(this.objectHelperMap.has(e)){console.warn(`Object3DHelperPlugin: object3D ${e.name} is already has helper`);return}const o=new sb,s=[],r=(f=this.five.getElement())==null?void 0:f.parentElement,a=this.five.camera,{moveHelper:l=!0,rotateHelper:c=!0,scaleHelper:u=!0,boundingBoxHelper:h=!1}=n,d=new Ce.Subscribe;if(l){const p=new Xv(e),v=this.getConfig(n.moveHelper),g=new cn(this.five,$v,e,p,v,d);o.addControllers({moveController:g.helperController}),s.push(()=>g.dispose())}if(c){const p=this.getConfig(n.rotateHelper),v=new Jv(e,H({container:r},p)),g=new cn(this.five,rb,e,v,p,d);o.addControllers({rotateController:g.helperController}),s.push(()=>g.dispose())}if(h){const p=new Kv(e),v=new cn(this.five,cb,e,p,void 0,d);o.addControllers({boundingBoxController:v.helperController})}if(u)if(e.isCSS3DObjectPlus&&r){const p=new qv(e,r,a,this.five.scene),v=new cn(this.five,lb,e,p,void 0,d);o.addControllers({scaleController:v.helperController}),s.push(()=>v.dispose()),ca(this.five).then(()=>{var g,A;if(e.isCSS3DObjectPlus){const y=e;if(!y||y.mode!=="front")return;const w=(g=this.css3DRender.behindModeCSS3DRenderer.wrapper)!=null?g:ua(this.five);w&&(this.css3DObjectParentMap.set(y,y.parent),y.removeFromParent(),this.css3DRender.behindModeCSS3DRenderer.setWrapper(w),(A=this.css3DRender.getBehindCSS3DObjectGroup())==null||A.add(y),this.css3DRender.render(this.five.camera))}})}else{const p=new ub(e),v=new cn(this.five,Rv,e,p,void 0,d);o.addControllers({scaleController:v.helperController}),s.push(()=>v.dispose())}return this.objectHelperMap.set(e,{helper:o,disposers:s}),o.controllers}removeObject3DHelper(e){if(!this.objectHelperMap.has(e))return;const{helper:n,disposers:o}=this.objectHelperMap.get(e);if(!!n){if(e.isCSS3DObjectPlus){const s=e,r=this.css3DObjectParentMap.get(s);r&&r.add(s),this.css3DRender.render(this.five.camera)}this.objectHelperMap.delete(e),n.dispose(),o==null||o.forEach(s=>s==null?void 0:s())}}handleEnable(e,n=!0){e?(this.everyHelperDo(o=>o.enable()),this.hooks.emit("enable",{userAction:n})):(this.everyHelperDo(o=>o.disable()),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){e?(this.everyHelperDo(o=>o.show()),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.everyHelperDo(o=>o.hide()),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}handleDispose(){this.objectHelperMap.forEach(({helper:e,disposers:n})=>{e.dispose(),n==null||n.forEach(o=>o==null?void 0:o())})}everyHelperDo(e){this.objectHelperMap.forEach(({helper:n,disposers:o})=>{n&&e(n)})}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&hb()}getConfig(e){if(!!e&&typeof e!="boolean"&&e.enable)return e}}const mb=i=>new Dl(i);exports.CSS3DRender=_t;exports.CSS3DRenderPlugin=qt;exports.CameraMovementEffect=Va;exports.CameraMovementPlugin=kh;exports.ContentType=sl;exports.CruisePlugin=dp;exports.CruisePluginController=po;exports.DIRECTION=Gt;exports.DISPLAY_STRATEGY_TYPE=Lt;exports.DimensionType=rl;exports.FLOOR_PLAN_ATTACHED_TO=gt;exports.FLOOR_TYPE_MAP=mh;exports.GuideLinePlugin=nl;exports.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE=St;exports.ItemLabelPlugin=Vm;exports.Magnifier=Ha;exports.MapviewFloorplanPlugin=Xd;exports.ModelChassisCompassPlugin=Ah;exports.ModelEntryDoorGuidePlugin=yh;exports.ModelFloorplanPlugin=Gd;exports.ModelItemLabelPlugin=gm;exports.ModelRoomLabelPlugin=eu;exports.ModelTVVideoPlugin=bm;exports.ModelViewPlugin=ac;exports.Object3DHelperController=Dl;exports.Object3DHelperPlugin=mb;exports.PLUGIN=Ai;exports.PaintBrush=rc;exports.PaintBrushTypeEnum=ot;exports.PanoCompassPlugin=Yh;exports.PanoCursorRaycasterPlugin=kc;exports.PanoDoorLabelPlugin=Jm;exports.PanoFloorplanRadarPlugin=hh;exports.PanoMeasurePlugin=Nf;exports.PanoMeasurePluginLine=Vt;exports.PanoMeasurePluginModel=fi;exports.PanoMeasurePluginPoint=Ue;exports.PanoMeasurePluginPolyline=hi;exports.PanoRulerPlugin=Mh;exports.PanoRulerProPlugin=Gh;exports.PanoSpatialTagPlugin=sm;exports.PanoTagPlugin=Vv;exports.PanoTagPluginController=Il;exports.PointType=al;exports.ROOM_FETILE_TYPE_MAP=fh;exports.ROOM_TYPE_MAP=ph;exports.Rotation=et;exports.TopviewFloorplanPlugin=Ud;exports.Util=tA;exports.VERSION=Co;exports.itemLabelPluginServerParams=Rm;exports.modelItemLabelPluginServerParams=Am;exports.modelRoomLabelPluginServerParams=tu;exports.pluginFlag=jv;