@realsee/dnalogel 2.10.6 → 2.10.7
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.
- package/dist/index.cjs.js +17 -17
- package/dist/index.js +6 -11
- package/dist/index.umd.js +1 -1
- package/docs/classes/CSS3DRender.html +31 -31
- package/docs/classes/CruisePluginController.html +24 -24
- package/docs/classes/Magnifier.html +20 -20
- package/docs/classes/ModelRoomLabelController.html +11 -11
- package/docs/classes/Object3DHelperController.html +24 -24
- package/docs/classes/PaintBrush.html +15 -15
- package/docs/classes/PanoMeasurePluginLine.html +23 -23
- package/docs/classes/PanoMeasurePluginModel.html +22 -22
- package/docs/classes/PanoMeasurePluginPoint.html +14 -14
- package/docs/classes/PanoMeasurePluginPolyline.html +26 -26
- package/docs/classes/PanoTagPluginController.html +47 -47
- package/docs/classes/Util.BetterTween.html +8 -8
- package/docs/classes/Util.FivePointSelector.html +12 -12
- package/docs/classes/Util.Interval.html +12 -12
- package/docs/classes/Util.Magnifier.html +17 -17
- package/docs/classes/Util.PointDomHelper.html +11 -11
- package/docs/classes/Util.PointHelper.html +11 -11
- package/docs/classes/Util.Rectangle.html +13 -13
- package/docs/enums/CameraMovementEffect.html +7 -7
- package/docs/enums/ContentType.html +19 -19
- package/docs/enums/DIRECTION.html +9 -9
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +9 -9
- package/docs/enums/DimensionType.html +7 -7
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +8 -8
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +9 -9
- package/docs/enums/PaintBrushTypeEnum.html +8 -8
- package/docs/enums/PointType.html +7 -7
- package/docs/enums/Rotation.html +8 -8
- package/docs/functions/CSS3DRenderPlugin.html +4 -4
- package/docs/functions/CameraMovementPlugin.html +4 -4
- package/docs/functions/CruisePlugin.html +4 -4
- package/docs/functions/GuideLinePlugin.html +5 -5
- package/docs/functions/ItemLabelPlugin.html +4 -4
- package/docs/functions/MapviewFloorplanPlugin.html +4 -4
- package/docs/functions/ModelChassisCompassPlugin.html +4 -4
- package/docs/functions/ModelEntryDoorGuidePlugin.html +4 -4
- package/docs/functions/ModelFloorplanPlugin.html +4 -4
- package/docs/functions/ModelItemLabelPlugin.html +4 -4
- package/docs/functions/ModelRoomLabelPlugin.html +4 -4
- package/docs/functions/ModelTVVideoPlugin.html +4 -4
- package/docs/functions/ModelViewPlugin.html +4 -4
- package/docs/functions/Object3DHelperPlugin.html +4 -4
- package/docs/functions/PanoCompassPlugin.html +4 -4
- package/docs/functions/PanoCursorRaycasterPlugin.html +4 -4
- package/docs/functions/PanoDoorLabelPlugin.html +4 -4
- package/docs/functions/PanoFloorplanRadarPlugin.html +4 -4
- package/docs/functions/PanoMeasurePlugin.html +4 -4
- package/docs/functions/PanoRulerPlugin.html +4 -4
- package/docs/functions/PanoRulerProPlugin.html +4 -4
- package/docs/functions/PanoSpatialTagPlugin.html +4 -4
- package/docs/functions/PanoTagPlugin.html +4 -4
- package/docs/functions/PanoVideoPlugin.html +4 -4
- package/docs/functions/TopviewFloorplanPlugin.html +4 -4
- package/docs/functions/Util.getCoordsFromClient.html +5 -5
- package/docs/functions/Util.getCoordsFromElement.html +5 -5
- package/docs/functions/Util.getFrameTime.html +5 -5
- package/docs/functions/Util.getIntersectFromRelativePosition.html +5 -5
- package/docs/functions/Util.getRaycasterFromFivePointer.html +5 -5
- package/docs/functions/Util.isNil.html +5 -5
- package/docs/functions/Util.nextFrame.html +5 -5
- package/docs/functions/Util.notNil.html +5 -5
- package/docs/functions/Util.requestAnimationFrameInterval.html +5 -5
- package/docs/functions/Util.tweenProgress.html +5 -5
- package/docs/functions/pluginFlag.html +5 -5
- package/docs/index.html +4 -4
- package/docs/interfaces/AddTagConfig.html +6 -6
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -11
- package/docs/interfaces/CSS3DRenderPluginState.html +8 -8
- package/docs/interfaces/CameraMovementPluginExportType.html +7 -7
- package/docs/interfaces/EventMap.html +15 -15
- package/docs/interfaces/FloorplanBounding.html +8 -8
- package/docs/interfaces/FloorplanData.html +10 -10
- package/docs/interfaces/FloorplanEntrance.html +11 -11
- package/docs/interfaces/FloorplanExtraObject.html +10 -10
- package/docs/interfaces/FloorplanExtraObject3D.html +8 -8
- package/docs/interfaces/FloorplanFloorData.html +9 -9
- package/docs/interfaces/FloorplanImagePosition.html +7 -7
- package/docs/interfaces/FloorplanObserver.html +9 -9
- package/docs/interfaces/FloorplanOutlineItem.html +9 -9
- package/docs/interfaces/FloorplanPosition.html +7 -7
- package/docs/interfaces/FloorplanRoomItem.html +13 -13
- package/docs/interfaces/FloorplanRoomLabelItem.html +7 -7
- package/docs/interfaces/FloorplanServerBounding.html +8 -8
- package/docs/interfaces/FloorplanServerComputedData.html +10 -10
- package/docs/interfaces/FloorplanServerData.html +7 -7
- package/docs/interfaces/FloorplanServerDoorItem.html +10 -10
- package/docs/interfaces/FloorplanServerDoorPosition.html +8 -8
- package/docs/interfaces/FloorplanServerEntrance.html +11 -11
- package/docs/interfaces/FloorplanServerFloorData.html +9 -9
- package/docs/interfaces/FloorplanServerImagePosition.html +7 -7
- package/docs/interfaces/FloorplanServerObserver.html +9 -9
- package/docs/interfaces/FloorplanServerOutlineItem.html +9 -9
- package/docs/interfaces/FloorplanServerPosition.html +7 -7
- package/docs/interfaces/FloorplanServerRoomItem.html +14 -14
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -7
- package/docs/interfaces/HelperOffset.html +8 -8
- package/docs/interfaces/ItemLabelPluginData.html +6 -6
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +11 -11
- package/docs/interfaces/ItemLabelPluginParametersType.html +9 -9
- package/docs/interfaces/MinMax.html +7 -7
- package/docs/interfaces/ModelChassisCompassPluginData.html +7 -7
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +8 -8
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +7 -7
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +8 -8
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +8 -8
- package/docs/interfaces/ModelItemLabelPluginData.html +6 -6
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +11 -11
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +7 -7
- package/docs/interfaces/ModelRoomLabelPluginData.html +6 -6
- package/docs/interfaces/ModelTVVideoPluginData.html +9 -9
- package/docs/interfaces/ModelTVVideoPluginExportType.html +8 -8
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +6 -6
- package/docs/interfaces/ModelViewPluginExportType.html +11 -11
- package/docs/interfaces/Object3DHelperState.html +8 -8
- package/docs/interfaces/ObjectHelperControllers.html +9 -9
- package/docs/interfaces/PaintBrushAction.html +12 -12
- package/docs/interfaces/PaintBrushConfigs.html +12 -12
- package/docs/interfaces/PaintBrushState.html +10 -10
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +10 -10
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +5 -5
- package/docs/interfaces/PanoMeasureParameterType.html +12 -12
- package/docs/interfaces/PanoMeasurePluginLineJson.html +8 -8
- package/docs/interfaces/PanoMeasurePluginOpenParameter.html +7 -7
- package/docs/interfaces/PanoMeasurePluginPointJson.html +7 -7
- package/docs/interfaces/PanoMeasurePluginPolylineJson.html +8 -8
- package/docs/interfaces/PanoRulerPluginExportType.html +10 -10
- package/docs/interfaces/PanoRulerPluginOptions.html +7 -7
- package/docs/interfaces/PanoRulerPluginParameterType.html +8 -8
- package/docs/interfaces/PanoRulerProPluginExportType.html +9 -9
- package/docs/interfaces/PanoRulerProPluginOptions.html +7 -7
- package/docs/interfaces/PanoRulerProPluginParameterType.html +7 -7
- package/docs/interfaces/PanoRulerProPluginState.html +8 -8
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +5 -5
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +5 -5
- package/docs/interfaces/PanoSpatialTagPluginData.html +11 -11
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +10 -10
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +13 -13
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +10 -10
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +13 -13
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +11 -11
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +10 -10
- package/docs/interfaces/PanoVideoPluginType.LoadParams.html +6 -6
- package/docs/interfaces/PanoVideoPluginType.PanoVideoItem.html +8 -8
- package/docs/interfaces/PanoVideoPluginType.PluginData.html +6 -6
- package/docs/interfaces/PanoVideoPluginType.PluginEventMap.html +9 -9
- package/docs/interfaces/PanoVideoPluginType.PluginState.html +6 -6
- package/docs/interfaces/PanoVideoPluginType.VideoItem.html +8 -8
- package/docs/interfaces/PanoVideoPluginType.VideoMeshParams.html +10 -10
- package/docs/interfaces/Point.html +8 -8
- package/docs/interfaces/Room.html +9 -9
- package/docs/interfaces/RoomInfo.html +7 -7
- package/docs/interfaces/RoomLabel.html +14 -14
- package/docs/interfaces/RoomRules.html +5 -5
- package/docs/interfaces/Rooms.html +5 -5
- package/docs/interfaces/Scissor.html +9 -9
- package/docs/interfaces/State.html +8 -8
- package/docs/interfaces/TagCache.html +12 -12
- package/docs/interfaces/TagConfig.html +10 -10
- package/docs/interfaces/TagIconUrl.html +9 -9
- package/docs/interfaces/Tags.html +9 -9
- package/docs/interfaces/TemporaryState.html +6 -6
- package/docs/interfaces/Util.MagnifierParameter.html +11 -11
- package/docs/interfaces/Util.MouseGroupParameter.html +8 -8
- package/docs/modules/PanoVideoPluginType.html +5 -5
- package/docs/modules/Util.html +5 -5
- package/docs/modules.html +4 -4
- package/docs/types/ArrayPosition.html +5 -5
- package/docs/types/AudioAppearance.html +5 -5
- package/docs/types/AudioTagTypeConfigKey.html +5 -5
- package/docs/types/CSS3DRenderExportType.html +5 -5
- package/docs/types/CSS3DRenderPluginExportType.html +5 -5
- package/docs/types/CSS3DRenderPluginParameterType.html +5 -5
- package/docs/types/ClassFunctionParameters.html +5 -5
- package/docs/types/Color.html +5 -5
- package/docs/types/ContentTypeConfigKey.html +5 -5
- package/docs/types/ContentTypeConfigKeySplit.html +5 -5
- package/docs/types/ContentTypeMap.html +5 -5
- package/docs/types/Create3DDomContainerReturnType.html +5 -5
- package/docs/types/Create3DElementReturnType.html +5 -5
- package/docs/types/CruisePluginExportType.html +5 -5
- package/docs/types/Direction-1.html +5 -5
- package/docs/types/Direction4.html +5 -5
- package/docs/types/FloorplanRuleLabels.html +5 -5
- package/docs/types/FloorplanServerRuleLabels.html +5 -5
- package/docs/types/GuideLinePluginExportType.html +5 -5
- package/docs/types/HelperEventMap.html +5 -5
- package/docs/types/LoadTagConfig.html +5 -5
- package/docs/types/MapviewFloorplanPluginParameterType.html +5 -5
- package/docs/types/MapviewFloorplanPluginReturnType.html +5 -5
- package/docs/types/MediaData.html +5 -5
- package/docs/types/MediaStore.html +5 -5
- package/docs/types/ModelElement.html +5 -5
- package/docs/types/ModelEntryDoorGuidePluginParameterType.html +5 -5
- package/docs/types/ModelFloorplanPluginParameterType.html +5 -5
- package/docs/types/ModelFloorplanPluginReturnType.html +5 -5
- package/docs/types/ModelRoomLabelPluginParameters.html +5 -5
- package/docs/types/ModelRoomLabelPluginReturnType.html +5 -5
- package/docs/types/MoveArgs.html +5 -5
- package/docs/types/MoveOpts.html +5 -5
- package/docs/types/Object3DHelperEventMap.html +5 -5
- package/docs/types/ObjectFit.html +5 -5
- package/docs/types/PaintBrushEventMap.html +5 -5
- package/docs/types/PanoCompassPluginData.html +5 -5
- package/docs/types/PanoCompassPluginExportType.html +5 -5
- package/docs/types/PanoCompassPluginParameterType.html +5 -5
- package/docs/types/PanoFloorplanRadarPluginParameterType.html +5 -5
- package/docs/types/PanoFloorplanRadarPluginReturnType.html +5 -5
- package/docs/types/PanoIndex.html +5 -5
- package/docs/types/PanoMeasurePluginEvent.html +5 -5
- package/docs/types/PanoMeasureReturnType.html +5 -5
- package/docs/types/PanoSpatialTagPluginId.html +5 -5
- package/docs/types/PanoTagPluginExportInterface.html +5 -5
- package/docs/types/PanoTagPluginParamsInterface.html +5 -5
- package/docs/types/PanoVideoPluginParameterType.html +5 -5
- package/docs/types/PanoVideoPluginReturnType.html +5 -5
- package/docs/types/PlaneTag.html +5 -5
- package/docs/types/PlaneTagElement.html +5 -5
- package/docs/types/Point2DElement.html +5 -5
- package/docs/types/Point2DTag.html +5 -5
- package/docs/types/Point3DElement.html +5 -5
- package/docs/types/Point3DTag.html +5 -5
- package/docs/types/PointTag.html +5 -5
- package/docs/types/PointTagElement.html +5 -5
- package/docs/types/Position.html +5 -5
- package/docs/types/RotateArgs.html +5 -5
- package/docs/types/RotateOpts.html +5 -5
- package/docs/types/RuleLabelsKey.html +5 -5
- package/docs/types/RuleLabelsValue.html +5 -5
- package/docs/types/StickType.html +5 -5
- package/docs/types/Tag.html +5 -5
- package/docs/types/Tag2D.html +5 -5
- package/docs/types/Tag3D.html +5 -5
- package/docs/types/TagContentType.html +5 -5
- package/docs/types/TagDimensionType.html +5 -5
- package/docs/types/TagElement.html +5 -5
- package/docs/types/TagEvents.html +5 -5
- package/docs/types/TagGLTFObject.html +5 -5
- package/docs/types/TagHooks.html +5 -5
- package/docs/types/TagIconSize.html +5 -5
- package/docs/types/TagId.html +5 -5
- package/docs/types/TagPointType.html +5 -5
- package/docs/types/TopviewFloorplanPluginParameterType.html +5 -5
- package/docs/types/TopviewFloorplanPluginReturnType.html +5 -5
- package/docs/types/WorkCode.html +5 -5
- package/docs/variables/FLOOR_TYPE_MAP.html +5 -5
- package/docs/variables/PLUGIN.html +5 -5
- package/docs/variables/ROOM_FETILE_TYPE_MAP.html +5 -5
- package/docs/variables/ROOM_TYPE_MAP.html +5 -5
- package/docs/variables/VERSION.html +5 -5
- package/docs/variables/itemLabelPluginServerParams.html +5 -5
- package/docs/variables/modelItemLabelPluginServerParams.html +5 -5
- package/docs/variables/modelRoomLabelPluginServerParams.html +5 -5
- package/libs/PanoTagPlugin/controller/index.js +52 -57
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Gl=Object.defineProperty,Wl=Object.defineProperties;var Nl=Object.getOwnPropertyDescriptors;var Io=Object.getOwnPropertySymbols;var _l=Object.prototype.hasOwnProperty,Xl=Object.prototype.propertyIsEnumerable;var vi=(i,t,e)=>t in i?Gl(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,
|
|
1
|
+
"use strict";var Gl=Object.defineProperty,Wl=Object.defineProperties;var Nl=Object.getOwnPropertyDescriptors;var Io=Object.getOwnPropertySymbols;var _l=Object.prototype.hasOwnProperty,Xl=Object.prototype.propertyIsEnumerable;var vi=(i,t,e)=>t in i?Gl(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,R=(i,t)=>{for(var e in t||(t={}))_l.call(t,e)&&vi(i,e,t[e]);if(Io)for(var e of Io(t))Xl.call(t,e)&&vi(i,e,t[e]);return i},me=(i,t)=>Wl(i,Nl(t));var m=(i,t,e)=>(vi(i,typeof t!="symbol"?t+"":t,e),e);var H=(i,t,e)=>new Promise((n,o)=>{var s=l=>{try{a(e.next(l))}catch(c){o(c)}},r=l=>{try{a(e.throw(l))}catch(c){o(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,r);a((e=e.apply(i,t)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const Un=require("@tweenjs/tween.js"),Ce=require("@realsee/five"),V=require("three"),qn=require("three/examples/jsm/renderers/CSS3DRenderer"),la=require("@realsee/five/line"),ca=require("three/examples/jsm/loaders/FBXLoader"),Yl=require("hammerjs"),Ul=require("classnames"),ql=require("polyline-normals"),Jl=require("object-assign-deep"),Zl=require("animejs"),Kl=require("@realsee/five/gltf-loader"),$l=require("lodash.get"),ec=require("lodash.clonedeep"),tc=require("lodash.isequal"),lt=i=>i&&typeof i=="object"&&"default"in i?i:{default:i};function ua(i){if(i&&i.__esModule)return i;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const e in i)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>i[e]})}}return t.default=i,Object.freeze(t)}const pn=lt(Un),ri=ua(Un),I=ua(V),yn=lt(Yl),Ke=lt(Ul),nc=lt(ql),ht=lt(Jl),ko=lt(Zl),kn=lt($l),ic=lt(ec),oc=lt(tc);function da(){}const xo=()=>Promise.resolve(),Do={__queue:Promise.resolve()};function sc(i=xo){Do.__queue=Do.__queue.then(i).catch(xo)}function xn(i,t,e){const n=i.x,o=i.y,s=Math.floor(n/t*1e4)/1e4,r=Math.floor(o/e*1e4)/1e4;return{x:s,y:r}}function bi(i,t,e){const{x:n,y:o}=i,s=n*t,r=o*e;return{x:s,y:r}}function Dn(i){if(i.length<2)return{};const t=i.slice(-2),e=t[0],n={x:(t[0].x+t[1].x)/2,y:(t[0].y+t[1].y)/2};return{control:e,end:n}}function rc(i,t,e=da){new Promise(n=>{setTimeout(()=>{e(),n(!0)},t*i)})}const ac=window,Lo=window.requestAnimationFrame||ac.webkitRequestAnimationFrame||(i=>setTimeout(i,16));function Nn(i,t=0){t<=0?Lo(i):Lo(()=>Nn(i,t-1))}function lc(i,t,e,n=Un.Easing.Linear.None){const o=new Un.Tween(i).to(t,e).easing(n).start();function s(r){!o.update(r)||requestAnimationFrame(s)}return requestAnimationFrame(s),o}var ot=(i=>(i.Drawline="Drawline",i.Undo="Undo",i.Exit="Exit",i))(ot||{});const dn=Symbol("$$PAINT_BRUSH_EVENT$$");function Ln(i){return i[dn]||(i[dn]={}),i[dn]}function cc(i){i[dn]||delete i[dn]}class uc{hasListener(t){const e=Ln(this);return e&&e[t]&&e[t].length>0}on(t,e,n){const o=Ln(this);return o[t]||(o[t]=[]),o[t].push([e,n||!1]),()=>this.off(t,e)}once(t,e){return this.on(t,e,!0)}off(t,e){if(t===void 0){cc(this);return}const n=Ln(this);if(n[t]||(n[t]=[]),e===void 0){n[t].length=0;return}let o=0;for(;o<n[t].length&&n[t][o][0]!==e;o++);o<n[t].length&&n[t].splice(o,1)}emit(t,...e){let n=!1;const s=Ln(this)[t]||[];for(let r of s.slice()){const[a,l=!1]=r,c=a(...e);l&&this.off(t,a),c===!1&&(n=!0)}return n}}function ut(){return((1+Math.random())*65536|0).toString(16).substring(1)}function Ge(){return(ut()+ut()+"-"+ut()+"-4"+ut().substr(0,3)+"-"+ut()+"-"+ut()+ut()+ut()).toLowerCase()}const dc=`
|
|
2
2
|
<style type="text/css">
|
|
3
3
|
|
|
4
4
|
#_gl_paintBrush {
|
|
@@ -98,10 +98,10 @@ transition: all 500ms;
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
</style>
|
|
101
|
-
`;class hc extends uc{constructor(e){super();m(this,"configs");m(this,"clientWidth");m(this,"clientHeight");m(this,"ready",!1);m(this,"uuid",Ge());m(this,"tween");m(this,"tweening",!1);m(this,"container");m(this,"canvas");m(this,"data",{});m(this,"tempLine",{});this.configs=e,this.clientWidth=document.body.clientWidth,this.clientHeight=document.body.clientHeight,this.container=this.ifInsertToDOM(),this.canvas={},this.initCtrl()}get color(){return this.configs.currentColor}get state(){return this.data}get dpr(){return this.configs.DPR||1}ifInsertToDOM(){if(this.container)return this.container;if(this.configs.container)this.configs.container.id="_gl_paintBrush",this.container=this.configs.container;else if(document.getElementById("_gl_paintBrush"))this.container=document.getElementById("_gl_paintBrush");else{const e=document.createElement("div");e.id="_gl_paintBrush",document.body.appendChild(e),this.container=e}return this.container.innerHTML=dc,this.container}initCanvas(e){const n=document.createElement("canvas");n.className=e,n.width=this.clientWidth,n.height=this.clientHeight;const o=n.getContext("2d");if(!!o)return o.lineWidth=5*this.dpr,o.lineCap="round",o.lineJoin="round",this.container.appendChild(n),n}initCtrl(){const e=document.createElement("div");e.className="_paintBrush-ctrl";const n=document.createElement("div");n.className="_paintBrush-ctrlinner";const o=document.createElement("a");o.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--undo",o.addEventListener("click",a=>{var d;if(a.stopPropagation(),this.configs.onClickUndo&&this.configs.onClickUndo(),!this.canvas[this.uuid]||!this.data[this.uuid]||this.data[this.uuid].length===0)return;const l=this.data[this.uuid].pop();l&&this.emitStateChange({type:ot.Undo,color:this.color,ready:this.ready,state:l,uuid:this.uuid});const c=(d=this.canvas[this.uuid])==null?void 0:d.getContext("2d");if(!this.canvas[this.uuid])return;const{width:u,height:h}=this.canvas[this.uuid];c&&c.clearRect(0,0,u,h),this.data[this.uuid].forEach(f=>this.handleDrawLine(this.uuid,f,{withUndo:!0}))});const s=document.createElement("a");return s.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--close",s.addEventListener("click",a=>{a.stopPropagation(),this.closeBrush(),this.configs.onClickClose&&this.configs.onClickClose()}),[o,s].forEach(a=>{const l=document.createElement("i");l.className="brush-icon";const c=document.createElement("span");c.className="brush-txt",c.innerText=a.className.endsWith("undo")?this.configs.onUndoText:this.configs.onExitText,a.appendChild(l),a.appendChild(c)}),n.appendChild(o),n.appendChild(s),e.appendChild(n),this.container.appendChild(e),e}openBrush(){if(this.ready)return;this.canvas[this.uuid]||(this.canvas[this.uuid]=this.initCanvas("_paintBrush-canvas")),this.container.className="brushing";const e=this.canvas[this.uuid];e.getContext("2d").clearRect(0,0,e.width,e.height),this.openBrushHandle(),this.ready=!0,this.emit("readyChange",!0)}closeBrush(){!this.ready||(this.container.className="",this.data={},this.tempLine={},Object.keys(this.canvas).forEach(e=>{this.canvas[e].ontouchstart=()=>!1,this.canvas[e].ontouchmove=()=>!1,this.canvas[e].ontouchend=()=>!1,this.canvas[e].ontouchcancel=()=>!1;const n=this.canvas[e].getContext("2d");n&&n.clearRect(0,0,this.canvas[e].width,this.canvas[e].height)}),this.ready=!1,this.emit("readyChange",!1),this.emitStateChange({type:ot.Exit,color:this.color,ready:!1,uuid:this.uuid}))}updateCurrentColor(e){const n=this.canvas[this.uuid];if(!n)return;const o=n.getContext("2d");!o||(this.configs.currentColor=e,o.strokeStyle=e)}openBrushHandle(){const e=this.canvas[this.uuid];if(!e)return;const n=e.getContext("2d");if(!n)return;const o=this.color||"#6D92FF";n.strokeStyle=o;let s=null,r=[],a,l=[],c=0;const u=(h,d,f)=>{const g=this.color||"#ff0000";n.strokeStyle=g,n.beginPath(),n.moveTo(h.x,h.y),n.quadraticCurveTo(d.x,d.y,f.x,f.y),n.stroke()};e.onmousedown=h=>{h.preventDefault(),c=Date.now();const d=h.clientX,f=h.clientY;r=[],r.push({x:d,y:f}),s={x:d,y:f},a=xn({x:d,y:f},this.clientWidth,this.clientHeight),l=[]},e.onmousemove=h=>{if(h.preventDefault(),!s)return;const d=Number(h.clientX),f=Number(h.clientY);if(Math.abs(d-s.x)<5&&Math.abs(f-s.y)<5||(r.push({x:d,y:f}),l.push(xn({x:d,y:f},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:g,end:A}=Dn(r);!g||!A||(u(s,g,A),s=A)},e.onmouseup=h=>{if(h.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const d=Date.now()-c,f={move:Object.assign({},a),uuid:this.uuid,line:[...l],color:this.color,duration:d<1280?d:d<2e3?1280:0};this.data[this.uuid].push(f),Nn(()=>{this.emitStateChange({type:ot.Drawline,color:this.color,ready:this.ready,state:f,uuid:this.uuid})})},e.ontouchstart=h=>{h.preventDefault(),c=Date.now();const d=h.touches[0].clientX,f=h.touches[0].clientY;r=[],r.push({x:d,y:f}),s={x:d,y:f},a=xn({x:d,y:f},this.clientWidth,this.clientHeight),l=[]},e.ontouchmove=h=>{if(h.preventDefault(),!s)return;const d=Number(h.touches[0].clientX),f=Number(h.touches[0].clientY);if(Math.abs(d-s.x)<5&&Math.abs(f-s.y)<5||(r.push({x:d,y:f}),l.push(xn({x:d,y:f},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:g,end:A}=Dn(r);!g||!A||(u(s,g,A),s=A)},e.ontouchend=e.ontouchcancel=h=>{if(h.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const d=Date.now()-c,f={move:Object.assign({},a),line:[...l],uuid:this.uuid,color:this.color,duration:d<1280?d:d<2e3?1280:0};this.data[this.uuid].push(f),Nn(()=>{this.emitStateChange({type:ot.Drawline,color:this.color,ready:this.ready,state:f,uuid:this.uuid})})}}emitStateChange(e,n=!0){if(e.type!==ot.Drawline){this.emit("stateChange",e,n);return}const o=Date.now(),s=e.state;if(!s||!s.line)return;const r=Math.ceil(s.line.length/100);for(let a=0;a<r;a++){const l={uuid:this.uuid,color:this.color,ready:this.ready,type:e.type,state:{uuid:this.uuid,move:s.move,duration:s.duration,color:this.color,line:s.line.slice(a*100,(a+1)*100)},timestamp:o,end:a===r-1};rc(a,20,()=>{this.emit("stateChange",l,n)})}}action(e){const{ready:n,type:o,uuid:s}=e;if(!n&&this.ready){this.closeBrush();return}if(n&&!this.ready){this.openBrush();return}if(!!this.ready)switch(o){case ot.Drawline:const{state:r,timestamp:a,end:l}=e;if(!a||!r)return;this.tempLine[a]=[].concat(this.tempLine[a]||[],r.line),l&&(Object.assign(r,{line:this.tempLine[a]}),this.handleDrawLine(s,r,{},()=>delete this.tempLine[a]));break;case ot.Undo:this.handleUndo(s);break}}handleDrawLine(e,n,{withUndo:o=!1},s=da){!n||Object.prototype.toString.call(n)!="[object Object]"||Object.keys(n).length===0||sc(()=>new Promise(r=>{if(o||(this.canvas[e]||(this.canvas[e]=this.initCanvas("_paintBrush-canvas--sync")),this.data[e]||(this.data[e]=[]),this.data[e].push(n)),!this.canvas[e])return;const a=this.canvas[e].getContext("2d");if(!a)return;const{line:l=[],color:c="black",duration:u=0,uuid:h}=n,d=bi(n.move||{},this.clientWidth,this.clientHeight);let f=[d];if(a.strokeStyle=c,a.beginPath(),a.moveTo(d.x,d.y),u&&!o){let g=[];const A=this;A.tween=lc({step:0},{step:l.length-1},u).onUpdate(({step:p})=>{var y;if(A.tweening=!0,!A.ready)return a.clearRect(0,0,A.canvas[h].width,A.canvas[h].height),(y=A.tween)==null?void 0:y.stop();const v=Math.floor(p);if(!g.find(w=>w===v)){if(g.push(v),f.push(bi(l[v],A.clientWidth,A.clientHeight)),f.length<3)return;const{control:w,end:P}=Dn(f);if(!w||!P)return;a.quadraticCurveTo(w.x,w.y,P.x,P.y),a.stroke()}}).onComplete(p=>{A.tween=void 0,A.tweening=!1,g=[],f=[],s&&s(),r()})}else{for(let g=0;g<l.length;g++){if(f.push(bi(l[g],this.clientWidth,this.clientHeight)),f.length<3)continue;const{control:A,end:p}=Dn(f);!A||!p||a.quadraticCurveTo(A.x,A.y,p.x,p.y)}a.stroke(),f=[],s&&s(),r()}}))}handleUndo(e){if(!this.canvas[e]||!this.data[e]||this.data[e].length===0)return;this.data[e].pop();const n=()=>{var s;const o=(s=this.canvas[e])==null?void 0:s.getContext("2d");o&&o.clearRect(0,0,this.canvas[e].width,this.canvas[e].height),this.data[e].forEach(r=>this.handleDrawLine(e,r,{withUndo:!0}))};if(this.tween&&this.tweening){this.tween.stop(),Nn(n,60);return}n()}destroyBrush(){this.closeBrush(),this.ready=!1,this.emit("readyChange",!0)}}class fc{constructor(t={}){m(this,"controller");const e=Object.assign({currentColor:"#f44336",onUndoText:"\u56DE\u9000",onExitText:"\u5173\u95ED"},t);this.controller=new hc(e)}on(t,e){this.controller.on(t,e)}off(t,e){this.controller.off(t,e)}once(t,e){this.controller.once(t,e)}show(){this.controller.openBrush()}action(t){this.controller.action(t)}get state(){return this.controller.state}get configs(){return this.controller.configs}dispose(){return this.controller.destroyBrush()}setCurrentColor(t){this.controller.updateCurrentColor(t)}}const mc=(i,t)=>{var U,j;let e=(j=(U=t==null?void 0:t.initialState)==null?void 0:U.enabled)!=null?j:!0,n=!1,o=!0,s=null;const a=O(O({},{lookAtCurrentCamera:!1,lockedPanoIndex:null,lockedLatitude:null,lockedLongitude:null}),t==null?void 0:t.config),l=new I.Scene,c=new Ce.Camera(60);let u=new I.Object3D,h,d;{const F=new I.DirectionalLight(16777215,.5);F.position.copy(new I.Vector3(1,1,1)),l.add(F)}{const F=new I.DirectionalLight(16777215,.3);l.add(F)}{const F=new I.AmbientLight(16777215,.3);l.add(F)}l.add(u);const f=()=>{if(n)return;h=k(i.model,c.fov,c.aspect),d=i.model.bounding.getCenter(new I.Vector3),l.remove(u),u=W(i.model),l.add(u),n=!0,S();function F(X){const G=X.clone();return G.uniforms.modelAlpha.value=1,G.uniforms.map.value&&(G.uniforms.map.value.needsUpdate=!0),G}function W(X){if(X instanceof I.Mesh){const G=X.geometry,ee=Array.isArray(X.material)?X.material.map(F):F(X.material);return new I.Mesh(G,ee)}else if(X instanceof I.Group){const G=new I.Group;return X.children.forEach(ee=>G.add(W(ee))),G}else{const G=new I.Object3D;return X.children.forEach(ee=>G.add(W(ee))),G}}},g=()=>{if(!!i.renderer)return s||(s=new I.WebGLRenderer({antialias:!1,alpha:!0}),s.setPixelRatio(i.renderer.getPixelRatio()),s.outputEncoding=I.sRGBEncoding,s.setClearColor(1579548,0),s.autoClear=!0),s},A=()=>{u.traverse(F=>{F instanceof I.Mesh&&[].concat(F.material).forEach(X=>X.dispose())}),l.remove(u),u=new I.Object3D,l.add(u),n=!1,S()},p=()=>{!e||n||f()},v=()=>{e||(e=!0,l.add(u),!n&&i.model.loaded&&f(),S())},y=()=>{!e||(l.remove(u),o=!0,x(),e=!1)},w=(F,W={})=>{const X=g();if(!X)return;F.appendChild(X.domElement),P(W);const G=window.getComputedStyle(F).position;G!=="relative"&&G!=="absolute"&&G!=="fixed"&&G!=="sticky"&&(F.style.position="relative")},P=(F={})=>{if(!s)return;const X=s.domElement.parentNode;if(X!=null&&X.nodeName){const{width:G=X.offsetWidth,height:ee=X.offsetHeight}=F;s.setSize(G,ee),c.aspect=G/ee,c.updateProjectionMatrix()}S()};function k(F,W,X){const G=F.bounding,ee=Math.pow(Math.pow(G.max.x-G.min.x+1,2)+Math.pow(G.max.y-G.min.y+1,2)+Math.pow(G.max.z-G.min.z+1,2),1/2);let N=ee/2/Math.tan(Math.PI*W/360);return X<1&&(N=N/X),isNaN(N)?ee:N}function C(F){return i.work.observers[F].standingPosition.clone()}const S=()=>{if(!e||!h||!d)return;const F=i.getPose();F.fov=c.fov,F.offset=d,F.distance=h,typeof a.lockedLatitude=="number"&&(F.latitude=a.lockedLatitude),typeof a.lockedLongitude=="number"&&(F.longitude=a.lockedLongitude),typeof a.lockedPanoIndex=="number"&&(F.offset=C(a.lockedPanoIndex)),a.lookAtCurrentCamera&&(F.offset=i.camera.position.clone().setY(i.camera.position.y+1)),c.setFromPose(F),o=!0},x=()=>{!e||o!==!0||!s||!s.domElement.parentNode||s.domElement.parentNode.offsetWidth===0||(s.render(l,c),o=!1)},Q=()=>{s&&s.dispose(),s=null},_=F=>{Object.assign(a,F),S()},R=()=>({enabled:e});return Object.assign(window,{camera:c}),i.on("modelLoaded",p),i.on("modelWillLoad",A),i.on("cameraDirectionUpdate",S),i.on("dispose",Q),i.on("renderFrame",x),i.on("cameraPositionUpdate",S),{appendTo:w,refresh:P,changeConfigs:_,enable:v,disable:y,getCurrentState:R}};function gt(...i){const t=[];return i.forEach(e=>{e.isCSS3DObjectPlus?t.push(e):t.push(...gt(...e.children))}),t}function Jn(i,t){const e=Math.round(i);return e%2===0?e:e+Number(t!=null&&t.floor?-1:1)}function pc(i,t,e=!0){if(!i)return console.error("createResizeObserver: element is undefined"),{observe:()=>{},unobserve:()=>{}};const n=()=>{const s=Jn(i.clientWidth,{floor:!0}),r=Jn(i.clientHeight,{floor:!0});t(s,r)};if(typeof ResizeObserver=="undefined"||!ResizeObserver)return console.warn("createResizeObserver: ResizeObserver is undefined"),{observe:()=>n(),unobserve:()=>{}};const o=new ResizeObserver(n);return e&&n(),{observe:()=>o.observe(i),unobserve:()=>o.unobserve(i)}}class So extends qn.CSS3DRenderer{constructor(){super();m(this,"wrapper");m(this,"requestAnimationFrameId");m(this,"resizeDisoper");this.domElement.style.position="absolute",this.domElement.style.top="0",this.domElement.style.left="0",this.domElement.style.userSelect="none",this.domElement.style.pointerEvents="none"}setWrapper(e){if(!e)throw new Error("CSS3DRenderer: wrapper is required");if(e.contains(this.domElement))return;const n=this.wrapper;return n&&n.contains(this.domElement)&&this.domElement.remove(),this.appendToElement(e),this.wrapper=e,this}appendToElement(e){e.appendChild(this.domElement);const n=(r,a)=>this.setSize(r,a),{observe:o,unobserve:s}=pc(e,n,!0);o(),this.resizeDisoper=s,this.wrapper=e}renderEveryFrame(e,n){if(this.wrapper||console.warn("wrapper is not find, creating a html element and call setWrapper(wrapper)",this,e),this.requestAnimationFrameId)return console.warn("CSS3DRenderer: render is running");const o=()=>{this.requestAnimationFrameId=requestAnimationFrame(o),!!e.visible&>(e).length!==0&&this.render(e,n)};o()}stopRender(){this.requestAnimationFrameId&&cancelAnimationFrame(this.requestAnimationFrameId)}dispose(){var e;this.stopRender(),(e=this.resizeDisoper)==null||e.call(this),this.domElement.remove()}}function gc(i){return typeof Symbol=="undefined"?`$Symbol<${i}>$`:Symbol(i)}const hn=gc("$$EVENT$$");function Sn(i){return i[hn]||(i[hn]={}),i[hn]}function Ac(i){i[hn]||delete i[hn]}class qt{hasListener(t){const e=Sn(this);return Boolean((e==null?void 0:e[t])&&e[t].length>0)}on(t,e,n){const o=Sn(this);return o[t]||(o[t]=[]),o[t].push([e,n||!1]),()=>this.off(t,e)}once(t,e){return this.on(t,e,!0)}off(t,e){if(t===void 0){Ac(this);return}const n=Sn(this);if(n[t]||(n[t]=[]),e===void 0){n[t].length=0;return}let o=0;for(;o<n[t].length&&n[t][o][0]!==e;o++);o<n[t].length&&n[t].splice(o,1)}emit(t,...e){let n=!1;const s=Sn(this)[t]||[];for(let r of s.slice()){const[a,l=!1]=r,c=a(...e);l&&this.off(t,a),c===!1&&(n=!0)}return n}}function to(...i){const t=new V.Vector3;return i.forEach(e=>{t.add(e)}),t.divideScalar(i.length),t}const vc=({x:i,y:t,z:e})=>new V.Vector3(i,t,e),ft=i=>new V.Vector3().fromArray(i),gn=i=>i instanceof V.Vector3?i:Array.isArray(i)?ft(i):vc(i);class bc extends I.Mesh{constructor(e,n){const o=new I.MeshBasicMaterial({opacity:0,color:0,transparent:!1,side:I.DoubleSide}),s=new I.PlaneGeometry(e,n);super(s,o);m(this,"name","opacity-mesh")}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}}const ha=1,yc=`CSS3DObjectPlus@${ha}`,wc=.00216,Cc=.003;class Pc extends qn.CSS3DObject{constructor(e){var k,C,S;const n=e.container,o=e.cornerPoints,s=(k=e.ratio)!=null?k:Cc,r=(C=e.dpr)!=null?C:1,a=(S=e.pointerEvents)!=null?S:"auto",l=Math.max(wc,s),c=o[0].distanceTo(o[1]),u=o[1].distanceTo(o[2]),h=Jn(c/s*r),d=Jn(u/s*r),f=to(...o);let g;if(l===s)n.style.width=`${h}px`,n.style.height=`${d}px`,g=n;else{const x=document.createElement("div");x.style.width=`${h}px`,x.style.height=`${d}px`,x.style.pointerEvents="none";const Q=s/l;n.style.position="absolute",n.style.left="0",n.style.top="0",n.style.width=`${Q*h}px`,n.style.height=`${Q*d}px`,x.appendChild(n),g=x}super(g);m(this,"version",ha);m(this,"isCSS3DObjectPlus",!0);m(this,"container");m(this,"width");m(this,"height");m(this,"domWidthPx");m(this,"domHeightPx");m(this,"cornerPoints");m(this,"centerPosition");m(this,"ratio");m(this,"mode","front");m(this,"hooks",new qt);m(this,"opacityMesh");m(this,"selfVisible",!0);m(this,"parentVisibleListenerDisposer");m(this,"createOpacityMesh",e=>{const{domWidthPx:n,domHeightPx:o}=e,s=new bc(n,o);return s.position.copy(e.position),s.rotation.copy(e.rotation),s.scale.copy(e.scale),s});m(this,"addParentVisibleListener",()=>{var e;if((e=this.parent)!=null&&e.isCSS3DGroup){const n=this.parent,o=s=>{this.setVisible(s&&this.selfVisible,{setSelfVisible:!1})};n.hooks.on("visibleChange",o),this.parentVisibleListenerDisposer=()=>n.hooks.off("visibleChange",o)}});m(this,"removeParentVisibleListener",()=>{var e;(e=this.parentVisibleListenerDisposer)==null||e.call(this)});if(n.style.pointerEvents=a,this.scale.set(l,l,l),this.cornerPoints=o,this.ratio=s,this.container=n,e.mode&&(this.mode=e.mode),l===s)this.width=c,this.height=u,this.domWidthPx=h,this.domHeightPx=d,this.centerPosition=f;else{const x=s/l;this.width=x*c,this.height=x*u,this.domWidthPx=x*h,this.domHeightPx=x*d,this.centerPosition=new V.Vector3().subVectors(f,o[0]).multiplyScalar(x).add(o[0])}n.classList.add(`${yc}__container`);const A=new V.Vector3().subVectors(o[1],o[0]),p=new V.Vector3().subVectors(o[3],o[0]),v=new V.Vector3().crossVectors(A,p).normalize();this.lookAt(v);const y=this.up.clone().applyQuaternion(this.quaternion),w=p.clone(),P=new V.Vector3().crossVectors(y,w).normalize();this.rotateOnWorldAxis(P,y.angleTo(w)),this.position.copy(f),this.addEventListener("added",()=>{var x;this.mode==="front"&&((x=this.opacityMesh)==null||x.removeFromParent()),this.addParentVisibleListener()}),this.addEventListener("removed",()=>{var x;(x=this.opacityMesh)==null||x.removeFromParent(),this.removeParentVisibleListener()})}setVisible(e,n={setSelfVisible:!0}){n.setSelfVisible&&(this.selfVisible=e),this.visible=e,this.opacityMesh&&(this.opacityMesh.visible=e)}removeFromParent(){var n;const e=this.parent;return e!==null&&e.remove(this),(n=this.opacityMesh)==null||n.removeFromParent(),this}removeOpacityMesh(){var e;return(e=this.opacityMesh)==null||e.removeFromParent(),this.opacityMesh=void 0,this}dispose(){var e;this.container.remove(),this.removeFromParent(),(e=this.opacityMesh)==null||e.removeFromParent()}getOpacityMesh(){if(this.opacityMesh)return this.opacityMesh;{const e=this.createOpacityMesh(this);return this.opacityMesh=e,e}}applyMatrix4(e){var n;super.applyMatrix4(e),(n=this.opacityMesh)==null||n.applyMatrix4(e)}applyQuaternion(e){var n;return super.applyQuaternion(e),(n=this.opacityMesh)==null||n.applyQuaternion(e),this}applyScaleMatrix4(e){var n;this.scale.applyMatrix4(e),(n=this.opacityMesh)==null||n.scale.applyMatrix4(e)}}class Ec extends I.Scene{constructor(){super()}add(...t){return super.add(...t),gt(...t).forEach(e=>{e.mode="front"}),this}}class Ic extends I.Scene{constructor(e){super();m(this,"scene");if(!e)throw new Error("CSS3DBehindScene: scene is required");this.scene=e}add(...e){return super.add(...e),gt(...e).forEach(n=>{n.mode="behind",this.scene.add(n.getOpacityMesh())}),this}remove(...e){return gt(...e).forEach(n=>{var o;(o=n.opacityMesh)==null||o.removeFromParent()}),super.remove(...e),this}}class fa extends I.Group{constructor(e){super();m(this,"isCSS3DGroup",!0);m(this,"mode");m(this,"CSS3DObjectLength",0);m(this,"hooks",new qt);this.mode=e}add(...e){return gt(...e).forEach(n=>{n.mode=this.mode}),super.add(...e),this.updateLength(),this}setVisible(e){this.visible=e,this.hooks.emit("visibleChange",e)}remove(...e){return super.remove(...e),this.updateLength(),this}updateLength(){this.CSS3DObjectLength=gt(this).length}}class kc extends fa{constructor(){super("front")}}class xc extends fa{constructor(e){super("behind");m(this,"scene");if(!e)throw new Error("CSS3DBehindScene: scene is required");this.scene=e}add(...e){return gt(...e).forEach(n=>{this.scene.add(n.getOpacityMesh())}),super.add(...e),this}}const Dc=3,Ri="CSS3DRenderer",cn=`${Ri}@${Dc}`,Vt=()=>{console.error(`${cn} is disposed`)},Se={css3DObjects:[],frontModeStore:{css3DRenderer:new So},behindModeStore:{css3DRenderer:new So}};function Mo(i){return Se.css3DObjects.find(t=>t.id===i)}function Lc(i){Se.frontModeStore.css3DRenderer.setWrapper(i)}function Sc(i){Se.behindModeStore.css3DRenderer.setWrapper(i)}class Nt{constructor(t){m(this,"hooks",new qt);m(this,"state",{enabled:!0,visible:!0,disposed:!1});m(this,"_scene");m(this,"store",{frontModeGroup:new kc});m(this,"create3DElement",(t,e,n)=>{if(this.state.disposed)return Vt();const o=(()=>{const P={ratio:.00216,devicePixelRatio:1,mode:"front",autoRender:!0,container:document.createElement("div"),pointerEvents:"none"};return Object.assign(P,n)})(),s=e.map(gn);if((s==null?void 0:s.length)<4)return console.error(`${cn}: requires 4 point but params may have fewer`);const{ratio:r,devicePixelRatio:a,mode:l,autoRender:c,container:u,pointerEvents:h}=o;let d=!1;const f=this.createObject(s,{ratio:r,dpr:a,container:u,mode:l,pointerEvents:h});Se.css3DObjects.push(f),o.scene&&this.setScene(o.scene);const g=()=>{if(d)return;const P=f.mode==="front"?this.getFrontCSS3DObjectGroup():this.getBehindCSS3DObjectGroup();!P||P.add(f)},A=()=>{d||(g(),this.render(t))},p=P=>this.setVisibleById(f.id,P),v=P=>this.setEnabledById(f.id,P),y=()=>(d=!0,f.removeFromParent(),!0),w=l==="front"?Se.frontModeStore.css3DRenderer:Se.behindModeStore.css3DRenderer;return c&&A(),{id:f.uuid,container:u,css3DObject:f,render:c?void 0:A,show:()=>p(!0),hide:()=>p(!1),setVisible:p,enable:()=>v(!0),disable:()=>v(!1),setEnabled:v,dispose:y,appendToElement:P=>w.setWrapper(P)}});m(this,"setVisibleById",(t,e)=>{var n;(n=Mo(t))==null||n.setVisible(e)});m(this,"setEnabledById",(t,e)=>{const n=Mo(t);if(!n)return;const o=n.mode==="front"?this.getFrontCSS3DObjectGroup({addGroupIfNotExists:!1}):this.getBehindCSS3DObjectGroup({addGroupIfNotExists:!1});!o||(e?o.add(n):o.remove(n))});m(this,"createObject",(t,e)=>{const n=new Pc(O({cornerPoints:t},e));return n.element.classList.add(`${Ri}__container`),n.element.id=`${Ri}__container--${n.uuid}`,n});t&&this.setScene(t)}get scene(){return this._scene||console.error("scene doesn't exist!, please call setScene(scene) first"),this._scene}static get frontModeCSS3DRenderer(){return Se.frontModeStore.css3DRenderer}static get behindModeCSS3DRenderer(){return Se.behindModeStore.css3DRenderer}get frontModeCSS3DRenderer(){return Se.frontModeStore.css3DRenderer}get behindModeCSS3DRenderer(){return Se.behindModeStore.css3DRenderer}setScene(t){this._scene=t}getCurrentState(){return this.state}setState(t,e={userAction:!0}){if(this.state.disposed)return Vt();const n=O({},this.state);this.state=Object.assign(this.state,t),n.visible!==this.state.visible&&(t.visible?this.handleShow():this.handleHide()),n.enabled!==this.state.enabled&&(t.enabled?this.handleEnable():this.handleDisable()),n.disposed!==this.state.disposed&&this.handleDispose(),this.hooks.emit("stateChange",{state:this.state,prevState:n,userAction:e.userAction})}dispose(){this.setState({disposed:!0}),this.hooks.emit("dispose")}show(){return H(this,arguments,function*({userAction:t}={userAction:!0}){if(this.state.disposed)return Vt();this.setState({visible:!0},{userAction:t}),this.hooks.emit("show",{userAction:t})})}hide(){return H(this,arguments,function*({userAction:t}={userAction:!0}){if(this.state.disposed)return Vt();this.setState({visible:!1},{userAction:t}),this.hooks.emit("hide",{userAction:t})})}enable({userAction:t}={userAction:!0}){if(this.state.disposed)return Vt();this.setState({enabled:!0},{userAction:t}),this.hooks.emit("enable",{userAction:t})}disable({userAction:t}={userAction:!0}){if(this.state.disposed)return Vt();this.setState({enabled:!1},{userAction:t}),this.hooks.emit("disable",{userAction:t})}getFrontCSS3DScene({createSceneIfNotExists:t=!1}={}){var n;const e=(n=Se.frontModeStore)==null?void 0:n.css3DScene;if(e)return e;if(t){const o=new Ec;Se.frontModeStore.css3DScene=o}return Se.frontModeStore.css3DScene}getBehindCSS3DScene({createSceneIfNotExists:t=!1}={}){var n,o;const e=(n=Se.behindModeStore)==null?void 0:n.css3DScene;if(e)return e;if(t){const s=(o=Se.behindModeStore.scene)!=null?o:this.scene;if(!s){console.error(`${cn}: scene is required when mode is behind`);return}const r=new Ic(s);Se.behindModeStore.css3DScene=r,Se.behindModeStore.scene=s}return Se.behindModeStore.css3DScene}getFrontCSS3DObjectGroup({addGroupIfNotExists:t=!0}={}){const e=this.getFrontCSS3DScene({createSceneIfNotExists:t});return t&&e&&(e.getObjectById(this.store.frontModeGroup.id)||e.add(this.store.frontModeGroup)),this.store.frontModeGroup}getBehindCSS3DObjectGroup({addGroupIfNotExists:t=!0}={}){var n;const e=this.getBehindCSS3DScene({createSceneIfNotExists:t});if(t&&e&&this.scene){const o=(n=this.store.behindModeGroup)!=null?n:new xc(this.scene);this.store.behindModeGroup=o,e.getObjectById(o.id)||e.add(o)}return this.store.behindModeGroup}render(t){var e,n;if(this.getFrontCSS3DObjectGroup({addGroupIfNotExists:!1}).CSS3DObjectLength>0){const o=this.getFrontCSS3DScene({createSceneIfNotExists:!0});if(!o)return console.error(`${cn}: css3DScene is required when mode is front`);Se.frontModeStore.css3DRenderer.renderEveryFrame(o,t)}if(((n=(e=this.getBehindCSS3DObjectGroup({addGroupIfNotExists:!1}))==null?void 0:e.CSS3DObjectLength)!=null?n:0)>0){const o=this.getBehindCSS3DScene({createSceneIfNotExists:!0});if(!o)return console.error(`${cn}: css3DScene is required when mode is behind`);Se.behindModeStore.css3DRenderer.renderEveryFrame(o,t)}}handleShow(){return H(this,null,function*(){var t;this.store.frontModeGroup.setVisible(!0),(t=this.store.behindModeGroup)==null||t.setVisible(!0)})}handleHide(){return H(this,null,function*(){var t;this.store.frontModeGroup.setVisible(!1),(t=this.store.behindModeGroup)==null||t.setVisible(!1)})}handleEnable(){var t,e;(t=this.getFrontCSS3DScene())==null||t.add(this.store.frontModeGroup),this.store.behindModeGroup&&((e=this.getBehindCSS3DScene())==null||e.add(this.store.behindModeGroup))}handleDisable(){var t,e,n;this.store.frontModeGroup.children.forEach(o=>{o instanceof qn.CSS3DObject&&o.element instanceof Element&&o.element.parentNode!==null&&o.element.remove()}),(t=this.store.behindModeGroup)==null||t.children.forEach(o=>{o instanceof qn.CSS3DObject&&o.element instanceof Element&&o.element.parentNode!==null&&o.element.remove()}),(e=this.getFrontCSS3DScene())==null||e.remove(this.store.frontModeGroup),this.store.behindModeGroup&&((n=this.getBehindCSS3DScene())==null||n.remove(this.store.behindModeGroup))}handleDispose(){this.handleDisable()}}m(Nt,"setFrontModeContainer",Lc),m(Nt,"setBehindModeContainer",Sc);function ma(i){return H(this,null,function*(){return new Promise(t=>{var e;if((e=i.model)!=null&&e.loaded){t();return}else i.once("modelLoaded",()=>t())})})}const rt=document.createElement("div");rt.classList.add("behindFiveElement");rt.style.position="absolute";rt.style.top="0";rt.style.left="0";rt.style.width="100%";rt.style.height="100%";rt.style.pointerEvents="none";function pa(i){var e,n,o,s,r;const t=(r=(n=yi(i.getElement()))!=null?n:yi((e=i.getElement())==null?void 0:e.parentElement))!=null?r:yi((s=(o=i.getElement())==null?void 0:o.parentElement)==null?void 0:s.parentElement);if(t!=null&&t.parentElement)return t.parentElement.insertBefore(rt,t),rt;console.error("Can not find a valid element to insert behindFiveElement. How to fix it: https://github.com/realsee-developer/dnalogel/tree/main/plugins/src/CSS3DRenderPlugin/README.md")}function yi(i){var a;if(!i)return;const t=(a=i.style.position)!=null?a:getComputedStyle(i).position;if(t!=="fixed"&&t!=="absolute"&&t!=="relative")return;const e=getComputedStyle(i),n=e.backgroundColor,o=e.backgroundImage;if(!(n!=="transparent"&&n!=="rgba(0, 0, 0, 0)"&&n!==""||o!=="none"&&o!==""))return i}const Mc="v2.0.1",wi=`CSS3DRenderPlugin@${Mc}`;class Tc extends Nt{constructor(e){super();m(this,"five");m(this,"behindFiveContainer");m(this,"staticPrefix","//vrlab-static.ljcdn.com");m(this,"create3DDomContainer",(e,n)=>{if(this.state.disposed)return;const o=(()=>{var h;(n==null?void 0:n.dpr)!==void 0&&console.warn(`${wi}: please use "config.devicePixelRatio" replace "config.dpr"`);const u={ratio:.00216,devicePixelRatio:(h=n==null?void 0:n.dpr)!=null?h:1,mode:"front",autoRender:!0};return Object.assign(u,n,(n==null?void 0:n.mode)==="behind"?{scene:this.five.scene}:void 0)})(),s=this.five.getElement();if(!s){console.error(`${wi}: five.getElement() is ${s}`);return}const{autoRender:r}=o;o.mode==="behind"&&o.behindFiveContainer&&(this.behindFiveContainer=o.behindFiveContainer);const a=this.create3DElement(this.five.camera,e,me(O({},o),{autoRender:!1}));if(!a)return;const l=()=>{const u=a.css3DObject.mode==="front"?s.parentElement:this.getBehindFiveElement();if(!u)return console.error(`${wi}: wrapper is ${u}`);a.appendToElement(u),a.render()},c=()=>{a.css3DObject.mode==="front"&&l(),a.css3DObject.mode==="behind"&&ma(this.five).then(()=>{l()})};return r&&c(),me(O({},a),{render:r?void 0:c})});this.five=e}disposeAll(){return this.dispose()}setState(...e){const n=super.setState(...e);return this.five.needsRender=!0,n}getBehindFiveElement(){return this.behindFiveContainer?this.behindFiveContainer:(this.behindFiveContainer=pa(this.five),this.behindFiveContainer)}}const Jt=i=>new Tc(i);function Ci(i,t,e=new V.Vector3(1,1,1),n=!1){const o=new la.Line(i,t);return o.setMaterial({dashed:n,color:e,linewidth:1}),o.remove(o.points),o}const zc=i=>{const t={intersection:null,disposers:[]},e=u=>{t.intersection=u},n=()=>{t.intersection=null};i.on("modelLoaded",()=>{i.on("intersectionOnModelUpdate",e),i.on("intersectionHidden",n)}),i.on("dispose",()=>{i.off("intersectionOnModelUpdate",e),i.off("intersectionHidden",n)});const o=(u,h=2,d=.1)=>{const f=h/2,A=c(u,d),p=new V.Group;p.add(Ci(new V.Vector3(A.x+f,A.y,A.z),new V.Vector3(A.x-f,A.y,A.z),new V.Vector3(1,0,0)),Ci(new V.Vector3(A.x,A.y+f,A.z),new V.Vector3(A.x,A.y-f,A.z),new V.Vector3(0,1,0)),Ci(new V.Vector3(A.x,A.y,A.z+f),new V.Vector3(A.x,A.y,A.z-f),new V.Vector3(0,0,1))),i.scene.add(p),i.needsRender=!0;const v=()=>{i.scene.remove(p)};return t.disposers.push(v),{clear:v,pointAxesHelperMesh:p}},s=(u,h=0)=>{var v,y;const d=(v=i==null?void 0:i.camera)==null?void 0:v.position;if(!d)return!1;const f=u.distanceTo(d),g=u.sub(d).normalize(),A=new V.Raycaster(d,g),p=(y=i.model.intersectRaycaster(A))==null?void 0:y[0];return!(p&&p.distance+h<f)},r=()=>t.intersection,a=()=>{var u,h;(h=(u=t.disposers)==null?void 0:u.forEach)==null||h.call(u,d=>d==null?void 0:d()),i.off("intersectionOnModelUpdate",e),i.off("intersectionHidden",n)},l=a,c=(u,h)=>{const d=u.clone();return i.camera.position.clone().sub(d).setLength(h).add(d)};return{intersection:r,pointAxesHelper:o,movePointTowardsCamera:c,destroy:a,dispose:l,canSeePoint:s}};function Y(){}const At=i=>i;function je(i,t){for(const e in t)i[e]=t[e];return i}function Bc(i){return i&&typeof i=="object"&&typeof i.then=="function"}function ga(i){return i()}function To(){return Object.create(null)}function ct(i){i.forEach(ga)}function Zt(i){return typeof i=="function"}function ne(i,t){return i!=i?t==t:i!==t||i&&typeof i=="object"||typeof i=="function"}let Mn;function _e(i,t){return Mn||(Mn=document.createElement("a")),Mn.href=t,i===Mn.href}function jc(i){return Object.keys(i).length===0}function Kt(i,t,e,n){if(i){const o=Aa(i,t,e,n);return i[0](o)}}function Aa(i,t,e,n){return i[1]&&n?je(e.ctx.slice(),i[1](n(t))):e.ctx}function $t(i,t,e,n){if(i[2]&&n){const o=i[2](n(e));if(t.dirty===void 0)return o;if(typeof o=="object"){const s=[],r=Math.max(t.dirty.length,o.length);for(let a=0;a<r;a+=1)s[a]=t.dirty[a]|o[a];return s}return t.dirty|o}return t.dirty}function en(i,t,e,n,o,s){if(o){const r=Aa(t,e,n,s);i.p(r,o)}}function tn(i){if(i.ctx.length>32){const t=[],e=i.ctx.length/32;for(let n=0;n<e;n++)t[n]=-1;return t}return-1}function Te(i){return i==null?"":i}function Pi(i){return i&&Zt(i.destroy)?i.destroy:Y}const va=typeof window!="undefined";let ba=va?()=>window.performance.now():()=>Date.now(),no=va?i=>requestAnimationFrame(i):Y;const Ht=new Set;function ya(i){Ht.forEach(t=>{t.c(i)||(Ht.delete(t),t.f())}),Ht.size!==0&&no(ya)}function wa(i){let t;return Ht.size===0&&no(ya),{promise:new Promise(e=>{Ht.add(t={c:i,f:e})}),abort(){Ht.delete(t)}}}function B(i,t){i.appendChild(t)}function ce(i,t,e){const n=io(i);if(!n.getElementById(t)){const o=z("style");o.id=t,o.textContent=e,Ca(n,o)}}function io(i){if(!i)return document;const t=i.getRootNode?i.getRootNode():i.ownerDocument;return t&&t.host?t:i.ownerDocument}function Vc(i){const t=z("style");return Ca(io(i),t),t.sheet}function Ca(i,t){return B(i.head||i,t),t.sheet}function T(i,t,e){i.insertBefore(t,e||null)}function M(i){i.parentNode&&i.parentNode.removeChild(i)}function at(i,t){for(let e=0;e<i.length;e+=1)i[e]&&i[e].d(t)}function z(i){return document.createElement(i)}function ye(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function ke(i){return document.createTextNode(i)}function $(){return ke(" ")}function fe(){return ke("")}function we(i,t,e,n){return i.addEventListener(t,e,n),()=>i.removeEventListener(t,e,n)}function Pa(i){return function(t){return t.stopPropagation(),i.call(this,t)}}function b(i,t,e){e==null?i.removeAttribute(t):i.getAttribute(t)!==e&&i.setAttribute(t,e)}function Qc(i){return Array.from(i.childNodes)}function Me(i,t){t=""+t,i.wholeText!==t&&(i.data=t)}function L(i,t,e,n){e===null?i.style.removeProperty(t):i.style.setProperty(t,e,n?"important":"")}let Tn;function Oc(){if(Tn===void 0){Tn=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(i){Tn=!0}}return Tn}function tt(i,t){getComputedStyle(i).position==="static"&&(i.style.position="relative");const n=z("iframe");n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1;const o=Oc();let s;return o?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=we(window,"message",r=>{r.source===n.contentWindow&&t()})):(n.src="about:blank",n.onload=()=>{s=we(n.contentWindow,"resize",t)}),B(i,n),()=>{(o||s&&n.contentWindow)&&s(),M(n)}}function q(i,t,e){i.classList[e?"add":"remove"](t)}function Ea(i,t,{bubbles:e=!1,cancelable:n=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(i,e,n,t),o}class Zn{constructor(t=!1){this.is_svg=!1,this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,e,n=null){this.e||(this.is_svg?this.e=ye(e.nodeName):this.e=z(e.nodeName),this.t=e,this.c(t)),this.i(n)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let e=0;e<this.n.length;e+=1)T(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(M)}}const Kn=new Map;let $n=0;function Rc(i){let t=5381,e=i.length;for(;e--;)t=(t<<5)-t^i.charCodeAt(e);return t>>>0}function Fc(i,t){const e={stylesheet:Vc(t),rules:{}};return Kn.set(i,e),e}function Ia(i,t,e,n,o,s,r,a=0){const l=16.666/n;let c=`{
|
|
101
|
+
`;class hc extends uc{constructor(e){super();m(this,"configs");m(this,"clientWidth");m(this,"clientHeight");m(this,"ready",!1);m(this,"uuid",Ge());m(this,"tween");m(this,"tweening",!1);m(this,"container");m(this,"canvas");m(this,"data",{});m(this,"tempLine",{});this.configs=e,this.clientWidth=document.body.clientWidth,this.clientHeight=document.body.clientHeight,this.container=this.ifInsertToDOM(),this.canvas={},this.initCtrl()}get color(){return this.configs.currentColor}get state(){return this.data}get dpr(){return this.configs.DPR||1}ifInsertToDOM(){if(this.container)return this.container;if(this.configs.container)this.configs.container.id="_gl_paintBrush",this.container=this.configs.container;else if(document.getElementById("_gl_paintBrush"))this.container=document.getElementById("_gl_paintBrush");else{const e=document.createElement("div");e.id="_gl_paintBrush",document.body.appendChild(e),this.container=e}return this.container.innerHTML=dc,this.container}initCanvas(e){const n=document.createElement("canvas");n.className=e,n.width=this.clientWidth,n.height=this.clientHeight;const o=n.getContext("2d");if(!!o)return o.lineWidth=5*this.dpr,o.lineCap="round",o.lineJoin="round",this.container.appendChild(n),n}initCtrl(){const e=document.createElement("div");e.className="_paintBrush-ctrl";const n=document.createElement("div");n.className="_paintBrush-ctrlinner";const o=document.createElement("a");o.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--undo",o.addEventListener("click",a=>{var d;if(a.stopPropagation(),this.configs.onClickUndo&&this.configs.onClickUndo(),!this.canvas[this.uuid]||!this.data[this.uuid]||this.data[this.uuid].length===0)return;const l=this.data[this.uuid].pop();l&&this.emitStateChange({type:ot.Undo,color:this.color,ready:this.ready,state:l,uuid:this.uuid});const c=(d=this.canvas[this.uuid])==null?void 0:d.getContext("2d");if(!this.canvas[this.uuid])return;const{width:u,height:h}=this.canvas[this.uuid];c&&c.clearRect(0,0,u,h),this.data[this.uuid].forEach(f=>this.handleDrawLine(this.uuid,f,{withUndo:!0}))});const s=document.createElement("a");return s.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--close",s.addEventListener("click",a=>{a.stopPropagation(),this.closeBrush(),this.configs.onClickClose&&this.configs.onClickClose()}),[o,s].forEach(a=>{const l=document.createElement("i");l.className="brush-icon";const c=document.createElement("span");c.className="brush-txt",c.innerText=a.className.endsWith("undo")?this.configs.onUndoText:this.configs.onExitText,a.appendChild(l),a.appendChild(c)}),n.appendChild(o),n.appendChild(s),e.appendChild(n),this.container.appendChild(e),e}openBrush(){if(this.ready)return;this.canvas[this.uuid]||(this.canvas[this.uuid]=this.initCanvas("_paintBrush-canvas")),this.container.className="brushing";const e=this.canvas[this.uuid];e.getContext("2d").clearRect(0,0,e.width,e.height),this.openBrushHandle(),this.ready=!0,this.emit("readyChange",!0)}closeBrush(){!this.ready||(this.container.className="",this.data={},this.tempLine={},Object.keys(this.canvas).forEach(e=>{this.canvas[e].ontouchstart=()=>!1,this.canvas[e].ontouchmove=()=>!1,this.canvas[e].ontouchend=()=>!1,this.canvas[e].ontouchcancel=()=>!1;const n=this.canvas[e].getContext("2d");n&&n.clearRect(0,0,this.canvas[e].width,this.canvas[e].height)}),this.ready=!1,this.emit("readyChange",!1),this.emitStateChange({type:ot.Exit,color:this.color,ready:!1,uuid:this.uuid}))}updateCurrentColor(e){const n=this.canvas[this.uuid];if(!n)return;const o=n.getContext("2d");!o||(this.configs.currentColor=e,o.strokeStyle=e)}openBrushHandle(){const e=this.canvas[this.uuid];if(!e)return;const n=e.getContext("2d");if(!n)return;const o=this.color||"#6D92FF";n.strokeStyle=o;let s=null,r=[],a,l=[],c=0;const u=(h,d,f)=>{const g=this.color||"#ff0000";n.strokeStyle=g,n.beginPath(),n.moveTo(h.x,h.y),n.quadraticCurveTo(d.x,d.y,f.x,f.y),n.stroke()};e.onmousedown=h=>{h.preventDefault(),c=Date.now();const d=h.clientX,f=h.clientY;r=[],r.push({x:d,y:f}),s={x:d,y:f},a=xn({x:d,y:f},this.clientWidth,this.clientHeight),l=[]},e.onmousemove=h=>{if(h.preventDefault(),!s)return;const d=Number(h.clientX),f=Number(h.clientY);if(Math.abs(d-s.x)<5&&Math.abs(f-s.y)<5||(r.push({x:d,y:f}),l.push(xn({x:d,y:f},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:g,end:A}=Dn(r);!g||!A||(u(s,g,A),s=A)},e.onmouseup=h=>{if(h.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const d=Date.now()-c,f={move:Object.assign({},a),uuid:this.uuid,line:[...l],color:this.color,duration:d<1280?d:d<2e3?1280:0};this.data[this.uuid].push(f),Nn(()=>{this.emitStateChange({type:ot.Drawline,color:this.color,ready:this.ready,state:f,uuid:this.uuid})})},e.ontouchstart=h=>{h.preventDefault(),c=Date.now();const d=h.touches[0].clientX,f=h.touches[0].clientY;r=[],r.push({x:d,y:f}),s={x:d,y:f},a=xn({x:d,y:f},this.clientWidth,this.clientHeight),l=[]},e.ontouchmove=h=>{if(h.preventDefault(),!s)return;const d=Number(h.touches[0].clientX),f=Number(h.touches[0].clientY);if(Math.abs(d-s.x)<5&&Math.abs(f-s.y)<5||(r.push({x:d,y:f}),l.push(xn({x:d,y:f},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:g,end:A}=Dn(r);!g||!A||(u(s,g,A),s=A)},e.ontouchend=e.ontouchcancel=h=>{if(h.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const d=Date.now()-c,f={move:Object.assign({},a),line:[...l],uuid:this.uuid,color:this.color,duration:d<1280?d:d<2e3?1280:0};this.data[this.uuid].push(f),Nn(()=>{this.emitStateChange({type:ot.Drawline,color:this.color,ready:this.ready,state:f,uuid:this.uuid})})}}emitStateChange(e,n=!0){if(e.type!==ot.Drawline){this.emit("stateChange",e,n);return}const o=Date.now(),s=e.state;if(!s||!s.line)return;const r=Math.ceil(s.line.length/100);for(let a=0;a<r;a++){const l={uuid:this.uuid,color:this.color,ready:this.ready,type:e.type,state:{uuid:this.uuid,move:s.move,duration:s.duration,color:this.color,line:s.line.slice(a*100,(a+1)*100)},timestamp:o,end:a===r-1};rc(a,20,()=>{this.emit("stateChange",l,n)})}}action(e){const{ready:n,type:o,uuid:s}=e;if(!n&&this.ready){this.closeBrush();return}if(n&&!this.ready){this.openBrush();return}if(!!this.ready)switch(o){case ot.Drawline:const{state:r,timestamp:a,end:l}=e;if(!a||!r)return;this.tempLine[a]=[].concat(this.tempLine[a]||[],r.line),l&&(Object.assign(r,{line:this.tempLine[a]}),this.handleDrawLine(s,r,{},()=>delete this.tempLine[a]));break;case ot.Undo:this.handleUndo(s);break}}handleDrawLine(e,n,{withUndo:o=!1},s=da){!n||Object.prototype.toString.call(n)!="[object Object]"||Object.keys(n).length===0||sc(()=>new Promise(r=>{if(o||(this.canvas[e]||(this.canvas[e]=this.initCanvas("_paintBrush-canvas--sync")),this.data[e]||(this.data[e]=[]),this.data[e].push(n)),!this.canvas[e])return;const a=this.canvas[e].getContext("2d");if(!a)return;const{line:l=[],color:c="black",duration:u=0,uuid:h}=n,d=bi(n.move||{},this.clientWidth,this.clientHeight);let f=[d];if(a.strokeStyle=c,a.beginPath(),a.moveTo(d.x,d.y),u&&!o){let g=[];const A=this;A.tween=lc({step:0},{step:l.length-1},u).onUpdate(({step:p})=>{var y;if(A.tweening=!0,!A.ready)return a.clearRect(0,0,A.canvas[h].width,A.canvas[h].height),(y=A.tween)==null?void 0:y.stop();const v=Math.floor(p);if(!g.find(w=>w===v)){if(g.push(v),f.push(bi(l[v],A.clientWidth,A.clientHeight)),f.length<3)return;const{control:w,end:P}=Dn(f);if(!w||!P)return;a.quadraticCurveTo(w.x,w.y,P.x,P.y),a.stroke()}}).onComplete(p=>{A.tween=void 0,A.tweening=!1,g=[],f=[],s&&s(),r()})}else{for(let g=0;g<l.length;g++){if(f.push(bi(l[g],this.clientWidth,this.clientHeight)),f.length<3)continue;const{control:A,end:p}=Dn(f);!A||!p||a.quadraticCurveTo(A.x,A.y,p.x,p.y)}a.stroke(),f=[],s&&s(),r()}}))}handleUndo(e){if(!this.canvas[e]||!this.data[e]||this.data[e].length===0)return;this.data[e].pop();const n=()=>{var s;const o=(s=this.canvas[e])==null?void 0:s.getContext("2d");o&&o.clearRect(0,0,this.canvas[e].width,this.canvas[e].height),this.data[e].forEach(r=>this.handleDrawLine(e,r,{withUndo:!0}))};if(this.tween&&this.tweening){this.tween.stop(),Nn(n,60);return}n()}destroyBrush(){this.closeBrush(),this.ready=!1,this.emit("readyChange",!0)}}class fc{constructor(t={}){m(this,"controller");const e=Object.assign({currentColor:"#f44336",onUndoText:"\u56DE\u9000",onExitText:"\u5173\u95ED"},t);this.controller=new hc(e)}on(t,e){this.controller.on(t,e)}off(t,e){this.controller.off(t,e)}once(t,e){this.controller.once(t,e)}show(){this.controller.openBrush()}action(t){this.controller.action(t)}get state(){return this.controller.state}get configs(){return this.controller.configs}dispose(){return this.controller.destroyBrush()}setCurrentColor(t){this.controller.updateCurrentColor(t)}}const mc=(i,t)=>{var U,j;let e=(j=(U=t==null?void 0:t.initialState)==null?void 0:U.enabled)!=null?j:!0,n=!1,o=!0,s=null;const a=R(R({},{lookAtCurrentCamera:!1,lockedPanoIndex:null,lockedLatitude:null,lockedLongitude:null}),t==null?void 0:t.config),l=new I.Scene,c=new Ce.Camera(60);let u=new I.Object3D,h,d;{const F=new I.DirectionalLight(16777215,.5);F.position.copy(new I.Vector3(1,1,1)),l.add(F)}{const F=new I.DirectionalLight(16777215,.3);l.add(F)}{const F=new I.AmbientLight(16777215,.3);l.add(F)}l.add(u);const f=()=>{if(n)return;h=k(i.model,c.fov,c.aspect),d=i.model.bounding.getCenter(new I.Vector3),l.remove(u),u=W(i.model),l.add(u),n=!0,S();function F(X){const G=X.clone();return G.uniforms.modelAlpha.value=1,G.uniforms.map.value&&(G.uniforms.map.value.needsUpdate=!0),G}function W(X){if(X instanceof I.Mesh){const G=X.geometry,ee=Array.isArray(X.material)?X.material.map(F):F(X.material);return new I.Mesh(G,ee)}else if(X instanceof I.Group){const G=new I.Group;return X.children.forEach(ee=>G.add(W(ee))),G}else{const G=new I.Object3D;return X.children.forEach(ee=>G.add(W(ee))),G}}},g=()=>{if(!!i.renderer)return s||(s=new I.WebGLRenderer({antialias:!1,alpha:!0}),s.setPixelRatio(i.renderer.getPixelRatio()),s.outputEncoding=I.sRGBEncoding,s.setClearColor(1579548,0),s.autoClear=!0),s},A=()=>{u.traverse(F=>{F instanceof I.Mesh&&[].concat(F.material).forEach(X=>X.dispose())}),l.remove(u),u=new I.Object3D,l.add(u),n=!1,S()},p=()=>{!e||n||f()},v=()=>{e||(e=!0,l.add(u),!n&&i.model.loaded&&f(),S())},y=()=>{!e||(l.remove(u),o=!0,x(),e=!1)},w=(F,W={})=>{const X=g();if(!X)return;F.appendChild(X.domElement),P(W);const G=window.getComputedStyle(F).position;G!=="relative"&&G!=="absolute"&&G!=="fixed"&&G!=="sticky"&&(F.style.position="relative")},P=(F={})=>{if(!s)return;const X=s.domElement.parentNode;if(X!=null&&X.nodeName){const{width:G=X.offsetWidth,height:ee=X.offsetHeight}=F;s.setSize(G,ee),c.aspect=G/ee,c.updateProjectionMatrix()}S()};function k(F,W,X){const G=F.bounding,ee=Math.pow(Math.pow(G.max.x-G.min.x+1,2)+Math.pow(G.max.y-G.min.y+1,2)+Math.pow(G.max.z-G.min.z+1,2),1/2);let N=ee/2/Math.tan(Math.PI*W/360);return X<1&&(N=N/X),isNaN(N)?ee:N}function C(F){return i.work.observers[F].standingPosition.clone()}const S=()=>{if(!e||!h||!d)return;const F=i.getPose();F.fov=c.fov,F.offset=d,F.distance=h,typeof a.lockedLatitude=="number"&&(F.latitude=a.lockedLatitude),typeof a.lockedLongitude=="number"&&(F.longitude=a.lockedLongitude),typeof a.lockedPanoIndex=="number"&&(F.offset=C(a.lockedPanoIndex)),a.lookAtCurrentCamera&&(F.offset=i.camera.position.clone().setY(i.camera.position.y+1)),c.setFromPose(F),o=!0},x=()=>{!e||o!==!0||!s||!s.domElement.parentNode||s.domElement.parentNode.offsetWidth===0||(s.render(l,c),o=!1)},Q=()=>{s&&s.dispose(),s=null},_=F=>{Object.assign(a,F),S()},O=()=>({enabled:e});return Object.assign(window,{camera:c}),i.on("modelLoaded",p),i.on("modelWillLoad",A),i.on("cameraDirectionUpdate",S),i.on("dispose",Q),i.on("renderFrame",x),i.on("cameraPositionUpdate",S),{appendTo:w,refresh:P,changeConfigs:_,enable:v,disable:y,getCurrentState:O}};function gt(...i){const t=[];return i.forEach(e=>{e.isCSS3DObjectPlus?t.push(e):t.push(...gt(...e.children))}),t}function Jn(i,t){const e=Math.round(i);return e%2===0?e:e+Number(t!=null&&t.floor?-1:1)}function pc(i,t,e=!0){if(!i)return console.error("createResizeObserver: element is undefined"),{observe:()=>{},unobserve:()=>{}};const n=()=>{const s=Jn(i.clientWidth,{floor:!0}),r=Jn(i.clientHeight,{floor:!0});t(s,r)};if(typeof ResizeObserver=="undefined"||!ResizeObserver)return console.warn("createResizeObserver: ResizeObserver is undefined"),{observe:()=>n(),unobserve:()=>{}};const o=new ResizeObserver(n);return e&&n(),{observe:()=>o.observe(i),unobserve:()=>o.unobserve(i)}}class So extends qn.CSS3DRenderer{constructor(){super();m(this,"wrapper");m(this,"requestAnimationFrameId");m(this,"resizeDisoper");this.domElement.style.position="absolute",this.domElement.style.top="0",this.domElement.style.left="0",this.domElement.style.userSelect="none",this.domElement.style.pointerEvents="none"}setWrapper(e){if(!e)throw new Error("CSS3DRenderer: wrapper is required");if(e.contains(this.domElement))return;const n=this.wrapper;return n&&n.contains(this.domElement)&&this.domElement.remove(),this.appendToElement(e),this.wrapper=e,this}appendToElement(e){e.appendChild(this.domElement);const n=(r,a)=>this.setSize(r,a),{observe:o,unobserve:s}=pc(e,n,!0);o(),this.resizeDisoper=s,this.wrapper=e}renderEveryFrame(e,n){if(this.wrapper||console.warn("wrapper is not find, creating a html element and call setWrapper(wrapper)",this,e),this.requestAnimationFrameId)return console.warn("CSS3DRenderer: render is running");const o=()=>{this.requestAnimationFrameId=requestAnimationFrame(o),!!e.visible&>(e).length!==0&&this.render(e,n)};o()}stopRender(){this.requestAnimationFrameId&&cancelAnimationFrame(this.requestAnimationFrameId)}dispose(){var e;this.stopRender(),(e=this.resizeDisoper)==null||e.call(this),this.domElement.remove()}}function gc(i){return typeof Symbol=="undefined"?`$Symbol<${i}>$`:Symbol(i)}const hn=gc("$$EVENT$$");function Sn(i){return i[hn]||(i[hn]={}),i[hn]}function Ac(i){i[hn]||delete i[hn]}class qt{hasListener(t){const e=Sn(this);return Boolean((e==null?void 0:e[t])&&e[t].length>0)}on(t,e,n){const o=Sn(this);return o[t]||(o[t]=[]),o[t].push([e,n||!1]),()=>this.off(t,e)}once(t,e){return this.on(t,e,!0)}off(t,e){if(t===void 0){Ac(this);return}const n=Sn(this);if(n[t]||(n[t]=[]),e===void 0){n[t].length=0;return}let o=0;for(;o<n[t].length&&n[t][o][0]!==e;o++);o<n[t].length&&n[t].splice(o,1)}emit(t,...e){let n=!1;const s=Sn(this)[t]||[];for(let r of s.slice()){const[a,l=!1]=r,c=a(...e);l&&this.off(t,a),c===!1&&(n=!0)}return n}}function to(...i){const t=new V.Vector3;return i.forEach(e=>{t.add(e)}),t.divideScalar(i.length),t}const vc=({x:i,y:t,z:e})=>new V.Vector3(i,t,e),ft=i=>new V.Vector3().fromArray(i),gn=i=>i instanceof V.Vector3?i:Array.isArray(i)?ft(i):vc(i);class bc extends I.Mesh{constructor(e,n){const o=new I.MeshBasicMaterial({opacity:0,color:0,transparent:!1,side:I.DoubleSide}),s=new I.PlaneGeometry(e,n);super(s,o);m(this,"name","opacity-mesh")}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}}const ha=1,yc=`CSS3DObjectPlus@${ha}`,wc=.00216,Cc=.003;class Pc extends qn.CSS3DObject{constructor(e){var k,C,S;const n=e.container,o=e.cornerPoints,s=(k=e.ratio)!=null?k:Cc,r=(C=e.dpr)!=null?C:1,a=(S=e.pointerEvents)!=null?S:"auto",l=Math.max(wc,s),c=o[0].distanceTo(o[1]),u=o[1].distanceTo(o[2]),h=Jn(c/s*r),d=Jn(u/s*r),f=to(...o);let g;if(l===s)n.style.width=`${h}px`,n.style.height=`${d}px`,g=n;else{const x=document.createElement("div");x.style.width=`${h}px`,x.style.height=`${d}px`,x.style.pointerEvents="none";const Q=s/l;n.style.position="absolute",n.style.left="0",n.style.top="0",n.style.width=`${Q*h}px`,n.style.height=`${Q*d}px`,x.appendChild(n),g=x}super(g);m(this,"version",ha);m(this,"isCSS3DObjectPlus",!0);m(this,"container");m(this,"width");m(this,"height");m(this,"domWidthPx");m(this,"domHeightPx");m(this,"cornerPoints");m(this,"centerPosition");m(this,"ratio");m(this,"mode","front");m(this,"hooks",new qt);m(this,"opacityMesh");m(this,"selfVisible",!0);m(this,"parentVisibleListenerDisposer");m(this,"createOpacityMesh",e=>{const{domWidthPx:n,domHeightPx:o}=e,s=new bc(n,o);return s.position.copy(e.position),s.rotation.copy(e.rotation),s.scale.copy(e.scale),s});m(this,"addParentVisibleListener",()=>{var e;if((e=this.parent)!=null&&e.isCSS3DGroup){const n=this.parent,o=s=>{this.setVisible(s&&this.selfVisible,{setSelfVisible:!1})};n.hooks.on("visibleChange",o),this.parentVisibleListenerDisposer=()=>n.hooks.off("visibleChange",o)}});m(this,"removeParentVisibleListener",()=>{var e;(e=this.parentVisibleListenerDisposer)==null||e.call(this)});if(n.style.pointerEvents=a,this.scale.set(l,l,l),this.cornerPoints=o,this.ratio=s,this.container=n,e.mode&&(this.mode=e.mode),l===s)this.width=c,this.height=u,this.domWidthPx=h,this.domHeightPx=d,this.centerPosition=f;else{const x=s/l;this.width=x*c,this.height=x*u,this.domWidthPx=x*h,this.domHeightPx=x*d,this.centerPosition=new V.Vector3().subVectors(f,o[0]).multiplyScalar(x).add(o[0])}n.classList.add(`${yc}__container`);const A=new V.Vector3().subVectors(o[1],o[0]),p=new V.Vector3().subVectors(o[3],o[0]),v=new V.Vector3().crossVectors(A,p).normalize();this.lookAt(v);const y=this.up.clone().applyQuaternion(this.quaternion),w=p.clone(),P=new V.Vector3().crossVectors(y,w).normalize();this.rotateOnWorldAxis(P,y.angleTo(w)),this.position.copy(f),this.addEventListener("added",()=>{var x;this.mode==="front"&&((x=this.opacityMesh)==null||x.removeFromParent()),this.addParentVisibleListener()}),this.addEventListener("removed",()=>{var x;(x=this.opacityMesh)==null||x.removeFromParent(),this.removeParentVisibleListener()})}setVisible(e,n={setSelfVisible:!0}){n.setSelfVisible&&(this.selfVisible=e),this.visible=e,this.opacityMesh&&(this.opacityMesh.visible=e)}removeFromParent(){var n;const e=this.parent;return e!==null&&e.remove(this),(n=this.opacityMesh)==null||n.removeFromParent(),this}removeOpacityMesh(){var e;return(e=this.opacityMesh)==null||e.removeFromParent(),this.opacityMesh=void 0,this}dispose(){var e;this.container.remove(),this.removeFromParent(),(e=this.opacityMesh)==null||e.removeFromParent()}getOpacityMesh(){if(this.opacityMesh)return this.opacityMesh;{const e=this.createOpacityMesh(this);return this.opacityMesh=e,e}}applyMatrix4(e){var n;super.applyMatrix4(e),(n=this.opacityMesh)==null||n.applyMatrix4(e)}applyQuaternion(e){var n;return super.applyQuaternion(e),(n=this.opacityMesh)==null||n.applyQuaternion(e),this}applyScaleMatrix4(e){var n;this.scale.applyMatrix4(e),(n=this.opacityMesh)==null||n.scale.applyMatrix4(e)}}class Ec extends I.Scene{constructor(){super()}add(...t){return super.add(...t),gt(...t).forEach(e=>{e.mode="front"}),this}}class Ic extends I.Scene{constructor(e){super();m(this,"scene");if(!e)throw new Error("CSS3DBehindScene: scene is required");this.scene=e}add(...e){return super.add(...e),gt(...e).forEach(n=>{n.mode="behind",this.scene.add(n.getOpacityMesh())}),this}remove(...e){return gt(...e).forEach(n=>{var o;(o=n.opacityMesh)==null||o.removeFromParent()}),super.remove(...e),this}}class fa extends I.Group{constructor(e){super();m(this,"isCSS3DGroup",!0);m(this,"mode");m(this,"CSS3DObjectLength",0);m(this,"hooks",new qt);this.mode=e}add(...e){return gt(...e).forEach(n=>{n.mode=this.mode}),super.add(...e),this.updateLength(),this}setVisible(e){this.visible=e,this.hooks.emit("visibleChange",e)}remove(...e){return super.remove(...e),this.updateLength(),this}updateLength(){this.CSS3DObjectLength=gt(this).length}}class kc extends fa{constructor(){super("front")}}class xc extends fa{constructor(e){super("behind");m(this,"scene");if(!e)throw new Error("CSS3DBehindScene: scene is required");this.scene=e}add(...e){return gt(...e).forEach(n=>{this.scene.add(n.getOpacityMesh())}),super.add(...e),this}}const Dc=3,Oi="CSS3DRenderer",cn=`${Oi}@${Dc}`,Vt=()=>{console.error(`${cn} is disposed`)},Se={css3DObjects:[],frontModeStore:{css3DRenderer:new So},behindModeStore:{css3DRenderer:new So}};function Mo(i){return Se.css3DObjects.find(t=>t.id===i)}function Lc(i){Se.frontModeStore.css3DRenderer.setWrapper(i)}function Sc(i){Se.behindModeStore.css3DRenderer.setWrapper(i)}class Nt{constructor(t){m(this,"hooks",new qt);m(this,"state",{enabled:!0,visible:!0,disposed:!1});m(this,"_scene");m(this,"store",{frontModeGroup:new kc});m(this,"create3DElement",(t,e,n)=>{if(this.state.disposed)return Vt();const o=(()=>{const P={ratio:.00216,devicePixelRatio:1,mode:"front",autoRender:!0,container:document.createElement("div"),pointerEvents:"none"};return Object.assign(P,n)})(),s=e.map(gn);if((s==null?void 0:s.length)<4)return console.error(`${cn}: requires 4 point but params may have fewer`);const{ratio:r,devicePixelRatio:a,mode:l,autoRender:c,container:u,pointerEvents:h}=o;let d=!1;const f=this.createObject(s,{ratio:r,dpr:a,container:u,mode:l,pointerEvents:h});Se.css3DObjects.push(f),o.scene&&this.setScene(o.scene);const g=()=>{if(d)return;const P=f.mode==="front"?this.getFrontCSS3DObjectGroup():this.getBehindCSS3DObjectGroup();!P||P.add(f)},A=()=>{d||(g(),this.render(t))},p=P=>this.setVisibleById(f.id,P),v=P=>this.setEnabledById(f.id,P),y=()=>(d=!0,f.removeFromParent(),!0),w=l==="front"?Se.frontModeStore.css3DRenderer:Se.behindModeStore.css3DRenderer;return c&&A(),{id:f.uuid,container:u,css3DObject:f,render:c?void 0:A,show:()=>p(!0),hide:()=>p(!1),setVisible:p,enable:()=>v(!0),disable:()=>v(!1),setEnabled:v,dispose:y,appendToElement:P=>w.setWrapper(P)}});m(this,"setVisibleById",(t,e)=>{var n;(n=Mo(t))==null||n.setVisible(e)});m(this,"setEnabledById",(t,e)=>{const n=Mo(t);if(!n)return;const o=n.mode==="front"?this.getFrontCSS3DObjectGroup({addGroupIfNotExists:!1}):this.getBehindCSS3DObjectGroup({addGroupIfNotExists:!1});!o||(e?o.add(n):o.remove(n))});m(this,"createObject",(t,e)=>{const n=new Pc(R({cornerPoints:t},e));return n.element.classList.add(`${Oi}__container`),n.element.id=`${Oi}__container--${n.uuid}`,n});t&&this.setScene(t)}get scene(){return this._scene||console.error("scene doesn't exist!, please call setScene(scene) first"),this._scene}static get frontModeCSS3DRenderer(){return Se.frontModeStore.css3DRenderer}static get behindModeCSS3DRenderer(){return Se.behindModeStore.css3DRenderer}get frontModeCSS3DRenderer(){return Se.frontModeStore.css3DRenderer}get behindModeCSS3DRenderer(){return Se.behindModeStore.css3DRenderer}setScene(t){this._scene=t}getCurrentState(){return this.state}setState(t,e={userAction:!0}){if(this.state.disposed)return Vt();const n=R({},this.state);this.state=Object.assign(this.state,t),n.visible!==this.state.visible&&(t.visible?this.handleShow():this.handleHide()),n.enabled!==this.state.enabled&&(t.enabled?this.handleEnable():this.handleDisable()),n.disposed!==this.state.disposed&&this.handleDispose(),this.hooks.emit("stateChange",{state:this.state,prevState:n,userAction:e.userAction})}dispose(){this.setState({disposed:!0}),this.hooks.emit("dispose")}show(){return H(this,arguments,function*({userAction:t}={userAction:!0}){if(this.state.disposed)return Vt();this.setState({visible:!0},{userAction:t}),this.hooks.emit("show",{userAction:t})})}hide(){return H(this,arguments,function*({userAction:t}={userAction:!0}){if(this.state.disposed)return Vt();this.setState({visible:!1},{userAction:t}),this.hooks.emit("hide",{userAction:t})})}enable({userAction:t}={userAction:!0}){if(this.state.disposed)return Vt();this.setState({enabled:!0},{userAction:t}),this.hooks.emit("enable",{userAction:t})}disable({userAction:t}={userAction:!0}){if(this.state.disposed)return Vt();this.setState({enabled:!1},{userAction:t}),this.hooks.emit("disable",{userAction:t})}getFrontCSS3DScene({createSceneIfNotExists:t=!1}={}){var n;const e=(n=Se.frontModeStore)==null?void 0:n.css3DScene;if(e)return e;if(t){const o=new Ec;Se.frontModeStore.css3DScene=o}return Se.frontModeStore.css3DScene}getBehindCSS3DScene({createSceneIfNotExists:t=!1}={}){var n,o;const e=(n=Se.behindModeStore)==null?void 0:n.css3DScene;if(e)return e;if(t){const s=(o=Se.behindModeStore.scene)!=null?o:this.scene;if(!s){console.error(`${cn}: scene is required when mode is behind`);return}const r=new Ic(s);Se.behindModeStore.css3DScene=r,Se.behindModeStore.scene=s}return Se.behindModeStore.css3DScene}getFrontCSS3DObjectGroup({addGroupIfNotExists:t=!0}={}){const e=this.getFrontCSS3DScene({createSceneIfNotExists:t});return t&&e&&(e.getObjectById(this.store.frontModeGroup.id)||e.add(this.store.frontModeGroup)),this.store.frontModeGroup}getBehindCSS3DObjectGroup({addGroupIfNotExists:t=!0}={}){var n;const e=this.getBehindCSS3DScene({createSceneIfNotExists:t});if(t&&e&&this.scene){const o=(n=this.store.behindModeGroup)!=null?n:new xc(this.scene);this.store.behindModeGroup=o,e.getObjectById(o.id)||e.add(o)}return this.store.behindModeGroup}render(t){var e,n;if(this.getFrontCSS3DObjectGroup({addGroupIfNotExists:!1}).CSS3DObjectLength>0){const o=this.getFrontCSS3DScene({createSceneIfNotExists:!0});if(!o)return console.error(`${cn}: css3DScene is required when mode is front`);Se.frontModeStore.css3DRenderer.renderEveryFrame(o,t)}if(((n=(e=this.getBehindCSS3DObjectGroup({addGroupIfNotExists:!1}))==null?void 0:e.CSS3DObjectLength)!=null?n:0)>0){const o=this.getBehindCSS3DScene({createSceneIfNotExists:!0});if(!o)return console.error(`${cn}: css3DScene is required when mode is behind`);Se.behindModeStore.css3DRenderer.renderEveryFrame(o,t)}}handleShow(){return H(this,null,function*(){var t;this.store.frontModeGroup.setVisible(!0),(t=this.store.behindModeGroup)==null||t.setVisible(!0)})}handleHide(){return H(this,null,function*(){var t;this.store.frontModeGroup.setVisible(!1),(t=this.store.behindModeGroup)==null||t.setVisible(!1)})}handleEnable(){var t,e;(t=this.getFrontCSS3DScene())==null||t.add(this.store.frontModeGroup),this.store.behindModeGroup&&((e=this.getBehindCSS3DScene())==null||e.add(this.store.behindModeGroup))}handleDisable(){var t,e,n;this.store.frontModeGroup.children.forEach(o=>{o instanceof qn.CSS3DObject&&o.element instanceof Element&&o.element.parentNode!==null&&o.element.remove()}),(t=this.store.behindModeGroup)==null||t.children.forEach(o=>{o instanceof qn.CSS3DObject&&o.element instanceof Element&&o.element.parentNode!==null&&o.element.remove()}),(e=this.getFrontCSS3DScene())==null||e.remove(this.store.frontModeGroup),this.store.behindModeGroup&&((n=this.getBehindCSS3DScene())==null||n.remove(this.store.behindModeGroup))}handleDispose(){this.handleDisable()}}m(Nt,"setFrontModeContainer",Lc),m(Nt,"setBehindModeContainer",Sc);function ma(i){return H(this,null,function*(){return new Promise(t=>{var e;if((e=i.model)!=null&&e.loaded){t();return}else i.once("modelLoaded",()=>t())})})}const rt=document.createElement("div");rt.classList.add("behindFiveElement");rt.style.position="absolute";rt.style.top="0";rt.style.left="0";rt.style.width="100%";rt.style.height="100%";rt.style.pointerEvents="none";function pa(i){var e,n,o,s,r;const t=(r=(n=yi(i.getElement()))!=null?n:yi((e=i.getElement())==null?void 0:e.parentElement))!=null?r:yi((s=(o=i.getElement())==null?void 0:o.parentElement)==null?void 0:s.parentElement);if(t!=null&&t.parentElement)return t.parentElement.insertBefore(rt,t),rt;console.error("Can not find a valid element to insert behindFiveElement. How to fix it: https://github.com/realsee-developer/dnalogel/tree/main/plugins/src/CSS3DRenderPlugin/README.md")}function yi(i){var a;if(!i)return;const t=(a=i.style.position)!=null?a:getComputedStyle(i).position;if(t!=="fixed"&&t!=="absolute"&&t!=="relative")return;const e=getComputedStyle(i),n=e.backgroundColor,o=e.backgroundImage;if(!(n!=="transparent"&&n!=="rgba(0, 0, 0, 0)"&&n!==""||o!=="none"&&o!==""))return i}const Mc="v2.0.1",wi=`CSS3DRenderPlugin@${Mc}`;class Tc extends Nt{constructor(e){super();m(this,"five");m(this,"behindFiveContainer");m(this,"staticPrefix","//vrlab-static.ljcdn.com");m(this,"create3DDomContainer",(e,n)=>{if(this.state.disposed)return;const o=(()=>{var h;(n==null?void 0:n.dpr)!==void 0&&console.warn(`${wi}: please use "config.devicePixelRatio" replace "config.dpr"`);const u={ratio:.00216,devicePixelRatio:(h=n==null?void 0:n.dpr)!=null?h:1,mode:"front",autoRender:!0};return Object.assign(u,n,(n==null?void 0:n.mode)==="behind"?{scene:this.five.scene}:void 0)})(),s=this.five.getElement();if(!s){console.error(`${wi}: five.getElement() is ${s}`);return}const{autoRender:r}=o;o.mode==="behind"&&o.behindFiveContainer&&(this.behindFiveContainer=o.behindFiveContainer);const a=this.create3DElement(this.five.camera,e,me(R({},o),{autoRender:!1}));if(!a)return;const l=()=>{const u=a.css3DObject.mode==="front"?s.parentElement:this.getBehindFiveElement();if(!u)return console.error(`${wi}: wrapper is ${u}`);a.appendToElement(u),a.render()},c=()=>{a.css3DObject.mode==="front"&&l(),a.css3DObject.mode==="behind"&&ma(this.five).then(()=>{l()})};return r&&c(),me(R({},a),{render:r?void 0:c})});this.five=e}disposeAll(){return this.dispose()}setState(...e){const n=super.setState(...e);return this.five.needsRender=!0,n}getBehindFiveElement(){return this.behindFiveContainer?this.behindFiveContainer:(this.behindFiveContainer=pa(this.five),this.behindFiveContainer)}}const Jt=i=>new Tc(i);function Ci(i,t,e=new V.Vector3(1,1,1),n=!1){const o=new la.Line(i,t);return o.setMaterial({dashed:n,color:e,linewidth:1}),o.remove(o.points),o}const zc=i=>{const t={intersection:null,disposers:[]},e=u=>{t.intersection=u},n=()=>{t.intersection=null};i.on("modelLoaded",()=>{i.on("intersectionOnModelUpdate",e),i.on("intersectionHidden",n)}),i.on("dispose",()=>{i.off("intersectionOnModelUpdate",e),i.off("intersectionHidden",n)});const o=(u,h=2,d=.1)=>{const f=h/2,A=c(u,d),p=new V.Group;p.add(Ci(new V.Vector3(A.x+f,A.y,A.z),new V.Vector3(A.x-f,A.y,A.z),new V.Vector3(1,0,0)),Ci(new V.Vector3(A.x,A.y+f,A.z),new V.Vector3(A.x,A.y-f,A.z),new V.Vector3(0,1,0)),Ci(new V.Vector3(A.x,A.y,A.z+f),new V.Vector3(A.x,A.y,A.z-f),new V.Vector3(0,0,1))),i.scene.add(p),i.needsRender=!0;const v=()=>{i.scene.remove(p)};return t.disposers.push(v),{clear:v,pointAxesHelperMesh:p}},s=(u,h=0)=>{var v,y;const d=(v=i==null?void 0:i.camera)==null?void 0:v.position;if(!d)return!1;const f=u.distanceTo(d),g=u.sub(d).normalize(),A=new V.Raycaster(d,g),p=(y=i.model.intersectRaycaster(A))==null?void 0:y[0];return!(p&&p.distance+h<f)},r=()=>t.intersection,a=()=>{var u,h;(h=(u=t.disposers)==null?void 0:u.forEach)==null||h.call(u,d=>d==null?void 0:d()),i.off("intersectionOnModelUpdate",e),i.off("intersectionHidden",n)},l=a,c=(u,h)=>{const d=u.clone();return i.camera.position.clone().sub(d).setLength(h).add(d)};return{intersection:r,pointAxesHelper:o,movePointTowardsCamera:c,destroy:a,dispose:l,canSeePoint:s}};function Y(){}const At=i=>i;function je(i,t){for(const e in t)i[e]=t[e];return i}function Bc(i){return i&&typeof i=="object"&&typeof i.then=="function"}function ga(i){return i()}function To(){return Object.create(null)}function ct(i){i.forEach(ga)}function Zt(i){return typeof i=="function"}function ne(i,t){return i!=i?t==t:i!==t||i&&typeof i=="object"||typeof i=="function"}let Mn;function _e(i,t){return Mn||(Mn=document.createElement("a")),Mn.href=t,i===Mn.href}function jc(i){return Object.keys(i).length===0}function Kt(i,t,e,n){if(i){const o=Aa(i,t,e,n);return i[0](o)}}function Aa(i,t,e,n){return i[1]&&n?je(e.ctx.slice(),i[1](n(t))):e.ctx}function $t(i,t,e,n){if(i[2]&&n){const o=i[2](n(e));if(t.dirty===void 0)return o;if(typeof o=="object"){const s=[],r=Math.max(t.dirty.length,o.length);for(let a=0;a<r;a+=1)s[a]=t.dirty[a]|o[a];return s}return t.dirty|o}return t.dirty}function en(i,t,e,n,o,s){if(o){const r=Aa(t,e,n,s);i.p(r,o)}}function tn(i){if(i.ctx.length>32){const t=[],e=i.ctx.length/32;for(let n=0;n<e;n++)t[n]=-1;return t}return-1}function Te(i){return i==null?"":i}function Pi(i){return i&&Zt(i.destroy)?i.destroy:Y}const va=typeof window!="undefined";let ba=va?()=>window.performance.now():()=>Date.now(),no=va?i=>requestAnimationFrame(i):Y;const Ht=new Set;function ya(i){Ht.forEach(t=>{t.c(i)||(Ht.delete(t),t.f())}),Ht.size!==0&&no(ya)}function wa(i){let t;return Ht.size===0&&no(ya),{promise:new Promise(e=>{Ht.add(t={c:i,f:e})}),abort(){Ht.delete(t)}}}function B(i,t){i.appendChild(t)}function ce(i,t,e){const n=io(i);if(!n.getElementById(t)){const o=z("style");o.id=t,o.textContent=e,Ca(n,o)}}function io(i){if(!i)return document;const t=i.getRootNode?i.getRootNode():i.ownerDocument;return t&&t.host?t:i.ownerDocument}function Vc(i){const t=z("style");return Ca(io(i),t),t.sheet}function Ca(i,t){return B(i.head||i,t),t.sheet}function T(i,t,e){i.insertBefore(t,e||null)}function M(i){i.parentNode&&i.parentNode.removeChild(i)}function at(i,t){for(let e=0;e<i.length;e+=1)i[e]&&i[e].d(t)}function z(i){return document.createElement(i)}function ye(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function ke(i){return document.createTextNode(i)}function $(){return ke(" ")}function fe(){return ke("")}function we(i,t,e,n){return i.addEventListener(t,e,n),()=>i.removeEventListener(t,e,n)}function Pa(i){return function(t){return t.stopPropagation(),i.call(this,t)}}function b(i,t,e){e==null?i.removeAttribute(t):i.getAttribute(t)!==e&&i.setAttribute(t,e)}function Qc(i){return Array.from(i.childNodes)}function Me(i,t){t=""+t,i.wholeText!==t&&(i.data=t)}function L(i,t,e,n){e===null?i.style.removeProperty(t):i.style.setProperty(t,e,n?"important":"")}let Tn;function Rc(){if(Tn===void 0){Tn=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(i){Tn=!0}}return Tn}function tt(i,t){getComputedStyle(i).position==="static"&&(i.style.position="relative");const n=z("iframe");n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1;const o=Rc();let s;return o?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=we(window,"message",r=>{r.source===n.contentWindow&&t()})):(n.src="about:blank",n.onload=()=>{s=we(n.contentWindow,"resize",t)}),B(i,n),()=>{(o||s&&n.contentWindow)&&s(),M(n)}}function q(i,t,e){i.classList[e?"add":"remove"](t)}function Ea(i,t,{bubbles:e=!1,cancelable:n=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(i,e,n,t),o}class Zn{constructor(t=!1){this.is_svg=!1,this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,e,n=null){this.e||(this.is_svg?this.e=ye(e.nodeName):this.e=z(e.nodeName),this.t=e,this.c(t)),this.i(n)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let e=0;e<this.n.length;e+=1)T(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(M)}}const Kn=new Map;let $n=0;function Oc(i){let t=5381,e=i.length;for(;e--;)t=(t<<5)-t^i.charCodeAt(e);return t>>>0}function Fc(i,t){const e={stylesheet:Vc(t),rules:{}};return Kn.set(i,e),e}function Ia(i,t,e,n,o,s,r,a=0){const l=16.666/n;let c=`{
|
|
102
102
|
`;for(let p=0;p<=1;p+=l){const v=t+(e-t)*s(p);c+=p*100+`%{${r(v,1-v)}}
|
|
103
103
|
`}const u=c+`100% {${r(e,1-e)}}
|
|
104
|
-
}`,h=`__svelte_${Rc(u)}_${a}`,d=io(i),{stylesheet:f,rules:g}=Kn.get(d)||Fc(d,i);g[h]||(g[h]=!0,f.insertRule(`@keyframes ${h} ${u}`,f.cssRules.length));const A=i.style.animation||"";return i.style.animation=`${A?`${A}, `:""}${h} ${n}ms linear ${o}ms 1 both`,$n+=1,h}function Fi(i,t){const e=(i.style.animation||"").split(", "),n=e.filter(t?s=>s.indexOf(t)<0:s=>s.indexOf("__svelte")===-1),o=e.length-n.length;o&&(i.style.animation=n.join(", "),$n-=o,$n||Hc())}function Hc(){no(()=>{$n||(Kn.forEach(i=>{const{ownerNode:t}=i.stylesheet;t&&M(t)}),Kn.clear())})}let An;function st(i){An=i}function Ct(){if(!An)throw new Error("Function called outside component initialization");return An}function ka(i){Ct().$$.before_update.push(i)}function Ue(i){Ct().$$.on_mount.push(i)}function Gc(i){Ct().$$.after_update.push(i)}function Pt(i){Ct().$$.on_destroy.push(i)}function ai(){const i=Ct();return(t,e,{cancelable:n=!1}={})=>{const o=i.$$.callbacks[t];if(o){const s=Ea(t,e,{cancelable:n});return o.slice().forEach(r=>{r.call(i,s)}),!s.defaultPrevented}return!0}}function Hi(i,t){return Ct().$$.context.set(i,t),t}function St(i){return Ct().$$.context.get(i)}function wn(i,t){const e=i.$$.callbacks[t.type];e&&e.slice().forEach(n=>n.call(this,t))}const un=[],Qe=[],_n=[],Gi=[],xa=Promise.resolve();let Wi=!1;function Da(){Wi||(Wi=!0,xa.then(oo))}function zo(){return Da(),xa}function xe(i){_n.push(i)}function Wc(i){Gi.push(i)}const Ei=new Set;let zn=0;function oo(){const i=An;do{for(;zn<un.length;){const t=un[zn];zn++,st(t),Nc(t.$$)}for(st(null),un.length=0,zn=0;Qe.length;)Qe.pop()();for(let t=0;t<_n.length;t+=1){const e=_n[t];Ei.has(e)||(Ei.add(e),e())}_n.length=0}while(un.length);for(;Gi.length;)Gi.pop()();Wi=!1,Ei.clear(),st(i)}function Nc(i){if(i.fragment!==null){i.update(),ct(i.before_update);const t=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,t),i.after_update.forEach(xe)}}let sn;function La(){return sn||(sn=Promise.resolve(),sn.then(()=>{sn=null})),sn}function ei(i,t,e){i.dispatchEvent(Ea(`${t?"intro":"outro"}${e}`))}const Xn=new Set;let mt;function se(){mt={r:0,c:[],p:mt}}function re(){mt.r||ct(mt.c),mt=mt.p}function E(i,t){i&&i.i&&(Xn.delete(i),i.i(t))}function D(i,t,e,n){if(i&&i.o){if(Xn.has(i))return;Xn.add(i),mt.c.push(()=>{Xn.delete(i),n&&(e&&i.d(1),n())}),i.o(t)}else n&&n()}const Sa={duration:0};function Tt(i,t,e){let n=t(i,e),o=!1,s,r,a=0;function l(){s&&Fi(i,s)}function c(){const{delay:h=0,duration:d=300,easing:f=At,tick:g=Y,css:A}=n||Sa;A&&(s=Ia(i,0,1,d,h,f,A,a++)),g(0,1);const p=ba()+h,v=p+d;r&&r.abort(),o=!0,xe(()=>ei(i,!0,"start")),r=wa(y=>{if(o){if(y>=v)return g(1,0),ei(i,!0,"end"),l(),o=!1;if(y>=p){const w=f((y-p)/d);g(w,1-w)}}return o})}let u=!1;return{start(){u||(u=!0,Fi(i),Zt(n)?(n=n(),La().then(c)):c())},invalidate(){u=!1},end(){o&&(l(),o=!1)}}}function nn(i,t,e){let n=t(i,e),o=!0,s;const r=mt;r.r+=1;function a(){const{delay:l=0,duration:c=300,easing:u=At,tick:h=Y,css:d}=n||Sa;d&&(s=Ia(i,1,0,c,l,u,d));const f=ba()+l,g=f+c;xe(()=>ei(i,!1,"start")),wa(A=>{if(o){if(A>=g)return h(0,1),ei(i,!1,"end"),--r.r||ct(r.c),!1;if(A>=f){const p=u((A-f)/c);h(1-p,p)}}return o})}return Zt(n)?La().then(()=>{n=n(),a()}):a(),{end(l){l&&n.tick&&n.tick(1,0),o&&(s&&Fi(i,s),o=!1)}}}function Bo(i,t){const e=t.token={};function n(o,s,r,a){if(t.token!==e)return;t.resolved=a;let l=t.ctx;r!==void 0&&(l=l.slice(),l[r]=a);const c=o&&(t.current=o)(l);let u=!1;t.block&&(t.blocks?t.blocks.forEach((h,d)=>{d!==s&&h&&(se(),D(h,1,1,()=>{t.blocks[d]===h&&(t.blocks[d]=null)}),re())}):t.block.d(1),c.c(),E(c,1),c.m(t.mount(),t.anchor),u=!0),t.block=c,t.blocks&&(t.blocks[s]=c),u&&oo()}if(Bc(i)){const o=Ct();if(i.then(s=>{st(o),n(t.then,1,t.value,s),st(null)},s=>{if(st(o),n(t.catch,2,t.error,s),st(null),!t.hasCatch)throw s}),t.current!==t.pending)return n(t.pending,0),!0}else{if(t.current!==t.then)return n(t.then,1,t.value,i),!0;t.resolved=i}}function _c(i,t,e){const n=t.slice(),{resolved:o}=i;i.current===i.then&&(n[i.value]=o),i.current===i.catch&&(n[i.error]=o),i.block.p(n,e)}const Xc=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function so(i,t){i.d(1),t.delete(i.key)}function Et(i,t){D(i,1,1,()=>{t.delete(i.key)})}function qe(i,t,e,n,o,s,r,a,l,c,u,h){let d=i.length,f=s.length,g=d;const A={};for(;g--;)A[i[g].key]=g;const p=[],v=new Map,y=new Map;for(g=f;g--;){const C=h(o,s,g),S=e(C);let x=r.get(S);x?n&&x.p(C,t):(x=c(S,C),x.c()),v.set(S,p[g]=x),S in A&&y.set(S,Math.abs(g-A[S]))}const w=new Set,P=new Set;function k(C){E(C,1),C.m(a,u),r.set(C.key,C),u=C.first,f--}for(;d&&f;){const C=p[f-1],S=i[d-1],x=C.key,Q=S.key;C===S?(u=C.first,d--,f--):v.has(Q)?!r.has(x)||w.has(x)?k(C):P.has(Q)?d--:y.get(x)>y.get(Q)?(P.add(x),k(C)):(w.add(Q),d--):(l(S,r),d--)}for(;d--;){const C=i[d];v.has(C.key)||l(C,r)}for(;f;)k(p[f-1]);return p}function Oe(i,t){const e={},n={},o={$$scope:1};let s=i.length;for(;s--;){const r=i[s],a=t[s];if(a){for(const l in r)l in a||(n[l]=1);for(const l in a)o[l]||(e[l]=a[l],o[l]=1);i[s]=a}else for(const l in r)o[l]=1}for(const r in n)r in e||(e[r]=void 0);return e}function Ma(i){return typeof i=="object"&&i!==null?i:{}}function Yc(i,t,e){const n=i.$$.props[t];n!==void 0&&(i.$$.bound[n]=e,e(i.$$.ctx[n]))}function K(i){i&&i.c()}function J(i,t,e,n){const{fragment:o,after_update:s}=i.$$;o&&o.m(t,e),n||xe(()=>{const r=i.$$.on_mount.map(ga).filter(Zt);i.$$.on_destroy?i.$$.on_destroy.push(...r):ct(r),i.$$.on_mount=[]}),s.forEach(xe)}function Z(i,t){const e=i.$$;e.fragment!==null&&(ct(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Uc(i,t){i.$$.dirty[0]===-1&&(un.push(i),Da(),i.$$.dirty.fill(0)),i.$$.dirty[t/31|0]|=1<<t%31}function ie(i,t,e,n,o,s,r,a=[-1]){const l=An;st(i);const c=i.$$={fragment:null,ctx:[],props:s,update:Y,not_equal:o,bound:To(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:To(),dirty:a,skip_bound:!1,root:t.target||l.$$.root};r&&r(c.root);let u=!1;if(c.ctx=e?e(i,t.props||{},(h,d,...f)=>{const g=f.length?f[0]:d;return c.ctx&&o(c.ctx[h],c.ctx[h]=g)&&(!c.skip_bound&&c.bound[h]&&c.bound[h](g),u&&Uc(i,h)),d}):[],c.update(),u=!0,ct(c.before_update),c.fragment=n?n(c.ctx):!1,t.target){if(t.hydrate){const h=Qc(t.target);c.fragment&&c.fragment.l(h),h.forEach(M)}else c.fragment&&c.fragment.c();t.intro&&E(i.$$.fragment),J(i,t.target,t.anchor,t.customElement),oo()}st(l)}class oe{$destroy(){Z(this,1),this.$destroy=Y}$on(t,e){if(!Zt(e))return Y;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const o=n.indexOf(e);o!==-1&&n.splice(o,1)}}$set(t){this.$$set&&!jc(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const qc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAA8CAYAAACZ1L+0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAYKADAAQAAAABAAAAPAAAAABU0H2EAAARRElEQVR4Ad2czY9cRZbFq1yFoQGDNCzwuAENohl54dkgdrNh34tZ8GciFi31nwEsmAEhhAWD1GMJCZgx5sMfUHN+J+NE3XfrZWWVcVVLHVLmuXG/74148V5m2bm/N8bR0dH+Bx988Po333zzbz///PONg4ODa+I9I9y/cuXKgV77h4eH+1KH3hP/yv7+vuBAsG+5UCIpCkMzDQ962Eu80Q1P/KmHT82v8IocZFL4pslDvL3fNARHoPI2wtbrV1jBIf9N8SEZ0UUP2wFHv2ocSc/2ouEz8PVooJXQ0/j10aNHoH2Idj4PHz4k1n29/k+5/u3ll1/+r7fffvtLzfGzd8ibjK6+9957f5ajf1XzH9y7d+8Xjf9FRs1SdvNBBg2SDQ1xh9ALH4yN0M2BNZrKwtFc9Fmkquuma5HJBzvLiIONBnx40B7QIzTdxCc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aB+/Y9+KfE/X3vttS8lI7e9/wfu514OAjYP0QAAAABJRU5ErkJggg==";function Jc(i){ce(i,"svelte-1d7uzh5",".room-label-item.svelte-1d7uzh5{position:absolute;font-size:0.5rem;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.room-label-item__text.svelte-1d7uzh5{position:absolute;left:0;top:-4rem;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:1.25rem;min-width:2rem;padding:0 0.375rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-1d7uzh5{position:absolute;top:-2.75rem;height:3rem;width:0.0625rem;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-1d7uzh5{font-size:0.625rem}")}function Zc(i){let t,e,n=i[0].name+"",o,s,r,a,l;return{c(){t=z("div"),e=z("span"),o=ke(n),s=$(),r=z("div"),b(e,"class","room-label-item__text svelte-1d7uzh5"),L(e,"background-image","url("+qc+")"),q(e,"wide",i[0].name.length>3),b(r,"class","room-label-item__bar svelte-1d7uzh5"),b(t,"class","room-label-item svelte-1d7uzh5"),L(t,"z-index",i[0].zIndex),L(t,"transform",i[0].transform),L(t,"opacity",i[0].visible?1:0)},m(c,u){T(c,t,u),B(t,e),B(e,o),B(t,s),B(t,r),a||(l=we(e,"click",i[1]),a=!0)},p(c,[u]){u&1&&n!==(n=c[0].name+"")&&Me(o,n),u&1&&q(e,"wide",c[0].name.length>3),u&1&&L(t,"z-index",c[0].zIndex),u&1&&L(t,"transform",c[0].transform),u&1&&L(t,"opacity",c[0].visible?1:0)},i:Y,o:Y,d(c){c&&M(t),a=!1,l()}}}function Kc(i,t,e){let{five:n}=t,{roomLabel:o}=t;function s(){n.setState({panoIndex:o.panoIndex,mode:"Panorama",longitude:o.longitude})}return i.$$set=r=>{"five"in r&&e(2,n=r.five),"roomLabel"in r&&e(0,o=r.roomLabel)},[o,s,n]}class $c extends oe{constructor(t){super(),ie(this,t,Kc,Zc,ne,{five:2,roomLabel:0},Jc)}}const{Map:eu}=Xc;function tu(i){ce(i,"svelte-9eg4zi",".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}")}function jo(i,t,e){const n=i.slice();return n[12]=t[e],n}function Vo(i,t){let e,n,o;return n=new $c({props:{roomLabel:t[12],five:t[1]}}),{key:i,first:null,c(){e=fe(),K(n.$$.fragment),this.first=e},m(s,r){T(s,e,r),J(n,s,r),o=!0},p(s,r){t=s;const a={};r&1&&(a.roomLabel=t[12]),r&2&&(a.five=t[1]),n.$set(a)},i(s){o||(E(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&M(e),Z(n,s)}}}function nu(i){let t,e=[],n=new eu,o,s,r=i[0];const a=l=>l[12].id;for(let l=0;l<r.length;l+=1){let c=jo(i,r,l),u=a(c);n.set(u,e[l]=Vo(u,c))}return{c(){t=z("div");for(let l=0;l<e.length;l+=1)e[l].c();b(t,"class","room-labels-container svelte-9eg4zi"),xe(()=>i[6].call(t))},m(l,c){T(l,t,c);for(let u=0;u<e.length;u+=1)e[u].m(t,null);o=tt(t,i[6].bind(t)),s=!0},p(l,[c]){c&3&&(r=l[0],se(),e=qe(e,c,a,1,l,r,n,t,Et,Vo,null,jo),re())},i(l){if(!s){for(let c=0;c<r.length;c+=1)E(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)D(e[c]);s=!1},d(l){l&&M(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}function iu(i,t,e){var A;let n,{five:o}=t,{roomLabels:s}=t,r,a,l=(A=o.model.shownFloor)!=null?A:null;function c(p){if(!(l===null||p.floorIndex===l))return!1;const y=new V.Raycaster,w=o.camera.position.clone(),P=new V.Vector3(p.position.x,p.position.y,p.position.z),k=P.distanceTo(w);y.set(w.clone(),P.clone().sub(w).normalize());const[C]=o.model.intersectRaycaster(y);return!(C&&C.distance+1<k)}function u(p,v){const w=new V.Vector3(p.position.x,p.position.y,p.position.z).clone().project(o.camera),P=Math.ceil((w.x+1)/2*v.x),k=Math.ceil((-w.y+1)/2*v.y);return`translate(${P}px, ${k}px)`}function h(p){const{rendererSize:v,shownFloor:y}=p,w=new Map;function P(C){const S=w.get(C.id);if(S)return S;const{x,y:Q,z:_}=C.position,R=new V.Vector3(x,Q,_).clone().distanceTo(o.camera.position);return w.set(C.id,R),R}return s.map(C=>{const S=c(C),x=S?u(C,v):C.transform,Q=P(C),R=s.filter(U=>U.visible&&P(U)<Q).length*10;return me(O({},C),{visible:S,transform:x,zIndex:R})})}function d(){e(0,s=h({rendererSize:n,shownFloor:l}))}function f(p){e(4,l=p)}o.on("cameraUpdate",d),o.on("modelShownFloorChange",f),Pt(()=>{o.off("cameraUpdate",d),o.off("modelShownFloorChange",f)});function g(){r=this.clientWidth,a=this.clientHeight,e(2,r),e(3,a)}return i.$$set=p=>{"five"in p&&e(1,o=p.five),"roomLabels"in p&&e(0,s=p.roomLabels)},i.$$.update=()=>{i.$$.dirty&12&&e(5,n={x:r,y:a}),i.$$.dirty&48&&e(0,s=h({rendererSize:n,shownFloor:l}))},[s,o,r,a,l,n,g]}class ou extends oe{constructor(t){super(),ie(this,t,iu,nu,ne,{five:1,roomLabels:0},tu)}}function su(i){return i.model_room_labels.map(({id:t,pano_index:e,floor_index:n,name:o,position:s,longitude:r})=>({id:t,name:o,position:s,longitude:r,panoIndex:e,floorIndex:n,zIndex:0,visible:!1,transform:""}))}class ru{constructor(t){m(this,"five");m(this,"enabled",!0);m(this,"fiveModeEnabled");m(this,"app");m(this,"wrapper");m(this,"roomLabels",[]);m(this,"container",document.createElement("div"));m(this,"onFiveModeChange",t=>{if(t!=="Floorplan"){this.fiveModeEnabled=!1,this.render();return}this.five.once("initAnimationEnded",()=>{this.fiveModeEnabled=this.five.currentMode==="Floorplan",this.render()})});this.five=t,this.fiveModeEnabled=this.five.currentMode==="Floorplan",this.container.classList.add("model-room-label-plugin-container"),this.container.style.width="100%",this.container.style.height="100%",this.container.style.position="absolute",this.container.style.pointerEvents="none",this.container.style.left="0",this.container.style.top="0",this.container.style.zIndex="5",this.five.once("dispose",()=>this.dispose()),this.five.on("modeChange",this.onFiveModeChange),this.render()}dispose(){this.five.off("modeChange",this.onFiveModeChange),this.container.remove()}load(t){this.roomLabels=su(t),this.render()}appendTo(t){return this.wrapper=t,t.appendChild(this.container),this.render(),this}disable(){return this.enabled=!1,this.render(),this}enable(){return this.enabled=!0,this.render(),this}render(){var t;if(!!this.wrapper){if(!this.enabled||!this.fiveModeEnabled){(t=this.app)==null||t.$destroy(),this.app=void 0;return}this.app?this.app.$set({five:this.five,roomLabels:this.roomLabels}):this.app=new ou({target:this.container,props:{five:this.five,roomLabels:this.roomLabels}})}}}const au=i=>new ru(i),lu={name:"ModelRoomLabelPlugin",version:0};var pt=(i=>(i[i.FLOOR=1]="FLOOR",i[i.CEILING=2]="CEILING",i[i.BOUNDING_CENTER=3]="BOUNDING_CENTER",i))(pt||{});function ti(i){return H(this,null,function*(){try{return[null,yield i]}catch(t){return t instanceof Error?[t,null]:[new Error(""),null]}})}function ni(i){return Object.prototype.toString.call(i)==="[object Object]"}function li(i,t){return i===t?!0:typeof i!=typeof t?!1:!!(Number.isNaN(i)&&Number.isNaN(t))}function cu(i,t){const e=Object.getOwnPropertyNames(i),n=Object.getOwnPropertyNames(t);if(e.length!==n.length)return!1;for(let o=0,s=e.length;o<s;o++){const r=e[o];if(!li(i[r],t[r]))return!1}return!0}function uu(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!li(i[e],t[e]))return!1;return!0}function du(i,t){return li(i,t)?!0:ni(i)&&ni(t)?cu(i,t):Array.isArray(i)&&Array.isArray(t)?uu(i,t):!1}function ro(i,t){return li(i,t)?!0:ni(i)&&ni(t)?fu(i,t):Array.isArray(i)&&Array.isArray(t)?hu(i,t):!1}function hu(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!ro(i[e],t[e]))return!1;return!0}function fu(i,t){const e=Object.getOwnPropertyNames(i),n=Object.getOwnPropertyNames(t);if(e.length!==n.length)return!1;for(let o=0,s=e.length;o<s;o++){const r=e[o];if(!ro(i[r],t[r]))return!1}return!0}function et(i,t,e={deep:!1}){return e.deep?ro(i,t):du(i,t)}function _t(i){return i<.5?4*i*i*i:.5*Math.pow(2*i-2,3)+1}function Ta(i){const t=i-1;return t*t*t+1}function Mt(i,{delay:t=0,duration:e=400,easing:n=At}={}){const o=+getComputedStyle(i).opacity;return{delay:t,duration:e,easing:n,css:s=>`opacity: ${s*o}`}}function Qo(i,{delay:t=0,duration:e=400,easing:n=Ta,x:o=0,y:s=0,opacity:r=0}={}){const a=getComputedStyle(i),l=+a.opacity,c=a.transform==="none"?"":a.transform,u=l*(1-r);return{delay:t,duration:e,easing:n,css:(h,d)=>`
|
|
104
|
+
}`,h=`__svelte_${Oc(u)}_${a}`,d=io(i),{stylesheet:f,rules:g}=Kn.get(d)||Fc(d,i);g[h]||(g[h]=!0,f.insertRule(`@keyframes ${h} ${u}`,f.cssRules.length));const A=i.style.animation||"";return i.style.animation=`${A?`${A}, `:""}${h} ${n}ms linear ${o}ms 1 both`,$n+=1,h}function Fi(i,t){const e=(i.style.animation||"").split(", "),n=e.filter(t?s=>s.indexOf(t)<0:s=>s.indexOf("__svelte")===-1),o=e.length-n.length;o&&(i.style.animation=n.join(", "),$n-=o,$n||Hc())}function Hc(){no(()=>{$n||(Kn.forEach(i=>{const{ownerNode:t}=i.stylesheet;t&&M(t)}),Kn.clear())})}let An;function st(i){An=i}function Ct(){if(!An)throw new Error("Function called outside component initialization");return An}function ka(i){Ct().$$.before_update.push(i)}function Ue(i){Ct().$$.on_mount.push(i)}function Gc(i){Ct().$$.after_update.push(i)}function Pt(i){Ct().$$.on_destroy.push(i)}function ai(){const i=Ct();return(t,e,{cancelable:n=!1}={})=>{const o=i.$$.callbacks[t];if(o){const s=Ea(t,e,{cancelable:n});return o.slice().forEach(r=>{r.call(i,s)}),!s.defaultPrevented}return!0}}function Hi(i,t){return Ct().$$.context.set(i,t),t}function St(i){return Ct().$$.context.get(i)}function wn(i,t){const e=i.$$.callbacks[t.type];e&&e.slice().forEach(n=>n.call(this,t))}const un=[],Qe=[],_n=[],Gi=[],xa=Promise.resolve();let Wi=!1;function Da(){Wi||(Wi=!0,xa.then(oo))}function zo(){return Da(),xa}function xe(i){_n.push(i)}function Wc(i){Gi.push(i)}const Ei=new Set;let zn=0;function oo(){const i=An;do{for(;zn<un.length;){const t=un[zn];zn++,st(t),Nc(t.$$)}for(st(null),un.length=0,zn=0;Qe.length;)Qe.pop()();for(let t=0;t<_n.length;t+=1){const e=_n[t];Ei.has(e)||(Ei.add(e),e())}_n.length=0}while(un.length);for(;Gi.length;)Gi.pop()();Wi=!1,Ei.clear(),st(i)}function Nc(i){if(i.fragment!==null){i.update(),ct(i.before_update);const t=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,t),i.after_update.forEach(xe)}}let sn;function La(){return sn||(sn=Promise.resolve(),sn.then(()=>{sn=null})),sn}function ei(i,t,e){i.dispatchEvent(Ea(`${t?"intro":"outro"}${e}`))}const Xn=new Set;let mt;function se(){mt={r:0,c:[],p:mt}}function re(){mt.r||ct(mt.c),mt=mt.p}function E(i,t){i&&i.i&&(Xn.delete(i),i.i(t))}function D(i,t,e,n){if(i&&i.o){if(Xn.has(i))return;Xn.add(i),mt.c.push(()=>{Xn.delete(i),n&&(e&&i.d(1),n())}),i.o(t)}else n&&n()}const Sa={duration:0};function Tt(i,t,e){let n=t(i,e),o=!1,s,r,a=0;function l(){s&&Fi(i,s)}function c(){const{delay:h=0,duration:d=300,easing:f=At,tick:g=Y,css:A}=n||Sa;A&&(s=Ia(i,0,1,d,h,f,A,a++)),g(0,1);const p=ba()+h,v=p+d;r&&r.abort(),o=!0,xe(()=>ei(i,!0,"start")),r=wa(y=>{if(o){if(y>=v)return g(1,0),ei(i,!0,"end"),l(),o=!1;if(y>=p){const w=f((y-p)/d);g(w,1-w)}}return o})}let u=!1;return{start(){u||(u=!0,Fi(i),Zt(n)?(n=n(),La().then(c)):c())},invalidate(){u=!1},end(){o&&(l(),o=!1)}}}function nn(i,t,e){let n=t(i,e),o=!0,s;const r=mt;r.r+=1;function a(){const{delay:l=0,duration:c=300,easing:u=At,tick:h=Y,css:d}=n||Sa;d&&(s=Ia(i,1,0,c,l,u,d));const f=ba()+l,g=f+c;xe(()=>ei(i,!1,"start")),wa(A=>{if(o){if(A>=g)return h(0,1),ei(i,!1,"end"),--r.r||ct(r.c),!1;if(A>=f){const p=u((A-f)/c);h(1-p,p)}}return o})}return Zt(n)?La().then(()=>{n=n(),a()}):a(),{end(l){l&&n.tick&&n.tick(1,0),o&&(s&&Fi(i,s),o=!1)}}}function Bo(i,t){const e=t.token={};function n(o,s,r,a){if(t.token!==e)return;t.resolved=a;let l=t.ctx;r!==void 0&&(l=l.slice(),l[r]=a);const c=o&&(t.current=o)(l);let u=!1;t.block&&(t.blocks?t.blocks.forEach((h,d)=>{d!==s&&h&&(se(),D(h,1,1,()=>{t.blocks[d]===h&&(t.blocks[d]=null)}),re())}):t.block.d(1),c.c(),E(c,1),c.m(t.mount(),t.anchor),u=!0),t.block=c,t.blocks&&(t.blocks[s]=c),u&&oo()}if(Bc(i)){const o=Ct();if(i.then(s=>{st(o),n(t.then,1,t.value,s),st(null)},s=>{if(st(o),n(t.catch,2,t.error,s),st(null),!t.hasCatch)throw s}),t.current!==t.pending)return n(t.pending,0),!0}else{if(t.current!==t.then)return n(t.then,1,t.value,i),!0;t.resolved=i}}function _c(i,t,e){const n=t.slice(),{resolved:o}=i;i.current===i.then&&(n[i.value]=o),i.current===i.catch&&(n[i.error]=o),i.block.p(n,e)}const Xc=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function so(i,t){i.d(1),t.delete(i.key)}function Et(i,t){D(i,1,1,()=>{t.delete(i.key)})}function qe(i,t,e,n,o,s,r,a,l,c,u,h){let d=i.length,f=s.length,g=d;const A={};for(;g--;)A[i[g].key]=g;const p=[],v=new Map,y=new Map;for(g=f;g--;){const C=h(o,s,g),S=e(C);let x=r.get(S);x?n&&x.p(C,t):(x=c(S,C),x.c()),v.set(S,p[g]=x),S in A&&y.set(S,Math.abs(g-A[S]))}const w=new Set,P=new Set;function k(C){E(C,1),C.m(a,u),r.set(C.key,C),u=C.first,f--}for(;d&&f;){const C=p[f-1],S=i[d-1],x=C.key,Q=S.key;C===S?(u=C.first,d--,f--):v.has(Q)?!r.has(x)||w.has(x)?k(C):P.has(Q)?d--:y.get(x)>y.get(Q)?(P.add(x),k(C)):(w.add(Q),d--):(l(S,r),d--)}for(;d--;){const C=i[d];v.has(C.key)||l(C,r)}for(;f;)k(p[f-1]);return p}function Re(i,t){const e={},n={},o={$$scope:1};let s=i.length;for(;s--;){const r=i[s],a=t[s];if(a){for(const l in r)l in a||(n[l]=1);for(const l in a)o[l]||(e[l]=a[l],o[l]=1);i[s]=a}else for(const l in r)o[l]=1}for(const r in n)r in e||(e[r]=void 0);return e}function Ma(i){return typeof i=="object"&&i!==null?i:{}}function Yc(i,t,e){const n=i.$$.props[t];n!==void 0&&(i.$$.bound[n]=e,e(i.$$.ctx[n]))}function K(i){i&&i.c()}function J(i,t,e,n){const{fragment:o,after_update:s}=i.$$;o&&o.m(t,e),n||xe(()=>{const r=i.$$.on_mount.map(ga).filter(Zt);i.$$.on_destroy?i.$$.on_destroy.push(...r):ct(r),i.$$.on_mount=[]}),s.forEach(xe)}function Z(i,t){const e=i.$$;e.fragment!==null&&(ct(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Uc(i,t){i.$$.dirty[0]===-1&&(un.push(i),Da(),i.$$.dirty.fill(0)),i.$$.dirty[t/31|0]|=1<<t%31}function ie(i,t,e,n,o,s,r,a=[-1]){const l=An;st(i);const c=i.$$={fragment:null,ctx:[],props:s,update:Y,not_equal:o,bound:To(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:To(),dirty:a,skip_bound:!1,root:t.target||l.$$.root};r&&r(c.root);let u=!1;if(c.ctx=e?e(i,t.props||{},(h,d,...f)=>{const g=f.length?f[0]:d;return c.ctx&&o(c.ctx[h],c.ctx[h]=g)&&(!c.skip_bound&&c.bound[h]&&c.bound[h](g),u&&Uc(i,h)),d}):[],c.update(),u=!0,ct(c.before_update),c.fragment=n?n(c.ctx):!1,t.target){if(t.hydrate){const h=Qc(t.target);c.fragment&&c.fragment.l(h),h.forEach(M)}else c.fragment&&c.fragment.c();t.intro&&E(i.$$.fragment),J(i,t.target,t.anchor,t.customElement),oo()}st(l)}class oe{$destroy(){Z(this,1),this.$destroy=Y}$on(t,e){if(!Zt(e))return Y;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const o=n.indexOf(e);o!==-1&&n.splice(o,1)}}$set(t){this.$$set&&!jc(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const qc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAA8CAYAAACZ1L+0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAYKADAAQAAAABAAAAPAAAAABU0H2EAAARRElEQVR4Ad2czY9cRZbFq1yFoQGDNCzwuAENohl54dkgdrNh34tZ8GciFi31nwEsmAEhhAWD1GMJCZgx5sMfUHN+J+NE3XfrZWWVcVVLHVLmuXG/74148V5m2bm/N8bR0dH+Bx988Po333zzbz///PONg4ODa+I9I9y/cuXKgV77h4eH+1KH3hP/yv7+vuBAsG+5UCIpCkMzDQ962Eu80Q1P/KmHT82v8IocZFL4pslDvL3fNARHoPI2wtbrV1jBIf9N8SEZ0UUP2wFHv2ocSc/2ouEz8PVooJXQ0/j10aNHoH2Idj4PHz4k1n29/k+5/u3ll1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bDHN88/curvewF4hjhNWasrwhy/0waIPjylyYjp49Ag++NhFhi7F+jeEFcc/H6w5TYbnxo2OoufXmNPcX+XWv4QLMo+taJkfeY4gvtRs/n8vzY/cssxB5CyKxi96/aB+/Y9+KfE/X3vttS8lI7e9/wfu514OAjYP0QAAAABJRU5ErkJggg==";function Jc(i){ce(i,"svelte-1d7uzh5",".room-label-item.svelte-1d7uzh5{position:absolute;font-size:0.5rem;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.room-label-item__text.svelte-1d7uzh5{position:absolute;left:0;top:-4rem;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:1.25rem;min-width:2rem;padding:0 0.375rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-1d7uzh5{position:absolute;top:-2.75rem;height:3rem;width:0.0625rem;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-1d7uzh5{font-size:0.625rem}")}function Zc(i){let t,e,n=i[0].name+"",o,s,r,a,l;return{c(){t=z("div"),e=z("span"),o=ke(n),s=$(),r=z("div"),b(e,"class","room-label-item__text svelte-1d7uzh5"),L(e,"background-image","url("+qc+")"),q(e,"wide",i[0].name.length>3),b(r,"class","room-label-item__bar svelte-1d7uzh5"),b(t,"class","room-label-item svelte-1d7uzh5"),L(t,"z-index",i[0].zIndex),L(t,"transform",i[0].transform),L(t,"opacity",i[0].visible?1:0)},m(c,u){T(c,t,u),B(t,e),B(e,o),B(t,s),B(t,r),a||(l=we(e,"click",i[1]),a=!0)},p(c,[u]){u&1&&n!==(n=c[0].name+"")&&Me(o,n),u&1&&q(e,"wide",c[0].name.length>3),u&1&&L(t,"z-index",c[0].zIndex),u&1&&L(t,"transform",c[0].transform),u&1&&L(t,"opacity",c[0].visible?1:0)},i:Y,o:Y,d(c){c&&M(t),a=!1,l()}}}function Kc(i,t,e){let{five:n}=t,{roomLabel:o}=t;function s(){n.setState({panoIndex:o.panoIndex,mode:"Panorama",longitude:o.longitude})}return i.$$set=r=>{"five"in r&&e(2,n=r.five),"roomLabel"in r&&e(0,o=r.roomLabel)},[o,s,n]}class $c extends oe{constructor(t){super(),ie(this,t,Kc,Zc,ne,{five:2,roomLabel:0},Jc)}}const{Map:eu}=Xc;function tu(i){ce(i,"svelte-9eg4zi",".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}")}function jo(i,t,e){const n=i.slice();return n[12]=t[e],n}function Vo(i,t){let e,n,o;return n=new $c({props:{roomLabel:t[12],five:t[1]}}),{key:i,first:null,c(){e=fe(),K(n.$$.fragment),this.first=e},m(s,r){T(s,e,r),J(n,s,r),o=!0},p(s,r){t=s;const a={};r&1&&(a.roomLabel=t[12]),r&2&&(a.five=t[1]),n.$set(a)},i(s){o||(E(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&M(e),Z(n,s)}}}function nu(i){let t,e=[],n=new eu,o,s,r=i[0];const a=l=>l[12].id;for(let l=0;l<r.length;l+=1){let c=jo(i,r,l),u=a(c);n.set(u,e[l]=Vo(u,c))}return{c(){t=z("div");for(let l=0;l<e.length;l+=1)e[l].c();b(t,"class","room-labels-container svelte-9eg4zi"),xe(()=>i[6].call(t))},m(l,c){T(l,t,c);for(let u=0;u<e.length;u+=1)e[u].m(t,null);o=tt(t,i[6].bind(t)),s=!0},p(l,[c]){c&3&&(r=l[0],se(),e=qe(e,c,a,1,l,r,n,t,Et,Vo,null,jo),re())},i(l){if(!s){for(let c=0;c<r.length;c+=1)E(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)D(e[c]);s=!1},d(l){l&&M(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}function iu(i,t,e){var A;let n,{five:o}=t,{roomLabels:s}=t,r,a,l=(A=o.model.shownFloor)!=null?A:null;function c(p){if(!(l===null||p.floorIndex===l))return!1;const y=new V.Raycaster,w=o.camera.position.clone(),P=new V.Vector3(p.position.x,p.position.y,p.position.z),k=P.distanceTo(w);y.set(w.clone(),P.clone().sub(w).normalize());const[C]=o.model.intersectRaycaster(y);return!(C&&C.distance+1<k)}function u(p,v){const w=new V.Vector3(p.position.x,p.position.y,p.position.z).clone().project(o.camera),P=Math.ceil((w.x+1)/2*v.x),k=Math.ceil((-w.y+1)/2*v.y);return`translate(${P}px, ${k}px)`}function h(p){const{rendererSize:v,shownFloor:y}=p,w=new Map;function P(C){const S=w.get(C.id);if(S)return S;const{x,y:Q,z:_}=C.position,O=new V.Vector3(x,Q,_).clone().distanceTo(o.camera.position);return w.set(C.id,O),O}return s.map(C=>{const S=c(C),x=S?u(C,v):C.transform,Q=P(C),O=s.filter(U=>U.visible&&P(U)<Q).length*10;return me(R({},C),{visible:S,transform:x,zIndex:O})})}function d(){e(0,s=h({rendererSize:n,shownFloor:l}))}function f(p){e(4,l=p)}o.on("cameraUpdate",d),o.on("modelShownFloorChange",f),Pt(()=>{o.off("cameraUpdate",d),o.off("modelShownFloorChange",f)});function g(){r=this.clientWidth,a=this.clientHeight,e(2,r),e(3,a)}return i.$$set=p=>{"five"in p&&e(1,o=p.five),"roomLabels"in p&&e(0,s=p.roomLabels)},i.$$.update=()=>{i.$$.dirty&12&&e(5,n={x:r,y:a}),i.$$.dirty&48&&e(0,s=h({rendererSize:n,shownFloor:l}))},[s,o,r,a,l,n,g]}class ou extends oe{constructor(t){super(),ie(this,t,iu,nu,ne,{five:1,roomLabels:0},tu)}}function su(i){return i.model_room_labels.map(({id:t,pano_index:e,floor_index:n,name:o,position:s,longitude:r})=>({id:t,name:o,position:s,longitude:r,panoIndex:e,floorIndex:n,zIndex:0,visible:!1,transform:""}))}class ru{constructor(t){m(this,"five");m(this,"enabled",!0);m(this,"fiveModeEnabled");m(this,"app");m(this,"wrapper");m(this,"roomLabels",[]);m(this,"container",document.createElement("div"));m(this,"onFiveModeChange",t=>{if(t!=="Floorplan"){this.fiveModeEnabled=!1,this.render();return}this.five.once("initAnimationEnded",()=>{this.fiveModeEnabled=this.five.currentMode==="Floorplan",this.render()})});this.five=t,this.fiveModeEnabled=this.five.currentMode==="Floorplan",this.container.classList.add("model-room-label-plugin-container"),this.container.style.width="100%",this.container.style.height="100%",this.container.style.position="absolute",this.container.style.pointerEvents="none",this.container.style.left="0",this.container.style.top="0",this.container.style.zIndex="5",this.five.once("dispose",()=>this.dispose()),this.five.on("modeChange",this.onFiveModeChange),this.render()}dispose(){this.five.off("modeChange",this.onFiveModeChange),this.container.remove()}load(t){this.roomLabels=su(t),this.render()}appendTo(t){return this.wrapper=t,t.appendChild(this.container),this.render(),this}disable(){return this.enabled=!1,this.render(),this}enable(){return this.enabled=!0,this.render(),this}render(){var t;if(!!this.wrapper){if(!this.enabled||!this.fiveModeEnabled){(t=this.app)==null||t.$destroy(),this.app=void 0;return}this.app?this.app.$set({five:this.five,roomLabels:this.roomLabels}):this.app=new ou({target:this.container,props:{five:this.five,roomLabels:this.roomLabels}})}}}const au=i=>new ru(i),lu={name:"ModelRoomLabelPlugin",version:0};var pt=(i=>(i[i.FLOOR=1]="FLOOR",i[i.CEILING=2]="CEILING",i[i.BOUNDING_CENTER=3]="BOUNDING_CENTER",i))(pt||{});function ti(i){return H(this,null,function*(){try{return[null,yield i]}catch(t){return t instanceof Error?[t,null]:[new Error(""),null]}})}function ni(i){return Object.prototype.toString.call(i)==="[object Object]"}function li(i,t){return i===t?!0:typeof i!=typeof t?!1:!!(Number.isNaN(i)&&Number.isNaN(t))}function cu(i,t){const e=Object.getOwnPropertyNames(i),n=Object.getOwnPropertyNames(t);if(e.length!==n.length)return!1;for(let o=0,s=e.length;o<s;o++){const r=e[o];if(!li(i[r],t[r]))return!1}return!0}function uu(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!li(i[e],t[e]))return!1;return!0}function du(i,t){return li(i,t)?!0:ni(i)&&ni(t)?cu(i,t):Array.isArray(i)&&Array.isArray(t)?uu(i,t):!1}function ro(i,t){return li(i,t)?!0:ni(i)&&ni(t)?fu(i,t):Array.isArray(i)&&Array.isArray(t)?hu(i,t):!1}function hu(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!ro(i[e],t[e]))return!1;return!0}function fu(i,t){const e=Object.getOwnPropertyNames(i),n=Object.getOwnPropertyNames(t);if(e.length!==n.length)return!1;for(let o=0,s=e.length;o<s;o++){const r=e[o];if(!ro(i[r],t[r]))return!1}return!0}function et(i,t,e={deep:!1}){return e.deep?ro(i,t):du(i,t)}function _t(i){return i<.5?4*i*i*i:.5*Math.pow(2*i-2,3)+1}function Ta(i){const t=i-1;return t*t*t+1}function Mt(i,{delay:t=0,duration:e=400,easing:n=At}={}){const o=+getComputedStyle(i).opacity;return{delay:t,duration:e,easing:n,css:s=>`opacity: ${s*o}`}}function Qo(i,{delay:t=0,duration:e=400,easing:n=Ta,x:o=0,y:s=0,opacity:r=0}={}){const a=getComputedStyle(i),l=+a.opacity,c=a.transform==="none"?"":a.transform,u=l*(1-r);return{delay:t,duration:e,easing:n,css:(h,d)=>`
|
|
105
105
|
transform: ${c} translate(${(1-h)*o}px, ${(1-h)*s}px);
|
|
106
106
|
opacity: ${l-u*d}`}}function ii(i,{delay:t=0,speed:e,duration:n,easing:o=_t}={}){let s=i.getTotalLength();const r=getComputedStyle(i);return r.strokeLinecap!=="butt"&&(s+=parseInt(r.strokeWidth)),n===void 0?e===void 0?n=800:n=s/e:typeof n=="function"&&(n=n(s)),{delay:t,duration:n,easing:o,css:(a,l)=>`stroke-dasharray: ${a*s} ${l*s}`}}const vt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAMAAAANf8AYAAAC2VBMVEUAAACCnP+Dn/+Enf+HqP+Gp/+Fof+Gpf+IrP+Lsf+Dof+Cmv+Lsv+Mtf+Eo/+Bmf+JrP+Hqf+Env+Krv+Fo/+Pu/+Ms/+Qvv+Hqf+RwP+KsP+Fpf+Mtv+Gov+Bnf+Qv/+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mO7DZbL/786+s0TIpKqXOhgqGCKcnhOrd28HBlmj+2LFZWia9KjkqnHoa3BmsjG7wKIgDuSzQw9F29Gh+3jDunTseWas1zKtKYbiIsrEjZdAF2iPiYOvIz+Nyuebm5h6+HuvGa2xU0qhwBbkzayzjDO8y3IwgbAdHPp87zNx8sIvLYN/tvhc1TF1lWqSEwaMWgG3ABpIB4sC2HY2Ei0sf0O2YmLWr1CdQGRYp8SK3ic/ZnRWMLqQ+2xGRwUD069dvV8zcuRom+rlA6Y2MbgGmhAGEz4VYSPQF5cyZM6GFYl6eTlN6ixi6aE6PqDLQZRi4EKI/KOfGFjUzqCKsXu6l2RpuAKJxiI1tHhcQJAYOHDhgwOZZs4ZSTHR5lQQYPDW1DS4aELQxdyEIAANGjtk8c6aaqTslk8gVwIAN0w3rAEL2bMtHm12AIOHqenXaNDWztEwo9hKJGHjR6OO0yDSI1IGdoQ0iY0a6Tt+06fKUDRQzqKw8Qlxr1AXrwNqwDvGBA+BrGUDc3d3Xr5+SQZj0E2ERqXIjPAJYNUbD18FoWEeDbHLPzLyQ4ePjQ5i3x1RCubfmpqkjMMNo6KOJ5uqe+f58C9GoaD29XyVSYS1h4DftKeWDDN4AbACZMZAsExEKghWUNKXWhlPfA2P1qjmUT556a9jmQotWi/VOFael1lR7ep4JfRZy8nhpwtG4wMMB/gdi9/nNH+vhezsmJ+fG5quX12fomHl6J+KFy88uA2RJyJPE4wkL4wIPBfgXxO5HxGN7zNw5W2bNnLZhio+OmaR3LD6tplrLfKeYAwX7/O6Dje/2dpniwuKiwoMHH+bn7723Z8/uHTu2fpg9+3p29sYrWVnr1l1cO2HCUFCGT+tshUcWLPj6IDf37ued27Z9unXz2owZU6dOnnxp4sQ1q1ePH79KN6vbQWc1SrfrTit6lO5NO6/F8yZNmofBfgNTwRQLsPLsHQAAAABJRU5ErkJggg==";function za(i){return i*180/Math.PI}function mu(i){ce(i,"svelte-17cl35n",".floorplan__camera-position.svelte-17cl35n{position:absolute;width:0;height:0}.floorplan__camera-rotate.svelte-17cl35n{position:absolute;background-repeat:no-repeat;background-size:100%}")}function pu(i){let t,e;return{c(){t=z("div"),e=z("div"),b(e,"class","floorplan__camera-rotate svelte-17cl35n"),L(e,"background-image",`url(${i[0]||vt})`),L(e,"width",i[4]),L(e,"height",i[4]),L(e,"left","-"+i[4]),L(e,"top","-"+i[4]),L(e,"transform",`rotate(${i[3]}deg)`),L(e,"transform-origin",`${i[4]} ${i[4]}`),b(t,"class","floorplan__camera-position svelte-17cl35n"),L(t,"left",i[1]),L(t,"top",i[2])},m(n,o){T(n,t,o),B(t,e)},p(n,[o]){o&1&&L(e,"background-image",`url(${n[0]||vt})`)},i:Y,o:Y,d(n){n&&M(t)}}}function gu(i,t,e){let{panoIndex:n}=t,{floorplanData:o}=t,{lastPanoramaLongitude:s}=t,{cameraImageUrl:r}=t;const{observers:a}=o,l=a[n],c=l.positionInImage.x,u=l.positionInImage.y,h=c*100+"%",d=u*100+"%",f=-za(s)+45,g=document.body.clientWidth,A=document.body.clientHeight,v=`${(g<500||A<500?17:37)/16}rem`;return i.$$set=y=>{"panoIndex"in y&&e(5,n=y.panoIndex),"floorplanData"in y&&e(6,o=y.floorplanData),"lastPanoramaLongitude"in y&&e(7,s=y.lastPanoramaLongitude),"cameraImageUrl"in y&&e(0,r=y.cameraImageUrl)},[r,h,d,f,v,n,o,s]}class Au extends oe{constructor(t){super(),ie(this,t,gu,pu,ne,{panoIndex:5,floorplanData:6,lastPanoramaLongitude:7,cameraImageUrl:0},mu)}}const vu="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArUAAAB7CAMAAABdA4ieAAAC91BMVEUAAACOpP/H0P+yxP/a4/+asv/W3/+/z/+cs//S3f+mu//Q2//5+v/H1P/d5f/l6//y9f++zf/i6f+ww/+ovP/7/P/u8v/N2f+Mp//q7/+4yf+uwf+Wr/+7y/+1xv+Ho//x9P+9zP+2x/+swP+gt/+Oqf/Y4v/r8P/l7P/b4//F0/+juf+Zsv+XsP+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p38TfYlEUgJaetWUOZwP3P3UnetYCW1ChU52JogoS1UKIlq9gT95yILSugKRKciq2VhLaEpIVm3366j2pxaSMyf07YRUlND5qTynvGG6aaDOSWgnptFiIKoQLWmQ7pLphuOkTB0lqoZDSTGiVBrXE1iT0wbgEEn0gtSEEncoNfRV1uKKN/KqL+/4C1xYSA7XapjATRGU1hGxT3NtcGnUK0UJgZf7TuDWEls1yt9wiWsja7awzYRWttYgWYrPcLbejWqua2WaCqBSixQLvWe5mi06RWqv8TDOhNUrZC9sdm+Xuu5cpUqvU+wwzYbVVkIXYLHd/olekVpmpZ8KiMYbU7ma/EXJZBW5JrZl2V9bRnNWyWe4xt8TWTPd3FdEYSEFslnsoURlAi01FqN56f2br2xeOe9ytgbyf4nErGg/hl6RN4Jc5Lt++2rVjHMdCIIqiqtoRQW2mMogIyZFjlsB2B9wjjaY1PXa3wcbSPaEDR1fP9fVt8aPai2+f2+TlWu2l0yweZHlEO5S9cyu1lDKj5T/fWCH4jLaUnXMbvFyrzby8xRrayqUM2+ZWqvuM1nmpgHWkl8F9z9yG7LNa5yEMa0n8yHb93Er1oXjnoMVyFn3KQVcP7VRpFn+sDiznaiuHNufsHnkIwy7aPA/r5jbFGW3m7S12ku55WPN7Li1PPIRhN6sjtBjTmm+KmYcwPEOKs9tHF1JDHCoHLZ5DQ8yPBic9DoHjAKvsb85qjbFxHOCprMZaf5qdhlorxwGeTsPIttvPlno0y3GAZfbHp6n3ynGAV0m99u/2J6H3znGAvW4n+J25tdY7xwFey1pvQe6/DlrjOMDLqfXW7N5pbs0YWhxgtpj0rl1uiaHFISzccSWohUCzOIemm0VKChwHOMutKCVwHOA4av/JVi0xtDiRpCRfRcvQ4lBfxSnG0OJc/+xTjKHFyVRMP38iDC0O92lZVRhanO+vcVWGFu9BRWkW7+Z3rapEizdy7ZVm8V5Gtr8AtSnix59eOmYAAAAASUVORK5CYII=";function bu(i){ce(i,"svelte-rpkaro",".floorplan-plugin__compass.svelte-rpkaro{position:absolute;left:50%;top:-2.875rem;width:14.4375rem;height:2.5625rem;will-change:opacity;transform-origin:center 11.5rem}.floorplan-plugin__compass-image.svelte-rpkaro{width:100%;height:100%;position:absolute;left:0;top:0;opacity:0.1;background-repeat:no-repeat;background-size:100% 100%}.floorplan-plugin__compass-text.svelte-rpkaro{position:absolute;left:50%;top:0.9375rem;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:0.625rem;color:#fff}")}function yu(i){let t,e,n,o,s;return{c(){t=z("div"),e=z("div"),n=$(),o=z("span"),s=ke(i[0]),b(e,"class","floorplan-plugin__compass-image svelte-rpkaro"),L(e,"background-image",`url(${vu})`),b(o,"class","floorplan-plugin__compass-text svelte-rpkaro"),b(t,"class","floorplan-plugin__compass svelte-rpkaro"),L(t,"transform",i[2])},m(r,a){T(r,t,a),B(t,e),B(t,n),B(t,o),B(o,s)},p(r,a){a&1&&Me(s,r[0])},d(r){r&&M(t)}}}function wu(i){let t,e=i[1]&&yu(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),T(n,t,o)},p(n,[o]){n[1]&&e.p(n,o)},i:Y,o:Y,d(n){e&&e.d(n),n&&M(t)}}}function Cu(i){return i/Math.PI*180}function Pu(i,t,e){var c;let{floorplanData:n}=t,{northDesc:o}=t;const s=(c=n.entrance)==null?void 0:c.northRad,r=typeof s=="number",l=`translateX(-50%) translateZ(10px) rotate(${-(s?Cu(s):0)+90}deg)`;return i.$$set=u=>{"floorplanData"in u&&e(3,n=u.floorplanData),"northDesc"in u&&e(0,o=u.northDesc)},[o,r,l,n]}class Eu extends oe{constructor(t){super(),ie(this,t,Pu,wu,ne,{floorplanData:3,northDesc:0},bu)}}const Qt=[];function ao(i,t=Y){let e;const n=new Set;function o(a){if(ne(i,a)&&(i=a,e)){const l=!Qt.length;for(const c of n)c[1](),Qt.push(c,i);if(l){for(let c=0;c<Qt.length;c+=2)Qt[c][0](Qt[c+1]);Qt.length=0}}}function s(a){o(a(i))}function r(a,l=Y){const c=[a,l];return n.add(c),n.size===1&&(e=t(o)||Y),a(i),()=>{n.delete(c),n.size===0&&(e(),e=null)}}return{set:o,update:s,subscribe:r}}function Iu(i){ce(i,"svelte-1gfoniz","img.svelte-1gfoniz{width:100%;height:100%}")}function ku(i){let t,e;return{c(){t=z("img"),_e(t.src,e=i[0])||b(t,"src",e),b(t,"alt","floorplan iamge"),b(t,"class","svelte-1gfoniz")},m(n,o){T(n,t,o)},p(n,[o]){o&1&&!_e(t.src,e=n[0])&&b(t,"src",e)},i:Y,o:Y,d(n){n&&M(t)}}}function xu(i,t,e){let{url:n}=t;return i.$$set=o=>{"url"in o&&e(0,n=o.url)},[n]}class Du extends oe{constructor(t){super(),ie(this,t,xu,ku,ne,{url:0},Iu)}}function Lu(i){ce(i,"svelte-ub47ya",".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}")}function Su(i){let t,e,n,o;return{c(){t=z("div"),e=new Zn(!1),n=$(),o=new Zn(!1),e.a=n,o.a=null,b(t,"class","floorplan-plugin__base-image svelte-ub47ya")},m(s,r){T(s,t,r),e.m(i[1],t),B(t,n),o.m(i[0],t)},p(s,[r]){r&1&&o.p(s[0])},i:Y,o:Y,d(s){s&&M(t)}}}function Mu(i,t,e){let{content:n}=t;const o=`
|
|
107
107
|
<style>
|
|
@@ -112,7 +112,7 @@ transition: all 500ms;
|
|
|
112
112
|
svg [type='lineItemGroup'] g g g g {
|
|
113
113
|
stroke: #ffffff;
|
|
114
114
|
}</style>
|
|
115
|
-
`;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class Tu extends oe{constructor(t){super(),ie(this,t,Mu,Su,ne,{content:0},Lu)}}function zu(i){ce(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function Bu(i){let t,e;return t=new Du({props:{url:i[1].url}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.url=n[1].url),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function ju(i){let t,e;return t=new Tu({props:{content:i[0]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.content=n[0]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Vu(i){let t,e,n,o;const s=[ju,Bu],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(i))&&(n=r[e]=s[e](i)),{c(){t=z("div"),n&&n.c(),b(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){T(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let u=e;e=a(l),e===u?~e&&r[e].p(l,c):(n&&(se(),D(r[u],1,1,()=>{r[u]=null}),re()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),E(n,1),n.m(t,null)):n=null)},i(l){o||(E(n),o=!0)},o(l){D(n),o=!1},d(l){l&&M(t),~e&&r[e].d()}}}function Qu(i,t,e){let n,o,{floorIndex:s}=t,{floorplanData:r}=t;return i.$$set=a=>{"floorIndex"in a&&e(2,s=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},i.$$.update=()=>{var a,l;i.$$.dirty&12&&e(1,n=r.outlines[s]),i.$$.dirty&12&&e(0,o=(l=(a=r.outlines)==null?void 0:a[s])==null?void 0:l.svgContent)},[o,n,s,r]}class Ba extends oe{constructor(t){super(),ie(this,t,Qu,Vu,ne,{floorIndex:2,floorplanData:3},zu)}}function Ou(i){ce(i,"svelte-12pzct5",".floorplan-plugin__room-label-item.svelte-12pzct5{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:1;color:#fff;transform:translate(-50%, -50%);white-space:nowrap;will-change:opacity;transition:opacity 300ms}.floorplan-plugin__room-size.svelte-12pzct5{opacity:0.45}")}function Ru(i){let t,e=i[8].outerHTML+"",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&256&&e!==(e=o[8].outerHTML+"")&&t.p(e)},d(o){o&&M(n),o&&t.d()}}}function Fu(i){let t,e,n=i[1]&&Oo(i),o=i[0]&&Ro(i);return{c(){n&&n.c(),t=$(),o&&o.c(),e=fe()},m(s,r){n&&n.m(s,r),T(s,t,r),o&&o.m(s,r),T(s,e,r)},p(s,r){s[1]?n?n.p(s,r):(n=Oo(s),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),s[0]?o?o.p(s,r):(o=Ro(s),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(s){n&&n.d(s),s&&M(t),o&&o.d(s),s&&M(e)}}}function Oo(i){let t,e=i[2].name+"",n;return{c(){t=z("span"),n=ke(e),b(t,"class","floorplan-plugin__room-name")},m(o,s){T(o,t,s),B(t,n)},p(o,s){s&4&&e!==(e=o[2].name+"")&&Me(n,e)},d(o){o&&M(t)}}}function Ro(i){let t,e;return{c(){t=z("span"),e=ke(i[7]),b(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(n,o){T(n,t,o),B(t,e)},p(n,o){o&128&&Me(e,n[7])},d(n){n&&M(t)}}}function Hu(i){let t,e;function n(r,a){if(r[3]===void 0)return Fu;if(r[8])return Ru}let o=n(i),s=o&&o(i);return{c(){t=z("div"),s&&s.c(),b(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),xe(()=>i[19].call(t)),L(t,"left",i[9]),L(t,"top",i[10]),L(t,"font-size",i[11]),L(t,"opacity",i[6]?"1":"0")},m(r,a){T(r,t,a),s&&s.m(t,null),e=tt(t,i[19].bind(t))},p(r,[a]){o===(o=n(r))&&s?s.p(r,a):(s&&s.d(1),s=o&&o(r),s&&(s.c(),s.m(t,null))),a&64&&L(t,"opacity",r[6]?"1":"0")},i:Y,o:Y,d(r){r&&M(t),s&&s.d(),e()}}}function Gu(i,t){const e=i[0],n=i[1];let o=!1;for(let s=0,r=t.length-1;s<t.length;r=s++){const a=t[s][0],l=t[s][1],c=t[r][0],u=t[r][1];l>n!=u>n&&e<(c-a)*(n-l)/(u-l)+a&&(o=!o)}return o}function Wu(i,t,e){let n,o,s,r,a,{pxmm:l}=t,{roomAreaEnable:c}=t,{roomNameEnable:u}=t,{room:h}=t,{hoveredRoom:d}=t,{getRoomAreaText:f}=t,{getLabelElement:g}=t,{adaptiveRoomLabelVisibleEnable:A}=t;function p(R,U){if(U.width===0||U.height===0)return()=>!1;const j=R.path.map(({x:he,y:ue})=>[he,ue]),F=R.roomLabel.position,{x:W,y:X}=F,{width:G,height:ee}=U,N=G/2,ae=ee/2;return function(ue){const pe=W*ue,Pe=X*ue,Le=j.map(([le,ge])=>[le*ue,ge*ue]);return[[pe+N,Pe-ae],[pe-N,Pe-ae],[pe-N,Pe+ae],[pe+N,Pe+ae]].every(le=>Gu(le,Le))}}const v=document.body.clientWidth,y=document.body.clientHeight,w=h.roomLabel,P=w.positionInImage.x*100+"%",k=w.positionInImage.y*100+"%",C=(v<500||y<500?10:14)+"px";let S=0,x=0,Q=!1;d.subscribe(function(U){e(16,Q=!!U&&U.id===h.id)});function _(){S=this.clientWidth,x=this.clientHeight,e(4,S),e(5,x)}return i.$$set=R=>{"pxmm"in R&&e(12,l=R.pxmm),"roomAreaEnable"in R&&e(0,c=R.roomAreaEnable),"roomNameEnable"in R&&e(1,u=R.roomNameEnable),"room"in R&&e(2,h=R.room),"hoveredRoom"in R&&e(13,d=R.hoveredRoom),"getRoomAreaText"in R&&e(14,f=R.getRoomAreaText),"getLabelElement"in R&&e(3,g=R.getLabelElement),"adaptiveRoomLabelVisibleEnable"in R&&e(15,A=R.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&12&&e(8,n=g==null?void 0:g(h)),i.$$.dirty&16388&&e(7,o=h.size?f(h.size):""),i.$$.dirty&48&&e(18,s={width:S,height:x}),i.$$.dirty&262148&&e(17,r=s?p(h,s):void 0),i.$$.dirty&233472&&e(6,a=A?Q?!0:!!(r!=null&&r(l)):!0)},[c,u,h,g,S,x,a,o,n,P,k,C,l,d,f,A,Q,r,s,_]}class Nu extends oe{constructor(t){super(),ie(this,t,Wu,Hu,ne,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},Ou)}}function _u(i){ce(i,"svelte-13xux0b",".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}")}function Fo(i,t,e){const n=i.slice();return n[12]=t[e],n}function Ho(i){let t,e=[],n=new Map,o,s,r=i[8];const a=l=>l[12].id;for(let l=0;l<r.length;l+=1){let c=Fo(i,r,l),u=a(c);n.set(u,e[l]=Go(u,c))}return{c(){t=z("div");for(let l=0;l<e.length;l+=1)e[l].c();b(t,"class","floorplan-plugin__room-labels svelte-13xux0b"),xe(()=>i[11].call(t))},m(l,c){T(l,t,c);for(let u=0;u<e.length;u+=1)e[u].m(t,null);o=tt(t,i[11].bind(t)),s=!0},p(l,c){c&447&&(r=l[8],se(),e=qe(e,c,a,1,l,r,n,t,Et,Go,null,Fo),re())},i(l){if(!s){for(let c=0;c<r.length;c+=1)E(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)D(e[c]);s=!1},d(l){l&&M(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}function Go(i,t){let e,n,o;const s=[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}];let r={};for(let a=0;a<s.length;a+=1)r=je(r,s[a]);return n=new Nu({props:r}),{key:i,first:null,c(){e=fe(),K(n.$$.fragment),this.first=e},m(a,l){T(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&447?Oe(s,[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}]):{};n.$set(c)},i(a){o||(E(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&M(e),Z(n,a)}}}function Xu(i){let t,e,n=i[8]&&Ho(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[8]?n?(n.p(o,s),s&256&&E(n,1)):(n=Ho(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Yu(i,t,e){let n,{floorIndex:o}=t,{roomAreaEnable:s}=t,{roomNameEnable:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{getRoomAreaText:c}=t,{getLabelElement:u}=t,{adaptiveRoomLabelVisibleEnable:h}=t,d=0,f=0;function g(){d=this.clientWidth,e(6,d)}return i.$$set=A=>{"floorIndex"in A&&e(9,o=A.floorIndex),"roomAreaEnable"in A&&e(0,s=A.roomAreaEnable),"roomNameEnable"in A&&e(1,r=A.roomNameEnable),"floorplanData"in A&&e(10,a=A.floorplanData),"hoveredRoom"in A&&e(2,l=A.hoveredRoom),"getRoomAreaText"in A&&e(3,c=A.getRoomAreaText),"getLabelElement"in A&&e(4,u=A.getLabelElement),"adaptiveRoomLabelVisibleEnable"in A&&e(5,h=A.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&1536&&e(8,n=a.floorDatas[o].rooms),i.$$.dirty&1088){const{max:A,min:p}=a.bounding,v=A.x-p.x;e(7,f=d/v)}},[s,r,l,c,u,h,d,f,n,o,a,g]}class Uu extends oe{constructor(t){super(),ie(this,t,Yu,Xu,ne,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},_u)}}function qu(i){ce(i,"svelte-djlmk4",".floorplan-plugin__rule-labels.svelte-djlmk4.svelte-djlmk4{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-djlmk4.svelte-djlmk4{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4.svelte-djlmk4{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4.svelte-djlmk4{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4.svelte-djlmk4{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-djlmk4.svelte-djlmk4{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale-wrapper.svelte-djlmk4{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-djlmk4.svelte-djlmk4{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale.svelte-djlmk4{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute}.floorplan-plugin__rule-labels--top.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-djlmk4.svelte-djlmk4{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-text-item.svelte-djlmk4{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-djlmk4.svelte-djlmk4{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}")}function Wo(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function No(i,t,e){const n=i.slice();return n[14]=t[e],n}function _o(i){let t;return{c(){t=z("div"),b(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),L(t,"left",i[14].left*100+"%"),L(t,"bottom",i[14].bottom*100+"%")},m(e,n){T(e,t,n)},p:Y,d(e){e&&M(t)}}}function Xo(i,t){let e,n,o=t[1](t[11].distance)+"",s,r;return{key:i,first:null,c(){e=z("div"),n=z("div"),s=ke(o),r=$(),b(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),q(n,"is-row",t[2]),b(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),L(e,"left",t[11].left*100+"%"),L(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){T(a,e,l),B(e,n),B(n,s),B(e,r)},p(a,l){t=a,l&2&&o!==(o=t[1](t[11].distance)+"")&&Me(s,o)},d(a){a&&M(e)}}}function Ju(i){let t,e,n,o,s,r,a=[],l=new Map,c,u=i[3],h=[];for(let g=0;g<u.length;g+=1)h[g]=_o(No(i,u,g));let d=i[4];const f=g=>g[13];for(let g=0;g<d.length;g+=1){let A=Wo(i,d,g),p=f(A);l.set(p,a[g]=Xo(p,A))}return{c(){t=z("div"),e=z("div"),n=$(),o=z("div");for(let g=0;g<h.length;g+=1)h[g].c();s=$(),r=z("div");for(let g=0;g<a.length;g+=1)a[g].c();b(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),b(o,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),q(o,"is-row",i[2]),b(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),b(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+i[0]+" svelte-djlmk4"),q(t,"is-row",i[2]),L(t,"width",i[2]?"100%":1/16+"rem"),L(t,"height",i[2]?1/16+"rem":"100%")},m(g,A){T(g,t,A),B(t,e),B(t,n),B(t,o);for(let p=0;p<h.length;p+=1)h[p].m(o,null);B(t,s),B(t,r);for(let p=0;p<a.length;p+=1)a[p].m(r,null)},p(g,[A]){if(A&8){u=g[3];let p;for(p=0;p<u.length;p+=1){const v=No(g,u,p);h[p]?h[p].p(v,A):(h[p]=_o(v),h[p].c(),h[p].m(o,null))}for(;p<h.length;p+=1)h[p].d(1);h.length=u.length}A&22&&(d=g[4],a=qe(a,A,f,1,g,d,l,r,so,Xo,null,Wo)),A&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+g[0]+" svelte-djlmk4")&&b(t,"class",c),A&5&&q(t,"is-row",g[2])},i:Y,o:Y,d(g){g&&M(t),at(h,g);for(let A=0;A<a.length;A+=1)a[A].d()}}}const Ot=1e3,Rt=180;function Zu(i,t,e){let{type:n}=t,{data:o}=t,{bounding:s}=t,{getRuleDistanceText:r}=t;const a=n==="top"||n==="bottom",l=s.max.x-s.min.x-(Ot-Rt)*2,c=s.max.y-s.min.y-(Ot-Rt)*2,u=o.map(([g,A])=>a?[g.x,A.x]:[g.y,A.y]).flat().sort().filter((g,A,p)=>A===0?!0:g!==p[A-1]),h=u.map(g=>{const A=a?(g-s.min.x-Ot+Rt)/l:0,p=a?0:(g-s.min.y-Ot+Rt)/c;return{left:A,bottom:p}});h.unshift({left:0,bottom:0}),h.push(a?{left:1,bottom:0}:{left:0,bottom:1});const d=u[u.length-1]-u[0],f=u.map((g,A,p)=>{const v=A===0?0:g-p[A-1],y=A===0?0:(g+p[A-1])/2,w=a?(y-s.min.x-Ot+Rt)/l:0,P=a?0:(y-s.min.y-Ot+Rt)/c;return{left:w,bottom:P,distance:v}}).filter(({distance:g})=>g/d>.1);return i.$$set=g=>{"type"in g&&e(0,n=g.type),"data"in g&&e(5,o=g.data),"bounding"in g&&e(6,s=g.bounding),"getRuleDistanceText"in g&&e(1,r=g.getRuleDistanceText)},[n,r,a,h,f,o,s]}class Ku extends oe{constructor(t){super(),ie(this,t,Zu,Ju,ne,{type:0,data:5,bounding:6,getRuleDistanceText:1},qu)}}function $u(i){ce(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function Yo(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function Uo(i,t){let e,n,o;const s=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<s.length;a+=1)r=je(r,s[a]);return n=new Ku({props:r}),{key:i,first:null,c(){e=fe(),K(n.$$.fragment),this.first=e},m(a,l){T(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&19?Oe(s,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){o||(E(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&M(e),Z(n,a)}}}function ed(i){let t,e=[],n=new Map,o,s=i[4];const r=a=>a[13];for(let a=0;a<s.length;a+=1){let l=Yo(i,s,a),c=r(l);n.set(c,e[a]=Uo(c,l))}return{c(){t=z("div");for(let a=0;a<e.length;a+=1)e[a].c();b(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),L(t,"width",i[3]),L(t,"height",i[2])},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&19&&(s=a[4],se(),e=qe(e,l,r,1,a,s,n,t,Et,Uo,null,Yo),re()),l&8&&L(t,"width",a[3]),l&4&&L(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)E(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()}}}const qo=1e3,Jo=180;function td(i,t,e){let n,o,s,r,a,l,c,u,h,d,{floorIndex:f}=t,{floorplanData:g}=t,{getRuleDistanceText:A}=t;return i.$$set=p=>{"floorIndex"in p&&e(5,f=p.floorIndex),"floorplanData"in p&&e(6,g=p.floorplanData),"getRuleDistanceText"in p&&e(0,A=p.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=g.bounding),i.$$.dirty&96&&e(11,o=g.floorDatas[f].rules),i.$$.dirty&2048&&e(12,s=Object.keys(o)),i.$$.dirty&6144&&e(4,r=s.map(p=>[p,o[p]])),i.$$.dirty&2&&e(9,a=n.max.x-n.min.x),i.$$.dirty&2&&e(7,l=n.max.y-n.min.y),i.$$.dirty&2&&e(10,c=n.max.x-n.min.x-(qo-Jo)*2),i.$$.dirty&2&&e(8,u=n.max.y-n.min.y-(qo-Jo)*2),i.$$.dirty&1536&&e(3,h=c/a*100+"%"),i.$$.dirty&384&&e(2,d=u/l*100+"%")},[A,n,d,h,r,f,g,l,u,a,c,o,s]}class nd extends oe{constructor(t){super(),ie(this,t,td,ed,ne,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},$u)}}function ci(i,t={}){let e="";const{needZ:n,needA:o}=t;return(n?i.slice().concat(i[0]):i.slice()).forEach((r,a)=>{const{x:l,y:c}=t.format?t.format(r):r,u=l+","+c;return a===0?(e+="M"+u,e):o!=null&&o[a]?(e+="A"+o[a]+","+u,e):(e+="L"+u,e)}),e+(n?"Z":"")}function ja({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function id(i,t){const e=i.x*1e3+t.bounding.origin.x,n=-i.z*1e3+t.bounding.origin.y;return{x:e,y:n}}function od(i,t){const e=t.bounding,n=e.max.x-e.min.x,o=e.max.y-e.min.y;return{x:(i.x-e.min.x)/n,y:(e.max.y-i.y)/o}}function sd(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function rd(i){let t;return{c(){t=ye("path"),b(t,"d",i[0]),b(t,"fill","#2F313A")},m(e,n){T(e,t,n)},p(e,[n]){n&1&&b(t,"d",e[0])},i:Y,o:Y,d(e){e&&M(t)}}}function ad(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=ci(o,{needZ:!0}))},[n,o]}class ld extends oe{constructor(t){super(),ie(this,t,ad,rd,ne,{path:1})}}function cd(i){let t,e,n,o,s,r;return{c(){t=ye("defs"),e=ye("pattern"),n=ye("rect"),o=ye("path"),s=$(),r=ye("path"),b(n,"x","0"),b(n,"y","0"),b(n,"width",i[1]),b(n,"height",i[1]),b(n,"fill","#323747"),b(o,"d",i[2]),b(o,"stroke","#ffffff"),b(o,"stroke-opacity","0.06"),b(o,"stroke-width","0.5"),b(o,"fill","none"),b(e,"id","fpm-room-pattern-0"),b(e,"x","0"),b(e,"y","0"),b(e,"width",i[1]),b(e,"height",i[1]),b(e,"patternUnits","userSpaceOnUse"),b(e,"patternTransform","scale(50 50)"),b(r,"d",i[0]),b(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){T(a,t,l),B(t,e),B(e,n),B(e,o),T(a,s,l),T(a,r,l)},p(a,[l]){l&1&&b(r,"d",a[0])},i:Y,o:Y,d(a){a&&M(t),a&&M(s),a&&M(r)}}}const Ii=6;function ud(i,t,e){let n,{path:o}=t;const s=Ii*2,r=`M0 ${Ii} h ${s} M${Ii} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=ci(o,{needZ:!0}))},[n,s,r,o]}class dd extends oe{constructor(t){super(),ie(this,t,ud,cd,ne,{path:3})}}function hd(i){let t,e,n,o,s,r,a,l,c,u,h;return{c(){t=ye("defs"),e=ye("pattern"),n=ye("rect"),o=ye("pattern"),s=ye("rect"),r=$(),a=ye("path"),l=$(),c=ye("path"),u=$(),h=ye("path"),b(n,"x","0"),b(n,"y","0"),b(n,"width","6"),b(n,"height","50"),b(n,"fill","none"),b(n,"stroke","#4B4B57"),b(n,"stroke-width","0.5"),b(e,"id","room-material-pattern-1"),b(e,"x","0"),b(e,"y","0"),b(e,"width","12"),b(e,"height","50"),b(e,"patternUnits","userSpaceOnUse"),b(e,"patternTransform","scale(50 50)"),b(s,"x","0"),b(s,"y","0"),b(s,"width","6"),b(s,"height","50"),b(s,"fill","none"),b(s,"stroke","#4B4B57"),b(s,"stroke-width","0.5"),b(o,"id","room-material-pattern-2"),b(o,"x","6"),b(o,"y","25"),b(o,"width","12"),b(o,"height","50"),b(o,"patternUnits","userSpaceOnUse"),b(o,"patternTransform","scale(50 50)"),b(a,"d",i[0]),b(a,"fill","#43434D"),b(c,"d",i[0]),b(c,"fill","url(#room-material-pattern-1)"),b(h,"d",i[0]),b(h,"fill","url(#room-material-pattern-2)")},m(d,f){T(d,t,f),B(t,e),B(e,n),B(t,o),B(o,s),T(d,r,f),T(d,a,f),T(d,l,f),T(d,c,f),T(d,u,f),T(d,h,f)},p(d,[f]){f&1&&b(a,"d",d[0]),f&1&&b(c,"d",d[0]),f&1&&b(h,"d",d[0])},i:Y,o:Y,d(d){d&&M(t),d&&M(r),d&&M(a),d&&M(l),d&&M(c),d&&M(u),d&&M(h)}}}function fd(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=ci(o,{needZ:!0}))},[n,o]}class md extends oe{constructor(t){super(),ie(this,t,fd,hd,ne,{path:1})}}function pd(i){ce(i,"svelte-1dykexu",".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}")}function Zo(i,t,e){const n=i.slice();return n[5]=t[e],n}function gd(i){let t,e;return t=new dd({props:{path:i[5].path}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Ad(i){let t,e;return t=new md({props:{path:i[5].path}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function vd(i){let t,e;return t=new ld({props:{path:i[5].path}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Ko(i){let t,e,n,o;const s=[vd,Ad,gd],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(i),n=r[e]=s[e](i),{c(){t=ye("svg"),n.c(),b(t,"width","100%"),b(t,"height","100%"),b(t,"viewBox",`0 0 ${i[1]} ${i[2]}`),b(t,"class","svelte-1dykexu")},m(l,c){T(l,t,c),r[e].m(t,null),o=!0},p(l,c){let u=e;e=a(l),e===u?r[e].p(l,c):(se(),D(r[u],1,1,()=>{r[u]=null}),re(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),E(n,1),n.m(t,null))},i(l){o||(E(n),o=!0)},o(l){D(n),o=!1},d(l){l&&M(t),r[e].d()}}}function bd(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=Ko(Zo(i,n,r));const s=r=>D(o[r],1,1,()=>{o[r]=null});return{c(){t=z("div");for(let r=0;r<o.length;r+=1)o[r].c();b(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){T(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=Zo(r,n,l);o[l]?(o[l].p(c,a),E(o[l],1)):(o[l]=Ko(c),o[l].c(),E(o[l],1),o[l].m(t,null))}for(se(),l=n.length;l<o.length;l+=1)s(l);re()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)E(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)D(o[a]);e=!1},d(r){r&&M(t),at(o,r)}}}function yd(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t;const r=s.bounding.max.x-s.bounding.min.x,a=s.bounding.max.y-s.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(3,o=l.floorIndex),"floorplanData"in l&&e(4,s=l.floorplanData)},i.$$.update=()=>{i.$$.dirty&24&&e(0,n=s.floorDatas[o].rooms.map(l=>me(O({},l),{path:l.path.map(c=>ja(c,s.bounding))})))},[n,r,a,o,s]}class wd extends oe{constructor(t){super(),ie(this,t,yd,bd,ne,{floorIndex:3,floorplanData:4},pd)}}function Cd(i){ce(i,"svelte-19uvvss","path.svelte-19uvvss{opacity:0}path.svelte-19uvvss:hover{opacity:0.1}")}function Pd(i){let t,e,n;return{c(){t=ye("path"),b(t,"d",i[2]),b(t,"fill","#fff"),b(t,"class","svelte-19uvvss")},m(o,s){T(o,t,s),e||(n=[we(t,"mouseenter",i[0]),we(t,"mouseleave",i[1])],e=!0)},p:Y,i:Y,o:Y,d(o){o&&M(t),e=!1,ct(n)}}}function Ed(i,t,e){let{room:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t;function r(){s.set(n)}function a(){s.set(void 0)}const{bounding:l}=o,c=ci(n.path,{needZ:!0,format:u=>ja(u,l)});return i.$$set=u=>{"room"in u&&e(3,n=u.room),"floorplanData"in u&&e(4,o=u.floorplanData),"hoveredRoom"in u&&e(5,s=u.hoveredRoom)},[r,a,c,n,o,s]}class Id extends oe{constructor(t){super(),ie(this,t,Ed,Pd,ne,{room:3,floorplanData:4,hoveredRoom:5},Cd)}}function kd(i){ce(i,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function $o(i,t,e){const n=i.slice();return n[5]=t[e],n}function es(i,t){let e,n,o;const s=[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}];let r={};for(let a=0;a<s.length;a+=1)r=je(r,s[a]);return n=new Id({props:r}),{key:i,first:null,c(){e=fe(),K(n.$$.fragment),this.first=e},m(a,l){T(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&7?Oe(s,[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}]):{};n.$set(c)},i(a){o||(E(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&M(e),Z(n,a)}}}function xd(i){let t,e,n=[],o=new Map,s,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[5].id;for(let l=0;l<r.length;l+=1){let c=$o(i,r,l),u=a(c);o.set(u,n[l]=es(u,c))}return{c(){t=z("div"),e=ye("svg");for(let l=0;l<n.length;l+=1)n[l].c();b(e,"width","100%"),b(e,"height","100%"),b(e,"viewBox",`0 0 ${i[3]} ${i[4]}`),b(e,"class","svelte-1kqo6e4"),b(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){T(l,t,c),B(t,e);for(let u=0;u<n.length;u+=1)n[u].m(e,null);s=!0},p(l,[c]){c&7&&(r=l[1].floorDatas[l[0]].rooms,se(),n=qe(n,c,a,1,l,r,o,e,Et,es,null,$o),re())},i(l){if(!s){for(let c=0;c<r.length;c+=1)E(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)D(n[c]);s=!1},d(l){l&&M(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function Dd(i,t,e){let{floorIndex:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t;const r=o.bounding.max.x-o.bounding.min.x,a=o.bounding.max.y-o.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(0,n=l.floorIndex),"floorplanData"in l&&e(1,o=l.floorplanData),"hoveredRoom"in l&&e(2,s=l.hoveredRoom)},[n,o,s,r,a]}class Va extends oe{constructor(t){super(),ie(this,t,Dd,xd,ne,{floorIndex:0,floorplanData:1,hoveredRoom:2},kd)}}function Ld(i){ce(i,"svelte-bl8zrz",".floorplan-plugin__floor.svelte-bl8zrz{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;pointer-events:none}.floorplan-plugin__floor--is-current.svelte-bl8zrz{opacity:1;pointer-events:auto}")}function ts(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[7],hoveredRoom:i[12]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Va({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&4226?Oe(n,[{floorIndex:s[1],floorplanData:s[7],hoveredRoom:s[12]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function ns(i){let t,e;const n=[{floorplanData:i[7],roomAreaEnable:i[4],roomNameEnable:i[5],floorIndex:i[1],getRoomAreaText:i[8],getLabelElement:i[9],hoveredRoom:i[12],adaptiveRoomLabelVisibleEnable:i[11]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Uu({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&7090?Oe(n,[{floorplanData:s[7],roomAreaEnable:s[4],roomNameEnable:s[5],floorIndex:s[1],getRoomAreaText:s[8],getLabelElement:s[9],hoveredRoom:s[12],adaptiveRoomLabelVisibleEnable:s[11]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function is(i){let t,e;const n=[{floorplanData:i[7],floorIndex:i[1],getRuleDistanceText:i[10]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new nd({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&1154?Oe(n,[{floorplanData:s[7],floorIndex:s[1],getRuleDistanceText:s[10]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function Sd(i){let t,e,n,o,s,r,a,l,c;const u=[{floorIndex:i[1],floorplanData:i[7]}];let h={};for(let v=0;v<u.length;v+=1)h=je(h,u[v]);e=new wd({props:h});let d=i[2]&&ts(i);const f=[{floorplanData:i[7],floorIndex:i[1]}];let g={};for(let v=0;v<f.length;v+=1)g=je(g,f[v]);s=new Ba({props:g});let A=i[3]&&ns(i),p=i[6]&&is(i);return{c(){t=z("div"),K(e.$$.fragment),n=$(),d&&d.c(),o=$(),K(s.$$.fragment),r=$(),A&&A.c(),a=$(),p&&p.c(),b(t,"class",l=Te(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(v,y){T(v,t,y),J(e,t,null),B(t,n),d&&d.m(t,null),B(t,o),J(s,t,null),B(t,r),A&&A.m(t,null),B(t,a),p&&p.m(t,null),c=!0},p(v,[y]){const w=y&130?Oe(u,[{floorIndex:v[1],floorplanData:v[7]}]):{};e.$set(w),v[2]?d?(d.p(v,y),y&4&&E(d,1)):(d=ts(v),d.c(),E(d,1),d.m(t,o)):d&&(se(),D(d,1,1,()=>{d=null}),re());const P=y&130?Oe(f,[{floorplanData:v[7],floorIndex:v[1]}]):{};s.$set(P),v[3]?A?(A.p(v,y),y&8&&E(A,1)):(A=ns(v),A.c(),E(A,1),A.m(t,a)):A&&(se(),D(A,1,1,()=>{A=null}),re()),v[6]?p?(p.p(v,y),y&64&&E(p,1)):(p=is(v),p.c(),E(p,1),p.m(t,null)):p&&(se(),D(p,1,1,()=>{p=null}),re()),(!c||y&1&&l!==(l=Te(`floorplan-plugin__floor${v[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&b(t,"class",l)},i(v){c||(E(e.$$.fragment,v),E(d),E(s.$$.fragment,v),E(A),E(p),c=!0)},o(v){D(e.$$.fragment,v),D(d),D(s.$$.fragment,v),D(A),D(p),c=!1},d(v){v&&M(t),Z(e),d&&d.d(),Z(s),A&&A.d(),p&&p.d()}}}function Md(i,t,e){let{isCurrent:n}=t,{floorIndex:o}=t,{hoverEnable:s}=t,{roomLabelsEnable:r}=t,{roomAreaEnable:a}=t,{roomNameEnable:l}=t,{ruleLabelsEnable:c}=t,{floorplanData:u}=t,{getRoomAreaText:h}=t,{getLabelElement:d}=t,{getRuleDistanceText:f}=t,{adaptiveRoomLabelVisibleEnable:g}=t;const A=ao(void 0);return i.$$set=p=>{"isCurrent"in p&&e(0,n=p.isCurrent),"floorIndex"in p&&e(1,o=p.floorIndex),"hoverEnable"in p&&e(2,s=p.hoverEnable),"roomLabelsEnable"in p&&e(3,r=p.roomLabelsEnable),"roomAreaEnable"in p&&e(4,a=p.roomAreaEnable),"roomNameEnable"in p&&e(5,l=p.roomNameEnable),"ruleLabelsEnable"in p&&e(6,c=p.ruleLabelsEnable),"floorplanData"in p&&e(7,u=p.floorplanData),"getRoomAreaText"in p&&e(8,h=p.getRoomAreaText),"getLabelElement"in p&&e(9,d=p.getLabelElement),"getRuleDistanceText"in p&&e(10,f=p.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in p&&e(11,g=p.adaptiveRoomLabelVisibleEnable)},[n,o,s,r,a,l,c,u,h,d,f,g,A]}class Td extends oe{constructor(t){super(),ie(this,t,Md,Sd,ne,{isCurrent:0,floorIndex:1,hoverEnable:2,roomLabelsEnable:3,roomAreaEnable:4,roomNameEnable:5,ruleLabelsEnable:6,floorplanData:7,getRoomAreaText:8,getLabelElement:9,getRuleDistanceText:10,adaptiveRoomLabelVisibleEnable:11},Ld)}}function zd(i){ce(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function os(i,t,e){const n=i.slice();return n[18]=t[e],n}function ss(i){let t,e,n,o,s,r,a=i[11].floorDatas,l=[];for(let f=0;f<a.length;f+=1)l[f]=rs(os(i,a,f));const c=f=>D(l[f],1,1,()=>{l[f]=null}),u=[{panoIndex:i[3],floorplanData:i[11],lastPanoramaLongitude:i[12],cameraImageUrl:i[13]}];let h={};for(let f=0;f<u.length;f+=1)h=je(h,u[f]);n=new Au({props:h});let d=i[6]&&as(i);return{c(){t=z("div");for(let f=0;f<l.length;f+=1)l[f].c();e=$(),K(n.$$.fragment),o=$(),d&&d.c(),b(t,"class","floorplan-main svelte-86bqav")},m(f,g){T(f,t,g);for(let A=0;A<l.length;A+=1)l[A].m(t,null);B(t,e),J(n,t,null),B(t,o),d&&d.m(t,null),r=!0},p(f,g){if(i=f,g&249776){a=i[11].floorDatas;let p;for(p=0;p<a.length;p+=1){const v=os(i,a,p);l[p]?(l[p].p(v,g),E(l[p],1)):(l[p]=rs(v),l[p].c(),E(l[p],1),l[p].m(t,e))}for(se(),p=a.length;p<l.length;p+=1)c(p);re()}const A=g&14344?Oe(u,[{panoIndex:i[3],floorplanData:i[11],lastPanoramaLongitude:i[12],cameraImageUrl:i[13]}]):{};n.$set(A),i[6]?d?(d.p(i,g),g&64&&E(d,1)):(d=as(i),d.c(),E(d,1),d.m(t,null)):d&&(se(),D(d,1,1,()=>{d=null}),re())},i(f){if(!r){for(let g=0;g<a.length;g+=1)E(l[g]);E(n.$$.fragment,f),E(d),s||xe(()=>{s=Tt(t,Mt,{duration:i[0],easing:At}),s.start()}),r=!0}},o(f){l=l.filter(Boolean);for(let g=0;g<l.length;g+=1)D(l[g]);D(n.$$.fragment,f),D(d),r=!1},d(f){f&&M(t),at(l,f),Z(n),d&&d.d()}}}function rs(i){let t,e;const n=[{hoverEnable:i[5],floorplanData:i[11],getRoomAreaText:i[14],getLabelElement:i[15],getRuleDistanceText:i[16],roomLabelsEnable:i[7],roomAreaEnable:i[8],roomNameEnable:i[9],ruleLabelsEnable:i[10],adaptiveRoomLabelVisibleEnable:i[17]},{floorIndex:i[18].floorIndex},{isCurrent:i[18].floorIndex===i[4]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Td({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&249776?Oe(n,[r&249760&&{hoverEnable:s[5],floorplanData:s[11],getRoomAreaText:s[14],getLabelElement:s[15],getRuleDistanceText:s[16],roomLabelsEnable:s[7],roomAreaEnable:s[8],roomNameEnable:s[9],ruleLabelsEnable:s[10],adaptiveRoomLabelVisibleEnable:s[17]},r&2048&&{floorIndex:s[18].floorIndex},r&2064&&{isCurrent:s[18].floorIndex===s[4]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function as(i){let t,e;return t=new Eu({props:{floorplanData:i[11],northDesc:i[2]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2048&&(s.floorplanData=n[11]),o&4&&(s.northDesc=n[2]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Bd(i){let t,e,n=i[1]&&ss(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&&E(n,1)):(n=ss(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function jd(i,t,e){let{duration:n=0}=t,{visible:o}=t,{northDesc:s}=t,{panoIndex:r}=t,{floorIndex:a}=t,{hoverEnable:l}=t,{compassEnable:c}=t,{roomLabelsEnable:u}=t,{roomAreaEnable:h}=t,{roomNameEnable:d}=t,{ruleLabelsEnable:f}=t,{floorplanData:g}=t,{lastPanoramaLongitude:A}=t,{cameraImageUrl:p}=t,{getRoomAreaText:v}=t,{getLabelElement:y}=t,{getRuleDistanceText:w}=t,{adaptiveRoomLabelVisibleEnable:P}=t;return i.$$set=k=>{"duration"in k&&e(0,n=k.duration),"visible"in k&&e(1,o=k.visible),"northDesc"in k&&e(2,s=k.northDesc),"panoIndex"in k&&e(3,r=k.panoIndex),"floorIndex"in k&&e(4,a=k.floorIndex),"hoverEnable"in k&&e(5,l=k.hoverEnable),"compassEnable"in k&&e(6,c=k.compassEnable),"roomLabelsEnable"in k&&e(7,u=k.roomLabelsEnable),"roomAreaEnable"in k&&e(8,h=k.roomAreaEnable),"roomNameEnable"in k&&e(9,d=k.roomNameEnable),"ruleLabelsEnable"in k&&e(10,f=k.ruleLabelsEnable),"floorplanData"in k&&e(11,g=k.floorplanData),"lastPanoramaLongitude"in k&&e(12,A=k.lastPanoramaLongitude),"cameraImageUrl"in k&&e(13,p=k.cameraImageUrl),"getRoomAreaText"in k&&e(14,v=k.getRoomAreaText),"getLabelElement"in k&&e(15,y=k.getLabelElement),"getRuleDistanceText"in k&&e(16,w=k.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in k&&e(17,P=k.adaptiveRoomLabelVisibleEnable)},[n,o,s,r,a,l,c,u,h,d,f,g,A,p,v,y,w,P]}class lo extends oe{constructor(t){super(),ie(this,t,jd,Bd,ne,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,hoverEnable:5,compassEnable:6,roomLabelsEnable:7,roomAreaEnable:8,roomNameEnable:9,ruleLabelsEnable:10,floorplanData:11,lastPanoramaLongitude:12,cameraImageUrl:13,getRoomAreaText:14,getLabelElement:15,getRuleDistanceText:16,adaptiveRoomLabelVisibleEnable:17},zd)}}const Vd="data:image/png;base64,iVBORw0KGgoAAAAN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i52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function Qd(i){return H(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(o){return H(this,null,function*(){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=yield fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s})};return yield Promise.all(i.map(e))})}function Od(i){return{id:i.id,size:i.size,name:i.name,path:i.path,roomType:i.room_type,floorType:i.floor_type,roomLabel:{position:i.room_label.position,positionInImage:i.room_label.position_in_image},observerIndexs:i.observer_indexs}}function Rd(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(Od),rules:i.rules}}function Fd(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function Hd(i){return{rad:i.rad,position:i.position,positionInImage:i.position_in_image,northRad:i.north_rad,roomId:i.room_id,floorIndex:i.floor_index}}function bt(i){return H(this,null,function*(){const t=yield Qd(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(Rd),o=i.computed_data.entrance?Hd(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(Fd)}})}function Gd(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:Vd,width:45,height:48},a=sd(s,t),l=id(s,e),c=od(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function Wd(i,t){return t(i),i}function ui(i,t){return Wd({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function ls(i,t){const e=Math.max(...i.work.observers.map(n=>n.floorIndex));return t>e?i.model.bounding.max.y:Math.max(...i.work.observers.filter(n=>n.floorIndex===t).map(n=>n.standingPosition.y))}function co(i,t,e=pt.BOUNDING_CENTER){const n=ls(i,t),o=ls(i,t+1);return e===pt.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===pt.CEILING?o:n}function uo(i,t,e,n){const o=co(i,e,n==null?void 0:n.attachedTo),s=new I.Vector3(0,o,0),r=new I.Vector3(1,o,0),a=s.clone().project(i.camera),l=r.clone().project(i.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}class Cn{constructor(t,e){m(this,"five");m(this,"hooks",new qt);m(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}}class zt extends Cn{}var We=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(We||{});const Qa=500,Nd=80;function Ni(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function Oa(i,t){return H(this,null,function*(){yield new Promise((e,n)=>{i.changeMode(...t).catch(o=>n(o)),i.once("initAnimationEnded",()=>{const o=i.getCurrentState(),s=t[0];o.mode!==s&&n(new Error("mode \u4E0E\u9884\u671F\u4E0D\u7B26")),(()=>{const l=t[1];return l?Object.keys(l).every(c=>{const u=o[c];if(u===void 0)return!0;const h=l[c];return typeof u=="number"&&typeof h=="number"?Ni(u,h,2):u===h}):!0})()||n(new Error("five pose \u4E0E\u9884\u671F\u4E0D\u7B26")),e()})})})}function ho(i,t){if(i.currentMode!==t.mode)return!1;const{latitude:e,longitude:n,fov:o}=t,{latitude:s,longitude:r}=i.getCurrentState(),a=i.camera.fov;return!(!Ni(e,s,2)||!Ni(n,r,2)||o!==a)}function Ra(i,t,e=!0){return H(this,null,function*(){if(ho(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[u]=yield ti(Oa(i,[t.mode,t,void 0,e]));if(u)throw new Error(We.ChangeModeError);return}const{latitude:s,longitude:r,fov:a}=o,l=Math.min(1e3,Math.max(200,Math.abs(s-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,Math.abs(a-t.fov)*10)),[c]=yield ti(i.updateCamera(t,l,e));if(c)throw new Error(We.UpdateCameraError)})}function Xt(i,t,e=300){const n=i.getElement();!n||(n.style.opacity=t+"",n.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(o=>n.addEventListener("transitionend",o,{once:!0})),new Promise(o=>setTimeout(o,e))]).then(()=>{n.style.transition="none"}))}function _d(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function Xd(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}class Yd extends zt{constructor(e,n){var a;super(e);m(this,"name","modelFloorplanPlugin");m(this,"state");m(this,"data");m(this,"showState");m(this,"showPromise");m(this,"app");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"selector");m(this,"showRejection");m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"show",(...n)=>H(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));m(this,"hide",(...n)=>H(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));m(this,"updateSize",()=>{if(!this.data||!ho(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=uo(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});m(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,We.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});m(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});m(this,"_show",e=>H(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(We.ModelNotLoaded);if(!this.data)throw new Error(We.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=O(O({},n),e),s=()=>H(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=d=>{a=!0,l=d};const[c]=yield ti(Ra(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(We.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,h=o.immediately?0:Qa;Xt(this.five,u,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));m(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,We.BreakOffByHide),this.showPromise=void 0;const o=O(O({},{userAction:!0,isAutoHide:!1}),e);Xt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});m(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});m(this,"onFiveInteriaPan",(e,n)=>{if(!n||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();o.mode==="Floorplan"&&(this.state.visible||Xd(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();_d(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});m(this,"onFiveWantsGesture",(e,n)=>{if(!!this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});m(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});m(this,"onFiveWantsTapGesture",()=>this.handleClick());m(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:Nd/((a=n==null?void 0:n.scale)!=null?a:1)};const o={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:vt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},s=n?ui(n,["selector","scale"]):{},r=O(O({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return H(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield bt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}this.render()}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return H(this,null,function*(){return yield bt(e.data)})}updateState(e,n){const o=this.state,s=e.config?O(O({},o.config),e.config):o.config;this.state=me(O(O({},this.state),e),{config:s}),!et(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=me(O({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude});if(this.app)return this.app.$set(n);this.app=new lo({target:this.container,intro:!0,props:n})}}const Ud=(i,t)=>new Yd(i,t);function qd(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function Jd(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}class Zd extends zt{constructor(e,n){super(e);m(this,"name","modelFloorplanPlugin");m(this,"state");m(this,"data");m(this,"showState");m(this,"showPromise");m(this,"app");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"selector");m(this,"showRejection");m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"show",(...n)=>H(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));m(this,"hide",(...n)=>H(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));m(this,"updateSize",()=>{if(!this.data||!ho(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=uo(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});m(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,We.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});m(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});m(this,"_show",e=>H(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(We.ModelNotLoaded);if(!this.data)throw new Error(We.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=O(O({},n),e),s=()=>H(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=d=>{a=!0,l=d};const[c]=yield ti(Ra(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(We.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,h=o.immediately?0:Qa;Xt(this.five,u,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));m(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,We.BreakOffByHide),this.showPromise=void 0;const o=O(O({},{userAction:!0,isAutoHide:!1}),e);Xt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});m(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();this.updatePosition(),this.updateSize(),qd(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});m(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1){if(n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1;if(n&&!this.state.visible){if(this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();return o.mode!==this.showState.mode||this.state.visible?void 0:(Jd(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});m(this,"onFiveWantsTapGesture",()=>this.handleClick());m(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2,fov:90};const o={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:vt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?ui(n,["selector","scale"]):{},r=O(O({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return H(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield bt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}updatePosition(){var a;const e=co(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new I.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}formatData(e){return H(this,null,function*(){return yield bt(e.data)})}updateState(e,n){const o=this.state,s=e.config?O(O({},o.config),e.config):o.config;this.state=me(O(O({},this.state),e),{config:s}),!et(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=me(O({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude});if(this.app)return this.app.$set(n);this.app=new lo({target:this.container,intro:!0,props:n})}}const Kd=(i,t)=>new Zd(i,t);class $d extends zt{constructor(e,n){super(e);m(this,"name","topviewFloorplanPlugin");m(this,"state");m(this,"data");m(this,"app");m(this,"selector");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper||this.five.getCurrentState().mode!=="Topview")return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=uo(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"_disable",e=>{var o,s;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,(s=this.container)==null||s.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:n})});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{!this.state.visible||(this.updatePosition(),this.updateSize())});m(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});m(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});m(this,"onFiveInitAnimationEnded",(...[,,e])=>{const{mode:n}=this.five.getCurrentState();n==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},e),this._show({userAction:e}))});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"));const o={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:vt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?ui(n,["selector","scale"]):{},r=O(O({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return H(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield bt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}updatePosition(){var a;const e=co(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new I.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return H(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return H(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return H(this,null,function*(){return yield bt(e.data)})}_show(e){return H(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:n}=e;this.hooks.emit("show",{userAction:n,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield Oa(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const o=500,s=this.state.config.modelOpacity;Xt(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return H(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;Xt(this.five,o,s),this.render()})}_enable(e){const{userAction:n}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}updateState(e,n){const o=this.state,s=e.config?O(O({},o.config),e.config):o.config;this.state=me(O(O({},this.state),e),{config:s}),!et(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=me(O({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude});if(this.app)return this.app.$set(n);this.app=new lo({target:this.container,intro:!0,props:n})}}const eh=(i,t)=>new $d(i,t);function fo(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function th(i){ce(i,"svelte-1nqrlxd",".plugin-radar__camera-wrapper.svelte-1nqrlxd{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1nqrlxd{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1nqrlxd{position:absolute;left:-0.9375rem;top:-0.9375rem;width:1.0625rem;height:1.0625rem;transform-origin:0.9375rem 0.9375rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function nh(i){let t,e,n;return{c(){t=z("div"),e=z("div"),n=z("div"),b(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),L(n,"background-image","url("+(i[0]||vt)+")"),L(n,"transform",i[1]),b(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),L(e,"transform",i[2]),b(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(o,s){T(o,t,s),B(t,e),B(e,n)},p(o,[s]){s&1&&L(n,"background-image","url("+(o[0]||vt)+")"),s&2&&L(n,"transform",o[1]),s&4&&L(e,"transform",o[2])},i:Y,o:Y,d(o){o&&M(t)}}}function ih(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function oh(i,t,e){let n,o,{five:s}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=s.getCurrentState().panoIndex,u=s.getCurrentState().longitude;function h(g,A){const p=g.bounding,v=g.observers[A];if(!v)return"";const y=(p.max.x-p.min.x)*r,w=(p.max.y-p.min.y)*r,P=Math.floor(v.positionInImage.x*y),k=Math.floor(v.positionInImage.y*w);return`translate(${P}px, ${k}px)`}function d(g){e(6,c=g)}const f=fo(g=>{e(7,u=g.longitude)},1e3/60);return Ue(()=>(s.on("panoWillArrive",d),s.on("cameraDirectionUpdate",f),function(){s.off("panoWillArrive",d),s.off("cameraDirectionUpdate",f)})),i.$$set=g=>{"five"in g&&e(3,s=g.five),"pxmm"in g&&e(4,r=g.pxmm),"floorplanData"in g&&e(5,a=g.floorplanData),"cameraImageUrl"in g&&e(0,l=g.cameraImageUrl)},i.$$.update=()=>{i.$$.dirty&96&&e(2,n=h(a,c)),i.$$.dirty&128&&e(1,o=ih(u))},[l,o,n,s,r,a,c,u]}class sh extends oe{constructor(t){super(),ie(this,t,oh,nh,ne,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},th)}}function rh(i){ce(i,"svelte-1i87fz7",".plugin-pano-floorplan__extra-objects.svelte-1i87fz7{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-1i87fz7{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-1i87fz7{transform:translate(-50%, -50%)}")}function cs(i,t,e){const n=i.slice();return n[1]=t[e],n}function us(i,t){let e,n,o=`${t[1].icon.width/16}rem`,s=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:i,first:null,c(){e=z("div"),n=z("div"),r=$(),b(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),L(n,"background-image",`url(${t[1].icon.url})`),L(n,"width",o),L(n,"height",s),b(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),L(e,"top",a),L(e,"left",l),this.first=e},m(c,u){T(c,e,u),B(e,n),B(e,r)},p(c,u){t=c,u&1&&L(n,"background-image",`url(${t[1].icon.url})`),u&1&&o!==(o=`${t[1].icon.width/16}rem`)&&L(n,"width",o),u&1&&s!==(s=`${t[1].icon.height/16}rem`)&&L(n,"height",s),u&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&L(e,"top",a),u&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&L(e,"left",l)},d(c){c&&M(e)}}}function ah(i){let t,e=[],n=new Map,o=i[0];const s=r=>r[1].id;for(let r=0;r<o.length;r+=1){let a=cs(i,o,r),l=s(a);n.set(l,e[r]=us(l,a))}return{c(){t=z("div");for(let r=0;r<e.length;r+=1)e[r].c();b(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){T(r,t,a);for(let l=0;l<e.length;l+=1)e[l].m(t,null)},p(r,[a]){a&1&&(o=r[0],e=qe(e,a,s,1,r,o,n,t,so,us,null,cs))},i:Y,o:Y,d(r){r&&M(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function lh(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class ch extends oe{constructor(t){super(),ie(this,t,lh,ah,ne,{extraObjects:0},rh)}}function ds(i){let t,e;const n=[{five:i[0],pxmm:i[1],floorIndex:i[2],floorplanData:i[4],onRoomHeightClick:i[6]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Va({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&87?Oe(n,[{five:s[0],pxmm:s[1],floorIndex:s[2],floorplanData:s[4],onRoomHeightClick:s[6]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function uh(i){let t,e,n,o,s,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let u=0;u<a.length;u+=1)l=je(l,a[u]);t=new Ba({props:l}),n=new ch({props:{extraObjects:i[5]}});let c=i[3]&&ds(i);return{c(){K(t.$$.fragment),e=$(),K(n.$$.fragment),o=$(),c&&c.c(),s=fe()},m(u,h){J(t,u,h),T(u,e,h),J(n,u,h),T(u,o,h),c&&c.m(u,h),T(u,s,h),r=!0},p(u,[h]){const d=h&20?Oe(a,[{floorIndex:u[2],floorplanData:u[4]}]):{};t.$set(d);const f={};h&32&&(f.extraObjects=u[5]),n.$set(f),u[3]?c?(c.p(u,h),h&8&&E(c,1)):(c=ds(u),c.c(),E(c,1),c.m(s.parentNode,s)):c&&(se(),D(c,1,1,()=>{c=null}),re())},i(u){r||(E(t.$$.fragment,u),E(n.$$.fragment,u),E(c),r=!0)},o(u){D(t.$$.fragment,u),D(n.$$.fragment,u),D(c),r=!1},d(u){Z(t,u),u&&M(e),Z(n,u),u&&M(o),c&&c.d(u),u&&M(s)}}}function dh(i,t,e){let n,{five:o}=t,{pxmm:s}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t;const u=void 0;return i.$$set=h=>{"five"in h&&e(0,o=h.five),"pxmm"in h&&e(1,s=h.pxmm),"floorIndex"in h&&e(2,r=h.floorIndex),"hoverEnable"in h&&e(3,a=h.hoverEnable),"floorplanData"in h&&e(4,l=h.floorplanData),"extraObjects"in h&&e(7,c=h.extraObjects)},i.$$.update=()=>{i.$$.dirty&132&&e(5,n=c==null?void 0:c.filter(h=>h.floorIndex===r))},[o,s,r,a,l,n,u,c]}class hh extends oe{constructor(t){super(),ie(this,t,dh,uh,ne,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:7})}}function fh(i){ce(i,"svelte-1mvqyqq",".plugin-floorplan-radar.svelte-1mvqyqq{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-1mvqyqq{position:relative}")}function hs(i){let t,e,n,o=i[6]!==0&&fs(i);return{c(){t=z("div"),o&&o.c(),b(t,"class","plugin-floorplan-radar svelte-1mvqyqq"),xe(()=>i[12].call(t))},m(s,r){T(s,t,r),o&&o.m(t,null),e=tt(t,i[12].bind(t)),n=!0},p(s,r){s[6]!==0?o?(o.p(s,r),r&64&&E(o,1)):(o=fs(s),o.c(),E(o,1),o.m(t,null)):o&&(se(),D(o,1,1,()=>{o=null}),re())},i(s){n||(E(o),n=!0)},o(s){D(o),n=!1},d(s){s&&M(t),o&&o.d(),e()}}}function fs(i){let t,e,n,o,s=`${i[8]}px`,r=`${i[11]}px`,a;const l=[{five:i[0],pxmm:i[9],floorIndex:i[10],floorplanData:i[3],hoverEnable:i[2],extraObjects:i[5]}];let c={};for(let d=0;d<l.length;d+=1)c=je(c,l[d]);e=new hh({props:c});const u=[{pxmm:i[9],five:i[0],floorplanData:i[3],cameraImageUrl:i[4]}];let h={};for(let d=0;d<u.length;d+=1)h=je(h,u[d]);return o=new sh({props:h}),{c(){t=z("div"),K(e.$$.fragment),n=$(),K(o.$$.fragment),b(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),L(t,"width",s),L(t,"height",r)},m(d,f){T(d,t,f),J(e,t,null),B(t,n),J(o,t,null),a=!0},p(d,f){const g=f&1581?Oe(l,[{five:d[0],pxmm:d[9],floorIndex:d[10],floorplanData:d[3],hoverEnable:d[2],extraObjects:d[5]}]):{};e.$set(g);const A=f&537?Oe(u,[{pxmm:d[9],five:d[0],floorplanData:d[3],cameraImageUrl:d[4]}]):{};o.$set(A),f&256&&s!==(s=`${d[8]}px`)&&L(t,"width",s),f&2048&&r!==(r=`${d[11]}px`)&&L(t,"height",r)},i(d){a||(E(e.$$.fragment,d),E(o.$$.fragment,d),a=!0)},o(d){D(e.$$.fragment,d),D(o.$$.fragment,d),a=!1},d(d){d&&M(t),Z(e),Z(o)}}}function mh(i){let t,e,n=i[1]&&hs(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&&E(n,1)):(n=hs(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function ph(i,t,e){var v,y;let{five:n}=t,{visible:o}=t,{hoverEnable:s}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,c=0,u=(y=(v=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:v.floorIndex)!=null?y:0,h=0,d=0,f=0,g=0;function A(w){e(10,u=n.work.observers[w].floorIndex)}Ue(()=>(n.on("panoArrived",A),()=>{n.off("panoArrived",A)}));function p(){h=this.clientWidth,d=this.clientHeight,e(6,h),e(7,d)}return i.$$set=w=>{"five"in w&&e(0,n=w.five),"visible"in w&&e(1,o=w.visible),"hoverEnable"in w&&e(2,s=w.hoverEnable),"floorplanData"in w&&e(3,r=w.floorplanData),"cameraImageUrl"in w&&e(4,a=w.cameraImageUrl),"extraObjects"in w&&e(5,l=w.extraObjects)},i.$$.update=()=>{if(i.$$.dirty&456){const w=Math.min(h,d),{max:P,min:k}=r.bounding,C=P.x-k.x,S=P.y-k.y,x=function(){return C>S?[w,w/C*S]:[w/S*C,w]}();e(8,f=x[0]),e(11,g=x[1]),e(9,c=f/C)}},[n,o,s,r,a,l,h,d,f,c,u,g,p]}class gh extends oe{constructor(t){super(),ie(this,t,ph,mh,ne,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5},fh)}}class Ah extends zt{constructor(e,n){super(e);m(this,"name","panoFloorplanRadarPlugin");m(this,"state");m(this,"data");m(this,"app");m(this,"wrapperSelector","");m(this,"wrapper",null);m(this,"disposed",!1);m(this,"extraObjects",[]);m(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});m(this,"_disable",e=>{var o;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:n})});this.five=e;const o={hoverEnable:!1,cameraImageUrl:vt},s=n!=null&&n.configs?n.configs:{},r=O(O({},o),s);this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}load(e,n,o=!0){return H(this,null,function*(){function s(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=s(r)?r.data:r,l=this.data;this.data=yield bt(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,o),this.render()})}show(){return H(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return H(this,arguments,function*(e={}){if(!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,n=!0){this.setState({config:e},{userAction:n}),this.render()}setExtraObjectsWith3DPositions(e){!this.data||(this.extraObjects=Gd(e,this.five,this.data),this.render())}formatData(e){return H(this,null,function*(){return yield bt(e.data)})}_enable(e){const{userAction:n}=e;this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}_show(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("show",{userAction:n}),this.render()}_hide(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n}),this.render()}updateState(e,n){const o=this.state;this.state=O(O({},this.state),e),!et(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const n=document.querySelector(this.wrapperSelector);this.wrapper=n}if(!this.data||!this.wrapper)return;const e=me(O({},this.state.config),{five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects});this.app?this.app.$set(e):this.app=new gh({target:this.wrapper,props:e})}}const vh=(i,t)=>new Ah(i,t),bh=[{type:0,floorType:1,roomType:"100900000012",name:"\u5176\u4ED6"},{type:1,floorType:1,roomType:"100900000002",name:"\u5BA2\u5385"},{type:2,floorType:1,roomType:"100900000002",name:"\u9910\u5385"},{type:3,floorType:0,roomType:"100900000001",name:"\u5367\u5BA4"},{type:4,floorType:0,roomType:"100900000001",name:"\u4E66\u623F"},{type:5,floorType:3,roomType:"100900000004",name:"\u536B\u751F\u95F4"},{type:6,floorType:3,roomType:"100900000004",name:"\u6DCB\u6D74\u95F4"},{type:7,floorType:3,roomType:"100900000004",name:"\u6D17\u624B\u95F4"},{type:8,floorType:3,roomType:"100900000003",name:"\u53A8\u623F"},{type:9,floorType:1,roomType:"100900000003",name:"\u5F00\u653E\u53A8\u623F",onlySubArea:!0},{type:10,floorType:0,roomType:"100900000001",name:"\u591A\u529F\u80FD\u95F4"},{type:11,floorType:0,roomType:"100900000009",name:"\u4FDD\u59C6\u95F4"},{type:12,floorType:4,roomType:"100900000005",name:"\u9633\u53F0"},{type:13,floorType:4,roomType:"100900000006",name:"\u9732\u53F0"},{type:14,floorType:0,roomType:"100900000008",name:"\u50A8\u7269\u95F4"},{type:15,floorType:0,roomType:"100900000013",name:"\u8863\u5E3D\u95F4"},{type:16,floorType:0,roomType:"100900000011",name:"\u9601\u697C"},{type:17,floorType:2,roomType:"100900000007",name:"\u82B1\u56ED"},{type:18,floorType:5,roomType:"100900000010",name:"\u8F66\u5E93"},{type:19,floorType:1,roomType:"100900000012",name:"\u7535\u68AF"},{type:20,floorType:1,roomType:"100900000012",name:"\u5730\u4E0B\u5BA4"},{type:21,floorType:1,roomType:"100900000012",name:"\u5929\u4E95"},{type:22,floorType:1,roomType:"100900000012",name:"\u9633\u5149\u623F"},{type:23,floorType:1,roomType:"100900000012",name:"\u8FC7\u9053"},{type:24,floorType:1,roomType:"100900000012",name:"\u697C\u68AF\u95F4"},{type:25,floorType:1,roomType:"100900000012",name:"\u95E8\u5385"},{type:26,floorType:2,roomType:"100900000012",name:"\u5165\u6237\u82B1\u56ED"},{type:27,floorType:1,roomType:"100900000012",name:"\u7384\u5173"},{type:28,floorType:1,roomType:"100900000012",name:"\u6311\u7A7A"},{type:29,floorType:4,roomType:"100900000012",name:"\u667E\u6652\u533A"},{type:30,floorType:4,roomType:"100900000012",name:"\u6D17\u8863\u623F"},{type:31,floorType:0,roomType:"100900000012",name:"\u5A31\u4E50\u533A"},{type:32,floorType:0,roomType:"100900000012",name:"\u5065\u8EAB\u533A"},{type:33,floorType:0,roomType:"100900000012",name:"\u63A5\u5F85\u533A"},{type:34,floorType:0,roomType:"100900000012",name:"\u5F71\u97F3\u533A"},{type:35,floorType:1,roomType:"100900000012",name:"\u9910\u996E\u533A"},{type:36,floorType:1,roomType:"100900000012",name:"\u5176\u4ED6",onlySubArea:!0},{type:37,floorType:1,roomType:"100900000002",name:"\u8D77\u5C45\u5BA4"},{type:38,floorType:0,roomType:"100900000001",name:"\u4E3B\u5367"},{type:39,floorType:0,roomType:"100900000001",name:"\u6B21\u5367"},{type:40,floorType:0,roomType:"100900000001",name:"\u4F18\u5316\u95F4"},{type:41,floorType:0,roomType:"100900000001",name:"\u529E\u516C\u5BA4"},{type:42,floorType:0,roomType:"100900000001",name:"\u4F1A\u8BAE\u5BA4"},{type:43,floorType:0,roomType:"100900000001",name:"\u6D3D\u8C08\u95F4"},{type:44,floorType:1,roomType:"100900000002",name:"\u5171\u4EAB\u5927\u5385"},{type:45,floorType:1,roomType:"100900000012",name:"\u6C34\u5427"},{type:46,floorType:0,roomType:"100900000015",name:"\u51FA\u5165\u53E3"},{type:47,floorType:0,roomType:"100900000015",name:"\u5927\u5385"},{type:48,floorType:0,roomType:"100900000015",name:"\u5305\u53A2"},{type:49,floorType:0,roomType:"100900000015",name:"\u5176\u4ED6"},{type:50,floorType:0,roomType:"100900000016",name:"\u51FA\u5165\u53E3"},{type:51,floorType:0,roomType:"100900000016",name:"\u529E\u516C\u533A"},{type:52,floorType:0,roomType:"100900000016",name:"\u8001\u677F\u95F4"},{type:53,floorType:0,roomType:"100900000016",name:"\u4F1A\u8BAE\u5BA4"},{type:54,floorType:0,roomType:"100900000016",name:"\u4F11\u606F\u533A/\u6C34\u5427"},{type:55,floorType:0,roomType:"100900000016",name:"\u5176\u4ED6"},{type:56,floorType:2,roomType:"100900000012",name:"\u7A7A\u4E2D\u82B1\u56ED"},{type:57,floorType:0,roomType:"100900000001",name:"\u6D0B\u5BA4"},{type:58,floorType:0,roomType:"100900000001",name:"\u548C\u5BA4"}],yh=[{type:0,description:"\u6728\u8D28\u5730\u677F"},{type:1,description:"\u74F7\u7816\u5730\u9762"},{type:2,description:"\u6237\u5916\u5730\u9762"},{type:3,description:"\u536B\u751F\u95F4\u5730\u9762"},{type:4,description:"\u9633\u53F0\u5730\u9762"},{type:5,description:"\u8F66\u5E93\u5730\u9762"}],wh=[{roomType:"100900000001",description:"\u5BA4"},{roomType:"100900000002",description:"\u5385"},{roomType:"100900000003",description:"\u53A8"},{roomType:"100900000004",description:"\u536B"},{roomType:"100900000005",description:"\u9633\u53F0"},{roomType:"100900000006",description:"\u9732\u53F0"},{roomType:"100900000007",description:"\u82B1\u56ED"},{roomType:"100900000008",description:"\u50A8"},{roomType:"100900000009",description:"\u4FDD\u59C6\u95F4"},{roomType:"100900000010",description:"\u8F66\u5E93"},{roomType:"100900000011",description:"\u9601\u697C"},{roomType:"100900000012",description:"\u5176\u4ED6"},{roomType:"100900000013",description:"\u8863"},{roomType:"100900000015",description:"\u5546\u94FA"},{roomType:"100900000016",description:"\u5199\u5B57\u697C"}],ki=(i,t,e)=>{const n=new I.Matrix4,o=new I.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},Ch=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[o,s,r]=e;o&&i.applyMatrix4(ki(o,0,0)),s&&i.applyMatrix4(ki(0,s,0)),r&&i.applyMatrix4(ki(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function Fa(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s=O({map:o.material.map||{}},t);o.material=new V.MeshBasicMaterial(s),o.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const Ph=(i,t)=>{var u;const e=t.fbx_url||"//vrlab-static.ljcdn.com/release/web/v3/dipan3/dipan.FBX",n=(u=t.north_rad)!=null?u:void 0,o={},s=h=>H(exports,null,function*(){var U;const d=(h==null?void 0:h.fbx_url)||e,f=(U=h==null?void 0:h.north_rad)!=null?U:n;if(typeof f!="number")throw new Error('"northRad"\u914D\u7F6E\u53C2\u6570\u7F3A\u5931\uFF1A\u672A\u914D\u7F6E\u6307\u5357\u9488\u6307\u5411\uFF01');const g=i.model.bounding,A=g.max.x-g.min.x,p=g.max.z-g.min.z,v=Math.max(A,p),w=yield new ca.FBXLoader().loadAsync(d);Fa(w,{transparent:!0,side:I.DoubleSide,blending:I.AdditiveBlending});const P=[0,f-Math.PI/2,0],{model:{bounding:{max:{x:k,z:C},min:{x:S,y:x,z:Q}}}}=i;o.yBase=x;const _={x:(k+S)/2,y:x-1.6,z:(C+Q)/2},R=.0045*v;return Ch(w,{position:_,rotation:P,scale:R}),o.object=w,!0}),r=({latitude:h})=>{if(!o.object)return;const d=a(h);d&&(o.object.position.y=d)},a=h=>{if(o.yBase===void 0)return;const d=.6;if(h>=Math.PI/4)return o.yBase-(d+1.6);const f=h*(4/Math.PI);return o.yBase-(d*f+1.6)};return{load:s,disable:()=>{!o.object||(i.scene.remove(o.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!o.object)return;const h=a(i.getPose().latitude);h&&(o.object.position.y=h),i.scene.add(o.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function Eh(i,t){var c,u,h,d,f;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(u=t==null?void 0:t.fontSize)!=null?u:e*(35/256)*1.2,o=(h=t==null?void 0:t.backgroundColor)!=null?h:"rgba(0,0,0,0)",s=(d=t==null?void 0:t.fontColor)!=null?d:"#fff",r=(f=t==null?void 0:t.textAlign)!=null?f:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=o,l.fillRect(0,0,e,e),l.font=`${n}px "\u5FAE\u8F6F\u96C5\u9ED1"`,l.textAlign=r,l.fillStyle=s,l.fillText(i,e/2,e*.7),new V.CanvasTexture(a)}const Ih=({x:i,y:t,z:e})=>new V.Vector3(i,t,e),kh=(i,t)=>{var A,p,v;const e={},n=(A=t.animationEnabled)!=null?A:!0,o=(p=t.position)!=null?p:void 0,s=(v=t.rad)!=null?v:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=y=>H(exports,null,function*(){var _,R,U,j,F,W,X,G;const w=(_=y==null?void 0:y.position)!=null?_:o;if(!w)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const P=Ih(w),k=(R=y==null?void 0:y.rad)!=null?R:s,C=(U=y==null?void 0:y.fbx_url)!=null?U:r;if(e.rad=k,k===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${k}`));const S=yield new ca.FBXLoader().loadAsync(C);S.position.copy(P),S.rotation.z=k,S.scale.set(.8,.8,.8),Fa(S,{transparent:!0,side:I.DoubleSide});const x=(X=(W=(F=(j=S.children)==null?void 0:j[0])==null?void 0:F.children)==null?void 0:W[3])==null?void 0:X.clone();if(!x)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${x}`));const Q=(G=t.name)!=null?G:"\u5165\u6237\u95E8";return x.material=new V.MeshBasicMaterial({transparent:!0,map:Eh(Q)}),x.renderOrder=3,S.children[0].add(x),e.object=S,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const y=1,w=new V.AnimationMixer(e.object);a.push(w);const P=w.clipAction(e.object.animations[0]);P.timeScale=y;let k;const C=()=>{let _=0,R=0;const U=1e3/30,j=F=>{_=requestAnimationFrame(j);const W=F-R;W<U||(R=F,a.forEach(X=>X.update(W/1e3)),i.needsRender=!0)};return _=requestAnimationFrame(j),()=>{cancelAnimationFrame(_)}},Q={play:()=>{k||(P.play(),k=C(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{P.stop(),k==null||k(),k=void 0}};e.animation=Q},u=y=>{var P;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((P=y==null?void 0:y.animationEnable)!=null?P:n)&&(e.animation||c(),e.animation.play()),i.scene.add(e.object),i.needsRender=!0},h=()=>{!e.object||(e.animation&&e.animation.stop(),i.scene.remove(e.object),i.needsRender=!0)},d=y=>y==="Floorplan"?u():h();return{load:l,enable:y=>(e.enabled||(e.enabled=!0,d(i.currentMode),i.on("modeChange",d),u(y)),!0),disable:()=>(e.enabled&&(e.enabled=!1,h(),i.off("modeChange",d)),!0)}};class mo extends pn.default.Tween{constructor(){super(...arguments);m(this,"disposeMethods",[]);m(this,"animationFrameDisposer");m(this,"onDispose",e=>(this.disposeMethods.push(e),this));m(this,"play",()=>(this.start(0),this.animationFrameDisposer=Pn(e=>this.update(e)),this));m(this,"dispose",()=>{var e;this.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this.disposeMethods.forEach(n=>n()),this.disposeMethods=[],pn.default.remove(this)})}}function Ha(i,t=pn.default.Easing.Linear.None){const e=new mo({progress:0}).to({progress:1});return i!==void 0&&e.duration(i),t!==void 0&&e.easing(t),e}const vn=window.requestAnimationFrame||(i=>setTimeout(i,16)),xh=window.cancelAnimationFrame||clearTimeout;function di(i,t=0){t<=0?vn(i):vn(()=>di(i,t-1))}function Pn(i,t=60){let e=-1,n=0,o=-1;const s=1e3/t;function r(a){o===-1&&(o=a),e=vn(r),!(a-n<s)&&(n=a,i&&i(a-o))}return e=vn(r),function(){xh(e)}}function Dh(){const i=Date.now();return new Promise(t=>{vn(()=>{t(Date.now()-i)})})}const Lh=ri.Easing;function Sh(i,t,e,n=Lh.Linear.None){const o=new ri.Tween(i).to(t,e).easing(n);di(()=>o.start(0));const s=Pn(a=>{o.update(a)===!1&&s()}),r=[];return o.onDestroy=a=>(r.push(a),o),o.destroy=function(){this.stop(),Object.assign(o,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();s()},o}function Mh(i,t){return Sh({progress:0},{progress:1},i,t)}var Ga=(i=>(i.Move="Move",i.Rotate="Rotate",i))(Ga||{}),$e=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))($e||{});const Yn=Math.PI*2;function ms(i){return(i%Yn+Yn)%Yn}function ps(i){return i%Yn}function xi(i,t,e){return i+(t-i)*e}const _i=(i,t,e)=>{const n=Math.PI,o=n*2;return i=ms(i),t=ms(t),e===$e.Anticlockwise&&i<t&&(i+=o),e===$e.Clockwise&&t<i&&(t+=o),e===$e.Loop&&t-i>n?_i(i,t,$e.Anticlockwise):e===$e.Loop&&i-t>n?_i(i,t,$e.Clockwise):{from:i,to:t}},Th=i=>{const t={},e=(l,c,...u)=>H(exports,[l,c,...u],function*(s,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),s.mode&&s.mode!==i.currentMode&&(yield i.changeMode(s.mode)),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(yield i.preloadPano(s.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:yield new Promise((h,d)=>{const f=s.panoIndex!==void 0?s.panoIndex:i.panoIndex;f!==void 0?i.moveToPano(f,Object.assign({duration:r,moveEndCallback:()=>h(!0),moveCancelCallback:()=>d(!1)},s)):d(!1)})}),n=s=>{const r=i.state,a=ps(r.latitude),l=ps(s.latitude),{from:c,to:u}=_i(r.longitude,s.longitude,s.rotation||$e.Loop),h=r.fov,d=s.fov;return{from:{latitude:a,longitude:c,fov:h},to:{latitude:l,longitude:u,fov:d}}};return{move:e,rotate:(l,c,...u)=>H(exports,[l,c,...u],function*(s,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),i.currentMode!==Ce.Five.Mode.Panorama&&(yield i.changeMode(Ce.Five.Mode.Panorama)),s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(a.preload&&(yield i.preloadPano(s.panoIndex)),yield new Promise((f,g)=>{if(!s.panoIndex){f(!0);return}i.moveToPano(s.panoIndex,{moveEndCallback:()=>f(!0),moveCancelCallback:()=>g(!1)})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:h,to:d}=n(s);return yield new Promise(f=>{const g=({progress:w})=>{const P={};P.longitude=xi(h.longitude,d.longitude,w),P.latitude=xi(h.latitude,d.latitude,w),P.fov=xi(h.fov,d.fov,w),i.setState(P,!0)},A=()=>{f(!0)},p=()=>{f(!1)},v=s.rotateSpeed?Math.ceil(Math.abs(d.longitude-h.longitude)/s.rotateSpeed*1e3):r,y=Mh(v,ri.Easing.Linear.None).onUpdate(g).onComplete(A).onDestroy(p);s.rotation===$e.Loop&&y.repeat(1/0).yoyo(!0),t.interruptCallback=(w=!0)=>{y.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),f(w)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function gs(i,t){return i.x===t.x&&i.y===t.y}function Wa(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function oi(i,t){return(t.y-i.y)/(t.x-i.x)}function Na(i,t,e){const n=oi(i[1],i[0]),o=oi(t[1],t[0]);if(isNaN(n)||isNaN(o)||Wa(n,o))return!1;if(Bn(i[0],t))return i[0];if(Bn(i[1],t))return i[1];if(Bn(t[0],i))return t[0];if(Bn(t[1],i))return t[1];if(e&&!zh(i,t))return!1;const s=i[0],r=t[0];if(Math.abs(n)===1/0)return{x:s.x,y:t[1].y-(t[1].x-s.x)*o};if(Math.abs(o)===1/0)return{x:r.x,y:i[1].y-(i[1].x-r.x)*n};const a=(r.y-s.y+n*s.x-o*r.x)/(n-o),l=n*a-n*s.x+s.y;return{x:a,y:l}}function Bn(i,t){return gs(i,t[0])||gs(i,t[1])?!0:(t[0].x-i.x)*(i.x-t[1].x)>=0&&(t[0].y-i.y)*(i.y-t[1].y)>=0&&Wa(oi(t[0],i),oi(i,t[1]))}function jn(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function zh(i,t){return Math.max(i[0].x,i[1].x)>=Math.min(t[0].x,t[1].x)&&Math.max(t[0].x,t[1].x)>=Math.min(i[0].x,i[1].x)&&Math.max(i[0].y,i[1].y)>=Math.min(t[0].y,t[1].y)&&jn(t[0],i[1],i[0])*jn(i[1],t[1],i[0])>0&&jn(i[0],t[1],t[0])*jn(t[1],i[1],t[0])>0?1:0}function _a(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>_a(i,t-1))}const Bh=`<style type="text/css">
|
|
115
|
+
`;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class Tu extends oe{constructor(t){super(),ie(this,t,Mu,Su,ne,{content:0},Lu)}}function zu(i){ce(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function Bu(i){let t,e;return t=new Du({props:{url:i[1].url}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.url=n[1].url),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function ju(i){let t,e;return t=new Tu({props:{content:i[0]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.content=n[0]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Vu(i){let t,e,n,o;const s=[ju,Bu],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(i))&&(n=r[e]=s[e](i)),{c(){t=z("div"),n&&n.c(),b(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){T(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let u=e;e=a(l),e===u?~e&&r[e].p(l,c):(n&&(se(),D(r[u],1,1,()=>{r[u]=null}),re()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),E(n,1),n.m(t,null)):n=null)},i(l){o||(E(n),o=!0)},o(l){D(n),o=!1},d(l){l&&M(t),~e&&r[e].d()}}}function Qu(i,t,e){let n,o,{floorIndex:s}=t,{floorplanData:r}=t;return i.$$set=a=>{"floorIndex"in a&&e(2,s=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},i.$$.update=()=>{var a,l;i.$$.dirty&12&&e(1,n=r.outlines[s]),i.$$.dirty&12&&e(0,o=(l=(a=r.outlines)==null?void 0:a[s])==null?void 0:l.svgContent)},[o,n,s,r]}class Ba extends oe{constructor(t){super(),ie(this,t,Qu,Vu,ne,{floorIndex:2,floorplanData:3},zu)}}function Ru(i){ce(i,"svelte-12pzct5",".floorplan-plugin__room-label-item.svelte-12pzct5{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:1;color:#fff;transform:translate(-50%, -50%);white-space:nowrap;will-change:opacity;transition:opacity 300ms}.floorplan-plugin__room-size.svelte-12pzct5{opacity:0.45}")}function Ou(i){let t,e=i[8].outerHTML+"",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&256&&e!==(e=o[8].outerHTML+"")&&t.p(e)},d(o){o&&M(n),o&&t.d()}}}function Fu(i){let t,e,n=i[1]&&Ro(i),o=i[0]&&Oo(i);return{c(){n&&n.c(),t=$(),o&&o.c(),e=fe()},m(s,r){n&&n.m(s,r),T(s,t,r),o&&o.m(s,r),T(s,e,r)},p(s,r){s[1]?n?n.p(s,r):(n=Ro(s),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),s[0]?o?o.p(s,r):(o=Oo(s),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(s){n&&n.d(s),s&&M(t),o&&o.d(s),s&&M(e)}}}function Ro(i){let t,e=i[2].name+"",n;return{c(){t=z("span"),n=ke(e),b(t,"class","floorplan-plugin__room-name")},m(o,s){T(o,t,s),B(t,n)},p(o,s){s&4&&e!==(e=o[2].name+"")&&Me(n,e)},d(o){o&&M(t)}}}function Oo(i){let t,e;return{c(){t=z("span"),e=ke(i[7]),b(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(n,o){T(n,t,o),B(t,e)},p(n,o){o&128&&Me(e,n[7])},d(n){n&&M(t)}}}function Hu(i){let t,e;function n(r,a){if(r[3]===void 0)return Fu;if(r[8])return Ou}let o=n(i),s=o&&o(i);return{c(){t=z("div"),s&&s.c(),b(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),xe(()=>i[19].call(t)),L(t,"left",i[9]),L(t,"top",i[10]),L(t,"font-size",i[11]),L(t,"opacity",i[6]?"1":"0")},m(r,a){T(r,t,a),s&&s.m(t,null),e=tt(t,i[19].bind(t))},p(r,[a]){o===(o=n(r))&&s?s.p(r,a):(s&&s.d(1),s=o&&o(r),s&&(s.c(),s.m(t,null))),a&64&&L(t,"opacity",r[6]?"1":"0")},i:Y,o:Y,d(r){r&&M(t),s&&s.d(),e()}}}function Gu(i,t){const e=i[0],n=i[1];let o=!1;for(let s=0,r=t.length-1;s<t.length;r=s++){const a=t[s][0],l=t[s][1],c=t[r][0],u=t[r][1];l>n!=u>n&&e<(c-a)*(n-l)/(u-l)+a&&(o=!o)}return o}function Wu(i,t,e){let n,o,s,r,a,{pxmm:l}=t,{roomAreaEnable:c}=t,{roomNameEnable:u}=t,{room:h}=t,{hoveredRoom:d}=t,{getRoomAreaText:f}=t,{getLabelElement:g}=t,{adaptiveRoomLabelVisibleEnable:A}=t;function p(O,U){if(U.width===0||U.height===0)return()=>!1;const j=O.path.map(({x:he,y:ue})=>[he,ue]),F=O.roomLabel.position,{x:W,y:X}=F,{width:G,height:ee}=U,N=G/2,ae=ee/2;return function(ue){const pe=W*ue,Pe=X*ue,Le=j.map(([le,ge])=>[le*ue,ge*ue]);return[[pe+N,Pe-ae],[pe-N,Pe-ae],[pe-N,Pe+ae],[pe+N,Pe+ae]].every(le=>Gu(le,Le))}}const v=document.body.clientWidth,y=document.body.clientHeight,w=h.roomLabel,P=w.positionInImage.x*100+"%",k=w.positionInImage.y*100+"%",C=(v<500||y<500?10:14)+"px";let S=0,x=0,Q=!1;d.subscribe(function(U){e(16,Q=!!U&&U.id===h.id)});function _(){S=this.clientWidth,x=this.clientHeight,e(4,S),e(5,x)}return i.$$set=O=>{"pxmm"in O&&e(12,l=O.pxmm),"roomAreaEnable"in O&&e(0,c=O.roomAreaEnable),"roomNameEnable"in O&&e(1,u=O.roomNameEnable),"room"in O&&e(2,h=O.room),"hoveredRoom"in O&&e(13,d=O.hoveredRoom),"getRoomAreaText"in O&&e(14,f=O.getRoomAreaText),"getLabelElement"in O&&e(3,g=O.getLabelElement),"adaptiveRoomLabelVisibleEnable"in O&&e(15,A=O.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&12&&e(8,n=g==null?void 0:g(h)),i.$$.dirty&16388&&e(7,o=h.size?f(h.size):""),i.$$.dirty&48&&e(18,s={width:S,height:x}),i.$$.dirty&262148&&e(17,r=s?p(h,s):void 0),i.$$.dirty&233472&&e(6,a=A?Q?!0:!!(r!=null&&r(l)):!0)},[c,u,h,g,S,x,a,o,n,P,k,C,l,d,f,A,Q,r,s,_]}class Nu extends oe{constructor(t){super(),ie(this,t,Wu,Hu,ne,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},Ru)}}function _u(i){ce(i,"svelte-13xux0b",".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}")}function Fo(i,t,e){const n=i.slice();return n[12]=t[e],n}function Ho(i){let t,e=[],n=new Map,o,s,r=i[8];const a=l=>l[12].id;for(let l=0;l<r.length;l+=1){let c=Fo(i,r,l),u=a(c);n.set(u,e[l]=Go(u,c))}return{c(){t=z("div");for(let l=0;l<e.length;l+=1)e[l].c();b(t,"class","floorplan-plugin__room-labels svelte-13xux0b"),xe(()=>i[11].call(t))},m(l,c){T(l,t,c);for(let u=0;u<e.length;u+=1)e[u].m(t,null);o=tt(t,i[11].bind(t)),s=!0},p(l,c){c&447&&(r=l[8],se(),e=qe(e,c,a,1,l,r,n,t,Et,Go,null,Fo),re())},i(l){if(!s){for(let c=0;c<r.length;c+=1)E(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)D(e[c]);s=!1},d(l){l&&M(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}function Go(i,t){let e,n,o;const s=[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}];let r={};for(let a=0;a<s.length;a+=1)r=je(r,s[a]);return n=new Nu({props:r}),{key:i,first:null,c(){e=fe(),K(n.$$.fragment),this.first=e},m(a,l){T(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&447?Re(s,[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}]):{};n.$set(c)},i(a){o||(E(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&M(e),Z(n,a)}}}function Xu(i){let t,e,n=i[8]&&Ho(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[8]?n?(n.p(o,s),s&256&&E(n,1)):(n=Ho(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Yu(i,t,e){let n,{floorIndex:o}=t,{roomAreaEnable:s}=t,{roomNameEnable:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{getRoomAreaText:c}=t,{getLabelElement:u}=t,{adaptiveRoomLabelVisibleEnable:h}=t,d=0,f=0;function g(){d=this.clientWidth,e(6,d)}return i.$$set=A=>{"floorIndex"in A&&e(9,o=A.floorIndex),"roomAreaEnable"in A&&e(0,s=A.roomAreaEnable),"roomNameEnable"in A&&e(1,r=A.roomNameEnable),"floorplanData"in A&&e(10,a=A.floorplanData),"hoveredRoom"in A&&e(2,l=A.hoveredRoom),"getRoomAreaText"in A&&e(3,c=A.getRoomAreaText),"getLabelElement"in A&&e(4,u=A.getLabelElement),"adaptiveRoomLabelVisibleEnable"in A&&e(5,h=A.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&1536&&e(8,n=a.floorDatas[o].rooms),i.$$.dirty&1088){const{max:A,min:p}=a.bounding,v=A.x-p.x;e(7,f=d/v)}},[s,r,l,c,u,h,d,f,n,o,a,g]}class Uu extends oe{constructor(t){super(),ie(this,t,Yu,Xu,ne,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},_u)}}function qu(i){ce(i,"svelte-djlmk4",".floorplan-plugin__rule-labels.svelte-djlmk4.svelte-djlmk4{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-djlmk4.svelte-djlmk4{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4.svelte-djlmk4{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4.svelte-djlmk4{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4.svelte-djlmk4{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-djlmk4.svelte-djlmk4{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale-wrapper.svelte-djlmk4{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-djlmk4.svelte-djlmk4{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale.svelte-djlmk4{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute}.floorplan-plugin__rule-labels--top.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-djlmk4.svelte-djlmk4{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-text-item.svelte-djlmk4{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-djlmk4.svelte-djlmk4{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}")}function Wo(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function No(i,t,e){const n=i.slice();return n[14]=t[e],n}function _o(i){let t;return{c(){t=z("div"),b(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),L(t,"left",i[14].left*100+"%"),L(t,"bottom",i[14].bottom*100+"%")},m(e,n){T(e,t,n)},p:Y,d(e){e&&M(t)}}}function Xo(i,t){let e,n,o=t[1](t[11].distance)+"",s,r;return{key:i,first:null,c(){e=z("div"),n=z("div"),s=ke(o),r=$(),b(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),q(n,"is-row",t[2]),b(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),L(e,"left",t[11].left*100+"%"),L(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){T(a,e,l),B(e,n),B(n,s),B(e,r)},p(a,l){t=a,l&2&&o!==(o=t[1](t[11].distance)+"")&&Me(s,o)},d(a){a&&M(e)}}}function Ju(i){let t,e,n,o,s,r,a=[],l=new Map,c,u=i[3],h=[];for(let g=0;g<u.length;g+=1)h[g]=_o(No(i,u,g));let d=i[4];const f=g=>g[13];for(let g=0;g<d.length;g+=1){let A=Wo(i,d,g),p=f(A);l.set(p,a[g]=Xo(p,A))}return{c(){t=z("div"),e=z("div"),n=$(),o=z("div");for(let g=0;g<h.length;g+=1)h[g].c();s=$(),r=z("div");for(let g=0;g<a.length;g+=1)a[g].c();b(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),b(o,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),q(o,"is-row",i[2]),b(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),b(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+i[0]+" svelte-djlmk4"),q(t,"is-row",i[2]),L(t,"width",i[2]?"100%":1/16+"rem"),L(t,"height",i[2]?1/16+"rem":"100%")},m(g,A){T(g,t,A),B(t,e),B(t,n),B(t,o);for(let p=0;p<h.length;p+=1)h[p].m(o,null);B(t,s),B(t,r);for(let p=0;p<a.length;p+=1)a[p].m(r,null)},p(g,[A]){if(A&8){u=g[3];let p;for(p=0;p<u.length;p+=1){const v=No(g,u,p);h[p]?h[p].p(v,A):(h[p]=_o(v),h[p].c(),h[p].m(o,null))}for(;p<h.length;p+=1)h[p].d(1);h.length=u.length}A&22&&(d=g[4],a=qe(a,A,f,1,g,d,l,r,so,Xo,null,Wo)),A&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+g[0]+" svelte-djlmk4")&&b(t,"class",c),A&5&&q(t,"is-row",g[2])},i:Y,o:Y,d(g){g&&M(t),at(h,g);for(let A=0;A<a.length;A+=1)a[A].d()}}}const Rt=1e3,Ot=180;function Zu(i,t,e){let{type:n}=t,{data:o}=t,{bounding:s}=t,{getRuleDistanceText:r}=t;const a=n==="top"||n==="bottom",l=s.max.x-s.min.x-(Rt-Ot)*2,c=s.max.y-s.min.y-(Rt-Ot)*2,u=o.map(([g,A])=>a?[g.x,A.x]:[g.y,A.y]).flat().sort().filter((g,A,p)=>A===0?!0:g!==p[A-1]),h=u.map(g=>{const A=a?(g-s.min.x-Rt+Ot)/l:0,p=a?0:(g-s.min.y-Rt+Ot)/c;return{left:A,bottom:p}});h.unshift({left:0,bottom:0}),h.push(a?{left:1,bottom:0}:{left:0,bottom:1});const d=u[u.length-1]-u[0],f=u.map((g,A,p)=>{const v=A===0?0:g-p[A-1],y=A===0?0:(g+p[A-1])/2,w=a?(y-s.min.x-Rt+Ot)/l:0,P=a?0:(y-s.min.y-Rt+Ot)/c;return{left:w,bottom:P,distance:v}}).filter(({distance:g})=>g/d>.1);return i.$$set=g=>{"type"in g&&e(0,n=g.type),"data"in g&&e(5,o=g.data),"bounding"in g&&e(6,s=g.bounding),"getRuleDistanceText"in g&&e(1,r=g.getRuleDistanceText)},[n,r,a,h,f,o,s]}class Ku extends oe{constructor(t){super(),ie(this,t,Zu,Ju,ne,{type:0,data:5,bounding:6,getRuleDistanceText:1},qu)}}function $u(i){ce(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function Yo(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function Uo(i,t){let e,n,o;const s=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<s.length;a+=1)r=je(r,s[a]);return n=new Ku({props:r}),{key:i,first:null,c(){e=fe(),K(n.$$.fragment),this.first=e},m(a,l){T(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&19?Re(s,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){o||(E(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&M(e),Z(n,a)}}}function ed(i){let t,e=[],n=new Map,o,s=i[4];const r=a=>a[13];for(let a=0;a<s.length;a+=1){let l=Yo(i,s,a),c=r(l);n.set(c,e[a]=Uo(c,l))}return{c(){t=z("div");for(let a=0;a<e.length;a+=1)e[a].c();b(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),L(t,"width",i[3]),L(t,"height",i[2])},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&19&&(s=a[4],se(),e=qe(e,l,r,1,a,s,n,t,Et,Uo,null,Yo),re()),l&8&&L(t,"width",a[3]),l&4&&L(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)E(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()}}}const qo=1e3,Jo=180;function td(i,t,e){let n,o,s,r,a,l,c,u,h,d,{floorIndex:f}=t,{floorplanData:g}=t,{getRuleDistanceText:A}=t;return i.$$set=p=>{"floorIndex"in p&&e(5,f=p.floorIndex),"floorplanData"in p&&e(6,g=p.floorplanData),"getRuleDistanceText"in p&&e(0,A=p.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=g.bounding),i.$$.dirty&96&&e(11,o=g.floorDatas[f].rules),i.$$.dirty&2048&&e(12,s=Object.keys(o)),i.$$.dirty&6144&&e(4,r=s.map(p=>[p,o[p]])),i.$$.dirty&2&&e(9,a=n.max.x-n.min.x),i.$$.dirty&2&&e(7,l=n.max.y-n.min.y),i.$$.dirty&2&&e(10,c=n.max.x-n.min.x-(qo-Jo)*2),i.$$.dirty&2&&e(8,u=n.max.y-n.min.y-(qo-Jo)*2),i.$$.dirty&1536&&e(3,h=c/a*100+"%"),i.$$.dirty&384&&e(2,d=u/l*100+"%")},[A,n,d,h,r,f,g,l,u,a,c,o,s]}class nd extends oe{constructor(t){super(),ie(this,t,td,ed,ne,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},$u)}}function ci(i,t={}){let e="";const{needZ:n,needA:o}=t;return(n?i.slice().concat(i[0]):i.slice()).forEach((r,a)=>{const{x:l,y:c}=t.format?t.format(r):r,u=l+","+c;return a===0?(e+="M"+u,e):o!=null&&o[a]?(e+="A"+o[a]+","+u,e):(e+="L"+u,e)}),e+(n?"Z":"")}function ja({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function id(i,t){const e=i.x*1e3+t.bounding.origin.x,n=-i.z*1e3+t.bounding.origin.y;return{x:e,y:n}}function od(i,t){const e=t.bounding,n=e.max.x-e.min.x,o=e.max.y-e.min.y;return{x:(i.x-e.min.x)/n,y:(e.max.y-i.y)/o}}function sd(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function rd(i){let t;return{c(){t=ye("path"),b(t,"d",i[0]),b(t,"fill","#2F313A")},m(e,n){T(e,t,n)},p(e,[n]){n&1&&b(t,"d",e[0])},i:Y,o:Y,d(e){e&&M(t)}}}function ad(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=ci(o,{needZ:!0}))},[n,o]}class ld extends oe{constructor(t){super(),ie(this,t,ad,rd,ne,{path:1})}}function cd(i){let t,e,n,o,s,r;return{c(){t=ye("defs"),e=ye("pattern"),n=ye("rect"),o=ye("path"),s=$(),r=ye("path"),b(n,"x","0"),b(n,"y","0"),b(n,"width",i[1]),b(n,"height",i[1]),b(n,"fill","#323747"),b(o,"d",i[2]),b(o,"stroke","#ffffff"),b(o,"stroke-opacity","0.06"),b(o,"stroke-width","0.5"),b(o,"fill","none"),b(e,"id","fpm-room-pattern-0"),b(e,"x","0"),b(e,"y","0"),b(e,"width",i[1]),b(e,"height",i[1]),b(e,"patternUnits","userSpaceOnUse"),b(e,"patternTransform","scale(50 50)"),b(r,"d",i[0]),b(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){T(a,t,l),B(t,e),B(e,n),B(e,o),T(a,s,l),T(a,r,l)},p(a,[l]){l&1&&b(r,"d",a[0])},i:Y,o:Y,d(a){a&&M(t),a&&M(s),a&&M(r)}}}const Ii=6;function ud(i,t,e){let n,{path:o}=t;const s=Ii*2,r=`M0 ${Ii} h ${s} M${Ii} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=ci(o,{needZ:!0}))},[n,s,r,o]}class dd extends oe{constructor(t){super(),ie(this,t,ud,cd,ne,{path:3})}}function hd(i){let t,e,n,o,s,r,a,l,c,u,h;return{c(){t=ye("defs"),e=ye("pattern"),n=ye("rect"),o=ye("pattern"),s=ye("rect"),r=$(),a=ye("path"),l=$(),c=ye("path"),u=$(),h=ye("path"),b(n,"x","0"),b(n,"y","0"),b(n,"width","6"),b(n,"height","50"),b(n,"fill","none"),b(n,"stroke","#4B4B57"),b(n,"stroke-width","0.5"),b(e,"id","room-material-pattern-1"),b(e,"x","0"),b(e,"y","0"),b(e,"width","12"),b(e,"height","50"),b(e,"patternUnits","userSpaceOnUse"),b(e,"patternTransform","scale(50 50)"),b(s,"x","0"),b(s,"y","0"),b(s,"width","6"),b(s,"height","50"),b(s,"fill","none"),b(s,"stroke","#4B4B57"),b(s,"stroke-width","0.5"),b(o,"id","room-material-pattern-2"),b(o,"x","6"),b(o,"y","25"),b(o,"width","12"),b(o,"height","50"),b(o,"patternUnits","userSpaceOnUse"),b(o,"patternTransform","scale(50 50)"),b(a,"d",i[0]),b(a,"fill","#43434D"),b(c,"d",i[0]),b(c,"fill","url(#room-material-pattern-1)"),b(h,"d",i[0]),b(h,"fill","url(#room-material-pattern-2)")},m(d,f){T(d,t,f),B(t,e),B(e,n),B(t,o),B(o,s),T(d,r,f),T(d,a,f),T(d,l,f),T(d,c,f),T(d,u,f),T(d,h,f)},p(d,[f]){f&1&&b(a,"d",d[0]),f&1&&b(c,"d",d[0]),f&1&&b(h,"d",d[0])},i:Y,o:Y,d(d){d&&M(t),d&&M(r),d&&M(a),d&&M(l),d&&M(c),d&&M(u),d&&M(h)}}}function fd(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=ci(o,{needZ:!0}))},[n,o]}class md extends oe{constructor(t){super(),ie(this,t,fd,hd,ne,{path:1})}}function pd(i){ce(i,"svelte-1dykexu",".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}")}function Zo(i,t,e){const n=i.slice();return n[5]=t[e],n}function gd(i){let t,e;return t=new dd({props:{path:i[5].path}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Ad(i){let t,e;return t=new md({props:{path:i[5].path}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function vd(i){let t,e;return t=new ld({props:{path:i[5].path}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Ko(i){let t,e,n,o;const s=[vd,Ad,gd],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(i),n=r[e]=s[e](i),{c(){t=ye("svg"),n.c(),b(t,"width","100%"),b(t,"height","100%"),b(t,"viewBox",`0 0 ${i[1]} ${i[2]}`),b(t,"class","svelte-1dykexu")},m(l,c){T(l,t,c),r[e].m(t,null),o=!0},p(l,c){let u=e;e=a(l),e===u?r[e].p(l,c):(se(),D(r[u],1,1,()=>{r[u]=null}),re(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),E(n,1),n.m(t,null))},i(l){o||(E(n),o=!0)},o(l){D(n),o=!1},d(l){l&&M(t),r[e].d()}}}function bd(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=Ko(Zo(i,n,r));const s=r=>D(o[r],1,1,()=>{o[r]=null});return{c(){t=z("div");for(let r=0;r<o.length;r+=1)o[r].c();b(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){T(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=Zo(r,n,l);o[l]?(o[l].p(c,a),E(o[l],1)):(o[l]=Ko(c),o[l].c(),E(o[l],1),o[l].m(t,null))}for(se(),l=n.length;l<o.length;l+=1)s(l);re()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)E(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)D(o[a]);e=!1},d(r){r&&M(t),at(o,r)}}}function yd(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t;const r=s.bounding.max.x-s.bounding.min.x,a=s.bounding.max.y-s.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(3,o=l.floorIndex),"floorplanData"in l&&e(4,s=l.floorplanData)},i.$$.update=()=>{i.$$.dirty&24&&e(0,n=s.floorDatas[o].rooms.map(l=>me(R({},l),{path:l.path.map(c=>ja(c,s.bounding))})))},[n,r,a,o,s]}class wd extends oe{constructor(t){super(),ie(this,t,yd,bd,ne,{floorIndex:3,floorplanData:4},pd)}}function Cd(i){ce(i,"svelte-19uvvss","path.svelte-19uvvss{opacity:0}path.svelte-19uvvss:hover{opacity:0.1}")}function Pd(i){let t,e,n;return{c(){t=ye("path"),b(t,"d",i[2]),b(t,"fill","#fff"),b(t,"class","svelte-19uvvss")},m(o,s){T(o,t,s),e||(n=[we(t,"mouseenter",i[0]),we(t,"mouseleave",i[1])],e=!0)},p:Y,i:Y,o:Y,d(o){o&&M(t),e=!1,ct(n)}}}function Ed(i,t,e){let{room:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t;function r(){s.set(n)}function a(){s.set(void 0)}const{bounding:l}=o,c=ci(n.path,{needZ:!0,format:u=>ja(u,l)});return i.$$set=u=>{"room"in u&&e(3,n=u.room),"floorplanData"in u&&e(4,o=u.floorplanData),"hoveredRoom"in u&&e(5,s=u.hoveredRoom)},[r,a,c,n,o,s]}class Id extends oe{constructor(t){super(),ie(this,t,Ed,Pd,ne,{room:3,floorplanData:4,hoveredRoom:5},Cd)}}function kd(i){ce(i,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function $o(i,t,e){const n=i.slice();return n[5]=t[e],n}function es(i,t){let e,n,o;const s=[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}];let r={};for(let a=0;a<s.length;a+=1)r=je(r,s[a]);return n=new Id({props:r}),{key:i,first:null,c(){e=fe(),K(n.$$.fragment),this.first=e},m(a,l){T(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&7?Re(s,[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}]):{};n.$set(c)},i(a){o||(E(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&M(e),Z(n,a)}}}function xd(i){let t,e,n=[],o=new Map,s,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[5].id;for(let l=0;l<r.length;l+=1){let c=$o(i,r,l),u=a(c);o.set(u,n[l]=es(u,c))}return{c(){t=z("div"),e=ye("svg");for(let l=0;l<n.length;l+=1)n[l].c();b(e,"width","100%"),b(e,"height","100%"),b(e,"viewBox",`0 0 ${i[3]} ${i[4]}`),b(e,"class","svelte-1kqo6e4"),b(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){T(l,t,c),B(t,e);for(let u=0;u<n.length;u+=1)n[u].m(e,null);s=!0},p(l,[c]){c&7&&(r=l[1].floorDatas[l[0]].rooms,se(),n=qe(n,c,a,1,l,r,o,e,Et,es,null,$o),re())},i(l){if(!s){for(let c=0;c<r.length;c+=1)E(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)D(n[c]);s=!1},d(l){l&&M(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function Dd(i,t,e){let{floorIndex:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t;const r=o.bounding.max.x-o.bounding.min.x,a=o.bounding.max.y-o.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(0,n=l.floorIndex),"floorplanData"in l&&e(1,o=l.floorplanData),"hoveredRoom"in l&&e(2,s=l.hoveredRoom)},[n,o,s,r,a]}class Va extends oe{constructor(t){super(),ie(this,t,Dd,xd,ne,{floorIndex:0,floorplanData:1,hoveredRoom:2},kd)}}function Ld(i){ce(i,"svelte-bl8zrz",".floorplan-plugin__floor.svelte-bl8zrz{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;pointer-events:none}.floorplan-plugin__floor--is-current.svelte-bl8zrz{opacity:1;pointer-events:auto}")}function ts(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[7],hoveredRoom:i[12]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Va({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&4226?Re(n,[{floorIndex:s[1],floorplanData:s[7],hoveredRoom:s[12]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function ns(i){let t,e;const n=[{floorplanData:i[7],roomAreaEnable:i[4],roomNameEnable:i[5],floorIndex:i[1],getRoomAreaText:i[8],getLabelElement:i[9],hoveredRoom:i[12],adaptiveRoomLabelVisibleEnable:i[11]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Uu({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&7090?Re(n,[{floorplanData:s[7],roomAreaEnable:s[4],roomNameEnable:s[5],floorIndex:s[1],getRoomAreaText:s[8],getLabelElement:s[9],hoveredRoom:s[12],adaptiveRoomLabelVisibleEnable:s[11]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function is(i){let t,e;const n=[{floorplanData:i[7],floorIndex:i[1],getRuleDistanceText:i[10]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new nd({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&1154?Re(n,[{floorplanData:s[7],floorIndex:s[1],getRuleDistanceText:s[10]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function Sd(i){let t,e,n,o,s,r,a,l,c;const u=[{floorIndex:i[1],floorplanData:i[7]}];let h={};for(let v=0;v<u.length;v+=1)h=je(h,u[v]);e=new wd({props:h});let d=i[2]&&ts(i);const f=[{floorplanData:i[7],floorIndex:i[1]}];let g={};for(let v=0;v<f.length;v+=1)g=je(g,f[v]);s=new Ba({props:g});let A=i[3]&&ns(i),p=i[6]&&is(i);return{c(){t=z("div"),K(e.$$.fragment),n=$(),d&&d.c(),o=$(),K(s.$$.fragment),r=$(),A&&A.c(),a=$(),p&&p.c(),b(t,"class",l=Te(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(v,y){T(v,t,y),J(e,t,null),B(t,n),d&&d.m(t,null),B(t,o),J(s,t,null),B(t,r),A&&A.m(t,null),B(t,a),p&&p.m(t,null),c=!0},p(v,[y]){const w=y&130?Re(u,[{floorIndex:v[1],floorplanData:v[7]}]):{};e.$set(w),v[2]?d?(d.p(v,y),y&4&&E(d,1)):(d=ts(v),d.c(),E(d,1),d.m(t,o)):d&&(se(),D(d,1,1,()=>{d=null}),re());const P=y&130?Re(f,[{floorplanData:v[7],floorIndex:v[1]}]):{};s.$set(P),v[3]?A?(A.p(v,y),y&8&&E(A,1)):(A=ns(v),A.c(),E(A,1),A.m(t,a)):A&&(se(),D(A,1,1,()=>{A=null}),re()),v[6]?p?(p.p(v,y),y&64&&E(p,1)):(p=is(v),p.c(),E(p,1),p.m(t,null)):p&&(se(),D(p,1,1,()=>{p=null}),re()),(!c||y&1&&l!==(l=Te(`floorplan-plugin__floor${v[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&b(t,"class",l)},i(v){c||(E(e.$$.fragment,v),E(d),E(s.$$.fragment,v),E(A),E(p),c=!0)},o(v){D(e.$$.fragment,v),D(d),D(s.$$.fragment,v),D(A),D(p),c=!1},d(v){v&&M(t),Z(e),d&&d.d(),Z(s),A&&A.d(),p&&p.d()}}}function Md(i,t,e){let{isCurrent:n}=t,{floorIndex:o}=t,{hoverEnable:s}=t,{roomLabelsEnable:r}=t,{roomAreaEnable:a}=t,{roomNameEnable:l}=t,{ruleLabelsEnable:c}=t,{floorplanData:u}=t,{getRoomAreaText:h}=t,{getLabelElement:d}=t,{getRuleDistanceText:f}=t,{adaptiveRoomLabelVisibleEnable:g}=t;const A=ao(void 0);return i.$$set=p=>{"isCurrent"in p&&e(0,n=p.isCurrent),"floorIndex"in p&&e(1,o=p.floorIndex),"hoverEnable"in p&&e(2,s=p.hoverEnable),"roomLabelsEnable"in p&&e(3,r=p.roomLabelsEnable),"roomAreaEnable"in p&&e(4,a=p.roomAreaEnable),"roomNameEnable"in p&&e(5,l=p.roomNameEnable),"ruleLabelsEnable"in p&&e(6,c=p.ruleLabelsEnable),"floorplanData"in p&&e(7,u=p.floorplanData),"getRoomAreaText"in p&&e(8,h=p.getRoomAreaText),"getLabelElement"in p&&e(9,d=p.getLabelElement),"getRuleDistanceText"in p&&e(10,f=p.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in p&&e(11,g=p.adaptiveRoomLabelVisibleEnable)},[n,o,s,r,a,l,c,u,h,d,f,g,A]}class Td extends oe{constructor(t){super(),ie(this,t,Md,Sd,ne,{isCurrent:0,floorIndex:1,hoverEnable:2,roomLabelsEnable:3,roomAreaEnable:4,roomNameEnable:5,ruleLabelsEnable:6,floorplanData:7,getRoomAreaText:8,getLabelElement:9,getRuleDistanceText:10,adaptiveRoomLabelVisibleEnable:11},Ld)}}function zd(i){ce(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function os(i,t,e){const n=i.slice();return n[18]=t[e],n}function ss(i){let t,e,n,o,s,r,a=i[11].floorDatas,l=[];for(let f=0;f<a.length;f+=1)l[f]=rs(os(i,a,f));const c=f=>D(l[f],1,1,()=>{l[f]=null}),u=[{panoIndex:i[3],floorplanData:i[11],lastPanoramaLongitude:i[12],cameraImageUrl:i[13]}];let h={};for(let f=0;f<u.length;f+=1)h=je(h,u[f]);n=new Au({props:h});let d=i[6]&&as(i);return{c(){t=z("div");for(let f=0;f<l.length;f+=1)l[f].c();e=$(),K(n.$$.fragment),o=$(),d&&d.c(),b(t,"class","floorplan-main svelte-86bqav")},m(f,g){T(f,t,g);for(let A=0;A<l.length;A+=1)l[A].m(t,null);B(t,e),J(n,t,null),B(t,o),d&&d.m(t,null),r=!0},p(f,g){if(i=f,g&249776){a=i[11].floorDatas;let p;for(p=0;p<a.length;p+=1){const v=os(i,a,p);l[p]?(l[p].p(v,g),E(l[p],1)):(l[p]=rs(v),l[p].c(),E(l[p],1),l[p].m(t,e))}for(se(),p=a.length;p<l.length;p+=1)c(p);re()}const A=g&14344?Re(u,[{panoIndex:i[3],floorplanData:i[11],lastPanoramaLongitude:i[12],cameraImageUrl:i[13]}]):{};n.$set(A),i[6]?d?(d.p(i,g),g&64&&E(d,1)):(d=as(i),d.c(),E(d,1),d.m(t,null)):d&&(se(),D(d,1,1,()=>{d=null}),re())},i(f){if(!r){for(let g=0;g<a.length;g+=1)E(l[g]);E(n.$$.fragment,f),E(d),s||xe(()=>{s=Tt(t,Mt,{duration:i[0],easing:At}),s.start()}),r=!0}},o(f){l=l.filter(Boolean);for(let g=0;g<l.length;g+=1)D(l[g]);D(n.$$.fragment,f),D(d),r=!1},d(f){f&&M(t),at(l,f),Z(n),d&&d.d()}}}function rs(i){let t,e;const n=[{hoverEnable:i[5],floorplanData:i[11],getRoomAreaText:i[14],getLabelElement:i[15],getRuleDistanceText:i[16],roomLabelsEnable:i[7],roomAreaEnable:i[8],roomNameEnable:i[9],ruleLabelsEnable:i[10],adaptiveRoomLabelVisibleEnable:i[17]},{floorIndex:i[18].floorIndex},{isCurrent:i[18].floorIndex===i[4]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Td({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&249776?Re(n,[r&249760&&{hoverEnable:s[5],floorplanData:s[11],getRoomAreaText:s[14],getLabelElement:s[15],getRuleDistanceText:s[16],roomLabelsEnable:s[7],roomAreaEnable:s[8],roomNameEnable:s[9],ruleLabelsEnable:s[10],adaptiveRoomLabelVisibleEnable:s[17]},r&2048&&{floorIndex:s[18].floorIndex},r&2064&&{isCurrent:s[18].floorIndex===s[4]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function as(i){let t,e;return t=new Eu({props:{floorplanData:i[11],northDesc:i[2]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2048&&(s.floorplanData=n[11]),o&4&&(s.northDesc=n[2]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Bd(i){let t,e,n=i[1]&&ss(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&&E(n,1)):(n=ss(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function jd(i,t,e){let{duration:n=0}=t,{visible:o}=t,{northDesc:s}=t,{panoIndex:r}=t,{floorIndex:a}=t,{hoverEnable:l}=t,{compassEnable:c}=t,{roomLabelsEnable:u}=t,{roomAreaEnable:h}=t,{roomNameEnable:d}=t,{ruleLabelsEnable:f}=t,{floorplanData:g}=t,{lastPanoramaLongitude:A}=t,{cameraImageUrl:p}=t,{getRoomAreaText:v}=t,{getLabelElement:y}=t,{getRuleDistanceText:w}=t,{adaptiveRoomLabelVisibleEnable:P}=t;return i.$$set=k=>{"duration"in k&&e(0,n=k.duration),"visible"in k&&e(1,o=k.visible),"northDesc"in k&&e(2,s=k.northDesc),"panoIndex"in k&&e(3,r=k.panoIndex),"floorIndex"in k&&e(4,a=k.floorIndex),"hoverEnable"in k&&e(5,l=k.hoverEnable),"compassEnable"in k&&e(6,c=k.compassEnable),"roomLabelsEnable"in k&&e(7,u=k.roomLabelsEnable),"roomAreaEnable"in k&&e(8,h=k.roomAreaEnable),"roomNameEnable"in k&&e(9,d=k.roomNameEnable),"ruleLabelsEnable"in k&&e(10,f=k.ruleLabelsEnable),"floorplanData"in k&&e(11,g=k.floorplanData),"lastPanoramaLongitude"in k&&e(12,A=k.lastPanoramaLongitude),"cameraImageUrl"in k&&e(13,p=k.cameraImageUrl),"getRoomAreaText"in k&&e(14,v=k.getRoomAreaText),"getLabelElement"in k&&e(15,y=k.getLabelElement),"getRuleDistanceText"in k&&e(16,w=k.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in k&&e(17,P=k.adaptiveRoomLabelVisibleEnable)},[n,o,s,r,a,l,c,u,h,d,f,g,A,p,v,y,w,P]}class lo extends oe{constructor(t){super(),ie(this,t,jd,Bd,ne,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,hoverEnable:5,compassEnable:6,roomLabelsEnable:7,roomAreaEnable:8,roomNameEnable:9,ruleLabelsEnable:10,floorplanData:11,lastPanoramaLongitude:12,cameraImageUrl:13,getRoomAreaText:14,getLabelElement:15,getRuleDistanceText:16,adaptiveRoomLabelVisibleEnable:17},zd)}}const Vd="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLO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1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function Qd(i){return H(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(o){return H(this,null,function*(){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=yield fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s})};return yield Promise.all(i.map(e))})}function Rd(i){return{id:i.id,size:i.size,name:i.name,path:i.path,roomType:i.room_type,floorType:i.floor_type,roomLabel:{position:i.room_label.position,positionInImage:i.room_label.position_in_image},observerIndexs:i.observer_indexs}}function Od(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(Rd),rules:i.rules}}function Fd(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function Hd(i){return{rad:i.rad,position:i.position,positionInImage:i.position_in_image,northRad:i.north_rad,roomId:i.room_id,floorIndex:i.floor_index}}function bt(i){return H(this,null,function*(){const t=yield Qd(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(Od),o=i.computed_data.entrance?Hd(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(Fd)}})}function Gd(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:Vd,width:45,height:48},a=sd(s,t),l=id(s,e),c=od(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function Wd(i,t){return t(i),i}function ui(i,t){return Wd({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function ls(i,t){const e=Math.max(...i.work.observers.map(n=>n.floorIndex));return t>e?i.model.bounding.max.y:Math.max(...i.work.observers.filter(n=>n.floorIndex===t).map(n=>n.standingPosition.y))}function co(i,t,e=pt.BOUNDING_CENTER){const n=ls(i,t),o=ls(i,t+1);return e===pt.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===pt.CEILING?o:n}function uo(i,t,e,n){const o=co(i,e,n==null?void 0:n.attachedTo),s=new I.Vector3(0,o,0),r=new I.Vector3(1,o,0),a=s.clone().project(i.camera),l=r.clone().project(i.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}class Cn{constructor(t,e){m(this,"five");m(this,"hooks",new qt);m(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}}class zt extends Cn{}var We=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(We||{});const Qa=500,Nd=80;function Ni(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function Ra(i,t){return H(this,null,function*(){yield new Promise((e,n)=>{i.changeMode(...t).catch(o=>n(o)),i.once("initAnimationEnded",()=>{const o=i.getCurrentState(),s=t[0];o.mode!==s&&n(new Error("mode \u4E0E\u9884\u671F\u4E0D\u7B26")),(()=>{const l=t[1];return l?Object.keys(l).every(c=>{const u=o[c];if(u===void 0)return!0;const h=l[c];return typeof u=="number"&&typeof h=="number"?Ni(u,h,2):u===h}):!0})()||n(new Error("five pose \u4E0E\u9884\u671F\u4E0D\u7B26")),e()})})})}function ho(i,t){if(i.currentMode!==t.mode)return!1;const{latitude:e,longitude:n,fov:o}=t,{latitude:s,longitude:r}=i.getCurrentState(),a=i.camera.fov;return!(!Ni(e,s,2)||!Ni(n,r,2)||o!==a)}function Oa(i,t,e=!0){return H(this,null,function*(){if(ho(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[u]=yield ti(Ra(i,[t.mode,t,void 0,e]));if(u)throw new Error(We.ChangeModeError);return}const{latitude:s,longitude:r,fov:a}=o,l=Math.min(1e3,Math.max(200,Math.abs(s-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,Math.abs(a-t.fov)*10)),[c]=yield ti(i.updateCamera(t,l,e));if(c)throw new Error(We.UpdateCameraError)})}function Xt(i,t,e=300){const n=i.getElement();!n||(n.style.opacity=t+"",n.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(o=>n.addEventListener("transitionend",o,{once:!0})),new Promise(o=>setTimeout(o,e))]).then(()=>{n.style.transition="none"}))}function _d(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function Xd(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}class Yd extends zt{constructor(e,n){var a;super(e);m(this,"name","modelFloorplanPlugin");m(this,"state");m(this,"data");m(this,"showState");m(this,"showPromise");m(this,"app");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"selector");m(this,"showRejection");m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"show",(...n)=>H(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));m(this,"hide",(...n)=>H(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));m(this,"updateSize",()=>{if(!this.data||!ho(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=uo(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});m(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,We.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});m(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});m(this,"_show",e=>H(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(We.ModelNotLoaded);if(!this.data)throw new Error(We.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=R(R({},n),e),s=()=>H(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=d=>{a=!0,l=d};const[c]=yield ti(Oa(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(We.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,h=o.immediately?0:Qa;Xt(this.five,u,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));m(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,We.BreakOffByHide),this.showPromise=void 0;const o=R(R({},{userAction:!0,isAutoHide:!1}),e);Xt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});m(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});m(this,"onFiveInteriaPan",(e,n)=>{if(!n||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();o.mode==="Floorplan"&&(this.state.visible||Xd(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();_d(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});m(this,"onFiveWantsGesture",(e,n)=>{if(!!this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});m(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});m(this,"onFiveWantsTapGesture",()=>this.handleClick());m(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:Nd/((a=n==null?void 0:n.scale)!=null?a:1)};const o={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:vt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},s=n?ui(n,["selector","scale"]):{},r=R(R({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return H(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield bt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}this.render()}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return H(this,null,function*(){return yield bt(e.data)})}updateState(e,n){const o=this.state,s=e.config?R(R({},o.config),e.config):o.config;this.state=me(R(R({},this.state),e),{config:s}),!et(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=me(R({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude});if(this.app)return this.app.$set(n);this.app=new lo({target:this.container,intro:!0,props:n})}}const Ud=(i,t)=>new Yd(i,t);function qd(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function Jd(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}class Zd extends zt{constructor(e,n){super(e);m(this,"name","modelFloorplanPlugin");m(this,"state");m(this,"data");m(this,"showState");m(this,"showPromise");m(this,"app");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"selector");m(this,"showRejection");m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"show",(...n)=>H(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));m(this,"hide",(...n)=>H(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));m(this,"updateSize",()=>{if(!this.data||!ho(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=uo(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});m(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,We.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});m(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});m(this,"_show",e=>H(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(We.ModelNotLoaded);if(!this.data)throw new Error(We.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=R(R({},n),e),s=()=>H(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=d=>{a=!0,l=d};const[c]=yield ti(Oa(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(We.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,h=o.immediately?0:Qa;Xt(this.five,u,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));m(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,We.BreakOffByHide),this.showPromise=void 0;const o=R(R({},{userAction:!0,isAutoHide:!1}),e);Xt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});m(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();this.updatePosition(),this.updateSize(),qd(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});m(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1){if(n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1;if(n&&!this.state.visible){if(this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();return o.mode!==this.showState.mode||this.state.visible?void 0:(Jd(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});m(this,"onFiveWantsTapGesture",()=>this.handleClick());m(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2,fov:90};const o={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:vt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?ui(n,["selector","scale"]):{},r=R(R({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return H(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield bt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}updatePosition(){var a;const e=co(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new I.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}formatData(e){return H(this,null,function*(){return yield bt(e.data)})}updateState(e,n){const o=this.state,s=e.config?R(R({},o.config),e.config):o.config;this.state=me(R(R({},this.state),e),{config:s}),!et(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=me(R({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude});if(this.app)return this.app.$set(n);this.app=new lo({target:this.container,intro:!0,props:n})}}const Kd=(i,t)=>new Zd(i,t);class $d extends zt{constructor(e,n){super(e);m(this,"name","topviewFloorplanPlugin");m(this,"state");m(this,"data");m(this,"app");m(this,"selector");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper||this.five.getCurrentState().mode!=="Topview")return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=uo(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"_disable",e=>{var o,s;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,(s=this.container)==null||s.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:n})});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{!this.state.visible||(this.updatePosition(),this.updateSize())});m(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});m(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});m(this,"onFiveInitAnimationEnded",(...[,,e])=>{const{mode:n}=this.five.getCurrentState();n==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},e),this._show({userAction:e}))});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"));const o={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:vt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?ui(n,["selector","scale"]):{},r=R(R({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return H(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield bt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}updatePosition(){var a;const e=co(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new I.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return H(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return H(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return H(this,null,function*(){return yield bt(e.data)})}_show(e){return H(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:n}=e;this.hooks.emit("show",{userAction:n,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield Ra(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const o=500,s=this.state.config.modelOpacity;Xt(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return H(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;Xt(this.five,o,s),this.render()})}_enable(e){const{userAction:n}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}updateState(e,n){const o=this.state,s=e.config?R(R({},o.config),e.config):o.config;this.state=me(R(R({},this.state),e),{config:s}),!et(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=me(R({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude});if(this.app)return this.app.$set(n);this.app=new lo({target:this.container,intro:!0,props:n})}}const eh=(i,t)=>new $d(i,t);function fo(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function th(i){ce(i,"svelte-1nqrlxd",".plugin-radar__camera-wrapper.svelte-1nqrlxd{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1nqrlxd{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1nqrlxd{position:absolute;left:-0.9375rem;top:-0.9375rem;width:1.0625rem;height:1.0625rem;transform-origin:0.9375rem 0.9375rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function nh(i){let t,e,n;return{c(){t=z("div"),e=z("div"),n=z("div"),b(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),L(n,"background-image","url("+(i[0]||vt)+")"),L(n,"transform",i[1]),b(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),L(e,"transform",i[2]),b(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(o,s){T(o,t,s),B(t,e),B(e,n)},p(o,[s]){s&1&&L(n,"background-image","url("+(o[0]||vt)+")"),s&2&&L(n,"transform",o[1]),s&4&&L(e,"transform",o[2])},i:Y,o:Y,d(o){o&&M(t)}}}function ih(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function oh(i,t,e){let n,o,{five:s}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=s.getCurrentState().panoIndex,u=s.getCurrentState().longitude;function h(g,A){const p=g.bounding,v=g.observers[A];if(!v)return"";const y=(p.max.x-p.min.x)*r,w=(p.max.y-p.min.y)*r,P=Math.floor(v.positionInImage.x*y),k=Math.floor(v.positionInImage.y*w);return`translate(${P}px, ${k}px)`}function d(g){e(6,c=g)}const f=fo(g=>{e(7,u=g.longitude)},1e3/60);return Ue(()=>(s.on("panoWillArrive",d),s.on("cameraDirectionUpdate",f),function(){s.off("panoWillArrive",d),s.off("cameraDirectionUpdate",f)})),i.$$set=g=>{"five"in g&&e(3,s=g.five),"pxmm"in g&&e(4,r=g.pxmm),"floorplanData"in g&&e(5,a=g.floorplanData),"cameraImageUrl"in g&&e(0,l=g.cameraImageUrl)},i.$$.update=()=>{i.$$.dirty&96&&e(2,n=h(a,c)),i.$$.dirty&128&&e(1,o=ih(u))},[l,o,n,s,r,a,c,u]}class sh extends oe{constructor(t){super(),ie(this,t,oh,nh,ne,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},th)}}function rh(i){ce(i,"svelte-1i87fz7",".plugin-pano-floorplan__extra-objects.svelte-1i87fz7{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-1i87fz7{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-1i87fz7{transform:translate(-50%, -50%)}")}function cs(i,t,e){const n=i.slice();return n[1]=t[e],n}function us(i,t){let e,n,o=`${t[1].icon.width/16}rem`,s=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:i,first:null,c(){e=z("div"),n=z("div"),r=$(),b(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),L(n,"background-image",`url(${t[1].icon.url})`),L(n,"width",o),L(n,"height",s),b(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),L(e,"top",a),L(e,"left",l),this.first=e},m(c,u){T(c,e,u),B(e,n),B(e,r)},p(c,u){t=c,u&1&&L(n,"background-image",`url(${t[1].icon.url})`),u&1&&o!==(o=`${t[1].icon.width/16}rem`)&&L(n,"width",o),u&1&&s!==(s=`${t[1].icon.height/16}rem`)&&L(n,"height",s),u&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&L(e,"top",a),u&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&L(e,"left",l)},d(c){c&&M(e)}}}function ah(i){let t,e=[],n=new Map,o=i[0];const s=r=>r[1].id;for(let r=0;r<o.length;r+=1){let a=cs(i,o,r),l=s(a);n.set(l,e[r]=us(l,a))}return{c(){t=z("div");for(let r=0;r<e.length;r+=1)e[r].c();b(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){T(r,t,a);for(let l=0;l<e.length;l+=1)e[l].m(t,null)},p(r,[a]){a&1&&(o=r[0],e=qe(e,a,s,1,r,o,n,t,so,us,null,cs))},i:Y,o:Y,d(r){r&&M(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function lh(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class ch extends oe{constructor(t){super(),ie(this,t,lh,ah,ne,{extraObjects:0},rh)}}function ds(i){let t,e;const n=[{five:i[0],pxmm:i[1],floorIndex:i[2],floorplanData:i[4],onRoomHeightClick:i[6]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new Va({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&87?Re(n,[{five:s[0],pxmm:s[1],floorIndex:s[2],floorplanData:s[4],onRoomHeightClick:s[6]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function uh(i){let t,e,n,o,s,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let u=0;u<a.length;u+=1)l=je(l,a[u]);t=new Ba({props:l}),n=new ch({props:{extraObjects:i[5]}});let c=i[3]&&ds(i);return{c(){K(t.$$.fragment),e=$(),K(n.$$.fragment),o=$(),c&&c.c(),s=fe()},m(u,h){J(t,u,h),T(u,e,h),J(n,u,h),T(u,o,h),c&&c.m(u,h),T(u,s,h),r=!0},p(u,[h]){const d=h&20?Re(a,[{floorIndex:u[2],floorplanData:u[4]}]):{};t.$set(d);const f={};h&32&&(f.extraObjects=u[5]),n.$set(f),u[3]?c?(c.p(u,h),h&8&&E(c,1)):(c=ds(u),c.c(),E(c,1),c.m(s.parentNode,s)):c&&(se(),D(c,1,1,()=>{c=null}),re())},i(u){r||(E(t.$$.fragment,u),E(n.$$.fragment,u),E(c),r=!0)},o(u){D(t.$$.fragment,u),D(n.$$.fragment,u),D(c),r=!1},d(u){Z(t,u),u&&M(e),Z(n,u),u&&M(o),c&&c.d(u),u&&M(s)}}}function dh(i,t,e){let n,{five:o}=t,{pxmm:s}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t;const u=void 0;return i.$$set=h=>{"five"in h&&e(0,o=h.five),"pxmm"in h&&e(1,s=h.pxmm),"floorIndex"in h&&e(2,r=h.floorIndex),"hoverEnable"in h&&e(3,a=h.hoverEnable),"floorplanData"in h&&e(4,l=h.floorplanData),"extraObjects"in h&&e(7,c=h.extraObjects)},i.$$.update=()=>{i.$$.dirty&132&&e(5,n=c==null?void 0:c.filter(h=>h.floorIndex===r))},[o,s,r,a,l,n,u,c]}class hh extends oe{constructor(t){super(),ie(this,t,dh,uh,ne,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:7})}}function fh(i){ce(i,"svelte-1mvqyqq",".plugin-floorplan-radar.svelte-1mvqyqq{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-1mvqyqq{position:relative}")}function hs(i){let t,e,n,o=i[6]!==0&&fs(i);return{c(){t=z("div"),o&&o.c(),b(t,"class","plugin-floorplan-radar svelte-1mvqyqq"),xe(()=>i[12].call(t))},m(s,r){T(s,t,r),o&&o.m(t,null),e=tt(t,i[12].bind(t)),n=!0},p(s,r){s[6]!==0?o?(o.p(s,r),r&64&&E(o,1)):(o=fs(s),o.c(),E(o,1),o.m(t,null)):o&&(se(),D(o,1,1,()=>{o=null}),re())},i(s){n||(E(o),n=!0)},o(s){D(o),n=!1},d(s){s&&M(t),o&&o.d(),e()}}}function fs(i){let t,e,n,o,s=`${i[8]}px`,r=`${i[11]}px`,a;const l=[{five:i[0],pxmm:i[9],floorIndex:i[10],floorplanData:i[3],hoverEnable:i[2],extraObjects:i[5]}];let c={};for(let d=0;d<l.length;d+=1)c=je(c,l[d]);e=new hh({props:c});const u=[{pxmm:i[9],five:i[0],floorplanData:i[3],cameraImageUrl:i[4]}];let h={};for(let d=0;d<u.length;d+=1)h=je(h,u[d]);return o=new sh({props:h}),{c(){t=z("div"),K(e.$$.fragment),n=$(),K(o.$$.fragment),b(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),L(t,"width",s),L(t,"height",r)},m(d,f){T(d,t,f),J(e,t,null),B(t,n),J(o,t,null),a=!0},p(d,f){const g=f&1581?Re(l,[{five:d[0],pxmm:d[9],floorIndex:d[10],floorplanData:d[3],hoverEnable:d[2],extraObjects:d[5]}]):{};e.$set(g);const A=f&537?Re(u,[{pxmm:d[9],five:d[0],floorplanData:d[3],cameraImageUrl:d[4]}]):{};o.$set(A),f&256&&s!==(s=`${d[8]}px`)&&L(t,"width",s),f&2048&&r!==(r=`${d[11]}px`)&&L(t,"height",r)},i(d){a||(E(e.$$.fragment,d),E(o.$$.fragment,d),a=!0)},o(d){D(e.$$.fragment,d),D(o.$$.fragment,d),a=!1},d(d){d&&M(t),Z(e),Z(o)}}}function mh(i){let t,e,n=i[1]&&hs(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&&E(n,1)):(n=hs(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function ph(i,t,e){var v,y;let{five:n}=t,{visible:o}=t,{hoverEnable:s}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,c=0,u=(y=(v=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:v.floorIndex)!=null?y:0,h=0,d=0,f=0,g=0;function A(w){e(10,u=n.work.observers[w].floorIndex)}Ue(()=>(n.on("panoArrived",A),()=>{n.off("panoArrived",A)}));function p(){h=this.clientWidth,d=this.clientHeight,e(6,h),e(7,d)}return i.$$set=w=>{"five"in w&&e(0,n=w.five),"visible"in w&&e(1,o=w.visible),"hoverEnable"in w&&e(2,s=w.hoverEnable),"floorplanData"in w&&e(3,r=w.floorplanData),"cameraImageUrl"in w&&e(4,a=w.cameraImageUrl),"extraObjects"in w&&e(5,l=w.extraObjects)},i.$$.update=()=>{if(i.$$.dirty&456){const w=Math.min(h,d),{max:P,min:k}=r.bounding,C=P.x-k.x,S=P.y-k.y,x=function(){return C>S?[w,w/C*S]:[w/S*C,w]}();e(8,f=x[0]),e(11,g=x[1]),e(9,c=f/C)}},[n,o,s,r,a,l,h,d,f,c,u,g,p]}class gh extends oe{constructor(t){super(),ie(this,t,ph,mh,ne,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5},fh)}}class Ah extends zt{constructor(e,n){super(e);m(this,"name","panoFloorplanRadarPlugin");m(this,"state");m(this,"data");m(this,"app");m(this,"wrapperSelector","");m(this,"wrapper",null);m(this,"disposed",!1);m(this,"extraObjects",[]);m(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});m(this,"_disable",e=>{var o;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:n})});this.five=e;const o={hoverEnable:!1,cameraImageUrl:vt},s=n!=null&&n.configs?n.configs:{},r=R(R({},o),s);this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}load(e,n,o=!0){return H(this,null,function*(){function s(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=s(r)?r.data:r,l=this.data;this.data=yield bt(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,o),this.render()})}show(){return H(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return H(this,arguments,function*(e={}){if(!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,n=!0){this.setState({config:e},{userAction:n}),this.render()}setExtraObjectsWith3DPositions(e){!this.data||(this.extraObjects=Gd(e,this.five,this.data),this.render())}formatData(e){return H(this,null,function*(){return yield bt(e.data)})}_enable(e){const{userAction:n}=e;this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}_show(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("show",{userAction:n}),this.render()}_hide(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n}),this.render()}updateState(e,n){const o=this.state;this.state=R(R({},this.state),e),!et(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const n=document.querySelector(this.wrapperSelector);this.wrapper=n}if(!this.data||!this.wrapper)return;const e=me(R({},this.state.config),{five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects});this.app?this.app.$set(e):this.app=new gh({target:this.wrapper,props:e})}}const vh=(i,t)=>new Ah(i,t),bh=[{type:0,floorType:1,roomType:"100900000012",name:"\u5176\u4ED6"},{type:1,floorType:1,roomType:"100900000002",name:"\u5BA2\u5385"},{type:2,floorType:1,roomType:"100900000002",name:"\u9910\u5385"},{type:3,floorType:0,roomType:"100900000001",name:"\u5367\u5BA4"},{type:4,floorType:0,roomType:"100900000001",name:"\u4E66\u623F"},{type:5,floorType:3,roomType:"100900000004",name:"\u536B\u751F\u95F4"},{type:6,floorType:3,roomType:"100900000004",name:"\u6DCB\u6D74\u95F4"},{type:7,floorType:3,roomType:"100900000004",name:"\u6D17\u624B\u95F4"},{type:8,floorType:3,roomType:"100900000003",name:"\u53A8\u623F"},{type:9,floorType:1,roomType:"100900000003",name:"\u5F00\u653E\u53A8\u623F",onlySubArea:!0},{type:10,floorType:0,roomType:"100900000001",name:"\u591A\u529F\u80FD\u95F4"},{type:11,floorType:0,roomType:"100900000009",name:"\u4FDD\u59C6\u95F4"},{type:12,floorType:4,roomType:"100900000005",name:"\u9633\u53F0"},{type:13,floorType:4,roomType:"100900000006",name:"\u9732\u53F0"},{type:14,floorType:0,roomType:"100900000008",name:"\u50A8\u7269\u95F4"},{type:15,floorType:0,roomType:"100900000013",name:"\u8863\u5E3D\u95F4"},{type:16,floorType:0,roomType:"100900000011",name:"\u9601\u697C"},{type:17,floorType:2,roomType:"100900000007",name:"\u82B1\u56ED"},{type:18,floorType:5,roomType:"100900000010",name:"\u8F66\u5E93"},{type:19,floorType:1,roomType:"100900000012",name:"\u7535\u68AF"},{type:20,floorType:1,roomType:"100900000012",name:"\u5730\u4E0B\u5BA4"},{type:21,floorType:1,roomType:"100900000012",name:"\u5929\u4E95"},{type:22,floorType:1,roomType:"100900000012",name:"\u9633\u5149\u623F"},{type:23,floorType:1,roomType:"100900000012",name:"\u8FC7\u9053"},{type:24,floorType:1,roomType:"100900000012",name:"\u697C\u68AF\u95F4"},{type:25,floorType:1,roomType:"100900000012",name:"\u95E8\u5385"},{type:26,floorType:2,roomType:"100900000012",name:"\u5165\u6237\u82B1\u56ED"},{type:27,floorType:1,roomType:"100900000012",name:"\u7384\u5173"},{type:28,floorType:1,roomType:"100900000012",name:"\u6311\u7A7A"},{type:29,floorType:4,roomType:"100900000012",name:"\u667E\u6652\u533A"},{type:30,floorType:4,roomType:"100900000012",name:"\u6D17\u8863\u623F"},{type:31,floorType:0,roomType:"100900000012",name:"\u5A31\u4E50\u533A"},{type:32,floorType:0,roomType:"100900000012",name:"\u5065\u8EAB\u533A"},{type:33,floorType:0,roomType:"100900000012",name:"\u63A5\u5F85\u533A"},{type:34,floorType:0,roomType:"100900000012",name:"\u5F71\u97F3\u533A"},{type:35,floorType:1,roomType:"100900000012",name:"\u9910\u996E\u533A"},{type:36,floorType:1,roomType:"100900000012",name:"\u5176\u4ED6",onlySubArea:!0},{type:37,floorType:1,roomType:"100900000002",name:"\u8D77\u5C45\u5BA4"},{type:38,floorType:0,roomType:"100900000001",name:"\u4E3B\u5367"},{type:39,floorType:0,roomType:"100900000001",name:"\u6B21\u5367"},{type:40,floorType:0,roomType:"100900000001",name:"\u4F18\u5316\u95F4"},{type:41,floorType:0,roomType:"100900000001",name:"\u529E\u516C\u5BA4"},{type:42,floorType:0,roomType:"100900000001",name:"\u4F1A\u8BAE\u5BA4"},{type:43,floorType:0,roomType:"100900000001",name:"\u6D3D\u8C08\u95F4"},{type:44,floorType:1,roomType:"100900000002",name:"\u5171\u4EAB\u5927\u5385"},{type:45,floorType:1,roomType:"100900000012",name:"\u6C34\u5427"},{type:46,floorType:0,roomType:"100900000015",name:"\u51FA\u5165\u53E3"},{type:47,floorType:0,roomType:"100900000015",name:"\u5927\u5385"},{type:48,floorType:0,roomType:"100900000015",name:"\u5305\u53A2"},{type:49,floorType:0,roomType:"100900000015",name:"\u5176\u4ED6"},{type:50,floorType:0,roomType:"100900000016",name:"\u51FA\u5165\u53E3"},{type:51,floorType:0,roomType:"100900000016",name:"\u529E\u516C\u533A"},{type:52,floorType:0,roomType:"100900000016",name:"\u8001\u677F\u95F4"},{type:53,floorType:0,roomType:"100900000016",name:"\u4F1A\u8BAE\u5BA4"},{type:54,floorType:0,roomType:"100900000016",name:"\u4F11\u606F\u533A/\u6C34\u5427"},{type:55,floorType:0,roomType:"100900000016",name:"\u5176\u4ED6"},{type:56,floorType:2,roomType:"100900000012",name:"\u7A7A\u4E2D\u82B1\u56ED"},{type:57,floorType:0,roomType:"100900000001",name:"\u6D0B\u5BA4"},{type:58,floorType:0,roomType:"100900000001",name:"\u548C\u5BA4"}],yh=[{type:0,description:"\u6728\u8D28\u5730\u677F"},{type:1,description:"\u74F7\u7816\u5730\u9762"},{type:2,description:"\u6237\u5916\u5730\u9762"},{type:3,description:"\u536B\u751F\u95F4\u5730\u9762"},{type:4,description:"\u9633\u53F0\u5730\u9762"},{type:5,description:"\u8F66\u5E93\u5730\u9762"}],wh=[{roomType:"100900000001",description:"\u5BA4"},{roomType:"100900000002",description:"\u5385"},{roomType:"100900000003",description:"\u53A8"},{roomType:"100900000004",description:"\u536B"},{roomType:"100900000005",description:"\u9633\u53F0"},{roomType:"100900000006",description:"\u9732\u53F0"},{roomType:"100900000007",description:"\u82B1\u56ED"},{roomType:"100900000008",description:"\u50A8"},{roomType:"100900000009",description:"\u4FDD\u59C6\u95F4"},{roomType:"100900000010",description:"\u8F66\u5E93"},{roomType:"100900000011",description:"\u9601\u697C"},{roomType:"100900000012",description:"\u5176\u4ED6"},{roomType:"100900000013",description:"\u8863"},{roomType:"100900000015",description:"\u5546\u94FA"},{roomType:"100900000016",description:"\u5199\u5B57\u697C"}],ki=(i,t,e)=>{const n=new I.Matrix4,o=new I.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},Ch=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[o,s,r]=e;o&&i.applyMatrix4(ki(o,0,0)),s&&i.applyMatrix4(ki(0,s,0)),r&&i.applyMatrix4(ki(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function Fa(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s=R({map:o.material.map||{}},t);o.material=new V.MeshBasicMaterial(s),o.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const Ph=(i,t)=>{var u;const e=t.fbx_url||"//vrlab-static.ljcdn.com/release/web/v3/dipan3/dipan.FBX",n=(u=t.north_rad)!=null?u:void 0,o={},s=h=>H(exports,null,function*(){var U;const d=(h==null?void 0:h.fbx_url)||e,f=(U=h==null?void 0:h.north_rad)!=null?U:n;if(typeof f!="number")throw new Error('"northRad"\u914D\u7F6E\u53C2\u6570\u7F3A\u5931\uFF1A\u672A\u914D\u7F6E\u6307\u5357\u9488\u6307\u5411\uFF01');const g=i.model.bounding,A=g.max.x-g.min.x,p=g.max.z-g.min.z,v=Math.max(A,p),w=yield new ca.FBXLoader().loadAsync(d);Fa(w,{transparent:!0,side:I.DoubleSide,blending:I.AdditiveBlending});const P=[0,f-Math.PI/2,0],{model:{bounding:{max:{x:k,z:C},min:{x:S,y:x,z:Q}}}}=i;o.yBase=x;const _={x:(k+S)/2,y:x-1.6,z:(C+Q)/2},O=.0045*v;return Ch(w,{position:_,rotation:P,scale:O}),o.object=w,!0}),r=({latitude:h})=>{if(!o.object)return;const d=a(h);d&&(o.object.position.y=d)},a=h=>{if(o.yBase===void 0)return;const d=.6;if(h>=Math.PI/4)return o.yBase-(d+1.6);const f=h*(4/Math.PI);return o.yBase-(d*f+1.6)};return{load:s,disable:()=>{!o.object||(i.scene.remove(o.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!o.object)return;const h=a(i.getPose().latitude);h&&(o.object.position.y=h),i.scene.add(o.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function Eh(i,t){var c,u,h,d,f;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(u=t==null?void 0:t.fontSize)!=null?u:e*(35/256)*1.2,o=(h=t==null?void 0:t.backgroundColor)!=null?h:"rgba(0,0,0,0)",s=(d=t==null?void 0:t.fontColor)!=null?d:"#fff",r=(f=t==null?void 0:t.textAlign)!=null?f:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=o,l.fillRect(0,0,e,e),l.font=`${n}px "\u5FAE\u8F6F\u96C5\u9ED1"`,l.textAlign=r,l.fillStyle=s,l.fillText(i,e/2,e*.7),new V.CanvasTexture(a)}const Ih=({x:i,y:t,z:e})=>new V.Vector3(i,t,e),kh=(i,t)=>{var A,p,v;const e={},n=(A=t.animationEnabled)!=null?A:!0,o=(p=t.position)!=null?p:void 0,s=(v=t.rad)!=null?v:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=y=>H(exports,null,function*(){var _,O,U,j,F,W,X,G;const w=(_=y==null?void 0:y.position)!=null?_:o;if(!w)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const P=Ih(w),k=(O=y==null?void 0:y.rad)!=null?O:s,C=(U=y==null?void 0:y.fbx_url)!=null?U:r;if(e.rad=k,k===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${k}`));const S=yield new ca.FBXLoader().loadAsync(C);S.position.copy(P),S.rotation.z=k,S.scale.set(.8,.8,.8),Fa(S,{transparent:!0,side:I.DoubleSide});const x=(X=(W=(F=(j=S.children)==null?void 0:j[0])==null?void 0:F.children)==null?void 0:W[3])==null?void 0:X.clone();if(!x)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${x}`));const Q=(G=t.name)!=null?G:"\u5165\u6237\u95E8";return x.material=new V.MeshBasicMaterial({transparent:!0,map:Eh(Q)}),x.renderOrder=3,S.children[0].add(x),e.object=S,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const y=1,w=new V.AnimationMixer(e.object);a.push(w);const P=w.clipAction(e.object.animations[0]);P.timeScale=y;let k;const C=()=>{let _=0,O=0;const U=1e3/30,j=F=>{_=requestAnimationFrame(j);const W=F-O;W<U||(O=F,a.forEach(X=>X.update(W/1e3)),i.needsRender=!0)};return _=requestAnimationFrame(j),()=>{cancelAnimationFrame(_)}},Q={play:()=>{k||(P.play(),k=C(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{P.stop(),k==null||k(),k=void 0}};e.animation=Q},u=y=>{var P;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((P=y==null?void 0:y.animationEnable)!=null?P:n)&&(e.animation||c(),e.animation.play()),i.scene.add(e.object),i.needsRender=!0},h=()=>{!e.object||(e.animation&&e.animation.stop(),i.scene.remove(e.object),i.needsRender=!0)},d=y=>y==="Floorplan"?u():h();return{load:l,enable:y=>(e.enabled||(e.enabled=!0,d(i.currentMode),i.on("modeChange",d),u(y)),!0),disable:()=>(e.enabled&&(e.enabled=!1,h(),i.off("modeChange",d)),!0)}};class mo extends pn.default.Tween{constructor(){super(...arguments);m(this,"disposeMethods",[]);m(this,"animationFrameDisposer");m(this,"onDispose",e=>(this.disposeMethods.push(e),this));m(this,"play",()=>(this.start(0),this.animationFrameDisposer=Pn(e=>this.update(e)),this));m(this,"dispose",()=>{var e;this.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this.disposeMethods.forEach(n=>n()),this.disposeMethods=[],pn.default.remove(this)})}}function Ha(i,t=pn.default.Easing.Linear.None){const e=new mo({progress:0}).to({progress:1});return i!==void 0&&e.duration(i),t!==void 0&&e.easing(t),e}const vn=window.requestAnimationFrame||(i=>setTimeout(i,16)),xh=window.cancelAnimationFrame||clearTimeout;function di(i,t=0){t<=0?vn(i):vn(()=>di(i,t-1))}function Pn(i,t=60){let e=-1,n=0,o=-1;const s=1e3/t;function r(a){o===-1&&(o=a),e=vn(r),!(a-n<s)&&(n=a,i&&i(a-o))}return e=vn(r),function(){xh(e)}}function Dh(){const i=Date.now();return new Promise(t=>{vn(()=>{t(Date.now()-i)})})}const Lh=ri.Easing;function Sh(i,t,e,n=Lh.Linear.None){const o=new ri.Tween(i).to(t,e).easing(n);di(()=>o.start(0));const s=Pn(a=>{o.update(a)===!1&&s()}),r=[];return o.onDestroy=a=>(r.push(a),o),o.destroy=function(){this.stop(),Object.assign(o,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();s()},o}function Mh(i,t){return Sh({progress:0},{progress:1},i,t)}var Ga=(i=>(i.Move="Move",i.Rotate="Rotate",i))(Ga||{}),$e=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))($e||{});const Yn=Math.PI*2;function ms(i){return(i%Yn+Yn)%Yn}function ps(i){return i%Yn}function xi(i,t,e){return i+(t-i)*e}const _i=(i,t,e)=>{const n=Math.PI,o=n*2;return i=ms(i),t=ms(t),e===$e.Anticlockwise&&i<t&&(i+=o),e===$e.Clockwise&&t<i&&(t+=o),e===$e.Loop&&t-i>n?_i(i,t,$e.Anticlockwise):e===$e.Loop&&i-t>n?_i(i,t,$e.Clockwise):{from:i,to:t}},Th=i=>{const t={},e=(l,c,...u)=>H(exports,[l,c,...u],function*(s,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),s.mode&&s.mode!==i.currentMode&&(yield i.changeMode(s.mode)),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(yield i.preloadPano(s.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:yield new Promise((h,d)=>{const f=s.panoIndex!==void 0?s.panoIndex:i.panoIndex;f!==void 0?i.moveToPano(f,Object.assign({duration:r,moveEndCallback:()=>h(!0),moveCancelCallback:()=>d(!1)},s)):d(!1)})}),n=s=>{const r=i.state,a=ps(r.latitude),l=ps(s.latitude),{from:c,to:u}=_i(r.longitude,s.longitude,s.rotation||$e.Loop),h=r.fov,d=s.fov;return{from:{latitude:a,longitude:c,fov:h},to:{latitude:l,longitude:u,fov:d}}};return{move:e,rotate:(l,c,...u)=>H(exports,[l,c,...u],function*(s,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),i.currentMode!==Ce.Five.Mode.Panorama&&(yield i.changeMode(Ce.Five.Mode.Panorama)),s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(a.preload&&(yield i.preloadPano(s.panoIndex)),yield new Promise((f,g)=>{if(!s.panoIndex){f(!0);return}i.moveToPano(s.panoIndex,{moveEndCallback:()=>f(!0),moveCancelCallback:()=>g(!1)})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:h,to:d}=n(s);return yield new Promise(f=>{const g=({progress:w})=>{const P={};P.longitude=xi(h.longitude,d.longitude,w),P.latitude=xi(h.latitude,d.latitude,w),P.fov=xi(h.fov,d.fov,w),i.setState(P,!0)},A=()=>{f(!0)},p=()=>{f(!1)},v=s.rotateSpeed?Math.ceil(Math.abs(d.longitude-h.longitude)/s.rotateSpeed*1e3):r,y=Mh(v,ri.Easing.Linear.None).onUpdate(g).onComplete(A).onDestroy(p);s.rotation===$e.Loop&&y.repeat(1/0).yoyo(!0),t.interruptCallback=(w=!0)=>{y.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),f(w)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function gs(i,t){return i.x===t.x&&i.y===t.y}function Wa(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function oi(i,t){return(t.y-i.y)/(t.x-i.x)}function Na(i,t,e){const n=oi(i[1],i[0]),o=oi(t[1],t[0]);if(isNaN(n)||isNaN(o)||Wa(n,o))return!1;if(Bn(i[0],t))return i[0];if(Bn(i[1],t))return i[1];if(Bn(t[0],i))return t[0];if(Bn(t[1],i))return t[1];if(e&&!zh(i,t))return!1;const s=i[0],r=t[0];if(Math.abs(n)===1/0)return{x:s.x,y:t[1].y-(t[1].x-s.x)*o};if(Math.abs(o)===1/0)return{x:r.x,y:i[1].y-(i[1].x-r.x)*n};const a=(r.y-s.y+n*s.x-o*r.x)/(n-o),l=n*a-n*s.x+s.y;return{x:a,y:l}}function Bn(i,t){return gs(i,t[0])||gs(i,t[1])?!0:(t[0].x-i.x)*(i.x-t[1].x)>=0&&(t[0].y-i.y)*(i.y-t[1].y)>=0&&Wa(oi(t[0],i),oi(i,t[1]))}function jn(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function zh(i,t){return Math.max(i[0].x,i[1].x)>=Math.min(t[0].x,t[1].x)&&Math.max(t[0].x,t[1].x)>=Math.min(i[0].x,i[1].x)&&Math.max(i[0].y,i[1].y)>=Math.min(t[0].y,t[1].y)&&jn(t[0],i[1],i[0])*jn(i[1],t[1],i[0])>0&&jn(i[0],t[1],t[0])*jn(t[1],i[1],t[0])>0?1:0}function _a(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>_a(i,t-1))}const Bh=`<style type="text/css">
|
|
116
116
|
.PanoRulerPlugin-rule-line {
|
|
117
117
|
position: absolute;
|
|
118
118
|
transform-origin: left center;
|
|
@@ -205,7 +205,7 @@ transition: all 500ms;
|
|
|
205
205
|
<div class="PanoRulerPlugin-rule-label-name">${e.options.distanceText(p)}</div>
|
|
206
206
|
</div>
|
|
207
207
|
</div>
|
|
208
|
-
`,y=document.createElement("div");return y.setAttribute("class","PanoRulerPlugin-rule"),y.setAttribute("data-name",A),y.setAttribute("style","display: none"),y.innerHTML=v,y},o=document.createElement("div");o.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;");const s=document.createElement("div");s.innerHTML=Bh,o.appendChild(s);const r={},a=(A,p)=>{if(e.loaded)throw new Error("\u6807\u5C3A\u88AB\u91CD\u590D\u521D\u59CB\u5316\uFF01");const v=Vh(A,i),y=i.work;if(!y)return!1;for(const w in p){const P=p[w],{standingPosition:k}=y.observers[0],C=P.map(({x:S,z:x,observers:Q})=>{const _=Q.length>0?A.rooms[A.observers[Q[0]]].name:"",R=v[_]?v[_].floor:null;let U=1/0,j={index:0,x:k.x,y:k.y,z:k.z};Q.forEach(N=>{if(!y.observers[N])return;const{standingPosition:ae}=y.observers[N],he={index:N,x:ae.x,y:ae.y,z:ae.z},ue=jh({x:S,z:x},he);R?ue<U&&Math.abs(he.y-R)<.3&&(U=ue,j=he):ue<U&&(U=ue,j=he)});const F=new V.Vector3(S,j.y,x);Object.assign(F,{observers:Q});const W=v[_]?v[_].roof:null,X=W?new V.Vector3(S,W,x):null;return X&&Object.assign(X,{observers:Q}),{origin:F,vertical:X}});r[w]={origins:C.map(S=>S.origin),rules:[]};for(const{origin:S,vertical:x}of C){if(!x)continue;const Q=n(w,S.distanceTo(x));o.append(Q),r[w].rules.push({vertical:!0,rule:[S,x],$element:Q})}for(let S=0;S<C.length;S++){let x=S+1;x>=C.length&&(x=0);const{origin:Q}=C[S],{origin:_}=C[x],R=n(w,Q.distanceTo(_));o.append(R),r[w].rules.push({vertical:!1,rule:[Q,_],$element:R})}}return e.loaded=!0,!0},l=(A,p,v)=>H(exports,null,function*(){const y=A||t.roomInfo,w=p||t.roomRules;if(!y||!w)throw new Error("\u6807\u5C3A\u6570\u636E\u4F9D\u8D56\u4E0D\u9F50\u5168\uFF01");return e.loaded=!1,e.options=O(O({},e.options),v||{}),i.model.loaded?a(y,w):yield new Promise(P=>i.once("modelLoaded",()=>P(a(y,w))))});t.roomInfo&&t.roomRules&&l(t.roomInfo,t.roomRules);const c=(A,p,v,y)=>{const w=[[{x:0,y:0},{x:v,y:0}],[{x:0,y:0},{x:0,y}],[{x:v,y:0},{x:v,y}],[{x:0,y},{x:v,y}]],P=[];for(let k=0;k<w.length;k++){const C=Na([A,p],[w[k][0],w[k][1]],!0);C&&P.push(C)}return P.length===0?!1:P},u=()=>{var Q;const A=(Q=i.getElement())==null?void 0:Q.parentElement;if(!A||!e.loaded||Object.keys(r).length<=0)return;const{panoIndex:p,camera:v,currentMode:y}=i;if(p===void 0)return;let w;for(const _ in r)_.split(",").indexOf(p.toString())>=0&&(w=_);if(!w){for(const _ in r)for(const{$element:R}of r[_].rules)R.style.display="none";return}const P=v.position,k=v.getWorldDirection(new V.Vector3),C=A.clientWidth,S=A.clientHeight;if(y!==Ce.Five.Mode.Panorama){for(const _ in r)for(const{$element:R}of r[_].rules)R.style.display="none";return}for(const _ in r)for(const{$element:R}of r[_].rules)R.style.display=_===w?"block":"none";const[x]=r[w].origins.slice().filter(_=>_.observers.indexOf(p)>=0).sort((_,R)=>{const U=_.clone().setY(0).sub(P).normalize().angleTo(k.clone().setY(0)),j=R.clone().setY(0).sub(P).normalize().angleTo(k.clone().setY(0));return U-j});for(const{rule:_,vertical:R,$element:U}of r[w].rules){const[j,F]=_,W=U.querySelector(".PanoRulerPlugin-rule-line");if(!W)return;if(!x){U.style.display="none";continue}if(j!==x&&F!==x){U.style.display="none";continue}if(j.distanceTo(F)<.3){U.style.display="none";continue}if(j.observers.indexOf(p)===-1||F.observers.indexOf(p)===-1){U.style.display="none";continue}if(j.clone().sub(P).normalize().angleTo(k)>Math.PI/2){U.style.display="none";continue}if(F.clone().sub(P).normalize().angleTo(k)>Math.PI/2){U.style.display="none";continue}const ee=j.distanceTo(F);if(F.clone().sub(F.clone().sub(j).divide(new V.Vector3(2,2,2))).distanceTo(P)/ee>8){U.style.display="none";continue}const he=j.clone().project(v),ue=(he.x+1)/2*C,pe=(-he.y+1)/2*S,Pe=F.clone().project(v),Le=(Pe.x+1)/2*C,ze=(-Pe.y+1)/2*S,le=Math.sqrt(Math.pow(Le-ue,2)+Math.pow(ze-pe,2));let ge=le,Ee=50;const de=c({x:~~ue,y:~~pe},{x:~~Le,y:~~ze},C,S);if(de&&de.length===1&&(x===j?(ge=Math.sqrt(Math.pow(de[0].x-ue,2)+Math.pow(de[0].y-pe,2)),Ee=ge/le*50):x===F&&(ge=Math.sqrt(Math.pow(de[0].x-Le,2)+Math.pow(de[0].y-ze,2)),Ee=100-ge/le*50)),de&&de.length===2){const te={x:(de[0].x+de[1].x)/2,y:(de[0].y+de[1].y)/2};Ee=Math.sqrt(Math.pow(te.x-ue,2)+Math.pow(te.y-pe,2))/le*100}const it=(Math.PI/2-Math.atan2(Le-ue,pe-ze))/Math.PI*180,ve=W.querySelector(".PanoRulerPlugin-rule-label"),Je=ve.children[0].clientWidth;Je>=le||Je/2>=Ee/100*le||Je/2>=(1-Ee/100)*le?W.style.display="none":(W.style.display="block",W.style.width=le+"px",W.style.left=ue+"px",W.style.top=pe+"px",W.style.transform=`rotate(${-it}deg)`,ve.style.left=`${Ee}%`)}},h=()=>_a(u),d=()=>{var A,p;return e.loaded?(e.enable||(o.setAttribute("class","PanoRulerPlugin"+(e.options.className?" "+e.options.className:"")),(p=(A=i.getElement())==null?void 0:A.parentElement)==null||p.append(o),u(),i.on("modeChange",u),i.on("cameraUpdate",h),e.enable=!0),!0):!1},f=()=>(e.enable&&(i.off("modeChange",u),i.off("cameraUpdate",h),o&&o.remove(),e.enable=!1),!0);function g(A){if(A.distanceText&&A.distanceText!==e.options.distanceText){const p=A.distanceText;e.options.distanceText=p,Object.values(r).forEach(v=>{v.rules.forEach(y=>{const[w,P]=y.rule,k=w.distanceTo(P),C=y.$element.querySelector(".PanoRulerPlugin-rule-label-name");!C||(C.innerText=p(k))})})}}return{enable:d,disable:f,load:l,state:e,changeConfigs:g}};function Oh(i){ce(i,"svelte-1h27ktp",".PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp{position:absolute;transform-origin:left 0.0625rem;width:0;height:0.125rem;pointer-events:none}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::after{content:'';position:absolute;left:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::before{content:'';position:absolute;right:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1.5s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp em.svelte-1h27ktp{display:block;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;box-shadow:0 0 0.25rem rgb(0 0 0 / 40%);position:relative}.rule-mixed-line.svelte-1h27ktp.svelte-1h27ktp{display:flex;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;align-items:center}.em-solid.svelte-1h27ktp.svelte-1h27ktp{height:100%;background:#ffffff}.em-dotted.svelte-1h27ktp.svelte-1h27ktp{height:0.125rem;background:var(--background-image);background-position:center;background-repeat:repeat}.PanoRulerPlugin-rule-label.svelte-1h27ktp.svelte-1h27ktp{position:absolute;width:0;height:0;top:0.0625rem;pointer-events:none}.PanoRulerPlugin-rule-label-name.svelte-1h27ktp.svelte-1h27ktp{position:absolute;padding:0.1875rem 0.375rem;background:rgba(195, 195, 195, 0.3);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem);border-radius:6.25rem;border:0.0625rem solid rgba(255, 255, 255, 0.6);white-space:nowrap;overflow:hidden;color:#ffffff;font-weight:500;font-size:0.75rem;line-height:1;animation:svelte-1h27ktp-viewport-rule-label 0.25s ease 1s;animation-fill-mode:both;box-shadow:inset 0 0 0.625rem 0 rgba(255, 255, 255, 0.3)}@keyframes svelte-1h27ktp-viewport-rule-line{0%{width:0%}100%{width:100%}}@keyframes svelte-1h27ktp-viewport-rule-label{0%{opacity:0;transform:scaleX(0)}100%{opacity:1;transform:translate(-50%, -50%) scaleX(1)}}@keyframes svelte-1h27ktp-viewport-rule-point{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}")}function As(i,t,e){const n=i.slice();return n[6]=t[e],n}function Rh(i){let t,e=i[0].children,n=[];for(let o=0;o<e.length;o+=1)n[o]=vs(As(i,e,o));return{c(){t=z("div");for(let o=0;o<n.length;o+=1)n[o].c();b(t,"class","rule-mixed-line svelte-1h27ktp")},m(o,s){T(o,t,s);for(let r=0;r<n.length;r+=1)n[r].m(t,null)},p(o,s){if(s&9){e=o[0].children;let r;for(r=0;r<e.length;r+=1){const a=As(o,e,r);n[r]?n[r].p(a,s):(n[r]=vs(a),n[r].c(),n[r].m(t,null))}for(;r<n.length;r+=1)n[r].d(1);n.length=e.length}},d(o){o&&M(t),at(n,o)}}}function Fh(i){let t,e;return{c(){t=z("em"),b(t,"class",e=Te(i[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),b(t,"style",i[3])},m(n,o){T(n,t,o)},p(n,o){o&1&&e!==(e=Te(n[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&b(t,"class",e),o&8&&b(t,"style",n[3])},d(n){n&&M(t)}}}function vs(i){let t,e,n=`${i[6].width}px`;return{c(){t=z("div"),b(t,"class",e=Te(i[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),b(t,"style",i[3]),L(t,"width",n)},m(o,s){T(o,t,s)},p(o,s){s&1&&e!==(e=Te(o[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&b(t,"class",e),s&8&&b(t,"style",o[3]),s&1&&n!==(n=`${o[6].width}px`)&&L(t,"width",n)},d(o){o&&M(t)}}}function Hh(i){let t,e,n,o,s=i[0].labelElement+"",r,a,l=`${i[0].labelOffset}%`,c=`${i[0].width}px`,u=`${i[0].left}px`,h=`${i[0].top}px`,d=`rotate(${i[0].rotateDeg}deg)`;function f(p,v){return p[0].children.length===0?Fh:Rh}let g=f(i),A=g(i);return{c(){t=z("div"),A.c(),e=$(),n=z("div"),o=z("div"),r=ke(s),b(o,"class","PanoRulerPlugin-rule-label-name svelte-1h27ktp"),xe(()=>i[4].call(o)),b(n,"class","PanoRulerPlugin-rule-label svelte-1h27ktp"),L(n,"left",l),b(t,"class","PanoRulerPlugin-rule-line svelte-1h27ktp"),L(t,"width",c),L(t,"left",u),L(t,"top",h),L(t,"transform",d),L(t,"display",i[0].visible&&i[2]?"block":"none")},m(p,v){T(p,t,v),A.m(t,null),B(t,e),B(t,n),B(n,o),B(o,r),a=tt(o,i[4].bind(o))},p(p,[v]){g===(g=f(p))&&A?A.p(p,v):(A.d(1),A=g(p),A&&(A.c(),A.m(t,e))),v&1&&s!==(s=p[0].labelElement+"")&&Me(r,s),v&1&&l!==(l=`${p[0].labelOffset}%`)&&L(n,"left",l),v&1&&c!==(c=`${p[0].width}px`)&&L(t,"width",c),v&1&&u!==(u=`${p[0].left}px`)&&L(t,"left",u),v&1&&h!==(h=`${p[0].top}px`)&&L(t,"top",h),v&1&&d!==(d=`rotate(${p[0].rotateDeg}deg)`)&&L(t,"transform",d),v&5&&L(t,"display",p[0].visible&&p[2]?"block":"none")},i:Y,o:Y,d(p){p&&M(t),A.d(),a()}}}function Gh(i,t,e){let n,{rulerItemProp:o}=t,s=!0,r,a="data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQiIHdpZHRoPSIxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PGZpbHRlciBpZD0icHJlZml4X19hIiBoZWlnaHQ9IjQwMCUiIHdpZHRoPSIxMzcuNCUiIHg9Ii0xOC43JSIgeT0iLTE1MCUiPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiBvcGVyYXRvcj0iZGlsYXRlIiByYWRpdXM9Ii41IiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSIvPjxmZU9mZnNldCBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSIvPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiByYWRpdXM9IjEiIHJlc3VsdD0ic2hhZG93SW5uZXIiLz48ZmVPZmZzZXQgaW49InNoYWRvd0lubmVyIiByZXN1bHQ9InNoYWRvd0lubmVyIi8+PGZlQ29tcG9zaXRlIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIGluMj0ic2hhZG93SW5uZXIiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIi8+PGZlR2F1c3NpYW5CbHVyIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSIgc3RkRGV2aWF0aW9uPSIuNSIvPjxmZUNvbG9yTWF0cml4IGluPSJzaGFkb3dCbHVyT3V0ZXIxIiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMiAwIi8+PC9maWx0ZXI+PHBhdGggaWQ9InByZWZpeF9fYiIgZD0iTS44ODkgMkgxMS41OCIvPjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1kYXNoYXJyYXk9IjUgNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48dXNlIGZpbGw9IiMwMDAiIGZpbHRlcj0idXJsKCNwcmVmaXhfX2EpIiB4bGluazpocmVmPSIjcHJlZml4X19iIi8+PHVzZSBzdHJva2U9IiNmZmYiIHN0cm9rZS1vcGFjaXR5PSIuNCIgeGxpbms6aHJlZj0iI3ByZWZpeF9fYiIvPjwvZz48L3N2Zz4=";function l(){r=this.offsetWidth,e(1,r)}return i.$$set=c=>{"rulerItemProp"in c&&e(0,o=c.rulerItemProp)},i.$$.update=()=>{i.$$.dirty&3&&(r>=o.width||r/2>=o.labelOffset/100*o.width||r/2>=(1-o.labelOffset/100)*o.width?e(2,s=!1):e(2,s=!0))},e(3,n=`--background-image: url(${a})`),[o,r,s,n,l]}class Wh extends oe{constructor(t){super(),ie(this,t,Gh,Hh,ne,{rulerItemProp:0},Oh)}}function bs(i,t,e){const n=i.slice();return n[12]=t[e],n}function ys(i){let t,e;return t=new Wh({props:{rulerItemProp:i[12]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.rulerItemProp=n[12]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Nh(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=ys(bs(i,n,r));const s=r=>D(o[r],1,1,()=>{o[r]=null});return{c(){t=z("div");for(let r=0;r<o.length;r+=1)o[r].c()},m(r,a){T(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&1){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=bs(r,n,l);o[l]?(o[l].p(c,a),E(o[l],1)):(o[l]=ys(c),o[l].c(),E(o[l],1),o[l].m(t,null))}for(se(),l=n.length;l<o.length;l+=1)s(l);re()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)E(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)D(o[a]);e=!1},d(r){r&&M(t),at(o,r)}}}function _h(i,t,e){var A,p,v,y;let{five:n}=t,{rulerDatas:o}=t,{options:s}=t,r=[];const a=((p=(A=n.getElement())==null?void 0:A.parentElement)==null?void 0:p.clientWidth)||0,l=((y=(v=n.getElement())==null?void 0:v.parentElement)==null?void 0:y.clientHeight)||0,c=(w,P)=>{const k=[[{x:0,y:0},{x:a,y:0}],[{x:0,y:0},{x:0,y:l}],[{x:a,y:0},{x:a,y:l}],[{x:0,y:l},{x:a,y:l}]],C=[];for(let S=0;S<k.length;S++){const x=Na([w,P],[k[S][0],k[S][1]],!0);x&&C.push(x)}return C.length===0?!1:C},u=(w,P)=>{const k=w.clone().project(n.camera),C=(k.x+1)/2*a,S=(-k.y+1)/2*l,x=P.clone().project(n.camera),Q=(x.x+1)/2*a,_=(-x.y+1)/2*l,R=Math.sqrt(Math.pow(Q-C,2)+Math.pow(_-S,2));return{startLeft:C,startTop:S,endLeft:Q,endTop:_,distance:R}},h=(w,P,k)=>{const C=n.camera.position,S=n.camera.getWorldDirection(new V.Vector3),x=w.clone().sub(C).normalize().angleTo(S),Q=P.clone().sub(C).normalize().angleTo(S),_=w.distanceTo(P),U=P.clone().sub(P.clone().sub(w).divide(new V.Vector3(2,2,2))).distanceTo(C),{startLeft:j,startTop:F,endLeft:W,endTop:X,distance:G}=u(w,P),N=-((Math.PI/2-Math.atan2(W-j,F-X))/Math.PI)*180;let ae=!0;k||(ae=!1),!et(w,k)&&!et(P,k)&&(ae=!1),_<.3&&(ae=!1),x>Math.PI/2&&(ae=!1),Q>Math.PI/2&&(ae=!1),U/_>8&&(ae=!1);let he=50,ue=G;const pe=c({x:~~j,y:~~F},{x:~~W,y:~~X});if(pe&&pe.length===1&&(et(w,k)?(ue=Math.sqrt(Math.pow(pe[0].x-j,2)+Math.pow(pe[0].y-F,2)),he=ue/G*50):et(P,k)&&(ue=Math.sqrt(Math.pow(pe[0].x-W,2)+Math.pow(pe[0].y-X,2)),he=100-ue/G*50)),pe&&pe.length===2){const Pe={x:(pe[0].x+pe[1].x)/2,y:(pe[0].y+pe[1].y)/2};he=Math.sqrt(Math.pow(Pe.x-j,2)+Math.pow(Pe.y-F,2))/G*100}return{startLeft:j,startTop:F,distance:G,deg:N,visible:ae,labelOffset:he,ruleLength:_}},d=()=>{const w=n.panoIndex,P=o.find(R=>R.panoIndex===w);if(!P)return e(0,r=[]);if(n.currentMode!==Ce.Five.Mode.Panorama)return e(0,r=[]);const k=n.camera.position,C=n.camera.getWorldDirection(new V.Vector3),S=P.lines.map(R=>new V.Vector3(R.start[0],-R.start[1],-R.start[2])),x=P.lines.map(R=>new V.Vector3(R.end[0],-R.end[1],-R.end[2])),[Q]=S.concat(x).sort((R,U)=>{const j=R.clone().setY(0).sub(k).normalize().angleTo(C.clone().setY(0)),F=U.clone().setY(0).sub(k).normalize().angleTo(C.clone().setY(0));return j-F}),_=P.lines.map(R=>{var ue,pe;const U=R.start,j=R.end,{startLeft:F,startTop:W,distance:X,deg:G,visible:ee,labelOffset:N,ruleLength:ae}=h(new V.Vector3(U[0],-U[1],-U[2]),new V.Vector3(j[0],-j[1],-j[2]),Q),he=[];return R.children&&((ue=R.children)==null?void 0:ue.length)>0&&((pe=R.children)==null||pe.forEach(Pe=>{const Le=Pe.start,ze=Pe.end,{distance:le}=u(new V.Vector3(Le[0],-Le[1],-Le[2]),new V.Vector3(ze[0],-ze[1],-ze[2]));he.push({width:le,state:Pe.state})})),{width:X,left:F,top:W,rotateDeg:G,state:R.state,children:he,labelOffset:N,visible:ee,labelElement:s.distanceText(ae)}});e(0,r=_)},f=()=>di(d),g=fo(d,80);return Ue(()=>{d(),n.on("panoArrived",d),n.on("modeChange",d),n.on("cameraDirectionUpdate",f),n.on("movingToPano",f),n.on("mouseWheel",()=>g()),n.on("pinchGesture",()=>g())}),Pt(()=>{n.off("panoArrived",d),n.off("modeChange",d),n.off("cameraDirectionUpdate",f),n.off("movingToPano",f),n.off("mouseWheel",()=>g()),n.off("pinchGesture",()=>g())}),i.$$set=w=>{"five"in w&&e(1,n=w.five),"rulerDatas"in w&&e(2,o=w.rulerDatas),"options"in w&&e(3,s=w.options)},[r,n,o,s]}class Xh extends oe{constructor(t){super(),ie(this,t,_h,Nh,ne,{five:1,rulerDatas:2,options:3})}}class Yh{constructor(t,e){m(this,"five");m(this,"container",document.createElement("div"));m(this,"panoRulerProData");m(this,"rulerItems");m(this,"state",{enabled:!1,loaded:!1,options:{className:"",distanceText:t=>`${t.toFixed(1)}m`}});var n,o;this.five=t,this.container.classList.add("panoRulerProPlugin-container"),this.container.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;"),e&&(e.data&&this.load(e.data),this.state.options=O(O({},this.state.options),e.options||{}),(n=e.options)!=null&&n.className&&this.container.classList.add((o=e.options)==null?void 0:o.className)),this.five.once("modelLoaded",()=>H(this,null,function*(){var s,r;(r=(s=this.five.getElement())==null?void 0:s.parentNode)==null||r.append(this.container)})),this.five.once("dispose",()=>this.dispose())}load(t){return H(this,null,function*(){if(!this.five.work)return;const e=t.data;if(!e)throw new Error("\u6807\u5C3A\u6570\u636E\u4F9D\u8D56\u4E0D\u9F50\u5168\uFF01");this.panoRulerProData=e,this.state.loaded=!0})}enable(){return this.state.loaded?(this.state.enabled||(this.state.enabled=!0,this.render()),!0):!1}disable(){return this.state.enabled&&(this.state.enabled=!1,this.render()),!0}render(){return H(this,null,function*(){var t;if(this.state.enabled){if(!this.panoRulerProData||!this.container)return;this.rulerItems=new Xh({target:this.container,props:{five:this.five,rulerDatas:this.panoRulerProData,options:this.state.options}})}else(t=this.rulerItems)==null||t.$destroy(),this.rulerItems=void 0})}dispose(){this.container&&(this.rulerItems.$destroy(),this.rulerItems=void 0),this.container.remove()}}const Uh=(i,t)=>new Yh(i,t),qh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZIAAABCCAYAAAB9y1BhAAAAAXNSR0IArs4c6QAADh5JREFUeAHtnVuPLDcVhedwC/dACKAICDxEIBQpygNI/Ab+MX8B8YCQEAjxgBAQLsm5Jjkn58r6Sl4jT52qnu4zXd121dqSx67q7ip7eXsv721XzcVFJAgEgSAQBIJAEAgCQeC4CLx48eKbSu+RH/fKuVoQWB8Cn1tfk9KiIHAUBH6tq/xKiTwSBILADgRCJDvAyUebRuAbpfXxSDatBmn8Pgh8YZ8v5TtBYIMIvFCbSZEgEASuQSBEcg1A+XizCDzfbMvT8CBwIAIhkgMBy9c3g0CIZDNdnYbeFIEQyU0RzO/XikCIZK09m3YdHYEQydEhzQVXgkCIZCUdmWYsj0CIZHmMc4c+EchCe5/9llqfAYEQyRlAzy27QCAeSRfdlEq2gECIpIVeSB1aRAAiudVixVKnINAaAiGS1nok9WkFAUJb8Upa6Y3Uo2kEQiRNd08qd0YEQiJnBD+37guBEElf/ZXang6BEMnpsM6dOkcgRNJ5B66x+nrjLmsTX1J6bSJHZ7+o9HklynWaOse1eKcc+XVlvxYFEnlfaThWfb7mcsn5nPRM6WmVU55KfO+J0mdKj8f5rVu3skNMoET6RSBE0m/fdVNzGWII4StKXy65y18t58aEAVGcUjDkGHsLhIOYfCC1xUT4QDJjgnmkc58qkT8saSiLeCCkSBBoBoEQSTNd0V9FZADRH8iAG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8bhou9iUbbs0/jMNTscBdRgJAm0hIF1+wzWSrt52OXkQOCUC0kNsNNuHsatz24iHqI709GxLAjcmktJQEwj5WPA+aCiuWB4YHKOT4yYRkF7zUNkg0lueSI4EgbMiIJ1kZyshL9LUOjNEwkT9sXT2pBP1VyaSQiCse9Coqa27LApBIPE+BEKkLwSk32zRHESDkp0zkSDQBALF9uKdYHunnkthwo7tfXQqQjmYSNQImBACIU2xIuGreB8CIdIvAtJzNogMosHI4mYkCDSHgPTUXspU2ItoEIvzEArlxWRvIlGFWTSnsnWF+b1dKAhk8QrrHpEgsDgC0ndi0oNoEBIuiASBZhGQvnqCz/KCJ/jYZtto7DPRoUU2N11LJIXxqNyUC0VFqeCTpRlP94gEgZMhIL0nbDCIdJswQSQINI9AIRRsNRP+KfvOkgNrKEddr5660YUqw3k8EAhkbvsuCztPVSF7JDqMBIF1IKAxcOl5S8eZLEWCQDcIFBtO2Kv2UOr645lAKkex4VeIpLo5jHbls1KD4eYaWIu4R+UeyYLA2RHQWGAADiJ9P9u2StcheRB4VQSkyzgD2PQppwBH4MaEMpBFRSDcqCYQx9ggDphr0QUb3SMSBJpAQGPiciei9P6oYYAmGphKbA4B6TRrJ+j1HKHYzh8cZbpVBowXZ8bgQhzPNJAOvvD4QjkOAj0hUAbdUOVMoHrqudT1OgSk2zgLkAl2n/LYvh9s900kutYV4UIvQiBXMMlBEAgCQWA1CBRCgUjmHAkI5vk+PACR1BcZmGmfH64GzTQkCASBILBhBAqhgEC9rDFGJI7FGJEcB4EgEASCQBAIAkEgCASBIBAEgkAQCAJBIAgEgSAQBIJAEAgCm0fg/x4jQQWGalpFAAAAAElFTkSuQmCC";function Jh(){const i=document.createElement("div"),t=document.createElement("i"),e=document.createElement("span");return i.appendChild(t),i.appendChild(e),i.style.position="relative",i.style.width="100%",i.style.display="flex",i.style.flexDirection="column",i.style.alignItems="center",i.style.marginTop=`${150/16}rem`,i.style.opacity="0",i.style.transition="opacity 1000ms linear",t.style.display="block",t.style.width=`${134/16}rem`,t.style.height=`${22/16}rem`,t.style.backgroundSize="100%",t.style.backgroundRepeat="no-repeat",t.style.backgroundImage=`url(${qh})`,e.style.marginTop=`${10/16}rem`,e.style.fontSize=`${16/16}rem`,e.style.color="#fff",e.style.opacity="0.7",e.style.textShadow="0 2px 16px rgb(22 34 83 / 24%)",e.style.fontWeight="bold",{appendTo(n){n.appendChild(i)},dispose(){i.remove()},setRoom(n){e.innerHTML=n.name+" "+Math.floor(n.size/1e6)+"\u33A1"},show(){i.style.opacity="1"},hide(){i.style.opacity="0"}}}const Zh=new I.TextureLoader;function ws(i){return H(this,null,function*(){return new Promise((t,e)=>{Zh.load(i,t,void 0,e)}).then(t=>(t.encoding=I.sRGBEncoding,t))})}const Vn={userAction:!0};class Kh extends zt{constructor(e,n){super(e);m(this,"state",{visible:!0,enabled:!0,config:{compassImageUrl:"//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png",entryDoorImageUrl:"//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png"}});m(this,"data");m(this,"group",new I.Group);m(this,"roomInfoInstance");m(this,"roomInfoWrapperInstance");m(this,"compassMeshTween");m(this,"compassMesh");m(this,"entryDoorMesh");m(this,"dispose",()=>{var e,n,o,s;this.five.scene.remove(this.group),this.group.remove(...this.group.children),(n=(e=this.compassMesh)==null?void 0:e.material.map)==null||n.dispose(),(s=(o=this.entryDoorMesh)==null?void 0:o.material.map)==null||s.dispose(),this.five.off("dispose",this.dispose),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});m(this,"_addEventListener",()=>{this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive),this.five.on("modeChange",this.onFiveModeChange),this.five.on("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});m(this,"_removeEventListener",()=>{this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("modeChange",this.onFiveModeChange),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});m(this,"_enable",()=>{this.five.scene.add(this.group),this.init(),this.onFivePanoArrived(this.five.panoIndex||0),this._addEventListener()});m(this,"_disable",()=>{this._clearCompassIfNeed(),this._clearEntryDoorIfNeed(),this.five.scene.remove(this.group),this._removeEventListener()});m(this,"_toggleVisible",()=>{this.group.visible=this.state.visible,this.five.needsRender=!0});m(this,"_clearCompassIfNeed",()=>{var e;this.compassMesh&&(this.group.remove(this.compassMesh),(e=this.compassMesh.material.map)==null||e.dispose(),this.compassMesh=null)});m(this,"_clearEntryDoorIfNeed",()=>{var e;this.entryDoorMesh&&(this.group.remove(this.entryDoorMesh),(e=this.entryDoorMesh.material.map)==null||e.dispose(),this.entryDoorMesh=null),this.roomInfoInstance&&(this.roomInfoInstance.dispose(),this.roomInfoInstance=null),this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.dispose(),this.roomInfoWrapperInstance=null)});m(this,"onFivePanoWillArrive",e=>{var n,o;e!==this.five.panoIndex&&((n=this.compassMeshTween)==null||n.dispose(),(o=this.compassMesh)==null||o.material.setValues({opacity:0}))});m(this,"onFivePanoArrived",e=>{var o,s,r,a,l,c,u;const n=(r=(s=(o=this.five.work)==null?void 0:o.observers)==null?void 0:s[e])==null?void 0:r.standingPosition;if(this.compassMesh&&(this.compassMesh.position.copy(n.clone().setY(n.y+.01)),this.compassMesh.material.opacity===0&&((a=this.compassMeshTween)==null||a.dispose(),this.compassMeshTween=Ha(1e3).onUpdate(({progress:h})=>{var d;(d=this.compassMesh)==null||d.material.setValues({opacity:h}),this.five.needsRender=!0}).play())),this.entryDoorMesh){const d=new I.Vector3(this.data.entrance.position.x,this.data.entrance.position.y,this.data.entrance.position.z).clone().setY(n.y).sub(n).normalize(),f=n.clone().add(d.clone().multiplyScalar(.7)).setY(n.y+.01);this.entryDoorMesh.rotation.z=new I.Vector3(0,0,-1).angleTo(d),this.entryDoorMesh.position.copy(f),((l=this.data)==null?void 0:l.room_observers[e].room.type)===1?(c=this.entryDoorMesh)==null||c.material.setValues({opacity:1}):(u=this.entryDoorMesh)==null||u.material.setValues({opacity:0})}this.roomInfoInstance&&this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.css3DObject.position.copy(n.clone().setY(n.y+.01)),this.roomInfoInstance.setRoom(this.data.room_observers[e].room)),this.five.needsRender=!0});m(this,"onFiveCameraDirectionUpdate",({longitude:e,latitude:n})=>{var o,s;!this.roomInfoWrapperInstance||(this.roomInfoWrapperInstance.css3DObject.rotation.z=e,n>.66&&this.five.getCurrentState().mode==="Panorama"?(o=this.roomInfoInstance)==null||o.show():(s=this.roomInfoInstance)==null||s.hide())});m(this,"onFiveModeChange",(e,n,o,s,r)=>{e!==n&&this.setState({visible:e===Ce.Five.Mode.Panorama},{userAction:r})});this.five.scene.add(this.group),this.five.once("dispose",this.dispose),this.setState({visible:!0,enabled:!0,config:O(O({},this.state.config),n||{})})}enable(e=Vn){this.setState({enabled:!0},e)}disable(e=Vn){this.setState({enabled:!1},e)}show(e=Vn){if(!!this.state.enabled)return this.setState({visible:!0},e),Promise.resolve()}hide(e=Vn){if(!!this.state.enabled)return this.setState({visible:!1},e),Promise.resolve()}setState(e,n={userAction:!0}){var s,r;const o=JSON.parse(JSON.stringify(this.state));this.state={visible:(s=e.visible)!=null?s:o.visible,enabled:(r=e.enabled)!=null?r:o.enabled,config:O(O({},o.config),e.config||{})},this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n.userAction}),e.enabled===!0&&(this._enable(),this.hooks.emit("enable",n)),e.enabled===!1&&(this._disable(),this.hooks.emit("disable",n)),e.visible===!1&&(this._toggleVisible(),this.hooks.emit("hide",n)),e.visible===!0&&(this._toggleVisible(),this.hooks.emit("show",n)),e.config&&this.init()}load(e,n,o=!0){return H(this,null,function*(){const s=yield this.formatData(e);JSON.stringify(this.data)!==JSON.stringify(s)&&(this.hooks.emit("dataChange",s,this.data),this.data=O({},s),this.init(),n&&this.setState(n,{userAction:o}),this.hooks.emit("dataLoaded",this.data))})}formatData(e){return e.version&&e.data?Promise.resolve(e.data):Promise.resolve(e)}init(){return H(this,null,function*(){var o,s,r,a;const e=(s=(o=this.data)==null?void 0:o.north_rad)!=null?s:null;this._clearCompassIfNeed(),e!==null&&(this.compassMesh=yield this.loadCompassMesh(),this.compassMesh.rotateX(-Math.PI/2),this.compassMesh.rotateZ(e-Math.PI/2),this.group.add(this.compassMesh));const n=(a=(r=this.data)==null?void 0:r.entrance)!=null?a:null;this._clearEntryDoorIfNeed(),n!==null&&(this.entryDoorMesh=yield this.loadEntryDoorMesh(),this.roomInfoWrapperInstance=this.loadRoomInfo(),this.roomInfoInstance=Jh(),this.entryDoorMesh.rotateX(-Math.PI/2),this.roomInfoWrapperInstance&&this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container),this.group.add(this.entryDoorMesh)),this.onFivePanoArrived(this.five.panoIndex||0),this.five.needsRender=!0})}loadCompassMesh(){return H(this,null,function*(){const e=this.state.config.compassImageUrl,n=yield ws(e),o=new I.CircleGeometry(.7,32),s=new I.MeshBasicMaterial({map:n,transparent:!0,opacity:0,depthTest:!1}),r=new I.Mesh(o,s);return r.name="pano-compass-mesh",r})}loadEntryDoorMesh(){return H(this,null,function*(){const e=this.state.config.entryDoorImageUrl,n=yield ws(e),o=new I.PlaneGeometry(.2,.16),s=new I.MeshBasicMaterial({map:n,transparent:!0,opacity:.8,depthTest:!1}),r=new I.Mesh(o,s);return r.name="pano-compass-entry-door",r})}loadRoomInfo(){const e=[new I.Vector3(-.7,0,-.7),new I.Vector3(.7,0,-.7),new I.Vector3(.7,0,.7),new I.Vector3(-.7,0,.7)];return Jt(this.five).create3DDomContainer(e)}}const $h=(i,t)=>new Kh(i,t);function Qn(i,t,e){const n=i[t],o=i[e];n===void 0||o===void 0||(i[t]=o,i[e]=n)}function ef(i,t,e){const n=e/2;for(let o=1;o<=n;o++){const s=e-(o-1);for(let r=1;r<=t;r++){const a=(o-1)*t+r-1,l=(s-1)*t+r-1;Qn(i,a*4+0,l*4+0),Qn(i,a*4+1,l*4+1),Qn(i,a*4+2,l*4+2),Qn(i,a*4+3,l*4+3)}}}class Xa{constructor(t,e){m(this,"width");m(this,"height");m(this,"containerDom");m(this,"hooks",new Ce.Subscribe);m(this,"canvas",document.createElement("canvas"));m(this,"five");m(this,"scale");m(this,"config");m(this,"offset",{x:0,y:0});m(this,"context");m(this,"renderCenter",new I.Vector3);m(this,"hammer");m(this,"state",{enabled:!1});m(this,"offsetRange");m(this,"isPanning",!1);m(this,"onPanstart",()=>{this.isPanning=!0,this.canvas.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)"});m(this,"onPan",t=>{if(!this.isPanning||!this.offsetRange||this.hooks.emit("wantsPanGesture",t))return;const{translateX:n,translateY:o}=this.getPanOffset(t,this.offsetRange);this.canvas.style.transform=`translate3d(${n}px, ${o}px, 100px)`});m(this,"onPanend",t=>{if(this.isPanning=!1,this.canvas.style.boxShadow="none",!this.offsetRange)return;const{translateX:e,translateY:n}=this.getPanOffset(t,this.offsetRange);this.canvas.style.transform=`translate3d(${e}px, ${n}px, 100px)`,this.offset={x:e,y:n}});var o,s,r;if(!t.renderer)throw new Error("Five Render \u672A\u521D\u59CB\u5316");this.five=t,this.scale=(o=e==null?void 0:e.scale)!=null?o:2,this.width=(s=e==null?void 0:e.width)!=null?s:190,this.height=(r=e==null?void 0:e.height)!=null?r:190,this.config={dragEnabled:(e==null?void 0:e.dragEnabled)||!1,autoFixPCPosition:(e==null?void 0:e.autoFixPCPosition)||!1,initialPosition:(e==null?void 0:e.initialPosition)||{left:"0",top:"0"}};const n=this.canvas.getContext("2d");if(!n)throw new Error("CANNOT CREATE CONTEXT2D");this.context=n,this.config.dragEnabled&&(this.hammer=new yn.default(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panstart",this.onPanstart),this.hammer.on("panend",this.onPanend)),this.initStyle()}dispose(){var t;this.clear(),this.disable(),(t=this.hammer)==null||t.destroy()}enable(){if(!this.state.enabled)return this.state.enabled=!0,this.containerDom&&this._appendTo(this.containerDom),this}disable(){if(!!this.state.enabled)return this.state.enabled=!1,this.canvas.remove(),this}appendTo(t){return this.containerDom=t,this.state.enabled&&this._appendTo(t),this}clear(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this}renderWithPoint(t){!this.containerDom||!this.state.enabled||(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}renderWithScreenPoint(t){!this.containerDom||!this.state.enabled||(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}resetOffset(){this.offset={x:0,y:0},this.canvas.style.transform=`translate3d(${0}px, ${0}px, 100px)`}getCurrentState(){return{enabled:this.state.enabled}}getRenderCenter(){return this.renderCenter}_appendTo(t){if(this.resetOffset(),t.appendChild(this.canvas),!this.offsetRange){const e=this.canvas.getBoundingClientRect(),n=t.getBoundingClientRect(),o=n.right-e.right,s=n.bottom-e.bottom,r=n.left-e.left,a=n.top-e.top;this.offsetRange={min:{x:r,y:a},max:{x:o,y:s}}}}autoFixPCPosition(){if(!this.containerDom)return;const{width:t,height:e}=this,[n,o,s]=(()=>{if(this.renderCenter instanceof I.Vector3){const r=this.renderCenter.clone().project(this.five.camera);return[(r.x+1)/2*this.containerDom.clientWidth,-(r.x-1)/2*this.containerDom.clientWidth,-(r.y-1)/2*this.containerDom.clientHeight]}else return[this.renderCenter.x,this.containerDom.clientWidth-this.renderCenter.x,this.renderCenter.y]})();n<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=90+"px"):s<183?(this.canvas.style.top=90+"px",this.canvas.style.left=-t/2+"px"):o<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=-t-90+"px"):(this.canvas.style.left=-t/2+"px",this.canvas.style.top=-e-90+"px"),this.canvas.style.transform=`translate3d(${n}px, ${s}px, 10px)`,this.offset={x:n,y:s}}render(){if(!this.five.renderer||!this.containerDom)return;const{scale:t,context:e,width:n,height:o}=this,s=this.five.renderer.getSize(new I.Vector2),[r,a]=(()=>{if(this.renderCenter instanceof I.Vector3){const p=this.renderCenter.clone().project(this.five.camera);return[(p.x+1)/2*s.x,(p.y+1)/2*s.y]}else return[this.renderCenter.x,s.y-this.renderCenter.y]})(),l=1,c=n/t,u=o/t,h=l*t,d=this.five.getPixels(r-c/2,a-c/2,c,u,h),f=Math.floor(n*l),g=Math.floor(o*l);ef(d,f,g);const A=new ImageData(f,g);A.data.set(d),e.putImageData(A,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}getPanOffset(t,e){const{min:{x:n,y:o},max:{x:s,y:r}}=e,a=this.offset.x+t.deltaX,l=this.offset.y+t.deltaY,c=Math.min(Math.max(a,n),s),u=Math.min(Math.max(l,o),r);return{translateX:c,translateY:u}}}class tf{constructor(t){m(this,"edges",[]);m(this,"five");m(this,"onModelLoaded",()=>{!this.five.model||(this.edges=this.five.model.getEdges())});this.five=t,this.five.model.loaded?this.onModelLoaded():this.five.on("modelLoaded",this.onModelLoaded)}dispose(){}getAdsorbentPoint(t){if(this.edges.length===0)return null;let e=1/0,n;return this.edges.forEach(o=>{const s=o.closestPointToPoint(t.point,!0,new V.Vector3),r=s.distanceTo(t.point);r<e&&(n=s,e=r)}),e>.1?null:n||null}}function nf(i,t){for(let e=0,n=t.length;e<n;e++)if(i===t[e])return t.splice(e,1)[0]}class Ye{constructor(t){m(this,"id");m(this,"lines");m(this,"position");m(this,"type","point");this.id=Ge(),this.lines=[],this.position=new V.Vector3,t instanceof V.Vector3?this.position.copy(t):this.position.fromArray(t)}toJson(){return{id:this.id,position:this.position.toArray()}}addLine(t){this.lines.push(t)}removeLine(t){nf(t,this.lines)}clone(){return new Ye(this.position)}}class hi{constructor(t){m(this,"id",Ge());m(this,"lines",[]);m(this,"points",[]);m(this,"visiblePanoIndexes");m(this,"model");m(this,"type","polyline");m(this,"hook",new Ce.Subscribe);this.model=t.model}addLine(t){if(this.includes(t)){console.error(new Error("\u4E0D\u80FD\u91CD\u590D\u6DFB\u52A0\u7EBF\u6BB5"));return}const e=this.getLastPoint(),n=e&&t.findAnotherPoint(e);e?e&&n?(this.lines.push(t),this.points.push(...t.points),this.hook.emit("lineAdded",t)):console.error(new Error("\u4F20\u5165\u7EBF\u6BB5\u65E0\u6CD5\u4E0E\u5F53\u524D\u6298\u7EBF\u8FDB\u884C\u8FDE\u63A5")):(this.lines.push(t),this.points.push(...t.points),this.hook.emit("lineAdded",t))}removeLine(t){if(this.lines.length!==0){if(!this.isLastLine(t)){console.error(new Error("\u4F20\u5165\u7EBF\u6BB5\u4E0D\u662F\u5F53\u524D\u6298\u7EBF\u7684\u6700\u540E\u4E00\u6BB5"));return}this.lines.pop(),this.lines.length===0?this.points.slice(0,this.points.length):this.points.pop(),this.hook.emit("lineRemoved",t)}}isLastLine(t){const e=this.getLastLine();return e?t.id===e.id:!1}getLastLine(){return this.lines.slice(-1)[0]}clear(){this.lines.slice(0,this.lines.length),this.points.slice(0,this.points.length)}overlapWith(t){return t.type==="point"?this.includes(t):t.type==="line"?t.points.some(e=>this.includes(e)):t.type==="polyline"?t.points.some(e=>this.includes(e)):!0}includes(t){return t.type==="point"?this.points.find(({id:e})=>e===t.id)!==void 0:t.type==="line"?this.lines.find(({id:e})=>e===t.id)!==void 0:!1}isEmpty(){return this.points.length===0}getLastPoint(){return this.points.slice(-1)[0]}toJson(){return{id:this.id,lines:this.lines.map(t=>t.toJson()),visiblePanoIndexes:this.visiblePanoIndexes}}getPointByID(t){return this.points.find(({id:e})=>e===t)}fromJson(t){this.clear(),this.id=t.id;const{getPoint:e,getAllPoints:n}=r(),o=t.lines.map(a=>{const[l,c]=a.points,u=e(l),h=e(c);if(!u||!h)throw new Error("\u7EBF\u4E0A\u7684\u70B9\u4E0D\u5B58\u5728");const d=new Bt(u,h,this.model);return d.id=a.id,d.text=a.text,d}),s=n();this.points.push(...s),this.lines.push(...o),this.visiblePanoIndexes=t.visiblePanoIndexes;function r(){const a=new Map;function l(u){const h=a.get(u.id);if(h)return h;const d=new Ye(u.position);return d.id=u.id,a.set(u.id,d),d}function c(){return Array.from(a.values())}return{getPoint:l,getAllPoints:c}}return this}replace(t){this.id=t.id,this.clear(),this.lines.push(...t.lines),this.points.push(...t.points)}}const of=1,sf=3,rf=new V.Color(16777215),af=new V.Color(6522623),lf=new V.Color(16777215),cf=new V.Color(6522623),uf=6,df=8,hf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==",Ya=new V.TextureLoader().load(hf),Ua={pointTexture:Ya,pointSize:uf,lineWidth:of,lineColor:rf,pointColor:lf,lineRenderOrder:20,pointsRenderOrder:20};me(O({},Ua),{dashed:!0});const ff={pointTexture:Ya,pointSize:df,lineWidth:sf,lineColor:af,pointColor:cf,lineRenderOrder:10,pointsRenderOrder:10};function mf(i,t,e){var u,h,d,f,g;const n=(u=e==null?void 0:e.lineWidth)!=null?u:2,o=(h=e==null?void 0:e.lineColor)!=null?h:new V.Color(16777215),s=(d=e==null?void 0:e.pointSize)!=null?d:5,r=(f=e==null?void 0:e.lineRenderOrder)!=null?f:10,a=(g=e==null?void 0:e.lineRenderOrder)!=null?g:20,l=new la.Line(i,t);l.setMaterial({linewidth:n,color:o}),l.line.material.depthTest=!1,l.line.material.transparent=!0,l.line.renderOrder=r,l.points.renderOrder=a;const c=l.points.material;return c.depthTest=!1,c.size=s,e!=null&&e.pointColor&&c.color.set(e.pointColor).convertSRGBToLinear(),e!=null&&e.pointTexture&&(c.map=e.pointTexture),l}function Cs(i,t){const[e,n]=i.points,o=t==="light"?ff:Ua,s=mf(e.position,n.position,o);return s.name="normalLine_"+i.id,s}function bn(i){const{x:t,y:e,z:n}=i;return!(Math.abs(t)>1||Math.abs(e)>1||Math.abs(n)>1)}function Di(i){const{z:t}=i;return!(Math.abs(t)>1)}function pf(){const i=document.createElement("div");return i.setAttribute("style","backdrop-filter: blur(4px);-webkit-backdrop-filter: blur(4px);-webkit-tap-highlight-color: rgba(0,0,0,0);"),i.style.width="max-content",i.style.padding="3px 6px",i.style.lineHeight="1",i.style.textAlign="center",i.style.transform="translate(-50%, -50%)",i.style.borderRadius="100px",i.style.fontSize="14px",i.style.color="#fff",i.style.background="rgba(195,195,195,0.70)",i.style.border="0.5px solid rgba(255,255,255,0.6)",i.style.cursor="pointer",i}function gf(i){const t=document.createElement("div");return t.id="distance_"+i.id,t.classList.add("five-plugin-measure__distance"),t.style.opacity="0",t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.width="0",t.style.height="0",t.style.transform="translate3d(0, 0, 0)",t.style.transformOrigin="left top",t}function Af(i){let t=!0;const{line:e}=i,n=e.id,o=pf(),s=gf(e),r=i.userDistanceItem,a=new V.Vector3(0,0,0),l={lineID:n,ndcPosition:a,update:d,appendTo:f,remove:g,highlight:u,unHighlight:h,getCurrentContent:A,setItemSelectable:p};s.style.pointerEvents=t?"all":"none",r!=null&&r.element?s.appendChild(r.element):s.appendChild(o);function c(){var v;(v=i.clickCallback)==null||v.call(i,l)}function u(){if(r)return r.highlight();o.style.border="0.5px solid #95AEFF",o.style.background="linear-gradient(90deg, #95AEFF 0%, #6386FF 100%)"}function h(){if(r)return r.unHighlight();o.style.border="0.5px solid rgba(255,255,255,0.6)",o.style.background="rgba(195,195,195,0.70)"}function d(v){if(e.mesh.visible===!1){s.style.opacity="0",s.style.pointerEvents="none";return}const y=v.getElement();if(!y)return;const w=y.clientWidth,P=y.clientHeight,k=w/2,C=P/2;if(e.points.length<2)return;const[S,x]=e.points,Q=S.position.clone().project(v.camera),_=x.position.clone().project(v.camera),R=Q.clone().lerp(_,.5),U=new V.Vector2(Q.x*k,Q.y*C),j=new V.Vector2(_.x*k,_.y*C),F=U.distanceTo(j);if((()=>!(Math.abs(Q.z)>1||Math.abs(_.z)>1||!Di(Q)&&!Di(_)||!Di(R)||F===0))()===!1){s.style.opacity="0",s.style.pointerEvents="none";return}const X=(R.x+1)/2*w,G=-(R.y-1)/2*P,N=-(Math.atan((U.y-j.y)/(U.x-j.x))*180)/Math.PI,ae=s.parentElement&&o.clientWidth>F?-20:0;s.style.transform=`translate(${X}px, ${G}px) rotate(${N}deg) translateY(${ae}px)`,s.style.opacity="1",s.style.pointerEvents=t?"all":"none",r&&r.update({line:e,polyline:e.getPolyline()});const he=A();o.innerText=he}function f(v){v.appendChild(s),s.addEventListener("click",c)}function g(){o.removeEventListener("click",c),s.remove()}function A(){var S,x,Q;if(e.points.length<2)return"";const[v,y]=e.points,w=v.position.clone().distanceTo(y.position),P=(S=i.line.text)!=null?S:i.line.model.config.defaultText,k=(Q=(x=i.line.model.config)==null?void 0:x.getDistanceText)==null?void 0:Q.call(x,w),C=P!=null?P:k;return C!=null?C:w.toFixed(2)+"m"}function p(v){t=v}return l}class Bt{constructor(t,e,n){m(this,"id");m(this,"selected",!1);m(this,"text");m(this,"type","line");m(this,"model");m(this,"mesh");m(this,"points");m(this,"lightMesh");m(this,"hook");m(this,"distanceItem");m(this,"polyline");var o;if(this.id=Ge(),this.model=n,t.id===e.id)throw new Error("\u65E0\u6548\u7684\u7EBF\u6BB5, \u4E00\u4E2A\u70B9\u65E0\u6CD5\u6784\u6210\u7EBF\u6BB5");typeof n.config.defaultText=="string"&&(this.text=n.config.defaultText),this.hook=new Ce.Subscribe,this.points=[t,e],this.mesh=Cs(this,"normal"),this.lightMesh=Cs(this,"light"),this.distanceItem=Af({line:this,clickCallback:()=>this.hook.emit("selected",this),userDistanceItem:(o=this.model.config)!=null&&o.userDistanceItemCreator?this.model.config.userDistanceItemCreator():void 0}),t.lines.push(this),e.lines.push(this)}clear(){this.selected=!1,this.polyline=void 0}isEmpty(){return this.points.length===0}getPolyline(){if(this.polyline)return this.polyline;const t=this.model.polylines.find(e=>e.lines.includes(this));if(t)return this.polyline=t,t}findAnotherPoint(t){return this.points.find(({id:e})=>e!==t.id)}setText(t){this.text=t,this.hook.emit("textChanged",t)}toJson(){return{id:this.id,points:this.points.map(t=>t.toJson()),text:this.text}}clone(){const t=new Bt(this.points[0].clone(),this.points[1].clone(),this.model);return t.text=this.text,t}}class fi{constructor(t){m(this,"config");m(this,"polylines",[]);m(this,"hook",new Ce.Subscribe);this.config=t}addPolyline(t){if(this.includes(t)){console.error(new Error("\u4E0D\u80FD\u91CD\u590D\u6DFB\u52A0 polyline"));return}this.polylines.push(t),this.hook.emit("polylineAdded",t)}replacePolylineByID(t,e){const n=this.getPolylineByID(t);n==null||n.replace(e)}removePolyline(t){const e=this.polylines.findIndex(({id:n})=>n===t.id);if(e===-1){console.error(new Error("polyline \u4E0D\u5B58\u5728"));return}this.polylines.splice(e,1),this.hook.emit("polylineRemoved",t)}getPolylineByID(t){return this.polylines.find(e=>e.id===t)}getPolylineByLine(t){return this.polylines.find(e=>e.includes(t))}getLineByID(t){return this.getAllLines().find(e=>e.id===t)}getAllLines(){return this.polylines.map(t=>t.lines).flat(1)}getAllPoints(){return this.polylines.map(t=>t.points).flat(1)}includes(t){return this.polylines.find(({id:e})=>e===t.id)!==void 0}clear(){this.polylines.forEach(t=>this.hook.emit("polylineRemoved",t)),this.polylines.splice(0,this.polylines.length)}getClosestPoint(){}parse(t){this.clear(),this.polylines.push(...t.polylines.map(e=>new hi({model:this}).fromJson(e))),this.polylines.forEach(e=>this.hook.emit("polylineAdded",e))}toJson(){return{polylines:this.polylines.map(t=>t.toJson()).filter(t=>t.lines.length>0)}}}const On=i=>i.preventDefault();class mi{constructor(t){m(this,"model");m(this,"five");m(this,"group");m(this,"config");m(this,"dashed");m(this,"disposed",!1);m(this,"isMobile");m(this,"mouseGroup");m(this,"container");m(this,"fiveHelper");m(this,"hook");m(this,"magnifier");m(this,"userDistanceItemCreator");m(this,"updateDistanceUI",()=>{this.dashed.distanceItem.update(this.five),this.model.getAllLines().forEach(t=>t.distanceItem.update(this.five))});var n,o;this.five=t.five,this.hook=t.hook,this.model=t.model,this.config=t.config,this.magnifier=t.magnifier,this.container=t.container,this.fiveHelper=t.fiveHelper,this.isMobile=(o=(n=t.openParams)==null?void 0:n.isMobile)!=null?o:!1,this.userDistanceItemCreator=t.userDistanceItemCreator,this.group=t.group,this.mouseGroup=t.mouseGroup,this.dashed=new Bt(new Ye([0,0,0]),new Ye([0,0,0]),this.model),this.dashed.distanceItem.setItemSelectable(!1),this.dashed.mesh.setMaterial({dashed:!0,dashScale:100}),this.dashed.mesh.name="dashLine";const e=this.five.getElement();e&&(e.addEventListener("touchstart",On),e.addEventListener("contextmenu",On))}removeLine(t){this.group.remove(t.mesh,t.lightMesh),t.distanceItem.remove(),this.five.needsRender=!0}updateMouseGroup(t,e){if(!t)return this.mouseGroup;const n=this.fiveHelper.getAdsorbentPoint(t),o=n||t.point;if(this.mouseGroup.position.copy(o),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const r=t.face.normal.clone().multiplyScalar(.05),l=t.point.clone().add(r).clone().add(r);this.mouseGroup.lookAt(l)}return this.mouseGroup}dispose(){this.disposed=!0,this.magnifier.disable(),this.model.getAllLines().forEach(e=>this.removeLine(e));const t=this.five.getElement();t&&(t.removeEventListener("touchstart",On),t.removeEventListener("contextmenu",On))}}function Xi(i){const{x:t,y:e}=i.center,{clientWidth:n,clientHeight:o}=i.target,s=i.target.getBoundingClientRect(),r=new V.Vector2(t,e).sub(new V.Vector2(s.left,s.top)),a=new V.Vector2(r.x/n*2-1,-(r.y/o)*2+1);return{point:r,ndcPoint:a}}function Li(i,t){const e=Xi(t).ndcPoint,n=new V.Raycaster;return n.setFromCamera(e,i.camera),i.model.intersectRaycaster(n)}class Rn extends mi{constructor(e){var o;super(e);m(this,"type","edit");m(this,"polyline");m(this,"pressPoint");m(this,"hasAppendDashed",!1);m(this,"hasAppendMouseGroup",!1);m(this,"fiveElement");m(this,"lastPoint",null);m(this,"hammer");m(this,"onIntersectionUpdate",fo((e,n)=>{var s;this.hasAppendMouseGroup===!1&&(this.group.add(this.mouseGroup),this.magnifier.appendTo(this.container),this.magnifier.enable(),this.hasAppendMouseGroup=!0);const o=this.updateMouseGroup(e,n).position;(s=this.pressPoint)==null||s.position.copy(o),this.updateDashed(),requestAnimationFrame(()=>this.magnifier.renderWithPoint(this.mouseGroup.position)),this.five.needsRender=!0},20));m(this,"revoke",()=>{if(this.polyline.lines.length===0&&this.lastPoint){this.lastPoint=null,this.hasAppendDashed=!1,this.dashed.distanceItem.remove(),this.group.remove(this.dashed.mesh),this.hook.emit("anchorChange",null),this.hook.emit("editedDashedLineChange",null),this.five.needsRender=!0;return}if(this.polyline.lines.length===0&&!this.lastPoint||!this.lastPoint)return;const e=this.polyline.lines[this.polyline.lines.length-1],n=e.findAnotherPoint(this.lastPoint);!n||(this.lastPoint=n,this.hook.emit("anchorChange",n.position),this.group.remove(e.mesh),this.polyline.removeLine(e),this.hasAppendMouseGroup=!1,this.mouseGroup.position.copy(this.lastPoint.position),this.group.remove(this.mouseGroup),e.distanceItem.remove(),this.updateDashed(),this.magnifier.disable(),this.five.needsRender=!0)});m(this,"onMouseLeave",()=>{this.magnifier.disable(),this.group.remove(this.mouseGroup),this.hasAppendMouseGroup=!1,this.lastPoint&&(this.mouseGroup.position.copy(this.lastPoint.position),this.updateDashed())});m(this,"onLineChanged",()=>{this.hook.emit("editedPolylineChange",this.polyline)});m(this,"onPress",e=>{const[n]=Li(this.five,e);if(!(n!=null&&n.face))return;const o=new Ye(n.point);this.pressPoint=o,this.onIntersectionUpdate(n)});m(this,"onPan",e=>{if(!this.pressPoint)return;const[n]=Li(this.five,e);!(n!=null&&n.face)||this.onIntersectionUpdate(n)});m(this,"onPanEnd",e=>{!this.pressPoint||this.onTap(e)});m(this,"onTap",e=>{this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh)),this.hasAppendDashed=!0;const[n]=Li(this.five,e);this.updateMouseGroup(n);const o=new Ye(this.mouseGroup.position),s=this.lastPoint;if(o&&(this.lastPoint=o),o&&s){const r=new Bt(s,o,this.model);r.distanceItem.setItemSelectable(!1),r.distanceItem.appendTo(this.container),this.polyline.addLine(r),this.group.add(r.mesh),r.distanceItem.update(this.five)}this.pressPoint=void 0,this.hasAppendMouseGroup=!1,this.magnifier.disable(),this.group.remove(this.mouseGroup),this.updateDashed(),this.five.needsRender=!0,this.hook.emit("anchorChange",o.position)});m(this,"onWantsTapGesture",()=>!1);m(this,"onWantsToMoveToPano",()=>!1);m(this,"onWantsPanGesture",()=>this.pressPoint?!1:void 0);m(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});m(this,"updateDashed",()=>{!this.lastPoint||(this.dashed.points[0].position.copy(this.lastPoint.position),this.dashed.points[1].position.copy(this.mouseGroup.position),this.dashed.mesh.setPoints(this.lastPoint.position,this.mouseGroup.position),this.dashed.distanceItem.update(this.five),this.hook.emit("editedDashedLineChange",this.dashed))});this.model=new fi(this.config),this.polyline=new hi({model:this.model}),this.model.addPolyline(this.polyline),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsPanGesture",this.onWantsPanGesture),this.five.on("wantsTapGesture",this.onWantsTapGesture),this.five.on("wantsToMoveToPano",this.onWantsToMoveToPano),this.five.on("intersectionOnModelUpdate",this.onIntersectionUpdate),this.polyline.hook.on("lineAdded",this.onLineChanged),this.polyline.hook.on("lineRemoved",this.onLineChanged);const n=this.five.getElement();if(n){this.fiveElement=n;const s=new yn.default(n);this.hammer=s,s.on("tap",this.onTap),s.on("pan",this.onPan),s.on("press",this.onPress),s.on("panend",this.onPanEnd)}this.five.helperVisible=!1,(o=this.fiveElement)==null||o.addEventListener("mouseleave",this.onMouseLeave),this.hook.emit("anchorChange",null),this.hook.emit("editedDashedLineChange",null),this.five.refresh()}dispose(){var e,n;super.dispose(),this.five.helperVisible=!0,this.group.remove(this.mouseGroup,this.dashed.mesh),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsPanGesture",this.onWantsPanGesture),this.five.off("wantsTapGesture",this.onWantsTapGesture),this.five.off("wantsToMoveToPano",this.onWantsToMoveToPano),this.five.off("intersectionOnModelUpdate",this.onIntersectionUpdate),this.polyline.hook.off("lineAdded",this.onLineChanged),this.polyline.hook.off("lineRemoved",this.onLineChanged),(e=this.hammer)==null||e.destroy(),(n=this.fiveElement)==null||n.removeEventListener("mouseleave",this.onMouseLeave),this.magnifier.dispose(),this.dashed.distanceItem.remove(),this.five.needsRender=!0}getEditingLines(){return this.polyline.lines}}class Ps extends mi{constructor(e){super(e);m(this,"type","view");m(this,"hammer");m(this,"polylineRemoved",e=>{e.lines.forEach(n=>this.removeLine(n)),this.hook.emit("selectedChange",this.model.getAllLines().filter(n=>n.selected).map(n=>n))});m(this,"polylineAdded",e=>{const n=this.five.getCurrentState().panoIndex;e.lines.forEach(o=>{e.visiblePanoIndexes&&!e.visiblePanoIndexes.includes(n)&&(o.mesh.visible=!1),o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),this.group.add(o.mesh)})});m(this,"onCameraUpdate",()=>{this.updateDistanceUI()});m(this,"onFivePanoWillArrive",e=>{this.model.polylines.forEach(n=>{!n.visiblePanoIndexes||n.visiblePanoIndexes.includes(e)||n.lines.forEach(o=>{o.mesh.visible=!1,o.distanceItem.update(this.five)})})});m(this,"onFivePanoArrived",e=>{this.model.polylines.forEach(n=>{!n.visiblePanoIndexes||n.visiblePanoIndexes.includes(e)&&n.lines.forEach(o=>{o.mesh.visible=!0,o.distanceItem.update(this.five)})})});this.model.getAllLines().forEach(o=>{o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),this.group.add(o.mesh)});const n=this.five.getElement();if(n){const o=new yn.default(n);this.hammer=o}this.onFivePanoWillArrive(this.five.getCurrentState().panoIndex),this.onFivePanoArrived(this.five.getCurrentState().panoIndex),this.updateDistanceUI(),this.five.needsRender=!0,this.model.hook.on("polylineAdded",this.polylineAdded),this.model.hook.on("polylineRemoved",this.polylineRemoved),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive)}dispose(){var e;super.dispose(),this.model.hook.off("polylineAdded",this.polylineAdded),this.model.hook.off("polylineRemoved",this.polylineRemoved),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.needsRender=!0,this.hook.emit("selectedChange",[]),(e=this.hammer)==null||e.destroy()}}const vf=`
|
|
208
|
+
`,y=document.createElement("div");return y.setAttribute("class","PanoRulerPlugin-rule"),y.setAttribute("data-name",A),y.setAttribute("style","display: none"),y.innerHTML=v,y},o=document.createElement("div");o.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;");const s=document.createElement("div");s.innerHTML=Bh,o.appendChild(s);const r={},a=(A,p)=>{if(e.loaded)throw new Error("\u6807\u5C3A\u88AB\u91CD\u590D\u521D\u59CB\u5316\uFF01");const v=Vh(A,i),y=i.work;if(!y)return!1;for(const w in p){const P=p[w],{standingPosition:k}=y.observers[0],C=P.map(({x:S,z:x,observers:Q})=>{const _=Q.length>0?A.rooms[A.observers[Q[0]]].name:"",O=v[_]?v[_].floor:null;let U=1/0,j={index:0,x:k.x,y:k.y,z:k.z};Q.forEach(N=>{if(!y.observers[N])return;const{standingPosition:ae}=y.observers[N],he={index:N,x:ae.x,y:ae.y,z:ae.z},ue=jh({x:S,z:x},he);O?ue<U&&Math.abs(he.y-O)<.3&&(U=ue,j=he):ue<U&&(U=ue,j=he)});const F=new V.Vector3(S,j.y,x);Object.assign(F,{observers:Q});const W=v[_]?v[_].roof:null,X=W?new V.Vector3(S,W,x):null;return X&&Object.assign(X,{observers:Q}),{origin:F,vertical:X}});r[w]={origins:C.map(S=>S.origin),rules:[]};for(const{origin:S,vertical:x}of C){if(!x)continue;const Q=n(w,S.distanceTo(x));o.append(Q),r[w].rules.push({vertical:!0,rule:[S,x],$element:Q})}for(let S=0;S<C.length;S++){let x=S+1;x>=C.length&&(x=0);const{origin:Q}=C[S],{origin:_}=C[x],O=n(w,Q.distanceTo(_));o.append(O),r[w].rules.push({vertical:!1,rule:[Q,_],$element:O})}}return e.loaded=!0,!0},l=(A,p,v)=>H(exports,null,function*(){const y=A||t.roomInfo,w=p||t.roomRules;if(!y||!w)throw new Error("\u6807\u5C3A\u6570\u636E\u4F9D\u8D56\u4E0D\u9F50\u5168\uFF01");return e.loaded=!1,e.options=R(R({},e.options),v||{}),i.model.loaded?a(y,w):yield new Promise(P=>i.once("modelLoaded",()=>P(a(y,w))))});t.roomInfo&&t.roomRules&&l(t.roomInfo,t.roomRules);const c=(A,p,v,y)=>{const w=[[{x:0,y:0},{x:v,y:0}],[{x:0,y:0},{x:0,y}],[{x:v,y:0},{x:v,y}],[{x:0,y},{x:v,y}]],P=[];for(let k=0;k<w.length;k++){const C=Na([A,p],[w[k][0],w[k][1]],!0);C&&P.push(C)}return P.length===0?!1:P},u=()=>{var Q;const A=(Q=i.getElement())==null?void 0:Q.parentElement;if(!A||!e.loaded||Object.keys(r).length<=0)return;const{panoIndex:p,camera:v,currentMode:y}=i;if(p===void 0)return;let w;for(const _ in r)_.split(",").indexOf(p.toString())>=0&&(w=_);if(!w){for(const _ in r)for(const{$element:O}of r[_].rules)O.style.display="none";return}const P=v.position,k=v.getWorldDirection(new V.Vector3),C=A.clientWidth,S=A.clientHeight;if(y!==Ce.Five.Mode.Panorama){for(const _ in r)for(const{$element:O}of r[_].rules)O.style.display="none";return}for(const _ in r)for(const{$element:O}of r[_].rules)O.style.display=_===w?"block":"none";const[x]=r[w].origins.slice().filter(_=>_.observers.indexOf(p)>=0).sort((_,O)=>{const U=_.clone().setY(0).sub(P).normalize().angleTo(k.clone().setY(0)),j=O.clone().setY(0).sub(P).normalize().angleTo(k.clone().setY(0));return U-j});for(const{rule:_,vertical:O,$element:U}of r[w].rules){const[j,F]=_,W=U.querySelector(".PanoRulerPlugin-rule-line");if(!W)return;if(!x){U.style.display="none";continue}if(j!==x&&F!==x){U.style.display="none";continue}if(j.distanceTo(F)<.3){U.style.display="none";continue}if(j.observers.indexOf(p)===-1||F.observers.indexOf(p)===-1){U.style.display="none";continue}if(j.clone().sub(P).normalize().angleTo(k)>Math.PI/2){U.style.display="none";continue}if(F.clone().sub(P).normalize().angleTo(k)>Math.PI/2){U.style.display="none";continue}const ee=j.distanceTo(F);if(F.clone().sub(F.clone().sub(j).divide(new V.Vector3(2,2,2))).distanceTo(P)/ee>8){U.style.display="none";continue}const he=j.clone().project(v),ue=(he.x+1)/2*C,pe=(-he.y+1)/2*S,Pe=F.clone().project(v),Le=(Pe.x+1)/2*C,ze=(-Pe.y+1)/2*S,le=Math.sqrt(Math.pow(Le-ue,2)+Math.pow(ze-pe,2));let ge=le,Ee=50;const de=c({x:~~ue,y:~~pe},{x:~~Le,y:~~ze},C,S);if(de&&de.length===1&&(x===j?(ge=Math.sqrt(Math.pow(de[0].x-ue,2)+Math.pow(de[0].y-pe,2)),Ee=ge/le*50):x===F&&(ge=Math.sqrt(Math.pow(de[0].x-Le,2)+Math.pow(de[0].y-ze,2)),Ee=100-ge/le*50)),de&&de.length===2){const te={x:(de[0].x+de[1].x)/2,y:(de[0].y+de[1].y)/2};Ee=Math.sqrt(Math.pow(te.x-ue,2)+Math.pow(te.y-pe,2))/le*100}const it=(Math.PI/2-Math.atan2(Le-ue,pe-ze))/Math.PI*180,ve=W.querySelector(".PanoRulerPlugin-rule-label"),Je=ve.children[0].clientWidth;Je>=le||Je/2>=Ee/100*le||Je/2>=(1-Ee/100)*le?W.style.display="none":(W.style.display="block",W.style.width=le+"px",W.style.left=ue+"px",W.style.top=pe+"px",W.style.transform=`rotate(${-it}deg)`,ve.style.left=`${Ee}%`)}},h=()=>_a(u),d=()=>{var A,p;return e.loaded?(e.enable||(o.setAttribute("class","PanoRulerPlugin"+(e.options.className?" "+e.options.className:"")),(p=(A=i.getElement())==null?void 0:A.parentElement)==null||p.append(o),u(),i.on("modeChange",u),i.on("cameraUpdate",h),e.enable=!0),!0):!1},f=()=>(e.enable&&(i.off("modeChange",u),i.off("cameraUpdate",h),o&&o.remove(),e.enable=!1),!0);function g(A){if(A.distanceText&&A.distanceText!==e.options.distanceText){const p=A.distanceText;e.options.distanceText=p,Object.values(r).forEach(v=>{v.rules.forEach(y=>{const[w,P]=y.rule,k=w.distanceTo(P),C=y.$element.querySelector(".PanoRulerPlugin-rule-label-name");!C||(C.innerText=p(k))})})}}return{enable:d,disable:f,load:l,state:e,changeConfigs:g}};function Rh(i){ce(i,"svelte-1h27ktp",".PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp{position:absolute;transform-origin:left 0.0625rem;width:0;height:0.125rem;pointer-events:none}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::after{content:'';position:absolute;left:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::before{content:'';position:absolute;right:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1.5s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp em.svelte-1h27ktp{display:block;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;box-shadow:0 0 0.25rem rgb(0 0 0 / 40%);position:relative}.rule-mixed-line.svelte-1h27ktp.svelte-1h27ktp{display:flex;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;align-items:center}.em-solid.svelte-1h27ktp.svelte-1h27ktp{height:100%;background:#ffffff}.em-dotted.svelte-1h27ktp.svelte-1h27ktp{height:0.125rem;background:var(--background-image);background-position:center;background-repeat:repeat}.PanoRulerPlugin-rule-label.svelte-1h27ktp.svelte-1h27ktp{position:absolute;width:0;height:0;top:0.0625rem;pointer-events:none}.PanoRulerPlugin-rule-label-name.svelte-1h27ktp.svelte-1h27ktp{position:absolute;padding:0.1875rem 0.375rem;background:rgba(195, 195, 195, 0.3);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem);border-radius:6.25rem;border:0.0625rem solid rgba(255, 255, 255, 0.6);white-space:nowrap;overflow:hidden;color:#ffffff;font-weight:500;font-size:0.75rem;line-height:1;animation:svelte-1h27ktp-viewport-rule-label 0.25s ease 1s;animation-fill-mode:both;box-shadow:inset 0 0 0.625rem 0 rgba(255, 255, 255, 0.3)}@keyframes svelte-1h27ktp-viewport-rule-line{0%{width:0%}100%{width:100%}}@keyframes svelte-1h27ktp-viewport-rule-label{0%{opacity:0;transform:scaleX(0)}100%{opacity:1;transform:translate(-50%, -50%) scaleX(1)}}@keyframes svelte-1h27ktp-viewport-rule-point{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}")}function As(i,t,e){const n=i.slice();return n[6]=t[e],n}function Oh(i){let t,e=i[0].children,n=[];for(let o=0;o<e.length;o+=1)n[o]=vs(As(i,e,o));return{c(){t=z("div");for(let o=0;o<n.length;o+=1)n[o].c();b(t,"class","rule-mixed-line svelte-1h27ktp")},m(o,s){T(o,t,s);for(let r=0;r<n.length;r+=1)n[r].m(t,null)},p(o,s){if(s&9){e=o[0].children;let r;for(r=0;r<e.length;r+=1){const a=As(o,e,r);n[r]?n[r].p(a,s):(n[r]=vs(a),n[r].c(),n[r].m(t,null))}for(;r<n.length;r+=1)n[r].d(1);n.length=e.length}},d(o){o&&M(t),at(n,o)}}}function Fh(i){let t,e;return{c(){t=z("em"),b(t,"class",e=Te(i[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),b(t,"style",i[3])},m(n,o){T(n,t,o)},p(n,o){o&1&&e!==(e=Te(n[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&b(t,"class",e),o&8&&b(t,"style",n[3])},d(n){n&&M(t)}}}function vs(i){let t,e,n=`${i[6].width}px`;return{c(){t=z("div"),b(t,"class",e=Te(i[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),b(t,"style",i[3]),L(t,"width",n)},m(o,s){T(o,t,s)},p(o,s){s&1&&e!==(e=Te(o[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&b(t,"class",e),s&8&&b(t,"style",o[3]),s&1&&n!==(n=`${o[6].width}px`)&&L(t,"width",n)},d(o){o&&M(t)}}}function Hh(i){let t,e,n,o,s=i[0].labelElement+"",r,a,l=`${i[0].labelOffset}%`,c=`${i[0].width}px`,u=`${i[0].left}px`,h=`${i[0].top}px`,d=`rotate(${i[0].rotateDeg}deg)`;function f(p,v){return p[0].children.length===0?Fh:Oh}let g=f(i),A=g(i);return{c(){t=z("div"),A.c(),e=$(),n=z("div"),o=z("div"),r=ke(s),b(o,"class","PanoRulerPlugin-rule-label-name svelte-1h27ktp"),xe(()=>i[4].call(o)),b(n,"class","PanoRulerPlugin-rule-label svelte-1h27ktp"),L(n,"left",l),b(t,"class","PanoRulerPlugin-rule-line svelte-1h27ktp"),L(t,"width",c),L(t,"left",u),L(t,"top",h),L(t,"transform",d),L(t,"display",i[0].visible&&i[2]?"block":"none")},m(p,v){T(p,t,v),A.m(t,null),B(t,e),B(t,n),B(n,o),B(o,r),a=tt(o,i[4].bind(o))},p(p,[v]){g===(g=f(p))&&A?A.p(p,v):(A.d(1),A=g(p),A&&(A.c(),A.m(t,e))),v&1&&s!==(s=p[0].labelElement+"")&&Me(r,s),v&1&&l!==(l=`${p[0].labelOffset}%`)&&L(n,"left",l),v&1&&c!==(c=`${p[0].width}px`)&&L(t,"width",c),v&1&&u!==(u=`${p[0].left}px`)&&L(t,"left",u),v&1&&h!==(h=`${p[0].top}px`)&&L(t,"top",h),v&1&&d!==(d=`rotate(${p[0].rotateDeg}deg)`)&&L(t,"transform",d),v&5&&L(t,"display",p[0].visible&&p[2]?"block":"none")},i:Y,o:Y,d(p){p&&M(t),A.d(),a()}}}function Gh(i,t,e){let n,{rulerItemProp:o}=t,s=!0,r,a="data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQiIHdpZHRoPSIxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PGZpbHRlciBpZD0icHJlZml4X19hIiBoZWlnaHQ9IjQwMCUiIHdpZHRoPSIxMzcuNCUiIHg9Ii0xOC43JSIgeT0iLTE1MCUiPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiBvcGVyYXRvcj0iZGlsYXRlIiByYWRpdXM9Ii41IiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSIvPjxmZU9mZnNldCBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSIvPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiByYWRpdXM9IjEiIHJlc3VsdD0ic2hhZG93SW5uZXIiLz48ZmVPZmZzZXQgaW49InNoYWRvd0lubmVyIiByZXN1bHQ9InNoYWRvd0lubmVyIi8+PGZlQ29tcG9zaXRlIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIGluMj0ic2hhZG93SW5uZXIiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIi8+PGZlR2F1c3NpYW5CbHVyIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSIgc3RkRGV2aWF0aW9uPSIuNSIvPjxmZUNvbG9yTWF0cml4IGluPSJzaGFkb3dCbHVyT3V0ZXIxIiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMiAwIi8+PC9maWx0ZXI+PHBhdGggaWQ9InByZWZpeF9fYiIgZD0iTS44ODkgMkgxMS41OCIvPjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1kYXNoYXJyYXk9IjUgNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48dXNlIGZpbGw9IiMwMDAiIGZpbHRlcj0idXJsKCNwcmVmaXhfX2EpIiB4bGluazpocmVmPSIjcHJlZml4X19iIi8+PHVzZSBzdHJva2U9IiNmZmYiIHN0cm9rZS1vcGFjaXR5PSIuNCIgeGxpbms6aHJlZj0iI3ByZWZpeF9fYiIvPjwvZz48L3N2Zz4=";function l(){r=this.offsetWidth,e(1,r)}return i.$$set=c=>{"rulerItemProp"in c&&e(0,o=c.rulerItemProp)},i.$$.update=()=>{i.$$.dirty&3&&(r>=o.width||r/2>=o.labelOffset/100*o.width||r/2>=(1-o.labelOffset/100)*o.width?e(2,s=!1):e(2,s=!0))},e(3,n=`--background-image: url(${a})`),[o,r,s,n,l]}class Wh extends oe{constructor(t){super(),ie(this,t,Gh,Hh,ne,{rulerItemProp:0},Rh)}}function bs(i,t,e){const n=i.slice();return n[12]=t[e],n}function ys(i){let t,e;return t=new Wh({props:{rulerItemProp:i[12]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.rulerItemProp=n[12]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Nh(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=ys(bs(i,n,r));const s=r=>D(o[r],1,1,()=>{o[r]=null});return{c(){t=z("div");for(let r=0;r<o.length;r+=1)o[r].c()},m(r,a){T(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&1){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=bs(r,n,l);o[l]?(o[l].p(c,a),E(o[l],1)):(o[l]=ys(c),o[l].c(),E(o[l],1),o[l].m(t,null))}for(se(),l=n.length;l<o.length;l+=1)s(l);re()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)E(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)D(o[a]);e=!1},d(r){r&&M(t),at(o,r)}}}function _h(i,t,e){var A,p,v,y;let{five:n}=t,{rulerDatas:o}=t,{options:s}=t,r=[];const a=((p=(A=n.getElement())==null?void 0:A.parentElement)==null?void 0:p.clientWidth)||0,l=((y=(v=n.getElement())==null?void 0:v.parentElement)==null?void 0:y.clientHeight)||0,c=(w,P)=>{const k=[[{x:0,y:0},{x:a,y:0}],[{x:0,y:0},{x:0,y:l}],[{x:a,y:0},{x:a,y:l}],[{x:0,y:l},{x:a,y:l}]],C=[];for(let S=0;S<k.length;S++){const x=Na([w,P],[k[S][0],k[S][1]],!0);x&&C.push(x)}return C.length===0?!1:C},u=(w,P)=>{const k=w.clone().project(n.camera),C=(k.x+1)/2*a,S=(-k.y+1)/2*l,x=P.clone().project(n.camera),Q=(x.x+1)/2*a,_=(-x.y+1)/2*l,O=Math.sqrt(Math.pow(Q-C,2)+Math.pow(_-S,2));return{startLeft:C,startTop:S,endLeft:Q,endTop:_,distance:O}},h=(w,P,k)=>{const C=n.camera.position,S=n.camera.getWorldDirection(new V.Vector3),x=w.clone().sub(C).normalize().angleTo(S),Q=P.clone().sub(C).normalize().angleTo(S),_=w.distanceTo(P),U=P.clone().sub(P.clone().sub(w).divide(new V.Vector3(2,2,2))).distanceTo(C),{startLeft:j,startTop:F,endLeft:W,endTop:X,distance:G}=u(w,P),N=-((Math.PI/2-Math.atan2(W-j,F-X))/Math.PI)*180;let ae=!0;k||(ae=!1),!et(w,k)&&!et(P,k)&&(ae=!1),_<.3&&(ae=!1),x>Math.PI/2&&(ae=!1),Q>Math.PI/2&&(ae=!1),U/_>8&&(ae=!1);let he=50,ue=G;const pe=c({x:~~j,y:~~F},{x:~~W,y:~~X});if(pe&&pe.length===1&&(et(w,k)?(ue=Math.sqrt(Math.pow(pe[0].x-j,2)+Math.pow(pe[0].y-F,2)),he=ue/G*50):et(P,k)&&(ue=Math.sqrt(Math.pow(pe[0].x-W,2)+Math.pow(pe[0].y-X,2)),he=100-ue/G*50)),pe&&pe.length===2){const Pe={x:(pe[0].x+pe[1].x)/2,y:(pe[0].y+pe[1].y)/2};he=Math.sqrt(Math.pow(Pe.x-j,2)+Math.pow(Pe.y-F,2))/G*100}return{startLeft:j,startTop:F,distance:G,deg:N,visible:ae,labelOffset:he,ruleLength:_}},d=()=>{const w=n.panoIndex,P=o.find(O=>O.panoIndex===w);if(!P)return e(0,r=[]);if(n.currentMode!==Ce.Five.Mode.Panorama)return e(0,r=[]);const k=n.camera.position,C=n.camera.getWorldDirection(new V.Vector3),S=P.lines.map(O=>new V.Vector3(O.start[0],-O.start[1],-O.start[2])),x=P.lines.map(O=>new V.Vector3(O.end[0],-O.end[1],-O.end[2])),[Q]=S.concat(x).sort((O,U)=>{const j=O.clone().setY(0).sub(k).normalize().angleTo(C.clone().setY(0)),F=U.clone().setY(0).sub(k).normalize().angleTo(C.clone().setY(0));return j-F}),_=P.lines.map(O=>{var ue,pe;const U=O.start,j=O.end,{startLeft:F,startTop:W,distance:X,deg:G,visible:ee,labelOffset:N,ruleLength:ae}=h(new V.Vector3(U[0],-U[1],-U[2]),new V.Vector3(j[0],-j[1],-j[2]),Q),he=[];return O.children&&((ue=O.children)==null?void 0:ue.length)>0&&((pe=O.children)==null||pe.forEach(Pe=>{const Le=Pe.start,ze=Pe.end,{distance:le}=u(new V.Vector3(Le[0],-Le[1],-Le[2]),new V.Vector3(ze[0],-ze[1],-ze[2]));he.push({width:le,state:Pe.state})})),{width:X,left:F,top:W,rotateDeg:G,state:O.state,children:he,labelOffset:N,visible:ee,labelElement:s.distanceText(ae)}});e(0,r=_)},f=()=>di(d),g=fo(d,80);return Ue(()=>{d(),n.on("panoArrived",d),n.on("modeChange",d),n.on("cameraDirectionUpdate",f),n.on("movingToPano",f),n.on("mouseWheel",()=>g()),n.on("pinchGesture",()=>g())}),Pt(()=>{n.off("panoArrived",d),n.off("modeChange",d),n.off("cameraDirectionUpdate",f),n.off("movingToPano",f),n.off("mouseWheel",()=>g()),n.off("pinchGesture",()=>g())}),i.$$set=w=>{"five"in w&&e(1,n=w.five),"rulerDatas"in w&&e(2,o=w.rulerDatas),"options"in w&&e(3,s=w.options)},[r,n,o,s]}class Xh extends oe{constructor(t){super(),ie(this,t,_h,Nh,ne,{five:1,rulerDatas:2,options:3})}}class Yh{constructor(t,e){m(this,"five");m(this,"container",document.createElement("div"));m(this,"panoRulerProData");m(this,"rulerItems");m(this,"state",{enabled:!1,loaded:!1,options:{className:"",distanceText:t=>`${t.toFixed(1)}m`}});var n,o;this.five=t,this.container.classList.add("panoRulerProPlugin-container"),this.container.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;"),e&&(e.data&&this.load(e.data),this.state.options=R(R({},this.state.options),e.options||{}),(n=e.options)!=null&&n.className&&this.container.classList.add((o=e.options)==null?void 0:o.className)),this.five.once("modelLoaded",()=>H(this,null,function*(){var s,r;(r=(s=this.five.getElement())==null?void 0:s.parentNode)==null||r.append(this.container)})),this.five.once("dispose",()=>this.dispose())}load(t){return H(this,null,function*(){if(!this.five.work)return;const e=t.data;if(!e)throw new Error("\u6807\u5C3A\u6570\u636E\u4F9D\u8D56\u4E0D\u9F50\u5168\uFF01");this.panoRulerProData=e,this.state.loaded=!0})}enable(){return this.state.loaded?(this.state.enabled||(this.state.enabled=!0,this.render()),!0):!1}disable(){return this.state.enabled&&(this.state.enabled=!1,this.render()),!0}render(){return H(this,null,function*(){var t;if(this.state.enabled){if(!this.panoRulerProData||!this.container)return;this.rulerItems=new Xh({target:this.container,props:{five:this.five,rulerDatas:this.panoRulerProData,options:this.state.options}})}else(t=this.rulerItems)==null||t.$destroy(),this.rulerItems=void 0})}dispose(){this.container&&(this.rulerItems.$destroy(),this.rulerItems=void 0),this.container.remove()}}const Uh=(i,t)=>new Yh(i,t),qh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZIAAABCCAYAAAB9y1BhAAAAAXNSR0IArs4c6QAADh5JREFUeAHtnVuPLDcVhedwC/dACKAICDxEIBQpygNI/Ab+MX8B8YCQEAjxgBAQLsm5Jjkn58r6Sl4jT52qnu4zXd121dqSx67q7ip7eXsv721XzcVFJAgEgSAQBIJAEAgCQeC4CLx48eKbSu+RH/fKuVoQWB8Cn1tfk9KiIHAUBH6tq/xKiTwSBILADgRCJDvAyUebRuAbpfXxSDatBmn8Pgh8YZ8v5TtBYIMIvFCbSZEgEASuQSBEcg1A+XizCDzfbMvT8CBwIAIhkgMBy9c3g0CIZDNdnYbeFIEQyU0RzO/XikCIZK09m3YdHYEQydEhzQVXgkCIZCUdmWYsj0CIZHmMc4c+EchCe5/9llqfAYEQyRlAzy27QCAeSRfdlEq2gECIpIVeSB1aRAAiudVixVKnINAaAiGS1nok9WkFAUJb8Upa6Y3Uo2kEQiRNd08qd0YEQiJnBD+37guBEElf/ZXang6BEMnpsM6dOkcg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x4jQQWGalpFAAAAAElFTkSuQmCC";function Jh(){const i=document.createElement("div"),t=document.createElement("i"),e=document.createElement("span");return i.appendChild(t),i.appendChild(e),i.style.position="relative",i.style.width="100%",i.style.display="flex",i.style.flexDirection="column",i.style.alignItems="center",i.style.marginTop=`${150/16}rem`,i.style.opacity="0",i.style.transition="opacity 1000ms linear",t.style.display="block",t.style.width=`${134/16}rem`,t.style.height=`${22/16}rem`,t.style.backgroundSize="100%",t.style.backgroundRepeat="no-repeat",t.style.backgroundImage=`url(${qh})`,e.style.marginTop=`${10/16}rem`,e.style.fontSize=`${16/16}rem`,e.style.color="#fff",e.style.opacity="0.7",e.style.textShadow="0 2px 16px rgb(22 34 83 / 24%)",e.style.fontWeight="bold",{appendTo(n){n.appendChild(i)},dispose(){i.remove()},setRoom(n){e.innerHTML=n.name+" "+Math.floor(n.size/1e6)+"\u33A1"},show(){i.style.opacity="1"},hide(){i.style.opacity="0"}}}const Zh=new I.TextureLoader;function ws(i){return H(this,null,function*(){return new Promise((t,e)=>{Zh.load(i,t,void 0,e)}).then(t=>(t.encoding=I.sRGBEncoding,t))})}const Vn={userAction:!0};class Kh extends zt{constructor(e,n){super(e);m(this,"state",{visible:!0,enabled:!0,config:{compassImageUrl:"//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png",entryDoorImageUrl:"//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png"}});m(this,"data");m(this,"group",new I.Group);m(this,"roomInfoInstance");m(this,"roomInfoWrapperInstance");m(this,"compassMeshTween");m(this,"compassMesh");m(this,"entryDoorMesh");m(this,"dispose",()=>{var e,n,o,s;this.five.scene.remove(this.group),this.group.remove(...this.group.children),(n=(e=this.compassMesh)==null?void 0:e.material.map)==null||n.dispose(),(s=(o=this.entryDoorMesh)==null?void 0:o.material.map)==null||s.dispose(),this.five.off("dispose",this.dispose),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});m(this,"_addEventListener",()=>{this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive),this.five.on("modeChange",this.onFiveModeChange),this.five.on("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});m(this,"_removeEventListener",()=>{this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("modeChange",this.onFiveModeChange),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});m(this,"_enable",()=>{this.five.scene.add(this.group),this.init(),this.onFivePanoArrived(this.five.panoIndex||0),this._addEventListener()});m(this,"_disable",()=>{this._clearCompassIfNeed(),this._clearEntryDoorIfNeed(),this.five.scene.remove(this.group),this._removeEventListener()});m(this,"_toggleVisible",()=>{this.group.visible=this.state.visible,this.five.needsRender=!0});m(this,"_clearCompassIfNeed",()=>{var e;this.compassMesh&&(this.group.remove(this.compassMesh),(e=this.compassMesh.material.map)==null||e.dispose(),this.compassMesh=null)});m(this,"_clearEntryDoorIfNeed",()=>{var e;this.entryDoorMesh&&(this.group.remove(this.entryDoorMesh),(e=this.entryDoorMesh.material.map)==null||e.dispose(),this.entryDoorMesh=null),this.roomInfoInstance&&(this.roomInfoInstance.dispose(),this.roomInfoInstance=null),this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.dispose(),this.roomInfoWrapperInstance=null)});m(this,"onFivePanoWillArrive",e=>{var n,o;e!==this.five.panoIndex&&((n=this.compassMeshTween)==null||n.dispose(),(o=this.compassMesh)==null||o.material.setValues({opacity:0}))});m(this,"onFivePanoArrived",e=>{var o,s,r,a,l,c,u;const n=(r=(s=(o=this.five.work)==null?void 0:o.observers)==null?void 0:s[e])==null?void 0:r.standingPosition;if(this.compassMesh&&(this.compassMesh.position.copy(n.clone().setY(n.y+.01)),this.compassMesh.material.opacity===0&&((a=this.compassMeshTween)==null||a.dispose(),this.compassMeshTween=Ha(1e3).onUpdate(({progress:h})=>{var d;(d=this.compassMesh)==null||d.material.setValues({opacity:h}),this.five.needsRender=!0}).play())),this.entryDoorMesh){const d=new I.Vector3(this.data.entrance.position.x,this.data.entrance.position.y,this.data.entrance.position.z).clone().setY(n.y).sub(n).normalize(),f=n.clone().add(d.clone().multiplyScalar(.7)).setY(n.y+.01);this.entryDoorMesh.rotation.z=new I.Vector3(0,0,-1).angleTo(d),this.entryDoorMesh.position.copy(f),((l=this.data)==null?void 0:l.room_observers[e].room.type)===1?(c=this.entryDoorMesh)==null||c.material.setValues({opacity:1}):(u=this.entryDoorMesh)==null||u.material.setValues({opacity:0})}this.roomInfoInstance&&this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.css3DObject.position.copy(n.clone().setY(n.y+.01)),this.roomInfoInstance.setRoom(this.data.room_observers[e].room)),this.five.needsRender=!0});m(this,"onFiveCameraDirectionUpdate",({longitude:e,latitude:n})=>{var o,s;!this.roomInfoWrapperInstance||(this.roomInfoWrapperInstance.css3DObject.rotation.z=e,n>.66&&this.five.getCurrentState().mode==="Panorama"?(o=this.roomInfoInstance)==null||o.show():(s=this.roomInfoInstance)==null||s.hide())});m(this,"onFiveModeChange",(e,n,o,s,r)=>{e!==n&&this.setState({visible:e===Ce.Five.Mode.Panorama},{userAction:r})});this.five.scene.add(this.group),this.five.once("dispose",this.dispose),this.setState({visible:!0,enabled:!0,config:R(R({},this.state.config),n||{})})}enable(e=Vn){this.setState({enabled:!0},e)}disable(e=Vn){this.setState({enabled:!1},e)}show(e=Vn){if(!!this.state.enabled)return this.setState({visible:!0},e),Promise.resolve()}hide(e=Vn){if(!!this.state.enabled)return this.setState({visible:!1},e),Promise.resolve()}setState(e,n={userAction:!0}){var s,r;const o=JSON.parse(JSON.stringify(this.state));this.state={visible:(s=e.visible)!=null?s:o.visible,enabled:(r=e.enabled)!=null?r:o.enabled,config:R(R({},o.config),e.config||{})},this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n.userAction}),e.enabled===!0&&(this._enable(),this.hooks.emit("enable",n)),e.enabled===!1&&(this._disable(),this.hooks.emit("disable",n)),e.visible===!1&&(this._toggleVisible(),this.hooks.emit("hide",n)),e.visible===!0&&(this._toggleVisible(),this.hooks.emit("show",n)),e.config&&this.init()}load(e,n,o=!0){return H(this,null,function*(){const s=yield this.formatData(e);JSON.stringify(this.data)!==JSON.stringify(s)&&(this.hooks.emit("dataChange",s,this.data),this.data=R({},s),this.init(),n&&this.setState(n,{userAction:o}),this.hooks.emit("dataLoaded",this.data))})}formatData(e){return e.version&&e.data?Promise.resolve(e.data):Promise.resolve(e)}init(){return H(this,null,function*(){var o,s,r,a;const e=(s=(o=this.data)==null?void 0:o.north_rad)!=null?s:null;this._clearCompassIfNeed(),e!==null&&(this.compassMesh=yield this.loadCompassMesh(),this.compassMesh.rotateX(-Math.PI/2),this.compassMesh.rotateZ(e-Math.PI/2),this.group.add(this.compassMesh));const n=(a=(r=this.data)==null?void 0:r.entrance)!=null?a:null;this._clearEntryDoorIfNeed(),n!==null&&(this.entryDoorMesh=yield this.loadEntryDoorMesh(),this.roomInfoWrapperInstance=this.loadRoomInfo(),this.roomInfoInstance=Jh(),this.entryDoorMesh.rotateX(-Math.PI/2),this.roomInfoWrapperInstance&&this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container),this.group.add(this.entryDoorMesh)),this.onFivePanoArrived(this.five.panoIndex||0),this.five.needsRender=!0})}loadCompassMesh(){return H(this,null,function*(){const e=this.state.config.compassImageUrl,n=yield ws(e),o=new I.CircleGeometry(.7,32),s=new I.MeshBasicMaterial({map:n,transparent:!0,opacity:0,depthTest:!1}),r=new I.Mesh(o,s);return r.name="pano-compass-mesh",r})}loadEntryDoorMesh(){return H(this,null,function*(){const e=this.state.config.entryDoorImageUrl,n=yield ws(e),o=new I.PlaneGeometry(.2,.16),s=new I.MeshBasicMaterial({map:n,transparent:!0,opacity:.8,depthTest:!1}),r=new I.Mesh(o,s);return r.name="pano-compass-entry-door",r})}loadRoomInfo(){const e=[new I.Vector3(-.7,0,-.7),new I.Vector3(.7,0,-.7),new I.Vector3(.7,0,.7),new I.Vector3(-.7,0,.7)];return Jt(this.five).create3DDomContainer(e)}}const $h=(i,t)=>new Kh(i,t);function Qn(i,t,e){const n=i[t],o=i[e];n===void 0||o===void 0||(i[t]=o,i[e]=n)}function ef(i,t,e){const n=e/2;for(let o=1;o<=n;o++){const s=e-(o-1);for(let r=1;r<=t;r++){const a=(o-1)*t+r-1,l=(s-1)*t+r-1;Qn(i,a*4+0,l*4+0),Qn(i,a*4+1,l*4+1),Qn(i,a*4+2,l*4+2),Qn(i,a*4+3,l*4+3)}}}class Xa{constructor(t,e){m(this,"width");m(this,"height");m(this,"containerDom");m(this,"hooks",new Ce.Subscribe);m(this,"canvas",document.createElement("canvas"));m(this,"five");m(this,"scale");m(this,"config");m(this,"offset",{x:0,y:0});m(this,"context");m(this,"renderCenter",new I.Vector3);m(this,"hammer");m(this,"state",{enabled:!1});m(this,"offsetRange");m(this,"isPanning",!1);m(this,"onPanstart",()=>{this.isPanning=!0,this.canvas.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)"});m(this,"onPan",t=>{if(!this.isPanning||!this.offsetRange||this.hooks.emit("wantsPanGesture",t))return;const{translateX:n,translateY:o}=this.getPanOffset(t,this.offsetRange);this.canvas.style.transform=`translate3d(${n}px, ${o}px, 100px)`});m(this,"onPanend",t=>{if(this.isPanning=!1,this.canvas.style.boxShadow="none",!this.offsetRange)return;const{translateX:e,translateY:n}=this.getPanOffset(t,this.offsetRange);this.canvas.style.transform=`translate3d(${e}px, ${n}px, 100px)`,this.offset={x:e,y:n}});var o,s,r;if(!t.renderer)throw new Error("Five Render \u672A\u521D\u59CB\u5316");this.five=t,this.scale=(o=e==null?void 0:e.scale)!=null?o:2,this.width=(s=e==null?void 0:e.width)!=null?s:190,this.height=(r=e==null?void 0:e.height)!=null?r:190,this.config={dragEnabled:(e==null?void 0:e.dragEnabled)||!1,autoFixPCPosition:(e==null?void 0:e.autoFixPCPosition)||!1,initialPosition:(e==null?void 0:e.initialPosition)||{left:"0",top:"0"}};const n=this.canvas.getContext("2d");if(!n)throw new Error("CANNOT CREATE CONTEXT2D");this.context=n,this.config.dragEnabled&&(this.hammer=new yn.default(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panstart",this.onPanstart),this.hammer.on("panend",this.onPanend)),this.initStyle()}dispose(){var t;this.clear(),this.disable(),(t=this.hammer)==null||t.destroy()}enable(){if(!this.state.enabled)return this.state.enabled=!0,this.containerDom&&this._appendTo(this.containerDom),this}disable(){if(!!this.state.enabled)return this.state.enabled=!1,this.canvas.remove(),this}appendTo(t){return this.containerDom=t,this.state.enabled&&this._appendTo(t),this}clear(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this}renderWithPoint(t){!this.containerDom||!this.state.enabled||(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}renderWithScreenPoint(t){!this.containerDom||!this.state.enabled||(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}resetOffset(){this.offset={x:0,y:0},this.canvas.style.transform=`translate3d(${0}px, ${0}px, 100px)`}getCurrentState(){return{enabled:this.state.enabled}}getRenderCenter(){return this.renderCenter}_appendTo(t){if(this.resetOffset(),t.appendChild(this.canvas),!this.offsetRange){const e=this.canvas.getBoundingClientRect(),n=t.getBoundingClientRect(),o=n.right-e.right,s=n.bottom-e.bottom,r=n.left-e.left,a=n.top-e.top;this.offsetRange={min:{x:r,y:a},max:{x:o,y:s}}}}autoFixPCPosition(){if(!this.containerDom)return;const{width:t,height:e}=this,[n,o,s]=(()=>{if(this.renderCenter instanceof I.Vector3){const r=this.renderCenter.clone().project(this.five.camera);return[(r.x+1)/2*this.containerDom.clientWidth,-(r.x-1)/2*this.containerDom.clientWidth,-(r.y-1)/2*this.containerDom.clientHeight]}else return[this.renderCenter.x,this.containerDom.clientWidth-this.renderCenter.x,this.renderCenter.y]})();n<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=90+"px"):s<183?(this.canvas.style.top=90+"px",this.canvas.style.left=-t/2+"px"):o<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=-t-90+"px"):(this.canvas.style.left=-t/2+"px",this.canvas.style.top=-e-90+"px"),this.canvas.style.transform=`translate3d(${n}px, ${s}px, 10px)`,this.offset={x:n,y:s}}render(){if(!this.five.renderer||!this.containerDom)return;const{scale:t,context:e,width:n,height:o}=this,s=this.five.renderer.getSize(new I.Vector2),[r,a]=(()=>{if(this.renderCenter instanceof I.Vector3){const p=this.renderCenter.clone().project(this.five.camera);return[(p.x+1)/2*s.x,(p.y+1)/2*s.y]}else return[this.renderCenter.x,s.y-this.renderCenter.y]})(),l=1,c=n/t,u=o/t,h=l*t,d=this.five.getPixels(r-c/2,a-c/2,c,u,h),f=Math.floor(n*l),g=Math.floor(o*l);ef(d,f,g);const A=new ImageData(f,g);A.data.set(d),e.putImageData(A,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}getPanOffset(t,e){const{min:{x:n,y:o},max:{x:s,y:r}}=e,a=this.offset.x+t.deltaX,l=this.offset.y+t.deltaY,c=Math.min(Math.max(a,n),s),u=Math.min(Math.max(l,o),r);return{translateX:c,translateY:u}}}class tf{constructor(t){m(this,"edges",[]);m(this,"five");m(this,"onModelLoaded",()=>{!this.five.model||(this.edges=this.five.model.getEdges())});this.five=t,this.five.model.loaded?this.onModelLoaded():this.five.on("modelLoaded",this.onModelLoaded)}dispose(){}getAdsorbentPoint(t){if(this.edges.length===0)return null;let e=1/0,n;return this.edges.forEach(o=>{const s=o.closestPointToPoint(t.point,!0,new V.Vector3),r=s.distanceTo(t.point);r<e&&(n=s,e=r)}),e>.1?null:n||null}}function nf(i,t){for(let e=0,n=t.length;e<n;e++)if(i===t[e])return t.splice(e,1)[0]}class Ye{constructor(t){m(this,"id");m(this,"lines");m(this,"position");m(this,"type","point");this.id=Ge(),this.lines=[],this.position=new V.Vector3,t instanceof V.Vector3?this.position.copy(t):this.position.fromArray(t)}toJson(){return{id:this.id,position:this.position.toArray()}}addLine(t){this.lines.push(t)}removeLine(t){nf(t,this.lines)}clone(){return new Ye(this.position)}}class hi{constructor(t){m(this,"id",Ge());m(this,"lines",[]);m(this,"points",[]);m(this,"visiblePanoIndexes");m(this,"model");m(this,"type","polyline");m(this,"hook",new Ce.Subscribe);this.model=t.model}addLine(t){if(this.includes(t)){console.error(new Error("\u4E0D\u80FD\u91CD\u590D\u6DFB\u52A0\u7EBF\u6BB5"));return}const e=this.getLastPoint(),n=e&&t.findAnotherPoint(e);e?e&&n?(this.lines.push(t),this.points.push(...t.points),this.hook.emit("lineAdded",t)):console.error(new Error("\u4F20\u5165\u7EBF\u6BB5\u65E0\u6CD5\u4E0E\u5F53\u524D\u6298\u7EBF\u8FDB\u884C\u8FDE\u63A5")):(this.lines.push(t),this.points.push(...t.points),this.hook.emit("lineAdded",t))}removeLine(t){if(this.lines.length!==0){if(!this.isLastLine(t)){console.error(new Error("\u4F20\u5165\u7EBF\u6BB5\u4E0D\u662F\u5F53\u524D\u6298\u7EBF\u7684\u6700\u540E\u4E00\u6BB5"));return}this.lines.pop(),this.lines.length===0?this.points.slice(0,this.points.length):this.points.pop(),this.hook.emit("lineRemoved",t)}}isLastLine(t){const e=this.getLastLine();return e?t.id===e.id:!1}getLastLine(){return this.lines.slice(-1)[0]}clear(){this.lines.slice(0,this.lines.length),this.points.slice(0,this.points.length)}overlapWith(t){return t.type==="point"?this.includes(t):t.type==="line"?t.points.some(e=>this.includes(e)):t.type==="polyline"?t.points.some(e=>this.includes(e)):!0}includes(t){return t.type==="point"?this.points.find(({id:e})=>e===t.id)!==void 0:t.type==="line"?this.lines.find(({id:e})=>e===t.id)!==void 0:!1}isEmpty(){return this.points.length===0}getLastPoint(){return this.points.slice(-1)[0]}toJson(){return{id:this.id,lines:this.lines.map(t=>t.toJson()),visiblePanoIndexes:this.visiblePanoIndexes}}getPointByID(t){return this.points.find(({id:e})=>e===t)}fromJson(t){this.clear(),this.id=t.id;const{getPoint:e,getAllPoints:n}=r(),o=t.lines.map(a=>{const[l,c]=a.points,u=e(l),h=e(c);if(!u||!h)throw new Error("\u7EBF\u4E0A\u7684\u70B9\u4E0D\u5B58\u5728");const d=new Bt(u,h,this.model);return d.id=a.id,d.text=a.text,d}),s=n();this.points.push(...s),this.lines.push(...o),this.visiblePanoIndexes=t.visiblePanoIndexes;function r(){const a=new Map;function l(u){const h=a.get(u.id);if(h)return h;const d=new Ye(u.position);return d.id=u.id,a.set(u.id,d),d}function c(){return Array.from(a.values())}return{getPoint:l,getAllPoints:c}}return this}replace(t){this.id=t.id,this.clear(),this.lines.push(...t.lines),this.points.push(...t.points)}}const of=1,sf=3,rf=new V.Color(16777215),af=new V.Color(6522623),lf=new V.Color(16777215),cf=new V.Color(6522623),uf=6,df=8,hf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==",Ya=new V.TextureLoader().load(hf),Ua={pointTexture:Ya,pointSize:uf,lineWidth:of,lineColor:rf,pointColor:lf,lineRenderOrder:20,pointsRenderOrder:20};me(R({},Ua),{dashed:!0});const ff={pointTexture:Ya,pointSize:df,lineWidth:sf,lineColor:af,pointColor:cf,lineRenderOrder:10,pointsRenderOrder:10};function mf(i,t,e){var u,h,d,f,g;const n=(u=e==null?void 0:e.lineWidth)!=null?u:2,o=(h=e==null?void 0:e.lineColor)!=null?h:new V.Color(16777215),s=(d=e==null?void 0:e.pointSize)!=null?d:5,r=(f=e==null?void 0:e.lineRenderOrder)!=null?f:10,a=(g=e==null?void 0:e.lineRenderOrder)!=null?g:20,l=new la.Line(i,t);l.setMaterial({linewidth:n,color:o}),l.line.material.depthTest=!1,l.line.material.transparent=!0,l.line.renderOrder=r,l.points.renderOrder=a;const c=l.points.material;return c.depthTest=!1,c.size=s,e!=null&&e.pointColor&&c.color.set(e.pointColor).convertSRGBToLinear(),e!=null&&e.pointTexture&&(c.map=e.pointTexture),l}function Cs(i,t){const[e,n]=i.points,o=t==="light"?ff:Ua,s=mf(e.position,n.position,o);return s.name="normalLine_"+i.id,s}function bn(i){const{x:t,y:e,z:n}=i;return!(Math.abs(t)>1||Math.abs(e)>1||Math.abs(n)>1)}function Di(i){const{z:t}=i;return!(Math.abs(t)>1)}function pf(){const i=document.createElement("div");return i.setAttribute("style","backdrop-filter: blur(4px);-webkit-backdrop-filter: blur(4px);-webkit-tap-highlight-color: rgba(0,0,0,0);"),i.style.width="max-content",i.style.padding="3px 6px",i.style.lineHeight="1",i.style.textAlign="center",i.style.transform="translate(-50%, -50%)",i.style.borderRadius="100px",i.style.fontSize="14px",i.style.color="#fff",i.style.background="rgba(195,195,195,0.70)",i.style.border="0.5px solid rgba(255,255,255,0.6)",i.style.cursor="pointer",i}function gf(i){const t=document.createElement("div");return t.id="distance_"+i.id,t.classList.add("five-plugin-measure__distance"),t.style.opacity="0",t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.width="0",t.style.height="0",t.style.transform="translate3d(0, 0, 0)",t.style.transformOrigin="left top",t}function Af(i){let t=!0;const{line:e}=i,n=e.id,o=pf(),s=gf(e),r=i.userDistanceItem,a=new V.Vector3(0,0,0),l={lineID:n,ndcPosition:a,update:d,appendTo:f,remove:g,highlight:u,unHighlight:h,getCurrentContent:A,setItemSelectable:p};s.style.pointerEvents=t?"all":"none",r!=null&&r.element?s.appendChild(r.element):s.appendChild(o);function c(){var v;(v=i.clickCallback)==null||v.call(i,l)}function u(){if(r)return r.highlight();o.style.border="0.5px solid #95AEFF",o.style.background="linear-gradient(90deg, #95AEFF 0%, #6386FF 100%)"}function h(){if(r)return r.unHighlight();o.style.border="0.5px solid rgba(255,255,255,0.6)",o.style.background="rgba(195,195,195,0.70)"}function d(v){if(e.mesh.visible===!1){s.style.opacity="0",s.style.pointerEvents="none";return}const y=v.getElement();if(!y)return;const w=y.clientWidth,P=y.clientHeight,k=w/2,C=P/2;if(e.points.length<2)return;const[S,x]=e.points,Q=S.position.clone().project(v.camera),_=x.position.clone().project(v.camera),O=Q.clone().lerp(_,.5),U=new V.Vector2(Q.x*k,Q.y*C),j=new V.Vector2(_.x*k,_.y*C),F=U.distanceTo(j);if((()=>!(Math.abs(Q.z)>1||Math.abs(_.z)>1||!Di(Q)&&!Di(_)||!Di(O)||F===0))()===!1){s.style.opacity="0",s.style.pointerEvents="none";return}const X=(O.x+1)/2*w,G=-(O.y-1)/2*P,N=-(Math.atan((U.y-j.y)/(U.x-j.x))*180)/Math.PI,ae=s.parentElement&&o.clientWidth>F?-20:0;s.style.transform=`translate(${X}px, ${G}px) rotate(${N}deg) translateY(${ae}px)`,s.style.opacity="1",s.style.pointerEvents=t?"all":"none",r&&r.update({line:e,polyline:e.getPolyline()});const he=A();o.innerText=he}function f(v){v.appendChild(s),s.addEventListener("click",c)}function g(){o.removeEventListener("click",c),s.remove()}function A(){var S,x,Q;if(e.points.length<2)return"";const[v,y]=e.points,w=v.position.clone().distanceTo(y.position),P=(S=i.line.text)!=null?S:i.line.model.config.defaultText,k=(Q=(x=i.line.model.config)==null?void 0:x.getDistanceText)==null?void 0:Q.call(x,w),C=P!=null?P:k;return C!=null?C:w.toFixed(2)+"m"}function p(v){t=v}return l}class Bt{constructor(t,e,n){m(this,"id");m(this,"selected",!1);m(this,"text");m(this,"type","line");m(this,"model");m(this,"mesh");m(this,"points");m(this,"lightMesh");m(this,"hook");m(this,"distanceItem");m(this,"polyline");var o;if(this.id=Ge(),this.model=n,t.id===e.id)throw new Error("\u65E0\u6548\u7684\u7EBF\u6BB5, \u4E00\u4E2A\u70B9\u65E0\u6CD5\u6784\u6210\u7EBF\u6BB5");typeof n.config.defaultText=="string"&&(this.text=n.config.defaultText),this.hook=new Ce.Subscribe,this.points=[t,e],this.mesh=Cs(this,"normal"),this.lightMesh=Cs(this,"light"),this.distanceItem=Af({line:this,clickCallback:()=>this.hook.emit("selected",this),userDistanceItem:(o=this.model.config)!=null&&o.userDistanceItemCreator?this.model.config.userDistanceItemCreator():void 0}),t.lines.push(this),e.lines.push(this)}clear(){this.selected=!1,this.polyline=void 0}isEmpty(){return this.points.length===0}getPolyline(){if(this.polyline)return this.polyline;const t=this.model.polylines.find(e=>e.lines.includes(this));if(t)return this.polyline=t,t}findAnotherPoint(t){return this.points.find(({id:e})=>e!==t.id)}setText(t){this.text=t,this.hook.emit("textChanged",t)}toJson(){return{id:this.id,points:this.points.map(t=>t.toJson()),text:this.text}}clone(){const t=new Bt(this.points[0].clone(),this.points[1].clone(),this.model);return t.text=this.text,t}}class fi{constructor(t){m(this,"config");m(this,"polylines",[]);m(this,"hook",new Ce.Subscribe);this.config=t}addPolyline(t){if(this.includes(t)){console.error(new Error("\u4E0D\u80FD\u91CD\u590D\u6DFB\u52A0 polyline"));return}this.polylines.push(t),this.hook.emit("polylineAdded",t)}replacePolylineByID(t,e){const n=this.getPolylineByID(t);n==null||n.replace(e)}removePolyline(t){const e=this.polylines.findIndex(({id:n})=>n===t.id);if(e===-1){console.error(new Error("polyline \u4E0D\u5B58\u5728"));return}this.polylines.splice(e,1),this.hook.emit("polylineRemoved",t)}getPolylineByID(t){return this.polylines.find(e=>e.id===t)}getPolylineByLine(t){return this.polylines.find(e=>e.includes(t))}getLineByID(t){return this.getAllLines().find(e=>e.id===t)}getAllLines(){return this.polylines.map(t=>t.lines).flat(1)}getAllPoints(){return this.polylines.map(t=>t.points).flat(1)}includes(t){return this.polylines.find(({id:e})=>e===t.id)!==void 0}clear(){this.polylines.forEach(t=>this.hook.emit("polylineRemoved",t)),this.polylines.splice(0,this.polylines.length)}getClosestPoint(){}parse(t){this.clear(),this.polylines.push(...t.polylines.map(e=>new hi({model:this}).fromJson(e))),this.polylines.forEach(e=>this.hook.emit("polylineAdded",e))}toJson(){return{polylines:this.polylines.map(t=>t.toJson()).filter(t=>t.lines.length>0)}}}const Rn=i=>i.preventDefault();class mi{constructor(t){m(this,"model");m(this,"five");m(this,"group");m(this,"config");m(this,"dashed");m(this,"disposed",!1);m(this,"isMobile");m(this,"mouseGroup");m(this,"container");m(this,"fiveHelper");m(this,"hook");m(this,"magnifier");m(this,"userDistanceItemCreator");m(this,"updateDistanceUI",()=>{this.dashed.distanceItem.update(this.five),this.model.getAllLines().forEach(t=>t.distanceItem.update(this.five))});var n,o;this.five=t.five,this.hook=t.hook,this.model=t.model,this.config=t.config,this.magnifier=t.magnifier,this.container=t.container,this.fiveHelper=t.fiveHelper,this.isMobile=(o=(n=t.openParams)==null?void 0:n.isMobile)!=null?o:!1,this.userDistanceItemCreator=t.userDistanceItemCreator,this.group=t.group,this.mouseGroup=t.mouseGroup,this.dashed=new Bt(new Ye([0,0,0]),new Ye([0,0,0]),this.model),this.dashed.distanceItem.setItemSelectable(!1),this.dashed.mesh.setMaterial({dashed:!0,dashScale:100}),this.dashed.mesh.name="dashLine";const e=this.five.getElement();e&&(e.addEventListener("touchstart",Rn),e.addEventListener("contextmenu",Rn))}removeLine(t){this.group.remove(t.mesh,t.lightMesh),t.distanceItem.remove(),this.five.needsRender=!0}updateMouseGroup(t,e){if(!t)return this.mouseGroup;const n=this.fiveHelper.getAdsorbentPoint(t),o=n||t.point;if(this.mouseGroup.position.copy(o),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const r=t.face.normal.clone().multiplyScalar(.05),l=t.point.clone().add(r).clone().add(r);this.mouseGroup.lookAt(l)}return this.mouseGroup}dispose(){this.disposed=!0,this.magnifier.disable(),this.model.getAllLines().forEach(e=>this.removeLine(e));const t=this.five.getElement();t&&(t.removeEventListener("touchstart",Rn),t.removeEventListener("contextmenu",Rn))}}function Xi(i){const{x:t,y:e}=i.center,{clientWidth:n,clientHeight:o}=i.target,s=i.target.getBoundingClientRect(),r=new V.Vector2(t,e).sub(new V.Vector2(s.left,s.top)),a=new V.Vector2(r.x/n*2-1,-(r.y/o)*2+1);return{point:r,ndcPoint:a}}function Li(i,t){const e=Xi(t).ndcPoint,n=new V.Raycaster;return n.setFromCamera(e,i.camera),i.model.intersectRaycaster(n)}class On extends mi{constructor(e){var o;super(e);m(this,"type","edit");m(this,"polyline");m(this,"pressPoint");m(this,"hasAppendDashed",!1);m(this,"hasAppendMouseGroup",!1);m(this,"fiveElement");m(this,"lastPoint",null);m(this,"hammer");m(this,"onIntersectionUpdate",fo((e,n)=>{var s;this.hasAppendMouseGroup===!1&&(this.group.add(this.mouseGroup),this.magnifier.appendTo(this.container),this.magnifier.enable(),this.hasAppendMouseGroup=!0);const o=this.updateMouseGroup(e,n).position;(s=this.pressPoint)==null||s.position.copy(o),this.updateDashed(),requestAnimationFrame(()=>this.magnifier.renderWithPoint(this.mouseGroup.position)),this.five.needsRender=!0},20));m(this,"revoke",()=>{if(this.polyline.lines.length===0&&this.lastPoint){this.lastPoint=null,this.hasAppendDashed=!1,this.dashed.distanceItem.remove(),this.group.remove(this.dashed.mesh),this.hook.emit("anchorChange",null),this.hook.emit("editedDashedLineChange",null),this.five.needsRender=!0;return}if(this.polyline.lines.length===0&&!this.lastPoint||!this.lastPoint)return;const e=this.polyline.lines[this.polyline.lines.length-1],n=e.findAnotherPoint(this.lastPoint);!n||(this.lastPoint=n,this.hook.emit("anchorChange",n.position),this.group.remove(e.mesh),this.polyline.removeLine(e),this.hasAppendMouseGroup=!1,this.mouseGroup.position.copy(this.lastPoint.position),this.group.remove(this.mouseGroup),e.distanceItem.remove(),this.updateDashed(),this.magnifier.disable(),this.five.needsRender=!0)});m(this,"onMouseLeave",()=>{this.magnifier.disable(),this.group.remove(this.mouseGroup),this.hasAppendMouseGroup=!1,this.lastPoint&&(this.mouseGroup.position.copy(this.lastPoint.position),this.updateDashed())});m(this,"onLineChanged",()=>{this.hook.emit("editedPolylineChange",this.polyline)});m(this,"onPress",e=>{const[n]=Li(this.five,e);if(!(n!=null&&n.face))return;const o=new Ye(n.point);this.pressPoint=o,this.onIntersectionUpdate(n)});m(this,"onPan",e=>{if(!this.pressPoint)return;const[n]=Li(this.five,e);!(n!=null&&n.face)||this.onIntersectionUpdate(n)});m(this,"onPanEnd",e=>{!this.pressPoint||this.onTap(e)});m(this,"onTap",e=>{this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh)),this.hasAppendDashed=!0;const[n]=Li(this.five,e);this.updateMouseGroup(n);const o=new Ye(this.mouseGroup.position),s=this.lastPoint;if(o&&(this.lastPoint=o),o&&s){const r=new Bt(s,o,this.model);r.distanceItem.setItemSelectable(!1),r.distanceItem.appendTo(this.container),this.polyline.addLine(r),this.group.add(r.mesh),r.distanceItem.update(this.five)}this.pressPoint=void 0,this.hasAppendMouseGroup=!1,this.magnifier.disable(),this.group.remove(this.mouseGroup),this.updateDashed(),this.five.needsRender=!0,this.hook.emit("anchorChange",o.position)});m(this,"onWantsTapGesture",()=>!1);m(this,"onWantsToMoveToPano",()=>!1);m(this,"onWantsPanGesture",()=>this.pressPoint?!1:void 0);m(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});m(this,"updateDashed",()=>{!this.lastPoint||(this.dashed.points[0].position.copy(this.lastPoint.position),this.dashed.points[1].position.copy(this.mouseGroup.position),this.dashed.mesh.setPoints(this.lastPoint.position,this.mouseGroup.position),this.dashed.distanceItem.update(this.five),this.hook.emit("editedDashedLineChange",this.dashed))});this.model=new fi(this.config),this.polyline=new hi({model:this.model}),this.model.addPolyline(this.polyline),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsPanGesture",this.onWantsPanGesture),this.five.on("wantsTapGesture",this.onWantsTapGesture),this.five.on("wantsToMoveToPano",this.onWantsToMoveToPano),this.five.on("intersectionOnModelUpdate",this.onIntersectionUpdate),this.polyline.hook.on("lineAdded",this.onLineChanged),this.polyline.hook.on("lineRemoved",this.onLineChanged);const n=this.five.getElement();if(n){this.fiveElement=n;const s=new yn.default(n);this.hammer=s,s.on("tap",this.onTap),s.on("pan",this.onPan),s.on("press",this.onPress),s.on("panend",this.onPanEnd)}this.five.helperVisible=!1,(o=this.fiveElement)==null||o.addEventListener("mouseleave",this.onMouseLeave),this.hook.emit("anchorChange",null),this.hook.emit("editedDashedLineChange",null),this.five.refresh()}dispose(){var e,n;super.dispose(),this.five.helperVisible=!0,this.group.remove(this.mouseGroup,this.dashed.mesh),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsPanGesture",this.onWantsPanGesture),this.five.off("wantsTapGesture",this.onWantsTapGesture),this.five.off("wantsToMoveToPano",this.onWantsToMoveToPano),this.five.off("intersectionOnModelUpdate",this.onIntersectionUpdate),this.polyline.hook.off("lineAdded",this.onLineChanged),this.polyline.hook.off("lineRemoved",this.onLineChanged),(e=this.hammer)==null||e.destroy(),(n=this.fiveElement)==null||n.removeEventListener("mouseleave",this.onMouseLeave),this.magnifier.dispose(),this.dashed.distanceItem.remove(),this.five.needsRender=!0}getEditingLines(){return this.polyline.lines}}class Ps extends mi{constructor(e){super(e);m(this,"type","view");m(this,"hammer");m(this,"polylineRemoved",e=>{e.lines.forEach(n=>this.removeLine(n)),this.hook.emit("selectedChange",this.model.getAllLines().filter(n=>n.selected).map(n=>n))});m(this,"polylineAdded",e=>{const n=this.five.getCurrentState().panoIndex;e.lines.forEach(o=>{e.visiblePanoIndexes&&!e.visiblePanoIndexes.includes(n)&&(o.mesh.visible=!1),o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),this.group.add(o.mesh)})});m(this,"onCameraUpdate",()=>{this.updateDistanceUI()});m(this,"onFivePanoWillArrive",e=>{this.model.polylines.forEach(n=>{!n.visiblePanoIndexes||n.visiblePanoIndexes.includes(e)||n.lines.forEach(o=>{o.mesh.visible=!1,o.distanceItem.update(this.five)})})});m(this,"onFivePanoArrived",e=>{this.model.polylines.forEach(n=>{!n.visiblePanoIndexes||n.visiblePanoIndexes.includes(e)&&n.lines.forEach(o=>{o.mesh.visible=!0,o.distanceItem.update(this.five)})})});this.model.getAllLines().forEach(o=>{o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),this.group.add(o.mesh)});const n=this.five.getElement();if(n){const o=new yn.default(n);this.hammer=o}this.onFivePanoWillArrive(this.five.getCurrentState().panoIndex),this.onFivePanoArrived(this.five.getCurrentState().panoIndex),this.updateDistanceUI(),this.five.needsRender=!0,this.model.hook.on("polylineAdded",this.polylineAdded),this.model.hook.on("polylineRemoved",this.polylineRemoved),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive)}dispose(){var e;super.dispose(),this.model.hook.off("polylineAdded",this.polylineAdded),this.model.hook.off("polylineRemoved",this.polylineRemoved),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.needsRender=!0,this.hook.emit("selectedChange",[]),(e=this.hammer)==null||e.destroy()}}const vf=`
|
|
209
209
|
<svg class="fpm__delete-icon" width="16px" height="17px" viewBox="0 0 16 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
210
210
|
<defs>
|
|
211
211
|
<linearGradient x1="22.185491%" y1="100%" x2="66.8316686%" y2="6.67239121%" id="linearGradient-1">
|
|
@@ -294,7 +294,7 @@ void main() {
|
|
|
294
294
|
float match = 1.0 - uv.x;
|
|
295
295
|
gl_FragColor = vec4(1.0,1.0,1.0,match);
|
|
296
296
|
}
|
|
297
|
-
`;function Ka(i){var v,y;const t=(v=i.isMobile)!=null?v:!0,e=(y=i.useNormalVector)!=null?y:!0;let n=10349931;e&&i.ballColor>=0&&(n=i.ballColor);const o=new V.Group,s=new V.PlaneGeometry(.3,.3),r=t?Df:Lf,a=new V.TextureLoader().load(r);a.encoding=V.sRGBEncoding;const l=new V.MeshBasicMaterial({map:a,transparent:!0,depthTest:!1}),c=new V.Mesh(s,l),u=new V.CurvePath;u.add(new V.LineCurve3(new V.Vector3(0,0,0),new V.Vector3(0,0,.1)));const h=new V.TubeGeometry(u,8,.003),d=new V.ShaderMaterial({vertexShader:Sf,fragmentShader:Mf,depthTest:!1,transparent:!0}),f=new V.Mesh(h,d),g=new V.SphereGeometry(.01,20,20),A=new V.MeshBasicMaterial({color:n,depthTest:!1,transparent:!0,side:V.DoubleSide}),p=new V.Mesh(g,A);return p.position.set(0,0,.1),o.name="mouse-current",o.add(c),e&&o.add(f,p),o}class Tf{constructor(t){m(this,"container",document.createElement("div"));m(this,"five");m(this,"group");m(this,"mouseGroup");m(this,"hasAppendMouseGroup",!1);m(this,"fiveHelper");m(this,"hook");m(this,"content");m(this,"intersectMesh");m(this,"centerMouseXY");m(this,"raycaster",new V.Raycaster);m(this,"pieceStyl",{matrix3d:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],scale:1,opacity:.4});m(this,"onCameraDirectionUpdate",()=>{const t=this.getIntersection();if(t){this.pieceChange(t),this.updateMouseGroup(t);const e=new Ye(this.mouseGroup.position);this.hook.emit("nowPointChange",e)}});m(this,"onWillChangeState",(t,e)=>{var o;this.dotAnimation();const n=(o=this.getIntersection())==null?void 0:o.point;!n||(e==="editing"?this.hook.emit("getStartPoint",new Ye(n)):this.hook.emit("getEndPoint",new Ye(n)))});m(this,"computedCenterMouseXY",()=>{const t=this.container.querySelector(".range-piece__aim");if(!t)return null;const{left:e,top:n,width:o,height:s}=t.getBoundingClientRect(),r=Math.round(e+o/2),a=Math.round(n+s/2),c=xf({x:r,y:a},this.five.getElement());this.centerMouseXY=c});m(this,"getIntersection",()=>{if(!this.centerMouseXY)return null;this.raycaster.setFromCamera(this.centerMouseXY,this.five.camera);const t=this.five.model.intersectRaycaster(this.raycaster)[0];return t||null});this.five=t.five,this.hook=t.hook,this.group=t.group,this.mouseGroup=Ka(O({isMobile:!0},t.openParams.crossHairParameter)),this.fiveHelper=t.fiveHelper,this.container.innerHTML=Ef,this.container.classList.add("range-piece-controller"),this.content=this.container.querySelector(".range-piece__content"),this.content&&(this.content.style.transform=`matrix3d(${this.pieceStyl.matrix3d.toString()}) scale(${this.pieceStyl.scale})`,this.content.style.opacity=`${this.pieceStyl.opacity}`),t.container.append(this.container),this.intersectMesh=new V.Mesh(new V.RingGeometry(.04,.08,32),new V.MeshBasicMaterial({color:1245179,opacity:0,side:V.DoubleSide,transparent:!0})),this.container.addEventListener("animationend",this.computedCenterMouseXY),this.five.on("cameraUpdate",this.onCameraDirectionUpdate),this.hook.on("willChangeState",this.onWillChangeState)}dispose(){this.container.removeEventListener("animationend",this.computedCenterMouseXY),this.five.off("cameraUpdate",this.onCameraDirectionUpdate),this.hook.off("willChangeState",this.onWillChangeState),this.container.remove(),this.group.remove(this.mouseGroup),this.mouseGroup.remove(),this.hasAppendMouseGroup=!1,this.five.scene.remove(this.intersectMesh)}pieceChange(t){const e=t.face,n=t.point;if(e&&n){const s=e.normal.clone().clone().multiplyScalar(.05),r=n.clone().add(s);this.intersectMesh.position.copy(r);const a=r.clone().add(s);this.intersectMesh.lookAt(a),this.five.scene.add(this.intersectMesh);const l=this.intersectMesh.modelViewMatrix.clone().toArray();this.changePieceStyl("matrix3d",l);const c=this.calculateSize(n);this.changePieceStyl("scale",c)}}calculateSize(t){if(!t)return;const e=this.five.camera.position;let n=t.distanceTo(e);const o=4,s=1;return n>o&&(n=o),n<s&&(n=s),-.51/(o-s)*n+1}dotAnimation(){const t=pn.default.Easing.Quadratic.InOut,e={opacity:.4,scale:this.pieceStyl.scale},n={opacity:[1,.4],scale:[this.pieceStyl.scale*.8,this.pieceStyl.scale]};let o=If;const s=new pn.default.Tween(e).to(n,500).easing(t).start(0).onUpdate(({opacity:r,scale:a})=>{this.changePieceStyl("scale",a),this.changePieceStyl("opacity",r)}).onComplete(()=>{o()});o=Pn(r=>{s.update(r)})}changePieceStyl(t,e){!this.content||(this.pieceStyl[t]=e,this.content.style.transform=`matrix3d(${this.pieceStyl.matrix3d.toString()}) scale(${this.pieceStyl.scale})`,this.content.style.opacity=`${this.pieceStyl.opacity}`)}updateMouseGroup(t,e){if(!this.hasAppendMouseGroup){this.group.add(this.mouseGroup),this.hasAppendMouseGroup=!0;const n=this.container.querySelector(".range-piece__aim");n&&(n.style.opacity="0")}if(!t)return this.mouseGroup;if(this.mouseGroup.position.copy(t.point),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const o=t.face.normal.clone().multiplyScalar(.05),r=t.point.clone().add(o).clone().add(o);this.mouseGroup.lookAt(r)}return this.mouseGroup}}class rn extends mi{constructor(e){super(e);m(this,"state","watching");m(this,"polyline");m(this,"hasAppendDashed",!1);m(this,"mobileStartPoint",null);m(this,"mobileNowPoint",null);m(this,"highlightedLines",[]);m(this,"deleteDom");m(this,"rangePieceController");m(this,"disposers",[]);m(this,"onLineChanged",()=>{this.hook.emit("editedPolylineChange",this.polyline)});m(this,"onWantsTapGesture",e=>{if(this.state==="editing")return!1;const[n]=this.five.model.intersectRaycaster(e);if(!n)return;const o=this.five.camera,s=n.point.clone().project(o),r=this.container.clientWidth,a=this.container.clientHeight,l=new V.Vector2(s.x*r,s.y*a),c=this.polyline.lines.map(f=>{const[g,A]=f.points,p=g.position.clone().project(o),v=A.position.clone().project(o);if(!bn(p)&&!bn(v))return null;const y=new V.Vector2(p.x*r,p.y*a),w=new V.Vector2(v.x*r,v.y*a);return{id:f.id,points:[y,w]}}).filter(f=>!!f);if(c.length===0)return;const h=c.map(f=>{const g=Ja(l,f.points);return{id:f.id,distance:g.distanceTo(l)}}).sort((f,g)=>f.distance-g.distance)[0];if(h.distance>20)return;const d=this.polyline.lines.find(({id:f})=>f===h.id);if(!!d)return this.chooseLine(d),!1});m(this,"onWantsToMoveToPano",()=>this.state==="watching");m(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});m(this,"updateMobileDashed",()=>{!this.mobileStartPoint||!this.mobileNowPoint||(this.dashed.points[0].position.copy(this.mobileStartPoint.position),this.dashed.points[1].position.copy(this.mobileNowPoint.position),this.dashed.mesh.setPoints(this.mobileStartPoint.position,this.mobileNowPoint.position),this.dashed.distanceItem.update(this.five),this.hook.emit("editedDashedLineChange",this.dashed))});m(this,"updateMagnifier",e=>{this.magnifier.containerDom!==this.container&&this.magnifier.appendTo(this.container),this.magnifier.getCurrentState().enabled||this.magnifier.enable(),requestAnimationFrame(()=>this.magnifier.renderWithPoint(e.position)),this.five.needsRender=!0});m(this,"onGetStartPoint",e=>{this.mobileStartPoint=e});m(this,"onGetEndPoint",e=>{const n=this.mobileNowPoint;if(this.removeLine(this.dashed),this.hasAppendDashed=!1,this.mobileStartPoint&&n){const o=new Bt(this.mobileStartPoint,n,this.model);o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),o.hook.on("selected",this.chooseLine),this.disposers.push(()=>o.hook.off("selected",this.chooseLine)),this.group.add(o.mesh),this.polyline.addLine(o)}this.mobileStartPoint=null,this.mobileNowPoint=null,this.five.needsRender=!0});m(this,"onNowPointChange",e=>{if(this.state==="watching"){this.mobileNowPoint=e,this.updateMagnifier(e);return}this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh),this.hasAppendDashed=!0),this.five.needsRender=!0,this.mobileNowPoint=e,this.updateMobileDashed(),this.updateMagnifier(e),this.five.needsRender=!0});m(this,"onWillChangeState",(e,n)=>{this.state=n,this.state==="watching"?this.five.helperVisible=!0:this.five.helperVisible=!1});m(this,"chooseLine",e=>{const n=Yi(e);this.highlightLines(n),this.five.needsRender=!0,this.hook.emit("selectedChange",n.map(o=>o))});m(this,"deleteDomClickCallback",()=>{this.highlightedLines.forEach(e=>{this.removeLine(e),this.polyline.removeLine(e)}),this.highlightedLines=[],this.deleteDom.setLines([]).hide()});m(this,"cancelDeleteClickCallback",()=>{this.clearHighlightLines()});this.model=new fi(this.config),this.polyline=new hi({model:this.model}),this.model.addPolyline(this.polyline),this.rangePieceController=new Tf(e),this.deleteDom=new qa(this.five,{onClick:this.deleteDomClickCallback,cancelDelete:this.cancelDeleteClickCallback}).appendTo(this.container),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsTapGesture",this.onWantsTapGesture),this.five.on("wantsToMoveToPano",this.onWantsToMoveToPano),this.polyline.hook.on("lineAdded",this.onLineChanged),this.polyline.hook.on("lineRemoved",this.onLineChanged),this.five.helperVisible=!1,this.hook.emit("editedDashedLineChange",null),this.hook.on("getStartPoint",this.onGetStartPoint),this.hook.on("getEndPoint",this.onGetEndPoint),this.hook.on("nowPointChange",this.onNowPointChange),this.hook.on("willChangeState",this.onWillChangeState),this.five.refresh()}dispose(){super.dispose(),this.disposers.forEach(e=>e()),this.five.helperVisible=!0,this.rangePieceController.dispose(),this.group.remove(this.mouseGroup,this.dashed.mesh),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsTapGesture",this.onWantsTapGesture),this.five.off("wantsToMoveToPano",this.onWantsToMoveToPano),this.polyline.hook.off("lineAdded",this.onLineChanged),this.polyline.hook.off("lineRemoved",this.onLineChanged),this.hook.off("getStartPoint",this.onGetStartPoint),this.hook.off("getEndPoint",this.onGetEndPoint),this.hook.off("nowPointChange",this.onNowPointChange),this.hook.off("willChangeState",this.onWillChangeState),this.hook.emit("selectedChange",[]),this.dashed.distanceItem.remove(),this.five.needsRender=!0}highlightLine(e){e.selected||(e.selected=!0,this.group.add(e.lightMesh),e.distanceItem.highlight(),this.five.needsRender=!0)}clearHighlightLines(){this.group.children.length!==0&&(this.deleteDom.setLines([]).hide(),this.polyline.lines.forEach(e=>{e.selected=!1,e.distanceItem.unHighlight(),this.group.remove(e.lightMesh)}),this.highlightedLines=[],this.five.needsRender=!0)}getEditingLines(){return this.polyline.lines}addStartPoint(){}highlightLines(e){this.clearHighlightLines(),this.highlightedLines=e,this.deleteDom.setLines(e).updatePosition().show(),e.forEach(n=>this.highlightLine(n))}}const $a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNzIiIGhlaWdodD0iNzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxmaWx0ZXIgeD0iLTUuMyUiIHk9Ii01LjMlIiB3aWR0aD0iMTEwLjUlIiBoZWlnaHQ9IjExMC41JSIgZmlsdGVyVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiBpZD0icHJlZml4X19hIj48ZmVPZmZzZXQgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSIvPjxmZUdhdXNzaWFuQmx1ciBzdGREZXZpYXRpb249IjEiIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSIvPjxmZUNvbXBvc2l0ZSBpbj0ic2hhZG93Qmx1ck91dGVyMSIgaW4yPSJTb3VyY2VBbHBoYSIgb3BlcmF0b3I9Im91dCIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIi8+PGZlQ29sb3JNYXRyaXggdmFsdWVzPSIwIDAgMCAwIDEgMCAwIDAgMCAxIDAgMCAwIDAgMSAwIDAgMCAwLjUgMCIgaW49InNoYWRvd0JsdXJPdXRlcjEiLz48L2ZpbHRlcj48ZmlsdGVyIHg9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ggMCAzMS41NTYgMTQuMTI4IDMxLjU1NiAzMS41NTZTNTMuNDI4IDY3LjU1NiAzNiA2Ny41NTYgNC40NDQgNTMuNDI4IDQuNDQ0IDM2IDE4LjU3MiA0LjQ0NCAzNiA0LjQ0NHoiIGZpbGw9InVybCgjcHJlZml4X19kKSIgZmlsbC1ydWxlPSJub256ZXJvIi8+PC9nPjwvc3ZnPg==",zf=`
|
|
297
|
+
`;function Ka(i){var v,y;const t=(v=i.isMobile)!=null?v:!0,e=(y=i.useNormalVector)!=null?y:!0;let n=10349931;e&&i.ballColor>=0&&(n=i.ballColor);const o=new V.Group,s=new V.PlaneGeometry(.3,.3),r=t?Df:Lf,a=new V.TextureLoader().load(r);a.encoding=V.sRGBEncoding;const l=new V.MeshBasicMaterial({map:a,transparent:!0,depthTest:!1}),c=new V.Mesh(s,l),u=new V.CurvePath;u.add(new V.LineCurve3(new V.Vector3(0,0,0),new V.Vector3(0,0,.1)));const h=new V.TubeGeometry(u,8,.003),d=new V.ShaderMaterial({vertexShader:Sf,fragmentShader:Mf,depthTest:!1,transparent:!0}),f=new V.Mesh(h,d),g=new V.SphereGeometry(.01,20,20),A=new V.MeshBasicMaterial({color:n,depthTest:!1,transparent:!0,side:V.DoubleSide}),p=new V.Mesh(g,A);return p.position.set(0,0,.1),o.name="mouse-current",o.add(c),e&&o.add(f,p),o}class Tf{constructor(t){m(this,"container",document.createElement("div"));m(this,"five");m(this,"group");m(this,"mouseGroup");m(this,"hasAppendMouseGroup",!1);m(this,"fiveHelper");m(this,"hook");m(this,"content");m(this,"intersectMesh");m(this,"centerMouseXY");m(this,"raycaster",new V.Raycaster);m(this,"pieceStyl",{matrix3d:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],scale:1,opacity:.4});m(this,"onCameraDirectionUpdate",()=>{const t=this.getIntersection();if(t){this.pieceChange(t),this.updateMouseGroup(t);const e=new Ye(this.mouseGroup.position);this.hook.emit("nowPointChange",e)}});m(this,"onWillChangeState",(t,e)=>{var o;this.dotAnimation();const n=(o=this.getIntersection())==null?void 0:o.point;!n||(e==="editing"?this.hook.emit("getStartPoint",new Ye(n)):this.hook.emit("getEndPoint",new Ye(n)))});m(this,"computedCenterMouseXY",()=>{const t=this.container.querySelector(".range-piece__aim");if(!t)return null;const{left:e,top:n,width:o,height:s}=t.getBoundingClientRect(),r=Math.round(e+o/2),a=Math.round(n+s/2),c=xf({x:r,y:a},this.five.getElement());this.centerMouseXY=c});m(this,"getIntersection",()=>{if(!this.centerMouseXY)return null;this.raycaster.setFromCamera(this.centerMouseXY,this.five.camera);const t=this.five.model.intersectRaycaster(this.raycaster)[0];return t||null});this.five=t.five,this.hook=t.hook,this.group=t.group,this.mouseGroup=Ka(R({isMobile:!0},t.openParams.crossHairParameter)),this.fiveHelper=t.fiveHelper,this.container.innerHTML=Ef,this.container.classList.add("range-piece-controller"),this.content=this.container.querySelector(".range-piece__content"),this.content&&(this.content.style.transform=`matrix3d(${this.pieceStyl.matrix3d.toString()}) scale(${this.pieceStyl.scale})`,this.content.style.opacity=`${this.pieceStyl.opacity}`),t.container.append(this.container),this.intersectMesh=new V.Mesh(new V.RingGeometry(.04,.08,32),new V.MeshBasicMaterial({color:1245179,opacity:0,side:V.DoubleSide,transparent:!0})),this.container.addEventListener("animationend",this.computedCenterMouseXY),this.five.on("cameraUpdate",this.onCameraDirectionUpdate),this.hook.on("willChangeState",this.onWillChangeState)}dispose(){this.container.removeEventListener("animationend",this.computedCenterMouseXY),this.five.off("cameraUpdate",this.onCameraDirectionUpdate),this.hook.off("willChangeState",this.onWillChangeState),this.container.remove(),this.group.remove(this.mouseGroup),this.mouseGroup.remove(),this.hasAppendMouseGroup=!1,this.five.scene.remove(this.intersectMesh)}pieceChange(t){const e=t.face,n=t.point;if(e&&n){const s=e.normal.clone().clone().multiplyScalar(.05),r=n.clone().add(s);this.intersectMesh.position.copy(r);const a=r.clone().add(s);this.intersectMesh.lookAt(a),this.five.scene.add(this.intersectMesh);const l=this.intersectMesh.modelViewMatrix.clone().toArray();this.changePieceStyl("matrix3d",l);const c=this.calculateSize(n);this.changePieceStyl("scale",c)}}calculateSize(t){if(!t)return;const e=this.five.camera.position;let n=t.distanceTo(e);const o=4,s=1;return n>o&&(n=o),n<s&&(n=s),-.51/(o-s)*n+1}dotAnimation(){const t=pn.default.Easing.Quadratic.InOut,e={opacity:.4,scale:this.pieceStyl.scale},n={opacity:[1,.4],scale:[this.pieceStyl.scale*.8,this.pieceStyl.scale]};let o=If;const s=new pn.default.Tween(e).to(n,500).easing(t).start(0).onUpdate(({opacity:r,scale:a})=>{this.changePieceStyl("scale",a),this.changePieceStyl("opacity",r)}).onComplete(()=>{o()});o=Pn(r=>{s.update(r)})}changePieceStyl(t,e){!this.content||(this.pieceStyl[t]=e,this.content.style.transform=`matrix3d(${this.pieceStyl.matrix3d.toString()}) scale(${this.pieceStyl.scale})`,this.content.style.opacity=`${this.pieceStyl.opacity}`)}updateMouseGroup(t,e){if(!this.hasAppendMouseGroup){this.group.add(this.mouseGroup),this.hasAppendMouseGroup=!0;const n=this.container.querySelector(".range-piece__aim");n&&(n.style.opacity="0")}if(!t)return this.mouseGroup;if(this.mouseGroup.position.copy(t.point),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const o=t.face.normal.clone().multiplyScalar(.05),r=t.point.clone().add(o).clone().add(o);this.mouseGroup.lookAt(r)}return this.mouseGroup}}class rn extends mi{constructor(e){super(e);m(this,"state","watching");m(this,"polyline");m(this,"hasAppendDashed",!1);m(this,"mobileStartPoint",null);m(this,"mobileNowPoint",null);m(this,"highlightedLines",[]);m(this,"deleteDom");m(this,"rangePieceController");m(this,"disposers",[]);m(this,"onLineChanged",()=>{this.hook.emit("editedPolylineChange",this.polyline)});m(this,"onWantsTapGesture",e=>{if(this.state==="editing")return!1;const[n]=this.five.model.intersectRaycaster(e);if(!n)return;const o=this.five.camera,s=n.point.clone().project(o),r=this.container.clientWidth,a=this.container.clientHeight,l=new V.Vector2(s.x*r,s.y*a),c=this.polyline.lines.map(f=>{const[g,A]=f.points,p=g.position.clone().project(o),v=A.position.clone().project(o);if(!bn(p)&&!bn(v))return null;const y=new V.Vector2(p.x*r,p.y*a),w=new V.Vector2(v.x*r,v.y*a);return{id:f.id,points:[y,w]}}).filter(f=>!!f);if(c.length===0)return;const h=c.map(f=>{const g=Ja(l,f.points);return{id:f.id,distance:g.distanceTo(l)}}).sort((f,g)=>f.distance-g.distance)[0];if(h.distance>20)return;const d=this.polyline.lines.find(({id:f})=>f===h.id);if(!!d)return this.chooseLine(d),!1});m(this,"onWantsToMoveToPano",()=>this.state==="watching");m(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});m(this,"updateMobileDashed",()=>{!this.mobileStartPoint||!this.mobileNowPoint||(this.dashed.points[0].position.copy(this.mobileStartPoint.position),this.dashed.points[1].position.copy(this.mobileNowPoint.position),this.dashed.mesh.setPoints(this.mobileStartPoint.position,this.mobileNowPoint.position),this.dashed.distanceItem.update(this.five),this.hook.emit("editedDashedLineChange",this.dashed))});m(this,"updateMagnifier",e=>{this.magnifier.containerDom!==this.container&&this.magnifier.appendTo(this.container),this.magnifier.getCurrentState().enabled||this.magnifier.enable(),requestAnimationFrame(()=>this.magnifier.renderWithPoint(e.position)),this.five.needsRender=!0});m(this,"onGetStartPoint",e=>{this.mobileStartPoint=e});m(this,"onGetEndPoint",e=>{const n=this.mobileNowPoint;if(this.removeLine(this.dashed),this.hasAppendDashed=!1,this.mobileStartPoint&&n){const o=new Bt(this.mobileStartPoint,n,this.model);o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),o.hook.on("selected",this.chooseLine),this.disposers.push(()=>o.hook.off("selected",this.chooseLine)),this.group.add(o.mesh),this.polyline.addLine(o)}this.mobileStartPoint=null,this.mobileNowPoint=null,this.five.needsRender=!0});m(this,"onNowPointChange",e=>{if(this.state==="watching"){this.mobileNowPoint=e,this.updateMagnifier(e);return}this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh),this.hasAppendDashed=!0),this.five.needsRender=!0,this.mobileNowPoint=e,this.updateMobileDashed(),this.updateMagnifier(e),this.five.needsRender=!0});m(this,"onWillChangeState",(e,n)=>{this.state=n,this.state==="watching"?this.five.helperVisible=!0:this.five.helperVisible=!1});m(this,"chooseLine",e=>{const n=Yi(e);this.highlightLines(n),this.five.needsRender=!0,this.hook.emit("selectedChange",n.map(o=>o))});m(this,"deleteDomClickCallback",()=>{this.highlightedLines.forEach(e=>{this.removeLine(e),this.polyline.removeLine(e)}),this.highlightedLines=[],this.deleteDom.setLines([]).hide()});m(this,"cancelDeleteClickCallback",()=>{this.clearHighlightLines()});this.model=new fi(this.config),this.polyline=new hi({model:this.model}),this.model.addPolyline(this.polyline),this.rangePieceController=new Tf(e),this.deleteDom=new qa(this.five,{onClick:this.deleteDomClickCallback,cancelDelete:this.cancelDeleteClickCallback}).appendTo(this.container),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsTapGesture",this.onWantsTapGesture),this.five.on("wantsToMoveToPano",this.onWantsToMoveToPano),this.polyline.hook.on("lineAdded",this.onLineChanged),this.polyline.hook.on("lineRemoved",this.onLineChanged),this.five.helperVisible=!1,this.hook.emit("editedDashedLineChange",null),this.hook.on("getStartPoint",this.onGetStartPoint),this.hook.on("getEndPoint",this.onGetEndPoint),this.hook.on("nowPointChange",this.onNowPointChange),this.hook.on("willChangeState",this.onWillChangeState),this.five.refresh()}dispose(){super.dispose(),this.disposers.forEach(e=>e()),this.five.helperVisible=!0,this.rangePieceController.dispose(),this.group.remove(this.mouseGroup,this.dashed.mesh),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsTapGesture",this.onWantsTapGesture),this.five.off("wantsToMoveToPano",this.onWantsToMoveToPano),this.polyline.hook.off("lineAdded",this.onLineChanged),this.polyline.hook.off("lineRemoved",this.onLineChanged),this.hook.off("getStartPoint",this.onGetStartPoint),this.hook.off("getEndPoint",this.onGetEndPoint),this.hook.off("nowPointChange",this.onNowPointChange),this.hook.off("willChangeState",this.onWillChangeState),this.hook.emit("selectedChange",[]),this.dashed.distanceItem.remove(),this.five.needsRender=!0}highlightLine(e){e.selected||(e.selected=!0,this.group.add(e.lightMesh),e.distanceItem.highlight(),this.five.needsRender=!0)}clearHighlightLines(){this.group.children.length!==0&&(this.deleteDom.setLines([]).hide(),this.polyline.lines.forEach(e=>{e.selected=!1,e.distanceItem.unHighlight(),this.group.remove(e.lightMesh)}),this.highlightedLines=[],this.five.needsRender=!0)}getEditingLines(){return this.polyline.lines}addStartPoint(){}highlightLines(e){this.clearHighlightLines(),this.highlightedLines=e,this.deleteDom.setLines(e).updatePosition().show(),e.forEach(n=>this.highlightLine(n))}}const $a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNzIiIGhlaWdodD0iNzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxmaWx0ZXIgeD0iLTUuMyUiIHk9Ii01LjMlIiB3aWR0aD0iMTEwLjUlIiBoZWlnaHQ9IjExMC41JSIgZmlsdGVyVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiBpZD0icHJlZml4X19hIj48ZmVPZmZzZXQgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSIvPjxmZUdhdXNzaWFuQmx1ciBzdGREZXZpYXRpb249IjEiIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSIvPjxmZUNvbXBvc2l0ZSBpbj0ic2hhZG93Qmx1ck91dGVyMSIgaW4yPSJTb3VyY2VBbHBoYSIgb3BlcmF0b3I9Im91dCIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIi8+PGZlQ29sb3JNYXRyaXggdmFsdWVzPSIwIDAgMCAwIDEgMCAwID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AwIDE2LjExOCAwIDM2czE2LjExOCAzNiAzNiAzNiAzNi0xNi4xMTggMzYtMzZTNTUuODgyIDAgMzYgMHptMCA0LjQ0NGMxNy40MjggMCAzMS41NTYgMTQuMTI4IDMxLjU1NiAzMS41NTZTNTMuNDI4IDY3LjU1NiAzNiA2Ny41NTYgNC40NDQgNTMuNDI4IDQuNDQ0IDM2IDE4LjU3MiA0LjQ0NCAzNiA0LjQ0NHoiIGZpbGw9InVybCgjcHJlZml4X19kKSIgZmlsbC1ydWxlPSJub256ZXJvIi8+PC9nPjwvc3ZnPg==",zf=`
|
|
298
298
|
<svg class="fpm__exit-icon width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
299
299
|
<defs>
|
|
300
300
|
<radialGradient cx="50%" cy="50%" fx="50%" fy="50%" r="86.3016741%" id="radialGradient-1">
|
|
@@ -494,7 +494,7 @@ void main() {
|
|
|
494
494
|
</div>
|
|
495
495
|
</div>
|
|
496
496
|
</div>
|
|
497
|
-
`,Of={display:"none",position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",transform:"translate(0, 10px)",transition:"opacity 500ms ease-in-out, transform 500ms ease-in-out"},Rf={position:"absolute",left:"50%",bottom:"32px",transform:"translateX(-50%)",height:"89px",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"14px",pointerEvents:"all",color:"#fff",zIndex:"10"},Ff={position:"absolute",bottom:"0",left:"0",opacity:"0.5",width:"100%",height:"184px",background:"linear-gradient(180deg, rgba(0,0,0,0.00) 0%, #000000 100%)",zIndex:"0"},tl={margin:"0 64px"},Hf={opacity:"0.85"},nl={width:"72px",height:"72px",backgroundSize:"100%",cursor:"pointer",transition:"all 200ms ease-in-out"},Gf={width:"24px",height:"24px",marginRight:"4px",backgroundSize:"100%",cursor:"pointer"},Wf={userSelect:"none",pointerEvents:"none"};class Nf{constructor(t,e,n){m(this,"container");m(this,"measureController");m(this,"mainElement");m(this,"_params");m(this,"_btnTexts",{start:"\u5F00\u59CB",end:"\u7ED3\u675F",revoke:"\u64A4\u9500",exit:"\u9000\u51FA"});m(this,"onMouseEnter",()=>{const{mainItem:t}=this.mainElement;t.style.opacity="1"});m(this,"onMouseLeave",()=>{const{mainItem:t}=this.mainElement;t.style.opacity="0.85"});m(this,"onClick",()=>{this.measureController.getCurrentMode()!=="Edit"?this.measureController.changeMode("Edit"):this.measureController.save().changeMode("Watch")});m(this,"modeChangeHandler",t=>{t==="Edit"?this.change2Done():this.change2Add()});var r,a,l,c;this._params=n,this._btnTexts={start:(r=this._params.startButtonText)!=null?r:this._btnTexts.start,end:(a=this._params.endButtonText)!=null?a:this._btnTexts.end,revoke:(l=this._params.revokeButtonText)!=null?l:this._btnTexts.revoke,exit:(c=this._params.exitButtonText)!=null?c:this._btnTexts.exit},this.measureController=t,this.container=e,this.mainElement=this.getMainElement(),Object.assign(this.mainElement.mainIcon.style,nl),Object.assign(this.mainElement.mainItem.style,tl);const{revokeTextDom:o,exitTextDom:s}=this._getTextElement();o&&(o.innerText=this._btnTexts.revoke),s&&(s.innerText=this._btnTexts.exit),this.change2Add(),this.measureController.hook.on("modeChange",this.modeChangeHandler),this.mainElement.mainItem.addEventListener("click",this.onClick),this.mainElement.mainItem.addEventListener("mouseenter",this.onMouseEnter),this.mainElement.mainItem.addEventListener("mouseleave",this.onMouseLeave)}dispose(){this.measureController.hook.off("modeChange",this.modeChangeHandler),this.mainElement.mainItem.removeEventListener("click",this.onClick),this.mainElement.mainItem.removeEventListener("mouseenter",this.onMouseEnter),this.mainElement.mainItem.removeEventListener("mouseleave",this.onMouseLeave)}getMainElement(){const t=this.container.querySelector(".fpm__main-text"),e=this.container.querySelector(".fpm__main"),n=this.container.querySelector(".fpm__main-icon");if(!e||!t||!n)throw new Error("cannot find dom");return{mainTextDom:t,mainItem:e,mainIcon:n}}_getTextElement(){const t=this.container.querySelector(".fpm__revoke-text"),e=this.container.querySelector(".fpm__exit-text");return{revokeTextDom:t,exitTextDom:e}}change2Add(){const{mainIcon:t,mainTextDom:e}=this.mainElement;if(t.className.includes("fpm__main__start")){e.innerText=this._btnTexts.start;return}t.className.includes("fpm__main__end")&&(t.style.transform="scale(0.8)",e.className.includes("fpm__main-text__show")?e.classList.replace("fpm__main-text__show","fpm__main-text__hide"):e.classList.add("fpm__main-text__hide"),setTimeout(()=>{t.classList.replace("fpm__main__end","fpm__main__start"),t.style.transform="scale(1)",e.innerText=this._btnTexts.start,e.classList.replace("fpm__main-text__hide","fpm__main-text__show")},200))}change2Done(){const{mainTextDom:t,mainIcon:e}=this.getMainElement();t.innerText!==this._btnTexts.end&&(e.className.includes("fpm__main__end")||e.className.includes("fpm__main__start")&&(e.style.transform="scale(0.8)",t.className.includes("fpm__main-text__show")?t.classList.replace("fpm__main-text__show","fpm__main-text__hide"):t.classList.add("fpm__main-text__hide"),setTimeout(()=>{e.classList.replace("fpm__main__start","fpm__main__end"),e.style.transform="scale(1)",t.innerText=this._btnTexts.end,t.classList.replace("fpm__main-text__hide","fpm__main-text__show")},200)))}}class _f{constructor(t,e,n){m(this,"container");m(this,"measureController");m(this,"mainElement");m(this,"_params");m(this,"_btnTexts",{start:"\u5F00\u59CB",end:"\u7ED3\u675F"});m(this,"onClick",()=>{var t;this.mainElement.mainTextDom.innerText===((t=this._params.startButtonText)!=null?t:"\u5F00\u59CB")?(this.measureController.hook.emit("willChangeState","watching","editing"),this.change2Done()):(this.measureController.hook.emit("willChangeState","editing","watching"),this.change2Add())});var o,s;this._params=n,this._btnTexts={start:(o=this._params.startButtonText)!=null?o:this._btnTexts.start,end:(s=this._params.endButtonText)!=null?s:this._btnTexts.end},this.measureController=t,this.container=e,this.mainElement=this.getMainElement(),this.mainElement.mainIcon.setAttribute("style","-webkit-tap-highlight-color: rgba(0,0,0,0);"),Object.assign(this.mainElement.mainIcon.style,nl),Object.assign(this.mainElement.mainItem.style,tl),this.change2Add(),this.mainElement.mainItem.addEventListener("click",this.onClick)}dispose(){this.mainElement.mainItem.removeEventListener("click",this.onClick)}getMainElement(){const t=this.container.querySelector(".fpm__main-text"),e=this.container.querySelector(".fpm__main"),n=this.container.querySelector(".fpm__main-icon");if(!e||!t||!n)throw new Error("cannot find dom");return{mainTextDom:t,mainItem:e,mainIcon:n}}change2Add(){const{mainIcon:t,mainTextDom:e}=this.mainElement;if(t.className.includes("fpm__main__start")){e.innerText=this._btnTexts.start;return}t.className.includes("fpm__main__end")&&(t.style.transform="scale(0.8)",e.className.includes("fpm__main-text__show")?e.classList.replace("fpm__main-text__show","fpm__main-text__hide"):e.classList.add("fpm__main-text__hide"),setTimeout(()=>{t.classList.replace("fpm__main__end","fpm__main__start"),t.style.transform="scale(1)",e.innerText=this._btnTexts.start,e.classList.replace("fpm__main-text__hide","fpm__main-text__show")},200))}change2Done(){const{mainTextDom:t,mainIcon:e}=this.mainElement;t.innerText!==this._btnTexts.end&&(e.className.includes("fpm__main__end")||e.className.includes("fpm__main__start")&&(e.style.transform="scale(0.8)",t.className.includes("fpm__main-text__show")?t.classList.replace("fpm__main-text__show","fpm__main-text__hide"):t.classList.add("fpm__main-text__hide"),setTimeout(()=>{e.classList.replace("fpm__main__start","fpm__main__end"),e.style.transform="scale(1)",t.innerText=this._btnTexts.end,t.classList.replace("fpm__main-text__hide","fpm__main-text__show")},200)))}}class Xf{constructor(t,e){m(this,"container");m(this,"revokeIcon");m(this,"revokeItem");m(this,"measureController");m(this,"onClick",()=>{this.measureController.revoke()});m(this,"onModeChange",t=>{if(t!=="Edit"&&this.revokeItem.className.includes("enabled")){this.revokeItem.classList.remove("enabled"),this.measureController.hook.off("anchorChange",this.onAnchorChange);return}this.measureController.hook.on("anchorChange",this.onAnchorChange)});m(this,"onAnchorChange",t=>{t&&this.revokeItem.classList.add("enabled")});this.measureController=t,this.container=e;const n=this.container.querySelector(".fpm__revoke-icon"),o=this.container.querySelector(".fpm__revoke");if(!n||!o)throw new Error("\u4E0D\u6B63\u786E\u7684\u9009\u62E9\u5668");this.revokeIcon=n,this.revokeItem=o,this.revokeItem.addEventListener("click",this.onClick),t.hook.on("modeChange",this.onModeChange)}dispose(){this.revokeItem.removeEventListener("click",this.onClick),this.measureController.hook.off("modeChange",this.onModeChange)}}class ks{constructor(t,e){m(this,"revoke");m(this,"container");m(this,"mainController");m(this,"disposers",[]);m(this,"measureController");m(this,"mode");m(this,"_params");m(this,"handleExit",()=>{const t=this.container.querySelector(".fpm__exit-icon"),e=this.container.querySelector(".fpm__exit");if(!e||!t)throw new Error("cannot find dom");this.mode==="pc"&&(Object.assign(e.style,Hf),Object.assign(t==null?void 0:t.style,Gf));const n=()=>{e.style.opacity="1"},o=()=>{e.style.opacity="0.85"},s=()=>{this.measureController.disable()};return e.addEventListener("click",s),e.addEventListener("mouseenter",n),e.addEventListener("mouseleave",o),()=>{e.removeEventListener("click",s),e.removeEventListener("mouseenter",n),e.removeEventListener("mouseleave",o)}});var r;this._params=e,this.measureController=t,this.mode=(r=e.mode)!=null?r:"pc",this.container=document.createElement("div"),this.container.innerHTML=this.mode==="mobile"?Bf:Qf,this.container.classList.add("fpm__ui-controller",this.mode),this.container.style.background="rgba(0, 0, 0, 0.15)",e.container.appendChild(this.container);const n=this.container.querySelectorAll(".fpm__text"),o=this.container.querySelector(".fpm_ui-bg"),s=this.container.querySelector(".fpm_operating-space");Object.assign(o==null?void 0:o.style,Ff),Object.assign(s==null?void 0:s.style,Rf),Object.assign(this.container.style,Of),n.forEach(a=>Object.assign(a.style,Wf))}dispose(){this.hide(),this.container.remove()}show(){return this.container.style.display="block",this.container.style.opacity="1",this.container.style.transform="translate(0, 0)",this.mode==="pc"?(this.revoke=new Xf(this.measureController,this.container),this.mainController=new Nf(this.measureController,this.container,this._params)):this.mainController=new _f(this.measureController,this.container,this._params),this.disposers.push(this.handleExit()),this}hide(){var t,e;return this.container.style.display="none",this.container.style.opacity="0",this.container.style.transform="translate(0, 10px)",this.mode==="pc"&&((t=this.revoke)==null||t.dispose()),(e=this.mainController)==null||e.dispose(),this.disposers.forEach(n=>n()),this.disposers=[],this}}class Yf{constructor(t,e){m(this,"measureController");m(this,"textDom",document.createElement("span"));m(this,"container",document.createElement("div"));m(this,"hasAnchor",!1);m(this,"hasChangedToWatch",!1);m(this,"_params");m(this,"onModelChange",t=>{var e;if(t==="View"){this.hide();return}if(t==="Watch"){this.hasChangedToWatch?(this.textDom.innerText="",this.hide()):(this.show(),this.hasChangedToWatch=!0);return}t==="Edit"&&(this.textDom.innerText=(e=this._params.firstPointTip)!=null?e:"\u8BF7\u9009\u62E9\u7B2C\u4E00\u4E2A\u6D4B\u91CF\u70B9\uFF0CEsc\u6216\u5355\u51FB\u9F20\u6807\u53F3\u952E\u53EF\u53D6\u6D88\u9009\u62E9",this.show())});m(this,"anchorChange",t=>{var e,n;!this.hasAnchor&&!!t?(this.hasAnchor=!0,this.textDom.innerText=(e=this._params.nextPointTip)!=null?e:"\u9009\u62E9\u4E0B\u4E00\u4E2A\u6D4B\u91CF\u70B9\uFF0CEsc\u6216\u5355\u51FB\u9F20\u6807\u53F3\u952E\u53D6\u6D88\u9009\u62E9"):t||(this.hasAnchor=!1,this.textDom.innerText=(n=this._params.firstPointTip)!=null?n:"\u8BF7\u9009\u62E9\u7B2C\u4E00\u4E2A\u6D4B\u91CF\u70B9\uFF0CEsc\u6216\u5355\u51FB\u9F20\u6807\u53F3\u952E\u53EF\u53D6\u6D88\u9009\u62E9")});m(this,"onEditedLineChange",t=>{var e;t.lines.length===1&&(this.textDom.innerText=(e=this._params.endTip)!=null?e:"\u53EF\u4EE5\u8FDE\u7EED\u9009\u62E9\u6D4B\u91CF\u70B9\uFF0C\u6216\u70B9\u51FB\u4E0B\u65B9\u201C\u7ED3\u675F\u201D\u6309\u94AE\u5B8C\u6210\u6D4B\u91CF\uFF08Esc\u53D6\u6D88\uFF0CCommand+S\u4FDD\u5B58\uFF09")});this._params=e,this.initDom(),e.container.append(this.container),this.measureController=t,t.hook.on("modeChange",this.onModelChange),t.hook.on("anchorChange",this.anchorChange),t.hook.on("editedPolylineChange",this.onEditedLineChange)}dispose(){this.hide(),this.container.remove()}show(){return this.container.style.opacity="1",this.container.style.transform="translate(0, 0)",this}hide(){return this.container.style.opacity="0",this.container.style.transform="translate(0, -10px)",this.measureController.hook.off("modeChange",this.onModelChange),this.measureController.hook.off("anchorChange",this.anchorChange),this.measureController.hook.off("editedPolylineChange",this.onEditedLineChange),this}initDom(){var n;const t=this.container,e=this.textDom;t.classList.add("fpm__guide-container"),t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.width="100%",t.style.height="110px",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.transform="translate(0, -10px)",t.style.background="linear-gradient(180deg, rgba(0,0,0,0.40) 0%, rgba(0,0,0,0.00) 100%)",t.style.transition="opacity 500ms ease-in-out, transform 500ms ease-in-out",t.style.opacity="0",e.classList.add("fpm__guide-text"),e.style.color="#fff",e.style.fontSize="20px",e.innerText=(n=this._params.startTip)!=null?n:"\u70B9\u51FB\u4E0B\u65B9\u201C\u5F00\u59CB\u201D\u6309\u94AE\u5F00\u59CB\u6D4B\u8DDD",t.appendChild(e)}}class Uf{constructor(t,e){m(this,"five");m(this,"measureController");m(this,"onKeyDown",t=>{if(t.metaKey&&t.code==="KeyS"){this.measureController.save().changeMode("Watch"),t.preventDefault();return}if(t.code==="Escape")return this.escape()});m(this,"onMouseDown",t=>{t.button===2&&(t.preventDefault(),this.escape())});this.five=e,this.measureController=t;const n=this.five.getElement();!n||(document.body.addEventListener("keydown",this.onKeyDown),n.addEventListener("mousedown",this.onMouseDown))}dispose(){const t=this.five.getElement();!t||(document.body.removeEventListener("keydown",this.onKeyDown),t.removeEventListener("mousedown",this.onMouseDown))}escape(){return this.measureController.getCurrentMode()==="Watch"?this.measureController.disable():this.measureController.changeMode("Watch")}}class qf{constructor(t,e){m(this,"hasOpen",!1);m(this,"hook",new Ce.Subscribe);m(this,"magnifier");m(this,"five");m(this,"model");m(this,"group");m(this,"config");m(this,"isMobile");m(this,"fiveHelper");m(this,"useUIController");m(this,"params");m(this,"useGuideController");m(this,"container",document.createElement("div"));m(this,"shortcutKeyController");m(this,"controller",null);m(this,"getCurrentMode",()=>this.controller instanceof Rn?"Edit":this.controller instanceof Is?"Watch":this.controller instanceof rn?"Mixed":this.controller instanceof Ps?"View":null);m(this,"changeMode",t=>{var o;if(!this.hasOpen||this.getCurrentMode()===t)return;(o=this.controller)==null||o.dispose();const e={View:Ps,Watch:Is,Edit:Rn,Mixed:rn};if(!e[t])throw new Error("\u4E0D\u5B58\u5728\u7684 Mode");const n=this.createControllerParams();this.controller=new e[t](n),this.hook.emit("modeChange",t)});var o,s,r,a;this.five=t,this.params=e,this.config=ui(e,["openParams","magnifierParams"]),this.model=new fi(this.config),this.fiveHelper=new tf(t),this.isMobile=(s=(o=e==null?void 0:e.openParams)==null?void 0:o.isMobile)!=null?s:!1,this.magnifier=new Xa(t,(r=e.magnifierParams)!=null?r:{width:190,height:190,scale:2}),this.group=new V.Group,this.group.name="plugin-measure-group",this.container.classList.add("five-plugin-measure-container"),this.container.style.position="absolute",this.container.style.left="0",this.container.style.top="0",this.container.style.pointerEvents="none",this.container.style.width="100%",this.container.style.height="100%",this.container.style.opacity="0";const n=(a=this.params.openParams)!=null?a:{};if(this.params.useUIController!==!1){const l=O({container:this.container,openParams:n},typeof this.params.useUIController=="object"?this.params.useUIController:{});this.useUIController=new ks(this,l)}if(this.params.useGuideController!==!1){const l=O({container:this.container},typeof this.params.useGuideController=="object"?this.params.useGuideController:{});this.useGuideController=new Yf(this,l)}}appendTo(t){t.append(this.container)}dispose(){var t,e;this.disable(),(t=this.useUIController)==null||t.dispose(),(e=this.magnifier)==null||e.dispose(),this.five.needsRender=!0}load(t){this.model.parse(t),this.save()}enable(t){var e;this.hasOpen||(this.hasOpen=!0,this.five.scene.add(this.group),this.container.style.opacity="1",t!=null&&t.mode?this.changeMode(t.mode):this.isMobile?this.changeMode("Mixed"):this.changeMode("Watch"),(e=this.useUIController)==null||e.show(),this.shortcutKeyController=new Uf(this,this.five),this.hook.emit("enable",!0))}disable(){var t,e,n,o;this.hasOpen=!1,this.container.style.opacity="0",(t=this.controller)==null||t.dispose(),(e=this.useUIController)==null||e.hide(),(n=this.useGuideController)==null||n.hide(),(o=this.shortcutKeyController)==null||o.dispose(),this.controller=null,this.five.helperVisible=!0,this.five.scene.remove(this.group),this.five.needsRender=!0,this.hook.emit("disable",!0)}edit(){const t=this.isMobile?"Mixed":"Edit";this.changeMode(t)}revoke(){this.controller instanceof Rn&&this.controller.revoke()}removePolyline(t){this.model.removePolyline(t)}removePolylineByID(t){const e=this.model.getPolylineByID(t);e&&this.model.removePolyline(e)}getPolylineByID(t){return this.model.getPolylineByID(t)}getEditedPolyline(){}highlightLine(t){if(this.getCurrentMode()!=="Watch")return!1;const e=this.model.getLineByID(t);return e?(this.controller.highlightLine(e),!0):!1}clearHighlightLines(){return this.getCurrentMode()!=="Watch"?!1:(this.controller.clearHighlightLines(),!0)}save(t){var o;if(!(this.controller instanceof Rn)&&!(this.controller instanceof rn))return this;const e=(o=t==null?void 0:t.mode)!=null?o:"View",n=this.controller.polyline;return this.model.addPolyline(n),this.changeMode(e),this}addStartPoint(){this.controller instanceof rn&&this.hook.emit("willChangeState","watching","editing")}addEndPoint(){this.controller instanceof rn&&this.hook.emit("willChangeState","editing","watching")}toJson(){return this.model.toJson()}changeIsMobile(t){var e;if(this.isMobile=t,this.params.useUIController!==!1){(e=this.useUIController)==null||e.dispose();const n=O({container:this.container,mode:this.isMobile?"mobile":"pc"},typeof this.params.useUIController=="object"?this.params.useUIController:{});this.useUIController=new ks(this,n)}}changeConfigs(t){var e;Object.assign(this.config,t),(e=this.controller)==null||e.updateDistanceUI()}setCustomText(t,e){var o;const n=this.model.getLineByID(t);if(!n)throw new Error("\u4E0D\u5B58\u5728\u7684\u7EBF\u6BB5");n.setText(e),(o=this.controller)==null||o.updateDistanceUI()}createControllerParams(){var e;const t=(e=this.params.openParams)!=null?e:{};return t.isMobile=this.isMobile,{five:this.five,hook:this.hook,group:this.group,model:this.model,config:this.config,magnifier:this.magnifier,container:this.container,fiveHelper:this.fiveHelper,openParams:t,mouseGroup:Ka(O({},t.crossHairParameter)),userDistanceItemCreator:this.params.userDistanceItemCreator}}}const Jf=function(t,e){return new qf(t,e)},il=ao(null);function Zf(i){ce(i,"svelte-19zi46m",".PanoSpatialTagPlugin__tag-origin.svelte-19zi46m{position:absolute;width:0.5rem;height:0.5rem;border-radius:50%;background:#fff;box-shadow:0 0 .6rem #fff;transform:translate(-50%, -50%) scale(1);transform-origin:center center;animation:svelte-19zi46m-PanoSpatialTagPlugin__tag-origin 1.2s forwards;pointer-events:auto}.PanoSpatialTagPlugin__tag-origin.svelte-19zi46m:after{content:'';position:absolute;top:50%;height:50%;width:2rem;height:2rem;transform:translate(-50%, -50%)}.PanoSpatialTagPlugin__tag-origin-destroy.svelte-19zi46m{transform:translate(-50%, -50%) scale(0.6);animation:svelte-19zi46m-PanoSpatialTagPlugin__tag-origin-destroy 1.2s forwards .7s}@keyframes svelte-19zi46m-PanoSpatialTagPlugin__tag-origin{0%{transform:translate(-50%, -50%) scale(1);opacity:0}100%{transform:translate(-50%, -50%) scale(0.6);opacity:1 }}@keyframes svelte-19zi46m-PanoSpatialTagPlugin__tag-origin-destroy{0%{transform:translate(-50%, -50%) scale(0.6);opacity:1}10%{transform:translate(-50%, -50%) scale(1);opacity:0.9}100%{transform:translate(-50%, -50%) scale(1);opacity:0}}")}function xs(i,t,e){const n=i.slice();return n[3]=t[e],n}function Ds(i){let t,e=`${i[3].top}%`,n=`${i[3].left}%`,o,s;function r(){return i[2](i[3])}return{c(){t=z("i"),b(t,"class","svelte-19zi46m"),q(t,"PanoSpatialTagPlugin__tag-origin",!0),q(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),L(t,"top",e),L(t,"left",n),L(t,"visibility",i[3].front?"visible":"hidden")},m(a,l){T(a,t,l),o||(s=we(t,"click",r),o=!0)},p(a,l){i=a,l&1&&q(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),l&1&&e!==(e=`${i[3].top}%`)&&L(t,"top",e),l&1&&n!==(n=`${i[3].left}%`)&&L(t,"left",n),l&1&&L(t,"visibility",i[3].front?"visible":"hidden")},d(a){a&&M(t),o=!1,s()}}}function Kf(i){let t,e=i[0],n=[];for(let o=0;o<e.length;o+=1)n[o]=Ds(xs(i,e,o));return{c(){for(let o=0;o<n.length;o+=1)n[o].c();t=fe()},m(o,s){for(let r=0;r<n.length;r+=1)n[r].m(o,s);T(o,t,s)},p(o,[s]){if(s&3){e=o[0];let r;for(r=0;r<e.length;r+=1){const a=xs(o,e,r);n[r]?n[r].p(a,s):(n[r]=Ds(a),n[r].c(),n[r].m(t.parentNode,t))}for(;r<n.length;r+=1)n[r].d(1);n.length=e.length}},i:Y,o:Y,d(o){at(n,o),o&&M(t)}}}function $f(i,t,e){let{origins:n}=t;const o=r=>{il.update(()=>`${r}-PanoSpatialTagPlugin-${Date.now()}`)},s=r=>o(r.id);return i.$$set=r=>{"origins"in r&&e(0,n=r.origins)},[n,o,s]}class em extends oe{constructor(t){super(),ie(this,t,$f,Kf,ne,{origins:0},Zf)}}function tm(i){ce(i,"svelte-1i5h9zh",".PanoSpatialTagPlugin__tag-x.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0;display:block;white-space:nowrap;box-sizing:border-box;width:25rem;height:14rem;color:#FFF;transform:translate(0, -100%);transition:height .5s linear}.PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh.svelte-1i5h9zh{content:'';position:absolute;width:30rem;height:30rem;top:-15rem;left:-15rem;z-index:-1;opacity:0;transition:opacity .8s .6s;background:url('https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png');background-size:30rem 30rem}.PanoSpatialTagPlugin__tag-line.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;left:-1rem;width:2rem;height:100%;overflow:hidden}.PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:1rem;height:calc(100% - 1.5rem);width:.15rem;background:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, .1));box-shadow:0 .1rem .5rem rgba(0, 0, 0, .2);opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .4s cubic-bezier(.44,.44,.74,.98) , opacity .4s cubic-bezier(.44,.44,.74,.98), width .5s linear, height .5s linear ;transform-origin:center bottom}.PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0.3rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0.5rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh{animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1 linear .5s forwards .45s}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh{animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2 linear .5s forwards .65s}.PanoSpatialTagPlugin__tag-x.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh.svelte-1i5h9zh{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line.svelte-1i5h9zh{transform:scaleY(-1)}.PanoSpatialTagPlugin__tag-animate.svelte-1i5h9zh.svelte-1i5h9zh{position:relative;height:100%;overflow:hidden;transform-origin:left top;transition:transform .5s linear}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-animate.svelte-1i5h9zh{transform-origin:left bottom}.PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;display:inline-block;transform:translate(-100%, 0);transition:transform .9s cubic-bezier(0,.65,.16,1.08) .6s;padding-left:.5rem;font-size:1rem}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{bottom:0}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh{opacity:1;transform:translate(-50%, 0) scaleY(1)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{top:unset;bottom:-15rem}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{opacity:.32}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh{opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .5s .55s, opacity .4s .55s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{opacity:0;transition:opacity .8s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{transform:translate(-100%, 0);transition:transform .6s cubic-bezier(.53,.06,.88,.59)}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content .svelte-1i5h9zh{pointer-events:none}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh{opacity:0.5;transform:translate(-50%, 10%) scaleY(0);animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1-hide linear .28s forwards .3s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh{opacity:0.5;transform:translate(-50%, 0) scaleY(0);animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2-hide linear .28s forwards .45s}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 135%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 20%) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 125%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1-hide{0%{opacity:0.5;transform:translate(-50%, 10%) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 105%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2-hide{0%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 100%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}")}function nm(i){let t,e,n,o,s,r,a,l,c,u,h,d,f,g,A;return{c(){t=z("div"),e=z("div"),n=$(),o=z("div"),s=z("i"),r=$(),a=z("i"),l=$(),c=z("i"),u=$(),h=z("div"),d=z("div"),b(e,"class","PanoSpatialTagPlugin__tag-shadow svelte-1i5h9zh"),L(e,"transform","translate("+i[7]/2*i[3]*3+"px, "+i[8]/2*(i[1]?-1:1)*i[3]*3+"px) scale("+1/i[3]+")"),b(s,"class","PanoSpatialTagPlugin__tag-flagpole svelte-1i5h9zh"),L(s,"width",i[4]+"rem"),b(a,"class","PanoSpatialTagPlugin__tag-line1 svelte-1i5h9zh"),b(c,"class","PanoSpatialTagPlugin__tag-line2 svelte-1i5h9zh"),b(o,"class","PanoSpatialTagPlugin__tag-line svelte-1i5h9zh"),b(d,"class","PanoSpatialTagPlugin__tag-content svelte-1i5h9zh"),b(h,"class","PanoSpatialTagPlugin__tag-animate svelte-1i5h9zh"),L(h,"transform","scale("+i[3]*3+")"),b(t,"id",f="PanoSpatialTagPlugin__"+i[0]),L(t,"height",20*i[5]+"rem"),b(t,"class","svelte-1i5h9zh"),q(t,"PanoSpatialTagPlugin__tag-x",!0),q(t,"PanoSpatialTagPlugin__tag-upside-down",i[1]),q(t,"PanoSpatialTagPlugin__tag-show",i[10]),q(t,"PanoSpatialTagPlugin__tag-hide",i[10]===!1||i[6])},m(p,v){T(p,t,v),B(t,e),B(t,n),B(t,o),B(o,s),B(o,r),B(o,a),B(o,l),B(o,c),B(t,u),B(t,h),B(h,d),d.innerHTML=i[2],i[16](d),g||(A=we(d,"click",i[11]),g=!0)},p(p,[v]){v&394&&L(e,"transform","translate("+p[7]/2*p[3]*3+"px, "+p[8]/2*(p[1]?-1:1)*p[3]*3+"px) scale("+1/p[3]+")"),v&16&&L(s,"width",p[4]+"rem"),v&4&&(d.innerHTML=p[2]),v&8&&L(h,"transform","scale("+p[3]*3+")"),v&1&&f!==(f="PanoSpatialTagPlugin__"+p[0])&&b(t,"id",f),v&32&&L(t,"height",20*p[5]+"rem"),v&2&&q(t,"PanoSpatialTagPlugin__tag-upside-down",p[1]),v&1024&&q(t,"PanoSpatialTagPlugin__tag-show",p[10]),v&1088&&q(t,"PanoSpatialTagPlugin__tag-hide",p[10]===!1||p[6])},i:Y,o:Y,d(p){p&&M(t),i[16](null),g=!1,A()}}}function im(i,t,e){let{id:n}=t,{upsideDown:o}=t,{content:s}=t,{contentZoom:r}=t,{lineWidthZoom:a}=t,{lineHeightZoom:l}=t,{destroying:c=!1}=t,{folded:u}=t,{dispose:h}=t,{events:d}=t,{hooks:f}=t,g=0,A=0,p,v,y=setTimeout(()=>{u||e(10,v=!0),y=void 0},100);const w=C=>{const S=Object.keys(d);let x=C.target;for(;x;){const Q=x.getAttribute("class");if(!Q){x=x.parentNode;continue}if(Q.includes("PanoSpatialTagPlugin__tag-content")){x=null;break}S.forEach(_=>{Q.includes(_)&&d[_](n)}),x=x.parentNode}};Ue(()=>{f.emit("initTag",{id:n})});const P=il.subscribe(C=>{if(C===null)return;const[S,x]=C.split("-PanoSpatialTagPlugin-");n===S&&(f.emit("clickOrigin",{id:n,show:v}),y||(e(10,v=u),e(12,u=!u),y=setTimeout(()=>{y=void 0},1500)))});Gc(()=>{e(7,g=p.offsetWidth),e(8,A=p.offsetHeight),!y&&e(10,v=!u)}),Pt(()=>{f.emit("destroyTag",{id:n}),P(),h()});function k(C){Qe[C?"unshift":"push"](()=>{p=C,e(9,p)})}return i.$$set=C=>{"id"in C&&e(0,n=C.id),"upsideDown"in C&&e(1,o=C.upsideDown),"content"in C&&e(2,s=C.content),"contentZoom"in C&&e(3,r=C.contentZoom),"lineWidthZoom"in C&&e(4,a=C.lineWidthZoom),"lineHeightZoom"in C&&e(5,l=C.lineHeightZoom),"destroying"in C&&e(6,c=C.destroying),"folded"in C&&e(12,u=C.folded),"dispose"in C&&e(13,h=C.dispose),"events"in C&&e(14,d=C.events),"hooks"in C&&e(15,f=C.hooks)},[n,o,s,r,a,l,c,g,A,p,v,w,u,h,d,f,k]}class om extends oe{constructor(t){super(),ie(this,t,im,nm,ne,{id:0,upsideDown:1,content:2,contentZoom:3,lineWidthZoom:4,lineHeightZoom:5,destroying:6,folded:12,dispose:13,events:14,hooks:15},tm)}}const sm={position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",pointerEvents:"none"},Ls="<",Ss=">",Ms="%",Ts="locals",rm="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",am={"&":"&","<":"<",">":">",'"':""","'":"'"},Fe={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};function zs(i){return i.replace(/;(\s*$)/,"$1")}function lm(i,t){return new cm(i).compileFunction()(t)}class cm{constructor(t){m(this,"templateText");m(this,"mode",null);m(this,"truncate",!1);m(this,"currentLine",1);m(this,"source","");m(this,"regex",new RegExp(rm));this.templateText=t}compileFunction(){let t;const e=` var __output = "";
|
|
497
|
+
`,Rf={display:"none",position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",transform:"translate(0, 10px)",transition:"opacity 500ms ease-in-out, transform 500ms ease-in-out"},Of={position:"absolute",left:"50%",bottom:"32px",transform:"translateX(-50%)",height:"89px",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"14px",pointerEvents:"all",color:"#fff",zIndex:"10"},Ff={position:"absolute",bottom:"0",left:"0",opacity:"0.5",width:"100%",height:"184px",background:"linear-gradient(180deg, rgba(0,0,0,0.00) 0%, #000000 100%)",zIndex:"0"},tl={margin:"0 64px"},Hf={opacity:"0.85"},nl={width:"72px",height:"72px",backgroundSize:"100%",cursor:"pointer",transition:"all 200ms ease-in-out"},Gf={width:"24px",height:"24px",marginRight:"4px",backgroundSize:"100%",cursor:"pointer"},Wf={userSelect:"none",pointerEvents:"none"};class Nf{constructor(t,e,n){m(this,"container");m(this,"measureController");m(this,"mainElement");m(this,"_params");m(this,"_btnTexts",{start:"\u5F00\u59CB",end:"\u7ED3\u675F",revoke:"\u64A4\u9500",exit:"\u9000\u51FA"});m(this,"onMouseEnter",()=>{const{mainItem:t}=this.mainElement;t.style.opacity="1"});m(this,"onMouseLeave",()=>{const{mainItem:t}=this.mainElement;t.style.opacity="0.85"});m(this,"onClick",()=>{this.measureController.getCurrentMode()!=="Edit"?this.measureController.changeMode("Edit"):this.measureController.save().changeMode("Watch")});m(this,"modeChangeHandler",t=>{t==="Edit"?this.change2Done():this.change2Add()});var r,a,l,c;this._params=n,this._btnTexts={start:(r=this._params.startButtonText)!=null?r:this._btnTexts.start,end:(a=this._params.endButtonText)!=null?a:this._btnTexts.end,revoke:(l=this._params.revokeButtonText)!=null?l:this._btnTexts.revoke,exit:(c=this._params.exitButtonText)!=null?c:this._btnTexts.exit},this.measureController=t,this.container=e,this.mainElement=this.getMainElement(),Object.assign(this.mainElement.mainIcon.style,nl),Object.assign(this.mainElement.mainItem.style,tl);const{revokeTextDom:o,exitTextDom:s}=this._getTextElement();o&&(o.innerText=this._btnTexts.revoke),s&&(s.innerText=this._btnTexts.exit),this.change2Add(),this.measureController.hook.on("modeChange",this.modeChangeHandler),this.mainElement.mainItem.addEventListener("click",this.onClick),this.mainElement.mainItem.addEventListener("mouseenter",this.onMouseEnter),this.mainElement.mainItem.addEventListener("mouseleave",this.onMouseLeave)}dispose(){this.measureController.hook.off("modeChange",this.modeChangeHandler),this.mainElement.mainItem.removeEventListener("click",this.onClick),this.mainElement.mainItem.removeEventListener("mouseenter",this.onMouseEnter),this.mainElement.mainItem.removeEventListener("mouseleave",this.onMouseLeave)}getMainElement(){const t=this.container.querySelector(".fpm__main-text"),e=this.container.querySelector(".fpm__main"),n=this.container.querySelector(".fpm__main-icon");if(!e||!t||!n)throw new Error("cannot find dom");return{mainTextDom:t,mainItem:e,mainIcon:n}}_getTextElement(){const t=this.container.querySelector(".fpm__revoke-text"),e=this.container.querySelector(".fpm__exit-text");return{revokeTextDom:t,exitTextDom:e}}change2Add(){const{mainIcon:t,mainTextDom:e}=this.mainElement;if(t.className.includes("fpm__main__start")){e.innerText=this._btnTexts.start;return}t.className.includes("fpm__main__end")&&(t.style.transform="scale(0.8)",e.className.includes("fpm__main-text__show")?e.classList.replace("fpm__main-text__show","fpm__main-text__hide"):e.classList.add("fpm__main-text__hide"),setTimeout(()=>{t.classList.replace("fpm__main__end","fpm__main__start"),t.style.transform="scale(1)",e.innerText=this._btnTexts.start,e.classList.replace("fpm__main-text__hide","fpm__main-text__show")},200))}change2Done(){const{mainTextDom:t,mainIcon:e}=this.getMainElement();t.innerText!==this._btnTexts.end&&(e.className.includes("fpm__main__end")||e.className.includes("fpm__main__start")&&(e.style.transform="scale(0.8)",t.className.includes("fpm__main-text__show")?t.classList.replace("fpm__main-text__show","fpm__main-text__hide"):t.classList.add("fpm__main-text__hide"),setTimeout(()=>{e.classList.replace("fpm__main__start","fpm__main__end"),e.style.transform="scale(1)",t.innerText=this._btnTexts.end,t.classList.replace("fpm__main-text__hide","fpm__main-text__show")},200)))}}class _f{constructor(t,e,n){m(this,"container");m(this,"measureController");m(this,"mainElement");m(this,"_params");m(this,"_btnTexts",{start:"\u5F00\u59CB",end:"\u7ED3\u675F"});m(this,"onClick",()=>{var t;this.mainElement.mainTextDom.innerText===((t=this._params.startButtonText)!=null?t:"\u5F00\u59CB")?(this.measureController.hook.emit("willChangeState","watching","editing"),this.change2Done()):(this.measureController.hook.emit("willChangeState","editing","watching"),this.change2Add())});var o,s;this._params=n,this._btnTexts={start:(o=this._params.startButtonText)!=null?o:this._btnTexts.start,end:(s=this._params.endButtonText)!=null?s:this._btnTexts.end},this.measureController=t,this.container=e,this.mainElement=this.getMainElement(),this.mainElement.mainIcon.setAttribute("style","-webkit-tap-highlight-color: rgba(0,0,0,0);"),Object.assign(this.mainElement.mainIcon.style,nl),Object.assign(this.mainElement.mainItem.style,tl),this.change2Add(),this.mainElement.mainItem.addEventListener("click",this.onClick)}dispose(){this.mainElement.mainItem.removeEventListener("click",this.onClick)}getMainElement(){const t=this.container.querySelector(".fpm__main-text"),e=this.container.querySelector(".fpm__main"),n=this.container.querySelector(".fpm__main-icon");if(!e||!t||!n)throw new Error("cannot find dom");return{mainTextDom:t,mainItem:e,mainIcon:n}}change2Add(){const{mainIcon:t,mainTextDom:e}=this.mainElement;if(t.className.includes("fpm__main__start")){e.innerText=this._btnTexts.start;return}t.className.includes("fpm__main__end")&&(t.style.transform="scale(0.8)",e.className.includes("fpm__main-text__show")?e.classList.replace("fpm__main-text__show","fpm__main-text__hide"):e.classList.add("fpm__main-text__hide"),setTimeout(()=>{t.classList.replace("fpm__main__end","fpm__main__start"),t.style.transform="scale(1)",e.innerText=this._btnTexts.start,e.classList.replace("fpm__main-text__hide","fpm__main-text__show")},200))}change2Done(){const{mainTextDom:t,mainIcon:e}=this.mainElement;t.innerText!==this._btnTexts.end&&(e.className.includes("fpm__main__end")||e.className.includes("fpm__main__start")&&(e.style.transform="scale(0.8)",t.className.includes("fpm__main-text__show")?t.classList.replace("fpm__main-text__show","fpm__main-text__hide"):t.classList.add("fpm__main-text__hide"),setTimeout(()=>{e.classList.replace("fpm__main__start","fpm__main__end"),e.style.transform="scale(1)",t.innerText=this._btnTexts.end,t.classList.replace("fpm__main-text__hide","fpm__main-text__show")},200)))}}class Xf{constructor(t,e){m(this,"container");m(this,"revokeIcon");m(this,"revokeItem");m(this,"measureController");m(this,"onClick",()=>{this.measureController.revoke()});m(this,"onModeChange",t=>{if(t!=="Edit"&&this.revokeItem.className.includes("enabled")){this.revokeItem.classList.remove("enabled"),this.measureController.hook.off("anchorChange",this.onAnchorChange);return}this.measureController.hook.on("anchorChange",this.onAnchorChange)});m(this,"onAnchorChange",t=>{t&&this.revokeItem.classList.add("enabled")});this.measureController=t,this.container=e;const n=this.container.querySelector(".fpm__revoke-icon"),o=this.container.querySelector(".fpm__revoke");if(!n||!o)throw new Error("\u4E0D\u6B63\u786E\u7684\u9009\u62E9\u5668");this.revokeIcon=n,this.revokeItem=o,this.revokeItem.addEventListener("click",this.onClick),t.hook.on("modeChange",this.onModeChange)}dispose(){this.revokeItem.removeEventListener("click",this.onClick),this.measureController.hook.off("modeChange",this.onModeChange)}}class ks{constructor(t,e){m(this,"revoke");m(this,"container");m(this,"mainController");m(this,"disposers",[]);m(this,"measureController");m(this,"mode");m(this,"_params");m(this,"handleExit",()=>{const t=this.container.querySelector(".fpm__exit-icon"),e=this.container.querySelector(".fpm__exit");if(!e||!t)throw new Error("cannot find dom");this.mode==="pc"&&(Object.assign(e.style,Hf),Object.assign(t==null?void 0:t.style,Gf));const n=()=>{e.style.opacity="1"},o=()=>{e.style.opacity="0.85"},s=()=>{this.measureController.disable()};return e.addEventListener("click",s),e.addEventListener("mouseenter",n),e.addEventListener("mouseleave",o),()=>{e.removeEventListener("click",s),e.removeEventListener("mouseenter",n),e.removeEventListener("mouseleave",o)}});var r;this._params=e,this.measureController=t,this.mode=(r=e.mode)!=null?r:"pc",this.container=document.createElement("div"),this.container.innerHTML=this.mode==="mobile"?Bf:Qf,this.container.classList.add("fpm__ui-controller",this.mode),this.container.style.background="rgba(0, 0, 0, 0.15)",e.container.appendChild(this.container);const n=this.container.querySelectorAll(".fpm__text"),o=this.container.querySelector(".fpm_ui-bg"),s=this.container.querySelector(".fpm_operating-space");Object.assign(o==null?void 0:o.style,Ff),Object.assign(s==null?void 0:s.style,Of),Object.assign(this.container.style,Rf),n.forEach(a=>Object.assign(a.style,Wf))}dispose(){this.hide(),this.container.remove()}show(){return this.container.style.display="block",this.container.style.opacity="1",this.container.style.transform="translate(0, 0)",this.mode==="pc"?(this.revoke=new Xf(this.measureController,this.container),this.mainController=new Nf(this.measureController,this.container,this._params)):this.mainController=new _f(this.measureController,this.container,this._params),this.disposers.push(this.handleExit()),this}hide(){var t,e;return this.container.style.display="none",this.container.style.opacity="0",this.container.style.transform="translate(0, 10px)",this.mode==="pc"&&((t=this.revoke)==null||t.dispose()),(e=this.mainController)==null||e.dispose(),this.disposers.forEach(n=>n()),this.disposers=[],this}}class Yf{constructor(t,e){m(this,"measureController");m(this,"textDom",document.createElement("span"));m(this,"container",document.createElement("div"));m(this,"hasAnchor",!1);m(this,"hasChangedToWatch",!1);m(this,"_params");m(this,"onModelChange",t=>{var e;if(t==="View"){this.hide();return}if(t==="Watch"){this.hasChangedToWatch?(this.textDom.innerText="",this.hide()):(this.show(),this.hasChangedToWatch=!0);return}t==="Edit"&&(this.textDom.innerText=(e=this._params.firstPointTip)!=null?e:"\u8BF7\u9009\u62E9\u7B2C\u4E00\u4E2A\u6D4B\u91CF\u70B9\uFF0CEsc\u6216\u5355\u51FB\u9F20\u6807\u53F3\u952E\u53EF\u53D6\u6D88\u9009\u62E9",this.show())});m(this,"anchorChange",t=>{var e,n;!this.hasAnchor&&!!t?(this.hasAnchor=!0,this.textDom.innerText=(e=this._params.nextPointTip)!=null?e:"\u9009\u62E9\u4E0B\u4E00\u4E2A\u6D4B\u91CF\u70B9\uFF0CEsc\u6216\u5355\u51FB\u9F20\u6807\u53F3\u952E\u53D6\u6D88\u9009\u62E9"):t||(this.hasAnchor=!1,this.textDom.innerText=(n=this._params.firstPointTip)!=null?n:"\u8BF7\u9009\u62E9\u7B2C\u4E00\u4E2A\u6D4B\u91CF\u70B9\uFF0CEsc\u6216\u5355\u51FB\u9F20\u6807\u53F3\u952E\u53EF\u53D6\u6D88\u9009\u62E9")});m(this,"onEditedLineChange",t=>{var e;t.lines.length===1&&(this.textDom.innerText=(e=this._params.endTip)!=null?e:"\u53EF\u4EE5\u8FDE\u7EED\u9009\u62E9\u6D4B\u91CF\u70B9\uFF0C\u6216\u70B9\u51FB\u4E0B\u65B9\u201C\u7ED3\u675F\u201D\u6309\u94AE\u5B8C\u6210\u6D4B\u91CF\uFF08Esc\u53D6\u6D88\uFF0CCommand+S\u4FDD\u5B58\uFF09")});this._params=e,this.initDom(),e.container.append(this.container),this.measureController=t,t.hook.on("modeChange",this.onModelChange),t.hook.on("anchorChange",this.anchorChange),t.hook.on("editedPolylineChange",this.onEditedLineChange)}dispose(){this.hide(),this.container.remove()}show(){return this.container.style.opacity="1",this.container.style.transform="translate(0, 0)",this}hide(){return this.container.style.opacity="0",this.container.style.transform="translate(0, -10px)",this.measureController.hook.off("modeChange",this.onModelChange),this.measureController.hook.off("anchorChange",this.anchorChange),this.measureController.hook.off("editedPolylineChange",this.onEditedLineChange),this}initDom(){var n;const t=this.container,e=this.textDom;t.classList.add("fpm__guide-container"),t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.width="100%",t.style.height="110px",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.transform="translate(0, -10px)",t.style.background="linear-gradient(180deg, rgba(0,0,0,0.40) 0%, rgba(0,0,0,0.00) 100%)",t.style.transition="opacity 500ms ease-in-out, transform 500ms ease-in-out",t.style.opacity="0",e.classList.add("fpm__guide-text"),e.style.color="#fff",e.style.fontSize="20px",e.innerText=(n=this._params.startTip)!=null?n:"\u70B9\u51FB\u4E0B\u65B9\u201C\u5F00\u59CB\u201D\u6309\u94AE\u5F00\u59CB\u6D4B\u8DDD",t.appendChild(e)}}class Uf{constructor(t,e){m(this,"five");m(this,"measureController");m(this,"onKeyDown",t=>{if(t.metaKey&&t.code==="KeyS"){this.measureController.save().changeMode("Watch"),t.preventDefault();return}if(t.code==="Escape")return this.escape()});m(this,"onMouseDown",t=>{t.button===2&&(t.preventDefault(),this.escape())});this.five=e,this.measureController=t;const n=this.five.getElement();!n||(document.body.addEventListener("keydown",this.onKeyDown),n.addEventListener("mousedown",this.onMouseDown))}dispose(){const t=this.five.getElement();!t||(document.body.removeEventListener("keydown",this.onKeyDown),t.removeEventListener("mousedown",this.onMouseDown))}escape(){return this.measureController.getCurrentMode()==="Watch"?this.measureController.disable():this.measureController.changeMode("Watch")}}class qf{constructor(t,e){m(this,"hasOpen",!1);m(this,"hook",new Ce.Subscribe);m(this,"magnifier");m(this,"five");m(this,"model");m(this,"group");m(this,"config");m(this,"isMobile");m(this,"fiveHelper");m(this,"useUIController");m(this,"params");m(this,"useGuideController");m(this,"container",document.createElement("div"));m(this,"shortcutKeyController");m(this,"controller",null);m(this,"getCurrentMode",()=>this.controller instanceof On?"Edit":this.controller instanceof Is?"Watch":this.controller instanceof rn?"Mixed":this.controller instanceof Ps?"View":null);m(this,"changeMode",t=>{var o;if(!this.hasOpen||this.getCurrentMode()===t)return;(o=this.controller)==null||o.dispose();const e={View:Ps,Watch:Is,Edit:On,Mixed:rn};if(!e[t])throw new Error("\u4E0D\u5B58\u5728\u7684 Mode");const n=this.createControllerParams();this.controller=new e[t](n),this.hook.emit("modeChange",t)});var o,s,r,a;this.five=t,this.params=e,this.config=ui(e,["openParams","magnifierParams"]),this.model=new fi(this.config),this.fiveHelper=new tf(t),this.isMobile=(s=(o=e==null?void 0:e.openParams)==null?void 0:o.isMobile)!=null?s:!1,this.magnifier=new Xa(t,(r=e.magnifierParams)!=null?r:{width:190,height:190,scale:2}),this.group=new V.Group,this.group.name="plugin-measure-group",this.container.classList.add("five-plugin-measure-container"),this.container.style.position="absolute",this.container.style.left="0",this.container.style.top="0",this.container.style.pointerEvents="none",this.container.style.width="100%",this.container.style.height="100%",this.container.style.opacity="0";const n=(a=this.params.openParams)!=null?a:{};if(this.params.useUIController!==!1){const l=R({container:this.container,openParams:n},typeof this.params.useUIController=="object"?this.params.useUIController:{});this.useUIController=new ks(this,l)}if(this.params.useGuideController!==!1){const l=R({container:this.container},typeof this.params.useGuideController=="object"?this.params.useGuideController:{});this.useGuideController=new Yf(this,l)}}appendTo(t){t.append(this.container)}dispose(){var t,e;this.disable(),(t=this.useUIController)==null||t.dispose(),(e=this.magnifier)==null||e.dispose(),this.five.needsRender=!0}load(t){this.model.parse(t),this.save()}enable(t){var e;this.hasOpen||(this.hasOpen=!0,this.five.scene.add(this.group),this.container.style.opacity="1",t!=null&&t.mode?this.changeMode(t.mode):this.isMobile?this.changeMode("Mixed"):this.changeMode("Watch"),(e=this.useUIController)==null||e.show(),this.shortcutKeyController=new Uf(this,this.five),this.hook.emit("enable",!0))}disable(){var t,e,n,o;this.hasOpen=!1,this.container.style.opacity="0",(t=this.controller)==null||t.dispose(),(e=this.useUIController)==null||e.hide(),(n=this.useGuideController)==null||n.hide(),(o=this.shortcutKeyController)==null||o.dispose(),this.controller=null,this.five.helperVisible=!0,this.five.scene.remove(this.group),this.five.needsRender=!0,this.hook.emit("disable",!0)}edit(){const t=this.isMobile?"Mixed":"Edit";this.changeMode(t)}revoke(){this.controller instanceof On&&this.controller.revoke()}removePolyline(t){this.model.removePolyline(t)}removePolylineByID(t){const e=this.model.getPolylineByID(t);e&&this.model.removePolyline(e)}getPolylineByID(t){return this.model.getPolylineByID(t)}getEditedPolyline(){}highlightLine(t){if(this.getCurrentMode()!=="Watch")return!1;const e=this.model.getLineByID(t);return e?(this.controller.highlightLine(e),!0):!1}clearHighlightLines(){return this.getCurrentMode()!=="Watch"?!1:(this.controller.clearHighlightLines(),!0)}save(t){var o;if(!(this.controller instanceof On)&&!(this.controller instanceof rn))return this;const e=(o=t==null?void 0:t.mode)!=null?o:"View",n=this.controller.polyline;return this.model.addPolyline(n),this.changeMode(e),this}addStartPoint(){this.controller instanceof rn&&this.hook.emit("willChangeState","watching","editing")}addEndPoint(){this.controller instanceof rn&&this.hook.emit("willChangeState","editing","watching")}toJson(){return this.model.toJson()}changeIsMobile(t){var e;if(this.isMobile=t,this.params.useUIController!==!1){(e=this.useUIController)==null||e.dispose();const n=R({container:this.container,mode:this.isMobile?"mobile":"pc"},typeof this.params.useUIController=="object"?this.params.useUIController:{});this.useUIController=new ks(this,n)}}changeConfigs(t){var e;Object.assign(this.config,t),(e=this.controller)==null||e.updateDistanceUI()}setCustomText(t,e){var o;const n=this.model.getLineByID(t);if(!n)throw new Error("\u4E0D\u5B58\u5728\u7684\u7EBF\u6BB5");n.setText(e),(o=this.controller)==null||o.updateDistanceUI()}createControllerParams(){var e;const t=(e=this.params.openParams)!=null?e:{};return t.isMobile=this.isMobile,{five:this.five,hook:this.hook,group:this.group,model:this.model,config:this.config,magnifier:this.magnifier,container:this.container,fiveHelper:this.fiveHelper,openParams:t,mouseGroup:Ka(R({},t.crossHairParameter)),userDistanceItemCreator:this.params.userDistanceItemCreator}}}const Jf=function(t,e){return new qf(t,e)},il=ao(null);function Zf(i){ce(i,"svelte-19zi46m",".PanoSpatialTagPlugin__tag-origin.svelte-19zi46m{position:absolute;width:0.5rem;height:0.5rem;border-radius:50%;background:#fff;box-shadow:0 0 .6rem #fff;transform:translate(-50%, -50%) scale(1);transform-origin:center center;animation:svelte-19zi46m-PanoSpatialTagPlugin__tag-origin 1.2s forwards;pointer-events:auto}.PanoSpatialTagPlugin__tag-origin.svelte-19zi46m:after{content:'';position:absolute;top:50%;height:50%;width:2rem;height:2rem;transform:translate(-50%, -50%)}.PanoSpatialTagPlugin__tag-origin-destroy.svelte-19zi46m{transform:translate(-50%, -50%) scale(0.6);animation:svelte-19zi46m-PanoSpatialTagPlugin__tag-origin-destroy 1.2s forwards .7s}@keyframes svelte-19zi46m-PanoSpatialTagPlugin__tag-origin{0%{transform:translate(-50%, -50%) scale(1);opacity:0}100%{transform:translate(-50%, -50%) scale(0.6);opacity:1 }}@keyframes svelte-19zi46m-PanoSpatialTagPlugin__tag-origin-destroy{0%{transform:translate(-50%, -50%) scale(0.6);opacity:1}10%{transform:translate(-50%, -50%) scale(1);opacity:0.9}100%{transform:translate(-50%, -50%) scale(1);opacity:0}}")}function xs(i,t,e){const n=i.slice();return n[3]=t[e],n}function Ds(i){let t,e=`${i[3].top}%`,n=`${i[3].left}%`,o,s;function r(){return i[2](i[3])}return{c(){t=z("i"),b(t,"class","svelte-19zi46m"),q(t,"PanoSpatialTagPlugin__tag-origin",!0),q(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),L(t,"top",e),L(t,"left",n),L(t,"visibility",i[3].front?"visible":"hidden")},m(a,l){T(a,t,l),o||(s=we(t,"click",r),o=!0)},p(a,l){i=a,l&1&&q(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),l&1&&e!==(e=`${i[3].top}%`)&&L(t,"top",e),l&1&&n!==(n=`${i[3].left}%`)&&L(t,"left",n),l&1&&L(t,"visibility",i[3].front?"visible":"hidden")},d(a){a&&M(t),o=!1,s()}}}function Kf(i){let t,e=i[0],n=[];for(let o=0;o<e.length;o+=1)n[o]=Ds(xs(i,e,o));return{c(){for(let o=0;o<n.length;o+=1)n[o].c();t=fe()},m(o,s){for(let r=0;r<n.length;r+=1)n[r].m(o,s);T(o,t,s)},p(o,[s]){if(s&3){e=o[0];let r;for(r=0;r<e.length;r+=1){const a=xs(o,e,r);n[r]?n[r].p(a,s):(n[r]=Ds(a),n[r].c(),n[r].m(t.parentNode,t))}for(;r<n.length;r+=1)n[r].d(1);n.length=e.length}},i:Y,o:Y,d(o){at(n,o),o&&M(t)}}}function $f(i,t,e){let{origins:n}=t;const o=r=>{il.update(()=>`${r}-PanoSpatialTagPlugin-${Date.now()}`)},s=r=>o(r.id);return i.$$set=r=>{"origins"in r&&e(0,n=r.origins)},[n,o,s]}class em extends oe{constructor(t){super(),ie(this,t,$f,Kf,ne,{origins:0},Zf)}}function tm(i){ce(i,"svelte-1i5h9zh",".PanoSpatialTagPlugin__tag-x.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0;display:block;white-space:nowrap;box-sizing:border-box;width:25rem;height:14rem;color:#FFF;transform:translate(0, -100%);transition:height .5s linear}.PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh.svelte-1i5h9zh{content:'';position:absolute;width:30rem;height:30rem;top:-15rem;left:-15rem;z-index:-1;opacity:0;transition:opacity .8s .6s;background:url('https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png');background-size:30rem 30rem}.PanoSpatialTagPlugin__tag-line.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;left:-1rem;width:2rem;height:100%;overflow:hidden}.PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:1rem;height:calc(100% - 1.5rem);width:.15rem;background:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, .1));box-shadow:0 .1rem .5rem rgba(0, 0, 0, .2);opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .4s cubic-bezier(.44,.44,.74,.98) , opacity .4s cubic-bezier(.44,.44,.74,.98), width .5s linear, height .5s linear ;transform-origin:center bottom}.PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0.3rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0.5rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh{animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1 linear .5s forwards .45s}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh{animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2 linear .5s forwards .65s}.PanoSpatialTagPlugin__tag-x.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh.svelte-1i5h9zh{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line.svelte-1i5h9zh{transform:scaleY(-1)}.PanoSpatialTagPlugin__tag-animate.svelte-1i5h9zh.svelte-1i5h9zh{position:relative;height:100%;overflow:hidden;transform-origin:left top;transition:transform .5s linear}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-animate.svelte-1i5h9zh{transform-origin:left bottom}.PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;display:inline-block;transform:translate(-100%, 0);transition:transform .9s cubic-bezier(0,.65,.16,1.08) .6s;padding-left:.5rem;font-size:1rem}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{bottom:0}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh{opacity:1;transform:translate(-50%, 0) scaleY(1)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{top:unset;bottom:-15rem}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{opacity:.32}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh{opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .5s .55s, opacity .4s .55s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{opacity:0;transition:opacity .8s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{transform:translate(-100%, 0);transition:transform .6s cubic-bezier(.53,.06,.88,.59)}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content .svelte-1i5h9zh{pointer-events:none}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh{opacity:0.5;transform:translate(-50%, 10%) scaleY(0);animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1-hide linear .28s forwards .3s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh{opacity:0.5;transform:translate(-50%, 0) scaleY(0);animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2-hide linear .28s forwards .45s}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 135%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 20%) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 125%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1-hide{0%{opacity:0.5;transform:translate(-50%, 10%) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 105%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2-hide{0%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 100%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}")}function nm(i){let t,e,n,o,s,r,a,l,c,u,h,d,f,g,A;return{c(){t=z("div"),e=z("div"),n=$(),o=z("div"),s=z("i"),r=$(),a=z("i"),l=$(),c=z("i"),u=$(),h=z("div"),d=z("div"),b(e,"class","PanoSpatialTagPlugin__tag-shadow svelte-1i5h9zh"),L(e,"transform","translate("+i[7]/2*i[3]*3+"px, "+i[8]/2*(i[1]?-1:1)*i[3]*3+"px) scale("+1/i[3]+")"),b(s,"class","PanoSpatialTagPlugin__tag-flagpole svelte-1i5h9zh"),L(s,"width",i[4]+"rem"),b(a,"class","PanoSpatialTagPlugin__tag-line1 svelte-1i5h9zh"),b(c,"class","PanoSpatialTagPlugin__tag-line2 svelte-1i5h9zh"),b(o,"class","PanoSpatialTagPlugin__tag-line svelte-1i5h9zh"),b(d,"class","PanoSpatialTagPlugin__tag-content svelte-1i5h9zh"),b(h,"class","PanoSpatialTagPlugin__tag-animate svelte-1i5h9zh"),L(h,"transform","scale("+i[3]*3+")"),b(t,"id",f="PanoSpatialTagPlugin__"+i[0]),L(t,"height",20*i[5]+"rem"),b(t,"class","svelte-1i5h9zh"),q(t,"PanoSpatialTagPlugin__tag-x",!0),q(t,"PanoSpatialTagPlugin__tag-upside-down",i[1]),q(t,"PanoSpatialTagPlugin__tag-show",i[10]),q(t,"PanoSpatialTagPlugin__tag-hide",i[10]===!1||i[6])},m(p,v){T(p,t,v),B(t,e),B(t,n),B(t,o),B(o,s),B(o,r),B(o,a),B(o,l),B(o,c),B(t,u),B(t,h),B(h,d),d.innerHTML=i[2],i[16](d),g||(A=we(d,"click",i[11]),g=!0)},p(p,[v]){v&394&&L(e,"transform","translate("+p[7]/2*p[3]*3+"px, "+p[8]/2*(p[1]?-1:1)*p[3]*3+"px) scale("+1/p[3]+")"),v&16&&L(s,"width",p[4]+"rem"),v&4&&(d.innerHTML=p[2]),v&8&&L(h,"transform","scale("+p[3]*3+")"),v&1&&f!==(f="PanoSpatialTagPlugin__"+p[0])&&b(t,"id",f),v&32&&L(t,"height",20*p[5]+"rem"),v&2&&q(t,"PanoSpatialTagPlugin__tag-upside-down",p[1]),v&1024&&q(t,"PanoSpatialTagPlugin__tag-show",p[10]),v&1088&&q(t,"PanoSpatialTagPlugin__tag-hide",p[10]===!1||p[6])},i:Y,o:Y,d(p){p&&M(t),i[16](null),g=!1,A()}}}function im(i,t,e){let{id:n}=t,{upsideDown:o}=t,{content:s}=t,{contentZoom:r}=t,{lineWidthZoom:a}=t,{lineHeightZoom:l}=t,{destroying:c=!1}=t,{folded:u}=t,{dispose:h}=t,{events:d}=t,{hooks:f}=t,g=0,A=0,p,v,y=setTimeout(()=>{u||e(10,v=!0),y=void 0},100);const w=C=>{const S=Object.keys(d);let x=C.target;for(;x;){const Q=x.getAttribute("class");if(!Q){x=x.parentNode;continue}if(Q.includes("PanoSpatialTagPlugin__tag-content")){x=null;break}S.forEach(_=>{Q.includes(_)&&d[_](n)}),x=x.parentNode}};Ue(()=>{f.emit("initTag",{id:n})});const P=il.subscribe(C=>{if(C===null)return;const[S,x]=C.split("-PanoSpatialTagPlugin-");n===S&&(f.emit("clickOrigin",{id:n,show:v}),y||(e(10,v=u),e(12,u=!u),y=setTimeout(()=>{y=void 0},1500)))});Gc(()=>{e(7,g=p.offsetWidth),e(8,A=p.offsetHeight),!y&&e(10,v=!u)}),Pt(()=>{f.emit("destroyTag",{id:n}),P(),h()});function k(C){Qe[C?"unshift":"push"](()=>{p=C,e(9,p)})}return i.$$set=C=>{"id"in C&&e(0,n=C.id),"upsideDown"in C&&e(1,o=C.upsideDown),"content"in C&&e(2,s=C.content),"contentZoom"in C&&e(3,r=C.contentZoom),"lineWidthZoom"in C&&e(4,a=C.lineWidthZoom),"lineHeightZoom"in C&&e(5,l=C.lineHeightZoom),"destroying"in C&&e(6,c=C.destroying),"folded"in C&&e(12,u=C.folded),"dispose"in C&&e(13,h=C.dispose),"events"in C&&e(14,d=C.events),"hooks"in C&&e(15,f=C.hooks)},[n,o,s,r,a,l,c,g,A,p,v,w,u,h,d,f,k]}class om extends oe{constructor(t){super(),ie(this,t,im,nm,ne,{id:0,upsideDown:1,content:2,contentZoom:3,lineWidthZoom:4,lineHeightZoom:5,destroying:6,folded:12,dispose:13,events:14,hooks:15},tm)}}const sm={position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",pointerEvents:"none"},Ls="<",Ss=">",Ms="%",Ts="locals",rm="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",am={"&":"&","<":"<",">":">",'"':""","'":"'"},Fe={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};function zs(i){return i.replace(/;(\s*$)/,"$1")}function lm(i,t){return new cm(i).compileFunction()(t)}class cm{constructor(t){m(this,"templateText");m(this,"mode",null);m(this,"truncate",!1);m(this,"currentLine",1);m(this,"source","");m(this,"regex",new RegExp(rm));this.templateText=t}compileFunction(){let t;const e=` var __output = "";
|
|
498
498
|
function __append(s) { if (s !== undefined && s !== null) __output += s }
|
|
499
499
|
with (`+Ts+` || {}) {
|
|
500
500
|
`,n=` }
|
|
@@ -509,25 +509,25 @@ void main() {
|
|
|
509
509
|
`)}switch(this.mode){case Fe.EVAL:this.source+=" ; "+t+`
|
|
510
510
|
`;break;case Fe.ESCAPED:this.source+=" ; __append(escapeFn("+zs(t)+`))
|
|
511
511
|
`;break;case Fe.RAW:this.source+=" ; __append("+zs(t)+`)
|
|
512
|
-
`;break;case Fe.COMMENT:break;case Fe.LITERAL:this._addOutput(t);break}}else this._addOutput(t)}}}const Si=.001,Bs=.01,um="https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png",dm=(i,t)=>{var N,ae,he,ue,pe,Pe,Le,ze;let e=t==null?void 0:t.container,n=1.4;const o=(N=t==null?void 0:t.wait)!=null?N:200,s=(ae=t==null?void 0:t.maxNumberOnScreen)!=null?ae:3,r=(he=t==null?void 0:t.minRad)!=null?he:Math.PI/4,a=(ue=t==null?void 0:t.nearTolerance)!=null?ue:100,l=(pe=t==null?void 0:t.upsideHeight)!=null?pe:1.6,c=(Pe=t==null?void 0:t.minDistance)!=null?Pe:1.2,u=(Le=t==null?void 0:t.maxDistance)!=null?Le:3.5,h=Jt(i),d=document.createElement("div");d.classList.add("PanoSpatialTagPlugin"),Object.assign(d.style,sm);const f=new Ce.Subscribe;let g=new Image;g.src=um;const A={points:[],origins:[],tags:[],template:"",events:{},render:lm,folded:!1,enabled:!0,forbidden:!0},p=new em({target:d,props:{origins:A.origins}}),v=(le,ge)=>{k(),ge&&C()},y=()=>{A.forbidden&&(A.forbidden=!1,C())},w=(le,ge)=>{if(A.tags.length===0)return;const Ee=ge.longitude-i.state.longitude,de=i.camera.clone();de.position.copy(ge.offset),de.rotateOnWorldAxis(new I.Vector3(0,1,0),Ee),de.updateProjectionMatrix(),de.updateMatrixWorld(!0);const Xe=new I.Frustum,it=new I.Matrix4;it.multiplyMatrices(de.projectionMatrix,de.matrixWorldInverse),Xe.setFromProjectionMatrix(it),A.tags.forEach(ve=>{const Je=de.position.clone().setY(n).distanceTo(ve.position);if(Je<c||Je>u||!Xe.containsPoint(ve.position))return ve.destroying=!0;const te=ve.position.clone().sub(de.position).setY(0);if(te.angleTo(ve.normal)>Math.PI/2-r&&te.angleTo(ve.normal)<Math.PI/2+r)return ve.destroying=!0}),A.tags.forEach(ve=>{ve.destroying?ve.app.$set({contentZoom:.1+de.position.distanceTo(ve.position)/u,lineWidthZoom:.38*(.01+de.position.distanceTo(ve.position)/u),destroying:ve.destroying}):ve.app.$set({lineWidthZoom:.38*(.01+de.position.distanceTo(ve.position)/u),lineHeightZoom:.4+(de.position.distanceTo(ve.position)-c)/u*.6,contentZoom:.1+de.position.distanceTo(ve.position)/u})}),setTimeout(()=>{A.tags.forEach(ve=>{ve.destroying&&(ve.app.$destroy(),ve=null)}),A.tags=A.tags.filter(ve=>!ve.destroying),k()},1900)},P=le=>{le!==Ce.Five.Mode.Panorama&&!A.forbidden&&(p.$set({origins:[]}),A.tags.forEach(ge=>{ge.app.$destroy(),ge=null}),A.origins=[],A.tags=[],A.forbidden=!0)},k=()=>{if(A.forbidden||!A.enabled)return;const le=i.camera,ge=le.getWorldDirection(new I.Vector3);A.origins=A.tags.map(Ee=>{const de=Ee.position.clone().project(le),Xe=Ee.position.clone().sub(le.position).setY(0).angleTo(ge.setY(0))<Math.PI/2;return{id:Ee.id,front:Xe,left:(de.x+1)/2*100,top:(-de.y+1)/2*100,destroying:Ee.destroying}}),p.$set({origins:A.origins})},C=()=>{A.forbidden||!A.enabled||(A.timeoutId&&clearTimeout(A.timeoutId),A.timeoutId=setTimeout(()=>{A.timeoutId=void 0;const le=S();le.length&&(A.tags=A.tags.concat(le),k())},o))},S=()=>{const{clientWidth:le,clientHeight:ge}=i.getElement(),Ee=[],de=i.camera,Xe=new I.Frustum,it=new I.Matrix4,ve=de.getWorldDirection(new I.Vector3);it.multiplyMatrices(de.projectionMatrix,de.matrixWorldInverse),Xe.setFromProjectionMatrix(it);const Je=A.tags.filter(Ae=>Xe.containsPoint(Ae.position)&&!Ae.destroying).length,te=A.points.reduce((Ae,Ve)=>{if(A.tags.find(Be=>Ve.id===Be.id&&!Be.destroying))return Ae;const Ze=de.position.clone().setY(n).distanceTo(Ve.position);if(Ze<c||Ze>u||!Xe.containsPoint(Ve.position))return Ae;const on=Ve.position.clone().sub(de.position).setY(0);if(on.angleTo(Ve.normal)>Math.PI/2-r&&on.angleTo(Ve.normal)<Math.PI/2+r)return Ae;const jt=Ve.position.clone().project(de);if(!A.tags.every(Be=>{if(Be.position.clone().sub(de.position).setY(0).angleTo(ve.setY(0))>Math.PI/2)return!0;const kt=Be.position.clone().project(de);return Math.sqrt(Math.pow((jt.x-kt.x)/2*le,2)+Math.pow((jt.y-kt.y)/2*ge,2))>a}))return Ae;const It={id:Ve.id,position:Ve.position,normal:Ve.normal,replacement:Ve.replacement,weight:Ve.weight,distance:Ze};let De;for(let Be=0,kt=Ae.length;Be<kt;Be++){const In=Ae[Be];if(It.weight>In.weight){De=Be;break}if(It.distance<In.distance){De=Be;break}}return De!==void 0?Ae.splice(De,0,It):Ae.push(It),Ae},[]);for(let Ae=0,Ve=te.length;Ae<Ve&&!(Je+Ee.length>=s);Ae++){const Ze=te[Ae];if(Ee.find(De=>Ze.id===De.id))continue;const on=Ze.position.clone().project(de);if(!A.tags.concat(Ee).every(De=>{if(De.position.clone().sub(de.position).setY(0).angleTo(ve.setY(0))>Math.PI/2)return!0;const Be=De.position.clone().project(de);return Math.sqrt(Math.pow((on.x-Be.x)/2*le,2)+Math.pow((on.y-Be.y)/2*ge,2))>a}))continue;const jt=new I.Raycaster(de.position.clone().setY(n),Ze.position.clone().sub(de.position.clone().setY(n)).normalize(),0,Ze.distance+Bs),[It]=A.intersectObjects?jt.intersectObjects(A.intersectObjects,!0):i.model.bvhs.loaded?i.model.intersectRaycaster(jt):jt.intersectObjects(i.model.children,!0);if(!!It&&Ze.distance-It.distance<Bs){const{position:De,normal:Be,id:kt,replacement:In}=Ze,Vl=new I.Plane().setFromNormalAndCoplanarPoint(Be,De),Eo=De.clone().sub(de.position).cross(new I.Vector3(0,1,0)).setLength(Si),Ql=[De.clone(),De.clone().add(Eo),De.clone().add(new I.Vector3(0,Si,0)).add(Eo),De.clone().add(new I.Vector3(0,Si,0))].map(Hl=>Vl.projectPoint(Hl,new I.Vector3)),{container:
|
|
512
|
+
`;break;case Fe.COMMENT:break;case Fe.LITERAL:this._addOutput(t);break}}else this._addOutput(t)}}}const Si=.001,Bs=.01,um="https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png",dm=(i,t)=>{var N,ae,he,ue,pe,Pe,Le,ze;let e=t==null?void 0:t.container,n=1.4;const o=(N=t==null?void 0:t.wait)!=null?N:200,s=(ae=t==null?void 0:t.maxNumberOnScreen)!=null?ae:3,r=(he=t==null?void 0:t.minRad)!=null?he:Math.PI/4,a=(ue=t==null?void 0:t.nearTolerance)!=null?ue:100,l=(pe=t==null?void 0:t.upsideHeight)!=null?pe:1.6,c=(Pe=t==null?void 0:t.minDistance)!=null?Pe:1.2,u=(Le=t==null?void 0:t.maxDistance)!=null?Le:3.5,h=Jt(i),d=document.createElement("div");d.classList.add("PanoSpatialTagPlugin"),Object.assign(d.style,sm);const f=new Ce.Subscribe;let g=new Image;g.src=um;const A={points:[],origins:[],tags:[],template:"",events:{},render:lm,folded:!1,enabled:!0,forbidden:!0},p=new em({target:d,props:{origins:A.origins}}),v=(le,ge)=>{k(),ge&&C()},y=()=>{A.forbidden&&(A.forbidden=!1,C())},w=(le,ge)=>{if(A.tags.length===0)return;const Ee=ge.longitude-i.state.longitude,de=i.camera.clone();de.position.copy(ge.offset),de.rotateOnWorldAxis(new I.Vector3(0,1,0),Ee),de.updateProjectionMatrix(),de.updateMatrixWorld(!0);const Xe=new I.Frustum,it=new I.Matrix4;it.multiplyMatrices(de.projectionMatrix,de.matrixWorldInverse),Xe.setFromProjectionMatrix(it),A.tags.forEach(ve=>{const Je=de.position.clone().setY(n).distanceTo(ve.position);if(Je<c||Je>u||!Xe.containsPoint(ve.position))return ve.destroying=!0;const te=ve.position.clone().sub(de.position).setY(0);if(te.angleTo(ve.normal)>Math.PI/2-r&&te.angleTo(ve.normal)<Math.PI/2+r)return ve.destroying=!0}),A.tags.forEach(ve=>{ve.destroying?ve.app.$set({contentZoom:.1+de.position.distanceTo(ve.position)/u,lineWidthZoom:.38*(.01+de.position.distanceTo(ve.position)/u),destroying:ve.destroying}):ve.app.$set({lineWidthZoom:.38*(.01+de.position.distanceTo(ve.position)/u),lineHeightZoom:.4+(de.position.distanceTo(ve.position)-c)/u*.6,contentZoom:.1+de.position.distanceTo(ve.position)/u})}),setTimeout(()=>{A.tags.forEach(ve=>{ve.destroying&&(ve.app.$destroy(),ve=null)}),A.tags=A.tags.filter(ve=>!ve.destroying),k()},1900)},P=le=>{le!==Ce.Five.Mode.Panorama&&!A.forbidden&&(p.$set({origins:[]}),A.tags.forEach(ge=>{ge.app.$destroy(),ge=null}),A.origins=[],A.tags=[],A.forbidden=!0)},k=()=>{if(A.forbidden||!A.enabled)return;const le=i.camera,ge=le.getWorldDirection(new I.Vector3);A.origins=A.tags.map(Ee=>{const de=Ee.position.clone().project(le),Xe=Ee.position.clone().sub(le.position).setY(0).angleTo(ge.setY(0))<Math.PI/2;return{id:Ee.id,front:Xe,left:(de.x+1)/2*100,top:(-de.y+1)/2*100,destroying:Ee.destroying}}),p.$set({origins:A.origins})},C=()=>{A.forbidden||!A.enabled||(A.timeoutId&&clearTimeout(A.timeoutId),A.timeoutId=setTimeout(()=>{A.timeoutId=void 0;const le=S();le.length&&(A.tags=A.tags.concat(le),k())},o))},S=()=>{const{clientWidth:le,clientHeight:ge}=i.getElement(),Ee=[],de=i.camera,Xe=new I.Frustum,it=new I.Matrix4,ve=de.getWorldDirection(new I.Vector3);it.multiplyMatrices(de.projectionMatrix,de.matrixWorldInverse),Xe.setFromProjectionMatrix(it);const Je=A.tags.filter(Ae=>Xe.containsPoint(Ae.position)&&!Ae.destroying).length,te=A.points.reduce((Ae,Ve)=>{if(A.tags.find(Be=>Ve.id===Be.id&&!Be.destroying))return Ae;const Ze=de.position.clone().setY(n).distanceTo(Ve.position);if(Ze<c||Ze>u||!Xe.containsPoint(Ve.position))return Ae;const on=Ve.position.clone().sub(de.position).setY(0);if(on.angleTo(Ve.normal)>Math.PI/2-r&&on.angleTo(Ve.normal)<Math.PI/2+r)return Ae;const jt=Ve.position.clone().project(de);if(!A.tags.every(Be=>{if(Be.position.clone().sub(de.position).setY(0).angleTo(ve.setY(0))>Math.PI/2)return!0;const kt=Be.position.clone().project(de);return Math.sqrt(Math.pow((jt.x-kt.x)/2*le,2)+Math.pow((jt.y-kt.y)/2*ge,2))>a}))return Ae;const It={id:Ve.id,position:Ve.position,normal:Ve.normal,replacement:Ve.replacement,weight:Ve.weight,distance:Ze};let De;for(let Be=0,kt=Ae.length;Be<kt;Be++){const In=Ae[Be];if(It.weight>In.weight){De=Be;break}if(It.distance<In.distance){De=Be;break}}return De!==void 0?Ae.splice(De,0,It):Ae.push(It),Ae},[]);for(let Ae=0,Ve=te.length;Ae<Ve&&!(Je+Ee.length>=s);Ae++){const Ze=te[Ae];if(Ee.find(De=>Ze.id===De.id))continue;const on=Ze.position.clone().project(de);if(!A.tags.concat(Ee).every(De=>{if(De.position.clone().sub(de.position).setY(0).angleTo(ve.setY(0))>Math.PI/2)return!0;const Be=De.position.clone().project(de);return Math.sqrt(Math.pow((on.x-Be.x)/2*le,2)+Math.pow((on.y-Be.y)/2*ge,2))>a}))continue;const jt=new I.Raycaster(de.position.clone().setY(n),Ze.position.clone().sub(de.position.clone().setY(n)).normalize(),0,Ze.distance+Bs),[It]=A.intersectObjects?jt.intersectObjects(A.intersectObjects,!0):i.model.bvhs.loaded?i.model.intersectRaycaster(jt):jt.intersectObjects(i.model.children,!0);if(!!It&&Ze.distance-It.distance<Bs){const{position:De,normal:Be,id:kt,replacement:In}=Ze,Vl=new I.Plane().setFromNormalAndCoplanarPoint(Be,De),Eo=De.clone().sub(de.position).cross(new I.Vector3(0,1,0)).setLength(Si),Ql=[De.clone(),De.clone().add(Eo),De.clone().add(new I.Vector3(0,Si,0)).add(Eo),De.clone().add(new I.Vector3(0,Si,0))].map(Hl=>Vl.projectPoint(Hl,new I.Vector3)),{container:Rl,dispose:Ol}=h.create3DDomContainer(Ql)||{},Fl=new om({target:Rl,props:{id:kt,content:A.render(A.template,In),lineWidthZoom:.38*(.01+de.position.distanceTo(De)/u),lineHeightZoom:.4+(de.position.distanceTo(De)-c)/u*.6,contentZoom:.1+de.position.distanceTo(De)/u,upsideDown:De.y>l,folded:A.folded,events:A.events,hooks:f,dispose:Ol}});Ee.push({position:De,normal:Be,id:kt,app:Fl})}}return Ee},x=le=>{A.points=le.points.map(ge=>{var Ee,de;return{id:ge.id,position:new I.Vector3().fromArray(ge.position),normal:new I.Vector3().fromArray(ge.normal),replacement:(Ee=ge.replacement)!=null?Ee:{},weight:(de=ge.weight)!=null?de:-1}}),le.render&&(A.render=le.render),le.template&&(A.template=le.template),le.events&&(A.events=le.events),le.enabled===!1&&(A.enabled=le.enabled),le.folded===!0&&(A.folded=le.folded)},Q=le=>{A.intersectObjects=le,C()},_=()=>{A.enabled=!0,C()},O=()=>{A.enabled=!1,p.$set({origins:[]}),A.tags.forEach(le=>{le.app.$destroy(),le=null}),A.origins=[],A.tags=[]},U=()=>{A.folded=!1,A.tags.forEach(le=>{le.app.$set({folded:A.folded})})},j=()=>{A.folded=!0,A.tags.forEach(le=>{le.app.$set({folded:A.folded})})},F=le=>{A.tags.forEach(ge=>{ge.id===le&&ge.app.$set({folded:!1})})},W=le=>{A.tags.forEach(ge=>{ge.id===le&&ge.app.$set({folded:!0})})},X=()=>{i.once("renderFrame",k)},G=()=>{e||(e=i.getElement().parentElement),e&&e.appendChild(d),A.forbidden=!1,n=i.model.bounding.getCenter(new I.Vector3).y,C(),i.on("panoWillArrive",w),i.on("panoArrived",y),i.on("modeChange",P),i.on("cameraUpdate",v)},ee=()=>{g=null,h.disposeAll(),p.$destroy(),A.tags.forEach(le=>{le.app.$destroy(),le=null}),A.origins=[],A.tags=[],i.off("modelLoaded",G),i.off("renderFrame",k),i.off("panoWillArrive",w),i.off("panoArrived",y),i.off("modeChange",P),i.off("cameraUpdate",v),i.off("dispose",ee),window.removeEventListener("resize",X,!1)};return window.addEventListener("resize",X,!1),(ze=i==null?void 0:i.model)!=null&&ze.loaded?G():i.once("modelLoaded",G),i.on("dispose",ee),{load:x,setIntersectObjects:Q,unfoldAll:U,foldAll:j,unfold:F,fold:W,enable:_,disable:O,hooks:f,dispose:ee}};var xt=(i=>(i.SMALL="small",i.MIDLLE="middle",i.LARGE="large",i.EXTRA_LARGE="x-large",i))(xt||{});function hm(i){ce(i,"svelte-1ir3cyd",`.item-label-item.svelte-1ir3cyd{position:absolute;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:0}.item-label-item.visible.svelte-1ir3cyd{opacity:1;animation:svelte-1ir3cyd-fadeIn .3s ease-in}.item-label-item__text-wrap.svelte-1ir3cyd::before{content:'';position:absolute;width:100%;height:100%;background-color:rgba(0, 0, 0, .3);filter:blur(1rem);z-index:-1}.item-label-item__text-wrap.svelte-1ir3cyd{padding:0.375rem 0.375rem 0;position:absolute;height:1.25rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap;line-height:0.625rem;font-size:0.6875rem;font-weight:bold;color:#FFEAC0;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center}.item-label-item__text.svelte-1ir3cyd{padding-bottom:0.25rem;border-top:0 solid;border-left:0 solid;border-right:0 solid;border-bottom:0.0625rem solid;-o-border-image:linear-gradient(to right, rgba(234, 208, 154, 0), rgba(234, 208, 154, 100), rgba(234, 208, 154, 0)) 4.5 1 4.5;border-image:linear-gradient(to right, rgba(234, 208, 154, 0), rgba(234, 208, 154, 100), rgba(234, 208, 154, 0)) 4.5 1 4.5}.item-label-item__bar.svelte-1ir3cyd{position:absolute;bottom:0;width:0.0625rem;background-image:linear-gradient(to bottom, rgba(234, 208, 154, 0), rgba(234, 208, 154, 1))}@keyframes svelte-1ir3cyd-fadeIn{from{opacity:0
|
|
513
513
|
}to{opacity:1
|
|
514
|
-
}}`)}function fm(i){let t,e,n,o=(i[0].name.length>6?`${i[0].name.slice(0,6)}...`:i[0].name)+"",s,r,a,l,c,u;return{c(){t=z("div"),e=z("div"),n=z("span"),s=ke(o),r=$(),a=z("div"),b(n,"class","item-label-item__text svelte-1ir3cyd"),b(e,"class","item-label-item__text-wrap svelte-1ir3cyd"),L(e,"top",`-${i[0].strokeLength+26}px`),b(a,"class","item-label-item__bar svelte-1ir3cyd"),L(a,"height",`${i[0].strokeLength}px`),b(t,"class",l=Te(Ke.default("item-label-item",{visible:i[0].visible}))+" svelte-1ir3cyd"),L(t,"z-index",i[0].zIndex),L(t,"transform",i[0].transform)},m(h,d){T(h,t,d),B(t,e),B(e,n),B(n,s),B(t,r),B(t,a),c||(u=we(n,"click",i[1]),c=!0)},p(h,[d]){d&1&&o!==(o=(h[0].name.length>6?`${h[0].name.slice(0,6)}...`:h[0].name)+"")&&Me(s,o),d&1&&L(e,"top",`-${h[0].strokeLength+26}px`),d&1&&L(a,"height",`${h[0].strokeLength}px`),d&1&&l!==(l=Te(Ke.default("item-label-item",{visible:h[0].visible}))+" svelte-1ir3cyd")&&b(t,"class",l),d&1&&L(t,"z-index",h[0].zIndex),d&1&&L(t,"transform",h[0].transform)},i:Y,o:Y,d(h){h&&M(t),c=!1,u()}}}function mm(i,t,e){let{itemLabel:n}=t,{hooks:o}=t;function s(){o.emit("onLabelClick",n)}return i.$$set=r=>{"itemLabel"in r&&e(0,n=r.itemLabel),"hooks"in r&&e(2,o=r.hooks)},[n,s,o]}class pm extends oe{constructor(t){super(),ie(this,t,mm,fm,ne,{itemLabel:0,hooks:2},hm)}}function ol(i,t=200){let e;return function(...n){clearTimeout(e),e=setTimeout(()=>{i(...n)},t)}}function gm(i){ce(i,"svelte-gk8s47",".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}")}function js(i,t,e){const n=i.slice();return n[26]=t[e],n}function Vs(i,t){let e,n,o;return n=new pm({props:{itemLabel:t[26],hooks:t[0]}}),{key:i,first:null,c(){e=fe(),K(n.$$.fragment),this.first=e},m(s,r){T(s,e,r),J(n,s,r),o=!0},p(s,r){t=s;const a={};r&2&&(a.itemLabel=t[26]),r&1&&(a.hooks=t[0]),n.$set(a)},i(s){o||(E(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&M(e),Z(n,s)}}}function Am(i){let t,e=[],n=new Map,o,s,r=i[1];const a=l=>l[26].id;for(let l=0;l<r.length;l+=1){let c=js(i,r,l),u=a(c);n.set(u,e[l]=Vs(u,c))}return{c(){t=z("div");for(let l=0;l<e.length;l+=1)e[l].c();b(t,"class","item-labels-container svelte-gk8s47"),xe(()=>i[9].call(t)),L(t,"opacity",i[4]?1:0)},m(l,c){T(l,t,c);for(let u=0;u<e.length;u+=1)e[u].m(t,null);o=tt(t,i[9].bind(t)),s=!0},p(l,[c]){c&3&&(r=l[1],se(),e=qe(e,c,a,1,l,r,n,t,Et,Vs,null,js),re()),c&16&&L(t,"opacity",l[4]?1:0)},i(l){if(!s){for(let c=0;c<r.length;c+=1)E(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)D(e[c]);s=!1},d(l){l&&M(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}let Qs=26,vm=11;function bm(i,t,e){const{Raycaster:n,Vector3:o}=I;let{five:s}=t,{modelOcclusionEnable:r}=t,{itemLabels:a}=t,{hooks:l}=t,{displayStrategyType:c}=t,u=null,h=null,d,f,g=[],A=!0;const p=(j,F)=>{const W=new n,X=j.camera.position.clone(),G=new o().fromArray(F.modelPosition),ee=G.distanceTo(X);W.set(X.clone(),G.clone().sub(X).normalize());const[N]=j.model.intersectRaycaster(W);return!(N&&N.distance+1<ee)},v=(j,F)=>{const W=new o(F.modelPosition[0],F.modelPosition[1],F.modelPosition[2]),X=j.project2d(W),G=X==null?void 0:X.x,ee=X==null?void 0:X.y;return[G,ee]},y=j=>`translate(${j[0]}px, ${j[1]}px)`,w=(j,F)=>g.length===0?!1:!!g.find(X=>j[0]>=X[0]-F&&j[0]<=X[0]+F||j[1]>=X[1]-Qs&&j[1]<=X[1]+Qs);function P(j,F){switch(F){case xt.SMALL:return Math.ceil(-27.78*j+85);case xt.MIDLLE:return Math.ceil(-38.9*j+130);case xt.LARGE:return Math.ceil(-44.44*j+140);case xt.EXTRA_LARGE:return Math.ceil(-92.59*j+300)}}const k=(j,F)=>{const W=F.map(G=>{const ee=v(j,G),N=G.name.length*vm,ae=P(G.modelPosition[1],c),ue=(r?p(j,G):!0)&&!w([ee[0],ee[1]+ae],N);if(!ue)return me(
|
|
514
|
+
}}`)}function fm(i){let t,e,n,o=(i[0].name.length>6?`${i[0].name.slice(0,6)}...`:i[0].name)+"",s,r,a,l,c,u;return{c(){t=z("div"),e=z("div"),n=z("span"),s=ke(o),r=$(),a=z("div"),b(n,"class","item-label-item__text svelte-1ir3cyd"),b(e,"class","item-label-item__text-wrap svelte-1ir3cyd"),L(e,"top",`-${i[0].strokeLength+26}px`),b(a,"class","item-label-item__bar svelte-1ir3cyd"),L(a,"height",`${i[0].strokeLength}px`),b(t,"class",l=Te(Ke.default("item-label-item",{visible:i[0].visible}))+" svelte-1ir3cyd"),L(t,"z-index",i[0].zIndex),L(t,"transform",i[0].transform)},m(h,d){T(h,t,d),B(t,e),B(e,n),B(n,s),B(t,r),B(t,a),c||(u=we(n,"click",i[1]),c=!0)},p(h,[d]){d&1&&o!==(o=(h[0].name.length>6?`${h[0].name.slice(0,6)}...`:h[0].name)+"")&&Me(s,o),d&1&&L(e,"top",`-${h[0].strokeLength+26}px`),d&1&&L(a,"height",`${h[0].strokeLength}px`),d&1&&l!==(l=Te(Ke.default("item-label-item",{visible:h[0].visible}))+" svelte-1ir3cyd")&&b(t,"class",l),d&1&&L(t,"z-index",h[0].zIndex),d&1&&L(t,"transform",h[0].transform)},i:Y,o:Y,d(h){h&&M(t),c=!1,u()}}}function mm(i,t,e){let{itemLabel:n}=t,{hooks:o}=t;function s(){o.emit("onLabelClick",n)}return i.$$set=r=>{"itemLabel"in r&&e(0,n=r.itemLabel),"hooks"in r&&e(2,o=r.hooks)},[n,s,o]}class pm extends oe{constructor(t){super(),ie(this,t,mm,fm,ne,{itemLabel:0,hooks:2},hm)}}function ol(i,t=200){let e;return function(...n){clearTimeout(e),e=setTimeout(()=>{i(...n)},t)}}function gm(i){ce(i,"svelte-gk8s47",".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}")}function js(i,t,e){const n=i.slice();return n[26]=t[e],n}function Vs(i,t){let e,n,o;return n=new pm({props:{itemLabel:t[26],hooks:t[0]}}),{key:i,first:null,c(){e=fe(),K(n.$$.fragment),this.first=e},m(s,r){T(s,e,r),J(n,s,r),o=!0},p(s,r){t=s;const a={};r&2&&(a.itemLabel=t[26]),r&1&&(a.hooks=t[0]),n.$set(a)},i(s){o||(E(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&M(e),Z(n,s)}}}function Am(i){let t,e=[],n=new Map,o,s,r=i[1];const a=l=>l[26].id;for(let l=0;l<r.length;l+=1){let c=js(i,r,l),u=a(c);n.set(u,e[l]=Vs(u,c))}return{c(){t=z("div");for(let l=0;l<e.length;l+=1)e[l].c();b(t,"class","item-labels-container svelte-gk8s47"),xe(()=>i[9].call(t)),L(t,"opacity",i[4]?1:0)},m(l,c){T(l,t,c);for(let u=0;u<e.length;u+=1)e[u].m(t,null);o=tt(t,i[9].bind(t)),s=!0},p(l,[c]){c&3&&(r=l[1],se(),e=qe(e,c,a,1,l,r,n,t,Et,Vs,null,js),re()),c&16&&L(t,"opacity",l[4]?1:0)},i(l){if(!s){for(let c=0;c<r.length;c+=1)E(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)D(e[c]);s=!1},d(l){l&&M(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}let Qs=26,vm=11;function bm(i,t,e){const{Raycaster:n,Vector3:o}=I;let{five:s}=t,{modelOcclusionEnable:r}=t,{itemLabels:a}=t,{hooks:l}=t,{displayStrategyType:c}=t,u=null,h=null,d,f,g=[],A=!0;const p=(j,F)=>{const W=new n,X=j.camera.position.clone(),G=new o().fromArray(F.modelPosition),ee=G.distanceTo(X);W.set(X.clone(),G.clone().sub(X).normalize());const[N]=j.model.intersectRaycaster(W);return!(N&&N.distance+1<ee)},v=(j,F)=>{const W=new o(F.modelPosition[0],F.modelPosition[1],F.modelPosition[2]),X=j.project2d(W),G=X==null?void 0:X.x,ee=X==null?void 0:X.y;return[G,ee]},y=j=>`translate(${j[0]}px, ${j[1]}px)`,w=(j,F)=>g.length===0?!1:!!g.find(X=>j[0]>=X[0]-F&&j[0]<=X[0]+F||j[1]>=X[1]-Qs&&j[1]<=X[1]+Qs);function P(j,F){switch(F){case xt.SMALL:return Math.ceil(-27.78*j+85);case xt.MIDLLE:return Math.ceil(-38.9*j+130);case xt.LARGE:return Math.ceil(-44.44*j+140);case xt.EXTRA_LARGE:return Math.ceil(-92.59*j+300)}}const k=(j,F)=>{const W=F.map(G=>{const ee=v(j,G),N=G.name.length*vm,ae=P(G.modelPosition[1],c),ue=(r?p(j,G):!0)&&!w([ee[0],ee[1]+ae],N);if(!ue)return me(R({},G),{visible:ue});g.push(ee);const pe=y(ee);return me(R({},G),{visible:ue,transform:pe,strokeLength:ae})}),X=W.filter(({visible:G})=>G).map(G=>({itemLabelItem:G,distance:new o(G.modelPosition[0],G.modelPosition[1],G.modelPosition[2]).clone().distanceTo(j.camera.position)})).sort((G,ee)=>G.distance-ee.distance);return W.map(G=>{const ee=X.findIndex(N=>N.itemLabelItem.id===G.id);return ee!==void 0?me(R({},G),{zIndex:ee*10}):G})},C=()=>{g=[],e(1,h=k(s,h))};ka(()=>{_()});const S=()=>{e(4,A=!1),x()};Ue(()=>{e(1,h=a),u=a,C(),Q(),s.on("cameraUpdate",S)});const x=ol(()=>{e(4,A=!0),C()},300),Q=()=>{window.addEventListener("resize",O,!1)},_=()=>{u!==a&&(e(1,h=a),u=a,C())},O=()=>{s.once("renderFrame",C)};Pt(()=>{s.off("cameraUpdate",S),window.removeEventListener("resize",O,!1)});function U(){d=this.clientWidth,f=this.clientHeight,e(2,d),e(3,f)}return i.$$set=j=>{"five"in j&&e(5,s=j.five),"modelOcclusionEnable"in j&&e(6,r=j.modelOcclusionEnable),"itemLabels"in j&&e(7,a=j.itemLabels),"hooks"in j&&e(0,l=j.hooks),"displayStrategyType"in j&&e(8,c=j.displayStrategyType)},[l,h,d,f,A,s,r,a,c,U]}class ym extends oe{constructor(t){super(),ie(this,t,bm,Am,ne,{five:5,modelOcclusionEnable:6,itemLabels:7,hooks:0,displayStrategyType:8},gm)}}function wm(i){return i.model_item_labels.map(t=>R({modelPosition:[t.position[0],t.position[1]+t.size[1],t.position[2]]},t))}const Cm=(i,t)=>{var d,f;const e={container:document.createElement("div"),data:null,enabled:!0,fiveModeEnabled:void 0,itemLabels:[],wrapper:null,app:void 0,hooks:new Ce.Subscribe,modelOcclusionEnable:(d=t==null?void 0:t.modelOcclusionEnable)!=null?d:!0,displayStrategyType:(f=t==null?void 0:t.displayStrategyType)!=null?f:xt.SMALL};e.container.setAttribute("class","model-item-label-plugin-container"),e.container.style.cssText=`
|
|
515
515
|
position: absolute;
|
|
516
516
|
left: 0;
|
|
517
517
|
top: 0;
|
|
518
518
|
width: 100%;
|
|
519
519
|
height: 100%;
|
|
520
520
|
z-index: 5;
|
|
521
|
-
`,e.container.style.pointerEvents="none";const n=g=>(e.wrapper=g,g.appendChild(e.container),l(),!0),o=g=>{e.itemLabels=wm(g),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{u(),e.container.remove()},l=()=>{var g;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(g=e.app)==null||g.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new ym({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType}})}},c=()=>{i.on("modeChange",h),i.once("dispose",a)},u=()=>{i.off("modeChange",h)},h=g=>{if(!!e.enabled){if(g!==Ce.Five.Mode.Floorplan){e.fiveModeEnabled=!1,l();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=i.currentMode===Ce.Five.Mode.Floorplan,l()})}};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},Pm={name:"ModelItemLabelPlugin",version:0};var Ft=(i=>(i.TOP_LEFT="topLeft",i.TOP_RIGHT="topRight",i.BOTTOM_LEFT="bottomLeft",i.BOTTOM_RIGHT="bottomRight",i))(Ft||{});function Em(i){if(i.length===0)return[];if(Array.isArray(i[0]))return i;let t=[];return i.forEach(e=>{const n=[e[Ft.TOP_LEFT],e[Ft.BOTTOM_LEFT],e[Ft.BOTTOM_RIGHT],e[Ft.TOP_RIGHT]];t.push(n)}),t}const Im=(i,{videoElement:t})=>{const e={videoMeshes:[],videoTextureEnabled:!1,videoSource:"",rectPoints:[],enabled:!1,videoElement:t},n=Jt(i),o=new Map,s=v=>{e.videoTexture&&(e.videoTexture.image.muted=v)},r=()=>e.videoTexture?e.videoTexture.image.muted:!0,a=()=>{if(e.enabled||!e.videoTexture)return;e.enabled=!0,e.videoMeshes=c(),e.videoMeshes.forEach(y=>i.scene.add(y));const v=()=>{if(!e.videoTexture)return;const y=()=>{var w;!e.videoTexture||((w=e.videoTexture)==null||w.image.removeEventListener("timeupdate",y),e.videoTextureEnabled=!0,e.videoMeshes.forEach(P=>{P.material.map!==e.videoTexture&&(P.material.map=e.videoTexture)}),i.needsRender=!0)};e.videoTexture.image.addEventListener("timeupdate",y),e.videoTexture&&e.videoMeshes.length&&(e.videoTexture.image.play(),e.videoTexture.image.onplay=()=>{n.hide()},e.videoTexture.image.onpause=()=>{n.show()},e.videoTexture.image.onclick=()=>{e.videoTexture.image.muted=!1,e.videoTexture.image.play()})};if(i.model.loaded)v();else return i.once("modelLoaded",()=>v())},l=()=>{!e.enabled||(e.enabled=!1,e.videoMeshes.forEach(v=>{v.geometry.dispose(),v.material.dispose(),i.scene.remove(v),e.videoTexture&&e.videoTexture.image.pause()}),e.videoMeshes=[],i.needsRender=!0)},c=()=>e.rectPoints.map((v,y)=>{const w=new I.BufferGeometry,P=128,k=[];k.push(...v[0].toArray());for(let j=1;j<P;j++)k.push(v[0].x+(v[1].x-v[0].x)*j/P,v[0].y+(v[1].y-v[0].y)*j/P,v[0].z+(v[1].z-v[0].z)*j/P);k.push(...v[1].toArray()),k.push(...v[2].toArray());for(let j=1;j<P;j++)k.push(v[2].x+(v[3].x-v[2].x)*j/P,v[2].y+(v[3].y-v[2].y)*j/P,v[2].z+(v[3].z-v[2].z)*j/P);k.push(...v[3].toArray());const C=[];C.push(0,1);for(let j=1;j<P;j++)C.push(0,1-j/P);C.push(0,0),C.push(1,0);for(let j=1;j<P;j++)C.push(1,j/P);C.push(1,1);const S=[];for(let j=0;j<P;j++)S.push(j,j+1,P*2-j,j,P*2-j,P*2+1-j);w.setAttribute("position",new I.BufferAttribute(new Float32Array(k),3)),w.setAttribute("uv",new I.BufferAttribute(new Float32Array(C),2)),w.setIndex(new I.BufferAttribute(new Uint32Array(S),1));const x=new I.AxesHelper(10);i.scene.add(x);const Q=new I.MeshBasicMaterial({map:e.videoTextureEnabled?e.videoTexture:e.imageTexture,side:I.DoubleSide}),_=new I.Mesh(w,Q);_.renderOrder=1,_.name=`ModelTVVideoPlugin-${y}-${performance.now()}`;const
|
|
521
|
+
`,e.container.style.pointerEvents="none";const n=g=>(e.wrapper=g,g.appendChild(e.container),l(),!0),o=g=>{e.itemLabels=wm(g),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{u(),e.container.remove()},l=()=>{var g;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(g=e.app)==null||g.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new ym({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType}})}},c=()=>{i.on("modeChange",h),i.once("dispose",a)},u=()=>{i.off("modeChange",h)},h=g=>{if(!!e.enabled){if(g!==Ce.Five.Mode.Floorplan){e.fiveModeEnabled=!1,l();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=i.currentMode===Ce.Five.Mode.Floorplan,l()})}};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},Pm={name:"ModelItemLabelPlugin",version:0};var Ft=(i=>(i.TOP_LEFT="topLeft",i.TOP_RIGHT="topRight",i.BOTTOM_LEFT="bottomLeft",i.BOTTOM_RIGHT="bottomRight",i))(Ft||{});function Em(i){if(i.length===0)return[];if(Array.isArray(i[0]))return i;let t=[];return i.forEach(e=>{const n=[e[Ft.TOP_LEFT],e[Ft.BOTTOM_LEFT],e[Ft.BOTTOM_RIGHT],e[Ft.TOP_RIGHT]];t.push(n)}),t}const Im=(i,{videoElement:t})=>{const e={videoMeshes:[],videoTextureEnabled:!1,videoSource:"",rectPoints:[],enabled:!1,videoElement:t},n=Jt(i),o=new Map,s=v=>{e.videoTexture&&(e.videoTexture.image.muted=v)},r=()=>e.videoTexture?e.videoTexture.image.muted:!0,a=()=>{if(e.enabled||!e.videoTexture)return;e.enabled=!0,e.videoMeshes=c(),e.videoMeshes.forEach(y=>i.scene.add(y));const v=()=>{if(!e.videoTexture)return;const y=()=>{var w;!e.videoTexture||((w=e.videoTexture)==null||w.image.removeEventListener("timeupdate",y),e.videoTextureEnabled=!0,e.videoMeshes.forEach(P=>{P.material.map!==e.videoTexture&&(P.material.map=e.videoTexture)}),i.needsRender=!0)};e.videoTexture.image.addEventListener("timeupdate",y),e.videoTexture&&e.videoMeshes.length&&(e.videoTexture.image.play(),e.videoTexture.image.onplay=()=>{n.hide()},e.videoTexture.image.onpause=()=>{n.show()},e.videoTexture.image.onclick=()=>{e.videoTexture.image.muted=!1,e.videoTexture.image.play()})};if(i.model.loaded)v();else return i.once("modelLoaded",()=>v())},l=()=>{!e.enabled||(e.enabled=!1,e.videoMeshes.forEach(v=>{v.geometry.dispose(),v.material.dispose(),i.scene.remove(v),e.videoTexture&&e.videoTexture.image.pause()}),e.videoMeshes=[],i.needsRender=!0)},c=()=>e.rectPoints.map((v,y)=>{const w=new I.BufferGeometry,P=128,k=[];k.push(...v[0].toArray());for(let j=1;j<P;j++)k.push(v[0].x+(v[1].x-v[0].x)*j/P,v[0].y+(v[1].y-v[0].y)*j/P,v[0].z+(v[1].z-v[0].z)*j/P);k.push(...v[1].toArray()),k.push(...v[2].toArray());for(let j=1;j<P;j++)k.push(v[2].x+(v[3].x-v[2].x)*j/P,v[2].y+(v[3].y-v[2].y)*j/P,v[2].z+(v[3].z-v[2].z)*j/P);k.push(...v[3].toArray());const C=[];C.push(0,1);for(let j=1;j<P;j++)C.push(0,1-j/P);C.push(0,0),C.push(1,0);for(let j=1;j<P;j++)C.push(1,j/P);C.push(1,1);const S=[];for(let j=0;j<P;j++)S.push(j,j+1,P*2-j,j,P*2-j,P*2+1-j);w.setAttribute("position",new I.BufferAttribute(new Float32Array(k),3)),w.setAttribute("uv",new I.BufferAttribute(new Float32Array(C),2)),w.setIndex(new I.BufferAttribute(new Uint32Array(S),1));const x=new I.AxesHelper(10);i.scene.add(x);const Q=new I.MeshBasicMaterial({map:e.videoTextureEnabled?e.videoTexture:e.imageTexture,side:I.DoubleSide}),_=new I.Mesh(w,Q);_.renderOrder=1,_.name=`ModelTVVideoPlugin-${y}-${performance.now()}`;const O=[v[1],v[2],v[3],v[0]],U=n.create3DDomContainer(O);if(U!=null&&U.container){const j=document.createElement("div");j.classList.add("play-icon"),j.style.width="100%",j.style.height="100%",j.style.display="flex",j.style.justifyContent="center",j.style.alignItems="center",j.style.pointerEvents="none",U.container.appendChild(j);const F=document.createElement("img");F.src="//vrlab-static.ljcdn.com/release/web/play.2ada5b6f.png",F.style.width="200px",F.style.pointerEvents="auto",F.onclick=()=>{e.videoTexture.image.muted=!1,e.videoTexture.image.play()},j.appendChild(F),o.set(_,U)}return _}),u=v=>{const y=new I.TextureLoader().load(v);return y.minFilter=I.LinearFilter,y.magFilter=I.LinearFilter,y.format=I.RGBFormat,y},h=(v,y)=>new Promise((w,P)=>{const k=new XMLHttpRequest;k.onreadystatechange=()=>{if(k.readyState==4)if(k.status==200){const C=window.URL||window.webkitURL;y=y||document.createElement("video"),y.crossOrigin="anonymous",y.muted=!0,y.loop=!0,y.playsInline=!0,y.src=C.createObjectURL(k.response);const S=new I.VideoTexture(y);S.minFilter=I.LinearFilter,S.magFilter=I.LinearFilter,S.format=I.RGBFormat,w(Object.assign(S,{videoSource:v}))}else P(new Error("Video download Error: "+k.status))},k.onerror=C=>P(C),k.open("GET",v),k.responseType="blob",k.send()}),d=(v,y)=>H(exports,null,function*(){const{video_src:w,video_poster_src:P,points:k}=v;e.videoSource=w,e.rectPoints=Em(k).map(C=>C.map(({x:S,y:x,z:Q})=>new I.Vector3(S,x,Q))),e.imageTexture=u(P),y&&(e.videoElement=y),e.videoTexture=yield h(e.videoSource,e.videoElement),e.enabled=!!v.enable,e.enabled&&a()}),f=v=>{if(!e.enabled)return;const y=e.videoMeshes;if(!(!y||v.intersectObjects(y).length===0))return e.videoTexture&&(e.videoTexture.image.paused||e.videoTexture.image.pause()),!1},g=v=>{v==="Floorplan"?n.hide():n.show()},A=()=>{if(!e.enabled)return;const v=i.camera.position;if(o.forEach((y,w)=>{const P=y.css3DObject.position.clone(),k=P.clone().sub(v).normalize(),C=new I.Raycaster(v,k),S=i.model.intersectRaycaster(C)[0],x=P.distanceTo(v),Q=.01;S&&S.distance+Q<x?y.hide():y.show()}),!r()){const y=e.rectPoints.find(w=>{const P=w[0].clone().add(w[1]).add(w[2]).add(w[3]).divideScalar(4);return w.map(k=>k.clone().add(P).divideScalar(2)).filter(k=>{const C=k.distanceTo(v),S=new I.Raycaster(v,k.clone().sub(v).normalize()),x=i.model.intersectRaycaster(S)[0],Q=.01;return!(x&&x.distance+Q<C)}).length>=2});(!y||y.length===0)&&s(!0)}},p=()=>{l(),e.videoTexture=void 0,i.off("modeChange",g),i.off("wantsTapGesture",f),i.off("panoArrived",A),i.off("renderFrame",()=>{e.videoMeshes.forEach(v=>{v&&(v.needsRender=!0)})})};return i.on("modeChange",g),i.on("wantsTapGesture",f),i.on("panoArrived",A),i.on("renderFrame",()=>{e.videoMeshes.forEach(v=>{v&&(v.needsRender=!0)})}),{enable:a,disable:l,load:d,dispose:p,state:e,css3DRenderPlugin:n}};function km(i){ce(i,"svelte-gduhqw",`.item-label-item.svelte-gduhqw.svelte-gduhqw{position:absolute;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;animation:svelte-gduhqw-fadeIn .3s ease-in}.item-label-item.fold.svelte-gduhqw>.item-label-item__text-wrap.svelte-gduhqw{visibility:hidden}.item-label-item.fold.svelte-gduhqw>.item-label-item__bar.anchor.svelte-gduhqw{visibility:hidden}.item-label-item.fold.svelte-gduhqw>.item-label-item__bar.anchor.svelte-gduhqw:after{visibility:visible}.item-label-item__text-wrap.svelte-gduhqw.svelte-gduhqw{height:-moz-fit-content;height:fit-content;padding:0.75rem 1.25rem 0.75rem 0.75rem;position:absolute;width:-moz-max-content;width:max-content;max-width:29.5625rem;min-height:5.75rem;background-image:linear-gradient(269deg, rgba(0, 0, 0, 0.50) 0%, rgba(0, 0, 0, 0.60) 49%, rgba(31, 38, 46, 0.70) 100%);border:0.09375rem solid rgba(255, 255, 255, .65);border-radius:0.1875rem;color:white;transform:translate(-50%, 0);display:flex;justify-content:flex-start;align-items:center;box-sizing:border-box;overflow:hidden;pointer-events:all}.item-label-item__custom.svelte-gduhqw.svelte-gduhqw{padding:0;max-width:unset;min-height:unset;background-image:unset;border:0;border-radius:0}.icon-wrap.svelte-gduhqw.svelte-gduhqw{width:4.25rem;height:100%;display:flex;justify-content:center;align-content:center}.icon.svelte-gduhqw.svelte-gduhqw{width:4.25rem;height:4.25rem;background-repeat:no-repeat;background-size:contain;background-position:center}.item-label-text.svelte-gduhqw.svelte-gduhqw{margin-left:0.75rem;padding-left:0.75rem;min-height:4.25rem;height:auto;display:flex;flex-flow:column;justify-content:space-around;align-content:flex-start;border-left:solid rgba(255, 255, 255, .2) 0.0625rem;border-top:solid rgba(255, 255, 255, .2) 0;border-right:solid rgba(255, 255, 255, .2) 0;border-bottom:solid rgba(255, 255, 255, .2) 0;pointer-events:auto}.item-model.svelte-gduhqw.svelte-gduhqw{white-space:nowrap;font-size:1.375rem;font-weight:bold;line-height:1.875rem}.item-name.svelte-gduhqw.svelte-gduhqw{height:auto;word-wrap:break-word;word-break:break-all;font-size:1.25rem;line-height:1.75rem}.item-label-item__bar.svelte-gduhqw.svelte-gduhqw{position:absolute;bottom:0;width:0.1875rem;background-image:linear-gradient(to bottom, white, rgba(255, 255, 255, 0));box-shadow:0 0.125rem 0.5rem 0 rgba(0, 0, 0, 0.20);pointer-events:none}.item-label-item__bar.anchor.svelte-gduhqw.svelte-gduhqw:after{content:'';position:absolute;bottom:0;width:1.5rem;height:1.5rem;background-image:url("//vrlab-public.ljcdn.com/common/file/web/67e7a198-28c9-47dc-879b-507bd3ae600c.png ");background-position:center;background-size:contain;transform:translate(-0.65625rem, 50%)}@keyframes svelte-gduhqw-fadeIn{from{opacity:0
|
|
522
522
|
}to{opacity:1
|
|
523
|
-
}}`)}function xm(i){let t,e,n,o=(i[0].code||i[0].id)+"",s,r,a,l=i[0].name+"",c,u=i[0].icon&&
|
|
523
|
+
}}`)}function xm(i){let t,e,n,o=(i[0].code||i[0].id)+"",s,r,a,l=i[0].name+"",c,u=i[0].icon&&Rs(i);return{c(){u&&u.c(),t=$(),e=z("div"),n=z("span"),s=ke(o),r=$(),a=z("span"),c=ke(l),b(n,"class","item-model svelte-gduhqw"),b(a,"class","item-name svelte-gduhqw"),b(e,"class","item-label-text svelte-gduhqw")},m(h,d){u&&u.m(h,d),T(h,t,d),T(h,e,d),B(e,n),B(n,s),B(e,r),B(e,a),B(a,c)},p(h,d){h[0].icon?u?u.p(h,d):(u=Rs(h),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null),d&1&&o!==(o=(h[0].code||h[0].id)+"")&&Me(s,o),d&1&&l!==(l=h[0].name+"")&&Me(c,l)},d(h){u&&u.d(h),h&&M(t),h&&M(e)}}}function Dm(i){let t;return{c(){t=z("div")},m(e,n){T(e,t,n),i[6](t)},p:Y,d(e){e&&M(t),i[6](null)}}}function Rs(i){let t,e,n,o,s;return{c(){t=z("div"),e=z("div"),b(e,"class","icon svelte-gduhqw"),b(e,"style",n=`background-image: url(${i[0].icon})`),b(t,"class","icon-wrap svelte-gduhqw")},m(r,a){T(r,t,a),B(t,e),o||(s=we(t,"click",i[7]),o=!0)},p(r,a){a&1&&n!==(n=`background-image: url(${r[0].icon})`)&&b(e,"style",n)},d(r){r&&M(t),o=!1,s()}}}function Lm(i){let t,e,n,o,s,r,a,l,c,u;function h(g,A){return A&1&&(n=null),n==null&&(n=!!Boolean(typeof g[0].render=="function")),n?Dm:xm}let d=h(i,-1),f=d(i);return{c(){t=z("div"),e=z("div"),f.c(),s=$(),r=z("div"),b(e,"class",o=Te(Ke.default("item-label-item__text-wrap",{"item-label-item__custom":Boolean(typeof i[0].render=="function")}))+" svelte-gduhqw"),L(e,"bottom",`${i[0].strokeLength}px`),b(r,"class",a=Te(Ke.default("item-label-item__bar",{anchor:i[1]}))+" svelte-gduhqw"),L(r,"height",`${i[0].strokeLength}px`),b(t,"class",l=Te(Ke.default("item-label-item",{fold:i[0].isFold}))+" svelte-gduhqw"),L(t,"z-index",i[0].zIndex),L(t,"transform",i[0].transform)},m(g,A){T(g,t,A),B(t,e),f.m(e,null),B(t,s),B(t,r),c||(u=we(e,"click",i[4]),c=!0)},p(g,[A]){d===(d=h(g,A))&&f?f.p(g,A):(f.d(1),f=d(g),f&&(f.c(),f.m(e,null))),A&1&&o!==(o=Te(Ke.default("item-label-item__text-wrap",{"item-label-item__custom":Boolean(typeof g[0].render=="function")}))+" svelte-gduhqw")&&b(e,"class",o),A&1&&L(e,"bottom",`${g[0].strokeLength}px`),A&2&&a!==(a=Te(Ke.default("item-label-item__bar",{anchor:g[1]}))+" svelte-gduhqw")&&b(r,"class",a),A&1&&L(r,"height",`${g[0].strokeLength}px`),A&1&&l!==(l=Te(Ke.default("item-label-item",{fold:g[0].isFold}))+" svelte-gduhqw")&&b(t,"class",l),A&1&&L(t,"z-index",g[0].zIndex),A&1&&L(t,"transform",g[0].transform)},i:Y,o:Y,d(g){g&&M(t),f.d(),c=!1,u()}}}function Sm(i,t,e){let{itemLabel:n}=t,{hooks:o}=t,{anchorEnabled:s}=t,{onIconClick:r}=t;function a(){o.emit("onLabelClick",n)}let l;function c(h){Qe[h?"unshift":"push"](()=>{l=h,e(3,l)})}const u=h=>r(n);return i.$$set=h=>{"itemLabel"in h&&e(0,n=h.itemLabel),"hooks"in h&&e(5,o=h.hooks),"anchorEnabled"in h&&e(1,s=h.anchorEnabled),"onIconClick"in h&&e(2,r=h.onIconClick)},i.$$.update=()=>{if(i.$$.dirty&9&&typeof n.render=="function"&&l&&l.children.length===0){const h=n.render(n);h&&l.appendChild(h)}},[n,s,r,l,a,o,c,u]}class Mm extends oe{constructor(t){super(),ie(this,t,Sm,Lm,ne,{itemLabel:0,hooks:5,anchorEnabled:1,onIconClick:2},km)}}const{Raycaster:Tm,Vector3:Lb}=I,Os=(i,t,e,n)=>{const o=t.clone().sub(e).normalize(),s=new Tm;s.set(e,o);const[r]=i.model.intersectRaycaster(s);return r&&r.distance+.01<n};var Dt=(i=>(i.SMALL="small",i.MIDLLE="middle",i.LARGE="large",i.EXTRA_LARGE="x-large",i))(Dt||{});const zm=(i,t)=>{switch(t){case Dt.SMALL:return Math.ceil(-27.78*i+85);case Dt.MIDLLE:return Math.ceil(-38.9*i+130);case Dt.LARGE:return Math.ceil(-44.44*i+140);case Dt.EXTRA_LARGE:return Math.ceil(-92.59*i+300)}},Bm=i=>`translate(${i[0]}px, ${i[1]}px)`;function Fs(i){return i.map(t=>R({observerIndex:void 0,visible:!1,isFold:!1},t))}function jm(i){ce(i,"svelte-gk8s47",".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}")}function Hs(i,t,e){const n=i.slice();return n[30]=t[e],n}function Gs(i){let t,e;return t=new Mm({props:{itemLabel:i[30],hooks:i[0],anchorEnabled:i[2],onIconClick:i[6]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o[0]&2&&(s.itemLabel=n[30]),o[0]&1&&(s.hooks=n[0]),o[0]&4&&(s.anchorEnabled=n[2]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Ws(i,t){let e,n,o,s=t[30].visible&&Gs(t);return{key:i,first:null,c(){e=fe(),s&&s.c(),n=fe(),this.first=e},m(r,a){T(r,e,a),s&&s.m(r,a),T(r,n,a),o=!0},p(r,a){t=r,t[30].visible?s?(s.p(t,a),a[0]&2&&E(s,1)):(s=Gs(t),s.c(),E(s,1),s.m(n.parentNode,n)):s&&(se(),D(s,1,1,()=>{s=null}),re())},i(r){o||(E(s),o=!0)},o(r){D(s),o=!1},d(r){r&&M(e),s&&s.d(r),r&&M(n)}}}function Vm(i){let t,e=[],n=new Map,o,s,r=i[1];const a=l=>l[30].id;for(let l=0;l<r.length;l+=1){let c=Hs(i,r,l),u=a(c);n.set(u,e[l]=Ws(u,c))}return{c(){t=z("div");for(let l=0;l<e.length;l+=1)e[l].c();b(t,"class","item-labels-container svelte-gk8s47"),xe(()=>i[12].call(t)),L(t,"opacity",i[5]?1:0)},m(l,c){T(l,t,c);for(let u=0;u<e.length;u+=1)e[u].m(t,null);o=tt(t,i[12].bind(t)),s=!0},p(l,c){c[0]&71&&(r=l[1],se(),e=qe(e,c,a,1,l,r,n,t,Et,Ws,null,Hs),re()),c[0]&32&&L(t,"opacity",l[5]?1:0)},i(l){if(!s){for(let c=0;c<r.length;c+=1)E(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)D(e[c]);s=!1},d(l){l&&M(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}let Qm=11;function Rm(i,t,e){const{Raycaster:n,Vector3:o}=I;let{five:s}=t,{modelOcclusionEnable:r}=t,{itemLabels:a}=t,{hooks:l}=t,{displayStrategyType:c}=t,{maxVisibleDistance:u}=t,h=null,d=null,f=(s==null?void 0:s.currentMode)===Ce.Five.Mode.Panorama,g,A,p=[],v=!0;const y=(W,X)=>{const G=W.camera.position.clone(),ee=new o(X.modelPosition[0],X.modelPosition[1],X.modelPosition[2]),N=ee.distanceTo(G);return u!==void 0&&W.state.mode===Ce.Five.Mode.Panorama&&N>u?!1:Os(W,ee.clone().sub(G).normalize(),G,N)},w=W=>{const{camera:X,model:G}=s,{x:ee,y:N,z:ae}=W.clone().project(X),he=(ee+1)/2,ue=(2-(N+1))/2,Le=Math.abs(ae)<1&&[he,ue].every(ze=>ze<1&&ze>=0);return Boolean(Le)},P=(W,X)=>{const G=new o(X.modelPosition[0],X.modelPosition[1],X.modelPosition[2]),ee=W.project2d(G),N=ee==null?void 0:ee.x,ae=ee==null?void 0:ee.y;return[N,ae]},k=(W,X)=>{const G=X.map(N=>{if(W.state.panoIndex!==N.panoIndex)return me(R({},N),{visible:!1});const ae=P(W,N);N.name.length*Qm;const he=zm(N.modelPosition[1],c),ue=W.currentMode===Ce.Five.Mode.Panorama?w(new o(N.position[0],N.position[1],N.position[2])):!0,pe=r?y(W,N):!1,Pe=ue&&!pe;if(!Pe)return me(R({},N),{visible:Pe});p.push(ae);const Le=Bm(ae);return me(R({},N),{visible:Pe,transform:Le,strokeLength:he})}),ee=G.filter(({visible:N})=>N).map(N=>({itemLabelItem:N,distance:new o(N.modelPosition[0],N.modelPosition[1],N.modelPosition[2]).clone().distanceTo(W.camera.position)})).sort((N,ae)=>N.distance-ae.distance);return G.map(N=>{const ae=ee.findIndex(he=>he.itemLabelItem.id===N.id);return ae!==void 0?me(R({},N),{zIndex:ae*10}):N})},C=()=>{p=[],e(1,d=k(s,d))},S=()=>{e(5,v=!1),x()},x=ol(()=>{e(5,v=!0),C()},300),Q=()=>{s.once("renderFrame",C)},_=()=>{window.addEventListener("resize",Q,!1)},O=()=>{h!==a&&(e(1,d=Fs(a)),h=a,C())},U=(W,X)=>{let G=[];for(let N=0;N<X.length;N++){const{position:ae,panoIndex:he}=X[N],ue=W.distanceTo(ae);(u===void 0||ue<=u||s.state.mode!==Ce.Five.Mode.Panorama)&&G.push({panoIndex:he,obVector:ae,distance:ue})}G=G.sort((N,ae)=>N.distance-ae.distance);let ee;for(let N=0;N<G.length;N++){const{obVector:ae,distance:he,panoIndex:ue}=G[N];if(!Os(s,W,ae,he)){ee=ue;break}}return typeof ee=="number"?X[ee]:void 0},j=W=>{if(s.state.mode===Ce.Five.Mode.Panorama)return;const X=s.work.observers,G=new o().fromArray(W.position),ee=U(G,X);if(ee&&(W.observerIndex=ee.panoIndex),typeof W.observerIndex=="number"){const N=X[W.observerIndex],ae=G.clone().sub(N.position).normalize(),he={longitude:Math.PI+Math.atan2(ae.x,ae.z),latitude:Math.acos(ae.y/ae.length())-Math.PI/2};s.setState(me(R({},he),{mode:Ce.Five.Mode.Panorama,panoIndex:W.observerIndex})),s.once("initAnimationEnded",()=>{e(1,d=d.map(ue=>me(R({},ue),{isFold:ue.id!==W.id}))),s.once("cameraUpdate",()=>{e(1,d=d.map(ue=>me(R({},ue),{isFold:!1})))})})}};ka(()=>{O()}),Ue(()=>{e(1,d=Fs(a)),h=a,C(),_(),s.on("cameraUpdate",S)}),Pt(()=>{s.off("cameraUpdate",S),window.removeEventListener("resize",Q,!1)});function F(){g=this.clientWidth,A=this.clientHeight,e(3,g),e(4,A)}return i.$$set=W=>{"five"in W&&e(7,s=W.five),"modelOcclusionEnable"in W&&e(8,r=W.modelOcclusionEnable),"itemLabels"in W&&e(9,a=W.itemLabels),"hooks"in W&&e(0,l=W.hooks),"displayStrategyType"in W&&e(10,c=W.displayStrategyType),"maxVisibleDistance"in W&&e(11,u=W.maxVisibleDistance)},[l,d,f,g,A,v,j,s,r,a,c,u,F]}class Om extends oe{constructor(t){super(),ie(this,t,Rm,Vm,ne,{five:7,modelOcclusionEnable:8,itemLabels:9,hooks:0,displayStrategyType:10,maxVisibleDistance:11},jm,[-1,-1])}}function Fm(i){return i.item_labels.map(t=>me(R({},t),{modelPosition:[t.position[0],t.position[1],t.position[2]],observerIndex:void 0}))}const Hm=void 0,Gm=(i,t)=>{var d,f,g,A;const e={container:document.createElement("div"),data:null,enabled:!0,fiveModeEnabled:!0,itemLabels:[],wrapper:null,app:void 0,hooks:new Ce.Subscribe,modelOcclusionEnable:(d=t==null?void 0:t.modelOcclusionEnable)!=null?d:!0,onlyVisibleInPanorama:(f=t==null?void 0:t.onlyVisibleInPanorama)!=null?f:!0,displayStrategyType:(g=t==null?void 0:t.displayStrategyType)!=null?g:Dt.SMALL,maxVisibleDistance:(A=t==null?void 0:t.maxVisibleDistance)!=null?A:Hm};e.container.setAttribute("class","item-label-plugin-container"),e.container.style.cssText=`
|
|
524
524
|
position: absolute;
|
|
525
525
|
left: 0;
|
|
526
526
|
top: 0;
|
|
527
527
|
width: 100%;
|
|
528
528
|
height: 100%;
|
|
529
529
|
z-index: 5;
|
|
530
|
-
`,e.container.style.pointerEvents="none";const n=p=>(e.wrapper=p,p.appendChild(e.container),l(),!0),o=p=>{e.itemLabels=Fm(p),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{u(),e.container.remove()},l=()=>{var p;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(p=e.app)==null||p.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new Rm({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,onlyVisibleInPanorama:e.onlyVisibleInPanorama,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},c=()=>{i.on("modeChange",h),i.once("dispose",a)},u=()=>{i.off("modeChange",h)},h=p=>{if(p!==Ce.Five.Mode.Panorama){e.fiveModeEnabled=!1,r();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=!0,s()})};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},Wm={name:"ItemLabelPlugin",version:0};class Nm extends Cn{constructor(e){super(e);m(this,"state");m(this,"container");m(this,"enabled");this.five=e,this.five.once("dispose",this.dispose),this.enabled=!0,this.state=this.initState()}enable(e){this.enabled=!0,this.updateState(me(O({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(me(O({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(me(O({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(me(O({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=O({},this.state);this.state=O(O(O({},this.state),e),n),this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===Ce.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState(me(O({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function _m(i){ce(i,"svelte-wpy7pz",'.plugin-DoorLabelPlugin-item.svelte-wpy7pz.svelte-wpy7pz{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity 0.3s ease}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz{position:absolute;top:50%;left:50%;border-radius:0.125rem;background:rgba(0, 0, 0, 0.35);line-height:0.75rem;padding:0.375rem;white-space:nowrap;font-size:0.75rem;font-style:normal;color:white;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform ease 1s, background ease 0.3s, color ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz::after{content:"";display:block;position:absolute;top:-0.0625rem;left:-0.0625rem;bottom:-0.0625rem;right:-0.0625rem;border-radius:0.125rem;border:0.0625rem solid rgba(0, 0, 0, 0);-o-border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;transition:opacity ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(255, 255, 255, 0.5)}.plugin-DoorLabelPlugin-icon.svelte-wpy7pz.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/DoorLabel-icon.de1304ae.svg") no-repeat;background-size:100%;display:inline-block;width:0.625rem;height:0.625rem;margin-left:0.25rem;transform-origin:center}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz{color:#f9eac1}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/arrow.6e8ec00e.svg") no-repeat}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(249, 234, 193, 0.5)}')}function Xm(i){let t,e,n,o,s,r,a,l;return{c(){t=z("div"),e=z("div"),n=z("span"),n.textContent=`${i[8]}`,o=$(),s=z("i"),b(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),b(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),b(e,"class",r=Te(Ke.default("plugin-DoorLabelPlugin-cnt",i[0].toward))+" svelte-wpy7pz"),b(e,"style",`transform: ${i[6]||"initial"};pointer-events: ${i[5]?"auto":"none"};opacity: ${i[5]?1:0}`),b(e,"data-camera-toward",i[7]),b(t,"style",`left: ${i[3]||0}%;top: ${i[4]||0}%;opacity: ${i[5]?1:0}`),b(t,"class","plugin-DoorLabelPlugin-item svelte-wpy7pz")},m(c,u){T(c,t,u),B(t,e),B(e,n),B(e,o),B(e,s),i[10](t),a||(l=we(e,"click",i[9]),a=!0)},p(c,[u]){u&1&&r!==(r=Te(Ke.default("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&b(e,"class",r)},i:Y,o:Y,d(c){c&&M(t),i[10](null),a=!1,l()}}}function Ym(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:u,cameraToward:h,name:d}=n;const f=()=>{if(!r||!a||!l||!s)return;const p=s.current.clientWidth/window.innerWidth*100,v=s.current.clientHeight/window.innerHeight*100;r<=p/2||r>=100-p/2||a<=v/2||a>=100-v/2},g=p=>{o&&o()};function A(p){Qe[p?"unshift":"push"](()=>{s=p,e(2,s)})}return i.$$set=p=>{"props"in p&&e(0,n=p.props),"onClick"in p&&e(1,o=p.onClick)},f(),[n,o,s,r,a,l,c,h,d,g,A]}class Um extends oe{constructor(t){super(),ie(this,t,Ym,Xm,ne,{props:0,onClick:1},_m)}}function qm(i,t){const e=Math.abs(i.top+i.height/2-t.top-t.height/2),n=Math.abs(i.left+i.width/2-t.left-t.width/2),o=(i.height+t.height)/2,s=(i.width+t.width)/2;return!(e>o&&n>s)}function Jm(i){const{camera:t}=i,e=t.getWorldDirection(new V.Vector3);let n=Math.atan(e.z/e.x)*180/Math.PI,o="";return e.x<0&&(n+=180),n<0&&(n+=360),n>315||n<=45?o="right":n>45&&n<=135?o="back":n>135&&n<=225?o="left":n>225&&n<=315&&(o="forward"),o}function Zm(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function Km(i){const t=Math.PI/4;return i>-t&&i<=t?"left":i>t*3||i<=-t*3?"right":i>-t*3&&i<=-t?"forward":i>t&&i<=t*3?"back":""}const $m={userAction:!0};class ep extends Nm{constructor(e){super(e);m(this,"MinVisibledistance",1.8);m(this,"MaxVisibledistance",5);m(this,"OffsetHeight",-1.3);m(this,"rooms");m(this,"floorplanServerData");m(this,"doorLabelItems");m(this,"visibleLabelMap",new Map);m(this,"labelItems",[]);m(this,"doorLabels");m(this,"roomObservers");m(this,"loadData",(e,n)=>{n&&(this.MaxVisibledistance=n.MaxVisibledistance,this.MinVisibledistance=n.MinVisibledistance,this.OffsetHeight=n.OffsetHeight),this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(o=>{o.$destroy()}),this.labelItems=[],this.doorLabels=[],this.doorLabelItems=[],this.floorplanServerData=e,typeof this.five.ready=="function"?this.five.ready().then(()=>this.initData()):this.five.once("panoArrived",()=>{this.initData()})});m(this,"initRoomObservers",()=>{var s,r;const e=this.floorplanServerData.computed_data.floor_datas||[],o=(((r=(s=this.five)==null?void 0:s.work)==null?void 0:r.observers)||[]).map(a=>{const l=a.panoIndex,c=a.floorIndex,u=e==null?void 0:e.find(h=>h.floor_index===c);if(u){const h=u.rooms.find(d=>d.observer_indexs.includes(l));if(h)return{panoIndex:l,floorIndex:c,name:h.name}}}).filter(Boolean);this.roomObservers=o});m(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});m(this,"fixDoorVisibleAndPosition",()=>{this.initRoomObservers();const{panoIndex:e}=this.five;if(!this.visible||this.five.model.empty||e===null||!this.roomObservers.find(a=>a.panoIndex===e))return;const n=this.roomObservers.find(a=>a.panoIndex===e),s=this.five.work.observers.find(a=>a.panoIndex===e).position.clone(),r=(()=>{if(this.visibleLabelMap.has(e))return this.visibleLabelMap.get(e);{const a=[];return this.doorLabels.forEach((l,c)=>{if(l.roomName===n.name)return;const u=l.position.clone(),h=u.distanceTo(s);if(h<this.MinVisibledistance||h>this.MaxVisibledistance)return;const d=new V.Raycaster,f=u.clone().sub(s).normalize();d.set(s,f);const[g]=this.five.model.intersectRaycaster(d);g&&g.distance+.1<h||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});m(this,"fixDoorPosition",()=>{var u,h,d,f,g,A,p,v,y,w,P,k;const{panoIndex:e,camera:n}=this.five;if(e===null)return;if(this.five.currentMode!=="Panorama")return this.hideAllLabels();const o=this.five.getElement(),s=o.clientWidth,r=o.clientHeight,a=n.getWorldDirection(new V.Vector3),l=[],c=[...this.labelItems];if(c.forEach((C,S)=>{if(C.visible){const x=n.position.distanceTo(C.position),Q=C.position.clone().add(new V.Vector3(0,this.OffsetHeight,0)),R=Q.clone().sub(n.position).normalize().angleTo(a),U=Q.clone().project(n),j=(U.x+1)/2.2*100,F=(-U.y+1)/2.2*100,W=j>=0&&j<=100&&F>=0&&F<=100&&x>this.MinVisibledistance&&x<=this.MaxVisibledistance;C.left=j,C.top=F,C.inSight=W&&R<Math.PI/2,C.cameraToward=Jm(this.five),W?l.push({disFromCameraToLabel:x,left:j,top:F,index:S}):C.transform="translate(-50%, -50%)"}else C.inSight=!1}),l.length>1){let C=0;l.sort((S,x)=>x.disFromCameraToLabel-S.disFromCameraToLabel);for(let S=1;S<l.length;S++){const{index:x,left:Q,top:_}=l[S-1],{index:R,left:U,top:j}=l[S],F=this.container.children[x],W=this.container.children[R];if(!F||!W)return;const X={left:s*Q/100,top:r*_/100,width:(d=(h=(u=F.children)==null?void 0:u[0])==null?void 0:h.clientWidth)!=null?d:0,height:(A=(g=(f=F.children)==null?void 0:f[0])==null?void 0:g.clientHeight)!=null?A:0},G={left:s*U/100,top:r*j/100,width:(y=(v=(p=W.children)==null?void 0:p[0])==null?void 0:v.clientWidth)!=null?y:0,height:(k=(P=(w=W.children)==null?void 0:w[0])==null?void 0:P.clientHeight)!=null?k:0};qm(X,G)&&(C++,c[x].transform=`translate(-50%, ${(C-1)*100-50}%)`,c[R].transform=`translate(-50%, ${C*100-50}%)`)}}this.labelItems=c,this.render()});m(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:o}=this.five;let s,r,a=1/0;for(const l of o.observers)if(this.roomObservers.find(u=>u.panoIndex===l.panoIndex&&u.name===e)){const u=l.standingPosition,h=n.distanceTo(u);h<a&&(s=l.panoIndex,r=u.clone().sub(n).normalize(),a=h)}if(r!==null&&s!==null){const l={};if(a>0){const u=new V.Vector3(0,0,-1),h=r.clone(),d=new V.Quaternion;d.setFromUnitVectors(u,h);const f=new V.Euler;f.setFromQuaternion(d,"YXZ"),l.longitude=f.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});m(this,"initData",()=>{var s;this.doorLabels=[];const e=this.five.panoIndex,n=this.floorplanServerData.computed_data.observers[e].floor_index,o=n!==void 0&&((s=this.floorplanServerData.computed_data.floor_datas[n])==null?void 0:s.rooms);this.rooms=o,this.rooms&&this.rooms.length>0&&this.rooms.forEach(r=>{var c;const a=(c=this.floorplanServerData.computed_data.doors)==null?void 0:c.filter(u=>!!(u&&u.name===r.name)),l=this.five.work.observers.filter((u,h)=>!!r.observer_indexs.find(d=>d===h));a&&a.forEach(u=>{const h=u.position;let d=1/0,f;l.forEach(A=>{const p=A.standingPosition,v={x:p.x,y:p.y,z:p.z},y=Zm(h,v);y<d&&(d=y,f=v)}),f&&(h.y=f.y+.01);const g=new V.Vector3(h.x,h.y,h.z);g.add(new V.Vector3(-.2,1.8,0).applyEuler(new V.Euler(0,u.rad,0))),this.doorLabels.push({roomName:r.name,name:u.name,position:g,toward:Km(u.rad)})})}),this.labelItems=this.doorLabels.map(r=>me(O({},r),{left:0,top:0,visible:!1,inSight:!1,transform:"",cameraToward:""})),this.five.on("wantsToMoveToPano",this.hideAllLabels),this.five.on("modelLoaded",this.fixDoorVisibleAndPosition),this.five.on("panoArrived",this.fixDoorVisibleAndPosition),this.five.on("initAnimationEnded",this.fixDoorPosition),this.five.on("cameraUpdate",this.fixDoorPosition),this.five.on("mouseWheel",this.fixDoorPosition),this.five.on("pinchGesture",this.fixDoorPosition),this.fixDoorVisibleAndPosition()})}stateChangedCallback(e,n){if(this.hooks.hasListener("stateChange")){const o={state:this.state,prevState:e,userAction:n?n.userAction:$m.userAction};this.hooks.emit("stateChange",o)}}render(){if(!this.enabled){this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(e=>{e==null||e.$destroy()}),this.doorLabels=void 0;return}this.doorLabelItems&&this.doorLabelItems.forEach(e=>{e.$destroy()}),this.doorLabelItems=[],this.labelItems.forEach(e=>{this.doorLabelItems.push(new Um({target:this.container,props:{props:e,onClick:()=>{this.onClick(e.name,e.position)}}}))})}initState(){return{enabled:!0,visible:!0}}dispose(){this&&this.five&&(this.five.off("wantsToMoveToPano",this.hideAllLabels),this.five.off("modelLoaded",this.fixDoorVisibleAndPosition),this.five.off("panoArrived",this.fixDoorVisibleAndPosition),this.five.off("initAnimationEnded",this.fixDoorPosition),this.five.off("cameraUpdate",this.fixDoorPosition),this.five.off("mouseWheel",this.fixDoorPosition),this.five.off("pinchGesture",this.fixDoorPosition),super.dispose())}}const tp=i=>new ep(i),np=2,ip=3,op=3,sp=2;function rp(i,t){var r,a,l;if(i.length<2)return console.warn("positionList length must be greater than 1"),[];const e=(r=t==null?void 0:t.unitWidth)!=null?r:.5,n=(a=t==null?void 0:t.unitHeight)!=null?a:.5,o=(l=t==null?void 0:t.skipPanoIndexMesh)!=null?l:!1,s=new I.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),u=s.getPoints(c),h=[];let d=0;const f=i;return f.forEach((g,A)=>{let p=0,v=99999999;u.forEach((C,S)=>{const x=C.distanceTo(g);x<v&&(p=S,v=x)});const y=u[p+1],w=y==null?void 0:y.distanceTo(g),P=u[p-1],k=P==null?void 0:P.distanceTo(g);if(p>d&&p-d>1){let C=p;P!==void 0&&k>.8&&(C=p+1),P!==void 0&&k>.2&&k<.3?C=p:v>.2&&v<.3&&(C=p+1);let S=d;if(y!==void 0&&w>.2&&w<.3?S=d+1:v>.2&&v<.3&&(S=d),u[S]&&u[S+1]){const _=f[A-1];if(_)if(_.equals(u[S]))S+=1;else{const R=new V.Vector3().subVectors(u[S+1],u[S]),U=new V.Vector3().subVectors(_,u[S]);R.angleTo(U)<Math.PI/2&&(S+=1)}}if(C<S||C-S<=1)return;const x=u.slice(S,C),Q=Ns(x,e,n);h.push(Q),d=p}}),h}else{const c=Math.ceil(s.getLength()),u=s.getPoints(c);return[Ns(u,e,n)]}}function Ns(i,t,e){const n=t/2,o=e/t,s=i.length,r=nc.default(i.map(v=>[v.x,v.z])),l=(i.length-1)*np*ip,c=2*s,u=c*op,h=c*sp,d=new Uint32Array(l),f=new Float32Array(u),g=new Float32Array(h);i.forEach((v,y)=>{});let A=0;for(let v=0;v<i.length;v++){const[y,w]=r[v][0],P=i[v],{x:k,y:C,z:S}=P,x=new V.Vector3(k+y*n,C+.05,S+w*n);f[v*6+0]=x.x,f[v*6+1]=x.y,f[v*6+2]=x.z;const Q=new V.Vector3(k-y*n,C+.05,S-w*n);f[v*6+3]=Q.x,f[v*6+4]=Q.y,f[v*6+5]=Q.z,A+=v>0?i[v-1].clone().sub(i[v]).length():0;const _=A/t/o;g[v*4+0]=0,g[v*4+1]=_,g[v*4+2]=1,g[v*4+3]=_,v!==i.length-1&&(d[v*6+0]=v*2+0,d[v*6+1]=v*2+2,d[v*6+2]=v*2+1,d[v*6+3]=v*2+2,d[v*6+4]=v*2+3,d[v*6+5]=v*2+1)}const p=new I.BufferGeometry;return p.setAttribute("position",new I.BufferAttribute(f,3)),p.setAttribute("uv",new I.BufferAttribute(g,2)),p.setIndex(new I.BufferAttribute(d,1)),p}function ap(i){const t=new I.TextureLoader().load(i.textureUrl);return t.wrapS=t.wrapT=I.RepeatWrapping,t.encoding=I.sRGBEncoding,new I.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function lp(i){return!yt(i)}function yt(i){return i!=null}const sl="v1.1.0",rl="GuideLinePlugin",Ui=`${rl}@${sl}`,_s=i=>`${Ui}--${i}`;class al extends zt{constructor(e,n){super(e,n);m(this,"state",{visible:!1,enabled:!0,disposed:!1});m(this,"data");m(this,"linesGroup");m(this,"disposedErrorLog",()=>{console.error(`${Ui} is disposed`)});m(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${rl}_DEBUG__`]:this})}load(e,n,o=!0){return H(this,null,function*(){const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.hooks.emit("dataChange",r,s),this.data=r,this.linesGroup&&this.five.scene.remove(this.linesGroup);const a=this.getLinesGroup(r.routes,r.config);!a||(this.linesGroup=a,yield this.waitFiveModelLoaded(),this.five.scene.add(a),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n),this.five.needsRender=!0,this.hooks.emit("dataLoaded",r),console.info(`${Ui} loaded`,r))})}formatData(e){return H(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e})}show(e){return H(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return H(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){var s;if(this.state.disposed)return this.disposedErrorLog();const o=O({},this.state);this.state=O(O({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),et(o,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0}),this.five.needsRender=!0)}handleEnable(e,n=!0){this.linesGroup&&(e?(this.five.scene.add(this.linesGroup),this.actionWhenEnabled(()=>this.hooks.emit("enable",{userAction:n}))):(this.five.scene.remove(this.linesGroup),this.hooks.emit("disable",{userAction:n})))}handleVisible(e,n=!0){this.linesGroup&&(e?(this.linesGroup.visible=!0,this.actionWhenEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.linesGroup.visible=!1,this.actionWhenEnabled(()=>this.hooks.emit("hide",{userAction:n}))))}handleDispose(){this.linesGroup&&this.five.scene.remove(this.linesGroup),this.hooks.emit("dispose")}getLinesGroup(e,n){const o=e.map(r=>this.getLine(r,n)).filter(yt),s=new I.Group;if(s.name=_s("route-group"),o.length!==0)return s.add(...o),s}getLine(e,n){var l,c,u,h,d,f,g,A;const o=new I.Group,s=e.panoIndexList.map(p=>{var v;return(v=this.five.work.observers[p])==null?void 0:v.standingPosition}).filter(yt),r=rp(s,{skipPanoIndexMesh:(c=(l=e.skipPanoIndexMesh)!=null?l:n==null?void 0:n.skipPanoIndexMesh)!=null?c:!0,unitWidth:(h=(u=e.unitWidth)!=null?u:n==null?void 0:n.unitWidth)!=null?h:.6,unitHeight:(f=(d=e.unitHeight)!=null?d:n==null?void 0:n.unitHeight)!=null?f:.4});if(!r)return;const a=ap({textureUrl:(A=(g=e.arrowTextureUrl)!=null?g:n==null?void 0:n.arrowTextureUrl)!=null?A:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return r.forEach(p=>{const v=new I.Mesh(p,a);v.name=_s("route-line-mesh"),o.add(v)}),o}waitFiveModelLoaded(){return H(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}m(al,"lasestVersion",sl);const ll=(i,t)=>new al(i,t);function Xs(i){const t=Math.abs(Math.cos(i.latitude));return new I.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function cp(i,t){const e=Xs(i),n=Xs(t);return e.angleTo(n)}const up=i=>H(exports,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),Fn=Math.PI*2;function dp(i){return i>=0&&i<Fn?i:(i%Fn+Fn)%Fn}function hp(i){return{longitude:dp(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function fp(i,t,e,n){const o=-i/e,s=i;return o*n+s}function mp(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const cl="v1.0.6",ul="CruisePlugin",pi=`${ul}@${cl}`,Ys=()=>{console.error(`${pi} is disposed`)},pp=()=>{console.warn(`${pi} is disabled`)},gp=()=>{console.error(`${pi} is disabled`)},Mi=new Map;class po extends zt{constructor(e,n){super(e,n);m(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});m(this,"data");m(this,"config");m(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});m(this,"GuideLine");this.config=n,Object.assign(window,{[`__${ul}_DEBUG__`]:this});const o=this.setFiveLinearUpdateCamera.bind(this),s=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",o),this.hooks.on("broke",s),this.hooks.on("end",s),this.hooks.on("pause",s),this.privateState.disposers.push(()=>{this.hooks.off("play",o),this.hooks.off("broke",s),this.hooks.off("end",s),this.hooks.off("pause",s)})}load(e,n,o){return H(this,null,function*(){var u,h,d,f,g;if(this.state.disposed)return Ys();this.privateState.fiveOriginGetProgress||(h=(u=this.five.controller)==null?void 0:u.cameraMotion)!=null&&h.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(f=(d=this.five.controller)==null?void 0:d.cameraMotion)==null?void 0:f.getProgress),this.clear();const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.data=r,this.hooks.emit("dataChange",r,s);let a=[],l;const c=this.data.keyframes.filter(A=>A.data.panoIndex!==void 0);c.filter((A,p)=>{var v;return A.data.panoIndex!==((v=c[p-1])==null?void 0:v.data.panoIndex)}).map(A=>A.data.panoIndex).forEach(A=>{var v,y;const p=(v=this.five.work.observers[A])==null?void 0:v.floorIndex;if(p!==void 0)if(l===p){const w=a.length-1;a[w]=[...(y=a[w])!=null?y:[],A]}else{l=p;const w=a.length;a[w]=[A]}}),this.GuideLine||(this.GuideLine=ll(this.five,this.config)),(g=this.GuideLine)==null||g.load({routes:a.map(A=>({panoIndexList:A})),config:r.guildPluginOptions}),this.setState({playing:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing),this.changeSpeed(this.state.speed),n&&this.setState(n,{userAction:o}),console.info(`${pi} loaded`,r),this.hooks.emit("dataLoaded",r)})}play(e){this.setState({playing:!0},e)}playFrom(e){const{index:n,id:o,userAction:s}=e;this.state.playing&&this.setState({playing:!1},{userAction:s}),this.setState({playing:!0},{userAction:s,playFromIndex:n,playFromId:o})}playFromStart(e){return this.playFrom(me(O({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return H(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return H(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){var s;if(this.state.disposed)return Ys();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return gp();const o=O({},this.state);this.state=O(O({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),e.playing!==void 0&&e.playing!==o.playing&&this.changePlayState(e.playing,n),e.speed!==void 0&&e.speed!==o.speed&&this.changeSpeed(e.speed,n==null?void 0:n.userAction),et(o,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0})}formatData(e){return H(this,null,function*(){this.five.work||(yield this.waitFiveLoaded());const n=this.five.work.observers,o=(()=>{const s=e;return typeof s=="object"&&s!==null&&s.version&&s.data?s.data:s})();if(o.keyframes)return{keyframesId:Ge(),keyframes:o.keyframes.map((s,r)=>{var c;const a=o.keyframes[r+1],l=(()=>!a||a.start===void 0||s.end===void 0?0:a.start-s.end)();return me(O({id:(c=s.uuid)!=null?c:Ge(),moveIndex:r,stay:l,index:r},s),{guildPluginOptions:o.guildPluginOptions})})};if(o.panoIndexList){let s=[];const{moveEffect:r,moveToFirstPanoEffect:a,moveToFirstPanoDuration:l}=o;return this.privateState.moveToFirstPanoEffect=a,this.privateState.moveToFirstPanoDuration=l,o.panoIndexList.forEach((c,u)=>{const h=(()=>{var p,v,y,w;const d=o.panoIndexList.slice(u).find(P=>P!==c);if(d===void 0)return;const f=(p=n[c])==null?void 0:p.position,g=(v=n[d])==null?void 0:v.position;if(!g||!f||((y=n[c])==null?void 0:y.floorIndex)!==((w=n[d])==null?void 0:w.floorIndex))return;const A=new I.Vector3().subVectors(g,f);return hp(A)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:u,stay:o.stay,data:O({effect:"Move",panoIndex:c,moveEffect:r},h!=null?h:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:u,stay:o.stay,data:{effect:"Move",panoIndex:c,moveEffect:r}}),h&&s.push({moveIndex:u,stay:o.stay,data:O({effect:"Rotate",panoIndex:c},h)}))}),{keyframesId:Ge(),keyframes:s.map((c,u)=>O({id:Ge(),index:u},c)),guildPluginOptions:o.guildPluginOptions}}else throw new Error("format error: data no keyframes or no panoIndexList")})}handleEnable(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.enable(),this.hooks.emit("enable",{userAction:n})):((s=this.GuideLine)==null||s.disable(),this.changePlayState(!1,{userAction:n}),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):((s=this.GuideLine)==null||s.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}changePlayState(e,n){this.actionIfStateIsEnabled(()=>{var o;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(o=n==null?void 0:n.userAction)!=null?o:!0})}),e?this.handlePlay(n):this.handlePause(n),this.state.playing=e}handlePlay(e){return H(this,null,function*(){var f;const{data:n,state:o,privateState:s,hooks:r}=this;if(s.playing||!(n!=null&&n.keyframes)||(n==null?void 0:n.keyframes.length)===0)return;const a=Ge();s.playId=a,s.playing=!0,s.broke=!1;const l=n.keyframes,c=this.getPauseData();(e==null?void 0:e.notEmitEvent)!==!0&&r.emit("play",{userAction:(f=e==null?void 0:e.userAction)!=null?f:!0});let u=!1;const d=yield(()=>H(this,null,function*(){var g,A;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(g=this.data)==null?void 0:g.keyframes.findIndex(p=>p.id===e.playFromId);if(c!=null&&c.keyframeId){const p=(A=this.data)==null?void 0:A.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect,duration:s.moveToFirstPanoDuration})),p){if(p.data.effect==="Move")return p.index;if(p.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(p,{duration:v}),u=!0,p.index+1}}}}))();this.clearPauseData();for(const g of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(d!==void 0&&g.index<d))try{r.emit("playIndexChange",g.index,g),yield this.playKeyframe(g,{moveEffect:u===!1?s.moveToFirstPanoEffect:void 0,duration:u===!1&&typeof s.moveToFirstPanoDuration=="number"?s.moveToFirstPanoDuration:void 0}),g.stay&&(yield mp(g.stay)),u===!1&&(u=!0)}catch(A){return Promise.resolve("broke")}}o.playing&&a===s.playId&&(this.setState({playing:!1},{userAction:!1}),r.emit("end"),this.clearPauseData())})}handlePause(e){var r;const{state:n,privateState:o,hooks:s}=this;n.playing=!1,o.playing!==!1&&(o.playing=!1,this.setPauseData(),o.broke||this.forceInteruptUpdateCamera(),(e==null?void 0:e.notEmitEvent)!==!0&&s.emit("pause",{userAction:(r=e==null?void 0:e.userAction)!=null?r:!0}))}playKeyframe(e,n){return H(this,null,function*(){var s;const{privateState:o}=this;return((s=this.privateState.currentPlayKeyframe)==null?void 0:s.keyframe.id)!==e.id&&(this.privateState.currentPlayKeyframe={keyframe:e}),o.currentPlayQueue.push(this.getPlayPromise(e,n)),this.actionPromiseQueue()})}addInterruptListener(e){const n=()=>{this.privateState.modeChanging||e()},o=e;return this.five.once("gesture",o),this.five.once("wantsChangeMode",n),()=>{this.five.off("gesture",o),this.five.once("wantsChangeMode",n)}}getPlayPromise(o){return H(this,arguments,function*(e,n={}){var r;const s=e.data;if(n.duration=(r=n.duration)!=null?r:e.start!==void 0&&e.end!==void 0?e.end-e.start:void 0,!!s)return new Promise((a,l)=>{let c=!1;this.addInterruptListener(()=>{if(!c)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),c=!0,l(new Error("play is interupted"))});try{if(c)return;const u=()=>{a(),c=!0};switch(s.effect){case"Move":this.move(s,n).then(u);break;case"Rotate":this.rotate(s,n).then(u);break;default:this.rotate(s,n).then(u)}}catch(u){}})})}actionPromiseQueue(){return H(this,null,function*(){const{privateState:e}=this;return new Promise((n,o)=>{if(e.currentPlayQueue.length===0){n();return}const s=e.currentPlayQueue.shift();if(!s){n();return}s.then(n,o)}).then(()=>e.currentPlayQueue.length===0?Promise.resolve():this.actionPromiseQueue())})}move(e,n){return H(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode(e);else if(e.panoIndex!==this.five.panoIndex)yield this.changePano(e,n);else return Promise.resolve()})}rotate(e,n){return H(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return yield this.changePano(e,n);yield this.updateCamera(e,n)})}updateCamera(o){return H(this,arguments,function*(e,n={}){const{five:s,privateState:r,state:a}=this,l=(()=>{var f,g;const h=(f=a.config)==null?void 0:f.speedConfig,d=(g=e.rotateSpeed)!=null?g:h==null?void 0:h.rotateSpeed;if((h==null?void 0:h.rotateSpeedUnit)===void 0)return d;if(d!==void 0)return h.rotateSpeedUnit==="rad/ms"?d:d/1e3})(),c=(()=>{if(n.duration)return n.duration;if(l){const h=this.five.getCurrentState();return cp(h,e)/l}return 800})();r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=c);const u=this.getSpeededDuration(c);return new Promise(h=>{up(()=>s.updateCamera(e,u)),setTimeout(()=>h(),u)})})}changePano(e,n){return H(this,null,function*(){const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;const a=o.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);const l=(()=>{var d,f;const u=(d=r.config)==null?void 0:d.speedConfig,h=(f=e.moveSpeed)!=null?f:u==null?void 0:u.moveSpeed;if((u==null?void 0:u.moveSpeedUnit)===void 0)return h;if(h!==void 0)return u.moveSpeedUnit==="m/ms"?h:h/1e3})(),c=(()=>{if(n!=null&&n.duration)return n.duration;if(l&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const u=o.work.observers[o.panoIndex].position,h=o.work.observers[e.panoIndex].position;return u.distanceTo(h)/l}return 800})();s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=c),yield new Promise(u=>{var h,d,f;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:this.getSpeededDuration(c),effect:(f=(d=n==null?void 0:n.moveEffect)!=null?d:(h=this.state.config)==null?void 0:h.moveEffect)!=null?f:e.moveEffect,moveCancelCallback:()=>u(),moveEndCallback:()=>u()}),a&&o.once("panoArrived",()=>u())}),a&&(this.privateState.modeChanging=!1)})}changeSpeed(e,n=!0){const{state:o,privateState:s,hooks:r}=this,{currentPlayKeyframe:a}=s;if(r.emit("speedChange",e,{userAction:n}),o.playing&&a)try{const l=a.originDuration!==void 0?a.originDuration*(1-this.getProgress()):void 0,c=this.playKeyframe(a.keyframe,{duration:l});s.currentPlayQueue.push(c)}catch(l){}}getSpeededDuration(e){return e/this.state.speed}getProgress(){return this.five.controller.cameraMotion.progress}changeMode(e,n){return H(this,null,function*(){e.mode&&e.mode!==this.five.currentMode&&(this.privateState.modeChanging=!0,yield this.five.changeMode(e.mode,e,n),this.privateState.modeChanging=!1)})}forceInteruptUpdateCamera(){this.five.updateCamera({},0)}getPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Mi.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return Mi.set((n=this.data)==null?void 0:n.keyframesId,{keyframeId:(o=this.privateState.currentPlayKeyframe)==null?void 0:o.keyframe.id,fiveState:this.five.getCurrentState(),duration:(s=this.privateState.currentPlayKeyframe)==null?void 0:s.originDuration,playedProgress:this.getProgress()})}clearPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Mi.delete((n=this.data)==null?void 0:n.keyframesId)}clear(){this.clearPauseData(),this.privateState.currentPlayKeyframe=null}handleDispose(){var e,n;this.setState({playing:!1}),this.clearPauseData(),this.clear(),(e=this.GuideLine)==null||e.dispose(),this.GuideLine=void 0,(n=this.privateState.disposers)==null||n.forEach(o=>o==null?void 0:o())}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&pp()}waitFiveLoaded(){return H(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}setFiveLinearUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=e=>{const n=this.five.controller.cameraMotion,o=e-n.startTime;return o<0?0:o>=n.duration?1:1-fp(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}m(po,"PluginVersion",cl);const Ap=i=>new po(i);function vp(i){ce(i,"svelte-xuejcm",".line.svelte-xuejcm{position:absolute;pointer-events:none}.line.vertical.svelte-xuejcm{transform:rotate(-90deg) translate3d(0.03125rem, 0, 0.625rem);transform-origin:0 0}.line.horizontal.svelte-xuejcm{transform:translate3d(0, -0.03125rem, 0.625rem)}.straight-line.svelte-xuejcm{display:block;width:100%;height:100%;overflow:visible}")}function Us(i){let t,e,n,o,s,r,a,l=i[3]&&qs(i);return{c(){t=z("div"),e=ye("svg"),n=ye("defs"),o=ye("linearGradient"),s=ye("stop"),r=ye("stop"),l&&l.c(),b(s,"offset","25%"),b(s,"stop-color",i[5]),b(s,"stop-opacity","1"),b(r,"offset","100%"),b(r,"stop-color",i[5]),b(r,"stop-opacity","0.5"),b(o,"x1",.5),b(o,"y1",.5),b(o,"x2",i[8]),b(o,"y2",.5),b(o,"id",i[10]),b(o,"gradientUnits","userSpaceOnUse"),b(e,"class","straight-line svelte-xuejcm"),b(e,"viewBox",a="0 0 "+i[8]+" "+i[7]),b(e,"preserveAspectRatio","none"),b(t,"class","line svelte-xuejcm"),q(t,"vertical",i[9]),q(t,"horizontal",!i[9]),L(t,"width",i[8]+"px"),L(t,"height",i[7]+"px")},m(c,u){T(c,t,u),B(t,e),B(e,n),B(n,o),B(o,s),B(o,r),l&&l.m(e,null)},p(c,u){u&32&&b(s,"stop-color",c[5]),u&32&&b(r,"stop-color",c[5]),u&256&&b(o,"x2",c[8]),c[3]?l?(l.p(c,u),u&8&&E(l,1)):(l=qs(c),l.c(),E(l,1),l.m(e,null)):l&&(se(),D(l,1,1,()=>{l=null}),re()),u&384&&a!==(a="0 0 "+c[8]+" "+c[7])&&b(e,"viewBox",a),u&512&&q(t,"vertical",c[9]),u&512&&q(t,"horizontal",!c[9]),u&256&&L(t,"width",c[8]+"px"),u&128&&L(t,"height",c[7]+"px")},d(c){c&&M(t),l&&l.d()}}}function qs(i){let t,e,n,o,s;return{c(){t=ye("path"),b(t,"fill","none"),b(t,"stroke",e=i[4]?`url(#${i[10]})`:i[5]),b(t,"stroke-width",1),b(t,"d",i[6])},m(r,a){T(r,t,a),s=!0},p(r,a){i=r,(!s||a&48&&e!==(e=i[4]?`url(#${i[10]})`:i[5]))&&b(t,"stroke",e),(!s||a&64)&&b(t,"d",i[6])},i(r){s||(r&&xe(()=>{o&&o.end(1),n=Tt(t,ii,{duration:i[2],delay:i[0],easing:At}),n.start()}),s=!0)},o(r){n&&n.invalidate(),r&&(o=nn(t,ii,{duration:i[2],delay:i[1],easing:At})),s=!1},d(r){r&&M(t),r&&o&&o.end()}}}function bp(i){let t,e=i[8]&&Us(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),T(n,t,o)},p(n,[o]){n[8]?e?e.p(n,o):(e=Us(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:Y,o:Y,d(n){e&&e.d(n),n&&M(t)}}}function yp(i,t,e){let n,o,s,r,{inDelay:a=0}=t,{outDelay:l=0}=t,{duration:c=1e3}=t,{unfolded:u}=t,{length:h}=t,{direction:d="horizontal"}=t,{useLinearColor:f=!1}=t,{color:g="white"}=t;const A=Ge();return i.$$set=p=>{"inDelay"in p&&e(0,a=p.inDelay),"outDelay"in p&&e(1,l=p.outDelay),"duration"in p&&e(2,c=p.duration),"unfolded"in p&&e(3,u=p.unfolded),"length"in p&&e(11,h=p.length),"direction"in p&&e(12,d=p.direction),"useLinearColor"in p&&e(4,f=p.useLinearColor),"color"in p&&e(5,g=p.color)},i.$$.update=()=>{i.$$.dirty&4096&&e(9,n=d==="vertical"),i.$$.dirty&2048&&e(8,o=h),i.$$.dirty&2048&&e(6,r=`M0.5 0.5 H ${h}`)},e(7,s=1),[a,l,c,u,f,g,r,s,o,n,A,h,d]}class go extends oe{constructor(t){super(),ie(this,t,yp,bp,ne,{inDelay:0,outDelay:1,duration:2,unfolded:3,length:11,direction:12,useLinearColor:4,color:5},vp)}}function wp(i){ce(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function Js(i){let t,e,n,o,s;return{c(){t=z("div"),b(t,"class","shadow svelte-faoauy"),b(t,"style",e=`
|
|
530
|
+
`,e.container.style.pointerEvents="none";const n=p=>(e.wrapper=p,p.appendChild(e.container),l(),!0),o=p=>{e.itemLabels=Fm(p),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{u(),e.container.remove()},l=()=>{var p;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(p=e.app)==null||p.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new Om({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,onlyVisibleInPanorama:e.onlyVisibleInPanorama,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},c=()=>{i.on("modeChange",h),i.once("dispose",a)},u=()=>{i.off("modeChange",h)},h=p=>{if(p!==Ce.Five.Mode.Panorama){e.fiveModeEnabled=!1,r();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=!0,s()})};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},Wm={name:"ItemLabelPlugin",version:0};class Nm extends Cn{constructor(e){super(e);m(this,"state");m(this,"container");m(this,"enabled");this.five=e,this.five.once("dispose",this.dispose),this.enabled=!0,this.state=this.initState()}enable(e){this.enabled=!0,this.updateState(me(R({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(me(R({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(me(R({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(me(R({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=R({},this.state);this.state=R(R(R({},this.state),e),n),this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===Ce.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState(me(R({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function _m(i){ce(i,"svelte-wpy7pz",'.plugin-DoorLabelPlugin-item.svelte-wpy7pz.svelte-wpy7pz{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity 0.3s ease}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz{position:absolute;top:50%;left:50%;border-radius:0.125rem;background:rgba(0, 0, 0, 0.35);line-height:0.75rem;padding:0.375rem;white-space:nowrap;font-size:0.75rem;font-style:normal;color:white;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform ease 1s, background ease 0.3s, color ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz::after{content:"";display:block;position:absolute;top:-0.0625rem;left:-0.0625rem;bottom:-0.0625rem;right:-0.0625rem;border-radius:0.125rem;border:0.0625rem solid rgba(0, 0, 0, 0);-o-border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;transition:opacity ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(255, 255, 255, 0.5)}.plugin-DoorLabelPlugin-icon.svelte-wpy7pz.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/DoorLabel-icon.de1304ae.svg") no-repeat;background-size:100%;display:inline-block;width:0.625rem;height:0.625rem;margin-left:0.25rem;transform-origin:center}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz{color:#f9eac1}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/arrow.6e8ec00e.svg") no-repeat}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(249, 234, 193, 0.5)}')}function Xm(i){let t,e,n,o,s,r,a,l;return{c(){t=z("div"),e=z("div"),n=z("span"),n.textContent=`${i[8]}`,o=$(),s=z("i"),b(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),b(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),b(e,"class",r=Te(Ke.default("plugin-DoorLabelPlugin-cnt",i[0].toward))+" svelte-wpy7pz"),b(e,"style",`transform: ${i[6]||"initial"};pointer-events: ${i[5]?"auto":"none"};opacity: ${i[5]?1:0}`),b(e,"data-camera-toward",i[7]),b(t,"style",`left: ${i[3]||0}%;top: ${i[4]||0}%;opacity: ${i[5]?1:0}`),b(t,"class","plugin-DoorLabelPlugin-item svelte-wpy7pz")},m(c,u){T(c,t,u),B(t,e),B(e,n),B(e,o),B(e,s),i[10](t),a||(l=we(e,"click",i[9]),a=!0)},p(c,[u]){u&1&&r!==(r=Te(Ke.default("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&b(e,"class",r)},i:Y,o:Y,d(c){c&&M(t),i[10](null),a=!1,l()}}}function Ym(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:u,cameraToward:h,name:d}=n;const f=()=>{if(!r||!a||!l||!s)return;const p=s.current.clientWidth/window.innerWidth*100,v=s.current.clientHeight/window.innerHeight*100;r<=p/2||r>=100-p/2||a<=v/2||a>=100-v/2},g=p=>{o&&o()};function A(p){Qe[p?"unshift":"push"](()=>{s=p,e(2,s)})}return i.$$set=p=>{"props"in p&&e(0,n=p.props),"onClick"in p&&e(1,o=p.onClick)},f(),[n,o,s,r,a,l,c,h,d,g,A]}class Um extends oe{constructor(t){super(),ie(this,t,Ym,Xm,ne,{props:0,onClick:1},_m)}}function qm(i,t){const e=Math.abs(i.top+i.height/2-t.top-t.height/2),n=Math.abs(i.left+i.width/2-t.left-t.width/2),o=(i.height+t.height)/2,s=(i.width+t.width)/2;return!(e>o&&n>s)}function Jm(i){const{camera:t}=i,e=t.getWorldDirection(new V.Vector3);let n=Math.atan(e.z/e.x)*180/Math.PI,o="";return e.x<0&&(n+=180),n<0&&(n+=360),n>315||n<=45?o="right":n>45&&n<=135?o="back":n>135&&n<=225?o="left":n>225&&n<=315&&(o="forward"),o}function Zm(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function Km(i){const t=Math.PI/4;return i>-t&&i<=t?"left":i>t*3||i<=-t*3?"right":i>-t*3&&i<=-t?"forward":i>t&&i<=t*3?"back":""}const $m={userAction:!0};class ep extends Nm{constructor(e){super(e);m(this,"MinVisibledistance",1.8);m(this,"MaxVisibledistance",5);m(this,"OffsetHeight",-1.3);m(this,"rooms");m(this,"floorplanServerData");m(this,"doorLabelItems");m(this,"visibleLabelMap",new Map);m(this,"labelItems",[]);m(this,"doorLabels");m(this,"roomObservers");m(this,"loadData",(e,n)=>{n&&(this.MaxVisibledistance=n.MaxVisibledistance,this.MinVisibledistance=n.MinVisibledistance,this.OffsetHeight=n.OffsetHeight),this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(o=>{o.$destroy()}),this.labelItems=[],this.doorLabels=[],this.doorLabelItems=[],this.floorplanServerData=e,typeof this.five.ready=="function"?this.five.ready().then(()=>this.initData()):this.five.once("panoArrived",()=>{this.initData()})});m(this,"initRoomObservers",()=>{var s,r;const e=this.floorplanServerData.computed_data.floor_datas||[],o=(((r=(s=this.five)==null?void 0:s.work)==null?void 0:r.observers)||[]).map(a=>{const l=a.panoIndex,c=a.floorIndex,u=e==null?void 0:e.find(h=>h.floor_index===c);if(u){const h=u.rooms.find(d=>d.observer_indexs.includes(l));if(h)return{panoIndex:l,floorIndex:c,name:h.name}}}).filter(Boolean);this.roomObservers=o});m(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});m(this,"fixDoorVisibleAndPosition",()=>{this.initRoomObservers();const{panoIndex:e}=this.five;if(!this.visible||this.five.model.empty||e===null||!this.roomObservers.find(a=>a.panoIndex===e))return;const n=this.roomObservers.find(a=>a.panoIndex===e),s=this.five.work.observers.find(a=>a.panoIndex===e).position.clone(),r=(()=>{if(this.visibleLabelMap.has(e))return this.visibleLabelMap.get(e);{const a=[];return this.doorLabels.forEach((l,c)=>{if(l.roomName===n.name)return;const u=l.position.clone(),h=u.distanceTo(s);if(h<this.MinVisibledistance||h>this.MaxVisibledistance)return;const d=new V.Raycaster,f=u.clone().sub(s).normalize();d.set(s,f);const[g]=this.five.model.intersectRaycaster(d);g&&g.distance+.1<h||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});m(this,"fixDoorPosition",()=>{var u,h,d,f,g,A,p,v,y,w,P,k;const{panoIndex:e,camera:n}=this.five;if(e===null)return;if(this.five.currentMode!=="Panorama")return this.hideAllLabels();const o=this.five.getElement(),s=o.clientWidth,r=o.clientHeight,a=n.getWorldDirection(new V.Vector3),l=[],c=[...this.labelItems];if(c.forEach((C,S)=>{if(C.visible){const x=n.position.distanceTo(C.position),Q=C.position.clone().add(new V.Vector3(0,this.OffsetHeight,0)),O=Q.clone().sub(n.position).normalize().angleTo(a),U=Q.clone().project(n),j=(U.x+1)/2.2*100,F=(-U.y+1)/2.2*100,W=j>=0&&j<=100&&F>=0&&F<=100&&x>this.MinVisibledistance&&x<=this.MaxVisibledistance;C.left=j,C.top=F,C.inSight=W&&O<Math.PI/2,C.cameraToward=Jm(this.five),W?l.push({disFromCameraToLabel:x,left:j,top:F,index:S}):C.transform="translate(-50%, -50%)"}else C.inSight=!1}),l.length>1){let C=0;l.sort((S,x)=>x.disFromCameraToLabel-S.disFromCameraToLabel);for(let S=1;S<l.length;S++){const{index:x,left:Q,top:_}=l[S-1],{index:O,left:U,top:j}=l[S],F=this.container.children[x],W=this.container.children[O];if(!F||!W)return;const X={left:s*Q/100,top:r*_/100,width:(d=(h=(u=F.children)==null?void 0:u[0])==null?void 0:h.clientWidth)!=null?d:0,height:(A=(g=(f=F.children)==null?void 0:f[0])==null?void 0:g.clientHeight)!=null?A:0},G={left:s*U/100,top:r*j/100,width:(y=(v=(p=W.children)==null?void 0:p[0])==null?void 0:v.clientWidth)!=null?y:0,height:(k=(P=(w=W.children)==null?void 0:w[0])==null?void 0:P.clientHeight)!=null?k:0};qm(X,G)&&(C++,c[x].transform=`translate(-50%, ${(C-1)*100-50}%)`,c[O].transform=`translate(-50%, ${C*100-50}%)`)}}this.labelItems=c,this.render()});m(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:o}=this.five;let s,r,a=1/0;for(const l of o.observers)if(this.roomObservers.find(u=>u.panoIndex===l.panoIndex&&u.name===e)){const u=l.standingPosition,h=n.distanceTo(u);h<a&&(s=l.panoIndex,r=u.clone().sub(n).normalize(),a=h)}if(r!==null&&s!==null){const l={};if(a>0){const u=new V.Vector3(0,0,-1),h=r.clone(),d=new V.Quaternion;d.setFromUnitVectors(u,h);const f=new V.Euler;f.setFromQuaternion(d,"YXZ"),l.longitude=f.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});m(this,"initData",()=>{var s;this.doorLabels=[];const e=this.five.panoIndex,n=this.floorplanServerData.computed_data.observers[e].floor_index,o=n!==void 0&&((s=this.floorplanServerData.computed_data.floor_datas[n])==null?void 0:s.rooms);this.rooms=o,this.rooms&&this.rooms.length>0&&this.rooms.forEach(r=>{var c;const a=(c=this.floorplanServerData.computed_data.doors)==null?void 0:c.filter(u=>!!(u&&u.name===r.name)),l=this.five.work.observers.filter((u,h)=>!!r.observer_indexs.find(d=>d===h));a&&a.forEach(u=>{const h=u.position;let d=1/0,f;l.forEach(A=>{const p=A.standingPosition,v={x:p.x,y:p.y,z:p.z},y=Zm(h,v);y<d&&(d=y,f=v)}),f&&(h.y=f.y+.01);const g=new V.Vector3(h.x,h.y,h.z);g.add(new V.Vector3(-.2,1.8,0).applyEuler(new V.Euler(0,u.rad,0))),this.doorLabels.push({roomName:r.name,name:u.name,position:g,toward:Km(u.rad)})})}),this.labelItems=this.doorLabels.map(r=>me(R({},r),{left:0,top:0,visible:!1,inSight:!1,transform:"",cameraToward:""})),this.five.on("wantsToMoveToPano",this.hideAllLabels),this.five.on("modelLoaded",this.fixDoorVisibleAndPosition),this.five.on("panoArrived",this.fixDoorVisibleAndPosition),this.five.on("initAnimationEnded",this.fixDoorPosition),this.five.on("cameraUpdate",this.fixDoorPosition),this.five.on("mouseWheel",this.fixDoorPosition),this.five.on("pinchGesture",this.fixDoorPosition),this.fixDoorVisibleAndPosition()})}stateChangedCallback(e,n){if(this.hooks.hasListener("stateChange")){const o={state:this.state,prevState:e,userAction:n?n.userAction:$m.userAction};this.hooks.emit("stateChange",o)}}render(){if(!this.enabled){this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(e=>{e==null||e.$destroy()}),this.doorLabels=void 0;return}this.doorLabelItems&&this.doorLabelItems.forEach(e=>{e.$destroy()}),this.doorLabelItems=[],this.labelItems.forEach(e=>{this.doorLabelItems.push(new Um({target:this.container,props:{props:e,onClick:()=>{this.onClick(e.name,e.position)}}}))})}initState(){return{enabled:!0,visible:!0}}dispose(){this&&this.five&&(this.five.off("wantsToMoveToPano",this.hideAllLabels),this.five.off("modelLoaded",this.fixDoorVisibleAndPosition),this.five.off("panoArrived",this.fixDoorVisibleAndPosition),this.five.off("initAnimationEnded",this.fixDoorPosition),this.five.off("cameraUpdate",this.fixDoorPosition),this.five.off("mouseWheel",this.fixDoorPosition),this.five.off("pinchGesture",this.fixDoorPosition),super.dispose())}}const tp=i=>new ep(i),np=2,ip=3,op=3,sp=2;function rp(i,t){var r,a,l;if(i.length<2)return console.warn("positionList length must be greater than 1"),[];const e=(r=t==null?void 0:t.unitWidth)!=null?r:.5,n=(a=t==null?void 0:t.unitHeight)!=null?a:.5,o=(l=t==null?void 0:t.skipPanoIndexMesh)!=null?l:!1,s=new I.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),u=s.getPoints(c),h=[];let d=0;const f=i;return f.forEach((g,A)=>{let p=0,v=99999999;u.forEach((C,S)=>{const x=C.distanceTo(g);x<v&&(p=S,v=x)});const y=u[p+1],w=y==null?void 0:y.distanceTo(g),P=u[p-1],k=P==null?void 0:P.distanceTo(g);if(p>d&&p-d>1){let C=p;P!==void 0&&k>.8&&(C=p+1),P!==void 0&&k>.2&&k<.3?C=p:v>.2&&v<.3&&(C=p+1);let S=d;if(y!==void 0&&w>.2&&w<.3?S=d+1:v>.2&&v<.3&&(S=d),u[S]&&u[S+1]){const _=f[A-1];if(_)if(_.equals(u[S]))S+=1;else{const O=new V.Vector3().subVectors(u[S+1],u[S]),U=new V.Vector3().subVectors(_,u[S]);O.angleTo(U)<Math.PI/2&&(S+=1)}}if(C<S||C-S<=1)return;const x=u.slice(S,C),Q=Ns(x,e,n);h.push(Q),d=p}}),h}else{const c=Math.ceil(s.getLength()),u=s.getPoints(c);return[Ns(u,e,n)]}}function Ns(i,t,e){const n=t/2,o=e/t,s=i.length,r=nc.default(i.map(v=>[v.x,v.z])),l=(i.length-1)*np*ip,c=2*s,u=c*op,h=c*sp,d=new Uint32Array(l),f=new Float32Array(u),g=new Float32Array(h);i.forEach((v,y)=>{});let A=0;for(let v=0;v<i.length;v++){const[y,w]=r[v][0],P=i[v],{x:k,y:C,z:S}=P,x=new V.Vector3(k+y*n,C+.05,S+w*n);f[v*6+0]=x.x,f[v*6+1]=x.y,f[v*6+2]=x.z;const Q=new V.Vector3(k-y*n,C+.05,S-w*n);f[v*6+3]=Q.x,f[v*6+4]=Q.y,f[v*6+5]=Q.z,A+=v>0?i[v-1].clone().sub(i[v]).length():0;const _=A/t/o;g[v*4+0]=0,g[v*4+1]=_,g[v*4+2]=1,g[v*4+3]=_,v!==i.length-1&&(d[v*6+0]=v*2+0,d[v*6+1]=v*2+2,d[v*6+2]=v*2+1,d[v*6+3]=v*2+2,d[v*6+4]=v*2+3,d[v*6+5]=v*2+1)}const p=new I.BufferGeometry;return p.setAttribute("position",new I.BufferAttribute(f,3)),p.setAttribute("uv",new I.BufferAttribute(g,2)),p.setIndex(new I.BufferAttribute(d,1)),p}function ap(i){const t=new I.TextureLoader().load(i.textureUrl);return t.wrapS=t.wrapT=I.RepeatWrapping,t.encoding=I.sRGBEncoding,new I.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function lp(i){return!yt(i)}function yt(i){return i!=null}const sl="v1.1.0",rl="GuideLinePlugin",Ui=`${rl}@${sl}`,_s=i=>`${Ui}--${i}`;class al extends zt{constructor(e,n){super(e,n);m(this,"state",{visible:!1,enabled:!0,disposed:!1});m(this,"data");m(this,"linesGroup");m(this,"disposedErrorLog",()=>{console.error(`${Ui} is disposed`)});m(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${rl}_DEBUG__`]:this})}load(e,n,o=!0){return H(this,null,function*(){const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.hooks.emit("dataChange",r,s),this.data=r,this.linesGroup&&this.five.scene.remove(this.linesGroup);const a=this.getLinesGroup(r.routes,r.config);!a||(this.linesGroup=a,yield this.waitFiveModelLoaded(),this.five.scene.add(a),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n),this.five.needsRender=!0,this.hooks.emit("dataLoaded",r),console.info(`${Ui} loaded`,r))})}formatData(e){return H(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e})}show(e){return H(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return H(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){var s;if(this.state.disposed)return this.disposedErrorLog();const o=R({},this.state);this.state=R(R({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),et(o,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0}),this.five.needsRender=!0)}handleEnable(e,n=!0){this.linesGroup&&(e?(this.five.scene.add(this.linesGroup),this.actionWhenEnabled(()=>this.hooks.emit("enable",{userAction:n}))):(this.five.scene.remove(this.linesGroup),this.hooks.emit("disable",{userAction:n})))}handleVisible(e,n=!0){this.linesGroup&&(e?(this.linesGroup.visible=!0,this.actionWhenEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.linesGroup.visible=!1,this.actionWhenEnabled(()=>this.hooks.emit("hide",{userAction:n}))))}handleDispose(){this.linesGroup&&this.five.scene.remove(this.linesGroup),this.hooks.emit("dispose")}getLinesGroup(e,n){const o=e.map(r=>this.getLine(r,n)).filter(yt),s=new I.Group;if(s.name=_s("route-group"),o.length!==0)return s.add(...o),s}getLine(e,n){var l,c,u,h,d,f,g,A;const o=new I.Group,s=e.panoIndexList.map(p=>{var v;return(v=this.five.work.observers[p])==null?void 0:v.standingPosition}).filter(yt),r=rp(s,{skipPanoIndexMesh:(c=(l=e.skipPanoIndexMesh)!=null?l:n==null?void 0:n.skipPanoIndexMesh)!=null?c:!0,unitWidth:(h=(u=e.unitWidth)!=null?u:n==null?void 0:n.unitWidth)!=null?h:.6,unitHeight:(f=(d=e.unitHeight)!=null?d:n==null?void 0:n.unitHeight)!=null?f:.4});if(!r)return;const a=ap({textureUrl:(A=(g=e.arrowTextureUrl)!=null?g:n==null?void 0:n.arrowTextureUrl)!=null?A:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return r.forEach(p=>{const v=new I.Mesh(p,a);v.name=_s("route-line-mesh"),o.add(v)}),o}waitFiveModelLoaded(){return H(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}m(al,"lasestVersion",sl);const ll=(i,t)=>new al(i,t);function Xs(i){const t=Math.abs(Math.cos(i.latitude));return new I.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function cp(i,t){const e=Xs(i),n=Xs(t);return e.angleTo(n)}const up=i=>H(exports,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),Fn=Math.PI*2;function dp(i){return i>=0&&i<Fn?i:(i%Fn+Fn)%Fn}function hp(i){return{longitude:dp(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function fp(i,t,e,n){const o=-i/e,s=i;return o*n+s}function mp(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const cl="v1.0.6",ul="CruisePlugin",pi=`${ul}@${cl}`,Ys=()=>{console.error(`${pi} is disposed`)},pp=()=>{console.warn(`${pi} is disabled`)},gp=()=>{console.error(`${pi} is disabled`)},Mi=new Map;class po extends zt{constructor(e,n){super(e,n);m(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});m(this,"data");m(this,"config");m(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});m(this,"GuideLine");this.config=n,Object.assign(window,{[`__${ul}_DEBUG__`]:this});const o=this.setFiveLinearUpdateCamera.bind(this),s=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",o),this.hooks.on("broke",s),this.hooks.on("end",s),this.hooks.on("pause",s),this.privateState.disposers.push(()=>{this.hooks.off("play",o),this.hooks.off("broke",s),this.hooks.off("end",s),this.hooks.off("pause",s)})}load(e,n,o){return H(this,null,function*(){var u,h,d,f,g;if(this.state.disposed)return Ys();this.privateState.fiveOriginGetProgress||(h=(u=this.five.controller)==null?void 0:u.cameraMotion)!=null&&h.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(f=(d=this.five.controller)==null?void 0:d.cameraMotion)==null?void 0:f.getProgress),this.clear();const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.data=r,this.hooks.emit("dataChange",r,s);let a=[],l;const c=this.data.keyframes.filter(A=>A.data.panoIndex!==void 0);c.filter((A,p)=>{var v;return A.data.panoIndex!==((v=c[p-1])==null?void 0:v.data.panoIndex)}).map(A=>A.data.panoIndex).forEach(A=>{var v,y;const p=(v=this.five.work.observers[A])==null?void 0:v.floorIndex;if(p!==void 0)if(l===p){const w=a.length-1;a[w]=[...(y=a[w])!=null?y:[],A]}else{l=p;const w=a.length;a[w]=[A]}}),this.GuideLine||(this.GuideLine=ll(this.five,this.config)),(g=this.GuideLine)==null||g.load({routes:a.map(A=>({panoIndexList:A})),config:r.guildPluginOptions}),this.setState({playing:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing),this.changeSpeed(this.state.speed),n&&this.setState(n,{userAction:o}),console.info(`${pi} loaded`,r),this.hooks.emit("dataLoaded",r)})}play(e){this.setState({playing:!0},e)}playFrom(e){const{index:n,id:o,userAction:s}=e;this.state.playing&&this.setState({playing:!1},{userAction:s}),this.setState({playing:!0},{userAction:s,playFromIndex:n,playFromId:o})}playFromStart(e){return this.playFrom(me(R({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return H(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return H(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){var s;if(this.state.disposed)return Ys();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return gp();const o=R({},this.state);this.state=R(R({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),e.playing!==void 0&&e.playing!==o.playing&&this.changePlayState(e.playing,n),e.speed!==void 0&&e.speed!==o.speed&&this.changeSpeed(e.speed,n==null?void 0:n.userAction),et(o,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0})}formatData(e){return H(this,null,function*(){this.five.work||(yield this.waitFiveLoaded());const n=this.five.work.observers,o=(()=>{const s=e;return typeof s=="object"&&s!==null&&s.version&&s.data?s.data:s})();if(o.keyframes)return{keyframesId:Ge(),keyframes:o.keyframes.map((s,r)=>{var c;const a=o.keyframes[r+1],l=(()=>!a||a.start===void 0||s.end===void 0?0:a.start-s.end)();return me(R({id:(c=s.uuid)!=null?c:Ge(),moveIndex:r,stay:l,index:r},s),{guildPluginOptions:o.guildPluginOptions})})};if(o.panoIndexList){let s=[];const{moveEffect:r,moveToFirstPanoEffect:a,moveToFirstPanoDuration:l}=o;return this.privateState.moveToFirstPanoEffect=a,this.privateState.moveToFirstPanoDuration=l,o.panoIndexList.forEach((c,u)=>{const h=(()=>{var p,v,y,w;const d=o.panoIndexList.slice(u).find(P=>P!==c);if(d===void 0)return;const f=(p=n[c])==null?void 0:p.position,g=(v=n[d])==null?void 0:v.position;if(!g||!f||((y=n[c])==null?void 0:y.floorIndex)!==((w=n[d])==null?void 0:w.floorIndex))return;const A=new I.Vector3().subVectors(g,f);return hp(A)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:u,stay:o.stay,data:R({effect:"Move",panoIndex:c,moveEffect:r},h!=null?h:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:u,stay:o.stay,data:{effect:"Move",panoIndex:c,moveEffect:r}}),h&&s.push({moveIndex:u,stay:o.stay,data:R({effect:"Rotate",panoIndex:c},h)}))}),{keyframesId:Ge(),keyframes:s.map((c,u)=>R({id:Ge(),index:u},c)),guildPluginOptions:o.guildPluginOptions}}else throw new Error("format error: data no keyframes or no panoIndexList")})}handleEnable(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.enable(),this.hooks.emit("enable",{userAction:n})):((s=this.GuideLine)==null||s.disable(),this.changePlayState(!1,{userAction:n}),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):((s=this.GuideLine)==null||s.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}changePlayState(e,n){this.actionIfStateIsEnabled(()=>{var o;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(o=n==null?void 0:n.userAction)!=null?o:!0})}),e?this.handlePlay(n):this.handlePause(n),this.state.playing=e}handlePlay(e){return H(this,null,function*(){var f;const{data:n,state:o,privateState:s,hooks:r}=this;if(s.playing||!(n!=null&&n.keyframes)||(n==null?void 0:n.keyframes.length)===0)return;const a=Ge();s.playId=a,s.playing=!0,s.broke=!1;const l=n.keyframes,c=this.getPauseData();(e==null?void 0:e.notEmitEvent)!==!0&&r.emit("play",{userAction:(f=e==null?void 0:e.userAction)!=null?f:!0});let u=!1;const d=yield(()=>H(this,null,function*(){var g,A;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(g=this.data)==null?void 0:g.keyframes.findIndex(p=>p.id===e.playFromId);if(c!=null&&c.keyframeId){const p=(A=this.data)==null?void 0:A.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect,duration:s.moveToFirstPanoDuration})),p){if(p.data.effect==="Move")return p.index;if(p.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(p,{duration:v}),u=!0,p.index+1}}}}))();this.clearPauseData();for(const g of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(d!==void 0&&g.index<d))try{r.emit("playIndexChange",g.index,g),yield this.playKeyframe(g,{moveEffect:u===!1?s.moveToFirstPanoEffect:void 0,duration:u===!1&&typeof s.moveToFirstPanoDuration=="number"?s.moveToFirstPanoDuration:void 0}),g.stay&&(yield mp(g.stay)),u===!1&&(u=!0)}catch(A){return Promise.resolve("broke")}}o.playing&&a===s.playId&&(this.setState({playing:!1},{userAction:!1}),r.emit("end"),this.clearPauseData())})}handlePause(e){var r;const{state:n,privateState:o,hooks:s}=this;n.playing=!1,o.playing!==!1&&(o.playing=!1,this.setPauseData(),o.broke||this.forceInteruptUpdateCamera(),(e==null?void 0:e.notEmitEvent)!==!0&&s.emit("pause",{userAction:(r=e==null?void 0:e.userAction)!=null?r:!0}))}playKeyframe(e,n){return H(this,null,function*(){var s;const{privateState:o}=this;return((s=this.privateState.currentPlayKeyframe)==null?void 0:s.keyframe.id)!==e.id&&(this.privateState.currentPlayKeyframe={keyframe:e}),o.currentPlayQueue.push(this.getPlayPromise(e,n)),this.actionPromiseQueue()})}addInterruptListener(e){const n=()=>{this.privateState.modeChanging||e()},o=e;return this.five.once("gesture",o),this.five.once("wantsChangeMode",n),()=>{this.five.off("gesture",o),this.five.once("wantsChangeMode",n)}}getPlayPromise(o){return H(this,arguments,function*(e,n={}){var r;const s=e.data;if(n.duration=(r=n.duration)!=null?r:e.start!==void 0&&e.end!==void 0?e.end-e.start:void 0,!!s)return new Promise((a,l)=>{let c=!1;this.addInterruptListener(()=>{if(!c)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),c=!0,l(new Error("play is interupted"))});try{if(c)return;const u=()=>{a(),c=!0};switch(s.effect){case"Move":this.move(s,n).then(u);break;case"Rotate":this.rotate(s,n).then(u);break;default:this.rotate(s,n).then(u)}}catch(u){}})})}actionPromiseQueue(){return H(this,null,function*(){const{privateState:e}=this;return new Promise((n,o)=>{if(e.currentPlayQueue.length===0){n();return}const s=e.currentPlayQueue.shift();if(!s){n();return}s.then(n,o)}).then(()=>e.currentPlayQueue.length===0?Promise.resolve():this.actionPromiseQueue())})}move(e,n){return H(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode(e);else if(e.panoIndex!==this.five.panoIndex)yield this.changePano(e,n);else return Promise.resolve()})}rotate(e,n){return H(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return yield this.changePano(e,n);yield this.updateCamera(e,n)})}updateCamera(o){return H(this,arguments,function*(e,n={}){const{five:s,privateState:r,state:a}=this,l=(()=>{var f,g;const h=(f=a.config)==null?void 0:f.speedConfig,d=(g=e.rotateSpeed)!=null?g:h==null?void 0:h.rotateSpeed;if((h==null?void 0:h.rotateSpeedUnit)===void 0)return d;if(d!==void 0)return h.rotateSpeedUnit==="rad/ms"?d:d/1e3})(),c=(()=>{if(n.duration)return n.duration;if(l){const h=this.five.getCurrentState();return cp(h,e)/l}return 800})();r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=c);const u=this.getSpeededDuration(c);return new Promise(h=>{up(()=>s.updateCamera(e,u)),setTimeout(()=>h(),u)})})}changePano(e,n){return H(this,null,function*(){const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;const a=o.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);const l=(()=>{var d,f;const u=(d=r.config)==null?void 0:d.speedConfig,h=(f=e.moveSpeed)!=null?f:u==null?void 0:u.moveSpeed;if((u==null?void 0:u.moveSpeedUnit)===void 0)return h;if(h!==void 0)return u.moveSpeedUnit==="m/ms"?h:h/1e3})(),c=(()=>{if(n!=null&&n.duration)return n.duration;if(l&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const u=o.work.observers[o.panoIndex].position,h=o.work.observers[e.panoIndex].position;return u.distanceTo(h)/l}return 800})();s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=c),yield new Promise(u=>{var h,d,f;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:this.getSpeededDuration(c),effect:(f=(d=n==null?void 0:n.moveEffect)!=null?d:(h=this.state.config)==null?void 0:h.moveEffect)!=null?f:e.moveEffect,moveCancelCallback:()=>u(),moveEndCallback:()=>u()}),a&&o.once("panoArrived",()=>u())}),a&&(this.privateState.modeChanging=!1)})}changeSpeed(e,n=!0){const{state:o,privateState:s,hooks:r}=this,{currentPlayKeyframe:a}=s;if(r.emit("speedChange",e,{userAction:n}),o.playing&&a)try{const l=a.originDuration!==void 0?a.originDuration*(1-this.getProgress()):void 0,c=this.playKeyframe(a.keyframe,{duration:l});s.currentPlayQueue.push(c)}catch(l){}}getSpeededDuration(e){return e/this.state.speed}getProgress(){return this.five.controller.cameraMotion.progress}changeMode(e,n){return H(this,null,function*(){e.mode&&e.mode!==this.five.currentMode&&(this.privateState.modeChanging=!0,yield this.five.changeMode(e.mode,e,n),this.privateState.modeChanging=!1)})}forceInteruptUpdateCamera(){this.five.updateCamera({},0)}getPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Mi.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return Mi.set((n=this.data)==null?void 0:n.keyframesId,{keyframeId:(o=this.privateState.currentPlayKeyframe)==null?void 0:o.keyframe.id,fiveState:this.five.getCurrentState(),duration:(s=this.privateState.currentPlayKeyframe)==null?void 0:s.originDuration,playedProgress:this.getProgress()})}clearPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Mi.delete((n=this.data)==null?void 0:n.keyframesId)}clear(){this.clearPauseData(),this.privateState.currentPlayKeyframe=null}handleDispose(){var e,n;this.setState({playing:!1}),this.clearPauseData(),this.clear(),(e=this.GuideLine)==null||e.dispose(),this.GuideLine=void 0,(n=this.privateState.disposers)==null||n.forEach(o=>o==null?void 0:o())}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&pp()}waitFiveLoaded(){return H(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}setFiveLinearUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=e=>{const n=this.five.controller.cameraMotion,o=e-n.startTime;return o<0?0:o>=n.duration?1:1-fp(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}m(po,"PluginVersion",cl);const Ap=i=>new po(i);function vp(i){ce(i,"svelte-xuejcm",".line.svelte-xuejcm{position:absolute;pointer-events:none}.line.vertical.svelte-xuejcm{transform:rotate(-90deg) translate3d(0.03125rem, 0, 0.625rem);transform-origin:0 0}.line.horizontal.svelte-xuejcm{transform:translate3d(0, -0.03125rem, 0.625rem)}.straight-line.svelte-xuejcm{display:block;width:100%;height:100%;overflow:visible}")}function Us(i){let t,e,n,o,s,r,a,l=i[3]&&qs(i);return{c(){t=z("div"),e=ye("svg"),n=ye("defs"),o=ye("linearGradient"),s=ye("stop"),r=ye("stop"),l&&l.c(),b(s,"offset","25%"),b(s,"stop-color",i[5]),b(s,"stop-opacity","1"),b(r,"offset","100%"),b(r,"stop-color",i[5]),b(r,"stop-opacity","0.5"),b(o,"x1",.5),b(o,"y1",.5),b(o,"x2",i[8]),b(o,"y2",.5),b(o,"id",i[10]),b(o,"gradientUnits","userSpaceOnUse"),b(e,"class","straight-line svelte-xuejcm"),b(e,"viewBox",a="0 0 "+i[8]+" "+i[7]),b(e,"preserveAspectRatio","none"),b(t,"class","line svelte-xuejcm"),q(t,"vertical",i[9]),q(t,"horizontal",!i[9]),L(t,"width",i[8]+"px"),L(t,"height",i[7]+"px")},m(c,u){T(c,t,u),B(t,e),B(e,n),B(n,o),B(o,s),B(o,r),l&&l.m(e,null)},p(c,u){u&32&&b(s,"stop-color",c[5]),u&32&&b(r,"stop-color",c[5]),u&256&&b(o,"x2",c[8]),c[3]?l?(l.p(c,u),u&8&&E(l,1)):(l=qs(c),l.c(),E(l,1),l.m(e,null)):l&&(se(),D(l,1,1,()=>{l=null}),re()),u&384&&a!==(a="0 0 "+c[8]+" "+c[7])&&b(e,"viewBox",a),u&512&&q(t,"vertical",c[9]),u&512&&q(t,"horizontal",!c[9]),u&256&&L(t,"width",c[8]+"px"),u&128&&L(t,"height",c[7]+"px")},d(c){c&&M(t),l&&l.d()}}}function qs(i){let t,e,n,o,s;return{c(){t=ye("path"),b(t,"fill","none"),b(t,"stroke",e=i[4]?`url(#${i[10]})`:i[5]),b(t,"stroke-width",1),b(t,"d",i[6])},m(r,a){T(r,t,a),s=!0},p(r,a){i=r,(!s||a&48&&e!==(e=i[4]?`url(#${i[10]})`:i[5]))&&b(t,"stroke",e),(!s||a&64)&&b(t,"d",i[6])},i(r){s||(r&&xe(()=>{o&&o.end(1),n=Tt(t,ii,{duration:i[2],delay:i[0],easing:At}),n.start()}),s=!0)},o(r){n&&n.invalidate(),r&&(o=nn(t,ii,{duration:i[2],delay:i[1],easing:At})),s=!1},d(r){r&&M(t),r&&o&&o.end()}}}function bp(i){let t,e=i[8]&&Us(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),T(n,t,o)},p(n,[o]){n[8]?e?e.p(n,o):(e=Us(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:Y,o:Y,d(n){e&&e.d(n),n&&M(t)}}}function yp(i,t,e){let n,o,s,r,{inDelay:a=0}=t,{outDelay:l=0}=t,{duration:c=1e3}=t,{unfolded:u}=t,{length:h}=t,{direction:d="horizontal"}=t,{useLinearColor:f=!1}=t,{color:g="white"}=t;const A=Ge();return i.$$set=p=>{"inDelay"in p&&e(0,a=p.inDelay),"outDelay"in p&&e(1,l=p.outDelay),"duration"in p&&e(2,c=p.duration),"unfolded"in p&&e(3,u=p.unfolded),"length"in p&&e(11,h=p.length),"direction"in p&&e(12,d=p.direction),"useLinearColor"in p&&e(4,f=p.useLinearColor),"color"in p&&e(5,g=p.color)},i.$$.update=()=>{i.$$.dirty&4096&&e(9,n=d==="vertical"),i.$$.dirty&2048&&e(8,o=h),i.$$.dirty&2048&&e(6,r=`M0.5 0.5 H ${h}`)},e(7,s=1),[a,l,c,u,f,g,r,s,o,n,A,h,d]}class go extends oe{constructor(t){super(),ie(this,t,yp,bp,ne,{inDelay:0,outDelay:1,duration:2,unfolded:3,length:11,direction:12,useLinearColor:4,color:5},vp)}}function wp(i){ce(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function Js(i){let t,e,n,o,s;return{c(){t=z("div"),b(t,"class","shadow svelte-faoauy"),b(t,"style",e=`
|
|
531
531
|
left:${Ne(i[5])};
|
|
532
532
|
bottom:${Ne(i[6])};
|
|
533
533
|
box-shadow: 0 0 ${Ne(i[10])} ${Ne(i[11])} rgba(0, 0, 0, ${i[12]});
|
|
@@ -541,9 +541,9 @@ void main() {
|
|
|
541
541
|
${i[8]?"transform: translateX(-50%); left: 50%":""}
|
|
542
542
|
${i[9]?"transform: translateX(-50%); top: 50%":""}
|
|
543
543
|
${i[7]?"transform: translate(-50%, -50%); left: 50%; top: 50%;":""}
|
|
544
|
-
`))&&b(t,"style",e),a&8&&L(t,"width",Ne(i[3])),a&16&&L(t,"height",Ne(i[4])),a&8192&&L(t,"z-index",i[13])},i(r){s||(r&&xe(()=>{o&&o.end(1),n=Tt(t,Mt,{duration:i[0]}),n.start()}),s=!0)},o(r){n&&n.invalidate(),r&&(o=nn(t,Mt,{duration:i[1]})),s=!1},d(r){r&&M(t),r&&o&&o.end()}}}function Cp(i){let t,e=i[2]&&Js(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),T(n,t,o)},p(n,[o]){n[2]?e?(e.p(n,o),o&4&&E(e,1)):(e=Js(n),e.c(),E(e,1),e.m(t.parentNode,t)):e&&(se(),D(e,1,1,()=>{e=null}),re())},i(n){E(e)},o(n){D(e)},d(n){e&&e.d(n),n&&M(t)}}}function Ne(i){return typeof i=="number"?i/16+"rem":i}function Pp(i,t,e){let{inDelay:n=1e3}=t,{outDelay:o=1e3}=t,{visible:s=!0}=t,{width:r=0}=t,{height:a=0}=t,{left:l=0}=t,{bottom:c=0}=t,{center:u=!1}=t,{horizontalCenter:h=!1}=t,{verticalCenter:d=!1}=t,{blurRadius:f}=t,{spreadRadius:g}=t,{opacity:A=.15}=t,{zIndex:p=-1}=t;return i.$$set=v=>{"inDelay"in v&&e(0,n=v.inDelay),"outDelay"in v&&e(1,o=v.outDelay),"visible"in v&&e(2,s=v.visible),"width"in v&&e(3,r=v.width),"height"in v&&e(4,a=v.height),"left"in v&&e(5,l=v.left),"bottom"in v&&e(6,c=v.bottom),"center"in v&&e(7,u=v.center),"horizontalCenter"in v&&e(8,h=v.horizontalCenter),"verticalCenter"in v&&e(9,d=v.verticalCenter),"blurRadius"in v&&e(10,f=v.blurRadius),"spreadRadius"in v&&e(11,g=v.spreadRadius),"opacity"in v&&e(12,A=v.opacity),"zIndex"in v&&e(13,p=v.zIndex)},[n,o,s,r,a,l,c,u,h,d,f,g,A,p]}class nt extends oe{constructor(t){super(),ie(this,t,Pp,Cp,ne,{inDelay:0,outDelay:1,visible:2,width:3,height:4,left:5,bottom:6,center:7,horizontalCenter:8,verticalCenter:9,blurRadius:10,spreadRadius:11,opacity:12,zIndex:13},wp)}}function Ep(i,t){t.forEach(e=>{const n=new I.SphereGeometry(.02,16,16),o=[],s=[new I.MeshBasicMaterial({color:16776960}),new I.MeshBasicMaterial({color:16711935}),new I.MeshBasicMaterial({color:16711680}),new I.MeshBasicMaterial({color:65535})];if(e.position.length===4)e.position.forEach((r,a)=>{const l=s[a],c=new I.Mesh(n,l);c.position.copy(ft(r)),o.push(c)});else{const r=s[0],a=new I.Mesh(n,r);a.position.copy(ft(e.position)),o.push(a)}o.forEach(r=>{r.material.depthTest=!1,i.scene.add(r)})})}const Re=i=>i;function qi(i){if(i.length<3)return;const t=i.map(gn),e=t[1].clone().sub(t[0]),n=t[2].clone().sub(t[1]);return e.cross(n)}var dl=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Image="Image",i.Video="Video",i.Link="Link",i.Sticker="Sticker",i.VRLink="VRLink",i.PanoLink="PanoLink",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.MediaModel="MediaModel",i.Custom="Custom",i.Unknown="Unknown",i))(dl||{}),hl=(i=>(i.Two="2D",i.Three="3D",i))(hl||{}),fl=(i=>(i.PointTag="PointTag",i.PlaneTag="PlaneTag",i))(fl||{});function Ip(i){return i.stickType==="3DPoint"||i.stickType==="Plane"}function He(i){return i.stickType==="Model"&&i.contentType==="MediaModel"}function Ji(i){if(!!i)if(Array.isArray(i)&&i.length===4){const e=i.map(gn);return to(e[0],e[2])}else return gn(i)}function Zs(i){if(He(i)&&i.matrix){const t=new V.Matrix4().fromArray(i.matrix),e=i.data.mediaPosition.map(n=>new V.Vector3().fromArray(n).applyMatrix4(t));return to(e[0],e[2])}else return Ji(i.position)}function an(i,t){if(i===void 0)return;const{min:e,max:n}=t!=null?t:{};if(!(e===void 0&&n===void 0))return!(typeof n=="number"&&n<i||typeof e=="number"&&e>i)}function kp(i){return new Promise(t=>{i.model.loaded?t():i.once("modelLoaded",()=>t())})}function xp(i,t,e){const o=new I.Plane().setFromNormalAndCoplanarPoint(e,t),s=t.clone().sub(i).cross(new I.Vector3(0,1,0)).setLength(.01),r=new I.Vector3(0,.01,0);return[t.clone().sub(s).sub(r),t.clone().add(s).sub(r),t.clone().add(s).add(r),t.clone().sub(s).add(r)].map(l=>o.projectPoint(l,new I.Vector3))}const Ks=(i,t=1e3/60)=>{let e=null;const n=i;return(...s)=>{e&&clearTimeout(e),e=setTimeout(()=>{n==null||n(...s),e&&clearTimeout(e),e=null},t)}};function Dp(i,t=200){let e;return function(...n){e||(i.apply(this,n),e=setTimeout(function(){e=null},t))}}function Lp(i,t){const[e,n]=t;if(e>=n||n<=1||e<=1)return-1;const o={},s=r=>(o[r]||(o[r]=i(r)),o[r]);for(let r=e;r<n;r++){const a=s(r),l=s(r-1);if(a<l)return r}return-1}function $s(i,t){if(!t||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",i),unobserve:()=>window.removeEventListener("resize",i)};{const e=new ResizeObserver(i);return{observe:()=>e.observe(t),unobserve:()=>e.unobserve(t)}}}function Sp(){return Math.random().toString(36).slice(-6)}const Ti=Sp();function Mp(i){ce(i,"svelte-1b2n9wi",".text-char.svelte-1b2n9wi{display:inline-block;text-shadow:0.125rem 0rem 0.5rem rgba(0, 0, 0, 0.15)}")}function er(i,t,e){const n=i.slice();return n[18]=t[e].id,n[0]=t[e].content,n[19]=t,n[20]=e,n}function Tp(i){let t,e=i[0]+"",n,o=i[20];const s=()=>i[9](t,o),r=()=>i[9](null,o);return{c(){t=z("span"),n=ke(e),b(t,"class","text-char svelte-1b2n9wi")},m(a,l){T(a,t,l),B(t,n),s()},p(a,l){i=a,l&4&&e!==(e=i[0]+"")&&Me(n,e),o!==i[20]&&(r(),o=i[20],s())},d(a){a&&M(t),r()}}}function zp(i){let t,e=i[20];const n=()=>i[8](t,e),o=()=>i[8](null,e);return{c(){t=z("span"),t.textContent="\xA0",b(t,"class","text-char svelte-1b2n9wi")},m(s,r){T(s,t,r),n()},p(s,r){i=s,e!==i[20]&&(o(),e=i[20],n())},d(s){s&&M(t),o()}}}function tr(i,t){let e,n;function o(a,l){return a[0]===a[3]?zp:Tp}let s=o(t),r=s(t);return{key:i,first:null,c(){e=fe(),r.c(),n=fe(),this.first=e},m(a,l){T(a,e,l),r.m(a,l),T(a,n,l)},p(a,l){t=a,s===(s=o(t))&&r?r.p(t,l):(r.d(1),r=s(t),r&&(r.c(),r.m(n.parentNode,n)))},d(a){a&&M(e),r.d(a),a&&M(n)}}}function Bp(i){let t=[],e=new Map,n,o=i[2];const s=r=>r[18];for(let r=0;r<o.length;r+=1){let a=er(i,o,r),l=s(a);e.set(l,t[r]=tr(l,a))}return{c(){for(let r=0;r<t.length;r+=1)t[r].c();n=fe()},m(r,a){for(let l=0;l<t.length;l+=1)t[l].m(r,a);T(r,n,a)},p(r,[a]){a&14&&(o=r[2],t=qe(t,a,s,1,r,o,e,n.parentNode,so,tr,n,er))},i:Y,o:Y,d(r){for(let a=0;a<t.length;a+=1)t[a].d(r);r&&M(n)}}}function jp(i,t,e){let n,{inDelay:o=0}=t,{outDelay:s=0}=t,{content:r}=t,{unfolded:a}=t,{isFistUnfoldedUpdate:l=!0}=t;const c=`__EMOJI_SPLIT_${Ti}__`,u=`__EMOJI_${Ti}__`,h=`__SPACE_${Ti}__`;let d,f,g=[];function A(k){const C=[],S=new RegExp(new RegExp("\\p{Regional_Indicator}\\p{Regional_Indicator}|\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?(\\u200D\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?)+|\\p{Emoji_Presentation}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?|\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)","gu"));return k.slice().replace(S,x=>`${c}${u}${x}${c}`).split(c).forEach(x=>x.startsWith(u)?C.push({id:Ge(),content:x.slice(u.length)}):C.push(...x.split("").map(Q=>Q===" "?h:Q).map(Q=>({id:Ge(),content:Q})))),C}function p(){if(!f)return;const k=!a;f.reversed!==k&&f.reverse(),f.play()}function v(k){if(l){e(4,l=!1);return}clearTimeout(d),d=setTimeout(p,k?o:s)}function y(k){const C=function(){const S=Lp(x=>k[x].getBoundingClientRect().x,[Math.min(k.length-1,10),Math.min(k.length-1,30)]);if(S>0)return S}();f=ko.default({targets:k.slice(0,C).filter(yt),autoplay:!1,duration:400,scale:[.7,1],rotate:[20,0],opacity:[0,1],translateX:[4,0],translateY:[10,0],delay:ko.default.stagger(50),easing:"easeInOutCubic"}),a&&f.seek(f.duration)}function w(k,C){Qe[k?"unshift":"push"](()=>{g[C]=k,e(1,g)})}function P(k,C){Qe[k?"unshift":"push"](()=>{g[C]=k,e(1,g)})}return i.$$set=k=>{"inDelay"in k&&e(5,o=k.inDelay),"outDelay"in k&&e(6,s=k.outDelay),"content"in k&&e(0,r=k.content),"unfolded"in k&&e(7,a=k.unfolded),"isFistUnfoldedUpdate"in k&&e(4,l=k.isFistUnfoldedUpdate)},i.$$.update=()=>{i.$$.dirty&1&&e(2,n=A(r)),i.$$.dirty&128&&v(a),i.$$.dirty&2&&y(g.filter(k=>!!k))},[r,g,n,h,l,o,s,a,w,P]}class ml extends oe{constructor(t){super(),ie(this,t,jp,Bp,ne,{inDelay:5,outDelay:6,content:0,unfolded:7,isFistUnfoldedUpdate:4},Mp)}}const Vp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAKqADAAQAAAABAAAAKgAAAADUGqULAAAB0ElEQVRYCe2WSUoEQRBFLVHEiV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ddIjrJGdkoKUx8HsdP60atWqf3C8RARmzg2m4UXfSM9jeSW8rq6u8vr163+TV8JfyQx3e9LZuHHjoQsXLvSMdKckYt9KL53tu/sBHXeeeJMk0rdJ5P2kQXkvqXXOnDnlEr8pTyUPrVmz5qvOzs7/lQTCkU4y1LtGkjIfmIlMnJ+K/MojfzIrl8B3kpU1osxJSYtTAL8wKf4EYJQFk+JeQMlvE3UcLRmTkkUANm1ZOZmE24dqGU5gOfCyZkyGWQT+IykW8zmSz0IpiLNN8t5iTmdTkgGTrInI7JcfULaH10Qnh/4IMVjAxNk6jxwajuUb8lqOZRT3S/lx06RY1g8C4akfiEJAOZdFKzsq/nNjIssdufjbhQAEAUodOGDWp4m8S0oHEhb+YexGkD4EBUpdVMrfl/E/RhNJnsjF/ls0r980YRQDlAqBylIqylcCzf4lHecB5veigSfmYoBycaxN2SHgT8e7pWKZwCzqzZpigUr9DlRuoIxXn8pIZJgHtkwpa8togHIiw587LeNx9mc2ZwIK5DOlXJaMFqhWwoMp/Ax+1W+ToOXTHGKNrDMLLo38LmKsQKmbdSrWil+N82UJaS40YTuJv/RdtAdpzet+aJDzvMpQV71oo2gYX5RXG2HnYZXtouzNRzXE3R0KE6jWjZU2iaZ9u8pqpU3UfvwrYSgSBVDtGDurBlHn/zj0QMIh7qlDNOfmcBj9ihKo9o+l1euiWGxSE5eun3na6jxQk3joEgdQ7TR+FWutE43lhQpph3sQvISAVRa9ppRzipY4gZqdw8/WigIWDWt1gD8EIsqSLlT/KPUVlKSAujs2XTLYeRHiIlA2DVi1qkRtK8PSULaEDF+Ue7ashwkTlf8DQc/cITdx9+UAAAAASUVORK5CYII=",Rp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAMAAAANIilAAAABcVBMVEUAAAAAAAD////////+/v45OTn////////39/fp6enPz8/7+/vw8PD+/v7x8fHc3NzHx8f////////+/v77+/vr6+v////7+/v5+fn////z8/P////////q6uqgoKD+/v79/f3m5ub+/v7////////////////39/f39/f////z8/P////t7e3s7Oz29vb////5+fn////h4eH////g4ODV1dX////////BwcH///////////+Ojo5zc3MlJSX////////////////////////7+/v////////////v7+/u7u7n5+f////39/f////09PT6+vr09PT+/v76+vr////5+fnv7+/09PTk5OT////////////////Jycn///++vr7///////+0tLT///9TU1P///8SEhL////////+/v76+vr////8/Pz39/ft7e3t7e36+vr////////X19fV1dX///+xsbF9fX1iYmL///////+K8mOEAAAAenRSTlMaAIDy8CD41cWRX9uk7Kl1VVEw6dWT/M/NvKyVkY475eWIgx0Z39rHv7axnZyZmIuKhn56emZjX1FEPTU0Kx4PCAX69fTgxcKkopWL7crJuri2sa6rnIyHhX54bVtZVU9NSUcsJSIcFROno6Hcwp+ekHVxbWhnRC8nDLc9s8oAAAOGSURBVEjHpdd3X9pAGAfwkBBDAoQmBJmWvUWWiIDIHoJb66x7a4d78Op7pBQ1J5DY33987vnyXEIu3CGy/0hvnDthM+l0hj3JScSudDKOdhNPpl1i8Ut624Gi6+trI3zW1tcdqGM7/SIC5/ZRR2SNJEm7JkHt7FAJjR18WIs40P3cAFxIOaIRna6ZOHxGunk+TDR1ukjUkSr0w86bcKShiz1OI4JMP8YAD9+4emM2Gm407IfIhzm0NxrhKNsLH4SvQ+RktyvUfZIMXYcPPsSFCcvY6EYW6ZPsxuiYZaLwAW5bDY70Da5paxjvm8d+UcjAUL/GzPtCnDF/mwFWhJ75Zs68x05gxxFRGQfa+RYXokHVCC4O4yOqYLTwBjNB+ncWEZnsbzrIvOLz4CW9g4jODn0ZPO/iZN0UmhaPp0Omq+Q/nLu6NO0hErJnurjKdTBzEdAhkqILXDAdbFkJ7EnDe4EVy198srpiwhE4X1RKDFOqviBwcNPK6gmPmeWlGDz+VdHqRPEVHo0tLTM8RpcX4G+flLe6kU/Cs1pYRnm8uriQhfoC+0ZDvbMLi6ttfO5fDCDCKFrvooAKAov+c4BZvy8EzaolCHRdIZ+fBThl9G0Ih1RCrBJWbPiMKYAZ409oMSqFWAktzJ9GBuDvRoVGOIQJMSas0CiM39u45v0M9tbaeLc6F5M+7dhcbRfgg+pcU/oNa85VDwDOzBtmpP9UKsN8BuCzeb1P+kPi08+fASyr6fVPUh/PJ72+xj/bZk5PSV0YlJ4z83iC4EipS5LkiAkeHxGcQerLwMARRzyW+QklhUgKpST8nXfYg+fHkjS89MPz0MFnhKdCSWpc8RBnPAZB3RUvLt7i3oob7f5juDzuikY81tjcHlcHg9xabdyUWDvF2ay3slecr1ptimNx9lhhs1bzXQxy5NZa6VMx9pS2Wt1H77cVjFartYvBdlDICDc0cbVa3Twd2NcOyuLwVqo+K1ebjgdcr0k+O1uXwThfl8vlhqm+99kASup5GINsYhhmG8d7UXzcBgo2e21cd9WlUll5/7G958ql8uxu7y0zS5SGSkOGBA51TRiGQAi232Y9v4kVQZGavpt6c6l3tLpNsc38gGOC01IeLg4Xi8NaLz1KkqO0VzvcTrFscYo4oLjiRAsKEXeJPRqxW0bsFWLGLVbiocyZSm5vbW0nU9BsIfyp/AGqAvfOkBaFawAAAABJRU5ErkJggg==";function Fp(i){ce(i,"svelte-1ogmlqq",".arrow.svelte-1ogmlqq{width:100%;height:100%;background-size:100%;transition:transform 400ms ease-in-out;cursor:pointer;pointer-events:auto}.arrow-wrapper.svelte-1ogmlqq{position:relative;width:100%;height:100%}.arrow.left.svelte-1ogmlqq{transform:rotate(0deg)}.arrow.right.svelte-1ogmlqq{transform:rotate(-180deg)}.arrow.top.svelte-1ogmlqq{transform:rotate(90deg)}.arrow.bottom.svelte-1ogmlqq{transform:rotate(-90deg)}")}function nr(i){let t,e,n,o,s,r,a,l,c,u;return e=new nt({props:{center:!0,blurRadius:9,spreadRadius:3}}),{c(){t=z("div"),K(e.$$.fragment),n=$(),o=z("div"),b(o,"class",s="arrow "+i[0]+" svelte-1ogmlqq"),L(o,"background-image","url("+Vp+")"),b(t,"class","arrow-wrapper svelte-1ogmlqq")},m(h,d){T(h,t,d),J(e,t,null),B(t,n),B(t,o),l=!0,c||(u=we(o,"click",i[5]),c=!0)},p(h,d){i=h,(!l||d&1&&s!==(s="arrow "+i[0]+" svelte-1ogmlqq"))&&b(o,"class",s)},i(h){l||(E(e.$$.fragment,h),h&&xe(()=>{a&&a.end(1),r=Tt(o,Mt,{duration:i[2],delay:i[3],easing:_t}),r.start()}),l=!0)},o(h){D(e.$$.fragment,h),r&&r.invalidate(),h&&(a=nn(o,Mt,{duration:i[2],delay:i[4],easing:_t})),l=!1},d(h){h&&M(t),Z(e),h&&a&&a.end(),c=!1,u()}}}function Hp(i){let t,e,n=i[1]&&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[1]?n?(n.p(o,s),s&2&&E(n,1)):(n=nr(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Gp(i,t,e){let{direction:n="right"}=t,{visible:o=!0}=t,{duration:s=0}=t,{inDelay:r=0}=t,{outDelay:a=0}=t;function l(c){wn.call(this,i,c)}return i.$$set=c=>{"direction"in c&&e(0,n=c.direction),"visible"in c&&e(1,o=c.visible),"duration"in c&&e(2,s=c.duration),"inDelay"in c&&e(3,r=c.inDelay),"outDelay"in c&&e(4,a=c.outDelay)},[n,o,s,r,a,l]}class Wp extends oe{constructor(t){super(),ie(this,t,Gp,Hp,ne,{direction:0,visible:1,duration:2,inDelay:3,outDelay:4},Fp)}}function Np(i,t,e=20,n=5){return new Promise((o,s)=>{let r=0;const a=setInterval(()=>{const l=i();t(l)?(clearInterval(a),o(l)):r>=n&&(clearInterval(a),s(l)),r++},e)})}function _p(i){ce(i,"svelte-1fuzm7v",".text.svelte-1fuzm7v{pointer-events:auto;box-sizing:border-box;display:inline-block;max-width:7.5rem;transition:transform 400ms ease-in-out;font-size:0.75rem;line-height:1.125rem;white-space:initial;cursor:pointer}.arrow.svelte-1fuzm7v{pointer-events:auto;display:inline-block;vertical-align:top;width:0.875rem;height:0.875rem;margin-left:0.125rem;margin-top:0.125rem}")}function ir(i){let t,e,n;return e=new ml({props:{unfolded:i[0],content:i[1],inDelay:500,outDelay:i[5]}}),{c(){t=z("div"),K(e.$$.fragment),b(t,"class","text svelte-1fuzm7v"),L(t,"transform",i[7])},m(o,s){T(o,t,s),J(e,t,null),i[10](t),n=!0},p(o,s){const r={};s&1&&(r.unfolded=o[0]),s&2&&(r.content=o[1]),s&32&&(r.outDelay=o[5]),e.$set(r),s&128&&L(t,"transform",o[7])},i(o){n||(E(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e),i[10](null)}}}function or(i){let t,e,n;return e=new Wp({props:{direction:i[6],visible:i[0],inDelay:600,duration:1e3}}),{c(){t=z("div"),K(e.$$.fragment),b(t,"class","arrow svelte-1fuzm7v")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s&64&&(r.direction=o[6]),s&1&&(r.visible=o[0]),e.$set(r)},i(o){n||(E(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function Xp(i){let t,e,n,o=i[1]&&ir(i),s=i[3]<i[4]&&or(i);return{c(){o&&o.c(),t=$(),s&&s.c(),e=fe()},m(r,a){o&&o.m(r,a),T(r,t,a),s&&s.m(r,a),T(r,e,a),n=!0},p(r,[a]){r[1]?o?(o.p(r,a),a&2&&E(o,1)):(o=ir(r),o.c(),E(o,1),o.m(t.parentNode,t)):o&&(se(),D(o,1,1,()=>{o=null}),re()),r[3]<r[4]?s?(s.p(r,a),a&24&&E(s,1)):(s=or(r),s.c(),E(s,1),s.m(e.parentNode,e)):s&&(se(),D(s,1,1,()=>{s=null}),re())},i(r){n||(E(o),E(s),n=!0)},o(r){D(o),D(s),n=!1},d(r){o&&o.d(r),r&&M(t),s&&s.d(r),r&&M(e)}}}function Yp(i,t,e){let n,o,s,{visible:r=!1}=t,{textUnfolded:a=!1}=t,{content:l}=t,c,u=0,h=0,d=0;function f(g){Qe[g?"unshift":"push"](()=>{c=g,e(2,c)})}return i.$$set=g=>{"visible"in g&&e(0,r=g.visible),"textUnfolded"in g&&e(8,a=g.textUnfolded),"content"in g&&e(1,l=g.content)},i.$$.update=()=>{if(i.$$.dirty&7&&c&&r&&l){const{lineHeight:g}=getComputedStyle(c);e(4,d=c.offsetHeight),Np(()=>c==null?void 0:c.offsetHeight,Boolean).then(()=>{e(4,d=c.offsetHeight)}),e(3,h=Number(g.replace("px","")))}i.$$.dirty&280&&e(9,u=a?h-d:0),i.$$.dirty&512&&e(7,n=`translateY(${u}px)`),i.$$.dirty&256&&e(6,o=a?"left":"right"),i.$$.dirty&256&&e(5,s=a?450:0)},[r,l,c,h,d,s,o,n,a,u,f]}class pl extends oe{constructor(t){super(),ie(this,t,Yp,Xp,ne,{visible:0,textUnfolded:8,content:1},_p)}}function Up(i){ce(i,"svelte-nlvd3x",".content.svelte-nlvd3x{width:-moz-max-content;width:max-content;height:3.375rem;padding:2.25rem 0.25rem 0 1rem;position:absolute;left:0;bottom:0;overflow:hidden;box-sizing:border-box;font-size:0;pointer-events:none;white-space:nowrap;font-weight:600}")}function sr(i){var h,d;let t,e,n,o,s,r,a,l,c,u;return t=new nt({props:{visible:i[2],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}}),n=new go({props:{unfolded:i[2],length:i[3],outDelay:i[4]+40*Math.min((d=(h=i[6][0])==null?void 0:h.content.length)!=null?d:10,15),useLinearColor:!0}}),r=new pl({props:{visible:i[2],textUnfolded:i[1],content:i[5]}}),{c(){K(t.$$.fragment),e=$(),K(n.$$.fragment),o=$(),s=z("div"),K(r.$$.fragment),b(s,"class","content svelte-nlvd3x"),xe(()=>i[8].call(s))},m(f,g){J(t,f,g),T(f,e,g),J(n,f,g),T(f,o,g),T(f,s,g),J(r,s,null),a=tt(s,i[8].bind(s)),l=!0,c||(u=we(s,"click",i[7]),c=!0)},p(f,g){var y,w;const A={};g&4&&(A.visible=f[2]),g&8&&(A.left=f[3]/2+"px"),t.$set(A);const p={};g&4&&(p.unfolded=f[2]),g&8&&(p.length=f[3]),g&16&&(p.outDelay=f[4]+40*Math.min((w=(y=f[6][0])==null?void 0:y.content.length)!=null?w:10,15)),n.$set(p);const v={};g&4&&(v.visible=f[2]),g&2&&(v.textUnfolded=f[1]),g&32&&(v.content=f[5]),r.$set(v)},i(f){l||(E(t.$$.fragment,f),E(n.$$.fragment,f),E(r.$$.fragment,f),l=!0)},o(f){D(t.$$.fragment,f),D(n.$$.fragment,f),D(r.$$.fragment,f),l=!1},d(f){Z(t,f),f&&M(e),Z(n,f),f&&M(o),f&&M(s),Z(r),a(),c=!1,u()}}}function qp(i){let t,e,n=i[0].state&&sr(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&&E(n,1)):(n=sr(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Jp(i,t,e){let n,o,s,{tag:r}=t,a,l=!1,c=[];function u(){e(1,l=!l)}function h(){a=this.clientWidth,e(3,a)}return i.$$set=d=>{"tag"in d&&e(0,r=d.tag)},i.$$.update=()=>{var d,f,g;i.$$.dirty&1&&e(2,n=!!((d=r.state)!=null&&d.unfolded)),i.$$.dirty&1&&e(5,o=(g=(f=r.data.title)!=null?f:r.data.text)!=null?g:""),i.$$.dirty&4&&(n||setTimeout(()=>{e(1,l=!1)},20)),i.$$.dirty&2&&e(4,s=l?450:0)},[r,l,n,a,s,o,c,u,h]}class Zp extends oe{constructor(t){super(),ie(this,t,Jp,qp,ne,{tag:0},Up)}}function Ie(i){return typeof i=="number"?i/16+"rem":i}function Kp(i){ce(i,"svelte-i9wdo4",".text.svelte-i9wdo4{display:-webkit-box;display:-ms-box;display:-moz-box;position:relative;width:-moz-max-content;width:max-content;max-width:100%;-webkit-box-orient:vertical;-ms-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}@keyframes svelte-i9wdo4-blink{0%{opacity:1}50%{opacity:0}100%{opacity:1}}.caret.svelte-i9wdo4{position:absolute;width:0.0625rem;height:100%;background-color:#fff;animation:svelte-i9wdo4-blink 1.2s infinite}.placeholder.svelte-i9wdo4{opacity:0.5}")}function $p(i){let t;const e=i[6].default,n=Kt(e,i,i[5],null);return{c(){n&&n.c()},m(o,s){n&&n.m(o,s),t=!0},p(o,s){n&&n.p&&(!t||s&32)&&en(n,e,o,o[5],t?$t(e,o[5],s,null):tn(o[5]),null)},i(o){t||(E(n,o),t=!0)},o(o){D(n,o),t=!1},d(o){n&&n.d(o)}}}function eg(i){var s,r;let t,e,n=((s=i[3])==null?void 0:s.inputting)&&rr(),o=((r=i[3])==null?void 0:r.placeholder)&&ar(i);return{c(){n&&n.c(),t=$(),o&&o.c(),e=fe()},m(a,l){n&&n.m(a,l),T(a,t,l),o&&o.m(a,l),T(a,e,l)},p(a,l){var c,u;(c=a[3])!=null&&c.inputting?n||(n=rr(),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),(u=a[3])!=null&&u.placeholder?o?o.p(a,l):(o=ar(a),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},i:Y,o:Y,d(a){n&&n.d(a),a&&M(t),o&&o.d(a),a&&M(e)}}}function tg(i){let t;return{c(){t=ke(i[2])},m(e,n){T(e,t,n)},p(e,n){n&4&&Me(t,e[2])},i:Y,o:Y,d(e){e&&M(t)}}}function rr(i){let t;return{c(){t=z("div"),b(t,"class","caret svelte-i9wdo4")},m(e,n){T(e,t,n)},d(e){e&&M(t)}}}function ar(i){let t,e=i[3].placeholder+"",n;return{c(){t=z("span"),n=ke(e),b(t,"class","placeholder svelte-i9wdo4")},m(o,s){T(o,t,s),B(t,n)},p(o,s){s&8&&e!==(e=o[3].placeholder+"")&&Me(n,e)},d(o){o&&M(t)}}}function ng(i){let t,e,n,o;const s=[tg,eg,$p],r=[];function a(l,c){return l[2]?0:l[4]?1:2}return e=a(i),n=r[e]=s[e](i),{c(){t=z("div"),n.c(),b(t,"class","text svelte-i9wdo4"),L(t,"max-width",typeof i[1]=="number"?Ie(i[1]):i[1]),L(t,"-webkit-line-clamp",i[0])},m(l,c){T(l,t,c),r[e].m(t,null),o=!0},p(l,[c]){let u=e;e=a(l),e===u?r[e].p(l,c):(se(),D(r[u],1,1,()=>{r[u]=null}),re(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),E(n,1),n.m(t,null)),c&2&&L(t,"max-width",typeof l[1]=="number"?Ie(l[1]):l[1]),c&1&&L(t,"-webkit-line-clamp",l[0])},i(l){o||(E(n),o=!0)},o(l){D(n),o=!1},d(l){l&&M(t),r[e].d()}}}function ig(i,t,e){let n,{$$slots:o={},$$scope:s}=t,{maxLine:r=1}=t,{maxWidth:a=null}=t,{text:l=null}=t,{edit:c=null}=t;return i.$$set=u=>{"maxLine"in u&&e(0,r=u.maxLine),"maxWidth"in u&&e(1,a=u.maxWidth),"text"in u&&e(2,l=u.text),"edit"in u&&e(3,c=u.edit),"$$scope"in u&&e(5,s=u.$$scope)},i.$$.update=()=>{i.$$.dirty&8&&e(4,n=(c==null?void 0:c.placeholder)||(c==null?void 0:c.inputting))},[r,a,l,c,n,s,o]}class Ao extends oe{constructor(t){super(),ie(this,t,ig,ng,ne,{maxLine:0,maxWidth:1,text:2,edit:3},Kp)}}function og(i){ce(i,"svelte-1oxrkr1",".plane__container.svelte-1oxrkr1.svelte-1oxrkr1{position:absolute;left:50%;transform:translate(-50%, -100%);width:-moz-max-content;width:max-content}.plane__wrapper.svelte-1oxrkr1.svelte-1oxrkr1{transition:transform 500ms linear, opacity 200ms linear;padding:0.625rem;background-color:rgba(0, 0, 0, 0.5);border:0.03125rem solid rgba(255, 255, 255, 0.3);border-radius:0.25rem}.unfolded.svelte-1oxrkr1 .plane__wrapper.svelte-1oxrkr1{transition-delay:200ms, 500ms;opacity:1}.folded.svelte-1oxrkr1 .plane__wrapper.svelte-1oxrkr1{opacity:0}.plane.svelte-1oxrkr1.svelte-1oxrkr1{max-width:11.75rem}.title.svelte-1oxrkr1.svelte-1oxrkr1{white-space:pre-wrap;font-weight:bold;font-size:0.75rem;line-height:1.125rem}.description.svelte-1oxrkr1.svelte-1oxrkr1{margin-top:0.25rem;white-space:pre-wrap;font-size:0.6875rem;line-height:1rem}")}function lr(i){var h,d;let t,e,n,o,s,r,a,l,c;t=new go({props:{unfolded:i[1],direction:"vertical",length:15,duration:500,inDelay:200,useLinearColor:!0}}),a=new Ao({props:{text:i[2],edit:(h=i[0].data.edit)==null?void 0:h.title}});let u=(i[0].data.description||((d=i[0].data.edit)==null?void 0:d.description))&&cr(i);return{c(){K(t.$$.fragment),e=$(),n=z("div"),o=z("div"),s=z("div"),r=z("div"),K(a.$$.fragment),l=$(),u&&u.c(),b(r,"class","title svelte-1oxrkr1"),b(s,"class","plane svelte-1oxrkr1"),b(o,"class","plane__wrapper svelte-1oxrkr1"),L(o,"transform",i[1]?"translateY(-15px)":"translateY(0)"),b(n,"class","plane__container svelte-1oxrkr1"),q(n,"unfolded",i[1]),q(n,"folded",i[3])},m(f,g){J(t,f,g),T(f,e,g),T(f,n,g),B(n,o),B(o,s),B(s,r),J(a,r,null),B(s,l),u&&u.m(s,null),c=!0},p(f,g){var v,y;const A={};g&2&&(A.unfolded=f[1]),t.$set(A);const p={};g&4&&(p.text=f[2]),g&1&&(p.edit=(v=f[0].data.edit)==null?void 0:v.title),a.$set(p),f[0].data.description||((y=f[0].data.edit)==null?void 0:y.description)?u?(u.p(f,g),g&1&&E(u,1)):(u=cr(f),u.c(),E(u,1),u.m(s,null)):u&&(se(),D(u,1,1,()=>{u=null}),re()),g&2&&L(o,"transform",f[1]?"translateY(-15px)":"translateY(0)"),(!c||g&2)&&q(n,"unfolded",f[1]),(!c||g&8)&&q(n,"folded",f[3])},i(f){c||(E(t.$$.fragment,f),E(a.$$.fragment,f),E(u),c=!0)},o(f){D(t.$$.fragment,f),D(a.$$.fragment,f),D(u),c=!1},d(f){Z(t,f),f&&M(e),f&&M(n),Z(a),u&&u.d()}}}function cr(i){var o;let t,e,n;return e=new Ao({props:{text:i[0].data.description,edit:(o=i[0].data.edit)==null?void 0:o.description,maxLine:3}}),{c(){t=z("div"),K(e.$$.fragment),b(t,"class","description svelte-1oxrkr1")},m(s,r){T(s,t,r),J(e,t,null),n=!0},p(s,r){var l;const a={};r&1&&(a.text=s[0].data.description),r&1&&(a.edit=(l=s[0].data.edit)==null?void 0:l.description),e.$set(a)},i(s){n||(E(e.$$.fragment,s),n=!0)},o(s){D(e.$$.fragment,s),n=!1},d(s){s&&M(t),Z(e)}}}function sg(i){let t,e,n=i[0].state&&lr(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&&E(n,1)):(n=lr(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function rg(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,c;i.$$.dirty&1&&e(1,n=!!((a=r.state)!=null&&a.unfolded)),i.$$.dirty&2&&e(3,o=!n),i.$$.dirty&1&&e(2,s=(c=(l=r.data.title)!=null?l:r.data.text)!=null?c:"")},[r,n,s,o]}class ag extends oe{constructor(t){super(),ie(this,t,rg,sg,ne,{tag:0},og)}}function lg(i){let t,e;return t=new ag({props:{tag:i[0]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function cg(i){let t,e;return t=new Zp({props:{tag:i[0]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function ug(i){let t,e,n,o;const s=[cg,lg],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&&(se(),D(r[u],1,1,()=>{r[u]=null}),re()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),E(e,1),e.m(n.parentNode,n)):e=null)},i(l){o||(E(e),o=!0)},o(l){D(e),o=!1},d(l){~t&&r[t].d(l),l&&M(n)}}}function dg(i,t,e){let n,{tag:o}=t;return i.$$set=s=>{"tag"in s&&e(0,o=s.tag)},i.$$.update=()=>{var s;i.$$.dirty&1&&e(1,n=(s=o.data.appearance)!=null?s:"line")},[o,n]}class hg extends oe{constructor(t){super(),ie(this,t,dg,ug,ne,{tag:0})}}function fg(i){ce(i,"svelte-blgtit",".line.svelte-blgtit{width:100%;height:100%;overflow:visible;pointer-events:none}")}function ur(i){let t,e,n,o;return{c(){t=ye("path"),b(t,"fill","none"),b(t,"stroke","url(#"+i[4]+")"),b(t,"stroke-width","1"),b(t,"d","M0 21 L14 0.5 L105 0.5")},m(s,r){T(s,t,r),o=!0},p(s,r){i=s},i(s){o||(s&&xe(()=>{n&&n.end(1),e=Tt(t,ii,{duration:i[1],delay:i[0],easing:Ta}),e.start()}),o=!0)},o(s){e&&e.invalidate(),s&&(n=nn(t,ii,{duration:i[1],delay:i[2],easing:_t})),o=!1},d(s){s&&M(t),s&&n&&n.end()}}}function mg(i){let t,e,n,o,s,r=i[3]&&ur(i);return{c(){t=ye("svg"),e=ye("defs"),n=ye("linearGradient"),o=ye("stop"),s=ye("stop"),r&&r.c(),b(o,"offset","25%"),b(o,"stop-color","white"),b(o,"stop-opacity","1"),b(s,"offset","100%"),b(s,"stop-color","white"),b(s,"stop-opacity","0.5"),b(n,"id",i[4]),b(n,"gradientUnits","userSpaceOnUse"),b(t,"class","line svelte-blgtit"),b(t,"viewBox","0 0 105 21")},m(a,l){T(a,t,l),B(t,e),B(e,n),B(n,o),B(n,s),r&&r.m(t,null)},p(a,[l]){a[3]?r?(r.p(a,l),l&8&&E(r,1)):(r=ur(a),r.c(),E(r,1),r.m(t,null)):r&&(se(),D(r,1,1,()=>{r=null}),re())},i(a){E(r)},o(a){D(r)},d(a){a&&M(t),r&&r.d()}}}function pg(i,t,e){let{inDelay:n=0}=t,{duration:o=1e3}=t,{outDelay:s=0}=t,{unfolded:r}=t;const a=Ge();return i.$$set=l=>{"inDelay"in l&&e(0,n=l.inDelay),"duration"in l&&e(1,o=l.duration),"outDelay"in l&&e(2,s=l.outDelay),"unfolded"in l&&e(3,r=l.unfolded)},[n,o,s,r,a]}class gg extends oe{constructor(t){super(),ie(this,t,pg,mg,ne,{inDelay:0,duration:1,outDelay:2,unfolded:3},fg)}}function Ag(i){ce(i,"svelte-1mgyhhn",`:root{--sc-dot-size:6px;--sc-active-dot-size:8px;--sc-dot-size-animation-time:250ms}.sc-carousel-dot__dot.svelte-1mgyhhn{background-color:var(--sc-color-rgb-light);border-radius:50%;display:inline-block;opacity:0.5;transition:opacity 100ms ease,\r
|
|
544
|
+
`))&&b(t,"style",e),a&8&&L(t,"width",Ne(i[3])),a&16&&L(t,"height",Ne(i[4])),a&8192&&L(t,"z-index",i[13])},i(r){s||(r&&xe(()=>{o&&o.end(1),n=Tt(t,Mt,{duration:i[0]}),n.start()}),s=!0)},o(r){n&&n.invalidate(),r&&(o=nn(t,Mt,{duration:i[1]})),s=!1},d(r){r&&M(t),r&&o&&o.end()}}}function Cp(i){let t,e=i[2]&&Js(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),T(n,t,o)},p(n,[o]){n[2]?e?(e.p(n,o),o&4&&E(e,1)):(e=Js(n),e.c(),E(e,1),e.m(t.parentNode,t)):e&&(se(),D(e,1,1,()=>{e=null}),re())},i(n){E(e)},o(n){D(e)},d(n){e&&e.d(n),n&&M(t)}}}function Ne(i){return typeof i=="number"?i/16+"rem":i}function Pp(i,t,e){let{inDelay:n=1e3}=t,{outDelay:o=1e3}=t,{visible:s=!0}=t,{width:r=0}=t,{height:a=0}=t,{left:l=0}=t,{bottom:c=0}=t,{center:u=!1}=t,{horizontalCenter:h=!1}=t,{verticalCenter:d=!1}=t,{blurRadius:f}=t,{spreadRadius:g}=t,{opacity:A=.15}=t,{zIndex:p=-1}=t;return i.$$set=v=>{"inDelay"in v&&e(0,n=v.inDelay),"outDelay"in v&&e(1,o=v.outDelay),"visible"in v&&e(2,s=v.visible),"width"in v&&e(3,r=v.width),"height"in v&&e(4,a=v.height),"left"in v&&e(5,l=v.left),"bottom"in v&&e(6,c=v.bottom),"center"in v&&e(7,u=v.center),"horizontalCenter"in v&&e(8,h=v.horizontalCenter),"verticalCenter"in v&&e(9,d=v.verticalCenter),"blurRadius"in v&&e(10,f=v.blurRadius),"spreadRadius"in v&&e(11,g=v.spreadRadius),"opacity"in v&&e(12,A=v.opacity),"zIndex"in v&&e(13,p=v.zIndex)},[n,o,s,r,a,l,c,u,h,d,f,g,A,p]}class nt extends oe{constructor(t){super(),ie(this,t,Pp,Cp,ne,{inDelay:0,outDelay:1,visible:2,width:3,height:4,left:5,bottom:6,center:7,horizontalCenter:8,verticalCenter:9,blurRadius:10,spreadRadius:11,opacity:12,zIndex:13},wp)}}function Ep(i,t){t.forEach(e=>{const n=new I.SphereGeometry(.02,16,16),o=[],s=[new I.MeshBasicMaterial({color:16776960}),new I.MeshBasicMaterial({color:16711935}),new I.MeshBasicMaterial({color:16711680}),new I.MeshBasicMaterial({color:65535})];if(e.position.length===4)e.position.forEach((r,a)=>{const l=s[a],c=new I.Mesh(n,l);c.position.copy(ft(r)),o.push(c)});else{const r=s[0],a=new I.Mesh(n,r);a.position.copy(ft(e.position)),o.push(a)}o.forEach(r=>{r.material.depthTest=!1,i.scene.add(r)})})}const Oe=i=>i;function qi(i){if(i.length<3)return;const t=i.map(gn),e=t[1].clone().sub(t[0]),n=t[2].clone().sub(t[1]);return e.cross(n)}var dl=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Image="Image",i.Video="Video",i.Link="Link",i.Sticker="Sticker",i.VRLink="VRLink",i.PanoLink="PanoLink",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.MediaModel="MediaModel",i.Custom="Custom",i.Unknown="Unknown",i))(dl||{}),hl=(i=>(i.Two="2D",i.Three="3D",i))(hl||{}),fl=(i=>(i.PointTag="PointTag",i.PlaneTag="PlaneTag",i))(fl||{});function Ip(i){return i.stickType==="3DPoint"||i.stickType==="Plane"}function He(i){return i.stickType==="Model"&&i.contentType==="MediaModel"}function Ji(i){if(!!i)if(Array.isArray(i)&&i.length===4){const e=i.map(gn);return to(e[0],e[2])}else return gn(i)}function Zs(i){if(He(i)&&i.matrix){const t=new V.Matrix4().fromArray(i.matrix),e=i.data.mediaPosition.map(n=>new V.Vector3().fromArray(n).applyMatrix4(t));return to(e[0],e[2])}else return Ji(i.position)}function an(i,t){if(i===void 0)return;const{min:e,max:n}=t!=null?t:{};if(!(e===void 0&&n===void 0))return!(typeof n=="number"&&n<i||typeof e=="number"&&e>i)}function kp(i){return new Promise(t=>{i.model.loaded?t():i.once("modelLoaded",()=>t())})}function xp(i,t,e){const o=new I.Plane().setFromNormalAndCoplanarPoint(e,t),s=t.clone().sub(i).cross(new I.Vector3(0,1,0)).setLength(.01),r=new I.Vector3(0,.01,0);return[t.clone().sub(s).sub(r),t.clone().add(s).sub(r),t.clone().add(s).add(r),t.clone().sub(s).add(r)].map(l=>o.projectPoint(l,new I.Vector3))}const Ks=(i,t=1e3/60)=>{let e=null;const n=i;return(...s)=>{e&&clearTimeout(e),e=setTimeout(()=>{n==null||n(...s),e&&clearTimeout(e),e=null},t)}};function Dp(i,t=200){let e;return function(...n){e||(i.apply(this,n),e=setTimeout(function(){e=null},t))}}function Lp(i,t){const[e,n]=t;if(e>=n||n<=1||e<=1)return-1;const o={},s=r=>(o[r]||(o[r]=i(r)),o[r]);for(let r=e;r<n;r++){const a=s(r),l=s(r-1);if(a<l)return r}return-1}function $s(i,t){if(!t||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",i),unobserve:()=>window.removeEventListener("resize",i)};{const e=new ResizeObserver(i);return{observe:()=>e.observe(t),unobserve:()=>e.unobserve(t)}}}function Sp(){return Math.random().toString(36).slice(-6)}const Ti=Sp();function Mp(i){ce(i,"svelte-1b2n9wi",".text-char.svelte-1b2n9wi{display:inline-block;text-shadow:0.125rem 0rem 0.5rem rgba(0, 0, 0, 0.15)}")}function er(i,t,e){const n=i.slice();return n[18]=t[e].id,n[0]=t[e].content,n[19]=t,n[20]=e,n}function Tp(i){let t,e=i[0]+"",n,o=i[20];const s=()=>i[9](t,o),r=()=>i[9](null,o);return{c(){t=z("span"),n=ke(e),b(t,"class","text-char svelte-1b2n9wi")},m(a,l){T(a,t,l),B(t,n),s()},p(a,l){i=a,l&4&&e!==(e=i[0]+"")&&Me(n,e),o!==i[20]&&(r(),o=i[20],s())},d(a){a&&M(t),r()}}}function zp(i){let t,e=i[20];const n=()=>i[8](t,e),o=()=>i[8](null,e);return{c(){t=z("span"),t.textContent="\xA0",b(t,"class","text-char svelte-1b2n9wi")},m(s,r){T(s,t,r),n()},p(s,r){i=s,e!==i[20]&&(o(),e=i[20],n())},d(s){s&&M(t),o()}}}function tr(i,t){let e,n;function o(a,l){return a[0]===a[3]?zp:Tp}let s=o(t),r=s(t);return{key:i,first:null,c(){e=fe(),r.c(),n=fe(),this.first=e},m(a,l){T(a,e,l),r.m(a,l),T(a,n,l)},p(a,l){t=a,s===(s=o(t))&&r?r.p(t,l):(r.d(1),r=s(t),r&&(r.c(),r.m(n.parentNode,n)))},d(a){a&&M(e),r.d(a),a&&M(n)}}}function Bp(i){let t=[],e=new Map,n,o=i[2];const s=r=>r[18];for(let r=0;r<o.length;r+=1){let a=er(i,o,r),l=s(a);e.set(l,t[r]=tr(l,a))}return{c(){for(let r=0;r<t.length;r+=1)t[r].c();n=fe()},m(r,a){for(let l=0;l<t.length;l+=1)t[l].m(r,a);T(r,n,a)},p(r,[a]){a&14&&(o=r[2],t=qe(t,a,s,1,r,o,e,n.parentNode,so,tr,n,er))},i:Y,o:Y,d(r){for(let a=0;a<t.length;a+=1)t[a].d(r);r&&M(n)}}}function jp(i,t,e){let n,{inDelay:o=0}=t,{outDelay:s=0}=t,{content:r}=t,{unfolded:a}=t,{isFistUnfoldedUpdate:l=!0}=t;const c=`__EMOJI_SPLIT_${Ti}__`,u=`__EMOJI_${Ti}__`,h=`__SPACE_${Ti}__`;let d,f,g=[];function A(k){const C=[],S=new RegExp(new RegExp("\\p{Regional_Indicator}\\p{Regional_Indicator}|\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?(\\u200D\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?)+|\\p{Emoji_Presentation}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?|\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)","gu"));return k.slice().replace(S,x=>`${c}${u}${x}${c}`).split(c).forEach(x=>x.startsWith(u)?C.push({id:Ge(),content:x.slice(u.length)}):C.push(...x.split("").map(Q=>Q===" "?h:Q).map(Q=>({id:Ge(),content:Q})))),C}function p(){if(!f)return;const k=!a;f.reversed!==k&&f.reverse(),f.play()}function v(k){if(l){e(4,l=!1);return}clearTimeout(d),d=setTimeout(p,k?o:s)}function y(k){const C=function(){const S=Lp(x=>k[x].getBoundingClientRect().x,[Math.min(k.length-1,10),Math.min(k.length-1,30)]);if(S>0)return S}();f=ko.default({targets:k.slice(0,C).filter(yt),autoplay:!1,duration:400,scale:[.7,1],rotate:[20,0],opacity:[0,1],translateX:[4,0],translateY:[10,0],delay:ko.default.stagger(50),easing:"easeInOutCubic"}),a&&f.seek(f.duration)}function w(k,C){Qe[k?"unshift":"push"](()=>{g[C]=k,e(1,g)})}function P(k,C){Qe[k?"unshift":"push"](()=>{g[C]=k,e(1,g)})}return i.$$set=k=>{"inDelay"in k&&e(5,o=k.inDelay),"outDelay"in k&&e(6,s=k.outDelay),"content"in k&&e(0,r=k.content),"unfolded"in k&&e(7,a=k.unfolded),"isFistUnfoldedUpdate"in k&&e(4,l=k.isFistUnfoldedUpdate)},i.$$.update=()=>{i.$$.dirty&1&&e(2,n=A(r)),i.$$.dirty&128&&v(a),i.$$.dirty&2&&y(g.filter(k=>!!k))},[r,g,n,h,l,o,s,a,w,P]}class ml extends oe{constructor(t){super(),ie(this,t,jp,Bp,ne,{inDelay:5,outDelay:6,content:0,unfolded:7,isFistUnfoldedUpdate:4},Mp)}}const Vp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAKqADAAQAAAABAAAAKgAAAADUGqULAAAB0ElEQVRYCe2WSUoEQRBFLVHEiVZU1I03cKW38SSewRt4A5fiTty5cQIFR9pZQWkcUNSe2/Z9yISiSGxRkUAy4BGZSVX168gistraYsQKxArECsQKxApYqkDyU5lmsznMM+ZgAGpQhaUkSRbINgLJCXiCBtSgAkVYtGGIBTKj8AgKSVahDNvQa0IUkUG4Bx91BpLdBTOS/cgUIB3a+gMwI9mFzE3a0I3z5B4r292JzGVA8tSSZILMcUDyzIykthOZvYDk+V9Ktmz4yGzhOhV4/+5YU4N/hzqo0StX3Fg5TcnNlYvgs8bPsM4hkScHoyO46haRnGEY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fULaH10Qnh/4IMVjAxNk6jxwajuUb8lqOZRT3S/lx06RY1g8C4akfiEJAOZdFKzsq/nNjIssdufjbhQAEAUodOGDWp4m8S0oHEhb+YexGkD4EBUpdVMrfl/E/RhNJnsjF/ls0r980YRQDlAqBylIqylcCzf4lHecB5veigSfmYoBycaxN2SHgT8e7pWKZwCzqzZpigUr9DlRuoIxXn8pIZJgHtkwpa8togHIiw587LeNx9mc2ZwIK5DOlXJaMFqhWwoMp/Ax+1W+ToOXTHGKNrDMLLo38LmKsQKmbdSrWil+N82UJaS40YTuJv/RdtAdpzet+aJDzvMpQV71oo2gYX5RXG2HnYZXtouzNRzXE3R0KE6jWjZU2iaZ9u8pqpU3UfvwrYSgSBVDtGDurBlHn/zj0QMIh7qlDNOfmcBj9ihKo9o+l1euiWGxSE5eun3na6jxQk3joEgdQ7TR+FWutE43lhQpph3sQvISAVRa9ppRzipY4gZqdw8/WigIWDWt1gD8EIsqSLlT/KPUVlKSAujs2XTLYeRHiIlA2DVi1qkRtK8PSULaEDF+Ue7ashwkTlf8DQc/cITdx9+UAAAAASUVORK5CYII=",Op="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAMAAAANIilAAAABcVBMVEUAAAAAAAD////////+/v45OTn////////39/fp6enPz8/7+/vw8PD+/v7x8fHc3NzHx8f////////+/v77+/vr6+v////7+/v5+fn////z8/P////////q6uqgoKD+/v79/f3m5ub+/v7////////////////39/f39/f////z8/P////t7e3s7Oz29vb////5+fn////h4eH////g4ODV1dX////////BwcH///////////+Ojo5zc3MlJSX////////////////////////7+/v////////////v7+/u7u7n5+f////39/f////09PT6+vr09PT+/v76+vr////5+fnv7+/09PTk5OT////////////////Jycn///++vr7///////+0tLT///9TU1P///8SEhL////////+/v76+vr////8/Pz39/ft7e3t7e36+vr////////X19fV1dX///+xsbF9fX1iYmL///////+K8mOEAAAAenRSTlMaAIDy8CD41cWRX9uk7Kl1VVEw6dWT/M/NvKyVkY475eWIgx0Z39rHv7ax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cbVa3Twd2NcOyuLwVqo+K1ebjgdcr0k+O1uXwThfl8vlhqm+99kASup5GINsYhhmG8d7UXzcBgo2e21cd9WlUll5/7G958ql8uxu7y0zS5SGSkOGBA51TRiGQAi232Y9v4kVQZGavpt6c6l3tLpNsc38gGOC01IeLg4Xi8NaLz1KkqO0VzvcTrFscYo4oLjiRAsKEXeJPRqxW0bsFWLGLVbiocyZSm5vbW0nU9BsIfyp/AGqAvfOkBaFawAAAABJRU5ErkJggg==";function Fp(i){ce(i,"svelte-1ogmlqq",".arrow.svelte-1ogmlqq{width:100%;height:100%;background-size:100%;transition:transform 400ms ease-in-out;cursor:pointer;pointer-events:auto}.arrow-wrapper.svelte-1ogmlqq{position:relative;width:100%;height:100%}.arrow.left.svelte-1ogmlqq{transform:rotate(0deg)}.arrow.right.svelte-1ogmlqq{transform:rotate(-180deg)}.arrow.top.svelte-1ogmlqq{transform:rotate(90deg)}.arrow.bottom.svelte-1ogmlqq{transform:rotate(-90deg)}")}function nr(i){let t,e,n,o,s,r,a,l,c,u;return e=new nt({props:{center:!0,blurRadius:9,spreadRadius:3}}),{c(){t=z("div"),K(e.$$.fragment),n=$(),o=z("div"),b(o,"class",s="arrow "+i[0]+" svelte-1ogmlqq"),L(o,"background-image","url("+Vp+")"),b(t,"class","arrow-wrapper svelte-1ogmlqq")},m(h,d){T(h,t,d),J(e,t,null),B(t,n),B(t,o),l=!0,c||(u=we(o,"click",i[5]),c=!0)},p(h,d){i=h,(!l||d&1&&s!==(s="arrow "+i[0]+" svelte-1ogmlqq"))&&b(o,"class",s)},i(h){l||(E(e.$$.fragment,h),h&&xe(()=>{a&&a.end(1),r=Tt(o,Mt,{duration:i[2],delay:i[3],easing:_t}),r.start()}),l=!0)},o(h){D(e.$$.fragment,h),r&&r.invalidate(),h&&(a=nn(o,Mt,{duration:i[2],delay:i[4],easing:_t})),l=!1},d(h){h&&M(t),Z(e),h&&a&&a.end(),c=!1,u()}}}function Hp(i){let t,e,n=i[1]&&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[1]?n?(n.p(o,s),s&2&&E(n,1)):(n=nr(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Gp(i,t,e){let{direction:n="right"}=t,{visible:o=!0}=t,{duration:s=0}=t,{inDelay:r=0}=t,{outDelay:a=0}=t;function l(c){wn.call(this,i,c)}return i.$$set=c=>{"direction"in c&&e(0,n=c.direction),"visible"in c&&e(1,o=c.visible),"duration"in c&&e(2,s=c.duration),"inDelay"in c&&e(3,r=c.inDelay),"outDelay"in c&&e(4,a=c.outDelay)},[n,o,s,r,a,l]}class Wp extends oe{constructor(t){super(),ie(this,t,Gp,Hp,ne,{direction:0,visible:1,duration:2,inDelay:3,outDelay:4},Fp)}}function Np(i,t,e=20,n=5){return new Promise((o,s)=>{let r=0;const a=setInterval(()=>{const l=i();t(l)?(clearInterval(a),o(l)):r>=n&&(clearInterval(a),s(l)),r++},e)})}function _p(i){ce(i,"svelte-1fuzm7v",".text.svelte-1fuzm7v{pointer-events:auto;box-sizing:border-box;display:inline-block;max-width:7.5rem;transition:transform 400ms ease-in-out;font-size:0.75rem;line-height:1.125rem;white-space:initial;cursor:pointer}.arrow.svelte-1fuzm7v{pointer-events:auto;display:inline-block;vertical-align:top;width:0.875rem;height:0.875rem;margin-left:0.125rem;margin-top:0.125rem}")}function ir(i){let t,e,n;return e=new ml({props:{unfolded:i[0],content:i[1],inDelay:500,outDelay:i[5]}}),{c(){t=z("div"),K(e.$$.fragment),b(t,"class","text svelte-1fuzm7v"),L(t,"transform",i[7])},m(o,s){T(o,t,s),J(e,t,null),i[10](t),n=!0},p(o,s){const r={};s&1&&(r.unfolded=o[0]),s&2&&(r.content=o[1]),s&32&&(r.outDelay=o[5]),e.$set(r),s&128&&L(t,"transform",o[7])},i(o){n||(E(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e),i[10](null)}}}function or(i){let t,e,n;return e=new Wp({props:{direction:i[6],visible:i[0],inDelay:600,duration:1e3}}),{c(){t=z("div"),K(e.$$.fragment),b(t,"class","arrow svelte-1fuzm7v")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s&64&&(r.direction=o[6]),s&1&&(r.visible=o[0]),e.$set(r)},i(o){n||(E(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function Xp(i){let t,e,n,o=i[1]&&ir(i),s=i[3]<i[4]&&or(i);return{c(){o&&o.c(),t=$(),s&&s.c(),e=fe()},m(r,a){o&&o.m(r,a),T(r,t,a),s&&s.m(r,a),T(r,e,a),n=!0},p(r,[a]){r[1]?o?(o.p(r,a),a&2&&E(o,1)):(o=ir(r),o.c(),E(o,1),o.m(t.parentNode,t)):o&&(se(),D(o,1,1,()=>{o=null}),re()),r[3]<r[4]?s?(s.p(r,a),a&24&&E(s,1)):(s=or(r),s.c(),E(s,1),s.m(e.parentNode,e)):s&&(se(),D(s,1,1,()=>{s=null}),re())},i(r){n||(E(o),E(s),n=!0)},o(r){D(o),D(s),n=!1},d(r){o&&o.d(r),r&&M(t),s&&s.d(r),r&&M(e)}}}function Yp(i,t,e){let n,o,s,{visible:r=!1}=t,{textUnfolded:a=!1}=t,{content:l}=t,c,u=0,h=0,d=0;function f(g){Qe[g?"unshift":"push"](()=>{c=g,e(2,c)})}return i.$$set=g=>{"visible"in g&&e(0,r=g.visible),"textUnfolded"in g&&e(8,a=g.textUnfolded),"content"in g&&e(1,l=g.content)},i.$$.update=()=>{if(i.$$.dirty&7&&c&&r&&l){const{lineHeight:g}=getComputedStyle(c);e(4,d=c.offsetHeight),Np(()=>c==null?void 0:c.offsetHeight,Boolean).then(()=>{e(4,d=c.offsetHeight)}),e(3,h=Number(g.replace("px","")))}i.$$.dirty&280&&e(9,u=a?h-d:0),i.$$.dirty&512&&e(7,n=`translateY(${u}px)`),i.$$.dirty&256&&e(6,o=a?"left":"right"),i.$$.dirty&256&&e(5,s=a?450:0)},[r,l,c,h,d,s,o,n,a,u,f]}class pl extends oe{constructor(t){super(),ie(this,t,Yp,Xp,ne,{visible:0,textUnfolded:8,content:1},_p)}}function Up(i){ce(i,"svelte-nlvd3x",".content.svelte-nlvd3x{width:-moz-max-content;width:max-content;height:3.375rem;padding:2.25rem 0.25rem 0 1rem;position:absolute;left:0;bottom:0;overflow:hidden;box-sizing:border-box;font-size:0;pointer-events:none;white-space:nowrap;font-weight:600}")}function sr(i){var h,d;let t,e,n,o,s,r,a,l,c,u;return t=new nt({props:{visible:i[2],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}}),n=new go({props:{unfolded:i[2],length:i[3],outDelay:i[4]+40*Math.min((d=(h=i[6][0])==null?void 0:h.content.length)!=null?d:10,15),useLinearColor:!0}}),r=new pl({props:{visible:i[2],textUnfolded:i[1],content:i[5]}}),{c(){K(t.$$.fragment),e=$(),K(n.$$.fragment),o=$(),s=z("div"),K(r.$$.fragment),b(s,"class","content svelte-nlvd3x"),xe(()=>i[8].call(s))},m(f,g){J(t,f,g),T(f,e,g),J(n,f,g),T(f,o,g),T(f,s,g),J(r,s,null),a=tt(s,i[8].bind(s)),l=!0,c||(u=we(s,"click",i[7]),c=!0)},p(f,g){var y,w;const A={};g&4&&(A.visible=f[2]),g&8&&(A.left=f[3]/2+"px"),t.$set(A);const p={};g&4&&(p.unfolded=f[2]),g&8&&(p.length=f[3]),g&16&&(p.outDelay=f[4]+40*Math.min((w=(y=f[6][0])==null?void 0:y.content.length)!=null?w:10,15)),n.$set(p);const v={};g&4&&(v.visible=f[2]),g&2&&(v.textUnfolded=f[1]),g&32&&(v.content=f[5]),r.$set(v)},i(f){l||(E(t.$$.fragment,f),E(n.$$.fragment,f),E(r.$$.fragment,f),l=!0)},o(f){D(t.$$.fragment,f),D(n.$$.fragment,f),D(r.$$.fragment,f),l=!1},d(f){Z(t,f),f&&M(e),Z(n,f),f&&M(o),f&&M(s),Z(r),a(),c=!1,u()}}}function qp(i){let t,e,n=i[0].state&&sr(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&&E(n,1)):(n=sr(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Jp(i,t,e){let n,o,s,{tag:r}=t,a,l=!1,c=[];function u(){e(1,l=!l)}function h(){a=this.clientWidth,e(3,a)}return i.$$set=d=>{"tag"in d&&e(0,r=d.tag)},i.$$.update=()=>{var d,f,g;i.$$.dirty&1&&e(2,n=!!((d=r.state)!=null&&d.unfolded)),i.$$.dirty&1&&e(5,o=(g=(f=r.data.title)!=null?f:r.data.text)!=null?g:""),i.$$.dirty&4&&(n||setTimeout(()=>{e(1,l=!1)},20)),i.$$.dirty&2&&e(4,s=l?450:0)},[r,l,n,a,s,o,c,u,h]}class Zp extends oe{constructor(t){super(),ie(this,t,Jp,qp,ne,{tag:0},Up)}}function Ie(i){return typeof i=="number"?i/16+"rem":i}function Kp(i){ce(i,"svelte-i9wdo4",".text.svelte-i9wdo4{display:-webkit-box;display:-ms-box;display:-moz-box;position:relative;width:-moz-max-content;width:max-content;max-width:100%;-webkit-box-orient:vertical;-ms-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}@keyframes svelte-i9wdo4-blink{0%{opacity:1}50%{opacity:0}100%{opacity:1}}.caret.svelte-i9wdo4{position:absolute;width:0.0625rem;height:100%;background-color:#fff;animation:svelte-i9wdo4-blink 1.2s infinite}.placeholder.svelte-i9wdo4{opacity:0.5}")}function $p(i){let t;const e=i[6].default,n=Kt(e,i,i[5],null);return{c(){n&&n.c()},m(o,s){n&&n.m(o,s),t=!0},p(o,s){n&&n.p&&(!t||s&32)&&en(n,e,o,o[5],t?$t(e,o[5],s,null):tn(o[5]),null)},i(o){t||(E(n,o),t=!0)},o(o){D(n,o),t=!1},d(o){n&&n.d(o)}}}function eg(i){var s,r;let t,e,n=((s=i[3])==null?void 0:s.inputting)&&rr(),o=((r=i[3])==null?void 0:r.placeholder)&&ar(i);return{c(){n&&n.c(),t=$(),o&&o.c(),e=fe()},m(a,l){n&&n.m(a,l),T(a,t,l),o&&o.m(a,l),T(a,e,l)},p(a,l){var c,u;(c=a[3])!=null&&c.inputting?n||(n=rr(),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),(u=a[3])!=null&&u.placeholder?o?o.p(a,l):(o=ar(a),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},i:Y,o:Y,d(a){n&&n.d(a),a&&M(t),o&&o.d(a),a&&M(e)}}}function tg(i){let t;return{c(){t=ke(i[2])},m(e,n){T(e,t,n)},p(e,n){n&4&&Me(t,e[2])},i:Y,o:Y,d(e){e&&M(t)}}}function rr(i){let t;return{c(){t=z("div"),b(t,"class","caret svelte-i9wdo4")},m(e,n){T(e,t,n)},d(e){e&&M(t)}}}function ar(i){let t,e=i[3].placeholder+"",n;return{c(){t=z("span"),n=ke(e),b(t,"class","placeholder svelte-i9wdo4")},m(o,s){T(o,t,s),B(t,n)},p(o,s){s&8&&e!==(e=o[3].placeholder+"")&&Me(n,e)},d(o){o&&M(t)}}}function ng(i){let t,e,n,o;const s=[tg,eg,$p],r=[];function a(l,c){return l[2]?0:l[4]?1:2}return e=a(i),n=r[e]=s[e](i),{c(){t=z("div"),n.c(),b(t,"class","text svelte-i9wdo4"),L(t,"max-width",typeof i[1]=="number"?Ie(i[1]):i[1]),L(t,"-webkit-line-clamp",i[0])},m(l,c){T(l,t,c),r[e].m(t,null),o=!0},p(l,[c]){let u=e;e=a(l),e===u?r[e].p(l,c):(se(),D(r[u],1,1,()=>{r[u]=null}),re(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),E(n,1),n.m(t,null)),c&2&&L(t,"max-width",typeof l[1]=="number"?Ie(l[1]):l[1]),c&1&&L(t,"-webkit-line-clamp",l[0])},i(l){o||(E(n),o=!0)},o(l){D(n),o=!1},d(l){l&&M(t),r[e].d()}}}function ig(i,t,e){let n,{$$slots:o={},$$scope:s}=t,{maxLine:r=1}=t,{maxWidth:a=null}=t,{text:l=null}=t,{edit:c=null}=t;return i.$$set=u=>{"maxLine"in u&&e(0,r=u.maxLine),"maxWidth"in u&&e(1,a=u.maxWidth),"text"in u&&e(2,l=u.text),"edit"in u&&e(3,c=u.edit),"$$scope"in u&&e(5,s=u.$$scope)},i.$$.update=()=>{i.$$.dirty&8&&e(4,n=(c==null?void 0:c.placeholder)||(c==null?void 0:c.inputting))},[r,a,l,c,n,s,o]}class Ao extends oe{constructor(t){super(),ie(this,t,ig,ng,ne,{maxLine:0,maxWidth:1,text:2,edit:3},Kp)}}function og(i){ce(i,"svelte-1oxrkr1",".plane__container.svelte-1oxrkr1.svelte-1oxrkr1{position:absolute;left:50%;transform:translate(-50%, -100%);width:-moz-max-content;width:max-content}.plane__wrapper.svelte-1oxrkr1.svelte-1oxrkr1{transition:transform 500ms linear, opacity 200ms linear;padding:0.625rem;background-color:rgba(0, 0, 0, 0.5);border:0.03125rem solid rgba(255, 255, 255, 0.3);border-radius:0.25rem}.unfolded.svelte-1oxrkr1 .plane__wrapper.svelte-1oxrkr1{transition-delay:200ms, 500ms;opacity:1}.folded.svelte-1oxrkr1 .plane__wrapper.svelte-1oxrkr1{opacity:0}.plane.svelte-1oxrkr1.svelte-1oxrkr1{max-width:11.75rem}.title.svelte-1oxrkr1.svelte-1oxrkr1{white-space:pre-wrap;font-weight:bold;font-size:0.75rem;line-height:1.125rem}.description.svelte-1oxrkr1.svelte-1oxrkr1{margin-top:0.25rem;white-space:pre-wrap;font-size:0.6875rem;line-height:1rem}")}function lr(i){var h,d;let t,e,n,o,s,r,a,l,c;t=new go({props:{unfolded:i[1],direction:"vertical",length:15,duration:500,inDelay:200,useLinearColor:!0}}),a=new Ao({props:{text:i[2],edit:(h=i[0].data.edit)==null?void 0:h.title}});let u=(i[0].data.description||((d=i[0].data.edit)==null?void 0:d.description))&&cr(i);return{c(){K(t.$$.fragment),e=$(),n=z("div"),o=z("div"),s=z("div"),r=z("div"),K(a.$$.fragment),l=$(),u&&u.c(),b(r,"class","title svelte-1oxrkr1"),b(s,"class","plane svelte-1oxrkr1"),b(o,"class","plane__wrapper svelte-1oxrkr1"),L(o,"transform",i[1]?"translateY(-15px)":"translateY(0)"),b(n,"class","plane__container svelte-1oxrkr1"),q(n,"unfolded",i[1]),q(n,"folded",i[3])},m(f,g){J(t,f,g),T(f,e,g),T(f,n,g),B(n,o),B(o,s),B(s,r),J(a,r,null),B(s,l),u&&u.m(s,null),c=!0},p(f,g){var v,y;const A={};g&2&&(A.unfolded=f[1]),t.$set(A);const p={};g&4&&(p.text=f[2]),g&1&&(p.edit=(v=f[0].data.edit)==null?void 0:v.title),a.$set(p),f[0].data.description||((y=f[0].data.edit)==null?void 0:y.description)?u?(u.p(f,g),g&1&&E(u,1)):(u=cr(f),u.c(),E(u,1),u.m(s,null)):u&&(se(),D(u,1,1,()=>{u=null}),re()),g&2&&L(o,"transform",f[1]?"translateY(-15px)":"translateY(0)"),(!c||g&2)&&q(n,"unfolded",f[1]),(!c||g&8)&&q(n,"folded",f[3])},i(f){c||(E(t.$$.fragment,f),E(a.$$.fragment,f),E(u),c=!0)},o(f){D(t.$$.fragment,f),D(a.$$.fragment,f),D(u),c=!1},d(f){Z(t,f),f&&M(e),f&&M(n),Z(a),u&&u.d()}}}function cr(i){var o;let t,e,n;return e=new Ao({props:{text:i[0].data.description,edit:(o=i[0].data.edit)==null?void 0:o.description,maxLine:3}}),{c(){t=z("div"),K(e.$$.fragment),b(t,"class","description svelte-1oxrkr1")},m(s,r){T(s,t,r),J(e,t,null),n=!0},p(s,r){var l;const a={};r&1&&(a.text=s[0].data.description),r&1&&(a.edit=(l=s[0].data.edit)==null?void 0:l.description),e.$set(a)},i(s){n||(E(e.$$.fragment,s),n=!0)},o(s){D(e.$$.fragment,s),n=!1},d(s){s&&M(t),Z(e)}}}function sg(i){let t,e,n=i[0].state&&lr(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&&E(n,1)):(n=lr(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function rg(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,c;i.$$.dirty&1&&e(1,n=!!((a=r.state)!=null&&a.unfolded)),i.$$.dirty&2&&e(3,o=!n),i.$$.dirty&1&&e(2,s=(c=(l=r.data.title)!=null?l:r.data.text)!=null?c:"")},[r,n,s,o]}class ag extends oe{constructor(t){super(),ie(this,t,rg,sg,ne,{tag:0},og)}}function lg(i){let t,e;return t=new ag({props:{tag:i[0]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function cg(i){let t,e;return t=new Zp({props:{tag:i[0]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function ug(i){let t,e,n,o;const s=[cg,lg],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&&(se(),D(r[u],1,1,()=>{r[u]=null}),re()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),E(e,1),e.m(n.parentNode,n)):e=null)},i(l){o||(E(e),o=!0)},o(l){D(e),o=!1},d(l){~t&&r[t].d(l),l&&M(n)}}}function dg(i,t,e){let n,{tag:o}=t;return i.$$set=s=>{"tag"in s&&e(0,o=s.tag)},i.$$.update=()=>{var s;i.$$.dirty&1&&e(1,n=(s=o.data.appearance)!=null?s:"line")},[o,n]}class hg extends oe{constructor(t){super(),ie(this,t,dg,ug,ne,{tag:0})}}function fg(i){ce(i,"svelte-blgtit",".line.svelte-blgtit{width:100%;height:100%;overflow:visible;pointer-events:none}")}function ur(i){let t,e,n,o;return{c(){t=ye("path"),b(t,"fill","none"),b(t,"stroke","url(#"+i[4]+")"),b(t,"stroke-width","1"),b(t,"d","M0 21 L14 0.5 L105 0.5")},m(s,r){T(s,t,r),o=!0},p(s,r){i=s},i(s){o||(s&&xe(()=>{n&&n.end(1),e=Tt(t,ii,{duration:i[1],delay:i[0],easing:Ta}),e.start()}),o=!0)},o(s){e&&e.invalidate(),s&&(n=nn(t,ii,{duration:i[1],delay:i[2],easing:_t})),o=!1},d(s){s&&M(t),s&&n&&n.end()}}}function mg(i){let t,e,n,o,s,r=i[3]&&ur(i);return{c(){t=ye("svg"),e=ye("defs"),n=ye("linearGradient"),o=ye("stop"),s=ye("stop"),r&&r.c(),b(o,"offset","25%"),b(o,"stop-color","white"),b(o,"stop-opacity","1"),b(s,"offset","100%"),b(s,"stop-color","white"),b(s,"stop-opacity","0.5"),b(n,"id",i[4]),b(n,"gradientUnits","userSpaceOnUse"),b(t,"class","line svelte-blgtit"),b(t,"viewBox","0 0 105 21")},m(a,l){T(a,t,l),B(t,e),B(e,n),B(n,o),B(n,s),r&&r.m(t,null)},p(a,[l]){a[3]?r?(r.p(a,l),l&8&&E(r,1)):(r=ur(a),r.c(),E(r,1),r.m(t,null)):r&&(se(),D(r,1,1,()=>{r=null}),re())},i(a){E(r)},o(a){D(r)},d(a){a&&M(t),r&&r.d()}}}function pg(i,t,e){let{inDelay:n=0}=t,{duration:o=1e3}=t,{outDelay:s=0}=t,{unfolded:r}=t;const a=Ge();return i.$$set=l=>{"inDelay"in l&&e(0,n=l.inDelay),"duration"in l&&e(1,o=l.duration),"outDelay"in l&&e(2,s=l.outDelay),"unfolded"in l&&e(3,r=l.unfolded)},[n,o,s,r,a]}class gg extends oe{constructor(t){super(),ie(this,t,pg,mg,ne,{inDelay:0,duration:1,outDelay:2,unfolded:3},fg)}}function Ag(i){ce(i,"svelte-1mgyhhn",`:root{--sc-dot-size:6px;--sc-active-dot-size:8px;--sc-dot-size-animation-time:250ms}.sc-carousel-dot__dot.svelte-1mgyhhn{background-color:var(--sc-color-rgb-light);border-radius:50%;display:inline-block;opacity:0.5;transition:opacity 100ms ease,\r
|
|
545
545
|
height var(--sc-dot-size-animation-time) ease,\r
|
|
546
|
-
width var(--sc-dot-size-animation-time) ease;cursor:pointer;-webkit-tap-highlight-color:transparent;height:var(--sc-dot-size);width:var(--sc-dot-size)}.sc-carousel-dot__dot.svelte-1mgyhhn:hover{opacity:0.9}.sc-carousel-dot__dot_active.svelte-1mgyhhn{opacity:0.7;height:var(--sc-active-dot-size);width:var(--sc-active-dot-size)}`)}function vg(i){let t,e,n;return{c(){t=z("button"),b(t,"class","sc-carousel-button sc-carousel-dot__dot svelte-1mgyhhn"),q(t,"sc-carousel-dot__dot_active",i[0])},m(o,s){T(o,t,s),e||(n=we(t,"click",i[1]),e=!0)},p(o,[s]){s&1&&q(t,"sc-carousel-dot__dot_active",o[0])},i:Y,o:Y,d(o){o&&M(t),e=!1,n()}}}function bg(i,t,e){let{active:n=!1}=t;function o(s){wn.call(this,i,s)}return i.$$set=s=>{"active"in s&&e(0,n=s.active)},[n,o]}class yg extends oe{constructor(t){super(),ie(this,t,bg,vg,ne,{active:0},Ag)}}function wg(i){ce(i,"svelte-670fde",".sc-carousel-dots__container.svelte-670fde{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;padding:0 30px}.sc-carousel-dots__dot-container.svelte-670fde{height:calc(var(--sc-dot-size) + 14px);width:calc(var(--sc-dot-size) + 10px);display:flex;align-items:center;justify-content:center}")}function dr(i,t,e){const n=i.slice();return n[5]=t[e],n[7]=e,n}function hr(i,t){let e,n,o,s;function r(){return t[3](t[7])}return n=new yg({props:{active:t[1]===t[7]}}),n.$on("click",r),{key:i,first:null,c(){e=z("div"),K(n.$$.fragment),o=$(),b(e,"class","sc-carousel-dots__dot-container svelte-670fde"),this.first=e},m(a,l){T(a,e,l),J(n,e,null),B(e,o),s=!0},p(a,l){t=a;const c={};l&3&&(c.active=t[1]===t[7]),n.$set(c)},i(a){s||(E(n.$$.fragment,a),s=!0)},o(a){D(n.$$.fragment,a),s=!1},d(a){a&&M(e),Z(n)}}}function Cg(i){let t,e=[],n=new Map,o,s=Array(i[0]);const r=a=>a[7];for(let a=0;a<s.length;a+=1){let l=dr(i,s,a),c=r(l);n.set(c,e[a]=hr(c,l))}return{c(){t=z("div");for(let a=0;a<e.length;a+=1)e[a].c();b(t,"class","sc-carousel-dots__container svelte-670fde")},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&7&&(s=Array(a[0]),se(),e=qe(e,l,r,1,a,s,n,t,Et,hr,null,dr),re())},i(a){if(!o){for(let l=0;l<s.length;l+=1)E(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 Pg(i,t,e){const n=ai();let{pagesCount:o=1}=t,{currentPageIndex:s=0}=t;function r(l){n("pageChange",l)}const a=l=>r(l);return i.$$set=l=>{"pagesCount"in l&&e(0,o=l.pagesCount),"currentPageIndex"in l&&e(1,s=l.currentPageIndex)},[o,s,r,a]}class Eg extends oe{constructor(t){super(),ie(this,t,Pg,Cg,ne,{pagesCount:0,currentPageIndex:1},wg)}}const Yt="prev",wt="next";function Ig(i){ce(i,"svelte-1bftafx",":root{--sc-arrow-size:2px}.sc-carousel-arrow__circle.svelte-1bftafx{width:20px;height:20px;border-radius:50%;background-color:var(--sc-color-rgb-light-50p);display:flex;align-items:center;justify-content:center;transition:opacity 100ms ease;cursor:pointer;-webkit-tap-highlight-color:transparent}.sc-carousel-arrow__circle.svelte-1bftafx:hover{opacity:0.9}.sc-carousel-arrow__arrow.svelte-1bftafx{border:solid var(--sc-color-hex-dark);border-width:0 var(--sc-arrow-size) var(--sc-arrow-size) 0;padding:var(--sc-arrow-size);position:relative}.sc-carousel-arrow__arrow-next.svelte-1bftafx{transform:rotate(-45deg);left:calc(var(--sc-arrow-size) / -2)}.sc-carousel-arrow__arrow-prev.svelte-1bftafx{transform:rotate(135deg);right:calc(var(--sc-arrow-size) / -2)}.sc-carousel-arrow__circle_disabled.svelte-1bftafx,.sc-carousel-arrow__circle_disabled.svelte-1bftafx:hover{opacity:0.5}")}function kg(i){let t,e,n,o;return{c(){t=z("button"),e=z("i"),b(e,"class","sc-carousel-arrow__arrow svelte-1bftafx"),q(e,"sc-carousel-arrow__arrow-next",i[0]===wt),q(e,"sc-carousel-arrow__arrow-prev",i[0]===Yt),b(t,"class","sc-carousel-button sc-carousel-arrow__circle svelte-1bftafx"),q(t,"sc-carousel-arrow__circle_disabled",i[1])},m(s,r){T(s,t,r),B(t,e),n||(o=we(t,"click",i[2]),n=!0)},p(s,[r]){r&1&&q(e,"sc-carousel-arrow__arrow-next",s[0]===wt),r&1&&q(e,"sc-carousel-arrow__arrow-prev",s[0]===Yt),r&2&&q(t,"sc-carousel-arrow__circle_disabled",s[1])},i:Y,o:Y,d(s){s&&M(t),n=!1,o()}}}function xg(i,t,e){let{direction:n=wt}=t,{disabled:o=!1}=t;function s(r){wn.call(this,i,r)}return i.$$set=r=>{"direction"in r&&e(0,n=r.direction),"disabled"in r&&e(1,o=r.disabled)},[n,o,s]}class gl extends oe{constructor(t){super(),ie(this,t,xg,kg,ne,{direction:0,disabled:1},Ig)}}function Dg(i){ce(i,"svelte-i7yfid",".sc-carousel-progress__indicator.svelte-i7yfid{height:100%;background-color:var(--sc-color-hex-dark-50p)}")}function Lg(i){let t;return{c(){t=z("div"),b(t,"class","sc-carousel-progress__indicator svelte-i7yfid"),L(t,"width",i[0]+"%")},m(e,n){T(e,t,n)},p(e,[n]){n&1&&L(t,"width",e[0]+"%")},i:Y,o:Y,d(e){e&&M(t)}}}const fr=100;function Sg(i,t,e){let n,{value:o=0}=t;return i.$$set=s=>{"value"in s&&e(1,o=s.value)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=Math.min(Math.max(o*fr,0),fr))},[n,o]}class Mg extends oe{constructor(t){super(),ie(this,t,Sg,Lg,ne,{value:1},Dg)}}function Tg(i,t){i.addEventListener("mousedown",t),i.addEventListener("touchstart",t,{passive:!0})}function zg(i,t){i.removeEventListener("mousedown",t),i.removeEventListener("touchstart",t)}function Bg(i,t){i.addEventListener("mouseup",t),i.addEventListener("touchend",t)}function mr(i,t){i.removeEventListener("mouseup",t),i.removeEventListener("touchend",t)}function jg(i,t){i.addEventListener("mousemove",t),i.addEventListener("touchmove",t)}function pr(i,t){i.removeEventListener("mousemove",t),i.removeEventListener("touchmove",t)}function vo(i){return function(t,e){i.dispatchEvent(new CustomEvent(t,{detail:e}))}}const Vg=110,Qg=9,Og=111,Rg=20;function zi(i){if("TouchEvent"in window&&i instanceof TouchEvent){const t=i.touches[0];return{x:t?t.clientX:0,y:t?t.clientY:0}}return{x:i.clientX,y:i.clientY}}function Fg(i,{thresholdProvider:t}){const e=vo(i);let n,o,s=0,r,a=!1;function l(){return Date.now()-r>=Og&&Math.abs(s)>=Rg}function c(d){r=Date.now(),s=0,a=!0;const f=zi(d);n=f.x,o=f.y,e("swipeStart",{x:n,y:o}),jg(window,u),Bg(window,h)}function u(d){if(!a)return;const f=zi(d),g=f.x-n,A=f.y-o;n=f.x,o=f.y,e("swipeMove",{x:n,y:o,dx:g,dy:A}),g!==0&&Math.sign(g)!==Math.sign(s)&&(s=0),s+=g,Math.abs(s)>t()&&(e("swipeThresholdReached",{direction:s>0?Yt:wt}),mr(window,h),pr(window,u))}function h(d){if(mr(window,h),pr(window,u),a=!1,!l()){e("swipeFailed");return}const f=zi(d);e("swipeEnd",{x:f.x,y:f.y})}return Tg(i,c),{destroy(){zg(i,c)}}}function Hg(i,t){i.addEventListener("mouseenter",t)}function Gg(i,t){i.removeEventListener("mouseenter",t)}function Wg(i,t){i.addEventListener("mouseleave",t)}function gr(i,t){i.removeEventListener("mouseleave",t)}function Ng(i){const t=vo(i);function e(){Wg(i,n),t("hovered",{value:!0})}function n(){t("hovered",{value:!1}),gr(i,n)}return Hg(i,e),{destroy(){Gg(i,e),gr(i,n)}}}const _g=(i,t)=>{const e=t.x-i.x,n=t.y-i.y;return Math.sqrt(e*e+n*n)};function Gt(i,t,e){return Math.max(i,Math.min(t,e))}function Xg(i,t){i.addEventListener("touchstart",t,{passive:!0})}function Yg(i,t){i.removeEventListener("touchstart",t)}function Ug(i,t){i.addEventListener("touchend",t)}function Ar(i,t){i.removeEventListener("touchend",t)}function qg(i){const t=vo(i);let e=0,n={x:0,y:0};function o({tapEndedAt:a,tapEndedPos:l}){const c=a-e,u=_g(n,l);return c<=Vg&&u<=Qg}function s(a){e=Date.now();const l=a.touches[0];n={x:l.clientX,y:l.clientY},Ug(i,r)}function r(a){Ar(i,r);const l=a.changedTouches[0];o({tapEndedAt:Date.now(),tapEndedPos:{x:l.clientX,y:l.clientY}})&&t("tapped")}return Xg(i,s),{destroy(){Yg(i,s),Ar(i,r)}}}function Jg({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,particlesToScroll:o}){return i===t-e?0:i===0?Al({particlesCountWithoutClones:t-n,particlesToScroll:o})-1:Math.floor((i-e)/o)}function Zg({currentParticleIndex:i,particlesToScroll:t}){return Math.ceil(i/t)}function Kg({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,infinite:o,particlesToScroll:s}){return o?Jg({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,particlesToScroll:s}):Zg({currentParticleIndex:i,particlesToScroll:s})}function Al({particlesCountWithoutClones:i,particlesToScroll:t}){return Math.ceil(i/t)}function $g({particlesCountWithoutClones:i,particlesToScroll:t,particlesToShow:e}){const n=vl({particlesCountWithoutClones:i,particlesToScroll:t,particlesToShow:e});return Math.ceil(i/t)-n}function e0({infinite:i,particlesCountWithoutClones:t,particlesToScroll:e,particlesToShow:n}){return i?Al({particlesCountWithoutClones:t,particlesToScroll:e}):$g({particlesCountWithoutClones:t,particlesToScroll:e,particlesToShow:n})}function t0({pageIndex:i,clonesCountHead:t,clonesCountTail:e,particlesToScroll:n,particlesCount:o}){return Gt(0,Math.min(t+i*n,o-e),o-1)}function n0({pageIndex:i,particlesToScroll:t,particlesCount:e,particlesToShow:n}){return Gt(0,Math.min(i*t,e-n),e-1)}function Bi({infinite:i,pageIndex:t,clonesCountHead:e,clonesCountTail:n,particlesToScroll:o,particlesCount:s,particlesToShow:r}){return i?t0({pageIndex:t,clonesCountHead:e,clonesCountTail:n,particlesToScroll:o,particlesCount:s}):n0({pageIndex:t,particlesToScroll:o,particlesCount:s,particlesToShow:r})}function i0({particlesContainerChildren:i,particleWidth:t}){for(let e=0;e<i.length;e++)i[e].style.minWidth=`${t}px`,i[e].style.maxWidth=`${t}px`}function vl({particlesToScroll:i,particlesToShow:t,particlesCountWithoutClones:e}){const n=i-t;let o=t;for(;;){const s=e-o-n;if(s<t)return Math.max(s,0);o+=t+n}}function o0(i){return new ResizeObserver(t=>{i({width:t[0].contentRect.width})})}function s0({clonesCountHead:i,clonesCountTail:t,particlesContainerChildren:e}){const n=[];for(let r=0;r<t;r++)n.push(e[r].cloneNode(!0));const o=[],s=e.length;for(let r=s-1;r>s-1-i;r--)o.push(e[r].cloneNode(!0));return{clonesToAppend:n,clonesToPrepend:o}}function r0({particlesContainer:i,clonesToAppend:t,clonesToPrepend:e}){for(let n=0;n<t.length;n++)i.append(t[n]);for(let n=0;n<e.length;n++)i.prepend(e[n])}function a0({infinite:i,particlesToShow:t,partialPageSize:e}){const n=i?{head:Math.ceil(e||t),tail:Math.ceil(t)}:{head:0,tail:0};return me(O({},n),{total:n.head+n.tail})}const fn=(i,t,e)=>{if(i&&i.hasOwnProperty(t))return i[t];if(e===void 0)throw new Error(`Required arg "${t}" was not provided`);return e},Zi=i=>t=>{i[t]&&i[t]()},l0=(i,t)=>oc.default(i,t),c0=i=>Object.keys(i||{}),u0=(i,t)=>{const e={};return i.forEach(n=>{e[n]=t[n]}),e},d0=()=>{const i={},t=(e,n)=>{const{watcherName:o,fn:s}=e,{prop:r,value:a}=n;i[o]||(i[o]={deps:{},fn:s}),i[o].deps[r]=a};return{subscribers:i,subscribe(e,n){e&&t(e,n)},notify(e,n){Object.entries(i).forEach(([o,{deps:s,fn:r}])=>{const a=c0(s);if(a.includes(n)){const l=u0(a,e);l0(s,l)||(i[o].deps=l,r())}})}}},h0=()=>{let i=null;return{targetWatcher(t,e){i={watcherName:t,fn:e},i.fn(),i=null},getTarget(){return i}}};function f0(i,t){const e=kn.default(i,"data",{}),n=kn.default(i,"watch",{}),o=kn.default(i,"methods",{}),s=kn.default(t,"onChange",()=>{}),{subscribe:r,notify:a,subscribers:l}=d0(),{targetWatcher:c,getTarget:u}=h0();let h;const d={},f=()=>({data:h,methods:d});let g=!1;const A=v=>(...y)=>{g=!0;const w=v(...y);return g=!1,w};Object.entries(o).forEach(([v,y])=>{d[v]=A((...w)=>y(f(),...w)),Object.defineProperty(d[v],"name",{value:v})}),h=new Proxy(ic.default(e),{get(v,y){return u()&&!g&&r(u(),{prop:y,value:v[y]}),Reflect.get(...arguments)},set(v,y,w){return v[y]===w||(Reflect.set(...arguments),u()||(s&&s(y,w),a(h,y))),!0}}),Object.entries(n).forEach(([v,y])=>{c(v,()=>{y(f())})});const p=[h,d];return p._internal={_getSubscribers(){return l}},p}function m0({pageIndex:i,particlesToShow:t,particlesToScroll:e,particlesCount:n}){const o=i===0?0:t-e,s=i*t-i*o,r=s+Math.max(t,e)-1,a=[];for(let l=s;l<=Math.min(n-1,r);l++)a.push(l);return a}function p0({infinite:i,pageIndex:t,pagesCount:e,particlesCount:n,particlesToShow:o,particlesToScroll:s}){const r=Gt(0,t,e-1);let a=r-1,l=r+1;a=i?a<0?e-1:a:Math.max(0,a),l=i?l>e-1?0:l:Math.min(e-1,l);const c=[...new Set([a,r,l,0,e-1])].sort((h,d)=>h-d),u=c.flatMap(h=>m0({pageIndex:h,particlesToShow:o,particlesToScroll:s,particlesCount:n}));return{pageIndexes:c,particleIndexes:[...new Set(u)].sort((h,d)=>h-d)}}const g0=(i,t)=>(i(),setInterval(i,t)),A0=35,vr=1;class v0{constructor({onProgressValueChange:t}){this._onProgressValueChange=t,this._autoplayDuration,this._onProgressValueChange,this._interval,this._paused=!1}setAutoplayDuration(t){this._autoplayDuration=t}start(t){return new Promise(e=>{this.reset();const n=Math.min(A0,Math.max(this._autoplayDuration,1));let o=-n;this._interval=g0(()=>H(this,null,function*(){if(this._paused)return;o+=n;const s=o/this._autoplayDuration;this._onProgressValueChange(s),s>vr&&(this.reset(),yield t(),e())}),n)})}pause(){this._paused=!0}resume(){this._paused=!1}reset(){clearInterval(this._interval),this._onProgressValueChange(vr)}}function b0(i){const t=new v0({onProgressValueChange:r=>{i("progressValue",1-r)}}),e=f0({data:{particlesCountWithoutClones:0,particlesToShow:1,particlesToShowInit:1,particlesToScroll:1,particlesToScrollInit:1,particlesCount:1,currentParticleIndex:1,infinite:!1,autoplayDuration:1e3,clonesCountHead:0,clonesCountTail:0,clonesCountTotal:0,partialPageSize:1,currentPageIndex:1,pagesCount:1,pauseOnFocus:!1,focused:!1,autoplay:!1,autoplayDirection:"next",disabled:!1,durationMsInit:1e3,durationMs:1e3,offset:0,particleWidth:0,loaded:[]},watch:{setLoaded({data:r}){r.loaded=p0({infinite:r.infinite,pageIndex:r.currentPageIndex,pagesCount:r.pagesCount,particlesCount:r.particlesCountWithoutClones,particlesToShow:r.particlesToShow,particlesToScroll:r.particlesToScroll}).particleIndexes},setCurrentPageIndex({data:r}){r.currentPageIndex=Kg({currentParticleIndex:r.currentParticleIndex,particlesCount:r.particlesCount,clonesCountHead:r.clonesCountHead,clonesCountTotal:r.clonesCountTotal,infinite:r.infinite,particlesToScroll:r.particlesToScroll})},setPartialPageSize({data:r}){r.partialPageSize=vl({particlesToScroll:r.particlesToScroll,particlesToShow:r.particlesToShow,particlesCountWithoutClones:r.particlesCountWithoutClones})},setClonesCount({data:r}){const{head:a,tail:l}=a0({infinite:r.infinite,particlesToShow:r.particlesToShow,partialPageSize:r.partialPageSize});r.clonesCountHead=a,r.clonesCountTail=l,r.clonesCountTotal=a+l},setProgressManagerAutoplayDuration({data:r}){t.setAutoplayDuration(r.autoplayDuration)},toggleProgressManager({data:{pauseOnFocus:r,focused:a}}){r&&(a?t.pause():t.resume())},initDuration({data:r}){r.durationMs=r.durationMsInit},applyAutoplay({data:r,methods:{_applyAutoplayIfNeeded:a}}){r.autoplay&&a(r.autoplay)},setPagesCount({data:r}){r.pagesCount=e0({infinite:r.infinite,particlesCountWithoutClones:r.particlesCountWithoutClones,particlesToScroll:r.particlesToScroll,particlesToShow:r.particlesToShow})},setParticlesToShow({data:r}){r.particlesToShow=Gt(1,r.particlesToShowInit,r.particlesCountWithoutClones)},setParticlesToScroll({data:r}){r.particlesToScroll=Gt(1,r.particlesToScrollInit,r.particlesCountWithoutClones)}},methods:{_prev({data:r}){r.currentParticleIndex=Bi({infinite:r.infinite,pageIndex:r.currentPageIndex-1,clonesCountHead:r.clonesCountHead,clonesCountTail:r.clonesCountTail,particlesToScroll:r.particlesToScroll,particlesCount:r.particlesCount,particlesToShow:r.particlesToShow})},_next({data:r}){r.currentParticleIndex=Bi({infinite:r.infinite,pageIndex:r.currentPageIndex+1,clonesCountHead:r.clonesCountHead,clonesCountTail:r.clonesCountTail,particlesToScroll:r.particlesToScroll,particlesCount:r.particlesCount,particlesToShow:r.particlesToShow})},_moveToParticle({data:r},a){r.currentParticleIndex=Gt(0,a,r.particlesCount-1)},toggleFocused({data:r}){r.focused=!r.focused},_applyAutoplayIfNeeded(l){return H(this,arguments,function*({data:r,methods:a}){if(!r.infinite&&(r.autoplayDirection===wt&&r.currentParticleIndex===r.particlesCount-1||r.autoplayDirection===Yt&&r.currentParticleIndex===0)){t.reset();return}if(r.autoplay){const c=()=>Zi({[wt]:()=>H(this,null,function*(){return a.showNextPage()}),[Yt]:()=>H(this,null,function*(){return a.showPrevPage()})})(r.autoplayDirection);yield t.start(c)}})},_jumpIfNeeded(l){return H(this,arguments,function*({data:r,methods:a}){let c=!1;return r.infinite&&(r.currentParticleIndex===0?(yield a.showParticle(r.particlesCount-r.clonesCountTotal,{animated:!1}),c=!0):r.currentParticleIndex===r.particlesCount-r.clonesCountTail&&(yield a.showParticle(r.clonesCountHead,{animated:!1}),c=!0)),c})},changePage(u,h,d){return H(this,arguments,function*({data:r,methods:a},l,c){if(t.reset(),r.disabled)return;r.disabled=!0,l(),yield a.offsetPage({animated:fn(c,"animated",!0)}),r.disabled=!1,!(yield a._jumpIfNeeded())&&a._applyAutoplayIfNeeded()})},showNextPage(c,u){return H(this,arguments,function*({data:r,methods:a},l){r.disabled||(yield a.changePage(a._next,l))})},showPrevPage(c,u){return H(this,arguments,function*({data:r,methods:a},l){r.disabled||(yield a.changePage(a._prev,l))})},showParticle(c,u,h){return H(this,arguments,function*({methods:r},a,l){yield r.changePage(()=>r._moveToParticle(a),l)})},_getParticleIndexByPageIndex({data:r},a){return Bi({infinite:r.infinite,pageIndex:a,clonesCountHead:r.clonesCountHead,clonesCountTail:r.clonesCountTail,particlesToScroll:r.particlesToScroll,particlesCount:r.particlesCount,particlesToShow:r.particlesToShow})},showPage(c,u,h){return H(this,arguments,function*({methods:r},a,l){const d=r._getParticleIndexByPageIndex(a);yield r.showParticle(d,l)})},offsetPage({data:r},a){const l=fn(a,"animated",!0);return new Promise(c=>{r.durationMs=l?r.durationMsInit:0,r.offset=-r.currentParticleIndex*r.particleWidth,setTimeout(()=>{c()},r.durationMs)})}}},{onChange:i}),[n,o]=e;return[{data:n,progressManager:t},o,e._internal]}function y0(i){ce(i,"svelte-sme1z4",":root{--sc-color-rgb-light-50p:rgba(93, 93, 93, 0.5);--sc-color-rgb-light:#5d5d5d;--sc-color-hex-dark-50p:rgba(30, 30, 30, 0.5);--sc-color-hex-dark:#1e1e1e}.sc-carousel__carousel-container.svelte-sme1z4{display:flex;width:100%;flex-direction:column;align-items:center}.sc-carousel__content-container.svelte-sme1z4{position:relative;display:flex;width:100%}.sc-carousel__pages-window.svelte-sme1z4{flex:1;display:flex;overflow:hidden;box-sizing:border-box;position:relative}.sc-carousel__pages-container.svelte-sme1z4{width:100%;display:flex;transition-property:transform}.sc-carousel__arrow-container.svelte-sme1z4{padding:5px;box-sizing:border-box;display:flex;align-items:center;justify-content:center}.sc-carousel-progress__container.svelte-sme1z4{width:100%;height:5px;background-color:var(--sc-color-rgb-light-50p);position:absolute;bottom:0}.sc-carousel-button{all:unset;cursor:pointer}.sc-carousel-button:focus{outline:5px auto}")}const w0=i=>({currentPageIndex:i[0]&32,pagesCount:i[0]&1024,loaded:i[0]&64}),br=i=>({currentPageIndex:i[5],pagesCount:i[10],showPage:i[15],loaded:i[6]}),C0=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),yr=i=>({showNextPage:i[14].showNextPage,loaded:i[6],currentPageIndex:i[5]}),P0=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),wr=i=>({loaded:i[6],currentPageIndex:i[5]}),E0=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Cr=i=>({showPrevPage:i[14].showPrevPage,loaded:i[6],currentPageIndex:i[5]});function Pr(i){let t;const e=i[37].prev,n=Kt(e,i,i[36],Cr),o=n||I0(i);return{c(){o&&o.c()},m(s,r){o&&o.m(s,r),t=!0},p(s,r){n?n.p&&(!t||r[0]&96|r[1]&32)&&en(n,e,s,s[36],t?$t(e,s[36],r,E0):tn(s[36]),Cr):o&&o.p&&(!t||r[0]&36)&&o.p(s,t?r:[-1,-1])},i(s){t||(E(o,s),t=!0)},o(s){D(o,s),t=!1},d(s){o&&o.d(s)}}}function I0(i){let t,e,n;return e=new gl({props:{direction:"prev",disabled:!i[2]&&i[5]===0}}),e.$on("click",i[23]),{c(){t=z("div"),K(e.$$.fragment),b(t,"class","sc-carousel__arrow-container svelte-sme1z4")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s[0]&36&&(r.disabled=!o[2]&&o[5]===0),e.$set(r)},i(o){n||(E(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function Er(i){let t,e,n;return e=new Mg({props:{value:i[7]}}),{c(){t=z("div"),K(e.$$.fragment),b(t,"class","sc-carousel-progress__container svelte-sme1z4")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s[0]&128&&(r.value=o[7]),e.$set(r)},i(o){n||(E(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function Ir(i){let t;const e=i[37].next,n=Kt(e,i,i[36],yr),o=n||k0(i);return{c(){o&&o.c()},m(s,r){o&&o.m(s,r),t=!0},p(s,r){n?n.p&&(!t||r[0]&96|r[1]&32)&&en(n,e,s,s[36],t?$t(e,s[36],r,C0):tn(s[36]),yr):o&&o.p&&(!t||r[0]&1060)&&o.p(s,t?r:[-1,-1])},i(s){t||(E(o,s),t=!0)},o(s){D(o,s),t=!1},d(s){o&&o.d(s)}}}function k0(i){let t,e,n;return e=new gl({props:{direction:"next",disabled:!i[2]&&i[5]===i[10]-1}}),e.$on("click",i[14].showNextPage),{c(){t=z("div"),K(e.$$.fragment),b(t,"class","sc-carousel__arrow-container svelte-sme1z4")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s[0]&1060&&(r.disabled=!o[2]&&o[5]===o[10]-1),e.$set(r)},i(o){n||(E(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function kr(i){let t;const e=i[37].dots,n=Kt(e,i,i[36],br),o=n||x0(i);return{c(){o&&o.c()},m(s,r){o&&o.m(s,r),t=!0},p(s,r){n?n.p&&(!t||r[0]&1120|r[1]&32)&&en(n,e,s,s[36],t?$t(e,s[36],r,w0):tn(s[36]),br):o&&o.p&&(!t||r[0]&1056)&&o.p(s,t?r:[-1,-1])},i(s){t||(E(o,s),t=!0)},o(s){D(o,s),t=!1},d(s){o&&o.d(s)}}}function x0(i){let t,e;return t=new Eg({props:{pagesCount:i[10],currentPageIndex:i[5]}}),t.$on("pageChange",i[41]),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o[0]&1024&&(s.pagesCount=n[10]),o[0]&32&&(s.currentPageIndex=n[5]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function D0(i){let t,e,n,o,s,r,a,l,c,u,h,d,f=i[1]&&Pr(i);const g=i[37].default,A=Kt(g,i,i[36],wr);let p=i[3]&&Er(i),v=i[1]&&Ir(i),y=i[4]&&kr(i);return{c(){t=z("div"),e=z("div"),f&&f.c(),n=$(),o=z("div"),s=z("div"),A&&A.c(),a=$(),p&&p.c(),l=$(),v&&v.c(),c=$(),y&&y.c(),b(s,"class","sc-carousel__pages-container svelte-sme1z4"),L(s,"transform","translateX("+i[8]+"px)"),L(s,"transition-duration",i[9]+"ms"),L(s,"transition-timing-function",i[0]),b(o,"class","sc-carousel__pages-window svelte-sme1z4"),b(e,"class","sc-carousel__content-container svelte-sme1z4"),b(t,"class","sc-carousel__carousel-container svelte-sme1z4")},m(w,P){T(w,t,P),B(t,e),f&&f.m(e,null),B(e,n),B(e,o),B(o,s),A&&A.m(s,null),i[39](s),B(o,a),p&&p.m(o,null),i[40](o),B(e,l),v&&v.m(e,null),B(t,c),y&&y.m(t,null),u=!0,h||(d=[Pi(r=Fg.call(null,s,{thresholdProvider:i[38]})),we(s,"swipeStart",i[16]),we(s,"swipeMove",i[18]),we(s,"swipeEnd",i[19]),we(s,"swipeFailed",i[20]),we(s,"swipeThresholdReached",i[17]),Pi(Ng.call(null,o)),we(o,"hovered",i[21]),Pi(qg.call(null,o)),we(o,"tapped",i[22])],h=!0)},p(w,P){w[1]?f?(f.p(w,P),P[0]&2&&E(f,1)):(f=Pr(w),f.c(),E(f,1),f.m(e,n)):f&&(se(),D(f,1,1,()=>{f=null}),re()),A&&A.p&&(!u||P[0]&96|P[1]&32)&&en(A,g,w,w[36],u?$t(g,w[36],P,P0):tn(w[36]),wr),(!u||P[0]&256)&&L(s,"transform","translateX("+w[8]+"px)"),(!u||P[0]&512)&&L(s,"transition-duration",w[9]+"ms"),(!u||P[0]&1)&&L(s,"transition-timing-function",w[0]),r&&Zt(r.update)&&P[0]&2048&&r.update.call(null,{thresholdProvider:w[38]}),w[3]?p?(p.p(w,P),P[0]&8&&E(p,1)):(p=Er(w),p.c(),E(p,1),p.m(o,null)):p&&(se(),D(p,1,1,()=>{p=null}),re()),w[1]?v?(v.p(w,P),P[0]&2&&E(v,1)):(v=Ir(w),v.c(),E(v,1),v.m(e,null)):v&&(se(),D(v,1,1,()=>{v=null}),re()),w[4]?y?(y.p(w,P),P[0]&16&&E(y,1)):(y=kr(w),y.c(),E(y,1),y.m(t,null)):y&&(se(),D(y,1,1,()=>{y=null}),re())},i(w){u||(E(f),E(A,w),E(p),E(v),E(y),u=!0)},o(w){D(f),D(A,w),D(p),D(v),D(y),u=!1},d(w){w&&M(t),f&&f.d(),A&&A.d(w),i[39](null),p&&p.d(),i[40](null),v&&v.d(),y&&y.d(),h=!1,ct(d)}}}function L0(i,t,e){let{$$slots:n={},$$scope:o}=t,s=[],r,a,l=0,c=0,u=1;const[{data:h,progressManager:d},f,g]=b0((te,Ae)=>{Zi({currentPageIndex:()=>e(5,r=Ae),progressValue:()=>e(7,a=Ae),offset:()=>e(8,l=Ae),durationMs:()=>e(9,c=Ae),pagesCount:()=>e(10,u=Ae),loaded:()=>e(6,s=Ae)})(te)}),A=ai();let{timingFunction:p="ease-in-out"}=t,{arrows:v=!0}=t,{infinite:y=!0}=t,{initialPageIndex:w=0}=t,{duration:P=500}=t,{autoplay:k=!1}=t,{autoplayDuration:C=3e3}=t,{autoplayDirection:S=wt}=t,{pauseOnFocus:x=!1}=t,{autoplayProgressVisible:Q=!1}=t,{dots:_=!0}=t,{swiping:R=!0}=t,{particlesToShow:U=1}=t,{particlesToScroll:j=1}=t;function F(te,Ae){return H(this,null,function*(){const Ve=fn(Ae,"animated",!0);if(typeof te!="number")throw new Error("pageIndex should be a number");yield f.showPage(te,{animated:Ve})})}function W(te){return H(this,null,function*(){const Ae=fn(te,"animated",!0);yield f.showPrevPage({animated:Ae})})}function X(te){return H(this,null,function*(){const Ae=fn(te,"animated",!0);yield f.showNextPage({animated:Ae})})}let G=0,ee,N;const ae=o0(({width:te})=>{e(11,G=te),h.particleWidth=G/h.particlesToShow,i0({particlesContainerChildren:N.children,particleWidth:h.particleWidth}),f.offsetPage({animated:!1})});function he(){const{clonesToAppend:te,clonesToPrepend:Ae}=s0({clonesCountHead:h.clonesCountHead,clonesCountTail:h.clonesCountTail,particlesContainerChildren:N.children});r0({particlesContainer:N,clonesToAppend:te,clonesToPrepend:Ae})}Ue(()=>{H(this,null,function*(){yield zo(),N&&ee&&(h.particlesCountWithoutClones=N.children.length,yield zo(),h.infinite&&he(),h.particlesCount=N.children.length,f.showPage(w,{animated:!1}),ae.observe(ee))})}),Pt(()=>{ae.disconnect(),d.reset()});function ue(te){return H(this,null,function*(){yield f.showPage(te,{animated:!0})})}function pe(){!R||(h.durationMs=0)}function Pe(te){return H(this,null,function*(){!R||(yield Zi({[wt]:f.showNextPage,[Yt]:f.showPrevPage})(te.detail.direction))})}function Le(te){!R||(h.offset+=te.detail.dx)}function ze(){!R||f.showParticle(h.currentParticleIndex)}function le(){return H(this,null,function*(){!R||(yield f.offsetPage({animated:!0}))})}function ge(te){h.focused=te.detail.value}function Ee(){f.toggleFocused()}function de(){f.showPrevPage()}const Xe=()=>G/3;function it(te){Qe[te?"unshift":"push"](()=>{N=te,e(13,N)})}function ve(te){Qe[te?"unshift":"push"](()=>{ee=te,e(12,ee)})}const Je=te=>ue(te.detail);return i.$$set=te=>{"timingFunction"in te&&e(0,p=te.timingFunction),"arrows"in te&&e(1,v=te.arrows),"infinite"in te&&e(2,y=te.infinite),"initialPageIndex"in te&&e(24,w=te.initialPageIndex),"duration"in te&&e(25,P=te.duration),"autoplay"in te&&e(26,k=te.autoplay),"autoplayDuration"in te&&e(27,C=te.autoplayDuration),"autoplayDirection"in te&&e(28,S=te.autoplayDirection),"pauseOnFocus"in te&&e(29,x=te.pauseOnFocus),"autoplayProgressVisible"in te&&e(3,Q=te.autoplayProgressVisible),"dots"in te&&e(4,_=te.dots),"swiping"in te&&e(30,R=te.swiping),"particlesToShow"in te&&e(31,U=te.particlesToShow),"particlesToScroll"in te&&e(32,j=te.particlesToScroll),"$$scope"in te&&e(36,o=te.$$scope)},i.$$.update=()=>{i.$$.dirty[0]&32&&A("pageChange",r),i.$$.dirty[0]&4&&(h.infinite=y),i.$$.dirty[0]&33554432&&(h.durationMsInit=P),i.$$.dirty[0]&67108864&&(h.autoplay=k),i.$$.dirty[0]&134217728&&(h.autoplayDuration=C),i.$$.dirty[0]&268435456&&(h.autoplayDirection=S),i.$$.dirty[0]&536870912&&(h.pauseOnFocus=x),i.$$.dirty[1]&1&&(h.particlesToShowInit=U),i.$$.dirty[1]&2&&(h.particlesToScrollInit=j)},[p,v,y,Q,_,r,s,a,l,c,u,G,ee,N,f,ue,pe,Pe,Le,ze,le,ge,Ee,de,w,P,k,C,S,x,R,U,j,F,W,X,o,n,Xe,it,ve,Je]}class S0 extends oe{constructor(t){super(),ie(this,t,L0,D0,ne,{timingFunction:0,arrows:1,infinite:2,initialPageIndex:24,duration:25,autoplay:26,autoplayDuration:27,autoplayDirection:28,pauseOnFocus:29,autoplayProgressVisible:3,dots:4,swiping:30,particlesToShow:31,particlesToScroll:32,goTo:33,goToPrev:34,goToNext:35},y0,[-1,-1])}get goTo(){return this.$$.ctx[33]}get goToPrev(){return this.$$.ctx[34]}get goToNext(){return this.$$.ctx[35]}}function M0(i){ce(i,"svelte-159ski6",".media-item.svelte-159ski6.svelte-159ski6{position:relative;height:100%}.media-content.svelte-159ski6.svelte-159ski6{position:relative;pointer-events:auto;width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;-o-object-fit:inherit;object-fit:inherit}.media-content.showPlayButton.svelte-159ski6.svelte-159ski6{pointer-events:none}.video-icon.svelte-159ski6.svelte-159ski6{width:12.5rem;height:6.25rem;max-width:60%;max-height:60%;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.video-play-button-container.svelte-159ski6.svelte-159ski6{display:none;position:absolute;width:100%;height:100%;top:0;left:0;transform:translate3d(0, 0, 0)}.video-play-button-container.showPlayButton.svelte-159ski6.svelte-159ski6{pointer-events:none;display:block}.video-icon.svelte-159ski6.svelte-159ski6{pointer-events:auto}.video-icon.large.svelte-159ski6.svelte-159ski6{width:12.5rem;height:6.25rem}.video-icon.small.svelte-159ski6.svelte-159ski6{width:1.75rem;height:1.75rem}.video-icon.svelte-159ski6 .video-icon-img.svelte-159ski6{width:100%;height:100%;background-position:center center;background-size:contain;background-repeat:no-repeat}.video-icon.svelte-159ski6 .video-icon-img.canPlay.svelte-159ski6{cursor:pointer}")}function xr(i){let t;function e(s,r){if(s[2].type==="Image")return z0;if(s[2].type==="Video")return T0}let n=e(i),o=n&&n(i);return{c(){t=z("div"),o&&o.c(),b(t,"class","media-item svelte-159ski6"),b(t,"draggable","false")},m(s,r){T(s,t,r),o&&o.m(t,null)},p(s,r){n===(n=e(s))&&o?o.p(s,r):(o&&o.d(1),o=n&&n(s),o&&(o.c(),o.m(t,null)))},d(s){s&&M(t),o&&o.d()}}}function T0(i){let t,e,n,o,s,r;function a(u,h){return u[7]&&u[2].videoCoverUrl?j0:B0}let l=a(i),c=l(i);return{c(){c.c(),t=$(),e=z("div"),n=z("div"),o=z("div"),b(o,"class","video-icon-img svelte-159ski6"),L(o,"background-image","url("+i[18]()+")"),q(o,"canPlay",i[5]),b(n,"class","video-icon svelte-159ski6"),q(n,"large",i[4]==="large"),q(n,"small",i[4]==="small"),b(e,"class","video-play-button-container svelte-159ski6"),q(e,"showPlayButton",i[9])},m(u,h){c.m(u,h),T(u,t,h),T(u,e,h),B(e,n),B(n,o),s||(r=we(o,"click",i[19]),s=!0)},p(u,h){l===(l=a(u))&&c?c.p(u,h):(c.d(1),c=l(u),c&&(c.c(),c.m(t.parentNode,t))),h&8&&L(o,"background-image","url("+u[18]()+")"),h&32&&q(o,"canPlay",u[5]),h&16&&q(n,"large",u[4]==="large"),h&16&&q(n,"small",u[4]==="small"),h&512&&q(e,"showPlayButton",u[9])},d(u){c.d(u),u&&M(t),u&&M(e),s=!1,r()}}}function z0(i){let t,e,n,o;return{c(){t=z("img"),b(t,"class","media-content svelte-159ski6"),b(t,"style",e=`object-fit: ${i[6]};`),_e(t.src,n=i[2].url)||b(t,"src",n),b(t,"alt",o=i[2].name),b(t,"draggable",!1)},m(s,r){T(s,t,r)},p(s,r){r&64&&e!==(e=`object-fit: ${s[6]};`)&&b(t,"style",e),r&4&&!_e(t.src,n=s[2].url)&&b(t,"src",n),r&4&&o!==(o=s[2].name)&&b(t,"alt",o)},d(s){s&&M(t)}}}function B0(i){let t,e,n,o,s,r,a;return{c(){t=z("video"),b(t,"class","media-content svelte-159ski6"),b(t,"style",e=`object-fit: ${i[6]};`),_e(t.src,n=i[2].videoCoverUrl?i[2].url:i[2].url+"#t=0.1")||b(t,"src",n),b(t,"poster",o=i[2].videoCoverUrl),b(t,"preload",s=i[2].videoCoverUrl?"none":"auto"),b(t,"disablepictureinpicture",""),t.playsInline=!0,b(t,"paused",""),t.muted=!0,b(t,"draggable",!1),t.loop=!1,b(t,"crossorigin",""),t.controls=!1,q(t,"showPlayButton",i[9])},m(l,c){T(l,t,c),i[17](t),r||(a=[we(t,"play",i[14]),we(t,"pause",i[15]),we(t,"click",i[16])],r=!0)},p(l,c){c&64&&e!==(e=`object-fit: ${l[6]};`)&&b(t,"style",e),c&4&&!_e(t.src,n=l[2].videoCoverUrl?l[2].url:l[2].url+"#t=0.1")&&b(t,"src",n),c&4&&o!==(o=l[2].videoCoverUrl)&&b(t,"poster",o),c&4&&s!==(s=l[2].videoCoverUrl?"none":"auto")&&b(t,"preload",s),c&512&&q(t,"showPlayButton",l[9])},d(l){l&&M(t),i[17](null),r=!1,ct(a)}}}function j0(i){let t,e,n,o;return{c(){t=z("img"),b(t,"class","media-content svelte-159ski6"),b(t,"style",e=`object-fit: ${i[6]};`),_e(t.src,n=i[2].videoCoverUrl)||b(t,"src",n),b(t,"alt",o=i[2].name),b(t,"draggable",!1)},m(s,r){T(s,t,r)},p(s,r){r&64&&e!==(e=`object-fit: ${s[6]};`)&&b(t,"style",e),r&4&&!_e(t.src,n=s[2].videoCoverUrl)&&b(t,"src",n),r&4&&o!==(o=s[2].name)&&b(t,"alt",o)},d(s){s&&M(t)}}}function V0(i){let t,e=i[2]&&xr(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),T(n,t,o)},p(n,[o]){n[2]?e?e.p(n,o):(e=xr(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:Y,o:Y,d(n){e&&e.d(n),n&&M(t)}}}function Q0(i,t,e){let n,{mediaInstance:o={paused:!0}}=t,{tag:s}=t,{media:r}=t,{playButtonIfNeed:a="withoutText"}=t,{playButtonSizeIfNeed:l="small"}=t,{canPlay:c=!0}=t,{objectFit:u="fill"}=t,{disableVideoIfHavePoster:h=!1}=t,d,f=!0,g=!1;function A(){e(12,g=(r==null?void 0:r.type)==="Video"&&Boolean(r.videoCoverUrl))}const p=St("mediaStore"),v=St("hooks"),y=()=>{g||(d==null||d.play(),d==null||d.pause(),e(12,g=!0))};v.on("loadVideoFirstFrame",y),Ue(()=>{p.subscribe(({currentMediaElement:Q})=>{Q!==d&&(d==null||d.pause())})});const w=Q=>{e(9,f=!1),e(0,o.paused=!1,o),p.set({currentMediaElement:d}),v.emit("playStateChange",{event:Q,state:"playing",tag:s,mediaInstance:d})},P=Q=>{e(9,f=!0),e(0,o.paused=!0,o),v.emit("playStateChange",{event:Q,state:"paused",tag:s,mediaInstance:d})},k=Q=>{d&&d.pause()};function C(Q){Qe[Q?"unshift":"push"](()=>{d=Q,e(8,d)})}const S=()=>a==="withText"?Qp:a==="withoutText"?Op:a,x=Q=>{!c||d&&(e(8,d.muted=!1,d),d.play())};return i.$$set=Q=>{"mediaInstance"in Q&&e(0,o=Q.mediaInstance),"tag"in Q&&e(1,s=Q.tag),"media"in Q&&e(2,r=Q.media),"playButtonIfNeed"in Q&&e(3,a=Q.playButtonIfNeed),"playButtonSizeIfNeed"in Q&&e(4,l=Q.playButtonSizeIfNeed),"canPlay"in Q&&e(5,c=Q.canPlay),"objectFit"in Q&&e(6,u=Q.objectFit),"disableVideoIfHavePoster"in Q&&e(7,h=Q.disableVideoIfHavePoster)},i.$$.update=()=>{if(i.$$.dirty&4&&e(13,n=r==null?void 0:r.url),i.$$.dirty&8192&&Boolean(n)&&A(),i.$$.dirty&256&&d&&e(9,f=d.paused),i.$$.dirty&4356&&(r==null?void 0:r.type)==="Video"&&!g){const Q=navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1,R=navigator.userAgent.toLowerCase().indexOf("iphone")!==-1&&Q;d&&R&&d.paused&&(document.removeEventListener("WeixinJSBridgeReady",y),document.removeEventListener("touchstart",y),document.removeEventListener("click",y),document.addEventListener("WeixinJSBridgeReady",y),document.addEventListener("touchstart",y),document.addEventListener("click",y))}},[o,s,r,a,l,c,u,h,d,f,p,v,g,n,w,P,k,C,S,x]}class bl extends oe{constructor(t){super(),ie(this,t,Q0,V0,ne,{mediaInstance:0,tag:1,media:2,playButtonIfNeed:3,playButtonSizeIfNeed:4,canPlay:5,objectFit:6,disableVideoIfHavePoster:7},M0)}}function O0(i){ce(i,"svelte-1mrbqlg",".media-list-wrapper.svelte-1mrbqlg.svelte-1mrbqlg{width:100%;height:100%;position:relative;overflow:hidden;border-radius:0.125rem}.media-list-wrapper.svelte-1mrbqlg .media-list.svelte-1mrbqlg{position:relative;pointer-events:auto;height:100%;left:50%;top:50%;transform:translate(-50%, -50%)}.media-list-wrapper.svelte-1mrbqlg .media-list.svelte-1mrbqlg .sc-carousel__carousel-container,.media-list-wrapper.svelte-1mrbqlg .media-list.svelte-1mrbqlg .sc-carousel__content-container{height:100%}")}function Dr(i,t,e){const n=i.slice();return n[21]=t[e],n[22]=t,n[23]=e,n}function Lr(i){let t,e,n,o,s,r,a;const l=[F0,R0],c=[];function u(h,d){return h[12]&&h[10].length>1?0:1}return n=u(i),o=c[n]=l[n](i),{c(){t=z("div"),e=z("div"),o.c(),b(e,"class","media-list svelte-1mrbqlg"),q(e,"carouselEnabled",i[12]),b(t,"class","media-list-wrapper svelte-1mrbqlg"),q(t,"unfolded",i[5])},m(h,d){T(h,t,d),B(t,e),c[n].m(e,null),a=!0},p(h,d){i=h;let f=n;n=u(i),n===f?c[n].p(i,d):(se(),D(c[f],1,1,()=>{c[f]=null}),re(),o=c[n],o?o.p(i,d):(o=c[n]=l[n](i),o.c()),E(o,1),o.m(e,null)),(!a||d&4096)&&q(e,"carouselEnabled",i[12]),(!a||d&32)&&q(t,"unfolded",i[5])},i(h){a||(E(o),h&&xe(()=>{r&&r.end(1),s=Tt(t,Qo,i[6]?{y:4,duration:i[4],delay:i[2],easing:At}:void 0),s.start()}),a=!0)},o(h){D(o),s&&s.invalidate(),h&&(r=nn(t,Qo,i[6]?{y:4,duration:i[4],delay:i[3],easing:At}:void 0)),a=!1},d(h){h&&M(t),c[n].d(),h&&r&&r.end()}}}function R0(i){let t,e;const n=[{media:i[1][0]},i[7],{tag:i[0]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new bl({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&131?Oe(n,[r&2&&{media:s[1][0]},r&128&&Ma(s[7]),r&1&&{tag:s[0]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function F0(i){let t,e,n={dots:!1,arrows:!1,$$slots:{default:[H0]},$$scope:{ctx:i}};return t=new S0({props:n}),i[17](t),t.$on("pageChange",i[18]),{c(){K(t.$$.fragment)},m(o,s){J(t,o,s),e=!0},p(o,s){const r={};s&16778625&&(r.$$scope={dirty:s,ctx:o}),t.$set(r)},i(o){e||(E(t.$$.fragment,o),e=!0)},o(o){D(t.$$.fragment,o),e=!1},d(o){i[17](null),Z(t,o)}}}function Sr(i){let t,e,n;const o=[i[7],{media:i[21]},{tag:i[0]}];function s(a){i[16](a,i[23])}let r={};for(let a=0;a<o.length;a+=1)r=je(r,o[a]);return i[8][i[23]]!==void 0&&(r.mediaInstance=i[8][i[23]]),t=new bl({props:r}),Qe.push(()=>Yc(t,"mediaInstance",s)),{c(){K(t.$$.fragment)},m(a,l){J(t,a,l),n=!0},p(a,l){i=a;const c=l&1153?Oe(o,[l&128&&Ma(i[7]),l&1024&&{media:i[21]},l&1&&{tag:i[0]}]):{};!e&&l&256&&(e=!0,c.mediaInstance=i[8][i[23]],Wc(()=>e=!1)),t.$set(c)},i(a){n||(E(t.$$.fragment,a),n=!0)},o(a){D(t.$$.fragment,a),n=!1},d(a){Z(t,a)}}}function H0(i){let t,e,n=i[10],o=[];for(let r=0;r<n.length;r+=1)o[r]=Sr(Dr(i,n,r));const s=r=>D(o[r],1,1,()=>{o[r]=null});return{c(){for(let r=0;r<o.length;r+=1)o[r].c();t=fe()},m(r,a){for(let l=0;l<o.length;l+=1)o[l].m(r,a);T(r,t,a),e=!0},p(r,a){if(a&1409){n=r[10];let l;for(l=0;l<n.length;l+=1){const c=Dr(r,n,l);o[l]?(o[l].p(c,a),E(o[l],1)):(o[l]=Sr(c),o[l].c(),E(o[l],1),o[l].m(t.parentNode,t))}for(se(),l=n.length;l<o.length;l+=1)s(l);re()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)E(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)D(o[a]);e=!1},d(r){at(o,r),r&&M(t)}}}function G0(i){let t,e,n=i[5]&&Lr(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[5]?n?(n.p(o,s),s&32&&E(n,1)):(n=Lr(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function W0(i,t,e){let n,o,s,r,{tag:a}=t,{mediaData:l}=t,{inDelay:c=0}=t,{outDelay:u=0}=t,{duration:h=0}=t,{unfolded:d=!0}=t,{animation:f=!0}=t,{mediaItemConfig:g}=t,{enableCarousel:A=!0}=t,{autoplayConfig:p={autoplay:!0,autoplayVideo:!1}}=t,v=[],y,w=null;const P=St("mediaStore");Ue(()=>{w=setInterval(()=>{r&&(y==null||y.goToNext())},3e3)}),Pt(()=>{clearInterval(w)});function k(x,Q){i.$$.not_equal(v[Q],x)&&(v[Q]=x,e(8,v))}function C(x){Qe[x?"unshift":"push"](()=>{y=x,e(11,y)})}const S=x=>{n||P.set({currentMediaElement:null})};return i.$$set=x=>{"tag"in x&&e(0,a=x.tag),"mediaData"in x&&e(1,l=x.mediaData),"inDelay"in x&&e(2,c=x.inDelay),"outDelay"in x&&e(3,u=x.outDelay),"duration"in x&&e(4,h=x.duration),"unfolded"in x&&e(5,d=x.unfolded),"animation"in x&&e(6,f=x.animation),"mediaItemConfig"in x&&e(7,g=x.mediaItemConfig),"enableCarousel"in x&&e(14,A=x.enableCarousel),"autoplayConfig"in x&&e(15,p=x.autoplayConfig)},i.$$.update=()=>{i.$$.dirty&256&&e(9,n=v.every(x=>x.paused)),i.$$.dirty&16386&&e(12,o=A&&(l==null?void 0:l.length)>1),i.$$.dirty&2&&e(10,s=l),i.$$.dirty&34304&&(r=s.length>1&&p.autoplay&&n)},[a,l,c,u,h,d,f,g,v,n,s,y,o,P,A,p,k,C,S]}class yl extends oe{constructor(t){super(),ie(this,t,W0,G0,ne,{tag:0,mediaData:1,inDelay:2,outDelay:3,duration:4,unfolded:5,animation:6,mediaItemConfig:7,enableCarousel:14,autoplayConfig:15},O0)}}function N0(i){ce(i,"svelte-1f7m1lj",".line.svelte-1f7m1lj{position:absolute;width:6.5625rem;height:1.3125rem;transform:translateY(-100%)}.text.svelte-1f7m1lj{position:absolute;width:6.25rem;left:1rem;bottom:0.0625rem;font-weight:600}.media-wrapper.svelte-1f7m1lj{position:absolute;left:0.875rem;top:-5.3125rem;width:5.625rem;height:3.75rem;font-weight:600}")}function Mr(i){let t,e,n,o,s,r,a,l;t=new nt({props:{visible:i[3],left:61,bottom:57,width:2,blurRadius:150,spreadRadius:75}}),o=new gg({props:{unfolded:i[3],outDelay:400}});let c=i[2]&&Tr(i),u=i[1]&&zr(i);return{c(){K(t.$$.fragment),e=$(),n=z("div"),K(o.$$.fragment),s=$(),c&&c.c(),r=$(),u&&u.c(),a=fe(),b(n,"class","line svelte-1f7m1lj")},m(h,d){J(t,h,d),T(h,e,d),T(h,n,d),J(o,n,null),T(h,s,d),c&&c.m(h,d),T(h,r,d),u&&u.m(h,d),T(h,a,d),l=!0},p(h,d){const f={};d&8&&(f.visible=h[3]),t.$set(f);const g={};d&8&&(g.unfolded=h[3]),o.$set(g),h[2]?c?(c.p(h,d),d&4&&E(c,1)):(c=Tr(h),c.c(),E(c,1),c.m(r.parentNode,r)):c&&(se(),D(c,1,1,()=>{c=null}),re()),h[1]?u?(u.p(h,d),d&2&&E(u,1)):(u=zr(h),u.c(),E(u,1),u.m(a.parentNode,a)):u&&(se(),D(u,1,1,()=>{u=null}),re())},i(h){l||(E(t.$$.fragment,h),E(o.$$.fragment,h),E(c),E(u),l=!0)},o(h){D(t.$$.fragment,h),D(o.$$.fragment,h),D(c),D(u),l=!1},d(h){Z(t,h),h&&M(e),h&&M(n),Z(o),h&&M(s),c&&c.d(h),h&&M(r),u&&u.d(h),h&&M(a)}}}function Tr(i){let t,e,n;return e=new ml({props:{unfolded:i[3],content:i[2],inDelay:500}}),{c(){t=z("div"),K(e.$$.fragment),b(t,"class","text svelte-1f7m1lj")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s&8&&(r.unfolded=o[3]),s&4&&(r.content=o[2]),e.$set(r)},i(o){n||(E(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function zr(i){let t,e,n;return e=new yl({props:{autoplayConfig:{autoplay:!1},unfolded:i[3],mediaData:i[1],tag:i[0],enableCarousel:!1,mediaItemConfig:{canPlay:!1,playButtonSizeIfNeed:"small",disableVideoIfHavePoster:!0},inDelay:500,duration:500}}),{c(){t=z("div"),K(e.$$.fragment),b(t,"class","media-wrapper svelte-1f7m1lj")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s&8&&(r.unfolded=o[3]),s&2&&(r.mediaData=o[1]),s&1&&(r.tag=o[0]),e.$set(r)},i(o){n||(E(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function _0(i){let t,e,n=i[0].state&&Mr(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&&E(n,1)):(n=Mr(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function X0(i,t,e){let n,o,s,r,{tag:a}=t;return i.$$set=l=>{"tag"in l&&e(0,a=l.tag)},i.$$.update=()=>{var l,c,u;i.$$.dirty&1&&e(3,n=a.state?a.state.unfolded:!1),i.$$.dirty&1&&e(4,o=(c=(l=a.data.title)!=null?l:a.data.text)!=null?c:""),i.$$.dirty&16&&e(2,s=((u=o.length)!=null?u:0)>7?o.substring(0,6)+"...":o),i.$$.dirty&1&&e(1,r=a.data.mediaData)},[a,r,s,n,o]}class Y0 extends oe{constructor(t){super(),ie(this,t,X0,_0,ne,{tag:0},N0)}}class Ki{constructor(t=0,e=0){m(this,"min");m(this,"max");m(this,"isInterval",!0);this.min=t,this.max=e}fromArray(t){return this.min=t[0],this.max=t[1],this}isOverlap(t){return Math.min(this.max,t.max)<Math.max(this.min,t.min)}contains(t){return this.min<t.min&&this.max>t.max}}class U0{constructor(t,e){m(this,"min");m(this,"max");m(this,"xInterval");m(this,"yInterval");m(this,"isRectangle",!0);this.min=t,this.max=e,this.xInterval=new Ki(this.min.x,this.max.x),this.yInterval=new Ki(this.min.y,this.max.y)}isOverlapWithRectangle(t){return!this.xInterval.isOverlap(t.xInterval)&&!this.yInterval.isOverlap(t.yInterval)}containsRect(t){return this.xInterval.contains(t.xInterval)&&this.yInterval.contains(t.yInterval)}}function Hn(i,t,e){const n=i[t],o=i[e];!n||!o||(i[t]=o,i[e]=n)}function q0(i,t,e){const n=e/2;for(let o=1;o<=n;o++){const s=e-(o-1);for(let r=1;r<=t;r++){const a=(o-1)*t+r-1,l=(s-1)*t+r-1;Hn(i,a*4+0,l*4+0),Hn(i,a*4+1,l*4+1),Hn(i,a*4+2,l*4+2),Hn(i,a*4+3,l*4+3)}}}class wl{constructor(t,e){m(this,"width");m(this,"height");m(this,"containerDom");m(this,"hooks",new Ce.Subscribe);m(this,"canvas",document.createElement("canvas"));m(this,"five");m(this,"scale");m(this,"config");m(this,"offset",{x:0,y:0});m(this,"context");m(this,"renderCenter",new I.Vector3);m(this,"hammer");m(this,"state",{enabled:!1});m(this,"onPan",t=>{if(!this.containerDom||this.hooks.emit("wantsPanGesture",t))return;const n=this.offset.x+t.deltaX,o=this.offset.y+t.deltaY;this.canvas.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)",this.canvas.style.transform=`translate3d(${n}px, ${o}px, 100px)`});m(this,"onPanEnd",t=>{this.offset={x:this.offset.x+t.deltaX,y:this.offset.y+t.deltaY},this.canvas.style.boxShadow="none"});var o,s,r;if(!t.renderer)throw new Error("Five Render \u672A\u521D\u59CB\u5316");this.five=t,this.scale=(o=e==null?void 0:e.scale)!=null?o:2,this.width=(s=e==null?void 0:e.width)!=null?s:190,this.height=(r=e==null?void 0:e.height)!=null?r:190,this.config={dragEnabled:(e==null?void 0:e.dragEnabled)||!1,autoFixPCPosition:(e==null?void 0:e.autoFixPCPosition)||!1,initialPosition:(e==null?void 0:e.initialPosition)||{left:"0",top:"0"}};const n=this.canvas.getContext("2d");if(!n)throw new Error("CANNOT CREATE CONTEXT2D");this.context=n,this.config.dragEnabled&&(this.hammer=new yn.default(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panend",this.onPanEnd)),this.initStyle()}dispose(){var t;this.clear(),this.disable(),(t=this.hammer)==null||t.destroy()}enable(){var t;if(!this.state.enabled)return this.state.enabled=!0,(t=this.containerDom)==null||t.append(this.canvas),this}disable(){if(!!this.state.enabled)return this.state.enabled=!1,this.canvas.remove(),this}appendTo(t){var e;return this.containerDom&&((e=this.containerDom)==null||e.removeChild(this.canvas)),this.containerDom=t,this.state.enabled&&t.append(this.canvas),this}clear(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this}renderWithPoint(t){!this.containerDom||!this.state.enabled||(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}autoFixPCPosition(){if(!this.containerDom)return;const{width:t,height:e}=this,n=this.renderCenter.clone().project(this.five.camera),o=(n.x+1)/2*this.containerDom.clientWidth,s=-(n.x-1)/2*this.containerDom.clientWidth,r=-(n.y-1)/2*this.containerDom.clientHeight;o<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=90+"px"):r<183?(this.canvas.style.top=90+"px",this.canvas.style.left=-t/2+"px"):s<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=-t-90+"px"):(this.canvas.style.left=-t/2+"px",this.canvas.style.top=-e-90+"px"),this.canvas.style.transform=`translate3d(${o}px, ${r}px, 10px)`,this.offset={x:o,y:r}}render(){if(!this.five.renderer||!this.containerDom)return;const{scale:t,context:e,width:n,height:o}=this,s=this.renderCenter.clone().project(this.five.camera),r=this.five.renderer.getSize(new I.Vector2),a=1,l=n/t,c=o/t,u=a*t,h=(s.x+1)/2*r.x,d=(s.y+1)/2*r.y,f=this.five.getPixels(h-l/2,d-l/2,l,c,u),g=Math.floor(n*a),A=Math.floor(o*a);q0(f,g,A);const p=new ImageData(g,A);p.data.set(f),e.putImageData(p,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}}function J0(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return new I.Vector2().set((i.x-s)/e*2-1,-(i.y-o)/n*2+1)}function Cl(i,t){const{offsetWidth:e,offsetHeight:n}=t;return new I.Vector2().set(i.x/e*2-1,-i.y/n*2+1)}function Z0(i,t){const e=i.getElement();if(!e)return;const n=Cl(t,e),o=new I.Raycaster;return o.setFromCamera(n,i.camera),o}function K0(i,t){const{x:e,y:n}=t,o=e*2-1,s=n*2-1,r=new I.Vector2().fromArray([o,s]),a=new I.Raycaster;return a.setFromCamera(r,i.camera),i.model.intersectRaycaster(a)[0]}const $0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbYAAAGwCAYAAADFUEBtAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABtqADAAQAAAABAAABsAAAAABTZ8U6AAAtiklEQVR4Ae2dAXJbSbJdp+d7AfYSHOGVeAPek5fkNXgLjviLmRkZl+CRbtc8UBKRRalZpyIesiorMx/eIcjb+QCh//Y3hwQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQk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AQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQn8NQn8fyHnyuSABiy2AAAAAElFTkSuQmCC",eA=`
|
|
546
|
+
width var(--sc-dot-size-animation-time) ease;cursor:pointer;-webkit-tap-highlight-color:transparent;height:var(--sc-dot-size);width:var(--sc-dot-size)}.sc-carousel-dot__dot.svelte-1mgyhhn:hover{opacity:0.9}.sc-carousel-dot__dot_active.svelte-1mgyhhn{opacity:0.7;height:var(--sc-active-dot-size);width:var(--sc-active-dot-size)}`)}function vg(i){let t,e,n;return{c(){t=z("button"),b(t,"class","sc-carousel-button sc-carousel-dot__dot svelte-1mgyhhn"),q(t,"sc-carousel-dot__dot_active",i[0])},m(o,s){T(o,t,s),e||(n=we(t,"click",i[1]),e=!0)},p(o,[s]){s&1&&q(t,"sc-carousel-dot__dot_active",o[0])},i:Y,o:Y,d(o){o&&M(t),e=!1,n()}}}function bg(i,t,e){let{active:n=!1}=t;function o(s){wn.call(this,i,s)}return i.$$set=s=>{"active"in s&&e(0,n=s.active)},[n,o]}class yg extends oe{constructor(t){super(),ie(this,t,bg,vg,ne,{active:0},Ag)}}function wg(i){ce(i,"svelte-670fde",".sc-carousel-dots__container.svelte-670fde{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;padding:0 30px}.sc-carousel-dots__dot-container.svelte-670fde{height:calc(var(--sc-dot-size) + 14px);width:calc(var(--sc-dot-size) + 10px);display:flex;align-items:center;justify-content:center}")}function dr(i,t,e){const n=i.slice();return n[5]=t[e],n[7]=e,n}function hr(i,t){let e,n,o,s;function r(){return t[3](t[7])}return n=new yg({props:{active:t[1]===t[7]}}),n.$on("click",r),{key:i,first:null,c(){e=z("div"),K(n.$$.fragment),o=$(),b(e,"class","sc-carousel-dots__dot-container svelte-670fde"),this.first=e},m(a,l){T(a,e,l),J(n,e,null),B(e,o),s=!0},p(a,l){t=a;const c={};l&3&&(c.active=t[1]===t[7]),n.$set(c)},i(a){s||(E(n.$$.fragment,a),s=!0)},o(a){D(n.$$.fragment,a),s=!1},d(a){a&&M(e),Z(n)}}}function Cg(i){let t,e=[],n=new Map,o,s=Array(i[0]);const r=a=>a[7];for(let a=0;a<s.length;a+=1){let l=dr(i,s,a),c=r(l);n.set(c,e[a]=hr(c,l))}return{c(){t=z("div");for(let a=0;a<e.length;a+=1)e[a].c();b(t,"class","sc-carousel-dots__container svelte-670fde")},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&7&&(s=Array(a[0]),se(),e=qe(e,l,r,1,a,s,n,t,Et,hr,null,dr),re())},i(a){if(!o){for(let l=0;l<s.length;l+=1)E(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 Pg(i,t,e){const n=ai();let{pagesCount:o=1}=t,{currentPageIndex:s=0}=t;function r(l){n("pageChange",l)}const a=l=>r(l);return i.$$set=l=>{"pagesCount"in l&&e(0,o=l.pagesCount),"currentPageIndex"in l&&e(1,s=l.currentPageIndex)},[o,s,r,a]}class Eg extends oe{constructor(t){super(),ie(this,t,Pg,Cg,ne,{pagesCount:0,currentPageIndex:1},wg)}}const Yt="prev",wt="next";function Ig(i){ce(i,"svelte-1bftafx",":root{--sc-arrow-size:2px}.sc-carousel-arrow__circle.svelte-1bftafx{width:20px;height:20px;border-radius:50%;background-color:var(--sc-color-rgb-light-50p);display:flex;align-items:center;justify-content:center;transition:opacity 100ms ease;cursor:pointer;-webkit-tap-highlight-color:transparent}.sc-carousel-arrow__circle.svelte-1bftafx:hover{opacity:0.9}.sc-carousel-arrow__arrow.svelte-1bftafx{border:solid var(--sc-color-hex-dark);border-width:0 var(--sc-arrow-size) var(--sc-arrow-size) 0;padding:var(--sc-arrow-size);position:relative}.sc-carousel-arrow__arrow-next.svelte-1bftafx{transform:rotate(-45deg);left:calc(var(--sc-arrow-size) / -2)}.sc-carousel-arrow__arrow-prev.svelte-1bftafx{transform:rotate(135deg);right:calc(var(--sc-arrow-size) / -2)}.sc-carousel-arrow__circle_disabled.svelte-1bftafx,.sc-carousel-arrow__circle_disabled.svelte-1bftafx:hover{opacity:0.5}")}function kg(i){let t,e,n,o;return{c(){t=z("button"),e=z("i"),b(e,"class","sc-carousel-arrow__arrow svelte-1bftafx"),q(e,"sc-carousel-arrow__arrow-next",i[0]===wt),q(e,"sc-carousel-arrow__arrow-prev",i[0]===Yt),b(t,"class","sc-carousel-button sc-carousel-arrow__circle svelte-1bftafx"),q(t,"sc-carousel-arrow__circle_disabled",i[1])},m(s,r){T(s,t,r),B(t,e),n||(o=we(t,"click",i[2]),n=!0)},p(s,[r]){r&1&&q(e,"sc-carousel-arrow__arrow-next",s[0]===wt),r&1&&q(e,"sc-carousel-arrow__arrow-prev",s[0]===Yt),r&2&&q(t,"sc-carousel-arrow__circle_disabled",s[1])},i:Y,o:Y,d(s){s&&M(t),n=!1,o()}}}function xg(i,t,e){let{direction:n=wt}=t,{disabled:o=!1}=t;function s(r){wn.call(this,i,r)}return i.$$set=r=>{"direction"in r&&e(0,n=r.direction),"disabled"in r&&e(1,o=r.disabled)},[n,o,s]}class gl extends oe{constructor(t){super(),ie(this,t,xg,kg,ne,{direction:0,disabled:1},Ig)}}function Dg(i){ce(i,"svelte-i7yfid",".sc-carousel-progress__indicator.svelte-i7yfid{height:100%;background-color:var(--sc-color-hex-dark-50p)}")}function Lg(i){let t;return{c(){t=z("div"),b(t,"class","sc-carousel-progress__indicator svelte-i7yfid"),L(t,"width",i[0]+"%")},m(e,n){T(e,t,n)},p(e,[n]){n&1&&L(t,"width",e[0]+"%")},i:Y,o:Y,d(e){e&&M(t)}}}const fr=100;function Sg(i,t,e){let n,{value:o=0}=t;return i.$$set=s=>{"value"in s&&e(1,o=s.value)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=Math.min(Math.max(o*fr,0),fr))},[n,o]}class Mg extends oe{constructor(t){super(),ie(this,t,Sg,Lg,ne,{value:1},Dg)}}function Tg(i,t){i.addEventListener("mousedown",t),i.addEventListener("touchstart",t,{passive:!0})}function zg(i,t){i.removeEventListener("mousedown",t),i.removeEventListener("touchstart",t)}function Bg(i,t){i.addEventListener("mouseup",t),i.addEventListener("touchend",t)}function mr(i,t){i.removeEventListener("mouseup",t),i.removeEventListener("touchend",t)}function jg(i,t){i.addEventListener("mousemove",t),i.addEventListener("touchmove",t)}function pr(i,t){i.removeEventListener("mousemove",t),i.removeEventListener("touchmove",t)}function vo(i){return function(t,e){i.dispatchEvent(new CustomEvent(t,{detail:e}))}}const Vg=110,Qg=9,Rg=111,Og=20;function zi(i){if("TouchEvent"in window&&i instanceof TouchEvent){const t=i.touches[0];return{x:t?t.clientX:0,y:t?t.clientY:0}}return{x:i.clientX,y:i.clientY}}function Fg(i,{thresholdProvider:t}){const e=vo(i);let n,o,s=0,r,a=!1;function l(){return Date.now()-r>=Rg&&Math.abs(s)>=Og}function c(d){r=Date.now(),s=0,a=!0;const f=zi(d);n=f.x,o=f.y,e("swipeStart",{x:n,y:o}),jg(window,u),Bg(window,h)}function u(d){if(!a)return;const f=zi(d),g=f.x-n,A=f.y-o;n=f.x,o=f.y,e("swipeMove",{x:n,y:o,dx:g,dy:A}),g!==0&&Math.sign(g)!==Math.sign(s)&&(s=0),s+=g,Math.abs(s)>t()&&(e("swipeThresholdReached",{direction:s>0?Yt:wt}),mr(window,h),pr(window,u))}function h(d){if(mr(window,h),pr(window,u),a=!1,!l()){e("swipeFailed");return}const f=zi(d);e("swipeEnd",{x:f.x,y:f.y})}return Tg(i,c),{destroy(){zg(i,c)}}}function Hg(i,t){i.addEventListener("mouseenter",t)}function Gg(i,t){i.removeEventListener("mouseenter",t)}function Wg(i,t){i.addEventListener("mouseleave",t)}function gr(i,t){i.removeEventListener("mouseleave",t)}function Ng(i){const t=vo(i);function e(){Wg(i,n),t("hovered",{value:!0})}function n(){t("hovered",{value:!1}),gr(i,n)}return Hg(i,e),{destroy(){Gg(i,e),gr(i,n)}}}const _g=(i,t)=>{const e=t.x-i.x,n=t.y-i.y;return Math.sqrt(e*e+n*n)};function Gt(i,t,e){return Math.max(i,Math.min(t,e))}function Xg(i,t){i.addEventListener("touchstart",t,{passive:!0})}function Yg(i,t){i.removeEventListener("touchstart",t)}function Ug(i,t){i.addEventListener("touchend",t)}function Ar(i,t){i.removeEventListener("touchend",t)}function qg(i){const t=vo(i);let e=0,n={x:0,y:0};function o({tapEndedAt:a,tapEndedPos:l}){const c=a-e,u=_g(n,l);return c<=Vg&&u<=Qg}function s(a){e=Date.now();const l=a.touches[0];n={x:l.clientX,y:l.clientY},Ug(i,r)}function r(a){Ar(i,r);const l=a.changedTouches[0];o({tapEndedAt:Date.now(),tapEndedPos:{x:l.clientX,y:l.clientY}})&&t("tapped")}return Xg(i,s),{destroy(){Yg(i,s),Ar(i,r)}}}function Jg({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,particlesToScroll:o}){return i===t-e?0:i===0?Al({particlesCountWithoutClones:t-n,particlesToScroll:o})-1:Math.floor((i-e)/o)}function Zg({currentParticleIndex:i,particlesToScroll:t}){return Math.ceil(i/t)}function Kg({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,infinite:o,particlesToScroll:s}){return o?Jg({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,particlesToScroll:s}):Zg({currentParticleIndex:i,particlesToScroll:s})}function Al({particlesCountWithoutClones:i,particlesToScroll:t}){return Math.ceil(i/t)}function $g({particlesCountWithoutClones:i,particlesToScroll:t,particlesToShow:e}){const n=vl({particlesCountWithoutClones:i,particlesToScroll:t,particlesToShow:e});return Math.ceil(i/t)-n}function e0({infinite:i,particlesCountWithoutClones:t,particlesToScroll:e,particlesToShow:n}){return i?Al({particlesCountWithoutClones:t,particlesToScroll:e}):$g({particlesCountWithoutClones:t,particlesToScroll:e,particlesToShow:n})}function t0({pageIndex:i,clonesCountHead:t,clonesCountTail:e,particlesToScroll:n,particlesCount:o}){return Gt(0,Math.min(t+i*n,o-e),o-1)}function n0({pageIndex:i,particlesToScroll:t,particlesCount:e,particlesToShow:n}){return Gt(0,Math.min(i*t,e-n),e-1)}function Bi({infinite:i,pageIndex:t,clonesCountHead:e,clonesCountTail:n,particlesToScroll:o,particlesCount:s,particlesToShow:r}){return i?t0({pageIndex:t,clonesCountHead:e,clonesCountTail:n,particlesToScroll:o,particlesCount:s}):n0({pageIndex:t,particlesToScroll:o,particlesCount:s,particlesToShow:r})}function i0({particlesContainerChildren:i,particleWidth:t}){for(let e=0;e<i.length;e++)i[e].style.minWidth=`${t}px`,i[e].style.maxWidth=`${t}px`}function vl({particlesToScroll:i,particlesToShow:t,particlesCountWithoutClones:e}){const n=i-t;let o=t;for(;;){const s=e-o-n;if(s<t)return Math.max(s,0);o+=t+n}}function o0(i){return new ResizeObserver(t=>{i({width:t[0].contentRect.width})})}function s0({clonesCountHead:i,clonesCountTail:t,particlesContainerChildren:e}){const n=[];for(let r=0;r<t;r++)n.push(e[r].cloneNode(!0));const o=[],s=e.length;for(let r=s-1;r>s-1-i;r--)o.push(e[r].cloneNode(!0));return{clonesToAppend:n,clonesToPrepend:o}}function r0({particlesContainer:i,clonesToAppend:t,clonesToPrepend:e}){for(let n=0;n<t.length;n++)i.append(t[n]);for(let n=0;n<e.length;n++)i.prepend(e[n])}function a0({infinite:i,particlesToShow:t,partialPageSize:e}){const n=i?{head:Math.ceil(e||t),tail:Math.ceil(t)}:{head:0,tail:0};return me(R({},n),{total:n.head+n.tail})}const fn=(i,t,e)=>{if(i&&i.hasOwnProperty(t))return i[t];if(e===void 0)throw new Error(`Required arg "${t}" was not provided`);return e},Zi=i=>t=>{i[t]&&i[t]()},l0=(i,t)=>oc.default(i,t),c0=i=>Object.keys(i||{}),u0=(i,t)=>{const e={};return i.forEach(n=>{e[n]=t[n]}),e},d0=()=>{const i={},t=(e,n)=>{const{watcherName:o,fn:s}=e,{prop:r,value:a}=n;i[o]||(i[o]={deps:{},fn:s}),i[o].deps[r]=a};return{subscribers:i,subscribe(e,n){e&&t(e,n)},notify(e,n){Object.entries(i).forEach(([o,{deps:s,fn:r}])=>{const a=c0(s);if(a.includes(n)){const l=u0(a,e);l0(s,l)||(i[o].deps=l,r())}})}}},h0=()=>{let i=null;return{targetWatcher(t,e){i={watcherName:t,fn:e},i.fn(),i=null},getTarget(){return i}}};function f0(i,t){const e=kn.default(i,"data",{}),n=kn.default(i,"watch",{}),o=kn.default(i,"methods",{}),s=kn.default(t,"onChange",()=>{}),{subscribe:r,notify:a,subscribers:l}=d0(),{targetWatcher:c,getTarget:u}=h0();let h;const d={},f=()=>({data:h,methods:d});let g=!1;const A=v=>(...y)=>{g=!0;const w=v(...y);return g=!1,w};Object.entries(o).forEach(([v,y])=>{d[v]=A((...w)=>y(f(),...w)),Object.defineProperty(d[v],"name",{value:v})}),h=new Proxy(ic.default(e),{get(v,y){return u()&&!g&&r(u(),{prop:y,value:v[y]}),Reflect.get(...arguments)},set(v,y,w){return v[y]===w||(Reflect.set(...arguments),u()||(s&&s(y,w),a(h,y))),!0}}),Object.entries(n).forEach(([v,y])=>{c(v,()=>{y(f())})});const p=[h,d];return p._internal={_getSubscribers(){return l}},p}function m0({pageIndex:i,particlesToShow:t,particlesToScroll:e,particlesCount:n}){const o=i===0?0:t-e,s=i*t-i*o,r=s+Math.max(t,e)-1,a=[];for(let l=s;l<=Math.min(n-1,r);l++)a.push(l);return a}function p0({infinite:i,pageIndex:t,pagesCount:e,particlesCount:n,particlesToShow:o,particlesToScroll:s}){const r=Gt(0,t,e-1);let a=r-1,l=r+1;a=i?a<0?e-1:a:Math.max(0,a),l=i?l>e-1?0:l:Math.min(e-1,l);const c=[...new Set([a,r,l,0,e-1])].sort((h,d)=>h-d),u=c.flatMap(h=>m0({pageIndex:h,particlesToShow:o,particlesToScroll:s,particlesCount:n}));return{pageIndexes:c,particleIndexes:[...new Set(u)].sort((h,d)=>h-d)}}const g0=(i,t)=>(i(),setInterval(i,t)),A0=35,vr=1;class v0{constructor({onProgressValueChange:t}){this._onProgressValueChange=t,this._autoplayDuration,this._onProgressValueChange,this._interval,this._paused=!1}setAutoplayDuration(t){this._autoplayDuration=t}start(t){return new Promise(e=>{this.reset();const n=Math.min(A0,Math.max(this._autoplayDuration,1));let o=-n;this._interval=g0(()=>H(this,null,function*(){if(this._paused)return;o+=n;const s=o/this._autoplayDuration;this._onProgressValueChange(s),s>vr&&(this.reset(),yield t(),e())}),n)})}pause(){this._paused=!0}resume(){this._paused=!1}reset(){clearInterval(this._interval),this._onProgressValueChange(vr)}}function b0(i){const t=new v0({onProgressValueChange:r=>{i("progressValue",1-r)}}),e=f0({data:{particlesCountWithoutClones:0,particlesToShow:1,particlesToShowInit:1,particlesToScroll:1,particlesToScrollInit:1,particlesCount:1,currentParticleIndex:1,infinite:!1,autoplayDuration:1e3,clonesCountHead:0,clonesCountTail:0,clonesCountTotal:0,partialPageSize:1,currentPageIndex:1,pagesCount:1,pauseOnFocus:!1,focused:!1,autoplay:!1,autoplayDirection:"next",disabled:!1,durationMsInit:1e3,durationMs:1e3,offset:0,particleWidth:0,loaded:[]},watch:{setLoaded({data:r}){r.loaded=p0({infinite:r.infinite,pageIndex:r.currentPageIndex,pagesCount:r.pagesCount,particlesCount:r.particlesCountWithoutClones,particlesToShow:r.particlesToShow,particlesToScroll:r.particlesToScroll}).particleIndexes},setCurrentPageIndex({data:r}){r.currentPageIndex=Kg({currentParticleIndex:r.currentParticleIndex,particlesCount:r.particlesCount,clonesCountHead:r.clonesCountHead,clonesCountTotal:r.clonesCountTotal,infinite:r.infinite,particlesToScroll:r.particlesToScroll})},setPartialPageSize({data:r}){r.partialPageSize=vl({particlesToScroll:r.particlesToScroll,particlesToShow:r.particlesToShow,particlesCountWithoutClones:r.particlesCountWithoutClones})},setClonesCount({data:r}){const{head:a,tail:l}=a0({infinite:r.infinite,particlesToShow:r.particlesToShow,partialPageSize:r.partialPageSize});r.clonesCountHead=a,r.clonesCountTail=l,r.clonesCountTotal=a+l},setProgressManagerAutoplayDuration({data:r}){t.setAutoplayDuration(r.autoplayDuration)},toggleProgressManager({data:{pauseOnFocus:r,focused:a}}){r&&(a?t.pause():t.resume())},initDuration({data:r}){r.durationMs=r.durationMsInit},applyAutoplay({data:r,methods:{_applyAutoplayIfNeeded:a}}){r.autoplay&&a(r.autoplay)},setPagesCount({data:r}){r.pagesCount=e0({infinite:r.infinite,particlesCountWithoutClones:r.particlesCountWithoutClones,particlesToScroll:r.particlesToScroll,particlesToShow:r.particlesToShow})},setParticlesToShow({data:r}){r.particlesToShow=Gt(1,r.particlesToShowInit,r.particlesCountWithoutClones)},setParticlesToScroll({data:r}){r.particlesToScroll=Gt(1,r.particlesToScrollInit,r.particlesCountWithoutClones)}},methods:{_prev({data:r}){r.currentParticleIndex=Bi({infinite:r.infinite,pageIndex:r.currentPageIndex-1,clonesCountHead:r.clonesCountHead,clonesCountTail:r.clonesCountTail,particlesToScroll:r.particlesToScroll,particlesCount:r.particlesCount,particlesToShow:r.particlesToShow})},_next({data:r}){r.currentParticleIndex=Bi({infinite:r.infinite,pageIndex:r.currentPageIndex+1,clonesCountHead:r.clonesCountHead,clonesCountTail:r.clonesCountTail,particlesToScroll:r.particlesToScroll,particlesCount:r.particlesCount,particlesToShow:r.particlesToShow})},_moveToParticle({data:r},a){r.currentParticleIndex=Gt(0,a,r.particlesCount-1)},toggleFocused({data:r}){r.focused=!r.focused},_applyAutoplayIfNeeded(l){return H(this,arguments,function*({data:r,methods:a}){if(!r.infinite&&(r.autoplayDirection===wt&&r.currentParticleIndex===r.particlesCount-1||r.autoplayDirection===Yt&&r.currentParticleIndex===0)){t.reset();return}if(r.autoplay){const c=()=>Zi({[wt]:()=>H(this,null,function*(){return a.showNextPage()}),[Yt]:()=>H(this,null,function*(){return a.showPrevPage()})})(r.autoplayDirection);yield t.start(c)}})},_jumpIfNeeded(l){return H(this,arguments,function*({data:r,methods:a}){let c=!1;return r.infinite&&(r.currentParticleIndex===0?(yield a.showParticle(r.particlesCount-r.clonesCountTotal,{animated:!1}),c=!0):r.currentParticleIndex===r.particlesCount-r.clonesCountTail&&(yield a.showParticle(r.clonesCountHead,{animated:!1}),c=!0)),c})},changePage(u,h,d){return H(this,arguments,function*({data:r,methods:a},l,c){if(t.reset(),r.disabled)return;r.disabled=!0,l(),yield a.offsetPage({animated:fn(c,"animated",!0)}),r.disabled=!1,!(yield a._jumpIfNeeded())&&a._applyAutoplayIfNeeded()})},showNextPage(c,u){return H(this,arguments,function*({data:r,methods:a},l){r.disabled||(yield a.changePage(a._next,l))})},showPrevPage(c,u){return H(this,arguments,function*({data:r,methods:a},l){r.disabled||(yield a.changePage(a._prev,l))})},showParticle(c,u,h){return H(this,arguments,function*({methods:r},a,l){yield r.changePage(()=>r._moveToParticle(a),l)})},_getParticleIndexByPageIndex({data:r},a){return Bi({infinite:r.infinite,pageIndex:a,clonesCountHead:r.clonesCountHead,clonesCountTail:r.clonesCountTail,particlesToScroll:r.particlesToScroll,particlesCount:r.particlesCount,particlesToShow:r.particlesToShow})},showPage(c,u,h){return H(this,arguments,function*({methods:r},a,l){const d=r._getParticleIndexByPageIndex(a);yield r.showParticle(d,l)})},offsetPage({data:r},a){const l=fn(a,"animated",!0);return new Promise(c=>{r.durationMs=l?r.durationMsInit:0,r.offset=-r.currentParticleIndex*r.particleWidth,setTimeout(()=>{c()},r.durationMs)})}}},{onChange:i}),[n,o]=e;return[{data:n,progressManager:t},o,e._internal]}function y0(i){ce(i,"svelte-sme1z4",":root{--sc-color-rgb-light-50p:rgba(93, 93, 93, 0.5);--sc-color-rgb-light:#5d5d5d;--sc-color-hex-dark-50p:rgba(30, 30, 30, 0.5);--sc-color-hex-dark:#1e1e1e}.sc-carousel__carousel-container.svelte-sme1z4{display:flex;width:100%;flex-direction:column;align-items:center}.sc-carousel__content-container.svelte-sme1z4{position:relative;display:flex;width:100%}.sc-carousel__pages-window.svelte-sme1z4{flex:1;display:flex;overflow:hidden;box-sizing:border-box;position:relative}.sc-carousel__pages-container.svelte-sme1z4{width:100%;display:flex;transition-property:transform}.sc-carousel__arrow-container.svelte-sme1z4{padding:5px;box-sizing:border-box;display:flex;align-items:center;justify-content:center}.sc-carousel-progress__container.svelte-sme1z4{width:100%;height:5px;background-color:var(--sc-color-rgb-light-50p);position:absolute;bottom:0}.sc-carousel-button{all:unset;cursor:pointer}.sc-carousel-button:focus{outline:5px auto}")}const w0=i=>({currentPageIndex:i[0]&32,pagesCount:i[0]&1024,loaded:i[0]&64}),br=i=>({currentPageIndex:i[5],pagesCount:i[10],showPage:i[15],loaded:i[6]}),C0=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),yr=i=>({showNextPage:i[14].showNextPage,loaded:i[6],currentPageIndex:i[5]}),P0=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),wr=i=>({loaded:i[6],currentPageIndex:i[5]}),E0=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Cr=i=>({showPrevPage:i[14].showPrevPage,loaded:i[6],currentPageIndex:i[5]});function Pr(i){let t;const e=i[37].prev,n=Kt(e,i,i[36],Cr),o=n||I0(i);return{c(){o&&o.c()},m(s,r){o&&o.m(s,r),t=!0},p(s,r){n?n.p&&(!t||r[0]&96|r[1]&32)&&en(n,e,s,s[36],t?$t(e,s[36],r,E0):tn(s[36]),Cr):o&&o.p&&(!t||r[0]&36)&&o.p(s,t?r:[-1,-1])},i(s){t||(E(o,s),t=!0)},o(s){D(o,s),t=!1},d(s){o&&o.d(s)}}}function I0(i){let t,e,n;return e=new gl({props:{direction:"prev",disabled:!i[2]&&i[5]===0}}),e.$on("click",i[23]),{c(){t=z("div"),K(e.$$.fragment),b(t,"class","sc-carousel__arrow-container svelte-sme1z4")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s[0]&36&&(r.disabled=!o[2]&&o[5]===0),e.$set(r)},i(o){n||(E(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function Er(i){let t,e,n;return e=new Mg({props:{value:i[7]}}),{c(){t=z("div"),K(e.$$.fragment),b(t,"class","sc-carousel-progress__container svelte-sme1z4")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s[0]&128&&(r.value=o[7]),e.$set(r)},i(o){n||(E(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function Ir(i){let t;const e=i[37].next,n=Kt(e,i,i[36],yr),o=n||k0(i);return{c(){o&&o.c()},m(s,r){o&&o.m(s,r),t=!0},p(s,r){n?n.p&&(!t||r[0]&96|r[1]&32)&&en(n,e,s,s[36],t?$t(e,s[36],r,C0):tn(s[36]),yr):o&&o.p&&(!t||r[0]&1060)&&o.p(s,t?r:[-1,-1])},i(s){t||(E(o,s),t=!0)},o(s){D(o,s),t=!1},d(s){o&&o.d(s)}}}function k0(i){let t,e,n;return e=new gl({props:{direction:"next",disabled:!i[2]&&i[5]===i[10]-1}}),e.$on("click",i[14].showNextPage),{c(){t=z("div"),K(e.$$.fragment),b(t,"class","sc-carousel__arrow-container svelte-sme1z4")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s[0]&1060&&(r.disabled=!o[2]&&o[5]===o[10]-1),e.$set(r)},i(o){n||(E(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function kr(i){let t;const e=i[37].dots,n=Kt(e,i,i[36],br),o=n||x0(i);return{c(){o&&o.c()},m(s,r){o&&o.m(s,r),t=!0},p(s,r){n?n.p&&(!t||r[0]&1120|r[1]&32)&&en(n,e,s,s[36],t?$t(e,s[36],r,w0):tn(s[36]),br):o&&o.p&&(!t||r[0]&1056)&&o.p(s,t?r:[-1,-1])},i(s){t||(E(o,s),t=!0)},o(s){D(o,s),t=!1},d(s){o&&o.d(s)}}}function x0(i){let t,e;return t=new Eg({props:{pagesCount:i[10],currentPageIndex:i[5]}}),t.$on("pageChange",i[41]),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o[0]&1024&&(s.pagesCount=n[10]),o[0]&32&&(s.currentPageIndex=n[5]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function D0(i){let t,e,n,o,s,r,a,l,c,u,h,d,f=i[1]&&Pr(i);const g=i[37].default,A=Kt(g,i,i[36],wr);let p=i[3]&&Er(i),v=i[1]&&Ir(i),y=i[4]&&kr(i);return{c(){t=z("div"),e=z("div"),f&&f.c(),n=$(),o=z("div"),s=z("div"),A&&A.c(),a=$(),p&&p.c(),l=$(),v&&v.c(),c=$(),y&&y.c(),b(s,"class","sc-carousel__pages-container svelte-sme1z4"),L(s,"transform","translateX("+i[8]+"px)"),L(s,"transition-duration",i[9]+"ms"),L(s,"transition-timing-function",i[0]),b(o,"class","sc-carousel__pages-window svelte-sme1z4"),b(e,"class","sc-carousel__content-container svelte-sme1z4"),b(t,"class","sc-carousel__carousel-container svelte-sme1z4")},m(w,P){T(w,t,P),B(t,e),f&&f.m(e,null),B(e,n),B(e,o),B(o,s),A&&A.m(s,null),i[39](s),B(o,a),p&&p.m(o,null),i[40](o),B(e,l),v&&v.m(e,null),B(t,c),y&&y.m(t,null),u=!0,h||(d=[Pi(r=Fg.call(null,s,{thresholdProvider:i[38]})),we(s,"swipeStart",i[16]),we(s,"swipeMove",i[18]),we(s,"swipeEnd",i[19]),we(s,"swipeFailed",i[20]),we(s,"swipeThresholdReached",i[17]),Pi(Ng.call(null,o)),we(o,"hovered",i[21]),Pi(qg.call(null,o)),we(o,"tapped",i[22])],h=!0)},p(w,P){w[1]?f?(f.p(w,P),P[0]&2&&E(f,1)):(f=Pr(w),f.c(),E(f,1),f.m(e,n)):f&&(se(),D(f,1,1,()=>{f=null}),re()),A&&A.p&&(!u||P[0]&96|P[1]&32)&&en(A,g,w,w[36],u?$t(g,w[36],P,P0):tn(w[36]),wr),(!u||P[0]&256)&&L(s,"transform","translateX("+w[8]+"px)"),(!u||P[0]&512)&&L(s,"transition-duration",w[9]+"ms"),(!u||P[0]&1)&&L(s,"transition-timing-function",w[0]),r&&Zt(r.update)&&P[0]&2048&&r.update.call(null,{thresholdProvider:w[38]}),w[3]?p?(p.p(w,P),P[0]&8&&E(p,1)):(p=Er(w),p.c(),E(p,1),p.m(o,null)):p&&(se(),D(p,1,1,()=>{p=null}),re()),w[1]?v?(v.p(w,P),P[0]&2&&E(v,1)):(v=Ir(w),v.c(),E(v,1),v.m(e,null)):v&&(se(),D(v,1,1,()=>{v=null}),re()),w[4]?y?(y.p(w,P),P[0]&16&&E(y,1)):(y=kr(w),y.c(),E(y,1),y.m(t,null)):y&&(se(),D(y,1,1,()=>{y=null}),re())},i(w){u||(E(f),E(A,w),E(p),E(v),E(y),u=!0)},o(w){D(f),D(A,w),D(p),D(v),D(y),u=!1},d(w){w&&M(t),f&&f.d(),A&&A.d(w),i[39](null),p&&p.d(),i[40](null),v&&v.d(),y&&y.d(),h=!1,ct(d)}}}function L0(i,t,e){let{$$slots:n={},$$scope:o}=t,s=[],r,a,l=0,c=0,u=1;const[{data:h,progressManager:d},f,g]=b0((te,Ae)=>{Zi({currentPageIndex:()=>e(5,r=Ae),progressValue:()=>e(7,a=Ae),offset:()=>e(8,l=Ae),durationMs:()=>e(9,c=Ae),pagesCount:()=>e(10,u=Ae),loaded:()=>e(6,s=Ae)})(te)}),A=ai();let{timingFunction:p="ease-in-out"}=t,{arrows:v=!0}=t,{infinite:y=!0}=t,{initialPageIndex:w=0}=t,{duration:P=500}=t,{autoplay:k=!1}=t,{autoplayDuration:C=3e3}=t,{autoplayDirection:S=wt}=t,{pauseOnFocus:x=!1}=t,{autoplayProgressVisible:Q=!1}=t,{dots:_=!0}=t,{swiping:O=!0}=t,{particlesToShow:U=1}=t,{particlesToScroll:j=1}=t;function F(te,Ae){return H(this,null,function*(){const Ve=fn(Ae,"animated",!0);if(typeof te!="number")throw new Error("pageIndex should be a number");yield f.showPage(te,{animated:Ve})})}function W(te){return H(this,null,function*(){const Ae=fn(te,"animated",!0);yield f.showPrevPage({animated:Ae})})}function X(te){return H(this,null,function*(){const Ae=fn(te,"animated",!0);yield f.showNextPage({animated:Ae})})}let G=0,ee,N;const ae=o0(({width:te})=>{e(11,G=te),h.particleWidth=G/h.particlesToShow,i0({particlesContainerChildren:N.children,particleWidth:h.particleWidth}),f.offsetPage({animated:!1})});function he(){const{clonesToAppend:te,clonesToPrepend:Ae}=s0({clonesCountHead:h.clonesCountHead,clonesCountTail:h.clonesCountTail,particlesContainerChildren:N.children});r0({particlesContainer:N,clonesToAppend:te,clonesToPrepend:Ae})}Ue(()=>{H(this,null,function*(){yield zo(),N&&ee&&(h.particlesCountWithoutClones=N.children.length,yield zo(),h.infinite&&he(),h.particlesCount=N.children.length,f.showPage(w,{animated:!1}),ae.observe(ee))})}),Pt(()=>{ae.disconnect(),d.reset()});function ue(te){return H(this,null,function*(){yield f.showPage(te,{animated:!0})})}function pe(){!O||(h.durationMs=0)}function Pe(te){return H(this,null,function*(){!O||(yield Zi({[wt]:f.showNextPage,[Yt]:f.showPrevPage})(te.detail.direction))})}function Le(te){!O||(h.offset+=te.detail.dx)}function ze(){!O||f.showParticle(h.currentParticleIndex)}function le(){return H(this,null,function*(){!O||(yield f.offsetPage({animated:!0}))})}function ge(te){h.focused=te.detail.value}function Ee(){f.toggleFocused()}function de(){f.showPrevPage()}const Xe=()=>G/3;function it(te){Qe[te?"unshift":"push"](()=>{N=te,e(13,N)})}function ve(te){Qe[te?"unshift":"push"](()=>{ee=te,e(12,ee)})}const Je=te=>ue(te.detail);return i.$$set=te=>{"timingFunction"in te&&e(0,p=te.timingFunction),"arrows"in te&&e(1,v=te.arrows),"infinite"in te&&e(2,y=te.infinite),"initialPageIndex"in te&&e(24,w=te.initialPageIndex),"duration"in te&&e(25,P=te.duration),"autoplay"in te&&e(26,k=te.autoplay),"autoplayDuration"in te&&e(27,C=te.autoplayDuration),"autoplayDirection"in te&&e(28,S=te.autoplayDirection),"pauseOnFocus"in te&&e(29,x=te.pauseOnFocus),"autoplayProgressVisible"in te&&e(3,Q=te.autoplayProgressVisible),"dots"in te&&e(4,_=te.dots),"swiping"in te&&e(30,O=te.swiping),"particlesToShow"in te&&e(31,U=te.particlesToShow),"particlesToScroll"in te&&e(32,j=te.particlesToScroll),"$$scope"in te&&e(36,o=te.$$scope)},i.$$.update=()=>{i.$$.dirty[0]&32&&A("pageChange",r),i.$$.dirty[0]&4&&(h.infinite=y),i.$$.dirty[0]&33554432&&(h.durationMsInit=P),i.$$.dirty[0]&67108864&&(h.autoplay=k),i.$$.dirty[0]&134217728&&(h.autoplayDuration=C),i.$$.dirty[0]&268435456&&(h.autoplayDirection=S),i.$$.dirty[0]&536870912&&(h.pauseOnFocus=x),i.$$.dirty[1]&1&&(h.particlesToShowInit=U),i.$$.dirty[1]&2&&(h.particlesToScrollInit=j)},[p,v,y,Q,_,r,s,a,l,c,u,G,ee,N,f,ue,pe,Pe,Le,ze,le,ge,Ee,de,w,P,k,C,S,x,O,U,j,F,W,X,o,n,Xe,it,ve,Je]}class S0 extends oe{constructor(t){super(),ie(this,t,L0,D0,ne,{timingFunction:0,arrows:1,infinite:2,initialPageIndex:24,duration:25,autoplay:26,autoplayDuration:27,autoplayDirection:28,pauseOnFocus:29,autoplayProgressVisible:3,dots:4,swiping:30,particlesToShow:31,particlesToScroll:32,goTo:33,goToPrev:34,goToNext:35},y0,[-1,-1])}get goTo(){return this.$$.ctx[33]}get goToPrev(){return this.$$.ctx[34]}get goToNext(){return this.$$.ctx[35]}}function M0(i){ce(i,"svelte-159ski6",".media-item.svelte-159ski6.svelte-159ski6{position:relative;height:100%}.media-content.svelte-159ski6.svelte-159ski6{position:relative;pointer-events:auto;width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;-o-object-fit:inherit;object-fit:inherit}.media-content.showPlayButton.svelte-159ski6.svelte-159ski6{pointer-events:none}.video-icon.svelte-159ski6.svelte-159ski6{width:12.5rem;height:6.25rem;max-width:60%;max-height:60%;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.video-play-button-container.svelte-159ski6.svelte-159ski6{display:none;position:absolute;width:100%;height:100%;top:0;left:0;transform:translate3d(0, 0, 0)}.video-play-button-container.showPlayButton.svelte-159ski6.svelte-159ski6{pointer-events:none;display:block}.video-icon.svelte-159ski6.svelte-159ski6{pointer-events:auto}.video-icon.large.svelte-159ski6.svelte-159ski6{width:12.5rem;height:6.25rem}.video-icon.small.svelte-159ski6.svelte-159ski6{width:1.75rem;height:1.75rem}.video-icon.svelte-159ski6 .video-icon-img.svelte-159ski6{width:100%;height:100%;background-position:center center;background-size:contain;background-repeat:no-repeat}.video-icon.svelte-159ski6 .video-icon-img.canPlay.svelte-159ski6{cursor:pointer}")}function xr(i){let t;function e(s,r){if(s[2].type==="Image")return z0;if(s[2].type==="Video")return T0}let n=e(i),o=n&&n(i);return{c(){t=z("div"),o&&o.c(),b(t,"class","media-item svelte-159ski6"),b(t,"draggable","false")},m(s,r){T(s,t,r),o&&o.m(t,null)},p(s,r){n===(n=e(s))&&o?o.p(s,r):(o&&o.d(1),o=n&&n(s),o&&(o.c(),o.m(t,null)))},d(s){s&&M(t),o&&o.d()}}}function T0(i){let t,e,n,o,s,r;function a(u,h){return u[7]&&u[2].videoCoverUrl?j0:B0}let l=a(i),c=l(i);return{c(){c.c(),t=$(),e=z("div"),n=z("div"),o=z("div"),b(o,"class","video-icon-img svelte-159ski6"),L(o,"background-image","url("+i[18]()+")"),q(o,"canPlay",i[5]),b(n,"class","video-icon svelte-159ski6"),q(n,"large",i[4]==="large"),q(n,"small",i[4]==="small"),b(e,"class","video-play-button-container svelte-159ski6"),q(e,"showPlayButton",i[9])},m(u,h){c.m(u,h),T(u,t,h),T(u,e,h),B(e,n),B(n,o),s||(r=we(o,"click",i[19]),s=!0)},p(u,h){l===(l=a(u))&&c?c.p(u,h):(c.d(1),c=l(u),c&&(c.c(),c.m(t.parentNode,t))),h&8&&L(o,"background-image","url("+u[18]()+")"),h&32&&q(o,"canPlay",u[5]),h&16&&q(n,"large",u[4]==="large"),h&16&&q(n,"small",u[4]==="small"),h&512&&q(e,"showPlayButton",u[9])},d(u){c.d(u),u&&M(t),u&&M(e),s=!1,r()}}}function z0(i){let t,e,n,o;return{c(){t=z("img"),b(t,"class","media-content svelte-159ski6"),b(t,"style",e=`object-fit: ${i[6]};`),_e(t.src,n=i[2].url)||b(t,"src",n),b(t,"alt",o=i[2].name),b(t,"draggable",!1)},m(s,r){T(s,t,r)},p(s,r){r&64&&e!==(e=`object-fit: ${s[6]};`)&&b(t,"style",e),r&4&&!_e(t.src,n=s[2].url)&&b(t,"src",n),r&4&&o!==(o=s[2].name)&&b(t,"alt",o)},d(s){s&&M(t)}}}function B0(i){let t,e,n,o,s,r,a;return{c(){t=z("video"),b(t,"class","media-content svelte-159ski6"),b(t,"style",e=`object-fit: ${i[6]};`),_e(t.src,n=i[2].videoCoverUrl?i[2].url:i[2].url+"#t=0.1")||b(t,"src",n),b(t,"poster",o=i[2].videoCoverUrl),b(t,"preload",s=i[2].videoCoverUrl?"none":"auto"),b(t,"disablepictureinpicture",""),t.playsInline=!0,b(t,"paused",""),t.muted=!0,b(t,"draggable",!1),t.loop=!1,b(t,"crossorigin",""),t.controls=!1,q(t,"showPlayButton",i[9])},m(l,c){T(l,t,c),i[17](t),r||(a=[we(t,"play",i[14]),we(t,"pause",i[15]),we(t,"click",i[16])],r=!0)},p(l,c){c&64&&e!==(e=`object-fit: ${l[6]};`)&&b(t,"style",e),c&4&&!_e(t.src,n=l[2].videoCoverUrl?l[2].url:l[2].url+"#t=0.1")&&b(t,"src",n),c&4&&o!==(o=l[2].videoCoverUrl)&&b(t,"poster",o),c&4&&s!==(s=l[2].videoCoverUrl?"none":"auto")&&b(t,"preload",s),c&512&&q(t,"showPlayButton",l[9])},d(l){l&&M(t),i[17](null),r=!1,ct(a)}}}function j0(i){let t,e,n,o;return{c(){t=z("img"),b(t,"class","media-content svelte-159ski6"),b(t,"style",e=`object-fit: ${i[6]};`),_e(t.src,n=i[2].videoCoverUrl)||b(t,"src",n),b(t,"alt",o=i[2].name),b(t,"draggable",!1)},m(s,r){T(s,t,r)},p(s,r){r&64&&e!==(e=`object-fit: ${s[6]};`)&&b(t,"style",e),r&4&&!_e(t.src,n=s[2].videoCoverUrl)&&b(t,"src",n),r&4&&o!==(o=s[2].name)&&b(t,"alt",o)},d(s){s&&M(t)}}}function V0(i){let t,e=i[2]&&xr(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),T(n,t,o)},p(n,[o]){n[2]?e?e.p(n,o):(e=xr(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:Y,o:Y,d(n){e&&e.d(n),n&&M(t)}}}function Q0(i,t,e){let n,{mediaInstance:o={paused:!0}}=t,{tag:s}=t,{media:r}=t,{playButtonIfNeed:a="withoutText"}=t,{playButtonSizeIfNeed:l="small"}=t,{canPlay:c=!0}=t,{objectFit:u="fill"}=t,{disableVideoIfHavePoster:h=!1}=t,d,f=!0,g=!1;function A(){e(12,g=(r==null?void 0:r.type)==="Video"&&Boolean(r.videoCoverUrl))}const p=St("mediaStore"),v=St("hooks"),y=()=>{g||(d==null||d.play(),d==null||d.pause(),e(12,g=!0))};v.on("loadVideoFirstFrame",y),Ue(()=>{p.subscribe(({currentMediaElement:Q})=>{Q!==d&&(d==null||d.pause())})});const w=Q=>{e(9,f=!1),e(0,o.paused=!1,o),p.set({currentMediaElement:d}),v.emit("playStateChange",{event:Q,state:"playing",tag:s,mediaInstance:d})},P=Q=>{e(9,f=!0),e(0,o.paused=!0,o),v.emit("playStateChange",{event:Q,state:"paused",tag:s,mediaInstance:d})},k=Q=>{d&&d.pause()};function C(Q){Qe[Q?"unshift":"push"](()=>{d=Q,e(8,d)})}const S=()=>a==="withText"?Qp:a==="withoutText"?Rp:a,x=Q=>{!c||d&&(e(8,d.muted=!1,d),d.play())};return i.$$set=Q=>{"mediaInstance"in Q&&e(0,o=Q.mediaInstance),"tag"in Q&&e(1,s=Q.tag),"media"in Q&&e(2,r=Q.media),"playButtonIfNeed"in Q&&e(3,a=Q.playButtonIfNeed),"playButtonSizeIfNeed"in Q&&e(4,l=Q.playButtonSizeIfNeed),"canPlay"in Q&&e(5,c=Q.canPlay),"objectFit"in Q&&e(6,u=Q.objectFit),"disableVideoIfHavePoster"in Q&&e(7,h=Q.disableVideoIfHavePoster)},i.$$.update=()=>{if(i.$$.dirty&4&&e(13,n=r==null?void 0:r.url),i.$$.dirty&8192&&Boolean(n)&&A(),i.$$.dirty&256&&d&&e(9,f=d.paused),i.$$.dirty&4356&&(r==null?void 0:r.type)==="Video"&&!g){const Q=navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1,O=navigator.userAgent.toLowerCase().indexOf("iphone")!==-1&&Q;d&&O&&d.paused&&(document.removeEventListener("WeixinJSBridgeReady",y),document.removeEventListener("touchstart",y),document.removeEventListener("click",y),document.addEventListener("WeixinJSBridgeReady",y),document.addEventListener("touchstart",y),document.addEventListener("click",y))}},[o,s,r,a,l,c,u,h,d,f,p,v,g,n,w,P,k,C,S,x]}class bl extends oe{constructor(t){super(),ie(this,t,Q0,V0,ne,{mediaInstance:0,tag:1,media:2,playButtonIfNeed:3,playButtonSizeIfNeed:4,canPlay:5,objectFit:6,disableVideoIfHavePoster:7},M0)}}function R0(i){ce(i,"svelte-1mrbqlg",".media-list-wrapper.svelte-1mrbqlg.svelte-1mrbqlg{width:100%;height:100%;position:relative;overflow:hidden;border-radius:0.125rem}.media-list-wrapper.svelte-1mrbqlg .media-list.svelte-1mrbqlg{position:relative;pointer-events:auto;height:100%;left:50%;top:50%;transform:translate(-50%, -50%)}.media-list-wrapper.svelte-1mrbqlg .media-list.svelte-1mrbqlg .sc-carousel__carousel-container,.media-list-wrapper.svelte-1mrbqlg .media-list.svelte-1mrbqlg .sc-carousel__content-container{height:100%}")}function Dr(i,t,e){const n=i.slice();return n[21]=t[e],n[22]=t,n[23]=e,n}function Lr(i){let t,e,n,o,s,r,a;const l=[F0,O0],c=[];function u(h,d){return h[12]&&h[10].length>1?0:1}return n=u(i),o=c[n]=l[n](i),{c(){t=z("div"),e=z("div"),o.c(),b(e,"class","media-list svelte-1mrbqlg"),q(e,"carouselEnabled",i[12]),b(t,"class","media-list-wrapper svelte-1mrbqlg"),q(t,"unfolded",i[5])},m(h,d){T(h,t,d),B(t,e),c[n].m(e,null),a=!0},p(h,d){i=h;let f=n;n=u(i),n===f?c[n].p(i,d):(se(),D(c[f],1,1,()=>{c[f]=null}),re(),o=c[n],o?o.p(i,d):(o=c[n]=l[n](i),o.c()),E(o,1),o.m(e,null)),(!a||d&4096)&&q(e,"carouselEnabled",i[12]),(!a||d&32)&&q(t,"unfolded",i[5])},i(h){a||(E(o),h&&xe(()=>{r&&r.end(1),s=Tt(t,Qo,i[6]?{y:4,duration:i[4],delay:i[2],easing:At}:void 0),s.start()}),a=!0)},o(h){D(o),s&&s.invalidate(),h&&(r=nn(t,Qo,i[6]?{y:4,duration:i[4],delay:i[3],easing:At}:void 0)),a=!1},d(h){h&&M(t),c[n].d(),h&&r&&r.end()}}}function O0(i){let t,e;const n=[{media:i[1][0]},i[7],{tag:i[0]}];let o={};for(let s=0;s<n.length;s+=1)o=je(o,n[s]);return t=new bl({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&131?Re(n,[r&2&&{media:s[1][0]},r&128&&Ma(s[7]),r&1&&{tag:s[0]}]):{};t.$set(a)},i(s){e||(E(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function F0(i){let t,e,n={dots:!1,arrows:!1,$$slots:{default:[H0]},$$scope:{ctx:i}};return t=new S0({props:n}),i[17](t),t.$on("pageChange",i[18]),{c(){K(t.$$.fragment)},m(o,s){J(t,o,s),e=!0},p(o,s){const r={};s&16778625&&(r.$$scope={dirty:s,ctx:o}),t.$set(r)},i(o){e||(E(t.$$.fragment,o),e=!0)},o(o){D(t.$$.fragment,o),e=!1},d(o){i[17](null),Z(t,o)}}}function Sr(i){let t,e,n;const o=[i[7],{media:i[21]},{tag:i[0]}];function s(a){i[16](a,i[23])}let r={};for(let a=0;a<o.length;a+=1)r=je(r,o[a]);return i[8][i[23]]!==void 0&&(r.mediaInstance=i[8][i[23]]),t=new bl({props:r}),Qe.push(()=>Yc(t,"mediaInstance",s)),{c(){K(t.$$.fragment)},m(a,l){J(t,a,l),n=!0},p(a,l){i=a;const c=l&1153?Re(o,[l&128&&Ma(i[7]),l&1024&&{media:i[21]},l&1&&{tag:i[0]}]):{};!e&&l&256&&(e=!0,c.mediaInstance=i[8][i[23]],Wc(()=>e=!1)),t.$set(c)},i(a){n||(E(t.$$.fragment,a),n=!0)},o(a){D(t.$$.fragment,a),n=!1},d(a){Z(t,a)}}}function H0(i){let t,e,n=i[10],o=[];for(let r=0;r<n.length;r+=1)o[r]=Sr(Dr(i,n,r));const s=r=>D(o[r],1,1,()=>{o[r]=null});return{c(){for(let r=0;r<o.length;r+=1)o[r].c();t=fe()},m(r,a){for(let l=0;l<o.length;l+=1)o[l].m(r,a);T(r,t,a),e=!0},p(r,a){if(a&1409){n=r[10];let l;for(l=0;l<n.length;l+=1){const c=Dr(r,n,l);o[l]?(o[l].p(c,a),E(o[l],1)):(o[l]=Sr(c),o[l].c(),E(o[l],1),o[l].m(t.parentNode,t))}for(se(),l=n.length;l<o.length;l+=1)s(l);re()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)E(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)D(o[a]);e=!1},d(r){at(o,r),r&&M(t)}}}function G0(i){let t,e,n=i[5]&&Lr(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[5]?n?(n.p(o,s),s&32&&E(n,1)):(n=Lr(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function W0(i,t,e){let n,o,s,r,{tag:a}=t,{mediaData:l}=t,{inDelay:c=0}=t,{outDelay:u=0}=t,{duration:h=0}=t,{unfolded:d=!0}=t,{animation:f=!0}=t,{mediaItemConfig:g}=t,{enableCarousel:A=!0}=t,{autoplayConfig:p={autoplay:!0,autoplayVideo:!1}}=t,v=[],y,w=null;const P=St("mediaStore");Ue(()=>{w=setInterval(()=>{r&&(y==null||y.goToNext())},3e3)}),Pt(()=>{clearInterval(w)});function k(x,Q){i.$$.not_equal(v[Q],x)&&(v[Q]=x,e(8,v))}function C(x){Qe[x?"unshift":"push"](()=>{y=x,e(11,y)})}const S=x=>{n||P.set({currentMediaElement:null})};return i.$$set=x=>{"tag"in x&&e(0,a=x.tag),"mediaData"in x&&e(1,l=x.mediaData),"inDelay"in x&&e(2,c=x.inDelay),"outDelay"in x&&e(3,u=x.outDelay),"duration"in x&&e(4,h=x.duration),"unfolded"in x&&e(5,d=x.unfolded),"animation"in x&&e(6,f=x.animation),"mediaItemConfig"in x&&e(7,g=x.mediaItemConfig),"enableCarousel"in x&&e(14,A=x.enableCarousel),"autoplayConfig"in x&&e(15,p=x.autoplayConfig)},i.$$.update=()=>{i.$$.dirty&256&&e(9,n=v.every(x=>x.paused)),i.$$.dirty&16386&&e(12,o=A&&(l==null?void 0:l.length)>1),i.$$.dirty&2&&e(10,s=l),i.$$.dirty&34304&&(r=s.length>1&&p.autoplay&&n)},[a,l,c,u,h,d,f,g,v,n,s,y,o,P,A,p,k,C,S]}class yl extends oe{constructor(t){super(),ie(this,t,W0,G0,ne,{tag:0,mediaData:1,inDelay:2,outDelay:3,duration:4,unfolded:5,animation:6,mediaItemConfig:7,enableCarousel:14,autoplayConfig:15},R0)}}function N0(i){ce(i,"svelte-1f7m1lj",".line.svelte-1f7m1lj{position:absolute;width:6.5625rem;height:1.3125rem;transform:translateY(-100%)}.text.svelte-1f7m1lj{position:absolute;width:6.25rem;left:1rem;bottom:0.0625rem;font-weight:600}.media-wrapper.svelte-1f7m1lj{position:absolute;left:0.875rem;top:-5.3125rem;width:5.625rem;height:3.75rem;font-weight:600}")}function Mr(i){let t,e,n,o,s,r,a,l;t=new nt({props:{visible:i[3],left:61,bottom:57,width:2,blurRadius:150,spreadRadius:75}}),o=new gg({props:{unfolded:i[3],outDelay:400}});let c=i[2]&&Tr(i),u=i[1]&&zr(i);return{c(){K(t.$$.fragment),e=$(),n=z("div"),K(o.$$.fragment),s=$(),c&&c.c(),r=$(),u&&u.c(),a=fe(),b(n,"class","line svelte-1f7m1lj")},m(h,d){J(t,h,d),T(h,e,d),T(h,n,d),J(o,n,null),T(h,s,d),c&&c.m(h,d),T(h,r,d),u&&u.m(h,d),T(h,a,d),l=!0},p(h,d){const f={};d&8&&(f.visible=h[3]),t.$set(f);const g={};d&8&&(g.unfolded=h[3]),o.$set(g),h[2]?c?(c.p(h,d),d&4&&E(c,1)):(c=Tr(h),c.c(),E(c,1),c.m(r.parentNode,r)):c&&(se(),D(c,1,1,()=>{c=null}),re()),h[1]?u?(u.p(h,d),d&2&&E(u,1)):(u=zr(h),u.c(),E(u,1),u.m(a.parentNode,a)):u&&(se(),D(u,1,1,()=>{u=null}),re())},i(h){l||(E(t.$$.fragment,h),E(o.$$.fragment,h),E(c),E(u),l=!0)},o(h){D(t.$$.fragment,h),D(o.$$.fragment,h),D(c),D(u),l=!1},d(h){Z(t,h),h&&M(e),h&&M(n),Z(o),h&&M(s),c&&c.d(h),h&&M(r),u&&u.d(h),h&&M(a)}}}function Tr(i){let t,e,n;return e=new ml({props:{unfolded:i[3],content:i[2],inDelay:500}}),{c(){t=z("div"),K(e.$$.fragment),b(t,"class","text svelte-1f7m1lj")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s&8&&(r.unfolded=o[3]),s&4&&(r.content=o[2]),e.$set(r)},i(o){n||(E(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function zr(i){let t,e,n;return e=new yl({props:{autoplayConfig:{autoplay:!1},unfolded:i[3],mediaData:i[1],tag:i[0],enableCarousel:!1,mediaItemConfig:{canPlay:!1,playButtonSizeIfNeed:"small",disableVideoIfHavePoster:!0},inDelay:500,duration:500}}),{c(){t=z("div"),K(e.$$.fragment),b(t,"class","media-wrapper svelte-1f7m1lj")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s&8&&(r.unfolded=o[3]),s&2&&(r.mediaData=o[1]),s&1&&(r.tag=o[0]),e.$set(r)},i(o){n||(E(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function _0(i){let t,e,n=i[0].state&&Mr(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&&E(n,1)):(n=Mr(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function X0(i,t,e){let n,o,s,r,{tag:a}=t;return i.$$set=l=>{"tag"in l&&e(0,a=l.tag)},i.$$.update=()=>{var l,c,u;i.$$.dirty&1&&e(3,n=a.state?a.state.unfolded:!1),i.$$.dirty&1&&e(4,o=(c=(l=a.data.title)!=null?l:a.data.text)!=null?c:""),i.$$.dirty&16&&e(2,s=((u=o.length)!=null?u:0)>7?o.substring(0,6)+"...":o),i.$$.dirty&1&&e(1,r=a.data.mediaData)},[a,r,s,n,o]}class Y0 extends oe{constructor(t){super(),ie(this,t,X0,_0,ne,{tag:0},N0)}}class Ki{constructor(t=0,e=0){m(this,"min");m(this,"max");m(this,"isInterval",!0);this.min=t,this.max=e}fromArray(t){return this.min=t[0],this.max=t[1],this}isOverlap(t){return Math.min(this.max,t.max)<Math.max(this.min,t.min)}contains(t){return this.min<t.min&&this.max>t.max}}class U0{constructor(t,e){m(this,"min");m(this,"max");m(this,"xInterval");m(this,"yInterval");m(this,"isRectangle",!0);this.min=t,this.max=e,this.xInterval=new Ki(this.min.x,this.max.x),this.yInterval=new Ki(this.min.y,this.max.y)}isOverlapWithRectangle(t){return!this.xInterval.isOverlap(t.xInterval)&&!this.yInterval.isOverlap(t.yInterval)}containsRect(t){return this.xInterval.contains(t.xInterval)&&this.yInterval.contains(t.yInterval)}}function Hn(i,t,e){const n=i[t],o=i[e];!n||!o||(i[t]=o,i[e]=n)}function q0(i,t,e){const n=e/2;for(let o=1;o<=n;o++){const s=e-(o-1);for(let r=1;r<=t;r++){const a=(o-1)*t+r-1,l=(s-1)*t+r-1;Hn(i,a*4+0,l*4+0),Hn(i,a*4+1,l*4+1),Hn(i,a*4+2,l*4+2),Hn(i,a*4+3,l*4+3)}}}class wl{constructor(t,e){m(this,"width");m(this,"height");m(this,"containerDom");m(this,"hooks",new Ce.Subscribe);m(this,"canvas",document.createElement("canvas"));m(this,"five");m(this,"scale");m(this,"config");m(this,"offset",{x:0,y:0});m(this,"context");m(this,"renderCenter",new I.Vector3);m(this,"hammer");m(this,"state",{enabled:!1});m(this,"onPan",t=>{if(!this.containerDom||this.hooks.emit("wantsPanGesture",t))return;const n=this.offset.x+t.deltaX,o=this.offset.y+t.deltaY;this.canvas.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)",this.canvas.style.transform=`translate3d(${n}px, ${o}px, 100px)`});m(this,"onPanEnd",t=>{this.offset={x:this.offset.x+t.deltaX,y:this.offset.y+t.deltaY},this.canvas.style.boxShadow="none"});var o,s,r;if(!t.renderer)throw new Error("Five Render \u672A\u521D\u59CB\u5316");this.five=t,this.scale=(o=e==null?void 0:e.scale)!=null?o:2,this.width=(s=e==null?void 0:e.width)!=null?s:190,this.height=(r=e==null?void 0:e.height)!=null?r:190,this.config={dragEnabled:(e==null?void 0:e.dragEnabled)||!1,autoFixPCPosition:(e==null?void 0:e.autoFixPCPosition)||!1,initialPosition:(e==null?void 0:e.initialPosition)||{left:"0",top:"0"}};const n=this.canvas.getContext("2d");if(!n)throw new Error("CANNOT CREATE CONTEXT2D");this.context=n,this.config.dragEnabled&&(this.hammer=new yn.default(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panend",this.onPanEnd)),this.initStyle()}dispose(){var t;this.clear(),this.disable(),(t=this.hammer)==null||t.destroy()}enable(){var t;if(!this.state.enabled)return this.state.enabled=!0,(t=this.containerDom)==null||t.append(this.canvas),this}disable(){if(!!this.state.enabled)return this.state.enabled=!1,this.canvas.remove(),this}appendTo(t){var e;return this.containerDom&&((e=this.containerDom)==null||e.removeChild(this.canvas)),this.containerDom=t,this.state.enabled&&t.append(this.canvas),this}clear(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this}renderWithPoint(t){!this.containerDom||!this.state.enabled||(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}autoFixPCPosition(){if(!this.containerDom)return;const{width:t,height:e}=this,n=this.renderCenter.clone().project(this.five.camera),o=(n.x+1)/2*this.containerDom.clientWidth,s=-(n.x-1)/2*this.containerDom.clientWidth,r=-(n.y-1)/2*this.containerDom.clientHeight;o<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=90+"px"):r<183?(this.canvas.style.top=90+"px",this.canvas.style.left=-t/2+"px"):s<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=-t-90+"px"):(this.canvas.style.left=-t/2+"px",this.canvas.style.top=-e-90+"px"),this.canvas.style.transform=`translate3d(${o}px, ${r}px, 10px)`,this.offset={x:o,y:r}}render(){if(!this.five.renderer||!this.containerDom)return;const{scale:t,context:e,width:n,height:o}=this,s=this.renderCenter.clone().project(this.five.camera),r=this.five.renderer.getSize(new I.Vector2),a=1,l=n/t,c=o/t,u=a*t,h=(s.x+1)/2*r.x,d=(s.y+1)/2*r.y,f=this.five.getPixels(h-l/2,d-l/2,l,c,u),g=Math.floor(n*a),A=Math.floor(o*a);q0(f,g,A);const p=new ImageData(g,A);p.data.set(f),e.putImageData(p,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}}function J0(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return new I.Vector2().set((i.x-s)/e*2-1,-(i.y-o)/n*2+1)}function Cl(i,t){const{offsetWidth:e,offsetHeight:n}=t;return new I.Vector2().set(i.x/e*2-1,-i.y/n*2+1)}function Z0(i,t){const e=i.getElement();if(!e)return;const n=Cl(t,e),o=new I.Raycaster;return o.setFromCamera(n,i.camera),o}function K0(i,t){const{x:e,y:n}=t,o=e*2-1,s=n*2-1,r=new I.Vector2().fromArray([o,s]),a=new I.Raycaster;return a.setFromCamera(r,i.camera),i.model.intersectRaycaster(a)[0]}const $0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbYAAAGwCAYAAADFUEBtAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABtqADAAQAAAABAAABsAAAAABTZ8U6AAAtiklEQVR4Ae2dAXJbSbJdp+d7AfYSHOGVeAPek5fkNXgLjviLmRkZl+CRbtc8UBKRRalZpyIesiorMx/eIcjb+QCh//Y3hwQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQg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CQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQn8NQn8fyHnyuSABiy2AAAAAElFTkSuQmCC",eA=`
|
|
547
547
|
varying vec2 vUv;
|
|
548
548
|
void main() {
|
|
549
549
|
vUv = uv;
|
|
@@ -558,8 +558,8 @@ 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 nA(){const i=new I.PlaneGeometry(.4,.4),t=$0,e=new I.TextureLoader().load(t);e.encoding=I.sRGBEncoding;const n=new I.MeshBasicMaterial({map:e,transparent:!0,depthTest:!1});return new I.Mesh(i,n)}function iA(){const i=new I.CurvePath;i.add(new I.LineCurve3(new I.Vector3(0,0,0),new I.Vector3(0,0,.1)));const t=new I.TubeGeometry(i,8,.003),e=new I.ShaderMaterial({vertexShader:eA,fragmentShader:tA,depthTest:!1,transparent:!0});return new I.Mesh(t,e)}function oA(){const i=new I.SphereGeometry(.01,20,20),t=new I.MeshBasicMaterial({color:10349931,depthTest:!1,transparent:!0,side:I.DoubleSide}),e=new I.Mesh(i,t);return e.position.set(0,0,.1),e}class Pl extends I.Object3D{constructor(){super();m(this,"planeMesh");m(this,"lineMesh");m(this,"ballMesh");this.planeMesh=nA(),this.lineMesh=iA(),this.ballMesh=oA(),this.add(this.planeMesh,this.lineMesh,this.ballMesh)}updateWithIntersect(e){if(!e.face)return;const n=new I.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 El{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=Jt(t).create3DDomContainer([[-n,n,0],[-n,-n,0],[n,-n,0],[n,n,0]].map(r=>new I.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(${Za})`,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 I.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(ri.Easing.Quadratic.InOut).onUpdate(({progress:e})=>{}).play()}dispose(){var t;(t=this.disposeCss3DObject)==null||t.call(this)}}class sA{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 I.Group);this.five=t,this.magnifier=(e==null?void 0:e.magnifier)===void 0?new wl(t,{dragEnabled:!0}):null,this.pointHelper=(e==null?void 0:e.pointHelper)===void 0?new Pl:null,this.pointDomHelper=(e==null?void 0:e.pointDomHelper)===void 0?new El(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 rA=Object.freeze(Object.defineProperty({__proto__:null,Interval:Ki,Rectangle:U0,Magnifier:wl,getCoordsFromClient:J0,getCoordsFromElement:Cl,getRaycasterFromFivePointer:Z0,getIntersectFromRelativePosition:K0,PointHelper:Pl,PointDomHelper:El,FivePointSelector:sA,isNil:lp,notNil:yt,BetterTween:mo,tweenProgress:Ha,nextFrame:di,requestAnimationFrameInterval:Pn,getFrameTime:Dh},Symbol.toStringTag,{value:"Module"}));function aA(i){ce(i,"svelte-sezqcq",'@charset "UTF-8";.svelte-sezqcq.svelte-sezqcq{box-sizing:border-box}.marketing.svelte-sezqcq.svelte-sezqcq{transform:translateY(-100%)}.marketing.svelte-sezqcq .line.svelte-sezqcq{position:absolute;height:1.875rem;width:0.0625rem;left:50%;transform:translateX(-50%);background-color:white;bottom:0;transform-origin:bottom;transition:all 500ms}.marketing.svelte-sezqcq .content.svelte-sezqcq{position:relative;min-width:7.5rem;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-property:opacity, transform;transition-duration:500ms}.marketing.svelte-sezqcq .content .headerImage.svelte-sezqcq{position:absolute;width:100%;top:0.25rem;transform:translateY(-100%);border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.title-wrapper.svelte-sezqcq.svelte-sezqcq{position:relative;width:100%;height:1.125rem}.title-wrapper.svelte-sezqcq .title.svelte-sezqcq{border-radius:0.25rem;width:100%;padding-left:0.625rem;padding-right:0.625rem}.title-wrapper.svelte-sezqcq .title .text.svelte-sezqcq{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;font-weight:bold;line-height:1.125rem}.footer.svelte-sezqcq.svelte-sezqcq{position:relative;padding:0.5rem 0.625rem 0 0;width:100%;display:flex;align-items:center}.footer.svelte-sezqcq .goto-button.svelte-sezqcq{display:flex;align-self:flex-end;flex-wrap:wrap;align-items:center;overflow:hidden;height:0.875rem}.footer.svelte-sezqcq .goto-button .gap.svelte-sezqcq{height:100%;width:0.625rem}.footer.svelte-sezqcq .goto-button .text.svelte-sezqcq{display:block;height:100%;font-size:0.625rem}.footer.svelte-sezqcq .arrow-wrapper.svelte-sezqcq{height:0.875rem;display:flex;align-self:flex-end;flex-grow:0;flex-shrink:0;align-items:center;margin-left:0.25rem}.footer.svelte-sezqcq .arrow-wrapper svg.arrow.svelte-sezqcq{width:0.375rem;height:0.625rem}.footer.svelte-sezqcq .price.svelte-sezqcq{flex-shrink:0;margin-right:auto;white-space:nowrap;display:flex;align-items:baseline;margin-left:0.625rem}.footer.svelte-sezqcq .price .value.svelte-sezqcq{position:relative;font-size:0.875rem;line-height:1rem;font-family:TG-TYPE, PingFangSC, Segoe UI, Rototo, sans-serif;letter-spacing:0rem}.footer.svelte-sezqcq .price .unit.svelte-sezqcq{padding-left:0.125rem;font-size:0.625rem}.tags-wrapper.svelte-sezqcq.svelte-sezqcq{position:relative;overflow:hidden;height:1rem;margin-top:0.25rem}.tags-wrapper.svelte-sezqcq .tags.svelte-sezqcq{position:relative;display:inline-flex;max-width:100%;flex-wrap:wrap;padding-left:0.625rem;padding-right:0.375rem}.tags-wrapper.svelte-sezqcq .tags .tag.svelte-sezqcq{display:flex;align-items:center;justify-content:center;flex-shrink:0;flex-grow:0;font-size:0.625rem;height:1rem;margin-right:0.25rem;margin-bottom:0.625rem;padding:0 0.25rem;border-radius:0.125rem;max-width:100%;text-overflow:ellipsis;overflow:hidden}.marketing.light.svelte-sezqcq .content.svelte-sezqcq{background-color:white}.marketing.light.svelte-sezqcq .content .title-wrapper .title .text.svelte-sezqcq{color:rgba(0, 0, 0, 0.8)}.marketing.light.svelte-sezqcq .content .tags-wrapper .tags .primary-tag.svelte-sezqcq{background:rgba(234, 208, 154, 0.5);color:#946700}.marketing.light.svelte-sezqcq .content .tags-wrapper .tags .secondary-tag.svelte-sezqcq{background:rgba(0, 0, 0, 0.06);color:rgba(0, 0, 0, 0.5)}.marketing.light.svelte-sezqcq .content .footer.svelte-sezqcq{color:#946700;fill:#946700}.marketing.dark.svelte-sezqcq .content.svelte-sezqcq{background-color:rgba(0, 0, 0, 0.5)}.marketing.dark.svelte-sezqcq .content .title-wrapper .title .text.svelte-sezqcq{color:white}.marketing.dark.svelte-sezqcq .content .tags-wrapper .tags .primary-tag.svelte-sezqcq{background:rgba(234, 208, 154, 0.5);color:white}.marketing.dark.svelte-sezqcq .content .tags-wrapper .tags .secondary-tag.svelte-sezqcq{background:rgba(255, 255, 255, 0.15);color:rgba(255, 255, 255, 0.85)}.marketing.dark.svelte-sezqcq .content .footer.svelte-sezqcq{color:#ead09a;fill:#ead09a}.marketing.unfolded.svelte-sezqcq .line.svelte-sezqcq{transform:translateX(-50%) scale(1, 1)}.marketing.folded.svelte-sezqcq .line.svelte-sezqcq{transform:translateX(-50%) scale(1, 0);transition-timing-function:ease-in}.marketing.unfolded.svelte-sezqcq .content.svelte-sezqcq{opacity:1}.marketing.folded.svelte-sezqcq .content.svelte-sezqcq{opacity:0;transform:translateY(0.425rem);transition-timing-function:ease-in}')}function Br(i,t,e){const n=i.slice();return n[0]=t[e],n}function jr(i,t,e){const n=i.slice();return n[0]=t[e],n}function Vr(i){let t,e;return{c(){t=z("img"),b(t,"class","headerImage svelte-sezqcq"),_e(t.src,e=i[3].headerPictureUrl)||b(t,"src",e),b(t,"alt","")},m(n,o){T(n,t,o)},p(n,o){o&8&&!_e(t.src,e=n[3].headerPictureUrl)&&b(t,"src",e)},d(n){n&&M(t)}}}function Qr(i){let t,e,n,o,s=i[2]||[],r=[];for(let c=0;c<s.length;c+=1)r[c]=Or(jr(i,s,c));let a=i[5]||[],l=[];for(let c=0;c<a.length;c+=1)l[c]=Rr(Br(i,a,c));return{c(){t=z("div"),e=z("div");for(let c=0;c<r.length;c+=1)r[c].c();n=$();for(let c=0;c<l.length;c+=1)l[c].c();b(e,"class","tags svelte-sezqcq"),xe(()=>i[11].call(e)),b(t,"class","tags-wrapper svelte-sezqcq")},m(c,u){T(c,t,u),B(t,e);for(let h=0;h<r.length;h+=1)r[h].m(e,null);B(e,n);for(let h=0;h<l.length;h+=1)l[h].m(e,null);o=tt(e,i[11].bind(e))},p(c,u){if(u&4){s=c[2]||[];let h;for(h=0;h<s.length;h+=1){const d=jr(c,s,h);r[h]?r[h].p(d,u):(r[h]=Or(d),r[h].c(),r[h].m(e,n))}for(;h<r.length;h+=1)r[h].d(1);r.length=s.length}if(u&32){a=c[5]||[];let h;for(h=0;h<a.length;h+=1){const d=Br(c,a,h);l[h]?l[h].p(d,u):(l[h]=Rr(d),l[h].c(),l[h].m(e,null))}for(;h<l.length;h+=1)l[h].d(1);l.length=a.length}},d(c){c&&M(t),at(r,c),at(l,c),o()}}}function Or(i){let t,e=i[0]+"",n;return{c(){t=z("div"),n=ke(e),b(t,"class","tag primary-tag svelte-sezqcq"),L(t,"min-width",bo)},m(o,s){T(o,t,s),B(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&Me(n,e)},d(o){o&&M(t)}}}function Rr(i){let t,e=i[0]+"",n;return{c(){t=z("div"),n=ke(e),b(t,"class","tag secondary-tag svelte-sezqcq"),L(t,"min-width",bo)},m(o,s){T(o,t,s),B(t,n)},p(o,s){s&32&&e!==(e=o[0]+"")&&Me(n,e)},d(o){o&&M(t)}}}function Fr(i){let t,e,n=i[7]&&Hr(i),o=i[3].highlightText&&Wr(i);return{c(){t=z("div"),n&&n.c(),e=$(),o&&o.c(),b(t,"class","footer svelte-sezqcq")},m(s,r){T(s,t,r),n&&n.m(t,null),B(t,e),o&&o.m(t,null)},p(s,r){s[7]?n?n.p(s,r):(n=Hr(s),n.c(),n.m(t,e)):n&&(n.d(1),n=null),s[3].highlightText?o?o.p(s,r):(o=Wr(s),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(s){s&&M(t),n&&n.d(),o&&o.d()}}}function Hr(i){let t,e,n=i[3].price.value+"",o,s,r=i[3].price.unit&&Gr(i);return{c(){t=z("div"),e=z("span"),o=ke(n),s=$(),r&&r.c(),b(e,"class","value svelte-sezqcq"),b(t,"class","price svelte-sezqcq")},m(a,l){T(a,t,l),B(t,e),B(e,o),B(t,s),r&&r.m(t,null)},p(a,l){l&8&&n!==(n=a[3].price.value+"")&&Me(o,n),a[3].price.unit?r?r.p(a,l):(r=Gr(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&M(t),r&&r.d()}}}function Gr(i){let t,e=i[3].price.unit+"",n;return{c(){t=z("span"),n=ke(e),b(t,"class","unit svelte-sezqcq")},m(o,s){T(o,t,s),B(t,n)},p(o,s){s&8&&e!==(e=o[3].price.unit+"")&&Me(n,e)},d(o){o&&M(t)}}}function Wr(i){let t,e,n,o,s=i[3].highlightText+"",r,a,l;return{c(){t=z("div"),e=z("div"),n=$(),o=z("span"),r=ke(s),a=$(),l=z("div"),l.innerHTML='<svg class="arrow svelte-sezqcq" viewBox="0 0 6 9"><g transform="translate(-3, -2)" fill-rule="nonzero" class="svelte-sezqcq"><path d="M4.43868724,2.12056563 C4.28121824,1.95989074 4.02582143,1.95979988 3.86824251,2.1203627 C3.72498894,2.26632889 3.71189225,2.49481723 3.82900374,2.65587166 L6.57092402,5.92894326 C6.72651763,6.11470411 6.72651763,6.38529589 6.57092402,6.57105674 L3.86804348,9.79798499 C3.72488984,9.94405307 3.71194952,10.1725507 3.8291712,10.3335217 L3.86824251,10.3796373 C4.01149607,10.5256035 4.23559087,10.5387981 4.39346025,10.4192733 L4.43868724,10.3794344 L8.1144599,6.5985342 C8.30312347,6.40447482 8.30312347,6.09552518 8.1144599,5.9014658 L4.43868724,2.12056563 Z" class="svelte-sezqcq"></path></g></svg>',b(e,"class","gap svelte-sezqcq"),b(o,"class","text svelte-sezqcq"),b(t,"class","goto-button goto-icon svelte-sezqcq"),b(l,"class","arrow-wrapper svelte-sezqcq")},m(c,u){T(c,t,u),B(t,e),B(t,n),B(t,o),B(o,r),T(c,a,u),T(c,l,u)},p(c,u){u&8&&s!==(s=c[3].highlightText+"")&&Me(r,s)},d(c){c&&M(t),c&&M(a),c&&M(l)}}}function lA(i){var P,k;let t,e,n,o,s,r,a,l,c,u,h=i[3].title+"",d,f,g,A,p;e=new nt({props:{visible:i[4],outDelay:500,left:61,bottom:87,blurRadius:150,spreadRadius:75}});let v=i[3].headerPictureUrl&&Vr(i),y=((P=i[2].length)!=null?P:0)+((k=i[5].length)!=null?k:0)>0&&Qr(i),w=(i[7]||i[3].highlightText)&&Fr(i);return{c(){t=z("div"),K(e.$$.fragment),n=$(),o=z("div"),s=$(),r=z("div"),v&&v.c(),a=$(),l=z("div"),c=z("div"),u=z("div"),d=ke(h),f=$(),y&&y.c(),g=$(),w&&w.c(),b(o,"class","line svelte-sezqcq"),L(o,"transition-delay",i[4]?Gn+"ms":Wn+_r-Nr-40+"ms"),b(u,"class","text svelte-sezqcq"),b(c,"class","title svelte-sezqcq"),b(l,"class","title-wrapper svelte-sezqcq"),b(r,"class","content svelte-sezqcq"),L(r,"max-width",Ie(i[9])),L(r,"transition-delay",i[4]?Gn+Wn+"ms":"0ms"),b(t,"class",A=Te(`marketing ${i[6]}`)+" svelte-sezqcq"),q(t,"unfolded",i[4]),q(t,"folded",i[8])},m(C,S){T(C,t,S),J(e,t,null),B(t,n),B(t,o),B(t,s),B(t,r),v&&v.m(r,null),B(r,a),B(r,l),B(l,c),B(c,u),B(u,d),B(r,f),y&&y.m(r,null),B(r,g),w&&w.m(r,null),p=!0},p(C,[S]){var Q,_;const x={};S&16&&(x.visible=C[4]),e.$set(x),S&16&&L(o,"transition-delay",C[4]?Gn+"ms":Wn+_r-Nr-40+"ms"),C[3].headerPictureUrl?v?v.p(C,S):(v=Vr(C),v.c(),v.m(r,a)):v&&(v.d(1),v=null),(!p||S&8)&&h!==(h=C[3].title+"")&&Me(d,h),((Q=C[2].length)!=null?Q:0)+((_=C[5].length)!=null?_:0)>0?y?y.p(C,S):(y=Qr(C),y.c(),y.m(r,g)):y&&(y.d(1),y=null),C[7]||C[3].highlightText?w?w.p(C,S):(w=Fr(C),w.c(),w.m(r,null)):w&&(w.d(1),w=null),S&16&&L(r,"transition-delay",C[4]?Gn+Wn+"ms":"0ms"),(!p||S&64&&A!==(A=Te(`marketing ${C[6]}`)+" svelte-sezqcq"))&&b(t,"class",A),(!p||S&80)&&q(t,"unfolded",C[4]),(!p||S&320)&&q(t,"folded",C[8])},i(C){p||(E(e.$$.fragment,C),p=!0)},o(C){D(e.$$.fragment,C),p=!1},d(C){C&&M(t),Z(e),v&&v.d(),y&&y.d(),w&&w.d()}}}const bo=40,Gn=400,Nr=500,Wn=180,_r=500;function cA(i,t,e){let n,o,s,r,a,l,c,u,{tag:h}=t,d,f=(()=>{var p;const A=(p=h.data.limitWidth)!=null?p:!0;if(typeof A=="number")return A;if(A===!0)return 172})();function g(){d=this.offsetHeight,e(1,d)}return i.$$set=A=>{"tag"in A&&e(0,h=A.tag)},i.$$.update=()=>{var A,p,v,y,w,P;i.$$.dirty&1&&e(4,n=(p=(A=h.state)==null?void 0:A.unfolded)!=null?p:!1),i.$$.dirty&16&&e(8,o=!n),i.$$.dirty&1&&e(3,s=h.data),i.$$.dirty&8&&e(7,r=yt((v=s.price)==null?void 0:v.value)&&((y=s.price)==null?void 0:y.value)!==""),i.$$.dirty&1&&e(6,a=h.data.theme||"light"),i.$$.dirty&1026&&d>40&&e(10,l=l-1),i.$$.dirty&1032&&e(2,c=((w=s.brandTags)==null?void 0:w.slice(0,l).filter(Boolean))||[]),i.$$.dirty&1036&&e(5,u=((P=s.tags)==null?void 0:P.slice(0,l-c.length).filter(Boolean))||[])},e(10,l=(f-20)/bo),[h,d,c,s,n,u,a,r,o,f,l,g]}class uA extends oe{constructor(t){super(),ie(this,t,cA,lA,ne,{tag:0},aA)}}const Ut="data:audio/mpeg;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAADAAAGhgBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////////////////////////////////////8AAAA5TEFNRTMuOThyAc0AAAAAAAAAABSAJAiqQgAAgAAABobxtI73AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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IFggOWUacWUeYmuadrZziQKKEgQsQLAhQkUJAgMQDghltLO1onp0cpkNInSFMqlYeSEJ5AHsqFdOwy1DA2sRmRJKxdKRfLhfLw5BzUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7ksRRA8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=",mn={};var si=(i=>(i.Default="default",i.GetAudioDuration="getAudioDuration",i.PlayAudio="playAudio",i))(si||{});function Il(i,t){const e=(t==null?void 0:t.namespace)||"default",n=mn[e]||(mn[e]=[]);let o=n.find(s=>!s.realSrc||s.realSrc===Ut);return o||(console.warn("\u672A\u627E\u5230\u7F13\u5B58\u97F3\u9891\uFF0C\u5DF2\u65B0\u5EFA",mn),o=new yo(Ut),n.push(o)),i&&(o.src=i),o}function dA(i){return H(this,null,function*(){const t=(()=>i instanceof yo?i:Il(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 Xr(i,t){const e=(t==null?void 0:t.namespace)||"default",n=mn[e]||(mn[e]=[]),o=i-n.length;if(!(o<=0))for(let s=0;s<o;s++)n.push(new yo(Ut))}class yo 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=()=>hA(this);document.addEventListener("click",n),document.addEventListener("touchend",n),this.removeDocumentEventListener=()=>{document.removeEventListener("click",n),document.removeEventListener("touchend",n)}}get isBlankAudio(){return this.realSrc===Ut||!this.realSrc}get src(){return super.src}set src(e){super.src=e,this.realSrc=e}clear(){this.src=Ut,this.currentTime=0}}function hA(i){!i||i.inited||(i.src&&(i.inited=!0,i.removeDocumentEventListener()),i.src===Ut&&i.play())}class fA 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 H(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=Il(this.sharedAudioSrc,{namespace:si.PlayAudio})),(n=this.eventListenerDisposer)==null||n.call(this),this.eventListenerDisposer=this.addEventListeners(),this.audioInstance.currentTime=(o=this.currentTime)!=null?o:0,this.audioInstance.play().then(()=>{var s;this.audioInstance.currentTime=(s=this.currentTime)!=null?s:0,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,this.sharedAudioPaused=e.paused,(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.sharedAudioPaused=!0,this.clear()},r=d=>{var f;(f=this.onended)==null||f.call(this,d),this.sharedAudioPaused=!0,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 mA(i){ce(i,"svelte-13e7hxv",".audio.svelte-13e7hxv{pointer-events:auto;cursor:pointer;width:100%;height:100%}")}function pA(i){let t,e,n,o;const s=i[8].default,r=Kt(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",Pa(i[1])),n=!0)},p(a,[l]){r&&r.p&&(!e||l&128)&&en(r,s,a,a[7],e?$t(s,a[7],l,null):tn(a[7]),null),(!e||l&1)&&b(t,"style",a[0])},i(a){e||(E(r,a),e=!0)},o(a){D(r,a),e=!1},d(a){a&&M(t),r&&r.d(a),n=!1,o()}}}function gA(i,t,e){let{$$slots:n={},$$scope:o}=t,{url:s}=t,{enable:r=!0}=t,{style:a=""}=t,{hooksInfo:l}=t;const c=ai(),u=St("hooks"),h=St("mediaStore");let d,f=!0;function g(){e(5,d.onplay=p=>{u.emit("playStateChange",O({event:p,state:"playing",mediaInstance:d},l)),c("play"),e(6,f=!1)},d),e(5,d.onpause=p=>{u.emit("playStateChange",O({event:p,state:"paused",mediaInstance:d},l)),c("pause"),e(6,f=!0)},d),e(5,d.onloadedmetadata=p=>{typeof d.duration=="number"&&!Number.isNaN(d.duration)&&c("duration",d.duration)},d),e(5,d.ontimeupdate=p=>{c("timeupdate",d.currentTime)},d)}h.subscribe(({currentMediaElement:p})=>{p!==d&&(f||d==null||d.pause())});function A(p){!d||(u.emit("click",O({event:p,target:"AudioTagPlayIcon",audioInstance:d},l)),h.set({currentMediaElement:d}),u.emit("playStateChange",O({event:p,state:d.paused?"playing":"paused",mediaInstance:d},l)),d.paused?d.play():d.pause())}return i.$$set=p=>{"url"in p&&e(2,s=p.url),"enable"in p&&e(3,r=p.enable),"style"in p&&e(0,a=p.style),"hooksInfo"in p&&e(4,l=p.hooksInfo),"$$scope"in p&&e(7,o=p.$$scope)},i.$$.update=()=>{i.$$.dirty&4&&(s||c("duration",0)),i.$$.dirty&36&&(d==null||d.dispose(),e(5,d=new fA(s)),c("audioRef",d),setTimeout(()=>c("audioRef",d),200),dA(s).then(p=>c("duration",p)),g()),i.$$.dirty&40&&(r||d==null||d.pause()),i.$$.dirty&72&&c(r&&!f?"play":"pause")},[a,A,s,r,l,d,f,o,n]}class kl extends oe{constructor(t){super(),ie(this,t,gA,pA,ne,{url:2,enable:3,style:0,hooksInfo:4},mA)}}function AA(i){ce(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 Yr(i){let t,e;return t=new nt({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function vA(i){let t,e,n,o,s,r=i[1]&&Yr();return{c(){t=z("div"),r&&r.c(),e=$(),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"),q(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),B(t,e),B(t,n),B(n,o),i[7](o),i[8](t),s=!0},p(a,[l]){a[1]?r?l&2&&E(r,1):(r=Yr(),r.c(),E(r,1),r.m(t,e)):r&&(se(),D(r,1,1,()=>{r=null}),re()),(!s||l&1)&&q(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||(E(r),s=!0)},o(a){D(r),s=!1},d(a){a&&M(t),r&&r.d(),i[7](null),i[8](null)}}}function bA(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){Qe[d?"unshift":"push"](()=>{c=d,e(4,c)})}function h(d){Qe[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 xl extends oe{constructor(t){super(),ie(this,t,bA,vA,ne,{playing:0,shadow:1,style:2,width:6},AA)}}function yA(i){ce(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 Ur(i){var v,y;let t,e,n,o,s,r,a,l,c,u,h,d,f,g,A;e=new nt({props:{visible:i[6],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}});let p=i[6]&&qr(i);return c=new pl({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=(v=i[5])==null?void 0:v.length)!=null?y:10,15),useLinearColor:!0}}),{c(){t=z("div"),K(e.$$.fragment),n=$(),o=z("div"),s=z("div"),r=z("div"),p&&p.c(),a=$(),l=z("div"),K(c.$$.fragment),h=$(),K(d.$$.fragment),b(r,"class","audio-icon svelte-1s6gk4a"),xe(()=>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"),q(t,"unfolded",i[6])},m(w,P){T(w,t,P),J(e,t,null),B(t,n),B(t,o),B(o,s),B(s,r),p&&p.m(r,null),B(s,a),B(s,l),J(c,l,null),u=tt(l,i[11].bind(l)),B(t,h),J(d,t,null),f=!0,g||(A=we(l,"click",i[7]),g=!0)},p(w,P){var x,Q;const k={};P&64&&(k.visible=w[6]),P&8&&(k.left=w[3]/2+"px"),e.$set(k),w[6]?p?(p.p(w,P),P&64&&E(p,1)):(p=qr(w),p.c(),E(p,1),p.m(r,null)):p&&(se(),D(p,1,1,()=>{p=null}),re());const C={};P&64&&(C.visible=w[6]),P&2&&(C.textUnfolded=w[1]),P&32&&(C.content=w[5]),c.$set(C);const S={};P&64&&(S.unfolded=w[6]),P&8&&(S.length=w[3]),P&48&&(S.outDelay=w[4]+20*Math.min((Q=(x=w[5])==null?void 0:x.length)!=null?Q:10,15)),d.$set(S),(!f||P&64)&&q(t,"unfolded",w[6])},i(w){f||(E(e.$$.fragment,w),E(p),E(c.$$.fragment,w),E(d.$$.fragment,w),f=!0)},o(w){D(e.$$.fragment,w),D(p),D(c.$$.fragment,w),D(d.$$.fragment,w),f=!1},d(w){w&&M(t),Z(e),p&&p.d(),Z(c),u(),Z(d),g=!1,A()}}}function qr(i){let t,e,n,o,s,r,a;return e=new nt({props:{center:!0,blurRadius:15,spreadRadius:6}}),o=new kl({props:{enable:i[6],url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[wA]},$$scope:{ctx:i}}}),o.$on("play",i[8]),o.$on("pause",i[9]),o.$on("audioRef",i[10]),{c(){t=z("div"),K(e.$$.fragment),n=$(),K(o.$$.fragment),b(t,"class","audio svelte-1s6gk4a")},m(l,c){T(l,t,c),J(e,t,null),B(t,n),J(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||(E(e.$$.fragment,l),E(o.$$.fragment,l),l&&xe(()=>{r&&r.end(1),s=Tt(t,Mt,{duration:1e3,delay:0,easing:_t}),s.start()}),a=!0)},o(l){var c,u;D(e.$$.fragment,l),D(o.$$.fragment,l),s&&s.invalidate(),l&&(r=nn(t,Mt,{duration:1e3,delay:20*Math.min((u=(c=i[5])==null?void 0:c.length)!=null?u:10,15),easing:_t})),a=!1},d(l){l&&M(t),Z(e),Z(o),l&&r&&r.end()}}}function wA(i){let t,e,n;return e=new xl({props:{playing:i[2]}}),{c(){t=z("div"),K(e.$$.fragment),b(t,"class","audio-icon__wrapper svelte-1s6gk4a")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s&4&&(r.playing=o[2]),e.$set(r)},i(o){n||(E(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function CA(i){let t,e,n=i[0].state&&Ur(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&&E(n,1)):(n=Ur(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function PA(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(A){wn.call(this,i,A)}function g(){c=this.clientWidth,e(3,c)}return i.$$set=A=>{"tag"in A&&e(0,r=A.tag)},i.$$.update=()=>{var A,p,v;i.$$.dirty&1&&e(6,n=!!((A=r.state)!=null&&A.unfolded)),i.$$.dirty&1&&e(5,o=(v=(p=r.data.title)!=null?p:r.data.text)!=null?v:""),i.$$.dirty&2&&e(4,s=a?450:0)},[r,a,l,c,s,o,n,u,h,d,f,g]}class EA extends oe{constructor(t){super(),ie(this,t,PA,CA,ne,{tag:0},yA)}}function IA(i){ce(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 Jr(i){let t,e,n,o;return n=new kl({props:{style:"width: max-content; height: max-content;",enable:i[0].state.visible,url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[xA]},$$scope:{ctx:i}}}),n.$on("play",i[8]),n.$on("pause",i[9]),n.$on("timeupdate",i[10]),n.$on("duration",i[11]),n.$on("audioRef",i[12]),{c(){t=z("div"),e=z("div"),K(n.$$.fragment),b(e,"class","audio-tag svelte-58hfjf"),L(e,"background-color",i[5]),L(e,"color",i[4]),b(t,"class","audio-tag__wrapper svelte-58hfjf")},m(s,r){T(s,t,r),B(t,e),J(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&8264&&(a.$$scope={dirty:r,ctx:s}),n.$set(a),r&32&&L(e,"background-color",s[5]),r&16&&L(e,"color",s[4])},i(s){o||(E(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&M(t),Z(n)}}}function kA(i){let t;return{c(){t=ke(i[6])},m(e,n){T(e,t,n)},p(e,n){n&64&&Me(t,e[6])},d(e){e&&M(t)}}}function xA(i){let t,e,n,o,s,r,a;return n=new xl({props:{playing:i[3]}}),r=new Ao({props:{maxWidth:72,$$slots:{default:[kA]},$$scope:{ctx:i}}}),{c(){t=z("div"),e=z("div"),K(n.$$.fragment),o=$(),s=z("div"),K(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),B(t,e),J(n,e,null),B(t,o),B(t,s),J(r,s,null),a=!0},p(l,c){const u={};c&8&&(u.playing=l[3]),n.$set(u);const h={};c&8256&&(h.$$scope={dirty:c,ctx:l}),r.$set(h)},i(l){a||(E(n.$$.fragment,l),E(r.$$.fragment,l),a=!0)},o(l){D(n.$$.fragment,l),D(r.$$.fragment,l),a=!1},d(l){l&&M(t),Z(n),Z(r)}}}function DA(i){let t,e,n=i[0].state&&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[0].state?n?(n.p(o,s),s&1&&E(n,1)):(n=Jr(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function LA(i,t,e){let n,o,s,r,{tag:a}=t,l=0,c=0,u=!1;const h=()=>{e(3,u=!0)},d=()=>{e(3,u=!1)},f=p=>{e(1,l=p.detail)},g=p=>{e(2,c=p.detail)};function A(p){wn.call(this,i,p)}return i.$$set=p=>{"tag"in p&&e(0,a=p.tag)},i.$$.update=()=>{var p,v,y;i.$$.dirty&1&&e(6,n=(v=(p=a.data.title)!=null?p:a.data.text)!=null?v:""),i.$$.dirty&1&&e(7,o=(y=a.data.theme)!=null?y:"light"),i.$$.dirty&128&&e(5,s=(()=>{if(o==="dark")return"rgba(0, 0, 0, 0.3)";if(o==="light")return"rgba(255, 255, 255, 0.3)"})()),i.$$.dirty&128&&e(4,r=(()=>{if(o==="dark")return"white";if(o==="light")return"rgba(0, 0, 0, 0.6)"})())},[a,l,c,u,r,s,n,o,h,d,f,g,A]}class SA extends oe{constructor(t){super(),ie(this,t,LA,DA,ne,{tag:0},IA)}}function MA(i){let t,e;return t=new SA({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function TA(i){let t,e;return t=new EA({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function zA(i){let t,e,n,o;const s=[TA,MA],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&&(se(),D(r[u],1,1,()=>{r[u]=null}),re()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),E(e,1),e.m(n.parentNode,n)):e=null)},i(l){o||(E(e),o=!0)},o(l){D(e),o=!1},d(l){~t&&r[t].d(l),l&&M(n)}}}function BA(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 jA extends oe{constructor(t){super(),ie(this,t,BA,zA,ne,{tag:0})}}function VA(i){ce(i,"svelte-10cw0el",".media-wrapper.svelte-10cw0el{position:absolute;width:100%;height:100%}")}function Zr(i){var o;let t,e,n;return e=new yl({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"),K(e.$$.fragment),b(t,"class","media-wrapper svelte-10cw0el")},m(s,r){T(s,t,r),J(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||(E(e.$$.fragment,s),n=!0)},o(s){D(e.$$.fragment,s),n=!1},d(s){s&&M(t),Z(e)}}}function QA(i){let t,e,n=i[0].state&&i[5]&&Zr(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&&E(n,1)):(n=Zr(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function OA(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 RA extends oe{constructor(t){super(),ie(this,t,OA,QA,ne,{tag:0},VA)}}function FA(i){return H(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 HA(i){return H(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 FA(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 GA(i){ce(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 Kr(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 $r(i){let t,e,n,o=i[2]&&ea();function s(l,c){return l[3]?NA:WA}let r=s(i),a=r(i);return{c(){t=z("div"),o&&o.c(),e=$(),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),B(t,e),a.m(t,null),n=!0},p(l,c){l[2]?o?c&4&&E(o,1):(o=ea(),o.c(),E(o,1),o.m(t,e)):o&&(se(),D(o,1,1,()=>{o=null}),re()),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||(E(o),n=!0)},o(l){D(o),n=!1},d(l){l&&M(t),o&&o.d(),a.d()}}}function ea(i){let t,e;return t=new nt({props:{center:!0,blurRadius:24,spreadRadius:16}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function WA(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 NA(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:YA,then:XA,catch:_A,value:14};return Bo(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]))&&Bo(e,n)||_c(n,i,s)},d(o){o&&M(t),n.block.d(o),n.token=null,n=null}}}function _A(i){return{c:Y,m:Y,p:Y,d:Y}}function XA(i){Kr(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),B(t,e),B(e,n)},p(r,a){Kr(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 YA(i){return{c:Y,m:Y,p:Y,d:Y}}function UA(i){let t,e,n=i[1]&&$r(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&&E(n,1)):(n=$r(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function qA(i,t,e){let n,{width:o=null}=t,{icon:s=null}=t,{shadow:r=!1}=t;const a=ai();function l(c){return H(this,null,function*(){const u=yield HA(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 Dl extends oe{constructor(t){super(),ie(this,t,qA,UA,ne,{width:0,icon:1,shadow:2},GA)}}function JA(i){ce(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 ta(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"),K(e.$$.fragment),n=$(),o=z("div"),s=ke(i[2]),b(o,"class","text svelte-e58ijk"),b(t,"class","text-wrapper svelte-e58ijk")},m(a,l){T(a,t,l),J(e,t,null),B(t,n),B(t,o),B(o,s),r=!0},p(a,l){(!r||l&4)&&Me(s,a[2])},i(a){r||(E(e.$$.fragment,a),r=!0)},o(a){D(e.$$.fragment,a),r=!1},d(a){a&&M(t),Z(e)}}}function ZA(i){let t,e,n,o;e=new Dl({props:{icon:i[1],shadow:!0}}),e.$on("iconLoaded",i[9]);let s=i[2]&&i[0]&&ta(i);return{c(){t=z("div"),K(e.$$.fragment),n=$(),s&&s.c(),b(t,"class","wrapper svelte-e58ijk")},m(r,a){T(r,t,a),J(e,t,null),B(t,n),s&&s.m(t,null),o=!0},p(r,[a]){const l={};a&2&&(l.icon=r[1]),e.$set(l),r[2]&&r[0]?s?(s.p(r,a),a&5&&E(s,1)):(s=ta(r),s.c(),E(s,1),s.m(t,null)):s&&(se(),D(s,1,1,()=>{s=null}),re())},i(r){o||(E(e.$$.fragment,r),E(s),o=!0)},o(r){D(e.$$.fragment,r),D(s),o=!1},d(r){r&&M(t),Z(e),s&&s.d()}}}function KA(i,t,e){let n,o,s,r,a,l,c,u,{tag:h}=t;Ue(()=>{n===!1&&e(0,n=(s==null?void 0:s.steps)<2)});const d=()=>{e(0,n=!0)};return i.$$set=f=>{"tag"in f&&e(3,h=f.tag)},i.$$.update=()=>{var f,g;i.$$.dirty&8&&e(2,o=(f=h.data.title)!=null?f:h.data.text),i.$$.dirty&8&&e(4,s=(g=h.data.icon)!=null?g:h.style.point),i.$$.dirty&16&&e(8,r=s.url),i.$$.dirty&16&&e(7,a=s.steps),i.$$.dirty&16&&e(6,l=s.fps),i.$$.dirty&16&&e(5,c=s.ratio),i.$$.dirty&480&&e(1,u={url:r,steps:a,fps:l,ratio:c})},e(0,n=!1),[n,u,o,h,s,c,l,a,r,d]}class $A extends oe{constructor(t){super(),ie(this,t,KA,ZA,ne,{tag:3},JA)}}function ev(i){ce(i,"svelte-kzl2aj",".customElement__container.svelte-kzl2aj{position:relative}")}function na(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 tv(i){let t,e=typeof i[0].element=="string"&&na(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=na(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 nv(i,t,e){let{tag:n}=t,o,s;Ue(()=>{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)}}}),Pt(()=>{s==null||s()});function r(a){Qe[a?"unshift":"push"](()=>{o=a,e(1,o)})}return i.$$set=a=>{"tag"in a&&e(0,n=a.tag)},[n,o,r]}class iv extends oe{constructor(t){super(),ie(this,t,nv,tv,ne,{tag:0},ev)}}function ov(i){ce(i,"svelte-1r4fqvg",'@font-face{font-family:"TG-TYPE";font-style:normal;font-weight:400;src:local("TG-TYPE-Bold"), url(data:application/font-woff2;charset=ut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q1vqGkeDvtdi/cS94wjCvwKBCIKDiD3ru8BvPeuA7z4EhUn967vBw4eoDf/DAmLDAv47BT4exWcEwAHAQFBXW97ipCarPcv8+7yAfdl8gP4aPf6FfIjB+r3gwUiBi77gwWHBjH3gwUkBuP7gwUnJPcxKPsxI/cx+y/y9y/3MPP7MO4GDvtdi/cSJQr3JBZkcqOzsKSksrCkcWdlcnFmHw6up6eurm+naGhvb2hop2+uHwv3EiUK9yP4ChUiCgt3SgWxBrnmBZGVj5eZGgsB2/cSAwtobm5paqBzqoYLAAABAAAAAAAAAAAAAA==) format("woff2")}*{-webkit-tap-highlight-color:transparent}.content__container.svelte-1r4fqvg{position:relative;left:50%;top:50%;transform:translate(-50%, -50%);font-family:PingFangSC, Segoe UI, Rototo, sans-serif}.content__container.withAnimation.svelte-1r4fqvg{transition:opacity 0.3s linear}.content__container.unClickable.svelte-1r4fqvg{pointer-events:none !important}.content__container.unClickable.svelte-1r4fqvg *{pointer-events:none !important}.content__wrapper.svelte-1r4fqvg{pointer-events:none;width:100%;height:100%}.content__container.hide.svelte-1r4fqvg{opacity:0;pointer-events:none}.content__container.hide.svelte-1r4fqvg *{pointer-events:none !important}.content__container.disable.svelte-1r4fqvg{display:none}.content.svelte-1r4fqvg{position:relative;width:100%;height:100%;font-size:0.75rem;color:#fff}.content.svelte-1r4fqvg:not(.unfolded){pointer-events:none}.content.svelte-1r4fqvg:not(.unfolded) *{pointer-events:none !important}.content.unfolded.svelte-1r4fqvg{pointer-events:auto}')}function sv(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 rv(i){let t,e,n,o,s,r,a,l,c;const u=[fv,hv,dv,uv,cv,lv,av],h=[];function d(f,g){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"||f[1].contentType==="Sticker"?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-1r4fqvg"),q(n,"unfolded",(f=i[1].state)==null?void 0:f.unfolded),b(e,"class","content__wrapper svelte-1r4fqvg"),b(t,"class","content__container svelte-1r4fqvg"),b(t,"data-id",r=i[1].id),q(t,"disable",i[1].enabled===!1),q(t,"hide",i[4]),q(t,"withAnimation",i[0]),q(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,g){T(f,t,g),B(t,e),B(e,n),~o&&h[o].m(n,null),a=!0,l||(c=we(t,"click",Pa(i[13])),l=!0)},p(f,g){var p;let A=o;o=d(f),o===A?~o&&h[o].p(f,g):(s&&(se(),D(h[A],1,1,()=>{h[A]=null}),re()),~o?(s=h[o],s?s.p(f,g):(s=h[o]=u[o](f),s.c()),E(s,1),s.m(n,null)):s=null),(!a||g&2)&&q(n,"unfolded",(p=f[1].state)==null?void 0:p.unfolded),(!a||g&2&&r!==(r=f[1].id))&&b(t,"data-id",r),(!a||g&2)&&q(t,"disable",f[1].enabled===!1),(!a||g&16)&&q(t,"hide",f[4]),(!a||g&1)&&q(t,"withAnimation",f[0]),(!a||g&2)&&q(t,"unClickable",f[1].clickable===!1),g&2&&L(t,"width",f[1].stickType==="Plane"||f[1].contentType==="MediaModel"?"100%":0),g&2&&L(t,"height",f[1].stickType==="Plane"||f[1].contentType==="MediaModel"?"100%":0)},i(f){a||(E(s),a=!0)},o(f){D(s),a=!1},d(f){f&&M(t),~o&&h[o].d(),l=!1,c()}}}function av(i){let t,e;return t=new RA({props:{tag:Re(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Re(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function lv(i){let t,e;return t=new $A({props:{tag:Re(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Re(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function cv(i){let t,e;return t=new uA({props:{tag:Re(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Re(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function uv(i){let t,e;return t=new jA({props:{tag:Re(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Re(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function dv(i){let t,e;return t=new Y0({props:{tag:Re(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Re(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function hv(i){let t,e;return t=new hg({props:{tag:Re(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Re(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function fv(i){let t,e;return t=new iv({props:{tag:Re(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Re(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function mv(i){let t,e,n,o;const s=[rv,sv],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):(se(),D(r[u],1,1,()=>{r[u]=null}),re(),e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),E(e,1),e.m(n.parentNode,n))},i(l){o||(E(e),o=!0)},o(l){D(e),o=!1},d(l){r[t].d(l),l&&M(n)}}}function pv(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:g}=t;Hi("hooks",h),Hi("mediaStore",f);let A,p;function v(P){P?h.emit("exposure",{id:r,type:"start"}):h.emit("exposure",{id:r,type:"end"})}function y(P,k,C){var S,x;return!(!k.visible||!k.enabled||!C.visible||!((S=P.state)!=null&&S.visible)||((x=P.temporaryState)==null?void 0:x.visible)===!1||He(P)&&!P.mediaVisible)}const w=P=>h.emit("click",{event:P,target:"TagContent",tag:u});return i.$$set=P=>{"withAnimation"in P&&e(0,c=P.withAnimation),"tag"in P&&e(1,u=P.tag),"hooks"in P&&e(2,h=P.hooks),"state"in P&&e(5,d=P.state),"mediaStore"in P&&e(6,f=P.mediaStore),"temporaryState"in P&&e(7,g=P.temporaryState)},i.$$.update=()=>{var P,k,C,S,x,Q,_,R,U,j,F;i.$$.dirty&2&&e(11,n=(P=u.state)==null?void 0:P.unfolded),i.$$.dirty&2&&e(10,o=(k=u.state)==null?void 0:k.visible),i.$$.dirty&162&&e(12,s=d.visible&&g.visible&&((C=u.state)==null?void 0:C.visible)),i.$$.dirty&2&&(r=u.id),i.$$.dirty&162&&e(4,a=!y(u,d,g)),i.$$.dirty&4096&&v(s),i.$$.dirty&3842&&u.hooks&&(n!==void 0&&n!==p&&(e(9,p=n),n?(x=(S=u.hooks).emit)==null||x.call(S,"unfolded"):(_=u==null?void 0:(Q=u.hooks).emit)==null||_.call(Q,"folded")),o!==void 0&&o!==A&&(e(8,A=o),o?(U=(R=u.hooks).emit)==null||U.call(R,"show"):(F=(j=u.hooks).emit)==null||F.call(j,"hide"))),i.$$.dirty&2&&e(3,l=(()=>!(typeof u.mergedConfig.unfoldedConfig=="object"&&u.mergedConfig.unfoldedConfig.keep==="folded"))())},[c,u,h,l,a,d,f,g,A,p,o,n,s,w]}class Ll extends oe{constructor(t){super(),ie(this,t,pv,mv,ne,{withAnimation:0,tag:1,hooks:2,state:5,mediaStore:6,temporaryState:7},ov)}}function gv(i){ce(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 Av(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 Dl({props:{icon:i[2],width:i[1]}}),{c(){t=z("div"),e=$(),n=z("div"),K(o.$$.fragment),s=$(),r=z("div"),a=$(),l=z("div"),K(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"),q(n,"unfolded",i[0]),q(n,"folded",i[3]),L(n,"width",Ie(i[1])),L(n,"height",Ie(i[1]))},m(f,g){T(f,t,g),T(f,e,g),T(f,n,g),J(o,n,null),B(n,s),B(n,r),B(n,a),B(n,l),J(c,l,null),u=!0,h||(d=we(t,"click",i[4]),h=!0)},p(f,[g]){g&8&&L(r,"transition-delay",(f[3]?f[5]:0)+"ms");const A={};g&4&&(A.icon=f[2]),g&2&&(A.width=f[1]),c.$set(A),g&8&&L(l,"transition-delay",(f[3]?f[5]:0)+"ms"),(!u||g&1)&&q(n,"unfolded",f[0]),(!u||g&8)&&q(n,"folded",f[3]),g&2&&L(n,"width",Ie(f[1])),g&2&&L(n,"height",Ie(f[1]))},i(f){u||(E(o.$$.fragment,f),E(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),Z(o),Z(c),h=!1,d()}}}function vv(i,t,e){let n,o,s,r;const a=St("hooks");let{tag:l}=t,c,u=!1;const h=()=>{c!==void 0&&clearTimeout(c),u=!0,c=setTimeout(()=>{u=!1},800)},d=g=>{u||a.emit("click",{event:g,target:"TagPoint",tag:l})},f=(()=>l.contentType==="Text"&&l.data.appearance==="plane"?500:800)();return i.$$set=g=>{"tag"in g&&e(6,l=g.tag)},i.$$.update=()=>{var g,A,p,v;i.$$.dirty&64&&e(0,n=(g=l.state)==null?void 0:g.unfolded),i.$$.dirty&1&&e(3,o=!n),i.$$.dirty&64&&e(2,s=(p=(A=l.style)==null?void 0:A.point)!=null&&p.url?(v=l.style)==null?void 0:v.point:{url:Rp}),i.$$.dirty&64&&e(1,r=(()=>{var w,P,k;const y=(k=(P=(w=l.style)==null?void 0:w.point)==null?void 0:P.size)!=null?k:"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 bv extends oe{constructor(t){super(),ie(this,t,vv,Av,ne,{tag:6},gv)}}function yv(i){ce(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 wv(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 Cv(i){let t,e;return t=new Ll({props:{mediaStore:i[2],withAnimation:i[0],tag:Re(i[1]),hooks:i[14],state:i[3],temporaryState:i[4]}}),{c(){K(t.$$.fragment)},m(n,o){J(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=Re(n[1])),o&8&&(s.state=n[3]),o&16&&(s.temporaryState=n[4]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Pv(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 Ev(i){let t,e;return t=new bv({props:{tag:i[1]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=n[1]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Iv(i){let t,e,n,o,s,r,a,l,c;const u=[Cv,wv],h=[];function d(p,v){return p[12]?0:1}n=d(i),o=h[n]=u[n](i);const f=[Ev,Pv],g=[];function A(p,v){return p[13]?0:1}return r=A(i),a=g[r]=f[r](i),{c(){t=z("div"),e=z("div"),o.c(),s=$(),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]),q(t,"unClickable",i[1].clickable===!1),q(t,"disable",i[10]),q(t,"hide",i[9]),q(t,"withAnimation",i[0])},m(p,v){T(p,t,v),B(t,e),h[n].m(e,null),B(e,s),g[r].m(e,null),c=!0},p(p,[v]){let y=n;n=d(p),n===y?h[n].p(p,v):(se(),D(h[y],1,1,()=>{h[y]=null}),re(),o=h[n],o?o.p(p,v):(o=h[n]=u[n](p),o.c()),E(o,1),o.m(e,s));let w=r;r=A(p),r===w?g[r].p(p,v):(se(),D(g[w],1,1,()=>{g[w]=null}),re(),a=g[r],a?a.p(p,v):(a=g[r]=f[r](p),a.c()),E(a,1),a.m(e,null)),(!c||v&256)&&b(e,"data-tag-unfolded",p[8]),(!c||v&2048)&&b(e,"data-tag-id",p[11]),(!c||v&2&&l!==(l=p[1].contentType))&&b(e,"data-content-type",l),v&128&&L(e,"left",p[7]),v&64&&L(e,"top",p[6]),v&32&&L(e,"z-index",p[5]),(!c||v&2048)&&b(t,"data-tag-id",p[11]),(!c||v&2)&&q(t,"unClickable",p[1].clickable===!1),(!c||v&1024)&&q(t,"disable",p[10]),(!c||v&512)&&q(t,"hide",p[9]),(!c||v&1)&&q(t,"withAnimation",p[0])},i(p){c||(E(o),E(a),c=!0)},o(p){D(o),D(a),c=!1},d(p){p&&M(t),h[n].d(),g[r].d()}}}function kv(i,t,e){let n,o,s,r,a,l,c,u,h,{withAnimation:d=!1}=t,{tag:f}=t,{mediaStore:g}=t,{state:A}=t,{temporaryState:p}=t;const v=St("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,g=y.mediaStore),"state"in y&&e(3,A=y.state),"temporaryState"in y&&e(4,p=y.temporaryState)},i.$$.update=()=>{var y,w,P,k,C,S,x,Q;i.$$.dirty&2&&e(13,n=(()=>!(f.contentType==="Sticker"||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=!((P=f.state)!=null&&P.visible)||((k=f.temporaryState)==null?void 0:k.visible)===!1),i.$$.dirty&2&&e(8,l=(C=f.state)==null?void 0:C.unfolded),i.$$.dirty&2&&e(7,c=((S=f.pointTagStyle)==null?void 0:S.leftPercent)+"%"),i.$$.dirty&2&&e(6,u=((x=f.pointTagStyle)==null?void 0:x.topPercent)+"%"),i.$$.dirty&2&&e(5,h=(Q=f.state)!=null&&Q.unfolded?1:0)},[d,f,g,A,p,h,u,c,l,a,r,s,o,n,v]}class xv extends oe{constructor(t){super(),ie(this,t,kv,Iv,ne,{withAnimation:0,tag:1,mediaStore:2,state:3,temporaryState:4},yv)}}function Dv(i){ce(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 ia(i,t,e){const n=i.slice();return n[6]=t[e],n}function oa(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=ia(i,s,a),c=r(l);n.set(c,e[a]=sa(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"),q(t,"hide",!i[3].visible||!i[4].visible),q(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],se(),e=qe(e,l,r,1,a,s,n,t,Et,sa,null,ia),re()),(!o||l&24)&&q(t,"hide",!a[3].visible||!a[4].visible),(!o||l&1)&&q(t,"withAnimation",a[0])},i(a){if(!o){for(let l=0;l<s.length;l+=1)E(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 sa(i,t){let e,n,o;return n=new xv({props:{state:t[3],temporaryState:t[4],withAnimation:t[0],tag:t[6],mediaStore:t[2]}}),{key:i,first:null,c(){e=fe(),K(n.$$.fragment),this.first=e},m(s,r){T(s,e,r),J(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||(E(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&M(e),Z(n,s)}}}function Lv(i){let t,e,n=i[3].enabled&&oa(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&&E(n,1)):(n=oa(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Sv(i,t,e){let{withAnimation:n=!1}=t,{tags:o=[]}=t,{hooks:s}=t,{mediaStore:r}=t,{state:a}=t,{temporaryState:l}=t;return Hi("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 Mv extends oe{constructor(t){super(),ie(this,t,Sv,Lv,ne,{withAnimation:0,tags:1,hooks:5,mediaStore:2,state:3,temporaryState:4},Dv)}}const Tv={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 zv extends Cn{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 Bv extends zv{constructor(e){super(e);m(this,"tags",[]);m(this,"config",Tv);m(this,"raycaster",new I.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]=ht.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(He(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"&&an(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),g=this.getTagEnableByIntersect(e,f);if(g.value===!1)return g}if(l.angleRange&&Ip(e)){const f=this.getAngle(e);if(an(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=He(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&&an(c,r.unfoldDistance)===!1)return!1})();s.unfolded=a;const l=this.getUnfoldedByCamera(e);return l!==void 0?l:s.unfolded}}getUnfoldedByCamera(e){return this.getVisibleByPanoIndex(e)?(()=>{var a;const s=this.getDistance(e),r=this.getTagConfig(e).unfoldedConfig;if(!!r){if(typeof r=="function")return r(this.five,{tag:e,distance:s});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.autoUnfold===void 0||r.autoUnfold===!1||r.autoUnfold.enable===!1||!r.autoUnfold.strategy)return;if(r.autoUnfold.strategy==="ScreenPostion"){const l=this.getTagProject(e);if(l&&an(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:g,y:A,z:p}=f;return!(Math.abs(p)>1||Math.abs(g)>1||Math.abs(A)>1)}).map(d=>({tag:d,id:d.id,tagConfig:this.getTagConfig(d).unfoldedConfig})).filter(({tag:d,tagConfig:f})=>{var g,A;return!(typeof f!="object"||f.keep||f.autoUnfold===!1||((g=f.autoUnfold)==null?void 0:g.enable)===!1||((A=f.autoUnfold)==null?void 0:A.strategy)!=="MinimumDistance")}).map(d=>me(O({},d),{distance:this.getDistance(d.tag)})).filter(({distance:d,tagConfig:f})=>{var g,A;return!(d===void 0||typeof f!="object"||f.autoUnfold===!1||((g=f.autoUnfold)==null?void 0:g.enable)===!1||((A=f.autoUnfold)==null?void 0:A.strategy)!=="MinimumDistance"||f.autoUnfold.distance&&an(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=Zs(e);if(!u)return-1;const 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"?gn(e.normal):qi(e.position))();if(!u)return;const h=new I.Vector3().copy(c).sub(Ji(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=ht.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)})}setModelMedialVisible(){const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{var s;if(!He(n))return;if(!((s=n.model)!=null&&s.object)){n.mediaVisible=!1;return}const o=e==="Panorama"?this.getModelMedialVisibleByPanoIndex(n):!0;n.mediaVisible=o})}setUnfoldedByPanoIndex(){this.tags.forEach(e=>{const n=this.getUnfoldedByPanoIndex(e);if(!!e.state&&(n!==void 0&&(e.state.unfolded=n),n&&!e.state.visible)){const o=this.getTagConfig(e);typeof o.unfoldedConfig=="object"&&o.unfoldedConfig.autoUnfoldWhenHide!==!1&&(e.state.unfolded=!1)}})}getTagProject(e){if(!this.getVisibleByPanoIndex(e)||!e.position)return;const o=Ji(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").filter(e=>e.position)}filter2DPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint").filter(e=>e.position)}filter3DPointTag(){return this.tags.filter(e=>e.stickType==="3DPoint").filter(e=>e.position)}filterModelTag(){return this.tags.filter(e=>e.stickType==="Model")}filter3DTag(){return this.tags.filter(e=>e.stickType==="3DPoint"||e.stickType==="Plane"||e.stickType==="Model")}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(!He(e))return;const f=this.tags.filter(He).map(A=>{var p;return(p=A.model)==null?void 0:p.object}).filter(yt);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==null?void 0: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=Zs(e).sub(o).normalize();return this.raycaster.set(o,s),this.raycaster}}function jv(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 Vv=new Kl.GLTFLoader;function Qv(i){return new Promise((t,e)=>{function n(s){t(s)}function o(s){e(s)}Vv.load(i,n,void 0,o)})}const Sl="3.0.0",$i=`DnalogelPlugin-PanoTagPlugin@${Sl}`,Ov=!1,Rv=i=>`${$i}--${i}`;class Ml extends Bv{constructor(e,n){super(e);m(this,"version",Sl);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 V.Group);m(this,"gltfObjectGroup",new V.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)=>H(this,null,function*(){e.data=ht.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=>{He(n)&&e==="Panorama"&&this.changeTagMode(n,"front"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags(),this.updateRenderAllTags()});m(this,"handleFiveModelShownFloorChange",()=>{this.tags.forEach(e=>{!He(e)||(e.state.visible=this.getVisible(e))}),this.updateRenderAllTags()});m(this,"loadModel",e=>H(this,null,function*(){var l;const n=e.data.modelUrl;if(!n)return;const o=Qv(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 V.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=O({debug:!1,config:this.config},n),this.debug=this.params.debug,this.config=this.params.config,Xr(1,{namespace:si.GetAudioDuration}),Xr(1,{namespace:si.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 H(this,null,function*(){var s,r;this.clearTags(),console.info($i," load:",{data:JSON.parse(JSON.stringify(e))}),this.config=ht.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{Ep(this.five,this.tags)}catch(a){console.error(a)}return o})}addTag(e,n){return H(this,null,function*(){const s=(Array.isArray(e)?e:[e]).map(r=>{const a=this.getTagConfig(r);return me(O({},r),{state:O({visible:void 0,unfolded:Ov},a.initialState),hooks:new Ce.Subscribe,clickable:a.clickable,mergedConfig:a})}).filter(r=>r.position);return s.forEach(jv),this.tags.push(...s),kp(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=ht.default({},this.config,e):this.config=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeGlobalConfig(e,n=!0){n?this.config.globalConfig=ht.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 H(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 H(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=O({},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=ft(n),this.updateRenderPlaneTag())}changeDataById(e,n,o=!0){const s=this.getTagById(e);!s||(o?s.data=ht.default({},s.data,n):s.data=O(O({},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?ht.default(s,n):Object.assign(s,n),(s==null?void 0:s.tag3DContentSvelte)&&(n==null?void 0:n.normal)&&(s.tag3DContentSvelte.currentNormal=ft(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 A,p,v,y;const o=(v=(p=(A=e.mergedConfig)==null?void 0:A.tag3DConfig)==null?void 0:p.ratio)!=null?v:.00216,s=(y=e.tag3DContentSvelte)==null?void 0:y.domContainer.css3DObject;if(!s)return;const r=He(e)?e.data.mediaPosition:e.position;n.updateWorldMatrix(!1,!1);const a=n.matrixWorld,l=new V.Vector3().fromArray(r[0]),c=new V.Vector3().fromArray(r[2]),u=new V.Vector3().lerpVectors(l,c,.5).add(new V.Vector3(0,0,5e-4)),h=new V.Matrix4().setPosition(u),d=new V.Matrix4().makeScale(o,o,o),f=new V.Matrix4().multiply(a).multiply(h).multiply(d);f.decompose(s.position,s.quaternion,s.scale);const g=s.opacityMesh;!g||f.decompose(g.position,g.quaternion,g.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 H(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}=$s(Dp(()=>{!this.store.resizeObserverDisposer||o()},500),e),{observe:a,unobserve:l}=$s(Ks(()=>n(),400),e);return s(),a(),()=>{r(),l()}}handleFiveModeChange(e){this.setModelMedialVisible(),this.tags.forEach(n=>{He(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(O({},e.temporaryState),{visible:n.visibleConfig.keep==="visible"}):e.temporaryState=me(O({},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 Ks(()=>{this.setUnfoldedByCamera(),this.updateRenderAllTags()},100)}handleFiveCameraUpdate(){this.updateRenderPointTag()}handleFivePanoArrived(){return H(this,null,function*(){this.setModelMedialVisible(),yield this.setVisibleAndUnfolded(),this.tags.forEach(e=>{e.temporaryState=me(O({},e.temporaryState),{visible:!0})}),this.store.visibleWithAnimation=!0,this.updateTagContainerVisible(),this.updateRenderAllTags()})}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 Mv({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(He(n)&&((l=n.model)==null?void 0:l.object)&&this.updateTagCss3DObjectMatrix(n,(c=n.model)==null?void 0:c.object),n.tag3DContentSvelte){const{svelteApp:h,domContainer:d,initialNormal:f,currentNormal:g}=n.tag3DContentSvelte;if(this.updateTagCss3DObjectVisible(n),h.$set({tag:n,hooks:this.hooks,state:this.state,temporaryState:this.temporaryState}),!f.equals(g)){const A=new V.Quaternion().setFromUnitVectors(f,g);d.css3DObject.setRotationFromQuaternion(A)}return}if(((u=n.state)==null?void 0:u.visible)===!1)return;if(this.css3DRenderPlugin||(this.css3DRenderPlugin=Jt(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:He(n)?n.data.mediaPosition:xp(this.five.camera.position,ft(n.position),ft(n.normal)))();if(!o)return;const s=function(){if(n.normal)return ft(n.normal);if(n.stickType==="Plane")return qi(n.position);if(n.contentType==="MediaModel")return qi(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 Ll({target:a.container,props:{tag:n,hooks:this.hooks,state:this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}}),domContainer:a,initialNormal:s,currentNormal:s})}),this.checkPanelTag()}updateRenderModelTag(){const e=o=>!this.enabledModelTagSet.has(o.customID);this.gltfObjectGroup.remove(...this.gltfObjectGroup.children.filter(e)),this.tags.filter(He).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 H(this,null,function*(){const n=e.filter(He).map(this.loadModel);yield Promise.all(n),this.setModelMedialVisible(),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 Fv=(i,t)=>new Ml(i,t);function be(i,t){this._camera=i||null,this._domElement=t||document,this._raycaster=new I.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)}be.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)};be.eventNames=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu","touchstart","touchend"];be.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}};be.prototype._objectCtxInit=function(i){i._3xDomEvent={}};be.prototype._objectCtxDeinit=function(i){delete i._3xDomEvent};be.prototype._objectCtxIsInit=function(i){return!!i._3xDomEvent};be.prototype._objectCtxGet=function(i){return i._3xDomEvent};be.prototype.camera=function(i){return i&&(this._camera=i),this._camera};be.prototype.bind=function(i,t,e,n){console.assert(be.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)};be.prototype.addEventListener=be.prototype.bind;be.prototype.unbind=function(i,t,e,n){console.assert(be.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)};be.prototype.removeEventListener=be.prototype.unbind;be.prototype._bound=function(i,t){var e=this._objectCtxGet(t);return e?!!e[i+"Handlers"]:!1};be.prototype._onMove=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new I.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)}};be.prototype._onEvent=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new I.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)}}};be.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)}};be.prototype._onMouseDown=function(i){return this._onMouseEvent("mousedown",i)};be.prototype._onMouseUp=function(i){return this._onMouseEvent("mouseup",i)};be.prototype._onMouseEvent=function(i,t){var e=this._getRelativeMouseXY(t);this._onEvent(i,e.x,e.y,t)};be.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)};be.prototype._onClick=function(i){this._onMouseEvent("click",i)};be.prototype._onDblClick=function(i){this._onMouseEvent("dblclick",i)};be.prototype._onContextmenu=function(i){this._onMouseEvent("contextmenu",i)};be.prototype._onTouchStart=function(i){return this._onTouchEvent("touchstart",i)};be.prototype._onTouchEnd=function(i){return this._onTouchEvent("touchend",i)};be.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)}};be.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 Tl(i){const t=new I.Box3,e=new I.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 En{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 qt,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 be(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.matrix,t.origin)}onApplyOriginObjectRotate(t){this.applyHelperQuaternion(t.quaternion,t.origin)}onApplyOriginObjectPosition(t){this.applyHelperMatrix4(t.matrix)}onSetOriginObjectScale(t){this.helperObject3D.scale.copy(t),this.updateOffsetByScale(t)}onSetOriginObjectRotate(t,e){this.helperObject3D.setHelperQuaternion(t,e)}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 I.Vector3().subVectors(this.boundingBox.max,e).multiply(t).add(e),o=new I.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(yt),s=[];for(const r of o)if(r instanceof I.Mesh||r instanceof I.Group){const a=r instanceof I.Group?r.children.filter(d=>d instanceof I.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 I.Vector3(0,0,0);if(!t)return o;const s=()=>e||(this.boundingBox?this.boundingBox:(this.boundingBox=Tl(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 Hv extends En{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 I.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())}}function zl(i,t,e){if(e){const o=new I.Vector3().subVectors(i.position,e).applyQuaternion(i.quaternion.clone().inverse()).applyQuaternion(t).add(e);i.position.copy(o)}i.quaternion.copy(t)}class Gv extends V.Object3D{constructor(){super()}add(...t){if(t.length===0)return this;const e=t.filter(Boolean);return super.add(...e)}remove(...t){if(t.length===0)return this;const e=t.filter(Boolean);return super.remove(...e)}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}}class gi extends Gv{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){zl(this,e,n)}applyHelperQuaternion(e,n){if(n){const o=new V.Vector3().subVectors(this.position,n).applyQuaternion(e).add(n);this.position.copy(o)}this.applyQuaternion(e)}dispose(){this.removeFromParent()}}class Wv extends gi{}class Nv extends gi{}class _v extends gi{}class Bl extends gi{}class Xv extends Bl{}class Yv extends I.Group{constructor(e){super();m(this,"direction");this.direction=e||"x"}}class ra extends I.Mesh{constructor(e,n,o){super(e,n);m(this,"direction");this.direction=o||"x"}}function Uv(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return Object.assign(new I.Vector2,{x:(i.x-s)/e*2-1,y:-(i.y-o)/n*2+1})}function wo(i,t,e){if(!t||!e||!i)return;const n=Uv(t,e);if(Math.abs(n.x)===1||Math.abs(n.y)===1)return;const o=new I.Raycaster;return o.setFromCamera(n,i),o}function qv(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 ji extends Yv{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 I.Color((u=e.color)!=null?u:16214315),o=new I.MeshBasicMaterial({color:n,depthTest:!1,opacity:1,transparent:!0,side:I.DoubleSide}),s=new I.ConeGeometry(.04,.1,32),r=new ra(s,o.clone(),e.direction);r.name=`arrow-${e.direction}`,this.arrow=r;const a=.004,l=new I.CylinderGeometry(a,a,.4,32),c=new ra(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 Vi={X:15618642,Y:4765519,Z:4227839};class Wt{static get X(){return new I.Color(Vi.X).convertSRGBToLinear().clone()}static get Y(){return new I.Color(Vi.Y).convertSRGBToLinear().clone()}static get Z(){return new I.Color(Vi.Z).convertSRGBToLinear().clone()}}class Jv extends Wv{constructor(e){super(e);m(this,"xArrow",new ji({direction:"x",color:Wt.X}));m(this,"yArrow",new ji({direction:"y",color:Wt.Y}));m(this,"zArrow",new ji({direction:"z",color:Wt.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 Lt(i,t){return Zv(document.createElement(t!=null?t:"div"),i)}function Zv(i,t){if(!t)return i;for(const e in t)e&&t[e]&&(i.style[e]=t[e]);return i}function Kv(i){const t=Lt(O({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 $v extends _v{constructor(e,n){super(e);m(this,"xCircle");m(this,"yCircle");m(this,"zCircle");m(this,"children",[]);m(this,"angleTips");m(this,"container");(n==null?void 0:n.yzCircleEnable)!==!1&&(this.xCircle=new Qi({direction:"x",color:Wt.X})),(n==null?void 0:n.xzCircleEnable)!==!1&&(this.yCircle=new Qi({direction:"y",color:Wt.Y})),(n==null?void 0:n.xyCircleEnable)!==!1&&(this.zCircle=new Qi({direction:"z",color:Wt.Z})),(n==null?void 0:n.container)&&(n==null?void 0:n.angleTipsEnable)!==!1&&(this.container=n==null?void 0:n.container,this.angleTips=Kv({display:"none"}),this.container.appendChild(this.angleTips.element)),this.add(...[this.xCircle,this.yCircle,this.zCircle].filter(Boolean)),this.show()}hide(){this.children.forEach(e=>e.hide())}show(){var e;this.children.forEach(n=>n.showCircle()),(e=this.angleTips)==null||e.hide()}showDraggingHelper(e){var n;this.hide(),this.children.filter(o=>e.includes(o.direction)).forEach(o=>o.showRing()),(n=this.angleTips)==null||n.show()}dispose(){var e,n;this.removeFromParent(),(n=(e=this.angleTips)==null?void 0:e.element)==null||n.remove()}}class Qi extends I.Group{constructor(e){super();m(this,"direction");m(this,"circle");m(this,"ring");m(this,"angleSector");this.direction=e.direction,this.circle=new eb(e),this.ring=new tb(e),this.angleSector=new nb(e),this.add(this.circle,this.ring,this.angleSector),this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}showCircle(){this.add(this.circle),this.remove(this.ring,this.angleSector)}showRing(){this.add(this.ring,this.angleSector),this.remove(this.circle)}hide(){this.remove(this.ring,this.angleSector,this.circle)}}class eb extends I.Mesh{constructor(e){var n;super();m(this,"direction");m(this,"gapAngle",.02);m(this,"geometry",new I.RingGeometry(.25,.3,20,8,this.gapAngle,Math.PI/2-this.gapAngle*2));this.material=new I.MeshBasicMaterial({opacity:.6,color:(n=e.color)!=null?n:16777215,transparent:!0,side:I.DoubleSide,depthTest:!1}),this.direction=e.direction,this.geometry.name=`RotateHelperCircleGeometry-${this.direction}`}}class tb extends I.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 I.RingGeometry(.25,.3,20,8,Math.PI/4*r+n,Math.PI/4-n*2),l=new I.MeshBasicMaterial({opacity:1,color:16777215,depthTest:!1,transparent:!0,side:I.DoubleSide}),c=new I.Mesh(a,l);return c.name=`AxesDashedRing-${this.direction}-${r}`,c});this.add(...o)}}class nb extends I.Mesh{constructor(e){var o;super();m(this,"direction");m(this,"baseAxes");m(this,"angleDirection");switch(e.direction){case"x":this.baseAxes=new I.Vector3(0,0,1);break;case"y":this.baseAxes=new I.Vector3(1,0,0);break;case"z":this.baseAxes=new I.Vector3(1,0,0);break}const n=.3+5e-4;this.geometry=new I.CircleGeometry(n,48,0,1e-4),this.material=new I.MeshBasicMaterial({opacity:.4,color:(o=e.color)!=null?o:16777215,depthTest:!1,transparent:!0,side:I.DoubleSide}),this.direction=e.direction,this.angleDirection=this.direction==="z"?1:-1}}function ib(){const i=Lt({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=Lt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=Lt({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:dt({cursor:"nesw-resize",left:n,bottom:n})},s={direction:"ns",element:dt({cursor:"ns-resize",bottom:n})},r={direction:"nwse",element:dt({cursor:"nwse-resize",right:n,bottom:n})},a={direction:"ew",element:dt({cursor:"ew-resize",right:n})},l={direction:"nesw",element:dt({cursor:"nesw-resize",right:n,top:n})},c={direction:"ns",element:dt({cursor:"ns-resize",top:n})},u={direction:"nwse",element:dt({cursor:"nwse-resize",left:n,top:n})},h={direction:"ew",element:dt({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 dt(i){const t=Lt(O({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},i)),e=Lt({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),n=Lt({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 ob extends Xv{constructor(e,n,o,s){super(e);m(this,"points",[]);m(this,"cornerPositions",[]);m(this,"css3DInstance");m(this,"plane");m(this,"css3DRenderer",new Nt);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}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 I.Vector3().subVectors(o.position,n).applyQuaternion(e).add(n);o.position.copy(r),o.applyQuaternion(e)}if(this.plane){const r=new I.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 I.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,l;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}=ib();this.points=r.map((c,u)=>({direction:c.direction,point:c.element,position:this.calculatePointPosition(e)[u]})),o.insertBefore(s,(a=o.children[0])!=null?a:null),this.helperObject.position.copy(this.originObject3D.position),(l=this.plane)==null||l.position.copy(this.originObject3D.position)}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 sb extends Nv{constructor(e){super(e);m(this,"box");m(this,"outline");m(this,"originObject");m(this,"positionAttribute");this.originObject=e,this.positionAttribute=new I.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=Tl(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 I.BufferGeometry;n.setIndex(new I.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const o=new I.LineBasicMaterial({color:64767,linewidth:1,opacity:1,depthTest:!1,transparent:!0,toneMapped:!1}),s=new I.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 I.BufferGeometry;n.setIndex(new I.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const o=new I.MeshBasicMaterial({color:64767,opacity:.1,depthTest:!1,transparent:!0});return new I.Mesh(n,o)}}class rb extends En{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 I.Vector3(1,0,0).applyQuaternion(this.helperObject3D.quaternion),r=new I.Vector3(0,1,0).applyQuaternion(this.helperObject3D.quaternion),a=new I.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 I.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}dragging(e){if(!this.isDragging||!this.startInfo)return;const n=wo(this.camera,e,this.container);return n?(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 I.Vector3);if(!a)return;const l=a.clone().projectOnVector(o),c=l.clone().sub(s),u=new I.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",{matrix:u}),this.hooks.emit("move",h))}dragEnd(){!this.isDragging||(this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("moveEnd"))}}class ln{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 ab="v1.0.1",lb="Object3DHelper",Co=`${lb}@${ab}`,cb=()=>{console.error(`${Co} is disposed`)},ub=()=>{console.warn(`${Co} is disabled`)},db=()=>{console.error(`${Co} is disabled`)};class hb{constructor(t){m(this,"controllers",{});m(this,"state",{visible:!0,enabled:!0,disposed:!1});m(this,"hooks",new qt);m(this,"eventListener",{});t&&this.addControllers(t),this.setState(this.state)}show(t){return H(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return H(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 cb();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return db();const n=O({},this.state);this.state=O(O({},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=O(O({},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&&ub()}}function Oi(i){return i*Math.PI/180}class fb extends En{constructor(...e){var c,u,h;super(...e);m(this,"name","RotateController");m(this,"startInfo");m(this,"removeListener");const n=this.helperObject3D;this.hoverListener([(c=n.xCircle)==null?void 0:c.circle,(u=n.yCircle)==null?void 0:u.circle,(h=n.zCircle)==null?void 0:h.circle].filter(Boolean));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.applyHelperQuaternion(this.originObject3D.quaternion)}setRotateAngle(e){const{x:n=0,y:o=0,z:s=0}=e,r=new I.Euler(Oi(n),Oi(o),Oi(s)),a=new I.Quaternion().setFromEuler(r);if(this.hooks.emit("wantToRotate",a))return;const{originObject3D:c,rotateCenter:u}=this;zl(c,a,u),this.hooks.emit("setObjectRotate",a,u),this.hooks.emit("rotate",a),this.render()}dispose(){this.removeListener(),super.dispose()}onApplyOriginObjectRotate(e){this.isDragging||super.onApplyOriginObjectRotate(e)}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();const s=n.point,r=this.getAngleHelper(o);this.setTipsAngle(0);const a=s.clone();a.y+=.2,this.setTipsPosition(a);const l=(()=>{if(o==="x")return new I.Vector3(1,0,0).applyQuaternion(this.originObject3D.quaternion);if(o==="y")return new I.Vector3(0,1,0).applyQuaternion(this.originObject3D.quaternion);if(o==="z")return new I.Vector3(0,0,1).applyQuaternion(this.originObject3D.quaternion)})(),c=new I.Plane().setFromNormalAndCoplanarPoint(l,s),h=c.projectPoint(s.clone(),new I.Vector3).clone().sub(this.rotateCenter),d=h.angleTo(r.baseAxes.clone().applyQuaternion(this.originObject3D.quaternion));this.setAngleHelperStart(o,d),this.setAngleHelperLength(o,0),this.startInfo={direction:o,startVector:h,plane:c,angleHelper:r,angle:0,objectQuaternion:this.originObject3D.quaternion.clone()},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("rotateStart"),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const n=wo(this.camera,e,this.container);return n?(this.rotate(n),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:n,plane:o,angleHelper:s,direction:r,objectQuaternion:a}=this.startInfo,{originObject3D:l}=this,c=e.ray.intersectPlane(o,new I.Vector3);if(!c)return;const u=this.rotateCenter.clone(),d=o.projectPoint(c.clone(),new I.Vector3).clone().sub(u);if(n.angleTo(d)===0)return;const f=new I.Quaternion().setFromUnitVectors(n.clone().normalize(),d.clone().normalize()),g=l.quaternion.clone().premultiply(f);if(this.hooks.emit("wantToRotate",g))return;const v=new I.Euler().setFromQuaternion(new I.Quaternion().setFromUnitVectors(n.clone().normalize().applyQuaternion(a.clone().inverse()),d.clone().normalize().applyQuaternion(a.clone().inverse())),`${r.toUpperCase()}${"XZY".replace(r.toUpperCase(),"")}`)[r]*s.angleDirection;if(this.startInfo.angle+=v,this.setAngleHelperLength(r,this.startInfo.angle),this.setTipsAngle(za(this.startInfo.angle)),u){const y=new I.Vector3().subVectors(l.position,u).applyQuaternion(f).add(u);l.position.copy(y)}l.applyQuaternion(f),this.hooks.emit("applyObjectRotate",{quaternion:f,origin:u}),this.hooks.emit("rotate",l.quaternion),this.startInfo.startVector=d}dragEnd(){!this.isDragging||(this.hooks.emit("setObjectRotate",this.originObject3D.quaternion,this.rotateCenter),this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("rotateEnd"))}getAngleHelper(e){var n,o,s;switch(e){case"x":return(n=this.helperObject3D.xCircle)==null?void 0:n.angleSector;case"y":return(o=this.helperObject3D.yCircle)==null?void 0:o.angleSector;case"z":return(s=this.helperObject3D.zCircle)==null?void 0:s.angleSector}}setAngleHelperStart(e,n){const o=this.getAngleHelper(e);if(!o){console.warn("angleHelper is undefined");return}if(o instanceof I.Mesh&&o.geometry instanceof I.CircleGeometry){const{radius:s,segments:r,thetaLength:a}=o.geometry.parameters;o.geometry=new I.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 I.Mesh&&r.geometry instanceof I.CircleGeometry){const{radius:a,thetaStart:l}=r.geometry.parameters,c=Math.ceil(Math.abs(s)*(40/(2*Math.PI)));r.geometry=new I.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 mb extends En{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()}onApplyOriginObjectPosition(e){this.isDragging||super.onApplyOriginObjectPosition(e)}onApplyOriginObjectScale(e){this.helperObject3D.applyHelperScaleMatrix4(e.matrix,e.origin)}getDragPlane(){const e=new I.Plane,n=this.helperObject3D.cornerPositions;if(n.length!==0)return n.length<3?e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new V.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}dragging(e){if(!this.isDragging)return;const n=wo(this.camera,e,this.container);if(!n)return this.dragEnd();this.scale(n)}scale(e){var Q,_;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 V.Vector3);if(!a||qv(a,this.camera.position))return;const l=new V.Vector3().addVectors(r[0],r[2]).divideScalar(2),{position:c,direction:u}=o,h=new V.Vector3().subVectors(r[1],r[0]),d=new V.Vector3().subVectors(r[3],r[0]),f=R=>{const U=new V.Vector3(0,0,0);if(!this.startInfo)return U;const j=(R==="ew"?h:d).clone(),F=c.clone().projectOnVector(j),W=a.clone().projectOnVector(j),X=l.clone().projectOnVector(j);if(W.equals(F))return U;if(R==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const N=new V.Vector3().subVectors(W,X),ae=N.x<0&&j.x>=0,he=N.y<0&&j.y>=0,ue=N.z<0&&j.z>=0;this.startInfo.dragPointInCenterBottom=ae||he||ue}if(R==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const N=new V.Vector3().subVectors(W,X),ae=N.x<0&&j.x>=0,he=N.y<0&&j.y>=0,ue=N.z<0&&j.z>=0;this.startInfo.dragPointInCenterLeft=ae||he||ue}const G=new V.Vector3().subVectors(W,F),ee=G.length();return ee>.3?(console.warn("offset.length() > 0.3, skipped",ee),U):G},g=f("ew"),A=f("ns"),p=()=>{const R=g;this.helperObject3D.cornerPositions.forEach((U,j)=>{var F;(F=this.startInfo)!=null&&F.dragPointInCenterLeft?(j===0||j===3)&&U.add(R):(j===1||j===2)&&U.add(R)})},v=()=>{const R=A;this.helperObject3D.cornerPositions.forEach((U,j)=>{var F;(F=this.startInfo)!=null&&F.dragPointInCenterBottom?(j===0||j===1)&&U.add(R):(j===2||j===3)&&U.add(R)})};switch(u){case"ew":p();break;case"ns":v();break;case"nesw":case"nwse":p(),v()}const y=new V.Vector3().subVectors(r[1],r[0]).length()/h.length(),w=new V.Vector3().subVectors(r[3],r[0]).length()/d.length(),P=new V.Vector3(y,w,1),k=new I.Matrix4().scale(P);n.isCSS3DObjectPlus?n.applyScaleMatrix4(k):n.scale.applyMatrix4(k),o.position.copy(a);const C=new V.Vector3().addVectors(r[0],r[2]).divideScalar(2),S=new V.Vector3().subVectors(C,l),x=new I.Matrix4().setPosition(S);n.applyMatrix4(x),(Q=this.helperObject3D.css3DInstance)==null||Q.css3DObject.applyMatrix4(x),(_=this.helperObject3D.plane)==null||_.applyMatrix4(x),this.hooks.emit("applyObjectScale",{matrix:k}),this.hooks.emit("applyObjectPosition",{matrix:x}),this.render()}dragEnd(){!this.isDragging||(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render())}}class pb extends mb{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 gb extends En{constructor(...e){super(...e);m(this,"name","BoundingBoxController")}}class Ab extends Bl{constructor(t){super(t)}}const Po="v1.0.0",eo="Object3DHelperPlugin",Ai=`${eo}@${Po}`,vb=()=>{console.error(`${Ai} is disposed`)},bb=()=>{console.warn(`${Ai} is disabled`)},yb=()=>{console.error(`${Ai} is disabled`)};class jl extends Cn{constructor(e){super(e);m(this,"version",Po);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 Nt(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 H(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return H(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 vb();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return yb();const o=O({},this.state);this.state=O(O({},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 hb,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 g=new Jv(e),A=this.getConfig(n.moveHelper),p=new ln(this.five,rb,e,g,A,d);o.addControllers({moveController:p.helperController}),s.push(()=>p.dispose())}if(c){const g=this.getConfig(n.rotateHelper),A=new $v(e,O({container:r},g)),p=new ln(this.five,fb,e,A,g,d);o.addControllers({rotateController:p.helperController}),s.push(()=>p.dispose())}if(h){const g=new sb(e),A=new ln(this.five,gb,e,g,void 0,d);o.addControllers({boundingBoxController:A.helperController})}if(u)if(e.isCSS3DObjectPlus&&r){const g=new ob(e,r,a,this.five.scene),A=new ln(this.five,pb,e,g,void 0,d);o.addControllers({scaleController:A.helperController}),s.push(()=>A.dispose()),ma(this.five).then(()=>{var p,v;if(e.isCSS3DObjectPlus){const y=e;if(!y||y.mode!=="front")return;const w=(p=this.css3DRender.behindModeCSS3DRenderer.wrapper)!=null?p:pa(this.five);w&&(this.css3DObjectParentMap.set(y,y.parent),y.removeFromParent(),this.css3DRender.behindModeCSS3DRenderer.setWrapper(w),(v=this.css3DRender.getBehindCSS3DObjectGroup())==null||v.add(y),this.css3DRender.render(this.five.camera))}})}else{const g=new Ab(e),A=new ln(this.five,Hv,e,g,void 0,d);o.addControllers({scaleController:A.helperController}),s.push(()=>A.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&&bb()}getConfig(e){if(!!e&&typeof e!="boolean"&&e.enable)return e}}const wb=i=>new jl(i),Cb=`
|
|
561
|
+
`;function nA(){const i=new I.PlaneGeometry(.4,.4),t=$0,e=new I.TextureLoader().load(t);e.encoding=I.sRGBEncoding;const n=new I.MeshBasicMaterial({map:e,transparent:!0,depthTest:!1});return new I.Mesh(i,n)}function iA(){const i=new I.CurvePath;i.add(new I.LineCurve3(new I.Vector3(0,0,0),new I.Vector3(0,0,.1)));const t=new I.TubeGeometry(i,8,.003),e=new I.ShaderMaterial({vertexShader:eA,fragmentShader:tA,depthTest:!1,transparent:!0});return new I.Mesh(t,e)}function oA(){const i=new I.SphereGeometry(.01,20,20),t=new I.MeshBasicMaterial({color:10349931,depthTest:!1,transparent:!0,side:I.DoubleSide}),e=new I.Mesh(i,t);return e.position.set(0,0,.1),e}class Pl extends I.Object3D{constructor(){super();m(this,"planeMesh");m(this,"lineMesh");m(this,"ballMesh");this.planeMesh=nA(),this.lineMesh=iA(),this.ballMesh=oA(),this.add(this.planeMesh,this.lineMesh,this.ballMesh)}updateWithIntersect(e){if(!e.face)return;const n=new I.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 El{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=Jt(t).create3DDomContainer([[-n,n,0],[-n,-n,0],[n,-n,0],[n,n,0]].map(r=>new I.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(${Za})`,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 I.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(ri.Easing.Quadratic.InOut).onUpdate(({progress:e})=>{}).play()}dispose(){var t;(t=this.disposeCss3DObject)==null||t.call(this)}}class sA{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 I.Group);this.five=t,this.magnifier=(e==null?void 0:e.magnifier)===void 0?new wl(t,{dragEnabled:!0}):null,this.pointHelper=(e==null?void 0:e.pointHelper)===void 0?new Pl:null,this.pointDomHelper=(e==null?void 0:e.pointDomHelper)===void 0?new El(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 rA=Object.freeze(Object.defineProperty({__proto__:null,Interval:Ki,Rectangle:U0,Magnifier:wl,getCoordsFromClient:J0,getCoordsFromElement:Cl,getRaycasterFromFivePointer:Z0,getIntersectFromRelativePosition:K0,PointHelper:Pl,PointDomHelper:El,FivePointSelector:sA,isNil:lp,notNil:yt,BetterTween:mo,tweenProgress:Ha,nextFrame:di,requestAnimationFrameInterval:Pn,getFrameTime:Dh},Symbol.toStringTag,{value:"Module"}));function aA(i){ce(i,"svelte-sezqcq",'@charset "UTF-8";.svelte-sezqcq.svelte-sezqcq{box-sizing:border-box}.marketing.svelte-sezqcq.svelte-sezqcq{transform:translateY(-100%)}.marketing.svelte-sezqcq .line.svelte-sezqcq{position:absolute;height:1.875rem;width:0.0625rem;left:50%;transform:translateX(-50%);background-color:white;bottom:0;transform-origin:bottom;transition:all 500ms}.marketing.svelte-sezqcq .content.svelte-sezqcq{position:relative;min-width:7.5rem;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-property:opacity, transform;transition-duration:500ms}.marketing.svelte-sezqcq .content .headerImage.svelte-sezqcq{position:absolute;width:100%;top:0.25rem;transform:translateY(-100%);border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.title-wrapper.svelte-sezqcq.svelte-sezqcq{position:relative;width:100%;height:1.125rem}.title-wrapper.svelte-sezqcq .title.svelte-sezqcq{border-radius:0.25rem;width:100%;padding-left:0.625rem;padding-right:0.625rem}.title-wrapper.svelte-sezqcq .title .text.svelte-sezqcq{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;font-weight:bold;line-height:1.125rem}.footer.svelte-sezqcq.svelte-sezqcq{position:relative;padding:0.5rem 0.625rem 0 0;width:100%;display:flex;align-items:center}.footer.svelte-sezqcq .goto-button.svelte-sezqcq{display:flex;align-self:flex-end;flex-wrap:wrap;align-items:center;overflow:hidden;height:0.875rem}.footer.svelte-sezqcq .goto-button .gap.svelte-sezqcq{height:100%;width:0.625rem}.footer.svelte-sezqcq .goto-button .text.svelte-sezqcq{display:block;height:100%;font-size:0.625rem}.footer.svelte-sezqcq .arrow-wrapper.svelte-sezqcq{height:0.875rem;display:flex;align-self:flex-end;flex-grow:0;flex-shrink:0;align-items:center;margin-left:0.25rem}.footer.svelte-sezqcq .arrow-wrapper svg.arrow.svelte-sezqcq{width:0.375rem;height:0.625rem}.footer.svelte-sezqcq .price.svelte-sezqcq{flex-shrink:0;margin-right:auto;white-space:nowrap;display:flex;align-items:baseline;margin-left:0.625rem}.footer.svelte-sezqcq .price .value.svelte-sezqcq{position:relative;font-size:0.875rem;line-height:1rem;font-family:TG-TYPE, PingFangSC, Segoe UI, Rototo, sans-serif;letter-spacing:0rem}.footer.svelte-sezqcq .price .unit.svelte-sezqcq{padding-left:0.125rem;font-size:0.625rem}.tags-wrapper.svelte-sezqcq.svelte-sezqcq{position:relative;overflow:hidden;height:1rem;margin-top:0.25rem}.tags-wrapper.svelte-sezqcq .tags.svelte-sezqcq{position:relative;display:inline-flex;max-width:100%;flex-wrap:wrap;padding-left:0.625rem;padding-right:0.375rem}.tags-wrapper.svelte-sezqcq .tags .tag.svelte-sezqcq{display:flex;align-items:center;justify-content:center;flex-shrink:0;flex-grow:0;font-size:0.625rem;height:1rem;margin-right:0.25rem;margin-bottom:0.625rem;padding:0 0.25rem;border-radius:0.125rem;max-width:100%;text-overflow:ellipsis;overflow:hidden}.marketing.light.svelte-sezqcq .content.svelte-sezqcq{background-color:white}.marketing.light.svelte-sezqcq .content .title-wrapper .title .text.svelte-sezqcq{color:rgba(0, 0, 0, 0.8)}.marketing.light.svelte-sezqcq .content .tags-wrapper .tags .primary-tag.svelte-sezqcq{background:rgba(234, 208, 154, 0.5);color:#946700}.marketing.light.svelte-sezqcq .content .tags-wrapper .tags .secondary-tag.svelte-sezqcq{background:rgba(0, 0, 0, 0.06);color:rgba(0, 0, 0, 0.5)}.marketing.light.svelte-sezqcq .content .footer.svelte-sezqcq{color:#946700;fill:#946700}.marketing.dark.svelte-sezqcq .content.svelte-sezqcq{background-color:rgba(0, 0, 0, 0.5)}.marketing.dark.svelte-sezqcq .content .title-wrapper .title .text.svelte-sezqcq{color:white}.marketing.dark.svelte-sezqcq .content .tags-wrapper .tags .primary-tag.svelte-sezqcq{background:rgba(234, 208, 154, 0.5);color:white}.marketing.dark.svelte-sezqcq .content .tags-wrapper .tags .secondary-tag.svelte-sezqcq{background:rgba(255, 255, 255, 0.15);color:rgba(255, 255, 255, 0.85)}.marketing.dark.svelte-sezqcq .content .footer.svelte-sezqcq{color:#ead09a;fill:#ead09a}.marketing.unfolded.svelte-sezqcq .line.svelte-sezqcq{transform:translateX(-50%) scale(1, 1)}.marketing.folded.svelte-sezqcq .line.svelte-sezqcq{transform:translateX(-50%) scale(1, 0);transition-timing-function:ease-in}.marketing.unfolded.svelte-sezqcq .content.svelte-sezqcq{opacity:1}.marketing.folded.svelte-sezqcq .content.svelte-sezqcq{opacity:0;transform:translateY(0.425rem);transition-timing-function:ease-in}')}function Br(i,t,e){const n=i.slice();return n[0]=t[e],n}function jr(i,t,e){const n=i.slice();return n[0]=t[e],n}function Vr(i){let t,e;return{c(){t=z("img"),b(t,"class","headerImage svelte-sezqcq"),_e(t.src,e=i[3].headerPictureUrl)||b(t,"src",e),b(t,"alt","")},m(n,o){T(n,t,o)},p(n,o){o&8&&!_e(t.src,e=n[3].headerPictureUrl)&&b(t,"src",e)},d(n){n&&M(t)}}}function Qr(i){let t,e,n,o,s=i[2]||[],r=[];for(let c=0;c<s.length;c+=1)r[c]=Rr(jr(i,s,c));let a=i[5]||[],l=[];for(let c=0;c<a.length;c+=1)l[c]=Or(Br(i,a,c));return{c(){t=z("div"),e=z("div");for(let c=0;c<r.length;c+=1)r[c].c();n=$();for(let c=0;c<l.length;c+=1)l[c].c();b(e,"class","tags svelte-sezqcq"),xe(()=>i[11].call(e)),b(t,"class","tags-wrapper svelte-sezqcq")},m(c,u){T(c,t,u),B(t,e);for(let h=0;h<r.length;h+=1)r[h].m(e,null);B(e,n);for(let h=0;h<l.length;h+=1)l[h].m(e,null);o=tt(e,i[11].bind(e))},p(c,u){if(u&4){s=c[2]||[];let h;for(h=0;h<s.length;h+=1){const d=jr(c,s,h);r[h]?r[h].p(d,u):(r[h]=Rr(d),r[h].c(),r[h].m(e,n))}for(;h<r.length;h+=1)r[h].d(1);r.length=s.length}if(u&32){a=c[5]||[];let h;for(h=0;h<a.length;h+=1){const d=Br(c,a,h);l[h]?l[h].p(d,u):(l[h]=Or(d),l[h].c(),l[h].m(e,null))}for(;h<l.length;h+=1)l[h].d(1);l.length=a.length}},d(c){c&&M(t),at(r,c),at(l,c),o()}}}function Rr(i){let t,e=i[0]+"",n;return{c(){t=z("div"),n=ke(e),b(t,"class","tag primary-tag svelte-sezqcq"),L(t,"min-width",bo)},m(o,s){T(o,t,s),B(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&Me(n,e)},d(o){o&&M(t)}}}function Or(i){let t,e=i[0]+"",n;return{c(){t=z("div"),n=ke(e),b(t,"class","tag secondary-tag svelte-sezqcq"),L(t,"min-width",bo)},m(o,s){T(o,t,s),B(t,n)},p(o,s){s&32&&e!==(e=o[0]+"")&&Me(n,e)},d(o){o&&M(t)}}}function Fr(i){let t,e,n=i[7]&&Hr(i),o=i[3].highlightText&&Wr(i);return{c(){t=z("div"),n&&n.c(),e=$(),o&&o.c(),b(t,"class","footer svelte-sezqcq")},m(s,r){T(s,t,r),n&&n.m(t,null),B(t,e),o&&o.m(t,null)},p(s,r){s[7]?n?n.p(s,r):(n=Hr(s),n.c(),n.m(t,e)):n&&(n.d(1),n=null),s[3].highlightText?o?o.p(s,r):(o=Wr(s),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(s){s&&M(t),n&&n.d(),o&&o.d()}}}function Hr(i){let t,e,n=i[3].price.value+"",o,s,r=i[3].price.unit&&Gr(i);return{c(){t=z("div"),e=z("span"),o=ke(n),s=$(),r&&r.c(),b(e,"class","value svelte-sezqcq"),b(t,"class","price svelte-sezqcq")},m(a,l){T(a,t,l),B(t,e),B(e,o),B(t,s),r&&r.m(t,null)},p(a,l){l&8&&n!==(n=a[3].price.value+"")&&Me(o,n),a[3].price.unit?r?r.p(a,l):(r=Gr(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&M(t),r&&r.d()}}}function Gr(i){let t,e=i[3].price.unit+"",n;return{c(){t=z("span"),n=ke(e),b(t,"class","unit svelte-sezqcq")},m(o,s){T(o,t,s),B(t,n)},p(o,s){s&8&&e!==(e=o[3].price.unit+"")&&Me(n,e)},d(o){o&&M(t)}}}function Wr(i){let t,e,n,o,s=i[3].highlightText+"",r,a,l;return{c(){t=z("div"),e=z("div"),n=$(),o=z("span"),r=ke(s),a=$(),l=z("div"),l.innerHTML='<svg class="arrow svelte-sezqcq" viewBox="0 0 6 9"><g transform="translate(-3, -2)" fill-rule="nonzero" class="svelte-sezqcq"><path d="M4.43868724,2.12056563 C4.28121824,1.95989074 4.02582143,1.95979988 3.86824251,2.1203627 C3.72498894,2.26632889 3.71189225,2.49481723 3.82900374,2.65587166 L6.57092402,5.92894326 C6.72651763,6.11470411 6.72651763,6.38529589 6.57092402,6.57105674 L3.86804348,9.79798499 C3.72488984,9.94405307 3.71194952,10.1725507 3.8291712,10.3335217 L3.86824251,10.3796373 C4.01149607,10.5256035 4.23559087,10.5387981 4.39346025,10.4192733 L4.43868724,10.3794344 L8.1144599,6.5985342 C8.30312347,6.40447482 8.30312347,6.09552518 8.1144599,5.9014658 L4.43868724,2.12056563 Z" class="svelte-sezqcq"></path></g></svg>',b(e,"class","gap svelte-sezqcq"),b(o,"class","text svelte-sezqcq"),b(t,"class","goto-button goto-icon svelte-sezqcq"),b(l,"class","arrow-wrapper svelte-sezqcq")},m(c,u){T(c,t,u),B(t,e),B(t,n),B(t,o),B(o,r),T(c,a,u),T(c,l,u)},p(c,u){u&8&&s!==(s=c[3].highlightText+"")&&Me(r,s)},d(c){c&&M(t),c&&M(a),c&&M(l)}}}function lA(i){var P,k;let t,e,n,o,s,r,a,l,c,u,h=i[3].title+"",d,f,g,A,p;e=new nt({props:{visible:i[4],outDelay:500,left:61,bottom:87,blurRadius:150,spreadRadius:75}});let v=i[3].headerPictureUrl&&Vr(i),y=((P=i[2].length)!=null?P:0)+((k=i[5].length)!=null?k:0)>0&&Qr(i),w=(i[7]||i[3].highlightText)&&Fr(i);return{c(){t=z("div"),K(e.$$.fragment),n=$(),o=z("div"),s=$(),r=z("div"),v&&v.c(),a=$(),l=z("div"),c=z("div"),u=z("div"),d=ke(h),f=$(),y&&y.c(),g=$(),w&&w.c(),b(o,"class","line svelte-sezqcq"),L(o,"transition-delay",i[4]?Gn+"ms":Wn+_r-Nr-40+"ms"),b(u,"class","text svelte-sezqcq"),b(c,"class","title svelte-sezqcq"),b(l,"class","title-wrapper svelte-sezqcq"),b(r,"class","content svelte-sezqcq"),L(r,"max-width",Ie(i[9])),L(r,"transition-delay",i[4]?Gn+Wn+"ms":"0ms"),b(t,"class",A=Te(`marketing ${i[6]}`)+" svelte-sezqcq"),q(t,"unfolded",i[4]),q(t,"folded",i[8])},m(C,S){T(C,t,S),J(e,t,null),B(t,n),B(t,o),B(t,s),B(t,r),v&&v.m(r,null),B(r,a),B(r,l),B(l,c),B(c,u),B(u,d),B(r,f),y&&y.m(r,null),B(r,g),w&&w.m(r,null),p=!0},p(C,[S]){var Q,_;const x={};S&16&&(x.visible=C[4]),e.$set(x),S&16&&L(o,"transition-delay",C[4]?Gn+"ms":Wn+_r-Nr-40+"ms"),C[3].headerPictureUrl?v?v.p(C,S):(v=Vr(C),v.c(),v.m(r,a)):v&&(v.d(1),v=null),(!p||S&8)&&h!==(h=C[3].title+"")&&Me(d,h),((Q=C[2].length)!=null?Q:0)+((_=C[5].length)!=null?_:0)>0?y?y.p(C,S):(y=Qr(C),y.c(),y.m(r,g)):y&&(y.d(1),y=null),C[7]||C[3].highlightText?w?w.p(C,S):(w=Fr(C),w.c(),w.m(r,null)):w&&(w.d(1),w=null),S&16&&L(r,"transition-delay",C[4]?Gn+Wn+"ms":"0ms"),(!p||S&64&&A!==(A=Te(`marketing ${C[6]}`)+" svelte-sezqcq"))&&b(t,"class",A),(!p||S&80)&&q(t,"unfolded",C[4]),(!p||S&320)&&q(t,"folded",C[8])},i(C){p||(E(e.$$.fragment,C),p=!0)},o(C){D(e.$$.fragment,C),p=!1},d(C){C&&M(t),Z(e),v&&v.d(),y&&y.d(),w&&w.d()}}}const bo=40,Gn=400,Nr=500,Wn=180,_r=500;function cA(i,t,e){let n,o,s,r,a,l,c,u,{tag:h}=t,d,f=(()=>{var p;const A=(p=h.data.limitWidth)!=null?p:!0;if(typeof A=="number")return A;if(A===!0)return 172})();function g(){d=this.offsetHeight,e(1,d)}return i.$$set=A=>{"tag"in A&&e(0,h=A.tag)},i.$$.update=()=>{var A,p,v,y,w,P;i.$$.dirty&1&&e(4,n=(p=(A=h.state)==null?void 0:A.unfolded)!=null?p:!1),i.$$.dirty&16&&e(8,o=!n),i.$$.dirty&1&&e(3,s=h.data),i.$$.dirty&8&&e(7,r=yt((v=s.price)==null?void 0:v.value)&&((y=s.price)==null?void 0:y.value)!==""),i.$$.dirty&1&&e(6,a=h.data.theme||"light"),i.$$.dirty&1026&&d>40&&e(10,l=l-1),i.$$.dirty&1032&&e(2,c=((w=s.brandTags)==null?void 0:w.slice(0,l).filter(Boolean))||[]),i.$$.dirty&1036&&e(5,u=((P=s.tags)==null?void 0:P.slice(0,l-c.length).filter(Boolean))||[])},e(10,l=(f-20)/bo),[h,d,c,s,n,u,a,r,o,f,l,g]}class uA extends oe{constructor(t){super(),ie(this,t,cA,lA,ne,{tag:0},aA)}}const Ut="data:audio/mpeg;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAADAAAGhgBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////////////////////////////////////8AAAA5TEFNRTMuOThyAc0AAAAAAAAAABSAJAiqQgAAgAAABobxtI73AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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alnZyjQUGBRQGIFggOWUacWUeYmuadrZziQKKEgQsQLAhQkUJAgMQDghltLO1onp0cpkNInSFMqlYeSEJ5AHsqFdOwy1DA2sRmRJKxdKRfLhfLw5BzUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7ksRRA8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=",mn={};var si=(i=>(i.Default="default",i.GetAudioDuration="getAudioDuration",i.PlayAudio="playAudio",i))(si||{});function Il(i,t){const e=(t==null?void 0:t.namespace)||"default",n=mn[e]||(mn[e]=[]);let o=n.find(s=>!s.realSrc||s.realSrc===Ut);return o||(console.warn("\u672A\u627E\u5230\u7F13\u5B58\u97F3\u9891\uFF0C\u5DF2\u65B0\u5EFA",mn),o=new yo(Ut),n.push(o)),i&&(o.src=i),o}function dA(i){return H(this,null,function*(){const t=(()=>i instanceof yo?i:Il(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 Xr(i,t){const e=(t==null?void 0:t.namespace)||"default",n=mn[e]||(mn[e]=[]),o=i-n.length;if(!(o<=0))for(let s=0;s<o;s++)n.push(new yo(Ut))}class yo 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=()=>hA(this);document.addEventListener("click",n),document.addEventListener("touchend",n),this.removeDocumentEventListener=()=>{document.removeEventListener("click",n),document.removeEventListener("touchend",n)}}get isBlankAudio(){return this.realSrc===Ut||!this.realSrc}get src(){return super.src}set src(e){super.src=e,this.realSrc=e}clear(){this.src=Ut,this.currentTime=0}}function hA(i){!i||i.inited||(i.src&&(i.inited=!0,i.removeDocumentEventListener()),i.src===Ut&&i.play())}class fA 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 H(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=Il(this.sharedAudioSrc,{namespace:si.PlayAudio})),(n=this.eventListenerDisposer)==null||n.call(this),this.eventListenerDisposer=this.addEventListeners(),this.audioInstance.currentTime=(o=this.currentTime)!=null?o:0,this.audioInstance.play().then(()=>{var s;this.audioInstance.currentTime=(s=this.currentTime)!=null?s:0,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,this.sharedAudioPaused=e.paused,(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.sharedAudioPaused=!0,this.clear()},r=d=>{var f;(f=this.onended)==null||f.call(this,d),this.sharedAudioPaused=!0,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 mA(i){ce(i,"svelte-13e7hxv",".audio.svelte-13e7hxv{pointer-events:auto;cursor:pointer;width:100%;height:100%}")}function pA(i){let t,e,n,o;const s=i[8].default,r=Kt(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",Pa(i[1])),n=!0)},p(a,[l]){r&&r.p&&(!e||l&128)&&en(r,s,a,a[7],e?$t(s,a[7],l,null):tn(a[7]),null),(!e||l&1)&&b(t,"style",a[0])},i(a){e||(E(r,a),e=!0)},o(a){D(r,a),e=!1},d(a){a&&M(t),r&&r.d(a),n=!1,o()}}}function gA(i,t,e){let{$$slots:n={},$$scope:o}=t,{url:s}=t,{enable:r=!0}=t,{style:a=""}=t,{hooksInfo:l}=t;const c=ai(),u=St("hooks"),h=St("mediaStore");let d,f=!0;function g(){e(5,d.onplay=p=>{u.emit("playStateChange",R({event:p,state:"playing",mediaInstance:d},l)),c("play"),e(6,f=!1)},d),e(5,d.onpause=p=>{u.emit("playStateChange",R({event:p,state:"paused",mediaInstance:d},l)),c("pause"),e(6,f=!0)},d),e(5,d.onloadedmetadata=p=>{typeof d.duration=="number"&&!Number.isNaN(d.duration)&&c("duration",d.duration)},d),e(5,d.ontimeupdate=p=>{c("timeupdate",d.currentTime)},d)}h.subscribe(({currentMediaElement:p})=>{p!==d&&(f||d==null||d.pause())});function A(p){!d||(u.emit("click",R({event:p,target:"AudioTagPlayIcon",audioInstance:d},l)),h.set({currentMediaElement:d}),u.emit("playStateChange",R({event:p,state:d.paused?"playing":"paused",mediaInstance:d},l)),d.paused?d.play():d.pause())}return i.$$set=p=>{"url"in p&&e(2,s=p.url),"enable"in p&&e(3,r=p.enable),"style"in p&&e(0,a=p.style),"hooksInfo"in p&&e(4,l=p.hooksInfo),"$$scope"in p&&e(7,o=p.$$scope)},i.$$.update=()=>{i.$$.dirty&4&&(s||c("duration",0)),i.$$.dirty&36&&(d==null||d.dispose(),e(5,d=new fA(s)),c("audioRef",d),setTimeout(()=>c("audioRef",d),200),dA(s).then(p=>c("duration",p)),g()),i.$$.dirty&40&&(r||d==null||d.pause()),i.$$.dirty&72&&c(r&&!f?"play":"pause")},[a,A,s,r,l,d,f,o,n]}class kl extends oe{constructor(t){super(),ie(this,t,gA,pA,ne,{url:2,enable:3,style:0,hooksInfo:4},mA)}}function AA(i){ce(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 Yr(i){let t,e;return t=new nt({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function vA(i){let t,e,n,o,s,r=i[1]&&Yr();return{c(){t=z("div"),r&&r.c(),e=$(),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"),q(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),B(t,e),B(t,n),B(n,o),i[7](o),i[8](t),s=!0},p(a,[l]){a[1]?r?l&2&&E(r,1):(r=Yr(),r.c(),E(r,1),r.m(t,e)):r&&(se(),D(r,1,1,()=>{r=null}),re()),(!s||l&1)&&q(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||(E(r),s=!0)},o(a){D(r),s=!1},d(a){a&&M(t),r&&r.d(),i[7](null),i[8](null)}}}function bA(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){Qe[d?"unshift":"push"](()=>{c=d,e(4,c)})}function h(d){Qe[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 xl extends oe{constructor(t){super(),ie(this,t,bA,vA,ne,{playing:0,shadow:1,style:2,width:6},AA)}}function yA(i){ce(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 Ur(i){var v,y;let t,e,n,o,s,r,a,l,c,u,h,d,f,g,A;e=new nt({props:{visible:i[6],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}});let p=i[6]&&qr(i);return c=new pl({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=(v=i[5])==null?void 0:v.length)!=null?y:10,15),useLinearColor:!0}}),{c(){t=z("div"),K(e.$$.fragment),n=$(),o=z("div"),s=z("div"),r=z("div"),p&&p.c(),a=$(),l=z("div"),K(c.$$.fragment),h=$(),K(d.$$.fragment),b(r,"class","audio-icon svelte-1s6gk4a"),xe(()=>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"),q(t,"unfolded",i[6])},m(w,P){T(w,t,P),J(e,t,null),B(t,n),B(t,o),B(o,s),B(s,r),p&&p.m(r,null),B(s,a),B(s,l),J(c,l,null),u=tt(l,i[11].bind(l)),B(t,h),J(d,t,null),f=!0,g||(A=we(l,"click",i[7]),g=!0)},p(w,P){var x,Q;const k={};P&64&&(k.visible=w[6]),P&8&&(k.left=w[3]/2+"px"),e.$set(k),w[6]?p?(p.p(w,P),P&64&&E(p,1)):(p=qr(w),p.c(),E(p,1),p.m(r,null)):p&&(se(),D(p,1,1,()=>{p=null}),re());const C={};P&64&&(C.visible=w[6]),P&2&&(C.textUnfolded=w[1]),P&32&&(C.content=w[5]),c.$set(C);const S={};P&64&&(S.unfolded=w[6]),P&8&&(S.length=w[3]),P&48&&(S.outDelay=w[4]+20*Math.min((Q=(x=w[5])==null?void 0:x.length)!=null?Q:10,15)),d.$set(S),(!f||P&64)&&q(t,"unfolded",w[6])},i(w){f||(E(e.$$.fragment,w),E(p),E(c.$$.fragment,w),E(d.$$.fragment,w),f=!0)},o(w){D(e.$$.fragment,w),D(p),D(c.$$.fragment,w),D(d.$$.fragment,w),f=!1},d(w){w&&M(t),Z(e),p&&p.d(),Z(c),u(),Z(d),g=!1,A()}}}function qr(i){let t,e,n,o,s,r,a;return e=new nt({props:{center:!0,blurRadius:15,spreadRadius:6}}),o=new kl({props:{enable:i[6],url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[wA]},$$scope:{ctx:i}}}),o.$on("play",i[8]),o.$on("pause",i[9]),o.$on("audioRef",i[10]),{c(){t=z("div"),K(e.$$.fragment),n=$(),K(o.$$.fragment),b(t,"class","audio svelte-1s6gk4a")},m(l,c){T(l,t,c),J(e,t,null),B(t,n),J(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||(E(e.$$.fragment,l),E(o.$$.fragment,l),l&&xe(()=>{r&&r.end(1),s=Tt(t,Mt,{duration:1e3,delay:0,easing:_t}),s.start()}),a=!0)},o(l){var c,u;D(e.$$.fragment,l),D(o.$$.fragment,l),s&&s.invalidate(),l&&(r=nn(t,Mt,{duration:1e3,delay:20*Math.min((u=(c=i[5])==null?void 0:c.length)!=null?u:10,15),easing:_t})),a=!1},d(l){l&&M(t),Z(e),Z(o),l&&r&&r.end()}}}function wA(i){let t,e,n;return e=new xl({props:{playing:i[2]}}),{c(){t=z("div"),K(e.$$.fragment),b(t,"class","audio-icon__wrapper svelte-1s6gk4a")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s&4&&(r.playing=o[2]),e.$set(r)},i(o){n||(E(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function CA(i){let t,e,n=i[0].state&&Ur(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&&E(n,1)):(n=Ur(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function PA(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(A){wn.call(this,i,A)}function g(){c=this.clientWidth,e(3,c)}return i.$$set=A=>{"tag"in A&&e(0,r=A.tag)},i.$$.update=()=>{var A,p,v;i.$$.dirty&1&&e(6,n=!!((A=r.state)!=null&&A.unfolded)),i.$$.dirty&1&&e(5,o=(v=(p=r.data.title)!=null?p:r.data.text)!=null?v:""),i.$$.dirty&2&&e(4,s=a?450:0)},[r,a,l,c,s,o,n,u,h,d,f,g]}class EA extends oe{constructor(t){super(),ie(this,t,PA,CA,ne,{tag:0},yA)}}function IA(i){ce(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 Jr(i){let t,e,n,o;return n=new kl({props:{style:"width: max-content; height: max-content;",enable:i[0].state.visible,url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[xA]},$$scope:{ctx:i}}}),n.$on("play",i[8]),n.$on("pause",i[9]),n.$on("timeupdate",i[10]),n.$on("duration",i[11]),n.$on("audioRef",i[12]),{c(){t=z("div"),e=z("div"),K(n.$$.fragment),b(e,"class","audio-tag svelte-58hfjf"),L(e,"background-color",i[5]),L(e,"color",i[4]),b(t,"class","audio-tag__wrapper svelte-58hfjf")},m(s,r){T(s,t,r),B(t,e),J(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&8264&&(a.$$scope={dirty:r,ctx:s}),n.$set(a),r&32&&L(e,"background-color",s[5]),r&16&&L(e,"color",s[4])},i(s){o||(E(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&M(t),Z(n)}}}function kA(i){let t;return{c(){t=ke(i[6])},m(e,n){T(e,t,n)},p(e,n){n&64&&Me(t,e[6])},d(e){e&&M(t)}}}function xA(i){let t,e,n,o,s,r,a;return n=new xl({props:{playing:i[3]}}),r=new Ao({props:{maxWidth:72,$$slots:{default:[kA]},$$scope:{ctx:i}}}),{c(){t=z("div"),e=z("div"),K(n.$$.fragment),o=$(),s=z("div"),K(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),B(t,e),J(n,e,null),B(t,o),B(t,s),J(r,s,null),a=!0},p(l,c){const u={};c&8&&(u.playing=l[3]),n.$set(u);const h={};c&8256&&(h.$$scope={dirty:c,ctx:l}),r.$set(h)},i(l){a||(E(n.$$.fragment,l),E(r.$$.fragment,l),a=!0)},o(l){D(n.$$.fragment,l),D(r.$$.fragment,l),a=!1},d(l){l&&M(t),Z(n),Z(r)}}}function DA(i){let t,e,n=i[0].state&&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[0].state?n?(n.p(o,s),s&1&&E(n,1)):(n=Jr(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function LA(i,t,e){let n,o,s,r,{tag:a}=t,l=0,c=0,u=!1;const h=()=>{e(3,u=!0)},d=()=>{e(3,u=!1)},f=p=>{e(1,l=p.detail)},g=p=>{e(2,c=p.detail)};function A(p){wn.call(this,i,p)}return i.$$set=p=>{"tag"in p&&e(0,a=p.tag)},i.$$.update=()=>{var p,v,y;i.$$.dirty&1&&e(6,n=(v=(p=a.data.title)!=null?p:a.data.text)!=null?v:""),i.$$.dirty&1&&e(7,o=(y=a.data.theme)!=null?y:"light"),i.$$.dirty&128&&e(5,s=(()=>{if(o==="dark")return"rgba(0, 0, 0, 0.3)";if(o==="light")return"rgba(255, 255, 255, 0.3)"})()),i.$$.dirty&128&&e(4,r=(()=>{if(o==="dark")return"white";if(o==="light")return"rgba(0, 0, 0, 0.6)"})())},[a,l,c,u,r,s,n,o,h,d,f,g,A]}class SA extends oe{constructor(t){super(),ie(this,t,LA,DA,ne,{tag:0},IA)}}function MA(i){let t,e;return t=new SA({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function TA(i){let t,e;return t=new EA({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function zA(i){let t,e,n,o;const s=[TA,MA],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&&(se(),D(r[u],1,1,()=>{r[u]=null}),re()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),E(e,1),e.m(n.parentNode,n)):e=null)},i(l){o||(E(e),o=!0)},o(l){D(e),o=!1},d(l){~t&&r[t].d(l),l&&M(n)}}}function BA(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 jA extends oe{constructor(t){super(),ie(this,t,BA,zA,ne,{tag:0})}}function VA(i){ce(i,"svelte-10cw0el",".media-wrapper.svelte-10cw0el{position:absolute;width:100%;height:100%}")}function Zr(i){var o;let t,e,n;return e=new yl({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"),K(e.$$.fragment),b(t,"class","media-wrapper svelte-10cw0el")},m(s,r){T(s,t,r),J(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||(E(e.$$.fragment,s),n=!0)},o(s){D(e.$$.fragment,s),n=!1},d(s){s&&M(t),Z(e)}}}function QA(i){let t,e,n=i[0].state&&i[5]&&Zr(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&&E(n,1)):(n=Zr(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function RA(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 OA extends oe{constructor(t){super(),ie(this,t,RA,QA,ne,{tag:0},VA)}}function FA(i){return H(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 HA(i){return H(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 FA(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 GA(i){ce(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 Kr(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 $r(i){let t,e,n,o=i[2]&&ea();function s(l,c){return l[3]?NA:WA}let r=s(i),a=r(i);return{c(){t=z("div"),o&&o.c(),e=$(),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),B(t,e),a.m(t,null),n=!0},p(l,c){l[2]?o?c&4&&E(o,1):(o=ea(),o.c(),E(o,1),o.m(t,e)):o&&(se(),D(o,1,1,()=>{o=null}),re()),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||(E(o),n=!0)},o(l){D(o),n=!1},d(l){l&&M(t),o&&o.d(),a.d()}}}function ea(i){let t,e;return t=new nt({props:{center:!0,blurRadius:24,spreadRadius:16}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function WA(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 NA(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:YA,then:XA,catch:_A,value:14};return Bo(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]))&&Bo(e,n)||_c(n,i,s)},d(o){o&&M(t),n.block.d(o),n.token=null,n=null}}}function _A(i){return{c:Y,m:Y,p:Y,d:Y}}function XA(i){Kr(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),B(t,e),B(e,n)},p(r,a){Kr(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 YA(i){return{c:Y,m:Y,p:Y,d:Y}}function UA(i){let t,e,n=i[1]&&$r(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&&E(n,1)):(n=$r(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function qA(i,t,e){let n,{width:o=null}=t,{icon:s=null}=t,{shadow:r=!1}=t;const a=ai();function l(c){return H(this,null,function*(){const u=yield HA(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 Dl extends oe{constructor(t){super(),ie(this,t,qA,UA,ne,{width:0,icon:1,shadow:2},GA)}}function JA(i){ce(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 ta(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"),K(e.$$.fragment),n=$(),o=z("div"),s=ke(i[2]),b(o,"class","text svelte-e58ijk"),b(t,"class","text-wrapper svelte-e58ijk")},m(a,l){T(a,t,l),J(e,t,null),B(t,n),B(t,o),B(o,s),r=!0},p(a,l){(!r||l&4)&&Me(s,a[2])},i(a){r||(E(e.$$.fragment,a),r=!0)},o(a){D(e.$$.fragment,a),r=!1},d(a){a&&M(t),Z(e)}}}function ZA(i){let t,e,n,o;e=new Dl({props:{icon:i[1],shadow:!0}}),e.$on("iconLoaded",i[9]);let s=i[2]&&i[0]&&ta(i);return{c(){t=z("div"),K(e.$$.fragment),n=$(),s&&s.c(),b(t,"class","wrapper svelte-e58ijk")},m(r,a){T(r,t,a),J(e,t,null),B(t,n),s&&s.m(t,null),o=!0},p(r,[a]){const l={};a&2&&(l.icon=r[1]),e.$set(l),r[2]&&r[0]?s?(s.p(r,a),a&5&&E(s,1)):(s=ta(r),s.c(),E(s,1),s.m(t,null)):s&&(se(),D(s,1,1,()=>{s=null}),re())},i(r){o||(E(e.$$.fragment,r),E(s),o=!0)},o(r){D(e.$$.fragment,r),D(s),o=!1},d(r){r&&M(t),Z(e),s&&s.d()}}}function KA(i,t,e){let n,o,s,r,a,l,c,u,{tag:h}=t;Ue(()=>{n===!1&&e(0,n=(s==null?void 0:s.steps)<2)});const d=()=>{e(0,n=!0)};return i.$$set=f=>{"tag"in f&&e(3,h=f.tag)},i.$$.update=()=>{var f,g;i.$$.dirty&8&&e(2,o=(f=h.data.title)!=null?f:h.data.text),i.$$.dirty&8&&e(4,s=(g=h.data.icon)!=null?g:h.style.point),i.$$.dirty&16&&e(8,r=s.url),i.$$.dirty&16&&e(7,a=s.steps),i.$$.dirty&16&&e(6,l=s.fps),i.$$.dirty&16&&e(5,c=s.ratio),i.$$.dirty&480&&e(1,u={url:r,steps:a,fps:l,ratio:c})},e(0,n=!1),[n,u,o,h,s,c,l,a,r,d]}class $A extends oe{constructor(t){super(),ie(this,t,KA,ZA,ne,{tag:3},JA)}}function ev(i){ce(i,"svelte-kzl2aj",".customElement__container.svelte-kzl2aj{position:relative}")}function na(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 tv(i){let t,e=typeof i[0].element=="string"&&na(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=na(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 nv(i,t,e){let{tag:n}=t,o,s;Ue(()=>{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)}}}),Pt(()=>{s==null||s()});function r(a){Qe[a?"unshift":"push"](()=>{o=a,e(1,o)})}return i.$$set=a=>{"tag"in a&&e(0,n=a.tag)},[n,o,r]}class iv extends oe{constructor(t){super(),ie(this,t,nv,tv,ne,{tag:0},ev)}}function ov(i){ce(i,"svelte-1r4fqvg",'@font-face{font-family:"TG-TYPE";font-style:normal;font-weight:400;src:local("TG-TYPE-Bold"), url(data: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oz7jBUmCh8kCq1vqGkeDvtdi/cS94wjCvwKBCIKDiD3ru8BvPeuA7z4EhUn967vBw4eoDf/DAmLDAv47BT4exWcEwAHAQFBXW97ipCarPcv8+7yAfdl8gP4aPf6FfIjB+r3gwUiBi77gwWHBjH3gwUkBuP7gwUnJPcxKPsxI/cx+y/y9y/3MPP7MO4GDvtdi/cSJQr3JBZkcqOzsKSksrCkcWdlcnFmHw6up6eurm+naGhvb2hop2+uHwv3EiUK9yP4ChUiCgt3SgWxBrnmBZGVj5eZGgsB2/cSAwtobm5paqBzqoYLAAABAAAAAAAAAAAAAA==) format("woff2")}*{-webkit-tap-highlight-color:transparent}.content__container.svelte-1r4fqvg{position:relative;left:50%;top:50%;transform:translate(-50%, -50%);font-family:PingFangSC, Segoe UI, Rototo, sans-serif}.content__container.withAnimation.svelte-1r4fqvg{transition:opacity 0.3s linear}.content__container.unClickable.svelte-1r4fqvg{pointer-events:none !important}.content__container.unClickable.svelte-1r4fqvg *{pointer-events:none !important}.content__wrapper.svelte-1r4fqvg{pointer-events:none;width:100%;height:100%}.content__container.hide.svelte-1r4fqvg{opacity:0;pointer-events:none}.content__container.hide.svelte-1r4fqvg *{pointer-events:none !important}.content__container.disable.svelte-1r4fqvg{display:none}.content.svelte-1r4fqvg{position:relative;width:100%;height:100%;font-size:0.75rem;color:#fff}.content.svelte-1r4fqvg:not(.unfolded){pointer-events:none}.content.svelte-1r4fqvg:not(.unfolded) *{pointer-events:none !important}.content.unfolded.svelte-1r4fqvg{pointer-events:auto}')}function sv(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 rv(i){let t,e,n,o,s,r,a,l,c;const u=[fv,hv,dv,uv,cv,lv,av],h=[];function d(f,g){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"||f[1].contentType==="Sticker"?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-1r4fqvg"),q(n,"unfolded",(f=i[1].state)==null?void 0:f.unfolded),b(e,"class","content__wrapper svelte-1r4fqvg"),b(t,"class","content__container svelte-1r4fqvg"),b(t,"data-id",r=i[1].id),q(t,"disable",i[1].enabled===!1),q(t,"hide",i[4]),q(t,"withAnimation",i[0]),q(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,g){T(f,t,g),B(t,e),B(e,n),~o&&h[o].m(n,null),a=!0,l||(c=we(t,"click",Pa(i[13])),l=!0)},p(f,g){var p;let A=o;o=d(f),o===A?~o&&h[o].p(f,g):(s&&(se(),D(h[A],1,1,()=>{h[A]=null}),re()),~o?(s=h[o],s?s.p(f,g):(s=h[o]=u[o](f),s.c()),E(s,1),s.m(n,null)):s=null),(!a||g&2)&&q(n,"unfolded",(p=f[1].state)==null?void 0:p.unfolded),(!a||g&2&&r!==(r=f[1].id))&&b(t,"data-id",r),(!a||g&2)&&q(t,"disable",f[1].enabled===!1),(!a||g&16)&&q(t,"hide",f[4]),(!a||g&1)&&q(t,"withAnimation",f[0]),(!a||g&2)&&q(t,"unClickable",f[1].clickable===!1),g&2&&L(t,"width",f[1].stickType==="Plane"||f[1].contentType==="MediaModel"?"100%":0),g&2&&L(t,"height",f[1].stickType==="Plane"||f[1].contentType==="MediaModel"?"100%":0)},i(f){a||(E(s),a=!0)},o(f){D(s),a=!1},d(f){f&&M(t),~o&&h[o].d(),l=!1,c()}}}function av(i){let t,e;return t=new OA({props:{tag:Oe(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Oe(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function lv(i){let t,e;return t=new $A({props:{tag:Oe(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Oe(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function cv(i){let t,e;return t=new uA({props:{tag:Oe(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Oe(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function uv(i){let t,e;return t=new jA({props:{tag:Oe(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Oe(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function dv(i){let t,e;return t=new Y0({props:{tag:Oe(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Oe(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function hv(i){let t,e;return t=new hg({props:{tag:Oe(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Oe(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function fv(i){let t,e;return t=new iv({props:{tag:Oe(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Oe(n[1])),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function mv(i){let t,e,n,o;const s=[rv,sv],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):(se(),D(r[u],1,1,()=>{r[u]=null}),re(),e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),E(e,1),e.m(n.parentNode,n))},i(l){o||(E(e),o=!0)},o(l){D(e),o=!1},d(l){r[t].d(l),l&&M(n)}}}function pv(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:g}=t;Hi("hooks",h),Hi("mediaStore",f);let A,p;function v(P){P?h.emit("exposure",{id:r,type:"start"}):h.emit("exposure",{id:r,type:"end"})}function y(P,k,C){var S,x;return!(!k.visible||!k.enabled||!C.visible||!((S=P.state)!=null&&S.visible)||((x=P.temporaryState)==null?void 0:x.visible)===!1||He(P)&&!P.mediaVisible)}const w=P=>h.emit("click",{event:P,target:"TagContent",tag:u});return i.$$set=P=>{"withAnimation"in P&&e(0,c=P.withAnimation),"tag"in P&&e(1,u=P.tag),"hooks"in P&&e(2,h=P.hooks),"state"in P&&e(5,d=P.state),"mediaStore"in P&&e(6,f=P.mediaStore),"temporaryState"in P&&e(7,g=P.temporaryState)},i.$$.update=()=>{var P,k,C,S,x,Q,_,O,U,j,F;i.$$.dirty&2&&e(11,n=(P=u.state)==null?void 0:P.unfolded),i.$$.dirty&2&&e(10,o=(k=u.state)==null?void 0:k.visible),i.$$.dirty&162&&e(12,s=d.visible&&g.visible&&((C=u.state)==null?void 0:C.visible)),i.$$.dirty&2&&(r=u.id),i.$$.dirty&162&&e(4,a=!y(u,d,g)),i.$$.dirty&4096&&v(s),i.$$.dirty&3842&&u.hooks&&(n!==void 0&&n!==p&&(e(9,p=n),n?(x=(S=u.hooks).emit)==null||x.call(S,"unfolded"):(_=u==null?void 0:(Q=u.hooks).emit)==null||_.call(Q,"folded")),o!==void 0&&o!==A&&(e(8,A=o),o?(U=(O=u.hooks).emit)==null||U.call(O,"show"):(F=(j=u.hooks).emit)==null||F.call(j,"hide"))),i.$$.dirty&2&&e(3,l=(()=>!(typeof u.mergedConfig.unfoldedConfig=="object"&&u.mergedConfig.unfoldedConfig.keep==="folded"))())},[c,u,h,l,a,d,f,g,A,p,o,n,s,w]}class Ll extends oe{constructor(t){super(),ie(this,t,pv,mv,ne,{withAnimation:0,tag:1,hooks:2,state:5,mediaStore:6,temporaryState:7},ov)}}function gv(i){ce(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 Av(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 Dl({props:{icon:i[2],width:i[1]}}),{c(){t=z("div"),e=$(),n=z("div"),K(o.$$.fragment),s=$(),r=z("div"),a=$(),l=z("div"),K(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"),q(n,"unfolded",i[0]),q(n,"folded",i[3]),L(n,"width",Ie(i[1])),L(n,"height",Ie(i[1]))},m(f,g){T(f,t,g),T(f,e,g),T(f,n,g),J(o,n,null),B(n,s),B(n,r),B(n,a),B(n,l),J(c,l,null),u=!0,h||(d=we(t,"click",i[4]),h=!0)},p(f,[g]){g&8&&L(r,"transition-delay",(f[3]?f[5]:0)+"ms");const A={};g&4&&(A.icon=f[2]),g&2&&(A.width=f[1]),c.$set(A),g&8&&L(l,"transition-delay",(f[3]?f[5]:0)+"ms"),(!u||g&1)&&q(n,"unfolded",f[0]),(!u||g&8)&&q(n,"folded",f[3]),g&2&&L(n,"width",Ie(f[1])),g&2&&L(n,"height",Ie(f[1]))},i(f){u||(E(o.$$.fragment,f),E(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),Z(o),Z(c),h=!1,d()}}}function vv(i,t,e){let n,o,s,r;const a=St("hooks");let{tag:l}=t,c,u=!1;const h=()=>{c!==void 0&&clearTimeout(c),u=!0,c=setTimeout(()=>{u=!1},800)},d=g=>{u||a.emit("click",{event:g,target:"TagPoint",tag:l})},f=(()=>l.contentType==="Text"&&l.data.appearance==="plane"?500:800)();return i.$$set=g=>{"tag"in g&&e(6,l=g.tag)},i.$$.update=()=>{var g,A,p,v;i.$$.dirty&64&&e(0,n=(g=l.state)==null?void 0:g.unfolded),i.$$.dirty&1&&e(3,o=!n),i.$$.dirty&64&&e(2,s=(p=(A=l.style)==null?void 0:A.point)!=null&&p.url?(v=l.style)==null?void 0:v.point:{url:Op}),i.$$.dirty&64&&e(1,r=(()=>{var w,P,k;const y=(k=(P=(w=l.style)==null?void 0:w.point)==null?void 0:P.size)!=null?k:"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 bv extends oe{constructor(t){super(),ie(this,t,vv,Av,ne,{tag:6},gv)}}function yv(i){ce(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 wv(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 Cv(i){let t,e;return t=new Ll({props:{mediaStore:i[2],withAnimation:i[0],tag:Oe(i[1]),hooks:i[14],state:i[3],temporaryState:i[4]}}),{c(){K(t.$$.fragment)},m(n,o){J(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=Oe(n[1])),o&8&&(s.state=n[3]),o&16&&(s.temporaryState=n[4]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Pv(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 Ev(i){let t,e;return t=new bv({props:{tag:i[1]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=n[1]),t.$set(s)},i(n){e||(E(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Iv(i){let t,e,n,o,s,r,a,l,c;const u=[Cv,wv],h=[];function d(p,v){return p[12]?0:1}n=d(i),o=h[n]=u[n](i);const f=[Ev,Pv],g=[];function A(p,v){return p[13]?0:1}return r=A(i),a=g[r]=f[r](i),{c(){t=z("div"),e=z("div"),o.c(),s=$(),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]),q(t,"unClickable",i[1].clickable===!1),q(t,"disable",i[10]),q(t,"hide",i[9]),q(t,"withAnimation",i[0])},m(p,v){T(p,t,v),B(t,e),h[n].m(e,null),B(e,s),g[r].m(e,null),c=!0},p(p,[v]){let y=n;n=d(p),n===y?h[n].p(p,v):(se(),D(h[y],1,1,()=>{h[y]=null}),re(),o=h[n],o?o.p(p,v):(o=h[n]=u[n](p),o.c()),E(o,1),o.m(e,s));let w=r;r=A(p),r===w?g[r].p(p,v):(se(),D(g[w],1,1,()=>{g[w]=null}),re(),a=g[r],a?a.p(p,v):(a=g[r]=f[r](p),a.c()),E(a,1),a.m(e,null)),(!c||v&256)&&b(e,"data-tag-unfolded",p[8]),(!c||v&2048)&&b(e,"data-tag-id",p[11]),(!c||v&2&&l!==(l=p[1].contentType))&&b(e,"data-content-type",l),v&128&&L(e,"left",p[7]),v&64&&L(e,"top",p[6]),v&32&&L(e,"z-index",p[5]),(!c||v&2048)&&b(t,"data-tag-id",p[11]),(!c||v&2)&&q(t,"unClickable",p[1].clickable===!1),(!c||v&1024)&&q(t,"disable",p[10]),(!c||v&512)&&q(t,"hide",p[9]),(!c||v&1)&&q(t,"withAnimation",p[0])},i(p){c||(E(o),E(a),c=!0)},o(p){D(o),D(a),c=!1},d(p){p&&M(t),h[n].d(),g[r].d()}}}function kv(i,t,e){let n,o,s,r,a,l,c,u,h,{withAnimation:d=!1}=t,{tag:f}=t,{mediaStore:g}=t,{state:A}=t,{temporaryState:p}=t;const v=St("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,g=y.mediaStore),"state"in y&&e(3,A=y.state),"temporaryState"in y&&e(4,p=y.temporaryState)},i.$$.update=()=>{var y,w,P,k,C,S,x,Q;i.$$.dirty&2&&e(13,n=(()=>!(f.contentType==="Sticker"||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=!((P=f.state)!=null&&P.visible)||((k=f.temporaryState)==null?void 0:k.visible)===!1),i.$$.dirty&2&&e(8,l=(C=f.state)==null?void 0:C.unfolded),i.$$.dirty&2&&e(7,c=((S=f.pointTagStyle)==null?void 0:S.leftPercent)+"%"),i.$$.dirty&2&&e(6,u=((x=f.pointTagStyle)==null?void 0:x.topPercent)+"%"),i.$$.dirty&2&&e(5,h=(Q=f.state)!=null&&Q.unfolded?1:0)},[d,f,g,A,p,h,u,c,l,a,r,s,o,n,v]}class xv extends oe{constructor(t){super(),ie(this,t,kv,Iv,ne,{withAnimation:0,tag:1,mediaStore:2,state:3,temporaryState:4},yv)}}function Dv(i){ce(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 ia(i,t,e){const n=i.slice();return n[6]=t[e],n}function oa(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=ia(i,s,a),c=r(l);n.set(c,e[a]=sa(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"),q(t,"hide",!i[3].visible||!i[4].visible),q(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],se(),e=qe(e,l,r,1,a,s,n,t,Et,sa,null,ia),re()),(!o||l&24)&&q(t,"hide",!a[3].visible||!a[4].visible),(!o||l&1)&&q(t,"withAnimation",a[0])},i(a){if(!o){for(let l=0;l<s.length;l+=1)E(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 sa(i,t){let e,n,o;return n=new xv({props:{state:t[3],temporaryState:t[4],withAnimation:t[0],tag:t[6],mediaStore:t[2]}}),{key:i,first:null,c(){e=fe(),K(n.$$.fragment),this.first=e},m(s,r){T(s,e,r),J(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||(E(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&M(e),Z(n,s)}}}function Lv(i){let t,e,n=i[3].enabled&&oa(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&&E(n,1)):(n=oa(o),n.c(),E(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(E(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Sv(i,t,e){let{withAnimation:n=!1}=t,{tags:o=[]}=t,{hooks:s}=t,{mediaStore:r}=t,{state:a}=t,{temporaryState:l}=t;return Hi("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 Mv extends oe{constructor(t){super(),ie(this,t,Sv,Lv,ne,{withAnimation:0,tags:1,hooks:5,mediaStore:2,state:3,temporaryState:4},Dv)}}const Tv={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 zv extends Cn{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 Bv extends zv{constructor(e){super(e);m(this,"tags",[]);m(this,"config",Tv);m(this,"raycaster",new I.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]=ht.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(He(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"&&an(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),g=this.getTagEnableByIntersect(e,f);if(g.value===!1)return g}if(l.angleRange&&Ip(e)){const f=this.getAngle(e);if(an(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=He(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&&an(c,r.unfoldDistance)===!1)return!1})();s.unfolded=a;const l=this.getUnfoldedByCamera(e);return l!==void 0?l:s.unfolded}}getUnfoldedByCamera(e){return this.getVisibleByPanoIndex(e)?(()=>{var a;const s=this.getDistance(e),r=this.getTagConfig(e).unfoldedConfig;if(!!r){if(typeof r=="function")return r(this.five,{tag:e,distance:s});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.autoUnfold===void 0||r.autoUnfold===!1||r.autoUnfold.enable===!1||!r.autoUnfold.strategy)return;if(r.autoUnfold.strategy==="ScreenPostion"){const l=this.getTagProject(e);if(l&&an(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:g,y:A,z:p}=f;return!(Math.abs(p)>1||Math.abs(g)>1||Math.abs(A)>1)}).map(d=>({tag:d,id:d.id,tagConfig:this.getTagConfig(d).unfoldedConfig})).filter(({tag:d,tagConfig:f})=>{var g,A;return!(typeof f!="object"||f.keep||f.autoUnfold===!1||((g=f.autoUnfold)==null?void 0:g.enable)===!1||((A=f.autoUnfold)==null?void 0:A.strategy)!=="MinimumDistance")}).map(d=>me(R({},d),{distance:this.getDistance(d.tag)})).filter(({distance:d,tagConfig:f})=>{var g,A;return!(d===void 0||typeof f!="object"||f.autoUnfold===!1||((g=f.autoUnfold)==null?void 0:g.enable)===!1||((A=f.autoUnfold)==null?void 0:A.strategy)!=="MinimumDistance"||f.autoUnfold.distance&&an(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=Zs(e);if(!u)return-1;const 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"?gn(e.normal):qi(e.position))();if(!u)return;const h=new I.Vector3().copy(c).sub(Ji(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=ht.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)})}setModelMedialVisible(){const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{var s;if(!He(n))return;if(!((s=n.model)!=null&&s.object)){n.mediaVisible=!1;return}const o=e==="Panorama"?this.getModelMedialVisibleByPanoIndex(n):!0;n.mediaVisible=o})}setUnfoldedByPanoIndex(){this.tags.forEach(e=>{const n=this.getUnfoldedByPanoIndex(e);if(!!e.state&&(n!==void 0&&(e.state.unfolded=n),n&&!e.state.visible)){const o=this.getTagConfig(e);typeof o.unfoldedConfig=="object"&&o.unfoldedConfig.autoUnfoldWhenHide!==!1&&(e.state.unfolded=!1)}})}getTagProject(e){if(!this.getVisibleByPanoIndex(e)||!e.position)return;const o=Ji(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").filter(e=>e.position)}filter2DPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint").filter(e=>e.position)}filter3DPointTag(){return this.tags.filter(e=>e.stickType==="3DPoint").filter(e=>e.position)}filterModelTag(){return this.tags.filter(e=>e.stickType==="Model")}filter3DTag(){return this.tags.filter(e=>e.stickType==="3DPoint"||e.stickType==="Plane"||e.stickType==="Model")}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(!He(e))return;const f=this.tags.filter(He).map(A=>{var p;return(p=A.model)==null?void 0:p.object}).filter(yt);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==null?void 0: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=Zs(e).sub(o).normalize();return this.raycaster.set(o,s),this.raycaster}}function jv(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 Vv=new Kl.GLTFLoader;function Qv(i){return new Promise((t,e)=>{function n(s){t(s)}function o(s){e(s)}Vv.load(i,n,void 0,o)})}const Sl="3.0.0",$i=`DnalogelPlugin-PanoTagPlugin@${Sl}`,Rv=!1,Ov=i=>`${$i}--${i}`;class Ml extends Bv{constructor(e,n){super(e);m(this,"version",Sl);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 V.Group);m(this,"gltfObjectGroup",new V.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)=>H(this,null,function*(){e.data=ht.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=>{He(n)&&e==="Panorama"&&this.changeTagMode(n,"front"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags(),this.updateRenderAllTags()});m(this,"handleFiveModelShownFloorChange",()=>{this.tags.forEach(e=>{!He(e)||(e.state.visible=this.getVisible(e))}),this.updateRenderAllTags()});m(this,"loadModel",e=>H(this,null,function*(){var l;const n=e.data.modelUrl;if(!n)return;const o=Qv(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 V.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=R({debug:!1,config:this.config},n),this.debug=this.params.debug,this.config=this.params.config,Xr(1,{namespace:si.GetAudioDuration}),Xr(1,{namespace:si.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 H(this,null,function*(){var s,r;this.clearTags(),console.info($i," load:",{data:JSON.parse(JSON.stringify(e))}),this.config=ht.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{Ep(this.five,this.tags)}catch(a){console.error(a)}return o})}addTag(e,n){return H(this,null,function*(){const s=(Array.isArray(e)?e:[e]).map(r=>{const a=this.getTagConfig(r);return me(R({},r),{state:R({visible:void 0,unfolded:Rv},a.initialState),hooks:new Ce.Subscribe,clickable:a.clickable,mergedConfig:a})}).filter(r=>r.position);return s.forEach(jv),this.tags.push(...s),kp(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=ht.default({},this.config,e):this.config=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeGlobalConfig(e,n=!0){n?this.config.globalConfig=ht.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 H(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 H(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=R({},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=ft(n),this.updateRenderPlaneTag())}changeDataById(e,n,o=!0){const s=this.getTagById(e);!s||(o?s.data=ht.default({},s.data,n):s.data=R(R({},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?ht.default(s,n):Object.assign(s,n),(s==null?void 0:s.tag3DContentSvelte)&&(n==null?void 0:n.normal)&&(s.tag3DContentSvelte.currentNormal=ft(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 A,p,v,y;const o=(v=(p=(A=e.mergedConfig)==null?void 0:A.tag3DConfig)==null?void 0:p.ratio)!=null?v:.00216,s=(y=e.tag3DContentSvelte)==null?void 0:y.domContainer.css3DObject;if(!s)return;const r=He(e)?e.data.mediaPosition:e.position;n.updateWorldMatrix(!1,!1);const a=n.matrixWorld,l=new V.Vector3().fromArray(r[0]),c=new V.Vector3().fromArray(r[2]),u=new V.Vector3().lerpVectors(l,c,.5).add(new V.Vector3(0,0,5e-4)),h=new V.Matrix4().setPosition(u),d=new V.Matrix4().makeScale(o,o,o),f=new V.Matrix4().multiply(a).multiply(h).multiply(d);f.decompose(s.position,s.quaternion,s.scale);const g=s.opacityMesh;!g||f.decompose(g.position,g.quaternion,g.scale)}updateTagCss3DObjectVisible(e){var n,o,s,r,a;(a=(o=(n=e.tag3DContentSvelte)==null?void 0:n.domContainer)==null?void 0:o.css3DObject)==null||a.setVisible(this.state.visible&&((r=(s=e.state)==null?void 0:s.visible)!=null?r:!0)),this.five.needsRender=!0}setVisibleAndUnfolded(){return H(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.group.visible=!0,this.updateTagContainerVisible(),this.five.needsRender=!0}handleHide(){this.pauseCurrentMedia(),this.state.visible=!1,this.group.visible=!1,this.updateTagContainerVisible(),this.five.needsRender=!0}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}=$s(Dp(()=>{!this.store.resizeObserverDisposer||o()},500),e),{observe:a,unobserve:l}=$s(Ks(()=>n(),400),e);return s(),a(),()=>{r(),l()}}handleFiveModeChange(e){this.setModelMedialVisible(),this.tags.forEach(n=>{He(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(R({},e.temporaryState),{visible:n.visibleConfig.keep==="visible"}):e.temporaryState=me(R({},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,s,r,a;(r=(s=(o=n.tag3DContentSvelte)==null?void 0:o.domContainer)==null?void 0:s.css3DObject)==null||r.setVisible(this.state.visible),(a=n.tag3DContentSvelte)==null||a.svelteApp.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation})})}handleFiveCameraUpdateDebounce(){return Ks(()=>{this.setUnfoldedByCamera(),this.updateRenderAllTags()},100)}handleFiveCameraUpdate(){this.updateRenderPointTag()}handleFivePanoArrived(){return H(this,null,function*(){this.setModelMedialVisible(),yield this.setVisibleAndUnfolded(),this.tags.forEach(e=>{e.temporaryState=me(R({},e.temporaryState),{visible:!0})}),this.store.visibleWithAnimation=!0,this.updateTagContainerVisible(),this.updateRenderAllTags()})}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 Mv({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(He(n)&&((l=n.model)==null?void 0:l.object)&&this.updateTagCss3DObjectMatrix(n,(c=n.model)==null?void 0:c.object),n.tag3DContentSvelte){const{svelteApp:h,domContainer:d,initialNormal:f,currentNormal:g}=n.tag3DContentSvelte;if(this.updateTagCss3DObjectVisible(n),h.$set({tag:n,hooks:this.hooks,state:this.state,temporaryState:this.temporaryState}),!f.equals(g)){const A=new V.Quaternion().setFromUnitVectors(f,g);d.css3DObject.setRotationFromQuaternion(A)}return}if(((u=n.state)==null?void 0:u.visible)===!1)return;if(this.css3DRenderPlugin||(this.css3DRenderPlugin=Jt(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:He(n)?n.data.mediaPosition:xp(this.five.camera.position,ft(n.position),ft(n.normal)))();if(!o)return;const s=function(){if(n.normal)return ft(n.normal);if(n.stickType==="Plane")return qi(n.position);if(n.contentType==="MediaModel")return qi(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 Ll({target:a.container,props:{tag:n,hooks:this.hooks,state:this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}}),domContainer:a,initialNormal:s,currentNormal:s})}),this.checkPanelTag()}updateRenderModelTag(){const e=o=>!this.enabledModelTagSet.has(o.customID);this.gltfObjectGroup.remove(...this.gltfObjectGroup.children.filter(e)),this.tags.filter(He).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 H(this,null,function*(){const n=e.filter(He).map(this.loadModel);yield Promise.all(n),this.setModelMedialVisible(),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 Fv=(i,t)=>new Ml(i,t);function be(i,t){this._camera=i||null,this._domElement=t||document,this._raycaster=new I.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)}be.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)};be.eventNames=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu","touchstart","touchend"];be.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}};be.prototype._objectCtxInit=function(i){i._3xDomEvent={}};be.prototype._objectCtxDeinit=function(i){delete i._3xDomEvent};be.prototype._objectCtxIsInit=function(i){return!!i._3xDomEvent};be.prototype._objectCtxGet=function(i){return i._3xDomEvent};be.prototype.camera=function(i){return i&&(this._camera=i),this._camera};be.prototype.bind=function(i,t,e,n){console.assert(be.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)};be.prototype.addEventListener=be.prototype.bind;be.prototype.unbind=function(i,t,e,n){console.assert(be.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)};be.prototype.removeEventListener=be.prototype.unbind;be.prototype._bound=function(i,t){var e=this._objectCtxGet(t);return e?!!e[i+"Handlers"]:!1};be.prototype._onMove=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new I.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)}};be.prototype._onEvent=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new I.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)}}};be.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)}};be.prototype._onMouseDown=function(i){return this._onMouseEvent("mousedown",i)};be.prototype._onMouseUp=function(i){return this._onMouseEvent("mouseup",i)};be.prototype._onMouseEvent=function(i,t){var e=this._getRelativeMouseXY(t);this._onEvent(i,e.x,e.y,t)};be.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)};be.prototype._onClick=function(i){this._onMouseEvent("click",i)};be.prototype._onDblClick=function(i){this._onMouseEvent("dblclick",i)};be.prototype._onContextmenu=function(i){this._onMouseEvent("contextmenu",i)};be.prototype._onTouchStart=function(i){return this._onTouchEvent("touchstart",i)};be.prototype._onTouchEnd=function(i){return this._onTouchEvent("touchend",i)};be.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)}};be.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 Tl(i){const t=new I.Box3,e=new I.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 En{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 qt,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 be(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.matrix,t.origin)}onApplyOriginObjectRotate(t){this.applyHelperQuaternion(t.quaternion,t.origin)}onApplyOriginObjectPosition(t){this.applyHelperMatrix4(t.matrix)}onSetOriginObjectScale(t){this.helperObject3D.scale.copy(t),this.updateOffsetByScale(t)}onSetOriginObjectRotate(t,e){this.helperObject3D.setHelperQuaternion(t,e)}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 I.Vector3().subVectors(this.boundingBox.max,e).multiply(t).add(e),o=new I.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(yt),s=[];for(const r of o)if(r instanceof I.Mesh||r instanceof I.Group){const a=r instanceof I.Group?r.children.filter(d=>d instanceof I.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 I.Vector3(0,0,0);if(!t)return o;const s=()=>e||(this.boundingBox?this.boundingBox:(this.boundingBox=Tl(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 Hv extends En{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 I.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())}}function zl(i,t,e){if(e){const o=new I.Vector3().subVectors(i.position,e).applyQuaternion(i.quaternion.clone().inverse()).applyQuaternion(t).add(e);i.position.copy(o)}i.quaternion.copy(t)}class Gv extends V.Object3D{constructor(){super()}add(...t){if(t.length===0)return this;const e=t.filter(Boolean);return super.add(...e)}remove(...t){if(t.length===0)return this;const e=t.filter(Boolean);return super.remove(...e)}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}}class gi extends Gv{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){zl(this,e,n)}applyHelperQuaternion(e,n){if(n){const o=new V.Vector3().subVectors(this.position,n).applyQuaternion(e).add(n);this.position.copy(o)}this.applyQuaternion(e)}dispose(){this.removeFromParent()}}class Wv extends gi{}class Nv extends gi{}class _v extends gi{}class Bl extends gi{}class Xv extends Bl{}class Yv extends I.Group{constructor(e){super();m(this,"direction");this.direction=e||"x"}}class ra extends I.Mesh{constructor(e,n,o){super(e,n);m(this,"direction");this.direction=o||"x"}}function Uv(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return Object.assign(new I.Vector2,{x:(i.x-s)/e*2-1,y:-(i.y-o)/n*2+1})}function wo(i,t,e){if(!t||!e||!i)return;const n=Uv(t,e);if(Math.abs(n.x)===1||Math.abs(n.y)===1)return;const o=new I.Raycaster;return o.setFromCamera(n,i),o}function qv(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 ji extends Yv{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 I.Color((u=e.color)!=null?u:16214315),o=new I.MeshBasicMaterial({color:n,depthTest:!1,opacity:1,transparent:!0,side:I.DoubleSide}),s=new I.ConeGeometry(.04,.1,32),r=new ra(s,o.clone(),e.direction);r.name=`arrow-${e.direction}`,this.arrow=r;const a=.004,l=new I.CylinderGeometry(a,a,.4,32),c=new ra(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 Vi={X:15618642,Y:4765519,Z:4227839};class Wt{static get X(){return new I.Color(Vi.X).convertSRGBToLinear().clone()}static get Y(){return new I.Color(Vi.Y).convertSRGBToLinear().clone()}static get Z(){return new I.Color(Vi.Z).convertSRGBToLinear().clone()}}class Jv extends Wv{constructor(e){super(e);m(this,"xArrow",new ji({direction:"x",color:Wt.X}));m(this,"yArrow",new ji({direction:"y",color:Wt.Y}));m(this,"zArrow",new ji({direction:"z",color:Wt.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 Lt(i,t){return Zv(document.createElement(t!=null?t:"div"),i)}function Zv(i,t){if(!t)return i;for(const e in t)e&&t[e]&&(i.style[e]=t[e]);return i}function Kv(i){const t=Lt(R({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 $v extends _v{constructor(e,n){super(e);m(this,"xCircle");m(this,"yCircle");m(this,"zCircle");m(this,"children",[]);m(this,"angleTips");m(this,"container");(n==null?void 0:n.yzCircleEnable)!==!1&&(this.xCircle=new Qi({direction:"x",color:Wt.X})),(n==null?void 0:n.xzCircleEnable)!==!1&&(this.yCircle=new Qi({direction:"y",color:Wt.Y})),(n==null?void 0:n.xyCircleEnable)!==!1&&(this.zCircle=new Qi({direction:"z",color:Wt.Z})),(n==null?void 0:n.container)&&(n==null?void 0:n.angleTipsEnable)!==!1&&(this.container=n==null?void 0:n.container,this.angleTips=Kv({display:"none"}),this.container.appendChild(this.angleTips.element)),this.add(...[this.xCircle,this.yCircle,this.zCircle].filter(Boolean)),this.show()}hide(){this.children.forEach(e=>e.hide())}show(){var e;this.children.forEach(n=>n.showCircle()),(e=this.angleTips)==null||e.hide()}showDraggingHelper(e){var n;this.hide(),this.children.filter(o=>e.includes(o.direction)).forEach(o=>o.showRing()),(n=this.angleTips)==null||n.show()}dispose(){var e,n;this.removeFromParent(),(n=(e=this.angleTips)==null?void 0:e.element)==null||n.remove()}}class Qi extends I.Group{constructor(e){super();m(this,"direction");m(this,"circle");m(this,"ring");m(this,"angleSector");this.direction=e.direction,this.circle=new eb(e),this.ring=new tb(e),this.angleSector=new nb(e),this.add(this.circle,this.ring,this.angleSector),this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}showCircle(){this.add(this.circle),this.remove(this.ring,this.angleSector)}showRing(){this.add(this.ring,this.angleSector),this.remove(this.circle)}hide(){this.remove(this.ring,this.angleSector,this.circle)}}class eb extends I.Mesh{constructor(e){var n;super();m(this,"direction");m(this,"gapAngle",.02);m(this,"geometry",new I.RingGeometry(.25,.3,20,8,this.gapAngle,Math.PI/2-this.gapAngle*2));this.material=new I.MeshBasicMaterial({opacity:.6,color:(n=e.color)!=null?n:16777215,transparent:!0,side:I.DoubleSide,depthTest:!1}),this.direction=e.direction,this.geometry.name=`RotateHelperCircleGeometry-${this.direction}`}}class tb extends I.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 I.RingGeometry(.25,.3,20,8,Math.PI/4*r+n,Math.PI/4-n*2),l=new I.MeshBasicMaterial({opacity:1,color:16777215,depthTest:!1,transparent:!0,side:I.DoubleSide}),c=new I.Mesh(a,l);return c.name=`AxesDashedRing-${this.direction}-${r}`,c});this.add(...o)}}class nb extends I.Mesh{constructor(e){var o;super();m(this,"direction");m(this,"baseAxes");m(this,"angleDirection");switch(e.direction){case"x":this.baseAxes=new I.Vector3(0,0,1);break;case"y":this.baseAxes=new I.Vector3(1,0,0);break;case"z":this.baseAxes=new I.Vector3(1,0,0);break}const n=.3+5e-4;this.geometry=new I.CircleGeometry(n,48,0,1e-4),this.material=new I.MeshBasicMaterial({opacity:.4,color:(o=e.color)!=null?o:16777215,depthTest:!1,transparent:!0,side:I.DoubleSide}),this.direction=e.direction,this.angleDirection=this.direction==="z"?1:-1}}function ib(){const i=Lt({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=Lt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=Lt({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:dt({cursor:"nesw-resize",left:n,bottom:n})},s={direction:"ns",element:dt({cursor:"ns-resize",bottom:n})},r={direction:"nwse",element:dt({cursor:"nwse-resize",right:n,bottom:n})},a={direction:"ew",element:dt({cursor:"ew-resize",right:n})},l={direction:"nesw",element:dt({cursor:"nesw-resize",right:n,top:n})},c={direction:"ns",element:dt({cursor:"ns-resize",top:n})},u={direction:"nwse",element:dt({cursor:"nwse-resize",left:n,top:n})},h={direction:"ew",element:dt({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 dt(i){const t=Lt(R({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},i)),e=Lt({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),n=Lt({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 ob extends Xv{constructor(e,n,o,s){super(e);m(this,"points",[]);m(this,"cornerPositions",[]);m(this,"css3DInstance");m(this,"plane");m(this,"css3DRenderer",new Nt);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}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 I.Vector3().subVectors(o.position,n).applyQuaternion(e).add(n);o.position.copy(r),o.applyQuaternion(e)}if(this.plane){const r=new I.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 I.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,l;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}=ib();this.points=r.map((c,u)=>({direction:c.direction,point:c.element,position:this.calculatePointPosition(e)[u]})),o.insertBefore(s,(a=o.children[0])!=null?a:null),this.helperObject.position.copy(this.originObject3D.position),(l=this.plane)==null||l.position.copy(this.originObject3D.position)}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 sb extends Nv{constructor(e){super(e);m(this,"box");m(this,"outline");m(this,"originObject");m(this,"positionAttribute");this.originObject=e,this.positionAttribute=new I.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=Tl(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 I.BufferGeometry;n.setIndex(new I.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const o=new I.LineBasicMaterial({color:64767,linewidth:1,opacity:1,depthTest:!1,transparent:!0,toneMapped:!1}),s=new I.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 I.BufferGeometry;n.setIndex(new I.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const o=new I.MeshBasicMaterial({color:64767,opacity:.1,depthTest:!1,transparent:!0});return new I.Mesh(n,o)}}class rb extends En{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 I.Vector3(1,0,0).applyQuaternion(this.helperObject3D.quaternion),r=new I.Vector3(0,1,0).applyQuaternion(this.helperObject3D.quaternion),a=new I.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 I.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}dragging(e){if(!this.isDragging||!this.startInfo)return;const n=wo(this.camera,e,this.container);return n?(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 I.Vector3);if(!a)return;const l=a.clone().projectOnVector(o),c=l.clone().sub(s),u=new I.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",{matrix:u}),this.hooks.emit("move",h))}dragEnd(){!this.isDragging||(this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("moveEnd"))}}class ln{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 ab="v1.0.1",lb="Object3DHelper",Co=`${lb}@${ab}`,cb=()=>{console.error(`${Co} is disposed`)},ub=()=>{console.warn(`${Co} is disabled`)},db=()=>{console.error(`${Co} is disabled`)};class hb{constructor(t){m(this,"controllers",{});m(this,"state",{visible:!0,enabled:!0,disposed:!1});m(this,"hooks",new qt);m(this,"eventListener",{});t&&this.addControllers(t),this.setState(this.state)}show(t){return H(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return H(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 cb();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return db();const n=R({},this.state);this.state=R(R({},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=R(R({},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&&ub()}}function Ri(i){return i*Math.PI/180}class fb extends En{constructor(...e){var c,u,h;super(...e);m(this,"name","RotateController");m(this,"startInfo");m(this,"removeListener");const n=this.helperObject3D;this.hoverListener([(c=n.xCircle)==null?void 0:c.circle,(u=n.yCircle)==null?void 0:u.circle,(h=n.zCircle)==null?void 0:h.circle].filter(Boolean));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.applyHelperQuaternion(this.originObject3D.quaternion)}setRotateAngle(e){const{x:n=0,y:o=0,z:s=0}=e,r=new I.Euler(Ri(n),Ri(o),Ri(s)),a=new I.Quaternion().setFromEuler(r);if(this.hooks.emit("wantToRotate",a))return;const{originObject3D:c,rotateCenter:u}=this;zl(c,a,u),this.hooks.emit("setObjectRotate",a,u),this.hooks.emit("rotate",a),this.render()}dispose(){this.removeListener(),super.dispose()}onApplyOriginObjectRotate(e){this.isDragging||super.onApplyOriginObjectRotate(e)}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();const s=n.point,r=this.getAngleHelper(o);this.setTipsAngle(0);const a=s.clone();a.y+=.2,this.setTipsPosition(a);const l=(()=>{if(o==="x")return new I.Vector3(1,0,0).applyQuaternion(this.originObject3D.quaternion);if(o==="y")return new I.Vector3(0,1,0).applyQuaternion(this.originObject3D.quaternion);if(o==="z")return new I.Vector3(0,0,1).applyQuaternion(this.originObject3D.quaternion)})(),c=new I.Plane().setFromNormalAndCoplanarPoint(l,s),h=c.projectPoint(s.clone(),new I.Vector3).clone().sub(this.rotateCenter),d=h.angleTo(r.baseAxes.clone().applyQuaternion(this.originObject3D.quaternion));this.setAngleHelperStart(o,d),this.setAngleHelperLength(o,0),this.startInfo={direction:o,startVector:h,plane:c,angleHelper:r,angle:0,objectQuaternion:this.originObject3D.quaternion.clone()},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("rotateStart"),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const n=wo(this.camera,e,this.container);return n?(this.rotate(n),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:n,plane:o,angleHelper:s,direction:r,objectQuaternion:a}=this.startInfo,{originObject3D:l}=this,c=e.ray.intersectPlane(o,new I.Vector3);if(!c)return;const u=this.rotateCenter.clone(),d=o.projectPoint(c.clone(),new I.Vector3).clone().sub(u);if(n.angleTo(d)===0)return;const f=new I.Quaternion().setFromUnitVectors(n.clone().normalize(),d.clone().normalize()),g=l.quaternion.clone().premultiply(f);if(this.hooks.emit("wantToRotate",g))return;const v=new I.Euler().setFromQuaternion(new I.Quaternion().setFromUnitVectors(n.clone().normalize().applyQuaternion(a.clone().inverse()),d.clone().normalize().applyQuaternion(a.clone().inverse())),`${r.toUpperCase()}${"XZY".replace(r.toUpperCase(),"")}`)[r]*s.angleDirection;if(this.startInfo.angle+=v,this.setAngleHelperLength(r,this.startInfo.angle),this.setTipsAngle(za(this.startInfo.angle)),u){const y=new I.Vector3().subVectors(l.position,u).applyQuaternion(f).add(u);l.position.copy(y)}l.applyQuaternion(f),this.hooks.emit("applyObjectRotate",{quaternion:f,origin:u}),this.hooks.emit("rotate",l.quaternion),this.startInfo.startVector=d}dragEnd(){!this.isDragging||(this.hooks.emit("setObjectRotate",this.originObject3D.quaternion,this.rotateCenter),this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("rotateEnd"))}getAngleHelper(e){var n,o,s;switch(e){case"x":return(n=this.helperObject3D.xCircle)==null?void 0:n.angleSector;case"y":return(o=this.helperObject3D.yCircle)==null?void 0:o.angleSector;case"z":return(s=this.helperObject3D.zCircle)==null?void 0:s.angleSector}}setAngleHelperStart(e,n){const o=this.getAngleHelper(e);if(!o){console.warn("angleHelper is undefined");return}if(o instanceof I.Mesh&&o.geometry instanceof I.CircleGeometry){const{radius:s,segments:r,thetaLength:a}=o.geometry.parameters;o.geometry=new I.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 I.Mesh&&r.geometry instanceof I.CircleGeometry){const{radius:a,thetaStart:l}=r.geometry.parameters,c=Math.ceil(Math.abs(s)*(40/(2*Math.PI)));r.geometry=new I.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 mb extends En{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()}onApplyOriginObjectPosition(e){this.isDragging||super.onApplyOriginObjectPosition(e)}onApplyOriginObjectScale(e){this.helperObject3D.applyHelperScaleMatrix4(e.matrix,e.origin)}getDragPlane(){const e=new I.Plane,n=this.helperObject3D.cornerPositions;if(n.length!==0)return n.length<3?e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new V.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}dragging(e){if(!this.isDragging)return;const n=wo(this.camera,e,this.container);if(!n)return this.dragEnd();this.scale(n)}scale(e){var Q,_;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 V.Vector3);if(!a||qv(a,this.camera.position))return;const l=new V.Vector3().addVectors(r[0],r[2]).divideScalar(2),{position:c,direction:u}=o,h=new V.Vector3().subVectors(r[1],r[0]),d=new V.Vector3().subVectors(r[3],r[0]),f=O=>{const U=new V.Vector3(0,0,0);if(!this.startInfo)return U;const j=(O==="ew"?h:d).clone(),F=c.clone().projectOnVector(j),W=a.clone().projectOnVector(j),X=l.clone().projectOnVector(j);if(W.equals(F))return U;if(O==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const N=new V.Vector3().subVectors(W,X),ae=N.x<0&&j.x>=0,he=N.y<0&&j.y>=0,ue=N.z<0&&j.z>=0;this.startInfo.dragPointInCenterBottom=ae||he||ue}if(O==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const N=new V.Vector3().subVectors(W,X),ae=N.x<0&&j.x>=0,he=N.y<0&&j.y>=0,ue=N.z<0&&j.z>=0;this.startInfo.dragPointInCenterLeft=ae||he||ue}const G=new V.Vector3().subVectors(W,F),ee=G.length();return ee>.3?(console.warn("offset.length() > 0.3, skipped",ee),U):G},g=f("ew"),A=f("ns"),p=()=>{const O=g;this.helperObject3D.cornerPositions.forEach((U,j)=>{var F;(F=this.startInfo)!=null&&F.dragPointInCenterLeft?(j===0||j===3)&&U.add(O):(j===1||j===2)&&U.add(O)})},v=()=>{const O=A;this.helperObject3D.cornerPositions.forEach((U,j)=>{var F;(F=this.startInfo)!=null&&F.dragPointInCenterBottom?(j===0||j===1)&&U.add(O):(j===2||j===3)&&U.add(O)})};switch(u){case"ew":p();break;case"ns":v();break;case"nesw":case"nwse":p(),v()}const y=new V.Vector3().subVectors(r[1],r[0]).length()/h.length(),w=new V.Vector3().subVectors(r[3],r[0]).length()/d.length(),P=new V.Vector3(y,w,1),k=new I.Matrix4().scale(P);n.isCSS3DObjectPlus?n.applyScaleMatrix4(k):n.scale.applyMatrix4(k),o.position.copy(a);const C=new V.Vector3().addVectors(r[0],r[2]).divideScalar(2),S=new V.Vector3().subVectors(C,l),x=new I.Matrix4().setPosition(S);n.applyMatrix4(x),(Q=this.helperObject3D.css3DInstance)==null||Q.css3DObject.applyMatrix4(x),(_=this.helperObject3D.plane)==null||_.applyMatrix4(x),this.hooks.emit("applyObjectScale",{matrix:k}),this.hooks.emit("applyObjectPosition",{matrix:x}),this.render()}dragEnd(){!this.isDragging||(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render())}}class pb extends mb{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 gb extends En{constructor(...e){super(...e);m(this,"name","BoundingBoxController")}}class Ab extends Bl{constructor(t){super(t)}}const Po="v1.0.0",eo="Object3DHelperPlugin",Ai=`${eo}@${Po}`,vb=()=>{console.error(`${Ai} is disposed`)},bb=()=>{console.warn(`${Ai} is disabled`)},yb=()=>{console.error(`${Ai} is disabled`)};class jl extends Cn{constructor(e){super(e);m(this,"version",Po);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 Nt(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 H(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return H(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 vb();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return yb();const o=R({},this.state);this.state=R(R({},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 hb,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 g=new Jv(e),A=this.getConfig(n.moveHelper),p=new ln(this.five,rb,e,g,A,d);o.addControllers({moveController:p.helperController}),s.push(()=>p.dispose())}if(c){const g=this.getConfig(n.rotateHelper),A=new $v(e,R({container:r},g)),p=new ln(this.five,fb,e,A,g,d);o.addControllers({rotateController:p.helperController}),s.push(()=>p.dispose())}if(h){const g=new sb(e),A=new ln(this.five,gb,e,g,void 0,d);o.addControllers({boundingBoxController:A.helperController})}if(u)if(e.isCSS3DObjectPlus&&r){const g=new ob(e,r,a,this.five.scene),A=new ln(this.five,pb,e,g,void 0,d);o.addControllers({scaleController:A.helperController}),s.push(()=>A.dispose()),ma(this.five).then(()=>{var p,v;if(e.isCSS3DObjectPlus){const y=e;if(!y||y.mode!=="front")return;const w=(p=this.css3DRender.behindModeCSS3DRenderer.wrapper)!=null?p:pa(this.five);w&&(this.css3DObjectParentMap.set(y,y.parent),y.removeFromParent(),this.css3DRender.behindModeCSS3DRenderer.setWrapper(w),(v=this.css3DRender.getBehindCSS3DObjectGroup())==null||v.add(y),this.css3DRender.render(this.five.camera))}})}else{const g=new Ab(e),A=new ln(this.five,Hv,e,g,void 0,d);o.addControllers({scaleController:A.helperController}),s.push(()=>A.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&&bb()}getConfig(e){if(!!e&&typeof e!="boolean"&&e.enable)return e}}const wb=i=>new jl(i),Cb=`
|
|
563
563
|
varying vec2 vUv;
|
|
564
564
|
void main() {
|
|
565
565
|
vUv = uv;
|
|
@@ -579,4 +579,4 @@ void main() {
|
|
|
579
579
|
float match = (1.0 - step(0.5, abs(uv.x - 0.5))) * (1.0 - step(0.5, abs(uv.y - 0.5))) * (transX < transY ? transX : transY);
|
|
580
580
|
gl_FragColor = vec4(texture2D(map, uv).xyz, match);
|
|
581
581
|
}
|
|
582
|
-
`;function Eb(i){const t=Math.PI*2;let e=-Math.atan2(i.x,-i.z);e=(e%t+t)%t;const n=-Math.asin(i.y/1);return{longitude:e,latitude:n}}class aa{constructor(t,e){m(this,"_id");m(this,"url");m(this,"five");m(this,"panoIndex");m(this,"observer");m(this,"origin");m(this,"video");m(this,"videoMesh");m(this,"_enabled",!0);m(this,"_disposed",!1);m(this,"videoDataLoaded",!1);m(this,"hasVideoEverPlayed",!1);m(this,"renderFiveDisposer");m(this,"uv2Position",(t,e)=>{var f;const o=Math.PI,s=Math.PI*2,r=t,a=1-e,l=new V.Vector3(-1*Math.cos(s*r)*Math.sin(o*a),1*Math.cos(o*a),1*Math.sin(s*r)*Math.sin(o*a));l.setX(-l.x);const c=(f=this.five.work)==null?void 0:f.observers[this.panoIndex];if(!c)return this.logWarning(`\u70B9\u4F4D ${this.panoIndex} \u4E0D\u5B58\u5728\uFF0C\u8BF7\u68C0\u67E5 Five \u6570\u636E\u662F\u5426\u6B63\u5E38\u3002`);const u=c.position.clone(),h=c.quaternion.clone(),d=l.clone();return d.applyAxisAngle(new V.Vector3(0,1,0),Math.PI/2),d.applyQuaternion(h),d.add(u),d});m(this,"onFiveDataLoaded",()=>{var l;const t=(l=this.five.work)==null?void 0:l.observers[this.panoIndex];if(!t)return this.logWarning(`\u70B9\u4F4D ${this.panoIndex} \u4E0D\u5B58\u5728\uFF0C\u8BF7\u68C0\u67E5 Five \u6570\u636E\u662F\u5426\u6B63\u5E38\u3002`);this.observer=t;const{x:e,y:n,z:o,w:s}=t.quaternion,r=new V.Quaternion(e,n,o,s),a=t.position;this.videoMesh.position.fromArray([a.x,a.y,a.z]),this.videoMesh.quaternion.set(0,0,0,1),this.videoMesh.rotateOnAxis(new V.Vector3(0,1,0),Math.PI/2),this.videoMesh.applyQuaternion(r)});m(this,"onFiveWantsMoveToPano",t=>{t===this.panoIndex&&(this.hasVideoEverPlayed||this.video.play().catch(e=>{console.log("\u{1F436} ==> error:",e)}))});m(this,"onFivePanoArrived",t=>{if(this.disposed)return this.logWarning("\u5B9E\u4F8B\u5DF2\u88AB\u9500\u6BC1");!this.enabled||this.panoIndex===t&&this.mount()});m(this,"onFivePanoWillArrive",t=>{if(t!==this.panoIndex)return this.unmount();this.panoIndex!==t&&this.unmount()});m(this,"onFiveModeChange",t=>{t!=="Panorama"&&this.hide()});m(this,"onFiveInitAnimationEnded",()=>{const t=this.five.getCurrentState();t.mode==="Panorama"&&t.panoIndex===this.panoIndex&&this.mount()});m(this,"onFiveWantsTapGesture",t=>{if(!this.five.scene.children.includes(this.videoMesh))return;if(this.disposed)return this.logWarning("\u5B9E\u4F8B\u5DF2\u88AB\u9500\u6BC1");if(!this.enabled)return this.logWarning("\u5B9E\u4F8B\u5DF2\u88AB\u7981\u7528");const[e]=t.intersectObject(this.videoMesh);if(!e)return;if(this.checkIntersectionInBounding(this.origin,e))return this.video.muted=!this.video.muted,!1});m(this,"onVideoDataLoaded",()=>{this.videoDataLoaded=!0,this.video.paused===!1&&this.video.src!==""&&this.onVideoPlayingAndLoaded()});m(this,"onVideoPlaying",()=>{this.hasVideoEverPlayed=!0,this.video.src!==""&&this.videoDataLoaded&&this.onVideoPlayingAndLoaded()});m(this,"onVideoPlayingAndLoaded",()=>{if(!this.videoDataLoaded)return this.logWarning("\u89C6\u9891\u6570\u636E\u672A\u52A0\u8F7D");if(this.video.paused===!0)return this.logWarning("\u89C6\u9891\u5DF2\u6682\u505C");this.video.addEventListener("timeupdate",()=>{this.video.src!==""&&this.panoIndex===this.five.getCurrentState().panoIndex&&this.five.getCurrentState().mode==="Panorama"&&(this.renderFiveDisposer||(this.renderFiveDisposer=Pn(()=>{this.five.needsRender=!0},30)),this.five.scene.add(this.videoMesh))},{once:!0})});m(this,"onVideoPaused",()=>{var t;(t=this.renderFiveDisposer)==null||t.call(this),this.renderFiveDisposer=void 0});var l,c;this.five=t,this.panoIndex=e.panoIndex,this._id=e.renderID,this.url=e.url,this.origin=e.origin.slice(),this._enabled=(c=(l=e.initialState)==null?void 0:l.enabled)!=null?c:!0;const n=document.createElement("video");n.crossOrigin="anonymous",n.autoplay=!1,n.muted=!0,n.loop=!0,n.playsInline=!0,this.video=n;const o=new V.VideoTexture(this.video);o.minFilter=V.LinearFilter,o.magFilter=V.LinearFilter;const s=new V.ShaderMaterial({vertexShader:Cb,fragmentShader:Pb,uniforms:{map:{value:o},size:{value:new V.Vector4(this.origin[0],1-this.origin[1]-this.origin[3],this.origin[2],this.origin[3])}},depthTest:!0,transparent:!0}),r=new V.SphereBufferGeometry(1,64,64);r.scale(-1,1,1);const a=new V.Mesh(r,s);a.name="pano-video",this.videoMesh=a,this.five.work&&this.onFiveDataLoaded(),this.enabled&&this.addEventListeners(),this.mountIfNeeded()}get renderID(){return this._id}get disposed(){return this._disposed}get enabled(){return this._enabled}dispose(){this.disposed||(this.disable(),this._disposed=!0)}enable(){this.disposed||this.enabled||(this._enabled=!0,this.addEventListeners(),this.mountIfNeeded())}disable(){this.disposed||!this.enabled||(this._enabled=!1,this.removeEventListeners(),this.unmount())}lookAtVideo(){if(!this.observer)return;const t=this.getUVCenter();if(!t)return;const e=this.uv2Position(t[0],t[1]);if(!e)return;const n=new V.Vector3().subVectors(e,this.observer.position).normalize(),{longitude:o,latitude:s}=Eb(n);this.five.setState({panoIndex:this.panoIndex,longitude:o,latitude:s}),this.onFiveWantsMoveToPano(this.panoIndex)}getUVCenter(){if(!this.origin)return;const t=this.origin[0]+this.origin[2]/2,e=this.origin[1]+this.origin[3]/2;return[t,e]}addEventListeners(){this.five.on("loaded",this.onFiveDataLoaded),this.five.on("modeChange",this.onFiveModeChange),this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive),this.five.on("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.on("wantsTapGesture",this.onFiveWantsTapGesture),this.five.on("initAnimationEnded",this.onFiveInitAnimationEnded),this.video.addEventListener("canplaythrough",this.onVideoDataLoaded),this.video.addEventListener("playing",this.onVideoPlaying),this.video.addEventListener("pause",this.onVideoPaused)}removeEventListeners(){this.five.off("loaded",this.onFiveDataLoaded),this.five.off("modeChange",this.onFiveModeChange),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.off("wantsTapGesture",this.onFiveWantsTapGesture),this.five.off("initAnimationEnded",this.onFiveInitAnimationEnded),this.video.removeEventListener("canplaythrough",this.onVideoDataLoaded),this.video.removeEventListener("playing",this.onVideoPlaying),this.video.removeEventListener("pause",this.onVideoPaused)}mountIfNeeded(){const t=this.five.getCurrentState();t.mode==="Panorama"&&t.panoIndex===this.panoIndex&&this.enabled&&this.mount()}mount(){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u7ECF\u9500\u6BC1\uFF0C\u65E0\u6CD5\u6302\u8F7D\u3002");if(this.url==="")return this.logWarning("\u89C6\u9891\u8D44\u6E90\u4E0D\u5B58\u5728\u3002");this.video.src!==this.url&&(this.video.src=this.url),this.video.paused&&this.video.play().catch(t=>{this.logWarning(t instanceof Error?t.message:"\u89C6\u9891\u64AD\u653E\u5931\u8D25\u3002"),this.five.once("gesture",()=>{this.video.play().catch(e=>{this.logWarning(e instanceof Error?e.message:"\u81EA\u52A8\u64AD\u653E\u89C6\u9891\u5931\u8D25\u3002")})})})}unmount(){this.video.pause(),this.video.src!==""&&(this.video.src=""),this.five.scene.remove(this.videoMesh)}hide(){this.video.pause(),this.five.scene.remove(this.videoMesh)}logWarning(t){console.warn("\u26D4 ==> [VideoMeshController]:",t)}checkIntersectionInBounding(t,e){if(!e.uv)return!1;const[n,o]=e.uv.toArray(),[s,r,a,l]=t,c=1-r-l,u=s+a,h=c+l;return n>=s&&n<=u&&o>=c&&o<=h}}class Ib extends Cn{constructor(e){super(e);m(this,"enabled",!0);m(this,"controllerMap",new Map);m(this,"_disposed",!1);this.five=e}get state(){return{enabled:this.enabled}}get disposed(){return this._disposed}load(e,n){var o;if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");typeof((o=n==null?void 0:n.initialState)==null?void 0:o.enabled)!="undefined"&&n.initialState.enabled!==this.enabled&&(n.initialState.enabled?this.enable():this.disable()),e.list.forEach(s=>{const r=s.pano_index,a=s.render_id;s.video_list.forEach(l=>{this.controllerMap.set(l.render_id,new aa(this.five,me(O({},l),{panoIndex:r,renderID:a,initialState:{enabled:this.enabled}})))})})}enable(e){var o;if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");if(this.enabled)return;this.enabled=!0,Array.from(this.controllerMap.values()).forEach(s=>s.enable());const n=(o=e==null?void 0:e.userAction)!=null?o:!0;this.hooks.emit("enable",{userAction:n})}disable(e){var o;if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");if(!this.enabled)return;this.enabled=!1,Array.from(this.controllerMap.values()).forEach(s=>s.disable());const n=(o=e==null?void 0:e.userAction)!=null?o:!0;this.hooks.emit("disable",{userAction:n})}lookAtVideoItemByRenderID(e){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");const n=this.controllerMap.get(e);if(!n)return this.logWarning(`ID \u4E3A ${e} \u7684\u70B9\u4F4D\u89C6\u9891\u4E0D\u5B58\u5728`);n.lookAtVideo()}add(e,n){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");n.forEach(o=>{if(this.controllerMap.get(o.render_id))return this.logWarning(`ID \u4E3A ${o.render_id} \u7684\u70B9\u4F4D\u89C6\u9891\u5DF2\u5B58\u5728`);const s=o.render_id;this.controllerMap.set(o.render_id,new aa(this.five,me(O({},o),{panoIndex:e,renderID:s,initialState:{enabled:this.enabled}})))})}removeByRenderID(e){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");const n=this.controllerMap.get(e);if(!n)return this.logWarning(`ID \u4E3A ${e} \u7684\u70B9\u4F4D\u89C6\u9891\u4E0D\u5B58\u5728`);n.dispose(),this.controllerMap.delete(e)}clear(){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");Array.from(this.controllerMap.values()).forEach(e=>e.dispose()),this.controllerMap.clear()}dispose(){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");this._disposed=!0,Array.from(this.controllerMap.values()).forEach(e=>e.dispose()),this.controllerMap.clear()}logWarning(e){console.warn("\u26D4 ==> [PanoVideoPluginController]:",e)}}const kb=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),xb=i=>new Ib(i);exports.CSS3DRender=Nt;exports.CSS3DRenderPlugin=Jt;exports.CameraMovementEffect=Ga;exports.CameraMovementPlugin=Th;exports.ContentType=dl;exports.CruisePlugin=Ap;exports.CruisePluginController=po;exports.DIRECTION=Ft;exports.DISPLAY_STRATEGY_TYPE=xt;exports.DimensionType=hl;exports.FLOOR_PLAN_ATTACHED_TO=pt;exports.FLOOR_TYPE_MAP=yh;exports.GuideLinePlugin=ll;exports.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE=Dt;exports.ItemLabelPlugin=Gm;exports.Magnifier=Xa;exports.MapviewFloorplanPlugin=Kd;exports.ModelChassisCompassPlugin=Ph;exports.ModelEntryDoorGuidePlugin=kh;exports.ModelFloorplanPlugin=Ud;exports.ModelItemLabelPlugin=Cm;exports.ModelRoomLabelPlugin=au;exports.ModelTVVideoPlugin=Im;exports.ModelViewPlugin=mc;exports.Object3DHelperController=jl;exports.Object3DHelperPlugin=wb;exports.PLUGIN=Ai;exports.PaintBrush=fc;exports.PaintBrushTypeEnum=ot;exports.PanoCompassPlugin=$h;exports.PanoCursorRaycasterPlugin=zc;exports.PanoDoorLabelPlugin=tp;exports.PanoFloorplanRadarPlugin=vh;exports.PanoMeasurePlugin=Jf;exports.PanoMeasurePluginLine=Bt;exports.PanoMeasurePluginModel=fi;exports.PanoMeasurePluginPoint=Ye;exports.PanoMeasurePluginPolyline=hi;exports.PanoRulerPlugin=Qh;exports.PanoRulerProPlugin=Uh;exports.PanoSpatialTagPlugin=dm;exports.PanoTagPlugin=Fv;exports.PanoTagPluginController=Ml;exports.PanoVideoPlugin=xb;exports.PanoVideoPluginType=kb;exports.PointType=fl;exports.ROOM_FETILE_TYPE_MAP=bh;exports.ROOM_TYPE_MAP=wh;exports.Rotation=$e;exports.TopviewFloorplanPlugin=eh;exports.Util=rA;exports.VERSION=Po;exports.itemLabelPluginServerParams=Wm;exports.modelItemLabelPluginServerParams=Pm;exports.modelRoomLabelPluginServerParams=lu;exports.pluginFlag=Rv;
|
|
582
|
+
`;function Eb(i){const t=Math.PI*2;let e=-Math.atan2(i.x,-i.z);e=(e%t+t)%t;const n=-Math.asin(i.y/1);return{longitude:e,latitude:n}}class aa{constructor(t,e){m(this,"_id");m(this,"url");m(this,"five");m(this,"panoIndex");m(this,"observer");m(this,"origin");m(this,"video");m(this,"videoMesh");m(this,"_enabled",!0);m(this,"_disposed",!1);m(this,"videoDataLoaded",!1);m(this,"hasVideoEverPlayed",!1);m(this,"renderFiveDisposer");m(this,"uv2Position",(t,e)=>{var f;const o=Math.PI,s=Math.PI*2,r=t,a=1-e,l=new V.Vector3(-1*Math.cos(s*r)*Math.sin(o*a),1*Math.cos(o*a),1*Math.sin(s*r)*Math.sin(o*a));l.setX(-l.x);const c=(f=this.five.work)==null?void 0:f.observers[this.panoIndex];if(!c)return this.logWarning(`\u70B9\u4F4D ${this.panoIndex} \u4E0D\u5B58\u5728\uFF0C\u8BF7\u68C0\u67E5 Five \u6570\u636E\u662F\u5426\u6B63\u5E38\u3002`);const u=c.position.clone(),h=c.quaternion.clone(),d=l.clone();return d.applyAxisAngle(new V.Vector3(0,1,0),Math.PI/2),d.applyQuaternion(h),d.add(u),d});m(this,"onFiveDataLoaded",()=>{var l;const t=(l=this.five.work)==null?void 0:l.observers[this.panoIndex];if(!t)return this.logWarning(`\u70B9\u4F4D ${this.panoIndex} \u4E0D\u5B58\u5728\uFF0C\u8BF7\u68C0\u67E5 Five \u6570\u636E\u662F\u5426\u6B63\u5E38\u3002`);this.observer=t;const{x:e,y:n,z:o,w:s}=t.quaternion,r=new V.Quaternion(e,n,o,s),a=t.position;this.videoMesh.position.fromArray([a.x,a.y,a.z]),this.videoMesh.quaternion.set(0,0,0,1),this.videoMesh.rotateOnAxis(new V.Vector3(0,1,0),Math.PI/2),this.videoMesh.applyQuaternion(r)});m(this,"onFiveWantsMoveToPano",t=>{t===this.panoIndex&&(this.hasVideoEverPlayed||this.video.play().catch(e=>{console.log("\u{1F436} ==> error:",e)}))});m(this,"onFivePanoArrived",t=>{if(this.disposed)return this.logWarning("\u5B9E\u4F8B\u5DF2\u88AB\u9500\u6BC1");!this.enabled||this.panoIndex===t&&this.mount()});m(this,"onFivePanoWillArrive",t=>{if(t!==this.panoIndex)return this.unmount();this.panoIndex!==t&&this.unmount()});m(this,"onFiveModeChange",t=>{t!=="Panorama"&&this.hide()});m(this,"onFiveInitAnimationEnded",()=>{const t=this.five.getCurrentState();t.mode==="Panorama"&&t.panoIndex===this.panoIndex&&this.mount()});m(this,"onFiveWantsTapGesture",t=>{if(!this.five.scene.children.includes(this.videoMesh))return;if(this.disposed)return this.logWarning("\u5B9E\u4F8B\u5DF2\u88AB\u9500\u6BC1");if(!this.enabled)return this.logWarning("\u5B9E\u4F8B\u5DF2\u88AB\u7981\u7528");const[e]=t.intersectObject(this.videoMesh);if(!e)return;if(this.checkIntersectionInBounding(this.origin,e))return this.video.muted=!this.video.muted,!1});m(this,"onVideoDataLoaded",()=>{this.videoDataLoaded=!0,this.video.paused===!1&&this.video.src!==""&&this.onVideoPlayingAndLoaded()});m(this,"onVideoPlaying",()=>{this.hasVideoEverPlayed=!0,this.video.src!==""&&this.videoDataLoaded&&this.onVideoPlayingAndLoaded()});m(this,"onVideoPlayingAndLoaded",()=>{if(!this.videoDataLoaded)return this.logWarning("\u89C6\u9891\u6570\u636E\u672A\u52A0\u8F7D");if(this.video.paused===!0)return this.logWarning("\u89C6\u9891\u5DF2\u6682\u505C");this.video.addEventListener("timeupdate",()=>{this.video.src!==""&&this.panoIndex===this.five.getCurrentState().panoIndex&&this.five.getCurrentState().mode==="Panorama"&&(this.renderFiveDisposer||(this.renderFiveDisposer=Pn(()=>{this.five.needsRender=!0},30)),this.five.scene.add(this.videoMesh))},{once:!0})});m(this,"onVideoPaused",()=>{var t;(t=this.renderFiveDisposer)==null||t.call(this),this.renderFiveDisposer=void 0});var l,c;this.five=t,this.panoIndex=e.panoIndex,this._id=e.renderID,this.url=e.url,this.origin=e.origin.slice(),this._enabled=(c=(l=e.initialState)==null?void 0:l.enabled)!=null?c:!0;const n=document.createElement("video");n.crossOrigin="anonymous",n.autoplay=!1,n.muted=!0,n.loop=!0,n.playsInline=!0,this.video=n;const o=new V.VideoTexture(this.video);o.minFilter=V.LinearFilter,o.magFilter=V.LinearFilter;const s=new V.ShaderMaterial({vertexShader:Cb,fragmentShader:Pb,uniforms:{map:{value:o},size:{value:new V.Vector4(this.origin[0],1-this.origin[1]-this.origin[3],this.origin[2],this.origin[3])}},depthTest:!0,transparent:!0}),r=new V.SphereBufferGeometry(1,64,64);r.scale(-1,1,1);const a=new V.Mesh(r,s);a.name="pano-video",this.videoMesh=a,this.five.work&&this.onFiveDataLoaded(),this.enabled&&this.addEventListeners(),this.mountIfNeeded()}get renderID(){return this._id}get disposed(){return this._disposed}get enabled(){return this._enabled}dispose(){this.disposed||(this.disable(),this._disposed=!0)}enable(){this.disposed||this.enabled||(this._enabled=!0,this.addEventListeners(),this.mountIfNeeded())}disable(){this.disposed||!this.enabled||(this._enabled=!1,this.removeEventListeners(),this.unmount())}lookAtVideo(){if(!this.observer)return;const t=this.getUVCenter();if(!t)return;const e=this.uv2Position(t[0],t[1]);if(!e)return;const n=new V.Vector3().subVectors(e,this.observer.position).normalize(),{longitude:o,latitude:s}=Eb(n);this.five.setState({panoIndex:this.panoIndex,longitude:o,latitude:s}),this.onFiveWantsMoveToPano(this.panoIndex)}getUVCenter(){if(!this.origin)return;const t=this.origin[0]+this.origin[2]/2,e=this.origin[1]+this.origin[3]/2;return[t,e]}addEventListeners(){this.five.on("loaded",this.onFiveDataLoaded),this.five.on("modeChange",this.onFiveModeChange),this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive),this.five.on("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.on("wantsTapGesture",this.onFiveWantsTapGesture),this.five.on("initAnimationEnded",this.onFiveInitAnimationEnded),this.video.addEventListener("canplaythrough",this.onVideoDataLoaded),this.video.addEventListener("playing",this.onVideoPlaying),this.video.addEventListener("pause",this.onVideoPaused)}removeEventListeners(){this.five.off("loaded",this.onFiveDataLoaded),this.five.off("modeChange",this.onFiveModeChange),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.off("wantsTapGesture",this.onFiveWantsTapGesture),this.five.off("initAnimationEnded",this.onFiveInitAnimationEnded),this.video.removeEventListener("canplaythrough",this.onVideoDataLoaded),this.video.removeEventListener("playing",this.onVideoPlaying),this.video.removeEventListener("pause",this.onVideoPaused)}mountIfNeeded(){const t=this.five.getCurrentState();t.mode==="Panorama"&&t.panoIndex===this.panoIndex&&this.enabled&&this.mount()}mount(){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u7ECF\u9500\u6BC1\uFF0C\u65E0\u6CD5\u6302\u8F7D\u3002");if(this.url==="")return this.logWarning("\u89C6\u9891\u8D44\u6E90\u4E0D\u5B58\u5728\u3002");this.video.src!==this.url&&(this.video.src=this.url),this.video.paused&&this.video.play().catch(t=>{this.logWarning(t instanceof Error?t.message:"\u89C6\u9891\u64AD\u653E\u5931\u8D25\u3002"),this.five.once("gesture",()=>{this.video.play().catch(e=>{this.logWarning(e instanceof Error?e.message:"\u81EA\u52A8\u64AD\u653E\u89C6\u9891\u5931\u8D25\u3002")})})})}unmount(){this.video.pause(),this.video.src!==""&&(this.video.src=""),this.five.scene.remove(this.videoMesh)}hide(){this.video.pause(),this.five.scene.remove(this.videoMesh)}logWarning(t){console.warn("\u26D4 ==> [VideoMeshController]:",t)}checkIntersectionInBounding(t,e){if(!e.uv)return!1;const[n,o]=e.uv.toArray(),[s,r,a,l]=t,c=1-r-l,u=s+a,h=c+l;return n>=s&&n<=u&&o>=c&&o<=h}}class Ib extends Cn{constructor(e){super(e);m(this,"enabled",!0);m(this,"controllerMap",new Map);m(this,"_disposed",!1);this.five=e}get state(){return{enabled:this.enabled}}get disposed(){return this._disposed}load(e,n){var o;if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");typeof((o=n==null?void 0:n.initialState)==null?void 0:o.enabled)!="undefined"&&n.initialState.enabled!==this.enabled&&(n.initialState.enabled?this.enable():this.disable()),e.list.forEach(s=>{const r=s.pano_index,a=s.render_id;s.video_list.forEach(l=>{this.controllerMap.set(l.render_id,new aa(this.five,me(R({},l),{panoIndex:r,renderID:a,initialState:{enabled:this.enabled}})))})})}enable(e){var o;if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");if(this.enabled)return;this.enabled=!0,Array.from(this.controllerMap.values()).forEach(s=>s.enable());const n=(o=e==null?void 0:e.userAction)!=null?o:!0;this.hooks.emit("enable",{userAction:n})}disable(e){var o;if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");if(!this.enabled)return;this.enabled=!1,Array.from(this.controllerMap.values()).forEach(s=>s.disable());const n=(o=e==null?void 0:e.userAction)!=null?o:!0;this.hooks.emit("disable",{userAction:n})}lookAtVideoItemByRenderID(e){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");const n=this.controllerMap.get(e);if(!n)return this.logWarning(`ID \u4E3A ${e} \u7684\u70B9\u4F4D\u89C6\u9891\u4E0D\u5B58\u5728`);n.lookAtVideo()}add(e,n){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");n.forEach(o=>{if(this.controllerMap.get(o.render_id))return this.logWarning(`ID \u4E3A ${o.render_id} \u7684\u70B9\u4F4D\u89C6\u9891\u5DF2\u5B58\u5728`);const s=o.render_id;this.controllerMap.set(o.render_id,new aa(this.five,me(R({},o),{panoIndex:e,renderID:s,initialState:{enabled:this.enabled}})))})}removeByRenderID(e){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");const n=this.controllerMap.get(e);if(!n)return this.logWarning(`ID \u4E3A ${e} \u7684\u70B9\u4F4D\u89C6\u9891\u4E0D\u5B58\u5728`);n.dispose(),this.controllerMap.delete(e)}clear(){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");Array.from(this.controllerMap.values()).forEach(e=>e.dispose()),this.controllerMap.clear()}dispose(){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");this._disposed=!0,Array.from(this.controllerMap.values()).forEach(e=>e.dispose()),this.controllerMap.clear()}logWarning(e){console.warn("\u26D4 ==> [PanoVideoPluginController]:",e)}}const kb=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),xb=i=>new Ib(i);exports.CSS3DRender=Nt;exports.CSS3DRenderPlugin=Jt;exports.CameraMovementEffect=Ga;exports.CameraMovementPlugin=Th;exports.ContentType=dl;exports.CruisePlugin=Ap;exports.CruisePluginController=po;exports.DIRECTION=Ft;exports.DISPLAY_STRATEGY_TYPE=xt;exports.DimensionType=hl;exports.FLOOR_PLAN_ATTACHED_TO=pt;exports.FLOOR_TYPE_MAP=yh;exports.GuideLinePlugin=ll;exports.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE=Dt;exports.ItemLabelPlugin=Gm;exports.Magnifier=Xa;exports.MapviewFloorplanPlugin=Kd;exports.ModelChassisCompassPlugin=Ph;exports.ModelEntryDoorGuidePlugin=kh;exports.ModelFloorplanPlugin=Ud;exports.ModelItemLabelPlugin=Cm;exports.ModelRoomLabelPlugin=au;exports.ModelTVVideoPlugin=Im;exports.ModelViewPlugin=mc;exports.Object3DHelperController=jl;exports.Object3DHelperPlugin=wb;exports.PLUGIN=Ai;exports.PaintBrush=fc;exports.PaintBrushTypeEnum=ot;exports.PanoCompassPlugin=$h;exports.PanoCursorRaycasterPlugin=zc;exports.PanoDoorLabelPlugin=tp;exports.PanoFloorplanRadarPlugin=vh;exports.PanoMeasurePlugin=Jf;exports.PanoMeasurePluginLine=Bt;exports.PanoMeasurePluginModel=fi;exports.PanoMeasurePluginPoint=Ye;exports.PanoMeasurePluginPolyline=hi;exports.PanoRulerPlugin=Qh;exports.PanoRulerProPlugin=Uh;exports.PanoSpatialTagPlugin=dm;exports.PanoTagPlugin=Fv;exports.PanoTagPluginController=Ml;exports.PanoVideoPlugin=xb;exports.PanoVideoPluginType=kb;exports.PointType=fl;exports.ROOM_FETILE_TYPE_MAP=bh;exports.ROOM_TYPE_MAP=wh;exports.Rotation=$e;exports.TopviewFloorplanPlugin=eh;exports.Util=rA;exports.VERSION=Po;exports.itemLabelPluginServerParams=Wm;exports.modelItemLabelPluginServerParams=Pm;exports.modelRoomLabelPluginServerParams=lu;exports.pluginFlag=Ov;
|