@realsee/dnalogel 2.13.2-dev.1 → 2.13.2-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +2 -2
- package/dist/index.js +5 -4
- package/dist/index.umd.js +2 -2
- package/docs/classes/CSS3DRender.html +31 -31
- package/docs/classes/CruisePluginController.html +25 -25
- package/docs/classes/Magnifier.html +20 -20
- package/docs/classes/ModelRoomLabelController.html +11 -11
- package/docs/classes/Object3DHelperController.html +25 -25
- 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 +45 -45
- 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/ImagePlaneGroup.html +6 -6
- 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 +14 -14
- 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/TagCacheInterface.html +12 -12
- package/docs/interfaces/TagConfig.html +11 -11
- package/docs/interfaces/TagGLTFObjectGroup.html +6 -6
- package/docs/interfaces/TagIconUrl.html +11 -11
- package/docs/interfaces/TagObjectGroup.html +6 -6
- package/docs/interfaces/TagStyle.html +6 -6
- 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/base/BasePlugin.js +1 -1
- package/libs/shared-utils/svelte/resizeObserver.js +9 -8
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -101,7 +101,7 @@ transition: all 500ms;
|
|
|
101
101
|
`;class Dc extends kc{constructor(e){super();f(this,"configs");f(this,"clientWidth");f(this,"clientHeight");f(this,"ready",!1);f(this,"uuid",_e());f(this,"tween");f(this,"tweening",!1);f(this,"container");f(this,"canvas");f(this,"data",{});f(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=xc,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 h;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=(h=this.canvas[this.uuid])==null?void 0:h.getContext("2d");if(!this.canvas[this.uuid])return;const{width:u,height:d}=this.canvas[this.uuid];c&&c.clearRect(0,0,u,d),this.data[this.uuid].forEach(m=>this.handleDrawLine(this.uuid,m,{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=(d,h,m)=>{const A=this.color||"#ff0000";n.strokeStyle=A,n.beginPath(),n.moveTo(d.x,d.y),n.quadraticCurveTo(h.x,h.y,m.x,m.y),n.stroke()};e.onmousedown=d=>{d.preventDefault(),c=Date.now();const h=d.clientX,m=d.clientY;r=[],r.push({x:h,y:m}),s={x:h,y:m},a=Sn({x:h,y:m},this.clientWidth,this.clientHeight),l=[]},e.onmousemove=d=>{if(d.preventDefault(),!s)return;const h=Number(d.clientX),m=Number(d.clientY);if(Math.abs(h-s.x)<5&&Math.abs(m-s.y)<5||(r.push({x:h,y:m}),l.push(Sn({x:h,y:m},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:A,end:v}=Mn(r);!A||!v||(u(s,A,v),s=v)},e.onmouseup=d=>{if(d.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const h=Date.now()-c,m={move:Object.assign({},a),uuid:this.uuid,line:[...l],color:this.color,duration:h<1280?h:h<2e3?1280:0};this.data[this.uuid].push(m),Yn(()=>{this.emitStateChange({type:ot.Drawline,color:this.color,ready:this.ready,state:m,uuid:this.uuid})})},e.ontouchstart=d=>{d.preventDefault(),c=Date.now();const h=d.touches[0].clientX,m=d.touches[0].clientY;r=[],r.push({x:h,y:m}),s={x:h,y:m},a=Sn({x:h,y:m},this.clientWidth,this.clientHeight),l=[]},e.ontouchmove=d=>{if(d.preventDefault(),!s)return;const h=Number(d.touches[0].clientX),m=Number(d.touches[0].clientY);if(Math.abs(h-s.x)<5&&Math.abs(m-s.y)<5||(r.push({x:h,y:m}),l.push(Sn({x:h,y:m},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:A,end:v}=Mn(r);!A||!v||(u(s,A,v),s=v)},e.ontouchend=e.ontouchcancel=d=>{if(d.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const h=Date.now()-c,m={move:Object.assign({},a),line:[...l],uuid:this.uuid,color:this.color,duration:h<1280?h:h<2e3?1280:0};this.data[this.uuid].push(m),Yn(()=>{this.emitStateChange({type:ot.Drawline,color:this.color,ready:this.ready,state:m,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};Cc(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=Aa){!n||Object.prototype.toString.call(n)!="[object Object]"||Object.keys(n).length===0||wc(()=>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:d}=n,h=xi(n.move||{},this.clientWidth,this.clientHeight);let m=[h];if(a.strokeStyle=c,a.beginPath(),a.moveTo(h.x,h.y),u&&!o){let A=[];const v=this;v.tween=Pc({step:0},{step:l.length-1},u).onUpdate(({step:p})=>{var b;if(v.tweening=!0,!v.ready)return a.clearRect(0,0,v.canvas[d].width,v.canvas[d].height),(b=v.tween)==null?void 0:b.stop();const g=Math.floor(p);if(!A.find(w=>w===g)){if(A.push(g),m.push(xi(l[g],v.clientWidth,v.clientHeight)),m.length<3)return;const{control:w,end:P}=Mn(m);if(!w||!P)return;a.quadraticCurveTo(w.x,w.y,P.x,P.y),a.stroke()}}).onComplete(p=>{v.tween=void 0,v.tweening=!1,A=[],m=[],s&&s(),r()})}else{for(let A=0;A<l.length;A++){if(m.push(xi(l[A],this.clientWidth,this.clientHeight)),m.length<3)continue;const{control:v,end:p}=Mn(m);!v||!p||a.quadraticCurveTo(v.x,v.y,p.x,p.y)}a.stroke(),m=[],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(),Yn(n,60);return}n()}destroyBrush(){this.closeBrush(),this.ready=!1,this.emit("readyChange",!0)}}class Lc{constructor(t={}){f(this,"controller");const e=Object.assign({currentColor:"#f44336",onUndoText:"\u56DE\u9000",onExitText:"\u5173\u95ED"},t);this.controller=new Dc(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 Sc=(i,t)=>{var H,B;let e=(B=(H=t==null?void 0:t.initialState)==null?void 0:H.enabled)!=null?B:!0,n=!1,o=!0,s=null;const a=Q(Q({},{lookAtCurrentCamera:!1,lockedPanoIndex:null,lockedLatitude:null,lockedLongitude:null}),t==null?void 0:t.config),l=new k.Scene,c=new Ce.Camera(60);let u=new k.Object3D,d,h;{const F=new k.DirectionalLight(16777215,.5);F.position.copy(new k.Vector3(1,1,1)),l.add(F)}{const F=new k.DirectionalLight(16777215,.3);l.add(F)}{const F=new k.AmbientLight(16777215,.3);l.add(F)}l.add(u);const m=()=>{if(n)return;d=x(i.model,c.fov,c.aspect),h=i.model.bounding.getCenter(new k.Vector3),l.remove(u),u=R(i.model),l.add(u),n=!0,D();function F(N){const _=N.clone();return _.uniforms.modelAlpha.value=1,_.uniforms.map.value&&(_.uniforms.map.value.needsUpdate=!0),_}function R(N){if(N instanceof k.Mesh){const _=N.geometry,$=Array.isArray(N.material)?N.material.map(F):F(N.material);return new k.Mesh(_,$)}else if(N instanceof k.Group){const _=new k.Group;return N.children.forEach($=>_.add(R($))),_}else{const _=new k.Object3D;return N.children.forEach($=>_.add(R($))),_}}},A=()=>{if(!!i.renderer)return s||(s=new k.WebGLRenderer({antialias:!1,alpha:!0}),s.setPixelRatio(i.renderer.getPixelRatio()),s.outputEncoding=k.sRGBEncoding,s.setClearColor(1579548,0),s.autoClear=!0),s},v=()=>{u.traverse(F=>{F instanceof k.Mesh&&[].concat(F.material).forEach(N=>N.dispose())}),l.remove(u),u=new k.Object3D,l.add(u),n=!1,D()},p=()=>{!e||n||m()},g=()=>{e||(e=!0,l.add(u),!n&&i.model.loaded&&m(),D())},b=()=>{!e||(l.remove(u),o=!0,E(),e=!1)},w=(F,R={})=>{const N=A();if(!N)return;F.appendChild(N.domElement),P(R);const _=window.getComputedStyle(F).position;_!=="relative"&&_!=="absolute"&&_!=="fixed"&&_!=="sticky"&&(F.style.position="relative")},P=(F={})=>{if(!s)return;const N=s.domElement.parentNode;if(N!=null&&N.nodeName){const{width:_=N.offsetWidth,height:$=N.offsetHeight}=F;s.setSize(_,$),c.aspect=_/$,c.updateProjectionMatrix()}D()};function x(F,R,N){const _=F.bounding,$=Math.pow(Math.pow(_.max.x-_.min.x+1,2)+Math.pow(_.max.y-_.min.y+1,2)+Math.pow(_.max.z-_.min.z+1,2),1/2);let Y=$/2/Math.tan(Math.PI*R/360);return N<1&&(Y=Y/N),isNaN(Y)?$:Y}function C(F){return i.work.observers[F].standingPosition.clone()}const D=()=>{if(!e||!d||!h)return;const F=i.getPose();F.fov=c.fov,F.offset=h,F.distance=d,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},E=()=>{!e||o!==!0||!s||!s.domElement.parentNode||s.domElement.parentNode.offsetWidth===0||(s.render(l,c),o=!1)},O=()=>{s&&s.dispose(),s=null},G=F=>{Object.assign(a,F),D()},X=()=>({enabled:e});return Object.assign(window,{camera:c}),i.on("modelLoaded",p),i.on("modelWillLoad",v),i.on("cameraDirectionUpdate",D),i.on("dispose",O),i.on("renderFrame",E),i.on("cameraPositionUpdate",D),{appendTo:w,refresh:P,changeConfigs:G,enable:g,disable:b,getCurrentState:X}};function gt(...i){const t=[];return i.forEach(e=>{e.isCSS3DObjectPlus?t.push(e):t.push(...gt(...e.children))}),t}function $n(i,t){const e=Math.round(i);return e%2===0?e:e+Number(t!=null&&t.floor?-1:1)}function Mc(i,t,e=!0){if(!i)return console.error("createResizeObserver: element is undefined"),{observe:()=>{},unobserve:()=>{}};const n=()=>{const s=$n(i.clientWidth,{floor:!0}),r=$n(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 Oo extends Kn.CSS3DRenderer{constructor(){super();f(this,"wrapper");f(this,"requestAnimationFrameId");f(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}=Mc(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;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 Tc(i){return typeof Symbol=="undefined"?`$Symbol<${i}>$`:Symbol(i)}const gn=Tc("$$EVENT$$");function zn(i){return i[gn]||(i[gn]={}),i[gn]}function zc(i){i[gn]||delete i[gn]}class Zt{hasListener(t){const e=zn(this);return Boolean((e==null?void 0:e[t])&&e[t].length>0)}on(t,e,n){const o=zn(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){zc(this);return}const n=zn(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=zn(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}}const Bc=({x:i,y:t,z:e})=>new V.Vector3(i,t,e),st=i=>new V.Vector3().fromArray(i),yn=i=>i instanceof V.Vector3?i:Array.isArray(i)?st(i):Bc(i);class jc extends k.Mesh{constructor(e,n){const o=new k.MeshBasicMaterial({opacity:0,color:0,transparent:!1,side:k.DoubleSide}),s=new k.PlaneGeometry(e,n);super(s,o);f(this,"name","opacity-mesh")}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}}function hi(...i){const t=new V.Vector3;return i.forEach(e=>{t.add(e)}),t.divideScalar(i.length),t}const va=1,Vc=`CSS3DObjectPlus@${va}`,Oc=.00216,Rc=.003;class Qc extends Kn.CSS3DObject{constructor(e){var x,C,D;const n=e.container,o=e.cornerPoints,s=(x=e.ratio)!=null?x:Rc,r=(C=e.dpr)!=null?C:1,a=(D=e.pointerEvents)!=null?D:"auto",l=Math.max(Oc,s),c=o[0].distanceTo(o[1]),u=o[1].distanceTo(o[2]),d=$n(c/s*r),h=$n(u/s*r),m=hi(...o);let A;if(l===s)n.style.width=`${d}px`,n.style.height=`${h}px`,A=n;else{const E=document.createElement("div");E.style.width=`${d}px`,E.style.height=`${h}px`,E.style.pointerEvents="none";const O=s/l;n.style.position="absolute",n.style.left="0",n.style.top="0",n.style.width=`${O*d}px`,n.style.height=`${O*h}px`,E.appendChild(n),A=E}super(A);f(this,"version",va);f(this,"isCSS3DObjectPlus",!0);f(this,"container");f(this,"width");f(this,"height");f(this,"domWidthPx");f(this,"domHeightPx");f(this,"cornerPoints");f(this,"centerPosition");f(this,"ratio");f(this,"mode","front");f(this,"hooks",new Zt);f(this,"opacityMesh");f(this,"selfVisible",!0);f(this,"parentVisibleListenerDisposer");f(this,"createOpacityMesh",e=>{const{domWidthPx:n,domHeightPx:o}=e,s=new jc(n,o);return s.position.copy(e.position),s.rotation.copy(e.rotation),s.scale.copy(e.scale),s});f(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)}});f(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=d,this.domHeightPx=h,this.centerPosition=m;else{const E=s/l;this.width=E*c,this.height=E*u,this.domWidthPx=E*d,this.domHeightPx=E*h,this.centerPosition=new V.Vector3().subVectors(m,o[0]).multiplyScalar(E).add(o[0])}n.classList.add(`${Vc}__container`);const v=new V.Vector3().subVectors(o[1],o[0]),p=new V.Vector3().subVectors(o[3],o[0]),g=new V.Vector3().crossVectors(v,p).normalize();this.lookAt(g);const b=this.up.clone().applyQuaternion(this.quaternion),w=p.clone(),P=new V.Vector3().crossVectors(b,w).normalize();this.rotateOnWorldAxis(P,b.angleTo(w)),this.position.copy(m),this.addEventListener("added",()=>{var E;this.mode==="front"&&((E=this.opacityMesh)==null||E.removeFromParent()),this.addParentVisibleListener()}),this.addEventListener("removed",()=>{var E;(E=this.opacityMesh)==null||E.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 Fc extends k.Scene{constructor(){super()}add(...t){return super.add(...t),gt(...t).forEach(e=>{e.mode="front"}),this}}class Hc extends k.Scene{constructor(e){super();f(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 ba extends k.Group{constructor(e){super();f(this,"isCSS3DGroup",!0);f(this,"mode");f(this,"CSS3DObjectLength",0);f(this,"hooks",new Zt);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 _c extends ba{constructor(){super("front")}}class Gc extends ba{constructor(e){super("behind");f(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 Wc=3,Xi="CSS3DRenderer",fn=`${Xi}@${Wc}`,Vt=()=>{console.error(`${fn} is disposed`)},Le={css3DObjects:[],frontModeStore:{css3DRenderer:new Oo},behindModeStore:{css3DRenderer:new Oo}};function Ro(i){return Le.css3DObjects.find(t=>t.id===i)}function Nc(i){Le.frontModeStore.css3DRenderer.setWrapper(i)}function Xc(i){Le.behindModeStore.css3DRenderer.setWrapper(i)}class Nt{constructor(t){f(this,"hooks",new Zt);f(this,"state",{enabled:!0,visible:!0,disposed:!1});f(this,"_scene");f(this,"store",{frontModeGroup:new _c});f(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(yn);if((s==null?void 0:s.length)<4)return console.error(`${fn}: requires 4 point but params may have fewer`);const{ratio:r,devicePixelRatio:a,mode:l,autoRender:c,container:u,pointerEvents:d}=o;let h=!1;const m=this.createObject(s,{ratio:r,dpr:a,container:u,mode:l,pointerEvents:d});Le.css3DObjects.push(m),o.scene&&this.setScene(o.scene);const A=()=>{if(h)return;const P=m.mode==="front"?this.getFrontCSS3DObjectGroup():this.getBehindCSS3DObjectGroup();!P||P.add(m)},v=()=>{h||(A(),this.render(t))},p=P=>this.setVisibleById(m.id,P),g=P=>this.setEnabledById(m.id,P),b=()=>(h=!0,m.removeFromParent(),!0),w=l==="front"?Le.frontModeStore.css3DRenderer:Le.behindModeStore.css3DRenderer;return c&&v(),{id:m.uuid,container:u,css3DObject:m,render:c?void 0:v,show:()=>p(!0),hide:()=>p(!1),setVisible:p,enable:()=>g(!0),disable:()=>g(!1),setEnabled:g,dispose:b,appendToElement:P=>w.setWrapper(P)}});f(this,"setVisibleById",(t,e)=>{var n;(n=Ro(t))==null||n.setVisible(e)});f(this,"setEnabledById",(t,e)=>{const n=Ro(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))});f(this,"createObject",(t,e)=>{const n=new Qc(Q({cornerPoints:t},e));return n.element.classList.add(`${Xi}__container`),n.element.id=`${Xi}__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 Le.frontModeStore.css3DRenderer}static get behindModeCSS3DRenderer(){return Le.behindModeStore.css3DRenderer}get frontModeCSS3DRenderer(){return Le.frontModeStore.css3DRenderer}get behindModeCSS3DRenderer(){return Le.behindModeStore.css3DRenderer}setScene(t){this._scene=t}getCurrentState(){return this.state}setState(t,e={userAction:!0}){if(this.state.disposed)return Vt();const n=Q({},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 W(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 W(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=Le.frontModeStore)==null?void 0:n.css3DScene;if(e)return e;if(t){const o=new Fc;Le.frontModeStore.css3DScene=o}return Le.frontModeStore.css3DScene}getBehindCSS3DScene({createSceneIfNotExists:t=!1}={}){var n,o;const e=(n=Le.behindModeStore)==null?void 0:n.css3DScene;if(e)return e;if(t){const s=(o=Le.behindModeStore.scene)!=null?o:this.scene;if(!s){console.error(`${fn}: scene is required when mode is behind`);return}const r=new Hc(s);Le.behindModeStore.css3DScene=r,Le.behindModeStore.scene=s}return Le.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 Gc(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(`${fn}: css3DScene is required when mode is front`);Le.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(`${fn}: css3DScene is required when mode is behind`);Le.behindModeStore.css3DRenderer.renderEveryFrame(o,t)}}handleShow(){return W(this,null,function*(){var t;this.store.frontModeGroup.setVisible(!0),(t=this.store.behindModeGroup)==null||t.setVisible(!0)})}handleHide(){return W(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 Kn.CSS3DObject&&o.element instanceof Element&&o.element.parentNode!==null&&o.element.remove()}),(t=this.store.behindModeGroup)==null||t.children.forEach(o=>{o instanceof Kn.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()}}f(Nt,"setFrontModeContainer",Nc),f(Nt,"setBehindModeContainer",Xc);function ya(i){return W(this,null,function*(){return new Promise(t=>{var e;if((e=i.model)!=null&&e.loaded){t();return}else i.once("modelLoaded",()=>t())})})}const lt=document.createElement("div");lt.classList.add("behindFiveElement");lt.style.position="absolute";lt.style.top="0";lt.style.left="0";lt.style.width="100%";lt.style.height="100%";lt.style.pointerEvents="none";function wa(i){var e,n,o,s,r;const t=(r=(n=Di(i.getElement()))!=null?n:Di((e=i.getElement())==null?void 0:e.parentElement))!=null?r:Di((s=(o=i.getElement())==null?void 0:o.parentElement)==null?void 0:s.parentElement);if(t!=null&&t.parentElement)return t.parentElement.insertBefore(lt,t),lt;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 Di(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 Ca="v2.0.1",Li=`CSS3DRenderPlugin@${Ca}`;class Yc extends Nt{constructor(e){super();f(this,"five");f(this,"behindFiveContainer");f(this,"VERSION",Ca);f(this,"staticPrefix","//vrlab-static.ljcdn.com");f(this,"create3DDomContainer",(e,n)=>{if(this.state.disposed)return;const o=(()=>{var d;(n==null?void 0:n.dpr)!==void 0&&console.warn(`${Li}: please use "config.devicePixelRatio" replace "config.dpr"`);const u={ratio:.00216,devicePixelRatio:(d=n==null?void 0:n.dpr)!=null?d: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(`${Li}: 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,fe(Q({},o),{autoRender:!1}));if(!a)return;const l=()=>{const u=a.css3DObject.mode==="front"?s.parentElement:this.getBehindFiveElement();if(!u)return console.error(`${Li}: wrapper is ${u}`);a.appendToElement(u),a.render()},c=()=>{a.css3DObject.mode==="front"&&l(),a.css3DObject.mode==="behind"&&ya(this.five).then(()=>{l()})};return r&&c(),fe(Q({},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=wa(this.five),this.behindFiveContainer)}}const Kt=i=>new Yc(i);function Si(i,t,e=new V.Vector3(1,1,1),n=!1){const o=new ma.Line(i,t);return o.setMaterial({dashed:n,color:e,linewidth:1}),o.remove(o.points),o}const Uc=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,d=2,h=.1)=>{const m=d/2,v=c(u,h),p=new V.Group;p.add(Si(new V.Vector3(v.x+m,v.y,v.z),new V.Vector3(v.x-m,v.y,v.z),new V.Vector3(1,0,0)),Si(new V.Vector3(v.x,v.y+m,v.z),new V.Vector3(v.x,v.y-m,v.z),new V.Vector3(0,1,0)),Si(new V.Vector3(v.x,v.y,v.z+m),new V.Vector3(v.x,v.y,v.z-m),new V.Vector3(0,0,1))),i.scene.add(p),i.needsRender=!0;const g=()=>{i.scene.remove(p)};return t.disposers.push(g),{clear:g,pointAxesHelperMesh:p}},s=(u,d=0)=>{var g,b;const h=(g=i==null?void 0:i.camera)==null?void 0:g.position;if(!h)return!1;const m=u.distanceTo(h),A=u.sub(h).normalize(),v=new V.Raycaster(h,A),p=(b=i.model.intersectRaycaster(v))==null?void 0:b[0];return!(p&&p.distance+d<m)},r=()=>t.intersection,a=()=>{var u,d;(d=(u=t.disposers)==null?void 0:u.forEach)==null||d.call(u,h=>h==null?void 0:h()),i.off("intersectionOnModelUpdate",e),i.off("intersectionHidden",n)},l=a,c=(u,d)=>{const h=u.clone();return i.camera.position.clone().sub(h).setLength(d).add(h)};return{intersection:r,pointAxesHelper:o,movePointTowardsCamera:c,destroy:a,dispose:l,canSeePoint:s}};function U(){}const At=i=>i;function Be(i,t){for(const e in t)i[e]=t[e];return i}function qc(i){return i&&typeof i=="object"&&typeof i.then=="function"}function Ea(i){return i()}function Qo(){return Object.create(null)}function He(i){i.forEach(Ea)}function $t(i){return typeof i=="function"}function ne(i,t){return i!=i?t==t:i!==t||i&&typeof i=="object"||typeof i=="function"}let Bn;function Ne(i,t){return Bn||(Bn=document.createElement("a")),Bn.href=t,i===Bn.href}function Jc(i){return Object.keys(i).length===0}function en(i,t,e,n){if(i){const o=Pa(i,t,e,n);return i[0](o)}}function Pa(i,t,e,n){return i[1]&&n?Be(e.ctx.slice(),i[1](n(t))):e.ctx}function tn(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 nn(i,t,e,n,o,s){if(o){const r=Pa(t,e,n,s);i.p(r,o)}}function on(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 at(i){return i&&$t(i.destroy)?i.destroy:U}const Ia=typeof window!="undefined";let ka=Ia?()=>window.performance.now():()=>Date.now(),lo=Ia?i=>requestAnimationFrame(i):U;const _t=new Set;function xa(i){_t.forEach(t=>{t.c(i)||(_t.delete(t),t.f())}),_t.size!==0&&lo(xa)}function Da(i){let t;return _t.size===0&&lo(xa),{promise:new Promise(e=>{_t.add(t={c:i,f:e})}),abort(){_t.delete(t)}}}function j(i,t){i.appendChild(t)}function le(i,t,e){const n=co(i);if(!n.getElementById(t)){const o=z("style");o.id=t,o.textContent=e,La(n,o)}}function co(i){if(!i)return document;const t=i.getRootNode?i.getRootNode():i.ownerDocument;return t&&t.host?t:i.ownerDocument}function Zc(i){const t=z("style");return La(co(i),t),t.sheet}function La(i,t){return j(i.head||i,t),t.sheet}function M(i,t,e){i.insertBefore(t,e||null)}function S(i){i.parentNode&&i.parentNode.removeChild(i)}function ct(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 we(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function ke(i){return document.createTextNode(i)}function ee(){return ke(" ")}function me(){return ke("")}function ge(i,t,e,n){return i.addEventListener(t,e,n),()=>i.removeEventListener(t,e,n)}function Sa(i){return function(t){return t.stopPropagation(),i.call(this,t)}}function y(i,t,e){e==null?i.removeAttribute(t):i.getAttribute(t)!==e&&i.setAttribute(t,e)}function Kc(i){return Array.from(i.childNodes)}function Se(i,t){t=""+t,i.wholeText!==t&&(i.data=t)}function T(i,t,e,n){e===null?i.style.removeProperty(t):i.style.setProperty(t,e,n?"important":"")}let jn;function $c(){if(jn===void 0){jn=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(i){jn=!0}}return jn}function fi(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=$c();let s;return o?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=ge(window,"message",r=>{r.source===n.contentWindow&&t()})):(n.src="about:blank",n.onload=()=>{s=ge(n.contentWindow,"resize",t)}),j(i,n),()=>{(o||s&&n.contentWindow)&&s(),S(n)}}function q(i,t,e){i.classList[e?"add":"remove"](t)}function Ma(i,t,{bubbles:e=!1,cancelable:n=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(i,e,n,t),o}class ei{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=we(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)M(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(S)}}const ti=new Map;let ni=0;function eu(i){let t=5381,e=i.length;for(;e--;)t=(t<<5)-t^i.charCodeAt(e);return t>>>0}function tu(i,t){const e={stylesheet:Zc(t),rules:{}};return ti.set(i,e),e}function Ta(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 g=t+(e-t)*s(p);c+=p*100+`%{${r(g,1-g)}}
|
|
103
103
|
`}const u=c+`100% {${r(e,1-e)}}
|
|
104
|
-
}`,d=`__svelte_${eu(u)}_${a}`,h=co(i),{stylesheet:m,rules:A}=ti.get(h)||tu(h,i);A[d]||(A[d]=!0,m.insertRule(`@keyframes ${d} ${u}`,m.cssRules.length));const v=i.style.animation||"";return i.style.animation=`${v?`${v}, `:""}${d} ${n}ms linear ${o}ms 1 both`,ni+=1,d}function Yi(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(", "),ni-=o,ni||nu())}function nu(){lo(()=>{ni||(ti.forEach(i=>{const{ownerNode:t}=i.stylesheet;t&&S(t)}),ti.clear())})}let wn;function rt(i){wn=i}function Ct(){if(!wn)throw new Error("Function called outside component initialization");return wn}function za(i){Ct().$$.before_update.push(i)}function Ue(i){Ct().$$.on_mount.push(i)}function Ba(i){Ct().$$.after_update.push(i)}function Et(i){Ct().$$.on_destroy.push(i)}function mi(){const i=Ct();return(t,e,{cancelable:n=!1}={})=>{const o=i.$$.callbacks[t];if(o){const s=Ma(t,e,{cancelable:n});return o.slice().forEach(r=>{r.call(i,s)}),!s.defaultPrevented}return!0}}function Ui(i,t){return Ct().$$.context.set(i,t),t}function St(i){return Ct().$$.context.get(i)}function sn(i,t){const e=i.$$.callbacks[t.type];e&&e.slice().forEach(n=>n.call(this,t))}const mn=[],Ve=[],Un=[],qi=[],ja=Promise.resolve();let Ji=!1;function Va(){Ji||(Ji=!0,ja.then(uo))}function Fo(){return Va(),ja}function Oe(i){Un.push(i)}function iu(i){qi.push(i)}const Mi=new Set;let Vn=0;function uo(){const i=wn;do{for(;Vn<mn.length;){const t=mn[Vn];Vn++,rt(t),ou(t.$$)}for(rt(null),mn.length=0,Vn=0;Ve.length;)Ve.pop()();for(let t=0;t<Un.length;t+=1){const e=Un[t];Mi.has(e)||(Mi.add(e),e())}Un.length=0}while(mn.length);for(;qi.length;)qi.pop()();Ji=!1,Mi.clear(),rt(i)}function ou(i){if(i.fragment!==null){i.update(),He(i.before_update);const t=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,t),i.after_update.forEach(Oe)}}let cn;function Oa(){return cn||(cn=Promise.resolve(),cn.then(()=>{cn=null})),cn}function ii(i,t,e){i.dispatchEvent(Ma(`${t?"intro":"outro"}${e}`))}const qn=new Set;let mt;function se(){mt={r:0,c:[],p:mt}}function re(){mt.r||He(mt.c),mt=mt.p}function I(i,t){i&&i.i&&(qn.delete(i),i.i(t))}function L(i,t,e,n){if(i&&i.o){if(qn.has(i))return;qn.add(i),mt.c.push(()=>{qn.delete(i),n&&(e&&i.d(1),n())}),i.o(t)}else n&&n()}const Ra={duration:0};function Tt(i,t,e){let n=t(i,e),o=!1,s,r,a=0;function l(){s&&Yi(i,s)}function c(){const{delay:d=0,duration:h=300,easing:m=At,tick:A=U,css:v}=n||Ra;v&&(s=Ta(i,0,1,h,d,m,v,a++)),A(0,1);const p=ka()+d,g=p+h;r&&r.abort(),o=!0,Oe(()=>ii(i,!0,"start")),r=Da(b=>{if(o){if(b>=g)return A(1,0),ii(i,!0,"end"),l(),o=!1;if(b>=p){const w=m((b-p)/h);A(w,1-w)}}return o})}let u=!1;return{start(){u||(u=!0,Yi(i),$t(n)?(n=n(),Oa().then(c)):c())},invalidate(){u=!1},end(){o&&(l(),o=!1)}}}function rn(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:d=U,css:h}=n||Ra;h&&(s=Ta(i,1,0,c,l,u,h));const m=ka()+l,A=m+c;Oe(()=>ii(i,!1,"start")),Da(v=>{if(o){if(v>=A)return d(0,1),ii(i,!1,"end"),--r.r||He(r.c),!1;if(v>=m){const p=u((v-m)/c);d(1-p,p)}}return o})}return $t(n)?Oa().then(()=>{n=n(),a()}):a(),{end(l){l&&n.tick&&n.tick(1,0),o&&(s&&Yi(i,s),o=!1)}}}function oi(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((d,h)=>{h!==s&&d&&(se(),L(d,1,1,()=>{t.blocks[h]===d&&(t.blocks[h]=null)}),re())}):t.block.d(1),c.c(),I(c,1),c.m(t.mount(),t.anchor),u=!0),t.block=c,t.blocks&&(t.blocks[s]=c),u&&uo()}if(qc(i)){const o=Ct();if(i.then(s=>{rt(o),n(t.then,1,t.value,s),rt(null)},s=>{if(rt(o),n(t.catch,2,t.error,s),rt(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 Qa(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 su=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function ho(i,t){i.d(1),t.delete(i.key)}function Pt(i,t){L(i,1,1,()=>{t.delete(i.key)})}function qe(i,t,e,n,o,s,r,a,l,c,u,d){let h=i.length,m=s.length,A=h;const v={};for(;A--;)v[i[A].key]=A;const p=[],g=new Map,b=new Map;for(A=m;A--;){const C=d(o,s,A),D=e(C);let E=r.get(D);E?n&&E.p(C,t):(E=c(D,C),E.c()),g.set(D,p[A]=E),D in v&&b.set(D,Math.abs(A-v[D]))}const w=new Set,P=new Set;function x(C){I(C,1),C.m(a,u),r.set(C.key,C),u=C.first,m--}for(;h&&m;){const C=p[m-1],D=i[h-1],E=C.key,O=D.key;C===D?(u=C.first,h--,m--):g.has(O)?!r.has(E)||w.has(E)?x(C):P.has(O)?h--:b.get(E)>b.get(O)?(P.add(E),x(C)):(w.add(O),h--):(l(D,r),h--)}for(;h--;){const C=i[h];g.has(C.key)||l(C,r)}for(;m;)x(p[m-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 Fa(i){return typeof i=="object"&&i!==null?i:{}}function ru(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||Oe(()=>{const r=i.$$.on_mount.map(Ea).filter($t);i.$$.on_destroy?i.$$.on_destroy.push(...r):He(r),i.$$.on_mount=[]}),s.forEach(Oe)}function Z(i,t){const e=i.$$;e.fragment!==null&&(He(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function au(i,t){i.$$.dirty[0]===-1&&(mn.push(i),Va(),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=wn;rt(i);const c=i.$$={fragment:null,ctx:[],props:s,update:U,not_equal:o,bound:Qo(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:Qo(),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||{},(d,h,...m)=>{const A=m.length?m[0]:h;return c.ctx&&o(c.ctx[d],c.ctx[d]=A)&&(!c.skip_bound&&c.bound[d]&&c.bound[d](A),u&&au(i,d)),h}):[],c.update(),u=!0,He(c.before_update),c.fragment=n?n(c.ctx):!1,t.target){if(t.hydrate){const d=Kc(t.target);c.fragment&&c.fragment.l(d),d.forEach(S)}else c.fragment&&c.fragment.c();t.intro&&I(i.$$.fragment),J(i,t.target,t.anchor,t.customElement),uo()}rt(l)}class oe{$destroy(){Z(this,1),this.$destroy=U}$on(t,e){if(!$t(e))return U;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 lu="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+8Xjf9FRs1SdvNBBg2SDQ1xh9ALH4yN0M2BNZrKwtFc9Fmkquuma5HJBzvLiIONBnx40B7QIzTdxCcNwj3dYlEoUmabAU+UFZDpxah22Ng2NjQXH0LrwccGwyEzXfWhWQwSYQHYuFevXj14/vnn37h79+7Nr7766gup/FX5PnAj33///f/46aef3vj444/vfPbZ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YqLKk1JsTtvkr1gzjSONJCBT1a6+q40eoo/9WWyeK6OL5Ax/Edn2uKDEd9BM8tbzxe98IraJJM7CBP98JjHFmR+3vqxOXzmmWceaKU337CxGhqCTUVolIGMabAnhGgUb71iahI7fFf7FIFCb3j/18voiuemdd/Mu/+uE1sQWfeX3MBuyzx5B39P/fRcr4dcAT9p5bxl4zhIgNqgnlRkILKuf1654tIUCk2oLJYbQpr0ZqRrGt30C1tk4FnyQYccray31B3s9UQviG104IUGmZ8mH5v+3qF2w51nn332TzHCsI7KJzEVm6akEVuPhLWGhUeM0CAjvkHmxCM+uCYPD2R0f2Ilt7lB4tMGZ3i7qPqfe+65P6j3X1y5du3aZ3rSefrGjRsvkNxpI80AeTGC0NgGoakvuFYrtvDjD11okBF6m3yjdfze9eM7sbPQIC8sg8detlPdP7XCy8ASOh6IC534Qf126Au6Aq7S+0P9jOJ/f/jhh7dfeeWVN1C4c+cOv5zoxsQgKD7O/OgIT3OLgrrkLAMR9EuQYsXLlWO5ePNMJ25s7Fhv8EIraduDDOJI7kfh6FT98M6Ka/GrLbE0/131X79+/YVXX331+tNPP32b3nt1tGhXP/rooz/ruf9N/YzWQ/2e2c8Cfg7Wz8RC9WkeE8pj/rQltMRH/jXdsdreAEp04mg8u22zYhvZ9IPueLE4puMLfnjRKzKCbD4ZHv9oK/mwaPOlm/ukkbFwjKLj428j8t8DEEvN9xJoJuhsDI9lxOeHXr3zE8cGm7fpQMfNgR54ntXmYXzx1ltvbX64VUl4SH//66+/fl2/5ndLC/BHMV/Q6ypN06Bm3lgFaKMcEbj+bDHN88/curvewF4hjhNWasrwhy/0waIPjylyYjp49Ag++NhFhi7F+jeEFcc/H6w5TYbnxo2OoufXmNPcX+XWv4QLMo+taJkfeY4gvtRs/n8vzY/cssxB5CyKxi96/aB+/Y9+KfE/X3vttS8lI7e9/wfu514OAjYP0QAAAABJRU5ErkJggg==";function cu(i){le(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 uu(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=ee(),r=z("div"),y(e,"class","room-label-item__text svelte-1d7uzh5"),T(e,"background-image","url("+lu+")"),q(e,"wide",i[0].name.length>3),y(r,"class","room-label-item__bar svelte-1d7uzh5"),y(t,"class","room-label-item svelte-1d7uzh5"),T(t,"z-index",i[0].zIndex),T(t,"transform",i[0].transform),T(t,"opacity",i[0].visible?1:0)},m(c,u){M(c,t,u),j(t,e),j(e,o),j(t,s),j(t,r),a||(l=ge(e,"click",i[1]),a=!0)},p(c,[u]){u&1&&n!==(n=c[0].name+"")&&Se(o,n),u&1&&q(e,"wide",c[0].name.length>3),u&1&&T(t,"z-index",c[0].zIndex),u&1&&T(t,"transform",c[0].transform),u&1&&T(t,"opacity",c[0].visible?1:0)},i:U,o:U,d(c){c&&S(t),a=!1,l()}}}function du(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 hu extends oe{constructor(t){super(),ie(this,t,du,uu,ne,{five:2,roomLabel:0},cu)}}var Ha=function(){if(typeof Map!="undefined")return Map;function i(t,e){var n=-1;return t.some(function(o,s){return o[0]===e?(n=s,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(e){var n=i(this.__entries__,e),o=this.__entries__[n];return o&&o[1]},t.prototype.set=function(e,n){var o=i(this.__entries__,e);~o?this.__entries__[o][1]=n:this.__entries__.push([e,n])},t.prototype.delete=function(e){var n=this.__entries__,o=i(n,e);~o&&n.splice(o,1)},t.prototype.has=function(e){return!!~i(this.__entries__,e)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,n){n===void 0&&(n=null);for(var o=0,s=this.__entries__;o<s.length;o++){var r=s[o];e.call(n,r[1],r[0])}},t}()}(),Zi=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,si=function(){return typeof global!="undefined"&&global.Math===Math?global:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),fu=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(si):function(i){return setTimeout(function(){return i(Date.now())},1e3/60)}}(),mu=2;function pu(i,t){var e=!1,n=!1,o=0;function s(){e&&(e=!1,i()),n&&a()}function r(){fu(s)}function a(){var l=Date.now();if(e){if(l-o<mu)return;n=!0}else e=!0,n=!1,setTimeout(r,t);o=l}return a}var gu=20,Au=["top","right","bottom","left","width","height","size","weight"],vu=typeof MutationObserver!="undefined",bu=function(){function i(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=pu(this.refresh.bind(this),gu)}return i.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},i.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},i.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},i.prototype.updateObservers_=function(){var t=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return t.forEach(function(e){return e.broadcastActive()}),t.length>0},i.prototype.connect_=function(){!Zi||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),vu?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},i.prototype.disconnect_=function(){!Zi||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},i.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=e===void 0?"":e,o=Au.some(function(s){return!!~n.indexOf(s)});o&&this.refresh()},i.getInstance=function(){return this.instance_||(this.instance_=new i),this.instance_},i.instance_=null,i}(),_a=function(i,t){for(var e=0,n=Object.keys(t);e<n.length;e++){var o=n[e];Object.defineProperty(i,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return i},Xt=function(i){var t=i&&i.ownerDocument&&i.ownerDocument.defaultView;return t||si},Ga=pi(0,0,0,0);function ri(i){return parseFloat(i)||0}function Ho(i){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return t.reduce(function(n,o){var s=i["border-"+o+"-width"];return n+ri(s)},0)}function yu(i){for(var t=["top","right","bottom","left"],e={},n=0,o=t;n<o.length;n++){var s=o[n],r=i["padding-"+s];e[s]=ri(r)}return e}function wu(i){var t=i.getBBox();return pi(0,0,t.width,t.height)}function Cu(i){var t=i.clientWidth,e=i.clientHeight;if(!t&&!e)return Ga;var n=Xt(i).getComputedStyle(i),o=yu(n),s=o.left+o.right,r=o.top+o.bottom,a=ri(n.width),l=ri(n.height);if(n.boxSizing==="border-box"&&(Math.round(a+s)!==t&&(a-=Ho(n,"left","right")+s),Math.round(l+r)!==e&&(l-=Ho(n,"top","bottom")+r)),!Pu(i)){var c=Math.round(a+s)-t,u=Math.round(l+r)-e;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return pi(o.left,o.top,a,l)}var Eu=function(){return typeof SVGGraphicsElement!="undefined"?function(i){return i instanceof Xt(i).SVGGraphicsElement}:function(i){return i instanceof Xt(i).SVGElement&&typeof i.getBBox=="function"}}();function Pu(i){return i===Xt(i).document.documentElement}function Iu(i){return Zi?Eu(i)?wu(i):Cu(i):Ga}function ku(i){var t=i.x,e=i.y,n=i.width,o=i.height,s=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,r=Object.create(s.prototype);return _a(r,{x:t,y:e,width:n,height:o,top:e,right:t+n,bottom:o+e,left:t}),r}function pi(i,t,e,n){return{x:i,y:t,width:e,height:n}}var xu=function(){function i(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=pi(0,0,0,0),this.target=t}return i.prototype.isActive=function(){var t=Iu(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},i.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},i}(),Du=function(){function i(t,e){var n=ku(e);_a(this,{target:t,contentRect:n})}return i}(),Lu=function(){function i(t,e,n){if(this.activeObservations_=[],this.observations_=new Ha,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=n}return i.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(t instanceof Xt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new xu(t)),this.controller_.addObserver(this),this.controller_.refresh())}},i.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(t instanceof Xt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;!e.has(t)||(e.delete(t),e.size||this.controller_.removeObserver(this))}},i.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},i.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(e){e.isActive()&&t.activeObservations_.push(e)})},i.prototype.broadcastActive=function(){if(!!this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map(function(n){return new Du(n.target,n.broadcastRect())});this.callback_.call(t,e,t),this.clearActive()}},i.prototype.clearActive=function(){this.activeObservations_.splice(0)},i.prototype.hasActive=function(){return this.activeObservations_.length>0},i}(),Wa=typeof WeakMap!="undefined"?new WeakMap:new Ha,Na=function(){function i(t){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var e=bu.getInstance(),n=new Lu(t,e,this);Wa.set(this,n)}return i}();["observe","unobserve","disconnect"].forEach(function(i){Na.prototype[i]=function(){var t;return(t=Wa.get(this))[i].apply(t,arguments)}});var Su=function(){return typeof si.ResizeObserver!="undefined"?si.ResizeObserver:Na}();function an(i){new Su((e,n)=>{for(const o of e){const{borderBoxSize:s}=o,r=s[0].inlineSize,a=s[0].blockSize;i.dispatchEvent(new CustomEvent("clientWidth",{detail:r})),i.dispatchEvent(new CustomEvent("clientHeight",{detail:a}))}}).observe(i)}const{Map:Mu}=su;function Tu(i){le(i,"svelte-9eg4zi",".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}")}function _o(i,t,e){const n=i.slice();return n[13]=t[e],n}function Go(i,t){let e,n,o;return n=new hu({props:{roomLabel:t[13],five:t[1]}}),{key:i,first:null,c(){e=me(),K(n.$$.fragment),this.first=e},m(s,r){M(s,e,r),J(n,s,r),o=!0},p(s,r){t=s;const a={};r&1&&(a.roomLabel=t[13]),r&2&&(a.five=t[1]),n.$set(a)},i(s){o||(I(n.$$.fragment,s),o=!0)},o(s){L(n.$$.fragment,s),o=!1},d(s){s&&S(e),Z(n,s)}}}function zu(i){let t,e=[],n=new Mu,o,s,r,a=i[0];const l=c=>c[13].id;for(let c=0;c<a.length;c+=1){let u=_o(i,a,c),d=l(u);n.set(d,e[c]=Go(d,u))}return{c(){t=z("div");for(let c=0;c<e.length;c+=1)e[c].c();y(t,"class","room-labels-container svelte-9eg4zi")},m(c,u){M(c,t,u);for(let d=0;d<e.length;d+=1)e[d].m(t,null);o=!0,s||(r=[at(an.call(null,t)),ge(t,"clientWidth",i[6]),ge(t,"clientHeight",i[7])],s=!0)},p(c,[u]){u&3&&(a=c[0],se(),e=qe(e,u,l,1,c,a,n,t,Pt,Go,null,_o),re())},i(c){if(!o){for(let u=0;u<a.length;u+=1)I(e[u]);o=!0}},o(c){for(let u=0;u<e.length;u+=1)L(e[u]);o=!1},d(c){c&&S(t);for(let u=0;u<e.length;u+=1)e[u].d();s=!1,He(r)}}}function Bu(i,t,e){var p;let n,{five:o}=t,{roomLabels:s}=t,r,a,l=(p=o.model.shownFloor)!=null?p:null;function c(g){if(!(l===null||g.floorIndex===l))return!1;const w=new V.Raycaster,P=o.camera.position.clone(),x=new V.Vector3(g.position.x,g.position.y,g.position.z),C=x.distanceTo(P);w.set(P.clone(),x.clone().sub(P).normalize());const[D]=o.model.intersectRaycaster(w);return!(D&&D.distance+1<C)}function u(g,b){const P=new V.Vector3(g.position.x,g.position.y,g.position.z).clone().project(o.camera),x=Math.ceil((P.x+1)/2*b.x),C=Math.ceil((-P.y+1)/2*b.y);return`translate(${x}px, ${C}px)`}function d(g){const{rendererSize:b,shownFloor:w}=g,P=new Map;function x(D){const E=P.get(D.id);if(E)return E;const{x:O,y:G,z:X}=D.position,H=new V.Vector3(O,G,X).clone().distanceTo(o.camera.position);return P.set(D.id,H),H}return s.map(D=>{const E=c(D),O=E?u(D,b):D.transform,G=x(D),H=s.filter(B=>B.visible&&x(B)<G).length*10;return fe(Q({},D),{visible:E,transform:O,zIndex:H})})}function h(){e(0,s=d({rendererSize:n,shownFloor:l}))}function m(g){e(4,l=g)}o.on("cameraUpdate",h),o.on("modelShownFloorChange",m),Ba(()=>{e(0,s=d({rendererSize:n,shownFloor:l}))}),Et(()=>{o.off("cameraUpdate",h),o.off("modelShownFloorChange",m)});const A=g=>{e(2,r=g.detail)},v=g=>{e(3,a=g.detail)};return i.$$set=g=>{"five"in g&&e(1,o=g.five),"roomLabels"in g&&e(0,s=g.roomLabels)},i.$$.update=()=>{i.$$.dirty&12&&e(5,n={x:r,y:a}),i.$$.dirty&48&&e(0,s=d({rendererSize:n,shownFloor:l}))},[s,o,r,a,l,n,A,v]}class ju extends oe{constructor(t){super(),ie(this,t,Bu,zu,ne,{five:1,roomLabels:0},Tu)}}function Vu(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 Ou{constructor(t){f(this,"five");f(this,"enabled",!0);f(this,"fiveModeEnabled");f(this,"app");f(this,"wrapper");f(this,"roomLabels",[]);f(this,"container",document.createElement("div"));f(this,"onFiveModeChange",t=>{if(!this.checkFiveMode(t)){this.fiveModeEnabled=!1,this.render();return}this.five.once("initAnimationEnded",()=>{this.fiveModeEnabled=this.checkFiveMode(this.five.getCurrentState().mode),this.render()})});this.five=t,this.fiveModeEnabled=this.checkFiveMode(t.getCurrentState().mode),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=Vu(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}checkFiveMode(t){return t==="Floorplan"||t==="Mapview"}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 ju({target:this.container,props:{five:this.five,roomLabels:this.roomLabels}})}}}const Ru=i=>new Ou(i),Qu={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 ai(i){return W(this,null,function*(){try{return[null,yield i]}catch(t){return t instanceof Error?[t,null]:[new Error(""),null]}})}function li(i){return Object.prototype.toString.call(i)==="[object Object]"}function gi(i,t){return i===t?!0:typeof i!=typeof t?!1:!!(Number.isNaN(i)&&Number.isNaN(t))}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(!gi(i[r],t[r]))return!1}return!0}function Hu(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!gi(i[e],t[e]))return!1;return!0}function _u(i,t){return gi(i,t)?!0:li(i)&&li(t)?Fu(i,t):Array.isArray(i)&&Array.isArray(t)?Hu(i,t):!1}function fo(i,t){return gi(i,t)?!0:li(i)&&li(t)?Wu(i,t):Array.isArray(i)&&Array.isArray(t)?Gu(i,t):!1}function Gu(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!fo(i[e],t[e]))return!1;return!0}function Wu(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(!fo(i[r],t[r]))return!1}return!0}function et(i,t,e={deep:!1}){return e.deep?fo(i,t):_u(i,t)}function Yt(i){return i<.5?4*i*i*i:.5*Math.pow(2*i-2,3)+1}function Xa(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 Wo(i,{delay:t=0,duration:e=400,easing:n=Xa,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:(d,h)=>`
|
|
104
|
+
}`,d=`__svelte_${eu(u)}_${a}`,h=co(i),{stylesheet:m,rules:A}=ti.get(h)||tu(h,i);A[d]||(A[d]=!0,m.insertRule(`@keyframes ${d} ${u}`,m.cssRules.length));const v=i.style.animation||"";return i.style.animation=`${v?`${v}, `:""}${d} ${n}ms linear ${o}ms 1 both`,ni+=1,d}function Yi(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(", "),ni-=o,ni||nu())}function nu(){lo(()=>{ni||(ti.forEach(i=>{const{ownerNode:t}=i.stylesheet;t&&S(t)}),ti.clear())})}let wn;function rt(i){wn=i}function Ct(){if(!wn)throw new Error("Function called outside component initialization");return wn}function za(i){Ct().$$.before_update.push(i)}function Ue(i){Ct().$$.on_mount.push(i)}function Ba(i){Ct().$$.after_update.push(i)}function Et(i){Ct().$$.on_destroy.push(i)}function mi(){const i=Ct();return(t,e,{cancelable:n=!1}={})=>{const o=i.$$.callbacks[t];if(o){const s=Ma(t,e,{cancelable:n});return o.slice().forEach(r=>{r.call(i,s)}),!s.defaultPrevented}return!0}}function Ui(i,t){return Ct().$$.context.set(i,t),t}function St(i){return Ct().$$.context.get(i)}function sn(i,t){const e=i.$$.callbacks[t.type];e&&e.slice().forEach(n=>n.call(this,t))}const mn=[],Ve=[],Un=[],qi=[],ja=Promise.resolve();let Ji=!1;function Va(){Ji||(Ji=!0,ja.then(uo))}function Fo(){return Va(),ja}function Oe(i){Un.push(i)}function iu(i){qi.push(i)}const Mi=new Set;let Vn=0;function uo(){const i=wn;do{for(;Vn<mn.length;){const t=mn[Vn];Vn++,rt(t),ou(t.$$)}for(rt(null),mn.length=0,Vn=0;Ve.length;)Ve.pop()();for(let t=0;t<Un.length;t+=1){const e=Un[t];Mi.has(e)||(Mi.add(e),e())}Un.length=0}while(mn.length);for(;qi.length;)qi.pop()();Ji=!1,Mi.clear(),rt(i)}function ou(i){if(i.fragment!==null){i.update(),He(i.before_update);const t=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,t),i.after_update.forEach(Oe)}}let cn;function Oa(){return cn||(cn=Promise.resolve(),cn.then(()=>{cn=null})),cn}function ii(i,t,e){i.dispatchEvent(Ma(`${t?"intro":"outro"}${e}`))}const qn=new Set;let mt;function se(){mt={r:0,c:[],p:mt}}function re(){mt.r||He(mt.c),mt=mt.p}function I(i,t){i&&i.i&&(qn.delete(i),i.i(t))}function L(i,t,e,n){if(i&&i.o){if(qn.has(i))return;qn.add(i),mt.c.push(()=>{qn.delete(i),n&&(e&&i.d(1),n())}),i.o(t)}else n&&n()}const Ra={duration:0};function Tt(i,t,e){let n=t(i,e),o=!1,s,r,a=0;function l(){s&&Yi(i,s)}function c(){const{delay:d=0,duration:h=300,easing:m=At,tick:A=U,css:v}=n||Ra;v&&(s=Ta(i,0,1,h,d,m,v,a++)),A(0,1);const p=ka()+d,g=p+h;r&&r.abort(),o=!0,Oe(()=>ii(i,!0,"start")),r=Da(b=>{if(o){if(b>=g)return A(1,0),ii(i,!0,"end"),l(),o=!1;if(b>=p){const w=m((b-p)/h);A(w,1-w)}}return o})}let u=!1;return{start(){u||(u=!0,Yi(i),$t(n)?(n=n(),Oa().then(c)):c())},invalidate(){u=!1},end(){o&&(l(),o=!1)}}}function rn(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:d=U,css:h}=n||Ra;h&&(s=Ta(i,1,0,c,l,u,h));const m=ka()+l,A=m+c;Oe(()=>ii(i,!1,"start")),Da(v=>{if(o){if(v>=A)return d(0,1),ii(i,!1,"end"),--r.r||He(r.c),!1;if(v>=m){const p=u((v-m)/c);d(1-p,p)}}return o})}return $t(n)?Oa().then(()=>{n=n(),a()}):a(),{end(l){l&&n.tick&&n.tick(1,0),o&&(s&&Yi(i,s),o=!1)}}}function oi(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((d,h)=>{h!==s&&d&&(se(),L(d,1,1,()=>{t.blocks[h]===d&&(t.blocks[h]=null)}),re())}):t.block.d(1),c.c(),I(c,1),c.m(t.mount(),t.anchor),u=!0),t.block=c,t.blocks&&(t.blocks[s]=c),u&&uo()}if(qc(i)){const o=Ct();if(i.then(s=>{rt(o),n(t.then,1,t.value,s),rt(null)},s=>{if(rt(o),n(t.catch,2,t.error,s),rt(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 Qa(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 su=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function ho(i,t){i.d(1),t.delete(i.key)}function Pt(i,t){L(i,1,1,()=>{t.delete(i.key)})}function qe(i,t,e,n,o,s,r,a,l,c,u,d){let h=i.length,m=s.length,A=h;const v={};for(;A--;)v[i[A].key]=A;const p=[],g=new Map,b=new Map;for(A=m;A--;){const C=d(o,s,A),D=e(C);let E=r.get(D);E?n&&E.p(C,t):(E=c(D,C),E.c()),g.set(D,p[A]=E),D in v&&b.set(D,Math.abs(A-v[D]))}const w=new Set,P=new Set;function x(C){I(C,1),C.m(a,u),r.set(C.key,C),u=C.first,m--}for(;h&&m;){const C=p[m-1],D=i[h-1],E=C.key,O=D.key;C===D?(u=C.first,h--,m--):g.has(O)?!r.has(E)||w.has(E)?x(C):P.has(O)?h--:b.get(E)>b.get(O)?(P.add(E),x(C)):(w.add(O),h--):(l(D,r),h--)}for(;h--;){const C=i[h];g.has(C.key)||l(C,r)}for(;m;)x(p[m-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 Fa(i){return typeof i=="object"&&i!==null?i:{}}function ru(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||Oe(()=>{const r=i.$$.on_mount.map(Ea).filter($t);i.$$.on_destroy?i.$$.on_destroy.push(...r):He(r),i.$$.on_mount=[]}),s.forEach(Oe)}function Z(i,t){const e=i.$$;e.fragment!==null&&(He(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function au(i,t){i.$$.dirty[0]===-1&&(mn.push(i),Va(),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=wn;rt(i);const c=i.$$={fragment:null,ctx:[],props:s,update:U,not_equal:o,bound:Qo(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:Qo(),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||{},(d,h,...m)=>{const A=m.length?m[0]:h;return c.ctx&&o(c.ctx[d],c.ctx[d]=A)&&(!c.skip_bound&&c.bound[d]&&c.bound[d](A),u&&au(i,d)),h}):[],c.update(),u=!0,He(c.before_update),c.fragment=n?n(c.ctx):!1,t.target){if(t.hydrate){const d=Kc(t.target);c.fragment&&c.fragment.l(d),d.forEach(S)}else c.fragment&&c.fragment.c();t.intro&&I(i.$$.fragment),J(i,t.target,t.anchor,t.customElement),uo()}rt(l)}class oe{$destroy(){Z(this,1),this.$destroy=U}$on(t,e){if(!$t(e))return U;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 lu="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+8Xjf9FRs1SdvNBBg2SDQ1xh9ALH4yN0M2BNZrKwtFc9Fmkquuma5HJBzvLiIONBnx40B7QIzTdxCcNwj3dYlEoUmabAU+UFZDpxah22Ng2NjQXH0LrwccGwyEzXfWhWQwSYQHYuFevXj14/v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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 uu(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=ee(),r=z("div"),y(e,"class","room-label-item__text svelte-1d7uzh5"),T(e,"background-image","url("+lu+")"),q(e,"wide",i[0].name.length>3),y(r,"class","room-label-item__bar svelte-1d7uzh5"),y(t,"class","room-label-item svelte-1d7uzh5"),T(t,"z-index",i[0].zIndex),T(t,"transform",i[0].transform),T(t,"opacity",i[0].visible?1:0)},m(c,u){M(c,t,u),j(t,e),j(e,o),j(t,s),j(t,r),a||(l=ge(e,"click",i[1]),a=!0)},p(c,[u]){u&1&&n!==(n=c[0].name+"")&&Se(o,n),u&1&&q(e,"wide",c[0].name.length>3),u&1&&T(t,"z-index",c[0].zIndex),u&1&&T(t,"transform",c[0].transform),u&1&&T(t,"opacity",c[0].visible?1:0)},i:U,o:U,d(c){c&&S(t),a=!1,l()}}}function du(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 hu extends oe{constructor(t){super(),ie(this,t,du,uu,ne,{five:2,roomLabel:0},cu)}}var Ha=function(){if(typeof Map!="undefined")return Map;function i(t,e){var n=-1;return t.some(function(o,s){return o[0]===e?(n=s,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(e){var n=i(this.__entries__,e),o=this.__entries__[n];return o&&o[1]},t.prototype.set=function(e,n){var o=i(this.__entries__,e);~o?this.__entries__[o][1]=n:this.__entries__.push([e,n])},t.prototype.delete=function(e){var n=this.__entries__,o=i(n,e);~o&&n.splice(o,1)},t.prototype.has=function(e){return!!~i(this.__entries__,e)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,n){n===void 0&&(n=null);for(var o=0,s=this.__entries__;o<s.length;o++){var r=s[o];e.call(n,r[1],r[0])}},t}()}(),Zi=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,si=function(){return typeof global!="undefined"&&global.Math===Math?global:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),fu=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(si):function(i){return setTimeout(function(){return i(Date.now())},1e3/60)}}(),mu=2;function pu(i,t){var e=!1,n=!1,o=0;function s(){e&&(e=!1,i()),n&&a()}function r(){fu(s)}function a(){var l=Date.now();if(e){if(l-o<mu)return;n=!0}else e=!0,n=!1,setTimeout(r,t);o=l}return a}var gu=20,Au=["top","right","bottom","left","width","height","size","weight"],vu=typeof MutationObserver!="undefined",bu=function(){function i(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=pu(this.refresh.bind(this),gu)}return i.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},i.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},i.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},i.prototype.updateObservers_=function(){var t=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return t.forEach(function(e){return e.broadcastActive()}),t.length>0},i.prototype.connect_=function(){!Zi||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),vu?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},i.prototype.disconnect_=function(){!Zi||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},i.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=e===void 0?"":e,o=Au.some(function(s){return!!~n.indexOf(s)});o&&this.refresh()},i.getInstance=function(){return this.instance_||(this.instance_=new i),this.instance_},i.instance_=null,i}(),_a=function(i,t){for(var e=0,n=Object.keys(t);e<n.length;e++){var o=n[e];Object.defineProperty(i,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return i},Xt=function(i){var t=i&&i.ownerDocument&&i.ownerDocument.defaultView;return t||si},Ga=pi(0,0,0,0);function ri(i){return parseFloat(i)||0}function Ho(i){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return t.reduce(function(n,o){var s=i["border-"+o+"-width"];return n+ri(s)},0)}function yu(i){for(var t=["top","right","bottom","left"],e={},n=0,o=t;n<o.length;n++){var s=o[n],r=i["padding-"+s];e[s]=ri(r)}return e}function wu(i){var t=i.getBBox();return pi(0,0,t.width,t.height)}function Cu(i){var t=i.clientWidth,e=i.clientHeight;if(!t&&!e)return Ga;var n=Xt(i).getComputedStyle(i),o=yu(n),s=o.left+o.right,r=o.top+o.bottom,a=ri(n.width),l=ri(n.height);if(n.boxSizing==="border-box"&&(Math.round(a+s)!==t&&(a-=Ho(n,"left","right")+s),Math.round(l+r)!==e&&(l-=Ho(n,"top","bottom")+r)),!Pu(i)){var c=Math.round(a+s)-t,u=Math.round(l+r)-e;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return pi(o.left,o.top,a,l)}var Eu=function(){return typeof SVGGraphicsElement!="undefined"?function(i){return i instanceof Xt(i).SVGGraphicsElement}:function(i){return i instanceof Xt(i).SVGElement&&typeof i.getBBox=="function"}}();function Pu(i){return i===Xt(i).document.documentElement}function Iu(i){return Zi?Eu(i)?wu(i):Cu(i):Ga}function ku(i){var t=i.x,e=i.y,n=i.width,o=i.height,s=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,r=Object.create(s.prototype);return _a(r,{x:t,y:e,width:n,height:o,top:e,right:t+n,bottom:o+e,left:t}),r}function pi(i,t,e,n){return{x:i,y:t,width:e,height:n}}var xu=function(){function i(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=pi(0,0,0,0),this.target=t}return i.prototype.isActive=function(){var t=Iu(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},i.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},i}(),Du=function(){function i(t,e){var n=ku(e);_a(this,{target:t,contentRect:n})}return i}(),Lu=function(){function i(t,e,n){if(this.activeObservations_=[],this.observations_=new Ha,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=n}return i.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(t instanceof Xt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new xu(t)),this.controller_.addObserver(this),this.controller_.refresh())}},i.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(t instanceof Xt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;!e.has(t)||(e.delete(t),e.size||this.controller_.removeObserver(this))}},i.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},i.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(e){e.isActive()&&t.activeObservations_.push(e)})},i.prototype.broadcastActive=function(){if(!!this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map(function(n){return new Du(n.target,n.broadcastRect())});this.callback_.call(t,e,t),this.clearActive()}},i.prototype.clearActive=function(){this.activeObservations_.splice(0)},i.prototype.hasActive=function(){return this.activeObservations_.length>0},i}(),Wa=typeof WeakMap!="undefined"?new WeakMap:new Ha,Na=function(){function i(t){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var e=bu.getInstance(),n=new Lu(t,e,this);Wa.set(this,n)}return i}();["observe","unobserve","disconnect"].forEach(function(i){Na.prototype[i]=function(){var t;return(t=Wa.get(this))[i].apply(t,arguments)}});var Su=function(){return typeof si.ResizeObserver!="undefined"?si.ResizeObserver:Na}();function an(i){new Su((e,n)=>{var o,s,r,a,l,c;for(const u of e){const{borderBoxSize:d,contentRect:h}=u,m=(r=(s=(o=d==null?void 0:d[0])==null?void 0:o.inlineSize)!=null?s:h.width)!=null?r:i.clientWidth,A=(c=(l=(a=d==null?void 0:d[0])==null?void 0:a.blockSize)!=null?l:h.height)!=null?c:i.clientHeight;i.dispatchEvent(new CustomEvent("clientWidth",{detail:m})),i.dispatchEvent(new CustomEvent("clientHeight",{detail:A}))}}).observe(i)}const{Map:Mu}=su;function Tu(i){le(i,"svelte-9eg4zi",".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}")}function _o(i,t,e){const n=i.slice();return n[13]=t[e],n}function Go(i,t){let e,n,o;return n=new hu({props:{roomLabel:t[13],five:t[1]}}),{key:i,first:null,c(){e=me(),K(n.$$.fragment),this.first=e},m(s,r){M(s,e,r),J(n,s,r),o=!0},p(s,r){t=s;const a={};r&1&&(a.roomLabel=t[13]),r&2&&(a.five=t[1]),n.$set(a)},i(s){o||(I(n.$$.fragment,s),o=!0)},o(s){L(n.$$.fragment,s),o=!1},d(s){s&&S(e),Z(n,s)}}}function zu(i){let t,e=[],n=new Mu,o,s,r,a=i[0];const l=c=>c[13].id;for(let c=0;c<a.length;c+=1){let u=_o(i,a,c),d=l(u);n.set(d,e[c]=Go(d,u))}return{c(){t=z("div");for(let c=0;c<e.length;c+=1)e[c].c();y(t,"class","room-labels-container svelte-9eg4zi")},m(c,u){M(c,t,u);for(let d=0;d<e.length;d+=1)e[d].m(t,null);o=!0,s||(r=[at(an.call(null,t)),ge(t,"clientWidth",i[6]),ge(t,"clientHeight",i[7])],s=!0)},p(c,[u]){u&3&&(a=c[0],se(),e=qe(e,u,l,1,c,a,n,t,Pt,Go,null,_o),re())},i(c){if(!o){for(let u=0;u<a.length;u+=1)I(e[u]);o=!0}},o(c){for(let u=0;u<e.length;u+=1)L(e[u]);o=!1},d(c){c&&S(t);for(let u=0;u<e.length;u+=1)e[u].d();s=!1,He(r)}}}function Bu(i,t,e){var p;let n,{five:o}=t,{roomLabels:s}=t,r,a,l=(p=o.model.shownFloor)!=null?p:null;function c(g){if(!(l===null||g.floorIndex===l))return!1;const w=new V.Raycaster,P=o.camera.position.clone(),x=new V.Vector3(g.position.x,g.position.y,g.position.z),C=x.distanceTo(P);w.set(P.clone(),x.clone().sub(P).normalize());const[D]=o.model.intersectRaycaster(w);return!(D&&D.distance+1<C)}function u(g,b){const P=new V.Vector3(g.position.x,g.position.y,g.position.z).clone().project(o.camera),x=Math.ceil((P.x+1)/2*b.x),C=Math.ceil((-P.y+1)/2*b.y);return`translate(${x}px, ${C}px)`}function d(g){const{rendererSize:b,shownFloor:w}=g,P=new Map;function x(D){const E=P.get(D.id);if(E)return E;const{x:O,y:G,z:X}=D.position,H=new V.Vector3(O,G,X).clone().distanceTo(o.camera.position);return P.set(D.id,H),H}return s.map(D=>{const E=c(D),O=E?u(D,b):D.transform,G=x(D),H=s.filter(B=>B.visible&&x(B)<G).length*10;return fe(Q({},D),{visible:E,transform:O,zIndex:H})})}function h(){e(0,s=d({rendererSize:n,shownFloor:l}))}function m(g){e(4,l=g)}o.on("cameraUpdate",h),o.on("modelShownFloorChange",m),Ba(()=>{e(0,s=d({rendererSize:n,shownFloor:l}))}),Et(()=>{o.off("cameraUpdate",h),o.off("modelShownFloorChange",m)});const A=g=>{e(2,r=g.detail)},v=g=>{e(3,a=g.detail)};return i.$$set=g=>{"five"in g&&e(1,o=g.five),"roomLabels"in g&&e(0,s=g.roomLabels)},i.$$.update=()=>{i.$$.dirty&12&&e(5,n={x:r,y:a}),i.$$.dirty&48&&e(0,s=d({rendererSize:n,shownFloor:l}))},[s,o,r,a,l,n,A,v]}class ju extends oe{constructor(t){super(),ie(this,t,Bu,zu,ne,{five:1,roomLabels:0},Tu)}}function Vu(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 Ou{constructor(t){f(this,"five");f(this,"enabled",!0);f(this,"fiveModeEnabled");f(this,"app");f(this,"wrapper");f(this,"roomLabels",[]);f(this,"container",document.createElement("div"));f(this,"onFiveModeChange",t=>{if(!this.checkFiveMode(t)){this.fiveModeEnabled=!1,this.render();return}this.five.once("initAnimationEnded",()=>{this.fiveModeEnabled=this.checkFiveMode(this.five.getCurrentState().mode),this.render()})});this.five=t,this.fiveModeEnabled=this.checkFiveMode(t.getCurrentState().mode),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=Vu(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}checkFiveMode(t){return t==="Floorplan"||t==="Mapview"}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 ju({target:this.container,props:{five:this.five,roomLabels:this.roomLabels}})}}}const Ru=i=>new Ou(i),Qu={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 ai(i){return W(this,null,function*(){try{return[null,yield i]}catch(t){return t instanceof Error?[t,null]:[new Error(""),null]}})}function li(i){return Object.prototype.toString.call(i)==="[object Object]"}function gi(i,t){return i===t?!0:typeof i!=typeof t?!1:!!(Number.isNaN(i)&&Number.isNaN(t))}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(!gi(i[r],t[r]))return!1}return!0}function Hu(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!gi(i[e],t[e]))return!1;return!0}function _u(i,t){return gi(i,t)?!0:li(i)&&li(t)?Fu(i,t):Array.isArray(i)&&Array.isArray(t)?Hu(i,t):!1}function fo(i,t){return gi(i,t)?!0:li(i)&&li(t)?Wu(i,t):Array.isArray(i)&&Array.isArray(t)?Gu(i,t):!1}function Gu(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!fo(i[e],t[e]))return!1;return!0}function Wu(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(!fo(i[r],t[r]))return!1}return!0}function et(i,t,e={deep:!1}){return e.deep?fo(i,t):_u(i,t)}function Yt(i){return i<.5?4*i*i*i:.5*Math.pow(2*i-2,3)+1}function Xa(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 Wo(i,{delay:t=0,duration:e=400,easing:n=Xa,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:(d,h)=>`
|
|
105
105
|
transform: ${c} translate(${(1-d)*o}px, ${(1-d)*s}px);
|
|
106
106
|
opacity: ${l-u*h}`}}function ci(i,{delay:t=0,speed:e,duration:n,easing:o=Yt}={}){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/+Nt/+Krv+Ho/+Rwf+Ouv+Emv+Amv+SxP+Sw/+NuP+Mtf/G0f6huP+Ot/+JrP+Jqv+Dnv+crf6Uqv////+QvP+PvP+Ms//J0/3p9/+Ux/+Ouf+Krf+Iqf+Fp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2xU0qhwBbkzayzjDO8y3IwgbAdHPp87zNx8sIvLYN/tvhc1TF1lWqSEwaMWgG3ABpIB4sC2HY2Ei0sf0O2YmLWr1CdQGRYp8SK3ic/ZnRWMLqQ+2xGRwUD069dvV8zcuRom+rlA6Y2MbgGmhAGEz4VYSPQF5cyZM6GFYl6eTlN6ixi6aE6PqDLQZRi4EKI/KOfGFjUzqCKsXu6l2RpuAKJxiI1tHhcQJAYOHDhgwOZZs4ZSTHR5lQQYPDW1DS4aELQxdyEIAANGjtk8c6aaqTslk8gVwIAN0w3rAEL2bMtHm12AIOHqenXaNDWztEwo9hKJGHjR6OO0yDSI1IGdoQ0iY0a6Tt+06fKUDRQzqKw8Qlxr1AXrwNqwDvGBA+BrGUDc3d3Xr5+SQZj0E2ERqXIjPAJYNUbD18FoWEeDbHLPzLyQ4ePjQ5i3x1RCubfmpqkjMMNo6KOJ5uqe+f58C9GoaD29XyVSYS1h4DftKeWDDN4AbACZMZAsExEKghWUNKXWhlPfA2P1qjmUT556a9jmQotWi/VOFael1lR7ep4JfRZy8nhpwtG4wMMB/gdi9/nNH+vhezsmJ+fG5quX12fomHl6J+KFy88uA2RJyJPE4wkL4wIPBfgXxO5HxGN7zNw5W2bNnLZhio+OmaR3LD6tplrLfKeYAwX7/O6Dje/2dpniwuKiwoMHH+bn7723Z8/uHTu2fpg9+3p29sYrWVnr1l1cO2HCUFCGT+tshUcWLPj6IDf37ued27Z9unXz2owZU6dOnnxp4sQ1q1ePH79KN6vbQWc1SrfrTit6lO5NO6/F8yZNmofBfgNTwRQLsPLsHQAAAABJRU5ErkJggg==";function Ya(i){return i*180/Math.PI}function Nu(i){le(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 Xu(i){let t,e;return{c(){t=z("div"),e=z("div"),y(e,"class","floorplan__camera-rotate svelte-17cl35n"),T(e,"background-image",`url(${i[0]||vt})`),T(e,"width",i[4]),T(e,"height",i[4]),T(e,"left","-"+i[4]),T(e,"top","-"+i[4]),T(e,"transform",`rotate(${i[3]}deg)`),T(e,"transform-origin",`${i[4]} ${i[4]}`),y(t,"class","floorplan__camera-position svelte-17cl35n"),T(t,"left",i[1]),T(t,"top",i[2])},m(n,o){M(n,t,o),j(t,e)},p(n,[o]){o&1&&T(e,"background-image",`url(${n[0]||vt})`)},i:U,o:U,d(n){n&&S(t)}}}function Yu(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,d=c*100+"%",h=u*100+"%",m=-Ya(s)+45,A=document.body.clientWidth,v=document.body.clientHeight,g=`${(A<500||v<500?17:37)/16}rem`;return i.$$set=b=>{"panoIndex"in b&&e(5,n=b.panoIndex),"floorplanData"in b&&e(6,o=b.floorplanData),"lastPanoramaLongitude"in b&&e(7,s=b.lastPanoramaLongitude),"cameraImageUrl"in b&&e(0,r=b.cameraImageUrl)},[r,d,h,m,g,n,o,s]}class Uu extends oe{constructor(t){super(),ie(this,t,Yu,Xu,ne,{panoIndex:5,floorplanData:6,lastPanoramaLongitude:7,cameraImageUrl:0},Nu)}}const qu="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+Trf/p7v97mv9wj/+kuv+ftf/x9P92lf/3+f/I1f+5yv+Eof98m//8/f/4+f90lf+9zf/j6f/T3f/L1/+Bnv/6+/+SrP/m7P/f5v/O2v/L2P/E0v/Az//+///s8P/e5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0lqoZDSTGiVBrXE1iT0wbgEEn0gtSEEncoNfRV1uKKN/KqL+/4C1xYSA7XapjATRGU1hGxT3NtcGnUK0UJgZf7TuDWEls1yt9wiWsja7awzYRWttYgWYrPcLbejWqua2WaCqBSixQLvWe5mi06RWqv8TDOhNUrZC9sdm+Xuu5cpUqvU+wwzYbVVkIXYLHd/olekVpmpZ8KiMYbU7ma/EXJZBW5JrZl2V9bRnNWyWe4xt8TWTPd3FdEYSEFslnsoURlAi01FqN56f2br2xeOe9ytgbyf4nErGg/hl6RN4Jc5Lt++2rVjHMdCIIqiqtoRQW2mMogIyZFjlsB2B9wjjaY1PXa3wcbSPaEDR1fP9fVt8aPai2+f2+TlWu2l0yweZHlEO5S9cyu1lDKj5T/fWCH4jLaUnXMbvFyrzby8xRrayqUM2+ZWqvuM1nmpgHWkl8F9z9yG7LNa5yEMa0n8yHb93Er1oXjnoMVyFn3KQVcP7VRpFn+sDiznaiuHNufsHnkIwy7aPA/r5jbFGW3m7S12ku55WPN7Li1PPIRhN6sjtBjTmm+KmYcwPEOKs9tHF1JDHCoHLZ5DQ8yPBic9DoHjAKvsb85qjbFxHOCprMZaf5qdhlorxwGeTsPIttvPlno0y3GAZfbHp6n3ynGAV0m99u/2J6H3znGAvW4n+J25tdY7xwFey1pvQe6/DlrjOMDLqfXW7N5pbs0YWhxgtpj0rl1uiaHFISzccSWohUCzOIemm0VKChwHOMutKCVwHOA4av/JVi0xtDiRpCRfRcvQ4lBfxSnG0OJc/+xTjKHFyVRMP38iDC0O92lZVRhanO+vcVWGFu9BRWkW7+Z3rapEizdy7ZVm8V5Gtr8AtSnix59eOmYAAAAASUVORK5CYII=";function Ju(i){le(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 Zu(i){let t,e,n,o,s;return{c(){t=z("div"),e=z("div"),n=ee(),o=z("span"),s=ke(i[0]),y(e,"class","floorplan-plugin__compass-image svelte-rpkaro"),T(e,"background-image",`url(${qu})`),y(o,"class","floorplan-plugin__compass-text svelte-rpkaro"),y(t,"class","floorplan-plugin__compass svelte-rpkaro"),T(t,"transform",i[2])},m(r,a){M(r,t,a),j(t,e),j(t,n),j(t,o),j(o,s)},p(r,a){a&1&&Se(s,r[0])},d(r){r&&S(t)}}}function Ku(i){let t,e=i[1]&&Zu(i);return{c(){e&&e.c(),t=me()},m(n,o){e&&e.m(n,o),M(n,t,o)},p(n,[o]){n[1]&&e.p(n,o)},i:U,o:U,d(n){e&&e.d(n),n&&S(t)}}}function $u(i){return i/Math.PI*180}function ed(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?$u(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 td extends oe{constructor(t){super(),ie(this,t,ed,Ku,ne,{floorplanData:3,northDesc:0},Ju)}}const Ot=[];function mo(i,t=U){let e;const n=new Set;function o(a){if(ne(i,a)&&(i=a,e)){const l=!Ot.length;for(const c of n)c[1](),Ot.push(c,i);if(l){for(let c=0;c<Ot.length;c+=2)Ot[c][0](Ot[c+1]);Ot.length=0}}}function s(a){o(a(i))}function r(a,l=U){const c=[a,l];return n.add(c),n.size===1&&(e=t(o)||U),a(i),()=>{n.delete(c),n.size===0&&(e(),e=null)}}return{set:o,update:s,subscribe:r}}function nd(i){le(i,"svelte-1gfoniz","img.svelte-1gfoniz{width:100%;height:100%}")}function id(i){let t,e;return{c(){t=z("img"),Ne(t.src,e=i[0])||y(t,"src",e),y(t,"alt","floorplan iamge"),y(t,"class","svelte-1gfoniz")},m(n,o){M(n,t,o)},p(n,[o]){o&1&&!Ne(t.src,e=n[0])&&y(t,"src",e)},i:U,o:U,d(n){n&&S(t)}}}function od(i,t,e){let{url:n}=t;return i.$$set=o=>{"url"in o&&e(0,n=o.url)},[n]}class sd extends oe{constructor(t){super(),ie(this,t,od,id,ne,{url:0},nd)}}function rd(i){le(i,"svelte-ub47ya",".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}")}function ad(i){let t,e,n,o;return{c(){t=z("div"),e=new ei(!1),n=ee(),o=new ei(!1),e.a=n,o.a=null,y(t,"class","floorplan-plugin__base-image svelte-ub47ya")},m(s,r){M(s,t,r),e.m(i[1],t),j(t,n),o.m(i[0],t)},p(s,[r]){r&1&&o.p(s[0])},i:U,o:U,d(s){s&&S(t)}}}function ld(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 cd extends oe{constructor(t){super(),ie(this,t,ld,ad,ne,{content:0},rd)}}function ud(i){le(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function dd(i){let t,e;return t=new sd({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||(I(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function hd(i){let t,e;return t=new cd({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||(I(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function fd(i){let t,e,n,o;const s=[hd,dd],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(),y(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){M(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let u=e;e=a(l),e===u?~e&&r[e].p(l,c):(n&&(se(),L(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()),I(n,1),n.m(t,null)):n=null)},i(l){o||(I(n),o=!0)},o(l){L(n),o=!1},d(l){l&&S(t),~e&&r[e].d()}}}function md(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 Ua extends oe{constructor(t){super(),ie(this,t,md,fd,ne,{floorIndex:2,floorplanData:3},ud)}}function pd(i){le(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 gd(i){let t,e=i[8].outerHTML+"",n;return{c(){t=new ei(!1),n=me(),t.a=n},m(o,s){t.m(e,o,s),M(o,n,s)},p(o,s){s&256&&e!==(e=o[8].outerHTML+"")&&t.p(e)},d(o){o&&S(n),o&&t.d()}}}function Ad(i){let t,e,n=i[1]&&No(i),o=i[0]&&Xo(i);return{c(){n&&n.c(),t=ee(),o&&o.c(),e=me()},m(s,r){n&&n.m(s,r),M(s,t,r),o&&o.m(s,r),M(s,e,r)},p(s,r){s[1]?n?n.p(s,r):(n=No(s),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),s[0]?o?o.p(s,r):(o=Xo(s),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(s){n&&n.d(s),s&&S(t),o&&o.d(s),s&&S(e)}}}function No(i){let t,e=i[2].name+"",n;return{c(){t=z("span"),n=ke(e),y(t,"class","floorplan-plugin__room-name")},m(o,s){M(o,t,s),j(t,n)},p(o,s){s&4&&e!==(e=o[2].name+"")&&Se(n,e)},d(o){o&&S(t)}}}function Xo(i){let t,e;return{c(){t=z("span"),e=ke(i[7]),y(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(n,o){M(n,t,o),j(t,e)},p(n,o){o&128&&Se(e,n[7])},d(n){n&&S(t)}}}function vd(i){let t,e,n;function o(a,l){if(a[3]===void 0)return Ad;if(a[8])return gd}let s=o(i),r=s&&s(i);return{c(){t=z("div"),r&&r.c(),y(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),T(t,"left",i[9]),T(t,"top",i[10]),T(t,"font-size",i[11]),T(t,"opacity",i[6]?"1":"0")},m(a,l){M(a,t,l),r&&r.m(t,null),e||(n=[at(an.call(null,t)),ge(t,"clientWidth",i[19]),ge(t,"clientHeight",i[20])],e=!0)},p(a,[l]){s===(s=o(a))&&r?r.p(a,l):(r&&r.d(1),r=s&&s(a),r&&(r.c(),r.m(t,null))),l&64&&T(t,"opacity",a[6]?"1":"0")},i:U,o:U,d(a){a&&S(t),r&&r.d(),e=!1,He(n)}}}function bd(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 yd(i,t,e){let n,o,s,r,a,{pxmm:l}=t,{roomAreaEnable:c}=t,{roomNameEnable:u}=t,{room:d}=t,{hoveredRoom:h}=t,{getRoomAreaText:m}=t,{getLabelElement:A}=t,{adaptiveRoomLabelVisibleEnable:v}=t;function p(H,B){if(B.width===0||B.height===0)return()=>!1;const F=H.path.map(({x:de,y:pe})=>[de,pe]),R=H.roomLabel.position,{x:N,y:_}=R,{width:$,height:Y}=B,ae=$/2,he=Y/2;return function(pe){const Pe=N*pe,Ie=_*pe,Me=F.map(([Ae,Ee])=>[Ae*pe,Ee*pe]);return[[Pe+ae,Ie-he],[Pe-ae,Ie-he],[Pe-ae,Ie+he],[Pe+ae,Ie+he]].every(Ae=>bd(Ae,Me))}}const g=document.body.clientWidth,b=document.body.clientHeight,w=d.roomLabel,P=w.positionInImage.x*100+"%",x=w.positionInImage.y*100+"%",C=(g<500||b<500?10:14)+"px";let D=0,E=0,O=!1;h.subscribe(function(B){e(16,O=!!B&&B.id===d.id)});const G=H=>{e(4,D=H.detail)},X=H=>{e(5,E=H.detail)};return i.$$set=H=>{"pxmm"in H&&e(12,l=H.pxmm),"roomAreaEnable"in H&&e(0,c=H.roomAreaEnable),"roomNameEnable"in H&&e(1,u=H.roomNameEnable),"room"in H&&e(2,d=H.room),"hoveredRoom"in H&&e(13,h=H.hoveredRoom),"getRoomAreaText"in H&&e(14,m=H.getRoomAreaText),"getLabelElement"in H&&e(3,A=H.getLabelElement),"adaptiveRoomLabelVisibleEnable"in H&&e(15,v=H.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&12&&e(8,n=A==null?void 0:A(d)),i.$$.dirty&16388&&e(7,o=d.size?m(d.size):""),i.$$.dirty&48&&e(18,s={width:D,height:E}),i.$$.dirty&262148&&e(17,r=s?p(d,s):void 0),i.$$.dirty&233472&&e(6,a=v?O?!0:!!(r!=null&&r(l)):!0)},[c,u,d,A,D,E,a,o,n,P,x,C,l,h,m,v,O,r,s,G,X]}class wd extends oe{constructor(t){super(),ie(this,t,yd,vd,ne,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},pd)}}function Cd(i){le(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 Yo(i,t,e){const n=i.slice();return n[12]=t[e],n}function Uo(i){let t,e=[],n=new Map,o,s,r,a=i[8];const l=c=>c[12].id;for(let c=0;c<a.length;c+=1){let u=Yo(i,a,c),d=l(u);n.set(d,e[c]=qo(d,u))}return{c(){t=z("div");for(let c=0;c<e.length;c+=1)e[c].c();y(t,"class","floorplan-plugin__room-labels svelte-13xux0b")},m(c,u){M(c,t,u);for(let d=0;d<e.length;d+=1)e[d].m(t,null);o=!0,s||(r=[at(an.call(null,t)),ge(t,"clientWidth",i[11])],s=!0)},p(c,u){u&447&&(a=c[8],se(),e=qe(e,u,l,1,c,a,n,t,Pt,qo,null,Yo),re())},i(c){if(!o){for(let u=0;u<a.length;u+=1)I(e[u]);o=!0}},o(c){for(let u=0;u<e.length;u+=1)L(e[u]);o=!1},d(c){c&&S(t);for(let u=0;u<e.length;u+=1)e[u].d();s=!1,He(r)}}}function qo(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=Be(r,s[a]);return n=new wd({props:r}),{key:i,first:null,c(){e=me(),K(n.$$.fragment),this.first=e},m(a,l){M(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||(I(n.$$.fragment,a),o=!0)},o(a){L(n.$$.fragment,a),o=!1},d(a){a&&S(e),Z(n,a)}}}function Ed(i){let t,e,n=i[8]&&Uo(i);return{c(){n&&n.c(),t=me()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[8]?n?(n.p(o,s),s&256&&I(n,1)):(n=Uo(o),n.c(),I(n,1),n.m(t.parentNode,t)):n&&(se(),L(n,1,1,()=>{n=null}),re())},i(o){e||(I(n),e=!0)},o(o){L(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function Pd(i,t,e){let n,{floorIndex:o}=t,{roomAreaEnable:s}=t,{roomNameEnable:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{getRoomAreaText:c}=t,{getLabelElement:u}=t,{adaptiveRoomLabelVisibleEnable:d}=t,h=0,m=0;const A=v=>{e(6,h=v.detail)};return i.$$set=v=>{"floorIndex"in v&&e(9,o=v.floorIndex),"roomAreaEnable"in v&&e(0,s=v.roomAreaEnable),"roomNameEnable"in v&&e(1,r=v.roomNameEnable),"floorplanData"in v&&e(10,a=v.floorplanData),"hoveredRoom"in v&&e(2,l=v.hoveredRoom),"getRoomAreaText"in v&&e(3,c=v.getRoomAreaText),"getLabelElement"in v&&e(4,u=v.getLabelElement),"adaptiveRoomLabelVisibleEnable"in v&&e(5,d=v.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&1536&&e(8,n=a.floorDatas[o].rooms),i.$$.dirty&1088){const{max:v,min:p}=a.bounding,g=v.x-p.x;e(7,m=h/g)}},[s,r,l,c,u,d,h,m,n,o,a,A]}class Id extends oe{constructor(t){super(),ie(this,t,Pd,Ed,ne,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},Cd)}}function kd(i){le(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 Jo(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function Zo(i,t,e){const n=i.slice();return n[14]=t[e],n}function Ko(i){let t;return{c(){t=z("div"),y(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),T(t,"left",i[14].left*100+"%"),T(t,"bottom",i[14].bottom*100+"%")},m(e,n){M(e,t,n)},p:U,d(e){e&&S(t)}}}function $o(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=ee(),y(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),q(n,"is-row",t[2]),y(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),T(e,"left",t[11].left*100+"%"),T(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){M(a,e,l),j(e,n),j(n,s),j(e,r)},p(a,l){t=a,l&2&&o!==(o=t[1](t[11].distance)+"")&&Se(s,o)},d(a){a&&S(e)}}}function xd(i){let t,e,n,o,s,r,a=[],l=new Map,c,u=i[3],d=[];for(let A=0;A<u.length;A+=1)d[A]=Ko(Zo(i,u,A));let h=i[4];const m=A=>A[13];for(let A=0;A<h.length;A+=1){let v=Jo(i,h,A),p=m(v);l.set(p,a[A]=$o(p,v))}return{c(){t=z("div"),e=z("div"),n=ee(),o=z("div");for(let A=0;A<d.length;A+=1)d[A].c();s=ee(),r=z("div");for(let A=0;A<a.length;A+=1)a[A].c();y(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),y(o,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),q(o,"is-row",i[2]),y(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),y(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+i[0]+" svelte-djlmk4"),q(t,"is-row",i[2]),T(t,"width",i[2]?"100%":1/16+"rem"),T(t,"height",i[2]?1/16+"rem":"100%")},m(A,v){M(A,t,v),j(t,e),j(t,n),j(t,o);for(let p=0;p<d.length;p+=1)d[p].m(o,null);j(t,s),j(t,r);for(let p=0;p<a.length;p+=1)a[p].m(r,null)},p(A,[v]){if(v&8){u=A[3];let p;for(p=0;p<u.length;p+=1){const g=Zo(A,u,p);d[p]?d[p].p(g,v):(d[p]=Ko(g),d[p].c(),d[p].m(o,null))}for(;p<d.length;p+=1)d[p].d(1);d.length=u.length}v&22&&(h=A[4],a=qe(a,v,m,1,A,h,l,r,ho,$o,null,Jo)),v&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+A[0]+" svelte-djlmk4")&&y(t,"class",c),v&5&&q(t,"is-row",A[2])},i:U,o:U,d(A){A&&S(t),ct(d,A);for(let v=0;v<a.length;v+=1)a[v].d()}}}const Rt=1e3,Qt=180;function Dd(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-Qt)*2,c=s.max.y-s.min.y-(Rt-Qt)*2,u=o.map(([A,v])=>a?[A.x,v.x]:[A.y,v.y]).flat().sort().filter((A,v,p)=>v===0?!0:A!==p[v-1]),d=u.map(A=>{const v=a?(A-s.min.x-Rt+Qt)/l:0,p=a?0:(A-s.min.y-Rt+Qt)/c;return{left:v,bottom:p}});d.unshift({left:0,bottom:0}),d.push(a?{left:1,bottom:0}:{left:0,bottom:1});const h=u[u.length-1]-u[0],m=u.map((A,v,p)=>{const g=v===0?0:A-p[v-1],b=v===0?0:(A+p[v-1])/2,w=a?(b-s.min.x-Rt+Qt)/l:0,P=a?0:(b-s.min.y-Rt+Qt)/c;return{left:w,bottom:P,distance:g}}).filter(({distance:A})=>A/h>.1);return i.$$set=A=>{"type"in A&&e(0,n=A.type),"data"in A&&e(5,o=A.data),"bounding"in A&&e(6,s=A.bounding),"getRuleDistanceText"in A&&e(1,r=A.getRuleDistanceText)},[n,r,a,d,m,o,s]}class Ld extends oe{constructor(t){super(),ie(this,t,Dd,xd,ne,{type:0,data:5,bounding:6,getRuleDistanceText:1},kd)}}function Sd(i){le(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function es(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function ts(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=Be(r,s[a]);return n=new Ld({props:r}),{key:i,first:null,c(){e=me(),K(n.$$.fragment),this.first=e},m(a,l){M(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||(I(n.$$.fragment,a),o=!0)},o(a){L(n.$$.fragment,a),o=!1},d(a){a&&S(e),Z(n,a)}}}function Md(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=es(i,s,a),c=r(l);n.set(c,e[a]=ts(c,l))}return{c(){t=z("div");for(let a=0;a<e.length;a+=1)e[a].c();y(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),T(t,"width",i[3]),T(t,"height",i[2])},m(a,l){M(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,[l]){l&19&&(s=a[4],se(),e=qe(e,l,r,1,a,s,n,t,Pt,ts,null,es),re()),l&8&&T(t,"width",a[3]),l&4&&T(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)I(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)L(e[l]);o=!1},d(a){a&&S(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const ns=1e3,is=180;function Td(i,t,e){let n,o,s,r,a,l,c,u,d,h,{floorIndex:m}=t,{floorplanData:A}=t,{getRuleDistanceText:v}=t;return i.$$set=p=>{"floorIndex"in p&&e(5,m=p.floorIndex),"floorplanData"in p&&e(6,A=p.floorplanData),"getRuleDistanceText"in p&&e(0,v=p.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=A.bounding),i.$$.dirty&96&&e(11,o=A.floorDatas[m].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-(ns-is)*2),i.$$.dirty&2&&e(8,u=n.max.y-n.min.y-(ns-is)*2),i.$$.dirty&1536&&e(3,d=c/a*100+"%"),i.$$.dirty&384&&e(2,h=u/l*100+"%")},[v,n,h,d,r,m,A,l,u,a,c,o,s]}class zd extends oe{constructor(t){super(),ie(this,t,Td,Md,ne,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},Sd)}}function Ai(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 qa({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function Bd(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 jd(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 Vd(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function Od(i){let t;return{c(){t=we("path"),y(t,"d",i[0]),y(t,"fill","#2F313A")},m(e,n){M(e,t,n)},p(e,[n]){n&1&&y(t,"d",e[0])},i:U,o:U,d(e){e&&S(t)}}}function Rd(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=Ai(o,{needZ:!0}))},[n,o]}class Qd extends oe{constructor(t){super(),ie(this,t,Rd,Od,ne,{path:1})}}function Fd(i){let t,e,n,o,s,r;return{c(){t=we("defs"),e=we("pattern"),n=we("rect"),o=we("path"),s=ee(),r=we("path"),y(n,"x","0"),y(n,"y","0"),y(n,"width",i[1]),y(n,"height",i[1]),y(n,"fill","#323747"),y(o,"d",i[2]),y(o,"stroke","#ffffff"),y(o,"stroke-opacity","0.06"),y(o,"stroke-width","0.5"),y(o,"fill","none"),y(e,"id","fpm-room-pattern-0"),y(e,"x","0"),y(e,"y","0"),y(e,"width",i[1]),y(e,"height",i[1]),y(e,"patternUnits","userSpaceOnUse"),y(e,"patternTransform","scale(50 50)"),y(r,"d",i[0]),y(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){M(a,t,l),j(t,e),j(e,n),j(e,o),M(a,s,l),M(a,r,l)},p(a,[l]){l&1&&y(r,"d",a[0])},i:U,o:U,d(a){a&&S(t),a&&S(s),a&&S(r)}}}const Ti=6;function Hd(i,t,e){let n,{path:o}=t;const s=Ti*2,r=`M0 ${Ti} h ${s} M${Ti} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=Ai(o,{needZ:!0}))},[n,s,r,o]}class _d extends oe{constructor(t){super(),ie(this,t,Hd,Fd,ne,{path:3})}}function Gd(i){let t,e,n,o,s,r,a,l,c,u,d;return{c(){t=we("defs"),e=we("pattern"),n=we("rect"),o=we("pattern"),s=we("rect"),r=ee(),a=we("path"),l=ee(),c=we("path"),u=ee(),d=we("path"),y(n,"x","0"),y(n,"y","0"),y(n,"width","6"),y(n,"height","50"),y(n,"fill","none"),y(n,"stroke","#4B4B57"),y(n,"stroke-width","0.5"),y(e,"id","room-material-pattern-1"),y(e,"x","0"),y(e,"y","0"),y(e,"width","12"),y(e,"height","50"),y(e,"patternUnits","userSpaceOnUse"),y(e,"patternTransform","scale(50 50)"),y(s,"x","0"),y(s,"y","0"),y(s,"width","6"),y(s,"height","50"),y(s,"fill","none"),y(s,"stroke","#4B4B57"),y(s,"stroke-width","0.5"),y(o,"id","room-material-pattern-2"),y(o,"x","6"),y(o,"y","25"),y(o,"width","12"),y(o,"height","50"),y(o,"patternUnits","userSpaceOnUse"),y(o,"patternTransform","scale(50 50)"),y(a,"d",i[0]),y(a,"fill","#43434D"),y(c,"d",i[0]),y(c,"fill","url(#room-material-pattern-1)"),y(d,"d",i[0]),y(d,"fill","url(#room-material-pattern-2)")},m(h,m){M(h,t,m),j(t,e),j(e,n),j(t,o),j(o,s),M(h,r,m),M(h,a,m),M(h,l,m),M(h,c,m),M(h,u,m),M(h,d,m)},p(h,[m]){m&1&&y(a,"d",h[0]),m&1&&y(c,"d",h[0]),m&1&&y(d,"d",h[0])},i:U,o:U,d(h){h&&S(t),h&&S(r),h&&S(a),h&&S(l),h&&S(c),h&&S(u),h&&S(d)}}}function Wd(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=Ai(o,{needZ:!0}))},[n,o]}class Nd extends oe{constructor(t){super(),ie(this,t,Wd,Gd,ne,{path:1})}}function Xd(i){le(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 os(i,t,e){const n=i.slice();return n[5]=t[e],n}function Yd(i){let t,e;return t=new _d({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||(I(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Ud(i){let t,e;return t=new Nd({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||(I(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function qd(i){let t,e;return t=new Qd({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||(I(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function ss(i){let t,e,n,o;const s=[qd,Ud,Yd],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=we("svg"),n.c(),y(t,"width","100%"),y(t,"height","100%"),y(t,"viewBox",`0 0 ${i[1]} ${i[2]}`),y(t,"class","svelte-1dykexu")},m(l,c){M(l,t,c),r[e].m(t,null),o=!0},p(l,c){let u=e;e=a(l),e===u?r[e].p(l,c):(se(),L(r[u],1,1,()=>{r[u]=null}),re(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),I(n,1),n.m(t,null))},i(l){o||(I(n),o=!0)},o(l){L(n),o=!1},d(l){l&&S(t),r[e].d()}}}function Jd(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=ss(os(i,n,r));const s=r=>L(o[r],1,1,()=>{o[r]=null});return{c(){t=z("div");for(let r=0;r<o.length;r+=1)o[r].c();y(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){M(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=os(r,n,l);o[l]?(o[l].p(c,a),I(o[l],1)):(o[l]=ss(c),o[l].c(),I(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)I(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)L(o[a]);e=!1},d(r){r&&S(t),ct(o,r)}}}function Zd(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=>fe(Q({},l),{path:l.path.map(c=>qa(c,s.bounding))})))},[n,r,a,o,s]}class Kd extends oe{constructor(t){super(),ie(this,t,Zd,Jd,ne,{floorIndex:3,floorplanData:4},Xd)}}function $d(i){le(i,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function eh(i){let t,e,n,o;return{c(){t=we("path"),y(t,"d",i[5]),y(t,"fill","#fff"),y(t,"style",i[2]),y(t,"id",e=`${i[1]}_${i[0].id}`),y(t,"class","svelte-qq2273")},m(s,r){M(s,t,r),n||(o=[ge(t,"mouseenter",i[3]),ge(t,"mouseleave",i[4])],n=!0)},p(s,[r]){r&4&&y(t,"style",s[2]),r&3&&e!==(e=`${s[1]}_${s[0].id}`)&&y(t,"id",e)},i:U,o:U,d(s){s&&S(t),n=!1,He(o)}}}function th(i,t,e){let n,o,{room:s}=t,{floorIndex:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{highlightData:c}=t;function u(){l.set(s)}function d(){l.set(void 0)}const{bounding:h}=a,m=Ai(s.path,{needZ:!0,format:A=>qa(A,h)});return i.$$set=A=>{"room"in A&&e(0,s=A.room),"floorIndex"in A&&e(1,r=A.floorIndex),"floorplanData"in A&&e(6,a=A.floorplanData),"hoveredRoom"in A&&e(7,l=A.hoveredRoom),"highlightData"in A&&e(8,c=A.highlightData)},i.$$.update=()=>{i.$$.dirty&259&&e(9,n=c[`${r}_${s.id}`]),i.$$.dirty&512&&e(2,o=n?`fill: ${n.color}; --opacity: ${n.opacity}; pointer-events: ${n.disabled?"none":"auto"}`:null)},[s,r,o,u,d,m,a,l,c,n]}class nh extends oe{constructor(t){super(),ie(this,t,th,eh,ne,{room:0,floorIndex:1,floorplanData:6,hoveredRoom:7,highlightData:8},$d)}}function ih(i){le(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 rs(i,t,e){const n=i.slice();return n[6]=t[e],n}function as(i,t){let e,n,o;const s=[{room:t[6],floorplanData:t[1],hoveredRoom:t[2],floorIndex:t[0],highlightData:t[3]}];let r={};for(let a=0;a<s.length;a+=1)r=Be(r,s[a]);return n=new nh({props:r}),{key:i,first:null,c(){e=me(),K(n.$$.fragment),this.first=e},m(a,l){M(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&15?Re(s,[{room:t[6],floorplanData:t[1],hoveredRoom:t[2],floorIndex:t[0],highlightData:t[3]}]):{};n.$set(c)},i(a){o||(I(n.$$.fragment,a),o=!0)},o(a){L(n.$$.fragment,a),o=!1},d(a){a&&S(e),Z(n,a)}}}function oh(i){let t,e,n=[],o=new Map,s,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[6].id;for(let l=0;l<r.length;l+=1){let c=rs(i,r,l),u=a(c);o.set(u,n[l]=as(u,c))}return{c(){t=z("div"),e=we("svg");for(let l=0;l<n.length;l+=1)n[l].c();y(e,"width","100%"),y(e,"height","100%"),y(e,"viewBox",`0 0 ${i[4]} ${i[5]}`),y(e,"class","svelte-1kqo6e4"),y(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){M(l,t,c),j(t,e);for(let u=0;u<n.length;u+=1)n[u].m(e,null);s=!0},p(l,[c]){c&15&&(r=l[1].floorDatas[l[0]].rooms,se(),n=qe(n,c,a,1,l,r,o,e,Pt,as,null,rs),re())},i(l){if(!s){for(let c=0;c<r.length;c+=1)I(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)L(n[c]);s=!1},d(l){l&&S(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function sh(i,t,e){let{floorIndex:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t,{highlightData:r}=t;const a=o.bounding.max.x-o.bounding.min.x,l=o.bounding.max.y-o.bounding.min.y;return i.$$set=c=>{"floorIndex"in c&&e(0,n=c.floorIndex),"floorplanData"in c&&e(1,o=c.floorplanData),"hoveredRoom"in c&&e(2,s=c.hoveredRoom),"highlightData"in c&&e(3,r=c.highlightData)},[n,o,s,r,a,l]}class Ja extends oe{constructor(t){super(),ie(this,t,sh,oh,ne,{floorIndex:0,floorplanData:1,hoveredRoom:2,highlightData:3},ih)}}function rh(i){le(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 ls(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[8],hoveredRoom:i[14],highlightData:i[13]}];let o={};for(let s=0;s<n.length;s+=1)o=Be(o,n[s]);return t=new Ja({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&24834?Re(n,[{floorIndex:s[1],floorplanData:s[8],hoveredRoom:s[14],highlightData:s[13]}]):{};t.$set(a)},i(s){e||(I(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function cs(i){let t,e;const n=[{floorplanData:i[8],roomAreaEnable:i[5],roomNameEnable:i[6],floorIndex:i[1],getRoomAreaText:i[9],getLabelElement:i[10],hoveredRoom:i[14],adaptiveRoomLabelVisibleEnable:i[12]}];let o={};for(let s=0;s<n.length;s+=1)o=Be(o,n[s]);return t=new Id({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&22370?Re(n,[{floorplanData:s[8],roomAreaEnable:s[5],roomNameEnable:s[6],floorIndex:s[1],getRoomAreaText:s[9],getLabelElement:s[10],hoveredRoom:s[14],adaptiveRoomLabelVisibleEnable:s[12]}]):{};t.$set(a)},i(s){e||(I(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function us(i){let t,e;const n=[{floorplanData:i[8],floorIndex:i[1],getRuleDistanceText:i[11]}];let o={};for(let s=0;s<n.length;s+=1)o=Be(o,n[s]);return t=new zd({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&2306?Re(n,[{floorplanData:s[8],floorIndex:s[1],getRuleDistanceText:s[11]}]):{};t.$set(a)},i(s){e||(I(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function ah(i){let t,e,n,o,s,r,a,l,c;const u=[{floorIndex:i[1],floorplanData:i[8]}];let d={};for(let g=0;g<u.length;g+=1)d=Be(d,u[g]);e=new Kd({props:d});let h=(i[2]||i[3])&&ls(i);const m=[{floorplanData:i[8],floorIndex:i[1]}];let A={};for(let g=0;g<m.length;g+=1)A=Be(A,m[g]);s=new Ua({props:A});let v=i[4]&&cs(i),p=i[7]&&us(i);return{c(){t=z("div"),K(e.$$.fragment),n=ee(),h&&h.c(),o=ee(),K(s.$$.fragment),r=ee(),v&&v.c(),a=ee(),p&&p.c(),y(t,"class",l=Te(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(g,b){M(g,t,b),J(e,t,null),j(t,n),h&&h.m(t,null),j(t,o),J(s,t,null),j(t,r),v&&v.m(t,null),j(t,a),p&&p.m(t,null),c=!0},p(g,[b]){const w=b&258?Re(u,[{floorIndex:g[1],floorplanData:g[8]}]):{};e.$set(w),g[2]||g[3]?h?(h.p(g,b),b&12&&I(h,1)):(h=ls(g),h.c(),I(h,1),h.m(t,o)):h&&(se(),L(h,1,1,()=>{h=null}),re());const P=b&258?Re(m,[{floorplanData:g[8],floorIndex:g[1]}]):{};s.$set(P),g[4]?v?(v.p(g,b),b&16&&I(v,1)):(v=cs(g),v.c(),I(v,1),v.m(t,a)):v&&(se(),L(v,1,1,()=>{v=null}),re()),g[7]?p?(p.p(g,b),b&128&&I(p,1)):(p=us(g),p.c(),I(p,1),p.m(t,null)):p&&(se(),L(p,1,1,()=>{p=null}),re()),(!c||b&1&&l!==(l=Te(`floorplan-plugin__floor${g[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&y(t,"class",l)},i(g){c||(I(e.$$.fragment,g),I(h),I(s.$$.fragment,g),I(v),I(p),c=!0)},o(g){L(e.$$.fragment,g),L(h),L(s.$$.fragment,g),L(v),L(p),c=!1},d(g){g&&S(t),Z(e),h&&h.d(),Z(s),v&&v.d(),p&&p.d()}}}function lh(i,t,e){let{isCurrent:n}=t,{floorIndex:o}=t,{highlightEnable:s}=t,{hoverEnable:r}=t,{roomLabelsEnable:a}=t,{roomAreaEnable:l}=t,{roomNameEnable:c}=t,{ruleLabelsEnable:u}=t,{floorplanData:d}=t,{getRoomAreaText:h}=t,{getLabelElement:m}=t,{getRuleDistanceText:A}=t,{adaptiveRoomLabelVisibleEnable:v}=t,{highlightData:p}=t;const g=mo(void 0);return i.$$set=b=>{"isCurrent"in b&&e(0,n=b.isCurrent),"floorIndex"in b&&e(1,o=b.floorIndex),"highlightEnable"in b&&e(2,s=b.highlightEnable),"hoverEnable"in b&&e(3,r=b.hoverEnable),"roomLabelsEnable"in b&&e(4,a=b.roomLabelsEnable),"roomAreaEnable"in b&&e(5,l=b.roomAreaEnable),"roomNameEnable"in b&&e(6,c=b.roomNameEnable),"ruleLabelsEnable"in b&&e(7,u=b.ruleLabelsEnable),"floorplanData"in b&&e(8,d=b.floorplanData),"getRoomAreaText"in b&&e(9,h=b.getRoomAreaText),"getLabelElement"in b&&e(10,m=b.getLabelElement),"getRuleDistanceText"in b&&e(11,A=b.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in b&&e(12,v=b.adaptiveRoomLabelVisibleEnable),"highlightData"in b&&e(13,p=b.highlightData)},[n,o,s,r,a,l,c,u,d,h,m,A,v,p,g]}class ch extends oe{constructor(t){super(),ie(this,t,lh,ah,ne,{isCurrent:0,floorIndex:1,highlightEnable:2,hoverEnable:3,roomLabelsEnable:4,roomAreaEnable:5,roomNameEnable:6,ruleLabelsEnable:7,floorplanData:8,getRoomAreaText:9,getLabelElement:10,getRuleDistanceText:11,adaptiveRoomLabelVisibleEnable:12,highlightData:13},rh)}}function uh(i){le(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function ds(i,t,e){const n=i.slice();return n[21]=t[e],n}function hs(i){let t,e,n,o,s,r=i[13].floorDatas,a=[];for(let d=0;d<r.length;d+=1)a[d]=fs(ds(i,r,d));const l=d=>L(a[d],1,1,()=>{a[d]=null});let c=i[5]&&ms(i),u=i[8]&&ps(i);return{c(){t=z("div");for(let d=0;d<a.length;d+=1)a[d].c();e=ee(),c&&c.c(),n=ee(),u&&u.c(),y(t,"class","floorplan-main svelte-86bqav")},m(d,h){M(d,t,h);for(let m=0;m<a.length;m+=1)a[m].m(t,null);j(t,e),c&&c.m(t,null),j(t,n),u&&u.m(t,null),s=!0},p(d,h){if(i=d,h&2047696){r=i[13].floorDatas;let m;for(m=0;m<r.length;m+=1){const A=ds(i,r,m);a[m]?(a[m].p(A,h),I(a[m],1)):(a[m]=fs(A),a[m].c(),I(a[m],1),a[m].m(t,e))}for(se(),m=r.length;m<a.length;m+=1)l(m);re()}i[5]?c?(c.p(i,h),h&32&&I(c,1)):(c=ms(i),c.c(),I(c,1),c.m(t,n)):c&&(se(),L(c,1,1,()=>{c=null}),re()),i[8]?u?(u.p(i,h),h&256&&I(u,1)):(u=ps(i),u.c(),I(u,1),u.m(t,null)):u&&(se(),L(u,1,1,()=>{u=null}),re())},i(d){if(!s){for(let h=0;h<r.length;h+=1)I(a[h]);I(c),I(u),o||Oe(()=>{o=Tt(t,Mt,{duration:i[0],easing:At}),o.start()}),s=!0}},o(d){a=a.filter(Boolean);for(let h=0;h<a.length;h+=1)L(a[h]);L(c),L(u),s=!1},d(d){d&&S(t),ct(a,d),c&&c.d(),u&&u.d()}}}function fs(i){let t,e;const n=[{hoverEnable:i[6],highlightEnable:i[7],floorplanData:i[13],getRoomAreaText:i[16],getLabelElement:i[17],getRuleDistanceText:i[18],roomLabelsEnable:i[9],roomAreaEnable:i[10],roomNameEnable:i[11],ruleLabelsEnable:i[12],adaptiveRoomLabelVisibleEnable:i[19],highlightData:i[20]},{floorIndex:i[21].floorIndex},{isCurrent:i[21].floorIndex===i[4]}];let o={};for(let s=0;s<n.length;s+=1)o=Be(o,n[s]);return t=new ch({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&2047696?Re(n,[r&2047680&&{hoverEnable:s[6],highlightEnable:s[7],floorplanData:s[13],getRoomAreaText:s[16],getLabelElement:s[17],getRuleDistanceText:s[18],roomLabelsEnable:s[9],roomAreaEnable:s[10],roomNameEnable:s[11],ruleLabelsEnable:s[12],adaptiveRoomLabelVisibleEnable:s[19],highlightData:s[20]},r&8192&&{floorIndex:s[21].floorIndex},r&8208&&{isCurrent:s[21].floorIndex===s[4]}]):{};t.$set(a)},i(s){e||(I(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function ms(i){let t,e;const n=[{panoIndex:i[3],floorplanData:i[13],lastPanoramaLongitude:i[14],cameraImageUrl:i[15]}];let o={};for(let s=0;s<n.length;s+=1)o=Be(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&57352?Re(n,[{panoIndex:s[3],floorplanData:s[13],lastPanoramaLongitude:s[14],cameraImageUrl:s[15]}]):{};t.$set(a)},i(s){e||(I(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function ps(i){let t,e;return t=new td({props:{floorplanData:i[13],northDesc:i[2]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&8192&&(s.floorplanData=n[13]),o&4&&(s.northDesc=n[2]),t.$set(s)},i(n){e||(I(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function dh(i){let t,e,n=i[1]&&hs(i);return{c(){n&&n.c(),t=me()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&I(n,1)):(n=hs(o),n.c(),I(n,1),n.m(t.parentNode,t)):n&&(se(),L(n,1,1,()=>{n=null}),re())},i(o){e||(I(n),e=!0)},o(o){L(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function hh(i,t,e){let{duration:n=0}=t,{visible:o}=t,{northDesc:s}=t,{panoIndex:r}=t,{floorIndex:a}=t,{cameraEnable:l}=t,{hoverEnable:c}=t,{highlightEnable:u}=t,{compassEnable:d}=t,{roomLabelsEnable:h}=t,{roomAreaEnable:m}=t,{roomNameEnable:A}=t,{ruleLabelsEnable:v}=t,{floorplanData:p}=t,{lastPanoramaLongitude:g}=t,{cameraImageUrl:b}=t,{getRoomAreaText:w}=t,{getLabelElement:P}=t,{getRuleDistanceText:x}=t,{adaptiveRoomLabelVisibleEnable:C}=t,{highlightData:D}=t;return i.$$set=E=>{"duration"in E&&e(0,n=E.duration),"visible"in E&&e(1,o=E.visible),"northDesc"in E&&e(2,s=E.northDesc),"panoIndex"in E&&e(3,r=E.panoIndex),"floorIndex"in E&&e(4,a=E.floorIndex),"cameraEnable"in E&&e(5,l=E.cameraEnable),"hoverEnable"in E&&e(6,c=E.hoverEnable),"highlightEnable"in E&&e(7,u=E.highlightEnable),"compassEnable"in E&&e(8,d=E.compassEnable),"roomLabelsEnable"in E&&e(9,h=E.roomLabelsEnable),"roomAreaEnable"in E&&e(10,m=E.roomAreaEnable),"roomNameEnable"in E&&e(11,A=E.roomNameEnable),"ruleLabelsEnable"in E&&e(12,v=E.ruleLabelsEnable),"floorplanData"in E&&e(13,p=E.floorplanData),"lastPanoramaLongitude"in E&&e(14,g=E.lastPanoramaLongitude),"cameraImageUrl"in E&&e(15,b=E.cameraImageUrl),"getRoomAreaText"in E&&e(16,w=E.getRoomAreaText),"getLabelElement"in E&&e(17,P=E.getLabelElement),"getRuleDistanceText"in E&&e(18,x=E.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in E&&e(19,C=E.adaptiveRoomLabelVisibleEnable),"highlightData"in E&&e(20,D=E.highlightData)},[n,o,s,r,a,l,c,u,d,h,m,A,v,p,g,b,w,P,x,C,D]}class po extends oe{constructor(t){super(),ie(this,t,hh,dh,ne,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,cameraEnable:5,hoverEnable:6,highlightEnable:7,compassEnable:8,roomLabelsEnable:9,roomAreaEnable:10,roomNameEnable:11,ruleLabelsEnable:12,floorplanData:13,lastPanoramaLongitude:14,cameraImageUrl:15,getRoomAreaText:16,getLabelElement:17,getRuleDistanceText:18,adaptiveRoomLabelVisibleEnable:19,highlightData:20},uh)}}const fh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvW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P9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function mh(i){return W(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(o){return W(this,null,function*(){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=yield fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s})};return yield Promise.all(i.map(e))})}function ph(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 gh(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(ph),rules:i.rules}}function Ah(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function vh(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 W(this,null,function*(){const t=yield mh(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(gh),o=i.computed_data.entrance?vh(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(Ah)}})}function bh(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:fh,width:45,height:48},a=Vd(s,t),l=Bd(s,e),c=jd(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function yh(i,t){return t(i),i}function vi(i,t){return yh({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function gs(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 go(i,t,e=pt.BOUNDING_CENTER){const n=gs(i,t),o=gs(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 Ao(i,t,e,n){const o=go(i,e,n==null?void 0:n.attachedTo),s=new k.Vector3(0,o,0),r=new k.Vector3(1,o,0),a=s.clone().project(i.camera),l=r.clone().project(i.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}class In{constructor(t,e){f(this,"VERSION","2.13.2-dev.1");f(this,"five");f(this,"hooks",new Zt);f(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}}class zt extends In{}var Ge=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(Ge||{});const Za=500,wh=80;function Ki(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function Ka(i,t){return W(this,null,function*(){yield new Promise((e,n)=>{i.changeMode(...t).catch(o=>n(o)),i.once("initAnimationEnded",()=>{const o=i.getCurrentState(),s=t[0];o.mode!==s&&n(new Error("mode \u4E0E\u9884\u671F\u4E0D\u7B26")),(()=>{const l=t[1];return l?Object.keys(l).every(c=>{const u=o[c];if(u===void 0)return!0;const d=l[c];return typeof u=="number"&&typeof d=="number"?Ki(u,d,2):u===d}):!0})()||n(new Error("five pose \u4E0E\u9884\u671F\u4E0D\u7B26")),e()})})})}function vo(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!(!Ki(e,s,2)||!Ki(n,r,2)||o!==a)}function $a(i,t,e=!0){return W(this,null,function*(){if(vo(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[u]=yield ai(Ka(i,[t.mode,t,void 0,e]));if(u)throw new Error(Ge.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 ai(i.updateCamera(t,l,e));if(c)throw new Error(Ge.UpdateCameraError)})}function Ut(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 Ch(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 Eh(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 Ph extends zt{constructor(e,n){var a;super(e);f(this,"name","modelFloorplanPlugin");f(this,"state");f(this,"data");f(this,"showState");f(this,"showPromise");f(this,"app");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"selector");f(this,"showRejection");f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(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")});f(this,"show",(...n)=>W(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));f(this,"hide",(...n)=>W(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!vo(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=Ao(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})});f(this,"highlight",e=>{!this.state.config.highlightEnable||(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,Ge.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(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}))});f(this,"_show",e=>W(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Ge.ModelNotLoaded);if(!this.data)throw new Error(Ge.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=Q(Q({},n),e),s=()=>W(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=h=>{a=!0,l=h};const[c]=yield ai($a(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Ge.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,d=o.immediately?0:Za;Ut(this.five,u,d),this.render(d)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,Ge.BreakOffByHide),this.showPromise=void 0;const o=Q(Q({},{userAction:!0,isAutoHide:!1}),e);Ut(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(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)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(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||Eh(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});f(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();Ch(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});f(this,"onFiveWantsGesture",(e,n)=>{if(!!this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});f(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});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(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:wh/((a=n==null?void 0:n.scale)!=null?a:1)};const o={northDesc:"\u5317",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:vt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},s=n?vi(n,["selector","scale"]):{},r=Q(Q({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return W(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield 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 W(this,null,function*(){return yield bt(e.data)})}updateState(e,n){const o=this.state,s=e.config?Q(Q({},o.config),e.config):o.config;this.state=fe(Q(Q({},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=fe(Q({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new po({target:this.container,intro:!0,props:n})}}const Ih=(i,t)=>new Ph(i,t);function kh(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 xh(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 Dh extends zt{constructor(e,n){super(e);f(this,"name","modelFloorplanPlugin");f(this,"state");f(this,"data");f(this,"showState");f(this,"showPromise");f(this,"app");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"selector");f(this,"showRejection");f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(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")});f(this,"show",(...n)=>W(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));f(this,"hide",(...n)=>W(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!vo(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=Ao(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})});f(this,"highlight",e=>{!this.state.config.highlightEnable||(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,Ge.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(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}))});f(this,"_show",e=>W(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Ge.ModelNotLoaded);if(!this.data)throw new Error(Ge.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=Q(Q({},n),e),s=()=>W(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=h=>{a=!0,l=h};const[c]=yield ai($a(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Ge.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,d=o.immediately?0:Za;Ut(this.five,u,d),this.render(d)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,Ge.BreakOffByHide),this.showPromise=void 0;const o=Q(Q({},{userAction:!0,isAutoHide:!1}),e);Ut(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(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)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();this.updatePosition(),this.updateSize(),kh(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});f(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:(xh(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2,fov:90};const o={northDesc:"\u5317",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:vt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?vi(n,["selector","scale"]):{},r=Q(Q({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return W(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield 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=go(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new k.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}formatData(e){return W(this,null,function*(){return yield bt(e.data)})}updateState(e,n){const o=this.state,s=e.config?Q(Q({},o.config),e.config):o.config;this.state=fe(Q(Q({},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=fe(Q({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new po({target:this.container,intro:!0,props:n})}}const Lh=(i,t)=>new Dh(i,t);class Sh extends zt{constructor(e,n){super(e);f(this,"name","topviewFloorplanPlugin");f(this,"state");f(this,"data");f(this,"app");f(this,"selector");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(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=Ao(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})});f(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")});f(this,"highlight",e=>{!this.state.config.highlightEnable||(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(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})});f(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)});f(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});f(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{!this.state.visible||(this.updatePosition(),this.updateSize())});f(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});f(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});f(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}))});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"));const o={northDesc:"\u5317",modelOpacity:1,cameraEnable:!0,hoverEnable:!0,highlightEnable:!1,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:vt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?vi(n,["selector","scale"]):{},r=Q(Q({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return W(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield 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=go(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new k.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return W(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return W(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return W(this,null,function*(){return yield bt(e.data)})}_show(e){return W(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:n}=e;this.hooks.emit("show",{userAction:n,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield Ka(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;Ut(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return W(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;Ut(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?Q(Q({},o.config),e.config):o.config;this.state=fe(Q(Q({},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=fe(Q({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new po({target:this.container,intro:!0,props:n})}}const Mh=(i,t)=>new Sh(i,t);function bo(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function Th(i){le(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 zh(i){let t,e,n;return{c(){t=z("div"),e=z("div"),n=z("div"),y(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),T(n,"background-image","url("+(i[0]||vt)+")"),T(n,"transform",i[1]),y(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),T(e,"transform",i[2]),y(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(o,s){M(o,t,s),j(t,e),j(e,n)},p(o,[s]){s&1&&T(n,"background-image","url("+(o[0]||vt)+")"),s&2&&T(n,"transform",o[1]),s&4&&T(e,"transform",o[2])},i:U,o:U,d(o){o&&S(t)}}}function Bh(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function jh(i,t,e){let n,o,{five:s}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=s.getCurrentState().panoIndex,u=s.getCurrentState().longitude;function d(A,v){const p=A.bounding,g=A.observers[v];if(!g)return"";const b=(p.max.x-p.min.x)*r,w=(p.max.y-p.min.y)*r,P=Math.floor(g.positionInImage.x*b),x=Math.floor(g.positionInImage.y*w);return`translate(${P}px, ${x}px)`}function h(A){e(6,c=A)}const m=bo(A=>{e(7,u=A.longitude)},1e3/60);return Ue(()=>(s.on("panoWillArrive",h),s.on("cameraDirectionUpdate",m),function(){s.off("panoWillArrive",h),s.off("cameraDirectionUpdate",m)})),i.$$set=A=>{"five"in A&&e(3,s=A.five),"pxmm"in A&&e(4,r=A.pxmm),"floorplanData"in A&&e(5,a=A.floorplanData),"cameraImageUrl"in A&&e(0,l=A.cameraImageUrl)},i.$$.update=()=>{i.$$.dirty&96&&e(2,n=d(a,c)),i.$$.dirty&128&&e(1,o=Bh(u))},[l,o,n,s,r,a,c,u]}class Vh extends oe{constructor(t){super(),ie(this,t,jh,zh,ne,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},Th)}}function Oh(i){le(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 As(i,t,e){const n=i.slice();return n[1]=t[e],n}function vs(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=ee(),y(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),T(n,"background-image",`url(${t[1].icon.url})`),T(n,"width",o),T(n,"height",s),y(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),T(e,"top",a),T(e,"left",l),this.first=e},m(c,u){M(c,e,u),j(e,n),j(e,r)},p(c,u){t=c,u&1&&T(n,"background-image",`url(${t[1].icon.url})`),u&1&&o!==(o=`${t[1].icon.width/16}rem`)&&T(n,"width",o),u&1&&s!==(s=`${t[1].icon.height/16}rem`)&&T(n,"height",s),u&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&T(e,"top",a),u&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&T(e,"left",l)},d(c){c&&S(e)}}}function Rh(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=As(i,o,r),l=s(a);n.set(l,e[r]=vs(l,a))}return{c(){t=z("div");for(let r=0;r<e.length;r+=1)e[r].c();y(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){M(r,t,a);for(let l=0;l<e.length;l+=1)e[l].m(t,null)},p(r,[a]){a&1&&(o=r[0],e=qe(e,a,s,1,r,o,n,t,ho,vs,null,As))},i:U,o:U,d(r){r&&S(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function Qh(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class Fh extends oe{constructor(t){super(),ie(this,t,Qh,Rh,ne,{extraObjects:0},Oh)}}function bs(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=Be(o,n[s]);return t=new Ja({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||(I(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function Hh(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=Be(l,a[u]);t=new Ua({props:l}),n=new Fh({props:{extraObjects:i[5]}});let c=i[3]&&bs(i);return{c(){K(t.$$.fragment),e=ee(),K(n.$$.fragment),o=ee(),c&&c.c(),s=me()},m(u,d){J(t,u,d),M(u,e,d),J(n,u,d),M(u,o,d),c&&c.m(u,d),M(u,s,d),r=!0},p(u,[d]){const h=d&20?Re(a,[{floorIndex:u[2],floorplanData:u[4]}]):{};t.$set(h);const m={};d&32&&(m.extraObjects=u[5]),n.$set(m),u[3]?c?(c.p(u,d),d&8&&I(c,1)):(c=bs(u),c.c(),I(c,1),c.m(s.parentNode,s)):c&&(se(),L(c,1,1,()=>{c=null}),re())},i(u){r||(I(t.$$.fragment,u),I(n.$$.fragment,u),I(c),r=!0)},o(u){L(t.$$.fragment,u),L(n.$$.fragment,u),L(c),r=!1},d(u){Z(t,u),u&&S(e),Z(n,u),u&&S(o),c&&c.d(u),u&&S(s)}}}function _h(i,t,e){let n,{five:o}=t,{pxmm:s}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t;const u=void 0;return i.$$set=d=>{"five"in d&&e(0,o=d.five),"pxmm"in d&&e(1,s=d.pxmm),"floorIndex"in d&&e(2,r=d.floorIndex),"hoverEnable"in d&&e(3,a=d.hoverEnable),"floorplanData"in d&&e(4,l=d.floorplanData),"extraObjects"in d&&e(7,c=d.extraObjects)},i.$$.update=()=>{i.$$.dirty&132&&e(5,n=c==null?void 0:c.filter(d=>d.floorIndex===r))},[o,s,r,a,l,n,u,c]}class Gh extends oe{constructor(t){super(),ie(this,t,_h,Hh,ne,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:7})}}function Wh(i){le(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 ys(i){let t,e,n,o,s=i[6]!==0&&ws(i);return{c(){t=z("div"),s&&s.c(),y(t,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(r,a){M(r,t,a),s&&s.m(t,null),e=!0,n||(o=[at(an.call(null,t)),ge(t,"clientWidth",i[12]),ge(t,"clientHeight",i[13])],n=!0)},p(r,a){r[6]!==0?s?(s.p(r,a),a&64&&I(s,1)):(s=ws(r),s.c(),I(s,1),s.m(t,null)):s&&(se(),L(s,1,1,()=>{s=null}),re())},i(r){e||(I(s),e=!0)},o(r){L(s),e=!1},d(r){r&&S(t),s&&s.d(),n=!1,He(o)}}}function ws(i){let t,e,n,o,s=`${i[8]}px`,r=`${i[11]}px`,a;const l=[{five:i[0],pxmm:i[9],floorIndex:i[10],floorplanData:i[3],hoverEnable:i[2],extraObjects:i[5]}];let c={};for(let h=0;h<l.length;h+=1)c=Be(c,l[h]);e=new Gh({props:c});const u=[{pxmm:i[9],five:i[0],floorplanData:i[3],cameraImageUrl:i[4]}];let d={};for(let h=0;h<u.length;h+=1)d=Be(d,u[h]);return o=new Vh({props:d}),{c(){t=z("div"),K(e.$$.fragment),n=ee(),K(o.$$.fragment),y(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),T(t,"width",s),T(t,"height",r)},m(h,m){M(h,t,m),J(e,t,null),j(t,n),J(o,t,null),a=!0},p(h,m){const A=m&1581?Re(l,[{five:h[0],pxmm:h[9],floorIndex:h[10],floorplanData:h[3],hoverEnable:h[2],extraObjects:h[5]}]):{};e.$set(A);const v=m&537?Re(u,[{pxmm:h[9],five:h[0],floorplanData:h[3],cameraImageUrl:h[4]}]):{};o.$set(v),m&256&&s!==(s=`${h[8]}px`)&&T(t,"width",s),m&2048&&r!==(r=`${h[11]}px`)&&T(t,"height",r)},i(h){a||(I(e.$$.fragment,h),I(o.$$.fragment,h),a=!0)},o(h){L(e.$$.fragment,h),L(o.$$.fragment,h),a=!1},d(h){h&&S(t),Z(e),Z(o)}}}function Nh(i){let t,e,n=i[1]&&ys(i);return{c(){n&&n.c(),t=me()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&I(n,1)):(n=ys(o),n.c(),I(n,1),n.m(t.parentNode,t)):n&&(se(),L(n,1,1,()=>{n=null}),re())},i(o){e||(I(n),e=!0)},o(o){L(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function Xh(i,t,e){var b,w;let{five:n}=t,{visible:o}=t,{hoverEnable:s}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,c=0,u=(w=(b=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:b.floorIndex)!=null?w:0,d=0,h=0,m=0,A=0;function v(P){e(10,u=n.work.observers[P].floorIndex)}Ue(()=>(n.on("panoArrived",v),()=>{n.off("panoArrived",v)}));const p=P=>{e(6,d=P.detail)},g=P=>{e(7,h=P.detail)};return i.$$set=P=>{"five"in P&&e(0,n=P.five),"visible"in P&&e(1,o=P.visible),"hoverEnable"in P&&e(2,s=P.hoverEnable),"floorplanData"in P&&e(3,r=P.floorplanData),"cameraImageUrl"in P&&e(4,a=P.cameraImageUrl),"extraObjects"in P&&e(5,l=P.extraObjects)},i.$$.update=()=>{if(i.$$.dirty&456){const P=Math.min(d,h),{max:x,min:C}=r.bounding,D=x.x-C.x,E=x.y-C.y,O=function(){return D>E?[P,P/D*E]:[P/E*D,P]}();e(8,m=O[0]),e(11,A=O[1]),e(9,c=m/D)}},[n,o,s,r,a,l,d,h,m,c,u,A,p,g]}class Yh extends oe{constructor(t){super(),ie(this,t,Xh,Nh,ne,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5},Wh)}}class Uh extends zt{constructor(e,n){super(e);f(this,"name","panoFloorplanRadarPlugin");f(this,"state");f(this,"data");f(this,"app");f(this,"wrapperSelector","");f(this,"wrapper",null);f(this,"disposed",!1);f(this,"extraObjects",[]);f(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});f(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=Q(Q({},o),s);this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}load(e,n,o=!0){return W(this,null,function*(){function s(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=s(r)?r.data:r,l=this.data;this.data=yield bt(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,o),this.render()})}show(){return W(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return W(this,arguments,function*(e={}){if(!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,n=!0){this.setState({config:e},{userAction:n}),this.render()}setExtraObjectsWith3DPositions(e){!this.data||(this.extraObjects=bh(e,this.five,this.data),this.render())}formatData(e){return W(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=Q(Q({},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=fe(Q({},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 Yh({target:this.wrapper,props:e})}}const qh=(i,t)=>new Uh(i,t),Jh=[{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"}],Zh=[{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"}],Kh=[{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"}],zi=(i,t,e)=>{const n=new k.Matrix4,o=new k.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},$h=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[o,s,r]=e;o&&i.applyMatrix4(zi(o,0,0)),s&&i.applyMatrix4(zi(0,s,0)),r&&i.applyMatrix4(zi(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function el(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s=Q({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 ef=(i,t)=>{var u;const e=t.fbx_url||"//vrlab-static.ljcdn.com/release/web/v3/dipan3/dipan.FBX",n=(u=t.north_rad)!=null?u:void 0,o={},s=d=>W(exports,null,function*(){var H;const h=(d==null?void 0:d.fbx_url)||e,m=(H=d==null?void 0:d.north_rad)!=null?H:n;if(typeof m!="number")throw new Error('"northRad"\u914D\u7F6E\u53C2\u6570\u7F3A\u5931\uFF1A\u672A\u914D\u7F6E\u6307\u5357\u9488\u6307\u5411\uFF01');const A=i.model.bounding,v=A.max.x-A.min.x,p=A.max.z-A.min.z,g=Math.max(v,p),w=yield new pa.FBXLoader().loadAsync(h);el(w,{transparent:!0,side:k.DoubleSide,blending:k.AdditiveBlending});const P=[0,m-Math.PI/2,0],{model:{bounding:{max:{x,z:C},min:{x:D,y:E,z:O}}}}=i;o.yBase=E;const G={x:(x+D)/2,y:E-1.6,z:(C+O)/2},X=.0045*g;return $h(w,{position:G,rotation:P,scale:X}),o.object=w,!0}),r=({latitude:d})=>{if(!o.object)return;const h=a(d);h&&(o.object.position.y=h)},a=d=>{if(o.yBase===void 0)return;const h=.6;if(d>=Math.PI/4)return o.yBase-(h+1.6);const m=d*(4/Math.PI);return o.yBase-(h*m+1.6)};return{load:s,disable:()=>{!o.object||(i.scene.remove(o.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!o.object)return;const d=a(i.getPose().latitude);d&&(o.object.position.y=d),i.scene.add(o.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function tf(i,t){var c,u,d,h,m;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(u=t==null?void 0:t.fontSize)!=null?u:e*(35/256)*1.2,o=(d=t==null?void 0:t.backgroundColor)!=null?d:"rgba(0,0,0,0)",s=(h=t==null?void 0:t.fontColor)!=null?h:"#fff",r=(m=t==null?void 0:t.textAlign)!=null?m:"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 nf=({x:i,y:t,z:e})=>new V.Vector3(i,t,e),of=(i,t)=>{var v,p,g;const e={},n=(v=t.animationEnabled)!=null?v:!0,o=(p=t.position)!=null?p:void 0,s=(g=t.rad)!=null?g:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=b=>W(exports,null,function*(){var G,X,H,B,F,R,N,_;const w=(G=b==null?void 0:b.position)!=null?G:o;if(!w)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const P=nf(w),x=(X=b==null?void 0:b.rad)!=null?X:s,C=(H=b==null?void 0:b.fbx_url)!=null?H:r;if(e.rad=x,x===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${x}`));const D=yield new pa.FBXLoader().loadAsync(C);D.position.copy(P),D.rotation.z=x,D.scale.set(.8,.8,.8),el(D,{transparent:!0,side:k.DoubleSide});const E=(N=(R=(F=(B=D.children)==null?void 0:B[0])==null?void 0:F.children)==null?void 0:R[3])==null?void 0:N.clone();if(!E)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${E}`));const O=(_=t.name)!=null?_:"\u5165\u6237\u95E8";return E.material=new V.MeshBasicMaterial({transparent:!0,map:tf(O)}),E.renderOrder=3,D.children[0].add(E),e.object=D,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const b=1,w=new V.AnimationMixer(e.object);a.push(w);const P=w.clipAction(e.object.animations[0]);P.timeScale=b;let x;const C=()=>{let G=0,X=0;const H=1e3/30,B=F=>{G=requestAnimationFrame(B);const R=F-X;R<H||(X=F,a.forEach(N=>N.update(R/1e3)),i.needsRender=!0)};return G=requestAnimationFrame(B),()=>{cancelAnimationFrame(G)}},O={play:()=>{x||(P.play(),x=C(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{P.stop(),x==null||x(),x=void 0}};e.animation=O},u=b=>{var P;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((P=b==null?void 0:b.animationEnable)!=null?P:n)&&(e.animation||c(),e.animation.play()),i.scene.add(e.object),i.needsRender=!0},d=()=>{!e.object||(e.animation&&e.animation.stop(),i.scene.remove(e.object),i.needsRender=!0)},h=b=>b==="Floorplan"?u():d();return{load:l,enable:b=>(e.enabled||(e.enabled=!0,h(i.currentMode),i.on("modeChange",h),u(b)),!0),disable:()=>(e.enabled&&(e.enabled=!1,d(),i.off("modeChange",h)),!0)}};class yo extends bn.default.Tween{constructor(){super(...arguments);f(this,"disposeMethods",[]);f(this,"animationFrameDisposer");f(this,"onDispose",e=>(this.disposeMethods.push(e),this));f(this,"play",()=>(this.start(0),this.animationFrameDisposer=kn(e=>this.update(e)),this));f(this,"dispose",()=>{var e;this.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this.disposeMethods.forEach(n=>n()),this.disposeMethods=[],bn.default.remove(this)})}}function tl(i,t=bn.default.Easing.Linear.None){const e=new yo({progress:0}).to({progress:1});return i!==void 0&&e.duration(i),t!==void 0&&e.easing(t),e}const Cn=window.requestAnimationFrame||(i=>setTimeout(i,16)),sf=window.cancelAnimationFrame||clearTimeout;function bi(i,t=0){t<=0?Cn(i):Cn(()=>bi(i,t-1))}function kn(i,t=60){let e=-1,n=0,o=-1;const s=1e3/t;function r(a){o===-1&&(o=a),e=Cn(r),!(a-n<s)&&(n=a,i&&i(a-o))}return e=Cn(r),function(){sf(e)}}function rf(){const i=Date.now();return new Promise(t=>{Cn(()=>{t(Date.now()-i)})})}const af=di.Easing;function lf(i,t,e,n=af.Linear.None){const o=new di.Tween(i).to(t,e).easing(n);bi(()=>o.start(0));const s=kn(a=>{o.update(a)===!1&&s()}),r=[];return o.onDestroy=a=>(r.push(a),o),o.destroy=function(){this.stop(),Object.assign(o,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();s()},o}function cf(i,t){return lf({progress:0},{progress:1},i,t)}var nl=(i=>(i.Move="Move",i.Rotate="Rotate",i))(nl||{}),$e=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))($e||{});const Jn=Math.PI*2;function Cs(i){return(i%Jn+Jn)%Jn}function Es(i){return i%Jn}function Bi(i,t,e){return i+(t-i)*e}const $i=(i,t,e)=>{const n=Math.PI,o=n*2;return i=Cs(i),t=Cs(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}},uf=i=>{const t={},e=(l,c,...u)=>W(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((d,h)=>{const m=s.panoIndex!==void 0?s.panoIndex:i.panoIndex;m!==void 0?i.moveToPano(m,Object.assign({duration:r,moveEndCallback:()=>d(!0),moveCancelCallback:()=>h(!1)},s)):h(!1)})}),n=s=>{const r=i.state,a=Es(r.latitude),l=Es(s.latitude),{from:c,to:u}=$i(r.longitude,s.longitude,s.rotation||$e.Loop),d=r.fov,h=s.fov;return{from:{latitude:a,longitude:c,fov:d},to:{latitude:l,longitude:u,fov:h}}};return{move:e,rotate:(l,c,...u)=>W(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((m,A)=>{if(!s.panoIndex){m(!0);return}i.moveToPano(s.panoIndex,{moveEndCallback:()=>m(!0),moveCancelCallback:()=>A(!1)})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:d,to:h}=n(s);return yield new Promise(m=>{const A=({progress:w})=>{const P={};P.longitude=Bi(d.longitude,h.longitude,w),P.latitude=Bi(d.latitude,h.latitude,w),P.fov=Bi(d.fov,h.fov,w),i.setState(P,!0)},v=()=>{m(!0)},p=()=>{m(!1)},g=s.rotateSpeed?Math.ceil(Math.abs(h.longitude-d.longitude)/s.rotateSpeed*1e3):r,b=cf(g,di.Easing.Linear.None).onUpdate(A).onComplete(v).onDestroy(p);s.rotation===$e.Loop&&b.repeat(1/0).yoyo(!0),t.interruptCallback=(w=!0)=>{b.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),m(w)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function Ps(i,t){return i.x===t.x&&i.y===t.y}function il(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function ui(i,t){return(t.y-i.y)/(t.x-i.x)}function ol(i,t,e){const n=ui(i[1],i[0]),o=ui(t[1],t[0]);if(isNaN(n)||isNaN(o)||il(n,o))return!1;if(On(i[0],t))return i[0];if(On(i[1],t))return i[1];if(On(t[0],i))return t[0];if(On(t[1],i))return t[1];if(e&&!df(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 On(i,t){return Ps(i,t[0])||Ps(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&&il(ui(t[0],i),ui(i,t[1]))}function Rn(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function df(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)&&Rn(t[0],i[1],i[0])*Rn(i[1],t[1],i[0])>0&&Rn(i[0],t[1],t[0])*Rn(t[1],i[1],t[0])>0?1:0}function sl(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>sl(i,t-1))}const hf=`<style type="text/css">
|
|
115
|
+
`;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class cd extends oe{constructor(t){super(),ie(this,t,ld,ad,ne,{content:0},rd)}}function ud(i){le(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function dd(i){let t,e;return t=new sd({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||(I(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function hd(i){let t,e;return t=new cd({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||(I(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function fd(i){let t,e,n,o;const s=[hd,dd],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(),y(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){M(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let u=e;e=a(l),e===u?~e&&r[e].p(l,c):(n&&(se(),L(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()),I(n,1),n.m(t,null)):n=null)},i(l){o||(I(n),o=!0)},o(l){L(n),o=!1},d(l){l&&S(t),~e&&r[e].d()}}}function md(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 Ua extends oe{constructor(t){super(),ie(this,t,md,fd,ne,{floorIndex:2,floorplanData:3},ud)}}function pd(i){le(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 gd(i){let t,e=i[8].outerHTML+"",n;return{c(){t=new ei(!1),n=me(),t.a=n},m(o,s){t.m(e,o,s),M(o,n,s)},p(o,s){s&256&&e!==(e=o[8].outerHTML+"")&&t.p(e)},d(o){o&&S(n),o&&t.d()}}}function Ad(i){let t,e,n=i[1]&&No(i),o=i[0]&&Xo(i);return{c(){n&&n.c(),t=ee(),o&&o.c(),e=me()},m(s,r){n&&n.m(s,r),M(s,t,r),o&&o.m(s,r),M(s,e,r)},p(s,r){s[1]?n?n.p(s,r):(n=No(s),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),s[0]?o?o.p(s,r):(o=Xo(s),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(s){n&&n.d(s),s&&S(t),o&&o.d(s),s&&S(e)}}}function No(i){let t,e=i[2].name+"",n;return{c(){t=z("span"),n=ke(e),y(t,"class","floorplan-plugin__room-name")},m(o,s){M(o,t,s),j(t,n)},p(o,s){s&4&&e!==(e=o[2].name+"")&&Se(n,e)},d(o){o&&S(t)}}}function Xo(i){let t,e;return{c(){t=z("span"),e=ke(i[7]),y(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(n,o){M(n,t,o),j(t,e)},p(n,o){o&128&&Se(e,n[7])},d(n){n&&S(t)}}}function vd(i){let t,e,n;function o(a,l){if(a[3]===void 0)return Ad;if(a[8])return gd}let s=o(i),r=s&&s(i);return{c(){t=z("div"),r&&r.c(),y(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),T(t,"left",i[9]),T(t,"top",i[10]),T(t,"font-size",i[11]),T(t,"opacity",i[6]?"1":"0")},m(a,l){M(a,t,l),r&&r.m(t,null),e||(n=[at(an.call(null,t)),ge(t,"clientWidth",i[19]),ge(t,"clientHeight",i[20])],e=!0)},p(a,[l]){s===(s=o(a))&&r?r.p(a,l):(r&&r.d(1),r=s&&s(a),r&&(r.c(),r.m(t,null))),l&64&&T(t,"opacity",a[6]?"1":"0")},i:U,o:U,d(a){a&&S(t),r&&r.d(),e=!1,He(n)}}}function bd(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 yd(i,t,e){let n,o,s,r,a,{pxmm:l}=t,{roomAreaEnable:c}=t,{roomNameEnable:u}=t,{room:d}=t,{hoveredRoom:h}=t,{getRoomAreaText:m}=t,{getLabelElement:A}=t,{adaptiveRoomLabelVisibleEnable:v}=t;function p(H,B){if(B.width===0||B.height===0)return()=>!1;const F=H.path.map(({x:de,y:pe})=>[de,pe]),R=H.roomLabel.position,{x:N,y:_}=R,{width:$,height:Y}=B,ae=$/2,he=Y/2;return function(pe){const Pe=N*pe,Ie=_*pe,Me=F.map(([Ae,Ee])=>[Ae*pe,Ee*pe]);return[[Pe+ae,Ie-he],[Pe-ae,Ie-he],[Pe-ae,Ie+he],[Pe+ae,Ie+he]].every(Ae=>bd(Ae,Me))}}const g=document.body.clientWidth,b=document.body.clientHeight,w=d.roomLabel,P=w.positionInImage.x*100+"%",x=w.positionInImage.y*100+"%",C=(g<500||b<500?10:14)+"px";let D=0,E=0,O=!1;h.subscribe(function(B){e(16,O=!!B&&B.id===d.id)});const G=H=>{e(4,D=H.detail)},X=H=>{e(5,E=H.detail)};return i.$$set=H=>{"pxmm"in H&&e(12,l=H.pxmm),"roomAreaEnable"in H&&e(0,c=H.roomAreaEnable),"roomNameEnable"in H&&e(1,u=H.roomNameEnable),"room"in H&&e(2,d=H.room),"hoveredRoom"in H&&e(13,h=H.hoveredRoom),"getRoomAreaText"in H&&e(14,m=H.getRoomAreaText),"getLabelElement"in H&&e(3,A=H.getLabelElement),"adaptiveRoomLabelVisibleEnable"in H&&e(15,v=H.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&12&&e(8,n=A==null?void 0:A(d)),i.$$.dirty&16388&&e(7,o=d.size?m(d.size):""),i.$$.dirty&48&&e(18,s={width:D,height:E}),i.$$.dirty&262148&&e(17,r=s?p(d,s):void 0),i.$$.dirty&233472&&e(6,a=v?O?!0:!!(r!=null&&r(l)):!0)},[c,u,d,A,D,E,a,o,n,P,x,C,l,h,m,v,O,r,s,G,X]}class wd extends oe{constructor(t){super(),ie(this,t,yd,vd,ne,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},pd)}}function Cd(i){le(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 Yo(i,t,e){const n=i.slice();return n[12]=t[e],n}function Uo(i){let t,e=[],n=new Map,o,s,r,a=i[8];const l=c=>c[12].id;for(let c=0;c<a.length;c+=1){let u=Yo(i,a,c),d=l(u);n.set(d,e[c]=qo(d,u))}return{c(){t=z("div");for(let c=0;c<e.length;c+=1)e[c].c();y(t,"class","floorplan-plugin__room-labels svelte-13xux0b")},m(c,u){M(c,t,u);for(let d=0;d<e.length;d+=1)e[d].m(t,null);o=!0,s||(r=[at(an.call(null,t)),ge(t,"clientWidth",i[11])],s=!0)},p(c,u){u&447&&(a=c[8],se(),e=qe(e,u,l,1,c,a,n,t,Pt,qo,null,Yo),re())},i(c){if(!o){for(let u=0;u<a.length;u+=1)I(e[u]);o=!0}},o(c){for(let u=0;u<e.length;u+=1)L(e[u]);o=!1},d(c){c&&S(t);for(let u=0;u<e.length;u+=1)e[u].d();s=!1,He(r)}}}function qo(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=Be(r,s[a]);return n=new wd({props:r}),{key:i,first:null,c(){e=me(),K(n.$$.fragment),this.first=e},m(a,l){M(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||(I(n.$$.fragment,a),o=!0)},o(a){L(n.$$.fragment,a),o=!1},d(a){a&&S(e),Z(n,a)}}}function Ed(i){let t,e,n=i[8]&&Uo(i);return{c(){n&&n.c(),t=me()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[8]?n?(n.p(o,s),s&256&&I(n,1)):(n=Uo(o),n.c(),I(n,1),n.m(t.parentNode,t)):n&&(se(),L(n,1,1,()=>{n=null}),re())},i(o){e||(I(n),e=!0)},o(o){L(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function Pd(i,t,e){let n,{floorIndex:o}=t,{roomAreaEnable:s}=t,{roomNameEnable:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{getRoomAreaText:c}=t,{getLabelElement:u}=t,{adaptiveRoomLabelVisibleEnable:d}=t,h=0,m=0;const A=v=>{e(6,h=v.detail)};return i.$$set=v=>{"floorIndex"in v&&e(9,o=v.floorIndex),"roomAreaEnable"in v&&e(0,s=v.roomAreaEnable),"roomNameEnable"in v&&e(1,r=v.roomNameEnable),"floorplanData"in v&&e(10,a=v.floorplanData),"hoveredRoom"in v&&e(2,l=v.hoveredRoom),"getRoomAreaText"in v&&e(3,c=v.getRoomAreaText),"getLabelElement"in v&&e(4,u=v.getLabelElement),"adaptiveRoomLabelVisibleEnable"in v&&e(5,d=v.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&1536&&e(8,n=a.floorDatas[o].rooms),i.$$.dirty&1088){const{max:v,min:p}=a.bounding,g=v.x-p.x;e(7,m=h/g)}},[s,r,l,c,u,d,h,m,n,o,a,A]}class Id extends oe{constructor(t){super(),ie(this,t,Pd,Ed,ne,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},Cd)}}function kd(i){le(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 Jo(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function Zo(i,t,e){const n=i.slice();return n[14]=t[e],n}function Ko(i){let t;return{c(){t=z("div"),y(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),T(t,"left",i[14].left*100+"%"),T(t,"bottom",i[14].bottom*100+"%")},m(e,n){M(e,t,n)},p:U,d(e){e&&S(t)}}}function $o(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=ee(),y(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),q(n,"is-row",t[2]),y(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),T(e,"left",t[11].left*100+"%"),T(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){M(a,e,l),j(e,n),j(n,s),j(e,r)},p(a,l){t=a,l&2&&o!==(o=t[1](t[11].distance)+"")&&Se(s,o)},d(a){a&&S(e)}}}function xd(i){let t,e,n,o,s,r,a=[],l=new Map,c,u=i[3],d=[];for(let A=0;A<u.length;A+=1)d[A]=Ko(Zo(i,u,A));let h=i[4];const m=A=>A[13];for(let A=0;A<h.length;A+=1){let v=Jo(i,h,A),p=m(v);l.set(p,a[A]=$o(p,v))}return{c(){t=z("div"),e=z("div"),n=ee(),o=z("div");for(let A=0;A<d.length;A+=1)d[A].c();s=ee(),r=z("div");for(let A=0;A<a.length;A+=1)a[A].c();y(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),y(o,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),q(o,"is-row",i[2]),y(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),y(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+i[0]+" svelte-djlmk4"),q(t,"is-row",i[2]),T(t,"width",i[2]?"100%":1/16+"rem"),T(t,"height",i[2]?1/16+"rem":"100%")},m(A,v){M(A,t,v),j(t,e),j(t,n),j(t,o);for(let p=0;p<d.length;p+=1)d[p].m(o,null);j(t,s),j(t,r);for(let p=0;p<a.length;p+=1)a[p].m(r,null)},p(A,[v]){if(v&8){u=A[3];let p;for(p=0;p<u.length;p+=1){const g=Zo(A,u,p);d[p]?d[p].p(g,v):(d[p]=Ko(g),d[p].c(),d[p].m(o,null))}for(;p<d.length;p+=1)d[p].d(1);d.length=u.length}v&22&&(h=A[4],a=qe(a,v,m,1,A,h,l,r,ho,$o,null,Jo)),v&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+A[0]+" svelte-djlmk4")&&y(t,"class",c),v&5&&q(t,"is-row",A[2])},i:U,o:U,d(A){A&&S(t),ct(d,A);for(let v=0;v<a.length;v+=1)a[v].d()}}}const Rt=1e3,Qt=180;function Dd(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-Qt)*2,c=s.max.y-s.min.y-(Rt-Qt)*2,u=o.map(([A,v])=>a?[A.x,v.x]:[A.y,v.y]).flat().sort().filter((A,v,p)=>v===0?!0:A!==p[v-1]),d=u.map(A=>{const v=a?(A-s.min.x-Rt+Qt)/l:0,p=a?0:(A-s.min.y-Rt+Qt)/c;return{left:v,bottom:p}});d.unshift({left:0,bottom:0}),d.push(a?{left:1,bottom:0}:{left:0,bottom:1});const h=u[u.length-1]-u[0],m=u.map((A,v,p)=>{const g=v===0?0:A-p[v-1],b=v===0?0:(A+p[v-1])/2,w=a?(b-s.min.x-Rt+Qt)/l:0,P=a?0:(b-s.min.y-Rt+Qt)/c;return{left:w,bottom:P,distance:g}}).filter(({distance:A})=>A/h>.1);return i.$$set=A=>{"type"in A&&e(0,n=A.type),"data"in A&&e(5,o=A.data),"bounding"in A&&e(6,s=A.bounding),"getRuleDistanceText"in A&&e(1,r=A.getRuleDistanceText)},[n,r,a,d,m,o,s]}class Ld extends oe{constructor(t){super(),ie(this,t,Dd,xd,ne,{type:0,data:5,bounding:6,getRuleDistanceText:1},kd)}}function Sd(i){le(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function es(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function ts(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=Be(r,s[a]);return n=new Ld({props:r}),{key:i,first:null,c(){e=me(),K(n.$$.fragment),this.first=e},m(a,l){M(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||(I(n.$$.fragment,a),o=!0)},o(a){L(n.$$.fragment,a),o=!1},d(a){a&&S(e),Z(n,a)}}}function Md(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=es(i,s,a),c=r(l);n.set(c,e[a]=ts(c,l))}return{c(){t=z("div");for(let a=0;a<e.length;a+=1)e[a].c();y(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),T(t,"width",i[3]),T(t,"height",i[2])},m(a,l){M(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,[l]){l&19&&(s=a[4],se(),e=qe(e,l,r,1,a,s,n,t,Pt,ts,null,es),re()),l&8&&T(t,"width",a[3]),l&4&&T(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)I(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)L(e[l]);o=!1},d(a){a&&S(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const ns=1e3,is=180;function Td(i,t,e){let n,o,s,r,a,l,c,u,d,h,{floorIndex:m}=t,{floorplanData:A}=t,{getRuleDistanceText:v}=t;return i.$$set=p=>{"floorIndex"in p&&e(5,m=p.floorIndex),"floorplanData"in p&&e(6,A=p.floorplanData),"getRuleDistanceText"in p&&e(0,v=p.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=A.bounding),i.$$.dirty&96&&e(11,o=A.floorDatas[m].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-(ns-is)*2),i.$$.dirty&2&&e(8,u=n.max.y-n.min.y-(ns-is)*2),i.$$.dirty&1536&&e(3,d=c/a*100+"%"),i.$$.dirty&384&&e(2,h=u/l*100+"%")},[v,n,h,d,r,m,A,l,u,a,c,o,s]}class zd extends oe{constructor(t){super(),ie(this,t,Td,Md,ne,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},Sd)}}function Ai(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 qa({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function Bd(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 jd(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 Vd(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function Od(i){let t;return{c(){t=we("path"),y(t,"d",i[0]),y(t,"fill","#2F313A")},m(e,n){M(e,t,n)},p(e,[n]){n&1&&y(t,"d",e[0])},i:U,o:U,d(e){e&&S(t)}}}function Rd(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=Ai(o,{needZ:!0}))},[n,o]}class Qd extends oe{constructor(t){super(),ie(this,t,Rd,Od,ne,{path:1})}}function Fd(i){let t,e,n,o,s,r;return{c(){t=we("defs"),e=we("pattern"),n=we("rect"),o=we("path"),s=ee(),r=we("path"),y(n,"x","0"),y(n,"y","0"),y(n,"width",i[1]),y(n,"height",i[1]),y(n,"fill","#323747"),y(o,"d",i[2]),y(o,"stroke","#ffffff"),y(o,"stroke-opacity","0.06"),y(o,"stroke-width","0.5"),y(o,"fill","none"),y(e,"id","fpm-room-pattern-0"),y(e,"x","0"),y(e,"y","0"),y(e,"width",i[1]),y(e,"height",i[1]),y(e,"patternUnits","userSpaceOnUse"),y(e,"patternTransform","scale(50 50)"),y(r,"d",i[0]),y(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){M(a,t,l),j(t,e),j(e,n),j(e,o),M(a,s,l),M(a,r,l)},p(a,[l]){l&1&&y(r,"d",a[0])},i:U,o:U,d(a){a&&S(t),a&&S(s),a&&S(r)}}}const Ti=6;function Hd(i,t,e){let n,{path:o}=t;const s=Ti*2,r=`M0 ${Ti} h ${s} M${Ti} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=Ai(o,{needZ:!0}))},[n,s,r,o]}class _d extends oe{constructor(t){super(),ie(this,t,Hd,Fd,ne,{path:3})}}function Gd(i){let t,e,n,o,s,r,a,l,c,u,d;return{c(){t=we("defs"),e=we("pattern"),n=we("rect"),o=we("pattern"),s=we("rect"),r=ee(),a=we("path"),l=ee(),c=we("path"),u=ee(),d=we("path"),y(n,"x","0"),y(n,"y","0"),y(n,"width","6"),y(n,"height","50"),y(n,"fill","none"),y(n,"stroke","#4B4B57"),y(n,"stroke-width","0.5"),y(e,"id","room-material-pattern-1"),y(e,"x","0"),y(e,"y","0"),y(e,"width","12"),y(e,"height","50"),y(e,"patternUnits","userSpaceOnUse"),y(e,"patternTransform","scale(50 50)"),y(s,"x","0"),y(s,"y","0"),y(s,"width","6"),y(s,"height","50"),y(s,"fill","none"),y(s,"stroke","#4B4B57"),y(s,"stroke-width","0.5"),y(o,"id","room-material-pattern-2"),y(o,"x","6"),y(o,"y","25"),y(o,"width","12"),y(o,"height","50"),y(o,"patternUnits","userSpaceOnUse"),y(o,"patternTransform","scale(50 50)"),y(a,"d",i[0]),y(a,"fill","#43434D"),y(c,"d",i[0]),y(c,"fill","url(#room-material-pattern-1)"),y(d,"d",i[0]),y(d,"fill","url(#room-material-pattern-2)")},m(h,m){M(h,t,m),j(t,e),j(e,n),j(t,o),j(o,s),M(h,r,m),M(h,a,m),M(h,l,m),M(h,c,m),M(h,u,m),M(h,d,m)},p(h,[m]){m&1&&y(a,"d",h[0]),m&1&&y(c,"d",h[0]),m&1&&y(d,"d",h[0])},i:U,o:U,d(h){h&&S(t),h&&S(r),h&&S(a),h&&S(l),h&&S(c),h&&S(u),h&&S(d)}}}function Wd(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=Ai(o,{needZ:!0}))},[n,o]}class Nd extends oe{constructor(t){super(),ie(this,t,Wd,Gd,ne,{path:1})}}function Xd(i){le(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 os(i,t,e){const n=i.slice();return n[5]=t[e],n}function Yd(i){let t,e;return t=new _d({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||(I(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Ud(i){let t,e;return t=new Nd({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||(I(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function qd(i){let t,e;return t=new Qd({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||(I(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function ss(i){let t,e,n,o;const s=[qd,Ud,Yd],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=we("svg"),n.c(),y(t,"width","100%"),y(t,"height","100%"),y(t,"viewBox",`0 0 ${i[1]} ${i[2]}`),y(t,"class","svelte-1dykexu")},m(l,c){M(l,t,c),r[e].m(t,null),o=!0},p(l,c){let u=e;e=a(l),e===u?r[e].p(l,c):(se(),L(r[u],1,1,()=>{r[u]=null}),re(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),I(n,1),n.m(t,null))},i(l){o||(I(n),o=!0)},o(l){L(n),o=!1},d(l){l&&S(t),r[e].d()}}}function Jd(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=ss(os(i,n,r));const s=r=>L(o[r],1,1,()=>{o[r]=null});return{c(){t=z("div");for(let r=0;r<o.length;r+=1)o[r].c();y(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){M(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=os(r,n,l);o[l]?(o[l].p(c,a),I(o[l],1)):(o[l]=ss(c),o[l].c(),I(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)I(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)L(o[a]);e=!1},d(r){r&&S(t),ct(o,r)}}}function Zd(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=>fe(Q({},l),{path:l.path.map(c=>qa(c,s.bounding))})))},[n,r,a,o,s]}class Kd extends oe{constructor(t){super(),ie(this,t,Zd,Jd,ne,{floorIndex:3,floorplanData:4},Xd)}}function $d(i){le(i,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function eh(i){let t,e,n,o;return{c(){t=we("path"),y(t,"d",i[5]),y(t,"fill","#fff"),y(t,"style",i[2]),y(t,"id",e=`${i[1]}_${i[0].id}`),y(t,"class","svelte-qq2273")},m(s,r){M(s,t,r),n||(o=[ge(t,"mouseenter",i[3]),ge(t,"mouseleave",i[4])],n=!0)},p(s,[r]){r&4&&y(t,"style",s[2]),r&3&&e!==(e=`${s[1]}_${s[0].id}`)&&y(t,"id",e)},i:U,o:U,d(s){s&&S(t),n=!1,He(o)}}}function th(i,t,e){let n,o,{room:s}=t,{floorIndex:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{highlightData:c}=t;function u(){l.set(s)}function d(){l.set(void 0)}const{bounding:h}=a,m=Ai(s.path,{needZ:!0,format:A=>qa(A,h)});return i.$$set=A=>{"room"in A&&e(0,s=A.room),"floorIndex"in A&&e(1,r=A.floorIndex),"floorplanData"in A&&e(6,a=A.floorplanData),"hoveredRoom"in A&&e(7,l=A.hoveredRoom),"highlightData"in A&&e(8,c=A.highlightData)},i.$$.update=()=>{i.$$.dirty&259&&e(9,n=c[`${r}_${s.id}`]),i.$$.dirty&512&&e(2,o=n?`fill: ${n.color}; --opacity: ${n.opacity}; pointer-events: ${n.disabled?"none":"auto"}`:null)},[s,r,o,u,d,m,a,l,c,n]}class nh extends oe{constructor(t){super(),ie(this,t,th,eh,ne,{room:0,floorIndex:1,floorplanData:6,hoveredRoom:7,highlightData:8},$d)}}function ih(i){le(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 rs(i,t,e){const n=i.slice();return n[6]=t[e],n}function as(i,t){let e,n,o;const s=[{room:t[6],floorplanData:t[1],hoveredRoom:t[2],floorIndex:t[0],highlightData:t[3]}];let r={};for(let a=0;a<s.length;a+=1)r=Be(r,s[a]);return n=new nh({props:r}),{key:i,first:null,c(){e=me(),K(n.$$.fragment),this.first=e},m(a,l){M(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&15?Re(s,[{room:t[6],floorplanData:t[1],hoveredRoom:t[2],floorIndex:t[0],highlightData:t[3]}]):{};n.$set(c)},i(a){o||(I(n.$$.fragment,a),o=!0)},o(a){L(n.$$.fragment,a),o=!1},d(a){a&&S(e),Z(n,a)}}}function oh(i){let t,e,n=[],o=new Map,s,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[6].id;for(let l=0;l<r.length;l+=1){let c=rs(i,r,l),u=a(c);o.set(u,n[l]=as(u,c))}return{c(){t=z("div"),e=we("svg");for(let l=0;l<n.length;l+=1)n[l].c();y(e,"width","100%"),y(e,"height","100%"),y(e,"viewBox",`0 0 ${i[4]} ${i[5]}`),y(e,"class","svelte-1kqo6e4"),y(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){M(l,t,c),j(t,e);for(let u=0;u<n.length;u+=1)n[u].m(e,null);s=!0},p(l,[c]){c&15&&(r=l[1].floorDatas[l[0]].rooms,se(),n=qe(n,c,a,1,l,r,o,e,Pt,as,null,rs),re())},i(l){if(!s){for(let c=0;c<r.length;c+=1)I(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)L(n[c]);s=!1},d(l){l&&S(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function sh(i,t,e){let{floorIndex:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t,{highlightData:r}=t;const a=o.bounding.max.x-o.bounding.min.x,l=o.bounding.max.y-o.bounding.min.y;return i.$$set=c=>{"floorIndex"in c&&e(0,n=c.floorIndex),"floorplanData"in c&&e(1,o=c.floorplanData),"hoveredRoom"in c&&e(2,s=c.hoveredRoom),"highlightData"in c&&e(3,r=c.highlightData)},[n,o,s,r,a,l]}class Ja extends oe{constructor(t){super(),ie(this,t,sh,oh,ne,{floorIndex:0,floorplanData:1,hoveredRoom:2,highlightData:3},ih)}}function rh(i){le(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 ls(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[8],hoveredRoom:i[14],highlightData:i[13]}];let o={};for(let s=0;s<n.length;s+=1)o=Be(o,n[s]);return t=new Ja({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&24834?Re(n,[{floorIndex:s[1],floorplanData:s[8],hoveredRoom:s[14],highlightData:s[13]}]):{};t.$set(a)},i(s){e||(I(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function cs(i){let t,e;const n=[{floorplanData:i[8],roomAreaEnable:i[5],roomNameEnable:i[6],floorIndex:i[1],getRoomAreaText:i[9],getLabelElement:i[10],hoveredRoom:i[14],adaptiveRoomLabelVisibleEnable:i[12]}];let o={};for(let s=0;s<n.length;s+=1)o=Be(o,n[s]);return t=new Id({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&22370?Re(n,[{floorplanData:s[8],roomAreaEnable:s[5],roomNameEnable:s[6],floorIndex:s[1],getRoomAreaText:s[9],getLabelElement:s[10],hoveredRoom:s[14],adaptiveRoomLabelVisibleEnable:s[12]}]):{};t.$set(a)},i(s){e||(I(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function us(i){let t,e;const n=[{floorplanData:i[8],floorIndex:i[1],getRuleDistanceText:i[11]}];let o={};for(let s=0;s<n.length;s+=1)o=Be(o,n[s]);return t=new zd({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&2306?Re(n,[{floorplanData:s[8],floorIndex:s[1],getRuleDistanceText:s[11]}]):{};t.$set(a)},i(s){e||(I(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function ah(i){let t,e,n,o,s,r,a,l,c;const u=[{floorIndex:i[1],floorplanData:i[8]}];let d={};for(let g=0;g<u.length;g+=1)d=Be(d,u[g]);e=new Kd({props:d});let h=(i[2]||i[3])&&ls(i);const m=[{floorplanData:i[8],floorIndex:i[1]}];let A={};for(let g=0;g<m.length;g+=1)A=Be(A,m[g]);s=new Ua({props:A});let v=i[4]&&cs(i),p=i[7]&&us(i);return{c(){t=z("div"),K(e.$$.fragment),n=ee(),h&&h.c(),o=ee(),K(s.$$.fragment),r=ee(),v&&v.c(),a=ee(),p&&p.c(),y(t,"class",l=Te(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(g,b){M(g,t,b),J(e,t,null),j(t,n),h&&h.m(t,null),j(t,o),J(s,t,null),j(t,r),v&&v.m(t,null),j(t,a),p&&p.m(t,null),c=!0},p(g,[b]){const w=b&258?Re(u,[{floorIndex:g[1],floorplanData:g[8]}]):{};e.$set(w),g[2]||g[3]?h?(h.p(g,b),b&12&&I(h,1)):(h=ls(g),h.c(),I(h,1),h.m(t,o)):h&&(se(),L(h,1,1,()=>{h=null}),re());const P=b&258?Re(m,[{floorplanData:g[8],floorIndex:g[1]}]):{};s.$set(P),g[4]?v?(v.p(g,b),b&16&&I(v,1)):(v=cs(g),v.c(),I(v,1),v.m(t,a)):v&&(se(),L(v,1,1,()=>{v=null}),re()),g[7]?p?(p.p(g,b),b&128&&I(p,1)):(p=us(g),p.c(),I(p,1),p.m(t,null)):p&&(se(),L(p,1,1,()=>{p=null}),re()),(!c||b&1&&l!==(l=Te(`floorplan-plugin__floor${g[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&y(t,"class",l)},i(g){c||(I(e.$$.fragment,g),I(h),I(s.$$.fragment,g),I(v),I(p),c=!0)},o(g){L(e.$$.fragment,g),L(h),L(s.$$.fragment,g),L(v),L(p),c=!1},d(g){g&&S(t),Z(e),h&&h.d(),Z(s),v&&v.d(),p&&p.d()}}}function lh(i,t,e){let{isCurrent:n}=t,{floorIndex:o}=t,{highlightEnable:s}=t,{hoverEnable:r}=t,{roomLabelsEnable:a}=t,{roomAreaEnable:l}=t,{roomNameEnable:c}=t,{ruleLabelsEnable:u}=t,{floorplanData:d}=t,{getRoomAreaText:h}=t,{getLabelElement:m}=t,{getRuleDistanceText:A}=t,{adaptiveRoomLabelVisibleEnable:v}=t,{highlightData:p}=t;const g=mo(void 0);return i.$$set=b=>{"isCurrent"in b&&e(0,n=b.isCurrent),"floorIndex"in b&&e(1,o=b.floorIndex),"highlightEnable"in b&&e(2,s=b.highlightEnable),"hoverEnable"in b&&e(3,r=b.hoverEnable),"roomLabelsEnable"in b&&e(4,a=b.roomLabelsEnable),"roomAreaEnable"in b&&e(5,l=b.roomAreaEnable),"roomNameEnable"in b&&e(6,c=b.roomNameEnable),"ruleLabelsEnable"in b&&e(7,u=b.ruleLabelsEnable),"floorplanData"in b&&e(8,d=b.floorplanData),"getRoomAreaText"in b&&e(9,h=b.getRoomAreaText),"getLabelElement"in b&&e(10,m=b.getLabelElement),"getRuleDistanceText"in b&&e(11,A=b.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in b&&e(12,v=b.adaptiveRoomLabelVisibleEnable),"highlightData"in b&&e(13,p=b.highlightData)},[n,o,s,r,a,l,c,u,d,h,m,A,v,p,g]}class ch extends oe{constructor(t){super(),ie(this,t,lh,ah,ne,{isCurrent:0,floorIndex:1,highlightEnable:2,hoverEnable:3,roomLabelsEnable:4,roomAreaEnable:5,roomNameEnable:6,ruleLabelsEnable:7,floorplanData:8,getRoomAreaText:9,getLabelElement:10,getRuleDistanceText:11,adaptiveRoomLabelVisibleEnable:12,highlightData:13},rh)}}function uh(i){le(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function ds(i,t,e){const n=i.slice();return n[21]=t[e],n}function hs(i){let t,e,n,o,s,r=i[13].floorDatas,a=[];for(let d=0;d<r.length;d+=1)a[d]=fs(ds(i,r,d));const l=d=>L(a[d],1,1,()=>{a[d]=null});let c=i[5]&&ms(i),u=i[8]&&ps(i);return{c(){t=z("div");for(let d=0;d<a.length;d+=1)a[d].c();e=ee(),c&&c.c(),n=ee(),u&&u.c(),y(t,"class","floorplan-main svelte-86bqav")},m(d,h){M(d,t,h);for(let m=0;m<a.length;m+=1)a[m].m(t,null);j(t,e),c&&c.m(t,null),j(t,n),u&&u.m(t,null),s=!0},p(d,h){if(i=d,h&2047696){r=i[13].floorDatas;let m;for(m=0;m<r.length;m+=1){const A=ds(i,r,m);a[m]?(a[m].p(A,h),I(a[m],1)):(a[m]=fs(A),a[m].c(),I(a[m],1),a[m].m(t,e))}for(se(),m=r.length;m<a.length;m+=1)l(m);re()}i[5]?c?(c.p(i,h),h&32&&I(c,1)):(c=ms(i),c.c(),I(c,1),c.m(t,n)):c&&(se(),L(c,1,1,()=>{c=null}),re()),i[8]?u?(u.p(i,h),h&256&&I(u,1)):(u=ps(i),u.c(),I(u,1),u.m(t,null)):u&&(se(),L(u,1,1,()=>{u=null}),re())},i(d){if(!s){for(let h=0;h<r.length;h+=1)I(a[h]);I(c),I(u),o||Oe(()=>{o=Tt(t,Mt,{duration:i[0],easing:At}),o.start()}),s=!0}},o(d){a=a.filter(Boolean);for(let h=0;h<a.length;h+=1)L(a[h]);L(c),L(u),s=!1},d(d){d&&S(t),ct(a,d),c&&c.d(),u&&u.d()}}}function fs(i){let t,e;const n=[{hoverEnable:i[6],highlightEnable:i[7],floorplanData:i[13],getRoomAreaText:i[16],getLabelElement:i[17],getRuleDistanceText:i[18],roomLabelsEnable:i[9],roomAreaEnable:i[10],roomNameEnable:i[11],ruleLabelsEnable:i[12],adaptiveRoomLabelVisibleEnable:i[19],highlightData:i[20]},{floorIndex:i[21].floorIndex},{isCurrent:i[21].floorIndex===i[4]}];let o={};for(let s=0;s<n.length;s+=1)o=Be(o,n[s]);return t=new ch({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&2047696?Re(n,[r&2047680&&{hoverEnable:s[6],highlightEnable:s[7],floorplanData:s[13],getRoomAreaText:s[16],getLabelElement:s[17],getRuleDistanceText:s[18],roomLabelsEnable:s[9],roomAreaEnable:s[10],roomNameEnable:s[11],ruleLabelsEnable:s[12],adaptiveRoomLabelVisibleEnable:s[19],highlightData:s[20]},r&8192&&{floorIndex:s[21].floorIndex},r&8208&&{isCurrent:s[21].floorIndex===s[4]}]):{};t.$set(a)},i(s){e||(I(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function ms(i){let t,e;const n=[{panoIndex:i[3],floorplanData:i[13],lastPanoramaLongitude:i[14],cameraImageUrl:i[15]}];let o={};for(let s=0;s<n.length;s+=1)o=Be(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&57352?Re(n,[{panoIndex:s[3],floorplanData:s[13],lastPanoramaLongitude:s[14],cameraImageUrl:s[15]}]):{};t.$set(a)},i(s){e||(I(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function ps(i){let t,e;return t=new td({props:{floorplanData:i[13],northDesc:i[2]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&8192&&(s.floorplanData=n[13]),o&4&&(s.northDesc=n[2]),t.$set(s)},i(n){e||(I(t.$$.fragment,n),e=!0)},o(n){L(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function dh(i){let t,e,n=i[1]&&hs(i);return{c(){n&&n.c(),t=me()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&I(n,1)):(n=hs(o),n.c(),I(n,1),n.m(t.parentNode,t)):n&&(se(),L(n,1,1,()=>{n=null}),re())},i(o){e||(I(n),e=!0)},o(o){L(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function hh(i,t,e){let{duration:n=0}=t,{visible:o}=t,{northDesc:s}=t,{panoIndex:r}=t,{floorIndex:a}=t,{cameraEnable:l}=t,{hoverEnable:c}=t,{highlightEnable:u}=t,{compassEnable:d}=t,{roomLabelsEnable:h}=t,{roomAreaEnable:m}=t,{roomNameEnable:A}=t,{ruleLabelsEnable:v}=t,{floorplanData:p}=t,{lastPanoramaLongitude:g}=t,{cameraImageUrl:b}=t,{getRoomAreaText:w}=t,{getLabelElement:P}=t,{getRuleDistanceText:x}=t,{adaptiveRoomLabelVisibleEnable:C}=t,{highlightData:D}=t;return i.$$set=E=>{"duration"in E&&e(0,n=E.duration),"visible"in E&&e(1,o=E.visible),"northDesc"in E&&e(2,s=E.northDesc),"panoIndex"in E&&e(3,r=E.panoIndex),"floorIndex"in E&&e(4,a=E.floorIndex),"cameraEnable"in E&&e(5,l=E.cameraEnable),"hoverEnable"in E&&e(6,c=E.hoverEnable),"highlightEnable"in E&&e(7,u=E.highlightEnable),"compassEnable"in E&&e(8,d=E.compassEnable),"roomLabelsEnable"in E&&e(9,h=E.roomLabelsEnable),"roomAreaEnable"in E&&e(10,m=E.roomAreaEnable),"roomNameEnable"in E&&e(11,A=E.roomNameEnable),"ruleLabelsEnable"in E&&e(12,v=E.ruleLabelsEnable),"floorplanData"in E&&e(13,p=E.floorplanData),"lastPanoramaLongitude"in E&&e(14,g=E.lastPanoramaLongitude),"cameraImageUrl"in E&&e(15,b=E.cameraImageUrl),"getRoomAreaText"in E&&e(16,w=E.getRoomAreaText),"getLabelElement"in E&&e(17,P=E.getLabelElement),"getRuleDistanceText"in E&&e(18,x=E.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in E&&e(19,C=E.adaptiveRoomLabelVisibleEnable),"highlightData"in E&&e(20,D=E.highlightData)},[n,o,s,r,a,l,c,u,d,h,m,A,v,p,g,b,w,P,x,C,D]}class po extends oe{constructor(t){super(),ie(this,t,hh,dh,ne,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,cameraEnable:5,hoverEnable:6,highlightEnable:7,compassEnable:8,roomLabelsEnable:9,roomAreaEnable:10,roomNameEnable:11,ruleLabelsEnable:12,floorplanData:13,lastPanoramaLongitude:14,cameraImageUrl:15,getRoomAreaText:16,getLabelElement:17,getRuleDistanceText:18,adaptiveRoomLabelVisibleEnable:19,highlightData:20},uh)}}const fh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA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IK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function mh(i){return W(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(o){return W(this,null,function*(){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=yield fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s})};return yield Promise.all(i.map(e))})}function ph(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 gh(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(ph),rules:i.rules}}function Ah(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function vh(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 W(this,null,function*(){const t=yield mh(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(gh),o=i.computed_data.entrance?vh(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(Ah)}})}function bh(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:fh,width:45,height:48},a=Vd(s,t),l=Bd(s,e),c=jd(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function yh(i,t){return t(i),i}function vi(i,t){return yh({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function gs(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 go(i,t,e=pt.BOUNDING_CENTER){const n=gs(i,t),o=gs(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 Ao(i,t,e,n){const o=go(i,e,n==null?void 0:n.attachedTo),s=new k.Vector3(0,o,0),r=new k.Vector3(1,o,0),a=s.clone().project(i.camera),l=r.clone().project(i.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}class In{constructor(t,e){f(this,"VERSION","2.13.2-dev.2");f(this,"five");f(this,"hooks",new Zt);f(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}}class zt extends In{}var Ge=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(Ge||{});const Za=500,wh=80;function Ki(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function Ka(i,t){return W(this,null,function*(){yield new Promise((e,n)=>{i.changeMode(...t).catch(o=>n(o)),i.once("initAnimationEnded",()=>{const o=i.getCurrentState(),s=t[0];o.mode!==s&&n(new Error("mode \u4E0E\u9884\u671F\u4E0D\u7B26")),(()=>{const l=t[1];return l?Object.keys(l).every(c=>{const u=o[c];if(u===void 0)return!0;const d=l[c];return typeof u=="number"&&typeof d=="number"?Ki(u,d,2):u===d}):!0})()||n(new Error("five pose \u4E0E\u9884\u671F\u4E0D\u7B26")),e()})})})}function vo(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!(!Ki(e,s,2)||!Ki(n,r,2)||o!==a)}function $a(i,t,e=!0){return W(this,null,function*(){if(vo(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[u]=yield ai(Ka(i,[t.mode,t,void 0,e]));if(u)throw new Error(Ge.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 ai(i.updateCamera(t,l,e));if(c)throw new Error(Ge.UpdateCameraError)})}function Ut(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 Ch(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 Eh(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 Ph extends zt{constructor(e,n){var a;super(e);f(this,"name","modelFloorplanPlugin");f(this,"state");f(this,"data");f(this,"showState");f(this,"showPromise");f(this,"app");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"selector");f(this,"showRejection");f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(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")});f(this,"show",(...n)=>W(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));f(this,"hide",(...n)=>W(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!vo(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=Ao(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})});f(this,"highlight",e=>{!this.state.config.highlightEnable||(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,Ge.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(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}))});f(this,"_show",e=>W(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Ge.ModelNotLoaded);if(!this.data)throw new Error(Ge.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=Q(Q({},n),e),s=()=>W(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=h=>{a=!0,l=h};const[c]=yield ai($a(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Ge.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,d=o.immediately?0:Za;Ut(this.five,u,d),this.render(d)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,Ge.BreakOffByHide),this.showPromise=void 0;const o=Q(Q({},{userAction:!0,isAutoHide:!1}),e);Ut(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(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)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(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||Eh(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});f(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();Ch(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});f(this,"onFiveWantsGesture",(e,n)=>{if(!!this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});f(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});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(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:wh/((a=n==null?void 0:n.scale)!=null?a:1)};const o={northDesc:"\u5317",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:vt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},s=n?vi(n,["selector","scale"]):{},r=Q(Q({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return W(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield 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 W(this,null,function*(){return yield bt(e.data)})}updateState(e,n){const o=this.state,s=e.config?Q(Q({},o.config),e.config):o.config;this.state=fe(Q(Q({},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=fe(Q({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new po({target:this.container,intro:!0,props:n})}}const Ih=(i,t)=>new Ph(i,t);function kh(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 xh(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 Dh extends zt{constructor(e,n){super(e);f(this,"name","modelFloorplanPlugin");f(this,"state");f(this,"data");f(this,"showState");f(this,"showPromise");f(this,"app");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"selector");f(this,"showRejection");f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(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")});f(this,"show",(...n)=>W(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));f(this,"hide",(...n)=>W(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!vo(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=Ao(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})});f(this,"highlight",e=>{!this.state.config.highlightEnable||(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,Ge.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(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}))});f(this,"_show",e=>W(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Ge.ModelNotLoaded);if(!this.data)throw new Error(Ge.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=Q(Q({},n),e),s=()=>W(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=h=>{a=!0,l=h};const[c]=yield ai($a(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Ge.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,d=o.immediately?0:Za;Ut(this.five,u,d),this.render(d)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,Ge.BreakOffByHide),this.showPromise=void 0;const o=Q(Q({},{userAction:!0,isAutoHide:!1}),e);Ut(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(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)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();this.updatePosition(),this.updateSize(),kh(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});f(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:(xh(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2,fov:90};const o={northDesc:"\u5317",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:vt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?vi(n,["selector","scale"]):{},r=Q(Q({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return W(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield 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=go(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new k.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}formatData(e){return W(this,null,function*(){return yield bt(e.data)})}updateState(e,n){const o=this.state,s=e.config?Q(Q({},o.config),e.config):o.config;this.state=fe(Q(Q({},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=fe(Q({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new po({target:this.container,intro:!0,props:n})}}const Lh=(i,t)=>new Dh(i,t);class Sh extends zt{constructor(e,n){super(e);f(this,"name","topviewFloorplanPlugin");f(this,"state");f(this,"data");f(this,"app");f(this,"selector");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"highlightData",{});f(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=Ao(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})});f(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")});f(this,"highlight",e=>{!this.state.config.highlightEnable||(this.highlightData=e,this.render())});f(this,"unhighlight",()=>{this.highlightData={},this.render()});f(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})});f(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)});f(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});f(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{!this.state.visible||(this.updatePosition(),this.updateSize())});f(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});f(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});f(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}))});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"));const o={northDesc:"\u5317",modelOpacity:1,cameraEnable:!0,hoverEnable:!0,highlightEnable:!1,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:vt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?vi(n,["selector","scale"]):{},r=Q(Q({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return W(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield 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=go(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new k.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return W(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return W(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return W(this,null,function*(){return yield bt(e.data)})}_show(e){return W(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:n}=e;this.hooks.emit("show",{userAction:n,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield Ka(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;Ut(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return W(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;Ut(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?Q(Q({},o.config),e.config):o.config;this.state=fe(Q(Q({},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=fe(Q({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new po({target:this.container,intro:!0,props:n})}}const Mh=(i,t)=>new Sh(i,t);function bo(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function Th(i){le(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 zh(i){let t,e,n;return{c(){t=z("div"),e=z("div"),n=z("div"),y(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),T(n,"background-image","url("+(i[0]||vt)+")"),T(n,"transform",i[1]),y(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),T(e,"transform",i[2]),y(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(o,s){M(o,t,s),j(t,e),j(e,n)},p(o,[s]){s&1&&T(n,"background-image","url("+(o[0]||vt)+")"),s&2&&T(n,"transform",o[1]),s&4&&T(e,"transform",o[2])},i:U,o:U,d(o){o&&S(t)}}}function Bh(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function jh(i,t,e){let n,o,{five:s}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=s.getCurrentState().panoIndex,u=s.getCurrentState().longitude;function d(A,v){const p=A.bounding,g=A.observers[v];if(!g)return"";const b=(p.max.x-p.min.x)*r,w=(p.max.y-p.min.y)*r,P=Math.floor(g.positionInImage.x*b),x=Math.floor(g.positionInImage.y*w);return`translate(${P}px, ${x}px)`}function h(A){e(6,c=A)}const m=bo(A=>{e(7,u=A.longitude)},1e3/60);return Ue(()=>(s.on("panoWillArrive",h),s.on("cameraDirectionUpdate",m),function(){s.off("panoWillArrive",h),s.off("cameraDirectionUpdate",m)})),i.$$set=A=>{"five"in A&&e(3,s=A.five),"pxmm"in A&&e(4,r=A.pxmm),"floorplanData"in A&&e(5,a=A.floorplanData),"cameraImageUrl"in A&&e(0,l=A.cameraImageUrl)},i.$$.update=()=>{i.$$.dirty&96&&e(2,n=d(a,c)),i.$$.dirty&128&&e(1,o=Bh(u))},[l,o,n,s,r,a,c,u]}class Vh extends oe{constructor(t){super(),ie(this,t,jh,zh,ne,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},Th)}}function Oh(i){le(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 As(i,t,e){const n=i.slice();return n[1]=t[e],n}function vs(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=ee(),y(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),T(n,"background-image",`url(${t[1].icon.url})`),T(n,"width",o),T(n,"height",s),y(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),T(e,"top",a),T(e,"left",l),this.first=e},m(c,u){M(c,e,u),j(e,n),j(e,r)},p(c,u){t=c,u&1&&T(n,"background-image",`url(${t[1].icon.url})`),u&1&&o!==(o=`${t[1].icon.width/16}rem`)&&T(n,"width",o),u&1&&s!==(s=`${t[1].icon.height/16}rem`)&&T(n,"height",s),u&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&T(e,"top",a),u&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&T(e,"left",l)},d(c){c&&S(e)}}}function Rh(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=As(i,o,r),l=s(a);n.set(l,e[r]=vs(l,a))}return{c(){t=z("div");for(let r=0;r<e.length;r+=1)e[r].c();y(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){M(r,t,a);for(let l=0;l<e.length;l+=1)e[l].m(t,null)},p(r,[a]){a&1&&(o=r[0],e=qe(e,a,s,1,r,o,n,t,ho,vs,null,As))},i:U,o:U,d(r){r&&S(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function Qh(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class Fh extends oe{constructor(t){super(),ie(this,t,Qh,Rh,ne,{extraObjects:0},Oh)}}function bs(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=Be(o,n[s]);return t=new Ja({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||(I(t.$$.fragment,s),e=!0)},o(s){L(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function Hh(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=Be(l,a[u]);t=new Ua({props:l}),n=new Fh({props:{extraObjects:i[5]}});let c=i[3]&&bs(i);return{c(){K(t.$$.fragment),e=ee(),K(n.$$.fragment),o=ee(),c&&c.c(),s=me()},m(u,d){J(t,u,d),M(u,e,d),J(n,u,d),M(u,o,d),c&&c.m(u,d),M(u,s,d),r=!0},p(u,[d]){const h=d&20?Re(a,[{floorIndex:u[2],floorplanData:u[4]}]):{};t.$set(h);const m={};d&32&&(m.extraObjects=u[5]),n.$set(m),u[3]?c?(c.p(u,d),d&8&&I(c,1)):(c=bs(u),c.c(),I(c,1),c.m(s.parentNode,s)):c&&(se(),L(c,1,1,()=>{c=null}),re())},i(u){r||(I(t.$$.fragment,u),I(n.$$.fragment,u),I(c),r=!0)},o(u){L(t.$$.fragment,u),L(n.$$.fragment,u),L(c),r=!1},d(u){Z(t,u),u&&S(e),Z(n,u),u&&S(o),c&&c.d(u),u&&S(s)}}}function _h(i,t,e){let n,{five:o}=t,{pxmm:s}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t;const u=void 0;return i.$$set=d=>{"five"in d&&e(0,o=d.five),"pxmm"in d&&e(1,s=d.pxmm),"floorIndex"in d&&e(2,r=d.floorIndex),"hoverEnable"in d&&e(3,a=d.hoverEnable),"floorplanData"in d&&e(4,l=d.floorplanData),"extraObjects"in d&&e(7,c=d.extraObjects)},i.$$.update=()=>{i.$$.dirty&132&&e(5,n=c==null?void 0:c.filter(d=>d.floorIndex===r))},[o,s,r,a,l,n,u,c]}class Gh extends oe{constructor(t){super(),ie(this,t,_h,Hh,ne,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:7})}}function Wh(i){le(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 ys(i){let t,e,n,o,s=i[6]!==0&&ws(i);return{c(){t=z("div"),s&&s.c(),y(t,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(r,a){M(r,t,a),s&&s.m(t,null),e=!0,n||(o=[at(an.call(null,t)),ge(t,"clientWidth",i[12]),ge(t,"clientHeight",i[13])],n=!0)},p(r,a){r[6]!==0?s?(s.p(r,a),a&64&&I(s,1)):(s=ws(r),s.c(),I(s,1),s.m(t,null)):s&&(se(),L(s,1,1,()=>{s=null}),re())},i(r){e||(I(s),e=!0)},o(r){L(s),e=!1},d(r){r&&S(t),s&&s.d(),n=!1,He(o)}}}function ws(i){let t,e,n,o,s=`${i[8]}px`,r=`${i[11]}px`,a;const l=[{five:i[0],pxmm:i[9],floorIndex:i[10],floorplanData:i[3],hoverEnable:i[2],extraObjects:i[5]}];let c={};for(let h=0;h<l.length;h+=1)c=Be(c,l[h]);e=new Gh({props:c});const u=[{pxmm:i[9],five:i[0],floorplanData:i[3],cameraImageUrl:i[4]}];let d={};for(let h=0;h<u.length;h+=1)d=Be(d,u[h]);return o=new Vh({props:d}),{c(){t=z("div"),K(e.$$.fragment),n=ee(),K(o.$$.fragment),y(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),T(t,"width",s),T(t,"height",r)},m(h,m){M(h,t,m),J(e,t,null),j(t,n),J(o,t,null),a=!0},p(h,m){const A=m&1581?Re(l,[{five:h[0],pxmm:h[9],floorIndex:h[10],floorplanData:h[3],hoverEnable:h[2],extraObjects:h[5]}]):{};e.$set(A);const v=m&537?Re(u,[{pxmm:h[9],five:h[0],floorplanData:h[3],cameraImageUrl:h[4]}]):{};o.$set(v),m&256&&s!==(s=`${h[8]}px`)&&T(t,"width",s),m&2048&&r!==(r=`${h[11]}px`)&&T(t,"height",r)},i(h){a||(I(e.$$.fragment,h),I(o.$$.fragment,h),a=!0)},o(h){L(e.$$.fragment,h),L(o.$$.fragment,h),a=!1},d(h){h&&S(t),Z(e),Z(o)}}}function Nh(i){let t,e,n=i[1]&&ys(i);return{c(){n&&n.c(),t=me()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&I(n,1)):(n=ys(o),n.c(),I(n,1),n.m(t.parentNode,t)):n&&(se(),L(n,1,1,()=>{n=null}),re())},i(o){e||(I(n),e=!0)},o(o){L(n),e=!1},d(o){n&&n.d(o),o&&S(t)}}}function Xh(i,t,e){var b,w;let{five:n}=t,{visible:o}=t,{hoverEnable:s}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,c=0,u=(w=(b=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:b.floorIndex)!=null?w:0,d=0,h=0,m=0,A=0;function v(P){e(10,u=n.work.observers[P].floorIndex)}Ue(()=>(n.on("panoArrived",v),()=>{n.off("panoArrived",v)}));const p=P=>{e(6,d=P.detail)},g=P=>{e(7,h=P.detail)};return i.$$set=P=>{"five"in P&&e(0,n=P.five),"visible"in P&&e(1,o=P.visible),"hoverEnable"in P&&e(2,s=P.hoverEnable),"floorplanData"in P&&e(3,r=P.floorplanData),"cameraImageUrl"in P&&e(4,a=P.cameraImageUrl),"extraObjects"in P&&e(5,l=P.extraObjects)},i.$$.update=()=>{if(i.$$.dirty&456){const P=Math.min(d,h),{max:x,min:C}=r.bounding,D=x.x-C.x,E=x.y-C.y,O=function(){return D>E?[P,P/D*E]:[P/E*D,P]}();e(8,m=O[0]),e(11,A=O[1]),e(9,c=m/D)}},[n,o,s,r,a,l,d,h,m,c,u,A,p,g]}class Yh extends oe{constructor(t){super(),ie(this,t,Xh,Nh,ne,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5},Wh)}}class Uh extends zt{constructor(e,n){super(e);f(this,"name","panoFloorplanRadarPlugin");f(this,"state");f(this,"data");f(this,"app");f(this,"wrapperSelector","");f(this,"wrapper",null);f(this,"disposed",!1);f(this,"extraObjects",[]);f(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});f(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=Q(Q({},o),s);this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}load(e,n,o=!0){return W(this,null,function*(){function s(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=s(r)?r.data:r,l=this.data;this.data=yield bt(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,o),this.render()})}show(){return W(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return W(this,arguments,function*(e={}){if(!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,n=!0){this.setState({config:e},{userAction:n}),this.render()}setExtraObjectsWith3DPositions(e){!this.data||(this.extraObjects=bh(e,this.five,this.data),this.render())}formatData(e){return W(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=Q(Q({},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=fe(Q({},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 Yh({target:this.wrapper,props:e})}}const qh=(i,t)=>new Uh(i,t),Jh=[{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"}],Zh=[{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"}],Kh=[{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"}],zi=(i,t,e)=>{const n=new k.Matrix4,o=new k.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},$h=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[o,s,r]=e;o&&i.applyMatrix4(zi(o,0,0)),s&&i.applyMatrix4(zi(0,s,0)),r&&i.applyMatrix4(zi(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function el(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s=Q({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 ef=(i,t)=>{var u;const e=t.fbx_url||"//vrlab-static.ljcdn.com/release/web/v3/dipan3/dipan.FBX",n=(u=t.north_rad)!=null?u:void 0,o={},s=d=>W(exports,null,function*(){var H;const h=(d==null?void 0:d.fbx_url)||e,m=(H=d==null?void 0:d.north_rad)!=null?H:n;if(typeof m!="number")throw new Error('"northRad"\u914D\u7F6E\u53C2\u6570\u7F3A\u5931\uFF1A\u672A\u914D\u7F6E\u6307\u5357\u9488\u6307\u5411\uFF01');const A=i.model.bounding,v=A.max.x-A.min.x,p=A.max.z-A.min.z,g=Math.max(v,p),w=yield new pa.FBXLoader().loadAsync(h);el(w,{transparent:!0,side:k.DoubleSide,blending:k.AdditiveBlending});const P=[0,m-Math.PI/2,0],{model:{bounding:{max:{x,z:C},min:{x:D,y:E,z:O}}}}=i;o.yBase=E;const G={x:(x+D)/2,y:E-1.6,z:(C+O)/2},X=.0045*g;return $h(w,{position:G,rotation:P,scale:X}),o.object=w,!0}),r=({latitude:d})=>{if(!o.object)return;const h=a(d);h&&(o.object.position.y=h)},a=d=>{if(o.yBase===void 0)return;const h=.6;if(d>=Math.PI/4)return o.yBase-(h+1.6);const m=d*(4/Math.PI);return o.yBase-(h*m+1.6)};return{load:s,disable:()=>{!o.object||(i.scene.remove(o.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!o.object)return;const d=a(i.getPose().latitude);d&&(o.object.position.y=d),i.scene.add(o.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function tf(i,t){var c,u,d,h,m;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(u=t==null?void 0:t.fontSize)!=null?u:e*(35/256)*1.2,o=(d=t==null?void 0:t.backgroundColor)!=null?d:"rgba(0,0,0,0)",s=(h=t==null?void 0:t.fontColor)!=null?h:"#fff",r=(m=t==null?void 0:t.textAlign)!=null?m:"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 nf=({x:i,y:t,z:e})=>new V.Vector3(i,t,e),of=(i,t)=>{var v,p,g;const e={},n=(v=t.animationEnabled)!=null?v:!0,o=(p=t.position)!=null?p:void 0,s=(g=t.rad)!=null?g:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=b=>W(exports,null,function*(){var G,X,H,B,F,R,N,_;const w=(G=b==null?void 0:b.position)!=null?G:o;if(!w)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const P=nf(w),x=(X=b==null?void 0:b.rad)!=null?X:s,C=(H=b==null?void 0:b.fbx_url)!=null?H:r;if(e.rad=x,x===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${x}`));const D=yield new pa.FBXLoader().loadAsync(C);D.position.copy(P),D.rotation.z=x,D.scale.set(.8,.8,.8),el(D,{transparent:!0,side:k.DoubleSide});const E=(N=(R=(F=(B=D.children)==null?void 0:B[0])==null?void 0:F.children)==null?void 0:R[3])==null?void 0:N.clone();if(!E)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${E}`));const O=(_=t.name)!=null?_:"\u5165\u6237\u95E8";return E.material=new V.MeshBasicMaterial({transparent:!0,map:tf(O)}),E.renderOrder=3,D.children[0].add(E),e.object=D,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const b=1,w=new V.AnimationMixer(e.object);a.push(w);const P=w.clipAction(e.object.animations[0]);P.timeScale=b;let x;const C=()=>{let G=0,X=0;const H=1e3/30,B=F=>{G=requestAnimationFrame(B);const R=F-X;R<H||(X=F,a.forEach(N=>N.update(R/1e3)),i.needsRender=!0)};return G=requestAnimationFrame(B),()=>{cancelAnimationFrame(G)}},O={play:()=>{x||(P.play(),x=C(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{P.stop(),x==null||x(),x=void 0}};e.animation=O},u=b=>{var P;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((P=b==null?void 0:b.animationEnable)!=null?P:n)&&(e.animation||c(),e.animation.play()),i.scene.add(e.object),i.needsRender=!0},d=()=>{!e.object||(e.animation&&e.animation.stop(),i.scene.remove(e.object),i.needsRender=!0)},h=b=>b==="Floorplan"?u():d();return{load:l,enable:b=>(e.enabled||(e.enabled=!0,h(i.currentMode),i.on("modeChange",h),u(b)),!0),disable:()=>(e.enabled&&(e.enabled=!1,d(),i.off("modeChange",h)),!0)}};class yo extends bn.default.Tween{constructor(){super(...arguments);f(this,"disposeMethods",[]);f(this,"animationFrameDisposer");f(this,"onDispose",e=>(this.disposeMethods.push(e),this));f(this,"play",()=>(this.start(0),this.animationFrameDisposer=kn(e=>this.update(e)),this));f(this,"dispose",()=>{var e;this.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this.disposeMethods.forEach(n=>n()),this.disposeMethods=[],bn.default.remove(this)})}}function tl(i,t=bn.default.Easing.Linear.None){const e=new yo({progress:0}).to({progress:1});return i!==void 0&&e.duration(i),t!==void 0&&e.easing(t),e}const Cn=window.requestAnimationFrame||(i=>setTimeout(i,16)),sf=window.cancelAnimationFrame||clearTimeout;function bi(i,t=0){t<=0?Cn(i):Cn(()=>bi(i,t-1))}function kn(i,t=60){let e=-1,n=0,o=-1;const s=1e3/t;function r(a){o===-1&&(o=a),e=Cn(r),!(a-n<s)&&(n=a,i&&i(a-o))}return e=Cn(r),function(){sf(e)}}function rf(){const i=Date.now();return new Promise(t=>{Cn(()=>{t(Date.now()-i)})})}const af=di.Easing;function lf(i,t,e,n=af.Linear.None){const o=new di.Tween(i).to(t,e).easing(n);bi(()=>o.start(0));const s=kn(a=>{o.update(a)===!1&&s()}),r=[];return o.onDestroy=a=>(r.push(a),o),o.destroy=function(){this.stop(),Object.assign(o,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();s()},o}function cf(i,t){return lf({progress:0},{progress:1},i,t)}var nl=(i=>(i.Move="Move",i.Rotate="Rotate",i))(nl||{}),$e=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))($e||{});const Jn=Math.PI*2;function Cs(i){return(i%Jn+Jn)%Jn}function Es(i){return i%Jn}function Bi(i,t,e){return i+(t-i)*e}const $i=(i,t,e)=>{const n=Math.PI,o=n*2;return i=Cs(i),t=Cs(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}},uf=i=>{const t={},e=(l,c,...u)=>W(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((d,h)=>{const m=s.panoIndex!==void 0?s.panoIndex:i.panoIndex;m!==void 0?i.moveToPano(m,Object.assign({duration:r,moveEndCallback:()=>d(!0),moveCancelCallback:()=>h(!1)},s)):h(!1)})}),n=s=>{const r=i.state,a=Es(r.latitude),l=Es(s.latitude),{from:c,to:u}=$i(r.longitude,s.longitude,s.rotation||$e.Loop),d=r.fov,h=s.fov;return{from:{latitude:a,longitude:c,fov:d},to:{latitude:l,longitude:u,fov:h}}};return{move:e,rotate:(l,c,...u)=>W(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((m,A)=>{if(!s.panoIndex){m(!0);return}i.moveToPano(s.panoIndex,{moveEndCallback:()=>m(!0),moveCancelCallback:()=>A(!1)})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:d,to:h}=n(s);return yield new Promise(m=>{const A=({progress:w})=>{const P={};P.longitude=Bi(d.longitude,h.longitude,w),P.latitude=Bi(d.latitude,h.latitude,w),P.fov=Bi(d.fov,h.fov,w),i.setState(P,!0)},v=()=>{m(!0)},p=()=>{m(!1)},g=s.rotateSpeed?Math.ceil(Math.abs(h.longitude-d.longitude)/s.rotateSpeed*1e3):r,b=cf(g,di.Easing.Linear.None).onUpdate(A).onComplete(v).onDestroy(p);s.rotation===$e.Loop&&b.repeat(1/0).yoyo(!0),t.interruptCallback=(w=!0)=>{b.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),m(w)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function Ps(i,t){return i.x===t.x&&i.y===t.y}function il(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function ui(i,t){return(t.y-i.y)/(t.x-i.x)}function ol(i,t,e){const n=ui(i[1],i[0]),o=ui(t[1],t[0]);if(isNaN(n)||isNaN(o)||il(n,o))return!1;if(On(i[0],t))return i[0];if(On(i[1],t))return i[1];if(On(t[0],i))return t[0];if(On(t[1],i))return t[1];if(e&&!df(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 On(i,t){return Ps(i,t[0])||Ps(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&&il(ui(t[0],i),ui(i,t[1]))}function Rn(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function df(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)&&Rn(t[0],i[1],i[0])*Rn(i[1],t[1],i[0])>0&&Rn(i[0],t[1],t[0])*Rn(t[1],i[1],t[0])>0?1:0}function sl(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>sl(i,t-1))}const hf=`<style type="text/css">
|
|
116
116
|
.PanoRulerPlugin-rule-line {
|
|
117
117
|
position: absolute;
|
|
118
118
|
transform-origin: left center;
|