@realsee/dnalogel 2.0.5-alpha.5 → 2.0.5-alpha.6
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.es.js +205 -204
- package/dist/index.js +205 -204
- package/dist/index.umd.js +12 -12
- package/docs/classes/CruisePluginController.html +1 -1
- package/docs/classes/Magnifier.html +1 -1
- package/docs/classes/ModelRoomLabelController.html +1 -1
- package/docs/classes/PaintBrush.html +1 -1
- package/docs/enums/CameraMovementEffect.html +1 -1
- package/docs/enums/DIRECTION.html +1 -1
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
- package/docs/enums/PaintBrushTypeEnum.html +1 -1
- package/docs/enums/Rotation.html +1 -1
- package/docs/index.html +1 -1
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +1 -1
- package/docs/interfaces/CSS3DRenderPluginState.html +1 -1
- package/docs/interfaces/CameraMovementPluginExportType.html +1 -1
- package/docs/interfaces/FloorplanBounding.html +1 -1
- package/docs/interfaces/FloorplanData.html +1 -1
- package/docs/interfaces/FloorplanEntrance.html +1 -1
- package/docs/interfaces/FloorplanExtraObject.html +1 -1
- package/docs/interfaces/FloorplanExtraObject3D.html +1 -1
- package/docs/interfaces/FloorplanFloorData.html +1 -1
- package/docs/interfaces/FloorplanImagePosition.html +1 -1
- package/docs/interfaces/FloorplanObserver.html +1 -1
- package/docs/interfaces/FloorplanOutlineItem.html +1 -1
- package/docs/interfaces/FloorplanPosition.html +1 -1
- package/docs/interfaces/FloorplanRoomItem.html +1 -1
- package/docs/interfaces/FloorplanRoomLabelItem.html +1 -1
- package/docs/interfaces/FloorplanServerBounding.html +1 -1
- package/docs/interfaces/FloorplanServerComputedData.html +1 -1
- package/docs/interfaces/FloorplanServerData.html +1 -1
- package/docs/interfaces/FloorplanServerDoorItem.html +1 -1
- package/docs/interfaces/FloorplanServerDoorPosition.html +1 -1
- package/docs/interfaces/FloorplanServerEntrance.html +1 -1
- package/docs/interfaces/FloorplanServerFloorData.html +1 -1
- package/docs/interfaces/FloorplanServerImagePosition.html +1 -1
- package/docs/interfaces/FloorplanServerObserver.html +1 -1
- package/docs/interfaces/FloorplanServerOutlineItem.html +1 -1
- package/docs/interfaces/FloorplanServerPosition.html +1 -1
- package/docs/interfaces/FloorplanServerRoomItem.html +1 -1
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +1 -1
- package/docs/interfaces/ItemLabelPluginData.html +1 -1
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/LineJson.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
- package/docs/interfaces/ModelViewPluginExportType.html +1 -1
- package/docs/interfaces/OpenParameter.html +1 -1
- package/docs/interfaces/PaintBrushAction.html +1 -1
- package/docs/interfaces/PaintBrushConfigs.html +1 -1
- package/docs/interfaces/PaintBrushState.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
- package/docs/interfaces/PanoMeasureParameterType.html +1 -1
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PanoRulerProPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerProPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerProPluginParameterType.html +1 -1
- package/docs/interfaces/PanoRulerProPluginState.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
- package/docs/interfaces/Point.html +1 -1
- package/docs/interfaces/PointJson.html +1 -1
- package/docs/interfaces/Room.html +1 -1
- package/docs/interfaces/RoomInfo.html +1 -1
- package/docs/interfaces/RoomLabel.html +1 -1
- package/docs/interfaces/RoomRules.html +1 -1
- package/docs/interfaces/Rooms.html +1 -1
- package/docs/modules.html +1 -1
- package/libs/ModelTVVideoPlugin/Plugin.js +40 -39
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -98,10 +98,10 @@ transition: all 500ms;
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
</style>
|
|
101
|
-
`;class kr extends Er{constructor(e){super();d(this,"configs");d(this,"clientWidth");d(this,"clientHeight");d(this,"ready",!1);d(this,"uuid",lt());d(this,"tween");d(this,"tweening",!1);d(this,"container");d(this,"canvas");d(this,"data",{});d(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=Lr,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 u;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:at.Undo,color:this.color,ready:this.ready,state:l,uuid:this.uuid});const c=(u=this.canvas[this.uuid])==null?void 0:u.getContext("2d");if(!this.canvas[this.uuid])return;const{width:h,height:f}=this.canvas[this.uuid];c&&c.clearRect(0,0,h,f),this.data[this.uuid].forEach(m=>this.handleDrawLine(this.uuid,m,{withUndo:!0}))});const s=document.createElement("a");return s.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--close",s.addEventListener("click",a=>{a.stopPropagation(),this.closeBrush(),this.configs.onClickClose&&this.configs.onClickClose()}),[o,s].forEach(a=>{const l=document.createElement("i");l.className="brush-icon";const c=document.createElement("span");c.className="brush-txt",c.innerText=a.className.endsWith("undo")?this.configs.onUndoText:this.configs.onExitText,a.appendChild(l),a.appendChild(c)}),n.appendChild(o),n.appendChild(s),e.appendChild(n),this.container.appendChild(e),e}openBrush(){if(this.ready)return;this.canvas[this.uuid]||(this.canvas[this.uuid]=this.initCanvas("_paintBrush-canvas")),this.container.className="brushing";const e=this.canvas[this.uuid];e.getContext("2d").clearRect(0,0,e.width,e.height),this.openBrushHandle(),this.ready=!0,this.emit("readyChange",!0)}closeBrush(){!this.ready||(this.container.className="",this.data={},this.tempLine={},Object.keys(this.canvas).forEach(e=>{this.canvas[e].ontouchstart=()=>!1,this.canvas[e].ontouchmove=()=>!1,this.canvas[e].ontouchend=()=>!1,this.canvas[e].ontouchcancel=()=>!1;const n=this.canvas[e].getContext("2d");n&&n.clearRect(0,0,this.canvas[e].width,this.canvas[e].height)}),this.ready=!1,this.emit("readyChange",!1),this.emitStateChange({type:at.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 h=(f,u,m)=>{const g=this.color||"#ff0000";n.strokeStyle=g,n.beginPath(),n.moveTo(f.x,f.y),n.quadraticCurveTo(u.x,u.y,m.x,m.y),n.stroke()};e.onmousedown=f=>{f.preventDefault(),c=Date.now();const u=f.clientX,m=f.clientY;r=[],r.push({x:u,y:m}),s={x:u,y:m},a=rn({x:u,y:m},this.clientWidth,this.clientHeight),l=[]},e.onmousemove=f=>{if(f.preventDefault(),!s)return;const u=Number(f.clientX),m=Number(f.clientY);if(Math.abs(u-s.x)<5&&Math.abs(m-s.y)<5||(r.push({x:u,y:m}),l.push(rn({x:u,y:m},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:g,end:v}=an(r);!g||!v||(h(s,g,v),s=v)},e.onmouseup=f=>{if(f.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const u=Date.now()-c,m={move:Object.assign({},a),uuid:this.uuid,line:[...l],color:this.color,duration:u<1280?u:u<2e3?1280:0};this.data[this.uuid].push(m),ln(()=>{this.emitStateChange({type:at.Drawline,color:this.color,ready:this.ready,state:m,uuid:this.uuid})})},e.ontouchstart=f=>{f.preventDefault(),c=Date.now();const u=f.touches[0].clientX,m=f.touches[0].clientY;r=[],r.push({x:u,y:m}),s={x:u,y:m},console.log("ontouchstart",u,m,s),a=rn({x:u,y:m},this.clientWidth,this.clientHeight),l=[]},e.ontouchmove=f=>{if(f.preventDefault(),!s)return;const u=Number(f.touches[0].clientX),m=Number(f.touches[0].clientY);if(Math.abs(u-s.x)<5&&Math.abs(m-s.y)<5||(r.push({x:u,y:m}),l.push(rn({x:u,y:m},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:g,end:v}=an(r);!g||!v||(h(s,g,v),s=v)},e.ontouchend=e.ontouchcancel=f=>{if(f.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const u=Date.now()-c,m={move:Object.assign({},a),line:[...l],uuid:this.uuid,color:this.color,duration:u<1280?u:u<2e3?1280:0};this.data[this.uuid].push(m),ln(()=>{this.emitStateChange({type:at.Drawline,color:this.color,ready:this.ready,state:m,uuid:this.uuid})})}}emitStateChange(e,n=!0){if(e.type!==at.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};Pr(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 at.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 at.Undo:this.handleUndo(s);break}}handleDrawLine(e,n,{withUndo:o=!1},s=Ji){!n||Object.prototype.toString.call(n)!="[object Object]"||Object.keys(n).length===0||(console.log("handleDrawLine",n,n.line),yr(()=>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:h=0,uuid:f}=n,u=ti(n.move||{},this.clientWidth,this.clientHeight);let m=[u];if(a.strokeStyle=c,a.beginPath(),a.moveTo(u.x,u.y),h&&!o){let g=[];const v=this;v.tween=xr({step:0},{step:l.length-1},h).onUpdate(({step:b})=>{var x;if(v.tweening=!0,!v.ready)return a.clearRect(0,0,v.canvas[f].width,v.canvas[f].height),(x=v.tween)==null?void 0:x.stop();const y=Math.floor(b);if(!g.find(P=>P===y)){if(g.push(y),console.log("__debug__",l,l[y],y),m.push(ti(l[y],v.clientWidth,v.clientHeight)),m.length<3)return;const{control:P,end:k}=an(m);if(!P||!k)return;a.quadraticCurveTo(P.x,P.y,k.x,k.y),a.stroke()}}).onComplete(b=>{v.tween=void 0,v.tweening=!1,g=[],m=[],s&&s(),r()})}else{for(let g=0;g<l.length;g++){if(m.push(ti(l[g],this.clientWidth,this.clientHeight)),m.length<3)continue;const{control:v,end:b}=an(m);!v||!b||a.quadraticCurveTo(v.x,v.y,b.x,b.y)}a.stroke(),m=[],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(),ln(n,60);return}n()}destroyBrush(){this.closeBrush(),this.ready=!1,this.emit("readyChange",!0)}}class Dr{constructor(t={}){d(this,"controller");const e=Object.assign({currentColor:"#f44336",onUndoText:"\u56DE\u9000",onExitText:"\u5173\u95ED"},t);this.controller=new kr(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 Tr=(i,t)=>{let e=!0,n=null;const s={...{lookAtCurrentCamera:!1,lockedPanoIndex:null,lockedLatitude:null,lockedLongitude:null},...t==null?void 0:t.config},r=new O.Scene,a=new me.Camera(60);let l=new O.Object3D,c,h;{const I=new O.DirectionalLight(16777215,.5);I.position.copy(new O.Vector3(1,1,1)),r.add(I)}{const I=new O.DirectionalLight(16777215,.3);r.add(I)}{const I=new O.AmbientLight(16777215,.3);r.add(I)}r.add(l);const f=()=>{if(!!i.renderer)return n||(n=new O.WebGLRenderer({antialias:!1,alpha:!0}),n.setPixelRatio(i.renderer.getPixelRatio()),n.outputEncoding=O.sRGBEncoding,n.setClearColor(1579548,0),n.autoClear=!0),n},u=()=>{l.traverse(I=>{I instanceof O.Mesh&&[].concat(I.material).forEach(E=>E.dispose())}),r.remove(l),l=new O.Object3D,r.add(l),x()},m=()=>{c=b(i.model,a.fov,a.aspect),h=i.model.bounding.getCenter(new O.Vector3);function I(E){const z=E.clone();return z.uniforms.modelAlpha.value=1,z.uniforms.map.value&&(z.uniforms.map.value.needsUpdate=!0),z}function D(E){if(E instanceof O.Mesh){const z=E.geometry,F=Array.isArray(E.material)?E.material.map(I):I(E.material);return new O.Mesh(z,F)}else if(E instanceof O.Group){const z=new O.Group;return E.children.forEach(F=>z.add(D(F))),z}else{const z=new O.Object3D;return E.children.forEach(F=>z.add(D(F))),z}}r.remove(l),l=D(i.model),r.add(l),x()},g=(I,D={})=>{const E=f();if(!E)return;I.appendChild(E.domElement),v(D);const z=window.getComputedStyle(I).position;z!=="relative"&&z!=="absolute"&&z!=="fixed"&&z!=="sticky"&&(I.style.position="relative")},v=(I={})=>{if(!n)return;const E=n.domElement.parentNode;if(E!=null&&E.nodeName){const{width:z=E.offsetWidth,height:F=E.offsetHeight}=I;n.setSize(z,F),a.aspect=z/F,a.updateProjectionMatrix()}x()};function b(I,D,E){const z=I.bounding,F=Math.pow(Math.pow(z.max.x-z.min.x+1,2)+Math.pow(z.max.y-z.min.y+1,2)+Math.pow(z.max.z-z.min.z+1,2),1/2);let R=F/2/Math.tan(Math.PI*D/360);return E<1&&(R=R/E),isNaN(R)?F:R}function y(I){return i.work.observers[I].standingPosition.clone()}const x=()=>{if(!c||!h)return;const I=i.getPose();I.fov=a.fov,I.offset=h,I.distance=c,typeof s.lockedLatitude=="number"&&(I.latitude=s.lockedLatitude),typeof s.lockedLongitude=="number"&&(I.longitude=s.lockedLongitude),typeof s.lockedPanoIndex=="number"&&(I.offset=y(s.lockedPanoIndex)),s.lookAtCurrentCamera&&(I.offset=i.camera.position.clone().setY(i.camera.position.y+1)),a.setFromPose(I),e=!0},P=()=>{e!==!0||!n||!n.domElement.parentNode||n.domElement.parentNode.offsetWidth===0||(n.render(r,a),e=!1)},k=()=>{n&&n.dispose(),n=null},T=I=>{Object.assign(s,I),x()};return Object.assign(window,{camera:a}),i.on("modelLoaded",m),i.on("modelWillLoad",u),i.on("cameraDirectionUpdate",x),i.on("dispose",k),i.on("renderFrame",P),i.on("cameraPositionUpdate",x),{appendTo:g,refresh:v,changeConfigs:T}};function zr(i){return typeof Symbol>"u"?`$Symbol<${i}>$`:Symbol(i)}const Vt=zr("$$EVENT$$");function hn(i){return i[Vt]||(i[Vt]={}),i[Vt]}function Mr(i){i[Vt]||delete i[Vt]}class Sr{hasListener(t){const e=hn(this);return Boolean((e==null?void 0:e[t])&&e[t].length>0)}on(t,e,n){const o=hn(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){Mr(this);return}const n=hn(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=hn(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 jr(...i){const t=new M.Vector3;return i.forEach(e=>{t.add(e)}),t.divideScalar(i.length),t}function un(i,t){const e=Math.round(i);return e%2===0?e:e+Number(t!=null&&t.smaller?-1:1)}const Or=({x:i,y:t,z:e})=>new M.Vector3(i,t,e),Nr=([i,t,e])=>new M.Vector3(i,t,e),Br=i=>i instanceof M.Vector3?i:Array.isArray(i)?Nr(i):Or(i),_i="1.0.1",Fr=`CSS3DObjectPlus@${_i}`,Gr=.00216,Rr=.003;class Xr extends $n.CSS3DObject{constructor(e,n,o=Rr,s=1){const r=Math.max(Gr,o),a=n[0].distanceTo(n[1]),l=n[1].distanceTo(n[2]),c=un(a/o*s),h=un(l/o*s),f=jr(...n);let u;if(r===o)e.style.width=`${c}px`,e.style.height=`${h}px`,u=e;else{const P=document.createElement("div");P.style.width=`${c}px`,P.style.height=`${h}px`,P.style.pointerEvents="none";const k=o/r;e.style.position="absolute",e.style.left="0",e.style.top="0",e.style.width=`${k*c}px`,e.style.height=`${k*h}px`,P.appendChild(e),u=P}super(u);d(this,"version",_i);d(this,"width");d(this,"height");d(this,"domWidthPx");d(this,"domHeightPx");d(this,"cornerPoints");d(this,"ratio");d(this,"container");d(this,"centerPosition");if(this.scale.set(r,r,r),this.cornerPoints=n,this.ratio=o,this.container=e,r===o)this.width=a,this.height=l,this.domWidthPx=c,this.domHeightPx=h,this.centerPosition=f;else{const P=o/r;this.width=P*a,this.height=P*l,this.domWidthPx=P*c,this.domHeightPx=P*h,this.centerPosition=new M.Vector3().subVectors(f.clone(),n[0].clone()).multiplyScalar(P).add(n[0])}e.classList.add(`${Fr}__container`);const m=new M.Vector3().subVectors(n[1],n[0]),g=new M.Vector3().subVectors(n[3],n[0]),v=new M.Vector3().crossVectors(m,g).normalize();this.lookAt(v);const b=this.up.clone().applyQuaternion(this.quaternion),y=g.clone(),x=new M.Vector3().crossVectors(b,y).normalize();this.rotateOnWorldAxis(x,b.angleTo(y)),this.position.copy(f)}}const Qr="v2.0.1",$i="CSS3DRenderer",dn=`${$i}@${Qr}`,eo=i=>`${dn}--${i}`,ge={};class Wr{constructor(){d(this,"hooks",new Sr);d(this,"state",{enabled:!0,visible:!0,disposed:!1});d(this,"store",{disposers:[],frontModeCSS3DObjects:{},behindModeCSS3DObjects:{}});d(this,"create3DElement",(t,e,n)=>{if(this.state.disposed)return this.disposedErrorLog();const o=(()=>{const j={ratio:.00216,devicePixelRatio:1,mode:"front",autoRender:!0,container:document.createElement("div"),pointerEvents:"none"};return Object.assign(j,n)})(),s=e.map(Br);if((s==null?void 0:s.length)<4)return console.error(`${dn}: requires 4 point but params may have fewer`);const{ratio:r,devicePixelRatio:a,mode:l,autoRender:c,container:h,pointerEvents:f}=o,u=[],{css3DObject:m,opacityMesh:g}=this.createObject(s,{ratio:r,dpr:a,container:h,mode:l,pointerEvents:f});h.id=`container--${m.uuid}`;const v=l==="front"&&!ge.frontModeStore,b=l==="behind"&&!ge.behindModeStore;b&&(ge.behindModeStore={scene:o.scene,css3DScene:new O.Scene,css3DRenderer:new $n.CSS3DRenderer}),v&&(ge.frontModeStore={css3DScene:new O.Scene,css3DRenderer:new $n.CSS3DRenderer});const y=l==="front"?ge.frontModeStore:ge.behindModeStore,{css3DScene:x,css3DRenderer:P}=y,k=(()=>{const j=()=>{l==="front"?this.store.frontModeCSS3DObjects[m.uuid]={visible:!0,enabled:!0,css3DObject:m,mode:"front"}:this.store.behindModeCSS3DObjects[m.uuid]={visible:!0,enabled:!0,css3DObject:m,opacityMesh:g,mode:"behind",scene:o.scene},x.add(m),l==="behind"&&g&&(o.scene.add(g),u.push(()=>g&&o.scene.remove(g)))};if(v||b){P.domElement.style.position="absolute",P.domElement.style.top="0",P.domElement.style.userSelect="none",P.domElement.style.pointerEvents="none",P.domElement.classList.add(eo(l));const N=()=>{const G=requestAnimationFrame(N);y.requestAnimationFrameId=G,P.render(x,t)};return()=>{j(),N()}}return()=>j()})(),T=l==="front"?ge.frontModeContainer:ge.behindModeContainer;if(T){this.appendToElement(T,l);const j=l==="front"?ge.frontModeStore:ge.behindModeStore;j&&(j.appendedToPage=!0)}const I=j=>this.setVisibleById(m.uuid,j),D=j=>this.setEnabledById(m.uuid,j),E=()=>I(!0),z=()=>I(!1),F=()=>D(!0),R=()=>D(!1),ee=()=>(delete this.store.frontModeCSS3DObjects[m.uuid],delete this.store.behindModeCSS3DObjects[m.uuid],u.forEach(j=>j==null?void 0:j()),x.remove(m),x.children.length===0&&(typeof y.requestAnimationFrameId=="number"&&cancelAnimationFrame(y.requestAnimationFrameId),P.domElement.remove(),l==="front"&&(ge.frontModeStore=void 0),l==="behind"&&(ge.behindModeStore=void 0),ge.resizeObserver=void 0),!0);return this.store.disposers.push(ee),c&&k(),{id:m.uuid,container:h,dispose:ee,css3DObject:m,render:c?void 0:k,show:E,hide:z,setVisible:I,disable:R,enable:F,setEnabled:D,appendToElement:j=>this.appendToElement(j,l)}});d(this,"setVisibleById",(t,e)=>{var o;const n=(o=this.store.frontModeCSS3DObjects[t])!=null?o:this.store.behindModeCSS3DObjects[t];if(!n)return console.error("id not found",t);n.visible=e,this.state.visible&&(n.css3DObject.visible=e,n.mode==="behind"&&(n.opacityMesh.visible=e))});d(this,"setEnabledById",(t,e)=>{var s,r,a;const n=(s=this.store.frontModeCSS3DObjects[t])!=null?s:this.store.behindModeCSS3DObjects[t];if(!n)return;const o=n.mode==="front"?(r=ge.frontModeStore)==null?void 0:r.css3DScene:(a=ge.behindModeStore)==null?void 0:a.css3DScene;!o||(e?(o.add(n.css3DObject),n.mode==="behind"&&n.scene.add(n.opacityMesh)):(o.remove(n.css3DObject),n.mode==="behind"&&n.scene.remove(n.opacityMesh)),n.enabled=e)});d(this,"createObject",(t,e)=>{const{ratio:n,dpr:o,container:s,mode:r,pointerEvents:a}=e,l=new Xr(s,t,n,o);s.style.pointerEvents=a,s.classList.add(`${$i}__container`);const{domWidthPx:c,domHeightPx:h}=l,f=(()=>{if(r==="behind"){const u=new O.MeshBasicMaterial({opacity:0,transparent:!1,side:O.DoubleSide}),m=new O.PlaneGeometry(c,h),g=new O.Mesh(m,u);return g.name=eo("mesh"),g.position.copy(l.position),g.rotation.copy(l.rotation),g.scale.copy(l.scale),g}})();return{css3DObject:l,opacityMesh:f}});d(this,"createResizeObserver",(t,e,n=!0)=>{if(!t)return console.error("createResizeObserver: element is undefined"),{observe:()=>{},unobserve:()=>{}};const o=()=>{const r=un(t.clientWidth,{smaller:!0}),a=un(t.clientHeight,{smaller:!0});e(r,a)};if(typeof ResizeObserver>"u"||!ResizeObserver)return console.warn("createResizeObserver: ResizeObserver is undefined"),{observe:()=>o(),unobserve:()=>{}};const s=new ResizeObserver(o);return n&&o(),{observe:()=>s.observe(t),unobserve:()=>s.unobserve(t)}});d(this,"disposedErrorLog",()=>{console.error(`${dn} is disposed`)})}getCurrentState(){return this.state}setState(t,e={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();const 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()),this.hooks.emit("stateChange",{state:this.state,prevState:n,userAction:e.userAction})}dispose(){this.store.disposers.forEach(t=>t==null?void 0:t()),this.store.disposers=[],this.hooks.emit("dispose"),this.state.disposed=!0}async show({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({visible:!0},{userAction:t}),this.hooks.emit("show",{userAction:t})}async hide({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({visible:!1},{userAction:t}),this.hooks.emit("hide",{userAction:t})}enable({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({enabled:!0},{userAction:t}),this.hooks.emit("enable",{userAction:t})}disable({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({enabled:!1},{userAction:t}),this.hooks.emit("disable",{userAction:t})}appendToElement(t,e){if(!t)throw new Error(`${dn} Cannot append to container: container is ${t}`);const n=e==="front"?ge.frontModeStore:ge.behindModeStore;if(!n){e==="front"&&(ge.frontModeContainer=t),e==="behind"&&(ge.behindModeContainer=t);return}if(!n.appendedToPage){if(t.appendChild(n.css3DRenderer.domElement),!ge.resizeObserver){const o=(a,l)=>{var c,h;(c=ge.frontModeStore)==null||c.css3DRenderer.setSize(a,l),(h=ge.behindModeStore)==null||h.css3DRenderer.setSize(a,l)},{observe:s,unobserve:r}=this.createResizeObserver(t,o,!0);ge.resizeObserver={observe:s,unobserve:r},s(),this.store.disposers.push(r)}n.appendedToPage=!0}}async handleShow(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=t.visible}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=t.visible,t.opacityMesh.visible=t.visible})}async handleHide(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=!1}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=!1,t.opacityMesh.visible=!1})}handleEnable(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{var e;!t.enabled||(e=ge.frontModeStore)==null||e.css3DScene.add(t.css3DObject)}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{var e,n;!t.enabled||((e=ge.behindModeStore)==null||e.css3DScene.add(t.css3DObject),(n=ge.behindModeStore)==null||n.scene.add(t.opacityMesh))})}handleDisable(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{var e;(e=ge.frontModeStore)==null||e.css3DScene.remove(t.css3DObject)}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{var e,n;(e=ge.behindModeStore)==null||e.css3DScene.remove(t.css3DObject),(n=ge.behindModeStore)==null||n.scene.remove(t.opacityMesh)})}}const to="CSS3DRenderPlugin@v2.0.1";class Hr extends Wr{constructor(e){super();d(this,"five");d(this,"create3DDomContainer",(e,n)=>{if(this.state.disposed)return;const o=(()=>{var m;(n==null?void 0:n.dpr)!==void 0&&console.warn(`${to}: please use "config.devicePixelRatio" replace "config.dpr"`);const u={ratio:.00216,devicePixelRatio:(m=n==null?void 0:n.dpr)!=null?m: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(`${to}: five.getElement() is ${s}`);return}const{autoRender:r,mode:a}=o,l=a==="front"?s.parentElement:o.behindFiveContainer;this.appendToElement(l||document.body,a);const c=this.create3DElement(this.five.camera,e,{...o,autoRender:!1});if(!c)return;const h=c.render,f=()=>{var u;a==="front"&&h(),a==="behind"&&((u=this.five.model)!=null&&u.loaded?h():this.five.once("modelLoaded",()=>h()))};return r&&f(),{...c,render:r?void 0:f}});this.five=e}disposeAll(){return this.dispose()}setState(...e){const n=super.setState(...e);return this.five.needsRender=!0,n}}const fn=i=>new Hr(i);function ni(i,t,e=new M.Vector3(1,1,1),n=!1){const o=new Yi.Line(i,t);return o.setMaterial({dashed:n,color:e,linewidth:1}),o.remove(o.points),o}const Yr=i=>{const t={intersection:null,disposers:[]},e=h=>{t.intersection=h},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=(h,f=2,u=.1)=>{const m=f/2,v=c(h,u),b=new M.Group;b.add(ni(new M.Vector3(v.x+m,v.y,v.z),new M.Vector3(v.x-m,v.y,v.z),new M.Vector3(1,0,0)),ni(new M.Vector3(v.x,v.y+m,v.z),new M.Vector3(v.x,v.y-m,v.z),new M.Vector3(0,1,0)),ni(new M.Vector3(v.x,v.y,v.z+m),new M.Vector3(v.x,v.y,v.z-m),new M.Vector3(0,0,1))),i.scene.add(b),i.needsRender=!0;const y=()=>{i.scene.remove(b)};return t.disposers.push(y),{clear:y,pointAxesHelperMesh:b}},s=(h,f=0)=>{var y,x;const u=(y=i==null?void 0:i.camera)==null?void 0:y.position;if(!u)return!1;const m=h.distanceTo(u),g=h.sub(u).normalize(),v=new M.Raycaster(u,g),b=(x=i.model.intersectRaycaster(v))==null?void 0:x[0];return!(b&&b.distance+f<m)},r=()=>t.intersection,a=()=>{var h,f;(f=(h=t.disposers)==null?void 0:h.forEach)==null||f.call(h,u=>u==null?void 0:u()),i.off("intersectionOnModelUpdate",e),i.off("intersectionHidden",n)},l=a,c=(h,f)=>{const u=h.clone();return i.camera.position.clone().sub(u).setLength(f).add(u)};return{intersection:r,pointAxesHelper:o,movePointTowardsCamera:c,destroy:a,dispose:l,canSeePoint:s}};function ne(){}const ii=i=>i;function Ge(i,t){for(const e in t)i[e]=t[e];return i}function no(i){return i()}function io(){return Object.create(null)}function Tt(i){i.forEach(no)}function oi(i){return typeof i=="function"}function ue(i,t){return i!=i?t==t:i!==t||i&&typeof i=="object"||typeof i=="function"}let mn;function oo(i,t){return mn||(mn=document.createElement("a")),mn.href=t,i===mn.href}function Vr(i){return Object.keys(i).length===0}function Se(i){return i==null?"":i}const so=typeof window<"u";let Zr=so?()=>window.performance.now():()=>Date.now(),si=so?i=>requestAnimationFrame(i):ne;const zt=new Set;function ro(i){zt.forEach(t=>{t.c(i)||(zt.delete(t),t.f())}),zt.size!==0&&si(ro)}function Jr(i){let t;return zt.size===0&&si(ro),{promise:new Promise(e=>{zt.add(t={c:i,f:e})}),abort(){zt.delete(t)}}}function W(i,t){i.appendChild(t)}function be(i,t,e){const n=ri(i);if(!n.getElementById(t)){const o=Q("style");o.id=t,o.textContent=e,ao(n,o)}}function ri(i){if(!i)return document;const t=i.getRootNode?i.getRootNode():i.ownerDocument;return t&&t.host?t:i.ownerDocument}function Ur(i){const t=Q("style");return ao(ri(i),t),t.sheet}function ao(i,t){return W(i.head||i,t),t.sheet}function V(i,t,e){i.insertBefore(t,e||null)}function H(i){i.parentNode.removeChild(i)}function Mt(i,t){for(let e=0;e<i.length;e+=1)i[e]&&i[e].d(t)}function Q(i){return document.createElement(i)}function Te(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Ue(i){return document.createTextNode(i)}function pe(){return Ue(" ")}function Re(){return Ue("")}function qe(i,t,e,n){return i.addEventListener(t,e,n),()=>i.removeEventListener(t,e,n)}function C(i,t,e){e==null?i.removeAttribute(t):i.getAttribute(t)!==e&&i.setAttribute(t,e)}function qr(i){return Array.from(i.childNodes)}function ct(i,t){t=""+t,i.wholeText!==t&&(i.data=t)}function S(i,t,e,n){e===null?i.style.removeProperty(t):i.style.setProperty(t,e,n?"important":"")}let pn;function Kr(){if(pn===void 0){pn=!1;try{typeof window<"u"&&window.parent&&window.parent.document}catch{pn=!0}}return pn}function St(i,t){getComputedStyle(i).position==="static"&&(i.style.position="relative");const n=Q("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=Kr();let s;return o?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=qe(window,"message",r=>{r.source===n.contentWindow&&t()})):(n.src="about:blank",n.onload=()=>{s=qe(n.contentWindow,"resize",t)}),W(i,n),()=>{(o||s&&n.contentWindow)&&s(),H(n)}}function je(i,t,e){i.classList[e?"add":"remove"](t)}function _r(i,t,{bubbles:e=!1,cancelable:n=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(i,e,n,t),o}class ai{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=Te(e.nodeName):this.e=Q(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)V(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(H)}}const gn=new Map;let vn=0;function $r(i){let t=5381,e=i.length;for(;e--;)t=(t<<5)-t^i.charCodeAt(e);return t>>>0}function ea(i,t){const e={stylesheet:Ur(t),rules:{}};return gn.set(i,e),e}function ta(i,t,e,n,o,s,r,a=0){const l=16.666/n;let c=`{
|
|
101
|
+
`;class kr extends Er{constructor(e){super();d(this,"configs");d(this,"clientWidth");d(this,"clientHeight");d(this,"ready",!1);d(this,"uuid",lt());d(this,"tween");d(this,"tweening",!1);d(this,"container");d(this,"canvas");d(this,"data",{});d(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=Lr,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 u;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:at.Undo,color:this.color,ready:this.ready,state:l,uuid:this.uuid});const c=(u=this.canvas[this.uuid])==null?void 0:u.getContext("2d");if(!this.canvas[this.uuid])return;const{width:h,height:f}=this.canvas[this.uuid];c&&c.clearRect(0,0,h,f),this.data[this.uuid].forEach(m=>this.handleDrawLine(this.uuid,m,{withUndo:!0}))});const s=document.createElement("a");return s.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--close",s.addEventListener("click",a=>{a.stopPropagation(),this.closeBrush(),this.configs.onClickClose&&this.configs.onClickClose()}),[o,s].forEach(a=>{const l=document.createElement("i");l.className="brush-icon";const c=document.createElement("span");c.className="brush-txt",c.innerText=a.className.endsWith("undo")?this.configs.onUndoText:this.configs.onExitText,a.appendChild(l),a.appendChild(c)}),n.appendChild(o),n.appendChild(s),e.appendChild(n),this.container.appendChild(e),e}openBrush(){if(this.ready)return;this.canvas[this.uuid]||(this.canvas[this.uuid]=this.initCanvas("_paintBrush-canvas")),this.container.className="brushing";const e=this.canvas[this.uuid];e.getContext("2d").clearRect(0,0,e.width,e.height),this.openBrushHandle(),this.ready=!0,this.emit("readyChange",!0)}closeBrush(){!this.ready||(this.container.className="",this.data={},this.tempLine={},Object.keys(this.canvas).forEach(e=>{this.canvas[e].ontouchstart=()=>!1,this.canvas[e].ontouchmove=()=>!1,this.canvas[e].ontouchend=()=>!1,this.canvas[e].ontouchcancel=()=>!1;const n=this.canvas[e].getContext("2d");n&&n.clearRect(0,0,this.canvas[e].width,this.canvas[e].height)}),this.ready=!1,this.emit("readyChange",!1),this.emitStateChange({type:at.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 h=(f,u,m)=>{const g=this.color||"#ff0000";n.strokeStyle=g,n.beginPath(),n.moveTo(f.x,f.y),n.quadraticCurveTo(u.x,u.y,m.x,m.y),n.stroke()};e.onmousedown=f=>{f.preventDefault(),c=Date.now();const u=f.clientX,m=f.clientY;r=[],r.push({x:u,y:m}),s={x:u,y:m},a=rn({x:u,y:m},this.clientWidth,this.clientHeight),l=[]},e.onmousemove=f=>{if(f.preventDefault(),!s)return;const u=Number(f.clientX),m=Number(f.clientY);if(Math.abs(u-s.x)<5&&Math.abs(m-s.y)<5||(r.push({x:u,y:m}),l.push(rn({x:u,y:m},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:g,end:v}=an(r);!g||!v||(h(s,g,v),s=v)},e.onmouseup=f=>{if(f.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const u=Date.now()-c,m={move:Object.assign({},a),uuid:this.uuid,line:[...l],color:this.color,duration:u<1280?u:u<2e3?1280:0};this.data[this.uuid].push(m),ln(()=>{this.emitStateChange({type:at.Drawline,color:this.color,ready:this.ready,state:m,uuid:this.uuid})})},e.ontouchstart=f=>{f.preventDefault(),c=Date.now();const u=f.touches[0].clientX,m=f.touches[0].clientY;r=[],r.push({x:u,y:m}),s={x:u,y:m},console.log("ontouchstart",u,m,s),a=rn({x:u,y:m},this.clientWidth,this.clientHeight),l=[]},e.ontouchmove=f=>{if(f.preventDefault(),!s)return;const u=Number(f.touches[0].clientX),m=Number(f.touches[0].clientY);if(Math.abs(u-s.x)<5&&Math.abs(m-s.y)<5||(r.push({x:u,y:m}),l.push(rn({x:u,y:m},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:g,end:v}=an(r);!g||!v||(h(s,g,v),s=v)},e.ontouchend=e.ontouchcancel=f=>{if(f.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const u=Date.now()-c,m={move:Object.assign({},a),line:[...l],uuid:this.uuid,color:this.color,duration:u<1280?u:u<2e3?1280:0};this.data[this.uuid].push(m),ln(()=>{this.emitStateChange({type:at.Drawline,color:this.color,ready:this.ready,state:m,uuid:this.uuid})})}}emitStateChange(e,n=!0){if(e.type!==at.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};Pr(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 at.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 at.Undo:this.handleUndo(s);break}}handleDrawLine(e,n,{withUndo:o=!1},s=Ji){!n||Object.prototype.toString.call(n)!="[object Object]"||Object.keys(n).length===0||(console.log("handleDrawLine",n,n.line),yr(()=>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:h=0,uuid:f}=n,u=ti(n.move||{},this.clientWidth,this.clientHeight);let m=[u];if(a.strokeStyle=c,a.beginPath(),a.moveTo(u.x,u.y),h&&!o){let g=[];const v=this;v.tween=xr({step:0},{step:l.length-1},h).onUpdate(({step:b})=>{var x;if(v.tweening=!0,!v.ready)return a.clearRect(0,0,v.canvas[f].width,v.canvas[f].height),(x=v.tween)==null?void 0:x.stop();const y=Math.floor(b);if(!g.find(P=>P===y)){if(g.push(y),console.log("__debug__",l,l[y],y),m.push(ti(l[y],v.clientWidth,v.clientHeight)),m.length<3)return;const{control:P,end:L}=an(m);if(!P||!L)return;a.quadraticCurveTo(P.x,P.y,L.x,L.y),a.stroke()}}).onComplete(b=>{v.tween=void 0,v.tweening=!1,g=[],m=[],s&&s(),r()})}else{for(let g=0;g<l.length;g++){if(m.push(ti(l[g],this.clientWidth,this.clientHeight)),m.length<3)continue;const{control:v,end:b}=an(m);!v||!b||a.quadraticCurveTo(v.x,v.y,b.x,b.y)}a.stroke(),m=[],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(),ln(n,60);return}n()}destroyBrush(){this.closeBrush(),this.ready=!1,this.emit("readyChange",!0)}}class Dr{constructor(t={}){d(this,"controller");const e=Object.assign({currentColor:"#f44336",onUndoText:"\u56DE\u9000",onExitText:"\u5173\u95ED"},t);this.controller=new kr(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 Tr=(i,t)=>{let e=!0,n=null;const s={...{lookAtCurrentCamera:!1,lockedPanoIndex:null,lockedLatitude:null,lockedLongitude:null},...t==null?void 0:t.config},r=new O.Scene,a=new me.Camera(60);let l=new O.Object3D,c,h;{const I=new O.DirectionalLight(16777215,.5);I.position.copy(new O.Vector3(1,1,1)),r.add(I)}{const I=new O.DirectionalLight(16777215,.3);r.add(I)}{const I=new O.AmbientLight(16777215,.3);r.add(I)}r.add(l);const f=()=>{if(!!i.renderer)return n||(n=new O.WebGLRenderer({antialias:!1,alpha:!0}),n.setPixelRatio(i.renderer.getPixelRatio()),n.outputEncoding=O.sRGBEncoding,n.setClearColor(1579548,0),n.autoClear=!0),n},u=()=>{l.traverse(I=>{I instanceof O.Mesh&&[].concat(I.material).forEach(E=>E.dispose())}),r.remove(l),l=new O.Object3D,r.add(l),x()},m=()=>{c=b(i.model,a.fov,a.aspect),h=i.model.bounding.getCenter(new O.Vector3);function I(E){const z=E.clone();return z.uniforms.modelAlpha.value=1,z.uniforms.map.value&&(z.uniforms.map.value.needsUpdate=!0),z}function D(E){if(E instanceof O.Mesh){const z=E.geometry,F=Array.isArray(E.material)?E.material.map(I):I(E.material);return new O.Mesh(z,F)}else if(E instanceof O.Group){const z=new O.Group;return E.children.forEach(F=>z.add(D(F))),z}else{const z=new O.Object3D;return E.children.forEach(F=>z.add(D(F))),z}}r.remove(l),l=D(i.model),r.add(l),x()},g=(I,D={})=>{const E=f();if(!E)return;I.appendChild(E.domElement),v(D);const z=window.getComputedStyle(I).position;z!=="relative"&&z!=="absolute"&&z!=="fixed"&&z!=="sticky"&&(I.style.position="relative")},v=(I={})=>{if(!n)return;const E=n.domElement.parentNode;if(E!=null&&E.nodeName){const{width:z=E.offsetWidth,height:F=E.offsetHeight}=I;n.setSize(z,F),a.aspect=z/F,a.updateProjectionMatrix()}x()};function b(I,D,E){const z=I.bounding,F=Math.pow(Math.pow(z.max.x-z.min.x+1,2)+Math.pow(z.max.y-z.min.y+1,2)+Math.pow(z.max.z-z.min.z+1,2),1/2);let R=F/2/Math.tan(Math.PI*D/360);return E<1&&(R=R/E),isNaN(R)?F:R}function y(I){return i.work.observers[I].standingPosition.clone()}const x=()=>{if(!c||!h)return;const I=i.getPose();I.fov=a.fov,I.offset=h,I.distance=c,typeof s.lockedLatitude=="number"&&(I.latitude=s.lockedLatitude),typeof s.lockedLongitude=="number"&&(I.longitude=s.lockedLongitude),typeof s.lockedPanoIndex=="number"&&(I.offset=y(s.lockedPanoIndex)),s.lookAtCurrentCamera&&(I.offset=i.camera.position.clone().setY(i.camera.position.y+1)),a.setFromPose(I),e=!0},P=()=>{e!==!0||!n||!n.domElement.parentNode||n.domElement.parentNode.offsetWidth===0||(n.render(r,a),e=!1)},L=()=>{n&&n.dispose(),n=null},T=I=>{Object.assign(s,I),x()};return Object.assign(window,{camera:a}),i.on("modelLoaded",m),i.on("modelWillLoad",u),i.on("cameraDirectionUpdate",x),i.on("dispose",L),i.on("renderFrame",P),i.on("cameraPositionUpdate",x),{appendTo:g,refresh:v,changeConfigs:T}};function zr(i){return typeof Symbol>"u"?`$Symbol<${i}>$`:Symbol(i)}const Vt=zr("$$EVENT$$");function hn(i){return i[Vt]||(i[Vt]={}),i[Vt]}function Mr(i){i[Vt]||delete i[Vt]}class Sr{hasListener(t){const e=hn(this);return Boolean((e==null?void 0:e[t])&&e[t].length>0)}on(t,e,n){const o=hn(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){Mr(this);return}const n=hn(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=hn(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 jr(...i){const t=new M.Vector3;return i.forEach(e=>{t.add(e)}),t.divideScalar(i.length),t}function un(i,t){const e=Math.round(i);return e%2===0?e:e+Number(t!=null&&t.smaller?-1:1)}const Or=({x:i,y:t,z:e})=>new M.Vector3(i,t,e),Nr=([i,t,e])=>new M.Vector3(i,t,e),Br=i=>i instanceof M.Vector3?i:Array.isArray(i)?Nr(i):Or(i),_i="1.0.1",Fr=`CSS3DObjectPlus@${_i}`,Gr=.00216,Rr=.003;class Xr extends $n.CSS3DObject{constructor(e,n,o=Rr,s=1){const r=Math.max(Gr,o),a=n[0].distanceTo(n[1]),l=n[1].distanceTo(n[2]),c=un(a/o*s),h=un(l/o*s),f=jr(...n);let u;if(r===o)e.style.width=`${c}px`,e.style.height=`${h}px`,u=e;else{const P=document.createElement("div");P.style.width=`${c}px`,P.style.height=`${h}px`,P.style.pointerEvents="none";const L=o/r;e.style.position="absolute",e.style.left="0",e.style.top="0",e.style.width=`${L*c}px`,e.style.height=`${L*h}px`,P.appendChild(e),u=P}super(u);d(this,"version",_i);d(this,"width");d(this,"height");d(this,"domWidthPx");d(this,"domHeightPx");d(this,"cornerPoints");d(this,"ratio");d(this,"container");d(this,"centerPosition");if(this.scale.set(r,r,r),this.cornerPoints=n,this.ratio=o,this.container=e,r===o)this.width=a,this.height=l,this.domWidthPx=c,this.domHeightPx=h,this.centerPosition=f;else{const P=o/r;this.width=P*a,this.height=P*l,this.domWidthPx=P*c,this.domHeightPx=P*h,this.centerPosition=new M.Vector3().subVectors(f.clone(),n[0].clone()).multiplyScalar(P).add(n[0])}e.classList.add(`${Fr}__container`);const m=new M.Vector3().subVectors(n[1],n[0]),g=new M.Vector3().subVectors(n[3],n[0]),v=new M.Vector3().crossVectors(m,g).normalize();this.lookAt(v);const b=this.up.clone().applyQuaternion(this.quaternion),y=g.clone(),x=new M.Vector3().crossVectors(b,y).normalize();this.rotateOnWorldAxis(x,b.angleTo(y)),this.position.copy(f)}}const Qr="v2.0.1",$i="CSS3DRenderer",dn=`${$i}@${Qr}`,eo=i=>`${dn}--${i}`,ge={};class Wr{constructor(){d(this,"hooks",new Sr);d(this,"state",{enabled:!0,visible:!0,disposed:!1});d(this,"store",{disposers:[],frontModeCSS3DObjects:{},behindModeCSS3DObjects:{}});d(this,"create3DElement",(t,e,n)=>{if(this.state.disposed)return this.disposedErrorLog();const o=(()=>{const j={ratio:.00216,devicePixelRatio:1,mode:"front",autoRender:!0,container:document.createElement("div"),pointerEvents:"none"};return Object.assign(j,n)})(),s=e.map(Br);if((s==null?void 0:s.length)<4)return console.error(`${dn}: requires 4 point but params may have fewer`);const{ratio:r,devicePixelRatio:a,mode:l,autoRender:c,container:h,pointerEvents:f}=o,u=[],{css3DObject:m,opacityMesh:g}=this.createObject(s,{ratio:r,dpr:a,container:h,mode:l,pointerEvents:f});h.id=`container--${m.uuid}`;const v=l==="front"&&!ge.frontModeStore,b=l==="behind"&&!ge.behindModeStore;b&&(ge.behindModeStore={scene:o.scene,css3DScene:new O.Scene,css3DRenderer:new $n.CSS3DRenderer}),v&&(ge.frontModeStore={css3DScene:new O.Scene,css3DRenderer:new $n.CSS3DRenderer});const y=l==="front"?ge.frontModeStore:ge.behindModeStore,{css3DScene:x,css3DRenderer:P}=y,L=(()=>{const j=()=>{l==="front"?this.store.frontModeCSS3DObjects[m.uuid]={visible:!0,enabled:!0,css3DObject:m,mode:"front"}:this.store.behindModeCSS3DObjects[m.uuid]={visible:!0,enabled:!0,css3DObject:m,opacityMesh:g,mode:"behind",scene:o.scene},x.add(m),l==="behind"&&g&&(o.scene.add(g),u.push(()=>g&&o.scene.remove(g)))};if(v||b){P.domElement.style.position="absolute",P.domElement.style.top="0",P.domElement.style.userSelect="none",P.domElement.style.pointerEvents="none",P.domElement.classList.add(eo(l));const N=()=>{const G=requestAnimationFrame(N);y.requestAnimationFrameId=G,P.render(x,t)};return()=>{j(),N()}}return()=>j()})(),T=l==="front"?ge.frontModeContainer:ge.behindModeContainer;if(T){this.appendToElement(T,l);const j=l==="front"?ge.frontModeStore:ge.behindModeStore;j&&(j.appendedToPage=!0)}const I=j=>this.setVisibleById(m.uuid,j),D=j=>this.setEnabledById(m.uuid,j),E=()=>I(!0),z=()=>I(!1),F=()=>D(!0),R=()=>D(!1),ee=()=>(delete this.store.frontModeCSS3DObjects[m.uuid],delete this.store.behindModeCSS3DObjects[m.uuid],u.forEach(j=>j==null?void 0:j()),x.remove(m),x.children.length===0&&(typeof y.requestAnimationFrameId=="number"&&cancelAnimationFrame(y.requestAnimationFrameId),P.domElement.remove(),l==="front"&&(ge.frontModeStore=void 0),l==="behind"&&(ge.behindModeStore=void 0),ge.resizeObserver=void 0),!0);return this.store.disposers.push(ee),c&&L(),{id:m.uuid,container:h,dispose:ee,css3DObject:m,render:c?void 0:L,show:E,hide:z,setVisible:I,disable:R,enable:F,setEnabled:D,appendToElement:j=>this.appendToElement(j,l)}});d(this,"setVisibleById",(t,e)=>{var o;const n=(o=this.store.frontModeCSS3DObjects[t])!=null?o:this.store.behindModeCSS3DObjects[t];if(!n)return console.error("id not found",t);n.visible=e,this.state.visible&&(n.css3DObject.visible=e,n.mode==="behind"&&(n.opacityMesh.visible=e))});d(this,"setEnabledById",(t,e)=>{var s,r,a;const n=(s=this.store.frontModeCSS3DObjects[t])!=null?s:this.store.behindModeCSS3DObjects[t];if(!n)return;const o=n.mode==="front"?(r=ge.frontModeStore)==null?void 0:r.css3DScene:(a=ge.behindModeStore)==null?void 0:a.css3DScene;!o||(e?(o.add(n.css3DObject),n.mode==="behind"&&n.scene.add(n.opacityMesh)):(o.remove(n.css3DObject),n.mode==="behind"&&n.scene.remove(n.opacityMesh)),n.enabled=e)});d(this,"createObject",(t,e)=>{const{ratio:n,dpr:o,container:s,mode:r,pointerEvents:a}=e,l=new Xr(s,t,n,o);s.style.pointerEvents=a,s.classList.add(`${$i}__container`);const{domWidthPx:c,domHeightPx:h}=l,f=(()=>{if(r==="behind"){const u=new O.MeshBasicMaterial({opacity:0,transparent:!1,side:O.DoubleSide}),m=new O.PlaneGeometry(c,h),g=new O.Mesh(m,u);return g.name=eo("mesh"),g.position.copy(l.position),g.rotation.copy(l.rotation),g.scale.copy(l.scale),g}})();return{css3DObject:l,opacityMesh:f}});d(this,"createResizeObserver",(t,e,n=!0)=>{if(!t)return console.error("createResizeObserver: element is undefined"),{observe:()=>{},unobserve:()=>{}};const o=()=>{const r=un(t.clientWidth,{smaller:!0}),a=un(t.clientHeight,{smaller:!0});e(r,a)};if(typeof ResizeObserver>"u"||!ResizeObserver)return console.warn("createResizeObserver: ResizeObserver is undefined"),{observe:()=>o(),unobserve:()=>{}};const s=new ResizeObserver(o);return n&&o(),{observe:()=>s.observe(t),unobserve:()=>s.unobserve(t)}});d(this,"disposedErrorLog",()=>{console.error(`${dn} is disposed`)})}getCurrentState(){return this.state}setState(t,e={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();const 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()),this.hooks.emit("stateChange",{state:this.state,prevState:n,userAction:e.userAction})}dispose(){this.store.disposers.forEach(t=>t==null?void 0:t()),this.store.disposers=[],this.hooks.emit("dispose"),this.state.disposed=!0}async show({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({visible:!0},{userAction:t}),this.hooks.emit("show",{userAction:t})}async hide({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({visible:!1},{userAction:t}),this.hooks.emit("hide",{userAction:t})}enable({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({enabled:!0},{userAction:t}),this.hooks.emit("enable",{userAction:t})}disable({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({enabled:!1},{userAction:t}),this.hooks.emit("disable",{userAction:t})}appendToElement(t,e){if(!t)throw new Error(`${dn} Cannot append to container: container is ${t}`);const n=e==="front"?ge.frontModeStore:ge.behindModeStore;if(!n){e==="front"&&(ge.frontModeContainer=t),e==="behind"&&(ge.behindModeContainer=t);return}if(!n.appendedToPage){if(t.appendChild(n.css3DRenderer.domElement),!ge.resizeObserver){const o=(a,l)=>{var c,h;(c=ge.frontModeStore)==null||c.css3DRenderer.setSize(a,l),(h=ge.behindModeStore)==null||h.css3DRenderer.setSize(a,l)},{observe:s,unobserve:r}=this.createResizeObserver(t,o,!0);ge.resizeObserver={observe:s,unobserve:r},s(),this.store.disposers.push(r)}n.appendedToPage=!0}}async handleShow(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=t.visible}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=t.visible,t.opacityMesh.visible=t.visible})}async handleHide(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=!1}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=!1,t.opacityMesh.visible=!1})}handleEnable(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{var e;!t.enabled||(e=ge.frontModeStore)==null||e.css3DScene.add(t.css3DObject)}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{var e,n;!t.enabled||((e=ge.behindModeStore)==null||e.css3DScene.add(t.css3DObject),(n=ge.behindModeStore)==null||n.scene.add(t.opacityMesh))})}handleDisable(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{var e;(e=ge.frontModeStore)==null||e.css3DScene.remove(t.css3DObject)}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{var e,n;(e=ge.behindModeStore)==null||e.css3DScene.remove(t.css3DObject),(n=ge.behindModeStore)==null||n.scene.remove(t.opacityMesh)})}}const to="CSS3DRenderPlugin@v2.0.1";class Hr extends Wr{constructor(e){super();d(this,"five");d(this,"create3DDomContainer",(e,n)=>{if(this.state.disposed)return;const o=(()=>{var m;(n==null?void 0:n.dpr)!==void 0&&console.warn(`${to}: please use "config.devicePixelRatio" replace "config.dpr"`);const u={ratio:.00216,devicePixelRatio:(m=n==null?void 0:n.dpr)!=null?m: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(`${to}: five.getElement() is ${s}`);return}const{autoRender:r,mode:a}=o,l=a==="front"?s.parentElement:o.behindFiveContainer;this.appendToElement(l||document.body,a);const c=this.create3DElement(this.five.camera,e,{...o,autoRender:!1});if(!c)return;const h=c.render,f=()=>{var u;a==="front"&&h(),a==="behind"&&((u=this.five.model)!=null&&u.loaded?h():this.five.once("modelLoaded",()=>h()))};return r&&f(),{...c,render:r?void 0:f}});this.five=e}disposeAll(){return this.dispose()}setState(...e){const n=super.setState(...e);return this.five.needsRender=!0,n}}const fn=i=>new Hr(i);function ni(i,t,e=new M.Vector3(1,1,1),n=!1){const o=new Yi.Line(i,t);return o.setMaterial({dashed:n,color:e,linewidth:1}),o.remove(o.points),o}const Yr=i=>{const t={intersection:null,disposers:[]},e=h=>{t.intersection=h},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=(h,f=2,u=.1)=>{const m=f/2,v=c(h,u),b=new M.Group;b.add(ni(new M.Vector3(v.x+m,v.y,v.z),new M.Vector3(v.x-m,v.y,v.z),new M.Vector3(1,0,0)),ni(new M.Vector3(v.x,v.y+m,v.z),new M.Vector3(v.x,v.y-m,v.z),new M.Vector3(0,1,0)),ni(new M.Vector3(v.x,v.y,v.z+m),new M.Vector3(v.x,v.y,v.z-m),new M.Vector3(0,0,1))),i.scene.add(b),i.needsRender=!0;const y=()=>{i.scene.remove(b)};return t.disposers.push(y),{clear:y,pointAxesHelperMesh:b}},s=(h,f=0)=>{var y,x;const u=(y=i==null?void 0:i.camera)==null?void 0:y.position;if(!u)return!1;const m=h.distanceTo(u),g=h.sub(u).normalize(),v=new M.Raycaster(u,g),b=(x=i.model.intersectRaycaster(v))==null?void 0:x[0];return!(b&&b.distance+f<m)},r=()=>t.intersection,a=()=>{var h,f;(f=(h=t.disposers)==null?void 0:h.forEach)==null||f.call(h,u=>u==null?void 0:u()),i.off("intersectionOnModelUpdate",e),i.off("intersectionHidden",n)},l=a,c=(h,f)=>{const u=h.clone();return i.camera.position.clone().sub(u).setLength(f).add(u)};return{intersection:r,pointAxesHelper:o,movePointTowardsCamera:c,destroy:a,dispose:l,canSeePoint:s}};function ne(){}const ii=i=>i;function Ge(i,t){for(const e in t)i[e]=t[e];return i}function no(i){return i()}function io(){return Object.create(null)}function Tt(i){i.forEach(no)}function oi(i){return typeof i=="function"}function ue(i,t){return i!=i?t==t:i!==t||i&&typeof i=="object"||typeof i=="function"}let mn;function oo(i,t){return mn||(mn=document.createElement("a")),mn.href=t,i===mn.href}function Vr(i){return Object.keys(i).length===0}function Se(i){return i==null?"":i}const so=typeof window<"u";let Zr=so?()=>window.performance.now():()=>Date.now(),si=so?i=>requestAnimationFrame(i):ne;const zt=new Set;function ro(i){zt.forEach(t=>{t.c(i)||(zt.delete(t),t.f())}),zt.size!==0&&si(ro)}function Jr(i){let t;return zt.size===0&&si(ro),{promise:new Promise(e=>{zt.add(t={c:i,f:e})}),abort(){zt.delete(t)}}}function W(i,t){i.appendChild(t)}function be(i,t,e){const n=ri(i);if(!n.getElementById(t)){const o=Q("style");o.id=t,o.textContent=e,ao(n,o)}}function ri(i){if(!i)return document;const t=i.getRootNode?i.getRootNode():i.ownerDocument;return t&&t.host?t:i.ownerDocument}function Ur(i){const t=Q("style");return ao(ri(i),t),t.sheet}function ao(i,t){return W(i.head||i,t),t.sheet}function V(i,t,e){i.insertBefore(t,e||null)}function H(i){i.parentNode.removeChild(i)}function Mt(i,t){for(let e=0;e<i.length;e+=1)i[e]&&i[e].d(t)}function Q(i){return document.createElement(i)}function Te(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Ue(i){return document.createTextNode(i)}function pe(){return Ue(" ")}function Re(){return Ue("")}function qe(i,t,e,n){return i.addEventListener(t,e,n),()=>i.removeEventListener(t,e,n)}function C(i,t,e){e==null?i.removeAttribute(t):i.getAttribute(t)!==e&&i.setAttribute(t,e)}function qr(i){return Array.from(i.childNodes)}function ct(i,t){t=""+t,i.wholeText!==t&&(i.data=t)}function S(i,t,e,n){e===null?i.style.removeProperty(t):i.style.setProperty(t,e,n?"important":"")}let pn;function Kr(){if(pn===void 0){pn=!1;try{typeof window<"u"&&window.parent&&window.parent.document}catch{pn=!0}}return pn}function St(i,t){getComputedStyle(i).position==="static"&&(i.style.position="relative");const n=Q("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=Kr();let s;return o?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=qe(window,"message",r=>{r.source===n.contentWindow&&t()})):(n.src="about:blank",n.onload=()=>{s=qe(n.contentWindow,"resize",t)}),W(i,n),()=>{(o||s&&n.contentWindow)&&s(),H(n)}}function je(i,t,e){i.classList[e?"add":"remove"](t)}function _r(i,t,{bubbles:e=!1,cancelable:n=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(i,e,n,t),o}class ai{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=Te(e.nodeName):this.e=Q(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)V(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(H)}}const gn=new Map;let vn=0;function $r(i){let t=5381,e=i.length;for(;e--;)t=(t<<5)-t^i.charCodeAt(e);return t>>>0}function ea(i,t){const e={stylesheet:Ur(t),rules:{}};return gn.set(i,e),e}function ta(i,t,e,n,o,s,r,a=0){const l=16.666/n;let c=`{
|
|
102
102
|
`;for(let b=0;b<=1;b+=l){const y=t+(e-t)*s(b);c+=b*100+`%{${r(y,1-y)}}
|
|
103
103
|
`}const h=c+`100% {${r(e,1-e)}}
|
|
104
|
-
}`,f=`__svelte_${$r(h)}_${a}`,u=ri(i),{stylesheet:m,rules:g}=gn.get(u)||ea(u,i);g[f]||(g[f]=!0,m.insertRule(`@keyframes ${f} ${h}`,m.cssRules.length));const v=i.style.animation||"";return i.style.animation=`${v?`${v}, `:""}${f} ${n}ms linear ${o}ms 1 both`,vn+=1,f}function lo(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||na())}function na(){si(()=>{vn||(gn.forEach(i=>{const{ownerNode:t}=i.stylesheet;t&&H(t)}),gn.clear())})}let Zt;function Jt(i){Zt=i}function bn(){if(!Zt)throw new Error("Function called outside component initialization");return Zt}function co(i){bn().$$.before_update.push(i)}function It(i){bn().$$.on_mount.push(i)}function ia(i){bn().$$.after_update.push(i)}function Ut(i){bn().$$.on_destroy.push(i)}const qt=[],jt=[],An=[],ho=[],oa=Promise.resolve();let li=!1;function sa(){li||(li=!0,oa.then(uo))}function Ke(i){An.push(i)}const ci=new Set;let yn=0;function uo(){const i=Zt;do{for(;yn<qt.length;){const t=qt[yn];yn++,Jt(t),ra(t.$$)}for(Jt(null),qt.length=0,yn=0;jt.length;)jt.pop()();for(let t=0;t<An.length;t+=1){const e=An[t];ci.has(e)||(ci.add(e),e())}An.length=0}while(qt.length);for(;ho.length;)ho.pop()();li=!1,ci.clear(),Jt(i)}function ra(i){if(i.fragment!==null){i.update(),Tt(i.before_update);const t=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,t),i.after_update.forEach(Ke)}}let Kt;function aa(){return Kt||(Kt=Promise.resolve(),Kt.then(()=>{Kt=null})),Kt}function fo(i,t,e){i.dispatchEvent(_r(`${t?"intro":"outro"}${e}`))}const Pn=new Set;let xt;function Ce(){xt={r:0,c:[],p:xt}}function Ee(){xt.r||Tt(xt.c),xt=xt.p}function X(i,t){i&&i.i&&(Pn.delete(i),i.i(t))}function K(i,t,e,n){if(i&&i.o){if(Pn.has(i))return;Pn.add(i),xt.c.push(()=>{Pn.delete(i),n&&(e&&i.d(1),n())}),i.o(t)}else n&&n()}const la={duration:0};function ca(i,t,e){let n=t(i,e),o=!1,s,r,a=0;function l(){s&&lo(i,s)}function c(){const{delay:f=0,duration:u=300,easing:m=ii,tick:g=ne,css:v}=n||la;v&&(s=ta(i,0,1,u,f,m,v,a++)),g(0,1);const b=Zr()+f,y=b+u;r&&r.abort(),o=!0,Ke(()=>fo(i,!0,"start")),r=Jr(x=>{if(o){if(x>=y)return g(1,0),fo(i,!0,"end"),l(),o=!1;if(x>=b){const P=m((x-b)/u);g(P,1-P)}}return o})}let h=!1;return{start(){h||(h=!0,lo(i),oi(n)?(n=n(),aa().then(c)):c())},invalidate(){h=!1},end(){o&&(l(),o=!1)}}}const ha=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function mo(i,t){i.d(1),t.delete(i.key)}function Ot(i,t){K(i,1,1,()=>{t.delete(i.key)})}function gt(i,t,e,n,o,s,r,a,l,c,h,f){let u=i.length,m=s.length,g=u;const v={};for(;g--;)v[i[g].key]=g;const b=[],y=new Map,x=new Map;for(g=m;g--;){const I=f(o,s,g),D=e(I);let E=r.get(D);E?n&&E.p(I,t):(E=c(D,I),E.c()),y.set(D,b[g]=E),D in v&&x.set(D,Math.abs(g-v[D]))}const P=new Set,k=new Set;function T(I){X(I,1),I.m(a,h),r.set(I.key,I),h=I.first,m--}for(;u&&m;){const I=b[m-1],D=i[u-1],E=I.key,z=D.key;I===D?(h=I.first,u--,m--):y.has(z)?!r.has(E)||P.has(E)?T(I):k.has(z)?u--:x.get(E)>x.get(z)?(k.add(E),T(I)):(P.add(z),u--):(l(D,r),u--)}for(;u--;){const I=i[u];y.has(I.key)||l(I,r)}for(;m;)T(b[m-1]);return b}function Xe(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 Pe(i){i&&i.c()}function Ae(i,t,e,n){const{fragment:o,after_update:s}=i.$$;o&&o.m(t,e),n||Ke(()=>{const r=i.$$.on_mount.map(no).filter(oi);i.$$.on_destroy?i.$$.on_destroy.push(...r):Tt(r),i.$$.on_mount=[]}),s.forEach(Ke)}function ye(i,t){const e=i.$$;e.fragment!==null&&(Tt(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function ua(i,t){i.$$.dirty[0]===-1&&(qt.push(i),sa(),i.$$.dirty.fill(0)),i.$$.dirty[t/31|0]|=1<<t%31}function de(i,t,e,n,o,s,r,a=[-1]){const l=Zt;Jt(i);const c=i.$$={fragment:null,ctx:[],props:s,update:ne,not_equal:o,bound:io(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:io(),dirty:a,skip_bound:!1,root:t.target||l.$$.root};r&&r(c.root);let h=!1;if(c.ctx=e?e(i,t.props||{},(f,u,...m)=>{const g=m.length?m[0]:u;return c.ctx&&o(c.ctx[f],c.ctx[f]=g)&&(!c.skip_bound&&c.bound[f]&&c.bound[f](g),h&&ua(i,f)),u}):[],c.update(),h=!0,Tt(c.before_update),c.fragment=n?n(c.ctx):!1,t.target){if(t.hydrate){const f=qr(t.target);c.fragment&&c.fragment.l(f),f.forEach(H)}else c.fragment&&c.fragment.c();t.intro&&X(i.$$.fragment),Ae(i,t.target,t.anchor,t.customElement),uo()}Jt(l)}class fe{$destroy(){ye(this,1),this.$destroy=ne}$on(t,e){if(!oi(e))return ne;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&&!Vr(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const da="data:image/png;base64,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";function fa(i){be(i,"svelte-877671",".room-label-item.svelte-877671{position:absolute;font-size:0.41667rem;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-877671{position:absolute;left:0;top:-3.33333rem;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:1.04167rem;min-width:1.66667rem;padding:0 0.3125rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-877671{position:absolute;top:-2.29167rem;height:2.5rem;width:1px;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-877671{font-size:0.52083rem}")}function ma(i){let t,e,n=i[0].name+"",o,s,r,a,l;return{c(){t=Q("div"),e=Q("span"),o=Ue(n),s=pe(),r=Q("div"),C(e,"class","room-label-item__text svelte-877671"),S(e,"background-image","url("+da+")"),je(e,"wide",i[0].name.length>3),C(r,"class","room-label-item__bar svelte-877671"),C(t,"class","room-label-item svelte-877671"),S(t,"z-index",i[0].zIndex),S(t,"transform",i[0].transform),S(t,"opacity",i[0].visible?1:0)},m(c,h){V(c,t,h),W(t,e),W(e,o),W(t,s),W(t,r),a||(l=qe(e,"click",i[1]),a=!0)},p(c,[h]){h&1&&n!==(n=c[0].name+"")&&ct(o,n),h&1&&je(e,"wide",c[0].name.length>3),h&1&&S(t,"z-index",c[0].zIndex),h&1&&S(t,"transform",c[0].transform),h&1&&S(t,"opacity",c[0].visible?1:0)},i:ne,o:ne,d(c){c&&H(t),a=!1,l()}}}function pa(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 ga extends fe{constructor(t){super(),de(this,t,pa,ma,ue,{five:2,roomLabel:0},fa)}}const{Map:va}=ha;function ba(i){be(i,"svelte-9eg4zi",".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}")}function po(i,t,e){const n=i.slice();return n[13]=t[e],n}function go(i,t){let e,n,o;return n=new ga({props:{roomLabel:t[13],five:t[1]}}),{key:i,first:null,c(){e=Re(),Pe(n.$$.fragment),this.first=e},m(s,r){V(s,e,r),Ae(n,s,r),o=!0},p(s,r){t=s;const a={};r&1&&(a.roomLabel=t[13]),r&2&&(a.five=t[1]),n.$set(a)},i(s){o||(X(n.$$.fragment,s),o=!0)},o(s){K(n.$$.fragment,s),o=!1},d(s){s&&H(e),ye(n,s)}}}function Aa(i){let t,e=[],n=new va,o,s,r=i[0];const a=l=>l[13].id;for(let l=0;l<r.length;l+=1){let c=po(i,r,l),h=a(c);n.set(h,e[l]=go(h,c))}return{c(){t=Q("div");for(let l=0;l<e.length;l+=1)e[l].c();C(t,"class","room-labels-container svelte-9eg4zi"),Ke(()=>i[6].call(t))},m(l,c){V(l,t,c);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=St(t,i[6].bind(t)),s=!0},p(l,[c]){c&3&&(r=l[0],Ce(),e=gt(e,c,a,1,l,r,n,t,Ot,go,null,po),Ee())},i(l){if(!s){for(let c=0;c<r.length;c+=1)X(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)K(e[c]);s=!1},d(l){l&&H(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}function ya(i,t,e){let n;var o;let{five:s}=t,{roomLabels:r}=t,a,l,c=(o=s.model.shownFloor)!==null&&o!==void 0?o:null;function h(b){if(!(c===null||b.floorIndex===c))return!1;const x=new M.Raycaster,P=s.camera.position.clone(),k=new M.Vector3(b.position.x,b.position.y,b.position.z),T=k.distanceTo(P);x.set(P.clone(),k.clone().sub(P).normalize());const[I]=s.model.intersectRaycaster(x);return!(I&&I.distance+1<T)}function f(b,y){const P=new M.Vector3(b.position.x,b.position.y,b.position.z).clone().project(s.camera),k=Math.ceil((P.x+1)/2*y.x),T=Math.ceil((-P.y+1)/2*y.y);return`translate(${k}px, ${T}px)`}function u(b){const{rendererSize:y,shownFloor:x}=b,P=new Map;function k(I){const D=P.get(I.id);if(D)return D;const{x:E,y:z,z:F}=I.position,R=new M.Vector3(E,z,F).clone().distanceTo(s.camera.position);return P.set(I.id,R),R}return r.map(I=>{const D=h(I),E=D?f(I,y):I.transform,z=k(I),R=r.filter(ee=>ee.visible&&k(ee)<z).length*10;return Object.assign(Object.assign({},I),{visible:D,transform:E,zIndex:R})})}function m(){e(0,r=u({rendererSize:n,shownFloor:c}))}function g(b){e(4,c=b)}s.on("cameraUpdate",m),s.on("modelShownFloorChange",g),Ut(()=>{s.off("cameraUpdate",m),s.off("modelShownFloorChange",g)});function v(){a=this.clientWidth,l=this.clientHeight,e(2,a),e(3,l)}return i.$$set=b=>{"five"in b&&e(1,s=b.five),"roomLabels"in b&&e(0,r=b.roomLabels)},i.$$.update=()=>{i.$$.dirty&12&&e(5,n={x:a,y:l}),i.$$.dirty&48&&e(0,r=u({rendererSize:n,shownFloor:c}))},[r,s,a,l,c,n,v]}class Pa extends fe{constructor(t){super(),de(this,t,ya,Aa,ue,{five:1,roomLabels:0},ba)}}function wa(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 Ia{constructor(t){d(this,"five");d(this,"enabled",!0);d(this,"fiveModeEnabled");d(this,"app");d(this,"wrapper");d(this,"roomLabels",[]);d(this,"container",document.createElement("div"));d(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=wa(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 Pa({target:this.container,props:{five:this.five,roomLabels:this.roomLabels}})}}}const xa=i=>new Ia(i),Ca={name:"ModelRoomLabelPlugin",version:0};var vt=(i=>(i[i.FLOOR=1]="FLOOR",i[i.CEILING=2]="CEILING",i[i.BOUNDING_CENTER=3]="BOUNDING_CENTER",i))(vt||{});async function wn(i){try{return[null,await i]}catch(t){return t instanceof Error?[t,null]:[new Error(""),null]}}function In(i){return Object.prototype.toString.call(i)==="[object Object]"}function xn(i,t){return i===t?!0:typeof i!=typeof t?!1:!!(Number.isNaN(i)&&Number.isNaN(t))}function Ea(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(!xn(i[r],t[r]))return!1}return!0}function La(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!xn(i[e],t[e]))return!1;return!0}function ka(i,t){return xn(i,t)?!0:In(i)&&In(t)?Ea(i,t):Array.isArray(i)&&Array.isArray(t)?La(i,t):!1}function hi(i,t){return xn(i,t)?!0:In(i)&&In(t)?Ta(i,t):Array.isArray(i)&&Array.isArray(t)?Da(i,t):!1}function Da(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!hi(i[e],t[e]))return!1;return!0}function Ta(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(!hi(i[r],t[r]))return!1}return!0}function et(i,t,e={deep:!1}){return e.deep?hi(i,t):ka(i,t)}function za(i,{delay:t=0,duration:e=400,easing:n=ii}={}){const o=+getComputedStyle(i).opacity;return{delay:t,duration:e,easing:n,css:s=>`opacity: ${s*o}`}}const bt="data:image/png;base64,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";function Ma(i){return i*180/Math.PI}function Sa(i){be(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 ja(i){let t,e;return{c(){t=Q("div"),e=Q("div"),C(e,"class","floorplan__camera-rotate svelte-17cl35n"),S(e,"background-image",`url(${i[0]||bt})`),S(e,"width",i[4]),S(e,"height",i[4]),S(e,"left","-"+i[4]),S(e,"top","-"+i[4]),S(e,"transform",`rotate(${i[3]}deg)`),S(e,"transform-origin",`${i[4]} ${i[4]}`),C(t,"class","floorplan__camera-position svelte-17cl35n"),S(t,"left",i[1]),S(t,"top",i[2])},m(n,o){V(n,t,o),W(t,e)},p(n,[o]){o&1&&S(e,"background-image",`url(${n[0]||bt})`)},i:ne,o:ne,d(n){n&&H(t)}}}function Oa(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,h=l.positionInImage.y,f=c*100+"%",u=h*100+"%",m=-Ma(s)+45,g=document.body.clientWidth,v=document.body.clientHeight,y=`${(g<500||v<500?17:37)/16}rem`;return i.$$set=x=>{"panoIndex"in x&&e(5,n=x.panoIndex),"floorplanData"in x&&e(6,o=x.floorplanData),"lastPanoramaLongitude"in x&&e(7,s=x.lastPanoramaLongitude),"cameraImageUrl"in x&&e(0,r=x.cameraImageUrl)},[r,f,u,m,y,n,o,s]}class Na extends fe{constructor(t){super(),de(this,t,Oa,ja,ue,{panoIndex:5,floorplanData:6,lastPanoramaLongitude:7,cameraImageUrl:0},Sa)}}const Ba="data:image/png;base64,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";function Fa(i){be(i,"svelte-z9kwkx",".floorplan-plugin__compass.svelte-z9kwkx{position:absolute;left:50%;top:-2.39583rem;width:12.03125rem;height:2.13542rem;will-change:opacity;transform-origin:center 9.58333rem}.floorplan-plugin__compass-image.svelte-z9kwkx{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-z9kwkx{position:absolute;left:50%;top:0.78125rem;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:0.52083rem;color:#fff}")}function Ga(i){let t,e,n,o,s;return{c(){t=Q("div"),e=Q("div"),n=pe(),o=Q("span"),s=Ue(i[0]),C(e,"class","floorplan-plugin__compass-image svelte-z9kwkx"),S(e,"background-image",`url(${Ba})`),C(o,"class","floorplan-plugin__compass-text svelte-z9kwkx"),C(t,"class","floorplan-plugin__compass svelte-z9kwkx"),S(t,"transform",i[2])},m(r,a){V(r,t,a),W(t,e),W(t,n),W(t,o),W(o,s)},p(r,a){a&1&&ct(s,r[0])},d(r){r&&H(t)}}}function Ra(i){let t,e=i[1]&&Ga(i);return{c(){e&&e.c(),t=Re()},m(n,o){e&&e.m(n,o),V(n,t,o)},p(n,[o]){n[1]&&e.p(n,o)},i:ne,o:ne,d(n){e&&e.d(n),n&&H(t)}}}function Xa(i){return i/Math.PI*180}function Qa(i,t,e){var n;let{floorplanData:o}=t,{northDesc:s}=t;const r=(n=o.entrance)===null||n===void 0?void 0:n.northRad,a=typeof r=="number",c=`translateX(-50%) translateZ(10px) rotate(${-(r?Xa(r):0)+90}deg)`;return i.$$set=h=>{"floorplanData"in h&&e(3,o=h.floorplanData),"northDesc"in h&&e(0,s=h.northDesc)},[s,a,c,o]}class Wa extends fe{constructor(t){super(),de(this,t,Qa,Ra,ue,{floorplanData:3,northDesc:0},Fa)}}const Nt=[];function vo(i,t=ne){let e;const n=new Set;function o(a){if(ue(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=ne){const c=[a,l];return n.add(c),n.size===1&&(e=t(o)||ne),a(i),()=>{n.delete(c),n.size===0&&(e(),e=null)}}return{set:o,update:s,subscribe:r}}function Ha(i){be(i,"svelte-1gfoniz","img.svelte-1gfoniz{width:100%;height:100%}")}function Ya(i){let t,e;return{c(){t=Q("img"),oo(t.src,e=i[0])||C(t,"src",e),C(t,"alt","floorplan iamge"),C(t,"class","svelte-1gfoniz")},m(n,o){V(n,t,o)},p(n,[o]){o&1&&!oo(t.src,e=n[0])&&C(t,"src",e)},i:ne,o:ne,d(n){n&&H(t)}}}function Va(i,t,e){let{url:n}=t;return i.$$set=o=>{"url"in o&&e(0,n=o.url)},[n]}class Za extends fe{constructor(t){super(),de(this,t,Va,Ya,ue,{url:0},Ha)}}function Ja(i){be(i,"svelte-ub47ya",".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}")}function Ua(i){let t,e,n,o;return{c(){t=Q("div"),e=new ai(!1),n=pe(),o=new ai(!1),e.a=n,o.a=null,C(t,"class","floorplan-plugin__base-image svelte-ub47ya")},m(s,r){V(s,t,r),e.m(i[1],t),W(t,n),o.m(i[0],t)},p(s,[r]){r&1&&o.p(s[0])},i:ne,o:ne,d(s){s&&H(t)}}}function qa(i,t,e){let{content:n}=t;const o=`
|
|
104
|
+
}`,f=`__svelte_${$r(h)}_${a}`,u=ri(i),{stylesheet:m,rules:g}=gn.get(u)||ea(u,i);g[f]||(g[f]=!0,m.insertRule(`@keyframes ${f} ${h}`,m.cssRules.length));const v=i.style.animation||"";return i.style.animation=`${v?`${v}, `:""}${f} ${n}ms linear ${o}ms 1 both`,vn+=1,f}function lo(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||na())}function na(){si(()=>{vn||(gn.forEach(i=>{const{ownerNode:t}=i.stylesheet;t&&H(t)}),gn.clear())})}let Zt;function Jt(i){Zt=i}function bn(){if(!Zt)throw new Error("Function called outside component initialization");return Zt}function co(i){bn().$$.before_update.push(i)}function It(i){bn().$$.on_mount.push(i)}function ia(i){bn().$$.after_update.push(i)}function Ut(i){bn().$$.on_destroy.push(i)}const qt=[],jt=[],An=[],ho=[],oa=Promise.resolve();let li=!1;function sa(){li||(li=!0,oa.then(uo))}function Ke(i){An.push(i)}const ci=new Set;let yn=0;function uo(){const i=Zt;do{for(;yn<qt.length;){const t=qt[yn];yn++,Jt(t),ra(t.$$)}for(Jt(null),qt.length=0,yn=0;jt.length;)jt.pop()();for(let t=0;t<An.length;t+=1){const e=An[t];ci.has(e)||(ci.add(e),e())}An.length=0}while(qt.length);for(;ho.length;)ho.pop()();li=!1,ci.clear(),Jt(i)}function ra(i){if(i.fragment!==null){i.update(),Tt(i.before_update);const t=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,t),i.after_update.forEach(Ke)}}let Kt;function aa(){return Kt||(Kt=Promise.resolve(),Kt.then(()=>{Kt=null})),Kt}function fo(i,t,e){i.dispatchEvent(_r(`${t?"intro":"outro"}${e}`))}const Pn=new Set;let xt;function Ce(){xt={r:0,c:[],p:xt}}function Ee(){xt.r||Tt(xt.c),xt=xt.p}function X(i,t){i&&i.i&&(Pn.delete(i),i.i(t))}function K(i,t,e,n){if(i&&i.o){if(Pn.has(i))return;Pn.add(i),xt.c.push(()=>{Pn.delete(i),n&&(e&&i.d(1),n())}),i.o(t)}else n&&n()}const la={duration:0};function ca(i,t,e){let n=t(i,e),o=!1,s,r,a=0;function l(){s&&lo(i,s)}function c(){const{delay:f=0,duration:u=300,easing:m=ii,tick:g=ne,css:v}=n||la;v&&(s=ta(i,0,1,u,f,m,v,a++)),g(0,1);const b=Zr()+f,y=b+u;r&&r.abort(),o=!0,Ke(()=>fo(i,!0,"start")),r=Jr(x=>{if(o){if(x>=y)return g(1,0),fo(i,!0,"end"),l(),o=!1;if(x>=b){const P=m((x-b)/u);g(P,1-P)}}return o})}let h=!1;return{start(){h||(h=!0,lo(i),oi(n)?(n=n(),aa().then(c)):c())},invalidate(){h=!1},end(){o&&(l(),o=!1)}}}const ha=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function mo(i,t){i.d(1),t.delete(i.key)}function Ot(i,t){K(i,1,1,()=>{t.delete(i.key)})}function gt(i,t,e,n,o,s,r,a,l,c,h,f){let u=i.length,m=s.length,g=u;const v={};for(;g--;)v[i[g].key]=g;const b=[],y=new Map,x=new Map;for(g=m;g--;){const I=f(o,s,g),D=e(I);let E=r.get(D);E?n&&E.p(I,t):(E=c(D,I),E.c()),y.set(D,b[g]=E),D in v&&x.set(D,Math.abs(g-v[D]))}const P=new Set,L=new Set;function T(I){X(I,1),I.m(a,h),r.set(I.key,I),h=I.first,m--}for(;u&&m;){const I=b[m-1],D=i[u-1],E=I.key,z=D.key;I===D?(h=I.first,u--,m--):y.has(z)?!r.has(E)||P.has(E)?T(I):L.has(z)?u--:x.get(E)>x.get(z)?(L.add(E),T(I)):(P.add(z),u--):(l(D,r),u--)}for(;u--;){const I=i[u];y.has(I.key)||l(I,r)}for(;m;)T(b[m-1]);return b}function Xe(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 Pe(i){i&&i.c()}function Ae(i,t,e,n){const{fragment:o,after_update:s}=i.$$;o&&o.m(t,e),n||Ke(()=>{const r=i.$$.on_mount.map(no).filter(oi);i.$$.on_destroy?i.$$.on_destroy.push(...r):Tt(r),i.$$.on_mount=[]}),s.forEach(Ke)}function ye(i,t){const e=i.$$;e.fragment!==null&&(Tt(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function ua(i,t){i.$$.dirty[0]===-1&&(qt.push(i),sa(),i.$$.dirty.fill(0)),i.$$.dirty[t/31|0]|=1<<t%31}function de(i,t,e,n,o,s,r,a=[-1]){const l=Zt;Jt(i);const c=i.$$={fragment:null,ctx:[],props:s,update:ne,not_equal:o,bound:io(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:io(),dirty:a,skip_bound:!1,root:t.target||l.$$.root};r&&r(c.root);let h=!1;if(c.ctx=e?e(i,t.props||{},(f,u,...m)=>{const g=m.length?m[0]:u;return c.ctx&&o(c.ctx[f],c.ctx[f]=g)&&(!c.skip_bound&&c.bound[f]&&c.bound[f](g),h&&ua(i,f)),u}):[],c.update(),h=!0,Tt(c.before_update),c.fragment=n?n(c.ctx):!1,t.target){if(t.hydrate){const f=qr(t.target);c.fragment&&c.fragment.l(f),f.forEach(H)}else c.fragment&&c.fragment.c();t.intro&&X(i.$$.fragment),Ae(i,t.target,t.anchor,t.customElement),uo()}Jt(l)}class fe{$destroy(){ye(this,1),this.$destroy=ne}$on(t,e){if(!oi(e))return ne;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&&!Vr(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const da="data:image/png;base64,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";function fa(i){be(i,"svelte-877671",".room-label-item.svelte-877671{position:absolute;font-size:0.41667rem;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-877671{position:absolute;left:0;top:-3.33333rem;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:1.04167rem;min-width:1.66667rem;padding:0 0.3125rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-877671{position:absolute;top:-2.29167rem;height:2.5rem;width:1px;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-877671{font-size:0.52083rem}")}function ma(i){let t,e,n=i[0].name+"",o,s,r,a,l;return{c(){t=Q("div"),e=Q("span"),o=Ue(n),s=pe(),r=Q("div"),C(e,"class","room-label-item__text svelte-877671"),S(e,"background-image","url("+da+")"),je(e,"wide",i[0].name.length>3),C(r,"class","room-label-item__bar svelte-877671"),C(t,"class","room-label-item svelte-877671"),S(t,"z-index",i[0].zIndex),S(t,"transform",i[0].transform),S(t,"opacity",i[0].visible?1:0)},m(c,h){V(c,t,h),W(t,e),W(e,o),W(t,s),W(t,r),a||(l=qe(e,"click",i[1]),a=!0)},p(c,[h]){h&1&&n!==(n=c[0].name+"")&&ct(o,n),h&1&&je(e,"wide",c[0].name.length>3),h&1&&S(t,"z-index",c[0].zIndex),h&1&&S(t,"transform",c[0].transform),h&1&&S(t,"opacity",c[0].visible?1:0)},i:ne,o:ne,d(c){c&&H(t),a=!1,l()}}}function pa(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 ga extends fe{constructor(t){super(),de(this,t,pa,ma,ue,{five:2,roomLabel:0},fa)}}const{Map:va}=ha;function ba(i){be(i,"svelte-9eg4zi",".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}")}function po(i,t,e){const n=i.slice();return n[13]=t[e],n}function go(i,t){let e,n,o;return n=new ga({props:{roomLabel:t[13],five:t[1]}}),{key:i,first:null,c(){e=Re(),Pe(n.$$.fragment),this.first=e},m(s,r){V(s,e,r),Ae(n,s,r),o=!0},p(s,r){t=s;const a={};r&1&&(a.roomLabel=t[13]),r&2&&(a.five=t[1]),n.$set(a)},i(s){o||(X(n.$$.fragment,s),o=!0)},o(s){K(n.$$.fragment,s),o=!1},d(s){s&&H(e),ye(n,s)}}}function Aa(i){let t,e=[],n=new va,o,s,r=i[0];const a=l=>l[13].id;for(let l=0;l<r.length;l+=1){let c=po(i,r,l),h=a(c);n.set(h,e[l]=go(h,c))}return{c(){t=Q("div");for(let l=0;l<e.length;l+=1)e[l].c();C(t,"class","room-labels-container svelte-9eg4zi"),Ke(()=>i[6].call(t))},m(l,c){V(l,t,c);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=St(t,i[6].bind(t)),s=!0},p(l,[c]){c&3&&(r=l[0],Ce(),e=gt(e,c,a,1,l,r,n,t,Ot,go,null,po),Ee())},i(l){if(!s){for(let c=0;c<r.length;c+=1)X(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)K(e[c]);s=!1},d(l){l&&H(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}function ya(i,t,e){let n;var o;let{five:s}=t,{roomLabels:r}=t,a,l,c=(o=s.model.shownFloor)!==null&&o!==void 0?o:null;function h(b){if(!(c===null||b.floorIndex===c))return!1;const x=new M.Raycaster,P=s.camera.position.clone(),L=new M.Vector3(b.position.x,b.position.y,b.position.z),T=L.distanceTo(P);x.set(P.clone(),L.clone().sub(P).normalize());const[I]=s.model.intersectRaycaster(x);return!(I&&I.distance+1<T)}function f(b,y){const P=new M.Vector3(b.position.x,b.position.y,b.position.z).clone().project(s.camera),L=Math.ceil((P.x+1)/2*y.x),T=Math.ceil((-P.y+1)/2*y.y);return`translate(${L}px, ${T}px)`}function u(b){const{rendererSize:y,shownFloor:x}=b,P=new Map;function L(I){const D=P.get(I.id);if(D)return D;const{x:E,y:z,z:F}=I.position,R=new M.Vector3(E,z,F).clone().distanceTo(s.camera.position);return P.set(I.id,R),R}return r.map(I=>{const D=h(I),E=D?f(I,y):I.transform,z=L(I),R=r.filter(ee=>ee.visible&&L(ee)<z).length*10;return Object.assign(Object.assign({},I),{visible:D,transform:E,zIndex:R})})}function m(){e(0,r=u({rendererSize:n,shownFloor:c}))}function g(b){e(4,c=b)}s.on("cameraUpdate",m),s.on("modelShownFloorChange",g),Ut(()=>{s.off("cameraUpdate",m),s.off("modelShownFloorChange",g)});function v(){a=this.clientWidth,l=this.clientHeight,e(2,a),e(3,l)}return i.$$set=b=>{"five"in b&&e(1,s=b.five),"roomLabels"in b&&e(0,r=b.roomLabels)},i.$$.update=()=>{i.$$.dirty&12&&e(5,n={x:a,y:l}),i.$$.dirty&48&&e(0,r=u({rendererSize:n,shownFloor:c}))},[r,s,a,l,c,n,v]}class Pa extends fe{constructor(t){super(),de(this,t,ya,Aa,ue,{five:1,roomLabels:0},ba)}}function wa(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 Ia{constructor(t){d(this,"five");d(this,"enabled",!0);d(this,"fiveModeEnabled");d(this,"app");d(this,"wrapper");d(this,"roomLabels",[]);d(this,"container",document.createElement("div"));d(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=wa(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 Pa({target:this.container,props:{five:this.five,roomLabels:this.roomLabels}})}}}const xa=i=>new Ia(i),Ca={name:"ModelRoomLabelPlugin",version:0};var vt=(i=>(i[i.FLOOR=1]="FLOOR",i[i.CEILING=2]="CEILING",i[i.BOUNDING_CENTER=3]="BOUNDING_CENTER",i))(vt||{});async function wn(i){try{return[null,await i]}catch(t){return t instanceof Error?[t,null]:[new Error(""),null]}}function In(i){return Object.prototype.toString.call(i)==="[object Object]"}function xn(i,t){return i===t?!0:typeof i!=typeof t?!1:!!(Number.isNaN(i)&&Number.isNaN(t))}function Ea(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(!xn(i[r],t[r]))return!1}return!0}function La(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!xn(i[e],t[e]))return!1;return!0}function ka(i,t){return xn(i,t)?!0:In(i)&&In(t)?Ea(i,t):Array.isArray(i)&&Array.isArray(t)?La(i,t):!1}function hi(i,t){return xn(i,t)?!0:In(i)&&In(t)?Ta(i,t):Array.isArray(i)&&Array.isArray(t)?Da(i,t):!1}function Da(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!hi(i[e],t[e]))return!1;return!0}function Ta(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(!hi(i[r],t[r]))return!1}return!0}function et(i,t,e={deep:!1}){return e.deep?hi(i,t):ka(i,t)}function za(i,{delay:t=0,duration:e=400,easing:n=ii}={}){const o=+getComputedStyle(i).opacity;return{delay:t,duration:e,easing:n,css:s=>`opacity: ${s*o}`}}const bt="data:image/png;base64,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";function Ma(i){return i*180/Math.PI}function Sa(i){be(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 ja(i){let t,e;return{c(){t=Q("div"),e=Q("div"),C(e,"class","floorplan__camera-rotate svelte-17cl35n"),S(e,"background-image",`url(${i[0]||bt})`),S(e,"width",i[4]),S(e,"height",i[4]),S(e,"left","-"+i[4]),S(e,"top","-"+i[4]),S(e,"transform",`rotate(${i[3]}deg)`),S(e,"transform-origin",`${i[4]} ${i[4]}`),C(t,"class","floorplan__camera-position svelte-17cl35n"),S(t,"left",i[1]),S(t,"top",i[2])},m(n,o){V(n,t,o),W(t,e)},p(n,[o]){o&1&&S(e,"background-image",`url(${n[0]||bt})`)},i:ne,o:ne,d(n){n&&H(t)}}}function Oa(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,h=l.positionInImage.y,f=c*100+"%",u=h*100+"%",m=-Ma(s)+45,g=document.body.clientWidth,v=document.body.clientHeight,y=`${(g<500||v<500?17:37)/16}rem`;return i.$$set=x=>{"panoIndex"in x&&e(5,n=x.panoIndex),"floorplanData"in x&&e(6,o=x.floorplanData),"lastPanoramaLongitude"in x&&e(7,s=x.lastPanoramaLongitude),"cameraImageUrl"in x&&e(0,r=x.cameraImageUrl)},[r,f,u,m,y,n,o,s]}class Na extends fe{constructor(t){super(),de(this,t,Oa,ja,ue,{panoIndex:5,floorplanData:6,lastPanoramaLongitude:7,cameraImageUrl:0},Sa)}}const Ba="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+2x//+/v/09v/W4f9ojv/c5P+xxP/d5v+xw/+vwv+Jo//g6P+nvP+SrP/R3P/1+f/W3//U3//C0P+Jp/9nh/+Kpv+Fov/Y4f/J1/+Pqf+rv/+Oqv+Oqv+muv+twP/f5//t8P97mf/h5/+twP+kuf/L2P+juP+Ipf+huP+Pqf/d5v+zxf+cs/+Zsf+wwv/V3v+8zP+Go/+zxP+GpP/T3f/r8P/u8v/o7f/d5P/m7P/H1P/w9P/D0f+uwf/Z4v/F0v/09//D0v/v8//s8v/d5P/Y4f/s8P+etv/X4f+gt/+ovf+bsv+xw/+Vr//j6v+1x//J1v+4yf/r8P+yxf/T3f/B0f+Fo//09//W4P/h6P/L1v/i6f/x9f/t8v/G0/+uwf/z9f/7/P/n7f/z9v/T3f+4yf/J1v/z9f/w8//q7v/O2v/8/f/5+v/y9f/w8//g6P/z9v+/zv+5yf+9zf/5+v/Q3P/B0P/u8f/R2//////LSJnaAAAA/HRSTlMAAwGMx2jAn2u7ebn0q8zX7J3TiHz45bRS35SFYZmPSembkYNwVMXh2cmodWVjXN43DHZu6gfyrJZGOvrzLAbVvbBB91raz7aypqH+4s6Bfj9/Vk9EMint3C8gt+fc1q+XGAml/O/SxBz7s66kSz3wI/bjc+fQvpOObV8VoyZyXjSpmgv97sMPyorNiYZN0XpYuvHCv6JNEhEWw61YgCUdGBIP5CIgHypaUEU6NS9JQy8lGlY6NCuMfVtPSzspJoRxcExBNTMUyn9zaWRfVkk9Oad9emtkY0RBMLGsnJaQj4ZmXVHhsaKbeW9owb466dnVy7mYj45wyaGV3bdGzuNnAAASkklEQVR42uyaS0iUURiGTUQZ1MaMURSEbOFt4ybGQClFHO9rBS8F3nAURHG0hZvyQrgQRsfNuKmRCTcGGaEzThNqMyouwswKNTVMLe/a/bLo+845/5z/dzIiumj971I3gz6+Puc9x0POT6bRaXfYrJa18YHFhYXXKzMz6+/fb2+/ePFia8uvWlXelFkcr6pO2NqCr2xv77xfn5lZWXm9sDgwvmZZGnHYzaZjHnLk/PaYzL0jS9Pji6+XN3Z3gvJPnTkTEJCT01xSUtWuVick+PlVJ6tUqvj44uLipkxIU3F5fLxKlZxc7efnl6BWt1eVlDTn5AQEnDl16lR+be2n3fWZlYWBNcugze485yFHzq/Kub7eEcv44tzyekpsbEhIZGRWVk1NUFBtPqU2gFGbANRWVycnI7XlCO0XQm25mFp1VRWjFrDNz68NCqqpyYqMDAmJjc3NzQ3cmJwfmLba7CZPDzlyfg5Wh3V6YG559HyhUhkVlZJSUJDLqK3pDkJqoS8ZtVWEWiCTUltejl37BaCVdG2Cul1MLUIb1M2pLShIiYpSKpWF58+37U3Oj1ue2E0ecuT8EK1mm3VoYG4vW6MrLQ0MDDwvUIvQ8q6tBWqZIeRQQ+DU8q51NwQxtbVAbRajNrZARG1gaWBpm0anyY6enB+bGOyV6ZVzIK6bPUPzs17Rx48fb80GaHVtpQRaF7XYtZFIbTcRBAFb7rWc2uJM1rVoCCqgFquWdy0TBDCEbqSWlm2KQC38rZSW6nS67OxW+CxXr0Z7ec/J8MqRxtQ7ONQ/2xIREeHlFR191UVtqRu1wBep2hpqCNxrpYYg6dp4Ude2Y9cG8K5FQ8hyNwSglnZtNoE22svLKyKirKxFsTo28cQsH9v+81Bevb29O1qMZQAtUhs9SqnVsK5199osRi3fENwNgXitcBqrrmZly7r2DKUWq7Zb8FrBEAoptW1tGg3rWk5tC3xSQ53ig8zuf5pzd4df9c8qFIrEOgOhtgyphdCubaVdC9iyrkVo+Wnsm12bID6NZYqWLxX32qpm0fKVD9ii10bSrkVDiJJ2bWuriFqjsaUDPmpdXWIifG7f1bGezT55bfhfYrrfM7Wamufrq9cjtIkGA+1aZgiArdRrlUBtirRr2YbAvBZGBLV71/INAcuWbwjcEERey7tWKe7abGnXdiC1DFq9r29eampF/3O5dv/1ODd7pj5og4ODU13UQtdyQ+Beq9FovnMaE20IAdwQJHut2BCE05jaffkSDAGwxbJl1CK27DQ2iqcxCFKLXWsgXatX+BJqg4O1aWlJz14N35XR/RfTeP/2VOeFpKS0tDQCLVDrq9AjtXVIrdFYVsaoHWWGQKgN3EdtCNVa91sGtdQQmvhpjFUtX74QWjoioNdm0a5lGwL3Wp1GI/HaCCP1WkMddi1Cm5cH1BJsky5UxGHrysLw7wQd9pl/XFfFBaRWq9UCtalIrZ56rcG7A7u2jHktMQQN91qllFq2fImoba468G5M6rVq4rV8Q0CvZdTGgtcitrxrNUgtli1QCyFe6+0yBL3eF6Cl1CYBtYBtnL9/0b2ezWseco56QGLvpV++7O8fF1dRAdhC16Ih0K4lhpBoQBaMLS6vZacxTdu+DSFXsiHkU689YENgd2MSQ0iQ7rXiG90Qvnxh2eJhTOfqWihb7rXUEIBalyFotaRru+IQ28uXY9LBF27JD3OObPqePn9TlJ4eExNDqO0CapOQWsCWdq2CUmtgGwKnli9f6LWFrg0hhFEr7doS1rXSu7HM8nK3DaHd7W6shnutyxACqdficYxSyzYEgVqEVsENQYtdi9j6U2rTi4oqfaZu32n0kHO04nlr+N3HjIaGoqIipNafUNsF1KIicK9VUK8FQ8Cu5YbAqQVslfv2Wuq1+TU7uxszK/DycG1t2mJZWrKOjIzYHA673Wx2Ok3nPImbNJqcfWa7vdfhsMG3rUtLFss0PG3Eh43ruzvC8sW7lhkCgxYMQXzLYCReyzYESGoePY0JXesPiYlBbCsbOjMyMu713L/uIedo5NiNm+8++vhkALSVlaRrqSEAtNKu1VNqWddKN4Rs3f6uLdxYnsTXsdNLg7Ze8y95WOhp6rM7RqyW6fGB+bnJ5Q0lNQRyo+u+fOGGIMFWOI2Rqq2ghgDUYtcSbH18fE4AuXLnHvr0PX30JvzEiRM+gG0nYFsE2IIgQARD0LINIY9vCNLla1R8ozu6PLc4brE6zH/iEcAxp90GD83mJ/dAqjU64TTGvNYodC0uX2SvJV1LNwSkFg3B1bWEWvhBhIdfeSjbwiHO9QeP34aFXQkPp9AitWgIgtfGYdcecBrrMJYJy1c0gLIHb62GrE96+/7aCmoyOwYnhvrnJo3otXz5Yl6roNCmptLTGHYtei1imy50rQ+lFrANC7v48ra86B6+HLs1/PDs2YsA7RWAlmLb0MkNgXStdENwv2WIUKzi2yrnoZo98ekkPpYQ7saQWtq1dPlCr+WGIO1axJZSe/Hs2bePHsiae4jSeOfxpdBQhJZULe/aSmIISG0cNwTetQoIMQTDbP9Qj818mP+Pejp7ByfGVmeF5WufIVw4wGuxahm1oaGh9S9vyqPYYYgnnL1O19cDtEAt7VrqtXCIdnWtsCEkYdfyWwaF4jMp174j9JtsvGvrGer/oMcNQXzL0CVZvhoaMii1iG2YQG19/enTp08+li33K/tm7JNGGIbxqiEht5m7iasMcBuwwOJk0tEFcn9BG7s1bizQGBycCCbXpUkTo9VFJVpRSeNkuBqnq6BRoiwOMtldm3Tr+37fJ9+dtFEUbNX3+RPIj+d+93zf/ctgyZb1YDAUAmx510J410JY1wqvbTeEma3vJ9uP9571yObu8rfTd6xrhSEIahFb2bXCayW1wWAwM2CvLf5XFvSMMr9fzw9kMhnEFqmVXSsMYQI3hFFJLUD7GixwZuvHU/kuoG+zsXx0CtS+Yl4runZ0fHzcvSEAtUPcEEKCWshhdYlezx44I0vV80J+AILQQgIuagdby9e1vXbm9Ogp3kmd2j45q7z1Ll/tXRuAoCEAtQzbQkE93qdLCw+Wsa9NXVXVfB6xdXftsOxauSHwszHgtfG0L6IufNkBdhm0vGul10Kk14quzQO1qqqDK7yg9Dwj682wrk+raqEgoGXUtrp2yGUI3Gt/we3T5/L+0Q+6W/mIXTvR7rWArTSEfJ5Rq+the40at5dBMTDDCC2jVhoCYjscAGo5tBC+fA0elXefhsF2dqTdOKtMyLlWvo2F3NQCtNPTiG04aZcI3B6lb6mqJZPhK2rVFrVBFATRtXKvrZw1Fh/RotXdoOzu/LwYhLj3Wo8hCGrDQG1y1jTIcbufvo2ilTJnZxFbnRsC81qxIYQ8XntRpy9SWOZ3y+dv2pevjPRaQa1pplIph87OuoxsXEulTJND6zWEjPRagDZwXqbredd94bgiqfUYgsq6Ngldi9hqmna8Qj9etw6/bMvSNIYt/MAtQ8i7DQG79rLeoPH8b75QPg8wbINyQ+CGILtW0yxLUZoE7v2RrRmKolgaUouGwL1W93gtdu1lnY57bj5IPBRei+GGAHF3rYKJ7608l82lF5lacSLxOFLLutaUXeuhNlOnOyEdkMu9VnYtJGnysrUshDYej6SLG9QBd5TZdASgjSsQhNZFrS69FoilF6+OsgDkIrauDWEWu1ZjhoDYRiKRdNohU+g4CyUnl2tRa1nSEKTXFmwi9s7kNg89G4IwBNG1SG0uZ9BVhQ4PEwzDyKWBWoEtUis2BNG19toSydc9bx81D91dC9hKaiNIrWE4dPxwy8yXnEQCoL3WtSnetQhtsklXRLv1YajNli8BraYgtozaXBqgTSQS2cl1+q1vytj6pD+bBWpF10qvFV2btIukBV2WhVRrQxDQCkNAbLNZv1N7zoeMt/jr13x+P1LLyhawlYLAX8fobl33g0ZWtE2+11oearFr/RDf3gEV7p/z6WDS5/MJaF1eqwhslSo9q3qW/vn9Y63Na7Fqs0gtpDZHhXs9/Z9r0ShC6+5aQS1C65ToEKHXmVqvRtoNwQ9BbKPR96vUGt5H1IcYg9YjCDkxIcSrNB32ONLRSg7H1msIEMA2GqNJoZWp1ckYQCuoRWwZtUYaFSFdpNHwYbOwsodde7UhtLAFaGOxl7U5eub9Ztfscd0Eoihsu8oSKJBoQpUYyYULmhSIBVjACuip0tFQpEaaagTSyLiI9GSMZArEKp4it95N7oXBk6dUr7Ln59sB4uNw7p0BTlfb3s7Wcm0fvfbbV7MveAYo7k9eEB5h+x0Aa22b9OlKb9bHP7kNgLZC2slawKTs80Bx/2sIW8DO7dy7VSt9SfuoyHMurei1k7bnt/3K8ExQXLT2Y0MA8qLwro2mRaG6hV5RTNpuuba81345v+n+E3oR6su7aAjc2hyt9cL4qN+fcNNcw9DzPJG1i7VG2dfidHlHaYW1qK0H2oauZvvz/ZEyhtLyrBUN4WzuxLweIO6HrOXWhiQa6pUupHeLkRCYrbWB2dqzZh+vPGxOl1xoW3iztYyxqNWj4KadG0URm7z9tyHoPZi+PnBJRExjk7WEEHiTrtMof9T7q7NctJYwcBaYGgJwVf/R5Sft3bkh8KydrXVV93aHzs7WklBMY2b+kob65uE0NhcEQhhaa1mWo+7VmqqzgElaRlDbKWtD0wykAg6GikJkretO2saKelt1cRyjtQAD5qw1zUBCdr2L1jIWAdzaWEVvq44+pI0AErLQs/rdyiAjm9ONiF5rATGlpaPWwUM1ZHSxFokIY9FNn12fivw4toQwkbWobemPynhbD1lW0hKtfYTtVa3PUk+q3pp7LYDW0jLL2lGJ+yP14DhZltFFW5DW6swApgbrpn1kbVmCtJnj+KP0GyFwFsCspZRLq1j70Z2qsxC0loK0qK0vd95Wne/7IC1Q8qgd9DgB1Il0dKx4CVsH8P1E3n3C7t76AM/aErKW3s1FAxVZNweUllvrIwc5V5r7MUiSWVoMW5C2NdVAXao7DmNL1vpJkgy1dH/V9W9wNmmTxdqy7OR7CMMnV2EiaxMgkGzoXjdDEKC2S0HwR3OeoD6beuBZ26K0QXC4y/Pa/7Jrx7gJw1AYx2su0iuYgYFI7sAJstiS2ZKpk8UeWfKWKyQLLJ5Qxyp34TZ9D15YOkBpm9ji/U/A8CP+HFj0styMapHtZ54bh/t5y2E9LoQNVppMXoN1uixLQns8rl9PeZ0T3O96O5T4rL2wBQkuZnCbWQ7OXdUe1zwNni8YCsh2VOuK1I/a2jtHapHtZp/J+cD9bf0HoiW1rpAp38TfYlEUgJaetWUOZwP3P3UnetYCW1ChU52JogoS1UKIlq9gT95yILSugKRKciq2VhLaEpIVm3366j2pxaSMyf07YRUlND5qTynvGG6aaDOSWgnptFiIKoQLWmQ7pLphuOkTB0lqoZDSTGiVBrXE1iT0wbgEEn0gtSEEncoNfRV1uKKN/KqL+/4C1xYSA7XapjATRGU1hGxT3NtcGnUK0UJgZf7TuDWEls1yt9wiWsja7awzYRWttYgWYrPcLbejWqua2WaCqBSixQLvWe5mi06RWqv8TDOhNUrZC9sdm+Xuu5cpUqvU+wwzYbVVkIXYLHd/olekVpmpZ8KiMYbU7ma/EXJZBW5JrZl2V9bRnNWyWe4xt8TWTPd3FdEYSEFslnsoURlAi01FqN56f2br2xeOe9ytgbyf4nErGg/hl6RN4Jc5Lt++2rVjHMdCIIqiqtoRQW2mMogIyZFjlsB2B9wjjaY1PXa3wcbSPaEDR1fP9fVt8aPai2+f2+TlWu2l0yweZHlEO5S9cyu1lDKj5T/fWCH4jLaUnXMbvFyrzby8xRrayqUM2+ZWqvuM1nmpgHWkl8F9z9yG7LNa5yEMa0n8yHb93Er1oXjnoMVyFn3KQVcP7VRpFn+sDiznaiuHNufsHnkIwy7aPA/r5jbFGW3m7S12ku55WPN7Li1PPIRhN6sjtBjTmm+KmYcwPEOKs9tHF1JDHCoHLZ5DQ8yPBic9DoHjAKvsb85qjbFxHOCprMZaf5qdhlorxwGeTsPIttvPlno0y3GAZfbHp6n3ynGAV0m99u/2J6H3znGAvW4n+J25tdY7xwFey1pvQe6/DlrjOMDLqfXW7N5pbs0YWhxgtpj0rl1uiaHFISzccSWohUCzOIemm0VKChwHOMutKCVwHOA4av/JVi0xtDiRpCRfRcvQ4lBfxSnG0OJc/+xTjKHFyVRMP38iDC0O92lZVRhanO+vcVWGFu9BRWkW7+Z3rapEizdy7ZVm8V5Gtr8AtSnix59eOmYAAAAASUVORK5CYII=";function Fa(i){be(i,"svelte-z9kwkx",".floorplan-plugin__compass.svelte-z9kwkx{position:absolute;left:50%;top:-2.39583rem;width:12.03125rem;height:2.13542rem;will-change:opacity;transform-origin:center 9.58333rem}.floorplan-plugin__compass-image.svelte-z9kwkx{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-z9kwkx{position:absolute;left:50%;top:0.78125rem;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:0.52083rem;color:#fff}")}function Ga(i){let t,e,n,o,s;return{c(){t=Q("div"),e=Q("div"),n=pe(),o=Q("span"),s=Ue(i[0]),C(e,"class","floorplan-plugin__compass-image svelte-z9kwkx"),S(e,"background-image",`url(${Ba})`),C(o,"class","floorplan-plugin__compass-text svelte-z9kwkx"),C(t,"class","floorplan-plugin__compass svelte-z9kwkx"),S(t,"transform",i[2])},m(r,a){V(r,t,a),W(t,e),W(t,n),W(t,o),W(o,s)},p(r,a){a&1&&ct(s,r[0])},d(r){r&&H(t)}}}function Ra(i){let t,e=i[1]&&Ga(i);return{c(){e&&e.c(),t=Re()},m(n,o){e&&e.m(n,o),V(n,t,o)},p(n,[o]){n[1]&&e.p(n,o)},i:ne,o:ne,d(n){e&&e.d(n),n&&H(t)}}}function Xa(i){return i/Math.PI*180}function Qa(i,t,e){var n;let{floorplanData:o}=t,{northDesc:s}=t;const r=(n=o.entrance)===null||n===void 0?void 0:n.northRad,a=typeof r=="number",c=`translateX(-50%) translateZ(10px) rotate(${-(r?Xa(r):0)+90}deg)`;return i.$$set=h=>{"floorplanData"in h&&e(3,o=h.floorplanData),"northDesc"in h&&e(0,s=h.northDesc)},[s,a,c,o]}class Wa extends fe{constructor(t){super(),de(this,t,Qa,Ra,ue,{floorplanData:3,northDesc:0},Fa)}}const Nt=[];function vo(i,t=ne){let e;const n=new Set;function o(a){if(ue(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=ne){const c=[a,l];return n.add(c),n.size===1&&(e=t(o)||ne),a(i),()=>{n.delete(c),n.size===0&&(e(),e=null)}}return{set:o,update:s,subscribe:r}}function Ha(i){be(i,"svelte-1gfoniz","img.svelte-1gfoniz{width:100%;height:100%}")}function Ya(i){let t,e;return{c(){t=Q("img"),oo(t.src,e=i[0])||C(t,"src",e),C(t,"alt","floorplan iamge"),C(t,"class","svelte-1gfoniz")},m(n,o){V(n,t,o)},p(n,[o]){o&1&&!oo(t.src,e=n[0])&&C(t,"src",e)},i:ne,o:ne,d(n){n&&H(t)}}}function Va(i,t,e){let{url:n}=t;return i.$$set=o=>{"url"in o&&e(0,n=o.url)},[n]}class Za extends fe{constructor(t){super(),de(this,t,Va,Ya,ue,{url:0},Ha)}}function Ja(i){be(i,"svelte-ub47ya",".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}")}function Ua(i){let t,e,n,o;return{c(){t=Q("div"),e=new ai(!1),n=pe(),o=new ai(!1),e.a=n,o.a=null,C(t,"class","floorplan-plugin__base-image svelte-ub47ya")},m(s,r){V(s,t,r),e.m(i[1],t),W(t,n),o.m(i[0],t)},p(s,[r]){r&1&&o.p(s[0])},i:ne,o:ne,d(s){s&&H(t)}}}function qa(i,t,e){let{content:n}=t;const o=`
|
|
105
105
|
<style>
|
|
106
106
|
svg [type='lineGroup'] path {
|
|
107
107
|
fill: #ffffff;
|
|
@@ -110,7 +110,7 @@ transition: all 500ms;
|
|
|
110
110
|
svg [type='lineItemGroup'] g g g g {
|
|
111
111
|
stroke: #ffffff;
|
|
112
112
|
}</style>
|
|
113
|
-
`;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class Ka extends fe{constructor(t){super(),de(this,t,qa,Ua,ue,{content:0},Ja)}}function _a(i){be(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function $a(i){let t,e;return t=new Za({props:{url:i[1].url}}),{c(){Pe(t.$$.fragment)},m(n,o){Ae(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.url=n[1].url),t.$set(s)},i(n){e||(X(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){ye(t,n)}}}function el(i){let t,e;return t=new Ka({props:{content:i[0]}}),{c(){Pe(t.$$.fragment)},m(n,o){Ae(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.content=n[0]),t.$set(s)},i(n){e||(X(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){ye(t,n)}}}function tl(i){let t,e,n,o;const s=[el,$a],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=Q("div"),n&&n.c(),C(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){V(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let h=e;e=a(l),e===h?~e&&r[e].p(l,c):(n&&(Ce(),K(r[h],1,1,()=>{r[h]=null}),Ee()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),X(n,1),n.m(t,null)):n=null)},i(l){o||(X(n),o=!0)},o(l){K(n),o=!1},d(l){l&&H(t),~e&&r[e].d()}}}function nl(i,t,e){let n,o;var s,r;let{floorIndex:a}=t,{floorplanData:l}=t;return i.$$set=c=>{"floorIndex"in c&&e(2,a=c.floorIndex),"floorplanData"in c&&e(3,l=c.floorplanData)},i.$$.update=()=>{i.$$.dirty&12&&e(1,n=l.outlines[a]),i.$$.dirty&60&&e(0,o=e(5,r=e(4,s=l.outlines)===null||s===void 0?void 0:s[a])===null||r===void 0?void 0:r.svgContent)},[o,n,a,l,s,r]}class bo extends fe{constructor(t){super(),de(this,t,nl,tl,ue,{floorIndex:2,floorplanData:3},_a)}}function il(i){be(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 ol(i){let t,e=i[4].outerHTML+"",n;return{c(){t=new ai(!1),n=Re(),t.a=n},m(o,s){t.m(e,o,s),V(o,n,s)},p(o,s){s&16&&e!==(e=o[4].outerHTML+"")&&t.p(e)},d(o){o&&H(n),o&&t.d()}}}function sl(i){let t,e=i[0].name+"",n,o,s,r;return{c(){t=Q("span"),n=Ue(e),o=pe(),s=Q("span"),r=Ue(i[5]),C(t,"class","floorplan-plugin__room-name"),C(s,"class","floorplan-plugin__room-size svelte-12pzct5")},m(a,l){V(a,t,l),W(t,n),V(a,o,l),V(a,s,l),W(s,r)},p(a,l){l&1&&e!==(e=a[0].name+"")&&ct(n,e),l&32&&ct(r,a[5])},d(a){a&&H(t),a&&H(o),a&&H(s)}}}function rl(i){let t;function e(s,r){if(s[1]===void 0)return sl;if(s[4])return ol}let n=e(i),o=n&&n(i);return{c(){t=Q("div"),o&&o.c(),C(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),S(t,"left",i[6]),S(t,"top",i[7]),S(t,"font-size",i[8]),S(t,"opacity",i[3]?"1":"0")},m(s,r){V(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&&S(t,"opacity",s[3]?"1":"0")},i:ne,o:ne,d(s){s&&H(t),o&&o.d(),i[16](null)}}}function al(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],h=t[r][1];l>n!=h>n&&e<(c-a)*(n-l)/(h-l)+a&&(o=!o)}return o}function ll(i,t,e){let n,o,s,r,{pxmm:a}=t,{room:l}=t,{hoveredRoom:c}=t,{getRoomAreaText:h}=t,{getLabelElement:f}=t,{adaptiveRoomLabelVisibleEnable:u}=t;function m(E,z){if(z.width===0||z.height===0)return()=>!1;const F=E.path.map(({x:ie,y:Y})=>[ie,Y]),R=E.roomLabel.position,{x:ee,y:j}=R,{width:N,height:G}=z,_=N/2,U=G/2;return function(Y){const te=ee*Y,re=j*Y,oe=F.map(([we,Le])=>[we*Y,Le*Y]);return[[te+_,re-U],[te-_,re-U],[te-_,re+U],[te+_,re+U]].every(we=>al(we,oe))}}const g=document.body.clientWidth,v=document.body.clientHeight,b=l.roomLabel,y=b.positionInImage.x*100+"%",x=b.positionInImage.y*100+"%",P=(g<500||v<500?10:14)/16+"rem";let k=!1,T,I;c.subscribe(function(z){e(13,k=!!z&&z.id===l.id)}),It(()=>{const E=T==null?void 0:T.getClientRects()[0];e(14,I={width:E.width,height:E.height})});function D(E){jt[E?"unshift":"push"](()=>{T=E,e(2,T)})}return i.$$set=E=>{"pxmm"in E&&e(9,a=E.pxmm),"room"in E&&e(0,l=E.room),"hoveredRoom"in E&&e(10,c=E.hoveredRoom),"getRoomAreaText"in E&&e(11,h=E.getRoomAreaText),"getLabelElement"in E&&e(1,f=E.getLabelElement),"adaptiveRoomLabelVisibleEnable"in E&&e(12,u=E.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&2049&&e(5,n=l.size?h(l.size):""),i.$$.dirty&16385&&e(15,o=I?m(l,I):void 0),i.$$.dirty&3&&e(4,s=f==null?void 0:f(l)),i.$$.dirty&45568&&e(3,r=u?k?!0:!!(o!=null&&o(a)):!0)},[l,f,T,r,s,n,y,x,P,a,c,h,u,k,I,o,D]}class cl extends fe{constructor(t){super(),de(this,t,ll,rl,ue,{pxmm:9,room:0,hoveredRoom:10,getRoomAreaText:11,getLabelElement:1,adaptiveRoomLabelVisibleEnable:12},il)}}function hl(i){be(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 Ao(i,t,e){const n=i.slice();return n[10]=t[e],n}function yo(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=Ao(i,r,l),h=a(c);n.set(h,e[l]=Po(h,c))}return{c(){t=Q("div");for(let l=0;l<e.length;l+=1)e[l].c();C(t,"class","floorplan-plugin__room-labels svelte-13xux0b"),Ke(()=>i[9].call(t))},m(l,c){V(l,t,c);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=St(t,i[9].bind(t)),s=!0},p(l,c){c&111&&(r=l[6],Ce(),e=gt(e,c,a,1,l,r,n,t,Ot,Po,null,Ao),Ee())},i(l){if(!s){for(let c=0;c<r.length;c+=1)X(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)K(e[c]);s=!1},d(l){l&&H(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}function Po(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=Ge(r,s[a]);return n=new cl({props:r}),{key:i,first:null,c(){e=Re(),Pe(n.$$.fragment),this.first=e},m(a,l){V(a,e,l),Ae(n,a,l),o=!0},p(a,l){t=a;const c=l&111?Xe(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||(X(n.$$.fragment,a),o=!0)},o(a){K(n.$$.fragment,a),o=!1},d(a){a&&H(e),ye(n,a)}}}function ul(i){let t,e,n=i[6]&&yo(i);return{c(){n&&n.c(),t=Re()},m(o,s){n&&n.m(o,s),V(o,t,s),e=!0},p(o,[s]){o[6]?n?(n.p(o,s),s&64&&X(n,1)):(n=yo(o),n.c(),X(n,1),n.m(t.parentNode,t)):n&&(Ce(),K(n,1,1,()=>{n=null}),Ee())},i(o){e||(X(n),e=!0)},o(o){K(n),e=!1},d(o){n&&n.d(o),o&&H(t)}}}function dl(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t,{hoveredRoom:r}=t,{getRoomAreaText:a}=t,{getLabelElement:l}=t,{adaptiveRoomLabelVisibleEnable:c}=t,h=0,f=0;function u(){h=this.clientWidth,e(4,h)}return i.$$set=m=>{"floorIndex"in m&&e(7,o=m.floorIndex),"floorplanData"in m&&e(8,s=m.floorplanData),"hoveredRoom"in m&&e(0,r=m.hoveredRoom),"getRoomAreaText"in m&&e(1,a=m.getRoomAreaText),"getLabelElement"in m&&e(2,l=m.getLabelElement),"adaptiveRoomLabelVisibleEnable"in m&&e(3,c=m.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&384&&e(6,n=s.floorDatas[o].rooms),i.$$.dirty&272){const{max:m,min:g}=s.bounding,v=m.x-g.x;e(5,f=h/v)}},[r,a,l,c,h,f,n,o,s,u]}class fl extends fe{constructor(t){super(),de(this,t,dl,ul,ue,{floorIndex:7,floorplanData:8,hoveredRoom:0,getRoomAreaText:1,getLabelElement:2,adaptiveRoomLabelVisibleEnable:3},hl)}}function ml(i){be(i,"svelte-djlmk4",".floorplan-plugin__rule-labels.svelte-djlmk4.svelte-djlmk4{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-djlmk4.svelte-djlmk4{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4.svelte-djlmk4{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4.svelte-djlmk4{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4.svelte-djlmk4{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-djlmk4.svelte-djlmk4{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale-wrapper.svelte-djlmk4{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-djlmk4.svelte-djlmk4{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale.svelte-djlmk4{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute}.floorplan-plugin__rule-labels--top.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-djlmk4.svelte-djlmk4{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-text-item.svelte-djlmk4{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-djlmk4.svelte-djlmk4{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}")}function wo(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function Io(i,t,e){const n=i.slice();return n[14]=t[e],n}function xo(i){let t;return{c(){t=Q("div"),C(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),S(t,"left",i[14].left*100+"%"),S(t,"bottom",i[14].bottom*100+"%")},m(e,n){V(e,t,n)},p:ne,d(e){e&&H(t)}}}function Co(i,t){let e,n,o=t[1](t[11].distance)+"",s,r;return{key:i,first:null,c(){e=Q("div"),n=Q("div"),s=Ue(o),r=pe(),C(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),je(n,"is-row",t[2]),C(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),S(e,"left",t[11].left*100+"%"),S(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){V(a,e,l),W(e,n),W(n,s),W(e,r)},p(a,l){t=a,l&2&&o!==(o=t[1](t[11].distance)+"")&&ct(s,o)},d(a){a&&H(e)}}}function pl(i){let t,e,n,o,s,r,a=[],l=new Map,c,h=i[3],f=[];for(let g=0;g<h.length;g+=1)f[g]=xo(Io(i,h,g));let u=i[4];const m=g=>g[13];for(let g=0;g<u.length;g+=1){let v=wo(i,u,g),b=m(v);l.set(b,a[g]=Co(b,v))}return{c(){t=Q("div"),e=Q("div"),n=pe(),o=Q("div");for(let g=0;g<f.length;g+=1)f[g].c();s=pe(),r=Q("div");for(let g=0;g<a.length;g+=1)a[g].c();C(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),C(o,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),je(o,"is-row",i[2]),C(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),C(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+i[0]+" svelte-djlmk4"),je(t,"is-row",i[2]),S(t,"width",i[2]?"100%":1/16+"rem"),S(t,"height",i[2]?1/16+"rem":"100%")},m(g,v){V(g,t,v),W(t,e),W(t,n),W(t,o);for(let b=0;b<f.length;b+=1)f[b].m(o,null);W(t,s),W(t,r);for(let b=0;b<a.length;b+=1)a[b].m(r,null)},p(g,[v]){if(v&8){h=g[3];let b;for(b=0;b<h.length;b+=1){const y=Io(g,h,b);f[b]?f[b].p(y,v):(f[b]=xo(y),f[b].c(),f[b].m(o,null))}for(;b<f.length;b+=1)f[b].d(1);f.length=h.length}v&22&&(u=g[4],a=gt(a,v,m,1,g,u,l,r,mo,Co,null,wo)),v&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+g[0]+" svelte-djlmk4")&&C(t,"class",c),v&5&&je(t,"is-row",g[2])},i:ne,o:ne,d(g){g&&H(t),Mt(f,g);for(let v=0;v<a.length;v+=1)a[v].d()}}}const Bt=1e3,Ft=180;function gl(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-(Bt-Ft)*2,c=s.max.y-s.min.y-(Bt-Ft)*2,h=o.map(([g,v])=>a?[g.x,v.x]:[g.y,v.y]).flat().sort().filter((g,v,b)=>v===0?!0:g!==b[v-1]),f=h.map(g=>{const v=a?(g-s.min.x-Bt+Ft)/l:0,b=a?0:(g-s.min.y-Bt+Ft)/c;return{left:v,bottom:b}});f.unshift({left:0,bottom:0}),f.push(a?{left:1,bottom:0}:{left:0,bottom:1});const u=h[h.length-1]-h[0],m=h.map((g,v,b)=>{const y=v===0?0:g-b[v-1],x=v===0?0:(g+b[v-1])/2,P=a?(x-s.min.x-Bt+Ft)/l:0,k=a?0:(x-s.min.y-Bt+Ft)/c;return{left:P,bottom:k,distance:y}}).filter(({distance:g})=>g/u>.1);return i.$$set=g=>{"type"in g&&e(0,n=g.type),"data"in g&&e(5,o=g.data),"bounding"in g&&e(6,s=g.bounding),"getRuleDistanceText"in g&&e(1,r=g.getRuleDistanceText)},[n,r,a,f,m,o,s]}class vl extends fe{constructor(t){super(),de(this,t,gl,pl,ue,{type:0,data:5,bounding:6,getRuleDistanceText:1},ml)}}function bl(i){be(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function Eo(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function Lo(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=Ge(r,s[a]);return n=new vl({props:r}),{key:i,first:null,c(){e=Re(),Pe(n.$$.fragment),this.first=e},m(a,l){V(a,e,l),Ae(n,a,l),o=!0},p(a,l){t=a;const c=l&19?Xe(s,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){o||(X(n.$$.fragment,a),o=!0)},o(a){K(n.$$.fragment,a),o=!1},d(a){a&&H(e),ye(n,a)}}}function Al(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=Eo(i,s,a),c=r(l);n.set(c,e[a]=Lo(c,l))}return{c(){t=Q("div");for(let a=0;a<e.length;a+=1)e[a].c();C(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),S(t,"width",i[3]),S(t,"height",i[2])},m(a,l){V(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],Ce(),e=gt(e,l,r,1,a,s,n,t,Ot,Lo,null,Eo),Ee()),l&8&&S(t,"width",a[3]),l&4&&S(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)X(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)K(e[l]);o=!1},d(a){a&&H(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const ko=1e3,Do=180;function yl(i,t,e){let n,o,s,r,a,l,c,h,f,u,{floorIndex:m}=t,{floorplanData:g}=t,{getRuleDistanceText:v}=t;return i.$$set=b=>{"floorIndex"in b&&e(5,m=b.floorIndex),"floorplanData"in b&&e(6,g=b.floorplanData),"getRuleDistanceText"in b&&e(0,v=b.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=g.bounding),i.$$.dirty&96&&e(11,o=g.floorDatas[m].rules),i.$$.dirty&2048&&e(12,s=Object.keys(o)),i.$$.dirty&6144&&e(4,r=s.map(b=>[b,o[b]])),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-(ko-Do)*2),i.$$.dirty&2&&e(8,h=n.max.y-n.min.y-(ko-Do)*2),i.$$.dirty&1536&&e(3,f=c/a*100+"%"),i.$$.dirty&384&&e(2,u=h/l*100+"%")},[v,n,u,f,r,m,g,l,h,a,c,o,s]}class Pl extends fe{constructor(t){super(),de(this,t,yl,Al,ue,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},bl)}}function Cn(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,h=l+","+c;return a===0?(e+="M"+h,e):o!=null&&o[a]?(e+="A"+o[a]+","+h,e):(e+="L"+h,e)}),e+(n?"Z":"")}function To({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function wl(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 Il(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 xl(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function Cl(i){let t;return{c(){t=Te("path"),C(t,"d",i[0]),C(t,"fill","#2F313A")},m(e,n){V(e,t,n)},p(e,[n]){n&1&&C(t,"d",e[0])},i:ne,o:ne,d(e){e&&H(t)}}}function El(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=Cn(o,{needZ:!0}))},[n,o]}class Ll extends fe{constructor(t){super(),de(this,t,El,Cl,ue,{path:1})}}function kl(i){let t,e,n,o,s,r;return{c(){t=Te("defs"),e=Te("pattern"),n=Te("rect"),o=Te("path"),s=pe(),r=Te("path"),C(n,"x","0"),C(n,"y","0"),C(n,"width",i[1]),C(n,"height",i[1]),C(n,"fill","#323747"),C(o,"d",i[2]),C(o,"stroke","#ffffff"),C(o,"stroke-opacity","0.06"),C(o,"stroke-width","0.5"),C(o,"fill","none"),C(e,"id","fpm-room-pattern-0"),C(e,"x","0"),C(e,"y","0"),C(e,"width",i[1]),C(e,"height",i[1]),C(e,"patternUnits","userSpaceOnUse"),C(e,"patternTransform","scale(50 50)"),C(r,"d",i[0]),C(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){V(a,t,l),W(t,e),W(e,n),W(e,o),V(a,s,l),V(a,r,l)},p(a,[l]){l&1&&C(r,"d",a[0])},i:ne,o:ne,d(a){a&&H(t),a&&H(s),a&&H(r)}}}const ui=6;function Dl(i,t,e){let n,{path:o}=t;const s=ui*2,r=`M0 ${ui} h ${s} M${ui} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=Cn(o,{needZ:!0}))},[n,s,r,o]}class Tl extends fe{constructor(t){super(),de(this,t,Dl,kl,ue,{path:3})}}function zl(i){let t,e,n,o,s,r,a,l,c,h,f;return{c(){t=Te("defs"),e=Te("pattern"),n=Te("rect"),o=Te("pattern"),s=Te("rect"),r=pe(),a=Te("path"),l=pe(),c=Te("path"),h=pe(),f=Te("path"),C(n,"x","0"),C(n,"y","0"),C(n,"width","6"),C(n,"height","50"),C(n,"fill","none"),C(n,"stroke","#4B4B57"),C(n,"stroke-width","0.5"),C(e,"id","room-material-pattern-1"),C(e,"x","0"),C(e,"y","0"),C(e,"width","12"),C(e,"height","50"),C(e,"patternUnits","userSpaceOnUse"),C(e,"patternTransform","scale(50 50)"),C(s,"x","0"),C(s,"y","0"),C(s,"width","6"),C(s,"height","50"),C(s,"fill","none"),C(s,"stroke","#4B4B57"),C(s,"stroke-width","0.5"),C(o,"id","room-material-pattern-2"),C(o,"x","6"),C(o,"y","25"),C(o,"width","12"),C(o,"height","50"),C(o,"patternUnits","userSpaceOnUse"),C(o,"patternTransform","scale(50 50)"),C(a,"d",i[0]),C(a,"fill","#43434D"),C(c,"d",i[0]),C(c,"fill","url(#room-material-pattern-1)"),C(f,"d",i[0]),C(f,"fill","url(#room-material-pattern-2)")},m(u,m){V(u,t,m),W(t,e),W(e,n),W(t,o),W(o,s),V(u,r,m),V(u,a,m),V(u,l,m),V(u,c,m),V(u,h,m),V(u,f,m)},p(u,[m]){m&1&&C(a,"d",u[0]),m&1&&C(c,"d",u[0]),m&1&&C(f,"d",u[0])},i:ne,o:ne,d(u){u&&H(t),u&&H(r),u&&H(a),u&&H(l),u&&H(c),u&&H(h),u&&H(f)}}}function Ml(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=Cn(o,{needZ:!0}))},[n,o]}class Sl extends fe{constructor(t){super(),de(this,t,Ml,zl,ue,{path:1})}}function jl(i){be(i,"svelte-1dykexu",".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}")}function zo(i,t,e){const n=i.slice();return n[5]=t[e],n}function Ol(i){let t,e;return t=new Tl({props:{path:i[5].path}}),{c(){Pe(t.$$.fragment)},m(n,o){Ae(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(X(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){ye(t,n)}}}function Nl(i){let t,e;return t=new Sl({props:{path:i[5].path}}),{c(){Pe(t.$$.fragment)},m(n,o){Ae(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(X(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){ye(t,n)}}}function Bl(i){let t,e;return t=new Ll({props:{path:i[5].path}}),{c(){Pe(t.$$.fragment)},m(n,o){Ae(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(X(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){ye(t,n)}}}function Mo(i){let t,e,n,o;const s=[Bl,Nl,Ol],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=Te("svg"),n.c(),C(t,"width","100%"),C(t,"height","100%"),C(t,"viewBox",`0 0 ${i[1]} ${i[2]}`),C(t,"class","svelte-1dykexu")},m(l,c){V(l,t,c),r[e].m(t,null),o=!0},p(l,c){let h=e;e=a(l),e===h?r[e].p(l,c):(Ce(),K(r[h],1,1,()=>{r[h]=null}),Ee(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),X(n,1),n.m(t,null))},i(l){o||(X(n),o=!0)},o(l){K(n),o=!1},d(l){l&&H(t),r[e].d()}}}function Fl(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=Mo(zo(i,n,r));const s=r=>K(o[r],1,1,()=>{o[r]=null});return{c(){t=Q("div");for(let r=0;r<o.length;r+=1)o[r].c();C(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){V(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=zo(r,n,l);o[l]?(o[l].p(c,a),X(o[l],1)):(o[l]=Mo(c),o[l].c(),X(o[l],1),o[l].m(t,null))}for(Ce(),l=n.length;l<o.length;l+=1)s(l);Ee()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)X(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)K(o[a]);e=!1},d(r){r&&H(t),Mt(o,r)}}}function Gl(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=>Object.assign(Object.assign({},l),{path:l.path.map(c=>To(c,s.bounding))})))},[n,r,a,o,s]}class Rl extends fe{constructor(t){super(),de(this,t,Gl,Fl,ue,{floorIndex:3,floorplanData:4},jl)}}function Xl(i){be(i,"svelte-19uvvss","path.svelte-19uvvss{opacity:0}path.svelte-19uvvss:hover{opacity:0.1}")}function Ql(i){let t,e,n;return{c(){t=Te("path"),C(t,"d",i[2]),C(t,"fill","#fff"),C(t,"class","svelte-19uvvss")},m(o,s){V(o,t,s),e||(n=[qe(t,"mouseenter",i[0]),qe(t,"mouseleave",i[1])],e=!0)},p:ne,i:ne,o:ne,d(o){o&&H(t),e=!1,Tt(n)}}}function Wl(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=Cn(n.path,{needZ:!0,format:h=>To(h,l)});return i.$$set=h=>{"room"in h&&e(3,n=h.room),"floorplanData"in h&&e(4,o=h.floorplanData),"hoveredRoom"in h&&e(5,s=h.hoveredRoom)},[r,a,c,n,o,s]}class Hl extends fe{constructor(t){super(),de(this,t,Wl,Ql,ue,{room:3,floorplanData:4,hoveredRoom:5},Xl)}}function Yl(i){be(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 So(i,t,e){const n=i.slice();return n[5]=t[e],n}function jo(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=Ge(r,s[a]);return n=new Hl({props:r}),{key:i,first:null,c(){e=Re(),Pe(n.$$.fragment),this.first=e},m(a,l){V(a,e,l),Ae(n,a,l),o=!0},p(a,l){t=a;const c=l&7?Xe(s,[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}]):{};n.$set(c)},i(a){o||(X(n.$$.fragment,a),o=!0)},o(a){K(n.$$.fragment,a),o=!1},d(a){a&&H(e),ye(n,a)}}}function Vl(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=So(i,r,l),h=a(c);o.set(h,n[l]=jo(h,c))}return{c(){t=Q("div"),e=Te("svg");for(let l=0;l<n.length;l+=1)n[l].c();C(e,"width","100%"),C(e,"height","100%"),C(e,"viewBox",`0 0 ${i[3]} ${i[4]}`),C(e,"class","svelte-1kqo6e4"),C(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){V(l,t,c),W(t,e);for(let h=0;h<n.length;h+=1)n[h].m(e,null);s=!0},p(l,[c]){c&7&&(r=l[1].floorDatas[l[0]].rooms,Ce(),n=gt(n,c,a,1,l,r,o,e,Ot,jo,null,So),Ee())},i(l){if(!s){for(let c=0;c<r.length;c+=1)X(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)K(n[c]);s=!1},d(l){l&&H(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function Zl(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 Oo extends fe{constructor(t){super(),de(this,t,Zl,Vl,ue,{floorIndex:0,floorplanData:1,hoveredRoom:2},Yl)}}function Jl(i){be(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 No(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=Ge(o,n[s]);return t=new Oo({props:o}),{c(){Pe(t.$$.fragment)},m(s,r){Ae(t,s,r),e=!0},p(s,r){const a=r&1058?Xe(n,[{floorIndex:s[1],floorplanData:s[5],hoveredRoom:s[10]}]):{};t.$set(a)},i(s){e||(X(t.$$.fragment,s),e=!0)},o(s){K(t.$$.fragment,s),e=!1},d(s){ye(t,s)}}}function Bo(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=Ge(o,n[s]);return t=new fl({props:o}),{c(){Pe(t.$$.fragment)},m(s,r){Ae(t,s,r),e=!0},p(s,r){const a=r&1762?Xe(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||(X(t.$$.fragment,s),e=!0)},o(s){K(t.$$.fragment,s),e=!1},d(s){ye(t,s)}}}function Fo(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=Ge(o,n[s]);return t=new Pl({props:o}),{c(){Pe(t.$$.fragment)},m(s,r){Ae(t,s,r),e=!0},p(s,r){const a=r&290?Xe(n,[{floorplanData:s[5],floorIndex:s[1],getRuleDistanceText:s[8]}]):{};t.$set(a)},i(s){e||(X(t.$$.fragment,s),e=!0)},o(s){K(t.$$.fragment,s),e=!1},d(s){ye(t,s)}}}function Ul(i){let t,e,n,o,s,r,a,l,c;const h=[{floorIndex:i[1],floorplanData:i[5]}];let f={};for(let y=0;y<h.length;y+=1)f=Ge(f,h[y]);e=new Rl({props:f});let u=i[2]&&No(i);const m=[{floorplanData:i[5],floorIndex:i[1]}];let g={};for(let y=0;y<m.length;y+=1)g=Ge(g,m[y]);s=new bo({props:g});let v=i[3]&&Bo(i),b=i[4]&&Fo(i);return{c(){t=Q("div"),Pe(e.$$.fragment),n=pe(),u&&u.c(),o=pe(),Pe(s.$$.fragment),r=pe(),v&&v.c(),a=pe(),b&&b.c(),C(t,"class",l=Se(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(y,x){V(y,t,x),Ae(e,t,null),W(t,n),u&&u.m(t,null),W(t,o),Ae(s,t,null),W(t,r),v&&v.m(t,null),W(t,a),b&&b.m(t,null),c=!0},p(y,[x]){const P=x&34?Xe(h,[{floorIndex:y[1],floorplanData:y[5]}]):{};e.$set(P),y[2]?u?(u.p(y,x),x&4&&X(u,1)):(u=No(y),u.c(),X(u,1),u.m(t,o)):u&&(Ce(),K(u,1,1,()=>{u=null}),Ee());const k=x&34?Xe(m,[{floorplanData:y[5],floorIndex:y[1]}]):{};s.$set(k),y[3]?v?(v.p(y,x),x&8&&X(v,1)):(v=Bo(y),v.c(),X(v,1),v.m(t,a)):v&&(Ce(),K(v,1,1,()=>{v=null}),Ee()),y[4]?b?(b.p(y,x),x&16&&X(b,1)):(b=Fo(y),b.c(),X(b,1),b.m(t,null)):b&&(Ce(),K(b,1,1,()=>{b=null}),Ee()),(!c||x&1&&l!==(l=Se(`floorplan-plugin__floor${y[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&C(t,"class",l)},i(y){c||(X(e.$$.fragment,y),X(u),X(s.$$.fragment,y),X(v),X(b),c=!0)},o(y){K(e.$$.fragment,y),K(u),K(s.$$.fragment,y),K(v),K(b),c=!1},d(y){y&&H(t),ye(e),u&&u.d(),ye(s),v&&v.d(),b&&b.d()}}}function ql(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:h}=t,{getRuleDistanceText:f}=t,{adaptiveRoomLabelVisibleEnable:u}=t;const m=vo(void 0);return i.$$set=g=>{"isCurrent"in g&&e(0,n=g.isCurrent),"floorIndex"in g&&e(1,o=g.floorIndex),"hoverEnable"in g&&e(2,s=g.hoverEnable),"roomLabelsEnable"in g&&e(3,r=g.roomLabelsEnable),"ruleLabelsEnable"in g&&e(4,a=g.ruleLabelsEnable),"floorplanData"in g&&e(5,l=g.floorplanData),"getRoomAreaText"in g&&e(6,c=g.getRoomAreaText),"getLabelElement"in g&&e(7,h=g.getLabelElement),"getRuleDistanceText"in g&&e(8,f=g.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in g&&e(9,u=g.adaptiveRoomLabelVisibleEnable)},[n,o,s,r,a,l,c,h,f,u,m]}class Kl extends fe{constructor(t){super(),de(this,t,ql,Ul,ue,{isCurrent:0,floorIndex:1,hoverEnable:2,roomLabelsEnable:3,ruleLabelsEnable:4,floorplanData:5,getRoomAreaText:6,getLabelElement:7,getRuleDistanceText:8,adaptiveRoomLabelVisibleEnable:9},Jl)}}function _l(i){be(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function Go(i,t,e){const n=i.slice();return n[16]=t[e],n}function Ro(i){let t,e,n,o,s,r,a=i[9].floorDatas,l=[];for(let m=0;m<a.length;m+=1)l[m]=Xo(Go(i,a,m));const c=m=>K(l[m],1,1,()=>{l[m]=null}),h=[{panoIndex:i[3],floorplanData:i[9],lastPanoramaLongitude:i[10],cameraImageUrl:i[11]}];let f={};for(let m=0;m<h.length;m+=1)f=Ge(f,h[m]);n=new Na({props:f});let u=i[6]&&Qo(i);return{c(){t=Q("div");for(let m=0;m<l.length;m+=1)l[m].c();e=pe(),Pe(n.$$.fragment),o=pe(),u&&u.c(),C(t,"class","floorplan-main svelte-86bqav")},m(m,g){V(m,t,g);for(let v=0;v<l.length;v+=1)l[v].m(t,null);W(t,e),Ae(n,t,null),W(t,o),u&&u.m(t,null),r=!0},p(m,g){if(i=m,g&62384){a=i[9].floorDatas;let b;for(b=0;b<a.length;b+=1){const y=Go(i,a,b);l[b]?(l[b].p(y,g),X(l[b],1)):(l[b]=Xo(y),l[b].c(),X(l[b],1),l[b].m(t,e))}for(Ce(),b=a.length;b<l.length;b+=1)c(b);Ee()}const v=g&3592?Xe(h,[{panoIndex:i[3],floorplanData:i[9],lastPanoramaLongitude:i[10],cameraImageUrl:i[11]}]):{};n.$set(v),i[6]?u?(u.p(i,g),g&64&&X(u,1)):(u=Qo(i),u.c(),X(u,1),u.m(t,null)):u&&(Ce(),K(u,1,1,()=>{u=null}),Ee())},i(m){if(!r){for(let g=0;g<a.length;g+=1)X(l[g]);X(n.$$.fragment,m),X(u),s||Ke(()=>{s=ca(t,za,{duration:i[0],easing:ii}),s.start()}),r=!0}},o(m){l=l.filter(Boolean);for(let g=0;g<l.length;g+=1)K(l[g]);K(n.$$.fragment,m),K(u),r=!1},d(m){m&&H(t),Mt(l,m),ye(n),u&&u.d()}}}function Xo(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=Ge(o,n[s]);return t=new Kl({props:o}),{c(){Pe(t.$$.fragment)},m(s,r){Ae(t,s,r),e=!0},p(s,r){const a=r&62384?Xe(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||(X(t.$$.fragment,s),e=!0)},o(s){K(t.$$.fragment,s),e=!1},d(s){ye(t,s)}}}function Qo(i){let t,e;return t=new Wa({props:{floorplanData:i[9],northDesc:i[2]}}),{c(){Pe(t.$$.fragment)},m(n,o){Ae(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||(X(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){ye(t,n)}}}function $l(i){let t,e,n=i[1]&&Ro(i);return{c(){n&&n.c(),t=Re()},m(o,s){n&&n.m(o,s),V(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&X(n,1)):(n=Ro(o),n.c(),X(n,1),n.m(t.parentNode,t)):n&&(Ce(),K(n,1,1,()=>{n=null}),Ee())},i(o){e||(X(n),e=!0)},o(o){K(n),e=!1},d(o){n&&n.d(o),o&&H(t)}}}function ec(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:h}=t,{ruleLabelsEnable:f}=t,{floorplanData:u}=t,{lastPanoramaLongitude:m}=t,{cameraImageUrl:g}=t,{getRoomAreaText:v}=t,{getLabelElement:b}=t,{getRuleDistanceText:y}=t,{adaptiveRoomLabelVisibleEnable:x}=t;return i.$$set=P=>{"duration"in P&&e(0,n=P.duration),"visible"in P&&e(1,o=P.visible),"northDesc"in P&&e(2,s=P.northDesc),"panoIndex"in P&&e(3,r=P.panoIndex),"floorIndex"in P&&e(4,a=P.floorIndex),"hoverEnable"in P&&e(5,l=P.hoverEnable),"compassEnable"in P&&e(6,c=P.compassEnable),"roomLabelsEnable"in P&&e(7,h=P.roomLabelsEnable),"ruleLabelsEnable"in P&&e(8,f=P.ruleLabelsEnable),"floorplanData"in P&&e(9,u=P.floorplanData),"lastPanoramaLongitude"in P&&e(10,m=P.lastPanoramaLongitude),"cameraImageUrl"in P&&e(11,g=P.cameraImageUrl),"getRoomAreaText"in P&&e(12,v=P.getRoomAreaText),"getLabelElement"in P&&e(13,b=P.getLabelElement),"getRuleDistanceText"in P&&e(14,y=P.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in P&&e(15,x=P.adaptiveRoomLabelVisibleEnable)},[n,o,s,r,a,l,c,h,f,u,m,g,v,b,y,x]}class di extends fe{constructor(t){super(),de(this,t,ec,$l,ue,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,hoverEnable:5,compassEnable:6,roomLabelsEnable:7,ruleLabelsEnable:8,floorplanData:9,lastPanoramaLongitude:10,cameraImageUrl:11,getRoomAreaText:12,getLabelElement:13,getRuleDistanceText:14,adaptiveRoomLabelVisibleEnable:15},_l)}}const tc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLOK6BPwIk9nNODM9Xf1RVe1b3elJRjCZmQ6euqGmuqer33rq4e23GqiOykBloDJQGagMVAYqA5WBykBlYFYD1qwP/tdzaZqOx9zYOLxeX0+L5yzLGp0X/03a25MOnGRcBtx+6Rlo9SL08G4EooFnxa8Yiivox5/h5Ys/4cl7NVorNDRnngX+0MIkVMeMSf23zyKML8J7/Dy8hwF2Buh9CnS+AEQIdLspBuGb+M7/qLW4qJrNpsLapjYhpwVnx3BMfCtNNx3Etc9xywvnMf80wG8HmQainw0RxSGrnmeBp+8k5/j9S0HbvXb5io0Lz880/0wPHV1NlhLd316He+4xOCv5ragF7L9PrH1qBJyB0626x/lC+qrSvH5r/W+n1WpxUM5nMY4GPeH8lHJaPgfeAFQHCL+ntkXT+vnUc3W6pvTIwC0wy3rA4dwLmK2avZ7Eo9uKBuYJfgJscbs8dLCxDMt+EOEPBEZNEWyBYHqTz6bPXrzUnNrSShxHIsYiOL69zrCGLLcLqJP68tB+9w5wj+YhWDafQ2s61wNqxjZhmrQ2pvMFCEvXuCUZ7wqH794ZWs28LJqlTXSUyuksF2M/yOwqgkx2c1ADa4wLAQRk2sAGQQakhN6yFC2hltfz5kSY44NKQeeh+vtI/SSzWhg2CzCgmWISmKUGmaYFBDfCSymnfxJ6/+ospVcWOLLp5DGP/y0P/Rp66O99DQNq7Po3Ds0a0wY+My2QSv2N2mO/OyxR2o6UQk+Lv7yJ06JYSnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";async function nc(i){const t=new Headers({"Content-Type":"text/plain"}),e=async function(o){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=await fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s};return await Promise.all(i.map(e))}function ic(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 oc(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(ic),rules:i.rules}}function sc(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function rc(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}}async function At(i){const t=await nc(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(oc),o=i.computed_data.entrance?rc(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(sc)}}function ac(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:tc,width:45,height:48},a=xl(s,t),l=wl(s,e),c=Il(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function lc(i,t){return t(i),i}function En(i,t){return lc({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function Wo(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 fi(i,t,e=vt.BOUNDING_CENTER){const n=Wo(i,t),o=Wo(i,t+1);return e===vt.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===vt.CEILING?o:n}function mi(i,t,e,n){const o=fi(i,e,n==null?void 0:n.attachedTo),s=new O.Vector3(0,o,0),r=new O.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 Ho{constructor(t){d(this,"five");d(this,"hooks",new me.Subscribe);this.five=t}getCurrentState(){return this.state}}class Ct extends Ho{}var Ye=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(Ye||{});const Yo=500,cc=80;function pi(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}async function Vo(i,t){await 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 h=o[c];if(h===void 0)return!0;const f=l[c];return typeof h=="number"&&typeof f=="number"?pi(h,f,2):h===f}):!0})()||n(new Error("five pose \u4E0E\u9884\u671F\u4E0D\u7B26")),e()})})}function gi(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!(!pi(e,s,2)||!pi(n,r,2)||o!==a)}async function Zo(i,t,e=!0){if(gi(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[h]=await wn(Vo(i,[t.mode,t,void 0,e]));if(h)throw new Error(Ye.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]=await wn(i.updateCamera(t,l,e));if(c)throw new Error(Ye.UpdateCameraError)}function Gt(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 hc(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 uc(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 dc extends Ct{constructor(e,n){var a;super(e);d(this,"name","modelFloorplanPlugin");d(this,"state");d(this,"data");d(this,"showState");d(this,"showPromise");d(this,"app");d(this,"panoIndex",0);d(this,"floorIndex",0);d(this,"selector");d(this,"showRejection");d(this,"wrapper");d(this,"container",document.createElement("div"));d(this,"lastPanoramaLongitude",0);d(this,"size",{width:0,height:0});d(this,"hasAddedEventListener",!1);d(this,"isHiddenByHideFunc",!1);d(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")});d(this,"show",async(e={})=>{if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show(e)});d(this,"hide",async(e={})=>{!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))});d(this,"updateSize",()=>{if(!this.data||!gi(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=mi(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})});d(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,Ye.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});d(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}))});d(this,"_show",async e=>{var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Ye.ModelNotLoaded);if(!this.data)throw new Error(Ye.DataNotLoaded);this.isHiddenByHideFunc=!1;const o={...{floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},...e},s=async()=>{this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=await wn(Zo(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Ye.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const h=o.modelOpacity,f=o.immediately?0:Yo;Gt(this.five,h,f),this.render(f)};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});d(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,Ye.BreakOffByHide),this.showPromise=void 0;const o={...{userAction:!0,isAutoHide:!1},...e};Gt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});d(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});d(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)});d(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});d(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||uc(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});d(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});d(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();hc(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});d(this,"onFiveWantsGesture",(e,n)=>{if(!!this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});d(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});d(this,"onFiveWantsTapGesture",()=>this.handleClick());d(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});d(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:cc/((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:bt,attachedTo:vt.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},s=n?En(n,["selector","scale"]):{},r={...o,...s};this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}async load(e,n,o=!0){function s(h){return Object.prototype.hasOwnProperty.apply(h,["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=await At(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()}async formatData(e){return await At(e.data)}updateState(e,n){const o=this.state,s=e.config?{...o.config,...e.config}:o.config;this.state={...this.state,...e,config:s},!et(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n={...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 di({target:this.container,intro:!0,props:n})}}const fc=(i,t)=>new dc(i,t);function mc(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 pc(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 gc extends Ct{constructor(e,n){super(e);d(this,"name","modelFloorplanPlugin");d(this,"state");d(this,"data");d(this,"showState");d(this,"showPromise");d(this,"app");d(this,"panoIndex",0);d(this,"floorIndex",0);d(this,"selector");d(this,"showRejection");d(this,"wrapper");d(this,"container",document.createElement("div"));d(this,"lastPanoramaLongitude",0);d(this,"size",{width:0,height:0});d(this,"hasAddedEventListener",!1);d(this,"isHiddenByHideFunc",!1);d(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")});d(this,"show",async(e={})=>{if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show(e)});d(this,"hide",async(e={})=>{!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))});d(this,"updateSize",()=>{if(!this.data||!gi(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=mi(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})});d(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,Ye.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});d(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}))});d(this,"_show",async e=>{var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Ye.ModelNotLoaded);if(!this.data)throw new Error(Ye.DataNotLoaded);this.isHiddenByHideFunc=!1;const o={...{floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},...e},s=async()=>{this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=await wn(Zo(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Ye.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const h=o.modelOpacity,f=o.immediately?0:Yo;Gt(this.five,h,f),this.render(f)};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});d(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,Ye.BreakOffByHide),this.showPromise=void 0;const o={...{userAction:!0,isAutoHide:!1},...e};Gt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});d(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});d(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)});d(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});d(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});d(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();this.updatePosition(),this.updateSize(),mc(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});d(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:(pc(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});d(this,"onFiveWantsTapGesture",()=>this.handleClick());d(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});d(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:bt,attachedTo:vt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?En(n,["selector","scale"]):{},r={...o,...s};this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}async load(e,n,o=!0){function s(h){return Object.prototype.hasOwnProperty.apply(h,["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=await At(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=fi(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new O.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+"%"}async formatData(e){return await At(e.data)}updateState(e,n){const o=this.state,s=e.config?{...o.config,...e.config}:o.config;this.state={...this.state,...e,config:s},!et(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n={...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 di({target:this.container,intro:!0,props:n})}}const vc=(i,t)=>new gc(i,t);class bc extends Ct{constructor(e,n){super(e);d(this,"name","topviewFloorplanPlugin");d(this,"state");d(this,"data");d(this,"app");d(this,"selector");d(this,"panoIndex",0);d(this,"floorIndex",0);d(this,"wrapper");d(this,"container",document.createElement("div"));d(this,"lastPanoramaLongitude",0);d(this,"size",{width:0,height:0});d(this,"hasAddedEventListener",!1);d(this,"isHiddenByHideFunc",!1);d(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=mi(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})});d(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")});d(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})});d(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)});d(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});d(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});d(this,"onFiveCameraUpdate",(e,n)=>{!this.state.visible||(this.updatePosition(),this.updateSize())});d(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});d(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});d(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}))});d(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:bt,attachedTo:vt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?En(n,["selector","scale"]):{},r={...o,...s};this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}async load(e,n,o=!0){function s(h){return Object.prototype.hasOwnProperty.apply(h,["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=await At(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=fi(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new O.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}async show(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})}async hide(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()}async formatData(e){return await At(e.data)}async _show(e){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"&&await Vo(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;Gt(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()}async _hide(e){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;Gt(this.five,o,s),this.render()}_enable(e){const{userAction:n}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}updateState(e,n){const o=this.state,s=e.config?{...o.config,...e.config}:o.config;this.state={...this.state,...e,config:s},!et(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n={...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 di({target:this.container,intro:!0,props:n})}}const Ac=(i,t)=>new bc(i,t);function vi(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function yc(i){be(i,"svelte-1ty3s4p",".plugin-radar__camera-wrapper.svelte-1ty3s4p{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1ty3s4p{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1ty3s4p{position:absolute;left:-0.78125rem;top:-0.78125rem;width:0.88542rem;height:0.88542rem;transform-origin:0.78125rem 0.78125rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function Pc(i){let t,e,n;return{c(){t=Q("div"),e=Q("div"),n=Q("div"),C(n,"class","plugin-radar__camera-rotate svelte-1ty3s4p"),S(n,"background-image","url("+(i[0]||bt)+")"),S(n,"transform",i[1]),C(e,"class","plugin-radar__camera-position svelte-1ty3s4p"),S(e,"transform",i[2]),C(t,"class","plugin-radar__camera-wrapper svelte-1ty3s4p")},m(o,s){V(o,t,s),W(t,e),W(e,n)},p(o,[s]){s&1&&S(n,"background-image","url("+(o[0]||bt)+")"),s&2&&S(n,"transform",o[1]),s&4&&S(e,"transform",o[2])},i:ne,o:ne,d(o){o&&H(t)}}}function wc(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function Ic(i,t,e){let n,o,{five:s}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=s.getCurrentState().panoIndex,h=s.getCurrentState().longitude;function f(g,v){const b=g.bounding,y=g.observers[v];if(!y)return"";const x=(b.max.x-b.min.x)*r,P=(b.max.y-b.min.y)*r,k=Math.floor(y.positionInImage.x*x),T=Math.floor(y.positionInImage.y*P);return`translate(${k}px, ${T}px)`}function u(g){e(6,c=g)}const m=vi(g=>{e(7,h=g.longitude)},1e3/60);return It(()=>(s.on("panoWillArrive",u),s.on("cameraDirectionUpdate",m),function(){s.off("panoWillArrive",u),s.off("cameraDirectionUpdate",m)})),i.$$set=g=>{"five"in g&&e(3,s=g.five),"pxmm"in g&&e(4,r=g.pxmm),"floorplanData"in g&&e(5,a=g.floorplanData),"cameraImageUrl"in g&&e(0,l=g.cameraImageUrl)},i.$$.update=()=>{i.$$.dirty&96&&e(2,n=f(a,c)),i.$$.dirty&128&&e(1,o=wc(h))},[l,o,n,s,r,a,c,h]}class xc extends fe{constructor(t){super(),de(this,t,Ic,Pc,ue,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},yc)}}function Cc(i){be(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 Jo(i,t,e){const n=i.slice();return n[1]=t[e],n}function Uo(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=Q("div"),n=Q("div"),r=pe(),C(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),S(n,"background-image",`url(${t[1].icon.url})`),S(n,"width",o),S(n,"height",s),C(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),S(e,"top",a),S(e,"left",l),this.first=e},m(c,h){V(c,e,h),W(e,n),W(e,r)},p(c,h){t=c,h&1&&S(n,"background-image",`url(${t[1].icon.url})`),h&1&&o!==(o=`${t[1].icon.width/16}rem`)&&S(n,"width",o),h&1&&s!==(s=`${t[1].icon.height/16}rem`)&&S(n,"height",s),h&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&S(e,"top",a),h&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&S(e,"left",l)},d(c){c&&H(e)}}}function Ec(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=Jo(i,o,r),l=s(a);n.set(l,e[r]=Uo(l,a))}return{c(){t=Q("div");for(let r=0;r<e.length;r+=1)e[r].c();C(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){V(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=gt(e,a,s,1,r,o,n,t,mo,Uo,null,Jo))},i:ne,o:ne,d(r){r&&H(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function Lc(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class kc extends fe{constructor(t){super(),de(this,t,Lc,Ec,ue,{extraObjects:0},Cc)}}function qo(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=Ge(o,n[s]);return t=new Oo({props:o}),{c(){Pe(t.$$.fragment)},m(s,r){Ae(t,s,r),e=!0},p(s,r){const a=r&87?Xe(n,[{five:s[0],pxmm:s[1],floorIndex:s[2],floorplanData:s[4],onRoomHeightClick:s[6]}]):{};t.$set(a)},i(s){e||(X(t.$$.fragment,s),e=!0)},o(s){K(t.$$.fragment,s),e=!1},d(s){ye(t,s)}}}function Dc(i){let t,e,n,o,s,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let h=0;h<a.length;h+=1)l=Ge(l,a[h]);t=new bo({props:l}),n=new kc({props:{extraObjects:i[5]}});let c=i[3]&&qo(i);return{c(){Pe(t.$$.fragment),e=pe(),Pe(n.$$.fragment),o=pe(),c&&c.c(),s=Re()},m(h,f){Ae(t,h,f),V(h,e,f),Ae(n,h,f),V(h,o,f),c&&c.m(h,f),V(h,s,f),r=!0},p(h,[f]){const u=f&20?Xe(a,[{floorIndex:h[2],floorplanData:h[4]}]):{};t.$set(u);const m={};f&32&&(m.extraObjects=h[5]),n.$set(m),h[3]?c?(c.p(h,f),f&8&&X(c,1)):(c=qo(h),c.c(),X(c,1),c.m(s.parentNode,s)):c&&(Ce(),K(c,1,1,()=>{c=null}),Ee())},i(h){r||(X(t.$$.fragment,h),X(n.$$.fragment,h),X(c),r=!0)},o(h){K(t.$$.fragment,h),K(n.$$.fragment,h),K(c),r=!1},d(h){ye(t,h),h&&H(e),ye(n,h),h&&H(o),c&&c.d(h),h&&H(s)}}}function Tc(i,t,e){let n,{five:o}=t,{pxmm:s}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t;const h=void 0;return i.$$set=f=>{"five"in f&&e(0,o=f.five),"pxmm"in f&&e(1,s=f.pxmm),"floorIndex"in f&&e(2,r=f.floorIndex),"hoverEnable"in f&&e(3,a=f.hoverEnable),"floorplanData"in f&&e(4,l=f.floorplanData),"extraObjects"in f&&e(7,c=f.extraObjects)},i.$$.update=()=>{i.$$.dirty&132&&e(5,n=c==null?void 0:c.filter(f=>f.floorIndex===r))},[o,s,r,a,l,n,h,c]}class zc extends fe{constructor(t){super(),de(this,t,Tc,Dc,ue,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:7})}}function Mc(i){be(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 Ko(i){let t,e,n,o=i[6]!==0&&_o(i);return{c(){t=Q("div"),o&&o.c(),C(t,"class","plugin-floorplan-radar svelte-1mvqyqq"),Ke(()=>i[12].call(t))},m(s,r){V(s,t,r),o&&o.m(t,null),e=St(t,i[12].bind(t)),n=!0},p(s,r){s[6]!==0?o?(o.p(s,r),r&64&&X(o,1)):(o=_o(s),o.c(),X(o,1),o.m(t,null)):o&&(Ce(),K(o,1,1,()=>{o=null}),Ee())},i(s){n||(X(o),n=!0)},o(s){K(o),n=!1},d(s){s&&H(t),o&&o.d(),e()}}}function _o(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 u=0;u<l.length;u+=1)c=Ge(c,l[u]);e=new zc({props:c});const h=[{pxmm:i[9],five:i[0],floorplanData:i[3],cameraImageUrl:i[4]}];let f={};for(let u=0;u<h.length;u+=1)f=Ge(f,h[u]);return o=new xc({props:f}),{c(){t=Q("div"),Pe(e.$$.fragment),n=pe(),Pe(o.$$.fragment),C(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),S(t,"width",s),S(t,"height",r)},m(u,m){V(u,t,m),Ae(e,t,null),W(t,n),Ae(o,t,null),a=!0},p(u,m){const g=m&1581?Xe(l,[{five:u[0],pxmm:u[9],floorIndex:u[10],floorplanData:u[3],hoverEnable:u[2],extraObjects:u[5]}]):{};e.$set(g);const v=m&537?Xe(h,[{pxmm:u[9],five:u[0],floorplanData:u[3],cameraImageUrl:u[4]}]):{};o.$set(v),m&256&&s!==(s=`${u[8]}px`)&&S(t,"width",s),m&2048&&r!==(r=`${u[11]}px`)&&S(t,"height",r)},i(u){a||(X(e.$$.fragment,u),X(o.$$.fragment,u),a=!0)},o(u){K(e.$$.fragment,u),K(o.$$.fragment,u),a=!1},d(u){u&&H(t),ye(e),ye(o)}}}function Sc(i){let t,e,n=i[1]&&Ko(i);return{c(){n&&n.c(),t=Re()},m(o,s){n&&n.m(o,s),V(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&X(n,1)):(n=Ko(o),n.c(),X(n,1),n.m(t.parentNode,t)):n&&(Ce(),K(n,1,1,()=>{n=null}),Ee())},i(o){e||(X(n),e=!0)},o(o){K(n),e=!1},d(o){n&&n.d(o),o&&H(t)}}}function jc(i,t,e){let{five:n}=t,{visible:o}=t,{hoverEnable:s}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,c=0,h=0,f=0,u=0,m=0,g=0;function v(y){e(10,h=n.work.observers[y].floorIndex)}It(()=>(n.on("panoArrived",v),()=>{n.off("panoArrived",v)}));function b(){f=this.clientWidth,u=this.clientHeight,e(6,f),e(7,u)}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(f,u),{max:x,min:P}=r.bounding,k=x.x-P.x,T=x.y-P.y,I=function(){return k>T?[y,y/k*T]:[y/T*k,y]}();e(8,m=I[0]),e(11,g=I[1]),e(9,c=m/k)}},[n,o,s,r,a,l,f,u,m,c,h,g,b]}class Oc extends fe{constructor(t){super(),de(this,t,jc,Sc,ue,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5},Mc)}}class Nc extends Ct{constructor(e,n){super(e);d(this,"name","panoFloorplanRadarPlugin");d(this,"state");d(this,"data");d(this,"app");d(this,"wrapperSelector","");d(this,"wrapper",null);d(this,"disposed",!1);d(this,"extraObjects",[]);d(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});d(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:bt},s=n!=null&&n.configs?n.configs:{},r={...o,...s};this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}async load(e,n,o=!0){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=await At(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,o),this.render()}async show(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})}async hide(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=ac(e,this.five,this.data),this.render())}async formatData(e){return await At(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={...this.state,...e},!et(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const n=document.querySelector(this.wrapperSelector);this.wrapper=n}if(!this.data||!this.wrapper)return;const e={...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 Oc({target:this.wrapper,props:e})}}const Bc=(i,t)=>new Nc(i,t),Fc=[{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"}],Gc=[{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"}],Rc=[{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 O.Matrix4,o=new O.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},Xc=(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 $o(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s={map:o.material.map||{},...t};o.material=new M.MeshBasicMaterial(s),o.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const Qc=(i,t)=>{var h;const e=t.fbx_url||"//vrlab-static.ljcdn.com/release/web/v3/dipan3/dipan.FBX",n=(h=t.north_rad)!=null?h:void 0,o={},s=async f=>{var ee;const u=(f==null?void 0:f.fbx_url)||e,m=(ee=f==null?void 0:f.north_rad)!=null?ee:n;if(typeof m!="number")throw new Error('"northRad"\u914D\u7F6E\u53C2\u6570\u7F3A\u5931\uFF1A\u672A\u914D\u7F6E\u6307\u5357\u9488\u6307\u5411\uFF01');const g=i.model.bounding,v=g.max.x-g.min.x,b=g.max.z-g.min.z,y=Math.max(v,b),P=await new Vi.FBXLoader().loadAsync(u);$o(P,{transparent:!0,side:O.DoubleSide,blending:O.AdditiveBlending});const k=[0,m-Math.PI/2,0],{model:{bounding:{max:{x:T,z:I},min:{x:D,y:E,z}}}}=i;o.yBase=E;const F={x:(T+D)/2,y:E-1.6,z:(I+z)/2},R=.0045*y;return Xc(P,{position:F,rotation:k,scale:R}),o.object=P,!0},r=({latitude:f})=>{if(!o.object)return;const u=a(f);u&&(o.object.position.y=u)},a=f=>{if(o.yBase===void 0)return;const u=.6;if(f>=Math.PI/4)return o.yBase-(u+1.6);const m=f*(4/Math.PI);return o.yBase-(u*m+1.6)};return{load:s,disable:()=>{!o.object||(i.scene.remove(o.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!o.object)return;const f=a(i.getPose().latitude);f&&(o.object.position.y=f),i.scene.add(o.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function Wc(i,t){var c,h,f,u,m;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(h=t==null?void 0:t.fontSize)!=null?h:e*(35/256)*1.2,o=(f=t==null?void 0:t.backgroundColor)!=null?f:"rgba(0,0,0,0)",s=(u=t==null?void 0:t.fontColor)!=null?u:"#fff",r=(m=t==null?void 0:t.textAlign)!=null?m:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=o,l.fillRect(0,0,e,e),l.font=`${n}px "\u5FAE\u8F6F\u96C5\u9ED1"`,l.textAlign=r,l.fillStyle=s,l.fillText(i,e/2,e*.7),new M.CanvasTexture(a)}const Hc=({x:i,y:t,z:e})=>new M.Vector3(i,t,e),Yc=(i,t)=>{var v,b,y;const e={},n=(v=t.animationEnabled)!=null?v:!0,o=(b=t.position)!=null?b:void 0,s=(y=t.rad)!=null?y:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=async x=>{var z,F,R,ee,j,N,G;const P=(z=x==null?void 0:x.position)!=null?z:o;if(!P)return Promise.reject("ModelEntryDoorGuidePlugin.load(): position is undefined");const k=Hc(P),T=(F=x==null?void 0:x.rad)!=null?F:s,I=(R=x==null?void 0:x.fbx_url)!=null?R:r;if(e.rad=T,T===void 0)return Promise.reject(`ModelEntryDoorGuidePlugin.load(): rad is ${T}`);const D=await new Vi.FBXLoader().loadAsync(I);D.position.copy(k),D.rotation.z=T,D.scale.set(.8,.8,.8),$o(D,{transparent:!0,side:O.DoubleSide});const E=(G=(N=(j=(ee=D.children)==null?void 0:ee[0])==null?void 0:j.children)==null?void 0:N[3])==null?void 0:G.clone();return E?(E.material=new M.MeshBasicMaterial({transparent:!0,map:Wc("\u5165\u6237\u95E8")}),E.renderOrder=3,D.children[0].add(E),e.object=D,!0):Promise.reject(`ModelEntryDoorGuidePlugin.load(): textMesh is ${E}`)},c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const x=1,P=new M.AnimationMixer(e.object);a.push(P);const k=P.clipAction(e.object.animations[0]);k.timeScale=x;let T;const I=()=>{let F=0,R=0;const ee=1e3/30,j=N=>{F=requestAnimationFrame(j);const G=N-R;G<ee||(R=N,a.forEach(_=>_.update(G/1e3)),i.needsRender=!0)};return F=requestAnimationFrame(j),()=>{cancelAnimationFrame(F)}},z={play:()=>{T||(k.play(),T=I(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{k.stop(),T==null||T(),T=void 0}};e.animation=z},h=x=>{var k;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((k=x==null?void 0:x.animationEnable)!=null?k:n)&&(e.animation||c(),e.animation.play()),i.scene.add(e.object),i.needsRender=!0},f=()=>{!e.object||(e.animation&&e.animation.stop(),i.scene.remove(e.object),i.needsRender=!0)},u=x=>x==="Floorplan"?h():f();return{load:l,enable:x=>(e.enabled||(e.enabled=!0,u(i.currentMode),i.on("modeChange",u),h(x)),!0),disable:()=>(e.enabled&&(e.enabled=!1,f(),i.off("modeChange",u)),!0)}},Ln=window.requestAnimationFrame||(i=>setTimeout(i,16)),Vc=window.cancelAnimationFrame||clearTimeout;function Ai(i,t=0){t<=0?Ln(i):Ln(()=>Ai(i,t-1))}function yi(i,t=60){let e=-1,n=0,o=-1;const s=1e3/t;function r(a){o===-1&&(o=a),e=Ln(r),!(a-n<s)&&(n=a,i&&i(a-o))}return e=Ln(r),function(){Vc(e)}}const Zc=ei.Easing;function Jc(i,t,e,n=Zc.Linear.None){const o=new ei.Tween(i).to(t,e).easing(n);Ai(()=>o.start(0));const s=yi(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 Uc(i,t){return Jc({progress:0},{progress:1},i,t)}var es=(i=>(i.Move="Move",i.Rotate="Rotate",i))(es||{}),tt=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(tt||{});const kn=Math.PI*2;function ts(i){return(i%kn+kn)%kn}function ns(i){return i%kn}function Pi(i,t,e){return i+(t-i)*e}const wi=(i,t,e)=>{const n=Math.PI,o=n*2;return i=ts(i),t=ts(t),e===tt.Anticlockwise&&i<t&&(i+=o),e===tt.Clockwise&&t<i&&(t+=o),e===tt.Loop&&t-i>n?wi(i,t,tt.Anticlockwise):e===tt.Loop&&i-t>n?wi(i,t,tt.Clockwise):{from:i,to:t}},qc=i=>{const t={},e=async(s,r,a={preload:!0})=>(t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&await a.asyncStartCallback(),s.mode&&s.mode!==i.currentMode&&await i.changeMode(s.mode),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&await i.preloadPano(s.panoIndex),a.asyncEndCallback&&await a.asyncEndCallback(),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:await new Promise((l,c)=>{const h=s.panoIndex!==void 0?s.panoIndex:i.panoIndex;h!==void 0?i.moveToPano(h,Object.assign({duration:r,moveEndCallback:()=>l(!0),moveCancelCallback:()=>c(!1)},s)):c(!1)})),n=s=>{const r=i.state,a=ns(r.latitude),l=ns(s.latitude),{from:c,to:h}=wi(r.longitude,s.longitude,s.rotation||tt.Loop),f=r.fov,u=s.fov;return{from:{latitude:a,longitude:c,fov:f},to:{latitude:l,longitude:h,fov:u}}};return{move:e,rotate:async(s,r,a={})=>{t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&await a.asyncStartCallback(),i.currentMode!==me.Five.Mode.Panorama&&await i.changeMode(me.Five.Mode.Panorama),s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(a.preload&&await i.preloadPano(s.panoIndex),await new Promise((h,f)=>{if(!s.panoIndex){h(!0);return}i.moveToPano(s.panoIndex,{moveEndCallback:()=>h(!0),moveCancelCallback:()=>f(!1)})})),a.asyncEndCallback&&await a.asyncEndCallback();const{from:l,to:c}=n(s);return await new Promise(h=>{const f=({progress:b})=>{const y={};y.longitude=Pi(l.longitude,c.longitude,b),y.latitude=Pi(l.latitude,c.latitude,b),y.fov=Pi(l.fov,c.fov,b),i.setState(y,!0)},u=()=>{h(!0)},m=()=>{h(!1)},g=s.rotateSpeed?Math.ceil(Math.abs(c.longitude-l.longitude)/s.rotateSpeed*1e3):r,v=Uc(g,ei.Easing.Linear.None).onUpdate(f).onComplete(u).onDestroy(m);s.rotation===tt.Loop&&v.repeat(1/0).yoyo(!0),t.interruptCallback=(b=!0)=>{v.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),h(b)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})}}};function is(i,t){return i.x===t.x&&i.y===t.y}function os(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function Dn(i,t){return(t.y-i.y)/(t.x-i.x)}function ss(i,t,e){const n=Dn(i[1],i[0]),o=Dn(t[1],t[0]);if(isNaN(n)||isNaN(o)||os(n,o))return!1;if(Tn(i[0],t))return i[0];if(Tn(i[1],t))return i[1];if(Tn(t[0],i))return t[0];if(Tn(t[1],i))return t[1];if(e&&!Kc(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 Tn(i,t){return is(i,t[0])||is(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&&os(Dn(t[0],i),Dn(i,t[1]))}function zn(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function Kc(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)&&zn(t[0],i[1],i[0])*zn(i[1],t[1],i[0])>0&&zn(i[0],t[1],t[0])*zn(t[1],i[1],t[0])>0?1:0}function rs(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>rs(i,t-1))}const _c=`<style type="text/css">
|
|
113
|
+
`;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class Ka extends fe{constructor(t){super(),de(this,t,qa,Ua,ue,{content:0},Ja)}}function _a(i){be(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function $a(i){let t,e;return t=new Za({props:{url:i[1].url}}),{c(){Pe(t.$$.fragment)},m(n,o){Ae(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.url=n[1].url),t.$set(s)},i(n){e||(X(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){ye(t,n)}}}function el(i){let t,e;return t=new Ka({props:{content:i[0]}}),{c(){Pe(t.$$.fragment)},m(n,o){Ae(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.content=n[0]),t.$set(s)},i(n){e||(X(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){ye(t,n)}}}function tl(i){let t,e,n,o;const s=[el,$a],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=Q("div"),n&&n.c(),C(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){V(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let h=e;e=a(l),e===h?~e&&r[e].p(l,c):(n&&(Ce(),K(r[h],1,1,()=>{r[h]=null}),Ee()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),X(n,1),n.m(t,null)):n=null)},i(l){o||(X(n),o=!0)},o(l){K(n),o=!1},d(l){l&&H(t),~e&&r[e].d()}}}function nl(i,t,e){let n,o;var s,r;let{floorIndex:a}=t,{floorplanData:l}=t;return i.$$set=c=>{"floorIndex"in c&&e(2,a=c.floorIndex),"floorplanData"in c&&e(3,l=c.floorplanData)},i.$$.update=()=>{i.$$.dirty&12&&e(1,n=l.outlines[a]),i.$$.dirty&60&&e(0,o=e(5,r=e(4,s=l.outlines)===null||s===void 0?void 0:s[a])===null||r===void 0?void 0:r.svgContent)},[o,n,a,l,s,r]}class bo extends fe{constructor(t){super(),de(this,t,nl,tl,ue,{floorIndex:2,floorplanData:3},_a)}}function il(i){be(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 ol(i){let t,e=i[4].outerHTML+"",n;return{c(){t=new ai(!1),n=Re(),t.a=n},m(o,s){t.m(e,o,s),V(o,n,s)},p(o,s){s&16&&e!==(e=o[4].outerHTML+"")&&t.p(e)},d(o){o&&H(n),o&&t.d()}}}function sl(i){let t,e=i[0].name+"",n,o,s,r;return{c(){t=Q("span"),n=Ue(e),o=pe(),s=Q("span"),r=Ue(i[5]),C(t,"class","floorplan-plugin__room-name"),C(s,"class","floorplan-plugin__room-size svelte-12pzct5")},m(a,l){V(a,t,l),W(t,n),V(a,o,l),V(a,s,l),W(s,r)},p(a,l){l&1&&e!==(e=a[0].name+"")&&ct(n,e),l&32&&ct(r,a[5])},d(a){a&&H(t),a&&H(o),a&&H(s)}}}function rl(i){let t;function e(s,r){if(s[1]===void 0)return sl;if(s[4])return ol}let n=e(i),o=n&&n(i);return{c(){t=Q("div"),o&&o.c(),C(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),S(t,"left",i[6]),S(t,"top",i[7]),S(t,"font-size",i[8]),S(t,"opacity",i[3]?"1":"0")},m(s,r){V(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&&S(t,"opacity",s[3]?"1":"0")},i:ne,o:ne,d(s){s&&H(t),o&&o.d(),i[16](null)}}}function al(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],h=t[r][1];l>n!=h>n&&e<(c-a)*(n-l)/(h-l)+a&&(o=!o)}return o}function ll(i,t,e){let n,o,s,r,{pxmm:a}=t,{room:l}=t,{hoveredRoom:c}=t,{getRoomAreaText:h}=t,{getLabelElement:f}=t,{adaptiveRoomLabelVisibleEnable:u}=t;function m(E,z){if(z.width===0||z.height===0)return()=>!1;const F=E.path.map(({x:ie,y:Y})=>[ie,Y]),R=E.roomLabel.position,{x:ee,y:j}=R,{width:N,height:G}=z,_=N/2,U=G/2;return function(Y){const te=ee*Y,re=j*Y,oe=F.map(([we,Le])=>[we*Y,Le*Y]);return[[te+_,re-U],[te-_,re-U],[te-_,re+U],[te+_,re+U]].every(we=>al(we,oe))}}const g=document.body.clientWidth,v=document.body.clientHeight,b=l.roomLabel,y=b.positionInImage.x*100+"%",x=b.positionInImage.y*100+"%",P=(g<500||v<500?10:14)/16+"rem";let L=!1,T,I;c.subscribe(function(z){e(13,L=!!z&&z.id===l.id)}),It(()=>{const E=T==null?void 0:T.getClientRects()[0];e(14,I={width:E.width,height:E.height})});function D(E){jt[E?"unshift":"push"](()=>{T=E,e(2,T)})}return i.$$set=E=>{"pxmm"in E&&e(9,a=E.pxmm),"room"in E&&e(0,l=E.room),"hoveredRoom"in E&&e(10,c=E.hoveredRoom),"getRoomAreaText"in E&&e(11,h=E.getRoomAreaText),"getLabelElement"in E&&e(1,f=E.getLabelElement),"adaptiveRoomLabelVisibleEnable"in E&&e(12,u=E.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&2049&&e(5,n=l.size?h(l.size):""),i.$$.dirty&16385&&e(15,o=I?m(l,I):void 0),i.$$.dirty&3&&e(4,s=f==null?void 0:f(l)),i.$$.dirty&45568&&e(3,r=u?L?!0:!!(o!=null&&o(a)):!0)},[l,f,T,r,s,n,y,x,P,a,c,h,u,L,I,o,D]}class cl extends fe{constructor(t){super(),de(this,t,ll,rl,ue,{pxmm:9,room:0,hoveredRoom:10,getRoomAreaText:11,getLabelElement:1,adaptiveRoomLabelVisibleEnable:12},il)}}function hl(i){be(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 Ao(i,t,e){const n=i.slice();return n[10]=t[e],n}function yo(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=Ao(i,r,l),h=a(c);n.set(h,e[l]=Po(h,c))}return{c(){t=Q("div");for(let l=0;l<e.length;l+=1)e[l].c();C(t,"class","floorplan-plugin__room-labels svelte-13xux0b"),Ke(()=>i[9].call(t))},m(l,c){V(l,t,c);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=St(t,i[9].bind(t)),s=!0},p(l,c){c&111&&(r=l[6],Ce(),e=gt(e,c,a,1,l,r,n,t,Ot,Po,null,Ao),Ee())},i(l){if(!s){for(let c=0;c<r.length;c+=1)X(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)K(e[c]);s=!1},d(l){l&&H(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}function Po(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=Ge(r,s[a]);return n=new cl({props:r}),{key:i,first:null,c(){e=Re(),Pe(n.$$.fragment),this.first=e},m(a,l){V(a,e,l),Ae(n,a,l),o=!0},p(a,l){t=a;const c=l&111?Xe(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||(X(n.$$.fragment,a),o=!0)},o(a){K(n.$$.fragment,a),o=!1},d(a){a&&H(e),ye(n,a)}}}function ul(i){let t,e,n=i[6]&&yo(i);return{c(){n&&n.c(),t=Re()},m(o,s){n&&n.m(o,s),V(o,t,s),e=!0},p(o,[s]){o[6]?n?(n.p(o,s),s&64&&X(n,1)):(n=yo(o),n.c(),X(n,1),n.m(t.parentNode,t)):n&&(Ce(),K(n,1,1,()=>{n=null}),Ee())},i(o){e||(X(n),e=!0)},o(o){K(n),e=!1},d(o){n&&n.d(o),o&&H(t)}}}function dl(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t,{hoveredRoom:r}=t,{getRoomAreaText:a}=t,{getLabelElement:l}=t,{adaptiveRoomLabelVisibleEnable:c}=t,h=0,f=0;function u(){h=this.clientWidth,e(4,h)}return i.$$set=m=>{"floorIndex"in m&&e(7,o=m.floorIndex),"floorplanData"in m&&e(8,s=m.floorplanData),"hoveredRoom"in m&&e(0,r=m.hoveredRoom),"getRoomAreaText"in m&&e(1,a=m.getRoomAreaText),"getLabelElement"in m&&e(2,l=m.getLabelElement),"adaptiveRoomLabelVisibleEnable"in m&&e(3,c=m.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&384&&e(6,n=s.floorDatas[o].rooms),i.$$.dirty&272){const{max:m,min:g}=s.bounding,v=m.x-g.x;e(5,f=h/v)}},[r,a,l,c,h,f,n,o,s,u]}class fl extends fe{constructor(t){super(),de(this,t,dl,ul,ue,{floorIndex:7,floorplanData:8,hoveredRoom:0,getRoomAreaText:1,getLabelElement:2,adaptiveRoomLabelVisibleEnable:3},hl)}}function ml(i){be(i,"svelte-djlmk4",".floorplan-plugin__rule-labels.svelte-djlmk4.svelte-djlmk4{position:absolute;display:flex}.floorplan-plugin__rule-labels--top.svelte-djlmk4.svelte-djlmk4{left:0;top:-1.25rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4.svelte-djlmk4{left:0;bottom:-1.25rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4.svelte-djlmk4{top:0;left:-1.25rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4.svelte-djlmk4{top:0;right:-1.25rem}.floorplan-plugin__rule-line.svelte-djlmk4.svelte-djlmk4{background:#fff;opacity:0.05;width:100%;height:100%}.floorplan-plugin__rule-scale-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute;width:0.3125rem;height:100%;left:50%;top:0;transform:translateX(-50%)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale-wrapper.svelte-djlmk4{width:100%;height:0.3125rem;top:50%;left:0;transform:translateY(-50%)}.floorplan-plugin__rule-scale.svelte-djlmk4.svelte-djlmk4{position:absolute;background:#fff;opacity:0.05;width:100%;height:0.0625rem}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-scale.svelte-djlmk4{width:0.0625rem;height:100%}.floorplan-plugin__rule-text-wrapper.svelte-djlmk4.svelte-djlmk4{position:absolute}.floorplan-plugin__rule-labels--top.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;top:0.625rem}.floorplan-plugin__rule-labels--bottom.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:100%;height:0;bottom:0.625rem}.floorplan-plugin__rule-labels--left.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;left:0.625rem}.floorplan-plugin__rule-labels--right.svelte-djlmk4 .floorplan-plugin__rule-text-wrapper.svelte-djlmk4{width:0;height:100%;right:0.625rem}.floorplan-plugin__rule-text-item.svelte-djlmk4.svelte-djlmk4{width:0;height:0;position:absolute;transform:rotate(90deg)}.floorplan-plugin__rule-labels.is-row.svelte-djlmk4 .floorplan-plugin__rule-text-item.svelte-djlmk4{transform:rotate(0)}.floorplan-plugin__rule-text.svelte-djlmk4.svelte-djlmk4{width:-moz-max-content;width:max-content;transform:translate(-50%, -50%);font-size:0.625rem;color:#fff;opacity:0.2}")}function wo(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function Io(i,t,e){const n=i.slice();return n[14]=t[e],n}function xo(i){let t;return{c(){t=Q("div"),C(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),S(t,"left",i[14].left*100+"%"),S(t,"bottom",i[14].bottom*100+"%")},m(e,n){V(e,t,n)},p:ne,d(e){e&&H(t)}}}function Co(i,t){let e,n,o=t[1](t[11].distance)+"",s,r;return{key:i,first:null,c(){e=Q("div"),n=Q("div"),s=Ue(o),r=pe(),C(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),je(n,"is-row",t[2]),C(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),S(e,"left",t[11].left*100+"%"),S(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){V(a,e,l),W(e,n),W(n,s),W(e,r)},p(a,l){t=a,l&2&&o!==(o=t[1](t[11].distance)+"")&&ct(s,o)},d(a){a&&H(e)}}}function pl(i){let t,e,n,o,s,r,a=[],l=new Map,c,h=i[3],f=[];for(let g=0;g<h.length;g+=1)f[g]=xo(Io(i,h,g));let u=i[4];const m=g=>g[13];for(let g=0;g<u.length;g+=1){let v=wo(i,u,g),b=m(v);l.set(b,a[g]=Co(b,v))}return{c(){t=Q("div"),e=Q("div"),n=pe(),o=Q("div");for(let g=0;g<f.length;g+=1)f[g].c();s=pe(),r=Q("div");for(let g=0;g<a.length;g+=1)a[g].c();C(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),C(o,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),je(o,"is-row",i[2]),C(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),C(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+i[0]+" svelte-djlmk4"),je(t,"is-row",i[2]),S(t,"width",i[2]?"100%":1/16+"rem"),S(t,"height",i[2]?1/16+"rem":"100%")},m(g,v){V(g,t,v),W(t,e),W(t,n),W(t,o);for(let b=0;b<f.length;b+=1)f[b].m(o,null);W(t,s),W(t,r);for(let b=0;b<a.length;b+=1)a[b].m(r,null)},p(g,[v]){if(v&8){h=g[3];let b;for(b=0;b<h.length;b+=1){const y=Io(g,h,b);f[b]?f[b].p(y,v):(f[b]=xo(y),f[b].c(),f[b].m(o,null))}for(;b<f.length;b+=1)f[b].d(1);f.length=h.length}v&22&&(u=g[4],a=gt(a,v,m,1,g,u,l,r,mo,Co,null,wo)),v&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+g[0]+" svelte-djlmk4")&&C(t,"class",c),v&5&&je(t,"is-row",g[2])},i:ne,o:ne,d(g){g&&H(t),Mt(f,g);for(let v=0;v<a.length;v+=1)a[v].d()}}}const Bt=1e3,Ft=180;function gl(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-(Bt-Ft)*2,c=s.max.y-s.min.y-(Bt-Ft)*2,h=o.map(([g,v])=>a?[g.x,v.x]:[g.y,v.y]).flat().sort().filter((g,v,b)=>v===0?!0:g!==b[v-1]),f=h.map(g=>{const v=a?(g-s.min.x-Bt+Ft)/l:0,b=a?0:(g-s.min.y-Bt+Ft)/c;return{left:v,bottom:b}});f.unshift({left:0,bottom:0}),f.push(a?{left:1,bottom:0}:{left:0,bottom:1});const u=h[h.length-1]-h[0],m=h.map((g,v,b)=>{const y=v===0?0:g-b[v-1],x=v===0?0:(g+b[v-1])/2,P=a?(x-s.min.x-Bt+Ft)/l:0,L=a?0:(x-s.min.y-Bt+Ft)/c;return{left:P,bottom:L,distance:y}}).filter(({distance:g})=>g/u>.1);return i.$$set=g=>{"type"in g&&e(0,n=g.type),"data"in g&&e(5,o=g.data),"bounding"in g&&e(6,s=g.bounding),"getRuleDistanceText"in g&&e(1,r=g.getRuleDistanceText)},[n,r,a,f,m,o,s]}class vl extends fe{constructor(t){super(),de(this,t,gl,pl,ue,{type:0,data:5,bounding:6,getRuleDistanceText:1},ml)}}function bl(i){be(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function Eo(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function Lo(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=Ge(r,s[a]);return n=new vl({props:r}),{key:i,first:null,c(){e=Re(),Pe(n.$$.fragment),this.first=e},m(a,l){V(a,e,l),Ae(n,a,l),o=!0},p(a,l){t=a;const c=l&19?Xe(s,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){o||(X(n.$$.fragment,a),o=!0)},o(a){K(n.$$.fragment,a),o=!1},d(a){a&&H(e),ye(n,a)}}}function Al(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=Eo(i,s,a),c=r(l);n.set(c,e[a]=Lo(c,l))}return{c(){t=Q("div");for(let a=0;a<e.length;a+=1)e[a].c();C(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),S(t,"width",i[3]),S(t,"height",i[2])},m(a,l){V(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],Ce(),e=gt(e,l,r,1,a,s,n,t,Ot,Lo,null,Eo),Ee()),l&8&&S(t,"width",a[3]),l&4&&S(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)X(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)K(e[l]);o=!1},d(a){a&&H(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const ko=1e3,Do=180;function yl(i,t,e){let n,o,s,r,a,l,c,h,f,u,{floorIndex:m}=t,{floorplanData:g}=t,{getRuleDistanceText:v}=t;return i.$$set=b=>{"floorIndex"in b&&e(5,m=b.floorIndex),"floorplanData"in b&&e(6,g=b.floorplanData),"getRuleDistanceText"in b&&e(0,v=b.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=g.bounding),i.$$.dirty&96&&e(11,o=g.floorDatas[m].rules),i.$$.dirty&2048&&e(12,s=Object.keys(o)),i.$$.dirty&6144&&e(4,r=s.map(b=>[b,o[b]])),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-(ko-Do)*2),i.$$.dirty&2&&e(8,h=n.max.y-n.min.y-(ko-Do)*2),i.$$.dirty&1536&&e(3,f=c/a*100+"%"),i.$$.dirty&384&&e(2,u=h/l*100+"%")},[v,n,u,f,r,m,g,l,h,a,c,o,s]}class Pl extends fe{constructor(t){super(),de(this,t,yl,Al,ue,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},bl)}}function Cn(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,h=l+","+c;return a===0?(e+="M"+h,e):o!=null&&o[a]?(e+="A"+o[a]+","+h,e):(e+="L"+h,e)}),e+(n?"Z":"")}function To({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function wl(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 Il(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 xl(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function Cl(i){let t;return{c(){t=Te("path"),C(t,"d",i[0]),C(t,"fill","#2F313A")},m(e,n){V(e,t,n)},p(e,[n]){n&1&&C(t,"d",e[0])},i:ne,o:ne,d(e){e&&H(t)}}}function El(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=Cn(o,{needZ:!0}))},[n,o]}class Ll extends fe{constructor(t){super(),de(this,t,El,Cl,ue,{path:1})}}function kl(i){let t,e,n,o,s,r;return{c(){t=Te("defs"),e=Te("pattern"),n=Te("rect"),o=Te("path"),s=pe(),r=Te("path"),C(n,"x","0"),C(n,"y","0"),C(n,"width",i[1]),C(n,"height",i[1]),C(n,"fill","#323747"),C(o,"d",i[2]),C(o,"stroke","#ffffff"),C(o,"stroke-opacity","0.06"),C(o,"stroke-width","0.5"),C(o,"fill","none"),C(e,"id","fpm-room-pattern-0"),C(e,"x","0"),C(e,"y","0"),C(e,"width",i[1]),C(e,"height",i[1]),C(e,"patternUnits","userSpaceOnUse"),C(e,"patternTransform","scale(50 50)"),C(r,"d",i[0]),C(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){V(a,t,l),W(t,e),W(e,n),W(e,o),V(a,s,l),V(a,r,l)},p(a,[l]){l&1&&C(r,"d",a[0])},i:ne,o:ne,d(a){a&&H(t),a&&H(s),a&&H(r)}}}const ui=6;function Dl(i,t,e){let n,{path:o}=t;const s=ui*2,r=`M0 ${ui} h ${s} M${ui} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=Cn(o,{needZ:!0}))},[n,s,r,o]}class Tl extends fe{constructor(t){super(),de(this,t,Dl,kl,ue,{path:3})}}function zl(i){let t,e,n,o,s,r,a,l,c,h,f;return{c(){t=Te("defs"),e=Te("pattern"),n=Te("rect"),o=Te("pattern"),s=Te("rect"),r=pe(),a=Te("path"),l=pe(),c=Te("path"),h=pe(),f=Te("path"),C(n,"x","0"),C(n,"y","0"),C(n,"width","6"),C(n,"height","50"),C(n,"fill","none"),C(n,"stroke","#4B4B57"),C(n,"stroke-width","0.5"),C(e,"id","room-material-pattern-1"),C(e,"x","0"),C(e,"y","0"),C(e,"width","12"),C(e,"height","50"),C(e,"patternUnits","userSpaceOnUse"),C(e,"patternTransform","scale(50 50)"),C(s,"x","0"),C(s,"y","0"),C(s,"width","6"),C(s,"height","50"),C(s,"fill","none"),C(s,"stroke","#4B4B57"),C(s,"stroke-width","0.5"),C(o,"id","room-material-pattern-2"),C(o,"x","6"),C(o,"y","25"),C(o,"width","12"),C(o,"height","50"),C(o,"patternUnits","userSpaceOnUse"),C(o,"patternTransform","scale(50 50)"),C(a,"d",i[0]),C(a,"fill","#43434D"),C(c,"d",i[0]),C(c,"fill","url(#room-material-pattern-1)"),C(f,"d",i[0]),C(f,"fill","url(#room-material-pattern-2)")},m(u,m){V(u,t,m),W(t,e),W(e,n),W(t,o),W(o,s),V(u,r,m),V(u,a,m),V(u,l,m),V(u,c,m),V(u,h,m),V(u,f,m)},p(u,[m]){m&1&&C(a,"d",u[0]),m&1&&C(c,"d",u[0]),m&1&&C(f,"d",u[0])},i:ne,o:ne,d(u){u&&H(t),u&&H(r),u&&H(a),u&&H(l),u&&H(c),u&&H(h),u&&H(f)}}}function Ml(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=Cn(o,{needZ:!0}))},[n,o]}class Sl extends fe{constructor(t){super(),de(this,t,Ml,zl,ue,{path:1})}}function jl(i){be(i,"svelte-1dykexu",".floorplan-plugin__room-material.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%}svg.svelte-1dykexu{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible}")}function zo(i,t,e){const n=i.slice();return n[5]=t[e],n}function Ol(i){let t,e;return t=new Tl({props:{path:i[5].path}}),{c(){Pe(t.$$.fragment)},m(n,o){Ae(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(X(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){ye(t,n)}}}function Nl(i){let t,e;return t=new Sl({props:{path:i[5].path}}),{c(){Pe(t.$$.fragment)},m(n,o){Ae(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(X(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){ye(t,n)}}}function Bl(i){let t,e;return t=new Ll({props:{path:i[5].path}}),{c(){Pe(t.$$.fragment)},m(n,o){Ae(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(X(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){ye(t,n)}}}function Mo(i){let t,e,n,o;const s=[Bl,Nl,Ol],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=Te("svg"),n.c(),C(t,"width","100%"),C(t,"height","100%"),C(t,"viewBox",`0 0 ${i[1]} ${i[2]}`),C(t,"class","svelte-1dykexu")},m(l,c){V(l,t,c),r[e].m(t,null),o=!0},p(l,c){let h=e;e=a(l),e===h?r[e].p(l,c):(Ce(),K(r[h],1,1,()=>{r[h]=null}),Ee(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),X(n,1),n.m(t,null))},i(l){o||(X(n),o=!0)},o(l){K(n),o=!1},d(l){l&&H(t),r[e].d()}}}function Fl(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=Mo(zo(i,n,r));const s=r=>K(o[r],1,1,()=>{o[r]=null});return{c(){t=Q("div");for(let r=0;r<o.length;r+=1)o[r].c();C(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){V(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=zo(r,n,l);o[l]?(o[l].p(c,a),X(o[l],1)):(o[l]=Mo(c),o[l].c(),X(o[l],1),o[l].m(t,null))}for(Ce(),l=n.length;l<o.length;l+=1)s(l);Ee()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)X(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)K(o[a]);e=!1},d(r){r&&H(t),Mt(o,r)}}}function Gl(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=>Object.assign(Object.assign({},l),{path:l.path.map(c=>To(c,s.bounding))})))},[n,r,a,o,s]}class Rl extends fe{constructor(t){super(),de(this,t,Gl,Fl,ue,{floorIndex:3,floorplanData:4},jl)}}function Xl(i){be(i,"svelte-19uvvss","path.svelte-19uvvss{opacity:0}path.svelte-19uvvss:hover{opacity:0.1}")}function Ql(i){let t,e,n;return{c(){t=Te("path"),C(t,"d",i[2]),C(t,"fill","#fff"),C(t,"class","svelte-19uvvss")},m(o,s){V(o,t,s),e||(n=[qe(t,"mouseenter",i[0]),qe(t,"mouseleave",i[1])],e=!0)},p:ne,i:ne,o:ne,d(o){o&&H(t),e=!1,Tt(n)}}}function Wl(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=Cn(n.path,{needZ:!0,format:h=>To(h,l)});return i.$$set=h=>{"room"in h&&e(3,n=h.room),"floorplanData"in h&&e(4,o=h.floorplanData),"hoveredRoom"in h&&e(5,s=h.hoveredRoom)},[r,a,c,n,o,s]}class Hl extends fe{constructor(t){super(),de(this,t,Wl,Ql,ue,{room:3,floorplanData:4,hoveredRoom:5},Xl)}}function Yl(i){be(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 So(i,t,e){const n=i.slice();return n[5]=t[e],n}function jo(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=Ge(r,s[a]);return n=new Hl({props:r}),{key:i,first:null,c(){e=Re(),Pe(n.$$.fragment),this.first=e},m(a,l){V(a,e,l),Ae(n,a,l),o=!0},p(a,l){t=a;const c=l&7?Xe(s,[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}]):{};n.$set(c)},i(a){o||(X(n.$$.fragment,a),o=!0)},o(a){K(n.$$.fragment,a),o=!1},d(a){a&&H(e),ye(n,a)}}}function Vl(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=So(i,r,l),h=a(c);o.set(h,n[l]=jo(h,c))}return{c(){t=Q("div"),e=Te("svg");for(let l=0;l<n.length;l+=1)n[l].c();C(e,"width","100%"),C(e,"height","100%"),C(e,"viewBox",`0 0 ${i[3]} ${i[4]}`),C(e,"class","svelte-1kqo6e4"),C(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){V(l,t,c),W(t,e);for(let h=0;h<n.length;h+=1)n[h].m(e,null);s=!0},p(l,[c]){c&7&&(r=l[1].floorDatas[l[0]].rooms,Ce(),n=gt(n,c,a,1,l,r,o,e,Ot,jo,null,So),Ee())},i(l){if(!s){for(let c=0;c<r.length;c+=1)X(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)K(n[c]);s=!1},d(l){l&&H(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function Zl(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 Oo extends fe{constructor(t){super(),de(this,t,Zl,Vl,ue,{floorIndex:0,floorplanData:1,hoveredRoom:2},Yl)}}function Jl(i){be(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 No(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=Ge(o,n[s]);return t=new Oo({props:o}),{c(){Pe(t.$$.fragment)},m(s,r){Ae(t,s,r),e=!0},p(s,r){const a=r&1058?Xe(n,[{floorIndex:s[1],floorplanData:s[5],hoveredRoom:s[10]}]):{};t.$set(a)},i(s){e||(X(t.$$.fragment,s),e=!0)},o(s){K(t.$$.fragment,s),e=!1},d(s){ye(t,s)}}}function Bo(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=Ge(o,n[s]);return t=new fl({props:o}),{c(){Pe(t.$$.fragment)},m(s,r){Ae(t,s,r),e=!0},p(s,r){const a=r&1762?Xe(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||(X(t.$$.fragment,s),e=!0)},o(s){K(t.$$.fragment,s),e=!1},d(s){ye(t,s)}}}function Fo(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=Ge(o,n[s]);return t=new Pl({props:o}),{c(){Pe(t.$$.fragment)},m(s,r){Ae(t,s,r),e=!0},p(s,r){const a=r&290?Xe(n,[{floorplanData:s[5],floorIndex:s[1],getRuleDistanceText:s[8]}]):{};t.$set(a)},i(s){e||(X(t.$$.fragment,s),e=!0)},o(s){K(t.$$.fragment,s),e=!1},d(s){ye(t,s)}}}function Ul(i){let t,e,n,o,s,r,a,l,c;const h=[{floorIndex:i[1],floorplanData:i[5]}];let f={};for(let y=0;y<h.length;y+=1)f=Ge(f,h[y]);e=new Rl({props:f});let u=i[2]&&No(i);const m=[{floorplanData:i[5],floorIndex:i[1]}];let g={};for(let y=0;y<m.length;y+=1)g=Ge(g,m[y]);s=new bo({props:g});let v=i[3]&&Bo(i),b=i[4]&&Fo(i);return{c(){t=Q("div"),Pe(e.$$.fragment),n=pe(),u&&u.c(),o=pe(),Pe(s.$$.fragment),r=pe(),v&&v.c(),a=pe(),b&&b.c(),C(t,"class",l=Se(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(y,x){V(y,t,x),Ae(e,t,null),W(t,n),u&&u.m(t,null),W(t,o),Ae(s,t,null),W(t,r),v&&v.m(t,null),W(t,a),b&&b.m(t,null),c=!0},p(y,[x]){const P=x&34?Xe(h,[{floorIndex:y[1],floorplanData:y[5]}]):{};e.$set(P),y[2]?u?(u.p(y,x),x&4&&X(u,1)):(u=No(y),u.c(),X(u,1),u.m(t,o)):u&&(Ce(),K(u,1,1,()=>{u=null}),Ee());const L=x&34?Xe(m,[{floorplanData:y[5],floorIndex:y[1]}]):{};s.$set(L),y[3]?v?(v.p(y,x),x&8&&X(v,1)):(v=Bo(y),v.c(),X(v,1),v.m(t,a)):v&&(Ce(),K(v,1,1,()=>{v=null}),Ee()),y[4]?b?(b.p(y,x),x&16&&X(b,1)):(b=Fo(y),b.c(),X(b,1),b.m(t,null)):b&&(Ce(),K(b,1,1,()=>{b=null}),Ee()),(!c||x&1&&l!==(l=Se(`floorplan-plugin__floor${y[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&C(t,"class",l)},i(y){c||(X(e.$$.fragment,y),X(u),X(s.$$.fragment,y),X(v),X(b),c=!0)},o(y){K(e.$$.fragment,y),K(u),K(s.$$.fragment,y),K(v),K(b),c=!1},d(y){y&&H(t),ye(e),u&&u.d(),ye(s),v&&v.d(),b&&b.d()}}}function ql(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:h}=t,{getRuleDistanceText:f}=t,{adaptiveRoomLabelVisibleEnable:u}=t;const m=vo(void 0);return i.$$set=g=>{"isCurrent"in g&&e(0,n=g.isCurrent),"floorIndex"in g&&e(1,o=g.floorIndex),"hoverEnable"in g&&e(2,s=g.hoverEnable),"roomLabelsEnable"in g&&e(3,r=g.roomLabelsEnable),"ruleLabelsEnable"in g&&e(4,a=g.ruleLabelsEnable),"floorplanData"in g&&e(5,l=g.floorplanData),"getRoomAreaText"in g&&e(6,c=g.getRoomAreaText),"getLabelElement"in g&&e(7,h=g.getLabelElement),"getRuleDistanceText"in g&&e(8,f=g.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in g&&e(9,u=g.adaptiveRoomLabelVisibleEnable)},[n,o,s,r,a,l,c,h,f,u,m]}class Kl extends fe{constructor(t){super(),de(this,t,ql,Ul,ue,{isCurrent:0,floorIndex:1,hoverEnable:2,roomLabelsEnable:3,ruleLabelsEnable:4,floorplanData:5,getRoomAreaText:6,getLabelElement:7,getRuleDistanceText:8,adaptiveRoomLabelVisibleEnable:9},Jl)}}function _l(i){be(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function Go(i,t,e){const n=i.slice();return n[16]=t[e],n}function Ro(i){let t,e,n,o,s,r,a=i[9].floorDatas,l=[];for(let m=0;m<a.length;m+=1)l[m]=Xo(Go(i,a,m));const c=m=>K(l[m],1,1,()=>{l[m]=null}),h=[{panoIndex:i[3],floorplanData:i[9],lastPanoramaLongitude:i[10],cameraImageUrl:i[11]}];let f={};for(let m=0;m<h.length;m+=1)f=Ge(f,h[m]);n=new Na({props:f});let u=i[6]&&Qo(i);return{c(){t=Q("div");for(let m=0;m<l.length;m+=1)l[m].c();e=pe(),Pe(n.$$.fragment),o=pe(),u&&u.c(),C(t,"class","floorplan-main svelte-86bqav")},m(m,g){V(m,t,g);for(let v=0;v<l.length;v+=1)l[v].m(t,null);W(t,e),Ae(n,t,null),W(t,o),u&&u.m(t,null),r=!0},p(m,g){if(i=m,g&62384){a=i[9].floorDatas;let b;for(b=0;b<a.length;b+=1){const y=Go(i,a,b);l[b]?(l[b].p(y,g),X(l[b],1)):(l[b]=Xo(y),l[b].c(),X(l[b],1),l[b].m(t,e))}for(Ce(),b=a.length;b<l.length;b+=1)c(b);Ee()}const v=g&3592?Xe(h,[{panoIndex:i[3],floorplanData:i[9],lastPanoramaLongitude:i[10],cameraImageUrl:i[11]}]):{};n.$set(v),i[6]?u?(u.p(i,g),g&64&&X(u,1)):(u=Qo(i),u.c(),X(u,1),u.m(t,null)):u&&(Ce(),K(u,1,1,()=>{u=null}),Ee())},i(m){if(!r){for(let g=0;g<a.length;g+=1)X(l[g]);X(n.$$.fragment,m),X(u),s||Ke(()=>{s=ca(t,za,{duration:i[0],easing:ii}),s.start()}),r=!0}},o(m){l=l.filter(Boolean);for(let g=0;g<l.length;g+=1)K(l[g]);K(n.$$.fragment,m),K(u),r=!1},d(m){m&&H(t),Mt(l,m),ye(n),u&&u.d()}}}function Xo(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=Ge(o,n[s]);return t=new Kl({props:o}),{c(){Pe(t.$$.fragment)},m(s,r){Ae(t,s,r),e=!0},p(s,r){const a=r&62384?Xe(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||(X(t.$$.fragment,s),e=!0)},o(s){K(t.$$.fragment,s),e=!1},d(s){ye(t,s)}}}function Qo(i){let t,e;return t=new Wa({props:{floorplanData:i[9],northDesc:i[2]}}),{c(){Pe(t.$$.fragment)},m(n,o){Ae(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||(X(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){ye(t,n)}}}function $l(i){let t,e,n=i[1]&&Ro(i);return{c(){n&&n.c(),t=Re()},m(o,s){n&&n.m(o,s),V(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&X(n,1)):(n=Ro(o),n.c(),X(n,1),n.m(t.parentNode,t)):n&&(Ce(),K(n,1,1,()=>{n=null}),Ee())},i(o){e||(X(n),e=!0)},o(o){K(n),e=!1},d(o){n&&n.d(o),o&&H(t)}}}function ec(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:h}=t,{ruleLabelsEnable:f}=t,{floorplanData:u}=t,{lastPanoramaLongitude:m}=t,{cameraImageUrl:g}=t,{getRoomAreaText:v}=t,{getLabelElement:b}=t,{getRuleDistanceText:y}=t,{adaptiveRoomLabelVisibleEnable:x}=t;return i.$$set=P=>{"duration"in P&&e(0,n=P.duration),"visible"in P&&e(1,o=P.visible),"northDesc"in P&&e(2,s=P.northDesc),"panoIndex"in P&&e(3,r=P.panoIndex),"floorIndex"in P&&e(4,a=P.floorIndex),"hoverEnable"in P&&e(5,l=P.hoverEnable),"compassEnable"in P&&e(6,c=P.compassEnable),"roomLabelsEnable"in P&&e(7,h=P.roomLabelsEnable),"ruleLabelsEnable"in P&&e(8,f=P.ruleLabelsEnable),"floorplanData"in P&&e(9,u=P.floorplanData),"lastPanoramaLongitude"in P&&e(10,m=P.lastPanoramaLongitude),"cameraImageUrl"in P&&e(11,g=P.cameraImageUrl),"getRoomAreaText"in P&&e(12,v=P.getRoomAreaText),"getLabelElement"in P&&e(13,b=P.getLabelElement),"getRuleDistanceText"in P&&e(14,y=P.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in P&&e(15,x=P.adaptiveRoomLabelVisibleEnable)},[n,o,s,r,a,l,c,h,f,u,m,g,v,b,y,x]}class di extends fe{constructor(t){super(),de(this,t,ec,$l,ue,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,hoverEnable:5,compassEnable:6,roomLabelsEnable:7,ruleLabelsEnable:8,floorplanData:9,lastPanoramaLongitude:10,cameraImageUrl:11,getRoomAreaText:12,getLabelElement:13,getRuleDistanceText:14,adaptiveRoomLabelVisibleEnable:15},_l)}}const tc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLOK6BPwIk9nNODM9Xf1RVe1b3elJRjCZmQ6euqGmuqer33rq4e23GqiOykBloDJQGagMVAYqA5WBykBlYFYD1qwP/tdzaZqOx9zYOLxeX0+L5yzLGp0X/03a25MOnGRcBtx+6Rlo9SL08G4EooFnxa8Yiivox5/h5Ys/4cl7NVorNDRnngX+0MIkVMeMSf23zyKML8J7/Dy8hwF2Buh9CnS+AEQIdLspBuGb+M7/qLW4qJrNpsLapjYhpwVnx3BMfCtNNx3Etc9xywvnMf80wG8HmQainw0RxSGrnmeBp+8k5/j9S0HbvXb5io0Lz880/0wPHV1NlhLd316He+4xOCv5ragF7L9PrH1qBJyB0626x/lC+qrSvH5r/W+n1WpxUM5nMY4GPeH8lHJaPgfeAFQHCL+ntkXT+vnUc3W6pvTIwC0wy3rA4dwLmK2avZ7Eo9uKBuYJfgJscbs8dLCxDMt+EOEPBEZNEWyBYHqTz6bPXrzUnNrSShxHIsYiOL69zrCGLLcLqJP68tB+9w5wj+YhWDafQ2s61wNqxjZhmrQ2pvMFCEvXuCUZ7wqH794ZWs28LJqlTXSUyuksF2M/yOwqgkx2c1ADa4wLAQRk2sAGQQakhN6yFC2hltfz5kSY44NKQeeh+vtI/SSzWhg2CzCgmWISmKUGmaYFBDfCSymnfxJ6/+ospVcWOLLp5DGP/y0P/Rp66O99DQNq7Po3Ds0a0wY+My2QSv2N2mO/OyxR2o6UQk+Lv7yJ06JYSnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";async function nc(i){const t=new Headers({"Content-Type":"text/plain"}),e=async function(o){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=await fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s};return await Promise.all(i.map(e))}function ic(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 oc(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(ic),rules:i.rules}}function sc(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function rc(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}}async function At(i){const t=await nc(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(oc),o=i.computed_data.entrance?rc(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(sc)}}function ac(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:tc,width:45,height:48},a=xl(s,t),l=wl(s,e),c=Il(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function lc(i,t){return t(i),i}function En(i,t){return lc({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function Wo(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 fi(i,t,e=vt.BOUNDING_CENTER){const n=Wo(i,t),o=Wo(i,t+1);return e===vt.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===vt.CEILING?o:n}function mi(i,t,e,n){const o=fi(i,e,n==null?void 0:n.attachedTo),s=new O.Vector3(0,o,0),r=new O.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 Ho{constructor(t){d(this,"five");d(this,"hooks",new me.Subscribe);this.five=t}getCurrentState(){return this.state}}class Ct extends Ho{}var Ye=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(Ye||{});const Yo=500,cc=80;function pi(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}async function Vo(i,t){await 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 h=o[c];if(h===void 0)return!0;const f=l[c];return typeof h=="number"&&typeof f=="number"?pi(h,f,2):h===f}):!0})()||n(new Error("five pose \u4E0E\u9884\u671F\u4E0D\u7B26")),e()})})}function gi(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!(!pi(e,s,2)||!pi(n,r,2)||o!==a)}async function Zo(i,t,e=!0){if(gi(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[h]=await wn(Vo(i,[t.mode,t,void 0,e]));if(h)throw new Error(Ye.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]=await wn(i.updateCamera(t,l,e));if(c)throw new Error(Ye.UpdateCameraError)}function Gt(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 hc(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 uc(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 dc extends Ct{constructor(e,n){var a;super(e);d(this,"name","modelFloorplanPlugin");d(this,"state");d(this,"data");d(this,"showState");d(this,"showPromise");d(this,"app");d(this,"panoIndex",0);d(this,"floorIndex",0);d(this,"selector");d(this,"showRejection");d(this,"wrapper");d(this,"container",document.createElement("div"));d(this,"lastPanoramaLongitude",0);d(this,"size",{width:0,height:0});d(this,"hasAddedEventListener",!1);d(this,"isHiddenByHideFunc",!1);d(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")});d(this,"show",async(e={})=>{if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show(e)});d(this,"hide",async(e={})=>{!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))});d(this,"updateSize",()=>{if(!this.data||!gi(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=mi(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})});d(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,Ye.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});d(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}))});d(this,"_show",async e=>{var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Ye.ModelNotLoaded);if(!this.data)throw new Error(Ye.DataNotLoaded);this.isHiddenByHideFunc=!1;const o={...{floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},...e},s=async()=>{this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=await wn(Zo(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Ye.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const h=o.modelOpacity,f=o.immediately?0:Yo;Gt(this.five,h,f),this.render(f)};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});d(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,Ye.BreakOffByHide),this.showPromise=void 0;const o={...{userAction:!0,isAutoHide:!1},...e};Gt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});d(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});d(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)});d(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});d(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||uc(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});d(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});d(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();hc(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});d(this,"onFiveWantsGesture",(e,n)=>{if(!!this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});d(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});d(this,"onFiveWantsTapGesture",()=>this.handleClick());d(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});d(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:cc/((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:bt,attachedTo:vt.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},s=n?En(n,["selector","scale"]):{},r={...o,...s};this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}async load(e,n,o=!0){function s(h){return Object.prototype.hasOwnProperty.apply(h,["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=await At(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()}async formatData(e){return await At(e.data)}updateState(e,n){const o=this.state,s=e.config?{...o.config,...e.config}:o.config;this.state={...this.state,...e,config:s},!et(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n={...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 di({target:this.container,intro:!0,props:n})}}const fc=(i,t)=>new dc(i,t);function mc(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 pc(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 gc extends Ct{constructor(e,n){super(e);d(this,"name","modelFloorplanPlugin");d(this,"state");d(this,"data");d(this,"showState");d(this,"showPromise");d(this,"app");d(this,"panoIndex",0);d(this,"floorIndex",0);d(this,"selector");d(this,"showRejection");d(this,"wrapper");d(this,"container",document.createElement("div"));d(this,"lastPanoramaLongitude",0);d(this,"size",{width:0,height:0});d(this,"hasAddedEventListener",!1);d(this,"isHiddenByHideFunc",!1);d(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")});d(this,"show",async(e={})=>{if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show(e)});d(this,"hide",async(e={})=>{!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))});d(this,"updateSize",()=>{if(!this.data||!gi(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=mi(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})});d(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,Ye.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});d(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}))});d(this,"_show",async e=>{var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Ye.ModelNotLoaded);if(!this.data)throw new Error(Ye.DataNotLoaded);this.isHiddenByHideFunc=!1;const o={...{floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},...e},s=async()=>{this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=await wn(Zo(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Ye.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const h=o.modelOpacity,f=o.immediately?0:Yo;Gt(this.five,h,f),this.render(f)};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});d(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,Ye.BreakOffByHide),this.showPromise=void 0;const o={...{userAction:!0,isAutoHide:!1},...e};Gt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});d(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});d(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)});d(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});d(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});d(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();this.updatePosition(),this.updateSize(),mc(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});d(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:(pc(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});d(this,"onFiveWantsTapGesture",()=>this.handleClick());d(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});d(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:bt,attachedTo:vt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?En(n,["selector","scale"]):{},r={...o,...s};this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}async load(e,n,o=!0){function s(h){return Object.prototype.hasOwnProperty.apply(h,["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=await At(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=fi(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new O.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+"%"}async formatData(e){return await At(e.data)}updateState(e,n){const o=this.state,s=e.config?{...o.config,...e.config}:o.config;this.state={...this.state,...e,config:s},!et(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n={...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 di({target:this.container,intro:!0,props:n})}}const vc=(i,t)=>new gc(i,t);class bc extends Ct{constructor(e,n){super(e);d(this,"name","topviewFloorplanPlugin");d(this,"state");d(this,"data");d(this,"app");d(this,"selector");d(this,"panoIndex",0);d(this,"floorIndex",0);d(this,"wrapper");d(this,"container",document.createElement("div"));d(this,"lastPanoramaLongitude",0);d(this,"size",{width:0,height:0});d(this,"hasAddedEventListener",!1);d(this,"isHiddenByHideFunc",!1);d(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=mi(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})});d(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")});d(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})});d(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)});d(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});d(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});d(this,"onFiveCameraUpdate",(e,n)=>{!this.state.visible||(this.updatePosition(),this.updateSize())});d(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});d(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});d(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}))});d(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:bt,attachedTo:vt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?En(n,["selector","scale"]):{},r={...o,...s};this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}async load(e,n,o=!0){function s(h){return Object.prototype.hasOwnProperty.apply(h,["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=await At(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=fi(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new O.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}async show(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})}async hide(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()}async formatData(e){return await At(e.data)}async _show(e){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"&&await Vo(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;Gt(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()}async _hide(e){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;Gt(this.five,o,s),this.render()}_enable(e){const{userAction:n}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}updateState(e,n){const o=this.state,s=e.config?{...o.config,...e.config}:o.config;this.state={...this.state,...e,config:s},!et(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n={...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 di({target:this.container,intro:!0,props:n})}}const Ac=(i,t)=>new bc(i,t);function vi(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function yc(i){be(i,"svelte-1ty3s4p",".plugin-radar__camera-wrapper.svelte-1ty3s4p{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1ty3s4p{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1ty3s4p{position:absolute;left:-0.78125rem;top:-0.78125rem;width:0.88542rem;height:0.88542rem;transform-origin:0.78125rem 0.78125rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function Pc(i){let t,e,n;return{c(){t=Q("div"),e=Q("div"),n=Q("div"),C(n,"class","plugin-radar__camera-rotate svelte-1ty3s4p"),S(n,"background-image","url("+(i[0]||bt)+")"),S(n,"transform",i[1]),C(e,"class","plugin-radar__camera-position svelte-1ty3s4p"),S(e,"transform",i[2]),C(t,"class","plugin-radar__camera-wrapper svelte-1ty3s4p")},m(o,s){V(o,t,s),W(t,e),W(e,n)},p(o,[s]){s&1&&S(n,"background-image","url("+(o[0]||bt)+")"),s&2&&S(n,"transform",o[1]),s&4&&S(e,"transform",o[2])},i:ne,o:ne,d(o){o&&H(t)}}}function wc(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function Ic(i,t,e){let n,o,{five:s}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=s.getCurrentState().panoIndex,h=s.getCurrentState().longitude;function f(g,v){const b=g.bounding,y=g.observers[v];if(!y)return"";const x=(b.max.x-b.min.x)*r,P=(b.max.y-b.min.y)*r,L=Math.floor(y.positionInImage.x*x),T=Math.floor(y.positionInImage.y*P);return`translate(${L}px, ${T}px)`}function u(g){e(6,c=g)}const m=vi(g=>{e(7,h=g.longitude)},1e3/60);return It(()=>(s.on("panoWillArrive",u),s.on("cameraDirectionUpdate",m),function(){s.off("panoWillArrive",u),s.off("cameraDirectionUpdate",m)})),i.$$set=g=>{"five"in g&&e(3,s=g.five),"pxmm"in g&&e(4,r=g.pxmm),"floorplanData"in g&&e(5,a=g.floorplanData),"cameraImageUrl"in g&&e(0,l=g.cameraImageUrl)},i.$$.update=()=>{i.$$.dirty&96&&e(2,n=f(a,c)),i.$$.dirty&128&&e(1,o=wc(h))},[l,o,n,s,r,a,c,h]}class xc extends fe{constructor(t){super(),de(this,t,Ic,Pc,ue,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},yc)}}function Cc(i){be(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 Jo(i,t,e){const n=i.slice();return n[1]=t[e],n}function Uo(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=Q("div"),n=Q("div"),r=pe(),C(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),S(n,"background-image",`url(${t[1].icon.url})`),S(n,"width",o),S(n,"height",s),C(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),S(e,"top",a),S(e,"left",l),this.first=e},m(c,h){V(c,e,h),W(e,n),W(e,r)},p(c,h){t=c,h&1&&S(n,"background-image",`url(${t[1].icon.url})`),h&1&&o!==(o=`${t[1].icon.width/16}rem`)&&S(n,"width",o),h&1&&s!==(s=`${t[1].icon.height/16}rem`)&&S(n,"height",s),h&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&S(e,"top",a),h&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&S(e,"left",l)},d(c){c&&H(e)}}}function Ec(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=Jo(i,o,r),l=s(a);n.set(l,e[r]=Uo(l,a))}return{c(){t=Q("div");for(let r=0;r<e.length;r+=1)e[r].c();C(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){V(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=gt(e,a,s,1,r,o,n,t,mo,Uo,null,Jo))},i:ne,o:ne,d(r){r&&H(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function Lc(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class kc extends fe{constructor(t){super(),de(this,t,Lc,Ec,ue,{extraObjects:0},Cc)}}function qo(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=Ge(o,n[s]);return t=new Oo({props:o}),{c(){Pe(t.$$.fragment)},m(s,r){Ae(t,s,r),e=!0},p(s,r){const a=r&87?Xe(n,[{five:s[0],pxmm:s[1],floorIndex:s[2],floorplanData:s[4],onRoomHeightClick:s[6]}]):{};t.$set(a)},i(s){e||(X(t.$$.fragment,s),e=!0)},o(s){K(t.$$.fragment,s),e=!1},d(s){ye(t,s)}}}function Dc(i){let t,e,n,o,s,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let h=0;h<a.length;h+=1)l=Ge(l,a[h]);t=new bo({props:l}),n=new kc({props:{extraObjects:i[5]}});let c=i[3]&&qo(i);return{c(){Pe(t.$$.fragment),e=pe(),Pe(n.$$.fragment),o=pe(),c&&c.c(),s=Re()},m(h,f){Ae(t,h,f),V(h,e,f),Ae(n,h,f),V(h,o,f),c&&c.m(h,f),V(h,s,f),r=!0},p(h,[f]){const u=f&20?Xe(a,[{floorIndex:h[2],floorplanData:h[4]}]):{};t.$set(u);const m={};f&32&&(m.extraObjects=h[5]),n.$set(m),h[3]?c?(c.p(h,f),f&8&&X(c,1)):(c=qo(h),c.c(),X(c,1),c.m(s.parentNode,s)):c&&(Ce(),K(c,1,1,()=>{c=null}),Ee())},i(h){r||(X(t.$$.fragment,h),X(n.$$.fragment,h),X(c),r=!0)},o(h){K(t.$$.fragment,h),K(n.$$.fragment,h),K(c),r=!1},d(h){ye(t,h),h&&H(e),ye(n,h),h&&H(o),c&&c.d(h),h&&H(s)}}}function Tc(i,t,e){let n,{five:o}=t,{pxmm:s}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t;const h=void 0;return i.$$set=f=>{"five"in f&&e(0,o=f.five),"pxmm"in f&&e(1,s=f.pxmm),"floorIndex"in f&&e(2,r=f.floorIndex),"hoverEnable"in f&&e(3,a=f.hoverEnable),"floorplanData"in f&&e(4,l=f.floorplanData),"extraObjects"in f&&e(7,c=f.extraObjects)},i.$$.update=()=>{i.$$.dirty&132&&e(5,n=c==null?void 0:c.filter(f=>f.floorIndex===r))},[o,s,r,a,l,n,h,c]}class zc extends fe{constructor(t){super(),de(this,t,Tc,Dc,ue,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:7})}}function Mc(i){be(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 Ko(i){let t,e,n,o=i[6]!==0&&_o(i);return{c(){t=Q("div"),o&&o.c(),C(t,"class","plugin-floorplan-radar svelte-1mvqyqq"),Ke(()=>i[12].call(t))},m(s,r){V(s,t,r),o&&o.m(t,null),e=St(t,i[12].bind(t)),n=!0},p(s,r){s[6]!==0?o?(o.p(s,r),r&64&&X(o,1)):(o=_o(s),o.c(),X(o,1),o.m(t,null)):o&&(Ce(),K(o,1,1,()=>{o=null}),Ee())},i(s){n||(X(o),n=!0)},o(s){K(o),n=!1},d(s){s&&H(t),o&&o.d(),e()}}}function _o(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 u=0;u<l.length;u+=1)c=Ge(c,l[u]);e=new zc({props:c});const h=[{pxmm:i[9],five:i[0],floorplanData:i[3],cameraImageUrl:i[4]}];let f={};for(let u=0;u<h.length;u+=1)f=Ge(f,h[u]);return o=new xc({props:f}),{c(){t=Q("div"),Pe(e.$$.fragment),n=pe(),Pe(o.$$.fragment),C(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),S(t,"width",s),S(t,"height",r)},m(u,m){V(u,t,m),Ae(e,t,null),W(t,n),Ae(o,t,null),a=!0},p(u,m){const g=m&1581?Xe(l,[{five:u[0],pxmm:u[9],floorIndex:u[10],floorplanData:u[3],hoverEnable:u[2],extraObjects:u[5]}]):{};e.$set(g);const v=m&537?Xe(h,[{pxmm:u[9],five:u[0],floorplanData:u[3],cameraImageUrl:u[4]}]):{};o.$set(v),m&256&&s!==(s=`${u[8]}px`)&&S(t,"width",s),m&2048&&r!==(r=`${u[11]}px`)&&S(t,"height",r)},i(u){a||(X(e.$$.fragment,u),X(o.$$.fragment,u),a=!0)},o(u){K(e.$$.fragment,u),K(o.$$.fragment,u),a=!1},d(u){u&&H(t),ye(e),ye(o)}}}function Sc(i){let t,e,n=i[1]&&Ko(i);return{c(){n&&n.c(),t=Re()},m(o,s){n&&n.m(o,s),V(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&X(n,1)):(n=Ko(o),n.c(),X(n,1),n.m(t.parentNode,t)):n&&(Ce(),K(n,1,1,()=>{n=null}),Ee())},i(o){e||(X(n),e=!0)},o(o){K(n),e=!1},d(o){n&&n.d(o),o&&H(t)}}}function jc(i,t,e){let{five:n}=t,{visible:o}=t,{hoverEnable:s}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,c=0,h=0,f=0,u=0,m=0,g=0;function v(y){e(10,h=n.work.observers[y].floorIndex)}It(()=>(n.on("panoArrived",v),()=>{n.off("panoArrived",v)}));function b(){f=this.clientWidth,u=this.clientHeight,e(6,f),e(7,u)}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(f,u),{max:x,min:P}=r.bounding,L=x.x-P.x,T=x.y-P.y,I=function(){return L>T?[y,y/L*T]:[y/T*L,y]}();e(8,m=I[0]),e(11,g=I[1]),e(9,c=m/L)}},[n,o,s,r,a,l,f,u,m,c,h,g,b]}class Oc extends fe{constructor(t){super(),de(this,t,jc,Sc,ue,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5},Mc)}}class Nc extends Ct{constructor(e,n){super(e);d(this,"name","panoFloorplanRadarPlugin");d(this,"state");d(this,"data");d(this,"app");d(this,"wrapperSelector","");d(this,"wrapper",null);d(this,"disposed",!1);d(this,"extraObjects",[]);d(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});d(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:bt},s=n!=null&&n.configs?n.configs:{},r={...o,...s};this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}async load(e,n,o=!0){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=await At(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,o),this.render()}async show(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})}async hide(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=ac(e,this.five,this.data),this.render())}async formatData(e){return await At(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={...this.state,...e},!et(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const n=document.querySelector(this.wrapperSelector);this.wrapper=n}if(!this.data||!this.wrapper)return;const e={...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 Oc({target:this.wrapper,props:e})}}const Bc=(i,t)=>new Nc(i,t),Fc=[{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"}],Gc=[{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"}],Rc=[{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 O.Matrix4,o=new O.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},Xc=(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 $o(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s={map:o.material.map||{},...t};o.material=new M.MeshBasicMaterial(s),o.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const Qc=(i,t)=>{var h;const e=t.fbx_url||"//vrlab-static.ljcdn.com/release/web/v3/dipan3/dipan.FBX",n=(h=t.north_rad)!=null?h:void 0,o={},s=async f=>{var ee;const u=(f==null?void 0:f.fbx_url)||e,m=(ee=f==null?void 0:f.north_rad)!=null?ee:n;if(typeof m!="number")throw new Error('"northRad"\u914D\u7F6E\u53C2\u6570\u7F3A\u5931\uFF1A\u672A\u914D\u7F6E\u6307\u5357\u9488\u6307\u5411\uFF01');const g=i.model.bounding,v=g.max.x-g.min.x,b=g.max.z-g.min.z,y=Math.max(v,b),P=await new Vi.FBXLoader().loadAsync(u);$o(P,{transparent:!0,side:O.DoubleSide,blending:O.AdditiveBlending});const L=[0,m-Math.PI/2,0],{model:{bounding:{max:{x:T,z:I},min:{x:D,y:E,z}}}}=i;o.yBase=E;const F={x:(T+D)/2,y:E-1.6,z:(I+z)/2},R=.0045*y;return Xc(P,{position:F,rotation:L,scale:R}),o.object=P,!0},r=({latitude:f})=>{if(!o.object)return;const u=a(f);u&&(o.object.position.y=u)},a=f=>{if(o.yBase===void 0)return;const u=.6;if(f>=Math.PI/4)return o.yBase-(u+1.6);const m=f*(4/Math.PI);return o.yBase-(u*m+1.6)};return{load:s,disable:()=>{!o.object||(i.scene.remove(o.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!o.object)return;const f=a(i.getPose().latitude);f&&(o.object.position.y=f),i.scene.add(o.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function Wc(i,t){var c,h,f,u,m;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(h=t==null?void 0:t.fontSize)!=null?h:e*(35/256)*1.2,o=(f=t==null?void 0:t.backgroundColor)!=null?f:"rgba(0,0,0,0)",s=(u=t==null?void 0:t.fontColor)!=null?u:"#fff",r=(m=t==null?void 0:t.textAlign)!=null?m:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=o,l.fillRect(0,0,e,e),l.font=`${n}px "\u5FAE\u8F6F\u96C5\u9ED1"`,l.textAlign=r,l.fillStyle=s,l.fillText(i,e/2,e*.7),new M.CanvasTexture(a)}const Hc=({x:i,y:t,z:e})=>new M.Vector3(i,t,e),Yc=(i,t)=>{var v,b,y;const e={},n=(v=t.animationEnabled)!=null?v:!0,o=(b=t.position)!=null?b:void 0,s=(y=t.rad)!=null?y:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=async x=>{var z,F,R,ee,j,N,G;const P=(z=x==null?void 0:x.position)!=null?z:o;if(!P)return Promise.reject("ModelEntryDoorGuidePlugin.load(): position is undefined");const L=Hc(P),T=(F=x==null?void 0:x.rad)!=null?F:s,I=(R=x==null?void 0:x.fbx_url)!=null?R:r;if(e.rad=T,T===void 0)return Promise.reject(`ModelEntryDoorGuidePlugin.load(): rad is ${T}`);const D=await new Vi.FBXLoader().loadAsync(I);D.position.copy(L),D.rotation.z=T,D.scale.set(.8,.8,.8),$o(D,{transparent:!0,side:O.DoubleSide});const E=(G=(N=(j=(ee=D.children)==null?void 0:ee[0])==null?void 0:j.children)==null?void 0:N[3])==null?void 0:G.clone();return E?(E.material=new M.MeshBasicMaterial({transparent:!0,map:Wc("\u5165\u6237\u95E8")}),E.renderOrder=3,D.children[0].add(E),e.object=D,!0):Promise.reject(`ModelEntryDoorGuidePlugin.load(): textMesh is ${E}`)},c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const x=1,P=new M.AnimationMixer(e.object);a.push(P);const L=P.clipAction(e.object.animations[0]);L.timeScale=x;let T;const I=()=>{let F=0,R=0;const ee=1e3/30,j=N=>{F=requestAnimationFrame(j);const G=N-R;G<ee||(R=N,a.forEach(_=>_.update(G/1e3)),i.needsRender=!0)};return F=requestAnimationFrame(j),()=>{cancelAnimationFrame(F)}},z={play:()=>{T||(L.play(),T=I(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{L.stop(),T==null||T(),T=void 0}};e.animation=z},h=x=>{var L;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((L=x==null?void 0:x.animationEnable)!=null?L:n)&&(e.animation||c(),e.animation.play()),i.scene.add(e.object),i.needsRender=!0},f=()=>{!e.object||(e.animation&&e.animation.stop(),i.scene.remove(e.object),i.needsRender=!0)},u=x=>x==="Floorplan"?h():f();return{load:l,enable:x=>(e.enabled||(e.enabled=!0,u(i.currentMode),i.on("modeChange",u),h(x)),!0),disable:()=>(e.enabled&&(e.enabled=!1,f(),i.off("modeChange",u)),!0)}},Ln=window.requestAnimationFrame||(i=>setTimeout(i,16)),Vc=window.cancelAnimationFrame||clearTimeout;function Ai(i,t=0){t<=0?Ln(i):Ln(()=>Ai(i,t-1))}function yi(i,t=60){let e=-1,n=0,o=-1;const s=1e3/t;function r(a){o===-1&&(o=a),e=Ln(r),!(a-n<s)&&(n=a,i&&i(a-o))}return e=Ln(r),function(){Vc(e)}}const Zc=ei.Easing;function Jc(i,t,e,n=Zc.Linear.None){const o=new ei.Tween(i).to(t,e).easing(n);Ai(()=>o.start(0));const s=yi(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 Uc(i,t){return Jc({progress:0},{progress:1},i,t)}var es=(i=>(i.Move="Move",i.Rotate="Rotate",i))(es||{}),tt=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(tt||{});const kn=Math.PI*2;function ts(i){return(i%kn+kn)%kn}function ns(i){return i%kn}function Pi(i,t,e){return i+(t-i)*e}const wi=(i,t,e)=>{const n=Math.PI,o=n*2;return i=ts(i),t=ts(t),e===tt.Anticlockwise&&i<t&&(i+=o),e===tt.Clockwise&&t<i&&(t+=o),e===tt.Loop&&t-i>n?wi(i,t,tt.Anticlockwise):e===tt.Loop&&i-t>n?wi(i,t,tt.Clockwise):{from:i,to:t}},qc=i=>{const t={},e=async(s,r,a={preload:!0})=>(t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&await a.asyncStartCallback(),s.mode&&s.mode!==i.currentMode&&await i.changeMode(s.mode),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&await i.preloadPano(s.panoIndex),a.asyncEndCallback&&await a.asyncEndCallback(),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:await new Promise((l,c)=>{const h=s.panoIndex!==void 0?s.panoIndex:i.panoIndex;h!==void 0?i.moveToPano(h,Object.assign({duration:r,moveEndCallback:()=>l(!0),moveCancelCallback:()=>c(!1)},s)):c(!1)})),n=s=>{const r=i.state,a=ns(r.latitude),l=ns(s.latitude),{from:c,to:h}=wi(r.longitude,s.longitude,s.rotation||tt.Loop),f=r.fov,u=s.fov;return{from:{latitude:a,longitude:c,fov:f},to:{latitude:l,longitude:h,fov:u}}};return{move:e,rotate:async(s,r,a={})=>{t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&await a.asyncStartCallback(),i.currentMode!==me.Five.Mode.Panorama&&await i.changeMode(me.Five.Mode.Panorama),s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(a.preload&&await i.preloadPano(s.panoIndex),await new Promise((h,f)=>{if(!s.panoIndex){h(!0);return}i.moveToPano(s.panoIndex,{moveEndCallback:()=>h(!0),moveCancelCallback:()=>f(!1)})})),a.asyncEndCallback&&await a.asyncEndCallback();const{from:l,to:c}=n(s);return await new Promise(h=>{const f=({progress:b})=>{const y={};y.longitude=Pi(l.longitude,c.longitude,b),y.latitude=Pi(l.latitude,c.latitude,b),y.fov=Pi(l.fov,c.fov,b),i.setState(y,!0)},u=()=>{h(!0)},m=()=>{h(!1)},g=s.rotateSpeed?Math.ceil(Math.abs(c.longitude-l.longitude)/s.rotateSpeed*1e3):r,v=Uc(g,ei.Easing.Linear.None).onUpdate(f).onComplete(u).onDestroy(m);s.rotation===tt.Loop&&v.repeat(1/0).yoyo(!0),t.interruptCallback=(b=!0)=>{v.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),h(b)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})}}};function is(i,t){return i.x===t.x&&i.y===t.y}function os(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function Dn(i,t){return(t.y-i.y)/(t.x-i.x)}function ss(i,t,e){const n=Dn(i[1],i[0]),o=Dn(t[1],t[0]);if(isNaN(n)||isNaN(o)||os(n,o))return!1;if(Tn(i[0],t))return i[0];if(Tn(i[1],t))return i[1];if(Tn(t[0],i))return t[0];if(Tn(t[1],i))return t[1];if(e&&!Kc(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 Tn(i,t){return is(i,t[0])||is(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&&os(Dn(t[0],i),Dn(i,t[1]))}function zn(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function Kc(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)&&zn(t[0],i[1],i[0])*zn(i[1],t[1],i[0])>0&&zn(i[0],t[1],t[0])*zn(t[1],i[1],t[0])>0?1:0}function rs(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>rs(i,t-1))}const _c=`<style type="text/css">
|
|
114
114
|
.PanoRulerPlugin-rule-line {
|
|
115
115
|
position: absolute;
|
|
116
116
|
transform-origin: left center;
|
|
@@ -203,13 +203,13 @@ transition: all 500ms;
|
|
|
203
203
|
<div class="PanoRulerPlugin-rule-label-name">${e.options.distanceText(b)}</div>
|
|
204
204
|
</div>
|
|
205
205
|
</div>
|
|
206
|
-
`,x=document.createElement("div");return x.setAttribute("class","PanoRulerPlugin-rule"),x.setAttribute("data-name",v),x.setAttribute("style","display: none"),x.innerHTML=y,x},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=_c,o.appendChild(s);const r={},a=(v,b)=>{if(e.loaded)throw new Error("\u6807\u5C3A\u88AB\u91CD\u590D\u521D\u59CB\u5316\uFF01");const y=eh(v,i),x=i.work;if(!x)return!1;for(const P in b){const k=b[P],{standingPosition:T}=x.observers[0],I=k.map(({x:D,z:E,observers:z})=>{const F=z.length>0?v.rooms[v.observers[z[0]]].name:"",R=y[F]?y[F].floor:null;let ee=1/0,j={index:0,x:T.x,y:T.y,z:T.z};z.forEach(Y=>{if(!x.observers[Y])return;const{standingPosition:te}=x.observers[Y],re={index:Y,x:te.x,y:te.y,z:te.z},oe=$c({x:D,z:E},re);R?oe<ee&&Math.abs(re.y-R)<.3&&(ee=oe,j=re):oe<ee&&(ee=oe,j=re)});const N=new M.Vector3(D,j.y,E);Object.assign(N,{observers:z});const G=y[F]?y[F].roof:null,_=G?new M.Vector3(D,G,E):null;return _&&Object.assign(_,{observers:z}),{origin:N,vertical:_}});r[P]={origins:I.map(D=>D.origin),rules:[]};for(const{origin:D,vertical:E}of I){if(!E)continue;const z=n(P,D.distanceTo(E));o.append(z),r[P].rules.push({vertical:!0,rule:[D,E],$element:z})}for(let D=0;D<I.length;D++){let E=D+1;E>=I.length&&(E=0);const{origin:z}=I[D],{origin:F}=I[E],R=n(P,z.distanceTo(F));o.append(R),r[P].rules.push({vertical:!1,rule:[z,F],$element:R})}}return e.loaded=!0,!0},l=async(v,b,y)=>{const x=v||t.roomInfo,P=b||t.roomRules;if(!x||!P)throw new Error("\u6807\u5C3A\u6570\u636E\u4F9D\u8D56\u4E0D\u9F50\u5168\uFF01");return e.loaded=!1,e.options={...e.options,...y||{}},i.model.loaded?a(x,P):await new Promise(k=>i.once("modelLoaded",()=>k(a(x,P))))};t.roomInfo&&t.roomRules&&l(t.roomInfo,t.roomRules);const c=(v,b,y,x)=>{const P=[[{x:0,y:0},{x:y,y:0}],[{x:0,y:0},{x:0,y:x}],[{x:y,y:0},{x:y,y:x}],[{x:0,y:x},{x:y,y:x}]],k=[];for(let T=0;T<P.length;T++){const I=ss([v,b],[P[T][0],P[T][1]],!0);I&&k.push(I)}return k.length===0?!1:k},h=()=>{var z;const v=(z=i.getElement())==null?void 0:z.parentElement;if(!v||!e.loaded||Object.keys(r).length<=0)return;const{panoIndex:b,camera:y,currentMode:x}=i;if(b===void 0)return;let P;for(const F in r)F.split(",").indexOf(b.toString())>=0&&(P=F);if(!P){for(const F in r)for(const{$element:R}of r[F].rules)R.style.display="none";return}const k=y.position,T=y.getWorldDirection(new M.Vector3),I=v.clientWidth,D=v.clientHeight;if(x!==me.Five.Mode.Panorama){for(const F in r)for(const{$element:R}of r[F].rules)R.style.display="none";return}for(const F in r)for(const{$element:R}of r[F].rules)R.style.display=F===P?"block":"none";const[E]=r[P].origins.slice().filter(F=>F.observers.indexOf(b)>=0).sort((F,R)=>{const ee=F.clone().setY(0).sub(k).normalize().angleTo(T.clone().setY(0)),j=R.clone().setY(0).sub(k).normalize().angleTo(T.clone().setY(0));return ee-j});for(const{rule:F,vertical:R,$element:ee}of r[P].rules){const[j,N]=F,G=ee.querySelector(".PanoRulerPlugin-rule-line");if(!G)return;if(!E){ee.style.display="none";continue}if(j!==E&&N!==E){ee.style.display="none";continue}if(j.distanceTo(N)<.3){ee.style.display="none";continue}if(j.observers.indexOf(b)===-1||N.observers.indexOf(b)===-1){ee.style.display="none";continue}if(j.clone().sub(k).normalize().angleTo(T)>Math.PI/2){ee.style.display="none";continue}if(N.clone().sub(k).normalize().angleTo(T)>Math.PI/2){ee.style.display="none";continue}const ie=j.distanceTo(N);if(N.clone().sub(N.clone().sub(j).divide(new M.Vector3(2,2,2))).distanceTo(k)/ie>8){ee.style.display="none";continue}const re=j.clone().project(y),oe=(re.x+1)/2*I,he=(-re.y+1)/2*D,we=N.clone().project(y),Le=(we.x+1)/2*I,Oe=(-we.y+1)/2*D,Z=Math.sqrt(Math.pow(Le-oe,2)+Math.pow(Oe-he,2));let ae=Z,se=50;const q=c({x:~~oe,y:~~he},{x:~~Le,y:~~Oe},I,D);if(q&&q.length===1&&(E===j?(ae=Math.sqrt(Math.pow(q[0].x-oe,2)+Math.pow(q[0].y-he,2)),se=ae/Z*50):E===N&&(ae=Math.sqrt(Math.pow(q[0].x-Le,2)+Math.pow(q[0].y-Oe,2)),se=100-ae/Z*50)),q&&q.length===2){const He={x:(q[0].x+q[1].x)/2,y:(q[0].y+q[1].y)/2};se=Math.sqrt(Math.pow(He.x-oe,2)+Math.pow(He.y-he,2))/Z*100}const Ve=(Math.PI/2-Math.atan2(Le-oe,he-Oe))/Math.PI*180,ce=G.querySelector(".PanoRulerPlugin-rule-label"),We=ce.children[0].clientWidth;We>=Z||We/2>=se/100*Z||We/2>=(1-se/100)*Z?G.style.display="none":(G.style.display="block",G.style.width=Z+"px",G.style.left=oe+"px",G.style.top=he+"px",G.style.transform=`rotate(${-Ve}deg)`,ce.style.left=`${se}%`)}},f=()=>rs(h),u=()=>{var v,b;return e.loaded?(e.enable||(o.setAttribute("class","PanoRulerPlugin"+(e.options.className?" "+e.options.className:"")),(b=(v=i.getElement())==null?void 0:v.parentElement)==null||b.append(o),h(),i.on("modeChange",h),i.on("cameraUpdate",f),e.enable=!0),!0):!1},m=()=>(e.enable&&(i.off("modeChange",h),i.off("cameraUpdate",f),o&&o.remove(),e.enable=!1),!0);function g(v){if(v.distanceText&&v.distanceText!==e.options.distanceText){const b=v.distanceText;e.options.distanceText=b,Object.values(r).forEach(y=>{y.rules.forEach(x=>{const[P,k]=x.rule,T=P.distanceTo(k),I=x.$element.querySelector(".PanoRulerPlugin-rule-label-name");!I||(I.innerText=b(T))})})}}return{enable:u,disable:m,load:l,state:e,changeConfigs:g}};function nh(i){be(i,"svelte-1h27ktp",".PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp{position:absolute;transform-origin:left 0.0625rem;width:0;height:0.125rem;pointer-events:none}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::after{content:'';position:absolute;left:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::before{content:'';position:absolute;right:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1.5s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp em.svelte-1h27ktp{display:block;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;box-shadow:0 0 0.25rem rgb(0 0 0 / 40%);position:relative}.rule-mixed-line.svelte-1h27ktp.svelte-1h27ktp{display:flex;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;align-items:center}.em-solid.svelte-1h27ktp.svelte-1h27ktp{height:100%;background:#ffffff}.em-dotted.svelte-1h27ktp.svelte-1h27ktp{height:0.125rem;background:var(--background-image);background-position:center;background-repeat:repeat}.PanoRulerPlugin-rule-label.svelte-1h27ktp.svelte-1h27ktp{position:absolute;width:0;height:0;top:0.0625rem;pointer-events:none}.PanoRulerPlugin-rule-label-name.svelte-1h27ktp.svelte-1h27ktp{position:absolute;padding:0.1875rem 0.375rem;background:rgba(195, 195, 195, 0.3);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem);border-radius:6.25rem;border:0.0625rem solid rgba(255, 255, 255, 0.6);white-space:nowrap;overflow:hidden;color:#ffffff;font-weight:500;font-size:0.75rem;line-height:1;animation:svelte-1h27ktp-viewport-rule-label 0.25s ease 1s;animation-fill-mode:both;box-shadow:inset 0 0 0.625rem 0 rgba(255, 255, 255, 0.3)}@keyframes svelte-1h27ktp-viewport-rule-line{0%{width:0%}100%{width:100%}}@keyframes svelte-1h27ktp-viewport-rule-label{0%{opacity:0;transform:scaleX(0)}100%{opacity:1;transform:translate(-50%, -50%) scaleX(1)}}@keyframes svelte-1h27ktp-viewport-rule-point{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}")}function as(i,t,e){const n=i.slice();return n[6]=t[e],n}function ih(i){let t,e=i[0].children,n=[];for(let o=0;o<e.length;o+=1)n[o]=ls(as(i,e,o));return{c(){t=Q("div");for(let o=0;o<n.length;o+=1)n[o].c();C(t,"class","rule-mixed-line svelte-1h27ktp")},m(o,s){V(o,t,s);for(let r=0;r<n.length;r+=1)n[r].m(t,null)},p(o,s){if(s&9){e=o[0].children;let r;for(r=0;r<e.length;r+=1){const a=as(o,e,r);n[r]?n[r].p(a,s):(n[r]=ls(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&&H(t),Mt(n,o)}}}function oh(i){let t,e;return{c(){t=Q("em"),C(t,"class",e=Se(i[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),C(t,"style",i[3])},m(n,o){V(n,t,o)},p(n,o){o&1&&e!==(e=Se(n[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&C(t,"class",e),o&8&&C(t,"style",n[3])},d(n){n&&H(t)}}}function ls(i){let t,e,n=`${i[6].width}px`;return{c(){t=Q("div"),C(t,"class",e=Se(i[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),C(t,"style",i[3]),S(t,"width",n)},m(o,s){V(o,t,s)},p(o,s){s&1&&e!==(e=Se(o[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&C(t,"class",e),s&8&&C(t,"style",o[3]),s&1&&n!==(n=`${o[6].width}px`)&&S(t,"width",n)},d(o){o&&H(t)}}}function sh(i){let t,e,n,o,s=i[0].labelElement+"",r,a,l=`${i[0].labelOffset}%`,c=`${i[0].width}px`,h=`${i[0].left}px`,f=`${i[0].top}px`,u=`rotate(${i[0].rotateDeg}deg)`;function m(b,y){return b[0].children.length===0?oh:ih}let g=m(i),v=g(i);return{c(){t=Q("div"),v.c(),e=pe(),n=Q("div"),o=Q("div"),r=Ue(s),C(o,"class","PanoRulerPlugin-rule-label-name svelte-1h27ktp"),Ke(()=>i[4].call(o)),C(n,"class","PanoRulerPlugin-rule-label svelte-1h27ktp"),S(n,"left",l),C(t,"class","PanoRulerPlugin-rule-line svelte-1h27ktp"),S(t,"width",c),S(t,"left",h),S(t,"top",f),S(t,"transform",u),S(t,"display",i[0].visible&&i[2]?"block":"none")},m(b,y){V(b,t,y),v.m(t,null),W(t,e),W(t,n),W(n,o),W(o,r),a=St(o,i[4].bind(o))},p(b,[y]){g===(g=m(b))&&v?v.p(b,y):(v.d(1),v=g(b),v&&(v.c(),v.m(t,e))),y&1&&s!==(s=b[0].labelElement+"")&&ct(r,s),y&1&&l!==(l=`${b[0].labelOffset}%`)&&S(n,"left",l),y&1&&c!==(c=`${b[0].width}px`)&&S(t,"width",c),y&1&&h!==(h=`${b[0].left}px`)&&S(t,"left",h),y&1&&f!==(f=`${b[0].top}px`)&&S(t,"top",f),y&1&&u!==(u=`rotate(${b[0].rotateDeg}deg)`)&&S(t,"transform",u),y&5&&S(t,"display",b[0].visible&&b[2]?"block":"none")},i:ne,o:ne,d(b){b&&H(t),v.d(),a()}}}function rh(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 ah extends fe{constructor(t){super(),de(this,t,rh,sh,ue,{rulerItemProp:0},nh)}}function cs(i,t,e){const n=i.slice();return n[16]=t[e],n}function hs(i){let t,e;return t=new ah({props:{rulerItemProp:i[16]}}),{c(){Pe(t.$$.fragment)},m(n,o){Ae(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.rulerItemProp=n[16]),t.$set(s)},i(n){e||(X(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){ye(t,n)}}}function lh(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=hs(cs(i,n,r));const s=r=>K(o[r],1,1,()=>{o[r]=null});return{c(){t=Q("div");for(let r=0;r<o.length;r+=1)o[r].c()},m(r,a){V(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=cs(r,n,l);o[l]?(o[l].p(c,a),X(o[l],1)):(o[l]=hs(c),o[l].c(),X(o[l],1),o[l].m(t,null))}for(Ce(),l=n.length;l<o.length;l+=1)s(l);Ee()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)X(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)K(o[a]);e=!1},d(r){r&&H(t),Mt(o,r)}}}function ch(i,t,e){var n,o,s,r;let{five:a}=t,{rulerDatas:l}=t,{options:c}=t,h=[];const f=((o=(n=a.getElement())===null||n===void 0?void 0:n.parentElement)===null||o===void 0?void 0:o.clientWidth)||0,u=((r=(s=a.getElement())===null||s===void 0?void 0:s.parentElement)===null||r===void 0?void 0:r.clientHeight)||0,m=(P,k)=>{const T=[[{x:0,y:0},{x:f,y:0}],[{x:0,y:0},{x:0,y:u}],[{x:f,y:0},{x:f,y:u}],[{x:0,y:u},{x:f,y:u}]],I=[];for(let D=0;D<T.length;D++){const E=ss([P,k],[T[D][0],T[D][1]],!0);E&&I.push(E)}return I.length===0?!1:I},g=(P,k)=>{const T=P.clone().project(a.camera),I=(T.x+1)/2*f,D=(-T.y+1)/2*u,E=k.clone().project(a.camera),z=(E.x+1)/2*f,F=(-E.y+1)/2*u,R=Math.sqrt(Math.pow(z-I,2)+Math.pow(F-D,2));return{startLeft:I,startTop:D,endLeft:z,endTop:F,distance:R}},v=(P,k,T)=>{const I=a.camera.position,D=a.camera.getWorldDirection(new M.Vector3),E=P.clone().sub(I).normalize().angleTo(D),z=k.clone().sub(I).normalize().angleTo(D),F=P.distanceTo(k),ee=k.clone().sub(k.clone().sub(P).divide(new M.Vector3(2,2,2))).distanceTo(I),{startLeft:j,startTop:N,endLeft:G,endTop:_,distance:U}=g(P,k),Y=-((Math.PI/2-Math.atan2(G-j,N-_))/Math.PI)*180;let te=!0;T||(te=!1),!et(P,T)&&!et(k,T)&&(te=!1),F<.3&&(te=!1),E>Math.PI/2&&(te=!1),z>Math.PI/2&&(te=!1),ee/F>8&&(te=!1);let re=50,oe=U;const he=m({x:~~j,y:~~N},{x:~~G,y:~~_});if(he&&he.length===1&&(et(P,T)?(oe=Math.sqrt(Math.pow(he[0].x-j,2)+Math.pow(he[0].y-N,2)),re=oe/U*50):et(k,T)&&(oe=Math.sqrt(Math.pow(he[0].x-G,2)+Math.pow(he[0].y-_,2)),re=100-oe/U*50)),he&&he.length===2){const we={x:(he[0].x+he[1].x)/2,y:(he[0].y+he[1].y)/2};re=Math.sqrt(Math.pow(we.x-j,2)+Math.pow(we.y-N,2))/U*100}return{startLeft:j,startTop:N,distance:U,deg:Y,visible:te,labelOffset:re,ruleLength:F}},b=()=>{const P=a.panoIndex,k=l.find(R=>R.panoIndex===P);if(!k)return e(0,h=[]);if(a.currentMode!==me.Five.Mode.Panorama)return e(0,h=[]);const T=a.camera.position,I=a.camera.getWorldDirection(new M.Vector3),D=k.lines.map(R=>new M.Vector3(R.start[0],-R.start[1],-R.start[2])),E=k.lines.map(R=>new M.Vector3(R.end[0],-R.end[1],-R.end[2])),[z]=D.concat(E).sort((R,ee)=>{const j=R.clone().setY(0).sub(T).normalize().angleTo(I.clone().setY(0)),N=ee.clone().setY(0).sub(T).normalize().angleTo(I.clone().setY(0));return j-N}),F=k.lines.map(R=>{var ee,j;const N=R.start,G=R.end,{startLeft:_,startTop:U,distance:ie,deg:Y,visible:te,labelOffset:re,ruleLength:oe}=v(new M.Vector3(N[0],-N[1],-N[2]),new M.Vector3(G[0],-G[1],-G[2]),z),he=[];return R.children&&((ee=R.children)===null||ee===void 0?void 0:ee.length)>0&&((j=R.children)===null||j===void 0||j.forEach(we=>{const Le=we.start,Oe=we.end,{distance:Z}=g(new M.Vector3(Le[0],-Le[1],-Le[2]),new M.Vector3(Oe[0],-Oe[1],-Oe[2]));he.push({width:Z,state:we.state})})),{width:ie,left:_,top:U,rotateDeg:Y,state:R.state,children:he,labelOffset:re,visible:te,labelElement:c.distanceText(oe)}});e(0,h=F)},y=()=>Ai(b),x=vi(b,80);return It(()=>{b(),a.on("panoArrived",b),a.on("modeChange",b),a.on("cameraDirectionUpdate",y),a.on("movingToPano",y),a.on("mouseWheel",()=>x()),a.on("pinchGesture",()=>x())}),Ut(()=>{a.off("panoArrived",b),a.off("modeChange",b),a.off("cameraDirectionUpdate",y),a.off("movingToPano",y),a.off("mouseWheel",()=>x()),a.off("pinchGesture",()=>x())}),i.$$set=P=>{"five"in P&&e(1,a=P.five),"rulerDatas"in P&&e(2,l=P.rulerDatas),"options"in P&&e(3,c=P.options)},[h,a,l,c]}class hh extends fe{constructor(t){super(),de(this,t,ch,lh,ue,{five:1,rulerDatas:2,options:3})}}class uh{constructor(t,e){d(this,"five");d(this,"container",document.createElement("div"));d(this,"panoRulerProData");d(this,"rulerItems");d(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={...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",async()=>{var s,r;(r=(s=this.five.getElement())==null?void 0:s.parentNode)==null||r.append(this.container)}),this.five.once("dispose",()=>this.dispose())}async load(t){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}async render(){var t;if(this.state.enabled){if(!this.panoRulerProData||!this.container)return;this.rulerItems=new hh({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 dh=(i,t)=>new uh(i,t),fh="data:image/png;base64,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";function mh(){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(${fh})`,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 ph=new O.TextureLoader;async function us(i){return new Promise((t,e)=>{ph.load(i,t,void 0,e)}).then(t=>(t.encoding=O.sRGBEncoding,t))}class gh extends wt.default.Tween{constructor(){super(...arguments);d(this,"disposeMethods",[]);d(this,"animationFrameDisposer");d(this,"onDispose",e=>(this.disposeMethods.push(e),this));d(this,"play",()=>(this.start(0),this.animationFrameDisposer=yi(e=>this.update(e)),this));d(this,"dispose",()=>{var e;this.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this.disposeMethods.forEach(n=>n()),this.disposeMethods=[],wt.default.remove(this)})}}function vh(i,t=wt.default.Easing.Linear.None){const e=new gh({progress:0}).to({progress:1});return i!==void 0&&e.duration(i),t!==void 0&&e.easing(t),e}const Mn={userAction:!0};class bh extends Ct{constructor(e,n){super(e);d(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"}});d(this,"data");d(this,"group",new O.Group);d(this,"roomInfoInstance");d(this,"roomInfoWrapperInstance");d(this,"compassMeshTween");d(this,"compassMesh");d(this,"entryDoorMesh");d(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)});d(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)});d(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)});d(this,"_enable",()=>{this.five.scene.add(this.group),this.init(),this.onFivePanoArrived(this.five.panoIndex||0),this._addEventListener()});d(this,"_disable",()=>{this._clearCompassIfNeed(),this._clearEntryDoorIfNeed(),this.five.scene.remove(this.group),this._removeEventListener()});d(this,"_toggleVisible",()=>{this.group.visible=this.state.visible,this.five.needsRender=!0});d(this,"_clearCompassIfNeed",()=>{var e;this.compassMesh&&(this.group.remove(this.compassMesh),(e=this.compassMesh.material.map)==null||e.dispose(),this.compassMesh=null)});d(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)});d(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}))});d(this,"onFivePanoArrived",e=>{var o,s,r,a,l,c,h;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=vh(1e3).onUpdate(({progress:f})=>{var u;(u=this.compassMesh)==null||u.material.setValues({opacity:f}),this.five.needsRender=!0}).play())),this.entryDoorMesh){const u=new O.Vector3(this.data.entrance.position.x,this.data.entrance.position.y,this.data.entrance.position.z).clone().setY(n.y).sub(n).normalize(),m=n.clone().add(u.clone().multiplyScalar(.7)).setY(n.y+.01);this.entryDoorMesh.rotation.z=new O.Vector3(0,0,-1).angleTo(u),this.entryDoorMesh.position.copy(m),((l=this.data)==null?void 0:l.room_observers[e].room.type)===1?(c=this.entryDoorMesh)==null||c.material.setValues({opacity:1}):(h=this.entryDoorMesh)==null||h.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});d(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())});d(this,"onFiveModeChange",(e,n,o,s,r)=>{e!==n&&this.setState({visible:e===me.Five.Mode.Panorama},{userAction:r})});this.five.scene.add(this.group),this.five.once("dispose",this.dispose),this.setState({visible:!0,enabled:!0,config:{...this.state.config,...n||{}}})}enable(e=Mn){this.setState({enabled:!0},e)}disable(e=Mn){this.setState({enabled:!1},e)}show(e=Mn){if(!!this.state.enabled)return this.setState({visible:!0},e),Promise.resolve()}hide(e=Mn){if(!!this.state.enabled)return this.setState({visible:!1},e),Promise.resolve()}setState(e,n={userAction:!0}){var s,r;const o=JSON.parse(JSON.stringify(this.state));this.state={visible:(s=e.visible)!=null?s:o.visible,enabled:(r=e.enabled)!=null?r:o.enabled,config:{...o.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()}async load(e,n,o=!0){const s=await this.formatData(e);JSON.stringify(this.data)!==JSON.stringify(s)&&(this.hooks.emit("dataChange",s,this.data),this.data={...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)}async init(){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=await 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=await this.loadEntryDoorMesh(),this.roomInfoWrapperInstance=this.loadRoomInfo(),this.roomInfoInstance=mh(),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}async loadCompassMesh(){const e=this.state.config.compassImageUrl,n=await us(e),o=new O.CircleGeometry(.7,32),s=new O.MeshBasicMaterial({map:n,transparent:!0,opacity:0,depthTest:!1}),r=new O.Mesh(o,s);return r.name="pano-compass-mesh",r}async loadEntryDoorMesh(){const e=this.state.config.entryDoorImageUrl,n=await us(e),o=new O.PlaneGeometry(.2,.16),s=new O.MeshBasicMaterial({map:n,transparent:!0,opacity:.8,depthTest:!1}),r=new O.Mesh(o,s);return r.name="pano-compass-entry-door",r}loadRoomInfo(){const e=[new O.Vector3(-.7,0,-.7),new O.Vector3(.7,0,-.7),new O.Vector3(.7,0,.7),new O.Vector3(-.7,0,.7)];return fn(this.five).create3DDomContainer(e)}}const Ah=(i,t)=>new bh(i,t);var ds={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
206
|
+
`,x=document.createElement("div");return x.setAttribute("class","PanoRulerPlugin-rule"),x.setAttribute("data-name",v),x.setAttribute("style","display: none"),x.innerHTML=y,x},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=_c,o.appendChild(s);const r={},a=(v,b)=>{if(e.loaded)throw new Error("\u6807\u5C3A\u88AB\u91CD\u590D\u521D\u59CB\u5316\uFF01");const y=eh(v,i),x=i.work;if(!x)return!1;for(const P in b){const L=b[P],{standingPosition:T}=x.observers[0],I=L.map(({x:D,z:E,observers:z})=>{const F=z.length>0?v.rooms[v.observers[z[0]]].name:"",R=y[F]?y[F].floor:null;let ee=1/0,j={index:0,x:T.x,y:T.y,z:T.z};z.forEach(Y=>{if(!x.observers[Y])return;const{standingPosition:te}=x.observers[Y],re={index:Y,x:te.x,y:te.y,z:te.z},oe=$c({x:D,z:E},re);R?oe<ee&&Math.abs(re.y-R)<.3&&(ee=oe,j=re):oe<ee&&(ee=oe,j=re)});const N=new M.Vector3(D,j.y,E);Object.assign(N,{observers:z});const G=y[F]?y[F].roof:null,_=G?new M.Vector3(D,G,E):null;return _&&Object.assign(_,{observers:z}),{origin:N,vertical:_}});r[P]={origins:I.map(D=>D.origin),rules:[]};for(const{origin:D,vertical:E}of I){if(!E)continue;const z=n(P,D.distanceTo(E));o.append(z),r[P].rules.push({vertical:!0,rule:[D,E],$element:z})}for(let D=0;D<I.length;D++){let E=D+1;E>=I.length&&(E=0);const{origin:z}=I[D],{origin:F}=I[E],R=n(P,z.distanceTo(F));o.append(R),r[P].rules.push({vertical:!1,rule:[z,F],$element:R})}}return e.loaded=!0,!0},l=async(v,b,y)=>{const x=v||t.roomInfo,P=b||t.roomRules;if(!x||!P)throw new Error("\u6807\u5C3A\u6570\u636E\u4F9D\u8D56\u4E0D\u9F50\u5168\uFF01");return e.loaded=!1,e.options={...e.options,...y||{}},i.model.loaded?a(x,P):await new Promise(L=>i.once("modelLoaded",()=>L(a(x,P))))};t.roomInfo&&t.roomRules&&l(t.roomInfo,t.roomRules);const c=(v,b,y,x)=>{const P=[[{x:0,y:0},{x:y,y:0}],[{x:0,y:0},{x:0,y:x}],[{x:y,y:0},{x:y,y:x}],[{x:0,y:x},{x:y,y:x}]],L=[];for(let T=0;T<P.length;T++){const I=ss([v,b],[P[T][0],P[T][1]],!0);I&&L.push(I)}return L.length===0?!1:L},h=()=>{var z;const v=(z=i.getElement())==null?void 0:z.parentElement;if(!v||!e.loaded||Object.keys(r).length<=0)return;const{panoIndex:b,camera:y,currentMode:x}=i;if(b===void 0)return;let P;for(const F in r)F.split(",").indexOf(b.toString())>=0&&(P=F);if(!P){for(const F in r)for(const{$element:R}of r[F].rules)R.style.display="none";return}const L=y.position,T=y.getWorldDirection(new M.Vector3),I=v.clientWidth,D=v.clientHeight;if(x!==me.Five.Mode.Panorama){for(const F in r)for(const{$element:R}of r[F].rules)R.style.display="none";return}for(const F in r)for(const{$element:R}of r[F].rules)R.style.display=F===P?"block":"none";const[E]=r[P].origins.slice().filter(F=>F.observers.indexOf(b)>=0).sort((F,R)=>{const ee=F.clone().setY(0).sub(L).normalize().angleTo(T.clone().setY(0)),j=R.clone().setY(0).sub(L).normalize().angleTo(T.clone().setY(0));return ee-j});for(const{rule:F,vertical:R,$element:ee}of r[P].rules){const[j,N]=F,G=ee.querySelector(".PanoRulerPlugin-rule-line");if(!G)return;if(!E){ee.style.display="none";continue}if(j!==E&&N!==E){ee.style.display="none";continue}if(j.distanceTo(N)<.3){ee.style.display="none";continue}if(j.observers.indexOf(b)===-1||N.observers.indexOf(b)===-1){ee.style.display="none";continue}if(j.clone().sub(L).normalize().angleTo(T)>Math.PI/2){ee.style.display="none";continue}if(N.clone().sub(L).normalize().angleTo(T)>Math.PI/2){ee.style.display="none";continue}const ie=j.distanceTo(N);if(N.clone().sub(N.clone().sub(j).divide(new M.Vector3(2,2,2))).distanceTo(L)/ie>8){ee.style.display="none";continue}const re=j.clone().project(y),oe=(re.x+1)/2*I,he=(-re.y+1)/2*D,we=N.clone().project(y),Le=(we.x+1)/2*I,Oe=(-we.y+1)/2*D,Z=Math.sqrt(Math.pow(Le-oe,2)+Math.pow(Oe-he,2));let ae=Z,se=50;const q=c({x:~~oe,y:~~he},{x:~~Le,y:~~Oe},I,D);if(q&&q.length===1&&(E===j?(ae=Math.sqrt(Math.pow(q[0].x-oe,2)+Math.pow(q[0].y-he,2)),se=ae/Z*50):E===N&&(ae=Math.sqrt(Math.pow(q[0].x-Le,2)+Math.pow(q[0].y-Oe,2)),se=100-ae/Z*50)),q&&q.length===2){const He={x:(q[0].x+q[1].x)/2,y:(q[0].y+q[1].y)/2};se=Math.sqrt(Math.pow(He.x-oe,2)+Math.pow(He.y-he,2))/Z*100}const Ve=(Math.PI/2-Math.atan2(Le-oe,he-Oe))/Math.PI*180,ce=G.querySelector(".PanoRulerPlugin-rule-label"),We=ce.children[0].clientWidth;We>=Z||We/2>=se/100*Z||We/2>=(1-se/100)*Z?G.style.display="none":(G.style.display="block",G.style.width=Z+"px",G.style.left=oe+"px",G.style.top=he+"px",G.style.transform=`rotate(${-Ve}deg)`,ce.style.left=`${se}%`)}},f=()=>rs(h),u=()=>{var v,b;return e.loaded?(e.enable||(o.setAttribute("class","PanoRulerPlugin"+(e.options.className?" "+e.options.className:"")),(b=(v=i.getElement())==null?void 0:v.parentElement)==null||b.append(o),h(),i.on("modeChange",h),i.on("cameraUpdate",f),e.enable=!0),!0):!1},m=()=>(e.enable&&(i.off("modeChange",h),i.off("cameraUpdate",f),o&&o.remove(),e.enable=!1),!0);function g(v){if(v.distanceText&&v.distanceText!==e.options.distanceText){const b=v.distanceText;e.options.distanceText=b,Object.values(r).forEach(y=>{y.rules.forEach(x=>{const[P,L]=x.rule,T=P.distanceTo(L),I=x.$element.querySelector(".PanoRulerPlugin-rule-label-name");!I||(I.innerText=b(T))})})}}return{enable:u,disable:m,load:l,state:e,changeConfigs:g}};function nh(i){be(i,"svelte-1h27ktp",".PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp{position:absolute;transform-origin:left 0.0625rem;width:0;height:0.125rem;pointer-events:none}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::after{content:'';position:absolute;left:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::before{content:'';position:absolute;right:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1.5s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp em.svelte-1h27ktp{display:block;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;box-shadow:0 0 0.25rem rgb(0 0 0 / 40%);position:relative}.rule-mixed-line.svelte-1h27ktp.svelte-1h27ktp{display:flex;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;align-items:center}.em-solid.svelte-1h27ktp.svelte-1h27ktp{height:100%;background:#ffffff}.em-dotted.svelte-1h27ktp.svelte-1h27ktp{height:0.125rem;background:var(--background-image);background-position:center;background-repeat:repeat}.PanoRulerPlugin-rule-label.svelte-1h27ktp.svelte-1h27ktp{position:absolute;width:0;height:0;top:0.0625rem;pointer-events:none}.PanoRulerPlugin-rule-label-name.svelte-1h27ktp.svelte-1h27ktp{position:absolute;padding:0.1875rem 0.375rem;background:rgba(195, 195, 195, 0.3);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem);border-radius:6.25rem;border:0.0625rem solid rgba(255, 255, 255, 0.6);white-space:nowrap;overflow:hidden;color:#ffffff;font-weight:500;font-size:0.75rem;line-height:1;animation:svelte-1h27ktp-viewport-rule-label 0.25s ease 1s;animation-fill-mode:both;box-shadow:inset 0 0 0.625rem 0 rgba(255, 255, 255, 0.3)}@keyframes svelte-1h27ktp-viewport-rule-line{0%{width:0%}100%{width:100%}}@keyframes svelte-1h27ktp-viewport-rule-label{0%{opacity:0;transform:scaleX(0)}100%{opacity:1;transform:translate(-50%, -50%) scaleX(1)}}@keyframes svelte-1h27ktp-viewport-rule-point{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}")}function as(i,t,e){const n=i.slice();return n[6]=t[e],n}function ih(i){let t,e=i[0].children,n=[];for(let o=0;o<e.length;o+=1)n[o]=ls(as(i,e,o));return{c(){t=Q("div");for(let o=0;o<n.length;o+=1)n[o].c();C(t,"class","rule-mixed-line svelte-1h27ktp")},m(o,s){V(o,t,s);for(let r=0;r<n.length;r+=1)n[r].m(t,null)},p(o,s){if(s&9){e=o[0].children;let r;for(r=0;r<e.length;r+=1){const a=as(o,e,r);n[r]?n[r].p(a,s):(n[r]=ls(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&&H(t),Mt(n,o)}}}function oh(i){let t,e;return{c(){t=Q("em"),C(t,"class",e=Se(i[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),C(t,"style",i[3])},m(n,o){V(n,t,o)},p(n,o){o&1&&e!==(e=Se(n[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&C(t,"class",e),o&8&&C(t,"style",n[3])},d(n){n&&H(t)}}}function ls(i){let t,e,n=`${i[6].width}px`;return{c(){t=Q("div"),C(t,"class",e=Se(i[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),C(t,"style",i[3]),S(t,"width",n)},m(o,s){V(o,t,s)},p(o,s){s&1&&e!==(e=Se(o[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&C(t,"class",e),s&8&&C(t,"style",o[3]),s&1&&n!==(n=`${o[6].width}px`)&&S(t,"width",n)},d(o){o&&H(t)}}}function sh(i){let t,e,n,o,s=i[0].labelElement+"",r,a,l=`${i[0].labelOffset}%`,c=`${i[0].width}px`,h=`${i[0].left}px`,f=`${i[0].top}px`,u=`rotate(${i[0].rotateDeg}deg)`;function m(b,y){return b[0].children.length===0?oh:ih}let g=m(i),v=g(i);return{c(){t=Q("div"),v.c(),e=pe(),n=Q("div"),o=Q("div"),r=Ue(s),C(o,"class","PanoRulerPlugin-rule-label-name svelte-1h27ktp"),Ke(()=>i[4].call(o)),C(n,"class","PanoRulerPlugin-rule-label svelte-1h27ktp"),S(n,"left",l),C(t,"class","PanoRulerPlugin-rule-line svelte-1h27ktp"),S(t,"width",c),S(t,"left",h),S(t,"top",f),S(t,"transform",u),S(t,"display",i[0].visible&&i[2]?"block":"none")},m(b,y){V(b,t,y),v.m(t,null),W(t,e),W(t,n),W(n,o),W(o,r),a=St(o,i[4].bind(o))},p(b,[y]){g===(g=m(b))&&v?v.p(b,y):(v.d(1),v=g(b),v&&(v.c(),v.m(t,e))),y&1&&s!==(s=b[0].labelElement+"")&&ct(r,s),y&1&&l!==(l=`${b[0].labelOffset}%`)&&S(n,"left",l),y&1&&c!==(c=`${b[0].width}px`)&&S(t,"width",c),y&1&&h!==(h=`${b[0].left}px`)&&S(t,"left",h),y&1&&f!==(f=`${b[0].top}px`)&&S(t,"top",f),y&1&&u!==(u=`rotate(${b[0].rotateDeg}deg)`)&&S(t,"transform",u),y&5&&S(t,"display",b[0].visible&&b[2]?"block":"none")},i:ne,o:ne,d(b){b&&H(t),v.d(),a()}}}function rh(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 ah extends fe{constructor(t){super(),de(this,t,rh,sh,ue,{rulerItemProp:0},nh)}}function cs(i,t,e){const n=i.slice();return n[16]=t[e],n}function hs(i){let t,e;return t=new ah({props:{rulerItemProp:i[16]}}),{c(){Pe(t.$$.fragment)},m(n,o){Ae(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.rulerItemProp=n[16]),t.$set(s)},i(n){e||(X(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){ye(t,n)}}}function lh(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=hs(cs(i,n,r));const s=r=>K(o[r],1,1,()=>{o[r]=null});return{c(){t=Q("div");for(let r=0;r<o.length;r+=1)o[r].c()},m(r,a){V(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=cs(r,n,l);o[l]?(o[l].p(c,a),X(o[l],1)):(o[l]=hs(c),o[l].c(),X(o[l],1),o[l].m(t,null))}for(Ce(),l=n.length;l<o.length;l+=1)s(l);Ee()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)X(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)K(o[a]);e=!1},d(r){r&&H(t),Mt(o,r)}}}function ch(i,t,e){var n,o,s,r;let{five:a}=t,{rulerDatas:l}=t,{options:c}=t,h=[];const f=((o=(n=a.getElement())===null||n===void 0?void 0:n.parentElement)===null||o===void 0?void 0:o.clientWidth)||0,u=((r=(s=a.getElement())===null||s===void 0?void 0:s.parentElement)===null||r===void 0?void 0:r.clientHeight)||0,m=(P,L)=>{const T=[[{x:0,y:0},{x:f,y:0}],[{x:0,y:0},{x:0,y:u}],[{x:f,y:0},{x:f,y:u}],[{x:0,y:u},{x:f,y:u}]],I=[];for(let D=0;D<T.length;D++){const E=ss([P,L],[T[D][0],T[D][1]],!0);E&&I.push(E)}return I.length===0?!1:I},g=(P,L)=>{const T=P.clone().project(a.camera),I=(T.x+1)/2*f,D=(-T.y+1)/2*u,E=L.clone().project(a.camera),z=(E.x+1)/2*f,F=(-E.y+1)/2*u,R=Math.sqrt(Math.pow(z-I,2)+Math.pow(F-D,2));return{startLeft:I,startTop:D,endLeft:z,endTop:F,distance:R}},v=(P,L,T)=>{const I=a.camera.position,D=a.camera.getWorldDirection(new M.Vector3),E=P.clone().sub(I).normalize().angleTo(D),z=L.clone().sub(I).normalize().angleTo(D),F=P.distanceTo(L),ee=L.clone().sub(L.clone().sub(P).divide(new M.Vector3(2,2,2))).distanceTo(I),{startLeft:j,startTop:N,endLeft:G,endTop:_,distance:U}=g(P,L),Y=-((Math.PI/2-Math.atan2(G-j,N-_))/Math.PI)*180;let te=!0;T||(te=!1),!et(P,T)&&!et(L,T)&&(te=!1),F<.3&&(te=!1),E>Math.PI/2&&(te=!1),z>Math.PI/2&&(te=!1),ee/F>8&&(te=!1);let re=50,oe=U;const he=m({x:~~j,y:~~N},{x:~~G,y:~~_});if(he&&he.length===1&&(et(P,T)?(oe=Math.sqrt(Math.pow(he[0].x-j,2)+Math.pow(he[0].y-N,2)),re=oe/U*50):et(L,T)&&(oe=Math.sqrt(Math.pow(he[0].x-G,2)+Math.pow(he[0].y-_,2)),re=100-oe/U*50)),he&&he.length===2){const we={x:(he[0].x+he[1].x)/2,y:(he[0].y+he[1].y)/2};re=Math.sqrt(Math.pow(we.x-j,2)+Math.pow(we.y-N,2))/U*100}return{startLeft:j,startTop:N,distance:U,deg:Y,visible:te,labelOffset:re,ruleLength:F}},b=()=>{const P=a.panoIndex,L=l.find(R=>R.panoIndex===P);if(!L)return e(0,h=[]);if(a.currentMode!==me.Five.Mode.Panorama)return e(0,h=[]);const T=a.camera.position,I=a.camera.getWorldDirection(new M.Vector3),D=L.lines.map(R=>new M.Vector3(R.start[0],-R.start[1],-R.start[2])),E=L.lines.map(R=>new M.Vector3(R.end[0],-R.end[1],-R.end[2])),[z]=D.concat(E).sort((R,ee)=>{const j=R.clone().setY(0).sub(T).normalize().angleTo(I.clone().setY(0)),N=ee.clone().setY(0).sub(T).normalize().angleTo(I.clone().setY(0));return j-N}),F=L.lines.map(R=>{var ee,j;const N=R.start,G=R.end,{startLeft:_,startTop:U,distance:ie,deg:Y,visible:te,labelOffset:re,ruleLength:oe}=v(new M.Vector3(N[0],-N[1],-N[2]),new M.Vector3(G[0],-G[1],-G[2]),z),he=[];return R.children&&((ee=R.children)===null||ee===void 0?void 0:ee.length)>0&&((j=R.children)===null||j===void 0||j.forEach(we=>{const Le=we.start,Oe=we.end,{distance:Z}=g(new M.Vector3(Le[0],-Le[1],-Le[2]),new M.Vector3(Oe[0],-Oe[1],-Oe[2]));he.push({width:Z,state:we.state})})),{width:ie,left:_,top:U,rotateDeg:Y,state:R.state,children:he,labelOffset:re,visible:te,labelElement:c.distanceText(oe)}});e(0,h=F)},y=()=>Ai(b),x=vi(b,80);return It(()=>{b(),a.on("panoArrived",b),a.on("modeChange",b),a.on("cameraDirectionUpdate",y),a.on("movingToPano",y),a.on("mouseWheel",()=>x()),a.on("pinchGesture",()=>x())}),Ut(()=>{a.off("panoArrived",b),a.off("modeChange",b),a.off("cameraDirectionUpdate",y),a.off("movingToPano",y),a.off("mouseWheel",()=>x()),a.off("pinchGesture",()=>x())}),i.$$set=P=>{"five"in P&&e(1,a=P.five),"rulerDatas"in P&&e(2,l=P.rulerDatas),"options"in P&&e(3,c=P.options)},[h,a,l,c]}class hh extends fe{constructor(t){super(),de(this,t,ch,lh,ue,{five:1,rulerDatas:2,options:3})}}class uh{constructor(t,e){d(this,"five");d(this,"container",document.createElement("div"));d(this,"panoRulerProData");d(this,"rulerItems");d(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={...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",async()=>{var s,r;(r=(s=this.five.getElement())==null?void 0:s.parentNode)==null||r.append(this.container)}),this.five.once("dispose",()=>this.dispose())}async load(t){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}async render(){var t;if(this.state.enabled){if(!this.panoRulerProData||!this.container)return;this.rulerItems=new hh({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 dh=(i,t)=>new uh(i,t),fh="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+cznVLwMf31Uypz7jZLJ0GEy8jqURnl8zPjyObDEsxknztsDUnFvMfF8e+4X6j88F4hlTDT3de6BiAYsI0HgxgiESG4MYd8XkLEhrARZTKUxUWB0MXrkiA3wdYYQg8Xs2cmzaR977cCE8eSM6wYDsQiXSyOrulDPRUT3AbsxydAnYO9kz87HfH9Kxv3D976lNEk2ujf9ANE8GCe1OeEzgRLZD4EQyX44df8tGQ08iNdHCU+jnhGPDVG9bgAGGD3Iw8TB5xgjz3jr3CTxSEapxxAL7VxcCmGaQPe6n/qScWtSIcdLrD1FhxbtRZn4x/3rtanvlBtffq57UCcI5l6dVF9CaJEgcAWBEMkVOPo+0ODHwGNEIAxIwsRBea6vdxlMPsNwYFAcIoEsnB4WQ6hTqxOMqg1wU40rxEx/kCal6AKejEnGOSFKvE8mFiYaFV8S9AVP5oo3o+syKSA0ZoJxmTWZJvFSXSMLIzBnXBa+bS5/UwQ0oDECEIRDF87n+nSOMDAMkIUNU51v2TjM4SWo2pdi1E34L1W4mnRALFOJtZ0pQe/QNVItT3XNOzpxV8n5fdWjaxzrBqY8j8Cc0Zn/RT45OQIaoPQT3oUHMDnHUzPKuYFLqGJYZFXObNILroSmIi8jMIfjy9/s8EwhGu/0+s+4CdI5vBkmKngv6Bo5x3NbodFFQmQOk6l48VzXQdcgF6d7unePoU7aE5lBIEQyA8y5TmvgEZ5iwBJSeKMkBrHXJVS8lCljZ8IwaZgwFlswvqzNugpT2K6rhTtaI2PPBIN0hWSkn6zJmFSc7yIYSIj0Y6VBdA108nZJd5TjuSQsNqDT558QyZn7rQxMSKNO435hkE0NNEIXzPhIzPiY7cXDEBBHkE0TyRx+0i9vovhf/R3pMR6MPWWTB+syU+JQ2tvlQ8Ji6C/kArHcKfcpHydrHYGxwWq9vl3XT4MFr4JZHO4/3gbkMTXYxkYMEmHtAsJgNsegYxaH9xFZBgH6YMoLXOZunV+1TGCYxHzgpkjfCYPhrUAw5BAMJDLGlbAY44E0iH7LJAlSgVw+UuK5l6nJlD6KnBuBEMmCPaDBwACpiYOBwuCqB0S9xZYBxmfs4YcsGEjkiSsLhBML/VD304lv3//tykTnQ7WENIjGBDYHQoFcSEym2IaMWP/JCaG9VZKyi8f6LaRSE8t4wsX3ImdAIERyRNALcTBIGByeYY13v4yJg+P7SiaOhKcERgMSI7VAJ4hcWGjHwyANonFTh8UYO3gv440kjKPvlqTs4llFLEy4GDfpM5A5g4RIbgi6lNkeh8NV4wEwVm7CUSg+CfLAZR9/R6cjZ0YgfXKiDpD+e2F/CIuVCRnjyh4L5DLeLYbXUu8Sg1gYUwNJ6ZoPVI6cCAE6I3IAAlJW3HCTBl6H3fK5qxCmMnGwiMiWy0jjCKiff6kqDuNDffbbxqu7+uqpP3iAEkJx2mfcOQx2W32YV74sqCUhkmvAlQLjUjMzcqiKxcJdwuwKT2NIUmAWDSOdIaB+/4WrrD78ncvJ20BA/cMmFcalE+GxXcJmFa+x3FWf1iHmXb/LZ3sgkNDWBEhSUhb67DYzA6rDVeOQBy/3gzQGJZWC5nkNgbECGffzCpq0niaUCRqTtH/RqjJmPdmDXMYvtoR4SD9U4kHJOgyWMStQbiLxSISelAoc6rUOFG5O2MnD4ni9xpHdPXNodXpeOvG+qy6j9XuXk7ePQDWeIRQmgizeT9k6zjF2IaRhbUV5thkLhENlCtxDr9Hl96VseGMommcxu7wzwlUmDnaHxC3ustf3r7T04z1/W/39B5eT94eA+pLw9OtKJpZdYTB2ldUhsLzOZY8u32U89/h5X1+RQuHuQhyErVCsmkjrUAazlHtKkEeeshUIGxT0odaPDUKwjiaXiZ/JwWEwL9qP7QBh7DdLkskY3hWGt8KC/eX/qFkHMsdrxeoHihSBbYP2OnBx58RrHZBHvI45lDZyXnrzrpsqA/JHl5OvCwH1s70ViAWPZby2Ujf4vg4GQpJO5K0SFTKrJBIpB1sDUQwIZNcuK2Kjd0v6RMqRtQ6BERnWzX5uHKQXf3I5+XoRkN3AHrLNGEIh7Vor9S4wIhab31q8GiKpyAMCQRmmBKLgOQ68DrYAbl4BpkDKuYFIfiYchvEhPflzMNkeAsWmQCi2KXP2kgkpnspmSWUOmC60Rh3NGg+dTJrzPCAPZg+D5yGjkDinwIjsRkC69VN/QzrzF5eTbxMB6QMhL3sq2Jo524mt8drqZhbq58BoVlvUocQ0WeswebA45pAU7XGZVyTcI8kQbKZD1d7IERCQnr3jy0h//upy8iAg3WACyyI9iccGbEexPbZBnsBCKrype9U7PbvYtaWOgyyYBTAjgET8gCCdxe4ak4c9j9V3nNocWRaBehffsnfK1btCoExMh+dOqokttslRERMLIXbO8QAkC/VERT7W71enW26w2teeCPz6raB4IlPiV5JAHvE8phDKuYMRkO79xD+SXv3N5eRBYA4B6QwTcya6kMrcsyp4JkRKWKPFdq1CmiOSUWfMvZiNRXIYPv/caRVq2F4jpIdvu1Ya8H93OXkQ2AcB6Q+PHUAqpDk7xqtZIJXuJ8FNEIlApx64gYA+t5DFIjnrHrzCIO/GERCR5RCQTv5IVx9CptK3fyx3p1x57QhIl/x/7llPmXpOBT1jNymk0uVjCGclkoq1AXhqvQaAWffA+3ioAe21EB1GgsByCEg3f+CrS+/+6XLyIPCqCEinsLeEvHZNmAnPM2HuKtpyciIpYNr7AFTIwfVwGY8DMFe5MKV2RRpHQHr6lqsoIvnA5eRB4BgISL+8gYhJNB4LYvvnCTN2kEl0816KDTiNWFQEHC4doBG68q6r+p7sZMD7gDzy+oEamZRPjoD09fu66TA+pI//PnkFcsPNICBdYz0Fu3idbSSs3+RzcIsSiQDi+ngdAGTWVfGKsHOB+GBCV1dgycE5EZDufs/31+D9r8vJg8BSCFT2kojN3K4vvBQm3E3Zy0WIRICwVRcwSFPbdu194LKt+kEdtT/SIQLS4Tddbenohy4nDwKnQGAPG4rdZALehA09KpGo8bhou9iUbbs0/jMNTscBdRgJAm0hIF1+wzWSrt52OXkQOCUC0kNsNNuHsatz24iHqI709GxLAjcmktJQEwj5WPA+aCiuWB4YHKOT4yYRkF7zUNkg0lueSI4EgbMiIJ1kZyshL9LUOjNEwkT9sXT2pBP1VyaSQiCse9Coqa27LApBIPE+BEKkLwSk32zRHESDkp0zkSDQBALF9uKdYHunnkthwo7tfXQqQjmYSNQImBACIU2xIuGreB8CIdIvAtJzNogMosHI4mYkCDSHgPTUXspU2ItoEIvzEArlxWRvIlGFWTSnsnWF+b1dKAhk8QrrHpEgsDgC0ndi0oNoEBIuiASBZhGQvnqCz/KCJ/jYZtto7DPRoUU2N11LJIXxqNyUC0VFqeCTpRlP94gEgZMhIL0nbDCIdJswQSQINI9AIRRsNRP+KfvOkgNrKEddr5660YUqw3k8EAhkbvsuCztPVSF7JDqMBIF1IKAxcOl5S8eZLEWCQDcIFBtO2Kv2UOr645lAKkex4VeIpLo5jHbls1KD4eYaWIu4R+UeyYLA2RHQWGAADiJ9P9u2StcheRB4VQSkyzgD2PQppwBH4MaEMpBFRSDcqCYQx9ggDphr0QUb3SMSBJpAQGPiciei9P6oYYAmGphKbA4B6TRrJ+j1HKHYzh8cZbpVBowXZ8bgQhzPNJAOvvD4QjkOAj0hUAbdUOVMoHrqudT1OgSk2zgLkAl2n/LYvh9s900kutYV4UIvQiBXMMlBEAgCQWA1CBRCgUjmHAkI5vk+PACR1BcZmGmfH64GzTQkCASBILBhBAqhgEC9rDFGJI7FGJEcB4EgEASCQBAIAkEgCASBIBAEgkAQCAJBIAgEgSAQBIJAEAgCm0fg/x4jQQWGalpFAAAAAElFTkSuQmCC";function mh(){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(${fh})`,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 ph=new O.TextureLoader;async function us(i){return new Promise((t,e)=>{ph.load(i,t,void 0,e)}).then(t=>(t.encoding=O.sRGBEncoding,t))}class gh extends wt.default.Tween{constructor(){super(...arguments);d(this,"disposeMethods",[]);d(this,"animationFrameDisposer");d(this,"onDispose",e=>(this.disposeMethods.push(e),this));d(this,"play",()=>(this.start(0),this.animationFrameDisposer=yi(e=>this.update(e)),this));d(this,"dispose",()=>{var e;this.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this.disposeMethods.forEach(n=>n()),this.disposeMethods=[],wt.default.remove(this)})}}function vh(i,t=wt.default.Easing.Linear.None){const e=new gh({progress:0}).to({progress:1});return i!==void 0&&e.duration(i),t!==void 0&&e.easing(t),e}const Mn={userAction:!0};class bh extends Ct{constructor(e,n){super(e);d(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"}});d(this,"data");d(this,"group",new O.Group);d(this,"roomInfoInstance");d(this,"roomInfoWrapperInstance");d(this,"compassMeshTween");d(this,"compassMesh");d(this,"entryDoorMesh");d(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)});d(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)});d(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)});d(this,"_enable",()=>{this.five.scene.add(this.group),this.init(),this.onFivePanoArrived(this.five.panoIndex||0),this._addEventListener()});d(this,"_disable",()=>{this._clearCompassIfNeed(),this._clearEntryDoorIfNeed(),this.five.scene.remove(this.group),this._removeEventListener()});d(this,"_toggleVisible",()=>{this.group.visible=this.state.visible,this.five.needsRender=!0});d(this,"_clearCompassIfNeed",()=>{var e;this.compassMesh&&(this.group.remove(this.compassMesh),(e=this.compassMesh.material.map)==null||e.dispose(),this.compassMesh=null)});d(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)});d(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}))});d(this,"onFivePanoArrived",e=>{var o,s,r,a,l,c,h;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=vh(1e3).onUpdate(({progress:f})=>{var u;(u=this.compassMesh)==null||u.material.setValues({opacity:f}),this.five.needsRender=!0}).play())),this.entryDoorMesh){const u=new O.Vector3(this.data.entrance.position.x,this.data.entrance.position.y,this.data.entrance.position.z).clone().setY(n.y).sub(n).normalize(),m=n.clone().add(u.clone().multiplyScalar(.7)).setY(n.y+.01);this.entryDoorMesh.rotation.z=new O.Vector3(0,0,-1).angleTo(u),this.entryDoorMesh.position.copy(m),((l=this.data)==null?void 0:l.room_observers[e].room.type)===1?(c=this.entryDoorMesh)==null||c.material.setValues({opacity:1}):(h=this.entryDoorMesh)==null||h.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});d(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())});d(this,"onFiveModeChange",(e,n,o,s,r)=>{e!==n&&this.setState({visible:e===me.Five.Mode.Panorama},{userAction:r})});this.five.scene.add(this.group),this.five.once("dispose",this.dispose),this.setState({visible:!0,enabled:!0,config:{...this.state.config,...n||{}}})}enable(e=Mn){this.setState({enabled:!0},e)}disable(e=Mn){this.setState({enabled:!1},e)}show(e=Mn){if(!!this.state.enabled)return this.setState({visible:!0},e),Promise.resolve()}hide(e=Mn){if(!!this.state.enabled)return this.setState({visible:!1},e),Promise.resolve()}setState(e,n={userAction:!0}){var s,r;const o=JSON.parse(JSON.stringify(this.state));this.state={visible:(s=e.visible)!=null?s:o.visible,enabled:(r=e.enabled)!=null?r:o.enabled,config:{...o.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()}async load(e,n,o=!0){const s=await this.formatData(e);JSON.stringify(this.data)!==JSON.stringify(s)&&(this.hooks.emit("dataChange",s,this.data),this.data={...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)}async init(){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=await 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=await this.loadEntryDoorMesh(),this.roomInfoWrapperInstance=this.loadRoomInfo(),this.roomInfoInstance=mh(),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}async loadCompassMesh(){const e=this.state.config.compassImageUrl,n=await us(e),o=new O.CircleGeometry(.7,32),s=new O.MeshBasicMaterial({map:n,transparent:!0,opacity:0,depthTest:!1}),r=new O.Mesh(o,s);return r.name="pano-compass-mesh",r}async loadEntryDoorMesh(){const e=this.state.config.entryDoorImageUrl,n=await us(e),o=new O.PlaneGeometry(.2,.16),s=new O.MeshBasicMaterial({map:n,transparent:!0,opacity:.8,depthTest:!1}),r=new O.Mesh(o,s);return r.name="pano-compass-entry-door",r}loadRoomInfo(){const e=[new O.Vector3(-.7,0,-.7),new O.Vector3(.7,0,-.7),new O.Vector3(.7,0,.7),new O.Vector3(-.7,0,.7)];return fn(this.five).create3DDomContainer(e)}}const Ah=(i,t)=>new bh(i,t);var ds={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
207
207
|
* http://hammerjs.github.io/
|
|
208
208
|
*
|
|
209
209
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
210
|
-
* Licensed under the MIT license */(function(i){(function(t,e,n,o){var s=["","webkit","Moz","MS","ms","o"],r=e.createElement("div"),a="function",l=Math.round,c=Math.abs,h=Date.now;function f(p,A,w){return setTimeout(P(p,w),A)}function u(p,A,w){return Array.isArray(p)?(m(p,w[A],w),!0):!1}function m(p,A,w){var
|
|
210
|
+
* Licensed under the MIT license */(function(i){(function(t,e,n,o){var s=["","webkit","Moz","MS","ms","o"],r=e.createElement("div"),a="function",l=Math.round,c=Math.abs,h=Date.now;function f(p,A,w){return setTimeout(P(p,w),A)}function u(p,A,w){return Array.isArray(p)?(m(p,w[A],w),!0):!1}function m(p,A,w){var k;if(!!p)if(p.forEach)p.forEach(A,w);else if(p.length!==o)for(k=0;k<p.length;)A.call(w,p[k],k,p),k++;else for(k in p)p.hasOwnProperty(k)&&A.call(w,p[k],k,p)}function g(p,A,w){var k="DEPRECATED METHOD: "+A+`
|
|
211
211
|
`+w+` AT
|
|
212
|
-
`;return function(){var B=new Error("get-stack-trace"),J=B&&B.stack?B.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",le=t.console&&(t.console.warn||t.console.log);return le&&le.call(t.console,L,J),p.apply(this,arguments)}}var v;typeof Object.assign!="function"?v=function(A){if(A===o||A===null)throw new TypeError("Cannot convert undefined or null to object");for(var w=Object(A),L=1;L<arguments.length;L++){var B=arguments[L];if(B!==o&&B!==null)for(var J in B)B.hasOwnProperty(J)&&(w[J]=B[J])}return w}:v=Object.assign;var b=g(function(A,w,L){for(var B=Object.keys(w),J=0;J<B.length;)(!L||L&&A[B[J]]===o)&&(A[B[J]]=w[B[J]]),J++;return A},"extend","Use `assign`."),y=g(function(A,w){return b(A,w,!0)},"merge","Use `assign`.");function x(p,A,w){var L=A.prototype,B;B=p.prototype=Object.create(L),B.constructor=p,B._super=L,w&&v(B,w)}function P(p,A){return function(){return p.apply(A,arguments)}}function k(p,A){return typeof p==a?p.apply(A&&A[0]||o,A):p}function T(p,A){return p===o?A:p}function I(p,A,w){m(F(A),function(L){p.addEventListener(L,w,!1)})}function D(p,A,w){m(F(A),function(L){p.removeEventListener(L,w,!1)})}function E(p,A){for(;p;){if(p==A)return!0;p=p.parentNode}return!1}function z(p,A){return p.indexOf(A)>-1}function F(p){return p.trim().split(/\s+/g)}function R(p,A,w){if(p.indexOf&&!w)return p.indexOf(A);for(var L=0;L<p.length;){if(w&&p[L][w]==A||!w&&p[L]===A)return L;L++}return-1}function ee(p){return Array.prototype.slice.call(p,0)}function j(p,A,w){for(var L=[],B=[],J=0;J<p.length;){var le=A?p[J][A]:p[J];R(B,le)<0&&L.push(p[J]),B[J]=le,J++}return w&&(A?L=L.sort(function(Me,Be){return Me[A]>Be[A]}):L=L.sort()),L}function N(p,A){for(var w,L,B=A[0].toUpperCase()+A.slice(1),J=0;J<s.length;){if(w=s[J],L=w?w+B:A,L in p)return L;J++}return o}var G=1;function _(){return G++}function U(p){var A=p.ownerDocument||p;return A.defaultView||A.parentWindow||t}var ie=/mobile|tablet|ip(ad|hone|od)|android/i,Y="ontouchstart"in t,te=N(t,"PointerEvent")!==o,re=Y&&ie.test(navigator.userAgent),oe="touch",he="pen",we="mouse",Le="kinect",Oe=25,Z=1,ae=2,se=4,q=8,Qe=1,Ve=2,ce=4,We=8,He=16,ve=Ve|ce,xe=We|He,Ze=ve|xe,yt=["x","y"],_e=["clientX","clientY"];function ke(p,A){var w=this;this.manager=p,this.callback=A,this.element=p.element,this.target=p.options.inputTarget,this.domHandler=function(L){k(p.options.enable,[p])&&w.handler(L)},this.init()}ke.prototype={handler:function(){},init:function(){this.evEl&&I(this.element,this.evEl,this.domHandler),this.evTarget&&I(this.target,this.evTarget,this.domHandler),this.evWin&&I(U(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&D(this.element,this.evEl,this.domHandler),this.evTarget&&D(this.target,this.evTarget,this.domHandler),this.evWin&&D(U(this.element),this.evWin,this.domHandler)}};function Ie(p){var A,w=p.options.inputClass;return w?A=w:te?A=Ni:re?A=Zn:Y?A=Bi:A=Vn,new A(p,De)}function De(p,A,w){var L=w.pointers.length,B=w.changedPointers.length,J=A&Z&&L-B===0,le=A&(se|q)&&L-B===0;w.isFirst=!!J,w.isFinal=!!le,J&&(p.session={}),w.eventType=A,ut(p,w),p.emit("hammer.input",w),p.recognize(w),p.session.prevInput=w}function ut(p,A){var w=p.session,L=A.pointers,B=L.length;w.firstInput||(w.firstInput=en(A)),B>1&&!w.firstMultiple?w.firstMultiple=en(A):B===1&&(w.firstMultiple=!1);var J=w.firstInput,le=w.firstMultiple,ze=le?le.center:J.center,Me=A.center=Wn(L);A.timeStamp=h(),A.deltaTime=A.timeStamp-J.timeStamp,A.angle=tn(ze,Me),A.distance=Wt(ze,Me),Qt(w,A),A.offsetDirection=Yn(A.deltaX,A.deltaY);var Be=Hn(A.deltaTime,A.deltaX,A.deltaY);A.overallVelocityX=Be.x,A.overallVelocityY=Be.y,A.overallVelocity=c(Be.x)>c(Be.y)?Be.x:Be.y,A.scale=le?Zd(le.pointers,L):1,A.rotation=le?Vd(le.pointers,L):0,A.maxPointers=w.prevInput?A.pointers.length>w.prevInput.maxPointers?A.pointers.length:w.prevInput.maxPointers:A.pointers.length,Oi(w,A);var rt=p.element;E(A.srcEvent.target,rt)&&(rt=A.srcEvent.target),A.target=rt}function Qt(p,A){var w=A.center,L=p.offsetDelta||{},B=p.prevDelta||{},J=p.prevInput||{};(A.eventType===Z||J.eventType===se)&&(B=p.prevDelta={x:J.deltaX||0,y:J.deltaY||0},L=p.offsetDelta={x:w.x,y:w.y}),A.deltaX=B.x+(w.x-L.x),A.deltaY=B.y+(w.y-L.y)}function Oi(p,A){var w=p.lastInterval||A,L=A.timeStamp-w.timeStamp,B,J,le,ze;if(A.eventType!=q&&(L>Oe||w.velocity===o)){var Me=A.deltaX-w.deltaX,Be=A.deltaY-w.deltaY,rt=Hn(L,Me,Be);J=rt.x,le=rt.y,B=c(rt.x)>c(rt.y)?rt.x:rt.y,ze=Yn(Me,Be),p.lastInterval=A}else B=w.velocity,J=w.velocityX,le=w.velocityY,ze=w.direction;A.velocity=B,A.velocityX=J,A.velocityY=le,A.direction=ze}function en(p){for(var A=[],w=0;w<p.pointers.length;)A[w]={clientX:l(p.pointers[w].clientX),clientY:l(p.pointers[w].clientY)},w++;return{timeStamp:h(),pointers:A,center:Wn(A),deltaX:p.deltaX,deltaY:p.deltaY}}function Wn(p){var A=p.length;if(A===1)return{x:l(p[0].clientX),y:l(p[0].clientY)};for(var w=0,L=0,B=0;B<A;)w+=p[B].clientX,L+=p[B].clientY,B++;return{x:l(w/A),y:l(L/A)}}function Hn(p,A,w){return{x:A/p||0,y:w/p||0}}function Yn(p,A){return p===A?Qe:c(p)>=c(A)?p<0?Ve:ce:A<0?We:He}function Wt(p,A,w){w||(w=yt);var L=A[w[0]]-p[w[0]],B=A[w[1]]-p[w[1]];return Math.sqrt(L*L+B*B)}function tn(p,A,w){w||(w=yt);var L=A[w[0]]-p[w[0]],B=A[w[1]]-p[w[1]];return Math.atan2(B,L)*180/Math.PI}function Vd(p,A){return tn(A[1],A[0],_e)+tn(p[1],p[0],_e)}function Zd(p,A){return Wt(A[0],A[1],_e)/Wt(p[0],p[1],_e)}var Jd={mousedown:Z,mousemove:ae,mouseup:se},Ud="mousedown",qd="mousemove mouseup";function Vn(){this.evEl=Ud,this.evWin=qd,this.pressed=!1,ke.apply(this,arguments)}x(Vn,ke,{handler:function(A){var w=Jd[A.type];w&Z&&A.button===0&&(this.pressed=!0),w&ae&&A.which!==1&&(w=se),this.pressed&&(w&se&&(this.pressed=!1),this.callback(this.manager,w,{pointers:[A],changedPointers:[A],pointerType:we,srcEvent:A}))}});var Kd={pointerdown:Z,pointermove:ae,pointerup:se,pointercancel:q,pointerout:q},_d={2:oe,3:he,4:we,5:Le},rr="pointerdown",ar="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(rr="MSPointerDown",ar="MSPointerMove MSPointerUp MSPointerCancel");function Ni(){this.evEl=rr,this.evWin=ar,ke.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}x(Ni,ke,{handler:function(A){var w=this.store,L=!1,B=A.type.toLowerCase().replace("ms",""),J=Kd[B],le=_d[A.pointerType]||A.pointerType,ze=le==oe,Me=R(w,A.pointerId,"pointerId");J&Z&&(A.button===0||ze)?Me<0&&(w.push(A),Me=w.length-1):J&(se|q)&&(L=!0),!(Me<0)&&(w[Me]=A,this.callback(this.manager,J,{pointers:w,changedPointers:[A],pointerType:le,srcEvent:A}),L&&w.splice(Me,1))}});var $d={touchstart:Z,touchmove:ae,touchend:se,touchcancel:q},ef="touchstart",tf="touchstart touchmove touchend touchcancel";function lr(){this.evTarget=ef,this.evWin=tf,this.started=!1,ke.apply(this,arguments)}x(lr,ke,{handler:function(A){var w=$d[A.type];if(w===Z&&(this.started=!0),!!this.started){var L=nf.call(this,A,w);w&(se|q)&&L[0].length-L[1].length===0&&(this.started=!1),this.callback(this.manager,w,{pointers:L[0],changedPointers:L[1],pointerType:oe,srcEvent:A})}}});function nf(p,A){var w=ee(p.touches),L=ee(p.changedTouches);return A&(se|q)&&(w=j(w.concat(L),"identifier",!0)),[w,L]}var of={touchstart:Z,touchmove:ae,touchend:se,touchcancel:q},sf="touchstart touchmove touchend touchcancel";function Zn(){this.evTarget=sf,this.targetIds={},ke.apply(this,arguments)}x(Zn,ke,{handler:function(A){var w=of[A.type],L=rf.call(this,A,w);!L||this.callback(this.manager,w,{pointers:L[0],changedPointers:L[1],pointerType:oe,srcEvent:A})}});function rf(p,A){var w=ee(p.touches),L=this.targetIds;if(A&(Z|ae)&&w.length===1)return L[w[0].identifier]=!0,[w,w];var B,J,le=ee(p.changedTouches),ze=[],Me=this.target;if(J=w.filter(function(Be){return E(Be.target,Me)}),A===Z)for(B=0;B<J.length;)L[J[B].identifier]=!0,B++;for(B=0;B<le.length;)L[le[B].identifier]&&ze.push(le[B]),A&(se|q)&&delete L[le[B].identifier],B++;if(!!ze.length)return[j(J.concat(ze),"identifier",!0),ze]}var af=2500,cr=25;function Bi(){ke.apply(this,arguments);var p=P(this.handler,this);this.touch=new Zn(this.manager,p),this.mouse=new Vn(this.manager,p),this.primaryTouch=null,this.lastTouches=[]}x(Bi,ke,{handler:function(A,w,L){var B=L.pointerType==oe,J=L.pointerType==we;if(!(J&&L.sourceCapabilities&&L.sourceCapabilities.firesTouchEvents)){if(B)lf.call(this,w,L);else if(J&&cf.call(this,L))return;this.callback(A,w,L)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function lf(p,A){p&Z?(this.primaryTouch=A.changedPointers[0].identifier,hr.call(this,A)):p&(se|q)&&hr.call(this,A)}function hr(p){var A=p.changedPointers[0];if(A.identifier===this.primaryTouch){var w={x:A.clientX,y:A.clientY};this.lastTouches.push(w);var L=this.lastTouches,B=function(){var J=L.indexOf(w);J>-1&&L.splice(J,1)};setTimeout(B,af)}}function cf(p){for(var A=p.srcEvent.clientX,w=p.srcEvent.clientY,L=0;L<this.lastTouches.length;L++){var B=this.lastTouches[L],J=Math.abs(A-B.x),le=Math.abs(w-B.y);if(J<=cr&&le<=cr)return!0}return!1}var ur=N(r.style,"touchAction"),dr=ur!==o,fr="compute",mr="auto",Fi="manipulation",Dt="none",nn="pan-x",on="pan-y",Jn=uf();function Gi(p,A){this.manager=p,this.set(A)}Gi.prototype={set:function(p){p==fr&&(p=this.compute()),dr&&this.manager.element.style&&Jn[p]&&(this.manager.element.style[ur]=p),this.actions=p.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var p=[];return m(this.manager.recognizers,function(A){k(A.options.enable,[A])&&(p=p.concat(A.getTouchAction()))}),hf(p.join(" "))},preventDefaults:function(p){var A=p.srcEvent,w=p.offsetDirection;if(this.manager.session.prevented){A.preventDefault();return}var L=this.actions,B=z(L,Dt)&&!Jn[Dt],J=z(L,on)&&!Jn[on],le=z(L,nn)&&!Jn[nn];if(B){var ze=p.pointers.length===1,Me=p.distance<2,Be=p.deltaTime<250;if(ze&&Me&&Be)return}if(!(le&&J)&&(B||J&&w&ve||le&&w&xe))return this.preventSrc(A)},preventSrc:function(p){this.manager.session.prevented=!0,p.preventDefault()}};function hf(p){if(z(p,Dt))return Dt;var A=z(p,nn),w=z(p,on);return A&&w?Dt:A||w?A?nn:on:z(p,Fi)?Fi:mr}function uf(){if(!dr)return!1;var p={},A=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(w){p[w]=A?t.CSS.supports("touch-action",w):!0}),p}var Un=1,Je=2,Ht=4,Pt=8,dt=Pt,sn=16,st=32;function ft(p){this.options=v({},this.defaults,p||{}),this.id=_(),this.manager=null,this.options.enable=T(this.options.enable,!0),this.state=Un,this.simultaneous={},this.requireFail=[]}ft.prototype={defaults:{},set:function(p){return v(this.options,p),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(p){if(u(p,"recognizeWith",this))return this;var A=this.simultaneous;return p=qn(p,this),A[p.id]||(A[p.id]=p,p.recognizeWith(this)),this},dropRecognizeWith:function(p){return u(p,"dropRecognizeWith",this)?this:(p=qn(p,this),delete this.simultaneous[p.id],this)},requireFailure:function(p){if(u(p,"requireFailure",this))return this;var A=this.requireFail;return p=qn(p,this),R(A,p)===-1&&(A.push(p),p.requireFailure(this)),this},dropRequireFailure:function(p){if(u(p,"dropRequireFailure",this))return this;p=qn(p,this);var A=R(this.requireFail,p);return A>-1&&this.requireFail.splice(A,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(p){return!!this.simultaneous[p.id]},emit:function(p){var A=this,w=this.state;function L(B){A.manager.emit(B,p)}w<Pt&&L(A.options.event+pr(w)),L(A.options.event),p.additionalEvent&&L(p.additionalEvent),w>=Pt&&L(A.options.event+pr(w))},tryEmit:function(p){if(this.canEmit())return this.emit(p);this.state=st},canEmit:function(){for(var p=0;p<this.requireFail.length;){if(!(this.requireFail[p].state&(st|Un)))return!1;p++}return!0},recognize:function(p){var A=v({},p);if(!k(this.options.enable,[this,A])){this.reset(),this.state=st;return}this.state&(dt|sn|st)&&(this.state=Un),this.state=this.process(A),this.state&(Je|Ht|Pt|sn)&&this.tryEmit(A)},process:function(p){},getTouchAction:function(){},reset:function(){}};function pr(p){return p&sn?"cancel":p&Pt?"end":p&Ht?"move":p&Je?"start":""}function gr(p){return p==He?"down":p==We?"up":p==Ve?"left":p==ce?"right":""}function qn(p,A){var w=A.manager;return w?w.get(p):p}function $e(){ft.apply(this,arguments)}x($e,ft,{defaults:{pointers:1},attrTest:function(p){var A=this.options.pointers;return A===0||p.pointers.length===A},process:function(p){var A=this.state,w=p.eventType,L=A&(Je|Ht),B=this.attrTest(p);return L&&(w&q||!B)?A|sn:L||B?w&se?A|Pt:A&Je?A|Ht:Je:st}});function Kn(){$e.apply(this,arguments),this.pX=null,this.pY=null}x(Kn,$e,{defaults:{event:"pan",threshold:10,pointers:1,direction:Ze},getTouchAction:function(){var p=this.options.direction,A=[];return p&ve&&A.push(on),p&xe&&A.push(nn),A},directionTest:function(p){var A=this.options,w=!0,L=p.distance,B=p.direction,J=p.deltaX,le=p.deltaY;return B&A.direction||(A.direction&ve?(B=J===0?Qe:J<0?Ve:ce,w=J!=this.pX,L=Math.abs(p.deltaX)):(B=le===0?Qe:le<0?We:He,w=le!=this.pY,L=Math.abs(p.deltaY))),p.direction=B,w&&L>A.threshold&&B&A.direction},attrTest:function(p){return $e.prototype.attrTest.call(this,p)&&(this.state&Je||!(this.state&Je)&&this.directionTest(p))},emit:function(p){this.pX=p.deltaX,this.pY=p.deltaY;var A=gr(p.direction);A&&(p.additionalEvent=this.options.event+A),this._super.emit.call(this,p)}});function Ri(){$e.apply(this,arguments)}x(Ri,$e,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Dt]},attrTest:function(p){return this._super.attrTest.call(this,p)&&(Math.abs(p.scale-1)>this.options.threshold||this.state&Je)},emit:function(p){if(p.scale!==1){var A=p.scale<1?"in":"out";p.additionalEvent=this.options.event+A}this._super.emit.call(this,p)}});function Xi(){ft.apply(this,arguments),this._timer=null,this._input=null}x(Xi,ft,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[mr]},process:function(p){var A=this.options,w=p.pointers.length===A.pointers,L=p.distance<A.threshold,B=p.deltaTime>A.time;if(this._input=p,!L||!w||p.eventType&(se|q)&&!B)this.reset();else if(p.eventType&Z)this.reset(),this._timer=f(function(){this.state=dt,this.tryEmit()},A.time,this);else if(p.eventType&se)return dt;return st},reset:function(){clearTimeout(this._timer)},emit:function(p){this.state===dt&&(p&&p.eventType&se?this.manager.emit(this.options.event+"up",p):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}});function Qi(){$e.apply(this,arguments)}x(Qi,$e,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Dt]},attrTest:function(p){return this._super.attrTest.call(this,p)&&(Math.abs(p.rotation)>this.options.threshold||this.state&Je)}});function Wi(){$e.apply(this,arguments)}x(Wi,$e,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:ve|xe,pointers:1},getTouchAction:function(){return Kn.prototype.getTouchAction.call(this)},attrTest:function(p){var A=this.options.direction,w;return A&(ve|xe)?w=p.overallVelocity:A&ve?w=p.overallVelocityX:A&xe&&(w=p.overallVelocityY),this._super.attrTest.call(this,p)&&A&p.offsetDirection&&p.distance>this.options.threshold&&p.maxPointers==this.options.pointers&&c(w)>this.options.velocity&&p.eventType&se},emit:function(p){var A=gr(p.offsetDirection);A&&this.manager.emit(this.options.event+A,p),this.manager.emit(this.options.event,p)}});function _n(){ft.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}x(_n,ft,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Fi]},process:function(p){var A=this.options,w=p.pointers.length===A.pointers,L=p.distance<A.threshold,B=p.deltaTime<A.time;if(this.reset(),p.eventType&Z&&this.count===0)return this.failTimeout();if(L&&B&&w){if(p.eventType!=se)return this.failTimeout();var J=this.pTime?p.timeStamp-this.pTime<A.interval:!0,le=!this.pCenter||Wt(this.pCenter,p.center)<A.posThreshold;this.pTime=p.timeStamp,this.pCenter=p.center,!le||!J?this.count=1:this.count+=1,this._input=p;var ze=this.count%A.taps;if(ze===0)return this.hasRequireFailures()?(this._timer=f(function(){this.state=dt,this.tryEmit()},A.interval,this),Je):dt}return st},failTimeout:function(){return this._timer=f(function(){this.state=st},this.options.interval,this),st},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==dt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function mt(p,A){return A=A||{},A.recognizers=T(A.recognizers,mt.defaults.preset),new Hi(p,A)}mt.VERSION="2.0.7",mt.defaults={domEvents:!1,touchAction:fr,enable:!0,inputTarget:null,inputClass:null,preset:[[Qi,{enable:!1}],[Ri,{enable:!1},["rotate"]],[Wi,{direction:ve}],[Kn,{direction:ve},["swipe"]],[_n],[_n,{event:"doubletap",taps:2},["tap"]],[Xi]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var df=1,vr=2;function Hi(p,A){this.options=v({},mt.defaults,A||{}),this.options.inputTarget=this.options.inputTarget||p,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=p,this.input=Ie(this),this.touchAction=new Gi(this,this.options.touchAction),br(this,!0),m(this.options.recognizers,function(w){var L=this.add(new w[0](w[1]));w[2]&&L.recognizeWith(w[2]),w[3]&&L.requireFailure(w[3])},this)}Hi.prototype={set:function(p){return v(this.options,p),p.touchAction&&this.touchAction.update(),p.inputTarget&&(this.input.destroy(),this.input.target=p.inputTarget,this.input.init()),this},stop:function(p){this.session.stopped=p?vr:df},recognize:function(p){var A=this.session;if(!A.stopped){this.touchAction.preventDefaults(p);var w,L=this.recognizers,B=A.curRecognizer;(!B||B&&B.state&dt)&&(B=A.curRecognizer=null);for(var J=0;J<L.length;)w=L[J],A.stopped!==vr&&(!B||w==B||w.canRecognizeWith(B))?w.recognize(p):w.reset(),!B&&w.state&(Je|Ht|Pt)&&(B=A.curRecognizer=w),J++}},get:function(p){if(p instanceof ft)return p;for(var A=this.recognizers,w=0;w<A.length;w++)if(A[w].options.event==p)return A[w];return null},add:function(p){if(u(p,"add",this))return this;var A=this.get(p.options.event);return A&&this.remove(A),this.recognizers.push(p),p.manager=this,this.touchAction.update(),p},remove:function(p){if(u(p,"remove",this))return this;if(p=this.get(p),p){var A=this.recognizers,w=R(A,p);w!==-1&&(A.splice(w,1),this.touchAction.update())}return this},on:function(p,A){if(p!==o&&A!==o){var w=this.handlers;return m(F(p),function(L){w[L]=w[L]||[],w[L].push(A)}),this}},off:function(p,A){if(p!==o){var w=this.handlers;return m(F(p),function(L){A?w[L]&&w[L].splice(R(w[L],A),1):delete w[L]}),this}},emit:function(p,A){this.options.domEvents&&ff(p,A);var w=this.handlers[p]&&this.handlers[p].slice();if(!(!w||!w.length)){A.type=p,A.preventDefault=function(){A.srcEvent.preventDefault()};for(var L=0;L<w.length;)w[L](A),L++}},destroy:function(){this.element&&br(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function br(p,A){var w=p.element;if(!!w.style){var L;m(p.options.cssProps,function(B,J){L=N(w.style,J),A?(p.oldCssProps[L]=w.style[L],w.style[L]=B):w.style[L]=p.oldCssProps[L]||""}),A||(p.oldCssProps={})}}function ff(p,A){var w=e.createEvent("Event");w.initEvent(p,!0,!0),w.gesture=A,A.target.dispatchEvent(w)}v(mt,{INPUT_START:Z,INPUT_MOVE:ae,INPUT_END:se,INPUT_CANCEL:q,STATE_POSSIBLE:Un,STATE_BEGAN:Je,STATE_CHANGED:Ht,STATE_ENDED:Pt,STATE_RECOGNIZED:dt,STATE_CANCELLED:sn,STATE_FAILED:st,DIRECTION_NONE:Qe,DIRECTION_LEFT:Ve,DIRECTION_RIGHT:ce,DIRECTION_UP:We,DIRECTION_DOWN:He,DIRECTION_HORIZONTAL:ve,DIRECTION_VERTICAL:xe,DIRECTION_ALL:Ze,Manager:Hi,Input:ke,TouchAction:Gi,TouchInput:Zn,MouseInput:Vn,PointerEventInput:Ni,TouchMouseInput:Bi,SingleTouchInput:lr,Recognizer:ft,AttrRecognizer:$e,Tap:_n,Pan:Kn,Swipe:Wi,Pinch:Ri,Rotate:Qi,Press:Xi,on:I,off:D,each:m,merge:y,extend:b,assign:v,inherit:x,bindFn:P,prefixed:N});var mf=typeof t<"u"?t:typeof self<"u"?self:{};mf.Hammer=mt,typeof o=="function"&&o.amd?o(function(){return mt}):i.exports?i.exports=mt:t[n]=mt})(window,document,"Hammer")})(ds);const Sn=ds.exports;function jn(i,t,e){const n=i[t];i[t]=i[e],i[e]=n}function yh(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;jn(i,a*4+0,l*4+0),jn(i,a*4+1,l*4+1),jn(i,a*4+2,l*4+2),jn(i,a*4+3,l*4+3)}}}class fs{constructor(t,e){d(this,"width");d(this,"height");d(this,"visible",!1);d(this,"hooks",new me.Subscribe);d(this,"contentDom",document.createElement("canvas"));d(this,"five");d(this,"scale");d(this,"wrapper");d(this,"config");d(this,"offset",{x:0,y:0});d(this,"canvas",this.contentDom);d(this,"context");d(this,"renderCenter",new O.Vector3);d(this,"lastPanEvent");d(this,"hammer");d(this,"onPan",t=>{var c,h,f,u;if(!this.wrapper)return;const e=(h=(c=this.lastPanEvent)==null?void 0:c.deltaX)!=null?h:0,n=(u=(f=this.lastPanEvent)==null?void 0:f.deltaY)!=null?u: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}});d(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 Sn(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 O.Vector2),a=1,l=n/t,c=o/t,h=a*t,f=(s.x+1)/2*r.x,u=(s.y+1)/2*r.y,m=this.five.getPixels(f-l/2,u-l/2,l,c,h),g=Math.floor(n*a),v=Math.floor(o*a);yh(m,g,v);const b=new ImageData(g,v);b.data.set(m),e.putImageData(b,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}}class Ph{constructor(t){d(this,"edges",[]);d(this,"five");d(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 M.Vector3),r=s.distanceTo(t.point);r<e&&(n=s,e=r)}),e>.1?null:n||null}}class Ii{constructor(){d(this,"id",lt());d(this,"points",[]);d(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 wh=1,Ih=3,xh=new M.Color(16777215),Ch=new M.Color(6522623),Eh=new M.Color(16777215),Lh=new M.Color(6522623),kh=6,Dh=8,Th="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==",ms=new M.TextureLoader().load(Th),ps={pointTexture:ms,pointSize:kh,lineWidth:wh,lineColor:xh,pointColor:Eh,lineRenderOrder:20,pointsRenderOrder:20};({...ps});const zh={pointTexture:ms,pointSize:Dh,lineWidth:Ih,lineColor:Ch,pointColor:Lh,lineRenderOrder:10,pointsRenderOrder:10};function Mh(i,t,e){var h,f,u,m,g;const n=(h=e==null?void 0:e.lineWidth)!=null?h:2,o=(f=e==null?void 0:e.lineColor)!=null?f:new M.Color(16777215),s=(u=e==null?void 0:e.pointSize)!=null?u:5,r=(m=e==null?void 0:e.lineRenderOrder)!=null?m:10,a=(g=e==null?void 0:e.lineRenderOrder)!=null?g:20,l=new Yi.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 gs(i,t){const[e,n]=i.points,o=t==="light"?zh:ps,s=Mh(e.position,n.position,o);return s.name="normalLine_"+i.id,s}function nt(i){const{x:t,y:e,z:n}=i;return!(Math.abs(t)>1||Math.abs(e)>1||Math.abs(n)>1)}function Sh(){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 jh(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 Oh(i){function t(){var g;(g=i.clickCallback)==null||g.call(i,m)}function e(){if(f)return f.highlight();c.style.border="0.5px solid #95AEFF",c.style.background="linear-gradient(90deg, #95AEFF 0%, #6386FF 100%)"}function n(){if(f)return f.unHighlight();c.style.border="0.5px solid rgba(255,255,255,0.6)",c.style.background="rgba(195,195,195,0.70)"}function o(g){const v=g.getElement();if(!v)return;const b=v.clientWidth,y=v.clientHeight;if(a.points.length<2)return;const[x,P]=a.points,k=x.position.clone().project(g.camera),T=P.position.clone().project(g.camera),I=k.clone().lerp(T,.5),D=new M.Vector2(k.x*b,k.y*y),E=new M.Vector2(T.x*b,T.y*y);if((()=>!(Math.abs(k.z)>1||Math.abs(T.z)>1||!nt(k)&&!nt(T)||!nt(I)||D.distanceTo(E)<20))()===!1){h.style.opacity="0",h.style.pointerEvents="none";return}const F=(I.x+1)/2*b,R=-(I.y-1)/2*y,j=-(Math.atan((D.y-E.y)/(D.x-E.x))*180)/Math.PI;h.style.transform=`translate(${F}px, ${R}px) rotate(${j}deg)`,h.style.opacity="1",h.style.pointerEvents="all",f&&f.update({line:a.toCompletelyJson(),polyline:a.getPolyline().toCompletelyJson()});const N=x.position.clone().distanceTo(P.position),G=i.line.model.params.getDistanceText(N);c.innerText!==G&&(c.innerText=G)}function s(g){g.appendChild(h),h.addEventListener("click",t)}function r(){c.removeEventListener("click",t),h.remove()}const{line:a}=i,l=a.id,c=Sh(),h=jh(a),f=i.userDistanceItem,u=new M.Vector3(0,0,0),m={lineID:l,ndcPosition:u,update:o,appendTo:s,remove:r,highlight:e,unHighlight:n};return f!=null&&f.element?h.appendChild(f.element):h.appendChild(c),m}class Rt{constructor(t,e,n){d(this,"id");d(this,"selected",!1);d(this,"type","line");d(this,"model");d(this,"mesh");d(this,"points");d(this,"lightMesh");d(this,"hook");d(this,"distanceItem");d(this,"polyline");if(this.id=lt(),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 me.Subscribe,this.points=[t,e],this.mesh=gs(this,"normal"),this.lightMesh=gs(this,"light"),this.distanceItem=Oh({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 Ii;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 Rt(this.points[0].clone(),this.points[1].clone(),this.model)}}function _t(i,t){for(let e=0,n=t.length;e<n;e++)if(i===t[e])return t.splice(e,1)[0]}class it{constructor(t){d(this,"id");d(this,"lines");d(this,"position");d(this,"type","point");this.id=lt(),this.lines=[],this.position=new M.Vector3,t instanceof M.Vector3?this.position.copy(t):this.position.fromArray(t)}toJson(){return{id:this.id,lines:this.lines.map(({id:t})=>t),position:this.position.toArray()}}addLine(t){this.lines.push(t)}removeLine(t){_t(t,this.lines)}clone(){return new it(this.position)}}class xi{constructor(t){d(this,"lines",[]);d(this,"points",[]);d(this,"params");d(this,"polylines",[]);d(this,"hook",new me.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 Ii;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&&_t(e,this.polylines)}const[n,o]=t.points;return n.lines.length===0&&_t(n,this.points),o.lines.length===0&&_t(o,this.points),_t(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 it(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 h=new Rt(l,c,this);return h.id=s.id,h}),o=t.polylines.map(s=>{const r=new Ii;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 On=i=>i.preventDefault();class Nn{constructor(t){d(this,"model");d(this,"five");d(this,"group");d(this,"config");d(this,"dashed");d(this,"disposed",!1);d(this,"isMobile");d(this,"mouseGroup");d(this,"container");d(this,"fiveHelper");d(this,"hook");d(this,"magnifier");d(this,"userDistanceItemCreator");d(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 Rt(new it([0,0,0]),new it([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",On),e.addEventListener("contextmenu",On))}removeLine(t){this.group.remove(t.mesh,t.lightMesh),t.distanceItem.remove(),this.five.needsRender=!0}updateMouseGroup(t,e){if(!t)return this.mouseGroup;const n=this.fiveHelper.getAdsorbentPoint(t),o=n||t.point;if(this.mouseGroup.position.copy(o),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const r=t.face.normal.clone().multiplyScalar(.05),l=t.point.clone().add(r).clone().add(r);this.mouseGroup.lookAt(l)}return this.mouseGroup}dispose(){this.disposed=!0,this.magnifier.remove(),this.model.lines.forEach(e=>this.removeLine(e));const t=this.five.getElement();t&&(t.removeEventListener("touchstart",On),t.removeEventListener("contextmenu",On))}}function Ci(i){const{x:t,y:e}=i.center,{clientWidth:n,clientHeight:o}=i.target,s=i.target.getBoundingClientRect(),r=new M.Vector2(t,e).sub(new M.Vector2(s.left,s.top)),a=new M.Vector2(r.x/n*2-1,-(r.y/o)*2+1);return{point:r,ndcPoint:a}}function Ei(i,t){const e=Ci(t).ndcPoint,n=new M.Raycaster;return n.setFromCamera(e,i.camera),i.model.intersectRaycaster(n)}class Bn extends Nn{constructor(e){var o;super(e);d(this,"type","edit");d(this,"pressPoint");d(this,"hasAppendDashed",!1);d(this,"hasAppendMouseGroup",!1);d(this,"fiveElement");d(this,"lastPoint",null);d(this,"hammer");d(this,"onIntersectionUpdate",vi((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));d(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)});d(this,"onMouseLeave",()=>{this.magnifier.remove(),this.group.remove(this.mouseGroup),this.hasAppendMouseGroup=!1,this.lastPoint&&(this.mouseGroup.position.copy(this.lastPoint.position),this.updateDashed())});d(this,"onLineChanged",()=>{this.hook.emit("editedLineChange",this.model.lines.map(e=>e.toCompletelyJson()))});d(this,"onPress",e=>{const[n]=Ei(this.five,e);if(!n||!n.face)return;const o=new it(n.point);this.pressPoint=o,this.onIntersectionUpdate(n)});d(this,"onPan",e=>{if(!this.pressPoint)return;const[n]=Ei(this.five,e);!n||!n.face||this.onIntersectionUpdate(n)});d(this,"onPanEnd",e=>{!this.pressPoint||this.onTap(e)});d(this,"onTap",e=>{this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh)),this.hasAppendDashed=!0;const[n]=Ei(this.five,e);this.updateMouseGroup(n);const o=new it(this.mouseGroup.position),s=this.lastPoint;if(o&&(this.lastPoint=o),o&&s){const r=new Rt(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)});d(this,"onWantsTapGesture",()=>!1);d(this,"onWantsToMoveToPano",()=>!1);d(this,"onWantsPanGesture",()=>this.pressPoint?!1:void 0);d(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});d(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 xi(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 Sn(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 Li(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,h;return l<0||Nh(t[0],t[1])?(c=t[0].x,h=t[0].y):l>1?(c=t[1].x,h=t[1].y):(c=t[0].x+l*o,h=t[0].y+l*s),new M.Vector2(c,h)}function Nh(i,t){return i.x===t.x&&i.y===t.y}function Fn(i){const t=(s,r,a)=>{const l=s.lines.find(h=>h.points.findIndex(({id:u})=>u===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 Bh extends Nn{constructor(e){super(e);d(this,"type","view");d(this,"highlightedLines",[]);d(this,"hammer");d(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 M.Vector2(s.x*r,s.y*a),c=this.model.lines.map(m=>{const[g,v]=m.points,b=g.position.clone().project(o),y=v.position.clone().project(o);if(!nt(b)&&!nt(y))return null;const x=new M.Vector2(b.x*r,b.y*a),P=new M.Vector2(y.x*r,y.y*a);return{id:m.id,points:[x,P]}}).filter(m=>!!m);if(c.length===0)return;const f=c.map(m=>{const g=Li(l,m.points);return{id:m.id,distance:g.distanceTo(l)}}).sort((m,g)=>m.distance-g.distance)[0],u=f.distance>20?void 0:this.model.lines.find(({id:m})=>m===f.id);if(this.highlightedLines.length>0&&!u)return this.clearHighlightLines(),!1;if(u)return this.chooseLine(u),!1});d(this,"chooseLine",e=>{const n=Fn(e);this.highlightLines(n),this.five.needsRender=!0,this.hook.emit("selectedChange",n.map(o=>o.toCompletelyJson()))});d(this,"lineRemoved",e=>{this.removeLine(e),this.hook.emit("selectedChange",this.model.lines.filter(n=>n.selected).map(n=>n.toCompletelyJson()))});d(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 Sn(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 Fh=`
|
|
212
|
+
`;return function(){var B=new Error("get-stack-trace"),J=B&&B.stack?B.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",le=t.console&&(t.console.warn||t.console.log);return le&&le.call(t.console,k,J),p.apply(this,arguments)}}var v;typeof Object.assign!="function"?v=function(A){if(A===o||A===null)throw new TypeError("Cannot convert undefined or null to object");for(var w=Object(A),k=1;k<arguments.length;k++){var B=arguments[k];if(B!==o&&B!==null)for(var J in B)B.hasOwnProperty(J)&&(w[J]=B[J])}return w}:v=Object.assign;var b=g(function(A,w,k){for(var B=Object.keys(w),J=0;J<B.length;)(!k||k&&A[B[J]]===o)&&(A[B[J]]=w[B[J]]),J++;return A},"extend","Use `assign`."),y=g(function(A,w){return b(A,w,!0)},"merge","Use `assign`.");function x(p,A,w){var k=A.prototype,B;B=p.prototype=Object.create(k),B.constructor=p,B._super=k,w&&v(B,w)}function P(p,A){return function(){return p.apply(A,arguments)}}function L(p,A){return typeof p==a?p.apply(A&&A[0]||o,A):p}function T(p,A){return p===o?A:p}function I(p,A,w){m(F(A),function(k){p.addEventListener(k,w,!1)})}function D(p,A,w){m(F(A),function(k){p.removeEventListener(k,w,!1)})}function E(p,A){for(;p;){if(p==A)return!0;p=p.parentNode}return!1}function z(p,A){return p.indexOf(A)>-1}function F(p){return p.trim().split(/\s+/g)}function R(p,A,w){if(p.indexOf&&!w)return p.indexOf(A);for(var k=0;k<p.length;){if(w&&p[k][w]==A||!w&&p[k]===A)return k;k++}return-1}function ee(p){return Array.prototype.slice.call(p,0)}function j(p,A,w){for(var k=[],B=[],J=0;J<p.length;){var le=A?p[J][A]:p[J];R(B,le)<0&&k.push(p[J]),B[J]=le,J++}return w&&(A?k=k.sort(function(Me,Be){return Me[A]>Be[A]}):k=k.sort()),k}function N(p,A){for(var w,k,B=A[0].toUpperCase()+A.slice(1),J=0;J<s.length;){if(w=s[J],k=w?w+B:A,k in p)return k;J++}return o}var G=1;function _(){return G++}function U(p){var A=p.ownerDocument||p;return A.defaultView||A.parentWindow||t}var ie=/mobile|tablet|ip(ad|hone|od)|android/i,Y="ontouchstart"in t,te=N(t,"PointerEvent")!==o,re=Y&&ie.test(navigator.userAgent),oe="touch",he="pen",we="mouse",Le="kinect",Oe=25,Z=1,ae=2,se=4,q=8,Qe=1,Ve=2,ce=4,We=8,He=16,ve=Ve|ce,xe=We|He,Ze=ve|xe,yt=["x","y"],_e=["clientX","clientY"];function ke(p,A){var w=this;this.manager=p,this.callback=A,this.element=p.element,this.target=p.options.inputTarget,this.domHandler=function(k){L(p.options.enable,[p])&&w.handler(k)},this.init()}ke.prototype={handler:function(){},init:function(){this.evEl&&I(this.element,this.evEl,this.domHandler),this.evTarget&&I(this.target,this.evTarget,this.domHandler),this.evWin&&I(U(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&D(this.element,this.evEl,this.domHandler),this.evTarget&&D(this.target,this.evTarget,this.domHandler),this.evWin&&D(U(this.element),this.evWin,this.domHandler)}};function Ie(p){var A,w=p.options.inputClass;return w?A=w:te?A=Ni:re?A=Zn:Y?A=Bi:A=Vn,new A(p,De)}function De(p,A,w){var k=w.pointers.length,B=w.changedPointers.length,J=A&Z&&k-B===0,le=A&(se|q)&&k-B===0;w.isFirst=!!J,w.isFinal=!!le,J&&(p.session={}),w.eventType=A,ut(p,w),p.emit("hammer.input",w),p.recognize(w),p.session.prevInput=w}function ut(p,A){var w=p.session,k=A.pointers,B=k.length;w.firstInput||(w.firstInput=en(A)),B>1&&!w.firstMultiple?w.firstMultiple=en(A):B===1&&(w.firstMultiple=!1);var J=w.firstInput,le=w.firstMultiple,ze=le?le.center:J.center,Me=A.center=Wn(k);A.timeStamp=h(),A.deltaTime=A.timeStamp-J.timeStamp,A.angle=tn(ze,Me),A.distance=Wt(ze,Me),Qt(w,A),A.offsetDirection=Yn(A.deltaX,A.deltaY);var Be=Hn(A.deltaTime,A.deltaX,A.deltaY);A.overallVelocityX=Be.x,A.overallVelocityY=Be.y,A.overallVelocity=c(Be.x)>c(Be.y)?Be.x:Be.y,A.scale=le?Zd(le.pointers,k):1,A.rotation=le?Vd(le.pointers,k):0,A.maxPointers=w.prevInput?A.pointers.length>w.prevInput.maxPointers?A.pointers.length:w.prevInput.maxPointers:A.pointers.length,Oi(w,A);var rt=p.element;E(A.srcEvent.target,rt)&&(rt=A.srcEvent.target),A.target=rt}function Qt(p,A){var w=A.center,k=p.offsetDelta||{},B=p.prevDelta||{},J=p.prevInput||{};(A.eventType===Z||J.eventType===se)&&(B=p.prevDelta={x:J.deltaX||0,y:J.deltaY||0},k=p.offsetDelta={x:w.x,y:w.y}),A.deltaX=B.x+(w.x-k.x),A.deltaY=B.y+(w.y-k.y)}function Oi(p,A){var w=p.lastInterval||A,k=A.timeStamp-w.timeStamp,B,J,le,ze;if(A.eventType!=q&&(k>Oe||w.velocity===o)){var Me=A.deltaX-w.deltaX,Be=A.deltaY-w.deltaY,rt=Hn(k,Me,Be);J=rt.x,le=rt.y,B=c(rt.x)>c(rt.y)?rt.x:rt.y,ze=Yn(Me,Be),p.lastInterval=A}else B=w.velocity,J=w.velocityX,le=w.velocityY,ze=w.direction;A.velocity=B,A.velocityX=J,A.velocityY=le,A.direction=ze}function en(p){for(var A=[],w=0;w<p.pointers.length;)A[w]={clientX:l(p.pointers[w].clientX),clientY:l(p.pointers[w].clientY)},w++;return{timeStamp:h(),pointers:A,center:Wn(A),deltaX:p.deltaX,deltaY:p.deltaY}}function Wn(p){var A=p.length;if(A===1)return{x:l(p[0].clientX),y:l(p[0].clientY)};for(var w=0,k=0,B=0;B<A;)w+=p[B].clientX,k+=p[B].clientY,B++;return{x:l(w/A),y:l(k/A)}}function Hn(p,A,w){return{x:A/p||0,y:w/p||0}}function Yn(p,A){return p===A?Qe:c(p)>=c(A)?p<0?Ve:ce:A<0?We:He}function Wt(p,A,w){w||(w=yt);var k=A[w[0]]-p[w[0]],B=A[w[1]]-p[w[1]];return Math.sqrt(k*k+B*B)}function tn(p,A,w){w||(w=yt);var k=A[w[0]]-p[w[0]],B=A[w[1]]-p[w[1]];return Math.atan2(B,k)*180/Math.PI}function Vd(p,A){return tn(A[1],A[0],_e)+tn(p[1],p[0],_e)}function Zd(p,A){return Wt(A[0],A[1],_e)/Wt(p[0],p[1],_e)}var Jd={mousedown:Z,mousemove:ae,mouseup:se},Ud="mousedown",qd="mousemove mouseup";function Vn(){this.evEl=Ud,this.evWin=qd,this.pressed=!1,ke.apply(this,arguments)}x(Vn,ke,{handler:function(A){var w=Jd[A.type];w&Z&&A.button===0&&(this.pressed=!0),w&ae&&A.which!==1&&(w=se),this.pressed&&(w&se&&(this.pressed=!1),this.callback(this.manager,w,{pointers:[A],changedPointers:[A],pointerType:we,srcEvent:A}))}});var Kd={pointerdown:Z,pointermove:ae,pointerup:se,pointercancel:q,pointerout:q},_d={2:oe,3:he,4:we,5:Le},rr="pointerdown",ar="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(rr="MSPointerDown",ar="MSPointerMove MSPointerUp MSPointerCancel");function Ni(){this.evEl=rr,this.evWin=ar,ke.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}x(Ni,ke,{handler:function(A){var w=this.store,k=!1,B=A.type.toLowerCase().replace("ms",""),J=Kd[B],le=_d[A.pointerType]||A.pointerType,ze=le==oe,Me=R(w,A.pointerId,"pointerId");J&Z&&(A.button===0||ze)?Me<0&&(w.push(A),Me=w.length-1):J&(se|q)&&(k=!0),!(Me<0)&&(w[Me]=A,this.callback(this.manager,J,{pointers:w,changedPointers:[A],pointerType:le,srcEvent:A}),k&&w.splice(Me,1))}});var $d={touchstart:Z,touchmove:ae,touchend:se,touchcancel:q},ef="touchstart",tf="touchstart touchmove touchend touchcancel";function lr(){this.evTarget=ef,this.evWin=tf,this.started=!1,ke.apply(this,arguments)}x(lr,ke,{handler:function(A){var w=$d[A.type];if(w===Z&&(this.started=!0),!!this.started){var k=nf.call(this,A,w);w&(se|q)&&k[0].length-k[1].length===0&&(this.started=!1),this.callback(this.manager,w,{pointers:k[0],changedPointers:k[1],pointerType:oe,srcEvent:A})}}});function nf(p,A){var w=ee(p.touches),k=ee(p.changedTouches);return A&(se|q)&&(w=j(w.concat(k),"identifier",!0)),[w,k]}var of={touchstart:Z,touchmove:ae,touchend:se,touchcancel:q},sf="touchstart touchmove touchend touchcancel";function Zn(){this.evTarget=sf,this.targetIds={},ke.apply(this,arguments)}x(Zn,ke,{handler:function(A){var w=of[A.type],k=rf.call(this,A,w);!k||this.callback(this.manager,w,{pointers:k[0],changedPointers:k[1],pointerType:oe,srcEvent:A})}});function rf(p,A){var w=ee(p.touches),k=this.targetIds;if(A&(Z|ae)&&w.length===1)return k[w[0].identifier]=!0,[w,w];var B,J,le=ee(p.changedTouches),ze=[],Me=this.target;if(J=w.filter(function(Be){return E(Be.target,Me)}),A===Z)for(B=0;B<J.length;)k[J[B].identifier]=!0,B++;for(B=0;B<le.length;)k[le[B].identifier]&&ze.push(le[B]),A&(se|q)&&delete k[le[B].identifier],B++;if(!!ze.length)return[j(J.concat(ze),"identifier",!0),ze]}var af=2500,cr=25;function Bi(){ke.apply(this,arguments);var p=P(this.handler,this);this.touch=new Zn(this.manager,p),this.mouse=new Vn(this.manager,p),this.primaryTouch=null,this.lastTouches=[]}x(Bi,ke,{handler:function(A,w,k){var B=k.pointerType==oe,J=k.pointerType==we;if(!(J&&k.sourceCapabilities&&k.sourceCapabilities.firesTouchEvents)){if(B)lf.call(this,w,k);else if(J&&cf.call(this,k))return;this.callback(A,w,k)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function lf(p,A){p&Z?(this.primaryTouch=A.changedPointers[0].identifier,hr.call(this,A)):p&(se|q)&&hr.call(this,A)}function hr(p){var A=p.changedPointers[0];if(A.identifier===this.primaryTouch){var w={x:A.clientX,y:A.clientY};this.lastTouches.push(w);var k=this.lastTouches,B=function(){var J=k.indexOf(w);J>-1&&k.splice(J,1)};setTimeout(B,af)}}function cf(p){for(var A=p.srcEvent.clientX,w=p.srcEvent.clientY,k=0;k<this.lastTouches.length;k++){var B=this.lastTouches[k],J=Math.abs(A-B.x),le=Math.abs(w-B.y);if(J<=cr&&le<=cr)return!0}return!1}var ur=N(r.style,"touchAction"),dr=ur!==o,fr="compute",mr="auto",Fi="manipulation",Dt="none",nn="pan-x",on="pan-y",Jn=uf();function Gi(p,A){this.manager=p,this.set(A)}Gi.prototype={set:function(p){p==fr&&(p=this.compute()),dr&&this.manager.element.style&&Jn[p]&&(this.manager.element.style[ur]=p),this.actions=p.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var p=[];return m(this.manager.recognizers,function(A){L(A.options.enable,[A])&&(p=p.concat(A.getTouchAction()))}),hf(p.join(" "))},preventDefaults:function(p){var A=p.srcEvent,w=p.offsetDirection;if(this.manager.session.prevented){A.preventDefault();return}var k=this.actions,B=z(k,Dt)&&!Jn[Dt],J=z(k,on)&&!Jn[on],le=z(k,nn)&&!Jn[nn];if(B){var ze=p.pointers.length===1,Me=p.distance<2,Be=p.deltaTime<250;if(ze&&Me&&Be)return}if(!(le&&J)&&(B||J&&w&ve||le&&w&xe))return this.preventSrc(A)},preventSrc:function(p){this.manager.session.prevented=!0,p.preventDefault()}};function hf(p){if(z(p,Dt))return Dt;var A=z(p,nn),w=z(p,on);return A&&w?Dt:A||w?A?nn:on:z(p,Fi)?Fi:mr}function uf(){if(!dr)return!1;var p={},A=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(w){p[w]=A?t.CSS.supports("touch-action",w):!0}),p}var Un=1,Je=2,Ht=4,Pt=8,dt=Pt,sn=16,st=32;function ft(p){this.options=v({},this.defaults,p||{}),this.id=_(),this.manager=null,this.options.enable=T(this.options.enable,!0),this.state=Un,this.simultaneous={},this.requireFail=[]}ft.prototype={defaults:{},set:function(p){return v(this.options,p),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(p){if(u(p,"recognizeWith",this))return this;var A=this.simultaneous;return p=qn(p,this),A[p.id]||(A[p.id]=p,p.recognizeWith(this)),this},dropRecognizeWith:function(p){return u(p,"dropRecognizeWith",this)?this:(p=qn(p,this),delete this.simultaneous[p.id],this)},requireFailure:function(p){if(u(p,"requireFailure",this))return this;var A=this.requireFail;return p=qn(p,this),R(A,p)===-1&&(A.push(p),p.requireFailure(this)),this},dropRequireFailure:function(p){if(u(p,"dropRequireFailure",this))return this;p=qn(p,this);var A=R(this.requireFail,p);return A>-1&&this.requireFail.splice(A,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(p){return!!this.simultaneous[p.id]},emit:function(p){var A=this,w=this.state;function k(B){A.manager.emit(B,p)}w<Pt&&k(A.options.event+pr(w)),k(A.options.event),p.additionalEvent&&k(p.additionalEvent),w>=Pt&&k(A.options.event+pr(w))},tryEmit:function(p){if(this.canEmit())return this.emit(p);this.state=st},canEmit:function(){for(var p=0;p<this.requireFail.length;){if(!(this.requireFail[p].state&(st|Un)))return!1;p++}return!0},recognize:function(p){var A=v({},p);if(!L(this.options.enable,[this,A])){this.reset(),this.state=st;return}this.state&(dt|sn|st)&&(this.state=Un),this.state=this.process(A),this.state&(Je|Ht|Pt|sn)&&this.tryEmit(A)},process:function(p){},getTouchAction:function(){},reset:function(){}};function pr(p){return p&sn?"cancel":p&Pt?"end":p&Ht?"move":p&Je?"start":""}function gr(p){return p==He?"down":p==We?"up":p==Ve?"left":p==ce?"right":""}function qn(p,A){var w=A.manager;return w?w.get(p):p}function $e(){ft.apply(this,arguments)}x($e,ft,{defaults:{pointers:1},attrTest:function(p){var A=this.options.pointers;return A===0||p.pointers.length===A},process:function(p){var A=this.state,w=p.eventType,k=A&(Je|Ht),B=this.attrTest(p);return k&&(w&q||!B)?A|sn:k||B?w&se?A|Pt:A&Je?A|Ht:Je:st}});function Kn(){$e.apply(this,arguments),this.pX=null,this.pY=null}x(Kn,$e,{defaults:{event:"pan",threshold:10,pointers:1,direction:Ze},getTouchAction:function(){var p=this.options.direction,A=[];return p&ve&&A.push(on),p&xe&&A.push(nn),A},directionTest:function(p){var A=this.options,w=!0,k=p.distance,B=p.direction,J=p.deltaX,le=p.deltaY;return B&A.direction||(A.direction&ve?(B=J===0?Qe:J<0?Ve:ce,w=J!=this.pX,k=Math.abs(p.deltaX)):(B=le===0?Qe:le<0?We:He,w=le!=this.pY,k=Math.abs(p.deltaY))),p.direction=B,w&&k>A.threshold&&B&A.direction},attrTest:function(p){return $e.prototype.attrTest.call(this,p)&&(this.state&Je||!(this.state&Je)&&this.directionTest(p))},emit:function(p){this.pX=p.deltaX,this.pY=p.deltaY;var A=gr(p.direction);A&&(p.additionalEvent=this.options.event+A),this._super.emit.call(this,p)}});function Ri(){$e.apply(this,arguments)}x(Ri,$e,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Dt]},attrTest:function(p){return this._super.attrTest.call(this,p)&&(Math.abs(p.scale-1)>this.options.threshold||this.state&Je)},emit:function(p){if(p.scale!==1){var A=p.scale<1?"in":"out";p.additionalEvent=this.options.event+A}this._super.emit.call(this,p)}});function Xi(){ft.apply(this,arguments),this._timer=null,this._input=null}x(Xi,ft,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[mr]},process:function(p){var A=this.options,w=p.pointers.length===A.pointers,k=p.distance<A.threshold,B=p.deltaTime>A.time;if(this._input=p,!k||!w||p.eventType&(se|q)&&!B)this.reset();else if(p.eventType&Z)this.reset(),this._timer=f(function(){this.state=dt,this.tryEmit()},A.time,this);else if(p.eventType&se)return dt;return st},reset:function(){clearTimeout(this._timer)},emit:function(p){this.state===dt&&(p&&p.eventType&se?this.manager.emit(this.options.event+"up",p):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}});function Qi(){$e.apply(this,arguments)}x(Qi,$e,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Dt]},attrTest:function(p){return this._super.attrTest.call(this,p)&&(Math.abs(p.rotation)>this.options.threshold||this.state&Je)}});function Wi(){$e.apply(this,arguments)}x(Wi,$e,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:ve|xe,pointers:1},getTouchAction:function(){return Kn.prototype.getTouchAction.call(this)},attrTest:function(p){var A=this.options.direction,w;return A&(ve|xe)?w=p.overallVelocity:A&ve?w=p.overallVelocityX:A&xe&&(w=p.overallVelocityY),this._super.attrTest.call(this,p)&&A&p.offsetDirection&&p.distance>this.options.threshold&&p.maxPointers==this.options.pointers&&c(w)>this.options.velocity&&p.eventType&se},emit:function(p){var A=gr(p.offsetDirection);A&&this.manager.emit(this.options.event+A,p),this.manager.emit(this.options.event,p)}});function _n(){ft.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}x(_n,ft,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Fi]},process:function(p){var A=this.options,w=p.pointers.length===A.pointers,k=p.distance<A.threshold,B=p.deltaTime<A.time;if(this.reset(),p.eventType&Z&&this.count===0)return this.failTimeout();if(k&&B&&w){if(p.eventType!=se)return this.failTimeout();var J=this.pTime?p.timeStamp-this.pTime<A.interval:!0,le=!this.pCenter||Wt(this.pCenter,p.center)<A.posThreshold;this.pTime=p.timeStamp,this.pCenter=p.center,!le||!J?this.count=1:this.count+=1,this._input=p;var ze=this.count%A.taps;if(ze===0)return this.hasRequireFailures()?(this._timer=f(function(){this.state=dt,this.tryEmit()},A.interval,this),Je):dt}return st},failTimeout:function(){return this._timer=f(function(){this.state=st},this.options.interval,this),st},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==dt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function mt(p,A){return A=A||{},A.recognizers=T(A.recognizers,mt.defaults.preset),new Hi(p,A)}mt.VERSION="2.0.7",mt.defaults={domEvents:!1,touchAction:fr,enable:!0,inputTarget:null,inputClass:null,preset:[[Qi,{enable:!1}],[Ri,{enable:!1},["rotate"]],[Wi,{direction:ve}],[Kn,{direction:ve},["swipe"]],[_n],[_n,{event:"doubletap",taps:2},["tap"]],[Xi]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var df=1,vr=2;function Hi(p,A){this.options=v({},mt.defaults,A||{}),this.options.inputTarget=this.options.inputTarget||p,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=p,this.input=Ie(this),this.touchAction=new Gi(this,this.options.touchAction),br(this,!0),m(this.options.recognizers,function(w){var k=this.add(new w[0](w[1]));w[2]&&k.recognizeWith(w[2]),w[3]&&k.requireFailure(w[3])},this)}Hi.prototype={set:function(p){return v(this.options,p),p.touchAction&&this.touchAction.update(),p.inputTarget&&(this.input.destroy(),this.input.target=p.inputTarget,this.input.init()),this},stop:function(p){this.session.stopped=p?vr:df},recognize:function(p){var A=this.session;if(!A.stopped){this.touchAction.preventDefaults(p);var w,k=this.recognizers,B=A.curRecognizer;(!B||B&&B.state&dt)&&(B=A.curRecognizer=null);for(var J=0;J<k.length;)w=k[J],A.stopped!==vr&&(!B||w==B||w.canRecognizeWith(B))?w.recognize(p):w.reset(),!B&&w.state&(Je|Ht|Pt)&&(B=A.curRecognizer=w),J++}},get:function(p){if(p instanceof ft)return p;for(var A=this.recognizers,w=0;w<A.length;w++)if(A[w].options.event==p)return A[w];return null},add:function(p){if(u(p,"add",this))return this;var A=this.get(p.options.event);return A&&this.remove(A),this.recognizers.push(p),p.manager=this,this.touchAction.update(),p},remove:function(p){if(u(p,"remove",this))return this;if(p=this.get(p),p){var A=this.recognizers,w=R(A,p);w!==-1&&(A.splice(w,1),this.touchAction.update())}return this},on:function(p,A){if(p!==o&&A!==o){var w=this.handlers;return m(F(p),function(k){w[k]=w[k]||[],w[k].push(A)}),this}},off:function(p,A){if(p!==o){var w=this.handlers;return m(F(p),function(k){A?w[k]&&w[k].splice(R(w[k],A),1):delete w[k]}),this}},emit:function(p,A){this.options.domEvents&&ff(p,A);var w=this.handlers[p]&&this.handlers[p].slice();if(!(!w||!w.length)){A.type=p,A.preventDefault=function(){A.srcEvent.preventDefault()};for(var k=0;k<w.length;)w[k](A),k++}},destroy:function(){this.element&&br(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function br(p,A){var w=p.element;if(!!w.style){var k;m(p.options.cssProps,function(B,J){k=N(w.style,J),A?(p.oldCssProps[k]=w.style[k],w.style[k]=B):w.style[k]=p.oldCssProps[k]||""}),A||(p.oldCssProps={})}}function ff(p,A){var w=e.createEvent("Event");w.initEvent(p,!0,!0),w.gesture=A,A.target.dispatchEvent(w)}v(mt,{INPUT_START:Z,INPUT_MOVE:ae,INPUT_END:se,INPUT_CANCEL:q,STATE_POSSIBLE:Un,STATE_BEGAN:Je,STATE_CHANGED:Ht,STATE_ENDED:Pt,STATE_RECOGNIZED:dt,STATE_CANCELLED:sn,STATE_FAILED:st,DIRECTION_NONE:Qe,DIRECTION_LEFT:Ve,DIRECTION_RIGHT:ce,DIRECTION_UP:We,DIRECTION_DOWN:He,DIRECTION_HORIZONTAL:ve,DIRECTION_VERTICAL:xe,DIRECTION_ALL:Ze,Manager:Hi,Input:ke,TouchAction:Gi,TouchInput:Zn,MouseInput:Vn,PointerEventInput:Ni,TouchMouseInput:Bi,SingleTouchInput:lr,Recognizer:ft,AttrRecognizer:$e,Tap:_n,Pan:Kn,Swipe:Wi,Pinch:Ri,Rotate:Qi,Press:Xi,on:I,off:D,each:m,merge:y,extend:b,assign:v,inherit:x,bindFn:P,prefixed:N});var mf=typeof t<"u"?t:typeof self<"u"?self:{};mf.Hammer=mt,typeof o=="function"&&o.amd?o(function(){return mt}):i.exports?i.exports=mt:t[n]=mt})(window,document,"Hammer")})(ds);const Sn=ds.exports;function jn(i,t,e){const n=i[t];i[t]=i[e],i[e]=n}function yh(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;jn(i,a*4+0,l*4+0),jn(i,a*4+1,l*4+1),jn(i,a*4+2,l*4+2),jn(i,a*4+3,l*4+3)}}}class fs{constructor(t,e){d(this,"width");d(this,"height");d(this,"visible",!1);d(this,"hooks",new me.Subscribe);d(this,"contentDom",document.createElement("canvas"));d(this,"five");d(this,"scale");d(this,"wrapper");d(this,"config");d(this,"offset",{x:0,y:0});d(this,"canvas",this.contentDom);d(this,"context");d(this,"renderCenter",new O.Vector3);d(this,"lastPanEvent");d(this,"hammer");d(this,"onPan",t=>{var c,h,f,u;if(!this.wrapper)return;const e=(h=(c=this.lastPanEvent)==null?void 0:c.deltaX)!=null?h:0,n=(u=(f=this.lastPanEvent)==null?void 0:f.deltaY)!=null?u: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}});d(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 Sn(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 O.Vector2),a=1,l=n/t,c=o/t,h=a*t,f=(s.x+1)/2*r.x,u=(s.y+1)/2*r.y,m=this.five.getPixels(f-l/2,u-l/2,l,c,h),g=Math.floor(n*a),v=Math.floor(o*a);yh(m,g,v);const b=new ImageData(g,v);b.data.set(m),e.putImageData(b,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}}class Ph{constructor(t){d(this,"edges",[]);d(this,"five");d(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 M.Vector3),r=s.distanceTo(t.point);r<e&&(n=s,e=r)}),e>.1?null:n||null}}class Ii{constructor(){d(this,"id",lt());d(this,"points",[]);d(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 wh=1,Ih=3,xh=new M.Color(16777215),Ch=new M.Color(6522623),Eh=new M.Color(16777215),Lh=new M.Color(6522623),kh=6,Dh=8,Th="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==",ms=new M.TextureLoader().load(Th),ps={pointTexture:ms,pointSize:kh,lineWidth:wh,lineColor:xh,pointColor:Eh,lineRenderOrder:20,pointsRenderOrder:20};({...ps});const zh={pointTexture:ms,pointSize:Dh,lineWidth:Ih,lineColor:Ch,pointColor:Lh,lineRenderOrder:10,pointsRenderOrder:10};function Mh(i,t,e){var h,f,u,m,g;const n=(h=e==null?void 0:e.lineWidth)!=null?h:2,o=(f=e==null?void 0:e.lineColor)!=null?f:new M.Color(16777215),s=(u=e==null?void 0:e.pointSize)!=null?u:5,r=(m=e==null?void 0:e.lineRenderOrder)!=null?m:10,a=(g=e==null?void 0:e.lineRenderOrder)!=null?g:20,l=new Yi.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 gs(i,t){const[e,n]=i.points,o=t==="light"?zh:ps,s=Mh(e.position,n.position,o);return s.name="normalLine_"+i.id,s}function nt(i){const{x:t,y:e,z:n}=i;return!(Math.abs(t)>1||Math.abs(e)>1||Math.abs(n)>1)}function Sh(){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 jh(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 Oh(i){function t(){var g;(g=i.clickCallback)==null||g.call(i,m)}function e(){if(f)return f.highlight();c.style.border="0.5px solid #95AEFF",c.style.background="linear-gradient(90deg, #95AEFF 0%, #6386FF 100%)"}function n(){if(f)return f.unHighlight();c.style.border="0.5px solid rgba(255,255,255,0.6)",c.style.background="rgba(195,195,195,0.70)"}function o(g){const v=g.getElement();if(!v)return;const b=v.clientWidth,y=v.clientHeight;if(a.points.length<2)return;const[x,P]=a.points,L=x.position.clone().project(g.camera),T=P.position.clone().project(g.camera),I=L.clone().lerp(T,.5),D=new M.Vector2(L.x*b,L.y*y),E=new M.Vector2(T.x*b,T.y*y);if((()=>!(Math.abs(L.z)>1||Math.abs(T.z)>1||!nt(L)&&!nt(T)||!nt(I)||D.distanceTo(E)<20))()===!1){h.style.opacity="0",h.style.pointerEvents="none";return}const F=(I.x+1)/2*b,R=-(I.y-1)/2*y,j=-(Math.atan((D.y-E.y)/(D.x-E.x))*180)/Math.PI;h.style.transform=`translate(${F}px, ${R}px) rotate(${j}deg)`,h.style.opacity="1",h.style.pointerEvents="all",f&&f.update({line:a.toCompletelyJson(),polyline:a.getPolyline().toCompletelyJson()});const N=x.position.clone().distanceTo(P.position),G=i.line.model.params.getDistanceText(N);c.innerText!==G&&(c.innerText=G)}function s(g){g.appendChild(h),h.addEventListener("click",t)}function r(){c.removeEventListener("click",t),h.remove()}const{line:a}=i,l=a.id,c=Sh(),h=jh(a),f=i.userDistanceItem,u=new M.Vector3(0,0,0),m={lineID:l,ndcPosition:u,update:o,appendTo:s,remove:r,highlight:e,unHighlight:n};return f!=null&&f.element?h.appendChild(f.element):h.appendChild(c),m}class Rt{constructor(t,e,n){d(this,"id");d(this,"selected",!1);d(this,"type","line");d(this,"model");d(this,"mesh");d(this,"points");d(this,"lightMesh");d(this,"hook");d(this,"distanceItem");d(this,"polyline");if(this.id=lt(),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 me.Subscribe,this.points=[t,e],this.mesh=gs(this,"normal"),this.lightMesh=gs(this,"light"),this.distanceItem=Oh({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 Ii;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 Rt(this.points[0].clone(),this.points[1].clone(),this.model)}}function _t(i,t){for(let e=0,n=t.length;e<n;e++)if(i===t[e])return t.splice(e,1)[0]}class it{constructor(t){d(this,"id");d(this,"lines");d(this,"position");d(this,"type","point");this.id=lt(),this.lines=[],this.position=new M.Vector3,t instanceof M.Vector3?this.position.copy(t):this.position.fromArray(t)}toJson(){return{id:this.id,lines:this.lines.map(({id:t})=>t),position:this.position.toArray()}}addLine(t){this.lines.push(t)}removeLine(t){_t(t,this.lines)}clone(){return new it(this.position)}}class xi{constructor(t){d(this,"lines",[]);d(this,"points",[]);d(this,"params");d(this,"polylines",[]);d(this,"hook",new me.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 Ii;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&&_t(e,this.polylines)}const[n,o]=t.points;return n.lines.length===0&&_t(n,this.points),o.lines.length===0&&_t(o,this.points),_t(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 it(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 h=new Rt(l,c,this);return h.id=s.id,h}),o=t.polylines.map(s=>{const r=new Ii;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 On=i=>i.preventDefault();class Nn{constructor(t){d(this,"model");d(this,"five");d(this,"group");d(this,"config");d(this,"dashed");d(this,"disposed",!1);d(this,"isMobile");d(this,"mouseGroup");d(this,"container");d(this,"fiveHelper");d(this,"hook");d(this,"magnifier");d(this,"userDistanceItemCreator");d(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 Rt(new it([0,0,0]),new it([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",On),e.addEventListener("contextmenu",On))}removeLine(t){this.group.remove(t.mesh,t.lightMesh),t.distanceItem.remove(),this.five.needsRender=!0}updateMouseGroup(t,e){if(!t)return this.mouseGroup;const n=this.fiveHelper.getAdsorbentPoint(t),o=n||t.point;if(this.mouseGroup.position.copy(o),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const r=t.face.normal.clone().multiplyScalar(.05),l=t.point.clone().add(r).clone().add(r);this.mouseGroup.lookAt(l)}return this.mouseGroup}dispose(){this.disposed=!0,this.magnifier.remove(),this.model.lines.forEach(e=>this.removeLine(e));const t=this.five.getElement();t&&(t.removeEventListener("touchstart",On),t.removeEventListener("contextmenu",On))}}function Ci(i){const{x:t,y:e}=i.center,{clientWidth:n,clientHeight:o}=i.target,s=i.target.getBoundingClientRect(),r=new M.Vector2(t,e).sub(new M.Vector2(s.left,s.top)),a=new M.Vector2(r.x/n*2-1,-(r.y/o)*2+1);return{point:r,ndcPoint:a}}function Ei(i,t){const e=Ci(t).ndcPoint,n=new M.Raycaster;return n.setFromCamera(e,i.camera),i.model.intersectRaycaster(n)}class Bn extends Nn{constructor(e){var o;super(e);d(this,"type","edit");d(this,"pressPoint");d(this,"hasAppendDashed",!1);d(this,"hasAppendMouseGroup",!1);d(this,"fiveElement");d(this,"lastPoint",null);d(this,"hammer");d(this,"onIntersectionUpdate",vi((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));d(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)});d(this,"onMouseLeave",()=>{this.magnifier.remove(),this.group.remove(this.mouseGroup),this.hasAppendMouseGroup=!1,this.lastPoint&&(this.mouseGroup.position.copy(this.lastPoint.position),this.updateDashed())});d(this,"onLineChanged",()=>{this.hook.emit("editedLineChange",this.model.lines.map(e=>e.toCompletelyJson()))});d(this,"onPress",e=>{const[n]=Ei(this.five,e);if(!n||!n.face)return;const o=new it(n.point);this.pressPoint=o,this.onIntersectionUpdate(n)});d(this,"onPan",e=>{if(!this.pressPoint)return;const[n]=Ei(this.five,e);!n||!n.face||this.onIntersectionUpdate(n)});d(this,"onPanEnd",e=>{!this.pressPoint||this.onTap(e)});d(this,"onTap",e=>{this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh)),this.hasAppendDashed=!0;const[n]=Ei(this.five,e);this.updateMouseGroup(n);const o=new it(this.mouseGroup.position),s=this.lastPoint;if(o&&(this.lastPoint=o),o&&s){const r=new Rt(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)});d(this,"onWantsTapGesture",()=>!1);d(this,"onWantsToMoveToPano",()=>!1);d(this,"onWantsPanGesture",()=>this.pressPoint?!1:void 0);d(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});d(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 xi(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 Sn(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 Li(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,h;return l<0||Nh(t[0],t[1])?(c=t[0].x,h=t[0].y):l>1?(c=t[1].x,h=t[1].y):(c=t[0].x+l*o,h=t[0].y+l*s),new M.Vector2(c,h)}function Nh(i,t){return i.x===t.x&&i.y===t.y}function Fn(i){const t=(s,r,a)=>{const l=s.lines.find(h=>h.points.findIndex(({id:u})=>u===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 Bh extends Nn{constructor(e){super(e);d(this,"type","view");d(this,"highlightedLines",[]);d(this,"hammer");d(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 M.Vector2(s.x*r,s.y*a),c=this.model.lines.map(m=>{const[g,v]=m.points,b=g.position.clone().project(o),y=v.position.clone().project(o);if(!nt(b)&&!nt(y))return null;const x=new M.Vector2(b.x*r,b.y*a),P=new M.Vector2(y.x*r,y.y*a);return{id:m.id,points:[x,P]}}).filter(m=>!!m);if(c.length===0)return;const f=c.map(m=>{const g=Li(l,m.points);return{id:m.id,distance:g.distanceTo(l)}}).sort((m,g)=>m.distance-g.distance)[0],u=f.distance>20?void 0:this.model.lines.find(({id:m})=>m===f.id);if(this.highlightedLines.length>0&&!u)return this.clearHighlightLines(),!1;if(u)return this.chooseLine(u),!1});d(this,"chooseLine",e=>{const n=Fn(e);this.highlightLines(n),this.five.needsRender=!0,this.hook.emit("selectedChange",n.map(o=>o.toCompletelyJson()))});d(this,"lineRemoved",e=>{this.removeLine(e),this.hook.emit("selectedChange",this.model.lines.filter(n=>n.selected).map(n=>n.toCompletelyJson()))});d(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 Sn(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 Fh=`
|
|
213
213
|
<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">
|
|
214
214
|
<defs>
|
|
215
215
|
<linearGradient x1="22.185491%" y1="100%" x2="66.8316686%" y2="6.67239121%" id="linearGradient-1">
|
|
@@ -498,7 +498,7 @@ void main() {
|
|
|
498
498
|
<div class='range-piece__content'></div>
|
|
499
499
|
<div class="range-piece__aim"></div>
|
|
500
500
|
</div>
|
|
501
|
-
`;function ru(){}const{Vector2:au}=O;function lu(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return Object.assign(new au,{x:(i.x-s)/e*2-1,y:-(i.y-o)/n*2+1})}class cu{constructor(t){d(this,"container",document.createElement("div"));d(this,"five");d(this,"group");d(this,"mouseGroup");d(this,"hasAppendMouseGroup",!1);d(this,"fiveHelper");d(this,"hook");d(this,"content");d(this,"intersectMesh");d(this,"centerMouseXY");d(this,"raycaster",new M.Raycaster);d(this,"pieceStyl",{matrix3d:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],scale:1,opacity:.4});d(this,"onCameraDirectionUpdate",()=>{const t=this.getIntersection();if(t){this.pieceChange(t),this.updateMouseGroup(t);const e=new it(this.mouseGroup.position);this.hook.emit("nowPointChange",e)}});d(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 it(n)):this.hook.emit("getEndPoint",new it(n)))});d(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=lu({x:r,y:a},this.five.getElement());this.centerMouseXY=c});d(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=ys({isMobile:!0,...t.openParams.crossHairParameter}),this.fiveHelper=t.fiveHelper,this.container.innerHTML=su,this.container.classList.add("range-piece-controller"),this.content=this.container.querySelector(".range-piece__content"),this.content&&(this.content.style.transform=`matrix3d(${this.pieceStyl.matrix3d.toString()}) scale(${this.pieceStyl.scale})`,this.content.style.opacity=`${this.pieceStyl.opacity}`),t.container.append(this.container),this.intersectMesh=new M.Mesh(new M.RingGeometry(.04,.08,32),new M.MeshBasicMaterial({color:1245179,opacity:0,side:M.DoubleSide,transparent:!0})),this.container.addEventListener("animationend",this.computedCenterMouseXY),this.five.on("cameraUpdate",this.onCameraDirectionUpdate),this.hook.on("willChangeState",this.onWillChangeState)}dispose(){this.container.removeEventListener("animationend",this.computedCenterMouseXY),this.five.off("cameraUpdate",this.onCameraDirectionUpdate),this.hook.off("willChangeState",this.onWillChangeState),this.container.remove(),this.group.remove(this.mouseGroup),this.mouseGroup.remove(),this.hasAppendMouseGroup=!1,this.five.scene.remove(this.intersectMesh)}pieceChange(t){const e=t.face,n=t.point;if(e&&n){const 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=wt.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=ru;const s=new wt.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=yi(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 hu{constructor(t,e){d(this,"hasOpen",!1);d(this,"hook",new me.Subscribe);d(this,"magnifier");d(this,"five");d(this,"model");d(this,"group");d(this,"config");d(this,"fiveHelper");d(this,"useUIController");d(this,"params");d(this,"useGuideController");d(this,"rangePieceController");d(this,"container",document.createElement("div"));d(this,"shortcutKeyController");d(this,"controller",null);d(this,"controllerParams");d(this,"getCurrentMode",()=>this.controller instanceof Bn?"Edit":this.controller instanceof ki?"Watch":this.controller instanceof As?"Mixed":null);d(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:Bh,Watch:ki,Edit:Bn};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,...En(e,["openParams","magnifierParams"])},this.model=new xi(this.config),this.fiveHelper=new Ph(t),this.magnifier=new fs(t,(s=e.magnifierParams)!=null?s:{width:190,height:190,scale:2}),this.group=new M.Group,this.group.name="plugin-measure-group",this.container.classList.add("five-plugin-measure-container"),this.container.style.position="absolute",this.container.style.left="0",this.container.style.top="0",this.container.style.pointerEvents="none",this.container.style.width="100%",this.container.style.height="100%",this.container.style.opacity="0",this.container.style.background="rgba(0, 0, 0, 0.15)";const o=(r=this.params.openParams)!=null?r:{};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:ys({...o.crossHairParameter}),userDistanceItemCreator:this.params.userDistanceItemCreator},this.params.useUIController!==!1&&(this.useUIController=new Cs(this,this.controllerParams)),this.params.useGuideController!==!1&&(this.useGuideController=new iu(this,this.controllerParams))}appendTo(t){t.append(this.container)}dispose(){var t,e;this.disable(),(t=this.useUIController)==null||t.dispose(),(e=this.magnifier)==null||e.dispose(),this.five.needsRender=!0}load(t){this.model.parse(t),this.save()}enable(){var t,e,n;this.hasOpen||(this.hasOpen=!0,this.five.scene.add(this.group),this.container.style.opacity="1",(t=this.params.openParams)!=null&&t.isMobile?(this.controller=new As(this.controllerParams),this.rangePieceController=new cu(this.controllerParams)):(this.five.helperVisible=!1,this.controller=new ki(this.controllerParams)),(e=this.useUIController)==null||e.show(),(n=this.useGuideController)==null||n.show(),this.shortcutKeyController=new ou(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 Bn&&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 Bn?(this.model.mergeModel(this.controller.model),this):this}toJson(){return this.model.toJson()}changeIsMobile(t){var e,n;((e=this.controllerParams.openParams)==null?void 0:e.isMobile)===void 0&&(this.controllerParams.openParams.isMobile=t),this.controllerParams.openParams.isMobile!==t&&(this.controllerParams.openParams.isMobile=t,this.params.useUIController!==!1&&((n=this.useUIController)==null||n.dispose()),this.useUIController=new Cs(this,this.controllerParams))}changeConfigs(t){var e;if(t.getDistanceText&&t.getDistanceText!==this.config.getDistanceText){const n=t.getDistanceText;this.config.getDistanceText=n,(e=this.controller)==null||e.updateDistanceUI()}}}const uu=function(t,e){return new hu(t,e)},Es=vo(null);function du(i){be(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 Ls(i,t,e){const n=i.slice();return n[3]=t[e],n}function ks(i){let t,e=`${i[3].top}%`,n=`${i[3].left}%`,o,s;function r(){return i[2](i[3])}return{c(){t=Q("i"),C(t,"class","svelte-19zi46m"),je(t,"PanoSpatialTagPlugin__tag-origin",!0),je(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),S(t,"top",e),S(t,"left",n),S(t,"visibility",i[3].front?"visible":"hidden")},m(a,l){V(a,t,l),o||(s=qe(t,"click",r),o=!0)},p(a,l){i=a,l&1&&je(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),l&1&&e!==(e=`${i[3].top}%`)&&S(t,"top",e),l&1&&n!==(n=`${i[3].left}%`)&&S(t,"left",n),l&1&&S(t,"visibility",i[3].front?"visible":"hidden")},d(a){a&&H(t),o=!1,s()}}}function fu(i){let t,e=i[0],n=[];for(let o=0;o<e.length;o+=1)n[o]=ks(Ls(i,e,o));return{c(){for(let o=0;o<n.length;o+=1)n[o].c();t=Re()},m(o,s){for(let r=0;r<n.length;r+=1)n[r].m(o,s);V(o,t,s)},p(o,[s]){if(s&3){e=o[0];let r;for(r=0;r<e.length;r+=1){const a=Ls(o,e,r);n[r]?n[r].p(a,s):(n[r]=ks(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:ne,o:ne,d(o){Mt(n,o),o&&H(t)}}}function mu(i,t,e){let{origins:n}=t;const o=r=>{Es.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 pu extends fe{constructor(t){super(),de(this,t,mu,fu,ue,{origins:0},du)}}function gu(i){be(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 vu(i){let t,e,n,o,s,r,a,l,c,h,f,u,m,g,v;return{c(){t=Q("div"),e=Q("div"),n=pe(),o=Q("div"),s=Q("i"),r=pe(),a=Q("i"),l=pe(),c=Q("i"),h=pe(),f=Q("div"),u=Q("div"),C(e,"class","PanoSpatialTagPlugin__tag-shadow svelte-1i5h9zh"),S(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]+")"),C(s,"class","PanoSpatialTagPlugin__tag-flagpole svelte-1i5h9zh"),S(s,"width",i[4]+"rem"),C(a,"class","PanoSpatialTagPlugin__tag-line1 svelte-1i5h9zh"),C(c,"class","PanoSpatialTagPlugin__tag-line2 svelte-1i5h9zh"),C(o,"class","PanoSpatialTagPlugin__tag-line svelte-1i5h9zh"),C(u,"class","PanoSpatialTagPlugin__tag-content svelte-1i5h9zh"),C(f,"class","PanoSpatialTagPlugin__tag-animate svelte-1i5h9zh"),S(f,"transform","scale("+i[3]*3+")"),C(t,"id",m="PanoSpatialTagPlugin__"+i[0]),S(t,"height",20*i[5]+"rem"),C(t,"class","svelte-1i5h9zh"),je(t,"PanoSpatialTagPlugin__tag-x",!0),je(t,"PanoSpatialTagPlugin__tag-upside-down",i[1]),je(t,"PanoSpatialTagPlugin__tag-show",i[10]),je(t,"PanoSpatialTagPlugin__tag-hide",i[10]===!1||i[6])},m(b,y){V(b,t,y),W(t,e),W(t,n),W(t,o),W(o,s),W(o,r),W(o,a),W(o,l),W(o,c),W(t,h),W(t,f),W(f,u),u.innerHTML=i[2],i[16](u),g||(v=qe(u,"click",i[11]),g=!0)},p(b,[y]){y&394&&S(e,"transform","translate("+b[7]/2*b[3]*3+"px, "+b[8]/2*(b[1]?-1:1)*b[3]*3+"px) scale("+1/b[3]+")"),y&16&&S(s,"width",b[4]+"rem"),y&4&&(u.innerHTML=b[2]),y&8&&S(f,"transform","scale("+b[3]*3+")"),y&1&&m!==(m="PanoSpatialTagPlugin__"+b[0])&&C(t,"id",m),y&32&&S(t,"height",20*b[5]+"rem"),y&2&&je(t,"PanoSpatialTagPlugin__tag-upside-down",b[1]),y&1024&&je(t,"PanoSpatialTagPlugin__tag-show",b[10]),y&1088&&je(t,"PanoSpatialTagPlugin__tag-hide",b[10]===!1||b[6])},i:ne,o:ne,d(b){b&&H(t),i[16](null),g=!1,v()}}}function bu(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:h}=t,{dispose:f}=t,{events:u}=t,{hooks:m}=t,g=0,v=0,b,y,x=setTimeout(()=>{h||e(10,y=!0),x=void 0},100);const P=I=>{const D=Object.keys(u);let E=I.target;for(;E;){const z=E.getAttribute("class");if(!z){E=E.parentNode;continue}if(z.includes("PanoSpatialTagPlugin__tag-content")){E=null;break}D.forEach(F=>{z.includes(F)&&u[F](n)}),E=E.parentNode}};It(()=>{m.emit("initTag",{id:n})});const k=Es.subscribe(I=>{if(I===null)return;const[D,E]=I.split("-PanoSpatialTagPlugin-");n===D&&(m.emit("clickOrigin",{id:n,show:y}),x||(e(10,y=h),e(12,h=!h),x=setTimeout(()=>{x=void 0},1500)))});ia(()=>{e(7,g=b.offsetWidth),e(8,v=b.offsetHeight),!x&&e(10,y=!h)}),Ut(()=>{m.emit("destroyTag",{id:n}),k(),f()});function T(I){jt[I?"unshift":"push"](()=>{b=I,e(9,b)})}return i.$$set=I=>{"id"in I&&e(0,n=I.id),"upsideDown"in I&&e(1,o=I.upsideDown),"content"in I&&e(2,s=I.content),"contentZoom"in I&&e(3,r=I.contentZoom),"lineWidthZoom"in I&&e(4,a=I.lineWidthZoom),"lineHeightZoom"in I&&e(5,l=I.lineHeightZoom),"destroying"in I&&e(6,c=I.destroying),"folded"in I&&e(12,h=I.folded),"dispose"in I&&e(13,f=I.dispose),"events"in I&&e(14,u=I.events),"hooks"in I&&e(15,m=I.hooks)},[n,o,s,r,a,l,c,g,v,b,y,P,h,f,u,m,T]}class Au extends fe{constructor(t){super(),de(this,t,bu,vu,ue,{id:0,upsideDown:1,content:2,contentZoom:3,lineWidthZoom:4,lineHeightZoom:5,destroying:6,folded:12,dispose:13,events:14,hooks:15},gu)}}const yu={position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",pointerEvents:"none"},Ds="<",Ts=">",zs="%",Ms="locals",Pu="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",wu={"&":"&","<":"<",">":">",'"':""","'":"'"},Ne={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};function Ss(i){return i.replace(/;(\s*$)/,"$1")}function Iu(i,t){return new xu(i).compileFunction()(t)}class xu{constructor(t){d(this,"templateText");d(this,"mode",null);d(this,"truncate",!1);d(this,"currentLine",1);d(this,"source","");d(this,"regex",new RegExp(Pu));this.templateText=t}compileFunction(){let t;const e=` var __output = "";
|
|
501
|
+
`;function ru(){}const{Vector2:au}=O;function lu(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return Object.assign(new au,{x:(i.x-s)/e*2-1,y:-(i.y-o)/n*2+1})}class cu{constructor(t){d(this,"container",document.createElement("div"));d(this,"five");d(this,"group");d(this,"mouseGroup");d(this,"hasAppendMouseGroup",!1);d(this,"fiveHelper");d(this,"hook");d(this,"content");d(this,"intersectMesh");d(this,"centerMouseXY");d(this,"raycaster",new M.Raycaster);d(this,"pieceStyl",{matrix3d:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],scale:1,opacity:.4});d(this,"onCameraDirectionUpdate",()=>{const t=this.getIntersection();if(t){this.pieceChange(t),this.updateMouseGroup(t);const e=new it(this.mouseGroup.position);this.hook.emit("nowPointChange",e)}});d(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 it(n)):this.hook.emit("getEndPoint",new it(n)))});d(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=lu({x:r,y:a},this.five.getElement());this.centerMouseXY=c});d(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=ys({isMobile:!0,...t.openParams.crossHairParameter}),this.fiveHelper=t.fiveHelper,this.container.innerHTML=su,this.container.classList.add("range-piece-controller"),this.content=this.container.querySelector(".range-piece__content"),this.content&&(this.content.style.transform=`matrix3d(${this.pieceStyl.matrix3d.toString()}) scale(${this.pieceStyl.scale})`,this.content.style.opacity=`${this.pieceStyl.opacity}`),t.container.append(this.container),this.intersectMesh=new M.Mesh(new M.RingGeometry(.04,.08,32),new M.MeshBasicMaterial({color:1245179,opacity:0,side:M.DoubleSide,transparent:!0})),this.container.addEventListener("animationend",this.computedCenterMouseXY),this.five.on("cameraUpdate",this.onCameraDirectionUpdate),this.hook.on("willChangeState",this.onWillChangeState)}dispose(){this.container.removeEventListener("animationend",this.computedCenterMouseXY),this.five.off("cameraUpdate",this.onCameraDirectionUpdate),this.hook.off("willChangeState",this.onWillChangeState),this.container.remove(),this.group.remove(this.mouseGroup),this.mouseGroup.remove(),this.hasAppendMouseGroup=!1,this.five.scene.remove(this.intersectMesh)}pieceChange(t){const e=t.face,n=t.point;if(e&&n){const 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=wt.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=ru;const s=new wt.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=yi(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 hu{constructor(t,e){d(this,"hasOpen",!1);d(this,"hook",new me.Subscribe);d(this,"magnifier");d(this,"five");d(this,"model");d(this,"group");d(this,"config");d(this,"fiveHelper");d(this,"useUIController");d(this,"params");d(this,"useGuideController");d(this,"rangePieceController");d(this,"container",document.createElement("div"));d(this,"shortcutKeyController");d(this,"controller",null);d(this,"controllerParams");d(this,"getCurrentMode",()=>this.controller instanceof Bn?"Edit":this.controller instanceof ki?"Watch":this.controller instanceof As?"Mixed":null);d(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:Bh,Watch:ki,Edit:Bn};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,...En(e,["openParams","magnifierParams"])},this.model=new xi(this.config),this.fiveHelper=new Ph(t),this.magnifier=new fs(t,(s=e.magnifierParams)!=null?s:{width:190,height:190,scale:2}),this.group=new M.Group,this.group.name="plugin-measure-group",this.container.classList.add("five-plugin-measure-container"),this.container.style.position="absolute",this.container.style.left="0",this.container.style.top="0",this.container.style.pointerEvents="none",this.container.style.width="100%",this.container.style.height="100%",this.container.style.opacity="0",this.container.style.background="rgba(0, 0, 0, 0.15)";const o=(r=this.params.openParams)!=null?r:{};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:ys({...o.crossHairParameter}),userDistanceItemCreator:this.params.userDistanceItemCreator},this.params.useUIController!==!1&&(this.useUIController=new Cs(this,this.controllerParams)),this.params.useGuideController!==!1&&(this.useGuideController=new iu(this,this.controllerParams))}appendTo(t){t.append(this.container)}dispose(){var t,e;this.disable(),(t=this.useUIController)==null||t.dispose(),(e=this.magnifier)==null||e.dispose(),this.five.needsRender=!0}load(t){this.model.parse(t),this.save()}enable(){var t,e,n;this.hasOpen||(this.hasOpen=!0,this.five.scene.add(this.group),this.container.style.opacity="1",(t=this.params.openParams)!=null&&t.isMobile?(this.controller=new As(this.controllerParams),this.rangePieceController=new cu(this.controllerParams)):(this.five.helperVisible=!1,this.controller=new ki(this.controllerParams)),(e=this.useUIController)==null||e.show(),(n=this.useGuideController)==null||n.show(),this.shortcutKeyController=new ou(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 Bn&&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 Bn?(this.model.mergeModel(this.controller.model),this):this}toJson(){return this.model.toJson()}changeIsMobile(t){var e,n;((e=this.controllerParams.openParams)==null?void 0:e.isMobile)===void 0&&(this.controllerParams.openParams.isMobile=t),this.controllerParams.openParams.isMobile!==t&&(this.controllerParams.openParams.isMobile=t,this.params.useUIController!==!1&&((n=this.useUIController)==null||n.dispose()),this.useUIController=new Cs(this,this.controllerParams))}changeConfigs(t){var e;if(t.getDistanceText&&t.getDistanceText!==this.config.getDistanceText){const n=t.getDistanceText;this.config.getDistanceText=n,(e=this.controller)==null||e.updateDistanceUI()}}}const uu=function(t,e){return new hu(t,e)},Es=vo(null);function du(i){be(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 Ls(i,t,e){const n=i.slice();return n[3]=t[e],n}function ks(i){let t,e=`${i[3].top}%`,n=`${i[3].left}%`,o,s;function r(){return i[2](i[3])}return{c(){t=Q("i"),C(t,"class","svelte-19zi46m"),je(t,"PanoSpatialTagPlugin__tag-origin",!0),je(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),S(t,"top",e),S(t,"left",n),S(t,"visibility",i[3].front?"visible":"hidden")},m(a,l){V(a,t,l),o||(s=qe(t,"click",r),o=!0)},p(a,l){i=a,l&1&&je(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),l&1&&e!==(e=`${i[3].top}%`)&&S(t,"top",e),l&1&&n!==(n=`${i[3].left}%`)&&S(t,"left",n),l&1&&S(t,"visibility",i[3].front?"visible":"hidden")},d(a){a&&H(t),o=!1,s()}}}function fu(i){let t,e=i[0],n=[];for(let o=0;o<e.length;o+=1)n[o]=ks(Ls(i,e,o));return{c(){for(let o=0;o<n.length;o+=1)n[o].c();t=Re()},m(o,s){for(let r=0;r<n.length;r+=1)n[r].m(o,s);V(o,t,s)},p(o,[s]){if(s&3){e=o[0];let r;for(r=0;r<e.length;r+=1){const a=Ls(o,e,r);n[r]?n[r].p(a,s):(n[r]=ks(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:ne,o:ne,d(o){Mt(n,o),o&&H(t)}}}function mu(i,t,e){let{origins:n}=t;const o=r=>{Es.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 pu extends fe{constructor(t){super(),de(this,t,mu,fu,ue,{origins:0},du)}}function gu(i){be(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 vu(i){let t,e,n,o,s,r,a,l,c,h,f,u,m,g,v;return{c(){t=Q("div"),e=Q("div"),n=pe(),o=Q("div"),s=Q("i"),r=pe(),a=Q("i"),l=pe(),c=Q("i"),h=pe(),f=Q("div"),u=Q("div"),C(e,"class","PanoSpatialTagPlugin__tag-shadow svelte-1i5h9zh"),S(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]+")"),C(s,"class","PanoSpatialTagPlugin__tag-flagpole svelte-1i5h9zh"),S(s,"width",i[4]+"rem"),C(a,"class","PanoSpatialTagPlugin__tag-line1 svelte-1i5h9zh"),C(c,"class","PanoSpatialTagPlugin__tag-line2 svelte-1i5h9zh"),C(o,"class","PanoSpatialTagPlugin__tag-line svelte-1i5h9zh"),C(u,"class","PanoSpatialTagPlugin__tag-content svelte-1i5h9zh"),C(f,"class","PanoSpatialTagPlugin__tag-animate svelte-1i5h9zh"),S(f,"transform","scale("+i[3]*3+")"),C(t,"id",m="PanoSpatialTagPlugin__"+i[0]),S(t,"height",20*i[5]+"rem"),C(t,"class","svelte-1i5h9zh"),je(t,"PanoSpatialTagPlugin__tag-x",!0),je(t,"PanoSpatialTagPlugin__tag-upside-down",i[1]),je(t,"PanoSpatialTagPlugin__tag-show",i[10]),je(t,"PanoSpatialTagPlugin__tag-hide",i[10]===!1||i[6])},m(b,y){V(b,t,y),W(t,e),W(t,n),W(t,o),W(o,s),W(o,r),W(o,a),W(o,l),W(o,c),W(t,h),W(t,f),W(f,u),u.innerHTML=i[2],i[16](u),g||(v=qe(u,"click",i[11]),g=!0)},p(b,[y]){y&394&&S(e,"transform","translate("+b[7]/2*b[3]*3+"px, "+b[8]/2*(b[1]?-1:1)*b[3]*3+"px) scale("+1/b[3]+")"),y&16&&S(s,"width",b[4]+"rem"),y&4&&(u.innerHTML=b[2]),y&8&&S(f,"transform","scale("+b[3]*3+")"),y&1&&m!==(m="PanoSpatialTagPlugin__"+b[0])&&C(t,"id",m),y&32&&S(t,"height",20*b[5]+"rem"),y&2&&je(t,"PanoSpatialTagPlugin__tag-upside-down",b[1]),y&1024&&je(t,"PanoSpatialTagPlugin__tag-show",b[10]),y&1088&&je(t,"PanoSpatialTagPlugin__tag-hide",b[10]===!1||b[6])},i:ne,o:ne,d(b){b&&H(t),i[16](null),g=!1,v()}}}function bu(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:h}=t,{dispose:f}=t,{events:u}=t,{hooks:m}=t,g=0,v=0,b,y,x=setTimeout(()=>{h||e(10,y=!0),x=void 0},100);const P=I=>{const D=Object.keys(u);let E=I.target;for(;E;){const z=E.getAttribute("class");if(!z){E=E.parentNode;continue}if(z.includes("PanoSpatialTagPlugin__tag-content")){E=null;break}D.forEach(F=>{z.includes(F)&&u[F](n)}),E=E.parentNode}};It(()=>{m.emit("initTag",{id:n})});const L=Es.subscribe(I=>{if(I===null)return;const[D,E]=I.split("-PanoSpatialTagPlugin-");n===D&&(m.emit("clickOrigin",{id:n,show:y}),x||(e(10,y=h),e(12,h=!h),x=setTimeout(()=>{x=void 0},1500)))});ia(()=>{e(7,g=b.offsetWidth),e(8,v=b.offsetHeight),!x&&e(10,y=!h)}),Ut(()=>{m.emit("destroyTag",{id:n}),L(),f()});function T(I){jt[I?"unshift":"push"](()=>{b=I,e(9,b)})}return i.$$set=I=>{"id"in I&&e(0,n=I.id),"upsideDown"in I&&e(1,o=I.upsideDown),"content"in I&&e(2,s=I.content),"contentZoom"in I&&e(3,r=I.contentZoom),"lineWidthZoom"in I&&e(4,a=I.lineWidthZoom),"lineHeightZoom"in I&&e(5,l=I.lineHeightZoom),"destroying"in I&&e(6,c=I.destroying),"folded"in I&&e(12,h=I.folded),"dispose"in I&&e(13,f=I.dispose),"events"in I&&e(14,u=I.events),"hooks"in I&&e(15,m=I.hooks)},[n,o,s,r,a,l,c,g,v,b,y,P,h,f,u,m,T]}class Au extends fe{constructor(t){super(),de(this,t,bu,vu,ue,{id:0,upsideDown:1,content:2,contentZoom:3,lineWidthZoom:4,lineHeightZoom:5,destroying:6,folded:12,dispose:13,events:14,hooks:15},gu)}}const yu={position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",pointerEvents:"none"},Ds="<",Ts=">",zs="%",Ms="locals",Pu="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",wu={"&":"&","<":"<",">":">",'"':""","'":"'"},Ne={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};function Ss(i){return i.replace(/;(\s*$)/,"$1")}function Iu(i,t){return new xu(i).compileFunction()(t)}class xu{constructor(t){d(this,"templateText");d(this,"mode",null);d(this,"truncate",!1);d(this,"currentLine",1);d(this,"source","");d(this,"regex",new RegExp(Pu));this.templateText=t}compileFunction(){let t;const e=` var __output = "";
|
|
502
502
|
function __append(s) { if (s !== undefined && s !== null) __output += s }
|
|
503
503
|
with (`+Ms+` || {}) {
|
|
504
504
|
`,n=` }
|
|
@@ -513,26 +513,26 @@ void main() {
|
|
|
513
513
|
`)}switch(this.mode){case Ne.EVAL:this.source+=" ; "+t+`
|
|
514
514
|
`;break;case Ne.ESCAPED:this.source+=" ; __append(escapeFn("+Ss(t)+`))
|
|
515
515
|
`;break;case Ne.RAW:this.source+=" ; __append("+Ss(t)+`)
|
|
516
|
-
`;break;case Ne.COMMENT:break;case Ne.LITERAL:this._addOutput(t);break}}else this._addOutput(t)}}}const Di=.001,js=.01,Cu="https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png",Eu=(i,t)=>{var Y,te,re,oe,he,we,Le,Oe;let e=t==null?void 0:t.container,n=1.4;const o=(Y=t==null?void 0:t.wait)!=null?Y:200,s=(te=t==null?void 0:t.maxNumberOnScreen)!=null?te:3,r=(re=t==null?void 0:t.minRad)!=null?re:Math.PI/4,a=(oe=t==null?void 0:t.nearTolerance)!=null?oe:100,l=(he=t==null?void 0:t.upsideHeight)!=null?he:1.6,c=(we=t==null?void 0:t.minDistance)!=null?we:1.2,h=(Le=t==null?void 0:t.maxDistance)!=null?Le:3.5,f=fn(i),u=document.createElement("div");u.classList.add("PanoSpatialTagPlugin"),Object.assign(u.style,yu);const m=new me.Subscribe;let g=new Image;g.src=Cu;const v={points:[],origins:[],tags:[],template:"",events:{},render:Iu,folded:!1,enabled:!0,forbidden:!0},b=new pu({target:u,props:{origins:v.origins}}),y=(Z,ae)=>{T(),ae&&I()},x=()=>{v.forbidden&&(v.forbidden=!1,I())},P=(Z,ae)=>{if(v.tags.length===0)return;const se=ae.longitude-i.state.longitude,q=i.camera.clone();q.position.copy(ae.offset),q.rotateOnWorldAxis(new O.Vector3(0,1,0),se),q.updateProjectionMatrix(),q.updateMatrixWorld(!0);const Qe=new O.Frustum,Ve=new O.Matrix4;Ve.multiplyMatrices(q.projectionMatrix,q.matrixWorldInverse),Qe.setFromProjectionMatrix(Ve),v.tags.forEach(ce=>{const We=q.position.clone().setY(n).distanceTo(ce.position);if(We<c||We>h||!Qe.containsPoint(ce.position))return ce.destroying=!0;const He=ce.position.clone().sub(q.position).setY(0);if(He.angleTo(ce.normal)>Math.PI/2-r&&He.angleTo(ce.normal)<Math.PI/2+r)return ce.destroying=!0}),v.tags.forEach(ce=>{ce.destroying?ce.app.$set({contentZoom:.1+q.position.distanceTo(ce.position)/h,lineWidthZoom:.38*(.01+q.position.distanceTo(ce.position)/h),destroying:ce.destroying}):ce.app.$set({lineWidthZoom:.38*(.01+q.position.distanceTo(ce.position)/h),lineHeightZoom:.4+(q.position.distanceTo(ce.position)-c)/h*.6,contentZoom:.1+q.position.distanceTo(ce.position)/h})}),setTimeout(()=>{v.tags.forEach(ce=>{ce.destroying&&(ce.app.$destroy(),ce=null)}),v.tags=v.tags.filter(ce=>!ce.destroying),T()},1900)},
|
|
516
|
+
`;break;case Ne.COMMENT:break;case Ne.LITERAL:this._addOutput(t);break}}else this._addOutput(t)}}}const Di=.001,js=.01,Cu="https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png",Eu=(i,t)=>{var Y,te,re,oe,he,we,Le,Oe;let e=t==null?void 0:t.container,n=1.4;const o=(Y=t==null?void 0:t.wait)!=null?Y:200,s=(te=t==null?void 0:t.maxNumberOnScreen)!=null?te:3,r=(re=t==null?void 0:t.minRad)!=null?re:Math.PI/4,a=(oe=t==null?void 0:t.nearTolerance)!=null?oe:100,l=(he=t==null?void 0:t.upsideHeight)!=null?he:1.6,c=(we=t==null?void 0:t.minDistance)!=null?we:1.2,h=(Le=t==null?void 0:t.maxDistance)!=null?Le:3.5,f=fn(i),u=document.createElement("div");u.classList.add("PanoSpatialTagPlugin"),Object.assign(u.style,yu);const m=new me.Subscribe;let g=new Image;g.src=Cu;const v={points:[],origins:[],tags:[],template:"",events:{},render:Iu,folded:!1,enabled:!0,forbidden:!0},b=new pu({target:u,props:{origins:v.origins}}),y=(Z,ae)=>{T(),ae&&I()},x=()=>{v.forbidden&&(v.forbidden=!1,I())},P=(Z,ae)=>{if(v.tags.length===0)return;const se=ae.longitude-i.state.longitude,q=i.camera.clone();q.position.copy(ae.offset),q.rotateOnWorldAxis(new O.Vector3(0,1,0),se),q.updateProjectionMatrix(),q.updateMatrixWorld(!0);const Qe=new O.Frustum,Ve=new O.Matrix4;Ve.multiplyMatrices(q.projectionMatrix,q.matrixWorldInverse),Qe.setFromProjectionMatrix(Ve),v.tags.forEach(ce=>{const We=q.position.clone().setY(n).distanceTo(ce.position);if(We<c||We>h||!Qe.containsPoint(ce.position))return ce.destroying=!0;const He=ce.position.clone().sub(q.position).setY(0);if(He.angleTo(ce.normal)>Math.PI/2-r&&He.angleTo(ce.normal)<Math.PI/2+r)return ce.destroying=!0}),v.tags.forEach(ce=>{ce.destroying?ce.app.$set({contentZoom:.1+q.position.distanceTo(ce.position)/h,lineWidthZoom:.38*(.01+q.position.distanceTo(ce.position)/h),destroying:ce.destroying}):ce.app.$set({lineWidthZoom:.38*(.01+q.position.distanceTo(ce.position)/h),lineHeightZoom:.4+(q.position.distanceTo(ce.position)-c)/h*.6,contentZoom:.1+q.position.distanceTo(ce.position)/h})}),setTimeout(()=>{v.tags.forEach(ce=>{ce.destroying&&(ce.app.$destroy(),ce=null)}),v.tags=v.tags.filter(ce=>!ce.destroying),T()},1900)},L=Z=>{Z!==me.Five.Mode.Panorama&&!v.forbidden&&(b.$set({origins:[]}),v.tags.forEach(ae=>{ae.app.$destroy(),ae=null}),v.origins=[],v.tags=[],v.forbidden=!0)},T=()=>{if(v.forbidden||!v.enabled)return;const Z=i.camera,ae=Z.getWorldDirection(new O.Vector3);v.origins=v.tags.map(se=>{const q=se.position.clone().project(Z),Qe=se.position.clone().sub(Z.position).setY(0).angleTo(ae.setY(0))<Math.PI/2;return{id:se.id,front:Qe,left:(q.x+1)/2*100,top:(-q.y+1)/2*100,destroying:se.destroying}}),b.$set({origins:v.origins})},I=()=>{v.forbidden||!v.enabled||(v.timeoutId&&clearTimeout(v.timeoutId),v.timeoutId=setTimeout(()=>{v.timeoutId=void 0;const Z=D();Z.length&&(v.tags=v.tags.concat(Z),T())},o))},D=()=>{const{clientWidth:Z,clientHeight:ae}=i.getElement(),se=[],q=i.camera,Qe=new O.Frustum,Ve=new O.Matrix4,ce=q.getWorldDirection(new O.Vector3);Ve.multiplyMatrices(q.projectionMatrix,q.matrixWorldInverse),Qe.setFromProjectionMatrix(Ve);const We=v.tags.filter(ve=>Qe.containsPoint(ve.position)&&!ve.destroying).length,He=v.points.reduce((ve,xe)=>{if(v.tags.find(De=>xe.id===De.id&&!De.destroying))return ve;const Ze=q.position.clone().setY(n).distanceTo(xe.position);if(Ze<c||Ze>h||!Qe.containsPoint(xe.position))return ve;const yt=xe.position.clone().sub(q.position).setY(0);if(yt.angleTo(xe.normal)>Math.PI/2-r&&yt.angleTo(xe.normal)<Math.PI/2+r)return ve;const _e=xe.position.clone().project(q);if(!v.tags.every(De=>{if(De.position.clone().sub(q.position).setY(0).angleTo(ce.setY(0))>Math.PI/2)return!0;const ut=De.position.clone().project(q);return Math.sqrt(Math.pow((_e.x-ut.x)/2*Z,2)+Math.pow((_e.y-ut.y)/2*ae,2))>a}))return ve;const ke={id:xe.id,position:xe.position,normal:xe.normal,replacement:xe.replacement,weight:xe.weight,distance:Ze};let Ie;for(let De=0,ut=ve.length;De<ut;De++){const Qt=ve[De];if(ke.weight>Qt.weight){Ie=De;break}if(ke.distance<Qt.distance){Ie=De;break}}return Ie!==void 0?ve.splice(Ie,0,ke):ve.push(ke),ve},[]);for(let ve=0,xe=He.length;ve<xe&&!(We+se.length>=s);ve++){const Ze=He[ve];if(se.find(Ie=>Ze.id===Ie.id))continue;const yt=Ze.position.clone().project(q);if(!v.tags.concat(se).every(Ie=>{if(Ie.position.clone().sub(q.position).setY(0).angleTo(ce.setY(0))>Math.PI/2)return!0;const De=Ie.position.clone().project(q);return Math.sqrt(Math.pow((yt.x-De.x)/2*Z,2)+Math.pow((yt.y-De.y)/2*ae,2))>a}))continue;const _e=new O.Raycaster(q.position.clone().setY(n),Ze.position.clone().sub(q.position.clone().setY(n)).normalize(),0,Ze.distance+js),[ke]=v.intersectObjects?_e.intersectObjects(v.intersectObjects,!0):i.model.bvhs.loaded?i.model.intersectRaycaster(_e):_e.intersectObjects(i.model.children,!0);if(!!ke&&Ze.distance-ke.distance<js){const{position:Ie,normal:De,id:ut,replacement:Qt}=Ze,Oi=new O.Plane().setFromNormalAndCoplanarPoint(De,Ie),en=Ie.clone().sub(q.position).cross(new O.Vector3(0,1,0)).setLength(Di),Wn=[Ie.clone(),Ie.clone().add(en),Ie.clone().add(new O.Vector3(0,Di,0)).add(en),Ie.clone().add(new O.Vector3(0,Di,0))].map(tn=>Oi.projectPoint(tn,new O.Vector3)),{container:Hn,dispose:Yn}=f.create3DDomContainer(Wn)||{},Wt=new Au({target:Hn,props:{id:ut,content:v.render(v.template,Qt),lineWidthZoom:.38*(.01+q.position.distanceTo(Ie)/h),lineHeightZoom:.4+(q.position.distanceTo(Ie)-c)/h*.6,contentZoom:.1+q.position.distanceTo(Ie)/h,upsideDown:Ie.y>l,folded:v.folded,events:v.events,hooks:m,dispose:Yn}});se.push({position:Ie,normal:De,id:ut,app:Wt})}}return se},E=Z=>{v.points=Z.points.map(ae=>{var se,q;return{id:ae.id,position:new O.Vector3().fromArray(ae.position),normal:new O.Vector3().fromArray(ae.normal),replacement:(se=ae.replacement)!=null?se:{},weight:(q=ae.weight)!=null?q:-1}}),Z.render&&(v.render=Z.render),Z.template&&(v.template=Z.template),Z.events&&(v.events=Z.events),Z.enabled===!1&&(v.enabled=Z.enabled),Z.folded===!0&&(v.folded=Z.folded)},z=Z=>{v.intersectObjects=Z,I()},F=()=>{v.enabled=!0,I()},R=()=>{v.enabled=!1,b.$set({origins:[]}),v.tags.forEach(Z=>{Z.app.$destroy(),Z=null}),v.origins=[],v.tags=[]},ee=()=>{v.folded=!1,v.tags.forEach(Z=>{Z.app.$set({folded:v.folded})})},j=()=>{v.folded=!0,v.tags.forEach(Z=>{Z.app.$set({folded:v.folded})})},N=Z=>{v.tags.forEach(ae=>{ae.id===Z&&ae.app.$set({folded:!1})})},G=Z=>{v.tags.forEach(ae=>{ae.id===Z&&ae.app.$set({folded:!0})})},_=()=>{i.once("renderFrame",T)},U=()=>{e||(e=i.getElement().parentElement),e&&e.appendChild(u),v.forbidden=!1,n=i.model.bounding.getCenter(new O.Vector3).y,I(),i.on("panoWillArrive",P),i.on("panoArrived",x),i.on("modeChange",L),i.on("cameraUpdate",y)},ie=()=>{g=null,f.disposeAll(),b.$destroy(),v.tags.forEach(Z=>{Z.app.$destroy(),Z=null}),v.origins=[],v.tags=[],i.off("modelLoaded",U),i.off("renderFrame",T),i.off("panoWillArrive",P),i.off("panoArrived",x),i.off("modeChange",L),i.off("cameraUpdate",y),i.off("dispose",ie),window.removeEventListener("resize",_,!1)};return window.addEventListener("resize",_,!1),(Oe=i==null?void 0:i.model)!=null&&Oe.loaded?U():i.once("modelLoaded",U),i.on("dispose",ie),{load:E,setIntersectObjects:z,unfoldAll:ee,foldAll:j,unfold:N,fold:G,enable:F,disable:R,hooks:m,dispose:ie}};var Et=(i=>(i.SMALL="small",i.MIDLLE="middle",i.LARGE="large",i.EXTRA_LARGE="x-large",i))(Et||{}),Os={exports:{}};/*!
|
|
517
517
|
Copyright (c) 2018 Jed Watson.
|
|
518
518
|
Licensed under the MIT License (MIT), see
|
|
519
519
|
http://jedwatson.github.io/classnames
|
|
520
520
|
*/(function(i){(function(){var t={}.hasOwnProperty;function e(){for(var n=[],o=0;o<arguments.length;o++){var s=arguments[o];if(!!s){var r=typeof s;if(r==="string"||r==="number")n.push(s);else if(Array.isArray(s)){if(s.length){var a=e.apply(null,s);a&&n.push(a)}}else if(r==="object"){if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]")){n.push(s.toString());continue}for(var l in s)t.call(s,l)&&s[l]&&n.push(l)}}}return n.join(" ")}i.exports?(e.default=e,i.exports=e):window.classNames=e})()})(Os);const ot=Os.exports;function Lu(i){be(i,"svelte-i9z7qw",`.item-label-item.svelte-i9z7qw{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-i9z7qw{opacity:1;animation:svelte-i9z7qw-fadeIn .3s ease-in}.item-label-item__text-wrap.svelte-i9z7qw::before{content:'';position:absolute;width:100%;height:100%;background-color:rgba(0, 0, 0, .3);filter:blur(0.83333rem);z-index:-1}.item-label-item__text-wrap.svelte-i9z7qw{padding:0.3125rem 0.3125rem 0;position:absolute;height:1.04167rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap;line-height:0.52083rem;font-size:0.57292rem;font-weight:bold;color:#FFEAC0;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center}.item-label-item__text.svelte-i9z7qw{padding-bottom:0.20833rem;border-top:0 solid;border-left:0 solid;border-right:0 solid;border-bottom:1px 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-i9z7qw{position:absolute;bottom:0;width:1px;background-image:linear-gradient(to bottom, rgba(234, 208, 154, 0), rgba(234, 208, 154, 1))}@keyframes svelte-i9z7qw-fadeIn{from{opacity:0
|
|
521
521
|
}to{opacity:1
|
|
522
|
-
}}`)}function ku(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,h;return{c(){t=Q("div"),e=Q("div"),n=Q("span"),s=Ue(o),r=pe(),a=Q("div"),C(n,"class","item-label-item__text svelte-i9z7qw"),C(e,"class","item-label-item__text-wrap svelte-i9z7qw"),S(e,"top",`-${i[0].strokeLength+26}px`),C(a,"class","item-label-item__bar svelte-i9z7qw"),S(a,"height",`${i[0].strokeLength}px`),C(t,"class",l=Se(ot("item-label-item",{visible:i[0].visible}))+" svelte-i9z7qw"),S(t,"z-index",i[0].zIndex),S(t,"transform",i[0].transform)},m(f,u){V(f,t,u),W(t,e),W(e,n),W(n,s),W(t,r),W(t,a),c||(h=qe(n,"click",i[1]),c=!0)},p(f,[u]){u&1&&o!==(o=(f[0].name.length>6?`${f[0].name.slice(0,6)}...`:f[0].name)+"")&&ct(s,o),u&1&&S(e,"top",`-${f[0].strokeLength+26}px`),u&1&&S(a,"height",`${f[0].strokeLength}px`),u&1&&l!==(l=Se(ot("item-label-item",{visible:f[0].visible}))+" svelte-i9z7qw")&&C(t,"class",l),u&1&&S(t,"z-index",f[0].zIndex),u&1&&S(t,"transform",f[0].transform)},i:ne,o:ne,d(f){f&&H(t),c=!1,h()}}}function Du(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 Tu extends fe{constructor(t){super(),de(this,t,Du,ku,ue,{itemLabel:0,hooks:2},Lu)}}function Ns(i,t=200){let e;return function(...n){clearTimeout(e),e=setTimeout(()=>{i(...n)},t)}}function zu(i){be(i,"svelte-gk8s47",".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}")}function Bs(i,t,e){const n=i.slice();return n[26]=t[e],n}function Fs(i,t){let e,n,o;return n=new Tu({props:{itemLabel:t[26],hooks:t[0]}}),{key:i,first:null,c(){e=Re(),Pe(n.$$.fragment),this.first=e},m(s,r){V(s,e,r),Ae(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||(X(n.$$.fragment,s),o=!0)},o(s){K(n.$$.fragment,s),o=!1},d(s){s&&H(e),ye(n,s)}}}function Mu(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=Bs(i,r,l),h=a(c);n.set(h,e[l]=Fs(h,c))}return{c(){t=Q("div");for(let l=0;l<e.length;l+=1)e[l].c();C(t,"class","item-labels-container svelte-gk8s47"),Ke(()=>i[9].call(t)),S(t,"opacity",i[4]?1:0)},m(l,c){V(l,t,c);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=St(t,i[9].bind(t)),s=!0},p(l,[c]){c&3&&(r=l[1],Ce(),e=gt(e,c,a,1,l,r,n,t,Ot,Fs,null,Bs),Ee()),c&16&&S(t,"opacity",l[4]?1:0)},i(l){if(!s){for(let c=0;c<r.length;c+=1)X(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)K(e[c]);s=!1},d(l){l&&H(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}let Gs=26,Su=11;function ju(i,t,e){const{Raycaster:n,Vector3:o}=O;let{five:s}=t,{modelOcclusionEnable:r}=t,{itemLabels:a}=t,{hooks:l}=t,{displayStrategyType:c}=t,h=null,f=null,u,m,g=[],v=!0;const b=(j,N)=>{const G=new n,_=j.camera.position.clone(),U=new o().fromArray(N.modelPosition),ie=U.distanceTo(_);G.set(_.clone(),U.clone().sub(_).normalize());const[Y]=j.model.intersectRaycaster(G);return!(Y&&Y.distance+1<ie)},y=(j,N)=>{const G=new o(N.modelPosition[0],N.modelPosition[1],N.modelPosition[2]),_=j.project2d(G),U=_==null?void 0:_.x,ie=_==null?void 0:_.y;return[U,ie]},x=j=>`translate(${j[0]}px, ${j[1]}px)`,P=(j,N)=>g.length===0?!1:!!g.find(_=>j[0]>=_[0]-N&&j[0]<=_[0]+N||j[1]>=_[1]-Gs&&j[1]<=_[1]+Gs);function
|
|
522
|
+
}}`)}function ku(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,h;return{c(){t=Q("div"),e=Q("div"),n=Q("span"),s=Ue(o),r=pe(),a=Q("div"),C(n,"class","item-label-item__text svelte-i9z7qw"),C(e,"class","item-label-item__text-wrap svelte-i9z7qw"),S(e,"top",`-${i[0].strokeLength+26}px`),C(a,"class","item-label-item__bar svelte-i9z7qw"),S(a,"height",`${i[0].strokeLength}px`),C(t,"class",l=Se(ot("item-label-item",{visible:i[0].visible}))+" svelte-i9z7qw"),S(t,"z-index",i[0].zIndex),S(t,"transform",i[0].transform)},m(f,u){V(f,t,u),W(t,e),W(e,n),W(n,s),W(t,r),W(t,a),c||(h=qe(n,"click",i[1]),c=!0)},p(f,[u]){u&1&&o!==(o=(f[0].name.length>6?`${f[0].name.slice(0,6)}...`:f[0].name)+"")&&ct(s,o),u&1&&S(e,"top",`-${f[0].strokeLength+26}px`),u&1&&S(a,"height",`${f[0].strokeLength}px`),u&1&&l!==(l=Se(ot("item-label-item",{visible:f[0].visible}))+" svelte-i9z7qw")&&C(t,"class",l),u&1&&S(t,"z-index",f[0].zIndex),u&1&&S(t,"transform",f[0].transform)},i:ne,o:ne,d(f){f&&H(t),c=!1,h()}}}function Du(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 Tu extends fe{constructor(t){super(),de(this,t,Du,ku,ue,{itemLabel:0,hooks:2},Lu)}}function Ns(i,t=200){let e;return function(...n){clearTimeout(e),e=setTimeout(()=>{i(...n)},t)}}function zu(i){be(i,"svelte-gk8s47",".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}")}function Bs(i,t,e){const n=i.slice();return n[26]=t[e],n}function Fs(i,t){let e,n,o;return n=new Tu({props:{itemLabel:t[26],hooks:t[0]}}),{key:i,first:null,c(){e=Re(),Pe(n.$$.fragment),this.first=e},m(s,r){V(s,e,r),Ae(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||(X(n.$$.fragment,s),o=!0)},o(s){K(n.$$.fragment,s),o=!1},d(s){s&&H(e),ye(n,s)}}}function Mu(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=Bs(i,r,l),h=a(c);n.set(h,e[l]=Fs(h,c))}return{c(){t=Q("div");for(let l=0;l<e.length;l+=1)e[l].c();C(t,"class","item-labels-container svelte-gk8s47"),Ke(()=>i[9].call(t)),S(t,"opacity",i[4]?1:0)},m(l,c){V(l,t,c);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=St(t,i[9].bind(t)),s=!0},p(l,[c]){c&3&&(r=l[1],Ce(),e=gt(e,c,a,1,l,r,n,t,Ot,Fs,null,Bs),Ee()),c&16&&S(t,"opacity",l[4]?1:0)},i(l){if(!s){for(let c=0;c<r.length;c+=1)X(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)K(e[c]);s=!1},d(l){l&&H(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}let Gs=26,Su=11;function ju(i,t,e){const{Raycaster:n,Vector3:o}=O;let{five:s}=t,{modelOcclusionEnable:r}=t,{itemLabels:a}=t,{hooks:l}=t,{displayStrategyType:c}=t,h=null,f=null,u,m,g=[],v=!0;const b=(j,N)=>{const G=new n,_=j.camera.position.clone(),U=new o().fromArray(N.modelPosition),ie=U.distanceTo(_);G.set(_.clone(),U.clone().sub(_).normalize());const[Y]=j.model.intersectRaycaster(G);return!(Y&&Y.distance+1<ie)},y=(j,N)=>{const G=new o(N.modelPosition[0],N.modelPosition[1],N.modelPosition[2]),_=j.project2d(G),U=_==null?void 0:_.x,ie=_==null?void 0:_.y;return[U,ie]},x=j=>`translate(${j[0]}px, ${j[1]}px)`,P=(j,N)=>g.length===0?!1:!!g.find(_=>j[0]>=_[0]-N&&j[0]<=_[0]+N||j[1]>=_[1]-Gs&&j[1]<=_[1]+Gs);function L(j,N){switch(N){case Et.SMALL:return Math.ceil(-27.78*j+85);case Et.MIDLLE:return Math.ceil(-38.9*j+130);case Et.LARGE:return Math.ceil(-44.44*j+140);case Et.EXTRA_LARGE:return Math.ceil(-92.59*j+300)}}const T=(j,N)=>{const G=N.map(U=>{const ie=y(j,U),Y=U.name.length*Su,te=L(U.modelPosition[1],c),oe=(r?b(j,U):!0)&&!P([ie[0],ie[1]+te],Y);if(!oe)return Object.assign(Object.assign({},U),{visible:oe});g.push(ie);const he=x(ie);return Object.assign(Object.assign({},U),{visible:oe,transform:he,strokeLength:te})}),_=G.filter(({visible:U})=>U).map(U=>({itemLabelItem:U,distance:new o(U.modelPosition[0],U.modelPosition[1],U.modelPosition[2]).clone().distanceTo(j.camera.position)})).sort((U,ie)=>U.distance-ie.distance);return G.map(U=>{const ie=_.findIndex(Y=>Y.itemLabelItem.id===U.id);return ie!==void 0?Object.assign(Object.assign({},U),{zIndex:ie*10}):U})},I=()=>{g=[],e(1,f=T(s,f))};co(()=>{F()});const D=()=>{e(4,v=!1),E()};It(()=>{e(1,f=a),h=a,I(),z(),s.on("cameraUpdate",D)});const E=Ns(()=>{e(4,v=!0),I()},300),z=()=>{window.addEventListener("resize",R,!1)},F=()=>{h!==a&&(e(1,f=a),h=a,I())},R=()=>{s.once("renderFrame",I)};Ut(()=>{s.off("cameraUpdate",D),window.removeEventListener("resize",R,!1)});function ee(){u=this.clientWidth,m=this.clientHeight,e(2,u),e(3,m)}return i.$$set=j=>{"five"in j&&e(5,s=j.five),"modelOcclusionEnable"in j&&e(6,r=j.modelOcclusionEnable),"itemLabels"in j&&e(7,a=j.itemLabels),"hooks"in j&&e(0,l=j.hooks),"displayStrategyType"in j&&e(8,c=j.displayStrategyType)},[l,f,u,m,v,s,r,a,c,ee]}class Ou extends fe{constructor(t){super(),de(this,t,ju,Mu,ue,{five:5,modelOcclusionEnable:6,itemLabels:7,hooks:0,displayStrategyType:8},zu)}}function Nu(i){return i.model_item_labels.map(t=>({modelPosition:[t.position[0],t.position[1]+t.size[1],t.position[2]],...t}))}const Bu=(i,t)=>{var u,m;const e={container:document.createElement("div"),data:null,enabled:!0,fiveModeEnabled:void 0,itemLabels:[],wrapper:null,app:void 0,hooks:new me.Subscribe,modelOcclusionEnable:(u=t==null?void 0:t.modelOcclusionEnable)!=null?u:!0,displayStrategyType:(m=t==null?void 0:t.displayStrategyType)!=null?m:Et.SMALL};e.container.setAttribute("class","model-item-label-plugin-container"),e.container.style.cssText=`
|
|
523
523
|
position: absolute;
|
|
524
524
|
left: 0;
|
|
525
525
|
top: 0;
|
|
526
526
|
width: 100%;
|
|
527
527
|
height: 100%;
|
|
528
528
|
z-index: 5;
|
|
529
|
-
`,e.container.style.pointerEvents="none";const n=g=>(e.wrapper=g,g.appendChild(e.container),l(),!0),o=g=>{e.itemLabels=Nu(g),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{h(),e.container.remove()},l=()=>{var g;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(g=e.app)==null||g.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new Ou({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",f),i.once("dispose",a)},h=()=>{i.off("modeChange",f)},f=g=>{if(!!e.enabled){if(g!==me.Five.Mode.Floorplan){e.fiveModeEnabled=!1,l();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=i.currentMode===me.Five.Mode.Floorplan,l()})}};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},Fu={name:"ModelItemLabelPlugin",version:0};var Xt=(i=>(i.TOP_LEFT="topLeft",i.TOP_RIGHT="topRight",i.BOTTOM_LEFT="bottomLeft",i.BOTTOM_RIGHT="bottomRight",i))(Xt||{});function Gu(i){if(i.length===0)return[];if(Array.isArray(i[0]))return i;let t=[];return i.forEach(e=>{const n=[e[Xt.TOP_LEFT],e[Xt.BOTTOM_LEFT],e[Xt.BOTTOM_RIGHT],e[Xt.TOP_RIGHT]];t.push(n)}),t}const Ru=(i,{videoElement:t})=>{const e={videoMeshes:[],videoTextureEnabled:!1,videoSource:"",rectPoints:[],enabled:!1,videoElement:t},n=fn(i),o=new Map,s=P=>{e.videoTexture&&(e.videoTexture.image.muted=P)},r=()=>e.videoTexture?e.videoTexture.image.muted:!0,a=()=>{if(e.enabled||!e.videoTexture)return;e.enabled=!0,e.videoMeshes=c(),e.videoMeshes.forEach(
|
|
529
|
+
`,e.container.style.pointerEvents="none";const n=g=>(e.wrapper=g,g.appendChild(e.container),l(),!0),o=g=>{e.itemLabels=Nu(g),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{h(),e.container.remove()},l=()=>{var g;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(g=e.app)==null||g.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new Ou({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",f),i.once("dispose",a)},h=()=>{i.off("modeChange",f)},f=g=>{if(!!e.enabled){if(g!==me.Five.Mode.Floorplan){e.fiveModeEnabled=!1,l();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=i.currentMode===me.Five.Mode.Floorplan,l()})}};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},Fu={name:"ModelItemLabelPlugin",version:0};var Xt=(i=>(i.TOP_LEFT="topLeft",i.TOP_RIGHT="topRight",i.BOTTOM_LEFT="bottomLeft",i.BOTTOM_RIGHT="bottomRight",i))(Xt||{});function Gu(i){if(i.length===0)return[];if(Array.isArray(i[0]))return i;let t=[];return i.forEach(e=>{const n=[e[Xt.TOP_LEFT],e[Xt.BOTTOM_LEFT],e[Xt.BOTTOM_RIGHT],e[Xt.TOP_RIGHT]];t.push(n)}),t}const Ru=(i,{videoElement:t})=>{const e={videoMeshes:[],videoTextureEnabled:!1,videoSource:"",rectPoints:[],enabled:!1,videoElement:t},n=fn(i),o=new Map,s=P=>{e.videoTexture&&(e.videoTexture.image.muted=P)},r=()=>e.videoTexture?e.videoTexture.image.muted:!0,a=()=>{if(e.enabled||!e.videoTexture)return;e.enabled=!0,e.videoMeshes=c(),e.videoMeshes.forEach(L=>i.scene.add(L)),o.forEach(L=>{L.enable()});const P=()=>{if(!e.videoTexture)return;const L=()=>{var T;!e.videoTexture||((T=e.videoTexture)==null||T.image.removeEventListener("timeupdate",L),e.videoTextureEnabled=!0,e.videoMeshes.forEach(I=>{I.material.map!==e.videoTexture&&(I.material.map=e.videoTexture)}),i.needsRender=!0)};e.videoTexture.image.addEventListener("timeupdate",L),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)P();else return i.once("modelLoaded",()=>P());v()},l=()=>{!e.enabled||(e.enabled=!1,e.videoMeshes.forEach(P=>{P.geometry.dispose(),P.material.dispose(),i.scene.remove(P),e.videoTexture&&e.videoTexture.image.pause()}),o.forEach(P=>{P.disable()}),e.videoMeshes=[],i.needsRender=!0)},c=()=>e.rectPoints.map((P,L)=>{const T=new O.BufferGeometry,I=128,D=[];D.push(...P[0].toArray());for(let N=1;N<I;N++)D.push(P[0].x+(P[1].x-P[0].x)*N/I,P[0].y+(P[1].y-P[0].y)*N/I,P[0].z+(P[1].z-P[0].z)*N/I);D.push(...P[1].toArray()),D.push(...P[2].toArray());for(let N=1;N<I;N++)D.push(P[2].x+(P[3].x-P[2].x)*N/I,P[2].y+(P[3].y-P[2].y)*N/I,P[2].z+(P[3].z-P[2].z)*N/I);D.push(...P[3].toArray());const E=[];E.push(0,1);for(let N=1;N<I;N++)E.push(0,1-N/I);E.push(0,0),E.push(1,0);for(let N=1;N<I;N++)E.push(1,N/I);E.push(1,1);const z=[];for(let N=0;N<I;N++)z.push(N,N+1,I*2-N,N,I*2-N,I*2+1-N);T.setAttribute("position",new O.BufferAttribute(new Float32Array(D),3)),T.setAttribute("uv",new O.BufferAttribute(new Float32Array(E),2)),T.setIndex(new O.BufferAttribute(new Uint32Array(z),1));const F=new O.MeshBasicMaterial({map:e.videoTextureEnabled?e.videoTexture:e.imageTexture,side:O.DoubleSide}),R=new O.Mesh(T,F);R.renderOrder=1,R.name=`ModelTVVideoPlugin-${L}-${performance.now()}`;const ee=[P[1],P[2],P[3],P[0]],j=n.create3DDomContainer(ee);if(j!=null&&j.container){const N=document.createElement("div");N.classList.add("play-icon"),N.style.width="100%",N.style.height="100%",N.style.display="flex",N.style.justifyContent="center",N.style.alignItems="center",N.style.pointerEvents="none",j.container.appendChild(N);const G=document.createElement("img");G.src="//vrlab-static.ljcdn.com/release/web/play.2ada5b6f.png",G.style.width="200px",G.style.pointerEvents="auto",G.onclick=()=>{e.videoTexture.image.muted=!1,e.videoTexture.image.play()},N.appendChild(G),o.set(R,j)}return R}),h=P=>{const L=new O.TextureLoader().load(P);return L.minFilter=O.LinearFilter,L.magFilter=O.LinearFilter,L.format=O.RGBFormat,L},f=(P,L)=>new Promise((T,I)=>{const D=new XMLHttpRequest;D.onreadystatechange=()=>{if(D.readyState==4)if(D.status==200){const E=window.URL||window.webkitURL;L=L||document.createElement("video"),L.crossOrigin="anonymous",L.muted=!0,L.loop=!0,L.playsInline=!0,L.src=E.createObjectURL(D.response);const z=new O.VideoTexture(L);z.minFilter=O.LinearFilter,z.magFilter=O.LinearFilter,z.format=O.RGBFormat,T(Object.assign(z,{videoSource:P}))}else I(new Error("Video download Error: "+D.status))},D.onerror=E=>I(E),D.open("GET",P),D.responseType="blob",D.send()}),u=async(P,L)=>{o.forEach(E=>E.dispose()),o.clear();const{video_src:T,video_poster_src:I,points:D}=P;e.videoSource=T,e.rectPoints=Gu(D).map(E=>E.map(({x:z,y:F,z:R})=>new O.Vector3(z,F,R))),e.imageTexture=h(I),L&&(e.videoElement=L),e.videoTexture=await f(e.videoSource,e.videoElement),e.enabled=!!P.enable,e.enabled&&a()},m=P=>{if(!e.enabled)return;const L=e.videoMeshes;if(!(!L||P.intersectObjects(L).length===0))return e.videoTexture&&(e.videoTexture.image.paused||e.videoTexture.image.pause()),!1},g=P=>{var L;P==="Floorplan"?n.hide():(L=e.videoTexture)!=null&&L.image.paused?n.show():n.hide()},v=()=>{if(!e.enabled)return;const P=i.camera.position;if(o.forEach((L,T)=>{const I=L.css3DObject.position.clone(),D=I.clone().sub(P).normalize(),E=new O.Raycaster(P,D),z=i.model.intersectRaycaster(E)[0],F=I.distanceTo(P),R=.01;z&&z.distance+R<F?L.hide():L.show()}),!r()){const L=e.rectPoints.find(T=>{const I=T[0].clone().add(T[1]).add(T[2]).add(T[3]).divideScalar(4);return T.map(D=>D.clone().add(I).divideScalar(2)).filter(D=>{const E=D.distanceTo(P),z=new O.Raycaster(P,D.clone().sub(P).normalize()),F=i.model.intersectRaycaster(z)[0],R=.01;return!(F&&F.distance+R<E)}).length>=2});(!L||L.length===0)&&s(!0)}},b=()=>{v()},y=()=>{e.videoMeshes.forEach(P=>{P&&(P.needsRender=!0)})},x=()=>{l(),e.videoTexture=void 0,i.off("modeChange",g),i.off("wantsTapGesture",m),i.off("panoArrived",b),i.off("renderFrame",y),o.clear()};return i.on("modeChange",g),i.on("wantsTapGesture",m),i.on("panoArrived",b),i.on("renderFrame",y),{enable:a,disable:l,load:u,dispose:x,state:e,css3DRenderPlugin:n}};function Xu(i){be(i,"svelte-1q3t254",`.item-label-item.svelte-1q3t254.svelte-1q3t254{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-1q3t254-fadeIn .3s ease-in}.item-label-item.fold.svelte-1q3t254>.item-label-item__text-wrap.svelte-1q3t254{visibility:hidden}.item-label-item.fold.svelte-1q3t254>.item-label-item__bar.anchor.svelte-1q3t254{visibility:hidden}.item-label-item.fold.svelte-1q3t254>.item-label-item__bar.anchor.svelte-1q3t254:after{visibility:visible}.item-label-item__text-wrap.svelte-1q3t254.svelte-1q3t254{height:-moz-fit-content;height:fit-content;padding:0.625rem 1.04167rem 0.625rem 0.625rem;position:absolute;width:-moz-max-content;width:max-content;max-width:24.63542rem;min-height:4.79167rem;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:1.5px solid rgba(255, 255, 255, .65);border-radius:0.15625rem;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-1q3t254.svelte-1q3t254{padding:0;max-width:unset;min-height:unset;background-image:unset;border:0;border-radius:0}.icon-wrap.svelte-1q3t254.svelte-1q3t254{width:3.54167rem;height:100%;display:flex;justify-content:center;align-content:center}.icon.svelte-1q3t254.svelte-1q3t254{width:3.54167rem;height:3.54167rem;background-repeat:no-repeat;background-size:contain;background-position:center}.item-label-text.svelte-1q3t254.svelte-1q3t254{margin-left:0.625rem;padding-left:0.625rem;min-height:3.54167rem;height:auto;display:flex;flex-flow:column;justify-content:space-around;align-content:flex-start;border-left:solid rgba(255, 255, 255, .2) 1px;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-1q3t254.svelte-1q3t254{white-space:nowrap;font-size:1.14583rem;font-weight:bold;line-height:1.5625rem}.item-name.svelte-1q3t254.svelte-1q3t254{height:auto;word-wrap:break-word;word-break:break-all;font-size:1.04167rem;line-height:1.45833rem}.item-label-item__bar.svelte-1q3t254.svelte-1q3t254{position:absolute;bottom:0;width:0.15625rem;background-image:linear-gradient(to bottom, white, rgba(255, 255, 255, 0));box-shadow:0 2px 0.41667rem 0 rgba(0, 0, 0, 0.20);pointer-events:none}.item-label-item__bar.anchor.svelte-1q3t254.svelte-1q3t254:after{content:'';position:absolute;bottom:0;width:1.25rem;height:1.25rem;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.54688rem, 50%)}@keyframes svelte-1q3t254-fadeIn{from{opacity:0
|
|
530
530
|
}to{opacity:1
|
|
531
|
-
}}`)}function Qu(i){let t,e,n,o=(i[0].code||i[0].id)+"",s,r,a,l=i[0].name+"",c,h=i[0].icon&&Rs(i);return{c(){h&&h.c(),t=pe(),e=Q("div"),n=Q("span"),s=Ue(o),r=pe(),a=Q("span"),c=Ue(l),C(n,"class","item-model svelte-1q3t254"),C(a,"class","item-name svelte-1q3t254"),C(e,"class","item-label-text svelte-1q3t254")},m(f,u){h&&h.m(f,u),V(f,t,u),V(f,e,u),W(e,n),W(n,s),W(e,r),W(e,a),W(a,c)},p(f,u){f[0].icon?h?h.p(f,u):(h=Rs(f),h.c(),h.m(t.parentNode,t)):h&&(h.d(1),h=null),u&1&&o!==(o=(f[0].code||f[0].id)+"")&&ct(s,o),u&1&&l!==(l=f[0].name+"")&&ct(c,l)},d(f){h&&h.d(f),f&&H(t),f&&H(e)}}}function Wu(i){let t;return{c(){t=Q("div")},m(e,n){V(e,t,n),i[6](t)},p:ne,d(e){e&&H(t),i[6](null)}}}function Rs(i){let t,e,n,o,s;return{c(){t=Q("div"),e=Q("div"),C(e,"class","icon svelte-1q3t254"),C(e,"style",n=`background-image: url(${i[0].icon})`),C(t,"class","icon-wrap svelte-1q3t254")},m(r,a){V(r,t,a),W(t,e),o||(s=qe(t,"click",i[7]),o=!0)},p(r,a){a&1&&n!==(n=`background-image: url(${r[0].icon})`)&&C(e,"style",n)},d(r){r&&H(t),o=!1,s()}}}function Hu(i){let t,e,n,o,s,r,a,l,c,h;function f(g,v){return v&1&&(n=null),n==null&&(n=!!Boolean(typeof g[0].render=="function")),n?Wu:Qu}let u=f(i,-1),m=u(i);return{c(){t=Q("div"),e=Q("div"),m.c(),s=pe(),r=Q("div"),C(e,"class",o=Se(ot("item-label-item__text-wrap",{"item-label-item__custom":Boolean(typeof i[0].render=="function")}))+" svelte-1q3t254"),S(e,"bottom",`${i[0].strokeLength}px`),C(r,"class",a=Se(ot("item-label-item__bar",{anchor:i[1]}))+" svelte-1q3t254"),S(r,"height",`${i[0].strokeLength}px`),C(t,"class",l=Se(ot("item-label-item",{fold:i[0].isFold}))+" svelte-1q3t254"),S(t,"z-index",i[0].zIndex),S(t,"transform",i[0].transform)},m(g,v){V(g,t,v),W(t,e),m.m(e,null),W(t,s),W(t,r),c||(h=qe(e,"click",i[4]),c=!0)},p(g,[v]){u===(u=f(g,v))&&m?m.p(g,v):(m.d(1),m=u(g),m&&(m.c(),m.m(e,null))),v&1&&o!==(o=Se(ot("item-label-item__text-wrap",{"item-label-item__custom":Boolean(typeof g[0].render=="function")}))+" svelte-1q3t254")&&C(e,"class",o),v&1&&S(e,"bottom",`${g[0].strokeLength}px`),v&2&&a!==(a=Se(ot("item-label-item__bar",{anchor:g[1]}))+" svelte-1q3t254")&&C(r,"class",a),v&1&&S(r,"height",`${g[0].strokeLength}px`),v&1&&l!==(l=Se(ot("item-label-item",{fold:g[0].isFold}))+" svelte-1q3t254")&&C(t,"class",l),v&1&&S(t,"z-index",g[0].zIndex),v&1&&S(t,"transform",g[0].transform)},i:ne,o:ne,d(g){g&&H(t),m.d(),c=!1,h()}}}function Yu(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(f){jt[f?"unshift":"push"](()=>{l=f,e(3,l)})}const h=f=>r(n);return i.$$set=f=>{"itemLabel"in f&&e(0,n=f.itemLabel),"hooks"in f&&e(5,o=f.hooks),"anchorEnabled"in f&&e(1,s=f.anchorEnabled),"onIconClick"in f&&e(2,r=f.onIconClick)},i.$$.update=()=>{if(i.$$.dirty&9&&typeof n.render=="function"&&l&&l.children.length===0){const f=n.render(n);f&&l.appendChild(f)}},[n,s,r,l,a,o,c,h]}class Vu extends fe{constructor(t){super(),de(this,t,Yu,Hu,ue,{itemLabel:0,hooks:5,anchorEnabled:1,onIconClick:2},Xu)}}const{Raycaster:Zu,Vector3:If}=O,Xs=(i,t,e,n)=>{const o=t.clone().sub(e).normalize(),s=new Zu;s.set(e,o);const[r]=i.model.intersectRaycaster(s);return r&&r.distance+.01<n};var Lt=(i=>(i.SMALL="small",i.MIDLLE="middle",i.LARGE="large",i.EXTRA_LARGE="x-large",i))(Lt||{});const Ju=(i,t)=>{switch(t){case Lt.SMALL:return Math.ceil(-27.78*i+85);case Lt.MIDLLE:return Math.ceil(-38.9*i+130);case Lt.LARGE:return Math.ceil(-44.44*i+140);case Lt.EXTRA_LARGE:return Math.ceil(-92.59*i+300)}},Uu=i=>`translate(${i[0]}px, ${i[1]}px)`;function Qs(i){return i.map(t=>({observerIndex:void 0,visible:!1,isFold:!1,...t}))}function qu(i){be(i,"svelte-gk8s47",".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}")}function Ws(i,t,e){const n=i.slice();return n[30]=t[e],n}function Hs(i){let t,e;return t=new Vu({props:{itemLabel:i[30],hooks:i[0],anchorEnabled:i[2],onIconClick:i[6]}}),{c(){Pe(t.$$.fragment)},m(n,o){Ae(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||(X(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){ye(t,n)}}}function Ys(i,t){let e,n,o,s=t[30].visible&&Hs(t);return{key:i,first:null,c(){e=Re(),s&&s.c(),n=Re(),this.first=e},m(r,a){V(r,e,a),s&&s.m(r,a),V(r,n,a),o=!0},p(r,a){t=r,t[30].visible?s?(s.p(t,a),a[0]&2&&X(s,1)):(s=Hs(t),s.c(),X(s,1),s.m(n.parentNode,n)):s&&(Ce(),K(s,1,1,()=>{s=null}),Ee())},i(r){o||(X(s),o=!0)},o(r){K(s),o=!1},d(r){r&&H(e),s&&s.d(r),r&&H(n)}}}function Ku(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=Ws(i,r,l),h=a(c);n.set(h,e[l]=Ys(h,c))}return{c(){t=Q("div");for(let l=0;l<e.length;l+=1)e[l].c();C(t,"class","item-labels-container svelte-gk8s47"),Ke(()=>i[12].call(t)),S(t,"opacity",i[5]?1:0)},m(l,c){V(l,t,c);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=St(t,i[12].bind(t)),s=!0},p(l,c){c[0]&71&&(r=l[1],Ce(),e=gt(e,c,a,1,l,r,n,t,Ot,Ys,null,Ws),Ee()),c[0]&32&&S(t,"opacity",l[5]?1:0)},i(l){if(!s){for(let c=0;c<r.length;c+=1)X(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)K(e[c]);s=!1},d(l){l&&H(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}let _u=11;function $u(i,t,e){const{Raycaster:n,Vector3:o}=O;let{five:s}=t,{modelOcclusionEnable:r}=t,{itemLabels:a}=t,{hooks:l}=t,{displayStrategyType:c}=t,{maxVisibleDistance:h}=t,f=null,u=null,m=(s==null?void 0:s.currentMode)===me.Five.Mode.Panorama,g,v,b=[],y=!0;const x=(G,_)=>{const U=G.camera.position.clone(),ie=new o(_.modelPosition[0],_.modelPosition[1],_.modelPosition[2]),Y=ie.distanceTo(U);return h!==void 0&&G.state.mode===me.Five.Mode.Panorama&&Y>h?!1:Xs(G,ie.clone().sub(U).normalize(),U,Y)},P=G=>{const{camera:_,model:U}=s,{x:ie,y:Y,z:te}=G.clone().project(_),re=(ie+1)/2,oe=(2-(Y+1))/2,Le=Math.abs(te)<1&&[re,oe].every(Oe=>Oe<1&&Oe>=0);return Boolean(Le)},
|
|
531
|
+
}}`)}function Qu(i){let t,e,n,o=(i[0].code||i[0].id)+"",s,r,a,l=i[0].name+"",c,h=i[0].icon&&Rs(i);return{c(){h&&h.c(),t=pe(),e=Q("div"),n=Q("span"),s=Ue(o),r=pe(),a=Q("span"),c=Ue(l),C(n,"class","item-model svelte-1q3t254"),C(a,"class","item-name svelte-1q3t254"),C(e,"class","item-label-text svelte-1q3t254")},m(f,u){h&&h.m(f,u),V(f,t,u),V(f,e,u),W(e,n),W(n,s),W(e,r),W(e,a),W(a,c)},p(f,u){f[0].icon?h?h.p(f,u):(h=Rs(f),h.c(),h.m(t.parentNode,t)):h&&(h.d(1),h=null),u&1&&o!==(o=(f[0].code||f[0].id)+"")&&ct(s,o),u&1&&l!==(l=f[0].name+"")&&ct(c,l)},d(f){h&&h.d(f),f&&H(t),f&&H(e)}}}function Wu(i){let t;return{c(){t=Q("div")},m(e,n){V(e,t,n),i[6](t)},p:ne,d(e){e&&H(t),i[6](null)}}}function Rs(i){let t,e,n,o,s;return{c(){t=Q("div"),e=Q("div"),C(e,"class","icon svelte-1q3t254"),C(e,"style",n=`background-image: url(${i[0].icon})`),C(t,"class","icon-wrap svelte-1q3t254")},m(r,a){V(r,t,a),W(t,e),o||(s=qe(t,"click",i[7]),o=!0)},p(r,a){a&1&&n!==(n=`background-image: url(${r[0].icon})`)&&C(e,"style",n)},d(r){r&&H(t),o=!1,s()}}}function Hu(i){let t,e,n,o,s,r,a,l,c,h;function f(g,v){return v&1&&(n=null),n==null&&(n=!!Boolean(typeof g[0].render=="function")),n?Wu:Qu}let u=f(i,-1),m=u(i);return{c(){t=Q("div"),e=Q("div"),m.c(),s=pe(),r=Q("div"),C(e,"class",o=Se(ot("item-label-item__text-wrap",{"item-label-item__custom":Boolean(typeof i[0].render=="function")}))+" svelte-1q3t254"),S(e,"bottom",`${i[0].strokeLength}px`),C(r,"class",a=Se(ot("item-label-item__bar",{anchor:i[1]}))+" svelte-1q3t254"),S(r,"height",`${i[0].strokeLength}px`),C(t,"class",l=Se(ot("item-label-item",{fold:i[0].isFold}))+" svelte-1q3t254"),S(t,"z-index",i[0].zIndex),S(t,"transform",i[0].transform)},m(g,v){V(g,t,v),W(t,e),m.m(e,null),W(t,s),W(t,r),c||(h=qe(e,"click",i[4]),c=!0)},p(g,[v]){u===(u=f(g,v))&&m?m.p(g,v):(m.d(1),m=u(g),m&&(m.c(),m.m(e,null))),v&1&&o!==(o=Se(ot("item-label-item__text-wrap",{"item-label-item__custom":Boolean(typeof g[0].render=="function")}))+" svelte-1q3t254")&&C(e,"class",o),v&1&&S(e,"bottom",`${g[0].strokeLength}px`),v&2&&a!==(a=Se(ot("item-label-item__bar",{anchor:g[1]}))+" svelte-1q3t254")&&C(r,"class",a),v&1&&S(r,"height",`${g[0].strokeLength}px`),v&1&&l!==(l=Se(ot("item-label-item",{fold:g[0].isFold}))+" svelte-1q3t254")&&C(t,"class",l),v&1&&S(t,"z-index",g[0].zIndex),v&1&&S(t,"transform",g[0].transform)},i:ne,o:ne,d(g){g&&H(t),m.d(),c=!1,h()}}}function Yu(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(f){jt[f?"unshift":"push"](()=>{l=f,e(3,l)})}const h=f=>r(n);return i.$$set=f=>{"itemLabel"in f&&e(0,n=f.itemLabel),"hooks"in f&&e(5,o=f.hooks),"anchorEnabled"in f&&e(1,s=f.anchorEnabled),"onIconClick"in f&&e(2,r=f.onIconClick)},i.$$.update=()=>{if(i.$$.dirty&9&&typeof n.render=="function"&&l&&l.children.length===0){const f=n.render(n);f&&l.appendChild(f)}},[n,s,r,l,a,o,c,h]}class Vu extends fe{constructor(t){super(),de(this,t,Yu,Hu,ue,{itemLabel:0,hooks:5,anchorEnabled:1,onIconClick:2},Xu)}}const{Raycaster:Zu,Vector3:If}=O,Xs=(i,t,e,n)=>{const o=t.clone().sub(e).normalize(),s=new Zu;s.set(e,o);const[r]=i.model.intersectRaycaster(s);return r&&r.distance+.01<n};var Lt=(i=>(i.SMALL="small",i.MIDLLE="middle",i.LARGE="large",i.EXTRA_LARGE="x-large",i))(Lt||{});const Ju=(i,t)=>{switch(t){case Lt.SMALL:return Math.ceil(-27.78*i+85);case Lt.MIDLLE:return Math.ceil(-38.9*i+130);case Lt.LARGE:return Math.ceil(-44.44*i+140);case Lt.EXTRA_LARGE:return Math.ceil(-92.59*i+300)}},Uu=i=>`translate(${i[0]}px, ${i[1]}px)`;function Qs(i){return i.map(t=>({observerIndex:void 0,visible:!1,isFold:!1,...t}))}function qu(i){be(i,"svelte-gk8s47",".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}")}function Ws(i,t,e){const n=i.slice();return n[30]=t[e],n}function Hs(i){let t,e;return t=new Vu({props:{itemLabel:i[30],hooks:i[0],anchorEnabled:i[2],onIconClick:i[6]}}),{c(){Pe(t.$$.fragment)},m(n,o){Ae(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||(X(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){ye(t,n)}}}function Ys(i,t){let e,n,o,s=t[30].visible&&Hs(t);return{key:i,first:null,c(){e=Re(),s&&s.c(),n=Re(),this.first=e},m(r,a){V(r,e,a),s&&s.m(r,a),V(r,n,a),o=!0},p(r,a){t=r,t[30].visible?s?(s.p(t,a),a[0]&2&&X(s,1)):(s=Hs(t),s.c(),X(s,1),s.m(n.parentNode,n)):s&&(Ce(),K(s,1,1,()=>{s=null}),Ee())},i(r){o||(X(s),o=!0)},o(r){K(s),o=!1},d(r){r&&H(e),s&&s.d(r),r&&H(n)}}}function Ku(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=Ws(i,r,l),h=a(c);n.set(h,e[l]=Ys(h,c))}return{c(){t=Q("div");for(let l=0;l<e.length;l+=1)e[l].c();C(t,"class","item-labels-container svelte-gk8s47"),Ke(()=>i[12].call(t)),S(t,"opacity",i[5]?1:0)},m(l,c){V(l,t,c);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=St(t,i[12].bind(t)),s=!0},p(l,c){c[0]&71&&(r=l[1],Ce(),e=gt(e,c,a,1,l,r,n,t,Ot,Ys,null,Ws),Ee()),c[0]&32&&S(t,"opacity",l[5]?1:0)},i(l){if(!s){for(let c=0;c<r.length;c+=1)X(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)K(e[c]);s=!1},d(l){l&&H(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}let _u=11;function $u(i,t,e){const{Raycaster:n,Vector3:o}=O;let{five:s}=t,{modelOcclusionEnable:r}=t,{itemLabels:a}=t,{hooks:l}=t,{displayStrategyType:c}=t,{maxVisibleDistance:h}=t,f=null,u=null,m=(s==null?void 0:s.currentMode)===me.Five.Mode.Panorama,g,v,b=[],y=!0;const x=(G,_)=>{const U=G.camera.position.clone(),ie=new o(_.modelPosition[0],_.modelPosition[1],_.modelPosition[2]),Y=ie.distanceTo(U);return h!==void 0&&G.state.mode===me.Five.Mode.Panorama&&Y>h?!1:Xs(G,ie.clone().sub(U).normalize(),U,Y)},P=G=>{const{camera:_,model:U}=s,{x:ie,y:Y,z:te}=G.clone().project(_),re=(ie+1)/2,oe=(2-(Y+1))/2,Le=Math.abs(te)<1&&[re,oe].every(Oe=>Oe<1&&Oe>=0);return Boolean(Le)},L=(G,_)=>{const U=new o(_.modelPosition[0],_.modelPosition[1],_.modelPosition[2]),ie=G.project2d(U),Y=ie==null?void 0:ie.x,te=ie==null?void 0:ie.y;return[Y,te]},T=(G,_)=>{const U=_.map(Y=>{if(G.state.panoIndex!==Y.panoIndex)return Object.assign(Object.assign({},Y),{visible:!1});const te=L(G,Y);Y.name.length*_u;const re=Ju(Y.modelPosition[1],c),oe=G.currentMode===me.Five.Mode.Panorama?P(new o(Y.position[0],Y.position[1],Y.position[2])):!0,he=r?x(G,Y):!1,we=oe&&!he;if(!we)return Object.assign(Object.assign({},Y),{visible:we});b.push(te);const Le=Uu(te);return Object.assign(Object.assign({},Y),{visible:we,transform:Le,strokeLength:re})}),ie=U.filter(({visible:Y})=>Y).map(Y=>({itemLabelItem:Y,distance:new o(Y.modelPosition[0],Y.modelPosition[1],Y.modelPosition[2]).clone().distanceTo(G.camera.position)})).sort((Y,te)=>Y.distance-te.distance);return U.map(Y=>{const te=ie.findIndex(re=>re.itemLabelItem.id===Y.id);return te!==void 0?Object.assign(Object.assign({},Y),{zIndex:te*10}):Y})},I=()=>{b=[],e(1,u=T(s,u))},D=()=>{e(5,y=!1),E()},E=Ns(()=>{e(5,y=!0),I()},300),z=()=>{s.once("renderFrame",I)},F=()=>{window.addEventListener("resize",z,!1)},R=()=>{f!==a&&(e(1,u=Qs(a)),f=a,I())},ee=(G,_)=>{let U=[];for(let Y=0;Y<_.length;Y++){const{position:te,panoIndex:re}=_[Y],oe=G.distanceTo(te);(h===void 0||oe<=h||s.state.mode!==me.Five.Mode.Panorama)&&U.push({panoIndex:re,obVector:te,distance:oe})}U=U.sort((Y,te)=>Y.distance-te.distance);let ie;for(let Y=0;Y<U.length;Y++){const{obVector:te,distance:re,panoIndex:oe}=U[Y];if(!Xs(s,G,te,re)){ie=oe;break}}return typeof ie=="number"?_[ie]:void 0},j=G=>{if(s.state.mode===me.Five.Mode.Panorama)return;const _=s.work.observers,U=new o().fromArray(G.position),ie=ee(U,_);if(ie&&(G.observerIndex=ie.panoIndex),typeof G.observerIndex=="number"){const Y=_[G.observerIndex],te=U.clone().sub(Y.position).normalize(),re={longitude:Math.PI+Math.atan2(te.x,te.z),latitude:Math.acos(te.y/te.length())-Math.PI/2};s.setState(Object.assign(Object.assign({},re),{mode:me.Five.Mode.Panorama,panoIndex:G.observerIndex})),s.once("initAnimationEnded",()=>{e(1,u=u.map(oe=>Object.assign(Object.assign({},oe),{isFold:oe.id!==G.id}))),s.once("cameraUpdate",()=>{e(1,u=u.map(oe=>Object.assign(Object.assign({},oe),{isFold:!1})))})})}};co(()=>{R()}),It(()=>{e(1,u=Qs(a)),f=a,I(),F(),s.on("cameraUpdate",D)}),Ut(()=>{s.off("cameraUpdate",D),window.removeEventListener("resize",z,!1)});function N(){g=this.clientWidth,v=this.clientHeight,e(3,g),e(4,v)}return i.$$set=G=>{"five"in G&&e(7,s=G.five),"modelOcclusionEnable"in G&&e(8,r=G.modelOcclusionEnable),"itemLabels"in G&&e(9,a=G.itemLabels),"hooks"in G&&e(0,l=G.hooks),"displayStrategyType"in G&&e(10,c=G.displayStrategyType),"maxVisibleDistance"in G&&e(11,h=G.maxVisibleDistance)},[l,u,m,g,v,y,j,s,r,a,c,h,N]}class ed extends fe{constructor(t){super(),de(this,t,$u,Ku,ue,{five:7,modelOcclusionEnable:8,itemLabels:9,hooks:0,displayStrategyType:10,maxVisibleDistance:11},qu,[-1,-1])}}function td(i){return i.item_labels.map(t=>({...t,modelPosition:[t.position[0],t.position[1],t.position[2]],observerIndex:void 0}))}const nd=void 0,id=(i,t)=>{var u,m,g,v;const e={container:document.createElement("div"),data:null,enabled:!0,fiveModeEnabled:!0,itemLabels:[],wrapper:null,app:void 0,hooks:new me.Subscribe,modelOcclusionEnable:(u=t==null?void 0:t.modelOcclusionEnable)!=null?u:!0,onlyVisibleInPanorama:(m=t==null?void 0:t.onlyVisibleInPanorama)!=null?m:!0,displayStrategyType:(g=t==null?void 0:t.displayStrategyType)!=null?g:Lt.SMALL,maxVisibleDistance:(v=t==null?void 0:t.maxVisibleDistance)!=null?v:nd};e.container.setAttribute("class","item-label-plugin-container"),e.container.style.cssText=`
|
|
532
532
|
position: absolute;
|
|
533
533
|
left: 0;
|
|
534
534
|
top: 0;
|
|
535
535
|
width: 100%;
|
|
536
536
|
height: 100%;
|
|
537
537
|
z-index: 5;
|
|
538
|
-
`,e.container.style.pointerEvents="none";const n=b=>(e.wrapper=b,b.appendChild(e.container),l(),!0),o=b=>{e.itemLabels=td(b),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{h(),e.container.remove()},l=()=>{var b;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(b=e.app)==null||b.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new ed({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",f),i.once("dispose",a)},h=()=>{i.off("modeChange",f)},f=b=>{if(b!==me.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}},od={name:"ItemLabelPlugin",version:0};class sd extends Ho{constructor(e){super(e);d(this,"state");d(this,"container");d(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({...e,userAction:!0})}disable(e){this.enabled=!1,this.updateState({...e,userAction:!0})}show(e){if(!!this.state.enabled)return this.setState({...this.state,visible:!0},e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState({...this.state,visible:!1},e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o={...this.state};this.state={...this.state,...e,...n},this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===me.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState({...this.state,enabled:this.enabled,visible:this.visible},e)}}function rd(i){be(i,"svelte-16kdbw2",'.plugin-DoorLabelPlugin-item.svelte-16kdbw2.svelte-16kdbw2{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity 0.3s ease}.plugin-DoorLabelPlugin-cnt.svelte-16kdbw2.svelte-16kdbw2{position:absolute;top:50%;left:50%;border-radius:2px;background:rgba(0, 0, 0, 0.35);line-height:0.625rem;padding:0.3125rem;white-space:nowrap;font-size:0.625rem;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-16kdbw2.svelte-16kdbw2::after{content:"";display:block;position:absolute;top:-1px;left:-1px;bottom:-1px;right:-1px;border-radius:2px;border:1px 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-16kdbw2.svelte-16kdbw2:active,.plugin-DoorLabelPlugin-cnt.svelte-16kdbw2.svelte-16kdbw2:focus{background:rgba(0, 0, 0, 0.5);color:rgba(255, 255, 255, 0.5)}.plugin-DoorLabelPlugin-icon.svelte-16kdbw2.svelte-16kdbw2{background:url("//vrlab-image4.ljcdn.com/release/web/DoorLabel-icon.de1304ae.svg") no-repeat;background-size:100%;display:inline-block;width:0.52083rem;height:0.52083rem;margin-left:0.20833rem;transform-origin:center}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].left.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-16kdbw2 .plugin-DoorLabelPlugin-txt.svelte-16kdbw2{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(-90deg);margin-left:0;margin-right:0.20833rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].forward.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-16kdbw2 .plugin-DoorLabelPlugin-txt.svelte-16kdbw2{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(-90deg);margin-left:0;margin-right:0.20833rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].back.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-16kdbw2 .plugin-DoorLabelPlugin-txt.svelte-16kdbw2{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(-90deg);margin-left:0;margin-right:0.20833rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].right.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-16kdbw2 .plugin-DoorLabelPlugin-txt.svelte-16kdbw2{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(-90deg);margin-left:0;margin-right:0.20833rem;order:0}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-16kdbw2.svelte-16kdbw2{color:#f9eac1}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{background:url("//vrlab-image4.ljcdn.com/release/web/arrow.6e8ec00e.svg") no-repeat}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-16kdbw2.svelte-16kdbw2:active,.plugin-DoorLabelPlugin-cnt--customBrand.svelte-16kdbw2.svelte-16kdbw2:focus{background:rgba(0, 0, 0, 0.5);color:rgba(249, 234, 193, 0.5)}')}function ad(i){let t,e,n,o,s,r,a,l;return{c(){t=Q("div"),e=Q("div"),n=Q("span"),n.textContent=`${i[8]}`,o=pe(),s=Q("i"),C(n,"class","plugin-DoorLabelPlugin-txt svelte-16kdbw2"),C(s,"class","plugin-DoorLabelPlugin-icon svelte-16kdbw2"),C(e,"class",r=Se(ot("plugin-DoorLabelPlugin-cnt",i[0].toward))+" svelte-16kdbw2"),C(e,"style",`transform: ${i[6]||"initial"};pointer-events: ${i[5]?"auto":"none"};opacity: ${i[5]?1:0}`),C(e,"data-camera-toward",i[7]),C(t,"style",`left: ${i[3]||0}%;top: ${i[4]||0}%;opacity: ${i[5]?1:0}`),C(t,"class","plugin-DoorLabelPlugin-item svelte-16kdbw2")},m(c,h){V(c,t,h),W(t,e),W(e,n),W(e,o),W(e,s),i[10](t),a||(l=qe(e,"click",i[9]),a=!0)},p(c,[h]){h&1&&r!==(r=Se(ot("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-16kdbw2")&&C(e,"class",r)},i:ne,o:ne,d(c){c&&H(t),i[10](null),a=!1,l()}}}function ld(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:h,cameraToward:f,name:u}=n,m=0;const g=()=>{if(!r||!a||!l||!s)return;const y=s.current.clientWidth/window.innerWidth*100,x=s.current.clientHeight/window.innerHeight*100;if(r<=y/2||r>=100-y/2||a<=x/2||a>=100-x/2)return;h!==m&&(console.log("panoDoorLabelPlugin",h,"\u89E6\u53D1\u57CB\u70B9"),m=h)},v=y=>{o&&o()};function b(y){jt[y?"unshift":"push"](()=>{s=y,e(2,s)})}return i.$$set=y=>{"props"in y&&e(0,n=y.props),"onClick"in y&&e(1,o=y.onClick)},g(),[n,o,s,r,a,l,c,f,u,v,b]}class cd extends fe{constructor(t){super(),de(this,t,ld,ad,ue,{props:0,onClick:1},rd)}}function hd(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 ud(i){const{camera:t}=i,e=t.getWorldDirection(new M.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 dd(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function fd(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 md={userAction:!0};class pd extends sd{constructor(e){super(e);d(this,"MinVisibledistance",1.8);d(this,"MaxVisibledistance",5);d(this,"OffsetHeight",-1.3);d(this,"rooms");d(this,"floorplanServerData");d(this,"doorLabelItems");d(this,"visibleLabelMap",new Map);d(this,"labelItems",[]);d(this,"doorLabels");d(this,"roomObservers");d(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,this.five.once("panoArrived",()=>{console.log("doorplugin","panoArrived"),this.initData()})});d(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,h=e==null?void 0:e.find(f=>f.floor_index===c);if(h){const f=h.rooms.find(u=>u.observer_indexs.includes(l));if(f)return{panoIndex:l,floorIndex:c,name:f.name}}}).filter(Boolean);this.roomObservers=o});d(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});d(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 h=l.position.clone(),f=h.distanceTo(s);if(f<this.MinVisibledistance||f>this.MaxVisibledistance)return;const u=new M.Raycaster,m=h.clone().sub(s).normalize();u.set(s,m);const[g]=this.five.model.intersectRaycaster(u);g&&g.distance+.1<f||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});d(this,"fixDoorPosition",()=>{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 M.Vector3),l=[],c=[...this.labelItems];if(c.forEach((h,f)=>{if(h.visible){const u=n.position.distanceTo(h.position),m=h.position.clone().add(new M.Vector3(0,this.OffsetHeight,0)),v=m.clone().sub(n.position).normalize().angleTo(a),b=m.clone().project(n),y=(b.x+1)/2.2*100,x=(-b.y+1)/2.2*100,P=y>=0&&y<=100&&x>=0&&x<=100&&u>this.MinVisibledistance&&u<=this.MaxVisibledistance;h.left=y,h.top=x,h.inSight=P&&v<Math.PI/2,h.cameraToward=ud(this.five),P?l.push({disFromCameraToLabel:u,left:y,top:x,index:f}):h.transform="translate(-50%, -50%)"}else h.inSight=!1}),l.length>1){let h=0;l.sort((f,u)=>u.disFromCameraToLabel-f.disFromCameraToLabel);for(let f=1;f<l.length;f++){const{index:u,left:m,top:g}=l[f-1],{index:v,left:b,top:y}=l[f],x=this.container.children[u],P=this.container.children[v];if(!x||!P)return;const k={left:s*m/100,top:r*g/100,width:x.children[0].clientWidth,height:x.children[0].clientHeight},T={left:s*b/100,top:r*y/100,width:P.children[0].clientWidth,height:P.children[0].clientHeight};hd(k,T)&&(h++,c[u].transform=`translate(-50%, ${(h-1)*100-50}%)`,c[v].transform=`translate(-50%, ${h*100-50}%)`)}}this.labelItems=c,this.render()});d(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:o}=this.five;let s,r,a=1/0;for(let l=0;l<o.observers.length;l++){if(this.roomObservers[l].name!==e)continue;const h=o.observers[l].standingPosition,f=n.distanceTo(h);f<a&&(s=l,r=h.clone().sub(n).normalize(),a=f)}if(r!==null&&s!==null){const l={};if(a>0){const h=new M.Vector3(0,0,-1),f=r.clone(),u=new M.Quaternion;u.setFromUnitVectors(h,f);const m=new M.Euler;m.setFromQuaternion(u,"YXZ"),l.longitude=m.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});d(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(h=>!!(h&&h.name===r.name)),l=this.five.work.observers.filter((h,f)=>!!r.observer_indexs.find(u=>u===f));a&&a.forEach(h=>{const f=h.position;let u=1/0,m;l.forEach(v=>{const b=v.standingPosition,y={x:b.x,y:b.y,z:b.z},x=dd(f,y);x<u&&(u=x,m=y)}),m&&(f.y=m.y+.01);const g=new M.Vector3(f.x,f.y,f.z);g.add(new M.Vector3(-.2,1.8,0).applyEuler(new M.Euler(0,h.rad,0))),this.doorLabels.push({roomName:r.name,name:h.name,position:g,toward:fd(h.rad)})})}),this.labelItems=this.doorLabels.map(r=>({...r,left:0,top:0,visible:!1,inSight:!1,transform:"",cameraToward:""})),console.log("doorplugin","labelItems",this.labelItems),this.five.on("wantsToMoveToPano",this.hideAllLabels),this.five.on("modelLoaded",this.fixDoorVisibleAndPosition),this.five.on("panoArrived",this.fixDoorVisibleAndPosition),this.five.on("initAnimationEnded",this.fixDoorPosition),this.five.on("cameraUpdate",this.fixDoorPosition),this.five.on("mouseWheel",this.fixDoorPosition),this.five.on("pinchGesture",this.fixDoorPosition),this.fixDoorVisibleAndPosition()})}stateChangedCallback(e,n){if(this.hooks.hasListener("stateChange")){const o={state:this.state,prevState:e,userAction:n?n.userAction:md.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 cd({target:this.container,props:{props:e,onClick:()=>{this.onClick(e.name,e.position)}}}))})}initState(){return{enabled:!0,visible:!0}}dispose(){this.five&&(this.five.off("wantsToMoveToPano",this.hideAllLabels),this.five.off("modelLoaded",this.fixDoorVisibleAndPosition),this.five.off("panoArrived",this.fixDoorVisibleAndPosition),this.five.off("initAnimationEnded",this.fixDoorPosition),this.five.off("cameraUpdate",this.fixDoorPosition),this.five.off("mouseWheel",this.fixDoorPosition),this.five.off("pinchGesture",this.fixDoorPosition),super.dispose())}}const gd=i=>new pd(i);var Gn={},vd=bd;function bd(i,t,e){return i[0]=t[0]+e[0],i[1]=t[1]+e[1],i}var Ad=yd;function yd(i,t,e){return i[0]=t,i[1]=e,i}var Pd=wd;function wd(i,t){var e=t[0],n=t[1],o=e*e+n*n;return o>0&&(o=1/Math.sqrt(o),i[0]=t[0]*o,i[1]=t[1]*o),i}var Id=xd;function xd(i,t,e){return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i}var Cd=Ed;function Ed(i,t){return i[0]*t[0]+i[1]*t[1]}var Ld=vd,Ti=Ad,Vs=Pd,kd=Id,Dd=Cd,Zs=[0,0];Gn.computeMiter=function(t,e,n,o,s){return Ld(t,n,o),Vs(t,t),Ti(e,-t[1],t[0]),Ti(Zs,-n[1],n[0]),s/Dd(e,Zs)},Gn.normal=function(t,e){return Ti(t,-e[1],e[0]),t},Gn.direction=function(t,e,n){return kd(t,e,n),Vs(t,t),t};var ht=Gn,kt=[0,0],Rn=[0,0],Js=[0,0],$t=[0,0],Td=function(i,t){var e=null,n=[];t&&(i=i.slice(),i.push(i[0]));for(var o=i.length,s=1;s<o;s++){var r=i[s-1],a=i[s],l=s<i.length-1?i[s+1]:null;if(ht.direction(kt,a,r),e||(e=[0,0],ht.normal(e,kt)),s===1&&zi(n,e,1),!l)ht.normal(e,kt),zi(n,e,1);else{ht.direction(Rn,l,a);var c=ht.computeMiter(Js,$t,kt,Rn,1);zi(n,$t,c)}}if(i.length>2&&t){var h=i[o-2],f=i[0],u=i[1];ht.direction(kt,f,h),ht.direction(Rn,u,f),ht.normal(e,kt);var m=ht.computeMiter(Js,$t,kt,Rn,1);n[0][0]=$t.slice(),n[o-1][0]=$t.slice(),n[0][1]=m,n[o-1][1]=m,n.pop()}return n};function zi(i,t,e){i.push([[t[0],t[1]],e])}const zd=2,Md=3,Sd=3,jd=2;function Od(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.skipPosition)!=null?l:!1,s=new O.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),h=s.getPoints(c),f=[];let u=0;const m=i;return m.forEach((g,v)=>{let b=0,y=99999999;h.forEach((I,D)=>{const E=I.distanceTo(g);E<y&&(b=D,y=E)});const x=h[b+1],P=x==null?void 0:x.distanceTo(g),k=h[b-1],T=k==null?void 0:k.distanceTo(g);if(b>u&&b-u>1){let I=b;k!==void 0&&T>.8&&(I=b+1),k!==void 0&&T>.2&&T<.3?I=b:y>.2&&y<.3&&(I=b+1);let D=u;if(x!==void 0&&P>.2&&P<.3?D=u+1:y>.2&&y<.3&&(D=u),h[D]&&h[D+1]){const F=m[v-1];if(F)if(F.equals(h[D]))D+=1;else{const R=new M.Vector3().subVectors(h[D+1],h[D]),ee=new M.Vector3().subVectors(F,h[D]);R.angleTo(ee)<Math.PI/2&&(D+=1)}}if(I<D||I-D<=1)return;const E=h.slice(D,I),z=Us(E,e,n);f.push(z),u=b}}),f}else{const c=Math.ceil(s.getLength()),h=s.getPoints(c);return[Us(h,e,n)]}}function Us(i,t,e){const n=t/2,o=e/t,s=i.length,r=Td(i.map(y=>[y.x,y.z])),l=(i.length-1)*zd*Md,c=2*s,h=c*Sd,f=c*jd,u=new Uint32Array(l),m=new Float32Array(h),g=new Float32Array(f);i.forEach((y,x)=>{});let v=0;for(let y=0;y<i.length;y++){const[x,P]=r[y][0],k=i[y],{x:T,y:I,z:D}=k,E=new M.Vector3(T+x*n,I+.05,D+P*n);m[y*6+0]=E.x,m[y*6+1]=E.y,m[y*6+2]=E.z;const z=new M.Vector3(T-x*n,I+.05,D-P*n);m[y*6+3]=z.x,m[y*6+4]=z.y,m[y*6+5]=z.z,v+=y>0?i[y-1].clone().sub(i[y]).length():0;const F=v/t/o;g[y*4+0]=0,g[y*4+1]=F,g[y*4+2]=1,g[y*4+3]=F,y!==i.length-1&&(u[y*6+0]=y*2+0,u[y*6+1]=y*2+2,u[y*6+2]=y*2+1,u[y*6+3]=y*2+2,u[y*6+4]=y*2+3,u[y*6+5]=y*2+1)}const b=new O.BufferGeometry;return b.setAttribute("position",new O.BufferAttribute(m,3)),b.setAttribute("uv",new O.BufferAttribute(g,2)),b.setIndex(new O.BufferAttribute(u,1)),b}function Nd(i){var n;const t=new O.TextureLoader().load((n=i==null?void 0:i.textureUrl)!=null?n:"//vrlab-static.ljcdn.com/release/web/arrow6.b6ce0c62.png");return t.wrapS=t.wrapT=O.RepeatWrapping,t.encoding=O.sRGBEncoding,new O.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function qs(i){return i!=null}const Ks="v1.0.1",_s="GuideLinePlugin",Mi=`${_s}@${Ks}`,$s=i=>`${Mi}--${i}`;class er extends Ct{constructor(e){super(e);d(this,"state",{visible:!1,enabled:!0,disposed:!1});d(this,"data");d(this,"linesGroup");d(this,"disposedErrorLog",()=>{console.error(`${Mi} is disposed`)});d(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${_s}_DEBUG__`]:this})}async load(e,n,o=!0){const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=await 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,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(`${Mi} loaded`,r))}async formatData(e){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e}async show(e){this.setState({visible:!0},e)}async hide(e){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={...this.state};this.state={...this.state,...e},e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),et(o,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0}),this.five.needsRender=!0)}handleEnable(e,n=!0){this.linesGroup&&(e?(this.five.scene.add(this.linesGroup),this.actionWhenEnabled(()=>this.hooks.emit("enable",{userAction:n}))):(this.five.scene.remove(this.linesGroup),this.hooks.emit("disable",{userAction:n})))}handleVisible(e,n=!0){this.linesGroup&&(e?(this.linesGroup.visible=!0,this.actionWhenEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.linesGroup.visible=!1,this.actionWhenEnabled(()=>this.hooks.emit("hide",{userAction:n}))))}handleDispose(){this.linesGroup&&this.five.scene.add(this.linesGroup)}getLinesGroup(e){const n=e.map(this.getLine.bind(this)).filter(qs),o=new O.Group;if(o.name=$s("route-group"),n.length!==0)return o.add(...n),o}getLine(e){const n=new O.Group,o=e.panoIndexList.map(a=>{var l;return(l=this.five.work.observers[a])==null?void 0:l.standingPosition}).filter(qs),s=Od(o,{skipPosition:!0,unitWidth:.6,unitHeight:.4});if(!s)return;const r=Nd({textureUrl:e.arrowTextureUrl});return s.forEach(a=>{const l=new O.Mesh(a,r);l.name=$s("route-line-mesh"),n.add(l)}),n}}d(er,"lasestVersion",Ks);const tr=i=>new er(i);function nr(i){const t=Math.abs(Math.cos(i.latitude));return new O.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function Bd(i,t){const e=nr(i),n=nr(t);return e.angleTo(n)}const Fd=async i=>{try{i().then(()=>{},()=>{}).catch(()=>{})}catch{}},Xn=Math.PI*2;function Gd(i){return i>=0&&i<Xn?i:(i%Xn+Xn)%Xn}function Rd(i){return{longitude:Gd(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function Xd(i,t,e,n){const o=-i/e,s=i;return o*n+s}function Qd(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const ir="v1.0.6",or="CruisePlugin",Qn=`${or}@${ir}`,sr=()=>{console.error(`${Qn} is disposed`)},Wd=()=>{console.warn(`${Qn} is disabled`)},Hd=()=>{console.error(`${Qn} is disabled`)},Si=new Map;class ji extends Ct{constructor(e){super(e);d(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});d(this,"data");d(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[]});d(this,"GuideLine");Object.assign(window,{[`__${or}_DEBUG__`]:this});const n=this.setFiveLinearUpdateCamera.bind(this),o=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",n),this.hooks.on("broke",o),this.hooks.on("end",o),this.hooks.on("pause",o),this.privateState.disposers.push(()=>{this.hooks.off("play",n),this.hooks.off("broke",o),this.hooks.off("end",o),this.hooks.off("pause",o)})}async load(e,n,o){var h,f,u,m,g;if(this.state.disposed)return sr();this.privateState.fiveOriginGetProgress||(f=(h=this.five.controller)==null?void 0:h.cameraMotion)!=null&&f.getProgress||(await this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(m=(u=this.five.controller)==null?void 0:u.cameraMotion)==null?void 0:m.getProgress),this.clear();const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=await this.formatData(e);this.data=r,this.hooks.emit("dataChange",r,s);let a=[],l;const c=this.data.keyframes.filter(v=>v.data.panoIndex!==void 0);c.filter((v,b)=>{var y;return v.data.panoIndex!==((y=c[b-1])==null?void 0:y.data.panoIndex)}).map(v=>v.data.panoIndex).forEach(v=>{var y,x;const b=(y=this.five.work.observers[v])==null?void 0:y.floorIndex;if(b!==void 0)if(l===b){const P=a.length-1;a[P]=[...(x=a[P])!=null?x:[],v]}else{l=b;const P=a.length;a[P]=[v]}}),this.GuideLine||(this.GuideLine=tr(this.five)),(g=this.GuideLine)==null||g.load({routes:a.map(v=>({panoIndexList:v}))}),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(`${Qn} 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({...e,index:0})}pause(e){this.setState({playing:!1},e)}async show(e){this.setState({visible:!0},e)}async hide(e){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 sr();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return Hd();const o={...this.state};this.state={...this.state,...e},e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),e.playing!==void 0&&e.playing!==o.playing&&this.changePlayState(e.playing,n),e.speed!==void 0&&e.speed!==o.speed&&this.changeSpeed(e.speed,n==null?void 0:n.userAction),et(o,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0})}async formatData(e){this.five.work||await 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:lt(),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{id:(c=s.uuid)!=null?c:lt(),moveIndex:r,stay:l,index:r,...s}})};if(o.panoIndexList){let s=[];const{moveEffect:r,moveToFirstPanoEffect:a}=o;return this.privateState.moveToFirstPanoEffect=a,o.panoIndexList.filter((l,c)=>l!==o.panoIndexList[c-1]).forEach((l,c)=>{const h=(()=>{var v,b,y,x;const f=o.panoIndexList[c+1];if(f===void 0)return;const u=(v=n[l])==null?void 0:v.position,m=(b=n[f])==null?void 0:b.position;if(!m||!u||((y=n[l])==null?void 0:y.floorIndex)!==((x=n[f])==null?void 0:x.floorIndex))return;const g=new O.Vector3().subVectors(m,u);return Rd(g)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:c,stay:o.stay,data:{effect:"Move",panoIndex:l,moveEffect:r,...h!=null?h:{}}}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:c,stay:o.stay,data:{effect:"Move",panoIndex:l,moveEffect:r}}),h&&s.push({moveIndex:c,stay:o.stay,data:{effect:"Rotate",panoIndex:l,...h}}))}),{keyframesId:lt(),keyframes:s.map((l,c)=>({id:lt(),index:c,...l}))}}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}async handlePlay(e){var m;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=lt();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:(m=e==null?void 0:e.userAction)!=null?m:!0});let h=!1;const u=await(async()=>{var g,v;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(g=this.data)==null?void 0:g.keyframes.findIndex(b=>b.id===e.playFromId);if(c!=null&&c.keyframeId){const b=(v=this.data)==null?void 0:v.keyframes.find(y=>y.id===c.keyframeId);if(c!=null&&c.fiveState&&await this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect}),b){if(b.data.effect==="Move")return b.index;if(b.data.effect==="Rotate"){const y=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return await this.playKeyframe(b,{duration:y}),h=!0,b.index+1}}}})();this.clearPauseData();for(const g of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(u!==void 0&&g.index<u))try{r.emit("playIndexChange",g.index,g),await this.playKeyframe(g,{moveEffect:h===!1?s.moveToFirstPanoEffect:void 0,duration:800}),g.stay&&await Qd(g.stay),h===!1&&(h=!0)}catch{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}))}async playKeyframe(e,n){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){return this.five.once("gesture",e),this.five.once("modeChange",e),()=>{this.five.off("gesture",e),this.five.once("modeChange",e)}}async getPlayPromise(e,n){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{}})}async actionPromiseQueue(){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())}async move(e,n){if(e.mode&&e.mode!==this.five.currentMode)await this.changeMode(e);else if(e.panoIndex!==this.five.panoIndex)await this.changePano(e,n);else return Promise.resolve()}async rotate(e,n){if(e.mode&&e.mode!==this.five.currentMode)await this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return await this.changePano(e,n);await this.updateCamera(e,n==null?void 0:n.duration)}async updateCamera(e,n=800){const{five:o,privateState:s,state:r}=this;let a=n;const l=(()=>{var u,m;const h=(u=r.config)==null?void 0:u.speedConfig,f=(m=e.rotateSpeed)!=null?m:h==null?void 0:h.rotateSpeed;if((h==null?void 0:h.rotateSpeedUnit)===void 0)return f;if(f!==void 0)return h.rotateSpeedUnit==="rad/ms"?f:f/1e3})();if(l){const h=this.five.getCurrentState();a=Bd(h,e)/l}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=a);const c=this.getSpeededDuration(a);return new Promise(h=>{Fd(()=>o.updateCamera(e,c)),setTimeout(()=>h(),c)})}async changePano(e,n){var h;const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;let a=(h=n==null?void 0:n.duration)!=null?h:800;const l=(()=>{var m,g;const f=(m=r.config)==null?void 0:m.speedConfig,u=(g=e.moveSpeed)!=null?g:f==null?void 0:f.moveSpeed;if((f==null?void 0:f.moveSpeedUnit)===void 0)return u;if(u!==void 0)return f.moveSpeedUnit==="m/ms"?u:u/1e3})();if(l&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const f=o.work.observers[o.panoIndex].position,u=o.work.observers[e.panoIndex].position;a=f.distanceTo(u)/l}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=a);const c=this.getSpeededDuration(a);return new Promise(f=>{var u,m,g;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:c,effect:(g=(m=n==null?void 0:n.moveEffect)!=null?m:(u=this.state.config)==null?void 0:u.moveEffect)!=null?g:e.moveEffect,moveCancelCallback:()=>f(),moveEndCallback:()=>f()})})}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{}}getSpeededDuration(e){return e/this.state.speed}getProgress(){return this.five.controller.cameraMotion.progress}async changeMode(e,n){e.mode&&e.mode!==this.five.currentMode&&await this.five.changeMode(e.mode,e,n)}forceInteruptUpdateCamera(){this.five.updateCamera({},0)}getPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Si.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return Si.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 Si.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&&Wd()}async waitFiveLoaded(){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-Xd(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}d(ji,"PluginVersion",ir);const Yd=i=>new ji(i);$.CSS3DRenderPlugin=fn,$.CameraMovementEffect=es,$.CameraMovementPlugin=qc,$.CruisePlugin=Yd,$.CruisePluginController=ji,$.DIRECTION=Xt,$.DISPLAY_STRATEGY_TYPE=Et,$.FLOOR_PLAN_ATTACHED_TO=vt,$.FLOOR_TYPE_MAP=Gc,$.GuideLinePlugin=tr,$.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE=Lt,$.ItemLabelPlugin=id,$.Magnifier=fs,$.MapviewFloorplanPlugin=vc,$.ModelChassisCompassPlugin=Qc,$.ModelEntryDoorGuidePlugin=Yc,$.ModelFloorplanPlugin=fc,$.ModelItemLabelPlugin=Bu,$.ModelRoomLabelPlugin=xa,$.ModelTVVideoPlugin=Ru,$.ModelViewPlugin=Tr,$.PaintBrush=Dr,$.PaintBrushTypeEnum=at,$.PanoCompassPlugin=Ah,$.PanoCursorRaycasterPlugin=Yr,$.PanoDoorLabelPlugin=gd,$.PanoFloorplanRadarPlugin=Bc,$.PanoMeasurePlugin=uu,$.PanoRulerPlugin=th,$.PanoRulerProPlugin=dh,$.PanoSpatialTagPlugin=Eu,$.ROOM_FETILE_TYPE_MAP=Fc,$.ROOM_TYPE_MAP=Rc,$.Rotation=tt,$.TopviewFloorplanPlugin=Ac,$.itemLabelPluginServerParams=od,$.modelItemLabelPluginServerParams=Fu,$.modelRoomLabelPluginServerParams=Ca,Object.defineProperties($,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
538
|
+
`,e.container.style.pointerEvents="none";const n=b=>(e.wrapper=b,b.appendChild(e.container),l(),!0),o=b=>{e.itemLabels=td(b),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{h(),e.container.remove()},l=()=>{var b;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(b=e.app)==null||b.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new ed({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",f),i.once("dispose",a)},h=()=>{i.off("modeChange",f)},f=b=>{if(b!==me.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}},od={name:"ItemLabelPlugin",version:0};class sd extends Ho{constructor(e){super(e);d(this,"state");d(this,"container");d(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({...e,userAction:!0})}disable(e){this.enabled=!1,this.updateState({...e,userAction:!0})}show(e){if(!!this.state.enabled)return this.setState({...this.state,visible:!0},e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState({...this.state,visible:!1},e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o={...this.state};this.state={...this.state,...e,...n},this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===me.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState({...this.state,enabled:this.enabled,visible:this.visible},e)}}function rd(i){be(i,"svelte-16kdbw2",'.plugin-DoorLabelPlugin-item.svelte-16kdbw2.svelte-16kdbw2{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity 0.3s ease}.plugin-DoorLabelPlugin-cnt.svelte-16kdbw2.svelte-16kdbw2{position:absolute;top:50%;left:50%;border-radius:2px;background:rgba(0, 0, 0, 0.35);line-height:0.625rem;padding:0.3125rem;white-space:nowrap;font-size:0.625rem;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-16kdbw2.svelte-16kdbw2::after{content:"";display:block;position:absolute;top:-1px;left:-1px;bottom:-1px;right:-1px;border-radius:2px;border:1px 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-16kdbw2.svelte-16kdbw2:active,.plugin-DoorLabelPlugin-cnt.svelte-16kdbw2.svelte-16kdbw2:focus{background:rgba(0, 0, 0, 0.5);color:rgba(255, 255, 255, 0.5)}.plugin-DoorLabelPlugin-icon.svelte-16kdbw2.svelte-16kdbw2{background:url("//vrlab-image4.ljcdn.com/release/web/DoorLabel-icon.de1304ae.svg") no-repeat;background-size:100%;display:inline-block;width:0.52083rem;height:0.52083rem;margin-left:0.20833rem;transform-origin:center}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].left.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-16kdbw2 .plugin-DoorLabelPlugin-txt.svelte-16kdbw2{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(-90deg);margin-left:0;margin-right:0.20833rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].forward.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-16kdbw2 .plugin-DoorLabelPlugin-txt.svelte-16kdbw2{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(-90deg);margin-left:0;margin-right:0.20833rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].back.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-16kdbw2 .plugin-DoorLabelPlugin-txt.svelte-16kdbw2{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(-90deg);margin-left:0;margin-right:0.20833rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].right.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-16kdbw2 .plugin-DoorLabelPlugin-txt.svelte-16kdbw2{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(-90deg);margin-left:0;margin-right:0.20833rem;order:0}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-16kdbw2.svelte-16kdbw2{color:#f9eac1}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{background:url("//vrlab-image4.ljcdn.com/release/web/arrow.6e8ec00e.svg") no-repeat}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-16kdbw2.svelte-16kdbw2:active,.plugin-DoorLabelPlugin-cnt--customBrand.svelte-16kdbw2.svelte-16kdbw2:focus{background:rgba(0, 0, 0, 0.5);color:rgba(249, 234, 193, 0.5)}')}function ad(i){let t,e,n,o,s,r,a,l;return{c(){t=Q("div"),e=Q("div"),n=Q("span"),n.textContent=`${i[8]}`,o=pe(),s=Q("i"),C(n,"class","plugin-DoorLabelPlugin-txt svelte-16kdbw2"),C(s,"class","plugin-DoorLabelPlugin-icon svelte-16kdbw2"),C(e,"class",r=Se(ot("plugin-DoorLabelPlugin-cnt",i[0].toward))+" svelte-16kdbw2"),C(e,"style",`transform: ${i[6]||"initial"};pointer-events: ${i[5]?"auto":"none"};opacity: ${i[5]?1:0}`),C(e,"data-camera-toward",i[7]),C(t,"style",`left: ${i[3]||0}%;top: ${i[4]||0}%;opacity: ${i[5]?1:0}`),C(t,"class","plugin-DoorLabelPlugin-item svelte-16kdbw2")},m(c,h){V(c,t,h),W(t,e),W(e,n),W(e,o),W(e,s),i[10](t),a||(l=qe(e,"click",i[9]),a=!0)},p(c,[h]){h&1&&r!==(r=Se(ot("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-16kdbw2")&&C(e,"class",r)},i:ne,o:ne,d(c){c&&H(t),i[10](null),a=!1,l()}}}function ld(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:h,cameraToward:f,name:u}=n,m=0;const g=()=>{if(!r||!a||!l||!s)return;const y=s.current.clientWidth/window.innerWidth*100,x=s.current.clientHeight/window.innerHeight*100;if(r<=y/2||r>=100-y/2||a<=x/2||a>=100-x/2)return;h!==m&&(console.log("panoDoorLabelPlugin",h,"\u89E6\u53D1\u57CB\u70B9"),m=h)},v=y=>{o&&o()};function b(y){jt[y?"unshift":"push"](()=>{s=y,e(2,s)})}return i.$$set=y=>{"props"in y&&e(0,n=y.props),"onClick"in y&&e(1,o=y.onClick)},g(),[n,o,s,r,a,l,c,f,u,v,b]}class cd extends fe{constructor(t){super(),de(this,t,ld,ad,ue,{props:0,onClick:1},rd)}}function hd(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 ud(i){const{camera:t}=i,e=t.getWorldDirection(new M.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 dd(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function fd(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 md={userAction:!0};class pd extends sd{constructor(e){super(e);d(this,"MinVisibledistance",1.8);d(this,"MaxVisibledistance",5);d(this,"OffsetHeight",-1.3);d(this,"rooms");d(this,"floorplanServerData");d(this,"doorLabelItems");d(this,"visibleLabelMap",new Map);d(this,"labelItems",[]);d(this,"doorLabels");d(this,"roomObservers");d(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,this.five.once("panoArrived",()=>{console.log("doorplugin","panoArrived"),this.initData()})});d(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,h=e==null?void 0:e.find(f=>f.floor_index===c);if(h){const f=h.rooms.find(u=>u.observer_indexs.includes(l));if(f)return{panoIndex:l,floorIndex:c,name:f.name}}}).filter(Boolean);this.roomObservers=o});d(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});d(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 h=l.position.clone(),f=h.distanceTo(s);if(f<this.MinVisibledistance||f>this.MaxVisibledistance)return;const u=new M.Raycaster,m=h.clone().sub(s).normalize();u.set(s,m);const[g]=this.five.model.intersectRaycaster(u);g&&g.distance+.1<f||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});d(this,"fixDoorPosition",()=>{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 M.Vector3),l=[],c=[...this.labelItems];if(c.forEach((h,f)=>{if(h.visible){const u=n.position.distanceTo(h.position),m=h.position.clone().add(new M.Vector3(0,this.OffsetHeight,0)),v=m.clone().sub(n.position).normalize().angleTo(a),b=m.clone().project(n),y=(b.x+1)/2.2*100,x=(-b.y+1)/2.2*100,P=y>=0&&y<=100&&x>=0&&x<=100&&u>this.MinVisibledistance&&u<=this.MaxVisibledistance;h.left=y,h.top=x,h.inSight=P&&v<Math.PI/2,h.cameraToward=ud(this.five),P?l.push({disFromCameraToLabel:u,left:y,top:x,index:f}):h.transform="translate(-50%, -50%)"}else h.inSight=!1}),l.length>1){let h=0;l.sort((f,u)=>u.disFromCameraToLabel-f.disFromCameraToLabel);for(let f=1;f<l.length;f++){const{index:u,left:m,top:g}=l[f-1],{index:v,left:b,top:y}=l[f],x=this.container.children[u],P=this.container.children[v];if(!x||!P)return;const L={left:s*m/100,top:r*g/100,width:x.children[0].clientWidth,height:x.children[0].clientHeight},T={left:s*b/100,top:r*y/100,width:P.children[0].clientWidth,height:P.children[0].clientHeight};hd(L,T)&&(h++,c[u].transform=`translate(-50%, ${(h-1)*100-50}%)`,c[v].transform=`translate(-50%, ${h*100-50}%)`)}}this.labelItems=c,this.render()});d(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:o}=this.five;let s,r,a=1/0;for(let l=0;l<o.observers.length;l++){if(this.roomObservers[l].name!==e)continue;const h=o.observers[l].standingPosition,f=n.distanceTo(h);f<a&&(s=l,r=h.clone().sub(n).normalize(),a=f)}if(r!==null&&s!==null){const l={};if(a>0){const h=new M.Vector3(0,0,-1),f=r.clone(),u=new M.Quaternion;u.setFromUnitVectors(h,f);const m=new M.Euler;m.setFromQuaternion(u,"YXZ"),l.longitude=m.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});d(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(h=>!!(h&&h.name===r.name)),l=this.five.work.observers.filter((h,f)=>!!r.observer_indexs.find(u=>u===f));a&&a.forEach(h=>{const f=h.position;let u=1/0,m;l.forEach(v=>{const b=v.standingPosition,y={x:b.x,y:b.y,z:b.z},x=dd(f,y);x<u&&(u=x,m=y)}),m&&(f.y=m.y+.01);const g=new M.Vector3(f.x,f.y,f.z);g.add(new M.Vector3(-.2,1.8,0).applyEuler(new M.Euler(0,h.rad,0))),this.doorLabels.push({roomName:r.name,name:h.name,position:g,toward:fd(h.rad)})})}),this.labelItems=this.doorLabels.map(r=>({...r,left:0,top:0,visible:!1,inSight:!1,transform:"",cameraToward:""})),console.log("doorplugin","labelItems",this.labelItems),this.five.on("wantsToMoveToPano",this.hideAllLabels),this.five.on("modelLoaded",this.fixDoorVisibleAndPosition),this.five.on("panoArrived",this.fixDoorVisibleAndPosition),this.five.on("initAnimationEnded",this.fixDoorPosition),this.five.on("cameraUpdate",this.fixDoorPosition),this.five.on("mouseWheel",this.fixDoorPosition),this.five.on("pinchGesture",this.fixDoorPosition),this.fixDoorVisibleAndPosition()})}stateChangedCallback(e,n){if(this.hooks.hasListener("stateChange")){const o={state:this.state,prevState:e,userAction:n?n.userAction:md.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 cd({target:this.container,props:{props:e,onClick:()=>{this.onClick(e.name,e.position)}}}))})}initState(){return{enabled:!0,visible:!0}}dispose(){this.five&&(this.five.off("wantsToMoveToPano",this.hideAllLabels),this.five.off("modelLoaded",this.fixDoorVisibleAndPosition),this.five.off("panoArrived",this.fixDoorVisibleAndPosition),this.five.off("initAnimationEnded",this.fixDoorPosition),this.five.off("cameraUpdate",this.fixDoorPosition),this.five.off("mouseWheel",this.fixDoorPosition),this.five.off("pinchGesture",this.fixDoorPosition),super.dispose())}}const gd=i=>new pd(i);var Gn={},vd=bd;function bd(i,t,e){return i[0]=t[0]+e[0],i[1]=t[1]+e[1],i}var Ad=yd;function yd(i,t,e){return i[0]=t,i[1]=e,i}var Pd=wd;function wd(i,t){var e=t[0],n=t[1],o=e*e+n*n;return o>0&&(o=1/Math.sqrt(o),i[0]=t[0]*o,i[1]=t[1]*o),i}var Id=xd;function xd(i,t,e){return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i}var Cd=Ed;function Ed(i,t){return i[0]*t[0]+i[1]*t[1]}var Ld=vd,Ti=Ad,Vs=Pd,kd=Id,Dd=Cd,Zs=[0,0];Gn.computeMiter=function(t,e,n,o,s){return Ld(t,n,o),Vs(t,t),Ti(e,-t[1],t[0]),Ti(Zs,-n[1],n[0]),s/Dd(e,Zs)},Gn.normal=function(t,e){return Ti(t,-e[1],e[0]),t},Gn.direction=function(t,e,n){return kd(t,e,n),Vs(t,t),t};var ht=Gn,kt=[0,0],Rn=[0,0],Js=[0,0],$t=[0,0],Td=function(i,t){var e=null,n=[];t&&(i=i.slice(),i.push(i[0]));for(var o=i.length,s=1;s<o;s++){var r=i[s-1],a=i[s],l=s<i.length-1?i[s+1]:null;if(ht.direction(kt,a,r),e||(e=[0,0],ht.normal(e,kt)),s===1&&zi(n,e,1),!l)ht.normal(e,kt),zi(n,e,1);else{ht.direction(Rn,l,a);var c=ht.computeMiter(Js,$t,kt,Rn,1);zi(n,$t,c)}}if(i.length>2&&t){var h=i[o-2],f=i[0],u=i[1];ht.direction(kt,f,h),ht.direction(Rn,u,f),ht.normal(e,kt);var m=ht.computeMiter(Js,$t,kt,Rn,1);n[0][0]=$t.slice(),n[o-1][0]=$t.slice(),n[0][1]=m,n[o-1][1]=m,n.pop()}return n};function zi(i,t,e){i.push([[t[0],t[1]],e])}const zd=2,Md=3,Sd=3,jd=2;function Od(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.skipPosition)!=null?l:!1,s=new O.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),h=s.getPoints(c),f=[];let u=0;const m=i;return m.forEach((g,v)=>{let b=0,y=99999999;h.forEach((I,D)=>{const E=I.distanceTo(g);E<y&&(b=D,y=E)});const x=h[b+1],P=x==null?void 0:x.distanceTo(g),L=h[b-1],T=L==null?void 0:L.distanceTo(g);if(b>u&&b-u>1){let I=b;L!==void 0&&T>.8&&(I=b+1),L!==void 0&&T>.2&&T<.3?I=b:y>.2&&y<.3&&(I=b+1);let D=u;if(x!==void 0&&P>.2&&P<.3?D=u+1:y>.2&&y<.3&&(D=u),h[D]&&h[D+1]){const F=m[v-1];if(F)if(F.equals(h[D]))D+=1;else{const R=new M.Vector3().subVectors(h[D+1],h[D]),ee=new M.Vector3().subVectors(F,h[D]);R.angleTo(ee)<Math.PI/2&&(D+=1)}}if(I<D||I-D<=1)return;const E=h.slice(D,I),z=Us(E,e,n);f.push(z),u=b}}),f}else{const c=Math.ceil(s.getLength()),h=s.getPoints(c);return[Us(h,e,n)]}}function Us(i,t,e){const n=t/2,o=e/t,s=i.length,r=Td(i.map(y=>[y.x,y.z])),l=(i.length-1)*zd*Md,c=2*s,h=c*Sd,f=c*jd,u=new Uint32Array(l),m=new Float32Array(h),g=new Float32Array(f);i.forEach((y,x)=>{});let v=0;for(let y=0;y<i.length;y++){const[x,P]=r[y][0],L=i[y],{x:T,y:I,z:D}=L,E=new M.Vector3(T+x*n,I+.05,D+P*n);m[y*6+0]=E.x,m[y*6+1]=E.y,m[y*6+2]=E.z;const z=new M.Vector3(T-x*n,I+.05,D-P*n);m[y*6+3]=z.x,m[y*6+4]=z.y,m[y*6+5]=z.z,v+=y>0?i[y-1].clone().sub(i[y]).length():0;const F=v/t/o;g[y*4+0]=0,g[y*4+1]=F,g[y*4+2]=1,g[y*4+3]=F,y!==i.length-1&&(u[y*6+0]=y*2+0,u[y*6+1]=y*2+2,u[y*6+2]=y*2+1,u[y*6+3]=y*2+2,u[y*6+4]=y*2+3,u[y*6+5]=y*2+1)}const b=new O.BufferGeometry;return b.setAttribute("position",new O.BufferAttribute(m,3)),b.setAttribute("uv",new O.BufferAttribute(g,2)),b.setIndex(new O.BufferAttribute(u,1)),b}function Nd(i){var n;const t=new O.TextureLoader().load((n=i==null?void 0:i.textureUrl)!=null?n:"//vrlab-static.ljcdn.com/release/web/arrow6.b6ce0c62.png");return t.wrapS=t.wrapT=O.RepeatWrapping,t.encoding=O.sRGBEncoding,new O.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function qs(i){return i!=null}const Ks="v1.0.1",_s="GuideLinePlugin",Mi=`${_s}@${Ks}`,$s=i=>`${Mi}--${i}`;class er extends Ct{constructor(e){super(e);d(this,"state",{visible:!1,enabled:!0,disposed:!1});d(this,"data");d(this,"linesGroup");d(this,"disposedErrorLog",()=>{console.error(`${Mi} is disposed`)});d(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${_s}_DEBUG__`]:this})}async load(e,n,o=!0){const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=await 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,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(`${Mi} loaded`,r))}async formatData(e){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e}async show(e){this.setState({visible:!0},e)}async hide(e){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={...this.state};this.state={...this.state,...e},e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),et(o,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0}),this.five.needsRender=!0)}handleEnable(e,n=!0){this.linesGroup&&(e?(this.five.scene.add(this.linesGroup),this.actionWhenEnabled(()=>this.hooks.emit("enable",{userAction:n}))):(this.five.scene.remove(this.linesGroup),this.hooks.emit("disable",{userAction:n})))}handleVisible(e,n=!0){this.linesGroup&&(e?(this.linesGroup.visible=!0,this.actionWhenEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.linesGroup.visible=!1,this.actionWhenEnabled(()=>this.hooks.emit("hide",{userAction:n}))))}handleDispose(){this.linesGroup&&this.five.scene.add(this.linesGroup)}getLinesGroup(e){const n=e.map(this.getLine.bind(this)).filter(qs),o=new O.Group;if(o.name=$s("route-group"),n.length!==0)return o.add(...n),o}getLine(e){const n=new O.Group,o=e.panoIndexList.map(a=>{var l;return(l=this.five.work.observers[a])==null?void 0:l.standingPosition}).filter(qs),s=Od(o,{skipPosition:!0,unitWidth:.6,unitHeight:.4});if(!s)return;const r=Nd({textureUrl:e.arrowTextureUrl});return s.forEach(a=>{const l=new O.Mesh(a,r);l.name=$s("route-line-mesh"),n.add(l)}),n}}d(er,"lasestVersion",Ks);const tr=i=>new er(i);function nr(i){const t=Math.abs(Math.cos(i.latitude));return new O.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function Bd(i,t){const e=nr(i),n=nr(t);return e.angleTo(n)}const Fd=async i=>{try{i().then(()=>{},()=>{}).catch(()=>{})}catch{}},Xn=Math.PI*2;function Gd(i){return i>=0&&i<Xn?i:(i%Xn+Xn)%Xn}function Rd(i){return{longitude:Gd(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function Xd(i,t,e,n){const o=-i/e,s=i;return o*n+s}function Qd(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const ir="v1.0.6",or="CruisePlugin",Qn=`${or}@${ir}`,sr=()=>{console.error(`${Qn} is disposed`)},Wd=()=>{console.warn(`${Qn} is disabled`)},Hd=()=>{console.error(`${Qn} is disabled`)},Si=new Map;class ji extends Ct{constructor(e){super(e);d(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});d(this,"data");d(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[]});d(this,"GuideLine");Object.assign(window,{[`__${or}_DEBUG__`]:this});const n=this.setFiveLinearUpdateCamera.bind(this),o=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",n),this.hooks.on("broke",o),this.hooks.on("end",o),this.hooks.on("pause",o),this.privateState.disposers.push(()=>{this.hooks.off("play",n),this.hooks.off("broke",o),this.hooks.off("end",o),this.hooks.off("pause",o)})}async load(e,n,o){var h,f,u,m,g;if(this.state.disposed)return sr();this.privateState.fiveOriginGetProgress||(f=(h=this.five.controller)==null?void 0:h.cameraMotion)!=null&&f.getProgress||(await this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(m=(u=this.five.controller)==null?void 0:u.cameraMotion)==null?void 0:m.getProgress),this.clear();const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=await this.formatData(e);this.data=r,this.hooks.emit("dataChange",r,s);let a=[],l;const c=this.data.keyframes.filter(v=>v.data.panoIndex!==void 0);c.filter((v,b)=>{var y;return v.data.panoIndex!==((y=c[b-1])==null?void 0:y.data.panoIndex)}).map(v=>v.data.panoIndex).forEach(v=>{var y,x;const b=(y=this.five.work.observers[v])==null?void 0:y.floorIndex;if(b!==void 0)if(l===b){const P=a.length-1;a[P]=[...(x=a[P])!=null?x:[],v]}else{l=b;const P=a.length;a[P]=[v]}}),this.GuideLine||(this.GuideLine=tr(this.five)),(g=this.GuideLine)==null||g.load({routes:a.map(v=>({panoIndexList:v}))}),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(`${Qn} 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({...e,index:0})}pause(e){this.setState({playing:!1},e)}async show(e){this.setState({visible:!0},e)}async hide(e){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 sr();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return Hd();const o={...this.state};this.state={...this.state,...e},e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),e.playing!==void 0&&e.playing!==o.playing&&this.changePlayState(e.playing,n),e.speed!==void 0&&e.speed!==o.speed&&this.changeSpeed(e.speed,n==null?void 0:n.userAction),et(o,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0})}async formatData(e){this.five.work||await 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:lt(),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{id:(c=s.uuid)!=null?c:lt(),moveIndex:r,stay:l,index:r,...s}})};if(o.panoIndexList){let s=[];const{moveEffect:r,moveToFirstPanoEffect:a}=o;return this.privateState.moveToFirstPanoEffect=a,o.panoIndexList.filter((l,c)=>l!==o.panoIndexList[c-1]).forEach((l,c)=>{const h=(()=>{var v,b,y,x;const f=o.panoIndexList[c+1];if(f===void 0)return;const u=(v=n[l])==null?void 0:v.position,m=(b=n[f])==null?void 0:b.position;if(!m||!u||((y=n[l])==null?void 0:y.floorIndex)!==((x=n[f])==null?void 0:x.floorIndex))return;const g=new O.Vector3().subVectors(m,u);return Rd(g)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:c,stay:o.stay,data:{effect:"Move",panoIndex:l,moveEffect:r,...h!=null?h:{}}}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:c,stay:o.stay,data:{effect:"Move",panoIndex:l,moveEffect:r}}),h&&s.push({moveIndex:c,stay:o.stay,data:{effect:"Rotate",panoIndex:l,...h}}))}),{keyframesId:lt(),keyframes:s.map((l,c)=>({id:lt(),index:c,...l}))}}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}async handlePlay(e){var m;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=lt();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:(m=e==null?void 0:e.userAction)!=null?m:!0});let h=!1;const u=await(async()=>{var g,v;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(g=this.data)==null?void 0:g.keyframes.findIndex(b=>b.id===e.playFromId);if(c!=null&&c.keyframeId){const b=(v=this.data)==null?void 0:v.keyframes.find(y=>y.id===c.keyframeId);if(c!=null&&c.fiveState&&await this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect}),b){if(b.data.effect==="Move")return b.index;if(b.data.effect==="Rotate"){const y=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return await this.playKeyframe(b,{duration:y}),h=!0,b.index+1}}}})();this.clearPauseData();for(const g of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(u!==void 0&&g.index<u))try{r.emit("playIndexChange",g.index,g),await this.playKeyframe(g,{moveEffect:h===!1?s.moveToFirstPanoEffect:void 0,duration:800}),g.stay&&await Qd(g.stay),h===!1&&(h=!0)}catch{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}))}async playKeyframe(e,n){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){return this.five.once("gesture",e),this.five.once("modeChange",e),()=>{this.five.off("gesture",e),this.five.once("modeChange",e)}}async getPlayPromise(e,n){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{}})}async actionPromiseQueue(){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())}async move(e,n){if(e.mode&&e.mode!==this.five.currentMode)await this.changeMode(e);else if(e.panoIndex!==this.five.panoIndex)await this.changePano(e,n);else return Promise.resolve()}async rotate(e,n){if(e.mode&&e.mode!==this.five.currentMode)await this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return await this.changePano(e,n);await this.updateCamera(e,n==null?void 0:n.duration)}async updateCamera(e,n=800){const{five:o,privateState:s,state:r}=this;let a=n;const l=(()=>{var u,m;const h=(u=r.config)==null?void 0:u.speedConfig,f=(m=e.rotateSpeed)!=null?m:h==null?void 0:h.rotateSpeed;if((h==null?void 0:h.rotateSpeedUnit)===void 0)return f;if(f!==void 0)return h.rotateSpeedUnit==="rad/ms"?f:f/1e3})();if(l){const h=this.five.getCurrentState();a=Bd(h,e)/l}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=a);const c=this.getSpeededDuration(a);return new Promise(h=>{Fd(()=>o.updateCamera(e,c)),setTimeout(()=>h(),c)})}async changePano(e,n){var h;const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;let a=(h=n==null?void 0:n.duration)!=null?h:800;const l=(()=>{var m,g;const f=(m=r.config)==null?void 0:m.speedConfig,u=(g=e.moveSpeed)!=null?g:f==null?void 0:f.moveSpeed;if((f==null?void 0:f.moveSpeedUnit)===void 0)return u;if(u!==void 0)return f.moveSpeedUnit==="m/ms"?u:u/1e3})();if(l&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const f=o.work.observers[o.panoIndex].position,u=o.work.observers[e.panoIndex].position;a=f.distanceTo(u)/l}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=a);const c=this.getSpeededDuration(a);return new Promise(f=>{var u,m,g;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:c,effect:(g=(m=n==null?void 0:n.moveEffect)!=null?m:(u=this.state.config)==null?void 0:u.moveEffect)!=null?g:e.moveEffect,moveCancelCallback:()=>f(),moveEndCallback:()=>f()})})}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{}}getSpeededDuration(e){return e/this.state.speed}getProgress(){return this.five.controller.cameraMotion.progress}async changeMode(e,n){e.mode&&e.mode!==this.five.currentMode&&await this.five.changeMode(e.mode,e,n)}forceInteruptUpdateCamera(){this.five.updateCamera({},0)}getPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Si.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return Si.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 Si.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&&Wd()}async waitFiveLoaded(){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-Xd(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}d(ji,"PluginVersion",ir);const Yd=i=>new ji(i);$.CSS3DRenderPlugin=fn,$.CameraMovementEffect=es,$.CameraMovementPlugin=qc,$.CruisePlugin=Yd,$.CruisePluginController=ji,$.DIRECTION=Xt,$.DISPLAY_STRATEGY_TYPE=Et,$.FLOOR_PLAN_ATTACHED_TO=vt,$.FLOOR_TYPE_MAP=Gc,$.GuideLinePlugin=tr,$.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE=Lt,$.ItemLabelPlugin=id,$.Magnifier=fs,$.MapviewFloorplanPlugin=vc,$.ModelChassisCompassPlugin=Qc,$.ModelEntryDoorGuidePlugin=Yc,$.ModelFloorplanPlugin=fc,$.ModelItemLabelPlugin=Bu,$.ModelRoomLabelPlugin=xa,$.ModelTVVideoPlugin=Ru,$.ModelViewPlugin=Tr,$.PaintBrush=Dr,$.PaintBrushTypeEnum=at,$.PanoCompassPlugin=Ah,$.PanoCursorRaycasterPlugin=Yr,$.PanoDoorLabelPlugin=gd,$.PanoFloorplanRadarPlugin=Bc,$.PanoMeasurePlugin=uu,$.PanoRulerPlugin=th,$.PanoRulerProPlugin=dh,$.PanoSpatialTagPlugin=Eu,$.ROOM_FETILE_TYPE_MAP=Fc,$.ROOM_TYPE_MAP=Rc,$.Rotation=tt,$.TopviewFloorplanPlugin=Ac,$.itemLabelPluginServerParams=od,$.modelItemLabelPluginServerParams=Fu,$.modelRoomLabelPluginServerParams=Ca,Object.defineProperties($,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|