@realsee/dnalogel 2.2.1 → 2.2.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 +11 -11
- package/dist/index.js +804 -803
- package/dist/index.umd.js +13 -13
- package/docs/classes/CruisePluginController.html +24 -24
- package/docs/classes/Magnifier.html +16 -16
- package/docs/classes/ModelRoomLabelController.html +11 -11
- package/docs/classes/Object3DHelperController.html +24 -24
- package/docs/classes/PaintBrush.html +15 -15
- package/docs/classes/PanoTagPluginController.html +39 -39
- 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 +12 -12
- 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/LinkType.html +7 -7
- 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/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/CSS3DRenderPluginEventMap.html +11 -11
- package/docs/interfaces/CSS3DRenderPluginState.html +8 -8
- package/docs/interfaces/CameraMovementPluginExportType.html +7 -7
- package/docs/interfaces/ContentTypeMap.html +12 -12
- 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/ItemLabelPluginData.html +6 -6
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +11 -11
- package/docs/interfaces/ItemLabelPluginParametersType.html +9 -9
- package/docs/interfaces/LineJson.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 +8 -8
- package/docs/interfaces/Object3DHelperState.html +8 -8
- package/docs/interfaces/OpenParameter.html +7 -7
- 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 +11 -11
- 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/Point.html +8 -8
- package/docs/interfaces/PointJson.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/TagConfig.html +10 -10
- package/docs/interfaces/Tags.html +9 -9
- package/docs/interfaces/Util.MagnifierParameter.html +11 -11
- package/docs/interfaces/Util.MouseGroupParameter.html +8 -8
- package/docs/modules/Util.html +5 -5
- package/docs/modules.html +4 -4
- package/docs/types/ArrayPosition.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/Color.html +5 -5
- package/docs/types/ContentTypeConfigKey.html +5 -5
- package/docs/types/ContentTypeConfigKeyArray.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/MapviewFloorplanPluginParameterType.html +5 -5
- package/docs/types/MapviewFloorplanPluginReturnType.html +5 -5
- package/docs/types/MediaData.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/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/PlaneTag.html +5 -5
- package/docs/types/PointTag.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/Tag.html +5 -5
- package/docs/types/Tag2D.html +5 -5
- package/docs/types/Tag3D.html +5 -5
- package/docs/types/TagId.html +5 -5
- package/docs/types/TopviewFloorplanPluginParameterType.html +5 -5
- package/docs/types/TopviewFloorplanPluginReturnType.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/PanoDoorLabelPlugin/Controller.js +117 -116
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -98,7 +98,7 @@ transition: all 500ms;
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
</style>
|
|
101
|
-
`;class Mr extends _r{constructor(e){super();m(this,"configs");m(this,"clientWidth");m(this,"clientHeight");m(this,"ready",!1);m(this,"uuid",ue());m(this,"tween");m(this,"tweening",!1);m(this,"container");m(this,"canvas");m(this,"data",{});m(this,"tempLine",{});this.configs=e,this.clientWidth=document.body.clientWidth,this.clientHeight=document.body.clientHeight,this.container=this.ifInsertToDOM(),this.canvas={},this.initCtrl()}get color(){return this.configs.currentColor}get state(){return this.data}get dpr(){return this.configs.DPR||1}ifInsertToDOM(){if(this.container)return this.container;if(this.configs.container)this.configs.container.id="_gl_paintBrush",this.container=this.configs.container;else if(document.getElementById("_gl_paintBrush"))this.container=document.getElementById("_gl_paintBrush");else{const e=document.createElement("div");e.id="_gl_paintBrush",document.body.appendChild(e),this.container=e}return this.container.innerHTML=zr,this.container}initCanvas(e){const n=document.createElement("canvas");n.className=e,n.width=this.clientWidth,n.height=this.clientHeight;const s=n.getContext("2d");if(!!s)return s.lineWidth=5*this.dpr,s.lineCap="round",s.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 s=document.createElement("a");s.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--undo",s.addEventListener("click",l=>{var h;if(l.stopPropagation(),this.configs.onClickUndo&&this.configs.onClickUndo(),!this.canvas[this.uuid]||!this.data[this.uuid]||this.data[this.uuid].length===0)return;const c=this.data[this.uuid].pop();c&&this.emitStateChange({type:ke.Undo,color:this.color,ready:this.ready,state:c,uuid:this.uuid});const d=(h=this.canvas[this.uuid])==null?void 0:h.getContext("2d");if(!this.canvas[this.uuid])return;const{width:u,height:f}=this.canvas[this.uuid];d&&d.clearRect(0,0,u,f),this.data[this.uuid].forEach(p=>this.handleDrawLine(this.uuid,p,{withUndo:!0}))});const r=document.createElement("a");return r.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--close",r.addEventListener("click",l=>{l.stopPropagation(),this.closeBrush(),this.configs.onClickClose&&this.configs.onClickClose()}),[s,r].forEach(l=>{const c=document.createElement("i");c.className="brush-icon";const d=document.createElement("span");d.className="brush-txt",d.innerText=l.className.endsWith("undo")?this.configs.onUndoText:this.configs.onExitText,l.appendChild(c),l.appendChild(d)}),n.appendChild(s),n.appendChild(r),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:ke.Exit,color:this.color,ready:!1,uuid:this.uuid}))}updateCurrentColor(e){const n=this.canvas[this.uuid];if(!n)return;const s=n.getContext("2d");!s||(this.configs.currentColor=e,s.strokeStyle=e)}openBrushHandle(){const e=this.canvas[this.uuid];if(!e)return;const n=e.getContext("2d");if(!n)return;const s=this.color||"#6D92FF";n.strokeStyle=s;let r=null,a=[],l,c=[],d=0;const u=(f,h,p)=>{const g=this.color||"#ff0000";n.strokeStyle=g,n.beginPath(),n.moveTo(f.x,f.y),n.quadraticCurveTo(h.x,h.y,p.x,p.y),n.stroke()};e.onmousedown=f=>{f.preventDefault(),d=Date.now();const h=f.clientX,p=f.clientY;a=[],a.push({x:h,y:p}),r={x:h,y:p},l=mt({x:h,y:p},this.clientWidth,this.clientHeight),c=[]},e.onmousemove=f=>{if(f.preventDefault(),!r)return;const h=Number(f.clientX),p=Number(f.clientY);if(Math.abs(h-r.x)<5&&Math.abs(p-r.y)<5||(a.push({x:h,y:p}),c.push(mt({x:h,y:p},this.clientWidth,this.clientHeight)),a.length<3))return;const{control:g,end:A}=pt(a);!g||!A||(u(r,g,A),r=A)},e.onmouseup=f=>{if(f.preventDefault(),r=null,a.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const h=Date.now()-d,p={move:Object.assign({},l),uuid:this.uuid,line:[...c],color:this.color,duration:h<1280?h:h<2e3?1280:0};this.data[this.uuid].push(p),Lt(()=>{this.emitStateChange({type:ke.Drawline,color:this.color,ready:this.ready,state:p,uuid:this.uuid})})},e.ontouchstart=f=>{f.preventDefault(),d=Date.now();const h=f.touches[0].clientX,p=f.touches[0].clientY;a=[],a.push({x:h,y:p}),r={x:h,y:p},console.log("ontouchstart",h,p,r),l=mt({x:h,y:p},this.clientWidth,this.clientHeight),c=[]},e.ontouchmove=f=>{if(f.preventDefault(),!r)return;const h=Number(f.touches[0].clientX),p=Number(f.touches[0].clientY);if(Math.abs(h-r.x)<5&&Math.abs(p-r.y)<5||(a.push({x:h,y:p}),c.push(mt({x:h,y:p},this.clientWidth,this.clientHeight)),a.length<3))return;const{control:g,end:A}=pt(a);!g||!A||(u(r,g,A),r=A)},e.ontouchend=e.ontouchcancel=f=>{if(f.preventDefault(),r=null,a.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const h=Date.now()-d,p={move:Object.assign({},l),line:[...c],uuid:this.uuid,color:this.color,duration:h<1280?h:h<2e3?1280:0};this.data[this.uuid].push(p),Lt(()=>{this.emitStateChange({type:ke.Drawline,color:this.color,ready:this.ready,state:p,uuid:this.uuid})})}}emitStateChange(e,n=!0){if(e.type!==ke.Drawline){this.emit("stateChange",e,n);return}const s=Date.now(),r=e.state;if(!r||!r.line)return;const a=Math.ceil(r.line.length/100);for(let l=0;l<a;l++){const c={uuid:this.uuid,color:this.color,ready:this.ready,type:e.type,state:{uuid:this.uuid,move:r.move,duration:r.duration,color:this.color,line:r.line.slice(l*100,(l+1)*100)},timestamp:s,end:l===a-1};xr(l,20,()=>{this.emit("stateChange",c,n)})}}action(e){const{ready:n,type:s,uuid:r}=e;if(!n&&this.ready){this.closeBrush();return}if(n&&!this.ready){this.openBrush();return}if(!!this.ready)switch(s){case ke.Drawline:const{state:a,timestamp:l,end:c}=e;if(!l||!a)return;this.tempLine[l]=[].concat(this.tempLine[l]||[],a.line),c&&(Object.assign(a,{line:this.tempLine[l]}),this.handleDrawLine(r,a,{},()=>delete this.tempLine[l]));break;case ke.Undo:this.handleUndo(r);break}}handleDrawLine(e,n,{withUndo:s=!1},r=hs){!n||Object.prototype.toString.call(n)!="[object Object]"||Object.keys(n).length===0||(console.log("handleDrawLine",n,n.line),kr(()=>new Promise(a=>{if(s||(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 l=this.canvas[e].getContext("2d");if(!l)return;const{line:c=[],color:d="black",duration:u=0,uuid:f}=n,h=Kt(n.move||{},this.clientWidth,this.clientHeight);let p=[h];if(l.strokeStyle=d,l.beginPath(),l.moveTo(h.x,h.y),u&&!s){let g=[];const A=this;A.tween=Sr({step:0},{step:c.length-1},u).onUpdate(({step:b})=>{var w;if(A.tweening=!0,!A.ready)return l.clearRect(0,0,A.canvas[f].width,A.canvas[f].height),(w=A.tween)==null?void 0:w.stop();const v=Math.floor(b);if(!g.find(y=>y===v)){if(g.push(v),console.log("__debug__",c,c[v],v),p.push(Kt(c[v],A.clientWidth,A.clientHeight)),p.length<3)return;const{control:y,end:I}=pt(p);if(!y||!I)return;l.quadraticCurveTo(y.x,y.y,I.x,I.y),l.stroke()}}).onComplete(b=>{A.tween=void 0,A.tweening=!1,g=[],p=[],r&&r(),a()})}else{for(let g=0;g<c.length;g++){if(p.push(Kt(c[g],this.clientWidth,this.clientHeight)),p.length<3)continue;const{control:A,end:b}=pt(p);!A||!b||l.quadraticCurveTo(A.x,A.y,b.x,b.y)}l.stroke(),p=[],r&&r(),a()}})))}handleUndo(e){if(console.log("handleUndo",e,this.canvas[e]),!this.canvas[e]||!this.data[e]||this.data[e].length===0)return;this.data[e].pop();const n=()=>{var r;const s=(r=this.canvas[e])==null?void 0:r.getContext("2d");s&&s.clearRect(0,0,this.canvas[e].width,this.canvas[e].height),this.data[e].forEach(a=>this.handleDrawLine(e,a,{withUndo:!0}))};if(this.tween&&this.tweening){this.tween.stop(),Lt(n,60);return}n()}destroyBrush(){this.closeBrush(),this.ready=!1,this.emit("readyChange",!0)}}class Tr{constructor(t={}){m(this,"controller");const e=Object.assign({currentColor:"#f44336",onUndoText:"\u56DE\u9000",onExitText:"\u5173\u95ED"},t);this.controller=new Mr(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 jr=(o,t)=>{let e=!0,n=null;const r=j(j({},{lookAtCurrentCamera:!1,lockedPanoIndex:null,lockedLatitude:null,lockedLongitude:null}),t==null?void 0:t.config),a=new P.Scene,l=new ee.Camera(60);let c=new P.Object3D,d,u;{const C=new P.DirectionalLight(16777215,.5);C.position.copy(new P.Vector3(1,1,1)),a.add(C)}{const C=new P.DirectionalLight(16777215,.3);a.add(C)}{const C=new P.AmbientLight(16777215,.3);a.add(C)}a.add(c);const f=()=>{if(!!o.renderer)return n||(n=new P.WebGLRenderer({antialias:!1,alpha:!0}),n.setPixelRatio(o.renderer.getPixelRatio()),n.outputEncoding=P.sRGBEncoding,n.setClearColor(1579548,0),n.autoClear=!0),n},h=()=>{c.traverse(C=>{C instanceof P.Mesh&&[].concat(C.material).forEach(x=>x.dispose())}),a.remove(c),c=new P.Object3D,a.add(c),w()},p=()=>{d=b(o.model,l.fov,l.aspect),u=o.model.bounding.getCenter(new P.Vector3);function C(x){const z=x.clone();return z.uniforms.modelAlpha.value=1,z.uniforms.map.value&&(z.uniforms.map.value.needsUpdate=!0),z}function D(x){if(x instanceof P.Mesh){const z=x.geometry,_=Array.isArray(x.material)?x.material.map(C):C(x.material);return new P.Mesh(z,_)}else if(x instanceof P.Group){const z=new P.Group;return x.children.forEach(_=>z.add(D(_))),z}else{const z=new P.Object3D;return x.children.forEach(_=>z.add(D(_))),z}}a.remove(c),c=D(o.model),a.add(c),w()},g=(C,D={})=>{const x=f();if(!x)return;C.appendChild(x.domElement),A(D);const z=window.getComputedStyle(C).position;z!=="relative"&&z!=="absolute"&&z!=="fixed"&&z!=="sticky"&&(C.style.position="relative")},A=(C={})=>{if(!n)return;const x=n.domElement.parentNode;if(x!=null&&x.nodeName){const{width:z=x.offsetWidth,height:_=x.offsetHeight}=C;n.setSize(z,_),l.aspect=z/_,l.updateProjectionMatrix()}w()};function b(C,D,x){const z=C.bounding,_=Math.pow(Math.pow(z.max.x-z.min.x+1,2)+Math.pow(z.max.y-z.min.y+1,2)+Math.pow(z.max.z-z.min.z+1,2),1/2);let T=_/2/Math.tan(Math.PI*D/360);return x<1&&(T=T/x),isNaN(T)?_:T}function v(C){return o.work.observers[C].standingPosition.clone()}const w=()=>{if(!d||!u)return;const C=o.getPose();C.fov=l.fov,C.offset=u,C.distance=d,typeof r.lockedLatitude=="number"&&(C.latitude=r.lockedLatitude),typeof r.lockedLongitude=="number"&&(C.longitude=r.lockedLongitude),typeof r.lockedPanoIndex=="number"&&(C.offset=v(r.lockedPanoIndex)),r.lookAtCurrentCamera&&(C.offset=o.camera.position.clone().setY(o.camera.position.y+1)),l.setFromPose(C),e=!0},y=()=>{e!==!0||!n||!n.domElement.parentNode||n.domElement.parentNode.offsetWidth===0||(n.render(a,l),e=!1)},I=()=>{n&&n.dispose(),n=null},k=C=>{Object.assign(r,C),w()};return Object.assign(window,{camera:l}),o.on("modelLoaded",p),o.on("modelWillLoad",h),o.on("cameraDirectionUpdate",w),o.on("dispose",I),o.on("renderFrame",y),o.on("cameraPositionUpdate",w),{appendTo:g,refresh:A,changeConfigs:k}};function Br(o){return typeof Symbol=="undefined"?`$Symbol<${o}>$`:Symbol(o)}const at=Br("$$EVENT$$");function At(o){return o[at]||(o[at]={}),o[at]}function Qr(o){o[at]||delete o[at]}class ht{hasListener(t){const e=At(this);return Boolean((e==null?void 0:e[t])&&e[t].length>0)}on(t,e,n){const s=At(this);return s[t]||(s[t]=[]),s[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){Qr(this);return}const n=At(this);if(n[t]||(n[t]=[]),e===void 0){n[t].length=0;return}let s=0;for(;s<n[t].length&&n[t][s][0]!==e;s++);s<n[t].length&&n[t].splice(s,1)}emit(t,...e){let n=!1;const r=At(this)[t]||[];for(let a of r.slice()){const[l,c=!1]=a,d=l(...e);c&&this.off(t,l),d===!1&&(n=!0)}return n}}function fs(...o){const t=new M.Vector3;return o.forEach(e=>{t.add(e)}),t.divideScalar(o.length),t}function Tt(o,t){const e=Math.round(o);return e%2===0?e:e+Number(t!=null&&t.smaller?-1:1)}const Rr=({x:o,y:t,z:e})=>new M.Vector3(o,t,e),De=([o,t,e])=>new M.Vector3(o,t,e),ct=o=>o instanceof M.Vector3?o:Array.isArray(o)?De(o):Rr(o),ms="1.0.2",Or=`CSS3DObjectPlus@${ms}`,Hr=.00216,Fr=.003;class ps extends Mt.CSS3DObject{constructor(e,n,s=Fr,r=1,a="front"){const l=Math.max(Hr,s),c=n[0].distanceTo(n[1]),d=n[1].distanceTo(n[2]),u=Tt(c/s*r),f=Tt(d/s*r),h=fs(...n);let p;if(l===s)e.style.width=`${u}px`,e.style.height=`${f}px`,p=e;else{const I=document.createElement("div");I.style.width=`${u}px`,I.style.height=`${f}px`,I.style.pointerEvents="none";const k=s/l;e.style.position="absolute",e.style.left="0",e.style.top="0",e.style.width=`${k*u}px`,e.style.height=`${k*f}px`,I.appendChild(e),p=I}super(p);m(this,"version",ms);m(this,"width");m(this,"height");m(this,"domWidthPx");m(this,"domHeightPx");m(this,"cornerPoints");m(this,"ratio");m(this,"container");m(this,"centerPosition");m(this,"mode","front");m(this,"hooks",new ht);m(this,"isCSS3DObjectPlus",!0);if(this.scale.set(l,l,l),this.cornerPoints=n,this.ratio=s,this.container=e,this.mode=a,l===s)this.width=c,this.height=d,this.domWidthPx=u,this.domHeightPx=f,this.centerPosition=h;else{const I=s/l;this.width=I*c,this.height=I*d,this.domWidthPx=I*u,this.domHeightPx=I*f,this.centerPosition=new M.Vector3().subVectors(h,n[0]).multiplyScalar(I).add(n[0])}e.classList.add(`${Or}__container`);const g=new M.Vector3().subVectors(n[1],n[0]),A=new M.Vector3().subVectors(n[3],n[0]),b=new M.Vector3().crossVectors(g,A).normalize();this.lookAt(b);const v=this.up.clone().applyQuaternion(this.quaternion),w=A.clone(),y=new M.Vector3().crossVectors(v,w).normalize();this.rotateOnWorldAxis(y,v.angleTo(w)),this.position.copy(h)}changeMode(e,n){if(e===this.mode)return;const s=this.mode;this.mode=e,this.hooks.emit("changeMode",e,s,n)}applyScaleMatrix4(e){this.scale.applyMatrix4(e),this.hooks.emit("applyScaleMatrix4",e)}applyMatrix4(e){super.applyMatrix4(e),this.hooks.emit("applyMatrix4",e)}applyQuaternion(e){return super.applyQuaternion(e),this.hooks.emit("applyQuaternion",e),this}}const Gr="v2.0.1",gs="CSS3DRenderer",Ge=`${gs}@${Gr}`,Vn=o=>`${Ge}--${o}`,U={};class As{constructor(){m(this,"hooks",new ht);m(this,"state",{enabled:!0,visible:!0,disposed:!1});m(this,"store",{rendered:!1,disposers:[],frontModeCSS3DObjects:{},behindModeCSS3DObjects:{}});m(this,"create3DElement",(t,e,n)=>{if(this.state.disposed)return this.disposedErrorLog();const s=(()=>{const E={ratio:.00216,devicePixelRatio:1,mode:"front",autoRender:!0,container:document.createElement("div"),pointerEvents:"none"};return Object.assign(E,n)})(),r=e.map(ct);if((r==null?void 0:r.length)<4)return console.error(`${Ge}: requires 4 point but params may have fewer`);const{ratio:a,devicePixelRatio:l,mode:c,autoRender:d,container:u,pointerEvents:f}=s,h=[],{css3DObject:p,opacityMesh:g}=this.createObject(r,{ratio:a,dpr:l,container:u,mode:c,pointerEvents:f});u.id=`container--${p.uuid}`;const A=c==="front"&&!U.frontModeStore,b=c==="behind"&&!U.behindModeStore;c==="front"&&this.initGlobalModeStore("front"),c==="behind"&&this.initGlobalModeStore("behind",s.scene),p.hooks.on("changeMode",(E,S,L)=>{var X,Y,J;if(E===S)return;E==="front"&&this.initGlobalModeStore("front"),E==="behind"&&this.initGlobalModeStore("behind",L);const B=S==="front"?U.frontModeStore:U.behindModeStore,R=E==="front"?U.frontModeStore:U.behindModeStore,G=S==="behind"?this.store.behindModeCSS3DObjects:this.store.frontModeCSS3DObjects,Q=E==="behind"?this.store.behindModeCSS3DObjects:this.store.frontModeCSS3DObjects;if(!G||!Q)return console.error(`${Ge}: changeMode error: prevObjects or nextObjects is undefined`);const O=G[p.uuid];if(!O)return console.error(`${Ge}: changeMode error: prevObject is undefined`);if(E==="behind"){const te=(X=O.opacityMesh)!=null?X:this.createOpacityMesh(O.css3DObject);B==null||B.css3DScene.remove(O.css3DObject),Q[p.uuid]={css3DObject:p,opacityMesh:te,visible:!0,enabled:!0,mode:E,scene:L},R==null||R.css3DScene.add(p),L==null||L.add(te)}E==="front"&&(B==null||B.css3DScene.remove(O.css3DObject),(J=(Y=G[p.uuid])==null?void 0:Y.scene)==null||J.remove(O.opacityMesh),Q[p.uuid]={css3DObject:p,visible:!0,enabled:!0,mode:E},R==null||R.css3DScene.add(p)),E==="behind"&&this.appendToElement(U.behindModeContainer,"behind"),E==="front"&&this.appendToElement(U.frontModeContainer,"front"),this.render(t),console.log("change success")});const v=c==="front"?U.frontModeStore:U.behindModeStore,{css3DScene:w,css3DRenderer:y}=v,I=(()=>{const E=()=>{var L,B;const S=p.mode;if(S==="front")this.store.frontModeCSS3DObjects[p.uuid]={visible:!0,enabled:!0,css3DObject:p,mode:"front"};else{if(!s.scene)return;this.store.behindModeCSS3DObjects[p.uuid]={visible:!0,enabled:!0,css3DObject:p,opacityMesh:g,mode:"behind",scene:s.scene}}w.getObjectById(p.id)||w.add(p),S==="behind"&&g&&((L=s.scene)!=null&&L.getObjectById(g.id)||(B=s.scene)==null||B.add(g),h.push(()=>{var R;return g&&((R=s.scene)==null?void 0:R.remove(g))}))};return A||b?(y.domElement.style.position="absolute",y.domElement.style.top="0",y.domElement.style.userSelect="none",y.domElement.style.pointerEvents="none",y.domElement.classList.add(Vn(c)),()=>{E(),this.render(t)}):(this.store.rendered=!0,()=>E())})(),k=c==="front"?U.frontModeContainer:U.behindModeContainer;if(k){this.appendToElement(k,c);const E=c==="front"?U.frontModeStore:U.behindModeStore;E&&(E.appendedToPage=!0)}const C=E=>this.setVisibleById(p.uuid,E),D=E=>this.setEnabledById(p.uuid,E),x=()=>C(!0),z=()=>C(!1),_=()=>D(!0),T=()=>D(!1),H=()=>(delete this.store.frontModeCSS3DObjects[p.uuid],delete this.store.behindModeCSS3DObjects[p.uuid],h.forEach(E=>E==null?void 0:E()),w.remove(p),w.children.length===0&&(typeof v.requestAnimationFrameId=="number"&&cancelAnimationFrame(v.requestAnimationFrameId),y.domElement.remove(),c==="front"&&(U.frontModeStore=void 0),c==="behind"&&(U.behindModeStore=void 0),U.frontModeResizeObserver=void 0,U.behindModeResizeObserver=void 0),!0);return this.store.disposers.push(H),d&&I(),{id:p.uuid,container:u,dispose:H,css3DObject:p,render:d?void 0:I,show:x,hide:z,setVisible:C,disable:T,enable:_,setEnabled:D,appendToElement:E=>this.appendToElement(E,c)}});m(this,"setVisibleById",(t,e)=>{var s;const n=(s=this.store.frontModeCSS3DObjects[t])!=null?s:this.store.behindModeCSS3DObjects[t];if(!n)return console.error("id not found",t);n.visible=e,this.state.visible&&(n.css3DObject.visible=e,n.mode==="behind"&&(n.opacityMesh.visible=e))});m(this,"setEnabledById",(t,e)=>{var r,a,l;const n=(r=this.store.frontModeCSS3DObjects[t])!=null?r:this.store.behindModeCSS3DObjects[t];if(!n)return;const s=n.mode==="front"?(a=U.frontModeStore)==null?void 0:a.css3DScene:(l=U.behindModeStore)==null?void 0:l.css3DScene;!s||(e?(s.add(n.css3DObject),n.mode==="behind"&&n.scene.add(n.opacityMesh)):(s.remove(n.css3DObject),n.mode==="behind"&&n.scene.remove(n.opacityMesh)),n.enabled=e)});m(this,"createObject",(t,e)=>{const{ratio:n,dpr:s,container:r,mode:a,pointerEvents:l}=e,c=new ps(r,t,n,s,a);r.style.pointerEvents=l,r.classList.add(`${gs}__container`);const d=a==="behind"?this.createOpacityMesh(c):void 0;return{css3DObject:c,opacityMesh:d}});m(this,"createOpacityMesh",t=>{const{domWidthPx:e,domHeightPx:n}=t,s=new P.MeshBasicMaterial({opacity:0,color:0,transparent:!1,side:P.DoubleSide}),r=new P.PlaneGeometry(e,n),a=new P.Mesh(r,s);return a.name=Vn("mesh"),a.position.copy(t.position),a.rotation.copy(t.rotation),a.scale.copy(t.scale),t.hooks.on("applyMatrix4",l=>a.applyMatrix4(l)),t.hooks.on("applyQuaternion",l=>a.applyQuaternion(l)),t.hooks.on("applyScaleMatrix4",l=>a.scale.applyMatrix4(l)),a});m(this,"createResizeObserver",(t,e,n=!0)=>{if(!t)return console.error("createResizeObserver: element is undefined"),{observe:()=>{},unobserve:()=>{}};const s=()=>{const a=Tt(t.clientWidth,{smaller:!0}),l=Tt(t.clientHeight,{smaller:!0});e(a,l)};if(typeof ResizeObserver=="undefined"||!ResizeObserver)return console.warn("createResizeObserver: ResizeObserver is undefined"),{observe:()=>s(),unobserve:()=>{}};const r=new ResizeObserver(s);return n&&s(),{observe:()=>r.observe(t),unobserve:()=>r.unobserve(t)}});m(this,"disposedErrorLog",()=>{console.error(`${Ge} is disposed`)})}getCurrentState(){return this.state}setState(t,e={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();const n=j({},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()),this.hooks.emit("stateChange",{state:this.state,prevState:n,userAction:e.userAction})}dispose(){this.store.disposers.forEach(t=>t==null?void 0:t()),this.store.disposers=[],this.hooks.emit("dispose"),this.state.disposed=!0}show(){return F(this,arguments,function*({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({visible:!0},{userAction:t}),this.hooks.emit("show",{userAction:t})})}hide(){return F(this,arguments,function*({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({visible:!1},{userAction:t}),this.hooks.emit("hide",{userAction:t})})}enable({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({enabled:!0},{userAction:t}),this.hooks.emit("enable",{userAction:t})}disable({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({enabled:!1},{userAction:t}),this.hooks.emit("disable",{userAction:t})}setContainer(t,e){e==="front"?U.frontModeContainer=t:U.behindModeContainer=t}appendToElement(t,e){const n=e==="front"?U.frontModeStore:U.behindModeStore;if(!n){if(e==="front"&&!U.frontModeContainer){if(!t)throw new Error(`${Ge} Cannot append to container: front mode but container is ${t}`);U.frontModeContainer=t}if(e==="behind"&&!U.behindModeContainer){if(!t)throw new Error(`${Ge} Cannot append to container: behind mode but container is ${t}`);U.behindModeContainer=t}return}if(n.appendedToPage)return;const s=e==="behind"?U.behindModeContainer:U.frontModeContainer;if(!s)return console.error("wrapper is undefined");if(s.appendChild(n.css3DRenderer.domElement),e==="behind"&&!U.behindModeResizeObserver){const r=(c,d)=>{var u;(u=U.behindModeStore)==null||u.css3DRenderer.setSize(c,d)},{observe:a,unobserve:l}=this.createResizeObserver(s,r,!0);U.behindModeResizeObserver={observe:a,unobserve:l},a(),this.store.disposers.push(l)}if(e==="front"&&!U.frontModeResizeObserver){const r=(c,d)=>{var u;(u=U.frontModeStore)==null||u.css3DRenderer.setSize(c,d)},{observe:a,unobserve:l}=this.createResizeObserver(s,r,!0);U.frontModeResizeObserver={observe:a,unobserve:l},a(),this.store.disposers.push(l)}n.appendedToPage=!0}render(t){const e=U.behindModeStore,n=U.frontModeStore;if(e&&Object.keys(this.store.behindModeCSS3DObjects).length>0&&!e.requestAnimationFrameId){const s=()=>{const r=requestAnimationFrame(s);e.requestAnimationFrameId=r,e.css3DRenderer.render(e.css3DScene,t)};s()}if(n&&Object.keys(this.store.frontModeCSS3DObjects).length>0&&!n.requestAnimationFrameId){const s=()=>{const r=requestAnimationFrame(s);n.requestAnimationFrameId=r,n.css3DRenderer.render(n.css3DScene,t)};s()}Object.keys(this.store.frontModeCSS3DObjects).length===0&&(n==null?void 0:n.requestAnimationFrameId)!==void 0&&(cancelAnimationFrame(n.requestAnimationFrameId),n.requestAnimationFrameId=void 0),Object.keys(this.store.behindModeCSS3DObjects).length===0&&(e==null?void 0:e.requestAnimationFrameId)!==void 0&&(cancelAnimationFrame(e.requestAnimationFrameId),e.requestAnimationFrameId=void 0)}initGlobalModeStore(t,e){const n=t==="front"&&!U.frontModeStore;t==="behind"&&!U.behindModeStore&&(U.behindModeStore={scene:e,css3DScene:new P.Scene,css3DRenderer:new Mt.CSS3DRenderer}),n&&(U.frontModeStore={css3DScene:new P.Scene,css3DRenderer:new Mt.CSS3DRenderer})}handleShow(){return F(this,null,function*(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=t.visible}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=t.visible,t.opacityMesh.visible=t.visible})})}handleHide(){return F(this,null,function*(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=!1}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=!1,t.opacityMesh.visible=!1})})}handleEnable(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{var e;!t.enabled||(e=U.frontModeStore)==null||e.css3DScene.add(t.css3DObject)}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{var e,n;!t.enabled||((e=U.behindModeStore)==null||e.css3DScene.add(t.css3DObject),(n=U.behindModeStore)==null||n.scene.add(t.opacityMesh))})}handleDisable(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{var e;(e=U.frontModeStore)==null||e.css3DScene.remove(t.css3DObject)}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{var e,n;(e=U.behindModeStore)==null||e.css3DScene.remove(t.css3DObject),(n=U.behindModeStore)==null||n.scene.remove(t.opacityMesh)})}}const Nr="v2.0.1",Jn=`CSS3DRenderPlugin@${Nr}`;class Wr extends As{constructor(e){super();m(this,"five");m(this,"behindFiveContainer");m(this,"staticPrefix","//vrlab-static.ljcdn.com");m(this,"create3DDomContainer",(e,n)=>{if(this.state.disposed)return;const s=(()=>{var g;(n==null?void 0:n.dpr)!==void 0&&console.warn(`${Jn}: please use "config.devicePixelRatio" replace "config.dpr"`);const p={ratio:.00216,devicePixelRatio:(g=n==null?void 0:n.dpr)!=null?g:1,mode:"front",autoRender:!0};return Object.assign(p,n,(n==null?void 0:n.mode)==="behind"?{scene:this.five.scene}:void 0)})(),r=this.five.getElement();if(!r){console.error(`${Jn}: five.getElement() is ${r}`);return}const{autoRender:a,mode:l}=s,c=l==="front"?r.parentElement:s.behindFiveContainer;this.setContainer(c||document.body,"front");const d=this.getBehindFiveElement();d&&this.setContainer(d,"behind"),this.appendToElement(c||document.body,l);const u=this.create3DElement(this.five.camera,e,V(j({},s),{autoRender:!1}));if(!u)return;const f=u.render,h=()=>{var p;l==="front"&&f(),l==="behind"&&((p=this.five.model)!=null&&p.loaded?f():this.five.once("modelLoaded",()=>f()))};return a&&h(),V(j({},u),{render:a?void 0:h})});this.five=e}disposeAll(){return this.dispose()}setState(...e){const n=super.setState(...e);return this.five.needsRender=!0,n}getBehindFiveElement(){var l;const{behindFiveContainer:e}=this;if(e)return e;const n=document.createElement("div");n.style.position="absolute",n.style.pointerEvents="none",n.style.top="0",n.style.left="0",n.style.width="100%",n.style.height="100%",this.behindFiveContainer=n;const s=this.five.getElement();if(!s)return;const r=(l=s==null?void 0:s.style.position)!=null?l:getComputedStyle(s);(!r||r==="static")&&console.warn("if you want to use css3DRenderPlugin behind mode, five element position is static, please set position to relative or absolute");const a=s==null?void 0:s.parentElement;if(a)return a.insertBefore(n,s),n}}const nt=o=>new Wr(o);function $t(o,t,e=new M.Vector3(1,1,1),n=!1){const s=new ls.Line(o,t);return s.setMaterial({dashed:n,color:e,linewidth:1}),s.remove(s.points),s}const Xr=o=>{const t={intersection:null,disposers:[]},e=u=>{t.intersection=u},n=()=>{t.intersection=null};o.on("modelLoaded",()=>{o.on("intersectionOnModelUpdate",e),o.on("intersectionHidden",n)}),o.on("dispose",()=>{o.off("intersectionOnModelUpdate",e),o.off("intersectionHidden",n)});const s=(u,f=2,h=.1)=>{const p=f/2,A=d(u,h),b=new M.Group;b.add($t(new M.Vector3(A.x+p,A.y,A.z),new M.Vector3(A.x-p,A.y,A.z),new M.Vector3(1,0,0)),$t(new M.Vector3(A.x,A.y+p,A.z),new M.Vector3(A.x,A.y-p,A.z),new M.Vector3(0,1,0)),$t(new M.Vector3(A.x,A.y,A.z+p),new M.Vector3(A.x,A.y,A.z-p),new M.Vector3(0,0,1))),o.scene.add(b),o.needsRender=!0;const v=()=>{o.scene.remove(b)};return t.disposers.push(v),{clear:v,pointAxesHelperMesh:b}},r=(u,f=0)=>{var v,w;const h=(v=o==null?void 0:o.camera)==null?void 0:v.position;if(!h)return!1;const p=u.distanceTo(h),g=u.sub(h).normalize(),A=new M.Raycaster(h,g),b=(w=o.model.intersectRaycaster(A))==null?void 0:w[0];return!(b&&b.distance+f<p)},a=()=>t.intersection,l=()=>{var u,f;(f=(u=t.disposers)==null?void 0:u.forEach)==null||f.call(u,h=>h==null?void 0:h()),o.off("intersectionOnModelUpdate",e),o.off("intersectionHidden",n)},c=l,d=(u,f)=>{const h=u.clone();return o.camera.position.clone().sub(h).setLength(f).add(h)};return{intersection:a,pointAxesHelper:s,movePointTowardsCamera:d,destroy:l,dispose:c,canSeePoint:r}},Yr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAA8CAYAAACZ1L+0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAA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XCy8ASOh6IC534Qf126Au6Aq7S+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 Ur(o){i.append_styles(o,"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 Vr(o){let t,e,n=o[0].name+"",s,r,a,l,c;return{c(){t=i.element("div"),e=i.element("span"),s=i.text(n),r=i.space(),a=i.element("div"),i.attr(e,"class","room-label-item__text svelte-1d7uzh5"),i.set_style(e,"background-image","url("+Yr+")"),i.toggle_class(e,"wide",o[0].name.length>3),i.attr(a,"class","room-label-item__bar svelte-1d7uzh5"),i.attr(t,"class","room-label-item svelte-1d7uzh5"),i.set_style(t,"z-index",o[0].zIndex,!1),i.set_style(t,"transform",o[0].transform,!1),i.set_style(t,"opacity",o[0].visible?1:0,!1)},m(d,u){i.insert(d,t,u),i.append(t,e),i.append(e,s),i.append(t,r),i.append(t,a),l||(c=i.listen(e,"click",o[1]),l=!0)},p(d,[u]){u&1&&n!==(n=d[0].name+"")&&i.set_data(s,n),u&1&&i.toggle_class(e,"wide",d[0].name.length>3),u&1&&i.set_style(t,"z-index",d[0].zIndex,!1),u&1&&i.set_style(t,"transform",d[0].transform,!1),u&1&&i.set_style(t,"opacity",d[0].visible?1:0,!1)},i:i.noop,o:i.noop,d(d){d&&i.detach(t),l=!1,c()}}}function Jr(o,t,e){let{five:n}=t,{roomLabel:s}=t;function r(){n.setState({panoIndex:s.panoIndex,mode:"Panorama",longitude:s.longitude})}return o.$$set=a=>{"five"in a&&e(2,n=a.five),"roomLabel"in a&&e(0,s=a.roomLabel)},[s,r,n]}class Zr extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Jr,Vr,i.safe_not_equal,{five:2,roomLabel:0},Ur)}}const{Map:qr}=i.globals;function Kr(o){i.append_styles(o,"svelte-9eg4zi",".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}")}function Zn(o,t,e){const n=o.slice();return n[12]=t[e],n}function qn(o,t){let e,n,s;return n=new Zr({props:{roomLabel:t[12],five:t[1]}}),{key:o,first:null,c(){e=i.empty(),i.create_component(n.$$.fragment),this.first=e},m(r,a){i.insert(r,e,a),i.mount_component(n,r,a),s=!0},p(r,a){t=r;const l={};a&1&&(l.roomLabel=t[12]),a&2&&(l.five=t[1]),n.$set(l)},i(r){s||(i.transition_in(n.$$.fragment,r),s=!0)},o(r){i.transition_out(n.$$.fragment,r),s=!1},d(r){r&&i.detach(e),i.destroy_component(n,r)}}}function $r(o){let t,e=[],n=new qr,s,r,a=o[0];const l=c=>c[12].id;for(let c=0;c<a.length;c+=1){let d=Zn(o,a,c),u=l(d);n.set(u,e[c]=qn(u,d))}return{c(){t=i.element("div");for(let c=0;c<e.length;c+=1)e[c].c();i.attr(t,"class","room-labels-container svelte-9eg4zi"),i.add_render_callback(()=>o[6].call(t))},m(c,d){i.insert(c,t,d);for(let u=0;u<e.length;u+=1)e[u].m(t,null);s=i.add_resize_listener(t,o[6].bind(t)),r=!0},p(c,[d]){d&3&&(a=c[0],i.group_outros(),e=i.update_keyed_each(e,d,l,1,c,a,n,t,i.outro_and_destroy_block,qn,null,Zn),i.check_outros())},i(c){if(!r){for(let d=0;d<a.length;d+=1)i.transition_in(e[d]);r=!0}},o(c){for(let d=0;d<e.length;d+=1)i.transition_out(e[d]);r=!1},d(c){c&&i.detach(t);for(let d=0;d<e.length;d+=1)e[d].d();s()}}}function ea(o,t,e){var A;let n,{five:s}=t,{roomLabels:r}=t,a,l,c=(A=s.model.shownFloor)!=null?A:null;function d(b){if(!(c===null||b.floorIndex===c))return!1;const w=new M.Raycaster,y=s.camera.position.clone(),I=new M.Vector3(b.position.x,b.position.y,b.position.z),k=I.distanceTo(y);w.set(y.clone(),I.clone().sub(y).normalize());const[C]=s.model.intersectRaycaster(w);return!(C&&C.distance+1<k)}function u(b,v){const y=new M.Vector3(b.position.x,b.position.y,b.position.z).clone().project(s.camera),I=Math.ceil((y.x+1)/2*v.x),k=Math.ceil((-y.y+1)/2*v.y);return`translate(${I}px, ${k}px)`}function f(b){const{rendererSize:v,shownFloor:w}=b,y=new Map;function I(C){const D=y.get(C.id);if(D)return D;const{x,y:z,z:_}=C.position,T=new M.Vector3(x,z,_).clone().distanceTo(s.camera.position);return y.set(C.id,T),T}return r.map(C=>{const D=d(C),x=D?u(C,v):C.transform,z=I(C),T=r.filter(H=>H.visible&&I(H)<z).length*10;return V(j({},C),{visible:D,transform:x,zIndex:T})})}function h(){e(0,r=f({rendererSize:n,shownFloor:c}))}function p(b){e(4,c=b)}s.on("cameraUpdate",h),s.on("modelShownFloorChange",p),Z.onDestroy(()=>{s.off("cameraUpdate",h),s.off("modelShownFloorChange",p)});function g(){a=this.clientWidth,l=this.clientHeight,e(2,a),e(3,l)}return o.$$set=b=>{"five"in b&&e(1,s=b.five),"roomLabels"in b&&e(0,r=b.roomLabels)},o.$$.update=()=>{o.$$.dirty&12&&e(5,n={x:a,y:l}),o.$$.dirty&48&&e(0,r=f({rendererSize:n,shownFloor:c}))},[r,s,a,l,c,n,g]}class ta extends i.SvelteComponent{constructor(t){super(),i.init(this,t,ea,$r,i.safe_not_equal,{five:1,roomLabels:0},Kr)}}function na(o){return o.model_room_labels.map(({id:t,pano_index:e,floor_index:n,name:s,position:r,longitude:a})=>({id:t,name:s,position:r,longitude:a,panoIndex:e,floorIndex:n,zIndex:0,visible:!1,transform:""}))}class ia{constructor(t){m(this,"five");m(this,"enabled",!0);m(this,"fiveModeEnabled");m(this,"app");m(this,"wrapper");m(this,"roomLabels",[]);m(this,"container",document.createElement("div"));m(this,"onFiveModeChange",t=>{if(t!=="Floorplan"){this.fiveModeEnabled=!1,this.render();return}this.five.once("initAnimationEnded",()=>{this.fiveModeEnabled=this.five.currentMode==="Floorplan",this.render()})});this.five=t,this.fiveModeEnabled=this.five.currentMode==="Floorplan",this.container.classList.add("model-room-label-plugin-container"),this.container.style.width="100%",this.container.style.height="100%",this.container.style.position="absolute",this.container.style.pointerEvents="none",this.container.style.left="0",this.container.style.top="0",this.container.style.zIndex="5",this.five.once("dispose",()=>this.dispose()),this.five.on("modeChange",this.onFiveModeChange),this.render()}dispose(){this.five.off("modeChange",this.onFiveModeChange),this.container.remove()}load(t){this.roomLabels=na(t),this.render()}appendTo(t){return this.wrapper=t,t.appendChild(this.container),this.render(),this}disable(){return this.enabled=!1,this.render(),this}enable(){return this.enabled=!0,this.render(),this}render(){var t;if(!!this.wrapper){if(!this.enabled||!this.fiveModeEnabled){(t=this.app)==null||t.$destroy(),this.app=void 0;return}this.app?this.app.$set({five:this.five,roomLabels:this.roomLabels}):this.app=new ta({target:this.container,props:{five:this.five,roomLabels:this.roomLabels}})}}}const oa=o=>new ia(o),sa={name:"ModelRoomLabelPlugin",version:0};var je=(o=>(o[o.FLOOR=1]="FLOOR",o[o.CEILING=2]="CEILING",o[o.BOUNDING_CENTER=3]="BOUNDING_CENTER",o))(je||{});function jt(o){return F(this,null,function*(){try{return[null,yield o]}catch(t){return t instanceof Error?[t,null]:[new Error(""),null]}})}function Bt(o){return Object.prototype.toString.call(o)==="[object Object]"}function Gt(o,t){return o===t?!0:typeof o!=typeof t?!1:!!(Number.isNaN(o)&&Number.isNaN(t))}function ra(o,t){const e=Object.getOwnPropertyNames(o),n=Object.getOwnPropertyNames(t);if(e.length!==n.length)return!1;for(let s=0,r=e.length;s<r;s++){const a=e[s];if(!Gt(o[a],t[a]))return!1}return!0}function aa(o,t){if(o.length!==t.length)return!1;for(let e=0,n=o.length;e<n;e++)if(!Gt(o[e],t[e]))return!1;return!0}function la(o,t){return Gt(o,t)?!0:Bt(o)&&Bt(t)?ra(o,t):Array.isArray(o)&&Array.isArray(t)?aa(o,t):!1}function xn(o,t){return Gt(o,t)?!0:Bt(o)&&Bt(t)?da(o,t):Array.isArray(o)&&Array.isArray(t)?ca(o,t):!1}function ca(o,t){if(o.length!==t.length)return!1;for(let e=0,n=o.length;e<n;e++)if(!xn(o[e],t[e]))return!1;return!0}function da(o,t){const e=Object.getOwnPropertyNames(o),n=Object.getOwnPropertyNames(t);if(e.length!==n.length)return!1;for(let s=0,r=e.length;s<r;s++){const a=e[s];if(!xn(o[a],t[a]))return!1}return!0}function Ce(o,t,e={deep:!1}){return e.deep?xn(o,t):la(o,t)}const Be="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAMAAAANf8AYAAAC2VBMVEUAAACCnP+Dn/+Enf+HqP+Gp/+Fof+Gpf+IrP+Lsf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fgNTwRQLsPLsHQAAAABJRU5ErkJggg==";function ua(o){return o*180/Math.PI}function ha(o){i.append_styles(o,"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 fa(o){let t,e;return{c(){t=i.element("div"),e=i.element("div"),i.attr(e,"class","floorplan__camera-rotate svelte-17cl35n"),i.set_style(e,"background-image",`url(${o[0]||Be})`),i.set_style(e,"width",o[4],!1),i.set_style(e,"height",o[4],!1),i.set_style(e,"left","-"+o[4],!1),i.set_style(e,"top","-"+o[4],!1),i.set_style(e,"transform",`rotate(${o[3]}deg)`,!1),i.set_style(e,"transform-origin",`${o[4]} ${o[4]}`,!1),i.attr(t,"class","floorplan__camera-position svelte-17cl35n"),i.set_style(t,"left",o[1],!1),i.set_style(t,"top",o[2],!1)},m(n,s){i.insert(n,t,s),i.append(t,e)},p(n,[s]){s&1&&i.set_style(e,"background-image",`url(${n[0]||Be})`)},i:i.noop,o:i.noop,d(n){n&&i.detach(t)}}}function ma(o,t,e){let{panoIndex:n}=t,{floorplanData:s}=t,{lastPanoramaLongitude:r}=t,{cameraImageUrl:a}=t;const{observers:l}=s,c=l[n],d=c.positionInImage.x,u=c.positionInImage.y,f=d*100+"%",h=u*100+"%",p=-ua(r)+45,g=document.body.clientWidth,A=document.body.clientHeight,v=`${(g<500||A<500?17:37)/16}rem`;return o.$$set=w=>{"panoIndex"in w&&e(5,n=w.panoIndex),"floorplanData"in w&&e(6,s=w.floorplanData),"lastPanoramaLongitude"in w&&e(7,r=w.lastPanoramaLongitude),"cameraImageUrl"in w&&e(0,a=w.cameraImageUrl)},[a,f,h,p,v,n,s,r]}class pa extends i.SvelteComponent{constructor(t){super(),i.init(this,t,ma,fa,i.safe_not_equal,{panoIndex:5,floorplanData:6,lastPanoramaLongitude:7,cameraImageUrl:0},ha)}}const ga="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArU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HFISzccSWohUCzOIemm0VKChwHOMutKCVwHOA4av/JVi0xtDiRpCRfRcvQ4lBfxSnG0OJc/+xTjKHFyVRMP38iDC0O92lZVRhanO+vcVWGFu9BRWkW7+Z3rapEizdy7ZVm8V5Gtr8AtSnix59eOmYAAAAASUVORK5CYII=";function Aa(o){i.append_styles(o,"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 va(o){let t,e,n,s,r;return{c(){t=i.element("div"),e=i.element("div"),n=i.space(),s=i.element("span"),r=i.text(o[0]),i.attr(e,"class","floorplan-plugin__compass-image svelte-rpkaro"),i.set_style(e,"background-image",`url(${ga})`),i.attr(s,"class","floorplan-plugin__compass-text svelte-rpkaro"),i.attr(t,"class","floorplan-plugin__compass svelte-rpkaro"),i.set_style(t,"transform",o[2],!1)},m(a,l){i.insert(a,t,l),i.append(t,e),i.append(t,n),i.append(t,s),i.append(s,r)},p(a,l){l&1&&i.set_data(r,a[0])},d(a){a&&i.detach(t)}}}function ba(o){let t,e=o[1]&&va(o);return{c(){e&&e.c(),t=i.empty()},m(n,s){e&&e.m(n,s),i.insert(n,t,s)},p(n,[s]){n[1]&&e.p(n,s)},i:i.noop,o:i.noop,d(n){e&&e.d(n),n&&i.detach(t)}}}function ya(o){return o/Math.PI*180}function wa(o,t,e){var d;let{floorplanData:n}=t,{northDesc:s}=t;const r=(d=n.entrance)==null?void 0:d.northRad,a=typeof r=="number",c=`translateX(-50%) translateZ(10px) rotate(${-(r?ya(r):0)+90}deg)`;return o.$$set=u=>{"floorplanData"in u&&e(3,n=u.floorplanData),"northDesc"in u&&e(0,s=u.northDesc)},[s,a,c,n]}class Ca extends i.SvelteComponent{constructor(t){super(),i.init(this,t,wa,ba,i.safe_not_equal,{floorplanData:3,northDesc:0},Aa)}}function Ea(o){i.append_styles(o,"svelte-1gfoniz","img.svelte-1gfoniz{width:100%;height:100%}")}function Pa(o){let t,e;return{c(){t=i.element("img"),i.src_url_equal(t.src,e=o[0])||i.attr(t,"src",e),i.attr(t,"alt","floorplan iamge"),i.attr(t,"class","svelte-1gfoniz")},m(n,s){i.insert(n,t,s)},p(n,[s]){s&1&&!i.src_url_equal(t.src,e=n[0])&&i.attr(t,"src",e)},i:i.noop,o:i.noop,d(n){n&&i.detach(t)}}}function Ia(o,t,e){let{url:n}=t;return o.$$set=s=>{"url"in s&&e(0,n=s.url)},[n]}class ka extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Ia,Pa,i.safe_not_equal,{url:0},Ea)}}function xa(o){i.append_styles(o,"svelte-ub47ya",".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}")}function Da(o){let t,e,n,s;return{c(){t=i.element("div"),e=new i.HtmlTag(!1),n=i.space(),s=new i.HtmlTag(!1),e.a=n,s.a=null,i.attr(t,"class","floorplan-plugin__base-image svelte-ub47ya")},m(r,a){i.insert(r,t,a),e.m(o[1],t),i.append(t,n),s.m(o[0],t)},p(r,[a]){a&1&&s.p(r[0])},i:i.noop,o:i.noop,d(r){r&&i.detach(t)}}}function Sa(o,t,e){let{content:n}=t;const s=`
|
|
101
|
+
`;class Mr extends _r{constructor(e){super();m(this,"configs");m(this,"clientWidth");m(this,"clientHeight");m(this,"ready",!1);m(this,"uuid",ue());m(this,"tween");m(this,"tweening",!1);m(this,"container");m(this,"canvas");m(this,"data",{});m(this,"tempLine",{});this.configs=e,this.clientWidth=document.body.clientWidth,this.clientHeight=document.body.clientHeight,this.container=this.ifInsertToDOM(),this.canvas={},this.initCtrl()}get color(){return this.configs.currentColor}get state(){return this.data}get dpr(){return this.configs.DPR||1}ifInsertToDOM(){if(this.container)return this.container;if(this.configs.container)this.configs.container.id="_gl_paintBrush",this.container=this.configs.container;else if(document.getElementById("_gl_paintBrush"))this.container=document.getElementById("_gl_paintBrush");else{const e=document.createElement("div");e.id="_gl_paintBrush",document.body.appendChild(e),this.container=e}return this.container.innerHTML=zr,this.container}initCanvas(e){const n=document.createElement("canvas");n.className=e,n.width=this.clientWidth,n.height=this.clientHeight;const s=n.getContext("2d");if(!!s)return s.lineWidth=5*this.dpr,s.lineCap="round",s.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 s=document.createElement("a");s.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--undo",s.addEventListener("click",l=>{var h;if(l.stopPropagation(),this.configs.onClickUndo&&this.configs.onClickUndo(),!this.canvas[this.uuid]||!this.data[this.uuid]||this.data[this.uuid].length===0)return;const c=this.data[this.uuid].pop();c&&this.emitStateChange({type:ke.Undo,color:this.color,ready:this.ready,state:c,uuid:this.uuid});const d=(h=this.canvas[this.uuid])==null?void 0:h.getContext("2d");if(!this.canvas[this.uuid])return;const{width:u,height:f}=this.canvas[this.uuid];d&&d.clearRect(0,0,u,f),this.data[this.uuid].forEach(p=>this.handleDrawLine(this.uuid,p,{withUndo:!0}))});const r=document.createElement("a");return r.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--close",r.addEventListener("click",l=>{l.stopPropagation(),this.closeBrush(),this.configs.onClickClose&&this.configs.onClickClose()}),[s,r].forEach(l=>{const c=document.createElement("i");c.className="brush-icon";const d=document.createElement("span");d.className="brush-txt",d.innerText=l.className.endsWith("undo")?this.configs.onUndoText:this.configs.onExitText,l.appendChild(c),l.appendChild(d)}),n.appendChild(s),n.appendChild(r),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:ke.Exit,color:this.color,ready:!1,uuid:this.uuid}))}updateCurrentColor(e){const n=this.canvas[this.uuid];if(!n)return;const s=n.getContext("2d");!s||(this.configs.currentColor=e,s.strokeStyle=e)}openBrushHandle(){const e=this.canvas[this.uuid];if(!e)return;const n=e.getContext("2d");if(!n)return;const s=this.color||"#6D92FF";n.strokeStyle=s;let r=null,a=[],l,c=[],d=0;const u=(f,h,p)=>{const g=this.color||"#ff0000";n.strokeStyle=g,n.beginPath(),n.moveTo(f.x,f.y),n.quadraticCurveTo(h.x,h.y,p.x,p.y),n.stroke()};e.onmousedown=f=>{f.preventDefault(),d=Date.now();const h=f.clientX,p=f.clientY;a=[],a.push({x:h,y:p}),r={x:h,y:p},l=mt({x:h,y:p},this.clientWidth,this.clientHeight),c=[]},e.onmousemove=f=>{if(f.preventDefault(),!r)return;const h=Number(f.clientX),p=Number(f.clientY);if(Math.abs(h-r.x)<5&&Math.abs(p-r.y)<5||(a.push({x:h,y:p}),c.push(mt({x:h,y:p},this.clientWidth,this.clientHeight)),a.length<3))return;const{control:g,end:A}=pt(a);!g||!A||(u(r,g,A),r=A)},e.onmouseup=f=>{if(f.preventDefault(),r=null,a.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const h=Date.now()-d,p={move:Object.assign({},l),uuid:this.uuid,line:[...c],color:this.color,duration:h<1280?h:h<2e3?1280:0};this.data[this.uuid].push(p),Lt(()=>{this.emitStateChange({type:ke.Drawline,color:this.color,ready:this.ready,state:p,uuid:this.uuid})})},e.ontouchstart=f=>{f.preventDefault(),d=Date.now();const h=f.touches[0].clientX,p=f.touches[0].clientY;a=[],a.push({x:h,y:p}),r={x:h,y:p},console.log("ontouchstart",h,p,r),l=mt({x:h,y:p},this.clientWidth,this.clientHeight),c=[]},e.ontouchmove=f=>{if(f.preventDefault(),!r)return;const h=Number(f.touches[0].clientX),p=Number(f.touches[0].clientY);if(Math.abs(h-r.x)<5&&Math.abs(p-r.y)<5||(a.push({x:h,y:p}),c.push(mt({x:h,y:p},this.clientWidth,this.clientHeight)),a.length<3))return;const{control:g,end:A}=pt(a);!g||!A||(u(r,g,A),r=A)},e.ontouchend=e.ontouchcancel=f=>{if(f.preventDefault(),r=null,a.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const h=Date.now()-d,p={move:Object.assign({},l),line:[...c],uuid:this.uuid,color:this.color,duration:h<1280?h:h<2e3?1280:0};this.data[this.uuid].push(p),Lt(()=>{this.emitStateChange({type:ke.Drawline,color:this.color,ready:this.ready,state:p,uuid:this.uuid})})}}emitStateChange(e,n=!0){if(e.type!==ke.Drawline){this.emit("stateChange",e,n);return}const s=Date.now(),r=e.state;if(!r||!r.line)return;const a=Math.ceil(r.line.length/100);for(let l=0;l<a;l++){const c={uuid:this.uuid,color:this.color,ready:this.ready,type:e.type,state:{uuid:this.uuid,move:r.move,duration:r.duration,color:this.color,line:r.line.slice(l*100,(l+1)*100)},timestamp:s,end:l===a-1};xr(l,20,()=>{this.emit("stateChange",c,n)})}}action(e){const{ready:n,type:s,uuid:r}=e;if(!n&&this.ready){this.closeBrush();return}if(n&&!this.ready){this.openBrush();return}if(!!this.ready)switch(s){case ke.Drawline:const{state:a,timestamp:l,end:c}=e;if(!l||!a)return;this.tempLine[l]=[].concat(this.tempLine[l]||[],a.line),c&&(Object.assign(a,{line:this.tempLine[l]}),this.handleDrawLine(r,a,{},()=>delete this.tempLine[l]));break;case ke.Undo:this.handleUndo(r);break}}handleDrawLine(e,n,{withUndo:s=!1},r=hs){!n||Object.prototype.toString.call(n)!="[object Object]"||Object.keys(n).length===0||(console.log("handleDrawLine",n,n.line),kr(()=>new Promise(a=>{if(s||(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 l=this.canvas[e].getContext("2d");if(!l)return;const{line:c=[],color:d="black",duration:u=0,uuid:f}=n,h=Kt(n.move||{},this.clientWidth,this.clientHeight);let p=[h];if(l.strokeStyle=d,l.beginPath(),l.moveTo(h.x,h.y),u&&!s){let g=[];const A=this;A.tween=Sr({step:0},{step:c.length-1},u).onUpdate(({step:b})=>{var w;if(A.tweening=!0,!A.ready)return l.clearRect(0,0,A.canvas[f].width,A.canvas[f].height),(w=A.tween)==null?void 0:w.stop();const v=Math.floor(b);if(!g.find(y=>y===v)){if(g.push(v),console.log("__debug__",c,c[v],v),p.push(Kt(c[v],A.clientWidth,A.clientHeight)),p.length<3)return;const{control:y,end:I}=pt(p);if(!y||!I)return;l.quadraticCurveTo(y.x,y.y,I.x,I.y),l.stroke()}}).onComplete(b=>{A.tween=void 0,A.tweening=!1,g=[],p=[],r&&r(),a()})}else{for(let g=0;g<c.length;g++){if(p.push(Kt(c[g],this.clientWidth,this.clientHeight)),p.length<3)continue;const{control:A,end:b}=pt(p);!A||!b||l.quadraticCurveTo(A.x,A.y,b.x,b.y)}l.stroke(),p=[],r&&r(),a()}})))}handleUndo(e){if(console.log("handleUndo",e,this.canvas[e]),!this.canvas[e]||!this.data[e]||this.data[e].length===0)return;this.data[e].pop();const n=()=>{var r;const s=(r=this.canvas[e])==null?void 0:r.getContext("2d");s&&s.clearRect(0,0,this.canvas[e].width,this.canvas[e].height),this.data[e].forEach(a=>this.handleDrawLine(e,a,{withUndo:!0}))};if(this.tween&&this.tweening){this.tween.stop(),Lt(n,60);return}n()}destroyBrush(){this.closeBrush(),this.ready=!1,this.emit("readyChange",!0)}}class Tr{constructor(t={}){m(this,"controller");const e=Object.assign({currentColor:"#f44336",onUndoText:"\u56DE\u9000",onExitText:"\u5173\u95ED"},t);this.controller=new Mr(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 jr=(o,t)=>{let e=!0,n=null;const r=j(j({},{lookAtCurrentCamera:!1,lockedPanoIndex:null,lockedLatitude:null,lockedLongitude:null}),t==null?void 0:t.config),a=new P.Scene,l=new ee.Camera(60);let c=new P.Object3D,d,u;{const C=new P.DirectionalLight(16777215,.5);C.position.copy(new P.Vector3(1,1,1)),a.add(C)}{const C=new P.DirectionalLight(16777215,.3);a.add(C)}{const C=new P.AmbientLight(16777215,.3);a.add(C)}a.add(c);const f=()=>{if(!!o.renderer)return n||(n=new P.WebGLRenderer({antialias:!1,alpha:!0}),n.setPixelRatio(o.renderer.getPixelRatio()),n.outputEncoding=P.sRGBEncoding,n.setClearColor(1579548,0),n.autoClear=!0),n},h=()=>{c.traverse(C=>{C instanceof P.Mesh&&[].concat(C.material).forEach(x=>x.dispose())}),a.remove(c),c=new P.Object3D,a.add(c),w()},p=()=>{d=b(o.model,l.fov,l.aspect),u=o.model.bounding.getCenter(new P.Vector3);function C(x){const z=x.clone();return z.uniforms.modelAlpha.value=1,z.uniforms.map.value&&(z.uniforms.map.value.needsUpdate=!0),z}function D(x){if(x instanceof P.Mesh){const z=x.geometry,L=Array.isArray(x.material)?x.material.map(C):C(x.material);return new P.Mesh(z,L)}else if(x instanceof P.Group){const z=new P.Group;return x.children.forEach(L=>z.add(D(L))),z}else{const z=new P.Object3D;return x.children.forEach(L=>z.add(D(L))),z}}a.remove(c),c=D(o.model),a.add(c),w()},g=(C,D={})=>{const x=f();if(!x)return;C.appendChild(x.domElement),A(D);const z=window.getComputedStyle(C).position;z!=="relative"&&z!=="absolute"&&z!=="fixed"&&z!=="sticky"&&(C.style.position="relative")},A=(C={})=>{if(!n)return;const x=n.domElement.parentNode;if(x!=null&&x.nodeName){const{width:z=x.offsetWidth,height:L=x.offsetHeight}=C;n.setSize(z,L),l.aspect=z/L,l.updateProjectionMatrix()}w()};function b(C,D,x){const z=C.bounding,L=Math.pow(Math.pow(z.max.x-z.min.x+1,2)+Math.pow(z.max.y-z.min.y+1,2)+Math.pow(z.max.z-z.min.z+1,2),1/2);let T=L/2/Math.tan(Math.PI*D/360);return x<1&&(T=T/x),isNaN(T)?L:T}function v(C){return o.work.observers[C].standingPosition.clone()}const w=()=>{if(!d||!u)return;const C=o.getPose();C.fov=l.fov,C.offset=u,C.distance=d,typeof r.lockedLatitude=="number"&&(C.latitude=r.lockedLatitude),typeof r.lockedLongitude=="number"&&(C.longitude=r.lockedLongitude),typeof r.lockedPanoIndex=="number"&&(C.offset=v(r.lockedPanoIndex)),r.lookAtCurrentCamera&&(C.offset=o.camera.position.clone().setY(o.camera.position.y+1)),l.setFromPose(C),e=!0},y=()=>{e!==!0||!n||!n.domElement.parentNode||n.domElement.parentNode.offsetWidth===0||(n.render(a,l),e=!1)},I=()=>{n&&n.dispose(),n=null},k=C=>{Object.assign(r,C),w()};return Object.assign(window,{camera:l}),o.on("modelLoaded",p),o.on("modelWillLoad",h),o.on("cameraDirectionUpdate",w),o.on("dispose",I),o.on("renderFrame",y),o.on("cameraPositionUpdate",w),{appendTo:g,refresh:A,changeConfigs:k}};function Br(o){return typeof Symbol=="undefined"?`$Symbol<${o}>$`:Symbol(o)}const at=Br("$$EVENT$$");function At(o){return o[at]||(o[at]={}),o[at]}function Qr(o){o[at]||delete o[at]}class ht{hasListener(t){const e=At(this);return Boolean((e==null?void 0:e[t])&&e[t].length>0)}on(t,e,n){const s=At(this);return s[t]||(s[t]=[]),s[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){Qr(this);return}const n=At(this);if(n[t]||(n[t]=[]),e===void 0){n[t].length=0;return}let s=0;for(;s<n[t].length&&n[t][s][0]!==e;s++);s<n[t].length&&n[t].splice(s,1)}emit(t,...e){let n=!1;const r=At(this)[t]||[];for(let a of r.slice()){const[l,c=!1]=a,d=l(...e);c&&this.off(t,l),d===!1&&(n=!0)}return n}}function fs(...o){const t=new M.Vector3;return o.forEach(e=>{t.add(e)}),t.divideScalar(o.length),t}function Tt(o,t){const e=Math.round(o);return e%2===0?e:e+Number(t!=null&&t.smaller?-1:1)}const Rr=({x:o,y:t,z:e})=>new M.Vector3(o,t,e),De=([o,t,e])=>new M.Vector3(o,t,e),ct=o=>o instanceof M.Vector3?o:Array.isArray(o)?De(o):Rr(o),ms="1.0.2",Or=`CSS3DObjectPlus@${ms}`,Hr=.00216,Fr=.003;class ps extends Mt.CSS3DObject{constructor(e,n,s=Fr,r=1,a="front"){const l=Math.max(Hr,s),c=n[0].distanceTo(n[1]),d=n[1].distanceTo(n[2]),u=Tt(c/s*r),f=Tt(d/s*r),h=fs(...n);let p;if(l===s)e.style.width=`${u}px`,e.style.height=`${f}px`,p=e;else{const I=document.createElement("div");I.style.width=`${u}px`,I.style.height=`${f}px`,I.style.pointerEvents="none";const k=s/l;e.style.position="absolute",e.style.left="0",e.style.top="0",e.style.width=`${k*u}px`,e.style.height=`${k*f}px`,I.appendChild(e),p=I}super(p);m(this,"version",ms);m(this,"width");m(this,"height");m(this,"domWidthPx");m(this,"domHeightPx");m(this,"cornerPoints");m(this,"ratio");m(this,"container");m(this,"centerPosition");m(this,"mode","front");m(this,"hooks",new ht);m(this,"isCSS3DObjectPlus",!0);if(this.scale.set(l,l,l),this.cornerPoints=n,this.ratio=s,this.container=e,this.mode=a,l===s)this.width=c,this.height=d,this.domWidthPx=u,this.domHeightPx=f,this.centerPosition=h;else{const I=s/l;this.width=I*c,this.height=I*d,this.domWidthPx=I*u,this.domHeightPx=I*f,this.centerPosition=new M.Vector3().subVectors(h,n[0]).multiplyScalar(I).add(n[0])}e.classList.add(`${Or}__container`);const g=new M.Vector3().subVectors(n[1],n[0]),A=new M.Vector3().subVectors(n[3],n[0]),b=new M.Vector3().crossVectors(g,A).normalize();this.lookAt(b);const v=this.up.clone().applyQuaternion(this.quaternion),w=A.clone(),y=new M.Vector3().crossVectors(v,w).normalize();this.rotateOnWorldAxis(y,v.angleTo(w)),this.position.copy(h)}changeMode(e,n){if(e===this.mode)return;const s=this.mode;this.mode=e,this.hooks.emit("changeMode",e,s,n)}applyScaleMatrix4(e){this.scale.applyMatrix4(e),this.hooks.emit("applyScaleMatrix4",e)}applyMatrix4(e){super.applyMatrix4(e),this.hooks.emit("applyMatrix4",e)}applyQuaternion(e){return super.applyQuaternion(e),this.hooks.emit("applyQuaternion",e),this}}const Gr="v2.0.1",gs="CSS3DRenderer",Ge=`${gs}@${Gr}`,Vn=o=>`${Ge}--${o}`,U={};class As{constructor(){m(this,"hooks",new ht);m(this,"state",{enabled:!0,visible:!0,disposed:!1});m(this,"store",{rendered:!1,disposers:[],frontModeCSS3DObjects:{},behindModeCSS3DObjects:{}});m(this,"create3DElement",(t,e,n)=>{if(this.state.disposed)return this.disposedErrorLog();const s=(()=>{const E={ratio:.00216,devicePixelRatio:1,mode:"front",autoRender:!0,container:document.createElement("div"),pointerEvents:"none"};return Object.assign(E,n)})(),r=e.map(ct);if((r==null?void 0:r.length)<4)return console.error(`${Ge}: requires 4 point but params may have fewer`);const{ratio:a,devicePixelRatio:l,mode:c,autoRender:d,container:u,pointerEvents:f}=s,h=[],{css3DObject:p,opacityMesh:g}=this.createObject(r,{ratio:a,dpr:l,container:u,mode:c,pointerEvents:f});u.id=`container--${p.uuid}`;const A=c==="front"&&!U.frontModeStore,b=c==="behind"&&!U.behindModeStore;c==="front"&&this.initGlobalModeStore("front"),c==="behind"&&this.initGlobalModeStore("behind",s.scene),p.hooks.on("changeMode",(E,S,_)=>{var X,Y,J;if(E===S)return;E==="front"&&this.initGlobalModeStore("front"),E==="behind"&&this.initGlobalModeStore("behind",_);const B=S==="front"?U.frontModeStore:U.behindModeStore,O=E==="front"?U.frontModeStore:U.behindModeStore,G=S==="behind"?this.store.behindModeCSS3DObjects:this.store.frontModeCSS3DObjects,Q=E==="behind"?this.store.behindModeCSS3DObjects:this.store.frontModeCSS3DObjects;if(!G||!Q)return console.error(`${Ge}: changeMode error: prevObjects or nextObjects is undefined`);const H=G[p.uuid];if(!H)return console.error(`${Ge}: changeMode error: prevObject is undefined`);if(E==="behind"){const te=(X=H.opacityMesh)!=null?X:this.createOpacityMesh(H.css3DObject);B==null||B.css3DScene.remove(H.css3DObject),Q[p.uuid]={css3DObject:p,opacityMesh:te,visible:!0,enabled:!0,mode:E,scene:_},O==null||O.css3DScene.add(p),_==null||_.add(te)}E==="front"&&(B==null||B.css3DScene.remove(H.css3DObject),(J=(Y=G[p.uuid])==null?void 0:Y.scene)==null||J.remove(H.opacityMesh),Q[p.uuid]={css3DObject:p,visible:!0,enabled:!0,mode:E},O==null||O.css3DScene.add(p)),E==="behind"&&this.appendToElement(U.behindModeContainer,"behind"),E==="front"&&this.appendToElement(U.frontModeContainer,"front"),this.render(t),console.log("change success")});const v=c==="front"?U.frontModeStore:U.behindModeStore,{css3DScene:w,css3DRenderer:y}=v,I=(()=>{const E=()=>{var _,B;const S=p.mode;if(S==="front")this.store.frontModeCSS3DObjects[p.uuid]={visible:!0,enabled:!0,css3DObject:p,mode:"front"};else{if(!s.scene)return;this.store.behindModeCSS3DObjects[p.uuid]={visible:!0,enabled:!0,css3DObject:p,opacityMesh:g,mode:"behind",scene:s.scene}}w.getObjectById(p.id)||w.add(p),S==="behind"&&g&&((_=s.scene)!=null&&_.getObjectById(g.id)||(B=s.scene)==null||B.add(g),h.push(()=>{var O;return g&&((O=s.scene)==null?void 0:O.remove(g))}))};return A||b?(y.domElement.style.position="absolute",y.domElement.style.top="0",y.domElement.style.userSelect="none",y.domElement.style.pointerEvents="none",y.domElement.classList.add(Vn(c)),()=>{E(),this.render(t)}):(this.store.rendered=!0,()=>E())})(),k=c==="front"?U.frontModeContainer:U.behindModeContainer;if(k){this.appendToElement(k,c);const E=c==="front"?U.frontModeStore:U.behindModeStore;E&&(E.appendedToPage=!0)}const C=E=>this.setVisibleById(p.uuid,E),D=E=>this.setEnabledById(p.uuid,E),x=()=>C(!0),z=()=>C(!1),L=()=>D(!0),T=()=>D(!1),R=()=>(delete this.store.frontModeCSS3DObjects[p.uuid],delete this.store.behindModeCSS3DObjects[p.uuid],h.forEach(E=>E==null?void 0:E()),w.remove(p),w.children.length===0&&(typeof v.requestAnimationFrameId=="number"&&cancelAnimationFrame(v.requestAnimationFrameId),y.domElement.remove(),c==="front"&&(U.frontModeStore=void 0),c==="behind"&&(U.behindModeStore=void 0),U.frontModeResizeObserver=void 0,U.behindModeResizeObserver=void 0),!0);return this.store.disposers.push(R),d&&I(),{id:p.uuid,container:u,dispose:R,css3DObject:p,render:d?void 0:I,show:x,hide:z,setVisible:C,disable:T,enable:L,setEnabled:D,appendToElement:E=>this.appendToElement(E,c)}});m(this,"setVisibleById",(t,e)=>{var s;const n=(s=this.store.frontModeCSS3DObjects[t])!=null?s:this.store.behindModeCSS3DObjects[t];if(!n)return console.error("id not found",t);n.visible=e,this.state.visible&&(n.css3DObject.visible=e,n.mode==="behind"&&(n.opacityMesh.visible=e))});m(this,"setEnabledById",(t,e)=>{var r,a,l;const n=(r=this.store.frontModeCSS3DObjects[t])!=null?r:this.store.behindModeCSS3DObjects[t];if(!n)return;const s=n.mode==="front"?(a=U.frontModeStore)==null?void 0:a.css3DScene:(l=U.behindModeStore)==null?void 0:l.css3DScene;!s||(e?(s.add(n.css3DObject),n.mode==="behind"&&n.scene.add(n.opacityMesh)):(s.remove(n.css3DObject),n.mode==="behind"&&n.scene.remove(n.opacityMesh)),n.enabled=e)});m(this,"createObject",(t,e)=>{const{ratio:n,dpr:s,container:r,mode:a,pointerEvents:l}=e,c=new ps(r,t,n,s,a);r.style.pointerEvents=l,r.classList.add(`${gs}__container`);const d=a==="behind"?this.createOpacityMesh(c):void 0;return{css3DObject:c,opacityMesh:d}});m(this,"createOpacityMesh",t=>{const{domWidthPx:e,domHeightPx:n}=t,s=new P.MeshBasicMaterial({opacity:0,color:0,transparent:!1,side:P.DoubleSide}),r=new P.PlaneGeometry(e,n),a=new P.Mesh(r,s);return a.name=Vn("mesh"),a.position.copy(t.position),a.rotation.copy(t.rotation),a.scale.copy(t.scale),t.hooks.on("applyMatrix4",l=>a.applyMatrix4(l)),t.hooks.on("applyQuaternion",l=>a.applyQuaternion(l)),t.hooks.on("applyScaleMatrix4",l=>a.scale.applyMatrix4(l)),a});m(this,"createResizeObserver",(t,e,n=!0)=>{if(!t)return console.error("createResizeObserver: element is undefined"),{observe:()=>{},unobserve:()=>{}};const s=()=>{const a=Tt(t.clientWidth,{smaller:!0}),l=Tt(t.clientHeight,{smaller:!0});e(a,l)};if(typeof ResizeObserver=="undefined"||!ResizeObserver)return console.warn("createResizeObserver: ResizeObserver is undefined"),{observe:()=>s(),unobserve:()=>{}};const r=new ResizeObserver(s);return n&&s(),{observe:()=>r.observe(t),unobserve:()=>r.unobserve(t)}});m(this,"disposedErrorLog",()=>{console.error(`${Ge} is disposed`)})}getCurrentState(){return this.state}setState(t,e={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();const n=j({},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()),this.hooks.emit("stateChange",{state:this.state,prevState:n,userAction:e.userAction})}dispose(){this.store.disposers.forEach(t=>t==null?void 0:t()),this.store.disposers=[],this.hooks.emit("dispose"),this.state.disposed=!0}show(){return F(this,arguments,function*({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({visible:!0},{userAction:t}),this.hooks.emit("show",{userAction:t})})}hide(){return F(this,arguments,function*({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({visible:!1},{userAction:t}),this.hooks.emit("hide",{userAction:t})})}enable({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({enabled:!0},{userAction:t}),this.hooks.emit("enable",{userAction:t})}disable({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({enabled:!1},{userAction:t}),this.hooks.emit("disable",{userAction:t})}setContainer(t,e){e==="front"?U.frontModeContainer=t:U.behindModeContainer=t}appendToElement(t,e){const n=e==="front"?U.frontModeStore:U.behindModeStore;if(!n){if(e==="front"&&!U.frontModeContainer){if(!t)throw new Error(`${Ge} Cannot append to container: front mode but container is ${t}`);U.frontModeContainer=t}if(e==="behind"&&!U.behindModeContainer){if(!t)throw new Error(`${Ge} Cannot append to container: behind mode but container is ${t}`);U.behindModeContainer=t}return}if(n.appendedToPage)return;const s=e==="behind"?U.behindModeContainer:U.frontModeContainer;if(!s)return console.error("wrapper is undefined");if(s.appendChild(n.css3DRenderer.domElement),e==="behind"&&!U.behindModeResizeObserver){const r=(c,d)=>{var u;(u=U.behindModeStore)==null||u.css3DRenderer.setSize(c,d)},{observe:a,unobserve:l}=this.createResizeObserver(s,r,!0);U.behindModeResizeObserver={observe:a,unobserve:l},a(),this.store.disposers.push(l)}if(e==="front"&&!U.frontModeResizeObserver){const r=(c,d)=>{var u;(u=U.frontModeStore)==null||u.css3DRenderer.setSize(c,d)},{observe:a,unobserve:l}=this.createResizeObserver(s,r,!0);U.frontModeResizeObserver={observe:a,unobserve:l},a(),this.store.disposers.push(l)}n.appendedToPage=!0}render(t){const e=U.behindModeStore,n=U.frontModeStore;if(e&&Object.keys(this.store.behindModeCSS3DObjects).length>0&&!e.requestAnimationFrameId){const s=()=>{const r=requestAnimationFrame(s);e.requestAnimationFrameId=r,e.css3DRenderer.render(e.css3DScene,t)};s()}if(n&&Object.keys(this.store.frontModeCSS3DObjects).length>0&&!n.requestAnimationFrameId){const s=()=>{const r=requestAnimationFrame(s);n.requestAnimationFrameId=r,n.css3DRenderer.render(n.css3DScene,t)};s()}Object.keys(this.store.frontModeCSS3DObjects).length===0&&(n==null?void 0:n.requestAnimationFrameId)!==void 0&&(cancelAnimationFrame(n.requestAnimationFrameId),n.requestAnimationFrameId=void 0),Object.keys(this.store.behindModeCSS3DObjects).length===0&&(e==null?void 0:e.requestAnimationFrameId)!==void 0&&(cancelAnimationFrame(e.requestAnimationFrameId),e.requestAnimationFrameId=void 0)}initGlobalModeStore(t,e){const n=t==="front"&&!U.frontModeStore;t==="behind"&&!U.behindModeStore&&(U.behindModeStore={scene:e,css3DScene:new P.Scene,css3DRenderer:new Mt.CSS3DRenderer}),n&&(U.frontModeStore={css3DScene:new P.Scene,css3DRenderer:new Mt.CSS3DRenderer})}handleShow(){return F(this,null,function*(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=t.visible}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=t.visible,t.opacityMesh.visible=t.visible})})}handleHide(){return F(this,null,function*(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=!1}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=!1,t.opacityMesh.visible=!1})})}handleEnable(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{var e;!t.enabled||(e=U.frontModeStore)==null||e.css3DScene.add(t.css3DObject)}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{var e,n;!t.enabled||((e=U.behindModeStore)==null||e.css3DScene.add(t.css3DObject),(n=U.behindModeStore)==null||n.scene.add(t.opacityMesh))})}handleDisable(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{var e;(e=U.frontModeStore)==null||e.css3DScene.remove(t.css3DObject)}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{var e,n;(e=U.behindModeStore)==null||e.css3DScene.remove(t.css3DObject),(n=U.behindModeStore)==null||n.scene.remove(t.opacityMesh)})}}const Nr="v2.0.1",Jn=`CSS3DRenderPlugin@${Nr}`;class Wr extends As{constructor(e){super();m(this,"five");m(this,"behindFiveContainer");m(this,"staticPrefix","//vrlab-static.ljcdn.com");m(this,"create3DDomContainer",(e,n)=>{if(this.state.disposed)return;const s=(()=>{var g;(n==null?void 0:n.dpr)!==void 0&&console.warn(`${Jn}: please use "config.devicePixelRatio" replace "config.dpr"`);const p={ratio:.00216,devicePixelRatio:(g=n==null?void 0:n.dpr)!=null?g:1,mode:"front",autoRender:!0};return Object.assign(p,n,(n==null?void 0:n.mode)==="behind"?{scene:this.five.scene}:void 0)})(),r=this.five.getElement();if(!r){console.error(`${Jn}: five.getElement() is ${r}`);return}const{autoRender:a,mode:l}=s,c=l==="front"?r.parentElement:s.behindFiveContainer;this.setContainer(c||document.body,"front");const d=this.getBehindFiveElement();d&&this.setContainer(d,"behind"),this.appendToElement(c||document.body,l);const u=this.create3DElement(this.five.camera,e,V(j({},s),{autoRender:!1}));if(!u)return;const f=u.render,h=()=>{var p;l==="front"&&f(),l==="behind"&&((p=this.five.model)!=null&&p.loaded?f():this.five.once("modelLoaded",()=>f()))};return a&&h(),V(j({},u),{render:a?void 0:h})});this.five=e}disposeAll(){return this.dispose()}setState(...e){const n=super.setState(...e);return this.five.needsRender=!0,n}getBehindFiveElement(){var l;const{behindFiveContainer:e}=this;if(e)return e;const n=document.createElement("div");n.style.position="absolute",n.style.pointerEvents="none",n.style.top="0",n.style.left="0",n.style.width="100%",n.style.height="100%",this.behindFiveContainer=n;const s=this.five.getElement();if(!s)return;const r=(l=s==null?void 0:s.style.position)!=null?l:getComputedStyle(s);(!r||r==="static")&&console.warn("if you want to use css3DRenderPlugin behind mode, five element position is static, please set position to relative or absolute");const a=s==null?void 0:s.parentElement;if(a)return a.insertBefore(n,s),n}}const nt=o=>new Wr(o);function $t(o,t,e=new M.Vector3(1,1,1),n=!1){const s=new ls.Line(o,t);return s.setMaterial({dashed:n,color:e,linewidth:1}),s.remove(s.points),s}const Xr=o=>{const t={intersection:null,disposers:[]},e=u=>{t.intersection=u},n=()=>{t.intersection=null};o.on("modelLoaded",()=>{o.on("intersectionOnModelUpdate",e),o.on("intersectionHidden",n)}),o.on("dispose",()=>{o.off("intersectionOnModelUpdate",e),o.off("intersectionHidden",n)});const s=(u,f=2,h=.1)=>{const p=f/2,A=d(u,h),b=new M.Group;b.add($t(new M.Vector3(A.x+p,A.y,A.z),new M.Vector3(A.x-p,A.y,A.z),new M.Vector3(1,0,0)),$t(new M.Vector3(A.x,A.y+p,A.z),new M.Vector3(A.x,A.y-p,A.z),new M.Vector3(0,1,0)),$t(new M.Vector3(A.x,A.y,A.z+p),new M.Vector3(A.x,A.y,A.z-p),new M.Vector3(0,0,1))),o.scene.add(b),o.needsRender=!0;const v=()=>{o.scene.remove(b)};return t.disposers.push(v),{clear:v,pointAxesHelperMesh:b}},r=(u,f=0)=>{var v,w;const h=(v=o==null?void 0:o.camera)==null?void 0:v.position;if(!h)return!1;const p=u.distanceTo(h),g=u.sub(h).normalize(),A=new M.Raycaster(h,g),b=(w=o.model.intersectRaycaster(A))==null?void 0:w[0];return!(b&&b.distance+f<p)},a=()=>t.intersection,l=()=>{var u,f;(f=(u=t.disposers)==null?void 0:u.forEach)==null||f.call(u,h=>h==null?void 0:h()),o.off("intersectionOnModelUpdate",e),o.off("intersectionHidden",n)},c=l,d=(u,f)=>{const h=u.clone();return o.camera.position.clone().sub(h).setLength(f).add(h)};return{intersection:a,pointAxesHelper:s,movePointTowardsCamera:d,destroy:l,dispose:c,canSeePoint:r}},Yr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAA8CAYAAACZ1L+0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAYKADAAQAAAABAAAAPAAAAABU0H2EAAARRElEQVR4Ad2czY9cRZbFq1yFoQGDNCzwuAENohl54dkgdrNh34t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ka/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 Ur(o){i.append_styles(o,"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 Vr(o){let t,e,n=o[0].name+"",s,r,a,l,c;return{c(){t=i.element("div"),e=i.element("span"),s=i.text(n),r=i.space(),a=i.element("div"),i.attr(e,"class","room-label-item__text svelte-1d7uzh5"),i.set_style(e,"background-image","url("+Yr+")"),i.toggle_class(e,"wide",o[0].name.length>3),i.attr(a,"class","room-label-item__bar svelte-1d7uzh5"),i.attr(t,"class","room-label-item svelte-1d7uzh5"),i.set_style(t,"z-index",o[0].zIndex,!1),i.set_style(t,"transform",o[0].transform,!1),i.set_style(t,"opacity",o[0].visible?1:0,!1)},m(d,u){i.insert(d,t,u),i.append(t,e),i.append(e,s),i.append(t,r),i.append(t,a),l||(c=i.listen(e,"click",o[1]),l=!0)},p(d,[u]){u&1&&n!==(n=d[0].name+"")&&i.set_data(s,n),u&1&&i.toggle_class(e,"wide",d[0].name.length>3),u&1&&i.set_style(t,"z-index",d[0].zIndex,!1),u&1&&i.set_style(t,"transform",d[0].transform,!1),u&1&&i.set_style(t,"opacity",d[0].visible?1:0,!1)},i:i.noop,o:i.noop,d(d){d&&i.detach(t),l=!1,c()}}}function Jr(o,t,e){let{five:n}=t,{roomLabel:s}=t;function r(){n.setState({panoIndex:s.panoIndex,mode:"Panorama",longitude:s.longitude})}return o.$$set=a=>{"five"in a&&e(2,n=a.five),"roomLabel"in a&&e(0,s=a.roomLabel)},[s,r,n]}class Zr extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Jr,Vr,i.safe_not_equal,{five:2,roomLabel:0},Ur)}}const{Map:qr}=i.globals;function Kr(o){i.append_styles(o,"svelte-9eg4zi",".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}")}function Zn(o,t,e){const n=o.slice();return n[12]=t[e],n}function qn(o,t){let e,n,s;return n=new Zr({props:{roomLabel:t[12],five:t[1]}}),{key:o,first:null,c(){e=i.empty(),i.create_component(n.$$.fragment),this.first=e},m(r,a){i.insert(r,e,a),i.mount_component(n,r,a),s=!0},p(r,a){t=r;const l={};a&1&&(l.roomLabel=t[12]),a&2&&(l.five=t[1]),n.$set(l)},i(r){s||(i.transition_in(n.$$.fragment,r),s=!0)},o(r){i.transition_out(n.$$.fragment,r),s=!1},d(r){r&&i.detach(e),i.destroy_component(n,r)}}}function $r(o){let t,e=[],n=new qr,s,r,a=o[0];const l=c=>c[12].id;for(let c=0;c<a.length;c+=1){let d=Zn(o,a,c),u=l(d);n.set(u,e[c]=qn(u,d))}return{c(){t=i.element("div");for(let c=0;c<e.length;c+=1)e[c].c();i.attr(t,"class","room-labels-container svelte-9eg4zi"),i.add_render_callback(()=>o[6].call(t))},m(c,d){i.insert(c,t,d);for(let u=0;u<e.length;u+=1)e[u].m(t,null);s=i.add_resize_listener(t,o[6].bind(t)),r=!0},p(c,[d]){d&3&&(a=c[0],i.group_outros(),e=i.update_keyed_each(e,d,l,1,c,a,n,t,i.outro_and_destroy_block,qn,null,Zn),i.check_outros())},i(c){if(!r){for(let d=0;d<a.length;d+=1)i.transition_in(e[d]);r=!0}},o(c){for(let d=0;d<e.length;d+=1)i.transition_out(e[d]);r=!1},d(c){c&&i.detach(t);for(let d=0;d<e.length;d+=1)e[d].d();s()}}}function ea(o,t,e){var A;let n,{five:s}=t,{roomLabels:r}=t,a,l,c=(A=s.model.shownFloor)!=null?A:null;function d(b){if(!(c===null||b.floorIndex===c))return!1;const w=new M.Raycaster,y=s.camera.position.clone(),I=new M.Vector3(b.position.x,b.position.y,b.position.z),k=I.distanceTo(y);w.set(y.clone(),I.clone().sub(y).normalize());const[C]=s.model.intersectRaycaster(w);return!(C&&C.distance+1<k)}function u(b,v){const y=new M.Vector3(b.position.x,b.position.y,b.position.z).clone().project(s.camera),I=Math.ceil((y.x+1)/2*v.x),k=Math.ceil((-y.y+1)/2*v.y);return`translate(${I}px, ${k}px)`}function f(b){const{rendererSize:v,shownFloor:w}=b,y=new Map;function I(C){const D=y.get(C.id);if(D)return D;const{x,y:z,z:L}=C.position,T=new M.Vector3(x,z,L).clone().distanceTo(s.camera.position);return y.set(C.id,T),T}return r.map(C=>{const D=d(C),x=D?u(C,v):C.transform,z=I(C),T=r.filter(R=>R.visible&&I(R)<z).length*10;return V(j({},C),{visible:D,transform:x,zIndex:T})})}function h(){e(0,r=f({rendererSize:n,shownFloor:c}))}function p(b){e(4,c=b)}s.on("cameraUpdate",h),s.on("modelShownFloorChange",p),Z.onDestroy(()=>{s.off("cameraUpdate",h),s.off("modelShownFloorChange",p)});function g(){a=this.clientWidth,l=this.clientHeight,e(2,a),e(3,l)}return o.$$set=b=>{"five"in b&&e(1,s=b.five),"roomLabels"in b&&e(0,r=b.roomLabels)},o.$$.update=()=>{o.$$.dirty&12&&e(5,n={x:a,y:l}),o.$$.dirty&48&&e(0,r=f({rendererSize:n,shownFloor:c}))},[r,s,a,l,c,n,g]}class ta extends i.SvelteComponent{constructor(t){super(),i.init(this,t,ea,$r,i.safe_not_equal,{five:1,roomLabels:0},Kr)}}function na(o){return o.model_room_labels.map(({id:t,pano_index:e,floor_index:n,name:s,position:r,longitude:a})=>({id:t,name:s,position:r,longitude:a,panoIndex:e,floorIndex:n,zIndex:0,visible:!1,transform:""}))}class ia{constructor(t){m(this,"five");m(this,"enabled",!0);m(this,"fiveModeEnabled");m(this,"app");m(this,"wrapper");m(this,"roomLabels",[]);m(this,"container",document.createElement("div"));m(this,"onFiveModeChange",t=>{if(t!=="Floorplan"){this.fiveModeEnabled=!1,this.render();return}this.five.once("initAnimationEnded",()=>{this.fiveModeEnabled=this.five.currentMode==="Floorplan",this.render()})});this.five=t,this.fiveModeEnabled=this.five.currentMode==="Floorplan",this.container.classList.add("model-room-label-plugin-container"),this.container.style.width="100%",this.container.style.height="100%",this.container.style.position="absolute",this.container.style.pointerEvents="none",this.container.style.left="0",this.container.style.top="0",this.container.style.zIndex="5",this.five.once("dispose",()=>this.dispose()),this.five.on("modeChange",this.onFiveModeChange),this.render()}dispose(){this.five.off("modeChange",this.onFiveModeChange),this.container.remove()}load(t){this.roomLabels=na(t),this.render()}appendTo(t){return this.wrapper=t,t.appendChild(this.container),this.render(),this}disable(){return this.enabled=!1,this.render(),this}enable(){return this.enabled=!0,this.render(),this}render(){var t;if(!!this.wrapper){if(!this.enabled||!this.fiveModeEnabled){(t=this.app)==null||t.$destroy(),this.app=void 0;return}this.app?this.app.$set({five:this.five,roomLabels:this.roomLabels}):this.app=new ta({target:this.container,props:{five:this.five,roomLabels:this.roomLabels}})}}}const oa=o=>new ia(o),sa={name:"ModelRoomLabelPlugin",version:0};var je=(o=>(o[o.FLOOR=1]="FLOOR",o[o.CEILING=2]="CEILING",o[o.BOUNDING_CENTER=3]="BOUNDING_CENTER",o))(je||{});function jt(o){return F(this,null,function*(){try{return[null,yield o]}catch(t){return t instanceof Error?[t,null]:[new Error(""),null]}})}function Bt(o){return Object.prototype.toString.call(o)==="[object Object]"}function Gt(o,t){return o===t?!0:typeof o!=typeof t?!1:!!(Number.isNaN(o)&&Number.isNaN(t))}function ra(o,t){const e=Object.getOwnPropertyNames(o),n=Object.getOwnPropertyNames(t);if(e.length!==n.length)return!1;for(let s=0,r=e.length;s<r;s++){const a=e[s];if(!Gt(o[a],t[a]))return!1}return!0}function aa(o,t){if(o.length!==t.length)return!1;for(let e=0,n=o.length;e<n;e++)if(!Gt(o[e],t[e]))return!1;return!0}function la(o,t){return Gt(o,t)?!0:Bt(o)&&Bt(t)?ra(o,t):Array.isArray(o)&&Array.isArray(t)?aa(o,t):!1}function xn(o,t){return Gt(o,t)?!0:Bt(o)&&Bt(t)?da(o,t):Array.isArray(o)&&Array.isArray(t)?ca(o,t):!1}function ca(o,t){if(o.length!==t.length)return!1;for(let e=0,n=o.length;e<n;e++)if(!xn(o[e],t[e]))return!1;return!0}function da(o,t){const e=Object.getOwnPropertyNames(o),n=Object.getOwnPropertyNames(t);if(e.length!==n.length)return!1;for(let s=0,r=e.length;s<r;s++){const a=e[s];if(!xn(o[a],t[a]))return!1}return!0}function Ce(o,t,e={deep:!1}){return e.deep?xn(o,t):la(o,t)}const Be="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+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cnhOrd28HBlmj+2LFZWia9KjkqnHoa3BmsjG7wKIgDuSzQw9F29Gh+3jDunTseWas1zKtKYbiIsrEjZdAF2iPiYOvIz+Nyuebm5h6+HuvGa2xU0qhwBbkzayzjDO8y3IwgbAdHPp87zNx8sIvLYN/tvhc1TF1lWqSEwaMWgG3ABpIB4sC2HY2Ei0sf0O2YmLWr1CdQGRYp8SK3ic/ZnRWMLqQ+2xGRwUD069dvV8zcuRom+rlA6Y2MbgGmhAGEz4VYSPQF5cyZM6GFYl6eTlN6ixi6aE6PqDLQZRi4EKI/KOfGFjUzqCKsXu6l2RpuAKJxiI1tHhcQJAYOHDhgwOZZs4ZSTHR5lQQYPDW1DS4aELQxdyEIAANGjtk8c6aaqTslk8gVwIAN0w3rAEL2bMtHm12AIOHqenXaNDWztEwo9hKJGHjR6OO0yDSI1IGdoQ0iY0a6Tt+06fKUDRQzqKw8Qlxr1AXrwNqwDvGBA+BrGUDc3d3Xr5+SQZj0E2ERqXIjPAJYNUbD18FoWEeDbHLPzLyQ4ePjQ5i3x1RCubfmpqkjMMNo6KOJ5uqe+f58C9GoaD29XyVSYS1h4DftKeWDDN4AbACZMZAsExEKghWUNKXWhlPfA2P1qjmUT556a9jmQotWi/VOFael1lR7ep4JfRZy8nhpwtG4wMMB/gdi9/nNH+vhezsmJ+fG5quX12fomHl6J+KFy88uA2RJyJPE4wkL4wIPBfgXxO5HxGN7zNw5W2bNnLZhio+OmaR3LD6tplrLfKeYAwX7/O6Dje/2dpniwuKiwoMHH+bn7723Z8/uHTu2fpg9+3p29sYrWVnr1l1cO2HCUFCGT+tshUcWLPj6IDf37ued27Z9unXz2owZU6dOnnxp4sQ1q1ePH79KN6vbQWc1SrfrTit6lO5NO6/F8yZNmofBfgNTwRQLsPLsHQAAAABJRU5ErkJggg==";function ua(o){return o*180/Math.PI}function ha(o){i.append_styles(o,"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 fa(o){let t,e;return{c(){t=i.element("div"),e=i.element("div"),i.attr(e,"class","floorplan__camera-rotate svelte-17cl35n"),i.set_style(e,"background-image",`url(${o[0]||Be})`),i.set_style(e,"width",o[4],!1),i.set_style(e,"height",o[4],!1),i.set_style(e,"left","-"+o[4],!1),i.set_style(e,"top","-"+o[4],!1),i.set_style(e,"transform",`rotate(${o[3]}deg)`,!1),i.set_style(e,"transform-origin",`${o[4]} ${o[4]}`,!1),i.attr(t,"class","floorplan__camera-position svelte-17cl35n"),i.set_style(t,"left",o[1],!1),i.set_style(t,"top",o[2],!1)},m(n,s){i.insert(n,t,s),i.append(t,e)},p(n,[s]){s&1&&i.set_style(e,"background-image",`url(${n[0]||Be})`)},i:i.noop,o:i.noop,d(n){n&&i.detach(t)}}}function ma(o,t,e){let{panoIndex:n}=t,{floorplanData:s}=t,{lastPanoramaLongitude:r}=t,{cameraImageUrl:a}=t;const{observers:l}=s,c=l[n],d=c.positionInImage.x,u=c.positionInImage.y,f=d*100+"%",h=u*100+"%",p=-ua(r)+45,g=document.body.clientWidth,A=document.body.clientHeight,v=`${(g<500||A<500?17:37)/16}rem`;return o.$$set=w=>{"panoIndex"in w&&e(5,n=w.panoIndex),"floorplanData"in w&&e(6,s=w.floorplanData),"lastPanoramaLongitude"in w&&e(7,r=w.lastPanoramaLongitude),"cameraImageUrl"in w&&e(0,a=w.cameraImageUrl)},[a,f,h,p,v,n,s,r]}class pa extends i.SvelteComponent{constructor(t){super(),i.init(this,t,ma,fa,i.safe_not_equal,{panoIndex:5,floorplanData:6,lastPanoramaLongitude:7,cameraImageUrl:0},ha)}}const ga="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+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8AtSnix59eOmYAAAAASUVORK5CYII=";function Aa(o){i.append_styles(o,"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 va(o){let t,e,n,s,r;return{c(){t=i.element("div"),e=i.element("div"),n=i.space(),s=i.element("span"),r=i.text(o[0]),i.attr(e,"class","floorplan-plugin__compass-image svelte-rpkaro"),i.set_style(e,"background-image",`url(${ga})`),i.attr(s,"class","floorplan-plugin__compass-text svelte-rpkaro"),i.attr(t,"class","floorplan-plugin__compass svelte-rpkaro"),i.set_style(t,"transform",o[2],!1)},m(a,l){i.insert(a,t,l),i.append(t,e),i.append(t,n),i.append(t,s),i.append(s,r)},p(a,l){l&1&&i.set_data(r,a[0])},d(a){a&&i.detach(t)}}}function ba(o){let t,e=o[1]&&va(o);return{c(){e&&e.c(),t=i.empty()},m(n,s){e&&e.m(n,s),i.insert(n,t,s)},p(n,[s]){n[1]&&e.p(n,s)},i:i.noop,o:i.noop,d(n){e&&e.d(n),n&&i.detach(t)}}}function ya(o){return o/Math.PI*180}function wa(o,t,e){var d;let{floorplanData:n}=t,{northDesc:s}=t;const r=(d=n.entrance)==null?void 0:d.northRad,a=typeof r=="number",c=`translateX(-50%) translateZ(10px) rotate(${-(r?ya(r):0)+90}deg)`;return o.$$set=u=>{"floorplanData"in u&&e(3,n=u.floorplanData),"northDesc"in u&&e(0,s=u.northDesc)},[s,a,c,n]}class Ca extends i.SvelteComponent{constructor(t){super(),i.init(this,t,wa,ba,i.safe_not_equal,{floorplanData:3,northDesc:0},Aa)}}function Ea(o){i.append_styles(o,"svelte-1gfoniz","img.svelte-1gfoniz{width:100%;height:100%}")}function Pa(o){let t,e;return{c(){t=i.element("img"),i.src_url_equal(t.src,e=o[0])||i.attr(t,"src",e),i.attr(t,"alt","floorplan iamge"),i.attr(t,"class","svelte-1gfoniz")},m(n,s){i.insert(n,t,s)},p(n,[s]){s&1&&!i.src_url_equal(t.src,e=n[0])&&i.attr(t,"src",e)},i:i.noop,o:i.noop,d(n){n&&i.detach(t)}}}function Ia(o,t,e){let{url:n}=t;return o.$$set=s=>{"url"in s&&e(0,n=s.url)},[n]}class ka extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Ia,Pa,i.safe_not_equal,{url:0},Ea)}}function xa(o){i.append_styles(o,"svelte-ub47ya",".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}")}function Da(o){let t,e,n,s;return{c(){t=i.element("div"),e=new i.HtmlTag(!1),n=i.space(),s=new i.HtmlTag(!1),e.a=n,s.a=null,i.attr(t,"class","floorplan-plugin__base-image svelte-ub47ya")},m(r,a){i.insert(r,t,a),e.m(o[1],t),i.append(t,n),s.m(o[0],t)},p(r,[a]){a&1&&s.p(r[0])},i:i.noop,o:i.noop,d(r){r&&i.detach(t)}}}function Sa(o,t,e){let{content:n}=t;const s=`
|
|
102
102
|
<style>
|
|
103
103
|
svg [type='lineGroup'] path {
|
|
104
104
|
fill: #ffffff;
|
|
@@ -107,7 +107,7 @@ transition: all 500ms;
|
|
|
107
107
|
svg [type='lineItemGroup'] g g g g {
|
|
108
108
|
stroke: #ffffff;
|
|
109
109
|
}</style>
|
|
110
|
-
`;return o.$$set=r=>{"content"in r&&e(0,n=r.content)},[n,s]}class La extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Sa,Da,i.safe_not_equal,{content:0},xa)}}function _a(o){i.append_styles(o,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function za(o){let t,e;return t=new ka({props:{url:o[1].url}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&2&&(r.url=n[1].url),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function Ma(o){let t,e;return t=new La({props:{content:o[0]}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&1&&(r.content=n[0]),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function Ta(o){let t,e,n,s;const r=[Ma,za],a=[];function l(c,d){return c[0]?0:c[1]?1:-1}return~(e=l(o))&&(n=a[e]=r[e](o)),{c(){t=i.element("div"),n&&n.c(),i.attr(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(c,d){i.insert(c,t,d),~e&&a[e].m(t,null),s=!0},p(c,[d]){let u=e;e=l(c),e===u?~e&&a[e].p(c,d):(n&&(i.group_outros(),i.transition_out(a[u],1,1,()=>{a[u]=null}),i.check_outros()),~e?(n=a[e],n?n.p(c,d):(n=a[e]=r[e](c),n.c()),i.transition_in(n,1),n.m(t,null)):n=null)},i(c){s||(i.transition_in(n),s=!0)},o(c){i.transition_out(n),s=!1},d(c){c&&i.detach(t),~e&&a[e].d()}}}function ja(o,t,e){let n,s,{floorIndex:r}=t,{floorplanData:a}=t;return o.$$set=l=>{"floorIndex"in l&&e(2,r=l.floorIndex),"floorplanData"in l&&e(3,a=l.floorplanData)},o.$$.update=()=>{var l,c;o.$$.dirty&12&&e(1,n=a.outlines[r]),o.$$.dirty&12&&e(0,s=(c=(l=a.outlines)==null?void 0:l[r])==null?void 0:c.svgContent)},[s,n,r,a]}class vs extends i.SvelteComponent{constructor(t){super(),i.init(this,t,ja,Ta,i.safe_not_equal,{floorIndex:2,floorplanData:3},_a)}}function Ba(o){i.append_styles(o,"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 Qa(o){let t,e=o[4].outerHTML+"",n;return{c(){t=new i.HtmlTag(!1),n=i.empty(),t.a=n},m(s,r){t.m(e,s,r),i.insert(s,n,r)},p(s,r){r&16&&e!==(e=s[4].outerHTML+"")&&t.p(e)},d(s){s&&i.detach(n),s&&t.d()}}}function Ra(o){let t,e=o[0].name+"",n,s,r,a;return{c(){t=i.element("span"),n=i.text(e),s=i.space(),r=i.element("span"),a=i.text(o[5]),i.attr(t,"class","floorplan-plugin__room-name"),i.attr(r,"class","floorplan-plugin__room-size svelte-12pzct5")},m(l,c){i.insert(l,t,c),i.append(t,n),i.insert(l,s,c),i.insert(l,r,c),i.append(r,a)},p(l,c){c&1&&e!==(e=l[0].name+"")&&i.set_data(n,e),c&32&&i.set_data(a,l[5])},d(l){l&&i.detach(t),l&&i.detach(s),l&&i.detach(r)}}}function Oa(o){let t;function e(r,a){if(r[1]===void 0)return Ra;if(r[4])return Qa}let n=e(o),s=n&&n(o);return{c(){t=i.element("div"),s&&s.c(),i.attr(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),i.set_style(t,"left",o[6],!1),i.set_style(t,"top",o[7],!1),i.set_style(t,"font-size",o[8],!1),i.set_style(t,"opacity",o[3]?"1":"0",!1)},m(r,a){i.insert(r,t,a),s&&s.m(t,null),o[16](t)},p(r,[a]){n===(n=e(r))&&s?s.p(r,a):(s&&s.d(1),s=n&&n(r),s&&(s.c(),s.m(t,null))),a&8&&i.set_style(t,"opacity",r[3]?"1":"0",!1)},i:i.noop,o:i.noop,d(r){r&&i.detach(t),s&&s.d(),o[16](null)}}}function Ha(o,t){const e=o[0],n=o[1];let s=!1;for(let r=0,a=t.length-1;r<t.length;a=r++){const l=t[r][0],c=t[r][1],d=t[a][0],u=t[a][1];c>n!=u>n&&e<(d-l)*(n-c)/(u-c)+l&&(s=!s)}return s}function Fa(o,t,e){let n,s,r,a,{pxmm:l}=t,{room:c}=t,{hoveredRoom:d}=t,{getRoomAreaText:u}=t,{getLabelElement:f}=t,{adaptiveRoomLabelVisibleEnable:h}=t;function p(x,z){if(z.width===0||z.height===0)return()=>!1;const _=x.path.map(({x:G,y:Q})=>[G,Q]),T=x.roomLabel.position,{x:H,y:E}=T,{width:S,height:L}=z,B=S/2,R=L/2;return function(Q){const O=H*Q,X=E*Q,Y=_.map(([te,oe])=>[te*Q,oe*Q]);return[[O+B,X-R],[O-B,X-R],[O-B,X+R],[O+B,X+R]].every(te=>Ha(te,Y))}}const g=document.body.clientWidth,A=document.body.clientHeight,b=c.roomLabel,v=b.positionInImage.x*100+"%",w=b.positionInImage.y*100+"%",y=(g<500||A<500?10:14)/16+"rem";let I=!1,k,C;d.subscribe(function(z){e(13,I=!!z&&z.id===c.id)}),Z.onMount(()=>{const x=k==null?void 0:k.getClientRects()[0];e(14,C={width:x.width,height:x.height})});function D(x){i.binding_callbacks[x?"unshift":"push"](()=>{k=x,e(2,k)})}return o.$$set=x=>{"pxmm"in x&&e(9,l=x.pxmm),"room"in x&&e(0,c=x.room),"hoveredRoom"in x&&e(10,d=x.hoveredRoom),"getRoomAreaText"in x&&e(11,u=x.getRoomAreaText),"getLabelElement"in x&&e(1,f=x.getLabelElement),"adaptiveRoomLabelVisibleEnable"in x&&e(12,h=x.adaptiveRoomLabelVisibleEnable)},o.$$.update=()=>{o.$$.dirty&2049&&e(5,n=c.size?u(c.size):""),o.$$.dirty&16385&&e(15,s=C?p(c,C):void 0),o.$$.dirty&3&&e(4,r=f==null?void 0:f(c)),o.$$.dirty&45568&&e(3,a=h?I?!0:!!(s!=null&&s(l)):!0)},[c,f,k,a,r,n,v,w,y,l,d,u,h,I,C,s,D]}class Ga extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Fa,Oa,i.safe_not_equal,{pxmm:9,room:0,hoveredRoom:10,getRoomAreaText:11,getLabelElement:1,adaptiveRoomLabelVisibleEnable:12},Ba)}}function Na(o){i.append_styles(o,"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 Kn(o,t,e){const n=o.slice();return n[10]=t[e],n}function $n(o){let t,e=[],n=new Map,s,r,a=o[6];const l=c=>c[10].id;for(let c=0;c<a.length;c+=1){let d=Kn(o,a,c),u=l(d);n.set(u,e[c]=ei(u,d))}return{c(){t=i.element("div");for(let c=0;c<e.length;c+=1)e[c].c();i.attr(t,"class","floorplan-plugin__room-labels svelte-13xux0b"),i.add_render_callback(()=>o[9].call(t))},m(c,d){i.insert(c,t,d);for(let u=0;u<e.length;u+=1)e[u].m(t,null);s=i.add_resize_listener(t,o[9].bind(t)),r=!0},p(c,d){d&111&&(a=c[6],i.group_outros(),e=i.update_keyed_each(e,d,l,1,c,a,n,t,i.outro_and_destroy_block,ei,null,Kn),i.check_outros())},i(c){if(!r){for(let d=0;d<a.length;d+=1)i.transition_in(e[d]);r=!0}},o(c){for(let d=0;d<e.length;d+=1)i.transition_out(e[d]);r=!1},d(c){c&&i.detach(t);for(let d=0;d<e.length;d+=1)e[d].d();s()}}}function ei(o,t){let e,n,s;const r=[{pxmm:t[5],room:t[10],getLabelElement:t[2],getRoomAreaText:t[1],hoveredRoom:t[0],adaptiveRoomLabelVisibleEnable:t[3]}];let a={};for(let l=0;l<r.length;l+=1)a=i.assign(a,r[l]);return n=new Ga({props:a}),{key:o,first:null,c(){e=i.empty(),i.create_component(n.$$.fragment),this.first=e},m(l,c){i.insert(l,e,c),i.mount_component(n,l,c),s=!0},p(l,c){t=l;const d=c&111?i.get_spread_update(r,[{pxmm:t[5],room:t[10],getLabelElement:t[2],getRoomAreaText:t[1],hoveredRoom:t[0],adaptiveRoomLabelVisibleEnable:t[3]}]):{};n.$set(d)},i(l){s||(i.transition_in(n.$$.fragment,l),s=!0)},o(l){i.transition_out(n.$$.fragment,l),s=!1},d(l){l&&i.detach(e),i.destroy_component(n,l)}}}function Wa(o){let t,e,n=o[6]&&$n(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[6]?n?(n.p(s,r),r&64&&i.transition_in(n,1)):(n=$n(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function Xa(o,t,e){let n,{floorIndex:s}=t,{floorplanData:r}=t,{hoveredRoom:a}=t,{getRoomAreaText:l}=t,{getLabelElement:c}=t,{adaptiveRoomLabelVisibleEnable:d}=t,u=0,f=0;function h(){u=this.clientWidth,e(4,u)}return o.$$set=p=>{"floorIndex"in p&&e(7,s=p.floorIndex),"floorplanData"in p&&e(8,r=p.floorplanData),"hoveredRoom"in p&&e(0,a=p.hoveredRoom),"getRoomAreaText"in p&&e(1,l=p.getRoomAreaText),"getLabelElement"in p&&e(2,c=p.getLabelElement),"adaptiveRoomLabelVisibleEnable"in p&&e(3,d=p.adaptiveRoomLabelVisibleEnable)},o.$$.update=()=>{if(o.$$.dirty&384&&e(6,n=r.floorDatas[s].rooms),o.$$.dirty&272){const{max:p,min:g}=r.bounding,A=p.x-g.x;e(5,f=u/A)}},[a,l,c,d,u,f,n,s,r,h]}class Ya extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Xa,Wa,i.safe_not_equal,{floorIndex:7,floorplanData:8,hoveredRoom:0,getRoomAreaText:1,getLabelElement:2,adaptiveRoomLabelVisibleEnable:3},Na)}}function Ua(o){i.append_styles(o,"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 ti(o,t,e){const n=o.slice();return n[11]=t[e],n[13]=e,n}function ni(o,t,e){const n=o.slice();return n[14]=t[e],n}function ii(o){let t;return{c(){t=i.element("div"),i.attr(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),i.set_style(t,"left",o[14].left*100+"%",!1),i.set_style(t,"bottom",o[14].bottom*100+"%",!1)},m(e,n){i.insert(e,t,n)},p:i.noop,d(e){e&&i.detach(t)}}}function oi(o,t){let e,n,s=t[1](t[11].distance)+"",r,a;return{key:o,first:null,c(){e=i.element("div"),n=i.element("div"),r=i.text(s),a=i.space(),i.attr(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),i.toggle_class(n,"is-row",t[2]),i.attr(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),i.set_style(e,"left",t[11].left*100+"%",!1),i.set_style(e,"bottom",t[11].bottom*100+"%",!1),this.first=e},m(l,c){i.insert(l,e,c),i.append(e,n),i.append(n,r),i.append(e,a)},p(l,c){t=l,c&2&&s!==(s=t[1](t[11].distance)+"")&&i.set_data(r,s)},d(l){l&&i.detach(e)}}}function Va(o){let t,e,n,s,r,a,l=[],c=new Map,d,u=o[3],f=[];for(let g=0;g<u.length;g+=1)f[g]=ii(ni(o,u,g));let h=o[4];const p=g=>g[13];for(let g=0;g<h.length;g+=1){let A=ti(o,h,g),b=p(A);c.set(b,l[g]=oi(b,A))}return{c(){t=i.element("div"),e=i.element("div"),n=i.space(),s=i.element("div");for(let g=0;g<f.length;g+=1)f[g].c();r=i.space(),a=i.element("div");for(let g=0;g<l.length;g+=1)l[g].c();i.attr(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),i.attr(s,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),i.toggle_class(s,"is-row",o[2]),i.attr(a,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),i.attr(t,"class",d="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+o[0]+" svelte-djlmk4"),i.toggle_class(t,"is-row",o[2]),i.set_style(t,"width",o[2]?"100%":1/16+"rem",!1),i.set_style(t,"height",o[2]?1/16+"rem":"100%",!1)},m(g,A){i.insert(g,t,A),i.append(t,e),i.append(t,n),i.append(t,s);for(let b=0;b<f.length;b+=1)f[b].m(s,null);i.append(t,r),i.append(t,a);for(let b=0;b<l.length;b+=1)l[b].m(a,null)},p(g,[A]){if(A&8){u=g[3];let b;for(b=0;b<u.length;b+=1){const v=ni(g,u,b);f[b]?f[b].p(v,A):(f[b]=ii(v),f[b].c(),f[b].m(s,null))}for(;b<f.length;b+=1)f[b].d(1);f.length=u.length}A&22&&(h=g[4],l=i.update_keyed_each(l,A,p,1,g,h,c,a,i.destroy_block,oi,null,ti)),A&1&&d!==(d="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+g[0]+" svelte-djlmk4")&&i.attr(t,"class",d),A&5&&i.toggle_class(t,"is-row",g[2])},i:i.noop,o:i.noop,d(g){g&&i.detach(t),i.destroy_each(f,g);for(let A=0;A<l.length;A+=1)l[A].d()}}}const Ke=1e3,$e=180;function Ja(o,t,e){let{type:n}=t,{data:s}=t,{bounding:r}=t,{getRuleDistanceText:a}=t;const l=n==="top"||n==="bottom",c=r.max.x-r.min.x-(Ke-$e)*2,d=r.max.y-r.min.y-(Ke-$e)*2,u=s.map(([g,A])=>l?[g.x,A.x]:[g.y,A.y]).flat().sort().filter((g,A,b)=>A===0?!0:g!==b[A-1]),f=u.map(g=>{const A=l?(g-r.min.x-Ke+$e)/c:0,b=l?0:(g-r.min.y-Ke+$e)/d;return{left:A,bottom:b}});f.unshift({left:0,bottom:0}),f.push(l?{left:1,bottom:0}:{left:0,bottom:1});const h=u[u.length-1]-u[0],p=u.map((g,A,b)=>{const v=A===0?0:g-b[A-1],w=A===0?0:(g+b[A-1])/2,y=l?(w-r.min.x-Ke+$e)/c:0,I=l?0:(w-r.min.y-Ke+$e)/d;return{left:y,bottom:I,distance:v}}).filter(({distance:g})=>g/h>.1);return o.$$set=g=>{"type"in g&&e(0,n=g.type),"data"in g&&e(5,s=g.data),"bounding"in g&&e(6,r=g.bounding),"getRuleDistanceText"in g&&e(1,a=g.getRuleDistanceText)},[n,a,l,f,p,s,r]}class Za extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Ja,Va,i.safe_not_equal,{type:0,data:5,bounding:6,getRuleDistanceText:1},Ua)}}function qa(o){i.append_styles(o,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function si(o,t,e){const n=o.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function ri(o,t){let e,n,s;const r=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let a={};for(let l=0;l<r.length;l+=1)a=i.assign(a,r[l]);return n=new Za({props:a}),{key:o,first:null,c(){e=i.empty(),i.create_component(n.$$.fragment),this.first=e},m(l,c){i.insert(l,e,c),i.mount_component(n,l,c),s=!0},p(l,c){t=l;const d=c&19?i.get_spread_update(r,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(d)},i(l){s||(i.transition_in(n.$$.fragment,l),s=!0)},o(l){i.transition_out(n.$$.fragment,l),s=!1},d(l){l&&i.detach(e),i.destroy_component(n,l)}}}function Ka(o){let t,e=[],n=new Map,s,r=o[4];const a=l=>l[13];for(let l=0;l<r.length;l+=1){let c=si(o,r,l),d=a(c);n.set(d,e[l]=ri(d,c))}return{c(){t=i.element("div");for(let l=0;l<e.length;l+=1)e[l].c();i.attr(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),i.set_style(t,"width",o[3],!1),i.set_style(t,"height",o[2],!1)},m(l,c){i.insert(l,t,c);for(let d=0;d<e.length;d+=1)e[d].m(t,null);s=!0},p(l,[c]){c&19&&(r=l[4],i.group_outros(),e=i.update_keyed_each(e,c,a,1,l,r,n,t,i.outro_and_destroy_block,ri,null,si),i.check_outros()),c&8&&i.set_style(t,"width",l[3],!1),c&4&&i.set_style(t,"height",l[2],!1)},i(l){if(!s){for(let c=0;c<r.length;c+=1)i.transition_in(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)i.transition_out(e[c]);s=!1},d(l){l&&i.detach(t);for(let c=0;c<e.length;c+=1)e[c].d()}}}const ai=1e3,li=180;function $a(o,t,e){let n,s,r,a,l,c,d,u,f,h,{floorIndex:p}=t,{floorplanData:g}=t,{getRuleDistanceText:A}=t;return o.$$set=b=>{"floorIndex"in b&&e(5,p=b.floorIndex),"floorplanData"in b&&e(6,g=b.floorplanData),"getRuleDistanceText"in b&&e(0,A=b.getRuleDistanceText)},o.$$.update=()=>{o.$$.dirty&64&&e(1,n=g.bounding),o.$$.dirty&96&&e(11,s=g.floorDatas[p].rules),o.$$.dirty&2048&&e(12,r=Object.keys(s)),o.$$.dirty&6144&&e(4,a=r.map(b=>[b,s[b]])),o.$$.dirty&2&&e(9,l=n.max.x-n.min.x),o.$$.dirty&2&&e(7,c=n.max.y-n.min.y),o.$$.dirty&2&&e(10,d=n.max.x-n.min.x-(ai-li)*2),o.$$.dirty&2&&e(8,u=n.max.y-n.min.y-(ai-li)*2),o.$$.dirty&1536&&e(3,f=d/l*100+"%"),o.$$.dirty&384&&e(2,h=u/c*100+"%")},[A,n,h,f,a,p,g,c,u,l,d,s,r]}class el extends i.SvelteComponent{constructor(t){super(),i.init(this,t,$a,Ka,i.safe_not_equal,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},qa)}}function Nt(o,t={}){let e="";const{needZ:n,needA:s}=t;return(n?o.slice().concat(o[0]):o.slice()).forEach((a,l)=>{const{x:c,y:d}=t.format?t.format(a):a,u=c+","+d;return l===0?(e+="M"+u,e):s!=null&&s[l]?(e+="A"+s[l]+","+u,e):(e+="L"+u,e)}),e+(n?"Z":"")}function bs({x:o,y:t},e){const{max:n,min:s}=e;return{x:o-s.x,y:n.y-t}}function tl(o,t){const e=o.x*1e3+t.bounding.origin.x,n=-o.z*1e3+t.bounding.origin.y;return{x:e,y:n}}function nl(o,t){const e=t.bounding,n=e.max.x-e.min.x,s=e.max.y-e.min.y;return{x:(o.x-e.min.x)/n,y:(e.max.y-o.y)/s}}function il(o,t){return Math.max(...t.work.observers.map(n=>o.z>=n.standingPosition.z?n.floorIndex:0))}function ol(o){let t;return{c(){t=i.svg_element("path"),i.attr(t,"d",o[0]),i.attr(t,"fill","#2F313A")},m(e,n){i.insert(e,t,n)},p(e,[n]){n&1&&i.attr(t,"d",e[0])},i:i.noop,o:i.noop,d(e){e&&i.detach(t)}}}function sl(o,t,e){let n,{path:s}=t;return o.$$set=r=>{"path"in r&&e(1,s=r.path)},o.$$.update=()=>{o.$$.dirty&2&&e(0,n=Nt(s,{needZ:!0}))},[n,s]}class rl extends i.SvelteComponent{constructor(t){super(),i.init(this,t,sl,ol,i.safe_not_equal,{path:1})}}function al(o){let t,e,n,s,r,a;return{c(){t=i.svg_element("defs"),e=i.svg_element("pattern"),n=i.svg_element("rect"),s=i.svg_element("path"),r=i.space(),a=i.svg_element("path"),i.attr(n,"x","0"),i.attr(n,"y","0"),i.attr(n,"width",o[1]),i.attr(n,"height",o[1]),i.attr(n,"fill","#323747"),i.attr(s,"d",o[2]),i.attr(s,"stroke","#ffffff"),i.attr(s,"stroke-opacity","0.06"),i.attr(s,"stroke-width","0.5"),i.attr(s,"fill","none"),i.attr(e,"id","fpm-room-pattern-0"),i.attr(e,"x","0"),i.attr(e,"y","0"),i.attr(e,"width",o[1]),i.attr(e,"height",o[1]),i.attr(e,"patternUnits","userSpaceOnUse"),i.attr(e,"patternTransform","scale(50 50)"),i.attr(a,"d",o[0]),i.attr(a,"fill","url(#fpm-room-pattern-0)")},m(l,c){i.insert(l,t,c),i.append(t,e),i.append(e,n),i.append(e,s),i.insert(l,r,c),i.insert(l,a,c)},p(l,[c]){c&1&&i.attr(a,"d",l[0])},i:i.noop,o:i.noop,d(l){l&&i.detach(t),l&&i.detach(r),l&&i.detach(a)}}}const en=6;function ll(o,t,e){let n,{path:s}=t;const r=en*2,a=`M0 ${en} h ${r} M${en} 0 v ${r}`;return o.$$set=l=>{"path"in l&&e(3,s=l.path)},o.$$.update=()=>{o.$$.dirty&8&&e(0,n=Nt(s,{needZ:!0}))},[n,r,a,s]}class cl extends i.SvelteComponent{constructor(t){super(),i.init(this,t,ll,al,i.safe_not_equal,{path:3})}}function dl(o){let t,e,n,s,r,a,l,c,d,u,f;return{c(){t=i.svg_element("defs"),e=i.svg_element("pattern"),n=i.svg_element("rect"),s=i.svg_element("pattern"),r=i.svg_element("rect"),a=i.space(),l=i.svg_element("path"),c=i.space(),d=i.svg_element("path"),u=i.space(),f=i.svg_element("path"),i.attr(n,"x","0"),i.attr(n,"y","0"),i.attr(n,"width","6"),i.attr(n,"height","50"),i.attr(n,"fill","none"),i.attr(n,"stroke","#4B4B57"),i.attr(n,"stroke-width","0.5"),i.attr(e,"id","room-material-pattern-1"),i.attr(e,"x","0"),i.attr(e,"y","0"),i.attr(e,"width","12"),i.attr(e,"height","50"),i.attr(e,"patternUnits","userSpaceOnUse"),i.attr(e,"patternTransform","scale(50 50)"),i.attr(r,"x","0"),i.attr(r,"y","0"),i.attr(r,"width","6"),i.attr(r,"height","50"),i.attr(r,"fill","none"),i.attr(r,"stroke","#4B4B57"),i.attr(r,"stroke-width","0.5"),i.attr(s,"id","room-material-pattern-2"),i.attr(s,"x","6"),i.attr(s,"y","25"),i.attr(s,"width","12"),i.attr(s,"height","50"),i.attr(s,"patternUnits","userSpaceOnUse"),i.attr(s,"patternTransform","scale(50 50)"),i.attr(l,"d",o[0]),i.attr(l,"fill","#43434D"),i.attr(d,"d",o[0]),i.attr(d,"fill","url(#room-material-pattern-1)"),i.attr(f,"d",o[0]),i.attr(f,"fill","url(#room-material-pattern-2)")},m(h,p){i.insert(h,t,p),i.append(t,e),i.append(e,n),i.append(t,s),i.append(s,r),i.insert(h,a,p),i.insert(h,l,p),i.insert(h,c,p),i.insert(h,d,p),i.insert(h,u,p),i.insert(h,f,p)},p(h,[p]){p&1&&i.attr(l,"d",h[0]),p&1&&i.attr(d,"d",h[0]),p&1&&i.attr(f,"d",h[0])},i:i.noop,o:i.noop,d(h){h&&i.detach(t),h&&i.detach(a),h&&i.detach(l),h&&i.detach(c),h&&i.detach(d),h&&i.detach(u),h&&i.detach(f)}}}function ul(o,t,e){let n,{path:s}=t;return o.$$set=r=>{"path"in r&&e(1,s=r.path)},o.$$.update=()=>{o.$$.dirty&2&&e(0,n=Nt(s,{needZ:!0}))},[n,s]}class hl extends i.SvelteComponent{constructor(t){super(),i.init(this,t,ul,dl,i.safe_not_equal,{path:1})}}function fl(o){i.append_styles(o,"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 ci(o,t,e){const n=o.slice();return n[5]=t[e],n}function ml(o){let t,e;return t=new cl({props:{path:o[5].path}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&1&&(r.path=n[5].path),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function pl(o){let t,e;return t=new hl({props:{path:o[5].path}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&1&&(r.path=n[5].path),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function gl(o){let t,e;return t=new rl({props:{path:o[5].path}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&1&&(r.path=n[5].path),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function di(o){let t,e,n,s;const r=[gl,pl,ml],a=[];function l(c,d){return c[5].floorType===1?0:c[5].floorType===0?1:2}return e=l(o),n=a[e]=r[e](o),{c(){t=i.svg_element("svg"),n.c(),i.attr(t,"width","100%"),i.attr(t,"height","100%"),i.attr(t,"viewBox",`0 0 ${o[1]} ${o[2]}`),i.attr(t,"class","svelte-1dykexu")},m(c,d){i.insert(c,t,d),a[e].m(t,null),s=!0},p(c,d){let u=e;e=l(c),e===u?a[e].p(c,d):(i.group_outros(),i.transition_out(a[u],1,1,()=>{a[u]=null}),i.check_outros(),n=a[e],n?n.p(c,d):(n=a[e]=r[e](c),n.c()),i.transition_in(n,1),n.m(t,null))},i(c){s||(i.transition_in(n),s=!0)},o(c){i.transition_out(n),s=!1},d(c){c&&i.detach(t),a[e].d()}}}function Al(o){let t,e,n=o[0],s=[];for(let a=0;a<n.length;a+=1)s[a]=di(ci(o,n,a));const r=a=>i.transition_out(s[a],1,1,()=>{s[a]=null});return{c(){t=i.element("div");for(let a=0;a<s.length;a+=1)s[a].c();i.attr(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(a,l){i.insert(a,t,l);for(let c=0;c<s.length;c+=1)s[c].m(t,null);e=!0},p(a,[l]){if(l&7){n=a[0];let c;for(c=0;c<n.length;c+=1){const d=ci(a,n,c);s[c]?(s[c].p(d,l),i.transition_in(s[c],1)):(s[c]=di(d),s[c].c(),i.transition_in(s[c],1),s[c].m(t,null))}for(i.group_outros(),c=n.length;c<s.length;c+=1)r(c);i.check_outros()}},i(a){if(!e){for(let l=0;l<n.length;l+=1)i.transition_in(s[l]);e=!0}},o(a){s=s.filter(Boolean);for(let l=0;l<s.length;l+=1)i.transition_out(s[l]);e=!1},d(a){a&&i.detach(t),i.destroy_each(s,a)}}}function vl(o,t,e){let n,{floorIndex:s}=t,{floorplanData:r}=t;const a=r.bounding.max.x-r.bounding.min.x,l=r.bounding.max.y-r.bounding.min.y;return o.$$set=c=>{"floorIndex"in c&&e(3,s=c.floorIndex),"floorplanData"in c&&e(4,r=c.floorplanData)},o.$$.update=()=>{o.$$.dirty&24&&e(0,n=r.floorDatas[s].rooms.map(c=>V(j({},c),{path:c.path.map(d=>bs(d,r.bounding))})))},[n,a,l,s,r]}class bl extends i.SvelteComponent{constructor(t){super(),i.init(this,t,vl,Al,i.safe_not_equal,{floorIndex:3,floorplanData:4},fl)}}function yl(o){i.append_styles(o,"svelte-19uvvss","path.svelte-19uvvss{opacity:0}path.svelte-19uvvss:hover{opacity:0.1}")}function wl(o){let t,e,n;return{c(){t=i.svg_element("path"),i.attr(t,"d",o[2]),i.attr(t,"fill","#fff"),i.attr(t,"class","svelte-19uvvss")},m(s,r){i.insert(s,t,r),e||(n=[i.listen(t,"mouseenter",o[0]),i.listen(t,"mouseleave",o[1])],e=!0)},p:i.noop,i:i.noop,o:i.noop,d(s){s&&i.detach(t),e=!1,i.run_all(n)}}}function Cl(o,t,e){let{room:n}=t,{floorplanData:s}=t,{hoveredRoom:r}=t;function a(){r.set(n)}function l(){r.set(void 0)}const{bounding:c}=s,d=Nt(n.path,{needZ:!0,format:u=>bs(u,c)});return o.$$set=u=>{"room"in u&&e(3,n=u.room),"floorplanData"in u&&e(4,s=u.floorplanData),"hoveredRoom"in u&&e(5,r=u.hoveredRoom)},[a,l,d,n,s,r]}class El extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Cl,wl,i.safe_not_equal,{room:3,floorplanData:4,hoveredRoom:5},yl)}}function Pl(o){i.append_styles(o,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function ui(o,t,e){const n=o.slice();return n[5]=t[e],n}function hi(o,t){let e,n,s;const r=[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}];let a={};for(let l=0;l<r.length;l+=1)a=i.assign(a,r[l]);return n=new El({props:a}),{key:o,first:null,c(){e=i.empty(),i.create_component(n.$$.fragment),this.first=e},m(l,c){i.insert(l,e,c),i.mount_component(n,l,c),s=!0},p(l,c){t=l;const d=c&7?i.get_spread_update(r,[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}]):{};n.$set(d)},i(l){s||(i.transition_in(n.$$.fragment,l),s=!0)},o(l){i.transition_out(n.$$.fragment,l),s=!1},d(l){l&&i.detach(e),i.destroy_component(n,l)}}}function Il(o){let t,e,n=[],s=new Map,r,a=o[1].floorDatas[o[0]].rooms;const l=c=>c[5].id;for(let c=0;c<a.length;c+=1){let d=ui(o,a,c),u=l(d);s.set(u,n[c]=hi(u,d))}return{c(){t=i.element("div"),e=i.svg_element("svg");for(let c=0;c<n.length;c+=1)n[c].c();i.attr(e,"width","100%"),i.attr(e,"height","100%"),i.attr(e,"viewBox",`0 0 ${o[3]} ${o[4]}`),i.attr(e,"class","svelte-1kqo6e4"),i.attr(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(c,d){i.insert(c,t,d),i.append(t,e);for(let u=0;u<n.length;u+=1)n[u].m(e,null);r=!0},p(c,[d]){d&7&&(a=c[1].floorDatas[c[0]].rooms,i.group_outros(),n=i.update_keyed_each(n,d,l,1,c,a,s,e,i.outro_and_destroy_block,hi,null,ui),i.check_outros())},i(c){if(!r){for(let d=0;d<a.length;d+=1)i.transition_in(n[d]);r=!0}},o(c){for(let d=0;d<n.length;d+=1)i.transition_out(n[d]);r=!1},d(c){c&&i.detach(t);for(let d=0;d<n.length;d+=1)n[d].d()}}}function kl(o,t,e){let{floorIndex:n}=t,{floorplanData:s}=t,{hoveredRoom:r}=t;const a=s.bounding.max.x-s.bounding.min.x,l=s.bounding.max.y-s.bounding.min.y;return o.$$set=c=>{"floorIndex"in c&&e(0,n=c.floorIndex),"floorplanData"in c&&e(1,s=c.floorplanData),"hoveredRoom"in c&&e(2,r=c.hoveredRoom)},[n,s,r,a,l]}class ys extends i.SvelteComponent{constructor(t){super(),i.init(this,t,kl,Il,i.safe_not_equal,{floorIndex:0,floorplanData:1,hoveredRoom:2},Pl)}}function xl(o){i.append_styles(o,"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 fi(o){let t,e;const n=[{floorIndex:o[1],floorplanData:o[5],hoveredRoom:o[10]}];let s={};for(let r=0;r<n.length;r+=1)s=i.assign(s,n[r]);return t=new ys({props:s}),{c(){i.create_component(t.$$.fragment)},m(r,a){i.mount_component(t,r,a),e=!0},p(r,a){const l=a&1058?i.get_spread_update(n,[{floorIndex:r[1],floorplanData:r[5],hoveredRoom:r[10]}]):{};t.$set(l)},i(r){e||(i.transition_in(t.$$.fragment,r),e=!0)},o(r){i.transition_out(t.$$.fragment,r),e=!1},d(r){i.destroy_component(t,r)}}}function mi(o){let t,e;const n=[{floorplanData:o[5],floorIndex:o[1],getRoomAreaText:o[6],getLabelElement:o[7],hoveredRoom:o[10],adaptiveRoomLabelVisibleEnable:o[9]}];let s={};for(let r=0;r<n.length;r+=1)s=i.assign(s,n[r]);return t=new Ya({props:s}),{c(){i.create_component(t.$$.fragment)},m(r,a){i.mount_component(t,r,a),e=!0},p(r,a){const l=a&1762?i.get_spread_update(n,[{floorplanData:r[5],floorIndex:r[1],getRoomAreaText:r[6],getLabelElement:r[7],hoveredRoom:r[10],adaptiveRoomLabelVisibleEnable:r[9]}]):{};t.$set(l)},i(r){e||(i.transition_in(t.$$.fragment,r),e=!0)},o(r){i.transition_out(t.$$.fragment,r),e=!1},d(r){i.destroy_component(t,r)}}}function pi(o){let t,e;const n=[{floorplanData:o[5],floorIndex:o[1],getRuleDistanceText:o[8]}];let s={};for(let r=0;r<n.length;r+=1)s=i.assign(s,n[r]);return t=new el({props:s}),{c(){i.create_component(t.$$.fragment)},m(r,a){i.mount_component(t,r,a),e=!0},p(r,a){const l=a&290?i.get_spread_update(n,[{floorplanData:r[5],floorIndex:r[1],getRuleDistanceText:r[8]}]):{};t.$set(l)},i(r){e||(i.transition_in(t.$$.fragment,r),e=!0)},o(r){i.transition_out(t.$$.fragment,r),e=!1},d(r){i.destroy_component(t,r)}}}function Dl(o){let t,e,n,s,r,a,l,c,d;const u=[{floorIndex:o[1],floorplanData:o[5]}];let f={};for(let v=0;v<u.length;v+=1)f=i.assign(f,u[v]);e=new bl({props:f});let h=o[2]&&fi(o);const p=[{floorplanData:o[5],floorIndex:o[1]}];let g={};for(let v=0;v<p.length;v+=1)g=i.assign(g,p[v]);r=new vs({props:g});let A=o[3]&&mi(o),b=o[4]&&pi(o);return{c(){t=i.element("div"),i.create_component(e.$$.fragment),n=i.space(),h&&h.c(),s=i.space(),i.create_component(r.$$.fragment),a=i.space(),A&&A.c(),l=i.space(),b&&b.c(),i.attr(t,"class",c=i.null_to_empty(`floorplan-plugin__floor${o[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(v,w){i.insert(v,t,w),i.mount_component(e,t,null),i.append(t,n),h&&h.m(t,null),i.append(t,s),i.mount_component(r,t,null),i.append(t,a),A&&A.m(t,null),i.append(t,l),b&&b.m(t,null),d=!0},p(v,[w]){const y=w&34?i.get_spread_update(u,[{floorIndex:v[1],floorplanData:v[5]}]):{};e.$set(y),v[2]?h?(h.p(v,w),w&4&&i.transition_in(h,1)):(h=fi(v),h.c(),i.transition_in(h,1),h.m(t,s)):h&&(i.group_outros(),i.transition_out(h,1,1,()=>{h=null}),i.check_outros());const I=w&34?i.get_spread_update(p,[{floorplanData:v[5],floorIndex:v[1]}]):{};r.$set(I),v[3]?A?(A.p(v,w),w&8&&i.transition_in(A,1)):(A=mi(v),A.c(),i.transition_in(A,1),A.m(t,l)):A&&(i.group_outros(),i.transition_out(A,1,1,()=>{A=null}),i.check_outros()),v[4]?b?(b.p(v,w),w&16&&i.transition_in(b,1)):(b=pi(v),b.c(),i.transition_in(b,1),b.m(t,null)):b&&(i.group_outros(),i.transition_out(b,1,1,()=>{b=null}),i.check_outros()),(!d||w&1&&c!==(c=i.null_to_empty(`floorplan-plugin__floor${v[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&i.attr(t,"class",c)},i(v){d||(i.transition_in(e.$$.fragment,v),i.transition_in(h),i.transition_in(r.$$.fragment,v),i.transition_in(A),i.transition_in(b),d=!0)},o(v){i.transition_out(e.$$.fragment,v),i.transition_out(h),i.transition_out(r.$$.fragment,v),i.transition_out(A),i.transition_out(b),d=!1},d(v){v&&i.detach(t),i.destroy_component(e),h&&h.d(),i.destroy_component(r),A&&A.d(),b&&b.d()}}}function Sl(o,t,e){let{isCurrent:n}=t,{floorIndex:s}=t,{hoverEnable:r}=t,{roomLabelsEnable:a}=t,{ruleLabelsEnable:l}=t,{floorplanData:c}=t,{getRoomAreaText:d}=t,{getLabelElement:u}=t,{getRuleDistanceText:f}=t,{adaptiveRoomLabelVisibleEnable:h}=t;const p=kn.writable(void 0);return o.$$set=g=>{"isCurrent"in g&&e(0,n=g.isCurrent),"floorIndex"in g&&e(1,s=g.floorIndex),"hoverEnable"in g&&e(2,r=g.hoverEnable),"roomLabelsEnable"in g&&e(3,a=g.roomLabelsEnable),"ruleLabelsEnable"in g&&e(4,l=g.ruleLabelsEnable),"floorplanData"in g&&e(5,c=g.floorplanData),"getRoomAreaText"in g&&e(6,d=g.getRoomAreaText),"getLabelElement"in g&&e(7,u=g.getLabelElement),"getRuleDistanceText"in g&&e(8,f=g.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in g&&e(9,h=g.adaptiveRoomLabelVisibleEnable)},[n,s,r,a,l,c,d,u,f,h,p]}class Ll extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Sl,Dl,i.safe_not_equal,{isCurrent:0,floorIndex:1,hoverEnable:2,roomLabelsEnable:3,ruleLabelsEnable:4,floorplanData:5,getRoomAreaText:6,getLabelElement:7,getRuleDistanceText:8,adaptiveRoomLabelVisibleEnable:9},xl)}}function _l(o){i.append_styles(o,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function gi(o,t,e){const n=o.slice();return n[16]=t[e],n}function Ai(o){let t,e,n,s,r,a,l=o[9].floorDatas,c=[];for(let p=0;p<l.length;p+=1)c[p]=vi(gi(o,l,p));const d=p=>i.transition_out(c[p],1,1,()=>{c[p]=null}),u=[{panoIndex:o[3],floorplanData:o[9],lastPanoramaLongitude:o[10],cameraImageUrl:o[11]}];let f={};for(let p=0;p<u.length;p+=1)f=i.assign(f,u[p]);n=new pa({props:f});let h=o[6]&&bi(o);return{c(){t=i.element("div");for(let p=0;p<c.length;p+=1)c[p].c();e=i.space(),i.create_component(n.$$.fragment),s=i.space(),h&&h.c(),i.attr(t,"class","floorplan-main svelte-86bqav")},m(p,g){i.insert(p,t,g);for(let A=0;A<c.length;A+=1)c[A].m(t,null);i.append(t,e),i.mount_component(n,t,null),i.append(t,s),h&&h.m(t,null),a=!0},p(p,g){if(o=p,g&62384){l=o[9].floorDatas;let b;for(b=0;b<l.length;b+=1){const v=gi(o,l,b);c[b]?(c[b].p(v,g),i.transition_in(c[b],1)):(c[b]=vi(v),c[b].c(),i.transition_in(c[b],1),c[b].m(t,e))}for(i.group_outros(),b=l.length;b<c.length;b+=1)d(b);i.check_outros()}const A=g&3592?i.get_spread_update(u,[{panoIndex:o[3],floorplanData:o[9],lastPanoramaLongitude:o[10],cameraImageUrl:o[11]}]):{};n.$set(A),o[6]?h?(h.p(o,g),g&64&&i.transition_in(h,1)):(h=bi(o),h.c(),i.transition_in(h,1),h.m(t,null)):h&&(i.group_outros(),i.transition_out(h,1,1,()=>{h=null}),i.check_outros())},i(p){if(!a){for(let g=0;g<l.length;g+=1)i.transition_in(c[g]);i.transition_in(n.$$.fragment,p),i.transition_in(h),r||i.add_render_callback(()=>{r=i.create_in_transition(t,me.fade,{duration:o[0],easing:Se.linear}),r.start()}),a=!0}},o(p){c=c.filter(Boolean);for(let g=0;g<c.length;g+=1)i.transition_out(c[g]);i.transition_out(n.$$.fragment,p),i.transition_out(h),a=!1},d(p){p&&i.detach(t),i.destroy_each(c,p),i.destroy_component(n),h&&h.d()}}}function vi(o){let t,e;const n=[{hoverEnable:o[5],floorplanData:o[9],getRoomAreaText:o[12],getLabelElement:o[13],getRuleDistanceText:o[14],roomLabelsEnable:o[7],ruleLabelsEnable:o[8],adaptiveRoomLabelVisibleEnable:o[15]},{floorIndex:o[16].floorIndex},{isCurrent:o[16].floorIndex===o[4]}];let s={};for(let r=0;r<n.length;r+=1)s=i.assign(s,n[r]);return t=new Ll({props:s}),{c(){i.create_component(t.$$.fragment)},m(r,a){i.mount_component(t,r,a),e=!0},p(r,a){const l=a&62384?i.get_spread_update(n,[a&62368&&{hoverEnable:r[5],floorplanData:r[9],getRoomAreaText:r[12],getLabelElement:r[13],getRuleDistanceText:r[14],roomLabelsEnable:r[7],ruleLabelsEnable:r[8],adaptiveRoomLabelVisibleEnable:r[15]},a&512&&{floorIndex:r[16].floorIndex},a&528&&{isCurrent:r[16].floorIndex===r[4]}]):{};t.$set(l)},i(r){e||(i.transition_in(t.$$.fragment,r),e=!0)},o(r){i.transition_out(t.$$.fragment,r),e=!1},d(r){i.destroy_component(t,r)}}}function bi(o){let t,e;return t=new Ca({props:{floorplanData:o[9],northDesc:o[2]}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&512&&(r.floorplanData=n[9]),s&4&&(r.northDesc=n[2]),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function zl(o){let t,e,n=o[1]&&Ai(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[1]?n?(n.p(s,r),r&2&&i.transition_in(n,1)):(n=Ai(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function Ml(o,t,e){let{duration:n=0}=t,{visible:s}=t,{northDesc:r}=t,{panoIndex:a}=t,{floorIndex:l}=t,{hoverEnable:c}=t,{compassEnable:d}=t,{roomLabelsEnable:u}=t,{ruleLabelsEnable:f}=t,{floorplanData:h}=t,{lastPanoramaLongitude:p}=t,{cameraImageUrl:g}=t,{getRoomAreaText:A}=t,{getLabelElement:b}=t,{getRuleDistanceText:v}=t,{adaptiveRoomLabelVisibleEnable:w}=t;return o.$$set=y=>{"duration"in y&&e(0,n=y.duration),"visible"in y&&e(1,s=y.visible),"northDesc"in y&&e(2,r=y.northDesc),"panoIndex"in y&&e(3,a=y.panoIndex),"floorIndex"in y&&e(4,l=y.floorIndex),"hoverEnable"in y&&e(5,c=y.hoverEnable),"compassEnable"in y&&e(6,d=y.compassEnable),"roomLabelsEnable"in y&&e(7,u=y.roomLabelsEnable),"ruleLabelsEnable"in y&&e(8,f=y.ruleLabelsEnable),"floorplanData"in y&&e(9,h=y.floorplanData),"lastPanoramaLongitude"in y&&e(10,p=y.lastPanoramaLongitude),"cameraImageUrl"in y&&e(11,g=y.cameraImageUrl),"getRoomAreaText"in y&&e(12,A=y.getRoomAreaText),"getLabelElement"in y&&e(13,b=y.getLabelElement),"getRuleDistanceText"in y&&e(14,v=y.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in y&&e(15,w=y.adaptiveRoomLabelVisibleEnable)},[n,s,r,a,l,c,d,u,f,h,p,g,A,b,v,w]}class Dn extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Ml,zl,i.safe_not_equal,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,hoverEnable:5,compassEnable:6,roomLabelsEnable:7,ruleLabelsEnable:8,floorplanData:9,lastPanoramaLongitude:10,cameraImageUrl:11,getRoomAreaText:12,getLabelElement:13,getRuleDistanceText:14,adaptiveRoomLabelVisibleEnable:15},_l)}}const Tl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLOK6BPwIk9nNODM9Xf1RVe1b3elJRjCZmQ6euqGmuqer33rq4e23GqiOykBloDJQGagMVAYqA5WBykBlYFYD1qwP/tdzaZqOx9zYOLxeX0+L5yzLGp0X/03a25MOnGRcBtx+6Rlo9SL08G4EooFnxa8Yiivox5/h5Ys/4cl7NVorNDRnngX+0MIkVMeMSf23zyKML8J7/Dy8hwF2Buh9CnS+AEQIdLspBuGb+M7/qLW4qJrNpsLapjYhpwVnx3BMfCtNNx3Etc9xywvnMf80wG8HmQainw0RxSGrnmeBp+8k5/j9S0HbvXb5io0Lz880/0wPHV1NlhLd316He+4xOCv5ragF7L9PrH1qBJyB0626x/lC+qrSvH5r/W+n1WpxUM5nMY4GPeH8lHJaPgfeAFQHCL+ntkXT+vnUc3W6pvTIwC0wy3rA4dwLmK2avZ7Eo9uKBuYJfgJscbs8dLCxDMt+EOEPBEZNEWyBYHqTz6bPXrzUnNrSShxHIsYiOL69zrCGLLcLqJP68tB+9w5wj+YhWDafQ2s61wNqxjZhmrQ2pvMFCEvXuCUZ7wqH794ZWs28LJqlTXSUyuksF2M/yOwqgkx2c1ADa4wLAQRk2sAGQQakhN6yFC2hltfz5kSY44NKQeeh+vtI/SSzWhg2CzCgmWISmKUGmaYFBDfCSymnfxJ6/+ospVcWOLLp5DGP/y0P/Rp66O99DQNq7Po3Ds0a0wY+My2QSv2N2mO/OyxR2o6UQk+Lv7yJ06JYSnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function jl(o){return F(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(s){return F(this,null,function*(){const r={index:s.index,url:s.url,svgUrl:s.svg_url};if(s.svg_url){const a=yield fetch(s.svg_url,{headers:t}).then(l=>l.text());r.svgContent=a}return r})};return yield Promise.all(o.map(e))})}function Bl(o){return{id:o.id,size:o.size,name:o.name,path:o.path,roomType:o.room_type,floorType:o.floor_type,roomLabel:{position:o.room_label.position,positionInImage:o.room_label.position_in_image},observerIndexs:o.observer_indexs}}function Ql(o){return{floorName:o.floor_name,floorIndex:o.floor_index,rooms:o.rooms.map(Bl),rules:o.rules}}function Rl(o){return{index:o.index,floorIndex:o.floor_index,position:o.position,positionInImage:o.position_in_image}}function Ol(o){return{rad:o.rad,position:o.position,positionInImage:o.position_in_image,northRad:o.north_rad,roomId:o.room_id,floorIndex:o.floor_index}}function Qe(o){return F(this,null,function*(){const t=yield jl(o.outlines),e=o.computed_data.bounding,n=o.computed_data.floor_datas.map(Ql),s=o.computed_data.entrance?Ol(o.computed_data.entrance):null;return{outlines:t,entrance:s,bounding:e,floorDatas:n,observers:o.computed_data.observers.map(Rl)}})}function Hl(o,t,e){return o.map(s=>{const r=s.position,a=s.icon?s.icon:{url:Tl,width:45,height:48},l=il(r,t),c=tl(r,e),d=nl(c,e);return{floorIndex:l,icon:a,id:s.id,position:c,positionInImage:d}})}function Fl(o,t){return t(o),o}function Wt(o,t){return Fl({},e=>{for(const n in o)t.indexOf(n)===-1&&(e[n]=o[n])})}function yi(o,t){const e=Math.max(...o.work.observers.map(n=>n.floorIndex));return t>e?o.model.bounding.max.y:Math.max(...o.work.observers.filter(n=>n.floorIndex===t).map(n=>n.standingPosition.y))}function Sn(o,t,e=je.BOUNDING_CENTER){const n=yi(o,t),s=yi(o,t+1);return e===je.BOUNDING_CENTER?(o.model.bounding.max.y+o.model.bounding.min.y)/2:e===je.CEILING?s:n}function Ln(o,t,e,n){const s=Sn(o,e,n==null?void 0:n.attachedTo),r=new P.Vector3(0,s,0),a=new P.Vector3(1,s,0),l=r.clone().project(o.camera),c=a.clone().project(o.camera);return Math.abs((c.x-l.x)/1e3)*(t.getBoundingClientRect().width/2)}class Xt{constructor(t,e){m(this,"five");m(this,"hooks",new ht);m(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}}class Ze extends Xt{}var he=(o=>(o.UnknownError="UnknownError",o.DataNotLoaded="DataNotLoaded",o.BreakOffByHide="BreakOffByHide",o.BreakOffByDisable="BreakOffByDisable",o.ModelNotLoaded="ModelNotLoaded",o.ChangeModeError="ChangeModeError",o.UpdateCameraError="UpdateCameraError",o))(he||{});const ws=500,Gl=80;function pn(o,t,e=4){return Math.floor(o*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function Cs(o,t){return F(this,null,function*(){yield new Promise((e,n)=>{o.changeMode(...t).catch(s=>n(s)),o.once("initAnimationEnded",()=>{const s=o.getCurrentState(),r=t[0];s.mode!==r&&n(new Error("mode \u4E0E\u9884\u671F\u4E0D\u7B26")),(()=>{const c=t[1];return c?Object.keys(c).every(d=>{const u=s[d];if(u===void 0)return!0;const f=c[d];return typeof u=="number"&&typeof f=="number"?pn(u,f,2):u===f}):!0})()||n(new Error("five pose \u4E0E\u9884\u671F\u4E0D\u7B26")),e()})})})}function _n(o,t){if(o.currentMode!==t.mode)return!1;const{latitude:e,longitude:n,fov:s}=t,{latitude:r,longitude:a}=o.getCurrentState(),l=o.camera.fov;return!(!pn(e,r,2)||!pn(n,a,2)||s!==l)}function Es(o,t,e=!0){return F(this,null,function*(){if(_n(o,t)===!0)return;const s=o.getCurrentState();if(s.mode!==t.mode){const[u]=yield jt(Cs(o,[t.mode,t,void 0,e]));if(u)throw new Error(he.ChangeModeError);return}const{latitude:r,longitude:a,fov:l}=s,c=Math.min(1e3,Math.max(200,Math.abs(r-Math.PI/2)*1e3,(a>Math.PI?2*Math.PI-a:a)*500,Math.abs(l-t.fov)*10)),[d]=yield jt(o.updateCamera(t,c,e));if(d)throw new Error(he.UpdateCameraError)})}function tt(o,t,e=300){const n=o.getElement();!n||(n.style.opacity=t+"",n.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(s=>n.addEventListener("transitionend",s,{once:!0})),new Promise(s=>setTimeout(s,e))]).then(()=>{n.style.transition="none"}))}function Nl(o){const{latitude:t,longitude:e}=o,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,s=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||s}function Wl(o){const{latitude:t,longitude:e}=o,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,s=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&s}class Xl extends Ze{constructor(e,n){var l;super(e);m(this,"name","modelFloorplanPlugin");m(this,"state");m(this,"data");m(this,"showState");m(this,"showPromise");m(this,"app");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"selector");m(this,"showRejection");m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"show",(...n)=>F(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const s=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},s),this._show(e)}));m(this,"hide",(...n)=>F(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));m(this,"updateSize",()=>{if(!this.data||!_n(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,s=n.x-e.x,r=n.y-e.y,a=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,l=Ln(this.five,this.wrapper,this.floorIndex,a),c=Math.ceil(s*l),d=Math.ceil(r*l);this.size.width===c&&this.size.height===d||(this.container.style.width=c+"px",this.container.style.height=d+"px",this.size={width:c,height:d})});m(this,"_disable",e=>{var s,r,a;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(s=this.showRejection)==null||s.call(this,he.BreakOffByDisable),this.showPromise=void 0,(r=this.app)==null||r.$destroy(),this.app=void 0,(a=this.container)==null||a.remove(),this.removeEventListener()});m(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});m(this,"_show",e=>F(this,null,function*(){var a;if(!this.state.enabled)return;if(!((a=this.five.model)!=null&&a.loaded))throw new Error(he.ModelNotLoaded);if(!this.data)throw new Error(he.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},s=j(j({},n),e),r=()=>F(this,null,function*(){this.hooks.emit("show",{userAction:s.userAction,auto:s.isAutoShow});let l=!1,c;this.showRejection=h=>{l=!0,c=h};const[d]=yield jt(Es(this.five,this.showState,s.userAction));if(d)throw d;if(l)throw c?new Error(c):new Error(he.UnknownError);this.updateSize(),this.floorIndex=s.floorIndex,this.five.model.show(this.floorIndex);const u=s.modelOpacity,f=s.immediately?0:ws;tt(this.five,u,f),this.render(f)});return this.showPromise=r().then(()=>{this.hooks.emit("showAnimationEnded",{auto:s.isAutoShow,userAction:s.userAction})}).catch(l=>{if(this.updateState({visible:!1},s.userAction),!s.isAutoShow&&l instanceof Error)throw l}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));m(this,"_hide",e=>{var r;(r=this.showRejection)==null||r.call(this,he.BreakOffByHide),this.showPromise=void 0;const s=j(j({},{userAction:!0,isAutoHide:!1}),e);tt(this.five,1,0),this.hooks.emit("hide",{auto:s.isAutoHide,userAction:s.userAction}),this.render()});m(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});m(this,"onFiveInteriaPan",(e,n)=>{if(!n||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const s=this.five.getCurrentState();s.mode==="Floorplan"&&(this.state.visible||Wl(s)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const s=this.five.getCurrentState();Nl(s)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});m(this,"onFiveWantsGesture",(e,n)=>{if(!!this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});m(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});m(this,"onFiveWantsTapGesture",()=>this.handleClick());m(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:Gl/((l=n==null?void 0:n.scale)!=null?l:1)};const s={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:Be,attachedTo:je.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:c=>(c/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:c=>c.toString()},r=n?Wt(n,["selector","scale"]):{},a=j(j({},s),r);this.state={enabled:!0,visible:!1,config:a},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,s=!0){return F(this,null,function*(){function r(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const a=e;a&&!a.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 l=JSON.parse(JSON.stringify(e)),c=r(l)?l.data:l,d=this.data;this.data=yield Qe(c),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,d),n&&this.updateState(n,s),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 s=this.state,r=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,r),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:r}):this._disable({userAction:r})),e.visible!==void 0&&s.visible!==e.visible){const a={userAction:r};e.visible?this._show(a):this._hide(a)}this.render()}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return F(this,null,function*(){return yield Qe(e.data)})}updateState(e,n){const s=this.state,r=e.config?j(j({},s.config),e.config):s.config;this.state=V(j(j({},this.state),e),{config:r}),!Ce(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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=V(j({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude});if(this.app)return this.app.$set(n);this.app=new Dn({target:this.container,intro:!0,props:n})}}const Yl=(o,t)=>new Xl(o,t);function Ul(o){const{latitude:t,longitude:e}=o,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,s=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||s}function Vl(o){const{latitude:t,longitude:e}=o,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,s=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&s}class Jl extends Ze{constructor(e,n){super(e);m(this,"name","modelFloorplanPlugin");m(this,"state");m(this,"data");m(this,"showState");m(this,"showPromise");m(this,"app");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"selector");m(this,"showRejection");m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"show",(...n)=>F(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const s=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},s),this._show(e)}));m(this,"hide",(...n)=>F(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));m(this,"updateSize",()=>{if(!this.data||!_n(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,s=n.x-e.x,r=n.y-e.y,a=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,l=Ln(this.five,this.wrapper,this.floorIndex,a),c=Math.ceil(s*l),d=Math.ceil(r*l);this.size.width===c&&this.size.height===d||(this.container.style.width=c+"px",this.container.style.height=d+"px",this.size={width:c,height:d})});m(this,"_disable",e=>{var s,r,a;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(s=this.showRejection)==null||s.call(this,he.BreakOffByDisable),this.showPromise=void 0,(r=this.app)==null||r.$destroy(),this.app=void 0,(a=this.container)==null||a.remove(),this.removeEventListener()});m(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});m(this,"_show",e=>F(this,null,function*(){var a;if(!this.state.enabled)return;if(!((a=this.five.model)!=null&&a.loaded))throw new Error(he.ModelNotLoaded);if(!this.data)throw new Error(he.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},s=j(j({},n),e),r=()=>F(this,null,function*(){this.hooks.emit("show",{userAction:s.userAction,auto:s.isAutoShow});let l=!1,c;this.showRejection=h=>{l=!0,c=h};const[d]=yield jt(Es(this.five,this.showState,s.userAction));if(d)throw d;if(l)throw c?new Error(c):new Error(he.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=s.floorIndex,this.five.model.show(this.floorIndex);const u=s.modelOpacity,f=s.immediately?0:ws;tt(this.five,u,f),this.render(f)});return this.showPromise=r().then(()=>{this.hooks.emit("showAnimationEnded",{auto:s.isAutoShow,userAction:s.userAction})}).catch(l=>{if(this.updateState({visible:!1},s.userAction),!s.isAutoShow&&l instanceof Error)throw l}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));m(this,"_hide",e=>{var r;(r=this.showRejection)==null||r.call(this,he.BreakOffByHide),this.showPromise=void 0;const s=j(j({},{userAction:!0,isAutoHide:!1}),e);tt(this.five,1,0),this.hooks.emit("hide",{auto:s.isAutoHide,userAction:s.userAction}),this.render()});m(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const s=this.five.getCurrentState();this.updatePosition(),this.updateSize(),Ul(s)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});m(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1){if(n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1;if(n&&!this.state.visible){if(this.isHiddenByHideFunc)return;const s=this.five.getCurrentState();return s.mode!==this.showState.mode||this.state.visible?void 0:(Vl(s)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});m(this,"onFiveWantsTapGesture",()=>this.handleClick());m(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2,fov:90};const s={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,cameraImageUrl:Be,attachedTo:je.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},r=n?Wt(n,["selector","scale"]):{},a=j(j({},s),r);this.state={enabled:!0,visible:!1,config:a},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,s=!0){return F(this,null,function*(){function r(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const a=e;a&&!a.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 l=JSON.parse(JSON.stringify(e)),c=r(l)?l.data:l,d=this.data;this.data=yield Qe(c),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,d),n&&this.updateState(n,s),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 s=this.state,r=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,r),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:r}):this._disable({userAction:r})),e.visible!==void 0&&s.visible!==e.visible){const a={userAction:r};e.visible?this._show(a):this._hide(a)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}updatePosition(){var l;const e=Sn(this.five,this.floorIndex,this.state.config.attachedTo),n=(l=this.five.model)==null?void 0:l.bounding.getCenter(new P.Vector3).setY(e);if(!n)return;const s=n.clone().project(this.five.camera),r=(s.x+1)/2,a=-(s.y-1)/2;this.container.style.left=r*100+"%",this.container.style.top=a*100+"%"}formatData(e){return F(this,null,function*(){return yield Qe(e.data)})}updateState(e,n){const s=this.state,r=e.config?j(j({},s.config),e.config):s.config;this.state=V(j(j({},this.state),e),{config:r}),!Ce(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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=V(j({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude});if(this.app)return this.app.$set(n);this.app=new Dn({target:this.container,intro:!0,props:n})}}const Zl=(o,t)=>new Jl(o,t);class ql extends Ze{constructor(e,n){super(e);m(this,"name","topviewFloorplanPlugin");m(this,"state");m(this,"data");m(this,"app");m(this,"selector");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper||this.five.getCurrentState().mode!=="Topview")return;const{min:e,max:n}=this.data.bounding,s=n.x-e.x,r=n.y-e.y,a=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,l=Ln(this.five,this.wrapper,this.floorIndex,a),c=Math.ceil(s*l),d=Math.ceil(r*l);this.size.width===c&&this.size.height===d||(this.container.style.width=c+"px",this.container.style.height=d+"px",this.size={width:c,height:d})});m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"_disable",e=>{var s,r;const{userAction:n}=e;(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:n})});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{!this.state.visible||(this.updatePosition(),this.updateSize())});m(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});m(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});m(this,"onFiveInitAnimationEnded",(...[,,e])=>{const{mode:n}=this.five.getCurrentState();n==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},e),this._show({userAction:e}))});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"));const s={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,cameraImageUrl:Be,attachedTo:je.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},r=n?Wt(n,["selector","scale"]):{},a=j(j({},s),r);this.state={enabled:!0,visible:!1,config:a},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,s=!0){return F(this,null,function*(){function r(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const a=e;a&&!a.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 l=JSON.parse(JSON.stringify(e)),c=r(l)?l.data:l,d=this.data;this.data=yield Qe(c),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,d),n&&this.updateState(n,s),this.render()})}updatePosition(){var l;const e=Sn(this.five,this.floorIndex,this.state.config.attachedTo),n=(l=this.five.model)==null?void 0:l.bounding.getCenter(new P.Vector3).setY(e);if(!n)return;const s=n.clone().project(this.five.camera),r=(s.x+1)/2,a=-(s.y-1)/2;this.container.style.left=r*100+"%",this.container.style.top=a*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return F(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 F(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 s=this.state,r=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,r),e.enabled!==void 0&&s.enabled!==e.enabled){const a={userAction:r};e.enabled?this._enable(a):this._disable(a)}if(e.visible!==void 0&&s.visible!==e.visible){const a={userAction:r};e.visible?this._show(a):this._hide(a)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return F(this,null,function*(){return yield Qe(e.data)})}_show(e){return F(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 Cs(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const s=500,r=this.state.config.modelOpacity;tt(this.five,r,s),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return F(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const s=1,r=0;tt(this.five,s,r),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 s=this.state,r=e.config?j(j({},s.config),e.config):s.config;this.state=V(j(j({},this.state),e),{config:r}),!Ce(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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=V(j({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude});if(this.app)return this.app.$set(n);this.app=new Dn({target:this.container,intro:!0,props:n})}}const Kl=(o,t)=>new ql(o,t);function zn(o,t=200){let e;return function(...n){e||(o(...n),e=setTimeout(function(){e=null},t))}}function $l(o){i.append_styles(o,"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 ec(o){let t,e,n;return{c(){t=i.element("div"),e=i.element("div"),n=i.element("div"),i.attr(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),i.set_style(n,"background-image","url("+(o[0]||Be)+")"),i.set_style(n,"transform",o[1],!1),i.attr(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),i.set_style(e,"transform",o[2],!1),i.attr(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(s,r){i.insert(s,t,r),i.append(t,e),i.append(e,n)},p(s,[r]){r&1&&i.set_style(n,"background-image","url("+(s[0]||Be)+")"),r&2&&i.set_style(n,"transform",s[1],!1),r&4&&i.set_style(e,"transform",s[2],!1)},i:i.noop,o:i.noop,d(s){s&&i.detach(t)}}}function tc(o){return`rotate(${Math.floor(o/Math.PI*180)*-1+45}deg)`}function nc(o,t,e){let n,s,{five:r}=t,{pxmm:a}=t,{floorplanData:l}=t,{cameraImageUrl:c}=t,d=r.getCurrentState().panoIndex,u=r.getCurrentState().longitude;function f(g,A){const b=g.bounding,v=g.observers[A];if(!v)return"";const w=(b.max.x-b.min.x)*a,y=(b.max.y-b.min.y)*a,I=Math.floor(v.positionInImage.x*w),k=Math.floor(v.positionInImage.y*y);return`translate(${I}px, ${k}px)`}function h(g){e(6,d=g)}const p=zn(g=>{e(7,u=g.longitude)},1e3/60);return Z.onMount(()=>(r.on("panoWillArrive",h),r.on("cameraDirectionUpdate",p),function(){r.off("panoWillArrive",h),r.off("cameraDirectionUpdate",p)})),o.$$set=g=>{"five"in g&&e(3,r=g.five),"pxmm"in g&&e(4,a=g.pxmm),"floorplanData"in g&&e(5,l=g.floorplanData),"cameraImageUrl"in g&&e(0,c=g.cameraImageUrl)},o.$$.update=()=>{o.$$.dirty&96&&e(2,n=f(l,d)),o.$$.dirty&128&&e(1,s=tc(u))},[c,s,n,r,a,l,d,u]}class ic extends i.SvelteComponent{constructor(t){super(),i.init(this,t,nc,ec,i.safe_not_equal,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},$l)}}function oc(o){i.append_styles(o,"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 wi(o,t,e){const n=o.slice();return n[1]=t[e],n}function Ci(o,t){let e,n,s=`${t[1].icon.width/16}rem`,r=`${t[1].icon.height/16}rem`,a,l=`${t[1].positionInImage.y*100}%`,c=`${t[1].positionInImage.x*100}%`;return{key:o,first:null,c(){e=i.element("div"),n=i.element("div"),a=i.space(),i.attr(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),i.set_style(n,"background-image",`url(${t[1].icon.url})`),i.set_style(n,"width",s,!1),i.set_style(n,"height",r,!1),i.attr(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),i.set_style(e,"top",l,!1),i.set_style(e,"left",c,!1),this.first=e},m(d,u){i.insert(d,e,u),i.append(e,n),i.append(e,a)},p(d,u){t=d,u&1&&i.set_style(n,"background-image",`url(${t[1].icon.url})`),u&1&&s!==(s=`${t[1].icon.width/16}rem`)&&i.set_style(n,"width",s,!1),u&1&&r!==(r=`${t[1].icon.height/16}rem`)&&i.set_style(n,"height",r,!1),u&1&&l!==(l=`${t[1].positionInImage.y*100}%`)&&i.set_style(e,"top",l,!1),u&1&&c!==(c=`${t[1].positionInImage.x*100}%`)&&i.set_style(e,"left",c,!1)},d(d){d&&i.detach(e)}}}function sc(o){let t,e=[],n=new Map,s=o[0];const r=a=>a[1].id;for(let a=0;a<s.length;a+=1){let l=wi(o,s,a),c=r(l);n.set(c,e[a]=Ci(c,l))}return{c(){t=i.element("div");for(let a=0;a<e.length;a+=1)e[a].c();i.attr(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(a,l){i.insert(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null)},p(a,[l]){l&1&&(s=a[0],e=i.update_keyed_each(e,l,r,1,a,s,n,t,i.destroy_block,Ci,null,wi))},i:i.noop,o:i.noop,d(a){a&&i.detach(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function rc(o,t,e){let{extraObjects:n=[]}=t;return o.$$set=s=>{"extraObjects"in s&&e(0,n=s.extraObjects)},[n]}class ac extends i.SvelteComponent{constructor(t){super(),i.init(this,t,rc,sc,i.safe_not_equal,{extraObjects:0},oc)}}function Ei(o){let t,e;const n=[{five:o[0],pxmm:o[1],floorIndex:o[2],floorplanData:o[4],onRoomHeightClick:o[6]}];let s={};for(let r=0;r<n.length;r+=1)s=i.assign(s,n[r]);return t=new ys({props:s}),{c(){i.create_component(t.$$.fragment)},m(r,a){i.mount_component(t,r,a),e=!0},p(r,a){const l=a&87?i.get_spread_update(n,[{five:r[0],pxmm:r[1],floorIndex:r[2],floorplanData:r[4],onRoomHeightClick:r[6]}]):{};t.$set(l)},i(r){e||(i.transition_in(t.$$.fragment,r),e=!0)},o(r){i.transition_out(t.$$.fragment,r),e=!1},d(r){i.destroy_component(t,r)}}}function lc(o){let t,e,n,s,r,a;const l=[{floorIndex:o[2],floorplanData:o[4]}];let c={};for(let u=0;u<l.length;u+=1)c=i.assign(c,l[u]);t=new vs({props:c}),n=new ac({props:{extraObjects:o[5]}});let d=o[3]&&Ei(o);return{c(){i.create_component(t.$$.fragment),e=i.space(),i.create_component(n.$$.fragment),s=i.space(),d&&d.c(),r=i.empty()},m(u,f){i.mount_component(t,u,f),i.insert(u,e,f),i.mount_component(n,u,f),i.insert(u,s,f),d&&d.m(u,f),i.insert(u,r,f),a=!0},p(u,[f]){const h=f&20?i.get_spread_update(l,[{floorIndex:u[2],floorplanData:u[4]}]):{};t.$set(h);const p={};f&32&&(p.extraObjects=u[5]),n.$set(p),u[3]?d?(d.p(u,f),f&8&&i.transition_in(d,1)):(d=Ei(u),d.c(),i.transition_in(d,1),d.m(r.parentNode,r)):d&&(i.group_outros(),i.transition_out(d,1,1,()=>{d=null}),i.check_outros())},i(u){a||(i.transition_in(t.$$.fragment,u),i.transition_in(n.$$.fragment,u),i.transition_in(d),a=!0)},o(u){i.transition_out(t.$$.fragment,u),i.transition_out(n.$$.fragment,u),i.transition_out(d),a=!1},d(u){i.destroy_component(t,u),u&&i.detach(e),i.destroy_component(n,u),u&&i.detach(s),d&&d.d(u),u&&i.detach(r)}}}function cc(o,t,e){let n,{five:s}=t,{pxmm:r}=t,{floorIndex:a}=t,{hoverEnable:l}=t,{floorplanData:c}=t,{extraObjects:d=[]}=t;const u=void 0;return o.$$set=f=>{"five"in f&&e(0,s=f.five),"pxmm"in f&&e(1,r=f.pxmm),"floorIndex"in f&&e(2,a=f.floorIndex),"hoverEnable"in f&&e(3,l=f.hoverEnable),"floorplanData"in f&&e(4,c=f.floorplanData),"extraObjects"in f&&e(7,d=f.extraObjects)},o.$$.update=()=>{o.$$.dirty&132&&e(5,n=d==null?void 0:d.filter(f=>f.floorIndex===a))},[s,r,a,l,c,n,u,d]}class dc extends i.SvelteComponent{constructor(t){super(),i.init(this,t,cc,lc,i.safe_not_equal,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:7})}}function uc(o){i.append_styles(o,"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 Pi(o){let t,e,n,s=o[6]!==0&&Ii(o);return{c(){t=i.element("div"),s&&s.c(),i.attr(t,"class","plugin-floorplan-radar svelte-1mvqyqq"),i.add_render_callback(()=>o[12].call(t))},m(r,a){i.insert(r,t,a),s&&s.m(t,null),e=i.add_resize_listener(t,o[12].bind(t)),n=!0},p(r,a){r[6]!==0?s?(s.p(r,a),a&64&&i.transition_in(s,1)):(s=Ii(r),s.c(),i.transition_in(s,1),s.m(t,null)):s&&(i.group_outros(),i.transition_out(s,1,1,()=>{s=null}),i.check_outros())},i(r){n||(i.transition_in(s),n=!0)},o(r){i.transition_out(s),n=!1},d(r){r&&i.detach(t),s&&s.d(),e()}}}function Ii(o){let t,e,n,s,r=`${o[8]}px`,a=`${o[11]}px`,l;const c=[{five:o[0],pxmm:o[9],floorIndex:o[10],floorplanData:o[3],hoverEnable:o[2],extraObjects:o[5]}];let d={};for(let h=0;h<c.length;h+=1)d=i.assign(d,c[h]);e=new dc({props:d});const u=[{pxmm:o[9],five:o[0],floorplanData:o[3],cameraImageUrl:o[4]}];let f={};for(let h=0;h<u.length;h+=1)f=i.assign(f,u[h]);return s=new ic({props:f}),{c(){t=i.element("div"),i.create_component(e.$$.fragment),n=i.space(),i.create_component(s.$$.fragment),i.attr(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),i.set_style(t,"width",r,!1),i.set_style(t,"height",a,!1)},m(h,p){i.insert(h,t,p),i.mount_component(e,t,null),i.append(t,n),i.mount_component(s,t,null),l=!0},p(h,p){const g=p&1581?i.get_spread_update(c,[{five:h[0],pxmm:h[9],floorIndex:h[10],floorplanData:h[3],hoverEnable:h[2],extraObjects:h[5]}]):{};e.$set(g);const A=p&537?i.get_spread_update(u,[{pxmm:h[9],five:h[0],floorplanData:h[3],cameraImageUrl:h[4]}]):{};s.$set(A),p&256&&r!==(r=`${h[8]}px`)&&i.set_style(t,"width",r,!1),p&2048&&a!==(a=`${h[11]}px`)&&i.set_style(t,"height",a,!1)},i(h){l||(i.transition_in(e.$$.fragment,h),i.transition_in(s.$$.fragment,h),l=!0)},o(h){i.transition_out(e.$$.fragment,h),i.transition_out(s.$$.fragment,h),l=!1},d(h){h&&i.detach(t),i.destroy_component(e),i.destroy_component(s)}}}function hc(o){let t,e,n=o[1]&&Pi(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[1]?n?(n.p(s,r),r&2&&i.transition_in(n,1)):(n=Pi(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function fc(o,t,e){var v,w;let{five:n}=t,{visible:s}=t,{hoverEnable:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,{extraObjects:c=[]}=t,d=0,u=(w=(v=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:v.floorIndex)!=null?w:0,f=0,h=0,p=0,g=0;function A(y){e(10,u=n.work.observers[y].floorIndex)}Z.onMount(()=>(n.on("panoArrived",A),()=>{n.off("panoArrived",A)}));function b(){f=this.clientWidth,h=this.clientHeight,e(6,f),e(7,h)}return o.$$set=y=>{"five"in y&&e(0,n=y.five),"visible"in y&&e(1,s=y.visible),"hoverEnable"in y&&e(2,r=y.hoverEnable),"floorplanData"in y&&e(3,a=y.floorplanData),"cameraImageUrl"in y&&e(4,l=y.cameraImageUrl),"extraObjects"in y&&e(5,c=y.extraObjects)},o.$$.update=()=>{if(o.$$.dirty&456){const y=Math.min(f,h),{max:I,min:k}=a.bounding,C=I.x-k.x,D=I.y-k.y,x=function(){return C>D?[y,y/C*D]:[y/D*C,y]}();e(8,p=x[0]),e(11,g=x[1]),e(9,d=p/C)}},[n,s,r,a,l,c,f,h,p,d,u,g,b]}class mc extends i.SvelteComponent{constructor(t){super(),i.init(this,t,fc,hc,i.safe_not_equal,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5},uc)}}class pc extends Ze{constructor(e,n){super(e);m(this,"name","panoFloorplanRadarPlugin");m(this,"state");m(this,"data");m(this,"app");m(this,"wrapperSelector","");m(this,"wrapper",null);m(this,"disposed",!1);m(this,"extraObjects",[]);m(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});m(this,"_disable",e=>{var s;const{userAction:n}=e;(s=this.app)==null||s.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:n})});this.five=e;const s={hoverEnable:!1,cameraImageUrl:Be},r=n!=null&&n.configs?n.configs:{},a=j(j({},s),r);this.state={enabled:!0,visible:!0,config:a},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,s=!0){return F(this,null,function*(){function r(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const a=JSON.parse(JSON.stringify(e)),l=r(a)?a.data:a,c=this.data;this.data=yield Qe(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,s),this.render()})}show(){return F(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 F(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 s=this.state,r=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,r),e.enabled!==void 0&&s.enabled!==e.enabled){const a={userAction:r};e.enabled?this._enable(a):this._disable(a)}if(e.visible!==void 0&&s.visible!==e.visible){const a={userAction:r};e.visible?this._show(a):this._hide(a)}}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=Hl(e,this.five,this.data),this.render())}formatData(e){return F(this,null,function*(){return yield Qe(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 s=this.state;this.state=j(j({},this.state),e),!Ce(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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=V(j({},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 mc({target:this.wrapper,props:e})}}const gc=(o,t)=>new pc(o,t),Ac=[{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"}],vc=[{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"}],bc=[{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"}],tn=(o,t,e)=>{const n=new P.Matrix4,s=new P.Euler(o,t,e,"YXZ");return n.makeRotationFromEuler(s),n},yc=(o,{scale:t,rotation:e,position:n})=>{if(t&&o.scale.set(t,t,t),e){const[s,r,a]=e;s&&o.applyMatrix4(tn(s,0,0)),r&&o.applyMatrix4(tn(0,r,0)),a&&o.applyMatrix4(tn(0,0,a))}return n&&o.position.set(n.x,n.y,n.z),o};function Ps(o,t){o.traverse(e=>{var n;if(e.type==="Mesh"){const s=e,r=j({map:s.material.map||{}},t);s.material=new M.MeshBasicMaterial(r),s.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const wc=(o,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,s={},r=f=>F(exports,null,function*(){var H;const h=(f==null?void 0:f.fbx_url)||e,p=(H=f==null?void 0:f.north_rad)!=null?H:n;if(typeof p!="number")throw new Error('"northRad"\u914D\u7F6E\u53C2\u6570\u7F3A\u5931\uFF1A\u672A\u914D\u7F6E\u6307\u5357\u9488\u6307\u5411\uFF01');const g=o.model.bounding,A=g.max.x-g.min.x,b=g.max.z-g.min.z,v=Math.max(A,b),y=yield new cs.FBXLoader().loadAsync(h);Ps(y,{transparent:!0,side:P.DoubleSide,blending:P.AdditiveBlending});const I=[0,p-Math.PI/2,0],{model:{bounding:{max:{x:k,z:C},min:{x:D,y:x,z}}}}=o;s.yBase=x;const _={x:(k+D)/2,y:x-1.6,z:(C+z)/2},T=.0045*v;return yc(y,{position:_,rotation:I,scale:T}),s.object=y,!0}),a=({latitude:f})=>{if(!s.object)return;const h=l(f);h&&(s.object.position.y=h)},l=f=>{if(s.yBase===void 0)return;const h=.6;if(f>=Math.PI/4)return s.yBase-(h+1.6);const p=f*(4/Math.PI);return s.yBase-(h*p+1.6)};return{load:r,disable:()=>{!s.object||(o.scene.remove(s.object),o.needsRender=!0,o.off("cameraDirectionUpdate",a))},enable:()=>{if(!s.object)return;const f=l(o.getPose().latitude);f&&(s.object.position.y=f),o.scene.add(s.object),o.needsRender=!0,o.on("cameraDirectionUpdate",a)}}};function Cc(o,t){var d,u,f,h,p;const e=(d=t==null?void 0:t.size)!=null?d:512,n=(u=t==null?void 0:t.fontSize)!=null?u:e*(35/256)*1.2,s=(f=t==null?void 0:t.backgroundColor)!=null?f:"rgba(0,0,0,0)",r=(h=t==null?void 0:t.fontColor)!=null?h:"#fff",a=(p=t==null?void 0:t.textAlign)!=null?p:"center",l=document.createElement("canvas");l.setAttribute("width",e+""),l.setAttribute("height",e+"");const c=l.getContext("2d");return c.fillStyle=s,c.fillRect(0,0,e,e),c.font=`${n}px "\u5FAE\u8F6F\u96C5\u9ED1"`,c.textAlign=a,c.fillStyle=r,c.fillText(o,e/2,e*.7),new M.CanvasTexture(l)}const Ec=({x:o,y:t,z:e})=>new M.Vector3(o,t,e),Pc=(o,t)=>{var A,b,v;const e={},n=(A=t.animationEnabled)!=null?A:!0,s=(b=t.position)!=null?b:void 0,r=(v=t.rad)!=null?v:void 0,a=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",l=[],c=w=>F(exports,null,function*(){var z,_,T,H,E,S,L;const y=(z=w==null?void 0:w.position)!=null?z:s;if(!y)return Promise.reject("ModelEntryDoorGuidePlugin.load(): position is undefined");const I=Ec(y),k=(_=w==null?void 0:w.rad)!=null?_:r,C=(T=w==null?void 0:w.fbx_url)!=null?T:a;if(e.rad=k,k===void 0)return Promise.reject(`ModelEntryDoorGuidePlugin.load(): rad is ${k}`);const D=yield new cs.FBXLoader().loadAsync(C);D.position.copy(I),D.rotation.z=k,D.scale.set(.8,.8,.8),Ps(D,{transparent:!0,side:P.DoubleSide});const x=(L=(S=(E=(H=D.children)==null?void 0:H[0])==null?void 0:E.children)==null?void 0:S[3])==null?void 0:L.clone();return x?(x.material=new M.MeshBasicMaterial({transparent:!0,map:Cc("\u5165\u6237\u95E8")}),x.renderOrder=3,D.children[0].add(x),e.object=D,!0):Promise.reject(`ModelEntryDoorGuidePlugin.load(): textMesh is ${x}`)}),d=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const w=1,y=new M.AnimationMixer(e.object);l.push(y);const I=y.clipAction(e.object.animations[0]);I.timeScale=w;let k;const C=()=>{let _=0,T=0;const H=1e3/30,E=S=>{_=requestAnimationFrame(E);const L=S-T;L<H||(T=S,l.forEach(B=>B.update(L/1e3)),o.needsRender=!0)};return _=requestAnimationFrame(E),()=>{cancelAnimationFrame(_)}},z={play:()=>{k||(I.play(),k=C(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{I.stop(),k==null||k(),k=void 0}};e.animation=z},u=w=>{var I;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((I=w==null?void 0:w.animationEnable)!=null?I:n)&&(e.animation||d(),e.animation.play()),o.scene.add(e.object),o.needsRender=!0},f=()=>{!e.object||(e.animation&&e.animation.stop(),o.scene.remove(e.object),o.needsRender=!0)},h=w=>w==="Floorplan"?u():f();return{load:c,enable:w=>(e.enabled||(e.enabled=!0,h(o.currentMode),o.on("modeChange",h),u(w)),!0),disable:()=>(e.enabled&&(e.enabled=!1,f(),o.off("modeChange",h)),!0)}};class Mn extends lt.default.Tween{constructor(){super(...arguments);m(this,"disposeMethods",[]);m(this,"animationFrameDisposer");m(this,"onDispose",e=>(this.disposeMethods.push(e),this));m(this,"play",()=>(this.start(0),this.animationFrameDisposer=Ut(e=>this.update(e)),this));m(this,"dispose",()=>{var e;this.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this.disposeMethods.forEach(n=>n()),this.disposeMethods=[],lt.default.remove(this)})}}function Is(o,t=lt.default.Easing.Linear.None){const e=new Mn({progress:0}).to({progress:1});return o!==void 0&&e.duration(o),t!==void 0&&e.easing(t),e}const dt=window.requestAnimationFrame||(o=>setTimeout(o,16)),Ic=window.cancelAnimationFrame||clearTimeout;function Yt(o,t=0){t<=0?dt(o):dt(()=>Yt(o,t-1))}function Ut(o,t=60){let e=-1,n=0,s=-1;const r=1e3/t;function a(l){s===-1&&(s=l),e=dt(a),!(l-n<r)&&(n=l,o&&o(l-s))}return e=dt(a),function(){Ic(e)}}function kc(){const o=Date.now();return new Promise(t=>{dt(()=>{t(Date.now()-o)})})}const xc=Ft.Easing;function Dc(o,t,e,n=xc.Linear.None){const s=new Ft.Tween(o).to(t,e).easing(n);Yt(()=>s.start(0));const r=Ut(l=>{s.update(l)===!1&&r()}),a=[];return s.onDestroy=l=>(a.push(l),s),s.destroy=function(){this.stop(),Object.assign(s,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let l;for(;l=a.shift();)l();r()},s}function Sc(o,t){return Dc({progress:0},{progress:1},o,t)}var ks=(o=>(o.Move="Move",o.Rotate="Rotate",o))(ks||{}),we=(o=>(o.Clockwise="Clockwise",o.Anticlockwise="Anticlockwise",o.Loop="Loop",o))(we||{});const _t=Math.PI*2;function ki(o){return(o%_t+_t)%_t}function xi(o){return o%_t}function nn(o,t,e){return o+(t-o)*e}const gn=(o,t,e)=>{const n=Math.PI,s=n*2;return o=ki(o),t=ki(t),e===we.Anticlockwise&&o<t&&(o+=s),e===we.Clockwise&&t<o&&(t+=s),e===we.Loop&&t-o>n?gn(o,t,we.Anticlockwise):e===we.Loop&&o-t>n?gn(o,t,we.Clockwise):{from:o,to:t}},Lc=o=>{const t={},e=(c,d,...u)=>F(exports,[c,d,...u],function*(r,a,l={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),l.asyncStartCallback&&(yield l.asyncStartCallback()),r.mode&&r.mode!==o.currentMode&&(yield o.changeMode(r.mode)),l.preload&&r.panoIndex!==void 0&&r.panoIndex!==o.panoIndex&&(yield o.preloadPano(r.panoIndex)),l.asyncEndCallback&&(yield l.asyncEndCallback()),r.panoIndex===void 0&&r.fov===void 0&&r.latitude===void 0&&r.longitude===void 0?!0:yield new Promise((f,h)=>{const p=r.panoIndex!==void 0?r.panoIndex:o.panoIndex;p!==void 0?o.moveToPano(p,Object.assign({duration:a,moveEndCallback:()=>f(!0),moveCancelCallback:()=>h(!1)},r)):h(!1)})}),n=r=>{const a=o.state,l=xi(a.latitude),c=xi(r.latitude),{from:d,to:u}=gn(a.longitude,r.longitude,r.rotation||we.Loop),f=a.fov,h=r.fov;return{from:{latitude:l,longitude:d,fov:f},to:{latitude:c,longitude:u,fov:h}}};return{move:e,rotate:(c,d,...u)=>F(exports,[c,d,...u],function*(r,a,l={}){t.interruptCallback&&t.interruptCallback(!1),l.asyncStartCallback&&(yield l.asyncStartCallback()),o.currentMode!==ee.Five.Mode.Panorama&&(yield o.changeMode(ee.Five.Mode.Panorama)),r.panoIndex!==void 0&&r.panoIndex!==o.panoIndex&&(l.preload&&(yield o.preloadPano(r.panoIndex)),yield new Promise((p,g)=>{if(!r.panoIndex){p(!0);return}o.moveToPano(r.panoIndex,{moveEndCallback:()=>p(!0),moveCancelCallback:()=>g(!1)})})),l.asyncEndCallback&&(yield l.asyncEndCallback());const{from:f,to:h}=n(r);return yield new Promise(p=>{const g=({progress:y})=>{const I={};I.longitude=nn(f.longitude,h.longitude,y),I.latitude=nn(f.latitude,h.latitude,y),I.fov=nn(f.fov,h.fov,y),o.setState(I,!0)},A=()=>{p(!0)},b=()=>{p(!1)},v=r.rotateSpeed?Math.ceil(Math.abs(h.longitude-f.longitude)/r.rotateSpeed*1e3):a,w=Sc(v,Ft.Easing.Linear.None).onUpdate(g).onComplete(A).onDestroy(b);r.rotation===we.Loop&&w.repeat(1/0).yoyo(!0),t.interruptCallback=(y=!0)=>{w.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),p(y)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},a)})})}};function Di(o,t){return o.x===t.x&&o.y===t.y}function xs(o,t){return Math.abs(o)===1/0&&Math.abs(t)===1/0?!0:Math.abs(o-t)<.001}function Qt(o,t){return(t.y-o.y)/(t.x-o.x)}function Ds(o,t,e){const n=Qt(o[1],o[0]),s=Qt(t[1],t[0]);if(isNaN(n)||isNaN(s)||xs(n,s))return!1;if(vt(o[0],t))return o[0];if(vt(o[1],t))return o[1];if(vt(t[0],o))return t[0];if(vt(t[1],o))return t[1];if(e&&!_c(o,t))return!1;const r=o[0],a=t[0];if(Math.abs(n)===1/0)return{x:r.x,y:t[1].y-(t[1].x-r.x)*s};if(Math.abs(s)===1/0)return{x:a.x,y:o[1].y-(o[1].x-a.x)*n};const l=(a.y-r.y+n*r.x-s*a.x)/(n-s),c=n*l-n*r.x+r.y;return{x:l,y:c}}function vt(o,t){return Di(o,t[0])||Di(o,t[1])?!0:(t[0].x-o.x)*(o.x-t[1].x)>=0&&(t[0].y-o.y)*(o.y-t[1].y)>=0&&xs(Qt(t[0],o),Qt(o,t[1]))}function bt(o,t,e){return(o.x-e.x)*(t.y-e.y)-(t.x-e.x)*(o.y-e.y)}function _c(o,t){return Math.max(o[0].x,o[1].x)>=Math.min(t[0].x,t[1].x)&&Math.max(t[0].x,t[1].x)>=Math.min(o[0].x,o[1].x)&&Math.max(o[0].y,o[1].y)>=Math.min(t[0].y,t[1].y)&&bt(t[0],o[1],o[0])*bt(o[1],t[1],o[0])>0&&bt(o[0],t[1],t[0])*bt(t[1],o[1],t[0])>0?1:0}function Ss(o,t=0){t<=0?requestAnimationFrame(o):requestAnimationFrame(()=>Ss(o,t-1))}const zc=`<style type="text/css">
|
|
110
|
+
`;return o.$$set=r=>{"content"in r&&e(0,n=r.content)},[n,s]}class La extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Sa,Da,i.safe_not_equal,{content:0},xa)}}function _a(o){i.append_styles(o,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function za(o){let t,e;return t=new ka({props:{url:o[1].url}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&2&&(r.url=n[1].url),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function Ma(o){let t,e;return t=new La({props:{content:o[0]}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&1&&(r.content=n[0]),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function Ta(o){let t,e,n,s;const r=[Ma,za],a=[];function l(c,d){return c[0]?0:c[1]?1:-1}return~(e=l(o))&&(n=a[e]=r[e](o)),{c(){t=i.element("div"),n&&n.c(),i.attr(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(c,d){i.insert(c,t,d),~e&&a[e].m(t,null),s=!0},p(c,[d]){let u=e;e=l(c),e===u?~e&&a[e].p(c,d):(n&&(i.group_outros(),i.transition_out(a[u],1,1,()=>{a[u]=null}),i.check_outros()),~e?(n=a[e],n?n.p(c,d):(n=a[e]=r[e](c),n.c()),i.transition_in(n,1),n.m(t,null)):n=null)},i(c){s||(i.transition_in(n),s=!0)},o(c){i.transition_out(n),s=!1},d(c){c&&i.detach(t),~e&&a[e].d()}}}function ja(o,t,e){let n,s,{floorIndex:r}=t,{floorplanData:a}=t;return o.$$set=l=>{"floorIndex"in l&&e(2,r=l.floorIndex),"floorplanData"in l&&e(3,a=l.floorplanData)},o.$$.update=()=>{var l,c;o.$$.dirty&12&&e(1,n=a.outlines[r]),o.$$.dirty&12&&e(0,s=(c=(l=a.outlines)==null?void 0:l[r])==null?void 0:c.svgContent)},[s,n,r,a]}class vs extends i.SvelteComponent{constructor(t){super(),i.init(this,t,ja,Ta,i.safe_not_equal,{floorIndex:2,floorplanData:3},_a)}}function Ba(o){i.append_styles(o,"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 Qa(o){let t,e=o[4].outerHTML+"",n;return{c(){t=new i.HtmlTag(!1),n=i.empty(),t.a=n},m(s,r){t.m(e,s,r),i.insert(s,n,r)},p(s,r){r&16&&e!==(e=s[4].outerHTML+"")&&t.p(e)},d(s){s&&i.detach(n),s&&t.d()}}}function Ra(o){let t,e=o[0].name+"",n,s,r,a;return{c(){t=i.element("span"),n=i.text(e),s=i.space(),r=i.element("span"),a=i.text(o[5]),i.attr(t,"class","floorplan-plugin__room-name"),i.attr(r,"class","floorplan-plugin__room-size svelte-12pzct5")},m(l,c){i.insert(l,t,c),i.append(t,n),i.insert(l,s,c),i.insert(l,r,c),i.append(r,a)},p(l,c){c&1&&e!==(e=l[0].name+"")&&i.set_data(n,e),c&32&&i.set_data(a,l[5])},d(l){l&&i.detach(t),l&&i.detach(s),l&&i.detach(r)}}}function Oa(o){let t;function e(r,a){if(r[1]===void 0)return Ra;if(r[4])return Qa}let n=e(o),s=n&&n(o);return{c(){t=i.element("div"),s&&s.c(),i.attr(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),i.set_style(t,"left",o[6],!1),i.set_style(t,"top",o[7],!1),i.set_style(t,"font-size",o[8],!1),i.set_style(t,"opacity",o[3]?"1":"0",!1)},m(r,a){i.insert(r,t,a),s&&s.m(t,null),o[16](t)},p(r,[a]){n===(n=e(r))&&s?s.p(r,a):(s&&s.d(1),s=n&&n(r),s&&(s.c(),s.m(t,null))),a&8&&i.set_style(t,"opacity",r[3]?"1":"0",!1)},i:i.noop,o:i.noop,d(r){r&&i.detach(t),s&&s.d(),o[16](null)}}}function Ha(o,t){const e=o[0],n=o[1];let s=!1;for(let r=0,a=t.length-1;r<t.length;a=r++){const l=t[r][0],c=t[r][1],d=t[a][0],u=t[a][1];c>n!=u>n&&e<(d-l)*(n-c)/(u-c)+l&&(s=!s)}return s}function Fa(o,t,e){let n,s,r,a,{pxmm:l}=t,{room:c}=t,{hoveredRoom:d}=t,{getRoomAreaText:u}=t,{getLabelElement:f}=t,{adaptiveRoomLabelVisibleEnable:h}=t;function p(x,z){if(z.width===0||z.height===0)return()=>!1;const L=x.path.map(({x:G,y:Q})=>[G,Q]),T=x.roomLabel.position,{x:R,y:E}=T,{width:S,height:_}=z,B=S/2,O=_/2;return function(Q){const H=R*Q,X=E*Q,Y=L.map(([te,oe])=>[te*Q,oe*Q]);return[[H+B,X-O],[H-B,X-O],[H-B,X+O],[H+B,X+O]].every(te=>Ha(te,Y))}}const g=document.body.clientWidth,A=document.body.clientHeight,b=c.roomLabel,v=b.positionInImage.x*100+"%",w=b.positionInImage.y*100+"%",y=(g<500||A<500?10:14)/16+"rem";let I=!1,k,C;d.subscribe(function(z){e(13,I=!!z&&z.id===c.id)}),Z.onMount(()=>{const x=k==null?void 0:k.getClientRects()[0];e(14,C={width:x.width,height:x.height})});function D(x){i.binding_callbacks[x?"unshift":"push"](()=>{k=x,e(2,k)})}return o.$$set=x=>{"pxmm"in x&&e(9,l=x.pxmm),"room"in x&&e(0,c=x.room),"hoveredRoom"in x&&e(10,d=x.hoveredRoom),"getRoomAreaText"in x&&e(11,u=x.getRoomAreaText),"getLabelElement"in x&&e(1,f=x.getLabelElement),"adaptiveRoomLabelVisibleEnable"in x&&e(12,h=x.adaptiveRoomLabelVisibleEnable)},o.$$.update=()=>{o.$$.dirty&2049&&e(5,n=c.size?u(c.size):""),o.$$.dirty&16385&&e(15,s=C?p(c,C):void 0),o.$$.dirty&3&&e(4,r=f==null?void 0:f(c)),o.$$.dirty&45568&&e(3,a=h?I?!0:!!(s!=null&&s(l)):!0)},[c,f,k,a,r,n,v,w,y,l,d,u,h,I,C,s,D]}class Ga extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Fa,Oa,i.safe_not_equal,{pxmm:9,room:0,hoveredRoom:10,getRoomAreaText:11,getLabelElement:1,adaptiveRoomLabelVisibleEnable:12},Ba)}}function Na(o){i.append_styles(o,"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 Kn(o,t,e){const n=o.slice();return n[10]=t[e],n}function $n(o){let t,e=[],n=new Map,s,r,a=o[6];const l=c=>c[10].id;for(let c=0;c<a.length;c+=1){let d=Kn(o,a,c),u=l(d);n.set(u,e[c]=ei(u,d))}return{c(){t=i.element("div");for(let c=0;c<e.length;c+=1)e[c].c();i.attr(t,"class","floorplan-plugin__room-labels svelte-13xux0b"),i.add_render_callback(()=>o[9].call(t))},m(c,d){i.insert(c,t,d);for(let u=0;u<e.length;u+=1)e[u].m(t,null);s=i.add_resize_listener(t,o[9].bind(t)),r=!0},p(c,d){d&111&&(a=c[6],i.group_outros(),e=i.update_keyed_each(e,d,l,1,c,a,n,t,i.outro_and_destroy_block,ei,null,Kn),i.check_outros())},i(c){if(!r){for(let d=0;d<a.length;d+=1)i.transition_in(e[d]);r=!0}},o(c){for(let d=0;d<e.length;d+=1)i.transition_out(e[d]);r=!1},d(c){c&&i.detach(t);for(let d=0;d<e.length;d+=1)e[d].d();s()}}}function ei(o,t){let e,n,s;const r=[{pxmm:t[5],room:t[10],getLabelElement:t[2],getRoomAreaText:t[1],hoveredRoom:t[0],adaptiveRoomLabelVisibleEnable:t[3]}];let a={};for(let l=0;l<r.length;l+=1)a=i.assign(a,r[l]);return n=new Ga({props:a}),{key:o,first:null,c(){e=i.empty(),i.create_component(n.$$.fragment),this.first=e},m(l,c){i.insert(l,e,c),i.mount_component(n,l,c),s=!0},p(l,c){t=l;const d=c&111?i.get_spread_update(r,[{pxmm:t[5],room:t[10],getLabelElement:t[2],getRoomAreaText:t[1],hoveredRoom:t[0],adaptiveRoomLabelVisibleEnable:t[3]}]):{};n.$set(d)},i(l){s||(i.transition_in(n.$$.fragment,l),s=!0)},o(l){i.transition_out(n.$$.fragment,l),s=!1},d(l){l&&i.detach(e),i.destroy_component(n,l)}}}function Wa(o){let t,e,n=o[6]&&$n(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[6]?n?(n.p(s,r),r&64&&i.transition_in(n,1)):(n=$n(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function Xa(o,t,e){let n,{floorIndex:s}=t,{floorplanData:r}=t,{hoveredRoom:a}=t,{getRoomAreaText:l}=t,{getLabelElement:c}=t,{adaptiveRoomLabelVisibleEnable:d}=t,u=0,f=0;function h(){u=this.clientWidth,e(4,u)}return o.$$set=p=>{"floorIndex"in p&&e(7,s=p.floorIndex),"floorplanData"in p&&e(8,r=p.floorplanData),"hoveredRoom"in p&&e(0,a=p.hoveredRoom),"getRoomAreaText"in p&&e(1,l=p.getRoomAreaText),"getLabelElement"in p&&e(2,c=p.getLabelElement),"adaptiveRoomLabelVisibleEnable"in p&&e(3,d=p.adaptiveRoomLabelVisibleEnable)},o.$$.update=()=>{if(o.$$.dirty&384&&e(6,n=r.floorDatas[s].rooms),o.$$.dirty&272){const{max:p,min:g}=r.bounding,A=p.x-g.x;e(5,f=u/A)}},[a,l,c,d,u,f,n,s,r,h]}class Ya extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Xa,Wa,i.safe_not_equal,{floorIndex:7,floorplanData:8,hoveredRoom:0,getRoomAreaText:1,getLabelElement:2,adaptiveRoomLabelVisibleEnable:3},Na)}}function Ua(o){i.append_styles(o,"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 ti(o,t,e){const n=o.slice();return n[11]=t[e],n[13]=e,n}function ni(o,t,e){const n=o.slice();return n[14]=t[e],n}function ii(o){let t;return{c(){t=i.element("div"),i.attr(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),i.set_style(t,"left",o[14].left*100+"%",!1),i.set_style(t,"bottom",o[14].bottom*100+"%",!1)},m(e,n){i.insert(e,t,n)},p:i.noop,d(e){e&&i.detach(t)}}}function oi(o,t){let e,n,s=t[1](t[11].distance)+"",r,a;return{key:o,first:null,c(){e=i.element("div"),n=i.element("div"),r=i.text(s),a=i.space(),i.attr(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),i.toggle_class(n,"is-row",t[2]),i.attr(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),i.set_style(e,"left",t[11].left*100+"%",!1),i.set_style(e,"bottom",t[11].bottom*100+"%",!1),this.first=e},m(l,c){i.insert(l,e,c),i.append(e,n),i.append(n,r),i.append(e,a)},p(l,c){t=l,c&2&&s!==(s=t[1](t[11].distance)+"")&&i.set_data(r,s)},d(l){l&&i.detach(e)}}}function Va(o){let t,e,n,s,r,a,l=[],c=new Map,d,u=o[3],f=[];for(let g=0;g<u.length;g+=1)f[g]=ii(ni(o,u,g));let h=o[4];const p=g=>g[13];for(let g=0;g<h.length;g+=1){let A=ti(o,h,g),b=p(A);c.set(b,l[g]=oi(b,A))}return{c(){t=i.element("div"),e=i.element("div"),n=i.space(),s=i.element("div");for(let g=0;g<f.length;g+=1)f[g].c();r=i.space(),a=i.element("div");for(let g=0;g<l.length;g+=1)l[g].c();i.attr(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),i.attr(s,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),i.toggle_class(s,"is-row",o[2]),i.attr(a,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),i.attr(t,"class",d="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+o[0]+" svelte-djlmk4"),i.toggle_class(t,"is-row",o[2]),i.set_style(t,"width",o[2]?"100%":1/16+"rem",!1),i.set_style(t,"height",o[2]?1/16+"rem":"100%",!1)},m(g,A){i.insert(g,t,A),i.append(t,e),i.append(t,n),i.append(t,s);for(let b=0;b<f.length;b+=1)f[b].m(s,null);i.append(t,r),i.append(t,a);for(let b=0;b<l.length;b+=1)l[b].m(a,null)},p(g,[A]){if(A&8){u=g[3];let b;for(b=0;b<u.length;b+=1){const v=ni(g,u,b);f[b]?f[b].p(v,A):(f[b]=ii(v),f[b].c(),f[b].m(s,null))}for(;b<f.length;b+=1)f[b].d(1);f.length=u.length}A&22&&(h=g[4],l=i.update_keyed_each(l,A,p,1,g,h,c,a,i.destroy_block,oi,null,ti)),A&1&&d!==(d="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+g[0]+" svelte-djlmk4")&&i.attr(t,"class",d),A&5&&i.toggle_class(t,"is-row",g[2])},i:i.noop,o:i.noop,d(g){g&&i.detach(t),i.destroy_each(f,g);for(let A=0;A<l.length;A+=1)l[A].d()}}}const Ke=1e3,$e=180;function Ja(o,t,e){let{type:n}=t,{data:s}=t,{bounding:r}=t,{getRuleDistanceText:a}=t;const l=n==="top"||n==="bottom",c=r.max.x-r.min.x-(Ke-$e)*2,d=r.max.y-r.min.y-(Ke-$e)*2,u=s.map(([g,A])=>l?[g.x,A.x]:[g.y,A.y]).flat().sort().filter((g,A,b)=>A===0?!0:g!==b[A-1]),f=u.map(g=>{const A=l?(g-r.min.x-Ke+$e)/c:0,b=l?0:(g-r.min.y-Ke+$e)/d;return{left:A,bottom:b}});f.unshift({left:0,bottom:0}),f.push(l?{left:1,bottom:0}:{left:0,bottom:1});const h=u[u.length-1]-u[0],p=u.map((g,A,b)=>{const v=A===0?0:g-b[A-1],w=A===0?0:(g+b[A-1])/2,y=l?(w-r.min.x-Ke+$e)/c:0,I=l?0:(w-r.min.y-Ke+$e)/d;return{left:y,bottom:I,distance:v}}).filter(({distance:g})=>g/h>.1);return o.$$set=g=>{"type"in g&&e(0,n=g.type),"data"in g&&e(5,s=g.data),"bounding"in g&&e(6,r=g.bounding),"getRuleDistanceText"in g&&e(1,a=g.getRuleDistanceText)},[n,a,l,f,p,s,r]}class Za extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Ja,Va,i.safe_not_equal,{type:0,data:5,bounding:6,getRuleDistanceText:1},Ua)}}function qa(o){i.append_styles(o,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function si(o,t,e){const n=o.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function ri(o,t){let e,n,s;const r=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let a={};for(let l=0;l<r.length;l+=1)a=i.assign(a,r[l]);return n=new Za({props:a}),{key:o,first:null,c(){e=i.empty(),i.create_component(n.$$.fragment),this.first=e},m(l,c){i.insert(l,e,c),i.mount_component(n,l,c),s=!0},p(l,c){t=l;const d=c&19?i.get_spread_update(r,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(d)},i(l){s||(i.transition_in(n.$$.fragment,l),s=!0)},o(l){i.transition_out(n.$$.fragment,l),s=!1},d(l){l&&i.detach(e),i.destroy_component(n,l)}}}function Ka(o){let t,e=[],n=new Map,s,r=o[4];const a=l=>l[13];for(let l=0;l<r.length;l+=1){let c=si(o,r,l),d=a(c);n.set(d,e[l]=ri(d,c))}return{c(){t=i.element("div");for(let l=0;l<e.length;l+=1)e[l].c();i.attr(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),i.set_style(t,"width",o[3],!1),i.set_style(t,"height",o[2],!1)},m(l,c){i.insert(l,t,c);for(let d=0;d<e.length;d+=1)e[d].m(t,null);s=!0},p(l,[c]){c&19&&(r=l[4],i.group_outros(),e=i.update_keyed_each(e,c,a,1,l,r,n,t,i.outro_and_destroy_block,ri,null,si),i.check_outros()),c&8&&i.set_style(t,"width",l[3],!1),c&4&&i.set_style(t,"height",l[2],!1)},i(l){if(!s){for(let c=0;c<r.length;c+=1)i.transition_in(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)i.transition_out(e[c]);s=!1},d(l){l&&i.detach(t);for(let c=0;c<e.length;c+=1)e[c].d()}}}const ai=1e3,li=180;function $a(o,t,e){let n,s,r,a,l,c,d,u,f,h,{floorIndex:p}=t,{floorplanData:g}=t,{getRuleDistanceText:A}=t;return o.$$set=b=>{"floorIndex"in b&&e(5,p=b.floorIndex),"floorplanData"in b&&e(6,g=b.floorplanData),"getRuleDistanceText"in b&&e(0,A=b.getRuleDistanceText)},o.$$.update=()=>{o.$$.dirty&64&&e(1,n=g.bounding),o.$$.dirty&96&&e(11,s=g.floorDatas[p].rules),o.$$.dirty&2048&&e(12,r=Object.keys(s)),o.$$.dirty&6144&&e(4,a=r.map(b=>[b,s[b]])),o.$$.dirty&2&&e(9,l=n.max.x-n.min.x),o.$$.dirty&2&&e(7,c=n.max.y-n.min.y),o.$$.dirty&2&&e(10,d=n.max.x-n.min.x-(ai-li)*2),o.$$.dirty&2&&e(8,u=n.max.y-n.min.y-(ai-li)*2),o.$$.dirty&1536&&e(3,f=d/l*100+"%"),o.$$.dirty&384&&e(2,h=u/c*100+"%")},[A,n,h,f,a,p,g,c,u,l,d,s,r]}class el extends i.SvelteComponent{constructor(t){super(),i.init(this,t,$a,Ka,i.safe_not_equal,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},qa)}}function Nt(o,t={}){let e="";const{needZ:n,needA:s}=t;return(n?o.slice().concat(o[0]):o.slice()).forEach((a,l)=>{const{x:c,y:d}=t.format?t.format(a):a,u=c+","+d;return l===0?(e+="M"+u,e):s!=null&&s[l]?(e+="A"+s[l]+","+u,e):(e+="L"+u,e)}),e+(n?"Z":"")}function bs({x:o,y:t},e){const{max:n,min:s}=e;return{x:o-s.x,y:n.y-t}}function tl(o,t){const e=o.x*1e3+t.bounding.origin.x,n=-o.z*1e3+t.bounding.origin.y;return{x:e,y:n}}function nl(o,t){const e=t.bounding,n=e.max.x-e.min.x,s=e.max.y-e.min.y;return{x:(o.x-e.min.x)/n,y:(e.max.y-o.y)/s}}function il(o,t){return Math.max(...t.work.observers.map(n=>o.z>=n.standingPosition.z?n.floorIndex:0))}function ol(o){let t;return{c(){t=i.svg_element("path"),i.attr(t,"d",o[0]),i.attr(t,"fill","#2F313A")},m(e,n){i.insert(e,t,n)},p(e,[n]){n&1&&i.attr(t,"d",e[0])},i:i.noop,o:i.noop,d(e){e&&i.detach(t)}}}function sl(o,t,e){let n,{path:s}=t;return o.$$set=r=>{"path"in r&&e(1,s=r.path)},o.$$.update=()=>{o.$$.dirty&2&&e(0,n=Nt(s,{needZ:!0}))},[n,s]}class rl extends i.SvelteComponent{constructor(t){super(),i.init(this,t,sl,ol,i.safe_not_equal,{path:1})}}function al(o){let t,e,n,s,r,a;return{c(){t=i.svg_element("defs"),e=i.svg_element("pattern"),n=i.svg_element("rect"),s=i.svg_element("path"),r=i.space(),a=i.svg_element("path"),i.attr(n,"x","0"),i.attr(n,"y","0"),i.attr(n,"width",o[1]),i.attr(n,"height",o[1]),i.attr(n,"fill","#323747"),i.attr(s,"d",o[2]),i.attr(s,"stroke","#ffffff"),i.attr(s,"stroke-opacity","0.06"),i.attr(s,"stroke-width","0.5"),i.attr(s,"fill","none"),i.attr(e,"id","fpm-room-pattern-0"),i.attr(e,"x","0"),i.attr(e,"y","0"),i.attr(e,"width",o[1]),i.attr(e,"height",o[1]),i.attr(e,"patternUnits","userSpaceOnUse"),i.attr(e,"patternTransform","scale(50 50)"),i.attr(a,"d",o[0]),i.attr(a,"fill","url(#fpm-room-pattern-0)")},m(l,c){i.insert(l,t,c),i.append(t,e),i.append(e,n),i.append(e,s),i.insert(l,r,c),i.insert(l,a,c)},p(l,[c]){c&1&&i.attr(a,"d",l[0])},i:i.noop,o:i.noop,d(l){l&&i.detach(t),l&&i.detach(r),l&&i.detach(a)}}}const en=6;function ll(o,t,e){let n,{path:s}=t;const r=en*2,a=`M0 ${en} h ${r} M${en} 0 v ${r}`;return o.$$set=l=>{"path"in l&&e(3,s=l.path)},o.$$.update=()=>{o.$$.dirty&8&&e(0,n=Nt(s,{needZ:!0}))},[n,r,a,s]}class cl extends i.SvelteComponent{constructor(t){super(),i.init(this,t,ll,al,i.safe_not_equal,{path:3})}}function dl(o){let t,e,n,s,r,a,l,c,d,u,f;return{c(){t=i.svg_element("defs"),e=i.svg_element("pattern"),n=i.svg_element("rect"),s=i.svg_element("pattern"),r=i.svg_element("rect"),a=i.space(),l=i.svg_element("path"),c=i.space(),d=i.svg_element("path"),u=i.space(),f=i.svg_element("path"),i.attr(n,"x","0"),i.attr(n,"y","0"),i.attr(n,"width","6"),i.attr(n,"height","50"),i.attr(n,"fill","none"),i.attr(n,"stroke","#4B4B57"),i.attr(n,"stroke-width","0.5"),i.attr(e,"id","room-material-pattern-1"),i.attr(e,"x","0"),i.attr(e,"y","0"),i.attr(e,"width","12"),i.attr(e,"height","50"),i.attr(e,"patternUnits","userSpaceOnUse"),i.attr(e,"patternTransform","scale(50 50)"),i.attr(r,"x","0"),i.attr(r,"y","0"),i.attr(r,"width","6"),i.attr(r,"height","50"),i.attr(r,"fill","none"),i.attr(r,"stroke","#4B4B57"),i.attr(r,"stroke-width","0.5"),i.attr(s,"id","room-material-pattern-2"),i.attr(s,"x","6"),i.attr(s,"y","25"),i.attr(s,"width","12"),i.attr(s,"height","50"),i.attr(s,"patternUnits","userSpaceOnUse"),i.attr(s,"patternTransform","scale(50 50)"),i.attr(l,"d",o[0]),i.attr(l,"fill","#43434D"),i.attr(d,"d",o[0]),i.attr(d,"fill","url(#room-material-pattern-1)"),i.attr(f,"d",o[0]),i.attr(f,"fill","url(#room-material-pattern-2)")},m(h,p){i.insert(h,t,p),i.append(t,e),i.append(e,n),i.append(t,s),i.append(s,r),i.insert(h,a,p),i.insert(h,l,p),i.insert(h,c,p),i.insert(h,d,p),i.insert(h,u,p),i.insert(h,f,p)},p(h,[p]){p&1&&i.attr(l,"d",h[0]),p&1&&i.attr(d,"d",h[0]),p&1&&i.attr(f,"d",h[0])},i:i.noop,o:i.noop,d(h){h&&i.detach(t),h&&i.detach(a),h&&i.detach(l),h&&i.detach(c),h&&i.detach(d),h&&i.detach(u),h&&i.detach(f)}}}function ul(o,t,e){let n,{path:s}=t;return o.$$set=r=>{"path"in r&&e(1,s=r.path)},o.$$.update=()=>{o.$$.dirty&2&&e(0,n=Nt(s,{needZ:!0}))},[n,s]}class hl extends i.SvelteComponent{constructor(t){super(),i.init(this,t,ul,dl,i.safe_not_equal,{path:1})}}function fl(o){i.append_styles(o,"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 ci(o,t,e){const n=o.slice();return n[5]=t[e],n}function ml(o){let t,e;return t=new cl({props:{path:o[5].path}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&1&&(r.path=n[5].path),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function pl(o){let t,e;return t=new hl({props:{path:o[5].path}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&1&&(r.path=n[5].path),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function gl(o){let t,e;return t=new rl({props:{path:o[5].path}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&1&&(r.path=n[5].path),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function di(o){let t,e,n,s;const r=[gl,pl,ml],a=[];function l(c,d){return c[5].floorType===1?0:c[5].floorType===0?1:2}return e=l(o),n=a[e]=r[e](o),{c(){t=i.svg_element("svg"),n.c(),i.attr(t,"width","100%"),i.attr(t,"height","100%"),i.attr(t,"viewBox",`0 0 ${o[1]} ${o[2]}`),i.attr(t,"class","svelte-1dykexu")},m(c,d){i.insert(c,t,d),a[e].m(t,null),s=!0},p(c,d){let u=e;e=l(c),e===u?a[e].p(c,d):(i.group_outros(),i.transition_out(a[u],1,1,()=>{a[u]=null}),i.check_outros(),n=a[e],n?n.p(c,d):(n=a[e]=r[e](c),n.c()),i.transition_in(n,1),n.m(t,null))},i(c){s||(i.transition_in(n),s=!0)},o(c){i.transition_out(n),s=!1},d(c){c&&i.detach(t),a[e].d()}}}function Al(o){let t,e,n=o[0],s=[];for(let a=0;a<n.length;a+=1)s[a]=di(ci(o,n,a));const r=a=>i.transition_out(s[a],1,1,()=>{s[a]=null});return{c(){t=i.element("div");for(let a=0;a<s.length;a+=1)s[a].c();i.attr(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(a,l){i.insert(a,t,l);for(let c=0;c<s.length;c+=1)s[c].m(t,null);e=!0},p(a,[l]){if(l&7){n=a[0];let c;for(c=0;c<n.length;c+=1){const d=ci(a,n,c);s[c]?(s[c].p(d,l),i.transition_in(s[c],1)):(s[c]=di(d),s[c].c(),i.transition_in(s[c],1),s[c].m(t,null))}for(i.group_outros(),c=n.length;c<s.length;c+=1)r(c);i.check_outros()}},i(a){if(!e){for(let l=0;l<n.length;l+=1)i.transition_in(s[l]);e=!0}},o(a){s=s.filter(Boolean);for(let l=0;l<s.length;l+=1)i.transition_out(s[l]);e=!1},d(a){a&&i.detach(t),i.destroy_each(s,a)}}}function vl(o,t,e){let n,{floorIndex:s}=t,{floorplanData:r}=t;const a=r.bounding.max.x-r.bounding.min.x,l=r.bounding.max.y-r.bounding.min.y;return o.$$set=c=>{"floorIndex"in c&&e(3,s=c.floorIndex),"floorplanData"in c&&e(4,r=c.floorplanData)},o.$$.update=()=>{o.$$.dirty&24&&e(0,n=r.floorDatas[s].rooms.map(c=>V(j({},c),{path:c.path.map(d=>bs(d,r.bounding))})))},[n,a,l,s,r]}class bl extends i.SvelteComponent{constructor(t){super(),i.init(this,t,vl,Al,i.safe_not_equal,{floorIndex:3,floorplanData:4},fl)}}function yl(o){i.append_styles(o,"svelte-19uvvss","path.svelte-19uvvss{opacity:0}path.svelte-19uvvss:hover{opacity:0.1}")}function wl(o){let t,e,n;return{c(){t=i.svg_element("path"),i.attr(t,"d",o[2]),i.attr(t,"fill","#fff"),i.attr(t,"class","svelte-19uvvss")},m(s,r){i.insert(s,t,r),e||(n=[i.listen(t,"mouseenter",o[0]),i.listen(t,"mouseleave",o[1])],e=!0)},p:i.noop,i:i.noop,o:i.noop,d(s){s&&i.detach(t),e=!1,i.run_all(n)}}}function Cl(o,t,e){let{room:n}=t,{floorplanData:s}=t,{hoveredRoom:r}=t;function a(){r.set(n)}function l(){r.set(void 0)}const{bounding:c}=s,d=Nt(n.path,{needZ:!0,format:u=>bs(u,c)});return o.$$set=u=>{"room"in u&&e(3,n=u.room),"floorplanData"in u&&e(4,s=u.floorplanData),"hoveredRoom"in u&&e(5,r=u.hoveredRoom)},[a,l,d,n,s,r]}class El extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Cl,wl,i.safe_not_equal,{room:3,floorplanData:4,hoveredRoom:5},yl)}}function Pl(o){i.append_styles(o,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function ui(o,t,e){const n=o.slice();return n[5]=t[e],n}function hi(o,t){let e,n,s;const r=[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}];let a={};for(let l=0;l<r.length;l+=1)a=i.assign(a,r[l]);return n=new El({props:a}),{key:o,first:null,c(){e=i.empty(),i.create_component(n.$$.fragment),this.first=e},m(l,c){i.insert(l,e,c),i.mount_component(n,l,c),s=!0},p(l,c){t=l;const d=c&7?i.get_spread_update(r,[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}]):{};n.$set(d)},i(l){s||(i.transition_in(n.$$.fragment,l),s=!0)},o(l){i.transition_out(n.$$.fragment,l),s=!1},d(l){l&&i.detach(e),i.destroy_component(n,l)}}}function Il(o){let t,e,n=[],s=new Map,r,a=o[1].floorDatas[o[0]].rooms;const l=c=>c[5].id;for(let c=0;c<a.length;c+=1){let d=ui(o,a,c),u=l(d);s.set(u,n[c]=hi(u,d))}return{c(){t=i.element("div"),e=i.svg_element("svg");for(let c=0;c<n.length;c+=1)n[c].c();i.attr(e,"width","100%"),i.attr(e,"height","100%"),i.attr(e,"viewBox",`0 0 ${o[3]} ${o[4]}`),i.attr(e,"class","svelte-1kqo6e4"),i.attr(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(c,d){i.insert(c,t,d),i.append(t,e);for(let u=0;u<n.length;u+=1)n[u].m(e,null);r=!0},p(c,[d]){d&7&&(a=c[1].floorDatas[c[0]].rooms,i.group_outros(),n=i.update_keyed_each(n,d,l,1,c,a,s,e,i.outro_and_destroy_block,hi,null,ui),i.check_outros())},i(c){if(!r){for(let d=0;d<a.length;d+=1)i.transition_in(n[d]);r=!0}},o(c){for(let d=0;d<n.length;d+=1)i.transition_out(n[d]);r=!1},d(c){c&&i.detach(t);for(let d=0;d<n.length;d+=1)n[d].d()}}}function kl(o,t,e){let{floorIndex:n}=t,{floorplanData:s}=t,{hoveredRoom:r}=t;const a=s.bounding.max.x-s.bounding.min.x,l=s.bounding.max.y-s.bounding.min.y;return o.$$set=c=>{"floorIndex"in c&&e(0,n=c.floorIndex),"floorplanData"in c&&e(1,s=c.floorplanData),"hoveredRoom"in c&&e(2,r=c.hoveredRoom)},[n,s,r,a,l]}class ys extends i.SvelteComponent{constructor(t){super(),i.init(this,t,kl,Il,i.safe_not_equal,{floorIndex:0,floorplanData:1,hoveredRoom:2},Pl)}}function xl(o){i.append_styles(o,"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 fi(o){let t,e;const n=[{floorIndex:o[1],floorplanData:o[5],hoveredRoom:o[10]}];let s={};for(let r=0;r<n.length;r+=1)s=i.assign(s,n[r]);return t=new ys({props:s}),{c(){i.create_component(t.$$.fragment)},m(r,a){i.mount_component(t,r,a),e=!0},p(r,a){const l=a&1058?i.get_spread_update(n,[{floorIndex:r[1],floorplanData:r[5],hoveredRoom:r[10]}]):{};t.$set(l)},i(r){e||(i.transition_in(t.$$.fragment,r),e=!0)},o(r){i.transition_out(t.$$.fragment,r),e=!1},d(r){i.destroy_component(t,r)}}}function mi(o){let t,e;const n=[{floorplanData:o[5],floorIndex:o[1],getRoomAreaText:o[6],getLabelElement:o[7],hoveredRoom:o[10],adaptiveRoomLabelVisibleEnable:o[9]}];let s={};for(let r=0;r<n.length;r+=1)s=i.assign(s,n[r]);return t=new Ya({props:s}),{c(){i.create_component(t.$$.fragment)},m(r,a){i.mount_component(t,r,a),e=!0},p(r,a){const l=a&1762?i.get_spread_update(n,[{floorplanData:r[5],floorIndex:r[1],getRoomAreaText:r[6],getLabelElement:r[7],hoveredRoom:r[10],adaptiveRoomLabelVisibleEnable:r[9]}]):{};t.$set(l)},i(r){e||(i.transition_in(t.$$.fragment,r),e=!0)},o(r){i.transition_out(t.$$.fragment,r),e=!1},d(r){i.destroy_component(t,r)}}}function pi(o){let t,e;const n=[{floorplanData:o[5],floorIndex:o[1],getRuleDistanceText:o[8]}];let s={};for(let r=0;r<n.length;r+=1)s=i.assign(s,n[r]);return t=new el({props:s}),{c(){i.create_component(t.$$.fragment)},m(r,a){i.mount_component(t,r,a),e=!0},p(r,a){const l=a&290?i.get_spread_update(n,[{floorplanData:r[5],floorIndex:r[1],getRuleDistanceText:r[8]}]):{};t.$set(l)},i(r){e||(i.transition_in(t.$$.fragment,r),e=!0)},o(r){i.transition_out(t.$$.fragment,r),e=!1},d(r){i.destroy_component(t,r)}}}function Dl(o){let t,e,n,s,r,a,l,c,d;const u=[{floorIndex:o[1],floorplanData:o[5]}];let f={};for(let v=0;v<u.length;v+=1)f=i.assign(f,u[v]);e=new bl({props:f});let h=o[2]&&fi(o);const p=[{floorplanData:o[5],floorIndex:o[1]}];let g={};for(let v=0;v<p.length;v+=1)g=i.assign(g,p[v]);r=new vs({props:g});let A=o[3]&&mi(o),b=o[4]&&pi(o);return{c(){t=i.element("div"),i.create_component(e.$$.fragment),n=i.space(),h&&h.c(),s=i.space(),i.create_component(r.$$.fragment),a=i.space(),A&&A.c(),l=i.space(),b&&b.c(),i.attr(t,"class",c=i.null_to_empty(`floorplan-plugin__floor${o[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(v,w){i.insert(v,t,w),i.mount_component(e,t,null),i.append(t,n),h&&h.m(t,null),i.append(t,s),i.mount_component(r,t,null),i.append(t,a),A&&A.m(t,null),i.append(t,l),b&&b.m(t,null),d=!0},p(v,[w]){const y=w&34?i.get_spread_update(u,[{floorIndex:v[1],floorplanData:v[5]}]):{};e.$set(y),v[2]?h?(h.p(v,w),w&4&&i.transition_in(h,1)):(h=fi(v),h.c(),i.transition_in(h,1),h.m(t,s)):h&&(i.group_outros(),i.transition_out(h,1,1,()=>{h=null}),i.check_outros());const I=w&34?i.get_spread_update(p,[{floorplanData:v[5],floorIndex:v[1]}]):{};r.$set(I),v[3]?A?(A.p(v,w),w&8&&i.transition_in(A,1)):(A=mi(v),A.c(),i.transition_in(A,1),A.m(t,l)):A&&(i.group_outros(),i.transition_out(A,1,1,()=>{A=null}),i.check_outros()),v[4]?b?(b.p(v,w),w&16&&i.transition_in(b,1)):(b=pi(v),b.c(),i.transition_in(b,1),b.m(t,null)):b&&(i.group_outros(),i.transition_out(b,1,1,()=>{b=null}),i.check_outros()),(!d||w&1&&c!==(c=i.null_to_empty(`floorplan-plugin__floor${v[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&i.attr(t,"class",c)},i(v){d||(i.transition_in(e.$$.fragment,v),i.transition_in(h),i.transition_in(r.$$.fragment,v),i.transition_in(A),i.transition_in(b),d=!0)},o(v){i.transition_out(e.$$.fragment,v),i.transition_out(h),i.transition_out(r.$$.fragment,v),i.transition_out(A),i.transition_out(b),d=!1},d(v){v&&i.detach(t),i.destroy_component(e),h&&h.d(),i.destroy_component(r),A&&A.d(),b&&b.d()}}}function Sl(o,t,e){let{isCurrent:n}=t,{floorIndex:s}=t,{hoverEnable:r}=t,{roomLabelsEnable:a}=t,{ruleLabelsEnable:l}=t,{floorplanData:c}=t,{getRoomAreaText:d}=t,{getLabelElement:u}=t,{getRuleDistanceText:f}=t,{adaptiveRoomLabelVisibleEnable:h}=t;const p=kn.writable(void 0);return o.$$set=g=>{"isCurrent"in g&&e(0,n=g.isCurrent),"floorIndex"in g&&e(1,s=g.floorIndex),"hoverEnable"in g&&e(2,r=g.hoverEnable),"roomLabelsEnable"in g&&e(3,a=g.roomLabelsEnable),"ruleLabelsEnable"in g&&e(4,l=g.ruleLabelsEnable),"floorplanData"in g&&e(5,c=g.floorplanData),"getRoomAreaText"in g&&e(6,d=g.getRoomAreaText),"getLabelElement"in g&&e(7,u=g.getLabelElement),"getRuleDistanceText"in g&&e(8,f=g.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in g&&e(9,h=g.adaptiveRoomLabelVisibleEnable)},[n,s,r,a,l,c,d,u,f,h,p]}class Ll extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Sl,Dl,i.safe_not_equal,{isCurrent:0,floorIndex:1,hoverEnable:2,roomLabelsEnable:3,ruleLabelsEnable:4,floorplanData:5,getRoomAreaText:6,getLabelElement:7,getRuleDistanceText:8,adaptiveRoomLabelVisibleEnable:9},xl)}}function _l(o){i.append_styles(o,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function gi(o,t,e){const n=o.slice();return n[16]=t[e],n}function Ai(o){let t,e,n,s,r,a,l=o[9].floorDatas,c=[];for(let p=0;p<l.length;p+=1)c[p]=vi(gi(o,l,p));const d=p=>i.transition_out(c[p],1,1,()=>{c[p]=null}),u=[{panoIndex:o[3],floorplanData:o[9],lastPanoramaLongitude:o[10],cameraImageUrl:o[11]}];let f={};for(let p=0;p<u.length;p+=1)f=i.assign(f,u[p]);n=new pa({props:f});let h=o[6]&&bi(o);return{c(){t=i.element("div");for(let p=0;p<c.length;p+=1)c[p].c();e=i.space(),i.create_component(n.$$.fragment),s=i.space(),h&&h.c(),i.attr(t,"class","floorplan-main svelte-86bqav")},m(p,g){i.insert(p,t,g);for(let A=0;A<c.length;A+=1)c[A].m(t,null);i.append(t,e),i.mount_component(n,t,null),i.append(t,s),h&&h.m(t,null),a=!0},p(p,g){if(o=p,g&62384){l=o[9].floorDatas;let b;for(b=0;b<l.length;b+=1){const v=gi(o,l,b);c[b]?(c[b].p(v,g),i.transition_in(c[b],1)):(c[b]=vi(v),c[b].c(),i.transition_in(c[b],1),c[b].m(t,e))}for(i.group_outros(),b=l.length;b<c.length;b+=1)d(b);i.check_outros()}const A=g&3592?i.get_spread_update(u,[{panoIndex:o[3],floorplanData:o[9],lastPanoramaLongitude:o[10],cameraImageUrl:o[11]}]):{};n.$set(A),o[6]?h?(h.p(o,g),g&64&&i.transition_in(h,1)):(h=bi(o),h.c(),i.transition_in(h,1),h.m(t,null)):h&&(i.group_outros(),i.transition_out(h,1,1,()=>{h=null}),i.check_outros())},i(p){if(!a){for(let g=0;g<l.length;g+=1)i.transition_in(c[g]);i.transition_in(n.$$.fragment,p),i.transition_in(h),r||i.add_render_callback(()=>{r=i.create_in_transition(t,me.fade,{duration:o[0],easing:Se.linear}),r.start()}),a=!0}},o(p){c=c.filter(Boolean);for(let g=0;g<c.length;g+=1)i.transition_out(c[g]);i.transition_out(n.$$.fragment,p),i.transition_out(h),a=!1},d(p){p&&i.detach(t),i.destroy_each(c,p),i.destroy_component(n),h&&h.d()}}}function vi(o){let t,e;const n=[{hoverEnable:o[5],floorplanData:o[9],getRoomAreaText:o[12],getLabelElement:o[13],getRuleDistanceText:o[14],roomLabelsEnable:o[7],ruleLabelsEnable:o[8],adaptiveRoomLabelVisibleEnable:o[15]},{floorIndex:o[16].floorIndex},{isCurrent:o[16].floorIndex===o[4]}];let s={};for(let r=0;r<n.length;r+=1)s=i.assign(s,n[r]);return t=new Ll({props:s}),{c(){i.create_component(t.$$.fragment)},m(r,a){i.mount_component(t,r,a),e=!0},p(r,a){const l=a&62384?i.get_spread_update(n,[a&62368&&{hoverEnable:r[5],floorplanData:r[9],getRoomAreaText:r[12],getLabelElement:r[13],getRuleDistanceText:r[14],roomLabelsEnable:r[7],ruleLabelsEnable:r[8],adaptiveRoomLabelVisibleEnable:r[15]},a&512&&{floorIndex:r[16].floorIndex},a&528&&{isCurrent:r[16].floorIndex===r[4]}]):{};t.$set(l)},i(r){e||(i.transition_in(t.$$.fragment,r),e=!0)},o(r){i.transition_out(t.$$.fragment,r),e=!1},d(r){i.destroy_component(t,r)}}}function bi(o){let t,e;return t=new Ca({props:{floorplanData:o[9],northDesc:o[2]}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&512&&(r.floorplanData=n[9]),s&4&&(r.northDesc=n[2]),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function zl(o){let t,e,n=o[1]&&Ai(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[1]?n?(n.p(s,r),r&2&&i.transition_in(n,1)):(n=Ai(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function Ml(o,t,e){let{duration:n=0}=t,{visible:s}=t,{northDesc:r}=t,{panoIndex:a}=t,{floorIndex:l}=t,{hoverEnable:c}=t,{compassEnable:d}=t,{roomLabelsEnable:u}=t,{ruleLabelsEnable:f}=t,{floorplanData:h}=t,{lastPanoramaLongitude:p}=t,{cameraImageUrl:g}=t,{getRoomAreaText:A}=t,{getLabelElement:b}=t,{getRuleDistanceText:v}=t,{adaptiveRoomLabelVisibleEnable:w}=t;return o.$$set=y=>{"duration"in y&&e(0,n=y.duration),"visible"in y&&e(1,s=y.visible),"northDesc"in y&&e(2,r=y.northDesc),"panoIndex"in y&&e(3,a=y.panoIndex),"floorIndex"in y&&e(4,l=y.floorIndex),"hoverEnable"in y&&e(5,c=y.hoverEnable),"compassEnable"in y&&e(6,d=y.compassEnable),"roomLabelsEnable"in y&&e(7,u=y.roomLabelsEnable),"ruleLabelsEnable"in y&&e(8,f=y.ruleLabelsEnable),"floorplanData"in y&&e(9,h=y.floorplanData),"lastPanoramaLongitude"in y&&e(10,p=y.lastPanoramaLongitude),"cameraImageUrl"in y&&e(11,g=y.cameraImageUrl),"getRoomAreaText"in y&&e(12,A=y.getRoomAreaText),"getLabelElement"in y&&e(13,b=y.getLabelElement),"getRuleDistanceText"in y&&e(14,v=y.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in y&&e(15,w=y.adaptiveRoomLabelVisibleEnable)},[n,s,r,a,l,c,d,u,f,h,p,g,A,b,v,w]}class Dn extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Ml,zl,i.safe_not_equal,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,hoverEnable:5,compassEnable:6,roomLabelsEnable:7,ruleLabelsEnable:8,floorplanData:9,lastPanoramaLongitude:10,cameraImageUrl:11,getRoomAreaText:12,getLabelElement:13,getRuleDistanceText:14,adaptiveRoomLabelVisibleEnable:15},_l)}}const Tl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLOK6BPwIk9nNODM9Xf1RVe1b3elJRjCZmQ6euqGmuqer33rq4e23GqiOykBloDJQGagMVAYqA5WBykBlYFYD1qwP/tdzaZqOx9zYOLxeX0+L5yzLGp0X/03a25MOnGRcBtx+6Rlo9SL08G4EooFnxa8Yiivox5/h5Ys/4cl7NVorNDRnngX+0MIkVMeMSf23zyKML8J7/Dy8hwF2Buh9CnS+AEQIdLspBuGb+M7/qLW4qJrNpsLapjYhpwVnx3BMfCtNNx3Etc9xywvnMf80wG8HmQainw0RxSGrnmeBp+8k5/j9S0HbvXb5io0Lz880/0wPHV1NlhLd316He+4xOCv5ragF7L9PrH1qBJyB0626x/lC+qrSvH5r/W+n1WpxUM5nMY4GPeH8lHJaPgfeAFQHCL+ntkXT+vnUc3W6pvTIwC0wy3rA4dwLmK2avZ7Eo9uKBuYJfgJscbs8dLCxDMt+EOEPBEZNEWyBYHqTz6bPXrzUnNrSShxHIsYiOL69zrCGLLcLqJP68tB+9w5wj+YhWDafQ2s61wNqxjZhmrQ2pvMFCEvXuCUZ7wqH794ZWs28LJqlTXSUyuksF2M/yOwqgkx2c1ADa4wLAQRk2sAGQQakhN6yFC2hltfz5kSY44NKQeeh+vtI/SSzWhg2CzCgmWISmKUGmaYFBDfCSymnfxJ6/+ospVcWOLLp5DGP/y0P/Rp66O99DQNq7Po3Ds0a0wY+My2QSv2N2mO/OyxR2o6UQk+Lv7yJ06JYSnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function jl(o){return F(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(s){return F(this,null,function*(){const r={index:s.index,url:s.url,svgUrl:s.svg_url};if(s.svg_url){const a=yield fetch(s.svg_url,{headers:t}).then(l=>l.text());r.svgContent=a}return r})};return yield Promise.all(o.map(e))})}function Bl(o){return{id:o.id,size:o.size,name:o.name,path:o.path,roomType:o.room_type,floorType:o.floor_type,roomLabel:{position:o.room_label.position,positionInImage:o.room_label.position_in_image},observerIndexs:o.observer_indexs}}function Ql(o){return{floorName:o.floor_name,floorIndex:o.floor_index,rooms:o.rooms.map(Bl),rules:o.rules}}function Rl(o){return{index:o.index,floorIndex:o.floor_index,position:o.position,positionInImage:o.position_in_image}}function Ol(o){return{rad:o.rad,position:o.position,positionInImage:o.position_in_image,northRad:o.north_rad,roomId:o.room_id,floorIndex:o.floor_index}}function Qe(o){return F(this,null,function*(){const t=yield jl(o.outlines),e=o.computed_data.bounding,n=o.computed_data.floor_datas.map(Ql),s=o.computed_data.entrance?Ol(o.computed_data.entrance):null;return{outlines:t,entrance:s,bounding:e,floorDatas:n,observers:o.computed_data.observers.map(Rl)}})}function Hl(o,t,e){return o.map(s=>{const r=s.position,a=s.icon?s.icon:{url:Tl,width:45,height:48},l=il(r,t),c=tl(r,e),d=nl(c,e);return{floorIndex:l,icon:a,id:s.id,position:c,positionInImage:d}})}function Fl(o,t){return t(o),o}function Wt(o,t){return Fl({},e=>{for(const n in o)t.indexOf(n)===-1&&(e[n]=o[n])})}function yi(o,t){const e=Math.max(...o.work.observers.map(n=>n.floorIndex));return t>e?o.model.bounding.max.y:Math.max(...o.work.observers.filter(n=>n.floorIndex===t).map(n=>n.standingPosition.y))}function Sn(o,t,e=je.BOUNDING_CENTER){const n=yi(o,t),s=yi(o,t+1);return e===je.BOUNDING_CENTER?(o.model.bounding.max.y+o.model.bounding.min.y)/2:e===je.CEILING?s:n}function Ln(o,t,e,n){const s=Sn(o,e,n==null?void 0:n.attachedTo),r=new P.Vector3(0,s,0),a=new P.Vector3(1,s,0),l=r.clone().project(o.camera),c=a.clone().project(o.camera);return Math.abs((c.x-l.x)/1e3)*(t.getBoundingClientRect().width/2)}class Xt{constructor(t,e){m(this,"five");m(this,"hooks",new ht);m(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}}class Ze extends Xt{}var he=(o=>(o.UnknownError="UnknownError",o.DataNotLoaded="DataNotLoaded",o.BreakOffByHide="BreakOffByHide",o.BreakOffByDisable="BreakOffByDisable",o.ModelNotLoaded="ModelNotLoaded",o.ChangeModeError="ChangeModeError",o.UpdateCameraError="UpdateCameraError",o))(he||{});const ws=500,Gl=80;function pn(o,t,e=4){return Math.floor(o*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function Cs(o,t){return F(this,null,function*(){yield new Promise((e,n)=>{o.changeMode(...t).catch(s=>n(s)),o.once("initAnimationEnded",()=>{const s=o.getCurrentState(),r=t[0];s.mode!==r&&n(new Error("mode \u4E0E\u9884\u671F\u4E0D\u7B26")),(()=>{const c=t[1];return c?Object.keys(c).every(d=>{const u=s[d];if(u===void 0)return!0;const f=c[d];return typeof u=="number"&&typeof f=="number"?pn(u,f,2):u===f}):!0})()||n(new Error("five pose \u4E0E\u9884\u671F\u4E0D\u7B26")),e()})})})}function _n(o,t){if(o.currentMode!==t.mode)return!1;const{latitude:e,longitude:n,fov:s}=t,{latitude:r,longitude:a}=o.getCurrentState(),l=o.camera.fov;return!(!pn(e,r,2)||!pn(n,a,2)||s!==l)}function Es(o,t,e=!0){return F(this,null,function*(){if(_n(o,t)===!0)return;const s=o.getCurrentState();if(s.mode!==t.mode){const[u]=yield jt(Cs(o,[t.mode,t,void 0,e]));if(u)throw new Error(he.ChangeModeError);return}const{latitude:r,longitude:a,fov:l}=s,c=Math.min(1e3,Math.max(200,Math.abs(r-Math.PI/2)*1e3,(a>Math.PI?2*Math.PI-a:a)*500,Math.abs(l-t.fov)*10)),[d]=yield jt(o.updateCamera(t,c,e));if(d)throw new Error(he.UpdateCameraError)})}function tt(o,t,e=300){const n=o.getElement();!n||(n.style.opacity=t+"",n.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(s=>n.addEventListener("transitionend",s,{once:!0})),new Promise(s=>setTimeout(s,e))]).then(()=>{n.style.transition="none"}))}function Nl(o){const{latitude:t,longitude:e}=o,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,s=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||s}function Wl(o){const{latitude:t,longitude:e}=o,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,s=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&s}class Xl extends Ze{constructor(e,n){var l;super(e);m(this,"name","modelFloorplanPlugin");m(this,"state");m(this,"data");m(this,"showState");m(this,"showPromise");m(this,"app");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"selector");m(this,"showRejection");m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"show",(...n)=>F(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const s=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},s),this._show(e)}));m(this,"hide",(...n)=>F(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));m(this,"updateSize",()=>{if(!this.data||!_n(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,s=n.x-e.x,r=n.y-e.y,a=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,l=Ln(this.five,this.wrapper,this.floorIndex,a),c=Math.ceil(s*l),d=Math.ceil(r*l);this.size.width===c&&this.size.height===d||(this.container.style.width=c+"px",this.container.style.height=d+"px",this.size={width:c,height:d})});m(this,"_disable",e=>{var s,r,a;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(s=this.showRejection)==null||s.call(this,he.BreakOffByDisable),this.showPromise=void 0,(r=this.app)==null||r.$destroy(),this.app=void 0,(a=this.container)==null||a.remove(),this.removeEventListener()});m(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});m(this,"_show",e=>F(this,null,function*(){var a;if(!this.state.enabled)return;if(!((a=this.five.model)!=null&&a.loaded))throw new Error(he.ModelNotLoaded);if(!this.data)throw new Error(he.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},s=j(j({},n),e),r=()=>F(this,null,function*(){this.hooks.emit("show",{userAction:s.userAction,auto:s.isAutoShow});let l=!1,c;this.showRejection=h=>{l=!0,c=h};const[d]=yield jt(Es(this.five,this.showState,s.userAction));if(d)throw d;if(l)throw c?new Error(c):new Error(he.UnknownError);this.updateSize(),this.floorIndex=s.floorIndex,this.five.model.show(this.floorIndex);const u=s.modelOpacity,f=s.immediately?0:ws;tt(this.five,u,f),this.render(f)});return this.showPromise=r().then(()=>{this.hooks.emit("showAnimationEnded",{auto:s.isAutoShow,userAction:s.userAction})}).catch(l=>{if(this.updateState({visible:!1},s.userAction),!s.isAutoShow&&l instanceof Error)throw l}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));m(this,"_hide",e=>{var r;(r=this.showRejection)==null||r.call(this,he.BreakOffByHide),this.showPromise=void 0;const s=j(j({},{userAction:!0,isAutoHide:!1}),e);tt(this.five,1,0),this.hooks.emit("hide",{auto:s.isAutoHide,userAction:s.userAction}),this.render()});m(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});m(this,"onFiveInteriaPan",(e,n)=>{if(!n||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const s=this.five.getCurrentState();s.mode==="Floorplan"&&(this.state.visible||Wl(s)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const s=this.five.getCurrentState();Nl(s)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});m(this,"onFiveWantsGesture",(e,n)=>{if(!!this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});m(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});m(this,"onFiveWantsTapGesture",()=>this.handleClick());m(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:Gl/((l=n==null?void 0:n.scale)!=null?l:1)};const s={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:Be,attachedTo:je.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:c=>(c/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:c=>c.toString()},r=n?Wt(n,["selector","scale"]):{},a=j(j({},s),r);this.state={enabled:!0,visible:!1,config:a},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,s=!0){return F(this,null,function*(){function r(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const a=e;a&&!a.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 l=JSON.parse(JSON.stringify(e)),c=r(l)?l.data:l,d=this.data;this.data=yield Qe(c),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,d),n&&this.updateState(n,s),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 s=this.state,r=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,r),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:r}):this._disable({userAction:r})),e.visible!==void 0&&s.visible!==e.visible){const a={userAction:r};e.visible?this._show(a):this._hide(a)}this.render()}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return F(this,null,function*(){return yield Qe(e.data)})}updateState(e,n){const s=this.state,r=e.config?j(j({},s.config),e.config):s.config;this.state=V(j(j({},this.state),e),{config:r}),!Ce(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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=V(j({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude});if(this.app)return this.app.$set(n);this.app=new Dn({target:this.container,intro:!0,props:n})}}const Yl=(o,t)=>new Xl(o,t);function Ul(o){const{latitude:t,longitude:e}=o,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,s=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||s}function Vl(o){const{latitude:t,longitude:e}=o,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,s=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&s}class Jl extends Ze{constructor(e,n){super(e);m(this,"name","modelFloorplanPlugin");m(this,"state");m(this,"data");m(this,"showState");m(this,"showPromise");m(this,"app");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"selector");m(this,"showRejection");m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"show",(...n)=>F(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const s=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},s),this._show(e)}));m(this,"hide",(...n)=>F(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));m(this,"updateSize",()=>{if(!this.data||!_n(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,s=n.x-e.x,r=n.y-e.y,a=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,l=Ln(this.five,this.wrapper,this.floorIndex,a),c=Math.ceil(s*l),d=Math.ceil(r*l);this.size.width===c&&this.size.height===d||(this.container.style.width=c+"px",this.container.style.height=d+"px",this.size={width:c,height:d})});m(this,"_disable",e=>{var s,r,a;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(s=this.showRejection)==null||s.call(this,he.BreakOffByDisable),this.showPromise=void 0,(r=this.app)==null||r.$destroy(),this.app=void 0,(a=this.container)==null||a.remove(),this.removeEventListener()});m(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});m(this,"_show",e=>F(this,null,function*(){var a;if(!this.state.enabled)return;if(!((a=this.five.model)!=null&&a.loaded))throw new Error(he.ModelNotLoaded);if(!this.data)throw new Error(he.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},s=j(j({},n),e),r=()=>F(this,null,function*(){this.hooks.emit("show",{userAction:s.userAction,auto:s.isAutoShow});let l=!1,c;this.showRejection=h=>{l=!0,c=h};const[d]=yield jt(Es(this.five,this.showState,s.userAction));if(d)throw d;if(l)throw c?new Error(c):new Error(he.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=s.floorIndex,this.five.model.show(this.floorIndex);const u=s.modelOpacity,f=s.immediately?0:ws;tt(this.five,u,f),this.render(f)});return this.showPromise=r().then(()=>{this.hooks.emit("showAnimationEnded",{auto:s.isAutoShow,userAction:s.userAction})}).catch(l=>{if(this.updateState({visible:!1},s.userAction),!s.isAutoShow&&l instanceof Error)throw l}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));m(this,"_hide",e=>{var r;(r=this.showRejection)==null||r.call(this,he.BreakOffByHide),this.showPromise=void 0;const s=j(j({},{userAction:!0,isAutoHide:!1}),e);tt(this.five,1,0),this.hooks.emit("hide",{auto:s.isAutoHide,userAction:s.userAction}),this.render()});m(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const s=this.five.getCurrentState();this.updatePosition(),this.updateSize(),Ul(s)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});m(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1){if(n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1;if(n&&!this.state.visible){if(this.isHiddenByHideFunc)return;const s=this.five.getCurrentState();return s.mode!==this.showState.mode||this.state.visible?void 0:(Vl(s)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});m(this,"onFiveWantsTapGesture",()=>this.handleClick());m(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2,fov:90};const s={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,cameraImageUrl:Be,attachedTo:je.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},r=n?Wt(n,["selector","scale"]):{},a=j(j({},s),r);this.state={enabled:!0,visible:!1,config:a},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,s=!0){return F(this,null,function*(){function r(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const a=e;a&&!a.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 l=JSON.parse(JSON.stringify(e)),c=r(l)?l.data:l,d=this.data;this.data=yield Qe(c),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,d),n&&this.updateState(n,s),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 s=this.state,r=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,r),e.enabled!==void 0&&s.enabled!==e.enabled&&(e.enabled?this._enable({userAction:r}):this._disable({userAction:r})),e.visible!==void 0&&s.visible!==e.visible){const a={userAction:r};e.visible?this._show(a):this._hide(a)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}updatePosition(){var l;const e=Sn(this.five,this.floorIndex,this.state.config.attachedTo),n=(l=this.five.model)==null?void 0:l.bounding.getCenter(new P.Vector3).setY(e);if(!n)return;const s=n.clone().project(this.five.camera),r=(s.x+1)/2,a=-(s.y-1)/2;this.container.style.left=r*100+"%",this.container.style.top=a*100+"%"}formatData(e){return F(this,null,function*(){return yield Qe(e.data)})}updateState(e,n){const s=this.state,r=e.config?j(j({},s.config),e.config):s.config;this.state=V(j(j({},this.state),e),{config:r}),!Ce(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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=V(j({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude});if(this.app)return this.app.$set(n);this.app=new Dn({target:this.container,intro:!0,props:n})}}const Zl=(o,t)=>new Jl(o,t);class ql extends Ze{constructor(e,n){super(e);m(this,"name","topviewFloorplanPlugin");m(this,"state");m(this,"data");m(this,"app");m(this,"selector");m(this,"panoIndex",0);m(this,"floorIndex",0);m(this,"wrapper");m(this,"container",document.createElement("div"));m(this,"lastPanoramaLongitude",0);m(this,"size",{width:0,height:0});m(this,"hasAddedEventListener",!1);m(this,"isHiddenByHideFunc",!1);m(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper||this.five.getCurrentState().mode!=="Topview")return;const{min:e,max:n}=this.data.bounding,s=n.x-e.x,r=n.y-e.y,a=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,l=Ln(this.five,this.wrapper,this.floorIndex,a),c=Math.ceil(s*l),d=Math.ceil(r*l);this.size.width===c&&this.size.height===d||(this.container.style.width=c+"px",this.container.style.height=d+"px",this.size={width:c,height:d})});m(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});m(this,"_disable",e=>{var s,r;const{userAction:n}=e;(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:n})});m(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});m(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});m(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});m(this,"onFiveCameraUpdate",(e,n)=>{!this.state.visible||(this.updatePosition(),this.updateSize())});m(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});m(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});m(this,"onFiveInitAnimationEnded",(...[,,e])=>{const{mode:n}=this.five.getCurrentState();n==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},e),this._show({userAction:e}))});m(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"));const s={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,cameraImageUrl:Be,attachedTo:je.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},r=n?Wt(n,["selector","scale"]):{},a=j(j({},s),r);this.state={enabled:!0,visible:!1,config:a},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,s=!0){return F(this,null,function*(){function r(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const a=e;a&&!a.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 l=JSON.parse(JSON.stringify(e)),c=r(l)?l.data:l,d=this.data;this.data=yield Qe(c),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,d),n&&this.updateState(n,s),this.render()})}updatePosition(){var l;const e=Sn(this.five,this.floorIndex,this.state.config.attachedTo),n=(l=this.five.model)==null?void 0:l.bounding.getCenter(new P.Vector3).setY(e);if(!n)return;const s=n.clone().project(this.five.camera),r=(s.x+1)/2,a=-(s.y-1)/2;this.container.style.left=r*100+"%",this.container.style.top=a*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return F(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 F(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 s=this.state,r=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,r),e.enabled!==void 0&&s.enabled!==e.enabled){const a={userAction:r};e.enabled?this._enable(a):this._disable(a)}if(e.visible!==void 0&&s.visible!==e.visible){const a={userAction:r};e.visible?this._show(a):this._hide(a)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return F(this,null,function*(){return yield Qe(e.data)})}_show(e){return F(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 Cs(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const s=500,r=this.state.config.modelOpacity;tt(this.five,r,s),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return F(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const s=1,r=0;tt(this.five,s,r),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 s=this.state,r=e.config?j(j({},s.config),e.config):s.config;this.state=V(j(j({},this.state),e),{config:r}),!Ce(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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=V(j({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude});if(this.app)return this.app.$set(n);this.app=new Dn({target:this.container,intro:!0,props:n})}}const Kl=(o,t)=>new ql(o,t);function zn(o,t=200){let e;return function(...n){e||(o(...n),e=setTimeout(function(){e=null},t))}}function $l(o){i.append_styles(o,"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 ec(o){let t,e,n;return{c(){t=i.element("div"),e=i.element("div"),n=i.element("div"),i.attr(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),i.set_style(n,"background-image","url("+(o[0]||Be)+")"),i.set_style(n,"transform",o[1],!1),i.attr(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),i.set_style(e,"transform",o[2],!1),i.attr(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(s,r){i.insert(s,t,r),i.append(t,e),i.append(e,n)},p(s,[r]){r&1&&i.set_style(n,"background-image","url("+(s[0]||Be)+")"),r&2&&i.set_style(n,"transform",s[1],!1),r&4&&i.set_style(e,"transform",s[2],!1)},i:i.noop,o:i.noop,d(s){s&&i.detach(t)}}}function tc(o){return`rotate(${Math.floor(o/Math.PI*180)*-1+45}deg)`}function nc(o,t,e){let n,s,{five:r}=t,{pxmm:a}=t,{floorplanData:l}=t,{cameraImageUrl:c}=t,d=r.getCurrentState().panoIndex,u=r.getCurrentState().longitude;function f(g,A){const b=g.bounding,v=g.observers[A];if(!v)return"";const w=(b.max.x-b.min.x)*a,y=(b.max.y-b.min.y)*a,I=Math.floor(v.positionInImage.x*w),k=Math.floor(v.positionInImage.y*y);return`translate(${I}px, ${k}px)`}function h(g){e(6,d=g)}const p=zn(g=>{e(7,u=g.longitude)},1e3/60);return Z.onMount(()=>(r.on("panoWillArrive",h),r.on("cameraDirectionUpdate",p),function(){r.off("panoWillArrive",h),r.off("cameraDirectionUpdate",p)})),o.$$set=g=>{"five"in g&&e(3,r=g.five),"pxmm"in g&&e(4,a=g.pxmm),"floorplanData"in g&&e(5,l=g.floorplanData),"cameraImageUrl"in g&&e(0,c=g.cameraImageUrl)},o.$$.update=()=>{o.$$.dirty&96&&e(2,n=f(l,d)),o.$$.dirty&128&&e(1,s=tc(u))},[c,s,n,r,a,l,d,u]}class ic extends i.SvelteComponent{constructor(t){super(),i.init(this,t,nc,ec,i.safe_not_equal,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},$l)}}function oc(o){i.append_styles(o,"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 wi(o,t,e){const n=o.slice();return n[1]=t[e],n}function Ci(o,t){let e,n,s=`${t[1].icon.width/16}rem`,r=`${t[1].icon.height/16}rem`,a,l=`${t[1].positionInImage.y*100}%`,c=`${t[1].positionInImage.x*100}%`;return{key:o,first:null,c(){e=i.element("div"),n=i.element("div"),a=i.space(),i.attr(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),i.set_style(n,"background-image",`url(${t[1].icon.url})`),i.set_style(n,"width",s,!1),i.set_style(n,"height",r,!1),i.attr(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),i.set_style(e,"top",l,!1),i.set_style(e,"left",c,!1),this.first=e},m(d,u){i.insert(d,e,u),i.append(e,n),i.append(e,a)},p(d,u){t=d,u&1&&i.set_style(n,"background-image",`url(${t[1].icon.url})`),u&1&&s!==(s=`${t[1].icon.width/16}rem`)&&i.set_style(n,"width",s,!1),u&1&&r!==(r=`${t[1].icon.height/16}rem`)&&i.set_style(n,"height",r,!1),u&1&&l!==(l=`${t[1].positionInImage.y*100}%`)&&i.set_style(e,"top",l,!1),u&1&&c!==(c=`${t[1].positionInImage.x*100}%`)&&i.set_style(e,"left",c,!1)},d(d){d&&i.detach(e)}}}function sc(o){let t,e=[],n=new Map,s=o[0];const r=a=>a[1].id;for(let a=0;a<s.length;a+=1){let l=wi(o,s,a),c=r(l);n.set(c,e[a]=Ci(c,l))}return{c(){t=i.element("div");for(let a=0;a<e.length;a+=1)e[a].c();i.attr(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(a,l){i.insert(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null)},p(a,[l]){l&1&&(s=a[0],e=i.update_keyed_each(e,l,r,1,a,s,n,t,i.destroy_block,Ci,null,wi))},i:i.noop,o:i.noop,d(a){a&&i.detach(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function rc(o,t,e){let{extraObjects:n=[]}=t;return o.$$set=s=>{"extraObjects"in s&&e(0,n=s.extraObjects)},[n]}class ac extends i.SvelteComponent{constructor(t){super(),i.init(this,t,rc,sc,i.safe_not_equal,{extraObjects:0},oc)}}function Ei(o){let t,e;const n=[{five:o[0],pxmm:o[1],floorIndex:o[2],floorplanData:o[4],onRoomHeightClick:o[6]}];let s={};for(let r=0;r<n.length;r+=1)s=i.assign(s,n[r]);return t=new ys({props:s}),{c(){i.create_component(t.$$.fragment)},m(r,a){i.mount_component(t,r,a),e=!0},p(r,a){const l=a&87?i.get_spread_update(n,[{five:r[0],pxmm:r[1],floorIndex:r[2],floorplanData:r[4],onRoomHeightClick:r[6]}]):{};t.$set(l)},i(r){e||(i.transition_in(t.$$.fragment,r),e=!0)},o(r){i.transition_out(t.$$.fragment,r),e=!1},d(r){i.destroy_component(t,r)}}}function lc(o){let t,e,n,s,r,a;const l=[{floorIndex:o[2],floorplanData:o[4]}];let c={};for(let u=0;u<l.length;u+=1)c=i.assign(c,l[u]);t=new vs({props:c}),n=new ac({props:{extraObjects:o[5]}});let d=o[3]&&Ei(o);return{c(){i.create_component(t.$$.fragment),e=i.space(),i.create_component(n.$$.fragment),s=i.space(),d&&d.c(),r=i.empty()},m(u,f){i.mount_component(t,u,f),i.insert(u,e,f),i.mount_component(n,u,f),i.insert(u,s,f),d&&d.m(u,f),i.insert(u,r,f),a=!0},p(u,[f]){const h=f&20?i.get_spread_update(l,[{floorIndex:u[2],floorplanData:u[4]}]):{};t.$set(h);const p={};f&32&&(p.extraObjects=u[5]),n.$set(p),u[3]?d?(d.p(u,f),f&8&&i.transition_in(d,1)):(d=Ei(u),d.c(),i.transition_in(d,1),d.m(r.parentNode,r)):d&&(i.group_outros(),i.transition_out(d,1,1,()=>{d=null}),i.check_outros())},i(u){a||(i.transition_in(t.$$.fragment,u),i.transition_in(n.$$.fragment,u),i.transition_in(d),a=!0)},o(u){i.transition_out(t.$$.fragment,u),i.transition_out(n.$$.fragment,u),i.transition_out(d),a=!1},d(u){i.destroy_component(t,u),u&&i.detach(e),i.destroy_component(n,u),u&&i.detach(s),d&&d.d(u),u&&i.detach(r)}}}function cc(o,t,e){let n,{five:s}=t,{pxmm:r}=t,{floorIndex:a}=t,{hoverEnable:l}=t,{floorplanData:c}=t,{extraObjects:d=[]}=t;const u=void 0;return o.$$set=f=>{"five"in f&&e(0,s=f.five),"pxmm"in f&&e(1,r=f.pxmm),"floorIndex"in f&&e(2,a=f.floorIndex),"hoverEnable"in f&&e(3,l=f.hoverEnable),"floorplanData"in f&&e(4,c=f.floorplanData),"extraObjects"in f&&e(7,d=f.extraObjects)},o.$$.update=()=>{o.$$.dirty&132&&e(5,n=d==null?void 0:d.filter(f=>f.floorIndex===a))},[s,r,a,l,c,n,u,d]}class dc extends i.SvelteComponent{constructor(t){super(),i.init(this,t,cc,lc,i.safe_not_equal,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:7})}}function uc(o){i.append_styles(o,"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 Pi(o){let t,e,n,s=o[6]!==0&&Ii(o);return{c(){t=i.element("div"),s&&s.c(),i.attr(t,"class","plugin-floorplan-radar svelte-1mvqyqq"),i.add_render_callback(()=>o[12].call(t))},m(r,a){i.insert(r,t,a),s&&s.m(t,null),e=i.add_resize_listener(t,o[12].bind(t)),n=!0},p(r,a){r[6]!==0?s?(s.p(r,a),a&64&&i.transition_in(s,1)):(s=Ii(r),s.c(),i.transition_in(s,1),s.m(t,null)):s&&(i.group_outros(),i.transition_out(s,1,1,()=>{s=null}),i.check_outros())},i(r){n||(i.transition_in(s),n=!0)},o(r){i.transition_out(s),n=!1},d(r){r&&i.detach(t),s&&s.d(),e()}}}function Ii(o){let t,e,n,s,r=`${o[8]}px`,a=`${o[11]}px`,l;const c=[{five:o[0],pxmm:o[9],floorIndex:o[10],floorplanData:o[3],hoverEnable:o[2],extraObjects:o[5]}];let d={};for(let h=0;h<c.length;h+=1)d=i.assign(d,c[h]);e=new dc({props:d});const u=[{pxmm:o[9],five:o[0],floorplanData:o[3],cameraImageUrl:o[4]}];let f={};for(let h=0;h<u.length;h+=1)f=i.assign(f,u[h]);return s=new ic({props:f}),{c(){t=i.element("div"),i.create_component(e.$$.fragment),n=i.space(),i.create_component(s.$$.fragment),i.attr(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),i.set_style(t,"width",r,!1),i.set_style(t,"height",a,!1)},m(h,p){i.insert(h,t,p),i.mount_component(e,t,null),i.append(t,n),i.mount_component(s,t,null),l=!0},p(h,p){const g=p&1581?i.get_spread_update(c,[{five:h[0],pxmm:h[9],floorIndex:h[10],floorplanData:h[3],hoverEnable:h[2],extraObjects:h[5]}]):{};e.$set(g);const A=p&537?i.get_spread_update(u,[{pxmm:h[9],five:h[0],floorplanData:h[3],cameraImageUrl:h[4]}]):{};s.$set(A),p&256&&r!==(r=`${h[8]}px`)&&i.set_style(t,"width",r,!1),p&2048&&a!==(a=`${h[11]}px`)&&i.set_style(t,"height",a,!1)},i(h){l||(i.transition_in(e.$$.fragment,h),i.transition_in(s.$$.fragment,h),l=!0)},o(h){i.transition_out(e.$$.fragment,h),i.transition_out(s.$$.fragment,h),l=!1},d(h){h&&i.detach(t),i.destroy_component(e),i.destroy_component(s)}}}function hc(o){let t,e,n=o[1]&&Pi(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[1]?n?(n.p(s,r),r&2&&i.transition_in(n,1)):(n=Pi(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function fc(o,t,e){var v,w;let{five:n}=t,{visible:s}=t,{hoverEnable:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,{extraObjects:c=[]}=t,d=0,u=(w=(v=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:v.floorIndex)!=null?w:0,f=0,h=0,p=0,g=0;function A(y){e(10,u=n.work.observers[y].floorIndex)}Z.onMount(()=>(n.on("panoArrived",A),()=>{n.off("panoArrived",A)}));function b(){f=this.clientWidth,h=this.clientHeight,e(6,f),e(7,h)}return o.$$set=y=>{"five"in y&&e(0,n=y.five),"visible"in y&&e(1,s=y.visible),"hoverEnable"in y&&e(2,r=y.hoverEnable),"floorplanData"in y&&e(3,a=y.floorplanData),"cameraImageUrl"in y&&e(4,l=y.cameraImageUrl),"extraObjects"in y&&e(5,c=y.extraObjects)},o.$$.update=()=>{if(o.$$.dirty&456){const y=Math.min(f,h),{max:I,min:k}=a.bounding,C=I.x-k.x,D=I.y-k.y,x=function(){return C>D?[y,y/C*D]:[y/D*C,y]}();e(8,p=x[0]),e(11,g=x[1]),e(9,d=p/C)}},[n,s,r,a,l,c,f,h,p,d,u,g,b]}class mc extends i.SvelteComponent{constructor(t){super(),i.init(this,t,fc,hc,i.safe_not_equal,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5},uc)}}class pc extends Ze{constructor(e,n){super(e);m(this,"name","panoFloorplanRadarPlugin");m(this,"state");m(this,"data");m(this,"app");m(this,"wrapperSelector","");m(this,"wrapper",null);m(this,"disposed",!1);m(this,"extraObjects",[]);m(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});m(this,"_disable",e=>{var s;const{userAction:n}=e;(s=this.app)==null||s.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:n})});this.five=e;const s={hoverEnable:!1,cameraImageUrl:Be},r=n!=null&&n.configs?n.configs:{},a=j(j({},s),r);this.state={enabled:!0,visible:!0,config:a},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,s=!0){return F(this,null,function*(){function r(d){return Object.prototype.hasOwnProperty.apply(d,["version"])}const a=JSON.parse(JSON.stringify(e)),l=r(a)?a.data:a,c=this.data;this.data=yield Qe(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,s),this.render()})}show(){return F(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 F(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 s=this.state,r=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,r),e.enabled!==void 0&&s.enabled!==e.enabled){const a={userAction:r};e.enabled?this._enable(a):this._disable(a)}if(e.visible!==void 0&&s.visible!==e.visible){const a={userAction:r};e.visible?this._show(a):this._hide(a)}}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=Hl(e,this.five,this.data),this.render())}formatData(e){return F(this,null,function*(){return yield Qe(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 s=this.state;this.state=j(j({},this.state),e),!Ce(this.state,s,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:s,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=V(j({},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 mc({target:this.wrapper,props:e})}}const gc=(o,t)=>new pc(o,t),Ac=[{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"}],vc=[{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"}],bc=[{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"}],tn=(o,t,e)=>{const n=new P.Matrix4,s=new P.Euler(o,t,e,"YXZ");return n.makeRotationFromEuler(s),n},yc=(o,{scale:t,rotation:e,position:n})=>{if(t&&o.scale.set(t,t,t),e){const[s,r,a]=e;s&&o.applyMatrix4(tn(s,0,0)),r&&o.applyMatrix4(tn(0,r,0)),a&&o.applyMatrix4(tn(0,0,a))}return n&&o.position.set(n.x,n.y,n.z),o};function Ps(o,t){o.traverse(e=>{var n;if(e.type==="Mesh"){const s=e,r=j({map:s.material.map||{}},t);s.material=new M.MeshBasicMaterial(r),s.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const wc=(o,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,s={},r=f=>F(exports,null,function*(){var R;const h=(f==null?void 0:f.fbx_url)||e,p=(R=f==null?void 0:f.north_rad)!=null?R:n;if(typeof p!="number")throw new Error('"northRad"\u914D\u7F6E\u53C2\u6570\u7F3A\u5931\uFF1A\u672A\u914D\u7F6E\u6307\u5357\u9488\u6307\u5411\uFF01');const g=o.model.bounding,A=g.max.x-g.min.x,b=g.max.z-g.min.z,v=Math.max(A,b),y=yield new cs.FBXLoader().loadAsync(h);Ps(y,{transparent:!0,side:P.DoubleSide,blending:P.AdditiveBlending});const I=[0,p-Math.PI/2,0],{model:{bounding:{max:{x:k,z:C},min:{x:D,y:x,z}}}}=o;s.yBase=x;const L={x:(k+D)/2,y:x-1.6,z:(C+z)/2},T=.0045*v;return yc(y,{position:L,rotation:I,scale:T}),s.object=y,!0}),a=({latitude:f})=>{if(!s.object)return;const h=l(f);h&&(s.object.position.y=h)},l=f=>{if(s.yBase===void 0)return;const h=.6;if(f>=Math.PI/4)return s.yBase-(h+1.6);const p=f*(4/Math.PI);return s.yBase-(h*p+1.6)};return{load:r,disable:()=>{!s.object||(o.scene.remove(s.object),o.needsRender=!0,o.off("cameraDirectionUpdate",a))},enable:()=>{if(!s.object)return;const f=l(o.getPose().latitude);f&&(s.object.position.y=f),o.scene.add(s.object),o.needsRender=!0,o.on("cameraDirectionUpdate",a)}}};function Cc(o,t){var d,u,f,h,p;const e=(d=t==null?void 0:t.size)!=null?d:512,n=(u=t==null?void 0:t.fontSize)!=null?u:e*(35/256)*1.2,s=(f=t==null?void 0:t.backgroundColor)!=null?f:"rgba(0,0,0,0)",r=(h=t==null?void 0:t.fontColor)!=null?h:"#fff",a=(p=t==null?void 0:t.textAlign)!=null?p:"center",l=document.createElement("canvas");l.setAttribute("width",e+""),l.setAttribute("height",e+"");const c=l.getContext("2d");return c.fillStyle=s,c.fillRect(0,0,e,e),c.font=`${n}px "\u5FAE\u8F6F\u96C5\u9ED1"`,c.textAlign=a,c.fillStyle=r,c.fillText(o,e/2,e*.7),new M.CanvasTexture(l)}const Ec=({x:o,y:t,z:e})=>new M.Vector3(o,t,e),Pc=(o,t)=>{var A,b,v;const e={},n=(A=t.animationEnabled)!=null?A:!0,s=(b=t.position)!=null?b:void 0,r=(v=t.rad)!=null?v:void 0,a=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",l=[],c=w=>F(exports,null,function*(){var z,L,T,R,E,S,_;const y=(z=w==null?void 0:w.position)!=null?z:s;if(!y)return Promise.reject("ModelEntryDoorGuidePlugin.load(): position is undefined");const I=Ec(y),k=(L=w==null?void 0:w.rad)!=null?L:r,C=(T=w==null?void 0:w.fbx_url)!=null?T:a;if(e.rad=k,k===void 0)return Promise.reject(`ModelEntryDoorGuidePlugin.load(): rad is ${k}`);const D=yield new cs.FBXLoader().loadAsync(C);D.position.copy(I),D.rotation.z=k,D.scale.set(.8,.8,.8),Ps(D,{transparent:!0,side:P.DoubleSide});const x=(_=(S=(E=(R=D.children)==null?void 0:R[0])==null?void 0:E.children)==null?void 0:S[3])==null?void 0:_.clone();return x?(x.material=new M.MeshBasicMaterial({transparent:!0,map:Cc("\u5165\u6237\u95E8")}),x.renderOrder=3,D.children[0].add(x),e.object=D,!0):Promise.reject(`ModelEntryDoorGuidePlugin.load(): textMesh is ${x}`)}),d=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const w=1,y=new M.AnimationMixer(e.object);l.push(y);const I=y.clipAction(e.object.animations[0]);I.timeScale=w;let k;const C=()=>{let L=0,T=0;const R=1e3/30,E=S=>{L=requestAnimationFrame(E);const _=S-T;_<R||(T=S,l.forEach(B=>B.update(_/1e3)),o.needsRender=!0)};return L=requestAnimationFrame(E),()=>{cancelAnimationFrame(L)}},z={play:()=>{k||(I.play(),k=C(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{I.stop(),k==null||k(),k=void 0}};e.animation=z},u=w=>{var I;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((I=w==null?void 0:w.animationEnable)!=null?I:n)&&(e.animation||d(),e.animation.play()),o.scene.add(e.object),o.needsRender=!0},f=()=>{!e.object||(e.animation&&e.animation.stop(),o.scene.remove(e.object),o.needsRender=!0)},h=w=>w==="Floorplan"?u():f();return{load:c,enable:w=>(e.enabled||(e.enabled=!0,h(o.currentMode),o.on("modeChange",h),u(w)),!0),disable:()=>(e.enabled&&(e.enabled=!1,f(),o.off("modeChange",h)),!0)}};class Mn extends lt.default.Tween{constructor(){super(...arguments);m(this,"disposeMethods",[]);m(this,"animationFrameDisposer");m(this,"onDispose",e=>(this.disposeMethods.push(e),this));m(this,"play",()=>(this.start(0),this.animationFrameDisposer=Ut(e=>this.update(e)),this));m(this,"dispose",()=>{var e;this.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this.disposeMethods.forEach(n=>n()),this.disposeMethods=[],lt.default.remove(this)})}}function Is(o,t=lt.default.Easing.Linear.None){const e=new Mn({progress:0}).to({progress:1});return o!==void 0&&e.duration(o),t!==void 0&&e.easing(t),e}const dt=window.requestAnimationFrame||(o=>setTimeout(o,16)),Ic=window.cancelAnimationFrame||clearTimeout;function Yt(o,t=0){t<=0?dt(o):dt(()=>Yt(o,t-1))}function Ut(o,t=60){let e=-1,n=0,s=-1;const r=1e3/t;function a(l){s===-1&&(s=l),e=dt(a),!(l-n<r)&&(n=l,o&&o(l-s))}return e=dt(a),function(){Ic(e)}}function kc(){const o=Date.now();return new Promise(t=>{dt(()=>{t(Date.now()-o)})})}const xc=Ft.Easing;function Dc(o,t,e,n=xc.Linear.None){const s=new Ft.Tween(o).to(t,e).easing(n);Yt(()=>s.start(0));const r=Ut(l=>{s.update(l)===!1&&r()}),a=[];return s.onDestroy=l=>(a.push(l),s),s.destroy=function(){this.stop(),Object.assign(s,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let l;for(;l=a.shift();)l();r()},s}function Sc(o,t){return Dc({progress:0},{progress:1},o,t)}var ks=(o=>(o.Move="Move",o.Rotate="Rotate",o))(ks||{}),we=(o=>(o.Clockwise="Clockwise",o.Anticlockwise="Anticlockwise",o.Loop="Loop",o))(we||{});const _t=Math.PI*2;function ki(o){return(o%_t+_t)%_t}function xi(o){return o%_t}function nn(o,t,e){return o+(t-o)*e}const gn=(o,t,e)=>{const n=Math.PI,s=n*2;return o=ki(o),t=ki(t),e===we.Anticlockwise&&o<t&&(o+=s),e===we.Clockwise&&t<o&&(t+=s),e===we.Loop&&t-o>n?gn(o,t,we.Anticlockwise):e===we.Loop&&o-t>n?gn(o,t,we.Clockwise):{from:o,to:t}},Lc=o=>{const t={},e=(c,d,...u)=>F(exports,[c,d,...u],function*(r,a,l={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),l.asyncStartCallback&&(yield l.asyncStartCallback()),r.mode&&r.mode!==o.currentMode&&(yield o.changeMode(r.mode)),l.preload&&r.panoIndex!==void 0&&r.panoIndex!==o.panoIndex&&(yield o.preloadPano(r.panoIndex)),l.asyncEndCallback&&(yield l.asyncEndCallback()),r.panoIndex===void 0&&r.fov===void 0&&r.latitude===void 0&&r.longitude===void 0?!0:yield new Promise((f,h)=>{const p=r.panoIndex!==void 0?r.panoIndex:o.panoIndex;p!==void 0?o.moveToPano(p,Object.assign({duration:a,moveEndCallback:()=>f(!0),moveCancelCallback:()=>h(!1)},r)):h(!1)})}),n=r=>{const a=o.state,l=xi(a.latitude),c=xi(r.latitude),{from:d,to:u}=gn(a.longitude,r.longitude,r.rotation||we.Loop),f=a.fov,h=r.fov;return{from:{latitude:l,longitude:d,fov:f},to:{latitude:c,longitude:u,fov:h}}};return{move:e,rotate:(c,d,...u)=>F(exports,[c,d,...u],function*(r,a,l={}){t.interruptCallback&&t.interruptCallback(!1),l.asyncStartCallback&&(yield l.asyncStartCallback()),o.currentMode!==ee.Five.Mode.Panorama&&(yield o.changeMode(ee.Five.Mode.Panorama)),r.panoIndex!==void 0&&r.panoIndex!==o.panoIndex&&(l.preload&&(yield o.preloadPano(r.panoIndex)),yield new Promise((p,g)=>{if(!r.panoIndex){p(!0);return}o.moveToPano(r.panoIndex,{moveEndCallback:()=>p(!0),moveCancelCallback:()=>g(!1)})})),l.asyncEndCallback&&(yield l.asyncEndCallback());const{from:f,to:h}=n(r);return yield new Promise(p=>{const g=({progress:y})=>{const I={};I.longitude=nn(f.longitude,h.longitude,y),I.latitude=nn(f.latitude,h.latitude,y),I.fov=nn(f.fov,h.fov,y),o.setState(I,!0)},A=()=>{p(!0)},b=()=>{p(!1)},v=r.rotateSpeed?Math.ceil(Math.abs(h.longitude-f.longitude)/r.rotateSpeed*1e3):a,w=Sc(v,Ft.Easing.Linear.None).onUpdate(g).onComplete(A).onDestroy(b);r.rotation===we.Loop&&w.repeat(1/0).yoyo(!0),t.interruptCallback=(y=!0)=>{w.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),p(y)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},a)})})}};function Di(o,t){return o.x===t.x&&o.y===t.y}function xs(o,t){return Math.abs(o)===1/0&&Math.abs(t)===1/0?!0:Math.abs(o-t)<.001}function Qt(o,t){return(t.y-o.y)/(t.x-o.x)}function Ds(o,t,e){const n=Qt(o[1],o[0]),s=Qt(t[1],t[0]);if(isNaN(n)||isNaN(s)||xs(n,s))return!1;if(vt(o[0],t))return o[0];if(vt(o[1],t))return o[1];if(vt(t[0],o))return t[0];if(vt(t[1],o))return t[1];if(e&&!_c(o,t))return!1;const r=o[0],a=t[0];if(Math.abs(n)===1/0)return{x:r.x,y:t[1].y-(t[1].x-r.x)*s};if(Math.abs(s)===1/0)return{x:a.x,y:o[1].y-(o[1].x-a.x)*n};const l=(a.y-r.y+n*r.x-s*a.x)/(n-s),c=n*l-n*r.x+r.y;return{x:l,y:c}}function vt(o,t){return Di(o,t[0])||Di(o,t[1])?!0:(t[0].x-o.x)*(o.x-t[1].x)>=0&&(t[0].y-o.y)*(o.y-t[1].y)>=0&&xs(Qt(t[0],o),Qt(o,t[1]))}function bt(o,t,e){return(o.x-e.x)*(t.y-e.y)-(t.x-e.x)*(o.y-e.y)}function _c(o,t){return Math.max(o[0].x,o[1].x)>=Math.min(t[0].x,t[1].x)&&Math.max(t[0].x,t[1].x)>=Math.min(o[0].x,o[1].x)&&Math.max(o[0].y,o[1].y)>=Math.min(t[0].y,t[1].y)&&bt(t[0],o[1],o[0])*bt(o[1],t[1],o[0])>0&&bt(o[0],t[1],t[0])*bt(t[1],o[1],t[0])>0?1:0}function Ss(o,t=0){t<=0?requestAnimationFrame(o):requestAnimationFrame(()=>Ss(o,t-1))}const zc=`<style type="text/css">
|
|
111
111
|
.PanoRulerPlugin-rule-line {
|
|
112
112
|
position: absolute;
|
|
113
113
|
transform-origin: left center;
|
|
@@ -200,7 +200,7 @@ transition: all 500ms;
|
|
|
200
200
|
<div class="PanoRulerPlugin-rule-label-name">${e.options.distanceText(b)}</div>
|
|
201
201
|
</div>
|
|
202
202
|
</div>
|
|
203
|
-
`,w=document.createElement("div");return w.setAttribute("class","PanoRulerPlugin-rule"),w.setAttribute("data-name",A),w.setAttribute("style","display: none"),w.innerHTML=v,w},s=document.createElement("div");s.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;");const r=document.createElement("div");r.innerHTML=zc,s.appendChild(r);const a={},l=(A,b)=>{if(e.loaded)throw new Error("\u6807\u5C3A\u88AB\u91CD\u590D\u521D\u59CB\u5316\uFF01");const v=Tc(A,o),w=o.work;if(!w)return!1;for(const y in b){const I=b[y],{standingPosition:k}=w.observers[0],C=I.map(({x:D,z:x,observers:z})=>{const _=z.length>0?A.rooms[A.observers[z[0]]].name:"",T=v[_]?v[_].floor:null;let H=1/0,E={index:0,x:k.x,y:k.y,z:k.z};z.forEach(Q=>{if(!w.observers[Q])return;const{standingPosition:O}=w.observers[Q],X={index:Q,x:O.x,y:O.y,z:O.z},Y=Mc({x:D,z:x},X);T?Y<H&&Math.abs(X.y-T)<.3&&(H=Y,E=X):Y<H&&(H=Y,E=X)});const S=new M.Vector3(D,E.y,x);Object.assign(S,{observers:z});const L=v[_]?v[_].roof:null,B=L?new M.Vector3(D,L,x):null;return B&&Object.assign(B,{observers:z}),{origin:S,vertical:B}});a[y]={origins:C.map(D=>D.origin),rules:[]};for(const{origin:D,vertical:x}of C){if(!x)continue;const z=n(y,D.distanceTo(x));s.append(z),a[y].rules.push({vertical:!0,rule:[D,x],$element:z})}for(let D=0;D<C.length;D++){let x=D+1;x>=C.length&&(x=0);const{origin:z}=C[D],{origin:_}=C[x],T=n(y,z.distanceTo(_));s.append(T),a[y].rules.push({vertical:!1,rule:[z,_],$element:T})}}return e.loaded=!0,!0},c=(A,b,v)=>F(exports,null,function*(){const w=A||t.roomInfo,y=b||t.roomRules;if(!w||!y)throw new Error("\u6807\u5C3A\u6570\u636E\u4F9D\u8D56\u4E0D\u9F50\u5168\uFF01");return e.loaded=!1,e.options=j(j({},e.options),v||{}),o.model.loaded?l(w,y):yield new Promise(I=>o.once("modelLoaded",()=>I(l(w,y))))});t.roomInfo&&t.roomRules&&c(t.roomInfo,t.roomRules);const d=(A,b,v,w)=>{const y=[[{x:0,y:0},{x:v,y:0}],[{x:0,y:0},{x:0,y:w}],[{x:v,y:0},{x:v,y:w}],[{x:0,y:w},{x:v,y:w}]],I=[];for(let k=0;k<y.length;k++){const C=Ds([A,b],[y[k][0],y[k][1]],!0);C&&I.push(C)}return I.length===0?!1:I},u=()=>{var z;const A=(z=o.getElement())==null?void 0:z.parentElement;if(!A||!e.loaded||Object.keys(a).length<=0)return;const{panoIndex:b,camera:v,currentMode:w}=o;if(b===void 0)return;let y;for(const _ in a)_.split(",").indexOf(b.toString())>=0&&(y=_);if(!y){for(const _ in a)for(const{$element:T}of a[_].rules)T.style.display="none";return}const I=v.position,k=v.getWorldDirection(new M.Vector3),C=A.clientWidth,D=A.clientHeight;if(w!==ee.Five.Mode.Panorama){for(const _ in a)for(const{$element:T}of a[_].rules)T.style.display="none";return}for(const _ in a)for(const{$element:T}of a[_].rules)T.style.display=_===y?"block":"none";const[x]=a[y].origins.slice().filter(_=>_.observers.indexOf(b)>=0).sort((_,T)=>{const H=_.clone().setY(0).sub(I).normalize().angleTo(k.clone().setY(0)),E=T.clone().setY(0).sub(I).normalize().angleTo(k.clone().setY(0));return H-E});for(const{rule:_,vertical:T,$element:H}of a[y].rules){const[E,S]=_,L=H.querySelector(".PanoRulerPlugin-rule-line");if(!L)return;if(!x){H.style.display="none";continue}if(E!==x&&S!==x){H.style.display="none";continue}if(E.distanceTo(S)<.3){H.style.display="none";continue}if(E.observers.indexOf(b)===-1||S.observers.indexOf(b)===-1){H.style.display="none";continue}if(E.clone().sub(I).normalize().angleTo(k)>Math.PI/2){H.style.display="none";continue}if(S.clone().sub(I).normalize().angleTo(k)>Math.PI/2){H.style.display="none";continue}const G=E.distanceTo(S);if(S.clone().sub(S.clone().sub(E).divide(new M.Vector3(2,2,2))).distanceTo(I)/G>8){H.style.display="none";continue}const X=E.clone().project(v),Y=(X.x+1)/2*C,J=(-X.y+1)/2*D,te=S.clone().project(v),oe=(te.x+1)/2*C,ce=(-te.y+1)/2*D,N=Math.sqrt(Math.pow(oe-Y,2)+Math.pow(ce-J,2));let $=N,ne=50;const W=d({x:~~Y,y:~~J},{x:~~oe,y:~~ce},C,D);if(W&&W.length===1&&(x===E?($=Math.sqrt(Math.pow(W[0].x-Y,2)+Math.pow(W[0].y-J,2)),ne=$/N*50):x===S&&($=Math.sqrt(Math.pow(W[0].x-oe,2)+Math.pow(W[0].y-ce,2)),ne=100-$/N*50)),W&&W.length===2){const _e={x:(W[0].x+W[1].x)/2,y:(W[0].y+W[1].y)/2};ne=Math.sqrt(Math.pow(_e.x-Y,2)+Math.pow(_e.y-J,2))/N*100}const Re=(Math.PI/2-Math.atan2(oe-Y,J-ce))/Math.PI*180,K=L.querySelector(".PanoRulerPlugin-rule-label"),Le=K.children[0].clientWidth;Le>=N||Le/2>=ne/100*N||Le/2>=(1-ne/100)*N?L.style.display="none":(L.style.display="block",L.style.width=N+"px",L.style.left=Y+"px",L.style.top=J+"px",L.style.transform=`rotate(${-Re}deg)`,K.style.left=`${ne}%`)}},f=()=>Ss(u),h=()=>{var A,b;return e.loaded?(e.enable||(s.setAttribute("class","PanoRulerPlugin"+(e.options.className?" "+e.options.className:"")),(b=(A=o.getElement())==null?void 0:A.parentElement)==null||b.append(s),u(),o.on("modeChange",u),o.on("cameraUpdate",f),e.enable=!0),!0):!1},p=()=>(e.enable&&(o.off("modeChange",u),o.off("cameraUpdate",f),s&&s.remove(),e.enable=!1),!0);function g(A){if(A.distanceText&&A.distanceText!==e.options.distanceText){const b=A.distanceText;e.options.distanceText=b,Object.values(a).forEach(v=>{v.rules.forEach(w=>{const[y,I]=w.rule,k=y.distanceTo(I),C=w.$element.querySelector(".PanoRulerPlugin-rule-label-name");!C||(C.innerText=b(k))})})}}return{enable:h,disable:p,load:c,state:e,changeConfigs:g}};function Bc(o){i.append_styles(o,"svelte-1h27ktp",".PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp{position:absolute;transform-origin:left 0.0625rem;width:0;height:0.125rem;pointer-events:none}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::after{content:'';position:absolute;left:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::before{content:'';position:absolute;right:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1.5s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp em.svelte-1h27ktp{display:block;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;box-shadow:0 0 0.25rem rgb(0 0 0 / 40%);position:relative}.rule-mixed-line.svelte-1h27ktp.svelte-1h27ktp{display:flex;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;align-items:center}.em-solid.svelte-1h27ktp.svelte-1h27ktp{height:100%;background:#ffffff}.em-dotted.svelte-1h27ktp.svelte-1h27ktp{height:0.125rem;background:var(--background-image);background-position:center;background-repeat:repeat}.PanoRulerPlugin-rule-label.svelte-1h27ktp.svelte-1h27ktp{position:absolute;width:0;height:0;top:0.0625rem;pointer-events:none}.PanoRulerPlugin-rule-label-name.svelte-1h27ktp.svelte-1h27ktp{position:absolute;padding:0.1875rem 0.375rem;background:rgba(195, 195, 195, 0.3);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem);border-radius:6.25rem;border:0.0625rem solid rgba(255, 255, 255, 0.6);white-space:nowrap;overflow:hidden;color:#ffffff;font-weight:500;font-size:0.75rem;line-height:1;animation:svelte-1h27ktp-viewport-rule-label 0.25s ease 1s;animation-fill-mode:both;box-shadow:inset 0 0 0.625rem 0 rgba(255, 255, 255, 0.3)}@keyframes svelte-1h27ktp-viewport-rule-line{0%{width:0%}100%{width:100%}}@keyframes svelte-1h27ktp-viewport-rule-label{0%{opacity:0;transform:scaleX(0)}100%{opacity:1;transform:translate(-50%, -50%) scaleX(1)}}@keyframes svelte-1h27ktp-viewport-rule-point{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}")}function Si(o,t,e){const n=o.slice();return n[6]=t[e],n}function Qc(o){let t,e=o[0].children,n=[];for(let s=0;s<e.length;s+=1)n[s]=Li(Si(o,e,s));return{c(){t=i.element("div");for(let s=0;s<n.length;s+=1)n[s].c();i.attr(t,"class","rule-mixed-line svelte-1h27ktp")},m(s,r){i.insert(s,t,r);for(let a=0;a<n.length;a+=1)n[a].m(t,null)},p(s,r){if(r&9){e=s[0].children;let a;for(a=0;a<e.length;a+=1){const l=Si(s,e,a);n[a]?n[a].p(l,r):(n[a]=Li(l),n[a].c(),n[a].m(t,null))}for(;a<n.length;a+=1)n[a].d(1);n.length=e.length}},d(s){s&&i.detach(t),i.destroy_each(n,s)}}}function Rc(o){let t,e;return{c(){t=i.element("em"),i.attr(t,"class",e=i.null_to_empty(o[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),i.attr(t,"style",o[3])},m(n,s){i.insert(n,t,s)},p(n,s){s&1&&e!==(e=i.null_to_empty(n[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&i.attr(t,"class",e),s&8&&i.attr(t,"style",n[3])},d(n){n&&i.detach(t)}}}function Li(o){let t,e,n=`${o[6].width}px`;return{c(){t=i.element("div"),i.attr(t,"class",e=i.null_to_empty(o[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),i.attr(t,"style",o[3]),i.set_style(t,"width",n,!1)},m(s,r){i.insert(s,t,r)},p(s,r){r&1&&e!==(e=i.null_to_empty(s[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&i.attr(t,"class",e),r&8&&i.attr(t,"style",s[3]),r&1&&n!==(n=`${s[6].width}px`)&&i.set_style(t,"width",n,!1)},d(s){s&&i.detach(t)}}}function Oc(o){let t,e,n,s,r=o[0].labelElement+"",a,l,c=`${o[0].labelOffset}%`,d=`${o[0].width}px`,u=`${o[0].left}px`,f=`${o[0].top}px`,h=`rotate(${o[0].rotateDeg}deg)`;function p(b,v){return b[0].children.length===0?Rc:Qc}let g=p(o),A=g(o);return{c(){t=i.element("div"),A.c(),e=i.space(),n=i.element("div"),s=i.element("div"),a=i.text(r),i.attr(s,"class","PanoRulerPlugin-rule-label-name svelte-1h27ktp"),i.add_render_callback(()=>o[4].call(s)),i.attr(n,"class","PanoRulerPlugin-rule-label svelte-1h27ktp"),i.set_style(n,"left",c,!1),i.attr(t,"class","PanoRulerPlugin-rule-line svelte-1h27ktp"),i.set_style(t,"width",d,!1),i.set_style(t,"left",u,!1),i.set_style(t,"top",f,!1),i.set_style(t,"transform",h,!1),i.set_style(t,"display",o[0].visible&&o[2]?"block":"none",!1)},m(b,v){i.insert(b,t,v),A.m(t,null),i.append(t,e),i.append(t,n),i.append(n,s),i.append(s,a),l=i.add_resize_listener(s,o[4].bind(s))},p(b,[v]){g===(g=p(b))&&A?A.p(b,v):(A.d(1),A=g(b),A&&(A.c(),A.m(t,e))),v&1&&r!==(r=b[0].labelElement+"")&&i.set_data(a,r),v&1&&c!==(c=`${b[0].labelOffset}%`)&&i.set_style(n,"left",c,!1),v&1&&d!==(d=`${b[0].width}px`)&&i.set_style(t,"width",d,!1),v&1&&u!==(u=`${b[0].left}px`)&&i.set_style(t,"left",u,!1),v&1&&f!==(f=`${b[0].top}px`)&&i.set_style(t,"top",f,!1),v&1&&h!==(h=`rotate(${b[0].rotateDeg}deg)`)&&i.set_style(t,"transform",h,!1),v&5&&i.set_style(t,"display",b[0].visible&&b[2]?"block":"none",!1)},i:i.noop,o:i.noop,d(b){b&&i.detach(t),A.d(),l()}}}function Hc(o,t,e){let n,{rulerItemProp:s}=t,r=!0,a,l="data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQiIHdpZHRoPSIxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PGZpbHRlciBpZD0icHJlZml4X19hIiBoZWlnaHQ9IjQwMCUiIHdpZHRoPSIxMzcuNCUiIHg9Ii0xOC43JSIgeT0iLTE1MCUiPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiBvcGV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jwvZz48L3N2Zz4=";function c(){a=this.offsetWidth,e(1,a)}return o.$$set=d=>{"rulerItemProp"in d&&e(0,s=d.rulerItemProp)},o.$$.update=()=>{o.$$.dirty&3&&(a>=s.width||a/2>=s.labelOffset/100*s.width||a/2>=(1-s.labelOffset/100)*s.width?e(2,r=!1):e(2,r=!0))},e(3,n=`--background-image: url(${l})`),[s,a,r,n,c]}class Fc extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Hc,Oc,i.safe_not_equal,{rulerItemProp:0},Bc)}}function _i(o,t,e){const n=o.slice();return n[12]=t[e],n}function zi(o){let t,e;return t=new Fc({props:{rulerItemProp:o[12]}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&1&&(r.rulerItemProp=n[12]),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function Gc(o){let t,e,n=o[0],s=[];for(let a=0;a<n.length;a+=1)s[a]=zi(_i(o,n,a));const r=a=>i.transition_out(s[a],1,1,()=>{s[a]=null});return{c(){t=i.element("div");for(let a=0;a<s.length;a+=1)s[a].c()},m(a,l){i.insert(a,t,l);for(let c=0;c<s.length;c+=1)s[c].m(t,null);e=!0},p(a,[l]){if(l&1){n=a[0];let c;for(c=0;c<n.length;c+=1){const d=_i(a,n,c);s[c]?(s[c].p(d,l),i.transition_in(s[c],1)):(s[c]=zi(d),s[c].c(),i.transition_in(s[c],1),s[c].m(t,null))}for(i.group_outros(),c=n.length;c<s.length;c+=1)r(c);i.check_outros()}},i(a){if(!e){for(let l=0;l<n.length;l+=1)i.transition_in(s[l]);e=!0}},o(a){s=s.filter(Boolean);for(let l=0;l<s.length;l+=1)i.transition_out(s[l]);e=!1},d(a){a&&i.detach(t),i.destroy_each(s,a)}}}function Nc(o,t,e){var A,b,v,w;let{five:n}=t,{rulerDatas:s}=t,{options:r}=t,a=[];const l=((b=(A=n.getElement())==null?void 0:A.parentElement)==null?void 0:b.clientWidth)||0,c=((w=(v=n.getElement())==null?void 0:v.parentElement)==null?void 0:w.clientHeight)||0,d=(y,I)=>{const k=[[{x:0,y:0},{x:l,y:0}],[{x:0,y:0},{x:0,y:c}],[{x:l,y:0},{x:l,y:c}],[{x:0,y:c},{x:l,y:c}]],C=[];for(let D=0;D<k.length;D++){const x=Ds([y,I],[k[D][0],k[D][1]],!0);x&&C.push(x)}return C.length===0?!1:C},u=(y,I)=>{const k=y.clone().project(n.camera),C=(k.x+1)/2*l,D=(-k.y+1)/2*c,x=I.clone().project(n.camera),z=(x.x+1)/2*l,_=(-x.y+1)/2*c,T=Math.sqrt(Math.pow(z-C,2)+Math.pow(_-D,2));return{startLeft:C,startTop:D,endLeft:z,endTop:_,distance:T}},f=(y,I,k)=>{const C=n.camera.position,D=n.camera.getWorldDirection(new M.Vector3),x=y.clone().sub(C).normalize().angleTo(D),z=I.clone().sub(C).normalize().angleTo(D),_=y.distanceTo(I),H=I.clone().sub(I.clone().sub(y).divide(new M.Vector3(2,2,2))).distanceTo(C),{startLeft:E,startTop:S,endLeft:L,endTop:B,distance:R}=u(y,I),Q=-((Math.PI/2-Math.atan2(L-E,S-B))/Math.PI)*180;let O=!0;k||(O=!1),!Ce(y,k)&&!Ce(I,k)&&(O=!1),_<.3&&(O=!1),x>Math.PI/2&&(O=!1),z>Math.PI/2&&(O=!1),H/_>8&&(O=!1);let X=50,Y=R;const J=d({x:~~E,y:~~S},{x:~~L,y:~~B});if(J&&J.length===1&&(Ce(y,k)?(Y=Math.sqrt(Math.pow(J[0].x-E,2)+Math.pow(J[0].y-S,2)),X=Y/R*50):Ce(I,k)&&(Y=Math.sqrt(Math.pow(J[0].x-L,2)+Math.pow(J[0].y-B,2)),X=100-Y/R*50)),J&&J.length===2){const te={x:(J[0].x+J[1].x)/2,y:(J[0].y+J[1].y)/2};X=Math.sqrt(Math.pow(te.x-E,2)+Math.pow(te.y-S,2))/R*100}return{startLeft:E,startTop:S,distance:R,deg:Q,visible:O,labelOffset:X,ruleLength:_}},h=()=>{const y=n.panoIndex,I=s.find(T=>T.panoIndex===y);if(!I)return e(0,a=[]);if(n.currentMode!==ee.Five.Mode.Panorama)return e(0,a=[]);const k=n.camera.position,C=n.camera.getWorldDirection(new M.Vector3),D=I.lines.map(T=>new M.Vector3(T.start[0],-T.start[1],-T.start[2])),x=I.lines.map(T=>new M.Vector3(T.end[0],-T.end[1],-T.end[2])),[z]=D.concat(x).sort((T,H)=>{const E=T.clone().setY(0).sub(k).normalize().angleTo(C.clone().setY(0)),S=H.clone().setY(0).sub(k).normalize().angleTo(C.clone().setY(0));return E-S}),_=I.lines.map(T=>{var Y,J;const H=T.start,E=T.end,{startLeft:S,startTop:L,distance:B,deg:R,visible:G,labelOffset:Q,ruleLength:O}=f(new M.Vector3(H[0],-H[1],-H[2]),new M.Vector3(E[0],-E[1],-E[2]),z),X=[];return T.children&&((Y=T.children)==null?void 0:Y.length)>0&&((J=T.children)==null||J.forEach(te=>{const oe=te.start,ce=te.end,{distance:N}=u(new M.Vector3(oe[0],-oe[1],-oe[2]),new M.Vector3(ce[0],-ce[1],-ce[2]));X.push({width:N,state:te.state})})),{width:B,left:S,top:L,rotateDeg:R,state:T.state,children:X,labelOffset:Q,visible:G,labelElement:r.distanceText(O)}});e(0,a=_)},p=()=>Yt(h),g=zn(h,80);return Z.onMount(()=>{h(),n.on("panoArrived",h),n.on("modeChange",h),n.on("cameraDirectionUpdate",p),n.on("movingToPano",p),n.on("mouseWheel",()=>g()),n.on("pinchGesture",()=>g())}),Z.onDestroy(()=>{n.off("panoArrived",h),n.off("modeChange",h),n.off("cameraDirectionUpdate",p),n.off("movingToPano",p),n.off("mouseWheel",()=>g()),n.off("pinchGesture",()=>g())}),o.$$set=y=>{"five"in y&&e(1,n=y.five),"rulerDatas"in y&&e(2,s=y.rulerDatas),"options"in y&&e(3,r=y.options)},[a,n,s,r]}class Wc extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Nc,Gc,i.safe_not_equal,{five:1,rulerDatas:2,options:3})}}class Xc{constructor(t,e){m(this,"five");m(this,"container",document.createElement("div"));m(this,"panoRulerProData");m(this,"rulerItems");m(this,"state",{enabled:!1,loaded:!1,options:{className:"",distanceText:t=>`${t.toFixed(1)}m`}});var n,s;this.five=t,this.container.classList.add("panoRulerProPlugin-container"),this.container.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;"),e&&(e.data&&this.load(e.data),this.state.options=j(j({},this.state.options),e.options||{}),(n=e.options)!=null&&n.className&&this.container.classList.add((s=e.options)==null?void 0:s.className)),this.five.once("modelLoaded",()=>F(this,null,function*(){var r,a;(a=(r=this.five.getElement())==null?void 0:r.parentNode)==null||a.append(this.container)})),this.five.once("dispose",()=>this.dispose())}load(t){return F(this,null,function*(){if(!this.five.work)return;const e=t.data;if(!e)throw new Error("\u6807\u5C3A\u6570\u636E\u4F9D\u8D56\u4E0D\u9F50\u5168\uFF01");this.panoRulerProData=e,this.state.loaded=!0})}enable(){return this.state.loaded?(this.state.enabled||(this.state.enabled=!0,this.render()),!0):!1}disable(){return this.state.enabled&&(this.state.enabled=!1,this.render()),!0}render(){return F(this,null,function*(){var t;if(this.state.enabled){if(!this.panoRulerProData||!this.container)return;this.rulerItems=new Wc({target:this.container,props:{five:this.five,rulerDatas:this.panoRulerProData,options:this.state.options}})}else(t=this.rulerItems)==null||t.$destroy(),this.rulerItems=void 0})}dispose(){this.container&&(this.rulerItems.$destroy(),this.rulerItems=void 0),this.container.remove()}}const Yc=(o,t)=>new Xc(o,t),Uc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZIAAABCCAYAAAB9y1BhAAAAAXNSR0IArs4c6QAADh5JREFUeAHtnVuPLDcVhedwC/dACKAICDxEIBQpygNI/Ab+MX8B8YCQEAjxgBAQLsm5Jjkn58r6Sl4jT52qnu4zXd121dqSx67q7ip7eXsv721XzcVFJAgEgSAQBIJAEAg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VeIpLo5jHbls1KD4eYaWIu4R+UeyYLA2RHQWGAADiJ9P9u2StcheRB4VQSkyzgD2PQppwBH4MaEMpBFRSDcqCYQx9ggDphr0QUb3SMSBJpAQGPiciei9P6oYYAmGphKbA4B6TRrJ+j1HKHYzh8cZbpVBowXZ8bgQhzPNJAOvvD4QjkOAj0hUAbdUOVMoHrqudT1OgSk2zgLkAl2n/LYvh9s900kutYV4UIvQiBXMMlBEAgCQWA1CBRCgUjmHAkI5vk+PACR1BcZmGmfH64GzTQkCASBILBhBAqhgEC9rDFGJI7FGJEcB4EgEASCQBAIAkEgCASBIBAEgkAQCAJBIAgEgSAQBIJAEAgCm0fg/x4jQQWGalpFAAAAAElFTkSuQmCC";function Vc(){const o=document.createElement("div"),t=document.createElement("i"),e=document.createElement("span");return o.appendChild(t),o.appendChild(e),o.style.position="relative",o.style.width="100%",o.style.display="flex",o.style.flexDirection="column",o.style.alignItems="center",o.style.marginTop=`${150/16}rem`,o.style.opacity="0",o.style.transition="opacity 1000ms linear",t.style.display="block",t.style.width=`${134/16}rem`,t.style.height=`${22/16}rem`,t.style.backgroundSize="100%",t.style.backgroundRepeat="no-repeat",t.style.backgroundImage=`url(${Uc})`,e.style.marginTop=`${10/16}rem`,e.style.fontSize=`${16/16}rem`,e.style.color="#fff",e.style.opacity="0.7",e.style.textShadow="0 2px 16px rgb(22 34 83 / 24%)",e.style.fontWeight="bold",{appendTo(n){n.appendChild(o)},dispose(){o.remove()},setRoom(n){e.innerHTML=n.name+" "+Math.floor(n.size/1e6)+"\u33A1"},show(){o.style.opacity="1"},hide(){o.style.opacity="0"}}}const Jc=new P.TextureLoader;function Mi(o){return F(this,null,function*(){return new Promise((t,e)=>{Jc.load(o,t,void 0,e)}).then(t=>(t.encoding=P.sRGBEncoding,t))})}const yt={userAction:!0};class Zc extends Ze{constructor(e,n){super(e);m(this,"state",{visible:!0,enabled:!0,config:{compassImageUrl:"//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png",entryDoorImageUrl:"//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png"}});m(this,"data");m(this,"group",new P.Group);m(this,"roomInfoInstance");m(this,"roomInfoWrapperInstance");m(this,"compassMeshTween");m(this,"compassMesh");m(this,"entryDoorMesh");m(this,"dispose",()=>{var e,n,s,r;this.five.scene.remove(this.group),this.group.remove(...this.group.children),(n=(e=this.compassMesh)==null?void 0:e.material.map)==null||n.dispose(),(r=(s=this.entryDoorMesh)==null?void 0:s.material.map)==null||r.dispose(),this.five.off("dispose",this.dispose),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});m(this,"_addEventListener",()=>{this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive),this.five.on("modeChange",this.onFiveModeChange),this.five.on("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});m(this,"_removeEventListener",()=>{this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("modeChange",this.onFiveModeChange),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});m(this,"_enable",()=>{this.five.scene.add(this.group),this.init(),this.onFivePanoArrived(this.five.panoIndex||0),this._addEventListener()});m(this,"_disable",()=>{this._clearCompassIfNeed(),this._clearEntryDoorIfNeed(),this.five.scene.remove(this.group),this._removeEventListener()});m(this,"_toggleVisible",()=>{this.group.visible=this.state.visible,this.five.needsRender=!0});m(this,"_clearCompassIfNeed",()=>{var e;this.compassMesh&&(this.group.remove(this.compassMesh),(e=this.compassMesh.material.map)==null||e.dispose(),this.compassMesh=null)});m(this,"_clearEntryDoorIfNeed",()=>{var e;this.entryDoorMesh&&(this.group.remove(this.entryDoorMesh),(e=this.entryDoorMesh.material.map)==null||e.dispose(),this.entryDoorMesh=null),this.roomInfoInstance&&(this.roomInfoInstance.dispose(),this.roomInfoInstance=null),this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.dispose(),this.roomInfoWrapperInstance=null)});m(this,"onFivePanoWillArrive",e=>{var n,s;e!==this.five.panoIndex&&((n=this.compassMeshTween)==null||n.dispose(),(s=this.compassMesh)==null||s.material.setValues({opacity:0}))});m(this,"onFivePanoArrived",e=>{var s,r,a,l,c,d,u;const n=(a=(r=(s=this.five.work)==null?void 0:s.observers)==null?void 0:r[e])==null?void 0:a.standingPosition;if(this.compassMesh&&(this.compassMesh.position.copy(n.clone().setY(n.y+.01)),this.compassMesh.material.opacity===0&&((l=this.compassMeshTween)==null||l.dispose(),this.compassMeshTween=Is(1e3).onUpdate(({progress:f})=>{var h;(h=this.compassMesh)==null||h.material.setValues({opacity:f}),this.five.needsRender=!0}).play())),this.entryDoorMesh){const h=new P.Vector3(this.data.entrance.position.x,this.data.entrance.position.y,this.data.entrance.position.z).clone().setY(n.y).sub(n).normalize(),p=n.clone().add(h.clone().multiplyScalar(.7)).setY(n.y+.01);this.entryDoorMesh.rotation.z=new P.Vector3(0,0,-1).angleTo(h),this.entryDoorMesh.position.copy(p),((c=this.data)==null?void 0:c.room_observers[e].room.type)===1?(d=this.entryDoorMesh)==null||d.material.setValues({opacity:1}):(u=this.entryDoorMesh)==null||u.material.setValues({opacity:0})}this.roomInfoInstance&&this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.css3DObject.position.copy(n.clone().setY(n.y+.01)),this.roomInfoInstance.setRoom(this.data.room_observers[e].room)),this.five.needsRender=!0});m(this,"onFiveCameraDirectionUpdate",({longitude:e,latitude:n})=>{var s,r;!this.roomInfoWrapperInstance||(this.roomInfoWrapperInstance.css3DObject.rotation.z=e,n>.66&&this.five.getCurrentState().mode==="Panorama"?(s=this.roomInfoInstance)==null||s.show():(r=this.roomInfoInstance)==null||r.hide())});m(this,"onFiveModeChange",(e,n,s,r,a)=>{e!==n&&this.setState({visible:e===ee.Five.Mode.Panorama},{userAction:a})});this.five.scene.add(this.group),this.five.once("dispose",this.dispose),this.setState({visible:!0,enabled:!0,config:j(j({},this.state.config),n||{})})}enable(e=yt){this.setState({enabled:!0},e)}disable(e=yt){this.setState({enabled:!1},e)}show(e=yt){if(!!this.state.enabled)return this.setState({visible:!0},e),Promise.resolve()}hide(e=yt){if(!!this.state.enabled)return this.setState({visible:!1},e),Promise.resolve()}setState(e,n={userAction:!0}){var r,a;const s=JSON.parse(JSON.stringify(this.state));this.state={visible:(r=e.visible)!=null?r:s.visible,enabled:(a=e.enabled)!=null?a:s.enabled,config:j(j({},s.config),e.config||{})},this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:n.userAction}),e.enabled===!0&&(this._enable(),this.hooks.emit("enable",n)),e.enabled===!1&&(this._disable(),this.hooks.emit("disable",n)),e.visible===!1&&(this._toggleVisible(),this.hooks.emit("hide",n)),e.visible===!0&&(this._toggleVisible(),this.hooks.emit("show",n)),e.config&&this.init()}load(e,n,s=!0){return F(this,null,function*(){const r=yield this.formatData(e);JSON.stringify(this.data)!==JSON.stringify(r)&&(this.hooks.emit("dataChange",r,this.data),this.data=j({},r),this.init(),n&&this.setState(n,{userAction:s}),this.hooks.emit("dataLoaded",this.data))})}formatData(e){return e.version&&e.data?Promise.resolve(e.data):Promise.resolve(e)}init(){return F(this,null,function*(){var s,r,a,l;const e=(r=(s=this.data)==null?void 0:s.north_rad)!=null?r:null;this._clearCompassIfNeed(),e!==null&&(this.compassMesh=yield this.loadCompassMesh(),this.compassMesh.rotateX(-Math.PI/2),this.compassMesh.rotateZ(e-Math.PI/2),this.group.add(this.compassMesh));const n=(l=(a=this.data)==null?void 0:a.entrance)!=null?l:null;this._clearEntryDoorIfNeed(),n!==null&&(this.entryDoorMesh=yield this.loadEntryDoorMesh(),this.roomInfoWrapperInstance=this.loadRoomInfo(),this.roomInfoInstance=Vc(),this.entryDoorMesh.rotateX(-Math.PI/2),this.roomInfoWrapperInstance&&this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container),this.group.add(this.entryDoorMesh)),this.onFivePanoArrived(this.five.panoIndex||0),this.five.needsRender=!0})}loadCompassMesh(){return F(this,null,function*(){const e=this.state.config.compassImageUrl,n=yield Mi(e),s=new P.CircleGeometry(.7,32),r=new P.MeshBasicMaterial({map:n,transparent:!0,opacity:0,depthTest:!1}),a=new P.Mesh(s,r);return a.name="pano-compass-mesh",a})}loadEntryDoorMesh(){return F(this,null,function*(){const e=this.state.config.entryDoorImageUrl,n=yield Mi(e),s=new P.PlaneGeometry(.2,.16),r=new P.MeshBasicMaterial({map:n,transparent:!0,opacity:.8,depthTest:!1}),a=new P.Mesh(s,r);return a.name="pano-compass-entry-door",a})}loadRoomInfo(){const e=[new P.Vector3(-.7,0,-.7),new P.Vector3(.7,0,-.7),new P.Vector3(.7,0,.7),new P.Vector3(-.7,0,.7)];return nt(this.five).create3DDomContainer(e)}}const qc=(o,t)=>new Zc(o,t);function wt(o,t,e){const n=o[t];o[t]=o[e],o[e]=n}function Kc(o,t,e){const n=e/2;for(let s=1;s<=n;s++){const r=e-(s-1);for(let a=1;a<=t;a++){const l=(s-1)*t+a-1,c=(r-1)*t+a-1;wt(o,l*4+0,c*4+0),wt(o,l*4+1,c*4+1),wt(o,l*4+2,c*4+2),wt(o,l*4+3,c*4+3)}}}class Ls{constructor(t,e){m(this,"width");m(this,"height");m(this,"visible",!1);m(this,"hooks",new ee.Subscribe);m(this,"contentDom",document.createElement("canvas"));m(this,"five");m(this,"scale");m(this,"wrapper");m(this,"config");m(this,"offset",{x:0,y:0});m(this,"canvas",this.contentDom);m(this,"context");m(this,"renderCenter",new P.Vector3);m(this,"lastPanEvent");m(this,"hammer");m(this,"onPan",t=>{var d,u,f,h;if(!this.wrapper)return;const e=(u=(d=this.lastPanEvent)==null?void 0:d.deltaX)!=null?u:0,n=(h=(f=this.lastPanEvent)==null?void 0:f.deltaY)!=null?h:0,s=t.deltaX-e,r=t.deltaY-n;if(this.lastPanEvent=t,this.hooks.emit("wantsPanGesture",{srcEvent:t,deltaX:s,deltaY:r}))return;const l=this.offset.x+s,c=this.offset.y+r;this.contentDom.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)",this.canvas.style.transform=`translate3d(${l}px, ${c}px, 100px)`,this.offset={x:l,y:c}});m(this,"onPanEnd",t=>{this.lastPanEvent=void 0,this.contentDom.style.boxShadow="none"});var s,r,a;if(!t.renderer)throw new Error("Five Render \u672A\u521D\u59CB\u5316");this.five=t,this.scale=(s=e==null?void 0:e.scale)!=null?s:2,this.width=(r=e==null?void 0:e.width)!=null?r:190,this.height=(a=e==null?void 0:e.height)!=null?a:190,this.config={dragEnabled:(e==null?void 0:e.dragEnabled)||!1,autoFixPCPosition:(e==null?void 0:e.autoFixPCPosition)||!1,initialPosition:(e==null?void 0:e.initialPosition)||{left:"0",top:"0"}};const n=this.canvas.getContext("2d");if(!n)throw new Error("CANNOT CREATE CONTEXT2D");this.context=n,this.config.dragEnabled&&(this.hammer=new ut.default(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panend",this.onPanEnd))}dispose(){var t;this.clear(),this.remove(),(t=this.hammer)==null||t.destroy()}remove(){this.canvas.remove(),this.visible=!1}clear(){this.context.clearRect(0,0,this.canvas.width,this.canvas.height)}appendTo(t){this.wrapper=t,this.initStyle(),t.append(this.canvas),this.visible=!0}renderWithPoint(t){!this.wrapper||(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}autoFixPCPosition(){if(!this.wrapper)return;const{width:t,height:e}=this,n=this.renderCenter.clone().project(this.five.camera),s=(n.x+1)/2*this.wrapper.clientWidth,r=-(n.x-1)/2*this.wrapper.clientWidth,a=-(n.y-1)/2*this.wrapper.clientHeight;s<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=90+"px"):a<183?(this.canvas.style.top=90+"px",this.canvas.style.left=-t/2+"px"):r<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=-t-90+"px"):(this.canvas.style.left=-t/2+"px",this.canvas.style.top=-e-90+"px"),this.canvas.style.transform=`translate3d(${s}px, ${a}px, 10px)`,this.offset={x:s,y:a}}render(){if(!this.five.renderer||!this.wrapper)return;const{scale:t,context:e,width:n,height:s}=this,r=this.renderCenter.clone().project(this.five.camera),a=this.five.renderer.getSize(new P.Vector2),l=1,c=n/t,d=s/t,u=l*t,f=(r.x+1)/2*a.x,h=(r.y+1)/2*a.y,p=this.five.getPixels(f-c/2,h-c/2,c,d,u),g=Math.floor(n*l),A=Math.floor(s*l);Kc(p,g,A);const b=new ImageData(g,A);b.data.set(p),e.putImageData(b,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}}class $c{constructor(t){m(this,"edges",[]);m(this,"five");m(this,"onModelLoaded",()=>{!this.five.model||(this.edges=this.five.model.getEdges())});this.five=t,this.five.model.loaded?this.onModelLoaded():this.five.on("modelLoaded",this.onModelLoaded)}dispose(){}getAdsorbentPoint(t){if(this.edges.length===0)return null;let e=1/0,n;return this.edges.forEach(s=>{const r=s.closestPointToPoint(t.point,!0,new M.Vector3),a=r.distanceTo(t.point);a<e&&(n=r,e=a)}),e>.1?null:n||null}}class An{constructor(){m(this,"id",ue());m(this,"points",[]);m(this,"lines",[])}push(t){const e=this.getNext(t);if(!e)throw new Error("\u5F53\u524D\u7EBF\u6BB5\u4E8E\u4E0A\u4E00\u6761\u7EBF\u6BB5\u65E0\u6CD5\u6784\u6210\u6298\u7EBF");return this.lines.push(e.line),this.points.push(...e.points),this.lines.length}pop(){const t=this.lines.pop();return this.lines.length===0?this.points.slice(0,this.points.length):this.points.pop(),t}getNext(t){const e=this.points.slice(-1)[0];if(!e)return{line:t,points:t.points};if(!t.points.includes(e))return null;const n=t.points.find(s=>s!==e);return n?{line:t,points:[n]}:null}toJson(){return{id:this.id,lines:this.lines.map(t=>t.id),points:this.points.map(t=>t.id)}}toCompletelyJson(){return{id:this.id,points:this.points.map(t=>t.toJson()),lines:this.lines.map(t=>t.toCompletelyJson())}}}const ed=1,td=3,nd=new M.Color(16777215),id=new M.Color(6522623),od=new M.Color(16777215),sd=new M.Color(6522623),rd=6,ad=8,ld="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==",_s=new M.TextureLoader().load(ld),zs={pointTexture:_s,pointSize:rd,lineWidth:ed,lineColor:nd,pointColor:od,lineRenderOrder:20,pointsRenderOrder:20};V(j({},zs),{dashed:!0});const cd={pointTexture:_s,pointSize:ad,lineWidth:td,lineColor:id,pointColor:sd,lineRenderOrder:10,pointsRenderOrder:10};function dd(o,t,e){var u,f,h,p,g;const n=(u=e==null?void 0:e.lineWidth)!=null?u:2,s=(f=e==null?void 0:e.lineColor)!=null?f:new M.Color(16777215),r=(h=e==null?void 0:e.pointSize)!=null?h:5,a=(p=e==null?void 0:e.lineRenderOrder)!=null?p:10,l=(g=e==null?void 0:e.lineRenderOrder)!=null?g:20,c=new ls.Line(o,t);c.setMaterial({linewidth:n,color:s}),c.line.material.depthTest=!1,c.line.material.transparent=!0,c.line.renderOrder=a,c.points.renderOrder=l;const d=c.points.material;return d.depthTest=!1,d.size=r,e!=null&&e.pointColor&&d.color.set(e.pointColor).convertSRGBToLinear(),e!=null&&e.pointTexture&&(d.map=e.pointTexture),c}function Ti(o,t){const[e,n]=o.points,s=t==="light"?cd:zs,r=dd(e.position,n.position,s);return r.name="normalLine_"+o.id,r}function Ee(o){const{x:t,y:e,z:n}=o;return!(Math.abs(t)>1||Math.abs(e)>1||Math.abs(n)>1)}function ud(){const o=document.createElement("div");return o.setAttribute("style","backdrop-filter: blur(4px);-webkit-backdrop-filter: blur(4px);"),o.style.padding="3px 6px",o.style.lineHeight="1",o.style.textAlign="center",o.style.transform="translate(-50%, -50%)",o.style.borderRadius="100px",o.style.fontSize="14px",o.style.color="#fff",o.style.background="rgba(195,195,195,0.70)",o.style.border="0.5px solid rgba(255,255,255,0.6)",o.style.pointerEvents="all",o.style.cursor="pointer",o}function hd(o){const t=document.createElement("div");return t.id="distance_"+o.id,t.classList.add("five-plugin-measure__distance"),t.style.opacity="0",t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.transform="translate3d(0, 0, 0)",t.style.transformOrigin="left top",t}function fd(o){function t(){var g;(g=o.clickCallback)==null||g.call(o,p)}function e(){if(f)return f.highlight();d.style.border="0.5px solid #95AEFF",d.style.background="linear-gradient(90deg, #95AEFF 0%, #6386FF 100%)"}function n(){if(f)return f.unHighlight();d.style.border="0.5px solid rgba(255,255,255,0.6)",d.style.background="rgba(195,195,195,0.70)"}function s(g){const A=g.getElement();if(!A)return;const b=A.clientWidth,v=A.clientHeight;if(l.points.length<2)return;const[w,y]=l.points,I=w.position.clone().project(g.camera),k=y.position.clone().project(g.camera),C=I.clone().lerp(k,.5),D=new M.Vector2(I.x*b,I.y*v),x=new M.Vector2(k.x*b,k.y*v);if((()=>!(Math.abs(I.z)>1||Math.abs(k.z)>1||!Ee(I)&&!Ee(k)||!Ee(C)||D.distanceTo(x)<20))()===!1){u.style.opacity="0",u.style.pointerEvents="none";return}const _=(C.x+1)/2*b,T=-(C.y-1)/2*v,E=-(Math.atan((D.y-x.y)/(D.x-x.x))*180)/Math.PI;u.style.transform=`translate(${_}px, ${T}px) rotate(${E}deg)`,u.style.opacity="1",u.style.pointerEvents="all",f&&f.update({line:l.toCompletelyJson(),polyline:l.getPolyline().toCompletelyJson()});const S=w.position.clone().distanceTo(y.position),L=o.line.model.params.getDistanceText(S);d.innerText!==L&&(d.innerText=L)}function r(g){g.appendChild(u),u.addEventListener("click",t)}function a(){d.removeEventListener("click",t),u.remove()}const{line:l}=o,c=l.id,d=ud(),u=hd(l),f=o.userDistanceItem,h=new M.Vector3(0,0,0),p={lineID:c,ndcPosition:h,update:s,appendTo:r,remove:a,highlight:e,unHighlight:n};return f!=null&&f.element?u.appendChild(f.element):u.appendChild(d),p}class it{constructor(t,e,n){m(this,"id");m(this,"selected",!1);m(this,"type","line");m(this,"model");m(this,"mesh");m(this,"points");m(this,"lightMesh");m(this,"hook");m(this,"distanceItem");m(this,"polyline");if(this.id=ue(),this.model=n,t.id===e.id)throw new Error("\u65E0\u6548\u7684\u7EBF\u6BB5, \u4E00\u4E2A\u70B9\u65E0\u6CD5\u6784\u6210\u7EBF\u6BB5");this.hook=new ee.Subscribe,this.points=[t,e],this.mesh=Ti(this,"normal"),this.lightMesh=Ti(this,"light"),this.distanceItem=fd({line:this,clickCallback:()=>this.hook.emit("selected",this),userDistanceItem:this.model.params.userDistanceItemCreator?this.model.params.userDistanceItemCreator():void 0}),t.lines.push(this),e.lines.push(this)}clear(){this.selected=!1,this.polyline=void 0}getPolyline(){if(this.polyline)return this.polyline;const t=this.model.polylines.find(n=>n.lines.includes(this));if(this.polyline=t,t)return t;const e=new An;return e.push(this),e}findAnotherPoint(t){return this.points.find(({id:e})=>e!==t.id)}toJson(){return{id:this.id,points:this.points.map(({id:t})=>t)}}toCompletelyJson(){return{id:this.id,points:this.points.map(t=>t.toJson())}}clone(){return new it(this.points[0].clone(),this.points[1].clone(),this.model)}}function st(o,t){for(let e=0,n=t.length;e<n;e++)if(o===t[e])return t.splice(e,1)[0]}class Pe{constructor(t){m(this,"id");m(this,"lines");m(this,"position");m(this,"type","point");this.id=ue(),this.lines=[],this.position=new M.Vector3,t instanceof M.Vector3?this.position.copy(t):this.position.fromArray(t)}toJson(){return{id:this.id,lines:this.lines.map(({id:t})=>t),position:this.position.toArray()}}addLine(t){this.lines.push(t)}removeLine(t){st(t,this.lines)}clone(){return new Pe(this.position)}}class Tn{constructor(t){m(this,"lines",[]);m(this,"points",[]);m(this,"params");m(this,"polylines",[]);m(this,"hook",new ee.Subscribe);this.params=t}addLine(t){const[e,n]=t.points;if(!e||!n)return this;this.includes(e)||this.points.push(e),this.includes(n)||this.points.push(n),this.lines.push(t);const s=this.polylines.find(r=>!!r.getNext(t));if(s)s.push(t);else{const r=new An;r.push(t),this.polylines.push(r)}this.hook.emit("lineAdded",t)}removeLineByID(t){const e=this.getLineByID(t);e&&this.removeLine(e)}removeLine(t){const e=this.polylines.find(r=>r.lines.includes(t));if(e){if(e.lines.slice(-1)[0]!==t)throw new Error("\u4E0D\u80FD\u4ECE\u4E2D\u95F4\u5220\u9664\u7EBF\u6BB5");e.pop(),e.lines.length===0&&st(e,this.polylines)}const[n,s]=t.points;return n.lines.length===0&&st(n,this.points),s.lines.length===0&&st(s,this.points),st(t,this.lines),t.clear(),this.hook.emit("lineRemoved",t),this}mergeModel(t){t.lines.forEach(e=>this.addLine(e))}includes(t){if(t.type==="point")return this.points.find(({id:e})=>e===t.id)!==void 0;if(t.type==="line")return this.lines.find(({id:e})=>e===t.id)!==void 0}getPointByID(t){return this.points.find(({id:e})=>e===t)}getLineByID(t){return this.lines.find(({id:e})=>e===t)}getClosestPoint(){}parse(t){const e=t.points.map(({id:r,position:a})=>{const l=new Pe(a);return l.id=r,l}),n=t.lines.map(r=>{const[a,l]=r.points,c=this.getPointByID.call({points:e},a),d=this.getPointByID.call({points:e},l);if(!c||!d)throw new Error("\u7EBF\u4E0A\u7684\u70B9\u4E0D\u5B58\u5728");const u=new it(c,d,this);return u.id=r.id,u}),s=t.polylines.map(r=>{const a=new An;return r.lines.forEach(l=>{const c=n.find(({id:d})=>d===l);c&&a.push(c)}),a});return this.points.splice(0,this.points.length,...e),this.lines.splice(0,this.lines.length,...n),this.polylines.splice(0,this.polylines.length,...s),this}toJson(){return{points:this.points.map(t=>t.toJson()),lines:this.lines.map(t=>t.toJson()),polylines:this.polylines.map(t=>t.toJson()).filter(t=>t.lines.length>0)}}}const Ct=o=>o.preventDefault();class Vt{constructor(t){m(this,"model");m(this,"five");m(this,"group");m(this,"config");m(this,"dashed");m(this,"disposed",!1);m(this,"isMobile");m(this,"mouseGroup");m(this,"container");m(this,"fiveHelper");m(this,"hook");m(this,"magnifier");m(this,"userDistanceItemCreator");m(this,"updateDistanceUI",()=>{this.dashed.distanceItem.update(this.five),this.model.lines.forEach(t=>t.distanceItem.update(this.five))});var n,s;this.five=t.five,this.hook=t.hook,this.model=t.model,this.config=t.config,this.magnifier=t.magnifier,this.container=t.container,this.fiveHelper=t.fiveHelper,this.isMobile=(s=(n=t.openParams)==null?void 0:n.isMobile)!=null?s:!1,this.userDistanceItemCreator=t.userDistanceItemCreator,this.group=t.group,this.mouseGroup=t.mouseGroup,this.dashed=new it(new Pe([0,0,0]),new Pe([0,0,0]),this.model),this.dashed.mesh.setMaterial({dashed:!0,dashScale:100}),this.dashed.mesh.name="dashLine";const e=this.five.getElement();e&&(e.addEventListener("touchstart",Ct),e.addEventListener("contextmenu",Ct))}removeLine(t){this.group.remove(t.mesh,t.lightMesh),t.distanceItem.remove(),this.five.needsRender=!0}updateMouseGroup(t,e){if(!t)return this.mouseGroup;const n=this.fiveHelper.getAdsorbentPoint(t),s=n||t.point;if(this.mouseGroup.position.copy(s),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const a=t.face.normal.clone().multiplyScalar(.05),c=t.point.clone().add(a).clone().add(a);this.mouseGroup.lookAt(c)}return this.mouseGroup}dispose(){this.disposed=!0,this.magnifier.remove(),this.model.lines.forEach(e=>this.removeLine(e));const t=this.five.getElement();t&&(t.removeEventListener("touchstart",Ct),t.removeEventListener("contextmenu",Ct))}}function vn(o){const{x:t,y:e}=o.center,{clientWidth:n,clientHeight:s}=o.target,r=o.target.getBoundingClientRect(),a=new M.Vector2(t,e).sub(new M.Vector2(r.left,r.top)),l=new M.Vector2(a.x/n*2-1,-(a.y/s)*2+1);return{point:a,ndcPoint:l}}function on(o,t){const e=vn(t).ndcPoint,n=new M.Raycaster;return n.setFromCamera(e,o.camera),o.model.intersectRaycaster(n)}class Et extends Vt{constructor(e){var s;super(e);m(this,"type","edit");m(this,"pressPoint");m(this,"hasAppendDashed",!1);m(this,"hasAppendMouseGroup",!1);m(this,"fiveElement");m(this,"lastPoint",null);m(this,"hammer");m(this,"onIntersectionUpdate",zn((e,n)=>{var r;this.hasAppendMouseGroup===!1&&(this.group.add(this.mouseGroup),this.magnifier.appendTo(this.container),this.hasAppendMouseGroup=!0);const s=this.updateMouseGroup(e,n).position;(r=this.pressPoint)==null||r.position.copy(s),this.updateDashed(),requestAnimationFrame(()=>this.magnifier.renderWithPoint(this.mouseGroup.position)),this.five.needsRender=!0},20));m(this,"revoke",()=>{if(this.model.lines.length===0&&this.lastPoint){this.lastPoint=null,this.hasAppendDashed=!1,this.dashed.distanceItem.remove(),this.group.remove(this.dashed.mesh),this.hook.emit("anchorChange",null),this.five.needsRender=!0;return}if(this.model.lines.length===0&&!this.lastPoint||!this.lastPoint)return;const e=this.model.lines[this.model.lines.length-1],n=e.findAnotherPoint(this.lastPoint);!n||(this.lastPoint=n,this.hook.emit("anchorChange",n.position),this.group.remove(e.mesh),this.model.removeLine(e),this.hasAppendMouseGroup=!1,this.mouseGroup.position.copy(this.lastPoint.position),this.group.remove(this.mouseGroup),e.distanceItem.remove(),this.updateDashed(),this.magnifier.remove(),this.five.needsRender=!0)});m(this,"onMouseLeave",()=>{this.magnifier.remove(),this.group.remove(this.mouseGroup),this.hasAppendMouseGroup=!1,this.lastPoint&&(this.mouseGroup.position.copy(this.lastPoint.position),this.updateDashed())});m(this,"onLineChanged",()=>{this.hook.emit("editedLineChange",this.model.lines.map(e=>e.toCompletelyJson()))});m(this,"onPress",e=>{const[n]=on(this.five,e);if(!n||!n.face)return;const s=new Pe(n.point);this.pressPoint=s,this.onIntersectionUpdate(n)});m(this,"onPan",e=>{if(!this.pressPoint)return;const[n]=on(this.five,e);!n||!n.face||this.onIntersectionUpdate(n)});m(this,"onPanEnd",e=>{!this.pressPoint||this.onTap(e)});m(this,"onTap",e=>{this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh)),this.hasAppendDashed=!0;const[n]=on(this.five,e);this.updateMouseGroup(n);const s=new Pe(this.mouseGroup.position),r=this.lastPoint;if(s&&(this.lastPoint=s),s&&r){const a=new it(r,s,this.model);a.distanceItem.appendTo(this.container),this.model.addLine(a),this.group.add(a.mesh),a.distanceItem.update(this.five)}this.pressPoint=void 0,this.hasAppendMouseGroup=!1,this.magnifier.remove(),this.group.remove(this.mouseGroup),this.updateDashed(),this.five.needsRender=!0,this.hook.emit("anchorChange",s.position)});m(this,"onWantsTapGesture",()=>!1);m(this,"onWantsToMoveToPano",()=>!1);m(this,"onWantsPanGesture",()=>this.pressPoint?!1:void 0);m(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});m(this,"updateDashed",()=>{!this.lastPoint||(this.dashed.points[0].position.copy(this.lastPoint.position),this.dashed.points[1].position.copy(this.mouseGroup.position),this.dashed.mesh.setPoints(this.lastPoint.position,this.mouseGroup.position),this.dashed.distanceItem.update(this.five))});this.model=new Tn(this.config),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsPanGesture",this.onWantsPanGesture),this.five.on("wantsTapGesture",this.onWantsTapGesture),this.five.on("wantsToMoveToPano",this.onWantsToMoveToPano),this.five.on("intersectionOnModelUpdate",this.onIntersectionUpdate),this.model.hook.on("lineAdded",this.onLineChanged),this.model.hook.on("lineRemoved",this.onLineChanged);const n=this.five.getElement();if(n){this.fiveElement=n;const r=new ut.default(n);this.hammer=r,r.on("tap",this.onTap),r.on("pan",this.onPan),r.on("press",this.onPress),r.on("panend",this.onPanEnd)}(s=this.fiveElement)==null||s.addEventListener("mouseleave",this.onMouseLeave),this.hook.emit("anchorChange",null),this.five.refresh()}dispose(){var e,n;super.dispose(),this.group.remove(this.mouseGroup,this.dashed.mesh),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsPanGesture",this.onWantsPanGesture),this.five.off("wantsTapGesture",this.onWantsTapGesture),this.five.off("wantsToMoveToPano",this.onWantsToMoveToPano),this.five.off("intersectionOnModelUpdate",this.onIntersectionUpdate),this.model.hook.off("lineAdded",this.onLineChanged),this.model.hook.off("lineRemoved",this.onLineChanged),(e=this.hammer)==null||e.destroy(),(n=this.fiveElement)==null||n.removeEventListener("mouseleave",this.onMouseLeave),this.magnifier.dispose(),this.dashed.distanceItem.remove(),this.five.needsRender=!0}getEditingLines(){return this.model.lines}}function jn(o,t){const e=o.x-t[0].x,n=o.y-t[0].y,s=t[1].x-t[0].x,r=t[1].y-t[0].y,a=e*s+n*r,l=s*s+r*r,c=a/l;let d,u;return c<0||md(t[0],t[1])?(d=t[0].x,u=t[0].y):c>1?(d=t[1].x,u=t[1].y):(d=t[0].x+c*s,u=t[0].y+c*r),new M.Vector2(d,u)}function md(o,t){return o.x===t.x&&o.y===t.y}function Rt(o){const t=(r,a,l)=>{const c=r.lines.find(u=>u.points.findIndex(({id:h})=>h===r.id)!==a);if(!c)return l;const d=c.points[a];return d?t(d,a,l.concat(c)):l},e=t(o.points[0],1,[]),n=t(o.points[0],0,[]);return e.concat(n)}class pd extends Vt{constructor(e){super(e);m(this,"type","view");m(this,"highlightedLines",[]);m(this,"hammer");m(this,"wantsTapGesture",e=>{if(this.model.lines.length===0)return;const[n]=this.five.model.intersectRaycaster(e);if(!n)return;const s=this.five.camera,r=n.point.clone().project(s),a=this.container.clientWidth,l=this.container.clientHeight,c=new M.Vector2(r.x*a,r.y*l),d=this.model.lines.map(p=>{const[g,A]=p.points,b=g.position.clone().project(s),v=A.position.clone().project(s);if(!Ee(b)&&!Ee(v))return null;const w=new M.Vector2(b.x*a,b.y*l),y=new M.Vector2(v.x*a,v.y*l);return{id:p.id,points:[w,y]}}).filter(p=>!!p);if(d.length===0)return;const f=d.map(p=>{const g=jn(c,p.points);return{id:p.id,distance:g.distanceTo(c)}}).sort((p,g)=>p.distance-g.distance)[0],h=f.distance>20?void 0:this.model.lines.find(({id:p})=>p===f.id);if(this.highlightedLines.length>0&&!h)return this.clearHighlightLines(),!1;if(h)return this.chooseLine(h),!1});m(this,"chooseLine",e=>{const n=Rt(e);this.highlightLines(n),this.five.needsRender=!0,this.hook.emit("selectedChange",n.map(s=>s.toCompletelyJson()))});m(this,"lineRemoved",e=>{this.removeLine(e),this.hook.emit("selectedChange",this.model.lines.filter(n=>n.selected).map(n=>n.toCompletelyJson()))});m(this,"onCameraUpdate",()=>{this.updateDistanceUI()});this.model.lines.forEach(s=>{s.distanceItem.appendTo(this.container),s.distanceItem.update(this.five),s.hook.on("selected",this.chooseLine),this.group.add(s.mesh)});const n=this.five.getElement();if(n){const s=new ut.default(n);this.hammer=s}this.model.hook.on("lineRemoved",this.lineRemoved),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsTapGesture",this.wantsTapGesture),this.five.needsRender=!0}dispose(){var e;super.dispose(),this.model.hook.off("lineRemoved",this.lineRemoved),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsTapGesture",this.wantsTapGesture),this.five.needsRender=!0,this.hook.emit("selectedChange",[]),(e=this.hammer)==null||e.destroy()}highlightLine(e){e.selected||(e.selected=!0,this.group.add(e.lightMesh),e.distanceItem.highlight(),this.five.needsRender=!0)}clearHighlightLines(){this.group.children.length!==0&&(this.model.lines.forEach(e=>{e.selected=!1,e.distanceItem.unHighlight(),this.group.remove(e.lightMesh)}),this.highlightedLines=[],this.five.needsRender=!0)}highlightLines(e){this.clearHighlightLines(),this.highlightedLines=e,e.forEach(n=>this.highlightLine(n))}}const gd=`
|
|
203
|
+
`,w=document.createElement("div");return w.setAttribute("class","PanoRulerPlugin-rule"),w.setAttribute("data-name",A),w.setAttribute("style","display: none"),w.innerHTML=v,w},s=document.createElement("div");s.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;");const r=document.createElement("div");r.innerHTML=zc,s.appendChild(r);const a={},l=(A,b)=>{if(e.loaded)throw new Error("\u6807\u5C3A\u88AB\u91CD\u590D\u521D\u59CB\u5316\uFF01");const v=Tc(A,o),w=o.work;if(!w)return!1;for(const y in b){const I=b[y],{standingPosition:k}=w.observers[0],C=I.map(({x:D,z:x,observers:z})=>{const L=z.length>0?A.rooms[A.observers[z[0]]].name:"",T=v[L]?v[L].floor:null;let R=1/0,E={index:0,x:k.x,y:k.y,z:k.z};z.forEach(Q=>{if(!w.observers[Q])return;const{standingPosition:H}=w.observers[Q],X={index:Q,x:H.x,y:H.y,z:H.z},Y=Mc({x:D,z:x},X);T?Y<R&&Math.abs(X.y-T)<.3&&(R=Y,E=X):Y<R&&(R=Y,E=X)});const S=new M.Vector3(D,E.y,x);Object.assign(S,{observers:z});const _=v[L]?v[L].roof:null,B=_?new M.Vector3(D,_,x):null;return B&&Object.assign(B,{observers:z}),{origin:S,vertical:B}});a[y]={origins:C.map(D=>D.origin),rules:[]};for(const{origin:D,vertical:x}of C){if(!x)continue;const z=n(y,D.distanceTo(x));s.append(z),a[y].rules.push({vertical:!0,rule:[D,x],$element:z})}for(let D=0;D<C.length;D++){let x=D+1;x>=C.length&&(x=0);const{origin:z}=C[D],{origin:L}=C[x],T=n(y,z.distanceTo(L));s.append(T),a[y].rules.push({vertical:!1,rule:[z,L],$element:T})}}return e.loaded=!0,!0},c=(A,b,v)=>F(exports,null,function*(){const w=A||t.roomInfo,y=b||t.roomRules;if(!w||!y)throw new Error("\u6807\u5C3A\u6570\u636E\u4F9D\u8D56\u4E0D\u9F50\u5168\uFF01");return e.loaded=!1,e.options=j(j({},e.options),v||{}),o.model.loaded?l(w,y):yield new Promise(I=>o.once("modelLoaded",()=>I(l(w,y))))});t.roomInfo&&t.roomRules&&c(t.roomInfo,t.roomRules);const d=(A,b,v,w)=>{const y=[[{x:0,y:0},{x:v,y:0}],[{x:0,y:0},{x:0,y:w}],[{x:v,y:0},{x:v,y:w}],[{x:0,y:w},{x:v,y:w}]],I=[];for(let k=0;k<y.length;k++){const C=Ds([A,b],[y[k][0],y[k][1]],!0);C&&I.push(C)}return I.length===0?!1:I},u=()=>{var z;const A=(z=o.getElement())==null?void 0:z.parentElement;if(!A||!e.loaded||Object.keys(a).length<=0)return;const{panoIndex:b,camera:v,currentMode:w}=o;if(b===void 0)return;let y;for(const L in a)L.split(",").indexOf(b.toString())>=0&&(y=L);if(!y){for(const L in a)for(const{$element:T}of a[L].rules)T.style.display="none";return}const I=v.position,k=v.getWorldDirection(new M.Vector3),C=A.clientWidth,D=A.clientHeight;if(w!==ee.Five.Mode.Panorama){for(const L in a)for(const{$element:T}of a[L].rules)T.style.display="none";return}for(const L in a)for(const{$element:T}of a[L].rules)T.style.display=L===y?"block":"none";const[x]=a[y].origins.slice().filter(L=>L.observers.indexOf(b)>=0).sort((L,T)=>{const R=L.clone().setY(0).sub(I).normalize().angleTo(k.clone().setY(0)),E=T.clone().setY(0).sub(I).normalize().angleTo(k.clone().setY(0));return R-E});for(const{rule:L,vertical:T,$element:R}of a[y].rules){const[E,S]=L,_=R.querySelector(".PanoRulerPlugin-rule-line");if(!_)return;if(!x){R.style.display="none";continue}if(E!==x&&S!==x){R.style.display="none";continue}if(E.distanceTo(S)<.3){R.style.display="none";continue}if(E.observers.indexOf(b)===-1||S.observers.indexOf(b)===-1){R.style.display="none";continue}if(E.clone().sub(I).normalize().angleTo(k)>Math.PI/2){R.style.display="none";continue}if(S.clone().sub(I).normalize().angleTo(k)>Math.PI/2){R.style.display="none";continue}const G=E.distanceTo(S);if(S.clone().sub(S.clone().sub(E).divide(new M.Vector3(2,2,2))).distanceTo(I)/G>8){R.style.display="none";continue}const X=E.clone().project(v),Y=(X.x+1)/2*C,J=(-X.y+1)/2*D,te=S.clone().project(v),oe=(te.x+1)/2*C,ce=(-te.y+1)/2*D,N=Math.sqrt(Math.pow(oe-Y,2)+Math.pow(ce-J,2));let $=N,ne=50;const W=d({x:~~Y,y:~~J},{x:~~oe,y:~~ce},C,D);if(W&&W.length===1&&(x===E?($=Math.sqrt(Math.pow(W[0].x-Y,2)+Math.pow(W[0].y-J,2)),ne=$/N*50):x===S&&($=Math.sqrt(Math.pow(W[0].x-oe,2)+Math.pow(W[0].y-ce,2)),ne=100-$/N*50)),W&&W.length===2){const _e={x:(W[0].x+W[1].x)/2,y:(W[0].y+W[1].y)/2};ne=Math.sqrt(Math.pow(_e.x-Y,2)+Math.pow(_e.y-J,2))/N*100}const Re=(Math.PI/2-Math.atan2(oe-Y,J-ce))/Math.PI*180,K=_.querySelector(".PanoRulerPlugin-rule-label"),Le=K.children[0].clientWidth;Le>=N||Le/2>=ne/100*N||Le/2>=(1-ne/100)*N?_.style.display="none":(_.style.display="block",_.style.width=N+"px",_.style.left=Y+"px",_.style.top=J+"px",_.style.transform=`rotate(${-Re}deg)`,K.style.left=`${ne}%`)}},f=()=>Ss(u),h=()=>{var A,b;return e.loaded?(e.enable||(s.setAttribute("class","PanoRulerPlugin"+(e.options.className?" "+e.options.className:"")),(b=(A=o.getElement())==null?void 0:A.parentElement)==null||b.append(s),u(),o.on("modeChange",u),o.on("cameraUpdate",f),e.enable=!0),!0):!1},p=()=>(e.enable&&(o.off("modeChange",u),o.off("cameraUpdate",f),s&&s.remove(),e.enable=!1),!0);function g(A){if(A.distanceText&&A.distanceText!==e.options.distanceText){const b=A.distanceText;e.options.distanceText=b,Object.values(a).forEach(v=>{v.rules.forEach(w=>{const[y,I]=w.rule,k=y.distanceTo(I),C=w.$element.querySelector(".PanoRulerPlugin-rule-label-name");!C||(C.innerText=b(k))})})}}return{enable:h,disable:p,load:c,state:e,changeConfigs:g}};function Bc(o){i.append_styles(o,"svelte-1h27ktp",".PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp{position:absolute;transform-origin:left 0.0625rem;width:0;height:0.125rem;pointer-events:none}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::after{content:'';position:absolute;left:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::before{content:'';position:absolute;right:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1.5s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp em.svelte-1h27ktp{display:block;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;box-shadow:0 0 0.25rem rgb(0 0 0 / 40%);position:relative}.rule-mixed-line.svelte-1h27ktp.svelte-1h27ktp{display:flex;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;align-items:center}.em-solid.svelte-1h27ktp.svelte-1h27ktp{height:100%;background:#ffffff}.em-dotted.svelte-1h27ktp.svelte-1h27ktp{height:0.125rem;background:var(--background-image);background-position:center;background-repeat:repeat}.PanoRulerPlugin-rule-label.svelte-1h27ktp.svelte-1h27ktp{position:absolute;width:0;height:0;top:0.0625rem;pointer-events:none}.PanoRulerPlugin-rule-label-name.svelte-1h27ktp.svelte-1h27ktp{position:absolute;padding:0.1875rem 0.375rem;background:rgba(195, 195, 195, 0.3);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem);border-radius:6.25rem;border:0.0625rem solid rgba(255, 255, 255, 0.6);white-space:nowrap;overflow:hidden;color:#ffffff;font-weight:500;font-size:0.75rem;line-height:1;animation:svelte-1h27ktp-viewport-rule-label 0.25s ease 1s;animation-fill-mode:both;box-shadow:inset 0 0 0.625rem 0 rgba(255, 255, 255, 0.3)}@keyframes svelte-1h27ktp-viewport-rule-line{0%{width:0%}100%{width:100%}}@keyframes svelte-1h27ktp-viewport-rule-label{0%{opacity:0;transform:scaleX(0)}100%{opacity:1;transform:translate(-50%, -50%) scaleX(1)}}@keyframes svelte-1h27ktp-viewport-rule-point{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}")}function Si(o,t,e){const n=o.slice();return n[6]=t[e],n}function Qc(o){let t,e=o[0].children,n=[];for(let s=0;s<e.length;s+=1)n[s]=Li(Si(o,e,s));return{c(){t=i.element("div");for(let s=0;s<n.length;s+=1)n[s].c();i.attr(t,"class","rule-mixed-line svelte-1h27ktp")},m(s,r){i.insert(s,t,r);for(let a=0;a<n.length;a+=1)n[a].m(t,null)},p(s,r){if(r&9){e=s[0].children;let a;for(a=0;a<e.length;a+=1){const l=Si(s,e,a);n[a]?n[a].p(l,r):(n[a]=Li(l),n[a].c(),n[a].m(t,null))}for(;a<n.length;a+=1)n[a].d(1);n.length=e.length}},d(s){s&&i.detach(t),i.destroy_each(n,s)}}}function Rc(o){let t,e;return{c(){t=i.element("em"),i.attr(t,"class",e=i.null_to_empty(o[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),i.attr(t,"style",o[3])},m(n,s){i.insert(n,t,s)},p(n,s){s&1&&e!==(e=i.null_to_empty(n[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&i.attr(t,"class",e),s&8&&i.attr(t,"style",n[3])},d(n){n&&i.detach(t)}}}function Li(o){let t,e,n=`${o[6].width}px`;return{c(){t=i.element("div"),i.attr(t,"class",e=i.null_to_empty(o[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),i.attr(t,"style",o[3]),i.set_style(t,"width",n,!1)},m(s,r){i.insert(s,t,r)},p(s,r){r&1&&e!==(e=i.null_to_empty(s[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&i.attr(t,"class",e),r&8&&i.attr(t,"style",s[3]),r&1&&n!==(n=`${s[6].width}px`)&&i.set_style(t,"width",n,!1)},d(s){s&&i.detach(t)}}}function Oc(o){let t,e,n,s,r=o[0].labelElement+"",a,l,c=`${o[0].labelOffset}%`,d=`${o[0].width}px`,u=`${o[0].left}px`,f=`${o[0].top}px`,h=`rotate(${o[0].rotateDeg}deg)`;function p(b,v){return b[0].children.length===0?Rc:Qc}let g=p(o),A=g(o);return{c(){t=i.element("div"),A.c(),e=i.space(),n=i.element("div"),s=i.element("div"),a=i.text(r),i.attr(s,"class","PanoRulerPlugin-rule-label-name svelte-1h27ktp"),i.add_render_callback(()=>o[4].call(s)),i.attr(n,"class","PanoRulerPlugin-rule-label svelte-1h27ktp"),i.set_style(n,"left",c,!1),i.attr(t,"class","PanoRulerPlugin-rule-line svelte-1h27ktp"),i.set_style(t,"width",d,!1),i.set_style(t,"left",u,!1),i.set_style(t,"top",f,!1),i.set_style(t,"transform",h,!1),i.set_style(t,"display",o[0].visible&&o[2]?"block":"none",!1)},m(b,v){i.insert(b,t,v),A.m(t,null),i.append(t,e),i.append(t,n),i.append(n,s),i.append(s,a),l=i.add_resize_listener(s,o[4].bind(s))},p(b,[v]){g===(g=p(b))&&A?A.p(b,v):(A.d(1),A=g(b),A&&(A.c(),A.m(t,e))),v&1&&r!==(r=b[0].labelElement+"")&&i.set_data(a,r),v&1&&c!==(c=`${b[0].labelOffset}%`)&&i.set_style(n,"left",c,!1),v&1&&d!==(d=`${b[0].width}px`)&&i.set_style(t,"width",d,!1),v&1&&u!==(u=`${b[0].left}px`)&&i.set_style(t,"left",u,!1),v&1&&f!==(f=`${b[0].top}px`)&&i.set_style(t,"top",f,!1),v&1&&h!==(h=`rotate(${b[0].rotateDeg}deg)`)&&i.set_style(t,"transform",h,!1),v&5&&i.set_style(t,"display",b[0].visible&&b[2]?"block":"none",!1)},i:i.noop,o:i.noop,d(b){b&&i.detach(t),A.d(),l()}}}function Hc(o,t,e){let n,{rul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PjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1kYXNoYXJyYXk9IjUgNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48dXNlIGZpbGw9IiMwMDAiIGZpbHRlcj0idXJsKCNwcmVmaXhfX2EpIiB4bGluazpocmVmPSIjcHJlZml4X19iIi8+PHVzZSBzdHJva2U9IiNmZmYiIHN0cm9rZS1vcGFjaXR5PSIuNCIgeGxpbms6aHJlZj0iI3ByZWZpeF9fYiIvPjwvZz48L3N2Zz4=";function c(){a=this.offsetWidth,e(1,a)}return o.$$set=d=>{"rulerItemProp"in d&&e(0,s=d.rulerItemProp)},o.$$.update=()=>{o.$$.dirty&3&&(a>=s.width||a/2>=s.labelOffset/100*s.width||a/2>=(1-s.labelOffset/100)*s.width?e(2,r=!1):e(2,r=!0))},e(3,n=`--background-image: url(${l})`),[s,a,r,n,c]}class Fc extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Hc,Oc,i.safe_not_equal,{rulerItemProp:0},Bc)}}function _i(o,t,e){const n=o.slice();return n[12]=t[e],n}function zi(o){let t,e;return t=new Fc({props:{rulerItemProp:o[12]}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&1&&(r.rulerItemProp=n[12]),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function Gc(o){let t,e,n=o[0],s=[];for(let a=0;a<n.length;a+=1)s[a]=zi(_i(o,n,a));const r=a=>i.transition_out(s[a],1,1,()=>{s[a]=null});return{c(){t=i.element("div");for(let a=0;a<s.length;a+=1)s[a].c()},m(a,l){i.insert(a,t,l);for(let c=0;c<s.length;c+=1)s[c].m(t,null);e=!0},p(a,[l]){if(l&1){n=a[0];let c;for(c=0;c<n.length;c+=1){const d=_i(a,n,c);s[c]?(s[c].p(d,l),i.transition_in(s[c],1)):(s[c]=zi(d),s[c].c(),i.transition_in(s[c],1),s[c].m(t,null))}for(i.group_outros(),c=n.length;c<s.length;c+=1)r(c);i.check_outros()}},i(a){if(!e){for(let l=0;l<n.length;l+=1)i.transition_in(s[l]);e=!0}},o(a){s=s.filter(Boolean);for(let l=0;l<s.length;l+=1)i.transition_out(s[l]);e=!1},d(a){a&&i.detach(t),i.destroy_each(s,a)}}}function Nc(o,t,e){var A,b,v,w;let{five:n}=t,{rulerDatas:s}=t,{options:r}=t,a=[];const l=((b=(A=n.getElement())==null?void 0:A.parentElement)==null?void 0:b.clientWidth)||0,c=((w=(v=n.getElement())==null?void 0:v.parentElement)==null?void 0:w.clientHeight)||0,d=(y,I)=>{const k=[[{x:0,y:0},{x:l,y:0}],[{x:0,y:0},{x:0,y:c}],[{x:l,y:0},{x:l,y:c}],[{x:0,y:c},{x:l,y:c}]],C=[];for(let D=0;D<k.length;D++){const x=Ds([y,I],[k[D][0],k[D][1]],!0);x&&C.push(x)}return C.length===0?!1:C},u=(y,I)=>{const k=y.clone().project(n.camera),C=(k.x+1)/2*l,D=(-k.y+1)/2*c,x=I.clone().project(n.camera),z=(x.x+1)/2*l,L=(-x.y+1)/2*c,T=Math.sqrt(Math.pow(z-C,2)+Math.pow(L-D,2));return{startLeft:C,startTop:D,endLeft:z,endTop:L,distance:T}},f=(y,I,k)=>{const C=n.camera.position,D=n.camera.getWorldDirection(new M.Vector3),x=y.clone().sub(C).normalize().angleTo(D),z=I.clone().sub(C).normalize().angleTo(D),L=y.distanceTo(I),R=I.clone().sub(I.clone().sub(y).divide(new M.Vector3(2,2,2))).distanceTo(C),{startLeft:E,startTop:S,endLeft:_,endTop:B,distance:O}=u(y,I),Q=-((Math.PI/2-Math.atan2(_-E,S-B))/Math.PI)*180;let H=!0;k||(H=!1),!Ce(y,k)&&!Ce(I,k)&&(H=!1),L<.3&&(H=!1),x>Math.PI/2&&(H=!1),z>Math.PI/2&&(H=!1),R/L>8&&(H=!1);let X=50,Y=O;const J=d({x:~~E,y:~~S},{x:~~_,y:~~B});if(J&&J.length===1&&(Ce(y,k)?(Y=Math.sqrt(Math.pow(J[0].x-E,2)+Math.pow(J[0].y-S,2)),X=Y/O*50):Ce(I,k)&&(Y=Math.sqrt(Math.pow(J[0].x-_,2)+Math.pow(J[0].y-B,2)),X=100-Y/O*50)),J&&J.length===2){const te={x:(J[0].x+J[1].x)/2,y:(J[0].y+J[1].y)/2};X=Math.sqrt(Math.pow(te.x-E,2)+Math.pow(te.y-S,2))/O*100}return{startLeft:E,startTop:S,distance:O,deg:Q,visible:H,labelOffset:X,ruleLength:L}},h=()=>{const y=n.panoIndex,I=s.find(T=>T.panoIndex===y);if(!I)return e(0,a=[]);if(n.currentMode!==ee.Five.Mode.Panorama)return e(0,a=[]);const k=n.camera.position,C=n.camera.getWorldDirection(new M.Vector3),D=I.lines.map(T=>new M.Vector3(T.start[0],-T.start[1],-T.start[2])),x=I.lines.map(T=>new M.Vector3(T.end[0],-T.end[1],-T.end[2])),[z]=D.concat(x).sort((T,R)=>{const E=T.clone().setY(0).sub(k).normalize().angleTo(C.clone().setY(0)),S=R.clone().setY(0).sub(k).normalize().angleTo(C.clone().setY(0));return E-S}),L=I.lines.map(T=>{var Y,J;const R=T.start,E=T.end,{startLeft:S,startTop:_,distance:B,deg:O,visible:G,labelOffset:Q,ruleLength:H}=f(new M.Vector3(R[0],-R[1],-R[2]),new M.Vector3(E[0],-E[1],-E[2]),z),X=[];return T.children&&((Y=T.children)==null?void 0:Y.length)>0&&((J=T.children)==null||J.forEach(te=>{const oe=te.start,ce=te.end,{distance:N}=u(new M.Vector3(oe[0],-oe[1],-oe[2]),new M.Vector3(ce[0],-ce[1],-ce[2]));X.push({width:N,state:te.state})})),{width:B,left:S,top:_,rotateDeg:O,state:T.state,children:X,labelOffset:Q,visible:G,labelElement:r.distanceText(H)}});e(0,a=L)},p=()=>Yt(h),g=zn(h,80);return Z.onMount(()=>{h(),n.on("panoArrived",h),n.on("modeChange",h),n.on("cameraDirectionUpdate",p),n.on("movingToPano",p),n.on("mouseWheel",()=>g()),n.on("pinchGesture",()=>g())}),Z.onDestroy(()=>{n.off("panoArrived",h),n.off("modeChange",h),n.off("cameraDirectionUpdate",p),n.off("movingToPano",p),n.off("mouseWheel",()=>g()),n.off("pinchGesture",()=>g())}),o.$$set=y=>{"five"in y&&e(1,n=y.five),"rulerDatas"in y&&e(2,s=y.rulerDatas),"options"in y&&e(3,r=y.options)},[a,n,s,r]}class Wc extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Nc,Gc,i.safe_not_equal,{five:1,rulerDatas:2,options:3})}}class Xc{constructor(t,e){m(this,"five");m(this,"container",document.createElement("div"));m(this,"panoRulerProData");m(this,"rulerItems");m(this,"state",{enabled:!1,loaded:!1,options:{className:"",distanceText:t=>`${t.toFixed(1)}m`}});var n,s;this.five=t,this.container.classList.add("panoRulerProPlugin-container"),this.container.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;"),e&&(e.data&&this.load(e.data),this.state.options=j(j({},this.state.options),e.options||{}),(n=e.options)!=null&&n.className&&this.container.classList.add((s=e.options)==null?void 0:s.className)),this.five.once("modelLoaded",()=>F(this,null,function*(){var r,a;(a=(r=this.five.getElement())==null?void 0:r.parentNode)==null||a.append(this.container)})),this.five.once("dispose",()=>this.dispose())}load(t){return F(this,null,function*(){if(!this.five.work)return;const e=t.data;if(!e)throw new Error("\u6807\u5C3A\u6570\u636E\u4F9D\u8D56\u4E0D\u9F50\u5168\uFF01");this.panoRulerProData=e,this.state.loaded=!0})}enable(){return this.state.loaded?(this.state.enabled||(this.state.enabled=!0,this.render()),!0):!1}disable(){return this.state.enabled&&(this.state.enabled=!1,this.render()),!0}render(){return F(this,null,function*(){var t;if(this.state.enabled){if(!this.panoRulerProData||!this.container)return;this.rulerItems=new Wc({target:this.container,props:{five:this.five,rulerDatas:this.panoRulerProData,options:this.state.options}})}else(t=this.rulerItems)==null||t.$destroy(),this.rulerItems=void 0})}dispose(){this.container&&(this.rulerItems.$destroy(),this.rulerItems=void 0),this.container.remove()}}const Yc=(o,t)=>new Xc(o,t),Uc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZIAAABCCAYAAAB9y1BhAAAAAXNSR0IArs4c6QAADh5JREFUeAHtnVuPLDcVhedwC/dACKAICDxEIBQpygNI/Ab+MX8B8YCQEAjxgBAQLsm5Jjkn58r6Sl4jT52qnu4zXd121dqSx67q7ip7eXsv721XzcVFJAgEgSAQBIJAEAgCQeC4CLx48eKbSu+RH/fKuVoQWB8Cn1tfk9KiIHAUBH6tq/xKiTwSBILADgRCJDvAyUebRuAbpfXxSDatBmn8Pgh8YZ8v5TtBYIMIvFCbSZEgEASuQSBEcg1A+XizCDzfbMvT8CBwIAIhkgMBy9c3g0CIZDNdnYbeFIEQyU0RzO/XikCIZK09m3YdHYEQydEhzQVXgkCIZCUdmWYsj0CIZHmMc4c+EchCe5/9llqfAYEQyRlAzy27QCAeSRfdlEq2gECIpIVeSB1aRAAiudVixVKnINAaAiGS1nok9WkFAUJb8Upa6Y3Uo2kEQiRNd08qd0YEQiJnBD+37guBEElf/ZXang6BEMnpsM6dOkcgRNJ5B66x+nrjLmsTX1J6bSJHZ7+o9HklynWaOse1eKcc+XVlvxYFEnlfaThWfb7mcsn5nPRM6WmVU55KfO+J0mdKj8f5rVu3skNMoET6RSBE0m/fdVNzGWII4StKXy65y18t58aEAVGcUjDkGHsLhIOYfCC1xUT4QDJjgnmkc58qkT8saSiLeCCkSBBoBoEQSTNd0V9FZADRH8iAGfvXS06Zc5CFCePQt0y3EFaq61CX1ayjC56U8br24sKd+kAuJhkI55OSPi75pyIcvKNIEFgcgRDJ4hD3ewMZLDwDXqfOq9RNFCYOCAMPYx851BDjIXiWzky9Tpyvw0kOL/nc+Jh7DyGqko+P+cznVLwMf31Uypz7jZLJ0GEy8jqURnl8zPjyObDEsx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RHESDkp0zkSDQBALF9uKdYHunnkthwo7tfXQqQjmYSNQImBACIU2xIuGreB8CIdIvAtJzNogMosHI4mYkCDSHgPTUXspU2ItoEIvzEArlxWRvIlGFWTSnsnWF+b1dKAhk8QrrHpEgsDgC0ndi0oNoEBIuiASBZhGQvnqCz/KCJ/jYZtto7DPRoUU2N11LJIXxqNyUC0VFqeCTpRlP94gEgZMhIL0nbDCIdJswQSQINI9AIRRsNRP+KfvOkgNrKEddr5660YUqw3k8EAhkbvsuCztPVSF7JDqMBIF1IKAxcOl5S8eZLEWCQDcIFBtO2Kv2UOr645lAKkex4VeIpLo5jHbls1KD4eYaWIu4R+UeyYLA2RHQWGAADiJ9P9u2StcheRB4VQSkyzgD2PQppwBH4MaEMpBFRSDcqCYQx9ggDphr0QUb3SMSBJpAQGPiciei9P6oYYAmGphKbA4B6TRrJ+j1HKHYzh8cZbpVBowXZ8bgQhzPNJAOvvD4QjkOAj0hUAbdUOVMoHrqudT1OgSk2zgLkAl2n/LYvh9s900kutYV4UIvQiBXMMlBEAgCQWA1CBRCgUjmHAkI5vk+PACR1BcZmGmfH64GzTQkCASBILBhBAqhgEC9rDFGJI7FGJEcB4EgEASCQBAIAkEgCASBIBAEgkAQCAJBIAgEgSAQBIJAEAgCm0fg/x4jQQWGalpFAAAAAElFTkSuQmCC";function Vc(){const o=document.createElement("div"),t=document.createElement("i"),e=document.createElement("span");return o.appendChild(t),o.appendChild(e),o.style.position="relative",o.style.width="100%",o.style.display="flex",o.style.flexDirection="column",o.style.alignItems="center",o.style.marginTop=`${150/16}rem`,o.style.opacity="0",o.style.transition="opacity 1000ms linear",t.style.display="block",t.style.width=`${134/16}rem`,t.style.height=`${22/16}rem`,t.style.backgroundSize="100%",t.style.backgroundRepeat="no-repeat",t.style.backgroundImage=`url(${Uc})`,e.style.marginTop=`${10/16}rem`,e.style.fontSize=`${16/16}rem`,e.style.color="#fff",e.style.opacity="0.7",e.style.textShadow="0 2px 16px rgb(22 34 83 / 24%)",e.style.fontWeight="bold",{appendTo(n){n.appendChild(o)},dispose(){o.remove()},setRoom(n){e.innerHTML=n.name+" "+Math.floor(n.size/1e6)+"\u33A1"},show(){o.style.opacity="1"},hide(){o.style.opacity="0"}}}const Jc=new P.TextureLoader;function Mi(o){return F(this,null,function*(){return new Promise((t,e)=>{Jc.load(o,t,void 0,e)}).then(t=>(t.encoding=P.sRGBEncoding,t))})}const yt={userAction:!0};class Zc extends Ze{constructor(e,n){super(e);m(this,"state",{visible:!0,enabled:!0,config:{compassImageUrl:"//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png",entryDoorImageUrl:"//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png"}});m(this,"data");m(this,"group",new P.Group);m(this,"roomInfoInstance");m(this,"roomInfoWrapperInstance");m(this,"compassMeshTween");m(this,"compassMesh");m(this,"entryDoorMesh");m(this,"dispose",()=>{var e,n,s,r;this.five.scene.remove(this.group),this.group.remove(...this.group.children),(n=(e=this.compassMesh)==null?void 0:e.material.map)==null||n.dispose(),(r=(s=this.entryDoorMesh)==null?void 0:s.material.map)==null||r.dispose(),this.five.off("dispose",this.dispose),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});m(this,"_addEventListener",()=>{this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive),this.five.on("modeChange",this.onFiveModeChange),this.five.on("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});m(this,"_removeEventListener",()=>{this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("modeChange",this.onFiveModeChange),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});m(this,"_enable",()=>{this.five.scene.add(this.group),this.init(),this.onFivePanoArrived(this.five.panoIndex||0),this._addEventListener()});m(this,"_disable",()=>{this._clearCompassIfNeed(),this._clearEntryDoorIfNeed(),this.five.scene.remove(this.group),this._removeEventListener()});m(this,"_toggleVisible",()=>{this.group.visible=this.state.visible,this.five.needsRender=!0});m(this,"_clearCompassIfNeed",()=>{var e;this.compassMesh&&(this.group.remove(this.compassMesh),(e=this.compassMesh.material.map)==null||e.dispose(),this.compassMesh=null)});m(this,"_clearEntryDoorIfNeed",()=>{var e;this.entryDoorMesh&&(this.group.remove(this.entryDoorMesh),(e=this.entryDoorMesh.material.map)==null||e.dispose(),this.entryDoorMesh=null),this.roomInfoInstance&&(this.roomInfoInstance.dispose(),this.roomInfoInstance=null),this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.dispose(),this.roomInfoWrapperInstance=null)});m(this,"onFivePanoWillArrive",e=>{var n,s;e!==this.five.panoIndex&&((n=this.compassMeshTween)==null||n.dispose(),(s=this.compassMesh)==null||s.material.setValues({opacity:0}))});m(this,"onFivePanoArrived",e=>{var s,r,a,l,c,d,u;const n=(a=(r=(s=this.five.work)==null?void 0:s.observers)==null?void 0:r[e])==null?void 0:a.standingPosition;if(this.compassMesh&&(this.compassMesh.position.copy(n.clone().setY(n.y+.01)),this.compassMesh.material.opacity===0&&((l=this.compassMeshTween)==null||l.dispose(),this.compassMeshTween=Is(1e3).onUpdate(({progress:f})=>{var h;(h=this.compassMesh)==null||h.material.setValues({opacity:f}),this.five.needsRender=!0}).play())),this.entryDoorMesh){const h=new P.Vector3(this.data.entrance.position.x,this.data.entrance.position.y,this.data.entrance.position.z).clone().setY(n.y).sub(n).normalize(),p=n.clone().add(h.clone().multiplyScalar(.7)).setY(n.y+.01);this.entryDoorMesh.rotation.z=new P.Vector3(0,0,-1).angleTo(h),this.entryDoorMesh.position.copy(p),((c=this.data)==null?void 0:c.room_observers[e].room.type)===1?(d=this.entryDoorMesh)==null||d.material.setValues({opacity:1}):(u=this.entryDoorMesh)==null||u.material.setValues({opacity:0})}this.roomInfoInstance&&this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.css3DObject.position.copy(n.clone().setY(n.y+.01)),this.roomInfoInstance.setRoom(this.data.room_observers[e].room)),this.five.needsRender=!0});m(this,"onFiveCameraDirectionUpdate",({longitude:e,latitude:n})=>{var s,r;!this.roomInfoWrapperInstance||(this.roomInfoWrapperInstance.css3DObject.rotation.z=e,n>.66&&this.five.getCurrentState().mode==="Panorama"?(s=this.roomInfoInstance)==null||s.show():(r=this.roomInfoInstance)==null||r.hide())});m(this,"onFiveModeChange",(e,n,s,r,a)=>{e!==n&&this.setState({visible:e===ee.Five.Mode.Panorama},{userAction:a})});this.five.scene.add(this.group),this.five.once("dispose",this.dispose),this.setState({visible:!0,enabled:!0,config:j(j({},this.state.config),n||{})})}enable(e=yt){this.setState({enabled:!0},e)}disable(e=yt){this.setState({enabled:!1},e)}show(e=yt){if(!!this.state.enabled)return this.setState({visible:!0},e),Promise.resolve()}hide(e=yt){if(!!this.state.enabled)return this.setState({visible:!1},e),Promise.resolve()}setState(e,n={userAction:!0}){var r,a;const s=JSON.parse(JSON.stringify(this.state));this.state={visible:(r=e.visible)!=null?r:s.visible,enabled:(a=e.enabled)!=null?a:s.enabled,config:j(j({},s.config),e.config||{})},this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:n.userAction}),e.enabled===!0&&(this._enable(),this.hooks.emit("enable",n)),e.enabled===!1&&(this._disable(),this.hooks.emit("disable",n)),e.visible===!1&&(this._toggleVisible(),this.hooks.emit("hide",n)),e.visible===!0&&(this._toggleVisible(),this.hooks.emit("show",n)),e.config&&this.init()}load(e,n,s=!0){return F(this,null,function*(){const r=yield this.formatData(e);JSON.stringify(this.data)!==JSON.stringify(r)&&(this.hooks.emit("dataChange",r,this.data),this.data=j({},r),this.init(),n&&this.setState(n,{userAction:s}),this.hooks.emit("dataLoaded",this.data))})}formatData(e){return e.version&&e.data?Promise.resolve(e.data):Promise.resolve(e)}init(){return F(this,null,function*(){var s,r,a,l;const e=(r=(s=this.data)==null?void 0:s.north_rad)!=null?r:null;this._clearCompassIfNeed(),e!==null&&(this.compassMesh=yield this.loadCompassMesh(),this.compassMesh.rotateX(-Math.PI/2),this.compassMesh.rotateZ(e-Math.PI/2),this.group.add(this.compassMesh));const n=(l=(a=this.data)==null?void 0:a.entrance)!=null?l:null;this._clearEntryDoorIfNeed(),n!==null&&(this.entryDoorMesh=yield this.loadEntryDoorMesh(),this.roomInfoWrapperInstance=this.loadRoomInfo(),this.roomInfoInstance=Vc(),this.entryDoorMesh.rotateX(-Math.PI/2),this.roomInfoWrapperInstance&&this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container),this.group.add(this.entryDoorMesh)),this.onFivePanoArrived(this.five.panoIndex||0),this.five.needsRender=!0})}loadCompassMesh(){return F(this,null,function*(){const e=this.state.config.compassImageUrl,n=yield Mi(e),s=new P.CircleGeometry(.7,32),r=new P.MeshBasicMaterial({map:n,transparent:!0,opacity:0,depthTest:!1}),a=new P.Mesh(s,r);return a.name="pano-compass-mesh",a})}loadEntryDoorMesh(){return F(this,null,function*(){const e=this.state.config.entryDoorImageUrl,n=yield Mi(e),s=new P.PlaneGeometry(.2,.16),r=new P.MeshBasicMaterial({map:n,transparent:!0,opacity:.8,depthTest:!1}),a=new P.Mesh(s,r);return a.name="pano-compass-entry-door",a})}loadRoomInfo(){const e=[new P.Vector3(-.7,0,-.7),new P.Vector3(.7,0,-.7),new P.Vector3(.7,0,.7),new P.Vector3(-.7,0,.7)];return nt(this.five).create3DDomContainer(e)}}const qc=(o,t)=>new Zc(o,t);function wt(o,t,e){const n=o[t];o[t]=o[e],o[e]=n}function Kc(o,t,e){const n=e/2;for(let s=1;s<=n;s++){const r=e-(s-1);for(let a=1;a<=t;a++){const l=(s-1)*t+a-1,c=(r-1)*t+a-1;wt(o,l*4+0,c*4+0),wt(o,l*4+1,c*4+1),wt(o,l*4+2,c*4+2),wt(o,l*4+3,c*4+3)}}}class Ls{constructor(t,e){m(this,"width");m(this,"height");m(this,"visible",!1);m(this,"hooks",new ee.Subscribe);m(this,"contentDom",document.createElement("canvas"));m(this,"five");m(this,"scale");m(this,"wrapper");m(this,"config");m(this,"offset",{x:0,y:0});m(this,"canvas",this.contentDom);m(this,"context");m(this,"renderCenter",new P.Vector3);m(this,"lastPanEvent");m(this,"hammer");m(this,"onPan",t=>{var d,u,f,h;if(!this.wrapper)return;const e=(u=(d=this.lastPanEvent)==null?void 0:d.deltaX)!=null?u:0,n=(h=(f=this.lastPanEvent)==null?void 0:f.deltaY)!=null?h:0,s=t.deltaX-e,r=t.deltaY-n;if(this.lastPanEvent=t,this.hooks.emit("wantsPanGesture",{srcEvent:t,deltaX:s,deltaY:r}))return;const l=this.offset.x+s,c=this.offset.y+r;this.contentDom.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)",this.canvas.style.transform=`translate3d(${l}px, ${c}px, 100px)`,this.offset={x:l,y:c}});m(this,"onPanEnd",t=>{this.lastPanEvent=void 0,this.contentDom.style.boxShadow="none"});var s,r,a;if(!t.renderer)throw new Error("Five Render \u672A\u521D\u59CB\u5316");this.five=t,this.scale=(s=e==null?void 0:e.scale)!=null?s:2,this.width=(r=e==null?void 0:e.width)!=null?r:190,this.height=(a=e==null?void 0:e.height)!=null?a:190,this.config={dragEnabled:(e==null?void 0:e.dragEnabled)||!1,autoFixPCPosition:(e==null?void 0:e.autoFixPCPosition)||!1,initialPosition:(e==null?void 0:e.initialPosition)||{left:"0",top:"0"}};const n=this.canvas.getContext("2d");if(!n)throw new Error("CANNOT CREATE CONTEXT2D");this.context=n,this.config.dragEnabled&&(this.hammer=new ut.default(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panend",this.onPanEnd))}dispose(){var t;this.clear(),this.remove(),(t=this.hammer)==null||t.destroy()}remove(){this.canvas.remove(),this.visible=!1}clear(){this.context.clearRect(0,0,this.canvas.width,this.canvas.height)}appendTo(t){this.wrapper=t,this.initStyle(),t.append(this.canvas),this.visible=!0}renderWithPoint(t){!this.wrapper||(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}autoFixPCPosition(){if(!this.wrapper)return;const{width:t,height:e}=this,n=this.renderCenter.clone().project(this.five.camera),s=(n.x+1)/2*this.wrapper.clientWidth,r=-(n.x-1)/2*this.wrapper.clientWidth,a=-(n.y-1)/2*this.wrapper.clientHeight;s<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=90+"px"):a<183?(this.canvas.style.top=90+"px",this.canvas.style.left=-t/2+"px"):r<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=-t-90+"px"):(this.canvas.style.left=-t/2+"px",this.canvas.style.top=-e-90+"px"),this.canvas.style.transform=`translate3d(${s}px, ${a}px, 10px)`,this.offset={x:s,y:a}}render(){if(!this.five.renderer||!this.wrapper)return;const{scale:t,context:e,width:n,height:s}=this,r=this.renderCenter.clone().project(this.five.camera),a=this.five.renderer.getSize(new P.Vector2),l=1,c=n/t,d=s/t,u=l*t,f=(r.x+1)/2*a.x,h=(r.y+1)/2*a.y,p=this.five.getPixels(f-c/2,h-c/2,c,d,u),g=Math.floor(n*l),A=Math.floor(s*l);Kc(p,g,A);const b=new ImageData(g,A);b.data.set(p),e.putImageData(b,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}}class $c{constructor(t){m(this,"edges",[]);m(this,"five");m(this,"onModelLoaded",()=>{!this.five.model||(this.edges=this.five.model.getEdges())});this.five=t,this.five.model.loaded?this.onModelLoaded():this.five.on("modelLoaded",this.onModelLoaded)}dispose(){}getAdsorbentPoint(t){if(this.edges.length===0)return null;let e=1/0,n;return this.edges.forEach(s=>{const r=s.closestPointToPoint(t.point,!0,new M.Vector3),a=r.distanceTo(t.point);a<e&&(n=r,e=a)}),e>.1?null:n||null}}class An{constructor(){m(this,"id",ue());m(this,"points",[]);m(this,"lines",[])}push(t){const e=this.getNext(t);if(!e)throw new Error("\u5F53\u524D\u7EBF\u6BB5\u4E8E\u4E0A\u4E00\u6761\u7EBF\u6BB5\u65E0\u6CD5\u6784\u6210\u6298\u7EBF");return this.lines.push(e.line),this.points.push(...e.points),this.lines.length}pop(){const t=this.lines.pop();return this.lines.length===0?this.points.slice(0,this.points.length):this.points.pop(),t}getNext(t){const e=this.points.slice(-1)[0];if(!e)return{line:t,points:t.points};if(!t.points.includes(e))return null;const n=t.points.find(s=>s!==e);return n?{line:t,points:[n]}:null}toJson(){return{id:this.id,lines:this.lines.map(t=>t.id),points:this.points.map(t=>t.id)}}toCompletelyJson(){return{id:this.id,points:this.points.map(t=>t.toJson()),lines:this.lines.map(t=>t.toCompletelyJson())}}}const ed=1,td=3,nd=new M.Color(16777215),id=new M.Color(6522623),od=new M.Color(16777215),sd=new M.Color(6522623),rd=6,ad=8,ld="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==",_s=new M.TextureLoader().load(ld),zs={pointTexture:_s,pointSize:rd,lineWidth:ed,lineColor:nd,pointColor:od,lineRenderOrder:20,pointsRenderOrder:20};V(j({},zs),{dashed:!0});const cd={pointTexture:_s,pointSize:ad,lineWidth:td,lineColor:id,pointColor:sd,lineRenderOrder:10,pointsRenderOrder:10};function dd(o,t,e){var u,f,h,p,g;const n=(u=e==null?void 0:e.lineWidth)!=null?u:2,s=(f=e==null?void 0:e.lineColor)!=null?f:new M.Color(16777215),r=(h=e==null?void 0:e.pointSize)!=null?h:5,a=(p=e==null?void 0:e.lineRenderOrder)!=null?p:10,l=(g=e==null?void 0:e.lineRenderOrder)!=null?g:20,c=new ls.Line(o,t);c.setMaterial({linewidth:n,color:s}),c.line.material.depthTest=!1,c.line.material.transparent=!0,c.line.renderOrder=a,c.points.renderOrder=l;const d=c.points.material;return d.depthTest=!1,d.size=r,e!=null&&e.pointColor&&d.color.set(e.pointColor).convertSRGBToLinear(),e!=null&&e.pointTexture&&(d.map=e.pointTexture),c}function Ti(o,t){const[e,n]=o.points,s=t==="light"?cd:zs,r=dd(e.position,n.position,s);return r.name="normalLine_"+o.id,r}function Ee(o){const{x:t,y:e,z:n}=o;return!(Math.abs(t)>1||Math.abs(e)>1||Math.abs(n)>1)}function ud(){const o=document.createElement("div");return o.setAttribute("style","backdrop-filter: blur(4px);-webkit-backdrop-filter: blur(4px);"),o.style.padding="3px 6px",o.style.lineHeight="1",o.style.textAlign="center",o.style.transform="translate(-50%, -50%)",o.style.borderRadius="100px",o.style.fontSize="14px",o.style.color="#fff",o.style.background="rgba(195,195,195,0.70)",o.style.border="0.5px solid rgba(255,255,255,0.6)",o.style.pointerEvents="all",o.style.cursor="pointer",o}function hd(o){const t=document.createElement("div");return t.id="distance_"+o.id,t.classList.add("five-plugin-measure__distance"),t.style.opacity="0",t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.transform="translate3d(0, 0, 0)",t.style.transformOrigin="left top",t}function fd(o){function t(){var g;(g=o.clickCallback)==null||g.call(o,p)}function e(){if(f)return f.highlight();d.style.border="0.5px solid #95AEFF",d.style.background="linear-gradient(90deg, #95AEFF 0%, #6386FF 100%)"}function n(){if(f)return f.unHighlight();d.style.border="0.5px solid rgba(255,255,255,0.6)",d.style.background="rgba(195,195,195,0.70)"}function s(g){const A=g.getElement();if(!A)return;const b=A.clientWidth,v=A.clientHeight;if(l.points.length<2)return;const[w,y]=l.points,I=w.position.clone().project(g.camera),k=y.position.clone().project(g.camera),C=I.clone().lerp(k,.5),D=new M.Vector2(I.x*b,I.y*v),x=new M.Vector2(k.x*b,k.y*v);if((()=>!(Math.abs(I.z)>1||Math.abs(k.z)>1||!Ee(I)&&!Ee(k)||!Ee(C)||D.distanceTo(x)<20))()===!1){u.style.opacity="0",u.style.pointerEvents="none";return}const L=(C.x+1)/2*b,T=-(C.y-1)/2*v,E=-(Math.atan((D.y-x.y)/(D.x-x.x))*180)/Math.PI;u.style.transform=`translate(${L}px, ${T}px) rotate(${E}deg)`,u.style.opacity="1",u.style.pointerEvents="all",f&&f.update({line:l.toCompletelyJson(),polyline:l.getPolyline().toCompletelyJson()});const S=w.position.clone().distanceTo(y.position),_=o.line.model.params.getDistanceText(S);d.innerText!==_&&(d.innerText=_)}function r(g){g.appendChild(u),u.addEventListener("click",t)}function a(){d.removeEventListener("click",t),u.remove()}const{line:l}=o,c=l.id,d=ud(),u=hd(l),f=o.userDistanceItem,h=new M.Vector3(0,0,0),p={lineID:c,ndcPosition:h,update:s,appendTo:r,remove:a,highlight:e,unHighlight:n};return f!=null&&f.element?u.appendChild(f.element):u.appendChild(d),p}class it{constructor(t,e,n){m(this,"id");m(this,"selected",!1);m(this,"type","line");m(this,"model");m(this,"mesh");m(this,"points");m(this,"lightMesh");m(this,"hook");m(this,"distanceItem");m(this,"polyline");if(this.id=ue(),this.model=n,t.id===e.id)throw new Error("\u65E0\u6548\u7684\u7EBF\u6BB5, \u4E00\u4E2A\u70B9\u65E0\u6CD5\u6784\u6210\u7EBF\u6BB5");this.hook=new ee.Subscribe,this.points=[t,e],this.mesh=Ti(this,"normal"),this.lightMesh=Ti(this,"light"),this.distanceItem=fd({line:this,clickCallback:()=>this.hook.emit("selected",this),userDistanceItem:this.model.params.userDistanceItemCreator?this.model.params.userDistanceItemCreator():void 0}),t.lines.push(this),e.lines.push(this)}clear(){this.selected=!1,this.polyline=void 0}getPolyline(){if(this.polyline)return this.polyline;const t=this.model.polylines.find(n=>n.lines.includes(this));if(this.polyline=t,t)return t;const e=new An;return e.push(this),e}findAnotherPoint(t){return this.points.find(({id:e})=>e!==t.id)}toJson(){return{id:this.id,points:this.points.map(({id:t})=>t)}}toCompletelyJson(){return{id:this.id,points:this.points.map(t=>t.toJson())}}clone(){return new it(this.points[0].clone(),this.points[1].clone(),this.model)}}function st(o,t){for(let e=0,n=t.length;e<n;e++)if(o===t[e])return t.splice(e,1)[0]}class Pe{constructor(t){m(this,"id");m(this,"lines");m(this,"position");m(this,"type","point");this.id=ue(),this.lines=[],this.position=new M.Vector3,t instanceof M.Vector3?this.position.copy(t):this.position.fromArray(t)}toJson(){return{id:this.id,lines:this.lines.map(({id:t})=>t),position:this.position.toArray()}}addLine(t){this.lines.push(t)}removeLine(t){st(t,this.lines)}clone(){return new Pe(this.position)}}class Tn{constructor(t){m(this,"lines",[]);m(this,"points",[]);m(this,"params");m(this,"polylines",[]);m(this,"hook",new ee.Subscribe);this.params=t}addLine(t){const[e,n]=t.points;if(!e||!n)return this;this.includes(e)||this.points.push(e),this.includes(n)||this.points.push(n),this.lines.push(t);const s=this.polylines.find(r=>!!r.getNext(t));if(s)s.push(t);else{const r=new An;r.push(t),this.polylines.push(r)}this.hook.emit("lineAdded",t)}removeLineByID(t){const e=this.getLineByID(t);e&&this.removeLine(e)}removeLine(t){const e=this.polylines.find(r=>r.lines.includes(t));if(e){if(e.lines.slice(-1)[0]!==t)throw new Error("\u4E0D\u80FD\u4ECE\u4E2D\u95F4\u5220\u9664\u7EBF\u6BB5");e.pop(),e.lines.length===0&&st(e,this.polylines)}const[n,s]=t.points;return n.lines.length===0&&st(n,this.points),s.lines.length===0&&st(s,this.points),st(t,this.lines),t.clear(),this.hook.emit("lineRemoved",t),this}mergeModel(t){t.lines.forEach(e=>this.addLine(e))}includes(t){if(t.type==="point")return this.points.find(({id:e})=>e===t.id)!==void 0;if(t.type==="line")return this.lines.find(({id:e})=>e===t.id)!==void 0}getPointByID(t){return this.points.find(({id:e})=>e===t)}getLineByID(t){return this.lines.find(({id:e})=>e===t)}getClosestPoint(){}parse(t){const e=t.points.map(({id:r,position:a})=>{const l=new Pe(a);return l.id=r,l}),n=t.lines.map(r=>{const[a,l]=r.points,c=this.getPointByID.call({points:e},a),d=this.getPointByID.call({points:e},l);if(!c||!d)throw new Error("\u7EBF\u4E0A\u7684\u70B9\u4E0D\u5B58\u5728");const u=new it(c,d,this);return u.id=r.id,u}),s=t.polylines.map(r=>{const a=new An;return r.lines.forEach(l=>{const c=n.find(({id:d})=>d===l);c&&a.push(c)}),a});return this.points.splice(0,this.points.length,...e),this.lines.splice(0,this.lines.length,...n),this.polylines.splice(0,this.polylines.length,...s),this}toJson(){return{points:this.points.map(t=>t.toJson()),lines:this.lines.map(t=>t.toJson()),polylines:this.polylines.map(t=>t.toJson()).filter(t=>t.lines.length>0)}}}const Ct=o=>o.preventDefault();class Vt{constructor(t){m(this,"model");m(this,"five");m(this,"group");m(this,"config");m(this,"dashed");m(this,"disposed",!1);m(this,"isMobile");m(this,"mouseGroup");m(this,"container");m(this,"fiveHelper");m(this,"hook");m(this,"magnifier");m(this,"userDistanceItemCreator");m(this,"updateDistanceUI",()=>{this.dashed.distanceItem.update(this.five),this.model.lines.forEach(t=>t.distanceItem.update(this.five))});var n,s;this.five=t.five,this.hook=t.hook,this.model=t.model,this.config=t.config,this.magnifier=t.magnifier,this.container=t.container,this.fiveHelper=t.fiveHelper,this.isMobile=(s=(n=t.openParams)==null?void 0:n.isMobile)!=null?s:!1,this.userDistanceItemCreator=t.userDistanceItemCreator,this.group=t.group,this.mouseGroup=t.mouseGroup,this.dashed=new it(new Pe([0,0,0]),new Pe([0,0,0]),this.model),this.dashed.mesh.setMaterial({dashed:!0,dashScale:100}),this.dashed.mesh.name="dashLine";const e=this.five.getElement();e&&(e.addEventListener("touchstart",Ct),e.addEventListener("contextmenu",Ct))}removeLine(t){this.group.remove(t.mesh,t.lightMesh),t.distanceItem.remove(),this.five.needsRender=!0}updateMouseGroup(t,e){if(!t)return this.mouseGroup;const n=this.fiveHelper.getAdsorbentPoint(t),s=n||t.point;if(this.mouseGroup.position.copy(s),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const a=t.face.normal.clone().multiplyScalar(.05),c=t.point.clone().add(a).clone().add(a);this.mouseGroup.lookAt(c)}return this.mouseGroup}dispose(){this.disposed=!0,this.magnifier.remove(),this.model.lines.forEach(e=>this.removeLine(e));const t=this.five.getElement();t&&(t.removeEventListener("touchstart",Ct),t.removeEventListener("contextmenu",Ct))}}function vn(o){const{x:t,y:e}=o.center,{clientWidth:n,clientHeight:s}=o.target,r=o.target.getBoundingClientRect(),a=new M.Vector2(t,e).sub(new M.Vector2(r.left,r.top)),l=new M.Vector2(a.x/n*2-1,-(a.y/s)*2+1);return{point:a,ndcPoint:l}}function on(o,t){const e=vn(t).ndcPoint,n=new M.Raycaster;return n.setFromCamera(e,o.camera),o.model.intersectRaycaster(n)}class Et extends Vt{constructor(e){var s;super(e);m(this,"type","edit");m(this,"pressPoint");m(this,"hasAppendDashed",!1);m(this,"hasAppendMouseGroup",!1);m(this,"fiveElement");m(this,"lastPoint",null);m(this,"hammer");m(this,"onIntersectionUpdate",zn((e,n)=>{var r;this.hasAppendMouseGroup===!1&&(this.group.add(this.mouseGroup),this.magnifier.appendTo(this.container),this.hasAppendMouseGroup=!0);const s=this.updateMouseGroup(e,n).position;(r=this.pressPoint)==null||r.position.copy(s),this.updateDashed(),requestAnimationFrame(()=>this.magnifier.renderWithPoint(this.mouseGroup.position)),this.five.needsRender=!0},20));m(this,"revoke",()=>{if(this.model.lines.length===0&&this.lastPoint){this.lastPoint=null,this.hasAppendDashed=!1,this.dashed.distanceItem.remove(),this.group.remove(this.dashed.mesh),this.hook.emit("anchorChange",null),this.five.needsRender=!0;return}if(this.model.lines.length===0&&!this.lastPoint||!this.lastPoint)return;const e=this.model.lines[this.model.lines.length-1],n=e.findAnotherPoint(this.lastPoint);!n||(this.lastPoint=n,this.hook.emit("anchorChange",n.position),this.group.remove(e.mesh),this.model.removeLine(e),this.hasAppendMouseGroup=!1,this.mouseGroup.position.copy(this.lastPoint.position),this.group.remove(this.mouseGroup),e.distanceItem.remove(),this.updateDashed(),this.magnifier.remove(),this.five.needsRender=!0)});m(this,"onMouseLeave",()=>{this.magnifier.remove(),this.group.remove(this.mouseGroup),this.hasAppendMouseGroup=!1,this.lastPoint&&(this.mouseGroup.position.copy(this.lastPoint.position),this.updateDashed())});m(this,"onLineChanged",()=>{this.hook.emit("editedLineChange",this.model.lines.map(e=>e.toCompletelyJson()))});m(this,"onPress",e=>{const[n]=on(this.five,e);if(!n||!n.face)return;const s=new Pe(n.point);this.pressPoint=s,this.onIntersectionUpdate(n)});m(this,"onPan",e=>{if(!this.pressPoint)return;const[n]=on(this.five,e);!n||!n.face||this.onIntersectionUpdate(n)});m(this,"onPanEnd",e=>{!this.pressPoint||this.onTap(e)});m(this,"onTap",e=>{this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh)),this.hasAppendDashed=!0;const[n]=on(this.five,e);this.updateMouseGroup(n);const s=new Pe(this.mouseGroup.position),r=this.lastPoint;if(s&&(this.lastPoint=s),s&&r){const a=new it(r,s,this.model);a.distanceItem.appendTo(this.container),this.model.addLine(a),this.group.add(a.mesh),a.distanceItem.update(this.five)}this.pressPoint=void 0,this.hasAppendMouseGroup=!1,this.magnifier.remove(),this.group.remove(this.mouseGroup),this.updateDashed(),this.five.needsRender=!0,this.hook.emit("anchorChange",s.position)});m(this,"onWantsTapGesture",()=>!1);m(this,"onWantsToMoveToPano",()=>!1);m(this,"onWantsPanGesture",()=>this.pressPoint?!1:void 0);m(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});m(this,"updateDashed",()=>{!this.lastPoint||(this.dashed.points[0].position.copy(this.lastPoint.position),this.dashed.points[1].position.copy(this.mouseGroup.position),this.dashed.mesh.setPoints(this.lastPoint.position,this.mouseGroup.position),this.dashed.distanceItem.update(this.five))});this.model=new Tn(this.config),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsPanGesture",this.onWantsPanGesture),this.five.on("wantsTapGesture",this.onWantsTapGesture),this.five.on("wantsToMoveToPano",this.onWantsToMoveToPano),this.five.on("intersectionOnModelUpdate",this.onIntersectionUpdate),this.model.hook.on("lineAdded",this.onLineChanged),this.model.hook.on("lineRemoved",this.onLineChanged);const n=this.five.getElement();if(n){this.fiveElement=n;const r=new ut.default(n);this.hammer=r,r.on("tap",this.onTap),r.on("pan",this.onPan),r.on("press",this.onPress),r.on("panend",this.onPanEnd)}(s=this.fiveElement)==null||s.addEventListener("mouseleave",this.onMouseLeave),this.hook.emit("anchorChange",null),this.five.refresh()}dispose(){var e,n;super.dispose(),this.group.remove(this.mouseGroup,this.dashed.mesh),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsPanGesture",this.onWantsPanGesture),this.five.off("wantsTapGesture",this.onWantsTapGesture),this.five.off("wantsToMoveToPano",this.onWantsToMoveToPano),this.five.off("intersectionOnModelUpdate",this.onIntersectionUpdate),this.model.hook.off("lineAdded",this.onLineChanged),this.model.hook.off("lineRemoved",this.onLineChanged),(e=this.hammer)==null||e.destroy(),(n=this.fiveElement)==null||n.removeEventListener("mouseleave",this.onMouseLeave),this.magnifier.dispose(),this.dashed.distanceItem.remove(),this.five.needsRender=!0}getEditingLines(){return this.model.lines}}function jn(o,t){const e=o.x-t[0].x,n=o.y-t[0].y,s=t[1].x-t[0].x,r=t[1].y-t[0].y,a=e*s+n*r,l=s*s+r*r,c=a/l;let d,u;return c<0||md(t[0],t[1])?(d=t[0].x,u=t[0].y):c>1?(d=t[1].x,u=t[1].y):(d=t[0].x+c*s,u=t[0].y+c*r),new M.Vector2(d,u)}function md(o,t){return o.x===t.x&&o.y===t.y}function Rt(o){const t=(r,a,l)=>{const c=r.lines.find(u=>u.points.findIndex(({id:h})=>h===r.id)!==a);if(!c)return l;const d=c.points[a];return d?t(d,a,l.concat(c)):l},e=t(o.points[0],1,[]),n=t(o.points[0],0,[]);return e.concat(n)}class pd extends Vt{constructor(e){super(e);m(this,"type","view");m(this,"highlightedLines",[]);m(this,"hammer");m(this,"wantsTapGesture",e=>{if(this.model.lines.length===0)return;const[n]=this.five.model.intersectRaycaster(e);if(!n)return;const s=this.five.camera,r=n.point.clone().project(s),a=this.container.clientWidth,l=this.container.clientHeight,c=new M.Vector2(r.x*a,r.y*l),d=this.model.lines.map(p=>{const[g,A]=p.points,b=g.position.clone().project(s),v=A.position.clone().project(s);if(!Ee(b)&&!Ee(v))return null;const w=new M.Vector2(b.x*a,b.y*l),y=new M.Vector2(v.x*a,v.y*l);return{id:p.id,points:[w,y]}}).filter(p=>!!p);if(d.length===0)return;const f=d.map(p=>{const g=jn(c,p.points);return{id:p.id,distance:g.distanceTo(c)}}).sort((p,g)=>p.distance-g.distance)[0],h=f.distance>20?void 0:this.model.lines.find(({id:p})=>p===f.id);if(this.highlightedLines.length>0&&!h)return this.clearHighlightLines(),!1;if(h)return this.chooseLine(h),!1});m(this,"chooseLine",e=>{const n=Rt(e);this.highlightLines(n),this.five.needsRender=!0,this.hook.emit("selectedChange",n.map(s=>s.toCompletelyJson()))});m(this,"lineRemoved",e=>{this.removeLine(e),this.hook.emit("selectedChange",this.model.lines.filter(n=>n.selected).map(n=>n.toCompletelyJson()))});m(this,"onCameraUpdate",()=>{this.updateDistanceUI()});this.model.lines.forEach(s=>{s.distanceItem.appendTo(this.container),s.distanceItem.update(this.five),s.hook.on("selected",this.chooseLine),this.group.add(s.mesh)});const n=this.five.getElement();if(n){const s=new ut.default(n);this.hammer=s}this.model.hook.on("lineRemoved",this.lineRemoved),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsTapGesture",this.wantsTapGesture),this.five.needsRender=!0}dispose(){var e;super.dispose(),this.model.hook.off("lineRemoved",this.lineRemoved),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsTapGesture",this.wantsTapGesture),this.five.needsRender=!0,this.hook.emit("selectedChange",[]),(e=this.hammer)==null||e.destroy()}highlightLine(e){e.selected||(e.selected=!0,this.group.add(e.lightMesh),e.distanceItem.highlight(),this.five.needsRender=!0)}clearHighlightLines(){this.group.children.length!==0&&(this.model.lines.forEach(e=>{e.selected=!1,e.distanceItem.unHighlight(),this.group.remove(e.lightMesh)}),this.highlightedLines=[],this.five.needsRender=!0)}highlightLines(e){this.clearHighlightLines(),this.highlightedLines=e,e.forEach(n=>this.highlightLine(n))}}const gd=`
|
|
204
204
|
<svg class="fpm__delete-icon" width="16px" height="17px" viewBox="0 0 16 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
205
205
|
<defs>
|
|
206
206
|
<linearGradient x1="22.185491%" y1="100%" x2="66.8316686%" y2="6.67239121%" id="linearGradient-1">
|
|
@@ -489,7 +489,7 @@ void main() {
|
|
|
489
489
|
<div class='range-piece__content'></div>
|
|
490
490
|
<div class="range-piece__aim"></div>
|
|
491
491
|
</div>
|
|
492
|
-
`;function Gd(){}const{Vector2:Nd}=P;function Wd(o,t){const{offsetWidth:e,offsetHeight:n}=t,{top:s,left:r}=t.getBoundingClientRect();return Object.assign(new Nd,{x:(o.x-r)/e*2-1,y:-(o.y-s)/n*2+1})}class Xd{constructor(t){m(this,"container",document.createElement("div"));m(this,"five");m(this,"group");m(this,"mouseGroup");m(this,"hasAppendMouseGroup",!1);m(this,"fiveHelper");m(this,"hook");m(this,"content");m(this,"intersectMesh");m(this,"centerMouseXY");m(this,"raycaster",new M.Raycaster);m(this,"pieceStyl",{matrix3d:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],scale:1,opacity:.4});m(this,"onCameraDirectionUpdate",()=>{const t=this.getIntersection();if(t){this.pieceChange(t),this.updateMouseGroup(t);const e=new Pe(this.mouseGroup.position);this.hook.emit("nowPointChange",e)}});m(this,"onWillChangeState",(t,e)=>{var s;this.dotAnimation();const n=(s=this.getIntersection())==null?void 0:s.point;!n||(e==="editing"?this.hook.emit("getStartPoint",new Pe(n)):this.hook.emit("getEndPoint",new Pe(n)))});m(this,"computedCenterMouseXY",()=>{const t=this.container.querySelector(".range-piece__aim");if(!t)return null;const{left:e,top:n,width:s,height:r}=t.getBoundingClientRect(),a=Math.round(e+s/2),l=Math.round(n+r/2),d=Wd({x:a,y:l},this.five.getElement());this.centerMouseXY=d});m(this,"getIntersection",()=>{if(!this.centerMouseXY)return null;this.raycaster.setFromCamera(this.centerMouseXY,this.five.camera);const t=this.five.model.intersectRaycaster(this.raycaster)[0];return t||null});this.five=t.five,this.hook=t.hook,this.group=t.group,this.mouseGroup=Ts(j({isMobile:!0},t.openParams.crossHairParameter)),this.fiveHelper=t.fiveHelper,this.container.innerHTML=Fd,this.container.classList.add("range-piece-controller"),this.content=this.container.querySelector(".range-piece__content"),this.content&&(this.content.style.transform=`matrix3d(${this.pieceStyl.matrix3d.toString()}) scale(${this.pieceStyl.scale})`,this.content.style.opacity=`${this.pieceStyl.opacity}`),t.container.append(this.container),this.intersectMesh=new M.Mesh(new M.RingGeometry(.04,.08,32),new M.MeshBasicMaterial({color:1245179,opacity:0,side:M.DoubleSide,transparent:!0})),this.container.addEventListener("animationend",this.computedCenterMouseXY),this.five.on("cameraUpdate",this.onCameraDirectionUpdate),this.hook.on("willChangeState",this.onWillChangeState)}dispose(){this.container.removeEventListener("animationend",this.computedCenterMouseXY),this.five.off("cameraUpdate",this.onCameraDirectionUpdate),this.hook.off("willChangeState",this.onWillChangeState),this.container.remove(),this.group.remove(this.mouseGroup),this.mouseGroup.remove(),this.hasAppendMouseGroup=!1,this.five.scene.remove(this.intersectMesh)}pieceChange(t){const e=t.face,n=t.point;if(e&&n){const r=e.normal.clone().clone().multiplyScalar(.05),a=n.clone().add(r);this.intersectMesh.position.copy(a);const l=a.clone().add(r);this.intersectMesh.lookAt(l),this.five.scene.add(this.intersectMesh);const c=this.intersectMesh.modelViewMatrix.clone().toArray();this.changePieceStyl("matrix3d",c);const d=this.calculateSize(n);this.changePieceStyl("scale",d)}}calculateSize(t){if(!t)return;const e=this.five.camera.position;let n=t.distanceTo(e);const s=4,r=1;return n>s&&(n=s),n<r&&(n=r),-.51/(s-r)*n+1}dotAnimation(){const t=lt.default.Easing.Quadratic.InOut,e={opacity:.4,scale:this.pieceStyl.scale},n={opacity:[1,.4],scale:[this.pieceStyl.scale*.8,this.pieceStyl.scale]};let s=Gd;const r=new lt.default.Tween(e).to(n,500).easing(t).start(0).onUpdate(({opacity:a,scale:l})=>{this.changePieceStyl("scale",l),this.changePieceStyl("opacity",a)}).onComplete(()=>{s()});s=Ut(a=>{r.update(a)})}changePieceStyl(t,e){!this.content||(this.pieceStyl[t]=e,this.content.style.transform=`matrix3d(${this.pieceStyl.matrix3d.toString()}) scale(${this.pieceStyl.scale})`,this.content.style.opacity=`${this.pieceStyl.opacity}`)}updateMouseGroup(t,e){if(!this.hasAppendMouseGroup){this.group.add(this.mouseGroup),this.hasAppendMouseGroup=!0;const n=this.container.querySelector(".range-piece__aim");n&&(n.style.opacity="0")}if(!t)return this.mouseGroup;if(this.mouseGroup.position.copy(t.point),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const s=t.face.normal.clone().multiplyScalar(.05),a=t.point.clone().add(s).clone().add(s);this.mouseGroup.lookAt(a)}return this.mouseGroup}}class Yd{constructor(t,e){m(this,"hasOpen",!1);m(this,"hook",new ee.Subscribe);m(this,"magnifier");m(this,"five");m(this,"model");m(this,"group");m(this,"config");m(this,"fiveHelper");m(this,"useUIController");m(this,"params");m(this,"useGuideController");m(this,"rangePieceController");m(this,"container",document.createElement("div"));m(this,"shortcutKeyController");m(this,"controller",null);m(this,"controllerParams");m(this,"getCurrentMode",()=>this.controller instanceof Et?"Edit":this.controller instanceof sn?"Watch":this.controller instanceof Bi?"Mixed":null);m(this,"changeMode",t=>{var n;if(!this.hasOpen||this.getCurrentMode()===t)return;if(this.getCurrentMode()==="Mixed"||t==="Mixed")return new Error("\u4E0D\u652F\u6301\u5207\u6362\u7684Mode");(n=this.controller)==null||n.dispose();const e={View:pd,Watch:sn,Edit:Et};if(!e[t])throw new Error("\u4E0D\u5B58\u5728\u7684 Mode");this.controller=new e[t](this.controllerParams),this.hook.emit("modeChange",t)});var r,a;this.five=t,this.params=e;const n={userDistanceItemCreator:void 0,getDistanceText(l){return l.toFixed(2)+"m"}};this.config=j(j({},n),Wt(e,["openParams","magnifierParams"])),this.model=new Tn(this.config),this.fiveHelper=new $c(t),this.magnifier=new Ls(t,(r=e.magnifierParams)!=null?r:{width:190,height:190,scale:2}),this.group=new M.Group,this.group.name="plugin-measure-group",this.container.classList.add("five-plugin-measure-container"),this.container.style.position="absolute",this.container.style.left="0",this.container.style.top="0",this.container.style.pointerEvents="none",this.container.style.width="100%",this.container.style.height="100%",this.container.style.opacity="0",this.container.style.background="rgba(0, 0, 0, 0.15)";const s=(a=this.params.openParams)!=null?a:{};this.controllerParams={five:this.five,hook:this.hook,group:this.group,model:this.model,config:this.config,magnifier:this.magnifier,container:this.container,fiveHelper:this.fiveHelper,openParams:s,mouseGroup:Ts(j({},s.crossHairParameter)),userDistanceItemCreator:this.params.userDistanceItemCreator},this.params.useUIController!==!1&&(this.useUIController=new Qi(this,this.controllerParams)),this.params.useGuideController!==!1&&(this.useGuideController=new Rd(this,this.controllerParams))}appendTo(t){t.append(this.container)}dispose(){var t,e;this.disable(),(t=this.useUIController)==null||t.dispose(),(e=this.magnifier)==null||e.dispose(),this.five.needsRender=!0}load(t){this.model.parse(t),this.save()}enable(){var t,e,n;this.hasOpen||(this.hasOpen=!0,this.five.scene.add(this.group),this.container.style.opacity="1",(t=this.params.openParams)!=null&&t.isMobile?(this.controller=new Bi(this.controllerParams),this.rangePieceController=new Xd(this.controllerParams)):(this.five.helperVisible=!1,this.controller=new sn(this.controllerParams)),(e=this.useUIController)==null||e.show(),(n=this.useGuideController)==null||n.show(),this.shortcutKeyController=new Od(this,this.five),this.hook.emit("enable",!0))}disable(){var t,e,n,s,r;this.hasOpen=!1,this.container.style.opacity="0",(t=this.controller)==null||t.dispose(),(e=this.rangePieceController)==null||e.dispose(),(n=this.useUIController)==null||n.hide(),(s=this.useGuideController)==null||s.hide(),(r=this.shortcutKeyController)==null||r.dispose(),this.controller=null,this.five.helperVisible=!0,this.five.scene.remove(this.group),this.five.needsRender=!0,this.hook.emit("disable",!0)}revoke(){this.controller instanceof Et&&this.controller.revoke()}removeLineByID(t){this.model.removeLineByID(t)}highlightLine(t){if(this.getCurrentMode()!=="Watch")return!1;const e=this.model.getLineByID(t);return e?(this.controller.highlightLine(e),!0):!1}clearHighlightLines(){return this.getCurrentMode()!=="Watch"?!1:(this.controller.clearHighlightLines(),!0)}save(){return this.controller instanceof Et?(this.model.mergeModel(this.controller.model),this):this}toJson(){return this.model.toJson()}changeIsMobile(t){var e,n;((e=this.controllerParams.openParams)==null?void 0:e.isMobile)===void 0&&(this.controllerParams.openParams.isMobile=t),this.controllerParams.openParams.isMobile!==t&&(this.controllerParams.openParams.isMobile=t,this.params.useUIController!==!1&&((n=this.useUIController)==null||n.dispose()),this.useUIController=new Qi(this,this.controllerParams))}changeConfigs(t){var e;if(t.getDistanceText&&t.getDistanceText!==this.config.getDistanceText){const n=t.getDistanceText;this.config.getDistanceText=n,(e=this.controller)==null||e.updateDistanceUI()}}}const Ud=function(t,e){return new Yd(t,e)},Hs=kn.writable(null);function Vd(o){i.append_styles(o,"svelte-19zi46m",".PanoSpatialTagPlugin__tag-origin.svelte-19zi46m{position:absolute;width:0.5rem;height:0.5rem;border-radius:50%;background:#fff;box-shadow:0 0 .6rem #fff;transform:translate(-50%, -50%) scale(1);transform-origin:center center;animation:svelte-19zi46m-PanoSpatialTagPlugin__tag-origin 1.2s forwards;pointer-events:auto}.PanoSpatialTagPlugin__tag-origin.svelte-19zi46m:after{content:'';position:absolute;top:50%;height:50%;width:2rem;height:2rem;transform:translate(-50%, -50%)}.PanoSpatialTagPlugin__tag-origin-destroy.svelte-19zi46m{transform:translate(-50%, -50%) scale(0.6);animation:svelte-19zi46m-PanoSpatialTagPlugin__tag-origin-destroy 1.2s forwards .7s}@keyframes svelte-19zi46m-PanoSpatialTagPlugin__tag-origin{0%{transform:translate(-50%, -50%) scale(1);opacity:0}100%{transform:translate(-50%, -50%) scale(0.6);opacity:1 }}@keyframes svelte-19zi46m-PanoSpatialTagPlugin__tag-origin-destroy{0%{transform:translate(-50%, -50%) scale(0.6);opacity:1}10%{transform:translate(-50%, -50%) scale(1);opacity:0.9}100%{transform:translate(-50%, -50%) scale(1);opacity:0}}")}function Ri(o,t,e){const n=o.slice();return n[3]=t[e],n}function Oi(o){let t,e=`${o[3].top}%`,n=`${o[3].left}%`,s,r;function a(){return o[2](o[3])}return{c(){t=i.element("i"),i.attr(t,"class","svelte-19zi46m"),i.toggle_class(t,"PanoSpatialTagPlugin__tag-origin",!0),i.toggle_class(t,"PanoSpatialTagPlugin__tag-origin-destroy",o[3].destroying),i.set_style(t,"top",e,!1),i.set_style(t,"left",n,!1),i.set_style(t,"visibility",o[3].front?"visible":"hidden",!1)},m(l,c){i.insert(l,t,c),s||(r=i.listen(t,"click",a),s=!0)},p(l,c){o=l,c&1&&i.toggle_class(t,"PanoSpatialTagPlugin__tag-origin-destroy",o[3].destroying),c&1&&e!==(e=`${o[3].top}%`)&&i.set_style(t,"top",e,!1),c&1&&n!==(n=`${o[3].left}%`)&&i.set_style(t,"left",n,!1),c&1&&i.set_style(t,"visibility",o[3].front?"visible":"hidden",!1)},d(l){l&&i.detach(t),s=!1,r()}}}function Jd(o){let t,e=o[0],n=[];for(let s=0;s<e.length;s+=1)n[s]=Oi(Ri(o,e,s));return{c(){for(let s=0;s<n.length;s+=1)n[s].c();t=i.empty()},m(s,r){for(let a=0;a<n.length;a+=1)n[a].m(s,r);i.insert(s,t,r)},p(s,[r]){if(r&3){e=s[0];let a;for(a=0;a<e.length;a+=1){const l=Ri(s,e,a);n[a]?n[a].p(l,r):(n[a]=Oi(l),n[a].c(),n[a].m(t.parentNode,t))}for(;a<n.length;a+=1)n[a].d(1);n.length=e.length}},i:i.noop,o:i.noop,d(s){i.destroy_each(n,s),s&&i.detach(t)}}}function Zd(o,t,e){let{origins:n}=t;const s=a=>{Hs.update(()=>`${a}-PanoSpatialTagPlugin-${Date.now()}`)},r=a=>s(a.id);return o.$$set=a=>{"origins"in a&&e(0,n=a.origins)},[n,s,r]}class qd extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Zd,Jd,i.safe_not_equal,{origins:0},Vd)}}function Kd(o){i.append_styles(o,"svelte-1i5h9zh",".PanoSpatialTagPlugin__tag-x.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0;display:block;white-space:nowrap;box-sizing:border-box;width:25rem;height:14rem;color:#FFF;transform:translate(0, -100%);transition:height .5s linear}.PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh.svelte-1i5h9zh{content:'';position:absolute;width:30rem;height:30rem;top:-15rem;left:-15rem;z-index:-1;opacity:0;transition:opacity .8s .6s;background:url('https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png');background-size:30rem 30rem}.PanoSpatialTagPlugin__tag-line.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;left:-1rem;width:2rem;height:100%;overflow:hidden}.PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:1rem;height:calc(100% - 1.5rem);width:.15rem;background:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, .1));box-shadow:0 .1rem .5rem rgba(0, 0, 0, .2);opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .4s cubic-bezier(.44,.44,.74,.98) , opacity .4s cubic-bezier(.44,.44,.74,.98), width .5s linear, height .5s linear ;transform-origin:center bottom}.PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0.3rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0.5rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh{animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1 linear .5s forwards .45s}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh{animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2 linear .5s forwards .65s}.PanoSpatialTagPlugin__tag-x.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh.svelte-1i5h9zh{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line.svelte-1i5h9zh{transform:scaleY(-1)}.PanoSpatialTagPlugin__tag-animate.svelte-1i5h9zh.svelte-1i5h9zh{position:relative;height:100%;overflow:hidden;transform-origin:left top;transition:transform .5s linear}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-animate.svelte-1i5h9zh{transform-origin:left bottom}.PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;display:inline-block;transform:translate(-100%, 0);transition:transform .9s cubic-bezier(0,.65,.16,1.08) .6s;padding-left:.5rem;font-size:1rem}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{bottom:0}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh{opacity:1;transform:translate(-50%, 0) scaleY(1)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{top:unset;bottom:-15rem}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{opacity:.32}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh{opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .5s .55s, opacity .4s .55s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{opacity:0;transition:opacity .8s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{transform:translate(-100%, 0);transition:transform .6s cubic-bezier(.53,.06,.88,.59)}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content .svelte-1i5h9zh{pointer-events:none}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh{opacity:0.5;transform:translate(-50%, 10%) scaleY(0);animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1-hide linear .28s forwards .3s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh{opacity:0.5;transform:translate(-50%, 0) scaleY(0);animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2-hide linear .28s forwards .45s}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 135%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 20%) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 125%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1-hide{0%{opacity:0.5;transform:translate(-50%, 10%) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 105%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2-hide{0%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 100%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}")}function $d(o){let t,e,n,s,r,a,l,c,d,u,f,h,p,g,A;return{c(){t=i.element("div"),e=i.element("div"),n=i.space(),s=i.element("div"),r=i.element("i"),a=i.space(),l=i.element("i"),c=i.space(),d=i.element("i"),u=i.space(),f=i.element("div"),h=i.element("div"),i.attr(e,"class","PanoSpatialTagPlugin__tag-shadow svelte-1i5h9zh"),i.set_style(e,"transform","translate("+o[7]/2*o[3]*3+"px, "+o[8]/2*(o[1]?-1:1)*o[3]*3+"px) scale("+1/o[3]+")"),i.attr(r,"class","PanoSpatialTagPlugin__tag-flagpole svelte-1i5h9zh"),i.set_style(r,"width",o[4]+"rem"),i.attr(l,"class","PanoSpatialTagPlugin__tag-line1 svelte-1i5h9zh"),i.attr(d,"class","PanoSpatialTagPlugin__tag-line2 svelte-1i5h9zh"),i.attr(s,"class","PanoSpatialTagPlugin__tag-line svelte-1i5h9zh"),i.attr(h,"class","PanoSpatialTagPlugin__tag-content svelte-1i5h9zh"),i.attr(f,"class","PanoSpatialTagPlugin__tag-animate svelte-1i5h9zh"),i.set_style(f,"transform","scale("+o[3]*3+")"),i.attr(t,"id",p="PanoSpatialTagPlugin__"+o[0]),i.set_style(t,"height",20*o[5]+"rem"),i.attr(t,"class","svelte-1i5h9zh"),i.toggle_class(t,"PanoSpatialTagPlugin__tag-x",!0),i.toggle_class(t,"PanoSpatialTagPlugin__tag-upside-down",o[1]),i.toggle_class(t,"PanoSpatialTagPlugin__tag-show",o[10]),i.toggle_class(t,"PanoSpatialTagPlugin__tag-hide",o[10]===!1||o[6])},m(b,v){i.insert(b,t,v),i.append(t,e),i.append(t,n),i.append(t,s),i.append(s,r),i.append(s,a),i.append(s,l),i.append(s,c),i.append(s,d),i.append(t,u),i.append(t,f),i.append(f,h),h.innerHTML=o[2],o[16](h),g||(A=i.listen(h,"click",o[11]),g=!0)},p(b,[v]){v&394&&i.set_style(e,"transform","translate("+b[7]/2*b[3]*3+"px, "+b[8]/2*(b[1]?-1:1)*b[3]*3+"px) scale("+1/b[3]+")"),v&16&&i.set_style(r,"width",b[4]+"rem"),v&4&&(h.innerHTML=b[2]),v&8&&i.set_style(f,"transform","scale("+b[3]*3+")"),v&1&&p!==(p="PanoSpatialTagPlugin__"+b[0])&&i.attr(t,"id",p),v&32&&i.set_style(t,"height",20*b[5]+"rem"),v&2&&i.toggle_class(t,"PanoSpatialTagPlugin__tag-upside-down",b[1]),v&1024&&i.toggle_class(t,"PanoSpatialTagPlugin__tag-show",b[10]),v&1088&&i.toggle_class(t,"PanoSpatialTagPlugin__tag-hide",b[10]===!1||b[6])},i:i.noop,o:i.noop,d(b){b&&i.detach(t),o[16](null),g=!1,A()}}}function eu(o,t,e){let{id:n}=t,{upsideDown:s}=t,{content:r}=t,{contentZoom:a}=t,{lineWidthZoom:l}=t,{lineHeightZoom:c}=t,{destroying:d=!1}=t,{folded:u}=t,{dispose:f}=t,{events:h}=t,{hooks:p}=t,g=0,A=0,b,v,w=setTimeout(()=>{u||e(10,v=!0),w=void 0},100);const y=C=>{const D=Object.keys(h);let x=C.target;for(;x;){const z=x.getAttribute("class");if(!z){x=x.parentNode;continue}if(z.includes("PanoSpatialTagPlugin__tag-content")){x=null;break}D.forEach(_=>{z.includes(_)&&h[_](n)}),x=x.parentNode}};Z.onMount(()=>{p.emit("initTag",{id:n})});const I=Hs.subscribe(C=>{if(C===null)return;const[D,x]=C.split("-PanoSpatialTagPlugin-");n===D&&(p.emit("clickOrigin",{id:n,show:v}),w||(e(10,v=u),e(12,u=!u),w=setTimeout(()=>{w=void 0},1500)))});Z.afterUpdate(()=>{e(7,g=b.offsetWidth),e(8,A=b.offsetHeight),!w&&e(10,v=!u)}),Z.onDestroy(()=>{p.emit("destroyTag",{id:n}),I(),f()});function k(C){i.binding_callbacks[C?"unshift":"push"](()=>{b=C,e(9,b)})}return o.$$set=C=>{"id"in C&&e(0,n=C.id),"upsideDown"in C&&e(1,s=C.upsideDown),"content"in C&&e(2,r=C.content),"contentZoom"in C&&e(3,a=C.contentZoom),"lineWidthZoom"in C&&e(4,l=C.lineWidthZoom),"lineHeightZoom"in C&&e(5,c=C.lineHeightZoom),"destroying"in C&&e(6,d=C.destroying),"folded"in C&&e(12,u=C.folded),"dispose"in C&&e(13,f=C.dispose),"events"in C&&e(14,h=C.events),"hooks"in C&&e(15,p=C.hooks)},[n,s,r,a,l,c,d,g,A,b,v,y,u,f,h,p,k]}class tu extends i.SvelteComponent{constructor(t){super(),i.init(this,t,eu,$d,i.safe_not_equal,{id:0,upsideDown:1,content:2,contentZoom:3,lineWidthZoom:4,lineHeightZoom:5,destroying:6,folded:12,dispose:13,events:14,hooks:15},Kd)}}const nu={position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",pointerEvents:"none"},Hi="<",Fi=">",Gi="%",Ni="locals",iu="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",ou={"&":"&","<":"<",">":">",'"':""","'":"'"},le={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};function Wi(o){return o.replace(/;(\s*$)/,"$1")}function su(o,t){return new ru(o).compileFunction()(t)}class ru{constructor(t){m(this,"templateText");m(this,"mode",null);m(this,"truncate",!1);m(this,"currentLine",1);m(this,"source","");m(this,"regex",new RegExp(iu));this.templateText=t}compileFunction(){let t;const e=` var __output = "";
|
|
492
|
+
`;function Gd(){}const{Vector2:Nd}=P;function Wd(o,t){const{offsetWidth:e,offsetHeight:n}=t,{top:s,left:r}=t.getBoundingClientRect();return Object.assign(new Nd,{x:(o.x-r)/e*2-1,y:-(o.y-s)/n*2+1})}class Xd{constructor(t){m(this,"container",document.createElement("div"));m(this,"five");m(this,"group");m(this,"mouseGroup");m(this,"hasAppendMouseGroup",!1);m(this,"fiveHelper");m(this,"hook");m(this,"content");m(this,"intersectMesh");m(this,"centerMouseXY");m(this,"raycaster",new M.Raycaster);m(this,"pieceStyl",{matrix3d:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],scale:1,opacity:.4});m(this,"onCameraDirectionUpdate",()=>{const t=this.getIntersection();if(t){this.pieceChange(t),this.updateMouseGroup(t);const e=new Pe(this.mouseGroup.position);this.hook.emit("nowPointChange",e)}});m(this,"onWillChangeState",(t,e)=>{var s;this.dotAnimation();const n=(s=this.getIntersection())==null?void 0:s.point;!n||(e==="editing"?this.hook.emit("getStartPoint",new Pe(n)):this.hook.emit("getEndPoint",new Pe(n)))});m(this,"computedCenterMouseXY",()=>{const t=this.container.querySelector(".range-piece__aim");if(!t)return null;const{left:e,top:n,width:s,height:r}=t.getBoundingClientRect(),a=Math.round(e+s/2),l=Math.round(n+r/2),d=Wd({x:a,y:l},this.five.getElement());this.centerMouseXY=d});m(this,"getIntersection",()=>{if(!this.centerMouseXY)return null;this.raycaster.setFromCamera(this.centerMouseXY,this.five.camera);const t=this.five.model.intersectRaycaster(this.raycaster)[0];return t||null});this.five=t.five,this.hook=t.hook,this.group=t.group,this.mouseGroup=Ts(j({isMobile:!0},t.openParams.crossHairParameter)),this.fiveHelper=t.fiveHelper,this.container.innerHTML=Fd,this.container.classList.add("range-piece-controller"),this.content=this.container.querySelector(".range-piece__content"),this.content&&(this.content.style.transform=`matrix3d(${this.pieceStyl.matrix3d.toString()}) scale(${this.pieceStyl.scale})`,this.content.style.opacity=`${this.pieceStyl.opacity}`),t.container.append(this.container),this.intersectMesh=new M.Mesh(new M.RingGeometry(.04,.08,32),new M.MeshBasicMaterial({color:1245179,opacity:0,side:M.DoubleSide,transparent:!0})),this.container.addEventListener("animationend",this.computedCenterMouseXY),this.five.on("cameraUpdate",this.onCameraDirectionUpdate),this.hook.on("willChangeState",this.onWillChangeState)}dispose(){this.container.removeEventListener("animationend",this.computedCenterMouseXY),this.five.off("cameraUpdate",this.onCameraDirectionUpdate),this.hook.off("willChangeState",this.onWillChangeState),this.container.remove(),this.group.remove(this.mouseGroup),this.mouseGroup.remove(),this.hasAppendMouseGroup=!1,this.five.scene.remove(this.intersectMesh)}pieceChange(t){const e=t.face,n=t.point;if(e&&n){const r=e.normal.clone().clone().multiplyScalar(.05),a=n.clone().add(r);this.intersectMesh.position.copy(a);const l=a.clone().add(r);this.intersectMesh.lookAt(l),this.five.scene.add(this.intersectMesh);const c=this.intersectMesh.modelViewMatrix.clone().toArray();this.changePieceStyl("matrix3d",c);const d=this.calculateSize(n);this.changePieceStyl("scale",d)}}calculateSize(t){if(!t)return;const e=this.five.camera.position;let n=t.distanceTo(e);const s=4,r=1;return n>s&&(n=s),n<r&&(n=r),-.51/(s-r)*n+1}dotAnimation(){const t=lt.default.Easing.Quadratic.InOut,e={opacity:.4,scale:this.pieceStyl.scale},n={opacity:[1,.4],scale:[this.pieceStyl.scale*.8,this.pieceStyl.scale]};let s=Gd;const r=new lt.default.Tween(e).to(n,500).easing(t).start(0).onUpdate(({opacity:a,scale:l})=>{this.changePieceStyl("scale",l),this.changePieceStyl("opacity",a)}).onComplete(()=>{s()});s=Ut(a=>{r.update(a)})}changePieceStyl(t,e){!this.content||(this.pieceStyl[t]=e,this.content.style.transform=`matrix3d(${this.pieceStyl.matrix3d.toString()}) scale(${this.pieceStyl.scale})`,this.content.style.opacity=`${this.pieceStyl.opacity}`)}updateMouseGroup(t,e){if(!this.hasAppendMouseGroup){this.group.add(this.mouseGroup),this.hasAppendMouseGroup=!0;const n=this.container.querySelector(".range-piece__aim");n&&(n.style.opacity="0")}if(!t)return this.mouseGroup;if(this.mouseGroup.position.copy(t.point),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const s=t.face.normal.clone().multiplyScalar(.05),a=t.point.clone().add(s).clone().add(s);this.mouseGroup.lookAt(a)}return this.mouseGroup}}class Yd{constructor(t,e){m(this,"hasOpen",!1);m(this,"hook",new ee.Subscribe);m(this,"magnifier");m(this,"five");m(this,"model");m(this,"group");m(this,"config");m(this,"fiveHelper");m(this,"useUIController");m(this,"params");m(this,"useGuideController");m(this,"rangePieceController");m(this,"container",document.createElement("div"));m(this,"shortcutKeyController");m(this,"controller",null);m(this,"controllerParams");m(this,"getCurrentMode",()=>this.controller instanceof Et?"Edit":this.controller instanceof sn?"Watch":this.controller instanceof Bi?"Mixed":null);m(this,"changeMode",t=>{var n;if(!this.hasOpen||this.getCurrentMode()===t)return;if(this.getCurrentMode()==="Mixed"||t==="Mixed")return new Error("\u4E0D\u652F\u6301\u5207\u6362\u7684Mode");(n=this.controller)==null||n.dispose();const e={View:pd,Watch:sn,Edit:Et};if(!e[t])throw new Error("\u4E0D\u5B58\u5728\u7684 Mode");this.controller=new e[t](this.controllerParams),this.hook.emit("modeChange",t)});var r,a;this.five=t,this.params=e;const n={userDistanceItemCreator:void 0,getDistanceText(l){return l.toFixed(2)+"m"}};this.config=j(j({},n),Wt(e,["openParams","magnifierParams"])),this.model=new Tn(this.config),this.fiveHelper=new $c(t),this.magnifier=new Ls(t,(r=e.magnifierParams)!=null?r:{width:190,height:190,scale:2}),this.group=new M.Group,this.group.name="plugin-measure-group",this.container.classList.add("five-plugin-measure-container"),this.container.style.position="absolute",this.container.style.left="0",this.container.style.top="0",this.container.style.pointerEvents="none",this.container.style.width="100%",this.container.style.height="100%",this.container.style.opacity="0",this.container.style.background="rgba(0, 0, 0, 0.15)";const s=(a=this.params.openParams)!=null?a:{};this.controllerParams={five:this.five,hook:this.hook,group:this.group,model:this.model,config:this.config,magnifier:this.magnifier,container:this.container,fiveHelper:this.fiveHelper,openParams:s,mouseGroup:Ts(j({},s.crossHairParameter)),userDistanceItemCreator:this.params.userDistanceItemCreator},this.params.useUIController!==!1&&(this.useUIController=new Qi(this,this.controllerParams)),this.params.useGuideController!==!1&&(this.useGuideController=new Rd(this,this.controllerParams))}appendTo(t){t.append(this.container)}dispose(){var t,e;this.disable(),(t=this.useUIController)==null||t.dispose(),(e=this.magnifier)==null||e.dispose(),this.five.needsRender=!0}load(t){this.model.parse(t),this.save()}enable(){var t,e,n;this.hasOpen||(this.hasOpen=!0,this.five.scene.add(this.group),this.container.style.opacity="1",(t=this.params.openParams)!=null&&t.isMobile?(this.controller=new Bi(this.controllerParams),this.rangePieceController=new Xd(this.controllerParams)):(this.five.helperVisible=!1,this.controller=new sn(this.controllerParams)),(e=this.useUIController)==null||e.show(),(n=this.useGuideController)==null||n.show(),this.shortcutKeyController=new Od(this,this.five),this.hook.emit("enable",!0))}disable(){var t,e,n,s,r;this.hasOpen=!1,this.container.style.opacity="0",(t=this.controller)==null||t.dispose(),(e=this.rangePieceController)==null||e.dispose(),(n=this.useUIController)==null||n.hide(),(s=this.useGuideController)==null||s.hide(),(r=this.shortcutKeyController)==null||r.dispose(),this.controller=null,this.five.helperVisible=!0,this.five.scene.remove(this.group),this.five.needsRender=!0,this.hook.emit("disable",!0)}revoke(){this.controller instanceof Et&&this.controller.revoke()}removeLineByID(t){this.model.removeLineByID(t)}highlightLine(t){if(this.getCurrentMode()!=="Watch")return!1;const e=this.model.getLineByID(t);return e?(this.controller.highlightLine(e),!0):!1}clearHighlightLines(){return this.getCurrentMode()!=="Watch"?!1:(this.controller.clearHighlightLines(),!0)}save(){return this.controller instanceof Et?(this.model.mergeModel(this.controller.model),this):this}toJson(){return this.model.toJson()}changeIsMobile(t){var e,n;((e=this.controllerParams.openParams)==null?void 0:e.isMobile)===void 0&&(this.controllerParams.openParams.isMobile=t),this.controllerParams.openParams.isMobile!==t&&(this.controllerParams.openParams.isMobile=t,this.params.useUIController!==!1&&((n=this.useUIController)==null||n.dispose()),this.useUIController=new Qi(this,this.controllerParams))}changeConfigs(t){var e;if(t.getDistanceText&&t.getDistanceText!==this.config.getDistanceText){const n=t.getDistanceText;this.config.getDistanceText=n,(e=this.controller)==null||e.updateDistanceUI()}}}const Ud=function(t,e){return new Yd(t,e)},Hs=kn.writable(null);function Vd(o){i.append_styles(o,"svelte-19zi46m",".PanoSpatialTagPlugin__tag-origin.svelte-19zi46m{position:absolute;width:0.5rem;height:0.5rem;border-radius:50%;background:#fff;box-shadow:0 0 .6rem #fff;transform:translate(-50%, -50%) scale(1);transform-origin:center center;animation:svelte-19zi46m-PanoSpatialTagPlugin__tag-origin 1.2s forwards;pointer-events:auto}.PanoSpatialTagPlugin__tag-origin.svelte-19zi46m:after{content:'';position:absolute;top:50%;height:50%;width:2rem;height:2rem;transform:translate(-50%, -50%)}.PanoSpatialTagPlugin__tag-origin-destroy.svelte-19zi46m{transform:translate(-50%, -50%) scale(0.6);animation:svelte-19zi46m-PanoSpatialTagPlugin__tag-origin-destroy 1.2s forwards .7s}@keyframes svelte-19zi46m-PanoSpatialTagPlugin__tag-origin{0%{transform:translate(-50%, -50%) scale(1);opacity:0}100%{transform:translate(-50%, -50%) scale(0.6);opacity:1 }}@keyframes svelte-19zi46m-PanoSpatialTagPlugin__tag-origin-destroy{0%{transform:translate(-50%, -50%) scale(0.6);opacity:1}10%{transform:translate(-50%, -50%) scale(1);opacity:0.9}100%{transform:translate(-50%, -50%) scale(1);opacity:0}}")}function Ri(o,t,e){const n=o.slice();return n[3]=t[e],n}function Oi(o){let t,e=`${o[3].top}%`,n=`${o[3].left}%`,s,r;function a(){return o[2](o[3])}return{c(){t=i.element("i"),i.attr(t,"class","svelte-19zi46m"),i.toggle_class(t,"PanoSpatialTagPlugin__tag-origin",!0),i.toggle_class(t,"PanoSpatialTagPlugin__tag-origin-destroy",o[3].destroying),i.set_style(t,"top",e,!1),i.set_style(t,"left",n,!1),i.set_style(t,"visibility",o[3].front?"visible":"hidden",!1)},m(l,c){i.insert(l,t,c),s||(r=i.listen(t,"click",a),s=!0)},p(l,c){o=l,c&1&&i.toggle_class(t,"PanoSpatialTagPlugin__tag-origin-destroy",o[3].destroying),c&1&&e!==(e=`${o[3].top}%`)&&i.set_style(t,"top",e,!1),c&1&&n!==(n=`${o[3].left}%`)&&i.set_style(t,"left",n,!1),c&1&&i.set_style(t,"visibility",o[3].front?"visible":"hidden",!1)},d(l){l&&i.detach(t),s=!1,r()}}}function Jd(o){let t,e=o[0],n=[];for(let s=0;s<e.length;s+=1)n[s]=Oi(Ri(o,e,s));return{c(){for(let s=0;s<n.length;s+=1)n[s].c();t=i.empty()},m(s,r){for(let a=0;a<n.length;a+=1)n[a].m(s,r);i.insert(s,t,r)},p(s,[r]){if(r&3){e=s[0];let a;for(a=0;a<e.length;a+=1){const l=Ri(s,e,a);n[a]?n[a].p(l,r):(n[a]=Oi(l),n[a].c(),n[a].m(t.parentNode,t))}for(;a<n.length;a+=1)n[a].d(1);n.length=e.length}},i:i.noop,o:i.noop,d(s){i.destroy_each(n,s),s&&i.detach(t)}}}function Zd(o,t,e){let{origins:n}=t;const s=a=>{Hs.update(()=>`${a}-PanoSpatialTagPlugin-${Date.now()}`)},r=a=>s(a.id);return o.$$set=a=>{"origins"in a&&e(0,n=a.origins)},[n,s,r]}class qd extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Zd,Jd,i.safe_not_equal,{origins:0},Vd)}}function Kd(o){i.append_styles(o,"svelte-1i5h9zh",".PanoSpatialTagPlugin__tag-x.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0;display:block;white-space:nowrap;box-sizing:border-box;width:25rem;height:14rem;color:#FFF;transform:translate(0, -100%);transition:height .5s linear}.PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh.svelte-1i5h9zh{content:'';position:absolute;width:30rem;height:30rem;top:-15rem;left:-15rem;z-index:-1;opacity:0;transition:opacity .8s .6s;background:url('https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png');background-size:30rem 30rem}.PanoSpatialTagPlugin__tag-line.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;left:-1rem;width:2rem;height:100%;overflow:hidden}.PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:1rem;height:calc(100% - 1.5rem);width:.15rem;background:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, .1));box-shadow:0 .1rem .5rem rgba(0, 0, 0, .2);opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .4s cubic-bezier(.44,.44,.74,.98) , opacity .4s cubic-bezier(.44,.44,.74,.98), width .5s linear, height .5s linear ;transform-origin:center bottom}.PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0.3rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0.5rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh{animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1 linear .5s forwards .45s}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh{animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2 linear .5s forwards .65s}.PanoSpatialTagPlugin__tag-x.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh.svelte-1i5h9zh{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line.svelte-1i5h9zh{transform:scaleY(-1)}.PanoSpatialTagPlugin__tag-animate.svelte-1i5h9zh.svelte-1i5h9zh{position:relative;height:100%;overflow:hidden;transform-origin:left top;transition:transform .5s linear}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-animate.svelte-1i5h9zh{transform-origin:left bottom}.PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;display:inline-block;transform:translate(-100%, 0);transition:transform .9s cubic-bezier(0,.65,.16,1.08) .6s;padding-left:.5rem;font-size:1rem}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{bottom:0}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh{opacity:1;transform:translate(-50%, 0) scaleY(1)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{top:unset;bottom:-15rem}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{opacity:.32}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh{opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .5s .55s, opacity .4s .55s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{opacity:0;transition:opacity .8s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{transform:translate(-100%, 0);transition:transform .6s cubic-bezier(.53,.06,.88,.59)}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content .svelte-1i5h9zh{pointer-events:none}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh{opacity:0.5;transform:translate(-50%, 10%) scaleY(0);animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1-hide linear .28s forwards .3s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh{opacity:0.5;transform:translate(-50%, 0) scaleY(0);animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2-hide linear .28s forwards .45s}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 135%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 20%) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 125%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1-hide{0%{opacity:0.5;transform:translate(-50%, 10%) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 105%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2-hide{0%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 100%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}")}function $d(o){let t,e,n,s,r,a,l,c,d,u,f,h,p,g,A;return{c(){t=i.element("div"),e=i.element("div"),n=i.space(),s=i.element("div"),r=i.element("i"),a=i.space(),l=i.element("i"),c=i.space(),d=i.element("i"),u=i.space(),f=i.element("div"),h=i.element("div"),i.attr(e,"class","PanoSpatialTagPlugin__tag-shadow svelte-1i5h9zh"),i.set_style(e,"transform","translate("+o[7]/2*o[3]*3+"px, "+o[8]/2*(o[1]?-1:1)*o[3]*3+"px) scale("+1/o[3]+")"),i.attr(r,"class","PanoSpatialTagPlugin__tag-flagpole svelte-1i5h9zh"),i.set_style(r,"width",o[4]+"rem"),i.attr(l,"class","PanoSpatialTagPlugin__tag-line1 svelte-1i5h9zh"),i.attr(d,"class","PanoSpatialTagPlugin__tag-line2 svelte-1i5h9zh"),i.attr(s,"class","PanoSpatialTagPlugin__tag-line svelte-1i5h9zh"),i.attr(h,"class","PanoSpatialTagPlugin__tag-content svelte-1i5h9zh"),i.attr(f,"class","PanoSpatialTagPlugin__tag-animate svelte-1i5h9zh"),i.set_style(f,"transform","scale("+o[3]*3+")"),i.attr(t,"id",p="PanoSpatialTagPlugin__"+o[0]),i.set_style(t,"height",20*o[5]+"rem"),i.attr(t,"class","svelte-1i5h9zh"),i.toggle_class(t,"PanoSpatialTagPlugin__tag-x",!0),i.toggle_class(t,"PanoSpatialTagPlugin__tag-upside-down",o[1]),i.toggle_class(t,"PanoSpatialTagPlugin__tag-show",o[10]),i.toggle_class(t,"PanoSpatialTagPlugin__tag-hide",o[10]===!1||o[6])},m(b,v){i.insert(b,t,v),i.append(t,e),i.append(t,n),i.append(t,s),i.append(s,r),i.append(s,a),i.append(s,l),i.append(s,c),i.append(s,d),i.append(t,u),i.append(t,f),i.append(f,h),h.innerHTML=o[2],o[16](h),g||(A=i.listen(h,"click",o[11]),g=!0)},p(b,[v]){v&394&&i.set_style(e,"transform","translate("+b[7]/2*b[3]*3+"px, "+b[8]/2*(b[1]?-1:1)*b[3]*3+"px) scale("+1/b[3]+")"),v&16&&i.set_style(r,"width",b[4]+"rem"),v&4&&(h.innerHTML=b[2]),v&8&&i.set_style(f,"transform","scale("+b[3]*3+")"),v&1&&p!==(p="PanoSpatialTagPlugin__"+b[0])&&i.attr(t,"id",p),v&32&&i.set_style(t,"height",20*b[5]+"rem"),v&2&&i.toggle_class(t,"PanoSpatialTagPlugin__tag-upside-down",b[1]),v&1024&&i.toggle_class(t,"PanoSpatialTagPlugin__tag-show",b[10]),v&1088&&i.toggle_class(t,"PanoSpatialTagPlugin__tag-hide",b[10]===!1||b[6])},i:i.noop,o:i.noop,d(b){b&&i.detach(t),o[16](null),g=!1,A()}}}function eu(o,t,e){let{id:n}=t,{upsideDown:s}=t,{content:r}=t,{contentZoom:a}=t,{lineWidthZoom:l}=t,{lineHeightZoom:c}=t,{destroying:d=!1}=t,{folded:u}=t,{dispose:f}=t,{events:h}=t,{hooks:p}=t,g=0,A=0,b,v,w=setTimeout(()=>{u||e(10,v=!0),w=void 0},100);const y=C=>{const D=Object.keys(h);let x=C.target;for(;x;){const z=x.getAttribute("class");if(!z){x=x.parentNode;continue}if(z.includes("PanoSpatialTagPlugin__tag-content")){x=null;break}D.forEach(L=>{z.includes(L)&&h[L](n)}),x=x.parentNode}};Z.onMount(()=>{p.emit("initTag",{id:n})});const I=Hs.subscribe(C=>{if(C===null)return;const[D,x]=C.split("-PanoSpatialTagPlugin-");n===D&&(p.emit("clickOrigin",{id:n,show:v}),w||(e(10,v=u),e(12,u=!u),w=setTimeout(()=>{w=void 0},1500)))});Z.afterUpdate(()=>{e(7,g=b.offsetWidth),e(8,A=b.offsetHeight),!w&&e(10,v=!u)}),Z.onDestroy(()=>{p.emit("destroyTag",{id:n}),I(),f()});function k(C){i.binding_callbacks[C?"unshift":"push"](()=>{b=C,e(9,b)})}return o.$$set=C=>{"id"in C&&e(0,n=C.id),"upsideDown"in C&&e(1,s=C.upsideDown),"content"in C&&e(2,r=C.content),"contentZoom"in C&&e(3,a=C.contentZoom),"lineWidthZoom"in C&&e(4,l=C.lineWidthZoom),"lineHeightZoom"in C&&e(5,c=C.lineHeightZoom),"destroying"in C&&e(6,d=C.destroying),"folded"in C&&e(12,u=C.folded),"dispose"in C&&e(13,f=C.dispose),"events"in C&&e(14,h=C.events),"hooks"in C&&e(15,p=C.hooks)},[n,s,r,a,l,c,d,g,A,b,v,y,u,f,h,p,k]}class tu extends i.SvelteComponent{constructor(t){super(),i.init(this,t,eu,$d,i.safe_not_equal,{id:0,upsideDown:1,content:2,contentZoom:3,lineWidthZoom:4,lineHeightZoom:5,destroying:6,folded:12,dispose:13,events:14,hooks:15},Kd)}}const nu={position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",pointerEvents:"none"},Hi="<",Fi=">",Gi="%",Ni="locals",iu="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",ou={"&":"&","<":"<",">":">",'"':""","'":"'"},le={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};function Wi(o){return o.replace(/;(\s*$)/,"$1")}function su(o,t){return new ru(o).compileFunction()(t)}class ru{constructor(t){m(this,"templateText");m(this,"mode",null);m(this,"truncate",!1);m(this,"currentLine",1);m(this,"source","");m(this,"regex",new RegExp(iu));this.templateText=t}compileFunction(){let t;const e=` var __output = "";
|
|
493
493
|
function __append(s) { if (s !== undefined && s !== null) __output += s }
|
|
494
494
|
with (`+Ni+` || {}) {
|
|
495
495
|
`,n=` }
|
|
@@ -504,25 +504,25 @@ void main() {
|
|
|
504
504
|
`)}switch(this.mode){case le.EVAL:this.source+=" ; "+t+`
|
|
505
505
|
`;break;case le.ESCAPED:this.source+=" ; __append(escapeFn("+Wi(t)+`))
|
|
506
506
|
`;break;case le.RAW:this.source+=" ; __append("+Wi(t)+`)
|
|
507
|
-
`;break;case le.COMMENT:break;case le.LITERAL:this._addOutput(t);break}}else this._addOutput(t)}}}const rn=.001,Xi=.01,au="https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png",lu=(o,t)=>{var Q,
|
|
507
|
+
`;break;case le.COMMENT:break;case le.LITERAL:this._addOutput(t);break}}else this._addOutput(t)}}}const rn=.001,Xi=.01,au="https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png",lu=(o,t)=>{var Q,H,X,Y,J,te,oe,ce;let e=t==null?void 0:t.container,n=1.4;const s=(Q=t==null?void 0:t.wait)!=null?Q:200,r=(H=t==null?void 0:t.maxNumberOnScreen)!=null?H:3,a=(X=t==null?void 0:t.minRad)!=null?X:Math.PI/4,l=(Y=t==null?void 0:t.nearTolerance)!=null?Y:100,c=(J=t==null?void 0:t.upsideHeight)!=null?J:1.6,d=(te=t==null?void 0:t.minDistance)!=null?te:1.2,u=(oe=t==null?void 0:t.maxDistance)!=null?oe:3.5,f=nt(o),h=document.createElement("div");h.classList.add("PanoSpatialTagPlugin"),Object.assign(h.style,nu);const p=new ee.Subscribe;let g=new Image;g.src=au;const A={points:[],origins:[],tags:[],template:"",events:{},render:su,folded:!1,enabled:!0,forbidden:!0},b=new qd({target:h,props:{origins:A.origins}}),v=(N,$)=>{k(),$&&C()},w=()=>{A.forbidden&&(A.forbidden=!1,C())},y=(N,$)=>{if(A.tags.length===0)return;const ne=$.longitude-o.state.longitude,W=o.camera.clone();W.position.copy($.offset),W.rotateOnWorldAxis(new P.Vector3(0,1,0),ne),W.updateProjectionMatrix(),W.updateMatrixWorld(!0);const Ie=new P.Frustum,Re=new P.Matrix4;Re.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),Ie.setFromProjectionMatrix(Re),A.tags.forEach(K=>{const Le=W.position.clone().setY(n).distanceTo(K.position);if(Le<d||Le>u||!Ie.containsPoint(K.position))return K.destroying=!0;const _e=K.position.clone().sub(W.position).setY(0);if(_e.angleTo(K.normal)>Math.PI/2-a&&_e.angleTo(K.normal)<Math.PI/2+a)return K.destroying=!0}),A.tags.forEach(K=>{K.destroying?K.app.$set({contentZoom:.1+W.position.distanceTo(K.position)/u,lineWidthZoom:.38*(.01+W.position.distanceTo(K.position)/u),destroying:K.destroying}):K.app.$set({lineWidthZoom:.38*(.01+W.position.distanceTo(K.position)/u),lineHeightZoom:.4+(W.position.distanceTo(K.position)-d)/u*.6,contentZoom:.1+W.position.distanceTo(K.position)/u})}),setTimeout(()=>{A.tags.forEach(K=>{K.destroying&&(K.app.$destroy(),K=null)}),A.tags=A.tags.filter(K=>!K.destroying),k()},1900)},I=N=>{N!==ee.Five.Mode.Panorama&&!A.forbidden&&(b.$set({origins:[]}),A.tags.forEach($=>{$.app.$destroy(),$=null}),A.origins=[],A.tags=[],A.forbidden=!0)},k=()=>{if(A.forbidden||!A.enabled)return;const N=o.camera,$=N.getWorldDirection(new P.Vector3);A.origins=A.tags.map(ne=>{const W=ne.position.clone().project(N),Ie=ne.position.clone().sub(N.position).setY(0).angleTo($.setY(0))<Math.PI/2;return{id:ne.id,front:Ie,left:(W.x+1)/2*100,top:(-W.y+1)/2*100,destroying:ne.destroying}}),b.$set({origins:A.origins})},C=()=>{A.forbidden||!A.enabled||(A.timeoutId&&clearTimeout(A.timeoutId),A.timeoutId=setTimeout(()=>{A.timeoutId=void 0;const N=D();N.length&&(A.tags=A.tags.concat(N),k())},s))},D=()=>{const{clientWidth:N,clientHeight:$}=o.getElement(),ne=[],W=o.camera,Ie=new P.Frustum,Re=new P.Matrix4,K=W.getWorldDirection(new P.Vector3);Re.multiplyMatrices(W.projectionMatrix,W.matrixWorldInverse),Ie.setFromProjectionMatrix(Re);const Le=A.tags.filter(se=>Ie.containsPoint(se.position)&&!se.destroying).length,_e=A.points.reduce((se,de)=>{if(A.tags.find(ae=>de.id===ae.id&&!ae.destroying))return se;const be=W.position.clone().setY(n).distanceTo(de.position);if(be<d||be>u||!Ie.containsPoint(de.position))return se;const ot=de.position.clone().sub(W.position).setY(0);if(ot.angleTo(de.normal)>Math.PI/2-a&&ot.angleTo(de.normal)<Math.PI/2+a)return se;const qe=de.position.clone().project(W);if(!A.tags.every(ae=>{if(ae.position.clone().sub(W.position).setY(0).angleTo(K.setY(0))>Math.PI/2)return!0;const He=ae.position.clone().project(W);return Math.sqrt(Math.pow((qe.x-He.x)/2*N,2)+Math.pow((qe.y-He.y)/2*$,2))>l}))return se;const Oe={id:de.id,position:de.position,normal:de.normal,replacement:de.replacement,weight:de.weight,distance:be};let ie;for(let ae=0,He=se.length;ae<He;ae++){const ft=se[ae];if(Oe.weight>ft.weight){ie=ae;break}if(Oe.distance<ft.distance){ie=ae;break}}return ie!==void 0?se.splice(ie,0,Oe):se.push(Oe),se},[]);for(let se=0,de=_e.length;se<de&&!(Le+ne.length>=r);se++){const be=_e[se];if(ne.find(ie=>be.id===ie.id))continue;const ot=be.position.clone().project(W);if(!A.tags.concat(ne).every(ie=>{if(ie.position.clone().sub(W.position).setY(0).angleTo(K.setY(0))>Math.PI/2)return!0;const ae=ie.position.clone().project(W);return Math.sqrt(Math.pow((ot.x-ae.x)/2*N,2)+Math.pow((ot.y-ae.y)/2*$,2))>l}))continue;const qe=new P.Raycaster(W.position.clone().setY(n),be.position.clone().sub(W.position.clone().setY(n)).normalize(),0,be.distance+Xi),[Oe]=A.intersectObjects?qe.intersectObjects(A.intersectObjects,!0):o.model.bvhs.loaded?o.model.intersectRaycaster(qe):qe.intersectObjects(o.model.children,!0);if(!!Oe&&be.distance-Oe.distance<Xi){const{position:ie,normal:ae,id:He,replacement:ft}=be,cr=new P.Plane().setFromNormalAndCoplanarPoint(ae,ie),Gn=ie.clone().sub(W.position).cross(new P.Vector3(0,1,0)).setLength(rn),dr=[ie.clone(),ie.clone().add(Gn),ie.clone().add(new P.Vector3(0,rn,0)).add(Gn),ie.clone().add(new P.Vector3(0,rn,0))].map(mr=>cr.projectPoint(mr,new P.Vector3)),{container:ur,dispose:hr}=f.create3DDomContainer(dr)||{},fr=new tu({target:ur,props:{id:He,content:A.render(A.template,ft),lineWidthZoom:.38*(.01+W.position.distanceTo(ie)/u),lineHeightZoom:.4+(W.position.distanceTo(ie)-d)/u*.6,contentZoom:.1+W.position.distanceTo(ie)/u,upsideDown:ie.y>c,folded:A.folded,events:A.events,hooks:p,dispose:hr}});ne.push({position:ie,normal:ae,id:He,app:fr})}}return ne},x=N=>{A.points=N.points.map($=>{var ne,W;return{id:$.id,position:new P.Vector3().fromArray($.position),normal:new P.Vector3().fromArray($.normal),replacement:(ne=$.replacement)!=null?ne:{},weight:(W=$.weight)!=null?W:-1}}),N.render&&(A.render=N.render),N.template&&(A.template=N.template),N.events&&(A.events=N.events),N.enabled===!1&&(A.enabled=N.enabled),N.folded===!0&&(A.folded=N.folded)},z=N=>{A.intersectObjects=N,C()},L=()=>{A.enabled=!0,C()},T=()=>{A.enabled=!1,b.$set({origins:[]}),A.tags.forEach(N=>{N.app.$destroy(),N=null}),A.origins=[],A.tags=[]},R=()=>{A.folded=!1,A.tags.forEach(N=>{N.app.$set({folded:A.folded})})},E=()=>{A.folded=!0,A.tags.forEach(N=>{N.app.$set({folded:A.folded})})},S=N=>{A.tags.forEach($=>{$.id===N&&$.app.$set({folded:!1})})},_=N=>{A.tags.forEach($=>{$.id===N&&$.app.$set({folded:!0})})},B=()=>{o.once("renderFrame",k)},O=()=>{e||(e=o.getElement().parentElement),e&&e.appendChild(h),A.forbidden=!1,n=o.model.bounding.getCenter(new P.Vector3).y,C(),o.on("panoWillArrive",y),o.on("panoArrived",w),o.on("modeChange",I),o.on("cameraUpdate",v)},G=()=>{g=null,f.disposeAll(),b.$destroy(),A.tags.forEach(N=>{N.app.$destroy(),N=null}),A.origins=[],A.tags=[],o.off("modelLoaded",O),o.off("renderFrame",k),o.off("panoWillArrive",y),o.off("panoArrived",w),o.off("modeChange",I),o.off("cameraUpdate",v),o.off("dispose",G),window.removeEventListener("resize",B,!1)};return window.addEventListener("resize",B,!1),(ce=o==null?void 0:o.model)!=null&&ce.loaded?O():o.once("modelLoaded",O),o.on("dispose",G),{load:x,setIntersectObjects:z,unfoldAll:R,foldAll:E,unfold:S,fold:_,enable:L,disable:T,hooks:p,dispose:G}};var We=(o=>(o.SMALL="small",o.MIDLLE="middle",o.LARGE="large",o.EXTRA_LARGE="x-large",o))(We||{});function cu(o){i.append_styles(o,"svelte-1ir3cyd",`.item-label-item.svelte-1ir3cyd{position:absolute;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:0}.item-label-item.visible.svelte-1ir3cyd{opacity:1;animation:svelte-1ir3cyd-fadeIn .3s ease-in}.item-label-item__text-wrap.svelte-1ir3cyd::before{content:'';position:absolute;width:100%;height:100%;background-color:rgba(0, 0, 0, .3);filter:blur(1rem);z-index:-1}.item-label-item__text-wrap.svelte-1ir3cyd{padding:0.375rem 0.375rem 0;position:absolute;height:1.25rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap;line-height:0.625rem;font-size:0.6875rem;font-weight:bold;color:#FFEAC0;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center}.item-label-item__text.svelte-1ir3cyd{padding-bottom:0.25rem;border-top:0 solid;border-left:0 solid;border-right:0 solid;border-bottom:0.0625rem solid;-o-border-image:linear-gradient(to right, rgba(234, 208, 154, 0), rgba(234, 208, 154, 100), rgba(234, 208, 154, 0)) 4.5 1 4.5;border-image:linear-gradient(to right, rgba(234, 208, 154, 0), rgba(234, 208, 154, 100), rgba(234, 208, 154, 0)) 4.5 1 4.5}.item-label-item__bar.svelte-1ir3cyd{position:absolute;bottom:0;width:0.0625rem;background-image:linear-gradient(to bottom, rgba(234, 208, 154, 0), rgba(234, 208, 154, 1))}@keyframes svelte-1ir3cyd-fadeIn{from{opacity:0
|
|
508
508
|
}to{opacity:1
|
|
509
|
-
}}`)}function du(o){let t,e,n,s=(o[0].name.length>6?`${o[0].name.slice(0,6)}...`:o[0].name)+"",r,a,l,c,d,u;return{c(){t=i.element("div"),e=i.element("div"),n=i.element("span"),r=i.text(s),a=i.space(),l=i.element("div"),i.attr(n,"class","item-label-item__text svelte-1ir3cyd"),i.attr(e,"class","item-label-item__text-wrap svelte-1ir3cyd"),i.set_style(e,"top",`-${o[0].strokeLength+26}px`),i.attr(l,"class","item-label-item__bar svelte-1ir3cyd"),i.set_style(l,"height",`${o[0].strokeLength}px`),i.attr(t,"class",c=i.null_to_empty(ye.default("item-label-item",{visible:o[0].visible}))+" svelte-1ir3cyd"),i.set_style(t,"z-index",o[0].zIndex,!1),i.set_style(t,"transform",o[0].transform,!1)},m(f,h){i.insert(f,t,h),i.append(t,e),i.append(e,n),i.append(n,r),i.append(t,a),i.append(t,l),d||(u=i.listen(n,"click",o[1]),d=!0)},p(f,[h]){h&1&&s!==(s=(f[0].name.length>6?`${f[0].name.slice(0,6)}...`:f[0].name)+"")&&i.set_data(r,s),h&1&&i.set_style(e,"top",`-${f[0].strokeLength+26}px`),h&1&&i.set_style(l,"height",`${f[0].strokeLength}px`),h&1&&c!==(c=i.null_to_empty(ye.default("item-label-item",{visible:f[0].visible}))+" svelte-1ir3cyd")&&i.attr(t,"class",c),h&1&&i.set_style(t,"z-index",f[0].zIndex,!1),h&1&&i.set_style(t,"transform",f[0].transform,!1)},i:i.noop,o:i.noop,d(f){f&&i.detach(t),d=!1,u()}}}function uu(o,t,e){let{itemLabel:n}=t,{hooks:s}=t;function r(){console.log("__onclick___: ",n),s.emit("onLabelClick",n)}return o.$$set=a=>{"itemLabel"in a&&e(0,n=a.itemLabel),"hooks"in a&&e(2,s=a.hooks)},[n,r,s]}class hu extends i.SvelteComponent{constructor(t){super(),i.init(this,t,uu,du,i.safe_not_equal,{itemLabel:0,hooks:2},cu)}}function Fs(o,t=200){let e;return function(...n){clearTimeout(e),e=setTimeout(()=>{o(...n)},t)}}function fu(o){i.append_styles(o,"svelte-gk8s47",".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}")}function Yi(o,t,e){const n=o.slice();return n[26]=t[e],n}function Ui(o,t){let e,n,s;return n=new hu({props:{itemLabel:t[26],hooks:t[0]}}),{key:o,first:null,c(){e=i.empty(),i.create_component(n.$$.fragment),this.first=e},m(r,a){i.insert(r,e,a),i.mount_component(n,r,a),s=!0},p(r,a){t=r;const l={};a&2&&(l.itemLabel=t[26]),a&1&&(l.hooks=t[0]),n.$set(l)},i(r){s||(i.transition_in(n.$$.fragment,r),s=!0)},o(r){i.transition_out(n.$$.fragment,r),s=!1},d(r){r&&i.detach(e),i.destroy_component(n,r)}}}function mu(o){let t,e=[],n=new Map,s,r,a=o[1];const l=c=>c[26].id;for(let c=0;c<a.length;c+=1){let d=Yi(o,a,c),u=l(d);n.set(u,e[c]=Ui(u,d))}return{c(){t=i.element("div");for(let c=0;c<e.length;c+=1)e[c].c();i.attr(t,"class","item-labels-container svelte-gk8s47"),i.add_render_callback(()=>o[9].call(t)),i.set_style(t,"opacity",o[4]?1:0,!1)},m(c,d){i.insert(c,t,d);for(let u=0;u<e.length;u+=1)e[u].m(t,null);s=i.add_resize_listener(t,o[9].bind(t)),r=!0},p(c,[d]){d&3&&(a=c[1],i.group_outros(),e=i.update_keyed_each(e,d,l,1,c,a,n,t,i.outro_and_destroy_block,Ui,null,Yi),i.check_outros()),d&16&&i.set_style(t,"opacity",c[4]?1:0,!1)},i(c){if(!r){for(let d=0;d<a.length;d+=1)i.transition_in(e[d]);r=!0}},o(c){for(let d=0;d<e.length;d+=1)i.transition_out(e[d]);r=!1},d(c){c&&i.detach(t);for(let d=0;d<e.length;d+=1)e[d].d();s()}}}let Vi=26,pu=11;function gu(o,t,e){const{Raycaster:n,Vector3:s}=P;let{five:r}=t,{modelOcclusionEnable:a}=t,{itemLabels:l}=t,{hooks:c}=t,{displayStrategyType:d}=t,u=null,f=null,h,p,g=[],A=!0;const b=(E,S)=>{const
|
|
509
|
+
}}`)}function du(o){let t,e,n,s=(o[0].name.length>6?`${o[0].name.slice(0,6)}...`:o[0].name)+"",r,a,l,c,d,u;return{c(){t=i.element("div"),e=i.element("div"),n=i.element("span"),r=i.text(s),a=i.space(),l=i.element("div"),i.attr(n,"class","item-label-item__text svelte-1ir3cyd"),i.attr(e,"class","item-label-item__text-wrap svelte-1ir3cyd"),i.set_style(e,"top",`-${o[0].strokeLength+26}px`),i.attr(l,"class","item-label-item__bar svelte-1ir3cyd"),i.set_style(l,"height",`${o[0].strokeLength}px`),i.attr(t,"class",c=i.null_to_empty(ye.default("item-label-item",{visible:o[0].visible}))+" svelte-1ir3cyd"),i.set_style(t,"z-index",o[0].zIndex,!1),i.set_style(t,"transform",o[0].transform,!1)},m(f,h){i.insert(f,t,h),i.append(t,e),i.append(e,n),i.append(n,r),i.append(t,a),i.append(t,l),d||(u=i.listen(n,"click",o[1]),d=!0)},p(f,[h]){h&1&&s!==(s=(f[0].name.length>6?`${f[0].name.slice(0,6)}...`:f[0].name)+"")&&i.set_data(r,s),h&1&&i.set_style(e,"top",`-${f[0].strokeLength+26}px`),h&1&&i.set_style(l,"height",`${f[0].strokeLength}px`),h&1&&c!==(c=i.null_to_empty(ye.default("item-label-item",{visible:f[0].visible}))+" svelte-1ir3cyd")&&i.attr(t,"class",c),h&1&&i.set_style(t,"z-index",f[0].zIndex,!1),h&1&&i.set_style(t,"transform",f[0].transform,!1)},i:i.noop,o:i.noop,d(f){f&&i.detach(t),d=!1,u()}}}function uu(o,t,e){let{itemLabel:n}=t,{hooks:s}=t;function r(){console.log("__onclick___: ",n),s.emit("onLabelClick",n)}return o.$$set=a=>{"itemLabel"in a&&e(0,n=a.itemLabel),"hooks"in a&&e(2,s=a.hooks)},[n,r,s]}class hu extends i.SvelteComponent{constructor(t){super(),i.init(this,t,uu,du,i.safe_not_equal,{itemLabel:0,hooks:2},cu)}}function Fs(o,t=200){let e;return function(...n){clearTimeout(e),e=setTimeout(()=>{o(...n)},t)}}function fu(o){i.append_styles(o,"svelte-gk8s47",".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}")}function Yi(o,t,e){const n=o.slice();return n[26]=t[e],n}function Ui(o,t){let e,n,s;return n=new hu({props:{itemLabel:t[26],hooks:t[0]}}),{key:o,first:null,c(){e=i.empty(),i.create_component(n.$$.fragment),this.first=e},m(r,a){i.insert(r,e,a),i.mount_component(n,r,a),s=!0},p(r,a){t=r;const l={};a&2&&(l.itemLabel=t[26]),a&1&&(l.hooks=t[0]),n.$set(l)},i(r){s||(i.transition_in(n.$$.fragment,r),s=!0)},o(r){i.transition_out(n.$$.fragment,r),s=!1},d(r){r&&i.detach(e),i.destroy_component(n,r)}}}function mu(o){let t,e=[],n=new Map,s,r,a=o[1];const l=c=>c[26].id;for(let c=0;c<a.length;c+=1){let d=Yi(o,a,c),u=l(d);n.set(u,e[c]=Ui(u,d))}return{c(){t=i.element("div");for(let c=0;c<e.length;c+=1)e[c].c();i.attr(t,"class","item-labels-container svelte-gk8s47"),i.add_render_callback(()=>o[9].call(t)),i.set_style(t,"opacity",o[4]?1:0,!1)},m(c,d){i.insert(c,t,d);for(let u=0;u<e.length;u+=1)e[u].m(t,null);s=i.add_resize_listener(t,o[9].bind(t)),r=!0},p(c,[d]){d&3&&(a=c[1],i.group_outros(),e=i.update_keyed_each(e,d,l,1,c,a,n,t,i.outro_and_destroy_block,Ui,null,Yi),i.check_outros()),d&16&&i.set_style(t,"opacity",c[4]?1:0,!1)},i(c){if(!r){for(let d=0;d<a.length;d+=1)i.transition_in(e[d]);r=!0}},o(c){for(let d=0;d<e.length;d+=1)i.transition_out(e[d]);r=!1},d(c){c&&i.detach(t);for(let d=0;d<e.length;d+=1)e[d].d();s()}}}let Vi=26,pu=11;function gu(o,t,e){const{Raycaster:n,Vector3:s}=P;let{five:r}=t,{modelOcclusionEnable:a}=t,{itemLabels:l}=t,{hooks:c}=t,{displayStrategyType:d}=t,u=null,f=null,h,p,g=[],A=!0;const b=(E,S)=>{const _=new n,B=E.camera.position.clone(),O=new s().fromArray(S.modelPosition),G=O.distanceTo(B);_.set(B.clone(),O.clone().sub(B).normalize());const[Q]=E.model.intersectRaycaster(_);return!(Q&&Q.distance+1<G)},v=(E,S)=>{const _=new s(S.modelPosition[0],S.modelPosition[1],S.modelPosition[2]),B=E.project2d(_),O=B==null?void 0:B.x,G=B==null?void 0:B.y;return[O,G]},w=E=>`translate(${E[0]}px, ${E[1]}px)`,y=(E,S)=>g.length===0?!1:!!g.find(B=>E[0]>=B[0]-S&&E[0]<=B[0]+S||E[1]>=B[1]-Vi&&E[1]<=B[1]+Vi);function I(E,S){switch(S){case We.SMALL:return Math.ceil(-27.78*E+85);case We.MIDLLE:return Math.ceil(-38.9*E+130);case We.LARGE:return Math.ceil(-44.44*E+140);case We.EXTRA_LARGE:return Math.ceil(-92.59*E+300)}}const k=(E,S)=>{const _=S.map(O=>{const G=v(E,O),Q=O.name.length*pu,H=I(O.modelPosition[1],d),Y=(a?b(E,O):!0)&&!y([G[0],G[1]+H],Q);if(!Y)return V(j({},O),{visible:Y});g.push(G);const J=w(G);return V(j({},O),{visible:Y,transform:J,strokeLength:H})}),B=_.filter(({visible:O})=>O).map(O=>({itemLabelItem:O,distance:new s(O.modelPosition[0],O.modelPosition[1],O.modelPosition[2]).clone().distanceTo(E.camera.position)})).sort((O,G)=>O.distance-G.distance);return _.map(O=>{const G=B.findIndex(Q=>Q.itemLabelItem.id===O.id);return G!==void 0?V(j({},O),{zIndex:G*10}):O})},C=()=>{g=[],e(1,f=k(r,f))};Z.beforeUpdate(()=>{L()});const D=()=>{e(4,A=!1),x()};Z.onMount(()=>{e(1,f=l),u=l,C(),z(),r.on("cameraUpdate",D)});const x=Fs(()=>{e(4,A=!0),C()},300),z=()=>{window.addEventListener("resize",T,!1)},L=()=>{u!==l&&(e(1,f=l),u=l,C())},T=()=>{r.once("renderFrame",C)};Z.onDestroy(()=>{r.off("cameraUpdate",D),window.removeEventListener("resize",T,!1)});function R(){h=this.clientWidth,p=this.clientHeight,e(2,h),e(3,p)}return o.$$set=E=>{"five"in E&&e(5,r=E.five),"modelOcclusionEnable"in E&&e(6,a=E.modelOcclusionEnable),"itemLabels"in E&&e(7,l=E.itemLabels),"hooks"in E&&e(0,c=E.hooks),"displayStrategyType"in E&&e(8,d=E.displayStrategyType)},[c,f,h,p,A,r,a,l,d,R]}class Au extends i.SvelteComponent{constructor(t){super(),i.init(this,t,gu,mu,i.safe_not_equal,{five:5,modelOcclusionEnable:6,itemLabels:7,hooks:0,displayStrategyType:8},fu)}}function vu(o){return o.model_item_labels.map(t=>j({modelPosition:[t.position[0],t.position[1]+t.size[1],t.position[2]]},t))}const bu=(o,t)=>{var h,p;const e={container:document.createElement("div"),data:null,enabled:!0,fiveModeEnabled:void 0,itemLabels:[],wrapper:null,app:void 0,hooks:new ee.Subscribe,modelOcclusionEnable:(h=t==null?void 0:t.modelOcclusionEnable)!=null?h:!0,displayStrategyType:(p=t==null?void 0:t.displayStrategyType)!=null?p:We.SMALL};e.container.setAttribute("class","model-item-label-plugin-container"),e.container.style.cssText=`
|
|
510
510
|
position: absolute;
|
|
511
511
|
left: 0;
|
|
512
512
|
top: 0;
|
|
513
513
|
width: 100%;
|
|
514
514
|
height: 100%;
|
|
515
515
|
z-index: 5;
|
|
516
|
-
`,e.container.style.pointerEvents="none";const n=g=>(e.wrapper=g,g.appendChild(e.container),c(),!0),s=g=>{e.itemLabels=vu(g),c()},r=()=>(e.enabled||(e.enabled=!0,c()),!0),a=()=>(e.enabled&&(e.enabled=!1,c()),!0),l=()=>{u(),e.container.remove()},c=()=>{var g;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(g=e.app)==null||g.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:o,itemLabels:e.itemLabels}):e.app=new Au({target:e.container,props:{five:o,modelOcclusionEnable:e.modelOcclusionEnable,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType}})}},d=()=>{o.on("modeChange",f),o.once("dispose",l)},u=()=>{o.off("modeChange",f)},f=g=>{if(!!e.enabled){if(g!==ee.Five.Mode.Floorplan){e.fiveModeEnabled=!1,c();return}o.once("initAnimationEnded",()=>{e.fiveModeEnabled=o.currentMode===ee.Five.Mode.Floorplan,c()})}};return d(),{appendTo:n,load:s,enable:r,disable:a,dispose:l,hooks:e.hooks}},yu={name:"ModelItemLabelPlugin",version:0};var et=(o=>(o.TOP_LEFT="topLeft",o.TOP_RIGHT="topRight",o.BOTTOM_LEFT="bottomLeft",o.BOTTOM_RIGHT="bottomRight",o))(et||{});function wu(o){if(o.length===0)return[];if(Array.isArray(o[0]))return o;let t=[];return o.forEach(e=>{const n=[e[et.TOP_LEFT],e[et.BOTTOM_LEFT],e[et.BOTTOM_RIGHT],e[et.TOP_RIGHT]];t.push(n)}),t}const Cu=(o,{videoElement:t})=>{const e={videoMeshes:[],videoTextureEnabled:!1,videoSource:"",rectPoints:[],enabled:!1,videoElement:t},n=nt(o),s=new Map,r=v=>{e.videoTexture&&(e.videoTexture.image.muted=v)},a=()=>e.videoTexture?e.videoTexture.image.muted:!0,l=()=>{if(e.enabled||!e.videoTexture)return;e.enabled=!0,e.videoMeshes=d(),e.videoMeshes.forEach(w=>o.scene.add(w));const v=()=>{if(!e.videoTexture)return;const w=()=>{var y;!e.videoTexture||((y=e.videoTexture)==null||y.image.removeEventListener("timeupdate",w),e.videoTextureEnabled=!0,e.videoMeshes.forEach(I=>{I.material.map!==e.videoTexture&&(I.material.map=e.videoTexture)}),o.needsRender=!0)};e.videoTexture.image.addEventListener("timeupdate",w),e.videoTexture&&e.videoMeshes.length&&(e.videoTexture.image.play(),e.videoTexture.image.onplay=()=>{n.hide()},e.videoTexture.image.onpause=()=>{n.show()},e.videoTexture.image.onclick=()=>{e.videoTexture.image.muted=!1,e.videoTexture.image.play()})};if(o.model.loaded)v();else return o.once("modelLoaded",()=>v())},c=()=>{!e.enabled||(e.enabled=!1,e.videoMeshes.forEach(v=>{v.geometry.dispose(),v.material.dispose(),o.scene.remove(v),e.videoTexture&&e.videoTexture.image.pause()}),e.videoMeshes=[],o.needsRender=!0)},d=()=>e.rectPoints.map((v,w)=>{const y=new P.BufferGeometry,I=128,k=[];k.push(...v[0].toArray());for(let E=1;E<I;E++)k.push(v[0].x+(v[1].x-v[0].x)*E/I,v[0].y+(v[1].y-v[0].y)*E/I,v[0].z+(v[1].z-v[0].z)*E/I);k.push(...v[1].toArray()),k.push(...v[2].toArray());for(let E=1;E<I;E++)k.push(v[2].x+(v[3].x-v[2].x)*E/I,v[2].y+(v[3].y-v[2].y)*E/I,v[2].z+(v[3].z-v[2].z)*E/I);k.push(...v[3].toArray());const C=[];C.push(0,1);for(let E=1;E<I;E++)C.push(0,1-E/I);C.push(0,0),C.push(1,0);for(let E=1;E<I;E++)C.push(1,E/I);C.push(1,1);const D=[];for(let E=0;E<I;E++)D.push(E,E+1,I*2-E,E,I*2-E,I*2+1-E);y.setAttribute("position",new P.BufferAttribute(new Float32Array(k),3)),y.setAttribute("uv",new P.BufferAttribute(new Float32Array(C),2)),y.setIndex(new P.BufferAttribute(new Uint32Array(D),1));const x=new P.AxesHelper(10);o.scene.add(x);const z=new P.MeshBasicMaterial({map:e.videoTextureEnabled?e.videoTexture:e.imageTexture,side:P.DoubleSide}),
|
|
516
|
+
`,e.container.style.pointerEvents="none";const n=g=>(e.wrapper=g,g.appendChild(e.container),c(),!0),s=g=>{e.itemLabels=vu(g),c()},r=()=>(e.enabled||(e.enabled=!0,c()),!0),a=()=>(e.enabled&&(e.enabled=!1,c()),!0),l=()=>{u(),e.container.remove()},c=()=>{var g;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(g=e.app)==null||g.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:o,itemLabels:e.itemLabels}):e.app=new Au({target:e.container,props:{five:o,modelOcclusionEnable:e.modelOcclusionEnable,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType}})}},d=()=>{o.on("modeChange",f),o.once("dispose",l)},u=()=>{o.off("modeChange",f)},f=g=>{if(!!e.enabled){if(g!==ee.Five.Mode.Floorplan){e.fiveModeEnabled=!1,c();return}o.once("initAnimationEnded",()=>{e.fiveModeEnabled=o.currentMode===ee.Five.Mode.Floorplan,c()})}};return d(),{appendTo:n,load:s,enable:r,disable:a,dispose:l,hooks:e.hooks}},yu={name:"ModelItemLabelPlugin",version:0};var et=(o=>(o.TOP_LEFT="topLeft",o.TOP_RIGHT="topRight",o.BOTTOM_LEFT="bottomLeft",o.BOTTOM_RIGHT="bottomRight",o))(et||{});function wu(o){if(o.length===0)return[];if(Array.isArray(o[0]))return o;let t=[];return o.forEach(e=>{const n=[e[et.TOP_LEFT],e[et.BOTTOM_LEFT],e[et.BOTTOM_RIGHT],e[et.TOP_RIGHT]];t.push(n)}),t}const Cu=(o,{videoElement:t})=>{const e={videoMeshes:[],videoTextureEnabled:!1,videoSource:"",rectPoints:[],enabled:!1,videoElement:t},n=nt(o),s=new Map,r=v=>{e.videoTexture&&(e.videoTexture.image.muted=v)},a=()=>e.videoTexture?e.videoTexture.image.muted:!0,l=()=>{if(e.enabled||!e.videoTexture)return;e.enabled=!0,e.videoMeshes=d(),e.videoMeshes.forEach(w=>o.scene.add(w));const v=()=>{if(!e.videoTexture)return;const w=()=>{var y;!e.videoTexture||((y=e.videoTexture)==null||y.image.removeEventListener("timeupdate",w),e.videoTextureEnabled=!0,e.videoMeshes.forEach(I=>{I.material.map!==e.videoTexture&&(I.material.map=e.videoTexture)}),o.needsRender=!0)};e.videoTexture.image.addEventListener("timeupdate",w),e.videoTexture&&e.videoMeshes.length&&(e.videoTexture.image.play(),e.videoTexture.image.onplay=()=>{n.hide()},e.videoTexture.image.onpause=()=>{n.show()},e.videoTexture.image.onclick=()=>{e.videoTexture.image.muted=!1,e.videoTexture.image.play()})};if(o.model.loaded)v();else return o.once("modelLoaded",()=>v())},c=()=>{!e.enabled||(e.enabled=!1,e.videoMeshes.forEach(v=>{v.geometry.dispose(),v.material.dispose(),o.scene.remove(v),e.videoTexture&&e.videoTexture.image.pause()}),e.videoMeshes=[],o.needsRender=!0)},d=()=>e.rectPoints.map((v,w)=>{const y=new P.BufferGeometry,I=128,k=[];k.push(...v[0].toArray());for(let E=1;E<I;E++)k.push(v[0].x+(v[1].x-v[0].x)*E/I,v[0].y+(v[1].y-v[0].y)*E/I,v[0].z+(v[1].z-v[0].z)*E/I);k.push(...v[1].toArray()),k.push(...v[2].toArray());for(let E=1;E<I;E++)k.push(v[2].x+(v[3].x-v[2].x)*E/I,v[2].y+(v[3].y-v[2].y)*E/I,v[2].z+(v[3].z-v[2].z)*E/I);k.push(...v[3].toArray());const C=[];C.push(0,1);for(let E=1;E<I;E++)C.push(0,1-E/I);C.push(0,0),C.push(1,0);for(let E=1;E<I;E++)C.push(1,E/I);C.push(1,1);const D=[];for(let E=0;E<I;E++)D.push(E,E+1,I*2-E,E,I*2-E,I*2+1-E);y.setAttribute("position",new P.BufferAttribute(new Float32Array(k),3)),y.setAttribute("uv",new P.BufferAttribute(new Float32Array(C),2)),y.setIndex(new P.BufferAttribute(new Uint32Array(D),1));const x=new P.AxesHelper(10);o.scene.add(x);const z=new P.MeshBasicMaterial({map:e.videoTextureEnabled?e.videoTexture:e.imageTexture,side:P.DoubleSide}),L=new P.Mesh(y,z);L.renderOrder=1,L.name=`ModelTVVideoPlugin-${w}-${performance.now()}`;const T=[v[1],v[2],v[3],v[0]],R=n.create3DDomContainer(T);if(R!=null&&R.container){const E=document.createElement("div");E.classList.add("play-icon"),E.style.width="100%",E.style.height="100%",E.style.display="flex",E.style.justifyContent="center",E.style.alignItems="center",E.style.pointerEvents="none",R.container.appendChild(E);const S=document.createElement("img");S.src="//vrlab-static.ljcdn.com/release/web/play.2ada5b6f.png",S.style.width="200px",S.style.pointerEvents="auto",S.onclick=()=>{e.videoTexture.image.muted=!1,e.videoTexture.image.play()},E.appendChild(S),s.set(L,R)}return L}),u=v=>{const w=new P.TextureLoader().load(v);return w.minFilter=P.LinearFilter,w.magFilter=P.LinearFilter,w.format=P.RGBFormat,w},f=(v,w)=>new Promise((y,I)=>{const k=new XMLHttpRequest;k.onreadystatechange=()=>{if(k.readyState==4)if(k.status==200){const C=window.URL||window.webkitURL;w=w||document.createElement("video"),w.crossOrigin="anonymous",w.muted=!0,w.loop=!0,w.playsInline=!0,w.src=C.createObjectURL(k.response);const D=new P.VideoTexture(w);D.minFilter=P.LinearFilter,D.magFilter=P.LinearFilter,D.format=P.RGBFormat,y(Object.assign(D,{videoSource:v}))}else I(new Error("Video download Error: "+k.status))},k.onerror=C=>I(C),k.open("GET",v),k.responseType="blob",k.send()}),h=(v,w)=>F(exports,null,function*(){const{video_src:y,video_poster_src:I,points:k}=v;e.videoSource=y,e.rectPoints=wu(k).map(C=>C.map(({x:D,y:x,z})=>new P.Vector3(D,x,z))),e.imageTexture=u(I),w&&(e.videoElement=w),e.videoTexture=yield f(e.videoSource,e.videoElement),e.enabled=!!v.enable,e.enabled&&l()}),p=v=>{if(!e.enabled)return;const w=e.videoMeshes;if(!(!w||v.intersectObjects(w).length===0))return e.videoTexture&&(e.videoTexture.image.paused||e.videoTexture.image.pause()),!1},g=v=>{v==="Floorplan"?n.hide():n.show()},A=()=>{if(!e.enabled)return;const v=o.camera.position;if(s.forEach((w,y)=>{const I=w.css3DObject.position.clone(),k=I.clone().sub(v).normalize(),C=new P.Raycaster(v,k),D=o.model.intersectRaycaster(C)[0],x=I.distanceTo(v),z=.01;D&&D.distance+z<x?w.hide():w.show()}),!a()){const w=e.rectPoints.find(y=>{const I=y[0].clone().add(y[1]).add(y[2]).add(y[3]).divideScalar(4);return y.map(k=>k.clone().add(I).divideScalar(2)).filter(k=>{const C=k.distanceTo(v),D=new P.Raycaster(v,k.clone().sub(v).normalize()),x=o.model.intersectRaycaster(D)[0],z=.01;return!(x&&x.distance+z<C)}).length>=2});(!w||w.length===0)&&r(!0)}},b=()=>{c(),e.videoTexture=void 0,o.off("modeChange",g),o.off("wantsTapGesture",p),o.off("panoArrived",A),o.off("renderFrame",()=>{e.videoMeshes.forEach(v=>{v&&(v.needsRender=!0)})})};return o.on("modeChange",g),o.on("wantsTapGesture",p),o.on("panoArrived",A),o.on("renderFrame",()=>{e.videoMeshes.forEach(v=>{v&&(v.needsRender=!0)})}),{enable:l,disable:c,load:h,dispose:b,state:e,css3DRenderPlugin:n}};function Eu(o){i.append_styles(o,"svelte-gduhqw",`.item-label-item.svelte-gduhqw.svelte-gduhqw{position:absolute;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;animation:svelte-gduhqw-fadeIn .3s ease-in}.item-label-item.fold.svelte-gduhqw>.item-label-item__text-wrap.svelte-gduhqw{visibility:hidden}.item-label-item.fold.svelte-gduhqw>.item-label-item__bar.anchor.svelte-gduhqw{visibility:hidden}.item-label-item.fold.svelte-gduhqw>.item-label-item__bar.anchor.svelte-gduhqw:after{visibility:visible}.item-label-item__text-wrap.svelte-gduhqw.svelte-gduhqw{height:-moz-fit-content;height:fit-content;padding:0.75rem 1.25rem 0.75rem 0.75rem;position:absolute;width:-moz-max-content;width:max-content;max-width:29.5625rem;min-height:5.75rem;background-image:linear-gradient(269deg, rgba(0, 0, 0, 0.50) 0%, rgba(0, 0, 0, 0.60) 49%, rgba(31, 38, 46, 0.70) 100%);border:0.09375rem solid rgba(255, 255, 255, .65);border-radius:0.1875rem;color:white;transform:translate(-50%, 0);display:flex;justify-content:flex-start;align-items:center;box-sizing:border-box;overflow:hidden;pointer-events:all}.item-label-item__custom.svelte-gduhqw.svelte-gduhqw{padding:0;max-width:unset;min-height:unset;background-image:unset;border:0;border-radius:0}.icon-wrap.svelte-gduhqw.svelte-gduhqw{width:4.25rem;height:100%;display:flex;justify-content:center;align-content:center}.icon.svelte-gduhqw.svelte-gduhqw{width:4.25rem;height:4.25rem;background-repeat:no-repeat;background-size:contain;background-position:center}.item-label-text.svelte-gduhqw.svelte-gduhqw{margin-left:0.75rem;padding-left:0.75rem;min-height:4.25rem;height:auto;display:flex;flex-flow:column;justify-content:space-around;align-content:flex-start;border-left:solid rgba(255, 255, 255, .2) 0.0625rem;border-top:solid rgba(255, 255, 255, .2) 0;border-right:solid rgba(255, 255, 255, .2) 0;border-bottom:solid rgba(255, 255, 255, .2) 0;pointer-events:auto}.item-model.svelte-gduhqw.svelte-gduhqw{white-space:nowrap;font-size:1.375rem;font-weight:bold;line-height:1.875rem}.item-name.svelte-gduhqw.svelte-gduhqw{height:auto;word-wrap:break-word;word-break:break-all;font-size:1.25rem;line-height:1.75rem}.item-label-item__bar.svelte-gduhqw.svelte-gduhqw{position:absolute;bottom:0;width:0.1875rem;background-image:linear-gradient(to bottom, white, rgba(255, 255, 255, 0));box-shadow:0 0.125rem 0.5rem 0 rgba(0, 0, 0, 0.20);pointer-events:none}.item-label-item__bar.anchor.svelte-gduhqw.svelte-gduhqw:after{content:'';position:absolute;bottom:0;width:1.5rem;height:1.5rem;background-image:url("//vrlab-public.ljcdn.com/common/file/web/67e7a198-28c9-47dc-879b-507bd3ae600c.png ");background-position:center;background-size:contain;transform:translate(-0.65625rem, 50%)}@keyframes svelte-gduhqw-fadeIn{from{opacity:0
|
|
517
517
|
}to{opacity:1
|
|
518
|
-
}}`)}function Pu(o){let t,e,n,s=(o[0].code||o[0].id)+"",r,a,l,c=o[0].name+"",d,u=o[0].icon&&Ji(o);return{c(){u&&u.c(),t=i.space(),e=i.element("div"),n=i.element("span"),r=i.text(s),a=i.space(),l=i.element("span"),d=i.text(c),i.attr(n,"class","item-model svelte-gduhqw"),i.attr(l,"class","item-name svelte-gduhqw"),i.attr(e,"class","item-label-text svelte-gduhqw")},m(f,h){u&&u.m(f,h),i.insert(f,t,h),i.insert(f,e,h),i.append(e,n),i.append(n,r),i.append(e,a),i.append(e,l),i.append(l,d)},p(f,h){f[0].icon?u?u.p(f,h):(u=Ji(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null),h&1&&s!==(s=(f[0].code||f[0].id)+"")&&i.set_data(r,s),h&1&&c!==(c=f[0].name+"")&&i.set_data(d,c)},d(f){u&&u.d(f),f&&i.detach(t),f&&i.detach(e)}}}function Iu(o){let t;return{c(){t=i.element("div")},m(e,n){i.insert(e,t,n),o[6](t)},p:i.noop,d(e){e&&i.detach(t),o[6](null)}}}function Ji(o){let t,e,n,s,r;return{c(){t=i.element("div"),e=i.element("div"),i.attr(e,"class","icon svelte-gduhqw"),i.attr(e,"style",n=`background-image: url(${o[0].icon})`),i.attr(t,"class","icon-wrap svelte-gduhqw")},m(a,l){i.insert(a,t,l),i.append(t,e),s||(r=i.listen(t,"click",o[7]),s=!0)},p(a,l){l&1&&n!==(n=`background-image: url(${a[0].icon})`)&&i.attr(e,"style",n)},d(a){a&&i.detach(t),s=!1,r()}}}function ku(o){let t,e,n,s,r,a,l,c,d,u;function f(g,A){return A&1&&(n=null),n==null&&(n=!!Boolean(typeof g[0].render=="function")),n?Iu:Pu}let h=f(o,-1),p=h(o);return{c(){t=i.element("div"),e=i.element("div"),p.c(),r=i.space(),a=i.element("div"),i.attr(e,"class",s=i.null_to_empty(ye.default("item-label-item__text-wrap",{"item-label-item__custom":Boolean(typeof o[0].render=="function")}))+" svelte-gduhqw"),i.set_style(e,"bottom",`${o[0].strokeLength}px`),i.attr(a,"class",l=i.null_to_empty(ye.default("item-label-item__bar",{anchor:o[1]}))+" svelte-gduhqw"),i.set_style(a,"height",`${o[0].strokeLength}px`),i.attr(t,"class",c=i.null_to_empty(ye.default("item-label-item",{fold:o[0].isFold}))+" svelte-gduhqw"),i.set_style(t,"z-index",o[0].zIndex,!1),i.set_style(t,"transform",o[0].transform,!1)},m(g,A){i.insert(g,t,A),i.append(t,e),p.m(e,null),i.append(t,r),i.append(t,a),d||(u=i.listen(e,"click",o[4]),d=!0)},p(g,[A]){h===(h=f(g,A))&&p?p.p(g,A):(p.d(1),p=h(g),p&&(p.c(),p.m(e,null))),A&1&&s!==(s=i.null_to_empty(ye.default("item-label-item__text-wrap",{"item-label-item__custom":Boolean(typeof g[0].render=="function")}))+" svelte-gduhqw")&&i.attr(e,"class",s),A&1&&i.set_style(e,"bottom",`${g[0].strokeLength}px`),A&2&&l!==(l=i.null_to_empty(ye.default("item-label-item__bar",{anchor:g[1]}))+" svelte-gduhqw")&&i.attr(a,"class",l),A&1&&i.set_style(a,"height",`${g[0].strokeLength}px`),A&1&&c!==(c=i.null_to_empty(ye.default("item-label-item",{fold:g[0].isFold}))+" svelte-gduhqw")&&i.attr(t,"class",c),A&1&&i.set_style(t,"z-index",g[0].zIndex,!1),A&1&&i.set_style(t,"transform",g[0].transform,!1)},i:i.noop,o:i.noop,d(g){g&&i.detach(t),p.d(),d=!1,u()}}}function xu(o,t,e){let{itemLabel:n}=t,{hooks:s}=t,{anchorEnabled:r}=t,{onIconClick:a}=t;function l(){s.emit("onLabelClick",n)}let c;function d(f){i.binding_callbacks[f?"unshift":"push"](()=>{c=f,e(3,c)})}const u=f=>a(n);return o.$$set=f=>{"itemLabel"in f&&e(0,n=f.itemLabel),"hooks"in f&&e(5,s=f.hooks),"anchorEnabled"in f&&e(1,r=f.anchorEnabled),"onIconClick"in f&&e(2,a=f.onIconClick)},o.$$.update=()=>{if(o.$$.dirty&9&&typeof n.render=="function"&&c&&c.children.length===0){const f=n.render(n);f&&c.appendChild(f)}},[n,r,a,c,l,s,d,u]}class Du extends i.SvelteComponent{constructor(t){super(),i.init(this,t,xu,ku,i.safe_not_equal,{itemLabel:0,hooks:5,anchorEnabled:1,onIconClick:2},Eu)}}const{Raycaster:Su,Vector3:kp}=P,Zi=(o,t,e,n)=>{const s=t.clone().sub(e).normalize(),r=new Su;r.set(e,s);const[a]=o.model.intersectRaycaster(r);return a&&a.distance+.01<n};var Xe=(o=>(o.SMALL="small",o.MIDLLE="middle",o.LARGE="large",o.EXTRA_LARGE="x-large",o))(Xe||{});const Lu=(o,t)=>{switch(t){case Xe.SMALL:return Math.ceil(-27.78*o+85);case Xe.MIDLLE:return Math.ceil(-38.9*o+130);case Xe.LARGE:return Math.ceil(-44.44*o+140);case Xe.EXTRA_LARGE:return Math.ceil(-92.59*o+300)}},_u=o=>`translate(${o[0]}px, ${o[1]}px)`;function qi(o){return o.map(t=>j({observerIndex:void 0,visible:!1,isFold:!1},t))}function zu(o){i.append_styles(o,"svelte-gk8s47",".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}")}function Ki(o,t,e){const n=o.slice();return n[30]=t[e],n}function $i(o){let t,e;return t=new Du({props:{itemLabel:o[30],hooks:o[0],anchorEnabled:o[2],onIconClick:o[6]}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s[0]&2&&(r.itemLabel=n[30]),s[0]&1&&(r.hooks=n[0]),s[0]&4&&(r.anchorEnabled=n[2]),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function eo(o,t){let e,n,s,r=t[30].visible&&$i(t);return{key:o,first:null,c(){e=i.empty(),r&&r.c(),n=i.empty(),this.first=e},m(a,l){i.insert(a,e,l),r&&r.m(a,l),i.insert(a,n,l),s=!0},p(a,l){t=a,t[30].visible?r?(r.p(t,l),l[0]&2&&i.transition_in(r,1)):(r=$i(t),r.c(),i.transition_in(r,1),r.m(n.parentNode,n)):r&&(i.group_outros(),i.transition_out(r,1,1,()=>{r=null}),i.check_outros())},i(a){s||(i.transition_in(r),s=!0)},o(a){i.transition_out(r),s=!1},d(a){a&&i.detach(e),r&&r.d(a),a&&i.detach(n)}}}function Mu(o){let t,e=[],n=new Map,s,r,a=o[1];const l=c=>c[30].id;for(let c=0;c<a.length;c+=1){let d=Ki(o,a,c),u=l(d);n.set(u,e[c]=eo(u,d))}return{c(){t=i.element("div");for(let c=0;c<e.length;c+=1)e[c].c();i.attr(t,"class","item-labels-container svelte-gk8s47"),i.add_render_callback(()=>o[12].call(t)),i.set_style(t,"opacity",o[5]?1:0,!1)},m(c,d){i.insert(c,t,d);for(let u=0;u<e.length;u+=1)e[u].m(t,null);s=i.add_resize_listener(t,o[12].bind(t)),r=!0},p(c,d){d[0]&71&&(a=c[1],i.group_outros(),e=i.update_keyed_each(e,d,l,1,c,a,n,t,i.outro_and_destroy_block,eo,null,Ki),i.check_outros()),d[0]&32&&i.set_style(t,"opacity",c[5]?1:0,!1)},i(c){if(!r){for(let d=0;d<a.length;d+=1)i.transition_in(e[d]);r=!0}},o(c){for(let d=0;d<e.length;d+=1)i.transition_out(e[d]);r=!1},d(c){c&&i.detach(t);for(let d=0;d<e.length;d+=1)e[d].d();s()}}}let Tu=11;function ju(o,t,e){const{Raycaster:n,Vector3:s}=P;let{five:r}=t,{modelOcclusionEnable:a}=t,{itemLabels:l}=t,{hooks:c}=t,{displayStrategyType:d}=t,{maxVisibleDistance:u}=t,f=null,h=null,p=(r==null?void 0:r.currentMode)===ee.Five.Mode.Panorama,g,A,b=[],v=!0;const w=(L,B)=>{const R=L.camera.position.clone(),G=new s(B.modelPosition[0],B.modelPosition[1],B.modelPosition[2]),Q=G.distanceTo(R);return u!==void 0&&L.state.mode===ee.Five.Mode.Panorama&&Q>u?!1:Zi(L,G.clone().sub(R).normalize(),R,Q)},y=L=>{const{camera:B,model:R}=r,{x:G,y:Q,z:O}=L.clone().project(B),X=(G+1)/2,Y=(2-(Q+1))/2,oe=Math.abs(O)<1&&[X,Y].every(ce=>ce<1&&ce>=0);return Boolean(oe)},I=(L,B)=>{const R=new s(B.modelPosition[0],B.modelPosition[1],B.modelPosition[2]),G=L.project2d(R),Q=G==null?void 0:G.x,O=G==null?void 0:G.y;return[Q,O]},k=(L,B)=>{const R=B.map(Q=>{if(L.state.panoIndex!==Q.panoIndex)return V(j({},Q),{visible:!1});const O=I(L,Q);Q.name.length*Tu;const X=Lu(Q.modelPosition[1],d),Y=L.currentMode===ee.Five.Mode.Panorama?y(new s(Q.position[0],Q.position[1],Q.position[2])):!0,J=a?w(L,Q):!1,te=Y&&!J;if(!te)return V(j({},Q),{visible:te});b.push(O);const oe=_u(O);return V(j({},Q),{visible:te,transform:oe,strokeLength:X})}),G=R.filter(({visible:Q})=>Q).map(Q=>({itemLabelItem:Q,distance:new s(Q.modelPosition[0],Q.modelPosition[1],Q.modelPosition[2]).clone().distanceTo(L.camera.position)})).sort((Q,O)=>Q.distance-O.distance);return R.map(Q=>{const O=G.findIndex(X=>X.itemLabelItem.id===Q.id);return O!==void 0?V(j({},Q),{zIndex:O*10}):Q})},C=()=>{b=[],e(1,h=k(r,h))},D=()=>{e(5,v=!1),x()},x=Fs(()=>{e(5,v=!0),C()},300),z=()=>{r.once("renderFrame",C)},_=()=>{window.addEventListener("resize",z,!1)},T=()=>{f!==l&&(e(1,h=qi(l)),f=l,C())},H=(L,B)=>{let R=[];for(let Q=0;Q<B.length;Q++){const{position:O,panoIndex:X}=B[Q],Y=L.distanceTo(O);(u===void 0||Y<=u||r.state.mode!==ee.Five.Mode.Panorama)&&R.push({panoIndex:X,obVector:O,distance:Y})}R=R.sort((Q,O)=>Q.distance-O.distance);let G;for(let Q=0;Q<R.length;Q++){const{obVector:O,distance:X,panoIndex:Y}=R[Q];if(!Zi(r,L,O,X)){G=Y;break}}return typeof G=="number"?B[G]:void 0},E=L=>{if(r.state.mode===ee.Five.Mode.Panorama)return;const B=r.work.observers,R=new s().fromArray(L.position),G=H(R,B);if(G&&(L.observerIndex=G.panoIndex),typeof L.observerIndex=="number"){const Q=B[L.observerIndex],O=R.clone().sub(Q.position).normalize(),X={longitude:Math.PI+Math.atan2(O.x,O.z),latitude:Math.acos(O.y/O.length())-Math.PI/2};r.setState(V(j({},X),{mode:ee.Five.Mode.Panorama,panoIndex:L.observerIndex})),r.once("initAnimationEnded",()=>{e(1,h=h.map(Y=>V(j({},Y),{isFold:Y.id!==L.id}))),r.once("cameraUpdate",()=>{e(1,h=h.map(Y=>V(j({},Y),{isFold:!1})))})})}};Z.beforeUpdate(()=>{T()}),Z.onMount(()=>{e(1,h=qi(l)),f=l,C(),_(),r.on("cameraUpdate",D)}),Z.onDestroy(()=>{r.off("cameraUpdate",D),window.removeEventListener("resize",z,!1)});function S(){g=this.clientWidth,A=this.clientHeight,e(3,g),e(4,A)}return o.$$set=L=>{"five"in L&&e(7,r=L.five),"modelOcclusionEnable"in L&&e(8,a=L.modelOcclusionEnable),"itemLabels"in L&&e(9,l=L.itemLabels),"hooks"in L&&e(0,c=L.hooks),"displayStrategyType"in L&&e(10,d=L.displayStrategyType),"maxVisibleDistance"in L&&e(11,u=L.maxVisibleDistance)},[c,h,p,g,A,v,E,r,a,l,d,u,S]}class Bu extends i.SvelteComponent{constructor(t){super(),i.init(this,t,ju,Mu,i.safe_not_equal,{five:7,modelOcclusionEnable:8,itemLabels:9,hooks:0,displayStrategyType:10,maxVisibleDistance:11},zu,[-1,-1])}}function Qu(o){return o.item_labels.map(t=>V(j({},t),{modelPosition:[t.position[0],t.position[1],t.position[2]],observerIndex:void 0}))}const Ru=void 0,Ou=(o,t)=>{var h,p,g,A;const e={container:document.createElement("div"),data:null,enabled:!0,fiveModeEnabled:!0,itemLabels:[],wrapper:null,app:void 0,hooks:new ee.Subscribe,modelOcclusionEnable:(h=t==null?void 0:t.modelOcclusionEnable)!=null?h:!0,onlyVisibleInPanorama:(p=t==null?void 0:t.onlyVisibleInPanorama)!=null?p:!0,displayStrategyType:(g=t==null?void 0:t.displayStrategyType)!=null?g:Xe.SMALL,maxVisibleDistance:(A=t==null?void 0:t.maxVisibleDistance)!=null?A:Ru};e.container.setAttribute("class","item-label-plugin-container"),e.container.style.cssText=`
|
|
518
|
+
}}`)}function Pu(o){let t,e,n,s=(o[0].code||o[0].id)+"",r,a,l,c=o[0].name+"",d,u=o[0].icon&&Ji(o);return{c(){u&&u.c(),t=i.space(),e=i.element("div"),n=i.element("span"),r=i.text(s),a=i.space(),l=i.element("span"),d=i.text(c),i.attr(n,"class","item-model svelte-gduhqw"),i.attr(l,"class","item-name svelte-gduhqw"),i.attr(e,"class","item-label-text svelte-gduhqw")},m(f,h){u&&u.m(f,h),i.insert(f,t,h),i.insert(f,e,h),i.append(e,n),i.append(n,r),i.append(e,a),i.append(e,l),i.append(l,d)},p(f,h){f[0].icon?u?u.p(f,h):(u=Ji(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null),h&1&&s!==(s=(f[0].code||f[0].id)+"")&&i.set_data(r,s),h&1&&c!==(c=f[0].name+"")&&i.set_data(d,c)},d(f){u&&u.d(f),f&&i.detach(t),f&&i.detach(e)}}}function Iu(o){let t;return{c(){t=i.element("div")},m(e,n){i.insert(e,t,n),o[6](t)},p:i.noop,d(e){e&&i.detach(t),o[6](null)}}}function Ji(o){let t,e,n,s,r;return{c(){t=i.element("div"),e=i.element("div"),i.attr(e,"class","icon svelte-gduhqw"),i.attr(e,"style",n=`background-image: url(${o[0].icon})`),i.attr(t,"class","icon-wrap svelte-gduhqw")},m(a,l){i.insert(a,t,l),i.append(t,e),s||(r=i.listen(t,"click",o[7]),s=!0)},p(a,l){l&1&&n!==(n=`background-image: url(${a[0].icon})`)&&i.attr(e,"style",n)},d(a){a&&i.detach(t),s=!1,r()}}}function ku(o){let t,e,n,s,r,a,l,c,d,u;function f(g,A){return A&1&&(n=null),n==null&&(n=!!Boolean(typeof g[0].render=="function")),n?Iu:Pu}let h=f(o,-1),p=h(o);return{c(){t=i.element("div"),e=i.element("div"),p.c(),r=i.space(),a=i.element("div"),i.attr(e,"class",s=i.null_to_empty(ye.default("item-label-item__text-wrap",{"item-label-item__custom":Boolean(typeof o[0].render=="function")}))+" svelte-gduhqw"),i.set_style(e,"bottom",`${o[0].strokeLength}px`),i.attr(a,"class",l=i.null_to_empty(ye.default("item-label-item__bar",{anchor:o[1]}))+" svelte-gduhqw"),i.set_style(a,"height",`${o[0].strokeLength}px`),i.attr(t,"class",c=i.null_to_empty(ye.default("item-label-item",{fold:o[0].isFold}))+" svelte-gduhqw"),i.set_style(t,"z-index",o[0].zIndex,!1),i.set_style(t,"transform",o[0].transform,!1)},m(g,A){i.insert(g,t,A),i.append(t,e),p.m(e,null),i.append(t,r),i.append(t,a),d||(u=i.listen(e,"click",o[4]),d=!0)},p(g,[A]){h===(h=f(g,A))&&p?p.p(g,A):(p.d(1),p=h(g),p&&(p.c(),p.m(e,null))),A&1&&s!==(s=i.null_to_empty(ye.default("item-label-item__text-wrap",{"item-label-item__custom":Boolean(typeof g[0].render=="function")}))+" svelte-gduhqw")&&i.attr(e,"class",s),A&1&&i.set_style(e,"bottom",`${g[0].strokeLength}px`),A&2&&l!==(l=i.null_to_empty(ye.default("item-label-item__bar",{anchor:g[1]}))+" svelte-gduhqw")&&i.attr(a,"class",l),A&1&&i.set_style(a,"height",`${g[0].strokeLength}px`),A&1&&c!==(c=i.null_to_empty(ye.default("item-label-item",{fold:g[0].isFold}))+" svelte-gduhqw")&&i.attr(t,"class",c),A&1&&i.set_style(t,"z-index",g[0].zIndex,!1),A&1&&i.set_style(t,"transform",g[0].transform,!1)},i:i.noop,o:i.noop,d(g){g&&i.detach(t),p.d(),d=!1,u()}}}function xu(o,t,e){let{itemLabel:n}=t,{hooks:s}=t,{anchorEnabled:r}=t,{onIconClick:a}=t;function l(){s.emit("onLabelClick",n)}let c;function d(f){i.binding_callbacks[f?"unshift":"push"](()=>{c=f,e(3,c)})}const u=f=>a(n);return o.$$set=f=>{"itemLabel"in f&&e(0,n=f.itemLabel),"hooks"in f&&e(5,s=f.hooks),"anchorEnabled"in f&&e(1,r=f.anchorEnabled),"onIconClick"in f&&e(2,a=f.onIconClick)},o.$$.update=()=>{if(o.$$.dirty&9&&typeof n.render=="function"&&c&&c.children.length===0){const f=n.render(n);f&&c.appendChild(f)}},[n,r,a,c,l,s,d,u]}class Du extends i.SvelteComponent{constructor(t){super(),i.init(this,t,xu,ku,i.safe_not_equal,{itemLabel:0,hooks:5,anchorEnabled:1,onIconClick:2},Eu)}}const{Raycaster:Su,Vector3:kp}=P,Zi=(o,t,e,n)=>{const s=t.clone().sub(e).normalize(),r=new Su;r.set(e,s);const[a]=o.model.intersectRaycaster(r);return a&&a.distance+.01<n};var Xe=(o=>(o.SMALL="small",o.MIDLLE="middle",o.LARGE="large",o.EXTRA_LARGE="x-large",o))(Xe||{});const Lu=(o,t)=>{switch(t){case Xe.SMALL:return Math.ceil(-27.78*o+85);case Xe.MIDLLE:return Math.ceil(-38.9*o+130);case Xe.LARGE:return Math.ceil(-44.44*o+140);case Xe.EXTRA_LARGE:return Math.ceil(-92.59*o+300)}},_u=o=>`translate(${o[0]}px, ${o[1]}px)`;function qi(o){return o.map(t=>j({observerIndex:void 0,visible:!1,isFold:!1},t))}function zu(o){i.append_styles(o,"svelte-gk8s47",".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}")}function Ki(o,t,e){const n=o.slice();return n[30]=t[e],n}function $i(o){let t,e;return t=new Du({props:{itemLabel:o[30],hooks:o[0],anchorEnabled:o[2],onIconClick:o[6]}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s[0]&2&&(r.itemLabel=n[30]),s[0]&1&&(r.hooks=n[0]),s[0]&4&&(r.anchorEnabled=n[2]),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function eo(o,t){let e,n,s,r=t[30].visible&&$i(t);return{key:o,first:null,c(){e=i.empty(),r&&r.c(),n=i.empty(),this.first=e},m(a,l){i.insert(a,e,l),r&&r.m(a,l),i.insert(a,n,l),s=!0},p(a,l){t=a,t[30].visible?r?(r.p(t,l),l[0]&2&&i.transition_in(r,1)):(r=$i(t),r.c(),i.transition_in(r,1),r.m(n.parentNode,n)):r&&(i.group_outros(),i.transition_out(r,1,1,()=>{r=null}),i.check_outros())},i(a){s||(i.transition_in(r),s=!0)},o(a){i.transition_out(r),s=!1},d(a){a&&i.detach(e),r&&r.d(a),a&&i.detach(n)}}}function Mu(o){let t,e=[],n=new Map,s,r,a=o[1];const l=c=>c[30].id;for(let c=0;c<a.length;c+=1){let d=Ki(o,a,c),u=l(d);n.set(u,e[c]=eo(u,d))}return{c(){t=i.element("div");for(let c=0;c<e.length;c+=1)e[c].c();i.attr(t,"class","item-labels-container svelte-gk8s47"),i.add_render_callback(()=>o[12].call(t)),i.set_style(t,"opacity",o[5]?1:0,!1)},m(c,d){i.insert(c,t,d);for(let u=0;u<e.length;u+=1)e[u].m(t,null);s=i.add_resize_listener(t,o[12].bind(t)),r=!0},p(c,d){d[0]&71&&(a=c[1],i.group_outros(),e=i.update_keyed_each(e,d,l,1,c,a,n,t,i.outro_and_destroy_block,eo,null,Ki),i.check_outros()),d[0]&32&&i.set_style(t,"opacity",c[5]?1:0,!1)},i(c){if(!r){for(let d=0;d<a.length;d+=1)i.transition_in(e[d]);r=!0}},o(c){for(let d=0;d<e.length;d+=1)i.transition_out(e[d]);r=!1},d(c){c&&i.detach(t);for(let d=0;d<e.length;d+=1)e[d].d();s()}}}let Tu=11;function ju(o,t,e){const{Raycaster:n,Vector3:s}=P;let{five:r}=t,{modelOcclusionEnable:a}=t,{itemLabels:l}=t,{hooks:c}=t,{displayStrategyType:d}=t,{maxVisibleDistance:u}=t,f=null,h=null,p=(r==null?void 0:r.currentMode)===ee.Five.Mode.Panorama,g,A,b=[],v=!0;const w=(_,B)=>{const O=_.camera.position.clone(),G=new s(B.modelPosition[0],B.modelPosition[1],B.modelPosition[2]),Q=G.distanceTo(O);return u!==void 0&&_.state.mode===ee.Five.Mode.Panorama&&Q>u?!1:Zi(_,G.clone().sub(O).normalize(),O,Q)},y=_=>{const{camera:B,model:O}=r,{x:G,y:Q,z:H}=_.clone().project(B),X=(G+1)/2,Y=(2-(Q+1))/2,oe=Math.abs(H)<1&&[X,Y].every(ce=>ce<1&&ce>=0);return Boolean(oe)},I=(_,B)=>{const O=new s(B.modelPosition[0],B.modelPosition[1],B.modelPosition[2]),G=_.project2d(O),Q=G==null?void 0:G.x,H=G==null?void 0:G.y;return[Q,H]},k=(_,B)=>{const O=B.map(Q=>{if(_.state.panoIndex!==Q.panoIndex)return V(j({},Q),{visible:!1});const H=I(_,Q);Q.name.length*Tu;const X=Lu(Q.modelPosition[1],d),Y=_.currentMode===ee.Five.Mode.Panorama?y(new s(Q.position[0],Q.position[1],Q.position[2])):!0,J=a?w(_,Q):!1,te=Y&&!J;if(!te)return V(j({},Q),{visible:te});b.push(H);const oe=_u(H);return V(j({},Q),{visible:te,transform:oe,strokeLength:X})}),G=O.filter(({visible:Q})=>Q).map(Q=>({itemLabelItem:Q,distance:new s(Q.modelPosition[0],Q.modelPosition[1],Q.modelPosition[2]).clone().distanceTo(_.camera.position)})).sort((Q,H)=>Q.distance-H.distance);return O.map(Q=>{const H=G.findIndex(X=>X.itemLabelItem.id===Q.id);return H!==void 0?V(j({},Q),{zIndex:H*10}):Q})},C=()=>{b=[],e(1,h=k(r,h))},D=()=>{e(5,v=!1),x()},x=Fs(()=>{e(5,v=!0),C()},300),z=()=>{r.once("renderFrame",C)},L=()=>{window.addEventListener("resize",z,!1)},T=()=>{f!==l&&(e(1,h=qi(l)),f=l,C())},R=(_,B)=>{let O=[];for(let Q=0;Q<B.length;Q++){const{position:H,panoIndex:X}=B[Q],Y=_.distanceTo(H);(u===void 0||Y<=u||r.state.mode!==ee.Five.Mode.Panorama)&&O.push({panoIndex:X,obVector:H,distance:Y})}O=O.sort((Q,H)=>Q.distance-H.distance);let G;for(let Q=0;Q<O.length;Q++){const{obVector:H,distance:X,panoIndex:Y}=O[Q];if(!Zi(r,_,H,X)){G=Y;break}}return typeof G=="number"?B[G]:void 0},E=_=>{if(r.state.mode===ee.Five.Mode.Panorama)return;const B=r.work.observers,O=new s().fromArray(_.position),G=R(O,B);if(G&&(_.observerIndex=G.panoIndex),typeof _.observerIndex=="number"){const Q=B[_.observerIndex],H=O.clone().sub(Q.position).normalize(),X={longitude:Math.PI+Math.atan2(H.x,H.z),latitude:Math.acos(H.y/H.length())-Math.PI/2};r.setState(V(j({},X),{mode:ee.Five.Mode.Panorama,panoIndex:_.observerIndex})),r.once("initAnimationEnded",()=>{e(1,h=h.map(Y=>V(j({},Y),{isFold:Y.id!==_.id}))),r.once("cameraUpdate",()=>{e(1,h=h.map(Y=>V(j({},Y),{isFold:!1})))})})}};Z.beforeUpdate(()=>{T()}),Z.onMount(()=>{e(1,h=qi(l)),f=l,C(),L(),r.on("cameraUpdate",D)}),Z.onDestroy(()=>{r.off("cameraUpdate",D),window.removeEventListener("resize",z,!1)});function S(){g=this.clientWidth,A=this.clientHeight,e(3,g),e(4,A)}return o.$$set=_=>{"five"in _&&e(7,r=_.five),"modelOcclusionEnable"in _&&e(8,a=_.modelOcclusionEnable),"itemLabels"in _&&e(9,l=_.itemLabels),"hooks"in _&&e(0,c=_.hooks),"displayStrategyType"in _&&e(10,d=_.displayStrategyType),"maxVisibleDistance"in _&&e(11,u=_.maxVisibleDistance)},[c,h,p,g,A,v,E,r,a,l,d,u,S]}class Bu extends i.SvelteComponent{constructor(t){super(),i.init(this,t,ju,Mu,i.safe_not_equal,{five:7,modelOcclusionEnable:8,itemLabels:9,hooks:0,displayStrategyType:10,maxVisibleDistance:11},zu,[-1,-1])}}function Qu(o){return o.item_labels.map(t=>V(j({},t),{modelPosition:[t.position[0],t.position[1],t.position[2]],observerIndex:void 0}))}const Ru=void 0,Ou=(o,t)=>{var h,p,g,A;const e={container:document.createElement("div"),data:null,enabled:!0,fiveModeEnabled:!0,itemLabels:[],wrapper:null,app:void 0,hooks:new ee.Subscribe,modelOcclusionEnable:(h=t==null?void 0:t.modelOcclusionEnable)!=null?h:!0,onlyVisibleInPanorama:(p=t==null?void 0:t.onlyVisibleInPanorama)!=null?p:!0,displayStrategyType:(g=t==null?void 0:t.displayStrategyType)!=null?g:Xe.SMALL,maxVisibleDistance:(A=t==null?void 0:t.maxVisibleDistance)!=null?A:Ru};e.container.setAttribute("class","item-label-plugin-container"),e.container.style.cssText=`
|
|
519
519
|
position: absolute;
|
|
520
520
|
left: 0;
|
|
521
521
|
top: 0;
|
|
522
522
|
width: 100%;
|
|
523
523
|
height: 100%;
|
|
524
524
|
z-index: 5;
|
|
525
|
-
`,e.container.style.pointerEvents="none";const n=b=>(e.wrapper=b,b.appendChild(e.container),c(),!0),s=b=>{e.itemLabels=Qu(b),c()},r=()=>(e.enabled||(e.enabled=!0,c()),!0),a=()=>(e.enabled&&(e.enabled=!1,c()),!0),l=()=>{u(),e.container.remove()},c=()=>{var b;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(b=e.app)==null||b.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:o,itemLabels:e.itemLabels}):e.app=new Bu({target:e.container,props:{five:o,modelOcclusionEnable:e.modelOcclusionEnable,onlyVisibleInPanorama:e.onlyVisibleInPanorama,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},d=()=>{o.on("modeChange",f),o.once("dispose",l)},u=()=>{o.off("modeChange",f)},f=b=>{if(b!==ee.Five.Mode.Panorama){e.fiveModeEnabled=!1,a();return}o.once("initAnimationEnded",()=>{e.fiveModeEnabled=!0,r()})};return d(),{appendTo:n,load:s,enable:r,disable:a,dispose:l,hooks:e.hooks}},Hu={name:"ItemLabelPlugin",version:0};class Fu extends Xt{constructor(e){super(e);m(this,"state");m(this,"container");m(this,"enabled");this.five=e,this.five.once("dispose",this.dispose),this.enabled=!0,this.state=this.initState()}enable(e){this.enabled=!0,this.updateState(V(j({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(V(j({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(V(j({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(V(j({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const s=j({},this.state);this.state=j(j(j({},this.state),e),n),this.stateChangedCallback(s,n)}get visible(){return this.five.state.mode===ee.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState(V(j({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function Gu(o){i.append_styles(o,"svelte-wpy7pz",'.plugin-DoorLabelPlugin-item.svelte-wpy7pz.svelte-wpy7pz{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity 0.3s ease}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz{position:absolute;top:50%;left:50%;border-radius:0.125rem;background:rgba(0, 0, 0, 0.35);line-height:0.75rem;padding:0.375rem;white-space:nowrap;font-size:0.75rem;font-style:normal;color:white;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform ease 1s, background ease 0.3s, color ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz::after{content:"";display:block;position:absolute;top:-0.0625rem;left:-0.0625rem;bottom:-0.0625rem;right:-0.0625rem;border-radius:0.125rem;border:0.0625rem solid rgba(0, 0, 0, 0);-o-border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;transition:opacity ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(255, 255, 255, 0.5)}.plugin-DoorLabelPlugin-icon.svelte-wpy7pz.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/DoorLabel-icon.de1304ae.svg") no-repeat;background-size:100%;display:inline-block;width:0.625rem;height:0.625rem;margin-left:0.25rem;transform-origin:center}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz{color:#f9eac1}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/arrow.6e8ec00e.svg") no-repeat}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(249, 234, 193, 0.5)}')}function Nu(o){let t,e,n,s,r,a,l,c;return{c(){t=i.element("div"),e=i.element("div"),n=i.element("span"),n.textContent=`${o[8]}`,s=i.space(),r=i.element("i"),i.attr(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),i.attr(r,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),i.attr(e,"class",a=i.null_to_empty(ye.default("plugin-DoorLabelPlugin-cnt",o[0].toward))+" svelte-wpy7pz"),i.attr(e,"style",`transform: ${o[6]||"initial"};pointer-events: ${o[5]?"auto":"none"};opacity: ${o[5]?1:0}`),i.attr(e,"data-camera-toward",o[7]),i.attr(t,"style",`left: ${o[3]||0}%;top: ${o[4]||0}%;opacity: ${o[5]?1:0}`),i.attr(t,"class","plugin-DoorLabelPlugin-item svelte-wpy7pz")},m(d,u){i.insert(d,t,u),i.append(t,e),i.append(e,n),i.append(e,s),i.append(e,r),o[10](t),l||(c=i.listen(e,"click",o[9]),l=!0)},p(d,[u]){u&1&&a!==(a=i.null_to_empty(ye.default("plugin-DoorLabelPlugin-cnt",d[0].toward))+" svelte-wpy7pz")&&i.attr(e,"class",a)},i:i.noop,o:i.noop,d(d){d&&i.detach(t),o[10](null),l=!1,c()}}}function Wu(o,t,e){let{props:n}=t,{onClick:s}=t,r,{left:a,top:l,inSight:c,transform:d,panoIndex:u,cameraToward:f,name:h}=n,p=0;const g=()=>{if(!a||!l||!c||!r)return;const v=r.current.clientWidth/window.innerWidth*100,w=r.current.clientHeight/window.innerHeight*100;if(a<=v/2||a>=100-v/2||l<=w/2||l>=100-w/2)return;u!==p&&(console.log("panoDoorLabelPlugin",u,"\u89E6\u53D1\u57CB\u70B9"),p=u)},A=v=>{s&&s()};function b(v){i.binding_callbacks[v?"unshift":"push"](()=>{r=v,e(2,r)})}return o.$$set=v=>{"props"in v&&e(0,n=v.props),"onClick"in v&&e(1,s=v.onClick)},g(),[n,s,r,a,l,c,d,f,h,A,b]}class Xu extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Wu,Nu,i.safe_not_equal,{props:0,onClick:1},Gu)}}function Yu(o,t){const e=Math.abs(o.top+o.height/2-t.top-t.height/2),n=Math.abs(o.left+o.width/2-t.left-t.width/2),s=(o.height+t.height)/2,r=(o.width+t.width)/2;return!(e>s&&n>r)}function Uu(o){const{camera:t}=o,e=t.getWorldDirection(new M.Vector3);let n=Math.atan(e.z/e.x)*180/Math.PI,s="";return e.x<0&&(n+=180),n<0&&(n+=360),n>315||n<=45?s="right":n>45&&n<=135?s="back":n>135&&n<=225?s="left":n>225&&n<=315&&(s="forward"),s}function Vu(o,t){return Math.sqrt(Math.pow(o.z-t.z,2)+Math.pow(o.x-t.x,2))}function Ju(o){const t=Math.PI/4;return o>-t&&o<=t?"left":o>t*3||o<=-t*3?"right":o>-t*3&&o<=-t?"forward":o>t&&o<=t*3?"back":""}const Zu={userAction:!0};class qu extends Fu{constructor(e){super(e);m(this,"MinVisibledistance",1.8);m(this,"MaxVisibledistance",5);m(this,"OffsetHeight",-1.3);m(this,"rooms");m(this,"floorplanServerData");m(this,"doorLabelItems");m(this,"visibleLabelMap",new Map);m(this,"labelItems",[]);m(this,"doorLabels");m(this,"roomObservers");m(this,"loadData",(e,n)=>{n&&(this.MaxVisibledistance=n.MaxVisibledistance,this.MinVisibledistance=n.MinVisibledistance,this.OffsetHeight=n.OffsetHeight),this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(s=>{s.$destroy()}),this.labelItems=[],this.doorLabels=[],this.doorLabelItems=[],this.floorplanServerData=e,this.five.once("panoArrived",()=>{console.log("doorplugin","panoArrived"),this.initData()})});m(this,"initRoomObservers",()=>{var r,a;const e=this.floorplanServerData.computed_data.floor_datas||[],s=(((a=(r=this.five)==null?void 0:r.work)==null?void 0:a.observers)||[]).map(l=>{const c=l.panoIndex,d=l.floorIndex,u=e==null?void 0:e.find(f=>f.floor_index===d);if(u){const f=u.rooms.find(h=>h.observer_indexs.includes(c));if(f)return{panoIndex:c,floorIndex:d,name:f.name}}}).filter(Boolean);this.roomObservers=s});m(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});m(this,"fixDoorVisibleAndPosition",()=>{this.initRoomObservers();const{panoIndex:e}=this.five;if(!this.visible||this.five.model.empty||e===null||!this.roomObservers.find(l=>l.panoIndex===e))return;const n=this.roomObservers.find(l=>l.panoIndex===e),r=this.five.work.observers.find(l=>l.panoIndex===e).position.clone(),a=(()=>{if(this.visibleLabelMap.has(e))return this.visibleLabelMap.get(e);{const l=[];return this.doorLabels.forEach((c,d)=>{if(c.roomName===n.name)return;const u=c.position.clone(),f=u.distanceTo(r);if(f<this.MinVisibledistance||f>this.MaxVisibledistance)return;const h=new M.Raycaster,p=u.clone().sub(r).normalize();h.set(r,p);const[g]=this.five.model.intersectRaycaster(h);g&&g.distance+.1<f||l.push(d)}),this.visibleLabelMap.set(e,l),l}})();this.labelItems.forEach((l,c)=>{l.visible=a.includes(c)}),this.fixDoorPosition()});m(this,"fixDoorPosition",()=>{const{panoIndex:e,camera:n}=this.five;if(e===null)return;if(this.five.currentMode!=="Panorama")return this.hideAllLabels();const s=this.five.getElement(),r=s.clientWidth,a=s.clientHeight,l=n.getWorldDirection(new M.Vector3),c=[],d=[...this.labelItems];if(d.forEach((u,f)=>{if(u.visible){const h=n.position.distanceTo(u.position),p=u.position.clone().add(new M.Vector3(0,this.OffsetHeight,0)),A=p.clone().sub(n.position).normalize().angleTo(l),b=p.clone().project(n),v=(b.x+1)/2.2*100,w=(-b.y+1)/2.2*100,y=v>=0&&v<=100&&w>=0&&w<=100&&h>this.MinVisibledistance&&h<=this.MaxVisibledistance;u.left=v,u.top=w,u.inSight=y&&A<Math.PI/2,u.cameraToward=Uu(this.five),y?c.push({disFromCameraToLabel:h,left:v,top:w,index:f}):u.transform="translate(-50%, -50%)"}else u.inSight=!1}),c.length>1){let u=0;c.sort((f,h)=>h.disFromCameraToLabel-f.disFromCameraToLabel);for(let f=1;f<c.length;f++){const{index:h,left:p,top:g}=c[f-1],{index:A,left:b,top:v}=c[f],w=this.container.children[h],y=this.container.children[A];if(!w||!y)return;const I={left:r*p/100,top:a*g/100,width:w.children[0].clientWidth,height:w.children[0].clientHeight},k={left:r*b/100,top:a*v/100,width:y.children[0].clientWidth,height:y.children[0].clientHeight};Yu(I,k)&&(u++,d[h].transform=`translate(-50%, ${(u-1)*100-50}%)`,d[A].transform=`translate(-50%, ${u*100-50}%)`)}}this.labelItems=d,this.render()});m(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:s}=this.five;let r,a,l=1/0;for(let c=0;c<s.observers.length;c++){if(this.roomObservers[c].name!==e)continue;const u=s.observers[c].standingPosition,f=n.distanceTo(u);f<l&&(r=c,a=u.clone().sub(n).normalize(),l=f)}if(a!==null&&r!==null){const c={};if(l>0){const u=new M.Vector3(0,0,-1),f=a.clone(),h=new M.Quaternion;h.setFromUnitVectors(u,f);const p=new M.Euler;p.setFromQuaternion(h,"YXZ"),c.longitude=p.y}this.five.emit("wantsToMoveToPano",r,{},!0)||this.five.moveToPano(r,{longitude:c.longitude})}});m(this,"initData",()=>{var r;this.doorLabels=[];const e=this.five.panoIndex,n=this.floorplanServerData.computed_data.observers[e].floor_index,s=n!==void 0&&((r=this.floorplanServerData.computed_data.floor_datas[n])==null?void 0:r.rooms);this.rooms=s,this.rooms&&this.rooms.length>0&&this.rooms.forEach(a=>{var d;const l=(d=this.floorplanServerData.computed_data.doors)==null?void 0:d.filter(u=>!!(u&&u.name===a.name)),c=this.five.work.observers.filter((u,f)=>!!a.observer_indexs.find(h=>h===f));l&&l.forEach(u=>{const f=u.position;let h=1/0,p;c.forEach(A=>{const b=A.standingPosition,v={x:b.x,y:b.y,z:b.z},w=Vu(f,v);w<h&&(h=w,p=v)}),p&&(f.y=p.y+.01);const g=new M.Vector3(f.x,f.y,f.z);g.add(new M.Vector3(-.2,1.8,0).applyEuler(new M.Euler(0,u.rad,0))),this.doorLabels.push({roomName:a.name,name:u.name,position:g,toward:Ju(u.rad)})})}),this.labelItems=this.doorLabels.map(a=>V(j({},a),{left:0,top:0,visible:!1,inSight:!1,transform:"",cameraToward:""})),console.log("doorplugin","labelItems",this.labelItems),this.five.on("wantsToMoveToPano",this.hideAllLabels),this.five.on("modelLoaded",this.fixDoorVisibleAndPosition),this.five.on("panoArrived",this.fixDoorVisibleAndPosition),this.five.on("initAnimationEnded",this.fixDoorPosition),this.five.on("cameraUpdate",this.fixDoorPosition),this.five.on("mouseWheel",this.fixDoorPosition),this.five.on("pinchGesture",this.fixDoorPosition),this.fixDoorVisibleAndPosition()})}stateChangedCallback(e,n){if(this.hooks.hasListener("stateChange")){const s={state:this.state,prevState:e,userAction:n?n.userAction:Zu.userAction};this.hooks.emit("stateChange",s)}}render(){if(!this.enabled){this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(e=>{e==null||e.$destroy()}),this.doorLabels=void 0;return}this.doorLabelItems&&this.doorLabelItems.forEach(e=>{e.$destroy()}),this.doorLabelItems=[],this.labelItems.forEach(e=>{this.doorLabelItems.push(new Xu({target:this.container,props:{props:e,onClick:()=>{this.onClick(e.name,e.position)}}}))})}initState(){return{enabled:!0,visible:!0}}dispose(){this.five&&(this.five.off("wantsToMoveToPano",this.hideAllLabels),this.five.off("modelLoaded",this.fixDoorVisibleAndPosition),this.five.off("panoArrived",this.fixDoorVisibleAndPosition),this.five.off("initAnimationEnded",this.fixDoorPosition),this.five.off("cameraUpdate",this.fixDoorPosition),this.five.off("mouseWheel",this.fixDoorPosition),this.five.off("pinchGesture",this.fixDoorPosition),super.dispose())}}const Ku=o=>new qu(o),$u=2,eh=3,th=3,nh=2;function ih(o,t){var a,l,c;if(o.length<2)return console.warn("positionList length must be greater than 1"),[];const e=(a=t==null?void 0:t.unitWidth)!=null?a:.5,n=(l=t==null?void 0:t.unitHeight)!=null?l:.5,s=(c=t==null?void 0:t.skipPanoIndexMesh)!=null?c:!1,r=new P.CatmullRomCurve3(o,!1,"catmullrom",1);if(s){const d=Math.ceil(r.getLength()/n*1.5),u=r.getPoints(d),f=[];let h=0;const p=o;return p.forEach((g,A)=>{let b=0,v=99999999;u.forEach((C,D)=>{const x=C.distanceTo(g);x<v&&(b=D,v=x)});const w=u[b+1],y=w==null?void 0:w.distanceTo(g),I=u[b-1],k=I==null?void 0:I.distanceTo(g);if(b>h&&b-h>1){let C=b;I!==void 0&&k>.8&&(C=b+1),I!==void 0&&k>.2&&k<.3?C=b:v>.2&&v<.3&&(C=b+1);let D=h;if(w!==void 0&&y>.2&&y<.3?D=h+1:v>.2&&v<.3&&(D=h),u[D]&&u[D+1]){const _=p[A-1];if(_)if(_.equals(u[D]))D+=1;else{const T=new M.Vector3().subVectors(u[D+1],u[D]),H=new M.Vector3().subVectors(_,u[D]);T.angleTo(H)<Math.PI/2&&(D+=1)}}if(C<D||C-D<=1)return;const x=u.slice(D,C),z=to(x,e,n);f.push(z),h=b}}),f}else{const d=Math.ceil(r.getLength()),u=r.getPoints(d);return[to(u,e,n)]}}function to(o,t,e){const n=t/2,s=e/t,r=o.length,a=Ir.default(o.map(v=>[v.x,v.z])),c=(o.length-1)*$u*eh,d=2*r,u=d*th,f=d*nh,h=new Uint32Array(c),p=new Float32Array(u),g=new Float32Array(f);o.forEach((v,w)=>{});let A=0;for(let v=0;v<o.length;v++){const[w,y]=a[v][0],I=o[v],{x:k,y:C,z:D}=I,x=new M.Vector3(k+w*n,C+.05,D+y*n);p[v*6+0]=x.x,p[v*6+1]=x.y,p[v*6+2]=x.z;const z=new M.Vector3(k-w*n,C+.05,D-y*n);p[v*6+3]=z.x,p[v*6+4]=z.y,p[v*6+5]=z.z,A+=v>0?o[v-1].clone().sub(o[v]).length():0;const _=A/t/s;g[v*4+0]=0,g[v*4+1]=_,g[v*4+2]=1,g[v*4+3]=_,v!==o.length-1&&(h[v*6+0]=v*2+0,h[v*6+1]=v*2+2,h[v*6+2]=v*2+1,h[v*6+3]=v*2+2,h[v*6+4]=v*2+3,h[v*6+5]=v*2+1)}const b=new P.BufferGeometry;return b.setAttribute("position",new P.BufferAttribute(p,3)),b.setAttribute("uv",new P.BufferAttribute(g,2)),b.setIndex(new P.BufferAttribute(h,1)),b}function oh(o){const t=new P.TextureLoader().load(o.textureUrl);return t.wrapS=t.wrapT=P.RepeatWrapping,t.encoding=P.sRGBEncoding,new P.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function sh(o){return!Ue(o)}function Ue(o){return o!=null}const Gs="v1.0.1",Ns="GuideLinePlugin",bn=`${Ns}@${Gs}`,no=o=>`${bn}--${o}`;class Ws extends Ze{constructor(e,n){super(e,n);m(this,"state",{visible:!1,enabled:!0,disposed:!1});m(this,"data");m(this,"linesGroup");m(this,"disposedErrorLog",()=>{console.error(`${bn} is disposed`)});m(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${Ns}_DEBUG__`]:this})}load(e,n,s=!0){return F(this,null,function*(){const r=this.data?JSON.parse(JSON.stringify(this.data)):void 0,a=yield this.formatData(e);this.hooks.emit("dataChange",a,r),this.data=a,this.linesGroup&&this.five.scene.remove(this.linesGroup);const l=this.getLinesGroup(a.routes);!l||(this.linesGroup=l,yield this.waitFiveModelLoaded(),this.five.scene.add(l),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n),this.five.needsRender=!0,this.hooks.emit("dataLoaded",a),console.log(`${bn} loaded`,a))})}formatData(e){return F(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e})}show(e){return F(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return F(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){var r;if(this.state.disposed)return this.disposedErrorLog();const s=j({},this.state);this.state=j(j({},this.state),e),e.disposed!==void 0&&e.disposed!==s.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),Ce(s,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:(r=n==null?void 0:n.userAction)!=null?r:!0}),this.five.needsRender=!0)}handleEnable(e,n=!0){this.linesGroup&&(e?(this.five.scene.add(this.linesGroup),this.actionWhenEnabled(()=>this.hooks.emit("enable",{userAction:n}))):(this.five.scene.remove(this.linesGroup),this.hooks.emit("disable",{userAction:n})))}handleVisible(e,n=!0){this.linesGroup&&(e?(this.linesGroup.visible=!0,this.actionWhenEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.linesGroup.visible=!1,this.actionWhenEnabled(()=>this.hooks.emit("hide",{userAction:n}))))}handleDispose(){this.linesGroup&&this.five.scene.add(this.linesGroup)}getLinesGroup(e){const n=e.map(this.getLine.bind(this)).filter(Ue),s=new P.Group;if(s.name=no("route-group"),n.length!==0)return s.add(...n),s}getLine(e){var l,c,d,u;const n=new P.Group,s=e.panoIndexList.map(f=>{var h;return(h=this.five.work.observers[f])==null?void 0:h.standingPosition}).filter(Ue),r=ih(s,{skipPanoIndexMesh:(l=e.skipPanoIndexMesh)!=null?l:!0,unitWidth:(c=e.unitWidth)!=null?c:.6,unitHeight:(d=e.unitHeight)!=null?d:.4});if(!r)return;const a=oh({textureUrl:(u=e.arrowTextureUrl)!=null?u:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return r.forEach(f=>{const h=new P.Mesh(f,a);h.name=no("route-line-mesh"),n.add(h)}),n}waitFiveModelLoaded(){return F(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}m(Ws,"lasestVersion",Gs);const Xs=(o,t)=>new Ws(o,t);function io(o){const t=Math.abs(Math.cos(o.latitude));return new P.Vector3(-Math.sin(o.longitude)*t,-Math.sin(o.latitude),-Math.cos(o.longitude)*t)}function rh(o,t){const e=io(o),n=io(t);return e.angleTo(n)}const ah=o=>F(exports,null,function*(){try{o().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),Pt=Math.PI*2;function lh(o){return o>=0&&o<Pt?o:(o%Pt+Pt)%Pt}function ch(o){return{longitude:lh(-Math.atan2(o.x,-o.z)),latitude:-Math.asin(o.y/1)}}function dh(o,t,e,n){const s=-o/e,r=o;return s*n+r}function uh(o){return new Promise(t=>{setTimeout(()=>{t()},o)})}const Ys="v1.0.6",Us="CruisePlugin",Jt=`${Us}@${Ys}`,oo=()=>{console.error(`${Jt} is disposed`)},hh=()=>{console.warn(`${Jt} is disabled`)},fh=()=>{console.error(`${Jt} is disabled`)},an=new Map;class Bn extends Ze{constructor(e,n){super(e,n);m(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});m(this,"data");m(this,"config");m(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});m(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Us}_DEBUG__`]:this});const s=this.setFiveLinearUpdateCamera.bind(this),r=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",s),this.hooks.on("broke",r),this.hooks.on("end",r),this.hooks.on("pause",r),this.privateState.disposers.push(()=>{this.hooks.off("play",s),this.hooks.off("broke",r),this.hooks.off("end",r),this.hooks.off("pause",r)})}load(e,n,s){return F(this,null,function*(){var u,f,h,p,g;if(this.state.disposed)return oo();this.privateState.fiveOriginGetProgress||(f=(u=this.five.controller)==null?void 0:u.cameraMotion)!=null&&f.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(p=(h=this.five.controller)==null?void 0:h.cameraMotion)==null?void 0:p.getProgress),this.clear();const r=this.data?JSON.parse(JSON.stringify(this.data)):void 0,a=yield this.formatData(e);this.data=a,this.hooks.emit("dataChange",a,r);let l=[],c;const d=this.data.keyframes.filter(A=>A.data.panoIndex!==void 0);d.filter((A,b)=>{var v;return A.data.panoIndex!==((v=d[b-1])==null?void 0:v.data.panoIndex)}).map(A=>A.data.panoIndex).forEach(A=>{var v,w;const b=(v=this.five.work.observers[A])==null?void 0:v.floorIndex;if(b!==void 0)if(c===b){const y=l.length-1;l[y]=[...(w=l[y])!=null?w:[],A]}else{c=b;const y=l.length;l[y]=[A]}}),this.GuideLine||(this.GuideLine=Xs(this.five,this.config)),(g=this.GuideLine)==null||g.load({routes:l.map(A=>({panoIndexList:A}))}),this.setState({playing:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing),this.changeSpeed(this.state.speed),n&&this.setState(n,{userAction:s}),console.log(`${Jt} loaded`,a),this.hooks.emit("dataLoaded",a)})}play(e){this.setState({playing:!0},e)}playFrom(e){const{index:n,id:s,userAction:r}=e;this.state.playing&&this.setState({playing:!1},{userAction:r}),this.setState({playing:!0},{userAction:r,playFromIndex:n,playFromId:s})}playFromStart(e){return this.playFrom(V(j({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return F(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return F(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){var r;if(this.state.disposed)return oo();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return fh();const s=j({},this.state);this.state=j(j({},this.state),e),e.disposed!==void 0&&e.disposed!==s.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),e.playing!==void 0&&e.playing!==s.playing&&this.changePlayState(e.playing,n),e.speed!==void 0&&e.speed!==s.speed&&this.changeSpeed(e.speed,n==null?void 0:n.userAction),Ce(s,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:(r=n==null?void 0:n.userAction)!=null?r:!0})}formatData(e){return F(this,null,function*(){this.five.work||(yield this.waitFiveLoaded());const n=this.five.work.observers,s=(()=>{const r=e;return typeof r=="object"&&r!==null&&r.version&&r.data?r.data:r})();if(s.keyframes)return{keyframesId:ue(),keyframes:s.keyframes.map((r,a)=>{var d;const l=s.keyframes[a+1],c=(()=>!l||l.start===void 0||r.end===void 0?0:l.start-r.end)();return j({id:(d=r.uuid)!=null?d:ue(),moveIndex:a,stay:c,index:a},r)})};if(s.panoIndexList){let r=[];const{moveEffect:a,moveToFirstPanoEffect:l}=s;return this.privateState.moveToFirstPanoEffect=l,s.panoIndexList.forEach((c,d)=>{const u=(()=>{var A,b,v,w;const f=s.panoIndexList.slice(d).find(y=>y!==c);if(f===void 0)return;const h=(A=n[c])==null?void 0:A.position,p=(b=n[f])==null?void 0:b.position;if(!p||!h||((v=n[c])==null?void 0:v.floorIndex)!==((w=n[f])==null?void 0:w.floorIndex))return;const g=new P.Vector3().subVectors(p,h);return ch(g)})();s.moveType===void 0||s.moveType==="justMove"?r.push({moveIndex:d,stay:s.stay,data:j({effect:"Move",panoIndex:c,moveEffect:a},u!=null?u:{})}):s.moveType==="moveAndRotate"&&(r.push({moveIndex:d,stay:s.stay,data:{effect:"Move",panoIndex:c,moveEffect:a}}),u&&r.push({moveIndex:d,stay:s.stay,data:j({effect:"Rotate",panoIndex:c},u)}))}),{keyframesId:ue(),keyframes:r.map((c,d)=>j({id:ue(),index:d},c))}}else throw new Error("format error: data no keyframes or no panoIndexList")})}handleEnable(e,n=!0){var s,r;e?((s=this.GuideLine)==null||s.enable(),this.hooks.emit("enable",{userAction:n})):((r=this.GuideLine)==null||r.disable(),this.changePlayState(!1,{userAction:n}),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){var s,r;e?((s=this.GuideLine)==null||s.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):((r=this.GuideLine)==null||r.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}changePlayState(e,n){this.actionIfStateIsEnabled(()=>{var s;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(s=n==null?void 0:n.userAction)!=null?s:!0})}),e?this.handlePlay(n):this.handlePause(n),this.state.playing=e}handlePlay(e){return F(this,null,function*(){var p;const{data:n,state:s,privateState:r,hooks:a}=this;if(r.playing||!(n!=null&&n.keyframes)||(n==null?void 0:n.keyframes.length)===0)return;const l=ue();r.playId=l,r.playing=!0,r.broke=!1;const c=n.keyframes,d=this.getPauseData();(e==null?void 0:e.notEmitEvent)!==!0&&a.emit("play",{userAction:(p=e==null?void 0:e.userAction)!=null?p:!0});let u=!1;const h=yield(()=>F(this,null,function*(){var g,A;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(g=this.data)==null?void 0:g.keyframes.findIndex(b=>b.id===e.playFromId);if(d!=null&&d.keyframeId){const b=(A=this.data)==null?void 0:A.keyframes.find(v=>v.id===d.keyframeId);if(d!=null&&d.fiveState&&(yield this.move(d.fiveState,{moveEffect:r.moveToFirstPanoEffect})),b){if(b.data.effect==="Move")return b.index;if(b.data.effect==="Rotate"){const v=d.duration!==void 0?d.duration*(1-d.playedProgress):void 0;return yield this.playKeyframe(b,{duration:v}),u=!0,b.index+1}}}}))();this.clearPauseData();for(const g of c){if(r.broke||!s.playing||!r.playing||l!==r.playId)return;if(!(h!==void 0&&g.index<h))try{a.emit("playIndexChange",g.index,g),yield this.playKeyframe(g,{moveEffect:u===!1?r.moveToFirstPanoEffect:void 0,duration:800}),g.stay&&(yield uh(g.stay)),u===!1&&(u=!0)}catch(A){return Promise.resolve("broke")}}s.playing&&l===r.playId&&(this.setState({playing:!1},{userAction:!1}),a.emit("end"),this.clearPauseData())})}handlePause(e){var a;const{state:n,privateState:s,hooks:r}=this;n.playing=!1,s.playing!==!1&&(s.playing=!1,this.setPauseData(),s.broke||this.forceInteruptUpdateCamera(),(e==null?void 0:e.notEmitEvent)!==!0&&r.emit("pause",{userAction:(a=e==null?void 0:e.userAction)!=null?a:!0}))}playKeyframe(e,n){return F(this,null,function*(){var r;const{privateState:s}=this;return((r=this.privateState.currentPlayKeyframe)==null?void 0:r.keyframe.id)!==e.id&&(this.privateState.currentPlayKeyframe={keyframe:e}),s.currentPlayQueue.push(this.getPlayPromise(e,n)),this.actionPromiseQueue()})}addInterruptListener(e){const n=()=>{this.privateState.modeChanging||e()},s=e;return this.five.once("gesture",s),this.five.once("wantsChangeMode",n),()=>{this.five.off("gesture",s),this.five.once("wantsChangeMode",n)}}getPlayPromise(e,n){return F(this,null,function*(){var r;const s=e.data;if((r=n==null?void 0:n.duration)!=null||e.start!==void 0&&e.end!==void 0&&e.end-e.start,!!s)return new Promise((a,l)=>{let c=!1;this.addInterruptListener(()=>{if(!c)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),c=!0,l(new Error("play is interupted"))});try{if(c)return;const d=()=>{a(),c=!0};switch(s.effect){case"Move":this.move(s,n).then(d);break;case"Rotate":this.rotate(s,n).then(d);break;default:this.rotate(s,n).then(d)}}catch(d){}})})}actionPromiseQueue(){return F(this,null,function*(){const{privateState:e}=this;return new Promise((n,s)=>{if(e.currentPlayQueue.length===0){n();return}const r=e.currentPlayQueue.shift();if(!r){n();return}r.then(n,s)}).then(()=>e.currentPlayQueue.length===0?Promise.resolve():this.actionPromiseQueue())})}move(e,n){return F(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode(e);else if(e.panoIndex!==this.five.panoIndex)yield this.changePano(e,n);else return Promise.resolve()})}rotate(e,n){return F(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return yield this.changePano(e,n);yield this.updateCamera(e,n==null?void 0:n.duration)})}updateCamera(e,n=800){return F(this,null,function*(){const{five:s,privateState:r,state:a}=this;let l=n;const c=(()=>{var h,p;const u=(h=a.config)==null?void 0:h.speedConfig,f=(p=e.rotateSpeed)!=null?p:u==null?void 0:u.rotateSpeed;if((u==null?void 0:u.rotateSpeedUnit)===void 0)return f;if(f!==void 0)return u.rotateSpeedUnit==="rad/ms"?f:f/1e3})();if(c){const u=this.five.getCurrentState();l=rh(u,e)/c}r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=l);const d=this.getSpeededDuration(l);return new Promise(u=>{ah(()=>s.updateCamera(e,d)),setTimeout(()=>u(),d)})})}changePano(e,n){return F(this,null,function*(){var f;const{five:s,privateState:r,state:a}=this;if(typeof e.panoIndex!="number"||e.panoIndex===s.panoIndex)return;s.getCurrentState().mode;const l=s.getCurrentState().mode!=="Panorama";l&&(this.privateState.modeChanging=!0);let c=(f=n==null?void 0:n.duration)!=null?f:800;const d=(()=>{var g,A;const h=(g=a.config)==null?void 0:g.speedConfig,p=(A=e.moveSpeed)!=null?A:h==null?void 0:h.moveSpeed;if((h==null?void 0:h.moveSpeedUnit)===void 0)return p;if(p!==void 0)return h.moveSpeedUnit==="m/ms"?p:p/1e3})();if(d&&typeof s.panoIndex=="number"&&typeof e.panoIndex=="number"){const h=s.work.observers[s.panoIndex].position,p=s.work.observers[e.panoIndex].position;c=h.distanceTo(p)/d}r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=c);const u=this.getSpeededDuration(c);yield new Promise(h=>{var p,g,A;s.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:u,effect:(A=(g=n==null?void 0:n.moveEffect)!=null?g:(p=this.state.config)==null?void 0:p.moveEffect)!=null?A:e.moveEffect,moveCancelCallback:()=>h(),moveEndCallback:()=>h()}),l&&s.once("panoArrived",()=>h())}),l&&(this.privateState.modeChanging=!1)})}changeSpeed(e,n=!0){const{state:s,privateState:r,hooks:a}=this,{currentPlayKeyframe:l}=r;if(a.emit("speedChange",e,{userAction:n}),s.playing&&l)try{const c=l.originDuration!==void 0?l.originDuration*(1-this.getProgress()):void 0,d=this.playKeyframe(l.keyframe,{duration:c});r.currentPlayQueue.push(d)}catch(c){}}getSpeededDuration(e){return e/this.state.speed}getProgress(){return this.five.controller.cameraMotion.progress}changeMode(e,n){return F(this,null,function*(){e.mode&&e.mode!==this.five.currentMode&&(this.privateState.modeChanging=!0,console.log("this.privateState.modeChanging",this.privateState.modeChanging),yield this.five.changeMode(e.mode,e,n),this.privateState.modeChanging=!1)})}forceInteruptUpdateCamera(){this.five.updateCamera({},0)}getPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return an.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,s,r;if((e=this.data)!=null&&e.keyframesId)return an.set((n=this.data)==null?void 0:n.keyframesId,{keyframeId:(s=this.privateState.currentPlayKeyframe)==null?void 0:s.keyframe.id,fiveState:this.five.getCurrentState(),duration:(r=this.privateState.currentPlayKeyframe)==null?void 0:r.originDuration,playedProgress:this.getProgress()})}clearPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return an.delete((n=this.data)==null?void 0:n.keyframesId)}clear(){this.clearPauseData(),this.privateState.currentPlayKeyframe=null}handleDispose(){var e,n;this.setState({playing:!1}),this.clearPauseData(),this.clear(),(e=this.GuideLine)==null||e.dispose(),this.GuideLine=void 0,(n=this.privateState.disposers)==null||n.forEach(s=>s==null?void 0:s())}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&hh()}waitFiveLoaded(){return F(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}setFiveLinearUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=e=>{const n=this.five.controller.cameraMotion,s=e-n.startTime;return s<0?0:s>=n.duration?1:1-dh(1,n.startVelocity,n.duration,s)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}m(Bn,"PluginVersion",Ys);const mh=o=>new Bn(o);function ph(o,t){t.forEach(e=>{const n=new P.SphereGeometry(.02,16,16),s=[],r=[new P.MeshBasicMaterial({color:16776960}),new P.MeshBasicMaterial({color:16711935}),new P.MeshBasicMaterial({color:16711680}),new P.MeshBasicMaterial({color:65535})];if(e.position.length===4)e.position.forEach((a,l)=>{const c=r[l],d=new P.Mesh(n,c);d.position.copy(De(a)),s.push(d)});else{const a=r[0],l=new P.Mesh(n,a);l.position.copy(De(e.position)),s.push(l)}s.forEach(a=>{a.material.depthTest=!1,o.scene.add(a)})})}const re=o=>o;function Vs(o){if(o.length<3)return;const t=o.map(ct),e=t[1].clone().sub(t[0]),n=t[2].clone().sub(t[1]);return e.cross(n)}function It(o){if(Array.isArray(o)&&o.length===4){const t=o.map(ct);return fs(t[0],t[2])}else return ct(o)}function kt(o,t){if(o===void 0)return;const{min:e,max:n}=t!=null?t:{};if(!(e===void 0&&n===void 0))return!(typeof n=="number"&&n<o||typeof e=="number"&&e>o)}function gh(o,t){o.model.loaded?t():o.once("modelLoaded",()=>t())}function Ah(o,t,e){const s=new P.Plane().setFromNormalAndCoplanarPoint(e,t),r=t.clone().sub(o).cross(new P.Vector3(0,1,0)).setLength(.01),a=new P.Vector3(0,.01,0);return[t.clone().sub(r).sub(a),t.clone().add(r).sub(a),t.clone().add(r).add(a),t.clone().sub(r).add(a)].map(c=>s.projectPoint(c,new P.Vector3))}const so=(o,t=1e3/60)=>{let e=null;const n=o;return(...r)=>{e&&clearTimeout(e),e=setTimeout(()=>{n==null||n(...r),e&&clearTimeout(e),e=null},t)}};function vh(o,t=200){let e;return function(...n){e||(o.apply(this,n),e=setTimeout(function(){e=null},t))}}function bh(o,t){const[e,n]=t;if(e>=n||n<=1||e<=1)return-1;const s={},r=a=>(s[a]||(s[a]=o(a)),s[a]);for(let a=e;a<n;a++){const l=r(a),c=r(a-1);if(l<c)return a}return-1}function ro(o,t){if(!t||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",o),unobserve:()=>window.removeEventListener("resize",o)};{const e=new ResizeObserver(o);return{observe:()=>e.observe(t),unobserve:()=>e.unobserve(t)}}}var Ae=(o=>(o.Two="2D",o.Three="3D",o))(Ae||{}),fe=(o=>(o.PointTag="PointTag",o.PlaneTag="PlaneTag",o))(fe||{}),ge=(o=>(o.Audio="Audio",o.Text="Text",o.ImageText="ImageText",o.Link="Link",o.Marketing="Marketing",o.MediaPlane="MediaPlane",o.Custom="Custom",o))(ge||{}),Ot=(o=>(o.VrLink="vr",o.NormalLink="normal",o))(Ot||{});function yh(o){i.append_styles(o,"svelte-1omzoh4",".straight-line.svelte-1omzoh4{display:block;width:100%;height:100%;overflow:visible}")}function ao(o){let t,e,n,s;return{c(){t=i.svg_element("path"),i.attr(t,"fill","none"),i.attr(t,"stroke","url(#"+o[4]+")"),i.attr(t,"stroke-width","1"),i.attr(t,"d","M0 0.5 L 148 0.5")},m(r,a){i.insert(r,t,a),s=!0},p(r,a){o=r},i(r){s||(r&&i.add_render_callback(()=>{n&&n.end(1),e=i.create_in_transition(t,me.draw,{duration:o[1],delay:o[0]}),e.start()}),s=!0)},o(r){e&&e.invalidate(),r&&(n=i.create_out_transition(t,me.draw,{duration:o[1],delay:o[2]})),s=!1},d(r){r&&i.detach(t),r&&n&&n.end()}}}function wh(o){let t,e,n,s,r,a=o[3]&&ao(o);return{c(){t=i.svg_element("svg"),e=i.svg_element("defs"),n=i.svg_element("linearGradient"),s=i.svg_element("stop"),r=i.svg_element("stop"),a&&a.c(),i.attr(s,"offset","25%"),i.attr(s,"stop-color","white"),i.attr(s,"stop-opacity","1"),i.attr(r,"offset","100%"),i.attr(r,"stop-color","white"),i.attr(r,"stop-opacity","0.5"),i.attr(n,"id",o[4]),i.attr(n,"gradientUnits","userSpaceOnUse"),i.attr(t,"class","straight-line svelte-1omzoh4"),i.attr(t,"viewBox","0 0 148 1"),i.attr(t,"preserveAspectRatio","none")},m(l,c){i.insert(l,t,c),i.append(t,e),i.append(e,n),i.append(n,s),i.append(n,r),a&&a.m(t,null)},p(l,[c]){l[3]?a?(a.p(l,c),c&8&&i.transition_in(a,1)):(a=ao(l),a.c(),i.transition_in(a,1),a.m(t,null)):a&&(i.group_outros(),i.transition_out(a,1,1,()=>{a=null}),i.check_outros())},i(l){i.transition_in(a)},o(l){i.transition_out(a)},d(l){l&&i.detach(t),a&&a.d()}}}function Ch(o,t,e){let{inDelay:n=0}=t,{duration:s=0}=t,{outDelay:r=0}=t,{unfolded:a}=t;const l=ue();return o.$$set=c=>{"inDelay"in c&&e(0,n=c.inDelay),"duration"in c&&e(1,s=c.duration),"outDelay"in c&&e(2,r=c.outDelay),"unfolded"in c&&e(3,a=c.unfolded)},[n,s,r,a,l]}class Js extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Ch,wh,i.safe_not_equal,{inDelay:0,duration:1,outDelay:2,unfolded:3},yh)}}function Eh(o){i.append_styles(o,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function lo(o){let t,e,n,s,r;return{c(){t=i.element("div"),i.attr(t,"class","shadow svelte-faoauy"),i.attr(t,"style",e=`
|
|
525
|
+
`,e.container.style.pointerEvents="none";const n=b=>(e.wrapper=b,b.appendChild(e.container),c(),!0),s=b=>{e.itemLabels=Qu(b),c()},r=()=>(e.enabled||(e.enabled=!0,c()),!0),a=()=>(e.enabled&&(e.enabled=!1,c()),!0),l=()=>{u(),e.container.remove()},c=()=>{var b;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(b=e.app)==null||b.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:o,itemLabels:e.itemLabels}):e.app=new Bu({target:e.container,props:{five:o,modelOcclusionEnable:e.modelOcclusionEnable,onlyVisibleInPanorama:e.onlyVisibleInPanorama,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},d=()=>{o.on("modeChange",f),o.once("dispose",l)},u=()=>{o.off("modeChange",f)},f=b=>{if(b!==ee.Five.Mode.Panorama){e.fiveModeEnabled=!1,a();return}o.once("initAnimationEnded",()=>{e.fiveModeEnabled=!0,r()})};return d(),{appendTo:n,load:s,enable:r,disable:a,dispose:l,hooks:e.hooks}},Hu={name:"ItemLabelPlugin",version:0};class Fu extends Xt{constructor(e){super(e);m(this,"state");m(this,"container");m(this,"enabled");this.five=e,this.five.once("dispose",this.dispose),this.enabled=!0,this.state=this.initState()}enable(e){this.enabled=!0,this.updateState(V(j({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(V(j({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(V(j({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(V(j({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const s=j({},this.state);this.state=j(j(j({},this.state),e),n),this.stateChangedCallback(s,n)}get visible(){return this.five.state.mode===ee.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState(V(j({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function Gu(o){i.append_styles(o,"svelte-wpy7pz",'.plugin-DoorLabelPlugin-item.svelte-wpy7pz.svelte-wpy7pz{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity 0.3s ease}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz{position:absolute;top:50%;left:50%;border-radius:0.125rem;background:rgba(0, 0, 0, 0.35);line-height:0.75rem;padding:0.375rem;white-space:nowrap;font-size:0.75rem;font-style:normal;color:white;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform ease 1s, background ease 0.3s, color ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz::after{content:"";display:block;position:absolute;top:-0.0625rem;left:-0.0625rem;bottom:-0.0625rem;right:-0.0625rem;border-radius:0.125rem;border:0.0625rem solid rgba(0, 0, 0, 0);-o-border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;transition:opacity ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(255, 255, 255, 0.5)}.plugin-DoorLabelPlugin-icon.svelte-wpy7pz.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/DoorLabel-icon.de1304ae.svg") no-repeat;background-size:100%;display:inline-block;width:0.625rem;height:0.625rem;margin-left:0.25rem;transform-origin:center}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz{color:#f9eac1}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/arrow.6e8ec00e.svg") no-repeat}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(249, 234, 193, 0.5)}')}function Nu(o){let t,e,n,s,r,a,l,c;return{c(){t=i.element("div"),e=i.element("div"),n=i.element("span"),n.textContent=`${o[8]}`,s=i.space(),r=i.element("i"),i.attr(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),i.attr(r,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),i.attr(e,"class",a=i.null_to_empty(ye.default("plugin-DoorLabelPlugin-cnt",o[0].toward))+" svelte-wpy7pz"),i.attr(e,"style",`transform: ${o[6]||"initial"};pointer-events: ${o[5]?"auto":"none"};opacity: ${o[5]?1:0}`),i.attr(e,"data-camera-toward",o[7]),i.attr(t,"style",`left: ${o[3]||0}%;top: ${o[4]||0}%;opacity: ${o[5]?1:0}`),i.attr(t,"class","plugin-DoorLabelPlugin-item svelte-wpy7pz")},m(d,u){i.insert(d,t,u),i.append(t,e),i.append(e,n),i.append(e,s),i.append(e,r),o[10](t),l||(c=i.listen(e,"click",o[9]),l=!0)},p(d,[u]){u&1&&a!==(a=i.null_to_empty(ye.default("plugin-DoorLabelPlugin-cnt",d[0].toward))+" svelte-wpy7pz")&&i.attr(e,"class",a)},i:i.noop,o:i.noop,d(d){d&&i.detach(t),o[10](null),l=!1,c()}}}function Wu(o,t,e){let{props:n}=t,{onClick:s}=t,r,{left:a,top:l,inSight:c,transform:d,panoIndex:u,cameraToward:f,name:h}=n,p=0;const g=()=>{if(!a||!l||!c||!r)return;const v=r.current.clientWidth/window.innerWidth*100,w=r.current.clientHeight/window.innerHeight*100;if(a<=v/2||a>=100-v/2||l<=w/2||l>=100-w/2)return;u!==p&&(console.log("panoDoorLabelPlugin",u,"\u89E6\u53D1\u57CB\u70B9"),p=u)},A=v=>{s&&s()};function b(v){i.binding_callbacks[v?"unshift":"push"](()=>{r=v,e(2,r)})}return o.$$set=v=>{"props"in v&&e(0,n=v.props),"onClick"in v&&e(1,s=v.onClick)},g(),[n,s,r,a,l,c,d,f,h,A,b]}class Xu extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Wu,Nu,i.safe_not_equal,{props:0,onClick:1},Gu)}}function Yu(o,t){const e=Math.abs(o.top+o.height/2-t.top-t.height/2),n=Math.abs(o.left+o.width/2-t.left-t.width/2),s=(o.height+t.height)/2,r=(o.width+t.width)/2;return!(e>s&&n>r)}function Uu(o){const{camera:t}=o,e=t.getWorldDirection(new M.Vector3);let n=Math.atan(e.z/e.x)*180/Math.PI,s="";return e.x<0&&(n+=180),n<0&&(n+=360),n>315||n<=45?s="right":n>45&&n<=135?s="back":n>135&&n<=225?s="left":n>225&&n<=315&&(s="forward"),s}function Vu(o,t){return Math.sqrt(Math.pow(o.z-t.z,2)+Math.pow(o.x-t.x,2))}function Ju(o){const t=Math.PI/4;return o>-t&&o<=t?"left":o>t*3||o<=-t*3?"right":o>-t*3&&o<=-t?"forward":o>t&&o<=t*3?"back":""}const Zu={userAction:!0};class qu extends Fu{constructor(e){super(e);m(this,"MinVisibledistance",1.8);m(this,"MaxVisibledistance",5);m(this,"OffsetHeight",-1.3);m(this,"rooms");m(this,"floorplanServerData");m(this,"doorLabelItems");m(this,"visibleLabelMap",new Map);m(this,"labelItems",[]);m(this,"doorLabels");m(this,"roomObservers");m(this,"loadData",(e,n)=>{n&&(this.MaxVisibledistance=n.MaxVisibledistance,this.MinVisibledistance=n.MinVisibledistance,this.OffsetHeight=n.OffsetHeight),this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(s=>{s.$destroy()}),this.labelItems=[],this.doorLabels=[],this.doorLabelItems=[],this.floorplanServerData=e,this.five.once("panoArrived",()=>{console.log("doorplugin","panoArrived"),this.initData()})});m(this,"initRoomObservers",()=>{var r,a;const e=this.floorplanServerData.computed_data.floor_datas||[],s=(((a=(r=this.five)==null?void 0:r.work)==null?void 0:a.observers)||[]).map(l=>{const c=l.panoIndex,d=l.floorIndex,u=e==null?void 0:e.find(f=>f.floor_index===d);if(u){const f=u.rooms.find(h=>h.observer_indexs.includes(c));if(f)return{panoIndex:c,floorIndex:d,name:f.name}}}).filter(Boolean);this.roomObservers=s});m(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});m(this,"fixDoorVisibleAndPosition",()=>{this.initRoomObservers();const{panoIndex:e}=this.five;if(!this.visible||this.five.model.empty||e===null||!this.roomObservers.find(l=>l.panoIndex===e))return;const n=this.roomObservers.find(l=>l.panoIndex===e),r=this.five.work.observers.find(l=>l.panoIndex===e).position.clone(),a=(()=>{if(this.visibleLabelMap.has(e))return this.visibleLabelMap.get(e);{const l=[];return this.doorLabels.forEach((c,d)=>{if(c.roomName===n.name)return;const u=c.position.clone(),f=u.distanceTo(r);if(f<this.MinVisibledistance||f>this.MaxVisibledistance)return;const h=new M.Raycaster,p=u.clone().sub(r).normalize();h.set(r,p);const[g]=this.five.model.intersectRaycaster(h);g&&g.distance+.1<f||l.push(d)}),this.visibleLabelMap.set(e,l),l}})();this.labelItems.forEach((l,c)=>{l.visible=a.includes(c)}),this.fixDoorPosition()});m(this,"fixDoorPosition",()=>{var u,f,h,p,g,A,b,v,w,y;const{panoIndex:e,camera:n}=this.five;if(e===null)return;if(this.five.currentMode!=="Panorama")return this.hideAllLabels();const s=this.five.getElement(),r=s.clientWidth,a=s.clientHeight,l=n.getWorldDirection(new M.Vector3),c=[],d=[...this.labelItems];if(d.forEach((I,k)=>{if(I.visible){const C=n.position.distanceTo(I.position),D=I.position.clone().add(new M.Vector3(0,this.OffsetHeight,0)),z=D.clone().sub(n.position).normalize().angleTo(l),L=D.clone().project(n),T=(L.x+1)/2.2*100,R=(-L.y+1)/2.2*100,E=T>=0&&T<=100&&R>=0&&R<=100&&C>this.MinVisibledistance&&C<=this.MaxVisibledistance;I.left=T,I.top=R,I.inSight=E&&z<Math.PI/2,I.cameraToward=Uu(this.five),E?c.push({disFromCameraToLabel:C,left:T,top:R,index:k}):I.transform="translate(-50%, -50%)"}else I.inSight=!1}),c.length>1){let I=0;c.sort((k,C)=>C.disFromCameraToLabel-k.disFromCameraToLabel);for(let k=1;k<c.length;k++){const{index:C,left:D,top:x}=c[k-1],{index:z,left:L,top:T}=c[k],R=this.container.children[C],E=this.container.children[z];if(!R||!E||!((u=R==null?void 0:R.children)!=null&&u[0])||!((f=E==null?void 0:E.children)!=null&&f[0]))return;const S={left:r*D/100,top:a*x/100,width:(p=(h=R.children[0])==null?void 0:h.clientWidth)!=null?p:0,height:(A=(g=R.children[0])==null?void 0:g.clientHeight)!=null?A:0},_={left:r*L/100,top:a*T/100,width:(v=(b=E.children[0])==null?void 0:b.clientWidth)!=null?v:0,height:(y=(w=E.children[0])==null?void 0:w.clientHeight)!=null?y:0};Yu(S,_)&&(I++,d[C].transform=`translate(-50%, ${(I-1)*100-50}%)`,d[z].transform=`translate(-50%, ${I*100-50}%)`)}}this.labelItems=d,this.render()});m(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:s}=this.five;let r,a,l=1/0;for(let c=0;c<s.observers.length;c++){if(this.roomObservers[c].name!==e)continue;const u=s.observers[c].standingPosition,f=n.distanceTo(u);f<l&&(r=c,a=u.clone().sub(n).normalize(),l=f)}if(a!==null&&r!==null){const c={};if(l>0){const u=new M.Vector3(0,0,-1),f=a.clone(),h=new M.Quaternion;h.setFromUnitVectors(u,f);const p=new M.Euler;p.setFromQuaternion(h,"YXZ"),c.longitude=p.y}this.five.emit("wantsToMoveToPano",r,{},!0)||this.five.moveToPano(r,{longitude:c.longitude})}});m(this,"initData",()=>{var r;this.doorLabels=[];const e=this.five.panoIndex,n=this.floorplanServerData.computed_data.observers[e].floor_index,s=n!==void 0&&((r=this.floorplanServerData.computed_data.floor_datas[n])==null?void 0:r.rooms);this.rooms=s,this.rooms&&this.rooms.length>0&&this.rooms.forEach(a=>{var d;const l=(d=this.floorplanServerData.computed_data.doors)==null?void 0:d.filter(u=>!!(u&&u.name===a.name)),c=this.five.work.observers.filter((u,f)=>!!a.observer_indexs.find(h=>h===f));l&&l.forEach(u=>{const f=u.position;let h=1/0,p;c.forEach(A=>{const b=A.standingPosition,v={x:b.x,y:b.y,z:b.z},w=Vu(f,v);w<h&&(h=w,p=v)}),p&&(f.y=p.y+.01);const g=new M.Vector3(f.x,f.y,f.z);g.add(new M.Vector3(-.2,1.8,0).applyEuler(new M.Euler(0,u.rad,0))),this.doorLabels.push({roomName:a.name,name:u.name,position:g,toward:Ju(u.rad)})})}),this.labelItems=this.doorLabels.map(a=>V(j({},a),{left:0,top:0,visible:!1,inSight:!1,transform:"",cameraToward:""})),this.five.on("wantsToMoveToPano",this.hideAllLabels),this.five.on("modelLoaded",this.fixDoorVisibleAndPosition),this.five.on("panoArrived",this.fixDoorVisibleAndPosition),this.five.on("initAnimationEnded",this.fixDoorPosition),this.five.on("cameraUpdate",this.fixDoorPosition),this.five.on("mouseWheel",this.fixDoorPosition),this.five.on("pinchGesture",this.fixDoorPosition),this.fixDoorVisibleAndPosition()})}stateChangedCallback(e,n){if(this.hooks.hasListener("stateChange")){const s={state:this.state,prevState:e,userAction:n?n.userAction:Zu.userAction};this.hooks.emit("stateChange",s)}}render(){if(!this.enabled){this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(e=>{e==null||e.$destroy()}),this.doorLabels=void 0;return}this.doorLabelItems&&this.doorLabelItems.forEach(e=>{e.$destroy()}),this.doorLabelItems=[],this.labelItems.forEach(e=>{this.doorLabelItems.push(new Xu({target:this.container,props:{props:e,onClick:()=>{this.onClick(e.name,e.position)}}}))})}initState(){return{enabled:!0,visible:!0}}dispose(){this.five&&(this.five.off("wantsToMoveToPano",this.hideAllLabels),this.five.off("modelLoaded",this.fixDoorVisibleAndPosition),this.five.off("panoArrived",this.fixDoorVisibleAndPosition),this.five.off("initAnimationEnded",this.fixDoorPosition),this.five.off("cameraUpdate",this.fixDoorPosition),this.five.off("mouseWheel",this.fixDoorPosition),this.five.off("pinchGesture",this.fixDoorPosition),super.dispose())}}const Ku=o=>new qu(o),$u=2,eh=3,th=3,nh=2;function ih(o,t){var a,l,c;if(o.length<2)return console.warn("positionList length must be greater than 1"),[];const e=(a=t==null?void 0:t.unitWidth)!=null?a:.5,n=(l=t==null?void 0:t.unitHeight)!=null?l:.5,s=(c=t==null?void 0:t.skipPanoIndexMesh)!=null?c:!1,r=new P.CatmullRomCurve3(o,!1,"catmullrom",1);if(s){const d=Math.ceil(r.getLength()/n*1.5),u=r.getPoints(d),f=[];let h=0;const p=o;return p.forEach((g,A)=>{let b=0,v=99999999;u.forEach((C,D)=>{const x=C.distanceTo(g);x<v&&(b=D,v=x)});const w=u[b+1],y=w==null?void 0:w.distanceTo(g),I=u[b-1],k=I==null?void 0:I.distanceTo(g);if(b>h&&b-h>1){let C=b;I!==void 0&&k>.8&&(C=b+1),I!==void 0&&k>.2&&k<.3?C=b:v>.2&&v<.3&&(C=b+1);let D=h;if(w!==void 0&&y>.2&&y<.3?D=h+1:v>.2&&v<.3&&(D=h),u[D]&&u[D+1]){const L=p[A-1];if(L)if(L.equals(u[D]))D+=1;else{const T=new M.Vector3().subVectors(u[D+1],u[D]),R=new M.Vector3().subVectors(L,u[D]);T.angleTo(R)<Math.PI/2&&(D+=1)}}if(C<D||C-D<=1)return;const x=u.slice(D,C),z=to(x,e,n);f.push(z),h=b}}),f}else{const d=Math.ceil(r.getLength()),u=r.getPoints(d);return[to(u,e,n)]}}function to(o,t,e){const n=t/2,s=e/t,r=o.length,a=Ir.default(o.map(v=>[v.x,v.z])),c=(o.length-1)*$u*eh,d=2*r,u=d*th,f=d*nh,h=new Uint32Array(c),p=new Float32Array(u),g=new Float32Array(f);o.forEach((v,w)=>{});let A=0;for(let v=0;v<o.length;v++){const[w,y]=a[v][0],I=o[v],{x:k,y:C,z:D}=I,x=new M.Vector3(k+w*n,C+.05,D+y*n);p[v*6+0]=x.x,p[v*6+1]=x.y,p[v*6+2]=x.z;const z=new M.Vector3(k-w*n,C+.05,D-y*n);p[v*6+3]=z.x,p[v*6+4]=z.y,p[v*6+5]=z.z,A+=v>0?o[v-1].clone().sub(o[v]).length():0;const L=A/t/s;g[v*4+0]=0,g[v*4+1]=L,g[v*4+2]=1,g[v*4+3]=L,v!==o.length-1&&(h[v*6+0]=v*2+0,h[v*6+1]=v*2+2,h[v*6+2]=v*2+1,h[v*6+3]=v*2+2,h[v*6+4]=v*2+3,h[v*6+5]=v*2+1)}const b=new P.BufferGeometry;return b.setAttribute("position",new P.BufferAttribute(p,3)),b.setAttribute("uv",new P.BufferAttribute(g,2)),b.setIndex(new P.BufferAttribute(h,1)),b}function oh(o){const t=new P.TextureLoader().load(o.textureUrl);return t.wrapS=t.wrapT=P.RepeatWrapping,t.encoding=P.sRGBEncoding,new P.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function sh(o){return!Ue(o)}function Ue(o){return o!=null}const Gs="v1.0.1",Ns="GuideLinePlugin",bn=`${Ns}@${Gs}`,no=o=>`${bn}--${o}`;class Ws extends Ze{constructor(e,n){super(e,n);m(this,"state",{visible:!1,enabled:!0,disposed:!1});m(this,"data");m(this,"linesGroup");m(this,"disposedErrorLog",()=>{console.error(`${bn} is disposed`)});m(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${Ns}_DEBUG__`]:this})}load(e,n,s=!0){return F(this,null,function*(){const r=this.data?JSON.parse(JSON.stringify(this.data)):void 0,a=yield this.formatData(e);this.hooks.emit("dataChange",a,r),this.data=a,this.linesGroup&&this.five.scene.remove(this.linesGroup);const l=this.getLinesGroup(a.routes);!l||(this.linesGroup=l,yield this.waitFiveModelLoaded(),this.five.scene.add(l),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n),this.five.needsRender=!0,this.hooks.emit("dataLoaded",a),console.log(`${bn} loaded`,a))})}formatData(e){return F(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e})}show(e){return F(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return F(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){var r;if(this.state.disposed)return this.disposedErrorLog();const s=j({},this.state);this.state=j(j({},this.state),e),e.disposed!==void 0&&e.disposed!==s.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),Ce(s,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:(r=n==null?void 0:n.userAction)!=null?r:!0}),this.five.needsRender=!0)}handleEnable(e,n=!0){this.linesGroup&&(e?(this.five.scene.add(this.linesGroup),this.actionWhenEnabled(()=>this.hooks.emit("enable",{userAction:n}))):(this.five.scene.remove(this.linesGroup),this.hooks.emit("disable",{userAction:n})))}handleVisible(e,n=!0){this.linesGroup&&(e?(this.linesGroup.visible=!0,this.actionWhenEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.linesGroup.visible=!1,this.actionWhenEnabled(()=>this.hooks.emit("hide",{userAction:n}))))}handleDispose(){this.linesGroup&&this.five.scene.add(this.linesGroup)}getLinesGroup(e){const n=e.map(this.getLine.bind(this)).filter(Ue),s=new P.Group;if(s.name=no("route-group"),n.length!==0)return s.add(...n),s}getLine(e){var l,c,d,u;const n=new P.Group,s=e.panoIndexList.map(f=>{var h;return(h=this.five.work.observers[f])==null?void 0:h.standingPosition}).filter(Ue),r=ih(s,{skipPanoIndexMesh:(l=e.skipPanoIndexMesh)!=null?l:!0,unitWidth:(c=e.unitWidth)!=null?c:.6,unitHeight:(d=e.unitHeight)!=null?d:.4});if(!r)return;const a=oh({textureUrl:(u=e.arrowTextureUrl)!=null?u:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return r.forEach(f=>{const h=new P.Mesh(f,a);h.name=no("route-line-mesh"),n.add(h)}),n}waitFiveModelLoaded(){return F(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}m(Ws,"lasestVersion",Gs);const Xs=(o,t)=>new Ws(o,t);function io(o){const t=Math.abs(Math.cos(o.latitude));return new P.Vector3(-Math.sin(o.longitude)*t,-Math.sin(o.latitude),-Math.cos(o.longitude)*t)}function rh(o,t){const e=io(o),n=io(t);return e.angleTo(n)}const ah=o=>F(exports,null,function*(){try{o().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),Pt=Math.PI*2;function lh(o){return o>=0&&o<Pt?o:(o%Pt+Pt)%Pt}function ch(o){return{longitude:lh(-Math.atan2(o.x,-o.z)),latitude:-Math.asin(o.y/1)}}function dh(o,t,e,n){const s=-o/e,r=o;return s*n+r}function uh(o){return new Promise(t=>{setTimeout(()=>{t()},o)})}const Ys="v1.0.6",Us="CruisePlugin",Jt=`${Us}@${Ys}`,oo=()=>{console.error(`${Jt} is disposed`)},hh=()=>{console.warn(`${Jt} is disabled`)},fh=()=>{console.error(`${Jt} is disabled`)},an=new Map;class Bn extends Ze{constructor(e,n){super(e,n);m(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});m(this,"data");m(this,"config");m(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});m(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Us}_DEBUG__`]:this});const s=this.setFiveLinearUpdateCamera.bind(this),r=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",s),this.hooks.on("broke",r),this.hooks.on("end",r),this.hooks.on("pause",r),this.privateState.disposers.push(()=>{this.hooks.off("play",s),this.hooks.off("broke",r),this.hooks.off("end",r),this.hooks.off("pause",r)})}load(e,n,s){return F(this,null,function*(){var u,f,h,p,g;if(this.state.disposed)return oo();this.privateState.fiveOriginGetProgress||(f=(u=this.five.controller)==null?void 0:u.cameraMotion)!=null&&f.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(p=(h=this.five.controller)==null?void 0:h.cameraMotion)==null?void 0:p.getProgress),this.clear();const r=this.data?JSON.parse(JSON.stringify(this.data)):void 0,a=yield this.formatData(e);this.data=a,this.hooks.emit("dataChange",a,r);let l=[],c;const d=this.data.keyframes.filter(A=>A.data.panoIndex!==void 0);d.filter((A,b)=>{var v;return A.data.panoIndex!==((v=d[b-1])==null?void 0:v.data.panoIndex)}).map(A=>A.data.panoIndex).forEach(A=>{var v,w;const b=(v=this.five.work.observers[A])==null?void 0:v.floorIndex;if(b!==void 0)if(c===b){const y=l.length-1;l[y]=[...(w=l[y])!=null?w:[],A]}else{c=b;const y=l.length;l[y]=[A]}}),this.GuideLine||(this.GuideLine=Xs(this.five,this.config)),(g=this.GuideLine)==null||g.load({routes:l.map(A=>({panoIndexList:A}))}),this.setState({playing:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing),this.changeSpeed(this.state.speed),n&&this.setState(n,{userAction:s}),console.log(`${Jt} loaded`,a),this.hooks.emit("dataLoaded",a)})}play(e){this.setState({playing:!0},e)}playFrom(e){const{index:n,id:s,userAction:r}=e;this.state.playing&&this.setState({playing:!1},{userAction:r}),this.setState({playing:!0},{userAction:r,playFromIndex:n,playFromId:s})}playFromStart(e){return this.playFrom(V(j({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return F(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return F(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){var r;if(this.state.disposed)return oo();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return fh();const s=j({},this.state);this.state=j(j({},this.state),e),e.disposed!==void 0&&e.disposed!==s.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),e.playing!==void 0&&e.playing!==s.playing&&this.changePlayState(e.playing,n),e.speed!==void 0&&e.speed!==s.speed&&this.changeSpeed(e.speed,n==null?void 0:n.userAction),Ce(s,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:s,userAction:(r=n==null?void 0:n.userAction)!=null?r:!0})}formatData(e){return F(this,null,function*(){this.five.work||(yield this.waitFiveLoaded());const n=this.five.work.observers,s=(()=>{const r=e;return typeof r=="object"&&r!==null&&r.version&&r.data?r.data:r})();if(s.keyframes)return{keyframesId:ue(),keyframes:s.keyframes.map((r,a)=>{var d;const l=s.keyframes[a+1],c=(()=>!l||l.start===void 0||r.end===void 0?0:l.start-r.end)();return j({id:(d=r.uuid)!=null?d:ue(),moveIndex:a,stay:c,index:a},r)})};if(s.panoIndexList){let r=[];const{moveEffect:a,moveToFirstPanoEffect:l}=s;return this.privateState.moveToFirstPanoEffect=l,s.panoIndexList.forEach((c,d)=>{const u=(()=>{var A,b,v,w;const f=s.panoIndexList.slice(d).find(y=>y!==c);if(f===void 0)return;const h=(A=n[c])==null?void 0:A.position,p=(b=n[f])==null?void 0:b.position;if(!p||!h||((v=n[c])==null?void 0:v.floorIndex)!==((w=n[f])==null?void 0:w.floorIndex))return;const g=new P.Vector3().subVectors(p,h);return ch(g)})();s.moveType===void 0||s.moveType==="justMove"?r.push({moveIndex:d,stay:s.stay,data:j({effect:"Move",panoIndex:c,moveEffect:a},u!=null?u:{})}):s.moveType==="moveAndRotate"&&(r.push({moveIndex:d,stay:s.stay,data:{effect:"Move",panoIndex:c,moveEffect:a}}),u&&r.push({moveIndex:d,stay:s.stay,data:j({effect:"Rotate",panoIndex:c},u)}))}),{keyframesId:ue(),keyframes:r.map((c,d)=>j({id:ue(),index:d},c))}}else throw new Error("format error: data no keyframes or no panoIndexList")})}handleEnable(e,n=!0){var s,r;e?((s=this.GuideLine)==null||s.enable(),this.hooks.emit("enable",{userAction:n})):((r=this.GuideLine)==null||r.disable(),this.changePlayState(!1,{userAction:n}),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){var s,r;e?((s=this.GuideLine)==null||s.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):((r=this.GuideLine)==null||r.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}changePlayState(e,n){this.actionIfStateIsEnabled(()=>{var s;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(s=n==null?void 0:n.userAction)!=null?s:!0})}),e?this.handlePlay(n):this.handlePause(n),this.state.playing=e}handlePlay(e){return F(this,null,function*(){var p;const{data:n,state:s,privateState:r,hooks:a}=this;if(r.playing||!(n!=null&&n.keyframes)||(n==null?void 0:n.keyframes.length)===0)return;const l=ue();r.playId=l,r.playing=!0,r.broke=!1;const c=n.keyframes,d=this.getPauseData();(e==null?void 0:e.notEmitEvent)!==!0&&a.emit("play",{userAction:(p=e==null?void 0:e.userAction)!=null?p:!0});let u=!1;const h=yield(()=>F(this,null,function*(){var g,A;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(g=this.data)==null?void 0:g.keyframes.findIndex(b=>b.id===e.playFromId);if(d!=null&&d.keyframeId){const b=(A=this.data)==null?void 0:A.keyframes.find(v=>v.id===d.keyframeId);if(d!=null&&d.fiveState&&(yield this.move(d.fiveState,{moveEffect:r.moveToFirstPanoEffect})),b){if(b.data.effect==="Move")return b.index;if(b.data.effect==="Rotate"){const v=d.duration!==void 0?d.duration*(1-d.playedProgress):void 0;return yield this.playKeyframe(b,{duration:v}),u=!0,b.index+1}}}}))();this.clearPauseData();for(const g of c){if(r.broke||!s.playing||!r.playing||l!==r.playId)return;if(!(h!==void 0&&g.index<h))try{a.emit("playIndexChange",g.index,g),yield this.playKeyframe(g,{moveEffect:u===!1?r.moveToFirstPanoEffect:void 0,duration:800}),g.stay&&(yield uh(g.stay)),u===!1&&(u=!0)}catch(A){return Promise.resolve("broke")}}s.playing&&l===r.playId&&(this.setState({playing:!1},{userAction:!1}),a.emit("end"),this.clearPauseData())})}handlePause(e){var a;const{state:n,privateState:s,hooks:r}=this;n.playing=!1,s.playing!==!1&&(s.playing=!1,this.setPauseData(),s.broke||this.forceInteruptUpdateCamera(),(e==null?void 0:e.notEmitEvent)!==!0&&r.emit("pause",{userAction:(a=e==null?void 0:e.userAction)!=null?a:!0}))}playKeyframe(e,n){return F(this,null,function*(){var r;const{privateState:s}=this;return((r=this.privateState.currentPlayKeyframe)==null?void 0:r.keyframe.id)!==e.id&&(this.privateState.currentPlayKeyframe={keyframe:e}),s.currentPlayQueue.push(this.getPlayPromise(e,n)),this.actionPromiseQueue()})}addInterruptListener(e){const n=()=>{this.privateState.modeChanging||e()},s=e;return this.five.once("gesture",s),this.five.once("wantsChangeMode",n),()=>{this.five.off("gesture",s),this.five.once("wantsChangeMode",n)}}getPlayPromise(e,n){return F(this,null,function*(){var r;const s=e.data;if((r=n==null?void 0:n.duration)!=null||e.start!==void 0&&e.end!==void 0&&e.end-e.start,!!s)return new Promise((a,l)=>{let c=!1;this.addInterruptListener(()=>{if(!c)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),c=!0,l(new Error("play is interupted"))});try{if(c)return;const d=()=>{a(),c=!0};switch(s.effect){case"Move":this.move(s,n).then(d);break;case"Rotate":this.rotate(s,n).then(d);break;default:this.rotate(s,n).then(d)}}catch(d){}})})}actionPromiseQueue(){return F(this,null,function*(){const{privateState:e}=this;return new Promise((n,s)=>{if(e.currentPlayQueue.length===0){n();return}const r=e.currentPlayQueue.shift();if(!r){n();return}r.then(n,s)}).then(()=>e.currentPlayQueue.length===0?Promise.resolve():this.actionPromiseQueue())})}move(e,n){return F(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode(e);else if(e.panoIndex!==this.five.panoIndex)yield this.changePano(e,n);else return Promise.resolve()})}rotate(e,n){return F(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return yield this.changePano(e,n);yield this.updateCamera(e,n==null?void 0:n.duration)})}updateCamera(e,n=800){return F(this,null,function*(){const{five:s,privateState:r,state:a}=this;let l=n;const c=(()=>{var h,p;const u=(h=a.config)==null?void 0:h.speedConfig,f=(p=e.rotateSpeed)!=null?p:u==null?void 0:u.rotateSpeed;if((u==null?void 0:u.rotateSpeedUnit)===void 0)return f;if(f!==void 0)return u.rotateSpeedUnit==="rad/ms"?f:f/1e3})();if(c){const u=this.five.getCurrentState();l=rh(u,e)/c}r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=l);const d=this.getSpeededDuration(l);return new Promise(u=>{ah(()=>s.updateCamera(e,d)),setTimeout(()=>u(),d)})})}changePano(e,n){return F(this,null,function*(){var f;const{five:s,privateState:r,state:a}=this;if(typeof e.panoIndex!="number"||e.panoIndex===s.panoIndex)return;s.getCurrentState().mode;const l=s.getCurrentState().mode!=="Panorama";l&&(this.privateState.modeChanging=!0);let c=(f=n==null?void 0:n.duration)!=null?f:800;const d=(()=>{var g,A;const h=(g=a.config)==null?void 0:g.speedConfig,p=(A=e.moveSpeed)!=null?A:h==null?void 0:h.moveSpeed;if((h==null?void 0:h.moveSpeedUnit)===void 0)return p;if(p!==void 0)return h.moveSpeedUnit==="m/ms"?p:p/1e3})();if(d&&typeof s.panoIndex=="number"&&typeof e.panoIndex=="number"){const h=s.work.observers[s.panoIndex].position,p=s.work.observers[e.panoIndex].position;c=h.distanceTo(p)/d}r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=c);const u=this.getSpeededDuration(c);yield new Promise(h=>{var p,g,A;s.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:u,effect:(A=(g=n==null?void 0:n.moveEffect)!=null?g:(p=this.state.config)==null?void 0:p.moveEffect)!=null?A:e.moveEffect,moveCancelCallback:()=>h(),moveEndCallback:()=>h()}),l&&s.once("panoArrived",()=>h())}),l&&(this.privateState.modeChanging=!1)})}changeSpeed(e,n=!0){const{state:s,privateState:r,hooks:a}=this,{currentPlayKeyframe:l}=r;if(a.emit("speedChange",e,{userAction:n}),s.playing&&l)try{const c=l.originDuration!==void 0?l.originDuration*(1-this.getProgress()):void 0,d=this.playKeyframe(l.keyframe,{duration:c});r.currentPlayQueue.push(d)}catch(c){}}getSpeededDuration(e){return e/this.state.speed}getProgress(){return this.five.controller.cameraMotion.progress}changeMode(e,n){return F(this,null,function*(){e.mode&&e.mode!==this.five.currentMode&&(this.privateState.modeChanging=!0,console.log("this.privateState.modeChanging",this.privateState.modeChanging),yield this.five.changeMode(e.mode,e,n),this.privateState.modeChanging=!1)})}forceInteruptUpdateCamera(){this.five.updateCamera({},0)}getPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return an.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,s,r;if((e=this.data)!=null&&e.keyframesId)return an.set((n=this.data)==null?void 0:n.keyframesId,{keyframeId:(s=this.privateState.currentPlayKeyframe)==null?void 0:s.keyframe.id,fiveState:this.five.getCurrentState(),duration:(r=this.privateState.currentPlayKeyframe)==null?void 0:r.originDuration,playedProgress:this.getProgress()})}clearPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return an.delete((n=this.data)==null?void 0:n.keyframesId)}clear(){this.clearPauseData(),this.privateState.currentPlayKeyframe=null}handleDispose(){var e,n;this.setState({playing:!1}),this.clearPauseData(),this.clear(),(e=this.GuideLine)==null||e.dispose(),this.GuideLine=void 0,(n=this.privateState.disposers)==null||n.forEach(s=>s==null?void 0:s())}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&hh()}waitFiveLoaded(){return F(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}setFiveLinearUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=e=>{const n=this.five.controller.cameraMotion,s=e-n.startTime;return s<0?0:s>=n.duration?1:1-dh(1,n.startVelocity,n.duration,s)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}m(Bn,"PluginVersion",Ys);const mh=o=>new Bn(o);function ph(o,t){t.forEach(e=>{const n=new P.SphereGeometry(.02,16,16),s=[],r=[new P.MeshBasicMaterial({color:16776960}),new P.MeshBasicMaterial({color:16711935}),new P.MeshBasicMaterial({color:16711680}),new P.MeshBasicMaterial({color:65535})];if(e.position.length===4)e.position.forEach((a,l)=>{const c=r[l],d=new P.Mesh(n,c);d.position.copy(De(a)),s.push(d)});else{const a=r[0],l=new P.Mesh(n,a);l.position.copy(De(e.position)),s.push(l)}s.forEach(a=>{a.material.depthTest=!1,o.scene.add(a)})})}const re=o=>o;function Vs(o){if(o.length<3)return;const t=o.map(ct),e=t[1].clone().sub(t[0]),n=t[2].clone().sub(t[1]);return e.cross(n)}function It(o){if(Array.isArray(o)&&o.length===4){const t=o.map(ct);return fs(t[0],t[2])}else return ct(o)}function kt(o,t){if(o===void 0)return;const{min:e,max:n}=t!=null?t:{};if(!(e===void 0&&n===void 0))return!(typeof n=="number"&&n<o||typeof e=="number"&&e>o)}function gh(o,t){o.model.loaded?t():o.once("modelLoaded",()=>t())}function Ah(o,t,e){const s=new P.Plane().setFromNormalAndCoplanarPoint(e,t),r=t.clone().sub(o).cross(new P.Vector3(0,1,0)).setLength(.01),a=new P.Vector3(0,.01,0);return[t.clone().sub(r).sub(a),t.clone().add(r).sub(a),t.clone().add(r).add(a),t.clone().sub(r).add(a)].map(c=>s.projectPoint(c,new P.Vector3))}const so=(o,t=1e3/60)=>{let e=null;const n=o;return(...r)=>{e&&clearTimeout(e),e=setTimeout(()=>{n==null||n(...r),e&&clearTimeout(e),e=null},t)}};function vh(o,t=200){let e;return function(...n){e||(o.apply(this,n),e=setTimeout(function(){e=null},t))}}function bh(o,t){const[e,n]=t;if(e>=n||n<=1||e<=1)return-1;const s={},r=a=>(s[a]||(s[a]=o(a)),s[a]);for(let a=e;a<n;a++){const l=r(a),c=r(a-1);if(l<c)return a}return-1}function ro(o,t){if(!t||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",o),unobserve:()=>window.removeEventListener("resize",o)};{const e=new ResizeObserver(o);return{observe:()=>e.observe(t),unobserve:()=>e.unobserve(t)}}}var Ae=(o=>(o.Two="2D",o.Three="3D",o))(Ae||{}),fe=(o=>(o.PointTag="PointTag",o.PlaneTag="PlaneTag",o))(fe||{}),ge=(o=>(o.Audio="Audio",o.Text="Text",o.ImageText="ImageText",o.Link="Link",o.Marketing="Marketing",o.MediaPlane="MediaPlane",o.Custom="Custom",o))(ge||{}),Ot=(o=>(o.VrLink="vr",o.NormalLink="normal",o))(Ot||{});function yh(o){i.append_styles(o,"svelte-1omzoh4",".straight-line.svelte-1omzoh4{display:block;width:100%;height:100%;overflow:visible}")}function ao(o){let t,e,n,s;return{c(){t=i.svg_element("path"),i.attr(t,"fill","none"),i.attr(t,"stroke","url(#"+o[4]+")"),i.attr(t,"stroke-width","1"),i.attr(t,"d","M0 0.5 L 148 0.5")},m(r,a){i.insert(r,t,a),s=!0},p(r,a){o=r},i(r){s||(r&&i.add_render_callback(()=>{n&&n.end(1),e=i.create_in_transition(t,me.draw,{duration:o[1],delay:o[0]}),e.start()}),s=!0)},o(r){e&&e.invalidate(),r&&(n=i.create_out_transition(t,me.draw,{duration:o[1],delay:o[2]})),s=!1},d(r){r&&i.detach(t),r&&n&&n.end()}}}function wh(o){let t,e,n,s,r,a=o[3]&&ao(o);return{c(){t=i.svg_element("svg"),e=i.svg_element("defs"),n=i.svg_element("linearGradient"),s=i.svg_element("stop"),r=i.svg_element("stop"),a&&a.c(),i.attr(s,"offset","25%"),i.attr(s,"stop-color","white"),i.attr(s,"stop-opacity","1"),i.attr(r,"offset","100%"),i.attr(r,"stop-color","white"),i.attr(r,"stop-opacity","0.5"),i.attr(n,"id",o[4]),i.attr(n,"gradientUnits","userSpaceOnUse"),i.attr(t,"class","straight-line svelte-1omzoh4"),i.attr(t,"viewBox","0 0 148 1"),i.attr(t,"preserveAspectRatio","none")},m(l,c){i.insert(l,t,c),i.append(t,e),i.append(e,n),i.append(n,s),i.append(n,r),a&&a.m(t,null)},p(l,[c]){l[3]?a?(a.p(l,c),c&8&&i.transition_in(a,1)):(a=ao(l),a.c(),i.transition_in(a,1),a.m(t,null)):a&&(i.group_outros(),i.transition_out(a,1,1,()=>{a=null}),i.check_outros())},i(l){i.transition_in(a)},o(l){i.transition_out(a)},d(l){l&&i.detach(t),a&&a.d()}}}function Ch(o,t,e){let{inDelay:n=0}=t,{duration:s=0}=t,{outDelay:r=0}=t,{unfolded:a}=t;const l=ue();return o.$$set=c=>{"inDelay"in c&&e(0,n=c.inDelay),"duration"in c&&e(1,s=c.duration),"outDelay"in c&&e(2,r=c.outDelay),"unfolded"in c&&e(3,a=c.unfolded)},[n,s,r,a,l]}class Js extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Ch,wh,i.safe_not_equal,{inDelay:0,duration:1,outDelay:2,unfolded:3},yh)}}function Eh(o){i.append_styles(o,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function lo(o){let t,e,n,s,r;return{c(){t=i.element("div"),i.attr(t,"class","shadow svelte-faoauy"),i.attr(t,"style",e=`
|
|
526
526
|
left:${pe(o[5])};
|
|
527
527
|
bottom:${pe(o[6])};
|
|
528
528
|
box-shadow: 0 0 ${pe(o[10])} ${pe(o[11])} rgba(0, 0, 0, ${o[12]});
|
|
@@ -536,9 +536,9 @@ void main() {
|
|
|
536
536
|
${o[8]?"transform: translateX(-50%); left: 50%":""}
|
|
537
537
|
${o[9]?"transform: translateX(-50%); top: 50%":""}
|
|
538
538
|
${o[7]?"transform: translate(-50%, -50%); left: 50%; top: 50%;":""}
|
|
539
|
-
`))&&i.attr(t,"style",e),l&8&&i.set_style(t,"width",pe(o[3]),!1),l&16&&i.set_style(t,"height",pe(o[4]),!1),l&8192&&i.set_style(t,"z-index",o[13],!1)},i(a){r||(a&&i.add_render_callback(()=>{s&&s.end(1),n=i.create_in_transition(t,me.fade,{duration:o[0]}),n.start()}),r=!0)},o(a){n&&n.invalidate(),a&&(s=i.create_out_transition(t,me.fade,{duration:o[1]})),r=!1},d(a){a&&i.detach(t),a&&s&&s.end()}}}function Ph(o){let t,e=o[2]&&lo(o);return{c(){e&&e.c(),t=i.empty()},m(n,s){e&&e.m(n,s),i.insert(n,t,s)},p(n,[s]){n[2]?e?(e.p(n,s),s&4&&i.transition_in(e,1)):(e=lo(n),e.c(),i.transition_in(e,1),e.m(t.parentNode,t)):e&&(i.group_outros(),i.transition_out(e,1,1,()=>{e=null}),i.check_outros())},i(n){i.transition_in(e)},o(n){i.transition_out(e)},d(n){e&&e.d(n),n&&i.detach(t)}}}function pe(o){return typeof o=="number"?o/16+"rem":o}function Ih(o,t,e){let{inDelay:n=1e3}=t,{outDelay:s=1e3}=t,{visible:r=!0}=t,{width:a=0}=t,{height:l=0}=t,{left:c=0}=t,{bottom:d=0}=t,{center:u=!1}=t,{horizontalCenter:f=!1}=t,{verticalCenter:h=!1}=t,{blurRadius:p}=t,{spreadRadius:g}=t,{opacity:A=.15}=t,{zIndex:b=void 0}=t;return o.$$set=v=>{"inDelay"in v&&e(0,n=v.inDelay),"outDelay"in v&&e(1,s=v.outDelay),"visible"in v&&e(2,r=v.visible),"width"in v&&e(3,a=v.width),"height"in v&&e(4,l=v.height),"left"in v&&e(5,c=v.left),"bottom"in v&&e(6,d=v.bottom),"center"in v&&e(7,u=v.center),"horizontalCenter"in v&&e(8,f=v.horizontalCenter),"verticalCenter"in v&&e(9,h=v.verticalCenter),"blurRadius"in v&&e(10,p=v.blurRadius),"spreadRadius"in v&&e(11,g=v.spreadRadius),"opacity"in v&&e(12,A=v.opacity),"zIndex"in v&&e(13,b=v.zIndex)},[n,s,r,a,l,c,d,u,f,h,p,g,A,b]}class ve extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Ih,Ph,i.safe_not_equal,{inDelay:0,outDelay:1,visible:2,width:3,height:4,left:5,bottom:6,center:7,horizontalCenter:8,verticalCenter:9,blurRadius:10,spreadRadius:11,opacity:12,zIndex:13},Eh)}}function kh(){return Math.random().toString(36).slice(-6)}const co=kh();function xh(o){i.append_styles(o,"svelte-1b2n9wi",".text-char.svelte-1b2n9wi{display:inline-block;text-shadow:0.125rem 0rem 0.5rem rgba(0, 0, 0, 0.15)}")}function uo(o,t,e){const n=o.slice();return n[10]=t[e],n[11]=t,n[12]=e,n}function ho(o){let t,e=o[10]+"",n,s=o[12];const r=()=>o[6](t,s),a=()=>o[6](null,s);return{c(){t=i.element("span"),n=i.text(e),i.attr(t,"class","text-char svelte-1b2n9wi")},m(l,c){i.insert(l,t,c),i.append(t,n),r()},p(l,c){o=l,c&2&&e!==(e=o[10]+"")&&i.set_data(n,e),s!==o[12]&&(a(),s=o[12],r())},d(l){l&&i.detach(t),a()}}}function Dh(o){let t,e=o[1],n=[];for(let s=0;s<e.length;s+=1)n[s]=ho(uo(o,e,s));return{c(){for(let s=0;s<n.length;s+=1)n[s].c();t=i.empty()},m(s,r){for(let a=0;a<n.length;a+=1)n[a].m(s,r);i.insert(s,t,r)},p(s,[r]){if(r&3){e=s[1];let a;for(a=0;a<e.length;a+=1){const l=uo(s,e,a);n[a]?n[a].p(l,r):(n[a]=ho(l),n[a].c(),n[a].m(t.parentNode,t))}for(;a<n.length;a+=1)n[a].d(1);n.length=e.length}},i:i.noop,o:i.noop,d(s){i.destroy_each(n,s),s&&i.detach(t)}}}function Sh(o,t,e){let n,{inDelay:s=0}=t,{outDelay:r=0}=t,{content:a}=t,{unfolded:l}=t,c,d=[],u;function f(p){clearTimeout(c),c=setTimeout(function(){!u||(p&&u.reversed||!p&&!u.reversed)&&(u.reverse(),u.play())},p?s:r)}Z.onMount(function(){const p=(()=>{const g=bh(A=>d[A].getBoundingClientRect().x,[Math.min(d.length-1,10),Math.min(d.length-1,30)]);if(g>0)return g})();u=Wn.default({targets:d.filter(Ue).slice(0,p),autoplay:!1,duration:400,scale:[.7,1],rotate:[20,0],opacity:[0,1],translateX:[4,0],translateY:[10,0],delay:Wn.default.stagger(50),easing:"easeInOutCubic"}),l&&u.seek(u.duration)});function h(p,g){i.binding_callbacks[p?"unshift":"push"](()=>{d[g]=p,e(0,d)})}return o.$$set=p=>{"inDelay"in p&&e(2,s=p.inDelay),"outDelay"in p&&e(3,r=p.outDelay),"content"in p&&e(4,a=p.content),"unfolded"in p&&e(5,l=p.unfolded)},o.$$.update=()=>{o.$$.dirty&16&&e(1,n=(()=>{const p=[],g=new RegExp(new RegExp("\\p{Regional_Indicator}\\p{Regional_Indicator}|\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?(\\u200D\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?)+|\\p{Emoji_Presentation}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?|\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)","gu")),A=`__EMOJI_SPLIT_${co}__`,b=`__EMOJI_${co}__`;return a.slice().replace(g,v=>`${A}${b}${v}${A}`).split(A).forEach(v=>v.startsWith(b)?p.push(v.slice(b.length)):p.push(...v.split(""))),p.filter(Boolean)})()),o.$$.dirty&32&&f(l)},[d,n,s,r,a,l,h]}class Zs extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Sh,Dh,i.safe_not_equal,{inDelay:2,outDelay:3,content:4,unfolded:5},xh)}}const Lh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAKqADAAQAAAABAAAAKgAAAADUGqULAAAB0ElEQVRYCe2WSUoEQRBFLVHEiVZU1I03cKW38SSewRt4A5fiTty5cQIFR9pZQWkcUNSe2/Z9yISiSGxRkUAy4BGZSVX168gistraYsQKxArECsQKxApYqkDyU5lmsznMM+ZgAGpQhaUkSRbINgLJCXiCBtSgAkVYtGGIBTKj8AgKSVahDNvQa0IUkUG4Bx91BpLdBTOS/cgUIB3a+gMwI9mFzE3a0I3z5B4r292Jz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Kf4EYJQFk+JeQMlvE3UcLRmTkkUANm1ZOZmE24dqGU5gOfCyZkyGWQT+IykW8zmSz0IpiLNN8t5iTmdTkgGTrInI7JcfULaH10Qnh/4IMVjAxNk6jxwajuUb8lqOZRT3S/lx06RY1g8C4akfiEJAOZdFKzsq/nNjIssdufjbhQAEAUodOGDWp4m8S0oHEhb+YexGkD4EBUpdVMrfl/E/RhNJnsjF/ls0r980YRQDlAqBylIqylcCzf4lHecB5veigSfmYoBycaxN2SHgT8e7pWKZwCzqzZpigUr9DlRuoIxXn8pIZJgHtkwpa8togHIiw587LeNx9mc2ZwIK5DOlXJaMFqhWwoMp/Ax+1W+ToOXTHGKNrDMLLo38LmKsQKmbdSrWil+N82UJaS40YTuJv/RdtAdpzet+aJDzvMpQV71oo2gYX5RXG2HnYZXtouzNRzXE3R0KE6jWjZU2iaZ9u8pqpU3UfvwrYSgSBVDtGDurBlHn/zj0QMIh7qlDNOfmcBj9ihKo9o+l1euiWGxSE5eun3na6jxQk3joEgdQ7TR+FWutE43lhQpph3sQvISAVRa9ppRzipY4gZqdw8/WigIWDWt1gD8EIsqSLlT/KPUVlKSAujs2XTLYeRHiIlA2DVi1qkRtK8PSULaEDF+Ue7ashwkTlf8DQc/cITdx9+UAAAAASUVORK5CYII=";function _h(o){i.append_styles(o,"svelte-1ogmlqq",".arrow.svelte-1ogmlqq{width:100%;height:100%;background-size:100%;transition:transform 400ms ease-in-out;cursor:pointer;pointer-events:auto}.arrow-wrapper.svelte-1ogmlqq{position:relative;width:100%;height:100%}.arrow.left.svelte-1ogmlqq{transform:rotate(0deg)}.arrow.right.svelte-1ogmlqq{transform:rotate(-180deg)}.arrow.top.svelte-1ogmlqq{transform:rotate(90deg)}.arrow.bottom.svelte-1ogmlqq{transform:rotate(-90deg)}")}function po(o){let t,e,n,s,r,a,l,c,d,u;return e=new ve({props:{center:!0,blurRadius:9,spreadRadius:3}}),{c(){t=i.element("div"),i.create_component(e.$$.fragment),n=i.space(),s=i.element("div"),i.attr(s,"class",r="arrow "+o[0]+" svelte-1ogmlqq"),i.set_style(s,"background-image","url("+Lh+")"),i.attr(t,"class","arrow-wrapper svelte-1ogmlqq")},m(f,h){i.insert(f,t,h),i.mount_component(e,t,null),i.append(t,n),i.append(t,s),c=!0,d||(u=i.listen(s,"click",o[5]),d=!0)},p(f,h){o=f,(!c||h&1&&r!==(r="arrow "+o[0]+" svelte-1ogmlqq"))&&i.attr(s,"class",r)},i(f){c||(i.transition_in(e.$$.fragment,f),f&&i.add_render_callback(()=>{l&&l.end(1),a=i.create_in_transition(s,me.fade,{duration:o[2],delay:o[3],easing:Se.cubicInOut}),a.start()}),c=!0)},o(f){i.transition_out(e.$$.fragment,f),a&&a.invalidate(),f&&(l=i.create_out_transition(s,me.fade,{duration:o[2],delay:o[4],easing:Se.cubicInOut})),c=!1},d(f){f&&i.detach(t),i.destroy_component(e),f&&l&&l.end(),d=!1,u()}}}function zh(o){let t,e,n=o[1]&&po(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[1]?n?(n.p(s,r),r&2&&i.transition_in(n,1)):(n=po(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function Mh(o,t,e){let{direction:n="right"}=t,{visible:s=!0}=t,{duration:r=0}=t,{inDelay:a=0}=t,{outDelay:l=0}=t;function c(d){i.bubble.call(this,o,d)}return o.$$set=d=>{"direction"in d&&e(0,n=d.direction),"visible"in d&&e(1,s=d.visible),"duration"in d&&e(2,r=d.duration),"inDelay"in d&&e(3,a=d.inDelay),"outDelay"in d&&e(4,l=d.outDelay)},[n,s,r,a,l,c]}class Th extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Mh,zh,i.safe_not_equal,{direction:0,visible:1,duration:2,inDelay:3,outDelay:4},_h)}}function jh(o,t,e=20,n=5){return new Promise((s,r)=>{let a=0;const l=setInterval(()=>{const c=o();t(c)?(clearInterval(l),s(c)):a>=n&&(clearInterval(l),r(c)),a++},e)})}function Bh(o){i.append_styles(o,"svelte-1fuzm7v",".text.svelte-1fuzm7v{pointer-events:auto;box-sizing:border-box;display:inline-block;max-width:7.5rem;transition:transform 400ms ease-in-out;font-size:0.75rem;line-height:1.125rem;white-space:initial;cursor:pointer}.arrow.svelte-1fuzm7v{pointer-events:auto;display:inline-block;vertical-align:top;width:0.875rem;height:0.875rem;margin-left:0.125rem;margin-top:0.125rem}")}function go(o,t,e){const n=o.slice();return n[11]=t[e].id,n[12]=t[e].content,n}function Ao(o,t){let e,n,s;return n=new Zs({props:{unfolded:t[0],content:t[12],inDelay:500,outDelay:t[5]}}),{key:o,first:null,c(){e=i.element("div"),i.create_component(n.$$.fragment),i.attr(e,"class","text svelte-1fuzm7v"),i.set_style(e,"transform",t[7],!1),this.first=e},m(r,a){i.insert(r,e,a),i.mount_component(n,e,null),t[10](e),s=!0},p(r,a){t=r;const l={};a&1&&(l.unfolded=t[0]),a&2&&(l.content=t[12]),a&32&&(l.outDelay=t[5]),n.$set(l),a&128&&i.set_style(e,"transform",t[7],!1)},i(r){s||(i.transition_in(n.$$.fragment,r),s=!0)},o(r){i.transition_out(n.$$.fragment,r),s=!1},d(r){r&&i.detach(e),i.destroy_component(n),t[10](null)}}}function vo(o){let t,e,n;return e=new Th({props:{direction:o[6],visible:o[0],inDelay:600,duration:1e3}}),{c(){t=i.element("div"),i.create_component(e.$$.fragment),i.attr(t,"class","arrow svelte-1fuzm7v")},m(s,r){i.insert(s,t,r),i.mount_component(e,t,null),n=!0},p(s,r){const a={};r&64&&(a.direction=s[6]),r&1&&(a.visible=s[0]),e.$set(a)},i(s){n||(i.transition_in(e.$$.fragment,s),n=!0)},o(s){i.transition_out(e.$$.fragment,s),n=!1},d(s){s&&i.detach(t),i.destroy_component(e)}}}function Qh(o){let t=[],e=new Map,n,s,r,a=o[1];const l=d=>d[11];for(let d=0;d<a.length;d+=1){let u=go(o,a,d),f=l(u);e.set(f,t[d]=Ao(f,u))}let c=o[3]<o[4]&&vo(o);return{c(){for(let d=0;d<t.length;d+=1)t[d].c();n=i.space(),c&&c.c(),s=i.empty()},m(d,u){for(let f=0;f<t.length;f+=1)t[f].m(d,u);i.insert(d,n,u),c&&c.m(d,u),i.insert(d,s,u),r=!0},p(d,[u]){u&167&&(a=d[1],i.group_outros(),t=i.update_keyed_each(t,u,l,1,d,a,e,n.parentNode,i.outro_and_destroy_block,Ao,n,go),i.check_outros()),d[3]<d[4]?c?(c.p(d,u),u&24&&i.transition_in(c,1)):(c=vo(d),c.c(),i.transition_in(c,1),c.m(s.parentNode,s)):c&&(i.group_outros(),i.transition_out(c,1,1,()=>{c=null}),i.check_outros())},i(d){if(!r){for(let u=0;u<a.length;u+=1)i.transition_in(t[u]);i.transition_in(c),r=!0}},o(d){for(let u=0;u<t.length;u+=1)i.transition_out(t[u]);i.transition_out(c),r=!1},d(d){for(let u=0;u<t.length;u+=1)t[u].d(d);d&&i.detach(n),c&&c.d(d),d&&i.detach(s)}}}function Rh(o,t,e){let n,s,r,{visible:a=!1}=t,{textUnfolded:l=!1}=t,{textItems:c}=t,d,u=0,f=0,h=0;function p(g){i.binding_callbacks[g?"unshift":"push"](()=>{d=g,e(2,d)})}return o.$$set=g=>{"visible"in g&&e(0,a=g.visible),"textUnfolded"in g&&e(8,l=g.textUnfolded),"textItems"in g&&e(1,c=g.textItems)},o.$$.update=()=>{if(o.$$.dirty&5&&d&&a){const{lineHeight:g}=getComputedStyle(d);e(4,h=d.offsetHeight),jh(()=>d==null?void 0:d.offsetHeight,Boolean).then(()=>{e(4,h=d.offsetHeight)}),e(3,f=Number(g.replace("px","")))}o.$$.dirty&280&&e(9,u=l?f-h:0),o.$$.dirty&512&&e(7,n=`translateY(${u}px)`),o.$$.dirty&256&&e(6,s=l?"left":"right"),o.$$.dirty&256&&e(5,r=l?450:0)},[a,c,d,f,h,r,s,n,l,u,p]}class qs extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Rh,Qh,i.safe_not_equal,{visible:0,textUnfolded:8,textItems:1},Bh)}}function Oh(o){i.append_styles(o,"svelte-18yy5x8",".line.svelte-18yy5x8{position:absolute;top:0;left:0;width:10.125rem;height:0.0625rem;transform:translate3d(0, -50%, 0.625rem)}.content.svelte-18yy5x8{width:-moz-max-content;width:max-content;height:3.375rem;padding:2.25rem 0.25rem 0 1rem;position:absolute;left:0;bottom:0;overflow:hidden;box-sizing:border-box;font-size:0;pointer-events:none;white-space:nowrap;font-weight:600}")}function bo(o){var h,p;let t,e,n,s,r,a,l,c,d,u,f;return t=new ve({props:{visible:o[2],left:o[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}}),s=new Js({props:{unfolded:o[2],duration:1e3,outDelay:o[5]+40*Math.min((p=(h=o[4][0])==null?void 0:h.content.length)!=null?p:10,15)}}),l=new qs({props:{visible:o[2],textUnfolded:o[1],textItems:o[4]}}),{c(){i.create_component(t.$$.fragment),e=i.space(),n=i.element("div"),i.create_component(s.$$.fragment),r=i.space(),a=i.element("div"),i.create_component(l.$$.fragment),i.attr(n,"class","line svelte-18yy5x8"),i.set_style(n,"width",o[3]+"px",!1),i.attr(a,"class","content svelte-18yy5x8"),i.add_render_callback(()=>o[8].call(a))},m(g,A){i.mount_component(t,g,A),i.insert(g,e,A),i.insert(g,n,A),i.mount_component(s,n,null),i.insert(g,r,A),i.insert(g,a,A),i.mount_component(l,a,null),c=i.add_resize_listener(a,o[8].bind(a)),d=!0,u||(f=i.listen(a,"click",o[6]),u=!0)},p(g,A){var y,I;const b={};A&4&&(b.visible=g[2]),A&8&&(b.left=g[3]/2+"px"),t.$set(b);const v={};A&4&&(v.unfolded=g[2]),A&48&&(v.outDelay=g[5]+40*Math.min((I=(y=g[4][0])==null?void 0:y.content.length)!=null?I:10,15)),s.$set(v),A&8&&i.set_style(n,"width",g[3]+"px",!1);const w={};A&4&&(w.visible=g[2]),A&2&&(w.textUnfolded=g[1]),A&16&&(w.textItems=g[4]),l.$set(w)},i(g){d||(i.transition_in(t.$$.fragment,g),i.transition_in(s.$$.fragment,g),i.transition_in(l.$$.fragment,g),d=!0)},o(g){i.transition_out(t.$$.fragment,g),i.transition_out(s.$$.fragment,g),i.transition_out(l.$$.fragment,g),d=!1},d(g){i.destroy_component(t,g),g&&i.detach(e),g&&i.detach(n),i.destroy_component(s),g&&i.detach(r),g&&i.detach(a),i.destroy_component(l),c(),u=!1,f()}}}function Hh(o){let t,e,n=o[0].state&&bo(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[0].state?n?(n.p(s,r),r&1&&i.transition_in(n,1)):(n=bo(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function Fh(o,t,e){let n,s,r,{tag:a}=t,l,c=!1,d=[];function u(){e(1,c=!c)}function f(){l=this.clientWidth,e(3,l)}return o.$$set=h=>{"tag"in h&&e(0,a=h.tag)},o.$$.update=()=>{var h;o.$$.dirty&1&&e(2,n=!!((h=a.state)!=null&&h.unfolded)),o.$$.dirty&1&&e(7,s=a.data.text),o.$$.dirty&128&&e(4,d=[{id:ue(),content:s}]),o.$$.dirty&4&&(n||setTimeout(()=>{e(1,c=!1)},20)),o.$$.dirty&2&&e(5,r=c?450:0)},[a,c,n,l,d,r,u,s,f]}class Gh extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Fh,Hh,i.safe_not_equal,{tag:0},Oh)}}function Nh(o){i.append_styles(o,"svelte-e72ouh",".line.svelte-e72ouh{width:100%;height:100%;overflow:visible}")}function yo(o){let t,e,n,s;return{c(){t=i.svg_element("path"),i.attr(t,"fill","none"),i.attr(t,"stroke","url(#"+o[4]+")"),i.attr(t,"stroke-width","1"),i.attr(t,"d","M0 21 L14 0.5 L105 0.5")},m(r,a){i.insert(r,t,a),s=!0},p(r,a){o=r},i(r){s||(r&&i.add_render_callback(()=>{n&&n.end(1),e=i.create_in_transition(t,me.draw,{duration:o[1],delay:o[0],easing:Se.cubicOut}),e.start()}),s=!0)},o(r){e&&e.invalidate(),r&&(n=i.create_out_transition(t,me.draw,{duration:o[1],delay:o[2],easing:Se.cubicInOut})),s=!1},d(r){r&&i.detach(t),r&&n&&n.end()}}}function Wh(o){let t,e,n,s,r,a=o[3]&&yo(o);return{c(){t=i.svg_element("svg"),e=i.svg_element("defs"),n=i.svg_element("linearGradient"),s=i.svg_element("stop"),r=i.svg_element("stop"),a&&a.c(),i.attr(s,"offset","25%"),i.attr(s,"stop-color","white"),i.attr(s,"stop-opacity","1"),i.attr(r,"offset","100%"),i.attr(r,"stop-color","white"),i.attr(r,"stop-opacity","0.5"),i.attr(n,"id",o[4]),i.attr(n,"gradientUnits","userSpaceOnUse"),i.attr(t,"class","line svelte-e72ouh"),i.attr(t,"viewBox","0 0 105 21")},m(l,c){i.insert(l,t,c),i.append(t,e),i.append(e,n),i.append(n,s),i.append(n,r),a&&a.m(t,null)},p(l,[c]){l[3]?a?(a.p(l,c),c&8&&i.transition_in(a,1)):(a=yo(l),a.c(),i.transition_in(a,1),a.m(t,null)):a&&(i.group_outros(),i.transition_out(a,1,1,()=>{a=null}),i.check_outros())},i(l){i.transition_in(a)},o(l){i.transition_out(a)},d(l){l&&i.detach(t),a&&a.d()}}}function Xh(o,t,e){let{inDelay:n=0}=t,{duration:s=0}=t,{outDelay:r=0}=t,{unfolded:a}=t;const l=ue();return o.$$set=c=>{"inDelay"in c&&e(0,n=c.inDelay),"duration"in c&&e(1,s=c.duration),"outDelay"in c&&e(2,r=c.outDelay),"unfolded"in c&&e(3,a=c.unfolded)},[n,s,r,a,l]}class Yh extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Xh,Wh,i.safe_not_equal,{inDelay:0,duration:1,outDelay:2,unfolded:3},Nh)}}function Ve(o){return typeof o=="object"&&o!==null&&o.constructor&&Object.prototype.toString.call(o).slice(8,-1)==="Object"}function Te(o,t){const e=["__proto__","constructor","prototype"];Object.keys(t).filter(n=>e.indexOf(n)<0).forEach(n=>{typeof o[n]=="undefined"?o[n]=t[n]:Ve(t[n])&&Ve(o[n])&&Object.keys(t[n]).length>0?t[n].__swiper__?o[n]=t[n]:Te(o[n],t[n]):o[n]=t[n]})}function yn(o={}){return o.navigation&&typeof o.navigation.nextEl=="undefined"&&typeof o.navigation.prevEl=="undefined"}function wn(o={}){return o.pagination&&typeof o.pagination.el=="undefined"}function Cn(o={}){return o.scrollbar&&typeof o.scrollbar.el=="undefined"}function Ht(o=""){const t=o.split(" ").map(n=>n.trim()).filter(n=>!!n),e=[];return t.forEach(n=>{e.indexOf(n)<0&&e.push(n)}),e.join(" ")}const Ks=["modules","init","_direction","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_preloadImages","updateOnImagesReady","_loop","_loopAdditionalSlides","_loopedSlides","_loopedSlidesLimit","_loopFillGroupWithBlank","loopPreventsSlide","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideBlankClass","slideActiveClass","slideDuplicateActiveClass","slideVisibleClass","slideDuplicateClass","slideNextClass","slideDuplicateNextClass","slidePrevClass","slideDuplicatePrevClass","wrapperClass","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","lazy","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom"];function Uh(o={},t=!0){const e={on:{}},n={},s={};Te(e,mn.default.defaults),Te(e,mn.default.extendedDefaults),e._emitClasses=!0,e.init=!1;const r={},a=Ks.map(c=>c.replace(/_/,"")),l=Object.assign({},o);return Object.keys(l).forEach(c=>{typeof o[c]!="undefined"&&(a.indexOf(c)>=0?Ve(o[c])?(e[c]={},s[c]={},Te(e[c],o[c]),Te(s[c],o[c])):(e[c]=o[c],s[c]=o[c]):c.search(/on[A-Z]/)===0&&typeof o[c]=="function"?t?n[`${c[2].toLowerCase()}${c.substr(3)}`]=o[c]:e.on[`${c[2].toLowerCase()}${c.substr(3)}`]=o[c]:r[c]=o[c])}),["navigation","pagination","scrollbar"].forEach(c=>{e[c]===!0&&(e[c]={}),e[c]===!1&&delete e[c]}),{params:e,passedParams:s,rest:r,events:n}}function Vh({el:o,nextEl:t,prevEl:e,paginationEl:n,scrollbarEl:s,swiper:r},a){yn(a)&&t&&e&&(r.params.navigation.nextEl=t,r.originalParams.navigation.nextEl=t,r.params.navigation.prevEl=e,r.originalParams.navigation.prevEl=e),wn(a)&&n&&(r.params.pagination.el=n,r.originalParams.pagination.el=n),Cn(a)&&s&&(r.params.scrollbar.el=s,r.originalParams.scrollbar.el=s),r.init(o)}function Jh(o,t,e,n,s){const r=[];if(!t)return r;const a=c=>{r.indexOf(c)<0&&r.push(c)};if(e&&n){const c=n.map(s),d=e.map(s);c.join("")!==d.join("")&&a("children"),n.length!==e.length&&a("children")}return Ks.filter(c=>c[0]==="_").map(c=>c.replace(/_/,"")).forEach(c=>{if(c in o&&c in t)if(Ve(o[c])&&Ve(t[c])){const d=Object.keys(o[c]),u=Object.keys(t[c]);d.length!==u.length?a(c):(d.forEach(f=>{o[c][f]!==t[c][f]&&a(c)}),u.forEach(f=>{o[c][f]!==t[c][f]&&a(c)}))}else o[c]!==t[c]&&a(c)}),r}function Zh({swiper:o,slides:t,passedParams:e,changedParams:n,nextEl:s,prevEl:r,scrollbarEl:a,paginationEl:l}){const c=n.filter(k=>k!=="children"&&k!=="direction"),{params:d,pagination:u,navigation:f,scrollbar:h,virtual:p,thumbs:g}=o;let A,b,v,w,y;n.includes("thumbs")&&e.thumbs&&e.thumbs.swiper&&d.thumbs&&!d.thumbs.swiper&&(A=!0),n.includes("controller")&&e.controller&&e.controller.control&&d.controller&&!d.controller.control&&(b=!0),n.includes("pagination")&&e.pagination&&(e.pagination.el||l)&&(d.pagination||d.pagination===!1)&&u&&!u.el&&(v=!0),n.includes("scrollbar")&&e.scrollbar&&(e.scrollbar.el||a)&&(d.scrollbar||d.scrollbar===!1)&&h&&!h.el&&(w=!0),n.includes("navigation")&&e.navigation&&(e.navigation.prevEl||r)&&(e.navigation.nextEl||s)&&(d.navigation||d.navigation===!1)&&f&&!f.prevEl&&!f.nextEl&&(y=!0);const I=k=>{!o[k]||(o[k].destroy(),k==="navigation"?(d[k].prevEl=void 0,d[k].nextEl=void 0,o[k].prevEl=void 0,o[k].nextEl=void 0):(d[k].el=void 0,o[k].el=void 0))};c.forEach(k=>{if(Ve(d[k])&&Ve(e[k]))Te(d[k],e[k]);else{const C=e[k];(C===!0||C===!1)&&(k==="navigation"||k==="pagination"||k==="scrollbar")?C===!1&&I(k):d[k]=e[k]}}),c.includes("controller")&&!b&&o.controller&&o.controller.control&&d.controller&&d.controller.control&&(o.controller.control=d.controller.control),n.includes("children")&&t&&p&&d.virtual.enabled?(p.slides=t,p.update(!0)):n.includes("children")&&o.lazy&&o.params.lazy.enabled&&o.lazy.load(),A&&g.init()&&g.update(!0),b&&(o.controller.control=d.controller.control),v&&(l&&(d.pagination.el=l),u.init(),u.render(),u.update()),w&&(a&&(d.scrollbar.el=a),h.init(),h.updateSize(),h.setTranslate()),y&&(s&&(d.navigation.nextEl=s),r&&(d.navigation.prevEl=r),f.init(),f.update()),n.includes("allowSlideNext")&&(o.allowSlideNext=e.allowSlideNext),n.includes("allowSlidePrev")&&(o.allowSlidePrev=e.allowSlidePrev),n.includes("direction")&&o.changeDirection(e.direction,!1),o.update()}const qh=o=>({virtualData:o&512}),wo=o=>({virtualData:o[9]}),Kh=o=>({virtualData:o&512}),Co=o=>({virtualData:o[9]}),$h=o=>({virtualData:o&512}),Eo=o=>({virtualData:o[9]}),ef=o=>({virtualData:o&512}),Po=o=>({virtualData:o[9]}),tf=o=>({virtualData:o&512}),Io=o=>({virtualData:o[9]});function ko(o){let t,e,n;return{c(){t=i.element("div"),e=i.space(),n=i.element("div"),i.attr(t,"class","swiper-button-prev"),i.attr(n,"class","swiper-button-next")},m(s,r){i.insert(s,t,r),o[13](t),i.insert(s,e,r),i.insert(s,n,r),o[14](n)},p:i.noop,d(s){s&&i.detach(t),o[13](null),s&&i.detach(e),s&&i.detach(n),o[14](null)}}}function xo(o){let t;return{c(){t=i.element("div"),i.attr(t,"class","swiper-scrollbar")},m(e,n){i.insert(e,t,n),o[15](t)},p:i.noop,d(e){e&&i.detach(t),o[15](null)}}}function Do(o){let t;return{c(){t=i.element("div"),i.attr(t,"class","swiper-pagination")},m(e,n){i.insert(e,t,n),o[16](t)},p:i.noop,d(e){e&&i.detach(t),o[16](null)}}}function nf(o){let t,e,n,s,r,a,l=yn(o[2]),c,d=Cn(o[2]),u,f=wn(o[2]),h,p,g;const A=o[12]["container-start"],b=i.create_slot(A,o,o[11],Io),v=o[12]["wrapper-start"],w=i.create_slot(v,o,o[11],Po),y=o[12].default,I=i.create_slot(y,o,o[11],Eo),k=o[12]["wrapper-end"],C=i.create_slot(k,o,o[11],Co);let D=l&&ko(o),x=d&&xo(o),z=f&&Do(o);const _=o[12]["container-end"],T=i.create_slot(_,o,o[11],wo);let H=[{class:p=Ht(`${o[1]}${o[0]?` ${o[0]}`:""}`)},o[3]],E={};for(let S=0;S<H.length;S+=1)E=i.assign(E,H[S]);return{c(){t=i.element("div"),b&&b.c(),e=i.space(),n=i.element("div"),w&&w.c(),s=i.space(),I&&I.c(),r=i.space(),C&&C.c(),a=i.space(),D&&D.c(),c=i.space(),x&&x.c(),u=i.space(),z&&z.c(),h=i.space(),T&&T.c(),i.attr(n,"class","swiper-wrapper"),i.set_attributes(t,E)},m(S,L){i.insert(S,t,L),b&&b.m(t,null),i.append(t,e),i.append(t,n),w&&w.m(n,null),i.append(n,s),I&&I.m(n,null),i.append(n,r),C&&C.m(n,null),i.append(t,a),D&&D.m(t,null),i.append(t,c),x&&x.m(t,null),i.append(t,u),z&&z.m(t,null),i.append(t,h),T&&T.m(t,null),o[17](t),g=!0},p(S,[L]){b&&b.p&&(!g||L&2560)&&i.update_slot_base(b,A,S,S[11],g?i.get_slot_changes(A,S[11],L,tf):i.get_all_dirty_from_scope(S[11]),Io),w&&w.p&&(!g||L&2560)&&i.update_slot_base(w,v,S,S[11],g?i.get_slot_changes(v,S[11],L,ef):i.get_all_dirty_from_scope(S[11]),Po),I&&I.p&&(!g||L&2560)&&i.update_slot_base(I,y,S,S[11],g?i.get_slot_changes(y,S[11],L,$h):i.get_all_dirty_from_scope(S[11]),Eo),C&&C.p&&(!g||L&2560)&&i.update_slot_base(C,k,S,S[11],g?i.get_slot_changes(k,S[11],L,Kh):i.get_all_dirty_from_scope(S[11]),Co),L&4&&(l=yn(S[2])),l?D?D.p(S,L):(D=ko(S),D.c(),D.m(t,c)):D&&(D.d(1),D=null),L&4&&(d=Cn(S[2])),d?x?x.p(S,L):(x=xo(S),x.c(),x.m(t,u)):x&&(x.d(1),x=null),L&4&&(f=wn(S[2])),f?z?z.p(S,L):(z=Do(S),z.c(),z.m(t,h)):z&&(z.d(1),z=null),T&&T.p&&(!g||L&2560)&&i.update_slot_base(T,_,S,S[11],g?i.get_slot_changes(_,S[11],L,qh):i.get_all_dirty_from_scope(S[11]),wo),i.set_attributes(t,E=i.get_spread_update(H,[(!g||L&3&&p!==(p=Ht(`${S[1]}${S[0]?` ${S[0]}`:""}`)))&&{class:p},L&8&&S[3]]))},i(S){g||(i.transition_in(b,S),i.transition_in(w,S),i.transition_in(I,S),i.transition_in(C,S),i.transition_in(T,S),g=!0)},o(S){i.transition_out(b,S),i.transition_out(w,S),i.transition_out(I,S),i.transition_out(C,S),i.transition_out(T,S),g=!1},d(S){S&&i.detach(t),b&&b.d(S),w&&w.d(S),I&&I.d(S),C&&C.d(S),D&&D.d(),x&&x.d(),z&&z.d(),T&&T.d(S),o[17](null)}}}function of(o,t,e){const n=["class","swiper"];let s=i.compute_rest_props(t,n),{$$slots:r={},$$scope:a}=t;const l=Z.createEventDispatcher();let{class:c=void 0}=t,d="swiper",u=!1,f=null,h=null,p,g,A,b,v=null,w=null,y=null,I=null,k=null,C={slides:[]};function D(){return f}const x=B=>{e(9,C=B),Z.tick().then(()=>{f.$wrapperEl.children(".swiper-slide").each(R=>{R.onSwiper&&R.onSwiper(f)}),f.updateSlides(),f.updateProgress(),f.updateSlidesClasses(),f.lazy&&f.params.lazy.enabled&&f.lazy.load()})},z=()=>{p=Uh(s),e(2,g=p.params),A=p.passedParams,e(3,b=p.rest)};z(),h=A;const _=()=>{u=!0};if(g.onAny=(B,...R)=>{l(B,R)},Object.assign(g.on,{_beforeBreakpoint:_,_containerClasses(B,R){e(1,d=R)}}),f=new mn.default(g),Z.setContext("swiper",f),f.virtual&&f.params.virtual.enabled){const B={cache:!1,renderExternal:R=>{x(R),g.virtual&&g.virtual.renderExternal&&g.virtual.renderExternal(R)},renderExternalUpdate:!1};Te(f.params.virtual,B),Te(f.originalParams.virtual,B)}Z.onMount(()=>{!v||(Vh({el:v,nextEl:y,prevEl:w,paginationEl:k,scrollbarEl:I,swiper:f},g),l("swiper",[f]),!g.virtual&&f.slides.each(B=>{B.onSwiper&&B.onSwiper(f)}))}),Z.afterUpdate(()=>{if(!f)return;z();const B=Jh(A,h);(B.length||u)&&f&&!f.destroyed&&Zh({swiper:f,passedParams:A,changedParams:B,nextEl:y,prevEl:w,scrollbarEl:I,paginationEl:k}),u=!1,h=A}),Z.onDestroy(()=>{typeof window!="undefined"&&f&&!f.destroyed&&f.destroy(!0,!1)});function T(B){i.binding_callbacks[B?"unshift":"push"](()=>{w=B,e(5,w)})}function H(B){i.binding_callbacks[B?"unshift":"push"](()=>{y=B,e(6,y)})}function E(B){i.binding_callbacks[B?"unshift":"push"](()=>{I=B,e(7,I)})}function S(B){i.binding_callbacks[B?"unshift":"push"](()=>{k=B,e(8,k)})}function L(B){i.binding_callbacks[B?"unshift":"push"](()=>{v=B,e(4,v)})}return o.$$set=B=>{t=i.assign(i.assign({},t),i.exclude_internal_props(B)),e(27,s=i.compute_rest_props(t,n)),"class"in B&&e(0,c=B.class),"$$scope"in B&&e(11,a=B.$$scope)},[c,d,g,b,v,w,y,I,k,C,D,a,r,T,H,E,S,L]}class sf extends i.SvelteComponent{constructor(t){super(),i.init(this,t,of,nf,i.safe_not_equal,{class:0,swiper:10})}get swiper(){return this.$$.ctx[10]}}const rf=o=>({data:o&32}),So=o=>({data:o[5]}),af=o=>({data:o&32}),Lo=o=>({data:o[5]});function lf(o){let t;const e=o[8].default,n=i.create_slot(e,o,o[7],So);return{c(){n&&n.c()},m(s,r){n&&n.m(s,r),t=!0},p(s,r){n&&n.p&&(!t||r&160)&&i.update_slot_base(n,e,s,s[7],t?i.get_slot_changes(e,s[7],r,rf):i.get_all_dirty_from_scope(s[7]),So)},i(s){t||(i.transition_in(n,s),t=!0)},o(s){i.transition_out(n,s),t=!1},d(s){n&&n.d(s)}}}function cf(o){let t,e,n;const s=o[8].default,r=i.create_slot(s,o,o[7],Lo);return{c(){t=i.element("div"),r&&r.c(),i.attr(t,"class","swiper-zoom-container"),i.attr(t,"data-swiper-zoom",e=typeof o[0]=="number"?o[0]:void 0)},m(a,l){i.insert(a,t,l),r&&r.m(t,null),n=!0},p(a,l){r&&r.p&&(!n||l&160)&&i.update_slot_base(r,s,a,a[7],n?i.get_slot_changes(s,a[7],l,af):i.get_all_dirty_from_scope(a[7]),Lo),(!n||l&1&&e!==(e=typeof a[0]=="number"?a[0]:void 0))&&i.attr(t,"data-swiper-zoom",e)},i(a){n||(i.transition_in(r,a),n=!0)},o(a){i.transition_out(r,a),n=!1},d(a){a&&i.detach(t),r&&r.d(a)}}}function df(o){let t,e,n,s,r;const a=[cf,lf],l=[];function c(f,h){return f[0]?0:1}e=c(o),n=l[e]=a[e](o);let d=[{class:s=Ht(`${o[3]}${o[2]?` ${o[2]}`:""}`)},{"data-swiper-slide-index":o[1]},o[6]],u={};for(let f=0;f<d.length;f+=1)u=i.assign(u,d[f]);return{c(){t=i.element("div"),n.c(),i.set_attributes(t,u)},m(f,h){i.insert(f,t,h),l[e].m(t,null),o[9](t),r=!0},p(f,[h]){let p=e;e=c(f),e===p?l[e].p(f,h):(i.group_outros(),i.transition_out(l[p],1,1,()=>{l[p]=null}),i.check_outros(),n=l[e],n?n.p(f,h):(n=l[e]=a[e](f),n.c()),i.transition_in(n,1),n.m(t,null)),i.set_attributes(t,u=i.get_spread_update(d,[(!r||h&12&&s!==(s=Ht(`${f[3]}${f[2]?` ${f[2]}`:""}`)))&&{class:s},(!r||h&2)&&{"data-swiper-slide-index":f[1]},h&64&&f[6]]))},i(f){r||(i.transition_in(n),r=!0)},o(f){i.transition_out(n),r=!1},d(f){f&&i.detach(t),l[e].d(),o[9](null)}}}function uf(o,t,e){let n;const s=["zoom","virtualIndex","class"];let r=i.compute_rest_props(t,s),{$$slots:a={},$$scope:l}=t,{zoom:c=void 0}=t,{virtualIndex:d=void 0}=t,{class:u=void 0}=t,f=null,h="swiper-slide",p=Z.getContext("swiper"),g=!1;const A=(y,I,k)=>{I===f&&e(3,h=k)},b=()=>{!p||g||(p.on("_slideClass",A),g=!0)},v=()=>{!p||(p.off("_slideClass",A),g=!1)};Z.onMount(()=>{typeof d!="undefined"&&(e(4,f.onSwiper=y=>{p=y,b()},f),b())}),Z.afterUpdate(()=>{if(!(!f||!p)){if(p.destroyed){h!=="swiper-slide"&&e(3,h="swiper-slide");return}b()}}),Z.beforeUpdate(()=>{b()}),Z.onDestroy(()=>{!p||v()});function w(y){i.binding_callbacks[y?"unshift":"push"](()=>{f=y,e(4,f)})}return o.$$set=y=>{t=i.assign(i.assign({},t),i.exclude_internal_props(y)),e(6,r=i.compute_rest_props(t,s)),"zoom"in y&&e(0,c=y.zoom),"virtualIndex"in y&&e(1,d=y.virtualIndex),"class"in y&&e(2,u=y.class),"$$scope"in y&&e(7,l=y.$$scope)},o.$$.update=()=>{o.$$.dirty&8&&e(5,n={isActive:h.indexOf("swiper-slide-active")>=0||h.indexOf("swiper-slide-duplicate-active")>=0,isVisible:h.indexOf("swiper-slide-visible")>=0,isDuplicate:h.indexOf("swiper-slide-duplicate")>=0,isPrev:h.indexOf("swiper-slide-prev")>=0||h.indexOf("swiper-slide-duplicate-prev")>=0,isNext:h.indexOf("swiper-slide-next")>=0||h.indexOf("swiper-slide-duplicate-next")>=0})},[c,d,u,h,f,n,r,l,a,w]}class hf extends i.SvelteComponent{constructor(t){super(),i.init(this,t,uf,df,i.safe_not_equal,{zoom:0,virtualIndex:1,class:2})}}function ff(o){i.append_styles(o,"svelte-cwtvzu",".media-item.svelte-cwtvzu.svelte-cwtvzu{height:100%}.media-content.svelte-cwtvzu.svelte-cwtvzu{width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;-o-object-fit:inherit;object-fit:inherit}.video-icon.svelte-cwtvzu.svelte-cwtvzu{width:12.5rem;height:6.25rem;max-width:60%;max-height:60%;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.video-play-button-container.svelte-cwtvzu.svelte-cwtvzu{display:none;pointer-events:auto;position:absolute;width:100%;height:100%;top:0;left:0}.video-play-button-container.showPlayButton.svelte-cwtvzu.svelte-cwtvzu{display:block}.video-icon.large.svelte-cwtvzu.svelte-cwtvzu{width:12.5rem;height:6.25rem}.video-icon.small.svelte-cwtvzu.svelte-cwtvzu{width:1.75rem;height:1.75rem}.video-icon.svelte-cwtvzu .video-icon-img.svelte-cwtvzu{width:100%;height:100%;background-position:center center;background-size:contain;background-repeat:no-repeat}.video-icon.svelte-cwtvzu .video-icon-img.canPlay.svelte-cwtvzu{cursor:pointer}")}function _o(o){let t;function e(r,a){if(r[0].type==="Image")return pf;if(r[0].type==="Video")return mf}let n=e(o),s=n&&n(o);return{c(){t=i.element("div"),s&&s.c(),i.attr(t,"class","media-item svelte-cwtvzu")},m(r,a){i.insert(r,t,a),s&&s.m(t,null)},p(r,a){n===(n=e(r))&&s?s.p(r,a):(s&&s.d(1),s=n&&n(r),s&&(s.c(),s.m(t,null)))},d(r){r&&i.detach(t),s&&s.d()}}}function mf(o){let t,e,n,s,r,a,l,c,d,u,f;return{c(){var h;t=i.element("video"),a=i.space(),l=i.element("div"),c=i.element("div"),d=i.element("div"),i.attr(t,"class","media-content svelte-cwtvzu"),i.attr(t,"style",e=`object-fit: ${o[3]};`),i.src_url_equal(t.src,n=o[0].url+"#t=0.1")||i.attr(t,"src",n),i.attr(t,"poster",s=(h=o[0].videoCoverUrl)!=null?h:void 0),i.attr(t,"preload",r=o[0].videoCoverUrl?void 0:"auto"),t.playsInline=!0,i.attr(t,"paused",""),t.loop=!1,i.attr(t,"crossorigin",""),t.controls=!1,i.toggle_class(t,"showPlayButton",o[5]),i.attr(d,"class","video-icon-img svelte-cwtvzu"),i.set_style(d,"background-image","url("+(o[1]==="large"?fo:mo)+")"),i.toggle_class(d,"canPlay",o[2]),i.attr(c,"class","video-icon svelte-cwtvzu"),i.toggle_class(c,"large",o[1]==="large"),i.toggle_class(c,"small",o[1]==="small"),i.attr(l,"class","video-play-button-container svelte-cwtvzu"),i.toggle_class(l,"showPlayButton",o[5])},m(h,p){i.insert(h,t,p),o[7](t),i.insert(h,a,p),i.insert(h,l,p),i.append(l,c),i.append(c,d),u||(f=[i.listen(t,"click",o[6]),i.listen(d,"click",o[8])],u=!0)},p(h,p){var g;p&8&&e!==(e=`object-fit: ${h[3]};`)&&i.attr(t,"style",e),p&1&&!i.src_url_equal(t.src,n=h[0].url+"#t=0.1")&&i.attr(t,"src",n),p&1&&s!==(s=(g=h[0].videoCoverUrl)!=null?g:void 0)&&i.attr(t,"poster",s),p&1&&r!==(r=h[0].videoCoverUrl?void 0:"auto")&&i.attr(t,"preload",r),p&32&&i.toggle_class(t,"showPlayButton",h[5]),p&2&&i.set_style(d,"background-image","url("+(h[1]==="large"?fo:mo)+")"),p&4&&i.toggle_class(d,"canPlay",h[2]),p&2&&i.toggle_class(c,"large",h[1]==="large"),p&2&&i.toggle_class(c,"small",h[1]==="small"),p&32&&i.toggle_class(l,"showPlayButton",h[5])},d(h){h&&i.detach(t),o[7](null),h&&i.detach(a),h&&i.detach(l),u=!1,i.run_all(f)}}}function pf(o){let t,e,n,s;return{c(){t=i.element("img"),i.attr(t,"class","media-content svelte-cwtvzu"),i.attr(t,"style",e=`object-fit: ${o[3]};`),i.src_url_equal(t.src,n=o[0].url)||i.attr(t,"src",n),i.attr(t,"alt",s=o[0].name)},m(r,a){i.insert(r,t,a)},p(r,a){a&8&&e!==(e=`object-fit: ${r[3]};`)&&i.attr(t,"style",e),a&1&&!i.src_url_equal(t.src,n=r[0].url)&&i.attr(t,"src",n),a&1&&s!==(s=r[0].name)&&i.attr(t,"alt",s)},d(r){r&&i.detach(t)}}}function gf(o){let t,e=o[0]&&_o(o);return{c(){e&&e.c(),t=i.empty()},m(n,s){e&&e.m(n,s),i.insert(n,t,s)},p(n,[s]){n[0]?e?e.p(n,s):(e=_o(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:i.noop,o:i.noop,d(n){e&&e.d(n),n&&i.detach(t)}}}function Af(o,t,e){let{media:n}=t,{playButtonIfNeed:s="small"}=t,{canPlay:r=!0}=t,{objectFit:a="cover"}=t,l,c=!1;const d=()=>l==null?void 0:l.pause();function u(h){i.binding_callbacks[h?"unshift":"push"](()=>{l=h,e(4,l)})}const f=()=>{!r||l&&l.play()};return o.$$set=h=>{"media"in h&&e(0,n=h.media),"playButtonIfNeed"in h&&e(1,s=h.playButtonIfNeed),"canPlay"in h&&e(2,r=h.canPlay),"objectFit"in h&&e(3,a=h.objectFit)},o.$$.update=()=>{o.$$.dirty&16&&l&&(e(5,c=l.paused),l.addEventListener("play",()=>{e(5,c=!1)}),l.addEventListener("pause",()=>{e(5,c=!0)}))},[n,s,r,a,l,c,d,u,f]}class $s extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Af,gf,i.safe_not_equal,{media:0,playButtonIfNeed:1,canPlay:2,objectFit:3},ff)}}function vf(o){i.append_styles(o,"svelte-ai0lv9",".media.svelte-ai0lv9{width:100%;height:100%;position:relative;overflow:hidden;border-radius:0.125rem}")}function zo(o,t,e){const n=o.slice();return n[23]=t[e],n}function Mo(o){let t,e,n,s,r,a;const l=[yf,bf],c=[];function d(u,f){return u[13]?0:1}return e=d(o),n=c[e]=l[e](o),{c(){t=i.element("div"),n.c(),i.attr(t,"class","media svelte-ai0lv9"),i.toggle_class(t,"unfolded",o[4])},m(u,f){i.insert(u,t,f),c[e].m(t,null),a=!0},p(u,f){o=u;let h=e;e=d(o),e===h?c[e].p(o,f):(i.group_outros(),i.transition_out(c[h],1,1,()=>{c[h]=null}),i.check_outros(),n=c[e],n?n.p(o,f):(n=c[e]=l[e](o),n.c()),i.transition_in(n,1),n.m(t,null)),f&16&&i.toggle_class(t,"unfolded",o[4])},i(u){a||(i.transition_in(n),u&&i.add_render_callback(()=>{r&&r.end(1),s=i.create_in_transition(t,me.fly,o[5]?{y:4,duration:o[3],delay:o[1],easing:Se.linear}:void 0),s.start()}),a=!0)},o(u){i.transition_out(n),s&&s.invalidate(),u&&(r=i.create_out_transition(t,me.fly,o[5]?{y:4,duration:o[3],delay:o[2],easing:Se.linear}:void 0)),a=!1},d(u){u&&i.detach(t),c[e].d(),u&&r&&r.end()}}}function bf(o){let t,e;return t=new $s({props:{media:o[0][0],objectFit:o[8],playButtonIfNeed:o[6],canPlay:o[7]}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&1&&(r.media=n[0][0]),s&256&&(r.objectFit=n[8]),s&64&&(r.playButtonIfNeed=n[6]),s&128&&(r.canPlay=n[7]),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function yf(o){let t,e;return t=new sf({props:{style:"height: 100%",modules:[ds.Autoplay],spaceBetween:30,autoplay:o[14]?re({delay:4e3,stopOnLastSlide:!1,disableOnInteraction:!1}):!1,loop:!0,$$slots:{default:[Cf]},$$scope:{ctx:o}}}),t.$on("init",o[19]),t.$on("slideChange",o[20]),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&16384&&(r.autoplay=n[14]?re({delay:4e3,stopOnLastSlide:!1,disableOnInteraction:!1}):!1),s&67111360&&(r.$$scope={dirty:s,ctx:n}),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function wf(o){let t,e,n;return t=new $s({props:{media:o[23],objectFit:o[8],playButtonIfNeed:o[6],canPlay:o[7]}}),{c(){i.create_component(t.$$.fragment),e=i.space()},m(s,r){i.mount_component(t,s,r),i.insert(s,e,r),n=!0},p(s,r){const a={};r&2048&&(a.media=s[23]),r&256&&(a.objectFit=s[8]),r&64&&(a.playButtonIfNeed=s[6]),r&128&&(a.canPlay=s[7]),t.$set(a)},i(s){n||(i.transition_in(t.$$.fragment,s),n=!0)},o(s){i.transition_out(t.$$.fragment,s),n=!1},d(s){i.destroy_component(t,s),s&&i.detach(e)}}}function To(o){let t,e;return t=new hf({props:{$$slots:{default:[wf]},$$scope:{ctx:o}}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&67111360&&(r.$$scope={dirty:s,ctx:n}),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function Cf(o){let t,e,n=o[11],s=[];for(let a=0;a<n.length;a+=1)s[a]=To(zo(o,n,a));const r=a=>i.transition_out(s[a],1,1,()=>{s[a]=null});return{c(){for(let a=0;a<s.length;a+=1)s[a].c();t=i.empty()},m(a,l){for(let c=0;c<s.length;c+=1)s[c].m(a,l);i.insert(a,t,l),e=!0},p(a,l){if(l&2496){n=a[11];let c;for(c=0;c<n.length;c+=1){const d=zo(a,n,c);s[c]?(s[c].p(d,l),i.transition_in(s[c],1)):(s[c]=To(d),s[c].c(),i.transition_in(s[c],1),s[c].m(t.parentNode,t))}for(i.group_outros(),c=n.length;c<s.length;c+=1)r(c);i.check_outros()}},i(a){if(!e){for(let l=0;l<n.length;l+=1)i.transition_in(s[l]);e=!0}},o(a){s=s.filter(Boolean);for(let l=0;l<s.length;l+=1)i.transition_out(s[l]);e=!1},d(a){i.destroy_each(s,a),a&&i.detach(t)}}}function Ef(o){let t,e,n=o[4]&&Mo(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[4]?n?(n.p(s,r),r&16&&i.transition_in(n,1)):(n=Mo(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function Pf(o,t,e){let n,s,r,{tag:a}=t,{mediaData:l}=t,{inDelay:c=0}=t,{outDelay:d=0}=t,{duration:u=0}=t,{unfolded:f=!0}=t,{animation:h=!0}=t,{playButtonIfNeed:p="small"}=t,{canPlay:g=!0}=t,{objectFit:A="cover"}=t,{enableCarousel:b=!0}=t,{autoplayConfig:v={autoplay:!0,autoplayVideo:!1}}=t;const w=Z.getContext("mediaStore"),y=Z.getContext("hooks");let I;function k(_){!n||!I||(w.set({currentMediaUrl:this.src}),y.emit("playStateChange",{event:_,state:"playing",tag:a,mediaInstance:this}),I.autoplay.stop())}function C(_){!n||!I||(y.emit("playStateChange",{event:_,state:"paused",tag:a,mediaInstance:this}),I.autoplay.running||I.autoplay.start())}let D=null;const x=_=>{e(10,I=_.detail[0])},z=_=>F(this,null,function*(){var B,R,G;if(!r||!v.autoplayVideo)return;const T=_.detail[0];if(!T)return;const H=T.realIndex;if(H===D)return;e(12,D=H);const E=s[H];if(!E||E.type!=="Video")return;T.autoplay.stop(),T.slides.map(Q=>Q.querySelector("video")).filter(Ue).forEach(Q=>Q.pause());const L=(B=T.slides[T.activeIndex])==null?void 0:B.querySelector("video");if(L&&(L.removeEventListener("play",k),L.removeEventListener("pause",C),L.addEventListener("play",k),L.addEventListener("pause",C)),L){L.addEventListener("click",()=>L.pause());const Q=(G=(R=L.parentElement)==null?void 0:R.getElementsByClassName("video-play-button-container"))==null?void 0:G[0];L.addEventListener("play",()=>Q==null?void 0:Q.classList.remove("showPlayButton")),L.addEventListener("pause",()=>Q==null?void 0:Q.classList.add("showPlayButton")),Q&&(L.paused?Q.classList.add("showPlayButton"):Q.classList.remove("showPlayButton"),Q.addEventListener("click",()=>L.play()))}});return o.$$set=_=>{"tag"in _&&e(17,a=_.tag),"mediaData"in _&&e(0,l=_.mediaData),"inDelay"in _&&e(1,c=_.inDelay),"outDelay"in _&&e(2,d=_.outDelay),"duration"in _&&e(3,u=_.duration),"unfolded"in _&&e(4,f=_.unfolded),"animation"in _&&e(5,h=_.animation),"playButtonIfNeed"in _&&e(6,p=_.playButtonIfNeed),"canPlay"in _&&e(7,g=_.canPlay),"objectFit"in _&&e(8,A=_.objectFit),"enableCarousel"in _&&e(18,b=_.enableCarousel),"autoplayConfig"in _&&e(9,v=_.autoplayConfig)},o.$$.update=()=>{o.$$.dirty&262145&&e(13,n=b&&(l==null?void 0:l.length)>1),o.$$.dirty&1&&e(11,s=l),o.$$.dirty&2560&&e(14,r=s.length>1&&v.autoplay),o.$$.dirty&1024&&I&&I.slides.forEach(_=>{const T=_.querySelector("video");T&&w.subscribe(({currentMediaUrl:H})=>{H!==T.src&&T.pause()})})},[l,c,d,u,f,h,p,g,A,v,I,s,D,n,r,k,C,a,b,x,z]}class er extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Pf,Ef,i.safe_not_equal,{tag:17,mediaData:0,inDelay:1,outDelay:2,duration:3,unfolded:4,animation:5,playButtonIfNeed:6,canPlay:7,objectFit:8,enableCarousel:18,autoplayConfig:9},vf)}}function If(o){i.append_styles(o,"svelte-1f7m1lj",".line.svelte-1f7m1lj{position:absolute;width:6.5625rem;height:1.3125rem;transform:translateY(-100%)}.text.svelte-1f7m1lj{position:absolute;width:6.25rem;left:1rem;bottom:0.0625rem;font-weight:600}.media-wrapper.svelte-1f7m1lj{position:absolute;left:0.875rem;top:-5.3125rem;width:5.625rem;height:3.75rem;font-weight:600}")}function jo(o,t,e){const n=o.slice();return n[5]=t[e].id,n[1]=t[e].content,n}function Bo(o){let t,e,n,s,r,a=[],l=new Map,c,d,u;t=new ve({props:{visible:o[4],left:61,bottom:57,width:2,blurRadius:150,spreadRadius:75}}),s=new Yh({props:{unfolded:o[4],duration:1e3,outDelay:400}});let f=o[2];const h=g=>g[5];for(let g=0;g<f.length;g+=1){let A=jo(o,f,g),b=h(A);l.set(b,a[g]=Qo(b,A))}let p=o[3]&&Ro(o);return{c(){i.create_component(t.$$.fragment),e=i.space(),n=i.element("div"),i.create_component(s.$$.fragment),r=i.space();for(let g=0;g<a.length;g+=1)a[g].c();c=i.space(),p&&p.c(),d=i.empty(),i.attr(n,"class","line svelte-1f7m1lj")},m(g,A){i.mount_component(t,g,A),i.insert(g,e,A),i.insert(g,n,A),i.mount_component(s,n,null),i.insert(g,r,A);for(let b=0;b<a.length;b+=1)a[b].m(g,A);i.insert(g,c,A),p&&p.m(g,A),i.insert(g,d,A),u=!0},p(g,A){const b={};A&16&&(b.visible=g[4]),t.$set(b);const v={};A&16&&(v.unfolded=g[4]),s.$set(v),A&20&&(f=g[2],i.group_outros(),a=i.update_keyed_each(a,A,h,1,g,f,l,c.parentNode,i.outro_and_destroy_block,Qo,c,jo),i.check_outros()),g[3]?p?(p.p(g,A),A&8&&i.transition_in(p,1)):(p=Ro(g),p.c(),i.transition_in(p,1),p.m(d.parentNode,d)):p&&(i.group_outros(),i.transition_out(p,1,1,()=>{p=null}),i.check_outros())},i(g){if(!u){i.transition_in(t.$$.fragment,g),i.transition_in(s.$$.fragment,g);for(let A=0;A<f.length;A+=1)i.transition_in(a[A]);i.transition_in(p),u=!0}},o(g){i.transition_out(t.$$.fragment,g),i.transition_out(s.$$.fragment,g);for(let A=0;A<a.length;A+=1)i.transition_out(a[A]);i.transition_out(p),u=!1},d(g){i.destroy_component(t,g),g&&i.detach(e),g&&i.detach(n),i.destroy_component(s),g&&i.detach(r);for(let A=0;A<a.length;A+=1)a[A].d(g);g&&i.detach(c),p&&p.d(g),g&&i.detach(d)}}}function Qo(o,t){let e,n,s;return n=new Zs({props:{unfolded:t[4],content:t[1],inDelay:500}}),{key:o,first:null,c(){e=i.element("div"),i.create_component(n.$$.fragment),i.attr(e,"class","text svelte-1f7m1lj"),this.first=e},m(r,a){i.insert(r,e,a),i.mount_component(n,e,null),s=!0},p(r,a){t=r;const l={};a&16&&(l.unfolded=t[4]),a&4&&(l.content=t[1]),n.$set(l)},i(r){s||(i.transition_in(n.$$.fragment,r),s=!0)},o(r){i.transition_out(n.$$.fragment,r),s=!1},d(r){r&&i.detach(e),i.destroy_component(n)}}}function Ro(o){let t,e,n;return e=new er({props:{autoplayConfig:{autoplay:!1},unfolded:o[4],mediaData:o[3],tag:o[0],enableCarousel:!1,canPlay:!1,playButtonIfNeed:"small",inDelay:500,duration:500}}),{c(){t=i.element("div"),i.create_component(e.$$.fragment),i.attr(t,"class","media-wrapper svelte-1f7m1lj")},m(s,r){i.insert(s,t,r),i.mount_component(e,t,null),n=!0},p(s,r){const a={};r&16&&(a.unfolded=s[4]),r&8&&(a.mediaData=s[3]),r&1&&(a.tag=s[0]),e.$set(a)},i(s){n||(i.transition_in(e.$$.fragment,s),n=!0)},o(s){i.transition_out(e.$$.fragment,s),n=!1},d(s){s&&i.detach(t),i.destroy_component(e)}}}function kf(o){let t,e,n=o[0].state&&Bo(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[0].state?n?(n.p(s,r),r&1&&i.transition_in(n,1)):(n=Bo(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function xf(o,t,e){let n,s,r,{tag:a}=t,l;return o.$$set=c=>{"tag"in c&&e(0,a=c.tag)},o.$$.update=()=>{var c,d,u;o.$$.dirty&1&&e(4,n=a.state?a.state.unfolded:!1),o.$$.dirty&1&&e(1,s=((d=(c=a.data.text)==null?void 0:c.length)!=null?d:0)>7?((u=a.data.text)==null?void 0:u.substring(0,6))+"...":a.data.text),o.$$.dirty&1&&e(3,r=a.data.mediaData),o.$$.dirty&2&&e(2,l=s?[{id:ue(),content:s}]:[])},[a,s,l,r,n]}class Df extends i.SvelteComponent{constructor(t){super(),i.init(this,t,xf,kf,i.safe_not_equal,{tag:0},If)}}function Sf(o){i.append_styles(o,"svelte-8mby9k",".svelte-8mby9k.svelte-8mby9k{box-sizing:border-box}.marketing.svelte-8mby9k.svelte-8mby9k{transform:translateY(-100%)}.content.svelte-8mby9k .headerImage.svelte-8mby9k{position:absolute;width:100%;top:0.25rem;transform:translateY(-100%);border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.line.svelte-8mby9k.svelte-8mby9k{position:absolute;height:2.0625rem;width:0.0625rem;left:50%;transform:translateX(-50%);background-color:white;bottom:0;transform-origin:bottom;transition:all 500ms}.content.svelte-8mby9k.svelte-8mby9k{background-color:white;position:relative;display:flex;flex-direction:column;min-width:11.125rem;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;border-radius:0.25rem;top:-1.875rem;left:-1rem;padding:0.5rem 0rem 0.5625rem;transition:all 500ms}.title.svelte-8mby9k.svelte-8mby9k{position:absolute;background-color:white;border-radius:0.25rem;width:100%;top:0.5rem;padding-left:0.75rem;padding-right:0.75rem}.title.svelte-8mby9k .text.svelte-8mby9k{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;font-weight:bold;line-height:1.125rem;color:#000}.footer.svelte-8mby9k.svelte-8mby9k{position:relative;padding-left:0.75rem;padding-right:0.75rem;width:100%;height:1.375rem;display:flex;align-items:center}.footer.svelte-8mby9k .goto-button.svelte-8mby9k{flex-shrink:0;white-space:nowrap;background-image:linear-gradient(to right, rgba(87, 144, 253, 1) 0, rgba(42, 114, 254, 1) 100%);color:#fff;font-size:0.625rem;border-radius:0.875rem;font-weight:bold;padding-left:0.5rem;padding-right:0.5rem;height:1.25rem;margin-left:auto;display:flex;align-items:center}.footer.svelte-8mby9k .goto-icon.svelte-8mby9k::after{content:'';display:inline-block;width:0.75rem;height:0.75rem;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAeFBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////GqOSsAAAAJ3RSTlMAFNO2pYt4bErz8uP6ysawgVtBPDcR5C4s2L6ZmJBzZGJXUyEeDws/0G2zAAAAkklEQVQ4y+3TRw6DMBAF0OAeJ3QCpCe0uf8NwRILLBYfiS1/aT3JoymnI+sERZ5VCH0iVto3QDfBLmeSSMUTogRV9bBEpJAKaYpGijn13aTSLeraeG9D0NZFZv4/rRL5FDHnITlllqjv6tykWsmX4JHr05y7j6oFKq2P8He48B0tAM0EY0EDxquClw6vLz6EI35GmwwSZpe+WOgAAAAASUVORK5CYII=);background-size:100% auto;background-repeat:no-repeat}.price.svelte-8mby9k.svelte-8mby9k{flex-shrink:0;margin-right:0.75rem;white-space:nowrap;color:#ff6600;display:flex;align-items:baseline}.price.svelte-8mby9k .value.svelte-8mby9k{position:relative;top:0.0625rem;font-size:1.125rem;line-height:1.375rem;font-family:TG-TYPE, PingFangSC, Segoe UI, Rototo, sans-serif;letter-spacing:0rem}.price.svelte-8mby9k .unit.svelte-8mby9k{padding-left:0.125rem;font-size:0.625rem}.tag.svelte-8mby9k.svelte-8mby9k{position:relative;background-color:white;display:flex;width:-moz-max-content;width:max-content;padding-left:0.75rem;padding-right:0.75rem;min-height:1.75rem}.tag.svelte-8mby9k .base-tag.svelte-8mby9k{height:1rem;margin-top:1.375rem;margin-bottom:0.5rem;margin-right:0.25rem;font-size:0.625rem;line-height:0.875rem;padding:0.0625rem 0.25rem;border-radius:0.125rem;overflow:hidden}.tag.svelte-8mby9k .primary-tag.svelte-8mby9k{background:#e5eefe;color:#0055ff}.tag.svelte-8mby9k .secondary-tag.svelte-8mby9k{background:rgba(255, 102, 0, 0.08);color:rgba(255, 102, 0, 1)}.unfolded.svelte-8mby9k .line.svelte-8mby9k{transform:translateX(-50%) scale(1, 1)}.folded.svelte-8mby9k .line.svelte-8mby9k{transform:translateX(-50%) scale(1, 0);transition-timing-function:ease-in}.unfolded.svelte-8mby9k .content.svelte-8mby9k{opacity:1}.folded.svelte-8mby9k .content.svelte-8mby9k{opacity:0;transform:translateY(0.425rem);transition-timing-function:ease-in}")}function Oo(o,t,e){const n=o.slice();return n[0]=t[e],n}function Ho(o,t,e){const n=o.slice();return n[0]=t[e],n}function Fo(o){let t,e=o[0]+"",n;return{c(){t=i.element("div"),n=i.text(e),i.attr(t,"class","base-tag primary-tag svelte-8mby9k")},m(s,r){i.insert(s,t,r),i.append(t,n)},p(s,r){r&4&&e!==(e=s[0]+"")&&i.set_data(n,e)},d(s){s&&i.detach(t)}}}function Go(o){let t,e=o[0]&&Fo(o);return{c(){e&&e.c(),t=i.empty()},m(n,s){e&&e.m(n,s),i.insert(n,t,s)},p(n,s){n[0]?e?e.p(n,s):(e=Fo(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},d(n){e&&e.d(n),n&&i.detach(t)}}}function No(o){let t,e=o[0]+"",n;return{c(){t=i.element("div"),n=i.text(e),i.attr(t,"class","base-tag secondary-tag svelte-8mby9k")},m(s,r){i.insert(s,t,r),i.append(t,n)},p(s,r){r&4&&e!==(e=s[0]+"")&&i.set_data(n,e)},d(s){s&&i.detach(t)}}}function Wo(o){let t,e=o[0]&&No(o);return{c(){e&&e.c(),t=i.empty()},m(n,s){e&&e.m(n,s),i.insert(n,t,s)},p(n,s){n[0]?e?e.p(n,s):(e=No(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},d(n){e&&e.d(n),n&&i.detach(t)}}}function Xo(o){let t,e,n=o[2].price.value+"",s,r,a=o[2].price.unit&&Yo(o);return{c(){t=i.element("div"),e=i.element("span"),s=i.text(n),r=i.space(),a&&a.c(),i.attr(e,"class","value svelte-8mby9k"),i.attr(t,"class","price svelte-8mby9k")},m(l,c){i.insert(l,t,c),i.append(t,e),i.append(e,s),i.append(t,r),a&&a.m(t,null)},p(l,c){c&4&&n!==(n=l[2].price.value+"")&&i.set_data(s,n),l[2].price.unit?a?a.p(l,c):(a=Yo(l),a.c(),a.m(t,null)):a&&(a.d(1),a=null)},d(l){l&&i.detach(t),a&&a.d()}}}function Yo(o){let t,e=o[2].price.unit+"",n;return{c(){t=i.element("span"),n=i.text(e),i.attr(t,"class","unit svelte-8mby9k")},m(s,r){i.insert(s,t,r),i.append(t,n)},p(s,r){r&4&&e!==(e=s[2].price.unit+"")&&i.set_data(n,e)},d(s){s&&i.detach(t)}}}function Uo(o){let t,e=o[2].highlightText+"",n;return{c(){t=i.element("div"),n=i.text(e),i.attr(t,"class","goto-button goto-icon svelte-8mby9k")},m(s,r){i.insert(s,t,r),i.append(t,n)},p(s,r){r&4&&e!==(e=s[2].highlightText+"")&&i.set_data(n,e)},d(s){s&&i.detach(t)}}}function Lf(o){var T,H;let t,e,n,s,r,a,l,c,d,u,f,h,p,g,A=o[2].title+"",b,v,w,y,I;e=new ve({props:{visible:o[1],outDelay:500,left:61,bottom:87,blurRadius:150,spreadRadius:75}});let k=o[2].brandTags||[],C=[];for(let E=0;E<k.length;E+=1)C[E]=Go(Ho(o,k,E));let D=o[2].tags||[],x=[];for(let E=0;E<D.length;E+=1)x[E]=Wo(Oo(o,D,E));let z=((T=o[2].price)==null?void 0:T.value)!==void 0&&((H=o[2].price)==null?void 0:H.value)!==null&&Xo(o),_=o[2].highlightText&&Uo(o);return{c(){var E,S;t=i.element("div"),i.create_component(e.$$.fragment),n=i.space(),s=i.element("div"),r=i.space(),a=i.element("div"),l=i.element("img"),d=i.space(),u=i.element("div");for(let L=0;L<C.length;L+=1)C[L].c();f=i.space();for(let L=0;L<x.length;L+=1)x[L].c();h=i.space(),p=i.element("div"),g=i.element("div"),b=i.text(A),v=i.space(),w=i.element("div"),z&&z.c(),y=i.space(),_&&_.c(),i.attr(s,"class","line svelte-8mby9k"),i.set_style(s,"transition-delay",o[1]?xt+"ms":Dt+Jo-Vo-40+"ms",!1),i.attr(l,"class","headerImage svelte-8mby9k"),i.src_url_equal(l.src,c=o[2].headerPictureUrl)||i.attr(l,"src",c),i.attr(l,"alt",""),i.attr(u,"class","tag svelte-8mby9k"),i.attr(g,"class","text svelte-8mby9k"),i.attr(p,"class","title svelte-8mby9k"),i.attr(w,"class","footer svelte-8mby9k"),i.set_style(w,"height",((E=o[2].price)==null?void 0:E.value)!==void 0&&((S=o[2].price)==null?void 0:S.value)!==null&&o[2].highlightText?void 0:"1rem",!1),i.attr(a,"class","content svelte-8mby9k"),i.set_style(a,"transition-delay",o[1]?xt+Dt+"ms":"0ms",!1),i.attr(t,"class","marketing svelte-8mby9k"),i.toggle_class(t,"unfolded",o[1]),i.toggle_class(t,"folded",o[3])},m(E,S){i.insert(E,t,S),i.mount_component(e,t,null),i.append(t,n),i.append(t,s),i.append(t,r),i.append(t,a),i.append(a,l),i.append(a,d),i.append(a,u);for(let L=0;L<C.length;L+=1)C[L].m(u,null);i.append(u,f);for(let L=0;L<x.length;L+=1)x[L].m(u,null);i.append(a,h),i.append(a,p),i.append(p,g),i.append(g,b),i.append(a,v),i.append(a,w),z&&z.m(w,null),i.append(w,y),_&&_.m(w,null),I=!0},p(E,[S]){var B,R,G,Q;const L={};if(S&2&&(L.visible=E[1]),e.$set(L),S&2&&i.set_style(s,"transition-delay",E[1]?xt+"ms":Dt+Jo-Vo-40+"ms",!1),(!I||S&4&&!i.src_url_equal(l.src,c=E[2].headerPictureUrl))&&i.attr(l,"src",c),S&4){k=E[2].brandTags||[];let O;for(O=0;O<k.length;O+=1){const X=Ho(E,k,O);C[O]?C[O].p(X,S):(C[O]=Go(X),C[O].c(),C[O].m(u,f))}for(;O<C.length;O+=1)C[O].d(1);C.length=k.length}if(S&4){D=E[2].tags||[];let O;for(O=0;O<D.length;O+=1){const X=Oo(E,D,O);x[O]?x[O].p(X,S):(x[O]=Wo(X),x[O].c(),x[O].m(u,null))}for(;O<x.length;O+=1)x[O].d(1);x.length=D.length}(!I||S&4)&&A!==(A=E[2].title+"")&&i.set_data(b,A),((B=E[2].price)==null?void 0:B.value)!==void 0&&((R=E[2].price)==null?void 0:R.value)!==null?z?z.p(E,S):(z=Xo(E),z.c(),z.m(w,y)):z&&(z.d(1),z=null),E[2].highlightText?_?_.p(E,S):(_=Uo(E),_.c(),_.m(w,null)):_&&(_.d(1),_=null),S&4&&i.set_style(w,"height",((G=E[2].price)==null?void 0:G.value)!==void 0&&((Q=E[2].price)==null?void 0:Q.value)!==null&&E[2].highlightText?void 0:"1rem",!1),S&2&&i.set_style(a,"transition-delay",E[1]?xt+Dt+"ms":"0ms",!1),S&2&&i.toggle_class(t,"unfolded",E[1]),S&8&&i.toggle_class(t,"folded",E[3])},i(E){I||(i.transition_in(e.$$.fragment,E),I=!0)},o(E){i.transition_out(e.$$.fragment,E),I=!1},d(E){E&&i.detach(t),i.destroy_component(e),i.destroy_each(C,E),i.destroy_each(x,E),z&&z.d(),_&&_.d()}}}const xt=400,Vo=500,Dt=180,Jo=500;function _f(o,t,e){let n,s,r,{tag:a}=t;return o.$$set=l=>{"tag"in l&&e(0,a=l.tag)},o.$$.update=()=>{var l,c;o.$$.dirty&1&&e(1,n=(c=(l=a.state)==null?void 0:l.unfolded)!=null?c:!1),o.$$.dirty&2&&e(3,s=!n),o.$$.dirty&1&&e(2,r=a.data)},[a,n,r,s]}class zf extends i.SvelteComponent{constructor(t){super(),i.init(this,t,_f,Lf,i.safe_not_equal,{tag:0},Sf)}}function Mf(o){i.append_styles(o,"svelte-1ku3wt4",`.audio.svelte-1ku3wt4.svelte-1ku3wt4{position:relative;width:100%;height:100%;cursor:pointer}@keyframes svelte-1ku3wt4-playing{25%{background-image:url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='9' cy='9' r='8' transform='translate(-1 -1)' fill='%23FFF' fill-rule='nonzero'/%3E%3C/svg%3E")}50%{background-image:url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zM5.533 6.685L4.169 8.049l1.414 1.413a2.078 2.078 0 0 0-.05-2.777z' fill='%23FFF' fill-rule='nonzero'/%3E%3C/svg%3E")}75%{background-image:url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zm-.656 4.874l-.906.905A3.35 3.35 0 0 1 7.369 8.1c0 .875-.333 1.67-.88 2.268l.906.906A4.628 4.628 0 0 0 8.65 8.101a4.627 4.627 0 0 0-1.306-3.227zm-1.811 1.81L4.169 8.05l1.414 1.413a2.078 2.078 0 0 0-.05-2.777z' fill='%23FFF' fill-rule='nonzero'/%3E%3C/svg%3E")}}.paused.svelte-1ku3wt4 .audio-icon.svelte-1ku3wt4{animation:none}.audio-icon.svelte-1ku3wt4.svelte-1ku3wt4{width:100%;height:100%;border-radius:50%;background-size:100%;animation:svelte-1ku3wt4-playing 2s steps(1) infinite;background-image:url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zm1.428 2.79l-.953.952a6.222 6.222 0 0 1 1.775 4.36c0 1.571-.58 3.006-1.538 4.103l-.184.202.793.794a7.344 7.344 0 0 0 2.21-5.26A7.341 7.341 0 0 0 9.428 2.79zM7.344 4.873l-.906.905A3.35 3.35 0 0 1 7.369 8.1c0 .802-.28 1.537-.748 2.115l-.132.153.906.906A4.628 4.628 0 0 0 8.65 8.101a4.627 4.627 0 0 0-1.306-3.227zm-1.811 1.81L4.169 8.05l1.414 1.413a2.078 2.078 0 0 0-.05-2.777z' fill='%23FFF' fill-rule='nonzero'/%3E%3C/svg%3E")}`)}function Zo(o){let t,e,n,s,r,a,l,c=!0,d,u,f,h,p;return e=new ve({props:{center:!0,blurRadius:15,spreadRadius:6}}),{c(){t=i.element("div"),i.create_component(e.$$.fragment),n=i.space(),s=i.element("div"),r=i.space(),a=i.element("audio"),i.attr(s,"class","audio-icon svelte-1ku3wt4"),a.controls=!1,i.attr(a,"playsinline",""),i.src_url_equal(a.src,l=o[3])||i.attr(a,"src",l),i.attr(t,"class","audio svelte-1ku3wt4"),i.toggle_class(t,"paused",o[6])},m(g,A){i.insert(g,t,A),i.mount_component(e,t,null),i.append(t,n),i.append(t,s),i.append(t,r),i.append(t,a),o[9](a),f=!0,h||(p=[i.listen(a,"play",o[10]),i.listen(a,"pause",o[10]),i.listen(t,"click",i.stop_propagation(o[7]))],h=!0)},p(g,A){o=g,(!f||A&8&&!i.src_url_equal(a.src,l=o[3]))&&i.attr(a,"src",l),A&64&&c!==(c=o[6])&&a[c?"pause":"play"](),A&64&&i.toggle_class(t,"paused",o[6])},i(g){f||(i.transition_in(e.$$.fragment,g),g&&i.add_render_callback(()=>{u&&u.end(1),d=i.create_in_transition(t,me.fade,{duration:o[2],delay:o[0],easing:Se.cubicInOut}),d.start()}),f=!0)},o(g){i.transition_out(e.$$.fragment,g),d&&d.invalidate(),g&&(u=i.create_out_transition(t,me.fade,{duration:o[2],delay:o[1],easing:Se.cubicInOut})),f=!1},d(g){g&&i.detach(t),i.destroy_component(e),o[9](null),g&&u&&u.end(),h=!1,i.run_all(p)}}}function Tf(o){let t,e,n=o[4]&&Zo(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[4]?n?(n.p(s,r),r&16&&i.transition_in(n,1)):(n=Zo(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function jf(o,t,e){let{inDelay:n=0}=t,{outDelay:s=0}=t,{duration:r=0}=t,{url:a}=t,{unfolded:l}=t,{hooksInfo:c={}}=t;const d=Z.getContext("hooks"),u=Z.getContext("mediaStore");let f,h=!0;u.subscribe(({currentMediaUrl:b})=>{b!==a&&(f==null||f.pause())});function p(b){u.set({currentMediaUrl:a}),f&&(d.emit("click",j({event:b,target:"AudioTagPlayIcon",audioInstance:f},c)),f.paused?f.play():f.pause(),e(5,f.onplay=v=>d.emit("playStateChange",j({event:v,state:"playing",mediaInstance:f},c)),f),e(5,f.onpause=v=>d.emit("playStateChange",j({event:v,state:"paused",mediaInstance:f},c)),f))}function g(b){i.binding_callbacks[b?"unshift":"push"](()=>{f=b,e(5,f)})}function A(){h=this.paused,e(6,h)}return o.$$set=b=>{"inDelay"in b&&e(0,n=b.inDelay),"outDelay"in b&&e(1,s=b.outDelay),"duration"in b&&e(2,r=b.duration),"url"in b&&e(3,a=b.url),"unfolded"in b&&e(4,l=b.unfolded),"hooksInfo"in b&&e(8,c=b.hooksInfo)},o.$$.update=()=>{o.$$.dirty&48&&(l||f==null||f.pause())},[n,s,r,a,l,f,h,p,c,g,A]}class Bf extends i.SvelteComponent{constructor(t){super(),i.init(this,t,jf,Tf,i.safe_not_equal,{inDelay:0,outDelay:1,duration:2,url:3,unfolded:4,hooksInfo:8},Mf)}}function Qf(o){i.append_styles(o,"svelte-4r8s18",".audio-tag.svelte-4r8s18.svelte-4r8s18{position:absolute;left:0;top:0;width:0;height:0;overflow:visible}.line.svelte-4r8s18.svelte-4r8s18{display:flex;position:absolute;top:0;left:0;width:10.125rem;height:0.0625rem;transform:translate3d(0, -50%, 0.625rem)}.content.svelte-4r8s18.svelte-4r8s18{width:-moz-max-content;width:max-content;height:3.375rem;padding:2.25rem 0.25rem 0 1rem;position:absolute;left:0;bottom:0.125rem;overflow:hidden;box-sizing:border-box;font-size:0;white-space:nowrap;font-weight:600}.wrapper.svelte-4r8s18.svelte-4r8s18{position:relative;width:100%;height:100%}.audio-icon.svelte-4r8s18.svelte-4r8s18{vertical-align:top;display:inline-block;width:1rem;height:1rem;margin-right:0.25rem;margin-top:0.0625rem}.unfolded.svelte-4r8s18 .audio-icon.svelte-4r8s18{pointer-events:auto}")}function qo(o){var w,y,I,k;let t,e,n,s,r,a,l,c,d,u,f,h,p,g,A,b,v;return e=new ve({props:{visible:o[5],left:o[2]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}}),r=new Js({props:{unfolded:o[5],duration:1e3,outDelay:o[4]+20*Math.min((y=(w=o[3][0])==null?void 0:w.content.length)!=null?y:10,15)}}),u=new Bf({props:{unfolded:o[5],url:o[0].data.audioUrl,duration:1e3,outDelay:20*Math.min((k=(I=o[3][0])==null?void 0:I.content.length)!=null?k:10,15),hooksInfo:{tag:o[0]}}}),p=new qs({props:{visible:o[5],textUnfolded:o[1],textItems:o[3]}}),{c(){t=i.element("div"),i.create_component(e.$$.fragment),n=i.space(),s=i.element("div"),i.create_component(r.$$.fragment),a=i.space(),l=i.element("div"),c=i.element("div"),d=i.element("div"),i.create_component(u.$$.fragment),f=i.space(),h=i.element("div"),i.create_component(p.$$.fragment),i.attr(s,"class","line svelte-4r8s18"),i.set_style(s,"width",o[2]+"px",!1),i.attr(d,"class","audio-icon svelte-4r8s18"),i.set_style(h,"display","inline-block",!1),i.attr(c,"class","wrapper svelte-4r8s18"),i.attr(l,"class","content svelte-4r8s18"),i.add_render_callback(()=>o[8].call(l)),i.attr(t,"class","audio-tag svelte-4r8s18"),i.toggle_class(t,"unfolded",o[5])},m(C,D){i.insert(C,t,D),i.mount_component(e,t,null),i.append(t,n),i.append(t,s),i.mount_component(r,s,null),i.append(t,a),i.append(t,l),i.append(l,c),i.append(c,d),i.mount_component(u,d,null),i.append(c,f),i.append(c,h),i.mount_component(p,h,null),g=i.add_resize_listener(l,o[8].bind(l)),A=!0,b||(v=i.listen(h,"click",o[6]),b=!0)},p(C,D){var H,E,S,L;const x={};D&32&&(x.visible=C[5]),D&4&&(x.left=C[2]/2+"px"),e.$set(x);const z={};D&32&&(z.unfolded=C[5]),D&24&&(z.outDelay=C[4]+20*Math.min((E=(H=C[3][0])==null?void 0:H.content.length)!=null?E:10,15)),r.$set(z),D&4&&i.set_style(s,"width",C[2]+"px",!1);const _={};D&32&&(_.unfolded=C[5]),D&1&&(_.url=C[0].data.audioUrl),D&8&&(_.outDelay=20*Math.min((L=(S=C[3][0])==null?void 0:S.content.length)!=null?L:10,15)),D&1&&(_.hooksInfo={tag:C[0]}),u.$set(_);const T={};D&32&&(T.visible=C[5]),D&2&&(T.textUnfolded=C[1]),D&8&&(T.textItems=C[3]),p.$set(T),D&32&&i.toggle_class(t,"unfolded",C[5])},i(C){A||(i.transition_in(e.$$.fragment,C),i.transition_in(r.$$.fragment,C),i.transition_in(u.$$.fragment,C),i.transition_in(p.$$.fragment,C),A=!0)},o(C){i.transition_out(e.$$.fragment,C),i.transition_out(r.$$.fragment,C),i.transition_out(u.$$.fragment,C),i.transition_out(p.$$.fragment,C),A=!1},d(C){C&&i.detach(t),i.destroy_component(e),i.destroy_component(r),i.destroy_component(u),i.destroy_component(p),g(),b=!1,v()}}}function Rf(o){let t,e,n=o[0].state&&qo(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[0].state?n?(n.p(s,r),r&1&&i.transition_in(n,1)):(n=qo(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function Of(o,t,e){let n,s,r,{tag:a}=t,l=!1,c,d=[];function u(){e(1,l=!l)}function f(){c=this.clientWidth,e(2,c)}return o.$$set=h=>{"tag"in h&&e(0,a=h.tag)},o.$$.update=()=>{var h;o.$$.dirty&1&&e(5,n=!!((h=a.state)!=null&&h.unfolded)),o.$$.dirty&1&&e(7,s=a.data.text),o.$$.dirty&128&&e(3,d=[{id:ue(),content:s}]),o.$$.dirty&2&&e(4,r=l?450:0)},[a,l,c,d,r,n,u,s,f]}class Hf extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Of,Rf,i.safe_not_equal,{tag:0},Qf)}}function Ff(o){i.append_styles(o,"svelte-10cw0el",".media-wrapper.svelte-10cw0el{position:absolute;width:100%;height:100%}")}function Ko(o){let t,e,n;return e=new er({props:{unfolded:o[5],mediaData:o[4],objectFit:o[2],enableCarousel:o[1],autoplayConfig:o[3],tag:o[0],canPlay:!0,playButtonIfNeed:"large",inDelay:500,duration:500}}),{c(){t=i.element("div"),i.create_component(e.$$.fragment),i.attr(t,"class","media-wrapper svelte-10cw0el")},m(s,r){i.insert(s,t,r),i.mount_component(e,t,null),n=!0},p(s,r){const a={};r&32&&(a.unfolded=s[5]),r&16&&(a.mediaData=s[4]),r&4&&(a.objectFit=s[2]),r&2&&(a.enableCarousel=s[1]),r&8&&(a.autoplayConfig=s[3]),r&1&&(a.tag=s[0]),e.$set(a)},i(s){n||(i.transition_in(e.$$.fragment,s),n=!0)},o(s){i.transition_out(e.$$.fragment,s),n=!1},d(s){s&&i.detach(t),i.destroy_component(e)}}}function Gf(o){let t,e,n=o[0].state&&o[4]&&Ko(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[0].state&&s[4]?n?(n.p(s,r),r&17&&i.transition_in(n,1)):(n=Ko(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function Nf(o,t,e){let n,s,r,a,l,{tag:c}=t;return o.$$set=d=>{"tag"in d&&e(0,c=d.tag)},o.$$.update=()=>{var d,u;o.$$.dirty&1&&e(5,n=c.state?c.state.unfolded:!1),o.$$.dirty&1&&e(4,s=c.data.mediaData),o.$$.dirty&1&&e(1,r=c.data.enableCarousel),o.$$.dirty&3&&e(3,a=(d=c.data.autoplayConfig)!=null?d:{autoplay:r!=null?r:!0,autoplayVideo:!0}),o.$$.dirty&1&&e(2,l=(u=c.data.objectFit)!=null?u:(()=>c.data.adaptationMode==="stretch"?"cover":c.data.adaptationMode==="proportional"?"contain":void 0)())},[c,r,l,a,s,n]}class Wf extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Nf,Gf,i.safe_not_equal,{tag:0},Ff)}}function Xf(o){i.append_styles(o,"svelte-7x7u86",".wrapper.svelte-7x7u86{font-weight:600;cursor:pointer;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);display:flex;align-items:center;justify-content:center;flex-direction:column;pointer-events:auto}.text-wrapper.svelte-7x7u86{position:relative;display:flex;align-items:center;justify-content:center}.icon.svelte-7x7u86{position:relative;margin-bottom:0.6875rem}.arrow0.svelte-7x7u86,.arrow1.svelte-7x7u86,.arrow2.svelte-7x7u86{position:absolute;width:1.625rem;height:0.75rem;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE4AAAAkCAYAAAAnxQwhAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAATqADAAQAAAABAAAAJAAAAABrx2urAAAGm0lEQVRoBd2ZXbCVUxjH26QSfSCS0JwoFNEZ0cc45iSmUUaqC+KCwUUXxYUZw4yrLhozLlDDRWa6oW5yOFTT0IcyKn1JnIjDKelLPipJcXT8fttaZ95qd+yzv+uZ+e211rvfd61n/ddaz1rv3qkOFWgtLS3n4Vb34NqhVCr1d6W5mao0hxBNwfrCOcG346S7Ee9gKFdEUjHCIZi+XA69E8p4rQVM98EeBLRcdqsI4RCtI0r0h4uCIvo1BZx1b4GzTjsA3yFec7pUxo+yC4doXen/IDg/6GB5GlSH8mbSWXA4lI+SNiDekVAuS1JW4RCtF72+EWI8c6k+A6ZJc5m+BHvCxX9ItyLe/lAueVIW4UI8u4beDkj02FnnTOuUuJbM/kVhNjQkLjaSbyxH3Cu5cIjmUWMoOKti+2PIT4Jsr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nPDpiH4Ay3HMe9tt+NiTh0bDPRBXRLIed07tZvDebEzhN4CzV3O5voyPi9KlxMcJwuGMQj0FE8M9Ku9I1MIJ94bvk4mNGORdcr41GLd8xjpM94HxZAmO7CAtmOF3Pyoz5srJ8bCZaw68M95NJU4GshlNf1dAf4i+15F/Bb9b416rGDRuPHsRHCHN2PEz3GahDXMq/wR9wfgTGyObFnE56ULwDxW/K5rRB/tTDa4YY2Imf3Zx/TIwFLVl6/iyF8SNxxX0LH1Ix720cDRoTJgNcbT2hwdUPZPZeCNYsc9EQazPEV4NTm9/zjlKWnKjT11otBYUcRS4AuKgmjrYToxrwUHPZN9z0Ql0afhyL+k0+rQtRQOu/3qIAhjIB0IPSJrrvwEcARvTko44896DhXFUvKESjD66msbD/eBMSw60eQVygAfDyXH8INe2gZPLiaF4ExTucTLPg2aMGg7uVpqzZwu4tm8Ad7UoFtn0q4ti1SHWt16odKO/A/DxAZgAcYVFt+3nV2AcHAIdQTsOa6Ea7P9MhZtB5jHQmsDltwMM8qrszFPpaEfILIYF4H+ZVnrGGf12coyEyXAvdIU4KUydaa4+r/cDl3UVaHMVzun7erp4+g/FWQWK5a6oeGeNoYHijAVFrIG44shmtKkK52x6FSZluMW4pVjvIJbHibPe0MPl61JWxEEZOvw216a3LkEeGMGFO0D1d8KqMyVu4WtRDE2Mh85Az6Wuso/RZA1ph38BBMvNbHuq7kAAAAAASUVORK5CYII=);background-repeat:no-repeat;background-size:contain;animation-fill-mode:backwards;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.2s}.arrow1.svelte-7x7u86{position:relative}.arrow0.svelte-7x7u86{top:-0.75rem;animation-name:svelte-7x7u86-up0}.arrow1.svelte-7x7u86{animation-name:svelte-7x7u86-up1}.arrow2.svelte-7x7u86{top:0.75rem;animation-name:svelte-7x7u86-up2}.text.svelte-7x7u86{position:absolute;top:0;font-size:0.875rem;color:#ffffff;letter-spacing:0;text-align:center;max-width:8.75rem;width:-moz-max-content;width:max-content;word-break:break-all;line-height:1.125rem;text-shadow:0.125rem 0rem 0.5rem rgba(0, 0, 0, 0.15)}@keyframes svelte-7x7u86-up0{0%{opacity:0.8;transform:translate3d(0, 0, 0) scale(0.84)}33.33%,100%{opacity:0;transform:translate3d(0, -0.75rem, 0) scale(0.84)}}@keyframes svelte-7x7u86-up1{0%{opacity:1;transform:translate3d(0, 0, 0) scale(1)}33.33%,100%{opacity:0.8;transform:translate3d(0, -0.75rem, 0) scale(0.84)}}@keyframes svelte-7x7u86-up2{0%{opacity:0}33.33%,100%{opacity:1;transform:translate3d(0, -0.75rem, 0)}}.link.svelte-7x7u86{position:relative;width:1.75rem;height:0.75rem;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAAAkCAMAAAAgl+0yAAAAnFBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+TINBkAAAAM3RSTlMAjLy6ILM2Fi+Zng3BrPvao4VC9ceneQfKkmNdV1AbEeLOsHA77ujUtn5JLnRraSUUjVLj/+RVAAABhElEQVRIx63V2W6CQBiGYUBUQGDYdwTZQZZa7v/eimik/ket/7yZ4yeTTCYf8+dOX8etxGVoxAvCVbguR3g0uRTMA0w4odGi+CbzFnGKosCqrmHc5rdEwzCwqtGFJlC7DqtOcTxANY67BHnVKOpVoEZRjFPdLgxbqIZhhFTjINChGgThF06NhpGd35OGMcCppyDPfajm+YhUR8cRoeo4+RGlJnnbalBt2x6nHh1dt4Gq6bqDU886y2ZQZVn9jFJ51vcbqPo+Up18UeSgKoo3nHqVJEkGqi1JPk49aLZmQdW2xXf1zP+vUFHsC1QVReK33xdk+w9SaqAq+732UvvdZ2UEqrud8lR5Wc4a7pO8GaoL9VBjy7rMlMosq1lV43LhZlrtF+yuJlbtEXpqXXP3NYwI8VJqakOIziw5aepV1FQuTdfhvlWVZdJCrao6MPe0spRpqV5ZFivqNqYpq3RQ2TST5/h4quoRCmwqq6rymol6plV53IZSomTKE/MroWfxDevL/wAEdPq1eGDh4AAAAABJRU5ErkJggg==);background-repeat:no-repeat;background-size:contain;animation-iteration-count:infinite;animation-timing-function:linear;animation-duration:1.2s;animation-name:svelte-7x7u86-left-right}@keyframes svelte-7x7u86-left-right{0%,100%{opacity:0.8;transform:translateX(-0.3125rem)}50%{opacity:1;transform:translateX(0)}}")}function Yf(o){let t,e,n,s;return t=new ve({props:{visible:!0,outDelay:0,inDelay:0,width:1.4,left:13,bottom:"auto",blurRadius:50,spreadRadius:18}}),{c(){i.create_component(t.$$.fragment),e=i.space(),n=i.element("div"),i.attr(n,"class","link svelte-7x7u86")},m(r,a){i.mount_component(t,r,a),i.insert(r,e,a),i.insert(r,n,a),s=!0},i(r){s||(i.transition_in(t.$$.fragment,r),s=!0)},o(r){i.transition_out(t.$$.fragment,r),s=!1},d(r){i.destroy_component(t,r),r&&i.detach(e),r&&i.detach(n)}}}function Uf(o){let t,e,n,s,r,a,l,c;return t=new ve({props:{visible:!0,outDelay:0,inDelay:0,height:1.2,left:13,bottom:12,blurRadius:50,spreadRadius:18}}),{c(){i.create_component(t.$$.fragment),e=i.space(),n=i.element("div"),s=i.space(),r=i.element("div"),a=i.space(),l=i.element("div"),i.attr(n,"class","arrow0 svelte-7x7u86"),i.attr(r,"class","arrow1 svelte-7x7u86"),i.attr(l,"class","arrow2 svelte-7x7u86")},m(d,u){i.mount_component(t,d,u),i.insert(d,e,u),i.insert(d,n,u),i.insert(d,s,u),i.insert(d,r,u),i.insert(d,a,u),i.insert(d,l,u),c=!0},i(d){c||(i.transition_in(t.$$.fragment,d),c=!0)},o(d){i.transition_out(t.$$.fragment,d),c=!1},d(d){i.destroy_component(t,d),d&&i.detach(e),d&&i.detach(n),d&&i.detach(s),d&&i.detach(r),d&&i.detach(a),d&&i.detach(l)}}}function Vf(o){let t,e,n,s,r,a,l,c,d,u=o[0].text+"",f,h;const p=[Uf,Yf],g=[];function A(b,v){return b[0].linkType===Ot.VrLink?0:b[0].linkType===Ot.NormalLink?1:-1}return~(n=A(o))&&(s=g[n]=p[n](o)),l=new ve({props:{visible:!0,outDelay:0,inDelay:0,left:"auto",bottom:"auto",width:"80%",blurRadius:40,spreadRadius:16,opacity:.08}}),{c(){t=i.element("div"),e=i.element("div"),s&&s.c(),r=i.space(),a=i.element("div"),i.create_component(l.$$.fragment),c=i.space(),d=i.element("div"),f=i.text(u),i.attr(e,"class","icon svelte-7x7u86"),i.attr(d,"class","text svelte-7x7u86"),i.attr(a,"class","text-wrapper svelte-7x7u86"),i.attr(t,"class","wrapper svelte-7x7u86")},m(b,v){i.insert(b,t,v),i.append(t,e),~n&&g[n].m(e,null),i.append(t,r),i.append(t,a),i.mount_component(l,a,null),i.append(a,c),i.append(a,d),i.append(d,f),h=!0},p(b,[v]){let w=n;n=A(b),n!==w&&(s&&(i.group_outros(),i.transition_out(g[w],1,1,()=>{g[w]=null}),i.check_outros()),~n?(s=g[n],s||(s=g[n]=p[n](b),s.c()),i.transition_in(s,1),s.m(e,null)):s=null),(!h||v&1)&&u!==(u=b[0].text+"")&&i.set_data(f,u)},i(b){h||(i.transition_in(s),i.transition_in(l.$$.fragment,b),h=!0)},o(b){i.transition_out(s),i.transition_out(l.$$.fragment,b),h=!1},d(b){b&&i.detach(t),~n&&g[n].d(),i.destroy_component(l)}}}function Jf(o,t,e){let n,{tag:s}=t;return o.$$set=r=>{"tag"in r&&e(1,s=r.tag)},o.$$.update=()=>{o.$$.dirty&2&&e(0,n=s.data)},[n,s]}class Zf extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Jf,Vf,i.safe_not_equal,{tag:1},Xf)}}function qf(o){i.append_styles(o,"svelte-kzl2aj",".customElement__container.svelte-kzl2aj{position:relative}")}function $o(o){let t,e=o[0].element+"",n;return{c(){t=new i.HtmlTag(!1),n=i.empty(),t.a=n},m(s,r){t.m(e,s,r),i.insert(s,n,r)},p(s,r){r&1&&e!==(e=s[0].element+"")&&t.p(e)},d(s){s&&i.detach(n),s&&t.d()}}}function Kf(o){let t,e=typeof o[0].element=="string"&&$o(o);return{c(){t=i.element("div"),e&&e.c(),i.attr(t,"class","customElement__container svelte-kzl2aj")},m(n,s){i.insert(n,t,s),e&&e.m(t,null),o[2](t)},p(n,[s]){typeof n[0].element=="string"?e?e.p(n,s):(e=$o(n),e.c(),e.m(t,null)):e&&(e.d(1),e=null)},i:i.noop,o:i.noop,d(n){n&&i.detach(t),e&&e.d(),o[2](null)}}}function $f(o,t,e){let{tag:n}=t,s,r;Z.onMount(()=>{if(s){if(n.element instanceof Element){const l=n.element;s.appendChild(l),r=()=>s==null?void 0:s.removeChild(l)}else if(typeof n.element=="function"){const l=n.element;r=l(s)}}}),Z.onDestroy(()=>{r==null||r()});function a(l){i.binding_callbacks[l?"unshift":"push"](()=>{s=l,e(1,s)})}return o.$$set=l=>{"tag"in l&&e(0,n=l.tag)},[n,s,a]}class em extends i.SvelteComponent{constructor(t){super(),i.init(this,t,$f,Kf,i.safe_not_equal,{tag:0},qf)}}function tm(o){i.append_styles(o,"svelte-95x526",`@font-face{font-family:'TG-TYPE';font-style:normal;font-weight:400;src:local('TG-TYPE-Bold'),
|
|
539
|
+
`))&&i.attr(t,"style",e),l&8&&i.set_style(t,"width",pe(o[3]),!1),l&16&&i.set_style(t,"height",pe(o[4]),!1),l&8192&&i.set_style(t,"z-index",o[13],!1)},i(a){r||(a&&i.add_render_callback(()=>{s&&s.end(1),n=i.create_in_transition(t,me.fade,{duration:o[0]}),n.start()}),r=!0)},o(a){n&&n.invalidate(),a&&(s=i.create_out_transition(t,me.fade,{duration:o[1]})),r=!1},d(a){a&&i.detach(t),a&&s&&s.end()}}}function Ph(o){let t,e=o[2]&&lo(o);return{c(){e&&e.c(),t=i.empty()},m(n,s){e&&e.m(n,s),i.insert(n,t,s)},p(n,[s]){n[2]?e?(e.p(n,s),s&4&&i.transition_in(e,1)):(e=lo(n),e.c(),i.transition_in(e,1),e.m(t.parentNode,t)):e&&(i.group_outros(),i.transition_out(e,1,1,()=>{e=null}),i.check_outros())},i(n){i.transition_in(e)},o(n){i.transition_out(e)},d(n){e&&e.d(n),n&&i.detach(t)}}}function pe(o){return typeof o=="number"?o/16+"rem":o}function Ih(o,t,e){let{inDelay:n=1e3}=t,{outDelay:s=1e3}=t,{visible:r=!0}=t,{width:a=0}=t,{height:l=0}=t,{left:c=0}=t,{bottom:d=0}=t,{center:u=!1}=t,{horizontalCenter:f=!1}=t,{verticalCenter:h=!1}=t,{blurRadius:p}=t,{spreadRadius:g}=t,{opacity:A=.15}=t,{zIndex:b=void 0}=t;return o.$$set=v=>{"inDelay"in v&&e(0,n=v.inDelay),"outDelay"in v&&e(1,s=v.outDelay),"visible"in v&&e(2,r=v.visible),"width"in v&&e(3,a=v.width),"height"in v&&e(4,l=v.height),"left"in v&&e(5,c=v.left),"bottom"in v&&e(6,d=v.bottom),"center"in v&&e(7,u=v.center),"horizontalCenter"in v&&e(8,f=v.horizontalCenter),"verticalCenter"in v&&e(9,h=v.verticalCenter),"blurRadius"in v&&e(10,p=v.blurRadius),"spreadRadius"in v&&e(11,g=v.spreadRadius),"opacity"in v&&e(12,A=v.opacity),"zIndex"in v&&e(13,b=v.zIndex)},[n,s,r,a,l,c,d,u,f,h,p,g,A,b]}class ve extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Ih,Ph,i.safe_not_equal,{inDelay:0,outDelay:1,visible:2,width:3,height:4,left:5,bottom:6,center:7,horizontalCenter:8,verticalCenter:9,blurRadius:10,spreadRadius:11,opacity:12,zIndex:13},Eh)}}function kh(){return Math.random().toString(36).slice(-6)}const co=kh();function xh(o){i.append_styles(o,"svelte-1b2n9wi",".text-char.svelte-1b2n9wi{display:inline-block;text-shadow:0.125rem 0rem 0.5rem rgba(0, 0, 0, 0.15)}")}function uo(o,t,e){const n=o.slice();return n[10]=t[e],n[11]=t,n[12]=e,n}function ho(o){let t,e=o[10]+"",n,s=o[12];const r=()=>o[6](t,s),a=()=>o[6](null,s);return{c(){t=i.element("span"),n=i.text(e),i.attr(t,"class","text-char svelte-1b2n9wi")},m(l,c){i.insert(l,t,c),i.append(t,n),r()},p(l,c){o=l,c&2&&e!==(e=o[10]+"")&&i.set_data(n,e),s!==o[12]&&(a(),s=o[12],r())},d(l){l&&i.detach(t),a()}}}function Dh(o){let t,e=o[1],n=[];for(let s=0;s<e.length;s+=1)n[s]=ho(uo(o,e,s));return{c(){for(let s=0;s<n.length;s+=1)n[s].c();t=i.empty()},m(s,r){for(let a=0;a<n.length;a+=1)n[a].m(s,r);i.insert(s,t,r)},p(s,[r]){if(r&3){e=s[1];let a;for(a=0;a<e.length;a+=1){const l=uo(s,e,a);n[a]?n[a].p(l,r):(n[a]=ho(l),n[a].c(),n[a].m(t.parentNode,t))}for(;a<n.length;a+=1)n[a].d(1);n.length=e.length}},i:i.noop,o:i.noop,d(s){i.destroy_each(n,s),s&&i.detach(t)}}}function Sh(o,t,e){let n,{inDelay:s=0}=t,{outDelay:r=0}=t,{content:a}=t,{unfolded:l}=t,c,d=[],u;function f(p){clearTimeout(c),c=setTimeout(function(){!u||(p&&u.reversed||!p&&!u.reversed)&&(u.reverse(),u.play())},p?s:r)}Z.onMount(function(){const p=(()=>{const g=bh(A=>d[A].getBoundingClientRect().x,[Math.min(d.length-1,10),Math.min(d.length-1,30)]);if(g>0)return g})();u=Wn.default({targets:d.filter(Ue).slice(0,p),autoplay:!1,duration:400,scale:[.7,1],rotate:[20,0],opacity:[0,1],translateX:[4,0],translateY:[10,0],delay:Wn.default.stagger(50),easing:"easeInOutCubic"}),l&&u.seek(u.duration)});function h(p,g){i.binding_callbacks[p?"unshift":"push"](()=>{d[g]=p,e(0,d)})}return o.$$set=p=>{"inDelay"in p&&e(2,s=p.inDelay),"outDelay"in p&&e(3,r=p.outDelay),"content"in p&&e(4,a=p.content),"unfolded"in p&&e(5,l=p.unfolded)},o.$$.update=()=>{o.$$.dirty&16&&e(1,n=(()=>{const p=[],g=new RegExp(new RegExp("\\p{Regional_Indicator}\\p{Regional_Indicator}|\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?(\\u200D\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?)+|\\p{Emoji_Presentation}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?|\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)","gu")),A=`__EMOJI_SPLIT_${co}__`,b=`__EMOJI_${co}__`;return a.slice().replace(g,v=>`${A}${b}${v}${A}`).split(A).forEach(v=>v.startsWith(b)?p.push(v.slice(b.length)):p.push(...v.split(""))),p.filter(Boolean)})()),o.$$.dirty&32&&f(l)},[d,n,s,r,a,l,h]}class Zs extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Sh,Dh,i.safe_not_equal,{inDelay:2,outDelay:3,content:4,unfolded:5},xh)}}const Lh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAKqADAAQAAAABAAAAKgAAAADUGqULAAAB0ElEQVRYCe2WSUoEQRBFLVHEiVZU1I03cKW38SSewRt4A5fiTty5cQIFR9pZQWkcUNSe2/Z9yISiSGxRkUAy4BGZSVX168gistraYsQKxArECsQKxApYqkDyU5lmsznMM+ZgAGpQhaUkSRbINgLJCXiCBtSgAkVYtGGIBTKj8AgKSVahDNvQa0IUkUG4Bx91BpLdBTOS/cgUIB3a+gMwI9mFzE3a0I3z5B4r292JzGVA8tSSZILMcUDyzIykthOZvYDk+V9Ktmz4yGzhOhV4/+5YU4N/hzqo0StX3Fg5TcnNlYvgs8bPsM4hkScHoyO46haRnGEYktQVI+4ypUYKyXtxyUu27JCceAMJvjo0HoM5CEZ7cPX7i013q3IWVV5r2aw/2TK+svWbPGU68KQCa6pYeus1V0X99quSfvtVSc39lmfz2mdbz32tg1dAJ0421AVs9E7/FxBSezrMmjI/gm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lAqBylIqylcCzf4lHecB5veigSfmYoBycaxN2SHgT8e7pWKZwCzqzZpigUr9DlRuoIxXn8pIZJgHtkwpa8togHIiw587LeNx9mc2ZwIK5DOlXJaMFqhWwoMp/Ax+1W+ToOXTHGKNrDMLLo38LmKsQKmbdSrWil+N82UJaS40YTuJv/RdtAdpzet+aJDzvMpQV71oo2gYX5RXG2HnYZXtouzNRzXE3R0KE6jWjZU2iaZ9u8pqpU3UfvwrYSgSBVDtGDurBlHn/zj0QMIh7qlDNOfmcBj9ihKo9o+l1euiWGxSE5eun3na6jxQk3joEgdQ7TR+FWutE43lhQpph3sQvISAVRa9ppRzipY4gZqdw8/WigIWDWt1gD8EIsqSLlT/KPUVlKSAujs2XTLYeRHiIlA2DVi1qkRtK8PSULaEDF+Ue7ashwkTlf8DQc/cITdx9+UAAAAASUVORK5CYII=";function _h(o){i.append_styles(o,"svelte-1ogmlqq",".arrow.svelte-1ogmlqq{width:100%;height:100%;background-size:100%;transition:transform 400ms ease-in-out;cursor:pointer;pointer-events:auto}.arrow-wrapper.svelte-1ogmlqq{position:relative;width:100%;height:100%}.arrow.left.svelte-1ogmlqq{transform:rotate(0deg)}.arrow.right.svelte-1ogmlqq{transform:rotate(-180deg)}.arrow.top.svelte-1ogmlqq{transform:rotate(90deg)}.arrow.bottom.svelte-1ogmlqq{transform:rotate(-90deg)}")}function po(o){let t,e,n,s,r,a,l,c,d,u;return e=new ve({props:{center:!0,blurRadius:9,spreadRadius:3}}),{c(){t=i.element("div"),i.create_component(e.$$.fragment),n=i.space(),s=i.element("div"),i.attr(s,"class",r="arrow "+o[0]+" svelte-1ogmlqq"),i.set_style(s,"background-image","url("+Lh+")"),i.attr(t,"class","arrow-wrapper svelte-1ogmlqq")},m(f,h){i.insert(f,t,h),i.mount_component(e,t,null),i.append(t,n),i.append(t,s),c=!0,d||(u=i.listen(s,"click",o[5]),d=!0)},p(f,h){o=f,(!c||h&1&&r!==(r="arrow "+o[0]+" svelte-1ogmlqq"))&&i.attr(s,"class",r)},i(f){c||(i.transition_in(e.$$.fragment,f),f&&i.add_render_callback(()=>{l&&l.end(1),a=i.create_in_transition(s,me.fade,{duration:o[2],delay:o[3],easing:Se.cubicInOut}),a.start()}),c=!0)},o(f){i.transition_out(e.$$.fragment,f),a&&a.invalidate(),f&&(l=i.create_out_transition(s,me.fade,{duration:o[2],delay:o[4],easing:Se.cubicInOut})),c=!1},d(f){f&&i.detach(t),i.destroy_component(e),f&&l&&l.end(),d=!1,u()}}}function zh(o){let t,e,n=o[1]&&po(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[1]?n?(n.p(s,r),r&2&&i.transition_in(n,1)):(n=po(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function Mh(o,t,e){let{direction:n="right"}=t,{visible:s=!0}=t,{duration:r=0}=t,{inDelay:a=0}=t,{outDelay:l=0}=t;function c(d){i.bubble.call(this,o,d)}return o.$$set=d=>{"direction"in d&&e(0,n=d.direction),"visible"in d&&e(1,s=d.visible),"duration"in d&&e(2,r=d.duration),"inDelay"in d&&e(3,a=d.inDelay),"outDelay"in d&&e(4,l=d.outDelay)},[n,s,r,a,l,c]}class Th extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Mh,zh,i.safe_not_equal,{direction:0,visible:1,duration:2,inDelay:3,outDelay:4},_h)}}function jh(o,t,e=20,n=5){return new Promise((s,r)=>{let a=0;const l=setInterval(()=>{const c=o();t(c)?(clearInterval(l),s(c)):a>=n&&(clearInterval(l),r(c)),a++},e)})}function Bh(o){i.append_styles(o,"svelte-1fuzm7v",".text.svelte-1fuzm7v{pointer-events:auto;box-sizing:border-box;display:inline-block;max-width:7.5rem;transition:transform 400ms ease-in-out;font-size:0.75rem;line-height:1.125rem;white-space:initial;cursor:pointer}.arrow.svelte-1fuzm7v{pointer-events:auto;display:inline-block;vertical-align:top;width:0.875rem;height:0.875rem;margin-left:0.125rem;margin-top:0.125rem}")}function go(o,t,e){const n=o.slice();return n[11]=t[e].id,n[12]=t[e].content,n}function Ao(o,t){let e,n,s;return n=new Zs({props:{unfolded:t[0],content:t[12],inDelay:500,outDelay:t[5]}}),{key:o,first:null,c(){e=i.element("div"),i.create_component(n.$$.fragment),i.attr(e,"class","text svelte-1fuzm7v"),i.set_style(e,"transform",t[7],!1),this.first=e},m(r,a){i.insert(r,e,a),i.mount_component(n,e,null),t[10](e),s=!0},p(r,a){t=r;const l={};a&1&&(l.unfolded=t[0]),a&2&&(l.content=t[12]),a&32&&(l.outDelay=t[5]),n.$set(l),a&128&&i.set_style(e,"transform",t[7],!1)},i(r){s||(i.transition_in(n.$$.fragment,r),s=!0)},o(r){i.transition_out(n.$$.fragment,r),s=!1},d(r){r&&i.detach(e),i.destroy_component(n),t[10](null)}}}function vo(o){let t,e,n;return e=new Th({props:{direction:o[6],visible:o[0],inDelay:600,duration:1e3}}),{c(){t=i.element("div"),i.create_component(e.$$.fragment),i.attr(t,"class","arrow svelte-1fuzm7v")},m(s,r){i.insert(s,t,r),i.mount_component(e,t,null),n=!0},p(s,r){const a={};r&64&&(a.direction=s[6]),r&1&&(a.visible=s[0]),e.$set(a)},i(s){n||(i.transition_in(e.$$.fragment,s),n=!0)},o(s){i.transition_out(e.$$.fragment,s),n=!1},d(s){s&&i.detach(t),i.destroy_component(e)}}}function Qh(o){let t=[],e=new Map,n,s,r,a=o[1];const l=d=>d[11];for(let d=0;d<a.length;d+=1){let u=go(o,a,d),f=l(u);e.set(f,t[d]=Ao(f,u))}let c=o[3]<o[4]&&vo(o);return{c(){for(let d=0;d<t.length;d+=1)t[d].c();n=i.space(),c&&c.c(),s=i.empty()},m(d,u){for(let f=0;f<t.length;f+=1)t[f].m(d,u);i.insert(d,n,u),c&&c.m(d,u),i.insert(d,s,u),r=!0},p(d,[u]){u&167&&(a=d[1],i.group_outros(),t=i.update_keyed_each(t,u,l,1,d,a,e,n.parentNode,i.outro_and_destroy_block,Ao,n,go),i.check_outros()),d[3]<d[4]?c?(c.p(d,u),u&24&&i.transition_in(c,1)):(c=vo(d),c.c(),i.transition_in(c,1),c.m(s.parentNode,s)):c&&(i.group_outros(),i.transition_out(c,1,1,()=>{c=null}),i.check_outros())},i(d){if(!r){for(let u=0;u<a.length;u+=1)i.transition_in(t[u]);i.transition_in(c),r=!0}},o(d){for(let u=0;u<t.length;u+=1)i.transition_out(t[u]);i.transition_out(c),r=!1},d(d){for(let u=0;u<t.length;u+=1)t[u].d(d);d&&i.detach(n),c&&c.d(d),d&&i.detach(s)}}}function Rh(o,t,e){let n,s,r,{visible:a=!1}=t,{textUnfolded:l=!1}=t,{textItems:c}=t,d,u=0,f=0,h=0;function p(g){i.binding_callbacks[g?"unshift":"push"](()=>{d=g,e(2,d)})}return o.$$set=g=>{"visible"in g&&e(0,a=g.visible),"textUnfolded"in g&&e(8,l=g.textUnfolded),"textItems"in g&&e(1,c=g.textItems)},o.$$.update=()=>{if(o.$$.dirty&5&&d&&a){const{lineHeight:g}=getComputedStyle(d);e(4,h=d.offsetHeight),jh(()=>d==null?void 0:d.offsetHeight,Boolean).then(()=>{e(4,h=d.offsetHeight)}),e(3,f=Number(g.replace("px","")))}o.$$.dirty&280&&e(9,u=l?f-h:0),o.$$.dirty&512&&e(7,n=`translateY(${u}px)`),o.$$.dirty&256&&e(6,s=l?"left":"right"),o.$$.dirty&256&&e(5,r=l?450:0)},[a,c,d,f,h,r,s,n,l,u,p]}class qs extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Rh,Qh,i.safe_not_equal,{visible:0,textUnfolded:8,textItems:1},Bh)}}function Oh(o){i.append_styles(o,"svelte-18yy5x8",".line.svelte-18yy5x8{position:absolute;top:0;left:0;width:10.125rem;height:0.0625rem;transform:translate3d(0, -50%, 0.625rem)}.content.svelte-18yy5x8{width:-moz-max-content;width:max-content;height:3.375rem;padding:2.25rem 0.25rem 0 1rem;position:absolute;left:0;bottom:0;overflow:hidden;box-sizing:border-box;font-size:0;pointer-events:none;white-space:nowrap;font-weight:600}")}function bo(o){var h,p;let t,e,n,s,r,a,l,c,d,u,f;return t=new ve({props:{visible:o[2],left:o[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}}),s=new Js({props:{unfolded:o[2],duration:1e3,outDelay:o[5]+40*Math.min((p=(h=o[4][0])==null?void 0:h.content.length)!=null?p:10,15)}}),l=new qs({props:{visible:o[2],textUnfolded:o[1],textItems:o[4]}}),{c(){i.create_component(t.$$.fragment),e=i.space(),n=i.element("div"),i.create_component(s.$$.fragment),r=i.space(),a=i.element("div"),i.create_component(l.$$.fragment),i.attr(n,"class","line svelte-18yy5x8"),i.set_style(n,"width",o[3]+"px",!1),i.attr(a,"class","content svelte-18yy5x8"),i.add_render_callback(()=>o[8].call(a))},m(g,A){i.mount_component(t,g,A),i.insert(g,e,A),i.insert(g,n,A),i.mount_component(s,n,null),i.insert(g,r,A),i.insert(g,a,A),i.mount_component(l,a,null),c=i.add_resize_listener(a,o[8].bind(a)),d=!0,u||(f=i.listen(a,"click",o[6]),u=!0)},p(g,A){var y,I;const b={};A&4&&(b.visible=g[2]),A&8&&(b.left=g[3]/2+"px"),t.$set(b);const v={};A&4&&(v.unfolded=g[2]),A&48&&(v.outDelay=g[5]+40*Math.min((I=(y=g[4][0])==null?void 0:y.content.length)!=null?I:10,15)),s.$set(v),A&8&&i.set_style(n,"width",g[3]+"px",!1);const w={};A&4&&(w.visible=g[2]),A&2&&(w.textUnfolded=g[1]),A&16&&(w.textItems=g[4]),l.$set(w)},i(g){d||(i.transition_in(t.$$.fragment,g),i.transition_in(s.$$.fragment,g),i.transition_in(l.$$.fragment,g),d=!0)},o(g){i.transition_out(t.$$.fragment,g),i.transition_out(s.$$.fragment,g),i.transition_out(l.$$.fragment,g),d=!1},d(g){i.destroy_component(t,g),g&&i.detach(e),g&&i.detach(n),i.destroy_component(s),g&&i.detach(r),g&&i.detach(a),i.destroy_component(l),c(),u=!1,f()}}}function Hh(o){let t,e,n=o[0].state&&bo(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[0].state?n?(n.p(s,r),r&1&&i.transition_in(n,1)):(n=bo(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function Fh(o,t,e){let n,s,r,{tag:a}=t,l,c=!1,d=[];function u(){e(1,c=!c)}function f(){l=this.clientWidth,e(3,l)}return o.$$set=h=>{"tag"in h&&e(0,a=h.tag)},o.$$.update=()=>{var h;o.$$.dirty&1&&e(2,n=!!((h=a.state)!=null&&h.unfolded)),o.$$.dirty&1&&e(7,s=a.data.text),o.$$.dirty&128&&e(4,d=[{id:ue(),content:s}]),o.$$.dirty&4&&(n||setTimeout(()=>{e(1,c=!1)},20)),o.$$.dirty&2&&e(5,r=c?450:0)},[a,c,n,l,d,r,u,s,f]}class Gh extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Fh,Hh,i.safe_not_equal,{tag:0},Oh)}}function Nh(o){i.append_styles(o,"svelte-e72ouh",".line.svelte-e72ouh{width:100%;height:100%;overflow:visible}")}function yo(o){let t,e,n,s;return{c(){t=i.svg_element("path"),i.attr(t,"fill","none"),i.attr(t,"stroke","url(#"+o[4]+")"),i.attr(t,"stroke-width","1"),i.attr(t,"d","M0 21 L14 0.5 L105 0.5")},m(r,a){i.insert(r,t,a),s=!0},p(r,a){o=r},i(r){s||(r&&i.add_render_callback(()=>{n&&n.end(1),e=i.create_in_transition(t,me.draw,{duration:o[1],delay:o[0],easing:Se.cubicOut}),e.start()}),s=!0)},o(r){e&&e.invalidate(),r&&(n=i.create_out_transition(t,me.draw,{duration:o[1],delay:o[2],easing:Se.cubicInOut})),s=!1},d(r){r&&i.detach(t),r&&n&&n.end()}}}function Wh(o){let t,e,n,s,r,a=o[3]&&yo(o);return{c(){t=i.svg_element("svg"),e=i.svg_element("defs"),n=i.svg_element("linearGradient"),s=i.svg_element("stop"),r=i.svg_element("stop"),a&&a.c(),i.attr(s,"offset","25%"),i.attr(s,"stop-color","white"),i.attr(s,"stop-opacity","1"),i.attr(r,"offset","100%"),i.attr(r,"stop-color","white"),i.attr(r,"stop-opacity","0.5"),i.attr(n,"id",o[4]),i.attr(n,"gradientUnits","userSpaceOnUse"),i.attr(t,"class","line svelte-e72ouh"),i.attr(t,"viewBox","0 0 105 21")},m(l,c){i.insert(l,t,c),i.append(t,e),i.append(e,n),i.append(n,s),i.append(n,r),a&&a.m(t,null)},p(l,[c]){l[3]?a?(a.p(l,c),c&8&&i.transition_in(a,1)):(a=yo(l),a.c(),i.transition_in(a,1),a.m(t,null)):a&&(i.group_outros(),i.transition_out(a,1,1,()=>{a=null}),i.check_outros())},i(l){i.transition_in(a)},o(l){i.transition_out(a)},d(l){l&&i.detach(t),a&&a.d()}}}function Xh(o,t,e){let{inDelay:n=0}=t,{duration:s=0}=t,{outDelay:r=0}=t,{unfolded:a}=t;const l=ue();return o.$$set=c=>{"inDelay"in c&&e(0,n=c.inDelay),"duration"in c&&e(1,s=c.duration),"outDelay"in c&&e(2,r=c.outDelay),"unfolded"in c&&e(3,a=c.unfolded)},[n,s,r,a,l]}class Yh extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Xh,Wh,i.safe_not_equal,{inDelay:0,duration:1,outDelay:2,unfolded:3},Nh)}}function Ve(o){return typeof o=="object"&&o!==null&&o.constructor&&Object.prototype.toString.call(o).slice(8,-1)==="Object"}function Te(o,t){const e=["__proto__","constructor","prototype"];Object.keys(t).filter(n=>e.indexOf(n)<0).forEach(n=>{typeof o[n]=="undefined"?o[n]=t[n]:Ve(t[n])&&Ve(o[n])&&Object.keys(t[n]).length>0?t[n].__swiper__?o[n]=t[n]:Te(o[n],t[n]):o[n]=t[n]})}function yn(o={}){return o.navigation&&typeof o.navigation.nextEl=="undefined"&&typeof o.navigation.prevEl=="undefined"}function wn(o={}){return o.pagination&&typeof o.pagination.el=="undefined"}function Cn(o={}){return o.scrollbar&&typeof o.scrollbar.el=="undefined"}function Ht(o=""){const t=o.split(" ").map(n=>n.trim()).filter(n=>!!n),e=[];return t.forEach(n=>{e.indexOf(n)<0&&e.push(n)}),e.join(" ")}const Ks=["modules","init","_direction","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_preloadImages","updateOnImagesReady","_loop","_loopAdditionalSlides","_loopedSlides","_loopedSlidesLimit","_loopFillGroupWithBlank","loopPreventsSlide","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideBlankClass","slideActiveClass","slideDuplicateActiveClass","slideVisibleClass","slideDuplicateClass","slideNextClass","slideDuplicateNextClass","slidePrevClass","slideDuplicatePrevClass","wrapperClass","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","lazy","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom"];function Uh(o={},t=!0){const e={on:{}},n={},s={};Te(e,mn.default.defaults),Te(e,mn.default.extendedDefaults),e._emitClasses=!0,e.init=!1;const r={},a=Ks.map(c=>c.replace(/_/,"")),l=Object.assign({},o);return Object.keys(l).forEach(c=>{typeof o[c]!="undefined"&&(a.indexOf(c)>=0?Ve(o[c])?(e[c]={},s[c]={},Te(e[c],o[c]),Te(s[c],o[c])):(e[c]=o[c],s[c]=o[c]):c.search(/on[A-Z]/)===0&&typeof o[c]=="function"?t?n[`${c[2].toLowerCase()}${c.substr(3)}`]=o[c]:e.on[`${c[2].toLowerCase()}${c.substr(3)}`]=o[c]:r[c]=o[c])}),["navigation","pagination","scrollbar"].forEach(c=>{e[c]===!0&&(e[c]={}),e[c]===!1&&delete e[c]}),{params:e,passedParams:s,rest:r,events:n}}function Vh({el:o,nextEl:t,prevEl:e,paginationEl:n,scrollbarEl:s,swiper:r},a){yn(a)&&t&&e&&(r.params.navigation.nextEl=t,r.originalParams.navigation.nextEl=t,r.params.navigation.prevEl=e,r.originalParams.navigation.prevEl=e),wn(a)&&n&&(r.params.pagination.el=n,r.originalParams.pagination.el=n),Cn(a)&&s&&(r.params.scrollbar.el=s,r.originalParams.scrollbar.el=s),r.init(o)}function Jh(o,t,e,n,s){const r=[];if(!t)return r;const a=c=>{r.indexOf(c)<0&&r.push(c)};if(e&&n){const c=n.map(s),d=e.map(s);c.join("")!==d.join("")&&a("children"),n.length!==e.length&&a("children")}return Ks.filter(c=>c[0]==="_").map(c=>c.replace(/_/,"")).forEach(c=>{if(c in o&&c in t)if(Ve(o[c])&&Ve(t[c])){const d=Object.keys(o[c]),u=Object.keys(t[c]);d.length!==u.length?a(c):(d.forEach(f=>{o[c][f]!==t[c][f]&&a(c)}),u.forEach(f=>{o[c][f]!==t[c][f]&&a(c)}))}else o[c]!==t[c]&&a(c)}),r}function Zh({swiper:o,slides:t,passedParams:e,changedParams:n,nextEl:s,prevEl:r,scrollbarEl:a,paginationEl:l}){const c=n.filter(k=>k!=="children"&&k!=="direction"),{params:d,pagination:u,navigation:f,scrollbar:h,virtual:p,thumbs:g}=o;let A,b,v,w,y;n.includes("thumbs")&&e.thumbs&&e.thumbs.swiper&&d.thumbs&&!d.thumbs.swiper&&(A=!0),n.includes("controller")&&e.controller&&e.controller.control&&d.controller&&!d.controller.control&&(b=!0),n.includes("pagination")&&e.pagination&&(e.pagination.el||l)&&(d.pagination||d.pagination===!1)&&u&&!u.el&&(v=!0),n.includes("scrollbar")&&e.scrollbar&&(e.scrollbar.el||a)&&(d.scrollbar||d.scrollbar===!1)&&h&&!h.el&&(w=!0),n.includes("navigation")&&e.navigation&&(e.navigation.prevEl||r)&&(e.navigation.nextEl||s)&&(d.navigation||d.navigation===!1)&&f&&!f.prevEl&&!f.nextEl&&(y=!0);const I=k=>{!o[k]||(o[k].destroy(),k==="navigation"?(d[k].prevEl=void 0,d[k].nextEl=void 0,o[k].prevEl=void 0,o[k].nextEl=void 0):(d[k].el=void 0,o[k].el=void 0))};c.forEach(k=>{if(Ve(d[k])&&Ve(e[k]))Te(d[k],e[k]);else{const C=e[k];(C===!0||C===!1)&&(k==="navigation"||k==="pagination"||k==="scrollbar")?C===!1&&I(k):d[k]=e[k]}}),c.includes("controller")&&!b&&o.controller&&o.controller.control&&d.controller&&d.controller.control&&(o.controller.control=d.controller.control),n.includes("children")&&t&&p&&d.virtual.enabled?(p.slides=t,p.update(!0)):n.includes("children")&&o.lazy&&o.params.lazy.enabled&&o.lazy.load(),A&&g.init()&&g.update(!0),b&&(o.controller.control=d.controller.control),v&&(l&&(d.pagination.el=l),u.init(),u.render(),u.update()),w&&(a&&(d.scrollbar.el=a),h.init(),h.updateSize(),h.setTranslate()),y&&(s&&(d.navigation.nextEl=s),r&&(d.navigation.prevEl=r),f.init(),f.update()),n.includes("allowSlideNext")&&(o.allowSlideNext=e.allowSlideNext),n.includes("allowSlidePrev")&&(o.allowSlidePrev=e.allowSlidePrev),n.includes("direction")&&o.changeDirection(e.direction,!1),o.update()}const qh=o=>({virtualData:o&512}),wo=o=>({virtualData:o[9]}),Kh=o=>({virtualData:o&512}),Co=o=>({virtualData:o[9]}),$h=o=>({virtualData:o&512}),Eo=o=>({virtualData:o[9]}),ef=o=>({virtualData:o&512}),Po=o=>({virtualData:o[9]}),tf=o=>({virtualData:o&512}),Io=o=>({virtualData:o[9]});function ko(o){let t,e,n;return{c(){t=i.element("div"),e=i.space(),n=i.element("div"),i.attr(t,"class","swiper-button-prev"),i.attr(n,"class","swiper-button-next")},m(s,r){i.insert(s,t,r),o[13](t),i.insert(s,e,r),i.insert(s,n,r),o[14](n)},p:i.noop,d(s){s&&i.detach(t),o[13](null),s&&i.detach(e),s&&i.detach(n),o[14](null)}}}function xo(o){let t;return{c(){t=i.element("div"),i.attr(t,"class","swiper-scrollbar")},m(e,n){i.insert(e,t,n),o[15](t)},p:i.noop,d(e){e&&i.detach(t),o[15](null)}}}function Do(o){let t;return{c(){t=i.element("div"),i.attr(t,"class","swiper-pagination")},m(e,n){i.insert(e,t,n),o[16](t)},p:i.noop,d(e){e&&i.detach(t),o[16](null)}}}function nf(o){let t,e,n,s,r,a,l=yn(o[2]),c,d=Cn(o[2]),u,f=wn(o[2]),h,p,g;const A=o[12]["container-start"],b=i.create_slot(A,o,o[11],Io),v=o[12]["wrapper-start"],w=i.create_slot(v,o,o[11],Po),y=o[12].default,I=i.create_slot(y,o,o[11],Eo),k=o[12]["wrapper-end"],C=i.create_slot(k,o,o[11],Co);let D=l&&ko(o),x=d&&xo(o),z=f&&Do(o);const L=o[12]["container-end"],T=i.create_slot(L,o,o[11],wo);let R=[{class:p=Ht(`${o[1]}${o[0]?` ${o[0]}`:""}`)},o[3]],E={};for(let S=0;S<R.length;S+=1)E=i.assign(E,R[S]);return{c(){t=i.element("div"),b&&b.c(),e=i.space(),n=i.element("div"),w&&w.c(),s=i.space(),I&&I.c(),r=i.space(),C&&C.c(),a=i.space(),D&&D.c(),c=i.space(),x&&x.c(),u=i.space(),z&&z.c(),h=i.space(),T&&T.c(),i.attr(n,"class","swiper-wrapper"),i.set_attributes(t,E)},m(S,_){i.insert(S,t,_),b&&b.m(t,null),i.append(t,e),i.append(t,n),w&&w.m(n,null),i.append(n,s),I&&I.m(n,null),i.append(n,r),C&&C.m(n,null),i.append(t,a),D&&D.m(t,null),i.append(t,c),x&&x.m(t,null),i.append(t,u),z&&z.m(t,null),i.append(t,h),T&&T.m(t,null),o[17](t),g=!0},p(S,[_]){b&&b.p&&(!g||_&2560)&&i.update_slot_base(b,A,S,S[11],g?i.get_slot_changes(A,S[11],_,tf):i.get_all_dirty_from_scope(S[11]),Io),w&&w.p&&(!g||_&2560)&&i.update_slot_base(w,v,S,S[11],g?i.get_slot_changes(v,S[11],_,ef):i.get_all_dirty_from_scope(S[11]),Po),I&&I.p&&(!g||_&2560)&&i.update_slot_base(I,y,S,S[11],g?i.get_slot_changes(y,S[11],_,$h):i.get_all_dirty_from_scope(S[11]),Eo),C&&C.p&&(!g||_&2560)&&i.update_slot_base(C,k,S,S[11],g?i.get_slot_changes(k,S[11],_,Kh):i.get_all_dirty_from_scope(S[11]),Co),_&4&&(l=yn(S[2])),l?D?D.p(S,_):(D=ko(S),D.c(),D.m(t,c)):D&&(D.d(1),D=null),_&4&&(d=Cn(S[2])),d?x?x.p(S,_):(x=xo(S),x.c(),x.m(t,u)):x&&(x.d(1),x=null),_&4&&(f=wn(S[2])),f?z?z.p(S,_):(z=Do(S),z.c(),z.m(t,h)):z&&(z.d(1),z=null),T&&T.p&&(!g||_&2560)&&i.update_slot_base(T,L,S,S[11],g?i.get_slot_changes(L,S[11],_,qh):i.get_all_dirty_from_scope(S[11]),wo),i.set_attributes(t,E=i.get_spread_update(R,[(!g||_&3&&p!==(p=Ht(`${S[1]}${S[0]?` ${S[0]}`:""}`)))&&{class:p},_&8&&S[3]]))},i(S){g||(i.transition_in(b,S),i.transition_in(w,S),i.transition_in(I,S),i.transition_in(C,S),i.transition_in(T,S),g=!0)},o(S){i.transition_out(b,S),i.transition_out(w,S),i.transition_out(I,S),i.transition_out(C,S),i.transition_out(T,S),g=!1},d(S){S&&i.detach(t),b&&b.d(S),w&&w.d(S),I&&I.d(S),C&&C.d(S),D&&D.d(),x&&x.d(),z&&z.d(),T&&T.d(S),o[17](null)}}}function of(o,t,e){const n=["class","swiper"];let s=i.compute_rest_props(t,n),{$$slots:r={},$$scope:a}=t;const l=Z.createEventDispatcher();let{class:c=void 0}=t,d="swiper",u=!1,f=null,h=null,p,g,A,b,v=null,w=null,y=null,I=null,k=null,C={slides:[]};function D(){return f}const x=B=>{e(9,C=B),Z.tick().then(()=>{f.$wrapperEl.children(".swiper-slide").each(O=>{O.onSwiper&&O.onSwiper(f)}),f.updateSlides(),f.updateProgress(),f.updateSlidesClasses(),f.lazy&&f.params.lazy.enabled&&f.lazy.load()})},z=()=>{p=Uh(s),e(2,g=p.params),A=p.passedParams,e(3,b=p.rest)};z(),h=A;const L=()=>{u=!0};if(g.onAny=(B,...O)=>{l(B,O)},Object.assign(g.on,{_beforeBreakpoint:L,_containerClasses(B,O){e(1,d=O)}}),f=new mn.default(g),Z.setContext("swiper",f),f.virtual&&f.params.virtual.enabled){const B={cache:!1,renderExternal:O=>{x(O),g.virtual&&g.virtual.renderExternal&&g.virtual.renderExternal(O)},renderExternalUpdate:!1};Te(f.params.virtual,B),Te(f.originalParams.virtual,B)}Z.onMount(()=>{!v||(Vh({el:v,nextEl:y,prevEl:w,paginationEl:k,scrollbarEl:I,swiper:f},g),l("swiper",[f]),!g.virtual&&f.slides.each(B=>{B.onSwiper&&B.onSwiper(f)}))}),Z.afterUpdate(()=>{if(!f)return;z();const B=Jh(A,h);(B.length||u)&&f&&!f.destroyed&&Zh({swiper:f,passedParams:A,changedParams:B,nextEl:y,prevEl:w,scrollbarEl:I,paginationEl:k}),u=!1,h=A}),Z.onDestroy(()=>{typeof window!="undefined"&&f&&!f.destroyed&&f.destroy(!0,!1)});function T(B){i.binding_callbacks[B?"unshift":"push"](()=>{w=B,e(5,w)})}function R(B){i.binding_callbacks[B?"unshift":"push"](()=>{y=B,e(6,y)})}function E(B){i.binding_callbacks[B?"unshift":"push"](()=>{I=B,e(7,I)})}function S(B){i.binding_callbacks[B?"unshift":"push"](()=>{k=B,e(8,k)})}function _(B){i.binding_callbacks[B?"unshift":"push"](()=>{v=B,e(4,v)})}return o.$$set=B=>{t=i.assign(i.assign({},t),i.exclude_internal_props(B)),e(27,s=i.compute_rest_props(t,n)),"class"in B&&e(0,c=B.class),"$$scope"in B&&e(11,a=B.$$scope)},[c,d,g,b,v,w,y,I,k,C,D,a,r,T,R,E,S,_]}class sf extends i.SvelteComponent{constructor(t){super(),i.init(this,t,of,nf,i.safe_not_equal,{class:0,swiper:10})}get swiper(){return this.$$.ctx[10]}}const rf=o=>({data:o&32}),So=o=>({data:o[5]}),af=o=>({data:o&32}),Lo=o=>({data:o[5]});function lf(o){let t;const e=o[8].default,n=i.create_slot(e,o,o[7],So);return{c(){n&&n.c()},m(s,r){n&&n.m(s,r),t=!0},p(s,r){n&&n.p&&(!t||r&160)&&i.update_slot_base(n,e,s,s[7],t?i.get_slot_changes(e,s[7],r,rf):i.get_all_dirty_from_scope(s[7]),So)},i(s){t||(i.transition_in(n,s),t=!0)},o(s){i.transition_out(n,s),t=!1},d(s){n&&n.d(s)}}}function cf(o){let t,e,n;const s=o[8].default,r=i.create_slot(s,o,o[7],Lo);return{c(){t=i.element("div"),r&&r.c(),i.attr(t,"class","swiper-zoom-container"),i.attr(t,"data-swiper-zoom",e=typeof o[0]=="number"?o[0]:void 0)},m(a,l){i.insert(a,t,l),r&&r.m(t,null),n=!0},p(a,l){r&&r.p&&(!n||l&160)&&i.update_slot_base(r,s,a,a[7],n?i.get_slot_changes(s,a[7],l,af):i.get_all_dirty_from_scope(a[7]),Lo),(!n||l&1&&e!==(e=typeof a[0]=="number"?a[0]:void 0))&&i.attr(t,"data-swiper-zoom",e)},i(a){n||(i.transition_in(r,a),n=!0)},o(a){i.transition_out(r,a),n=!1},d(a){a&&i.detach(t),r&&r.d(a)}}}function df(o){let t,e,n,s,r;const a=[cf,lf],l=[];function c(f,h){return f[0]?0:1}e=c(o),n=l[e]=a[e](o);let d=[{class:s=Ht(`${o[3]}${o[2]?` ${o[2]}`:""}`)},{"data-swiper-slide-index":o[1]},o[6]],u={};for(let f=0;f<d.length;f+=1)u=i.assign(u,d[f]);return{c(){t=i.element("div"),n.c(),i.set_attributes(t,u)},m(f,h){i.insert(f,t,h),l[e].m(t,null),o[9](t),r=!0},p(f,[h]){let p=e;e=c(f),e===p?l[e].p(f,h):(i.group_outros(),i.transition_out(l[p],1,1,()=>{l[p]=null}),i.check_outros(),n=l[e],n?n.p(f,h):(n=l[e]=a[e](f),n.c()),i.transition_in(n,1),n.m(t,null)),i.set_attributes(t,u=i.get_spread_update(d,[(!r||h&12&&s!==(s=Ht(`${f[3]}${f[2]?` ${f[2]}`:""}`)))&&{class:s},(!r||h&2)&&{"data-swiper-slide-index":f[1]},h&64&&f[6]]))},i(f){r||(i.transition_in(n),r=!0)},o(f){i.transition_out(n),r=!1},d(f){f&&i.detach(t),l[e].d(),o[9](null)}}}function uf(o,t,e){let n;const s=["zoom","virtualIndex","class"];let r=i.compute_rest_props(t,s),{$$slots:a={},$$scope:l}=t,{zoom:c=void 0}=t,{virtualIndex:d=void 0}=t,{class:u=void 0}=t,f=null,h="swiper-slide",p=Z.getContext("swiper"),g=!1;const A=(y,I,k)=>{I===f&&e(3,h=k)},b=()=>{!p||g||(p.on("_slideClass",A),g=!0)},v=()=>{!p||(p.off("_slideClass",A),g=!1)};Z.onMount(()=>{typeof d!="undefined"&&(e(4,f.onSwiper=y=>{p=y,b()},f),b())}),Z.afterUpdate(()=>{if(!(!f||!p)){if(p.destroyed){h!=="swiper-slide"&&e(3,h="swiper-slide");return}b()}}),Z.beforeUpdate(()=>{b()}),Z.onDestroy(()=>{!p||v()});function w(y){i.binding_callbacks[y?"unshift":"push"](()=>{f=y,e(4,f)})}return o.$$set=y=>{t=i.assign(i.assign({},t),i.exclude_internal_props(y)),e(6,r=i.compute_rest_props(t,s)),"zoom"in y&&e(0,c=y.zoom),"virtualIndex"in y&&e(1,d=y.virtualIndex),"class"in y&&e(2,u=y.class),"$$scope"in y&&e(7,l=y.$$scope)},o.$$.update=()=>{o.$$.dirty&8&&e(5,n={isActive:h.indexOf("swiper-slide-active")>=0||h.indexOf("swiper-slide-duplicate-active")>=0,isVisible:h.indexOf("swiper-slide-visible")>=0,isDuplicate:h.indexOf("swiper-slide-duplicate")>=0,isPrev:h.indexOf("swiper-slide-prev")>=0||h.indexOf("swiper-slide-duplicate-prev")>=0,isNext:h.indexOf("swiper-slide-next")>=0||h.indexOf("swiper-slide-duplicate-next")>=0})},[c,d,u,h,f,n,r,l,a,w]}class hf extends i.SvelteComponent{constructor(t){super(),i.init(this,t,uf,df,i.safe_not_equal,{zoom:0,virtualIndex:1,class:2})}}function ff(o){i.append_styles(o,"svelte-cwtvzu",".media-item.svelte-cwtvzu.svelte-cwtvzu{height:100%}.media-content.svelte-cwtvzu.svelte-cwtvzu{width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;-o-object-fit:inherit;object-fit:inherit}.video-icon.svelte-cwtvzu.svelte-cwtvzu{width:12.5rem;height:6.25rem;max-width:60%;max-height:60%;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.video-play-button-container.svelte-cwtvzu.svelte-cwtvzu{display:none;pointer-events:auto;position:absolute;width:100%;height:100%;top:0;left:0}.video-play-button-container.showPlayButton.svelte-cwtvzu.svelte-cwtvzu{display:block}.video-icon.large.svelte-cwtvzu.svelte-cwtvzu{width:12.5rem;height:6.25rem}.video-icon.small.svelte-cwtvzu.svelte-cwtvzu{width:1.75rem;height:1.75rem}.video-icon.svelte-cwtvzu .video-icon-img.svelte-cwtvzu{width:100%;height:100%;background-position:center center;background-size:contain;background-repeat:no-repeat}.video-icon.svelte-cwtvzu .video-icon-img.canPlay.svelte-cwtvzu{cursor:pointer}")}function _o(o){let t;function e(r,a){if(r[0].type==="Image")return pf;if(r[0].type==="Video")return mf}let n=e(o),s=n&&n(o);return{c(){t=i.element("div"),s&&s.c(),i.attr(t,"class","media-item svelte-cwtvzu")},m(r,a){i.insert(r,t,a),s&&s.m(t,null)},p(r,a){n===(n=e(r))&&s?s.p(r,a):(s&&s.d(1),s=n&&n(r),s&&(s.c(),s.m(t,null)))},d(r){r&&i.detach(t),s&&s.d()}}}function mf(o){let t,e,n,s,r,a,l,c,d,u,f;return{c(){var h;t=i.element("video"),a=i.space(),l=i.element("div"),c=i.element("div"),d=i.element("div"),i.attr(t,"class","media-content svelte-cwtvzu"),i.attr(t,"style",e=`object-fit: ${o[3]};`),i.src_url_equal(t.src,n=o[0].url+"#t=0.1")||i.attr(t,"src",n),i.attr(t,"poster",s=(h=o[0].videoCoverUrl)!=null?h:void 0),i.attr(t,"preload",r=o[0].videoCoverUrl?void 0:"auto"),t.playsInline=!0,i.attr(t,"paused",""),t.loop=!1,i.attr(t,"crossorigin",""),t.controls=!1,i.toggle_class(t,"showPlayButton",o[5]),i.attr(d,"class","video-icon-img svelte-cwtvzu"),i.set_style(d,"background-image","url("+(o[1]==="large"?fo:mo)+")"),i.toggle_class(d,"canPlay",o[2]),i.attr(c,"class","video-icon svelte-cwtvzu"),i.toggle_class(c,"large",o[1]==="large"),i.toggle_class(c,"small",o[1]==="small"),i.attr(l,"class","video-play-button-container svelte-cwtvzu"),i.toggle_class(l,"showPlayButton",o[5])},m(h,p){i.insert(h,t,p),o[7](t),i.insert(h,a,p),i.insert(h,l,p),i.append(l,c),i.append(c,d),u||(f=[i.listen(t,"click",o[6]),i.listen(d,"click",o[8])],u=!0)},p(h,p){var g;p&8&&e!==(e=`object-fit: ${h[3]};`)&&i.attr(t,"style",e),p&1&&!i.src_url_equal(t.src,n=h[0].url+"#t=0.1")&&i.attr(t,"src",n),p&1&&s!==(s=(g=h[0].videoCoverUrl)!=null?g:void 0)&&i.attr(t,"poster",s),p&1&&r!==(r=h[0].videoCoverUrl?void 0:"auto")&&i.attr(t,"preload",r),p&32&&i.toggle_class(t,"showPlayButton",h[5]),p&2&&i.set_style(d,"background-image","url("+(h[1]==="large"?fo:mo)+")"),p&4&&i.toggle_class(d,"canPlay",h[2]),p&2&&i.toggle_class(c,"large",h[1]==="large"),p&2&&i.toggle_class(c,"small",h[1]==="small"),p&32&&i.toggle_class(l,"showPlayButton",h[5])},d(h){h&&i.detach(t),o[7](null),h&&i.detach(a),h&&i.detach(l),u=!1,i.run_all(f)}}}function pf(o){let t,e,n,s;return{c(){t=i.element("img"),i.attr(t,"class","media-content svelte-cwtvzu"),i.attr(t,"style",e=`object-fit: ${o[3]};`),i.src_url_equal(t.src,n=o[0].url)||i.attr(t,"src",n),i.attr(t,"alt",s=o[0].name)},m(r,a){i.insert(r,t,a)},p(r,a){a&8&&e!==(e=`object-fit: ${r[3]};`)&&i.attr(t,"style",e),a&1&&!i.src_url_equal(t.src,n=r[0].url)&&i.attr(t,"src",n),a&1&&s!==(s=r[0].name)&&i.attr(t,"alt",s)},d(r){r&&i.detach(t)}}}function gf(o){let t,e=o[0]&&_o(o);return{c(){e&&e.c(),t=i.empty()},m(n,s){e&&e.m(n,s),i.insert(n,t,s)},p(n,[s]){n[0]?e?e.p(n,s):(e=_o(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:i.noop,o:i.noop,d(n){e&&e.d(n),n&&i.detach(t)}}}function Af(o,t,e){let{media:n}=t,{playButtonIfNeed:s="small"}=t,{canPlay:r=!0}=t,{objectFit:a="cover"}=t,l,c=!1;const d=()=>l==null?void 0:l.pause();function u(h){i.binding_callbacks[h?"unshift":"push"](()=>{l=h,e(4,l)})}const f=()=>{!r||l&&l.play()};return o.$$set=h=>{"media"in h&&e(0,n=h.media),"playButtonIfNeed"in h&&e(1,s=h.playButtonIfNeed),"canPlay"in h&&e(2,r=h.canPlay),"objectFit"in h&&e(3,a=h.objectFit)},o.$$.update=()=>{o.$$.dirty&16&&l&&(e(5,c=l.paused),l.addEventListener("play",()=>{e(5,c=!1)}),l.addEventListener("pause",()=>{e(5,c=!0)}))},[n,s,r,a,l,c,d,u,f]}class $s extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Af,gf,i.safe_not_equal,{media:0,playButtonIfNeed:1,canPlay:2,objectFit:3},ff)}}function vf(o){i.append_styles(o,"svelte-ai0lv9",".media.svelte-ai0lv9{width:100%;height:100%;position:relative;overflow:hidden;border-radius:0.125rem}")}function zo(o,t,e){const n=o.slice();return n[23]=t[e],n}function Mo(o){let t,e,n,s,r,a;const l=[yf,bf],c=[];function d(u,f){return u[13]?0:1}return e=d(o),n=c[e]=l[e](o),{c(){t=i.element("div"),n.c(),i.attr(t,"class","media svelte-ai0lv9"),i.toggle_class(t,"unfolded",o[4])},m(u,f){i.insert(u,t,f),c[e].m(t,null),a=!0},p(u,f){o=u;let h=e;e=d(o),e===h?c[e].p(o,f):(i.group_outros(),i.transition_out(c[h],1,1,()=>{c[h]=null}),i.check_outros(),n=c[e],n?n.p(o,f):(n=c[e]=l[e](o),n.c()),i.transition_in(n,1),n.m(t,null)),f&16&&i.toggle_class(t,"unfolded",o[4])},i(u){a||(i.transition_in(n),u&&i.add_render_callback(()=>{r&&r.end(1),s=i.create_in_transition(t,me.fly,o[5]?{y:4,duration:o[3],delay:o[1],easing:Se.linear}:void 0),s.start()}),a=!0)},o(u){i.transition_out(n),s&&s.invalidate(),u&&(r=i.create_out_transition(t,me.fly,o[5]?{y:4,duration:o[3],delay:o[2],easing:Se.linear}:void 0)),a=!1},d(u){u&&i.detach(t),c[e].d(),u&&r&&r.end()}}}function bf(o){let t,e;return t=new $s({props:{media:o[0][0],objectFit:o[8],playButtonIfNeed:o[6],canPlay:o[7]}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&1&&(r.media=n[0][0]),s&256&&(r.objectFit=n[8]),s&64&&(r.playButtonIfNeed=n[6]),s&128&&(r.canPlay=n[7]),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function yf(o){let t,e;return t=new sf({props:{style:"height: 100%",modules:[ds.Autoplay],spaceBetween:30,autoplay:o[14]?re({delay:4e3,stopOnLastSlide:!1,disableOnInteraction:!1}):!1,loop:!0,$$slots:{default:[Cf]},$$scope:{ctx:o}}}),t.$on("init",o[19]),t.$on("slideChange",o[20]),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&16384&&(r.autoplay=n[14]?re({delay:4e3,stopOnLastSlide:!1,disableOnInteraction:!1}):!1),s&67111360&&(r.$$scope={dirty:s,ctx:n}),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function wf(o){let t,e,n;return t=new $s({props:{media:o[23],objectFit:o[8],playButtonIfNeed:o[6],canPlay:o[7]}}),{c(){i.create_component(t.$$.fragment),e=i.space()},m(s,r){i.mount_component(t,s,r),i.insert(s,e,r),n=!0},p(s,r){const a={};r&2048&&(a.media=s[23]),r&256&&(a.objectFit=s[8]),r&64&&(a.playButtonIfNeed=s[6]),r&128&&(a.canPlay=s[7]),t.$set(a)},i(s){n||(i.transition_in(t.$$.fragment,s),n=!0)},o(s){i.transition_out(t.$$.fragment,s),n=!1},d(s){i.destroy_component(t,s),s&&i.detach(e)}}}function To(o){let t,e;return t=new hf({props:{$$slots:{default:[wf]},$$scope:{ctx:o}}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&67111360&&(r.$$scope={dirty:s,ctx:n}),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function Cf(o){let t,e,n=o[11],s=[];for(let a=0;a<n.length;a+=1)s[a]=To(zo(o,n,a));const r=a=>i.transition_out(s[a],1,1,()=>{s[a]=null});return{c(){for(let a=0;a<s.length;a+=1)s[a].c();t=i.empty()},m(a,l){for(let c=0;c<s.length;c+=1)s[c].m(a,l);i.insert(a,t,l),e=!0},p(a,l){if(l&2496){n=a[11];let c;for(c=0;c<n.length;c+=1){const d=zo(a,n,c);s[c]?(s[c].p(d,l),i.transition_in(s[c],1)):(s[c]=To(d),s[c].c(),i.transition_in(s[c],1),s[c].m(t.parentNode,t))}for(i.group_outros(),c=n.length;c<s.length;c+=1)r(c);i.check_outros()}},i(a){if(!e){for(let l=0;l<n.length;l+=1)i.transition_in(s[l]);e=!0}},o(a){s=s.filter(Boolean);for(let l=0;l<s.length;l+=1)i.transition_out(s[l]);e=!1},d(a){i.destroy_each(s,a),a&&i.detach(t)}}}function Ef(o){let t,e,n=o[4]&&Mo(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[4]?n?(n.p(s,r),r&16&&i.transition_in(n,1)):(n=Mo(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function Pf(o,t,e){let n,s,r,{tag:a}=t,{mediaData:l}=t,{inDelay:c=0}=t,{outDelay:d=0}=t,{duration:u=0}=t,{unfolded:f=!0}=t,{animation:h=!0}=t,{playButtonIfNeed:p="small"}=t,{canPlay:g=!0}=t,{objectFit:A="cover"}=t,{enableCarousel:b=!0}=t,{autoplayConfig:v={autoplay:!0,autoplayVideo:!1}}=t;const w=Z.getContext("mediaStore"),y=Z.getContext("hooks");let I;function k(L){!n||!I||(w.set({currentMediaUrl:this.src}),y.emit("playStateChange",{event:L,state:"playing",tag:a,mediaInstance:this}),I.autoplay.stop())}function C(L){!n||!I||(y.emit("playStateChange",{event:L,state:"paused",tag:a,mediaInstance:this}),I.autoplay.running||I.autoplay.start())}let D=null;const x=L=>{e(10,I=L.detail[0])},z=L=>F(this,null,function*(){var B,O,G;if(!r||!v.autoplayVideo)return;const T=L.detail[0];if(!T)return;const R=T.realIndex;if(R===D)return;e(12,D=R);const E=s[R];if(!E||E.type!=="Video")return;T.autoplay.stop(),T.slides.map(Q=>Q.querySelector("video")).filter(Ue).forEach(Q=>Q.pause());const _=(B=T.slides[T.activeIndex])==null?void 0:B.querySelector("video");if(_&&(_.removeEventListener("play",k),_.removeEventListener("pause",C),_.addEventListener("play",k),_.addEventListener("pause",C)),_){_.addEventListener("click",()=>_.pause());const Q=(G=(O=_.parentElement)==null?void 0:O.getElementsByClassName("video-play-button-container"))==null?void 0:G[0];_.addEventListener("play",()=>Q==null?void 0:Q.classList.remove("showPlayButton")),_.addEventListener("pause",()=>Q==null?void 0:Q.classList.add("showPlayButton")),Q&&(_.paused?Q.classList.add("showPlayButton"):Q.classList.remove("showPlayButton"),Q.addEventListener("click",()=>_.play()))}});return o.$$set=L=>{"tag"in L&&e(17,a=L.tag),"mediaData"in L&&e(0,l=L.mediaData),"inDelay"in L&&e(1,c=L.inDelay),"outDelay"in L&&e(2,d=L.outDelay),"duration"in L&&e(3,u=L.duration),"unfolded"in L&&e(4,f=L.unfolded),"animation"in L&&e(5,h=L.animation),"playButtonIfNeed"in L&&e(6,p=L.playButtonIfNeed),"canPlay"in L&&e(7,g=L.canPlay),"objectFit"in L&&e(8,A=L.objectFit),"enableCarousel"in L&&e(18,b=L.enableCarousel),"autoplayConfig"in L&&e(9,v=L.autoplayConfig)},o.$$.update=()=>{o.$$.dirty&262145&&e(13,n=b&&(l==null?void 0:l.length)>1),o.$$.dirty&1&&e(11,s=l),o.$$.dirty&2560&&e(14,r=s.length>1&&v.autoplay),o.$$.dirty&1024&&I&&I.slides.forEach(L=>{const T=L.querySelector("video");T&&w.subscribe(({currentMediaUrl:R})=>{R!==T.src&&T.pause()})})},[l,c,d,u,f,h,p,g,A,v,I,s,D,n,r,k,C,a,b,x,z]}class er extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Pf,Ef,i.safe_not_equal,{tag:17,mediaData:0,inDelay:1,outDelay:2,duration:3,unfolded:4,animation:5,playButtonIfNeed:6,canPlay:7,objectFit:8,enableCarousel:18,autoplayConfig:9},vf)}}function If(o){i.append_styles(o,"svelte-1f7m1lj",".line.svelte-1f7m1lj{position:absolute;width:6.5625rem;height:1.3125rem;transform:translateY(-100%)}.text.svelte-1f7m1lj{position:absolute;width:6.25rem;left:1rem;bottom:0.0625rem;font-weight:600}.media-wrapper.svelte-1f7m1lj{position:absolute;left:0.875rem;top:-5.3125rem;width:5.625rem;height:3.75rem;font-weight:600}")}function jo(o,t,e){const n=o.slice();return n[5]=t[e].id,n[1]=t[e].content,n}function Bo(o){let t,e,n,s,r,a=[],l=new Map,c,d,u;t=new ve({props:{visible:o[4],left:61,bottom:57,width:2,blurRadius:150,spreadRadius:75}}),s=new Yh({props:{unfolded:o[4],duration:1e3,outDelay:400}});let f=o[2];const h=g=>g[5];for(let g=0;g<f.length;g+=1){let A=jo(o,f,g),b=h(A);l.set(b,a[g]=Qo(b,A))}let p=o[3]&&Ro(o);return{c(){i.create_component(t.$$.fragment),e=i.space(),n=i.element("div"),i.create_component(s.$$.fragment),r=i.space();for(let g=0;g<a.length;g+=1)a[g].c();c=i.space(),p&&p.c(),d=i.empty(),i.attr(n,"class","line svelte-1f7m1lj")},m(g,A){i.mount_component(t,g,A),i.insert(g,e,A),i.insert(g,n,A),i.mount_component(s,n,null),i.insert(g,r,A);for(let b=0;b<a.length;b+=1)a[b].m(g,A);i.insert(g,c,A),p&&p.m(g,A),i.insert(g,d,A),u=!0},p(g,A){const b={};A&16&&(b.visible=g[4]),t.$set(b);const v={};A&16&&(v.unfolded=g[4]),s.$set(v),A&20&&(f=g[2],i.group_outros(),a=i.update_keyed_each(a,A,h,1,g,f,l,c.parentNode,i.outro_and_destroy_block,Qo,c,jo),i.check_outros()),g[3]?p?(p.p(g,A),A&8&&i.transition_in(p,1)):(p=Ro(g),p.c(),i.transition_in(p,1),p.m(d.parentNode,d)):p&&(i.group_outros(),i.transition_out(p,1,1,()=>{p=null}),i.check_outros())},i(g){if(!u){i.transition_in(t.$$.fragment,g),i.transition_in(s.$$.fragment,g);for(let A=0;A<f.length;A+=1)i.transition_in(a[A]);i.transition_in(p),u=!0}},o(g){i.transition_out(t.$$.fragment,g),i.transition_out(s.$$.fragment,g);for(let A=0;A<a.length;A+=1)i.transition_out(a[A]);i.transition_out(p),u=!1},d(g){i.destroy_component(t,g),g&&i.detach(e),g&&i.detach(n),i.destroy_component(s),g&&i.detach(r);for(let A=0;A<a.length;A+=1)a[A].d(g);g&&i.detach(c),p&&p.d(g),g&&i.detach(d)}}}function Qo(o,t){let e,n,s;return n=new Zs({props:{unfolded:t[4],content:t[1],inDelay:500}}),{key:o,first:null,c(){e=i.element("div"),i.create_component(n.$$.fragment),i.attr(e,"class","text svelte-1f7m1lj"),this.first=e},m(r,a){i.insert(r,e,a),i.mount_component(n,e,null),s=!0},p(r,a){t=r;const l={};a&16&&(l.unfolded=t[4]),a&4&&(l.content=t[1]),n.$set(l)},i(r){s||(i.transition_in(n.$$.fragment,r),s=!0)},o(r){i.transition_out(n.$$.fragment,r),s=!1},d(r){r&&i.detach(e),i.destroy_component(n)}}}function Ro(o){let t,e,n;return e=new er({props:{autoplayConfig:{autoplay:!1},unfolded:o[4],mediaData:o[3],tag:o[0],enableCarousel:!1,canPlay:!1,playButtonIfNeed:"small",inDelay:500,duration:500}}),{c(){t=i.element("div"),i.create_component(e.$$.fragment),i.attr(t,"class","media-wrapper svelte-1f7m1lj")},m(s,r){i.insert(s,t,r),i.mount_component(e,t,null),n=!0},p(s,r){const a={};r&16&&(a.unfolded=s[4]),r&8&&(a.mediaData=s[3]),r&1&&(a.tag=s[0]),e.$set(a)},i(s){n||(i.transition_in(e.$$.fragment,s),n=!0)},o(s){i.transition_out(e.$$.fragment,s),n=!1},d(s){s&&i.detach(t),i.destroy_component(e)}}}function kf(o){let t,e,n=o[0].state&&Bo(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[0].state?n?(n.p(s,r),r&1&&i.transition_in(n,1)):(n=Bo(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function xf(o,t,e){let n,s,r,{tag:a}=t,l;return o.$$set=c=>{"tag"in c&&e(0,a=c.tag)},o.$$.update=()=>{var c,d,u;o.$$.dirty&1&&e(4,n=a.state?a.state.unfolded:!1),o.$$.dirty&1&&e(1,s=((d=(c=a.data.text)==null?void 0:c.length)!=null?d:0)>7?((u=a.data.text)==null?void 0:u.substring(0,6))+"...":a.data.text),o.$$.dirty&1&&e(3,r=a.data.mediaData),o.$$.dirty&2&&e(2,l=s?[{id:ue(),content:s}]:[])},[a,s,l,r,n]}class Df extends i.SvelteComponent{constructor(t){super(),i.init(this,t,xf,kf,i.safe_not_equal,{tag:0},If)}}function Sf(o){i.append_styles(o,"svelte-8mby9k",".svelte-8mby9k.svelte-8mby9k{box-sizing:border-box}.marketing.svelte-8mby9k.svelte-8mby9k{transform:translateY(-100%)}.content.svelte-8mby9k .headerImage.svelte-8mby9k{position:absolute;width:100%;top:0.25rem;transform:translateY(-100%);border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.line.svelte-8mby9k.svelte-8mby9k{position:absolute;height:2.0625rem;width:0.0625rem;left:50%;transform:translateX(-50%);background-color:white;bottom:0;transform-origin:bottom;transition:all 500ms}.content.svelte-8mby9k.svelte-8mby9k{background-color:white;position:relative;display:flex;flex-direction:column;min-width:11.125rem;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;border-radius:0.25rem;top:-1.875rem;left:-1rem;padding:0.5rem 0rem 0.5625rem;transition:all 500ms}.title.svelte-8mby9k.svelte-8mby9k{position:absolute;background-color:white;border-radius:0.25rem;width:100%;top:0.5rem;padding-left:0.75rem;padding-right:0.75rem}.title.svelte-8mby9k .text.svelte-8mby9k{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;font-weight:bold;line-height:1.125rem;color:#000}.footer.svelte-8mby9k.svelte-8mby9k{position:relative;padding-left:0.75rem;padding-right:0.75rem;width:100%;height:1.375rem;display:flex;align-items:center}.footer.svelte-8mby9k .goto-button.svelte-8mby9k{flex-shrink:0;white-space:nowrap;background-image:linear-gradient(to right, rgba(87, 144, 253, 1) 0, rgba(42, 114, 254, 1) 100%);color:#fff;font-size:0.625rem;border-radius:0.875rem;font-weight:bold;padding-left:0.5rem;padding-right:0.5rem;height:1.25rem;margin-left:auto;display:flex;align-items:center}.footer.svelte-8mby9k .goto-icon.svelte-8mby9k::after{content:'';display:inline-block;width:0.75rem;height:0.75rem;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAeFBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////GqOSsAAAAJ3RSTlMAFNO2pYt4bErz8uP6ysawgVtBPDcR5C4s2L6ZmJBzZGJXUyEeDws/0G2zAAAAkklEQVQ4y+3TRw6DMBAF0OAeJ3QCpCe0uf8NwRILLBYfiS1/aT3JoymnI+sERZ5VCH0iVto3QDfBLmeSSMUTogRV9bBEpJAKaYpGijn13aTSLeraeG9D0NZFZv4/rRL5FDHnITlllqjv6tykWsmX4JHr05y7j6oFKq2P8He48B0tAM0EY0EDxquClw6vLz6EI35GmwwSZpe+WOgAAAAASUVORK5CYII=);background-size:100% auto;background-repeat:no-repeat}.price.svelte-8mby9k.svelte-8mby9k{flex-shrink:0;margin-right:0.75rem;white-space:nowrap;color:#ff6600;display:flex;align-items:baseline}.price.svelte-8mby9k .value.svelte-8mby9k{position:relative;top:0.0625rem;font-size:1.125rem;line-height:1.375rem;font-family:TG-TYPE, PingFangSC, Segoe UI, Rototo, sans-serif;letter-spacing:0rem}.price.svelte-8mby9k .unit.svelte-8mby9k{padding-left:0.125rem;font-size:0.625rem}.tag.svelte-8mby9k.svelte-8mby9k{position:relative;background-color:white;display:flex;width:-moz-max-content;width:max-content;padding-left:0.75rem;padding-right:0.75rem;min-height:1.75rem}.tag.svelte-8mby9k .base-tag.svelte-8mby9k{height:1rem;margin-top:1.375rem;margin-bottom:0.5rem;margin-right:0.25rem;font-size:0.625rem;line-height:0.875rem;padding:0.0625rem 0.25rem;border-radius:0.125rem;overflow:hidden}.tag.svelte-8mby9k .primary-tag.svelte-8mby9k{background:#e5eefe;color:#0055ff}.tag.svelte-8mby9k .secondary-tag.svelte-8mby9k{background:rgba(255, 102, 0, 0.08);color:rgba(255, 102, 0, 1)}.unfolded.svelte-8mby9k .line.svelte-8mby9k{transform:translateX(-50%) scale(1, 1)}.folded.svelte-8mby9k .line.svelte-8mby9k{transform:translateX(-50%) scale(1, 0);transition-timing-function:ease-in}.unfolded.svelte-8mby9k .content.svelte-8mby9k{opacity:1}.folded.svelte-8mby9k .content.svelte-8mby9k{opacity:0;transform:translateY(0.425rem);transition-timing-function:ease-in}")}function Oo(o,t,e){const n=o.slice();return n[0]=t[e],n}function Ho(o,t,e){const n=o.slice();return n[0]=t[e],n}function Fo(o){let t,e=o[0]+"",n;return{c(){t=i.element("div"),n=i.text(e),i.attr(t,"class","base-tag primary-tag svelte-8mby9k")},m(s,r){i.insert(s,t,r),i.append(t,n)},p(s,r){r&4&&e!==(e=s[0]+"")&&i.set_data(n,e)},d(s){s&&i.detach(t)}}}function Go(o){let t,e=o[0]&&Fo(o);return{c(){e&&e.c(),t=i.empty()},m(n,s){e&&e.m(n,s),i.insert(n,t,s)},p(n,s){n[0]?e?e.p(n,s):(e=Fo(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},d(n){e&&e.d(n),n&&i.detach(t)}}}function No(o){let t,e=o[0]+"",n;return{c(){t=i.element("div"),n=i.text(e),i.attr(t,"class","base-tag secondary-tag svelte-8mby9k")},m(s,r){i.insert(s,t,r),i.append(t,n)},p(s,r){r&4&&e!==(e=s[0]+"")&&i.set_data(n,e)},d(s){s&&i.detach(t)}}}function Wo(o){let t,e=o[0]&&No(o);return{c(){e&&e.c(),t=i.empty()},m(n,s){e&&e.m(n,s),i.insert(n,t,s)},p(n,s){n[0]?e?e.p(n,s):(e=No(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},d(n){e&&e.d(n),n&&i.detach(t)}}}function Xo(o){let t,e,n=o[2].price.value+"",s,r,a=o[2].price.unit&&Yo(o);return{c(){t=i.element("div"),e=i.element("span"),s=i.text(n),r=i.space(),a&&a.c(),i.attr(e,"class","value svelte-8mby9k"),i.attr(t,"class","price svelte-8mby9k")},m(l,c){i.insert(l,t,c),i.append(t,e),i.append(e,s),i.append(t,r),a&&a.m(t,null)},p(l,c){c&4&&n!==(n=l[2].price.value+"")&&i.set_data(s,n),l[2].price.unit?a?a.p(l,c):(a=Yo(l),a.c(),a.m(t,null)):a&&(a.d(1),a=null)},d(l){l&&i.detach(t),a&&a.d()}}}function Yo(o){let t,e=o[2].price.unit+"",n;return{c(){t=i.element("span"),n=i.text(e),i.attr(t,"class","unit svelte-8mby9k")},m(s,r){i.insert(s,t,r),i.append(t,n)},p(s,r){r&4&&e!==(e=s[2].price.unit+"")&&i.set_data(n,e)},d(s){s&&i.detach(t)}}}function Uo(o){let t,e=o[2].highlightText+"",n;return{c(){t=i.element("div"),n=i.text(e),i.attr(t,"class","goto-button goto-icon svelte-8mby9k")},m(s,r){i.insert(s,t,r),i.append(t,n)},p(s,r){r&4&&e!==(e=s[2].highlightText+"")&&i.set_data(n,e)},d(s){s&&i.detach(t)}}}function Lf(o){var T,R;let t,e,n,s,r,a,l,c,d,u,f,h,p,g,A=o[2].title+"",b,v,w,y,I;e=new ve({props:{visible:o[1],outDelay:500,left:61,bottom:87,blurRadius:150,spreadRadius:75}});let k=o[2].brandTags||[],C=[];for(let E=0;E<k.length;E+=1)C[E]=Go(Ho(o,k,E));let D=o[2].tags||[],x=[];for(let E=0;E<D.length;E+=1)x[E]=Wo(Oo(o,D,E));let z=((T=o[2].price)==null?void 0:T.value)!==void 0&&((R=o[2].price)==null?void 0:R.value)!==null&&Xo(o),L=o[2].highlightText&&Uo(o);return{c(){var E,S;t=i.element("div"),i.create_component(e.$$.fragment),n=i.space(),s=i.element("div"),r=i.space(),a=i.element("div"),l=i.element("img"),d=i.space(),u=i.element("div");for(let _=0;_<C.length;_+=1)C[_].c();f=i.space();for(let _=0;_<x.length;_+=1)x[_].c();h=i.space(),p=i.element("div"),g=i.element("div"),b=i.text(A),v=i.space(),w=i.element("div"),z&&z.c(),y=i.space(),L&&L.c(),i.attr(s,"class","line svelte-8mby9k"),i.set_style(s,"transition-delay",o[1]?xt+"ms":Dt+Jo-Vo-40+"ms",!1),i.attr(l,"class","headerImage svelte-8mby9k"),i.src_url_equal(l.src,c=o[2].headerPictureUrl)||i.attr(l,"src",c),i.attr(l,"alt",""),i.attr(u,"class","tag svelte-8mby9k"),i.attr(g,"class","text svelte-8mby9k"),i.attr(p,"class","title svelte-8mby9k"),i.attr(w,"class","footer svelte-8mby9k"),i.set_style(w,"height",((E=o[2].price)==null?void 0:E.value)!==void 0&&((S=o[2].price)==null?void 0:S.value)!==null&&o[2].highlightText?void 0:"1rem",!1),i.attr(a,"class","content svelte-8mby9k"),i.set_style(a,"transition-delay",o[1]?xt+Dt+"ms":"0ms",!1),i.attr(t,"class","marketing svelte-8mby9k"),i.toggle_class(t,"unfolded",o[1]),i.toggle_class(t,"folded",o[3])},m(E,S){i.insert(E,t,S),i.mount_component(e,t,null),i.append(t,n),i.append(t,s),i.append(t,r),i.append(t,a),i.append(a,l),i.append(a,d),i.append(a,u);for(let _=0;_<C.length;_+=1)C[_].m(u,null);i.append(u,f);for(let _=0;_<x.length;_+=1)x[_].m(u,null);i.append(a,h),i.append(a,p),i.append(p,g),i.append(g,b),i.append(a,v),i.append(a,w),z&&z.m(w,null),i.append(w,y),L&&L.m(w,null),I=!0},p(E,[S]){var B,O,G,Q;const _={};if(S&2&&(_.visible=E[1]),e.$set(_),S&2&&i.set_style(s,"transition-delay",E[1]?xt+"ms":Dt+Jo-Vo-40+"ms",!1),(!I||S&4&&!i.src_url_equal(l.src,c=E[2].headerPictureUrl))&&i.attr(l,"src",c),S&4){k=E[2].brandTags||[];let H;for(H=0;H<k.length;H+=1){const X=Ho(E,k,H);C[H]?C[H].p(X,S):(C[H]=Go(X),C[H].c(),C[H].m(u,f))}for(;H<C.length;H+=1)C[H].d(1);C.length=k.length}if(S&4){D=E[2].tags||[];let H;for(H=0;H<D.length;H+=1){const X=Oo(E,D,H);x[H]?x[H].p(X,S):(x[H]=Wo(X),x[H].c(),x[H].m(u,null))}for(;H<x.length;H+=1)x[H].d(1);x.length=D.length}(!I||S&4)&&A!==(A=E[2].title+"")&&i.set_data(b,A),((B=E[2].price)==null?void 0:B.value)!==void 0&&((O=E[2].price)==null?void 0:O.value)!==null?z?z.p(E,S):(z=Xo(E),z.c(),z.m(w,y)):z&&(z.d(1),z=null),E[2].highlightText?L?L.p(E,S):(L=Uo(E),L.c(),L.m(w,null)):L&&(L.d(1),L=null),S&4&&i.set_style(w,"height",((G=E[2].price)==null?void 0:G.value)!==void 0&&((Q=E[2].price)==null?void 0:Q.value)!==null&&E[2].highlightText?void 0:"1rem",!1),S&2&&i.set_style(a,"transition-delay",E[1]?xt+Dt+"ms":"0ms",!1),S&2&&i.toggle_class(t,"unfolded",E[1]),S&8&&i.toggle_class(t,"folded",E[3])},i(E){I||(i.transition_in(e.$$.fragment,E),I=!0)},o(E){i.transition_out(e.$$.fragment,E),I=!1},d(E){E&&i.detach(t),i.destroy_component(e),i.destroy_each(C,E),i.destroy_each(x,E),z&&z.d(),L&&L.d()}}}const xt=400,Vo=500,Dt=180,Jo=500;function _f(o,t,e){let n,s,r,{tag:a}=t;return o.$$set=l=>{"tag"in l&&e(0,a=l.tag)},o.$$.update=()=>{var l,c;o.$$.dirty&1&&e(1,n=(c=(l=a.state)==null?void 0:l.unfolded)!=null?c:!1),o.$$.dirty&2&&e(3,s=!n),o.$$.dirty&1&&e(2,r=a.data)},[a,n,r,s]}class zf extends i.SvelteComponent{constructor(t){super(),i.init(this,t,_f,Lf,i.safe_not_equal,{tag:0},Sf)}}function Mf(o){i.append_styles(o,"svelte-1ku3wt4",`.audio.svelte-1ku3wt4.svelte-1ku3wt4{position:relative;width:100%;height:100%;cursor:pointer}@keyframes svelte-1ku3wt4-playing{25%{background-image:url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='9' cy='9' r='8' transform='translate(-1 -1)' fill='%23FFF' fill-rule='nonzero'/%3E%3C/svg%3E")}50%{background-image:url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zM5.533 6.685L4.169 8.049l1.414 1.413a2.078 2.078 0 0 0-.05-2.777z' fill='%23FFF' fill-rule='nonzero'/%3E%3C/svg%3E")}75%{background-image:url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zm-.656 4.874l-.906.905A3.35 3.35 0 0 1 7.369 8.1c0 .875-.333 1.67-.88 2.268l.906.906A4.628 4.628 0 0 0 8.65 8.101a4.627 4.627 0 0 0-1.306-3.227zm-1.811 1.81L4.169 8.05l1.414 1.413a2.078 2.078 0 0 0-.05-2.777z' fill='%23FFF' fill-rule='nonzero'/%3E%3C/svg%3E")}}.paused.svelte-1ku3wt4 .audio-icon.svelte-1ku3wt4{animation:none}.audio-icon.svelte-1ku3wt4.svelte-1ku3wt4{width:100%;height:100%;border-radius:50%;background-size:100%;animation:svelte-1ku3wt4-playing 2s steps(1) infinite;background-image:url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zm1.428 2.79l-.953.952a6.222 6.222 0 0 1 1.775 4.36c0 1.571-.58 3.006-1.538 4.103l-.184.202.793.794a7.344 7.344 0 0 0 2.21-5.26A7.341 7.341 0 0 0 9.428 2.79zM7.344 4.873l-.906.905A3.35 3.35 0 0 1 7.369 8.1c0 .802-.28 1.537-.748 2.115l-.132.153.906.906A4.628 4.628 0 0 0 8.65 8.101a4.627 4.627 0 0 0-1.306-3.227zm-1.811 1.81L4.169 8.05l1.414 1.413a2.078 2.078 0 0 0-.05-2.777z' fill='%23FFF' fill-rule='nonzero'/%3E%3C/svg%3E")}`)}function Zo(o){let t,e,n,s,r,a,l,c=!0,d,u,f,h,p;return e=new ve({props:{center:!0,blurRadius:15,spreadRadius:6}}),{c(){t=i.element("div"),i.create_component(e.$$.fragment),n=i.space(),s=i.element("div"),r=i.space(),a=i.element("audio"),i.attr(s,"class","audio-icon svelte-1ku3wt4"),a.controls=!1,i.attr(a,"playsinline",""),i.src_url_equal(a.src,l=o[3])||i.attr(a,"src",l),i.attr(t,"class","audio svelte-1ku3wt4"),i.toggle_class(t,"paused",o[6])},m(g,A){i.insert(g,t,A),i.mount_component(e,t,null),i.append(t,n),i.append(t,s),i.append(t,r),i.append(t,a),o[9](a),f=!0,h||(p=[i.listen(a,"play",o[10]),i.listen(a,"pause",o[10]),i.listen(t,"click",i.stop_propagation(o[7]))],h=!0)},p(g,A){o=g,(!f||A&8&&!i.src_url_equal(a.src,l=o[3]))&&i.attr(a,"src",l),A&64&&c!==(c=o[6])&&a[c?"pause":"play"](),A&64&&i.toggle_class(t,"paused",o[6])},i(g){f||(i.transition_in(e.$$.fragment,g),g&&i.add_render_callback(()=>{u&&u.end(1),d=i.create_in_transition(t,me.fade,{duration:o[2],delay:o[0],easing:Se.cubicInOut}),d.start()}),f=!0)},o(g){i.transition_out(e.$$.fragment,g),d&&d.invalidate(),g&&(u=i.create_out_transition(t,me.fade,{duration:o[2],delay:o[1],easing:Se.cubicInOut})),f=!1},d(g){g&&i.detach(t),i.destroy_component(e),o[9](null),g&&u&&u.end(),h=!1,i.run_all(p)}}}function Tf(o){let t,e,n=o[4]&&Zo(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[4]?n?(n.p(s,r),r&16&&i.transition_in(n,1)):(n=Zo(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function jf(o,t,e){let{inDelay:n=0}=t,{outDelay:s=0}=t,{duration:r=0}=t,{url:a}=t,{unfolded:l}=t,{hooksInfo:c={}}=t;const d=Z.getContext("hooks"),u=Z.getContext("mediaStore");let f,h=!0;u.subscribe(({currentMediaUrl:b})=>{b!==a&&(f==null||f.pause())});function p(b){u.set({currentMediaUrl:a}),f&&(d.emit("click",j({event:b,target:"AudioTagPlayIcon",audioInstance:f},c)),f.paused?f.play():f.pause(),e(5,f.onplay=v=>d.emit("playStateChange",j({event:v,state:"playing",mediaInstance:f},c)),f),e(5,f.onpause=v=>d.emit("playStateChange",j({event:v,state:"paused",mediaInstance:f},c)),f))}function g(b){i.binding_callbacks[b?"unshift":"push"](()=>{f=b,e(5,f)})}function A(){h=this.paused,e(6,h)}return o.$$set=b=>{"inDelay"in b&&e(0,n=b.inDelay),"outDelay"in b&&e(1,s=b.outDelay),"duration"in b&&e(2,r=b.duration),"url"in b&&e(3,a=b.url),"unfolded"in b&&e(4,l=b.unfolded),"hooksInfo"in b&&e(8,c=b.hooksInfo)},o.$$.update=()=>{o.$$.dirty&48&&(l||f==null||f.pause())},[n,s,r,a,l,f,h,p,c,g,A]}class Bf extends i.SvelteComponent{constructor(t){super(),i.init(this,t,jf,Tf,i.safe_not_equal,{inDelay:0,outDelay:1,duration:2,url:3,unfolded:4,hooksInfo:8},Mf)}}function Qf(o){i.append_styles(o,"svelte-4r8s18",".audio-tag.svelte-4r8s18.svelte-4r8s18{position:absolute;left:0;top:0;width:0;height:0;overflow:visible}.line.svelte-4r8s18.svelte-4r8s18{display:flex;position:absolute;top:0;left:0;width:10.125rem;height:0.0625rem;transform:translate3d(0, -50%, 0.625rem)}.content.svelte-4r8s18.svelte-4r8s18{width:-moz-max-content;width:max-content;height:3.375rem;padding:2.25rem 0.25rem 0 1rem;position:absolute;left:0;bottom:0.125rem;overflow:hidden;box-sizing:border-box;font-size:0;white-space:nowrap;font-weight:600}.wrapper.svelte-4r8s18.svelte-4r8s18{position:relative;width:100%;height:100%}.audio-icon.svelte-4r8s18.svelte-4r8s18{vertical-align:top;display:inline-block;width:1rem;height:1rem;margin-right:0.25rem;margin-top:0.0625rem}.unfolded.svelte-4r8s18 .audio-icon.svelte-4r8s18{pointer-events:auto}")}function qo(o){var w,y,I,k;let t,e,n,s,r,a,l,c,d,u,f,h,p,g,A,b,v;return e=new ve({props:{visible:o[5],left:o[2]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}}),r=new Js({props:{unfolded:o[5],duration:1e3,outDelay:o[4]+20*Math.min((y=(w=o[3][0])==null?void 0:w.content.length)!=null?y:10,15)}}),u=new Bf({props:{unfolded:o[5],url:o[0].data.audioUrl,duration:1e3,outDelay:20*Math.min((k=(I=o[3][0])==null?void 0:I.content.length)!=null?k:10,15),hooksInfo:{tag:o[0]}}}),p=new qs({props:{visible:o[5],textUnfolded:o[1],textItems:o[3]}}),{c(){t=i.element("div"),i.create_component(e.$$.fragment),n=i.space(),s=i.element("div"),i.create_component(r.$$.fragment),a=i.space(),l=i.element("div"),c=i.element("div"),d=i.element("div"),i.create_component(u.$$.fragment),f=i.space(),h=i.element("div"),i.create_component(p.$$.fragment),i.attr(s,"class","line svelte-4r8s18"),i.set_style(s,"width",o[2]+"px",!1),i.attr(d,"class","audio-icon svelte-4r8s18"),i.set_style(h,"display","inline-block",!1),i.attr(c,"class","wrapper svelte-4r8s18"),i.attr(l,"class","content svelte-4r8s18"),i.add_render_callback(()=>o[8].call(l)),i.attr(t,"class","audio-tag svelte-4r8s18"),i.toggle_class(t,"unfolded",o[5])},m(C,D){i.insert(C,t,D),i.mount_component(e,t,null),i.append(t,n),i.append(t,s),i.mount_component(r,s,null),i.append(t,a),i.append(t,l),i.append(l,c),i.append(c,d),i.mount_component(u,d,null),i.append(c,f),i.append(c,h),i.mount_component(p,h,null),g=i.add_resize_listener(l,o[8].bind(l)),A=!0,b||(v=i.listen(h,"click",o[6]),b=!0)},p(C,D){var R,E,S,_;const x={};D&32&&(x.visible=C[5]),D&4&&(x.left=C[2]/2+"px"),e.$set(x);const z={};D&32&&(z.unfolded=C[5]),D&24&&(z.outDelay=C[4]+20*Math.min((E=(R=C[3][0])==null?void 0:R.content.length)!=null?E:10,15)),r.$set(z),D&4&&i.set_style(s,"width",C[2]+"px",!1);const L={};D&32&&(L.unfolded=C[5]),D&1&&(L.url=C[0].data.audioUrl),D&8&&(L.outDelay=20*Math.min((_=(S=C[3][0])==null?void 0:S.content.length)!=null?_:10,15)),D&1&&(L.hooksInfo={tag:C[0]}),u.$set(L);const T={};D&32&&(T.visible=C[5]),D&2&&(T.textUnfolded=C[1]),D&8&&(T.textItems=C[3]),p.$set(T),D&32&&i.toggle_class(t,"unfolded",C[5])},i(C){A||(i.transition_in(e.$$.fragment,C),i.transition_in(r.$$.fragment,C),i.transition_in(u.$$.fragment,C),i.transition_in(p.$$.fragment,C),A=!0)},o(C){i.transition_out(e.$$.fragment,C),i.transition_out(r.$$.fragment,C),i.transition_out(u.$$.fragment,C),i.transition_out(p.$$.fragment,C),A=!1},d(C){C&&i.detach(t),i.destroy_component(e),i.destroy_component(r),i.destroy_component(u),i.destroy_component(p),g(),b=!1,v()}}}function Rf(o){let t,e,n=o[0].state&&qo(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[0].state?n?(n.p(s,r),r&1&&i.transition_in(n,1)):(n=qo(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function Of(o,t,e){let n,s,r,{tag:a}=t,l=!1,c,d=[];function u(){e(1,l=!l)}function f(){c=this.clientWidth,e(2,c)}return o.$$set=h=>{"tag"in h&&e(0,a=h.tag)},o.$$.update=()=>{var h;o.$$.dirty&1&&e(5,n=!!((h=a.state)!=null&&h.unfolded)),o.$$.dirty&1&&e(7,s=a.data.text),o.$$.dirty&128&&e(3,d=[{id:ue(),content:s}]),o.$$.dirty&2&&e(4,r=l?450:0)},[a,l,c,d,r,n,u,s,f]}class Hf extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Of,Rf,i.safe_not_equal,{tag:0},Qf)}}function Ff(o){i.append_styles(o,"svelte-10cw0el",".media-wrapper.svelte-10cw0el{position:absolute;width:100%;height:100%}")}function Ko(o){let t,e,n;return e=new er({props:{unfolded:o[5],mediaData:o[4],objectFit:o[2],enableCarousel:o[1],autoplayConfig:o[3],tag:o[0],canPlay:!0,playButtonIfNeed:"large",inDelay:500,duration:500}}),{c(){t=i.element("div"),i.create_component(e.$$.fragment),i.attr(t,"class","media-wrapper svelte-10cw0el")},m(s,r){i.insert(s,t,r),i.mount_component(e,t,null),n=!0},p(s,r){const a={};r&32&&(a.unfolded=s[5]),r&16&&(a.mediaData=s[4]),r&4&&(a.objectFit=s[2]),r&2&&(a.enableCarousel=s[1]),r&8&&(a.autoplayConfig=s[3]),r&1&&(a.tag=s[0]),e.$set(a)},i(s){n||(i.transition_in(e.$$.fragment,s),n=!0)},o(s){i.transition_out(e.$$.fragment,s),n=!1},d(s){s&&i.detach(t),i.destroy_component(e)}}}function Gf(o){let t,e,n=o[0].state&&o[4]&&Ko(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[0].state&&s[4]?n?(n.p(s,r),r&17&&i.transition_in(n,1)):(n=Ko(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function Nf(o,t,e){let n,s,r,a,l,{tag:c}=t;return o.$$set=d=>{"tag"in d&&e(0,c=d.tag)},o.$$.update=()=>{var d,u;o.$$.dirty&1&&e(5,n=c.state?c.state.unfolded:!1),o.$$.dirty&1&&e(4,s=c.data.mediaData),o.$$.dirty&1&&e(1,r=c.data.enableCarousel),o.$$.dirty&3&&e(3,a=(d=c.data.autoplayConfig)!=null?d:{autoplay:r!=null?r:!0,autoplayVideo:!0}),o.$$.dirty&1&&e(2,l=(u=c.data.objectFit)!=null?u:(()=>c.data.adaptationMode==="stretch"?"cover":c.data.adaptationMode==="proportional"?"contain":void 0)())},[c,r,l,a,s,n]}class Wf extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Nf,Gf,i.safe_not_equal,{tag:0},Ff)}}function Xf(o){i.append_styles(o,"svelte-7x7u86",".wrapper.svelte-7x7u86{font-weight:600;cursor:pointer;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);display:flex;align-items:center;justify-content:center;flex-direction:column;pointer-events:auto}.text-wrapper.svelte-7x7u86{position:relative;display:flex;align-items:center;justify-content:center}.icon.svelte-7x7u86{position:relative;margin-bottom:0.6875rem}.arrow0.svelte-7x7u86,.arrow1.svelte-7x7u86,.arrow2.svelte-7x7u86{position:absolute;width:1.625rem;height:0.75rem;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAE4AAAAkCAYAAAAnxQwhAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAATqADAAQAAAABAAAAJAAAAABrx2urAAAGm0lEQVRoBd2ZXbCVUxjH26QSfSCS0JwoFNEZ0cc45iSmUUaqC+KCwUUXxYUZw4yrLhozLlDDRWa6oW5yOFTT0IcyKn1JnIjDKelLPipJcXT8fttaZ95qd+yzv+uZ+e211rvfd61n/ddaz1rv3qkOFWgtLS3n4Vb34NqhVCr1d6W5mao0hxBNwfrCOcG346S7Ee9gKFdEUjHCIZi+XA69E8p4rQVM98EeBLRcdqsI4RCtI0r0h4uCIvo1BZx1b4GzTjsA3yFec7pUxo+yC4doXen/IDg/6GB5GlSH8mbSWXA4lI+SNiDekVAuS1JW4RCtF72+EWI8c6k+A6ZJc5m+BHvCxX9ItyLe/lAueVIW4UI8u4beDkj02FnnTOuUuJbM/kVhNjQkLjaSbyxH3Cu5cIjmUWMoOKti+2PIT4JsrI6blkKMe87GTYhX0iNLdDwbh/O+B9G6UclIMNWcXQ/CrRbaYRu5dz44C7XfYTXimZbESiYconk2GwGdwSOF4j0JV0AuZrybA4plfYq4BvF2kRbdSiIcog2hJ+6StmcnFesJ6AL52DEefgOiWNa/EfG25FNpNs8WVbgQz+7EEc9o0RRxYiwUKDXuJcVqovxRMeNe0YRDtB44Pw4uAc0jx2gYZqEItoE63TSc0fILLEa8o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YY2Imf3Zx/TIwFLVl6/iyF8SNxxX0LH1Ix720cDRoTJgNcbT2hwdUPZPZeCNYsc9EQazPEV4NTm9/zjlKWnKjT11otBYUcRS4AuKgmjrYToxrwUHPZN9z0Ql0afhyL+k0+rQtRQOu/3qIAhjIB0IPSJrrvwEcARvTko44896DhXFUvKESjD66msbD/eBMSw60eQVygAfDyXH8INe2gZPLiaF4ExTucTLPg2aMGg7uVpqzZwu4tm8Ad7UoFtn0q4ti1SHWt16odKO/A/DxAZgAcYVFt+3nV2AcHAIdQTsOa6Ea7P9MhZtB5jHQmsDltwMM8qrszFPpaEfILIYF4H+ZVnrGGf12coyEyXAvdIU4KUydaa4+r/cDl3UVaHMVzun7erp4+g/FWQWK5a6oeGeNoYHijAVFrIG44shmtKkK52x6FSZluMW4pVjvIJbHibPe0MPl61JWxEEZOvw216a3LkEeGMGFO0D1d8KqMyVu4WtRDE2Mh85Az6Wuso/RZA1ph38BBMvNbHuq7kAAAAAASUVORK5CYII=);background-repeat:no-repeat;background-size:contain;animation-fill-mode:backwards;animation-iteration-count:infinite;animation-timing-function:ease-in-out;animation-duration:1.2s}.arrow1.svelte-7x7u86{position:relative}.arrow0.svelte-7x7u86{top:-0.75rem;animation-name:svelte-7x7u86-up0}.arrow1.svelte-7x7u86{animation-name:svelte-7x7u86-up1}.arrow2.svelte-7x7u86{top:0.75rem;animation-name:svelte-7x7u86-up2}.text.svelte-7x7u86{position:absolute;top:0;font-size:0.875rem;color:#ffffff;letter-spacing:0;text-align:center;max-width:8.75rem;width:-moz-max-content;width:max-content;word-break:break-all;line-height:1.125rem;text-shadow:0.125rem 0rem 0.5rem rgba(0, 0, 0, 0.15)}@keyframes svelte-7x7u86-up0{0%{opacity:0.8;transform:translate3d(0, 0, 0) scale(0.84)}33.33%,100%{opacity:0;transform:translate3d(0, -0.75rem, 0) scale(0.84)}}@keyframes svelte-7x7u86-up1{0%{opacity:1;transform:translate3d(0, 0, 0) scale(1)}33.33%,100%{opacity:0.8;transform:translate3d(0, -0.75rem, 0) scale(0.84)}}@keyframes svelte-7x7u86-up2{0%{opacity:0}33.33%,100%{opacity:1;transform:translate3d(0, -0.75rem, 0)}}.link.svelte-7x7u86{position:relative;width:1.75rem;height:0.75rem;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAAAkCAMAAAAgl+0yAAAAnFBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+TINBkAAAAM3RSTlMAjLy6ILM2Fi+Zng3BrPvao4VC9ceneQfKkmNdV1AbEeLOsHA77ujUtn5JLnRraSUUjVLj/+RVAAABhElEQVRIx63V2W6CQBiGYUBUQGDYdwTZQZZa7v/eimik/ket/7yZ4yeTTCYf8+dOX8etxGVoxAvCVbguR3g0uRTMA0w4odGi+CbzFnGKosCqrmHc5rdEwzCwqtGFJlC7DqtOcTxANY67BHnVKOpVoEZRjFPdLgxbqIZhhFTjINChGgThF06NhpGd35OGMcCppyDPfajm+YhUR8cRoeo4+RGlJnnbalBt2x6nHh1dt4Gq6bqDU886y2ZQZVn9jFJ51vcbqPo+Up18UeSgKoo3nHqVJEkGqi1JPk49aLZmQdW2xXf1zP+vUFHsC1QVReK33xdk+w9SaqAq+732UvvdZ2UEqrud8lR5Wc4a7pO8GaoL9VBjy7rMlMosq1lV43LhZlrtF+yuJlbtEXpqXXP3NYwI8VJqakOIziw5aepV1FQuTdfhvlWVZdJCrao6MPe0spRpqV5ZFivqNqYpq3RQ2TST5/h4quoRCmwqq6rymol6plV53IZSomTKE/MroWfxDevL/wAEdPq1eGDh4AAAAABJRU5ErkJggg==);background-repeat:no-repeat;background-size:contain;animation-iteration-count:infinite;animation-timing-function:linear;animation-duration:1.2s;animation-name:svelte-7x7u86-left-right}@keyframes svelte-7x7u86-left-right{0%,100%{opacity:0.8;transform:translateX(-0.3125rem)}50%{opacity:1;transform:translateX(0)}}")}function Yf(o){let t,e,n,s;return t=new ve({props:{visible:!0,outDelay:0,inDelay:0,width:1.4,left:13,bottom:"auto",blurRadius:50,spreadRadius:18}}),{c(){i.create_component(t.$$.fragment),e=i.space(),n=i.element("div"),i.attr(n,"class","link svelte-7x7u86")},m(r,a){i.mount_component(t,r,a),i.insert(r,e,a),i.insert(r,n,a),s=!0},i(r){s||(i.transition_in(t.$$.fragment,r),s=!0)},o(r){i.transition_out(t.$$.fragment,r),s=!1},d(r){i.destroy_component(t,r),r&&i.detach(e),r&&i.detach(n)}}}function Uf(o){let t,e,n,s,r,a,l,c;return t=new ve({props:{visible:!0,outDelay:0,inDelay:0,height:1.2,left:13,bottom:12,blurRadius:50,spreadRadius:18}}),{c(){i.create_component(t.$$.fragment),e=i.space(),n=i.element("div"),s=i.space(),r=i.element("div"),a=i.space(),l=i.element("div"),i.attr(n,"class","arrow0 svelte-7x7u86"),i.attr(r,"class","arrow1 svelte-7x7u86"),i.attr(l,"class","arrow2 svelte-7x7u86")},m(d,u){i.mount_component(t,d,u),i.insert(d,e,u),i.insert(d,n,u),i.insert(d,s,u),i.insert(d,r,u),i.insert(d,a,u),i.insert(d,l,u),c=!0},i(d){c||(i.transition_in(t.$$.fragment,d),c=!0)},o(d){i.transition_out(t.$$.fragment,d),c=!1},d(d){i.destroy_component(t,d),d&&i.detach(e),d&&i.detach(n),d&&i.detach(s),d&&i.detach(r),d&&i.detach(a),d&&i.detach(l)}}}function Vf(o){let t,e,n,s,r,a,l,c,d,u=o[0].text+"",f,h;const p=[Uf,Yf],g=[];function A(b,v){return b[0].linkType===Ot.VrLink?0:b[0].linkType===Ot.NormalLink?1:-1}return~(n=A(o))&&(s=g[n]=p[n](o)),l=new ve({props:{visible:!0,outDelay:0,inDelay:0,left:"auto",bottom:"auto",width:"80%",blurRadius:40,spreadRadius:16,opacity:.08}}),{c(){t=i.element("div"),e=i.element("div"),s&&s.c(),r=i.space(),a=i.element("div"),i.create_component(l.$$.fragment),c=i.space(),d=i.element("div"),f=i.text(u),i.attr(e,"class","icon svelte-7x7u86"),i.attr(d,"class","text svelte-7x7u86"),i.attr(a,"class","text-wrapper svelte-7x7u86"),i.attr(t,"class","wrapper svelte-7x7u86")},m(b,v){i.insert(b,t,v),i.append(t,e),~n&&g[n].m(e,null),i.append(t,r),i.append(t,a),i.mount_component(l,a,null),i.append(a,c),i.append(a,d),i.append(d,f),h=!0},p(b,[v]){let w=n;n=A(b),n!==w&&(s&&(i.group_outros(),i.transition_out(g[w],1,1,()=>{g[w]=null}),i.check_outros()),~n?(s=g[n],s||(s=g[n]=p[n](b),s.c()),i.transition_in(s,1),s.m(e,null)):s=null),(!h||v&1)&&u!==(u=b[0].text+"")&&i.set_data(f,u)},i(b){h||(i.transition_in(s),i.transition_in(l.$$.fragment,b),h=!0)},o(b){i.transition_out(s),i.transition_out(l.$$.fragment,b),h=!1},d(b){b&&i.detach(t),~n&&g[n].d(),i.destroy_component(l)}}}function Jf(o,t,e){let n,{tag:s}=t;return o.$$set=r=>{"tag"in r&&e(1,s=r.tag)},o.$$.update=()=>{o.$$.dirty&2&&e(0,n=s.data)},[n,s]}class Zf extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Jf,Vf,i.safe_not_equal,{tag:1},Xf)}}function qf(o){i.append_styles(o,"svelte-kzl2aj",".customElement__container.svelte-kzl2aj{position:relative}")}function $o(o){let t,e=o[0].element+"",n;return{c(){t=new i.HtmlTag(!1),n=i.empty(),t.a=n},m(s,r){t.m(e,s,r),i.insert(s,n,r)},p(s,r){r&1&&e!==(e=s[0].element+"")&&t.p(e)},d(s){s&&i.detach(n),s&&t.d()}}}function Kf(o){let t,e=typeof o[0].element=="string"&&$o(o);return{c(){t=i.element("div"),e&&e.c(),i.attr(t,"class","customElement__container svelte-kzl2aj")},m(n,s){i.insert(n,t,s),e&&e.m(t,null),o[2](t)},p(n,[s]){typeof n[0].element=="string"?e?e.p(n,s):(e=$o(n),e.c(),e.m(t,null)):e&&(e.d(1),e=null)},i:i.noop,o:i.noop,d(n){n&&i.detach(t),e&&e.d(),o[2](null)}}}function $f(o,t,e){let{tag:n}=t,s,r;Z.onMount(()=>{if(s){if(n.element instanceof Element){const l=n.element;s.appendChild(l),r=()=>s==null?void 0:s.removeChild(l)}else if(typeof n.element=="function"){const l=n.element;r=l(s)}}}),Z.onDestroy(()=>{r==null||r()});function a(l){i.binding_callbacks[l?"unshift":"push"](()=>{s=l,e(1,s)})}return o.$$set=l=>{"tag"in l&&e(0,n=l.tag)},[n,s,a]}class em extends i.SvelteComponent{constructor(t){super(),i.init(this,t,$f,Kf,i.safe_not_equal,{tag:0},qf)}}function tm(o){i.append_styles(o,"svelte-95x526",`@font-face{font-family:'TG-TYPE';font-style:normal;font-weight:400;src:local('TG-TYPE-Bold'),
|
|
540
540
|
url(data:application/font-woff2;charset=utf-8;base64,T1RUTwAKAIAAAwAgQ0ZGINFD4CEAAAaQAAAHC0dTVUIAAQAAAAANnAAAAApPUy8yaB5pEwAAAjQAAABgY21hcEItjGUAAAT0AAABfGhlYWQS1WWOAAAAtAAAADZoaGVhBfMBxwAAAhAAAAAkaG10eJ9gBO8AAADsAAABJG1heHAASVAAAAAArAAAAAZuYW1lqczkZQAAApQAAAJecG9zdP+4ADIAAAZwAAAAIAAAUAAASQAAAAEAAAABAADkeHeyXw889QADA+gAAAAA2NoRKwAAAADY2hErACn/OAHgAyAAAQADAAIAAAAAAAAB9ABdAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACCAA7AcwAdwIIADMCCAA0AhwAMwISADkCCAAuAfQANAH+ACsB/gApAggANAEeAFABHgBQAR4AUAIIADQC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lZltcZbC7urGzuh8T8oX8ghVPW7zHx7q6yMa9W1BPWVpQHw6i96Tz92/0AbTz93DzA/hp+HkVsIGveKwezmNFtUAbZGeBeGofSmNiRT8aZJVnnmseSrHPYtoboAb7EvukBfcHBvdL+CEFmaySqaQa+9gWxry+yJ6dhoGcHq12oWZmGk5YW1BMXLnKHg4gCiEK+11L91IlCvdiyhWtb6hpJgoeJAoOIQogCqz3pe/3b/UBufX3bfQD+G74dxWyga94rB7NZEW0PhtlaIF4ah9KY2FFPxo7tkTPZh6MjIqKjB+TiJCIjYoIjgaCoKGHoRuanY6QoB+IgfsB+6QF9wcG9y/4IgWYppGnqhr7a/sCFVBbvMjHu7zGyLxbTk5aWk4fDvtd+AojCoz7jBUmCh8kCq1vqGkeDvtdi/cS94wjCvwKBCIKDiD3ru8BvPeuA7z4EhUn967vBw4eoDf/DAmLDAv47BT4exWcEwAHAQFBXW97ipCarPcv8+7yAfdl8gP4aPf6FfIjB+r3gwUiBi77gwWHBjH3gwUkBuP7gwUnJPcxKPsxI/cx+y/y9y/3MPP7MO4GDvtdi/cSJQr3JBZkcqOzsKSksrCkcWdlcnFmHw6up6eurm+naGhvb2hop2+uHwv3EiUK9yP4ChUiCgt3SgWxBrnmBZGVj5eZGgsB2/cSAwtobm5paqBzqoYLAAABAAAAAAAAAAAAAA==)
|
|
541
|
-
format('woff2')}.content__container.svelte-95x526{position:relative;left:50%;top:50%;transform:translate(-50%, -50%);font-family:PingFangSC, Segoe UI, Rototo, sans-serif}.content__container.unClickable.svelte-95x526{pointer-events:none !important}.content__container.unClickable.svelte-95x526 *{pointer-events:none !important}*{-webkit-tap-highlight-color:transparent}.content__wrapper.svelte-95x526{pointer-events:none;width:100%;height:100%}.withAnimation.svelte-95x526{transition:opacity 0.3s linear}.content__container.hide.svelte-95x526{opacity:0;pointer-events:none}.content__container.hide.svelte-95x526 *{pointer-events:none !important}.content__container.disable.svelte-95x526{display:none}.content__container.hide.svelte-95x526 *{pointer-events:none}.content.svelte-95x526{position:relative;width:100%;height:100%;font-size:0.75rem;line-height:1.125rem;color:#fff}.content.svelte-95x526:not(.unfolded){pointer-events:none}.content.svelte-95x526:not(.unfolded) *{pointer-events:none !important}.content.unfolded.svelte-95x526{pointer-events:auto}`)}function nm(o){let t,e;return t=new Wf({props:{tag:re(o[1])}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&2&&(r.tag=re(n[1])),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function im(o){let t,e;return t=new Zf({props:{tag:re(o[1])}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&2&&(r.tag=re(n[1])),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function om(o){let t,e;return t=new zf({props:{tag:re(o[1])}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&2&&(r.tag=re(n[1])),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function sm(o){let t,e;return t=new Hf({props:{tag:re(o[1])}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&2&&(r.tag=re(n[1])),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function rm(o){let t,e;return t=new Df({props:{tag:re(o[1])}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&2&&(r.tag=re(n[1])),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function am(o){let t,e;return t=new Gh({props:{tag:re(o[1])}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&2&&(r.tag=re(n[1])),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function lm(o){let t,e;return t=new em({props:{tag:re(o[1])}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&2&&(r.tag=re(n[1])),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function cm(o){let t,e,n,s,r,a,l,c,d;const u=[lm,am,rm,sm,om,im,nm],f=[];function h(p,g){return p[1].element?0:p[1].contentType===ge.Text?1:p[1].contentType===ge.ImageText?2:p[1].contentType===ge.Audio?3:p[1].contentType===ge.Marketing?4:p[1].contentType===ge.Link?5:p[1].contentType===ge.MediaPlane?6:-1}return~(s=h(o))&&(r=f[s]=u[s](o)),{c(){var p,g,A;t=i.element("div"),e=i.element("div"),n=i.element("div"),r&&r.c(),i.attr(n,"class","content svelte-95x526"),i.toggle_class(n,"unfolded",(p=o[1].state)==null?void 0:p.unfolded),i.attr(e,"class","content__wrapper svelte-95x526"),i.attr(t,"class","content__container svelte-95x526"),i.attr(t,"data-id",a=o[1].id),i.toggle_class(t,"disable",o[1].enabled===!1||((g=o[1].temporaryState)==null?void 0:g.visible)===!1),i.toggle_class(t,"hide",!o[3].visible||!o[3].enabled||!o[4].visible||!((A=o[1].state)!=null&&A.visible)),i.toggle_class(t,"withAnimation",o[0]),i.toggle_class(t,"unClickable",o[1].clickable===!1),i.set_style(t,"width",o[1].pointType==="PointTag"?0:"100%",!1),i.set_style(t,"height",o[1].pointType==="PointTag"?0:"100%",!1)},m(p,g){i.insert(p,t,g),i.append(t,e),i.append(e,n),~s&&f[s].m(n,null),l=!0,c||(d=i.listen(t,"click",i.stop_propagation(o[11])),c=!0)},p(p,[g]){var b,v,w;let A=s;s=h(p),s===A?~s&&f[s].p(p,g):(r&&(i.group_outros(),i.transition_out(f[A],1,1,()=>{f[A]=null}),i.check_outros()),~s?(r=f[s],r?r.p(p,g):(r=f[s]=u[s](p),r.c()),i.transition_in(r,1),r.m(n,null)):r=null),g&2&&i.toggle_class(n,"unfolded",(b=p[1].state)==null?void 0:b.unfolded),(!l||g&2&&a!==(a=p[1].id))&&i.attr(t,"data-id",a),g&2&&i.toggle_class(t,"disable",p[1].enabled===!1||((v=p[1].temporaryState)==null?void 0:v.visible)===!1),g&26&&i.toggle_class(t,"hide",!p[3].visible||!p[3].enabled||!p[4].visible||!((w=p[1].state)!=null&&w.visible)),g&1&&i.toggle_class(t,"withAnimation",p[0]),g&2&&i.toggle_class(t,"unClickable",p[1].clickable===!1),g&2&&i.set_style(t,"width",p[1].pointType==="PointTag"?0:"100%",!1),g&2&&i.set_style(t,"height",p[1].pointType==="PointTag"?0:"100%",!1)},i(p){l||(i.transition_in(r),l=!0)},o(p){i.transition_out(r),l=!1},d(p){p&&i.detach(t),~s&&f[s].d(),c=!1,d()}}}function dm(o,t,e){let n,s,r,a,{withAnimation:l=!1}=t,{tag:c}=t,{hooks:d}=t,{state:u}=t,{mediaStore:f}=t,{temporaryState:h}=t;Z.setContext("hooks",d),Z.setContext("mediaStore",f);let p,g;function A(v){v?d.emit("exposure",{id:a,type:"start"}):d.emit("exposure",{id:a,type:"end"})}const b=v=>d.emit("click",{event:v,target:"TagContent",tag:c});return o.$$set=v=>{"withAnimation"in v&&e(0,l=v.withAnimation),"tag"in v&&e(1,c=v.tag),"hooks"in v&&e(2,d=v.hooks),"state"in v&&e(3,u=v.state),"mediaStore"in v&&e(5,f=v.mediaStore),"temporaryState"in v&&e(4,h=v.temporaryState)},o.$$.update=()=>{var v,w;o.$$.dirty&2&&e(9,n=(v=c.state)==null?void 0:v.unfolded),o.$$.dirty&2&&e(8,s=(w=c.state)==null?void 0:w.visible),o.$$.dirty&280&&e(10,r=u.visible&&h.visible&&s),o.$$.dirty&2&&(a=c.id),o.$$.dirty&1024&&A(r),o.$$.dirty&962&&c.hooks&&(n!==void 0&&n!==g&&(e(7,g=n),n?c.hooks.emit("unfolded"):c.hooks.emit("folded")),s!==void 0&&s!==p&&(e(6,p=s),s?c.hooks.emit("show"):c.hooks.emit("hide")))},[l,c,d,u,h,f,p,g,s,n,r,b]}class tr extends i.SvelteComponent{constructor(t){super(),i.init(this,t,dm,cm,i.safe_not_equal,{withAnimation:0,tag:1,hooks:2,state:3,mediaStore:5,temporaryState:4},tm)}}function um(o){i.append_styles(o,"svelte-fuismw",".point.svelte-fuismw.svelte-fuismw{pointer-events:none;width:1.5rem;height:1.5rem}.small-point.svelte-fuismw.svelte-fuismw,.big-point.svelte-fuismw.svelte-fuismw{position:absolute;width:100%;height:100%;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:all 500ms}.big-point.svelte-fuismw.svelte-fuismw{background-color:rgba(0, 0, 0, 0.1)}.folded.point.svelte-fuismw.svelte-fuismw{animation:svelte-fuismw-breathing 2s linear infinite}.big-point.svelte-fuismw.svelte-fuismw::before,.big-point.svelte-fuismw.svelte-fuismw::after{content:'';display:block;position:absolute;background-size:contain;background-repeat:no-repeat;pointer-events:none}.big-point.svelte-fuismw.svelte-fuismw::before{width:100%;height:100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAMAAABiM0N1AAAAqFBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8j1z1tAAAAOHRSTlMABgoNFBsYIhEmHyksMoJ6RZ5aXzpnU03AtqaZjLuGN+zcifnW0cjEqnA+lOZzbWLhkH6i8rGuagnOwPMAAAQOSURBVFjDrZiHctp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C6EF089tPxxGHNzV8sKTgRhSzVYa2Wf5yeadHphlWGdb4IUeEO5K2SHrUiqJuW9GiLFdwVzRbCXTf5tg11mvhYdufZbLUr11XEi/k4KHexUxWSY8DBCby7AU8E3eUhfzVkYZgR6H/agF8C3KNqCeHLIIRR7oEr0XXsixy9P1jH/doJLF2nPXbIlw5y1aC6t4eROW1pduaLs/7b6NEqFiWrWpBzaXuaOy4Nfe6bRfqGwzSXBJZhnF8y9oUhcnzOyM9pI7wCWP0LSkyy1iFWWwsFp8LeKLfd4doRyTLRacAAAAASUVORK5CYII=)}.folded.svelte-fuismw .big-point.svelte-fuismw::before{animation:svelte-fuismw-rotate 2s linear infinite}.big-point.svelte-fuismw.svelte-fuismw::after{position:absolute;width:1rem;height:1rem;background-image:var(--iconUrl)}.small-point.svelte-fuismw.svelte-fuismw::before{content:'';display:block;position:absolute;pointer-events:none;width:0.25rem;height:0.25rem;border-radius:100%;background-color:white}.folded.svelte-fuismw .big-point.svelte-fuismw{opacity:1;scale:1}.unfolded.svelte-fuismw .big-point.svelte-fuismw{opacity:0;scale:0}.folded.svelte-fuismw .small-point.svelte-fuismw{opacity:0;scale:6}.unfolded.svelte-fuismw .small-point.svelte-fuismw{opacity:1;scale:1}@keyframes svelte-fuismw-rotate{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}@keyframes svelte-fuismw-breathing{0%{transform:scale(1)}25%{transform:scale(0.9)}50%{transform:scale(1)}}")}function hm(o){let t,e,n,s,r,a,l;return e=new ve({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){t=i.element("div"),i.create_component(e.$$.fragment),n=i.space(),s=i.element("div"),r=i.space(),a=i.element("div"),i.attr(s,"class","small-point svelte-fuismw"),i.set_style(s,"transition-delay",o[3]?o[2]+"ms":"0ms",!1),i.attr(a,"class","big-point svelte-fuismw"),i.set_style(a,"--iconUrl","url("+o[1]+")"),i.set_style(a,"transition-delay",o[3]?o[2]+"ms":"0ms",!1),i.attr(t,"class","point svelte-fuismw"),i.toggle_class(t,"folded",o[3]),i.toggle_class(t,"unfolded",o[0])},m(c,d){i.insert(c,t,d),i.mount_component(e,t,null),i.append(t,n),i.append(t,s),i.append(t,r),i.append(t,a),l=!0},p(c,[d]){d&12&&i.set_style(s,"transition-delay",c[3]?c[2]+"ms":"0ms",!1),(!l||d&2)&&i.set_style(a,"--iconUrl","url("+c[1]+")"),d&12&&i.set_style(a,"transition-delay",c[3]?c[2]+"ms":"0ms",!1),d&8&&i.toggle_class(t,"folded",c[3]),d&1&&i.toggle_class(t,"unfolded",c[0])},i(c){l||(i.transition_in(e.$$.fragment,c),l=!0)},o(c){i.transition_out(e.$$.fragment,c),l=!1},d(c){c&&i.detach(t),i.destroy_component(e)}}}function fm(o,t,e){let n,{unfolded:s}=t,{iconUrl:r}=t,{foldDelay:a=800}=t;return o.$$set=l=>{"unfolded"in l&&e(0,s=l.unfolded),"iconUrl"in l&&e(1,r=l.iconUrl),"foldDelay"in l&&e(2,a=l.foldDelay)},o.$$.update=()=>{o.$$.dirty&1&&e(3,n=!s)},[s,r,a,n]}class mm extends i.SvelteComponent{constructor(t){super(),i.init(this,t,fm,hm,i.safe_not_equal,{unfolded:0,iconUrl:1,foldDelay:2},um)}}function pm(o){i.append_styles(o,"svelte-jzvcn0",".point.svelte-jzvcn0.svelte-jzvcn0{pointer-events:none;width:1rem;height:1rem}.small-point.svelte-jzvcn0.svelte-jzvcn0,.big-point.svelte-jzvcn0.svelte-jzvcn0{position:absolute;width:100%;height:100%;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:all 500ms}.big-point.svelte-jzvcn0.svelte-jzvcn0::before,.big-point.svelte-jzvcn0.svelte-jzvcn0::after{content:'';display:block;position:absolute;background-size:contain;background-repeat:no-repeat;pointer-events:none}.big-point.svelte-jzvcn0.svelte-jzvcn0::before{width:100%;height:100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAMAAABiM0N1AAAAqFBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8j1z1tAAAAOHRSTlMABgoNFBsYIhEmHyksMoJ6RZ5aXzpnU03AtqaZjLuGN+zcifnW0cjEqnA+lOZzbWLhkH6i8rGuagnOwPMAAAQOSURBVFjDrZiHctpAEIYXYzvGOvXeUe+IYuD93ywrJAIhFJX8M8zoBHzz757utHvwTETJHJPfGQZfWJXILWCMPuqNbuu6vj+khrHjed40TWvFfQ2jvCl8nGha6lQCl7s07UqcUlfOZrOxVtKsN2a+0uJYK+ScEIqiFifhBSGSsnJ8f8u99cLMVnEUHTKXIOMX6vuk5gpphFYyhmHzHpzcDqNUJGgEER+oz5OaK8ShNcIdt+zx1ys7lhdqiDlRkPF+JaSdWIhasaz6lLPQ1qFDIwYpDeTr62veCS8bGLIQRSsVK78/5nDeOlYIYhovHeOtU0dDXw2KSGiKesQRyjJ10Q66QcyZMTvpTEMUumpMieyWvs9ZLZcmodAOYlorsysBflpjiEJTFBEY5+7sicul34T1iak5U25momN9Ya4wPCT57r8cteW0dk4YuKMTqjXVkgjciFr+8B3ngnmM6kii5X/efB0F+jUHnuiatLJY+Et84EnUNacfiaKZjQhX4oJAwPlqOB3mJaoh4dxxG5Nc3Q8DkywunP6kBalN53J7G3g0JqiNC3qpjQ7TRPvmn2U3L3/kU4JaTn/SKU0qb76dDf0kGNjHJbD+wX1gcMxO6fZVrzXUcQaROkvt3+pljIYugQ0LDi1ZBgeN9JK9MjTCkmgwgPou19I5QzBI5yy5RvqOw6xMMbKzoeGWmnQfBBwa6woj6wyNsYSx7R0chWuOwsjOqR6aboyNyvcpgOsl3ZzNhoNm3bztdAK1x5NuzmCwunkjjq4AEzKXFI1NUmVnwIfydJBoW7CPVAR1uR6XbVwlmgF2xF1yPTbbubYHLZamgyTNhiSmp4PoJIEk+R+gOAFb+x+hxRoctHw6iItsMLT/Mf3RHixbnP5AyhEPmZ1NB+E6A0V3pi9aPqyB6Pz0bSTxXID0kE/d2DgvxBFzEKdutdXawJGSMlM3/3Sd4fA93bnTXkfSuvwGFGOI016QbKm3VdbOn/bKjpd1e6Pg1SlFhPzjdXWNwjNTyprkhz33i4Wpji600FA5h05q4Ywv/bxge7mNRe7YYtQMwqt/kMLixpXHQhBwcCXBYukxBbvkBTv4S5V/HNNC6EF089tPxxGHNzV8sKTgRhSzVYa2Wf5yeadHphlWGdb4IUeEO5K2SHrUiqJuW9GiLFdwVzRbCXTf5tg11mvhYdufZbLUr11XEi/k4KHexUxWSY8DBCby7AU8E3eUhfzVkYZgR6H/agF8C3KNqCeHLIIRR7oEr0XXsixy9P1jH/doJLF2nPXbIlw5y1aC6t4eROW1pduaLs/7b6NEqFiWrWpBzaXuaOy4Nfe6bRfqGwzSXBJZhnF8y9oUhcnzOyM9pI7wCWP0LSkyy1iFWWwsFp8LeKLfd4doRyTLRacAAAAASUVORK5CYII=);background-size:contain;background-repeat:no-repeat}.small-point.svelte-jzvcn0.svelte-jzvcn0::before{content:'';display:block;position:absolute;pointer-events:none;width:0.375rem;height:0.375rem;border-radius:100%;background-color:white}.unfolded.svelte-jzvcn0 .big-point.svelte-jzvcn0{opacity:0;transform:scale(0)}.folded.svelte-jzvcn0 .big-point.svelte-jzvcn0{opacity:1;transform:scale(1)}.unfolded.svelte-jzvcn0 .small-point.svelte-jzvcn0{transform:scale(0.6)}.folded.svelte-jzvcn0 .small-point.svelte-jzvcn0{transform:scale(1)}")}function gm(o){let t,e,n,s,r,a,l;return e=new ve({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){t=i.element("div"),i.create_component(e.$$.fragment),n=i.space(),s=i.element("div"),r=i.space(),a=i.element("div"),i.attr(s,"class","small-point svelte-jzvcn0"),i.set_style(s,"transition-delay",o[2]?o[1]+"ms":"0ms",!1),i.attr(a,"class","big-point svelte-jzvcn0"),i.set_style(a,"transition-delay",o[2]?o[1]+"ms":"0ms",!1),i.attr(t,"class","point svelte-jzvcn0"),i.toggle_class(t,"unfolded",o[0]),i.toggle_class(t,"folded",o[2])},m(c,d){i.insert(c,t,d),i.mount_component(e,t,null),i.append(t,n),i.append(t,s),i.append(t,r),i.append(t,a),l=!0},p(c,[d]){d&6&&i.set_style(s,"transition-delay",c[2]?c[1]+"ms":"0ms",!1),d&6&&i.set_style(a,"transition-delay",c[2]?c[1]+"ms":"0ms",!1),d&1&&i.toggle_class(t,"unfolded",c[0]),d&4&&i.toggle_class(t,"folded",c[2])},i(c){l||(i.transition_in(e.$$.fragment,c),l=!0)},o(c){i.transition_out(e.$$.fragment,c),l=!1},d(c){c&&i.detach(t),i.destroy_component(e)}}}function Am(o,t,e){let n,{unfolded:s}=t,{foldDelay:r=800}=t;return o.$$set=a=>{"unfolded"in a&&e(0,s=a.unfolded),"foldDelay"in a&&e(1,r=a.foldDelay)},o.$$.update=()=>{o.$$.dirty&1&&e(2,n=!s)},[s,r,n]}class vm extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Am,gm,i.safe_not_equal,{unfolded:0,foldDelay:1},pm)}}function bm(o){i.append_styles(o,"svelte-8en2lj",".point-click-helper.svelte-8en2lj{position:absolute;width:2.5rem;height:2.5rem;left:50%;top:50%;transform:translate(-50%, -50%)}")}function es(o){let t,e,n=o[0].contentType!==ge.Link&&ts(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,r){s[0].contentType!==ge.Link?n?(n.p(s,r),r&1&&i.transition_in(n,1)):(n=ts(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function ts(o){let t,e,n,s,r,a;const l=[wm,ym],c=[];function d(u,f){var h,p,g,A;return((p=(h=u[0].style)==null?void 0:h.point)==null?void 0:p.style)==="CustomIcon"&&((A=(g=u[0].style)==null?void 0:g.point)==null?void 0:A.iconUrl)?0:1}return n=d(o),s=c[n]=l[n](o),{c(){t=i.element("div"),e=i.space(),s.c(),r=i.empty(),i.attr(t,"class","point-click-helper svelte-8en2lj")},m(u,f){i.insert(u,t,f),i.insert(u,e,f),c[n].m(u,f),i.insert(u,r,f),a=!0},p(u,f){let h=n;n=d(u),n===h?c[n].p(u,f):(i.group_outros(),i.transition_out(c[h],1,1,()=>{c[h]=null}),i.check_outros(),s=c[n],s?s.p(u,f):(s=c[n]=l[n](u),s.c()),i.transition_in(s,1),s.m(r.parentNode,r))},i(u){a||(i.transition_in(s),a=!0)},o(u){i.transition_out(s),a=!1},d(u){u&&i.detach(t),u&&i.detach(e),c[n].d(u),u&&i.detach(r)}}}function ym(o){let t,e;return t=new vm({props:{unfolded:o[0].state.unfolded,foldDelay:o[1]}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&1&&(r.unfolded=n[0].state.unfolded),s&2&&(r.foldDelay=n[1]),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function wm(o){let t,e;return t=new mm({props:{iconUrl:o[0].style.point.iconUrl,unfolded:o[0].state.unfolded,foldDelay:o[1]}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&1&&(r.iconUrl=n[0].style.point.iconUrl),s&1&&(r.unfolded=n[0].state.unfolded),s&2&&(r.foldDelay=n[1]),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function Cm(o){var s,r,a;let t,e,n=((s=o[0].pointTagStyle)==null?void 0:s.leftPercent)&&((r=o[0].pointTagStyle)==null?void 0:r.topPercent)&&o[0].enabled!==!1&&o[0].state&&((a=o[0].temporaryState)==null?void 0:a.visible)!==!1&&es(o);return{c(){n&&n.c(),t=i.empty()},m(l,c){n&&n.m(l,c),i.insert(l,t,c),e=!0},p(l,[c]){var d,u,f;((d=l[0].pointTagStyle)==null?void 0:d.leftPercent)&&((u=l[0].pointTagStyle)==null?void 0:u.topPercent)&&l[0].enabled!==!1&&l[0].state&&((f=l[0].temporaryState)==null?void 0:f.visible)!==!1?n?(n.p(l,c),c&1&&i.transition_in(n,1)):(n=es(l),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(l){e||(i.transition_in(n),e=!0)},o(l){i.transition_out(n),e=!1},d(l){n&&n.d(l),l&&i.detach(t)}}}function Em(o,t,e){let n,{tag:s}=t;return o.$$set=r=>{"tag"in r&&e(0,s=r.tag)},o.$$.update=()=>{var r,a;o.$$.dirty&1&&e(1,n=(a=(r=s.style)==null?void 0:r.foldedPointDelay)!=null?a:s.contentType===ge.Marketing?600:void 0)},[s,n]}class Pm extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Em,Cm,i.safe_not_equal,{tag:0},bm)}}function Im(o){i.append_styles(o,"svelte-1vzhbu2",".wrapper.svelte-1vzhbu2{position:absolute;width:0rem;height:0rem;overflow:visible;pointer-events:auto}.point.svelte-1vzhbu2{-webkit-tap-highlight-color:transparent;position:absolute;transform:translate(-50%, -50%);left:50%;top:50%}")}function ns(o){let t,e;return t=new tr({props:{mediaStore:o[4],withAnimation:o[0],tag:re(o[1]),hooks:o[2],state:o[3],temporaryState:o[5]}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&16&&(r.mediaStore=n[4]),s&1&&(r.withAnimation=n[0]),s&2&&(r.tag=re(n[1])),s&4&&(r.hooks=n[2]),s&8&&(r.state=n[3]),s&32&&(r.temporaryState=n[5]),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function is(o){let t,e,n,s,r;return e=new Pm({props:{tag:o[1]}}),{c(){t=i.element("div"),i.create_component(e.$$.fragment),i.attr(t,"class","point svelte-1vzhbu2")},m(a,l){i.insert(a,t,l),i.mount_component(e,t,null),n=!0,s||(r=i.listen(t,"click",i.stop_propagation(o[11])),s=!0)},p(a,l){const c={};l&2&&(c.tag=a[1]),e.$set(c)},i(a){n||(i.transition_in(e.$$.fragment,a),n=!0)},o(a){i.transition_out(e.$$.fragment,a),n=!1},d(a){a&&i.detach(t),i.destroy_component(e),s=!1,r()}}}function km(o){var l,c;let t,e,n,s,r=o[1].dimensionType===Ae.Two&&ns(o),a=o[1].pointType===fe.PointTag&&((c=(l=o[1].style)==null?void 0:l.point)==null?void 0:c.style)!=="noPoint"&&is(o);return{c(){t=i.element("div"),r&&r.c(),e=i.space(),a&&a.c(),i.attr(t,"class","wrapper svelte-1vzhbu2"),i.attr(t,"data-id",n=o[1].id),i.toggle_class(t,"hide",o[10]),i.toggle_class(t,"unfolded",o[6]),i.set_style(t,"left",o[9],!1),i.set_style(t,"top",o[8],!1),i.set_style(t,"z-index",o[7],!1)},m(d,u){i.insert(d,t,u),r&&r.m(t,null),i.append(t,e),a&&a.m(t,null),s=!0},p(d,[u]){var f,h;d[1].dimensionType===Ae.Two?r?(r.p(d,u),u&2&&i.transition_in(r,1)):(r=ns(d),r.c(),i.transition_in(r,1),r.m(t,e)):r&&(i.group_outros(),i.transition_out(r,1,1,()=>{r=null}),i.check_outros()),d[1].pointType===fe.PointTag&&((h=(f=d[1].style)==null?void 0:f.point)==null?void 0:h.style)!=="noPoint"?a?(a.p(d,u),u&2&&i.transition_in(a,1)):(a=is(d),a.c(),i.transition_in(a,1),a.m(t,null)):a&&(i.group_outros(),i.transition_out(a,1,1,()=>{a=null}),i.check_outros()),(!s||u&2&&n!==(n=d[1].id))&&i.attr(t,"data-id",n),u&1024&&i.toggle_class(t,"hide",d[10]),u&64&&i.toggle_class(t,"unfolded",d[6]),u&512&&i.set_style(t,"left",d[9],!1),u&256&&i.set_style(t,"top",d[8],!1),u&128&&i.set_style(t,"z-index",d[7],!1)},i(d){s||(i.transition_in(r),i.transition_in(a),s=!0)},o(d){i.transition_out(r),i.transition_out(a),s=!1},d(d){d&&i.detach(t),r&&r.d(),a&&a.d()}}}function xm(o,t,e){let n,s,r,a,l,c,{withAnimation:d=!1}=t,{tag:u}=t,{hooks:f}=t,{state:h}=t,{mediaStore:p}=t,{temporaryState:g}=t,A,b=!1;function v(y){A!==void 0&&clearTimeout(A),b=!0,A=setTimeout(()=>{b=!1},800)}const w=y=>{b||f.emit("click",{event:y,target:"TagPoint",tag:u})};return o.$$set=y=>{"withAnimation"in y&&e(0,d=y.withAnimation),"tag"in y&&e(1,u=y.tag),"hooks"in y&&e(2,f=y.hooks),"state"in y&&e(3,h=y.state),"mediaStore"in y&&e(4,p=y.mediaStore),"temporaryState"in y&&e(5,g=y.temporaryState)},o.$$.update=()=>{var y,I,k,C;o.$$.dirty&2&&e(12,n=(y=u.state)==null?void 0:y.visible),o.$$.dirty&4096&&e(10,s=!n),o.$$.dirty&2&&e(6,r=(I=u.state)==null?void 0:I.unfolded),o.$$.dirty&2&&e(9,a=((k=u.pointTagStyle)==null?void 0:k.leftPercent)+"%"),o.$$.dirty&2&&e(8,l=((C=u.pointTagStyle)==null?void 0:C.topPercent)+"%"),o.$$.dirty&2&&e(7,c=u.contentType===ge.Link?1:0),o.$$.dirty&64&&v()},[d,u,f,h,p,g,r,c,l,a,s,w,n]}class Dm extends i.SvelteComponent{constructor(t){super(),i.init(this,t,xm,km,i.safe_not_equal,{withAnimation:0,tag:1,hooks:2,state:3,mediaStore:4,temporaryState:5},Im)}}function Sm(o){i.append_styles(o,"svelte-1eci49s",".tag--container.svelte-1eci49s{box-sizing:border-box;position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;opacity:1;-webkit-user-select:none;-moz-user-select:none;user-select:none}.tag.hide.svelte-1eci49s{display:none}.withAnimation.svelte-1eci49s{transition:opacity 0.3s linear}.tag--container.hide.svelte-1eci49s{opacity:0;pointer-events:none}.tag--container.hide.svelte-1eci49s *{pointer-events:none}")}function os(o,t,e){const n=o.slice();return n[6]=t[e],n}function ss(o){let t,e=[],n=new Map,s,r=o[1];const a=l=>l[6].id;for(let l=0;l<r.length;l+=1){let c=os(o,r,l),d=a(c);n.set(d,e[l]=rs(d,c))}return{c(){t=i.element("div");for(let l=0;l<e.length;l+=1)e[l].c();i.attr(t,"class","tag--container svelte-1eci49s"),i.toggle_class(t,"hide",!o[3].visible||!o[5].visible),i.toggle_class(t,"withAnimation",o[0])},m(l,c){i.insert(l,t,c);for(let d=0;d<e.length;d+=1)e[d].m(t,null);s=!0},p(l,c){c&63&&(r=l[1],i.group_outros(),e=i.update_keyed_each(e,c,a,1,l,r,n,t,i.outro_and_destroy_block,rs,null,os),i.check_outros()),c&40&&i.toggle_class(t,"hide",!l[3].visible||!l[5].visible),c&1&&i.toggle_class(t,"withAnimation",l[0])},i(l){if(!s){for(let c=0;c<r.length;c+=1)i.transition_in(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)i.transition_out(e[c]);s=!1},d(l){l&&i.detach(t);for(let c=0;c<e.length;c+=1)e[c].d()}}}function rs(o,t){let e,n,s,r;const a=[{tag:t[6],hooks:t[2],state:t[3],mediaStore:t[4],temporaryState:t[5],withAnimation:t[0]}];let l={};for(let c=0;c<a.length;c+=1)l=i.assign(l,a[c]);return n=new Dm({props:l}),{key:o,first:null,c(){var c,d,u;e=i.element("div"),i.create_component(n.$$.fragment),s=i.space(),i.attr(e,"class","tag svelte-1eci49s"),i.toggle_class(e,"hide",!((c=t[6].pointTagStyle)!=null&&c.leftPercent)||!((d=t[6].pointTagStyle)!=null&&d.topPercent)||t[6].enabled===!1||!t[6].state||((u=t[6].temporaryState)==null?void 0:u.visible)===!1),this.first=e},m(c,d){i.insert(c,e,d),i.mount_component(n,e,null),i.append(e,s),r=!0},p(c,d){var f,h,p;t=c;const u=d&63?i.get_spread_update(a,[{tag:t[6],hooks:t[2],state:t[3],mediaStore:t[4],temporaryState:t[5],withAnimation:t[0]}]):{};n.$set(u),d&2&&i.toggle_class(e,"hide",!((f=t[6].pointTagStyle)!=null&&f.leftPercent)||!((h=t[6].pointTagStyle)!=null&&h.topPercent)||t[6].enabled===!1||!t[6].state||((p=t[6].temporaryState)==null?void 0:p.visible)===!1)},i(c){r||(i.transition_in(n.$$.fragment,c),r=!0)},o(c){i.transition_out(n.$$.fragment,c),r=!1},d(c){c&&i.detach(e),i.destroy_component(n)}}}function Lm(o){let t,e,n=o[3].enabled&&ss(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[3].enabled?n?(n.p(s,r),r&8&&i.transition_in(n,1)):(n=ss(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function _m(o,t,e){let{withAnimation:n=!1}=t,{tags:s=[]}=t,{hooks:r}=t,{state:a}=t,{mediaStore:l}=t,{temporaryState:c}=t;return o.$$set=d=>{"withAnimation"in d&&e(0,n=d.withAnimation),"tags"in d&&e(1,s=d.tags),"hooks"in d&&e(2,r=d.hooks),"state"in d&&e(3,a=d.state),"mediaStore"in d&&e(4,l=d.mediaStore),"temporaryState"in d&&e(5,c=d.temporaryState)},[n,s,r,a,l,c]}class zm extends i.SvelteComponent{constructor(t){super(),i.init(this,t,_m,Lm,i.safe_not_equal,{withAnimation:0,tags:1,hooks:2,state:3,mediaStore:4,temporaryState:5},Sm)}}const Mm={globalConfig:{initialState:{},visibleConfig:{visibleDistance:{max:5},angleRange:{min:-45,max:45}},unfoldedConfig:{autoUnfold:{strategy:"MinimumDistance"}},tag3DConfig:{ratio:.0035}},contentTypeConfig:{"Any-Link-Any":{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},"Any-Marketing-Any":{unfoldedConfig:void 0},"3D-MediaPlane-PlaneTag":{unfoldedConfig:{keep:"unfolded"},visibleConfig:{alwaysShowWhenMovePano:!0,angleRange:void 0,visibleDistance:void 0}}}};class Tm extends Xt{constructor(e){super(e);m(this,"tagCacheByPanoIndex",{})}getCaches({panoIndex:e,id:n,key:s}){var d,u,f,h;const{five:r}=this,a=(d=r.panoIndex)!=null?d:e;if(a===void 0)throw new Error(`TagCacheController getCache(): fivePanoIndex is ${a}`);const l=`${(f=(u=r.work)==null?void 0:u.workCode)!=null?f:r.model.uuid}-${a}`;let c=this.tagCacheByPanoIndex[l];if(c||(c=new Map,this.tagCacheByPanoIndex[l]=c),n===void 0)return c;if(s===void 0){const p=c.get(n);return p||(c.set(n,{}),c.get(n))}return(h=c.get(n))==null?void 0:h[s]}clearCache(){this.tagCacheByPanoIndex={}}}class jm extends Tm{constructor(e){super(e);m(this,"tags",[]);m(this,"config",Mm);m(this,"raycaster",new P.Raycaster)}getTagById(e){const n=this.tags.find(s=>s.id===e);if(!n){console.error(`getTagById(): tag is ${n}, id is ${e}`);return}return n}changeConfig(e,n=!0){n?this.config=Ne.default({},this.config,e):this.config=e,this.clearCache()}changeGlobalConfig(e,n=!0){n?this.config.globalConfig=Ne.default({},this.config.globalConfig,e):this.config.globalConfig=e,this.clearCache()}changeContentTypeConfig(e,n,s=!0){this.config.contentTypeConfig||(this.config.contentTypeConfig={}),s?this.config.contentTypeConfig[e]=Ne.default({},this.config.contentTypeConfig[e],n):this.config.contentTypeConfig[e]=n,this.clearCache()}getVisibleByPanoIndex(e,n){var a;const s=this.getCaches({panoIndex:n,id:e.id}),r=(a=this.five.panoIndex)!=null?a:n;if(s.visible!==void 0)return s.visible;{const l=(()=>{var u,f,h,p,g;const c=(u=this.getTagConfig(e).visibleConfig)!=null?u:{},d=this.getDistance(e);if(typeof c=="function")return c(this.five,{tag:e,distance:d});if(c.keep==="hidden")return!1;if(c.keep==="visible")return!0;if(c.visiblePanoIndex!==void 0&&(r===void 0||!c.visiblePanoIndex.includes(r))||c.visibleDistance!==void 0&&c.visibleDistance!=="unLimited"&&kt(d,c.visibleDistance)===!1)return!1;if(((f=c.intersectRaycaster)==null?void 0:f.enabled)!==!1){if(r===void 0)return!1;const A=(h=this.five.work.observers[r])==null?void 0:h.position;if(A===void 0)throw new Error(`getVisible(): observerPosition is ${A}`);const b=It(e.position).sub(A).normalize();this.raycaster.set(A,b);const[v]=this.five.model.intersectRaycaster(this.raycaster),w=(g=(p=c.intersectRaycaster)==null?void 0:p.distanceAccuracy)!=null?g:.01;if(v&&v.distance+w<d)return!1}return!(c.angleRange&&e.dimensionType===Ae.Three&&kt(this.getAngle(e),c.angleRange)===!1)})();return s.visible=l,s.visible}}getUnfoldedByPanoIndex(e,n){if(!this.getVisibleByPanoIndex(e))return;const r=this.getCaches({panoIndex:n,id:e.id});if(r.unfolded!==void 0)return r.unfolded;{const a=this.getTagConfig(e).unfoldedConfig;if(!a)return;const l=(()=>{const d=this.getDistance(e);if(typeof a=="function")return a(this.five,{tag:e,distance:d});if(a.keep==="folded")return!1;if(a.keep==="unfolded")return!0;if(a.disableUnfold===!0)return!1;if(a.disableFold===!0)return!0;if(a.unfoldDistance&&kt(d,a.unfoldDistance)===!1)return!1})();r.unfolded=l;const c=this.getUnfoldedByCamera(e);return c!==void 0?c:r.unfolded}}getUnfoldedByCamera(e){return this.getVisibleByPanoIndex(e)?(()=>{var l;const r=this.getDistance(e),a=this.getTagConfig(e).unfoldedConfig;if(!!a){if(typeof a=="function")return a(this.five,{tag:e,distance:r});if(a.keep==="folded")return!1;if(a.keep==="unfolded")return!0;if(a.disableUnfold===!0)return!1;if(a.disableFold===!0)return!0;if(a.autoUnfold===void 0)return;if(a.autoUnfold.strategy==="ScreenPostion"){const c=this.getTagProject(e);if(c&&kt(c.x,a.autoUnfold.autoUnfoldProjectX)===!1)return!1}if(a.autoUnfold.strategy==="MinimumDistance"){const u=this.filterPointTag().filter(h=>this.getVisibleByPanoIndex(h)).filter(h=>{const p=this.getTagProject(h);if(!p)return!1;const{x:g,y:A,z:b}=p;return!(Math.abs(b)>1||Math.abs(g)>1||Math.abs(A)>1)}).filter(h=>{var g;const p=this.getTagConfig(h).unfoldedConfig;return typeof p=="object"&&((g=p.autoUnfold)==null?void 0:g.strategy)==="MinimumDistance"}).map(h=>({id:h.id,distance:this.getDistance(h)})).filter(h=>h.distance!==void 0).sort((h,p)=>h.distance-p.distance).findIndex(h=>h.id===e.id);if(u===-1||u<=((l=a.autoUnfold.maxNumber)!=null?l:1)-1===!1)return!1}return!0}})():void 0}getDistance(e,n){var a,l,c;const s=(a=this.five.panoIndex)!=null?a:n;if(s===void 0)throw new Error(`getDistance(): fivePanoIndex is ${s}`);const r=this.getCaches({panoIndex:n,id:e.id});if(r.distance!==void 0)return r.distance;{const d=(c=(l=this.five.work)==null?void 0:l.observers[s])==null?void 0:c.position;if(d===void 0)throw new Error(`getDistance(): observerPosition is ${d}`);const u=(()=>e.pointType===fe.PointTag?De(e==null?void 0:e.position):It(e.position))(),f=d.distanceTo(u);return r.distance=f,f}}getAngle(e,n){var a,l,c;const s=(a=this.five.panoIndex)!=null?a:n;if(s===void 0)throw new Error(`getDistance(): fivePanoIndex is ${s}`);const r=this.getCaches({panoIndex:n,id:e.id});if(r.angle!==void 0)return r.angle;{const d=(c=(l=this.five.work)==null?void 0:l.observers[s])==null?void 0:c.position;if(d===void 0)throw new Error(`getAngleRange(): observerPosition is ${d}`);const u=(()=>e.pointType===fe.PointTag?ct(e.normal):Vs(e.position))();if(!u)return;const f=new P.Vector3().copy(d).sub(It(e.position)),h=u.angleTo(f)*180/Math.PI;return r.angle=h,r.angle}}getTagConfig(e){var r;if(!e)return(r=this.config.globalConfig)!=null?r:{};const n={};return this.config.contentTypeConfig&&Object.keys(this.config.contentTypeConfig).forEach(a=>{const l=a;if(n[l])return;const c=l.split("-"),[d="Any",u="Any",f="Any"]=c||[];(e.dimensionType===d||d==="Any")&&(e.contentType===u||u==="Any")&&(e.pointType===f||f==="Any")&&(n[l]=this.config.contentTypeConfig[l])}),Ne.default({},this.config.globalConfig,...Object.values(n),e.config)}canBe(e,n){const s=this.getTagConfig(n);if(!s||typeof s!="object")return!0;if(e==="show"||e==="hide"){if(!s.visibleConfig||typeof s.visibleConfig!="object")return!0;if(e==="show"&&s.visibleConfig.keep==="hidden"||e==="hide"&&(s.visibleConfig.keep==="visible"||s.visibleConfig.alwaysShowWhenMovePano))return!1}if(e==="fold"||e==="unfold"){if(!s.unfoldedConfig||typeof s.unfoldedConfig!="object")return!0;if(e==="fold"&&(s.unfoldedConfig.disableFold||s.unfoldedConfig.keep==="unfolded")||e==="unfold"&&(s.unfoldedConfig.disableUnfold||s.unfoldedConfig.keep==="folded"))return!1}return!0}setPointTagPosition(){const e=this.filterPointTag();e.length!==0&&e.forEach(n=>{var r;if(!((r=n.state)!=null&&r.visible)){n.pointTagStyle=void 0;return}const s=this.getTagProject(n);if(!s){n.pointTagStyle=void 0;return}n.pointTagStyle={leftPercent:(s.x+1)/2*100,topPercent:(-s.y+1)/2*100}})}setVisibleByPanoIndex(){this.tags.forEach(e=>{const n=this.getVisibleByPanoIndex(e);e.state&&(e.state.visible=n)})}setUnfoldedByPanoIndex(){this.tags.forEach(e=>{const n=this.getUnfoldedByPanoIndex(e);if(!!e.state&&(n!==void 0&&(e.state.unfolded=n),n&&!e.state.visible)){const s=this.getTagConfig(e);typeof s.unfoldedConfig=="object"&&s.unfoldedConfig.autoUnfoldWhenHide!==!1&&(e.state.unfolded=!1)}})}getTagProject(e){if(!this.getVisibleByPanoIndex(e))return;const s=It(e.position),{x:r,y:a,z:l}=s.project(this.five.camera);if(!(l>1))return{x:r,y:a,z:l}}filterPointTag(){return this.tags.filter(e=>e.pointType===fe.PointTag)}filterTag2D(){return this.tags.filter(e=>e.dimensionType===Ae.Two)}filter3DPointTag(){return this.tags.filter(e=>e.dimensionType===Ae.Three&&e.pointType===fe.PointTag)}filter3DTag(){return this.tags.filter(e=>e.dimensionType===Ae.Three)}filterPlaneTag(){return this.tags.filter(e=>e.dimensionType===Ae.Three&&e.pointType===fe.PlaneTag)}}const nr="1.2.6",En=`DnalogelPlugin-PanoTagPlugin@${nr}`,Bm=!1,Qm=o=>`${En}--${o}`;class ir extends jm{constructor(e,n){super(e);m(this,"version",nr);m(this,"state",{enabled:!0,visible:!0});m(this,"params");m(this,"debug");m(this,"css3DRenderPlugin");m(this,"TagContainerSvelte");m(this,"temporaryState",{visible:!0});m(this,"mediaStore",kn.writable({currentMediaUrl:""}));m(this,"store",{disposers:[],disposed:!1,resizeObserverDisposerAdding:!1,css3DRenderDisposer:new Map});m(this,"staticUrl");m(this,"disposedErrorLog",()=>{console.error(`${En} is disposed`)});this.params=j({debug:!1,mergePluginDefaultConfigToLoadDataConfig:!1,config:this.config,staticConfig:{host:"vrlab-static.ljcdn.com"}},n),this.debug=this.params.debug,this.config=this.params.config,this.staticUrl=(()=>{var r;const s=this.params.staticConfig;if(typeof s=="string")return s;{const a=s.protocol?s.protocol+":":"",l=(r=s.host)!=null?r:"vrlab-static.ljcdn.com",c=s.port?":"+s.port:"";return`${a}//${l}${c}`}})(),Object.assign(window,{__PANOTAGPLUGIN_DEBUG__:this})}load(e,n){var s,r;this.clearTags(),console.log(En,"load:",{data:e}),this.params.mergePluginDefaultConfigToLoadDataConfig?this.config=Ne.default({},this.config,{globalConfig:(s=e.globalConfig)!=null?s:{},contentTypeConfig:(r=e.contentTypeConfig)!=null?r:{}}):(e.globalConfig&&(this.config.globalConfig=e.globalConfig),e.contentTypeConfig&&(this.config.contentTypeConfig=e.contentTypeConfig)),this.addTag(e.tagList,n),this.debug&&ph(this.five,this.tags)}addTag(e,n){const r=(Array.isArray(e)?e:[e]).map(a=>{const l=this.getTagConfig(a);return V(j({},a),{state:j({visible:void 0,unfolded:Bm},l.initialState),hooks:new ee.Subscribe,clickable:l.clickable})}).filter(a=>a.position);this.tags.push(...r),gh(this.five,()=>{var a,l,c;this.store.eventListenerDisposer&&((l=(a=this.store).eventListenerDisposer)==null||l.call(a)),this.state.enabled&&(this.store.eventListenerDisposer=this.addEventListener()),this.addResizeListener(),this.checkPanelTag(),this.setVisibleAndUnfolded({withAnimation:(c=n==null?void 0:n.withAnimation)!=null?c:!0}).then(()=>this.updateRenderAllTags()),this.updateRenderAllTags()})}clearTags(){this.tags=[],this.clearCache(),this.disposeAllCSS3DContainer(),this.updateRenderAllTags()}show(e){return F(this,null,function*(){const{userAction:n=!0,withAnimation:s=!1}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({visible:!0},{userAction:n,visibleWithAnimation:s}),this.hooks.emit("show",{userAction:n,withAnimation:s})})}hide(e){return F(this,null,function*(){const{userAction:n=!0,withAnimation:s=!1}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({visible:!1},{userAction:n,visibleWithAnimation:s}),this.hooks.emit("hide",{userAction:n,withAnimation:s})})}enable(e){const{userAction:n=!0}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({enabled:!0},{userAction:n}),this.hooks.emit("enable",{userAction:n})}disable(e){const{userAction:n=!0}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({enabled:!1},{userAction:n}),this.hooks.emit("disable",{userAction:n})}dispose(){var e,n,s,r,a,l;this.disposeAllCSS3DContainer(),(e=this.TagContainerSvelte)==null||e.$destroy(),this.filter3DTag().forEach(c=>{var d;return(d=c.tag3DContentSvelte)==null?void 0:d.svelteApp.$destroy()}),this.tags=[],(n=this.store.disposers)==null||n.forEach(c=>c==null?void 0:c()),this.store.disposers=[],this.store.disposed=!0,(r=(s=this.store).eventListenerDisposer)==null||r.call(s),this.store.eventListenerDisposer=void 0,(l=(a=this.store).resizeObserverDisposer)==null||l.call(a),this.store.resizeObserverDisposer=void 0,this.store.resizeObserverDisposerAdding=!1,this.clearCache(),this.hooks.emit("dispose")}setState(e,n){if(this.store.disposed)return this.disposedErrorLog();const{userAction:s=!0,visibleWithAnimation:r=!1}=n,a=j({},this.state);this.state=Object.assign(this.state,e),this.store.visibleWithAnimation=r,a.visible!==this.state.visible&&(e.visible?this.handleShow():this.handleHide()),a.enabled!==this.state.enabled&&(e.enabled?this.handleEnable():this.handleDisable()),this.hooks.emit("stateChange",{state:this.state,prevState:a,userAction:s})}changeTagNormalById(e,n){const s=this.getTagById(e);!s||!s.tag3DContentSvelte||(s.tag3DContentSvelte.currentNormal=De(n),this.updateRenderPlaneTag())}changeDataById(e,n,s=!0){const r=this.getTagById(e);!r||(s?r.data=Ne.default({},r.data,n):Object.assign(r.data,n),this.checkPanelTag(),this.updateRenderAllTags())}changeTagById(e,n,s=!0){const r=this.getTagById(e);!n||(s?Ne.default(r,n):Object.assign(r,n),(r==null?void 0:r.tag3DContentSvelte)&&(n==null?void 0:n.normal)&&(r.tag3DContentSvelte.currentNormal=De(n.normal)),this.updateRenderAllTags(),this.checkPanelTag())}destroyTagById(e){(Array.isArray(e)?e:[e]).forEach(s=>{const r=this.tags.findIndex(a=>a.id===s);r!==-1&&this.tags.splice(r,1)}),this.updateRenderAllTags()}pauseCurrentMedia(){this.mediaStore.set({currentMediaUrl:""})}setVisibleAndUnfolded(){return F(this,arguments,function*({withAnimation:e}={withAnimation:!1}){return this.setVisibleByPanoIndex(),e?new Promise((n,s)=>{setTimeout(()=>{this.setUnfoldedByPanoIndex(),n()},10)}):(this.setUnfoldedByPanoIndex(),Promise.resolve())})}handleShow(){this.state.visible=!0,this.updateTagContainerVisible()}handleHide(){this.state.visible=!1,this.updateTagContainerVisible()}handleEnable(){this.state.enabled=!0,this.store.eventListenerDisposer=this.addEventListener(),this.updateRenderAllTags()}handleDisable(){var e,n,s;this.state.enabled=!1,(n=(e=this.store).eventListenerDisposer)==null||n.call(e),(s=this.TagContainerSvelte)==null||s.$set({tags:[]}),this.filter3DTag().forEach(r=>{var a;(a=r.tag3DContentSvelte)==null||a.svelteApp.$destroy(),r.tag3DContentSvelte=void 0})}addEventListener(){const{five:e,hooks:n}=this,s=this.handleFiveWantsMoveToPano.bind(this),r=this.handleFiveModeChange.bind(this),a=this.handleFiveCameraUpdate.bind(this),l=this.handleFiveCameraUpdateDebounce(),c=this.handleFivePanoArrived.bind(this),d=this.clickhandler.bind(this);return e.on("wantsMoveToPano",s),e.on("modeChange",r),e.on("cameraUpdate",a),e.on("cameraUpdate",l),e.on("panoArrived",c),n.on("click",d),()=>{e.off("wantsMoveToPano",s),e.off("modeChange",r),e.off("cameraUpdate",a),e.off("cameraUpdate",l),e.off("panoArrived",c),n.off("click",d),this.store.eventListenerDisposer=void 0}}addResizeListener(){if(!this.store.resizeObserverDisposer&&!this.store.resizeObserverDisposerAdding){const e=this.addResizeObserver();this.store.resizeObserverDisposerAdding=!0,setTimeout(()=>{this.store.resizeObserverDisposer=e,this.store.resizeObserverDisposerAdding=!1},200)}}addResizeObserver(){if(!this.store.disposed)return;const e=this.five.getElement(),n=()=>{!this.state.enabled||(this.show(),this.updateRenderAllTags())},s=()=>{!this.state.enabled||this.hide()},{observe:r,unobserve:a}=ro(vh(()=>{!this.store.resizeObserverDisposer||s()},500),e),{observe:l,unobserve:c}=ro(so(()=>n(),400),e);return r(),l(),()=>{a(),c()}}handleFiveModeChange(e){e==="Panorama"?this.five.once("panoArrived",()=>this.temporaryShow()):this.temporaryHide()}handleFiveWantsMoveToPano(){this.tags.forEach(e=>{const n=this.getTagConfig(e);typeof n.visibleConfig=="object"&&n.visibleConfig.keep?e.temporaryState=V(j({},e.temporaryState),{visible:n.visibleConfig.keep==="visible"}):typeof n.visibleConfig=="object"&&n.visibleConfig.alwaysShowWhenMovePano?e.temporaryState=V(j({},e.temporaryState),{visible:!0}):e.temporaryState=V(j({},e.temporaryState),{visible:!1})}),this.updateRenderAllTags()}temporaryShow(){this.temporaryState.visible=!0}temporaryHide(){this.temporaryState.visible=!1}clickhandler(e){if(e.target!=="TagPoint")return;if(!e.tag.state)return console.warn("Clickhandler: params.tag.state is undefined");const n=this.canBe("fold",e.tag),s=this.canBe("unfold",e.tag);n&&s&&(e.tag.state.unfolded=!e.tag.state.unfolded,e.tag.state.unfolded&&this.tags.forEach(r=>{r.id!==e.tag.id&&r.state&&this.canBe("fold",r)&&(r.state.unfolded=!1)}),this.updateRenderAllTags())}updateRenderAllTags(){this.updateRenderPointTag(),this.updateRenderPlaneTag()}updateTagContainerVisible(){var e;(e=this.TagContainerSvelte)==null||e.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation}),this.filter3DTag().forEach(n=>{var s;(s=n.tag3DContentSvelte)==null||s.svelteApp.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation})})}handleFiveCameraUpdateDebounce(){return so(()=>{this.setUnfoldedByCamera(),this.updateRenderAllTags()},100)}handleFiveCameraUpdate(){this.updateRenderPointTag()}handleFivePanoArrived(){return F(this,null,function*(){yield this.setVisibleAndUnfolded(),this.tags.forEach(e=>{e.temporaryState=V(j({},e.temporaryState),{visible:!0})}),this.updateRenderAllTags()})}setUnfoldedByCamera(){let e=!1;this.tags.forEach(n=>{const s=this.getUnfoldedByCamera(n);!n.state||s!==void 0&&(s===!0&&(e=!0),n.state.unfolded=s)}),e&&this.tags.forEach(n=>{const s=this.getTagConfig(n).unfoldedConfig;typeof s=="object"&&(s.autoUnfold||s.disableFold||s.keep)||n.state&&(n.state.unfolded=!1)})}updateRenderPointTag(){var n;const e=this.filterPointTag();if(this.setPointTagPosition(),this.TagContainerSvelte)this.TagContainerSvelte.$set({tags:e,state:this.state,temporaryState:this.temporaryState});else{const s=(n=this.five.getElement())==null?void 0:n.parentElement;if(!s)return console.error("updateRenderPlaneTag: tag2DContainer not found");this.TagContainerSvelte=new zm({target:s,props:{hooks:this.hooks,tags:e,state:this.state,temporaryState:this.temporaryState,mediaStore:this.mediaStore}})}}updateRenderPlaneTag(){[...this.filterPlaneTag(),...this.filter3DPointTag()].forEach(n=>{var s;if(n.tag3DContentSvelte){const{svelteApp:r,domContainer:a,initialNormal:l,currentNormal:c}=n.tag3DContentSvelte;if(r.$set({tag:n,hooks:this.hooks,state:this.state,temporaryState:this.temporaryState}),!l.equals(c)){const d=new M.Quaternion().setFromUnitVectors(l,c);a.css3DObject.setRotationFromQuaternion(d)}}else{if(((s=n.state)==null?void 0:s.visible)===!1)return;if(this.css3DRenderPlugin||(this.css3DRenderPlugin=nt(this.five)),n.pointType===fe.PointTag&&!n.normal)return console.error("updateRenderPlaneTag: \u4E09\u7EF4\u70B9\u6807\u7B7E\u7F3A\u5C11\u6CD5\u5411\u91CF\uFF01");const r=n.pointType===fe.PlaneTag?n.position:Ah(this.five.camera.position,De(n.position),De(n.normal)),a=n.pointType===fe.PlaneTag?Vs(n.position):De(n.normal),l=this.getTagConfig(n).tag3DConfig,c=this.css3DRenderPlugin.create3DDomContainer(r,l);if(!c)return;this.store.css3DRenderDisposer.set(n.id,c.dispose),n.tag3DContentSvelte={svelteApp:new tr({target:c.container,props:{tag:n,hooks:this.hooks,state:this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}}),domContainer:c,initialNormal:a,currentNormal:a}}}),this.checkPanelTag()}disposeAllCSS3DContainer(){for(const[e,n]of this.store.css3DRenderDisposer)n==null||n();this.store.css3DRenderDisposer=new Map}checkPanelTag(){this.tags.forEach(e=>{var n;e.dimensionType===Ae.Two&&e.pointType===fe.PointTag&&((n=e.tag3DContentSvelte)==null||n.domContainer.dispose(),e.tag3DContentSvelte=void 0)});for(const[e,n]of this.store.css3DRenderDisposer){const s=this.getTagById(e);(!s||s.dimensionType!==Ae.Three)&&(n==null||n(),this.store.css3DRenderDisposer.delete(e))}}}const Rm=(o,t)=>new ir(o,t);class Qn extends M.Object3D{constructor(e,n){var s;super();m(this,"originObject3D");m(this,"onRender");this.originObject3D=e,this.onRender=(s=n==null?void 0:n.onRender)!=null?s:()=>{}}get helperObject(){return this}render(){this.onRender()}show(){this.visible=!0,this.render()}hide(){this.visible=!1,this.render()}updatePosition(){this.position.copy(this.originObject3D.position)}updateQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}applyHelperScaleMatrix4(e,n){this.scale.applyMatrix4(e)}applyHelperQuaternion(e,n){this.applyQuaternion(e)}}class Om extends Qn{}class Hm extends Qn{}class Fm extends Qn{}class Gm extends Fm{}class Nm extends P.Group{constructor(e){super();m(this,"direction");this.direction=e||"x"}}class as extends P.Mesh{constructor(e,n,s){super(e,n);m(this,"direction");this.direction=s||"x"}}function Wm(o,t){const{offsetWidth:e,offsetHeight:n}=t,{top:s,left:r}=t.getBoundingClientRect();return Object.assign(new P.Vector2,{x:(o.x-r)/e*2-1,y:-(o.y-s)/n*2+1})}function Rn(o,t,e){if(!t||!e||!o)return;const n=Wm(t,e);if(Math.abs(n.x)===1||Math.abs(n.y)===1)return;const s=new P.Raycaster;return s.setFromCamera(n,o),s}function Xm(o,t){return!(Math.abs(o.x-t.x)>1e-5||Math.abs(o.y-t.y)>1e-5||Math.abs(o.z-t.z)>1e-5)}class ln extends Nm{constructor(e){var u;super(e.direction);m(this,"line");m(this,"arrow");m(this,"lineHeight",.4);m(this,"arrowHeight",.1);this.name="ArrowGroup";const n=new P.Color((u=e.color)!=null?u:16214315),s=new P.MeshBasicMaterial({color:n,depthTest:!1,opacity:1,transparent:!0,side:P.DoubleSide}),r=new P.ConeGeometry(.04,.1,32),a=new as(r,s.clone(),e.direction);a.name=`arrow-${e.direction}`,this.arrow=a;const l=.004,c=new P.CylinderGeometry(l,l,.4,32),d=new as(c,s.clone(),e.direction);d.name=`line-${e.direction}`,this.line=d,this.formatArrow(),this.formatLine(),this.add(this.arrow,this.line)}formatArrow(){this.arrow.geometry.translate(0,this.lineHeight+this.arrowHeight/2,0),this.direction==="x"?(this.arrow.geometry.rotateX(Math.PI/2),this.arrow.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.arrow.geometry.rotateX(Math.PI/2)}formatLine(){this.line.geometry.translate(0,this.lineHeight/2,0),this.direction==="x"?(this.line.geometry.rotateX(Math.PI/2),this.line.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.line.geometry.rotateX(Math.PI/2)}}const cn={X:15618642,Y:4765519,Z:4227839};class xe{static get X(){return new P.Color(cn.X).convertSRGBToLinear().clone()}static get Y(){return new P.Color(cn.Y).convertSRGBToLinear().clone()}static get Z(){return new P.Color(cn.Z).convertSRGBToLinear().clone()}}class Ym extends Om{constructor(e){super(e);m(this,"xArrow",new ln({direction:"x",color:xe.X}));m(this,"yArrow",new ln({direction:"y",color:xe.Y}));m(this,"zArrow",new ln({direction:"z",color:xe.Z}));this.add(this.xArrow),this.add(this.yArrow),this.add(this.zArrow)}show(){super.show(),this.xArrow.visible=!0,this.yArrow.visible=!0,this.zArrow.visible=!0}showDraggingHelper(e){this.xArrow.visible=e.includes("x"),this.yArrow.visible=e.includes("y"),this.zArrow.visible=e.includes("z")}dispose(){this.remove(this.xArrow,this.yArrow,this.zArrow)}}function Ye(o,t){return Um(document.createElement(t!=null?t:"div"),o)}function Um(o,t){if(!t)return o;for(const e in t)e&&t[e]&&(o.style[e]=t[e]);return o}function Vm(o){const t=Ye(j({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},o)),e=()=>{t.style.display!=="block"&&(!t.style.top||!t.style.left||(t.style.display="block"))};return{element:t,show:e,hide:()=>{t.style.display="none",t.style.top="",t.style.left=""},setLeftTop:(r,a)=>{t.style.left=r,t.style.top=a,e()}}}class Jm extends Hm{constructor(e,n){var s;super(e);m(this,"yzCircle",new dn({direction:"x",color:xe.X}));m(this,"xzCircle",new dn({direction:"y",color:xe.Y}));m(this,"xyCircle",new dn({direction:"z",color:xe.Z}));m(this,"xRingHelper",new un({direction:"x"}));m(this,"yRingHelper",new un({direction:"y"}));m(this,"zRingHelper",new un({direction:"z"}));m(this,"xAngleHelper",new hn({direction:"x",color:xe.X}));m(this,"yAngleHelper",new hn({direction:"y",color:xe.Y}));m(this,"zAngleHelper",new hn({direction:"z",color:xe.Z}));m(this,"angleTips");m(this,"container");n&&(this.container=n==null?void 0:n.container,this.angleTips=Vm({display:"none"}),(s=this.container)==null||s.appendChild(this.angleTips.element)),this.show()}updateAngleHelperQuaternion(){this.xAngleHelper.quaternion.copy(this.yzCircle.quaternion),this.yAngleHelper.quaternion.copy(this.xzCircle.quaternion),this.zAngleHelper.quaternion.copy(this.xyCircle.quaternion),this.xRingHelper.quaternion.copy(this.yzCircle.quaternion),this.yRingHelper.quaternion.copy(this.xzCircle.quaternion),this.zRingHelper.quaternion.copy(this.xyCircle.quaternion)}applyHelperQuaternion(e,n){this.yzCircle.applyQuaternion(e),this.xzCircle.applyQuaternion(e),this.xyCircle.applyQuaternion(e),this.xAngleHelper.baseAxes.applyQuaternion(e),this.yAngleHelper.baseAxes.applyQuaternion(e),this.zAngleHelper.baseAxes.applyQuaternion(e)}hide(){this.remove(this.yzCircle,this.xzCircle,this.xyCircle,this.xRingHelper,this.yRingHelper,this.zRingHelper,this.xAngleHelper,this.yAngleHelper,this.zAngleHelper)}show(){var e;this.add(this.xyCircle,this.xzCircle,this.yzCircle),this.remove(this.xRingHelper,this.yRingHelper,this.zRingHelper,this.xAngleHelper,this.yAngleHelper,this.zAngleHelper),(e=this.angleTips)==null||e.hide()}showDraggingHelper(e){var n;this.hide(),this.add(...this.filterRingHelper(e)),this.add(...this.filterAngleHelper(e)),(n=this.angleTips)==null||n.show()}dispose(){var e,n;this.remove(this.yzCircle,this.xzCircle,this.xyCircle,this.xRingHelper,this.yRingHelper,this.zRingHelper,this.xAngleHelper,this.yAngleHelper,this.zAngleHelper),(e=this.angleTips)!=null&&e.element&&((n=this.container)==null||n.removeChild(this.angleTips.element))}filterRingHelper(e){return[this.xRingHelper,this.yRingHelper,this.zRingHelper].filter(n=>e.includes(n.direction))}filterAngleHelper(e){return[this.xAngleHelper,this.yAngleHelper,this.zAngleHelper].filter(n=>e.includes(n.direction))}}class dn extends P.Mesh{constructor(e){var n;super();m(this,"direction");m(this,"gapAngle",.02);m(this,"geometry",new P.RingGeometry(.25,.3,20,8,this.gapAngle,Math.PI/2-this.gapAngle*2));this.material=new P.MeshBasicMaterial({opacity:.6,color:(n=e.color)!=null?n:16777215,transparent:!0,side:P.DoubleSide,depthTest:!1}),this.direction=e.direction,this.geometry.name=`RotateHelperCircleGeometry-${this.direction}`,this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}class un extends P.Group{constructor(e){super();m(this,"direction");this.direction=e.direction;const n=.015,s=new Array(8).fill(null).map((r,a)=>{const l=new P.RingGeometry(.25,.3,20,8,Math.PI/4*a+n,Math.PI/4-n*2),c=new P.MeshBasicMaterial({opacity:1,color:16777215,depthTest:!1,transparent:!0,side:P.DoubleSide}),d=new P.Mesh(l,c);return d.name=`AxesDashedRing-${this.direction}-${a}`,d});this.add(...s),this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}class hn extends P.Mesh{constructor(e){var s;super();m(this,"direction");m(this,"baseAxes");switch(e.direction){case"x":this.baseAxes=new P.Vector3(0,0,1);break;case"y":this.baseAxes=new P.Vector3(1,0,0);break;case"z":this.baseAxes=new P.Vector3(1,0,0);break}const n=.3+5e-4;this.geometry=new P.CircleGeometry(n,48,0,1e-4),this.material=new P.MeshBasicMaterial({opacity:.4,color:(s=e.color)!=null?s:16777215,depthTest:!1,transparent:!0,side:P.DoubleSide}),this.direction=e.direction,this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}function Zm(){const o=Ye({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=Ye({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=Ye({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"absolute",border:"1px solid rgba(255,255,255,0.4)"});o.appendChild(t),t.appendChild(e);const n="-4px",s={direction:"nesw",element:Me({cursor:"nesw-resize",left:n,bottom:n})},r={direction:"ns",element:Me({cursor:"ns-resize",bottom:n})},a={direction:"nwse",element:Me({cursor:"nwse-resize",right:n,bottom:n})},l={direction:"ew",element:Me({cursor:"ew-resize",right:n})},c={direction:"nesw",element:Me({cursor:"nesw-resize",right:n,top:n})},d={direction:"ns",element:Me({cursor:"ns-resize",top:n})},u={direction:"nwse",element:Me({cursor:"nwse-resize",left:n,top:n})},f={direction:"ew",element:Me({cursor:"ew-resize",left:n})};return new Array(r,l,d,f,s,a,c,u).forEach(p=>t.appendChild(p.element)),{container:o,squares:[s,r,a,l,c,d,u,f]}}function Me(o){const t=Ye(j({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},o)),e=Ye({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),n=Ye({width:"15px",height:"15px",cursor:o==null?void 0:o.cursor,pointerEvents:"auto",background:"transparent"});return n.draggable=!0,e.appendChild(n),t.appendChild(e),t}class qm extends Gm{constructor(e,n,s,r){super(e);m(this,"points",[]);m(this,"cornerPositions",[]);m(this,"css3DInstance");m(this,"plane");m(this,"css3DRenderer",new As);m(this,"camera");m(this,"scene");m(this,"container");m(this,"enabled",!1);this.camera=s,this.scene=r,this.container=n,this.initRectangleScaleHelper()}get helperObject(){var e;if(!((e=this.css3DInstance)!=null&&e.css3DObject))throw new Error("css3DInstance is not initialized");return this.css3DInstance.css3DObject}updatePosition(){var e;this.helperObject.position.copy(this.originObject3D.position),(e=this.plane)==null||e.position.copy(this.originObject3D.position)}updateQuaternion(){var e;(e=this.plane)==null||e.quaternion.copy(this.originObject3D.quaternion)}applyMatrix4(e){var n;super.applyMatrix4(e),this.helperObject.applyMatrix4(e),(n=this.plane)==null||n.applyMatrix4(e),this.cornerPositions.forEach(s=>s.applyMatrix4(e))}showDraggingHelper(){}applyHelperScaleMatrix4(e,n){var s;(s=this.plane)==null||s.scale.applyMatrix4(e),this.helperObject.applyScaleMatrix4(e)}updatePoints(){const e=this.calculatePointPosition(this.cornerPositions);this.points.forEach((n,s)=>{n.position.copy(e[s])})}applyHelperQuaternion(e,n){var r;const s=(r=this.css3DInstance)==null?void 0:r.css3DObject;if(s){const a=new P.Vector3().subVectors(s.position,n).applyQuaternion(e).add(n);s.position.copy(a),s.applyQuaternion(e)}if(this.plane){const a=new P.Vector3().subVectors(this.plane.position,n).applyQuaternion(e).add(n);this.plane.position.copy(a),this.plane.applyQuaternion(e)}this.cornerPositions.forEach(a=>{const l=new P.Vector3().subVectors(a,n).applyQuaternion(e).add(n);a.copy(l)})}enable(){var e;this.enabled||(this.enabled=!0,(e=this.css3DInstance)==null||e.enable(),this.plane&&this.scene.add(this.plane))}disable(){var e;!this.enabled||(this.enabled=!1,(e=this.css3DInstance)==null||e.disable(),this.plane&&this.scene.remove(this.plane))}show(){var e;(e=this.css3DInstance)==null||e.show(),this.plane&&(this.plane.visible=!0)}hide(){var e;(e=this.css3DInstance)==null||e.hide(),this.plane&&(this.plane.visible=!1)}dispose(){this.disable(),this.css3DRenderer.dispose()}initRectangleScaleHelper(){var u;const e=this.getCornerPositions();if(!e)return;this.cornerPositions=e;const n=this.css3DRenderer.create3DElement(this.camera,e,{ratio:.003});if(!n)return;this.css3DInstance=n,n.appendToElement(this.container);const s=n.css3DObject.container,{container:r,squares:a}=Zm();this.points=a.map((f,h)=>({direction:f.direction,point:f.element,position:this.calculatePointPosition(e)[h]})),s.insertBefore(r,(u=s.children[0])!=null?u:null);const l=new P.PlaneGeometry(n.css3DObject.width,n.css3DObject.height),c=new P.MeshBasicMaterial({color:0,opacity:.15,transparent:!0,side:P.DoubleSide}),d=new P.Mesh(l,c);this.scene.add(d),this.updatePosition()}getCornerPositions(){const{originObject3D:e}=this;if(e instanceof Mt.CSS3DObject){if(e.isCSS3DObjectPlus)return e.cornerPoints;console.error("\u6682\u65F6\u53EA\u652F\u6301 CSS3DRenderPlugin \u751F\u6210\u7684\u7269\u4F53")}else console.error("\u5F53\u524D\u7269\u4F53\u6682\u65F6\u4E0D\u652F\u6301 ScaleHelper")}calculatePointPosition(e){return[e[0].clone(),e[0].clone().add(e[1]).divideScalar(2),e[1].clone(),e[1].clone().add(e[2]).divideScalar(2),e[2].clone(),e[2].clone().add(e[3]).divideScalar(2),e[3].clone(),e[3].clone().add(e[0]).divideScalar(2)]}}new P.Vector3;function q(o,t){this._camera=o||null,this._domElement=t||document,this._raycaster=new P.Raycaster,this._selected=null,this._boundObjs={};var e=this;this._$onClick=function(){e._onClick.apply(e,arguments)},this._$onDblClick=function(){e._onDblClick.apply(e,arguments)},this._$onMouseMove=function(){e._onMouseMove.apply(e,arguments)},this._$onMouseDown=function(){e._onMouseDown.apply(e,arguments)},this._$onMouseUp=function(){e._onMouseUp.apply(e,arguments)},this._$onTouchMove=function(){e._onTouchMove.apply(e,arguments)},this._$onTouchStart=function(){e._onTouchStart.apply(e,arguments)},this._$onTouchEnd=function(){e._onTouchEnd.apply(e,arguments)},this._$onContextmenu=function(){e._onContextmenu.apply(e,arguments)},this._domElement.addEventListener("click",this._$onClick,!1),this._domElement.addEventListener("dblclick",this._$onDblClick,!1),this._domElement.addEventListener("mousemove",this._$onMouseMove,!1),this._domElement.addEventListener("mousedown",this._$onMouseDown,!1),this._domElement.addEventListener("mouseup",this._$onMouseUp,!1),this._domElement.addEventListener("touchmove",this._$onTouchMove,!1),this._domElement.addEventListener("touchstart",this._$onTouchStart,!1),this._domElement.addEventListener("touchend",this._$onTouchEnd,!1),this._domElement.addEventListener("contextmenu",this._$onContextmenu,!1)}q.prototype.destroy=function(){this._domElement.removeEventListener("click",this._$onClick,!1),this._domElement.removeEventListener("dblclick",this._$onDblClick,!1),this._domElement.removeEventListener("mousemove",this._$onMouseMove,!1),this._domElement.removeEventListener("mousedown",this._$onMouseDown,!1),this._domElement.removeEventListener("mouseup",this._$onMouseUp,!1),this._domElement.removeEventListener("touchmove",this._$onTouchMove,!1),this._domElement.removeEventListener("touchstart",this._$onTouchStart,!1),this._domElement.removeEventListener("touchend",this._$onTouchEnd,!1),this._domElement.removeEventListener("contextmenu",this._$onContextmenu,!1)};q.eventNames=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu","touchstart","touchend"];q.prototype._getRelativeMouseXY=function(o){var t=o.target||o.srcElement;t.nodeType===3&&(t=t.parentNode);var e={x:0,y:0},n=t,s=getComputedStyle(n,null);e.y+=parseInt(s.getPropertyValue("padding-top"),10),e.x+=parseInt(s.getPropertyValue("padding-left"),10);do e.x+=n.offsetLeft,e.y+=n.offsetTop,s=getComputedStyle(n,null),e.x+=parseInt(s.getPropertyValue("border-left-width"),10),e.y+=parseInt(s.getPropertyValue("border-top-width"),10);while(n=n.offsetParent);var r={width:t===window?window.innerWidth:t.offsetWidth,height:t===window?window.innerHeight:t.offsetHeight};return{x:Number((o.pageX-e.x)/r.width)*2-1,y:-((o.pageY-e.y)/r.height)*2+1}};q.prototype._objectCtxInit=function(o){o._3xDomEvent={}};q.prototype._objectCtxDeinit=function(o){delete o._3xDomEvent};q.prototype._objectCtxIsInit=function(o){return!!o._3xDomEvent};q.prototype._objectCtxGet=function(o){return o._3xDomEvent};q.prototype.camera=function(o){return o&&(this._camera=o),this._camera};q.prototype.bind=function(o,t,e,n){console.assert(q.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(o)||this._objectCtxInit(o);var s=this._objectCtxGet(o);s[t+"Handlers"]||(s[t+"Handlers"]=[]),s[t+"Handlers"].push({callback:e,useCapture:n}),this._boundObjs[t]===void 0&&(this._boundObjs[t]=[]),this._boundObjs[t].push(o)};q.prototype.addEventListener=q.prototype.bind;q.prototype.unbind=function(o,t,e,n){console.assert(q.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(o)||this._objectCtxInit(o);var s=this._objectCtxGet(o);s[t+"Handlers"]||(s[t+"Handlers"]=[]);for(var r=s[t+"Handlers"],a=0;a<r.length;a++){var l=r[a];if(e==l.callback&&n==l.useCapture){r.splice(a,1);break}}var c=this._boundObjs[t].indexOf(o);console.assert(c!==-1),this._boundObjs[t].splice(c,1)};q.prototype.removeEventListener=q.prototype.unbind;q.prototype._bound=function(o,t){var e=this._objectCtxGet(t);return e?!!e[o+"Handlers"]:!1};q.prototype._onMove=function(o,t,e,n){var s=this._boundObjs[o];if(!(s===void 0||s.length===0)){var r=new P.Vector2;r.set(t,e),this._raycaster.setFromCamera(r,this._camera);var a=this._raycaster.intersectObjects(s),l=this._selected;if(a.length>0){var c,d,u,f=a[0],h=f.object;this._selected=h,u=this._bound("mousemove",h),l!=h&&(c=this._bound("mouseover",h),d=l&&this._bound("mouseout",l))}else d=l&&this._bound("mouseout",l),this._selected=null;u&&this._notify("mousemove",h,n,f),c&&this._notify("mouseover",h,n,f),d&&this._notify("mouseout",l,n,f)}};q.prototype._onEvent=function(o,t,e,n){var s=this._boundObjs[o];if(!(s===void 0||s.length===0)){var r=new P.Vector2;r.set(t,e),this._raycaster.setFromCamera(r,this._camera);var a=this._raycaster.intersectObjects(s,!0);if(a.length!==0){for(var l=a[0],c=l.object,d=this._objectCtxGet(c),u=c.parent;typeof d=="undefined"&&u;)d=this._objectCtxGet(u),u=u.parent;!d||this._notify(o,c,n,l)}}};q.prototype._notify=function(o,t,e,n){var s=this._objectCtxGet(t),r=s?s[o+"Handlers"]:null;if(console.assert(arguments.length===4),!s||!r||r.length===0){t.parent&&this._notify(o,t.parent,e,n);return}for(var r=s[o+"Handlers"],a=0;a<r.length;a++){var l=r[a],c=!0;l.callback({type:o,target:t,origDomEvent:e,intersect:n,stopPropagation:function(){c=!1}}),!!c&&l.useCapture===!1&&t.parent&&this._notify(o,t.parent,e,n)}};q.prototype._onMouseDown=function(o){return this._onMouseEvent("mousedown",o)};q.prototype._onMouseUp=function(o){return this._onMouseEvent("mouseup",o)};q.prototype._onMouseEvent=function(o,t){var e=this._getRelativeMouseXY(t);this._onEvent(o,e.x,e.y,t)};q.prototype._onMouseMove=function(o){var t=this._getRelativeMouseXY(o);this._onMove("mousemove",t.x,t.y,o),this._onMove("mouseover",t.x,t.y,o),this._onMove("mouseout",t.x,t.y,o)};q.prototype._onClick=function(o){this._onMouseEvent("click",o)};q.prototype._onDblClick=function(o){this._onMouseEvent("dblclick",o)};q.prototype._onContextmenu=function(o){this._onMouseEvent("contextmenu",o)};q.prototype._onTouchStart=function(o){return this._onTouchEvent("touchstart",o)};q.prototype._onTouchEnd=function(o){return this._onTouchEvent("touchend",o)};q.prototype._onTouchMove=function(o){if(o.touches.length==1){o.preventDefault();var t=Number(o.touches[0].pageX/window.innerWidth)*2-1,e=-(o.touches[0].pageY/window.innerHeight)*2+1;this._onMove("mousemove",t,e,o),this._onMove("mouseover",t,e,o),this._onMove("mouseout",t,e,o)}};q.prototype._onTouchEvent=function(o,t){if(t.touches.length==1){t.preventDefault();var e=Number(t.touches[0].pageX/window.innerWidth)*2-1,n=-(t.touches[0].pageY/window.innerHeight)*2+1;this._onEvent(o,e,n,t)}};let Fe=null;class On{constructor(t,e,n,s,r,a,l){m(this,"hooks",new ht);m(this,"helperObject3D");m(this,"originObject3D");m(this,"camera");m(this,"model");m(this,"scene");m(this,"container");m(this,"domEvents");m(this,"isDragging",!1);m(this,"onRender");m(this,"enabled",!1);m(this,"onWantsTapGesture",t=>{if(this.getIntersectObject(t))return!1});this.camera=t,this.model=e,this.originObject3D=n,this.helperObject3D=s,this.container=r,this.scene=a,this.domEvents=new q(t,r),this.onRender=l!=null?l:()=>{},this.initialHelperPosition(),this.initialHelperQuaternion(),this.enable()}initialHelperPosition(){this.helperObject3D.updatePosition()}initialHelperQuaternion(){this.helperObject3D.updateQuaternion()}enable(){this.enabled||(this.enabled=!0,this.scene.add(this.helperObject3D),this.render())}disable(){!this.enabled||(this.enabled=!1,this.scene.remove(this.helperObject3D),this.render())}show(){this.helperObject3D.show(),this.render()}hide(){this.helperObject3D.hide(),this.render()}dispose(){this.helperObject3D.dispose(),this.scene.remove(this.helperObject3D),this.render()}setOpacity(t){this.setOriginOpacityProperty();const e=this.originObject3D;if(e instanceof P.Mesh&&(e.material.opacity=t),e.isCSS3DObjectPlus){const n=e;n.container.style.opacity=t.toString()}this.render()}restoreOpacity(){if(Fe===null)return;const t=this.originObject3D;if(t instanceof P.Mesh&&(t.material.opacity=Fe.opacity),t.isCSS3DObjectPlus){const e=t;e.container.style.opacity=Fe.opacity.toString()}this.render()}setOriginOpacityProperty(){var t,e;if(Fe===null){const n=this.originObject3D;n instanceof P.Mesh&&(Fe={opacity:n.material.opacity}),n instanceof ps&&(Fe={opacity:(t=n.container.style.opacity)!=null?t:1}),n.isCSS3DObjectPlus&&(Fe={opacity:Number((e=n.container.style.opacity)!=null?e:1)})}}updateHelperPosition(){this.helperObject3D.updatePosition()}updateHelperQuaternion(){this.helperObject3D.updateQuaternion()}applyHelperMatrix4(t){this.helperObject3D.applyMatrix4(t)}applyHelperQuaternion(t,e){this.helperObject3D.applyHelperQuaternion(t,e)}applyHelperScaleMatrix4(t,e){this.helperObject3D.applyHelperScaleMatrix4(t,e)}onWantsGesture(t,e,n){if(this.isDragging)return!1}render(){this.onRender()}hoverListener(t,e=16777215,n=1){const s=(Array.isArray(t)?t:[t]).filter(Ue),r=[];for(const a of s)if(a instanceof P.Mesh||a instanceof P.Group){const l=a instanceof P.Group?a.children.filter(h=>h instanceof P.Mesh):[a];l.forEach(h=>{h.__originalColor__=h.material.color.clone(),h.__originalOpacity__=h.material.opacity});const c=()=>{l.forEach(h=>{h.material.color.set(e),h.material.opacity=n}),this.render()},d=()=>{l.forEach(h=>{h.material.color.copy(h.__originalColor__),h.material.opacity=h.__originalOpacity__}),this.render()},u=()=>{this.isDragging||c()},f=()=>{this.isDragging||d()};for(const h of l)this.domEvents.addEventListener(h,"mouseover",u),this.domEvents.addEventListener(h,"mouseout",f),this.hooks.on("moveStart",c),this.hooks.on("moveEnd",d),this.hooks.on("rotateEnd",d),r.push(()=>{this.domEvents.removeEventListener(h,"mouseover",u),this.domEvents.removeEventListener(h,"mouseout",f),this.hooks.off("moveStart",c),this.hooks.off("moveEnd",d),this.hooks.off("rotateEnd",d)})}return()=>r.forEach(a=>a==null?void 0:a())}getIntersectObject(t){const e=this.camera.position,n=this.helperObject3D;if(!n)return;let s;const r=t.intersectObject(n,!0)[0];if(!!r&&(s=r,s.object=n,!!s)){if(this.model.intersectRaycaster){const a=this.model.intersectRaycaster(t)[0];if(a&&a.point.distanceTo(e)<s.point.distanceTo(e))return}return s.object}}}class Km extends On{constructor(...e){super(...e);m(this,"startInfo");const n=this.helperObject3D;this.hoverListener([n.xArrow,n.yArrow,n.zArrow]);const s=this.dragStart.bind(this),r=this.dragging.bind(this),a=this.dragEnd.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",s),document.addEventListener("mousemove",r),document.addEventListener("mouseup",a)}dragStart(e){if(this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const s=(n==null?void 0:n.object).direction;if(!s)return this.dragEnd();const r=new P.Vector3(1,0,0).applyQuaternion(this.helperObject3D.quaternion),a=new P.Vector3(0,1,0).applyQuaternion(this.helperObject3D.quaternion),l=new P.Vector3(0,0,1).applyQuaternion(this.helperObject3D.quaternion),c=(()=>{switch(s){case"x":return r;case"y":return a;case"z":return l}})(),d=(()=>{switch(s){case"x":case"y":return l;case"z":return r}})(),u=n.point.clone(),f=new P.Plane;f.setFromNormalAndCoplanarPoint(d,u),this.startInfo={startVectorProject:u.clone().projectOnVector(c),directionVector:c,plane:f},this.helperObject3D.showDraggingHelper([s]),this.hooks.emit("moveStart"),this.isDragging=!0,console.log("%c MoveController dragStart","color: #e5af2e")}dragging(e){if(!this.isDragging||!this.startInfo)return;const n=Rn(this.camera,e,this.container);return n?(console.log("%c RotateController dragging","color: #49de1b"),this.move(n),!1):this.dragEnd()}move(e){if(!this.startInfo)return this.dragEnd();const{plane:n,directionVector:s,startVectorProject:r}=this.startInfo,a=this.originObject3D,l=e.ray.intersectPlane(n,new P.Vector3);if(!l)return;const c=l.clone().projectOnVector(s),d=c.clone().sub(r),u=new P.Matrix4;u.setPosition(d),a.applyMatrix4(u),this.helperObject3D.applyMatrix4(u),r.copy(c),this.hooks.emit("positionUpdate",{matrix4:u})}dragEnd(){!this.isDragging||(console.log("%c MoveController dragEnd","color: #e94e4e"),this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("moveEnd"))}}class fn{constructor(t,e,n,s){m(this,"helperController");m(this,"five");m(this,"onFiveWantsTapGesture",t=>{if(!this.helperController)return;const e=this.helperController.onWantsTapGesture(t);return this.five.needsRender=!0,e});m(this,"onFiveWantsGesture",(...t)=>{if(!this.helperController)return;const e=this.helperController.onWantsGesture(...t);return this.five.needsRender=!0,e});const{camera:r,model:a,scene:l}=t,c=t.getElement();if(this.five=t,!r||!a||!c||!l)return;const d=()=>{t.needsRender=!0};this.helperController=new e(r,a,n,s,c,l,d),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsGesture",this.onFiveWantsGesture)}}const $m="v1.0.1",ep="Object3DHelper",Hn=`${ep}@${$m}`,tp=()=>{console.error(`${Hn} is disposed`)},np=()=>{console.warn(`${Hn} is disabled`)},ip=()=>{console.error(`${Hn} is disabled`)};class op{constructor(t,e){m(this,"controllers",{});m(this,"state",{visible:!0,enabled:!0,disposed:!1});m(this,"hooks",new ht);m(this,"helpers");m(this,"eventListener",{});m(this,"handlePositionUpdate",(t,...e)=>{var r,a,l,c;const[n]=e,s=n==null?void 0:n.matrix4;s&&(t!==this.controllers.moveController&&((r=this.controllers.moveController)==null||r.applyHelperMatrix4(s)),t!==this.controllers.rotateController&&((a=this.controllers.rotateController)==null||a.applyHelperMatrix4(s)),t!==this.controllers.scaleController&&((l=this.controllers.scaleController)==null||l.applyHelperMatrix4(s)),(c=this.helpers.outlineHelper)==null||c.applyMatrix4(s))});m(this,"handleScaleUpdate",(t,...e)=>{var r,a;const[n]=e,s=n==null?void 0:n.matrix4;s&&((r=this.controllers.scaleController)==null||r.applyHelperScaleMatrix4(s,n),(a=this.helpers.outlineHelper)==null||a.scale.applyMatrix4(s))});m(this,"handleRotateUpdate",(t,...e)=>{var s,r,a,l;const[n]=e;if(n){const{quaternion:c,origin:d}=n;c&&(t!==this.controllers.moveController&&((s=this.controllers.moveController)==null||s.applyHelperQuaternion(c,d)),t!==this.controllers.rotateController&&((r=this.controllers.rotateController)==null||r.applyHelperQuaternion(c,d)),t!==this.controllers.scaleController&&((a=this.controllers.scaleController)==null||a.applyHelperQuaternion(c,d)),(l=this.helpers.outlineHelper)==null||l.applyQuaternion(c))}});t&&this.addControllers(t),this.helpers=e!=null?e:{},this.setState(this.state)}show(t){return F(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return F(this,null,function*(){this.setState({visible:!1},t)})}enable(t){this.setState({enabled:!0},t)}disable(t){this.setState({enabled:!1},t)}dispose(){this.setState({disposed:!0})}setState(t,e){if(this.state.disposed)return tp();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return ip();const n=j({},this.state);this.state=j(j({},this.state),t),t.disposed!==void 0&&t.disposed!==n.disposed&&t.disposed&&this.handleDispose(),t.visible!==void 0&&this.handleVisible(t.visible),t.enabled!==void 0&&this.handleEnable(t.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:n})}addControllers(t){this.controllers=j(j({},this.controllers),t),this.addEventListener(),this.setState(this.state)}addHelpers(t){this.helpers=j(j({},this.helpers),t)}getCurrentState(){return this.state}addEventListener(){for(const t in this.controllers){if(!t)continue;const e=t;this.eventListener[e]||(this.eventListener[e]=(()=>{const n=this.controllers[e];if(!n)return;const s=()=>this.handleStart(n),r=()=>this.handleEnd(n),a=(...d)=>this.handlePositionUpdate(n,...d),l=(...d)=>this.handleRotateUpdate(n,...d),c=(...d)=>this.handleScaleUpdate(n,...d);return n.hooks.on("moveStart",s),n.hooks.on("rotateStart",s),n.hooks.on("scaleStart",s),n.hooks.on("positionUpdate",a),n.hooks.on("rotateUpdate",l),n.hooks.on("scaleUpdate",c),n.hooks.on("moveEnd",r),n.hooks.on("rotateEnd",r),n.hooks.on("scaleEnd",r),()=>{n.hooks.off("moveStart",s),n.hooks.off("rotateStart",s),n.hooks.off("scaleStart",s),n.hooks.off("positionUpdate",a),n.hooks.off("rotateUpdate",l),n.hooks.off("scaleUpdate",c),n.hooks.off("moveEnd",r),n.hooks.off("rotateEnd",r),n.hooks.off("scaleEnd",r)}})())}}handleEnd(t){t&&this.setOtherHelpersVisible(!0,t)}handleStart(t){t&&this.setOtherHelpersVisible(!1,t)}setOtherHelpersVisible(t,e){var n,s,r,a;t?((r=this.controllers.moveController)==null||r.helperObject3D.show(),(a=this.controllers.rotateController)==null||a.helperObject3D.show()):(e!==this.controllers.moveController&&((n=this.controllers.moveController)==null||n.helperObject3D.hide()),e!==this.controllers.rotateController&&((s=this.controllers.rotateController)==null||s.helperObject3D.hide()))}handleEnable(t,e=!0){t?(this.everyControllerDo(n=>{n.enable()}),this.hooks.emit("enable",{userAction:e})):(this.everyControllerDo(n=>{n.disable(),n.restoreOpacity()}),this.hooks.emit("disable",{userAction:e})),this.state.enabled=t}handleVisible(t,e=!0){t?(this.everyControllerDo(n=>{n.show()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:e}))):(this.everyControllerDo(n=>{n.hide(),n.restoreOpacity()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:e}))),this.state.visible=t}everyControllerDo(t){Object.values(this.controllers).forEach(e=>{e&&t(e)})}handleDispose(){var t,e;Object.values(this.controllers).forEach(n=>{n==null||n.dispose(),n==null||n.restoreOpacity()});for(const n in this.controllers){if(!n)continue;const s=n;(e=(t=this.eventListener)[s])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&np()}}class sp extends On{constructor(...e){super(...e);m(this,"startInfo");m(this,"lastRotation");m(this,"rotations",[]);m(this,"helperObject3DQuaternion",this.originObject3D.quaternion.clone());const n=this.helperObject3D;this.hoverListener([n.xyCircle,n.xzCircle,n.yzCircle]);const s=this.dragStart.bind(this),r=this.dragging.bind(this),a=this.dragEnd.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",s),document.addEventListener("mousemove",r),document.addEventListener("mouseup",a)}initialHelperQuaternion(){this.helperObject3D.updateAngleHelperQuaternion(),this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion)}dragStart(e){if(this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const s=(n==null?void 0:n.object).direction;if(!s)return this.dragEnd();this.helperObject3D.updateAngleHelperQuaternion();const r=n.point,a=this.originObject3D.position.clone(),l=this.getAngleHelper(s);this.setTipsAngle(0);const c=r.clone();c.y+=.2,this.setTipsPosition(c);const d=new P.Vector3(1,0,0).applyQuaternion(this.helperObject3DQuaternion),u=new P.Vector3(0,1,0).applyQuaternion(this.helperObject3DQuaternion),f=new P.Vector3(0,0,1).applyQuaternion(this.helperObject3DQuaternion),h=(()=>{switch(s){case"x":return d;case"y":return u;case"z":return f}})(),p=new P.Plane().setFromNormalAndCoplanarPoint(h,r),g=new P.Vector3;p.projectPoint(r.clone(),g);const A=g.clone().sub(a),b=A.clone(),v=A.angleTo(l.baseAxes);this.setAngleHelperStart(s,v),this.setAngleHelperLength(s,0),this.rotations.push({vector:A.clone(),direction:!0}),this.startInfo={direction:s,startVector:A,staticStartVector:b,plane:p,angleHelper:l},this.helperObject3D.showDraggingHelper([s]),this.hooks.emit("rotateStart"),this.isDragging=!0,console.log(`%c RotateController dragStart ${s}`,"color: #e5af2e")}dragging(e){var s;if(!this.isDragging)return;const n=Rn(this.camera,e,this.container);return n?(console.log(`%c RotateController dragging ${(s=this.startInfo)==null?void 0:s.direction}`,"color: #49de1b"),this.rotate(n),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:n,plane:s,angleHelper:r,staticStartVector:a,direction:l}=this.startInfo,c=this.originObject3D,d=e.ray.intersectPlane(s,new P.Vector3);if(!d)return;const u=c.position.clone(),f=new P.Vector3;s.projectPoint(d.clone(),f);const h=f.clone().sub(u);if(n.angleTo(h)===0||(this.lastRotation===void 0&&(this.lastRotation={angle:0}),this.rotations.length===0))return;const p=(()=>{if(this.rotations.length===1)return h.angleTo(r.baseAxes)>a.angleTo(r.baseAxes);{const A=this.rotations[this.rotations.length-1],b=this.rotations[this.rotations.length-2],v=h.angleTo(b.vector),w=h.angleTo(A.vector),y=A.vector.angleTo(b.vector);if(y===0||w===0||v===0)return;if(v>w&&v>y)return A.direction;if(v<y&&w<y||v<w&&w>y)return!A.direction}})();if(p===void 0)return console.warn("rotationDirection is undefined");this.rotations.push({vector:h,direction:p}),this.rotations=this.rotations.slice(-2),this.lastRotation.angle=this.lastRotation.angle+h.angleTo(n)*(p?1:-1),this.setAngleHelperLength(l,this.lastRotation.angle),this.setTipsAngle(this.lastRotation.angle/Math.PI*180);const g=new P.Quaternion().setFromUnitVectors(n.clone().normalize(),h.clone().normalize());c.applyQuaternion(g),this.helperObject3D.applyHelperQuaternion(g),this.helperObject3DQuaternion.premultiply(g),this.hooks.emit("rotateUpdate",{quaternion:g,origin:u}),this.startInfo.startVector=h}dragEnd(){!this.isDragging||(console.log("%c RotateController dragEnd","color: #e94e4e"),this.startInfo=void 0,this.isDragging=!1,this.lastRotation=void 0,this.rotations=[],this.helperObject3D.show(),this.hooks.emit("rotateEnd"))}getAngleHelper(e){switch(e){case"x":return this.helperObject3D.xAngleHelper;case"y":return this.helperObject3D.yAngleHelper;case"z":return this.helperObject3D.zAngleHelper}}setAngleHelperStart(e,n){const s=this.getAngleHelper(e);if(s instanceof P.Mesh&&s.geometry instanceof P.CircleGeometry){const{radius:r,segments:a,thetaLength:l}=s.geometry.parameters;s.geometry=new P.CircleGeometry(r,a,n,l)}else console.warn("only support THREE.CircleGeometry")}setAngleHelperLength(e,n){const r=n>=0?Math.max(n,.001):Math.min(n,-.001),a=this.getAngleHelper(e);if(a instanceof P.Mesh&&a.geometry instanceof P.CircleGeometry){const{radius:l,thetaStart:c}=a.geometry.parameters,d=Math.ceil(Math.abs(r)*(40/(2*Math.PI)));a.geometry=new P.CircleGeometry(l,d,c,r)}else console.warn("only support THREE.CircleGeometry")}setTipsAngle(e){var s;const n=(s=this.helperObject3D.angleTips)==null?void 0:s.element;!n||(n.innerText=`${e.toFixed(0)}\xB0`)}setTipsPosition(e){const n=this.helperObject3D.angleTips;if(!n)return;const s=e.project(this.camera),{x:r,y:a,z:l}=s;if(l>1)return;const c=(r+1)/2*100+"%",d=(-a+1)/2*100+"%";n.setLeftTop(c,d)}}class rp extends On{constructor(...e){super(...e);m(this,"startInfo")}enable(){this.helperObject3D.enable(),super.enable()}disable(){this.helperObject3D.disable(),super.disable()}show(){this.helperObject3D.show(),super.show()}hide(){this.helperObject3D.hide(),super.hide()}getDragPlane(){const e=new P.Plane,n=this.helperObject3D.cornerPositions;if(n.length!==0)return n.length<3?e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new M.Vector3),n[0]):e.setFromCoplanarPoints(n[0],n[1],n[2]),e}dragStart(e,n){var r,a;(a=(r=this.helperObject3D).updatePoints)==null||a.call(r);const s=this.getDragPlane();if(!s)return this.dragEnd();this.startInfo={startPoint:{position:n.position.clone(),direction:n.direction},plane:s},this.hooks.emit("scaleStart"),this.render(),this.isDragging=!0,console.log("%c RectangleScaleController dragStart","color: #e5af2e")}dragging(e){if(!this.isDragging)return;const n=Rn(this.camera,e,this.container);if(!n)return this.dragEnd();this.scale(n),console.log("%c RectangleScaleController dragging","color: #49de1b")}scale(e){var z,_;if(!this.startInfo)return;const n=this.originObject3D,{startPoint:s,plane:r}=this.startInfo,a=this.helperObject3D.cornerPositions;if(a.length<4)return this.dragEnd();const l=e.ray.intersectPlane(r,new M.Vector3);if(!l||Xm(l,this.camera.position))return;const c=new M.Vector3().addVectors(a[0],a[2]).divideScalar(2),{position:d,direction:u}=s,f=new M.Vector3().subVectors(a[1],a[0]),h=new M.Vector3().subVectors(a[3],a[0]),p=T=>{const H=new M.Vector3(0,0,0);if(!this.startInfo)return H;const E=(T==="ew"?f:h).clone(),S=d.clone().projectOnVector(E),L=l.clone().projectOnVector(E),B=c.clone().projectOnVector(E);if(L.equals(S))return H;if(T==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const Q=new M.Vector3().subVectors(L,B),O=Q.x<0&&E.x>=0,X=Q.y<0&&E.y>=0,Y=Q.z<0&&E.z>=0;this.startInfo.dragPointInCenterBottom=O||X||Y}if(T==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const Q=new M.Vector3().subVectors(L,B),O=Q.x<0&&E.x>=0,X=Q.y<0&&E.y>=0,Y=Q.z<0&&E.z>=0;this.startInfo.dragPointInCenterLeft=O||X||Y}const R=new M.Vector3().subVectors(L,S),G=R.length();return G>.3?(console.warn("offset.length() > 0.3, skipped",G),H):R},g=p("ew"),A=p("ns"),b=()=>{const T=g;this.helperObject3D.cornerPositions.forEach((H,E)=>{var S;(S=this.startInfo)!=null&&S.dragPointInCenterLeft?(E===0||E===3)&&H.add(T):(E===1||E===2)&&H.add(T)})},v=()=>{const T=A;this.helperObject3D.cornerPositions.forEach((H,E)=>{var S;(S=this.startInfo)!=null&&S.dragPointInCenterBottom?(E===0||E===1)&&H.add(T):(E===2||E===3)&&H.add(T)})};switch(u){case"ew":b();break;case"ns":v();break;case"nesw":case"nwse":b(),v()}const w=new M.Vector3().subVectors(a[1],a[0]).length()/f.length(),y=new M.Vector3().subVectors(a[3],a[0]).length()/h.length(),I=new M.Vector3(w,y,1),k=new P.Matrix4().scale(I);n.isCSS3DObjectPlus?n.applyScaleMatrix4(k):n.scale.applyMatrix4(k),s.position.copy(l);const C=new M.Vector3().addVectors(a[0],a[2]).divideScalar(2),D=new M.Vector3().subVectors(C,c),x=new P.Matrix4().setPosition(D);n.applyMatrix4(x),(z=this.helperObject3D.css3DInstance)==null||z.css3DObject.applyMatrix4(x),(_=this.helperObject3D.plane)==null||_.applyMatrix4(x),this.hooks.emit("scaleUpdate",{matrix4:k,helperOrigin:c}),this.hooks.emit("positionUpdate",{matrix4:x}),this.render()}dragEnd(){!this.isDragging||(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render(),console.log("%c RectangleScaleController dragEnd","color: #e94e4e"))}}class ap extends rp{constructor(...t){super(...t),this.addHTMLEventListener()}addHTMLEventListener(){this.helperObject3D.points.forEach(t=>{if(!t)return;const e=t.point,n=a=>this.dragStart(a,t),s=this.dragging.bind(this),r=this.dragEnd.bind(this);e.addEventListener("dragstart",n),e.addEventListener("drag",s),e.addEventListener("dragend",r)})}}const Fn="v1.0.0",Pn="Object3DHelperPlugin",Zt=`${Pn}@${Fn}`,lp=()=>{console.error(`${Zt} is disposed`)},cp=()=>{console.warn(`${Zt} is disabled`)},dp=()=>{console.error(`${Zt} is disabled`)};class or extends Xt{constructor(e){super(e);m(this,"version",Fn);m(this,"name",Pn);m(this,"state",{visible:!0,enabled:!0,disposed:!1});m(this,"objectHelperMap",new Map);this.five=e,console.warn("Object3DHelper: \u4F7F\u7528\u6B64\u63D2\u4EF6\u9700\u8981\u5728\u521D\u59CB\u5316five\u65F6\uFF0C\u8BBE\u7F6Efive\u53C2\u6570: { backgroundAlpha: 0, backgroundColor: 0x000000 }"),Object.assign(window,{[`__${Pn.toUpperCase()}_DEBUG__`]:this})}show(e){return F(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return F(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){if(this.state.disposed)return lp();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return dp();const s=j({},this.state);this.state=j(j({},this.state),e),e.disposed!==void 0&&e.disposed!==s.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:s})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,n={}){var u;if(!e)return console.error("Object3D is undefined");if(this.objectHelperMap.has(e)){console.warn(`Object3DHelperPlugin: object3D ${e.name} is already has helper`);return}const s=new op;this.objectHelperMap.set(e,s);const r=(u=this.five.getElement())==null?void 0:u.parentElement,a=this.five.camera,{moveHelper:l=!0,rotateHelper:c=!0,scaleHelper:d=!0}=n;if(l){const f=new Ym(e),h=new fn(this.five,Km,e,f);s.addControllers({moveController:h.helperController})}if(c){let f;r&&a&&(f={container:r});const h=new Jm(e,f),p=new fn(this.five,sp,e,h);s.addControllers({rotateController:p.helperController})}if(d&&r){const f=new qm(e,r,a,this.five.scene),h=new fn(this.five,ap,e,f);s.addControllers({scaleController:h.helperController})}e.isCSS3DObjectPlus&&e.changeMode("behind",this.five.scene)}removeObject3DHelper(e){const n=this.objectHelperMap.get(e);!n||(e.isCSS3DObjectPlus&&e.changeMode("front"),this.objectHelperMap.delete(e),n.dispose())}handleEnable(e,n=!0){e?(this.everyHelperDo(s=>s.enable()),this.hooks.emit("enable",{userAction:n})):(this.everyHelperDo(s=>s.disable()),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){e?(this.everyHelperDo(s=>s.show()),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.everyHelperDo(s=>s.hide()),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}handleDispose(){this.everyHelperDo(e=>e.dispose())}everyHelperDo(e){this.objectHelperMap.forEach(n=>{n&&e(n)})}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&cp()}}const up=o=>new or(o);class In{constructor(t=0,e=0){m(this,"min");m(this,"max");m(this,"isInterval",!0);this.min=t,this.max=e}fromArray(t){return this.min=t[0],this.max=t[1],this}isOverlap(t){return Math.min(this.max,t.max)<Math.max(this.min,t.min)}contains(t){return this.min<t.min&&this.max>t.max}}class hp{constructor(t,e){m(this,"min");m(this,"max");m(this,"xInterval");m(this,"yInterval");m(this,"isRectangle",!0);this.min=t,this.max=e,this.xInterval=new In(this.min.x,this.max.x),this.yInterval=new In(this.min.y,this.max.y)}isOverlapWithRectangle(t){return!this.xInterval.isOverlap(t.xInterval)&&!this.yInterval.isOverlap(t.yInterval)}containsRect(t){return this.xInterval.contains(t.xInterval)&&this.yInterval.contains(t.yInterval)}}function St(o,t,e){const n=o[t],s=o[e];!n||!s||(o[t]=s,o[e]=n)}function fp(o,t,e){const n=e/2;for(let s=1;s<=n;s++){const r=e-(s-1);for(let a=1;a<=t;a++){const l=(s-1)*t+a-1,c=(r-1)*t+a-1;St(o,l*4+0,c*4+0),St(o,l*4+1,c*4+1),St(o,l*4+2,c*4+2),St(o,l*4+3,c*4+3)}}}class sr{constructor(t,e){m(this,"width");m(this,"height");m(this,"containerDom");m(this,"hooks",new ee.Subscribe);m(this,"canvas",document.createElement("canvas"));m(this,"five");m(this,"scale");m(this,"config");m(this,"offset",{x:0,y:0});m(this,"context");m(this,"renderCenter",new P.Vector3);m(this,"hammer");m(this,"state",{enabled:!1});m(this,"onPan",t=>{if(!this.containerDom||this.hooks.emit("wantsPanGesture",t))return;const n=this.offset.x+t.deltaX,s=this.offset.y+t.deltaY;this.canvas.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)",this.canvas.style.transform=`translate3d(${n}px, ${s}px, 100px)`});m(this,"onPanEnd",t=>{this.offset={x:this.offset.x+t.deltaX,y:this.offset.y+t.deltaY},this.canvas.style.boxShadow="none"});var s,r,a;if(!t.renderer)throw new Error("Five Render \u672A\u521D\u59CB\u5316");this.five=t,this.scale=(s=e==null?void 0:e.scale)!=null?s:2,this.width=(r=e==null?void 0:e.width)!=null?r:190,this.height=(a=e==null?void 0:e.height)!=null?a:190,this.config={dragEnabled:(e==null?void 0:e.dragEnabled)||!1,autoFixPCPosition:(e==null?void 0:e.autoFixPCPosition)||!1,initialPosition:(e==null?void 0:e.initialPosition)||{left:"0",top:"0"}};const n=this.canvas.getContext("2d");if(!n)throw new Error("CANNOT CREATE CONTEXT2D");this.context=n,this.config.dragEnabled&&(this.hammer=new ut.default(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panend",this.onPanEnd)),this.initStyle()}dispose(){var t;this.clear(),this.disable(),(t=this.hammer)==null||t.destroy()}enable(){var t;if(!this.state.enabled)return this.state.enabled=!0,(t=this.containerDom)==null||t.append(this.canvas),this}disable(){if(!!this.state.enabled)return this.state.enabled=!1,this.canvas.remove(),this}appendTo(t){var e;return this.containerDom&&((e=this.containerDom)==null||e.removeChild(this.canvas)),this.containerDom=t,this.state.enabled&&t.append(this.canvas),this}clear(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this}renderWithPoint(t){!this.containerDom||!this.state.enabled||(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}autoFixPCPosition(){if(!this.containerDom)return;const{width:t,height:e}=this,n=this.renderCenter.clone().project(this.five.camera),s=(n.x+1)/2*this.containerDom.clientWidth,r=-(n.x-1)/2*this.containerDom.clientWidth,a=-(n.y-1)/2*this.containerDom.clientHeight;s<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=90+"px"):a<183?(this.canvas.style.top=90+"px",this.canvas.style.left=-t/2+"px"):r<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=-t-90+"px"):(this.canvas.style.left=-t/2+"px",this.canvas.style.top=-e-90+"px"),this.canvas.style.transform=`translate3d(${s}px, ${a}px, 10px)`,this.offset={x:s,y:a}}render(){if(!this.five.renderer||!this.containerDom)return;const{scale:t,context:e,width:n,height:s}=this,r=this.renderCenter.clone().project(this.five.camera),a=this.five.renderer.getSize(new P.Vector2),l=1,c=n/t,d=s/t,u=l*t,f=(r.x+1)/2*a.x,h=(r.y+1)/2*a.y,p=this.five.getPixels(f-c/2,h-c/2,c,d,u),g=Math.floor(n*l),A=Math.floor(s*l);fp(p,g,A);const b=new ImageData(g,A);b.data.set(p),e.putImageData(b,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}}function mp(o,t){const{offsetWidth:e,offsetHeight:n}=t,{top:s,left:r}=t.getBoundingClientRect();return new P.Vector2().set((o.x-r)/e*2-1,-(o.y-s)/n*2+1)}function rr(o,t){const{offsetWidth:e,offsetHeight:n}=t;return new P.Vector2().set(o.x/e*2-1,-o.y/n*2+1)}function pp(o,t){const e=o.getElement();if(!e)return;const n=rr(t,e),s=new P.Raycaster;return s.setFromCamera(n,o.camera),s}function gp(o,t){const{x:e,y:n}=t,s=e*2-1,r=n*2-1,a=new P.Vector2().fromArray([s,r]),l=new P.Raycaster;return l.setFromCamera(a,o.camera),o.model.intersectRaycaster(l)[0]}const Ap="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbYAAAGwCAYAAADFUEBtAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABtqADAAQAAAABAAABsAAAAABTZ8U6AAAtiklEQVR4Ae2dAXJbSbJdp+d7AfYSHOGVeAPek5fkNXgLjviLmRkZl+CRbtc8UBKRRalZpyIesiorMx/eIcjb+QCh//Y3hwQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSE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ABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQn8NQn8fyHnyuSABiy2AAAAAElFTkSuQmCC",vp=`
|
|
541
|
+
format('woff2')}.content__container.svelte-95x526{position:relative;left:50%;top:50%;transform:translate(-50%, -50%);font-family:PingFangSC, Segoe UI, Rototo, sans-serif}.content__container.unClickable.svelte-95x526{pointer-events:none !important}.content__container.unClickable.svelte-95x526 *{pointer-events:none !important}*{-webkit-tap-highlight-color:transparent}.content__wrapper.svelte-95x526{pointer-events:none;width:100%;height:100%}.withAnimation.svelte-95x526{transition:opacity 0.3s linear}.content__container.hide.svelte-95x526{opacity:0;pointer-events:none}.content__container.hide.svelte-95x526 *{pointer-events:none !important}.content__container.disable.svelte-95x526{display:none}.content__container.hide.svelte-95x526 *{pointer-events:none}.content.svelte-95x526{position:relative;width:100%;height:100%;font-size:0.75rem;line-height:1.125rem;color:#fff}.content.svelte-95x526:not(.unfolded){pointer-events:none}.content.svelte-95x526:not(.unfolded) *{pointer-events:none !important}.content.unfolded.svelte-95x526{pointer-events:auto}`)}function nm(o){let t,e;return t=new Wf({props:{tag:re(o[1])}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&2&&(r.tag=re(n[1])),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function im(o){let t,e;return t=new Zf({props:{tag:re(o[1])}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&2&&(r.tag=re(n[1])),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function om(o){let t,e;return t=new zf({props:{tag:re(o[1])}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&2&&(r.tag=re(n[1])),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function sm(o){let t,e;return t=new Hf({props:{tag:re(o[1])}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&2&&(r.tag=re(n[1])),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function rm(o){let t,e;return t=new Df({props:{tag:re(o[1])}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&2&&(r.tag=re(n[1])),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function am(o){let t,e;return t=new Gh({props:{tag:re(o[1])}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&2&&(r.tag=re(n[1])),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function lm(o){let t,e;return t=new em({props:{tag:re(o[1])}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&2&&(r.tag=re(n[1])),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function cm(o){let t,e,n,s,r,a,l,c,d;const u=[lm,am,rm,sm,om,im,nm],f=[];function h(p,g){return p[1].element?0:p[1].contentType===ge.Text?1:p[1].contentType===ge.ImageText?2:p[1].contentType===ge.Audio?3:p[1].contentType===ge.Marketing?4:p[1].contentType===ge.Link?5:p[1].contentType===ge.MediaPlane?6:-1}return~(s=h(o))&&(r=f[s]=u[s](o)),{c(){var p,g,A;t=i.element("div"),e=i.element("div"),n=i.element("div"),r&&r.c(),i.attr(n,"class","content svelte-95x526"),i.toggle_class(n,"unfolded",(p=o[1].state)==null?void 0:p.unfolded),i.attr(e,"class","content__wrapper svelte-95x526"),i.attr(t,"class","content__container svelte-95x526"),i.attr(t,"data-id",a=o[1].id),i.toggle_class(t,"disable",o[1].enabled===!1||((g=o[1].temporaryState)==null?void 0:g.visible)===!1),i.toggle_class(t,"hide",!o[3].visible||!o[3].enabled||!o[4].visible||!((A=o[1].state)!=null&&A.visible)),i.toggle_class(t,"withAnimation",o[0]),i.toggle_class(t,"unClickable",o[1].clickable===!1),i.set_style(t,"width",o[1].pointType==="PointTag"?0:"100%",!1),i.set_style(t,"height",o[1].pointType==="PointTag"?0:"100%",!1)},m(p,g){i.insert(p,t,g),i.append(t,e),i.append(e,n),~s&&f[s].m(n,null),l=!0,c||(d=i.listen(t,"click",i.stop_propagation(o[11])),c=!0)},p(p,[g]){var b,v,w;let A=s;s=h(p),s===A?~s&&f[s].p(p,g):(r&&(i.group_outros(),i.transition_out(f[A],1,1,()=>{f[A]=null}),i.check_outros()),~s?(r=f[s],r?r.p(p,g):(r=f[s]=u[s](p),r.c()),i.transition_in(r,1),r.m(n,null)):r=null),g&2&&i.toggle_class(n,"unfolded",(b=p[1].state)==null?void 0:b.unfolded),(!l||g&2&&a!==(a=p[1].id))&&i.attr(t,"data-id",a),g&2&&i.toggle_class(t,"disable",p[1].enabled===!1||((v=p[1].temporaryState)==null?void 0:v.visible)===!1),g&26&&i.toggle_class(t,"hide",!p[3].visible||!p[3].enabled||!p[4].visible||!((w=p[1].state)!=null&&w.visible)),g&1&&i.toggle_class(t,"withAnimation",p[0]),g&2&&i.toggle_class(t,"unClickable",p[1].clickable===!1),g&2&&i.set_style(t,"width",p[1].pointType==="PointTag"?0:"100%",!1),g&2&&i.set_style(t,"height",p[1].pointType==="PointTag"?0:"100%",!1)},i(p){l||(i.transition_in(r),l=!0)},o(p){i.transition_out(r),l=!1},d(p){p&&i.detach(t),~s&&f[s].d(),c=!1,d()}}}function dm(o,t,e){let n,s,r,a,{withAnimation:l=!1}=t,{tag:c}=t,{hooks:d}=t,{state:u}=t,{mediaStore:f}=t,{temporaryState:h}=t;Z.setContext("hooks",d),Z.setContext("mediaStore",f);let p,g;function A(v){v?d.emit("exposure",{id:a,type:"start"}):d.emit("exposure",{id:a,type:"end"})}const b=v=>d.emit("click",{event:v,target:"TagContent",tag:c});return o.$$set=v=>{"withAnimation"in v&&e(0,l=v.withAnimation),"tag"in v&&e(1,c=v.tag),"hooks"in v&&e(2,d=v.hooks),"state"in v&&e(3,u=v.state),"mediaStore"in v&&e(5,f=v.mediaStore),"temporaryState"in v&&e(4,h=v.temporaryState)},o.$$.update=()=>{var v,w;o.$$.dirty&2&&e(9,n=(v=c.state)==null?void 0:v.unfolded),o.$$.dirty&2&&e(8,s=(w=c.state)==null?void 0:w.visible),o.$$.dirty&280&&e(10,r=u.visible&&h.visible&&s),o.$$.dirty&2&&(a=c.id),o.$$.dirty&1024&&A(r),o.$$.dirty&962&&c.hooks&&(n!==void 0&&n!==g&&(e(7,g=n),n?c.hooks.emit("unfolded"):c.hooks.emit("folded")),s!==void 0&&s!==p&&(e(6,p=s),s?c.hooks.emit("show"):c.hooks.emit("hide")))},[l,c,d,u,h,f,p,g,s,n,r,b]}class tr extends i.SvelteComponent{constructor(t){super(),i.init(this,t,dm,cm,i.safe_not_equal,{withAnimation:0,tag:1,hooks:2,state:3,mediaStore:5,temporaryState:4},tm)}}function um(o){i.append_styles(o,"svelte-fuismw",".point.svelte-fuismw.svelte-fuismw{pointer-events:none;width:1.5rem;height:1.5rem}.small-point.svelte-fuismw.svelte-fuismw,.big-point.svelte-fuismw.svelte-fuismw{position:absolute;width:100%;height:100%;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:all 500ms}.big-point.svelte-fuismw.svelte-fuismw{background-color:rgba(0, 0, 0, 0.1)}.folded.point.svelte-fuismw.svelte-fuismw{animation:svelte-fuismw-breathing 2s linear infinite}.big-point.svelte-fuismw.svelte-fuismw::before,.big-point.svelte-fuismw.svelte-fuismw::after{content:'';display:block;position:absolute;background-size:contain;background-repeat:no-repeat;pointer-events:none}.big-point.svelte-fuismw.svelte-fuismw::before{width:100%;height:100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAMAAABiM0N1AAAAqFBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8j1z1tAAAAOHRSTlMABgoNFBsYIhEmHyksMoJ6RZ5aXzpnU03AtqaZjLuGN+zcifnW0cjEqnA+lOZzbWLhkH6i8rGuagnOwPMAAAQOSURBVFjDrZiHctpAEIYXYzvGOvXeUe+IYuD93ywrJAIhFJX8M8zoBHzz757utHvwTETJHJPfGQZfWJXILWCMPuqNbuu6vj+khrHjed40TWvFfQ2jvCl8nGha6lQCl7s07UqcUlfOZrOxVtKsN2a+0uJYK+ScEIqiFifhBSGSsnJ8f8u99cLMVnEUHTKXIOMX6vuk5gpphFYyhmHzHpzcDqNUJGgEER+oz5OaK8ShNcIdt+zx1ys7lhdqiDlRkPF+JaSdWIhasaz6lLPQ1qFDIwYpDeTr62veCS8bGLIQRSsVK78/5nDeOlYIYhovHeOtU0dDXw2KSGiKesQRyjJ10Q66QcyZMTvpTEMUumpMieyWvs9ZLZcmodAOYlorsysBflpjiEJTFBEY5+7sicul34T1iak5U25momN9Ya4wPCT57r8cteW0dk4YuKMTqjXVkgjciFr+8B3ngnmM6kii5X/efB0F+jUHnuiatLJY+Et84EnUNacfiaKZjQhX4oJAwPlqOB3mJaoh4dxxG5Nc3Q8DkywunP6kBalN53J7G3g0JqiNC3qpjQ7TRPvmn2U3L3/kU4JaTn/SKU0qb76dDf0kGNjHJbD+wX1gcMxO6fZVrzXUcQaROkvt3+pljIYugQ0LDi1ZBgeN9JK9MjTCkmgwgPou19I5QzBI5yy5RvqOw6xMMbKzoeGWmnQfBBwa6woj6wyNsYSx7R0chWuOwsjOqR6aboyNyvcpgOsl3ZzNhoNm3bztdAK1x5NuzmCwunkjjq4AEzKXFI1NUmVnwIfydJBoW7CPVAR1uR6XbVwlmgF2xF1yPTbbubYHLZamgyTNhiSmp4PoJIEk+R+gOAFb+x+hxRoctHw6iItsMLT/Mf3RHixbnP5AyhEPmZ1NB+E6A0V3pi9aPqyB6Pz0bSTxXID0kE/d2DgvxBFzEKdutdXawJGSMlM3/3Sd4fA93bnTXkfSuvwGFGOI016QbKm3VdbOn/bKjpd1e6Pg1SlFhPzjdXWNwjNTyprkhz33i4Wpji600FA5h05q4Ywv/bxge7mNRe7YYtQMwqt/kMLixpXHQhBwcCXBYukxBbvkBTv4S5V/HNNC6EF089tPxxGHNzV8sKTgRhSzVYa2Wf5yeadHphlWGdb4IUeEO5K2SHrUiqJuW9GiLFdwVzRbCXTf5tg11mvhYdufZbLUr11XEi/k4KHexUxWSY8DBCby7AU8E3eUhfzVkYZgR6H/agF8C3KNqCeHLIIRR7oEr0XXsixy9P1jH/doJLF2nPXbIlw5y1aC6t4eROW1pduaLs/7b6NEqFiWrWpBzaXuaOy4Nfe6bRfqGwzSXBJZhnF8y9oUhcnzOyM9pI7wCWP0LSkyy1iFWWwsFp8LeKLfd4doRyTLRacAAAAASUVORK5CYII=)}.folded.svelte-fuismw .big-point.svelte-fuismw::before{animation:svelte-fuismw-rotate 2s linear infinite}.big-point.svelte-fuismw.svelte-fuismw::after{position:absolute;width:1rem;height:1rem;background-image:var(--iconUrl)}.small-point.svelte-fuismw.svelte-fuismw::before{content:'';display:block;position:absolute;pointer-events:none;width:0.25rem;height:0.25rem;border-radius:100%;background-color:white}.folded.svelte-fuismw .big-point.svelte-fuismw{opacity:1;scale:1}.unfolded.svelte-fuismw .big-point.svelte-fuismw{opacity:0;scale:0}.folded.svelte-fuismw .small-point.svelte-fuismw{opacity:0;scale:6}.unfolded.svelte-fuismw .small-point.svelte-fuismw{opacity:1;scale:1}@keyframes svelte-fuismw-rotate{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}@keyframes svelte-fuismw-breathing{0%{transform:scale(1)}25%{transform:scale(0.9)}50%{transform:scale(1)}}")}function hm(o){let t,e,n,s,r,a,l;return e=new ve({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){t=i.element("div"),i.create_component(e.$$.fragment),n=i.space(),s=i.element("div"),r=i.space(),a=i.element("div"),i.attr(s,"class","small-point svelte-fuismw"),i.set_style(s,"transition-delay",o[3]?o[2]+"ms":"0ms",!1),i.attr(a,"class","big-point svelte-fuismw"),i.set_style(a,"--iconUrl","url("+o[1]+")"),i.set_style(a,"transition-delay",o[3]?o[2]+"ms":"0ms",!1),i.attr(t,"class","point svelte-fuismw"),i.toggle_class(t,"folded",o[3]),i.toggle_class(t,"unfolded",o[0])},m(c,d){i.insert(c,t,d),i.mount_component(e,t,null),i.append(t,n),i.append(t,s),i.append(t,r),i.append(t,a),l=!0},p(c,[d]){d&12&&i.set_style(s,"transition-delay",c[3]?c[2]+"ms":"0ms",!1),(!l||d&2)&&i.set_style(a,"--iconUrl","url("+c[1]+")"),d&12&&i.set_style(a,"transition-delay",c[3]?c[2]+"ms":"0ms",!1),d&8&&i.toggle_class(t,"folded",c[3]),d&1&&i.toggle_class(t,"unfolded",c[0])},i(c){l||(i.transition_in(e.$$.fragment,c),l=!0)},o(c){i.transition_out(e.$$.fragment,c),l=!1},d(c){c&&i.detach(t),i.destroy_component(e)}}}function fm(o,t,e){let n,{unfolded:s}=t,{iconUrl:r}=t,{foldDelay:a=800}=t;return o.$$set=l=>{"unfolded"in l&&e(0,s=l.unfolded),"iconUrl"in l&&e(1,r=l.iconUrl),"foldDelay"in l&&e(2,a=l.foldDelay)},o.$$.update=()=>{o.$$.dirty&1&&e(3,n=!s)},[s,r,a,n]}class mm extends i.SvelteComponent{constructor(t){super(),i.init(this,t,fm,hm,i.safe_not_equal,{unfolded:0,iconUrl:1,foldDelay:2},um)}}function pm(o){i.append_styles(o,"svelte-jzvcn0",".point.svelte-jzvcn0.svelte-jzvcn0{pointer-events:none;width:1rem;height:1rem}.small-point.svelte-jzvcn0.svelte-jzvcn0,.big-point.svelte-jzvcn0.svelte-jzvcn0{position:absolute;width:100%;height:100%;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:all 500ms}.big-point.svelte-jzvcn0.svelte-jzvcn0::before,.big-point.svelte-jzvcn0.svelte-jzvcn0::after{content:'';display:block;position:absolute;background-size:contain;background-repeat:no-repeat;pointer-events:none}.big-point.svelte-jzvcn0.svelte-jzvcn0::before{width:100%;height:100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEgAAABICAMAAABiM0N1AAAAqFBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8j1z1tAAAAOHRSTlMABgoNFBsYIhEmHyksMoJ6RZ5aXzpnU03AtqaZjLuGN+zcifnW0cjEqnA+lOZzbWLhkH6i8rGuagnOwPMAAAQOSURBVFjDrZiHctpAEIYXYzvGOvXeUe+IYuD93ywrJAIhFJX8M8zoBHzz757utHvwTETJHJPfGQZfWJXILWCMPuqNbuu6vj+khrHjed40TWvFfQ2jvCl8nGha6lQCl7s07UqcUlfOZrOxVtKsN2a+0uJYK+ScEIqiFifhBSGSsnJ8f8u99cLMVnEUHTKXIOMX6vuk5gpphFYyhmHzHpzcDqNUJGgEER+oz5OaK8ShNcIdt+zx1ys7lhdqiDlRkPF+JaSdWIhasaz6lLPQ1qFDIwYpDeTr62veCS8bGLIQRSsVK78/5nDeOlYIYhovHeOtU0dDXw2KSGiKesQRyjJ10Q66QcyZMTvpTEMUumpMieyWvs9ZLZcmodAOYlorsysBflpjiEJTFBEY5+7sicul34T1iak5U25momN9Ya4wPCT57r8cteW0dk4YuKMTqjXVkgjciFr+8B3ngnmM6kii5X/efB0F+jUHnuiatLJY+Et84EnUNacfiaKZjQhX4oJAwPlqOB3mJaoh4dxxG5Nc3Q8DkywunP6kBalN53J7G3g0JqiNC3qpjQ7TRPvmn2U3L3/kU4JaTn/SKU0qb76dDf0kGNjHJbD+wX1gcMxO6fZVrzXUcQaROkvt3+pljIYugQ0LDi1ZBgeN9JK9MjTCkmgwgPou19I5QzBI5yy5RvqOw6xMMbKzoeGWmnQfBBwa6woj6wyNsYSx7R0chWuOwsjOqR6aboyNyvcpgOsl3ZzNhoNm3bztdAK1x5NuzmCwunkjjq4AEzKXFI1NUmVnwIfydJBoW7CPVAR1uR6XbVwlmgF2xF1yPTbbubYHLZamgyTNhiSmp4PoJIEk+R+gOAFb+x+hxRoctHw6iItsMLT/Mf3RHixbnP5AyhEPmZ1NB+E6A0V3pi9aPqyB6Pz0bSTxXID0kE/d2DgvxBFzEKdutdXawJGSMlM3/3Sd4fA93bnTXkfSuvwGFGOI016QbKm3VdbOn/bKjpd1e6Pg1SlFhPzjdXWNwjNTyprkhz33i4Wpji600FA5h05q4Ywv/bxge7mNRe7YYtQMwqt/kMLixpXHQhBwcCXBYukxBbvkBTv4S5V/HNNC6EF089tPxxGHNzV8sKTgRhSzVYa2Wf5yeadHphlWGdb4IUeEO5K2SHrUiqJuW9GiLFdwVzRbCXTf5tg11mvhYdufZbLUr11XEi/k4KHexUxWSY8DBCby7AU8E3eUhfzVkYZgR6H/agF8C3KNqCeHLIIRR7oEr0XXsixy9P1jH/doJLF2nPXbIlw5y1aC6t4eROW1pduaLs/7b6NEqFiWrWpBzaXuaOy4Nfe6bRfqGwzSXBJZhnF8y9oUhcnzOyM9pI7wCWP0LSkyy1iFWWwsFp8LeKLfd4doRyTLRacAAAAASUVORK5CYII=);background-size:contain;background-repeat:no-repeat}.small-point.svelte-jzvcn0.svelte-jzvcn0::before{content:'';display:block;position:absolute;pointer-events:none;width:0.375rem;height:0.375rem;border-radius:100%;background-color:white}.unfolded.svelte-jzvcn0 .big-point.svelte-jzvcn0{opacity:0;transform:scale(0)}.folded.svelte-jzvcn0 .big-point.svelte-jzvcn0{opacity:1;transform:scale(1)}.unfolded.svelte-jzvcn0 .small-point.svelte-jzvcn0{transform:scale(0.6)}.folded.svelte-jzvcn0 .small-point.svelte-jzvcn0{transform:scale(1)}")}function gm(o){let t,e,n,s,r,a,l;return e=new ve({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){t=i.element("div"),i.create_component(e.$$.fragment),n=i.space(),s=i.element("div"),r=i.space(),a=i.element("div"),i.attr(s,"class","small-point svelte-jzvcn0"),i.set_style(s,"transition-delay",o[2]?o[1]+"ms":"0ms",!1),i.attr(a,"class","big-point svelte-jzvcn0"),i.set_style(a,"transition-delay",o[2]?o[1]+"ms":"0ms",!1),i.attr(t,"class","point svelte-jzvcn0"),i.toggle_class(t,"unfolded",o[0]),i.toggle_class(t,"folded",o[2])},m(c,d){i.insert(c,t,d),i.mount_component(e,t,null),i.append(t,n),i.append(t,s),i.append(t,r),i.append(t,a),l=!0},p(c,[d]){d&6&&i.set_style(s,"transition-delay",c[2]?c[1]+"ms":"0ms",!1),d&6&&i.set_style(a,"transition-delay",c[2]?c[1]+"ms":"0ms",!1),d&1&&i.toggle_class(t,"unfolded",c[0]),d&4&&i.toggle_class(t,"folded",c[2])},i(c){l||(i.transition_in(e.$$.fragment,c),l=!0)},o(c){i.transition_out(e.$$.fragment,c),l=!1},d(c){c&&i.detach(t),i.destroy_component(e)}}}function Am(o,t,e){let n,{unfolded:s}=t,{foldDelay:r=800}=t;return o.$$set=a=>{"unfolded"in a&&e(0,s=a.unfolded),"foldDelay"in a&&e(1,r=a.foldDelay)},o.$$.update=()=>{o.$$.dirty&1&&e(2,n=!s)},[s,r,n]}class vm extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Am,gm,i.safe_not_equal,{unfolded:0,foldDelay:1},pm)}}function bm(o){i.append_styles(o,"svelte-8en2lj",".point-click-helper.svelte-8en2lj{position:absolute;width:2.5rem;height:2.5rem;left:50%;top:50%;transform:translate(-50%, -50%)}")}function es(o){let t,e,n=o[0].contentType!==ge.Link&&ts(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,r){s[0].contentType!==ge.Link?n?(n.p(s,r),r&1&&i.transition_in(n,1)):(n=ts(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function ts(o){let t,e,n,s,r,a;const l=[wm,ym],c=[];function d(u,f){var h,p,g,A;return((p=(h=u[0].style)==null?void 0:h.point)==null?void 0:p.style)==="CustomIcon"&&((A=(g=u[0].style)==null?void 0:g.point)==null?void 0:A.iconUrl)?0:1}return n=d(o),s=c[n]=l[n](o),{c(){t=i.element("div"),e=i.space(),s.c(),r=i.empty(),i.attr(t,"class","point-click-helper svelte-8en2lj")},m(u,f){i.insert(u,t,f),i.insert(u,e,f),c[n].m(u,f),i.insert(u,r,f),a=!0},p(u,f){let h=n;n=d(u),n===h?c[n].p(u,f):(i.group_outros(),i.transition_out(c[h],1,1,()=>{c[h]=null}),i.check_outros(),s=c[n],s?s.p(u,f):(s=c[n]=l[n](u),s.c()),i.transition_in(s,1),s.m(r.parentNode,r))},i(u){a||(i.transition_in(s),a=!0)},o(u){i.transition_out(s),a=!1},d(u){u&&i.detach(t),u&&i.detach(e),c[n].d(u),u&&i.detach(r)}}}function ym(o){let t,e;return t=new vm({props:{unfolded:o[0].state.unfolded,foldDelay:o[1]}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&1&&(r.unfolded=n[0].state.unfolded),s&2&&(r.foldDelay=n[1]),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function wm(o){let t,e;return t=new mm({props:{iconUrl:o[0].style.point.iconUrl,unfolded:o[0].state.unfolded,foldDelay:o[1]}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&1&&(r.iconUrl=n[0].style.point.iconUrl),s&1&&(r.unfolded=n[0].state.unfolded),s&2&&(r.foldDelay=n[1]),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function Cm(o){var s,r,a;let t,e,n=((s=o[0].pointTagStyle)==null?void 0:s.leftPercent)&&((r=o[0].pointTagStyle)==null?void 0:r.topPercent)&&o[0].enabled!==!1&&o[0].state&&((a=o[0].temporaryState)==null?void 0:a.visible)!==!1&&es(o);return{c(){n&&n.c(),t=i.empty()},m(l,c){n&&n.m(l,c),i.insert(l,t,c),e=!0},p(l,[c]){var d,u,f;((d=l[0].pointTagStyle)==null?void 0:d.leftPercent)&&((u=l[0].pointTagStyle)==null?void 0:u.topPercent)&&l[0].enabled!==!1&&l[0].state&&((f=l[0].temporaryState)==null?void 0:f.visible)!==!1?n?(n.p(l,c),c&1&&i.transition_in(n,1)):(n=es(l),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(l){e||(i.transition_in(n),e=!0)},o(l){i.transition_out(n),e=!1},d(l){n&&n.d(l),l&&i.detach(t)}}}function Em(o,t,e){let n,{tag:s}=t;return o.$$set=r=>{"tag"in r&&e(0,s=r.tag)},o.$$.update=()=>{var r,a;o.$$.dirty&1&&e(1,n=(a=(r=s.style)==null?void 0:r.foldedPointDelay)!=null?a:s.contentType===ge.Marketing?600:void 0)},[s,n]}class Pm extends i.SvelteComponent{constructor(t){super(),i.init(this,t,Em,Cm,i.safe_not_equal,{tag:0},bm)}}function Im(o){i.append_styles(o,"svelte-1vzhbu2",".wrapper.svelte-1vzhbu2{position:absolute;width:0rem;height:0rem;overflow:visible;pointer-events:auto}.point.svelte-1vzhbu2{-webkit-tap-highlight-color:transparent;position:absolute;transform:translate(-50%, -50%);left:50%;top:50%}")}function ns(o){let t,e;return t=new tr({props:{mediaStore:o[4],withAnimation:o[0],tag:re(o[1]),hooks:o[2],state:o[3],temporaryState:o[5]}}),{c(){i.create_component(t.$$.fragment)},m(n,s){i.mount_component(t,n,s),e=!0},p(n,s){const r={};s&16&&(r.mediaStore=n[4]),s&1&&(r.withAnimation=n[0]),s&2&&(r.tag=re(n[1])),s&4&&(r.hooks=n[2]),s&8&&(r.state=n[3]),s&32&&(r.temporaryState=n[5]),t.$set(r)},i(n){e||(i.transition_in(t.$$.fragment,n),e=!0)},o(n){i.transition_out(t.$$.fragment,n),e=!1},d(n){i.destroy_component(t,n)}}}function is(o){let t,e,n,s,r;return e=new Pm({props:{tag:o[1]}}),{c(){t=i.element("div"),i.create_component(e.$$.fragment),i.attr(t,"class","point svelte-1vzhbu2")},m(a,l){i.insert(a,t,l),i.mount_component(e,t,null),n=!0,s||(r=i.listen(t,"click",i.stop_propagation(o[11])),s=!0)},p(a,l){const c={};l&2&&(c.tag=a[1]),e.$set(c)},i(a){n||(i.transition_in(e.$$.fragment,a),n=!0)},o(a){i.transition_out(e.$$.fragment,a),n=!1},d(a){a&&i.detach(t),i.destroy_component(e),s=!1,r()}}}function km(o){var l,c;let t,e,n,s,r=o[1].dimensionType===Ae.Two&&ns(o),a=o[1].pointType===fe.PointTag&&((c=(l=o[1].style)==null?void 0:l.point)==null?void 0:c.style)!=="noPoint"&&is(o);return{c(){t=i.element("div"),r&&r.c(),e=i.space(),a&&a.c(),i.attr(t,"class","wrapper svelte-1vzhbu2"),i.attr(t,"data-id",n=o[1].id),i.toggle_class(t,"hide",o[10]),i.toggle_class(t,"unfolded",o[6]),i.set_style(t,"left",o[9],!1),i.set_style(t,"top",o[8],!1),i.set_style(t,"z-index",o[7],!1)},m(d,u){i.insert(d,t,u),r&&r.m(t,null),i.append(t,e),a&&a.m(t,null),s=!0},p(d,[u]){var f,h;d[1].dimensionType===Ae.Two?r?(r.p(d,u),u&2&&i.transition_in(r,1)):(r=ns(d),r.c(),i.transition_in(r,1),r.m(t,e)):r&&(i.group_outros(),i.transition_out(r,1,1,()=>{r=null}),i.check_outros()),d[1].pointType===fe.PointTag&&((h=(f=d[1].style)==null?void 0:f.point)==null?void 0:h.style)!=="noPoint"?a?(a.p(d,u),u&2&&i.transition_in(a,1)):(a=is(d),a.c(),i.transition_in(a,1),a.m(t,null)):a&&(i.group_outros(),i.transition_out(a,1,1,()=>{a=null}),i.check_outros()),(!s||u&2&&n!==(n=d[1].id))&&i.attr(t,"data-id",n),u&1024&&i.toggle_class(t,"hide",d[10]),u&64&&i.toggle_class(t,"unfolded",d[6]),u&512&&i.set_style(t,"left",d[9],!1),u&256&&i.set_style(t,"top",d[8],!1),u&128&&i.set_style(t,"z-index",d[7],!1)},i(d){s||(i.transition_in(r),i.transition_in(a),s=!0)},o(d){i.transition_out(r),i.transition_out(a),s=!1},d(d){d&&i.detach(t),r&&r.d(),a&&a.d()}}}function xm(o,t,e){let n,s,r,a,l,c,{withAnimation:d=!1}=t,{tag:u}=t,{hooks:f}=t,{state:h}=t,{mediaStore:p}=t,{temporaryState:g}=t,A,b=!1;function v(y){A!==void 0&&clearTimeout(A),b=!0,A=setTimeout(()=>{b=!1},800)}const w=y=>{b||f.emit("click",{event:y,target:"TagPoint",tag:u})};return o.$$set=y=>{"withAnimation"in y&&e(0,d=y.withAnimation),"tag"in y&&e(1,u=y.tag),"hooks"in y&&e(2,f=y.hooks),"state"in y&&e(3,h=y.state),"mediaStore"in y&&e(4,p=y.mediaStore),"temporaryState"in y&&e(5,g=y.temporaryState)},o.$$.update=()=>{var y,I,k,C;o.$$.dirty&2&&e(12,n=(y=u.state)==null?void 0:y.visible),o.$$.dirty&4096&&e(10,s=!n),o.$$.dirty&2&&e(6,r=(I=u.state)==null?void 0:I.unfolded),o.$$.dirty&2&&e(9,a=((k=u.pointTagStyle)==null?void 0:k.leftPercent)+"%"),o.$$.dirty&2&&e(8,l=((C=u.pointTagStyle)==null?void 0:C.topPercent)+"%"),o.$$.dirty&2&&e(7,c=u.contentType===ge.Link?1:0),o.$$.dirty&64&&v()},[d,u,f,h,p,g,r,c,l,a,s,w,n]}class Dm extends i.SvelteComponent{constructor(t){super(),i.init(this,t,xm,km,i.safe_not_equal,{withAnimation:0,tag:1,hooks:2,state:3,mediaStore:4,temporaryState:5},Im)}}function Sm(o){i.append_styles(o,"svelte-1eci49s",".tag--container.svelte-1eci49s{box-sizing:border-box;position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;opacity:1;-webkit-user-select:none;-moz-user-select:none;user-select:none}.tag.hide.svelte-1eci49s{display:none}.withAnimation.svelte-1eci49s{transition:opacity 0.3s linear}.tag--container.hide.svelte-1eci49s{opacity:0;pointer-events:none}.tag--container.hide.svelte-1eci49s *{pointer-events:none}")}function os(o,t,e){const n=o.slice();return n[6]=t[e],n}function ss(o){let t,e=[],n=new Map,s,r=o[1];const a=l=>l[6].id;for(let l=0;l<r.length;l+=1){let c=os(o,r,l),d=a(c);n.set(d,e[l]=rs(d,c))}return{c(){t=i.element("div");for(let l=0;l<e.length;l+=1)e[l].c();i.attr(t,"class","tag--container svelte-1eci49s"),i.toggle_class(t,"hide",!o[3].visible||!o[5].visible),i.toggle_class(t,"withAnimation",o[0])},m(l,c){i.insert(l,t,c);for(let d=0;d<e.length;d+=1)e[d].m(t,null);s=!0},p(l,c){c&63&&(r=l[1],i.group_outros(),e=i.update_keyed_each(e,c,a,1,l,r,n,t,i.outro_and_destroy_block,rs,null,os),i.check_outros()),c&40&&i.toggle_class(t,"hide",!l[3].visible||!l[5].visible),c&1&&i.toggle_class(t,"withAnimation",l[0])},i(l){if(!s){for(let c=0;c<r.length;c+=1)i.transition_in(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)i.transition_out(e[c]);s=!1},d(l){l&&i.detach(t);for(let c=0;c<e.length;c+=1)e[c].d()}}}function rs(o,t){let e,n,s,r;const a=[{tag:t[6],hooks:t[2],state:t[3],mediaStore:t[4],temporaryState:t[5],withAnimation:t[0]}];let l={};for(let c=0;c<a.length;c+=1)l=i.assign(l,a[c]);return n=new Dm({props:l}),{key:o,first:null,c(){var c,d,u;e=i.element("div"),i.create_component(n.$$.fragment),s=i.space(),i.attr(e,"class","tag svelte-1eci49s"),i.toggle_class(e,"hide",!((c=t[6].pointTagStyle)!=null&&c.leftPercent)||!((d=t[6].pointTagStyle)!=null&&d.topPercent)||t[6].enabled===!1||!t[6].state||((u=t[6].temporaryState)==null?void 0:u.visible)===!1),this.first=e},m(c,d){i.insert(c,e,d),i.mount_component(n,e,null),i.append(e,s),r=!0},p(c,d){var f,h,p;t=c;const u=d&63?i.get_spread_update(a,[{tag:t[6],hooks:t[2],state:t[3],mediaStore:t[4],temporaryState:t[5],withAnimation:t[0]}]):{};n.$set(u),d&2&&i.toggle_class(e,"hide",!((f=t[6].pointTagStyle)!=null&&f.leftPercent)||!((h=t[6].pointTagStyle)!=null&&h.topPercent)||t[6].enabled===!1||!t[6].state||((p=t[6].temporaryState)==null?void 0:p.visible)===!1)},i(c){r||(i.transition_in(n.$$.fragment,c),r=!0)},o(c){i.transition_out(n.$$.fragment,c),r=!1},d(c){c&&i.detach(e),i.destroy_component(n)}}}function Lm(o){let t,e,n=o[3].enabled&&ss(o);return{c(){n&&n.c(),t=i.empty()},m(s,r){n&&n.m(s,r),i.insert(s,t,r),e=!0},p(s,[r]){s[3].enabled?n?(n.p(s,r),r&8&&i.transition_in(n,1)):(n=ss(s),n.c(),i.transition_in(n,1),n.m(t.parentNode,t)):n&&(i.group_outros(),i.transition_out(n,1,1,()=>{n=null}),i.check_outros())},i(s){e||(i.transition_in(n),e=!0)},o(s){i.transition_out(n),e=!1},d(s){n&&n.d(s),s&&i.detach(t)}}}function _m(o,t,e){let{withAnimation:n=!1}=t,{tags:s=[]}=t,{hooks:r}=t,{state:a}=t,{mediaStore:l}=t,{temporaryState:c}=t;return o.$$set=d=>{"withAnimation"in d&&e(0,n=d.withAnimation),"tags"in d&&e(1,s=d.tags),"hooks"in d&&e(2,r=d.hooks),"state"in d&&e(3,a=d.state),"mediaStore"in d&&e(4,l=d.mediaStore),"temporaryState"in d&&e(5,c=d.temporaryState)},[n,s,r,a,l,c]}class zm extends i.SvelteComponent{constructor(t){super(),i.init(this,t,_m,Lm,i.safe_not_equal,{withAnimation:0,tags:1,hooks:2,state:3,mediaStore:4,temporaryState:5},Sm)}}const Mm={globalConfig:{initialState:{},visibleConfig:{visibleDistance:{max:5},angleRange:{min:-45,max:45}},unfoldedConfig:{autoUnfold:{strategy:"MinimumDistance"}},tag3DConfig:{ratio:.0035}},contentTypeConfig:{"Any-Link-Any":{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},"Any-Marketing-Any":{unfoldedConfig:void 0},"3D-MediaPlane-PlaneTag":{unfoldedConfig:{keep:"unfolded"},visibleConfig:{alwaysShowWhenMovePano:!0,angleRange:void 0,visibleDistance:void 0}}}};class Tm extends Xt{constructor(e){super(e);m(this,"tagCacheByPanoIndex",{})}getCaches({panoIndex:e,id:n,key:s}){var d,u,f,h;const{five:r}=this,a=(d=r.panoIndex)!=null?d:e;if(a===void 0)throw new Error(`TagCacheController getCache(): fivePanoIndex is ${a}`);const l=`${(f=(u=r.work)==null?void 0:u.workCode)!=null?f:r.model.uuid}-${a}`;let c=this.tagCacheByPanoIndex[l];if(c||(c=new Map,this.tagCacheByPanoIndex[l]=c),n===void 0)return c;if(s===void 0){const p=c.get(n);return p||(c.set(n,{}),c.get(n))}return(h=c.get(n))==null?void 0:h[s]}clearCache(){this.tagCacheByPanoIndex={}}}class jm extends Tm{constructor(e){super(e);m(this,"tags",[]);m(this,"config",Mm);m(this,"raycaster",new P.Raycaster)}getTagById(e){const n=this.tags.find(s=>s.id===e);if(!n){console.error(`getTagById(): tag is ${n}, id is ${e}`);return}return n}changeConfig(e,n=!0){n?this.config=Ne.default({},this.config,e):this.config=e,this.clearCache()}changeGlobalConfig(e,n=!0){n?this.config.globalConfig=Ne.default({},this.config.globalConfig,e):this.config.globalConfig=e,this.clearCache()}changeContentTypeConfig(e,n,s=!0){this.config.contentTypeConfig||(this.config.contentTypeConfig={}),s?this.config.contentTypeConfig[e]=Ne.default({},this.config.contentTypeConfig[e],n):this.config.contentTypeConfig[e]=n,this.clearCache()}getVisibleByPanoIndex(e,n){var a;const s=this.getCaches({panoIndex:n,id:e.id}),r=(a=this.five.panoIndex)!=null?a:n;if(s.visible!==void 0)return s.visible;{const l=(()=>{var u,f,h,p,g;const c=(u=this.getTagConfig(e).visibleConfig)!=null?u:{},d=this.getDistance(e);if(typeof c=="function")return c(this.five,{tag:e,distance:d});if(c.keep==="hidden")return!1;if(c.keep==="visible")return!0;if(c.visiblePanoIndex!==void 0&&(r===void 0||!c.visiblePanoIndex.includes(r))||c.visibleDistance!==void 0&&c.visibleDistance!=="unLimited"&&kt(d,c.visibleDistance)===!1)return!1;if(((f=c.intersectRaycaster)==null?void 0:f.enabled)!==!1){if(r===void 0)return!1;const A=(h=this.five.work.observers[r])==null?void 0:h.position;if(A===void 0)throw new Error(`getVisible(): observerPosition is ${A}`);const b=It(e.position).sub(A).normalize();this.raycaster.set(A,b);const[v]=this.five.model.intersectRaycaster(this.raycaster),w=(g=(p=c.intersectRaycaster)==null?void 0:p.distanceAccuracy)!=null?g:.01;if(v&&v.distance+w<d)return!1}return!(c.angleRange&&e.dimensionType===Ae.Three&&kt(this.getAngle(e),c.angleRange)===!1)})();return s.visible=l,s.visible}}getUnfoldedByPanoIndex(e,n){if(!this.getVisibleByPanoIndex(e))return;const r=this.getCaches({panoIndex:n,id:e.id});if(r.unfolded!==void 0)return r.unfolded;{const a=this.getTagConfig(e).unfoldedConfig;if(!a)return;const l=(()=>{const d=this.getDistance(e);if(typeof a=="function")return a(this.five,{tag:e,distance:d});if(a.keep==="folded")return!1;if(a.keep==="unfolded")return!0;if(a.disableUnfold===!0)return!1;if(a.disableFold===!0)return!0;if(a.unfoldDistance&&kt(d,a.unfoldDistance)===!1)return!1})();r.unfolded=l;const c=this.getUnfoldedByCamera(e);return c!==void 0?c:r.unfolded}}getUnfoldedByCamera(e){return this.getVisibleByPanoIndex(e)?(()=>{var l;const r=this.getDistance(e),a=this.getTagConfig(e).unfoldedConfig;if(!!a){if(typeof a=="function")return a(this.five,{tag:e,distance:r});if(a.keep==="folded")return!1;if(a.keep==="unfolded")return!0;if(a.disableUnfold===!0)return!1;if(a.disableFold===!0)return!0;if(a.autoUnfold===void 0)return;if(a.autoUnfold.strategy==="ScreenPostion"){const c=this.getTagProject(e);if(c&&kt(c.x,a.autoUnfold.autoUnfoldProjectX)===!1)return!1}if(a.autoUnfold.strategy==="MinimumDistance"){const u=this.filterPointTag().filter(h=>this.getVisibleByPanoIndex(h)).filter(h=>{const p=this.getTagProject(h);if(!p)return!1;const{x:g,y:A,z:b}=p;return!(Math.abs(b)>1||Math.abs(g)>1||Math.abs(A)>1)}).filter(h=>{var g;const p=this.getTagConfig(h).unfoldedConfig;return typeof p=="object"&&((g=p.autoUnfold)==null?void 0:g.strategy)==="MinimumDistance"}).map(h=>({id:h.id,distance:this.getDistance(h)})).filter(h=>h.distance!==void 0).sort((h,p)=>h.distance-p.distance).findIndex(h=>h.id===e.id);if(u===-1||u<=((l=a.autoUnfold.maxNumber)!=null?l:1)-1===!1)return!1}return!0}})():void 0}getDistance(e,n){var a,l,c;const s=(a=this.five.panoIndex)!=null?a:n;if(s===void 0)throw new Error(`getDistance(): fivePanoIndex is ${s}`);const r=this.getCaches({panoIndex:n,id:e.id});if(r.distance!==void 0)return r.distance;{const d=(c=(l=this.five.work)==null?void 0:l.observers[s])==null?void 0:c.position;if(d===void 0)throw new Error(`getDistance(): observerPosition is ${d}`);const u=(()=>e.pointType===fe.PointTag?De(e==null?void 0:e.position):It(e.position))(),f=d.distanceTo(u);return r.distance=f,f}}getAngle(e,n){var a,l,c;const s=(a=this.five.panoIndex)!=null?a:n;if(s===void 0)throw new Error(`getDistance(): fivePanoIndex is ${s}`);const r=this.getCaches({panoIndex:n,id:e.id});if(r.angle!==void 0)return r.angle;{const d=(c=(l=this.five.work)==null?void 0:l.observers[s])==null?void 0:c.position;if(d===void 0)throw new Error(`getAngleRange(): observerPosition is ${d}`);const u=(()=>e.pointType===fe.PointTag?ct(e.normal):Vs(e.position))();if(!u)return;const f=new P.Vector3().copy(d).sub(It(e.position)),h=u.angleTo(f)*180/Math.PI;return r.angle=h,r.angle}}getTagConfig(e){var r;if(!e)return(r=this.config.globalConfig)!=null?r:{};const n={};return this.config.contentTypeConfig&&Object.keys(this.config.contentTypeConfig).forEach(a=>{const l=a;if(n[l])return;const c=l.split("-"),[d="Any",u="Any",f="Any"]=c||[];(e.dimensionType===d||d==="Any")&&(e.contentType===u||u==="Any")&&(e.pointType===f||f==="Any")&&(n[l]=this.config.contentTypeConfig[l])}),Ne.default({},this.config.globalConfig,...Object.values(n),e.config)}canBe(e,n){const s=this.getTagConfig(n);if(!s||typeof s!="object")return!0;if(e==="show"||e==="hide"){if(!s.visibleConfig||typeof s.visibleConfig!="object")return!0;if(e==="show"&&s.visibleConfig.keep==="hidden"||e==="hide"&&(s.visibleConfig.keep==="visible"||s.visibleConfig.alwaysShowWhenMovePano))return!1}if(e==="fold"||e==="unfold"){if(!s.unfoldedConfig||typeof s.unfoldedConfig!="object")return!0;if(e==="fold"&&(s.unfoldedConfig.disableFold||s.unfoldedConfig.keep==="unfolded")||e==="unfold"&&(s.unfoldedConfig.disableUnfold||s.unfoldedConfig.keep==="folded"))return!1}return!0}setPointTagPosition(){const e=this.filterPointTag();e.length!==0&&e.forEach(n=>{var r;if(!((r=n.state)!=null&&r.visible)){n.pointTagStyle=void 0;return}const s=this.getTagProject(n);if(!s){n.pointTagStyle=void 0;return}n.pointTagStyle={leftPercent:(s.x+1)/2*100,topPercent:(-s.y+1)/2*100}})}setVisibleByPanoIndex(){this.tags.forEach(e=>{const n=this.getVisibleByPanoIndex(e);e.state&&(e.state.visible=n)})}setUnfoldedByPanoIndex(){this.tags.forEach(e=>{const n=this.getUnfoldedByPanoIndex(e);if(!!e.state&&(n!==void 0&&(e.state.unfolded=n),n&&!e.state.visible)){const s=this.getTagConfig(e);typeof s.unfoldedConfig=="object"&&s.unfoldedConfig.autoUnfoldWhenHide!==!1&&(e.state.unfolded=!1)}})}getTagProject(e){if(!this.getVisibleByPanoIndex(e))return;const s=It(e.position),{x:r,y:a,z:l}=s.project(this.five.camera);if(!(l>1))return{x:r,y:a,z:l}}filterPointTag(){return this.tags.filter(e=>e.pointType===fe.PointTag)}filterTag2D(){return this.tags.filter(e=>e.dimensionType===Ae.Two)}filter3DPointTag(){return this.tags.filter(e=>e.dimensionType===Ae.Three&&e.pointType===fe.PointTag)}filter3DTag(){return this.tags.filter(e=>e.dimensionType===Ae.Three)}filterPlaneTag(){return this.tags.filter(e=>e.dimensionType===Ae.Three&&e.pointType===fe.PlaneTag)}}const nr="1.2.6",En=`DnalogelPlugin-PanoTagPlugin@${nr}`,Bm=!1,Qm=o=>`${En}--${o}`;class ir extends jm{constructor(e,n){super(e);m(this,"version",nr);m(this,"state",{enabled:!0,visible:!0});m(this,"params");m(this,"debug");m(this,"css3DRenderPlugin");m(this,"TagContainerSvelte");m(this,"temporaryState",{visible:!0});m(this,"mediaStore",kn.writable({currentMediaUrl:""}));m(this,"store",{disposers:[],disposed:!1,resizeObserverDisposerAdding:!1,css3DRenderDisposer:new Map});m(this,"staticUrl");m(this,"disposedErrorLog",()=>{console.error(`${En} is disposed`)});this.params=j({debug:!1,mergePluginDefaultConfigToLoadDataConfig:!1,config:this.config,staticConfig:{host:"vrlab-static.ljcdn.com"}},n),this.debug=this.params.debug,this.config=this.params.config,this.staticUrl=(()=>{var r;const s=this.params.staticConfig;if(typeof s=="string")return s;{const a=s.protocol?s.protocol+":":"",l=(r=s.host)!=null?r:"vrlab-static.ljcdn.com",c=s.port?":"+s.port:"";return`${a}//${l}${c}`}})(),Object.assign(window,{__PANOTAGPLUGIN_DEBUG__:this})}load(e,n){var s,r;this.clearTags(),console.log(En,"load:",{data:e}),this.params.mergePluginDefaultConfigToLoadDataConfig?this.config=Ne.default({},this.config,{globalConfig:(s=e.globalConfig)!=null?s:{},contentTypeConfig:(r=e.contentTypeConfig)!=null?r:{}}):(e.globalConfig&&(this.config.globalConfig=e.globalConfig),e.contentTypeConfig&&(this.config.contentTypeConfig=e.contentTypeConfig)),this.addTag(e.tagList,n),this.debug&&ph(this.five,this.tags)}addTag(e,n){const r=(Array.isArray(e)?e:[e]).map(a=>{const l=this.getTagConfig(a);return V(j({},a),{state:j({visible:void 0,unfolded:Bm},l.initialState),hooks:new ee.Subscribe,clickable:l.clickable})}).filter(a=>a.position);this.tags.push(...r),gh(this.five,()=>{var a,l,c;this.store.eventListenerDisposer&&((l=(a=this.store).eventListenerDisposer)==null||l.call(a)),this.state.enabled&&(this.store.eventListenerDisposer=this.addEventListener()),this.addResizeListener(),this.checkPanelTag(),this.setVisibleAndUnfolded({withAnimation:(c=n==null?void 0:n.withAnimation)!=null?c:!0}).then(()=>this.updateRenderAllTags()),this.updateRenderAllTags()})}clearTags(){this.tags=[],this.clearCache(),this.disposeAllCSS3DContainer(),this.updateRenderAllTags()}show(e){return F(this,null,function*(){const{userAction:n=!0,withAnimation:s=!1}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({visible:!0},{userAction:n,visibleWithAnimation:s}),this.hooks.emit("show",{userAction:n,withAnimation:s})})}hide(e){return F(this,null,function*(){const{userAction:n=!0,withAnimation:s=!1}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({visible:!1},{userAction:n,visibleWithAnimation:s}),this.hooks.emit("hide",{userAction:n,withAnimation:s})})}enable(e){const{userAction:n=!0}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({enabled:!0},{userAction:n}),this.hooks.emit("enable",{userAction:n})}disable(e){const{userAction:n=!0}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({enabled:!1},{userAction:n}),this.hooks.emit("disable",{userAction:n})}dispose(){var e,n,s,r,a,l;this.disposeAllCSS3DContainer(),(e=this.TagContainerSvelte)==null||e.$destroy(),this.filter3DTag().forEach(c=>{var d;return(d=c.tag3DContentSvelte)==null?void 0:d.svelteApp.$destroy()}),this.tags=[],(n=this.store.disposers)==null||n.forEach(c=>c==null?void 0:c()),this.store.disposers=[],this.store.disposed=!0,(r=(s=this.store).eventListenerDisposer)==null||r.call(s),this.store.eventListenerDisposer=void 0,(l=(a=this.store).resizeObserverDisposer)==null||l.call(a),this.store.resizeObserverDisposer=void 0,this.store.resizeObserverDisposerAdding=!1,this.clearCache(),this.hooks.emit("dispose")}setState(e,n){if(this.store.disposed)return this.disposedErrorLog();const{userAction:s=!0,visibleWithAnimation:r=!1}=n,a=j({},this.state);this.state=Object.assign(this.state,e),this.store.visibleWithAnimation=r,a.visible!==this.state.visible&&(e.visible?this.handleShow():this.handleHide()),a.enabled!==this.state.enabled&&(e.enabled?this.handleEnable():this.handleDisable()),this.hooks.emit("stateChange",{state:this.state,prevState:a,userAction:s})}changeTagNormalById(e,n){const s=this.getTagById(e);!s||!s.tag3DContentSvelte||(s.tag3DContentSvelte.currentNormal=De(n),this.updateRenderPlaneTag())}changeDataById(e,n,s=!0){const r=this.getTagById(e);!r||(s?r.data=Ne.default({},r.data,n):Object.assign(r.data,n),this.checkPanelTag(),this.updateRenderAllTags())}changeTagById(e,n,s=!0){const r=this.getTagById(e);!n||(s?Ne.default(r,n):Object.assign(r,n),(r==null?void 0:r.tag3DContentSvelte)&&(n==null?void 0:n.normal)&&(r.tag3DContentSvelte.currentNormal=De(n.normal)),this.updateRenderAllTags(),this.checkPanelTag())}destroyTagById(e){(Array.isArray(e)?e:[e]).forEach(s=>{const r=this.tags.findIndex(a=>a.id===s);r!==-1&&this.tags.splice(r,1)}),this.updateRenderAllTags()}pauseCurrentMedia(){this.mediaStore.set({currentMediaUrl:""})}setVisibleAndUnfolded(){return F(this,arguments,function*({withAnimation:e}={withAnimation:!1}){return this.setVisibleByPanoIndex(),e?new Promise((n,s)=>{setTimeout(()=>{this.setUnfoldedByPanoIndex(),n()},10)}):(this.setUnfoldedByPanoIndex(),Promise.resolve())})}handleShow(){this.state.visible=!0,this.updateTagContainerVisible()}handleHide(){this.state.visible=!1,this.updateTagContainerVisible()}handleEnable(){this.state.enabled=!0,this.store.eventListenerDisposer=this.addEventListener(),this.updateRenderAllTags()}handleDisable(){var e,n,s;this.state.enabled=!1,(n=(e=this.store).eventListenerDisposer)==null||n.call(e),(s=this.TagContainerSvelte)==null||s.$set({tags:[]}),this.filter3DTag().forEach(r=>{var a;(a=r.tag3DContentSvelte)==null||a.svelteApp.$destroy(),r.tag3DContentSvelte=void 0})}addEventListener(){const{five:e,hooks:n}=this,s=this.handleFiveWantsMoveToPano.bind(this),r=this.handleFiveModeChange.bind(this),a=this.handleFiveCameraUpdate.bind(this),l=this.handleFiveCameraUpdateDebounce(),c=this.handleFivePanoArrived.bind(this),d=this.clickhandler.bind(this);return e.on("wantsMoveToPano",s),e.on("modeChange",r),e.on("cameraUpdate",a),e.on("cameraUpdate",l),e.on("panoArrived",c),n.on("click",d),()=>{e.off("wantsMoveToPano",s),e.off("modeChange",r),e.off("cameraUpdate",a),e.off("cameraUpdate",l),e.off("panoArrived",c),n.off("click",d),this.store.eventListenerDisposer=void 0}}addResizeListener(){if(!this.store.resizeObserverDisposer&&!this.store.resizeObserverDisposerAdding){const e=this.addResizeObserver();this.store.resizeObserverDisposerAdding=!0,setTimeout(()=>{this.store.resizeObserverDisposer=e,this.store.resizeObserverDisposerAdding=!1},200)}}addResizeObserver(){if(!this.store.disposed)return;const e=this.five.getElement(),n=()=>{!this.state.enabled||(this.show(),this.updateRenderAllTags())},s=()=>{!this.state.enabled||this.hide()},{observe:r,unobserve:a}=ro(vh(()=>{!this.store.resizeObserverDisposer||s()},500),e),{observe:l,unobserve:c}=ro(so(()=>n(),400),e);return r(),l(),()=>{a(),c()}}handleFiveModeChange(e){e==="Panorama"?this.five.once("panoArrived",()=>this.temporaryShow()):this.temporaryHide()}handleFiveWantsMoveToPano(){this.tags.forEach(e=>{const n=this.getTagConfig(e);typeof n.visibleConfig=="object"&&n.visibleConfig.keep?e.temporaryState=V(j({},e.temporaryState),{visible:n.visibleConfig.keep==="visible"}):typeof n.visibleConfig=="object"&&n.visibleConfig.alwaysShowWhenMovePano?e.temporaryState=V(j({},e.temporaryState),{visible:!0}):e.temporaryState=V(j({},e.temporaryState),{visible:!1})}),this.updateRenderAllTags()}temporaryShow(){this.temporaryState.visible=!0}temporaryHide(){this.temporaryState.visible=!1}clickhandler(e){if(e.target!=="TagPoint")return;if(!e.tag.state)return console.warn("Clickhandler: params.tag.state is undefined");const n=this.canBe("fold",e.tag),s=this.canBe("unfold",e.tag);n&&s&&(e.tag.state.unfolded=!e.tag.state.unfolded,e.tag.state.unfolded&&this.tags.forEach(r=>{r.id!==e.tag.id&&r.state&&this.canBe("fold",r)&&(r.state.unfolded=!1)}),this.updateRenderAllTags())}updateRenderAllTags(){this.updateRenderPointTag(),this.updateRenderPlaneTag()}updateTagContainerVisible(){var e;(e=this.TagContainerSvelte)==null||e.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation}),this.filter3DTag().forEach(n=>{var s;(s=n.tag3DContentSvelte)==null||s.svelteApp.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation})})}handleFiveCameraUpdateDebounce(){return so(()=>{this.setUnfoldedByCamera(),this.updateRenderAllTags()},100)}handleFiveCameraUpdate(){this.updateRenderPointTag()}handleFivePanoArrived(){return F(this,null,function*(){yield this.setVisibleAndUnfolded(),this.tags.forEach(e=>{e.temporaryState=V(j({},e.temporaryState),{visible:!0})}),this.updateRenderAllTags()})}setUnfoldedByCamera(){let e=!1;this.tags.forEach(n=>{const s=this.getUnfoldedByCamera(n);!n.state||s!==void 0&&(s===!0&&(e=!0),n.state.unfolded=s)}),e&&this.tags.forEach(n=>{const s=this.getTagConfig(n).unfoldedConfig;typeof s=="object"&&(s.autoUnfold||s.disableFold||s.keep)||n.state&&(n.state.unfolded=!1)})}updateRenderPointTag(){var n;const e=this.filterPointTag();if(this.setPointTagPosition(),this.TagContainerSvelte)this.TagContainerSvelte.$set({tags:e,state:this.state,temporaryState:this.temporaryState});else{const s=(n=this.five.getElement())==null?void 0:n.parentElement;if(!s)return console.error("updateRenderPlaneTag: tag2DContainer not found");this.TagContainerSvelte=new zm({target:s,props:{hooks:this.hooks,tags:e,state:this.state,temporaryState:this.temporaryState,mediaStore:this.mediaStore}})}}updateRenderPlaneTag(){[...this.filterPlaneTag(),...this.filter3DPointTag()].forEach(n=>{var s;if(n.tag3DContentSvelte){const{svelteApp:r,domContainer:a,initialNormal:l,currentNormal:c}=n.tag3DContentSvelte;if(r.$set({tag:n,hooks:this.hooks,state:this.state,temporaryState:this.temporaryState}),!l.equals(c)){const d=new M.Quaternion().setFromUnitVectors(l,c);a.css3DObject.setRotationFromQuaternion(d)}}else{if(((s=n.state)==null?void 0:s.visible)===!1)return;if(this.css3DRenderPlugin||(this.css3DRenderPlugin=nt(this.five)),n.pointType===fe.PointTag&&!n.normal)return console.error("updateRenderPlaneTag: \u4E09\u7EF4\u70B9\u6807\u7B7E\u7F3A\u5C11\u6CD5\u5411\u91CF\uFF01");const r=n.pointType===fe.PlaneTag?n.position:Ah(this.five.camera.position,De(n.position),De(n.normal)),a=n.pointType===fe.PlaneTag?Vs(n.position):De(n.normal),l=this.getTagConfig(n).tag3DConfig,c=this.css3DRenderPlugin.create3DDomContainer(r,l);if(!c)return;this.store.css3DRenderDisposer.set(n.id,c.dispose),n.tag3DContentSvelte={svelteApp:new tr({target:c.container,props:{tag:n,hooks:this.hooks,state:this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}}),domContainer:c,initialNormal:a,currentNormal:a}}}),this.checkPanelTag()}disposeAllCSS3DContainer(){for(const[e,n]of this.store.css3DRenderDisposer)n==null||n();this.store.css3DRenderDisposer=new Map}checkPanelTag(){this.tags.forEach(e=>{var n;e.dimensionType===Ae.Two&&e.pointType===fe.PointTag&&((n=e.tag3DContentSvelte)==null||n.domContainer.dispose(),e.tag3DContentSvelte=void 0)});for(const[e,n]of this.store.css3DRenderDisposer){const s=this.getTagById(e);(!s||s.dimensionType!==Ae.Three)&&(n==null||n(),this.store.css3DRenderDisposer.delete(e))}}}const Rm=(o,t)=>new ir(o,t);class Qn extends M.Object3D{constructor(e,n){var s;super();m(this,"originObject3D");m(this,"onRender");this.originObject3D=e,this.onRender=(s=n==null?void 0:n.onRender)!=null?s:()=>{}}get helperObject(){return this}render(){this.onRender()}show(){this.visible=!0,this.render()}hide(){this.visible=!1,this.render()}updatePosition(){this.position.copy(this.originObject3D.position)}updateQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}applyHelperScaleMatrix4(e,n){this.scale.applyMatrix4(e)}applyHelperQuaternion(e,n){this.applyQuaternion(e)}}class Om extends Qn{}class Hm extends Qn{}class Fm extends Qn{}class Gm extends Fm{}class Nm extends P.Group{constructor(e){super();m(this,"direction");this.direction=e||"x"}}class as extends P.Mesh{constructor(e,n,s){super(e,n);m(this,"direction");this.direction=s||"x"}}function Wm(o,t){const{offsetWidth:e,offsetHeight:n}=t,{top:s,left:r}=t.getBoundingClientRect();return Object.assign(new P.Vector2,{x:(o.x-r)/e*2-1,y:-(o.y-s)/n*2+1})}function Rn(o,t,e){if(!t||!e||!o)return;const n=Wm(t,e);if(Math.abs(n.x)===1||Math.abs(n.y)===1)return;const s=new P.Raycaster;return s.setFromCamera(n,o),s}function Xm(o,t){return!(Math.abs(o.x-t.x)>1e-5||Math.abs(o.y-t.y)>1e-5||Math.abs(o.z-t.z)>1e-5)}class ln extends Nm{constructor(e){var u;super(e.direction);m(this,"line");m(this,"arrow");m(this,"lineHeight",.4);m(this,"arrowHeight",.1);this.name="ArrowGroup";const n=new P.Color((u=e.color)!=null?u:16214315),s=new P.MeshBasicMaterial({color:n,depthTest:!1,opacity:1,transparent:!0,side:P.DoubleSide}),r=new P.ConeGeometry(.04,.1,32),a=new as(r,s.clone(),e.direction);a.name=`arrow-${e.direction}`,this.arrow=a;const l=.004,c=new P.CylinderGeometry(l,l,.4,32),d=new as(c,s.clone(),e.direction);d.name=`line-${e.direction}`,this.line=d,this.formatArrow(),this.formatLine(),this.add(this.arrow,this.line)}formatArrow(){this.arrow.geometry.translate(0,this.lineHeight+this.arrowHeight/2,0),this.direction==="x"?(this.arrow.geometry.rotateX(Math.PI/2),this.arrow.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.arrow.geometry.rotateX(Math.PI/2)}formatLine(){this.line.geometry.translate(0,this.lineHeight/2,0),this.direction==="x"?(this.line.geometry.rotateX(Math.PI/2),this.line.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.line.geometry.rotateX(Math.PI/2)}}const cn={X:15618642,Y:4765519,Z:4227839};class xe{static get X(){return new P.Color(cn.X).convertSRGBToLinear().clone()}static get Y(){return new P.Color(cn.Y).convertSRGBToLinear().clone()}static get Z(){return new P.Color(cn.Z).convertSRGBToLinear().clone()}}class Ym extends Om{constructor(e){super(e);m(this,"xArrow",new ln({direction:"x",color:xe.X}));m(this,"yArrow",new ln({direction:"y",color:xe.Y}));m(this,"zArrow",new ln({direction:"z",color:xe.Z}));this.add(this.xArrow),this.add(this.yArrow),this.add(this.zArrow)}show(){super.show(),this.xArrow.visible=!0,this.yArrow.visible=!0,this.zArrow.visible=!0}showDraggingHelper(e){this.xArrow.visible=e.includes("x"),this.yArrow.visible=e.includes("y"),this.zArrow.visible=e.includes("z")}dispose(){this.remove(this.xArrow,this.yArrow,this.zArrow)}}function Ye(o,t){return Um(document.createElement(t!=null?t:"div"),o)}function Um(o,t){if(!t)return o;for(const e in t)e&&t[e]&&(o.style[e]=t[e]);return o}function Vm(o){const t=Ye(j({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},o)),e=()=>{t.style.display!=="block"&&(!t.style.top||!t.style.left||(t.style.display="block"))};return{element:t,show:e,hide:()=>{t.style.display="none",t.style.top="",t.style.left=""},setLeftTop:(r,a)=>{t.style.left=r,t.style.top=a,e()}}}class Jm extends Hm{constructor(e,n){var s;super(e);m(this,"yzCircle",new dn({direction:"x",color:xe.X}));m(this,"xzCircle",new dn({direction:"y",color:xe.Y}));m(this,"xyCircle",new dn({direction:"z",color:xe.Z}));m(this,"xRingHelper",new un({direction:"x"}));m(this,"yRingHelper",new un({direction:"y"}));m(this,"zRingHelper",new un({direction:"z"}));m(this,"xAngleHelper",new hn({direction:"x",color:xe.X}));m(this,"yAngleHelper",new hn({direction:"y",color:xe.Y}));m(this,"zAngleHelper",new hn({direction:"z",color:xe.Z}));m(this,"angleTips");m(this,"container");n&&(this.container=n==null?void 0:n.container,this.angleTips=Vm({display:"none"}),(s=this.container)==null||s.appendChild(this.angleTips.element)),this.show()}updateAngleHelperQuaternion(){this.xAngleHelper.quaternion.copy(this.yzCircle.quaternion),this.yAngleHelper.quaternion.copy(this.xzCircle.quaternion),this.zAngleHelper.quaternion.copy(this.xyCircle.quaternion),this.xRingHelper.quaternion.copy(this.yzCircle.quaternion),this.yRingHelper.quaternion.copy(this.xzCircle.quaternion),this.zRingHelper.quaternion.copy(this.xyCircle.quaternion)}applyHelperQuaternion(e,n){this.yzCircle.applyQuaternion(e),this.xzCircle.applyQuaternion(e),this.xyCircle.applyQuaternion(e),this.xAngleHelper.baseAxes.applyQuaternion(e),this.yAngleHelper.baseAxes.applyQuaternion(e),this.zAngleHelper.baseAxes.applyQuaternion(e)}hide(){this.remove(this.yzCircle,this.xzCircle,this.xyCircle,this.xRingHelper,this.yRingHelper,this.zRingHelper,this.xAngleHelper,this.yAngleHelper,this.zAngleHelper)}show(){var e;this.add(this.xyCircle,this.xzCircle,this.yzCircle),this.remove(this.xRingHelper,this.yRingHelper,this.zRingHelper,this.xAngleHelper,this.yAngleHelper,this.zAngleHelper),(e=this.angleTips)==null||e.hide()}showDraggingHelper(e){var n;this.hide(),this.add(...this.filterRingHelper(e)),this.add(...this.filterAngleHelper(e)),(n=this.angleTips)==null||n.show()}dispose(){var e,n;this.remove(this.yzCircle,this.xzCircle,this.xyCircle,this.xRingHelper,this.yRingHelper,this.zRingHelper,this.xAngleHelper,this.yAngleHelper,this.zAngleHelper),(e=this.angleTips)!=null&&e.element&&((n=this.container)==null||n.removeChild(this.angleTips.element))}filterRingHelper(e){return[this.xRingHelper,this.yRingHelper,this.zRingHelper].filter(n=>e.includes(n.direction))}filterAngleHelper(e){return[this.xAngleHelper,this.yAngleHelper,this.zAngleHelper].filter(n=>e.includes(n.direction))}}class dn extends P.Mesh{constructor(e){var n;super();m(this,"direction");m(this,"gapAngle",.02);m(this,"geometry",new P.RingGeometry(.25,.3,20,8,this.gapAngle,Math.PI/2-this.gapAngle*2));this.material=new P.MeshBasicMaterial({opacity:.6,color:(n=e.color)!=null?n:16777215,transparent:!0,side:P.DoubleSide,depthTest:!1}),this.direction=e.direction,this.geometry.name=`RotateHelperCircleGeometry-${this.direction}`,this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}class un extends P.Group{constructor(e){super();m(this,"direction");this.direction=e.direction;const n=.015,s=new Array(8).fill(null).map((r,a)=>{const l=new P.RingGeometry(.25,.3,20,8,Math.PI/4*a+n,Math.PI/4-n*2),c=new P.MeshBasicMaterial({opacity:1,color:16777215,depthTest:!1,transparent:!0,side:P.DoubleSide}),d=new P.Mesh(l,c);return d.name=`AxesDashedRing-${this.direction}-${a}`,d});this.add(...s),this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}class hn extends P.Mesh{constructor(e){var s;super();m(this,"direction");m(this,"baseAxes");switch(e.direction){case"x":this.baseAxes=new P.Vector3(0,0,1);break;case"y":this.baseAxes=new P.Vector3(1,0,0);break;case"z":this.baseAxes=new P.Vector3(1,0,0);break}const n=.3+5e-4;this.geometry=new P.CircleGeometry(n,48,0,1e-4),this.material=new P.MeshBasicMaterial({opacity:.4,color:(s=e.color)!=null?s:16777215,depthTest:!1,transparent:!0,side:P.DoubleSide}),this.direction=e.direction,this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}function Zm(){const o=Ye({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=Ye({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=Ye({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"absolute",border:"1px solid rgba(255,255,255,0.4)"});o.appendChild(t),t.appendChild(e);const n="-4px",s={direction:"nesw",element:Me({cursor:"nesw-resize",left:n,bottom:n})},r={direction:"ns",element:Me({cursor:"ns-resize",bottom:n})},a={direction:"nwse",element:Me({cursor:"nwse-resize",right:n,bottom:n})},l={direction:"ew",element:Me({cursor:"ew-resize",right:n})},c={direction:"nesw",element:Me({cursor:"nesw-resize",right:n,top:n})},d={direction:"ns",element:Me({cursor:"ns-resize",top:n})},u={direction:"nwse",element:Me({cursor:"nwse-resize",left:n,top:n})},f={direction:"ew",element:Me({cursor:"ew-resize",left:n})};return new Array(r,l,d,f,s,a,c,u).forEach(p=>t.appendChild(p.element)),{container:o,squares:[s,r,a,l,c,d,u,f]}}function Me(o){const t=Ye(j({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},o)),e=Ye({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),n=Ye({width:"15px",height:"15px",cursor:o==null?void 0:o.cursor,pointerEvents:"auto",background:"transparent"});return n.draggable=!0,e.appendChild(n),t.appendChild(e),t}class qm extends Gm{constructor(e,n,s,r){super(e);m(this,"points",[]);m(this,"cornerPositions",[]);m(this,"css3DInstance");m(this,"plane");m(this,"css3DRenderer",new As);m(this,"camera");m(this,"scene");m(this,"container");m(this,"enabled",!1);this.camera=s,this.scene=r,this.container=n,this.initRectangleScaleHelper()}get helperObject(){var e;if(!((e=this.css3DInstance)!=null&&e.css3DObject))throw new Error("css3DInstance is not initialized");return this.css3DInstance.css3DObject}updatePosition(){var e;this.helperObject.position.copy(this.originObject3D.position),(e=this.plane)==null||e.position.copy(this.originObject3D.position)}updateQuaternion(){var e;(e=this.plane)==null||e.quaternion.copy(this.originObject3D.quaternion)}applyMatrix4(e){var n;super.applyMatrix4(e),this.helperObject.applyMatrix4(e),(n=this.plane)==null||n.applyMatrix4(e),this.cornerPositions.forEach(s=>s.applyMatrix4(e))}showDraggingHelper(){}applyHelperScaleMatrix4(e,n){var s;(s=this.plane)==null||s.scale.applyMatrix4(e),this.helperObject.applyScaleMatrix4(e)}updatePoints(){const e=this.calculatePointPosition(this.cornerPositions);this.points.forEach((n,s)=>{n.position.copy(e[s])})}applyHelperQuaternion(e,n){var r;const s=(r=this.css3DInstance)==null?void 0:r.css3DObject;if(s){const a=new P.Vector3().subVectors(s.position,n).applyQuaternion(e).add(n);s.position.copy(a),s.applyQuaternion(e)}if(this.plane){const a=new P.Vector3().subVectors(this.plane.position,n).applyQuaternion(e).add(n);this.plane.position.copy(a),this.plane.applyQuaternion(e)}this.cornerPositions.forEach(a=>{const l=new P.Vector3().subVectors(a,n).applyQuaternion(e).add(n);a.copy(l)})}enable(){var e;this.enabled||(this.enabled=!0,(e=this.css3DInstance)==null||e.enable(),this.plane&&this.scene.add(this.plane))}disable(){var e;!this.enabled||(this.enabled=!1,(e=this.css3DInstance)==null||e.disable(),this.plane&&this.scene.remove(this.plane))}show(){var e;(e=this.css3DInstance)==null||e.show(),this.plane&&(this.plane.visible=!0)}hide(){var e;(e=this.css3DInstance)==null||e.hide(),this.plane&&(this.plane.visible=!1)}dispose(){this.disable(),this.css3DRenderer.dispose()}initRectangleScaleHelper(){var u;const e=this.getCornerPositions();if(!e)return;this.cornerPositions=e;const n=this.css3DRenderer.create3DElement(this.camera,e,{ratio:.003});if(!n)return;this.css3DInstance=n,n.appendToElement(this.container);const s=n.css3DObject.container,{container:r,squares:a}=Zm();this.points=a.map((f,h)=>({direction:f.direction,point:f.element,position:this.calculatePointPosition(e)[h]})),s.insertBefore(r,(u=s.children[0])!=null?u:null);const l=new P.PlaneGeometry(n.css3DObject.width,n.css3DObject.height),c=new P.MeshBasicMaterial({color:0,opacity:.15,transparent:!0,side:P.DoubleSide}),d=new P.Mesh(l,c);this.scene.add(d),this.updatePosition()}getCornerPositions(){const{originObject3D:e}=this;if(e instanceof Mt.CSS3DObject){if(e.isCSS3DObjectPlus)return e.cornerPoints;console.error("\u6682\u65F6\u53EA\u652F\u6301 CSS3DRenderPlugin \u751F\u6210\u7684\u7269\u4F53")}else console.error("\u5F53\u524D\u7269\u4F53\u6682\u65F6\u4E0D\u652F\u6301 ScaleHelper")}calculatePointPosition(e){return[e[0].clone(),e[0].clone().add(e[1]).divideScalar(2),e[1].clone(),e[1].clone().add(e[2]).divideScalar(2),e[2].clone(),e[2].clone().add(e[3]).divideScalar(2),e[3].clone(),e[3].clone().add(e[0]).divideScalar(2)]}}new P.Vector3;function q(o,t){this._camera=o||null,this._domElement=t||document,this._raycaster=new P.Raycaster,this._selected=null,this._boundObjs={};var e=this;this._$onClick=function(){e._onClick.apply(e,arguments)},this._$onDblClick=function(){e._onDblClick.apply(e,arguments)},this._$onMouseMove=function(){e._onMouseMove.apply(e,arguments)},this._$onMouseDown=function(){e._onMouseDown.apply(e,arguments)},this._$onMouseUp=function(){e._onMouseUp.apply(e,arguments)},this._$onTouchMove=function(){e._onTouchMove.apply(e,arguments)},this._$onTouchStart=function(){e._onTouchStart.apply(e,arguments)},this._$onTouchEnd=function(){e._onTouchEnd.apply(e,arguments)},this._$onContextmenu=function(){e._onContextmenu.apply(e,arguments)},this._domElement.addEventListener("click",this._$onClick,!1),this._domElement.addEventListener("dblclick",this._$onDblClick,!1),this._domElement.addEventListener("mousemove",this._$onMouseMove,!1),this._domElement.addEventListener("mousedown",this._$onMouseDown,!1),this._domElement.addEventListener("mouseup",this._$onMouseUp,!1),this._domElement.addEventListener("touchmove",this._$onTouchMove,!1),this._domElement.addEventListener("touchstart",this._$onTouchStart,!1),this._domElement.addEventListener("touchend",this._$onTouchEnd,!1),this._domElement.addEventListener("contextmenu",this._$onContextmenu,!1)}q.prototype.destroy=function(){this._domElement.removeEventListener("click",this._$onClick,!1),this._domElement.removeEventListener("dblclick",this._$onDblClick,!1),this._domElement.removeEventListener("mousemove",this._$onMouseMove,!1),this._domElement.removeEventListener("mousedown",this._$onMouseDown,!1),this._domElement.removeEventListener("mouseup",this._$onMouseUp,!1),this._domElement.removeEventListener("touchmove",this._$onTouchMove,!1),this._domElement.removeEventListener("touchstart",this._$onTouchStart,!1),this._domElement.removeEventListener("touchend",this._$onTouchEnd,!1),this._domElement.removeEventListener("contextmenu",this._$onContextmenu,!1)};q.eventNames=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu","touchstart","touchend"];q.prototype._getRelativeMouseXY=function(o){var t=o.target||o.srcElement;t.nodeType===3&&(t=t.parentNode);var e={x:0,y:0},n=t,s=getComputedStyle(n,null);e.y+=parseInt(s.getPropertyValue("padding-top"),10),e.x+=parseInt(s.getPropertyValue("padding-left"),10);do e.x+=n.offsetLeft,e.y+=n.offsetTop,s=getComputedStyle(n,null),e.x+=parseInt(s.getPropertyValue("border-left-width"),10),e.y+=parseInt(s.getPropertyValue("border-top-width"),10);while(n=n.offsetParent);var r={width:t===window?window.innerWidth:t.offsetWidth,height:t===window?window.innerHeight:t.offsetHeight};return{x:Number((o.pageX-e.x)/r.width)*2-1,y:-((o.pageY-e.y)/r.height)*2+1}};q.prototype._objectCtxInit=function(o){o._3xDomEvent={}};q.prototype._objectCtxDeinit=function(o){delete o._3xDomEvent};q.prototype._objectCtxIsInit=function(o){return!!o._3xDomEvent};q.prototype._objectCtxGet=function(o){return o._3xDomEvent};q.prototype.camera=function(o){return o&&(this._camera=o),this._camera};q.prototype.bind=function(o,t,e,n){console.assert(q.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(o)||this._objectCtxInit(o);var s=this._objectCtxGet(o);s[t+"Handlers"]||(s[t+"Handlers"]=[]),s[t+"Handlers"].push({callback:e,useCapture:n}),this._boundObjs[t]===void 0&&(this._boundObjs[t]=[]),this._boundObjs[t].push(o)};q.prototype.addEventListener=q.prototype.bind;q.prototype.unbind=function(o,t,e,n){console.assert(q.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(o)||this._objectCtxInit(o);var s=this._objectCtxGet(o);s[t+"Handlers"]||(s[t+"Handlers"]=[]);for(var r=s[t+"Handlers"],a=0;a<r.length;a++){var l=r[a];if(e==l.callback&&n==l.useCapture){r.splice(a,1);break}}var c=this._boundObjs[t].indexOf(o);console.assert(c!==-1),this._boundObjs[t].splice(c,1)};q.prototype.removeEventListener=q.prototype.unbind;q.prototype._bound=function(o,t){var e=this._objectCtxGet(t);return e?!!e[o+"Handlers"]:!1};q.prototype._onMove=function(o,t,e,n){var s=this._boundObjs[o];if(!(s===void 0||s.length===0)){var r=new P.Vector2;r.set(t,e),this._raycaster.setFromCamera(r,this._camera);var a=this._raycaster.intersectObjects(s),l=this._selected;if(a.length>0){var c,d,u,f=a[0],h=f.object;this._selected=h,u=this._bound("mousemove",h),l!=h&&(c=this._bound("mouseover",h),d=l&&this._bound("mouseout",l))}else d=l&&this._bound("mouseout",l),this._selected=null;u&&this._notify("mousemove",h,n,f),c&&this._notify("mouseover",h,n,f),d&&this._notify("mouseout",l,n,f)}};q.prototype._onEvent=function(o,t,e,n){var s=this._boundObjs[o];if(!(s===void 0||s.length===0)){var r=new P.Vector2;r.set(t,e),this._raycaster.setFromCamera(r,this._camera);var a=this._raycaster.intersectObjects(s,!0);if(a.length!==0){for(var l=a[0],c=l.object,d=this._objectCtxGet(c),u=c.parent;typeof d=="undefined"&&u;)d=this._objectCtxGet(u),u=u.parent;!d||this._notify(o,c,n,l)}}};q.prototype._notify=function(o,t,e,n){var s=this._objectCtxGet(t),r=s?s[o+"Handlers"]:null;if(console.assert(arguments.length===4),!s||!r||r.length===0){t.parent&&this._notify(o,t.parent,e,n);return}for(var r=s[o+"Handlers"],a=0;a<r.length;a++){var l=r[a],c=!0;l.callback({type:o,target:t,origDomEvent:e,intersect:n,stopPropagation:function(){c=!1}}),!!c&&l.useCapture===!1&&t.parent&&this._notify(o,t.parent,e,n)}};q.prototype._onMouseDown=function(o){return this._onMouseEvent("mousedown",o)};q.prototype._onMouseUp=function(o){return this._onMouseEvent("mouseup",o)};q.prototype._onMouseEvent=function(o,t){var e=this._getRelativeMouseXY(t);this._onEvent(o,e.x,e.y,t)};q.prototype._onMouseMove=function(o){var t=this._getRelativeMouseXY(o);this._onMove("mousemove",t.x,t.y,o),this._onMove("mouseover",t.x,t.y,o),this._onMove("mouseout",t.x,t.y,o)};q.prototype._onClick=function(o){this._onMouseEvent("click",o)};q.prototype._onDblClick=function(o){this._onMouseEvent("dblclick",o)};q.prototype._onContextmenu=function(o){this._onMouseEvent("contextmenu",o)};q.prototype._onTouchStart=function(o){return this._onTouchEvent("touchstart",o)};q.prototype._onTouchEnd=function(o){return this._onTouchEvent("touchend",o)};q.prototype._onTouchMove=function(o){if(o.touches.length==1){o.preventDefault();var t=Number(o.touches[0].pageX/window.innerWidth)*2-1,e=-(o.touches[0].pageY/window.innerHeight)*2+1;this._onMove("mousemove",t,e,o),this._onMove("mouseover",t,e,o),this._onMove("mouseout",t,e,o)}};q.prototype._onTouchEvent=function(o,t){if(t.touches.length==1){t.preventDefault();var e=Number(t.touches[0].pageX/window.innerWidth)*2-1,n=-(t.touches[0].pageY/window.innerHeight)*2+1;this._onEvent(o,e,n,t)}};let Fe=null;class On{constructor(t,e,n,s,r,a,l){m(this,"hooks",new ht);m(this,"helperObject3D");m(this,"originObject3D");m(this,"camera");m(this,"model");m(this,"scene");m(this,"container");m(this,"domEvents");m(this,"isDragging",!1);m(this,"onRender");m(this,"enabled",!1);m(this,"onWantsTapGesture",t=>{if(this.getIntersectObject(t))return!1});this.camera=t,this.model=e,this.originObject3D=n,this.helperObject3D=s,this.container=r,this.scene=a,this.domEvents=new q(t,r),this.onRender=l!=null?l:()=>{},this.initialHelperPosition(),this.initialHelperQuaternion(),this.enable()}initialHelperPosition(){this.helperObject3D.updatePosition()}initialHelperQuaternion(){this.helperObject3D.updateQuaternion()}enable(){this.enabled||(this.enabled=!0,this.scene.add(this.helperObject3D),this.render())}disable(){!this.enabled||(this.enabled=!1,this.scene.remove(this.helperObject3D),this.render())}show(){this.helperObject3D.show(),this.render()}hide(){this.helperObject3D.hide(),this.render()}dispose(){this.helperObject3D.dispose(),this.scene.remove(this.helperObject3D),this.render()}setOpacity(t){this.setOriginOpacityProperty();const e=this.originObject3D;if(e instanceof P.Mesh&&(e.material.opacity=t),e.isCSS3DObjectPlus){const n=e;n.container.style.opacity=t.toString()}this.render()}restoreOpacity(){if(Fe===null)return;const t=this.originObject3D;if(t instanceof P.Mesh&&(t.material.opacity=Fe.opacity),t.isCSS3DObjectPlus){const e=t;e.container.style.opacity=Fe.opacity.toString()}this.render()}setOriginOpacityProperty(){var t,e;if(Fe===null){const n=this.originObject3D;n instanceof P.Mesh&&(Fe={opacity:n.material.opacity}),n instanceof ps&&(Fe={opacity:(t=n.container.style.opacity)!=null?t:1}),n.isCSS3DObjectPlus&&(Fe={opacity:Number((e=n.container.style.opacity)!=null?e:1)})}}updateHelperPosition(){this.helperObject3D.updatePosition()}updateHelperQuaternion(){this.helperObject3D.updateQuaternion()}applyHelperMatrix4(t){this.helperObject3D.applyMatrix4(t)}applyHelperQuaternion(t,e){this.helperObject3D.applyHelperQuaternion(t,e)}applyHelperScaleMatrix4(t,e){this.helperObject3D.applyHelperScaleMatrix4(t,e)}onWantsGesture(t,e,n){if(this.isDragging)return!1}render(){this.onRender()}hoverListener(t,e=16777215,n=1){const s=(Array.isArray(t)?t:[t]).filter(Ue),r=[];for(const a of s)if(a instanceof P.Mesh||a instanceof P.Group){const l=a instanceof P.Group?a.children.filter(h=>h instanceof P.Mesh):[a];l.forEach(h=>{h.__originalColor__=h.material.color.clone(),h.__originalOpacity__=h.material.opacity});const c=()=>{l.forEach(h=>{h.material.color.set(e),h.material.opacity=n}),this.render()},d=()=>{l.forEach(h=>{h.material.color.copy(h.__originalColor__),h.material.opacity=h.__originalOpacity__}),this.render()},u=()=>{this.isDragging||c()},f=()=>{this.isDragging||d()};for(const h of l)this.domEvents.addEventListener(h,"mouseover",u),this.domEvents.addEventListener(h,"mouseout",f),this.hooks.on("moveStart",c),this.hooks.on("moveEnd",d),this.hooks.on("rotateEnd",d),r.push(()=>{this.domEvents.removeEventListener(h,"mouseover",u),this.domEvents.removeEventListener(h,"mouseout",f),this.hooks.off("moveStart",c),this.hooks.off("moveEnd",d),this.hooks.off("rotateEnd",d)})}return()=>r.forEach(a=>a==null?void 0:a())}getIntersectObject(t){const e=this.camera.position,n=this.helperObject3D;if(!n)return;let s;const r=t.intersectObject(n,!0)[0];if(!!r&&(s=r,s.object=n,!!s)){if(this.model.intersectRaycaster){const a=this.model.intersectRaycaster(t)[0];if(a&&a.point.distanceTo(e)<s.point.distanceTo(e))return}return s.object}}}class Km extends On{constructor(...e){super(...e);m(this,"startInfo");const n=this.helperObject3D;this.hoverListener([n.xArrow,n.yArrow,n.zArrow]);const s=this.dragStart.bind(this),r=this.dragging.bind(this),a=this.dragEnd.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",s),document.addEventListener("mousemove",r),document.addEventListener("mouseup",a)}dragStart(e){if(this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const s=(n==null?void 0:n.object).direction;if(!s)return this.dragEnd();const r=new P.Vector3(1,0,0).applyQuaternion(this.helperObject3D.quaternion),a=new P.Vector3(0,1,0).applyQuaternion(this.helperObject3D.quaternion),l=new P.Vector3(0,0,1).applyQuaternion(this.helperObject3D.quaternion),c=(()=>{switch(s){case"x":return r;case"y":return a;case"z":return l}})(),d=(()=>{switch(s){case"x":case"y":return l;case"z":return r}})(),u=n.point.clone(),f=new P.Plane;f.setFromNormalAndCoplanarPoint(d,u),this.startInfo={startVectorProject:u.clone().projectOnVector(c),directionVector:c,plane:f},this.helperObject3D.showDraggingHelper([s]),this.hooks.emit("moveStart"),this.isDragging=!0,console.log("%c MoveController dragStart","color: #e5af2e")}dragging(e){if(!this.isDragging||!this.startInfo)return;const n=Rn(this.camera,e,this.container);return n?(console.log("%c RotateController dragging","color: #49de1b"),this.move(n),!1):this.dragEnd()}move(e){if(!this.startInfo)return this.dragEnd();const{plane:n,directionVector:s,startVectorProject:r}=this.startInfo,a=this.originObject3D,l=e.ray.intersectPlane(n,new P.Vector3);if(!l)return;const c=l.clone().projectOnVector(s),d=c.clone().sub(r),u=new P.Matrix4;u.setPosition(d),a.applyMatrix4(u),this.helperObject3D.applyMatrix4(u),r.copy(c),this.hooks.emit("positionUpdate",{matrix4:u})}dragEnd(){!this.isDragging||(console.log("%c MoveController dragEnd","color: #e94e4e"),this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("moveEnd"))}}class fn{constructor(t,e,n,s){m(this,"helperController");m(this,"five");m(this,"onFiveWantsTapGesture",t=>{if(!this.helperController)return;const e=this.helperController.onWantsTapGesture(t);return this.five.needsRender=!0,e});m(this,"onFiveWantsGesture",(...t)=>{if(!this.helperController)return;const e=this.helperController.onWantsGesture(...t);return this.five.needsRender=!0,e});const{camera:r,model:a,scene:l}=t,c=t.getElement();if(this.five=t,!r||!a||!c||!l)return;const d=()=>{t.needsRender=!0};this.helperController=new e(r,a,n,s,c,l,d),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsGesture",this.onFiveWantsGesture)}}const $m="v1.0.1",ep="Object3DHelper",Hn=`${ep}@${$m}`,tp=()=>{console.error(`${Hn} is disposed`)},np=()=>{console.warn(`${Hn} is disabled`)},ip=()=>{console.error(`${Hn} is disabled`)};class op{constructor(t,e){m(this,"controllers",{});m(this,"state",{visible:!0,enabled:!0,disposed:!1});m(this,"hooks",new ht);m(this,"helpers");m(this,"eventListener",{});m(this,"handlePositionUpdate",(t,...e)=>{var r,a,l,c;const[n]=e,s=n==null?void 0:n.matrix4;s&&(t!==this.controllers.moveController&&((r=this.controllers.moveController)==null||r.applyHelperMatrix4(s)),t!==this.controllers.rotateController&&((a=this.controllers.rotateController)==null||a.applyHelperMatrix4(s)),t!==this.controllers.scaleController&&((l=this.controllers.scaleController)==null||l.applyHelperMatrix4(s)),(c=this.helpers.outlineHelper)==null||c.applyMatrix4(s))});m(this,"handleScaleUpdate",(t,...e)=>{var r,a;const[n]=e,s=n==null?void 0:n.matrix4;s&&((r=this.controllers.scaleController)==null||r.applyHelperScaleMatrix4(s,n),(a=this.helpers.outlineHelper)==null||a.scale.applyMatrix4(s))});m(this,"handleRotateUpdate",(t,...e)=>{var s,r,a,l;const[n]=e;if(n){const{quaternion:c,origin:d}=n;c&&(t!==this.controllers.moveController&&((s=this.controllers.moveController)==null||s.applyHelperQuaternion(c,d)),t!==this.controllers.rotateController&&((r=this.controllers.rotateController)==null||r.applyHelperQuaternion(c,d)),t!==this.controllers.scaleController&&((a=this.controllers.scaleController)==null||a.applyHelperQuaternion(c,d)),(l=this.helpers.outlineHelper)==null||l.applyQuaternion(c))}});t&&this.addControllers(t),this.helpers=e!=null?e:{},this.setState(this.state)}show(t){return F(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return F(this,null,function*(){this.setState({visible:!1},t)})}enable(t){this.setState({enabled:!0},t)}disable(t){this.setState({enabled:!1},t)}dispose(){this.setState({disposed:!0})}setState(t,e){if(this.state.disposed)return tp();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return ip();const n=j({},this.state);this.state=j(j({},this.state),t),t.disposed!==void 0&&t.disposed!==n.disposed&&t.disposed&&this.handleDispose(),t.visible!==void 0&&this.handleVisible(t.visible),t.enabled!==void 0&&this.handleEnable(t.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:n})}addControllers(t){this.controllers=j(j({},this.controllers),t),this.addEventListener(),this.setState(this.state)}addHelpers(t){this.helpers=j(j({},this.helpers),t)}getCurrentState(){return this.state}addEventListener(){for(const t in this.controllers){if(!t)continue;const e=t;this.eventListener[e]||(this.eventListener[e]=(()=>{const n=this.controllers[e];if(!n)return;const s=()=>this.handleStart(n),r=()=>this.handleEnd(n),a=(...d)=>this.handlePositionUpdate(n,...d),l=(...d)=>this.handleRotateUpdate(n,...d),c=(...d)=>this.handleScaleUpdate(n,...d);return n.hooks.on("moveStart",s),n.hooks.on("rotateStart",s),n.hooks.on("scaleStart",s),n.hooks.on("positionUpdate",a),n.hooks.on("rotateUpdate",l),n.hooks.on("scaleUpdate",c),n.hooks.on("moveEnd",r),n.hooks.on("rotateEnd",r),n.hooks.on("scaleEnd",r),()=>{n.hooks.off("moveStart",s),n.hooks.off("rotateStart",s),n.hooks.off("scaleStart",s),n.hooks.off("positionUpdate",a),n.hooks.off("rotateUpdate",l),n.hooks.off("scaleUpdate",c),n.hooks.off("moveEnd",r),n.hooks.off("rotateEnd",r),n.hooks.off("scaleEnd",r)}})())}}handleEnd(t){t&&this.setOtherHelpersVisible(!0,t)}handleStart(t){t&&this.setOtherHelpersVisible(!1,t)}setOtherHelpersVisible(t,e){var n,s,r,a;t?((r=this.controllers.moveController)==null||r.helperObject3D.show(),(a=this.controllers.rotateController)==null||a.helperObject3D.show()):(e!==this.controllers.moveController&&((n=this.controllers.moveController)==null||n.helperObject3D.hide()),e!==this.controllers.rotateController&&((s=this.controllers.rotateController)==null||s.helperObject3D.hide()))}handleEnable(t,e=!0){t?(this.everyControllerDo(n=>{n.enable()}),this.hooks.emit("enable",{userAction:e})):(this.everyControllerDo(n=>{n.disable(),n.restoreOpacity()}),this.hooks.emit("disable",{userAction:e})),this.state.enabled=t}handleVisible(t,e=!0){t?(this.everyControllerDo(n=>{n.show()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:e}))):(this.everyControllerDo(n=>{n.hide(),n.restoreOpacity()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:e}))),this.state.visible=t}everyControllerDo(t){Object.values(this.controllers).forEach(e=>{e&&t(e)})}handleDispose(){var t,e;Object.values(this.controllers).forEach(n=>{n==null||n.dispose(),n==null||n.restoreOpacity()});for(const n in this.controllers){if(!n)continue;const s=n;(e=(t=this.eventListener)[s])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&np()}}class sp extends On{constructor(...e){super(...e);m(this,"startInfo");m(this,"lastRotation");m(this,"rotations",[]);m(this,"helperObject3DQuaternion",this.originObject3D.quaternion.clone());const n=this.helperObject3D;this.hoverListener([n.xyCircle,n.xzCircle,n.yzCircle]);const s=this.dragStart.bind(this),r=this.dragging.bind(this),a=this.dragEnd.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",s),document.addEventListener("mousemove",r),document.addEventListener("mouseup",a)}initialHelperQuaternion(){this.helperObject3D.updateAngleHelperQuaternion(),this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion)}dragStart(e){if(this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const s=(n==null?void 0:n.object).direction;if(!s)return this.dragEnd();this.helperObject3D.updateAngleHelperQuaternion();const r=n.point,a=this.originObject3D.position.clone(),l=this.getAngleHelper(s);this.setTipsAngle(0);const c=r.clone();c.y+=.2,this.setTipsPosition(c);const d=new P.Vector3(1,0,0).applyQuaternion(this.helperObject3DQuaternion),u=new P.Vector3(0,1,0).applyQuaternion(this.helperObject3DQuaternion),f=new P.Vector3(0,0,1).applyQuaternion(this.helperObject3DQuaternion),h=(()=>{switch(s){case"x":return d;case"y":return u;case"z":return f}})(),p=new P.Plane().setFromNormalAndCoplanarPoint(h,r),g=new P.Vector3;p.projectPoint(r.clone(),g);const A=g.clone().sub(a),b=A.clone(),v=A.angleTo(l.baseAxes);this.setAngleHelperStart(s,v),this.setAngleHelperLength(s,0),this.rotations.push({vector:A.clone(),direction:!0}),this.startInfo={direction:s,startVector:A,staticStartVector:b,plane:p,angleHelper:l},this.helperObject3D.showDraggingHelper([s]),this.hooks.emit("rotateStart"),this.isDragging=!0,console.log(`%c RotateController dragStart ${s}`,"color: #e5af2e")}dragging(e){var s;if(!this.isDragging)return;const n=Rn(this.camera,e,this.container);return n?(console.log(`%c RotateController dragging ${(s=this.startInfo)==null?void 0:s.direction}`,"color: #49de1b"),this.rotate(n),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:n,plane:s,angleHelper:r,staticStartVector:a,direction:l}=this.startInfo,c=this.originObject3D,d=e.ray.intersectPlane(s,new P.Vector3);if(!d)return;const u=c.position.clone(),f=new P.Vector3;s.projectPoint(d.clone(),f);const h=f.clone().sub(u);if(n.angleTo(h)===0||(this.lastRotation===void 0&&(this.lastRotation={angle:0}),this.rotations.length===0))return;const p=(()=>{if(this.rotations.length===1)return h.angleTo(r.baseAxes)>a.angleTo(r.baseAxes);{const A=this.rotations[this.rotations.length-1],b=this.rotations[this.rotations.length-2],v=h.angleTo(b.vector),w=h.angleTo(A.vector),y=A.vector.angleTo(b.vector);if(y===0||w===0||v===0)return;if(v>w&&v>y)return A.direction;if(v<y&&w<y||v<w&&w>y)return!A.direction}})();if(p===void 0)return console.warn("rotationDirection is undefined");this.rotations.push({vector:h,direction:p}),this.rotations=this.rotations.slice(-2),this.lastRotation.angle=this.lastRotation.angle+h.angleTo(n)*(p?1:-1),this.setAngleHelperLength(l,this.lastRotation.angle),this.setTipsAngle(this.lastRotation.angle/Math.PI*180);const g=new P.Quaternion().setFromUnitVectors(n.clone().normalize(),h.clone().normalize());c.applyQuaternion(g),this.helperObject3D.applyHelperQuaternion(g),this.helperObject3DQuaternion.premultiply(g),this.hooks.emit("rotateUpdate",{quaternion:g,origin:u}),this.startInfo.startVector=h}dragEnd(){!this.isDragging||(console.log("%c RotateController dragEnd","color: #e94e4e"),this.startInfo=void 0,this.isDragging=!1,this.lastRotation=void 0,this.rotations=[],this.helperObject3D.show(),this.hooks.emit("rotateEnd"))}getAngleHelper(e){switch(e){case"x":return this.helperObject3D.xAngleHelper;case"y":return this.helperObject3D.yAngleHelper;case"z":return this.helperObject3D.zAngleHelper}}setAngleHelperStart(e,n){const s=this.getAngleHelper(e);if(s instanceof P.Mesh&&s.geometry instanceof P.CircleGeometry){const{radius:r,segments:a,thetaLength:l}=s.geometry.parameters;s.geometry=new P.CircleGeometry(r,a,n,l)}else console.warn("only support THREE.CircleGeometry")}setAngleHelperLength(e,n){const r=n>=0?Math.max(n,.001):Math.min(n,-.001),a=this.getAngleHelper(e);if(a instanceof P.Mesh&&a.geometry instanceof P.CircleGeometry){const{radius:l,thetaStart:c}=a.geometry.parameters,d=Math.ceil(Math.abs(r)*(40/(2*Math.PI)));a.geometry=new P.CircleGeometry(l,d,c,r)}else console.warn("only support THREE.CircleGeometry")}setTipsAngle(e){var s;const n=(s=this.helperObject3D.angleTips)==null?void 0:s.element;!n||(n.innerText=`${e.toFixed(0)}\xB0`)}setTipsPosition(e){const n=this.helperObject3D.angleTips;if(!n)return;const s=e.project(this.camera),{x:r,y:a,z:l}=s;if(l>1)return;const c=(r+1)/2*100+"%",d=(-a+1)/2*100+"%";n.setLeftTop(c,d)}}class rp extends On{constructor(...e){super(...e);m(this,"startInfo")}enable(){this.helperObject3D.enable(),super.enable()}disable(){this.helperObject3D.disable(),super.disable()}show(){this.helperObject3D.show(),super.show()}hide(){this.helperObject3D.hide(),super.hide()}getDragPlane(){const e=new P.Plane,n=this.helperObject3D.cornerPositions;if(n.length!==0)return n.length<3?e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new M.Vector3),n[0]):e.setFromCoplanarPoints(n[0],n[1],n[2]),e}dragStart(e,n){var r,a;(a=(r=this.helperObject3D).updatePoints)==null||a.call(r);const s=this.getDragPlane();if(!s)return this.dragEnd();this.startInfo={startPoint:{position:n.position.clone(),direction:n.direction},plane:s},this.hooks.emit("scaleStart"),this.render(),this.isDragging=!0,console.log("%c RectangleScaleController dragStart","color: #e5af2e")}dragging(e){if(!this.isDragging)return;const n=Rn(this.camera,e,this.container);if(!n)return this.dragEnd();this.scale(n),console.log("%c RectangleScaleController dragging","color: #49de1b")}scale(e){var z,L;if(!this.startInfo)return;const n=this.originObject3D,{startPoint:s,plane:r}=this.startInfo,a=this.helperObject3D.cornerPositions;if(a.length<4)return this.dragEnd();const l=e.ray.intersectPlane(r,new M.Vector3);if(!l||Xm(l,this.camera.position))return;const c=new M.Vector3().addVectors(a[0],a[2]).divideScalar(2),{position:d,direction:u}=s,f=new M.Vector3().subVectors(a[1],a[0]),h=new M.Vector3().subVectors(a[3],a[0]),p=T=>{const R=new M.Vector3(0,0,0);if(!this.startInfo)return R;const E=(T==="ew"?f:h).clone(),S=d.clone().projectOnVector(E),_=l.clone().projectOnVector(E),B=c.clone().projectOnVector(E);if(_.equals(S))return R;if(T==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const Q=new M.Vector3().subVectors(_,B),H=Q.x<0&&E.x>=0,X=Q.y<0&&E.y>=0,Y=Q.z<0&&E.z>=0;this.startInfo.dragPointInCenterBottom=H||X||Y}if(T==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const Q=new M.Vector3().subVectors(_,B),H=Q.x<0&&E.x>=0,X=Q.y<0&&E.y>=0,Y=Q.z<0&&E.z>=0;this.startInfo.dragPointInCenterLeft=H||X||Y}const O=new M.Vector3().subVectors(_,S),G=O.length();return G>.3?(console.warn("offset.length() > 0.3, skipped",G),R):O},g=p("ew"),A=p("ns"),b=()=>{const T=g;this.helperObject3D.cornerPositions.forEach((R,E)=>{var S;(S=this.startInfo)!=null&&S.dragPointInCenterLeft?(E===0||E===3)&&R.add(T):(E===1||E===2)&&R.add(T)})},v=()=>{const T=A;this.helperObject3D.cornerPositions.forEach((R,E)=>{var S;(S=this.startInfo)!=null&&S.dragPointInCenterBottom?(E===0||E===1)&&R.add(T):(E===2||E===3)&&R.add(T)})};switch(u){case"ew":b();break;case"ns":v();break;case"nesw":case"nwse":b(),v()}const w=new M.Vector3().subVectors(a[1],a[0]).length()/f.length(),y=new M.Vector3().subVectors(a[3],a[0]).length()/h.length(),I=new M.Vector3(w,y,1),k=new P.Matrix4().scale(I);n.isCSS3DObjectPlus?n.applyScaleMatrix4(k):n.scale.applyMatrix4(k),s.position.copy(l);const C=new M.Vector3().addVectors(a[0],a[2]).divideScalar(2),D=new M.Vector3().subVectors(C,c),x=new P.Matrix4().setPosition(D);n.applyMatrix4(x),(z=this.helperObject3D.css3DInstance)==null||z.css3DObject.applyMatrix4(x),(L=this.helperObject3D.plane)==null||L.applyMatrix4(x),this.hooks.emit("scaleUpdate",{matrix4:k,helperOrigin:c}),this.hooks.emit("positionUpdate",{matrix4:x}),this.render()}dragEnd(){!this.isDragging||(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render(),console.log("%c RectangleScaleController dragEnd","color: #e94e4e"))}}class ap extends rp{constructor(...t){super(...t),this.addHTMLEventListener()}addHTMLEventListener(){this.helperObject3D.points.forEach(t=>{if(!t)return;const e=t.point,n=a=>this.dragStart(a,t),s=this.dragging.bind(this),r=this.dragEnd.bind(this);e.addEventListener("dragstart",n),e.addEventListener("drag",s),e.addEventListener("dragend",r)})}}const Fn="v1.0.0",Pn="Object3DHelperPlugin",Zt=`${Pn}@${Fn}`,lp=()=>{console.error(`${Zt} is disposed`)},cp=()=>{console.warn(`${Zt} is disabled`)},dp=()=>{console.error(`${Zt} is disabled`)};class or extends Xt{constructor(e){super(e);m(this,"version",Fn);m(this,"name",Pn);m(this,"state",{visible:!0,enabled:!0,disposed:!1});m(this,"objectHelperMap",new Map);this.five=e,console.warn("Object3DHelper: \u4F7F\u7528\u6B64\u63D2\u4EF6\u9700\u8981\u5728\u521D\u59CB\u5316five\u65F6\uFF0C\u8BBE\u7F6Efive\u53C2\u6570: { backgroundAlpha: 0, backgroundColor: 0x000000 }"),Object.assign(window,{[`__${Pn.toUpperCase()}_DEBUG__`]:this})}show(e){return F(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return F(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){if(this.state.disposed)return lp();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return dp();const s=j({},this.state);this.state=j(j({},this.state),e),e.disposed!==void 0&&e.disposed!==s.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==s.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==s.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:s})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,n={}){var u;if(!e)return console.error("Object3D is undefined");if(this.objectHelperMap.has(e)){console.warn(`Object3DHelperPlugin: object3D ${e.name} is already has helper`);return}const s=new op;this.objectHelperMap.set(e,s);const r=(u=this.five.getElement())==null?void 0:u.parentElement,a=this.five.camera,{moveHelper:l=!0,rotateHelper:c=!0,scaleHelper:d=!0}=n;if(l){const f=new Ym(e),h=new fn(this.five,Km,e,f);s.addControllers({moveController:h.helperController})}if(c){let f;r&&a&&(f={container:r});const h=new Jm(e,f),p=new fn(this.five,sp,e,h);s.addControllers({rotateController:p.helperController})}if(d&&r){const f=new qm(e,r,a,this.five.scene),h=new fn(this.five,ap,e,f);s.addControllers({scaleController:h.helperController})}e.isCSS3DObjectPlus&&e.changeMode("behind",this.five.scene)}removeObject3DHelper(e){const n=this.objectHelperMap.get(e);!n||(e.isCSS3DObjectPlus&&e.changeMode("front"),this.objectHelperMap.delete(e),n.dispose())}handleEnable(e,n=!0){e?(this.everyHelperDo(s=>s.enable()),this.hooks.emit("enable",{userAction:n})):(this.everyHelperDo(s=>s.disable()),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){e?(this.everyHelperDo(s=>s.show()),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.everyHelperDo(s=>s.hide()),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}handleDispose(){this.everyHelperDo(e=>e.dispose())}everyHelperDo(e){this.objectHelperMap.forEach(n=>{n&&e(n)})}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&cp()}}const up=o=>new or(o);class In{constructor(t=0,e=0){m(this,"min");m(this,"max");m(this,"isInterval",!0);this.min=t,this.max=e}fromArray(t){return this.min=t[0],this.max=t[1],this}isOverlap(t){return Math.min(this.max,t.max)<Math.max(this.min,t.min)}contains(t){return this.min<t.min&&this.max>t.max}}class hp{constructor(t,e){m(this,"min");m(this,"max");m(this,"xInterval");m(this,"yInterval");m(this,"isRectangle",!0);this.min=t,this.max=e,this.xInterval=new In(this.min.x,this.max.x),this.yInterval=new In(this.min.y,this.max.y)}isOverlapWithRectangle(t){return!this.xInterval.isOverlap(t.xInterval)&&!this.yInterval.isOverlap(t.yInterval)}containsRect(t){return this.xInterval.contains(t.xInterval)&&this.yInterval.contains(t.yInterval)}}function St(o,t,e){const n=o[t],s=o[e];!n||!s||(o[t]=s,o[e]=n)}function fp(o,t,e){const n=e/2;for(let s=1;s<=n;s++){const r=e-(s-1);for(let a=1;a<=t;a++){const l=(s-1)*t+a-1,c=(r-1)*t+a-1;St(o,l*4+0,c*4+0),St(o,l*4+1,c*4+1),St(o,l*4+2,c*4+2),St(o,l*4+3,c*4+3)}}}class sr{constructor(t,e){m(this,"width");m(this,"height");m(this,"containerDom");m(this,"hooks",new ee.Subscribe);m(this,"canvas",document.createElement("canvas"));m(this,"five");m(this,"scale");m(this,"config");m(this,"offset",{x:0,y:0});m(this,"context");m(this,"renderCenter",new P.Vector3);m(this,"hammer");m(this,"state",{enabled:!1});m(this,"onPan",t=>{if(!this.containerDom||this.hooks.emit("wantsPanGesture",t))return;const n=this.offset.x+t.deltaX,s=this.offset.y+t.deltaY;this.canvas.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)",this.canvas.style.transform=`translate3d(${n}px, ${s}px, 100px)`});m(this,"onPanEnd",t=>{this.offset={x:this.offset.x+t.deltaX,y:this.offset.y+t.deltaY},this.canvas.style.boxShadow="none"});var s,r,a;if(!t.renderer)throw new Error("Five Render \u672A\u521D\u59CB\u5316");this.five=t,this.scale=(s=e==null?void 0:e.scale)!=null?s:2,this.width=(r=e==null?void 0:e.width)!=null?r:190,this.height=(a=e==null?void 0:e.height)!=null?a:190,this.config={dragEnabled:(e==null?void 0:e.dragEnabled)||!1,autoFixPCPosition:(e==null?void 0:e.autoFixPCPosition)||!1,initialPosition:(e==null?void 0:e.initialPosition)||{left:"0",top:"0"}};const n=this.canvas.getContext("2d");if(!n)throw new Error("CANNOT CREATE CONTEXT2D");this.context=n,this.config.dragEnabled&&(this.hammer=new ut.default(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panend",this.onPanEnd)),this.initStyle()}dispose(){var t;this.clear(),this.disable(),(t=this.hammer)==null||t.destroy()}enable(){var t;if(!this.state.enabled)return this.state.enabled=!0,(t=this.containerDom)==null||t.append(this.canvas),this}disable(){if(!!this.state.enabled)return this.state.enabled=!1,this.canvas.remove(),this}appendTo(t){var e;return this.containerDom&&((e=this.containerDom)==null||e.removeChild(this.canvas)),this.containerDom=t,this.state.enabled&&t.append(this.canvas),this}clear(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this}renderWithPoint(t){!this.containerDom||!this.state.enabled||(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}autoFixPCPosition(){if(!this.containerDom)return;const{width:t,height:e}=this,n=this.renderCenter.clone().project(this.five.camera),s=(n.x+1)/2*this.containerDom.clientWidth,r=-(n.x-1)/2*this.containerDom.clientWidth,a=-(n.y-1)/2*this.containerDom.clientHeight;s<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=90+"px"):a<183?(this.canvas.style.top=90+"px",this.canvas.style.left=-t/2+"px"):r<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=-t-90+"px"):(this.canvas.style.left=-t/2+"px",this.canvas.style.top=-e-90+"px"),this.canvas.style.transform=`translate3d(${s}px, ${a}px, 10px)`,this.offset={x:s,y:a}}render(){if(!this.five.renderer||!this.containerDom)return;const{scale:t,context:e,width:n,height:s}=this,r=this.renderCenter.clone().project(this.five.camera),a=this.five.renderer.getSize(new P.Vector2),l=1,c=n/t,d=s/t,u=l*t,f=(r.x+1)/2*a.x,h=(r.y+1)/2*a.y,p=this.five.getPixels(f-c/2,h-c/2,c,d,u),g=Math.floor(n*l),A=Math.floor(s*l);fp(p,g,A);const b=new ImageData(g,A);b.data.set(p),e.putImageData(b,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}}function mp(o,t){const{offsetWidth:e,offsetHeight:n}=t,{top:s,left:r}=t.getBoundingClientRect();return new P.Vector2().set((o.x-r)/e*2-1,-(o.y-s)/n*2+1)}function rr(o,t){const{offsetWidth:e,offsetHeight:n}=t;return new P.Vector2().set(o.x/e*2-1,-o.y/n*2+1)}function pp(o,t){const e=o.getElement();if(!e)return;const n=rr(t,e),s=new P.Raycaster;return s.setFromCamera(n,o.camera),s}function gp(o,t){const{x:e,y:n}=t,s=e*2-1,r=n*2-1,a=new P.Vector2().fromArray([s,r]),l=new P.Raycaster;return l.setFromCamera(a,o.camera),o.model.intersectRaycaster(l)[0]}const Ap="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbYAAAGwCAYAAADFUEBtAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABtqADAAQAAAABAAABsAAAAABTZ8U6AAAtiklEQVR4Ae2dAXJbSbJdp+d7AfYSHOGVeAPek5fkNXgLjviLmRkZl+CRbtc8UBKRRalZpyIesiorMx/eIcjb+QCh//Y3hwQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkI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ISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQn8NQn8fyHnyuSABiy2AAAAAElFTkSuQmCC",vp=`
|
|
542
542
|
varying vec2 vUv;
|
|
543
543
|
void main() {
|
|
544
544
|
vUv = uv;
|