@realsee/dnalogel 2.3.7 → 2.3.8
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 +12 -12
- package/dist/index.js +115 -115
- package/dist/index.umd.js +12 -12
- package/docs/classes/CSS3DRender.html +31 -31
- 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 +11 -11
- 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/PanoTagPlugin/Components/TagWrapper.js +56 -56
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -98,12 +98,12 @@ transition: all 500ms;
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
</style>
|
|
101
|
-
`;class kl extends Il{constructor(e){super();f(this,"configs");f(this,"clientWidth");f(this,"clientHeight");f(this,"ready",!1);f(this,"uuid",He());f(this,"tween");f(this,"tweening",!1);f(this,"container");f(this,"canvas");f(this,"data",{});f(this,"tempLine",{});this.configs=e,this.clientWidth=document.body.clientWidth,this.clientHeight=document.body.clientHeight,this.container=this.ifInsertToDOM(),this.canvas={},this.initCtrl()}get color(){return this.configs.currentColor}get state(){return this.data}get dpr(){return this.configs.DPR||1}ifInsertToDOM(){if(this.container)return this.container;if(this.configs.container)this.configs.container.id="_gl_paintBrush",this.container=this.configs.container;else if(document.getElementById("_gl_paintBrush"))this.container=document.getElementById("_gl_paintBrush");else{const e=document.createElement("div");e.id="_gl_paintBrush",document.body.appendChild(e),this.container=e}return this.container.innerHTML=xl,this.container}initCanvas(e){const n=document.createElement("canvas");n.className=e,n.width=this.clientWidth,n.height=this.clientHeight;const o=n.getContext("2d");if(!!o)return o.lineWidth=5*this.dpr,o.lineCap="round",o.lineJoin="round",this.container.appendChild(n),n}initCtrl(){const e=document.createElement("div");e.className="_paintBrush-ctrl";const n=document.createElement("div");n.className="_paintBrush-ctrlinner";const o=document.createElement("a");o.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--undo",o.addEventListener("click",a=>{var h;if(a.stopPropagation(),this.configs.onClickUndo&&this.configs.onClickUndo(),!this.canvas[this.uuid]||!this.data[this.uuid]||this.data[this.uuid].length===0)return;const l=this.data[this.uuid].pop();l&&this.emitStateChange({type:it.Undo,color:this.color,ready:this.ready,state:l,uuid:this.uuid});const c=(h=this.canvas[this.uuid])==null?void 0:h.getContext("2d");if(!this.canvas[this.uuid])return;const{width:u,height:d}=this.canvas[this.uuid];c&&c.clearRect(0,0,u,d),this.data[this.uuid].forEach(p=>this.handleDrawLine(this.uuid,p,{withUndo:!0}))});const s=document.createElement("a");return s.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--close",s.addEventListener("click",a=>{a.stopPropagation(),this.closeBrush(),this.configs.onClickClose&&this.configs.onClickClose()}),[o,s].forEach(a=>{const l=document.createElement("i");l.className="brush-icon";const c=document.createElement("span");c.className="brush-txt",c.innerText=a.className.endsWith("undo")?this.configs.onUndoText:this.configs.onExitText,a.appendChild(l),a.appendChild(c)}),n.appendChild(o),n.appendChild(s),e.appendChild(n),this.container.appendChild(e),e}openBrush(){if(this.ready)return;this.canvas[this.uuid]||(this.canvas[this.uuid]=this.initCanvas("_paintBrush-canvas")),this.container.className="brushing";const e=this.canvas[this.uuid];e.getContext("2d").clearRect(0,0,e.width,e.height),this.openBrushHandle(),this.ready=!0,this.emit("readyChange",!0)}closeBrush(){!this.ready||(this.container.className="",this.data={},this.tempLine={},Object.keys(this.canvas).forEach(e=>{this.canvas[e].ontouchstart=()=>!1,this.canvas[e].ontouchmove=()=>!1,this.canvas[e].ontouchend=()=>!1,this.canvas[e].ontouchcancel=()=>!1;const n=this.canvas[e].getContext("2d");n&&n.clearRect(0,0,this.canvas[e].width,this.canvas[e].height)}),this.ready=!1,this.emit("readyChange",!1),this.emitStateChange({type:it.Exit,color:this.color,ready:!1,uuid:this.uuid}))}updateCurrentColor(e){const n=this.canvas[this.uuid];if(!n)return;const o=n.getContext("2d");!o||(this.configs.currentColor=e,o.strokeStyle=e)}openBrushHandle(){const e=this.canvas[this.uuid];if(!e)return;const n=e.getContext("2d");if(!n)return;const o=this.color||"#6D92FF";n.strokeStyle=o;let s=null,r=[],a,l=[],c=0;const u=(d,h,p)=>{const m=this.color||"#ff0000";n.strokeStyle=m,n.beginPath(),n.moveTo(d.x,d.y),n.quadraticCurveTo(h.x,h.y,p.x,p.y),n.stroke()};e.onmousedown=d=>{d.preventDefault(),c=Date.now();const h=d.clientX,p=d.clientY;r=[],r.push({x:h,y:p}),s={x:h,y:p},a=vn({x:h,y:p},this.clientWidth,this.clientHeight),l=[]},e.onmousemove=d=>{if(d.preventDefault(),!s)return;const h=Number(d.clientX),p=Number(d.clientY);if(Math.abs(h-s.x)<5&&Math.abs(p-s.y)<5||(r.push({x:h,y:p}),l.push(vn({x:h,y:p},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:m,end:g}=bn(r);!m||!g||(u(s,m,g),s=g)},e.onmouseup=d=>{if(d.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const h=Date.now()-c,p={move:Object.assign({},a),uuid:this.uuid,line:[...l],color:this.color,duration:h<1280?h:h<2e3?1280:0};this.data[this.uuid].push(p),Rn(()=>{this.emitStateChange({type:it.Drawline,color:this.color,ready:this.ready,state:p,uuid:this.uuid})})},e.ontouchstart=d=>{d.preventDefault(),c=Date.now();const h=d.touches[0].clientX,p=d.touches[0].clientY;r=[],r.push({x:h,y:p}),s={x:h,y:p},console.log("ontouchstart",h,p,s),a=vn({x:h,y:p},this.clientWidth,this.clientHeight),l=[]},e.ontouchmove=d=>{if(d.preventDefault(),!s)return;const h=Number(d.touches[0].clientX),p=Number(d.touches[0].clientY);if(Math.abs(h-s.x)<5&&Math.abs(p-s.y)<5||(r.push({x:h,y:p}),l.push(vn({x:h,y:p},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:m,end:g}=bn(r);!m||!g||(u(s,m,g),s=g)},e.ontouchend=e.ontouchcancel=d=>{if(d.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const h=Date.now()-c,p={move:Object.assign({},a),line:[...l],uuid:this.uuid,color:this.color,duration:h<1280?h:h<2e3?1280:0};this.data[this.uuid].push(p),Rn(()=>{this.emitStateChange({type:it.Drawline,color:this.color,ready:this.ready,state:p,uuid:this.uuid})})}}emitStateChange(e,n=!0){if(e.type!==it.Drawline){this.emit("stateChange",e,n);return}const o=Date.now(),s=e.state;if(!s||!s.line)return;const r=Math.ceil(s.line.length/100);for(let a=0;a<r;a++){const l={uuid:this.uuid,color:this.color,ready:this.ready,type:e.type,state:{uuid:this.uuid,move:s.move,duration:s.duration,color:this.color,line:s.line.slice(a*100,(a+1)*100)},timestamp:o,end:a===r-1};wl(a,20,()=>{this.emit("stateChange",l,n)})}}action(e){const{ready:n,type:o,uuid:s}=e;if(!n&&this.ready){this.closeBrush();return}if(n&&!this.ready){this.openBrush();return}if(!!this.ready)switch(o){case it.Drawline:const{state:r,timestamp:a,end:l}=e;if(!a||!r)return;this.tempLine[a]=[].concat(this.tempLine[a]||[],r.line),l&&(Object.assign(r,{line:this.tempLine[a]}),this.handleDrawLine(s,r,{},()=>delete this.tempLine[a]));break;case it.Undo:this.handleUndo(s);break}}handleDrawLine(e,n,{withUndo:o=!1},s=Nr){!n||Object.prototype.toString.call(n)!="[object Object]"||Object.keys(n).length===0||(console.log("handleDrawLine",n,n.line),yl(()=>new Promise(r=>{if(o||(this.canvas[e]||(this.canvas[e]=this.initCanvas("_paintBrush-canvas--sync")),this.data[e]||(this.data[e]=[]),this.data[e].push(n)),!this.canvas[e])return;const a=this.canvas[e].getContext("2d");if(!a)return;const{line:l=[],color:c="black",duration:u=0,uuid:d}=n,h=mi(n.move||{},this.clientWidth,this.clientHeight);let p=[h];if(a.strokeStyle=c,a.beginPath(),a.moveTo(h.x,h.y),u&&!o){let m=[];const g=this;g.tween=El({step:0},{step:l.length-1},u).onUpdate(({step:A})=>{var w;if(g.tweening=!0,!g.ready)return a.clearRect(0,0,g.canvas[d].width,g.canvas[d].height),(w=g.tween)==null?void 0:w.stop();const v=Math.floor(A);if(!m.find(y=>y===v)){if(m.push(v),console.log("__debug__",l,l[v],v),p.push(mi(l[v],g.clientWidth,g.clientHeight)),p.length<3)return;const{control:y,end:x}=bn(p);if(!y||!x)return;a.quadraticCurveTo(y.x,y.y,x.x,x.y),a.stroke()}}).onComplete(A=>{g.tween=void 0,g.tweening=!1,m=[],p=[],s&&s(),r()})}else{for(let m=0;m<l.length;m++){if(p.push(mi(l[m],this.clientWidth,this.clientHeight)),p.length<3)continue;const{control:g,end:A}=bn(p);!g||!A||a.quadraticCurveTo(g.x,g.y,A.x,A.y)}a.stroke(),p=[],s&&s(),r()}})))}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 s;const o=(s=this.canvas[e])==null?void 0:s.getContext("2d");o&&o.clearRect(0,0,this.canvas[e].width,this.canvas[e].height),this.data[e].forEach(r=>this.handleDrawLine(e,r,{withUndo:!0}))};if(this.tween&&this.tweening){this.tween.stop(),Rn(n,60);return}n()}destroyBrush(){this.closeBrush(),this.ready=!1,this.emit("readyChange",!0)}}class Dl{constructor(t={}){f(this,"controller");const e=Object.assign({currentColor:"#f44336",onUndoText:"\u56DE\u9000",onExitText:"\u5173\u95ED"},t);this.controller=new kl(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 Ll=(i,t)=>{var U,P;let e=(P=(U=t==null?void 0:t.initialState)==null?void 0:U.enabled)!=null?P:!0,n=!1,o=!0,s=null;const a=N(N({},{lookAtCurrentCamera:!1,lockedPanoIndex:null,lockedLatitude:null,lockedLongitude:null}),t==null?void 0:t.config),l=new E.Scene,c=new be.Camera(60);let u=new E.Object3D,d,h;{const I=new E.DirectionalLight(16777215,.5);I.position.copy(new E.Vector3(1,1,1)),l.add(I)}{const I=new E.DirectionalLight(16777215,.3);l.add(I)}{const I=new E.AmbientLight(16777215,.3);l.add(I)}l.add(u);const p=()=>{if(n)return;d=L(i.model,c.fov,c.aspect),h=i.model.bounding.getCenter(new E.Vector3),l.remove(u),u=z(i.model),l.add(u),n=!0,S();function I(H){const X=H.clone();return X.uniforms.modelAlpha.value=1,X.uniforms.map.value&&(X.uniforms.map.value.needsUpdate=!0),X}function z(H){if(H instanceof E.Mesh){const X=H.geometry,Z=Array.isArray(H.material)?H.material.map(I):I(H.material);return new E.Mesh(X,Z)}else if(H instanceof E.Group){const X=new E.Group;return H.children.forEach(Z=>X.add(z(Z))),X}else{const X=new E.Object3D;return H.children.forEach(Z=>X.add(z(Z))),X}}},m=()=>{if(!!i.renderer)return s||(s=new E.WebGLRenderer({antialias:!1,alpha:!0}),s.setPixelRatio(i.renderer.getPixelRatio()),s.outputEncoding=E.sRGBEncoding,s.setClearColor(1579548,0),s.autoClear=!0),s},g=()=>{u.traverse(I=>{I instanceof E.Mesh&&[].concat(I.material).forEach(H=>H.dispose())}),l.remove(u),u=new E.Object3D,l.add(u),n=!1,S()},A=()=>{!e||n||p()},v=()=>{e||(e=!0,l.add(u),!n&&i.model.loaded&&p(),S())},w=()=>{!e||(l.remove(u),o=!0,k(),e=!1)},y=(I,z={})=>{const H=m();if(!H)return;I.appendChild(H.domElement),x(z);const X=window.getComputedStyle(I).position;X!=="relative"&&X!=="absolute"&&X!=="fixed"&&X!=="sticky"&&(I.style.position="relative")},x=(I={})=>{if(!s)return;const H=s.domElement.parentNode;if(H!=null&&H.nodeName){const{width:X=H.offsetWidth,height:Z=H.offsetHeight}=I;s.setSize(X,Z),c.aspect=X/Z,c.updateProjectionMatrix()}S()};function L(I,z,H){const X=I.bounding,Z=Math.pow(Math.pow(X.max.x-X.min.x+1,2)+Math.pow(X.max.y-X.min.y+1,2)+Math.pow(X.max.z-X.min.z+1,2),1/2);let Y=Z/2/Math.tan(Math.PI*z/360);return H<1&&(Y=Y/H),isNaN(Y)?Z:Y}function C(I){return i.work.observers[I].standingPosition.clone()}const S=()=>{if(!e||!d||!h)return;const I=i.getPose();I.fov=c.fov,I.offset=h,I.distance=d,typeof a.lockedLatitude=="number"&&(I.latitude=a.lockedLatitude),typeof a.lockedLongitude=="number"&&(I.longitude=a.lockedLongitude),typeof a.lockedPanoIndex=="number"&&(I.offset=C(a.lockedPanoIndex)),a.lookAtCurrentCamera&&(I.offset=i.camera.position.clone().setY(i.camera.position.y+1)),c.setFromPose(I),o=!0},k=()=>{!e||o!==!0||!s||!s.domElement.parentNode||s.domElement.parentNode.offsetWidth===0||(s.render(l,c),o=!1)},G=()=>{s&&s.dispose(),s=null},O=I=>{Object.assign(a,I),S()},W=()=>({enabled:e});return Object.assign(window,{camera:c}),i.on("modelLoaded",A),i.on("modelWillLoad",g),i.on("cameraDirectionUpdate",S),i.on("dispose",G),i.on("renderFrame",k),i.on("cameraPositionUpdate",S),{appendTo:y,refresh:x,changeConfigs:O,enable:v,disable:w,getCurrentState:W}};function pt(...i){const t=[];return i.forEach(e=>{e.isCSS3DObjectPlus?t.push(e):t.push(...pt(...e.children))}),t}function Nn(i,t){const e=Math.round(i);return e%2===0?e:e+Number(t!=null&&t.floor?-1:1)}function Sl(i,t,e=!0){if(!i)return console.error("createResizeObserver: element is undefined"),{observe:()=>{},unobserve:()=>{}};const n=()=>{const s=Nn(i.clientWidth,{floor:!0}),r=Nn(i.clientHeight,{floor:!0});t(s,r)};if(typeof ResizeObserver=="undefined"||!ResizeObserver)return console.warn("createResizeObserver: ResizeObserver is undefined"),{observe:()=>n(),unobserve:()=>{}};const o=new ResizeObserver(n);return e&&n(),{observe:()=>o.observe(i),unobserve:()=>o.unobserve(i)}}class wo extends un.CSS3DRenderer{constructor(){super();f(this,"wrapper");f(this,"requestAnimationFrameId");f(this,"resizeDisoper");this.domElement.style.position="absolute",this.domElement.style.top="0",this.domElement.style.left="0",this.domElement.style.userSelect="none",this.domElement.style.pointerEvents="none"}setWrapper(e){if(!e)throw new Error("CSS3DRenderer: wrapper is required");if(e.contains(this.domElement))return;const n=this.wrapper;return n&&n.contains(this.domElement)&&this.domElement.remove(),this.appendToElement(e),this.wrapper=e,this}appendToElement(e){e.appendChild(this.domElement);const n=(r,a)=>this.setSize(r,a),{observe:o,unobserve:s}=Sl(e,n,!0);o(),this.resizeDisoper=s,this.wrapper=e}renderEveryFrame(e,n){if(this.wrapper||console.warn("wrapper is not find, creating a html element and call setWrapper(wrapper)",this,e),this.requestAnimationFrameId)return console.warn("CSS3DRenderer: render is running");const o=()=>{this.requestAnimationFrameId=requestAnimationFrame(o),!!e.visible&&pt(e).length!==0&&this.render(e,n)};o()}stopRender(){this.requestAnimationFrameId&&cancelAnimationFrame(this.requestAnimationFrameId)}dispose(){var e;this.stopRender(),(e=this.resizeDisoper)==null||e.call(this),this.domElement.remove()}}function zl(i){return typeof Symbol=="undefined"?`$Symbol<${i}>$`:Symbol(i)}const ln=zl("$$EVENT$$");function wn(i){return i[ln]||(i[ln]={}),i[ln]}function Ml(i){i[ln]||delete i[ln]}class qt{hasListener(t){const e=wn(this);return Boolean((e==null?void 0:e[t])&&e[t].length>0)}on(t,e,n){const o=wn(this);return o[t]||(o[t]=[]),o[t].push([e,n||!1]),()=>this.off(t,e)}once(t,e){return this.on(t,e,!0)}off(t,e){if(t===void 0){Ml(this);return}const n=wn(this);if(n[t]||(n[t]=[]),e===void 0){n[t].length=0;return}let o=0;for(;o<n[t].length&&n[t][o][0]!==e;o++);o<n[t].length&&n[t].splice(o,1)}emit(t,...e){let n=!1;const s=wn(this)[t]||[];for(let r of s.slice()){const[a,l=!1]=r,c=a(...e);l&&this.off(t,a),c===!1&&(n=!0)}return n}}function Wr(...i){const t=new F.Vector3;return i.forEach(e=>{t.add(e)}),t.divideScalar(i.length),t}const Tl=({x:i,y:t,z:e})=>new F.Vector3(i,t,e),st=([i,t,e])=>new F.Vector3(i,t,e),hn=i=>i instanceof F.Vector3?i:Array.isArray(i)?st(i):Tl(i);class Bl extends E.Mesh{constructor(e,n){const o=new E.MeshBasicMaterial({opacity:0,color:0,transparent:!1,side:E.DoubleSide}),s=new E.PlaneGeometry(e,n);super(s,o);f(this,"name","opacity-mesh")}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}}const Xr=1,jl=`CSS3DObjectPlus@${Xr}`,Ql=.00216,Rl=.003;class Yr extends un.CSS3DObject{constructor(e){var L,C,S;const n=e.container,o=e.cornerPoints,s=(L=e.ratio)!=null?L:Rl,r=(C=e.dpr)!=null?C:1,a=(S=e.pointerEvents)!=null?S:"auto",l=Math.max(Ql,s),c=o[0].distanceTo(o[1]),u=o[1].distanceTo(o[2]),d=Nn(c/s*r),h=Nn(u/s*r),p=Wr(...o);let m;if(l===s)n.style.width=`${d}px`,n.style.height=`${h}px`,m=n;else{const k=document.createElement("div");k.style.width=`${d}px`,k.style.height=`${h}px`,k.style.pointerEvents="none";const G=s/l;n.style.position="absolute",n.style.left="0",n.style.top="0",n.style.width=`${G*d}px`,n.style.height=`${G*h}px`,k.appendChild(n),m=k}super(m);f(this,"version",Xr);f(this,"isCSS3DObjectPlus",!0);f(this,"container");f(this,"width");f(this,"height");f(this,"domWidthPx");f(this,"domHeightPx");f(this,"cornerPoints");f(this,"centerPosition");f(this,"ratio");f(this,"mode","front");f(this,"hooks",new qt);f(this,"opacityMesh");f(this,"selfVisible",!0);f(this,"parentVisibleListenerDisposer");f(this,"createOpacityMesh",e=>{const{domWidthPx:n,domHeightPx:o}=e,s=new Bl(n,o);return s.position.copy(e.position),s.rotation.copy(e.rotation),s.scale.copy(e.scale),s});f(this,"addParentVisibleListener",()=>{var e;if((e=this.parent)!=null&&e.isCSS3DGroup){const n=this.parent,o=s=>{this.setVisible(s&&this.selfVisible,{setSelfVisible:!1})};n.hooks.on("visibleChange",o),this.parentVisibleListenerDisposer=()=>n.hooks.off("visibleChange",o)}});f(this,"removeParentVisibleListener",()=>{var e;(e=this.parentVisibleListenerDisposer)==null||e.call(this)});if(n.style.pointerEvents=a,this.scale.set(l,l,l),this.cornerPoints=o,this.ratio=s,this.container=n,e.mode&&(this.mode=e.mode),l===s)this.width=c,this.height=u,this.domWidthPx=d,this.domHeightPx=h,this.centerPosition=p;else{const k=s/l;this.width=k*c,this.height=k*u,this.domWidthPx=k*d,this.domHeightPx=k*h,this.centerPosition=new F.Vector3().subVectors(p,o[0]).multiplyScalar(k).add(o[0])}n.classList.add(`${jl}__container`);const g=new F.Vector3().subVectors(o[1],o[0]),A=new F.Vector3().subVectors(o[3],o[0]),v=new F.Vector3().crossVectors(g,A).normalize();this.lookAt(v);const w=this.up.clone().applyQuaternion(this.quaternion),y=A.clone(),x=new F.Vector3().crossVectors(w,y).normalize();this.rotateOnWorldAxis(x,w.angleTo(y)),this.position.copy(p),this.addEventListener("added",()=>{var k;this.mode==="front"&&((k=this.opacityMesh)==null||k.removeFromParent()),this.addParentVisibleListener()}),this.addEventListener("removed",()=>{var k;(k=this.opacityMesh)==null||k.removeFromParent(),this.removeParentVisibleListener()})}setVisible(e,n={setSelfVisible:!0}){n.setSelfVisible&&(this.selfVisible=e),this.visible=e,this.opacityMesh&&(this.opacityMesh.visible=e)}removeFromParent(){var n;const e=this.parent;return e!==null&&e.remove(this),(n=this.opacityMesh)==null||n.removeFromParent(),this}removeOpacityMesh(){var e;return(e=this.opacityMesh)==null||e.removeFromParent(),this.opacityMesh=void 0,this}dispose(){var e;this.container.remove(),this.removeFromParent(),(e=this.opacityMesh)==null||e.removeFromParent()}getOpacityMesh(){if(this.opacityMesh)return this.opacityMesh;{const e=this.createOpacityMesh(this);return this.opacityMesh=e,e}}applyMatrix4(e){var n;super.applyMatrix4(e),(n=this.opacityMesh)==null||n.applyMatrix4(e)}applyQuaternion(e){var n;return super.applyQuaternion(e),(n=this.opacityMesh)==null||n.applyQuaternion(e),this}applyScaleMatrix4(e){var n;this.scale.applyMatrix4(e),(n=this.opacityMesh)==null||n.scale.applyMatrix4(e)}}class Ol extends E.Scene{constructor(){super()}add(...t){return super.add(...t),pt(...t).forEach(e=>{e.mode="front"}),this}}class Hl extends E.Scene{constructor(e){super();f(this,"scene");if(!e)throw new Error("CSS3DBehindScene: scene is required");this.scene=e}add(...e){return super.add(...e),pt(...e).forEach(n=>{n.mode="behind",this.scene.add(n.getOpacityMesh())}),this}remove(...e){return pt(...e).forEach(n=>{var o;(o=n.opacityMesh)==null||o.removeFromParent()}),super.remove(...e),this}}class Ur extends E.Group{constructor(e){super();f(this,"isCSS3DGroup",!0);f(this,"mode");f(this,"CSS3DObjectLength",0);f(this,"hooks",new qt);this.mode=e}add(...e){return pt(...e).forEach(n=>{n.mode=this.mode}),super.add(...e),this.updateLength(),this}setVisible(e){this.visible=e,this.hooks.emit("visibleChange",e)}remove(...e){return super.remove(...e),this.updateLength(),this}updateLength(){this.CSS3DObjectLength=pt(this).length}}class Fl extends Ur{constructor(){super("front")}}class Gl extends Ur{constructor(e){super("behind");f(this,"scene");if(!e)throw new Error("CSS3DBehindScene: scene is required");this.scene=e}add(...e){return pt(...e).forEach(n=>{this.scene.add(n.getOpacityMesh())}),super.add(...e),this}}const Nl=3,Mi="CSS3DRenderer",on=`${Mi}@${Nl}`,Gt=()=>{console.error(`${on} is disposed`)},Ie={css3DObjects:[],frontModeStore:{css3DRenderer:new wo},behindModeStore:{css3DRenderer:new wo}};function Co(i){return Ie.css3DObjects.find(t=>t.id===i)}function Wl(i){Ie.frontModeStore.css3DRenderer.setWrapper(i)}function Xl(i){Ie.behindModeStore.css3DRenderer.setWrapper(i)}class Vt{constructor(t){f(this,"hooks",new qt);f(this,"state",{enabled:!0,visible:!0,disposed:!1});f(this,"_scene");f(this,"store",{frontModeGroup:new Fl});f(this,"create3DElement",(t,e,n)=>{if(this.state.disposed)return Gt();const o=(()=>{const y={ratio:.00216,devicePixelRatio:1,mode:"front",autoRender:!0,container:document.createElement("div"),pointerEvents:"none"};return Object.assign(y,n)})(),s=e.map(hn);if((s==null?void 0:s.length)<4)return console.error(`${on}: requires 4 point but params may have fewer`);const{ratio:r,devicePixelRatio:a,mode:l,autoRender:c,container:u,pointerEvents:d}=o,h=this.createObject(s,{ratio:r,dpr:a,container:u,mode:l,pointerEvents:d});Ie.css3DObjects.push(h),o.scene&&this.setScene(o.scene);const p=()=>{const y=h.mode==="front"?this.getFrontCSS3DObjectGroup():this.getBehindCSS3DObjectGroup();!y||y.add(h)},m=()=>{p(),this.render(t)},g=y=>this.setVisibleById(h.id,y),A=y=>this.setEnabledById(h.id,y),v=()=>(h.removeFromParent(),!0),w=l==="front"?Ie.frontModeStore.css3DRenderer:Ie.behindModeStore.css3DRenderer;return c&&m(),{id:h.uuid,container:u,css3DObject:h,render:c?void 0:m,show:()=>g(!0),hide:()=>g(!1),setVisible:g,enable:()=>A(!0),disable:()=>A(!1),setEnabled:A,dispose:v,appendToElement:y=>w.setWrapper(y)}});f(this,"setVisibleById",(t,e)=>{var n;(n=Co(t))==null||n.setVisible(e)});f(this,"setEnabledById",(t,e)=>{const n=Co(t);if(!n)return;const o=n.mode==="front"?this.getFrontCSS3DObjectGroup({addGroupIfNotExists:!1}):this.getBehindCSS3DObjectGroup({addGroupIfNotExists:!1});!o||(e?o.add(n):o.remove(n))});f(this,"createObject",(t,e)=>{const n=new Yr(N({cornerPoints:t},e));return n.element.classList.add(`${Mi}__container`),n.element.id=`${Mi}__container--${n.uuid}`,n});t&&this.setScene(t)}get scene(){return this._scene||console.error("scene doesn't exist!, please call setScene(scene) first"),this._scene}static get frontModeCSS3DRenderer(){return Ie.frontModeStore.css3DRenderer}static get behindModeCSS3DRenderer(){return Ie.behindModeStore.css3DRenderer}get frontModeCSS3DRenderer(){return Ie.frontModeStore.css3DRenderer}get behindModeCSS3DRenderer(){return Ie.behindModeStore.css3DRenderer}setScene(t){this._scene=t}getCurrentState(){return this.state}setState(t,e={userAction:!0}){if(this.state.disposed)return Gt();const n=N({},this.state);this.state=Object.assign(this.state,t),n.visible!==this.state.visible&&(t.visible?this.handleShow():this.handleHide()),n.enabled!==this.state.enabled&&(t.enabled?this.handleEnable():this.handleDisable()),n.disposed!==this.state.disposed&&this.handleDispose(),this.hooks.emit("stateChange",{state:this.state,prevState:n,userAction:e.userAction})}dispose(){this.setState({disposed:!0}),this.hooks.emit("dispose")}show(){return J(this,arguments,function*({userAction:t}={userAction:!0}){if(this.state.disposed)return Gt();this.setState({visible:!0},{userAction:t}),this.hooks.emit("show",{userAction:t})})}hide(){return J(this,arguments,function*({userAction:t}={userAction:!0}){if(this.state.disposed)return Gt();this.setState({visible:!1},{userAction:t}),this.hooks.emit("hide",{userAction:t})})}enable({userAction:t}={userAction:!0}){if(this.state.disposed)return Gt();this.setState({enabled:!0},{userAction:t}),this.hooks.emit("enable",{userAction:t})}disable({userAction:t}={userAction:!0}){if(this.state.disposed)return Gt();this.setState({enabled:!1},{userAction:t}),this.hooks.emit("disable",{userAction:t})}getFrontCSS3DScene({createSceneIfNotExists:t=!1}={}){var n;const e=(n=Ie.frontModeStore)==null?void 0:n.css3DScene;if(e)return e;if(t){const o=new Ol;Ie.frontModeStore.css3DScene=o}return Ie.frontModeStore.css3DScene}getBehindCSS3DScene({createSceneIfNotExists:t=!1}={}){var n,o;const e=(n=Ie.behindModeStore)==null?void 0:n.css3DScene;if(e)return e;if(t){const s=(o=Ie.behindModeStore.scene)!=null?o:this.scene;if(!s){console.error(`${on}: scene is required when mode is behind`);return}const r=new Hl(s);Ie.behindModeStore.css3DScene=r,Ie.behindModeStore.scene=s}return Ie.behindModeStore.css3DScene}getFrontCSS3DObjectGroup({addGroupIfNotExists:t=!0}={}){const e=this.getFrontCSS3DScene({createSceneIfNotExists:t});return t&&e&&(e.getObjectById(this.store.frontModeGroup.id)||e.add(this.store.frontModeGroup)),this.store.frontModeGroup}getBehindCSS3DObjectGroup({addGroupIfNotExists:t=!0}={}){var n;const e=this.getBehindCSS3DScene({createSceneIfNotExists:t});if(t&&e&&this.scene){const o=(n=this.store.behindModeGroup)!=null?n:new Gl(this.scene);this.store.behindModeGroup=o,e.getObjectById(o.id)||e.add(o)}return this.store.behindModeGroup}render(t){var e,n;if(this.getFrontCSS3DObjectGroup({addGroupIfNotExists:!1}).CSS3DObjectLength>0){const o=this.getFrontCSS3DScene({createSceneIfNotExists:!0});if(!o)return console.error(`${on}: css3DScene is required when mode is front`);Ie.frontModeStore.css3DRenderer.renderEveryFrame(o,t)}if(((n=(e=this.getBehindCSS3DObjectGroup({addGroupIfNotExists:!1}))==null?void 0:e.CSS3DObjectLength)!=null?n:0)>0){const o=this.getBehindCSS3DScene({createSceneIfNotExists:!0});if(!o)return console.error(`${on}: css3DScene is required when mode is behind`);Ie.behindModeStore.css3DRenderer.renderEveryFrame(o,t)}}handleShow(){return J(this,null,function*(){var t;this.store.frontModeGroup.setVisible(!0),(t=this.store.behindModeGroup)==null||t.setVisible(!0)})}handleHide(){return J(this,null,function*(){var t;this.store.frontModeGroup.setVisible(!1),(t=this.store.behindModeGroup)==null||t.setVisible(!1)})}handleEnable(){var t,e;(t=this.getFrontCSS3DScene())==null||t.add(this.store.frontModeGroup),this.store.behindModeGroup&&((e=this.getBehindCSS3DScene())==null||e.add(this.store.behindModeGroup))}handleDisable(){var t,e,n;this.store.frontModeGroup.children.forEach(o=>{o instanceof un.CSS3DObject&&o.element instanceof Element&&o.element.parentNode!==null&&o.element.parentNode.removeChild(o.element)}),(t=this.store.behindModeGroup)==null||t.children.forEach(o=>{o instanceof un.CSS3DObject&&o.element instanceof Element&&o.element.parentNode!==null&&o.element.parentNode.removeChild(o.element)}),(e=this.getFrontCSS3DScene())==null||e.remove(this.store.frontModeGroup),this.store.behindModeGroup&&((n=this.getBehindCSS3DScene())==null||n.remove(this.store.behindModeGroup))}handleDispose(){this.handleDisable()}}f(Vt,"setFrontModeContainer",Wl),f(Vt,"setBehindModeContainer",Xl);function Vr(i){return J(this,null,function*(){return new Promise(t=>{var e;if((e=i.model)!=null&&e.loaded){t();return}else i.once("modelLoaded",()=>t())})})}const gt=document.createElement("div");gt.style.position="absolute";gt.style.top="0";gt.style.left="0";gt.style.width="100%";gt.style.height="100%";gt.style.pointerEvents="none";function Jr(i){var e,n;const t=(n=Eo(i.getElement()))!=null?n:Eo((e=i.getElement())==null?void 0:e.parentElement);if(t!=null&&t.parentElement)return t.parentElement.insertBefore(gt,t),gt;console.error("Can not find a valid element to insert behindFiveElement. How to fix it: https://github.com/realsee-developer/dnalogel/blob/main/plugins/src/PanoTagPlugin/README.md")}function Eo(i){var o;if(!i)return;const t=(o=i.style.position)!=null?o:getComputedStyle(i).position;if(t!=="fixed"&&t!=="absolute"&&t!=="relative")return;const e=getComputedStyle(i).backgroundColor;if(!(e!=="transparent"&&e!=="rgba(0, 0, 0, 0)"))return i}const Yl="v2.0.1",pi=`CSS3DRenderPlugin@${Yl}`;class Ul extends Vt{constructor(e){super();f(this,"five");f(this,"behindFiveContainer");f(this,"staticPrefix","//vrlab-static.ljcdn.com");f(this,"create3DDomContainer",(e,n)=>{if(this.state.disposed)return;const o=(()=>{var d;(n==null?void 0:n.dpr)!==void 0&&console.warn(`${pi}: please use "config.devicePixelRatio" replace "config.dpr"`);const u={ratio:.00216,devicePixelRatio:(d=n==null?void 0:n.dpr)!=null?d:1,mode:"front",autoRender:!0};return Object.assign(u,n,(n==null?void 0:n.mode)==="behind"?{scene:this.five.scene}:void 0)})(),s=this.five.getElement();if(!s){console.error(`${pi}: five.getElement() is ${s}`);return}const{autoRender:r}=o;o.mode==="behind"&&o.behindFiveContainer&&(this.behindFiveContainer=o.behindFiveContainer);const a=this.create3DElement(this.five.camera,e,he(N({},o),{autoRender:!1}));if(!a)return;const l=()=>{const u=a.css3DObject.mode==="front"?s.parentElement:this.getBehindFiveElement();if(!u)return console.error(`${pi}: wrapper is ${u}`);a.appendToElement(u),a.render()},c=()=>{a.css3DObject.mode==="front"&&l(),a.css3DObject.mode==="behind"&&Vr(this.five).then(()=>{l()})};return r&&c(),he(N({},a),{render:r?void 0:c})});this.five=e}disposeAll(){return this.dispose()}setState(...e){const n=super.setState(...e);return this.five.needsRender=!0,n}getBehindFiveElement(){return this.behindFiveContainer?this.behindFiveContainer:(this.behindFiveContainer=Jr(this.five),this.behindFiveContainer)}}const Kt=i=>new Ul(i);function gi(i,t,e=new F.Vector3(1,1,1),n=!1){const o=new Or.Line(i,t);return o.setMaterial({dashed:n,color:e,linewidth:1}),o.remove(o.points),o}const Vl=i=>{const t={intersection:null,disposers:[]},e=u=>{t.intersection=u},n=()=>{t.intersection=null};i.on("modelLoaded",()=>{i.on("intersectionOnModelUpdate",e),i.on("intersectionHidden",n)}),i.on("dispose",()=>{i.off("intersectionOnModelUpdate",e),i.off("intersectionHidden",n)});const o=(u,d=2,h=.1)=>{const p=d/2,g=c(u,h),A=new F.Group;A.add(gi(new F.Vector3(g.x+p,g.y,g.z),new F.Vector3(g.x-p,g.y,g.z),new F.Vector3(1,0,0)),gi(new F.Vector3(g.x,g.y+p,g.z),new F.Vector3(g.x,g.y-p,g.z),new F.Vector3(0,1,0)),gi(new F.Vector3(g.x,g.y,g.z+p),new F.Vector3(g.x,g.y,g.z-p),new F.Vector3(0,0,1))),i.scene.add(A),i.needsRender=!0;const v=()=>{i.scene.remove(A)};return t.disposers.push(v),{clear:v,pointAxesHelperMesh:A}},s=(u,d=0)=>{var v,w;const h=(v=i==null?void 0:i.camera)==null?void 0:v.position;if(!h)return!1;const p=u.distanceTo(h),m=u.sub(h).normalize(),g=new F.Raycaster(h,m),A=(w=i.model.intersectRaycaster(g))==null?void 0:w[0];return!(A&&A.distance+d<p)},r=()=>t.intersection,a=()=>{var u,d;(d=(u=t.disposers)==null?void 0:u.forEach)==null||d.call(u,h=>h==null?void 0:h()),i.off("intersectionOnModelUpdate",e),i.off("intersectionHidden",n)},l=a,c=(u,d)=>{const h=u.clone();return i.camera.position.clone().sub(h).setLength(d).add(h)};return{intersection:r,pointAxesHelper:o,movePointTowardsCamera:c,destroy:a,dispose:l,canSeePoint:s}};function te(){}const Jt=i=>i;function we(i,t){for(const e in t)i[e]=t[e];return i}function _r(i){return i()}function Po(){return Object.create(null)}function rt(i){i.forEach(_r)}function ii(i){return typeof i=="function"}function ne(i,t){return i!=i?t==t:i!==t||i&&typeof i=="object"||typeof i=="function"}let Cn;function et(i,t){return Cn||(Cn=document.createElement("a")),Cn.href=t,i===Cn.href}function Jl(i){return Object.keys(i).length===0}function It(i,t,e,n){if(i){const o=Zr(i,t,e,n);return i[0](o)}}function Zr(i,t,e,n){return i[1]&&n?we(e.ctx.slice(),i[1](n(t))):e.ctx}function xt(i,t,e,n){if(i[2]&&n){const o=i[2](n(e));if(t.dirty===void 0)return o;if(typeof o=="object"){const s=[],r=Math.max(t.dirty.length,o.length);for(let a=0;a<r;a+=1)s[a]=t.dirty[a]|o[a];return s}return t.dirty|o}return t.dirty}function kt(i,t,e,n,o,s){if(o){const r=Zr(t,e,n,s);i.p(r,o)}}function Dt(i){if(i.ctx.length>32){const t=[],e=i.ctx.length/32;for(let n=0;n<e;n++)t[n]=-1;return t}return-1}function qr(i){const t={};for(const e in i)e[0]!=="$"&&(t[e]=i[e]);return t}function Wn(i,t){const e={};t=new Set(t);for(const n in i)!t.has(n)&&n[0]!=="$"&&(e[n]=i[n]);return e}function Se(i){return i==null?"":i}const Kr=typeof window!="undefined";let $r=Kr?()=>window.performance.now():()=>Date.now(),Vi=Kr?i=>requestAnimationFrame(i):te;const Ut=new Set;function ea(i){Ut.forEach(t=>{t.c(i)||(Ut.delete(t),t.f())}),Ut.size!==0&&Vi(ea)}function ta(i){let t;return Ut.size===0&&Vi(ea),{promise:new Promise(e=>{Ut.add(t={c:i,f:e})}),abort(){Ut.delete(t)}}}function Q(i,t){i.appendChild(t)}function ae(i,t,e){const n=Ji(i);if(!n.getElementById(t)){const o=j("style");o.id=t,o.textContent=e,na(n,o)}}function Ji(i){if(!i)return document;const t=i.getRootNode?i.getRootNode():i.ownerDocument;return t&&t.host?t:i.ownerDocument}function _l(i){const t=j("style");return na(Ji(i),t),t.sheet}function na(i,t){return Q(i.head||i,t),t.sheet}function B(i,t,e){i.insertBefore(t,e||null)}function M(i){i.parentNode&&i.parentNode.removeChild(i)}function tt(i,t){for(let e=0;e<i.length;e+=1)i[e]&&i[e].d(t)}function j(i){return document.createElement(i)}function Ae(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function ke(i){return document.createTextNode(i)}function _(){return ke(" ")}function fe(){return ke("")}function Pe(i,t,e,n){return i.addEventListener(t,e,n),()=>i.removeEventListener(t,e,n)}function _i(i){return function(t){return t.stopPropagation(),i.call(this,t)}}function b(i,t,e){e==null?i.removeAttribute(t):i.getAttribute(t)!==e&&i.setAttribute(t,e)}function Xn(i,t){const e=Object.getOwnPropertyDescriptors(i.__proto__);for(const n in t)t[n]==null?i.removeAttribute(n):n==="style"?i.style.cssText=t[n]:n==="__value"?i.value=i[n]=t[n]:e[n]&&e[n].set?i[n]=t[n]:b(i,n,t[n])}function Zl(i){return Array.from(i.childNodes)}function Be(i,t){t=""+t,i.wholeText!==t&&(i.data=t)}function R(i,t,e,n){e===null?i.style.removeProperty(t):i.style.setProperty(t,e,n?"important":"")}let En;function ql(){if(En===void 0){En=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(i){En=!0}}return En}function bt(i,t){getComputedStyle(i).position==="static"&&(i.style.position="relative");const n=j("iframe");n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1;const o=ql();let s;return o?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=Pe(window,"message",r=>{r.source===n.contentWindow&&t()})):(n.src="about:blank",n.onload=()=>{s=Pe(n.contentWindow,"resize",t)}),Q(i,n),()=>{(o||s&&n.contentWindow)&&s(),M(n)}}function q(i,t,e){i.classList[e?"add":"remove"](t)}function ia(i,t,{bubbles:e=!1,cancelable:n=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(i,e,n,t),o}class Yn{constructor(t=!1){this.is_svg=!1,this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,e,n=null){this.e||(this.is_svg?this.e=Ae(e.nodeName):this.e=j(e.nodeName),this.t=e,this.c(t)),this.i(n)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let e=0;e<this.n.length;e+=1)B(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(M)}}const Un=new Map;let Vn=0;function Kl(i){let t=5381,e=i.length;for(;e--;)t=(t<<5)-t^i.charCodeAt(e);return t>>>0}function $l(i,t){const e={stylesheet:_l(t),rules:{}};return Un.set(i,e),e}function oa(i,t,e,n,o,s,r,a=0){const l=16.666/n;let c=`{
|
|
101
|
+
`;class kl extends Il{constructor(e){super();f(this,"configs");f(this,"clientWidth");f(this,"clientHeight");f(this,"ready",!1);f(this,"uuid",He());f(this,"tween");f(this,"tweening",!1);f(this,"container");f(this,"canvas");f(this,"data",{});f(this,"tempLine",{});this.configs=e,this.clientWidth=document.body.clientWidth,this.clientHeight=document.body.clientHeight,this.container=this.ifInsertToDOM(),this.canvas={},this.initCtrl()}get color(){return this.configs.currentColor}get state(){return this.data}get dpr(){return this.configs.DPR||1}ifInsertToDOM(){if(this.container)return this.container;if(this.configs.container)this.configs.container.id="_gl_paintBrush",this.container=this.configs.container;else if(document.getElementById("_gl_paintBrush"))this.container=document.getElementById("_gl_paintBrush");else{const e=document.createElement("div");e.id="_gl_paintBrush",document.body.appendChild(e),this.container=e}return this.container.innerHTML=xl,this.container}initCanvas(e){const n=document.createElement("canvas");n.className=e,n.width=this.clientWidth,n.height=this.clientHeight;const o=n.getContext("2d");if(!!o)return o.lineWidth=5*this.dpr,o.lineCap="round",o.lineJoin="round",this.container.appendChild(n),n}initCtrl(){const e=document.createElement("div");e.className="_paintBrush-ctrl";const n=document.createElement("div");n.className="_paintBrush-ctrlinner";const o=document.createElement("a");o.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--undo",o.addEventListener("click",a=>{var h;if(a.stopPropagation(),this.configs.onClickUndo&&this.configs.onClickUndo(),!this.canvas[this.uuid]||!this.data[this.uuid]||this.data[this.uuid].length===0)return;const l=this.data[this.uuid].pop();l&&this.emitStateChange({type:it.Undo,color:this.color,ready:this.ready,state:l,uuid:this.uuid});const c=(h=this.canvas[this.uuid])==null?void 0:h.getContext("2d");if(!this.canvas[this.uuid])return;const{width:u,height:d}=this.canvas[this.uuid];c&&c.clearRect(0,0,u,d),this.data[this.uuid].forEach(p=>this.handleDrawLine(this.uuid,p,{withUndo:!0}))});const s=document.createElement("a");return s.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--close",s.addEventListener("click",a=>{a.stopPropagation(),this.closeBrush(),this.configs.onClickClose&&this.configs.onClickClose()}),[o,s].forEach(a=>{const l=document.createElement("i");l.className="brush-icon";const c=document.createElement("span");c.className="brush-txt",c.innerText=a.className.endsWith("undo")?this.configs.onUndoText:this.configs.onExitText,a.appendChild(l),a.appendChild(c)}),n.appendChild(o),n.appendChild(s),e.appendChild(n),this.container.appendChild(e),e}openBrush(){if(this.ready)return;this.canvas[this.uuid]||(this.canvas[this.uuid]=this.initCanvas("_paintBrush-canvas")),this.container.className="brushing";const e=this.canvas[this.uuid];e.getContext("2d").clearRect(0,0,e.width,e.height),this.openBrushHandle(),this.ready=!0,this.emit("readyChange",!0)}closeBrush(){!this.ready||(this.container.className="",this.data={},this.tempLine={},Object.keys(this.canvas).forEach(e=>{this.canvas[e].ontouchstart=()=>!1,this.canvas[e].ontouchmove=()=>!1,this.canvas[e].ontouchend=()=>!1,this.canvas[e].ontouchcancel=()=>!1;const n=this.canvas[e].getContext("2d");n&&n.clearRect(0,0,this.canvas[e].width,this.canvas[e].height)}),this.ready=!1,this.emit("readyChange",!1),this.emitStateChange({type:it.Exit,color:this.color,ready:!1,uuid:this.uuid}))}updateCurrentColor(e){const n=this.canvas[this.uuid];if(!n)return;const o=n.getContext("2d");!o||(this.configs.currentColor=e,o.strokeStyle=e)}openBrushHandle(){const e=this.canvas[this.uuid];if(!e)return;const n=e.getContext("2d");if(!n)return;const o=this.color||"#6D92FF";n.strokeStyle=o;let s=null,r=[],a,l=[],c=0;const u=(d,h,p)=>{const m=this.color||"#ff0000";n.strokeStyle=m,n.beginPath(),n.moveTo(d.x,d.y),n.quadraticCurveTo(h.x,h.y,p.x,p.y),n.stroke()};e.onmousedown=d=>{d.preventDefault(),c=Date.now();const h=d.clientX,p=d.clientY;r=[],r.push({x:h,y:p}),s={x:h,y:p},a=vn({x:h,y:p},this.clientWidth,this.clientHeight),l=[]},e.onmousemove=d=>{if(d.preventDefault(),!s)return;const h=Number(d.clientX),p=Number(d.clientY);if(Math.abs(h-s.x)<5&&Math.abs(p-s.y)<5||(r.push({x:h,y:p}),l.push(vn({x:h,y:p},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:m,end:g}=bn(r);!m||!g||(u(s,m,g),s=g)},e.onmouseup=d=>{if(d.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const h=Date.now()-c,p={move:Object.assign({},a),uuid:this.uuid,line:[...l],color:this.color,duration:h<1280?h:h<2e3?1280:0};this.data[this.uuid].push(p),Rn(()=>{this.emitStateChange({type:it.Drawline,color:this.color,ready:this.ready,state:p,uuid:this.uuid})})},e.ontouchstart=d=>{d.preventDefault(),c=Date.now();const h=d.touches[0].clientX,p=d.touches[0].clientY;r=[],r.push({x:h,y:p}),s={x:h,y:p},console.log("ontouchstart",h,p,s),a=vn({x:h,y:p},this.clientWidth,this.clientHeight),l=[]},e.ontouchmove=d=>{if(d.preventDefault(),!s)return;const h=Number(d.touches[0].clientX),p=Number(d.touches[0].clientY);if(Math.abs(h-s.x)<5&&Math.abs(p-s.y)<5||(r.push({x:h,y:p}),l.push(vn({x:h,y:p},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:m,end:g}=bn(r);!m||!g||(u(s,m,g),s=g)},e.ontouchend=e.ontouchcancel=d=>{if(d.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const h=Date.now()-c,p={move:Object.assign({},a),line:[...l],uuid:this.uuid,color:this.color,duration:h<1280?h:h<2e3?1280:0};this.data[this.uuid].push(p),Rn(()=>{this.emitStateChange({type:it.Drawline,color:this.color,ready:this.ready,state:p,uuid:this.uuid})})}}emitStateChange(e,n=!0){if(e.type!==it.Drawline){this.emit("stateChange",e,n);return}const o=Date.now(),s=e.state;if(!s||!s.line)return;const r=Math.ceil(s.line.length/100);for(let a=0;a<r;a++){const l={uuid:this.uuid,color:this.color,ready:this.ready,type:e.type,state:{uuid:this.uuid,move:s.move,duration:s.duration,color:this.color,line:s.line.slice(a*100,(a+1)*100)},timestamp:o,end:a===r-1};wl(a,20,()=>{this.emit("stateChange",l,n)})}}action(e){const{ready:n,type:o,uuid:s}=e;if(!n&&this.ready){this.closeBrush();return}if(n&&!this.ready){this.openBrush();return}if(!!this.ready)switch(o){case it.Drawline:const{state:r,timestamp:a,end:l}=e;if(!a||!r)return;this.tempLine[a]=[].concat(this.tempLine[a]||[],r.line),l&&(Object.assign(r,{line:this.tempLine[a]}),this.handleDrawLine(s,r,{},()=>delete this.tempLine[a]));break;case it.Undo:this.handleUndo(s);break}}handleDrawLine(e,n,{withUndo:o=!1},s=Nr){!n||Object.prototype.toString.call(n)!="[object Object]"||Object.keys(n).length===0||(console.log("handleDrawLine",n,n.line),yl(()=>new Promise(r=>{if(o||(this.canvas[e]||(this.canvas[e]=this.initCanvas("_paintBrush-canvas--sync")),this.data[e]||(this.data[e]=[]),this.data[e].push(n)),!this.canvas[e])return;const a=this.canvas[e].getContext("2d");if(!a)return;const{line:l=[],color:c="black",duration:u=0,uuid:d}=n,h=mi(n.move||{},this.clientWidth,this.clientHeight);let p=[h];if(a.strokeStyle=c,a.beginPath(),a.moveTo(h.x,h.y),u&&!o){let m=[];const g=this;g.tween=El({step:0},{step:l.length-1},u).onUpdate(({step:A})=>{var w;if(g.tweening=!0,!g.ready)return a.clearRect(0,0,g.canvas[d].width,g.canvas[d].height),(w=g.tween)==null?void 0:w.stop();const v=Math.floor(A);if(!m.find(y=>y===v)){if(m.push(v),console.log("__debug__",l,l[v],v),p.push(mi(l[v],g.clientWidth,g.clientHeight)),p.length<3)return;const{control:y,end:x}=bn(p);if(!y||!x)return;a.quadraticCurveTo(y.x,y.y,x.x,x.y),a.stroke()}}).onComplete(A=>{g.tween=void 0,g.tweening=!1,m=[],p=[],s&&s(),r()})}else{for(let m=0;m<l.length;m++){if(p.push(mi(l[m],this.clientWidth,this.clientHeight)),p.length<3)continue;const{control:g,end:A}=bn(p);!g||!A||a.quadraticCurveTo(g.x,g.y,A.x,A.y)}a.stroke(),p=[],s&&s(),r()}})))}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 s;const o=(s=this.canvas[e])==null?void 0:s.getContext("2d");o&&o.clearRect(0,0,this.canvas[e].width,this.canvas[e].height),this.data[e].forEach(r=>this.handleDrawLine(e,r,{withUndo:!0}))};if(this.tween&&this.tweening){this.tween.stop(),Rn(n,60);return}n()}destroyBrush(){this.closeBrush(),this.ready=!1,this.emit("readyChange",!0)}}class Dl{constructor(t={}){f(this,"controller");const e=Object.assign({currentColor:"#f44336",onUndoText:"\u56DE\u9000",onExitText:"\u5173\u95ED"},t);this.controller=new kl(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 Ll=(i,t)=>{var U,P;let e=(P=(U=t==null?void 0:t.initialState)==null?void 0:U.enabled)!=null?P:!0,n=!1,o=!0,s=null;const a=N(N({},{lookAtCurrentCamera:!1,lockedPanoIndex:null,lockedLatitude:null,lockedLongitude:null}),t==null?void 0:t.config),l=new E.Scene,c=new be.Camera(60);let u=new E.Object3D,d,h;{const I=new E.DirectionalLight(16777215,.5);I.position.copy(new E.Vector3(1,1,1)),l.add(I)}{const I=new E.DirectionalLight(16777215,.3);l.add(I)}{const I=new E.AmbientLight(16777215,.3);l.add(I)}l.add(u);const p=()=>{if(n)return;d=L(i.model,c.fov,c.aspect),h=i.model.bounding.getCenter(new E.Vector3),l.remove(u),u=z(i.model),l.add(u),n=!0,S();function I(H){const X=H.clone();return X.uniforms.modelAlpha.value=1,X.uniforms.map.value&&(X.uniforms.map.value.needsUpdate=!0),X}function z(H){if(H instanceof E.Mesh){const X=H.geometry,Z=Array.isArray(H.material)?H.material.map(I):I(H.material);return new E.Mesh(X,Z)}else if(H instanceof E.Group){const X=new E.Group;return H.children.forEach(Z=>X.add(z(Z))),X}else{const X=new E.Object3D;return H.children.forEach(Z=>X.add(z(Z))),X}}},m=()=>{if(!!i.renderer)return s||(s=new E.WebGLRenderer({antialias:!1,alpha:!0}),s.setPixelRatio(i.renderer.getPixelRatio()),s.outputEncoding=E.sRGBEncoding,s.setClearColor(1579548,0),s.autoClear=!0),s},g=()=>{u.traverse(I=>{I instanceof E.Mesh&&[].concat(I.material).forEach(H=>H.dispose())}),l.remove(u),u=new E.Object3D,l.add(u),n=!1,S()},A=()=>{!e||n||p()},v=()=>{e||(e=!0,l.add(u),!n&&i.model.loaded&&p(),S())},w=()=>{!e||(l.remove(u),o=!0,k(),e=!1)},y=(I,z={})=>{const H=m();if(!H)return;I.appendChild(H.domElement),x(z);const X=window.getComputedStyle(I).position;X!=="relative"&&X!=="absolute"&&X!=="fixed"&&X!=="sticky"&&(I.style.position="relative")},x=(I={})=>{if(!s)return;const H=s.domElement.parentNode;if(H!=null&&H.nodeName){const{width:X=H.offsetWidth,height:Z=H.offsetHeight}=I;s.setSize(X,Z),c.aspect=X/Z,c.updateProjectionMatrix()}S()};function L(I,z,H){const X=I.bounding,Z=Math.pow(Math.pow(X.max.x-X.min.x+1,2)+Math.pow(X.max.y-X.min.y+1,2)+Math.pow(X.max.z-X.min.z+1,2),1/2);let Y=Z/2/Math.tan(Math.PI*z/360);return H<1&&(Y=Y/H),isNaN(Y)?Z:Y}function C(I){return i.work.observers[I].standingPosition.clone()}const S=()=>{if(!e||!d||!h)return;const I=i.getPose();I.fov=c.fov,I.offset=h,I.distance=d,typeof a.lockedLatitude=="number"&&(I.latitude=a.lockedLatitude),typeof a.lockedLongitude=="number"&&(I.longitude=a.lockedLongitude),typeof a.lockedPanoIndex=="number"&&(I.offset=C(a.lockedPanoIndex)),a.lookAtCurrentCamera&&(I.offset=i.camera.position.clone().setY(i.camera.position.y+1)),c.setFromPose(I),o=!0},k=()=>{!e||o!==!0||!s||!s.domElement.parentNode||s.domElement.parentNode.offsetWidth===0||(s.render(l,c),o=!1)},G=()=>{s&&s.dispose(),s=null},O=I=>{Object.assign(a,I),S()},W=()=>({enabled:e});return Object.assign(window,{camera:c}),i.on("modelLoaded",A),i.on("modelWillLoad",g),i.on("cameraDirectionUpdate",S),i.on("dispose",G),i.on("renderFrame",k),i.on("cameraPositionUpdate",S),{appendTo:y,refresh:x,changeConfigs:O,enable:v,disable:w,getCurrentState:W}};function pt(...i){const t=[];return i.forEach(e=>{e.isCSS3DObjectPlus?t.push(e):t.push(...pt(...e.children))}),t}function Nn(i,t){const e=Math.round(i);return e%2===0?e:e+Number(t!=null&&t.floor?-1:1)}function Sl(i,t,e=!0){if(!i)return console.error("createResizeObserver: element is undefined"),{observe:()=>{},unobserve:()=>{}};const n=()=>{const s=Nn(i.clientWidth,{floor:!0}),r=Nn(i.clientHeight,{floor:!0});t(s,r)};if(typeof ResizeObserver=="undefined"||!ResizeObserver)return console.warn("createResizeObserver: ResizeObserver is undefined"),{observe:()=>n(),unobserve:()=>{}};const o=new ResizeObserver(n);return e&&n(),{observe:()=>o.observe(i),unobserve:()=>o.unobserve(i)}}class wo extends un.CSS3DRenderer{constructor(){super();f(this,"wrapper");f(this,"requestAnimationFrameId");f(this,"resizeDisoper");this.domElement.style.position="absolute",this.domElement.style.top="0",this.domElement.style.left="0",this.domElement.style.userSelect="none",this.domElement.style.pointerEvents="none"}setWrapper(e){if(!e)throw new Error("CSS3DRenderer: wrapper is required");if(e.contains(this.domElement))return;const n=this.wrapper;return n&&n.contains(this.domElement)&&this.domElement.remove(),this.appendToElement(e),this.wrapper=e,this}appendToElement(e){e.appendChild(this.domElement);const n=(r,a)=>this.setSize(r,a),{observe:o,unobserve:s}=Sl(e,n,!0);o(),this.resizeDisoper=s,this.wrapper=e}renderEveryFrame(e,n){if(this.wrapper||console.warn("wrapper is not find, creating a html element and call setWrapper(wrapper)",this,e),this.requestAnimationFrameId)return console.warn("CSS3DRenderer: render is running");const o=()=>{this.requestAnimationFrameId=requestAnimationFrame(o),!!e.visible&&pt(e).length!==0&&this.render(e,n)};o()}stopRender(){this.requestAnimationFrameId&&cancelAnimationFrame(this.requestAnimationFrameId)}dispose(){var e;this.stopRender(),(e=this.resizeDisoper)==null||e.call(this),this.domElement.remove()}}function zl(i){return typeof Symbol=="undefined"?`$Symbol<${i}>$`:Symbol(i)}const ln=zl("$$EVENT$$");function wn(i){return i[ln]||(i[ln]={}),i[ln]}function Ml(i){i[ln]||delete i[ln]}class qt{hasListener(t){const e=wn(this);return Boolean((e==null?void 0:e[t])&&e[t].length>0)}on(t,e,n){const o=wn(this);return o[t]||(o[t]=[]),o[t].push([e,n||!1]),()=>this.off(t,e)}once(t,e){return this.on(t,e,!0)}off(t,e){if(t===void 0){Ml(this);return}const n=wn(this);if(n[t]||(n[t]=[]),e===void 0){n[t].length=0;return}let o=0;for(;o<n[t].length&&n[t][o][0]!==e;o++);o<n[t].length&&n[t].splice(o,1)}emit(t,...e){let n=!1;const s=wn(this)[t]||[];for(let r of s.slice()){const[a,l=!1]=r,c=a(...e);l&&this.off(t,a),c===!1&&(n=!0)}return n}}function Wr(...i){const t=new F.Vector3;return i.forEach(e=>{t.add(e)}),t.divideScalar(i.length),t}const Tl=({x:i,y:t,z:e})=>new F.Vector3(i,t,e),st=([i,t,e])=>new F.Vector3(i,t,e),hn=i=>i instanceof F.Vector3?i:Array.isArray(i)?st(i):Tl(i);class Bl extends E.Mesh{constructor(e,n){const o=new E.MeshBasicMaterial({opacity:0,color:0,transparent:!1,side:E.DoubleSide}),s=new E.PlaneGeometry(e,n);super(s,o);f(this,"name","opacity-mesh")}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}}const Xr=1,jl=`CSS3DObjectPlus@${Xr}`,Ql=.00216,Rl=.003;class Yr extends un.CSS3DObject{constructor(e){var L,C,S;const n=e.container,o=e.cornerPoints,s=(L=e.ratio)!=null?L:Rl,r=(C=e.dpr)!=null?C:1,a=(S=e.pointerEvents)!=null?S:"auto",l=Math.max(Ql,s),c=o[0].distanceTo(o[1]),u=o[1].distanceTo(o[2]),d=Nn(c/s*r),h=Nn(u/s*r),p=Wr(...o);let m;if(l===s)n.style.width=`${d}px`,n.style.height=`${h}px`,m=n;else{const k=document.createElement("div");k.style.width=`${d}px`,k.style.height=`${h}px`,k.style.pointerEvents="none";const G=s/l;n.style.position="absolute",n.style.left="0",n.style.top="0",n.style.width=`${G*d}px`,n.style.height=`${G*h}px`,k.appendChild(n),m=k}super(m);f(this,"version",Xr);f(this,"isCSS3DObjectPlus",!0);f(this,"container");f(this,"width");f(this,"height");f(this,"domWidthPx");f(this,"domHeightPx");f(this,"cornerPoints");f(this,"centerPosition");f(this,"ratio");f(this,"mode","front");f(this,"hooks",new qt);f(this,"opacityMesh");f(this,"selfVisible",!0);f(this,"parentVisibleListenerDisposer");f(this,"createOpacityMesh",e=>{const{domWidthPx:n,domHeightPx:o}=e,s=new Bl(n,o);return s.position.copy(e.position),s.rotation.copy(e.rotation),s.scale.copy(e.scale),s});f(this,"addParentVisibleListener",()=>{var e;if((e=this.parent)!=null&&e.isCSS3DGroup){const n=this.parent,o=s=>{this.setVisible(s&&this.selfVisible,{setSelfVisible:!1})};n.hooks.on("visibleChange",o),this.parentVisibleListenerDisposer=()=>n.hooks.off("visibleChange",o)}});f(this,"removeParentVisibleListener",()=>{var e;(e=this.parentVisibleListenerDisposer)==null||e.call(this)});if(n.style.pointerEvents=a,this.scale.set(l,l,l),this.cornerPoints=o,this.ratio=s,this.container=n,e.mode&&(this.mode=e.mode),l===s)this.width=c,this.height=u,this.domWidthPx=d,this.domHeightPx=h,this.centerPosition=p;else{const k=s/l;this.width=k*c,this.height=k*u,this.domWidthPx=k*d,this.domHeightPx=k*h,this.centerPosition=new F.Vector3().subVectors(p,o[0]).multiplyScalar(k).add(o[0])}n.classList.add(`${jl}__container`);const g=new F.Vector3().subVectors(o[1],o[0]),A=new F.Vector3().subVectors(o[3],o[0]),v=new F.Vector3().crossVectors(g,A).normalize();this.lookAt(v);const w=this.up.clone().applyQuaternion(this.quaternion),y=A.clone(),x=new F.Vector3().crossVectors(w,y).normalize();this.rotateOnWorldAxis(x,w.angleTo(y)),this.position.copy(p),this.addEventListener("added",()=>{var k;this.mode==="front"&&((k=this.opacityMesh)==null||k.removeFromParent()),this.addParentVisibleListener()}),this.addEventListener("removed",()=>{var k;(k=this.opacityMesh)==null||k.removeFromParent(),this.removeParentVisibleListener()})}setVisible(e,n={setSelfVisible:!0}){n.setSelfVisible&&(this.selfVisible=e),this.visible=e,this.opacityMesh&&(this.opacityMesh.visible=e)}removeFromParent(){var n;const e=this.parent;return e!==null&&e.remove(this),(n=this.opacityMesh)==null||n.removeFromParent(),this}removeOpacityMesh(){var e;return(e=this.opacityMesh)==null||e.removeFromParent(),this.opacityMesh=void 0,this}dispose(){var e;this.container.remove(),this.removeFromParent(),(e=this.opacityMesh)==null||e.removeFromParent()}getOpacityMesh(){if(this.opacityMesh)return this.opacityMesh;{const e=this.createOpacityMesh(this);return this.opacityMesh=e,e}}applyMatrix4(e){var n;super.applyMatrix4(e),(n=this.opacityMesh)==null||n.applyMatrix4(e)}applyQuaternion(e){var n;return super.applyQuaternion(e),(n=this.opacityMesh)==null||n.applyQuaternion(e),this}applyScaleMatrix4(e){var n;this.scale.applyMatrix4(e),(n=this.opacityMesh)==null||n.scale.applyMatrix4(e)}}class Ol extends E.Scene{constructor(){super()}add(...t){return super.add(...t),pt(...t).forEach(e=>{e.mode="front"}),this}}class Hl extends E.Scene{constructor(e){super();f(this,"scene");if(!e)throw new Error("CSS3DBehindScene: scene is required");this.scene=e}add(...e){return super.add(...e),pt(...e).forEach(n=>{n.mode="behind",this.scene.add(n.getOpacityMesh())}),this}remove(...e){return pt(...e).forEach(n=>{var o;(o=n.opacityMesh)==null||o.removeFromParent()}),super.remove(...e),this}}class Ur extends E.Group{constructor(e){super();f(this,"isCSS3DGroup",!0);f(this,"mode");f(this,"CSS3DObjectLength",0);f(this,"hooks",new qt);this.mode=e}add(...e){return pt(...e).forEach(n=>{n.mode=this.mode}),super.add(...e),this.updateLength(),this}setVisible(e){this.visible=e,this.hooks.emit("visibleChange",e)}remove(...e){return super.remove(...e),this.updateLength(),this}updateLength(){this.CSS3DObjectLength=pt(this).length}}class Fl extends Ur{constructor(){super("front")}}class Gl extends Ur{constructor(e){super("behind");f(this,"scene");if(!e)throw new Error("CSS3DBehindScene: scene is required");this.scene=e}add(...e){return pt(...e).forEach(n=>{this.scene.add(n.getOpacityMesh())}),super.add(...e),this}}const Nl=3,Mi="CSS3DRenderer",on=`${Mi}@${Nl}`,Gt=()=>{console.error(`${on} is disposed`)},Ie={css3DObjects:[],frontModeStore:{css3DRenderer:new wo},behindModeStore:{css3DRenderer:new wo}};function Co(i){return Ie.css3DObjects.find(t=>t.id===i)}function Wl(i){Ie.frontModeStore.css3DRenderer.setWrapper(i)}function Xl(i){Ie.behindModeStore.css3DRenderer.setWrapper(i)}class Vt{constructor(t){f(this,"hooks",new qt);f(this,"state",{enabled:!0,visible:!0,disposed:!1});f(this,"_scene");f(this,"store",{frontModeGroup:new Fl});f(this,"create3DElement",(t,e,n)=>{if(this.state.disposed)return Gt();const o=(()=>{const y={ratio:.00216,devicePixelRatio:1,mode:"front",autoRender:!0,container:document.createElement("div"),pointerEvents:"none"};return Object.assign(y,n)})(),s=e.map(hn);if((s==null?void 0:s.length)<4)return console.error(`${on}: requires 4 point but params may have fewer`);const{ratio:r,devicePixelRatio:a,mode:l,autoRender:c,container:u,pointerEvents:d}=o,h=this.createObject(s,{ratio:r,dpr:a,container:u,mode:l,pointerEvents:d});Ie.css3DObjects.push(h),o.scene&&this.setScene(o.scene);const p=()=>{const y=h.mode==="front"?this.getFrontCSS3DObjectGroup():this.getBehindCSS3DObjectGroup();!y||y.add(h)},m=()=>{p(),this.render(t)},g=y=>this.setVisibleById(h.id,y),A=y=>this.setEnabledById(h.id,y),v=()=>(h.removeFromParent(),!0),w=l==="front"?Ie.frontModeStore.css3DRenderer:Ie.behindModeStore.css3DRenderer;return c&&m(),{id:h.uuid,container:u,css3DObject:h,render:c?void 0:m,show:()=>g(!0),hide:()=>g(!1),setVisible:g,enable:()=>A(!0),disable:()=>A(!1),setEnabled:A,dispose:v,appendToElement:y=>w.setWrapper(y)}});f(this,"setVisibleById",(t,e)=>{var n;(n=Co(t))==null||n.setVisible(e)});f(this,"setEnabledById",(t,e)=>{const n=Co(t);if(!n)return;const o=n.mode==="front"?this.getFrontCSS3DObjectGroup({addGroupIfNotExists:!1}):this.getBehindCSS3DObjectGroup({addGroupIfNotExists:!1});!o||(e?o.add(n):o.remove(n))});f(this,"createObject",(t,e)=>{const n=new Yr(N({cornerPoints:t},e));return n.element.classList.add(`${Mi}__container`),n.element.id=`${Mi}__container--${n.uuid}`,n});t&&this.setScene(t)}get scene(){return this._scene||console.error("scene doesn't exist!, please call setScene(scene) first"),this._scene}static get frontModeCSS3DRenderer(){return Ie.frontModeStore.css3DRenderer}static get behindModeCSS3DRenderer(){return Ie.behindModeStore.css3DRenderer}get frontModeCSS3DRenderer(){return Ie.frontModeStore.css3DRenderer}get behindModeCSS3DRenderer(){return Ie.behindModeStore.css3DRenderer}setScene(t){this._scene=t}getCurrentState(){return this.state}setState(t,e={userAction:!0}){if(this.state.disposed)return Gt();const n=N({},this.state);this.state=Object.assign(this.state,t),n.visible!==this.state.visible&&(t.visible?this.handleShow():this.handleHide()),n.enabled!==this.state.enabled&&(t.enabled?this.handleEnable():this.handleDisable()),n.disposed!==this.state.disposed&&this.handleDispose(),this.hooks.emit("stateChange",{state:this.state,prevState:n,userAction:e.userAction})}dispose(){this.setState({disposed:!0}),this.hooks.emit("dispose")}show(){return J(this,arguments,function*({userAction:t}={userAction:!0}){if(this.state.disposed)return Gt();this.setState({visible:!0},{userAction:t}),this.hooks.emit("show",{userAction:t})})}hide(){return J(this,arguments,function*({userAction:t}={userAction:!0}){if(this.state.disposed)return Gt();this.setState({visible:!1},{userAction:t}),this.hooks.emit("hide",{userAction:t})})}enable({userAction:t}={userAction:!0}){if(this.state.disposed)return Gt();this.setState({enabled:!0},{userAction:t}),this.hooks.emit("enable",{userAction:t})}disable({userAction:t}={userAction:!0}){if(this.state.disposed)return Gt();this.setState({enabled:!1},{userAction:t}),this.hooks.emit("disable",{userAction:t})}getFrontCSS3DScene({createSceneIfNotExists:t=!1}={}){var n;const e=(n=Ie.frontModeStore)==null?void 0:n.css3DScene;if(e)return e;if(t){const o=new Ol;Ie.frontModeStore.css3DScene=o}return Ie.frontModeStore.css3DScene}getBehindCSS3DScene({createSceneIfNotExists:t=!1}={}){var n,o;const e=(n=Ie.behindModeStore)==null?void 0:n.css3DScene;if(e)return e;if(t){const s=(o=Ie.behindModeStore.scene)!=null?o:this.scene;if(!s){console.error(`${on}: scene is required when mode is behind`);return}const r=new Hl(s);Ie.behindModeStore.css3DScene=r,Ie.behindModeStore.scene=s}return Ie.behindModeStore.css3DScene}getFrontCSS3DObjectGroup({addGroupIfNotExists:t=!0}={}){const e=this.getFrontCSS3DScene({createSceneIfNotExists:t});return t&&e&&(e.getObjectById(this.store.frontModeGroup.id)||e.add(this.store.frontModeGroup)),this.store.frontModeGroup}getBehindCSS3DObjectGroup({addGroupIfNotExists:t=!0}={}){var n;const e=this.getBehindCSS3DScene({createSceneIfNotExists:t});if(t&&e&&this.scene){const o=(n=this.store.behindModeGroup)!=null?n:new Gl(this.scene);this.store.behindModeGroup=o,e.getObjectById(o.id)||e.add(o)}return this.store.behindModeGroup}render(t){var e,n;if(this.getFrontCSS3DObjectGroup({addGroupIfNotExists:!1}).CSS3DObjectLength>0){const o=this.getFrontCSS3DScene({createSceneIfNotExists:!0});if(!o)return console.error(`${on}: css3DScene is required when mode is front`);Ie.frontModeStore.css3DRenderer.renderEveryFrame(o,t)}if(((n=(e=this.getBehindCSS3DObjectGroup({addGroupIfNotExists:!1}))==null?void 0:e.CSS3DObjectLength)!=null?n:0)>0){const o=this.getBehindCSS3DScene({createSceneIfNotExists:!0});if(!o)return console.error(`${on}: css3DScene is required when mode is behind`);Ie.behindModeStore.css3DRenderer.renderEveryFrame(o,t)}}handleShow(){return J(this,null,function*(){var t;this.store.frontModeGroup.setVisible(!0),(t=this.store.behindModeGroup)==null||t.setVisible(!0)})}handleHide(){return J(this,null,function*(){var t;this.store.frontModeGroup.setVisible(!1),(t=this.store.behindModeGroup)==null||t.setVisible(!1)})}handleEnable(){var t,e;(t=this.getFrontCSS3DScene())==null||t.add(this.store.frontModeGroup),this.store.behindModeGroup&&((e=this.getBehindCSS3DScene())==null||e.add(this.store.behindModeGroup))}handleDisable(){var t,e,n;this.store.frontModeGroup.children.forEach(o=>{o instanceof un.CSS3DObject&&o.element instanceof Element&&o.element.parentNode!==null&&o.element.parentNode.removeChild(o.element)}),(t=this.store.behindModeGroup)==null||t.children.forEach(o=>{o instanceof un.CSS3DObject&&o.element instanceof Element&&o.element.parentNode!==null&&o.element.parentNode.removeChild(o.element)}),(e=this.getFrontCSS3DScene())==null||e.remove(this.store.frontModeGroup),this.store.behindModeGroup&&((n=this.getBehindCSS3DScene())==null||n.remove(this.store.behindModeGroup))}handleDispose(){this.handleDisable()}}f(Vt,"setFrontModeContainer",Wl),f(Vt,"setBehindModeContainer",Xl);function Vr(i){return J(this,null,function*(){return new Promise(t=>{var e;if((e=i.model)!=null&&e.loaded){t();return}else i.once("modelLoaded",()=>t())})})}const gt=document.createElement("div");gt.style.position="absolute";gt.style.top="0";gt.style.left="0";gt.style.width="100%";gt.style.height="100%";gt.style.pointerEvents="none";function Jr(i){var e,n;const t=(n=Eo(i.getElement()))!=null?n:Eo((e=i.getElement())==null?void 0:e.parentElement);if(t!=null&&t.parentElement)return t.parentElement.insertBefore(gt,t),gt;console.error("Can not find a valid element to insert behindFiveElement. How to fix it: https://github.com/realsee-developer/dnalogel/blob/main/plugins/src/PanoTagPlugin/README.md")}function Eo(i){var o;if(!i)return;const t=(o=i.style.position)!=null?o:getComputedStyle(i).position;if(t!=="fixed"&&t!=="absolute"&&t!=="relative")return;const e=getComputedStyle(i).backgroundColor;if(!(e!=="transparent"&&e!=="rgba(0, 0, 0, 0)"))return i}const Yl="v2.0.1",pi=`CSS3DRenderPlugin@${Yl}`;class Ul extends Vt{constructor(e){super();f(this,"five");f(this,"behindFiveContainer");f(this,"staticPrefix","//vrlab-static.ljcdn.com");f(this,"create3DDomContainer",(e,n)=>{if(this.state.disposed)return;const o=(()=>{var d;(n==null?void 0:n.dpr)!==void 0&&console.warn(`${pi}: please use "config.devicePixelRatio" replace "config.dpr"`);const u={ratio:.00216,devicePixelRatio:(d=n==null?void 0:n.dpr)!=null?d:1,mode:"front",autoRender:!0};return Object.assign(u,n,(n==null?void 0:n.mode)==="behind"?{scene:this.five.scene}:void 0)})(),s=this.five.getElement();if(!s){console.error(`${pi}: five.getElement() is ${s}`);return}const{autoRender:r}=o;o.mode==="behind"&&o.behindFiveContainer&&(this.behindFiveContainer=o.behindFiveContainer);const a=this.create3DElement(this.five.camera,e,he(N({},o),{autoRender:!1}));if(!a)return;const l=()=>{const u=a.css3DObject.mode==="front"?s.parentElement:this.getBehindFiveElement();if(!u)return console.error(`${pi}: wrapper is ${u}`);a.appendToElement(u),a.render()},c=()=>{a.css3DObject.mode==="front"&&l(),a.css3DObject.mode==="behind"&&Vr(this.five).then(()=>{l()})};return r&&c(),he(N({},a),{render:r?void 0:c})});this.five=e}disposeAll(){return this.dispose()}setState(...e){const n=super.setState(...e);return this.five.needsRender=!0,n}getBehindFiveElement(){return this.behindFiveContainer?this.behindFiveContainer:(this.behindFiveContainer=Jr(this.five),this.behindFiveContainer)}}const Kt=i=>new Ul(i);function gi(i,t,e=new F.Vector3(1,1,1),n=!1){const o=new Or.Line(i,t);return o.setMaterial({dashed:n,color:e,linewidth:1}),o.remove(o.points),o}const Vl=i=>{const t={intersection:null,disposers:[]},e=u=>{t.intersection=u},n=()=>{t.intersection=null};i.on("modelLoaded",()=>{i.on("intersectionOnModelUpdate",e),i.on("intersectionHidden",n)}),i.on("dispose",()=>{i.off("intersectionOnModelUpdate",e),i.off("intersectionHidden",n)});const o=(u,d=2,h=.1)=>{const p=d/2,g=c(u,h),A=new F.Group;A.add(gi(new F.Vector3(g.x+p,g.y,g.z),new F.Vector3(g.x-p,g.y,g.z),new F.Vector3(1,0,0)),gi(new F.Vector3(g.x,g.y+p,g.z),new F.Vector3(g.x,g.y-p,g.z),new F.Vector3(0,1,0)),gi(new F.Vector3(g.x,g.y,g.z+p),new F.Vector3(g.x,g.y,g.z-p),new F.Vector3(0,0,1))),i.scene.add(A),i.needsRender=!0;const v=()=>{i.scene.remove(A)};return t.disposers.push(v),{clear:v,pointAxesHelperMesh:A}},s=(u,d=0)=>{var v,w;const h=(v=i==null?void 0:i.camera)==null?void 0:v.position;if(!h)return!1;const p=u.distanceTo(h),m=u.sub(h).normalize(),g=new F.Raycaster(h,m),A=(w=i.model.intersectRaycaster(g))==null?void 0:w[0];return!(A&&A.distance+d<p)},r=()=>t.intersection,a=()=>{var u,d;(d=(u=t.disposers)==null?void 0:u.forEach)==null||d.call(u,h=>h==null?void 0:h()),i.off("intersectionOnModelUpdate",e),i.off("intersectionHidden",n)},l=a,c=(u,d)=>{const h=u.clone();return i.camera.position.clone().sub(h).setLength(d).add(h)};return{intersection:r,pointAxesHelper:o,movePointTowardsCamera:c,destroy:a,dispose:l,canSeePoint:s}};function te(){}const Jt=i=>i;function we(i,t){for(const e in t)i[e]=t[e];return i}function _r(i){return i()}function Po(){return Object.create(null)}function rt(i){i.forEach(_r)}function ii(i){return typeof i=="function"}function ne(i,t){return i!=i?t==t:i!==t||i&&typeof i=="object"||typeof i=="function"}let Cn;function et(i,t){return Cn||(Cn=document.createElement("a")),Cn.href=t,i===Cn.href}function Jl(i){return Object.keys(i).length===0}function It(i,t,e,n){if(i){const o=Zr(i,t,e,n);return i[0](o)}}function Zr(i,t,e,n){return i[1]&&n?we(e.ctx.slice(),i[1](n(t))):e.ctx}function xt(i,t,e,n){if(i[2]&&n){const o=i[2](n(e));if(t.dirty===void 0)return o;if(typeof o=="object"){const s=[],r=Math.max(t.dirty.length,o.length);for(let a=0;a<r;a+=1)s[a]=t.dirty[a]|o[a];return s}return t.dirty|o}return t.dirty}function kt(i,t,e,n,o,s){if(o){const r=Zr(t,e,n,s);i.p(r,o)}}function Dt(i){if(i.ctx.length>32){const t=[],e=i.ctx.length/32;for(let n=0;n<e;n++)t[n]=-1;return t}return-1}function qr(i){const t={};for(const e in i)e[0]!=="$"&&(t[e]=i[e]);return t}function Wn(i,t){const e={};t=new Set(t);for(const n in i)!t.has(n)&&n[0]!=="$"&&(e[n]=i[n]);return e}function je(i){return i==null?"":i}const Kr=typeof window!="undefined";let $r=Kr?()=>window.performance.now():()=>Date.now(),Vi=Kr?i=>requestAnimationFrame(i):te;const Ut=new Set;function ea(i){Ut.forEach(t=>{t.c(i)||(Ut.delete(t),t.f())}),Ut.size!==0&&Vi(ea)}function ta(i){let t;return Ut.size===0&&Vi(ea),{promise:new Promise(e=>{Ut.add(t={c:i,f:e})}),abort(){Ut.delete(t)}}}function Q(i,t){i.appendChild(t)}function ae(i,t,e){const n=Ji(i);if(!n.getElementById(t)){const o=j("style");o.id=t,o.textContent=e,na(n,o)}}function Ji(i){if(!i)return document;const t=i.getRootNode?i.getRootNode():i.ownerDocument;return t&&t.host?t:i.ownerDocument}function _l(i){const t=j("style");return na(Ji(i),t),t.sheet}function na(i,t){return Q(i.head||i,t),t.sheet}function B(i,t,e){i.insertBefore(t,e||null)}function M(i){i.parentNode&&i.parentNode.removeChild(i)}function tt(i,t){for(let e=0;e<i.length;e+=1)i[e]&&i[e].d(t)}function j(i){return document.createElement(i)}function Ae(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function ke(i){return document.createTextNode(i)}function _(){return ke(" ")}function fe(){return ke("")}function Pe(i,t,e,n){return i.addEventListener(t,e,n),()=>i.removeEventListener(t,e,n)}function _i(i){return function(t){return t.stopPropagation(),i.call(this,t)}}function b(i,t,e){e==null?i.removeAttribute(t):i.getAttribute(t)!==e&&i.setAttribute(t,e)}function Xn(i,t){const e=Object.getOwnPropertyDescriptors(i.__proto__);for(const n in t)t[n]==null?i.removeAttribute(n):n==="style"?i.style.cssText=t[n]:n==="__value"?i.value=i[n]=t[n]:e[n]&&e[n].set?i[n]=t[n]:b(i,n,t[n])}function Zl(i){return Array.from(i.childNodes)}function Te(i,t){t=""+t,i.wholeText!==t&&(i.data=t)}function R(i,t,e,n){e===null?i.style.removeProperty(t):i.style.setProperty(t,e,n?"important":"")}let En;function ql(){if(En===void 0){En=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(i){En=!0}}return En}function bt(i,t){getComputedStyle(i).position==="static"&&(i.style.position="relative");const n=j("iframe");n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1;const o=ql();let s;return o?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=Pe(window,"message",r=>{r.source===n.contentWindow&&t()})):(n.src="about:blank",n.onload=()=>{s=Pe(n.contentWindow,"resize",t)}),Q(i,n),()=>{(o||s&&n.contentWindow)&&s(),M(n)}}function q(i,t,e){i.classList[e?"add":"remove"](t)}function ia(i,t,{bubbles:e=!1,cancelable:n=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(i,e,n,t),o}class Yn{constructor(t=!1){this.is_svg=!1,this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,e,n=null){this.e||(this.is_svg?this.e=Ae(e.nodeName):this.e=j(e.nodeName),this.t=e,this.c(t)),this.i(n)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let e=0;e<this.n.length;e+=1)B(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(M)}}const Un=new Map;let Vn=0;function Kl(i){let t=5381,e=i.length;for(;e--;)t=(t<<5)-t^i.charCodeAt(e);return t>>>0}function $l(i,t){const e={stylesheet:_l(t),rules:{}};return Un.set(i,e),e}function oa(i,t,e,n,o,s,r,a=0){const l=16.666/n;let c=`{
|
|
102
102
|
`;for(let A=0;A<=1;A+=l){const v=t+(e-t)*s(A);c+=A*100+`%{${r(v,1-v)}}
|
|
103
103
|
`}const u=c+`100% {${r(e,1-e)}}
|
|
104
|
-
}`,d=`__svelte_${Kl(u)}_${a}`,h=Ji(i),{stylesheet:p,rules:m}=Un.get(h)||$l(h,i);m[d]||(m[d]=!0,p.insertRule(`@keyframes ${d} ${u}`,p.cssRules.length));const g=i.style.animation||"";return i.style.animation=`${g?`${g}, `:""}${d} ${n}ms linear ${o}ms 1 both`,Vn+=1,d}function Ti(i,t){const e=(i.style.animation||"").split(", "),n=e.filter(t?s=>s.indexOf(t)<0:s=>s.indexOf("__svelte")===-1),o=e.length-n.length;o&&(i.style.animation=n.join(", "),Vn-=o,Vn||ec())}function ec(){Vi(()=>{Vn||(Un.forEach(i=>{const{ownerNode:t}=i.stylesheet;t&&M(t)}),Un.clear())})}let fn;function cn(i){fn=i}function Rt(){if(!fn)throw new Error("Function called outside component initialization");return fn}function Zi(i){Rt().$$.before_update.push(i)}function Ye(i){Rt().$$.on_mount.push(i)}function qi(i){Rt().$$.after_update.push(i)}function yt(i){Rt().$$.on_destroy.push(i)}function tc(){const i=Rt();return(t,e,{cancelable:n=!1}={})=>{const o=i.$$.callbacks[t];if(o){const s=ia(t,e,{cancelable:n});return o.slice().forEach(r=>{r.call(i,s)}),!s.defaultPrevented}return!0}}function Bi(i,t){return Rt().$$.context.set(i,t),t}function mn(i){return Rt().$$.context.get(i)}function nc(i,t){const e=i.$$.callbacks[t.type];e&&e.slice().forEach(n=>n.call(this,t))}const sn=[],Te=[],On=[],Io=[],sa=Promise.resolve();let ji=!1;function ra(){ji||(ji=!0,sa.then(aa))}function ic(){return ra(),sa}function xe(i){On.push(i)}const Ai=new Set;let Pn=0;function aa(){const i=fn;do{for(;Pn<sn.length;){const t=sn[Pn];Pn++,cn(t),oc(t.$$)}for(cn(null),sn.length=0,Pn=0;Te.length;)Te.pop()();for(let t=0;t<On.length;t+=1){const e=On[t];Ai.has(e)||(Ai.add(e),e())}On.length=0}while(sn.length);for(;Io.length;)Io.pop()();ji=!1,Ai.clear(),cn(i)}function oc(i){if(i.fragment!==null){i.update(),rt(i.before_update);const t=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,t),i.after_update.forEach(xe)}}let nn;function la(){return nn||(nn=Promise.resolve(),nn.then(()=>{nn=null})),nn}function Jn(i,t,e){i.dispatchEvent(ia(`${t?"intro":"outro"}${e}`))}const Hn=new Set;let ht;function le(){ht={r:0,c:[],p:ht}}function ce(){ht.r||rt(ht.c),ht=ht.p}function D(i,t){i&&i.i&&(Hn.delete(i),i.i(t))}function T(i,t,e,n){if(i&&i.o){if(Hn.has(i))return;Hn.add(i),ht.c.push(()=>{Hn.delete(i),n&&(e&&i.d(1),n())}),i.o(t)}else n&&n()}const ca={duration:0};function Ot(i,t,e){let n=t(i,e),o=!1,s,r,a=0;function l(){s&&Ti(i,s)}function c(){const{delay:d=0,duration:h=300,easing:p=Jt,tick:m=te,css:g}=n||ca;g&&(s=oa(i,0,1,h,d,p,g,a++)),m(0,1);const A=$r()+d,v=A+h;r&&r.abort(),o=!0,xe(()=>Jn(i,!0,"start")),r=ta(w=>{if(o){if(w>=v)return m(1,0),Jn(i,!0,"end"),l(),o=!1;if(w>=A){const y=p((w-A)/h);m(y,1-y)}}return o})}let u=!1;return{start(){u||(u=!0,Ti(i),ii(n)?(n=n(),la().then(c)):c())},invalidate(){u=!1},end(){o&&(l(),o=!1)}}}function $t(i,t,e){let n=t(i,e),o=!0,s;const r=ht;r.r+=1;function a(){const{delay:l=0,duration:c=300,easing:u=Jt,tick:d=te,css:h}=n||ca;h&&(s=oa(i,1,0,c,l,u,h));const p=$r()+l,m=p+c;xe(()=>Jn(i,!1,"start")),ta(g=>{if(o){if(g>=m)return d(0,1),Jn(i,!1,"end"),--r.r||rt(r.c),!1;if(g>=p){const A=u((g-p)/c);d(1-A,A)}}return o})}return ii(n)?la().then(()=>{n=n(),a()}):a(),{end(l){l&&n.tick&&n.tick(1,0),o&&(s&&Ti(i,s),o=!1)}}}const sc=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function ua(i,t){i.d(1),t.delete(i.key)}function at(i,t){T(i,1,1,()=>{t.delete(i.key)})}function Ue(i,t,e,n,o,s,r,a,l,c,u,d){let h=i.length,p=s.length,m=h;const g={};for(;m--;)g[i[m].key]=m;const A=[],v=new Map,w=new Map;for(m=p;m--;){const C=d(o,s,m),S=e(C);let k=r.get(S);k?n&&k.p(C,t):(k=c(S,C),k.c()),v.set(S,A[m]=k),S in g&&w.set(S,Math.abs(m-g[S]))}const y=new Set,x=new Set;function L(C){D(C,1),C.m(a,u),r.set(C.key,C),u=C.first,p--}for(;h&&p;){const C=A[p-1],S=i[h-1],k=C.key,G=S.key;C===S?(u=C.first,h--,p--):v.has(G)?!r.has(k)||y.has(k)?L(C):x.has(G)?h--:w.get(k)>w.get(G)?(x.add(k),L(C)):(y.add(G),h--):(l(S,r),h--)}for(;h--;){const C=i[h];v.has(C.key)||l(C,r)}for(;p;)L(A[p-1]);return A}function je(i,t){const e={},n={},o={$$scope:1};let s=i.length;for(;s--;){const r=i[s],a=t[s];if(a){for(const l in r)l in a||(n[l]=1);for(const l in a)o[l]||(e[l]=a[l],o[l]=1);i[s]=a}else for(const l in r)o[l]=1}for(const r in n)r in e||(e[r]=void 0);return e}function ee(i){i&&i.c()}function K(i,t,e,n){const{fragment:o,after_update:s}=i.$$;o&&o.m(t,e),n||xe(()=>{const r=i.$$.on_mount.map(_r).filter(ii);i.$$.on_destroy?i.$$.on_destroy.push(...r):rt(r),i.$$.on_mount=[]}),s.forEach(xe)}function $(i,t){const e=i.$$;e.fragment!==null&&(rt(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function rc(i,t){i.$$.dirty[0]===-1&&(sn.push(i),ra(),i.$$.dirty.fill(0)),i.$$.dirty[t/31|0]|=1<<t%31}function ie(i,t,e,n,o,s,r,a=[-1]){const l=fn;cn(i);const c=i.$$={fragment:null,ctx:[],props:s,update:te,not_equal:o,bound:Po(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:Po(),dirty:a,skip_bound:!1,root:t.target||l.$$.root};r&&r(c.root);let u=!1;if(c.ctx=e?e(i,t.props||{},(d,h,...p)=>{const m=p.length?p[0]:h;return c.ctx&&o(c.ctx[d],c.ctx[d]=m)&&(!c.skip_bound&&c.bound[d]&&c.bound[d](m),u&&rc(i,d)),h}):[],c.update(),u=!0,rt(c.before_update),c.fragment=n?n(c.ctx):!1,t.target){if(t.hydrate){const d=Zl(t.target);c.fragment&&c.fragment.l(d),d.forEach(M)}else c.fragment&&c.fragment.c();t.intro&&D(i.$$.fragment),K(i,t.target,t.anchor,t.customElement),aa()}cn(l)}class oe{$destroy(){$(this,1),this.$destroy=te}$on(t,e){if(!ii(e))return te;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const o=n.indexOf(e);o!==-1&&n.splice(o,1)}}$set(t){this.$$set&&!Jl(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const ac="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAA8CAYAAACZ1L+0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAYKADAAQAAAABAAAAPAAAAABU0H2EAAARRElEQVR4Ad2czY9cRZbFq1yFoQGDNCzwuAENohl54dkgdrNh34tZ8GciFi31nwEsmAEhhAWD1GMJCZgx5sMfUHN+J+NE3XfrZWWVcVVLHVLmuXG/74148V5m2bm/N8bR0dH+Bx988Po333zzbz///PONg4ODa+I9I9y/cuXKgV77h4eH+1KH3hP/yv7+vuBAsG+5UCIpC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lm/ukkbFwjKLj428j8t8DEEvN9xJoJuhsDI9lxOeHXr3zE8cGm7fpQMfNgR54ntXmYXzx1ltvbX64VUl4SH//66+/fl2/5ndLC/BHMV/Q6ypN06Bm3lgFaKMcEbj+bDHN88/curvewF4hjhNWasrwhy/0waIPjylyYjp49Ag++NhFhi7F+jeEFcc/H6w5TYbnxo2OoufXmNPcX+XWv4QLMo+taJkfeY4gvtRs/n8vzY/cssxB5CyKxi96/aB+/Y9+KfE/X3vttS8lI7e9/wfu514OAjYP0QAAAABJRU5ErkJggg==";function lc(i){ae(i,"svelte-1d7uzh5",".room-label-item.svelte-1d7uzh5{position:absolute;font-size:0.5rem;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.room-label-item__text.svelte-1d7uzh5{position:absolute;left:0;top:-4rem;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:1.25rem;min-width:2rem;padding:0 0.375rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-1d7uzh5{position:absolute;top:-2.75rem;height:3rem;width:0.0625rem;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-1d7uzh5{font-size:0.625rem}")}function cc(i){let t,e,n=i[0].name+"",o,s,r,a,l;return{c(){t=j("div"),e=j("span"),o=ke(n),s=_(),r=j("div"),b(e,"class","room-label-item__text svelte-1d7uzh5"),R(e,"background-image","url("+ac+")"),q(e,"wide",i[0].name.length>3),b(r,"class","room-label-item__bar svelte-1d7uzh5"),b(t,"class","room-label-item svelte-1d7uzh5"),R(t,"z-index",i[0].zIndex),R(t,"transform",i[0].transform),R(t,"opacity",i[0].visible?1:0)},m(c,u){B(c,t,u),Q(t,e),Q(e,o),Q(t,s),Q(t,r),a||(l=Pe(e,"click",i[1]),a=!0)},p(c,[u]){u&1&&n!==(n=c[0].name+"")&&Be(o,n),u&1&&q(e,"wide",c[0].name.length>3),u&1&&R(t,"z-index",c[0].zIndex),u&1&&R(t,"transform",c[0].transform),u&1&&R(t,"opacity",c[0].visible?1:0)},i:te,o:te,d(c){c&&M(t),a=!1,l()}}}function uc(i,t,e){let{five:n}=t,{roomLabel:o}=t;function s(){n.setState({panoIndex:o.panoIndex,mode:"Panorama",longitude:o.longitude})}return i.$$set=r=>{"five"in r&&e(2,n=r.five),"roomLabel"in r&&e(0,o=r.roomLabel)},[o,s,n]}class dc extends oe{constructor(t){super(),ie(this,t,uc,cc,ne,{five:2,roomLabel:0},lc)}}const{Map:hc}=sc;function fc(i){ae(i,"svelte-9eg4zi",".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}")}function xo(i,t,e){const n=i.slice();return n[12]=t[e],n}function ko(i,t){let e,n,o;return n=new dc({props:{roomLabel:t[12],five:t[1]}}),{key:i,first:null,c(){e=fe(),ee(n.$$.fragment),this.first=e},m(s,r){B(s,e,r),K(n,s,r),o=!0},p(s,r){t=s;const a={};r&1&&(a.roomLabel=t[12]),r&2&&(a.five=t[1]),n.$set(a)},i(s){o||(D(n.$$.fragment,s),o=!0)},o(s){T(n.$$.fragment,s),o=!1},d(s){s&&M(e),$(n,s)}}}function mc(i){let t,e=[],n=new hc,o,s,r=i[0];const a=l=>l[12].id;for(let l=0;l<r.length;l+=1){let c=xo(i,r,l),u=a(c);n.set(u,e[l]=ko(u,c))}return{c(){t=j("div");for(let l=0;l<e.length;l+=1)e[l].c();b(t,"class","room-labels-container svelte-9eg4zi"),xe(()=>i[6].call(t))},m(l,c){B(l,t,c);for(let u=0;u<e.length;u+=1)e[u].m(t,null);o=bt(t,i[6].bind(t)),s=!0},p(l,[c]){c&3&&(r=l[0],le(),e=Ue(e,c,a,1,l,r,n,t,at,ko,null,xo),ce())},i(l){if(!s){for(let c=0;c<r.length;c+=1)D(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)T(e[c]);s=!1},d(l){l&&M(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}function pc(i,t,e){var g;let n,{five:o}=t,{roomLabels:s}=t,r,a,l=(g=o.model.shownFloor)!=null?g:null;function c(A){if(!(l===null||A.floorIndex===l))return!1;const w=new F.Raycaster,y=o.camera.position.clone(),x=new F.Vector3(A.position.x,A.position.y,A.position.z),L=x.distanceTo(y);w.set(y.clone(),x.clone().sub(y).normalize());const[C]=o.model.intersectRaycaster(w);return!(C&&C.distance+1<L)}function u(A,v){const y=new F.Vector3(A.position.x,A.position.y,A.position.z).clone().project(o.camera),x=Math.ceil((y.x+1)/2*v.x),L=Math.ceil((-y.y+1)/2*v.y);return`translate(${x}px, ${L}px)`}function d(A){const{rendererSize:v,shownFloor:w}=A,y=new Map;function x(C){const S=y.get(C.id);if(S)return S;const{x:k,y:G,z:O}=C.position,W=new F.Vector3(k,G,O).clone().distanceTo(o.camera.position);return y.set(C.id,W),W}return s.map(C=>{const S=c(C),k=S?u(C,v):C.transform,G=x(C),W=s.filter(U=>U.visible&&x(U)<G).length*10;return he(N({},C),{visible:S,transform:k,zIndex:W})})}function h(){e(0,s=d({rendererSize:n,shownFloor:l}))}function p(A){e(4,l=A)}o.on("cameraUpdate",h),o.on("modelShownFloorChange",p),yt(()=>{o.off("cameraUpdate",h),o.off("modelShownFloorChange",p)});function m(){r=this.clientWidth,a=this.clientHeight,e(2,r),e(3,a)}return i.$$set=A=>{"five"in A&&e(1,o=A.five),"roomLabels"in A&&e(0,s=A.roomLabels)},i.$$.update=()=>{i.$$.dirty&12&&e(5,n={x:r,y:a}),i.$$.dirty&48&&e(0,s=d({rendererSize:n,shownFloor:l}))},[s,o,r,a,l,n,m]}class gc extends oe{constructor(t){super(),ie(this,t,pc,mc,ne,{five:1,roomLabels:0},fc)}}function Ac(i){return i.model_room_labels.map(({id:t,pano_index:e,floor_index:n,name:o,position:s,longitude:r})=>({id:t,name:o,position:s,longitude:r,panoIndex:e,floorIndex:n,zIndex:0,visible:!1,transform:""}))}class vc{constructor(t){f(this,"five");f(this,"enabled",!0);f(this,"fiveModeEnabled");f(this,"app");f(this,"wrapper");f(this,"roomLabels",[]);f(this,"container",document.createElement("div"));f(this,"onFiveModeChange",t=>{if(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=Ac(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 gc({target:this.container,props:{five:this.five,roomLabels:this.roomLabels}})}}}const bc=i=>new vc(i),yc={name:"ModelRoomLabelPlugin",version:0};var mt=(i=>(i[i.FLOOR=1]="FLOOR",i[i.CEILING=2]="CEILING",i[i.BOUNDING_CENTER=3]="BOUNDING_CENTER",i))(mt||{});function _n(i){return J(this,null,function*(){try{return[null,yield i]}catch(t){return t instanceof Error?[t,null]:[new Error(""),null]}})}function Zn(i){return Object.prototype.toString.call(i)==="[object Object]"}function oi(i,t){return i===t?!0:typeof i!=typeof t?!1:!!(Number.isNaN(i)&&Number.isNaN(t))}function wc(i,t){const e=Object.getOwnPropertyNames(i),n=Object.getOwnPropertyNames(t);if(e.length!==n.length)return!1;for(let o=0,s=e.length;o<s;o++){const r=e[o];if(!oi(i[r],t[r]))return!1}return!0}function Cc(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!oi(i[e],t[e]))return!1;return!0}function Ec(i,t){return oi(i,t)?!0:Zn(i)&&Zn(t)?wc(i,t):Array.isArray(i)&&Array.isArray(t)?Cc(i,t):!1}function Ki(i,t){return oi(i,t)?!0:Zn(i)&&Zn(t)?Ic(i,t):Array.isArray(i)&&Array.isArray(t)?Pc(i,t):!1}function Pc(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!Ki(i[e],t[e]))return!1;return!0}function Ic(i,t){const e=Object.getOwnPropertyNames(i),n=Object.getOwnPropertyNames(t);if(e.length!==n.length)return!1;for(let o=0,s=e.length;o<s;o++){const r=e[o];if(!Ki(i[r],t[r]))return!1}return!0}function qe(i,t,e={deep:!1}){return e.deep?Ki(i,t):Ec(i,t)}function _t(i){return i<.5?4*i*i*i:.5*Math.pow(2*i-2,3)+1}function da(i){const t=i-1;return t*t*t+1}function Tt(i,{delay:t=0,duration:e=400,easing:n=Jt}={}){const o=+getComputedStyle(i).opacity;return{delay:t,duration:e,easing:n,css:s=>`opacity: ${s*o}`}}function Do(i,{delay:t=0,duration:e=400,easing:n=da,x:o=0,y:s=0,opacity:r=0}={}){const a=getComputedStyle(i),l=+a.opacity,c=a.transform==="none"?"":a.transform,u=l*(1-r);return{delay:t,duration:e,easing:n,css:(d,h)=>`
|
|
104
|
+
}`,d=`__svelte_${Kl(u)}_${a}`,h=Ji(i),{stylesheet:p,rules:m}=Un.get(h)||$l(h,i);m[d]||(m[d]=!0,p.insertRule(`@keyframes ${d} ${u}`,p.cssRules.length));const g=i.style.animation||"";return i.style.animation=`${g?`${g}, `:""}${d} ${n}ms linear ${o}ms 1 both`,Vn+=1,d}function Ti(i,t){const e=(i.style.animation||"").split(", "),n=e.filter(t?s=>s.indexOf(t)<0:s=>s.indexOf("__svelte")===-1),o=e.length-n.length;o&&(i.style.animation=n.join(", "),Vn-=o,Vn||ec())}function ec(){Vi(()=>{Vn||(Un.forEach(i=>{const{ownerNode:t}=i.stylesheet;t&&M(t)}),Un.clear())})}let fn;function cn(i){fn=i}function Rt(){if(!fn)throw new Error("Function called outside component initialization");return fn}function Zi(i){Rt().$$.before_update.push(i)}function Ye(i){Rt().$$.on_mount.push(i)}function qi(i){Rt().$$.after_update.push(i)}function yt(i){Rt().$$.on_destroy.push(i)}function tc(){const i=Rt();return(t,e,{cancelable:n=!1}={})=>{const o=i.$$.callbacks[t];if(o){const s=ia(t,e,{cancelable:n});return o.slice().forEach(r=>{r.call(i,s)}),!s.defaultPrevented}return!0}}function Bi(i,t){return Rt().$$.context.set(i,t),t}function mn(i){return Rt().$$.context.get(i)}function nc(i,t){const e=i.$$.callbacks[t.type];e&&e.slice().forEach(n=>n.call(this,t))}const sn=[],Me=[],On=[],Io=[],sa=Promise.resolve();let ji=!1;function ra(){ji||(ji=!0,sa.then(aa))}function ic(){return ra(),sa}function xe(i){On.push(i)}const Ai=new Set;let Pn=0;function aa(){const i=fn;do{for(;Pn<sn.length;){const t=sn[Pn];Pn++,cn(t),oc(t.$$)}for(cn(null),sn.length=0,Pn=0;Me.length;)Me.pop()();for(let t=0;t<On.length;t+=1){const e=On[t];Ai.has(e)||(Ai.add(e),e())}On.length=0}while(sn.length);for(;Io.length;)Io.pop()();ji=!1,Ai.clear(),cn(i)}function oc(i){if(i.fragment!==null){i.update(),rt(i.before_update);const t=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,t),i.after_update.forEach(xe)}}let nn;function la(){return nn||(nn=Promise.resolve(),nn.then(()=>{nn=null})),nn}function Jn(i,t,e){i.dispatchEvent(ia(`${t?"intro":"outro"}${e}`))}const Hn=new Set;let ht;function le(){ht={r:0,c:[],p:ht}}function ce(){ht.r||rt(ht.c),ht=ht.p}function D(i,t){i&&i.i&&(Hn.delete(i),i.i(t))}function T(i,t,e,n){if(i&&i.o){if(Hn.has(i))return;Hn.add(i),ht.c.push(()=>{Hn.delete(i),n&&(e&&i.d(1),n())}),i.o(t)}else n&&n()}const ca={duration:0};function Ot(i,t,e){let n=t(i,e),o=!1,s,r,a=0;function l(){s&&Ti(i,s)}function c(){const{delay:d=0,duration:h=300,easing:p=Jt,tick:m=te,css:g}=n||ca;g&&(s=oa(i,0,1,h,d,p,g,a++)),m(0,1);const A=$r()+d,v=A+h;r&&r.abort(),o=!0,xe(()=>Jn(i,!0,"start")),r=ta(w=>{if(o){if(w>=v)return m(1,0),Jn(i,!0,"end"),l(),o=!1;if(w>=A){const y=p((w-A)/h);m(y,1-y)}}return o})}let u=!1;return{start(){u||(u=!0,Ti(i),ii(n)?(n=n(),la().then(c)):c())},invalidate(){u=!1},end(){o&&(l(),o=!1)}}}function $t(i,t,e){let n=t(i,e),o=!0,s;const r=ht;r.r+=1;function a(){const{delay:l=0,duration:c=300,easing:u=Jt,tick:d=te,css:h}=n||ca;h&&(s=oa(i,1,0,c,l,u,h));const p=$r()+l,m=p+c;xe(()=>Jn(i,!1,"start")),ta(g=>{if(o){if(g>=m)return d(0,1),Jn(i,!1,"end"),--r.r||rt(r.c),!1;if(g>=p){const A=u((g-p)/c);d(1-A,A)}}return o})}return ii(n)?la().then(()=>{n=n(),a()}):a(),{end(l){l&&n.tick&&n.tick(1,0),o&&(s&&Ti(i,s),o=!1)}}}const sc=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function ua(i,t){i.d(1),t.delete(i.key)}function at(i,t){T(i,1,1,()=>{t.delete(i.key)})}function Ue(i,t,e,n,o,s,r,a,l,c,u,d){let h=i.length,p=s.length,m=h;const g={};for(;m--;)g[i[m].key]=m;const A=[],v=new Map,w=new Map;for(m=p;m--;){const C=d(o,s,m),S=e(C);let k=r.get(S);k?n&&k.p(C,t):(k=c(S,C),k.c()),v.set(S,A[m]=k),S in g&&w.set(S,Math.abs(m-g[S]))}const y=new Set,x=new Set;function L(C){D(C,1),C.m(a,u),r.set(C.key,C),u=C.first,p--}for(;h&&p;){const C=A[p-1],S=i[h-1],k=C.key,G=S.key;C===S?(u=C.first,h--,p--):v.has(G)?!r.has(k)||y.has(k)?L(C):x.has(G)?h--:w.get(k)>w.get(G)?(x.add(k),L(C)):(y.add(G),h--):(l(S,r),h--)}for(;h--;){const C=i[h];v.has(C.key)||l(C,r)}for(;p;)L(A[p-1]);return A}function Be(i,t){const e={},n={},o={$$scope:1};let s=i.length;for(;s--;){const r=i[s],a=t[s];if(a){for(const l in r)l in a||(n[l]=1);for(const l in a)o[l]||(e[l]=a[l],o[l]=1);i[s]=a}else for(const l in r)o[l]=1}for(const r in n)r in e||(e[r]=void 0);return e}function ee(i){i&&i.c()}function K(i,t,e,n){const{fragment:o,after_update:s}=i.$$;o&&o.m(t,e),n||xe(()=>{const r=i.$$.on_mount.map(_r).filter(ii);i.$$.on_destroy?i.$$.on_destroy.push(...r):rt(r),i.$$.on_mount=[]}),s.forEach(xe)}function $(i,t){const e=i.$$;e.fragment!==null&&(rt(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function rc(i,t){i.$$.dirty[0]===-1&&(sn.push(i),ra(),i.$$.dirty.fill(0)),i.$$.dirty[t/31|0]|=1<<t%31}function ie(i,t,e,n,o,s,r,a=[-1]){const l=fn;cn(i);const c=i.$$={fragment:null,ctx:[],props:s,update:te,not_equal:o,bound:Po(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:Po(),dirty:a,skip_bound:!1,root:t.target||l.$$.root};r&&r(c.root);let u=!1;if(c.ctx=e?e(i,t.props||{},(d,h,...p)=>{const m=p.length?p[0]:h;return c.ctx&&o(c.ctx[d],c.ctx[d]=m)&&(!c.skip_bound&&c.bound[d]&&c.bound[d](m),u&&rc(i,d)),h}):[],c.update(),u=!0,rt(c.before_update),c.fragment=n?n(c.ctx):!1,t.target){if(t.hydrate){const d=Zl(t.target);c.fragment&&c.fragment.l(d),d.forEach(M)}else c.fragment&&c.fragment.c();t.intro&&D(i.$$.fragment),K(i,t.target,t.anchor,t.customElement),aa()}cn(l)}class oe{$destroy(){$(this,1),this.$destroy=te}$on(t,e){if(!ii(e))return te;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const o=n.indexOf(e);o!==-1&&n.splice(o,1)}}$set(t){this.$$set&&!Jl(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const ac="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAA8CAYAAACZ1L+0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAYKADAAQAAAABAAAAPAAAAABU0H2EAAARRElEQVR4Ad2czY9cRZbFq1yFoQGDNCzwuAENohl54dkgdrNh34tZ8GciFi31nwEsmAEhhAWD1GMJCZgx5sMfUHN+J+NE3XfrZWWVcVVLHVLmuXG/74148V5m2bm/N8bR0dH+Bx988Po333zzbz///PONg4ODa+I9I9y/cuXKgV77h4eH+1KH3hP/yv7+vuBAsG+5UCIpCkMzDQ962Eu80Q1P/KmHT82v8IocZFL4pslDvL3fNARHoPI2wtbrV1jBIf9N8SEZ0UUP2wFHv2ocSc/2ouEz8PVooJXQ0/j10aNHoH2Idj4PHz4k1n29/k+5/u3ll1/+r7fffvtLzfGzd8ibjK6+9957f5ajf1XzH9y7d+8Xjf9FRs1SdvNBBg2SDQ1xh9ALH4yN0M2BNZrKwtFc9Fmkquuma5HJBzvLiIONBnx40B7QIzTdxCcNwj3dYlEoUmabAU+UFZDpxah22Ng2NjQXH0LrwccGwyEzXfWhWQwSYQHYuFevXj14/vnn37h79+7Nr7766gup/FX5PnAj33///f/46aef3vj444/vfPbZZz9IYGMcnDbkhEYQL001Hfsu775i+7j6LID6cDQWYo8mabGMxOr+e/ye3y7989p3/9jfvHnz2q1bt25oMb549913/3Lwzjvv/Mu3337775988smdzz///AcVQ+IecsAOp8OOHRpkiJniWQnrBJmwc7EF8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3j/18voiuemdd/Mu/+uE1sQWfeX3MBuyzx5B39P/fRcr4dcAT9p5bxl4zhIgNqgnlRkILKuf1654tIUCk2oLJYbQpr0ZqRrGt30C1tk4FnyQYccray31B3s9UQviG104IUGmZ8mH5v+3qF2w51nn332TzHCsI7KJzEVm6akEVuPhLWGhUeM0CAjvkHmxCM+uCYPD2R0f2Ilt7lB4tMGZ3i7qPqfe+65P6j3X1y5du3aZ3rSefrGjRsvkNxpI80AeTGC0NgGoakvuFYrtvDjD11okBF6m3yjdfze9eM7sbPQIC8sg8detlPdP7XCy8ASOh6IC534Qf126Au6Aq7S+0P9jOJ/f/jhh7dfeeWVN1C4c+cOv5zoxsQgKD7O/OgIT3OLgrrkLAMR9EuQYsXLlWO5ePNMJ25s7Fhv8EIraduDDOJI7kfh6FT98M6Ka/GrLbE0/131X79+/YVXX331+tNPP32b3nt1tGhXP/rooz/ruf9N/YzWQ/2e2c8Cfg7Wz8RC9WkeE8pj/rQltMRH/jXdsdreAEp04mg8u22zYhvZ9IPueLE4puMLfnjRKzKCbD4ZHv9oK/mwaPOlm/ukkbFwjKLj428j8t8DEEvN9xJoJuhsDI9lxOeHXr3zE8cGm7fpQMfNgR54ntXmYXzx1ltvbX64VUl4SH//66+/fl2/5ndLC/BHMV/Q6ypN06Bm3lgFaKMcEbj+bDHN88/curvewF4hjhNWasrwhy/0waIPjylyYjp49Ag++NhFhi7F+jeEFcc/H6w5TYbnxo2OoufXmNPcX+XWv4QLMo+taJkfeY4gvtRs/n8vzY/cssxB5CyKxi96/aB+/Y9+KfE/X3vttS8lI7e9/wfu514OAjYP0QAAAABJRU5ErkJggg==";function lc(i){ae(i,"svelte-1d7uzh5",".room-label-item.svelte-1d7uzh5{position:absolute;font-size:0.5rem;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.room-label-item__text.svelte-1d7uzh5{position:absolute;left:0;top:-4rem;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:1.25rem;min-width:2rem;padding:0 0.375rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-1d7uzh5{position:absolute;top:-2.75rem;height:3rem;width:0.0625rem;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-1d7uzh5{font-size:0.625rem}")}function cc(i){let t,e,n=i[0].name+"",o,s,r,a,l;return{c(){t=j("div"),e=j("span"),o=ke(n),s=_(),r=j("div"),b(e,"class","room-label-item__text svelte-1d7uzh5"),R(e,"background-image","url("+ac+")"),q(e,"wide",i[0].name.length>3),b(r,"class","room-label-item__bar svelte-1d7uzh5"),b(t,"class","room-label-item svelte-1d7uzh5"),R(t,"z-index",i[0].zIndex),R(t,"transform",i[0].transform),R(t,"opacity",i[0].visible?1:0)},m(c,u){B(c,t,u),Q(t,e),Q(e,o),Q(t,s),Q(t,r),a||(l=Pe(e,"click",i[1]),a=!0)},p(c,[u]){u&1&&n!==(n=c[0].name+"")&&Te(o,n),u&1&&q(e,"wide",c[0].name.length>3),u&1&&R(t,"z-index",c[0].zIndex),u&1&&R(t,"transform",c[0].transform),u&1&&R(t,"opacity",c[0].visible?1:0)},i:te,o:te,d(c){c&&M(t),a=!1,l()}}}function uc(i,t,e){let{five:n}=t,{roomLabel:o}=t;function s(){n.setState({panoIndex:o.panoIndex,mode:"Panorama",longitude:o.longitude})}return i.$$set=r=>{"five"in r&&e(2,n=r.five),"roomLabel"in r&&e(0,o=r.roomLabel)},[o,s,n]}class dc extends oe{constructor(t){super(),ie(this,t,uc,cc,ne,{five:2,roomLabel:0},lc)}}const{Map:hc}=sc;function fc(i){ae(i,"svelte-9eg4zi",".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}")}function xo(i,t,e){const n=i.slice();return n[12]=t[e],n}function ko(i,t){let e,n,o;return n=new dc({props:{roomLabel:t[12],five:t[1]}}),{key:i,first:null,c(){e=fe(),ee(n.$$.fragment),this.first=e},m(s,r){B(s,e,r),K(n,s,r),o=!0},p(s,r){t=s;const a={};r&1&&(a.roomLabel=t[12]),r&2&&(a.five=t[1]),n.$set(a)},i(s){o||(D(n.$$.fragment,s),o=!0)},o(s){T(n.$$.fragment,s),o=!1},d(s){s&&M(e),$(n,s)}}}function mc(i){let t,e=[],n=new hc,o,s,r=i[0];const a=l=>l[12].id;for(let l=0;l<r.length;l+=1){let c=xo(i,r,l),u=a(c);n.set(u,e[l]=ko(u,c))}return{c(){t=j("div");for(let l=0;l<e.length;l+=1)e[l].c();b(t,"class","room-labels-container svelte-9eg4zi"),xe(()=>i[6].call(t))},m(l,c){B(l,t,c);for(let u=0;u<e.length;u+=1)e[u].m(t,null);o=bt(t,i[6].bind(t)),s=!0},p(l,[c]){c&3&&(r=l[0],le(),e=Ue(e,c,a,1,l,r,n,t,at,ko,null,xo),ce())},i(l){if(!s){for(let c=0;c<r.length;c+=1)D(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)T(e[c]);s=!1},d(l){l&&M(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}function pc(i,t,e){var g;let n,{five:o}=t,{roomLabels:s}=t,r,a,l=(g=o.model.shownFloor)!=null?g:null;function c(A){if(!(l===null||A.floorIndex===l))return!1;const w=new F.Raycaster,y=o.camera.position.clone(),x=new F.Vector3(A.position.x,A.position.y,A.position.z),L=x.distanceTo(y);w.set(y.clone(),x.clone().sub(y).normalize());const[C]=o.model.intersectRaycaster(w);return!(C&&C.distance+1<L)}function u(A,v){const y=new F.Vector3(A.position.x,A.position.y,A.position.z).clone().project(o.camera),x=Math.ceil((y.x+1)/2*v.x),L=Math.ceil((-y.y+1)/2*v.y);return`translate(${x}px, ${L}px)`}function d(A){const{rendererSize:v,shownFloor:w}=A,y=new Map;function x(C){const S=y.get(C.id);if(S)return S;const{x:k,y:G,z:O}=C.position,W=new F.Vector3(k,G,O).clone().distanceTo(o.camera.position);return y.set(C.id,W),W}return s.map(C=>{const S=c(C),k=S?u(C,v):C.transform,G=x(C),W=s.filter(U=>U.visible&&x(U)<G).length*10;return he(N({},C),{visible:S,transform:k,zIndex:W})})}function h(){e(0,s=d({rendererSize:n,shownFloor:l}))}function p(A){e(4,l=A)}o.on("cameraUpdate",h),o.on("modelShownFloorChange",p),yt(()=>{o.off("cameraUpdate",h),o.off("modelShownFloorChange",p)});function m(){r=this.clientWidth,a=this.clientHeight,e(2,r),e(3,a)}return i.$$set=A=>{"five"in A&&e(1,o=A.five),"roomLabels"in A&&e(0,s=A.roomLabels)},i.$$.update=()=>{i.$$.dirty&12&&e(5,n={x:r,y:a}),i.$$.dirty&48&&e(0,s=d({rendererSize:n,shownFloor:l}))},[s,o,r,a,l,n,m]}class gc extends oe{constructor(t){super(),ie(this,t,pc,mc,ne,{five:1,roomLabels:0},fc)}}function Ac(i){return i.model_room_labels.map(({id:t,pano_index:e,floor_index:n,name:o,position:s,longitude:r})=>({id:t,name:o,position:s,longitude:r,panoIndex:e,floorIndex:n,zIndex:0,visible:!1,transform:""}))}class vc{constructor(t){f(this,"five");f(this,"enabled",!0);f(this,"fiveModeEnabled");f(this,"app");f(this,"wrapper");f(this,"roomLabels",[]);f(this,"container",document.createElement("div"));f(this,"onFiveModeChange",t=>{if(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=Ac(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 gc({target:this.container,props:{five:this.five,roomLabels:this.roomLabels}})}}}const bc=i=>new vc(i),yc={name:"ModelRoomLabelPlugin",version:0};var mt=(i=>(i[i.FLOOR=1]="FLOOR",i[i.CEILING=2]="CEILING",i[i.BOUNDING_CENTER=3]="BOUNDING_CENTER",i))(mt||{});function _n(i){return J(this,null,function*(){try{return[null,yield i]}catch(t){return t instanceof Error?[t,null]:[new Error(""),null]}})}function Zn(i){return Object.prototype.toString.call(i)==="[object Object]"}function oi(i,t){return i===t?!0:typeof i!=typeof t?!1:!!(Number.isNaN(i)&&Number.isNaN(t))}function wc(i,t){const e=Object.getOwnPropertyNames(i),n=Object.getOwnPropertyNames(t);if(e.length!==n.length)return!1;for(let o=0,s=e.length;o<s;o++){const r=e[o];if(!oi(i[r],t[r]))return!1}return!0}function Cc(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!oi(i[e],t[e]))return!1;return!0}function Ec(i,t){return oi(i,t)?!0:Zn(i)&&Zn(t)?wc(i,t):Array.isArray(i)&&Array.isArray(t)?Cc(i,t):!1}function Ki(i,t){return oi(i,t)?!0:Zn(i)&&Zn(t)?Ic(i,t):Array.isArray(i)&&Array.isArray(t)?Pc(i,t):!1}function Pc(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!Ki(i[e],t[e]))return!1;return!0}function Ic(i,t){const e=Object.getOwnPropertyNames(i),n=Object.getOwnPropertyNames(t);if(e.length!==n.length)return!1;for(let o=0,s=e.length;o<s;o++){const r=e[o];if(!Ki(i[r],t[r]))return!1}return!0}function qe(i,t,e={deep:!1}){return e.deep?Ki(i,t):Ec(i,t)}function _t(i){return i<.5?4*i*i*i:.5*Math.pow(2*i-2,3)+1}function da(i){const t=i-1;return t*t*t+1}function Tt(i,{delay:t=0,duration:e=400,easing:n=Jt}={}){const o=+getComputedStyle(i).opacity;return{delay:t,duration:e,easing:n,css:s=>`opacity: ${s*o}`}}function Do(i,{delay:t=0,duration:e=400,easing:n=da,x:o=0,y:s=0,opacity:r=0}={}){const a=getComputedStyle(i),l=+a.opacity,c=a.transform==="none"?"":a.transform,u=l*(1-r);return{delay:t,duration:e,easing:n,css:(d,h)=>`
|
|
105
105
|
transform: ${c} translate(${(1-d)*o}px, ${(1-d)*s}px);
|
|
106
|
-
opacity: ${l-u*h}`}}function qn(i,{delay:t=0,speed:e,duration:n,easing:o=_t}={}){let s=i.getTotalLength();const r=getComputedStyle(i);return r.strokeLinecap!=="butt"&&(s+=parseInt(r.strokeWidth)),n===void 0?e===void 0?n=800:n=s/e:typeof n=="function"&&(n=n(s)),{delay:t,duration:n,easing:o,css:(a,l)=>`stroke-dasharray: ${a*s} ${l*s}`}}const At="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAMAAAANf8AYAAAC2VBMVEUAAACCnP+Dn/+Enf+HqP+Gp/+Fof+Gpf+IrP+Lsf+Dof+Cmv+Lsv+Mtf+Eo/+Bmf+JrP+Hqf+Env+Krv+Fo/+Pu/+Ms/+Qvv+Hqf+RwP+KsP+Fpf+Mtv+Gov+Bnf+Qv/+Nt/+Krv+Ho/+Rwf+Ouv+Emv+Amv+SxP+Sw/+NuP+Mtf/G0f6huP+Ot/+JrP+Jqv+Dnv+crf6Uqv////+QvP+PvP+Ms//J0/3p9/+Ux/+Ouf+Krf+Iqf+Fpv+/zf6WsP+MpP+RqP+Uyf+Jy//V3P6Yuf+Qqf+Rqv/5/f+Sxf+Jy/////+Lx/+Ouf+Nw/+Owv+PwP+Jr/+Jq/+VvP+Vuv/c4v+Fnf+btP+InP+Blf/3+P6Txf+Jzf+Jyf+NxP+Qwf/t8/6Svv+Tvf/O1f7Czv3T2f6cu/+qvP7a4fvo7v77/v/o9//p9//0+v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Xu6l2RpuAKJxiI1tHhcQJAYOHDhgwOZZs4ZSTHR5lQQYPDW1DS4aELQxdyEIAANGjtk8c6aaqTslk8gVwIAN0w3rAEL2bMtHm12AIOHqenXaNDWztEwo9hKJGHjR6OO0yDSI1IGdoQ0iY0a6Tt+06fKUDRQzqKw8Qlxr1AXrwNqwDvGBA+BrGUDc3d3Xr5+SQZj0E2ERqXIjPAJYNUbD18FoWEeDbHLPzLyQ4ePjQ5i3x1RCubfmpqkjMMNo6KOJ5uqe+f58C9GoaD29XyVSYS1h4DftKeWDDN4AbACZMZAsExEKghWUNKXWhlPfA2P1qjmUT556a9jmQotWi/VOFael1lR7ep4JfRZy8nhpwtG4wMMB/gdi9/nNH+vhezsmJ+fG5quX12fomHl6J+KFy88uA2RJyJPE4wkL4wIPBfgXxO5HxGN7zNw5W2bNnLZhio+OmaR3LD6tplrLfKeYAwX7/O6Dje/2dpniwuKiwoMHH+bn7723Z8/uHTu2fpg9+3p29sYrWVnr1l1cO2HCUFCGT+tshUcWLPj6IDf37ued27Z9unXz2owZU6dOnnxp4sQ1q1ePH79KN6vbQWc1SrfrTit6lO5NO6/F8yZNmofBfgNTwRQLsPLsHQAAAABJRU5ErkJggg==";function xc(i){return i*180/Math.PI}function kc(i){ae(i,"svelte-17cl35n",".floorplan__camera-position.svelte-17cl35n{position:absolute;width:0;height:0}.floorplan__camera-rotate.svelte-17cl35n{position:absolute;background-repeat:no-repeat;background-size:100%}")}function Dc(i){let t,e;return{c(){t=j("div"),e=j("div"),b(e,"class","floorplan__camera-rotate svelte-17cl35n"),R(e,"background-image",`url(${i[0]||At})`),R(e,"width",i[4]),R(e,"height",i[4]),R(e,"left","-"+i[4]),R(e,"top","-"+i[4]),R(e,"transform",`rotate(${i[3]}deg)`),R(e,"transform-origin",`${i[4]} ${i[4]}`),b(t,"class","floorplan__camera-position svelte-17cl35n"),R(t,"left",i[1]),R(t,"top",i[2])},m(n,o){B(n,t,o),Q(t,e)},p(n,[o]){o&1&&R(e,"background-image",`url(${n[0]||At})`)},i:te,o:te,d(n){n&&M(t)}}}function Lc(i,t,e){let{panoIndex:n}=t,{floorplanData:o}=t,{lastPanoramaLongitude:s}=t,{cameraImageUrl:r}=t;const{observers:a}=o,l=a[n],c=l.positionInImage.x,u=l.positionInImage.y,d=c*100+"%",h=u*100+"%",p=-xc(s)+45,m=document.body.clientWidth,g=document.body.clientHeight,v=`${(m<500||g<500?17:37)/16}rem`;return i.$$set=w=>{"panoIndex"in w&&e(5,n=w.panoIndex),"floorplanData"in w&&e(6,o=w.floorplanData),"lastPanoramaLongitude"in w&&e(7,s=w.lastPanoramaLongitude),"cameraImageUrl"in w&&e(0,r=w.cameraImageUrl)},[r,d,h,p,v,n,o,s]}class Sc extends oe{constructor(t){super(),ie(this,t,Lc,Dc,ne,{panoIndex:5,floorplanData:6,lastPanoramaLongitude:7,cameraImageUrl:0},kc)}}const zc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArUAAAB7CAMAAABdA4ieAAAC91BMVEUAAACOpP/H0P+yxP/a4/+asv/W3/+/z/+cs//S3f+mu//Q2//5+v/H1P/d5f/l6//y9f++zf/i6f+ww/+ovP/7/P/u8v/N2f+Mp//q7/+4yf+uwf+Wr/+7y/+1xv+Ho//x9P+9zP+2x/+swP+gt/+Oqf/Y4v/r8P/l7P/b4//F0/+juf+Zsv+XsP+Trf/p7v97mv9wj/+kuv+ftf/x9P92lf/3+f/I1f+5yv+Eof98m//8/f/4+f90lf+9zf/j6f/T3f/L1/+Bnv/6+/+SrP/m7P/f5v/O2v/L2P/E0v/Az//+///s8P/e5v+rv/+pvv+Anv+qvv+Pqv+Kpv+CoP93l/9xlP/z9v/p7v90lf9uj//P2//v8//o7f/k6v/K1v+6yv9rjv98nv/E0v/9/v/09//h6P/X4f9pjP/9/f/N2f/K1v/C0f+Ho/99nP/1+P9sj//6+//u8/+iuP/u8//g6P/U3v+3x/+0xv+etf+Vrv9pjf/B0P9ukf+ht/+Vr/94mP/G0/+8zP+2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5JrZl2V9bRnNWyWe4xt8TWTPd3FdEYSEFslnsoURlAi01FqN56f2br2xeOe9ytgbyf4nErGg/hl6RN4Jc5Lt++2rVjHMdCIIqiqtoRQW2mMogIyZFjlsB2B9wjjaY1PXa3wcbSPaEDR1fP9fVt8aPai2+f2+TlWu2l0yweZHlEO5S9cyu1lDKj5T/fWCH4jLaUnXMbvFyrzby8xRrayqUM2+ZWqvuM1nmpgHWkl8F9z9yG7LNa5yEMa0n8yHb93Er1oXjnoMVyFn3KQVcP7VRpFn+sDiznaiuHNufsHnkIwy7aPA/r5jbFGW3m7S12ku55WPN7Li1PPIRhN6sjtBjTmm+KmYcwPEOKs9tHF1JDHCoHLZ5DQ8yPBic9DoHjAKvsb85qjbFxHOCprMZaf5qdhlorxwGeTsPIttvPlno0y3GAZfbHp6n3ynGAV0m99u/2J6H3znGAvW4n+J25tdY7xwFey1pvQe6/DlrjOMDLqfXW7N5pbs0YWhxgtpj0rl1uiaHFISzccSWohUCzOIemm0VKChwHOMutKCVwHOA4av/JVi0xtDiRpCRfRcvQ4lBfxSnG0OJc/+xTjKHFyVRMP38iDC0O92lZVRhanO+vcVWGFu9BRWkW7+Z3rapEizdy7ZVm8V5Gtr8AtSnix59eOmYAAAAASUVORK5CYII=";function Mc(i){ae(i,"svelte-rpkaro",".floorplan-plugin__compass.svelte-rpkaro{position:absolute;left:50%;top:-2.875rem;width:14.4375rem;height:2.5625rem;will-change:opacity;transform-origin:center 11.5rem}.floorplan-plugin__compass-image.svelte-rpkaro{width:100%;height:100%;position:absolute;left:0;top:0;opacity:0.1;background-repeat:no-repeat;background-size:100% 100%}.floorplan-plugin__compass-text.svelte-rpkaro{position:absolute;left:50%;top:0.9375rem;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:0.625rem;color:#fff}")}function Tc(i){let t,e,n,o,s;return{c(){t=j("div"),e=j("div"),n=_(),o=j("span"),s=ke(i[0]),b(e,"class","floorplan-plugin__compass-image svelte-rpkaro"),R(e,"background-image",`url(${zc})`),b(o,"class","floorplan-plugin__compass-text svelte-rpkaro"),b(t,"class","floorplan-plugin__compass svelte-rpkaro"),R(t,"transform",i[2])},m(r,a){B(r,t,a),Q(t,e),Q(t,n),Q(t,o),Q(o,s)},p(r,a){a&1&&Be(s,r[0])},d(r){r&&M(t)}}}function Bc(i){let t,e=i[1]&&Tc(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),B(n,t,o)},p(n,[o]){n[1]&&e.p(n,o)},i:te,o:te,d(n){e&&e.d(n),n&&M(t)}}}function jc(i){return i/Math.PI*180}function Qc(i,t,e){var c;let{floorplanData:n}=t,{northDesc:o}=t;const s=(c=n.entrance)==null?void 0:c.northRad,r=typeof s=="number",l=`translateX(-50%) translateZ(10px) rotate(${-(s?jc(s):0)+90}deg)`;return i.$$set=u=>{"floorplanData"in u&&e(3,n=u.floorplanData),"northDesc"in u&&e(0,o=u.northDesc)},[o,r,l,n]}class Rc extends oe{constructor(t){super(),ie(this,t,Qc,Bc,ne,{floorplanData:3,northDesc:0},Mc)}}const Nt=[];function $i(i,t=te){let e;const n=new Set;function o(a){if(ne(i,a)&&(i=a,e)){const l=!Nt.length;for(const c of n)c[1](),Nt.push(c,i);if(l){for(let c=0;c<Nt.length;c+=2)Nt[c][0](Nt[c+1]);Nt.length=0}}}function s(a){o(a(i))}function r(a,l=te){const c=[a,l];return n.add(c),n.size===1&&(e=t(o)||te),a(i),()=>{n.delete(c),n.size===0&&(e(),e=null)}}return{set:o,update:s,subscribe:r}}function Oc(i){ae(i,"svelte-1gfoniz","img.svelte-1gfoniz{width:100%;height:100%}")}function Hc(i){let t,e;return{c(){t=j("img"),et(t.src,e=i[0])||b(t,"src",e),b(t,"alt","floorplan iamge"),b(t,"class","svelte-1gfoniz")},m(n,o){B(n,t,o)},p(n,[o]){o&1&&!et(t.src,e=n[0])&&b(t,"src",e)},i:te,o:te,d(n){n&&M(t)}}}function Fc(i,t,e){let{url:n}=t;return i.$$set=o=>{"url"in o&&e(0,n=o.url)},[n]}class Gc extends oe{constructor(t){super(),ie(this,t,Fc,Hc,ne,{url:0},Oc)}}function Nc(i){ae(i,"svelte-ub47ya",".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}")}function Wc(i){let t,e,n,o;return{c(){t=j("div"),e=new Yn(!1),n=_(),o=new Yn(!1),e.a=n,o.a=null,b(t,"class","floorplan-plugin__base-image svelte-ub47ya")},m(s,r){B(s,t,r),e.m(i[1],t),Q(t,n),o.m(i[0],t)},p(s,[r]){r&1&&o.p(s[0])},i:te,o:te,d(s){s&&M(t)}}}function Xc(i,t,e){let{content:n}=t;const o=`
|
|
106
|
+
opacity: ${l-u*h}`}}function qn(i,{delay:t=0,speed:e,duration:n,easing:o=_t}={}){let s=i.getTotalLength();const r=getComputedStyle(i);return r.strokeLinecap!=="butt"&&(s+=parseInt(r.strokeWidth)),n===void 0?e===void 0?n=800:n=s/e:typeof n=="function"&&(n=n(s)),{delay:t,duration:n,easing:o,css:(a,l)=>`stroke-dasharray: ${a*s} ${l*s}`}}const At="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAMAAAANf8AYAAAC2VBMVEUAAACCnP+Dn/+Enf+HqP+Gp/+Fof+Gpf+IrP+Lsf+Dof+Cmv+Lsv+Mtf+Eo/+Bmf+JrP+Hqf+Env+Krv+Fo/+Pu/+Ms/+Qvv+Hqf+RwP+KsP+Fpf+Mtv+Gov+Bnf+Qv/+Nt/+Krv+Ho/+Rwf+Ouv+Emv+Amv+SxP+Sw/+NuP+Mtf/G0f6huP+Ot/+JrP+Jqv+Dnv+crf6Uqv////+QvP+PvP+Ms//J0/3p9/+Ux/+Ouf+Krf+Iqf+Fpv+/zf6WsP+MpP+RqP+Uyf+Jy//V3P6Yuf+Qqf+Rqv/5/f+Sxf+Jy/////+Lx/+Ouf+Nw/+Owv+PwP+Jr/+Jq/+VvP+Vuv/c4v+Fnf+btP+InP+Blf/3+P6Txf+Jzf+Jyf+NxP+Qwf/t8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PQF5cyZM6GFYl6eTlN6ixi6aE6PqDLQZRi4EKI/KOfGFjUzqCKsXu6l2RpuAKJxiI1tHhcQJAYOHDhgwOZZs4ZSTHR5lQQYPDW1DS4aELQxdyEIAANGjtk8c6aaqTslk8gVwIAN0w3rAEL2bMtHm12AIOHqenXaNDWztEwo9hKJGHjR6OO0yDSI1IGdoQ0iY0a6Tt+06fKUDRQzqKw8Qlxr1AXrwNqwDvGBA+BrGUDc3d3Xr5+SQZj0E2ERqXIjPAJYNUbD18FoWEeDbHLPzLyQ4ePjQ5i3x1RCubfmpqkjMMNo6KOJ5uqe+f58C9GoaD29XyVSYS1h4DftKeWDDN4AbACZMZAsExEKghWUNKXWhlPfA2P1qjmUT556a9jmQotWi/VOFael1lR7ep4JfRZy8nhpwtG4wMMB/gdi9/nNH+vhezsmJ+fG5quX12fomHl6J+KFy88uA2RJyJPE4wkL4wIPBfgXxO5HxGN7zNw5W2bNnLZhio+OmaR3LD6tplrLfKeYAwX7/O6Dje/2dpniwuKiwoMHH+bn7723Z8/uHTu2fpg9+3p29sYrWVnr1l1cO2HCUFCGT+tshUcWLPj6IDf37ued27Z9unXz2owZU6dOnnxp4sQ1q1ePH79KN6vbQWc1SrfrTit6lO5NO6/F8yZNmofBfgNTwRQLsPLsHQAAAABJRU5ErkJggg==";function xc(i){return i*180/Math.PI}function kc(i){ae(i,"svelte-17cl35n",".floorplan__camera-position.svelte-17cl35n{position:absolute;width:0;height:0}.floorplan__camera-rotate.svelte-17cl35n{position:absolute;background-repeat:no-repeat;background-size:100%}")}function Dc(i){let t,e;return{c(){t=j("div"),e=j("div"),b(e,"class","floorplan__camera-rotate svelte-17cl35n"),R(e,"background-image",`url(${i[0]||At})`),R(e,"width",i[4]),R(e,"height",i[4]),R(e,"left","-"+i[4]),R(e,"top","-"+i[4]),R(e,"transform",`rotate(${i[3]}deg)`),R(e,"transform-origin",`${i[4]} ${i[4]}`),b(t,"class","floorplan__camera-position svelte-17cl35n"),R(t,"left",i[1]),R(t,"top",i[2])},m(n,o){B(n,t,o),Q(t,e)},p(n,[o]){o&1&&R(e,"background-image",`url(${n[0]||At})`)},i:te,o:te,d(n){n&&M(t)}}}function Lc(i,t,e){let{panoIndex:n}=t,{floorplanData:o}=t,{lastPanoramaLongitude:s}=t,{cameraImageUrl:r}=t;const{observers:a}=o,l=a[n],c=l.positionInImage.x,u=l.positionInImage.y,d=c*100+"%",h=u*100+"%",p=-xc(s)+45,m=document.body.clientWidth,g=document.body.clientHeight,v=`${(m<500||g<500?17:37)/16}rem`;return i.$$set=w=>{"panoIndex"in w&&e(5,n=w.panoIndex),"floorplanData"in w&&e(6,o=w.floorplanData),"lastPanoramaLongitude"in w&&e(7,s=w.lastPanoramaLongitude),"cameraImageUrl"in w&&e(0,r=w.cameraImageUrl)},[r,d,h,p,v,n,o,s]}class Sc extends oe{constructor(t){super(),ie(this,t,Lc,Dc,ne,{panoIndex:5,floorplanData:6,lastPanoramaLongitude:7,cameraImageUrl:0},kc)}}const zc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArUAAAB7CAMAAABdA4ieAAAC91BMVEUAAACOpP/H0P+yxP/a4/+asv/W3/+/z/+cs//S3f+mu//Q2//5+v/H1P/d5f/l6//y9f++zf/i6f+ww/+ovP/7/P/u8v/N2f+Mp//q7/+4yf+uwf+Wr/+7y/+1xv+Ho//x9P+9zP+2x/+swP+gt/+Oqf/Y4v/r8P/l7P/b4//F0/+juf+Zsv+XsP+Trf/p7v97mv9wj/+kuv+ftf/x9P92lf/3+f/I1f+5yv+Eof98m//8/f/4+f90lf+9zf/j6f/T3f/L1/+Bnv/6+/+SrP/m7P/f5v/O2v/L2P/E0v/Az//+///s8P/e5v+rv/+pvv+Anv+qvv+Pqv+Kpv+CoP93l/9xlP/z9v/p7v90lf9uj//P2//v8//o7f/k6v/K1v+6yv9rjv98nv/E0v/9/v/09//h6P/X4f9pjP/9/f/N2f/K1v/C0f+Ho/99nP/1+P9sj//6+//u8/+iuP/u8//g6P/U3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xuu5cpUqvU+wwzYbVVkIXYLHd/olekVpmpZ8KiMYbU7ma/EXJZBW5JrZl2V9bRnNWyWe4xt8TWTPd3FdEYSEFslnsoURlAi01FqN56f2br2xeOe9ytgbyf4nErGg/hl6RN4Jc5Lt++2rVjHMdCIIqiqtoRQW2mMogIyZFjlsB2B9wjjaY1PXa3wcbSPaEDR1fP9fVt8aPai2+f2+TlWu2l0yweZHlEO5S9cyu1lDKj5T/fWCH4jLaUnXMbvFyrzby8xRrayqUM2+ZWqvuM1nmpgHWkl8F9z9yG7LNa5yEMa0n8yHb93Er1oXjnoMVyFn3KQVcP7VRpFn+sDiznaiuHNufsHnkIwy7aPA/r5jbFGW3m7S12ku55WPN7Li1PPIRhN6sjtBjTmm+KmYcwPEOKs9tHF1JDHCoHLZ5DQ8yPBic9DoHjAKvsb85qjbFxHOCprMZaf5qdhlorxwGeTsPIttvPlno0y3GAZfbHp6n3ynGAV0m99u/2J6H3znGAvW4n+J25tdY7xwFey1pvQe6/DlrjOMDLqfXW7N5pbs0YWhxgtpj0rl1uiaHFISzccSWohUCzOIemm0VKChwHOMutKCVwHOA4av/JVi0xtDiRpCRfRcvQ4lBfxSnG0OJc/+xTjKHFyVRMP38iDC0O92lZVRhanO+vcVWGFu9BRWkW7+Z3rapEizdy7ZVm8V5Gtr8AtSnix59eOmYAAAAASUVORK5CYII=";function Mc(i){ae(i,"svelte-rpkaro",".floorplan-plugin__compass.svelte-rpkaro{position:absolute;left:50%;top:-2.875rem;width:14.4375rem;height:2.5625rem;will-change:opacity;transform-origin:center 11.5rem}.floorplan-plugin__compass-image.svelte-rpkaro{width:100%;height:100%;position:absolute;left:0;top:0;opacity:0.1;background-repeat:no-repeat;background-size:100% 100%}.floorplan-plugin__compass-text.svelte-rpkaro{position:absolute;left:50%;top:0.9375rem;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:0.625rem;color:#fff}")}function Tc(i){let t,e,n,o,s;return{c(){t=j("div"),e=j("div"),n=_(),o=j("span"),s=ke(i[0]),b(e,"class","floorplan-plugin__compass-image svelte-rpkaro"),R(e,"background-image",`url(${zc})`),b(o,"class","floorplan-plugin__compass-text svelte-rpkaro"),b(t,"class","floorplan-plugin__compass svelte-rpkaro"),R(t,"transform",i[2])},m(r,a){B(r,t,a),Q(t,e),Q(t,n),Q(t,o),Q(o,s)},p(r,a){a&1&&Te(s,r[0])},d(r){r&&M(t)}}}function Bc(i){let t,e=i[1]&&Tc(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),B(n,t,o)},p(n,[o]){n[1]&&e.p(n,o)},i:te,o:te,d(n){e&&e.d(n),n&&M(t)}}}function jc(i){return i/Math.PI*180}function Qc(i,t,e){var c;let{floorplanData:n}=t,{northDesc:o}=t;const s=(c=n.entrance)==null?void 0:c.northRad,r=typeof s=="number",l=`translateX(-50%) translateZ(10px) rotate(${-(s?jc(s):0)+90}deg)`;return i.$$set=u=>{"floorplanData"in u&&e(3,n=u.floorplanData),"northDesc"in u&&e(0,o=u.northDesc)},[o,r,l,n]}class Rc extends oe{constructor(t){super(),ie(this,t,Qc,Bc,ne,{floorplanData:3,northDesc:0},Mc)}}const Nt=[];function $i(i,t=te){let e;const n=new Set;function o(a){if(ne(i,a)&&(i=a,e)){const l=!Nt.length;for(const c of n)c[1](),Nt.push(c,i);if(l){for(let c=0;c<Nt.length;c+=2)Nt[c][0](Nt[c+1]);Nt.length=0}}}function s(a){o(a(i))}function r(a,l=te){const c=[a,l];return n.add(c),n.size===1&&(e=t(o)||te),a(i),()=>{n.delete(c),n.size===0&&(e(),e=null)}}return{set:o,update:s,subscribe:r}}function Oc(i){ae(i,"svelte-1gfoniz","img.svelte-1gfoniz{width:100%;height:100%}")}function Hc(i){let t,e;return{c(){t=j("img"),et(t.src,e=i[0])||b(t,"src",e),b(t,"alt","floorplan iamge"),b(t,"class","svelte-1gfoniz")},m(n,o){B(n,t,o)},p(n,[o]){o&1&&!et(t.src,e=n[0])&&b(t,"src",e)},i:te,o:te,d(n){n&&M(t)}}}function Fc(i,t,e){let{url:n}=t;return i.$$set=o=>{"url"in o&&e(0,n=o.url)},[n]}class Gc extends oe{constructor(t){super(),ie(this,t,Fc,Hc,ne,{url:0},Oc)}}function Nc(i){ae(i,"svelte-ub47ya",".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}")}function Wc(i){let t,e,n,o;return{c(){t=j("div"),e=new Yn(!1),n=_(),o=new Yn(!1),e.a=n,o.a=null,b(t,"class","floorplan-plugin__base-image svelte-ub47ya")},m(s,r){B(s,t,r),e.m(i[1],t),Q(t,n),o.m(i[0],t)},p(s,[r]){r&1&&o.p(s[0])},i:te,o:te,d(s){s&&M(t)}}}function Xc(i,t,e){let{content:n}=t;const o=`
|
|
107
107
|
<style>
|
|
108
108
|
svg [type='lineGroup'] path {
|
|
109
109
|
fill: #ffffff;
|
|
@@ -112,7 +112,7 @@ transition: all 500ms;
|
|
|
112
112
|
svg [type='lineItemGroup'] g g g g {
|
|
113
113
|
stroke: #ffffff;
|
|
114
114
|
}</style>
|
|
115
|
-
`;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class Yc extends oe{constructor(t){super(),ie(this,t,Xc,Wc,ne,{content:0},Nc)}}function Uc(i){ae(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function Vc(i){let t,e;return t=new Gc({props:{url:i[1].url}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.url=n[1].url),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Jc(i){let t,e;return t=new Yc({props:{content:i[0]}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.content=n[0]),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function _c(i){let t,e,n,o;const s=[Jc,Vc],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(i))&&(n=r[e]=s[e](i)),{c(){t=j("div"),n&&n.c(),b(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){B(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let u=e;e=a(l),e===u?~e&&r[e].p(l,c):(n&&(le(),T(r[u],1,1,()=>{r[u]=null}),ce()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),D(n,1),n.m(t,null)):n=null)},i(l){o||(D(n),o=!0)},o(l){T(n),o=!1},d(l){l&&M(t),~e&&r[e].d()}}}function Zc(i,t,e){let n,o,{floorIndex:s}=t,{floorplanData:r}=t;return i.$$set=a=>{"floorIndex"in a&&e(2,s=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},i.$$.update=()=>{var a,l;i.$$.dirty&12&&e(1,n=r.outlines[s]),i.$$.dirty&12&&e(0,o=(l=(a=r.outlines)==null?void 0:a[s])==null?void 0:l.svgContent)},[o,n,s,r]}class ha extends oe{constructor(t){super(),ie(this,t,Zc,_c,ne,{floorIndex:2,floorplanData:3},Uc)}}function qc(i){ae(i,"svelte-12pzct5",".floorplan-plugin__room-label-item.svelte-12pzct5{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:1;color:#fff;transform:translate(-50%, -50%);white-space:nowrap;will-change:opacity;transition:opacity 300ms}.floorplan-plugin__room-size.svelte-12pzct5{opacity:0.45}")}function Kc(i){let t,e=i[4].outerHTML+"",n;return{c(){t=new Yn(!1),n=fe(),t.a=n},m(o,s){t.m(e,o,s),B(o,n,s)},p(o,s){s&16&&e!==(e=o[4].outerHTML+"")&&t.p(e)},d(o){o&&M(n),o&&t.d()}}}function $c(i){let t,e=i[0].name+"",n,o,s,r;return{c(){t=j("span"),n=ke(e),o=_(),s=j("span"),r=ke(i[5]),b(t,"class","floorplan-plugin__room-name"),b(s,"class","floorplan-plugin__room-size svelte-12pzct5")},m(a,l){B(a,t,l),Q(t,n),B(a,o,l),B(a,s,l),Q(s,r)},p(a,l){l&1&&e!==(e=a[0].name+"")&&Be(n,e),l&32&&Be(r,a[5])},d(a){a&&M(t),a&&M(o),a&&M(s)}}}function eu(i){let t;function e(s,r){if(s[1]===void 0)return $c;if(s[4])return Kc}let n=e(i),o=n&&n(i);return{c(){t=j("div"),o&&o.c(),b(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),R(t,"left",i[6]),R(t,"top",i[7]),R(t,"font-size",i[8]),R(t,"opacity",i[3]?"1":"0")},m(s,r){B(s,t,r),o&&o.m(t,null),i[16](t)},p(s,[r]){n===(n=e(s))&&o?o.p(s,r):(o&&o.d(1),o=n&&n(s),o&&(o.c(),o.m(t,null))),r&8&&R(t,"opacity",s[3]?"1":"0")},i:te,o:te,d(s){s&&M(t),o&&o.d(),i[16](null)}}}function tu(i,t){const e=i[0],n=i[1];let o=!1;for(let s=0,r=t.length-1;s<t.length;r=s++){const a=t[s][0],l=t[s][1],c=t[r][0],u=t[r][1];l>n!=u>n&&e<(c-a)*(n-l)/(u-l)+a&&(o=!o)}return o}function nu(i,t,e){let n,o,s,r,{pxmm:a}=t,{room:l}=t,{hoveredRoom:c}=t,{getRoomAreaText:u}=t,{getLabelElement:d}=t,{adaptiveRoomLabelVisibleEnable:h}=t;function p(k,G){if(G.width===0||G.height===0)return()=>!1;const O=k.path.map(({x:Z,y:Y})=>[Z,Y]),W=k.roomLabel.position,{x:U,y:P}=W,{width:I,height:z}=G,H=I/2,X=z/2;return function(Y){const V=U*Y,ue=P*Y,de=O.map(([Ce,De])=>[Ce*Y,De*Y]);return[[V+H,ue-X],[V-H,ue-X],[V-H,ue+X],[V+H,ue+X]].every(Ce=>tu(Ce,de))}}const m=document.body.clientWidth,g=document.body.clientHeight,A=l.roomLabel,v=A.positionInImage.x*100+"%",w=A.positionInImage.y*100+"%",y=(m<500||g<500?10:14)/16+"rem";let x=!1,L,C;c.subscribe(function(G){e(13,x=!!G&&G.id===l.id)}),Ye(()=>{const k=L==null?void 0:L.getClientRects()[0];e(14,C={width:k.width,height:k.height})});function S(k){Te[k?"unshift":"push"](()=>{L=k,e(2,L)})}return i.$$set=k=>{"pxmm"in k&&e(9,a=k.pxmm),"room"in k&&e(0,l=k.room),"hoveredRoom"in k&&e(10,c=k.hoveredRoom),"getRoomAreaText"in k&&e(11,u=k.getRoomAreaText),"getLabelElement"in k&&e(1,d=k.getLabelElement),"adaptiveRoomLabelVisibleEnable"in k&&e(12,h=k.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&2049&&e(5,n=l.size?u(l.size):""),i.$$.dirty&16385&&e(15,o=C?p(l,C):void 0),i.$$.dirty&3&&e(4,s=d==null?void 0:d(l)),i.$$.dirty&45568&&e(3,r=h?x?!0:!!(o!=null&&o(a)):!0)},[l,d,L,r,s,n,v,w,y,a,c,u,h,x,C,o,S]}class iu extends oe{constructor(t){super(),ie(this,t,nu,eu,ne,{pxmm:9,room:0,hoveredRoom:10,getRoomAreaText:11,getLabelElement:1,adaptiveRoomLabelVisibleEnable:12},qc)}}function ou(i){ae(i,"svelte-13xux0b",".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}")}function Lo(i,t,e){const n=i.slice();return n[10]=t[e],n}function So(i){let t,e=[],n=new Map,o,s,r=i[6];const a=l=>l[10].id;for(let l=0;l<r.length;l+=1){let c=Lo(i,r,l),u=a(c);n.set(u,e[l]=zo(u,c))}return{c(){t=j("div");for(let l=0;l<e.length;l+=1)e[l].c();b(t,"class","floorplan-plugin__room-labels svelte-13xux0b"),xe(()=>i[9].call(t))},m(l,c){B(l,t,c);for(let u=0;u<e.length;u+=1)e[u].m(t,null);o=bt(t,i[9].bind(t)),s=!0},p(l,c){c&111&&(r=l[6],le(),e=Ue(e,c,a,1,l,r,n,t,at,zo,null,Lo),ce())},i(l){if(!s){for(let c=0;c<r.length;c+=1)D(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)T(e[c]);s=!1},d(l){l&&M(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}function zo(i,t){let e,n,o;const s=[{pxmm:t[5],room:t[10],getLabelElement:t[2],getRoomAreaText:t[1],hoveredRoom:t[0],adaptiveRoomLabelVisibleEnable:t[3]}];let r={};for(let a=0;a<s.length;a+=1)r=we(r,s[a]);return n=new iu({props:r}),{key:i,first:null,c(){e=fe(),ee(n.$$.fragment),this.first=e},m(a,l){B(a,e,l),K(n,a,l),o=!0},p(a,l){t=a;const c=l&111?je(s,[{pxmm:t[5],room:t[10],getLabelElement:t[2],getRoomAreaText:t[1],hoveredRoom:t[0],adaptiveRoomLabelVisibleEnable:t[3]}]):{};n.$set(c)},i(a){o||(D(n.$$.fragment,a),o=!0)},o(a){T(n.$$.fragment,a),o=!1},d(a){a&&M(e),$(n,a)}}}function su(i){let t,e,n=i[6]&&So(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[6]?n?(n.p(o,s),s&64&&D(n,1)):(n=So(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function ru(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t,{hoveredRoom:r}=t,{getRoomAreaText:a}=t,{getLabelElement:l}=t,{adaptiveRoomLabelVisibleEnable:c}=t,u=0,d=0;function h(){u=this.clientWidth,e(4,u)}return i.$$set=p=>{"floorIndex"in p&&e(7,o=p.floorIndex),"floorplanData"in p&&e(8,s=p.floorplanData),"hoveredRoom"in p&&e(0,r=p.hoveredRoom),"getRoomAreaText"in p&&e(1,a=p.getRoomAreaText),"getLabelElement"in p&&e(2,l=p.getLabelElement),"adaptiveRoomLabelVisibleEnable"in p&&e(3,c=p.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&384&&e(6,n=s.floorDatas[o].rooms),i.$$.dirty&272){const{max:p,min:m}=s.bounding,g=p.x-m.x;e(5,d=u/g)}},[r,a,l,c,u,d,n,o,s,h]}class au extends oe{constructor(t){super(),ie(this,t,ru,su,ne,{floorIndex:7,floorplanData:8,hoveredRoom:0,getRoomAreaText:1,getLabelElement:2,adaptiveRoomLabelVisibleEnable:3},ou)}}function lu(i){ae(i,"svelte-djlmk4",".floorplan-plugin__rule-labels.svelte-djlmk4.svelte-djlmk4{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-djlmk4.svelte-djlmk4{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4.svelte-djlmk4{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4.svelte-djlmk4{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4.svelte-djlmk4{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-djlmk4.svelte-djlmk4{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale-wrapper.svelte-djlmk4{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-djlmk4.svelte-djlmk4{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale.svelte-djlmk4{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute}.floorplan-plugin__rule-labels--top.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-djlmk4.svelte-djlmk4{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-text-item.svelte-djlmk4{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-djlmk4.svelte-djlmk4{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}")}function Mo(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function To(i,t,e){const n=i.slice();return n[14]=t[e],n}function Bo(i){let t;return{c(){t=j("div"),b(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),R(t,"left",i[14].left*100+"%"),R(t,"bottom",i[14].bottom*100+"%")},m(e,n){B(e,t,n)},p:te,d(e){e&&M(t)}}}function jo(i,t){let e,n,o=t[1](t[11].distance)+"",s,r;return{key:i,first:null,c(){e=j("div"),n=j("div"),s=ke(o),r=_(),b(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),q(n,"is-row",t[2]),b(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),R(e,"left",t[11].left*100+"%"),R(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){B(a,e,l),Q(e,n),Q(n,s),Q(e,r)},p(a,l){t=a,l&2&&o!==(o=t[1](t[11].distance)+"")&&Be(s,o)},d(a){a&&M(e)}}}function cu(i){let t,e,n,o,s,r,a=[],l=new Map,c,u=i[3],d=[];for(let m=0;m<u.length;m+=1)d[m]=Bo(To(i,u,m));let h=i[4];const p=m=>m[13];for(let m=0;m<h.length;m+=1){let g=Mo(i,h,m),A=p(g);l.set(A,a[m]=jo(A,g))}return{c(){t=j("div"),e=j("div"),n=_(),o=j("div");for(let m=0;m<d.length;m+=1)d[m].c();s=_(),r=j("div");for(let m=0;m<a.length;m+=1)a[m].c();b(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),b(o,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),q(o,"is-row",i[2]),b(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),b(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+i[0]+" svelte-djlmk4"),q(t,"is-row",i[2]),R(t,"width",i[2]?"100%":1/16+"rem"),R(t,"height",i[2]?1/16+"rem":"100%")},m(m,g){B(m,t,g),Q(t,e),Q(t,n),Q(t,o);for(let A=0;A<d.length;A+=1)d[A].m(o,null);Q(t,s),Q(t,r);for(let A=0;A<a.length;A+=1)a[A].m(r,null)},p(m,[g]){if(g&8){u=m[3];let A;for(A=0;A<u.length;A+=1){const v=To(m,u,A);d[A]?d[A].p(v,g):(d[A]=Bo(v),d[A].c(),d[A].m(o,null))}for(;A<d.length;A+=1)d[A].d(1);d.length=u.length}g&22&&(h=m[4],a=Ue(a,g,p,1,m,h,l,r,ua,jo,null,Mo)),g&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+m[0]+" svelte-djlmk4")&&b(t,"class",c),g&5&&q(t,"is-row",m[2])},i:te,o:te,d(m){m&&M(t),tt(d,m);for(let g=0;g<a.length;g+=1)a[g].d()}}}const Wt=1e3,Xt=180;function uu(i,t,e){let{type:n}=t,{data:o}=t,{bounding:s}=t,{getRuleDistanceText:r}=t;const a=n==="top"||n==="bottom",l=s.max.x-s.min.x-(Wt-Xt)*2,c=s.max.y-s.min.y-(Wt-Xt)*2,u=o.map(([m,g])=>a?[m.x,g.x]:[m.y,g.y]).flat().sort().filter((m,g,A)=>g===0?!0:m!==A[g-1]),d=u.map(m=>{const g=a?(m-s.min.x-Wt+Xt)/l:0,A=a?0:(m-s.min.y-Wt+Xt)/c;return{left:g,bottom:A}});d.unshift({left:0,bottom:0}),d.push(a?{left:1,bottom:0}:{left:0,bottom:1});const h=u[u.length-1]-u[0],p=u.map((m,g,A)=>{const v=g===0?0:m-A[g-1],w=g===0?0:(m+A[g-1])/2,y=a?(w-s.min.x-Wt+Xt)/l:0,x=a?0:(w-s.min.y-Wt+Xt)/c;return{left:y,bottom:x,distance:v}}).filter(({distance:m})=>m/h>.1);return i.$$set=m=>{"type"in m&&e(0,n=m.type),"data"in m&&e(5,o=m.data),"bounding"in m&&e(6,s=m.bounding),"getRuleDistanceText"in m&&e(1,r=m.getRuleDistanceText)},[n,r,a,d,p,o,s]}class du extends oe{constructor(t){super(),ie(this,t,uu,cu,ne,{type:0,data:5,bounding:6,getRuleDistanceText:1},lu)}}function hu(i){ae(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function Qo(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function Ro(i,t){let e,n,o;const s=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<s.length;a+=1)r=we(r,s[a]);return n=new du({props:r}),{key:i,first:null,c(){e=fe(),ee(n.$$.fragment),this.first=e},m(a,l){B(a,e,l),K(n,a,l),o=!0},p(a,l){t=a;const c=l&19?je(s,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){o||(D(n.$$.fragment,a),o=!0)},o(a){T(n.$$.fragment,a),o=!1},d(a){a&&M(e),$(n,a)}}}function fu(i){let t,e=[],n=new Map,o,s=i[4];const r=a=>a[13];for(let a=0;a<s.length;a+=1){let l=Qo(i,s,a),c=r(l);n.set(c,e[a]=Ro(c,l))}return{c(){t=j("div");for(let a=0;a<e.length;a+=1)e[a].c();b(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),R(t,"width",i[3]),R(t,"height",i[2])},m(a,l){B(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,[l]){l&19&&(s=a[4],le(),e=Ue(e,l,r,1,a,s,n,t,at,Ro,null,Qo),ce()),l&8&&R(t,"width",a[3]),l&4&&R(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)D(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)T(e[l]);o=!1},d(a){a&&M(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const Oo=1e3,Ho=180;function mu(i,t,e){let n,o,s,r,a,l,c,u,d,h,{floorIndex:p}=t,{floorplanData:m}=t,{getRuleDistanceText:g}=t;return i.$$set=A=>{"floorIndex"in A&&e(5,p=A.floorIndex),"floorplanData"in A&&e(6,m=A.floorplanData),"getRuleDistanceText"in A&&e(0,g=A.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=m.bounding),i.$$.dirty&96&&e(11,o=m.floorDatas[p].rules),i.$$.dirty&2048&&e(12,s=Object.keys(o)),i.$$.dirty&6144&&e(4,r=s.map(A=>[A,o[A]])),i.$$.dirty&2&&e(9,a=n.max.x-n.min.x),i.$$.dirty&2&&e(7,l=n.max.y-n.min.y),i.$$.dirty&2&&e(10,c=n.max.x-n.min.x-(Oo-Ho)*2),i.$$.dirty&2&&e(8,u=n.max.y-n.min.y-(Oo-Ho)*2),i.$$.dirty&1536&&e(3,d=c/a*100+"%"),i.$$.dirty&384&&e(2,h=u/l*100+"%")},[g,n,h,d,r,p,m,l,u,a,c,o,s]}class pu extends oe{constructor(t){super(),ie(this,t,mu,fu,ne,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},hu)}}function si(i,t={}){let e="";const{needZ:n,needA:o}=t;return(n?i.slice().concat(i[0]):i.slice()).forEach((r,a)=>{const{x:l,y:c}=t.format?t.format(r):r,u=l+","+c;return a===0?(e+="M"+u,e):o!=null&&o[a]?(e+="A"+o[a]+","+u,e):(e+="L"+u,e)}),e+(n?"Z":"")}function fa({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function gu(i,t){const e=i.x*1e3+t.bounding.origin.x,n=-i.z*1e3+t.bounding.origin.y;return{x:e,y:n}}function Au(i,t){const e=t.bounding,n=e.max.x-e.min.x,o=e.max.y-e.min.y;return{x:(i.x-e.min.x)/n,y:(e.max.y-i.y)/o}}function vu(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function bu(i){let t;return{c(){t=Ae("path"),b(t,"d",i[0]),b(t,"fill","#2F313A")},m(e,n){B(e,t,n)},p(e,[n]){n&1&&b(t,"d",e[0])},i:te,o:te,d(e){e&&M(t)}}}function yu(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=si(o,{needZ:!0}))},[n,o]}class wu extends oe{constructor(t){super(),ie(this,t,yu,bu,ne,{path:1})}}function Cu(i){let t,e,n,o,s,r;return{c(){t=Ae("defs"),e=Ae("pattern"),n=Ae("rect"),o=Ae("path"),s=_(),r=Ae("path"),b(n,"x","0"),b(n,"y","0"),b(n,"width",i[1]),b(n,"height",i[1]),b(n,"fill","#323747"),b(o,"d",i[2]),b(o,"stroke","#ffffff"),b(o,"stroke-opacity","0.06"),b(o,"stroke-width","0.5"),b(o,"fill","none"),b(e,"id","fpm-room-pattern-0"),b(e,"x","0"),b(e,"y","0"),b(e,"width",i[1]),b(e,"height",i[1]),b(e,"patternUnits","userSpaceOnUse"),b(e,"patternTransform","scale(50 50)"),b(r,"d",i[0]),b(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){B(a,t,l),Q(t,e),Q(e,n),Q(e,o),B(a,s,l),B(a,r,l)},p(a,[l]){l&1&&b(r,"d",a[0])},i:te,o:te,d(a){a&&M(t),a&&M(s),a&&M(r)}}}const vi=6;function Eu(i,t,e){let n,{path:o}=t;const s=vi*2,r=`M0 ${vi} h ${s} M${vi} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=si(o,{needZ:!0}))},[n,s,r,o]}class Pu extends oe{constructor(t){super(),ie(this,t,Eu,Cu,ne,{path:3})}}function Iu(i){let t,e,n,o,s,r,a,l,c,u,d;return{c(){t=Ae("defs"),e=Ae("pattern"),n=Ae("rect"),o=Ae("pattern"),s=Ae("rect"),r=_(),a=Ae("path"),l=_(),c=Ae("path"),u=_(),d=Ae("path"),b(n,"x","0"),b(n,"y","0"),b(n,"width","6"),b(n,"height","50"),b(n,"fill","none"),b(n,"stroke","#4B4B57"),b(n,"stroke-width","0.5"),b(e,"id","room-material-pattern-1"),b(e,"x","0"),b(e,"y","0"),b(e,"width","12"),b(e,"height","50"),b(e,"patternUnits","userSpaceOnUse"),b(e,"patternTransform","scale(50 50)"),b(s,"x","0"),b(s,"y","0"),b(s,"width","6"),b(s,"height","50"),b(s,"fill","none"),b(s,"stroke","#4B4B57"),b(s,"stroke-width","0.5"),b(o,"id","room-material-pattern-2"),b(o,"x","6"),b(o,"y","25"),b(o,"width","12"),b(o,"height","50"),b(o,"patternUnits","userSpaceOnUse"),b(o,"patternTransform","scale(50 50)"),b(a,"d",i[0]),b(a,"fill","#43434D"),b(c,"d",i[0]),b(c,"fill","url(#room-material-pattern-1)"),b(d,"d",i[0]),b(d,"fill","url(#room-material-pattern-2)")},m(h,p){B(h,t,p),Q(t,e),Q(e,n),Q(t,o),Q(o,s),B(h,r,p),B(h,a,p),B(h,l,p),B(h,c,p),B(h,u,p),B(h,d,p)},p(h,[p]){p&1&&b(a,"d",h[0]),p&1&&b(c,"d",h[0]),p&1&&b(d,"d",h[0])},i:te,o:te,d(h){h&&M(t),h&&M(r),h&&M(a),h&&M(l),h&&M(c),h&&M(u),h&&M(d)}}}function xu(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=si(o,{needZ:!0}))},[n,o]}class ku extends oe{constructor(t){super(),ie(this,t,xu,Iu,ne,{path:1})}}function Du(i){ae(i,"svelte-1dykexu",".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}")}function Fo(i,t,e){const n=i.slice();return n[5]=t[e],n}function Lu(i){let t,e;return t=new Pu({props:{path:i[5].path}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Su(i){let t,e;return t=new ku({props:{path:i[5].path}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function zu(i){let t,e;return t=new wu({props:{path:i[5].path}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Go(i){let t,e,n,o;const s=[zu,Su,Lu],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(i),n=r[e]=s[e](i),{c(){t=Ae("svg"),n.c(),b(t,"width","100%"),b(t,"height","100%"),b(t,"viewBox",`0 0 ${i[1]} ${i[2]}`),b(t,"class","svelte-1dykexu")},m(l,c){B(l,t,c),r[e].m(t,null),o=!0},p(l,c){let u=e;e=a(l),e===u?r[e].p(l,c):(le(),T(r[u],1,1,()=>{r[u]=null}),ce(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),D(n,1),n.m(t,null))},i(l){o||(D(n),o=!0)},o(l){T(n),o=!1},d(l){l&&M(t),r[e].d()}}}function Mu(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=Go(Fo(i,n,r));const s=r=>T(o[r],1,1,()=>{o[r]=null});return{c(){t=j("div");for(let r=0;r<o.length;r+=1)o[r].c();b(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){B(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=Fo(r,n,l);o[l]?(o[l].p(c,a),D(o[l],1)):(o[l]=Go(c),o[l].c(),D(o[l],1),o[l].m(t,null))}for(le(),l=n.length;l<o.length;l+=1)s(l);ce()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)D(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)T(o[a]);e=!1},d(r){r&&M(t),tt(o,r)}}}function Tu(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t;const r=s.bounding.max.x-s.bounding.min.x,a=s.bounding.max.y-s.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(3,o=l.floorIndex),"floorplanData"in l&&e(4,s=l.floorplanData)},i.$$.update=()=>{i.$$.dirty&24&&e(0,n=s.floorDatas[o].rooms.map(l=>he(N({},l),{path:l.path.map(c=>fa(c,s.bounding))})))},[n,r,a,o,s]}class Bu extends oe{constructor(t){super(),ie(this,t,Tu,Mu,ne,{floorIndex:3,floorplanData:4},Du)}}function ju(i){ae(i,"svelte-19uvvss","path.svelte-19uvvss{opacity:0}path.svelte-19uvvss:hover{opacity:0.1}")}function Qu(i){let t,e,n;return{c(){t=Ae("path"),b(t,"d",i[2]),b(t,"fill","#fff"),b(t,"class","svelte-19uvvss")},m(o,s){B(o,t,s),e||(n=[Pe(t,"mouseenter",i[0]),Pe(t,"mouseleave",i[1])],e=!0)},p:te,i:te,o:te,d(o){o&&M(t),e=!1,rt(n)}}}function Ru(i,t,e){let{room:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t;function r(){s.set(n)}function a(){s.set(void 0)}const{bounding:l}=o,c=si(n.path,{needZ:!0,format:u=>fa(u,l)});return i.$$set=u=>{"room"in u&&e(3,n=u.room),"floorplanData"in u&&e(4,o=u.floorplanData),"hoveredRoom"in u&&e(5,s=u.hoveredRoom)},[r,a,c,n,o,s]}class Ou extends oe{constructor(t){super(),ie(this,t,Ru,Qu,ne,{room:3,floorplanData:4,hoveredRoom:5},ju)}}function Hu(i){ae(i,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function No(i,t,e){const n=i.slice();return n[5]=t[e],n}function Wo(i,t){let e,n,o;const s=[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}];let r={};for(let a=0;a<s.length;a+=1)r=we(r,s[a]);return n=new Ou({props:r}),{key:i,first:null,c(){e=fe(),ee(n.$$.fragment),this.first=e},m(a,l){B(a,e,l),K(n,a,l),o=!0},p(a,l){t=a;const c=l&7?je(s,[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}]):{};n.$set(c)},i(a){o||(D(n.$$.fragment,a),o=!0)},o(a){T(n.$$.fragment,a),o=!1},d(a){a&&M(e),$(n,a)}}}function Fu(i){let t,e,n=[],o=new Map,s,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[5].id;for(let l=0;l<r.length;l+=1){let c=No(i,r,l),u=a(c);o.set(u,n[l]=Wo(u,c))}return{c(){t=j("div"),e=Ae("svg");for(let l=0;l<n.length;l+=1)n[l].c();b(e,"width","100%"),b(e,"height","100%"),b(e,"viewBox",`0 0 ${i[3]} ${i[4]}`),b(e,"class","svelte-1kqo6e4"),b(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){B(l,t,c),Q(t,e);for(let u=0;u<n.length;u+=1)n[u].m(e,null);s=!0},p(l,[c]){c&7&&(r=l[1].floorDatas[l[0]].rooms,le(),n=Ue(n,c,a,1,l,r,o,e,at,Wo,null,No),ce())},i(l){if(!s){for(let c=0;c<r.length;c+=1)D(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)T(n[c]);s=!1},d(l){l&&M(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function Gu(i,t,e){let{floorIndex:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t;const r=o.bounding.max.x-o.bounding.min.x,a=o.bounding.max.y-o.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(0,n=l.floorIndex),"floorplanData"in l&&e(1,o=l.floorplanData),"hoveredRoom"in l&&e(2,s=l.hoveredRoom)},[n,o,s,r,a]}class ma extends oe{constructor(t){super(),ie(this,t,Gu,Fu,ne,{floorIndex:0,floorplanData:1,hoveredRoom:2},Hu)}}function Nu(i){ae(i,"svelte-bl8zrz",".floorplan-plugin__floor.svelte-bl8zrz{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;pointer-events:none}.floorplan-plugin__floor--is-current.svelte-bl8zrz{opacity:1;pointer-events:auto}")}function Xo(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[5],hoveredRoom:i[10]}];let o={};for(let s=0;s<n.length;s+=1)o=we(o,n[s]);return t=new ma({props:o}),{c(){ee(t.$$.fragment)},m(s,r){K(t,s,r),e=!0},p(s,r){const a=r&1058?je(n,[{floorIndex:s[1],floorplanData:s[5],hoveredRoom:s[10]}]):{};t.$set(a)},i(s){e||(D(t.$$.fragment,s),e=!0)},o(s){T(t.$$.fragment,s),e=!1},d(s){$(t,s)}}}function Yo(i){let t,e;const n=[{floorplanData:i[5],floorIndex:i[1],getRoomAreaText:i[6],getLabelElement:i[7],hoveredRoom:i[10],adaptiveRoomLabelVisibleEnable:i[9]}];let o={};for(let s=0;s<n.length;s+=1)o=we(o,n[s]);return t=new au({props:o}),{c(){ee(t.$$.fragment)},m(s,r){K(t,s,r),e=!0},p(s,r){const a=r&1762?je(n,[{floorplanData:s[5],floorIndex:s[1],getRoomAreaText:s[6],getLabelElement:s[7],hoveredRoom:s[10],adaptiveRoomLabelVisibleEnable:s[9]}]):{};t.$set(a)},i(s){e||(D(t.$$.fragment,s),e=!0)},o(s){T(t.$$.fragment,s),e=!1},d(s){$(t,s)}}}function Uo(i){let t,e;const n=[{floorplanData:i[5],floorIndex:i[1],getRuleDistanceText:i[8]}];let o={};for(let s=0;s<n.length;s+=1)o=we(o,n[s]);return t=new pu({props:o}),{c(){ee(t.$$.fragment)},m(s,r){K(t,s,r),e=!0},p(s,r){const a=r&290?je(n,[{floorplanData:s[5],floorIndex:s[1],getRuleDistanceText:s[8]}]):{};t.$set(a)},i(s){e||(D(t.$$.fragment,s),e=!0)},o(s){T(t.$$.fragment,s),e=!1},d(s){$(t,s)}}}function Wu(i){let t,e,n,o,s,r,a,l,c;const u=[{floorIndex:i[1],floorplanData:i[5]}];let d={};for(let v=0;v<u.length;v+=1)d=we(d,u[v]);e=new Bu({props:d});let h=i[2]&&Xo(i);const p=[{floorplanData:i[5],floorIndex:i[1]}];let m={};for(let v=0;v<p.length;v+=1)m=we(m,p[v]);s=new ha({props:m});let g=i[3]&&Yo(i),A=i[4]&&Uo(i);return{c(){t=j("div"),ee(e.$$.fragment),n=_(),h&&h.c(),o=_(),ee(s.$$.fragment),r=_(),g&&g.c(),a=_(),A&&A.c(),b(t,"class",l=Se(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(v,w){B(v,t,w),K(e,t,null),Q(t,n),h&&h.m(t,null),Q(t,o),K(s,t,null),Q(t,r),g&&g.m(t,null),Q(t,a),A&&A.m(t,null),c=!0},p(v,[w]){const y=w&34?je(u,[{floorIndex:v[1],floorplanData:v[5]}]):{};e.$set(y),v[2]?h?(h.p(v,w),w&4&&D(h,1)):(h=Xo(v),h.c(),D(h,1),h.m(t,o)):h&&(le(),T(h,1,1,()=>{h=null}),ce());const x=w&34?je(p,[{floorplanData:v[5],floorIndex:v[1]}]):{};s.$set(x),v[3]?g?(g.p(v,w),w&8&&D(g,1)):(g=Yo(v),g.c(),D(g,1),g.m(t,a)):g&&(le(),T(g,1,1,()=>{g=null}),ce()),v[4]?A?(A.p(v,w),w&16&&D(A,1)):(A=Uo(v),A.c(),D(A,1),A.m(t,null)):A&&(le(),T(A,1,1,()=>{A=null}),ce()),(!c||w&1&&l!==(l=Se(`floorplan-plugin__floor${v[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&b(t,"class",l)},i(v){c||(D(e.$$.fragment,v),D(h),D(s.$$.fragment,v),D(g),D(A),c=!0)},o(v){T(e.$$.fragment,v),T(h),T(s.$$.fragment,v),T(g),T(A),c=!1},d(v){v&&M(t),$(e),h&&h.d(),$(s),g&&g.d(),A&&A.d()}}}function Xu(i,t,e){let{isCurrent:n}=t,{floorIndex:o}=t,{hoverEnable:s}=t,{roomLabelsEnable:r}=t,{ruleLabelsEnable:a}=t,{floorplanData:l}=t,{getRoomAreaText:c}=t,{getLabelElement:u}=t,{getRuleDistanceText:d}=t,{adaptiveRoomLabelVisibleEnable:h}=t;const p=$i(void 0);return i.$$set=m=>{"isCurrent"in m&&e(0,n=m.isCurrent),"floorIndex"in m&&e(1,o=m.floorIndex),"hoverEnable"in m&&e(2,s=m.hoverEnable),"roomLabelsEnable"in m&&e(3,r=m.roomLabelsEnable),"ruleLabelsEnable"in m&&e(4,a=m.ruleLabelsEnable),"floorplanData"in m&&e(5,l=m.floorplanData),"getRoomAreaText"in m&&e(6,c=m.getRoomAreaText),"getLabelElement"in m&&e(7,u=m.getLabelElement),"getRuleDistanceText"in m&&e(8,d=m.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in m&&e(9,h=m.adaptiveRoomLabelVisibleEnable)},[n,o,s,r,a,l,c,u,d,h,p]}class Yu extends oe{constructor(t){super(),ie(this,t,Xu,Wu,ne,{isCurrent:0,floorIndex:1,hoverEnable:2,roomLabelsEnable:3,ruleLabelsEnable:4,floorplanData:5,getRoomAreaText:6,getLabelElement:7,getRuleDistanceText:8,adaptiveRoomLabelVisibleEnable:9},Nu)}}function Uu(i){ae(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function Vo(i,t,e){const n=i.slice();return n[16]=t[e],n}function Jo(i){let t,e,n,o,s,r,a=i[9].floorDatas,l=[];for(let p=0;p<a.length;p+=1)l[p]=_o(Vo(i,a,p));const c=p=>T(l[p],1,1,()=>{l[p]=null}),u=[{panoIndex:i[3],floorplanData:i[9],lastPanoramaLongitude:i[10],cameraImageUrl:i[11]}];let d={};for(let p=0;p<u.length;p+=1)d=we(d,u[p]);n=new Sc({props:d});let h=i[6]&&Zo(i);return{c(){t=j("div");for(let p=0;p<l.length;p+=1)l[p].c();e=_(),ee(n.$$.fragment),o=_(),h&&h.c(),b(t,"class","floorplan-main svelte-86bqav")},m(p,m){B(p,t,m);for(let g=0;g<l.length;g+=1)l[g].m(t,null);Q(t,e),K(n,t,null),Q(t,o),h&&h.m(t,null),r=!0},p(p,m){if(i=p,m&62384){a=i[9].floorDatas;let A;for(A=0;A<a.length;A+=1){const v=Vo(i,a,A);l[A]?(l[A].p(v,m),D(l[A],1)):(l[A]=_o(v),l[A].c(),D(l[A],1),l[A].m(t,e))}for(le(),A=a.length;A<l.length;A+=1)c(A);ce()}const g=m&3592?je(u,[{panoIndex:i[3],floorplanData:i[9],lastPanoramaLongitude:i[10],cameraImageUrl:i[11]}]):{};n.$set(g),i[6]?h?(h.p(i,m),m&64&&D(h,1)):(h=Zo(i),h.c(),D(h,1),h.m(t,null)):h&&(le(),T(h,1,1,()=>{h=null}),ce())},i(p){if(!r){for(let m=0;m<a.length;m+=1)D(l[m]);D(n.$$.fragment,p),D(h),s||xe(()=>{s=Ot(t,Tt,{duration:i[0],easing:Jt}),s.start()}),r=!0}},o(p){l=l.filter(Boolean);for(let m=0;m<l.length;m+=1)T(l[m]);T(n.$$.fragment,p),T(h),r=!1},d(p){p&&M(t),tt(l,p),$(n),h&&h.d()}}}function _o(i){let t,e;const n=[{hoverEnable:i[5],floorplanData:i[9],getRoomAreaText:i[12],getLabelElement:i[13],getRuleDistanceText:i[14],roomLabelsEnable:i[7],ruleLabelsEnable:i[8],adaptiveRoomLabelVisibleEnable:i[15]},{floorIndex:i[16].floorIndex},{isCurrent:i[16].floorIndex===i[4]}];let o={};for(let s=0;s<n.length;s+=1)o=we(o,n[s]);return t=new Yu({props:o}),{c(){ee(t.$$.fragment)},m(s,r){K(t,s,r),e=!0},p(s,r){const a=r&62384?je(n,[r&62368&&{hoverEnable:s[5],floorplanData:s[9],getRoomAreaText:s[12],getLabelElement:s[13],getRuleDistanceText:s[14],roomLabelsEnable:s[7],ruleLabelsEnable:s[8],adaptiveRoomLabelVisibleEnable:s[15]},r&512&&{floorIndex:s[16].floorIndex},r&528&&{isCurrent:s[16].floorIndex===s[4]}]):{};t.$set(a)},i(s){e||(D(t.$$.fragment,s),e=!0)},o(s){T(t.$$.fragment,s),e=!1},d(s){$(t,s)}}}function Zo(i){let t,e;return t=new Rc({props:{floorplanData:i[9],northDesc:i[2]}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&512&&(s.floorplanData=n[9]),o&4&&(s.northDesc=n[2]),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Vu(i){let t,e,n=i[1]&&Jo(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&D(n,1)):(n=Jo(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Ju(i,t,e){let{duration:n=0}=t,{visible:o}=t,{northDesc:s}=t,{panoIndex:r}=t,{floorIndex:a}=t,{hoverEnable:l}=t,{compassEnable:c}=t,{roomLabelsEnable:u}=t,{ruleLabelsEnable:d}=t,{floorplanData:h}=t,{lastPanoramaLongitude:p}=t,{cameraImageUrl:m}=t,{getRoomAreaText:g}=t,{getLabelElement:A}=t,{getRuleDistanceText:v}=t,{adaptiveRoomLabelVisibleEnable:w}=t;return i.$$set=y=>{"duration"in y&&e(0,n=y.duration),"visible"in y&&e(1,o=y.visible),"northDesc"in y&&e(2,s=y.northDesc),"panoIndex"in y&&e(3,r=y.panoIndex),"floorIndex"in y&&e(4,a=y.floorIndex),"hoverEnable"in y&&e(5,l=y.hoverEnable),"compassEnable"in y&&e(6,c=y.compassEnable),"roomLabelsEnable"in y&&e(7,u=y.roomLabelsEnable),"ruleLabelsEnable"in y&&e(8,d=y.ruleLabelsEnable),"floorplanData"in y&&e(9,h=y.floorplanData),"lastPanoramaLongitude"in y&&e(10,p=y.lastPanoramaLongitude),"cameraImageUrl"in y&&e(11,m=y.cameraImageUrl),"getRoomAreaText"in y&&e(12,g=y.getRoomAreaText),"getLabelElement"in y&&e(13,A=y.getLabelElement),"getRuleDistanceText"in y&&e(14,v=y.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in y&&e(15,w=y.adaptiveRoomLabelVisibleEnable)},[n,o,s,r,a,l,c,u,d,h,p,m,g,A,v,w]}class eo extends oe{constructor(t){super(),ie(this,t,Ju,Vu,ne,{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},Uu)}}const _u="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAA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91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function Zu(i){return J(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(o){return J(this,null,function*(){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=yield fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s})};return yield Promise.all(i.map(e))})}function qu(i){return{id:i.id,size:i.size,name:i.name,path:i.path,roomType:i.room_type,floorType:i.floor_type,roomLabel:{position:i.room_label.position,positionInImage:i.room_label.position_in_image},observerIndexs:i.observer_indexs}}function Ku(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(qu),rules:i.rules}}function $u(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function ed(i){return{rad:i.rad,position:i.position,positionInImage:i.position_in_image,northRad:i.north_rad,roomId:i.room_id,floorIndex:i.floor_index}}function vt(i){return J(this,null,function*(){const t=yield Zu(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(Ku),o=i.computed_data.entrance?ed(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map($u)}})}function td(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:_u,width:45,height:48},a=vu(s,t),l=gu(s,e),c=Au(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function nd(i,t){return t(i),i}function ri(i,t){return nd({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function qo(i,t){const e=Math.max(...i.work.observers.map(n=>n.floorIndex));return t>e?i.model.bounding.max.y:Math.max(...i.work.observers.filter(n=>n.floorIndex===t).map(n=>n.standingPosition.y))}function to(i,t,e=mt.BOUNDING_CENTER){const n=qo(i,t),o=qo(i,t+1);return e===mt.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===mt.CEILING?o:n}function no(i,t,e,n){const o=to(i,e,n==null?void 0:n.attachedTo),s=new E.Vector3(0,o,0),r=new E.Vector3(1,o,0),a=s.clone().project(i.camera),l=r.clone().project(i.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}class ai{constructor(t,e){f(this,"five");f(this,"hooks",new qt);f(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}}class Ht extends ai{}var Fe=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(Fe||{});const pa=500,id=80;function Qi(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function ga(i,t){return J(this,null,function*(){yield new Promise((e,n)=>{i.changeMode(...t).catch(o=>n(o)),i.once("initAnimationEnded",()=>{const o=i.getCurrentState(),s=t[0];o.mode!==s&&n(new Error("mode \u4E0E\u9884\u671F\u4E0D\u7B26")),(()=>{const l=t[1];return l?Object.keys(l).every(c=>{const u=o[c];if(u===void 0)return!0;const d=l[c];return typeof u=="number"&&typeof d=="number"?Qi(u,d,2):u===d}):!0})()||n(new Error("five pose \u4E0E\u9884\u671F\u4E0D\u7B26")),e()})})})}function io(i,t){if(i.currentMode!==t.mode)return!1;const{latitude:e,longitude:n,fov:o}=t,{latitude:s,longitude:r}=i.getCurrentState(),a=i.camera.fov;return!(!Qi(e,s,2)||!Qi(n,r,2)||o!==a)}function Aa(i,t,e=!0){return J(this,null,function*(){if(io(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[u]=yield _n(ga(i,[t.mode,t,void 0,e]));if(u)throw new Error(Fe.ChangeModeError);return}const{latitude:s,longitude:r,fov:a}=o,l=Math.min(1e3,Math.max(200,Math.abs(s-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,Math.abs(a-t.fov)*10)),[c]=yield _n(i.updateCamera(t,l,e));if(c)throw new Error(Fe.UpdateCameraError)})}function Zt(i,t,e=300){const n=i.getElement();!n||(n.style.opacity=t+"",n.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(o=>n.addEventListener("transitionend",o,{once:!0})),new Promise(o=>setTimeout(o,e))]).then(()=>{n.style.transition="none"}))}function od(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function sd(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}class rd extends Ht{constructor(e,n){var a;super(e);f(this,"name","modelFloorplanPlugin");f(this,"state");f(this,"data");f(this,"showState");f(this,"showPromise");f(this,"app");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"selector");f(this,"showRejection");f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});f(this,"show",(...n)=>J(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));f(this,"hide",(...n)=>J(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!io(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=no(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,Fe.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});f(this,"_show",e=>J(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Fe.ModelNotLoaded);if(!this.data)throw new Error(Fe.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=N(N({},n),e),s=()=>J(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=h=>{a=!0,l=h};const[c]=yield _n(Aa(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Fe.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,d=o.immediately?0:pa;Zt(this.five,u,d),this.render(d)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,Fe.BreakOffByHide),this.showPromise=void 0;const o=N(N({},{userAction:!0,isAutoHide:!1}),e);Zt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFiveInteriaPan",(e,n)=>{if(!n||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();o.mode==="Floorplan"&&(this.state.visible||sd(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});f(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();od(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});f(this,"onFiveWantsGesture",(e,n)=>{if(!!this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});f(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:id/((a=n==null?void 0:n.scale)!=null?a:1)};const o={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:At,attachedTo:mt.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},s=n?ri(n,["selector","scale"]):{},r=N(N({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return J(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield vt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}this.render()}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return J(this,null,function*(){return yield vt(e.data)})}updateState(e,n){const o=this.state,s=e.config?N(N({},o.config),e.config):o.config;this.state=he(N(N({},this.state),e),{config:s}),!qe(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=he(N({},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 eo({target:this.container,intro:!0,props:n})}}const ad=(i,t)=>new rd(i,t);function ld(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function cd(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}class ud extends Ht{constructor(e,n){super(e);f(this,"name","modelFloorplanPlugin");f(this,"state");f(this,"data");f(this,"showState");f(this,"showPromise");f(this,"app");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"selector");f(this,"showRejection");f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});f(this,"show",(...n)=>J(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));f(this,"hide",(...n)=>J(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!io(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=no(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,Fe.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});f(this,"_show",e=>J(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Fe.ModelNotLoaded);if(!this.data)throw new Error(Fe.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=N(N({},n),e),s=()=>J(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=h=>{a=!0,l=h};const[c]=yield _n(Aa(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Fe.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,d=o.immediately?0:pa;Zt(this.five,u,d),this.render(d)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,Fe.BreakOffByHide),this.showPromise=void 0;const o=N(N({},{userAction:!0,isAutoHide:!1}),e);Zt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();this.updatePosition(),this.updateSize(),ld(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});f(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1){if(n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1;if(n&&!this.state.visible){if(this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();return o.mode!==this.showState.mode||this.state.visible?void 0:(cd(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2,fov:90};const o={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,cameraImageUrl:At,attachedTo:mt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?ri(n,["selector","scale"]):{},r=N(N({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return J(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield vt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}updatePosition(){var a;const e=to(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}formatData(e){return J(this,null,function*(){return yield vt(e.data)})}updateState(e,n){const o=this.state,s=e.config?N(N({},o.config),e.config):o.config;this.state=he(N(N({},this.state),e),{config:s}),!qe(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=he(N({},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 eo({target:this.container,intro:!0,props:n})}}const dd=(i,t)=>new ud(i,t);class hd extends Ht{constructor(e,n){super(e);f(this,"name","topviewFloorplanPlugin");f(this,"state");f(this,"data");f(this,"app");f(this,"selector");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper||this.five.getCurrentState().mode!=="Topview")return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=no(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});f(this,"_disable",e=>{var o,s;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,(s=this.container)==null||s.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:n})});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});f(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{!this.state.visible||(this.updatePosition(),this.updateSize())});f(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});f(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});f(this,"onFiveInitAnimationEnded",(...[,,e])=>{const{mode:n}=this.five.getCurrentState();n==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},e),this._show({userAction:e}))});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"));const o={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,cameraImageUrl:At,attachedTo:mt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?ri(n,["selector","scale"]):{},r=N(N({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return J(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield vt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}updatePosition(){var a;const e=to(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return J(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 J(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return J(this,null,function*(){return yield vt(e.data)})}_show(e){return J(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 ga(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const o=500,s=this.state.config.modelOpacity;Zt(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return J(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;Zt(this.five,o,s),this.render()})}_enable(e){const{userAction:n}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}updateState(e,n){const o=this.state,s=e.config?N(N({},o.config),e.config):o.config;this.state=he(N(N({},this.state),e),{config:s}),!qe(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=he(N({},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 eo({target:this.container,intro:!0,props:n})}}const fd=(i,t)=>new hd(i,t);function oo(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function md(i){ae(i,"svelte-1nqrlxd",".plugin-radar__camera-wrapper.svelte-1nqrlxd{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1nqrlxd{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1nqrlxd{position:absolute;left:-0.9375rem;top:-0.9375rem;width:1.0625rem;height:1.0625rem;transform-origin:0.9375rem 0.9375rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function pd(i){let t,e,n;return{c(){t=j("div"),e=j("div"),n=j("div"),b(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),R(n,"background-image","url("+(i[0]||At)+")"),R(n,"transform",i[1]),b(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),R(e,"transform",i[2]),b(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(o,s){B(o,t,s),Q(t,e),Q(e,n)},p(o,[s]){s&1&&R(n,"background-image","url("+(o[0]||At)+")"),s&2&&R(n,"transform",o[1]),s&4&&R(e,"transform",o[2])},i:te,o:te,d(o){o&&M(t)}}}function gd(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function Ad(i,t,e){let n,o,{five:s}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=s.getCurrentState().panoIndex,u=s.getCurrentState().longitude;function d(m,g){const A=m.bounding,v=m.observers[g];if(!v)return"";const w=(A.max.x-A.min.x)*r,y=(A.max.y-A.min.y)*r,x=Math.floor(v.positionInImage.x*w),L=Math.floor(v.positionInImage.y*y);return`translate(${x}px, ${L}px)`}function h(m){e(6,c=m)}const p=oo(m=>{e(7,u=m.longitude)},1e3/60);return Ye(()=>(s.on("panoWillArrive",h),s.on("cameraDirectionUpdate",p),function(){s.off("panoWillArrive",h),s.off("cameraDirectionUpdate",p)})),i.$$set=m=>{"five"in m&&e(3,s=m.five),"pxmm"in m&&e(4,r=m.pxmm),"floorplanData"in m&&e(5,a=m.floorplanData),"cameraImageUrl"in m&&e(0,l=m.cameraImageUrl)},i.$$.update=()=>{i.$$.dirty&96&&e(2,n=d(a,c)),i.$$.dirty&128&&e(1,o=gd(u))},[l,o,n,s,r,a,c,u]}class vd extends oe{constructor(t){super(),ie(this,t,Ad,pd,ne,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},md)}}function bd(i){ae(i,"svelte-1i87fz7",".plugin-pano-floorplan__extra-objects.svelte-1i87fz7{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-1i87fz7{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-1i87fz7{transform:translate(-50%, -50%)}")}function Ko(i,t,e){const n=i.slice();return n[1]=t[e],n}function $o(i,t){let e,n,o=`${t[1].icon.width/16}rem`,s=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:i,first:null,c(){e=j("div"),n=j("div"),r=_(),b(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),R(n,"background-image",`url(${t[1].icon.url})`),R(n,"width",o),R(n,"height",s),b(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),R(e,"top",a),R(e,"left",l),this.first=e},m(c,u){B(c,e,u),Q(e,n),Q(e,r)},p(c,u){t=c,u&1&&R(n,"background-image",`url(${t[1].icon.url})`),u&1&&o!==(o=`${t[1].icon.width/16}rem`)&&R(n,"width",o),u&1&&s!==(s=`${t[1].icon.height/16}rem`)&&R(n,"height",s),u&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&R(e,"top",a),u&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&R(e,"left",l)},d(c){c&&M(e)}}}function yd(i){let t,e=[],n=new Map,o=i[0];const s=r=>r[1].id;for(let r=0;r<o.length;r+=1){let a=Ko(i,o,r),l=s(a);n.set(l,e[r]=$o(l,a))}return{c(){t=j("div");for(let r=0;r<e.length;r+=1)e[r].c();b(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){B(r,t,a);for(let l=0;l<e.length;l+=1)e[l].m(t,null)},p(r,[a]){a&1&&(o=r[0],e=Ue(e,a,s,1,r,o,n,t,ua,$o,null,Ko))},i:te,o:te,d(r){r&&M(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function wd(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class Cd extends oe{constructor(t){super(),ie(this,t,wd,yd,ne,{extraObjects:0},bd)}}function es(i){let t,e;const n=[{five:i[0],pxmm:i[1],floorIndex:i[2],floorplanData:i[4],onRoomHeightClick:i[6]}];let o={};for(let s=0;s<n.length;s+=1)o=we(o,n[s]);return t=new ma({props:o}),{c(){ee(t.$$.fragment)},m(s,r){K(t,s,r),e=!0},p(s,r){const a=r&87?je(n,[{five:s[0],pxmm:s[1],floorIndex:s[2],floorplanData:s[4],onRoomHeightClick:s[6]}]):{};t.$set(a)},i(s){e||(D(t.$$.fragment,s),e=!0)},o(s){T(t.$$.fragment,s),e=!1},d(s){$(t,s)}}}function Ed(i){let t,e,n,o,s,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let u=0;u<a.length;u+=1)l=we(l,a[u]);t=new ha({props:l}),n=new Cd({props:{extraObjects:i[5]}});let c=i[3]&&es(i);return{c(){ee(t.$$.fragment),e=_(),ee(n.$$.fragment),o=_(),c&&c.c(),s=fe()},m(u,d){K(t,u,d),B(u,e,d),K(n,u,d),B(u,o,d),c&&c.m(u,d),B(u,s,d),r=!0},p(u,[d]){const h=d&20?je(a,[{floorIndex:u[2],floorplanData:u[4]}]):{};t.$set(h);const p={};d&32&&(p.extraObjects=u[5]),n.$set(p),u[3]?c?(c.p(u,d),d&8&&D(c,1)):(c=es(u),c.c(),D(c,1),c.m(s.parentNode,s)):c&&(le(),T(c,1,1,()=>{c=null}),ce())},i(u){r||(D(t.$$.fragment,u),D(n.$$.fragment,u),D(c),r=!0)},o(u){T(t.$$.fragment,u),T(n.$$.fragment,u),T(c),r=!1},d(u){$(t,u),u&&M(e),$(n,u),u&&M(o),c&&c.d(u),u&&M(s)}}}function Pd(i,t,e){let n,{five:o}=t,{pxmm:s}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t;const u=void 0;return i.$$set=d=>{"five"in d&&e(0,o=d.five),"pxmm"in d&&e(1,s=d.pxmm),"floorIndex"in d&&e(2,r=d.floorIndex),"hoverEnable"in d&&e(3,a=d.hoverEnable),"floorplanData"in d&&e(4,l=d.floorplanData),"extraObjects"in d&&e(7,c=d.extraObjects)},i.$$.update=()=>{i.$$.dirty&132&&e(5,n=c==null?void 0:c.filter(d=>d.floorIndex===r))},[o,s,r,a,l,n,u,c]}class Id extends oe{constructor(t){super(),ie(this,t,Pd,Ed,ne,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:7})}}function xd(i){ae(i,"svelte-1mvqyqq",".plugin-floorplan-radar.svelte-1mvqyqq{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-1mvqyqq{position:relative}")}function ts(i){let t,e,n,o=i[6]!==0&&ns(i);return{c(){t=j("div"),o&&o.c(),b(t,"class","plugin-floorplan-radar svelte-1mvqyqq"),xe(()=>i[12].call(t))},m(s,r){B(s,t,r),o&&o.m(t,null),e=bt(t,i[12].bind(t)),n=!0},p(s,r){s[6]!==0?o?(o.p(s,r),r&64&&D(o,1)):(o=ns(s),o.c(),D(o,1),o.m(t,null)):o&&(le(),T(o,1,1,()=>{o=null}),ce())},i(s){n||(D(o),n=!0)},o(s){T(o),n=!1},d(s){s&&M(t),o&&o.d(),e()}}}function ns(i){let t,e,n,o,s=`${i[8]}px`,r=`${i[11]}px`,a;const l=[{five:i[0],pxmm:i[9],floorIndex:i[10],floorplanData:i[3],hoverEnable:i[2],extraObjects:i[5]}];let c={};for(let h=0;h<l.length;h+=1)c=we(c,l[h]);e=new Id({props:c});const u=[{pxmm:i[9],five:i[0],floorplanData:i[3],cameraImageUrl:i[4]}];let d={};for(let h=0;h<u.length;h+=1)d=we(d,u[h]);return o=new vd({props:d}),{c(){t=j("div"),ee(e.$$.fragment),n=_(),ee(o.$$.fragment),b(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),R(t,"width",s),R(t,"height",r)},m(h,p){B(h,t,p),K(e,t,null),Q(t,n),K(o,t,null),a=!0},p(h,p){const m=p&1581?je(l,[{five:h[0],pxmm:h[9],floorIndex:h[10],floorplanData:h[3],hoverEnable:h[2],extraObjects:h[5]}]):{};e.$set(m);const g=p&537?je(u,[{pxmm:h[9],five:h[0],floorplanData:h[3],cameraImageUrl:h[4]}]):{};o.$set(g),p&256&&s!==(s=`${h[8]}px`)&&R(t,"width",s),p&2048&&r!==(r=`${h[11]}px`)&&R(t,"height",r)},i(h){a||(D(e.$$.fragment,h),D(o.$$.fragment,h),a=!0)},o(h){T(e.$$.fragment,h),T(o.$$.fragment,h),a=!1},d(h){h&&M(t),$(e),$(o)}}}function kd(i){let t,e,n=i[1]&&ts(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&D(n,1)):(n=ts(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Dd(i,t,e){var v,w;let{five:n}=t,{visible:o}=t,{hoverEnable:s}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,c=0,u=(w=(v=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:v.floorIndex)!=null?w:0,d=0,h=0,p=0,m=0;function g(y){e(10,u=n.work.observers[y].floorIndex)}Ye(()=>(n.on("panoArrived",g),()=>{n.off("panoArrived",g)}));function A(){d=this.clientWidth,h=this.clientHeight,e(6,d),e(7,h)}return i.$$set=y=>{"five"in y&&e(0,n=y.five),"visible"in y&&e(1,o=y.visible),"hoverEnable"in y&&e(2,s=y.hoverEnable),"floorplanData"in y&&e(3,r=y.floorplanData),"cameraImageUrl"in y&&e(4,a=y.cameraImageUrl),"extraObjects"in y&&e(5,l=y.extraObjects)},i.$$.update=()=>{if(i.$$.dirty&456){const y=Math.min(d,h),{max:x,min:L}=r.bounding,C=x.x-L.x,S=x.y-L.y,k=function(){return C>S?[y,y/C*S]:[y/S*C,y]}();e(8,p=k[0]),e(11,m=k[1]),e(9,c=p/C)}},[n,o,s,r,a,l,d,h,p,c,u,m,A]}class Ld extends oe{constructor(t){super(),ie(this,t,Dd,kd,ne,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5},xd)}}class Sd extends Ht{constructor(e,n){super(e);f(this,"name","panoFloorplanRadarPlugin");f(this,"state");f(this,"data");f(this,"app");f(this,"wrapperSelector","");f(this,"wrapper",null);f(this,"disposed",!1);f(this,"extraObjects",[]);f(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});f(this,"_disable",e=>{var o;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:n})});this.five=e;const o={hoverEnable:!1,cameraImageUrl:At},s=n!=null&&n.configs?n.configs:{},r=N(N({},o),s);this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}load(e,n,o=!0){return J(this,null,function*(){function s(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=s(r)?r.data:r,l=this.data;this.data=yield vt(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,o),this.render()})}show(){return J(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 J(this,arguments,function*(e={}){if(!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,n=!0){this.setState({config:e},{userAction:n}),this.render()}setExtraObjectsWith3DPositions(e){!this.data||(this.extraObjects=td(e,this.five,this.data),this.render())}formatData(e){return J(this,null,function*(){return yield vt(e.data)})}_enable(e){const{userAction:n}=e;this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}_show(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("show",{userAction:n}),this.render()}_hide(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n}),this.render()}updateState(e,n){const o=this.state;this.state=N(N({},this.state),e),!qe(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const n=document.querySelector(this.wrapperSelector);this.wrapper=n}if(!this.data||!this.wrapper)return;const e=he(N({},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 Ld({target:this.wrapper,props:e})}}const zd=(i,t)=>new Sd(i,t),Md=[{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"}],Td=[{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"}],Bd=[{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"}],bi=(i,t,e)=>{const n=new E.Matrix4,o=new E.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},jd=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[o,s,r]=e;o&&i.applyMatrix4(bi(o,0,0)),s&&i.applyMatrix4(bi(0,s,0)),r&&i.applyMatrix4(bi(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function va(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s=N({map:o.material.map||{}},t);o.material=new F.MeshBasicMaterial(s),o.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const Qd=(i,t)=>{var u;const e=t.fbx_url||"//vrlab-static.ljcdn.com/release/web/v3/dipan3/dipan.FBX",n=(u=t.north_rad)!=null?u:void 0,o={},s=d=>J(exports,null,function*(){var U;const h=(d==null?void 0:d.fbx_url)||e,p=(U=d==null?void 0:d.north_rad)!=null?U: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 m=i.model.bounding,g=m.max.x-m.min.x,A=m.max.z-m.min.z,v=Math.max(g,A),y=yield new Hr.FBXLoader().loadAsync(h);va(y,{transparent:!0,side:E.DoubleSide,blending:E.AdditiveBlending});const x=[0,p-Math.PI/2,0],{model:{bounding:{max:{x:L,z:C},min:{x:S,y:k,z:G}}}}=i;o.yBase=k;const O={x:(L+S)/2,y:k-1.6,z:(C+G)/2},W=.0045*v;return jd(y,{position:O,rotation:x,scale:W}),o.object=y,!0}),r=({latitude:d})=>{if(!o.object)return;const h=a(d);h&&(o.object.position.y=h)},a=d=>{if(o.yBase===void 0)return;const h=.6;if(d>=Math.PI/4)return o.yBase-(h+1.6);const p=d*(4/Math.PI);return o.yBase-(h*p+1.6)};return{load:s,disable:()=>{!o.object||(i.scene.remove(o.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!o.object)return;const d=a(i.getPose().latitude);d&&(o.object.position.y=d),i.scene.add(o.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function Rd(i,t){var c,u,d,h,p;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(u=t==null?void 0:t.fontSize)!=null?u:e*(35/256)*1.2,o=(d=t==null?void 0:t.backgroundColor)!=null?d:"rgba(0,0,0,0)",s=(h=t==null?void 0:t.fontColor)!=null?h:"#fff",r=(p=t==null?void 0:t.textAlign)!=null?p:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=o,l.fillRect(0,0,e,e),l.font=`${n}px "\u5FAE\u8F6F\u96C5\u9ED1"`,l.textAlign=r,l.fillStyle=s,l.fillText(i,e/2,e*.7),new F.CanvasTexture(a)}const Od=({x:i,y:t,z:e})=>new F.Vector3(i,t,e),Hd=(i,t)=>{var g,A,v;const e={},n=(g=t.animationEnabled)!=null?g:!0,o=(A=t.position)!=null?A:void 0,s=(v=t.rad)!=null?v:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=w=>J(exports,null,function*(){var O,W,U,P,I,z,H,X;const y=(O=w==null?void 0:w.position)!=null?O:o;if(!y)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const x=Od(y),L=(W=w==null?void 0:w.rad)!=null?W:s,C=(U=w==null?void 0:w.fbx_url)!=null?U:r;if(e.rad=L,L===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${L}`));const S=yield new Hr.FBXLoader().loadAsync(C);S.position.copy(x),S.rotation.z=L,S.scale.set(.8,.8,.8),va(S,{transparent:!0,side:E.DoubleSide});const k=(H=(z=(I=(P=S.children)==null?void 0:P[0])==null?void 0:I.children)==null?void 0:z[3])==null?void 0:H.clone();if(!k)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${k}`));const G=(X=t.name)!=null?X:"\u5165\u6237\u95E8";return k.material=new F.MeshBasicMaterial({transparent:!0,map:Rd(G)}),k.renderOrder=3,S.children[0].add(k),e.object=S,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const w=1,y=new F.AnimationMixer(e.object);a.push(y);const x=y.clipAction(e.object.animations[0]);x.timeScale=w;let L;const C=()=>{let O=0,W=0;const U=1e3/30,P=I=>{O=requestAnimationFrame(P);const z=I-W;z<U||(W=I,a.forEach(H=>H.update(z/1e3)),i.needsRender=!0)};return O=requestAnimationFrame(P),()=>{cancelAnimationFrame(O)}},G={play:()=>{L||(x.play(),L=C(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{x.stop(),L==null||L(),L=void 0}};e.animation=G},u=w=>{var x;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((x=w==null?void 0:w.animationEnable)!=null?x:n)&&(e.animation||c(),e.animation.play()),i.scene.add(e.object),i.needsRender=!0},d=()=>{!e.object||(e.animation&&e.animation.stop(),i.scene.remove(e.object),i.needsRender=!0)},h=w=>w==="Floorplan"?u():d();return{load:l,enable:w=>(e.enabled||(e.enabled=!0,h(i.currentMode),i.on("modeChange",h),u(w)),!0),disable:()=>(e.enabled&&(e.enabled=!1,d(),i.off("modeChange",h)),!0)}};class so extends dn.default.Tween{constructor(){super(...arguments);f(this,"disposeMethods",[]);f(this,"animationFrameDisposer");f(this,"onDispose",e=>(this.disposeMethods.push(e),this));f(this,"play",()=>(this.start(0),this.animationFrameDisposer=ci(e=>this.update(e)),this));f(this,"dispose",()=>{var e;this.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this.disposeMethods.forEach(n=>n()),this.disposeMethods=[],dn.default.remove(this)})}}function ba(i,t=dn.default.Easing.Linear.None){const e=new so({progress:0}).to({progress:1});return i!==void 0&&e.duration(i),t!==void 0&&e.easing(t),e}const pn=window.requestAnimationFrame||(i=>setTimeout(i,16)),Fd=window.cancelAnimationFrame||clearTimeout;function li(i,t=0){t<=0?pn(i):pn(()=>li(i,t-1))}function ci(i,t=60){let e=-1,n=0,o=-1;const s=1e3/t;function r(a){o===-1&&(o=a),e=pn(r),!(a-n<s)&&(n=a,i&&i(a-o))}return e=pn(r),function(){Fd(e)}}function Gd(){const i=Date.now();return new Promise(t=>{pn(()=>{t(Date.now()-i)})})}const Nd=ni.Easing;function Wd(i,t,e,n=Nd.Linear.None){const o=new ni.Tween(i).to(t,e).easing(n);li(()=>o.start(0));const s=ci(a=>{o.update(a)===!1&&s()}),r=[];return o.onDestroy=a=>(r.push(a),o),o.destroy=function(){this.stop(),Object.assign(o,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();s()},o}function Xd(i,t){return Wd({progress:0},{progress:1},i,t)}var ya=(i=>(i.Move="Move",i.Rotate="Rotate",i))(ya||{}),Ze=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(Ze||{});const Fn=Math.PI*2;function is(i){return(i%Fn+Fn)%Fn}function os(i){return i%Fn}function yi(i,t,e){return i+(t-i)*e}const Ri=(i,t,e)=>{const n=Math.PI,o=n*2;return i=is(i),t=is(t),e===Ze.Anticlockwise&&i<t&&(i+=o),e===Ze.Clockwise&&t<i&&(t+=o),e===Ze.Loop&&t-i>n?Ri(i,t,Ze.Anticlockwise):e===Ze.Loop&&i-t>n?Ri(i,t,Ze.Clockwise):{from:i,to:t}},Yd=i=>{const t={},e=(l,c,...u)=>J(exports,[l,c,...u],function*(s,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),s.mode&&s.mode!==i.currentMode&&(yield i.changeMode(s.mode)),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(yield i.preloadPano(s.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:yield new Promise((d,h)=>{const p=s.panoIndex!==void 0?s.panoIndex:i.panoIndex;p!==void 0?i.moveToPano(p,Object.assign({duration:r,moveEndCallback:()=>d(!0),moveCancelCallback:()=>h(!1)},s)):h(!1)})}),n=s=>{const r=i.state,a=os(r.latitude),l=os(s.latitude),{from:c,to:u}=Ri(r.longitude,s.longitude,s.rotation||Ze.Loop),d=r.fov,h=s.fov;return{from:{latitude:a,longitude:c,fov:d},to:{latitude:l,longitude:u,fov:h}}};return{move:e,rotate:(l,c,...u)=>J(exports,[l,c,...u],function*(s,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),i.currentMode!==be.Five.Mode.Panorama&&(yield i.changeMode(be.Five.Mode.Panorama)),s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(a.preload&&(yield i.preloadPano(s.panoIndex)),yield new Promise((p,m)=>{if(!s.panoIndex){p(!0);return}i.moveToPano(s.panoIndex,{moveEndCallback:()=>p(!0),moveCancelCallback:()=>m(!1)})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:d,to:h}=n(s);return yield new Promise(p=>{const m=({progress:y})=>{const x={};x.longitude=yi(d.longitude,h.longitude,y),x.latitude=yi(d.latitude,h.latitude,y),x.fov=yi(d.fov,h.fov,y),i.setState(x,!0)},g=()=>{p(!0)},A=()=>{p(!1)},v=s.rotateSpeed?Math.ceil(Math.abs(h.longitude-d.longitude)/s.rotateSpeed*1e3):r,w=Xd(v,ni.Easing.Linear.None).onUpdate(m).onComplete(g).onDestroy(A);s.rotation===Ze.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)},r)})})}};function ss(i,t){return i.x===t.x&&i.y===t.y}function wa(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function Kn(i,t){return(t.y-i.y)/(t.x-i.x)}function Ca(i,t,e){const n=Kn(i[1],i[0]),o=Kn(t[1],t[0]);if(isNaN(n)||isNaN(o)||wa(n,o))return!1;if(In(i[0],t))return i[0];if(In(i[1],t))return i[1];if(In(t[0],i))return t[0];if(In(t[1],i))return t[1];if(e&&!Ud(i,t))return!1;const s=i[0],r=t[0];if(Math.abs(n)===1/0)return{x:s.x,y:t[1].y-(t[1].x-s.x)*o};if(Math.abs(o)===1/0)return{x:r.x,y:i[1].y-(i[1].x-r.x)*n};const a=(r.y-s.y+n*s.x-o*r.x)/(n-o),l=n*a-n*s.x+s.y;return{x:a,y:l}}function In(i,t){return ss(i,t[0])||ss(i,t[1])?!0:(t[0].x-i.x)*(i.x-t[1].x)>=0&&(t[0].y-i.y)*(i.y-t[1].y)>=0&&wa(Kn(t[0],i),Kn(i,t[1]))}function xn(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function Ud(i,t){return Math.max(i[0].x,i[1].x)>=Math.min(t[0].x,t[1].x)&&Math.max(t[0].x,t[1].x)>=Math.min(i[0].x,i[1].x)&&Math.max(i[0].y,i[1].y)>=Math.min(t[0].y,t[1].y)&&xn(t[0],i[1],i[0])*xn(i[1],t[1],i[0])>0&&xn(i[0],t[1],t[0])*xn(t[1],i[1],t[0])>0?1:0}function Ea(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>Ea(i,t-1))}const Vd=`<style type="text/css">
|
|
115
|
+
`;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class Yc extends oe{constructor(t){super(),ie(this,t,Xc,Wc,ne,{content:0},Nc)}}function Uc(i){ae(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function Vc(i){let t,e;return t=new Gc({props:{url:i[1].url}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.url=n[1].url),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Jc(i){let t,e;return t=new Yc({props:{content:i[0]}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.content=n[0]),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function _c(i){let t,e,n,o;const s=[Jc,Vc],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(i))&&(n=r[e]=s[e](i)),{c(){t=j("div"),n&&n.c(),b(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){B(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let u=e;e=a(l),e===u?~e&&r[e].p(l,c):(n&&(le(),T(r[u],1,1,()=>{r[u]=null}),ce()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),D(n,1),n.m(t,null)):n=null)},i(l){o||(D(n),o=!0)},o(l){T(n),o=!1},d(l){l&&M(t),~e&&r[e].d()}}}function Zc(i,t,e){let n,o,{floorIndex:s}=t,{floorplanData:r}=t;return i.$$set=a=>{"floorIndex"in a&&e(2,s=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},i.$$.update=()=>{var a,l;i.$$.dirty&12&&e(1,n=r.outlines[s]),i.$$.dirty&12&&e(0,o=(l=(a=r.outlines)==null?void 0:a[s])==null?void 0:l.svgContent)},[o,n,s,r]}class ha extends oe{constructor(t){super(),ie(this,t,Zc,_c,ne,{floorIndex:2,floorplanData:3},Uc)}}function qc(i){ae(i,"svelte-12pzct5",".floorplan-plugin__room-label-item.svelte-12pzct5{position:absolute;display:flex;flex-flow:column;align-items:center;line-height:1;color:#fff;transform:translate(-50%, -50%);white-space:nowrap;will-change:opacity;transition:opacity 300ms}.floorplan-plugin__room-size.svelte-12pzct5{opacity:0.45}")}function Kc(i){let t,e=i[4].outerHTML+"",n;return{c(){t=new Yn(!1),n=fe(),t.a=n},m(o,s){t.m(e,o,s),B(o,n,s)},p(o,s){s&16&&e!==(e=o[4].outerHTML+"")&&t.p(e)},d(o){o&&M(n),o&&t.d()}}}function $c(i){let t,e=i[0].name+"",n,o,s,r;return{c(){t=j("span"),n=ke(e),o=_(),s=j("span"),r=ke(i[5]),b(t,"class","floorplan-plugin__room-name"),b(s,"class","floorplan-plugin__room-size svelte-12pzct5")},m(a,l){B(a,t,l),Q(t,n),B(a,o,l),B(a,s,l),Q(s,r)},p(a,l){l&1&&e!==(e=a[0].name+"")&&Te(n,e),l&32&&Te(r,a[5])},d(a){a&&M(t),a&&M(o),a&&M(s)}}}function eu(i){let t;function e(s,r){if(s[1]===void 0)return $c;if(s[4])return Kc}let n=e(i),o=n&&n(i);return{c(){t=j("div"),o&&o.c(),b(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),R(t,"left",i[6]),R(t,"top",i[7]),R(t,"font-size",i[8]),R(t,"opacity",i[3]?"1":"0")},m(s,r){B(s,t,r),o&&o.m(t,null),i[16](t)},p(s,[r]){n===(n=e(s))&&o?o.p(s,r):(o&&o.d(1),o=n&&n(s),o&&(o.c(),o.m(t,null))),r&8&&R(t,"opacity",s[3]?"1":"0")},i:te,o:te,d(s){s&&M(t),o&&o.d(),i[16](null)}}}function tu(i,t){const e=i[0],n=i[1];let o=!1;for(let s=0,r=t.length-1;s<t.length;r=s++){const a=t[s][0],l=t[s][1],c=t[r][0],u=t[r][1];l>n!=u>n&&e<(c-a)*(n-l)/(u-l)+a&&(o=!o)}return o}function nu(i,t,e){let n,o,s,r,{pxmm:a}=t,{room:l}=t,{hoveredRoom:c}=t,{getRoomAreaText:u}=t,{getLabelElement:d}=t,{adaptiveRoomLabelVisibleEnable:h}=t;function p(k,G){if(G.width===0||G.height===0)return()=>!1;const O=k.path.map(({x:Z,y:Y})=>[Z,Y]),W=k.roomLabel.position,{x:U,y:P}=W,{width:I,height:z}=G,H=I/2,X=z/2;return function(Y){const V=U*Y,ue=P*Y,de=O.map(([Ce,De])=>[Ce*Y,De*Y]);return[[V+H,ue-X],[V-H,ue-X],[V-H,ue+X],[V+H,ue+X]].every(Ce=>tu(Ce,de))}}const m=document.body.clientWidth,g=document.body.clientHeight,A=l.roomLabel,v=A.positionInImage.x*100+"%",w=A.positionInImage.y*100+"%",y=(m<500||g<500?10:14)/16+"rem";let x=!1,L,C;c.subscribe(function(G){e(13,x=!!G&&G.id===l.id)}),Ye(()=>{const k=L==null?void 0:L.getClientRects()[0];e(14,C={width:k.width,height:k.height})});function S(k){Me[k?"unshift":"push"](()=>{L=k,e(2,L)})}return i.$$set=k=>{"pxmm"in k&&e(9,a=k.pxmm),"room"in k&&e(0,l=k.room),"hoveredRoom"in k&&e(10,c=k.hoveredRoom),"getRoomAreaText"in k&&e(11,u=k.getRoomAreaText),"getLabelElement"in k&&e(1,d=k.getLabelElement),"adaptiveRoomLabelVisibleEnable"in k&&e(12,h=k.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&2049&&e(5,n=l.size?u(l.size):""),i.$$.dirty&16385&&e(15,o=C?p(l,C):void 0),i.$$.dirty&3&&e(4,s=d==null?void 0:d(l)),i.$$.dirty&45568&&e(3,r=h?x?!0:!!(o!=null&&o(a)):!0)},[l,d,L,r,s,n,v,w,y,a,c,u,h,x,C,o,S]}class iu extends oe{constructor(t){super(),ie(this,t,nu,eu,ne,{pxmm:9,room:0,hoveredRoom:10,getRoomAreaText:11,getLabelElement:1,adaptiveRoomLabelVisibleEnable:12},qc)}}function ou(i){ae(i,"svelte-13xux0b",".floorplan-plugin__room-labels.svelte-13xux0b{width:100%;height:100%;position:absolute;left:0;top:0;z-index:20;pointer-events:none}")}function Lo(i,t,e){const n=i.slice();return n[10]=t[e],n}function So(i){let t,e=[],n=new Map,o,s,r=i[6];const a=l=>l[10].id;for(let l=0;l<r.length;l+=1){let c=Lo(i,r,l),u=a(c);n.set(u,e[l]=zo(u,c))}return{c(){t=j("div");for(let l=0;l<e.length;l+=1)e[l].c();b(t,"class","floorplan-plugin__room-labels svelte-13xux0b"),xe(()=>i[9].call(t))},m(l,c){B(l,t,c);for(let u=0;u<e.length;u+=1)e[u].m(t,null);o=bt(t,i[9].bind(t)),s=!0},p(l,c){c&111&&(r=l[6],le(),e=Ue(e,c,a,1,l,r,n,t,at,zo,null,Lo),ce())},i(l){if(!s){for(let c=0;c<r.length;c+=1)D(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)T(e[c]);s=!1},d(l){l&&M(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}function zo(i,t){let e,n,o;const s=[{pxmm:t[5],room:t[10],getLabelElement:t[2],getRoomAreaText:t[1],hoveredRoom:t[0],adaptiveRoomLabelVisibleEnable:t[3]}];let r={};for(let a=0;a<s.length;a+=1)r=we(r,s[a]);return n=new iu({props:r}),{key:i,first:null,c(){e=fe(),ee(n.$$.fragment),this.first=e},m(a,l){B(a,e,l),K(n,a,l),o=!0},p(a,l){t=a;const c=l&111?Be(s,[{pxmm:t[5],room:t[10],getLabelElement:t[2],getRoomAreaText:t[1],hoveredRoom:t[0],adaptiveRoomLabelVisibleEnable:t[3]}]):{};n.$set(c)},i(a){o||(D(n.$$.fragment,a),o=!0)},o(a){T(n.$$.fragment,a),o=!1},d(a){a&&M(e),$(n,a)}}}function su(i){let t,e,n=i[6]&&So(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[6]?n?(n.p(o,s),s&64&&D(n,1)):(n=So(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function ru(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t,{hoveredRoom:r}=t,{getRoomAreaText:a}=t,{getLabelElement:l}=t,{adaptiveRoomLabelVisibleEnable:c}=t,u=0,d=0;function h(){u=this.clientWidth,e(4,u)}return i.$$set=p=>{"floorIndex"in p&&e(7,o=p.floorIndex),"floorplanData"in p&&e(8,s=p.floorplanData),"hoveredRoom"in p&&e(0,r=p.hoveredRoom),"getRoomAreaText"in p&&e(1,a=p.getRoomAreaText),"getLabelElement"in p&&e(2,l=p.getLabelElement),"adaptiveRoomLabelVisibleEnable"in p&&e(3,c=p.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&384&&e(6,n=s.floorDatas[o].rooms),i.$$.dirty&272){const{max:p,min:m}=s.bounding,g=p.x-m.x;e(5,d=u/g)}},[r,a,l,c,u,d,n,o,s,h]}class au extends oe{constructor(t){super(),ie(this,t,ru,su,ne,{floorIndex:7,floorplanData:8,hoveredRoom:0,getRoomAreaText:1,getLabelElement:2,adaptiveRoomLabelVisibleEnable:3},ou)}}function lu(i){ae(i,"svelte-djlmk4",".floorplan-plugin__rule-labels.svelte-djlmk4.svelte-djlmk4{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-djlmk4.svelte-djlmk4{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4.svelte-djlmk4{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4.svelte-djlmk4{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4.svelte-djlmk4{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-djlmk4.svelte-djlmk4{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale-wrapper.svelte-djlmk4{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-djlmk4.svelte-djlmk4{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale.svelte-djlmk4{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute}.floorplan-plugin__rule-labels--top.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-djlmk4.svelte-djlmk4{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-text-item.svelte-djlmk4{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-djlmk4.svelte-djlmk4{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}")}function Mo(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function To(i,t,e){const n=i.slice();return n[14]=t[e],n}function Bo(i){let t;return{c(){t=j("div"),b(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),R(t,"left",i[14].left*100+"%"),R(t,"bottom",i[14].bottom*100+"%")},m(e,n){B(e,t,n)},p:te,d(e){e&&M(t)}}}function jo(i,t){let e,n,o=t[1](t[11].distance)+"",s,r;return{key:i,first:null,c(){e=j("div"),n=j("div"),s=ke(o),r=_(),b(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),q(n,"is-row",t[2]),b(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),R(e,"left",t[11].left*100+"%"),R(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){B(a,e,l),Q(e,n),Q(n,s),Q(e,r)},p(a,l){t=a,l&2&&o!==(o=t[1](t[11].distance)+"")&&Te(s,o)},d(a){a&&M(e)}}}function cu(i){let t,e,n,o,s,r,a=[],l=new Map,c,u=i[3],d=[];for(let m=0;m<u.length;m+=1)d[m]=Bo(To(i,u,m));let h=i[4];const p=m=>m[13];for(let m=0;m<h.length;m+=1){let g=Mo(i,h,m),A=p(g);l.set(A,a[m]=jo(A,g))}return{c(){t=j("div"),e=j("div"),n=_(),o=j("div");for(let m=0;m<d.length;m+=1)d[m].c();s=_(),r=j("div");for(let m=0;m<a.length;m+=1)a[m].c();b(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),b(o,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),q(o,"is-row",i[2]),b(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),b(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+i[0]+" svelte-djlmk4"),q(t,"is-row",i[2]),R(t,"width",i[2]?"100%":1/16+"rem"),R(t,"height",i[2]?1/16+"rem":"100%")},m(m,g){B(m,t,g),Q(t,e),Q(t,n),Q(t,o);for(let A=0;A<d.length;A+=1)d[A].m(o,null);Q(t,s),Q(t,r);for(let A=0;A<a.length;A+=1)a[A].m(r,null)},p(m,[g]){if(g&8){u=m[3];let A;for(A=0;A<u.length;A+=1){const v=To(m,u,A);d[A]?d[A].p(v,g):(d[A]=Bo(v),d[A].c(),d[A].m(o,null))}for(;A<d.length;A+=1)d[A].d(1);d.length=u.length}g&22&&(h=m[4],a=Ue(a,g,p,1,m,h,l,r,ua,jo,null,Mo)),g&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+m[0]+" svelte-djlmk4")&&b(t,"class",c),g&5&&q(t,"is-row",m[2])},i:te,o:te,d(m){m&&M(t),tt(d,m);for(let g=0;g<a.length;g+=1)a[g].d()}}}const Wt=1e3,Xt=180;function uu(i,t,e){let{type:n}=t,{data:o}=t,{bounding:s}=t,{getRuleDistanceText:r}=t;const a=n==="top"||n==="bottom",l=s.max.x-s.min.x-(Wt-Xt)*2,c=s.max.y-s.min.y-(Wt-Xt)*2,u=o.map(([m,g])=>a?[m.x,g.x]:[m.y,g.y]).flat().sort().filter((m,g,A)=>g===0?!0:m!==A[g-1]),d=u.map(m=>{const g=a?(m-s.min.x-Wt+Xt)/l:0,A=a?0:(m-s.min.y-Wt+Xt)/c;return{left:g,bottom:A}});d.unshift({left:0,bottom:0}),d.push(a?{left:1,bottom:0}:{left:0,bottom:1});const h=u[u.length-1]-u[0],p=u.map((m,g,A)=>{const v=g===0?0:m-A[g-1],w=g===0?0:(m+A[g-1])/2,y=a?(w-s.min.x-Wt+Xt)/l:0,x=a?0:(w-s.min.y-Wt+Xt)/c;return{left:y,bottom:x,distance:v}}).filter(({distance:m})=>m/h>.1);return i.$$set=m=>{"type"in m&&e(0,n=m.type),"data"in m&&e(5,o=m.data),"bounding"in m&&e(6,s=m.bounding),"getRuleDistanceText"in m&&e(1,r=m.getRuleDistanceText)},[n,r,a,d,p,o,s]}class du extends oe{constructor(t){super(),ie(this,t,uu,cu,ne,{type:0,data:5,bounding:6,getRuleDistanceText:1},lu)}}function hu(i){ae(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function Qo(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function Ro(i,t){let e,n,o;const s=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<s.length;a+=1)r=we(r,s[a]);return n=new du({props:r}),{key:i,first:null,c(){e=fe(),ee(n.$$.fragment),this.first=e},m(a,l){B(a,e,l),K(n,a,l),o=!0},p(a,l){t=a;const c=l&19?Be(s,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){o||(D(n.$$.fragment,a),o=!0)},o(a){T(n.$$.fragment,a),o=!1},d(a){a&&M(e),$(n,a)}}}function fu(i){let t,e=[],n=new Map,o,s=i[4];const r=a=>a[13];for(let a=0;a<s.length;a+=1){let l=Qo(i,s,a),c=r(l);n.set(c,e[a]=Ro(c,l))}return{c(){t=j("div");for(let a=0;a<e.length;a+=1)e[a].c();b(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),R(t,"width",i[3]),R(t,"height",i[2])},m(a,l){B(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,[l]){l&19&&(s=a[4],le(),e=Ue(e,l,r,1,a,s,n,t,at,Ro,null,Qo),ce()),l&8&&R(t,"width",a[3]),l&4&&R(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)D(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)T(e[l]);o=!1},d(a){a&&M(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const Oo=1e3,Ho=180;function mu(i,t,e){let n,o,s,r,a,l,c,u,d,h,{floorIndex:p}=t,{floorplanData:m}=t,{getRuleDistanceText:g}=t;return i.$$set=A=>{"floorIndex"in A&&e(5,p=A.floorIndex),"floorplanData"in A&&e(6,m=A.floorplanData),"getRuleDistanceText"in A&&e(0,g=A.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=m.bounding),i.$$.dirty&96&&e(11,o=m.floorDatas[p].rules),i.$$.dirty&2048&&e(12,s=Object.keys(o)),i.$$.dirty&6144&&e(4,r=s.map(A=>[A,o[A]])),i.$$.dirty&2&&e(9,a=n.max.x-n.min.x),i.$$.dirty&2&&e(7,l=n.max.y-n.min.y),i.$$.dirty&2&&e(10,c=n.max.x-n.min.x-(Oo-Ho)*2),i.$$.dirty&2&&e(8,u=n.max.y-n.min.y-(Oo-Ho)*2),i.$$.dirty&1536&&e(3,d=c/a*100+"%"),i.$$.dirty&384&&e(2,h=u/l*100+"%")},[g,n,h,d,r,p,m,l,u,a,c,o,s]}class pu extends oe{constructor(t){super(),ie(this,t,mu,fu,ne,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},hu)}}function si(i,t={}){let e="";const{needZ:n,needA:o}=t;return(n?i.slice().concat(i[0]):i.slice()).forEach((r,a)=>{const{x:l,y:c}=t.format?t.format(r):r,u=l+","+c;return a===0?(e+="M"+u,e):o!=null&&o[a]?(e+="A"+o[a]+","+u,e):(e+="L"+u,e)}),e+(n?"Z":"")}function fa({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function gu(i,t){const e=i.x*1e3+t.bounding.origin.x,n=-i.z*1e3+t.bounding.origin.y;return{x:e,y:n}}function Au(i,t){const e=t.bounding,n=e.max.x-e.min.x,o=e.max.y-e.min.y;return{x:(i.x-e.min.x)/n,y:(e.max.y-i.y)/o}}function vu(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function bu(i){let t;return{c(){t=Ae("path"),b(t,"d",i[0]),b(t,"fill","#2F313A")},m(e,n){B(e,t,n)},p(e,[n]){n&1&&b(t,"d",e[0])},i:te,o:te,d(e){e&&M(t)}}}function yu(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=si(o,{needZ:!0}))},[n,o]}class wu extends oe{constructor(t){super(),ie(this,t,yu,bu,ne,{path:1})}}function Cu(i){let t,e,n,o,s,r;return{c(){t=Ae("defs"),e=Ae("pattern"),n=Ae("rect"),o=Ae("path"),s=_(),r=Ae("path"),b(n,"x","0"),b(n,"y","0"),b(n,"width",i[1]),b(n,"height",i[1]),b(n,"fill","#323747"),b(o,"d",i[2]),b(o,"stroke","#ffffff"),b(o,"stroke-opacity","0.06"),b(o,"stroke-width","0.5"),b(o,"fill","none"),b(e,"id","fpm-room-pattern-0"),b(e,"x","0"),b(e,"y","0"),b(e,"width",i[1]),b(e,"height",i[1]),b(e,"patternUnits","userSpaceOnUse"),b(e,"patternTransform","scale(50 50)"),b(r,"d",i[0]),b(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){B(a,t,l),Q(t,e),Q(e,n),Q(e,o),B(a,s,l),B(a,r,l)},p(a,[l]){l&1&&b(r,"d",a[0])},i:te,o:te,d(a){a&&M(t),a&&M(s),a&&M(r)}}}const vi=6;function Eu(i,t,e){let n,{path:o}=t;const s=vi*2,r=`M0 ${vi} h ${s} M${vi} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=si(o,{needZ:!0}))},[n,s,r,o]}class Pu extends oe{constructor(t){super(),ie(this,t,Eu,Cu,ne,{path:3})}}function Iu(i){let t,e,n,o,s,r,a,l,c,u,d;return{c(){t=Ae("defs"),e=Ae("pattern"),n=Ae("rect"),o=Ae("pattern"),s=Ae("rect"),r=_(),a=Ae("path"),l=_(),c=Ae("path"),u=_(),d=Ae("path"),b(n,"x","0"),b(n,"y","0"),b(n,"width","6"),b(n,"height","50"),b(n,"fill","none"),b(n,"stroke","#4B4B57"),b(n,"stroke-width","0.5"),b(e,"id","room-material-pattern-1"),b(e,"x","0"),b(e,"y","0"),b(e,"width","12"),b(e,"height","50"),b(e,"patternUnits","userSpaceOnUse"),b(e,"patternTransform","scale(50 50)"),b(s,"x","0"),b(s,"y","0"),b(s,"width","6"),b(s,"height","50"),b(s,"fill","none"),b(s,"stroke","#4B4B57"),b(s,"stroke-width","0.5"),b(o,"id","room-material-pattern-2"),b(o,"x","6"),b(o,"y","25"),b(o,"width","12"),b(o,"height","50"),b(o,"patternUnits","userSpaceOnUse"),b(o,"patternTransform","scale(50 50)"),b(a,"d",i[0]),b(a,"fill","#43434D"),b(c,"d",i[0]),b(c,"fill","url(#room-material-pattern-1)"),b(d,"d",i[0]),b(d,"fill","url(#room-material-pattern-2)")},m(h,p){B(h,t,p),Q(t,e),Q(e,n),Q(t,o),Q(o,s),B(h,r,p),B(h,a,p),B(h,l,p),B(h,c,p),B(h,u,p),B(h,d,p)},p(h,[p]){p&1&&b(a,"d",h[0]),p&1&&b(c,"d",h[0]),p&1&&b(d,"d",h[0])},i:te,o:te,d(h){h&&M(t),h&&M(r),h&&M(a),h&&M(l),h&&M(c),h&&M(u),h&&M(d)}}}function xu(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=si(o,{needZ:!0}))},[n,o]}class ku extends oe{constructor(t){super(),ie(this,t,xu,Iu,ne,{path:1})}}function Du(i){ae(i,"svelte-1dykexu",".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}")}function Fo(i,t,e){const n=i.slice();return n[5]=t[e],n}function Lu(i){let t,e;return t=new Pu({props:{path:i[5].path}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Su(i){let t,e;return t=new ku({props:{path:i[5].path}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function zu(i){let t,e;return t=new wu({props:{path:i[5].path}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Go(i){let t,e,n,o;const s=[zu,Su,Lu],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(i),n=r[e]=s[e](i),{c(){t=Ae("svg"),n.c(),b(t,"width","100%"),b(t,"height","100%"),b(t,"viewBox",`0 0 ${i[1]} ${i[2]}`),b(t,"class","svelte-1dykexu")},m(l,c){B(l,t,c),r[e].m(t,null),o=!0},p(l,c){let u=e;e=a(l),e===u?r[e].p(l,c):(le(),T(r[u],1,1,()=>{r[u]=null}),ce(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),D(n,1),n.m(t,null))},i(l){o||(D(n),o=!0)},o(l){T(n),o=!1},d(l){l&&M(t),r[e].d()}}}function Mu(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=Go(Fo(i,n,r));const s=r=>T(o[r],1,1,()=>{o[r]=null});return{c(){t=j("div");for(let r=0;r<o.length;r+=1)o[r].c();b(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){B(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=Fo(r,n,l);o[l]?(o[l].p(c,a),D(o[l],1)):(o[l]=Go(c),o[l].c(),D(o[l],1),o[l].m(t,null))}for(le(),l=n.length;l<o.length;l+=1)s(l);ce()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)D(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)T(o[a]);e=!1},d(r){r&&M(t),tt(o,r)}}}function Tu(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t;const r=s.bounding.max.x-s.bounding.min.x,a=s.bounding.max.y-s.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(3,o=l.floorIndex),"floorplanData"in l&&e(4,s=l.floorplanData)},i.$$.update=()=>{i.$$.dirty&24&&e(0,n=s.floorDatas[o].rooms.map(l=>he(N({},l),{path:l.path.map(c=>fa(c,s.bounding))})))},[n,r,a,o,s]}class Bu extends oe{constructor(t){super(),ie(this,t,Tu,Mu,ne,{floorIndex:3,floorplanData:4},Du)}}function ju(i){ae(i,"svelte-19uvvss","path.svelte-19uvvss{opacity:0}path.svelte-19uvvss:hover{opacity:0.1}")}function Qu(i){let t,e,n;return{c(){t=Ae("path"),b(t,"d",i[2]),b(t,"fill","#fff"),b(t,"class","svelte-19uvvss")},m(o,s){B(o,t,s),e||(n=[Pe(t,"mouseenter",i[0]),Pe(t,"mouseleave",i[1])],e=!0)},p:te,i:te,o:te,d(o){o&&M(t),e=!1,rt(n)}}}function Ru(i,t,e){let{room:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t;function r(){s.set(n)}function a(){s.set(void 0)}const{bounding:l}=o,c=si(n.path,{needZ:!0,format:u=>fa(u,l)});return i.$$set=u=>{"room"in u&&e(3,n=u.room),"floorplanData"in u&&e(4,o=u.floorplanData),"hoveredRoom"in u&&e(5,s=u.hoveredRoom)},[r,a,c,n,o,s]}class Ou extends oe{constructor(t){super(),ie(this,t,Ru,Qu,ne,{room:3,floorplanData:4,hoveredRoom:5},ju)}}function Hu(i){ae(i,"svelte-1kqo6e4",".floorplan-plugin__room-highlight.svelte-1kqo6e4{position:absolute;width:100%;height:100%}svg.svelte-1kqo6e4{width:100%;height:100%;overflow:visible}")}function No(i,t,e){const n=i.slice();return n[5]=t[e],n}function Wo(i,t){let e,n,o;const s=[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}];let r={};for(let a=0;a<s.length;a+=1)r=we(r,s[a]);return n=new Ou({props:r}),{key:i,first:null,c(){e=fe(),ee(n.$$.fragment),this.first=e},m(a,l){B(a,e,l),K(n,a,l),o=!0},p(a,l){t=a;const c=l&7?Be(s,[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}]):{};n.$set(c)},i(a){o||(D(n.$$.fragment,a),o=!0)},o(a){T(n.$$.fragment,a),o=!1},d(a){a&&M(e),$(n,a)}}}function Fu(i){let t,e,n=[],o=new Map,s,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[5].id;for(let l=0;l<r.length;l+=1){let c=No(i,r,l),u=a(c);o.set(u,n[l]=Wo(u,c))}return{c(){t=j("div"),e=Ae("svg");for(let l=0;l<n.length;l+=1)n[l].c();b(e,"width","100%"),b(e,"height","100%"),b(e,"viewBox",`0 0 ${i[3]} ${i[4]}`),b(e,"class","svelte-1kqo6e4"),b(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){B(l,t,c),Q(t,e);for(let u=0;u<n.length;u+=1)n[u].m(e,null);s=!0},p(l,[c]){c&7&&(r=l[1].floorDatas[l[0]].rooms,le(),n=Ue(n,c,a,1,l,r,o,e,at,Wo,null,No),ce())},i(l){if(!s){for(let c=0;c<r.length;c+=1)D(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)T(n[c]);s=!1},d(l){l&&M(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function Gu(i,t,e){let{floorIndex:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t;const r=o.bounding.max.x-o.bounding.min.x,a=o.bounding.max.y-o.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(0,n=l.floorIndex),"floorplanData"in l&&e(1,o=l.floorplanData),"hoveredRoom"in l&&e(2,s=l.hoveredRoom)},[n,o,s,r,a]}class ma extends oe{constructor(t){super(),ie(this,t,Gu,Fu,ne,{floorIndex:0,floorplanData:1,hoveredRoom:2},Hu)}}function Nu(i){ae(i,"svelte-bl8zrz",".floorplan-plugin__floor.svelte-bl8zrz{position:absolute;left:0;top:0;width:100%;height:100%;opacity:0;pointer-events:none}.floorplan-plugin__floor--is-current.svelte-bl8zrz{opacity:1;pointer-events:auto}")}function Xo(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[5],hoveredRoom:i[10]}];let o={};for(let s=0;s<n.length;s+=1)o=we(o,n[s]);return t=new ma({props:o}),{c(){ee(t.$$.fragment)},m(s,r){K(t,s,r),e=!0},p(s,r){const a=r&1058?Be(n,[{floorIndex:s[1],floorplanData:s[5],hoveredRoom:s[10]}]):{};t.$set(a)},i(s){e||(D(t.$$.fragment,s),e=!0)},o(s){T(t.$$.fragment,s),e=!1},d(s){$(t,s)}}}function Yo(i){let t,e;const n=[{floorplanData:i[5],floorIndex:i[1],getRoomAreaText:i[6],getLabelElement:i[7],hoveredRoom:i[10],adaptiveRoomLabelVisibleEnable:i[9]}];let o={};for(let s=0;s<n.length;s+=1)o=we(o,n[s]);return t=new au({props:o}),{c(){ee(t.$$.fragment)},m(s,r){K(t,s,r),e=!0},p(s,r){const a=r&1762?Be(n,[{floorplanData:s[5],floorIndex:s[1],getRoomAreaText:s[6],getLabelElement:s[7],hoveredRoom:s[10],adaptiveRoomLabelVisibleEnable:s[9]}]):{};t.$set(a)},i(s){e||(D(t.$$.fragment,s),e=!0)},o(s){T(t.$$.fragment,s),e=!1},d(s){$(t,s)}}}function Uo(i){let t,e;const n=[{floorplanData:i[5],floorIndex:i[1],getRuleDistanceText:i[8]}];let o={};for(let s=0;s<n.length;s+=1)o=we(o,n[s]);return t=new pu({props:o}),{c(){ee(t.$$.fragment)},m(s,r){K(t,s,r),e=!0},p(s,r){const a=r&290?Be(n,[{floorplanData:s[5],floorIndex:s[1],getRuleDistanceText:s[8]}]):{};t.$set(a)},i(s){e||(D(t.$$.fragment,s),e=!0)},o(s){T(t.$$.fragment,s),e=!1},d(s){$(t,s)}}}function Wu(i){let t,e,n,o,s,r,a,l,c;const u=[{floorIndex:i[1],floorplanData:i[5]}];let d={};for(let v=0;v<u.length;v+=1)d=we(d,u[v]);e=new Bu({props:d});let h=i[2]&&Xo(i);const p=[{floorplanData:i[5],floorIndex:i[1]}];let m={};for(let v=0;v<p.length;v+=1)m=we(m,p[v]);s=new ha({props:m});let g=i[3]&&Yo(i),A=i[4]&&Uo(i);return{c(){t=j("div"),ee(e.$$.fragment),n=_(),h&&h.c(),o=_(),ee(s.$$.fragment),r=_(),g&&g.c(),a=_(),A&&A.c(),b(t,"class",l=je(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(v,w){B(v,t,w),K(e,t,null),Q(t,n),h&&h.m(t,null),Q(t,o),K(s,t,null),Q(t,r),g&&g.m(t,null),Q(t,a),A&&A.m(t,null),c=!0},p(v,[w]){const y=w&34?Be(u,[{floorIndex:v[1],floorplanData:v[5]}]):{};e.$set(y),v[2]?h?(h.p(v,w),w&4&&D(h,1)):(h=Xo(v),h.c(),D(h,1),h.m(t,o)):h&&(le(),T(h,1,1,()=>{h=null}),ce());const x=w&34?Be(p,[{floorplanData:v[5],floorIndex:v[1]}]):{};s.$set(x),v[3]?g?(g.p(v,w),w&8&&D(g,1)):(g=Yo(v),g.c(),D(g,1),g.m(t,a)):g&&(le(),T(g,1,1,()=>{g=null}),ce()),v[4]?A?(A.p(v,w),w&16&&D(A,1)):(A=Uo(v),A.c(),D(A,1),A.m(t,null)):A&&(le(),T(A,1,1,()=>{A=null}),ce()),(!c||w&1&&l!==(l=je(`floorplan-plugin__floor${v[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&b(t,"class",l)},i(v){c||(D(e.$$.fragment,v),D(h),D(s.$$.fragment,v),D(g),D(A),c=!0)},o(v){T(e.$$.fragment,v),T(h),T(s.$$.fragment,v),T(g),T(A),c=!1},d(v){v&&M(t),$(e),h&&h.d(),$(s),g&&g.d(),A&&A.d()}}}function Xu(i,t,e){let{isCurrent:n}=t,{floorIndex:o}=t,{hoverEnable:s}=t,{roomLabelsEnable:r}=t,{ruleLabelsEnable:a}=t,{floorplanData:l}=t,{getRoomAreaText:c}=t,{getLabelElement:u}=t,{getRuleDistanceText:d}=t,{adaptiveRoomLabelVisibleEnable:h}=t;const p=$i(void 0);return i.$$set=m=>{"isCurrent"in m&&e(0,n=m.isCurrent),"floorIndex"in m&&e(1,o=m.floorIndex),"hoverEnable"in m&&e(2,s=m.hoverEnable),"roomLabelsEnable"in m&&e(3,r=m.roomLabelsEnable),"ruleLabelsEnable"in m&&e(4,a=m.ruleLabelsEnable),"floorplanData"in m&&e(5,l=m.floorplanData),"getRoomAreaText"in m&&e(6,c=m.getRoomAreaText),"getLabelElement"in m&&e(7,u=m.getLabelElement),"getRuleDistanceText"in m&&e(8,d=m.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in m&&e(9,h=m.adaptiveRoomLabelVisibleEnable)},[n,o,s,r,a,l,c,u,d,h,p]}class Yu extends oe{constructor(t){super(),ie(this,t,Xu,Wu,ne,{isCurrent:0,floorIndex:1,hoverEnable:2,roomLabelsEnable:3,ruleLabelsEnable:4,floorplanData:5,getRoomAreaText:6,getLabelElement:7,getRuleDistanceText:8,adaptiveRoomLabelVisibleEnable:9},Nu)}}function Uu(i){ae(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function Vo(i,t,e){const n=i.slice();return n[16]=t[e],n}function Jo(i){let t,e,n,o,s,r,a=i[9].floorDatas,l=[];for(let p=0;p<a.length;p+=1)l[p]=_o(Vo(i,a,p));const c=p=>T(l[p],1,1,()=>{l[p]=null}),u=[{panoIndex:i[3],floorplanData:i[9],lastPanoramaLongitude:i[10],cameraImageUrl:i[11]}];let d={};for(let p=0;p<u.length;p+=1)d=we(d,u[p]);n=new Sc({props:d});let h=i[6]&&Zo(i);return{c(){t=j("div");for(let p=0;p<l.length;p+=1)l[p].c();e=_(),ee(n.$$.fragment),o=_(),h&&h.c(),b(t,"class","floorplan-main svelte-86bqav")},m(p,m){B(p,t,m);for(let g=0;g<l.length;g+=1)l[g].m(t,null);Q(t,e),K(n,t,null),Q(t,o),h&&h.m(t,null),r=!0},p(p,m){if(i=p,m&62384){a=i[9].floorDatas;let A;for(A=0;A<a.length;A+=1){const v=Vo(i,a,A);l[A]?(l[A].p(v,m),D(l[A],1)):(l[A]=_o(v),l[A].c(),D(l[A],1),l[A].m(t,e))}for(le(),A=a.length;A<l.length;A+=1)c(A);ce()}const g=m&3592?Be(u,[{panoIndex:i[3],floorplanData:i[9],lastPanoramaLongitude:i[10],cameraImageUrl:i[11]}]):{};n.$set(g),i[6]?h?(h.p(i,m),m&64&&D(h,1)):(h=Zo(i),h.c(),D(h,1),h.m(t,null)):h&&(le(),T(h,1,1,()=>{h=null}),ce())},i(p){if(!r){for(let m=0;m<a.length;m+=1)D(l[m]);D(n.$$.fragment,p),D(h),s||xe(()=>{s=Ot(t,Tt,{duration:i[0],easing:Jt}),s.start()}),r=!0}},o(p){l=l.filter(Boolean);for(let m=0;m<l.length;m+=1)T(l[m]);T(n.$$.fragment,p),T(h),r=!1},d(p){p&&M(t),tt(l,p),$(n),h&&h.d()}}}function _o(i){let t,e;const n=[{hoverEnable:i[5],floorplanData:i[9],getRoomAreaText:i[12],getLabelElement:i[13],getRuleDistanceText:i[14],roomLabelsEnable:i[7],ruleLabelsEnable:i[8],adaptiveRoomLabelVisibleEnable:i[15]},{floorIndex:i[16].floorIndex},{isCurrent:i[16].floorIndex===i[4]}];let o={};for(let s=0;s<n.length;s+=1)o=we(o,n[s]);return t=new Yu({props:o}),{c(){ee(t.$$.fragment)},m(s,r){K(t,s,r),e=!0},p(s,r){const a=r&62384?Be(n,[r&62368&&{hoverEnable:s[5],floorplanData:s[9],getRoomAreaText:s[12],getLabelElement:s[13],getRuleDistanceText:s[14],roomLabelsEnable:s[7],ruleLabelsEnable:s[8],adaptiveRoomLabelVisibleEnable:s[15]},r&512&&{floorIndex:s[16].floorIndex},r&528&&{isCurrent:s[16].floorIndex===s[4]}]):{};t.$set(a)},i(s){e||(D(t.$$.fragment,s),e=!0)},o(s){T(t.$$.fragment,s),e=!1},d(s){$(t,s)}}}function Zo(i){let t,e;return t=new Rc({props:{floorplanData:i[9],northDesc:i[2]}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&512&&(s.floorplanData=n[9]),o&4&&(s.northDesc=n[2]),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Vu(i){let t,e,n=i[1]&&Jo(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&D(n,1)):(n=Jo(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Ju(i,t,e){let{duration:n=0}=t,{visible:o}=t,{northDesc:s}=t,{panoIndex:r}=t,{floorIndex:a}=t,{hoverEnable:l}=t,{compassEnable:c}=t,{roomLabelsEnable:u}=t,{ruleLabelsEnable:d}=t,{floorplanData:h}=t,{lastPanoramaLongitude:p}=t,{cameraImageUrl:m}=t,{getRoomAreaText:g}=t,{getLabelElement:A}=t,{getRuleDistanceText:v}=t,{adaptiveRoomLabelVisibleEnable:w}=t;return i.$$set=y=>{"duration"in y&&e(0,n=y.duration),"visible"in y&&e(1,o=y.visible),"northDesc"in y&&e(2,s=y.northDesc),"panoIndex"in y&&e(3,r=y.panoIndex),"floorIndex"in y&&e(4,a=y.floorIndex),"hoverEnable"in y&&e(5,l=y.hoverEnable),"compassEnable"in y&&e(6,c=y.compassEnable),"roomLabelsEnable"in y&&e(7,u=y.roomLabelsEnable),"ruleLabelsEnable"in y&&e(8,d=y.ruleLabelsEnable),"floorplanData"in y&&e(9,h=y.floorplanData),"lastPanoramaLongitude"in y&&e(10,p=y.lastPanoramaLongitude),"cameraImageUrl"in y&&e(11,m=y.cameraImageUrl),"getRoomAreaText"in y&&e(12,g=y.getRoomAreaText),"getLabelElement"in y&&e(13,A=y.getLabelElement),"getRuleDistanceText"in y&&e(14,v=y.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in y&&e(15,w=y.adaptiveRoomLabelVisibleEnable)},[n,o,s,r,a,l,c,u,d,h,p,m,g,A,v,w]}class eo extends oe{constructor(t){super(),ie(this,t,Ju,Vu,ne,{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},Uu)}}const _u="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiI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kO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function Zu(i){return J(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(o){return J(this,null,function*(){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=yield fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s})};return yield Promise.all(i.map(e))})}function qu(i){return{id:i.id,size:i.size,name:i.name,path:i.path,roomType:i.room_type,floorType:i.floor_type,roomLabel:{position:i.room_label.position,positionInImage:i.room_label.position_in_image},observerIndexs:i.observer_indexs}}function Ku(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(qu),rules:i.rules}}function $u(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function ed(i){return{rad:i.rad,position:i.position,positionInImage:i.position_in_image,northRad:i.north_rad,roomId:i.room_id,floorIndex:i.floor_index}}function vt(i){return J(this,null,function*(){const t=yield Zu(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(Ku),o=i.computed_data.entrance?ed(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map($u)}})}function td(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:_u,width:45,height:48},a=vu(s,t),l=gu(s,e),c=Au(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function nd(i,t){return t(i),i}function ri(i,t){return nd({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function qo(i,t){const e=Math.max(...i.work.observers.map(n=>n.floorIndex));return t>e?i.model.bounding.max.y:Math.max(...i.work.observers.filter(n=>n.floorIndex===t).map(n=>n.standingPosition.y))}function to(i,t,e=mt.BOUNDING_CENTER){const n=qo(i,t),o=qo(i,t+1);return e===mt.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===mt.CEILING?o:n}function no(i,t,e,n){const o=to(i,e,n==null?void 0:n.attachedTo),s=new E.Vector3(0,o,0),r=new E.Vector3(1,o,0),a=s.clone().project(i.camera),l=r.clone().project(i.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}class ai{constructor(t,e){f(this,"five");f(this,"hooks",new qt);f(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}}class Ht extends ai{}var Fe=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(Fe||{});const pa=500,id=80;function Qi(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function ga(i,t){return J(this,null,function*(){yield new Promise((e,n)=>{i.changeMode(...t).catch(o=>n(o)),i.once("initAnimationEnded",()=>{const o=i.getCurrentState(),s=t[0];o.mode!==s&&n(new Error("mode \u4E0E\u9884\u671F\u4E0D\u7B26")),(()=>{const l=t[1];return l?Object.keys(l).every(c=>{const u=o[c];if(u===void 0)return!0;const d=l[c];return typeof u=="number"&&typeof d=="number"?Qi(u,d,2):u===d}):!0})()||n(new Error("five pose \u4E0E\u9884\u671F\u4E0D\u7B26")),e()})})})}function io(i,t){if(i.currentMode!==t.mode)return!1;const{latitude:e,longitude:n,fov:o}=t,{latitude:s,longitude:r}=i.getCurrentState(),a=i.camera.fov;return!(!Qi(e,s,2)||!Qi(n,r,2)||o!==a)}function Aa(i,t,e=!0){return J(this,null,function*(){if(io(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[u]=yield _n(ga(i,[t.mode,t,void 0,e]));if(u)throw new Error(Fe.ChangeModeError);return}const{latitude:s,longitude:r,fov:a}=o,l=Math.min(1e3,Math.max(200,Math.abs(s-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,Math.abs(a-t.fov)*10)),[c]=yield _n(i.updateCamera(t,l,e));if(c)throw new Error(Fe.UpdateCameraError)})}function Zt(i,t,e=300){const n=i.getElement();!n||(n.style.opacity=t+"",n.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(o=>n.addEventListener("transitionend",o,{once:!0})),new Promise(o=>setTimeout(o,e))]).then(()=>{n.style.transition="none"}))}function od(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function sd(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}class rd extends Ht{constructor(e,n){var a;super(e);f(this,"name","modelFloorplanPlugin");f(this,"state");f(this,"data");f(this,"showState");f(this,"showPromise");f(this,"app");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"selector");f(this,"showRejection");f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});f(this,"show",(...n)=>J(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));f(this,"hide",(...n)=>J(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!io(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=no(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,Fe.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});f(this,"_show",e=>J(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Fe.ModelNotLoaded);if(!this.data)throw new Error(Fe.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=N(N({},n),e),s=()=>J(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=h=>{a=!0,l=h};const[c]=yield _n(Aa(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Fe.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,d=o.immediately?0:pa;Zt(this.five,u,d),this.render(d)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,Fe.BreakOffByHide),this.showPromise=void 0;const o=N(N({},{userAction:!0,isAutoHide:!1}),e);Zt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFiveInteriaPan",(e,n)=>{if(!n||this.state.config.autoShowEnable===!1||this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();o.mode==="Floorplan"&&(this.state.visible||sd(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});f(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();od(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});f(this,"onFiveWantsGesture",(e,n)=>{if(!!this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});f(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode==="Floorplan"&&this.state.config.autoShowEnable!==!1&&n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:id/((a=n==null?void 0:n.scale)!=null?a:1)};const o={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:At,attachedTo:mt.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},s=n?ri(n,["selector","scale"]):{},r=N(N({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return J(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield vt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}this.render()}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return J(this,null,function*(){return yield vt(e.data)})}updateState(e,n){const o=this.state,s=e.config?N(N({},o.config),e.config):o.config;this.state=he(N(N({},this.state),e),{config:s}),!qe(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=he(N({},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 eo({target:this.container,intro:!0,props:n})}}const ad=(i,t)=>new rd(i,t);function ld(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function cd(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}class ud extends Ht{constructor(e,n){super(e);f(this,"name","modelFloorplanPlugin");f(this,"state");f(this,"data");f(this,"showState");f(this,"showPromise");f(this,"app");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"selector");f(this,"showRejection");f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});f(this,"show",(...n)=>J(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));f(this,"hide",(...n)=>J(this,[...n],function*(e={}){!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))}));f(this,"updateSize",()=>{if(!this.data||!io(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=no(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,Fe.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});f(this,"_enable",e=>{const{userAction:n}=e;this.addEventListener(),this.wrapper&&(this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n}))});f(this,"_show",e=>J(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Fe.ModelNotLoaded);if(!this.data)throw new Error(Fe.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=N(N({},n),e),s=()=>J(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=h=>{a=!0,l=h};const[c]=yield _n(Aa(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Fe.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,d=o.immediately?0:pa;Zt(this.five,u,d),this.render(d)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,Fe.BreakOffByHide),this.showPromise=void 0;const o=N(N({},{userAction:!0,isAutoHide:!1}),e);Zt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});f(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});f(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();this.updatePosition(),this.updateSize(),ld(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});f(this,"onFiveWantsPanGesture",(e,n)=>{if(this.five.getCurrentState().mode===this.showState.mode&&this.state.config.autoShowEnable!==!1){if(n&&this.state.visible)return this.five.updateCamera(this.showState,0),!1;if(n&&!this.state.visible){if(this.isHiddenByHideFunc)return;const o=this.five.getCurrentState();return o.mode!==this.showState.mode||this.state.visible?void 0:(cd(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});f(this,"onFiveWantsTapGesture",()=>this.handleClick());f(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2,fov:90};const o={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,cameraImageUrl:At,attachedTo:mt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?ri(n,["selector","scale"]):{},r=N(N({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return J(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield vt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}updatePosition(){var a;const e=to(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}formatData(e){return J(this,null,function*(){return yield vt(e.data)})}updateState(e,n){const o=this.state,s=e.config?N(N({},o.config),e.config):o.config;this.state=he(N(N({},this.state),e),{config:s}),!qe(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=he(N({},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 eo({target:this.container,intro:!0,props:n})}}const dd=(i,t)=>new ud(i,t);class hd extends Ht{constructor(e,n){super(e);f(this,"name","topviewFloorplanPlugin");f(this,"state");f(this,"data");f(this,"app");f(this,"selector");f(this,"panoIndex",0);f(this,"floorIndex",0);f(this,"wrapper");f(this,"container",document.createElement("div"));f(this,"lastPanoramaLongitude",0);f(this,"size",{width:0,height:0});f(this,"hasAddedEventListener",!1);f(this,"isHiddenByHideFunc",!1);f(this,"updateSize",()=>{if(!this.data||!this.container||!this.wrapper||this.five.getCurrentState().mode!=="Topview")return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=no(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});f(this,"dispose",()=>{var e,n;this.removeEventListener(),(e=this.app)==null||e.$destroy(),this.app=void 0,(n=this.container)==null||n.remove(),this.data=void 0,this.wrapper=void 0,this.selector=void 0,this.hooks.emit("dispose")});f(this,"_disable",e=>{var o,s;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,(s=this.container)==null||s.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:n})});f(this,"onFiveModelLoaded",()=>{if(this.state.enabled===!1||this.wrapper||!this.selector)return;const e=this.selector instanceof Element?this.selector:document.querySelector(this.selector);if(!e)throw new Error("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");this.wrapper=e,e.append(this.container)});f(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});f(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});f(this,"onFiveCameraUpdate",(e,n)=>{!this.state.visible||(this.updatePosition(),this.updateSize())});f(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});f(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});f(this,"onFiveInitAnimationEnded",(...[,,e])=>{const{mode:n}=this.five.getCurrentState();n==="Topview"&&!this.isHiddenByHideFunc&&!this.state.visible&&this.state.config.autoShowEnable&&(this.updateState({visible:!0},e),this._show({userAction:e}))});f(this,"onModelShownFloorChange",e=>{if(this.floorIndex!==e){if(e===null){const n=this.five.getCurrentState().panoIndex;this.floorIndex=this.five.work.observers[n].floorIndex;return}this.floorIndex=e,this.updateSize(),this.render()}});n!=null&&n.selector&&(this.selector=n.selector,console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"));const o={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,cameraImageUrl:At,attachedTo:mt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?ri(n,["selector","scale"]):{},r=N(N({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return J(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield vt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}updatePosition(){var a;const e=to(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new E.Vector3).setY(e);if(!n)return;const o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return J(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 J(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return J(this,null,function*(){return yield vt(e.data)})}_show(e){return J(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 ga(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const o=500,s=this.state.config.modelOpacity;Zt(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return J(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;Zt(this.five,o,s),this.render()})}_enable(e){const{userAction:n}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}updateState(e,n){const o=this.state,s=e.config?N(N({},o.config),e.config):o.config;this.state=he(N(N({},this.state),e),{config:s}),!qe(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=he(N({},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 eo({target:this.container,intro:!0,props:n})}}const fd=(i,t)=>new hd(i,t);function oo(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function md(i){ae(i,"svelte-1nqrlxd",".plugin-radar__camera-wrapper.svelte-1nqrlxd{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1nqrlxd{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1nqrlxd{position:absolute;left:-0.9375rem;top:-0.9375rem;width:1.0625rem;height:1.0625rem;transform-origin:0.9375rem 0.9375rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function pd(i){let t,e,n;return{c(){t=j("div"),e=j("div"),n=j("div"),b(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),R(n,"background-image","url("+(i[0]||At)+")"),R(n,"transform",i[1]),b(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),R(e,"transform",i[2]),b(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(o,s){B(o,t,s),Q(t,e),Q(e,n)},p(o,[s]){s&1&&R(n,"background-image","url("+(o[0]||At)+")"),s&2&&R(n,"transform",o[1]),s&4&&R(e,"transform",o[2])},i:te,o:te,d(o){o&&M(t)}}}function gd(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function Ad(i,t,e){let n,o,{five:s}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=s.getCurrentState().panoIndex,u=s.getCurrentState().longitude;function d(m,g){const A=m.bounding,v=m.observers[g];if(!v)return"";const w=(A.max.x-A.min.x)*r,y=(A.max.y-A.min.y)*r,x=Math.floor(v.positionInImage.x*w),L=Math.floor(v.positionInImage.y*y);return`translate(${x}px, ${L}px)`}function h(m){e(6,c=m)}const p=oo(m=>{e(7,u=m.longitude)},1e3/60);return Ye(()=>(s.on("panoWillArrive",h),s.on("cameraDirectionUpdate",p),function(){s.off("panoWillArrive",h),s.off("cameraDirectionUpdate",p)})),i.$$set=m=>{"five"in m&&e(3,s=m.five),"pxmm"in m&&e(4,r=m.pxmm),"floorplanData"in m&&e(5,a=m.floorplanData),"cameraImageUrl"in m&&e(0,l=m.cameraImageUrl)},i.$$.update=()=>{i.$$.dirty&96&&e(2,n=d(a,c)),i.$$.dirty&128&&e(1,o=gd(u))},[l,o,n,s,r,a,c,u]}class vd extends oe{constructor(t){super(),ie(this,t,Ad,pd,ne,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},md)}}function bd(i){ae(i,"svelte-1i87fz7",".plugin-pano-floorplan__extra-objects.svelte-1i87fz7{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.plugin-pano-floorplan__extra-object-item--position.svelte-1i87fz7{position:absolute;width:0;height:0}.plugin-pano-floorplan__extra-object-item.svelte-1i87fz7{transform:translate(-50%, -50%)}")}function Ko(i,t,e){const n=i.slice();return n[1]=t[e],n}function $o(i,t){let e,n,o=`${t[1].icon.width/16}rem`,s=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:i,first:null,c(){e=j("div"),n=j("div"),r=_(),b(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),R(n,"background-image",`url(${t[1].icon.url})`),R(n,"width",o),R(n,"height",s),b(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),R(e,"top",a),R(e,"left",l),this.first=e},m(c,u){B(c,e,u),Q(e,n),Q(e,r)},p(c,u){t=c,u&1&&R(n,"background-image",`url(${t[1].icon.url})`),u&1&&o!==(o=`${t[1].icon.width/16}rem`)&&R(n,"width",o),u&1&&s!==(s=`${t[1].icon.height/16}rem`)&&R(n,"height",s),u&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&R(e,"top",a),u&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&R(e,"left",l)},d(c){c&&M(e)}}}function yd(i){let t,e=[],n=new Map,o=i[0];const s=r=>r[1].id;for(let r=0;r<o.length;r+=1){let a=Ko(i,o,r),l=s(a);n.set(l,e[r]=$o(l,a))}return{c(){t=j("div");for(let r=0;r<e.length;r+=1)e[r].c();b(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){B(r,t,a);for(let l=0;l<e.length;l+=1)e[l].m(t,null)},p(r,[a]){a&1&&(o=r[0],e=Ue(e,a,s,1,r,o,n,t,ua,$o,null,Ko))},i:te,o:te,d(r){r&&M(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function wd(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class Cd extends oe{constructor(t){super(),ie(this,t,wd,yd,ne,{extraObjects:0},bd)}}function es(i){let t,e;const n=[{five:i[0],pxmm:i[1],floorIndex:i[2],floorplanData:i[4],onRoomHeightClick:i[6]}];let o={};for(let s=0;s<n.length;s+=1)o=we(o,n[s]);return t=new ma({props:o}),{c(){ee(t.$$.fragment)},m(s,r){K(t,s,r),e=!0},p(s,r){const a=r&87?Be(n,[{five:s[0],pxmm:s[1],floorIndex:s[2],floorplanData:s[4],onRoomHeightClick:s[6]}]):{};t.$set(a)},i(s){e||(D(t.$$.fragment,s),e=!0)},o(s){T(t.$$.fragment,s),e=!1},d(s){$(t,s)}}}function Ed(i){let t,e,n,o,s,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let u=0;u<a.length;u+=1)l=we(l,a[u]);t=new ha({props:l}),n=new Cd({props:{extraObjects:i[5]}});let c=i[3]&&es(i);return{c(){ee(t.$$.fragment),e=_(),ee(n.$$.fragment),o=_(),c&&c.c(),s=fe()},m(u,d){K(t,u,d),B(u,e,d),K(n,u,d),B(u,o,d),c&&c.m(u,d),B(u,s,d),r=!0},p(u,[d]){const h=d&20?Be(a,[{floorIndex:u[2],floorplanData:u[4]}]):{};t.$set(h);const p={};d&32&&(p.extraObjects=u[5]),n.$set(p),u[3]?c?(c.p(u,d),d&8&&D(c,1)):(c=es(u),c.c(),D(c,1),c.m(s.parentNode,s)):c&&(le(),T(c,1,1,()=>{c=null}),ce())},i(u){r||(D(t.$$.fragment,u),D(n.$$.fragment,u),D(c),r=!0)},o(u){T(t.$$.fragment,u),T(n.$$.fragment,u),T(c),r=!1},d(u){$(t,u),u&&M(e),$(n,u),u&&M(o),c&&c.d(u),u&&M(s)}}}function Pd(i,t,e){let n,{five:o}=t,{pxmm:s}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t;const u=void 0;return i.$$set=d=>{"five"in d&&e(0,o=d.five),"pxmm"in d&&e(1,s=d.pxmm),"floorIndex"in d&&e(2,r=d.floorIndex),"hoverEnable"in d&&e(3,a=d.hoverEnable),"floorplanData"in d&&e(4,l=d.floorplanData),"extraObjects"in d&&e(7,c=d.extraObjects)},i.$$.update=()=>{i.$$.dirty&132&&e(5,n=c==null?void 0:c.filter(d=>d.floorIndex===r))},[o,s,r,a,l,n,u,c]}class Id extends oe{constructor(t){super(),ie(this,t,Pd,Ed,ne,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:7})}}function xd(i){ae(i,"svelte-1mvqyqq",".plugin-floorplan-radar.svelte-1mvqyqq{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.plugin-floorplan-radar-container.svelte-1mvqyqq{position:relative}")}function ts(i){let t,e,n,o=i[6]!==0&&ns(i);return{c(){t=j("div"),o&&o.c(),b(t,"class","plugin-floorplan-radar svelte-1mvqyqq"),xe(()=>i[12].call(t))},m(s,r){B(s,t,r),o&&o.m(t,null),e=bt(t,i[12].bind(t)),n=!0},p(s,r){s[6]!==0?o?(o.p(s,r),r&64&&D(o,1)):(o=ns(s),o.c(),D(o,1),o.m(t,null)):o&&(le(),T(o,1,1,()=>{o=null}),ce())},i(s){n||(D(o),n=!0)},o(s){T(o),n=!1},d(s){s&&M(t),o&&o.d(),e()}}}function ns(i){let t,e,n,o,s=`${i[8]}px`,r=`${i[11]}px`,a;const l=[{five:i[0],pxmm:i[9],floorIndex:i[10],floorplanData:i[3],hoverEnable:i[2],extraObjects:i[5]}];let c={};for(let h=0;h<l.length;h+=1)c=we(c,l[h]);e=new Id({props:c});const u=[{pxmm:i[9],five:i[0],floorplanData:i[3],cameraImageUrl:i[4]}];let d={};for(let h=0;h<u.length;h+=1)d=we(d,u[h]);return o=new vd({props:d}),{c(){t=j("div"),ee(e.$$.fragment),n=_(),ee(o.$$.fragment),b(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),R(t,"width",s),R(t,"height",r)},m(h,p){B(h,t,p),K(e,t,null),Q(t,n),K(o,t,null),a=!0},p(h,p){const m=p&1581?Be(l,[{five:h[0],pxmm:h[9],floorIndex:h[10],floorplanData:h[3],hoverEnable:h[2],extraObjects:h[5]}]):{};e.$set(m);const g=p&537?Be(u,[{pxmm:h[9],five:h[0],floorplanData:h[3],cameraImageUrl:h[4]}]):{};o.$set(g),p&256&&s!==(s=`${h[8]}px`)&&R(t,"width",s),p&2048&&r!==(r=`${h[11]}px`)&&R(t,"height",r)},i(h){a||(D(e.$$.fragment,h),D(o.$$.fragment,h),a=!0)},o(h){T(e.$$.fragment,h),T(o.$$.fragment,h),a=!1},d(h){h&&M(t),$(e),$(o)}}}function kd(i){let t,e,n=i[1]&&ts(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&D(n,1)):(n=ts(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Dd(i,t,e){var v,w;let{five:n}=t,{visible:o}=t,{hoverEnable:s}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,c=0,u=(w=(v=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:v.floorIndex)!=null?w:0,d=0,h=0,p=0,m=0;function g(y){e(10,u=n.work.observers[y].floorIndex)}Ye(()=>(n.on("panoArrived",g),()=>{n.off("panoArrived",g)}));function A(){d=this.clientWidth,h=this.clientHeight,e(6,d),e(7,h)}return i.$$set=y=>{"five"in y&&e(0,n=y.five),"visible"in y&&e(1,o=y.visible),"hoverEnable"in y&&e(2,s=y.hoverEnable),"floorplanData"in y&&e(3,r=y.floorplanData),"cameraImageUrl"in y&&e(4,a=y.cameraImageUrl),"extraObjects"in y&&e(5,l=y.extraObjects)},i.$$.update=()=>{if(i.$$.dirty&456){const y=Math.min(d,h),{max:x,min:L}=r.bounding,C=x.x-L.x,S=x.y-L.y,k=function(){return C>S?[y,y/C*S]:[y/S*C,y]}();e(8,p=k[0]),e(11,m=k[1]),e(9,c=p/C)}},[n,o,s,r,a,l,d,h,p,c,u,m,A]}class Ld extends oe{constructor(t){super(),ie(this,t,Dd,kd,ne,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5},xd)}}class Sd extends Ht{constructor(e,n){super(e);f(this,"name","panoFloorplanRadarPlugin");f(this,"state");f(this,"data");f(this,"app");f(this,"wrapperSelector","");f(this,"wrapper",null);f(this,"disposed",!1);f(this,"extraObjects",[]);f(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});f(this,"_disable",e=>{var o;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:n})});this.five=e;const o={hoverEnable:!1,cameraImageUrl:At},s=n!=null&&n.configs?n.configs:{},r=N(N({},o),s);this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}load(e,n,o=!0){return J(this,null,function*(){function s(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=s(r)?r.data:r,l=this.data;this.data=yield vt(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,o),this.render()})}show(){return J(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 J(this,arguments,function*(e={}){if(!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,n=!0){this.setState({config:e},{userAction:n}),this.render()}setExtraObjectsWith3DPositions(e){!this.data||(this.extraObjects=td(e,this.five,this.data),this.render())}formatData(e){return J(this,null,function*(){return yield vt(e.data)})}_enable(e){const{userAction:n}=e;this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}_show(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("show",{userAction:n}),this.render()}_hide(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n}),this.render()}updateState(e,n){const o=this.state;this.state=N(N({},this.state),e),!qe(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const n=document.querySelector(this.wrapperSelector);this.wrapper=n}if(!this.data||!this.wrapper)return;const e=he(N({},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 Ld({target:this.wrapper,props:e})}}const zd=(i,t)=>new Sd(i,t),Md=[{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"}],Td=[{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"}],Bd=[{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"}],bi=(i,t,e)=>{const n=new E.Matrix4,o=new E.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},jd=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[o,s,r]=e;o&&i.applyMatrix4(bi(o,0,0)),s&&i.applyMatrix4(bi(0,s,0)),r&&i.applyMatrix4(bi(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function va(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s=N({map:o.material.map||{}},t);o.material=new F.MeshBasicMaterial(s),o.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const Qd=(i,t)=>{var u;const e=t.fbx_url||"//vrlab-static.ljcdn.com/release/web/v3/dipan3/dipan.FBX",n=(u=t.north_rad)!=null?u:void 0,o={},s=d=>J(exports,null,function*(){var U;const h=(d==null?void 0:d.fbx_url)||e,p=(U=d==null?void 0:d.north_rad)!=null?U: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 m=i.model.bounding,g=m.max.x-m.min.x,A=m.max.z-m.min.z,v=Math.max(g,A),y=yield new Hr.FBXLoader().loadAsync(h);va(y,{transparent:!0,side:E.DoubleSide,blending:E.AdditiveBlending});const x=[0,p-Math.PI/2,0],{model:{bounding:{max:{x:L,z:C},min:{x:S,y:k,z:G}}}}=i;o.yBase=k;const O={x:(L+S)/2,y:k-1.6,z:(C+G)/2},W=.0045*v;return jd(y,{position:O,rotation:x,scale:W}),o.object=y,!0}),r=({latitude:d})=>{if(!o.object)return;const h=a(d);h&&(o.object.position.y=h)},a=d=>{if(o.yBase===void 0)return;const h=.6;if(d>=Math.PI/4)return o.yBase-(h+1.6);const p=d*(4/Math.PI);return o.yBase-(h*p+1.6)};return{load:s,disable:()=>{!o.object||(i.scene.remove(o.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!o.object)return;const d=a(i.getPose().latitude);d&&(o.object.position.y=d),i.scene.add(o.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function Rd(i,t){var c,u,d,h,p;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(u=t==null?void 0:t.fontSize)!=null?u:e*(35/256)*1.2,o=(d=t==null?void 0:t.backgroundColor)!=null?d:"rgba(0,0,0,0)",s=(h=t==null?void 0:t.fontColor)!=null?h:"#fff",r=(p=t==null?void 0:t.textAlign)!=null?p:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=o,l.fillRect(0,0,e,e),l.font=`${n}px "\u5FAE\u8F6F\u96C5\u9ED1"`,l.textAlign=r,l.fillStyle=s,l.fillText(i,e/2,e*.7),new F.CanvasTexture(a)}const Od=({x:i,y:t,z:e})=>new F.Vector3(i,t,e),Hd=(i,t)=>{var g,A,v;const e={},n=(g=t.animationEnabled)!=null?g:!0,o=(A=t.position)!=null?A:void 0,s=(v=t.rad)!=null?v:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=w=>J(exports,null,function*(){var O,W,U,P,I,z,H,X;const y=(O=w==null?void 0:w.position)!=null?O:o;if(!y)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const x=Od(y),L=(W=w==null?void 0:w.rad)!=null?W:s,C=(U=w==null?void 0:w.fbx_url)!=null?U:r;if(e.rad=L,L===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${L}`));const S=yield new Hr.FBXLoader().loadAsync(C);S.position.copy(x),S.rotation.z=L,S.scale.set(.8,.8,.8),va(S,{transparent:!0,side:E.DoubleSide});const k=(H=(z=(I=(P=S.children)==null?void 0:P[0])==null?void 0:I.children)==null?void 0:z[3])==null?void 0:H.clone();if(!k)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${k}`));const G=(X=t.name)!=null?X:"\u5165\u6237\u95E8";return k.material=new F.MeshBasicMaterial({transparent:!0,map:Rd(G)}),k.renderOrder=3,S.children[0].add(k),e.object=S,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const w=1,y=new F.AnimationMixer(e.object);a.push(y);const x=y.clipAction(e.object.animations[0]);x.timeScale=w;let L;const C=()=>{let O=0,W=0;const U=1e3/30,P=I=>{O=requestAnimationFrame(P);const z=I-W;z<U||(W=I,a.forEach(H=>H.update(z/1e3)),i.needsRender=!0)};return O=requestAnimationFrame(P),()=>{cancelAnimationFrame(O)}},G={play:()=>{L||(x.play(),L=C(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{x.stop(),L==null||L(),L=void 0}};e.animation=G},u=w=>{var x;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((x=w==null?void 0:w.animationEnable)!=null?x:n)&&(e.animation||c(),e.animation.play()),i.scene.add(e.object),i.needsRender=!0},d=()=>{!e.object||(e.animation&&e.animation.stop(),i.scene.remove(e.object),i.needsRender=!0)},h=w=>w==="Floorplan"?u():d();return{load:l,enable:w=>(e.enabled||(e.enabled=!0,h(i.currentMode),i.on("modeChange",h),u(w)),!0),disable:()=>(e.enabled&&(e.enabled=!1,d(),i.off("modeChange",h)),!0)}};class so extends dn.default.Tween{constructor(){super(...arguments);f(this,"disposeMethods",[]);f(this,"animationFrameDisposer");f(this,"onDispose",e=>(this.disposeMethods.push(e),this));f(this,"play",()=>(this.start(0),this.animationFrameDisposer=ci(e=>this.update(e)),this));f(this,"dispose",()=>{var e;this.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this.disposeMethods.forEach(n=>n()),this.disposeMethods=[],dn.default.remove(this)})}}function ba(i,t=dn.default.Easing.Linear.None){const e=new so({progress:0}).to({progress:1});return i!==void 0&&e.duration(i),t!==void 0&&e.easing(t),e}const pn=window.requestAnimationFrame||(i=>setTimeout(i,16)),Fd=window.cancelAnimationFrame||clearTimeout;function li(i,t=0){t<=0?pn(i):pn(()=>li(i,t-1))}function ci(i,t=60){let e=-1,n=0,o=-1;const s=1e3/t;function r(a){o===-1&&(o=a),e=pn(r),!(a-n<s)&&(n=a,i&&i(a-o))}return e=pn(r),function(){Fd(e)}}function Gd(){const i=Date.now();return new Promise(t=>{pn(()=>{t(Date.now()-i)})})}const Nd=ni.Easing;function Wd(i,t,e,n=Nd.Linear.None){const o=new ni.Tween(i).to(t,e).easing(n);li(()=>o.start(0));const s=ci(a=>{o.update(a)===!1&&s()}),r=[];return o.onDestroy=a=>(r.push(a),o),o.destroy=function(){this.stop(),Object.assign(o,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();s()},o}function Xd(i,t){return Wd({progress:0},{progress:1},i,t)}var ya=(i=>(i.Move="Move",i.Rotate="Rotate",i))(ya||{}),Ze=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(Ze||{});const Fn=Math.PI*2;function is(i){return(i%Fn+Fn)%Fn}function os(i){return i%Fn}function yi(i,t,e){return i+(t-i)*e}const Ri=(i,t,e)=>{const n=Math.PI,o=n*2;return i=is(i),t=is(t),e===Ze.Anticlockwise&&i<t&&(i+=o),e===Ze.Clockwise&&t<i&&(t+=o),e===Ze.Loop&&t-i>n?Ri(i,t,Ze.Anticlockwise):e===Ze.Loop&&i-t>n?Ri(i,t,Ze.Clockwise):{from:i,to:t}},Yd=i=>{const t={},e=(l,c,...u)=>J(exports,[l,c,...u],function*(s,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),s.mode&&s.mode!==i.currentMode&&(yield i.changeMode(s.mode)),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(yield i.preloadPano(s.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:yield new Promise((d,h)=>{const p=s.panoIndex!==void 0?s.panoIndex:i.panoIndex;p!==void 0?i.moveToPano(p,Object.assign({duration:r,moveEndCallback:()=>d(!0),moveCancelCallback:()=>h(!1)},s)):h(!1)})}),n=s=>{const r=i.state,a=os(r.latitude),l=os(s.latitude),{from:c,to:u}=Ri(r.longitude,s.longitude,s.rotation||Ze.Loop),d=r.fov,h=s.fov;return{from:{latitude:a,longitude:c,fov:d},to:{latitude:l,longitude:u,fov:h}}};return{move:e,rotate:(l,c,...u)=>J(exports,[l,c,...u],function*(s,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),i.currentMode!==be.Five.Mode.Panorama&&(yield i.changeMode(be.Five.Mode.Panorama)),s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(a.preload&&(yield i.preloadPano(s.panoIndex)),yield new Promise((p,m)=>{if(!s.panoIndex){p(!0);return}i.moveToPano(s.panoIndex,{moveEndCallback:()=>p(!0),moveCancelCallback:()=>m(!1)})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:d,to:h}=n(s);return yield new Promise(p=>{const m=({progress:y})=>{const x={};x.longitude=yi(d.longitude,h.longitude,y),x.latitude=yi(d.latitude,h.latitude,y),x.fov=yi(d.fov,h.fov,y),i.setState(x,!0)},g=()=>{p(!0)},A=()=>{p(!1)},v=s.rotateSpeed?Math.ceil(Math.abs(h.longitude-d.longitude)/s.rotateSpeed*1e3):r,w=Xd(v,ni.Easing.Linear.None).onUpdate(m).onComplete(g).onDestroy(A);s.rotation===Ze.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)},r)})})}};function ss(i,t){return i.x===t.x&&i.y===t.y}function wa(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function Kn(i,t){return(t.y-i.y)/(t.x-i.x)}function Ca(i,t,e){const n=Kn(i[1],i[0]),o=Kn(t[1],t[0]);if(isNaN(n)||isNaN(o)||wa(n,o))return!1;if(In(i[0],t))return i[0];if(In(i[1],t))return i[1];if(In(t[0],i))return t[0];if(In(t[1],i))return t[1];if(e&&!Ud(i,t))return!1;const s=i[0],r=t[0];if(Math.abs(n)===1/0)return{x:s.x,y:t[1].y-(t[1].x-s.x)*o};if(Math.abs(o)===1/0)return{x:r.x,y:i[1].y-(i[1].x-r.x)*n};const a=(r.y-s.y+n*s.x-o*r.x)/(n-o),l=n*a-n*s.x+s.y;return{x:a,y:l}}function In(i,t){return ss(i,t[0])||ss(i,t[1])?!0:(t[0].x-i.x)*(i.x-t[1].x)>=0&&(t[0].y-i.y)*(i.y-t[1].y)>=0&&wa(Kn(t[0],i),Kn(i,t[1]))}function xn(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function Ud(i,t){return Math.max(i[0].x,i[1].x)>=Math.min(t[0].x,t[1].x)&&Math.max(t[0].x,t[1].x)>=Math.min(i[0].x,i[1].x)&&Math.max(i[0].y,i[1].y)>=Math.min(t[0].y,t[1].y)&&xn(t[0],i[1],i[0])*xn(i[1],t[1],i[0])>0&&xn(i[0],t[1],t[0])*xn(t[1],i[1],t[0])>0?1:0}function Ea(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>Ea(i,t-1))}const Vd=`<style type="text/css">
|
|
116
116
|
.PanoRulerPlugin-rule-line {
|
|
117
117
|
position: absolute;
|
|
118
118
|
transform-origin: left center;
|
|
@@ -205,7 +205,7 @@ transition: all 500ms;
|
|
|
205
205
|
<div class="PanoRulerPlugin-rule-label-name">${e.options.distanceText(A)}</div>
|
|
206
206
|
</div>
|
|
207
207
|
</div>
|
|
208
|
-
`,w=document.createElement("div");return w.setAttribute("class","PanoRulerPlugin-rule"),w.setAttribute("data-name",g),w.setAttribute("style","display: none"),w.innerHTML=v,w},o=document.createElement("div");o.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;");const s=document.createElement("div");s.innerHTML=Vd,o.appendChild(s);const r={},a=(g,A)=>{if(e.loaded)throw new Error("\u6807\u5C3A\u88AB\u91CD\u590D\u521D\u59CB\u5316\uFF01");const v=_d(g,i),w=i.work;if(!w)return!1;for(const y in A){const x=A[y],{standingPosition:L}=w.observers[0],C=x.map(({x:S,z:k,observers:G})=>{const O=G.length>0?g.rooms[g.observers[G[0]]].name:"",W=v[O]?v[O].floor:null;let U=1/0,P={index:0,x:L.x,y:L.y,z:L.z};G.forEach(Y=>{if(!w.observers[Y])return;const{standingPosition:V}=w.observers[Y],ue={index:Y,x:V.x,y:V.y,z:V.z},de=Jd({x:S,z:k},ue);W?de<U&&Math.abs(ue.y-W)<.3&&(U=de,P=ue):de<U&&(U=de,P=ue)});const I=new F.Vector3(S,P.y,k);Object.assign(I,{observers:G});const z=v[O]?v[O].roof:null,H=z?new F.Vector3(S,z,k):null;return H&&Object.assign(H,{observers:G}),{origin:I,vertical:H}});r[y]={origins:C.map(S=>S.origin),rules:[]};for(const{origin:S,vertical:k}of C){if(!k)continue;const G=n(y,S.distanceTo(k));o.append(G),r[y].rules.push({vertical:!0,rule:[S,k],$element:G})}for(let S=0;S<C.length;S++){let k=S+1;k>=C.length&&(k=0);const{origin:G}=C[S],{origin:O}=C[k],W=n(y,G.distanceTo(O));o.append(W),r[y].rules.push({vertical:!1,rule:[G,O],$element:W})}}return e.loaded=!0,!0},l=(g,A,v)=>J(exports,null,function*(){const w=g||t.roomInfo,y=A||t.roomRules;if(!w||!y)throw new Error("\u6807\u5C3A\u6570\u636E\u4F9D\u8D56\u4E0D\u9F50\u5168\uFF01");return e.loaded=!1,e.options=N(N({},e.options),v||{}),i.model.loaded?a(w,y):yield new Promise(x=>i.once("modelLoaded",()=>x(a(w,y))))});t.roomInfo&&t.roomRules&&l(t.roomInfo,t.roomRules);const c=(g,A,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}]],x=[];for(let L=0;L<y.length;L++){const C=Ca([g,A],[y[L][0],y[L][1]],!0);C&&x.push(C)}return x.length===0?!1:x},u=()=>{var G;const g=(G=i.getElement())==null?void 0:G.parentElement;if(!g||!e.loaded||Object.keys(r).length<=0)return;const{panoIndex:A,camera:v,currentMode:w}=i;if(A===void 0)return;let y;for(const O in r)O.split(",").indexOf(A.toString())>=0&&(y=O);if(!y){for(const O in r)for(const{$element:W}of r[O].rules)W.style.display="none";return}const x=v.position,L=v.getWorldDirection(new F.Vector3),C=g.clientWidth,S=g.clientHeight;if(w!==be.Five.Mode.Panorama){for(const O in r)for(const{$element:W}of r[O].rules)W.style.display="none";return}for(const O in r)for(const{$element:W}of r[O].rules)W.style.display=O===y?"block":"none";const[k]=r[y].origins.slice().filter(O=>O.observers.indexOf(A)>=0).sort((O,W)=>{const U=O.clone().setY(0).sub(x).normalize().angleTo(L.clone().setY(0)),P=W.clone().setY(0).sub(x).normalize().angleTo(L.clone().setY(0));return U-P});for(const{rule:O,vertical:W,$element:U}of r[y].rules){const[P,I]=O,z=U.querySelector(".PanoRulerPlugin-rule-line");if(!z)return;if(!k){U.style.display="none";continue}if(P!==k&&I!==k){U.style.display="none";continue}if(P.distanceTo(I)<.3){U.style.display="none";continue}if(P.observers.indexOf(A)===-1||I.observers.indexOf(A)===-1){U.style.display="none";continue}if(P.clone().sub(x).normalize().angleTo(L)>Math.PI/2){U.style.display="none";continue}if(I.clone().sub(x).normalize().angleTo(L)>Math.PI/2){U.style.display="none";continue}const Z=P.distanceTo(I);if(I.clone().sub(I.clone().sub(P).divide(new F.Vector3(2,2,2))).distanceTo(x)/Z>8){U.style.display="none";continue}const ue=P.clone().project(v),de=(ue.x+1)/2*C,me=(-ue.y+1)/2*S,Ce=I.clone().project(v),De=(Ce.x+1)/2*C,Re=(-Ce.y+1)/2*S,se=Math.sqrt(Math.pow(De-de,2)+Math.pow(Re-me,2));let ve=se,ye=50;const re=c({x:~~de,y:~~me},{x:~~De,y:~~Re},C,S);if(re&&re.length===1&&(k===P?(ve=Math.sqrt(Math.pow(re[0].x-de,2)+Math.pow(re[0].y-me,2)),ye=ve/se*50):k===I&&(ve=Math.sqrt(Math.pow(re[0].x-De,2)+Math.pow(re[0].y-Re,2)),ye=100-ve/se*50)),re&&re.length===2){const ct={x:(re[0].x+re[1].x)/2,y:(re[0].y+re[1].y)/2};ye=Math.sqrt(Math.pow(ct.x-de,2)+Math.pow(ct.y-me,2))/se*100}const wt=(Math.PI/2-Math.atan2(De-de,me-Re))/Math.PI*180,ge=z.querySelector(".PanoRulerPlugin-rule-label"),lt=ge.children[0].clientWidth;lt>=se||lt/2>=ye/100*se||lt/2>=(1-ye/100)*se?z.style.display="none":(z.style.display="block",z.style.width=se+"px",z.style.left=de+"px",z.style.top=me+"px",z.style.transform=`rotate(${-wt}deg)`,ge.style.left=`${ye}%`)}},d=()=>Ea(u),h=()=>{var g,A;return e.loaded?(e.enable||(o.setAttribute("class","PanoRulerPlugin"+(e.options.className?" "+e.options.className:"")),(A=(g=i.getElement())==null?void 0:g.parentElement)==null||A.append(o),u(),i.on("modeChange",u),i.on("cameraUpdate",d),e.enable=!0),!0):!1},p=()=>(e.enable&&(i.off("modeChange",u),i.off("cameraUpdate",d),o&&o.remove(),e.enable=!1),!0);function m(g){if(g.distanceText&&g.distanceText!==e.options.distanceText){const A=g.distanceText;e.options.distanceText=A,Object.values(r).forEach(v=>{v.rules.forEach(w=>{const[y,x]=w.rule,L=y.distanceTo(x),C=w.$element.querySelector(".PanoRulerPlugin-rule-label-name");!C||(C.innerText=A(L))})})}}return{enable:h,disable:p,load:l,state:e,changeConfigs:m}};function qd(i){ae(i,"svelte-1h27ktp",".PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp{position:absolute;transform-origin:left 0.0625rem;width:0;height:0.125rem;pointer-events:none}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::after{content:'';position:absolute;left:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::before{content:'';position:absolute;right:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1.5s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp em.svelte-1h27ktp{display:block;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;box-shadow:0 0 0.25rem rgb(0 0 0 / 40%);position:relative}.rule-mixed-line.svelte-1h27ktp.svelte-1h27ktp{display:flex;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;align-items:center}.em-solid.svelte-1h27ktp.svelte-1h27ktp{height:100%;background:#ffffff}.em-dotted.svelte-1h27ktp.svelte-1h27ktp{height:0.125rem;background:var(--background-image);background-position:center;background-repeat:repeat}.PanoRulerPlugin-rule-label.svelte-1h27ktp.svelte-1h27ktp{position:absolute;width:0;height:0;top:0.0625rem;pointer-events:none}.PanoRulerPlugin-rule-label-name.svelte-1h27ktp.svelte-1h27ktp{position:absolute;padding:0.1875rem 0.375rem;background:rgba(195, 195, 195, 0.3);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem);border-radius:6.25rem;border:0.0625rem solid rgba(255, 255, 255, 0.6);white-space:nowrap;overflow:hidden;color:#ffffff;font-weight:500;font-size:0.75rem;line-height:1;animation:svelte-1h27ktp-viewport-rule-label 0.25s ease 1s;animation-fill-mode:both;box-shadow:inset 0 0 0.625rem 0 rgba(255, 255, 255, 0.3)}@keyframes svelte-1h27ktp-viewport-rule-line{0%{width:0%}100%{width:100%}}@keyframes svelte-1h27ktp-viewport-rule-label{0%{opacity:0;transform:scaleX(0)}100%{opacity:1;transform:translate(-50%, -50%) scaleX(1)}}@keyframes svelte-1h27ktp-viewport-rule-point{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}")}function rs(i,t,e){const n=i.slice();return n[6]=t[e],n}function Kd(i){let t,e=i[0].children,n=[];for(let o=0;o<e.length;o+=1)n[o]=as(rs(i,e,o));return{c(){t=j("div");for(let o=0;o<n.length;o+=1)n[o].c();b(t,"class","rule-mixed-line svelte-1h27ktp")},m(o,s){B(o,t,s);for(let r=0;r<n.length;r+=1)n[r].m(t,null)},p(o,s){if(s&9){e=o[0].children;let r;for(r=0;r<e.length;r+=1){const a=rs(o,e,r);n[r]?n[r].p(a,s):(n[r]=as(a),n[r].c(),n[r].m(t,null))}for(;r<n.length;r+=1)n[r].d(1);n.length=e.length}},d(o){o&&M(t),tt(n,o)}}}function $d(i){let t,e;return{c(){t=j("em"),b(t,"class",e=Se(i[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),b(t,"style",i[3])},m(n,o){B(n,t,o)},p(n,o){o&1&&e!==(e=Se(n[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&b(t,"class",e),o&8&&b(t,"style",n[3])},d(n){n&&M(t)}}}function as(i){let t,e,n=`${i[6].width}px`;return{c(){t=j("div"),b(t,"class",e=Se(i[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),b(t,"style",i[3]),R(t,"width",n)},m(o,s){B(o,t,s)},p(o,s){s&1&&e!==(e=Se(o[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&b(t,"class",e),s&8&&b(t,"style",o[3]),s&1&&n!==(n=`${o[6].width}px`)&&R(t,"width",n)},d(o){o&&M(t)}}}function eh(i){let t,e,n,o,s=i[0].labelElement+"",r,a,l=`${i[0].labelOffset}%`,c=`${i[0].width}px`,u=`${i[0].left}px`,d=`${i[0].top}px`,h=`rotate(${i[0].rotateDeg}deg)`;function p(A,v){return A[0].children.length===0?$d:Kd}let m=p(i),g=m(i);return{c(){t=j("div"),g.c(),e=_(),n=j("div"),o=j("div"),r=ke(s),b(o,"class","PanoRulerPlugin-rule-label-name svelte-1h27ktp"),xe(()=>i[4].call(o)),b(n,"class","PanoRulerPlugin-rule-label svelte-1h27ktp"),R(n,"left",l),b(t,"class","PanoRulerPlugin-rule-line svelte-1h27ktp"),R(t,"width",c),R(t,"left",u),R(t,"top",d),R(t,"transform",h),R(t,"display",i[0].visible&&i[2]?"block":"none")},m(A,v){B(A,t,v),g.m(t,null),Q(t,e),Q(t,n),Q(n,o),Q(o,r),a=bt(o,i[4].bind(o))},p(A,[v]){m===(m=p(A))&&g?g.p(A,v):(g.d(1),g=m(A),g&&(g.c(),g.m(t,e))),v&1&&s!==(s=A[0].labelElement+"")&&Be(r,s),v&1&&l!==(l=`${A[0].labelOffset}%`)&&R(n,"left",l),v&1&&c!==(c=`${A[0].width}px`)&&R(t,"width",c),v&1&&u!==(u=`${A[0].left}px`)&&R(t,"left",u),v&1&&d!==(d=`${A[0].top}px`)&&R(t,"top",d),v&1&&h!==(h=`rotate(${A[0].rotateDeg}deg)`)&&R(t,"transform",h),v&5&&R(t,"display",A[0].visible&&A[2]?"block":"none")},i:te,o:te,d(A){A&&M(t),g.d(),a()}}}function th(i,t,e){let n,{rulerItemProp:o}=t,s=!0,r,a="data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQiIHdpZHRoPSIxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PGZpbHRlciBpZD0icHJlZml4X19hIiBoZWlnaHQ9IjQwMCUiIHdpZHRoPSIxMzcuNCUiIHg9Ii0xOC43JSIgeT0iLTE1MCUiPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiBvcGVyYXRvcj0iZGlsYXRlIiByYWRpdXM9Ii41IiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSIvPjxmZU9mZnNldCBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSIvPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiByYWRpdXM9IjEiIHJlc3VsdD0ic2hhZG93SW5uZXIiLz48ZmVPZmZzZXQgaW49InNoYWRvd0lubmVyIiByZXN1bHQ9InNoYWRvd0lubmVyIi8+PGZlQ29tcG9zaXRlIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIGluMj0ic2hhZG93SW5uZXIiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIi8+PGZlR2F1c3NpYW5CbHVyIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSIgc3RkRGV2aWF0aW9uPSIuNSIvPjxmZUNvbG9yTWF0cml4IGluPSJzaGFkb3dCbHVyT3V0ZXIxIiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMiAwIi8+PC9maWx0ZXI+PHBhdGggaWQ9InByZWZpeF9fYiIgZD0iTS44ODkgMkgxMS41OCIvPjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1kYXNoYXJyYXk9IjUgNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48dXNlIGZpbGw9IiMwMDAiIGZpbHRlcj0idXJsKCNwcmVmaXhfX2EpIiB4bGluazpocmVmPSIjcHJlZml4X19iIi8+PHVzZSBzdHJva2U9IiNmZmYiIHN0cm9rZS1vcGFjaXR5PSIuNCIgeGxpbms6aHJlZj0iI3ByZWZpeF9fYiIvPjwvZz48L3N2Zz4=";function l(){r=this.offsetWidth,e(1,r)}return i.$$set=c=>{"rulerItemProp"in c&&e(0,o=c.rulerItemProp)},i.$$.update=()=>{i.$$.dirty&3&&(r>=o.width||r/2>=o.labelOffset/100*o.width||r/2>=(1-o.labelOffset/100)*o.width?e(2,s=!1):e(2,s=!0))},e(3,n=`--background-image: url(${a})`),[o,r,s,n,l]}class nh extends oe{constructor(t){super(),ie(this,t,th,eh,ne,{rulerItemProp:0},qd)}}function ls(i,t,e){const n=i.slice();return n[12]=t[e],n}function cs(i){let t,e;return t=new nh({props:{rulerItemProp:i[12]}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.rulerItemProp=n[12]),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function ih(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=cs(ls(i,n,r));const s=r=>T(o[r],1,1,()=>{o[r]=null});return{c(){t=j("div");for(let r=0;r<o.length;r+=1)o[r].c()},m(r,a){B(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&1){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=ls(r,n,l);o[l]?(o[l].p(c,a),D(o[l],1)):(o[l]=cs(c),o[l].c(),D(o[l],1),o[l].m(t,null))}for(le(),l=n.length;l<o.length;l+=1)s(l);ce()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)D(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)T(o[a]);e=!1},d(r){r&&M(t),tt(o,r)}}}function oh(i,t,e){var g,A,v,w;let{five:n}=t,{rulerDatas:o}=t,{options:s}=t,r=[];const a=((A=(g=n.getElement())==null?void 0:g.parentElement)==null?void 0:A.clientWidth)||0,l=((w=(v=n.getElement())==null?void 0:v.parentElement)==null?void 0:w.clientHeight)||0,c=(y,x)=>{const L=[[{x:0,y:0},{x:a,y:0}],[{x:0,y:0},{x:0,y:l}],[{x:a,y:0},{x:a,y:l}],[{x:0,y:l},{x:a,y:l}]],C=[];for(let S=0;S<L.length;S++){const k=Ca([y,x],[L[S][0],L[S][1]],!0);k&&C.push(k)}return C.length===0?!1:C},u=(y,x)=>{const L=y.clone().project(n.camera),C=(L.x+1)/2*a,S=(-L.y+1)/2*l,k=x.clone().project(n.camera),G=(k.x+1)/2*a,O=(-k.y+1)/2*l,W=Math.sqrt(Math.pow(G-C,2)+Math.pow(O-S,2));return{startLeft:C,startTop:S,endLeft:G,endTop:O,distance:W}},d=(y,x,L)=>{const C=n.camera.position,S=n.camera.getWorldDirection(new F.Vector3),k=y.clone().sub(C).normalize().angleTo(S),G=x.clone().sub(C).normalize().angleTo(S),O=y.distanceTo(x),U=x.clone().sub(x.clone().sub(y).divide(new F.Vector3(2,2,2))).distanceTo(C),{startLeft:P,startTop:I,endLeft:z,endTop:H,distance:X}=u(y,x),Y=-((Math.PI/2-Math.atan2(z-P,I-H))/Math.PI)*180;let V=!0;L||(V=!1),!qe(y,L)&&!qe(x,L)&&(V=!1),O<.3&&(V=!1),k>Math.PI/2&&(V=!1),G>Math.PI/2&&(V=!1),U/O>8&&(V=!1);let ue=50,de=X;const me=c({x:~~P,y:~~I},{x:~~z,y:~~H});if(me&&me.length===1&&(qe(y,L)?(de=Math.sqrt(Math.pow(me[0].x-P,2)+Math.pow(me[0].y-I,2)),ue=de/X*50):qe(x,L)&&(de=Math.sqrt(Math.pow(me[0].x-z,2)+Math.pow(me[0].y-H,2)),ue=100-de/X*50)),me&&me.length===2){const Ce={x:(me[0].x+me[1].x)/2,y:(me[0].y+me[1].y)/2};ue=Math.sqrt(Math.pow(Ce.x-P,2)+Math.pow(Ce.y-I,2))/X*100}return{startLeft:P,startTop:I,distance:X,deg:Y,visible:V,labelOffset:ue,ruleLength:O}},h=()=>{const y=n.panoIndex,x=o.find(W=>W.panoIndex===y);if(!x)return e(0,r=[]);if(n.currentMode!==be.Five.Mode.Panorama)return e(0,r=[]);const L=n.camera.position,C=n.camera.getWorldDirection(new F.Vector3),S=x.lines.map(W=>new F.Vector3(W.start[0],-W.start[1],-W.start[2])),k=x.lines.map(W=>new F.Vector3(W.end[0],-W.end[1],-W.end[2])),[G]=S.concat(k).sort((W,U)=>{const P=W.clone().setY(0).sub(L).normalize().angleTo(C.clone().setY(0)),I=U.clone().setY(0).sub(L).normalize().angleTo(C.clone().setY(0));return P-I}),O=x.lines.map(W=>{var de,me;const U=W.start,P=W.end,{startLeft:I,startTop:z,distance:H,deg:X,visible:Z,labelOffset:Y,ruleLength:V}=d(new F.Vector3(U[0],-U[1],-U[2]),new F.Vector3(P[0],-P[1],-P[2]),G),ue=[];return W.children&&((de=W.children)==null?void 0:de.length)>0&&((me=W.children)==null||me.forEach(Ce=>{const De=Ce.start,Re=Ce.end,{distance:se}=u(new F.Vector3(De[0],-De[1],-De[2]),new F.Vector3(Re[0],-Re[1],-Re[2]));ue.push({width:se,state:Ce.state})})),{width:H,left:I,top:z,rotateDeg:X,state:W.state,children:ue,labelOffset:Y,visible:Z,labelElement:s.distanceText(V)}});e(0,r=O)},p=()=>li(h),m=oo(h,80);return Ye(()=>{h(),n.on("panoArrived",h),n.on("modeChange",h),n.on("cameraDirectionUpdate",p),n.on("movingToPano",p),n.on("mouseWheel",()=>m()),n.on("pinchGesture",()=>m())}),yt(()=>{n.off("panoArrived",h),n.off("modeChange",h),n.off("cameraDirectionUpdate",p),n.off("movingToPano",p),n.off("mouseWheel",()=>m()),n.off("pinchGesture",()=>m())}),i.$$set=y=>{"five"in y&&e(1,n=y.five),"rulerDatas"in y&&e(2,o=y.rulerDatas),"options"in y&&e(3,s=y.options)},[r,n,o,s]}class sh extends oe{constructor(t){super(),ie(this,t,oh,ih,ne,{five:1,rulerDatas:2,options:3})}}class rh{constructor(t,e){f(this,"five");f(this,"container",document.createElement("div"));f(this,"panoRulerProData");f(this,"rulerItems");f(this,"state",{enabled:!1,loaded:!1,options:{className:"",distanceText:t=>`${t.toFixed(1)}m`}});var n,o;this.five=t,this.container.classList.add("panoRulerProPlugin-container"),this.container.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;"),e&&(e.data&&this.load(e.data),this.state.options=N(N({},this.state.options),e.options||{}),(n=e.options)!=null&&n.className&&this.container.classList.add((o=e.options)==null?void 0:o.className)),this.five.once("modelLoaded",()=>J(this,null,function*(){var s,r;(r=(s=this.five.getElement())==null?void 0:s.parentNode)==null||r.append(this.container)})),this.five.once("dispose",()=>this.dispose())}load(t){return J(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 J(this,null,function*(){var t;if(this.state.enabled){if(!this.panoRulerProData||!this.container)return;this.rulerItems=new sh({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 ah=(i,t)=>new rh(i,t),lh="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+c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T2pBP1VyaSQiCse9Coqa27LApBIPE+BEKkLwSk32zRHESDkp0zkSDQBALF9uKdYHunnkthwo7tfXQqQjmYSNQImBACIU2xIuGreB8CIdIvAtJzNogMosHI4mYkCDSHgPTUXspU2ItoEIvzEArlxWRvIlGFWTSnsnWF+b1dKAhk8QrrHpEgsDgC0ndi0oNoEBIuiASBZhGQvnqCz/KCJ/jYZtto7DPRoUU2N11LJIXxqNyUC0VFqeCTpRlP94gEgZMhIL0nbDCIdJswQSQINI9AIRRsNRP+KfvOkgNrKEddr5660YUqw3k8EAhkbvsuCztPVSF7JDqMBIF1IKAxcOl5S8eZLEWCQDcIFBtO2Kv2UOr645lAKkex4VeIpLo5jHbls1KD4eYaWIu4R+UeyYLA2RHQWGAADiJ9P9u2StcheRB4VQSkyzgD2PQppwBH4MaEMpBFRSDcqCYQx9ggDphr0QUb3SMSBJpAQGPiciei9P6oYYAmGphKbA4B6TRrJ+j1HKHYzh8cZbpVBowXZ8bgQhzPNJAOvvD4QjkOAj0hUAbdUOVMoHrqudT1OgSk2zgLkAl2n/LYvh9s900kutYV4UIvQiBXMMlBEAgCQWA1CBRCgUjmHAkI5vk+PACR1BcZmGmfH64GzTQkCASBILBhBAqhgEC9rDFGJI7FGJEcB4EgEASCQBAIAkEgCASBIBAEgkAQCAJBIAgEgSAQBIJAEAgCm0fg/x4jQQWGalpFAAAAAElFTkSuQmCC";function ch(){const i=document.createElement("div"),t=document.createElement("i"),e=document.createElement("span");return i.appendChild(t),i.appendChild(e),i.style.position="relative",i.style.width="100%",i.style.display="flex",i.style.flexDirection="column",i.style.alignItems="center",i.style.marginTop=`${150/16}rem`,i.style.opacity="0",i.style.transition="opacity 1000ms linear",t.style.display="block",t.style.width=`${134/16}rem`,t.style.height=`${22/16}rem`,t.style.backgroundSize="100%",t.style.backgroundRepeat="no-repeat",t.style.backgroundImage=`url(${lh})`,e.style.marginTop=`${10/16}rem`,e.style.fontSize=`${16/16}rem`,e.style.color="#fff",e.style.opacity="0.7",e.style.textShadow="0 2px 16px rgb(22 34 83 / 24%)",e.style.fontWeight="bold",{appendTo(n){n.appendChild(i)},dispose(){i.remove()},setRoom(n){e.innerHTML=n.name+" "+Math.floor(n.size/1e6)+"\u33A1"},show(){i.style.opacity="1"},hide(){i.style.opacity="0"}}}const uh=new E.TextureLoader;function us(i){return J(this,null,function*(){return new Promise((t,e)=>{uh.load(i,t,void 0,e)}).then(t=>(t.encoding=E.sRGBEncoding,t))})}const kn={userAction:!0};class dh extends Ht{constructor(e,n){super(e);f(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"}});f(this,"data");f(this,"group",new E.Group);f(this,"roomInfoInstance");f(this,"roomInfoWrapperInstance");f(this,"compassMeshTween");f(this,"compassMesh");f(this,"entryDoorMesh");f(this,"dispose",()=>{var e,n,o,s;this.five.scene.remove(this.group),this.group.remove(...this.group.children),(n=(e=this.compassMesh)==null?void 0:e.material.map)==null||n.dispose(),(s=(o=this.entryDoorMesh)==null?void 0:o.material.map)==null||s.dispose(),this.five.off("dispose",this.dispose),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});f(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)});f(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)});f(this,"_enable",()=>{this.five.scene.add(this.group),this.init(),this.onFivePanoArrived(this.five.panoIndex||0),this._addEventListener()});f(this,"_disable",()=>{this._clearCompassIfNeed(),this._clearEntryDoorIfNeed(),this.five.scene.remove(this.group),this._removeEventListener()});f(this,"_toggleVisible",()=>{this.group.visible=this.state.visible,this.five.needsRender=!0});f(this,"_clearCompassIfNeed",()=>{var e;this.compassMesh&&(this.group.remove(this.compassMesh),(e=this.compassMesh.material.map)==null||e.dispose(),this.compassMesh=null)});f(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)});f(this,"onFivePanoWillArrive",e=>{var n,o;e!==this.five.panoIndex&&((n=this.compassMeshTween)==null||n.dispose(),(o=this.compassMesh)==null||o.material.setValues({opacity:0}))});f(this,"onFivePanoArrived",e=>{var o,s,r,a,l,c,u;const n=(r=(s=(o=this.five.work)==null?void 0:o.observers)==null?void 0:s[e])==null?void 0:r.standingPosition;if(this.compassMesh&&(this.compassMesh.position.copy(n.clone().setY(n.y+.01)),this.compassMesh.material.opacity===0&&((a=this.compassMeshTween)==null||a.dispose(),this.compassMeshTween=ba(1e3).onUpdate(({progress:d})=>{var h;(h=this.compassMesh)==null||h.material.setValues({opacity:d}),this.five.needsRender=!0}).play())),this.entryDoorMesh){const h=new E.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 E.Vector3(0,0,-1).angleTo(h),this.entryDoorMesh.position.copy(p),((l=this.data)==null?void 0:l.room_observers[e].room.type)===1?(c=this.entryDoorMesh)==null||c.material.setValues({opacity:1}):(u=this.entryDoorMesh)==null||u.material.setValues({opacity:0})}this.roomInfoInstance&&this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.css3DObject.position.copy(n.clone().setY(n.y+.01)),this.roomInfoInstance.setRoom(this.data.room_observers[e].room)),this.five.needsRender=!0});f(this,"onFiveCameraDirectionUpdate",({longitude:e,latitude:n})=>{var o,s;!this.roomInfoWrapperInstance||(this.roomInfoWrapperInstance.css3DObject.rotation.z=e,n>.66&&this.five.getCurrentState().mode==="Panorama"?(o=this.roomInfoInstance)==null||o.show():(s=this.roomInfoInstance)==null||s.hide())});f(this,"onFiveModeChange",(e,n,o,s,r)=>{e!==n&&this.setState({visible:e===be.Five.Mode.Panorama},{userAction:r})});this.five.scene.add(this.group),this.five.once("dispose",this.dispose),this.setState({visible:!0,enabled:!0,config:N(N({},this.state.config),n||{})})}enable(e=kn){this.setState({enabled:!0},e)}disable(e=kn){this.setState({enabled:!1},e)}show(e=kn){if(!!this.state.enabled)return this.setState({visible:!0},e),Promise.resolve()}hide(e=kn){if(!!this.state.enabled)return this.setState({visible:!1},e),Promise.resolve()}setState(e,n={userAction:!0}){var s,r;const o=JSON.parse(JSON.stringify(this.state));this.state={visible:(s=e.visible)!=null?s:o.visible,enabled:(r=e.enabled)!=null?r:o.enabled,config:N(N({},o.config),e.config||{})},this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n.userAction}),e.enabled===!0&&(this._enable(),this.hooks.emit("enable",n)),e.enabled===!1&&(this._disable(),this.hooks.emit("disable",n)),e.visible===!1&&(this._toggleVisible(),this.hooks.emit("hide",n)),e.visible===!0&&(this._toggleVisible(),this.hooks.emit("show",n)),e.config&&this.init()}load(e,n,o=!0){return J(this,null,function*(){const s=yield this.formatData(e);JSON.stringify(this.data)!==JSON.stringify(s)&&(this.hooks.emit("dataChange",s,this.data),this.data=N({},s),this.init(),n&&this.setState(n,{userAction:o}),this.hooks.emit("dataLoaded",this.data))})}formatData(e){return e.version&&e.data?Promise.resolve(e.data):Promise.resolve(e)}init(){return J(this,null,function*(){var o,s,r,a;const e=(s=(o=this.data)==null?void 0:o.north_rad)!=null?s:null;this._clearCompassIfNeed(),e!==null&&(this.compassMesh=yield this.loadCompassMesh(),this.compassMesh.rotateX(-Math.PI/2),this.compassMesh.rotateZ(e-Math.PI/2),this.group.add(this.compassMesh));const n=(a=(r=this.data)==null?void 0:r.entrance)!=null?a:null;this._clearEntryDoorIfNeed(),n!==null&&(this.entryDoorMesh=yield this.loadEntryDoorMesh(),this.roomInfoWrapperInstance=this.loadRoomInfo(),this.roomInfoInstance=ch(),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 J(this,null,function*(){const e=this.state.config.compassImageUrl,n=yield us(e),o=new E.CircleGeometry(.7,32),s=new E.MeshBasicMaterial({map:n,transparent:!0,opacity:0,depthTest:!1}),r=new E.Mesh(o,s);return r.name="pano-compass-mesh",r})}loadEntryDoorMesh(){return J(this,null,function*(){const e=this.state.config.entryDoorImageUrl,n=yield us(e),o=new E.PlaneGeometry(.2,.16),s=new E.MeshBasicMaterial({map:n,transparent:!0,opacity:.8,depthTest:!1}),r=new E.Mesh(o,s);return r.name="pano-compass-entry-door",r})}loadRoomInfo(){const e=[new E.Vector3(-.7,0,-.7),new E.Vector3(.7,0,-.7),new E.Vector3(.7,0,.7),new E.Vector3(-.7,0,.7)];return Kt(this.five).create3DDomContainer(e)}}const hh=(i,t)=>new dh(i,t);function Dn(i,t,e){const n=i[t];i[t]=i[e],i[e]=n}function fh(i,t,e){const n=e/2;for(let o=1;o<=n;o++){const s=e-(o-1);for(let r=1;r<=t;r++){const a=(o-1)*t+r-1,l=(s-1)*t+r-1;Dn(i,a*4+0,l*4+0),Dn(i,a*4+1,l*4+1),Dn(i,a*4+2,l*4+2),Dn(i,a*4+3,l*4+3)}}}class Pa{constructor(t,e){f(this,"width");f(this,"height");f(this,"visible",!1);f(this,"hooks",new be.Subscribe);f(this,"contentDom",document.createElement("canvas"));f(this,"five");f(this,"scale");f(this,"wrapper");f(this,"config");f(this,"offset",{x:0,y:0});f(this,"canvas",this.contentDom);f(this,"context");f(this,"renderCenter",new E.Vector3);f(this,"lastPanEvent");f(this,"hammer");f(this,"onPan",t=>{var c,u,d,h;if(!this.wrapper)return;const e=(u=(c=this.lastPanEvent)==null?void 0:c.deltaX)!=null?u:0,n=(h=(d=this.lastPanEvent)==null?void 0:d.deltaY)!=null?h:0,o=t.deltaX-e,s=t.deltaY-n;if(this.lastPanEvent=t,this.hooks.emit("wantsPanGesture",{srcEvent:t,deltaX:o,deltaY:s}))return;const a=this.offset.x+o,l=this.offset.y+s;this.contentDom.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)",this.canvas.style.transform=`translate3d(${a}px, ${l}px, 100px)`,this.offset={x:a,y:l}});f(this,"onPanEnd",t=>{this.lastPanEvent=void 0,this.contentDom.style.boxShadow="none"});var o,s,r;if(!t.renderer)throw new Error("Five Render \u672A\u521D\u59CB\u5316");this.five=t,this.scale=(o=e==null?void 0:e.scale)!=null?o:2,this.width=(s=e==null?void 0:e.width)!=null?s:190,this.height=(r=e==null?void 0:e.height)!=null?r:190,this.config={dragEnabled:(e==null?void 0:e.dragEnabled)||!1,autoFixPCPosition:(e==null?void 0:e.autoFixPCPosition)||!1,initialPosition:(e==null?void 0:e.initialPosition)||{left:"0",top:"0"}};const n=this.canvas.getContext("2d");if(!n)throw new Error("CANNOT CREATE CONTEXT2D");this.context=n,this.config.dragEnabled&&(this.hammer=new gn.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),o=(n.x+1)/2*this.wrapper.clientWidth,s=-(n.x-1)/2*this.wrapper.clientWidth,r=-(n.y-1)/2*this.wrapper.clientHeight;o<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=90+"px"):r<183?(this.canvas.style.top=90+"px",this.canvas.style.left=-t/2+"px"):s<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=-t-90+"px"):(this.canvas.style.left=-t/2+"px",this.canvas.style.top=-e-90+"px"),this.canvas.style.transform=`translate3d(${o}px, ${r}px, 10px)`,this.offset={x:o,y:r}}render(){if(!this.five.renderer||!this.wrapper)return;const{scale:t,context:e,width:n,height:o}=this,s=this.renderCenter.clone().project(this.five.camera),r=this.five.renderer.getSize(new E.Vector2),a=1,l=n/t,c=o/t,u=a*t,d=(s.x+1)/2*r.x,h=(s.y+1)/2*r.y,p=this.five.getPixels(d-l/2,h-l/2,l,c,u),m=Math.floor(n*a),g=Math.floor(o*a);fh(p,m,g);const A=new ImageData(m,g);A.data.set(p),e.putImageData(A,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}}class mh{constructor(t){f(this,"edges",[]);f(this,"five");f(this,"onModelLoaded",()=>{!this.five.model||(this.edges=this.five.model.getEdges())});this.five=t,this.five.model.loaded?this.onModelLoaded():this.five.on("modelLoaded",this.onModelLoaded)}dispose(){}getAdsorbentPoint(t){if(this.edges.length===0)return null;let e=1/0,n;return this.edges.forEach(o=>{const s=o.closestPointToPoint(t.point,!0,new F.Vector3),r=s.distanceTo(t.point);r<e&&(n=s,e=r)}),e>.1?null:n||null}}class Oi{constructor(){f(this,"id",He());f(this,"points",[]);f(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(o=>o!==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 ph=1,gh=3,Ah=new F.Color(16777215),vh=new F.Color(6522623),bh=new F.Color(16777215),yh=new F.Color(6522623),wh=6,Ch=8,Eh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==",Ia=new F.TextureLoader().load(Eh),xa={pointTexture:Ia,pointSize:wh,lineWidth:ph,lineColor:Ah,pointColor:bh,lineRenderOrder:20,pointsRenderOrder:20};he(N({},xa),{dashed:!0});const Ph={pointTexture:Ia,pointSize:Ch,lineWidth:gh,lineColor:vh,pointColor:yh,lineRenderOrder:10,pointsRenderOrder:10};function Ih(i,t,e){var u,d,h,p,m;const n=(u=e==null?void 0:e.lineWidth)!=null?u:2,o=(d=e==null?void 0:e.lineColor)!=null?d:new F.Color(16777215),s=(h=e==null?void 0:e.pointSize)!=null?h:5,r=(p=e==null?void 0:e.lineRenderOrder)!=null?p:10,a=(m=e==null?void 0:e.lineRenderOrder)!=null?m:20,l=new Or.Line(i,t);l.setMaterial({linewidth:n,color:o}),l.line.material.depthTest=!1,l.line.material.transparent=!0,l.line.renderOrder=r,l.points.renderOrder=a;const c=l.points.material;return c.depthTest=!1,c.size=s,e!=null&&e.pointColor&&c.color.set(e.pointColor).convertSRGBToLinear(),e!=null&&e.pointTexture&&(c.map=e.pointTexture),l}function ds(i,t){const[e,n]=i.points,o=t==="light"?Ph:xa,s=Ih(e.position,n.position,o);return s.name="normalLine_"+i.id,s}function Ke(i){const{x:t,y:e,z:n}=i;return!(Math.abs(t)>1||Math.abs(e)>1||Math.abs(n)>1)}function xh(){const i=document.createElement("div");return i.setAttribute("style","backdrop-filter: blur(4px);-webkit-backdrop-filter: blur(4px);"),i.style.padding="3px 6px",i.style.lineHeight="1",i.style.textAlign="center",i.style.transform="translate(-50%, -50%)",i.style.borderRadius="100px",i.style.fontSize="14px",i.style.color="#fff",i.style.background="rgba(195,195,195,0.70)",i.style.border="0.5px solid rgba(255,255,255,0.6)",i.style.pointerEvents="all",i.style.cursor="pointer",i}function kh(i){const t=document.createElement("div");return t.id="distance_"+i.id,t.classList.add("five-plugin-measure__distance"),t.style.opacity="0",t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.transform="translate3d(0, 0, 0)",t.style.transformOrigin="left top",t}function Dh(i){function t(){var m;(m=i.clickCallback)==null||m.call(i,p)}function e(){if(d)return d.highlight();c.style.border="0.5px solid #95AEFF",c.style.background="linear-gradient(90deg, #95AEFF 0%, #6386FF 100%)"}function n(){if(d)return d.unHighlight();c.style.border="0.5px solid rgba(255,255,255,0.6)",c.style.background="rgba(195,195,195,0.70)"}function o(m){const g=m.getElement();if(!g)return;const A=g.clientWidth,v=g.clientHeight;if(a.points.length<2)return;const[w,y]=a.points,x=w.position.clone().project(m.camera),L=y.position.clone().project(m.camera),C=x.clone().lerp(L,.5),S=new F.Vector2(x.x*A,x.y*v),k=new F.Vector2(L.x*A,L.y*v);if((()=>!(Math.abs(x.z)>1||Math.abs(L.z)>1||!Ke(x)&&!Ke(L)||!Ke(C)||S.distanceTo(k)<20))()===!1){u.style.opacity="0",u.style.pointerEvents="none";return}const O=(C.x+1)/2*A,W=-(C.y-1)/2*v,P=-(Math.atan((S.y-k.y)/(S.x-k.x))*180)/Math.PI;u.style.transform=`translate(${O}px, ${W}px) rotate(${P}deg)`,u.style.opacity="1",u.style.pointerEvents="all",d&&d.update({line:a.toCompletelyJson(),polyline:a.getPolyline().toCompletelyJson()});const I=w.position.clone().distanceTo(y.position),z=i.line.model.params.getDistanceText(I);c.innerText!==z&&(c.innerText=z)}function s(m){m.appendChild(u),u.addEventListener("click",t)}function r(){c.removeEventListener("click",t),u.remove()}const{line:a}=i,l=a.id,c=xh(),u=kh(a),d=i.userDistanceItem,h=new F.Vector3(0,0,0),p={lineID:l,ndcPosition:h,update:o,appendTo:s,remove:r,highlight:e,unHighlight:n};return d!=null&&d.element?u.appendChild(d.element):u.appendChild(c),p}class en{constructor(t,e,n){f(this,"id");f(this,"selected",!1);f(this,"type","line");f(this,"model");f(this,"mesh");f(this,"points");f(this,"lightMesh");f(this,"hook");f(this,"distanceItem");f(this,"polyline");if(this.id=He(),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 be.Subscribe,this.points=[t,e],this.mesh=ds(this,"normal"),this.lightMesh=ds(this,"light"),this.distanceItem=Dh({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 Oi;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 en(this.points[0].clone(),this.points[1].clone(),this.model)}}function rn(i,t){for(let e=0,n=t.length;e<n;e++)if(i===t[e])return t.splice(e,1)[0]}class $e{constructor(t){f(this,"id");f(this,"lines");f(this,"position");f(this,"type","point");this.id=He(),this.lines=[],this.position=new F.Vector3,t instanceof F.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){rn(t,this.lines)}clone(){return new $e(this.position)}}class ro{constructor(t){f(this,"lines",[]);f(this,"points",[]);f(this,"params");f(this,"polylines",[]);f(this,"hook",new be.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 o=this.polylines.find(s=>!!s.getNext(t));if(o)o.push(t);else{const s=new Oi;s.push(t),this.polylines.push(s)}this.hook.emit("lineAdded",t)}removeLineByID(t){const e=this.getLineByID(t);e&&this.removeLine(e)}removeLine(t){const e=this.polylines.find(s=>s.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&&rn(e,this.polylines)}const[n,o]=t.points;return n.lines.length===0&&rn(n,this.points),o.lines.length===0&&rn(o,this.points),rn(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:s,position:r})=>{const a=new $e(r);return a.id=s,a}),n=t.lines.map(s=>{const[r,a]=s.points,l=this.getPointByID.call({points:e},r),c=this.getPointByID.call({points:e},a);if(!l||!c)throw new Error("\u7EBF\u4E0A\u7684\u70B9\u4E0D\u5B58\u5728");const u=new en(l,c,this);return u.id=s.id,u}),o=t.polylines.map(s=>{const r=new Oi;return s.lines.forEach(a=>{const l=n.find(({id:c})=>c===a);l&&r.push(l)}),r});return this.points.splice(0,this.points.length,...e),this.lines.splice(0,this.lines.length,...n),this.polylines.splice(0,this.polylines.length,...o),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 Ln=i=>i.preventDefault();class ui{constructor(t){f(this,"model");f(this,"five");f(this,"group");f(this,"config");f(this,"dashed");f(this,"disposed",!1);f(this,"isMobile");f(this,"mouseGroup");f(this,"container");f(this,"fiveHelper");f(this,"hook");f(this,"magnifier");f(this,"userDistanceItemCreator");f(this,"updateDistanceUI",()=>{this.dashed.distanceItem.update(this.five),this.model.lines.forEach(t=>t.distanceItem.update(this.five))});var n,o;this.five=t.five,this.hook=t.hook,this.model=t.model,this.config=t.config,this.magnifier=t.magnifier,this.container=t.container,this.fiveHelper=t.fiveHelper,this.isMobile=(o=(n=t.openParams)==null?void 0:n.isMobile)!=null?o:!1,this.userDistanceItemCreator=t.userDistanceItemCreator,this.group=t.group,this.mouseGroup=t.mouseGroup,this.dashed=new en(new $e([0,0,0]),new $e([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",Ln),e.addEventListener("contextmenu",Ln))}removeLine(t){this.group.remove(t.mesh,t.lightMesh),t.distanceItem.remove(),this.five.needsRender=!0}updateMouseGroup(t,e){if(!t)return this.mouseGroup;const n=this.fiveHelper.getAdsorbentPoint(t),o=n||t.point;if(this.mouseGroup.position.copy(o),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const r=t.face.normal.clone().multiplyScalar(.05),l=t.point.clone().add(r).clone().add(r);this.mouseGroup.lookAt(l)}return this.mouseGroup}dispose(){this.disposed=!0,this.magnifier.remove(),this.model.lines.forEach(e=>this.removeLine(e));const t=this.five.getElement();t&&(t.removeEventListener("touchstart",Ln),t.removeEventListener("contextmenu",Ln))}}function Hi(i){const{x:t,y:e}=i.center,{clientWidth:n,clientHeight:o}=i.target,s=i.target.getBoundingClientRect(),r=new F.Vector2(t,e).sub(new F.Vector2(s.left,s.top)),a=new F.Vector2(r.x/n*2-1,-(r.y/o)*2+1);return{point:r,ndcPoint:a}}function wi(i,t){const e=Hi(t).ndcPoint,n=new F.Raycaster;return n.setFromCamera(e,i.camera),i.model.intersectRaycaster(n)}class Sn extends ui{constructor(e){var o;super(e);f(this,"type","edit");f(this,"pressPoint");f(this,"hasAppendDashed",!1);f(this,"hasAppendMouseGroup",!1);f(this,"fiveElement");f(this,"lastPoint",null);f(this,"hammer");f(this,"onIntersectionUpdate",oo((e,n)=>{var s;this.hasAppendMouseGroup===!1&&(this.group.add(this.mouseGroup),this.magnifier.appendTo(this.container),this.hasAppendMouseGroup=!0);const o=this.updateMouseGroup(e,n).position;(s=this.pressPoint)==null||s.position.copy(o),this.updateDashed(),requestAnimationFrame(()=>this.magnifier.renderWithPoint(this.mouseGroup.position)),this.five.needsRender=!0},20));f(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)});f(this,"onMouseLeave",()=>{this.magnifier.remove(),this.group.remove(this.mouseGroup),this.hasAppendMouseGroup=!1,this.lastPoint&&(this.mouseGroup.position.copy(this.lastPoint.position),this.updateDashed())});f(this,"onLineChanged",()=>{this.hook.emit("editedLineChange",this.model.lines.map(e=>e.toCompletelyJson()))});f(this,"onPress",e=>{const[n]=wi(this.five,e);if(!n||!n.face)return;const o=new $e(n.point);this.pressPoint=o,this.onIntersectionUpdate(n)});f(this,"onPan",e=>{if(!this.pressPoint)return;const[n]=wi(this.five,e);!n||!n.face||this.onIntersectionUpdate(n)});f(this,"onPanEnd",e=>{!this.pressPoint||this.onTap(e)});f(this,"onTap",e=>{this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh)),this.hasAppendDashed=!0;const[n]=wi(this.five,e);this.updateMouseGroup(n);const o=new $e(this.mouseGroup.position),s=this.lastPoint;if(o&&(this.lastPoint=o),o&&s){const r=new en(s,o,this.model);r.distanceItem.appendTo(this.container),this.model.addLine(r),this.group.add(r.mesh),r.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",o.position)});f(this,"onWantsTapGesture",()=>!1);f(this,"onWantsToMoveToPano",()=>!1);f(this,"onWantsPanGesture",()=>this.pressPoint?!1:void 0);f(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});f(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 ro(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 s=new gn.default(n);this.hammer=s,s.on("tap",this.onTap),s.on("pan",this.onPan),s.on("press",this.onPress),s.on("panend",this.onPanEnd)}(o=this.fiveElement)==null||o.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 ao(i,t){const e=i.x-t[0].x,n=i.y-t[0].y,o=t[1].x-t[0].x,s=t[1].y-t[0].y,r=e*o+n*s,a=o*o+s*s,l=r/a;let c,u;return l<0||Lh(t[0],t[1])?(c=t[0].x,u=t[0].y):l>1?(c=t[1].x,u=t[1].y):(c=t[0].x+l*o,u=t[0].y+l*s),new F.Vector2(c,u)}function Lh(i,t){return i.x===t.x&&i.y===t.y}function $n(i){const t=(s,r,a)=>{const l=s.lines.find(u=>u.points.findIndex(({id:h})=>h===s.id)!==r);if(!l)return a;const c=l.points[r];return c?t(c,r,a.concat(l)):a},e=t(i.points[0],1,[]),n=t(i.points[0],0,[]);return e.concat(n)}class Sh extends ui{constructor(e){super(e);f(this,"type","view");f(this,"highlightedLines",[]);f(this,"hammer");f(this,"wantsTapGesture",e=>{if(this.model.lines.length===0)return;const[n]=this.five.model.intersectRaycaster(e);if(!n)return;const o=this.five.camera,s=n.point.clone().project(o),r=this.container.clientWidth,a=this.container.clientHeight,l=new F.Vector2(s.x*r,s.y*a),c=this.model.lines.map(p=>{const[m,g]=p.points,A=m.position.clone().project(o),v=g.position.clone().project(o);if(!Ke(A)&&!Ke(v))return null;const w=new F.Vector2(A.x*r,A.y*a),y=new F.Vector2(v.x*r,v.y*a);return{id:p.id,points:[w,y]}}).filter(p=>!!p);if(c.length===0)return;const d=c.map(p=>{const m=ao(l,p.points);return{id:p.id,distance:m.distanceTo(l)}}).sort((p,m)=>p.distance-m.distance)[0],h=d.distance>20?void 0:this.model.lines.find(({id:p})=>p===d.id);if(this.highlightedLines.length>0&&!h)return this.clearHighlightLines(),!1;if(h)return this.chooseLine(h),!1});f(this,"chooseLine",e=>{const n=$n(e);this.highlightLines(n),this.five.needsRender=!0,this.hook.emit("selectedChange",n.map(o=>o.toCompletelyJson()))});f(this,"lineRemoved",e=>{this.removeLine(e),this.hook.emit("selectedChange",this.model.lines.filter(n=>n.selected).map(n=>n.toCompletelyJson()))});f(this,"onCameraUpdate",()=>{this.updateDistanceUI()});this.model.lines.forEach(o=>{o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),o.hook.on("selected",this.chooseLine),this.group.add(o.mesh)});const n=this.five.getElement();if(n){const o=new gn.default(n);this.hammer=o}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 zh=`
|
|
208
|
+
`,w=document.createElement("div");return w.setAttribute("class","PanoRulerPlugin-rule"),w.setAttribute("data-name",g),w.setAttribute("style","display: none"),w.innerHTML=v,w},o=document.createElement("div");o.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;");const s=document.createElement("div");s.innerHTML=Vd,o.appendChild(s);const r={},a=(g,A)=>{if(e.loaded)throw new Error("\u6807\u5C3A\u88AB\u91CD\u590D\u521D\u59CB\u5316\uFF01");const v=_d(g,i),w=i.work;if(!w)return!1;for(const y in A){const x=A[y],{standingPosition:L}=w.observers[0],C=x.map(({x:S,z:k,observers:G})=>{const O=G.length>0?g.rooms[g.observers[G[0]]].name:"",W=v[O]?v[O].floor:null;let U=1/0,P={index:0,x:L.x,y:L.y,z:L.z};G.forEach(Y=>{if(!w.observers[Y])return;const{standingPosition:V}=w.observers[Y],ue={index:Y,x:V.x,y:V.y,z:V.z},de=Jd({x:S,z:k},ue);W?de<U&&Math.abs(ue.y-W)<.3&&(U=de,P=ue):de<U&&(U=de,P=ue)});const I=new F.Vector3(S,P.y,k);Object.assign(I,{observers:G});const z=v[O]?v[O].roof:null,H=z?new F.Vector3(S,z,k):null;return H&&Object.assign(H,{observers:G}),{origin:I,vertical:H}});r[y]={origins:C.map(S=>S.origin),rules:[]};for(const{origin:S,vertical:k}of C){if(!k)continue;const G=n(y,S.distanceTo(k));o.append(G),r[y].rules.push({vertical:!0,rule:[S,k],$element:G})}for(let S=0;S<C.length;S++){let k=S+1;k>=C.length&&(k=0);const{origin:G}=C[S],{origin:O}=C[k],W=n(y,G.distanceTo(O));o.append(W),r[y].rules.push({vertical:!1,rule:[G,O],$element:W})}}return e.loaded=!0,!0},l=(g,A,v)=>J(exports,null,function*(){const w=g||t.roomInfo,y=A||t.roomRules;if(!w||!y)throw new Error("\u6807\u5C3A\u6570\u636E\u4F9D\u8D56\u4E0D\u9F50\u5168\uFF01");return e.loaded=!1,e.options=N(N({},e.options),v||{}),i.model.loaded?a(w,y):yield new Promise(x=>i.once("modelLoaded",()=>x(a(w,y))))});t.roomInfo&&t.roomRules&&l(t.roomInfo,t.roomRules);const c=(g,A,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}]],x=[];for(let L=0;L<y.length;L++){const C=Ca([g,A],[y[L][0],y[L][1]],!0);C&&x.push(C)}return x.length===0?!1:x},u=()=>{var G;const g=(G=i.getElement())==null?void 0:G.parentElement;if(!g||!e.loaded||Object.keys(r).length<=0)return;const{panoIndex:A,camera:v,currentMode:w}=i;if(A===void 0)return;let y;for(const O in r)O.split(",").indexOf(A.toString())>=0&&(y=O);if(!y){for(const O in r)for(const{$element:W}of r[O].rules)W.style.display="none";return}const x=v.position,L=v.getWorldDirection(new F.Vector3),C=g.clientWidth,S=g.clientHeight;if(w!==be.Five.Mode.Panorama){for(const O in r)for(const{$element:W}of r[O].rules)W.style.display="none";return}for(const O in r)for(const{$element:W}of r[O].rules)W.style.display=O===y?"block":"none";const[k]=r[y].origins.slice().filter(O=>O.observers.indexOf(A)>=0).sort((O,W)=>{const U=O.clone().setY(0).sub(x).normalize().angleTo(L.clone().setY(0)),P=W.clone().setY(0).sub(x).normalize().angleTo(L.clone().setY(0));return U-P});for(const{rule:O,vertical:W,$element:U}of r[y].rules){const[P,I]=O,z=U.querySelector(".PanoRulerPlugin-rule-line");if(!z)return;if(!k){U.style.display="none";continue}if(P!==k&&I!==k){U.style.display="none";continue}if(P.distanceTo(I)<.3){U.style.display="none";continue}if(P.observers.indexOf(A)===-1||I.observers.indexOf(A)===-1){U.style.display="none";continue}if(P.clone().sub(x).normalize().angleTo(L)>Math.PI/2){U.style.display="none";continue}if(I.clone().sub(x).normalize().angleTo(L)>Math.PI/2){U.style.display="none";continue}const Z=P.distanceTo(I);if(I.clone().sub(I.clone().sub(P).divide(new F.Vector3(2,2,2))).distanceTo(x)/Z>8){U.style.display="none";continue}const ue=P.clone().project(v),de=(ue.x+1)/2*C,me=(-ue.y+1)/2*S,Ce=I.clone().project(v),De=(Ce.x+1)/2*C,Re=(-Ce.y+1)/2*S,se=Math.sqrt(Math.pow(De-de,2)+Math.pow(Re-me,2));let ve=se,ye=50;const re=c({x:~~de,y:~~me},{x:~~De,y:~~Re},C,S);if(re&&re.length===1&&(k===P?(ve=Math.sqrt(Math.pow(re[0].x-de,2)+Math.pow(re[0].y-me,2)),ye=ve/se*50):k===I&&(ve=Math.sqrt(Math.pow(re[0].x-De,2)+Math.pow(re[0].y-Re,2)),ye=100-ve/se*50)),re&&re.length===2){const ct={x:(re[0].x+re[1].x)/2,y:(re[0].y+re[1].y)/2};ye=Math.sqrt(Math.pow(ct.x-de,2)+Math.pow(ct.y-me,2))/se*100}const wt=(Math.PI/2-Math.atan2(De-de,me-Re))/Math.PI*180,ge=z.querySelector(".PanoRulerPlugin-rule-label"),lt=ge.children[0].clientWidth;lt>=se||lt/2>=ye/100*se||lt/2>=(1-ye/100)*se?z.style.display="none":(z.style.display="block",z.style.width=se+"px",z.style.left=de+"px",z.style.top=me+"px",z.style.transform=`rotate(${-wt}deg)`,ge.style.left=`${ye}%`)}},d=()=>Ea(u),h=()=>{var g,A;return e.loaded?(e.enable||(o.setAttribute("class","PanoRulerPlugin"+(e.options.className?" "+e.options.className:"")),(A=(g=i.getElement())==null?void 0:g.parentElement)==null||A.append(o),u(),i.on("modeChange",u),i.on("cameraUpdate",d),e.enable=!0),!0):!1},p=()=>(e.enable&&(i.off("modeChange",u),i.off("cameraUpdate",d),o&&o.remove(),e.enable=!1),!0);function m(g){if(g.distanceText&&g.distanceText!==e.options.distanceText){const A=g.distanceText;e.options.distanceText=A,Object.values(r).forEach(v=>{v.rules.forEach(w=>{const[y,x]=w.rule,L=y.distanceTo(x),C=w.$element.querySelector(".PanoRulerPlugin-rule-label-name");!C||(C.innerText=A(L))})})}}return{enable:h,disable:p,load:l,state:e,changeConfigs:m}};function qd(i){ae(i,"svelte-1h27ktp",".PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp{position:absolute;transform-origin:left 0.0625rem;width:0;height:0.125rem;pointer-events:none}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::after{content:'';position:absolute;left:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::before{content:'';position:absolute;right:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1.5s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp em.svelte-1h27ktp{display:block;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;box-shadow:0 0 0.25rem rgb(0 0 0 / 40%);position:relative}.rule-mixed-line.svelte-1h27ktp.svelte-1h27ktp{display:flex;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;align-items:center}.em-solid.svelte-1h27ktp.svelte-1h27ktp{height:100%;background:#ffffff}.em-dotted.svelte-1h27ktp.svelte-1h27ktp{height:0.125rem;background:var(--background-image);background-position:center;background-repeat:repeat}.PanoRulerPlugin-rule-label.svelte-1h27ktp.svelte-1h27ktp{position:absolute;width:0;height:0;top:0.0625rem;pointer-events:none}.PanoRulerPlugin-rule-label-name.svelte-1h27ktp.svelte-1h27ktp{position:absolute;padding:0.1875rem 0.375rem;background:rgba(195, 195, 195, 0.3);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem);border-radius:6.25rem;border:0.0625rem solid rgba(255, 255, 255, 0.6);white-space:nowrap;overflow:hidden;color:#ffffff;font-weight:500;font-size:0.75rem;line-height:1;animation:svelte-1h27ktp-viewport-rule-label 0.25s ease 1s;animation-fill-mode:both;box-shadow:inset 0 0 0.625rem 0 rgba(255, 255, 255, 0.3)}@keyframes svelte-1h27ktp-viewport-rule-line{0%{width:0%}100%{width:100%}}@keyframes svelte-1h27ktp-viewport-rule-label{0%{opacity:0;transform:scaleX(0)}100%{opacity:1;transform:translate(-50%, -50%) scaleX(1)}}@keyframes svelte-1h27ktp-viewport-rule-point{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}")}function rs(i,t,e){const n=i.slice();return n[6]=t[e],n}function Kd(i){let t,e=i[0].children,n=[];for(let o=0;o<e.length;o+=1)n[o]=as(rs(i,e,o));return{c(){t=j("div");for(let o=0;o<n.length;o+=1)n[o].c();b(t,"class","rule-mixed-line svelte-1h27ktp")},m(o,s){B(o,t,s);for(let r=0;r<n.length;r+=1)n[r].m(t,null)},p(o,s){if(s&9){e=o[0].children;let r;for(r=0;r<e.length;r+=1){const a=rs(o,e,r);n[r]?n[r].p(a,s):(n[r]=as(a),n[r].c(),n[r].m(t,null))}for(;r<n.length;r+=1)n[r].d(1);n.length=e.length}},d(o){o&&M(t),tt(n,o)}}}function $d(i){let t,e;return{c(){t=j("em"),b(t,"class",e=je(i[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),b(t,"style",i[3])},m(n,o){B(n,t,o)},p(n,o){o&1&&e!==(e=je(n[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&b(t,"class",e),o&8&&b(t,"style",n[3])},d(n){n&&M(t)}}}function as(i){let t,e,n=`${i[6].width}px`;return{c(){t=j("div"),b(t,"class",e=je(i[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),b(t,"style",i[3]),R(t,"width",n)},m(o,s){B(o,t,s)},p(o,s){s&1&&e!==(e=je(o[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&b(t,"class",e),s&8&&b(t,"style",o[3]),s&1&&n!==(n=`${o[6].width}px`)&&R(t,"width",n)},d(o){o&&M(t)}}}function eh(i){let t,e,n,o,s=i[0].labelElement+"",r,a,l=`${i[0].labelOffset}%`,c=`${i[0].width}px`,u=`${i[0].left}px`,d=`${i[0].top}px`,h=`rotate(${i[0].rotateDeg}deg)`;function p(A,v){return A[0].children.length===0?$d:Kd}let m=p(i),g=m(i);return{c(){t=j("div"),g.c(),e=_(),n=j("div"),o=j("div"),r=ke(s),b(o,"class","PanoRulerPlugin-rule-label-name svelte-1h27ktp"),xe(()=>i[4].call(o)),b(n,"class","PanoRulerPlugin-rule-label svelte-1h27ktp"),R(n,"left",l),b(t,"class","PanoRulerPlugin-rule-line svelte-1h27ktp"),R(t,"width",c),R(t,"left",u),R(t,"top",d),R(t,"transform",h),R(t,"display",i[0].visible&&i[2]?"block":"none")},m(A,v){B(A,t,v),g.m(t,null),Q(t,e),Q(t,n),Q(n,o),Q(o,r),a=bt(o,i[4].bind(o))},p(A,[v]){m===(m=p(A))&&g?g.p(A,v):(g.d(1),g=m(A),g&&(g.c(),g.m(t,e))),v&1&&s!==(s=A[0].labelElement+"")&&Te(r,s),v&1&&l!==(l=`${A[0].labelOffset}%`)&&R(n,"left",l),v&1&&c!==(c=`${A[0].width}px`)&&R(t,"width",c),v&1&&u!==(u=`${A[0].left}px`)&&R(t,"left",u),v&1&&d!==(d=`${A[0].top}px`)&&R(t,"top",d),v&1&&h!==(h=`rotate(${A[0].rotateDeg}deg)`)&&R(t,"transform",h),v&5&&R(t,"display",A[0].visible&&A[2]?"block":"none")},i:te,o:te,d(A){A&&M(t),g.d(),a()}}}function th(i,t,e){let n,{rulerItemProp:o}=t,s=!0,r,a="data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQiIHdpZHRoPSIxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PGZpbHRlciBpZD0icHJlZml4X19hIiBoZWlnaHQ9IjQwMCUiIHdpZHRoPSIxMzcuNCUiIHg9Ii0xOC43JSIgeT0iLTE1MCUiPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiBvcGVyYXRvcj0iZGlsYXRlIiByYWRpdXM9Ii41IiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSIvPjxmZU9mZnNldCBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSIvPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiByYWRpdXM9IjEiIHJlc3VsdD0ic2hhZG93SW5uZXIiLz48ZmVPZmZzZXQgaW49InNoYWRvd0lubmVyIiByZXN1bHQ9InNoYWRvd0lubmVyIi8+PGZlQ29tcG9zaXRlIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIGluMj0ic2hhZG93SW5uZXIiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIi8+PGZlR2F1c3NpYW5CbHVyIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSIgc3RkRGV2aWF0aW9uPSIuNSIvPjxmZUNvbG9yTWF0cml4IGluPSJzaGFkb3dCbHVyT3V0ZXIxIiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMiAwIi8+PC9maWx0ZXI+PHBhdGggaWQ9InByZWZpeF9fYiIgZD0iTS44ODkgMkgxMS41OCIvPjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1kYXNoYXJyYXk9IjUgNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48dXNlIGZpbGw9IiMwMDAiIGZpbHRlcj0idXJsKCNwcmVmaXhfX2EpIiB4bGluazpocmVmPSIjcHJlZml4X19iIi8+PHVzZSBzdHJva2U9IiNmZmYiIHN0cm9rZS1vcGFjaXR5PSIuNCIgeGxpbms6aHJlZj0iI3ByZWZpeF9fYiIvPjwvZz48L3N2Zz4=";function l(){r=this.offsetWidth,e(1,r)}return i.$$set=c=>{"rulerItemProp"in c&&e(0,o=c.rulerItemProp)},i.$$.update=()=>{i.$$.dirty&3&&(r>=o.width||r/2>=o.labelOffset/100*o.width||r/2>=(1-o.labelOffset/100)*o.width?e(2,s=!1):e(2,s=!0))},e(3,n=`--background-image: url(${a})`),[o,r,s,n,l]}class nh extends oe{constructor(t){super(),ie(this,t,th,eh,ne,{rulerItemProp:0},qd)}}function ls(i,t,e){const n=i.slice();return n[12]=t[e],n}function cs(i){let t,e;return t=new nh({props:{rulerItemProp:i[12]}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.rulerItemProp=n[12]),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function ih(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=cs(ls(i,n,r));const s=r=>T(o[r],1,1,()=>{o[r]=null});return{c(){t=j("div");for(let r=0;r<o.length;r+=1)o[r].c()},m(r,a){B(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&1){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=ls(r,n,l);o[l]?(o[l].p(c,a),D(o[l],1)):(o[l]=cs(c),o[l].c(),D(o[l],1),o[l].m(t,null))}for(le(),l=n.length;l<o.length;l+=1)s(l);ce()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)D(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)T(o[a]);e=!1},d(r){r&&M(t),tt(o,r)}}}function oh(i,t,e){var g,A,v,w;let{five:n}=t,{rulerDatas:o}=t,{options:s}=t,r=[];const a=((A=(g=n.getElement())==null?void 0:g.parentElement)==null?void 0:A.clientWidth)||0,l=((w=(v=n.getElement())==null?void 0:v.parentElement)==null?void 0:w.clientHeight)||0,c=(y,x)=>{const L=[[{x:0,y:0},{x:a,y:0}],[{x:0,y:0},{x:0,y:l}],[{x:a,y:0},{x:a,y:l}],[{x:0,y:l},{x:a,y:l}]],C=[];for(let S=0;S<L.length;S++){const k=Ca([y,x],[L[S][0],L[S][1]],!0);k&&C.push(k)}return C.length===0?!1:C},u=(y,x)=>{const L=y.clone().project(n.camera),C=(L.x+1)/2*a,S=(-L.y+1)/2*l,k=x.clone().project(n.camera),G=(k.x+1)/2*a,O=(-k.y+1)/2*l,W=Math.sqrt(Math.pow(G-C,2)+Math.pow(O-S,2));return{startLeft:C,startTop:S,endLeft:G,endTop:O,distance:W}},d=(y,x,L)=>{const C=n.camera.position,S=n.camera.getWorldDirection(new F.Vector3),k=y.clone().sub(C).normalize().angleTo(S),G=x.clone().sub(C).normalize().angleTo(S),O=y.distanceTo(x),U=x.clone().sub(x.clone().sub(y).divide(new F.Vector3(2,2,2))).distanceTo(C),{startLeft:P,startTop:I,endLeft:z,endTop:H,distance:X}=u(y,x),Y=-((Math.PI/2-Math.atan2(z-P,I-H))/Math.PI)*180;let V=!0;L||(V=!1),!qe(y,L)&&!qe(x,L)&&(V=!1),O<.3&&(V=!1),k>Math.PI/2&&(V=!1),G>Math.PI/2&&(V=!1),U/O>8&&(V=!1);let ue=50,de=X;const me=c({x:~~P,y:~~I},{x:~~z,y:~~H});if(me&&me.length===1&&(qe(y,L)?(de=Math.sqrt(Math.pow(me[0].x-P,2)+Math.pow(me[0].y-I,2)),ue=de/X*50):qe(x,L)&&(de=Math.sqrt(Math.pow(me[0].x-z,2)+Math.pow(me[0].y-H,2)),ue=100-de/X*50)),me&&me.length===2){const Ce={x:(me[0].x+me[1].x)/2,y:(me[0].y+me[1].y)/2};ue=Math.sqrt(Math.pow(Ce.x-P,2)+Math.pow(Ce.y-I,2))/X*100}return{startLeft:P,startTop:I,distance:X,deg:Y,visible:V,labelOffset:ue,ruleLength:O}},h=()=>{const y=n.panoIndex,x=o.find(W=>W.panoIndex===y);if(!x)return e(0,r=[]);if(n.currentMode!==be.Five.Mode.Panorama)return e(0,r=[]);const L=n.camera.position,C=n.camera.getWorldDirection(new F.Vector3),S=x.lines.map(W=>new F.Vector3(W.start[0],-W.start[1],-W.start[2])),k=x.lines.map(W=>new F.Vector3(W.end[0],-W.end[1],-W.end[2])),[G]=S.concat(k).sort((W,U)=>{const P=W.clone().setY(0).sub(L).normalize().angleTo(C.clone().setY(0)),I=U.clone().setY(0).sub(L).normalize().angleTo(C.clone().setY(0));return P-I}),O=x.lines.map(W=>{var de,me;const U=W.start,P=W.end,{startLeft:I,startTop:z,distance:H,deg:X,visible:Z,labelOffset:Y,ruleLength:V}=d(new F.Vector3(U[0],-U[1],-U[2]),new F.Vector3(P[0],-P[1],-P[2]),G),ue=[];return W.children&&((de=W.children)==null?void 0:de.length)>0&&((me=W.children)==null||me.forEach(Ce=>{const De=Ce.start,Re=Ce.end,{distance:se}=u(new F.Vector3(De[0],-De[1],-De[2]),new F.Vector3(Re[0],-Re[1],-Re[2]));ue.push({width:se,state:Ce.state})})),{width:H,left:I,top:z,rotateDeg:X,state:W.state,children:ue,labelOffset:Y,visible:Z,labelElement:s.distanceText(V)}});e(0,r=O)},p=()=>li(h),m=oo(h,80);return Ye(()=>{h(),n.on("panoArrived",h),n.on("modeChange",h),n.on("cameraDirectionUpdate",p),n.on("movingToPano",p),n.on("mouseWheel",()=>m()),n.on("pinchGesture",()=>m())}),yt(()=>{n.off("panoArrived",h),n.off("modeChange",h),n.off("cameraDirectionUpdate",p),n.off("movingToPano",p),n.off("mouseWheel",()=>m()),n.off("pinchGesture",()=>m())}),i.$$set=y=>{"five"in y&&e(1,n=y.five),"rulerDatas"in y&&e(2,o=y.rulerDatas),"options"in y&&e(3,s=y.options)},[r,n,o,s]}class sh extends oe{constructor(t){super(),ie(this,t,oh,ih,ne,{five:1,rulerDatas:2,options:3})}}class rh{constructor(t,e){f(this,"five");f(this,"container",document.createElement("div"));f(this,"panoRulerProData");f(this,"rulerItems");f(this,"state",{enabled:!1,loaded:!1,options:{className:"",distanceText:t=>`${t.toFixed(1)}m`}});var n,o;this.five=t,this.container.classList.add("panoRulerProPlugin-container"),this.container.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;"),e&&(e.data&&this.load(e.data),this.state.options=N(N({},this.state.options),e.options||{}),(n=e.options)!=null&&n.className&&this.container.classList.add((o=e.options)==null?void 0:o.className)),this.five.once("modelLoaded",()=>J(this,null,function*(){var s,r;(r=(s=this.five.getElement())==null?void 0:s.parentNode)==null||r.append(this.container)})),this.five.once("dispose",()=>this.dispose())}load(t){return J(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 J(this,null,function*(){var t;if(this.state.enabled){if(!this.panoRulerProData||!this.container)return;this.rulerItems=new sh({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 ah=(i,t)=>new rh(i,t),lh="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+cznVLwMf31Uypz7jZLJ0GEy8jqURnl8zPjy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wSk32zRHESDkp0zkSDQBALF9uKdYHunnkthwo7tfXQqQjmYSNQImBACIU2xIuGreB8CIdIvAtJzNogMosHI4mYkCDSHgPTUXspU2ItoEIvzEArlxWRvIlGFWTSnsnWF+b1dKAhk8QrrHpEgsDgC0ndi0oNoEBIuiASBZhGQvnqCz/KCJ/jYZtto7DPRoUU2N11LJIXxqNyUC0VFqeCTpRlP94gEgZMhIL0nbDCIdJswQSQINI9AIRRsNRP+KfvOkgNrKEddr5660YUqw3k8EAhkbvsuCztPVSF7JDqMBIF1IKAxcOl5S8eZLEWCQDcIFBtO2Kv2UOr645lAKkex4VeIpLo5jHbls1KD4eYaWIu4R+UeyYLA2RHQWGAADiJ9P9u2StcheRB4VQSkyzgD2PQppwBH4MaEMpBFRSDcqCYQx9ggDphr0QUb3SMSBJpAQGPiciei9P6oYYAmGphKbA4B6TRrJ+j1HKHYzh8cZbpVBowXZ8bgQhzPNJAOvvD4QjkOAj0hUAbdUOVMoHrqudT1OgSk2zgLkAl2n/LYvh9s900kutYV4UIvQiBXMMlBEAgCQWA1CBRCgUjmHAkI5vk+PACR1BcZmGmfH64GzTQkCASBILBhBAqhgEC9rDFGJI7FGJEcB4EgEASCQBAIAkEgCASBIBAEgkAQCAJBIAgEgSAQBIJAEAgCm0fg/x4jQQWGalpFAAAAAElFTkSuQmCC";function ch(){const i=document.createElement("div"),t=document.createElement("i"),e=document.createElement("span");return i.appendChild(t),i.appendChild(e),i.style.position="relative",i.style.width="100%",i.style.display="flex",i.style.flexDirection="column",i.style.alignItems="center",i.style.marginTop=`${150/16}rem`,i.style.opacity="0",i.style.transition="opacity 1000ms linear",t.style.display="block",t.style.width=`${134/16}rem`,t.style.height=`${22/16}rem`,t.style.backgroundSize="100%",t.style.backgroundRepeat="no-repeat",t.style.backgroundImage=`url(${lh})`,e.style.marginTop=`${10/16}rem`,e.style.fontSize=`${16/16}rem`,e.style.color="#fff",e.style.opacity="0.7",e.style.textShadow="0 2px 16px rgb(22 34 83 / 24%)",e.style.fontWeight="bold",{appendTo(n){n.appendChild(i)},dispose(){i.remove()},setRoom(n){e.innerHTML=n.name+" "+Math.floor(n.size/1e6)+"\u33A1"},show(){i.style.opacity="1"},hide(){i.style.opacity="0"}}}const uh=new E.TextureLoader;function us(i){return J(this,null,function*(){return new Promise((t,e)=>{uh.load(i,t,void 0,e)}).then(t=>(t.encoding=E.sRGBEncoding,t))})}const kn={userAction:!0};class dh extends Ht{constructor(e,n){super(e);f(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"}});f(this,"data");f(this,"group",new E.Group);f(this,"roomInfoInstance");f(this,"roomInfoWrapperInstance");f(this,"compassMeshTween");f(this,"compassMesh");f(this,"entryDoorMesh");f(this,"dispose",()=>{var e,n,o,s;this.five.scene.remove(this.group),this.group.remove(...this.group.children),(n=(e=this.compassMesh)==null?void 0:e.material.map)==null||n.dispose(),(s=(o=this.entryDoorMesh)==null?void 0:o.material.map)==null||s.dispose(),this.five.off("dispose",this.dispose),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});f(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)});f(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)});f(this,"_enable",()=>{this.five.scene.add(this.group),this.init(),this.onFivePanoArrived(this.five.panoIndex||0),this._addEventListener()});f(this,"_disable",()=>{this._clearCompassIfNeed(),this._clearEntryDoorIfNeed(),this.five.scene.remove(this.group),this._removeEventListener()});f(this,"_toggleVisible",()=>{this.group.visible=this.state.visible,this.five.needsRender=!0});f(this,"_clearCompassIfNeed",()=>{var e;this.compassMesh&&(this.group.remove(this.compassMesh),(e=this.compassMesh.material.map)==null||e.dispose(),this.compassMesh=null)});f(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)});f(this,"onFivePanoWillArrive",e=>{var n,o;e!==this.five.panoIndex&&((n=this.compassMeshTween)==null||n.dispose(),(o=this.compassMesh)==null||o.material.setValues({opacity:0}))});f(this,"onFivePanoArrived",e=>{var o,s,r,a,l,c,u;const n=(r=(s=(o=this.five.work)==null?void 0:o.observers)==null?void 0:s[e])==null?void 0:r.standingPosition;if(this.compassMesh&&(this.compassMesh.position.copy(n.clone().setY(n.y+.01)),this.compassMesh.material.opacity===0&&((a=this.compassMeshTween)==null||a.dispose(),this.compassMeshTween=ba(1e3).onUpdate(({progress:d})=>{var h;(h=this.compassMesh)==null||h.material.setValues({opacity:d}),this.five.needsRender=!0}).play())),this.entryDoorMesh){const h=new E.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 E.Vector3(0,0,-1).angleTo(h),this.entryDoorMesh.position.copy(p),((l=this.data)==null?void 0:l.room_observers[e].room.type)===1?(c=this.entryDoorMesh)==null||c.material.setValues({opacity:1}):(u=this.entryDoorMesh)==null||u.material.setValues({opacity:0})}this.roomInfoInstance&&this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.css3DObject.position.copy(n.clone().setY(n.y+.01)),this.roomInfoInstance.setRoom(this.data.room_observers[e].room)),this.five.needsRender=!0});f(this,"onFiveCameraDirectionUpdate",({longitude:e,latitude:n})=>{var o,s;!this.roomInfoWrapperInstance||(this.roomInfoWrapperInstance.css3DObject.rotation.z=e,n>.66&&this.five.getCurrentState().mode==="Panorama"?(o=this.roomInfoInstance)==null||o.show():(s=this.roomInfoInstance)==null||s.hide())});f(this,"onFiveModeChange",(e,n,o,s,r)=>{e!==n&&this.setState({visible:e===be.Five.Mode.Panorama},{userAction:r})});this.five.scene.add(this.group),this.five.once("dispose",this.dispose),this.setState({visible:!0,enabled:!0,config:N(N({},this.state.config),n||{})})}enable(e=kn){this.setState({enabled:!0},e)}disable(e=kn){this.setState({enabled:!1},e)}show(e=kn){if(!!this.state.enabled)return this.setState({visible:!0},e),Promise.resolve()}hide(e=kn){if(!!this.state.enabled)return this.setState({visible:!1},e),Promise.resolve()}setState(e,n={userAction:!0}){var s,r;const o=JSON.parse(JSON.stringify(this.state));this.state={visible:(s=e.visible)!=null?s:o.visible,enabled:(r=e.enabled)!=null?r:o.enabled,config:N(N({},o.config),e.config||{})},this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n.userAction}),e.enabled===!0&&(this._enable(),this.hooks.emit("enable",n)),e.enabled===!1&&(this._disable(),this.hooks.emit("disable",n)),e.visible===!1&&(this._toggleVisible(),this.hooks.emit("hide",n)),e.visible===!0&&(this._toggleVisible(),this.hooks.emit("show",n)),e.config&&this.init()}load(e,n,o=!0){return J(this,null,function*(){const s=yield this.formatData(e);JSON.stringify(this.data)!==JSON.stringify(s)&&(this.hooks.emit("dataChange",s,this.data),this.data=N({},s),this.init(),n&&this.setState(n,{userAction:o}),this.hooks.emit("dataLoaded",this.data))})}formatData(e){return e.version&&e.data?Promise.resolve(e.data):Promise.resolve(e)}init(){return J(this,null,function*(){var o,s,r,a;const e=(s=(o=this.data)==null?void 0:o.north_rad)!=null?s:null;this._clearCompassIfNeed(),e!==null&&(this.compassMesh=yield this.loadCompassMesh(),this.compassMesh.rotateX(-Math.PI/2),this.compassMesh.rotateZ(e-Math.PI/2),this.group.add(this.compassMesh));const n=(a=(r=this.data)==null?void 0:r.entrance)!=null?a:null;this._clearEntryDoorIfNeed(),n!==null&&(this.entryDoorMesh=yield this.loadEntryDoorMesh(),this.roomInfoWrapperInstance=this.loadRoomInfo(),this.roomInfoInstance=ch(),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 J(this,null,function*(){const e=this.state.config.compassImageUrl,n=yield us(e),o=new E.CircleGeometry(.7,32),s=new E.MeshBasicMaterial({map:n,transparent:!0,opacity:0,depthTest:!1}),r=new E.Mesh(o,s);return r.name="pano-compass-mesh",r})}loadEntryDoorMesh(){return J(this,null,function*(){const e=this.state.config.entryDoorImageUrl,n=yield us(e),o=new E.PlaneGeometry(.2,.16),s=new E.MeshBasicMaterial({map:n,transparent:!0,opacity:.8,depthTest:!1}),r=new E.Mesh(o,s);return r.name="pano-compass-entry-door",r})}loadRoomInfo(){const e=[new E.Vector3(-.7,0,-.7),new E.Vector3(.7,0,-.7),new E.Vector3(.7,0,.7),new E.Vector3(-.7,0,.7)];return Kt(this.five).create3DDomContainer(e)}}const hh=(i,t)=>new dh(i,t);function Dn(i,t,e){const n=i[t];i[t]=i[e],i[e]=n}function fh(i,t,e){const n=e/2;for(let o=1;o<=n;o++){const s=e-(o-1);for(let r=1;r<=t;r++){const a=(o-1)*t+r-1,l=(s-1)*t+r-1;Dn(i,a*4+0,l*4+0),Dn(i,a*4+1,l*4+1),Dn(i,a*4+2,l*4+2),Dn(i,a*4+3,l*4+3)}}}class Pa{constructor(t,e){f(this,"width");f(this,"height");f(this,"visible",!1);f(this,"hooks",new be.Subscribe);f(this,"contentDom",document.createElement("canvas"));f(this,"five");f(this,"scale");f(this,"wrapper");f(this,"config");f(this,"offset",{x:0,y:0});f(this,"canvas",this.contentDom);f(this,"context");f(this,"renderCenter",new E.Vector3);f(this,"lastPanEvent");f(this,"hammer");f(this,"onPan",t=>{var c,u,d,h;if(!this.wrapper)return;const e=(u=(c=this.lastPanEvent)==null?void 0:c.deltaX)!=null?u:0,n=(h=(d=this.lastPanEvent)==null?void 0:d.deltaY)!=null?h:0,o=t.deltaX-e,s=t.deltaY-n;if(this.lastPanEvent=t,this.hooks.emit("wantsPanGesture",{srcEvent:t,deltaX:o,deltaY:s}))return;const a=this.offset.x+o,l=this.offset.y+s;this.contentDom.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)",this.canvas.style.transform=`translate3d(${a}px, ${l}px, 100px)`,this.offset={x:a,y:l}});f(this,"onPanEnd",t=>{this.lastPanEvent=void 0,this.contentDom.style.boxShadow="none"});var o,s,r;if(!t.renderer)throw new Error("Five Render \u672A\u521D\u59CB\u5316");this.five=t,this.scale=(o=e==null?void 0:e.scale)!=null?o:2,this.width=(s=e==null?void 0:e.width)!=null?s:190,this.height=(r=e==null?void 0:e.height)!=null?r:190,this.config={dragEnabled:(e==null?void 0:e.dragEnabled)||!1,autoFixPCPosition:(e==null?void 0:e.autoFixPCPosition)||!1,initialPosition:(e==null?void 0:e.initialPosition)||{left:"0",top:"0"}};const n=this.canvas.getContext("2d");if(!n)throw new Error("CANNOT CREATE CONTEXT2D");this.context=n,this.config.dragEnabled&&(this.hammer=new gn.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),o=(n.x+1)/2*this.wrapper.clientWidth,s=-(n.x-1)/2*this.wrapper.clientWidth,r=-(n.y-1)/2*this.wrapper.clientHeight;o<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=90+"px"):r<183?(this.canvas.style.top=90+"px",this.canvas.style.left=-t/2+"px"):s<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=-t-90+"px"):(this.canvas.style.left=-t/2+"px",this.canvas.style.top=-e-90+"px"),this.canvas.style.transform=`translate3d(${o}px, ${r}px, 10px)`,this.offset={x:o,y:r}}render(){if(!this.five.renderer||!this.wrapper)return;const{scale:t,context:e,width:n,height:o}=this,s=this.renderCenter.clone().project(this.five.camera),r=this.five.renderer.getSize(new E.Vector2),a=1,l=n/t,c=o/t,u=a*t,d=(s.x+1)/2*r.x,h=(s.y+1)/2*r.y,p=this.five.getPixels(d-l/2,h-l/2,l,c,u),m=Math.floor(n*a),g=Math.floor(o*a);fh(p,m,g);const A=new ImageData(m,g);A.data.set(p),e.putImageData(A,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}}class mh{constructor(t){f(this,"edges",[]);f(this,"five");f(this,"onModelLoaded",()=>{!this.five.model||(this.edges=this.five.model.getEdges())});this.five=t,this.five.model.loaded?this.onModelLoaded():this.five.on("modelLoaded",this.onModelLoaded)}dispose(){}getAdsorbentPoint(t){if(this.edges.length===0)return null;let e=1/0,n;return this.edges.forEach(o=>{const s=o.closestPointToPoint(t.point,!0,new F.Vector3),r=s.distanceTo(t.point);r<e&&(n=s,e=r)}),e>.1?null:n||null}}class Oi{constructor(){f(this,"id",He());f(this,"points",[]);f(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(o=>o!==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 ph=1,gh=3,Ah=new F.Color(16777215),vh=new F.Color(6522623),bh=new F.Color(16777215),yh=new F.Color(6522623),wh=6,Ch=8,Eh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==",Ia=new F.TextureLoader().load(Eh),xa={pointTexture:Ia,pointSize:wh,lineWidth:ph,lineColor:Ah,pointColor:bh,lineRenderOrder:20,pointsRenderOrder:20};he(N({},xa),{dashed:!0});const Ph={pointTexture:Ia,pointSize:Ch,lineWidth:gh,lineColor:vh,pointColor:yh,lineRenderOrder:10,pointsRenderOrder:10};function Ih(i,t,e){var u,d,h,p,m;const n=(u=e==null?void 0:e.lineWidth)!=null?u:2,o=(d=e==null?void 0:e.lineColor)!=null?d:new F.Color(16777215),s=(h=e==null?void 0:e.pointSize)!=null?h:5,r=(p=e==null?void 0:e.lineRenderOrder)!=null?p:10,a=(m=e==null?void 0:e.lineRenderOrder)!=null?m:20,l=new Or.Line(i,t);l.setMaterial({linewidth:n,color:o}),l.line.material.depthTest=!1,l.line.material.transparent=!0,l.line.renderOrder=r,l.points.renderOrder=a;const c=l.points.material;return c.depthTest=!1,c.size=s,e!=null&&e.pointColor&&c.color.set(e.pointColor).convertSRGBToLinear(),e!=null&&e.pointTexture&&(c.map=e.pointTexture),l}function ds(i,t){const[e,n]=i.points,o=t==="light"?Ph:xa,s=Ih(e.position,n.position,o);return s.name="normalLine_"+i.id,s}function Ke(i){const{x:t,y:e,z:n}=i;return!(Math.abs(t)>1||Math.abs(e)>1||Math.abs(n)>1)}function xh(){const i=document.createElement("div");return i.setAttribute("style","backdrop-filter: blur(4px);-webkit-backdrop-filter: blur(4px);"),i.style.padding="3px 6px",i.style.lineHeight="1",i.style.textAlign="center",i.style.transform="translate(-50%, -50%)",i.style.borderRadius="100px",i.style.fontSize="14px",i.style.color="#fff",i.style.background="rgba(195,195,195,0.70)",i.style.border="0.5px solid rgba(255,255,255,0.6)",i.style.pointerEvents="all",i.style.cursor="pointer",i}function kh(i){const t=document.createElement("div");return t.id="distance_"+i.id,t.classList.add("five-plugin-measure__distance"),t.style.opacity="0",t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.transform="translate3d(0, 0, 0)",t.style.transformOrigin="left top",t}function Dh(i){function t(){var m;(m=i.clickCallback)==null||m.call(i,p)}function e(){if(d)return d.highlight();c.style.border="0.5px solid #95AEFF",c.style.background="linear-gradient(90deg, #95AEFF 0%, #6386FF 100%)"}function n(){if(d)return d.unHighlight();c.style.border="0.5px solid rgba(255,255,255,0.6)",c.style.background="rgba(195,195,195,0.70)"}function o(m){const g=m.getElement();if(!g)return;const A=g.clientWidth,v=g.clientHeight;if(a.points.length<2)return;const[w,y]=a.points,x=w.position.clone().project(m.camera),L=y.position.clone().project(m.camera),C=x.clone().lerp(L,.5),S=new F.Vector2(x.x*A,x.y*v),k=new F.Vector2(L.x*A,L.y*v);if((()=>!(Math.abs(x.z)>1||Math.abs(L.z)>1||!Ke(x)&&!Ke(L)||!Ke(C)||S.distanceTo(k)<20))()===!1){u.style.opacity="0",u.style.pointerEvents="none";return}const O=(C.x+1)/2*A,W=-(C.y-1)/2*v,P=-(Math.atan((S.y-k.y)/(S.x-k.x))*180)/Math.PI;u.style.transform=`translate(${O}px, ${W}px) rotate(${P}deg)`,u.style.opacity="1",u.style.pointerEvents="all",d&&d.update({line:a.toCompletelyJson(),polyline:a.getPolyline().toCompletelyJson()});const I=w.position.clone().distanceTo(y.position),z=i.line.model.params.getDistanceText(I);c.innerText!==z&&(c.innerText=z)}function s(m){m.appendChild(u),u.addEventListener("click",t)}function r(){c.removeEventListener("click",t),u.remove()}const{line:a}=i,l=a.id,c=xh(),u=kh(a),d=i.userDistanceItem,h=new F.Vector3(0,0,0),p={lineID:l,ndcPosition:h,update:o,appendTo:s,remove:r,highlight:e,unHighlight:n};return d!=null&&d.element?u.appendChild(d.element):u.appendChild(c),p}class en{constructor(t,e,n){f(this,"id");f(this,"selected",!1);f(this,"type","line");f(this,"model");f(this,"mesh");f(this,"points");f(this,"lightMesh");f(this,"hook");f(this,"distanceItem");f(this,"polyline");if(this.id=He(),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 be.Subscribe,this.points=[t,e],this.mesh=ds(this,"normal"),this.lightMesh=ds(this,"light"),this.distanceItem=Dh({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 Oi;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 en(this.points[0].clone(),this.points[1].clone(),this.model)}}function rn(i,t){for(let e=0,n=t.length;e<n;e++)if(i===t[e])return t.splice(e,1)[0]}class $e{constructor(t){f(this,"id");f(this,"lines");f(this,"position");f(this,"type","point");this.id=He(),this.lines=[],this.position=new F.Vector3,t instanceof F.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){rn(t,this.lines)}clone(){return new $e(this.position)}}class ro{constructor(t){f(this,"lines",[]);f(this,"points",[]);f(this,"params");f(this,"polylines",[]);f(this,"hook",new be.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 o=this.polylines.find(s=>!!s.getNext(t));if(o)o.push(t);else{const s=new Oi;s.push(t),this.polylines.push(s)}this.hook.emit("lineAdded",t)}removeLineByID(t){const e=this.getLineByID(t);e&&this.removeLine(e)}removeLine(t){const e=this.polylines.find(s=>s.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&&rn(e,this.polylines)}const[n,o]=t.points;return n.lines.length===0&&rn(n,this.points),o.lines.length===0&&rn(o,this.points),rn(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:s,position:r})=>{const a=new $e(r);return a.id=s,a}),n=t.lines.map(s=>{const[r,a]=s.points,l=this.getPointByID.call({points:e},r),c=this.getPointByID.call({points:e},a);if(!l||!c)throw new Error("\u7EBF\u4E0A\u7684\u70B9\u4E0D\u5B58\u5728");const u=new en(l,c,this);return u.id=s.id,u}),o=t.polylines.map(s=>{const r=new Oi;return s.lines.forEach(a=>{const l=n.find(({id:c})=>c===a);l&&r.push(l)}),r});return this.points.splice(0,this.points.length,...e),this.lines.splice(0,this.lines.length,...n),this.polylines.splice(0,this.polylines.length,...o),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 Ln=i=>i.preventDefault();class ui{constructor(t){f(this,"model");f(this,"five");f(this,"group");f(this,"config");f(this,"dashed");f(this,"disposed",!1);f(this,"isMobile");f(this,"mouseGroup");f(this,"container");f(this,"fiveHelper");f(this,"hook");f(this,"magnifier");f(this,"userDistanceItemCreator");f(this,"updateDistanceUI",()=>{this.dashed.distanceItem.update(this.five),this.model.lines.forEach(t=>t.distanceItem.update(this.five))});var n,o;this.five=t.five,this.hook=t.hook,this.model=t.model,this.config=t.config,this.magnifier=t.magnifier,this.container=t.container,this.fiveHelper=t.fiveHelper,this.isMobile=(o=(n=t.openParams)==null?void 0:n.isMobile)!=null?o:!1,this.userDistanceItemCreator=t.userDistanceItemCreator,this.group=t.group,this.mouseGroup=t.mouseGroup,this.dashed=new en(new $e([0,0,0]),new $e([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",Ln),e.addEventListener("contextmenu",Ln))}removeLine(t){this.group.remove(t.mesh,t.lightMesh),t.distanceItem.remove(),this.five.needsRender=!0}updateMouseGroup(t,e){if(!t)return this.mouseGroup;const n=this.fiveHelper.getAdsorbentPoint(t),o=n||t.point;if(this.mouseGroup.position.copy(o),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const r=t.face.normal.clone().multiplyScalar(.05),l=t.point.clone().add(r).clone().add(r);this.mouseGroup.lookAt(l)}return this.mouseGroup}dispose(){this.disposed=!0,this.magnifier.remove(),this.model.lines.forEach(e=>this.removeLine(e));const t=this.five.getElement();t&&(t.removeEventListener("touchstart",Ln),t.removeEventListener("contextmenu",Ln))}}function Hi(i){const{x:t,y:e}=i.center,{clientWidth:n,clientHeight:o}=i.target,s=i.target.getBoundingClientRect(),r=new F.Vector2(t,e).sub(new F.Vector2(s.left,s.top)),a=new F.Vector2(r.x/n*2-1,-(r.y/o)*2+1);return{point:r,ndcPoint:a}}function wi(i,t){const e=Hi(t).ndcPoint,n=new F.Raycaster;return n.setFromCamera(e,i.camera),i.model.intersectRaycaster(n)}class Sn extends ui{constructor(e){var o;super(e);f(this,"type","edit");f(this,"pressPoint");f(this,"hasAppendDashed",!1);f(this,"hasAppendMouseGroup",!1);f(this,"fiveElement");f(this,"lastPoint",null);f(this,"hammer");f(this,"onIntersectionUpdate",oo((e,n)=>{var s;this.hasAppendMouseGroup===!1&&(this.group.add(this.mouseGroup),this.magnifier.appendTo(this.container),this.hasAppendMouseGroup=!0);const o=this.updateMouseGroup(e,n).position;(s=this.pressPoint)==null||s.position.copy(o),this.updateDashed(),requestAnimationFrame(()=>this.magnifier.renderWithPoint(this.mouseGroup.position)),this.five.needsRender=!0},20));f(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)});f(this,"onMouseLeave",()=>{this.magnifier.remove(),this.group.remove(this.mouseGroup),this.hasAppendMouseGroup=!1,this.lastPoint&&(this.mouseGroup.position.copy(this.lastPoint.position),this.updateDashed())});f(this,"onLineChanged",()=>{this.hook.emit("editedLineChange",this.model.lines.map(e=>e.toCompletelyJson()))});f(this,"onPress",e=>{const[n]=wi(this.five,e);if(!n||!n.face)return;const o=new $e(n.point);this.pressPoint=o,this.onIntersectionUpdate(n)});f(this,"onPan",e=>{if(!this.pressPoint)return;const[n]=wi(this.five,e);!n||!n.face||this.onIntersectionUpdate(n)});f(this,"onPanEnd",e=>{!this.pressPoint||this.onTap(e)});f(this,"onTap",e=>{this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh)),this.hasAppendDashed=!0;const[n]=wi(this.five,e);this.updateMouseGroup(n);const o=new $e(this.mouseGroup.position),s=this.lastPoint;if(o&&(this.lastPoint=o),o&&s){const r=new en(s,o,this.model);r.distanceItem.appendTo(this.container),this.model.addLine(r),this.group.add(r.mesh),r.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",o.position)});f(this,"onWantsTapGesture",()=>!1);f(this,"onWantsToMoveToPano",()=>!1);f(this,"onWantsPanGesture",()=>this.pressPoint?!1:void 0);f(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});f(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 ro(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 s=new gn.default(n);this.hammer=s,s.on("tap",this.onTap),s.on("pan",this.onPan),s.on("press",this.onPress),s.on("panend",this.onPanEnd)}(o=this.fiveElement)==null||o.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 ao(i,t){const e=i.x-t[0].x,n=i.y-t[0].y,o=t[1].x-t[0].x,s=t[1].y-t[0].y,r=e*o+n*s,a=o*o+s*s,l=r/a;let c,u;return l<0||Lh(t[0],t[1])?(c=t[0].x,u=t[0].y):l>1?(c=t[1].x,u=t[1].y):(c=t[0].x+l*o,u=t[0].y+l*s),new F.Vector2(c,u)}function Lh(i,t){return i.x===t.x&&i.y===t.y}function $n(i){const t=(s,r,a)=>{const l=s.lines.find(u=>u.points.findIndex(({id:h})=>h===s.id)!==r);if(!l)return a;const c=l.points[r];return c?t(c,r,a.concat(l)):a},e=t(i.points[0],1,[]),n=t(i.points[0],0,[]);return e.concat(n)}class Sh extends ui{constructor(e){super(e);f(this,"type","view");f(this,"highlightedLines",[]);f(this,"hammer");f(this,"wantsTapGesture",e=>{if(this.model.lines.length===0)return;const[n]=this.five.model.intersectRaycaster(e);if(!n)return;const o=this.five.camera,s=n.point.clone().project(o),r=this.container.clientWidth,a=this.container.clientHeight,l=new F.Vector2(s.x*r,s.y*a),c=this.model.lines.map(p=>{const[m,g]=p.points,A=m.position.clone().project(o),v=g.position.clone().project(o);if(!Ke(A)&&!Ke(v))return null;const w=new F.Vector2(A.x*r,A.y*a),y=new F.Vector2(v.x*r,v.y*a);return{id:p.id,points:[w,y]}}).filter(p=>!!p);if(c.length===0)return;const d=c.map(p=>{const m=ao(l,p.points);return{id:p.id,distance:m.distanceTo(l)}}).sort((p,m)=>p.distance-m.distance)[0],h=d.distance>20?void 0:this.model.lines.find(({id:p})=>p===d.id);if(this.highlightedLines.length>0&&!h)return this.clearHighlightLines(),!1;if(h)return this.chooseLine(h),!1});f(this,"chooseLine",e=>{const n=$n(e);this.highlightLines(n),this.five.needsRender=!0,this.hook.emit("selectedChange",n.map(o=>o.toCompletelyJson()))});f(this,"lineRemoved",e=>{this.removeLine(e),this.hook.emit("selectedChange",this.model.lines.filter(n=>n.selected).map(n=>n.toCompletelyJson()))});f(this,"onCameraUpdate",()=>{this.updateDistanceUI()});this.model.lines.forEach(o=>{o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),o.hook.on("selected",this.chooseLine),this.group.add(o.mesh)});const n=this.five.getElement();if(n){const o=new gn.default(n);this.hammer=o}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 zh=`
|
|
209
209
|
<svg class="fpm__delete-icon" width="16px" height="17px" viewBox="0 0 16 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
210
210
|
<defs>
|
|
211
211
|
<linearGradient x1="22.185491%" y1="100%" x2="66.8316686%" y2="6.67239121%" id="linearGradient-1">
|
|
@@ -494,7 +494,7 @@ void main() {
|
|
|
494
494
|
<div class='range-piece__content'></div>
|
|
495
495
|
<div class="range-piece__aim"></div>
|
|
496
496
|
</div>
|
|
497
|
-
`;function of(){}const{Vector2:sf}=E;function rf(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return Object.assign(new sf,{x:(i.x-s)/e*2-1,y:-(i.y-o)/n*2+1})}class af{constructor(t){f(this,"container",document.createElement("div"));f(this,"five");f(this,"group");f(this,"mouseGroup");f(this,"hasAppendMouseGroup",!1);f(this,"fiveHelper");f(this,"hook");f(this,"content");f(this,"intersectMesh");f(this,"centerMouseXY");f(this,"raycaster",new F.Raycaster);f(this,"pieceStyl",{matrix3d:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],scale:1,opacity:.4});f(this,"onCameraDirectionUpdate",()=>{const t=this.getIntersection();if(t){this.pieceChange(t),this.updateMouseGroup(t);const e=new $e(this.mouseGroup.position);this.hook.emit("nowPointChange",e)}});f(this,"onWillChangeState",(t,e)=>{var o;this.dotAnimation();const n=(o=this.getIntersection())==null?void 0:o.point;!n||(e==="editing"?this.hook.emit("getStartPoint",new $e(n)):this.hook.emit("getEndPoint",new $e(n)))});f(this,"computedCenterMouseXY",()=>{const t=this.container.querySelector(".range-piece__aim");if(!t)return null;const{left:e,top:n,width:o,height:s}=t.getBoundingClientRect(),r=Math.round(e+o/2),a=Math.round(n+s/2),c=rf({x:r,y:a},this.five.getElement());this.centerMouseXY=c});f(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=Da(N({isMobile:!0},t.openParams.crossHairParameter)),this.fiveHelper=t.fiveHelper,this.container.innerHTML=nf,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 F.Mesh(new F.RingGeometry(.04,.08,32),new F.MeshBasicMaterial({color:1245179,opacity:0,side:F.DoubleSide,transparent:!0})),this.container.addEventListener("animationend",this.computedCenterMouseXY),this.five.on("cameraUpdate",this.onCameraDirectionUpdate),this.hook.on("willChangeState",this.onWillChangeState)}dispose(){this.container.removeEventListener("animationend",this.computedCenterMouseXY),this.five.off("cameraUpdate",this.onCameraDirectionUpdate),this.hook.off("willChangeState",this.onWillChangeState),this.container.remove(),this.group.remove(this.mouseGroup),this.mouseGroup.remove(),this.hasAppendMouseGroup=!1,this.five.scene.remove(this.intersectMesh)}pieceChange(t){const e=t.face,n=t.point;if(e&&n){const s=e.normal.clone().clone().multiplyScalar(.05),r=n.clone().add(s);this.intersectMesh.position.copy(r);const a=r.clone().add(s);this.intersectMesh.lookAt(a),this.five.scene.add(this.intersectMesh);const l=this.intersectMesh.modelViewMatrix.clone().toArray();this.changePieceStyl("matrix3d",l);const c=this.calculateSize(n);this.changePieceStyl("scale",c)}}calculateSize(t){if(!t)return;const e=this.five.camera.position;let n=t.distanceTo(e);const o=4,s=1;return n>o&&(n=o),n<s&&(n=s),-.51/(o-s)*n+1}dotAnimation(){const t=dn.default.Easing.Quadratic.InOut,e={opacity:.4,scale:this.pieceStyl.scale},n={opacity:[1,.4],scale:[this.pieceStyl.scale*.8,this.pieceStyl.scale]};let o=of;const s=new dn.default.Tween(e).to(n,500).easing(t).start(0).onUpdate(({opacity:r,scale:a})=>{this.changePieceStyl("scale",a),this.changePieceStyl("opacity",r)}).onComplete(()=>{o()});o=ci(r=>{s.update(r)})}changePieceStyl(t,e){!this.content||(this.pieceStyl[t]=e,this.content.style.transform=`matrix3d(${this.pieceStyl.matrix3d.toString()}) scale(${this.pieceStyl.scale})`,this.content.style.opacity=`${this.pieceStyl.opacity}`)}updateMouseGroup(t,e){if(!this.hasAppendMouseGroup){this.group.add(this.mouseGroup),this.hasAppendMouseGroup=!0;const n=this.container.querySelector(".range-piece__aim");n&&(n.style.opacity="0")}if(!t)return this.mouseGroup;if(this.mouseGroup.position.copy(t.point),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const o=t.face.normal.clone().multiplyScalar(.05),r=t.point.clone().add(o).clone().add(o);this.mouseGroup.lookAt(r)}return this.mouseGroup}}class lf{constructor(t,e){f(this,"hasOpen",!1);f(this,"hook",new be.Subscribe);f(this,"magnifier");f(this,"five");f(this,"model");f(this,"group");f(this,"config");f(this,"fiveHelper");f(this,"useUIController");f(this,"params");f(this,"useGuideController");f(this,"rangePieceController");f(this,"container",document.createElement("div"));f(this,"shortcutKeyController");f(this,"controller",null);f(this,"controllerParams");f(this,"getCurrentMode",()=>this.controller instanceof Sn?"Edit":this.controller instanceof Ci?"Watch":this.controller instanceof fs?"Mixed":null);f(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:Sh,Watch:Ci,Edit:Sn};if(!e[t])throw new Error("\u4E0D\u5B58\u5728\u7684 Mode");this.controller=new e[t](this.controllerParams),this.hook.emit("modeChange",t)});var s,r;this.five=t,this.params=e;const n={userDistanceItemCreator:void 0,getDistanceText(a){return a.toFixed(2)+"m"}};this.config=N(N({},n),ri(e,["openParams","magnifierParams"])),this.model=new ro(this.config),this.fiveHelper=new mh(t),this.magnifier=new Pa(t,(s=e.magnifierParams)!=null?s:{width:190,height:190,scale:2}),this.group=new F.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 o=(r=this.params.openParams)!=null?r:{};if(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:o,mouseGroup:Da(N({},o.crossHairParameter)),userDistanceItemCreator:this.params.userDistanceItemCreator},this.params.useUIController!==!1){const a=N({container:this.container,openParams:o},typeof this.params.useUIController=="object"?this.params.useUIController:{});this.useUIController=new ms(this,a)}if(this.params.useGuideController!==!1){const a=N({container:this.container},typeof this.params.useGuideController=="object"?this.params.useGuideController:{});this.useGuideController=new $h(this,a)}}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 fs(this.controllerParams),this.rangePieceController=new af(this.controllerParams)):(this.five.helperVisible=!1,this.controller=new Ci(this.controllerParams)),(e=this.useUIController)==null||e.show(),(n=this.useGuideController)==null||n.show(),this.shortcutKeyController=new ef(this,this.five),this.hook.emit("enable",!0))}disable(){var t,e,n,o,s;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(),(o=this.useGuideController)==null||o.hide(),(s=this.shortcutKeyController)==null||s.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 Sn&&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 Sn?(this.model.mergeModel(this.controller.model),this):this}toJson(){return this.model.toJson()}changeIsMobile(t){var e,n;if(((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();const o=N({container:this.container,openParams:this.controllerParams.openParams},typeof this.params.useUIController=="object"?this.params.useUIController:{});this.useUIController=new ms(this,o)}}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 cf=function(t,e){return new lf(t,e)},Ba=$i(null);function uf(i){ae(i,"svelte-19zi46m",".PanoSpatialTagPlugin__tag-origin.svelte-19zi46m{position:absolute;width:0.5rem;height:0.5rem;border-radius:50%;background:#fff;box-shadow:0 0 .6rem #fff;transform:translate(-50%, -50%) scale(1);transform-origin:center center;animation:svelte-19zi46m-PanoSpatialTagPlugin__tag-origin 1.2s forwards;pointer-events:auto}.PanoSpatialTagPlugin__tag-origin.svelte-19zi46m:after{content:'';position:absolute;top:50%;height:50%;width:2rem;height:2rem;transform:translate(-50%, -50%)}.PanoSpatialTagPlugin__tag-origin-destroy.svelte-19zi46m{transform:translate(-50%, -50%) scale(0.6);animation:svelte-19zi46m-PanoSpatialTagPlugin__tag-origin-destroy 1.2s forwards .7s}@keyframes svelte-19zi46m-PanoSpatialTagPlugin__tag-origin{0%{transform:translate(-50%, -50%) scale(1);opacity:0}100%{transform:translate(-50%, -50%) scale(0.6);opacity:1 }}@keyframes svelte-19zi46m-PanoSpatialTagPlugin__tag-origin-destroy{0%{transform:translate(-50%, -50%) scale(0.6);opacity:1}10%{transform:translate(-50%, -50%) scale(1);opacity:0.9}100%{transform:translate(-50%, -50%) scale(1);opacity:0}}")}function ps(i,t,e){const n=i.slice();return n[3]=t[e],n}function gs(i){let t,e=`${i[3].top}%`,n=`${i[3].left}%`,o,s;function r(){return i[2](i[3])}return{c(){t=j("i"),b(t,"class","svelte-19zi46m"),q(t,"PanoSpatialTagPlugin__tag-origin",!0),q(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),R(t,"top",e),R(t,"left",n),R(t,"visibility",i[3].front?"visible":"hidden")},m(a,l){B(a,t,l),o||(s=Pe(t,"click",r),o=!0)},p(a,l){i=a,l&1&&q(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),l&1&&e!==(e=`${i[3].top}%`)&&R(t,"top",e),l&1&&n!==(n=`${i[3].left}%`)&&R(t,"left",n),l&1&&R(t,"visibility",i[3].front?"visible":"hidden")},d(a){a&&M(t),o=!1,s()}}}function df(i){let t,e=i[0],n=[];for(let o=0;o<e.length;o+=1)n[o]=gs(ps(i,e,o));return{c(){for(let o=0;o<n.length;o+=1)n[o].c();t=fe()},m(o,s){for(let r=0;r<n.length;r+=1)n[r].m(o,s);B(o,t,s)},p(o,[s]){if(s&3){e=o[0];let r;for(r=0;r<e.length;r+=1){const a=ps(o,e,r);n[r]?n[r].p(a,s):(n[r]=gs(a),n[r].c(),n[r].m(t.parentNode,t))}for(;r<n.length;r+=1)n[r].d(1);n.length=e.length}},i:te,o:te,d(o){tt(n,o),o&&M(t)}}}function hf(i,t,e){let{origins:n}=t;const o=r=>{Ba.update(()=>`${r}-PanoSpatialTagPlugin-${Date.now()}`)},s=r=>o(r.id);return i.$$set=r=>{"origins"in r&&e(0,n=r.origins)},[n,o,s]}class ff extends oe{constructor(t){super(),ie(this,t,hf,df,ne,{origins:0},uf)}}function mf(i){ae(i,"svelte-1i5h9zh",".PanoSpatialTagPlugin__tag-x.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0;display:block;white-space:nowrap;box-sizing:border-box;width:25rem;height:14rem;color:#FFF;transform:translate(0, -100%);transition:height .5s linear}.PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh.svelte-1i5h9zh{content:'';position:absolute;width:30rem;height:30rem;top:-15rem;left:-15rem;z-index:-1;opacity:0;transition:opacity .8s .6s;background:url('https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png');background-size:30rem 30rem}.PanoSpatialTagPlugin__tag-line.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;left:-1rem;width:2rem;height:100%;overflow:hidden}.PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:1rem;height:calc(100% - 1.5rem);width:.15rem;background:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, .1));box-shadow:0 .1rem .5rem rgba(0, 0, 0, .2);opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .4s cubic-bezier(.44,.44,.74,.98) , opacity .4s cubic-bezier(.44,.44,.74,.98), width .5s linear, height .5s linear ;transform-origin:center bottom}.PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0.3rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0.5rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh{animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1 linear .5s forwards .45s}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh{animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2 linear .5s forwards .65s}.PanoSpatialTagPlugin__tag-x.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh.svelte-1i5h9zh{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line.svelte-1i5h9zh{transform:scaleY(-1)}.PanoSpatialTagPlugin__tag-animate.svelte-1i5h9zh.svelte-1i5h9zh{position:relative;height:100%;overflow:hidden;transform-origin:left top;transition:transform .5s linear}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-animate.svelte-1i5h9zh{transform-origin:left bottom}.PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;display:inline-block;transform:translate(-100%, 0);transition:transform .9s cubic-bezier(0,.65,.16,1.08) .6s;padding-left:.5rem;font-size:1rem}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{bottom:0}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh{opacity:1;transform:translate(-50%, 0) scaleY(1)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{top:unset;bottom:-15rem}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{opacity:.32}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh{opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .5s .55s, opacity .4s .55s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{opacity:0;transition:opacity .8s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{transform:translate(-100%, 0);transition:transform .6s cubic-bezier(.53,.06,.88,.59)}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content .svelte-1i5h9zh{pointer-events:none}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh{opacity:0.5;transform:translate(-50%, 10%) scaleY(0);animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1-hide linear .28s forwards .3s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh{opacity:0.5;transform:translate(-50%, 0) scaleY(0);animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2-hide linear .28s forwards .45s}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 135%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 20%) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 125%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1-hide{0%{opacity:0.5;transform:translate(-50%, 10%) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 105%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2-hide{0%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 100%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}")}function pf(i){let t,e,n,o,s,r,a,l,c,u,d,h,p,m,g;return{c(){t=j("div"),e=j("div"),n=_(),o=j("div"),s=j("i"),r=_(),a=j("i"),l=_(),c=j("i"),u=_(),d=j("div"),h=j("div"),b(e,"class","PanoSpatialTagPlugin__tag-shadow svelte-1i5h9zh"),R(e,"transform","translate("+i[7]/2*i[3]*3+"px, "+i[8]/2*(i[1]?-1:1)*i[3]*3+"px) scale("+1/i[3]+")"),b(s,"class","PanoSpatialTagPlugin__tag-flagpole svelte-1i5h9zh"),R(s,"width",i[4]+"rem"),b(a,"class","PanoSpatialTagPlugin__tag-line1 svelte-1i5h9zh"),b(c,"class","PanoSpatialTagPlugin__tag-line2 svelte-1i5h9zh"),b(o,"class","PanoSpatialTagPlugin__tag-line svelte-1i5h9zh"),b(h,"class","PanoSpatialTagPlugin__tag-content svelte-1i5h9zh"),b(d,"class","PanoSpatialTagPlugin__tag-animate svelte-1i5h9zh"),R(d,"transform","scale("+i[3]*3+")"),b(t,"id",p="PanoSpatialTagPlugin__"+i[0]),R(t,"height",20*i[5]+"rem"),b(t,"class","svelte-1i5h9zh"),q(t,"PanoSpatialTagPlugin__tag-x",!0),q(t,"PanoSpatialTagPlugin__tag-upside-down",i[1]),q(t,"PanoSpatialTagPlugin__tag-show",i[10]),q(t,"PanoSpatialTagPlugin__tag-hide",i[10]===!1||i[6])},m(A,v){B(A,t,v),Q(t,e),Q(t,n),Q(t,o),Q(o,s),Q(o,r),Q(o,a),Q(o,l),Q(o,c),Q(t,u),Q(t,d),Q(d,h),h.innerHTML=i[2],i[16](h),m||(g=Pe(h,"click",i[11]),m=!0)},p(A,[v]){v&394&&R(e,"transform","translate("+A[7]/2*A[3]*3+"px, "+A[8]/2*(A[1]?-1:1)*A[3]*3+"px) scale("+1/A[3]+")"),v&16&&R(s,"width",A[4]+"rem"),v&4&&(h.innerHTML=A[2]),v&8&&R(d,"transform","scale("+A[3]*3+")"),v&1&&p!==(p="PanoSpatialTagPlugin__"+A[0])&&b(t,"id",p),v&32&&R(t,"height",20*A[5]+"rem"),v&2&&q(t,"PanoSpatialTagPlugin__tag-upside-down",A[1]),v&1024&&q(t,"PanoSpatialTagPlugin__tag-show",A[10]),v&1088&&q(t,"PanoSpatialTagPlugin__tag-hide",A[10]===!1||A[6])},i:te,o:te,d(A){A&&M(t),i[16](null),m=!1,g()}}}function gf(i,t,e){let{id:n}=t,{upsideDown:o}=t,{content:s}=t,{contentZoom:r}=t,{lineWidthZoom:a}=t,{lineHeightZoom:l}=t,{destroying:c=!1}=t,{folded:u}=t,{dispose:d}=t,{events:h}=t,{hooks:p}=t,m=0,g=0,A,v,w=setTimeout(()=>{u||e(10,v=!0),w=void 0},100);const y=C=>{const S=Object.keys(h);let k=C.target;for(;k;){const G=k.getAttribute("class");if(!G){k=k.parentNode;continue}if(G.includes("PanoSpatialTagPlugin__tag-content")){k=null;break}S.forEach(O=>{G.includes(O)&&h[O](n)}),k=k.parentNode}};Ye(()=>{p.emit("initTag",{id:n})});const x=Ba.subscribe(C=>{if(C===null)return;const[S,k]=C.split("-PanoSpatialTagPlugin-");n===S&&(p.emit("clickOrigin",{id:n,show:v}),w||(e(10,v=u),e(12,u=!u),w=setTimeout(()=>{w=void 0},1500)))});qi(()=>{e(7,m=A.offsetWidth),e(8,g=A.offsetHeight),!w&&e(10,v=!u)}),yt(()=>{p.emit("destroyTag",{id:n}),x(),d()});function L(C){Te[C?"unshift":"push"](()=>{A=C,e(9,A)})}return i.$$set=C=>{"id"in C&&e(0,n=C.id),"upsideDown"in C&&e(1,o=C.upsideDown),"content"in C&&e(2,s=C.content),"contentZoom"in C&&e(3,r=C.contentZoom),"lineWidthZoom"in C&&e(4,a=C.lineWidthZoom),"lineHeightZoom"in C&&e(5,l=C.lineHeightZoom),"destroying"in C&&e(6,c=C.destroying),"folded"in C&&e(12,u=C.folded),"dispose"in C&&e(13,d=C.dispose),"events"in C&&e(14,h=C.events),"hooks"in C&&e(15,p=C.hooks)},[n,o,s,r,a,l,c,m,g,A,v,y,u,d,h,p,L]}class Af extends oe{constructor(t){super(),ie(this,t,gf,pf,ne,{id:0,upsideDown:1,content:2,contentZoom:3,lineWidthZoom:4,lineHeightZoom:5,destroying:6,folded:12,dispose:13,events:14,hooks:15},mf)}}const vf={position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",pointerEvents:"none"},As="<",vs=">",bs="%",ys="locals",bf="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",yf={"&":"&","<":"<",">":">",'"':""","'":"'"},Qe={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};function ws(i){return i.replace(/;(\s*$)/,"$1")}function wf(i,t){return new Cf(i).compileFunction()(t)}class Cf{constructor(t){f(this,"templateText");f(this,"mode",null);f(this,"truncate",!1);f(this,"currentLine",1);f(this,"source","");f(this,"regex",new RegExp(bf));this.templateText=t}compileFunction(){let t;const e=` var __output = "";
|
|
497
|
+
`;function of(){}const{Vector2:sf}=E;function rf(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return Object.assign(new sf,{x:(i.x-s)/e*2-1,y:-(i.y-o)/n*2+1})}class af{constructor(t){f(this,"container",document.createElement("div"));f(this,"five");f(this,"group");f(this,"mouseGroup");f(this,"hasAppendMouseGroup",!1);f(this,"fiveHelper");f(this,"hook");f(this,"content");f(this,"intersectMesh");f(this,"centerMouseXY");f(this,"raycaster",new F.Raycaster);f(this,"pieceStyl",{matrix3d:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],scale:1,opacity:.4});f(this,"onCameraDirectionUpdate",()=>{const t=this.getIntersection();if(t){this.pieceChange(t),this.updateMouseGroup(t);const e=new $e(this.mouseGroup.position);this.hook.emit("nowPointChange",e)}});f(this,"onWillChangeState",(t,e)=>{var o;this.dotAnimation();const n=(o=this.getIntersection())==null?void 0:o.point;!n||(e==="editing"?this.hook.emit("getStartPoint",new $e(n)):this.hook.emit("getEndPoint",new $e(n)))});f(this,"computedCenterMouseXY",()=>{const t=this.container.querySelector(".range-piece__aim");if(!t)return null;const{left:e,top:n,width:o,height:s}=t.getBoundingClientRect(),r=Math.round(e+o/2),a=Math.round(n+s/2),c=rf({x:r,y:a},this.five.getElement());this.centerMouseXY=c});f(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=Da(N({isMobile:!0},t.openParams.crossHairParameter)),this.fiveHelper=t.fiveHelper,this.container.innerHTML=nf,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 F.Mesh(new F.RingGeometry(.04,.08,32),new F.MeshBasicMaterial({color:1245179,opacity:0,side:F.DoubleSide,transparent:!0})),this.container.addEventListener("animationend",this.computedCenterMouseXY),this.five.on("cameraUpdate",this.onCameraDirectionUpdate),this.hook.on("willChangeState",this.onWillChangeState)}dispose(){this.container.removeEventListener("animationend",this.computedCenterMouseXY),this.five.off("cameraUpdate",this.onCameraDirectionUpdate),this.hook.off("willChangeState",this.onWillChangeState),this.container.remove(),this.group.remove(this.mouseGroup),this.mouseGroup.remove(),this.hasAppendMouseGroup=!1,this.five.scene.remove(this.intersectMesh)}pieceChange(t){const e=t.face,n=t.point;if(e&&n){const s=e.normal.clone().clone().multiplyScalar(.05),r=n.clone().add(s);this.intersectMesh.position.copy(r);const a=r.clone().add(s);this.intersectMesh.lookAt(a),this.five.scene.add(this.intersectMesh);const l=this.intersectMesh.modelViewMatrix.clone().toArray();this.changePieceStyl("matrix3d",l);const c=this.calculateSize(n);this.changePieceStyl("scale",c)}}calculateSize(t){if(!t)return;const e=this.five.camera.position;let n=t.distanceTo(e);const o=4,s=1;return n>o&&(n=o),n<s&&(n=s),-.51/(o-s)*n+1}dotAnimation(){const t=dn.default.Easing.Quadratic.InOut,e={opacity:.4,scale:this.pieceStyl.scale},n={opacity:[1,.4],scale:[this.pieceStyl.scale*.8,this.pieceStyl.scale]};let o=of;const s=new dn.default.Tween(e).to(n,500).easing(t).start(0).onUpdate(({opacity:r,scale:a})=>{this.changePieceStyl("scale",a),this.changePieceStyl("opacity",r)}).onComplete(()=>{o()});o=ci(r=>{s.update(r)})}changePieceStyl(t,e){!this.content||(this.pieceStyl[t]=e,this.content.style.transform=`matrix3d(${this.pieceStyl.matrix3d.toString()}) scale(${this.pieceStyl.scale})`,this.content.style.opacity=`${this.pieceStyl.opacity}`)}updateMouseGroup(t,e){if(!this.hasAppendMouseGroup){this.group.add(this.mouseGroup),this.hasAppendMouseGroup=!0;const n=this.container.querySelector(".range-piece__aim");n&&(n.style.opacity="0")}if(!t)return this.mouseGroup;if(this.mouseGroup.position.copy(t.point),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const o=t.face.normal.clone().multiplyScalar(.05),r=t.point.clone().add(o).clone().add(o);this.mouseGroup.lookAt(r)}return this.mouseGroup}}class lf{constructor(t,e){f(this,"hasOpen",!1);f(this,"hook",new be.Subscribe);f(this,"magnifier");f(this,"five");f(this,"model");f(this,"group");f(this,"config");f(this,"fiveHelper");f(this,"useUIController");f(this,"params");f(this,"useGuideController");f(this,"rangePieceController");f(this,"container",document.createElement("div"));f(this,"shortcutKeyController");f(this,"controller",null);f(this,"controllerParams");f(this,"getCurrentMode",()=>this.controller instanceof Sn?"Edit":this.controller instanceof Ci?"Watch":this.controller instanceof fs?"Mixed":null);f(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:Sh,Watch:Ci,Edit:Sn};if(!e[t])throw new Error("\u4E0D\u5B58\u5728\u7684 Mode");this.controller=new e[t](this.controllerParams),this.hook.emit("modeChange",t)});var s,r;this.five=t,this.params=e;const n={userDistanceItemCreator:void 0,getDistanceText(a){return a.toFixed(2)+"m"}};this.config=N(N({},n),ri(e,["openParams","magnifierParams"])),this.model=new ro(this.config),this.fiveHelper=new mh(t),this.magnifier=new Pa(t,(s=e.magnifierParams)!=null?s:{width:190,height:190,scale:2}),this.group=new F.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 o=(r=this.params.openParams)!=null?r:{};if(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:o,mouseGroup:Da(N({},o.crossHairParameter)),userDistanceItemCreator:this.params.userDistanceItemCreator},this.params.useUIController!==!1){const a=N({container:this.container,openParams:o},typeof this.params.useUIController=="object"?this.params.useUIController:{});this.useUIController=new ms(this,a)}if(this.params.useGuideController!==!1){const a=N({container:this.container},typeof this.params.useGuideController=="object"?this.params.useGuideController:{});this.useGuideController=new $h(this,a)}}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 fs(this.controllerParams),this.rangePieceController=new af(this.controllerParams)):(this.five.helperVisible=!1,this.controller=new Ci(this.controllerParams)),(e=this.useUIController)==null||e.show(),(n=this.useGuideController)==null||n.show(),this.shortcutKeyController=new ef(this,this.five),this.hook.emit("enable",!0))}disable(){var t,e,n,o,s;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(),(o=this.useGuideController)==null||o.hide(),(s=this.shortcutKeyController)==null||s.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 Sn&&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 Sn?(this.model.mergeModel(this.controller.model),this):this}toJson(){return this.model.toJson()}changeIsMobile(t){var e,n;if(((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();const o=N({container:this.container,openParams:this.controllerParams.openParams},typeof this.params.useUIController=="object"?this.params.useUIController:{});this.useUIController=new ms(this,o)}}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 cf=function(t,e){return new lf(t,e)},Ba=$i(null);function uf(i){ae(i,"svelte-19zi46m",".PanoSpatialTagPlugin__tag-origin.svelte-19zi46m{position:absolute;width:0.5rem;height:0.5rem;border-radius:50%;background:#fff;box-shadow:0 0 .6rem #fff;transform:translate(-50%, -50%) scale(1);transform-origin:center center;animation:svelte-19zi46m-PanoSpatialTagPlugin__tag-origin 1.2s forwards;pointer-events:auto}.PanoSpatialTagPlugin__tag-origin.svelte-19zi46m:after{content:'';position:absolute;top:50%;height:50%;width:2rem;height:2rem;transform:translate(-50%, -50%)}.PanoSpatialTagPlugin__tag-origin-destroy.svelte-19zi46m{transform:translate(-50%, -50%) scale(0.6);animation:svelte-19zi46m-PanoSpatialTagPlugin__tag-origin-destroy 1.2s forwards .7s}@keyframes svelte-19zi46m-PanoSpatialTagPlugin__tag-origin{0%{transform:translate(-50%, -50%) scale(1);opacity:0}100%{transform:translate(-50%, -50%) scale(0.6);opacity:1 }}@keyframes svelte-19zi46m-PanoSpatialTagPlugin__tag-origin-destroy{0%{transform:translate(-50%, -50%) scale(0.6);opacity:1}10%{transform:translate(-50%, -50%) scale(1);opacity:0.9}100%{transform:translate(-50%, -50%) scale(1);opacity:0}}")}function ps(i,t,e){const n=i.slice();return n[3]=t[e],n}function gs(i){let t,e=`${i[3].top}%`,n=`${i[3].left}%`,o,s;function r(){return i[2](i[3])}return{c(){t=j("i"),b(t,"class","svelte-19zi46m"),q(t,"PanoSpatialTagPlugin__tag-origin",!0),q(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),R(t,"top",e),R(t,"left",n),R(t,"visibility",i[3].front?"visible":"hidden")},m(a,l){B(a,t,l),o||(s=Pe(t,"click",r),o=!0)},p(a,l){i=a,l&1&&q(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),l&1&&e!==(e=`${i[3].top}%`)&&R(t,"top",e),l&1&&n!==(n=`${i[3].left}%`)&&R(t,"left",n),l&1&&R(t,"visibility",i[3].front?"visible":"hidden")},d(a){a&&M(t),o=!1,s()}}}function df(i){let t,e=i[0],n=[];for(let o=0;o<e.length;o+=1)n[o]=gs(ps(i,e,o));return{c(){for(let o=0;o<n.length;o+=1)n[o].c();t=fe()},m(o,s){for(let r=0;r<n.length;r+=1)n[r].m(o,s);B(o,t,s)},p(o,[s]){if(s&3){e=o[0];let r;for(r=0;r<e.length;r+=1){const a=ps(o,e,r);n[r]?n[r].p(a,s):(n[r]=gs(a),n[r].c(),n[r].m(t.parentNode,t))}for(;r<n.length;r+=1)n[r].d(1);n.length=e.length}},i:te,o:te,d(o){tt(n,o),o&&M(t)}}}function hf(i,t,e){let{origins:n}=t;const o=r=>{Ba.update(()=>`${r}-PanoSpatialTagPlugin-${Date.now()}`)},s=r=>o(r.id);return i.$$set=r=>{"origins"in r&&e(0,n=r.origins)},[n,o,s]}class ff extends oe{constructor(t){super(),ie(this,t,hf,df,ne,{origins:0},uf)}}function mf(i){ae(i,"svelte-1i5h9zh",".PanoSpatialTagPlugin__tag-x.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0;display:block;white-space:nowrap;box-sizing:border-box;width:25rem;height:14rem;color:#FFF;transform:translate(0, -100%);transition:height .5s linear}.PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh.svelte-1i5h9zh{content:'';position:absolute;width:30rem;height:30rem;top:-15rem;left:-15rem;z-index:-1;opacity:0;transition:opacity .8s .6s;background:url('https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png');background-size:30rem 30rem}.PanoSpatialTagPlugin__tag-line.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;left:-1rem;width:2rem;height:100%;overflow:hidden}.PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:1rem;height:calc(100% - 1.5rem);width:.15rem;background:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, .1));box-shadow:0 .1rem .5rem rgba(0, 0, 0, .2);opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .4s cubic-bezier(.44,.44,.74,.98) , opacity .4s cubic-bezier(.44,.44,.74,.98), width .5s linear, height .5s linear ;transform-origin:center bottom}.PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0.3rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0.5rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh{animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1 linear .5s forwards .45s}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh{animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2 linear .5s forwards .65s}.PanoSpatialTagPlugin__tag-x.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh.svelte-1i5h9zh{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line.svelte-1i5h9zh{transform:scaleY(-1)}.PanoSpatialTagPlugin__tag-animate.svelte-1i5h9zh.svelte-1i5h9zh{position:relative;height:100%;overflow:hidden;transform-origin:left top;transition:transform .5s linear}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-animate.svelte-1i5h9zh{transform-origin:left bottom}.PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;display:inline-block;transform:translate(-100%, 0);transition:transform .9s cubic-bezier(0,.65,.16,1.08) .6s;padding-left:.5rem;font-size:1rem}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{bottom:0}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh{opacity:1;transform:translate(-50%, 0) scaleY(1)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{top:unset;bottom:-15rem}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{opacity:.32}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh{opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .5s .55s, opacity .4s .55s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{opacity:0;transition:opacity .8s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{transform:translate(-100%, 0);transition:transform .6s cubic-bezier(.53,.06,.88,.59)}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content .svelte-1i5h9zh{pointer-events:none}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh{opacity:0.5;transform:translate(-50%, 10%) scaleY(0);animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1-hide linear .28s forwards .3s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh{opacity:0.5;transform:translate(-50%, 0) scaleY(0);animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2-hide linear .28s forwards .45s}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 135%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 20%) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 125%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1-hide{0%{opacity:0.5;transform:translate(-50%, 10%) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 105%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2-hide{0%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 100%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}")}function pf(i){let t,e,n,o,s,r,a,l,c,u,d,h,p,m,g;return{c(){t=j("div"),e=j("div"),n=_(),o=j("div"),s=j("i"),r=_(),a=j("i"),l=_(),c=j("i"),u=_(),d=j("div"),h=j("div"),b(e,"class","PanoSpatialTagPlugin__tag-shadow svelte-1i5h9zh"),R(e,"transform","translate("+i[7]/2*i[3]*3+"px, "+i[8]/2*(i[1]?-1:1)*i[3]*3+"px) scale("+1/i[3]+")"),b(s,"class","PanoSpatialTagPlugin__tag-flagpole svelte-1i5h9zh"),R(s,"width",i[4]+"rem"),b(a,"class","PanoSpatialTagPlugin__tag-line1 svelte-1i5h9zh"),b(c,"class","PanoSpatialTagPlugin__tag-line2 svelte-1i5h9zh"),b(o,"class","PanoSpatialTagPlugin__tag-line svelte-1i5h9zh"),b(h,"class","PanoSpatialTagPlugin__tag-content svelte-1i5h9zh"),b(d,"class","PanoSpatialTagPlugin__tag-animate svelte-1i5h9zh"),R(d,"transform","scale("+i[3]*3+")"),b(t,"id",p="PanoSpatialTagPlugin__"+i[0]),R(t,"height",20*i[5]+"rem"),b(t,"class","svelte-1i5h9zh"),q(t,"PanoSpatialTagPlugin__tag-x",!0),q(t,"PanoSpatialTagPlugin__tag-upside-down",i[1]),q(t,"PanoSpatialTagPlugin__tag-show",i[10]),q(t,"PanoSpatialTagPlugin__tag-hide",i[10]===!1||i[6])},m(A,v){B(A,t,v),Q(t,e),Q(t,n),Q(t,o),Q(o,s),Q(o,r),Q(o,a),Q(o,l),Q(o,c),Q(t,u),Q(t,d),Q(d,h),h.innerHTML=i[2],i[16](h),m||(g=Pe(h,"click",i[11]),m=!0)},p(A,[v]){v&394&&R(e,"transform","translate("+A[7]/2*A[3]*3+"px, "+A[8]/2*(A[1]?-1:1)*A[3]*3+"px) scale("+1/A[3]+")"),v&16&&R(s,"width",A[4]+"rem"),v&4&&(h.innerHTML=A[2]),v&8&&R(d,"transform","scale("+A[3]*3+")"),v&1&&p!==(p="PanoSpatialTagPlugin__"+A[0])&&b(t,"id",p),v&32&&R(t,"height",20*A[5]+"rem"),v&2&&q(t,"PanoSpatialTagPlugin__tag-upside-down",A[1]),v&1024&&q(t,"PanoSpatialTagPlugin__tag-show",A[10]),v&1088&&q(t,"PanoSpatialTagPlugin__tag-hide",A[10]===!1||A[6])},i:te,o:te,d(A){A&&M(t),i[16](null),m=!1,g()}}}function gf(i,t,e){let{id:n}=t,{upsideDown:o}=t,{content:s}=t,{contentZoom:r}=t,{lineWidthZoom:a}=t,{lineHeightZoom:l}=t,{destroying:c=!1}=t,{folded:u}=t,{dispose:d}=t,{events:h}=t,{hooks:p}=t,m=0,g=0,A,v,w=setTimeout(()=>{u||e(10,v=!0),w=void 0},100);const y=C=>{const S=Object.keys(h);let k=C.target;for(;k;){const G=k.getAttribute("class");if(!G){k=k.parentNode;continue}if(G.includes("PanoSpatialTagPlugin__tag-content")){k=null;break}S.forEach(O=>{G.includes(O)&&h[O](n)}),k=k.parentNode}};Ye(()=>{p.emit("initTag",{id:n})});const x=Ba.subscribe(C=>{if(C===null)return;const[S,k]=C.split("-PanoSpatialTagPlugin-");n===S&&(p.emit("clickOrigin",{id:n,show:v}),w||(e(10,v=u),e(12,u=!u),w=setTimeout(()=>{w=void 0},1500)))});qi(()=>{e(7,m=A.offsetWidth),e(8,g=A.offsetHeight),!w&&e(10,v=!u)}),yt(()=>{p.emit("destroyTag",{id:n}),x(),d()});function L(C){Me[C?"unshift":"push"](()=>{A=C,e(9,A)})}return i.$$set=C=>{"id"in C&&e(0,n=C.id),"upsideDown"in C&&e(1,o=C.upsideDown),"content"in C&&e(2,s=C.content),"contentZoom"in C&&e(3,r=C.contentZoom),"lineWidthZoom"in C&&e(4,a=C.lineWidthZoom),"lineHeightZoom"in C&&e(5,l=C.lineHeightZoom),"destroying"in C&&e(6,c=C.destroying),"folded"in C&&e(12,u=C.folded),"dispose"in C&&e(13,d=C.dispose),"events"in C&&e(14,h=C.events),"hooks"in C&&e(15,p=C.hooks)},[n,o,s,r,a,l,c,m,g,A,v,y,u,d,h,p,L]}class Af extends oe{constructor(t){super(),ie(this,t,gf,pf,ne,{id:0,upsideDown:1,content:2,contentZoom:3,lineWidthZoom:4,lineHeightZoom:5,destroying:6,folded:12,dispose:13,events:14,hooks:15},mf)}}const vf={position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",pointerEvents:"none"},As="<",vs=">",bs="%",ys="locals",bf="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",yf={"&":"&","<":"<",">":">",'"':""","'":"'"},Qe={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};function ws(i){return i.replace(/;(\s*$)/,"$1")}function wf(i,t){return new Cf(i).compileFunction()(t)}class Cf{constructor(t){f(this,"templateText");f(this,"mode",null);f(this,"truncate",!1);f(this,"currentLine",1);f(this,"source","");f(this,"regex",new RegExp(bf));this.templateText=t}compileFunction(){let t;const e=` var __output = "";
|
|
498
498
|
function __append(s) { if (s !== undefined && s !== null) __output += s }
|
|
499
499
|
with (`+ys+` || {}) {
|
|
500
500
|
`,n=` }
|
|
@@ -509,9 +509,9 @@ void main() {
|
|
|
509
509
|
`)}switch(this.mode){case Qe.EVAL:this.source+=" ; "+t+`
|
|
510
510
|
`;break;case Qe.ESCAPED:this.source+=" ; __append(escapeFn("+ws(t)+`))
|
|
511
511
|
`;break;case Qe.RAW:this.source+=" ; __append("+ws(t)+`)
|
|
512
|
-
`;break;case Qe.COMMENT:break;case Qe.LITERAL:this._addOutput(t);break}}else this._addOutput(t)}}}const Ei=.001,Cs=.01,Ef="https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png",Pf=(i,t)=>{var Y,V,ue,de,me,Ce,De,Re;let e=t==null?void 0:t.container,n=1.4;const o=(Y=t==null?void 0:t.wait)!=null?Y:200,s=(V=t==null?void 0:t.maxNumberOnScreen)!=null?V:3,r=(ue=t==null?void 0:t.minRad)!=null?ue:Math.PI/4,a=(de=t==null?void 0:t.nearTolerance)!=null?de:100,l=(me=t==null?void 0:t.upsideHeight)!=null?me:1.6,c=(Ce=t==null?void 0:t.minDistance)!=null?Ce:1.2,u=(De=t==null?void 0:t.maxDistance)!=null?De:3.5,d=Kt(i),h=document.createElement("div");h.classList.add("PanoSpatialTagPlugin"),Object.assign(h.style,vf);const p=new be.Subscribe;let m=new Image;m.src=Ef;const g={points:[],origins:[],tags:[],template:"",events:{},render:wf,folded:!1,enabled:!0,forbidden:!0},A=new ff({target:h,props:{origins:g.origins}}),v=(se,ve)=>{L(),ve&&C()},w=()=>{g.forbidden&&(g.forbidden=!1,C())},y=(se,ve)=>{if(g.tags.length===0)return;const ye=ve.longitude-i.state.longitude,re=i.camera.clone();re.position.copy(ve.offset),re.rotateOnWorldAxis(new E.Vector3(0,1,0),ye),re.updateProjectionMatrix(),re.updateMatrixWorld(!0);const nt=new E.Frustum,wt=new E.Matrix4;wt.multiplyMatrices(re.projectionMatrix,re.matrixWorldInverse),nt.setFromProjectionMatrix(wt),g.tags.forEach(ge=>{const lt=re.position.clone().setY(n).distanceTo(ge.position);if(lt<c||lt>u||!nt.containsPoint(ge.position))return ge.destroying=!0;const ct=ge.position.clone().sub(re.position).setY(0);if(ct.angleTo(ge.normal)>Math.PI/2-r&&ct.angleTo(ge.normal)<Math.PI/2+r)return ge.destroying=!0}),g.tags.forEach(ge=>{ge.destroying?ge.app.$set({contentZoom:.1+re.position.distanceTo(ge.position)/u,lineWidthZoom:.38*(.01+re.position.distanceTo(ge.position)/u),destroying:ge.destroying}):ge.app.$set({lineWidthZoom:.38*(.01+re.position.distanceTo(ge.position)/u),lineHeightZoom:.4+(re.position.distanceTo(ge.position)-c)/u*.6,contentZoom:.1+re.position.distanceTo(ge.position)/u})}),setTimeout(()=>{g.tags.forEach(ge=>{ge.destroying&&(ge.app.$destroy(),ge=null)}),g.tags=g.tags.filter(ge=>!ge.destroying),L()},1900)},x=se=>{se!==be.Five.Mode.Panorama&&!g.forbidden&&(A.$set({origins:[]}),g.tags.forEach(ve=>{ve.app.$destroy(),ve=null}),g.origins=[],g.tags=[],g.forbidden=!0)},L=()=>{if(g.forbidden||!g.enabled)return;const se=i.camera,ve=se.getWorldDirection(new E.Vector3);g.origins=g.tags.map(ye=>{const re=ye.position.clone().project(se),nt=ye.position.clone().sub(se.position).setY(0).angleTo(ve.setY(0))<Math.PI/2;return{id:ye.id,front:nt,left:(re.x+1)/2*100,top:(-re.y+1)/2*100,destroying:ye.destroying}}),A.$set({origins:g.origins})},C=()=>{g.forbidden||!g.enabled||(g.timeoutId&&clearTimeout(g.timeoutId),g.timeoutId=setTimeout(()=>{g.timeoutId=void 0;const se=S();se.length&&(g.tags=g.tags.concat(se),L())},o))},S=()=>{const{clientWidth:se,clientHeight:ve}=i.getElement(),ye=[],re=i.camera,nt=new E.Frustum,wt=new E.Matrix4,ge=re.getWorldDirection(new E.Vector3);wt.multiplyMatrices(re.projectionMatrix,re.matrixWorldInverse),nt.setFromProjectionMatrix(wt);const lt=g.tags.filter(Le=>nt.containsPoint(Le.position)&&!Le.destroying).length,ct=g.points.reduce((Le,Oe)=>{if(g.tags.find(
|
|
512
|
+
`;break;case Qe.COMMENT:break;case Qe.LITERAL:this._addOutput(t);break}}else this._addOutput(t)}}}const Ei=.001,Cs=.01,Ef="https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png",Pf=(i,t)=>{var Y,V,ue,de,me,Ce,De,Re;let e=t==null?void 0:t.container,n=1.4;const o=(Y=t==null?void 0:t.wait)!=null?Y:200,s=(V=t==null?void 0:t.maxNumberOnScreen)!=null?V:3,r=(ue=t==null?void 0:t.minRad)!=null?ue:Math.PI/4,a=(de=t==null?void 0:t.nearTolerance)!=null?de:100,l=(me=t==null?void 0:t.upsideHeight)!=null?me:1.6,c=(Ce=t==null?void 0:t.minDistance)!=null?Ce:1.2,u=(De=t==null?void 0:t.maxDistance)!=null?De:3.5,d=Kt(i),h=document.createElement("div");h.classList.add("PanoSpatialTagPlugin"),Object.assign(h.style,vf);const p=new be.Subscribe;let m=new Image;m.src=Ef;const g={points:[],origins:[],tags:[],template:"",events:{},render:wf,folded:!1,enabled:!0,forbidden:!0},A=new ff({target:h,props:{origins:g.origins}}),v=(se,ve)=>{L(),ve&&C()},w=()=>{g.forbidden&&(g.forbidden=!1,C())},y=(se,ve)=>{if(g.tags.length===0)return;const ye=ve.longitude-i.state.longitude,re=i.camera.clone();re.position.copy(ve.offset),re.rotateOnWorldAxis(new E.Vector3(0,1,0),ye),re.updateProjectionMatrix(),re.updateMatrixWorld(!0);const nt=new E.Frustum,wt=new E.Matrix4;wt.multiplyMatrices(re.projectionMatrix,re.matrixWorldInverse),nt.setFromProjectionMatrix(wt),g.tags.forEach(ge=>{const lt=re.position.clone().setY(n).distanceTo(ge.position);if(lt<c||lt>u||!nt.containsPoint(ge.position))return ge.destroying=!0;const ct=ge.position.clone().sub(re.position).setY(0);if(ct.angleTo(ge.normal)>Math.PI/2-r&&ct.angleTo(ge.normal)<Math.PI/2+r)return ge.destroying=!0}),g.tags.forEach(ge=>{ge.destroying?ge.app.$set({contentZoom:.1+re.position.distanceTo(ge.position)/u,lineWidthZoom:.38*(.01+re.position.distanceTo(ge.position)/u),destroying:ge.destroying}):ge.app.$set({lineWidthZoom:.38*(.01+re.position.distanceTo(ge.position)/u),lineHeightZoom:.4+(re.position.distanceTo(ge.position)-c)/u*.6,contentZoom:.1+re.position.distanceTo(ge.position)/u})}),setTimeout(()=>{g.tags.forEach(ge=>{ge.destroying&&(ge.app.$destroy(),ge=null)}),g.tags=g.tags.filter(ge=>!ge.destroying),L()},1900)},x=se=>{se!==be.Five.Mode.Panorama&&!g.forbidden&&(A.$set({origins:[]}),g.tags.forEach(ve=>{ve.app.$destroy(),ve=null}),g.origins=[],g.tags=[],g.forbidden=!0)},L=()=>{if(g.forbidden||!g.enabled)return;const se=i.camera,ve=se.getWorldDirection(new E.Vector3);g.origins=g.tags.map(ye=>{const re=ye.position.clone().project(se),nt=ye.position.clone().sub(se.position).setY(0).angleTo(ve.setY(0))<Math.PI/2;return{id:ye.id,front:nt,left:(re.x+1)/2*100,top:(-re.y+1)/2*100,destroying:ye.destroying}}),A.$set({origins:g.origins})},C=()=>{g.forbidden||!g.enabled||(g.timeoutId&&clearTimeout(g.timeoutId),g.timeoutId=setTimeout(()=>{g.timeoutId=void 0;const se=S();se.length&&(g.tags=g.tags.concat(se),L())},o))},S=()=>{const{clientWidth:se,clientHeight:ve}=i.getElement(),ye=[],re=i.camera,nt=new E.Frustum,wt=new E.Matrix4,ge=re.getWorldDirection(new E.Vector3);wt.multiplyMatrices(re.projectionMatrix,re.matrixWorldInverse),nt.setFromProjectionMatrix(wt);const lt=g.tags.filter(Le=>nt.containsPoint(Le.position)&&!Le.destroying).length,ct=g.points.reduce((Le,Oe)=>{if(g.tags.find(ze=>Oe.id===ze.id&&!ze.destroying))return Le;const Je=re.position.clone().setY(n).distanceTo(Oe.position);if(Je<c||Je>u||!nt.containsPoint(Oe.position))return Le;const tn=Oe.position.clone().sub(re.position).setY(0);if(tn.angleTo(Oe.normal)>Math.PI/2-r&&tn.angleTo(Oe.normal)<Math.PI/2+r)return Le;const Ft=Oe.position.clone().project(re);if(!g.tags.every(ze=>{if(ze.position.clone().sub(re.position).setY(0).angleTo(ge.setY(0))>Math.PI/2)return!0;const Et=ze.position.clone().project(re);return Math.sqrt(Math.pow((Ft.x-Et.x)/2*se,2)+Math.pow((Ft.y-Et.y)/2*ve,2))>a}))return Le;const Ct={id:Oe.id,position:Oe.position,normal:Oe.normal,replacement:Oe.replacement,weight:Oe.weight,distance:Je};let Ee;for(let ze=0,Et=Le.length;ze<Et;ze++){const An=Le[ze];if(Ct.weight>An.weight){Ee=ze;break}if(Ct.distance<An.distance){Ee=ze;break}}return Ee!==void 0?Le.splice(Ee,0,Ct):Le.push(Ct),Le},[]);for(let Le=0,Oe=ct.length;Le<Oe&&!(lt+ye.length>=s);Le++){const Je=ct[Le];if(ye.find(Ee=>Je.id===Ee.id))continue;const tn=Je.position.clone().project(re);if(!g.tags.concat(ye).every(Ee=>{if(Ee.position.clone().sub(re.position).setY(0).angleTo(ge.setY(0))>Math.PI/2)return!0;const ze=Ee.position.clone().project(re);return Math.sqrt(Math.pow((tn.x-ze.x)/2*se,2)+Math.pow((tn.y-ze.y)/2*ve,2))>a}))continue;const Ft=new E.Raycaster(re.position.clone().setY(n),Je.position.clone().sub(re.position.clone().setY(n)).normalize(),0,Je.distance+Cs),[Ct]=g.intersectObjects?Ft.intersectObjects(g.intersectObjects,!0):i.model.bvhs.loaded?i.model.intersectRaycaster(Ft):Ft.intersectObjects(i.model.children,!0);if(!!Ct&&Je.distance-Ct.distance<Cs){const{position:Ee,normal:ze,id:Et,replacement:An}=Je,il=new E.Plane().setFromNormalAndCoplanarPoint(ze,Ee),po=Ee.clone().sub(re.position).cross(new E.Vector3(0,1,0)).setLength(Ei),ol=[Ee.clone(),Ee.clone().add(po),Ee.clone().add(new E.Vector3(0,Ei,0)).add(po),Ee.clone().add(new E.Vector3(0,Ei,0))].map(ll=>il.projectPoint(ll,new E.Vector3)),{container:sl,dispose:rl}=d.create3DDomContainer(ol)||{},al=new Af({target:sl,props:{id:Et,content:g.render(g.template,An),lineWidthZoom:.38*(.01+re.position.distanceTo(Ee)/u),lineHeightZoom:.4+(re.position.distanceTo(Ee)-c)/u*.6,contentZoom:.1+re.position.distanceTo(Ee)/u,upsideDown:Ee.y>l,folded:g.folded,events:g.events,hooks:p,dispose:rl}});ye.push({position:Ee,normal:ze,id:Et,app:al})}}return ye},k=se=>{g.points=se.points.map(ve=>{var ye,re;return{id:ve.id,position:new E.Vector3().fromArray(ve.position),normal:new E.Vector3().fromArray(ve.normal),replacement:(ye=ve.replacement)!=null?ye:{},weight:(re=ve.weight)!=null?re:-1}}),se.render&&(g.render=se.render),se.template&&(g.template=se.template),se.events&&(g.events=se.events),se.enabled===!1&&(g.enabled=se.enabled),se.folded===!0&&(g.folded=se.folded)},G=se=>{g.intersectObjects=se,C()},O=()=>{g.enabled=!0,C()},W=()=>{g.enabled=!1,A.$set({origins:[]}),g.tags.forEach(se=>{se.app.$destroy(),se=null}),g.origins=[],g.tags=[]},U=()=>{g.folded=!1,g.tags.forEach(se=>{se.app.$set({folded:g.folded})})},P=()=>{g.folded=!0,g.tags.forEach(se=>{se.app.$set({folded:g.folded})})},I=se=>{g.tags.forEach(ve=>{ve.id===se&&ve.app.$set({folded:!1})})},z=se=>{g.tags.forEach(ve=>{ve.id===se&&ve.app.$set({folded:!0})})},H=()=>{i.once("renderFrame",L)},X=()=>{e||(e=i.getElement().parentElement),e&&e.appendChild(h),g.forbidden=!1,n=i.model.bounding.getCenter(new E.Vector3).y,C(),i.on("panoWillArrive",y),i.on("panoArrived",w),i.on("modeChange",x),i.on("cameraUpdate",v)},Z=()=>{m=null,d.disposeAll(),A.$destroy(),g.tags.forEach(se=>{se.app.$destroy(),se=null}),g.origins=[],g.tags=[],i.off("modelLoaded",X),i.off("renderFrame",L),i.off("panoWillArrive",y),i.off("panoArrived",w),i.off("modeChange",x),i.off("cameraUpdate",v),i.off("dispose",Z),window.removeEventListener("resize",H,!1)};return window.addEventListener("resize",H,!1),(Re=i==null?void 0:i.model)!=null&&Re.loaded?X():i.once("modelLoaded",X),i.on("dispose",Z),{load:k,setIntersectObjects:G,unfoldAll:U,foldAll:P,unfold:I,fold:z,enable:O,disable:W,hooks:p,dispose:Z}};var St=(i=>(i.SMALL="small",i.MIDLLE="middle",i.LARGE="large",i.EXTRA_LARGE="x-large",i))(St||{});function If(i){ae(i,"svelte-1ir3cyd",`.item-label-item.svelte-1ir3cyd{position:absolute;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:0}.item-label-item.visible.svelte-1ir3cyd{opacity:1;animation:svelte-1ir3cyd-fadeIn .3s ease-in}.item-label-item__text-wrap.svelte-1ir3cyd::before{content:'';position:absolute;width:100%;height:100%;background-color:rgba(0, 0, 0, .3);filter:blur(1rem);z-index:-1}.item-label-item__text-wrap.svelte-1ir3cyd{padding:0.375rem 0.375rem 0;position:absolute;height:1.25rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap;line-height:0.625rem;font-size:0.6875rem;font-weight:bold;color:#FFEAC0;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center}.item-label-item__text.svelte-1ir3cyd{padding-bottom:0.25rem;border-top:0 solid;border-left:0 solid;border-right:0 solid;border-bottom:0.0625rem solid;-o-border-image:linear-gradient(to right, rgba(234, 208, 154, 0), rgba(234, 208, 154, 100), rgba(234, 208, 154, 0)) 4.5 1 4.5;border-image:linear-gradient(to right, rgba(234, 208, 154, 0), rgba(234, 208, 154, 100), rgba(234, 208, 154, 0)) 4.5 1 4.5}.item-label-item__bar.svelte-1ir3cyd{position:absolute;bottom:0;width:0.0625rem;background-image:linear-gradient(to bottom, rgba(234, 208, 154, 0), rgba(234, 208, 154, 1))}@keyframes svelte-1ir3cyd-fadeIn{from{opacity:0
|
|
513
513
|
}to{opacity:1
|
|
514
|
-
}}`)}function xf(i){let t,e,n,o=(i[0].name.length>6?`${i[0].name.slice(0,6)}...`:i[0].name)+"",s,r,a,l,c,u;return{c(){t=j("div"),e=j("div"),n=j("span"),s=ke(o),r=_(),a=j("div"),b(n,"class","item-label-item__text svelte-1ir3cyd"),b(e,"class","item-label-item__text-wrap svelte-1ir3cyd"),R(e,"top",`-${i[0].strokeLength+26}px`),b(a,"class","item-label-item__bar svelte-1ir3cyd"),R(a,"height",`${i[0].strokeLength}px`),b(t,"class",l=
|
|
514
|
+
}}`)}function xf(i){let t,e,n,o=(i[0].name.length>6?`${i[0].name.slice(0,6)}...`:i[0].name)+"",s,r,a,l,c,u;return{c(){t=j("div"),e=j("div"),n=j("span"),s=ke(o),r=_(),a=j("div"),b(n,"class","item-label-item__text svelte-1ir3cyd"),b(e,"class","item-label-item__text-wrap svelte-1ir3cyd"),R(e,"top",`-${i[0].strokeLength+26}px`),b(a,"class","item-label-item__bar svelte-1ir3cyd"),R(a,"height",`${i[0].strokeLength}px`),b(t,"class",l=je(_e.default("item-label-item",{visible:i[0].visible}))+" svelte-1ir3cyd"),R(t,"z-index",i[0].zIndex),R(t,"transform",i[0].transform)},m(d,h){B(d,t,h),Q(t,e),Q(e,n),Q(n,s),Q(t,r),Q(t,a),c||(u=Pe(n,"click",i[1]),c=!0)},p(d,[h]){h&1&&o!==(o=(d[0].name.length>6?`${d[0].name.slice(0,6)}...`:d[0].name)+"")&&Te(s,o),h&1&&R(e,"top",`-${d[0].strokeLength+26}px`),h&1&&R(a,"height",`${d[0].strokeLength}px`),h&1&&l!==(l=je(_e.default("item-label-item",{visible:d[0].visible}))+" svelte-1ir3cyd")&&b(t,"class",l),h&1&&R(t,"z-index",d[0].zIndex),h&1&&R(t,"transform",d[0].transform)},i:te,o:te,d(d){d&&M(t),c=!1,u()}}}function kf(i,t,e){let{itemLabel:n}=t,{hooks:o}=t;function s(){console.log("__onclick___: ",n),o.emit("onLabelClick",n)}return i.$$set=r=>{"itemLabel"in r&&e(0,n=r.itemLabel),"hooks"in r&&e(2,o=r.hooks)},[n,s,o]}class Df extends oe{constructor(t){super(),ie(this,t,kf,xf,ne,{itemLabel:0,hooks:2},If)}}function ja(i,t=200){let e;return function(...n){clearTimeout(e),e=setTimeout(()=>{i(...n)},t)}}function Lf(i){ae(i,"svelte-gk8s47",".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}")}function Es(i,t,e){const n=i.slice();return n[26]=t[e],n}function Ps(i,t){let e,n,o;return n=new Df({props:{itemLabel:t[26],hooks:t[0]}}),{key:i,first:null,c(){e=fe(),ee(n.$$.fragment),this.first=e},m(s,r){B(s,e,r),K(n,s,r),o=!0},p(s,r){t=s;const a={};r&2&&(a.itemLabel=t[26]),r&1&&(a.hooks=t[0]),n.$set(a)},i(s){o||(D(n.$$.fragment,s),o=!0)},o(s){T(n.$$.fragment,s),o=!1},d(s){s&&M(e),$(n,s)}}}function Sf(i){let t,e=[],n=new Map,o,s,r=i[1];const a=l=>l[26].id;for(let l=0;l<r.length;l+=1){let c=Es(i,r,l),u=a(c);n.set(u,e[l]=Ps(u,c))}return{c(){t=j("div");for(let l=0;l<e.length;l+=1)e[l].c();b(t,"class","item-labels-container svelte-gk8s47"),xe(()=>i[9].call(t)),R(t,"opacity",i[4]?1:0)},m(l,c){B(l,t,c);for(let u=0;u<e.length;u+=1)e[u].m(t,null);o=bt(t,i[9].bind(t)),s=!0},p(l,[c]){c&3&&(r=l[1],le(),e=Ue(e,c,a,1,l,r,n,t,at,Ps,null,Es),ce()),c&16&&R(t,"opacity",l[4]?1:0)},i(l){if(!s){for(let c=0;c<r.length;c+=1)D(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)T(e[c]);s=!1},d(l){l&&M(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}let Is=26,zf=11;function Mf(i,t,e){const{Raycaster:n,Vector3:o}=E;let{five:s}=t,{modelOcclusionEnable:r}=t,{itemLabels:a}=t,{hooks:l}=t,{displayStrategyType:c}=t,u=null,d=null,h,p,m=[],g=!0;const A=(P,I)=>{const z=new n,H=P.camera.position.clone(),X=new o().fromArray(I.modelPosition),Z=X.distanceTo(H);z.set(H.clone(),X.clone().sub(H).normalize());const[Y]=P.model.intersectRaycaster(z);return!(Y&&Y.distance+1<Z)},v=(P,I)=>{const z=new o(I.modelPosition[0],I.modelPosition[1],I.modelPosition[2]),H=P.project2d(z),X=H==null?void 0:H.x,Z=H==null?void 0:H.y;return[X,Z]},w=P=>`translate(${P[0]}px, ${P[1]}px)`,y=(P,I)=>m.length===0?!1:!!m.find(H=>P[0]>=H[0]-I&&P[0]<=H[0]+I||P[1]>=H[1]-Is&&P[1]<=H[1]+Is);function x(P,I){switch(I){case St.SMALL:return Math.ceil(-27.78*P+85);case St.MIDLLE:return Math.ceil(-38.9*P+130);case St.LARGE:return Math.ceil(-44.44*P+140);case St.EXTRA_LARGE:return Math.ceil(-92.59*P+300)}}const L=(P,I)=>{const z=I.map(X=>{const Z=v(P,X),Y=X.name.length*zf,V=x(X.modelPosition[1],c),de=(r?A(P,X):!0)&&!y([Z[0],Z[1]+V],Y);if(!de)return he(N({},X),{visible:de});m.push(Z);const me=w(Z);return he(N({},X),{visible:de,transform:me,strokeLength:V})}),H=z.filter(({visible:X})=>X).map(X=>({itemLabelItem:X,distance:new o(X.modelPosition[0],X.modelPosition[1],X.modelPosition[2]).clone().distanceTo(P.camera.position)})).sort((X,Z)=>X.distance-Z.distance);return z.map(X=>{const Z=H.findIndex(Y=>Y.itemLabelItem.id===X.id);return Z!==void 0?he(N({},X),{zIndex:Z*10}):X})},C=()=>{m=[],e(1,d=L(s,d))};Zi(()=>{O()});const S=()=>{e(4,g=!1),k()};Ye(()=>{e(1,d=a),u=a,C(),G(),s.on("cameraUpdate",S)});const k=ja(()=>{e(4,g=!0),C()},300),G=()=>{window.addEventListener("resize",W,!1)},O=()=>{u!==a&&(e(1,d=a),u=a,C())},W=()=>{s.once("renderFrame",C)};yt(()=>{s.off("cameraUpdate",S),window.removeEventListener("resize",W,!1)});function U(){h=this.clientWidth,p=this.clientHeight,e(2,h),e(3,p)}return i.$$set=P=>{"five"in P&&e(5,s=P.five),"modelOcclusionEnable"in P&&e(6,r=P.modelOcclusionEnable),"itemLabels"in P&&e(7,a=P.itemLabels),"hooks"in P&&e(0,l=P.hooks),"displayStrategyType"in P&&e(8,c=P.displayStrategyType)},[l,d,h,p,g,s,r,a,c,U]}class Tf extends oe{constructor(t){super(),ie(this,t,Mf,Sf,ne,{five:5,modelOcclusionEnable:6,itemLabels:7,hooks:0,displayStrategyType:8},Lf)}}function Bf(i){return i.model_item_labels.map(t=>N({modelPosition:[t.position[0],t.position[1]+t.size[1],t.position[2]]},t))}const jf=(i,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 be.Subscribe,modelOcclusionEnable:(h=t==null?void 0:t.modelOcclusionEnable)!=null?h:!0,displayStrategyType:(p=t==null?void 0:t.displayStrategyType)!=null?p:St.SMALL};e.container.setAttribute("class","model-item-label-plugin-container"),e.container.style.cssText=`
|
|
515
515
|
position: absolute;
|
|
516
516
|
left: 0;
|
|
517
517
|
top: 0;
|
|
@@ -520,14 +520,14 @@ void main() {
|
|
|
520
520
|
z-index: 5;
|
|
521
521
|
`,e.container.style.pointerEvents="none";const n=m=>(e.wrapper=m,m.appendChild(e.container),l(),!0),o=m=>{e.itemLabels=Bf(m),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{u(),e.container.remove()},l=()=>{var m;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(m=e.app)==null||m.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new Tf({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType}})}},c=()=>{i.on("modeChange",d),i.once("dispose",a)},u=()=>{i.off("modeChange",d)},d=m=>{if(!!e.enabled){if(m!==be.Five.Mode.Floorplan){e.fiveModeEnabled=!1,l();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=i.currentMode===be.Five.Mode.Floorplan,l()})}};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},Qf={name:"ModelItemLabelPlugin",version:0};var Yt=(i=>(i.TOP_LEFT="topLeft",i.TOP_RIGHT="topRight",i.BOTTOM_LEFT="bottomLeft",i.BOTTOM_RIGHT="bottomRight",i))(Yt||{});function Rf(i){if(i.length===0)return[];if(Array.isArray(i[0]))return i;let t=[];return i.forEach(e=>{const n=[e[Yt.TOP_LEFT],e[Yt.BOTTOM_LEFT],e[Yt.BOTTOM_RIGHT],e[Yt.TOP_RIGHT]];t.push(n)}),t}const Of=(i,{videoElement:t})=>{const e={videoMeshes:[],videoTextureEnabled:!1,videoSource:"",rectPoints:[],enabled:!1,videoElement:t},n=Kt(i),o=new Map,s=v=>{e.videoTexture&&(e.videoTexture.image.muted=v)},r=()=>e.videoTexture?e.videoTexture.image.muted:!0,a=()=>{if(e.enabled||!e.videoTexture)return;e.enabled=!0,e.videoMeshes=c(),e.videoMeshes.forEach(w=>i.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(x=>{x.material.map!==e.videoTexture&&(x.material.map=e.videoTexture)}),i.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(i.model.loaded)v();else return i.once("modelLoaded",()=>v())},l=()=>{!e.enabled||(e.enabled=!1,e.videoMeshes.forEach(v=>{v.geometry.dispose(),v.material.dispose(),i.scene.remove(v),e.videoTexture&&e.videoTexture.image.pause()}),e.videoMeshes=[],i.needsRender=!0)},c=()=>e.rectPoints.map((v,w)=>{const y=new E.BufferGeometry,x=128,L=[];L.push(...v[0].toArray());for(let P=1;P<x;P++)L.push(v[0].x+(v[1].x-v[0].x)*P/x,v[0].y+(v[1].y-v[0].y)*P/x,v[0].z+(v[1].z-v[0].z)*P/x);L.push(...v[1].toArray()),L.push(...v[2].toArray());for(let P=1;P<x;P++)L.push(v[2].x+(v[3].x-v[2].x)*P/x,v[2].y+(v[3].y-v[2].y)*P/x,v[2].z+(v[3].z-v[2].z)*P/x);L.push(...v[3].toArray());const C=[];C.push(0,1);for(let P=1;P<x;P++)C.push(0,1-P/x);C.push(0,0),C.push(1,0);for(let P=1;P<x;P++)C.push(1,P/x);C.push(1,1);const S=[];for(let P=0;P<x;P++)S.push(P,P+1,x*2-P,P,x*2-P,x*2+1-P);y.setAttribute("position",new E.BufferAttribute(new Float32Array(L),3)),y.setAttribute("uv",new E.BufferAttribute(new Float32Array(C),2)),y.setIndex(new E.BufferAttribute(new Uint32Array(S),1));const k=new E.AxesHelper(10);i.scene.add(k);const G=new E.MeshBasicMaterial({map:e.videoTextureEnabled?e.videoTexture:e.imageTexture,side:E.DoubleSide}),O=new E.Mesh(y,G);O.renderOrder=1,O.name=`ModelTVVideoPlugin-${w}-${performance.now()}`;const W=[v[1],v[2],v[3],v[0]],U=n.create3DDomContainer(W);if(U!=null&&U.container){const P=document.createElement("div");P.classList.add("play-icon"),P.style.width="100%",P.style.height="100%",P.style.display="flex",P.style.justifyContent="center",P.style.alignItems="center",P.style.pointerEvents="none",U.container.appendChild(P);const I=document.createElement("img");I.src="//vrlab-static.ljcdn.com/release/web/play.2ada5b6f.png",I.style.width="200px",I.style.pointerEvents="auto",I.onclick=()=>{e.videoTexture.image.muted=!1,e.videoTexture.image.play()},P.appendChild(I),o.set(O,U)}return O}),u=v=>{const w=new E.TextureLoader().load(v);return w.minFilter=E.LinearFilter,w.magFilter=E.LinearFilter,w.format=E.RGBFormat,w},d=(v,w)=>new Promise((y,x)=>{const L=new XMLHttpRequest;L.onreadystatechange=()=>{if(L.readyState==4)if(L.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(L.response);const S=new E.VideoTexture(w);S.minFilter=E.LinearFilter,S.magFilter=E.LinearFilter,S.format=E.RGBFormat,y(Object.assign(S,{videoSource:v}))}else x(new Error("Video download Error: "+L.status))},L.onerror=C=>x(C),L.open("GET",v),L.responseType="blob",L.send()}),h=(v,w)=>J(exports,null,function*(){const{video_src:y,video_poster_src:x,points:L}=v;e.videoSource=y,e.rectPoints=Rf(L).map(C=>C.map(({x:S,y:k,z:G})=>new E.Vector3(S,k,G))),e.imageTexture=u(x),w&&(e.videoElement=w),e.videoTexture=yield d(e.videoSource,e.videoElement),e.enabled=!!v.enable,e.enabled&&a()}),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},m=v=>{v==="Floorplan"?n.hide():n.show()},g=()=>{if(!e.enabled)return;const v=i.camera.position;if(o.forEach((w,y)=>{const x=w.css3DObject.position.clone(),L=x.clone().sub(v).normalize(),C=new E.Raycaster(v,L),S=i.model.intersectRaycaster(C)[0],k=x.distanceTo(v),G=.01;S&&S.distance+G<k?w.hide():w.show()}),!r()){const w=e.rectPoints.find(y=>{const x=y[0].clone().add(y[1]).add(y[2]).add(y[3]).divideScalar(4);return y.map(L=>L.clone().add(x).divideScalar(2)).filter(L=>{const C=L.distanceTo(v),S=new E.Raycaster(v,L.clone().sub(v).normalize()),k=i.model.intersectRaycaster(S)[0],G=.01;return!(k&&k.distance+G<C)}).length>=2});(!w||w.length===0)&&s(!0)}},A=()=>{l(),e.videoTexture=void 0,i.off("modeChange",m),i.off("wantsTapGesture",p),i.off("panoArrived",g),i.off("renderFrame",()=>{e.videoMeshes.forEach(v=>{v&&(v.needsRender=!0)})})};return i.on("modeChange",m),i.on("wantsTapGesture",p),i.on("panoArrived",g),i.on("renderFrame",()=>{e.videoMeshes.forEach(v=>{v&&(v.needsRender=!0)})}),{enable:a,disable:l,load:h,dispose:A,state:e,css3DRenderPlugin:n}};function Hf(i){ae(i,"svelte-gduhqw",`.item-label-item.svelte-gduhqw.svelte-gduhqw{position:absolute;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;animation:svelte-gduhqw-fadeIn .3s ease-in}.item-label-item.fold.svelte-gduhqw>.item-label-item__text-wrap.svelte-gduhqw{visibility:hidden}.item-label-item.fold.svelte-gduhqw>.item-label-item__bar.anchor.svelte-gduhqw{visibility:hidden}.item-label-item.fold.svelte-gduhqw>.item-label-item__bar.anchor.svelte-gduhqw:after{visibility:visible}.item-label-item__text-wrap.svelte-gduhqw.svelte-gduhqw{height:-moz-fit-content;height:fit-content;padding:0.75rem 1.25rem 0.75rem 0.75rem;position:absolute;width:-moz-max-content;width:max-content;max-width:29.5625rem;min-height:5.75rem;background-image:linear-gradient(269deg, rgba(0, 0, 0, 0.50) 0%, rgba(0, 0, 0, 0.60) 49%, rgba(31, 38, 46, 0.70) 100%);border:0.09375rem solid rgba(255, 255, 255, .65);border-radius:0.1875rem;color:white;transform:translate(-50%, 0);display:flex;justify-content:flex-start;align-items:center;box-sizing:border-box;overflow:hidden;pointer-events:all}.item-label-item__custom.svelte-gduhqw.svelte-gduhqw{padding:0;max-width:unset;min-height:unset;background-image:unset;border:0;border-radius:0}.icon-wrap.svelte-gduhqw.svelte-gduhqw{width:4.25rem;height:100%;display:flex;justify-content:center;align-content:center}.icon.svelte-gduhqw.svelte-gduhqw{width:4.25rem;height:4.25rem;background-repeat:no-repeat;background-size:contain;background-position:center}.item-label-text.svelte-gduhqw.svelte-gduhqw{margin-left:0.75rem;padding-left:0.75rem;min-height:4.25rem;height:auto;display:flex;flex-flow:column;justify-content:space-around;align-content:flex-start;border-left:solid rgba(255, 255, 255, .2) 0.0625rem;border-top:solid rgba(255, 255, 255, .2) 0;border-right:solid rgba(255, 255, 255, .2) 0;border-bottom:solid rgba(255, 255, 255, .2) 0;pointer-events:auto}.item-model.svelte-gduhqw.svelte-gduhqw{white-space:nowrap;font-size:1.375rem;font-weight:bold;line-height:1.875rem}.item-name.svelte-gduhqw.svelte-gduhqw{height:auto;word-wrap:break-word;word-break:break-all;font-size:1.25rem;line-height:1.75rem}.item-label-item__bar.svelte-gduhqw.svelte-gduhqw{position:absolute;bottom:0;width:0.1875rem;background-image:linear-gradient(to bottom, white, rgba(255, 255, 255, 0));box-shadow:0 0.125rem 0.5rem 0 rgba(0, 0, 0, 0.20);pointer-events:none}.item-label-item__bar.anchor.svelte-gduhqw.svelte-gduhqw:after{content:'';position:absolute;bottom:0;width:1.5rem;height:1.5rem;background-image:url("//vrlab-public.ljcdn.com/common/file/web/67e7a198-28c9-47dc-879b-507bd3ae600c.png ");background-position:center;background-size:contain;transform:translate(-0.65625rem, 50%)}@keyframes svelte-gduhqw-fadeIn{from{opacity:0
|
|
522
522
|
}to{opacity:1
|
|
523
|
-
}}`)}function Ff(i){let t,e,n,o=(i[0].code||i[0].id)+"",s,r,a,l=i[0].name+"",c,u=i[0].icon&&xs(i);return{c(){u&&u.c(),t=_(),e=j("div"),n=j("span"),s=ke(o),r=_(),a=j("span"),c=ke(l),b(n,"class","item-model svelte-gduhqw"),b(a,"class","item-name svelte-gduhqw"),b(e,"class","item-label-text svelte-gduhqw")},m(d,h){u&&u.m(d,h),B(d,t,h),B(d,e,h),Q(e,n),Q(n,s),Q(e,r),Q(e,a),Q(a,c)},p(d,h){d[0].icon?u?u.p(d,h):(u=xs(d),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null),h&1&&o!==(o=(d[0].code||d[0].id)+"")&&
|
|
523
|
+
}}`)}function Ff(i){let t,e,n,o=(i[0].code||i[0].id)+"",s,r,a,l=i[0].name+"",c,u=i[0].icon&&xs(i);return{c(){u&&u.c(),t=_(),e=j("div"),n=j("span"),s=ke(o),r=_(),a=j("span"),c=ke(l),b(n,"class","item-model svelte-gduhqw"),b(a,"class","item-name svelte-gduhqw"),b(e,"class","item-label-text svelte-gduhqw")},m(d,h){u&&u.m(d,h),B(d,t,h),B(d,e,h),Q(e,n),Q(n,s),Q(e,r),Q(e,a),Q(a,c)},p(d,h){d[0].icon?u?u.p(d,h):(u=xs(d),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null),h&1&&o!==(o=(d[0].code||d[0].id)+"")&&Te(s,o),h&1&&l!==(l=d[0].name+"")&&Te(c,l)},d(d){u&&u.d(d),d&&M(t),d&&M(e)}}}function Gf(i){let t;return{c(){t=j("div")},m(e,n){B(e,t,n),i[6](t)},p:te,d(e){e&&M(t),i[6](null)}}}function xs(i){let t,e,n,o,s;return{c(){t=j("div"),e=j("div"),b(e,"class","icon svelte-gduhqw"),b(e,"style",n=`background-image: url(${i[0].icon})`),b(t,"class","icon-wrap svelte-gduhqw")},m(r,a){B(r,t,a),Q(t,e),o||(s=Pe(t,"click",i[7]),o=!0)},p(r,a){a&1&&n!==(n=`background-image: url(${r[0].icon})`)&&b(e,"style",n)},d(r){r&&M(t),o=!1,s()}}}function Nf(i){let t,e,n,o,s,r,a,l,c,u;function d(m,g){return g&1&&(n=null),n==null&&(n=!!Boolean(typeof m[0].render=="function")),n?Gf:Ff}let h=d(i,-1),p=h(i);return{c(){t=j("div"),e=j("div"),p.c(),s=_(),r=j("div"),b(e,"class",o=je(_e.default("item-label-item__text-wrap",{"item-label-item__custom":Boolean(typeof i[0].render=="function")}))+" svelte-gduhqw"),R(e,"bottom",`${i[0].strokeLength}px`),b(r,"class",a=je(_e.default("item-label-item__bar",{anchor:i[1]}))+" svelte-gduhqw"),R(r,"height",`${i[0].strokeLength}px`),b(t,"class",l=je(_e.default("item-label-item",{fold:i[0].isFold}))+" svelte-gduhqw"),R(t,"z-index",i[0].zIndex),R(t,"transform",i[0].transform)},m(m,g){B(m,t,g),Q(t,e),p.m(e,null),Q(t,s),Q(t,r),c||(u=Pe(e,"click",i[4]),c=!0)},p(m,[g]){h===(h=d(m,g))&&p?p.p(m,g):(p.d(1),p=h(m),p&&(p.c(),p.m(e,null))),g&1&&o!==(o=je(_e.default("item-label-item__text-wrap",{"item-label-item__custom":Boolean(typeof m[0].render=="function")}))+" svelte-gduhqw")&&b(e,"class",o),g&1&&R(e,"bottom",`${m[0].strokeLength}px`),g&2&&a!==(a=je(_e.default("item-label-item__bar",{anchor:m[1]}))+" svelte-gduhqw")&&b(r,"class",a),g&1&&R(r,"height",`${m[0].strokeLength}px`),g&1&&l!==(l=je(_e.default("item-label-item",{fold:m[0].isFold}))+" svelte-gduhqw")&&b(t,"class",l),g&1&&R(t,"z-index",m[0].zIndex),g&1&&R(t,"transform",m[0].transform)},i:te,o:te,d(m){m&&M(t),p.d(),c=!1,u()}}}function Wf(i,t,e){let{itemLabel:n}=t,{hooks:o}=t,{anchorEnabled:s}=t,{onIconClick:r}=t;function a(){o.emit("onLabelClick",n)}let l;function c(d){Me[d?"unshift":"push"](()=>{l=d,e(3,l)})}const u=d=>r(n);return i.$$set=d=>{"itemLabel"in d&&e(0,n=d.itemLabel),"hooks"in d&&e(5,o=d.hooks),"anchorEnabled"in d&&e(1,s=d.anchorEnabled),"onIconClick"in d&&e(2,r=d.onIconClick)},i.$$.update=()=>{if(i.$$.dirty&9&&typeof n.render=="function"&&l&&l.children.length===0){const d=n.render(n);d&&l.appendChild(d)}},[n,s,r,l,a,o,c,u]}class Xf extends oe{constructor(t){super(),ie(this,t,Wf,Nf,ne,{itemLabel:0,hooks:5,anchorEnabled:1,onIconClick:2},Hf)}}const{Raycaster:Yf,Vector3:G0}=E,ks=(i,t,e,n)=>{const o=t.clone().sub(e).normalize(),s=new Yf;s.set(e,o);const[r]=i.model.intersectRaycaster(s);return r&&r.distance+.01<n};var zt=(i=>(i.SMALL="small",i.MIDLLE="middle",i.LARGE="large",i.EXTRA_LARGE="x-large",i))(zt||{});const Uf=(i,t)=>{switch(t){case zt.SMALL:return Math.ceil(-27.78*i+85);case zt.MIDLLE:return Math.ceil(-38.9*i+130);case zt.LARGE:return Math.ceil(-44.44*i+140);case zt.EXTRA_LARGE:return Math.ceil(-92.59*i+300)}},Vf=i=>`translate(${i[0]}px, ${i[1]}px)`;function Ds(i){return i.map(t=>N({observerIndex:void 0,visible:!1,isFold:!1},t))}function Jf(i){ae(i,"svelte-gk8s47",".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}")}function Ls(i,t,e){const n=i.slice();return n[30]=t[e],n}function Ss(i){let t,e;return t=new Xf({props:{itemLabel:i[30],hooks:i[0],anchorEnabled:i[2],onIconClick:i[6]}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o[0]&2&&(s.itemLabel=n[30]),o[0]&1&&(s.hooks=n[0]),o[0]&4&&(s.anchorEnabled=n[2]),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function zs(i,t){let e,n,o,s=t[30].visible&&Ss(t);return{key:i,first:null,c(){e=fe(),s&&s.c(),n=fe(),this.first=e},m(r,a){B(r,e,a),s&&s.m(r,a),B(r,n,a),o=!0},p(r,a){t=r,t[30].visible?s?(s.p(t,a),a[0]&2&&D(s,1)):(s=Ss(t),s.c(),D(s,1),s.m(n.parentNode,n)):s&&(le(),T(s,1,1,()=>{s=null}),ce())},i(r){o||(D(s),o=!0)},o(r){T(s),o=!1},d(r){r&&M(e),s&&s.d(r),r&&M(n)}}}function _f(i){let t,e=[],n=new Map,o,s,r=i[1];const a=l=>l[30].id;for(let l=0;l<r.length;l+=1){let c=Ls(i,r,l),u=a(c);n.set(u,e[l]=zs(u,c))}return{c(){t=j("div");for(let l=0;l<e.length;l+=1)e[l].c();b(t,"class","item-labels-container svelte-gk8s47"),xe(()=>i[12].call(t)),R(t,"opacity",i[5]?1:0)},m(l,c){B(l,t,c);for(let u=0;u<e.length;u+=1)e[u].m(t,null);o=bt(t,i[12].bind(t)),s=!0},p(l,c){c[0]&71&&(r=l[1],le(),e=Ue(e,c,a,1,l,r,n,t,at,zs,null,Ls),ce()),c[0]&32&&R(t,"opacity",l[5]?1:0)},i(l){if(!s){for(let c=0;c<r.length;c+=1)D(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)T(e[c]);s=!1},d(l){l&&M(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}let Zf=11;function qf(i,t,e){const{Raycaster:n,Vector3:o}=E;let{five:s}=t,{modelOcclusionEnable:r}=t,{itemLabels:a}=t,{hooks:l}=t,{displayStrategyType:c}=t,{maxVisibleDistance:u}=t,d=null,h=null,p=(s==null?void 0:s.currentMode)===be.Five.Mode.Panorama,m,g,A=[],v=!0;const w=(z,H)=>{const X=z.camera.position.clone(),Z=new o(H.modelPosition[0],H.modelPosition[1],H.modelPosition[2]),Y=Z.distanceTo(X);return u!==void 0&&z.state.mode===be.Five.Mode.Panorama&&Y>u?!1:ks(z,Z.clone().sub(X).normalize(),X,Y)},y=z=>{const{camera:H,model:X}=s,{x:Z,y:Y,z:V}=z.clone().project(H),ue=(Z+1)/2,de=(2-(Y+1))/2,De=Math.abs(V)<1&&[ue,de].every(Re=>Re<1&&Re>=0);return Boolean(De)},x=(z,H)=>{const X=new o(H.modelPosition[0],H.modelPosition[1],H.modelPosition[2]),Z=z.project2d(X),Y=Z==null?void 0:Z.x,V=Z==null?void 0:Z.y;return[Y,V]},L=(z,H)=>{const X=H.map(Y=>{if(z.state.panoIndex!==Y.panoIndex)return he(N({},Y),{visible:!1});const V=x(z,Y);Y.name.length*Zf;const ue=Uf(Y.modelPosition[1],c),de=z.currentMode===be.Five.Mode.Panorama?y(new o(Y.position[0],Y.position[1],Y.position[2])):!0,me=r?w(z,Y):!1,Ce=de&&!me;if(!Ce)return he(N({},Y),{visible:Ce});A.push(V);const De=Vf(V);return he(N({},Y),{visible:Ce,transform:De,strokeLength:ue})}),Z=X.filter(({visible:Y})=>Y).map(Y=>({itemLabelItem:Y,distance:new o(Y.modelPosition[0],Y.modelPosition[1],Y.modelPosition[2]).clone().distanceTo(z.camera.position)})).sort((Y,V)=>Y.distance-V.distance);return X.map(Y=>{const V=Z.findIndex(ue=>ue.itemLabelItem.id===Y.id);return V!==void 0?he(N({},Y),{zIndex:V*10}):Y})},C=()=>{A=[],e(1,h=L(s,h))},S=()=>{e(5,v=!1),k()},k=ja(()=>{e(5,v=!0),C()},300),G=()=>{s.once("renderFrame",C)},O=()=>{window.addEventListener("resize",G,!1)},W=()=>{d!==a&&(e(1,h=Ds(a)),d=a,C())},U=(z,H)=>{let X=[];for(let Y=0;Y<H.length;Y++){const{position:V,panoIndex:ue}=H[Y],de=z.distanceTo(V);(u===void 0||de<=u||s.state.mode!==be.Five.Mode.Panorama)&&X.push({panoIndex:ue,obVector:V,distance:de})}X=X.sort((Y,V)=>Y.distance-V.distance);let Z;for(let Y=0;Y<X.length;Y++){const{obVector:V,distance:ue,panoIndex:de}=X[Y];if(!ks(s,z,V,ue)){Z=de;break}}return typeof Z=="number"?H[Z]:void 0},P=z=>{if(s.state.mode===be.Five.Mode.Panorama)return;const H=s.work.observers,X=new o().fromArray(z.position),Z=U(X,H);if(Z&&(z.observerIndex=Z.panoIndex),typeof z.observerIndex=="number"){const Y=H[z.observerIndex],V=X.clone().sub(Y.position).normalize(),ue={longitude:Math.PI+Math.atan2(V.x,V.z),latitude:Math.acos(V.y/V.length())-Math.PI/2};s.setState(he(N({},ue),{mode:be.Five.Mode.Panorama,panoIndex:z.observerIndex})),s.once("initAnimationEnded",()=>{e(1,h=h.map(de=>he(N({},de),{isFold:de.id!==z.id}))),s.once("cameraUpdate",()=>{e(1,h=h.map(de=>he(N({},de),{isFold:!1})))})})}};Zi(()=>{W()}),Ye(()=>{e(1,h=Ds(a)),d=a,C(),O(),s.on("cameraUpdate",S)}),yt(()=>{s.off("cameraUpdate",S),window.removeEventListener("resize",G,!1)});function I(){m=this.clientWidth,g=this.clientHeight,e(3,m),e(4,g)}return i.$$set=z=>{"five"in z&&e(7,s=z.five),"modelOcclusionEnable"in z&&e(8,r=z.modelOcclusionEnable),"itemLabels"in z&&e(9,a=z.itemLabels),"hooks"in z&&e(0,l=z.hooks),"displayStrategyType"in z&&e(10,c=z.displayStrategyType),"maxVisibleDistance"in z&&e(11,u=z.maxVisibleDistance)},[l,h,p,m,g,v,P,s,r,a,c,u,I]}class Kf extends oe{constructor(t){super(),ie(this,t,qf,_f,ne,{five:7,modelOcclusionEnable:8,itemLabels:9,hooks:0,displayStrategyType:10,maxVisibleDistance:11},Jf,[-1,-1])}}function $f(i){return i.item_labels.map(t=>he(N({},t),{modelPosition:[t.position[0],t.position[1],t.position[2]],observerIndex:void 0}))}const em=void 0,tm=(i,t)=>{var h,p,m,g;const e={container:document.createElement("div"),data:null,enabled:!0,fiveModeEnabled:!0,itemLabels:[],wrapper:null,app:void 0,hooks:new be.Subscribe,modelOcclusionEnable:(h=t==null?void 0:t.modelOcclusionEnable)!=null?h:!0,onlyVisibleInPanorama:(p=t==null?void 0:t.onlyVisibleInPanorama)!=null?p:!0,displayStrategyType:(m=t==null?void 0:t.displayStrategyType)!=null?m:zt.SMALL,maxVisibleDistance:(g=t==null?void 0:t.maxVisibleDistance)!=null?g:em};e.container.setAttribute("class","item-label-plugin-container"),e.container.style.cssText=`
|
|
524
524
|
position: absolute;
|
|
525
525
|
left: 0;
|
|
526
526
|
top: 0;
|
|
527
527
|
width: 100%;
|
|
528
528
|
height: 100%;
|
|
529
529
|
z-index: 5;
|
|
530
|
-
`,e.container.style.pointerEvents="none";const n=A=>(e.wrapper=A,A.appendChild(e.container),l(),!0),o=A=>{e.itemLabels=$f(A),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{u(),e.container.remove()},l=()=>{var A;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(A=e.app)==null||A.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new Kf({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,onlyVisibleInPanorama:e.onlyVisibleInPanorama,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},c=()=>{i.on("modeChange",d),i.once("dispose",a)},u=()=>{i.off("modeChange",d)},d=A=>{if(A!==be.Five.Mode.Panorama){e.fiveModeEnabled=!1,r();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=!0,s()})};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},nm={name:"ItemLabelPlugin",version:0};class im extends ai{constructor(e){super(e);f(this,"state");f(this,"container");f(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(he(N({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(he(N({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(he(N({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(he(N({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=N({},this.state);this.state=N(N(N({},this.state),e),n),this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===be.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState(he(N({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function om(i){ae(i,"svelte-wpy7pz",'.plugin-DoorLabelPlugin-item.svelte-wpy7pz.svelte-wpy7pz{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity 0.3s ease}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz{position:absolute;top:50%;left:50%;border-radius:0.125rem;background:rgba(0, 0, 0, 0.35);line-height:0.75rem;padding:0.375rem;white-space:nowrap;font-size:0.75rem;font-style:normal;color:white;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform ease 1s, background ease 0.3s, color ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz::after{content:"";display:block;position:absolute;top:-0.0625rem;left:-0.0625rem;bottom:-0.0625rem;right:-0.0625rem;border-radius:0.125rem;border:0.0625rem solid rgba(0, 0, 0, 0);-o-border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;transition:opacity ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(255, 255, 255, 0.5)}.plugin-DoorLabelPlugin-icon.svelte-wpy7pz.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/DoorLabel-icon.de1304ae.svg") no-repeat;background-size:100%;display:inline-block;width:0.625rem;height:0.625rem;margin-left:0.25rem;transform-origin:center}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz{color:#f9eac1}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/arrow.6e8ec00e.svg") no-repeat}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(249, 234, 193, 0.5)}')}function sm(i){let t,e,n,o,s,r,a,l;return{c(){t=j("div"),e=j("div"),n=j("span"),n.textContent=`${i[8]}`,o=_(),s=j("i"),b(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),b(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),b(e,"class",r=Se(_e.default("plugin-DoorLabelPlugin-cnt",i[0].toward))+" svelte-wpy7pz"),b(e,"style",`transform: ${i[6]||"initial"};pointer-events: ${i[5]?"auto":"none"};opacity: ${i[5]?1:0}`),b(e,"data-camera-toward",i[7]),b(t,"style",`left: ${i[3]||0}%;top: ${i[4]||0}%;opacity: ${i[5]?1:0}`),b(t,"class","plugin-DoorLabelPlugin-item svelte-wpy7pz")},m(c,u){B(c,t,u),Q(t,e),Q(e,n),Q(e,o),Q(e,s),i[10](t),a||(l=Pe(e,"click",i[9]),a=!0)},p(c,[u]){u&1&&r!==(r=Se(_e.default("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&b(e,"class",r)},i:te,o:te,d(c){c&&M(t),i[10](null),a=!1,l()}}}function rm(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:u,cameraToward:d,name:h}=n,p=0;const m=()=>{if(!r||!a||!l||!s)return;const v=s.current.clientWidth/window.innerWidth*100,w=s.current.clientHeight/window.innerHeight*100;if(r<=v/2||r>=100-v/2||a<=w/2||a>=100-w/2)return;u!==p&&(console.log("panoDoorLabelPlugin",u,"\u89E6\u53D1\u57CB\u70B9"),p=u)},g=v=>{o&&o()};function A(v){Te[v?"unshift":"push"](()=>{s=v,e(2,s)})}return i.$$set=v=>{"props"in v&&e(0,n=v.props),"onClick"in v&&e(1,o=v.onClick)},m(),[n,o,s,r,a,l,c,d,h,g,A]}class am extends oe{constructor(t){super(),ie(this,t,rm,sm,ne,{props:0,onClick:1},om)}}function lm(i,t){const e=Math.abs(i.top+i.height/2-t.top-t.height/2),n=Math.abs(i.left+i.width/2-t.left-t.width/2),o=(i.height+t.height)/2,s=(i.width+t.width)/2;return!(e>o&&n>s)}function cm(i){const{camera:t}=i,e=t.getWorldDirection(new F.Vector3);let n=Math.atan(e.z/e.x)*180/Math.PI,o="";return e.x<0&&(n+=180),n<0&&(n+=360),n>315||n<=45?o="right":n>45&&n<=135?o="back":n>135&&n<=225?o="left":n>225&&n<=315&&(o="forward"),o}function um(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function dm(i){const t=Math.PI/4;return i>-t&&i<=t?"left":i>t*3||i<=-t*3?"right":i>-t*3&&i<=-t?"forward":i>t&&i<=t*3?"back":""}const hm={userAction:!0};class fm extends im{constructor(e){super(e);f(this,"MinVisibledistance",1.8);f(this,"MaxVisibledistance",5);f(this,"OffsetHeight",-1.3);f(this,"rooms");f(this,"floorplanServerData");f(this,"doorLabelItems");f(this,"visibleLabelMap",new Map);f(this,"labelItems",[]);f(this,"doorLabels");f(this,"roomObservers");f(this,"loadData",(e,n)=>{n&&(this.MaxVisibledistance=n.MaxVisibledistance,this.MinVisibledistance=n.MinVisibledistance,this.OffsetHeight=n.OffsetHeight),this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(o=>{o.$destroy()}),this.labelItems=[],this.doorLabels=[],this.doorLabelItems=[],this.floorplanServerData=e,typeof this.five.ready=="function"?this.five.ready().then(()=>this.initData()):this.five.once("panoArrived",()=>{this.initData()})});f(this,"initRoomObservers",()=>{var s,r;const e=this.floorplanServerData.computed_data.floor_datas||[],o=(((r=(s=this.five)==null?void 0:s.work)==null?void 0:r.observers)||[]).map(a=>{const l=a.panoIndex,c=a.floorIndex,u=e==null?void 0:e.find(d=>d.floor_index===c);if(u){const d=u.rooms.find(h=>h.observer_indexs.includes(l));if(d)return{panoIndex:l,floorIndex:c,name:d.name}}}).filter(Boolean);this.roomObservers=o});f(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});f(this,"fixDoorVisibleAndPosition",()=>{this.initRoomObservers();const{panoIndex:e}=this.five;if(!this.visible||this.five.model.empty||e===null||!this.roomObservers.find(a=>a.panoIndex===e))return;const n=this.roomObservers.find(a=>a.panoIndex===e),s=this.five.work.observers.find(a=>a.panoIndex===e).position.clone(),r=(()=>{if(this.visibleLabelMap.has(e))return this.visibleLabelMap.get(e);{const a=[];return this.doorLabels.forEach((l,c)=>{if(l.roomName===n.name)return;const u=l.position.clone(),d=u.distanceTo(s);if(d<this.MinVisibledistance||d>this.MaxVisibledistance)return;const h=new F.Raycaster,p=u.clone().sub(s).normalize();h.set(s,p);const[m]=this.five.model.intersectRaycaster(h);m&&m.distance+.1<d||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});f(this,"fixDoorPosition",()=>{var u,d,h,p,m,g,A,v,w,y,x,L;const{panoIndex:e,camera:n}=this.five;if(e===null)return;if(this.five.currentMode!=="Panorama")return this.hideAllLabels();const o=this.five.getElement(),s=o.clientWidth,r=o.clientHeight,a=n.getWorldDirection(new F.Vector3),l=[],c=[...this.labelItems];if(c.forEach((C,S)=>{if(C.visible){const k=n.position.distanceTo(C.position),G=C.position.clone().add(new F.Vector3(0,this.OffsetHeight,0)),W=G.clone().sub(n.position).normalize().angleTo(a),U=G.clone().project(n),P=(U.x+1)/2.2*100,I=(-U.y+1)/2.2*100,z=P>=0&&P<=100&&I>=0&&I<=100&&k>this.MinVisibledistance&&k<=this.MaxVisibledistance;C.left=P,C.top=I,C.inSight=z&&W<Math.PI/2,C.cameraToward=cm(this.five),z?l.push({disFromCameraToLabel:k,left:P,top:I,index:S}):C.transform="translate(-50%, -50%)"}else C.inSight=!1}),l.length>1){let C=0;l.sort((S,k)=>k.disFromCameraToLabel-S.disFromCameraToLabel);for(let S=1;S<l.length;S++){const{index:k,left:G,top:O}=l[S-1],{index:W,left:U,top:P}=l[S],I=this.container.children[k],z=this.container.children[W];if(!I||!z)return;const H={left:s*G/100,top:r*O/100,width:(h=(d=(u=I.children)==null?void 0:u[0])==null?void 0:d.clientWidth)!=null?h:0,height:(g=(m=(p=I.children)==null?void 0:p[0])==null?void 0:m.clientHeight)!=null?g:0},X={left:s*U/100,top:r*P/100,width:(w=(v=(A=z.children)==null?void 0:A[0])==null?void 0:v.clientWidth)!=null?w:0,height:(L=(x=(y=z.children)==null?void 0:y[0])==null?void 0:x.clientHeight)!=null?L:0};lm(H,X)&&(C++,c[k].transform=`translate(-50%, ${(C-1)*100-50}%)`,c[W].transform=`translate(-50%, ${C*100-50}%)`)}}this.labelItems=c,this.render()});f(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:o}=this.five;let s,r,a=1/0;for(const l of o.observers)if(this.roomObservers.find(u=>u.panoIndex===l.panoIndex&&u.name===e)){const u=l.standingPosition,d=n.distanceTo(u);d<a&&(s=l.panoIndex,r=u.clone().sub(n).normalize(),a=d)}if(r!==null&&s!==null){const l={};if(a>0){const u=new F.Vector3(0,0,-1),d=r.clone(),h=new F.Quaternion;h.setFromUnitVectors(u,d);const p=new F.Euler;p.setFromQuaternion(h,"YXZ"),l.longitude=p.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});f(this,"initData",()=>{var s;this.doorLabels=[];const e=this.five.panoIndex,n=this.floorplanServerData.computed_data.observers[e].floor_index,o=n!==void 0&&((s=this.floorplanServerData.computed_data.floor_datas[n])==null?void 0:s.rooms);this.rooms=o,this.rooms&&this.rooms.length>0&&this.rooms.forEach(r=>{var c;const a=(c=this.floorplanServerData.computed_data.doors)==null?void 0:c.filter(u=>!!(u&&u.name===r.name)),l=this.five.work.observers.filter((u,d)=>!!r.observer_indexs.find(h=>h===d));a&&a.forEach(u=>{const d=u.position;let h=1/0,p;l.forEach(g=>{const A=g.standingPosition,v={x:A.x,y:A.y,z:A.z},w=um(d,v);w<h&&(h=w,p=v)}),p&&(d.y=p.y+.01);const m=new F.Vector3(d.x,d.y,d.z);m.add(new F.Vector3(-.2,1.8,0).applyEuler(new F.Euler(0,u.rad,0))),this.doorLabels.push({roomName:r.name,name:u.name,position:m,toward:dm(u.rad)})})}),this.labelItems=this.doorLabels.map(r=>he(N({},r),{left:0,top:0,visible:!1,inSight:!1,transform:"",cameraToward:""})),this.five.on("wantsToMoveToPano",this.hideAllLabels),this.five.on("modelLoaded",this.fixDoorVisibleAndPosition),this.five.on("panoArrived",this.fixDoorVisibleAndPosition),this.five.on("initAnimationEnded",this.fixDoorPosition),this.five.on("cameraUpdate",this.fixDoorPosition),this.five.on("mouseWheel",this.fixDoorPosition),this.five.on("pinchGesture",this.fixDoorPosition),this.fixDoorVisibleAndPosition()})}stateChangedCallback(e,n){if(this.hooks.hasListener("stateChange")){const o={state:this.state,prevState:e,userAction:n?n.userAction:hm.userAction};this.hooks.emit("stateChange",o)}}render(){if(!this.enabled){this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(e=>{e==null||e.$destroy()}),this.doorLabels=void 0;return}this.doorLabelItems&&this.doorLabelItems.forEach(e=>{e.$destroy()}),this.doorLabelItems=[],this.labelItems.forEach(e=>{this.doorLabelItems.push(new am({target:this.container,props:{props:e,onClick:()=>{this.onClick(e.name,e.position)}}}))})}initState(){return{enabled:!0,visible:!0}}dispose(){this&&this.five&&(this.five.off("wantsToMoveToPano",this.hideAllLabels),this.five.off("modelLoaded",this.fixDoorVisibleAndPosition),this.five.off("panoArrived",this.fixDoorVisibleAndPosition),this.five.off("initAnimationEnded",this.fixDoorPosition),this.five.off("cameraUpdate",this.fixDoorPosition),this.five.off("mouseWheel",this.fixDoorPosition),this.five.off("pinchGesture",this.fixDoorPosition),super.dispose())}}const mm=i=>new fm(i),pm=2,gm=3,Am=3,vm=2;function bm(i,t){var r,a,l;if(i.length<2)return console.warn("positionList length must be greater than 1"),[];const e=(r=t==null?void 0:t.unitWidth)!=null?r:.5,n=(a=t==null?void 0:t.unitHeight)!=null?a:.5,o=(l=t==null?void 0:t.skipPanoIndexMesh)!=null?l:!1,s=new E.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),u=s.getPoints(c),d=[];let h=0;const p=i;return p.forEach((m,g)=>{let A=0,v=99999999;u.forEach((C,S)=>{const k=C.distanceTo(m);k<v&&(A=S,v=k)});const w=u[A+1],y=w==null?void 0:w.distanceTo(m),x=u[A-1],L=x==null?void 0:x.distanceTo(m);if(A>h&&A-h>1){let C=A;x!==void 0&&L>.8&&(C=A+1),x!==void 0&&L>.2&&L<.3?C=A:v>.2&&v<.3&&(C=A+1);let S=h;if(w!==void 0&&y>.2&&y<.3?S=h+1:v>.2&&v<.3&&(S=h),u[S]&&u[S+1]){const O=p[g-1];if(O)if(O.equals(u[S]))S+=1;else{const W=new F.Vector3().subVectors(u[S+1],u[S]),U=new F.Vector3().subVectors(O,u[S]);W.angleTo(U)<Math.PI/2&&(S+=1)}}if(C<S||C-S<=1)return;const k=u.slice(S,C),G=Ms(k,e,n);d.push(G),h=A}}),d}else{const c=Math.ceil(s.getLength()),u=s.getPoints(c);return[Ms(u,e,n)]}}function Ms(i,t,e){const n=t/2,o=e/t,s=i.length,r=bl.default(i.map(v=>[v.x,v.z])),l=(i.length-1)*pm*gm,c=2*s,u=c*Am,d=c*vm,h=new Uint32Array(l),p=new Float32Array(u),m=new Float32Array(d);i.forEach((v,w)=>{});let g=0;for(let v=0;v<i.length;v++){const[w,y]=r[v][0],x=i[v],{x:L,y:C,z:S}=x,k=new F.Vector3(L+w*n,C+.05,S+y*n);p[v*6+0]=k.x,p[v*6+1]=k.y,p[v*6+2]=k.z;const G=new F.Vector3(L-w*n,C+.05,S-y*n);p[v*6+3]=G.x,p[v*6+4]=G.y,p[v*6+5]=G.z,g+=v>0?i[v-1].clone().sub(i[v]).length():0;const O=g/t/o;m[v*4+0]=0,m[v*4+1]=O,m[v*4+2]=1,m[v*4+3]=O,v!==i.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 A=new E.BufferGeometry;return A.setAttribute("position",new E.BufferAttribute(p,3)),A.setAttribute("uv",new E.BufferAttribute(m,2)),A.setIndex(new E.BufferAttribute(h,1)),A}function ym(i){const t=new E.TextureLoader().load(i.textureUrl);return t.wrapS=t.wrapT=E.RepeatWrapping,t.encoding=E.sRGBEncoding,new E.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function wm(i){return!Bt(i)}function Bt(i){return i!=null}const Qa="v1.0.1",Ra="GuideLinePlugin",Fi=`${Ra}@${Qa}`,Ts=i=>`${Fi}--${i}`;class Oa extends Ht{constructor(e,n){super(e,n);f(this,"state",{visible:!1,enabled:!0,disposed:!1});f(this,"data");f(this,"linesGroup");f(this,"disposedErrorLog",()=>{console.error(`${Fi} is disposed`)});f(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${Ra}_DEBUG__`]:this})}load(e,n,o=!0){return J(this,null,function*(){const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.hooks.emit("dataChange",r,s),this.data=r,this.linesGroup&&this.five.scene.remove(this.linesGroup);const a=this.getLinesGroup(r.routes);!a||(this.linesGroup=a,yield this.waitFiveModelLoaded(),this.five.scene.add(a),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n),this.five.needsRender=!0,this.hooks.emit("dataLoaded",r),console.log(`${Fi} loaded`,r))})}formatData(e){return J(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e})}show(e){return J(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return J(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){var s;if(this.state.disposed)return this.disposedErrorLog();const o=N({},this.state);this.state=N(N({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),qe(o,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0}),this.five.needsRender=!0)}handleEnable(e,n=!0){this.linesGroup&&(e?(this.five.scene.add(this.linesGroup),this.actionWhenEnabled(()=>this.hooks.emit("enable",{userAction:n}))):(this.five.scene.remove(this.linesGroup),this.hooks.emit("disable",{userAction:n})))}handleVisible(e,n=!0){this.linesGroup&&(e?(this.linesGroup.visible=!0,this.actionWhenEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.linesGroup.visible=!1,this.actionWhenEnabled(()=>this.hooks.emit("hide",{userAction:n}))))}handleDispose(){this.linesGroup&&this.five.scene.add(this.linesGroup)}getLinesGroup(e){const n=e.map(this.getLine.bind(this)).filter(Bt),o=new E.Group;if(o.name=Ts("route-group"),n.length!==0)return o.add(...n),o}getLine(e){var a,l,c,u;const n=new E.Group,o=e.panoIndexList.map(d=>{var h;return(h=this.five.work.observers[d])==null?void 0:h.standingPosition}).filter(Bt),s=bm(o,{skipPanoIndexMesh:(a=e.skipPanoIndexMesh)!=null?a:!0,unitWidth:(l=e.unitWidth)!=null?l:.6,unitHeight:(c=e.unitHeight)!=null?c:.4});if(!s)return;const r=ym({textureUrl:(u=e.arrowTextureUrl)!=null?u:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return s.forEach(d=>{const h=new E.Mesh(d,r);h.name=Ts("route-line-mesh"),n.add(h)}),n}waitFiveModelLoaded(){return J(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}f(Oa,"lasestVersion",Qa);const Ha=(i,t)=>new Oa(i,t);function Bs(i){const t=Math.abs(Math.cos(i.latitude));return new E.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function Cm(i,t){const e=Bs(i),n=Bs(t);return e.angleTo(n)}const Em=i=>J(exports,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),zn=Math.PI*2;function Pm(i){return i>=0&&i<zn?i:(i%zn+zn)%zn}function Im(i){return{longitude:Pm(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function xm(i,t,e,n){const o=-i/e,s=i;return o*n+s}function km(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const Fa="v1.0.6",Ga="CruisePlugin",di=`${Ga}@${Fa}`,js=()=>{console.error(`${di} is disposed`)},Dm=()=>{console.warn(`${di} is disabled`)},Lm=()=>{console.error(`${di} is disabled`)},Pi=new Map;class lo extends Ht{constructor(e,n){super(e,n);f(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});f(this,"data");f(this,"config");f(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});f(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Ga}_DEBUG__`]:this});const o=this.setFiveLinearUpdateCamera.bind(this),s=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",o),this.hooks.on("broke",s),this.hooks.on("end",s),this.hooks.on("pause",s),this.privateState.disposers.push(()=>{this.hooks.off("play",o),this.hooks.off("broke",s),this.hooks.off("end",s),this.hooks.off("pause",s)})}load(e,n,o){return J(this,null,function*(){var u,d,h,p,m;if(this.state.disposed)return js();this.privateState.fiveOriginGetProgress||(d=(u=this.five.controller)==null?void 0:u.cameraMotion)!=null&&d.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 s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.data=r,this.hooks.emit("dataChange",r,s);let a=[],l;const c=this.data.keyframes.filter(g=>g.data.panoIndex!==void 0);c.filter((g,A)=>{var v;return g.data.panoIndex!==((v=c[A-1])==null?void 0:v.data.panoIndex)}).map(g=>g.data.panoIndex).forEach(g=>{var v,w;const A=(v=this.five.work.observers[g])==null?void 0:v.floorIndex;if(A!==void 0)if(l===A){const y=a.length-1;a[y]=[...(w=a[y])!=null?w:[],g]}else{l=A;const y=a.length;a[y]=[g]}}),this.GuideLine||(this.GuideLine=Ha(this.five,this.config)),(m=this.GuideLine)==null||m.load({routes:a.map(g=>({panoIndexList:g}))}),this.setState({playing:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing),this.changeSpeed(this.state.speed),n&&this.setState(n,{userAction:o}),console.log(`${di} loaded`,r),this.hooks.emit("dataLoaded",r)})}play(e){this.setState({playing:!0},e)}playFrom(e){const{index:n,id:o,userAction:s}=e;this.state.playing&&this.setState({playing:!1},{userAction:s}),this.setState({playing:!0},{userAction:s,playFromIndex:n,playFromId:o})}playFromStart(e){return this.playFrom(he(N({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return J(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return J(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){var s;if(this.state.disposed)return js();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return Lm();const o=N({},this.state);this.state=N(N({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),e.playing!==void 0&&e.playing!==o.playing&&this.changePlayState(e.playing,n),e.speed!==void 0&&e.speed!==o.speed&&this.changeSpeed(e.speed,n==null?void 0:n.userAction),qe(o,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0})}formatData(e){return J(this,null,function*(){this.five.work||(yield this.waitFiveLoaded());const n=this.five.work.observers,o=(()=>{const s=e;return typeof s=="object"&&s!==null&&s.version&&s.data?s.data:s})();if(o.keyframes)return{keyframesId:He(),keyframes:o.keyframes.map((s,r)=>{var c;const a=o.keyframes[r+1],l=(()=>!a||a.start===void 0||s.end===void 0?0:a.start-s.end)();return N({id:(c=s.uuid)!=null?c:He(),moveIndex:r,stay:l,index:r},s)})};if(o.panoIndexList){let s=[];const{moveEffect:r,moveToFirstPanoEffect:a,moveToFirstPanoDuration:l}=o;return this.privateState.moveToFirstPanoEffect=a,this.privateState.moveToFirstPanoDuration=l,o.panoIndexList.forEach((c,u)=>{const d=(()=>{var A,v,w,y;const h=o.panoIndexList.slice(u).find(x=>x!==c);if(h===void 0)return;const p=(A=n[c])==null?void 0:A.position,m=(v=n[h])==null?void 0:v.position;if(!m||!p||((w=n[c])==null?void 0:w.floorIndex)!==((y=n[h])==null?void 0:y.floorIndex))return;const g=new E.Vector3().subVectors(m,p);return Im(g)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:u,stay:o.stay,data:N({effect:"Move",panoIndex:c,moveEffect:r},d!=null?d:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:u,stay:o.stay,data:{effect:"Move",panoIndex:c,moveEffect:r}}),d&&s.push({moveIndex:u,stay:o.stay,data:N({effect:"Rotate",panoIndex:c},d)}))}),{keyframesId:He(),keyframes:s.map((c,u)=>N({id:He(),index:u},c))}}else throw new Error("format error: data no keyframes or no panoIndexList")})}handleEnable(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.enable(),this.hooks.emit("enable",{userAction:n})):((s=this.GuideLine)==null||s.disable(),this.changePlayState(!1,{userAction:n}),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):((s=this.GuideLine)==null||s.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}changePlayState(e,n){this.actionIfStateIsEnabled(()=>{var o;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(o=n==null?void 0:n.userAction)!=null?o:!0})}),e?this.handlePlay(n):this.handlePause(n),this.state.playing=e}handlePlay(e){return J(this,null,function*(){var p;const{data:n,state:o,privateState:s,hooks:r}=this;if(s.playing||!(n!=null&&n.keyframes)||(n==null?void 0:n.keyframes.length)===0)return;const a=He();s.playId=a,s.playing=!0,s.broke=!1;const l=n.keyframes,c=this.getPauseData();(e==null?void 0:e.notEmitEvent)!==!0&&r.emit("play",{userAction:(p=e==null?void 0:e.userAction)!=null?p:!0});let u=!1;const h=yield(()=>J(this,null,function*(){var m,g;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(m=this.data)==null?void 0:m.keyframes.findIndex(A=>A.id===e.playFromId);if(c!=null&&c.keyframeId){const A=(g=this.data)==null?void 0:g.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect,duration:s.moveToFirstPanoDuration})),A){if(A.data.effect==="Move")return A.index;if(A.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(A,{duration:v}),u=!0,A.index+1}}}}))();this.clearPauseData();for(const m of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(h!==void 0&&m.index<h))try{r.emit("playIndexChange",m.index,m),yield this.playKeyframe(m,{moveEffect:u===!1?s.moveToFirstPanoEffect:void 0,duration:u===!1&&typeof s.moveToFirstPanoDuration=="number"?s.moveToFirstPanoDuration:800}),m.stay&&(yield km(m.stay)),u===!1&&(u=!0)}catch(g){return Promise.resolve("broke")}}o.playing&&a===s.playId&&(this.setState({playing:!1},{userAction:!1}),r.emit("end"),this.clearPauseData())})}handlePause(e){var r;const{state:n,privateState:o,hooks:s}=this;n.playing=!1,o.playing!==!1&&(o.playing=!1,this.setPauseData(),o.broke||this.forceInteruptUpdateCamera(),(e==null?void 0:e.notEmitEvent)!==!0&&s.emit("pause",{userAction:(r=e==null?void 0:e.userAction)!=null?r:!0}))}playKeyframe(e,n){return J(this,null,function*(){var s;const{privateState:o}=this;return((s=this.privateState.currentPlayKeyframe)==null?void 0:s.keyframe.id)!==e.id&&(this.privateState.currentPlayKeyframe={keyframe:e}),o.currentPlayQueue.push(this.getPlayPromise(e,n)),this.actionPromiseQueue()})}addInterruptListener(e){const n=()=>{this.privateState.modeChanging||e()},o=e;return this.five.once("gesture",o),this.five.once("wantsChangeMode",n),()=>{this.five.off("gesture",o),this.five.once("wantsChangeMode",n)}}getPlayPromise(e,n){return J(this,null,function*(){var s;const o=e.data;if(n.duration=(s=n==null?void 0:n.duration)!=null?s:e.start!==void 0&&e.end!==void 0?e.end-e.start:void 0,!!o)return new Promise((r,a)=>{let l=!1;this.addInterruptListener(()=>{if(!l)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),l=!0,a(new Error("play is interupted"))});try{if(l)return;const c=()=>{r(),l=!0};switch(o.effect){case"Move":this.move(o,n).then(c);break;case"Rotate":this.rotate(o,n).then(c);break;default:this.rotate(o,n).then(c)}}catch(c){}})})}actionPromiseQueue(){return J(this,null,function*(){const{privateState:e}=this;return new Promise((n,o)=>{if(e.currentPlayQueue.length===0){n();return}const s=e.currentPlayQueue.shift();if(!s){n();return}s.then(n,o)}).then(()=>e.currentPlayQueue.length===0?Promise.resolve():this.actionPromiseQueue())})}move(e,n){return J(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 J(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return yield this.changePano(e,n);yield this.updateCamera(e,n)})}updateCamera(e,n){return J(this,null,function*(){const{five:o,privateState:s,state:r}=this,a=(()=>{var h,p;const u=(h=r.config)==null?void 0:h.speedConfig,d=(p=e.rotateSpeed)!=null?p:u==null?void 0:u.rotateSpeed;if((u==null?void 0:u.rotateSpeedUnit)===void 0)return d;if(d!==void 0)return u.rotateSpeedUnit==="rad/ms"?d:d/1e3})(),l=(()=>{if(n.duration)return n.duration;if(a){const u=this.five.getCurrentState();return Cm(u,e)/a}return 800})();s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=l);const c=this.getSpeededDuration(l);return new Promise(u=>{Em(()=>o.updateCamera(e,c)),setTimeout(()=>u(),c)})})}changePano(e,n){return J(this,null,function*(){const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;const a=o.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);const l=(()=>{var h,p;const u=(h=r.config)==null?void 0:h.speedConfig,d=(p=e.moveSpeed)!=null?p:u==null?void 0:u.moveSpeed;if((u==null?void 0:u.moveSpeedUnit)===void 0)return d;if(d!==void 0)return u.moveSpeedUnit==="m/ms"?d:d/1e3})(),c=(()=>{if(n!=null&&n.duration)return n.duration;if(l&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const u=o.work.observers[o.panoIndex].position,d=o.work.observers[e.panoIndex].position;return u.distanceTo(d)/l}return 800})();s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=c),yield new Promise(u=>{var d,h,p;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:this.getSpeededDuration(c),effect:(p=(h=n==null?void 0:n.moveEffect)!=null?h:(d=this.state.config)==null?void 0:d.moveEffect)!=null?p:e.moveEffect,moveCancelCallback:()=>u(),moveEndCallback:()=>u()}),a&&o.once("panoArrived",()=>u())}),a&&(this.privateState.modeChanging=!1)})}changeSpeed(e,n=!0){const{state:o,privateState:s,hooks:r}=this,{currentPlayKeyframe:a}=s;if(r.emit("speedChange",e,{userAction:n}),o.playing&&a)try{const l=a.originDuration!==void 0?a.originDuration*(1-this.getProgress()):void 0,c=this.playKeyframe(a.keyframe,{duration:l});s.currentPlayQueue.push(c)}catch(l){}}getSpeededDuration(e){return e/this.state.speed}getProgress(){return this.five.controller.cameraMotion.progress}changeMode(e,n){return J(this,null,function*(){e.mode&&e.mode!==this.five.currentMode&&(this.privateState.modeChanging=!0,yield this.five.changeMode(e.mode,e,n),this.privateState.modeChanging=!1)})}forceInteruptUpdateCamera(){this.five.updateCamera({},0)}getPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Pi.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return Pi.set((n=this.data)==null?void 0:n.keyframesId,{keyframeId:(o=this.privateState.currentPlayKeyframe)==null?void 0:o.keyframe.id,fiveState:this.five.getCurrentState(),duration:(s=this.privateState.currentPlayKeyframe)==null?void 0:s.originDuration,playedProgress:this.getProgress()})}clearPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Pi.delete((n=this.data)==null?void 0:n.keyframesId)}clear(){this.clearPauseData(),this.privateState.currentPlayKeyframe=null}handleDispose(){var e,n;this.setState({playing:!1}),this.clearPauseData(),this.clear(),(e=this.GuideLine)==null||e.dispose(),this.GuideLine=void 0,(n=this.privateState.disposers)==null||n.forEach(o=>o==null?void 0:o())}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&Dm()}waitFiveLoaded(){return J(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}setFiveLinearUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=e=>{const n=this.five.controller.cameraMotion,o=e-n.startTime;return o<0?0:o>=n.duration?1:1-xm(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}f(lo,"PluginVersion",Fa);const Sm=i=>new lo(i);function zm(i,t){t.forEach(e=>{const n=new E.SphereGeometry(.02,16,16),o=[],s=[new E.MeshBasicMaterial({color:16776960}),new E.MeshBasicMaterial({color:16711935}),new E.MeshBasicMaterial({color:16711680}),new E.MeshBasicMaterial({color:65535})];if(e.position.length===4)e.position.forEach((r,a)=>{const l=s[a],c=new E.Mesh(n,l);c.position.copy(st(r)),o.push(c)});else{const r=s[0],a=new E.Mesh(n,r);a.position.copy(st(e.position)),o.push(a)}o.forEach(r=>{r.material.depthTest=!1,i.scene.add(r)})})}const ze=i=>i;function Na(i){if(i.length<3)return;const t=i.map(hn),e=t[1].clone().sub(t[0]),n=t[2].clone().sub(t[1]);return e.cross(n)}function Mn(i){if(Array.isArray(i)&&i.length===4){const t=i.map(hn);return Wr(t[0],t[2])}else return hn(i)}function Tn(i,t){if(i===void 0)return;const{min:e,max:n}=t!=null?t:{};if(!(e===void 0&&n===void 0))return!(typeof n=="number"&&n<i||typeof e=="number"&&e>i)}function Mm(i,t){i.model.loaded?t():i.once("modelLoaded",()=>t())}function Tm(i,t,e){const o=new E.Plane().setFromNormalAndCoplanarPoint(e,t),s=t.clone().sub(i).cross(new E.Vector3(0,1,0)).setLength(.01),r=new E.Vector3(0,.01,0);return[t.clone().sub(s).sub(r),t.clone().add(s).sub(r),t.clone().add(s).add(r),t.clone().sub(s).add(r)].map(l=>o.projectPoint(l,new E.Vector3))}const Qs=(i,t=1e3/60)=>{let e=null;const n=i;return(...s)=>{e&&clearTimeout(e),e=setTimeout(()=>{n==null||n(...s),e&&clearTimeout(e),e=null},t)}};function Bm(i,t=200){let e;return function(...n){e||(i.apply(this,n),e=setTimeout(function(){e=null},t))}}function jm(i,t){const[e,n]=t;if(e>=n||n<=1||e<=1)return-1;const o={},s=r=>(o[r]||(o[r]=i(r)),o[r]);for(let r=e;r<n;r++){const a=s(r),l=s(r-1);if(a<l)return r}return-1}function Rs(i,t){if(!t||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",i),unobserve:()=>window.removeEventListener("resize",i)};{const e=new ResizeObserver(i);return{observe:()=>e.observe(t),unobserve:()=>e.unobserve(t)}}}var Xe=(i=>(i.Two="2D",i.Three="3D",i))(Xe||{}),Ge=(i=>(i.PointTag="PointTag",i.PlaneTag="PlaneTag",i))(Ge||{}),We=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Link="Link",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.Custom="Custom",i))(We||{}),ei=(i=>(i.VrLink="vr",i.NormalLink="normal",i))(ei||{});function Qm(i){ae(i,"svelte-1omzoh4",".straight-line.svelte-1omzoh4{display:block;width:100%;height:100%;overflow:visible}")}function Os(i){let t,e,n,o;return{c(){t=Ae("path"),b(t,"fill","none"),b(t,"stroke","url(#"+i[4]+")"),b(t,"stroke-width","1"),b(t,"d","M0 0.5 L 148 0.5")},m(s,r){B(s,t,r),o=!0},p(s,r){i=s},i(s){o||(s&&xe(()=>{n&&n.end(1),e=Ot(t,qn,{duration:i[1],delay:i[0]}),e.start()}),o=!0)},o(s){e&&e.invalidate(),s&&(n=$t(t,qn,{duration:i[1],delay:i[2]})),o=!1},d(s){s&&M(t),s&&n&&n.end()}}}function Rm(i){let t,e,n,o,s,r=i[3]&&Os(i);return{c(){t=Ae("svg"),e=Ae("defs"),n=Ae("linearGradient"),o=Ae("stop"),s=Ae("stop"),r&&r.c(),b(o,"offset","25%"),b(o,"stop-color","white"),b(o,"stop-opacity","1"),b(s,"offset","100%"),b(s,"stop-color","white"),b(s,"stop-opacity","0.5"),b(n,"id",i[4]),b(n,"gradientUnits","userSpaceOnUse"),b(t,"class","straight-line svelte-1omzoh4"),b(t,"viewBox","0 0 148 1"),b(t,"preserveAspectRatio","none")},m(a,l){B(a,t,l),Q(t,e),Q(e,n),Q(n,o),Q(n,s),r&&r.m(t,null)},p(a,[l]){a[3]?r?(r.p(a,l),l&8&&D(r,1)):(r=Os(a),r.c(),D(r,1),r.m(t,null)):r&&(le(),T(r,1,1,()=>{r=null}),ce())},i(a){D(r)},o(a){T(r)},d(a){a&&M(t),r&&r.d()}}}function Om(i,t,e){let{inDelay:n=0}=t,{duration:o=0}=t,{outDelay:s=0}=t,{unfolded:r}=t;const a=He();return i.$$set=l=>{"inDelay"in l&&e(0,n=l.inDelay),"duration"in l&&e(1,o=l.duration),"outDelay"in l&&e(2,s=l.outDelay),"unfolded"in l&&e(3,r=l.unfolded)},[n,o,s,r,a]}class Wa extends oe{constructor(t){super(),ie(this,t,Om,Rm,ne,{inDelay:0,duration:1,outDelay:2,unfolded:3},Qm)}}function Hm(i){ae(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function Hs(i){let t,e,n,o,s;return{c(){t=j("div"),b(t,"class","shadow svelte-faoauy"),b(t,"style",e=`
|
|
530
|
+
`,e.container.style.pointerEvents="none";const n=A=>(e.wrapper=A,A.appendChild(e.container),l(),!0),o=A=>{e.itemLabels=$f(A),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{u(),e.container.remove()},l=()=>{var A;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(A=e.app)==null||A.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new Kf({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,onlyVisibleInPanorama:e.onlyVisibleInPanorama,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},c=()=>{i.on("modeChange",d),i.once("dispose",a)},u=()=>{i.off("modeChange",d)},d=A=>{if(A!==be.Five.Mode.Panorama){e.fiveModeEnabled=!1,r();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=!0,s()})};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},nm={name:"ItemLabelPlugin",version:0};class im extends ai{constructor(e){super(e);f(this,"state");f(this,"container");f(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(he(N({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(he(N({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(he(N({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(he(N({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=N({},this.state);this.state=N(N(N({},this.state),e),n),this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===be.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState(he(N({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function om(i){ae(i,"svelte-wpy7pz",'.plugin-DoorLabelPlugin-item.svelte-wpy7pz.svelte-wpy7pz{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity 0.3s ease}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz{position:absolute;top:50%;left:50%;border-radius:0.125rem;background:rgba(0, 0, 0, 0.35);line-height:0.75rem;padding:0.375rem;white-space:nowrap;font-size:0.75rem;font-style:normal;color:white;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform ease 1s, background ease 0.3s, color ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz::after{content:"";display:block;position:absolute;top:-0.0625rem;left:-0.0625rem;bottom:-0.0625rem;right:-0.0625rem;border-radius:0.125rem;border:0.0625rem solid rgba(0, 0, 0, 0);-o-border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;transition:opacity ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(255, 255, 255, 0.5)}.plugin-DoorLabelPlugin-icon.svelte-wpy7pz.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/DoorLabel-icon.de1304ae.svg") no-repeat;background-size:100%;display:inline-block;width:0.625rem;height:0.625rem;margin-left:0.25rem;transform-origin:center}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz{color:#f9eac1}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/arrow.6e8ec00e.svg") no-repeat}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(249, 234, 193, 0.5)}')}function sm(i){let t,e,n,o,s,r,a,l;return{c(){t=j("div"),e=j("div"),n=j("span"),n.textContent=`${i[8]}`,o=_(),s=j("i"),b(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),b(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),b(e,"class",r=je(_e.default("plugin-DoorLabelPlugin-cnt",i[0].toward))+" svelte-wpy7pz"),b(e,"style",`transform: ${i[6]||"initial"};pointer-events: ${i[5]?"auto":"none"};opacity: ${i[5]?1:0}`),b(e,"data-camera-toward",i[7]),b(t,"style",`left: ${i[3]||0}%;top: ${i[4]||0}%;opacity: ${i[5]?1:0}`),b(t,"class","plugin-DoorLabelPlugin-item svelte-wpy7pz")},m(c,u){B(c,t,u),Q(t,e),Q(e,n),Q(e,o),Q(e,s),i[10](t),a||(l=Pe(e,"click",i[9]),a=!0)},p(c,[u]){u&1&&r!==(r=je(_e.default("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&b(e,"class",r)},i:te,o:te,d(c){c&&M(t),i[10](null),a=!1,l()}}}function rm(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:u,cameraToward:d,name:h}=n,p=0;const m=()=>{if(!r||!a||!l||!s)return;const v=s.current.clientWidth/window.innerWidth*100,w=s.current.clientHeight/window.innerHeight*100;if(r<=v/2||r>=100-v/2||a<=w/2||a>=100-w/2)return;u!==p&&(console.log("panoDoorLabelPlugin",u,"\u89E6\u53D1\u57CB\u70B9"),p=u)},g=v=>{o&&o()};function A(v){Me[v?"unshift":"push"](()=>{s=v,e(2,s)})}return i.$$set=v=>{"props"in v&&e(0,n=v.props),"onClick"in v&&e(1,o=v.onClick)},m(),[n,o,s,r,a,l,c,d,h,g,A]}class am extends oe{constructor(t){super(),ie(this,t,rm,sm,ne,{props:0,onClick:1},om)}}function lm(i,t){const e=Math.abs(i.top+i.height/2-t.top-t.height/2),n=Math.abs(i.left+i.width/2-t.left-t.width/2),o=(i.height+t.height)/2,s=(i.width+t.width)/2;return!(e>o&&n>s)}function cm(i){const{camera:t}=i,e=t.getWorldDirection(new F.Vector3);let n=Math.atan(e.z/e.x)*180/Math.PI,o="";return e.x<0&&(n+=180),n<0&&(n+=360),n>315||n<=45?o="right":n>45&&n<=135?o="back":n>135&&n<=225?o="left":n>225&&n<=315&&(o="forward"),o}function um(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function dm(i){const t=Math.PI/4;return i>-t&&i<=t?"left":i>t*3||i<=-t*3?"right":i>-t*3&&i<=-t?"forward":i>t&&i<=t*3?"back":""}const hm={userAction:!0};class fm extends im{constructor(e){super(e);f(this,"MinVisibledistance",1.8);f(this,"MaxVisibledistance",5);f(this,"OffsetHeight",-1.3);f(this,"rooms");f(this,"floorplanServerData");f(this,"doorLabelItems");f(this,"visibleLabelMap",new Map);f(this,"labelItems",[]);f(this,"doorLabels");f(this,"roomObservers");f(this,"loadData",(e,n)=>{n&&(this.MaxVisibledistance=n.MaxVisibledistance,this.MinVisibledistance=n.MinVisibledistance,this.OffsetHeight=n.OffsetHeight),this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(o=>{o.$destroy()}),this.labelItems=[],this.doorLabels=[],this.doorLabelItems=[],this.floorplanServerData=e,typeof this.five.ready=="function"?this.five.ready().then(()=>this.initData()):this.five.once("panoArrived",()=>{this.initData()})});f(this,"initRoomObservers",()=>{var s,r;const e=this.floorplanServerData.computed_data.floor_datas||[],o=(((r=(s=this.five)==null?void 0:s.work)==null?void 0:r.observers)||[]).map(a=>{const l=a.panoIndex,c=a.floorIndex,u=e==null?void 0:e.find(d=>d.floor_index===c);if(u){const d=u.rooms.find(h=>h.observer_indexs.includes(l));if(d)return{panoIndex:l,floorIndex:c,name:d.name}}}).filter(Boolean);this.roomObservers=o});f(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});f(this,"fixDoorVisibleAndPosition",()=>{this.initRoomObservers();const{panoIndex:e}=this.five;if(!this.visible||this.five.model.empty||e===null||!this.roomObservers.find(a=>a.panoIndex===e))return;const n=this.roomObservers.find(a=>a.panoIndex===e),s=this.five.work.observers.find(a=>a.panoIndex===e).position.clone(),r=(()=>{if(this.visibleLabelMap.has(e))return this.visibleLabelMap.get(e);{const a=[];return this.doorLabels.forEach((l,c)=>{if(l.roomName===n.name)return;const u=l.position.clone(),d=u.distanceTo(s);if(d<this.MinVisibledistance||d>this.MaxVisibledistance)return;const h=new F.Raycaster,p=u.clone().sub(s).normalize();h.set(s,p);const[m]=this.five.model.intersectRaycaster(h);m&&m.distance+.1<d||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});f(this,"fixDoorPosition",()=>{var u,d,h,p,m,g,A,v,w,y,x,L;const{panoIndex:e,camera:n}=this.five;if(e===null)return;if(this.five.currentMode!=="Panorama")return this.hideAllLabels();const o=this.five.getElement(),s=o.clientWidth,r=o.clientHeight,a=n.getWorldDirection(new F.Vector3),l=[],c=[...this.labelItems];if(c.forEach((C,S)=>{if(C.visible){const k=n.position.distanceTo(C.position),G=C.position.clone().add(new F.Vector3(0,this.OffsetHeight,0)),W=G.clone().sub(n.position).normalize().angleTo(a),U=G.clone().project(n),P=(U.x+1)/2.2*100,I=(-U.y+1)/2.2*100,z=P>=0&&P<=100&&I>=0&&I<=100&&k>this.MinVisibledistance&&k<=this.MaxVisibledistance;C.left=P,C.top=I,C.inSight=z&&W<Math.PI/2,C.cameraToward=cm(this.five),z?l.push({disFromCameraToLabel:k,left:P,top:I,index:S}):C.transform="translate(-50%, -50%)"}else C.inSight=!1}),l.length>1){let C=0;l.sort((S,k)=>k.disFromCameraToLabel-S.disFromCameraToLabel);for(let S=1;S<l.length;S++){const{index:k,left:G,top:O}=l[S-1],{index:W,left:U,top:P}=l[S],I=this.container.children[k],z=this.container.children[W];if(!I||!z)return;const H={left:s*G/100,top:r*O/100,width:(h=(d=(u=I.children)==null?void 0:u[0])==null?void 0:d.clientWidth)!=null?h:0,height:(g=(m=(p=I.children)==null?void 0:p[0])==null?void 0:m.clientHeight)!=null?g:0},X={left:s*U/100,top:r*P/100,width:(w=(v=(A=z.children)==null?void 0:A[0])==null?void 0:v.clientWidth)!=null?w:0,height:(L=(x=(y=z.children)==null?void 0:y[0])==null?void 0:x.clientHeight)!=null?L:0};lm(H,X)&&(C++,c[k].transform=`translate(-50%, ${(C-1)*100-50}%)`,c[W].transform=`translate(-50%, ${C*100-50}%)`)}}this.labelItems=c,this.render()});f(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:o}=this.five;let s,r,a=1/0;for(const l of o.observers)if(this.roomObservers.find(u=>u.panoIndex===l.panoIndex&&u.name===e)){const u=l.standingPosition,d=n.distanceTo(u);d<a&&(s=l.panoIndex,r=u.clone().sub(n).normalize(),a=d)}if(r!==null&&s!==null){const l={};if(a>0){const u=new F.Vector3(0,0,-1),d=r.clone(),h=new F.Quaternion;h.setFromUnitVectors(u,d);const p=new F.Euler;p.setFromQuaternion(h,"YXZ"),l.longitude=p.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});f(this,"initData",()=>{var s;this.doorLabels=[];const e=this.five.panoIndex,n=this.floorplanServerData.computed_data.observers[e].floor_index,o=n!==void 0&&((s=this.floorplanServerData.computed_data.floor_datas[n])==null?void 0:s.rooms);this.rooms=o,this.rooms&&this.rooms.length>0&&this.rooms.forEach(r=>{var c;const a=(c=this.floorplanServerData.computed_data.doors)==null?void 0:c.filter(u=>!!(u&&u.name===r.name)),l=this.five.work.observers.filter((u,d)=>!!r.observer_indexs.find(h=>h===d));a&&a.forEach(u=>{const d=u.position;let h=1/0,p;l.forEach(g=>{const A=g.standingPosition,v={x:A.x,y:A.y,z:A.z},w=um(d,v);w<h&&(h=w,p=v)}),p&&(d.y=p.y+.01);const m=new F.Vector3(d.x,d.y,d.z);m.add(new F.Vector3(-.2,1.8,0).applyEuler(new F.Euler(0,u.rad,0))),this.doorLabels.push({roomName:r.name,name:u.name,position:m,toward:dm(u.rad)})})}),this.labelItems=this.doorLabels.map(r=>he(N({},r),{left:0,top:0,visible:!1,inSight:!1,transform:"",cameraToward:""})),this.five.on("wantsToMoveToPano",this.hideAllLabels),this.five.on("modelLoaded",this.fixDoorVisibleAndPosition),this.five.on("panoArrived",this.fixDoorVisibleAndPosition),this.five.on("initAnimationEnded",this.fixDoorPosition),this.five.on("cameraUpdate",this.fixDoorPosition),this.five.on("mouseWheel",this.fixDoorPosition),this.five.on("pinchGesture",this.fixDoorPosition),this.fixDoorVisibleAndPosition()})}stateChangedCallback(e,n){if(this.hooks.hasListener("stateChange")){const o={state:this.state,prevState:e,userAction:n?n.userAction:hm.userAction};this.hooks.emit("stateChange",o)}}render(){if(!this.enabled){this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(e=>{e==null||e.$destroy()}),this.doorLabels=void 0;return}this.doorLabelItems&&this.doorLabelItems.forEach(e=>{e.$destroy()}),this.doorLabelItems=[],this.labelItems.forEach(e=>{this.doorLabelItems.push(new am({target:this.container,props:{props:e,onClick:()=>{this.onClick(e.name,e.position)}}}))})}initState(){return{enabled:!0,visible:!0}}dispose(){this&&this.five&&(this.five.off("wantsToMoveToPano",this.hideAllLabels),this.five.off("modelLoaded",this.fixDoorVisibleAndPosition),this.five.off("panoArrived",this.fixDoorVisibleAndPosition),this.five.off("initAnimationEnded",this.fixDoorPosition),this.five.off("cameraUpdate",this.fixDoorPosition),this.five.off("mouseWheel",this.fixDoorPosition),this.five.off("pinchGesture",this.fixDoorPosition),super.dispose())}}const mm=i=>new fm(i),pm=2,gm=3,Am=3,vm=2;function bm(i,t){var r,a,l;if(i.length<2)return console.warn("positionList length must be greater than 1"),[];const e=(r=t==null?void 0:t.unitWidth)!=null?r:.5,n=(a=t==null?void 0:t.unitHeight)!=null?a:.5,o=(l=t==null?void 0:t.skipPanoIndexMesh)!=null?l:!1,s=new E.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),u=s.getPoints(c),d=[];let h=0;const p=i;return p.forEach((m,g)=>{let A=0,v=99999999;u.forEach((C,S)=>{const k=C.distanceTo(m);k<v&&(A=S,v=k)});const w=u[A+1],y=w==null?void 0:w.distanceTo(m),x=u[A-1],L=x==null?void 0:x.distanceTo(m);if(A>h&&A-h>1){let C=A;x!==void 0&&L>.8&&(C=A+1),x!==void 0&&L>.2&&L<.3?C=A:v>.2&&v<.3&&(C=A+1);let S=h;if(w!==void 0&&y>.2&&y<.3?S=h+1:v>.2&&v<.3&&(S=h),u[S]&&u[S+1]){const O=p[g-1];if(O)if(O.equals(u[S]))S+=1;else{const W=new F.Vector3().subVectors(u[S+1],u[S]),U=new F.Vector3().subVectors(O,u[S]);W.angleTo(U)<Math.PI/2&&(S+=1)}}if(C<S||C-S<=1)return;const k=u.slice(S,C),G=Ms(k,e,n);d.push(G),h=A}}),d}else{const c=Math.ceil(s.getLength()),u=s.getPoints(c);return[Ms(u,e,n)]}}function Ms(i,t,e){const n=t/2,o=e/t,s=i.length,r=bl.default(i.map(v=>[v.x,v.z])),l=(i.length-1)*pm*gm,c=2*s,u=c*Am,d=c*vm,h=new Uint32Array(l),p=new Float32Array(u),m=new Float32Array(d);i.forEach((v,w)=>{});let g=0;for(let v=0;v<i.length;v++){const[w,y]=r[v][0],x=i[v],{x:L,y:C,z:S}=x,k=new F.Vector3(L+w*n,C+.05,S+y*n);p[v*6+0]=k.x,p[v*6+1]=k.y,p[v*6+2]=k.z;const G=new F.Vector3(L-w*n,C+.05,S-y*n);p[v*6+3]=G.x,p[v*6+4]=G.y,p[v*6+5]=G.z,g+=v>0?i[v-1].clone().sub(i[v]).length():0;const O=g/t/o;m[v*4+0]=0,m[v*4+1]=O,m[v*4+2]=1,m[v*4+3]=O,v!==i.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 A=new E.BufferGeometry;return A.setAttribute("position",new E.BufferAttribute(p,3)),A.setAttribute("uv",new E.BufferAttribute(m,2)),A.setIndex(new E.BufferAttribute(h,1)),A}function ym(i){const t=new E.TextureLoader().load(i.textureUrl);return t.wrapS=t.wrapT=E.RepeatWrapping,t.encoding=E.sRGBEncoding,new E.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function wm(i){return!Bt(i)}function Bt(i){return i!=null}const Qa="v1.0.1",Ra="GuideLinePlugin",Fi=`${Ra}@${Qa}`,Ts=i=>`${Fi}--${i}`;class Oa extends Ht{constructor(e,n){super(e,n);f(this,"state",{visible:!1,enabled:!0,disposed:!1});f(this,"data");f(this,"linesGroup");f(this,"disposedErrorLog",()=>{console.error(`${Fi} is disposed`)});f(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${Ra}_DEBUG__`]:this})}load(e,n,o=!0){return J(this,null,function*(){const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.hooks.emit("dataChange",r,s),this.data=r,this.linesGroup&&this.five.scene.remove(this.linesGroup);const a=this.getLinesGroup(r.routes);!a||(this.linesGroup=a,yield this.waitFiveModelLoaded(),this.five.scene.add(a),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n),this.five.needsRender=!0,this.hooks.emit("dataLoaded",r),console.log(`${Fi} loaded`,r))})}formatData(e){return J(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e})}show(e){return J(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return J(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){var s;if(this.state.disposed)return this.disposedErrorLog();const o=N({},this.state);this.state=N(N({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),qe(o,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0}),this.five.needsRender=!0)}handleEnable(e,n=!0){this.linesGroup&&(e?(this.five.scene.add(this.linesGroup),this.actionWhenEnabled(()=>this.hooks.emit("enable",{userAction:n}))):(this.five.scene.remove(this.linesGroup),this.hooks.emit("disable",{userAction:n})))}handleVisible(e,n=!0){this.linesGroup&&(e?(this.linesGroup.visible=!0,this.actionWhenEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.linesGroup.visible=!1,this.actionWhenEnabled(()=>this.hooks.emit("hide",{userAction:n}))))}handleDispose(){this.linesGroup&&this.five.scene.add(this.linesGroup)}getLinesGroup(e){const n=e.map(this.getLine.bind(this)).filter(Bt),o=new E.Group;if(o.name=Ts("route-group"),n.length!==0)return o.add(...n),o}getLine(e){var a,l,c,u;const n=new E.Group,o=e.panoIndexList.map(d=>{var h;return(h=this.five.work.observers[d])==null?void 0:h.standingPosition}).filter(Bt),s=bm(o,{skipPanoIndexMesh:(a=e.skipPanoIndexMesh)!=null?a:!0,unitWidth:(l=e.unitWidth)!=null?l:.6,unitHeight:(c=e.unitHeight)!=null?c:.4});if(!s)return;const r=ym({textureUrl:(u=e.arrowTextureUrl)!=null?u:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return s.forEach(d=>{const h=new E.Mesh(d,r);h.name=Ts("route-line-mesh"),n.add(h)}),n}waitFiveModelLoaded(){return J(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}f(Oa,"lasestVersion",Qa);const Ha=(i,t)=>new Oa(i,t);function Bs(i){const t=Math.abs(Math.cos(i.latitude));return new E.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function Cm(i,t){const e=Bs(i),n=Bs(t);return e.angleTo(n)}const Em=i=>J(exports,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),zn=Math.PI*2;function Pm(i){return i>=0&&i<zn?i:(i%zn+zn)%zn}function Im(i){return{longitude:Pm(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function xm(i,t,e,n){const o=-i/e,s=i;return o*n+s}function km(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const Fa="v1.0.6",Ga="CruisePlugin",di=`${Ga}@${Fa}`,js=()=>{console.error(`${di} is disposed`)},Dm=()=>{console.warn(`${di} is disabled`)},Lm=()=>{console.error(`${di} is disabled`)},Pi=new Map;class lo extends Ht{constructor(e,n){super(e,n);f(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});f(this,"data");f(this,"config");f(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});f(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Ga}_DEBUG__`]:this});const o=this.setFiveLinearUpdateCamera.bind(this),s=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",o),this.hooks.on("broke",s),this.hooks.on("end",s),this.hooks.on("pause",s),this.privateState.disposers.push(()=>{this.hooks.off("play",o),this.hooks.off("broke",s),this.hooks.off("end",s),this.hooks.off("pause",s)})}load(e,n,o){return J(this,null,function*(){var u,d,h,p,m;if(this.state.disposed)return js();this.privateState.fiveOriginGetProgress||(d=(u=this.five.controller)==null?void 0:u.cameraMotion)!=null&&d.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 s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.data=r,this.hooks.emit("dataChange",r,s);let a=[],l;const c=this.data.keyframes.filter(g=>g.data.panoIndex!==void 0);c.filter((g,A)=>{var v;return g.data.panoIndex!==((v=c[A-1])==null?void 0:v.data.panoIndex)}).map(g=>g.data.panoIndex).forEach(g=>{var v,w;const A=(v=this.five.work.observers[g])==null?void 0:v.floorIndex;if(A!==void 0)if(l===A){const y=a.length-1;a[y]=[...(w=a[y])!=null?w:[],g]}else{l=A;const y=a.length;a[y]=[g]}}),this.GuideLine||(this.GuideLine=Ha(this.five,this.config)),(m=this.GuideLine)==null||m.load({routes:a.map(g=>({panoIndexList:g}))}),this.setState({playing:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing),this.changeSpeed(this.state.speed),n&&this.setState(n,{userAction:o}),console.log(`${di} loaded`,r),this.hooks.emit("dataLoaded",r)})}play(e){this.setState({playing:!0},e)}playFrom(e){const{index:n,id:o,userAction:s}=e;this.state.playing&&this.setState({playing:!1},{userAction:s}),this.setState({playing:!0},{userAction:s,playFromIndex:n,playFromId:o})}playFromStart(e){return this.playFrom(he(N({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return J(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return J(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){var s;if(this.state.disposed)return js();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return Lm();const o=N({},this.state);this.state=N(N({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),e.playing!==void 0&&e.playing!==o.playing&&this.changePlayState(e.playing,n),e.speed!==void 0&&e.speed!==o.speed&&this.changeSpeed(e.speed,n==null?void 0:n.userAction),qe(o,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0})}formatData(e){return J(this,null,function*(){this.five.work||(yield this.waitFiveLoaded());const n=this.five.work.observers,o=(()=>{const s=e;return typeof s=="object"&&s!==null&&s.version&&s.data?s.data:s})();if(o.keyframes)return{keyframesId:He(),keyframes:o.keyframes.map((s,r)=>{var c;const a=o.keyframes[r+1],l=(()=>!a||a.start===void 0||s.end===void 0?0:a.start-s.end)();return N({id:(c=s.uuid)!=null?c:He(),moveIndex:r,stay:l,index:r},s)})};if(o.panoIndexList){let s=[];const{moveEffect:r,moveToFirstPanoEffect:a,moveToFirstPanoDuration:l}=o;return this.privateState.moveToFirstPanoEffect=a,this.privateState.moveToFirstPanoDuration=l,o.panoIndexList.forEach((c,u)=>{const d=(()=>{var A,v,w,y;const h=o.panoIndexList.slice(u).find(x=>x!==c);if(h===void 0)return;const p=(A=n[c])==null?void 0:A.position,m=(v=n[h])==null?void 0:v.position;if(!m||!p||((w=n[c])==null?void 0:w.floorIndex)!==((y=n[h])==null?void 0:y.floorIndex))return;const g=new E.Vector3().subVectors(m,p);return Im(g)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:u,stay:o.stay,data:N({effect:"Move",panoIndex:c,moveEffect:r},d!=null?d:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:u,stay:o.stay,data:{effect:"Move",panoIndex:c,moveEffect:r}}),d&&s.push({moveIndex:u,stay:o.stay,data:N({effect:"Rotate",panoIndex:c},d)}))}),{keyframesId:He(),keyframes:s.map((c,u)=>N({id:He(),index:u},c))}}else throw new Error("format error: data no keyframes or no panoIndexList")})}handleEnable(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.enable(),this.hooks.emit("enable",{userAction:n})):((s=this.GuideLine)==null||s.disable(),this.changePlayState(!1,{userAction:n}),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):((s=this.GuideLine)==null||s.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}changePlayState(e,n){this.actionIfStateIsEnabled(()=>{var o;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(o=n==null?void 0:n.userAction)!=null?o:!0})}),e?this.handlePlay(n):this.handlePause(n),this.state.playing=e}handlePlay(e){return J(this,null,function*(){var p;const{data:n,state:o,privateState:s,hooks:r}=this;if(s.playing||!(n!=null&&n.keyframes)||(n==null?void 0:n.keyframes.length)===0)return;const a=He();s.playId=a,s.playing=!0,s.broke=!1;const l=n.keyframes,c=this.getPauseData();(e==null?void 0:e.notEmitEvent)!==!0&&r.emit("play",{userAction:(p=e==null?void 0:e.userAction)!=null?p:!0});let u=!1;const h=yield(()=>J(this,null,function*(){var m,g;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(m=this.data)==null?void 0:m.keyframes.findIndex(A=>A.id===e.playFromId);if(c!=null&&c.keyframeId){const A=(g=this.data)==null?void 0:g.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect,duration:s.moveToFirstPanoDuration})),A){if(A.data.effect==="Move")return A.index;if(A.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(A,{duration:v}),u=!0,A.index+1}}}}))();this.clearPauseData();for(const m of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(h!==void 0&&m.index<h))try{r.emit("playIndexChange",m.index,m),yield this.playKeyframe(m,{moveEffect:u===!1?s.moveToFirstPanoEffect:void 0,duration:u===!1&&typeof s.moveToFirstPanoDuration=="number"?s.moveToFirstPanoDuration:800}),m.stay&&(yield km(m.stay)),u===!1&&(u=!0)}catch(g){return Promise.resolve("broke")}}o.playing&&a===s.playId&&(this.setState({playing:!1},{userAction:!1}),r.emit("end"),this.clearPauseData())})}handlePause(e){var r;const{state:n,privateState:o,hooks:s}=this;n.playing=!1,o.playing!==!1&&(o.playing=!1,this.setPauseData(),o.broke||this.forceInteruptUpdateCamera(),(e==null?void 0:e.notEmitEvent)!==!0&&s.emit("pause",{userAction:(r=e==null?void 0:e.userAction)!=null?r:!0}))}playKeyframe(e,n){return J(this,null,function*(){var s;const{privateState:o}=this;return((s=this.privateState.currentPlayKeyframe)==null?void 0:s.keyframe.id)!==e.id&&(this.privateState.currentPlayKeyframe={keyframe:e}),o.currentPlayQueue.push(this.getPlayPromise(e,n)),this.actionPromiseQueue()})}addInterruptListener(e){const n=()=>{this.privateState.modeChanging||e()},o=e;return this.five.once("gesture",o),this.five.once("wantsChangeMode",n),()=>{this.five.off("gesture",o),this.five.once("wantsChangeMode",n)}}getPlayPromise(e,n){return J(this,null,function*(){var s;const o=e.data;if(n.duration=(s=n==null?void 0:n.duration)!=null?s:e.start!==void 0&&e.end!==void 0?e.end-e.start:void 0,!!o)return new Promise((r,a)=>{let l=!1;this.addInterruptListener(()=>{if(!l)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),l=!0,a(new Error("play is interupted"))});try{if(l)return;const c=()=>{r(),l=!0};switch(o.effect){case"Move":this.move(o,n).then(c);break;case"Rotate":this.rotate(o,n).then(c);break;default:this.rotate(o,n).then(c)}}catch(c){}})})}actionPromiseQueue(){return J(this,null,function*(){const{privateState:e}=this;return new Promise((n,o)=>{if(e.currentPlayQueue.length===0){n();return}const s=e.currentPlayQueue.shift();if(!s){n();return}s.then(n,o)}).then(()=>e.currentPlayQueue.length===0?Promise.resolve():this.actionPromiseQueue())})}move(e,n){return J(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 J(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return yield this.changePano(e,n);yield this.updateCamera(e,n)})}updateCamera(e,n){return J(this,null,function*(){const{five:o,privateState:s,state:r}=this,a=(()=>{var h,p;const u=(h=r.config)==null?void 0:h.speedConfig,d=(p=e.rotateSpeed)!=null?p:u==null?void 0:u.rotateSpeed;if((u==null?void 0:u.rotateSpeedUnit)===void 0)return d;if(d!==void 0)return u.rotateSpeedUnit==="rad/ms"?d:d/1e3})(),l=(()=>{if(n.duration)return n.duration;if(a){const u=this.five.getCurrentState();return Cm(u,e)/a}return 800})();s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=l);const c=this.getSpeededDuration(l);return new Promise(u=>{Em(()=>o.updateCamera(e,c)),setTimeout(()=>u(),c)})})}changePano(e,n){return J(this,null,function*(){const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;const a=o.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);const l=(()=>{var h,p;const u=(h=r.config)==null?void 0:h.speedConfig,d=(p=e.moveSpeed)!=null?p:u==null?void 0:u.moveSpeed;if((u==null?void 0:u.moveSpeedUnit)===void 0)return d;if(d!==void 0)return u.moveSpeedUnit==="m/ms"?d:d/1e3})(),c=(()=>{if(n!=null&&n.duration)return n.duration;if(l&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const u=o.work.observers[o.panoIndex].position,d=o.work.observers[e.panoIndex].position;return u.distanceTo(d)/l}return 800})();s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=c),yield new Promise(u=>{var d,h,p;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:this.getSpeededDuration(c),effect:(p=(h=n==null?void 0:n.moveEffect)!=null?h:(d=this.state.config)==null?void 0:d.moveEffect)!=null?p:e.moveEffect,moveCancelCallback:()=>u(),moveEndCallback:()=>u()}),a&&o.once("panoArrived",()=>u())}),a&&(this.privateState.modeChanging=!1)})}changeSpeed(e,n=!0){const{state:o,privateState:s,hooks:r}=this,{currentPlayKeyframe:a}=s;if(r.emit("speedChange",e,{userAction:n}),o.playing&&a)try{const l=a.originDuration!==void 0?a.originDuration*(1-this.getProgress()):void 0,c=this.playKeyframe(a.keyframe,{duration:l});s.currentPlayQueue.push(c)}catch(l){}}getSpeededDuration(e){return e/this.state.speed}getProgress(){return this.five.controller.cameraMotion.progress}changeMode(e,n){return J(this,null,function*(){e.mode&&e.mode!==this.five.currentMode&&(this.privateState.modeChanging=!0,yield this.five.changeMode(e.mode,e,n),this.privateState.modeChanging=!1)})}forceInteruptUpdateCamera(){this.five.updateCamera({},0)}getPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Pi.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return Pi.set((n=this.data)==null?void 0:n.keyframesId,{keyframeId:(o=this.privateState.currentPlayKeyframe)==null?void 0:o.keyframe.id,fiveState:this.five.getCurrentState(),duration:(s=this.privateState.currentPlayKeyframe)==null?void 0:s.originDuration,playedProgress:this.getProgress()})}clearPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Pi.delete((n=this.data)==null?void 0:n.keyframesId)}clear(){this.clearPauseData(),this.privateState.currentPlayKeyframe=null}handleDispose(){var e,n;this.setState({playing:!1}),this.clearPauseData(),this.clear(),(e=this.GuideLine)==null||e.dispose(),this.GuideLine=void 0,(n=this.privateState.disposers)==null||n.forEach(o=>o==null?void 0:o())}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&Dm()}waitFiveLoaded(){return J(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}setFiveLinearUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=e=>{const n=this.five.controller.cameraMotion,o=e-n.startTime;return o<0?0:o>=n.duration?1:1-xm(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}f(lo,"PluginVersion",Fa);const Sm=i=>new lo(i);function zm(i,t){t.forEach(e=>{const n=new E.SphereGeometry(.02,16,16),o=[],s=[new E.MeshBasicMaterial({color:16776960}),new E.MeshBasicMaterial({color:16711935}),new E.MeshBasicMaterial({color:16711680}),new E.MeshBasicMaterial({color:65535})];if(e.position.length===4)e.position.forEach((r,a)=>{const l=s[a],c=new E.Mesh(n,l);c.position.copy(st(r)),o.push(c)});else{const r=s[0],a=new E.Mesh(n,r);a.position.copy(st(e.position)),o.push(a)}o.forEach(r=>{r.material.depthTest=!1,i.scene.add(r)})})}const Se=i=>i;function Na(i){if(i.length<3)return;const t=i.map(hn),e=t[1].clone().sub(t[0]),n=t[2].clone().sub(t[1]);return e.cross(n)}function Mn(i){if(Array.isArray(i)&&i.length===4){const t=i.map(hn);return Wr(t[0],t[2])}else return hn(i)}function Tn(i,t){if(i===void 0)return;const{min:e,max:n}=t!=null?t:{};if(!(e===void 0&&n===void 0))return!(typeof n=="number"&&n<i||typeof e=="number"&&e>i)}function Mm(i,t){i.model.loaded?t():i.once("modelLoaded",()=>t())}function Tm(i,t,e){const o=new E.Plane().setFromNormalAndCoplanarPoint(e,t),s=t.clone().sub(i).cross(new E.Vector3(0,1,0)).setLength(.01),r=new E.Vector3(0,.01,0);return[t.clone().sub(s).sub(r),t.clone().add(s).sub(r),t.clone().add(s).add(r),t.clone().sub(s).add(r)].map(l=>o.projectPoint(l,new E.Vector3))}const Qs=(i,t=1e3/60)=>{let e=null;const n=i;return(...s)=>{e&&clearTimeout(e),e=setTimeout(()=>{n==null||n(...s),e&&clearTimeout(e),e=null},t)}};function Bm(i,t=200){let e;return function(...n){e||(i.apply(this,n),e=setTimeout(function(){e=null},t))}}function jm(i,t){const[e,n]=t;if(e>=n||n<=1||e<=1)return-1;const o={},s=r=>(o[r]||(o[r]=i(r)),o[r]);for(let r=e;r<n;r++){const a=s(r),l=s(r-1);if(a<l)return r}return-1}function Rs(i,t){if(!t||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",i),unobserve:()=>window.removeEventListener("resize",i)};{const e=new ResizeObserver(i);return{observe:()=>e.observe(t),unobserve:()=>e.unobserve(t)}}}var Xe=(i=>(i.Two="2D",i.Three="3D",i))(Xe||{}),Ge=(i=>(i.PointTag="PointTag",i.PlaneTag="PlaneTag",i))(Ge||{}),We=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Link="Link",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.Custom="Custom",i))(We||{}),ei=(i=>(i.VrLink="vr",i.NormalLink="normal",i))(ei||{});function Qm(i){ae(i,"svelte-1omzoh4",".straight-line.svelte-1omzoh4{display:block;width:100%;height:100%;overflow:visible}")}function Os(i){let t,e,n,o;return{c(){t=Ae("path"),b(t,"fill","none"),b(t,"stroke","url(#"+i[4]+")"),b(t,"stroke-width","1"),b(t,"d","M0 0.5 L 148 0.5")},m(s,r){B(s,t,r),o=!0},p(s,r){i=s},i(s){o||(s&&xe(()=>{n&&n.end(1),e=Ot(t,qn,{duration:i[1],delay:i[0]}),e.start()}),o=!0)},o(s){e&&e.invalidate(),s&&(n=$t(t,qn,{duration:i[1],delay:i[2]})),o=!1},d(s){s&&M(t),s&&n&&n.end()}}}function Rm(i){let t,e,n,o,s,r=i[3]&&Os(i);return{c(){t=Ae("svg"),e=Ae("defs"),n=Ae("linearGradient"),o=Ae("stop"),s=Ae("stop"),r&&r.c(),b(o,"offset","25%"),b(o,"stop-color","white"),b(o,"stop-opacity","1"),b(s,"offset","100%"),b(s,"stop-color","white"),b(s,"stop-opacity","0.5"),b(n,"id",i[4]),b(n,"gradientUnits","userSpaceOnUse"),b(t,"class","straight-line svelte-1omzoh4"),b(t,"viewBox","0 0 148 1"),b(t,"preserveAspectRatio","none")},m(a,l){B(a,t,l),Q(t,e),Q(e,n),Q(n,o),Q(n,s),r&&r.m(t,null)},p(a,[l]){a[3]?r?(r.p(a,l),l&8&&D(r,1)):(r=Os(a),r.c(),D(r,1),r.m(t,null)):r&&(le(),T(r,1,1,()=>{r=null}),ce())},i(a){D(r)},o(a){T(r)},d(a){a&&M(t),r&&r.d()}}}function Om(i,t,e){let{inDelay:n=0}=t,{duration:o=0}=t,{outDelay:s=0}=t,{unfolded:r}=t;const a=He();return i.$$set=l=>{"inDelay"in l&&e(0,n=l.inDelay),"duration"in l&&e(1,o=l.duration),"outDelay"in l&&e(2,s=l.outDelay),"unfolded"in l&&e(3,r=l.unfolded)},[n,o,s,r,a]}class Wa extends oe{constructor(t){super(),ie(this,t,Om,Rm,ne,{inDelay:0,duration:1,outDelay:2,unfolded:3},Qm)}}function Hm(i){ae(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function Hs(i){let t,e,n,o,s;return{c(){t=j("div"),b(t,"class","shadow svelte-faoauy"),b(t,"style",e=`
|
|
531
531
|
left:${Ne(i[5])};
|
|
532
532
|
bottom:${Ne(i[6])};
|
|
533
533
|
box-shadow: 0 0 ${Ne(i[10])} ${Ne(i[11])} rgba(0, 0, 0, ${i[12]});
|
|
@@ -541,9 +541,9 @@ void main() {
|
|
|
541
541
|
${i[8]?"transform: translateX(-50%); left: 50%":""}
|
|
542
542
|
${i[9]?"transform: translateX(-50%); top: 50%":""}
|
|
543
543
|
${i[7]?"transform: translate(-50%, -50%); left: 50%; top: 50%;":""}
|
|
544
|
-
`))&&b(t,"style",e),a&8&&R(t,"width",Ne(i[3])),a&16&&R(t,"height",Ne(i[4])),a&8192&&R(t,"z-index",i[13])},i(r){s||(r&&xe(()=>{o&&o.end(1),n=Ot(t,Tt,{duration:i[0]}),n.start()}),s=!0)},o(r){n&&n.invalidate(),r&&(o=$t(t,Tt,{duration:i[1]})),s=!1},d(r){r&&M(t),r&&o&&o.end()}}}function Fm(i){let t,e=i[2]&&Hs(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),B(n,t,o)},p(n,[o]){n[2]?e?(e.p(n,o),o&4&&D(e,1)):(e=Hs(n),e.c(),D(e,1),e.m(t.parentNode,t)):e&&(le(),T(e,1,1,()=>{e=null}),ce())},i(n){D(e)},o(n){T(e)},d(n){e&&e.d(n),n&&M(t)}}}function Ne(i){return typeof i=="number"?i/16+"rem":i}function Gm(i,t,e){let{inDelay:n=1e3}=t,{outDelay:o=1e3}=t,{visible:s=!0}=t,{width:r=0}=t,{height:a=0}=t,{left:l=0}=t,{bottom:c=0}=t,{center:u=!1}=t,{horizontalCenter:d=!1}=t,{verticalCenter:h=!1}=t,{blurRadius:p}=t,{spreadRadius:m}=t,{opacity:g=.15}=t,{zIndex:A=void 0}=t;return i.$$set=v=>{"inDelay"in v&&e(0,n=v.inDelay),"outDelay"in v&&e(1,o=v.outDelay),"visible"in v&&e(2,s=v.visible),"width"in v&&e(3,r=v.width),"height"in v&&e(4,a=v.height),"left"in v&&e(5,l=v.left),"bottom"in v&&e(6,c=v.bottom),"center"in v&&e(7,u=v.center),"horizontalCenter"in v&&e(8,d=v.horizontalCenter),"verticalCenter"in v&&e(9,h=v.verticalCenter),"blurRadius"in v&&e(10,p=v.blurRadius),"spreadRadius"in v&&e(11,m=v.spreadRadius),"opacity"in v&&e(12,g=v.opacity),"zIndex"in v&&e(13,A=v.zIndex)},[n,o,s,r,a,l,c,u,d,h,p,m,g,A]}class Ve extends oe{constructor(t){super(),ie(this,t,Gm,Fm,ne,{inDelay:0,outDelay:1,visible:2,width:3,height:4,left:5,bottom:6,center:7,horizontalCenter:8,verticalCenter:9,blurRadius:10,spreadRadius:11,opacity:12,zIndex:13},Hm)}}function Nm(){return Math.random().toString(36).slice(-6)}const Fs=Nm();function Wm(i){ae(i,"svelte-zgfkts",".text-char.svelte-zgfkts{text-shadow:0.125rem 0rem 0.5rem rgba(0, 0, 0, 0.15)}")}function Gs(i,t,e){const n=i.slice();return n[10]=t[e],n[11]=t,n[12]=e,n}function Ns(i){let t,e=i[10]+"",n,o=i[12];const s=()=>i[6](t,o),r=()=>i[6](null,o);return{c(){t=j("span"),n=ke(e),b(t,"class","text-char svelte-zgfkts")},m(a,l){B(a,t,l),Q(t,n),s()},p(a,l){i=a,l&2&&e!==(e=i[10]+"")&&Be(n,e),o!==i[12]&&(r(),o=i[12],s())},d(a){a&&M(t),r()}}}function Xm(i){let t,e=i[1],n=[];for(let o=0;o<e.length;o+=1)n[o]=Ns(Gs(i,e,o));return{c(){for(let o=0;o<n.length;o+=1)n[o].c();t=fe()},m(o,s){for(let r=0;r<n.length;r+=1)n[r].m(o,s);B(o,t,s)},p(o,[s]){if(s&3){e=o[1];let r;for(r=0;r<e.length;r+=1){const a=Gs(o,e,r);n[r]?n[r].p(a,s):(n[r]=Ns(a),n[r].c(),n[r].m(t.parentNode,t))}for(;r<n.length;r+=1)n[r].d(1);n.length=e.length}},i:te,o:te,d(o){tt(n,o),o&&M(t)}}}function Ym(i,t,e){let n,{inDelay:o=0}=t,{outDelay:s=0}=t,{content:r}=t,{unfolded:a}=t,l,c=[],u;function d(p){clearTimeout(l),l=setTimeout(function(){!u||(p&&u.reversed||!p&&!u.reversed)&&(u.reverse(),u.play())},p?o:s)}Ye(function(){const p=(()=>{const m=jm(g=>c[g].getBoundingClientRect().x,[Math.min(c.length-1,10),Math.min(c.length-1,30)]);if(m>0)return m})();u=Ao.default({targets:c.slice(0,p).filter(Bt),autoplay:!1,duration:400,scale:[.7,1],rotate:[20,0],opacity:[0,1],translateX:[4,0],translateY:[10,0],delay:Ao.default.stagger(50),easing:"easeInOutCubic"}),a&&u.seek(u.duration)});function h(p,m){Te[p?"unshift":"push"](()=>{c[m]=p,e(0,c)})}return i.$$set=p=>{"inDelay"in p&&e(2,o=p.inDelay),"outDelay"in p&&e(3,s=p.outDelay),"content"in p&&e(4,r=p.content),"unfolded"in p&&e(5,a=p.unfolded)},i.$$.update=()=>{i.$$.dirty&16&&e(1,n=(()=>{const p=[],m=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")),g=`__EMOJI_SPLIT_${Fs}__`,A=`__EMOJI_${Fs}__`;return r.slice().replace(m,v=>`${g}${A}${v}${g}`).split(g).forEach(v=>v.startsWith(A)?p.push(v.slice(A.length)):p.push(...v.split(""))),p})()),i.$$.dirty&32&&d(a)},[c,n,o,s,r,a,h]}class Xa extends oe{constructor(t){super(),ie(this,t,Ym,Xm,ne,{inDelay:2,outDelay:3,content:4,unfolded:5},Wm)}}const Um="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAKqADAAQAAAABAAAAKgAAAADUGqULAAAB0ElEQVRYCe2WSUoEQRBFLVHEiVZU1I03cKW38SSewRt4A5fiTty5cQIFR9pZQWkcUNSe2/Z9yISiSGxRkUAy4BGZSVX168gistraYsQKxArECsQKxApYqkDyU5lmsznMM+ZgAGpQhaUkSRbINgLJCXiCBtSgAkVYtGGIBTKj8AgKSVahDNvQa0IUkUG4Bx91BpLdBTOS/cgUIB3a+gMwI9mFzE3a0I3z5B4r292JzGVA8tSSZILMcUDyzIykthOZvYDk+V9Ktmz4yGzhOhV4/+5YU4N/hzqo0StX3Fg5TcnNlYvgs8bPsM4hkScHoyO46haRnGEYktQVI+4ypUYKyXtx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AxNk6jxwajuUb8lqOZRT3S/lx06RY1g8C4akfiEJAOZdFKzsq/nNjIssdufjbhQAEAUodOGDWp4m8S0oHEhb+YexGkD4EBUpdVMrfl/E/RhNJnsjF/ls0r980YRQDlAqBylIqylcCzf4lHecB5veigSfmYoBycaxN2SHgT8e7pWKZwCzqzZpigUr9DlRuoIxXn8pIZJgHtkwpa8togHIiw587LeNx9mc2ZwIK5DOlXJaMFqhWwoMp/Ax+1W+ToOXTHGKNrDMLLo38LmKsQKmbdSrWil+N82UJaS40YTuJv/RdtAdpzet+aJDzvMpQV71oo2gYX5RXG2HnYZXtouzNRzXE3R0KE6jWjZU2iaZ9u8pqpU3UfvwrYSgSBVDtGDurBlHn/zj0QMIh7qlDNOfmcBj9ihKo9o+l1euiWGxSE5eun3na6jxQk3joEgdQ7TR+FWutE43lhQpph3sQvISAVRa9ppRzipY4gZqdw8/WigIWDWt1gD8EIsqSLlT/KPUVlKSAujs2XTLYeRHiIlA2DVi1qkRtK8PSULaEDF+Ue7ashwkTlf8DQc/cITdx9+UAAAAASUVORK5CYII=";function Vm(i){ae(i,"svelte-1ogmlqq",".arrow.svelte-1ogmlqq{width:100%;height:100%;background-size:100%;transition:transform 400ms ease-in-out;cursor:pointer;pointer-events:auto}.arrow-wrapper.svelte-1ogmlqq{position:relative;width:100%;height:100%}.arrow.left.svelte-1ogmlqq{transform:rotate(0deg)}.arrow.right.svelte-1ogmlqq{transform:rotate(-180deg)}.arrow.top.svelte-1ogmlqq{transform:rotate(90deg)}.arrow.bottom.svelte-1ogmlqq{transform:rotate(-90deg)}")}function Ys(i){let t,e,n,o,s,r,a,l,c,u;return e=new Ve({props:{center:!0,blurRadius:9,spreadRadius:3}}),{c(){t=j("div"),ee(e.$$.fragment),n=_(),o=j("div"),b(o,"class",s="arrow "+i[0]+" svelte-1ogmlqq"),R(o,"background-image","url("+Um+")"),b(t,"class","arrow-wrapper svelte-1ogmlqq")},m(d,h){B(d,t,h),K(e,t,null),Q(t,n),Q(t,o),l=!0,c||(u=Pe(o,"click",i[5]),c=!0)},p(d,h){i=d,(!l||h&1&&s!==(s="arrow "+i[0]+" svelte-1ogmlqq"))&&b(o,"class",s)},i(d){l||(D(e.$$.fragment,d),d&&xe(()=>{a&&a.end(1),r=Ot(o,Tt,{duration:i[2],delay:i[3],easing:_t}),r.start()}),l=!0)},o(d){T(e.$$.fragment,d),r&&r.invalidate(),d&&(a=$t(o,Tt,{duration:i[2],delay:i[4],easing:_t})),l=!1},d(d){d&&M(t),$(e),d&&a&&a.end(),c=!1,u()}}}function Jm(i){let t,e,n=i[1]&&Ys(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&D(n,1)):(n=Ys(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function _m(i,t,e){let{direction:n="right"}=t,{visible:o=!0}=t,{duration:s=0}=t,{inDelay:r=0}=t,{outDelay:a=0}=t;function l(c){nc.call(this,i,c)}return i.$$set=c=>{"direction"in c&&e(0,n=c.direction),"visible"in c&&e(1,o=c.visible),"duration"in c&&e(2,s=c.duration),"inDelay"in c&&e(3,r=c.inDelay),"outDelay"in c&&e(4,a=c.outDelay)},[n,o,s,r,a,l]}class Zm extends oe{constructor(t){super(),ie(this,t,_m,Jm,ne,{direction:0,visible:1,duration:2,inDelay:3,outDelay:4},Vm)}}function qm(i,t,e=20,n=5){return new Promise((o,s)=>{let r=0;const a=setInterval(()=>{const l=i();t(l)?(clearInterval(a),o(l)):r>=n&&(clearInterval(a),s(l)),r++},e)})}function Km(i){ae(i,"svelte-1fuzm7v",".text.svelte-1fuzm7v{pointer-events:auto;box-sizing:border-box;display:inline-block;max-width:7.5rem;transition:transform 400ms ease-in-out;font-size:0.75rem;line-height:1.125rem;white-space:initial;cursor:pointer}.arrow.svelte-1fuzm7v{pointer-events:auto;display:inline-block;vertical-align:top;width:0.875rem;height:0.875rem;margin-left:0.125rem;margin-top:0.125rem}")}function Us(i,t,e){const n=i.slice();return n[11]=t[e].id,n[12]=t[e].content,n}function Vs(i,t){let e,n,o;return n=new Xa({props:{unfolded:t[0],content:t[12],inDelay:500,outDelay:t[5]}}),{key:i,first:null,c(){e=j("div"),ee(n.$$.fragment),b(e,"class","text svelte-1fuzm7v"),R(e,"transform",t[7]),this.first=e},m(s,r){B(s,e,r),K(n,e,null),t[10](e),o=!0},p(s,r){t=s;const a={};r&1&&(a.unfolded=t[0]),r&2&&(a.content=t[12]),r&32&&(a.outDelay=t[5]),n.$set(a),r&128&&R(e,"transform",t[7])},i(s){o||(D(n.$$.fragment,s),o=!0)},o(s){T(n.$$.fragment,s),o=!1},d(s){s&&M(e),$(n),t[10](null)}}}function Js(i){let t,e,n;return e=new Zm({props:{direction:i[6],visible:i[0],inDelay:600,duration:1e3}}),{c(){t=j("div"),ee(e.$$.fragment),b(t,"class","arrow svelte-1fuzm7v")},m(o,s){B(o,t,s),K(e,t,null),n=!0},p(o,s){const r={};s&64&&(r.direction=o[6]),s&1&&(r.visible=o[0]),e.$set(r)},i(o){n||(D(e.$$.fragment,o),n=!0)},o(o){T(e.$$.fragment,o),n=!1},d(o){o&&M(t),$(e)}}}function $m(i){let t=[],e=new Map,n,o,s,r=i[1];const a=c=>c[11];for(let c=0;c<r.length;c+=1){let u=Us(i,r,c),d=a(u);e.set(d,t[c]=Vs(d,u))}let l=i[3]<i[4]&&Js(i);return{c(){for(let c=0;c<t.length;c+=1)t[c].c();n=_(),l&&l.c(),o=fe()},m(c,u){for(let d=0;d<t.length;d+=1)t[d].m(c,u);B(c,n,u),l&&l.m(c,u),B(c,o,u),s=!0},p(c,[u]){u&167&&(r=c[1],le(),t=Ue(t,u,a,1,c,r,e,n.parentNode,at,Vs,n,Us),ce()),c[3]<c[4]?l?(l.p(c,u),u&24&&D(l,1)):(l=Js(c),l.c(),D(l,1),l.m(o.parentNode,o)):l&&(le(),T(l,1,1,()=>{l=null}),ce())},i(c){if(!s){for(let u=0;u<r.length;u+=1)D(t[u]);D(l),s=!0}},o(c){for(let u=0;u<t.length;u+=1)T(t[u]);T(l),s=!1},d(c){for(let u=0;u<t.length;u+=1)t[u].d(c);c&&M(n),l&&l.d(c),c&&M(o)}}}function ep(i,t,e){let n,o,s,{visible:r=!1}=t,{textUnfolded:a=!1}=t,{textItems:l}=t,c,u=0,d=0,h=0;function p(m){Te[m?"unshift":"push"](()=>{c=m,e(2,c)})}return i.$$set=m=>{"visible"in m&&e(0,r=m.visible),"textUnfolded"in m&&e(8,a=m.textUnfolded),"textItems"in m&&e(1,l=m.textItems)},i.$$.update=()=>{if(i.$$.dirty&5&&c&&r){const{lineHeight:m}=getComputedStyle(c);e(4,h=c.offsetHeight),qm(()=>c==null?void 0:c.offsetHeight,Boolean).then(()=>{e(4,h=c.offsetHeight)}),e(3,d=Number(m.replace("px","")))}i.$$.dirty&280&&e(9,u=a?d-h:0),i.$$.dirty&512&&e(7,n=`translateY(${u}px)`),i.$$.dirty&256&&e(6,o=a?"left":"right"),i.$$.dirty&256&&e(5,s=a?450:0)},[r,l,c,d,h,s,o,n,a,u,p]}class Ya extends oe{constructor(t){super(),ie(this,t,ep,$m,ne,{visible:0,textUnfolded:8,textItems:1},Km)}}function tp(i){ae(i,"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 _s(i){var h,p;let t,e,n,o,s,r,a,l,c,u,d;return t=new Ve({props:{visible:i[2],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}}),o=new Wa({props:{unfolded:i[2],duration:1e3,outDelay:i[5]+40*Math.min((p=(h=i[4][0])==null?void 0:h.content.length)!=null?p:10,15)}}),a=new Ya({props:{visible:i[2],textUnfolded:i[1],textItems:i[4]}}),{c(){ee(t.$$.fragment),e=_(),n=j("div"),ee(o.$$.fragment),s=_(),r=j("div"),ee(a.$$.fragment),b(n,"class","line svelte-18yy5x8"),R(n,"width",i[3]+"px"),b(r,"class","content svelte-18yy5x8"),xe(()=>i[8].call(r))},m(m,g){K(t,m,g),B(m,e,g),B(m,n,g),K(o,n,null),B(m,s,g),B(m,r,g),K(a,r,null),l=bt(r,i[8].bind(r)),c=!0,u||(d=Pe(r,"click",i[6]),u=!0)},p(m,g){var y,x;const A={};g&4&&(A.visible=m[2]),g&8&&(A.left=m[3]/2+"px"),t.$set(A);const v={};g&4&&(v.unfolded=m[2]),g&48&&(v.outDelay=m[5]+40*Math.min((x=(y=m[4][0])==null?void 0:y.content.length)!=null?x:10,15)),o.$set(v),g&8&&R(n,"width",m[3]+"px");const w={};g&4&&(w.visible=m[2]),g&2&&(w.textUnfolded=m[1]),g&16&&(w.textItems=m[4]),a.$set(w)},i(m){c||(D(t.$$.fragment,m),D(o.$$.fragment,m),D(a.$$.fragment,m),c=!0)},o(m){T(t.$$.fragment,m),T(o.$$.fragment,m),T(a.$$.fragment,m),c=!1},d(m){$(t,m),m&&M(e),m&&M(n),$(o),m&&M(s),m&&M(r),$(a),l(),u=!1,d()}}}function np(i){let t,e,n=i[0].state&&_s(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&D(n,1)):(n=_s(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function ip(i,t,e){let n,o,s,{tag:r}=t,a,l=!1,c=[];function u(){e(1,l=!l)}function d(){a=this.clientWidth,e(3,a)}return i.$$set=h=>{"tag"in h&&e(0,r=h.tag)},i.$$.update=()=>{var h;i.$$.dirty&1&&e(2,n=!!((h=r.state)!=null&&h.unfolded)),i.$$.dirty&1&&e(7,o=r.data.text),i.$$.dirty&128&&e(4,c=[{id:He(),content:o}]),i.$$.dirty&4&&(n||setTimeout(()=>{e(1,l=!1)},20)),i.$$.dirty&2&&e(5,s=l?450:0)},[r,l,n,a,c,s,u,o,d]}class op extends oe{constructor(t){super(),ie(this,t,ip,np,ne,{tag:0},tp)}}function sp(i){ae(i,"svelte-e72ouh",".line.svelte-e72ouh{width:100%;height:100%;overflow:visible}")}function Zs(i){let t,e,n,o;return{c(){t=Ae("path"),b(t,"fill","none"),b(t,"stroke","url(#"+i[4]+")"),b(t,"stroke-width","1"),b(t,"d","M0 21 L14 0.5 L105 0.5")},m(s,r){B(s,t,r),o=!0},p(s,r){i=s},i(s){o||(s&&xe(()=>{n&&n.end(1),e=Ot(t,qn,{duration:i[1],delay:i[0],easing:da}),e.start()}),o=!0)},o(s){e&&e.invalidate(),s&&(n=$t(t,qn,{duration:i[1],delay:i[2],easing:_t})),o=!1},d(s){s&&M(t),s&&n&&n.end()}}}function rp(i){let t,e,n,o,s,r=i[3]&&Zs(i);return{c(){t=Ae("svg"),e=Ae("defs"),n=Ae("linearGradient"),o=Ae("stop"),s=Ae("stop"),r&&r.c(),b(o,"offset","25%"),b(o,"stop-color","white"),b(o,"stop-opacity","1"),b(s,"offset","100%"),b(s,"stop-color","white"),b(s,"stop-opacity","0.5"),b(n,"id",i[4]),b(n,"gradientUnits","userSpaceOnUse"),b(t,"class","line svelte-e72ouh"),b(t,"viewBox","0 0 105 21")},m(a,l){B(a,t,l),Q(t,e),Q(e,n),Q(n,o),Q(n,s),r&&r.m(t,null)},p(a,[l]){a[3]?r?(r.p(a,l),l&8&&D(r,1)):(r=Zs(a),r.c(),D(r,1),r.m(t,null)):r&&(le(),T(r,1,1,()=>{r=null}),ce())},i(a){D(r)},o(a){T(r)},d(a){a&&M(t),r&&r.d()}}}function ap(i,t,e){let{inDelay:n=0}=t,{duration:o=0}=t,{outDelay:s=0}=t,{unfolded:r}=t;const a=He();return i.$$set=l=>{"inDelay"in l&&e(0,n=l.inDelay),"duration"in l&&e(1,o=l.duration),"outDelay"in l&&e(2,s=l.outDelay),"unfolded"in l&&e(3,r=l.unfolded)},[n,o,s,r,a]}class lp extends oe{constructor(t){super(),ie(this,t,ap,rp,ne,{inDelay:0,duration:1,outDelay:2,unfolded:3},sp)}}function jt(i){return typeof i=="object"&&i!==null&&i.constructor&&Object.prototype.toString.call(i).slice(8,-1)==="Object"}function ft(i,t){const e=["__proto__","constructor","prototype"];Object.keys(t).filter(n=>e.indexOf(n)<0).forEach(n=>{typeof i[n]=="undefined"?i[n]=t[n]:jt(t[n])&&jt(i[n])&&Object.keys(t[n]).length>0?t[n].__swiper__?i[n]=t[n]:ft(i[n],t[n]):i[n]=t[n]})}function Gi(i={}){return i.navigation&&typeof i.navigation.nextEl=="undefined"&&typeof i.navigation.prevEl=="undefined"}function Ni(i={}){return i.pagination&&typeof i.pagination.el=="undefined"}function Wi(i={}){return i.scrollbar&&typeof i.scrollbar.el=="undefined"}function ti(i=""){const t=i.split(" ").map(n=>n.trim()).filter(n=>!!n),e=[];return t.forEach(n=>{e.indexOf(n)<0&&e.push(n)}),e.join(" ")}const Ua=["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 cp(i={},t=!0){const e={on:{}},n={},o={};ft(e,zi.default.defaults),ft(e,zi.default.extendedDefaults),e._emitClasses=!0,e.init=!1;const s={},r=Ua.map(l=>l.replace(/_/,"")),a=Object.assign({},i);return Object.keys(a).forEach(l=>{typeof i[l]!="undefined"&&(r.indexOf(l)>=0?jt(i[l])?(e[l]={},o[l]={},ft(e[l],i[l]),ft(o[l],i[l])):(e[l]=i[l],o[l]=i[l]):l.search(/on[A-Z]/)===0&&typeof i[l]=="function"?t?n[`${l[2].toLowerCase()}${l.substr(3)}`]=i[l]:e.on[`${l[2].toLowerCase()}${l.substr(3)}`]=i[l]:s[l]=i[l])}),["navigation","pagination","scrollbar"].forEach(l=>{e[l]===!0&&(e[l]={}),e[l]===!1&&delete e[l]}),{params:e,passedParams:o,rest:s,events:n}}function up({el:i,nextEl:t,prevEl:e,paginationEl:n,scrollbarEl:o,swiper:s},r){Gi(r)&&t&&e&&(s.params.navigation.nextEl=t,s.originalParams.navigation.nextEl=t,s.params.navigation.prevEl=e,s.originalParams.navigation.prevEl=e),Ni(r)&&n&&(s.params.pagination.el=n,s.originalParams.pagination.el=n),Wi(r)&&o&&(s.params.scrollbar.el=o,s.originalParams.scrollbar.el=o),s.init(i)}function dp(i,t,e,n,o){const s=[];if(!t)return s;const r=l=>{s.indexOf(l)<0&&s.push(l)};if(e&&n){const l=n.map(o),c=e.map(o);l.join("")!==c.join("")&&r("children"),n.length!==e.length&&r("children")}return Ua.filter(l=>l[0]==="_").map(l=>l.replace(/_/,"")).forEach(l=>{if(l in i&&l in t)if(jt(i[l])&&jt(t[l])){const c=Object.keys(i[l]),u=Object.keys(t[l]);c.length!==u.length?r(l):(c.forEach(d=>{i[l][d]!==t[l][d]&&r(l)}),u.forEach(d=>{i[l][d]!==t[l][d]&&r(l)}))}else i[l]!==t[l]&&r(l)}),s}function hp({swiper:i,slides:t,passedParams:e,changedParams:n,nextEl:o,prevEl:s,scrollbarEl:r,paginationEl:a}){const l=n.filter(L=>L!=="children"&&L!=="direction"),{params:c,pagination:u,navigation:d,scrollbar:h,virtual:p,thumbs:m}=i;let g,A,v,w,y;n.includes("thumbs")&&e.thumbs&&e.thumbs.swiper&&c.thumbs&&!c.thumbs.swiper&&(g=!0),n.includes("controller")&&e.controller&&e.controller.control&&c.controller&&!c.controller.control&&(A=!0),n.includes("pagination")&&e.pagination&&(e.pagination.el||a)&&(c.pagination||c.pagination===!1)&&u&&!u.el&&(v=!0),n.includes("scrollbar")&&e.scrollbar&&(e.scrollbar.el||r)&&(c.scrollbar||c.scrollbar===!1)&&h&&!h.el&&(w=!0),n.includes("navigation")&&e.navigation&&(e.navigation.prevEl||s)&&(e.navigation.nextEl||o)&&(c.navigation||c.navigation===!1)&&d&&!d.prevEl&&!d.nextEl&&(y=!0);const x=L=>{!i[L]||(i[L].destroy(),L==="navigation"?(c[L].prevEl=void 0,c[L].nextEl=void 0,i[L].prevEl=void 0,i[L].nextEl=void 0):(c[L].el=void 0,i[L].el=void 0))};l.forEach(L=>{if(jt(c[L])&&jt(e[L]))ft(c[L],e[L]);else{const C=e[L];(C===!0||C===!1)&&(L==="navigation"||L==="pagination"||L==="scrollbar")?C===!1&&x(L):c[L]=e[L]}}),l.includes("controller")&&!A&&i.controller&&i.controller.control&&c.controller&&c.controller.control&&(i.controller.control=c.controller.control),n.includes("children")&&t&&p&&c.virtual.enabled?(p.slides=t,p.update(!0)):n.includes("children")&&i.lazy&&i.params.lazy.enabled&&i.lazy.load(),g&&m.init()&&m.update(!0),A&&(i.controller.control=c.controller.control),v&&(a&&(c.pagination.el=a),u.init(),u.render(),u.update()),w&&(r&&(c.scrollbar.el=r),h.init(),h.updateSize(),h.setTranslate()),y&&(o&&(c.navigation.nextEl=o),s&&(c.navigation.prevEl=s),d.init(),d.update()),n.includes("allowSlideNext")&&(i.allowSlideNext=e.allowSlideNext),n.includes("allowSlidePrev")&&(i.allowSlidePrev=e.allowSlidePrev),n.includes("direction")&&i.changeDirection(e.direction,!1),i.update()}const fp=i=>({virtualData:i&512}),qs=i=>({virtualData:i[9]}),mp=i=>({virtualData:i&512}),Ks=i=>({virtualData:i[9]}),pp=i=>({virtualData:i&512}),$s=i=>({virtualData:i[9]}),gp=i=>({virtualData:i&512}),er=i=>({virtualData:i[9]}),Ap=i=>({virtualData:i&512}),tr=i=>({virtualData:i[9]});function nr(i){let t,e,n;return{c(){t=j("div"),e=_(),n=j("div"),b(t,"class","swiper-button-prev"),b(n,"class","swiper-button-next")},m(o,s){B(o,t,s),i[13](t),B(o,e,s),B(o,n,s),i[14](n)},p:te,d(o){o&&M(t),i[13](null),o&&M(e),o&&M(n),i[14](null)}}}function ir(i){let t;return{c(){t=j("div"),b(t,"class","swiper-scrollbar")},m(e,n){B(e,t,n),i[15](t)},p:te,d(e){e&&M(t),i[15](null)}}}function or(i){let t;return{c(){t=j("div"),b(t,"class","swiper-pagination")},m(e,n){B(e,t,n),i[16](t)},p:te,d(e){e&&M(t),i[16](null)}}}function vp(i){let t,e,n,o,s,r,a=Gi(i[2]),l,c=Wi(i[2]),u,d=Ni(i[2]),h,p,m;const g=i[12]["container-start"],A=It(g,i,i[11],tr),v=i[12]["wrapper-start"],w=It(v,i,i[11],er),y=i[12].default,x=It(y,i,i[11],$s),L=i[12]["wrapper-end"],C=It(L,i,i[11],Ks);let S=a&&nr(i),k=c&&ir(i),G=d&&or(i);const O=i[12]["container-end"],W=It(O,i,i[11],qs);let U=[{class:p=ti(`${i[1]}${i[0]?` ${i[0]}`:""}`)},i[3]],P={};for(let I=0;I<U.length;I+=1)P=we(P,U[I]);return{c(){t=j("div"),A&&A.c(),e=_(),n=j("div"),w&&w.c(),o=_(),x&&x.c(),s=_(),C&&C.c(),r=_(),S&&S.c(),l=_(),k&&k.c(),u=_(),G&&G.c(),h=_(),W&&W.c(),b(n,"class","swiper-wrapper"),Xn(t,P)},m(I,z){B(I,t,z),A&&A.m(t,null),Q(t,e),Q(t,n),w&&w.m(n,null),Q(n,o),x&&x.m(n,null),Q(n,s),C&&C.m(n,null),Q(t,r),S&&S.m(t,null),Q(t,l),k&&k.m(t,null),Q(t,u),G&&G.m(t,null),Q(t,h),W&&W.m(t,null),i[17](t),m=!0},p(I,[z]){A&&A.p&&(!m||z&2560)&&kt(A,g,I,I[11],m?xt(g,I[11],z,Ap):Dt(I[11]),tr),w&&w.p&&(!m||z&2560)&&kt(w,v,I,I[11],m?xt(v,I[11],z,gp):Dt(I[11]),er),x&&x.p&&(!m||z&2560)&&kt(x,y,I,I[11],m?xt(y,I[11],z,pp):Dt(I[11]),$s),C&&C.p&&(!m||z&2560)&&kt(C,L,I,I[11],m?xt(L,I[11],z,mp):Dt(I[11]),Ks),z&4&&(a=Gi(I[2])),a?S?S.p(I,z):(S=nr(I),S.c(),S.m(t,l)):S&&(S.d(1),S=null),z&4&&(c=Wi(I[2])),c?k?k.p(I,z):(k=ir(I),k.c(),k.m(t,u)):k&&(k.d(1),k=null),z&4&&(d=Ni(I[2])),d?G?G.p(I,z):(G=or(I),G.c(),G.m(t,h)):G&&(G.d(1),G=null),W&&W.p&&(!m||z&2560)&&kt(W,O,I,I[11],m?xt(O,I[11],z,fp):Dt(I[11]),qs),Xn(t,P=je(U,[(!m||z&3&&p!==(p=ti(`${I[1]}${I[0]?` ${I[0]}`:""}`)))&&{class:p},z&8&&I[3]]))},i(I){m||(D(A,I),D(w,I),D(x,I),D(C,I),D(W,I),m=!0)},o(I){T(A,I),T(w,I),T(x,I),T(C,I),T(W,I),m=!1},d(I){I&&M(t),A&&A.d(I),w&&w.d(I),x&&x.d(I),C&&C.d(I),S&&S.d(),k&&k.d(),G&&G.d(),W&&W.d(I),i[17](null)}}}function bp(i,t,e){const n=["class","swiper"];let o=Wn(t,n),{$$slots:s={},$$scope:r}=t;const a=tc();let{class:l=void 0}=t,c="swiper",u=!1,d=null,h=null,p,m,g,A,v=null,w=null,y=null,x=null,L=null,C={slides:[]};function S(){return d}const k=H=>{e(9,C=H),ic().then(()=>{d.$wrapperEl.children(".swiper-slide").each(X=>{X.onSwiper&&X.onSwiper(d)}),d.updateSlides(),d.updateProgress(),d.updateSlidesClasses(),d.lazy&&d.params.lazy.enabled&&d.lazy.load()})},G=()=>{p=cp(o),e(2,m=p.params),g=p.passedParams,e(3,A=p.rest)};G(),h=g;const O=()=>{u=!0};if(m.onAny=(H,...X)=>{a(H,X)},Object.assign(m.on,{_beforeBreakpoint:O,_containerClasses(H,X){e(1,c=X)}}),d=new zi.default(m),Bi("swiper",d),d.virtual&&d.params.virtual.enabled){const H={cache:!1,renderExternal:X=>{k(X),m.virtual&&m.virtual.renderExternal&&m.virtual.renderExternal(X)},renderExternalUpdate:!1};ft(d.params.virtual,H),ft(d.originalParams.virtual,H)}Ye(()=>{!v||(up({el:v,nextEl:y,prevEl:w,paginationEl:L,scrollbarEl:x,swiper:d},m),a("swiper",[d]),!m.virtual&&d.slides.each(H=>{H.onSwiper&&H.onSwiper(d)}))}),qi(()=>{if(!d)return;G();const H=dp(g,h);(H.length||u)&&d&&!d.destroyed&&hp({swiper:d,passedParams:g,changedParams:H,nextEl:y,prevEl:w,scrollbarEl:x,paginationEl:L}),u=!1,h=g}),yt(()=>{typeof window!="undefined"&&d&&!d.destroyed&&d.destroy(!0,!1)});function W(H){Te[H?"unshift":"push"](()=>{w=H,e(5,w)})}function U(H){Te[H?"unshift":"push"](()=>{y=H,e(6,y)})}function P(H){Te[H?"unshift":"push"](()=>{x=H,e(7,x)})}function I(H){Te[H?"unshift":"push"](()=>{L=H,e(8,L)})}function z(H){Te[H?"unshift":"push"](()=>{v=H,e(4,v)})}return i.$$set=H=>{t=we(we({},t),qr(H)),e(27,o=Wn(t,n)),"class"in H&&e(0,l=H.class),"$$scope"in H&&e(11,r=H.$$scope)},[l,c,m,A,v,w,y,x,L,C,S,r,s,W,U,P,I,z]}class yp extends oe{constructor(t){super(),ie(this,t,bp,vp,ne,{class:0,swiper:10})}get swiper(){return this.$$.ctx[10]}}const wp=i=>({data:i&32}),sr=i=>({data:i[5]}),Cp=i=>({data:i&32}),rr=i=>({data:i[5]});function Ep(i){let t;const e=i[8].default,n=It(e,i,i[7],sr);return{c(){n&&n.c()},m(o,s){n&&n.m(o,s),t=!0},p(o,s){n&&n.p&&(!t||s&160)&&kt(n,e,o,o[7],t?xt(e,o[7],s,wp):Dt(o[7]),sr)},i(o){t||(D(n,o),t=!0)},o(o){T(n,o),t=!1},d(o){n&&n.d(o)}}}function Pp(i){let t,e,n;const o=i[8].default,s=It(o,i,i[7],rr);return{c(){t=j("div"),s&&s.c(),b(t,"class","swiper-zoom-container"),b(t,"data-swiper-zoom",e=typeof i[0]=="number"?i[0]:void 0)},m(r,a){B(r,t,a),s&&s.m(t,null),n=!0},p(r,a){s&&s.p&&(!n||a&160)&&kt(s,o,r,r[7],n?xt(o,r[7],a,Cp):Dt(r[7]),rr),(!n||a&1&&e!==(e=typeof r[0]=="number"?r[0]:void 0))&&b(t,"data-swiper-zoom",e)},i(r){n||(D(s,r),n=!0)},o(r){T(s,r),n=!1},d(r){r&&M(t),s&&s.d(r)}}}function Ip(i){let t,e,n,o,s;const r=[Pp,Ep],a=[];function l(d,h){return d[0]?0:1}e=l(i),n=a[e]=r[e](i);let c=[{class:o=ti(`${i[3]}${i[2]?` ${i[2]}`:""}`)},{"data-swiper-slide-index":i[1]},i[6]],u={};for(let d=0;d<c.length;d+=1)u=we(u,c[d]);return{c(){t=j("div"),n.c(),Xn(t,u)},m(d,h){B(d,t,h),a[e].m(t,null),i[9](t),s=!0},p(d,[h]){let p=e;e=l(d),e===p?a[e].p(d,h):(le(),T(a[p],1,1,()=>{a[p]=null}),ce(),n=a[e],n?n.p(d,h):(n=a[e]=r[e](d),n.c()),D(n,1),n.m(t,null)),Xn(t,u=je(c,[(!s||h&12&&o!==(o=ti(`${d[3]}${d[2]?` ${d[2]}`:""}`)))&&{class:o},(!s||h&2)&&{"data-swiper-slide-index":d[1]},h&64&&d[6]]))},i(d){s||(D(n),s=!0)},o(d){T(n),s=!1},d(d){d&&M(t),a[e].d(),i[9](null)}}}function xp(i,t,e){let n;const o=["zoom","virtualIndex","class"];let s=Wn(t,o),{$$slots:r={},$$scope:a}=t,{zoom:l=void 0}=t,{virtualIndex:c=void 0}=t,{class:u=void 0}=t,d=null,h="swiper-slide",p=mn("swiper"),m=!1;const g=(y,x,L)=>{x===d&&e(3,h=L)},A=()=>{!p||m||(p.on("_slideClass",g),m=!0)},v=()=>{!p||(p.off("_slideClass",g),m=!1)};Ye(()=>{typeof c!="undefined"&&(e(4,d.onSwiper=y=>{p=y,A()},d),A())}),qi(()=>{if(!(!d||!p)){if(p.destroyed){h!=="swiper-slide"&&e(3,h="swiper-slide");return}A()}}),Zi(()=>{A()}),yt(()=>{!p||v()});function w(y){Te[y?"unshift":"push"](()=>{d=y,e(4,d)})}return i.$$set=y=>{t=we(we({},t),qr(y)),e(6,s=Wn(t,o)),"zoom"in y&&e(0,l=y.zoom),"virtualIndex"in y&&e(1,c=y.virtualIndex),"class"in y&&e(2,u=y.class),"$$scope"in y&&e(7,a=y.$$scope)},i.$$.update=()=>{i.$$.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})},[l,c,u,h,d,n,s,a,r,w]}class kp extends oe{constructor(t){super(),ie(this,t,xp,Ip,ne,{zoom:0,virtualIndex:1,class:2})}}function Dp(i){ae(i,"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 ar(i){let t;function e(s,r){if(s[0].type==="Image")return Sp;if(s[0].type==="Video")return Lp}let n=e(i),o=n&&n(i);return{c(){t=j("div"),o&&o.c(),b(t,"class","media-item svelte-cwtvzu")},m(s,r){B(s,t,r),o&&o.m(t,null)},p(s,r){n===(n=e(s))&&o?o.p(s,r):(o&&o.d(1),o=n&&n(s),o&&(o.c(),o.m(t,null)))},d(s){s&&M(t),o&&o.d()}}}function Lp(i){let t,e,n,o,s,r,a,l,c,u,d;return{c(){var h;t=j("video"),r=_(),a=j("div"),l=j("div"),c=j("div"),b(t,"class","media-content svelte-cwtvzu"),b(t,"style",e=`object-fit: ${i[3]};`),et(t.src,n=i[0].url+"#t=0.1")||b(t,"src",n),b(t,"poster",o=(h=i[0].videoCoverUrl)!=null?h:void 0),b(t,"preload",s=i[0].videoCoverUrl?void 0:"auto"),t.playsInline=!0,b(t,"paused",""),t.loop=!1,b(t,"crossorigin",""),t.controls=!1,q(t,"showPlayButton",i[5]),b(c,"class","video-icon-img svelte-cwtvzu"),R(c,"background-image","url("+(i[1]==="large"?Ws:Xs)+")"),q(c,"canPlay",i[2]),b(l,"class","video-icon svelte-cwtvzu"),q(l,"large",i[1]==="large"),q(l,"small",i[1]==="small"),b(a,"class","video-play-button-container svelte-cwtvzu"),q(a,"showPlayButton",i[5])},m(h,p){B(h,t,p),i[7](t),B(h,r,p),B(h,a,p),Q(a,l),Q(l,c),u||(d=[Pe(t,"click",i[6]),Pe(c,"click",i[8])],u=!0)},p(h,p){var m;p&8&&e!==(e=`object-fit: ${h[3]};`)&&b(t,"style",e),p&1&&!et(t.src,n=h[0].url+"#t=0.1")&&b(t,"src",n),p&1&&o!==(o=(m=h[0].videoCoverUrl)!=null?m:void 0)&&b(t,"poster",o),p&1&&s!==(s=h[0].videoCoverUrl?void 0:"auto")&&b(t,"preload",s),p&32&&q(t,"showPlayButton",h[5]),p&2&&R(c,"background-image","url("+(h[1]==="large"?Ws:Xs)+")"),p&4&&q(c,"canPlay",h[2]),p&2&&q(l,"large",h[1]==="large"),p&2&&q(l,"small",h[1]==="small"),p&32&&q(a,"showPlayButton",h[5])},d(h){h&&M(t),i[7](null),h&&M(r),h&&M(a),u=!1,rt(d)}}}function Sp(i){let t,e,n,o;return{c(){t=j("img"),b(t,"class","media-content svelte-cwtvzu"),b(t,"style",e=`object-fit: ${i[3]};`),et(t.src,n=i[0].url)||b(t,"src",n),b(t,"alt",o=i[0].name)},m(s,r){B(s,t,r)},p(s,r){r&8&&e!==(e=`object-fit: ${s[3]};`)&&b(t,"style",e),r&1&&!et(t.src,n=s[0].url)&&b(t,"src",n),r&1&&o!==(o=s[0].name)&&b(t,"alt",o)},d(s){s&&M(t)}}}function zp(i){let t,e=i[0]&&ar(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),B(n,t,o)},p(n,[o]){n[0]?e?e.p(n,o):(e=ar(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:te,o:te,d(n){e&&e.d(n),n&&M(t)}}}function Mp(i,t,e){let{media:n}=t,{playButtonIfNeed:o="small"}=t,{canPlay:s=!0}=t,{objectFit:r="cover"}=t,a,l=!1;const c=()=>a==null?void 0:a.pause();function u(h){Te[h?"unshift":"push"](()=>{a=h,e(4,a)})}const d=()=>{!s||a&&a.play()};return i.$$set=h=>{"media"in h&&e(0,n=h.media),"playButtonIfNeed"in h&&e(1,o=h.playButtonIfNeed),"canPlay"in h&&e(2,s=h.canPlay),"objectFit"in h&&e(3,r=h.objectFit)},i.$$.update=()=>{i.$$.dirty&16&&a&&(e(5,l=a.paused),a.addEventListener("play",()=>{e(5,l=!1)}),a.addEventListener("pause",()=>{e(5,l=!0)}))},[n,o,s,r,a,l,c,u,d]}class Va extends oe{constructor(t){super(),ie(this,t,Mp,zp,ne,{media:0,playButtonIfNeed:1,canPlay:2,objectFit:3},Dp)}}function Tp(i){ae(i,"svelte-ai0lv9",".media.svelte-ai0lv9{width:100%;height:100%;position:relative;overflow:hidden;border-radius:0.125rem}")}function lr(i,t,e){const n=i.slice();return n[23]=t[e],n}function cr(i){let t,e,n,o,s,r;const a=[jp,Bp],l=[];function c(u,d){return u[13]?0:1}return e=c(i),n=l[e]=a[e](i),{c(){t=j("div"),n.c(),b(t,"class","media svelte-ai0lv9"),q(t,"unfolded",i[4])},m(u,d){B(u,t,d),l[e].m(t,null),r=!0},p(u,d){i=u;let h=e;e=c(i),e===h?l[e].p(i,d):(le(),T(l[h],1,1,()=>{l[h]=null}),ce(),n=l[e],n?n.p(i,d):(n=l[e]=a[e](i),n.c()),D(n,1),n.m(t,null)),(!r||d&16)&&q(t,"unfolded",i[4])},i(u){r||(D(n),u&&xe(()=>{s&&s.end(1),o=Ot(t,Do,i[5]?{y:4,duration:i[3],delay:i[1],easing:Jt}:void 0),o.start()}),r=!0)},o(u){T(n),o&&o.invalidate(),u&&(s=$t(t,Do,i[5]?{y:4,duration:i[3],delay:i[2],easing:Jt}:void 0)),r=!1},d(u){u&&M(t),l[e].d(),u&&s&&s.end()}}}function Bp(i){let t,e;return t=new Va({props:{media:i[0][0],objectFit:i[8],playButtonIfNeed:i[6],canPlay:i[7]}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.media=n[0][0]),o&256&&(s.objectFit=n[8]),o&64&&(s.playButtonIfNeed=n[6]),o&128&&(s.canPlay=n[7]),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function jp(i){let t,e;return t=new yp({props:{style:"height: 100%",modules:[Fr.Autoplay],spaceBetween:30,autoplay:i[14]?ze({delay:4e3,stopOnLastSlide:!1,disableOnInteraction:!1}):!1,loop:!0,$$slots:{default:[Rp]},$$scope:{ctx:i}}}),t.$on("init",i[19]),t.$on("slideChange",i[20]),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&16384&&(s.autoplay=n[14]?ze({delay:4e3,stopOnLastSlide:!1,disableOnInteraction:!1}):!1),o&67111360&&(s.$$scope={dirty:o,ctx:n}),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Qp(i){let t,e,n;return t=new Va({props:{media:i[23],objectFit:i[8],playButtonIfNeed:i[6],canPlay:i[7]}}),{c(){ee(t.$$.fragment),e=_()},m(o,s){K(t,o,s),B(o,e,s),n=!0},p(o,s){const r={};s&2048&&(r.media=o[23]),s&256&&(r.objectFit=o[8]),s&64&&(r.playButtonIfNeed=o[6]),s&128&&(r.canPlay=o[7]),t.$set(r)},i(o){n||(D(t.$$.fragment,o),n=!0)},o(o){T(t.$$.fragment,o),n=!1},d(o){$(t,o),o&&M(e)}}}function ur(i){let t,e;return t=new kp({props:{$$slots:{default:[Qp]},$$scope:{ctx:i}}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&67111360&&(s.$$scope={dirty:o,ctx:n}),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Rp(i){let t,e,n=i[11],o=[];for(let r=0;r<n.length;r+=1)o[r]=ur(lr(i,n,r));const s=r=>T(o[r],1,1,()=>{o[r]=null});return{c(){for(let r=0;r<o.length;r+=1)o[r].c();t=fe()},m(r,a){for(let l=0;l<o.length;l+=1)o[l].m(r,a);B(r,t,a),e=!0},p(r,a){if(a&2496){n=r[11];let l;for(l=0;l<n.length;l+=1){const c=lr(r,n,l);o[l]?(o[l].p(c,a),D(o[l],1)):(o[l]=ur(c),o[l].c(),D(o[l],1),o[l].m(t.parentNode,t))}for(le(),l=n.length;l<o.length;l+=1)s(l);ce()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)D(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)T(o[a]);e=!1},d(r){tt(o,r),r&&M(t)}}}function Op(i){let t,e,n=i[4]&&cr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[4]?n?(n.p(o,s),s&16&&D(n,1)):(n=cr(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Hp(i,t,e){let n,o,s,{tag:r}=t,{mediaData:a}=t,{inDelay:l=0}=t,{outDelay:c=0}=t,{duration:u=0}=t,{unfolded:d=!0}=t,{animation:h=!0}=t,{playButtonIfNeed:p="small"}=t,{canPlay:m=!0}=t,{objectFit:g="cover"}=t,{enableCarousel:A=!0}=t,{autoplayConfig:v={autoplay:!0,autoplayVideo:!1}}=t;const w=mn("mediaStore"),y=mn("hooks");let x;function L(O){!n||!x||(w.set({currentMediaUrl:this.src}),y.emit("playStateChange",{event:O,state:"playing",tag:r,mediaInstance:this}),x.autoplay.stop())}function C(O){!n||!x||(y.emit("playStateChange",{event:O,state:"paused",tag:r,mediaInstance:this}),x.autoplay.running||x.autoplay.start())}let S=null;const k=O=>{e(10,x=O.detail[0])},G=O=>J(this,null,function*(){var H,X,Z;if(!s||!v.autoplayVideo)return;const W=O.detail[0];if(!W)return;const U=W.realIndex;if(U===S)return;e(12,S=U);const P=o[U];if(!P||P.type!=="Video")return;W.autoplay.stop(),W.slides.map(Y=>Y.querySelector("video")).filter(Bt).forEach(Y=>Y.pause());const z=(H=W.slides[W.activeIndex])==null?void 0:H.querySelector("video");if(z&&(z.removeEventListener("play",L),z.removeEventListener("pause",C),z.addEventListener("play",L),z.addEventListener("pause",C)),z){z.addEventListener("click",()=>z.pause());const Y=(Z=(X=z.parentElement)==null?void 0:X.getElementsByClassName("video-play-button-container"))==null?void 0:Z[0];z.addEventListener("play",()=>Y==null?void 0:Y.classList.remove("showPlayButton")),z.addEventListener("pause",()=>Y==null?void 0:Y.classList.add("showPlayButton")),Y&&(z.paused?Y.classList.add("showPlayButton"):Y.classList.remove("showPlayButton"),Y.addEventListener("click",()=>z.play()))}});return i.$$set=O=>{"tag"in O&&e(17,r=O.tag),"mediaData"in O&&e(0,a=O.mediaData),"inDelay"in O&&e(1,l=O.inDelay),"outDelay"in O&&e(2,c=O.outDelay),"duration"in O&&e(3,u=O.duration),"unfolded"in O&&e(4,d=O.unfolded),"animation"in O&&e(5,h=O.animation),"playButtonIfNeed"in O&&e(6,p=O.playButtonIfNeed),"canPlay"in O&&e(7,m=O.canPlay),"objectFit"in O&&e(8,g=O.objectFit),"enableCarousel"in O&&e(18,A=O.enableCarousel),"autoplayConfig"in O&&e(9,v=O.autoplayConfig)},i.$$.update=()=>{i.$$.dirty&262145&&e(13,n=A&&(a==null?void 0:a.length)>1),i.$$.dirty&1&&e(11,o=a),i.$$.dirty&2560&&e(14,s=o.length>1&&v.autoplay),i.$$.dirty&1024&&x&&x.slides.forEach(O=>{const W=O.querySelector("video");W&&w.subscribe(({currentMediaUrl:U})=>{U!==W.src&&W.pause()})})},[a,l,c,u,d,h,p,m,g,v,x,o,S,n,s,L,C,r,A,k,G]}class Ja extends oe{constructor(t){super(),ie(this,t,Hp,Op,ne,{tag:17,mediaData:0,inDelay:1,outDelay:2,duration:3,unfolded:4,animation:5,playButtonIfNeed:6,canPlay:7,objectFit:8,enableCarousel:18,autoplayConfig:9},Tp)}}function Fp(i){ae(i,"svelte-1f7m1lj",".line.svelte-1f7m1lj{position:absolute;width:6.5625rem;height:1.3125rem;transform:translateY(-100%)}.text.svelte-1f7m1lj{position:absolute;width:6.25rem;left:1rem;bottom:0.0625rem;font-weight:600}.media-wrapper.svelte-1f7m1lj{position:absolute;left:0.875rem;top:-5.3125rem;width:5.625rem;height:3.75rem;font-weight:600}")}function dr(i,t,e){const n=i.slice();return n[5]=t[e].id,n[1]=t[e].content,n}function hr(i){let t,e,n,o,s,r=[],a=new Map,l,c,u;t=new Ve({props:{visible:i[4],left:61,bottom:57,width:2,blurRadius:150,spreadRadius:75}}),o=new lp({props:{unfolded:i[4],duration:1e3,outDelay:400}});let d=i[2];const h=m=>m[5];for(let m=0;m<d.length;m+=1){let g=dr(i,d,m),A=h(g);a.set(A,r[m]=fr(A,g))}let p=i[3]&&mr(i);return{c(){ee(t.$$.fragment),e=_(),n=j("div"),ee(o.$$.fragment),s=_();for(let m=0;m<r.length;m+=1)r[m].c();l=_(),p&&p.c(),c=fe(),b(n,"class","line svelte-1f7m1lj")},m(m,g){K(t,m,g),B(m,e,g),B(m,n,g),K(o,n,null),B(m,s,g);for(let A=0;A<r.length;A+=1)r[A].m(m,g);B(m,l,g),p&&p.m(m,g),B(m,c,g),u=!0},p(m,g){const A={};g&16&&(A.visible=m[4]),t.$set(A);const v={};g&16&&(v.unfolded=m[4]),o.$set(v),g&20&&(d=m[2],le(),r=Ue(r,g,h,1,m,d,a,l.parentNode,at,fr,l,dr),ce()),m[3]?p?(p.p(m,g),g&8&&D(p,1)):(p=mr(m),p.c(),D(p,1),p.m(c.parentNode,c)):p&&(le(),T(p,1,1,()=>{p=null}),ce())},i(m){if(!u){D(t.$$.fragment,m),D(o.$$.fragment,m);for(let g=0;g<d.length;g+=1)D(r[g]);D(p),u=!0}},o(m){T(t.$$.fragment,m),T(o.$$.fragment,m);for(let g=0;g<r.length;g+=1)T(r[g]);T(p),u=!1},d(m){$(t,m),m&&M(e),m&&M(n),$(o),m&&M(s);for(let g=0;g<r.length;g+=1)r[g].d(m);m&&M(l),p&&p.d(m),m&&M(c)}}}function fr(i,t){let e,n,o;return n=new Xa({props:{unfolded:t[4],content:t[1],inDelay:500}}),{key:i,first:null,c(){e=j("div"),ee(n.$$.fragment),b(e,"class","text svelte-1f7m1lj"),this.first=e},m(s,r){B(s,e,r),K(n,e,null),o=!0},p(s,r){t=s;const a={};r&16&&(a.unfolded=t[4]),r&4&&(a.content=t[1]),n.$set(a)},i(s){o||(D(n.$$.fragment,s),o=!0)},o(s){T(n.$$.fragment,s),o=!1},d(s){s&&M(e),$(n)}}}function mr(i){let t,e,n;return e=new Ja({props:{autoplayConfig:{autoplay:!1},unfolded:i[4],mediaData:i[3],tag:i[0],enableCarousel:!1,canPlay:!1,playButtonIfNeed:"small",inDelay:500,duration:500}}),{c(){t=j("div"),ee(e.$$.fragment),b(t,"class","media-wrapper svelte-1f7m1lj")},m(o,s){B(o,t,s),K(e,t,null),n=!0},p(o,s){const r={};s&16&&(r.unfolded=o[4]),s&8&&(r.mediaData=o[3]),s&1&&(r.tag=o[0]),e.$set(r)},i(o){n||(D(e.$$.fragment,o),n=!0)},o(o){T(e.$$.fragment,o),n=!1},d(o){o&&M(t),$(e)}}}function Gp(i){let t,e,n=i[0].state&&hr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&D(n,1)):(n=hr(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Np(i,t,e){let n,o,s,{tag:r}=t,a;return i.$$set=l=>{"tag"in l&&e(0,r=l.tag)},i.$$.update=()=>{var l,c,u;i.$$.dirty&1&&e(4,n=r.state?r.state.unfolded:!1),i.$$.dirty&1&&e(1,o=((c=(l=r.data.text)==null?void 0:l.length)!=null?c:0)>7?((u=r.data.text)==null?void 0:u.substring(0,6))+"...":r.data.text),i.$$.dirty&1&&e(3,s=r.data.mediaData),i.$$.dirty&2&&e(2,a=o?[{id:He(),content:o}]:[])},[r,o,a,s,n]}class Wp extends oe{constructor(t){super(),ie(this,t,Np,Gp,ne,{tag:0},Fp)}}function Xp(i){ae(i,"svelte-8mby9k",".svelte-8mby9k.svelte-8mby9k{box-sizing:border-box}.marketing.svelte-8mby9k.svelte-8mby9k{transform:translateY(-100%)}.content.svelte-8mby9k .headerImage.svelte-8mby9k{position:absolute;width:100%;top:0.25rem;transform:translateY(-100%);border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.line.svelte-8mby9k.svelte-8mby9k{position:absolute;height:2.0625rem;width:0.0625rem;left:50%;transform:translateX(-50%);background-color:white;bottom:0;transform-origin:bottom;transition:all 500ms}.content.svelte-8mby9k.svelte-8mby9k{background-color:white;position:relative;display:flex;flex-direction:column;min-width:11.125rem;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;border-radius:0.25rem;top:-1.875rem;left:-1rem;padding:0.5rem 0rem 0.5625rem;transition:all 500ms}.title.svelte-8mby9k.svelte-8mby9k{position:absolute;background-color:white;border-radius:0.25rem;width:100%;top:0.5rem;padding-left:0.75rem;padding-right:0.75rem}.title.svelte-8mby9k .text.svelte-8mby9k{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;font-weight:bold;line-height:1.125rem;color:#000}.footer.svelte-8mby9k.svelte-8mby9k{position:relative;padding-left:0.75rem;padding-right:0.75rem;width:100%;height:1.375rem;display:flex;align-items:center}.footer.svelte-8mby9k .goto-button.svelte-8mby9k{flex-shrink:0;white-space:nowrap;background-image:linear-gradient(to right, rgba(87, 144, 253, 1) 0, rgba(42, 114, 254, 1) 100%);color:#fff;font-size:0.625rem;border-radius:0.875rem;font-weight:bold;padding-left:0.5rem;padding-right:0.5rem;height:1.25rem;margin-left:auto;display:flex;align-items:center}.footer.svelte-8mby9k .goto-icon.svelte-8mby9k::after{content:'';display:inline-block;width:0.75rem;height:0.75rem;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAeFBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////GqOSsAAAAJ3RSTlMAFNO2pYt4bErz8uP6ysawgVtBPDcR5C4s2L6ZmJBzZGJXUyEeDws/0G2zAAAAkklEQVQ4y+3TRw6DMBAF0OAeJ3QCpCe0uf8NwRILLBYfiS1/aT3JoymnI+sERZ5VCH0iVto3QDfBLmeSSMUTogRV9bBEpJAKaYpGijn13aTSLeraeG9D0NZFZv4/rRL5FDHnITlllqjv6tykWsmX4JHr05y7j6oFKq2P8He48B0tAM0EY0EDxquClw6vLz6EI35GmwwSZpe+WOgAAAAASUVORK5CYII=);background-size:100% auto;background-repeat:no-repeat}.price.svelte-8mby9k.svelte-8mby9k{flex-shrink:0;margin-right:0.75rem;white-space:nowrap;color:#ff6600;display:flex;align-items:baseline}.price.svelte-8mby9k .value.svelte-8mby9k{position:relative;top:0.0625rem;font-size:1.125rem;line-height:1.375rem;font-family:TG-TYPE, PingFangSC, Segoe UI, Rototo, sans-serif;letter-spacing:0rem}.price.svelte-8mby9k .unit.svelte-8mby9k{padding-left:0.125rem;font-size:0.625rem}.tag.svelte-8mby9k.svelte-8mby9k{position:relative;background-color:white;display:flex;width:-moz-max-content;width:max-content;padding-left:0.75rem;padding-right:0.75rem;min-height:1.75rem}.tag.svelte-8mby9k .base-tag.svelte-8mby9k{height:1rem;margin-top:1.375rem;margin-bottom:0.5rem;margin-right:0.25rem;font-size:0.625rem;line-height:0.875rem;padding:0.0625rem 0.25rem;border-radius:0.125rem;overflow:hidden}.tag.svelte-8mby9k .primary-tag.svelte-8mby9k{background:#e5eefe;color:#0055ff}.tag.svelte-8mby9k .secondary-tag.svelte-8mby9k{background:rgba(255, 102, 0, 0.08);color:rgba(255, 102, 0, 1)}.unfolded.svelte-8mby9k .line.svelte-8mby9k{transform:translateX(-50%) scale(1, 1)}.folded.svelte-8mby9k .line.svelte-8mby9k{transform:translateX(-50%) scale(1, 0);transition-timing-function:ease-in}.unfolded.svelte-8mby9k .content.svelte-8mby9k{opacity:1}.folded.svelte-8mby9k .content.svelte-8mby9k{opacity:0;transform:translateY(0.425rem);transition-timing-function:ease-in}")}function pr(i,t,e){const n=i.slice();return n[0]=t[e],n}function gr(i,t,e){const n=i.slice();return n[0]=t[e],n}function Ar(i){let t,e=i[0]+"",n;return{c(){t=j("div"),n=ke(e),b(t,"class","base-tag primary-tag svelte-8mby9k")},m(o,s){B(o,t,s),Q(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&Be(n,e)},d(o){o&&M(t)}}}function vr(i){let t,e=i[0]&&Ar(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),B(n,t,o)},p(n,o){n[0]?e?e.p(n,o):(e=Ar(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},d(n){e&&e.d(n),n&&M(t)}}}function br(i){let t,e=i[0]+"",n;return{c(){t=j("div"),n=ke(e),b(t,"class","base-tag secondary-tag svelte-8mby9k")},m(o,s){B(o,t,s),Q(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&Be(n,e)},d(o){o&&M(t)}}}function yr(i){let t,e=i[0]&&br(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),B(n,t,o)},p(n,o){n[0]?e?e.p(n,o):(e=br(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},d(n){e&&e.d(n),n&&M(t)}}}function wr(i){let t,e,n=i[2].price.value+"",o,s,r=i[2].price.unit&&Cr(i);return{c(){t=j("div"),e=j("span"),o=ke(n),s=_(),r&&r.c(),b(e,"class","value svelte-8mby9k"),b(t,"class","price svelte-8mby9k")},m(a,l){B(a,t,l),Q(t,e),Q(e,o),Q(t,s),r&&r.m(t,null)},p(a,l){l&4&&n!==(n=a[2].price.value+"")&&Be(o,n),a[2].price.unit?r?r.p(a,l):(r=Cr(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&M(t),r&&r.d()}}}function Cr(i){let t,e=i[2].price.unit+"",n;return{c(){t=j("span"),n=ke(e),b(t,"class","unit svelte-8mby9k")},m(o,s){B(o,t,s),Q(t,n)},p(o,s){s&4&&e!==(e=o[2].price.unit+"")&&Be(n,e)},d(o){o&&M(t)}}}function Er(i){let t,e=i[2].highlightText+"",n;return{c(){t=j("div"),n=ke(e),b(t,"class","goto-button goto-icon svelte-8mby9k")},m(o,s){B(o,t,s),Q(t,n)},p(o,s){s&4&&e!==(e=o[2].highlightText+"")&&Be(n,e)},d(o){o&&M(t)}}}function Yp(i){var W,U;let t,e,n,o,s,r,a,l,c,u,d,h,p,m,g=i[2].title+"",A,v,w,y,x;e=new Ve({props:{visible:i[1],outDelay:500,left:61,bottom:87,blurRadius:150,spreadRadius:75}});let L=i[2].brandTags||[],C=[];for(let P=0;P<L.length;P+=1)C[P]=vr(gr(i,L,P));let S=i[2].tags||[],k=[];for(let P=0;P<S.length;P+=1)k[P]=yr(pr(i,S,P));let G=((W=i[2].price)==null?void 0:W.value)!==void 0&&((U=i[2].price)==null?void 0:U.value)!==null&&wr(i),O=i[2].highlightText&&Er(i);return{c(){var P,I;t=j("div"),ee(e.$$.fragment),n=_(),o=j("div"),s=_(),r=j("div"),a=j("img"),c=_(),u=j("div");for(let z=0;z<C.length;z+=1)C[z].c();d=_();for(let z=0;z<k.length;z+=1)k[z].c();h=_(),p=j("div"),m=j("div"),A=ke(g),v=_(),w=j("div"),G&&G.c(),y=_(),O&&O.c(),b(o,"class","line svelte-8mby9k"),R(o,"transition-delay",i[1]?Bn+"ms":jn+Ir-Pr-40+"ms"),b(a,"class","headerImage svelte-8mby9k"),et(a.src,l=i[2].headerPictureUrl)||b(a,"src",l),b(a,"alt",""),b(u,"class","tag svelte-8mby9k"),b(m,"class","text svelte-8mby9k"),b(p,"class","title svelte-8mby9k"),b(w,"class","footer svelte-8mby9k"),R(w,"height",((P=i[2].price)==null?void 0:P.value)!==void 0&&((I=i[2].price)==null?void 0:I.value)!==null&&i[2].highlightText?void 0:"1rem"),b(r,"class","content svelte-8mby9k"),R(r,"transition-delay",i[1]?Bn+jn+"ms":"0ms"),b(t,"class","marketing svelte-8mby9k"),q(t,"unfolded",i[1]),q(t,"folded",i[3])},m(P,I){B(P,t,I),K(e,t,null),Q(t,n),Q(t,o),Q(t,s),Q(t,r),Q(r,a),Q(r,c),Q(r,u);for(let z=0;z<C.length;z+=1)C[z].m(u,null);Q(u,d);for(let z=0;z<k.length;z+=1)k[z].m(u,null);Q(r,h),Q(r,p),Q(p,m),Q(m,A),Q(r,v),Q(r,w),G&&G.m(w,null),Q(w,y),O&&O.m(w,null),x=!0},p(P,[I]){var H,X,Z,Y;const z={};if(I&2&&(z.visible=P[1]),e.$set(z),I&2&&R(o,"transition-delay",P[1]?Bn+"ms":jn+Ir-Pr-40+"ms"),(!x||I&4&&!et(a.src,l=P[2].headerPictureUrl))&&b(a,"src",l),I&4){L=P[2].brandTags||[];let V;for(V=0;V<L.length;V+=1){const ue=gr(P,L,V);C[V]?C[V].p(ue,I):(C[V]=vr(ue),C[V].c(),C[V].m(u,d))}for(;V<C.length;V+=1)C[V].d(1);C.length=L.length}if(I&4){S=P[2].tags||[];let V;for(V=0;V<S.length;V+=1){const ue=pr(P,S,V);k[V]?k[V].p(ue,I):(k[V]=yr(ue),k[V].c(),k[V].m(u,null))}for(;V<k.length;V+=1)k[V].d(1);k.length=S.length}(!x||I&4)&&g!==(g=P[2].title+"")&&Be(A,g),((H=P[2].price)==null?void 0:H.value)!==void 0&&((X=P[2].price)==null?void 0:X.value)!==null?G?G.p(P,I):(G=wr(P),G.c(),G.m(w,y)):G&&(G.d(1),G=null),P[2].highlightText?O?O.p(P,I):(O=Er(P),O.c(),O.m(w,null)):O&&(O.d(1),O=null),I&4&&R(w,"height",((Z=P[2].price)==null?void 0:Z.value)!==void 0&&((Y=P[2].price)==null?void 0:Y.value)!==null&&P[2].highlightText?void 0:"1rem"),I&2&&R(r,"transition-delay",P[1]?Bn+jn+"ms":"0ms"),(!x||I&2)&&q(t,"unfolded",P[1]),(!x||I&8)&&q(t,"folded",P[3])},i(P){x||(D(e.$$.fragment,P),x=!0)},o(P){T(e.$$.fragment,P),x=!1},d(P){P&&M(t),$(e),tt(C,P),tt(k,P),G&&G.d(),O&&O.d()}}}const Bn=400,Pr=500,jn=180,Ir=500;function Up(i,t,e){let n,o,s,{tag:r}=t;return i.$$set=a=>{"tag"in a&&e(0,r=a.tag)},i.$$.update=()=>{var a,l;i.$$.dirty&1&&e(1,n=(l=(a=r.state)==null?void 0:a.unfolded)!=null?l:!1),i.$$.dirty&2&&e(3,o=!n),i.$$.dirty&1&&e(2,s=r.data)},[r,n,s,o]}class Vp extends oe{constructor(t){super(),ie(this,t,Up,Yp,ne,{tag:0},Xp)}}function Jp(i){ae(i,"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 xr(i){let t,e,n,o,s,r,a,l=!0,c,u,d,h,p;return e=new Ve({props:{center:!0,blurRadius:15,spreadRadius:6}}),{c(){t=j("div"),ee(e.$$.fragment),n=_(),o=j("div"),s=_(),r=j("audio"),b(o,"class","audio-icon svelte-1ku3wt4"),r.controls=!1,b(r,"playsinline",""),et(r.src,a=i[3])||b(r,"src",a),b(t,"class","audio svelte-1ku3wt4"),q(t,"paused",i[6])},m(m,g){B(m,t,g),K(e,t,null),Q(t,n),Q(t,o),Q(t,s),Q(t,r),i[9](r),d=!0,h||(p=[Pe(r,"play",i[10]),Pe(r,"pause",i[10]),Pe(t,"click",_i(i[7]))],h=!0)},p(m,g){i=m,(!d||g&8&&!et(r.src,a=i[3]))&&b(r,"src",a),g&64&&l!==(l=i[6])&&r[l?"pause":"play"](),(!d||g&64)&&q(t,"paused",i[6])},i(m){d||(D(e.$$.fragment,m),m&&xe(()=>{u&&u.end(1),c=Ot(t,Tt,{duration:i[2],delay:i[0],easing:_t}),c.start()}),d=!0)},o(m){T(e.$$.fragment,m),c&&c.invalidate(),m&&(u=$t(t,Tt,{duration:i[2],delay:i[1],easing:_t})),d=!1},d(m){m&&M(t),$(e),i[9](null),m&&u&&u.end(),h=!1,rt(p)}}}function _p(i){let t,e,n=i[4]&&xr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[4]?n?(n.p(o,s),s&16&&D(n,1)):(n=xr(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Zp(i,t,e){let{inDelay:n=0}=t,{outDelay:o=0}=t,{duration:s=0}=t,{url:r}=t,{unfolded:a}=t,{hooksInfo:l={}}=t;const c=mn("hooks"),u=mn("mediaStore");let d,h=!0;u.subscribe(({currentMediaUrl:A})=>{A!==r&&(d==null||d.pause())});function p(A){u.set({currentMediaUrl:r}),d&&(c.emit("click",N({event:A,target:"AudioTagPlayIcon",audioInstance:d},l)),d.paused?d.play():d.pause(),e(5,d.onplay=v=>c.emit("playStateChange",N({event:v,state:"playing",mediaInstance:d},l)),d),e(5,d.onpause=v=>c.emit("playStateChange",N({event:v,state:"paused",mediaInstance:d},l)),d))}function m(A){Te[A?"unshift":"push"](()=>{d=A,e(5,d)})}function g(){h=this.paused,e(6,h)}return i.$$set=A=>{"inDelay"in A&&e(0,n=A.inDelay),"outDelay"in A&&e(1,o=A.outDelay),"duration"in A&&e(2,s=A.duration),"url"in A&&e(3,r=A.url),"unfolded"in A&&e(4,a=A.unfolded),"hooksInfo"in A&&e(8,l=A.hooksInfo)},i.$$.update=()=>{i.$$.dirty&48&&(a||d==null||d.pause())},[n,o,s,r,a,d,h,p,l,m,g]}class qp extends oe{constructor(t){super(),ie(this,t,Zp,_p,ne,{inDelay:0,outDelay:1,duration:2,url:3,unfolded:4,hooksInfo:8},Jp)}}function Kp(i){ae(i,"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 kr(i){var w,y,x,L;let t,e,n,o,s,r,a,l,c,u,d,h,p,m,g,A,v;return e=new Ve({props:{visible:i[5],left:i[2]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}}),s=new Wa({props:{unfolded:i[5],duration:1e3,outDelay:i[4]+20*Math.min((y=(w=i[3][0])==null?void 0:w.content.length)!=null?y:10,15)}}),u=new qp({props:{unfolded:i[5],url:i[0].data.audioUrl,duration:1e3,outDelay:20*Math.min((L=(x=i[3][0])==null?void 0:x.content.length)!=null?L:10,15),hooksInfo:{tag:i[0]}}}),p=new Ya({props:{visible:i[5],textUnfolded:i[1],textItems:i[3]}}),{c(){t=j("div"),ee(e.$$.fragment),n=_(),o=j("div"),ee(s.$$.fragment),r=_(),a=j("div"),l=j("div"),c=j("div"),ee(u.$$.fragment),d=_(),h=j("div"),ee(p.$$.fragment),b(o,"class","line svelte-4r8s18"),R(o,"width",i[2]+"px"),b(c,"class","audio-icon svelte-4r8s18"),R(h,"display","inline-block"),b(l,"class","wrapper svelte-4r8s18"),b(a,"class","content svelte-4r8s18"),xe(()=>i[8].call(a)),b(t,"class","audio-tag svelte-4r8s18"),q(t,"unfolded",i[5])},m(C,S){B(C,t,S),K(e,t,null),Q(t,n),Q(t,o),K(s,o,null),Q(t,r),Q(t,a),Q(a,l),Q(l,c),K(u,c,null),Q(l,d),Q(l,h),K(p,h,null),m=bt(a,i[8].bind(a)),g=!0,A||(v=Pe(h,"click",i[6]),A=!0)},p(C,S){var U,P,I,z;const k={};S&32&&(k.visible=C[5]),S&4&&(k.left=C[2]/2+"px"),e.$set(k);const G={};S&32&&(G.unfolded=C[5]),S&24&&(G.outDelay=C[4]+20*Math.min((P=(U=C[3][0])==null?void 0:U.content.length)!=null?P:10,15)),s.$set(G),S&4&&R(o,"width",C[2]+"px");const O={};S&32&&(O.unfolded=C[5]),S&1&&(O.url=C[0].data.audioUrl),S&8&&(O.outDelay=20*Math.min((z=(I=C[3][0])==null?void 0:I.content.length)!=null?z:10,15)),S&1&&(O.hooksInfo={tag:C[0]}),u.$set(O);const W={};S&32&&(W.visible=C[5]),S&2&&(W.textUnfolded=C[1]),S&8&&(W.textItems=C[3]),p.$set(W),(!g||S&32)&&q(t,"unfolded",C[5])},i(C){g||(D(e.$$.fragment,C),D(s.$$.fragment,C),D(u.$$.fragment,C),D(p.$$.fragment,C),g=!0)},o(C){T(e.$$.fragment,C),T(s.$$.fragment,C),T(u.$$.fragment,C),T(p.$$.fragment,C),g=!1},d(C){C&&M(t),$(e),$(s),$(u),$(p),m(),A=!1,v()}}}function $p(i){let t,e,n=i[0].state&&kr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&D(n,1)):(n=kr(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function eg(i,t,e){let n,o,s,{tag:r}=t,a=!1,l,c=[];function u(){e(1,a=!a)}function d(){l=this.clientWidth,e(2,l)}return i.$$set=h=>{"tag"in h&&e(0,r=h.tag)},i.$$.update=()=>{var h;i.$$.dirty&1&&e(5,n=!!((h=r.state)!=null&&h.unfolded)),i.$$.dirty&1&&e(7,o=r.data.text),i.$$.dirty&128&&e(3,c=[{id:He(),content:o}]),i.$$.dirty&2&&e(4,s=a?450:0)},[r,a,l,c,s,n,u,o,d]}class tg extends oe{constructor(t){super(),ie(this,t,eg,$p,ne,{tag:0},Kp)}}function ng(i){ae(i,"svelte-10cw0el",".media-wrapper.svelte-10cw0el{position:absolute;width:100%;height:100%}")}function Dr(i){let t,e,n;return e=new Ja({props:{unfolded:i[5],mediaData:i[4],objectFit:i[2],enableCarousel:i[1],autoplayConfig:i[3],tag:i[0],canPlay:!0,playButtonIfNeed:"large",inDelay:500,duration:500}}),{c(){t=j("div"),ee(e.$$.fragment),b(t,"class","media-wrapper svelte-10cw0el")},m(o,s){B(o,t,s),K(e,t,null),n=!0},p(o,s){const r={};s&32&&(r.unfolded=o[5]),s&16&&(r.mediaData=o[4]),s&4&&(r.objectFit=o[2]),s&2&&(r.enableCarousel=o[1]),s&8&&(r.autoplayConfig=o[3]),s&1&&(r.tag=o[0]),e.$set(r)},i(o){n||(D(e.$$.fragment,o),n=!0)},o(o){T(e.$$.fragment,o),n=!1},d(o){o&&M(t),$(e)}}}function ig(i){let t,e,n=i[0].state&&i[4]&&Dr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[0].state&&o[4]?n?(n.p(o,s),s&17&&D(n,1)):(n=Dr(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function og(i,t,e){let n,o,s,r,a,{tag:l}=t;return i.$$set=c=>{"tag"in c&&e(0,l=c.tag)},i.$$.update=()=>{var c,u;i.$$.dirty&1&&e(5,n=l.state?l.state.unfolded:!1),i.$$.dirty&1&&e(4,o=l.data.mediaData),i.$$.dirty&1&&e(1,s=l.data.enableCarousel),i.$$.dirty&3&&e(3,r=(c=l.data.autoplayConfig)!=null?c:{autoplay:s!=null?s:!0,autoplayVideo:!0}),i.$$.dirty&1&&e(2,a=(u=l.data.objectFit)!=null?u:(()=>l.data.adaptationMode==="stretch"?"cover":l.data.adaptationMode==="proportional"?"contain":void 0)())},[l,s,a,r,o,n]}class sg extends oe{constructor(t){super(),ie(this,t,og,ig,ne,{tag:0},ng)}}function rg(i){ae(i,"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/CrRbaYRu5dz44C7XfYTXimZbESiYconk2GwGdwSOF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9I1MIJ94bvk4mNGORdcr41GLd8xjpM94HxZAmO7CAtmOF3Pyoz5srJ8bCZaw68M95NJU4GshlNf1dAf4i+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 ag(i){let t,e,n,o;return t=new Ve({props:{visible:!0,outDelay:0,inDelay:0,width:1.4,left:13,bottom:"auto",blurRadius:50,spreadRadius:18}}),{c(){ee(t.$$.fragment),e=_(),n=j("div"),b(n,"class","link svelte-7x7u86")},m(s,r){K(t,s,r),B(s,e,r),B(s,n,r),o=!0},i(s){o||(D(t.$$.fragment,s),o=!0)},o(s){T(t.$$.fragment,s),o=!1},d(s){$(t,s),s&&M(e),s&&M(n)}}}function lg(i){let t,e,n,o,s,r,a,l;return t=new Ve({props:{visible:!0,outDelay:0,inDelay:0,height:1.2,left:13,bottom:12,blurRadius:50,spreadRadius:18}}),{c(){ee(t.$$.fragment),e=_(),n=j("div"),o=_(),s=j("div"),r=_(),a=j("div"),b(n,"class","arrow0 svelte-7x7u86"),b(s,"class","arrow1 svelte-7x7u86"),b(a,"class","arrow2 svelte-7x7u86")},m(c,u){K(t,c,u),B(c,e,u),B(c,n,u),B(c,o,u),B(c,s,u),B(c,r,u),B(c,a,u),l=!0},i(c){l||(D(t.$$.fragment,c),l=!0)},o(c){T(t.$$.fragment,c),l=!1},d(c){$(t,c),c&&M(e),c&&M(n),c&&M(o),c&&M(s),c&&M(r),c&&M(a)}}}function cg(i){let t,e,n,o,s,r,a,l,c,u=i[0].text+"",d,h;const p=[lg,ag],m=[];function g(A,v){return A[0].linkType===ei.VrLink?0:A[0].linkType===ei.NormalLink?1:-1}return~(n=g(i))&&(o=m[n]=p[n](i)),a=new Ve({props:{visible:!0,outDelay:0,inDelay:0,left:"auto",bottom:"auto",width:"80%",blurRadius:40,spreadRadius:16,opacity:.08}}),{c(){t=j("div"),e=j("div"),o&&o.c(),s=_(),r=j("div"),ee(a.$$.fragment),l=_(),c=j("div"),d=ke(u),b(e,"class","icon svelte-7x7u86"),b(c,"class","text svelte-7x7u86"),b(r,"class","text-wrapper svelte-7x7u86"),b(t,"class","wrapper svelte-7x7u86")},m(A,v){B(A,t,v),Q(t,e),~n&&m[n].m(e,null),Q(t,s),Q(t,r),K(a,r,null),Q(r,l),Q(r,c),Q(c,d),h=!0},p(A,[v]){let w=n;n=g(A),n!==w&&(o&&(le(),T(m[w],1,1,()=>{m[w]=null}),ce()),~n?(o=m[n],o||(o=m[n]=p[n](A),o.c()),D(o,1),o.m(e,null)):o=null),(!h||v&1)&&u!==(u=A[0].text+"")&&Be(d,u)},i(A){h||(D(o),D(a.$$.fragment,A),h=!0)},o(A){T(o),T(a.$$.fragment,A),h=!1},d(A){A&&M(t),~n&&m[n].d(),$(a)}}}function ug(i,t,e){let n,{tag:o}=t;return i.$$set=s=>{"tag"in s&&e(1,o=s.tag)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=o.data)},[n,o]}class dg extends oe{constructor(t){super(),ie(this,t,ug,cg,ne,{tag:1},rg)}}function hg(i){ae(i,"svelte-kzl2aj",".customElement__container.svelte-kzl2aj{position:relative}")}function Lr(i){let t,e=i[0].element+"",n;return{c(){t=new Yn(!1),n=fe(),t.a=n},m(o,s){t.m(e,o,s),B(o,n,s)},p(o,s){s&1&&e!==(e=o[0].element+"")&&t.p(e)},d(o){o&&M(n),o&&t.d()}}}function fg(i){let t,e=typeof i[0].element=="string"&&Lr(i);return{c(){t=j("div"),e&&e.c(),b(t,"class","customElement__container svelte-kzl2aj")},m(n,o){B(n,t,o),e&&e.m(t,null),i[2](t)},p(n,[o]){typeof n[0].element=="string"?e?e.p(n,o):(e=Lr(n),e.c(),e.m(t,null)):e&&(e.d(1),e=null)},i:te,o:te,d(n){n&&M(t),e&&e.d(),i[2](null)}}}function mg(i,t,e){let{tag:n}=t,o,s;Ye(()=>{if(o){if(n.element instanceof Element){const a=n.element;o.appendChild(a),s=()=>o==null?void 0:o.removeChild(a)}else if(typeof n.element=="function"){const a=n.element;s=a(o)}}}),yt(()=>{s==null||s()});function r(a){Te[a?"unshift":"push"](()=>{o=a,e(1,o)})}return i.$$set=a=>{"tag"in a&&e(0,n=a.tag)},[n,o,r]}class pg extends oe{constructor(t){super(),ie(this,t,mg,fg,ne,{tag:0},hg)}}function gg(i){ae(i,"svelte-95x526",`@font-face{font-family:'TG-TYPE';font-style:normal;font-weight:400;src:local('TG-TYPE-Bold'),
|
|
544
|
+
`))&&b(t,"style",e),a&8&&R(t,"width",Ne(i[3])),a&16&&R(t,"height",Ne(i[4])),a&8192&&R(t,"z-index",i[13])},i(r){s||(r&&xe(()=>{o&&o.end(1),n=Ot(t,Tt,{duration:i[0]}),n.start()}),s=!0)},o(r){n&&n.invalidate(),r&&(o=$t(t,Tt,{duration:i[1]})),s=!1},d(r){r&&M(t),r&&o&&o.end()}}}function Fm(i){let t,e=i[2]&&Hs(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),B(n,t,o)},p(n,[o]){n[2]?e?(e.p(n,o),o&4&&D(e,1)):(e=Hs(n),e.c(),D(e,1),e.m(t.parentNode,t)):e&&(le(),T(e,1,1,()=>{e=null}),ce())},i(n){D(e)},o(n){T(e)},d(n){e&&e.d(n),n&&M(t)}}}function Ne(i){return typeof i=="number"?i/16+"rem":i}function Gm(i,t,e){let{inDelay:n=1e3}=t,{outDelay:o=1e3}=t,{visible:s=!0}=t,{width:r=0}=t,{height:a=0}=t,{left:l=0}=t,{bottom:c=0}=t,{center:u=!1}=t,{horizontalCenter:d=!1}=t,{verticalCenter:h=!1}=t,{blurRadius:p}=t,{spreadRadius:m}=t,{opacity:g=.15}=t,{zIndex:A=void 0}=t;return i.$$set=v=>{"inDelay"in v&&e(0,n=v.inDelay),"outDelay"in v&&e(1,o=v.outDelay),"visible"in v&&e(2,s=v.visible),"width"in v&&e(3,r=v.width),"height"in v&&e(4,a=v.height),"left"in v&&e(5,l=v.left),"bottom"in v&&e(6,c=v.bottom),"center"in v&&e(7,u=v.center),"horizontalCenter"in v&&e(8,d=v.horizontalCenter),"verticalCenter"in v&&e(9,h=v.verticalCenter),"blurRadius"in v&&e(10,p=v.blurRadius),"spreadRadius"in v&&e(11,m=v.spreadRadius),"opacity"in v&&e(12,g=v.opacity),"zIndex"in v&&e(13,A=v.zIndex)},[n,o,s,r,a,l,c,u,d,h,p,m,g,A]}class Ve extends oe{constructor(t){super(),ie(this,t,Gm,Fm,ne,{inDelay:0,outDelay:1,visible:2,width:3,height:4,left:5,bottom:6,center:7,horizontalCenter:8,verticalCenter:9,blurRadius:10,spreadRadius:11,opacity:12,zIndex:13},Hm)}}function Nm(){return Math.random().toString(36).slice(-6)}const Fs=Nm();function Wm(i){ae(i,"svelte-zgfkts",".text-char.svelte-zgfkts{text-shadow:0.125rem 0rem 0.5rem rgba(0, 0, 0, 0.15)}")}function Gs(i,t,e){const n=i.slice();return n[10]=t[e],n[11]=t,n[12]=e,n}function Ns(i){let t,e=i[10]+"",n,o=i[12];const s=()=>i[6](t,o),r=()=>i[6](null,o);return{c(){t=j("span"),n=ke(e),b(t,"class","text-char svelte-zgfkts")},m(a,l){B(a,t,l),Q(t,n),s()},p(a,l){i=a,l&2&&e!==(e=i[10]+"")&&Te(n,e),o!==i[12]&&(r(),o=i[12],s())},d(a){a&&M(t),r()}}}function Xm(i){let t,e=i[1],n=[];for(let o=0;o<e.length;o+=1)n[o]=Ns(Gs(i,e,o));return{c(){for(let o=0;o<n.length;o+=1)n[o].c();t=fe()},m(o,s){for(let r=0;r<n.length;r+=1)n[r].m(o,s);B(o,t,s)},p(o,[s]){if(s&3){e=o[1];let r;for(r=0;r<e.length;r+=1){const a=Gs(o,e,r);n[r]?n[r].p(a,s):(n[r]=Ns(a),n[r].c(),n[r].m(t.parentNode,t))}for(;r<n.length;r+=1)n[r].d(1);n.length=e.length}},i:te,o:te,d(o){tt(n,o),o&&M(t)}}}function Ym(i,t,e){let n,{inDelay:o=0}=t,{outDelay:s=0}=t,{content:r}=t,{unfolded:a}=t,l,c=[],u;function d(p){clearTimeout(l),l=setTimeout(function(){!u||(p&&u.reversed||!p&&!u.reversed)&&(u.reverse(),u.play())},p?o:s)}Ye(function(){const p=(()=>{const m=jm(g=>c[g].getBoundingClientRect().x,[Math.min(c.length-1,10),Math.min(c.length-1,30)]);if(m>0)return m})();u=Ao.default({targets:c.slice(0,p).filter(Bt),autoplay:!1,duration:400,scale:[.7,1],rotate:[20,0],opacity:[0,1],translateX:[4,0],translateY:[10,0],delay:Ao.default.stagger(50),easing:"easeInOutCubic"}),a&&u.seek(u.duration)});function h(p,m){Me[p?"unshift":"push"](()=>{c[m]=p,e(0,c)})}return i.$$set=p=>{"inDelay"in p&&e(2,o=p.inDelay),"outDelay"in p&&e(3,s=p.outDelay),"content"in p&&e(4,r=p.content),"unfolded"in p&&e(5,a=p.unfolded)},i.$$.update=()=>{i.$$.dirty&16&&e(1,n=(()=>{const p=[],m=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")),g=`__EMOJI_SPLIT_${Fs}__`,A=`__EMOJI_${Fs}__`;return r.slice().replace(m,v=>`${g}${A}${v}${g}`).split(g).forEach(v=>v.startsWith(A)?p.push(v.slice(A.length)):p.push(...v.split(""))),p})()),i.$$.dirty&32&&d(a)},[c,n,o,s,r,a,h]}class Xa extends oe{constructor(t){super(),ie(this,t,Ym,Xm,ne,{inDelay:2,outDelay:3,content:4,unfolded:5},Wm)}}const Um="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQ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+NAhb1YNVHmPyQYqD9ku7969e9O8efPSNOmY3TXjMHN+tmhaKDdJ+JFo5C/cdnV1ddIjrJGdkoKUx8HsdP60atWqf3C8RARmzg2m4UXfSM9jeSW8rq6u8vr163+TV8JfyQx3e9LZuHHjoQsXLvSMdKckYt9KL53tu/sBHXeeeJMk0rdJ5P2kQXkvqXXOnDnlEr8pTyUPrVmz5qvOzs7/lQTCkU4y1LtGkjIfmIlMnJ+K/MojfzIrl8B3kpU1osxJSYtTAL8wKf4EYJQFk+JeQMlvE3UcLRmTkkUANm1ZOZmE24dqGU5gOfCyZkyGWQT+IykW8zmSz0IpiLNN8t5iTmdTkgGTrInI7JcfULaH10Qnh/4IMVjAxNk6jxwajuUb8lqOZRT3S/lx06RY1g8C4akfiEJAOZdFKzsq/nNjIssdufjbhQAEAUodOGDWp4m8S0oHEhb+YexGkD4EBUpdVMrfl/E/RhNJnsjF/ls0r980YRQDlAqBylIqylcCzf4lHecB5veigSfmYoBycaxN2SHgT8e7pWKZwCzqzZpigUr9DlRuoIxXn8pIZJgHtkwpa8togHIiw587LeNx9mc2ZwIK5DOlXJaMFqhWwoMp/Ax+1W+ToOXTHGKNrDMLLo38LmKsQKmbdSrWil+N82UJaS40YTuJv/RdtAdpzet+aJDzvMpQV71oo2gYX5RXG2HnYZXtouzNRzXE3R0KE6jWjZU2iaZ9u8pqpU3UfvwrYSgSBVDtGDurBlHn/zj0QMIh7qlDNOfmcBj9ihKo9o+l1euiWGxSE5eun3na6jxQk3joEgdQ7TR+FWutE43lhQpph3sQvISAVRa9ppRzipY4gZqdw8/WigIWDWt1gD8EIsqSLlT/KPUVlKSAujs2XTLYeRHiIlA2DVi1qkRtK8PSULaEDF+Ue7ashwkTlf8DQc/cITdx9+UAAAAASUVORK5CYII=";function Vm(i){ae(i,"svelte-1ogmlqq",".arrow.svelte-1ogmlqq{width:100%;height:100%;background-size:100%;transition:transform 400ms ease-in-out;cursor:pointer;pointer-events:auto}.arrow-wrapper.svelte-1ogmlqq{position:relative;width:100%;height:100%}.arrow.left.svelte-1ogmlqq{transform:rotate(0deg)}.arrow.right.svelte-1ogmlqq{transform:rotate(-180deg)}.arrow.top.svelte-1ogmlqq{transform:rotate(90deg)}.arrow.bottom.svelte-1ogmlqq{transform:rotate(-90deg)}")}function Ys(i){let t,e,n,o,s,r,a,l,c,u;return e=new Ve({props:{center:!0,blurRadius:9,spreadRadius:3}}),{c(){t=j("div"),ee(e.$$.fragment),n=_(),o=j("div"),b(o,"class",s="arrow "+i[0]+" svelte-1ogmlqq"),R(o,"background-image","url("+Um+")"),b(t,"class","arrow-wrapper svelte-1ogmlqq")},m(d,h){B(d,t,h),K(e,t,null),Q(t,n),Q(t,o),l=!0,c||(u=Pe(o,"click",i[5]),c=!0)},p(d,h){i=d,(!l||h&1&&s!==(s="arrow "+i[0]+" svelte-1ogmlqq"))&&b(o,"class",s)},i(d){l||(D(e.$$.fragment,d),d&&xe(()=>{a&&a.end(1),r=Ot(o,Tt,{duration:i[2],delay:i[3],easing:_t}),r.start()}),l=!0)},o(d){T(e.$$.fragment,d),r&&r.invalidate(),d&&(a=$t(o,Tt,{duration:i[2],delay:i[4],easing:_t})),l=!1},d(d){d&&M(t),$(e),d&&a&&a.end(),c=!1,u()}}}function Jm(i){let t,e,n=i[1]&&Ys(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&D(n,1)):(n=Ys(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function _m(i,t,e){let{direction:n="right"}=t,{visible:o=!0}=t,{duration:s=0}=t,{inDelay:r=0}=t,{outDelay:a=0}=t;function l(c){nc.call(this,i,c)}return i.$$set=c=>{"direction"in c&&e(0,n=c.direction),"visible"in c&&e(1,o=c.visible),"duration"in c&&e(2,s=c.duration),"inDelay"in c&&e(3,r=c.inDelay),"outDelay"in c&&e(4,a=c.outDelay)},[n,o,s,r,a,l]}class Zm extends oe{constructor(t){super(),ie(this,t,_m,Jm,ne,{direction:0,visible:1,duration:2,inDelay:3,outDelay:4},Vm)}}function qm(i,t,e=20,n=5){return new Promise((o,s)=>{let r=0;const a=setInterval(()=>{const l=i();t(l)?(clearInterval(a),o(l)):r>=n&&(clearInterval(a),s(l)),r++},e)})}function Km(i){ae(i,"svelte-1fuzm7v",".text.svelte-1fuzm7v{pointer-events:auto;box-sizing:border-box;display:inline-block;max-width:7.5rem;transition:transform 400ms ease-in-out;font-size:0.75rem;line-height:1.125rem;white-space:initial;cursor:pointer}.arrow.svelte-1fuzm7v{pointer-events:auto;display:inline-block;vertical-align:top;width:0.875rem;height:0.875rem;margin-left:0.125rem;margin-top:0.125rem}")}function Us(i,t,e){const n=i.slice();return n[11]=t[e].id,n[12]=t[e].content,n}function Vs(i,t){let e,n,o;return n=new Xa({props:{unfolded:t[0],content:t[12],inDelay:500,outDelay:t[5]}}),{key:i,first:null,c(){e=j("div"),ee(n.$$.fragment),b(e,"class","text svelte-1fuzm7v"),R(e,"transform",t[7]),this.first=e},m(s,r){B(s,e,r),K(n,e,null),t[10](e),o=!0},p(s,r){t=s;const a={};r&1&&(a.unfolded=t[0]),r&2&&(a.content=t[12]),r&32&&(a.outDelay=t[5]),n.$set(a),r&128&&R(e,"transform",t[7])},i(s){o||(D(n.$$.fragment,s),o=!0)},o(s){T(n.$$.fragment,s),o=!1},d(s){s&&M(e),$(n),t[10](null)}}}function Js(i){let t,e,n;return e=new Zm({props:{direction:i[6],visible:i[0],inDelay:600,duration:1e3}}),{c(){t=j("div"),ee(e.$$.fragment),b(t,"class","arrow svelte-1fuzm7v")},m(o,s){B(o,t,s),K(e,t,null),n=!0},p(o,s){const r={};s&64&&(r.direction=o[6]),s&1&&(r.visible=o[0]),e.$set(r)},i(o){n||(D(e.$$.fragment,o),n=!0)},o(o){T(e.$$.fragment,o),n=!1},d(o){o&&M(t),$(e)}}}function $m(i){let t=[],e=new Map,n,o,s,r=i[1];const a=c=>c[11];for(let c=0;c<r.length;c+=1){let u=Us(i,r,c),d=a(u);e.set(d,t[c]=Vs(d,u))}let l=i[3]<i[4]&&Js(i);return{c(){for(let c=0;c<t.length;c+=1)t[c].c();n=_(),l&&l.c(),o=fe()},m(c,u){for(let d=0;d<t.length;d+=1)t[d].m(c,u);B(c,n,u),l&&l.m(c,u),B(c,o,u),s=!0},p(c,[u]){u&167&&(r=c[1],le(),t=Ue(t,u,a,1,c,r,e,n.parentNode,at,Vs,n,Us),ce()),c[3]<c[4]?l?(l.p(c,u),u&24&&D(l,1)):(l=Js(c),l.c(),D(l,1),l.m(o.parentNode,o)):l&&(le(),T(l,1,1,()=>{l=null}),ce())},i(c){if(!s){for(let u=0;u<r.length;u+=1)D(t[u]);D(l),s=!0}},o(c){for(let u=0;u<t.length;u+=1)T(t[u]);T(l),s=!1},d(c){for(let u=0;u<t.length;u+=1)t[u].d(c);c&&M(n),l&&l.d(c),c&&M(o)}}}function ep(i,t,e){let n,o,s,{visible:r=!1}=t,{textUnfolded:a=!1}=t,{textItems:l}=t,c,u=0,d=0,h=0;function p(m){Me[m?"unshift":"push"](()=>{c=m,e(2,c)})}return i.$$set=m=>{"visible"in m&&e(0,r=m.visible),"textUnfolded"in m&&e(8,a=m.textUnfolded),"textItems"in m&&e(1,l=m.textItems)},i.$$.update=()=>{if(i.$$.dirty&5&&c&&r){const{lineHeight:m}=getComputedStyle(c);e(4,h=c.offsetHeight),qm(()=>c==null?void 0:c.offsetHeight,Boolean).then(()=>{e(4,h=c.offsetHeight)}),e(3,d=Number(m.replace("px","")))}i.$$.dirty&280&&e(9,u=a?d-h:0),i.$$.dirty&512&&e(7,n=`translateY(${u}px)`),i.$$.dirty&256&&e(6,o=a?"left":"right"),i.$$.dirty&256&&e(5,s=a?450:0)},[r,l,c,d,h,s,o,n,a,u,p]}class Ya extends oe{constructor(t){super(),ie(this,t,ep,$m,ne,{visible:0,textUnfolded:8,textItems:1},Km)}}function tp(i){ae(i,"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 _s(i){var h,p;let t,e,n,o,s,r,a,l,c,u,d;return t=new Ve({props:{visible:i[2],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}}),o=new Wa({props:{unfolded:i[2],duration:1e3,outDelay:i[5]+40*Math.min((p=(h=i[4][0])==null?void 0:h.content.length)!=null?p:10,15)}}),a=new Ya({props:{visible:i[2],textUnfolded:i[1],textItems:i[4]}}),{c(){ee(t.$$.fragment),e=_(),n=j("div"),ee(o.$$.fragment),s=_(),r=j("div"),ee(a.$$.fragment),b(n,"class","line svelte-18yy5x8"),R(n,"width",i[3]+"px"),b(r,"class","content svelte-18yy5x8"),xe(()=>i[8].call(r))},m(m,g){K(t,m,g),B(m,e,g),B(m,n,g),K(o,n,null),B(m,s,g),B(m,r,g),K(a,r,null),l=bt(r,i[8].bind(r)),c=!0,u||(d=Pe(r,"click",i[6]),u=!0)},p(m,g){var y,x;const A={};g&4&&(A.visible=m[2]),g&8&&(A.left=m[3]/2+"px"),t.$set(A);const v={};g&4&&(v.unfolded=m[2]),g&48&&(v.outDelay=m[5]+40*Math.min((x=(y=m[4][0])==null?void 0:y.content.length)!=null?x:10,15)),o.$set(v),g&8&&R(n,"width",m[3]+"px");const w={};g&4&&(w.visible=m[2]),g&2&&(w.textUnfolded=m[1]),g&16&&(w.textItems=m[4]),a.$set(w)},i(m){c||(D(t.$$.fragment,m),D(o.$$.fragment,m),D(a.$$.fragment,m),c=!0)},o(m){T(t.$$.fragment,m),T(o.$$.fragment,m),T(a.$$.fragment,m),c=!1},d(m){$(t,m),m&&M(e),m&&M(n),$(o),m&&M(s),m&&M(r),$(a),l(),u=!1,d()}}}function np(i){let t,e,n=i[0].state&&_s(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&D(n,1)):(n=_s(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function ip(i,t,e){let n,o,s,{tag:r}=t,a,l=!1,c=[];function u(){e(1,l=!l)}function d(){a=this.clientWidth,e(3,a)}return i.$$set=h=>{"tag"in h&&e(0,r=h.tag)},i.$$.update=()=>{var h;i.$$.dirty&1&&e(2,n=!!((h=r.state)!=null&&h.unfolded)),i.$$.dirty&1&&e(7,o=r.data.text),i.$$.dirty&128&&e(4,c=[{id:He(),content:o}]),i.$$.dirty&4&&(n||setTimeout(()=>{e(1,l=!1)},20)),i.$$.dirty&2&&e(5,s=l?450:0)},[r,l,n,a,c,s,u,o,d]}class op extends oe{constructor(t){super(),ie(this,t,ip,np,ne,{tag:0},tp)}}function sp(i){ae(i,"svelte-e72ouh",".line.svelte-e72ouh{width:100%;height:100%;overflow:visible}")}function Zs(i){let t,e,n,o;return{c(){t=Ae("path"),b(t,"fill","none"),b(t,"stroke","url(#"+i[4]+")"),b(t,"stroke-width","1"),b(t,"d","M0 21 L14 0.5 L105 0.5")},m(s,r){B(s,t,r),o=!0},p(s,r){i=s},i(s){o||(s&&xe(()=>{n&&n.end(1),e=Ot(t,qn,{duration:i[1],delay:i[0],easing:da}),e.start()}),o=!0)},o(s){e&&e.invalidate(),s&&(n=$t(t,qn,{duration:i[1],delay:i[2],easing:_t})),o=!1},d(s){s&&M(t),s&&n&&n.end()}}}function rp(i){let t,e,n,o,s,r=i[3]&&Zs(i);return{c(){t=Ae("svg"),e=Ae("defs"),n=Ae("linearGradient"),o=Ae("stop"),s=Ae("stop"),r&&r.c(),b(o,"offset","25%"),b(o,"stop-color","white"),b(o,"stop-opacity","1"),b(s,"offset","100%"),b(s,"stop-color","white"),b(s,"stop-opacity","0.5"),b(n,"id",i[4]),b(n,"gradientUnits","userSpaceOnUse"),b(t,"class","line svelte-e72ouh"),b(t,"viewBox","0 0 105 21")},m(a,l){B(a,t,l),Q(t,e),Q(e,n),Q(n,o),Q(n,s),r&&r.m(t,null)},p(a,[l]){a[3]?r?(r.p(a,l),l&8&&D(r,1)):(r=Zs(a),r.c(),D(r,1),r.m(t,null)):r&&(le(),T(r,1,1,()=>{r=null}),ce())},i(a){D(r)},o(a){T(r)},d(a){a&&M(t),r&&r.d()}}}function ap(i,t,e){let{inDelay:n=0}=t,{duration:o=0}=t,{outDelay:s=0}=t,{unfolded:r}=t;const a=He();return i.$$set=l=>{"inDelay"in l&&e(0,n=l.inDelay),"duration"in l&&e(1,o=l.duration),"outDelay"in l&&e(2,s=l.outDelay),"unfolded"in l&&e(3,r=l.unfolded)},[n,o,s,r,a]}class lp extends oe{constructor(t){super(),ie(this,t,ap,rp,ne,{inDelay:0,duration:1,outDelay:2,unfolded:3},sp)}}function jt(i){return typeof i=="object"&&i!==null&&i.constructor&&Object.prototype.toString.call(i).slice(8,-1)==="Object"}function ft(i,t){const e=["__proto__","constructor","prototype"];Object.keys(t).filter(n=>e.indexOf(n)<0).forEach(n=>{typeof i[n]=="undefined"?i[n]=t[n]:jt(t[n])&&jt(i[n])&&Object.keys(t[n]).length>0?t[n].__swiper__?i[n]=t[n]:ft(i[n],t[n]):i[n]=t[n]})}function Gi(i={}){return i.navigation&&typeof i.navigation.nextEl=="undefined"&&typeof i.navigation.prevEl=="undefined"}function Ni(i={}){return i.pagination&&typeof i.pagination.el=="undefined"}function Wi(i={}){return i.scrollbar&&typeof i.scrollbar.el=="undefined"}function ti(i=""){const t=i.split(" ").map(n=>n.trim()).filter(n=>!!n),e=[];return t.forEach(n=>{e.indexOf(n)<0&&e.push(n)}),e.join(" ")}const Ua=["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 cp(i={},t=!0){const e={on:{}},n={},o={};ft(e,zi.default.defaults),ft(e,zi.default.extendedDefaults),e._emitClasses=!0,e.init=!1;const s={},r=Ua.map(l=>l.replace(/_/,"")),a=Object.assign({},i);return Object.keys(a).forEach(l=>{typeof i[l]!="undefined"&&(r.indexOf(l)>=0?jt(i[l])?(e[l]={},o[l]={},ft(e[l],i[l]),ft(o[l],i[l])):(e[l]=i[l],o[l]=i[l]):l.search(/on[A-Z]/)===0&&typeof i[l]=="function"?t?n[`${l[2].toLowerCase()}${l.substr(3)}`]=i[l]:e.on[`${l[2].toLowerCase()}${l.substr(3)}`]=i[l]:s[l]=i[l])}),["navigation","pagination","scrollbar"].forEach(l=>{e[l]===!0&&(e[l]={}),e[l]===!1&&delete e[l]}),{params:e,passedParams:o,rest:s,events:n}}function up({el:i,nextEl:t,prevEl:e,paginationEl:n,scrollbarEl:o,swiper:s},r){Gi(r)&&t&&e&&(s.params.navigation.nextEl=t,s.originalParams.navigation.nextEl=t,s.params.navigation.prevEl=e,s.originalParams.navigation.prevEl=e),Ni(r)&&n&&(s.params.pagination.el=n,s.originalParams.pagination.el=n),Wi(r)&&o&&(s.params.scrollbar.el=o,s.originalParams.scrollbar.el=o),s.init(i)}function dp(i,t,e,n,o){const s=[];if(!t)return s;const r=l=>{s.indexOf(l)<0&&s.push(l)};if(e&&n){const l=n.map(o),c=e.map(o);l.join("")!==c.join("")&&r("children"),n.length!==e.length&&r("children")}return Ua.filter(l=>l[0]==="_").map(l=>l.replace(/_/,"")).forEach(l=>{if(l in i&&l in t)if(jt(i[l])&&jt(t[l])){const c=Object.keys(i[l]),u=Object.keys(t[l]);c.length!==u.length?r(l):(c.forEach(d=>{i[l][d]!==t[l][d]&&r(l)}),u.forEach(d=>{i[l][d]!==t[l][d]&&r(l)}))}else i[l]!==t[l]&&r(l)}),s}function hp({swiper:i,slides:t,passedParams:e,changedParams:n,nextEl:o,prevEl:s,scrollbarEl:r,paginationEl:a}){const l=n.filter(L=>L!=="children"&&L!=="direction"),{params:c,pagination:u,navigation:d,scrollbar:h,virtual:p,thumbs:m}=i;let g,A,v,w,y;n.includes("thumbs")&&e.thumbs&&e.thumbs.swiper&&c.thumbs&&!c.thumbs.swiper&&(g=!0),n.includes("controller")&&e.controller&&e.controller.control&&c.controller&&!c.controller.control&&(A=!0),n.includes("pagination")&&e.pagination&&(e.pagination.el||a)&&(c.pagination||c.pagination===!1)&&u&&!u.el&&(v=!0),n.includes("scrollbar")&&e.scrollbar&&(e.scrollbar.el||r)&&(c.scrollbar||c.scrollbar===!1)&&h&&!h.el&&(w=!0),n.includes("navigation")&&e.navigation&&(e.navigation.prevEl||s)&&(e.navigation.nextEl||o)&&(c.navigation||c.navigation===!1)&&d&&!d.prevEl&&!d.nextEl&&(y=!0);const x=L=>{!i[L]||(i[L].destroy(),L==="navigation"?(c[L].prevEl=void 0,c[L].nextEl=void 0,i[L].prevEl=void 0,i[L].nextEl=void 0):(c[L].el=void 0,i[L].el=void 0))};l.forEach(L=>{if(jt(c[L])&&jt(e[L]))ft(c[L],e[L]);else{const C=e[L];(C===!0||C===!1)&&(L==="navigation"||L==="pagination"||L==="scrollbar")?C===!1&&x(L):c[L]=e[L]}}),l.includes("controller")&&!A&&i.controller&&i.controller.control&&c.controller&&c.controller.control&&(i.controller.control=c.controller.control),n.includes("children")&&t&&p&&c.virtual.enabled?(p.slides=t,p.update(!0)):n.includes("children")&&i.lazy&&i.params.lazy.enabled&&i.lazy.load(),g&&m.init()&&m.update(!0),A&&(i.controller.control=c.controller.control),v&&(a&&(c.pagination.el=a),u.init(),u.render(),u.update()),w&&(r&&(c.scrollbar.el=r),h.init(),h.updateSize(),h.setTranslate()),y&&(o&&(c.navigation.nextEl=o),s&&(c.navigation.prevEl=s),d.init(),d.update()),n.includes("allowSlideNext")&&(i.allowSlideNext=e.allowSlideNext),n.includes("allowSlidePrev")&&(i.allowSlidePrev=e.allowSlidePrev),n.includes("direction")&&i.changeDirection(e.direction,!1),i.update()}const fp=i=>({virtualData:i&512}),qs=i=>({virtualData:i[9]}),mp=i=>({virtualData:i&512}),Ks=i=>({virtualData:i[9]}),pp=i=>({virtualData:i&512}),$s=i=>({virtualData:i[9]}),gp=i=>({virtualData:i&512}),er=i=>({virtualData:i[9]}),Ap=i=>({virtualData:i&512}),tr=i=>({virtualData:i[9]});function nr(i){let t,e,n;return{c(){t=j("div"),e=_(),n=j("div"),b(t,"class","swiper-button-prev"),b(n,"class","swiper-button-next")},m(o,s){B(o,t,s),i[13](t),B(o,e,s),B(o,n,s),i[14](n)},p:te,d(o){o&&M(t),i[13](null),o&&M(e),o&&M(n),i[14](null)}}}function ir(i){let t;return{c(){t=j("div"),b(t,"class","swiper-scrollbar")},m(e,n){B(e,t,n),i[15](t)},p:te,d(e){e&&M(t),i[15](null)}}}function or(i){let t;return{c(){t=j("div"),b(t,"class","swiper-pagination")},m(e,n){B(e,t,n),i[16](t)},p:te,d(e){e&&M(t),i[16](null)}}}function vp(i){let t,e,n,o,s,r,a=Gi(i[2]),l,c=Wi(i[2]),u,d=Ni(i[2]),h,p,m;const g=i[12]["container-start"],A=It(g,i,i[11],tr),v=i[12]["wrapper-start"],w=It(v,i,i[11],er),y=i[12].default,x=It(y,i,i[11],$s),L=i[12]["wrapper-end"],C=It(L,i,i[11],Ks);let S=a&&nr(i),k=c&&ir(i),G=d&&or(i);const O=i[12]["container-end"],W=It(O,i,i[11],qs);let U=[{class:p=ti(`${i[1]}${i[0]?` ${i[0]}`:""}`)},i[3]],P={};for(let I=0;I<U.length;I+=1)P=we(P,U[I]);return{c(){t=j("div"),A&&A.c(),e=_(),n=j("div"),w&&w.c(),o=_(),x&&x.c(),s=_(),C&&C.c(),r=_(),S&&S.c(),l=_(),k&&k.c(),u=_(),G&&G.c(),h=_(),W&&W.c(),b(n,"class","swiper-wrapper"),Xn(t,P)},m(I,z){B(I,t,z),A&&A.m(t,null),Q(t,e),Q(t,n),w&&w.m(n,null),Q(n,o),x&&x.m(n,null),Q(n,s),C&&C.m(n,null),Q(t,r),S&&S.m(t,null),Q(t,l),k&&k.m(t,null),Q(t,u),G&&G.m(t,null),Q(t,h),W&&W.m(t,null),i[17](t),m=!0},p(I,[z]){A&&A.p&&(!m||z&2560)&&kt(A,g,I,I[11],m?xt(g,I[11],z,Ap):Dt(I[11]),tr),w&&w.p&&(!m||z&2560)&&kt(w,v,I,I[11],m?xt(v,I[11],z,gp):Dt(I[11]),er),x&&x.p&&(!m||z&2560)&&kt(x,y,I,I[11],m?xt(y,I[11],z,pp):Dt(I[11]),$s),C&&C.p&&(!m||z&2560)&&kt(C,L,I,I[11],m?xt(L,I[11],z,mp):Dt(I[11]),Ks),z&4&&(a=Gi(I[2])),a?S?S.p(I,z):(S=nr(I),S.c(),S.m(t,l)):S&&(S.d(1),S=null),z&4&&(c=Wi(I[2])),c?k?k.p(I,z):(k=ir(I),k.c(),k.m(t,u)):k&&(k.d(1),k=null),z&4&&(d=Ni(I[2])),d?G?G.p(I,z):(G=or(I),G.c(),G.m(t,h)):G&&(G.d(1),G=null),W&&W.p&&(!m||z&2560)&&kt(W,O,I,I[11],m?xt(O,I[11],z,fp):Dt(I[11]),qs),Xn(t,P=Be(U,[(!m||z&3&&p!==(p=ti(`${I[1]}${I[0]?` ${I[0]}`:""}`)))&&{class:p},z&8&&I[3]]))},i(I){m||(D(A,I),D(w,I),D(x,I),D(C,I),D(W,I),m=!0)},o(I){T(A,I),T(w,I),T(x,I),T(C,I),T(W,I),m=!1},d(I){I&&M(t),A&&A.d(I),w&&w.d(I),x&&x.d(I),C&&C.d(I),S&&S.d(),k&&k.d(),G&&G.d(),W&&W.d(I),i[17](null)}}}function bp(i,t,e){const n=["class","swiper"];let o=Wn(t,n),{$$slots:s={},$$scope:r}=t;const a=tc();let{class:l=void 0}=t,c="swiper",u=!1,d=null,h=null,p,m,g,A,v=null,w=null,y=null,x=null,L=null,C={slides:[]};function S(){return d}const k=H=>{e(9,C=H),ic().then(()=>{d.$wrapperEl.children(".swiper-slide").each(X=>{X.onSwiper&&X.onSwiper(d)}),d.updateSlides(),d.updateProgress(),d.updateSlidesClasses(),d.lazy&&d.params.lazy.enabled&&d.lazy.load()})},G=()=>{p=cp(o),e(2,m=p.params),g=p.passedParams,e(3,A=p.rest)};G(),h=g;const O=()=>{u=!0};if(m.onAny=(H,...X)=>{a(H,X)},Object.assign(m.on,{_beforeBreakpoint:O,_containerClasses(H,X){e(1,c=X)}}),d=new zi.default(m),Bi("swiper",d),d.virtual&&d.params.virtual.enabled){const H={cache:!1,renderExternal:X=>{k(X),m.virtual&&m.virtual.renderExternal&&m.virtual.renderExternal(X)},renderExternalUpdate:!1};ft(d.params.virtual,H),ft(d.originalParams.virtual,H)}Ye(()=>{!v||(up({el:v,nextEl:y,prevEl:w,paginationEl:L,scrollbarEl:x,swiper:d},m),a("swiper",[d]),!m.virtual&&d.slides.each(H=>{H.onSwiper&&H.onSwiper(d)}))}),qi(()=>{if(!d)return;G();const H=dp(g,h);(H.length||u)&&d&&!d.destroyed&&hp({swiper:d,passedParams:g,changedParams:H,nextEl:y,prevEl:w,scrollbarEl:x,paginationEl:L}),u=!1,h=g}),yt(()=>{typeof window!="undefined"&&d&&!d.destroyed&&d.destroy(!0,!1)});function W(H){Me[H?"unshift":"push"](()=>{w=H,e(5,w)})}function U(H){Me[H?"unshift":"push"](()=>{y=H,e(6,y)})}function P(H){Me[H?"unshift":"push"](()=>{x=H,e(7,x)})}function I(H){Me[H?"unshift":"push"](()=>{L=H,e(8,L)})}function z(H){Me[H?"unshift":"push"](()=>{v=H,e(4,v)})}return i.$$set=H=>{t=we(we({},t),qr(H)),e(27,o=Wn(t,n)),"class"in H&&e(0,l=H.class),"$$scope"in H&&e(11,r=H.$$scope)},[l,c,m,A,v,w,y,x,L,C,S,r,s,W,U,P,I,z]}class yp extends oe{constructor(t){super(),ie(this,t,bp,vp,ne,{class:0,swiper:10})}get swiper(){return this.$$.ctx[10]}}const wp=i=>({data:i&32}),sr=i=>({data:i[5]}),Cp=i=>({data:i&32}),rr=i=>({data:i[5]});function Ep(i){let t;const e=i[8].default,n=It(e,i,i[7],sr);return{c(){n&&n.c()},m(o,s){n&&n.m(o,s),t=!0},p(o,s){n&&n.p&&(!t||s&160)&&kt(n,e,o,o[7],t?xt(e,o[7],s,wp):Dt(o[7]),sr)},i(o){t||(D(n,o),t=!0)},o(o){T(n,o),t=!1},d(o){n&&n.d(o)}}}function Pp(i){let t,e,n;const o=i[8].default,s=It(o,i,i[7],rr);return{c(){t=j("div"),s&&s.c(),b(t,"class","swiper-zoom-container"),b(t,"data-swiper-zoom",e=typeof i[0]=="number"?i[0]:void 0)},m(r,a){B(r,t,a),s&&s.m(t,null),n=!0},p(r,a){s&&s.p&&(!n||a&160)&&kt(s,o,r,r[7],n?xt(o,r[7],a,Cp):Dt(r[7]),rr),(!n||a&1&&e!==(e=typeof r[0]=="number"?r[0]:void 0))&&b(t,"data-swiper-zoom",e)},i(r){n||(D(s,r),n=!0)},o(r){T(s,r),n=!1},d(r){r&&M(t),s&&s.d(r)}}}function Ip(i){let t,e,n,o,s;const r=[Pp,Ep],a=[];function l(d,h){return d[0]?0:1}e=l(i),n=a[e]=r[e](i);let c=[{class:o=ti(`${i[3]}${i[2]?` ${i[2]}`:""}`)},{"data-swiper-slide-index":i[1]},i[6]],u={};for(let d=0;d<c.length;d+=1)u=we(u,c[d]);return{c(){t=j("div"),n.c(),Xn(t,u)},m(d,h){B(d,t,h),a[e].m(t,null),i[9](t),s=!0},p(d,[h]){let p=e;e=l(d),e===p?a[e].p(d,h):(le(),T(a[p],1,1,()=>{a[p]=null}),ce(),n=a[e],n?n.p(d,h):(n=a[e]=r[e](d),n.c()),D(n,1),n.m(t,null)),Xn(t,u=Be(c,[(!s||h&12&&o!==(o=ti(`${d[3]}${d[2]?` ${d[2]}`:""}`)))&&{class:o},(!s||h&2)&&{"data-swiper-slide-index":d[1]},h&64&&d[6]]))},i(d){s||(D(n),s=!0)},o(d){T(n),s=!1},d(d){d&&M(t),a[e].d(),i[9](null)}}}function xp(i,t,e){let n;const o=["zoom","virtualIndex","class"];let s=Wn(t,o),{$$slots:r={},$$scope:a}=t,{zoom:l=void 0}=t,{virtualIndex:c=void 0}=t,{class:u=void 0}=t,d=null,h="swiper-slide",p=mn("swiper"),m=!1;const g=(y,x,L)=>{x===d&&e(3,h=L)},A=()=>{!p||m||(p.on("_slideClass",g),m=!0)},v=()=>{!p||(p.off("_slideClass",g),m=!1)};Ye(()=>{typeof c!="undefined"&&(e(4,d.onSwiper=y=>{p=y,A()},d),A())}),qi(()=>{if(!(!d||!p)){if(p.destroyed){h!=="swiper-slide"&&e(3,h="swiper-slide");return}A()}}),Zi(()=>{A()}),yt(()=>{!p||v()});function w(y){Me[y?"unshift":"push"](()=>{d=y,e(4,d)})}return i.$$set=y=>{t=we(we({},t),qr(y)),e(6,s=Wn(t,o)),"zoom"in y&&e(0,l=y.zoom),"virtualIndex"in y&&e(1,c=y.virtualIndex),"class"in y&&e(2,u=y.class),"$$scope"in y&&e(7,a=y.$$scope)},i.$$.update=()=>{i.$$.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})},[l,c,u,h,d,n,s,a,r,w]}class kp extends oe{constructor(t){super(),ie(this,t,xp,Ip,ne,{zoom:0,virtualIndex:1,class:2})}}function Dp(i){ae(i,"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 ar(i){let t;function e(s,r){if(s[0].type==="Image")return Sp;if(s[0].type==="Video")return Lp}let n=e(i),o=n&&n(i);return{c(){t=j("div"),o&&o.c(),b(t,"class","media-item svelte-cwtvzu")},m(s,r){B(s,t,r),o&&o.m(t,null)},p(s,r){n===(n=e(s))&&o?o.p(s,r):(o&&o.d(1),o=n&&n(s),o&&(o.c(),o.m(t,null)))},d(s){s&&M(t),o&&o.d()}}}function Lp(i){let t,e,n,o,s,r,a,l,c,u,d;return{c(){var h;t=j("video"),r=_(),a=j("div"),l=j("div"),c=j("div"),b(t,"class","media-content svelte-cwtvzu"),b(t,"style",e=`object-fit: ${i[3]};`),et(t.src,n=i[0].url+"#t=0.1")||b(t,"src",n),b(t,"poster",o=(h=i[0].videoCoverUrl)!=null?h:void 0),b(t,"preload",s=i[0].videoCoverUrl?void 0:"auto"),t.playsInline=!0,b(t,"paused",""),t.loop=!1,b(t,"crossorigin",""),t.controls=!1,q(t,"showPlayButton",i[5]),b(c,"class","video-icon-img svelte-cwtvzu"),R(c,"background-image","url("+(i[1]==="large"?Ws:Xs)+")"),q(c,"canPlay",i[2]),b(l,"class","video-icon svelte-cwtvzu"),q(l,"large",i[1]==="large"),q(l,"small",i[1]==="small"),b(a,"class","video-play-button-container svelte-cwtvzu"),q(a,"showPlayButton",i[5])},m(h,p){B(h,t,p),i[7](t),B(h,r,p),B(h,a,p),Q(a,l),Q(l,c),u||(d=[Pe(t,"click",i[6]),Pe(c,"click",i[8])],u=!0)},p(h,p){var m;p&8&&e!==(e=`object-fit: ${h[3]};`)&&b(t,"style",e),p&1&&!et(t.src,n=h[0].url+"#t=0.1")&&b(t,"src",n),p&1&&o!==(o=(m=h[0].videoCoverUrl)!=null?m:void 0)&&b(t,"poster",o),p&1&&s!==(s=h[0].videoCoverUrl?void 0:"auto")&&b(t,"preload",s),p&32&&q(t,"showPlayButton",h[5]),p&2&&R(c,"background-image","url("+(h[1]==="large"?Ws:Xs)+")"),p&4&&q(c,"canPlay",h[2]),p&2&&q(l,"large",h[1]==="large"),p&2&&q(l,"small",h[1]==="small"),p&32&&q(a,"showPlayButton",h[5])},d(h){h&&M(t),i[7](null),h&&M(r),h&&M(a),u=!1,rt(d)}}}function Sp(i){let t,e,n,o;return{c(){t=j("img"),b(t,"class","media-content svelte-cwtvzu"),b(t,"style",e=`object-fit: ${i[3]};`),et(t.src,n=i[0].url)||b(t,"src",n),b(t,"alt",o=i[0].name)},m(s,r){B(s,t,r)},p(s,r){r&8&&e!==(e=`object-fit: ${s[3]};`)&&b(t,"style",e),r&1&&!et(t.src,n=s[0].url)&&b(t,"src",n),r&1&&o!==(o=s[0].name)&&b(t,"alt",o)},d(s){s&&M(t)}}}function zp(i){let t,e=i[0]&&ar(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),B(n,t,o)},p(n,[o]){n[0]?e?e.p(n,o):(e=ar(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:te,o:te,d(n){e&&e.d(n),n&&M(t)}}}function Mp(i,t,e){let{media:n}=t,{playButtonIfNeed:o="small"}=t,{canPlay:s=!0}=t,{objectFit:r="cover"}=t,a,l=!1;const c=()=>a==null?void 0:a.pause();function u(h){Me[h?"unshift":"push"](()=>{a=h,e(4,a)})}const d=()=>{!s||a&&a.play()};return i.$$set=h=>{"media"in h&&e(0,n=h.media),"playButtonIfNeed"in h&&e(1,o=h.playButtonIfNeed),"canPlay"in h&&e(2,s=h.canPlay),"objectFit"in h&&e(3,r=h.objectFit)},i.$$.update=()=>{i.$$.dirty&16&&a&&(e(5,l=a.paused),a.addEventListener("play",()=>{e(5,l=!1)}),a.addEventListener("pause",()=>{e(5,l=!0)}))},[n,o,s,r,a,l,c,u,d]}class Va extends oe{constructor(t){super(),ie(this,t,Mp,zp,ne,{media:0,playButtonIfNeed:1,canPlay:2,objectFit:3},Dp)}}function Tp(i){ae(i,"svelte-ai0lv9",".media.svelte-ai0lv9{width:100%;height:100%;position:relative;overflow:hidden;border-radius:0.125rem}")}function lr(i,t,e){const n=i.slice();return n[23]=t[e],n}function cr(i){let t,e,n,o,s,r;const a=[jp,Bp],l=[];function c(u,d){return u[13]?0:1}return e=c(i),n=l[e]=a[e](i),{c(){t=j("div"),n.c(),b(t,"class","media svelte-ai0lv9"),q(t,"unfolded",i[4])},m(u,d){B(u,t,d),l[e].m(t,null),r=!0},p(u,d){i=u;let h=e;e=c(i),e===h?l[e].p(i,d):(le(),T(l[h],1,1,()=>{l[h]=null}),ce(),n=l[e],n?n.p(i,d):(n=l[e]=a[e](i),n.c()),D(n,1),n.m(t,null)),(!r||d&16)&&q(t,"unfolded",i[4])},i(u){r||(D(n),u&&xe(()=>{s&&s.end(1),o=Ot(t,Do,i[5]?{y:4,duration:i[3],delay:i[1],easing:Jt}:void 0),o.start()}),r=!0)},o(u){T(n),o&&o.invalidate(),u&&(s=$t(t,Do,i[5]?{y:4,duration:i[3],delay:i[2],easing:Jt}:void 0)),r=!1},d(u){u&&M(t),l[e].d(),u&&s&&s.end()}}}function Bp(i){let t,e;return t=new Va({props:{media:i[0][0],objectFit:i[8],playButtonIfNeed:i[6],canPlay:i[7]}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.media=n[0][0]),o&256&&(s.objectFit=n[8]),o&64&&(s.playButtonIfNeed=n[6]),o&128&&(s.canPlay=n[7]),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function jp(i){let t,e;return t=new yp({props:{style:"height: 100%",modules:[Fr.Autoplay],spaceBetween:30,autoplay:i[14]?Se({delay:4e3,stopOnLastSlide:!1,disableOnInteraction:!1}):!1,loop:!0,$$slots:{default:[Rp]},$$scope:{ctx:i}}}),t.$on("init",i[19]),t.$on("slideChange",i[20]),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&16384&&(s.autoplay=n[14]?Se({delay:4e3,stopOnLastSlide:!1,disableOnInteraction:!1}):!1),o&67111360&&(s.$$scope={dirty:o,ctx:n}),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Qp(i){let t,e,n;return t=new Va({props:{media:i[23],objectFit:i[8],playButtonIfNeed:i[6],canPlay:i[7]}}),{c(){ee(t.$$.fragment),e=_()},m(o,s){K(t,o,s),B(o,e,s),n=!0},p(o,s){const r={};s&2048&&(r.media=o[23]),s&256&&(r.objectFit=o[8]),s&64&&(r.playButtonIfNeed=o[6]),s&128&&(r.canPlay=o[7]),t.$set(r)},i(o){n||(D(t.$$.fragment,o),n=!0)},o(o){T(t.$$.fragment,o),n=!1},d(o){$(t,o),o&&M(e)}}}function ur(i){let t,e;return t=new kp({props:{$$slots:{default:[Qp]},$$scope:{ctx:i}}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&67111360&&(s.$$scope={dirty:o,ctx:n}),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Rp(i){let t,e,n=i[11],o=[];for(let r=0;r<n.length;r+=1)o[r]=ur(lr(i,n,r));const s=r=>T(o[r],1,1,()=>{o[r]=null});return{c(){for(let r=0;r<o.length;r+=1)o[r].c();t=fe()},m(r,a){for(let l=0;l<o.length;l+=1)o[l].m(r,a);B(r,t,a),e=!0},p(r,a){if(a&2496){n=r[11];let l;for(l=0;l<n.length;l+=1){const c=lr(r,n,l);o[l]?(o[l].p(c,a),D(o[l],1)):(o[l]=ur(c),o[l].c(),D(o[l],1),o[l].m(t.parentNode,t))}for(le(),l=n.length;l<o.length;l+=1)s(l);ce()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)D(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)T(o[a]);e=!1},d(r){tt(o,r),r&&M(t)}}}function Op(i){let t,e,n=i[4]&&cr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[4]?n?(n.p(o,s),s&16&&D(n,1)):(n=cr(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Hp(i,t,e){let n,o,s,{tag:r}=t,{mediaData:a}=t,{inDelay:l=0}=t,{outDelay:c=0}=t,{duration:u=0}=t,{unfolded:d=!0}=t,{animation:h=!0}=t,{playButtonIfNeed:p="small"}=t,{canPlay:m=!0}=t,{objectFit:g="cover"}=t,{enableCarousel:A=!0}=t,{autoplayConfig:v={autoplay:!0,autoplayVideo:!1}}=t;const w=mn("mediaStore"),y=mn("hooks");let x;function L(O){!n||!x||(w.set({currentMediaUrl:this.src}),y.emit("playStateChange",{event:O,state:"playing",tag:r,mediaInstance:this}),x.autoplay.stop())}function C(O){!n||!x||(y.emit("playStateChange",{event:O,state:"paused",tag:r,mediaInstance:this}),x.autoplay.running||x.autoplay.start())}let S=null;const k=O=>{e(10,x=O.detail[0])},G=O=>J(this,null,function*(){var H,X,Z;if(!s||!v.autoplayVideo)return;const W=O.detail[0];if(!W)return;const U=W.realIndex;if(U===S)return;e(12,S=U);const P=o[U];if(!P||P.type!=="Video")return;W.autoplay.stop(),W.slides.map(Y=>Y.querySelector("video")).filter(Bt).forEach(Y=>Y.pause());const z=(H=W.slides[W.activeIndex])==null?void 0:H.querySelector("video");if(z&&(z.removeEventListener("play",L),z.removeEventListener("pause",C),z.addEventListener("play",L),z.addEventListener("pause",C)),z){z.addEventListener("click",()=>z.pause());const Y=(Z=(X=z.parentElement)==null?void 0:X.getElementsByClassName("video-play-button-container"))==null?void 0:Z[0];z.addEventListener("play",()=>Y==null?void 0:Y.classList.remove("showPlayButton")),z.addEventListener("pause",()=>Y==null?void 0:Y.classList.add("showPlayButton")),Y&&(z.paused?Y.classList.add("showPlayButton"):Y.classList.remove("showPlayButton"),Y.addEventListener("click",()=>z.play()))}});return i.$$set=O=>{"tag"in O&&e(17,r=O.tag),"mediaData"in O&&e(0,a=O.mediaData),"inDelay"in O&&e(1,l=O.inDelay),"outDelay"in O&&e(2,c=O.outDelay),"duration"in O&&e(3,u=O.duration),"unfolded"in O&&e(4,d=O.unfolded),"animation"in O&&e(5,h=O.animation),"playButtonIfNeed"in O&&e(6,p=O.playButtonIfNeed),"canPlay"in O&&e(7,m=O.canPlay),"objectFit"in O&&e(8,g=O.objectFit),"enableCarousel"in O&&e(18,A=O.enableCarousel),"autoplayConfig"in O&&e(9,v=O.autoplayConfig)},i.$$.update=()=>{i.$$.dirty&262145&&e(13,n=A&&(a==null?void 0:a.length)>1),i.$$.dirty&1&&e(11,o=a),i.$$.dirty&2560&&e(14,s=o.length>1&&v.autoplay),i.$$.dirty&1024&&x&&x.slides.forEach(O=>{const W=O.querySelector("video");W&&w.subscribe(({currentMediaUrl:U})=>{U!==W.src&&W.pause()})})},[a,l,c,u,d,h,p,m,g,v,x,o,S,n,s,L,C,r,A,k,G]}class Ja extends oe{constructor(t){super(),ie(this,t,Hp,Op,ne,{tag:17,mediaData:0,inDelay:1,outDelay:2,duration:3,unfolded:4,animation:5,playButtonIfNeed:6,canPlay:7,objectFit:8,enableCarousel:18,autoplayConfig:9},Tp)}}function Fp(i){ae(i,"svelte-1f7m1lj",".line.svelte-1f7m1lj{position:absolute;width:6.5625rem;height:1.3125rem;transform:translateY(-100%)}.text.svelte-1f7m1lj{position:absolute;width:6.25rem;left:1rem;bottom:0.0625rem;font-weight:600}.media-wrapper.svelte-1f7m1lj{position:absolute;left:0.875rem;top:-5.3125rem;width:5.625rem;height:3.75rem;font-weight:600}")}function dr(i,t,e){const n=i.slice();return n[5]=t[e].id,n[1]=t[e].content,n}function hr(i){let t,e,n,o,s,r=[],a=new Map,l,c,u;t=new Ve({props:{visible:i[4],left:61,bottom:57,width:2,blurRadius:150,spreadRadius:75}}),o=new lp({props:{unfolded:i[4],duration:1e3,outDelay:400}});let d=i[2];const h=m=>m[5];for(let m=0;m<d.length;m+=1){let g=dr(i,d,m),A=h(g);a.set(A,r[m]=fr(A,g))}let p=i[3]&&mr(i);return{c(){ee(t.$$.fragment),e=_(),n=j("div"),ee(o.$$.fragment),s=_();for(let m=0;m<r.length;m+=1)r[m].c();l=_(),p&&p.c(),c=fe(),b(n,"class","line svelte-1f7m1lj")},m(m,g){K(t,m,g),B(m,e,g),B(m,n,g),K(o,n,null),B(m,s,g);for(let A=0;A<r.length;A+=1)r[A].m(m,g);B(m,l,g),p&&p.m(m,g),B(m,c,g),u=!0},p(m,g){const A={};g&16&&(A.visible=m[4]),t.$set(A);const v={};g&16&&(v.unfolded=m[4]),o.$set(v),g&20&&(d=m[2],le(),r=Ue(r,g,h,1,m,d,a,l.parentNode,at,fr,l,dr),ce()),m[3]?p?(p.p(m,g),g&8&&D(p,1)):(p=mr(m),p.c(),D(p,1),p.m(c.parentNode,c)):p&&(le(),T(p,1,1,()=>{p=null}),ce())},i(m){if(!u){D(t.$$.fragment,m),D(o.$$.fragment,m);for(let g=0;g<d.length;g+=1)D(r[g]);D(p),u=!0}},o(m){T(t.$$.fragment,m),T(o.$$.fragment,m);for(let g=0;g<r.length;g+=1)T(r[g]);T(p),u=!1},d(m){$(t,m),m&&M(e),m&&M(n),$(o),m&&M(s);for(let g=0;g<r.length;g+=1)r[g].d(m);m&&M(l),p&&p.d(m),m&&M(c)}}}function fr(i,t){let e,n,o;return n=new Xa({props:{unfolded:t[4],content:t[1],inDelay:500}}),{key:i,first:null,c(){e=j("div"),ee(n.$$.fragment),b(e,"class","text svelte-1f7m1lj"),this.first=e},m(s,r){B(s,e,r),K(n,e,null),o=!0},p(s,r){t=s;const a={};r&16&&(a.unfolded=t[4]),r&4&&(a.content=t[1]),n.$set(a)},i(s){o||(D(n.$$.fragment,s),o=!0)},o(s){T(n.$$.fragment,s),o=!1},d(s){s&&M(e),$(n)}}}function mr(i){let t,e,n;return e=new Ja({props:{autoplayConfig:{autoplay:!1},unfolded:i[4],mediaData:i[3],tag:i[0],enableCarousel:!1,canPlay:!1,playButtonIfNeed:"small",inDelay:500,duration:500}}),{c(){t=j("div"),ee(e.$$.fragment),b(t,"class","media-wrapper svelte-1f7m1lj")},m(o,s){B(o,t,s),K(e,t,null),n=!0},p(o,s){const r={};s&16&&(r.unfolded=o[4]),s&8&&(r.mediaData=o[3]),s&1&&(r.tag=o[0]),e.$set(r)},i(o){n||(D(e.$$.fragment,o),n=!0)},o(o){T(e.$$.fragment,o),n=!1},d(o){o&&M(t),$(e)}}}function Gp(i){let t,e,n=i[0].state&&hr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&D(n,1)):(n=hr(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Np(i,t,e){let n,o,s,{tag:r}=t,a;return i.$$set=l=>{"tag"in l&&e(0,r=l.tag)},i.$$.update=()=>{var l,c,u;i.$$.dirty&1&&e(4,n=r.state?r.state.unfolded:!1),i.$$.dirty&1&&e(1,o=((c=(l=r.data.text)==null?void 0:l.length)!=null?c:0)>7?((u=r.data.text)==null?void 0:u.substring(0,6))+"...":r.data.text),i.$$.dirty&1&&e(3,s=r.data.mediaData),i.$$.dirty&2&&e(2,a=o?[{id:He(),content:o}]:[])},[r,o,a,s,n]}class Wp extends oe{constructor(t){super(),ie(this,t,Np,Gp,ne,{tag:0},Fp)}}function Xp(i){ae(i,"svelte-8mby9k",".svelte-8mby9k.svelte-8mby9k{box-sizing:border-box}.marketing.svelte-8mby9k.svelte-8mby9k{transform:translateY(-100%)}.content.svelte-8mby9k .headerImage.svelte-8mby9k{position:absolute;width:100%;top:0.25rem;transform:translateY(-100%);border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.line.svelte-8mby9k.svelte-8mby9k{position:absolute;height:2.0625rem;width:0.0625rem;left:50%;transform:translateX(-50%);background-color:white;bottom:0;transform-origin:bottom;transition:all 500ms}.content.svelte-8mby9k.svelte-8mby9k{background-color:white;position:relative;display:flex;flex-direction:column;min-width:11.125rem;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;border-radius:0.25rem;top:-1.875rem;left:-1rem;padding:0.5rem 0rem 0.5625rem;transition:all 500ms}.title.svelte-8mby9k.svelte-8mby9k{position:absolute;background-color:white;border-radius:0.25rem;width:100%;top:0.5rem;padding-left:0.75rem;padding-right:0.75rem}.title.svelte-8mby9k .text.svelte-8mby9k{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:0.75rem;font-weight:bold;line-height:1.125rem;color:#000}.footer.svelte-8mby9k.svelte-8mby9k{position:relative;padding-left:0.75rem;padding-right:0.75rem;width:100%;height:1.375rem;display:flex;align-items:center}.footer.svelte-8mby9k .goto-button.svelte-8mby9k{flex-shrink:0;white-space:nowrap;background-image:linear-gradient(to right, rgba(87, 144, 253, 1) 0, rgba(42, 114, 254, 1) 100%);color:#fff;font-size:0.625rem;border-radius:0.875rem;font-weight:bold;padding-left:0.5rem;padding-right:0.5rem;height:1.25rem;margin-left:auto;display:flex;align-items:center}.footer.svelte-8mby9k .goto-icon.svelte-8mby9k::after{content:'';display:inline-block;width:0.75rem;height:0.75rem;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAMAAADW3miqAAAAeFBMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////GqOSsAAAAJ3RSTlMAFNO2pYt4bErz8uP6ysawgVtBPDcR5C4s2L6ZmJBzZGJXUyEeDws/0G2zAAAAkklEQVQ4y+3TRw6DMBAF0OAeJ3QCpCe0uf8NwRILLBYfiS1/aT3JoymnI+sERZ5VCH0iVto3QDfBLmeSSMUTogRV9bBEpJAKaYpGijn13aTSLeraeG9D0NZFZv4/rRL5FDHnITlllqjv6tykWsmX4JHr05y7j6oFKq2P8He48B0tAM0EY0EDxquClw6vLz6EI35GmwwSZpe+WOgAAAAASUVORK5CYII=);background-size:100% auto;background-repeat:no-repeat}.price.svelte-8mby9k.svelte-8mby9k{flex-shrink:0;margin-right:0.75rem;white-space:nowrap;color:#ff6600;display:flex;align-items:baseline}.price.svelte-8mby9k .value.svelte-8mby9k{position:relative;top:0.0625rem;font-size:1.125rem;line-height:1.375rem;font-family:TG-TYPE, PingFangSC, Segoe UI, Rototo, sans-serif;letter-spacing:0rem}.price.svelte-8mby9k .unit.svelte-8mby9k{padding-left:0.125rem;font-size:0.625rem}.tag.svelte-8mby9k.svelte-8mby9k{position:relative;background-color:white;display:flex;width:-moz-max-content;width:max-content;padding-left:0.75rem;padding-right:0.75rem;min-height:1.75rem}.tag.svelte-8mby9k .base-tag.svelte-8mby9k{height:1rem;margin-top:1.375rem;margin-bottom:0.5rem;margin-right:0.25rem;font-size:0.625rem;line-height:0.875rem;padding:0.0625rem 0.25rem;border-radius:0.125rem;overflow:hidden}.tag.svelte-8mby9k .primary-tag.svelte-8mby9k{background:#e5eefe;color:#0055ff}.tag.svelte-8mby9k .secondary-tag.svelte-8mby9k{background:rgba(255, 102, 0, 0.08);color:rgba(255, 102, 0, 1)}.unfolded.svelte-8mby9k .line.svelte-8mby9k{transform:translateX(-50%) scale(1, 1)}.folded.svelte-8mby9k .line.svelte-8mby9k{transform:translateX(-50%) scale(1, 0);transition-timing-function:ease-in}.unfolded.svelte-8mby9k .content.svelte-8mby9k{opacity:1}.folded.svelte-8mby9k .content.svelte-8mby9k{opacity:0;transform:translateY(0.425rem);transition-timing-function:ease-in}")}function pr(i,t,e){const n=i.slice();return n[0]=t[e],n}function gr(i,t,e){const n=i.slice();return n[0]=t[e],n}function Ar(i){let t,e=i[0]+"",n;return{c(){t=j("div"),n=ke(e),b(t,"class","base-tag primary-tag svelte-8mby9k")},m(o,s){B(o,t,s),Q(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&Te(n,e)},d(o){o&&M(t)}}}function vr(i){let t,e=i[0]&&Ar(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),B(n,t,o)},p(n,o){n[0]?e?e.p(n,o):(e=Ar(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},d(n){e&&e.d(n),n&&M(t)}}}function br(i){let t,e=i[0]+"",n;return{c(){t=j("div"),n=ke(e),b(t,"class","base-tag secondary-tag svelte-8mby9k")},m(o,s){B(o,t,s),Q(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&Te(n,e)},d(o){o&&M(t)}}}function yr(i){let t,e=i[0]&&br(i);return{c(){e&&e.c(),t=fe()},m(n,o){e&&e.m(n,o),B(n,t,o)},p(n,o){n[0]?e?e.p(n,o):(e=br(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},d(n){e&&e.d(n),n&&M(t)}}}function wr(i){let t,e,n=i[2].price.value+"",o,s,r=i[2].price.unit&&Cr(i);return{c(){t=j("div"),e=j("span"),o=ke(n),s=_(),r&&r.c(),b(e,"class","value svelte-8mby9k"),b(t,"class","price svelte-8mby9k")},m(a,l){B(a,t,l),Q(t,e),Q(e,o),Q(t,s),r&&r.m(t,null)},p(a,l){l&4&&n!==(n=a[2].price.value+"")&&Te(o,n),a[2].price.unit?r?r.p(a,l):(r=Cr(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&M(t),r&&r.d()}}}function Cr(i){let t,e=i[2].price.unit+"",n;return{c(){t=j("span"),n=ke(e),b(t,"class","unit svelte-8mby9k")},m(o,s){B(o,t,s),Q(t,n)},p(o,s){s&4&&e!==(e=o[2].price.unit+"")&&Te(n,e)},d(o){o&&M(t)}}}function Er(i){let t,e=i[2].highlightText+"",n;return{c(){t=j("div"),n=ke(e),b(t,"class","goto-button goto-icon svelte-8mby9k")},m(o,s){B(o,t,s),Q(t,n)},p(o,s){s&4&&e!==(e=o[2].highlightText+"")&&Te(n,e)},d(o){o&&M(t)}}}function Yp(i){var W,U;let t,e,n,o,s,r,a,l,c,u,d,h,p,m,g=i[2].title+"",A,v,w,y,x;e=new Ve({props:{visible:i[1],outDelay:500,left:61,bottom:87,blurRadius:150,spreadRadius:75}});let L=i[2].brandTags||[],C=[];for(let P=0;P<L.length;P+=1)C[P]=vr(gr(i,L,P));let S=i[2].tags||[],k=[];for(let P=0;P<S.length;P+=1)k[P]=yr(pr(i,S,P));let G=((W=i[2].price)==null?void 0:W.value)!==void 0&&((U=i[2].price)==null?void 0:U.value)!==null&&wr(i),O=i[2].highlightText&&Er(i);return{c(){var P,I;t=j("div"),ee(e.$$.fragment),n=_(),o=j("div"),s=_(),r=j("div"),a=j("img"),c=_(),u=j("div");for(let z=0;z<C.length;z+=1)C[z].c();d=_();for(let z=0;z<k.length;z+=1)k[z].c();h=_(),p=j("div"),m=j("div"),A=ke(g),v=_(),w=j("div"),G&&G.c(),y=_(),O&&O.c(),b(o,"class","line svelte-8mby9k"),R(o,"transition-delay",i[1]?Bn+"ms":jn+Ir-Pr-40+"ms"),b(a,"class","headerImage svelte-8mby9k"),et(a.src,l=i[2].headerPictureUrl)||b(a,"src",l),b(a,"alt",""),b(u,"class","tag svelte-8mby9k"),b(m,"class","text svelte-8mby9k"),b(p,"class","title svelte-8mby9k"),b(w,"class","footer svelte-8mby9k"),R(w,"height",((P=i[2].price)==null?void 0:P.value)!==void 0&&((I=i[2].price)==null?void 0:I.value)!==null&&i[2].highlightText?void 0:"1rem"),b(r,"class","content svelte-8mby9k"),R(r,"transition-delay",i[1]?Bn+jn+"ms":"0ms"),b(t,"class","marketing svelte-8mby9k"),q(t,"unfolded",i[1]),q(t,"folded",i[3])},m(P,I){B(P,t,I),K(e,t,null),Q(t,n),Q(t,o),Q(t,s),Q(t,r),Q(r,a),Q(r,c),Q(r,u);for(let z=0;z<C.length;z+=1)C[z].m(u,null);Q(u,d);for(let z=0;z<k.length;z+=1)k[z].m(u,null);Q(r,h),Q(r,p),Q(p,m),Q(m,A),Q(r,v),Q(r,w),G&&G.m(w,null),Q(w,y),O&&O.m(w,null),x=!0},p(P,[I]){var H,X,Z,Y;const z={};if(I&2&&(z.visible=P[1]),e.$set(z),I&2&&R(o,"transition-delay",P[1]?Bn+"ms":jn+Ir-Pr-40+"ms"),(!x||I&4&&!et(a.src,l=P[2].headerPictureUrl))&&b(a,"src",l),I&4){L=P[2].brandTags||[];let V;for(V=0;V<L.length;V+=1){const ue=gr(P,L,V);C[V]?C[V].p(ue,I):(C[V]=vr(ue),C[V].c(),C[V].m(u,d))}for(;V<C.length;V+=1)C[V].d(1);C.length=L.length}if(I&4){S=P[2].tags||[];let V;for(V=0;V<S.length;V+=1){const ue=pr(P,S,V);k[V]?k[V].p(ue,I):(k[V]=yr(ue),k[V].c(),k[V].m(u,null))}for(;V<k.length;V+=1)k[V].d(1);k.length=S.length}(!x||I&4)&&g!==(g=P[2].title+"")&&Te(A,g),((H=P[2].price)==null?void 0:H.value)!==void 0&&((X=P[2].price)==null?void 0:X.value)!==null?G?G.p(P,I):(G=wr(P),G.c(),G.m(w,y)):G&&(G.d(1),G=null),P[2].highlightText?O?O.p(P,I):(O=Er(P),O.c(),O.m(w,null)):O&&(O.d(1),O=null),I&4&&R(w,"height",((Z=P[2].price)==null?void 0:Z.value)!==void 0&&((Y=P[2].price)==null?void 0:Y.value)!==null&&P[2].highlightText?void 0:"1rem"),I&2&&R(r,"transition-delay",P[1]?Bn+jn+"ms":"0ms"),(!x||I&2)&&q(t,"unfolded",P[1]),(!x||I&8)&&q(t,"folded",P[3])},i(P){x||(D(e.$$.fragment,P),x=!0)},o(P){T(e.$$.fragment,P),x=!1},d(P){P&&M(t),$(e),tt(C,P),tt(k,P),G&&G.d(),O&&O.d()}}}const Bn=400,Pr=500,jn=180,Ir=500;function Up(i,t,e){let n,o,s,{tag:r}=t;return i.$$set=a=>{"tag"in a&&e(0,r=a.tag)},i.$$.update=()=>{var a,l;i.$$.dirty&1&&e(1,n=(l=(a=r.state)==null?void 0:a.unfolded)!=null?l:!1),i.$$.dirty&2&&e(3,o=!n),i.$$.dirty&1&&e(2,s=r.data)},[r,n,s,o]}class Vp extends oe{constructor(t){super(),ie(this,t,Up,Yp,ne,{tag:0},Xp)}}function Jp(i){ae(i,"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 xr(i){let t,e,n,o,s,r,a,l=!0,c,u,d,h,p;return e=new Ve({props:{center:!0,blurRadius:15,spreadRadius:6}}),{c(){t=j("div"),ee(e.$$.fragment),n=_(),o=j("div"),s=_(),r=j("audio"),b(o,"class","audio-icon svelte-1ku3wt4"),r.controls=!1,b(r,"playsinline",""),et(r.src,a=i[3])||b(r,"src",a),b(t,"class","audio svelte-1ku3wt4"),q(t,"paused",i[6])},m(m,g){B(m,t,g),K(e,t,null),Q(t,n),Q(t,o),Q(t,s),Q(t,r),i[9](r),d=!0,h||(p=[Pe(r,"play",i[10]),Pe(r,"pause",i[10]),Pe(t,"click",_i(i[7]))],h=!0)},p(m,g){i=m,(!d||g&8&&!et(r.src,a=i[3]))&&b(r,"src",a),g&64&&l!==(l=i[6])&&r[l?"pause":"play"](),(!d||g&64)&&q(t,"paused",i[6])},i(m){d||(D(e.$$.fragment,m),m&&xe(()=>{u&&u.end(1),c=Ot(t,Tt,{duration:i[2],delay:i[0],easing:_t}),c.start()}),d=!0)},o(m){T(e.$$.fragment,m),c&&c.invalidate(),m&&(u=$t(t,Tt,{duration:i[2],delay:i[1],easing:_t})),d=!1},d(m){m&&M(t),$(e),i[9](null),m&&u&&u.end(),h=!1,rt(p)}}}function _p(i){let t,e,n=i[4]&&xr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[4]?n?(n.p(o,s),s&16&&D(n,1)):(n=xr(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Zp(i,t,e){let{inDelay:n=0}=t,{outDelay:o=0}=t,{duration:s=0}=t,{url:r}=t,{unfolded:a}=t,{hooksInfo:l={}}=t;const c=mn("hooks"),u=mn("mediaStore");let d,h=!0;u.subscribe(({currentMediaUrl:A})=>{A!==r&&(d==null||d.pause())});function p(A){u.set({currentMediaUrl:r}),d&&(c.emit("click",N({event:A,target:"AudioTagPlayIcon",audioInstance:d},l)),d.paused?d.play():d.pause(),e(5,d.onplay=v=>c.emit("playStateChange",N({event:v,state:"playing",mediaInstance:d},l)),d),e(5,d.onpause=v=>c.emit("playStateChange",N({event:v,state:"paused",mediaInstance:d},l)),d))}function m(A){Me[A?"unshift":"push"](()=>{d=A,e(5,d)})}function g(){h=this.paused,e(6,h)}return i.$$set=A=>{"inDelay"in A&&e(0,n=A.inDelay),"outDelay"in A&&e(1,o=A.outDelay),"duration"in A&&e(2,s=A.duration),"url"in A&&e(3,r=A.url),"unfolded"in A&&e(4,a=A.unfolded),"hooksInfo"in A&&e(8,l=A.hooksInfo)},i.$$.update=()=>{i.$$.dirty&48&&(a||d==null||d.pause())},[n,o,s,r,a,d,h,p,l,m,g]}class qp extends oe{constructor(t){super(),ie(this,t,Zp,_p,ne,{inDelay:0,outDelay:1,duration:2,url:3,unfolded:4,hooksInfo:8},Jp)}}function Kp(i){ae(i,"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 kr(i){var w,y,x,L;let t,e,n,o,s,r,a,l,c,u,d,h,p,m,g,A,v;return e=new Ve({props:{visible:i[5],left:i[2]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}}),s=new Wa({props:{unfolded:i[5],duration:1e3,outDelay:i[4]+20*Math.min((y=(w=i[3][0])==null?void 0:w.content.length)!=null?y:10,15)}}),u=new qp({props:{unfolded:i[5],url:i[0].data.audioUrl,duration:1e3,outDelay:20*Math.min((L=(x=i[3][0])==null?void 0:x.content.length)!=null?L:10,15),hooksInfo:{tag:i[0]}}}),p=new Ya({props:{visible:i[5],textUnfolded:i[1],textItems:i[3]}}),{c(){t=j("div"),ee(e.$$.fragment),n=_(),o=j("div"),ee(s.$$.fragment),r=_(),a=j("div"),l=j("div"),c=j("div"),ee(u.$$.fragment),d=_(),h=j("div"),ee(p.$$.fragment),b(o,"class","line svelte-4r8s18"),R(o,"width",i[2]+"px"),b(c,"class","audio-icon svelte-4r8s18"),R(h,"display","inline-block"),b(l,"class","wrapper svelte-4r8s18"),b(a,"class","content svelte-4r8s18"),xe(()=>i[8].call(a)),b(t,"class","audio-tag svelte-4r8s18"),q(t,"unfolded",i[5])},m(C,S){B(C,t,S),K(e,t,null),Q(t,n),Q(t,o),K(s,o,null),Q(t,r),Q(t,a),Q(a,l),Q(l,c),K(u,c,null),Q(l,d),Q(l,h),K(p,h,null),m=bt(a,i[8].bind(a)),g=!0,A||(v=Pe(h,"click",i[6]),A=!0)},p(C,S){var U,P,I,z;const k={};S&32&&(k.visible=C[5]),S&4&&(k.left=C[2]/2+"px"),e.$set(k);const G={};S&32&&(G.unfolded=C[5]),S&24&&(G.outDelay=C[4]+20*Math.min((P=(U=C[3][0])==null?void 0:U.content.length)!=null?P:10,15)),s.$set(G),S&4&&R(o,"width",C[2]+"px");const O={};S&32&&(O.unfolded=C[5]),S&1&&(O.url=C[0].data.audioUrl),S&8&&(O.outDelay=20*Math.min((z=(I=C[3][0])==null?void 0:I.content.length)!=null?z:10,15)),S&1&&(O.hooksInfo={tag:C[0]}),u.$set(O);const W={};S&32&&(W.visible=C[5]),S&2&&(W.textUnfolded=C[1]),S&8&&(W.textItems=C[3]),p.$set(W),(!g||S&32)&&q(t,"unfolded",C[5])},i(C){g||(D(e.$$.fragment,C),D(s.$$.fragment,C),D(u.$$.fragment,C),D(p.$$.fragment,C),g=!0)},o(C){T(e.$$.fragment,C),T(s.$$.fragment,C),T(u.$$.fragment,C),T(p.$$.fragment,C),g=!1},d(C){C&&M(t),$(e),$(s),$(u),$(p),m(),A=!1,v()}}}function $p(i){let t,e,n=i[0].state&&kr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&D(n,1)):(n=kr(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function eg(i,t,e){let n,o,s,{tag:r}=t,a=!1,l,c=[];function u(){e(1,a=!a)}function d(){l=this.clientWidth,e(2,l)}return i.$$set=h=>{"tag"in h&&e(0,r=h.tag)},i.$$.update=()=>{var h;i.$$.dirty&1&&e(5,n=!!((h=r.state)!=null&&h.unfolded)),i.$$.dirty&1&&e(7,o=r.data.text),i.$$.dirty&128&&e(3,c=[{id:He(),content:o}]),i.$$.dirty&2&&e(4,s=a?450:0)},[r,a,l,c,s,n,u,o,d]}class tg extends oe{constructor(t){super(),ie(this,t,eg,$p,ne,{tag:0},Kp)}}function ng(i){ae(i,"svelte-10cw0el",".media-wrapper.svelte-10cw0el{position:absolute;width:100%;height:100%}")}function Dr(i){let t,e,n;return e=new Ja({props:{unfolded:i[5],mediaData:i[4],objectFit:i[2],enableCarousel:i[1],autoplayConfig:i[3],tag:i[0],canPlay:!0,playButtonIfNeed:"large",inDelay:500,duration:500}}),{c(){t=j("div"),ee(e.$$.fragment),b(t,"class","media-wrapper svelte-10cw0el")},m(o,s){B(o,t,s),K(e,t,null),n=!0},p(o,s){const r={};s&32&&(r.unfolded=o[5]),s&16&&(r.mediaData=o[4]),s&4&&(r.objectFit=o[2]),s&2&&(r.enableCarousel=o[1]),s&8&&(r.autoplayConfig=o[3]),s&1&&(r.tag=o[0]),e.$set(r)},i(o){n||(D(e.$$.fragment,o),n=!0)},o(o){T(e.$$.fragment,o),n=!1},d(o){o&&M(t),$(e)}}}function ig(i){let t,e,n=i[0].state&&i[4]&&Dr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[0].state&&o[4]?n?(n.p(o,s),s&17&&D(n,1)):(n=Dr(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function og(i,t,e){let n,o,s,r,a,{tag:l}=t;return i.$$set=c=>{"tag"in c&&e(0,l=c.tag)},i.$$.update=()=>{var c,u;i.$$.dirty&1&&e(5,n=l.state?l.state.unfolded:!1),i.$$.dirty&1&&e(4,o=l.data.mediaData),i.$$.dirty&1&&e(1,s=l.data.enableCarousel),i.$$.dirty&3&&e(3,r=(c=l.data.autoplayConfig)!=null?c:{autoplay:s!=null?s:!0,autoplayVideo:!0}),i.$$.dirty&1&&e(2,a=(u=l.data.objectFit)!=null?u:(()=>l.data.adaptationMode==="stretch"?"cover":l.data.adaptationMode==="proportional"?"contain":void 0)())},[l,s,a,r,o,n]}class sg extends oe{constructor(t){super(),ie(this,t,og,ig,ne,{tag:0},ng)}}function rg(i){ae(i,"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+e211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;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 ag(i){let t,e,n,o;return t=new Ve({props:{visible:!0,outDelay:0,inDelay:0,width:1.4,left:13,bottom:"auto",blurRadius:50,spreadRadius:18}}),{c(){ee(t.$$.fragment),e=_(),n=j("div"),b(n,"class","link svelte-7x7u86")},m(s,r){K(t,s,r),B(s,e,r),B(s,n,r),o=!0},i(s){o||(D(t.$$.fragment,s),o=!0)},o(s){T(t.$$.fragment,s),o=!1},d(s){$(t,s),s&&M(e),s&&M(n)}}}function lg(i){let t,e,n,o,s,r,a,l;return t=new Ve({props:{visible:!0,outDelay:0,inDelay:0,height:1.2,left:13,bottom:12,blurRadius:50,spreadRadius:18}}),{c(){ee(t.$$.fragment),e=_(),n=j("div"),o=_(),s=j("div"),r=_(),a=j("div"),b(n,"class","arrow0 svelte-7x7u86"),b(s,"class","arrow1 svelte-7x7u86"),b(a,"class","arrow2 svelte-7x7u86")},m(c,u){K(t,c,u),B(c,e,u),B(c,n,u),B(c,o,u),B(c,s,u),B(c,r,u),B(c,a,u),l=!0},i(c){l||(D(t.$$.fragment,c),l=!0)},o(c){T(t.$$.fragment,c),l=!1},d(c){$(t,c),c&&M(e),c&&M(n),c&&M(o),c&&M(s),c&&M(r),c&&M(a)}}}function cg(i){let t,e,n,o,s,r,a,l,c,u=i[0].text+"",d,h;const p=[lg,ag],m=[];function g(A,v){return A[0].linkType===ei.VrLink?0:A[0].linkType===ei.NormalLink?1:-1}return~(n=g(i))&&(o=m[n]=p[n](i)),a=new Ve({props:{visible:!0,outDelay:0,inDelay:0,left:"auto",bottom:"auto",width:"80%",blurRadius:40,spreadRadius:16,opacity:.08}}),{c(){t=j("div"),e=j("div"),o&&o.c(),s=_(),r=j("div"),ee(a.$$.fragment),l=_(),c=j("div"),d=ke(u),b(e,"class","icon svelte-7x7u86"),b(c,"class","text svelte-7x7u86"),b(r,"class","text-wrapper svelte-7x7u86"),b(t,"class","wrapper svelte-7x7u86")},m(A,v){B(A,t,v),Q(t,e),~n&&m[n].m(e,null),Q(t,s),Q(t,r),K(a,r,null),Q(r,l),Q(r,c),Q(c,d),h=!0},p(A,[v]){let w=n;n=g(A),n!==w&&(o&&(le(),T(m[w],1,1,()=>{m[w]=null}),ce()),~n?(o=m[n],o||(o=m[n]=p[n](A),o.c()),D(o,1),o.m(e,null)):o=null),(!h||v&1)&&u!==(u=A[0].text+"")&&Te(d,u)},i(A){h||(D(o),D(a.$$.fragment,A),h=!0)},o(A){T(o),T(a.$$.fragment,A),h=!1},d(A){A&&M(t),~n&&m[n].d(),$(a)}}}function ug(i,t,e){let n,{tag:o}=t;return i.$$set=s=>{"tag"in s&&e(1,o=s.tag)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=o.data)},[n,o]}class dg extends oe{constructor(t){super(),ie(this,t,ug,cg,ne,{tag:1},rg)}}function hg(i){ae(i,"svelte-kzl2aj",".customElement__container.svelte-kzl2aj{position:relative}")}function Lr(i){let t,e=i[0].element+"",n;return{c(){t=new Yn(!1),n=fe(),t.a=n},m(o,s){t.m(e,o,s),B(o,n,s)},p(o,s){s&1&&e!==(e=o[0].element+"")&&t.p(e)},d(o){o&&M(n),o&&t.d()}}}function fg(i){let t,e=typeof i[0].element=="string"&&Lr(i);return{c(){t=j("div"),e&&e.c(),b(t,"class","customElement__container svelte-kzl2aj")},m(n,o){B(n,t,o),e&&e.m(t,null),i[2](t)},p(n,[o]){typeof n[0].element=="string"?e?e.p(n,o):(e=Lr(n),e.c(),e.m(t,null)):e&&(e.d(1),e=null)},i:te,o:te,d(n){n&&M(t),e&&e.d(),i[2](null)}}}function mg(i,t,e){let{tag:n}=t,o,s;Ye(()=>{if(o){if(n.element instanceof Element){const a=n.element;o.appendChild(a),s=()=>o==null?void 0:o.removeChild(a)}else if(typeof n.element=="function"){const a=n.element;s=a(o)}}}),yt(()=>{s==null||s()});function r(a){Me[a?"unshift":"push"](()=>{o=a,e(1,o)})}return i.$$set=a=>{"tag"in a&&e(0,n=a.tag)},[n,o,r]}class pg extends oe{constructor(t){super(),ie(this,t,mg,fg,ne,{tag:0},hg)}}function gg(i){ae(i,"svelte-95x526",`@font-face{font-family:'TG-TYPE';font-style:normal;font-weight:400;src:local('TG-TYPE-Bold'),
|
|
545
545
|
url(data:application/font-woff2;charset=utf-8;base64,T1RUTwAKAIAAAwAgQ0ZGINFD4CEAAAaQAAAHC0dTVUIAAQAAAAANnAAAAApPUy8yaB5pEwAAAjQAAABgY21hcEItjGUAAAT0AAABfGhlYWQS1WWOAAAAtAAAADZoaGVhBfMBxwAAAhAAAAAkaG10eJ9gBO8AAADsAAABJG1heHAASVAAAAAArAAAAAZuYW1lqczkZQAAApQAAAJecG9zdP+4ADIAAAZwAAAAIAAAUAAASQAAAAEAAAABAADkeHeyXw889QADA+gAAAAA2NoRKwAAAADY2hErACn/OAHgAyAAAQADAAIAAAAAAAAB9ABdAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJ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7yMe8vcfHvVlPT1laTx8OmIr5UQG/+B8D93iKFfsIBvdo+OYF+6T2+B8oBg6iifL3bPX3QPEStvNB8vc/8jXxE/L4EvgHFRPss7Cnu78arYOreqgexWpNr0YbaWyDem4fUmlmTUcaXqBftGAeE/JWYmROSxpklWieax5Ksc9i2BuxrpWerB/LsbTP2BrHaMVath4T7PsN93QVu7FjXFtlZltcZbC7urGzuh8T8oX8ghVPW7zHx7q6yMa9W1BPWVpQHw6i96Tz92/0AbTz93DzA/hp+HkVsIGveKwezmNFtUAbZGeBeGofSmNiRT8aZJVnnmseSrHPYtoboAb7EvukBfcHBvdL+CEFmaySqaQa+9gWxry+yJ6dhoGcHq12oWZmGk5YW1BMXLnKHg4gCiEK+11L91IlCvdiyhWtb6hpJgoeJAoOIQogCqz3pe/3b/UBufX3bfQD+G74dxWyga94rB7NZEW0PhtlaIF4ah9KY2FFPxo7tkTPZh6MjIqKjB+TiJCIjYoIjgaCoKGHoRuanY6QoB+IgfsB+6QF9wcG9y/4IgWYppGnqhr7a/sCFVBbvMjHu7zGyLxbTk5aWk4fDvtd+AojCoz7jBUmCh8kCq1vqGkeDvtdi/cS94wjCvwKBCIKDiD3ru8BvPeuA7z4EhUn967vBw4eoDf/DAmLDAv47BT4exWcEwAHAQFBXW97ipCarPcv8+7yAfdl8gP4aPf6FfIjB+r3gwUiBi77gwWHBjH3gwUkBuP7gwUnJPcxKPsxI/cx+y/y9y/3MPP7MO4GDvtdi/cSJQr3JBZkcqOzsKSksrCkcWdlcnFmHw6up6eurm+naGhvb2hop2+uHwv3EiUK9yP4ChUiCgt3SgWxBrnmBZGVj5eZGgsB2/cSAwtobm5paqBzqoYLAAABAAAAAAAAAAAAAA==)
|
|
546
|
-
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 Ag(i){let t,e;return t=new sg({props:{tag:ze(i[1])}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=ze(n[1])),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function vg(i){let t,e;return t=new dg({props:{tag:ze(i[1])}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=ze(n[1])),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function bg(i){let t,e;return t=new Vp({props:{tag:ze(i[1])}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=ze(n[1])),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function yg(i){let t,e;return t=new tg({props:{tag:ze(i[1])}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=ze(n[1])),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function wg(i){let t,e;return t=new Wp({props:{tag:ze(i[1])}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=ze(n[1])),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Cg(i){let t,e;return t=new op({props:{tag:ze(i[1])}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=ze(n[1])),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Eg(i){let t,e;return t=new pg({props:{tag:ze(i[1])}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=ze(n[1])),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Pg(i){let t,e,n,o,s,r,a,l,c;const u=[Eg,Cg,wg,yg,bg,vg,Ag],d=[];function h(p,m){return p[1].element?0:p[1].contentType===We.Text?1:p[1].contentType===We.ImageText?2:p[1].contentType===We.Audio?3:p[1].contentType===We.Marketing?4:p[1].contentType===We.Link?5:p[1].contentType===We.MediaPlane?6:-1}return~(o=h(i))&&(s=d[o]=u[o](i)),{c(){var p,m,g;t=j("div"),e=j("div"),n=j("div"),s&&s.c(),b(n,"class","content svelte-95x526"),q(n,"unfolded",(p=i[1].state)==null?void 0:p.unfolded),b(e,"class","content__wrapper svelte-95x526"),b(t,"class","content__container svelte-95x526"),b(t,"data-id",r=i[1].id),q(t,"disable",i[1].enabled===!1||((m=i[1].temporaryState)==null?void 0:m.visible)===!1),q(t,"hide",!i[3].visible||!i[3].enabled||!i[4].visible||!((g=i[1].state)!=null&&g.visible)),q(t,"withAnimation",i[0]),q(t,"unClickable",i[1].clickable===!1),R(t,"width",i[1].pointType==="PointTag"?0:"100%"),R(t,"height",i[1].pointType==="PointTag"?0:"100%")},m(p,m){B(p,t,m),Q(t,e),Q(e,n),~o&&d[o].m(n,null),a=!0,l||(c=Pe(t,"click",_i(i[11])),l=!0)},p(p,[m]){var A,v,w;let g=o;o=h(p),o===g?~o&&d[o].p(p,m):(s&&(le(),T(d[g],1,1,()=>{d[g]=null}),ce()),~o?(s=d[o],s?s.p(p,m):(s=d[o]=u[o](p),s.c()),D(s,1),s.m(n,null)):s=null),(!a||m&2)&&q(n,"unfolded",(A=p[1].state)==null?void 0:A.unfolded),(!a||m&2&&r!==(r=p[1].id))&&b(t,"data-id",r),(!a||m&2)&&q(t,"disable",p[1].enabled===!1||((v=p[1].temporaryState)==null?void 0:v.visible)===!1),(!a||m&26)&&q(t,"hide",!p[3].visible||!p[3].enabled||!p[4].visible||!((w=p[1].state)!=null&&w.visible)),(!a||m&1)&&q(t,"withAnimation",p[0]),(!a||m&2)&&q(t,"unClickable",p[1].clickable===!1),m&2&&R(t,"width",p[1].pointType==="PointTag"?0:"100%"),m&2&&R(t,"height",p[1].pointType==="PointTag"?0:"100%")},i(p){a||(D(s),a=!0)},o(p){T(s),a=!1},d(p){p&&M(t),~o&&d[o].d(),l=!1,c()}}}function Ig(i,t,e){let n,o,s,r,{withAnimation:a=!1}=t,{tag:l}=t,{hooks:c}=t,{state:u}=t,{mediaStore:d}=t,{temporaryState:h}=t;Bi("hooks",c),Bi("mediaStore",d);let p,m;function g(v){v?c.emit("exposure",{id:r,type:"start"}):c.emit("exposure",{id:r,type:"end"})}const A=v=>c.emit("click",{event:v,target:"TagContent",tag:l});return i.$$set=v=>{"withAnimation"in v&&e(0,a=v.withAnimation),"tag"in v&&e(1,l=v.tag),"hooks"in v&&e(2,c=v.hooks),"state"in v&&e(3,u=v.state),"mediaStore"in v&&e(5,d=v.mediaStore),"temporaryState"in v&&e(4,h=v.temporaryState)},i.$$.update=()=>{var v,w;i.$$.dirty&2&&e(9,n=(v=l.state)==null?void 0:v.unfolded),i.$$.dirty&2&&e(8,o=(w=l.state)==null?void 0:w.visible),i.$$.dirty&280&&e(10,s=u.visible&&h.visible&&o),i.$$.dirty&2&&(r=l.id),i.$$.dirty&1024&&g(s),i.$$.dirty&962&&l.hooks&&(n!==void 0&&n!==m&&(e(7,m=n),n?l.hooks.emit("unfolded"):l.hooks.emit("folded")),o!==void 0&&o!==p&&(e(6,p=o),o?l.hooks.emit("show"):l.hooks.emit("hide")))},[a,l,c,u,h,d,p,m,o,n,s,A]}class _a extends oe{constructor(t){super(),ie(this,t,Ig,Pg,ne,{withAnimation:0,tag:1,hooks:2,state:3,mediaStore:5,temporaryState:4},gg)}}function xg(i){ae(i,"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+khrHjed40TWvFfQ2jvCl8nGha6lQCl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WSY8DBCby7AU8E3eUhfzVkYZgR6H/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 kg(i){let t,e,n,o,s,r,a;return e=new Ve({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){t=j("div"),ee(e.$$.fragment),n=_(),o=j("div"),s=_(),r=j("div"),b(o,"class","small-point svelte-fuismw"),R(o,"transition-delay",i[3]?i[2]+"ms":"0ms"),b(r,"class","big-point svelte-fuismw"),R(r,"--iconUrl","url("+i[1]+")"),R(r,"transition-delay",i[3]?i[2]+"ms":"0ms"),b(t,"class","point svelte-fuismw"),q(t,"folded",i[3]),q(t,"unfolded",i[0])},m(l,c){B(l,t,c),K(e,t,null),Q(t,n),Q(t,o),Q(t,s),Q(t,r),a=!0},p(l,[c]){c&12&&R(o,"transition-delay",l[3]?l[2]+"ms":"0ms"),(!a||c&2)&&R(r,"--iconUrl","url("+l[1]+")"),c&12&&R(r,"transition-delay",l[3]?l[2]+"ms":"0ms"),(!a||c&8)&&q(t,"folded",l[3]),(!a||c&1)&&q(t,"unfolded",l[0])},i(l){a||(D(e.$$.fragment,l),a=!0)},o(l){T(e.$$.fragment,l),a=!1},d(l){l&&M(t),$(e)}}}function Dg(i,t,e){let n,{unfolded:o}=t,{iconUrl:s}=t,{foldDelay:r=800}=t;return i.$$set=a=>{"unfolded"in a&&e(0,o=a.unfolded),"iconUrl"in a&&e(1,s=a.iconUrl),"foldDelay"in a&&e(2,r=a.foldDelay)},i.$$.update=()=>{i.$$.dirty&1&&e(3,n=!o)},[o,s,r,n]}class Lg extends oe{constructor(t){super(),ie(this,t,Dg,kg,ne,{unfolded:0,iconUrl:1,foldDelay:2},xg)}}function Sg(i){ae(i,"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+IYuD93ywrJAIhFJX8M8zoBHzz757utHvwTETJHJPfGQZfWJXIL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GiLFdwVzRbCXTf5tg11mvhYdufZbLUr11XEi/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 zg(i){let t,e,n,o,s,r,a;return e=new Ve({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){t=j("div"),ee(e.$$.fragment),n=_(),o=j("div"),s=_(),r=j("div"),b(o,"class","small-point svelte-jzvcn0"),R(o,"transition-delay",i[2]?i[1]+"ms":"0ms"),b(r,"class","big-point svelte-jzvcn0"),R(r,"transition-delay",i[2]?i[1]+"ms":"0ms"),b(t,"class","point svelte-jzvcn0"),q(t,"unfolded",i[0]),q(t,"folded",i[2])},m(l,c){B(l,t,c),K(e,t,null),Q(t,n),Q(t,o),Q(t,s),Q(t,r),a=!0},p(l,[c]){c&6&&R(o,"transition-delay",l[2]?l[1]+"ms":"0ms"),c&6&&R(r,"transition-delay",l[2]?l[1]+"ms":"0ms"),(!a||c&1)&&q(t,"unfolded",l[0]),(!a||c&4)&&q(t,"folded",l[2])},i(l){a||(D(e.$$.fragment,l),a=!0)},o(l){T(e.$$.fragment,l),a=!1},d(l){l&&M(t),$(e)}}}function Mg(i,t,e){let n,{unfolded:o}=t,{foldDelay:s=800}=t;return i.$$set=r=>{"unfolded"in r&&e(0,o=r.unfolded),"foldDelay"in r&&e(1,s=r.foldDelay)},i.$$.update=()=>{i.$$.dirty&1&&e(2,n=!o)},[o,s,n]}class Tg extends oe{constructor(t){super(),ie(this,t,Mg,zg,ne,{unfolded:0,foldDelay:1},Sg)}}function Bg(i){ae(i,"svelte-8en2lj",".point-click-helper.svelte-8en2lj{position:absolute;width:2.5rem;height:2.5rem;left:50%;top:50%;transform:translate(-50%, -50%)}")}function Sr(i){let t,e,n=i[0].contentType!==We.Link&&zr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,s){o[0].contentType!==We.Link?n?(n.p(o,s),s&1&&D(n,1)):(n=zr(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function zr(i){let t,e,n,o,s,r;const a=[Qg,jg],l=[];function c(u,d){var h,p,m,g;return((p=(h=u[0].style)==null?void 0:h.point)==null?void 0:p.style)==="CustomIcon"&&((g=(m=u[0].style)==null?void 0:m.point)==null?void 0:g.iconUrl)?0:1}return n=c(i),o=l[n]=a[n](i),{c(){t=j("div"),e=_(),o.c(),s=fe(),b(t,"class","point-click-helper svelte-8en2lj")},m(u,d){B(u,t,d),B(u,e,d),l[n].m(u,d),B(u,s,d),r=!0},p(u,d){let h=n;n=c(u),n===h?l[n].p(u,d):(le(),T(l[h],1,1,()=>{l[h]=null}),ce(),o=l[n],o?o.p(u,d):(o=l[n]=a[n](u),o.c()),D(o,1),o.m(s.parentNode,s))},i(u){r||(D(o),r=!0)},o(u){T(o),r=!1},d(u){u&&M(t),u&&M(e),l[n].d(u),u&&M(s)}}}function jg(i){let t,e;return t=new Tg({props:{unfolded:i[0].state.unfolded,foldDelay:i[1]}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.unfolded=n[0].state.unfolded),o&2&&(s.foldDelay=n[1]),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Qg(i){let t,e;return t=new Lg({props:{iconUrl:i[0].style.point.iconUrl,unfolded:i[0].state.unfolded,foldDelay:i[1]}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.iconUrl=n[0].style.point.iconUrl),o&1&&(s.unfolded=n[0].state.unfolded),o&2&&(s.foldDelay=n[1]),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Rg(i){var o,s,r;let t,e,n=((o=i[0].pointTagStyle)==null?void 0:o.leftPercent)&&((s=i[0].pointTagStyle)==null?void 0:s.topPercent)&&i[0].enabled!==!1&&i[0].state&&((r=i[0].temporaryState)==null?void 0:r.visible)!==!1&&Sr(i);return{c(){n&&n.c(),t=fe()},m(a,l){n&&n.m(a,l),B(a,t,l),e=!0},p(a,[l]){var c,u,d;((c=a[0].pointTagStyle)==null?void 0:c.leftPercent)&&((u=a[0].pointTagStyle)==null?void 0:u.topPercent)&&a[0].enabled!==!1&&a[0].state&&((d=a[0].temporaryState)==null?void 0:d.visible)!==!1?n?(n.p(a,l),l&1&&D(n,1)):(n=Sr(a),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(a){e||(D(n),e=!0)},o(a){T(n),e=!1},d(a){n&&n.d(a),a&&M(t)}}}function Og(i,t,e){let n,{tag:o}=t;return i.$$set=s=>{"tag"in s&&e(0,o=s.tag)},i.$$.update=()=>{var s,r;i.$$.dirty&1&&e(1,n=(r=(s=o.style)==null?void 0:s.foldedPointDelay)!=null?r:o.contentType===We.Marketing?600:void 0)},[o,n]}class Hg extends oe{constructor(t){super(),ie(this,t,Og,Rg,ne,{tag:0},Bg)}}function Fg(i){ae(i,"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 Mr(i){let t,e;return t=new _a({props:{mediaStore:i[4],withAnimation:i[0],tag:ze(i[1]),hooks:i[2],state:i[3],temporaryState:i[5]}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&16&&(s.mediaStore=n[4]),o&1&&(s.withAnimation=n[0]),o&2&&(s.tag=ze(n[1])),o&4&&(s.hooks=n[2]),o&8&&(s.state=n[3]),o&32&&(s.temporaryState=n[5]),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Tr(i){let t,e,n,o,s;return e=new Hg({props:{tag:i[1]}}),{c(){t=j("div"),ee(e.$$.fragment),b(t,"class","point svelte-1vzhbu2")},m(r,a){B(r,t,a),K(e,t,null),n=!0,o||(s=Pe(t,"click",_i(i[11])),o=!0)},p(r,a){const l={};a&2&&(l.tag=r[1]),e.$set(l)},i(r){n||(D(e.$$.fragment,r),n=!0)},o(r){T(e.$$.fragment,r),n=!1},d(r){r&&M(t),$(e),o=!1,s()}}}function Gg(i){var l,c;let t,e,n,o,s,r=i[1].dimensionType===Xe.Two&&Mr(i),a=i[1].pointType===Ge.PointTag&&((c=(l=i[1].style)==null?void 0:l.point)==null?void 0:c.style)!=="noPoint"&&Tr(i);return{c(){t=j("div"),r&&r.c(),e=_(),a&&a.c(),b(t,"class",n=Se(`wrapper tag-${i[1].contentType}`)+" svelte-1vzhbu2"),b(t,"data-id",o=i[1].id),q(t,"hide",i[10]),q(t,"unfolded",i[6]),R(t,"left",i[9]),R(t,"top",i[8]),R(t,"z-index",i[7])},m(u,d){B(u,t,d),r&&r.m(t,null),Q(t,e),a&&a.m(t,null),s=!0},p(u,[d]){var h,p;u[1].dimensionType===Xe.Two?r?(r.p(u,d),d&2&&D(r,1)):(r=Mr(u),r.c(),D(r,1),r.m(t,e)):r&&(le(),T(r,1,1,()=>{r=null}),ce()),u[1].pointType===Ge.PointTag&&((p=(h=u[1].style)==null?void 0:h.point)==null?void 0:p.style)!=="noPoint"?a?(a.p(u,d),d&2&&D(a,1)):(a=Tr(u),a.c(),D(a,1),a.m(t,null)):a&&(le(),T(a,1,1,()=>{a=null}),ce()),(!s||d&2&&n!==(n=Se(`wrapper tag-${u[1].contentType}`)+" svelte-1vzhbu2"))&&b(t,"class",n),(!s||d&2&&o!==(o=u[1].id))&&b(t,"data-id",o),(!s||d&1026)&&q(t,"hide",u[10]),(!s||d&66)&&q(t,"unfolded",u[6]),d&512&&R(t,"left",u[9]),d&256&&R(t,"top",u[8]),d&128&&R(t,"z-index",u[7])},i(u){s||(D(r),D(a),s=!0)},o(u){T(r),T(a),s=!1},d(u){u&&M(t),r&&r.d(),a&&a.d()}}}function Ng(i,t,e){let n,o,s,r,a,l,{withAnimation:c=!1}=t,{tag:u}=t,{hooks:d}=t,{state:h}=t,{mediaStore:p}=t,{temporaryState:m}=t,g,A=!1;function v(y){g!==void 0&&clearTimeout(g),A=!0,g=setTimeout(()=>{A=!1},800)}const w=y=>{A||d.emit("click",{event:y,target:"TagPoint",tag:u})};return i.$$set=y=>{"withAnimation"in y&&e(0,c=y.withAnimation),"tag"in y&&e(1,u=y.tag),"hooks"in y&&e(2,d=y.hooks),"state"in y&&e(3,h=y.state),"mediaStore"in y&&e(4,p=y.mediaStore),"temporaryState"in y&&e(5,m=y.temporaryState)},i.$$.update=()=>{var y,x,L,C;i.$$.dirty&2&&e(12,n=(y=u.state)==null?void 0:y.visible),i.$$.dirty&4096&&e(10,o=!n),i.$$.dirty&2&&e(6,s=(x=u.state)==null?void 0:x.unfolded),i.$$.dirty&2&&e(9,r=((L=u.pointTagStyle)==null?void 0:L.leftPercent)+"%"),i.$$.dirty&2&&e(8,a=((C=u.pointTagStyle)==null?void 0:C.topPercent)+"%"),i.$$.dirty&2&&e(7,l=u.contentType===We.Link?1:0),i.$$.dirty&64&&v()},[c,u,d,h,p,m,s,l,a,r,o,w,n]}class Wg extends oe{constructor(t){super(),ie(this,t,Ng,Gg,ne,{withAnimation:0,tag:1,hooks:2,state:3,mediaStore:4,temporaryState:5},Fg)}}function Xg(i){ae(i,"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 Br(i,t,e){const n=i.slice();return n[6]=t[e],n}function jr(i){let t,e=[],n=new Map,o,s=i[1];const r=a=>a[6].id;for(let a=0;a<s.length;a+=1){let l=Br(i,s,a),c=r(l);n.set(c,e[a]=Qr(c,l))}return{c(){t=j("div");for(let a=0;a<e.length;a+=1)e[a].c();b(t,"class","tag--container svelte-1eci49s"),q(t,"hide",!i[3].visible||!i[5].visible),q(t,"withAnimation",i[0])},m(a,l){B(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,l){l&63&&(s=a[1],le(),e=Ue(e,l,r,1,a,s,n,t,at,Qr,null,Br),ce()),(!o||l&40)&&q(t,"hide",!a[3].visible||!a[5].visible),(!o||l&1)&&q(t,"withAnimation",a[0])},i(a){if(!o){for(let l=0;l<s.length;l+=1)D(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)T(e[l]);o=!1},d(a){a&&M(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function Qr(i,t){let e,n,o,s;const r=[{tag:t[6],hooks:t[2],state:t[3],mediaStore:t[4],temporaryState:t[5],withAnimation:t[0]}];let a={};for(let l=0;l<r.length;l+=1)a=we(a,r[l]);return n=new Wg({props:a}),{key:i,first:null,c(){var l,c,u;e=j("div"),ee(n.$$.fragment),o=_(),b(e,"class","tag svelte-1eci49s"),q(e,"hide",!((l=t[6].pointTagStyle)!=null&&l.leftPercent)||!((c=t[6].pointTagStyle)!=null&&c.topPercent)||t[6].enabled===!1||!t[6].state||((u=t[6].temporaryState)==null?void 0:u.visible)===!1),this.first=e},m(l,c){B(l,e,c),K(n,e,null),Q(e,o),s=!0},p(l,c){var d,h,p;t=l;const u=c&63?je(r,[{tag:t[6],hooks:t[2],state:t[3],mediaStore:t[4],temporaryState:t[5],withAnimation:t[0]}]):{};n.$set(u),(!s||c&2)&&q(e,"hide",!((d=t[6].pointTagStyle)!=null&&d.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(l){s||(D(n.$$.fragment,l),s=!0)},o(l){T(n.$$.fragment,l),s=!1},d(l){l&&M(e),$(n)}}}function Yg(i){let t,e,n=i[3].enabled&&jr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[3].enabled?n?(n.p(o,s),s&8&&D(n,1)):(n=jr(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Ug(i,t,e){let{withAnimation:n=!1}=t,{tags:o=[]}=t,{hooks:s}=t,{state:r}=t,{mediaStore:a}=t,{temporaryState:l}=t;return i.$$set=c=>{"withAnimation"in c&&e(0,n=c.withAnimation),"tags"in c&&e(1,o=c.tags),"hooks"in c&&e(2,s=c.hooks),"state"in c&&e(3,r=c.state),"mediaStore"in c&&e(4,a=c.mediaStore),"temporaryState"in c&&e(5,l=c.temporaryState)},[n,o,s,r,a,l]}class Vg extends oe{constructor(t){super(),ie(this,t,Ug,Yg,ne,{withAnimation:0,tags:1,hooks:2,state:3,mediaStore:4,temporaryState:5},Xg)}}const Jg={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 _g extends ai{constructor(e){super(e);f(this,"tagCacheByPanoIndex",{})}getCaches({panoIndex:e,id:n,key:o}){var c,u,d,h;const{five:s}=this,r=(c=s.panoIndex)!=null?c:e;if(r===void 0)throw new Error(`TagCacheController getCache(): fivePanoIndex is ${r}`);const a=`${(d=(u=s.work)==null?void 0:u.workCode)!=null?d:s.model.uuid}-${r}`;let l=this.tagCacheByPanoIndex[a];if(l||(l=new Map,this.tagCacheByPanoIndex[a]=l),n===void 0)return l;if(o===void 0){const p=l.get(n);return p||(l.set(n,{}),l.get(n))}return(h=l.get(n))==null?void 0:h[o]}clearCache(){this.tagCacheByPanoIndex={}}}class Zg extends _g{constructor(e){super(e);f(this,"tags",[]);f(this,"config",Jg);f(this,"raycaster",new E.Raycaster)}getTagById(e){const n=this.tags.find(o=>o.id===e);if(!n){console.error(`getTagById(): tag is ${n}, id is ${e}`);return}return n}changeConfig(e,n=!0){n?this.config=Lt.default({},this.config,e):this.config=e,this.clearCache()}changeGlobalConfig(e,n=!0){n?this.config.globalConfig=Lt.default({},this.config.globalConfig,e):this.config.globalConfig=e,this.clearCache()}changeContentTypeConfig(e,n,o=!0){this.config.contentTypeConfig||(this.config.contentTypeConfig={}),o?this.config.contentTypeConfig[e]=Lt.default({},this.config.contentTypeConfig[e],n):this.config.contentTypeConfig[e]=n,this.clearCache()}getVisibleByPanoIndex(e,n){var r;const o=this.getCaches({panoIndex:n,id:e.id}),s=(r=this.five.panoIndex)!=null?r:n;if(o.visible!==void 0)return o.visible;{const a=(()=>{var u,d,h,p,m;const l=(u=this.getTagConfig(e).visibleConfig)!=null?u:{},c=this.getDistance(e);if(typeof l=="function")return l(this.five,{tag:e,distance:c});if(l.keep==="hidden")return!1;if(l.keep==="visible")return!0;if(l.visiblePanoIndex!==void 0&&(s===void 0||!l.visiblePanoIndex.includes(s))||l.visibleDistance!==void 0&&l.visibleDistance!=="unLimited"&&Tn(c,l.visibleDistance)===!1)return!1;if(((d=l.intersectRaycaster)==null?void 0:d.enabled)!==!1){if(s===void 0)return!1;const g=(h=this.five.work.observers[s])==null?void 0:h.position;if(g===void 0)throw new Error(`getVisible(): observerPosition is ${g}`);const A=Mn(e.position).sub(g).normalize();this.raycaster.set(g,A);const[v]=this.five.model.intersectRaycaster(this.raycaster),w=(m=(p=l.intersectRaycaster)==null?void 0:p.distanceAccuracy)!=null?m:.01;if(v&&v.distance+w<c)return!1}return!(l.angleRange&&e.dimensionType===Xe.Three&&Tn(this.getAngle(e),l.angleRange)===!1)})();return o.visible=a,o.visible}}getUnfoldedByPanoIndex(e,n){if(!this.getVisibleByPanoIndex(e))return;const s=this.getCaches({panoIndex:n,id:e.id});if(s.unfolded!==void 0)return s.unfolded;{const r=this.getTagConfig(e).unfoldedConfig;if(!r)return;const a=(()=>{const c=this.getDistance(e);if(typeof r=="function")return r(this.five,{tag:e,distance:c});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.disableUnfold===!0)return!1;if(r.disableFold===!0)return!0;if(r.unfoldDistance&&Tn(c,r.unfoldDistance)===!1)return!1})();s.unfolded=a;const l=this.getUnfoldedByCamera(e);return l!==void 0?l:s.unfolded}}getUnfoldedByCamera(e){return this.getVisibleByPanoIndex(e)?(()=>{var a;const s=this.getDistance(e),r=this.getTagConfig(e).unfoldedConfig;if(!!r){if(typeof r=="function")return r(this.five,{tag:e,distance:s});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.disableUnfold===!0)return!1;if(r.disableFold===!0)return!0;if(r.autoUnfold===void 0)return;if(r.autoUnfold.strategy==="ScreenPostion"){const l=this.getTagProject(e);if(l&&Tn(l.x,r.autoUnfold.autoUnfoldProjectX)===!1)return!1}if(r.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:m,y:g,z:A}=p;return!(Math.abs(A)>1||Math.abs(m)>1||Math.abs(g)>1)}).filter(h=>{var m;const p=this.getTagConfig(h).unfoldedConfig;return typeof p=="object"&&((m=p.autoUnfold)==null?void 0:m.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<=((a=r.autoUnfold.maxNumber)!=null?a:1)-1===!1)return!1}return!0}})():void 0}getDistance(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCaches({panoIndex:n,id:e.id});if(s.distance!==void 0)return s.distance;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getDistance(): observerPosition is ${c}`);const u=(()=>e.pointType===Ge.PointTag?st(e==null?void 0:e.position):Mn(e.position))(),d=c.distanceTo(u);return s.distance=d,d}}getAngle(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCaches({panoIndex:n,id:e.id});if(s.angle!==void 0)return s.angle;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getAngleRange(): observerPosition is ${c}`);const u=(()=>e.pointType===Ge.PointTag?hn(e.normal):Na(e.position))();if(!u)return;const d=new E.Vector3().copy(c).sub(Mn(e.position)),h=u.angleTo(d)*180/Math.PI;return s.angle=h,s.angle}}getTagConfig(e){var s;if(!e)return(s=this.config.globalConfig)!=null?s:{};const n={};return this.config.contentTypeConfig&&Object.keys(this.config.contentTypeConfig).forEach(r=>{const a=r;if(n[a])return;const l=a.split("-"),[c="Any",u="Any",d="Any"]=l||[];(e.dimensionType===c||c==="Any")&&(e.contentType===u||u==="Any")&&(e.pointType===d||d==="Any")&&(n[a]=this.config.contentTypeConfig[a])}),Lt.default({},this.config.globalConfig,...Object.values(n),e.config)}canBe(e,n){const o=this.getTagConfig(n);if(!o||typeof o!="object")return!0;if(e==="show"||e==="hide"){if(!o.visibleConfig||typeof o.visibleConfig!="object")return!0;if(e==="show"&&o.visibleConfig.keep==="hidden"||e==="hide"&&(o.visibleConfig.keep==="visible"||o.visibleConfig.alwaysShowWhenMovePano))return!1}if(e==="fold"||e==="unfold"){if(!o.unfoldedConfig||typeof o.unfoldedConfig!="object")return!0;if(e==="fold"&&(o.unfoldedConfig.disableFold||o.unfoldedConfig.keep==="unfolded")||e==="unfold"&&(o.unfoldedConfig.disableUnfold||o.unfoldedConfig.keep==="folded"))return!1}return!0}setPointTagPosition(){const e=this.filterPointTag();e.length!==0&&e.forEach(n=>{var s;if(!((s=n.state)!=null&&s.visible)){n.pointTagStyle=void 0;return}const o=this.getTagProject(n);if(!o){n.pointTagStyle=void 0;return}n.pointTagStyle={leftPercent:(o.x+1)/2*100,topPercent:(-o.y+1)/2*100}})}setVisibleByPanoIndex(){this.tags.forEach(e=>{const n=this.getVisibleByPanoIndex(e);e.state&&(e.state.visible=n)})}setUnfoldedByPanoIndex(){this.tags.forEach(e=>{const n=this.getUnfoldedByPanoIndex(e);if(!!e.state&&(n!==void 0&&(e.state.unfolded=n),n&&!e.state.visible)){const o=this.getTagConfig(e);typeof o.unfoldedConfig=="object"&&o.unfoldedConfig.autoUnfoldWhenHide!==!1&&(e.state.unfolded=!1)}})}getTagProject(e){if(!this.getVisibleByPanoIndex(e))return;const o=Mn(e.position),{x:s,y:r,z:a}=o.project(this.five.camera);if(!(a>1))return{x:s,y:r,z:a}}filterPointTag(){return this.tags.filter(e=>e.pointType===Ge.PointTag)}filterTag2D(){return this.tags.filter(e=>e.dimensionType===Xe.Two)}filter3DPointTag(){return this.tags.filter(e=>e.dimensionType===Xe.Three&&e.pointType===Ge.PointTag)}filter3DTag(){return this.tags.filter(e=>e.dimensionType===Xe.Three)}filterPlaneTag(){return this.tags.filter(e=>e.dimensionType===Xe.Three&&e.pointType===Ge.PlaneTag)}}const Za="1.2.6",Xi=`DnalogelPlugin-PanoTagPlugin@${Za}`,qg=!1,Kg=i=>`${Xi}--${i}`;class qa extends Zg{constructor(e,n){super(e);f(this,"version",Za);f(this,"state",{enabled:!0,visible:!0});f(this,"params");f(this,"debug");f(this,"css3DRenderPlugin");f(this,"TagContainerSvelte");f(this,"temporaryState",{visible:!0});f(this,"mediaStore",$i({currentMediaUrl:""}));f(this,"store",{disposers:[],disposed:!1,resizeObserverDisposerAdding:!1,css3DRenderDisposer:new Map});f(this,"staticUrl");f(this,"disposedErrorLog",()=>{console.error(`${Xi} is disposed`)});this.params=N({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 s;const o=this.params.staticConfig;if(typeof o=="string")return o;{const r=o.protocol?o.protocol+":":"",a=(s=o.host)!=null?s:"vrlab-static.ljcdn.com",l=o.port?":"+o.port:"";return`${r}//${a}${l}`}})(),Object.assign(window,{__PANOTAGPLUGIN_DEBUG__:this})}load(e,n){var o,s;this.clearTags(),console.log(Xi,"load:",{data:e}),this.params.mergePluginDefaultConfigToLoadDataConfig?this.config=Lt.default({},this.config,{globalConfig:(o=e.globalConfig)!=null?o:{},contentTypeConfig:(s=e.contentTypeConfig)!=null?s:{}}):(e.globalConfig&&(this.config.globalConfig=e.globalConfig),e.contentTypeConfig&&(this.config.contentTypeConfig=e.contentTypeConfig)),this.addTag(e.tagList,n),this.debug&&zm(this.five,this.tags)}addTag(e,n){const s=(Array.isArray(e)?e:[e]).map(r=>{const a=this.getTagConfig(r);return he(N({},r),{state:N({visible:void 0,unfolded:qg},a.initialState),hooks:new be.Subscribe,clickable:a.clickable})}).filter(r=>r.position);this.tags.push(...s),Mm(this.five,()=>{var r,a,l;this.store.eventListenerDisposer&&((a=(r=this.store).eventListenerDisposer)==null||a.call(r)),this.state.enabled&&(this.store.eventListenerDisposer=this.addEventListener()),this.addResizeListener(),this.checkPanelTag(),this.setVisibleAndUnfolded({withAnimation:(l=n==null?void 0:n.withAnimation)!=null?l:!0}).then(()=>this.updateRenderAllTags()),this.updateRenderAllTags()})}clearTags(){this.tags=[],this.clearCache(),this.disposeAllCSS3DContainer(),this.updateRenderAllTags()}show(e){return J(this,null,function*(){const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({visible:!0},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("show",{userAction:n,withAnimation:o})})}hide(e){return J(this,null,function*(){const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({visible:!1},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("hide",{userAction:n,withAnimation:o})})}enable(e){const{userAction:n=!0}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.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,o,s,r,a;this.disposeAllCSS3DContainer(),(e=this.TagContainerSvelte)==null||e.$destroy(),this.filter3DTag().forEach(l=>{var c;return(c=l.tag3DContentSvelte)==null?void 0:c.svelteApp.$destroy()}),this.tags=[],(n=this.store.disposers)==null||n.forEach(l=>l==null?void 0:l()),this.store.disposers=[],this.store.disposed=!0,(s=(o=this.store).eventListenerDisposer)==null||s.call(o),this.store.eventListenerDisposer=void 0,(a=(r=this.store).resizeObserverDisposer)==null||a.call(r),this.store.resizeObserverDisposer=void 0,this.store.resizeObserverDisposerAdding=!1,this.clearCache(),this.hooks.emit("dispose")}setState(e,n){if(this.store.disposed)return this.disposedErrorLog();const{userAction:o=!0,visibleWithAnimation:s=!1}=n,r=N({},this.state);this.state=Object.assign(this.state,e),this.store.visibleWithAnimation=s,r.visible!==this.state.visible&&(e.visible?this.handleShow():this.handleHide()),r.enabled!==this.state.enabled&&(e.enabled?this.handleEnable():this.handleDisable()),this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:o})}changeTagNormalById(e,n){const o=this.getTagById(e);!o||!o.tag3DContentSvelte||(o.tag3DContentSvelte.currentNormal=st(n),this.updateRenderPlaneTag())}changeDataById(e,n,o=!0){const s=this.getTagById(e);!s||(o?s.data=Lt.default({},s.data,n):Object.assign(s.data,n),this.checkPanelTag(),this.updateRenderAllTags())}changeTagById(e,n,o=!0){const s=this.getTagById(e);!n||(o?Lt.default(s,n):Object.assign(s,n),(s==null?void 0:s.tag3DContentSvelte)&&(n==null?void 0:n.normal)&&(s.tag3DContentSvelte.currentNormal=st(n.normal)),this.updateRenderAllTags(),this.checkPanelTag())}destroyTagById(e){(Array.isArray(e)?e:[e]).forEach(o=>{const s=this.tags.findIndex(r=>r.id===o);s!==-1&&this.tags.splice(s,1)}),this.updateRenderAllTags()}pauseCurrentMedia(){this.mediaStore.set({currentMediaUrl:""})}setVisibleAndUnfolded(){return J(this,arguments,function*({withAnimation:e}={withAnimation:!1}){return this.setVisibleByPanoIndex(),e?new Promise((n,o)=>{setTimeout(()=>{this.setUnfoldedByPanoIndex(),n()},10)}):(this.setUnfoldedByPanoIndex(),Promise.resolve())})}handleShow(){this.state.visible=!0,this.updateTagContainerVisible()}handleHide(){this.state.visible=!1,this.updateTagContainerVisible()}handleEnable(){this.state.enabled=!0,this.store.eventListenerDisposer=this.addEventListener(),this.updateRenderAllTags()}handleDisable(){var e,n,o;this.state.enabled=!1,(n=(e=this.store).eventListenerDisposer)==null||n.call(e),(o=this.TagContainerSvelte)==null||o.$set({tags:[]}),this.filter3DTag().forEach(s=>{var r;(r=s.tag3DContentSvelte)==null||r.svelteApp.$destroy(),s.tag3DContentSvelte=void 0})}addEventListener(){const{five:e,hooks:n}=this,o=this.handleFiveWantsMoveToPano.bind(this),s=this.handleFiveModeChange.bind(this),r=this.handleFiveCameraUpdate.bind(this),a=this.handleFiveCameraUpdateDebounce(),l=this.handleFivePanoArrived.bind(this),c=this.clickhandler.bind(this);return e.on("wantsMoveToPano",o),e.on("modeChange",s),e.on("cameraUpdate",r),e.on("cameraUpdate",a),e.on("panoArrived",l),n.on("click",c),()=>{e.off("wantsMoveToPano",o),e.off("modeChange",s),e.off("cameraUpdate",r),e.off("cameraUpdate",a),e.off("panoArrived",l),n.off("click",c),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())},o=()=>{!this.state.enabled||this.hide()},{observe:s,unobserve:r}=Rs(Bm(()=>{!this.store.resizeObserverDisposer||o()},500),e),{observe:a,unobserve:l}=Rs(Qs(()=>n(),400),e);return s(),a(),()=>{r(),l()}}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=he(N({},e.temporaryState),{visible:n.visibleConfig.keep==="visible"}):typeof n.visibleConfig=="object"&&n.visibleConfig.alwaysShowWhenMovePano?e.temporaryState=he(N({},e.temporaryState),{visible:!0}):e.temporaryState=he(N({},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),o=this.canBe("unfold",e.tag);n&&o&&(e.tag.state.unfolded=!e.tag.state.unfolded,e.tag.state.unfolded&&this.tags.forEach(s=>{s.id!==e.tag.id&&s.state&&this.canBe("fold",s)&&(s.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 o;(o=n.tag3DContentSvelte)==null||o.svelteApp.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation})})}handleFiveCameraUpdateDebounce(){return Qs(()=>{this.setUnfoldedByCamera(),this.updateRenderAllTags()},100)}handleFiveCameraUpdate(){this.updateRenderPointTag()}handleFivePanoArrived(){return J(this,null,function*(){yield this.setVisibleAndUnfolded(),this.tags.forEach(e=>{e.temporaryState=he(N({},e.temporaryState),{visible:!0})}),this.updateRenderAllTags()})}setUnfoldedByCamera(){let e=!1;this.tags.forEach(n=>{const o=this.getUnfoldedByCamera(n);!n.state||o!==void 0&&(o===!0&&(e=!0),n.state.unfolded=o)}),e&&this.tags.forEach(n=>{const o=this.getTagConfig(n).unfoldedConfig;typeof o=="object"&&(o.autoUnfold||o.disableFold||o.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 o=(n=this.five.getElement())==null?void 0:n.parentElement;if(!o)return console.error("updateRenderPlaneTag: tag2DContainer not found");this.TagContainerSvelte=new Vg({target:o,props:{hooks:this.hooks,tags:e,state:this.state,temporaryState:this.temporaryState,mediaStore:this.mediaStore}})}}updateRenderPlaneTag(){[...this.filterPlaneTag(),...this.filter3DPointTag()].forEach(n=>{var o;if(n.tag3DContentSvelte){const{svelteApp:s,domContainer:r,initialNormal:a,currentNormal:l}=n.tag3DContentSvelte;if(s.$set({tag:n,hooks:this.hooks,state:this.state,temporaryState:this.temporaryState}),!a.equals(l)){const c=new F.Quaternion().setFromUnitVectors(a,l);r.css3DObject.setRotationFromQuaternion(c)}}else{if(((o=n.state)==null?void 0:o.visible)===!1)return;if(this.css3DRenderPlugin||(this.css3DRenderPlugin=Kt(this.five)),n.pointType===Ge.PointTag&&!n.normal)return console.error("updateRenderPlaneTag: \u4E09\u7EF4\u70B9\u6807\u7B7E\u7F3A\u5C11\u6CD5\u5411\u91CF\uFF01");const s=n.pointType===Ge.PlaneTag?n.position:Tm(this.five.camera.position,st(n.position),st(n.normal)),r=n.pointType===Ge.PlaneTag?Na(n.position):st(n.normal),a=this.getTagConfig(n).tag3DConfig,l=this.css3DRenderPlugin.create3DDomContainer(s,a);if(!l)return;this.store.css3DRenderDisposer.set(n.id,l.dispose),n.tag3DContentSvelte={svelteApp:new _a({target:l.container,props:{tag:n,hooks:this.hooks,state:this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}}),domContainer:l,initialNormal:r,currentNormal:r}}}),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===Xe.Two&&e.pointType===Ge.PointTag&&((n=e.tag3DContentSvelte)==null||n.domContainer.dispose(),e.tag3DContentSvelte=void 0)});for(const[e,n]of this.store.css3DRenderDisposer){const o=this.getTagById(e);(!o||o.dimensionType!==Xe.Three)&&(n==null||n(),this.store.css3DRenderDisposer.delete(e))}}}const $g=(i,t)=>new qa(i,t);class co extends F.Object3D{constructor(e,n){var o;super();f(this,"originObject3D");f(this,"onRender");this.originObject3D=e,this.onRender=(o=n==null?void 0:n.onRender)!=null?o:()=>{}}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 e0 extends co{}class t0 extends co{}class n0 extends co{}class i0 extends n0{}class o0 extends E.Group{constructor(e){super();f(this,"direction");this.direction=e||"x"}}class Rr extends E.Mesh{constructor(e,n,o){super(e,n);f(this,"direction");this.direction=o||"x"}}function s0(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return Object.assign(new E.Vector2,{x:(i.x-s)/e*2-1,y:-(i.y-o)/n*2+1})}function uo(i,t,e){if(!t||!e||!i)return;const n=s0(t,e);if(Math.abs(n.x)===1||Math.abs(n.y)===1)return;const o=new E.Raycaster;return o.setFromCamera(n,i),o}function r0(i,t){return!(Math.abs(i.x-t.x)>1e-5||Math.abs(i.y-t.y)>1e-5||Math.abs(i.z-t.z)>1e-5)}class Ii extends o0{constructor(e){var u;super(e.direction);f(this,"line");f(this,"arrow");f(this,"lineHeight",.4);f(this,"arrowHeight",.1);this.name="ArrowGroup";const n=new E.Color((u=e.color)!=null?u:16214315),o=new E.MeshBasicMaterial({color:n,depthTest:!1,opacity:1,transparent:!0,side:E.DoubleSide}),s=new E.ConeGeometry(.04,.1,32),r=new Rr(s,o.clone(),e.direction);r.name=`arrow-${e.direction}`,this.arrow=r;const a=.004,l=new E.CylinderGeometry(a,a,.4,32),c=new Rr(l,o.clone(),e.direction);c.name=`line-${e.direction}`,this.line=c,this.formatArrow(),this.formatLine(),this.add(this.arrow,this.line)}formatArrow(){this.arrow.geometry.translate(0,this.lineHeight+this.arrowHeight/2,0),this.direction==="x"?(this.arrow.geometry.rotateX(Math.PI/2),this.arrow.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.arrow.geometry.rotateX(Math.PI/2)}formatLine(){this.line.geometry.translate(0,this.lineHeight/2,0),this.direction==="x"?(this.line.geometry.rotateX(Math.PI/2),this.line.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.line.geometry.rotateX(Math.PI/2)}}const xi={X:15618642,Y:4765519,Z:4227839};class ot{static get X(){return new E.Color(xi.X).convertSRGBToLinear().clone()}static get Y(){return new E.Color(xi.Y).convertSRGBToLinear().clone()}static get Z(){return new E.Color(xi.Z).convertSRGBToLinear().clone()}}class a0 extends e0{constructor(e){super(e);f(this,"xArrow",new Ii({direction:"x",color:ot.X}));f(this,"yArrow",new Ii({direction:"y",color:ot.Y}));f(this,"zArrow",new Ii({direction:"z",color:ot.Z}));this.add(this.xArrow),this.add(this.yArrow),this.add(this.zArrow)}show(){super.show(),this.xArrow.visible=!0,this.yArrow.visible=!0,this.zArrow.visible=!0}showDraggingHelper(e){this.xArrow.visible=e.includes("x"),this.yArrow.visible=e.includes("y"),this.zArrow.visible=e.includes("z")}dispose(){this.remove(this.xArrow,this.yArrow,this.zArrow)}}function Mt(i,t){return l0(document.createElement(t!=null?t:"div"),i)}function l0(i,t){if(!t)return i;for(const e in t)e&&t[e]&&(i.style[e]=t[e]);return i}function c0(i){const t=Mt(N({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},i)),e=()=>{t.style.display!=="block"&&(!t.style.top||!t.style.left||(t.style.display="block"))};return{element:t,show:e,hide:()=>{t.style.display="none",t.style.top="",t.style.left=""},setLeftTop:(s,r)=>{t.style.left=s,t.style.top=r,e()}}}class u0 extends t0{constructor(e,n){var o;super(e);f(this,"yzCircle",new ki({direction:"x",color:ot.X}));f(this,"xzCircle",new ki({direction:"y",color:ot.Y}));f(this,"xyCircle",new ki({direction:"z",color:ot.Z}));f(this,"xRingHelper",new Di({direction:"x"}));f(this,"yRingHelper",new Di({direction:"y"}));f(this,"zRingHelper",new Di({direction:"z"}));f(this,"xAngleHelper",new Li({direction:"x",color:ot.X}));f(this,"yAngleHelper",new Li({direction:"y",color:ot.Y}));f(this,"zAngleHelper",new Li({direction:"z",color:ot.Z}));f(this,"angleTips");f(this,"container");n&&(this.container=n==null?void 0:n.container,this.angleTips=c0({display:"none"}),(o=this.container)==null||o.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 ki extends E.Mesh{constructor(e){var n;super();f(this,"direction");f(this,"gapAngle",.02);f(this,"geometry",new E.RingGeometry(.25,.3,20,8,this.gapAngle,Math.PI/2-this.gapAngle*2));this.material=new E.MeshBasicMaterial({opacity:.6,color:(n=e.color)!=null?n:16777215,transparent:!0,side:E.DoubleSide,depthTest:!1}),this.direction=e.direction,this.geometry.name=`RotateHelperCircleGeometry-${this.direction}`,this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}class Di extends E.Group{constructor(e){super();f(this,"direction");this.direction=e.direction;const n=.015,o=new Array(8).fill(null).map((s,r)=>{const a=new E.RingGeometry(.25,.3,20,8,Math.PI/4*r+n,Math.PI/4-n*2),l=new E.MeshBasicMaterial({opacity:1,color:16777215,depthTest:!1,transparent:!0,side:E.DoubleSide}),c=new E.Mesh(a,l);return c.name=`AxesDashedRing-${this.direction}-${r}`,c});this.add(...o),this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}class Li extends E.Mesh{constructor(e){var o;super();f(this,"direction");f(this,"baseAxes");switch(e.direction){case"x":this.baseAxes=new E.Vector3(0,0,1);break;case"y":this.baseAxes=new E.Vector3(1,0,0);break;case"z":this.baseAxes=new E.Vector3(1,0,0);break}const n=.3+5e-4;this.geometry=new E.CircleGeometry(n,48,0,1e-4),this.material=new E.MeshBasicMaterial({opacity:.4,color:(o=e.color)!=null?o:16777215,depthTest:!1,transparent:!0,side:E.DoubleSide}),this.direction=e.direction,this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}function d0(){const i=Mt({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=Mt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=Mt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"absolute",border:"1px solid rgba(255,255,255,0.4)"});i.appendChild(t),t.appendChild(e);const n="-4px",o={direction:"nesw",element:dt({cursor:"nesw-resize",left:n,bottom:n})},s={direction:"ns",element:dt({cursor:"ns-resize",bottom:n})},r={direction:"nwse",element:dt({cursor:"nwse-resize",right:n,bottom:n})},a={direction:"ew",element:dt({cursor:"ew-resize",right:n})},l={direction:"nesw",element:dt({cursor:"nesw-resize",right:n,top:n})},c={direction:"ns",element:dt({cursor:"ns-resize",top:n})},u={direction:"nwse",element:dt({cursor:"nwse-resize",left:n,top:n})},d={direction:"ew",element:dt({cursor:"ew-resize",left:n})};return new Array(s,a,c,d,o,r,l,u).forEach(p=>t.appendChild(p.element)),{container:i,squares:[o,s,r,a,l,c,u,d]}}function dt(i){const t=Mt(N({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},i)),e=Mt({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),n=Mt({width:"15px",height:"15px",cursor:i==null?void 0:i.cursor,pointerEvents:"auto",background:"transparent"});return n.draggable=!0,e.appendChild(n),t.appendChild(e),t}class h0 extends i0{constructor(e,n,o,s){super(e);f(this,"points",[]);f(this,"cornerPositions",[]);f(this,"css3DInstance");f(this,"plane");f(this,"css3DRenderer",new Vt);f(this,"camera");f(this,"scene");f(this,"container");f(this,"enabled",!1);this.camera=o,this.scene=s,this.container=n,this.initRectangleScaleHelper()}get helperObject(){var e;if(!((e=this.css3DInstance)!=null&&e.css3DObject))throw new Error("css3DInstance is not initialized");return this.css3DInstance.css3DObject}updatePosition(){var e;this.helperObject.position.copy(this.originObject3D.position),(e=this.plane)==null||e.position.copy(this.originObject3D.position)}updateQuaternion(){var e;(e=this.plane)==null||e.quaternion.copy(this.originObject3D.quaternion)}applyMatrix4(e){var n;super.applyMatrix4(e),this.helperObject.applyMatrix4(e),(n=this.plane)==null||n.applyMatrix4(e),this.cornerPositions.forEach(o=>o.applyMatrix4(e))}showDraggingHelper(){}applyHelperScaleMatrix4(e,n){var o;(o=this.plane)==null||o.scale.applyMatrix4(e),this.helperObject.applyScaleMatrix4(e)}updatePoints(){const e=this.calculatePointPosition(this.cornerPositions);this.points.forEach((n,o)=>{n.position.copy(e[o])})}applyHelperQuaternion(e,n){var s;const o=(s=this.css3DInstance)==null?void 0:s.css3DObject;if(o){const r=new E.Vector3().subVectors(o.position,n).applyQuaternion(e).add(n);o.position.copy(r),o.applyQuaternion(e)}if(this.plane){const r=new E.Vector3().subVectors(this.plane.position,n).applyQuaternion(e).add(n);this.plane.position.copy(r),this.plane.applyQuaternion(e)}this.cornerPositions.forEach(r=>{const a=new E.Vector3().subVectors(r,n).applyQuaternion(e).add(n);r.copy(a)})}enable(){var e;this.enabled||(this.enabled=!0,(e=this.css3DInstance)==null||e.enable(),this.plane&&this.scene.add(this.plane))}disable(){var e;!this.enabled||(this.enabled=!1,(e=this.css3DInstance)==null||e.disable(),this.plane&&this.scene.remove(this.plane))}show(){var e;(e=this.css3DInstance)==null||e.show(),this.plane&&(this.plane.visible=!0)}hide(){var e;(e=this.css3DInstance)==null||e.hide(),this.plane&&(this.plane.visible=!1)}dispose(){this.disable(),this.css3DRenderer.dispose()}initRectangleScaleHelper(){var 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 o=n.css3DObject.container,{container:s,squares:r}=d0();this.points=r.map((d,h)=>({direction:d.direction,point:d.element,position:this.calculatePointPosition(e)[h]})),o.insertBefore(s,(u=o.children[0])!=null?u:null);const a=new E.PlaneGeometry(n.css3DObject.width,n.css3DObject.height),l=new E.MeshBasicMaterial({color:0,opacity:.15,transparent:!0,side:E.DoubleSide}),c=new E.Mesh(a,l);this.scene.add(c),this.updatePosition()}getCornerPositions(){const{originObject3D:e}=this;if(e instanceof un.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 E.Vector3;function pe(i,t){this._camera=i||null,this._domElement=t||document,this._raycaster=new E.Raycaster,this._selected=null,this._boundObjs={};var e=this;this._$onClick=function(){e._onClick.apply(e,arguments)},this._$onDblClick=function(){e._onDblClick.apply(e,arguments)},this._$onMouseMove=function(){e._onMouseMove.apply(e,arguments)},this._$onMouseDown=function(){e._onMouseDown.apply(e,arguments)},this._$onMouseUp=function(){e._onMouseUp.apply(e,arguments)},this._$onTouchMove=function(){e._onTouchMove.apply(e,arguments)},this._$onTouchStart=function(){e._onTouchStart.apply(e,arguments)},this._$onTouchEnd=function(){e._onTouchEnd.apply(e,arguments)},this._$onContextmenu=function(){e._onContextmenu.apply(e,arguments)},this._domElement.addEventListener("click",this._$onClick,!1),this._domElement.addEventListener("dblclick",this._$onDblClick,!1),this._domElement.addEventListener("mousemove",this._$onMouseMove,!1),this._domElement.addEventListener("mousedown",this._$onMouseDown,!1),this._domElement.addEventListener("mouseup",this._$onMouseUp,!1),this._domElement.addEventListener("touchmove",this._$onTouchMove,!1),this._domElement.addEventListener("touchstart",this._$onTouchStart,!1),this._domElement.addEventListener("touchend",this._$onTouchEnd,!1),this._domElement.addEventListener("contextmenu",this._$onContextmenu,!1)}pe.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)};pe.eventNames=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu","touchstart","touchend"];pe.prototype._getRelativeMouseXY=function(i){var t=i.target||i.srcElement;t.nodeType===3&&(t=t.parentNode);var e={x:0,y:0},n=t,o=getComputedStyle(n,null);e.y+=parseInt(o.getPropertyValue("padding-top"),10),e.x+=parseInt(o.getPropertyValue("padding-left"),10);do e.x+=n.offsetLeft,e.y+=n.offsetTop,o=getComputedStyle(n,null),e.x+=parseInt(o.getPropertyValue("border-left-width"),10),e.y+=parseInt(o.getPropertyValue("border-top-width"),10);while(n=n.offsetParent);var s={width:t===window?window.innerWidth:t.offsetWidth,height:t===window?window.innerHeight:t.offsetHeight};return{x:Number((i.pageX-e.x)/s.width)*2-1,y:-((i.pageY-e.y)/s.height)*2+1}};pe.prototype._objectCtxInit=function(i){i._3xDomEvent={}};pe.prototype._objectCtxDeinit=function(i){delete i._3xDomEvent};pe.prototype._objectCtxIsInit=function(i){return!!i._3xDomEvent};pe.prototype._objectCtxGet=function(i){return i._3xDomEvent};pe.prototype.camera=function(i){return i&&(this._camera=i),this._camera};pe.prototype.bind=function(i,t,e,n){console.assert(pe.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]),o[t+"Handlers"].push({callback:e,useCapture:n}),this._boundObjs[t]===void 0&&(this._boundObjs[t]=[]),this._boundObjs[t].push(i)};pe.prototype.addEventListener=pe.prototype.bind;pe.prototype.unbind=function(i,t,e,n){console.assert(pe.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]);for(var s=o[t+"Handlers"],r=0;r<s.length;r++){var a=s[r];if(e==a.callback&&n==a.useCapture){s.splice(r,1);break}}var l=this._boundObjs[t].indexOf(i);console.assert(l!==-1),this._boundObjs[t].splice(l,1)};pe.prototype.removeEventListener=pe.prototype.unbind;pe.prototype._bound=function(i,t){var e=this._objectCtxGet(t);return e?!!e[i+"Handlers"]:!1};pe.prototype._onMove=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new E.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o),a=this._selected;if(r.length>0){var l,c,u,d=r[0],h=d.object;this._selected=h,u=this._bound("mousemove",h),a!=h&&(l=this._bound("mouseover",h),c=a&&this._bound("mouseout",a))}else c=a&&this._bound("mouseout",a),this._selected=null;u&&this._notify("mousemove",h,n,d),l&&this._notify("mouseover",h,n,d),c&&this._notify("mouseout",a,n,d)}};pe.prototype._onEvent=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new E.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o,!0);if(r.length!==0){for(var a=r[0],l=a.object,c=this._objectCtxGet(l),u=l.parent;typeof c=="undefined"&&u;)c=this._objectCtxGet(u),u=u.parent;!c||this._notify(i,l,n,a)}}};pe.prototype._notify=function(i,t,e,n){var o=this._objectCtxGet(t),s=o?o[i+"Handlers"]:null;if(console.assert(arguments.length===4),!o||!s||s.length===0){t.parent&&this._notify(i,t.parent,e,n);return}for(var s=o[i+"Handlers"],r=0;r<s.length;r++){var a=s[r],l=!0;a.callback({type:i,target:t,origDomEvent:e,intersect:n,stopPropagation:function(){l=!1}}),!!l&&a.useCapture===!1&&t.parent&&this._notify(i,t.parent,e,n)}};pe.prototype._onMouseDown=function(i){return this._onMouseEvent("mousedown",i)};pe.prototype._onMouseUp=function(i){return this._onMouseEvent("mouseup",i)};pe.prototype._onMouseEvent=function(i,t){var e=this._getRelativeMouseXY(t);this._onEvent(i,e.x,e.y,t)};pe.prototype._onMouseMove=function(i){var t=this._getRelativeMouseXY(i);this._onMove("mousemove",t.x,t.y,i),this._onMove("mouseover",t.x,t.y,i),this._onMove("mouseout",t.x,t.y,i)};pe.prototype._onClick=function(i){this._onMouseEvent("click",i)};pe.prototype._onDblClick=function(i){this._onMouseEvent("dblclick",i)};pe.prototype._onContextmenu=function(i){this._onMouseEvent("contextmenu",i)};pe.prototype._onTouchStart=function(i){return this._onTouchEvent("touchstart",i)};pe.prototype._onTouchEnd=function(i){return this._onTouchEvent("touchend",i)};pe.prototype._onTouchMove=function(i){if(i.touches.length==1){i.preventDefault();var t=Number(i.touches[0].pageX/window.innerWidth)*2-1,e=-(i.touches[0].pageY/window.innerHeight)*2+1;this._onMove("mousemove",t,e,i),this._onMove("mouseover",t,e,i),this._onMove("mouseout",t,e,i)}};pe.prototype._onTouchEvent=function(i,t){if(t.touches.length==1){t.preventDefault();var e=Number(t.touches[0].pageX/window.innerWidth)*2-1,n=-(t.touches[0].pageY/window.innerHeight)*2+1;this._onEvent(i,e,n,t)}};let Pt=null;class ho{constructor(t,e,n,o,s,r,a){f(this,"hooks",new qt);f(this,"helperObject3D");f(this,"originObject3D");f(this,"camera");f(this,"model");f(this,"scene");f(this,"container");f(this,"domEvents");f(this,"isDragging",!1);f(this,"onRender");f(this,"enabled",!1);f(this,"onWantsTapGesture",t=>{if(this.getIntersectObject(t))return!1});this.camera=t,this.model=e,this.originObject3D=n,this.helperObject3D=o,this.container=s,this.scene=r,this.domEvents=new pe(t,s),this.onRender=a!=null?a:()=>{},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 E.Mesh&&(e.material.opacity=t),e.isCSS3DObjectPlus){const n=e;n.container.style.opacity=t.toString()}this.render()}restoreOpacity(){if(Pt===null)return;const t=this.originObject3D;if(t instanceof E.Mesh&&(t.material.opacity=Pt.opacity),t.isCSS3DObjectPlus){const e=t;e.container.style.opacity=Pt.opacity.toString()}this.render()}setOriginOpacityProperty(){var t,e;if(Pt===null){const n=this.originObject3D;n instanceof E.Mesh&&(Pt={opacity:n.material.opacity}),n instanceof Yr&&(Pt={opacity:(t=n.container.style.opacity)!=null?t:1}),n.isCSS3DObjectPlus&&(Pt={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 o=(Array.isArray(t)?t:[t]).filter(Bt),s=[];for(const r of o)if(r instanceof E.Mesh||r instanceof E.Group){const a=r instanceof E.Group?r.children.filter(h=>h instanceof E.Mesh):[r];a.forEach(h=>{h.__originalColor__=h.material.color.clone(),h.__originalOpacity__=h.material.opacity});const l=()=>{a.forEach(h=>{h.material.color.set(e),h.material.opacity=n}),this.render()},c=()=>{a.forEach(h=>{h.material.color.copy(h.__originalColor__),h.material.opacity=h.__originalOpacity__}),this.render()},u=()=>{this.isDragging||l()},d=()=>{this.isDragging||c()};for(const h of a)this.domEvents.addEventListener(h,"mouseover",u),this.domEvents.addEventListener(h,"mouseout",d),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",c),this.hooks.on("rotateEnd",c),s.push(()=>{this.domEvents.removeEventListener(h,"mouseover",u),this.domEvents.removeEventListener(h,"mouseout",d),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",c),this.hooks.off("rotateEnd",c)})}return()=>s.forEach(r=>r==null?void 0:r())}getIntersectObject(t){const e=this.camera.position,n=this.helperObject3D;if(!n)return;let o;const s=t.intersectObject(n,!0)[0];if(!!s&&(o=s,o.object=n,!!o)){if(this.model.intersectRaycaster){const r=this.model.intersectRaycaster(t)[0];if(r&&r.point.distanceTo(e)<o.point.distanceTo(e))return}return o.object}}}class f0 extends ho{constructor(...e){super(...e);f(this,"startInfo");const n=this.helperObject3D;this.hoverListener([n.xArrow,n.yArrow,n.zArrow]);const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r)}dragStart(e){if(this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();const s=new E.Vector3(1,0,0).applyQuaternion(this.helperObject3D.quaternion),r=new E.Vector3(0,1,0).applyQuaternion(this.helperObject3D.quaternion),a=new E.Vector3(0,0,1).applyQuaternion(this.helperObject3D.quaternion),l=(()=>{switch(o){case"x":return s;case"y":return r;case"z":return a}})(),c=(()=>{switch(o){case"x":case"y":return a;case"z":return s}})(),u=n.point.clone(),d=new E.Plane;d.setFromNormalAndCoplanarPoint(c,u),this.startInfo={startVectorProject:u.clone().projectOnVector(l),directionVector:l,plane:d},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("moveStart"),this.isDragging=!0,console.log("%c MoveController dragStart","color: #e5af2e")}dragging(e){if(!this.isDragging||!this.startInfo)return;const n=uo(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:o,startVectorProject:s}=this.startInfo,r=this.originObject3D,a=e.ray.intersectPlane(n,new E.Vector3);if(!a)return;const l=a.clone().projectOnVector(o),c=l.clone().sub(s),u=new E.Matrix4;u.setPosition(c),r.applyMatrix4(u),this.helperObject3D.applyMatrix4(u),s.copy(l),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 Si{constructor(t,e,n,o){f(this,"helperController");f(this,"five");f(this,"onFiveWantsTapGesture",t=>{if(!this.helperController)return;const e=this.helperController.onWantsTapGesture(t);return this.five.needsRender=!0,e});f(this,"onFiveWantsGesture",(...t)=>{if(!this.helperController)return;const e=this.helperController.onWantsGesture(...t);return this.five.needsRender=!0,e});const{camera:s,model:r,scene:a}=t,l=t.getElement();if(this.five=t,!s||!r||!l||!a)return;const c=()=>{t.needsRender=!0};this.helperController=new e(s,r,n,o,l,a,c),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsGesture",this.onFiveWantsGesture)}}const m0="v1.0.1",p0="Object3DHelper",fo=`${p0}@${m0}`,g0=()=>{console.error(`${fo} is disposed`)},A0=()=>{console.warn(`${fo} is disabled`)},v0=()=>{console.error(`${fo} is disabled`)};class b0{constructor(t,e){f(this,"controllers",{});f(this,"state",{visible:!0,enabled:!0,disposed:!1});f(this,"hooks",new qt);f(this,"helpers");f(this,"eventListener",{});f(this,"handlePositionUpdate",(t,...e)=>{var s,r,a,l;const[n]=e,o=n==null?void 0:n.matrix4;o&&(t!==this.controllers.moveController&&((s=this.controllers.moveController)==null||s.applyHelperMatrix4(o)),t!==this.controllers.rotateController&&((r=this.controllers.rotateController)==null||r.applyHelperMatrix4(o)),t!==this.controllers.scaleController&&((a=this.controllers.scaleController)==null||a.applyHelperMatrix4(o)),(l=this.helpers.outlineHelper)==null||l.applyMatrix4(o))});f(this,"handleScaleUpdate",(t,...e)=>{var s,r;const[n]=e,o=n==null?void 0:n.matrix4;o&&((s=this.controllers.scaleController)==null||s.applyHelperScaleMatrix4(o,n),(r=this.helpers.outlineHelper)==null||r.scale.applyMatrix4(o))});f(this,"handleRotateUpdate",(t,...e)=>{var o,s,r,a;const[n]=e;if(n){const{quaternion:l,origin:c}=n;l&&(t!==this.controllers.moveController&&((o=this.controllers.moveController)==null||o.applyHelperQuaternion(l,c)),t!==this.controllers.rotateController&&((s=this.controllers.rotateController)==null||s.applyHelperQuaternion(l,c)),t!==this.controllers.scaleController&&((r=this.controllers.scaleController)==null||r.applyHelperQuaternion(l,c)),(a=this.helpers.outlineHelper)==null||a.applyQuaternion(l))}});t&&this.addControllers(t),this.helpers=e!=null?e:{},this.setState(this.state)}show(t){return J(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return J(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 g0();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return v0();const n=N({},this.state);this.state=N(N({},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=N(N({},this.controllers),t),this.addEventListener(),this.setState(this.state)}addHelpers(t){this.helpers=N(N({},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 o=()=>this.handleStart(n),s=()=>this.handleEnd(n),r=(...c)=>this.handlePositionUpdate(n,...c),a=(...c)=>this.handleRotateUpdate(n,...c),l=(...c)=>this.handleScaleUpdate(n,...c);return n.hooks.on("moveStart",o),n.hooks.on("rotateStart",o),n.hooks.on("scaleStart",o),n.hooks.on("positionUpdate",r),n.hooks.on("rotateUpdate",a),n.hooks.on("scaleUpdate",l),n.hooks.on("moveEnd",s),n.hooks.on("rotateEnd",s),n.hooks.on("scaleEnd",s),()=>{n.hooks.off("moveStart",o),n.hooks.off("rotateStart",o),n.hooks.off("scaleStart",o),n.hooks.off("positionUpdate",r),n.hooks.off("rotateUpdate",a),n.hooks.off("scaleUpdate",l),n.hooks.off("moveEnd",s),n.hooks.off("rotateEnd",s),n.hooks.off("scaleEnd",s)}})())}}handleEnd(t){t&&this.setOtherHelpersVisible(!0,t)}handleStart(t){t&&this.setOtherHelpersVisible(!1,t)}setOtherHelpersVisible(t,e){var n,o,s,r;t?((s=this.controllers.moveController)==null||s.helperObject3D.show(),(r=this.controllers.rotateController)==null||r.helperObject3D.show()):(e!==this.controllers.moveController&&((n=this.controllers.moveController)==null||n.helperObject3D.hide()),e!==this.controllers.rotateController&&((o=this.controllers.rotateController)==null||o.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 o=n;(e=(t=this.eventListener)[o])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&A0()}}class y0 extends ho{constructor(...e){super(...e);f(this,"startInfo");f(this,"lastRotation");f(this,"rotations",[]);f(this,"helperObject3DQuaternion",this.originObject3D.quaternion.clone());const n=this.helperObject3D;this.hoverListener([n.xyCircle,n.xzCircle,n.yzCircle]);const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r)}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 o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();this.helperObject3D.updateAngleHelperQuaternion();const s=n.point,r=this.originObject3D.position.clone(),a=this.getAngleHelper(o);this.setTipsAngle(0);const l=s.clone();l.y+=.2,this.setTipsPosition(l);const c=new E.Vector3(1,0,0).applyQuaternion(this.helperObject3DQuaternion),u=new E.Vector3(0,1,0).applyQuaternion(this.helperObject3DQuaternion),d=new E.Vector3(0,0,1).applyQuaternion(this.helperObject3DQuaternion),h=(()=>{switch(o){case"x":return c;case"y":return u;case"z":return d}})(),p=new E.Plane().setFromNormalAndCoplanarPoint(h,s),m=new E.Vector3;p.projectPoint(s.clone(),m);const g=m.clone().sub(r),A=g.clone(),v=g.angleTo(a.baseAxes);this.setAngleHelperStart(o,v),this.setAngleHelperLength(o,0),this.rotations.push({vector:g.clone(),direction:!0}),this.startInfo={direction:o,startVector:g,staticStartVector:A,plane:p,angleHelper:a},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("rotateStart"),this.isDragging=!0,console.log(`%c RotateController dragStart ${o}`,"color: #e5af2e")}dragging(e){var o;if(!this.isDragging)return;const n=uo(this.camera,e,this.container);return n?(console.log(`%c RotateController dragging ${(o=this.startInfo)==null?void 0:o.direction}`,"color: #49de1b"),this.rotate(n),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:n,plane:o,angleHelper:s,staticStartVector:r,direction:a}=this.startInfo,l=this.originObject3D,c=e.ray.intersectPlane(o,new E.Vector3);if(!c)return;const u=l.position.clone(),d=new E.Vector3;o.projectPoint(c.clone(),d);const h=d.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(s.baseAxes)>r.angleTo(s.baseAxes);{const g=this.rotations[this.rotations.length-1],A=this.rotations[this.rotations.length-2],v=h.angleTo(A.vector),w=h.angleTo(g.vector),y=g.vector.angleTo(A.vector);if(y===0||w===0||v===0)return;if(v>w&&v>y)return g.direction;if(v<y&&w<y||v<w&&w>y)return!g.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(a,this.lastRotation.angle),this.setTipsAngle(this.lastRotation.angle/Math.PI*180);const m=new E.Quaternion().setFromUnitVectors(n.clone().normalize(),h.clone().normalize());l.applyQuaternion(m),this.helperObject3D.applyHelperQuaternion(m),this.helperObject3DQuaternion.premultiply(m),this.hooks.emit("rotateUpdate",{quaternion:m,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 o=this.getAngleHelper(e);if(o instanceof E.Mesh&&o.geometry instanceof E.CircleGeometry){const{radius:s,segments:r,thetaLength:a}=o.geometry.parameters;o.geometry=new E.CircleGeometry(s,r,n,a)}else console.warn("only support THREE.CircleGeometry")}setAngleHelperLength(e,n){const s=n>=0?Math.max(n,.001):Math.min(n,-.001),r=this.getAngleHelper(e);if(r instanceof E.Mesh&&r.geometry instanceof E.CircleGeometry){const{radius:a,thetaStart:l}=r.geometry.parameters,c=Math.ceil(Math.abs(s)*(40/(2*Math.PI)));r.geometry=new E.CircleGeometry(a,c,l,s)}else console.warn("only support THREE.CircleGeometry")}setTipsAngle(e){var o;const n=(o=this.helperObject3D.angleTips)==null?void 0:o.element;!n||(n.innerText=`${e.toFixed(0)}\xB0`)}setTipsPosition(e){const n=this.helperObject3D.angleTips;if(!n)return;const o=e.project(this.camera),{x:s,y:r,z:a}=o;if(a>1)return;const l=(s+1)/2*100+"%",c=(-r+1)/2*100+"%";n.setLeftTop(l,c)}}class w0 extends ho{constructor(...e){super(...e);f(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 E.Plane,n=this.helperObject3D.cornerPositions;if(n.length!==0)return n.length<3?e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new F.Vector3),n[0]):e.setFromCoplanarPoints(n[0],n[1],n[2]),e}dragStart(e,n){var s,r;(r=(s=this.helperObject3D).updatePoints)==null||r.call(s);const o=this.getDragPlane();if(!o)return this.dragEnd();this.startInfo={startPoint:{position:n.position.clone(),direction:n.direction},plane:o},this.hooks.emit("scaleStart"),this.render(),this.isDragging=!0,console.log("%c RectangleScaleController dragStart","color: #e5af2e")}dragging(e){if(!this.isDragging)return;const n=uo(this.camera,e,this.container);if(!n)return this.dragEnd();this.scale(n),console.log("%c RectangleScaleController dragging","color: #49de1b")}scale(e){var G,O;if(!this.startInfo)return;const n=this.originObject3D,{startPoint:o,plane:s}=this.startInfo,r=this.helperObject3D.cornerPositions;if(r.length<4)return this.dragEnd();const a=e.ray.intersectPlane(s,new F.Vector3);if(!a||r0(a,this.camera.position))return;const l=new F.Vector3().addVectors(r[0],r[2]).divideScalar(2),{position:c,direction:u}=o,d=new F.Vector3().subVectors(r[1],r[0]),h=new F.Vector3().subVectors(r[3],r[0]),p=W=>{const U=new F.Vector3(0,0,0);if(!this.startInfo)return U;const P=(W==="ew"?d:h).clone(),I=c.clone().projectOnVector(P),z=a.clone().projectOnVector(P),H=l.clone().projectOnVector(P);if(z.equals(I))return U;if(W==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const Y=new F.Vector3().subVectors(z,H),V=Y.x<0&&P.x>=0,ue=Y.y<0&&P.y>=0,de=Y.z<0&&P.z>=0;this.startInfo.dragPointInCenterBottom=V||ue||de}if(W==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const Y=new F.Vector3().subVectors(z,H),V=Y.x<0&&P.x>=0,ue=Y.y<0&&P.y>=0,de=Y.z<0&&P.z>=0;this.startInfo.dragPointInCenterLeft=V||ue||de}const X=new F.Vector3().subVectors(z,I),Z=X.length();return Z>.3?(console.warn("offset.length() > 0.3, skipped",Z),U):X},m=p("ew"),g=p("ns"),A=()=>{const W=m;this.helperObject3D.cornerPositions.forEach((U,P)=>{var I;(I=this.startInfo)!=null&&I.dragPointInCenterLeft?(P===0||P===3)&&U.add(W):(P===1||P===2)&&U.add(W)})},v=()=>{const W=g;this.helperObject3D.cornerPositions.forEach((U,P)=>{var I;(I=this.startInfo)!=null&&I.dragPointInCenterBottom?(P===0||P===1)&&U.add(W):(P===2||P===3)&&U.add(W)})};switch(u){case"ew":A();break;case"ns":v();break;case"nesw":case"nwse":A(),v()}const w=new F.Vector3().subVectors(r[1],r[0]).length()/d.length(),y=new F.Vector3().subVectors(r[3],r[0]).length()/h.length(),x=new F.Vector3(w,y,1),L=new E.Matrix4().scale(x);n.isCSS3DObjectPlus?n.applyScaleMatrix4(L):n.scale.applyMatrix4(L),o.position.copy(a);const C=new F.Vector3().addVectors(r[0],r[2]).divideScalar(2),S=new F.Vector3().subVectors(C,l),k=new E.Matrix4().setPosition(S);n.applyMatrix4(k),(G=this.helperObject3D.css3DInstance)==null||G.css3DObject.applyMatrix4(k),(O=this.helperObject3D.plane)==null||O.applyMatrix4(k),this.hooks.emit("scaleUpdate",{matrix4:L,helperOrigin:l}),this.hooks.emit("positionUpdate",{matrix4:k}),this.render()}dragEnd(){!this.isDragging||(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render(),console.log("%c RectangleScaleController dragEnd","color: #e94e4e"))}}class C0 extends w0{constructor(...t){super(...t),this.addHTMLEventListener()}addHTMLEventListener(){this.helperObject3D.points.forEach(t=>{if(!t)return;const e=t.point,n=r=>this.dragStart(r,t),o=this.dragging.bind(this),s=this.dragEnd.bind(this);e.addEventListener("dragstart",n),e.addEventListener("drag",o),e.addEventListener("dragend",s)})}}const mo="v1.0.0",Yi="Object3DHelperPlugin",hi=`${Yi}@${mo}`,E0=()=>{console.error(`${hi} is disposed`)},P0=()=>{console.warn(`${hi} is disabled`)},I0=()=>{console.error(`${hi} is disabled`)};class Ka extends ai{constructor(e){super(e);f(this,"version",mo);f(this,"name",Yi);f(this,"state",{visible:!0,enabled:!0,disposed:!1});f(this,"objectHelperMap",new Map);f(this,"css3DObjectParentMap",new Map);f(this,"css3DRender");this.five=e,this.css3DRender=new Vt(this.five.scene),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,{[`__${Yi.toUpperCase()}_DEBUG__`]:this})}show(e){return J(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return J(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 E0();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return I0();const o=N({},this.state);this.state=N(N({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:o})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,n={}){var 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 o=new b0;this.objectHelperMap.set(e,o);const s=(u=this.five.getElement())==null?void 0:u.parentElement,r=this.five.camera,{moveHelper:a=!0,rotateHelper:l=!0,scaleHelper:c=!0}=n;if(a){const d=new a0(e),h=new Si(this.five,f0,e,d);o.addControllers({moveController:h.helperController})}if(l){let d;s&&r&&(d={container:s});const h=new u0(e,d),p=new Si(this.five,y0,e,h);o.addControllers({rotateController:p.helperController})}if(c&&s){const d=new h0(e,s,r,this.five.scene),h=new Si(this.five,C0,e,d);o.addControllers({scaleController:h.helperController})}e.isCSS3DObjectPlus&&Vr(this.five).then(()=>{var p,m;const d=e,h=(p=this.css3DRender.behindModeCSS3DRenderer.wrapper)!=null?p:Jr(this.five);h&&(this.css3DObjectParentMap.set(d,d.parent),d.removeFromParent(),this.css3DRender.behindModeCSS3DRenderer.setWrapper(h),(m=this.css3DRender.getBehindCSS3DObjectGroup())==null||m.add(d),this.css3DRender.render(this.five.camera))})}removeObject3DHelper(e){const n=this.objectHelperMap.get(e);if(!!n){if(e.isCSS3DObjectPlus){const o=e,s=this.css3DObjectParentMap.get(o);s==null||s.add(o),this.css3DRender.render(this.five.camera)}this.objectHelperMap.delete(e),n.dispose()}}handleEnable(e,n=!0){e?(this.everyHelperDo(o=>o.enable()),this.hooks.emit("enable",{userAction:n})):(this.everyHelperDo(o=>o.disable()),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){e?(this.everyHelperDo(o=>o.show()),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.everyHelperDo(o=>o.hide()),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}handleDispose(){this.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&&P0()}}const x0=i=>new Ka(i);class Ui{constructor(t=0,e=0){f(this,"min");f(this,"max");f(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 k0{constructor(t,e){f(this,"min");f(this,"max");f(this,"xInterval");f(this,"yInterval");f(this,"isRectangle",!0);this.min=t,this.max=e,this.xInterval=new Ui(this.min.x,this.max.x),this.yInterval=new Ui(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 Qn(i,t,e){const n=i[t],o=i[e];!n||!o||(i[t]=o,i[e]=n)}function D0(i,t,e){const n=e/2;for(let o=1;o<=n;o++){const s=e-(o-1);for(let r=1;r<=t;r++){const a=(o-1)*t+r-1,l=(s-1)*t+r-1;Qn(i,a*4+0,l*4+0),Qn(i,a*4+1,l*4+1),Qn(i,a*4+2,l*4+2),Qn(i,a*4+3,l*4+3)}}}class $a{constructor(t,e){f(this,"width");f(this,"height");f(this,"containerDom");f(this,"hooks",new be.Subscribe);f(this,"canvas",document.createElement("canvas"));f(this,"five");f(this,"scale");f(this,"config");f(this,"offset",{x:0,y:0});f(this,"context");f(this,"renderCenter",new E.Vector3);f(this,"hammer");f(this,"state",{enabled:!1});f(this,"onPan",t=>{if(!this.containerDom||this.hooks.emit("wantsPanGesture",t))return;const n=this.offset.x+t.deltaX,o=this.offset.y+t.deltaY;this.canvas.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)",this.canvas.style.transform=`translate3d(${n}px, ${o}px, 100px)`});f(this,"onPanEnd",t=>{this.offset={x:this.offset.x+t.deltaX,y:this.offset.y+t.deltaY},this.canvas.style.boxShadow="none"});var o,s,r;if(!t.renderer)throw new Error("Five Render \u672A\u521D\u59CB\u5316");this.five=t,this.scale=(o=e==null?void 0:e.scale)!=null?o:2,this.width=(s=e==null?void 0:e.width)!=null?s:190,this.height=(r=e==null?void 0:e.height)!=null?r:190,this.config={dragEnabled:(e==null?void 0:e.dragEnabled)||!1,autoFixPCPosition:(e==null?void 0:e.autoFixPCPosition)||!1,initialPosition:(e==null?void 0:e.initialPosition)||{left:"0",top:"0"}};const n=this.canvas.getContext("2d");if(!n)throw new Error("CANNOT CREATE CONTEXT2D");this.context=n,this.config.dragEnabled&&(this.hammer=new gn.default(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panend",this.onPanEnd)),this.initStyle()}dispose(){var t;this.clear(),this.disable(),(t=this.hammer)==null||t.destroy()}enable(){var t;if(!this.state.enabled)return this.state.enabled=!0,(t=this.containerDom)==null||t.append(this.canvas),this}disable(){if(!!this.state.enabled)return this.state.enabled=!1,this.canvas.remove(),this}appendTo(t){var e;return this.containerDom&&((e=this.containerDom)==null||e.removeChild(this.canvas)),this.containerDom=t,this.state.enabled&&t.append(this.canvas),this}clear(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this}renderWithPoint(t){!this.containerDom||!this.state.enabled||(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}autoFixPCPosition(){if(!this.containerDom)return;const{width:t,height:e}=this,n=this.renderCenter.clone().project(this.five.camera),o=(n.x+1)/2*this.containerDom.clientWidth,s=-(n.x-1)/2*this.containerDom.clientWidth,r=-(n.y-1)/2*this.containerDom.clientHeight;o<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=90+"px"):r<183?(this.canvas.style.top=90+"px",this.canvas.style.left=-t/2+"px"):s<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=-t-90+"px"):(this.canvas.style.left=-t/2+"px",this.canvas.style.top=-e-90+"px"),this.canvas.style.transform=`translate3d(${o}px, ${r}px, 10px)`,this.offset={x:o,y:r}}render(){if(!this.five.renderer||!this.containerDom)return;const{scale:t,context:e,width:n,height:o}=this,s=this.renderCenter.clone().project(this.five.camera),r=this.five.renderer.getSize(new E.Vector2),a=1,l=n/t,c=o/t,u=a*t,d=(s.x+1)/2*r.x,h=(s.y+1)/2*r.y,p=this.five.getPixels(d-l/2,h-l/2,l,c,u),m=Math.floor(n*a),g=Math.floor(o*a);D0(p,m,g);const A=new ImageData(m,g);A.data.set(p),e.putImageData(A,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}}function L0(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return new E.Vector2().set((i.x-s)/e*2-1,-(i.y-o)/n*2+1)}function el(i,t){const{offsetWidth:e,offsetHeight:n}=t;return new E.Vector2().set(i.x/e*2-1,-i.y/n*2+1)}function S0(i,t){const e=i.getElement();if(!e)return;const n=el(t,e),o=new E.Raycaster;return o.setFromCamera(n,i.camera),o}function z0(i,t){const{x:e,y:n}=t,o=e*2-1,s=n*2-1,r=new E.Vector2().fromArray([o,s]),a=new E.Raycaster;return a.setFromCamera(r,i.camera),i.model.intersectRaycaster(a)[0]}const M0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbYAAAGwCAYAAADFUEBtAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABtqADAAQAAAABAAABsAAAAABTZ8U6AAAtiklEQVR4Ae2dAXJbSbJdp+d7AfYSHOGVeAPek5fkNXgLjviLmRkZl+CRbtc8UBKRRalZpyIesiorMx/eIcjb+QCh//Y3hwQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAIS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Bh2wDVkscSaNF6mf/xxx9fbuNm7vZYMl64BCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQn8NQn8fyHnyuSABiy2AAAAAElFTkSuQmCC",T0=`
|
|
546
|
+
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 Ag(i){let t,e;return t=new sg({props:{tag:Se(i[1])}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Se(n[1])),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function vg(i){let t,e;return t=new dg({props:{tag:Se(i[1])}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Se(n[1])),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function bg(i){let t,e;return t=new Vp({props:{tag:Se(i[1])}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Se(n[1])),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function yg(i){let t,e;return t=new tg({props:{tag:Se(i[1])}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Se(n[1])),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function wg(i){let t,e;return t=new Wp({props:{tag:Se(i[1])}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Se(n[1])),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Cg(i){let t,e;return t=new op({props:{tag:Se(i[1])}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Se(n[1])),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Eg(i){let t,e;return t=new pg({props:{tag:Se(i[1])}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Se(n[1])),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Pg(i){let t,e,n,o,s,r,a,l,c;const u=[Eg,Cg,wg,yg,bg,vg,Ag],d=[];function h(p,m){return p[1].element?0:p[1].contentType===We.Text?1:p[1].contentType===We.ImageText?2:p[1].contentType===We.Audio?3:p[1].contentType===We.Marketing?4:p[1].contentType===We.Link?5:p[1].contentType===We.MediaPlane?6:-1}return~(o=h(i))&&(s=d[o]=u[o](i)),{c(){var p,m,g;t=j("div"),e=j("div"),n=j("div"),s&&s.c(),b(n,"class","content svelte-95x526"),q(n,"unfolded",(p=i[1].state)==null?void 0:p.unfolded),b(e,"class","content__wrapper svelte-95x526"),b(t,"class","content__container svelte-95x526"),b(t,"data-id",r=i[1].id),q(t,"disable",i[1].enabled===!1||((m=i[1].temporaryState)==null?void 0:m.visible)===!1),q(t,"hide",!i[3].visible||!i[3].enabled||!i[4].visible||!((g=i[1].state)!=null&&g.visible)),q(t,"withAnimation",i[0]),q(t,"unClickable",i[1].clickable===!1),R(t,"width",i[1].pointType==="PointTag"?0:"100%"),R(t,"height",i[1].pointType==="PointTag"?0:"100%")},m(p,m){B(p,t,m),Q(t,e),Q(e,n),~o&&d[o].m(n,null),a=!0,l||(c=Pe(t,"click",_i(i[11])),l=!0)},p(p,[m]){var A,v,w;let g=o;o=h(p),o===g?~o&&d[o].p(p,m):(s&&(le(),T(d[g],1,1,()=>{d[g]=null}),ce()),~o?(s=d[o],s?s.p(p,m):(s=d[o]=u[o](p),s.c()),D(s,1),s.m(n,null)):s=null),(!a||m&2)&&q(n,"unfolded",(A=p[1].state)==null?void 0:A.unfolded),(!a||m&2&&r!==(r=p[1].id))&&b(t,"data-id",r),(!a||m&2)&&q(t,"disable",p[1].enabled===!1||((v=p[1].temporaryState)==null?void 0:v.visible)===!1),(!a||m&26)&&q(t,"hide",!p[3].visible||!p[3].enabled||!p[4].visible||!((w=p[1].state)!=null&&w.visible)),(!a||m&1)&&q(t,"withAnimation",p[0]),(!a||m&2)&&q(t,"unClickable",p[1].clickable===!1),m&2&&R(t,"width",p[1].pointType==="PointTag"?0:"100%"),m&2&&R(t,"height",p[1].pointType==="PointTag"?0:"100%")},i(p){a||(D(s),a=!0)},o(p){T(s),a=!1},d(p){p&&M(t),~o&&d[o].d(),l=!1,c()}}}function Ig(i,t,e){let n,o,s,r,{withAnimation:a=!1}=t,{tag:l}=t,{hooks:c}=t,{state:u}=t,{mediaStore:d}=t,{temporaryState:h}=t;Bi("hooks",c),Bi("mediaStore",d);let p,m;function g(v){v?c.emit("exposure",{id:r,type:"start"}):c.emit("exposure",{id:r,type:"end"})}const A=v=>c.emit("click",{event:v,target:"TagContent",tag:l});return i.$$set=v=>{"withAnimation"in v&&e(0,a=v.withAnimation),"tag"in v&&e(1,l=v.tag),"hooks"in v&&e(2,c=v.hooks),"state"in v&&e(3,u=v.state),"mediaStore"in v&&e(5,d=v.mediaStore),"temporaryState"in v&&e(4,h=v.temporaryState)},i.$$.update=()=>{var v,w;i.$$.dirty&2&&e(9,n=(v=l.state)==null?void 0:v.unfolded),i.$$.dirty&2&&e(8,o=(w=l.state)==null?void 0:w.visible),i.$$.dirty&280&&e(10,s=u.visible&&h.visible&&o),i.$$.dirty&2&&(r=l.id),i.$$.dirty&1024&&g(s),i.$$.dirty&962&&l.hooks&&(n!==void 0&&n!==m&&(e(7,m=n),n?l.hooks.emit("unfolded"):l.hooks.emit("folded")),o!==void 0&&o!==p&&(e(6,p=o),o?l.hooks.emit("show"):l.hooks.emit("hide")))},[a,l,c,u,h,d,p,m,o,n,s,A]}class _a extends oe{constructor(t){super(),ie(this,t,Ig,Pg,ne,{withAnimation:0,tag:1,hooks:2,state:3,mediaStore:5,temporaryState:4},gg)}}function xg(i){ae(i,"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+JaSdWIhasaz6lLPQ1qFDIwYpDeTr62veCS8bGL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sFp8LeKLfd4doRyTLRacAAAAASUVORK5CYII=)}.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 kg(i){let t,e,n,o,s,r,a;return e=new Ve({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){t=j("div"),ee(e.$$.fragment),n=_(),o=j("div"),s=_(),r=j("div"),b(o,"class","small-point svelte-fuismw"),R(o,"transition-delay",i[3]?i[2]+"ms":"0ms"),b(r,"class","big-point svelte-fuismw"),R(r,"--iconUrl","url("+i[1]+")"),R(r,"transition-delay",i[3]?i[2]+"ms":"0ms"),b(t,"class","point svelte-fuismw"),q(t,"folded",i[3]),q(t,"unfolded",i[0])},m(l,c){B(l,t,c),K(e,t,null),Q(t,n),Q(t,o),Q(t,s),Q(t,r),a=!0},p(l,[c]){c&12&&R(o,"transition-delay",l[3]?l[2]+"ms":"0ms"),(!a||c&2)&&R(r,"--iconUrl","url("+l[1]+")"),c&12&&R(r,"transition-delay",l[3]?l[2]+"ms":"0ms"),(!a||c&8)&&q(t,"folded",l[3]),(!a||c&1)&&q(t,"unfolded",l[0])},i(l){a||(D(e.$$.fragment,l),a=!0)},o(l){T(e.$$.fragment,l),a=!1},d(l){l&&M(t),$(e)}}}function Dg(i,t,e){let n,{unfolded:o}=t,{iconUrl:s}=t,{foldDelay:r=800}=t;return i.$$set=a=>{"unfolded"in a&&e(0,o=a.unfolded),"iconUrl"in a&&e(1,s=a.iconUrl),"foldDelay"in a&&e(2,r=a.foldDelay)},i.$$.update=()=>{i.$$.dirty&1&&e(3,n=!o)},[o,s,r,n]}class Lg extends oe{constructor(t){super(),ie(this,t,Dg,kg,ne,{unfolded:0,iconUrl:1,foldDelay:2},xg)}}function Sg(i){ae(i,"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+zx1ys7lhdqiDl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zSXBJZhnF8y9oUhcnzOyM9pI7wCWP0LSkyy1iFWWwsFp8LeKLfd4doRyTLRacAAAAASUVORK5CYII=);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 zg(i){let t,e,n,o,s,r,a;return e=new Ve({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){t=j("div"),ee(e.$$.fragment),n=_(),o=j("div"),s=_(),r=j("div"),b(o,"class","small-point svelte-jzvcn0"),R(o,"transition-delay",i[2]?i[1]+"ms":"0ms"),b(r,"class","big-point svelte-jzvcn0"),R(r,"transition-delay",i[2]?i[1]+"ms":"0ms"),b(t,"class","point svelte-jzvcn0"),q(t,"unfolded",i[0]),q(t,"folded",i[2])},m(l,c){B(l,t,c),K(e,t,null),Q(t,n),Q(t,o),Q(t,s),Q(t,r),a=!0},p(l,[c]){c&6&&R(o,"transition-delay",l[2]?l[1]+"ms":"0ms"),c&6&&R(r,"transition-delay",l[2]?l[1]+"ms":"0ms"),(!a||c&1)&&q(t,"unfolded",l[0]),(!a||c&4)&&q(t,"folded",l[2])},i(l){a||(D(e.$$.fragment,l),a=!0)},o(l){T(e.$$.fragment,l),a=!1},d(l){l&&M(t),$(e)}}}function Mg(i,t,e){let n,{unfolded:o}=t,{foldDelay:s=800}=t;return i.$$set=r=>{"unfolded"in r&&e(0,o=r.unfolded),"foldDelay"in r&&e(1,s=r.foldDelay)},i.$$.update=()=>{i.$$.dirty&1&&e(2,n=!o)},[o,s,n]}class Tg extends oe{constructor(t){super(),ie(this,t,Mg,zg,ne,{unfolded:0,foldDelay:1},Sg)}}function Bg(i){ae(i,"svelte-8en2lj",".point-click-helper.svelte-8en2lj{position:absolute;width:2.5rem;height:2.5rem;left:50%;top:50%;transform:translate(-50%, -50%)}")}function Sr(i){let t,e,n=i[0].contentType!==We.Link&&zr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,s){o[0].contentType!==We.Link?n?(n.p(o,s),s&1&&D(n,1)):(n=zr(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function zr(i){let t,e,n,o,s,r;const a=[Qg,jg],l=[];function c(u,d){var h,p,m,g;return((p=(h=u[0].style)==null?void 0:h.point)==null?void 0:p.style)==="CustomIcon"&&((g=(m=u[0].style)==null?void 0:m.point)==null?void 0:g.iconUrl)?0:1}return n=c(i),o=l[n]=a[n](i),{c(){t=j("div"),e=_(),o.c(),s=fe(),b(t,"class","point-click-helper svelte-8en2lj")},m(u,d){B(u,t,d),B(u,e,d),l[n].m(u,d),B(u,s,d),r=!0},p(u,d){let h=n;n=c(u),n===h?l[n].p(u,d):(le(),T(l[h],1,1,()=>{l[h]=null}),ce(),o=l[n],o?o.p(u,d):(o=l[n]=a[n](u),o.c()),D(o,1),o.m(s.parentNode,s))},i(u){r||(D(o),r=!0)},o(u){T(o),r=!1},d(u){u&&M(t),u&&M(e),l[n].d(u),u&&M(s)}}}function jg(i){let t,e;return t=new Tg({props:{unfolded:i[0].state.unfolded,foldDelay:i[1]}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.unfolded=n[0].state.unfolded),o&2&&(s.foldDelay=n[1]),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Qg(i){let t,e;return t=new Lg({props:{iconUrl:i[0].style.point.iconUrl,unfolded:i[0].state.unfolded,foldDelay:i[1]}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.iconUrl=n[0].style.point.iconUrl),o&1&&(s.unfolded=n[0].state.unfolded),o&2&&(s.foldDelay=n[1]),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Rg(i){var o,s,r;let t,e,n=((o=i[0].pointTagStyle)==null?void 0:o.leftPercent)&&((s=i[0].pointTagStyle)==null?void 0:s.topPercent)&&i[0].enabled!==!1&&i[0].state&&((r=i[0].temporaryState)==null?void 0:r.visible)!==!1&&Sr(i);return{c(){n&&n.c(),t=fe()},m(a,l){n&&n.m(a,l),B(a,t,l),e=!0},p(a,[l]){var c,u,d;((c=a[0].pointTagStyle)==null?void 0:c.leftPercent)&&((u=a[0].pointTagStyle)==null?void 0:u.topPercent)&&a[0].enabled!==!1&&a[0].state&&((d=a[0].temporaryState)==null?void 0:d.visible)!==!1?n?(n.p(a,l),l&1&&D(n,1)):(n=Sr(a),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(a){e||(D(n),e=!0)},o(a){T(n),e=!1},d(a){n&&n.d(a),a&&M(t)}}}function Og(i,t,e){let n,{tag:o}=t;return i.$$set=s=>{"tag"in s&&e(0,o=s.tag)},i.$$.update=()=>{var s,r;i.$$.dirty&1&&e(1,n=(r=(s=o.style)==null?void 0:s.foldedPointDelay)!=null?r:o.contentType===We.Marketing?600:void 0)},[o,n]}class Hg extends oe{constructor(t){super(),ie(this,t,Og,Rg,ne,{tag:0},Bg)}}function Fg(i){ae(i,"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 Mr(i){let t,e;return t=new _a({props:{mediaStore:i[4],withAnimation:i[0],tag:Se(i[1]),hooks:i[2],state:i[3],temporaryState:i[5]}}),{c(){ee(t.$$.fragment)},m(n,o){K(t,n,o),e=!0},p(n,o){const s={};o&16&&(s.mediaStore=n[4]),o&1&&(s.withAnimation=n[0]),o&2&&(s.tag=Se(n[1])),o&4&&(s.hooks=n[2]),o&8&&(s.state=n[3]),o&32&&(s.temporaryState=n[5]),t.$set(s)},i(n){e||(D(t.$$.fragment,n),e=!0)},o(n){T(t.$$.fragment,n),e=!1},d(n){$(t,n)}}}function Tr(i){let t,e,n,o,s;return e=new Hg({props:{tag:i[1]}}),{c(){t=j("div"),ee(e.$$.fragment),b(t,"class","point svelte-1vzhbu2")},m(r,a){B(r,t,a),K(e,t,null),n=!0,o||(s=Pe(t,"click",_i(i[11])),o=!0)},p(r,a){const l={};a&2&&(l.tag=r[1]),e.$set(l)},i(r){n||(D(e.$$.fragment,r),n=!0)},o(r){T(e.$$.fragment,r),n=!1},d(r){r&&M(t),$(e),o=!1,s()}}}function Gg(i){var l,c;let t,e,n,o,s,r=i[1].dimensionType===Xe.Two&&Mr(i),a=i[1].pointType===Ge.PointTag&&((c=(l=i[1].style)==null?void 0:l.point)==null?void 0:c.style)!=="noPoint"&&Tr(i);return{c(){t=j("div"),r&&r.c(),e=_(),a&&a.c(),b(t,"class","wrapper svelte-1vzhbu2"),b(t,"data-content-type",n=i[1].contentType),b(t,"data-id",o=i[1].id),q(t,"hide",i[10]),q(t,"unfolded",i[6]),R(t,"left",i[9]),R(t,"top",i[8]),R(t,"z-index",i[7])},m(u,d){B(u,t,d),r&&r.m(t,null),Q(t,e),a&&a.m(t,null),s=!0},p(u,[d]){var h,p;u[1].dimensionType===Xe.Two?r?(r.p(u,d),d&2&&D(r,1)):(r=Mr(u),r.c(),D(r,1),r.m(t,e)):r&&(le(),T(r,1,1,()=>{r=null}),ce()),u[1].pointType===Ge.PointTag&&((p=(h=u[1].style)==null?void 0:h.point)==null?void 0:p.style)!=="noPoint"?a?(a.p(u,d),d&2&&D(a,1)):(a=Tr(u),a.c(),D(a,1),a.m(t,null)):a&&(le(),T(a,1,1,()=>{a=null}),ce()),(!s||d&2&&n!==(n=u[1].contentType))&&b(t,"data-content-type",n),(!s||d&2&&o!==(o=u[1].id))&&b(t,"data-id",o),(!s||d&1024)&&q(t,"hide",u[10]),(!s||d&64)&&q(t,"unfolded",u[6]),d&512&&R(t,"left",u[9]),d&256&&R(t,"top",u[8]),d&128&&R(t,"z-index",u[7])},i(u){s||(D(r),D(a),s=!0)},o(u){T(r),T(a),s=!1},d(u){u&&M(t),r&&r.d(),a&&a.d()}}}function Ng(i,t,e){let n,o,s,r,a,l,{withAnimation:c=!1}=t,{tag:u}=t,{hooks:d}=t,{state:h}=t,{mediaStore:p}=t,{temporaryState:m}=t,g,A=!1;function v(y){g!==void 0&&clearTimeout(g),A=!0,g=setTimeout(()=>{A=!1},800)}const w=y=>{A||d.emit("click",{event:y,target:"TagPoint",tag:u})};return i.$$set=y=>{"withAnimation"in y&&e(0,c=y.withAnimation),"tag"in y&&e(1,u=y.tag),"hooks"in y&&e(2,d=y.hooks),"state"in y&&e(3,h=y.state),"mediaStore"in y&&e(4,p=y.mediaStore),"temporaryState"in y&&e(5,m=y.temporaryState)},i.$$.update=()=>{var y,x,L,C;i.$$.dirty&2&&e(12,n=(y=u.state)==null?void 0:y.visible),i.$$.dirty&4096&&e(10,o=!n),i.$$.dirty&2&&e(6,s=(x=u.state)==null?void 0:x.unfolded),i.$$.dirty&2&&e(9,r=((L=u.pointTagStyle)==null?void 0:L.leftPercent)+"%"),i.$$.dirty&2&&e(8,a=((C=u.pointTagStyle)==null?void 0:C.topPercent)+"%"),i.$$.dirty&2&&e(7,l=u.contentType===We.Link?1:0),i.$$.dirty&64&&v()},[c,u,d,h,p,m,s,l,a,r,o,w,n]}class Wg extends oe{constructor(t){super(),ie(this,t,Ng,Gg,ne,{withAnimation:0,tag:1,hooks:2,state:3,mediaStore:4,temporaryState:5},Fg)}}function Xg(i){ae(i,"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 Br(i,t,e){const n=i.slice();return n[6]=t[e],n}function jr(i){let t,e=[],n=new Map,o,s=i[1];const r=a=>a[6].id;for(let a=0;a<s.length;a+=1){let l=Br(i,s,a),c=r(l);n.set(c,e[a]=Qr(c,l))}return{c(){t=j("div");for(let a=0;a<e.length;a+=1)e[a].c();b(t,"class","tag--container svelte-1eci49s"),q(t,"hide",!i[3].visible||!i[5].visible),q(t,"withAnimation",i[0])},m(a,l){B(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,l){l&63&&(s=a[1],le(),e=Ue(e,l,r,1,a,s,n,t,at,Qr,null,Br),ce()),(!o||l&40)&&q(t,"hide",!a[3].visible||!a[5].visible),(!o||l&1)&&q(t,"withAnimation",a[0])},i(a){if(!o){for(let l=0;l<s.length;l+=1)D(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)T(e[l]);o=!1},d(a){a&&M(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function Qr(i,t){let e,n,o,s;const r=[{tag:t[6],hooks:t[2],state:t[3],mediaStore:t[4],temporaryState:t[5],withAnimation:t[0]}];let a={};for(let l=0;l<r.length;l+=1)a=we(a,r[l]);return n=new Wg({props:a}),{key:i,first:null,c(){var l,c,u;e=j("div"),ee(n.$$.fragment),o=_(),b(e,"class","tag svelte-1eci49s"),q(e,"hide",!((l=t[6].pointTagStyle)!=null&&l.leftPercent)||!((c=t[6].pointTagStyle)!=null&&c.topPercent)||t[6].enabled===!1||!t[6].state||((u=t[6].temporaryState)==null?void 0:u.visible)===!1),this.first=e},m(l,c){B(l,e,c),K(n,e,null),Q(e,o),s=!0},p(l,c){var d,h,p;t=l;const u=c&63?Be(r,[{tag:t[6],hooks:t[2],state:t[3],mediaStore:t[4],temporaryState:t[5],withAnimation:t[0]}]):{};n.$set(u),(!s||c&2)&&q(e,"hide",!((d=t[6].pointTagStyle)!=null&&d.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(l){s||(D(n.$$.fragment,l),s=!0)},o(l){T(n.$$.fragment,l),s=!1},d(l){l&&M(e),$(n)}}}function Yg(i){let t,e,n=i[3].enabled&&jr(i);return{c(){n&&n.c(),t=fe()},m(o,s){n&&n.m(o,s),B(o,t,s),e=!0},p(o,[s]){o[3].enabled?n?(n.p(o,s),s&8&&D(n,1)):(n=jr(o),n.c(),D(n,1),n.m(t.parentNode,t)):n&&(le(),T(n,1,1,()=>{n=null}),ce())},i(o){e||(D(n),e=!0)},o(o){T(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Ug(i,t,e){let{withAnimation:n=!1}=t,{tags:o=[]}=t,{hooks:s}=t,{state:r}=t,{mediaStore:a}=t,{temporaryState:l}=t;return i.$$set=c=>{"withAnimation"in c&&e(0,n=c.withAnimation),"tags"in c&&e(1,o=c.tags),"hooks"in c&&e(2,s=c.hooks),"state"in c&&e(3,r=c.state),"mediaStore"in c&&e(4,a=c.mediaStore),"temporaryState"in c&&e(5,l=c.temporaryState)},[n,o,s,r,a,l]}class Vg extends oe{constructor(t){super(),ie(this,t,Ug,Yg,ne,{withAnimation:0,tags:1,hooks:2,state:3,mediaStore:4,temporaryState:5},Xg)}}const Jg={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 _g extends ai{constructor(e){super(e);f(this,"tagCacheByPanoIndex",{})}getCaches({panoIndex:e,id:n,key:o}){var c,u,d,h;const{five:s}=this,r=(c=s.panoIndex)!=null?c:e;if(r===void 0)throw new Error(`TagCacheController getCache(): fivePanoIndex is ${r}`);const a=`${(d=(u=s.work)==null?void 0:u.workCode)!=null?d:s.model.uuid}-${r}`;let l=this.tagCacheByPanoIndex[a];if(l||(l=new Map,this.tagCacheByPanoIndex[a]=l),n===void 0)return l;if(o===void 0){const p=l.get(n);return p||(l.set(n,{}),l.get(n))}return(h=l.get(n))==null?void 0:h[o]}clearCache(){this.tagCacheByPanoIndex={}}}class Zg extends _g{constructor(e){super(e);f(this,"tags",[]);f(this,"config",Jg);f(this,"raycaster",new E.Raycaster)}getTagById(e){const n=this.tags.find(o=>o.id===e);if(!n){console.error(`getTagById(): tag is ${n}, id is ${e}`);return}return n}changeConfig(e,n=!0){n?this.config=Lt.default({},this.config,e):this.config=e,this.clearCache()}changeGlobalConfig(e,n=!0){n?this.config.globalConfig=Lt.default({},this.config.globalConfig,e):this.config.globalConfig=e,this.clearCache()}changeContentTypeConfig(e,n,o=!0){this.config.contentTypeConfig||(this.config.contentTypeConfig={}),o?this.config.contentTypeConfig[e]=Lt.default({},this.config.contentTypeConfig[e],n):this.config.contentTypeConfig[e]=n,this.clearCache()}getVisibleByPanoIndex(e,n){var r;const o=this.getCaches({panoIndex:n,id:e.id}),s=(r=this.five.panoIndex)!=null?r:n;if(o.visible!==void 0)return o.visible;{const a=(()=>{var u,d,h,p,m;const l=(u=this.getTagConfig(e).visibleConfig)!=null?u:{},c=this.getDistance(e);if(typeof l=="function")return l(this.five,{tag:e,distance:c});if(l.keep==="hidden")return!1;if(l.keep==="visible")return!0;if(l.visiblePanoIndex!==void 0&&(s===void 0||!l.visiblePanoIndex.includes(s))||l.visibleDistance!==void 0&&l.visibleDistance!=="unLimited"&&Tn(c,l.visibleDistance)===!1)return!1;if(((d=l.intersectRaycaster)==null?void 0:d.enabled)!==!1){if(s===void 0)return!1;const g=(h=this.five.work.observers[s])==null?void 0:h.position;if(g===void 0)throw new Error(`getVisible(): observerPosition is ${g}`);const A=Mn(e.position).sub(g).normalize();this.raycaster.set(g,A);const[v]=this.five.model.intersectRaycaster(this.raycaster),w=(m=(p=l.intersectRaycaster)==null?void 0:p.distanceAccuracy)!=null?m:.01;if(v&&v.distance+w<c)return!1}return!(l.angleRange&&e.dimensionType===Xe.Three&&Tn(this.getAngle(e),l.angleRange)===!1)})();return o.visible=a,o.visible}}getUnfoldedByPanoIndex(e,n){if(!this.getVisibleByPanoIndex(e))return;const s=this.getCaches({panoIndex:n,id:e.id});if(s.unfolded!==void 0)return s.unfolded;{const r=this.getTagConfig(e).unfoldedConfig;if(!r)return;const a=(()=>{const c=this.getDistance(e);if(typeof r=="function")return r(this.five,{tag:e,distance:c});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.disableUnfold===!0)return!1;if(r.disableFold===!0)return!0;if(r.unfoldDistance&&Tn(c,r.unfoldDistance)===!1)return!1})();s.unfolded=a;const l=this.getUnfoldedByCamera(e);return l!==void 0?l:s.unfolded}}getUnfoldedByCamera(e){return this.getVisibleByPanoIndex(e)?(()=>{var a;const s=this.getDistance(e),r=this.getTagConfig(e).unfoldedConfig;if(!!r){if(typeof r=="function")return r(this.five,{tag:e,distance:s});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.disableUnfold===!0)return!1;if(r.disableFold===!0)return!0;if(r.autoUnfold===void 0)return;if(r.autoUnfold.strategy==="ScreenPostion"){const l=this.getTagProject(e);if(l&&Tn(l.x,r.autoUnfold.autoUnfoldProjectX)===!1)return!1}if(r.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:m,y:g,z:A}=p;return!(Math.abs(A)>1||Math.abs(m)>1||Math.abs(g)>1)}).filter(h=>{var m;const p=this.getTagConfig(h).unfoldedConfig;return typeof p=="object"&&((m=p.autoUnfold)==null?void 0:m.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<=((a=r.autoUnfold.maxNumber)!=null?a:1)-1===!1)return!1}return!0}})():void 0}getDistance(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCaches({panoIndex:n,id:e.id});if(s.distance!==void 0)return s.distance;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getDistance(): observerPosition is ${c}`);const u=(()=>e.pointType===Ge.PointTag?st(e==null?void 0:e.position):Mn(e.position))(),d=c.distanceTo(u);return s.distance=d,d}}getAngle(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCaches({panoIndex:n,id:e.id});if(s.angle!==void 0)return s.angle;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getAngleRange(): observerPosition is ${c}`);const u=(()=>e.pointType===Ge.PointTag?hn(e.normal):Na(e.position))();if(!u)return;const d=new E.Vector3().copy(c).sub(Mn(e.position)),h=u.angleTo(d)*180/Math.PI;return s.angle=h,s.angle}}getTagConfig(e){var s;if(!e)return(s=this.config.globalConfig)!=null?s:{};const n={};return this.config.contentTypeConfig&&Object.keys(this.config.contentTypeConfig).forEach(r=>{const a=r;if(n[a])return;const l=a.split("-"),[c="Any",u="Any",d="Any"]=l||[];(e.dimensionType===c||c==="Any")&&(e.contentType===u||u==="Any")&&(e.pointType===d||d==="Any")&&(n[a]=this.config.contentTypeConfig[a])}),Lt.default({},this.config.globalConfig,...Object.values(n),e.config)}canBe(e,n){const o=this.getTagConfig(n);if(!o||typeof o!="object")return!0;if(e==="show"||e==="hide"){if(!o.visibleConfig||typeof o.visibleConfig!="object")return!0;if(e==="show"&&o.visibleConfig.keep==="hidden"||e==="hide"&&(o.visibleConfig.keep==="visible"||o.visibleConfig.alwaysShowWhenMovePano))return!1}if(e==="fold"||e==="unfold"){if(!o.unfoldedConfig||typeof o.unfoldedConfig!="object")return!0;if(e==="fold"&&(o.unfoldedConfig.disableFold||o.unfoldedConfig.keep==="unfolded")||e==="unfold"&&(o.unfoldedConfig.disableUnfold||o.unfoldedConfig.keep==="folded"))return!1}return!0}setPointTagPosition(){const e=this.filterPointTag();e.length!==0&&e.forEach(n=>{var s;if(!((s=n.state)!=null&&s.visible)){n.pointTagStyle=void 0;return}const o=this.getTagProject(n);if(!o){n.pointTagStyle=void 0;return}n.pointTagStyle={leftPercent:(o.x+1)/2*100,topPercent:(-o.y+1)/2*100}})}setVisibleByPanoIndex(){this.tags.forEach(e=>{const n=this.getVisibleByPanoIndex(e);e.state&&(e.state.visible=n)})}setUnfoldedByPanoIndex(){this.tags.forEach(e=>{const n=this.getUnfoldedByPanoIndex(e);if(!!e.state&&(n!==void 0&&(e.state.unfolded=n),n&&!e.state.visible)){const o=this.getTagConfig(e);typeof o.unfoldedConfig=="object"&&o.unfoldedConfig.autoUnfoldWhenHide!==!1&&(e.state.unfolded=!1)}})}getTagProject(e){if(!this.getVisibleByPanoIndex(e))return;const o=Mn(e.position),{x:s,y:r,z:a}=o.project(this.five.camera);if(!(a>1))return{x:s,y:r,z:a}}filterPointTag(){return this.tags.filter(e=>e.pointType===Ge.PointTag)}filterTag2D(){return this.tags.filter(e=>e.dimensionType===Xe.Two)}filter3DPointTag(){return this.tags.filter(e=>e.dimensionType===Xe.Three&&e.pointType===Ge.PointTag)}filter3DTag(){return this.tags.filter(e=>e.dimensionType===Xe.Three)}filterPlaneTag(){return this.tags.filter(e=>e.dimensionType===Xe.Three&&e.pointType===Ge.PlaneTag)}}const Za="1.2.6",Xi=`DnalogelPlugin-PanoTagPlugin@${Za}`,qg=!1,Kg=i=>`${Xi}--${i}`;class qa extends Zg{constructor(e,n){super(e);f(this,"version",Za);f(this,"state",{enabled:!0,visible:!0});f(this,"params");f(this,"debug");f(this,"css3DRenderPlugin");f(this,"TagContainerSvelte");f(this,"temporaryState",{visible:!0});f(this,"mediaStore",$i({currentMediaUrl:""}));f(this,"store",{disposers:[],disposed:!1,resizeObserverDisposerAdding:!1,css3DRenderDisposer:new Map});f(this,"staticUrl");f(this,"disposedErrorLog",()=>{console.error(`${Xi} is disposed`)});this.params=N({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 s;const o=this.params.staticConfig;if(typeof o=="string")return o;{const r=o.protocol?o.protocol+":":"",a=(s=o.host)!=null?s:"vrlab-static.ljcdn.com",l=o.port?":"+o.port:"";return`${r}//${a}${l}`}})(),Object.assign(window,{__PANOTAGPLUGIN_DEBUG__:this})}load(e,n){var o,s;this.clearTags(),console.log(Xi,"load:",{data:e}),this.params.mergePluginDefaultConfigToLoadDataConfig?this.config=Lt.default({},this.config,{globalConfig:(o=e.globalConfig)!=null?o:{},contentTypeConfig:(s=e.contentTypeConfig)!=null?s:{}}):(e.globalConfig&&(this.config.globalConfig=e.globalConfig),e.contentTypeConfig&&(this.config.contentTypeConfig=e.contentTypeConfig)),this.addTag(e.tagList,n),this.debug&&zm(this.five,this.tags)}addTag(e,n){const s=(Array.isArray(e)?e:[e]).map(r=>{const a=this.getTagConfig(r);return he(N({},r),{state:N({visible:void 0,unfolded:qg},a.initialState),hooks:new be.Subscribe,clickable:a.clickable})}).filter(r=>r.position);this.tags.push(...s),Mm(this.five,()=>{var r,a,l;this.store.eventListenerDisposer&&((a=(r=this.store).eventListenerDisposer)==null||a.call(r)),this.state.enabled&&(this.store.eventListenerDisposer=this.addEventListener()),this.addResizeListener(),this.checkPanelTag(),this.setVisibleAndUnfolded({withAnimation:(l=n==null?void 0:n.withAnimation)!=null?l:!0}).then(()=>this.updateRenderAllTags()),this.updateRenderAllTags()})}clearTags(){this.tags=[],this.clearCache(),this.disposeAllCSS3DContainer(),this.updateRenderAllTags()}show(e){return J(this,null,function*(){const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({visible:!0},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("show",{userAction:n,withAnimation:o})})}hide(e){return J(this,null,function*(){const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.setState({visible:!1},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("hide",{userAction:n,withAnimation:o})})}enable(e){const{userAction:n=!0}=e!=null?e:{};if(this.store.disposed)return this.disposedErrorLog();this.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,o,s,r,a;this.disposeAllCSS3DContainer(),(e=this.TagContainerSvelte)==null||e.$destroy(),this.filter3DTag().forEach(l=>{var c;return(c=l.tag3DContentSvelte)==null?void 0:c.svelteApp.$destroy()}),this.tags=[],(n=this.store.disposers)==null||n.forEach(l=>l==null?void 0:l()),this.store.disposers=[],this.store.disposed=!0,(s=(o=this.store).eventListenerDisposer)==null||s.call(o),this.store.eventListenerDisposer=void 0,(a=(r=this.store).resizeObserverDisposer)==null||a.call(r),this.store.resizeObserverDisposer=void 0,this.store.resizeObserverDisposerAdding=!1,this.clearCache(),this.hooks.emit("dispose")}setState(e,n){if(this.store.disposed)return this.disposedErrorLog();const{userAction:o=!0,visibleWithAnimation:s=!1}=n,r=N({},this.state);this.state=Object.assign(this.state,e),this.store.visibleWithAnimation=s,r.visible!==this.state.visible&&(e.visible?this.handleShow():this.handleHide()),r.enabled!==this.state.enabled&&(e.enabled?this.handleEnable():this.handleDisable()),this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:o})}changeTagNormalById(e,n){const o=this.getTagById(e);!o||!o.tag3DContentSvelte||(o.tag3DContentSvelte.currentNormal=st(n),this.updateRenderPlaneTag())}changeDataById(e,n,o=!0){const s=this.getTagById(e);!s||(o?s.data=Lt.default({},s.data,n):Object.assign(s.data,n),this.checkPanelTag(),this.updateRenderAllTags())}changeTagById(e,n,o=!0){const s=this.getTagById(e);!n||(o?Lt.default(s,n):Object.assign(s,n),(s==null?void 0:s.tag3DContentSvelte)&&(n==null?void 0:n.normal)&&(s.tag3DContentSvelte.currentNormal=st(n.normal)),this.updateRenderAllTags(),this.checkPanelTag())}destroyTagById(e){(Array.isArray(e)?e:[e]).forEach(o=>{const s=this.tags.findIndex(r=>r.id===o);s!==-1&&this.tags.splice(s,1)}),this.updateRenderAllTags()}pauseCurrentMedia(){this.mediaStore.set({currentMediaUrl:""})}setVisibleAndUnfolded(){return J(this,arguments,function*({withAnimation:e}={withAnimation:!1}){return this.setVisibleByPanoIndex(),e?new Promise((n,o)=>{setTimeout(()=>{this.setUnfoldedByPanoIndex(),n()},10)}):(this.setUnfoldedByPanoIndex(),Promise.resolve())})}handleShow(){this.state.visible=!0,this.updateTagContainerVisible()}handleHide(){this.state.visible=!1,this.updateTagContainerVisible()}handleEnable(){this.state.enabled=!0,this.store.eventListenerDisposer=this.addEventListener(),this.updateRenderAllTags()}handleDisable(){var e,n,o;this.state.enabled=!1,(n=(e=this.store).eventListenerDisposer)==null||n.call(e),(o=this.TagContainerSvelte)==null||o.$set({tags:[]}),this.filter3DTag().forEach(s=>{var r;(r=s.tag3DContentSvelte)==null||r.svelteApp.$destroy(),s.tag3DContentSvelte=void 0})}addEventListener(){const{five:e,hooks:n}=this,o=this.handleFiveWantsMoveToPano.bind(this),s=this.handleFiveModeChange.bind(this),r=this.handleFiveCameraUpdate.bind(this),a=this.handleFiveCameraUpdateDebounce(),l=this.handleFivePanoArrived.bind(this),c=this.clickhandler.bind(this);return e.on("wantsMoveToPano",o),e.on("modeChange",s),e.on("cameraUpdate",r),e.on("cameraUpdate",a),e.on("panoArrived",l),n.on("click",c),()=>{e.off("wantsMoveToPano",o),e.off("modeChange",s),e.off("cameraUpdate",r),e.off("cameraUpdate",a),e.off("panoArrived",l),n.off("click",c),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())},o=()=>{!this.state.enabled||this.hide()},{observe:s,unobserve:r}=Rs(Bm(()=>{!this.store.resizeObserverDisposer||o()},500),e),{observe:a,unobserve:l}=Rs(Qs(()=>n(),400),e);return s(),a(),()=>{r(),l()}}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=he(N({},e.temporaryState),{visible:n.visibleConfig.keep==="visible"}):typeof n.visibleConfig=="object"&&n.visibleConfig.alwaysShowWhenMovePano?e.temporaryState=he(N({},e.temporaryState),{visible:!0}):e.temporaryState=he(N({},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),o=this.canBe("unfold",e.tag);n&&o&&(e.tag.state.unfolded=!e.tag.state.unfolded,e.tag.state.unfolded&&this.tags.forEach(s=>{s.id!==e.tag.id&&s.state&&this.canBe("fold",s)&&(s.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 o;(o=n.tag3DContentSvelte)==null||o.svelteApp.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation})})}handleFiveCameraUpdateDebounce(){return Qs(()=>{this.setUnfoldedByCamera(),this.updateRenderAllTags()},100)}handleFiveCameraUpdate(){this.updateRenderPointTag()}handleFivePanoArrived(){return J(this,null,function*(){yield this.setVisibleAndUnfolded(),this.tags.forEach(e=>{e.temporaryState=he(N({},e.temporaryState),{visible:!0})}),this.updateRenderAllTags()})}setUnfoldedByCamera(){let e=!1;this.tags.forEach(n=>{const o=this.getUnfoldedByCamera(n);!n.state||o!==void 0&&(o===!0&&(e=!0),n.state.unfolded=o)}),e&&this.tags.forEach(n=>{const o=this.getTagConfig(n).unfoldedConfig;typeof o=="object"&&(o.autoUnfold||o.disableFold||o.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 o=(n=this.five.getElement())==null?void 0:n.parentElement;if(!o)return console.error("updateRenderPlaneTag: tag2DContainer not found");this.TagContainerSvelte=new Vg({target:o,props:{hooks:this.hooks,tags:e,state:this.state,temporaryState:this.temporaryState,mediaStore:this.mediaStore}})}}updateRenderPlaneTag(){[...this.filterPlaneTag(),...this.filter3DPointTag()].forEach(n=>{var o;if(n.tag3DContentSvelte){const{svelteApp:s,domContainer:r,initialNormal:a,currentNormal:l}=n.tag3DContentSvelte;if(s.$set({tag:n,hooks:this.hooks,state:this.state,temporaryState:this.temporaryState}),!a.equals(l)){const c=new F.Quaternion().setFromUnitVectors(a,l);r.css3DObject.setRotationFromQuaternion(c)}}else{if(((o=n.state)==null?void 0:o.visible)===!1)return;if(this.css3DRenderPlugin||(this.css3DRenderPlugin=Kt(this.five)),n.pointType===Ge.PointTag&&!n.normal)return console.error("updateRenderPlaneTag: \u4E09\u7EF4\u70B9\u6807\u7B7E\u7F3A\u5C11\u6CD5\u5411\u91CF\uFF01");const s=n.pointType===Ge.PlaneTag?n.position:Tm(this.five.camera.position,st(n.position),st(n.normal)),r=n.pointType===Ge.PlaneTag?Na(n.position):st(n.normal),a=this.getTagConfig(n).tag3DConfig,l=this.css3DRenderPlugin.create3DDomContainer(s,a);if(!l)return;this.store.css3DRenderDisposer.set(n.id,l.dispose),n.tag3DContentSvelte={svelteApp:new _a({target:l.container,props:{tag:n,hooks:this.hooks,state:this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}}),domContainer:l,initialNormal:r,currentNormal:r}}}),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===Xe.Two&&e.pointType===Ge.PointTag&&((n=e.tag3DContentSvelte)==null||n.domContainer.dispose(),e.tag3DContentSvelte=void 0)});for(const[e,n]of this.store.css3DRenderDisposer){const o=this.getTagById(e);(!o||o.dimensionType!==Xe.Three)&&(n==null||n(),this.store.css3DRenderDisposer.delete(e))}}}const $g=(i,t)=>new qa(i,t);class co extends F.Object3D{constructor(e,n){var o;super();f(this,"originObject3D");f(this,"onRender");this.originObject3D=e,this.onRender=(o=n==null?void 0:n.onRender)!=null?o:()=>{}}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 e0 extends co{}class t0 extends co{}class n0 extends co{}class i0 extends n0{}class o0 extends E.Group{constructor(e){super();f(this,"direction");this.direction=e||"x"}}class Rr extends E.Mesh{constructor(e,n,o){super(e,n);f(this,"direction");this.direction=o||"x"}}function s0(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return Object.assign(new E.Vector2,{x:(i.x-s)/e*2-1,y:-(i.y-o)/n*2+1})}function uo(i,t,e){if(!t||!e||!i)return;const n=s0(t,e);if(Math.abs(n.x)===1||Math.abs(n.y)===1)return;const o=new E.Raycaster;return o.setFromCamera(n,i),o}function r0(i,t){return!(Math.abs(i.x-t.x)>1e-5||Math.abs(i.y-t.y)>1e-5||Math.abs(i.z-t.z)>1e-5)}class Ii extends o0{constructor(e){var u;super(e.direction);f(this,"line");f(this,"arrow");f(this,"lineHeight",.4);f(this,"arrowHeight",.1);this.name="ArrowGroup";const n=new E.Color((u=e.color)!=null?u:16214315),o=new E.MeshBasicMaterial({color:n,depthTest:!1,opacity:1,transparent:!0,side:E.DoubleSide}),s=new E.ConeGeometry(.04,.1,32),r=new Rr(s,o.clone(),e.direction);r.name=`arrow-${e.direction}`,this.arrow=r;const a=.004,l=new E.CylinderGeometry(a,a,.4,32),c=new Rr(l,o.clone(),e.direction);c.name=`line-${e.direction}`,this.line=c,this.formatArrow(),this.formatLine(),this.add(this.arrow,this.line)}formatArrow(){this.arrow.geometry.translate(0,this.lineHeight+this.arrowHeight/2,0),this.direction==="x"?(this.arrow.geometry.rotateX(Math.PI/2),this.arrow.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.arrow.geometry.rotateX(Math.PI/2)}formatLine(){this.line.geometry.translate(0,this.lineHeight/2,0),this.direction==="x"?(this.line.geometry.rotateX(Math.PI/2),this.line.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.line.geometry.rotateX(Math.PI/2)}}const xi={X:15618642,Y:4765519,Z:4227839};class ot{static get X(){return new E.Color(xi.X).convertSRGBToLinear().clone()}static get Y(){return new E.Color(xi.Y).convertSRGBToLinear().clone()}static get Z(){return new E.Color(xi.Z).convertSRGBToLinear().clone()}}class a0 extends e0{constructor(e){super(e);f(this,"xArrow",new Ii({direction:"x",color:ot.X}));f(this,"yArrow",new Ii({direction:"y",color:ot.Y}));f(this,"zArrow",new Ii({direction:"z",color:ot.Z}));this.add(this.xArrow),this.add(this.yArrow),this.add(this.zArrow)}show(){super.show(),this.xArrow.visible=!0,this.yArrow.visible=!0,this.zArrow.visible=!0}showDraggingHelper(e){this.xArrow.visible=e.includes("x"),this.yArrow.visible=e.includes("y"),this.zArrow.visible=e.includes("z")}dispose(){this.remove(this.xArrow,this.yArrow,this.zArrow)}}function Mt(i,t){return l0(document.createElement(t!=null?t:"div"),i)}function l0(i,t){if(!t)return i;for(const e in t)e&&t[e]&&(i.style[e]=t[e]);return i}function c0(i){const t=Mt(N({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},i)),e=()=>{t.style.display!=="block"&&(!t.style.top||!t.style.left||(t.style.display="block"))};return{element:t,show:e,hide:()=>{t.style.display="none",t.style.top="",t.style.left=""},setLeftTop:(s,r)=>{t.style.left=s,t.style.top=r,e()}}}class u0 extends t0{constructor(e,n){var o;super(e);f(this,"yzCircle",new ki({direction:"x",color:ot.X}));f(this,"xzCircle",new ki({direction:"y",color:ot.Y}));f(this,"xyCircle",new ki({direction:"z",color:ot.Z}));f(this,"xRingHelper",new Di({direction:"x"}));f(this,"yRingHelper",new Di({direction:"y"}));f(this,"zRingHelper",new Di({direction:"z"}));f(this,"xAngleHelper",new Li({direction:"x",color:ot.X}));f(this,"yAngleHelper",new Li({direction:"y",color:ot.Y}));f(this,"zAngleHelper",new Li({direction:"z",color:ot.Z}));f(this,"angleTips");f(this,"container");n&&(this.container=n==null?void 0:n.container,this.angleTips=c0({display:"none"}),(o=this.container)==null||o.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 ki extends E.Mesh{constructor(e){var n;super();f(this,"direction");f(this,"gapAngle",.02);f(this,"geometry",new E.RingGeometry(.25,.3,20,8,this.gapAngle,Math.PI/2-this.gapAngle*2));this.material=new E.MeshBasicMaterial({opacity:.6,color:(n=e.color)!=null?n:16777215,transparent:!0,side:E.DoubleSide,depthTest:!1}),this.direction=e.direction,this.geometry.name=`RotateHelperCircleGeometry-${this.direction}`,this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}class Di extends E.Group{constructor(e){super();f(this,"direction");this.direction=e.direction;const n=.015,o=new Array(8).fill(null).map((s,r)=>{const a=new E.RingGeometry(.25,.3,20,8,Math.PI/4*r+n,Math.PI/4-n*2),l=new E.MeshBasicMaterial({opacity:1,color:16777215,depthTest:!1,transparent:!0,side:E.DoubleSide}),c=new E.Mesh(a,l);return c.name=`AxesDashedRing-${this.direction}-${r}`,c});this.add(...o),this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}class Li extends E.Mesh{constructor(e){var o;super();f(this,"direction");f(this,"baseAxes");switch(e.direction){case"x":this.baseAxes=new E.Vector3(0,0,1);break;case"y":this.baseAxes=new E.Vector3(1,0,0);break;case"z":this.baseAxes=new E.Vector3(1,0,0);break}const n=.3+5e-4;this.geometry=new E.CircleGeometry(n,48,0,1e-4),this.material=new E.MeshBasicMaterial({opacity:.4,color:(o=e.color)!=null?o:16777215,depthTest:!1,transparent:!0,side:E.DoubleSide}),this.direction=e.direction,this.direction==="y"?this.rotateX(Math.PI/2):this.direction==="x"&&this.rotateY(-Math.PI/2)}}function d0(){const i=Mt({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=Mt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=Mt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"absolute",border:"1px solid rgba(255,255,255,0.4)"});i.appendChild(t),t.appendChild(e);const n="-4px",o={direction:"nesw",element:dt({cursor:"nesw-resize",left:n,bottom:n})},s={direction:"ns",element:dt({cursor:"ns-resize",bottom:n})},r={direction:"nwse",element:dt({cursor:"nwse-resize",right:n,bottom:n})},a={direction:"ew",element:dt({cursor:"ew-resize",right:n})},l={direction:"nesw",element:dt({cursor:"nesw-resize",right:n,top:n})},c={direction:"ns",element:dt({cursor:"ns-resize",top:n})},u={direction:"nwse",element:dt({cursor:"nwse-resize",left:n,top:n})},d={direction:"ew",element:dt({cursor:"ew-resize",left:n})};return new Array(s,a,c,d,o,r,l,u).forEach(p=>t.appendChild(p.element)),{container:i,squares:[o,s,r,a,l,c,u,d]}}function dt(i){const t=Mt(N({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},i)),e=Mt({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),n=Mt({width:"15px",height:"15px",cursor:i==null?void 0:i.cursor,pointerEvents:"auto",background:"transparent"});return n.draggable=!0,e.appendChild(n),t.appendChild(e),t}class h0 extends i0{constructor(e,n,o,s){super(e);f(this,"points",[]);f(this,"cornerPositions",[]);f(this,"css3DInstance");f(this,"plane");f(this,"css3DRenderer",new Vt);f(this,"camera");f(this,"scene");f(this,"container");f(this,"enabled",!1);this.camera=o,this.scene=s,this.container=n,this.initRectangleScaleHelper()}get helperObject(){var e;if(!((e=this.css3DInstance)!=null&&e.css3DObject))throw new Error("css3DInstance is not initialized");return this.css3DInstance.css3DObject}updatePosition(){var e;this.helperObject.position.copy(this.originObject3D.position),(e=this.plane)==null||e.position.copy(this.originObject3D.position)}updateQuaternion(){var e;(e=this.plane)==null||e.quaternion.copy(this.originObject3D.quaternion)}applyMatrix4(e){var n;super.applyMatrix4(e),this.helperObject.applyMatrix4(e),(n=this.plane)==null||n.applyMatrix4(e),this.cornerPositions.forEach(o=>o.applyMatrix4(e))}showDraggingHelper(){}applyHelperScaleMatrix4(e,n){var o;(o=this.plane)==null||o.scale.applyMatrix4(e),this.helperObject.applyScaleMatrix4(e)}updatePoints(){const e=this.calculatePointPosition(this.cornerPositions);this.points.forEach((n,o)=>{n.position.copy(e[o])})}applyHelperQuaternion(e,n){var s;const o=(s=this.css3DInstance)==null?void 0:s.css3DObject;if(o){const r=new E.Vector3().subVectors(o.position,n).applyQuaternion(e).add(n);o.position.copy(r),o.applyQuaternion(e)}if(this.plane){const r=new E.Vector3().subVectors(this.plane.position,n).applyQuaternion(e).add(n);this.plane.position.copy(r),this.plane.applyQuaternion(e)}this.cornerPositions.forEach(r=>{const a=new E.Vector3().subVectors(r,n).applyQuaternion(e).add(n);r.copy(a)})}enable(){var e;this.enabled||(this.enabled=!0,(e=this.css3DInstance)==null||e.enable(),this.plane&&this.scene.add(this.plane))}disable(){var e;!this.enabled||(this.enabled=!1,(e=this.css3DInstance)==null||e.disable(),this.plane&&this.scene.remove(this.plane))}show(){var e;(e=this.css3DInstance)==null||e.show(),this.plane&&(this.plane.visible=!0)}hide(){var e;(e=this.css3DInstance)==null||e.hide(),this.plane&&(this.plane.visible=!1)}dispose(){this.disable(),this.css3DRenderer.dispose()}initRectangleScaleHelper(){var 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 o=n.css3DObject.container,{container:s,squares:r}=d0();this.points=r.map((d,h)=>({direction:d.direction,point:d.element,position:this.calculatePointPosition(e)[h]})),o.insertBefore(s,(u=o.children[0])!=null?u:null);const a=new E.PlaneGeometry(n.css3DObject.width,n.css3DObject.height),l=new E.MeshBasicMaterial({color:0,opacity:.15,transparent:!0,side:E.DoubleSide}),c=new E.Mesh(a,l);this.scene.add(c),this.updatePosition()}getCornerPositions(){const{originObject3D:e}=this;if(e instanceof un.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 E.Vector3;function pe(i,t){this._camera=i||null,this._domElement=t||document,this._raycaster=new E.Raycaster,this._selected=null,this._boundObjs={};var e=this;this._$onClick=function(){e._onClick.apply(e,arguments)},this._$onDblClick=function(){e._onDblClick.apply(e,arguments)},this._$onMouseMove=function(){e._onMouseMove.apply(e,arguments)},this._$onMouseDown=function(){e._onMouseDown.apply(e,arguments)},this._$onMouseUp=function(){e._onMouseUp.apply(e,arguments)},this._$onTouchMove=function(){e._onTouchMove.apply(e,arguments)},this._$onTouchStart=function(){e._onTouchStart.apply(e,arguments)},this._$onTouchEnd=function(){e._onTouchEnd.apply(e,arguments)},this._$onContextmenu=function(){e._onContextmenu.apply(e,arguments)},this._domElement.addEventListener("click",this._$onClick,!1),this._domElement.addEventListener("dblclick",this._$onDblClick,!1),this._domElement.addEventListener("mousemove",this._$onMouseMove,!1),this._domElement.addEventListener("mousedown",this._$onMouseDown,!1),this._domElement.addEventListener("mouseup",this._$onMouseUp,!1),this._domElement.addEventListener("touchmove",this._$onTouchMove,!1),this._domElement.addEventListener("touchstart",this._$onTouchStart,!1),this._domElement.addEventListener("touchend",this._$onTouchEnd,!1),this._domElement.addEventListener("contextmenu",this._$onContextmenu,!1)}pe.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)};pe.eventNames=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu","touchstart","touchend"];pe.prototype._getRelativeMouseXY=function(i){var t=i.target||i.srcElement;t.nodeType===3&&(t=t.parentNode);var e={x:0,y:0},n=t,o=getComputedStyle(n,null);e.y+=parseInt(o.getPropertyValue("padding-top"),10),e.x+=parseInt(o.getPropertyValue("padding-left"),10);do e.x+=n.offsetLeft,e.y+=n.offsetTop,o=getComputedStyle(n,null),e.x+=parseInt(o.getPropertyValue("border-left-width"),10),e.y+=parseInt(o.getPropertyValue("border-top-width"),10);while(n=n.offsetParent);var s={width:t===window?window.innerWidth:t.offsetWidth,height:t===window?window.innerHeight:t.offsetHeight};return{x:Number((i.pageX-e.x)/s.width)*2-1,y:-((i.pageY-e.y)/s.height)*2+1}};pe.prototype._objectCtxInit=function(i){i._3xDomEvent={}};pe.prototype._objectCtxDeinit=function(i){delete i._3xDomEvent};pe.prototype._objectCtxIsInit=function(i){return!!i._3xDomEvent};pe.prototype._objectCtxGet=function(i){return i._3xDomEvent};pe.prototype.camera=function(i){return i&&(this._camera=i),this._camera};pe.prototype.bind=function(i,t,e,n){console.assert(pe.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]),o[t+"Handlers"].push({callback:e,useCapture:n}),this._boundObjs[t]===void 0&&(this._boundObjs[t]=[]),this._boundObjs[t].push(i)};pe.prototype.addEventListener=pe.prototype.bind;pe.prototype.unbind=function(i,t,e,n){console.assert(pe.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]);for(var s=o[t+"Handlers"],r=0;r<s.length;r++){var a=s[r];if(e==a.callback&&n==a.useCapture){s.splice(r,1);break}}var l=this._boundObjs[t].indexOf(i);console.assert(l!==-1),this._boundObjs[t].splice(l,1)};pe.prototype.removeEventListener=pe.prototype.unbind;pe.prototype._bound=function(i,t){var e=this._objectCtxGet(t);return e?!!e[i+"Handlers"]:!1};pe.prototype._onMove=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new E.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o),a=this._selected;if(r.length>0){var l,c,u,d=r[0],h=d.object;this._selected=h,u=this._bound("mousemove",h),a!=h&&(l=this._bound("mouseover",h),c=a&&this._bound("mouseout",a))}else c=a&&this._bound("mouseout",a),this._selected=null;u&&this._notify("mousemove",h,n,d),l&&this._notify("mouseover",h,n,d),c&&this._notify("mouseout",a,n,d)}};pe.prototype._onEvent=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new E.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o,!0);if(r.length!==0){for(var a=r[0],l=a.object,c=this._objectCtxGet(l),u=l.parent;typeof c=="undefined"&&u;)c=this._objectCtxGet(u),u=u.parent;!c||this._notify(i,l,n,a)}}};pe.prototype._notify=function(i,t,e,n){var o=this._objectCtxGet(t),s=o?o[i+"Handlers"]:null;if(console.assert(arguments.length===4),!o||!s||s.length===0){t.parent&&this._notify(i,t.parent,e,n);return}for(var s=o[i+"Handlers"],r=0;r<s.length;r++){var a=s[r],l=!0;a.callback({type:i,target:t,origDomEvent:e,intersect:n,stopPropagation:function(){l=!1}}),!!l&&a.useCapture===!1&&t.parent&&this._notify(i,t.parent,e,n)}};pe.prototype._onMouseDown=function(i){return this._onMouseEvent("mousedown",i)};pe.prototype._onMouseUp=function(i){return this._onMouseEvent("mouseup",i)};pe.prototype._onMouseEvent=function(i,t){var e=this._getRelativeMouseXY(t);this._onEvent(i,e.x,e.y,t)};pe.prototype._onMouseMove=function(i){var t=this._getRelativeMouseXY(i);this._onMove("mousemove",t.x,t.y,i),this._onMove("mouseover",t.x,t.y,i),this._onMove("mouseout",t.x,t.y,i)};pe.prototype._onClick=function(i){this._onMouseEvent("click",i)};pe.prototype._onDblClick=function(i){this._onMouseEvent("dblclick",i)};pe.prototype._onContextmenu=function(i){this._onMouseEvent("contextmenu",i)};pe.prototype._onTouchStart=function(i){return this._onTouchEvent("touchstart",i)};pe.prototype._onTouchEnd=function(i){return this._onTouchEvent("touchend",i)};pe.prototype._onTouchMove=function(i){if(i.touches.length==1){i.preventDefault();var t=Number(i.touches[0].pageX/window.innerWidth)*2-1,e=-(i.touches[0].pageY/window.innerHeight)*2+1;this._onMove("mousemove",t,e,i),this._onMove("mouseover",t,e,i),this._onMove("mouseout",t,e,i)}};pe.prototype._onTouchEvent=function(i,t){if(t.touches.length==1){t.preventDefault();var e=Number(t.touches[0].pageX/window.innerWidth)*2-1,n=-(t.touches[0].pageY/window.innerHeight)*2+1;this._onEvent(i,e,n,t)}};let Pt=null;class ho{constructor(t,e,n,o,s,r,a){f(this,"hooks",new qt);f(this,"helperObject3D");f(this,"originObject3D");f(this,"camera");f(this,"model");f(this,"scene");f(this,"container");f(this,"domEvents");f(this,"isDragging",!1);f(this,"onRender");f(this,"enabled",!1);f(this,"onWantsTapGesture",t=>{if(this.getIntersectObject(t))return!1});this.camera=t,this.model=e,this.originObject3D=n,this.helperObject3D=o,this.container=s,this.scene=r,this.domEvents=new pe(t,s),this.onRender=a!=null?a:()=>{},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 E.Mesh&&(e.material.opacity=t),e.isCSS3DObjectPlus){const n=e;n.container.style.opacity=t.toString()}this.render()}restoreOpacity(){if(Pt===null)return;const t=this.originObject3D;if(t instanceof E.Mesh&&(t.material.opacity=Pt.opacity),t.isCSS3DObjectPlus){const e=t;e.container.style.opacity=Pt.opacity.toString()}this.render()}setOriginOpacityProperty(){var t,e;if(Pt===null){const n=this.originObject3D;n instanceof E.Mesh&&(Pt={opacity:n.material.opacity}),n instanceof Yr&&(Pt={opacity:(t=n.container.style.opacity)!=null?t:1}),n.isCSS3DObjectPlus&&(Pt={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 o=(Array.isArray(t)?t:[t]).filter(Bt),s=[];for(const r of o)if(r instanceof E.Mesh||r instanceof E.Group){const a=r instanceof E.Group?r.children.filter(h=>h instanceof E.Mesh):[r];a.forEach(h=>{h.__originalColor__=h.material.color.clone(),h.__originalOpacity__=h.material.opacity});const l=()=>{a.forEach(h=>{h.material.color.set(e),h.material.opacity=n}),this.render()},c=()=>{a.forEach(h=>{h.material.color.copy(h.__originalColor__),h.material.opacity=h.__originalOpacity__}),this.render()},u=()=>{this.isDragging||l()},d=()=>{this.isDragging||c()};for(const h of a)this.domEvents.addEventListener(h,"mouseover",u),this.domEvents.addEventListener(h,"mouseout",d),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",c),this.hooks.on("rotateEnd",c),s.push(()=>{this.domEvents.removeEventListener(h,"mouseover",u),this.domEvents.removeEventListener(h,"mouseout",d),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",c),this.hooks.off("rotateEnd",c)})}return()=>s.forEach(r=>r==null?void 0:r())}getIntersectObject(t){const e=this.camera.position,n=this.helperObject3D;if(!n)return;let o;const s=t.intersectObject(n,!0)[0];if(!!s&&(o=s,o.object=n,!!o)){if(this.model.intersectRaycaster){const r=this.model.intersectRaycaster(t)[0];if(r&&r.point.distanceTo(e)<o.point.distanceTo(e))return}return o.object}}}class f0 extends ho{constructor(...e){super(...e);f(this,"startInfo");const n=this.helperObject3D;this.hoverListener([n.xArrow,n.yArrow,n.zArrow]);const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r)}dragStart(e){if(this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();const s=new E.Vector3(1,0,0).applyQuaternion(this.helperObject3D.quaternion),r=new E.Vector3(0,1,0).applyQuaternion(this.helperObject3D.quaternion),a=new E.Vector3(0,0,1).applyQuaternion(this.helperObject3D.quaternion),l=(()=>{switch(o){case"x":return s;case"y":return r;case"z":return a}})(),c=(()=>{switch(o){case"x":case"y":return a;case"z":return s}})(),u=n.point.clone(),d=new E.Plane;d.setFromNormalAndCoplanarPoint(c,u),this.startInfo={startVectorProject:u.clone().projectOnVector(l),directionVector:l,plane:d},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("moveStart"),this.isDragging=!0,console.log("%c MoveController dragStart","color: #e5af2e")}dragging(e){if(!this.isDragging||!this.startInfo)return;const n=uo(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:o,startVectorProject:s}=this.startInfo,r=this.originObject3D,a=e.ray.intersectPlane(n,new E.Vector3);if(!a)return;const l=a.clone().projectOnVector(o),c=l.clone().sub(s),u=new E.Matrix4;u.setPosition(c),r.applyMatrix4(u),this.helperObject3D.applyMatrix4(u),s.copy(l),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 Si{constructor(t,e,n,o){f(this,"helperController");f(this,"five");f(this,"onFiveWantsTapGesture",t=>{if(!this.helperController)return;const e=this.helperController.onWantsTapGesture(t);return this.five.needsRender=!0,e});f(this,"onFiveWantsGesture",(...t)=>{if(!this.helperController)return;const e=this.helperController.onWantsGesture(...t);return this.five.needsRender=!0,e});const{camera:s,model:r,scene:a}=t,l=t.getElement();if(this.five=t,!s||!r||!l||!a)return;const c=()=>{t.needsRender=!0};this.helperController=new e(s,r,n,o,l,a,c),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsGesture",this.onFiveWantsGesture)}}const m0="v1.0.1",p0="Object3DHelper",fo=`${p0}@${m0}`,g0=()=>{console.error(`${fo} is disposed`)},A0=()=>{console.warn(`${fo} is disabled`)},v0=()=>{console.error(`${fo} is disabled`)};class b0{constructor(t,e){f(this,"controllers",{});f(this,"state",{visible:!0,enabled:!0,disposed:!1});f(this,"hooks",new qt);f(this,"helpers");f(this,"eventListener",{});f(this,"handlePositionUpdate",(t,...e)=>{var s,r,a,l;const[n]=e,o=n==null?void 0:n.matrix4;o&&(t!==this.controllers.moveController&&((s=this.controllers.moveController)==null||s.applyHelperMatrix4(o)),t!==this.controllers.rotateController&&((r=this.controllers.rotateController)==null||r.applyHelperMatrix4(o)),t!==this.controllers.scaleController&&((a=this.controllers.scaleController)==null||a.applyHelperMatrix4(o)),(l=this.helpers.outlineHelper)==null||l.applyMatrix4(o))});f(this,"handleScaleUpdate",(t,...e)=>{var s,r;const[n]=e,o=n==null?void 0:n.matrix4;o&&((s=this.controllers.scaleController)==null||s.applyHelperScaleMatrix4(o,n),(r=this.helpers.outlineHelper)==null||r.scale.applyMatrix4(o))});f(this,"handleRotateUpdate",(t,...e)=>{var o,s,r,a;const[n]=e;if(n){const{quaternion:l,origin:c}=n;l&&(t!==this.controllers.moveController&&((o=this.controllers.moveController)==null||o.applyHelperQuaternion(l,c)),t!==this.controllers.rotateController&&((s=this.controllers.rotateController)==null||s.applyHelperQuaternion(l,c)),t!==this.controllers.scaleController&&((r=this.controllers.scaleController)==null||r.applyHelperQuaternion(l,c)),(a=this.helpers.outlineHelper)==null||a.applyQuaternion(l))}});t&&this.addControllers(t),this.helpers=e!=null?e:{},this.setState(this.state)}show(t){return J(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return J(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 g0();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return v0();const n=N({},this.state);this.state=N(N({},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=N(N({},this.controllers),t),this.addEventListener(),this.setState(this.state)}addHelpers(t){this.helpers=N(N({},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 o=()=>this.handleStart(n),s=()=>this.handleEnd(n),r=(...c)=>this.handlePositionUpdate(n,...c),a=(...c)=>this.handleRotateUpdate(n,...c),l=(...c)=>this.handleScaleUpdate(n,...c);return n.hooks.on("moveStart",o),n.hooks.on("rotateStart",o),n.hooks.on("scaleStart",o),n.hooks.on("positionUpdate",r),n.hooks.on("rotateUpdate",a),n.hooks.on("scaleUpdate",l),n.hooks.on("moveEnd",s),n.hooks.on("rotateEnd",s),n.hooks.on("scaleEnd",s),()=>{n.hooks.off("moveStart",o),n.hooks.off("rotateStart",o),n.hooks.off("scaleStart",o),n.hooks.off("positionUpdate",r),n.hooks.off("rotateUpdate",a),n.hooks.off("scaleUpdate",l),n.hooks.off("moveEnd",s),n.hooks.off("rotateEnd",s),n.hooks.off("scaleEnd",s)}})())}}handleEnd(t){t&&this.setOtherHelpersVisible(!0,t)}handleStart(t){t&&this.setOtherHelpersVisible(!1,t)}setOtherHelpersVisible(t,e){var n,o,s,r;t?((s=this.controllers.moveController)==null||s.helperObject3D.show(),(r=this.controllers.rotateController)==null||r.helperObject3D.show()):(e!==this.controllers.moveController&&((n=this.controllers.moveController)==null||n.helperObject3D.hide()),e!==this.controllers.rotateController&&((o=this.controllers.rotateController)==null||o.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 o=n;(e=(t=this.eventListener)[o])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&A0()}}class y0 extends ho{constructor(...e){super(...e);f(this,"startInfo");f(this,"lastRotation");f(this,"rotations",[]);f(this,"helperObject3DQuaternion",this.originObject3D.quaternion.clone());const n=this.helperObject3D;this.hoverListener([n.xyCircle,n.xzCircle,n.yzCircle]);const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r)}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 o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();this.helperObject3D.updateAngleHelperQuaternion();const s=n.point,r=this.originObject3D.position.clone(),a=this.getAngleHelper(o);this.setTipsAngle(0);const l=s.clone();l.y+=.2,this.setTipsPosition(l);const c=new E.Vector3(1,0,0).applyQuaternion(this.helperObject3DQuaternion),u=new E.Vector3(0,1,0).applyQuaternion(this.helperObject3DQuaternion),d=new E.Vector3(0,0,1).applyQuaternion(this.helperObject3DQuaternion),h=(()=>{switch(o){case"x":return c;case"y":return u;case"z":return d}})(),p=new E.Plane().setFromNormalAndCoplanarPoint(h,s),m=new E.Vector3;p.projectPoint(s.clone(),m);const g=m.clone().sub(r),A=g.clone(),v=g.angleTo(a.baseAxes);this.setAngleHelperStart(o,v),this.setAngleHelperLength(o,0),this.rotations.push({vector:g.clone(),direction:!0}),this.startInfo={direction:o,startVector:g,staticStartVector:A,plane:p,angleHelper:a},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("rotateStart"),this.isDragging=!0,console.log(`%c RotateController dragStart ${o}`,"color: #e5af2e")}dragging(e){var o;if(!this.isDragging)return;const n=uo(this.camera,e,this.container);return n?(console.log(`%c RotateController dragging ${(o=this.startInfo)==null?void 0:o.direction}`,"color: #49de1b"),this.rotate(n),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:n,plane:o,angleHelper:s,staticStartVector:r,direction:a}=this.startInfo,l=this.originObject3D,c=e.ray.intersectPlane(o,new E.Vector3);if(!c)return;const u=l.position.clone(),d=new E.Vector3;o.projectPoint(c.clone(),d);const h=d.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(s.baseAxes)>r.angleTo(s.baseAxes);{const g=this.rotations[this.rotations.length-1],A=this.rotations[this.rotations.length-2],v=h.angleTo(A.vector),w=h.angleTo(g.vector),y=g.vector.angleTo(A.vector);if(y===0||w===0||v===0)return;if(v>w&&v>y)return g.direction;if(v<y&&w<y||v<w&&w>y)return!g.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(a,this.lastRotation.angle),this.setTipsAngle(this.lastRotation.angle/Math.PI*180);const m=new E.Quaternion().setFromUnitVectors(n.clone().normalize(),h.clone().normalize());l.applyQuaternion(m),this.helperObject3D.applyHelperQuaternion(m),this.helperObject3DQuaternion.premultiply(m),this.hooks.emit("rotateUpdate",{quaternion:m,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 o=this.getAngleHelper(e);if(o instanceof E.Mesh&&o.geometry instanceof E.CircleGeometry){const{radius:s,segments:r,thetaLength:a}=o.geometry.parameters;o.geometry=new E.CircleGeometry(s,r,n,a)}else console.warn("only support THREE.CircleGeometry")}setAngleHelperLength(e,n){const s=n>=0?Math.max(n,.001):Math.min(n,-.001),r=this.getAngleHelper(e);if(r instanceof E.Mesh&&r.geometry instanceof E.CircleGeometry){const{radius:a,thetaStart:l}=r.geometry.parameters,c=Math.ceil(Math.abs(s)*(40/(2*Math.PI)));r.geometry=new E.CircleGeometry(a,c,l,s)}else console.warn("only support THREE.CircleGeometry")}setTipsAngle(e){var o;const n=(o=this.helperObject3D.angleTips)==null?void 0:o.element;!n||(n.innerText=`${e.toFixed(0)}\xB0`)}setTipsPosition(e){const n=this.helperObject3D.angleTips;if(!n)return;const o=e.project(this.camera),{x:s,y:r,z:a}=o;if(a>1)return;const l=(s+1)/2*100+"%",c=(-r+1)/2*100+"%";n.setLeftTop(l,c)}}class w0 extends ho{constructor(...e){super(...e);f(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 E.Plane,n=this.helperObject3D.cornerPositions;if(n.length!==0)return n.length<3?e.setFromNormalAndCoplanarPoint(this.originObject3D.getWorldDirection(new F.Vector3),n[0]):e.setFromCoplanarPoints(n[0],n[1],n[2]),e}dragStart(e,n){var s,r;(r=(s=this.helperObject3D).updatePoints)==null||r.call(s);const o=this.getDragPlane();if(!o)return this.dragEnd();this.startInfo={startPoint:{position:n.position.clone(),direction:n.direction},plane:o},this.hooks.emit("scaleStart"),this.render(),this.isDragging=!0,console.log("%c RectangleScaleController dragStart","color: #e5af2e")}dragging(e){if(!this.isDragging)return;const n=uo(this.camera,e,this.container);if(!n)return this.dragEnd();this.scale(n),console.log("%c RectangleScaleController dragging","color: #49de1b")}scale(e){var G,O;if(!this.startInfo)return;const n=this.originObject3D,{startPoint:o,plane:s}=this.startInfo,r=this.helperObject3D.cornerPositions;if(r.length<4)return this.dragEnd();const a=e.ray.intersectPlane(s,new F.Vector3);if(!a||r0(a,this.camera.position))return;const l=new F.Vector3().addVectors(r[0],r[2]).divideScalar(2),{position:c,direction:u}=o,d=new F.Vector3().subVectors(r[1],r[0]),h=new F.Vector3().subVectors(r[3],r[0]),p=W=>{const U=new F.Vector3(0,0,0);if(!this.startInfo)return U;const P=(W==="ew"?d:h).clone(),I=c.clone().projectOnVector(P),z=a.clone().projectOnVector(P),H=l.clone().projectOnVector(P);if(z.equals(I))return U;if(W==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const Y=new F.Vector3().subVectors(z,H),V=Y.x<0&&P.x>=0,ue=Y.y<0&&P.y>=0,de=Y.z<0&&P.z>=0;this.startInfo.dragPointInCenterBottom=V||ue||de}if(W==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const Y=new F.Vector3().subVectors(z,H),V=Y.x<0&&P.x>=0,ue=Y.y<0&&P.y>=0,de=Y.z<0&&P.z>=0;this.startInfo.dragPointInCenterLeft=V||ue||de}const X=new F.Vector3().subVectors(z,I),Z=X.length();return Z>.3?(console.warn("offset.length() > 0.3, skipped",Z),U):X},m=p("ew"),g=p("ns"),A=()=>{const W=m;this.helperObject3D.cornerPositions.forEach((U,P)=>{var I;(I=this.startInfo)!=null&&I.dragPointInCenterLeft?(P===0||P===3)&&U.add(W):(P===1||P===2)&&U.add(W)})},v=()=>{const W=g;this.helperObject3D.cornerPositions.forEach((U,P)=>{var I;(I=this.startInfo)!=null&&I.dragPointInCenterBottom?(P===0||P===1)&&U.add(W):(P===2||P===3)&&U.add(W)})};switch(u){case"ew":A();break;case"ns":v();break;case"nesw":case"nwse":A(),v()}const w=new F.Vector3().subVectors(r[1],r[0]).length()/d.length(),y=new F.Vector3().subVectors(r[3],r[0]).length()/h.length(),x=new F.Vector3(w,y,1),L=new E.Matrix4().scale(x);n.isCSS3DObjectPlus?n.applyScaleMatrix4(L):n.scale.applyMatrix4(L),o.position.copy(a);const C=new F.Vector3().addVectors(r[0],r[2]).divideScalar(2),S=new F.Vector3().subVectors(C,l),k=new E.Matrix4().setPosition(S);n.applyMatrix4(k),(G=this.helperObject3D.css3DInstance)==null||G.css3DObject.applyMatrix4(k),(O=this.helperObject3D.plane)==null||O.applyMatrix4(k),this.hooks.emit("scaleUpdate",{matrix4:L,helperOrigin:l}),this.hooks.emit("positionUpdate",{matrix4:k}),this.render()}dragEnd(){!this.isDragging||(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render(),console.log("%c RectangleScaleController dragEnd","color: #e94e4e"))}}class C0 extends w0{constructor(...t){super(...t),this.addHTMLEventListener()}addHTMLEventListener(){this.helperObject3D.points.forEach(t=>{if(!t)return;const e=t.point,n=r=>this.dragStart(r,t),o=this.dragging.bind(this),s=this.dragEnd.bind(this);e.addEventListener("dragstart",n),e.addEventListener("drag",o),e.addEventListener("dragend",s)})}}const mo="v1.0.0",Yi="Object3DHelperPlugin",hi=`${Yi}@${mo}`,E0=()=>{console.error(`${hi} is disposed`)},P0=()=>{console.warn(`${hi} is disabled`)},I0=()=>{console.error(`${hi} is disabled`)};class Ka extends ai{constructor(e){super(e);f(this,"version",mo);f(this,"name",Yi);f(this,"state",{visible:!0,enabled:!0,disposed:!1});f(this,"objectHelperMap",new Map);f(this,"css3DObjectParentMap",new Map);f(this,"css3DRender");this.five=e,this.css3DRender=new Vt(this.five.scene),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,{[`__${Yi.toUpperCase()}_DEBUG__`]:this})}show(e){return J(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return J(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 E0();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return I0();const o=N({},this.state);this.state=N(N({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:o})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,n={}){var 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 o=new b0;this.objectHelperMap.set(e,o);const s=(u=this.five.getElement())==null?void 0:u.parentElement,r=this.five.camera,{moveHelper:a=!0,rotateHelper:l=!0,scaleHelper:c=!0}=n;if(a){const d=new a0(e),h=new Si(this.five,f0,e,d);o.addControllers({moveController:h.helperController})}if(l){let d;s&&r&&(d={container:s});const h=new u0(e,d),p=new Si(this.five,y0,e,h);o.addControllers({rotateController:p.helperController})}if(c&&s){const d=new h0(e,s,r,this.five.scene),h=new Si(this.five,C0,e,d);o.addControllers({scaleController:h.helperController})}e.isCSS3DObjectPlus&&Vr(this.five).then(()=>{var p,m;const d=e,h=(p=this.css3DRender.behindModeCSS3DRenderer.wrapper)!=null?p:Jr(this.five);h&&(this.css3DObjectParentMap.set(d,d.parent),d.removeFromParent(),this.css3DRender.behindModeCSS3DRenderer.setWrapper(h),(m=this.css3DRender.getBehindCSS3DObjectGroup())==null||m.add(d),this.css3DRender.render(this.five.camera))})}removeObject3DHelper(e){const n=this.objectHelperMap.get(e);if(!!n){if(e.isCSS3DObjectPlus){const o=e,s=this.css3DObjectParentMap.get(o);s==null||s.add(o),this.css3DRender.render(this.five.camera)}this.objectHelperMap.delete(e),n.dispose()}}handleEnable(e,n=!0){e?(this.everyHelperDo(o=>o.enable()),this.hooks.emit("enable",{userAction:n})):(this.everyHelperDo(o=>o.disable()),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){e?(this.everyHelperDo(o=>o.show()),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.everyHelperDo(o=>o.hide()),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}handleDispose(){this.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&&P0()}}const x0=i=>new Ka(i);class Ui{constructor(t=0,e=0){f(this,"min");f(this,"max");f(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 k0{constructor(t,e){f(this,"min");f(this,"max");f(this,"xInterval");f(this,"yInterval");f(this,"isRectangle",!0);this.min=t,this.max=e,this.xInterval=new Ui(this.min.x,this.max.x),this.yInterval=new Ui(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 Qn(i,t,e){const n=i[t],o=i[e];!n||!o||(i[t]=o,i[e]=n)}function D0(i,t,e){const n=e/2;for(let o=1;o<=n;o++){const s=e-(o-1);for(let r=1;r<=t;r++){const a=(o-1)*t+r-1,l=(s-1)*t+r-1;Qn(i,a*4+0,l*4+0),Qn(i,a*4+1,l*4+1),Qn(i,a*4+2,l*4+2),Qn(i,a*4+3,l*4+3)}}}class $a{constructor(t,e){f(this,"width");f(this,"height");f(this,"containerDom");f(this,"hooks",new be.Subscribe);f(this,"canvas",document.createElement("canvas"));f(this,"five");f(this,"scale");f(this,"config");f(this,"offset",{x:0,y:0});f(this,"context");f(this,"renderCenter",new E.Vector3);f(this,"hammer");f(this,"state",{enabled:!1});f(this,"onPan",t=>{if(!this.containerDom||this.hooks.emit("wantsPanGesture",t))return;const n=this.offset.x+t.deltaX,o=this.offset.y+t.deltaY;this.canvas.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)",this.canvas.style.transform=`translate3d(${n}px, ${o}px, 100px)`});f(this,"onPanEnd",t=>{this.offset={x:this.offset.x+t.deltaX,y:this.offset.y+t.deltaY},this.canvas.style.boxShadow="none"});var o,s,r;if(!t.renderer)throw new Error("Five Render \u672A\u521D\u59CB\u5316");this.five=t,this.scale=(o=e==null?void 0:e.scale)!=null?o:2,this.width=(s=e==null?void 0:e.width)!=null?s:190,this.height=(r=e==null?void 0:e.height)!=null?r:190,this.config={dragEnabled:(e==null?void 0:e.dragEnabled)||!1,autoFixPCPosition:(e==null?void 0:e.autoFixPCPosition)||!1,initialPosition:(e==null?void 0:e.initialPosition)||{left:"0",top:"0"}};const n=this.canvas.getContext("2d");if(!n)throw new Error("CANNOT CREATE CONTEXT2D");this.context=n,this.config.dragEnabled&&(this.hammer=new gn.default(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panend",this.onPanEnd)),this.initStyle()}dispose(){var t;this.clear(),this.disable(),(t=this.hammer)==null||t.destroy()}enable(){var t;if(!this.state.enabled)return this.state.enabled=!0,(t=this.containerDom)==null||t.append(this.canvas),this}disable(){if(!!this.state.enabled)return this.state.enabled=!1,this.canvas.remove(),this}appendTo(t){var e;return this.containerDom&&((e=this.containerDom)==null||e.removeChild(this.canvas)),this.containerDom=t,this.state.enabled&&t.append(this.canvas),this}clear(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this}renderWithPoint(t){!this.containerDom||!this.state.enabled||(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}autoFixPCPosition(){if(!this.containerDom)return;const{width:t,height:e}=this,n=this.renderCenter.clone().project(this.five.camera),o=(n.x+1)/2*this.containerDom.clientWidth,s=-(n.x-1)/2*this.containerDom.clientWidth,r=-(n.y-1)/2*this.containerDom.clientHeight;o<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=90+"px"):r<183?(this.canvas.style.top=90+"px",this.canvas.style.left=-t/2+"px"):s<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=-t-90+"px"):(this.canvas.style.left=-t/2+"px",this.canvas.style.top=-e-90+"px"),this.canvas.style.transform=`translate3d(${o}px, ${r}px, 10px)`,this.offset={x:o,y:r}}render(){if(!this.five.renderer||!this.containerDom)return;const{scale:t,context:e,width:n,height:o}=this,s=this.renderCenter.clone().project(this.five.camera),r=this.five.renderer.getSize(new E.Vector2),a=1,l=n/t,c=o/t,u=a*t,d=(s.x+1)/2*r.x,h=(s.y+1)/2*r.y,p=this.five.getPixels(d-l/2,h-l/2,l,c,u),m=Math.floor(n*a),g=Math.floor(o*a);D0(p,m,g);const A=new ImageData(m,g);A.data.set(p),e.putImageData(A,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}}function L0(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return new E.Vector2().set((i.x-s)/e*2-1,-(i.y-o)/n*2+1)}function el(i,t){const{offsetWidth:e,offsetHeight:n}=t;return new E.Vector2().set(i.x/e*2-1,-i.y/n*2+1)}function S0(i,t){const e=i.getElement();if(!e)return;const n=el(t,e),o=new E.Raycaster;return o.setFromCamera(n,i.camera),o}function z0(i,t){const{x:e,y:n}=t,o=e*2-1,s=n*2-1,r=new E.Vector2().fromArray([o,s]),a=new E.Raycaster;return a.setFromCamera(r,i.camera),i.model.intersectRaycaster(a)[0]}const M0="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbYAAAGwCAYAAADFUEBtAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABtqADAAQAAAABAAABsAAAAABTZ8U6AAAtiklEQVR4Ae2dAXJbSbJdp+d7AfYSHOGVeAPek5fkNXgLjviLmRkZl+CRbtc8UBKRRalZpyIesiorMx/eIcjb+QCh//Y3hwQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkMEbgj7FKFpLA4QS+fPnyx23czJc//V498h2Oy8uXwDYCf/oF3HYWC0vgAAI3QfuP22V+uR35vYplrOsX/03w/kWAVgISmCPwX+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ACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQn8NQn8fyHnyuSABiy2AAAAAElFTkSuQmCC",T0=`
|
|
547
547
|
varying vec2 vUv;
|
|
548
548
|
void main() {
|
|
549
549
|
vUv = uv;
|