@aibee/crc-bmap 0.0.119 → 0.0.121

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.
@@ -24,7 +24,7 @@ var Fn=Object.create;var ce=Object.defineProperty;var Un=Object.getOwnPropertyDe
24
24
  gl_FragColor = vec4(uColor2, uOpacity); // \u5176\u4ED6\u9762\u989C\u8272\uFF09
25
25
  }
26
26
  }
27
- `,r=-1/0,i=this.geometry.getAttribute("position");if(i)for(let l=0;l<i.count;l++){let u=i.getZ(l);u>r&&(r=u)}let s=new si({uniforms:{maxZ:{value:r},uColor:{value:new an(this.options[0].fillColor)},uColor2:{value:new an(J(this.options[0].fillColor))},uOpacity:{value:this.options[0].fillOpacity}},vertexShader:t,fragmentShader:e});this.material=s}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],r=this.context.materialFactory.createLineMaterial({color:t,opacity:e});return this.lineMaterial=r,r}getBorderPoints(t){let{height:e,deltaHeight:r,geometry:i}=t,s=[],l=e+(r||0),{coords:u}=i;for(let a=0;a<u.length;a++){let c=u[a];for(let p=0;p<c.length;p++){let d=c[p],h=p+1===c.length?c[0]:c[p+1];s.push(new ln(d[0],d[1],l)),s.push(new ln(h[0],h[1],l))}}return s}initLineGeometry(){let t=this.options.map(e=>{let r=this.getBorderPoints(e);return new ei().setFromPoints(r)});this.lineGeometry=un(t)}createBorder(){let t=new ri(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){this.initGeometry(),this.initMaterial();let t=new ii(this.geometry,this.material);this.add(t),this.initLineMaterial(),this.initLineGeometry(),this.createBorder()}dispose(){this.geometry?.dispose(),this.material?.dispose(),this.lineGeometry?.dispose(),this.clear()}};import{ExtrudeGeometry as ai,Mesh as li,Object3D as ui}from"three";var ci={uuid:"",iconUrl:"",name:"",secondRotate:0,airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},opacity:1,visible:!0},It=class extends ui{constructor(t,e){super();this.context=t;this.options=K({...ci,...e},this),this.init()}options;mesh;async init(){let{deltaHeight:t,airHeight:e,geometry:r,iconUrl:i,opacity:s}=this.options,l=B(r.coords[0],r.coords.slice(1)),u=new ai(l,{steps:1,bevelEnabled:!1,depth:0,curveSegments:4}),a=await this.context.materialFactory.createGroundTextureMaterial({url:i,opacity:s}),c=new li(u,a);this.mesh=c,this.mesh.position.z=e+t,this.add(c)}dispose(){this.mesh?.geometry.dispose(),this.clear()}};import{Box3 as hi,Object3D as pi,Vector3 as cn}from"three";var fi={url:"",geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},id:"",width:0,rotate:1,airHeight:1,deltaHeight:0},Nt=class extends pi{constructor(t,e){super();this.context=t;this.options=Object.assign({},fi,e),this.loadModel()}model=null;options;async loadModel(){let t=await vt(this.options.url);t.scene.rotation.set(Math.PI/2,Math.PI/2,0);let e=new hi().setFromObject(t.scene),r=e.getSize(new cn),i=Math.max(r.x,r.y),s=this.options.width/i;this.scale.set(s,s,s),this.add(t.scene),this.position.copy(e.getCenter(new cn)),this.position.z+=this.options.airHeight+this.options.deltaHeight,this.model=t}dispose(){P(this),this.model=null}};import{BufferGeometry as di,ExtrudeGeometry as gi,LineSegments as mi,Mesh as yi,Object3D as _i,Vector3 as hn}from"three";import{mergeGeometries as pn}from"three/examples/jsm/utils/BufferGeometryUtils";import{Line2 as vi}from"three/examples/jsm/lines/line2";import{LineGeometry as xi}from"three/examples/jsm/lines/lineGeometry";var Dt=class extends _i{constructor(t,e){super();this.context=t;this.options=e;e.length&&this.init()}geometry;material;lineMaterial;lineGeometry;Mesh;LineMesh;initGeometry(){let t=this.options.map(e=>{let r=B(e.geometry.coords[0],e.geometry.coords.slice(1));return new gi(r,{steps:1,bevelEnabled:!1,depth:0,curveSegments:4})});this.geometry=pn(t),t.forEach(e=>e.dispose())}initMaterial(){let{fillColor:t,fillOpacity:e}=this.options[0],r=this.context.materialFactory.createMeshBasicMaterial({color:t,opacity:e});return this.material=r,r}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],r=this.context.materialFactory.createLineMaterial({color:t,opacity:e});return this.lineMaterial=r,r}getBorderPoints(t){let{deltaHeight:e,geometry:r}=t,i=[],s=e||0,{coords:l}=r;for(let u=0;u<l.length;u++){let a=l[u];for(let c=0;c<a.length;c++){let p=a[c],d=c+1===a.length?a[0]:a[c+1];i.push(new hn(p[0],p[1],s)),i.push(new hn(d[0],d[1],s))}}return i}initDoubleLine(){let t=this.options.filter(r=>r.double&&r.geometry.otherCoords?.[1]?.length);if(!t.length)return;let e=t.reduce((r,i)=>{let s=`${i.secondColor}-${i.dashed}`;return r[s]&&r[s].push(i),r[s]||(r[s]=[i]),r},{});Object.values(e).map(r=>{let i=this.context.materialFactory.createLine2MaterialMap({color:r[0].secondColor,width:.2,dashed:r[0].dashed});r.map(s=>{let l=new xi,u=s.geometry.otherCoords[1].map(c=>[...c,0]).flat(2);l.setPositions(u);let a=new vi(l,i);a.computeLineDistances(),a.position.z+=.001,this.add(a)})})}initLineGeometry(){let t=this.options.map(e=>{let r=this.getBorderPoints(e);return new di().setFromPoints(r)});this.lineGeometry=pn(t)}createBorder(){let t=new mi(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){this.initGeometry(),this.initMaterial();let t=new yi(this.geometry,this.material);this.add(t),this.initLineMaterial(),this.initLineGeometry(),this.createBorder(),this.initDoubleLine(),this.position.z+=.001+(this.options[0].deltaHeight||0)}dispose(){this.geometry?.dispose(),this.lineGeometry?.dispose(),this.clear()}};import{Frustum as Ei}from"three";var Ot=class extends F{startPoint;endPoint;rect;frustum=new Ei;constructor(n){super(n);let{config:{selectBox:{fill:t,stroke:e}}}=n;this.rect=$(e,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(n){super.setEnable(n),R(this.rect,0,0,0,0),n?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}onPointerDown=n=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(n);t&&(this.startPoint=t),this.endPoint=void 0};onPointerMove=n=>{if(!this.enable||!this.startPoint)return;let t=this.getIntersectByPointerEvent(n);t&&(this.endPoint=t)};onPointerUp=n=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(n);t&&(this.endPoint=t),this.doSelect(),this.startPoint=void 0};onUpdate=()=>{if(this.startPoint){let n=this.getSvgCoordinate(this.startPoint),t={...n};this.endPoint&&(t=this.getSvgCoordinate(this.endPoint));let e={x:Math.min(n.x,t.x),y:Math.min(n.y,t.y)},r=Math.abs(t.x-n.x),i=Math.abs(t.y-n.y);R(this.rect,e.x,e.y,r,i)}else R(this.rect,0,0,0,0)};registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:t,container:{clientWidth:e,clientHeight:r}}}=this,i=y(this.startPoint,t,e,r),s=y(this.endPoint,t,e,r),l={x:Math.min(i.x,s.x),y:Math.min(i.y,s.y)},u={x:Math.max(i.x,s.x),y:Math.max(i.y,s.y)},a=this.searchMapInFrustum(l,u);this.dispatchEvent({type:"selected",list:a})}}searchMapInFrustum(n,t){let{context:e}=this;return e.currentFloor?.graphicLayer.children.filter(r=>r instanceof M&&this.searchChildInFrustum(r,n,t))||[]}searchChildInFrustum(n,t,e){let{context:{camera:r,container:{clientWidth:i,clientHeight:s}}}=this;if(!n)return!1;if(!n.mesh){let d=n.getPosition();if(d){let h=y(d,r,i,s);return ft(h,t,e)}return!1}n.mesh.geometry.boundingBox||n.mesh.geometry.computeBoundingBox();let l=n.mesh.geometry.boundingBox;if(!l)return!1;let{min:u,max:a}=l,c=y(u,r,i,s),p=y(a,r,i,s);return!(!ft(c,t,e)||!ft(p,t,e))}dispose(){this.unRegistryEvent()}};var Ft=class extends bi{constructor(t){super();this.context=t;this.boxSelection=new Ot(t),this.boxSelection.setEnable(!1),this.registryEvent()}_list=new Set;boxSelection;prevPanStatus;prevRotateStatus;downPoint=null;isMultipleSelect=!1;get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.context.control.enablePan,this.prevRotateStatus=this.context.control.enableRotate,this.context.control.enablePan=!1,this.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.context.control.enablePan=!!this.prevPanStatus,this.context.control.enableRotate=!!this.prevRotateStatus)}onPointerDown=t=>{this.downPoint={x:t.offsetX,y:t.offsetY}};onPointerUp=t=>{if(!this.downPoint)return;let{offsetX:e,offsetY:r}=t,{x:i,y:s}=this.downPoint;if(Math.sqrt((i-e)**2+(s-r)**2)>3)return;let{graphics:l}=this.context.getGraphicsByDeviceXy(e,r),u=new Set(l.map(c=>c.options.id));this.context.getPoisByDeviceXy(e,r).forEach(c=>{if(!u.has(c.options.id)){let p=this.context.currentFloor?.graphicLayer.graphicMap.get(c.options.id)||null;p&&p.options.geometry.type==="point"&&(l.push(p),u.add(c.options.id))}}),(xt?t.metaKey:t.ctrlKey)||this._list.clear(),l.forEach(c=>this._list.add(c)),this.selectEnd(),this.downPoint=null};onPointerOut=t=>{this.disableBoxSelection()};onKeyDown=t=>{Qt(t.key)&&this.enableBoxSelection()};onKeyUp=t=>{Qt(t.key)&&this.disableBoxSelection()};onBoxSelected=({list:t})=>{this._list.clear(),t.forEach(e=>{this._list.add(e)}),this.selectEnd()};selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.container.addEventListener("pointerout",this.onPointerOut),this.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.container.removeEventListener("pointerout",this.onPointerOut),this.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(t){this._list.delete(t)}dispose(){this.unRegistryEvent()}};import{EventDispatcher as Mi}from"three";var Ut=class extends Mi{constructor(t){super();this.context=t;this.registryEvent()}curGraphics=new Set;timer=new D;graphicTimerMap=new Map;onPointerMove=({graphics:t,pois:e,e:r})=>{let i=e.map(a=>this.context.currentFloor?.graphicLayer.graphicMap.get(a.options.id)).filter(a=>a&&a.options.geometry.type==="point");if(!t.length&&!i.length&&this.curGraphics.size){this.curGraphics.clear(),this.handleHoverGraphicsChange();return}let{time:s}=this.context.config.hover,l=new Set;if(i.length){let a,c=1e4;i.forEach(p=>{let d=e.find(g=>g.options.id===p.options.id),{x:h,y:f}=d.clientPos,m=Math.sqrt((h-r.offsetX)**2+(f-r.offsetY)**2);m<c&&(c=m,a=p)}),l.add(a)}l.size||t.forEach(a=>l.add(a)),l.forEach(a=>{if(this.graphicTimerMap.get(a)||this.curGraphics.has(a))return;let c=this.timer.setTimeout(()=>{this.curGraphics.add(a),this.graphicTimerMap.delete(a),this.timer.clearTimeout(c),this.handleHoverGraphicsChange()},s);this.graphicTimerMap.set(a,c)}),this.graphicTimerMap.forEach((a,c)=>{l.has(c)||(this.timer.clearTimeout(a),this.graphicTimerMap.delete(c))});let u=this.curGraphics.size;this.curGraphics.forEach(a=>{l.has(a)||this.curGraphics.delete(a)}),u!==this.curGraphics.size&&this.handleHoverGraphicsChange()};onPointerLevel=()=>{this.curGraphics.clear(),this.handleHoverGraphicsChange()};onBodyPointerMove=t=>{if(this.curGraphics.size){let e=this.context.container.getBoundingClientRect();(t.clientX<e.left||t.clientX>e.right||t.clientY<e.top||t.clientY>e.bottom)&&this.onPointerLevel()}};handleHoverGraphicsChange(t=this.curGraphics){this.dispatchEvent({type:"hover-change",graphics:Array.from(t)})}registryEvent(){this.context.addEventListener("pointer-over",this.onPointerMove),this.context.addEventListener("pointer-move",this.onPointerMove),this.context.addEventListener("pointer-level",this.onPointerLevel),document.body.addEventListener("pointermove",this.onBodyPointerMove)}unRegistryEvent(){this.context.removeEventListener("pointer-over",this.onPointerMove),this.context.removeEventListener("pointer-move",this.onPointerMove),this.context.removeEventListener("pointer-level",this.onPointerLevel),document.body.removeEventListener("pointermove",this.onBodyPointerMove)}dispose(){this.unRegistryEvent(),this.timer.dispose()}};import{LineMaterial as Si}from"three/examples/jsm/lines/LineMaterial";import{Color as Gt,LineBasicMaterial as wi,MeshStandardMaterial as Ti,MeshBasicMaterial as fn,ShaderMaterial as Ci,DoubleSide as Pi,Vector2 as Ai}from"three";function dn(o){return`${o.x}-${o.y}-${o.z}`}var Bt=class{constructor(n){this.context=n}lineMaterialMap=new Map;meshStandardMaterialMap=new Map;meshBasicMaterialMap=new Map;shaderMaterialMap=new Map;groundTextureMaterialMap=new Map;line2MaterialMap=new Map;generateLineMaterialKey({color:n,opacity:t}){return`${n}-${t}`}createLineMaterial({color:n,opacity:t}){let e=this.generateLineMaterialKey({color:n,opacity:t});if(this.lineMaterialMap.has(e))return this.lineMaterialMap.get(e);let r=new wi({color:new Gt(n).convertLinearToSRGB(),transparent:!0,opacity:t});return this.lineMaterialMap.set(e,r),r}createMeshStandardMaterial({color:n,opacity:t}){let e=`${n}-${t}`;if(this.meshStandardMaterialMap.has(e))return this.meshStandardMaterialMap.get(e);let r=new Ti({color:new Gt(n).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:t,depthWrite:!0});return this.meshStandardMaterialMap.set(e,r),r}createMeshBasicMaterial({color:n,opacity:t}){let e=`${n}-${t}`;if(this.meshBasicMaterialMap.has(e))return this.meshBasicMaterialMap.get(e);let r=new fn({color:n,transparent:!0,opacity:t,depthWrite:!0});return this.meshBasicMaterialMap.set(e,r),r}createShaderMaterial({gradualColor:n,center:t,maxValue:e,opacity:r,direction:i,max:s,min:l}){let u=`${n.toString()}-${dn(t)}-${e}-${r}-${dn(i)}`;if(this.shaderMaterialMap.has(u))return this.shaderMaterialMap.get(u);let a=`
27
+ `,r=-1/0,i=this.geometry.getAttribute("position");if(i)for(let l=0;l<i.count;l++){let u=i.getZ(l);u>r&&(r=u)}let s=new si({uniforms:{maxZ:{value:r},uColor:{value:new an(this.options[0].fillColor)},uColor2:{value:new an(J(this.options[0].fillColor))},uOpacity:{value:this.options[0].fillOpacity}},vertexShader:t,fragmentShader:e});this.material=s}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],r=this.context.materialFactory.createLineMaterial({color:t,opacity:e});return this.lineMaterial=r,r}getBorderPoints(t){let{height:e,deltaHeight:r,geometry:i}=t,s=[],l=e+(r||0),{coords:u}=i;for(let a=0;a<u.length;a++){let c=u[a];for(let p=0;p<c.length;p++){let d=c[p],h=p+1===c.length?c[0]:c[p+1];s.push(new ln(d[0],d[1],l)),s.push(new ln(h[0],h[1],l))}}return s}initLineGeometry(){let t=this.options.map(e=>{let r=this.getBorderPoints(e);return new ei().setFromPoints(r)});this.lineGeometry=un(t)}createBorder(){let t=new ri(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){this.initGeometry(),this.initMaterial();let t=new ii(this.geometry,this.material);this.add(t),this.initLineMaterial(),this.initLineGeometry(),this.createBorder()}dispose(){this.geometry?.dispose(),this.material?.dispose(),this.lineGeometry?.dispose(),this.clear()}};import{ExtrudeGeometry as ai,Mesh as li,Object3D as ui}from"three";var ci={uuid:"",iconUrl:"",name:"",secondRotate:0,airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},opacity:1,visible:!0},It=class extends ui{constructor(t,e){super();this.context=t;this.options=K({...ci,...e},this),this.init()}options;mesh;async init(){let{deltaHeight:t,airHeight:e,geometry:r,iconUrl:i,opacity:s}=this.options,l=B(r.coords[0],r.coords.slice(1)),u=new ai(l,{steps:1,bevelEnabled:!1,depth:0,curveSegments:4}),a=await this.context.materialFactory.createGroundTextureMaterial({url:i,opacity:s}),c=new li(u,a);this.mesh=c,this.mesh.position.z=e+t,this.add(c)}dispose(){this.mesh?.geometry.dispose(),this.clear()}};import{Box3 as hi,Object3D as pi,Vector3 as cn}from"three";var fi={url:"",geometry:{type:"polygon",cds:[],coords:[],curveCpt:[],curveIndex:[]},id:"",width:0,rotate:1,airHeight:1,deltaHeight:0},Nt=class extends pi{constructor(t,e){super();this.context=t;this.options=Object.assign({},fi,e),this.loadModel()}model=null;options;async loadModel(){let t=await vt(this.options.url);t.scene.rotation.set(Math.PI/2,Math.PI/2,0);let e=new hi().setFromObject(t.scene),r=e.getSize(new cn),i=Math.max(r.x,r.y),s=this.options.width/i;this.scale.set(s,s,s),this.add(t.scene),this.position.copy(e.getCenter(new cn)),this.position.z+=this.options.airHeight+this.options.deltaHeight,this.model=t}dispose(){P(this),this.model=null}};import{BufferGeometry as di,ExtrudeGeometry as gi,LineSegments as mi,Mesh as yi,Object3D as _i,Vector3 as hn}from"three";import{mergeGeometries as pn}from"three/examples/jsm/utils/BufferGeometryUtils";import{Line2 as vi}from"three/examples/jsm/lines/Line2";import{LineGeometry as xi}from"three/examples/jsm/lines/LineGeometry";var Dt=class extends _i{constructor(t,e){super();this.context=t;this.options=e;e.length&&this.init()}geometry;material;lineMaterial;lineGeometry;Mesh;LineMesh;initGeometry(){let t=this.options.map(e=>{let r=B(e.geometry.coords[0],e.geometry.coords.slice(1));return new gi(r,{steps:1,bevelEnabled:!1,depth:0,curveSegments:4})});this.geometry=pn(t),t.forEach(e=>e.dispose())}initMaterial(){let{fillColor:t,fillOpacity:e}=this.options[0],r=this.context.materialFactory.createMeshBasicMaterial({color:t,opacity:e});return this.material=r,r}initLineMaterial(){let{strokeColor:t,strokeOpacity:e}=this.options[0],r=this.context.materialFactory.createLineMaterial({color:t,opacity:e});return this.lineMaterial=r,r}getBorderPoints(t){let{deltaHeight:e,geometry:r}=t,i=[],s=e||0,{coords:l}=r;for(let u=0;u<l.length;u++){let a=l[u];for(let c=0;c<a.length;c++){let p=a[c],d=c+1===a.length?a[0]:a[c+1];i.push(new hn(p[0],p[1],s)),i.push(new hn(d[0],d[1],s))}}return i}initDoubleLine(){let t=this.options.filter(r=>r.double&&r.geometry.otherCoords?.[1]?.length);if(!t.length)return;let e=t.reduce((r,i)=>{let s=`${i.secondColor}-${i.dashed}`;return r[s]&&r[s].push(i),r[s]||(r[s]=[i]),r},{});Object.values(e).map(r=>{let i=this.context.materialFactory.createLine2MaterialMap({color:r[0].secondColor,width:.2,dashed:r[0].dashed});r.map(s=>{let l=new xi,u=s.geometry.otherCoords[1].map(c=>[...c,0]).flat(2);l.setPositions(u);let a=new vi(l,i);a.computeLineDistances(),a.position.z+=.001,this.add(a)})})}initLineGeometry(){let t=this.options.map(e=>{let r=this.getBorderPoints(e);return new di().setFromPoints(r)});this.lineGeometry=pn(t)}createBorder(){let t=new mi(this.lineGeometry,this.lineMaterial);return this.LineMesh=t,this.add(t),t}init(){this.initGeometry(),this.initMaterial();let t=new yi(this.geometry,this.material);this.add(t),this.initLineMaterial(),this.initLineGeometry(),this.createBorder(),this.initDoubleLine(),this.position.z+=.001+(this.options[0].deltaHeight||0)}dispose(){this.geometry?.dispose(),this.lineGeometry?.dispose(),this.clear()}};import{Frustum as Ei}from"three";var Ot=class extends F{startPoint;endPoint;rect;frustum=new Ei;constructor(n){super(n);let{config:{selectBox:{fill:t,stroke:e}}}=n;this.rect=$(e,t),this.svg.appendChild(this.rect),this.registryEvent()}setEnable(n){super.setEnable(n),R(this.rect,0,0,0,0),n?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}onPointerDown=n=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(n);t&&(this.startPoint=t),this.endPoint=void 0};onPointerMove=n=>{if(!this.enable||!this.startPoint)return;let t=this.getIntersectByPointerEvent(n);t&&(this.endPoint=t)};onPointerUp=n=>{if(!this.enable)return;let t=this.getIntersectByPointerEvent(n);t&&(this.endPoint=t),this.doSelect(),this.startPoint=void 0};onUpdate=()=>{if(this.startPoint){let n=this.getSvgCoordinate(this.startPoint),t={...n};this.endPoint&&(t=this.getSvgCoordinate(this.endPoint));let e={x:Math.min(n.x,t.x),y:Math.min(n.y,t.y)},r=Math.abs(t.x-n.x),i=Math.abs(t.y-n.y);R(this.rect,e.x,e.y,r,i)}else R(this.rect,0,0,0,0)};registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:t,container:{clientWidth:e,clientHeight:r}}}=this,i=y(this.startPoint,t,e,r),s=y(this.endPoint,t,e,r),l={x:Math.min(i.x,s.x),y:Math.min(i.y,s.y)},u={x:Math.max(i.x,s.x),y:Math.max(i.y,s.y)},a=this.searchMapInFrustum(l,u);this.dispatchEvent({type:"selected",list:a})}}searchMapInFrustum(n,t){let{context:e}=this;return e.currentFloor?.graphicLayer.children.filter(r=>r instanceof M&&this.searchChildInFrustum(r,n,t))||[]}searchChildInFrustum(n,t,e){let{context:{camera:r,container:{clientWidth:i,clientHeight:s}}}=this;if(!n)return!1;if(!n.mesh){let d=n.getPosition();if(d){let h=y(d,r,i,s);return ft(h,t,e)}return!1}n.mesh.geometry.boundingBox||n.mesh.geometry.computeBoundingBox();let l=n.mesh.geometry.boundingBox;if(!l)return!1;let{min:u,max:a}=l,c=y(u,r,i,s),p=y(a,r,i,s);return!(!ft(c,t,e)||!ft(p,t,e))}dispose(){this.unRegistryEvent()}};var Ft=class extends bi{constructor(t){super();this.context=t;this.boxSelection=new Ot(t),this.boxSelection.setEnable(!1),this.registryEvent()}_list=new Set;boxSelection;prevPanStatus;prevRotateStatus;downPoint=null;isMultipleSelect=!1;get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.context.control.enablePan,this.prevRotateStatus=this.context.control.enableRotate,this.context.control.enablePan=!1,this.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.context.control.enablePan=!!this.prevPanStatus,this.context.control.enableRotate=!!this.prevRotateStatus)}onPointerDown=t=>{this.downPoint={x:t.offsetX,y:t.offsetY}};onPointerUp=t=>{if(!this.downPoint)return;let{offsetX:e,offsetY:r}=t,{x:i,y:s}=this.downPoint;if(Math.sqrt((i-e)**2+(s-r)**2)>3)return;let{graphics:l}=this.context.getGraphicsByDeviceXy(e,r),u=new Set(l.map(c=>c.options.id));this.context.getPoisByDeviceXy(e,r).forEach(c=>{if(!u.has(c.options.id)){let p=this.context.currentFloor?.graphicLayer.graphicMap.get(c.options.id)||null;p&&p.options.geometry.type==="point"&&(l.push(p),u.add(c.options.id))}}),(xt?t.metaKey:t.ctrlKey)||this._list.clear(),l.forEach(c=>this._list.add(c)),this.selectEnd(),this.downPoint=null};onPointerOut=t=>{this.disableBoxSelection()};onKeyDown=t=>{Qt(t.key)&&this.enableBoxSelection()};onKeyUp=t=>{Qt(t.key)&&this.disableBoxSelection()};onBoxSelected=({list:t})=>{this._list.clear(),t.forEach(e=>{this._list.add(e)}),this.selectEnd()};selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.container.addEventListener("pointerout",this.onPointerOut),this.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.container.removeEventListener("pointerout",this.onPointerOut),this.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(t){this._list.delete(t)}dispose(){this.unRegistryEvent()}};import{EventDispatcher as Mi}from"three";var Ut=class extends Mi{constructor(t){super();this.context=t;this.registryEvent()}curGraphics=new Set;timer=new D;graphicTimerMap=new Map;onPointerMove=({graphics:t,pois:e,e:r})=>{let i=e.map(a=>this.context.currentFloor?.graphicLayer.graphicMap.get(a.options.id)).filter(a=>a&&a.options.geometry.type==="point");if(!t.length&&!i.length&&this.curGraphics.size){this.curGraphics.clear(),this.handleHoverGraphicsChange();return}let{time:s}=this.context.config.hover,l=new Set;if(i.length){let a,c=1e4;i.forEach(p=>{let d=e.find(g=>g.options.id===p.options.id),{x:h,y:f}=d.clientPos,m=Math.sqrt((h-r.offsetX)**2+(f-r.offsetY)**2);m<c&&(c=m,a=p)}),l.add(a)}l.size||t.forEach(a=>l.add(a)),l.forEach(a=>{if(this.graphicTimerMap.get(a)||this.curGraphics.has(a))return;let c=this.timer.setTimeout(()=>{this.curGraphics.add(a),this.graphicTimerMap.delete(a),this.timer.clearTimeout(c),this.handleHoverGraphicsChange()},s);this.graphicTimerMap.set(a,c)}),this.graphicTimerMap.forEach((a,c)=>{l.has(c)||(this.timer.clearTimeout(a),this.graphicTimerMap.delete(c))});let u=this.curGraphics.size;this.curGraphics.forEach(a=>{l.has(a)||this.curGraphics.delete(a)}),u!==this.curGraphics.size&&this.handleHoverGraphicsChange()};onPointerLevel=()=>{this.curGraphics.clear(),this.handleHoverGraphicsChange()};onBodyPointerMove=t=>{if(this.curGraphics.size){let e=this.context.container.getBoundingClientRect();(t.clientX<e.left||t.clientX>e.right||t.clientY<e.top||t.clientY>e.bottom)&&this.onPointerLevel()}};handleHoverGraphicsChange(t=this.curGraphics){this.dispatchEvent({type:"hover-change",graphics:Array.from(t)})}registryEvent(){this.context.addEventListener("pointer-over",this.onPointerMove),this.context.addEventListener("pointer-move",this.onPointerMove),this.context.addEventListener("pointer-level",this.onPointerLevel),document.body.addEventListener("pointermove",this.onBodyPointerMove)}unRegistryEvent(){this.context.removeEventListener("pointer-over",this.onPointerMove),this.context.removeEventListener("pointer-move",this.onPointerMove),this.context.removeEventListener("pointer-level",this.onPointerLevel),document.body.removeEventListener("pointermove",this.onBodyPointerMove)}dispose(){this.unRegistryEvent(),this.timer.dispose()}};import{LineMaterial as Si}from"three/examples/jsm/lines/LineMaterial";import{Color as Gt,LineBasicMaterial as wi,MeshStandardMaterial as Ti,MeshBasicMaterial as fn,ShaderMaterial as Ci,DoubleSide as Pi,Vector2 as Ai}from"three";function dn(o){return`${o.x}-${o.y}-${o.z}`}var Bt=class{constructor(n){this.context=n}lineMaterialMap=new Map;meshStandardMaterialMap=new Map;meshBasicMaterialMap=new Map;shaderMaterialMap=new Map;groundTextureMaterialMap=new Map;line2MaterialMap=new Map;generateLineMaterialKey({color:n,opacity:t}){return`${n}-${t}`}createLineMaterial({color:n,opacity:t}){let e=this.generateLineMaterialKey({color:n,opacity:t});if(this.lineMaterialMap.has(e))return this.lineMaterialMap.get(e);let r=new wi({color:new Gt(n).convertLinearToSRGB(),transparent:!0,opacity:t});return this.lineMaterialMap.set(e,r),r}createMeshStandardMaterial({color:n,opacity:t}){let e=`${n}-${t}`;if(this.meshStandardMaterialMap.has(e))return this.meshStandardMaterialMap.get(e);let r=new Ti({color:new Gt(n).convertLinearToSRGB(),roughness:1,transparent:!0,opacity:t,depthWrite:!0});return this.meshStandardMaterialMap.set(e,r),r}createMeshBasicMaterial({color:n,opacity:t}){let e=`${n}-${t}`;if(this.meshBasicMaterialMap.has(e))return this.meshBasicMaterialMap.get(e);let r=new fn({color:n,transparent:!0,opacity:t,depthWrite:!0});return this.meshBasicMaterialMap.set(e,r),r}createShaderMaterial({gradualColor:n,center:t,maxValue:e,opacity:r,direction:i,max:s,min:l}){let u=`${n.toString()}-${dn(t)}-${e}-${r}-${dn(i)}`;if(this.shaderMaterialMap.has(u))return this.shaderMaterialMap.get(u);let a=`
28
28
  uniform vec3 uColor;
29
29
  uniform vec3 uGradualColor;
30
30
  uniform vec3 center;
@@ -3749,5 +3749,5 @@ three/build/three.module.js:
3749
3749
  */
3750
3750
  `)}import{Mesh as to,Object3D as eo,TextureLoader as no,Color as ro,Vector2 as ae,Vector3 as io,NormalBlending as oo,RepeatWrapping as so}from"three";import{BufferGeometry as qi,Matrix4 as xn,Vector3 as Z,Ray as ji,Sphere as Yi,LineSegments as Zi,BufferAttribute as V,ShaderChunk as w,ShaderMaterial as En,UniformsLib as Ki,Color as $i,Vector2 as vn}from"three";var T=class extends qi{constructor(){super(),this.isMeshLine=!0,this.type="MeshLine",this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this._points=[],this._geom=null,this.widthCallback=null,this.matrixWorld=new xn,Object.defineProperties(this,{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(n){this.setGeometry(n,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(n){this.setPoints(n,this.widthCallback)}}})}};T.prototype.setMatrixWorld=function(o){this.matrixWorld=o};T.prototype.setGeometry=function(o,n){this._geometry=o,this.setPoints(o.getAttribute("position").array,n)};T.prototype.setPoints=function(o,n){if(!(o instanceof Float32Array)&&!(o instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=o,this.widthCallback=n,this.positions=[],this.counters=[],o.length&&o[0]instanceof Z)for(var t=0;t<o.length;t++){var e=o[t],r=t/o.length;this.positions.push(e.x,e.y,e.z),this.positions.push(e.x,e.y,e.z),this.counters.push(r),this.counters.push(r)}else for(var t=0;t<o.length;t+=3){var r=t/o.length;this.positions.push(o[t],o[t+1],o[t+2]),this.positions.push(o[t],o[t+1],o[t+2]),this.counters.push(r),this.counters.push(r)}this.process()};function Ji(o,n){var t=new xn,e=new ji,r=new Yi,i=new Z,s=this.geometry;if(s.boundingSphere||s.computeBoundingSphere(),r.copy(s.boundingSphere),r.applyMatrix4(this.matrixWorld),o.ray.intersectSphere(r,i)!==!1){t.copy(this.matrixWorld).invert(),e.copy(o.ray).applyMatrix4(t);var l=new Z,u=new Z,a=new Z,c=this instanceof Zi?2:1,p=s.index,d=s.attributes;if(p!==null)for(var h=p.array,f=d.position.array,m=d.width.array,g=0,x=h.length-1;g<x;g+=c){var b=h[g],_=h[g+1];l.fromArray(f,b*3),u.fromArray(f,_*3);var E=m[Math.floor(g/3)]!==void 0?m[Math.floor(g/3)]:1,W=o.params.Line.threshold+this.material.lineWidth*E/2,G=W*W,ut=e.distanceSqToSegment(l,u,i,a);if(!(ut>G)){i.applyMatrix4(this.matrixWorld);var ct=o.ray.origin.distanceTo(i);ct<o.near||ct>o.far||(n.push({distance:ct,point:a.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this}),g=x)}}}}T.prototype.raycast=Ji;T.prototype.compareV3=function(o,n){var t=o*6,e=n*6;return this.positions[t]===this.positions[e]&&this.positions[t+1]===this.positions[e+1]&&this.positions[t+2]===this.positions[e+2]};T.prototype.copyV3=function(o){var n=o*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]};T.prototype.getDistance=function(o){let n=0;for(let t=0;t<o;t++){let e=6*t,r=new Z(this.positions[e],this.positions[e+1],this.positions[e+2]),i=new Z(this.positions[e+6],this.positions[e+7],this.positions[e+8]),s=r.distanceTo(i);n+=s}return n};T.prototype.process=function(){var o=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var n;let t=this.getDistance(o-1);var e;this.compareV3(0,o-1)?e=this.copyV3(o-2):e=this.copyV3(0),this.previous.push(e[0],e[1],e[2]),this.previous.push(e[0],e[1],e[2]);for(var r=0;r<o;r++){if(this.side.push(1),this.side.push(-1),this.widthCallback?n=this.widthCallback(r/(o-1)):n=1,this.width.push(n),this.width.push(n),r===0)this.uvs.push(0,0),this.uvs.push(0,1);else if(r===o-1)this.uvs.push(1,0),this.uvs.push(1,1);else{let s=this.getDistance(r)/t;this.uvs.push(s,0),this.uvs.push(s,1)}if(r<o-1){e=this.copyV3(r),this.previous.push(e[0],e[1],e[2]),this.previous.push(e[0],e[1],e[2]);var i=r*2;this.indices_array.push(i,i+1,i+2),this.indices_array.push(i+2,i+1,i+3)}r>0&&(e=this.copyV3(r),this.next.push(e[0],e[1],e[2]),this.next.push(e[0],e[1],e[2]))}this.compareV3(o-1,0)?e=this.copyV3(1):e=this.copyV3(o-1),this.next.push(e[0],e[1],e[2]),this.next.push(e[0],e[1],e[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new V(new Float32Array(this.positions),3),previous:new V(new Float32Array(this.previous),3),next:new V(new Float32Array(this.next),3),side:new V(new Float32Array(this.side),1),width:new V(new Float32Array(this.width),1),uv:new V(new Float32Array(this.uvs),2),index:new V(new Uint16Array(this.indices_array),1),counters:new V(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function se(o,n,t,e,r){var i;if(o=o.subarray||o.slice?o:o.buffer,t=t.subarray||t.slice?t:t.buffer,o=n?o.subarray?o.subarray(n,r&&n+r):o.slice(n,r&&n+r):o,t.set)t.set(o,e);else for(i=0;i<o.length;i++)t[i+e]=o[i];return t}T.prototype.advance=function(o){var n=this._attributes.position.array,t=this._attributes.previous.array,e=this._attributes.next.array,r=n.length;se(n,0,t,0,r),se(n,6,n,0,r-6),n[r-6]=o.x,n[r-5]=o.y,n[r-4]=o.z,n[r-3]=o.x,n[r-2]=o.y,n[r-1]=o.z,se(n,6,e,0,r-6),e[r-6]=o.x,e[r-5]=o.y,e[r-4]=o.z,e[r-3]=o.x,e[r-2]=o.y,e[r-1]=o.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0};w.meshline_vert=["",w.logdepthbuf_pars_vertex,w.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;"," vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",w.logdepthbuf_vertex,w.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",w.fog_vertex,"}"].join(`
3751
3751
  `);w.meshline_frag=["",w.fog_pars_fragment,w.logdepthbuf_pars_fragment,"","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform float dashArray;","uniform float dashOffset;","uniform float dashRatio;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {","",w.logdepthbuf_fragment,""," vec4 c = vColor;"," if( useMap == 1. ) c *= texture2D( map, vUV * repeat );"," if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;"," if( c.a < alphaTest ) discard;"," if( useDash == 1. ){"," c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));"," }"," gl_FragColor = c;"," gl_FragColor.a *= step(vCounters, visibility);","",w.fog_fragment,"}"].join(`
3752
- `);var lt=class extends En{constructor(n){super({uniforms:Object.assign({},Ki.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new $i(16777215)},opacity:{value:1},resolution:{value:new vn(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new vn(1,1)}}),vertexShader:w.meshline_vert,fragmentShader:w.meshline_frag}),this.isMeshLineMaterial=!0,this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(t){this.uniforms.lineWidth.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(t){this.uniforms.useMap.value=t}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(t){this.uniforms.alphaMap.value=t}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(t){this.uniforms.useAlphaMap.value=t}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(t){this.uniforms.color.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(t){this.uniforms.sizeAttenuation.value=t}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(t){this.uniforms.dashArray.value=t,this.useDash=t!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(t){this.uniforms.dashRatio.value=t}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(t){this.uniforms.useDash.value=t}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(t){this.uniforms.visibility.value=t}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(t){this.uniforms.alphaTest.value=t}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(t){this.uniforms.repeat.value.copy(t)}}}),this.setValues(n)}};lt.prototype.copy=function(o){return En.prototype.copy.call(this,o),this.lineWidth=o.lineWidth,this.map=o.map,this.useMap=o.useMap,this.alphaMap=o.alphaMap,this.useAlphaMap=o.useAlphaMap,this.color.copy(o.color),this.opacity=o.opacity,this.resolution.copy(o.resolution),this.sizeAttenuation=o.sizeAttenuation,this.dashArray.copy(o.dashArray),this.dashOffset.copy(o.dashOffset),this.dashRatio.copy(o.dashRatio),this.useDash=o.useDash,this.visibility=o.visibility,this.alphaTest=o.alphaTest,this.repeat.copy(o.repeat),this};var bn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAMAAACROYkbAAABrVBMVEVsjPdsjPdqi/doifdpivdrjPdsjPdsjPd/m/igtfqTq/lykfdri/dsjPdtjfe/zPv8/f/w8/6zw/p0kvdri/dsjPdtjffU3vz////////3+f62xfpzkfdri/dsjPdsjPeZr/nr8P7////////4+f62xfp0kvdri/dsjPdsjPdujveXrvne5v3////////3+f63x/t2lPdri/dsjPdsjPdsjPdri/eMpfjb4/3+/v/////4+v+7yft1k/dri/dsjPdsjPdri/eJovjl6/3////////3+f6Jo/lqivdsjPdri/dvjveluPry9f7////////i6f2BnPhqi/dsjPdrjPdvjveluPrv8v7////////l6/6Uq/lsjPdsjPdsjPdvjveluPrv8v7////////m6/6Uq/lsjPdsjPdsjPdsjPeZr/nv8v7////////s8f6XrvlsjPdsjPdtjffS2/z////////w9P6bsfltjfdsjPdtjffBz/v7/P/y9f6svvpxkPdrjPdsjPdsjPd+mviftPqVrPlykfdri/dsjPdsjPdri/doifdpifdrjPdsjPclkRlrAAAAx0lEQVQ4y2NgwAsYmZhZWNkYyAfsHJxc3Dy85BvAxy8gKCQsIkq2AWLiEpJS0jKycuQaIK+gqKSsoqqmrkGmAZpa2jq6evoGhkbG5BlgYmpmbmFpZW1ja0emE+wdHJ2cXVzd3D3INMDTy9vH188/IDCIPP3BIaFh4RGRUdExseQZEBefkJiUnJKalp5BngGZWdk5uXn5BemFZAZBUXFJaVl5RSWZ9jMwVFXX1NbVNzSSq5+hqbmlta29g2z9DJ1d3T29ffhUAABKPSh5Xst3GwAAAABJRU5ErkJggg==";var Mn={texture_url:bn,lineWidth:8,color:16777215},qt=class extends eo{constructor(t,e){super();this.navigation=t;this.config=Object.assign({},Mn,e),this.registryEvent()}mesh=null;geometry=null;material=null;texture=null;config=Mn;points=[];basicRepeat=1;registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate)}onControlChange=()=>{this.changeRepeat()};onUpdate=()=>{this.texture};getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:r,height:i}}}}}=this,s=t.map(([u,a])=>y(new io(u,a,0),e,r,i)).map(({x:u,y:a})=>[u,a]);return dt(s)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new ae(t,1)}loadTexture(t){return new Promise((e,r)=>{new no().load(t,e,void 0,r)})}transformPoints(t){let e=[];for(let r=0;r<t.length;r++)e.push(...t[r],0);return e}updatePoints(t){this.points=t,this.changeRepeat();let e=this.transformPoints(t);this.geometry&&this.geometry.setPoints(e)}async create(t){let e=this.geometry=new T;if(this.updatePoints(t),!this.texture){let s=this.texture=await this.loadTexture(this.config.texture_url);s.wrapS=s.wrapT=so}let r=this.material=new lt({useMap:!0,color:new ro(this.config.color),transparent:!0,resolution:new ae(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!0,sizeAttenuation:!1,lineWidth:this.config.lineWidth*2,map:this.texture,blending:oo,repeat:new ae(this.getRepeat(),1)}),i=this.mesh=new to(e,r);return this.add(i),i}dispose(){this.unRegistryEvent(),this.clear(),this.geometry?.dispose(),this.material?.dispose(),this.texture?.dispose()}};import{Group as ao,Tween as lo}from"@tweenjs/tween.js";var uo={path:{},speed:10,cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},loadRoad:!0},Sn=class extends U{path=null;worker=oe();fetchRoadStatus=!1;uniqueKey=new Q;paths=[];options;pathTween=new ao;startPoi=null;animationPathOptions={cPathIndex:0};cPath=[];constructor(n,t,e={}){super(n),this.options=Object.assign({},uo,e);let{apiDomain:r,apiPath:{roadNetwork:i},apiInfo:s}=this.bmap.config;this.registryEvent(),this.options.loadRoad&&st(this.worker,"load_road",{url:`${r||location.origin}${i}?project=${t}`,...s}).then(l=>{this.fetchRoadStatus=!0,this.dispatchEvent({type:"fetch-road-status",status:!0}),this.dispatchEvent({type:"fetch-road-data",roadInfo:l})}).catch(l=>{console.log("[\u52A0\u8F7D\u8DEF\u7F51\u5931\u8D25]",l)})}registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate),this.bmap.addEventListener("switch_floor_after",this.onSwitchFloor)}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate),this.bmap.removeEventListener("switch_floor_after",this.onSwitchFloor)}onUpdate=()=>{this.pathTween.update()};async setRoadData(n){this.fetchRoadStatus=!1,this.dispatchEvent({type:"fetch-road-status",status:!1}),await st(this.worker,"set_road_info",n),this.fetchRoadStatus=!0,this.dispatchEvent({type:"fetch-road-status",status:!0})}clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.pathTween.getAll().forEach(n=>n.stop()),this.pathTween.removeAll())}onSwitchFloor=({data:{curFloor:n}})=>{if(this.paths.length){let t=this.paths.find(e=>e.floor===n.name);t?this.renderPath(this.translatePoints(t.points)):this.clearPath()}else this.clearPath()};getDirectionPath(n){return st(this.worker,"get_direction_path",n)}addPath(n){this.paths=n;let t=this.bmap.context.currentFloor?.name,e=n.find(r=>r.floor===t);if(e)if(this.bmap.currentBuildGround)this.renderPath(this.translatePoints(e.points));else{let r=()=>{this.bmap.removeEventListener("center-change",r),this.renderPath(this.translatePoints(e.points))};this.bmap.addEventListener("center-change",r)}else this.clearPath()}translatePoints(n){let[t,e]=this.bmap.buildingCenter;return n.map(r=>[r[0]-t,r[1]-e])}getPath(n,t,e=""){return new Promise((r,i)=>{let s=()=>{st(this.worker,"get_path",{start:n,end:t,type:e}).then(l=>{l?typeof l=="string"?i(l):r(l):i("no-path")})};if(this.fetchRoadStatus)s();else{let l=({status:u})=>{u&&(this.removeEventListener("fetch-road-status",l),s())};this.addEventListener("fetch-road-status",l)}})}renderPath(n){let t=this.catmullRomCurve3(n);this.cPath=t,this.animationPathOptions={cPathIndex:0},this.path?this.path.updatePoints(t):(this.path=new qt(this,this.options.path),this.path.create(t),this.path.position.z=this.bmap.context.currentFloor.groundMaxHeight+1,this.bmap.context.scene.add(this.path)),this.startPoi&&(this.startPoi.dispose(),this.startPoi=null),this.options.needStartPoi&&(this.startPoi=this.bmap.context.currentFloor?.addPoi({...this.options.startPoi,position:{x:t[0][0],y:t[0][1],z:1e-4},collision_enable:!1})||null)}catmullRomCurve3(n){return Oe(n,!1,!0,.1,150,2.5)}async animationTo(n,t=this.options.speed){if(n.floor!==this.bmap.context.currentFloor?.name||!this.path)return;let{animationPathOptions:{cPathIndex:e}}=this,r=[this.path.points[0],...this.cPath.slice(e+1)],i=this.translatePoints([n.pos])[0],{distance:s,pos:l,index:u}=r.reduce((f,m,g,x)=>{if(g===x.length-1)return f;let{distance:b,closestPoint:_}=Fe(i,m,x[g+1]);return b<f.distance&&(f.distance=b,f.pos=_,f.index=g),f},{distance:Number.MAX_SAFE_INTEGER,pos:n.pos,index:0});if(s>this.options.cheapMaximumDistance||this.path.points[0][0]===l[0]&&this.path.points[0][1]===l[1])return;let a=0,c=[];if(u===0)a=S(r[0],l),c=[a];else{c=[S(r[0],r[1])];for(let f=1;f<u;f++)c.push(S(r[f],r[f+1]));c.push(S(r[u],l)),a=c.reduce((f,m)=>f+m,0)}let p=this.kmPerHourToMetersPerSecond(t),d=a/p;this.pathTween.getAll().forEach(f=>f.stop()),this.pathTween.removeAll();let h={distance:0};return new Promise(f=>{let m=new lo(h,this.pathTween).to({distance:a},d*1e3).onUpdate(()=>{for(let g=0;g<c.length;g++){let x=c.slice(0,g+1).reduce((b,_)=>b+_,0);if(x>=h.distance){let b=x-c[g],_=h.distance-b,E=r[g],W=r[g+1],G=Ue(E,W,_);this.path?.updatePoints([G,...r.slice(g+1)]),this.animationPathOptions.cPathIndex+=g,this.startPoi&&this.startPoi.position.setX(G[0]).setY(G[1]),this.dispatchEvent({type:"path-animation"});return}}}).onComplete(()=>{this.pathTween.remove(m),this.dispatchEvent({type:"path-animation-end"}),f(!0)}).start()})}kmPerHourToMetersPerSecond(n){return n*1e3/3600}dispose(){this.worker.terminate(),this.unRegistryEvent(),this.path?.dispose(),this.uniqueKey.dispose(),this.startPoi?.dispose()}};var wn=class extends U{cacheData=new Map;floorDataLengthMap=new Map;async load(n){let t=L(n);if(this.cacheData.has(t))return this.cacheData.get(t);console.time("floor/get\u8BF7\u6C42"+n.resource_type_list);let[,e]=await Promise.all([this.loadBuildGround(n),Xt(n,this.bmap.config)]);console.timeEnd("floor/get\u8BF7\u6C42"+n.resource_type_list);let r=L({floor:n.floor,ts:n.ts});this.bmap.transformGraphicData(e,this.bmap.buildingCenter,this.floorDataLengthMap.get(r)||0),e.forEach(s=>s.info.transformToBuildingGround=!1),this.cacheData.set(t,e);let i=this.floorDataLengthMap.get(r)||0;return this.floorDataLengthMap.set(r,i+e.length),e}isSameFloor(n){return this.bmap.context.currentFloor?.key===L(n)}switchFloorByData(n,t){if(this.isSameFloor(t)){if(!n.length)return;let e=this.bmap.context.currentFloor,r=e.userData.legacyToGraphicMap,i=e.userData.graphicMap,s=[];for(let l of n){if(l.info.group==="ground")e.createGround(l.info);else{let u=e.addGraphic(l.info);u.userData.data=l,r.set(l.legacy_id,u),s.push(u)}i.set(l.element_uuid,l)}this.bmap.triggerHooks("switch_floor_before",{curFloor:e,graphics:s}),this.bmap.initialFloorCamera(),this.bmap.triggerHooks("switch_floor_after",{curFloor:e,graphics:s})}else{let e=L(t),{curFloor:r,graphics:i}=this.bmap.createFloor(n);r.name=t.floor,r.key=e;let s=new Map;n.forEach(l=>{s.set(l.element_uuid,l)}),r.userData.graphicMap=s,this.bmap.triggerHooks("switch_floor_before",{curFloor:r,graphics:i}),this.bmap.context.switchFloor(r),this.bmap.initialFloorCamera(),this.bmap.triggerHooks("switch_floor_after",{curFloor:r,graphics:i})}}filterData(n,t){if(!this.isSameFloor(t))return n;let e=this.bmap.context.currentFloor.userData.graphicMap;return n.filter(r=>!e.has(r.element_uuid))}async switchFloorByStoreData(n){let t=await this.load({...n,resource_type_list:"6"}),e=this.filterData(t,n);this.switchFloorByData(e,n)}async switchFloorByOtherData(n){let t=await this.load({...n,resource_type_list:"1,2,3,4"}),e=this.filterData(t,n);this.switchFloorByData(e,n)}async loadBuildGround({brand:n,project:t}){let e=L({brand:n,project:t});return await this.bmap.loadBuildingGround({brand:n,project:t}),this.bmap.currentBuildGround=this.bmap.buildingGroundMap.get(e)||null,this.bmap.currentBuildGround}async changeFloor(n){return await Promise.all([this.switchFloorByStoreData(n),this.switchFloorByOtherData(n)]),Array.from(this.bmap.context.currentFloor.userData.graphicMap.values())}};import{Group as co}from"three";var Tn=class extends U{poiLayer;floors=[];group=new co;constructor(n){super(n),this.poiLayer=new tt(n.context)}show(n){let t=n[0].userData.height;n.forEach(i=>{i.poiLayer.pois.forEach(s=>{this.poiLayer.pushPoi(s)}),i.poiLayer.pois.length=0,i.poiLayer.dispose(),i.position.z=t,t+=i.userData.height});let{scene:e,currentFloor:r}=this.bmap.context;r&&(e.remove(r),r.dispose()),this.group.add(this.poiLayer,...n),e.add(this.group),this.floors=n}hide(){let{scene:n}=this.bmap.context;n.remove(this.group),this.poiLayer.clear(!0),this.floors.forEach(t=>{t.dispose()}),this.floors=[],this.group.clear()}fitCamera(){let{context:n,config:t,type:e}=this.bmap;n.cameraBound.setEnable(!1),n.control.minZoom=0,n.control.maxZoom=1/0,n.camera.zoom=1,n.setAzimuthalAngle(t.control.defaultAzimuthal,0),n.setPolarAngle(t.control.defaultPolar,0),n.fitCameraToObject(this.group,void 0,0);let r=n.camera.zoom;n.control.minZoom=r,n.control.maxZoom=r*25,e==="3d"&&n.fitCameraToObject(this.group,t.defaultPadding,0,!1),this.bmap.basicZoom=n.camera.zoom,n.control.addEventListener("change",this.bmap.onControlChange.bind(this.bmap)),this.bmap.onControlChange(),n.cameraBound.setEnable(!0)}dispose(){this.poiLayer.dispose(),this.floors.forEach(n=>n.dispose()),this.floors=[]}};var N;function Cn(o="aibee_map"){return new Promise((n,t)=>{if(N)return n({db:N,type:"success"});let e=indexedDB.open(o);e.onupgradeneeded=function(r){N=r.target.result,console.log("onupgradeneeded"),n({db:N,type:"onupgradeneeded"})},e.onsuccess=r=>{N=r.target.result,n({db:N,type:"success"})},e.onerror=r=>{t(r)}})}function Pn(o,n,t=N){return new Promise((e,r)=>{t||r("\u6CA1\u6709db");let s=t.transaction([o],"readonly").objectStore(o).get(n);s.onsuccess=()=>{s.result?e(s.result.value):e(null)},s.onerror=l=>{console.log("[getVersionByKey]",l),e(null)}})}function An(o,n,t,e=N){return new Promise((r,i)=>(e||i("\u6CA1\u6709db"),new Promise((s,l)=>{let a=e.transaction([o],"readwrite").objectStore(o).add({key:n,value:t});a.onsuccess=function(c){s(c)},a.onerror=function(c){l(c)}})))}function jt(o,n=N){n&&(n.objectStoreNames.contains(o)||n.createObjectStore(o,{keyPath:"key"}))}function Rn(){N?.close(),N=null}function H(o,n,t=0){o.forEach(e=>{e.geometry.coords=JSON.parse(JSON.stringify(e.geometry.cds)),e.geometry.type==="polygon"?(e.geometry.coords.map(r=>{Array.isArray(r)&&r.forEach(i=>{i[0]-=n[0],i[1]-=n[1]})}),e.geometry.otherCds&&(e.geometry.otherCoords=e.geometry.otherCds.map(r=>r.map(i=>nt(i,n))))):e.geometry.coords=nt(e.geometry.cds,n)});for(let e=0;e<o.length;e++){let r=o[e];r.deltaHeight=1e-5*(t+e+1)}}function nt(o,n){return[o[0]-n[0],o[1]-n[1]]}var mh={loadRoadNetwork:!1},Yt="version",le="map_data",Zt="road_network_data",Ln=class{constructor(n){this.bmap=n;this.initDb()}floors=[];async initDb(){try{let{db:n,type:t}=await Cn();t==="onupgradeneeded"&&(jt(Yt),jt(le),jt(Zt))}catch(n){console.log("[\u6253\u5F00indexDb\u9519\u8BEF]",n)}}async load(n){if(this.clear(),Array.isArray(n))this.floors=n;else{let t=await fetch(n).then(e=>e.json());t.code==="0"&&(this.floors=t.data.list)}}setCacheData(n,t,e){return An(n,`${t}`,e)}getCacheData(n,t){return Pn(n,`${t}`)}getFloorCacheKey(n){return`${n.floor_id}`}async getFloorData(n){let t=this.floors.find(r=>r.floor===n);if(!t)return null;let e=this.getFloorCacheKey(t);try{if(await this.getCacheData(Yt,e)===t.version_id){let i=await this.getCacheData(le,e);if(i)return this.getDataByJson(i)}return this.getFloorDataByFloorInfo(t)}catch{return this.getFloorDataByFloorInfo(t)}}async getFloorDataByFloorInfo(n){let t=this.getFloorCacheKey(n);console.time("zstd_json");let e=await fetch(n.map_url).then(r=>r.json());return console.timeEnd("zstd_json"),this.setCacheData(le,t,e),this.setCacheData(Yt,t,n.version_id),this.getDataByJson(e)}async getRoadNetworkData(){return(await Promise.all(this.floors.map(async t=>{let e=this.getFloorCacheKey(t);try{if(await this.getCacheData(Yt,e)===t.version_id){let s=await this.getCacheData(Zt,e);if(s)return s}let i=await fetch(t.route_url).then(s=>s.json());return await this.setCacheData(Zt,e,i),i}catch{let r=await fetch(t.route_url).then(i=>i.json());return await this.setCacheData(Zt,e,r),r}}))).filter(t=>t.points)}async getOtherDataByFreeTime(){}async getMulFloorsData(n){return Promise.all(n.map(t=>this.getFloorData(t))).then(t=>t.filter(e=>e))}async getDataByUrl(n){let t=await fetch(n).then(e=>e.json());return this.getDataByJson(t)}getDataByJson(n){let t=new z(this.bmap.context),e=[0,0];return n.layers.forEach(r=>{switch(r.l_type){case"range":let i=r.elements[0];e=[i.center_x,i.center_y];break;case"graph":let s=[],l=new Map;H(r.elements,e),r.elements.forEach(h=>{if(h.group==="ground")t.createGround(h);else{let f=t.addGraphic(h);s.push(f),l.set(h.id,f)}}),t.userData.graphics=s,t.userData.graphicMap=l;break;case"ground":H(r.elements,e);let u=r.elements.map(h=>new M(this.bmap.context,h));t.addGrounds(u);break;case"wall":H(r.elements,e);let a=r.elements.reduce((h,f)=>{let{fillColor:m,fillOpacity:g,strokeColor:x,strokeOpacity:b}=f,_=`${m}-${g}-${x}-${b}`;return h[_]?h[_].push(f):h[_]=[f],h},{});Object.values(a).forEach(h=>{let f=new Lt(this.bmap.context,h);t.wallLayer.add(f)});break;case"lane":H(r.elements,e);let c=r.elements.reduce((h,f)=>{let{fillColor:m,fillOpacity:g,strokeColor:x,strokeOpacity:b}=f,_=`${m}-${g}-${x}-${b}`;return h[_]?h[_].push(f):h[_]=[f],h},{});Object.values(c).forEach(h=>{let f=new Dt(this.bmap.context,h);t.laneLayer.add(f)});break;case"texture2d":case"texture3d":H(r.elements,e),r.elements.forEach(h=>{let f=new It(this.bmap.context,h);t.textureLayer.add(f)});break;case"glb":H(r.elements,e),r.elements.forEach(h=>{let f=new Nt(this.bmap.context,{...h,url:h.secondUrl,rotate:h.secondRotate,width:h.secondWidth});t.glbModelLayer.add(f)});break;case"store":r.elements.map(h=>{let f=nt([h.center_x,h.center_y],e);t.poiLayer.createPoi({icon:h.poi_info.icon,texts:[{text:h.store_name||h.poi_info.name}],position:{x:f[0],y:f[1],z:h.airHeight}})});break;case"facility":r.elements.map(h=>{let f=nt(h.geometry.cds,e);t.poiLayer.createPoi({icon:h.poi_info.icon,texts:[{text:h.store_name||h.poi_info.name}],position:{x:f[0],y:f[1],z:h.airHeight}})});break;case"parkingSpace":H(r.elements,e);let p=[],d=new Map;r.elements.forEach(h=>{let f=t.addGraphic(h);p.push(f),d.set(h.id,f);let m=nt([h.center_x,h.center_y],e);t.poiLayer.createPoi({texts:[{text:h.poi_info.name}],position:{x:m[0],y:m[1],z:h.airHeight}})}),t.userData.parkingSpaces=p,t.userData.parkingSpacesGraphicMap=d;break}}),t.userData.center=e,t.userData.height=n.floorHeight,t}clear(){}dispose(){this.clear(),Rn()}};export{Ln as AibeeLoader,yn as BMap,F as BaseSvg,Wt as Context,_n as Equipment,Ce as Events,z as Floor,Nt as GlbModel,M as Graphic,Tt as GraphicLayer,It as GroundTexture,St as HeatmapElement,it as HooksName,Ut as HoverHelper,Dt as Lane,C as Layer,Wi as MapTypePolar,wt as Model,Tn as MulFloors,Sn as Navigation,Mt as Overlay,hr as PathDirection,at as Poi,tt as PoiLayer,Qe as RoadNetwork,sn as SelectBox,Ft as Selection,bt as Shadow,wn as SplitLoad,At as SvgLine,Rt as SvgPolygon,D as Timer,Q as UniqueKey,Lt as Wall,Oo as addAlphaToHexColor,Me as calc_angle,pr as calc_direction,be as clearCanvas,Ee as clearTextTexture,tn as convertToSnakeCase,nr as createCanvas,rt as createCircle,mt as createLine,$ as createRect,Se as createSvg,gt as createSvgElement,J as darkenColor,mh as defaultAibeeLoaderOption,zi as defaultConfig,ci as defaultOptions,P as dispose,Te as disposeLoader,Fe as distancePointToSegment,L as generatorKeyByObj,Jt as getCenter,gn as getConfig,Qo as getDirectPath,S as getLength,Co as getLongestSideDir,dt as getPathLength,bo as getTextureByText,ve as hasChinese,ge as initCamera,er as initCanvas,ye as initControl,_e as initDirectionalLight,me as initLight,de as initRenderer,fe as initScene,B as initShape,ft as isContain,Qt as isControl,xt as isMac,mn as loadBuildingGround,Xt as loadGraphics,vt as loadModel,Ue as moveOnRoute,K as proxyOptions,cr as removeWeightPath,Y as setCirclePosition,A as setLineStartEnd,R as setRectPosition,Oe as simplifyPath,we as sleepOnePromise,Io as sleepOneRf,De as smoothPath,Do as strToNumber,j as timeoutPromise,hs as toWebWorker,st as triggerWorker,y as vector3ToDevice,qo as xhrGet};
3752
+ `);var lt=class extends En{constructor(n){super({uniforms:Object.assign({},Ki.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new $i(16777215)},opacity:{value:1},resolution:{value:new vn(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new vn(1,1)}}),vertexShader:w.meshline_vert,fragmentShader:w.meshline_frag}),this.isMeshLineMaterial=!0,this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(t){this.uniforms.lineWidth.value=t}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(t){this.uniforms.map.value=t}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(t){this.uniforms.useMap.value=t}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(t){this.uniforms.alphaMap.value=t}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(t){this.uniforms.useAlphaMap.value=t}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(t){this.uniforms.color.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(t){this.uniforms.sizeAttenuation.value=t}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(t){this.uniforms.dashArray.value=t,this.useDash=t!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(t){this.uniforms.dashOffset.value=t}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(t){this.uniforms.dashRatio.value=t}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(t){this.uniforms.useDash.value=t}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(t){this.uniforms.visibility.value=t}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(t){this.uniforms.alphaTest.value=t}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(t){this.uniforms.repeat.value.copy(t)}}}),this.setValues(n)}};lt.prototype.copy=function(o){return En.prototype.copy.call(this,o),this.lineWidth=o.lineWidth,this.map=o.map,this.useMap=o.useMap,this.alphaMap=o.alphaMap,this.useAlphaMap=o.useAlphaMap,this.color.copy(o.color),this.opacity=o.opacity,this.resolution.copy(o.resolution),this.sizeAttenuation=o.sizeAttenuation,this.dashArray.copy(o.dashArray),this.dashOffset.copy(o.dashOffset),this.dashRatio.copy(o.dashRatio),this.useDash=o.useDash,this.visibility=o.visibility,this.alphaTest=o.alphaTest,this.repeat.copy(o.repeat),this};var bn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAMAAACROYkbAAABrVBMVEVsjPdsjPdqi/doifdpivdrjPdsjPdsjPd/m/igtfqTq/lykfdri/dsjPdtjfe/zPv8/f/w8/6zw/p0kvdri/dsjPdtjffU3vz////////3+f62xfpzkfdri/dsjPdsjPeZr/nr8P7////////4+f62xfp0kvdri/dsjPdsjPdujveXrvne5v3////////3+f63x/t2lPdri/dsjPdsjPdsjPdri/eMpfjb4/3+/v/////4+v+7yft1k/dri/dsjPdsjPdri/eJovjl6/3////////3+f6Jo/lqivdsjPdri/dvjveluPry9f7////////i6f2BnPhqi/dsjPdrjPdvjveluPrv8v7////////l6/6Uq/lsjPdsjPdsjPdvjveluPrv8v7////////m6/6Uq/lsjPdsjPdsjPdsjPeZr/nv8v7////////s8f6XrvlsjPdsjPdtjffS2/z////////w9P6bsfltjfdsjPdtjffBz/v7/P/y9f6svvpxkPdrjPdsjPdsjPd+mviftPqVrPlykfdri/dsjPdsjPdri/doifdpifdrjPdsjPclkRlrAAAAx0lEQVQ4y2NgwAsYmZhZWNkYyAfsHJxc3Dy85BvAxy8gKCQsIkq2AWLiEpJS0jKycuQaIK+gqKSsoqqmrkGmAZpa2jq6evoGhkbG5BlgYmpmbmFpZW1ja0emE+wdHJ2cXVzd3D3INMDTy9vH188/IDCIPP3BIaFh4RGRUdExseQZEBefkJiUnJKalp5BngGZWdk5uXn5BemFZAZBUXFJaVl5RSWZ9jMwVFXX1NbVNzSSq5+hqbmlta29g2z9DJ1d3T29ffhUAABKPSh5Xst3GwAAAABJRU5ErkJggg==";var Mn={texture_url:bn,lineWidth:8,color:16777215},qt=class extends eo{constructor(t,e){super();this.navigation=t;this.config=Object.assign({},Mn,e),this.registryEvent()}mesh=null;geometry=null;material=null;texture=null;config=Mn;points=[];basicRepeat=1;registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate)}onControlChange=()=>{this.changeRepeat()};onUpdate=()=>{this.texture};getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:r,height:i}}}}}=this,s=t.map(([u,a])=>y(new io(u,a,0),e,r,i)).map(({x:u,y:a})=>[u,a]);return dt(s)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new ae(t,1)}loadTexture(t){return new Promise((e,r)=>{new no().load(t,e,void 0,r)})}transformPoints(t){let e=[];for(let r=0;r<t.length;r++)e.push(...t[r],0);return e}updatePoints(t){this.points=t,this.changeRepeat();let e=this.transformPoints(t);this.geometry&&this.geometry.setPoints(e)}async create(t){let e=this.geometry=new T;if(this.updatePoints(t),!this.texture){let s=this.texture=await this.loadTexture(this.config.texture_url);s.wrapS=s.wrapT=so}let r=this.material=new lt({useMap:!0,color:new ro(this.config.color),transparent:!0,resolution:new ae(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!0,sizeAttenuation:!1,lineWidth:this.config.lineWidth*2,map:this.texture,blending:oo,repeat:new ae(this.getRepeat(),1)}),i=this.mesh=new to(e,r);return this.add(i),i}dispose(){this.unRegistryEvent(),this.clear(),this.geometry?.dispose(),this.material?.dispose(),this.texture?.dispose()}};import{Group as ao,Tween as lo}from"@tweenjs/tween.js";var uo={path:{},speed:10,cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},loadRoad:!0},Sn=class extends U{path=null;worker=oe();fetchRoadStatus=!1;uniqueKey=new Q;paths=[];options;pathTween=new ao;startPoi=null;animationPathOptions={cPathIndex:0};cPath=[];constructor(n,t,e={}){super(n),this.options=Object.assign({},uo,e);let{apiDomain:r,apiPath:{roadNetwork:i},apiInfo:s}=this.bmap.config;this.registryEvent(),this.options.loadRoad&&st(this.worker,"load_road",{url:`${r||location.origin}${i}?project=${t}`,...s}).then(l=>{this.fetchRoadStatus=!0,this.dispatchEvent({type:"fetch-road-status",status:!0}),this.dispatchEvent({type:"fetch-road-data",roadInfo:l})}).catch(l=>{console.log("[\u52A0\u8F7D\u8DEF\u7F51\u5931\u8D25]",l)})}registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate),this.bmap.addEventListener("switch_floor_after",this.onSwitchFloor)}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate),this.bmap.removeEventListener("switch_floor_after",this.onSwitchFloor)}onUpdate=()=>{this.pathTween.update()};async setRoadData(n){this.fetchRoadStatus=!1,this.dispatchEvent({type:"fetch-road-status",status:!1}),await st(this.worker,"set_road_info",n),this.fetchRoadStatus=!0,this.dispatchEvent({type:"fetch-road-status",status:!0})}clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.pathTween.getAll().forEach(n=>n.stop()),this.pathTween.removeAll())}onSwitchFloor=({data:{curFloor:n}})=>{if(this.paths.length){let t=this.paths.find(e=>e.floor===n.name);t?this.renderPath(this.translatePoints(t.points)):this.clearPath()}else this.clearPath()};getDirectionPath(n){return st(this.worker,"get_direction_path",n)}addPath(n){this.paths=n;let t=this.bmap.context.currentFloor?.name,e=n.find(r=>r.floor===t);if(e)if(this.bmap.currentBuildGround)this.renderPath(this.translatePoints(e.points));else{let r=()=>{this.bmap.removeEventListener("center-change",r),this.renderPath(this.translatePoints(e.points))};this.bmap.addEventListener("center-change",r)}else this.clearPath()}translatePoints(n){let[t,e]=this.bmap.buildingCenter;return n.map(r=>[r[0]-t,r[1]-e])}getPath(n,t,e=""){return new Promise((r,i)=>{let s=()=>{st(this.worker,"get_path",{start:n,end:t,type:e}).then(l=>{l?typeof l=="string"?i(l):r(l):i("no-path")})};if(this.fetchRoadStatus)s();else{let l=({status:u})=>{u&&(this.removeEventListener("fetch-road-status",l),s())};this.addEventListener("fetch-road-status",l)}})}renderPath(n){let t=this.catmullRomCurve3(n);this.cPath=t,this.animationPathOptions={cPathIndex:0},this.path?this.path.updatePoints(t):(this.path=new qt(this,this.options.path),this.path.create(t),this.path.position.z=this.bmap.context.currentFloor.groundMaxHeight+1,this.bmap.context.scene.add(this.path)),this.startPoi&&(this.startPoi.dispose(),this.startPoi=null),this.options.needStartPoi&&(this.startPoi=this.bmap.context.currentFloor?.addPoi({...this.options.startPoi,position:{x:t[0][0],y:t[0][1],z:1e-4},collision_enable:!1})||null)}catmullRomCurve3(n){return Oe(n,!1,!0,.1,150,2.5)}async animationTo(n,t=this.options.speed){if(n.floor!==this.bmap.context.currentFloor?.name||!this.path)return;let{animationPathOptions:{cPathIndex:e}}=this,r=[this.path.points[0],...this.cPath.slice(e+1)],i=this.translatePoints([n.pos])[0],{distance:s,pos:l,index:u}=r.reduce((f,m,g,x)=>{if(g===x.length-1)return f;let{distance:b,closestPoint:_}=Fe(i,m,x[g+1]);return b<f.distance&&(f.distance=b,f.pos=_,f.index=g),f},{distance:Number.MAX_SAFE_INTEGER,pos:n.pos,index:0});if(s>this.options.cheapMaximumDistance||this.path.points[0][0]===l[0]&&this.path.points[0][1]===l[1])return;let a=0,c=[];if(u===0)a=S(r[0],l),c=[a];else{c=[S(r[0],r[1])];for(let f=1;f<u;f++)c.push(S(r[f],r[f+1]));c.push(S(r[u],l)),a=c.reduce((f,m)=>f+m,0)}let p=this.kmPerHourToMetersPerSecond(t),d=a/p;this.pathTween.getAll().forEach(f=>f.stop()),this.pathTween.removeAll();let h={distance:0};return new Promise(f=>{let m=new lo(h,this.pathTween).to({distance:a},d*1e3).onUpdate(()=>{for(let g=0;g<c.length;g++){let x=c.slice(0,g+1).reduce((b,_)=>b+_,0);if(x>=h.distance){let b=x-c[g],_=h.distance-b,E=r[g],W=r[g+1],G=Ue(E,W,_);this.path?.updatePoints([G,...r.slice(g+1)]),this.animationPathOptions.cPathIndex+=g,this.startPoi&&this.startPoi.position.setX(G[0]).setY(G[1]),this.dispatchEvent({type:"path-animation"});return}}}).onComplete(()=>{this.pathTween.remove(m),this.dispatchEvent({type:"path-animation-end"}),f(!0)}).start()})}kmPerHourToMetersPerSecond(n){return n*1e3/3600}dispose(){this.worker.terminate(),this.unRegistryEvent(),this.path?.dispose(),this.uniqueKey.dispose(),this.startPoi?.dispose()}};var wn=class extends U{cacheData=new Map;floorDataLengthMap=new Map;async load(n){let t=L(n);if(this.cacheData.has(t))return this.cacheData.get(t);console.time("floor/get\u8BF7\u6C42"+n.resource_type_list);let[,e]=await Promise.all([this.loadBuildGround(n),Xt(n,this.bmap.config)]);console.timeEnd("floor/get\u8BF7\u6C42"+n.resource_type_list);let r=L({floor:n.floor,ts:n.ts});this.bmap.transformGraphicData(e,this.bmap.buildingCenter,this.floorDataLengthMap.get(r)||0),e.forEach(s=>s.info.transformToBuildingGround=!1),this.cacheData.set(t,e);let i=this.floorDataLengthMap.get(r)||0;return this.floorDataLengthMap.set(r,i+e.length),e}isSameFloor(n){return this.bmap.context.currentFloor?.key===L(n)}switchFloorByData(n,t){if(this.isSameFloor(t)){if(!n.length)return;let e=this.bmap.context.currentFloor,r=e.userData.legacyToGraphicMap,i=e.userData.graphicMap,s=[];for(let l of n){if(l.info.group==="ground")e.createGround(l.info);else{let u=e.addGraphic(l.info);u.userData.data=l,r.set(l.legacy_id,u),s.push(u)}i.set(l.element_uuid,l)}this.bmap.triggerHooks("switch_floor_before",{curFloor:e,graphics:s}),this.bmap.initialFloorCamera(),this.bmap.triggerHooks("switch_floor_after",{curFloor:e,graphics:s})}else{let e=L(t),{curFloor:r,graphics:i}=this.bmap.createFloor(n);r.name=t.floor,r.key=e;let s=new Map;n.forEach(l=>{s.set(l.element_uuid,l)}),r.userData.graphicMap=s,this.bmap.triggerHooks("switch_floor_before",{curFloor:r,graphics:i}),this.bmap.context.switchFloor(r),this.bmap.initialFloorCamera(),this.bmap.triggerHooks("switch_floor_after",{curFloor:r,graphics:i})}}filterData(n,t){if(!this.isSameFloor(t))return n;let e=this.bmap.context.currentFloor.userData.graphicMap;return n.filter(r=>!e.has(r.element_uuid))}async switchFloorByStoreData(n){let t=await this.load({...n,resource_type_list:"6"}),e=this.filterData(t,n);this.switchFloorByData(e,n)}async switchFloorByOtherData(n){let t=await this.load({...n,resource_type_list:"1,2,3,4"}),e=this.filterData(t,n);this.switchFloorByData(e,n)}async loadBuildGround({brand:n,project:t}){let e=L({brand:n,project:t});return await this.bmap.loadBuildingGround({brand:n,project:t}),this.bmap.currentBuildGround=this.bmap.buildingGroundMap.get(e)||null,this.bmap.currentBuildGround}async changeFloor(n){return await Promise.all([this.switchFloorByStoreData(n),this.switchFloorByOtherData(n)]),Array.from(this.bmap.context.currentFloor.userData.graphicMap.values())}};import{Group as co}from"three";var Tn=class extends U{poiLayer;floors=[];group=new co;constructor(n){super(n),this.poiLayer=new tt(n.context)}show(n){let t=n[0].userData.height;n.forEach(i=>{i.poiLayer.pois.forEach(s=>{this.poiLayer.pushPoi(s)}),i.poiLayer.pois.length=0,i.poiLayer.dispose(),i.position.z=t,t+=i.userData.height});let{scene:e,currentFloor:r}=this.bmap.context;r&&(e.remove(r),r.dispose()),this.group.add(this.poiLayer,...n),e.add(this.group),this.floors=n}hide(){let{scene:n}=this.bmap.context;n.remove(this.group),this.poiLayer.clear(!0),this.floors.forEach(t=>{t.dispose()}),this.floors=[],this.group.clear()}fitCamera(){let{context:n,config:t,type:e}=this.bmap;n.cameraBound.setEnable(!1),n.control.minZoom=0,n.control.maxZoom=1/0,n.camera.zoom=1,n.setAzimuthalAngle(t.control.defaultAzimuthal,0),n.setPolarAngle(t.control.defaultPolar,0),n.fitCameraToObject(this.group,void 0,0);let r=n.camera.zoom;n.control.minZoom=r,n.control.maxZoom=r*25,e==="3d"&&n.fitCameraToObject(this.group,t.defaultPadding,0,!1),this.bmap.basicZoom=n.camera.zoom,n.control.addEventListener("change",this.bmap.onControlChange.bind(this.bmap)),this.bmap.onControlChange(),n.cameraBound.setEnable(!0)}dispose(){this.poiLayer.dispose(),this.floors.forEach(n=>n.dispose()),this.floors=[]}};var N;function Cn(o="aibee_map"){return new Promise((n,t)=>{if(N)return n({db:N,type:"success"});let e=indexedDB.open(o);e.onupgradeneeded=function(r){N=r.target.result,console.log("onupgradeneeded"),n({db:N,type:"onupgradeneeded"})},e.onsuccess=r=>{N=r.target.result,n({db:N,type:"success"})},e.onerror=r=>{t(r)}})}function Pn(o,n,t=N){return new Promise((e,r)=>{t||r("\u6CA1\u6709db");let s=t.transaction([o],"readonly").objectStore(o).get(n);s.onsuccess=()=>{s.result?e(s.result.value):e(null)},s.onerror=l=>{console.log("[getVersionByKey]",l),e(null)}})}function An(o,n,t,e=N){return new Promise((r,i)=>(e||i("\u6CA1\u6709db"),new Promise((s,l)=>{let a=e.transaction([o],"readwrite").objectStore(o).add({key:n,value:t});a.onsuccess=function(c){s(c)},a.onerror=function(c){l(c)}})))}function jt(o,n=N){n&&(n.objectStoreNames.contains(o)||n.createObjectStore(o,{keyPath:"key"}))}function Rn(){N?.close(),N=null}function H(o,n,t=0){o.forEach(e=>{e.geometry.coords=JSON.parse(JSON.stringify(e.geometry.cds)),e.geometry.type==="polygon"?(e.geometry.coords.map(r=>{Array.isArray(r)&&r.forEach(i=>{i[0]-=n[0],i[1]-=n[1]})}),e.geometry.otherCds&&(e.geometry.otherCoords=e.geometry.otherCds.map(r=>r.map(i=>nt(i,n))))):e.geometry.coords=nt(e.geometry.cds,n)});for(let e=0;e<o.length;e++){let r=o[e];r.deltaHeight=1e-5*(t+e+1)}}function nt(o,n){return[o[0]-n[0],o[1]-n[1]]}var gh={loadRoadNetwork:!1},Yt="version",le="map_data",Zt="road_network_data",Ln=class{constructor(n){this.bmap=n;this.initDb()}floors=[];async initDb(){try{let{db:n,type:t}=await Cn();t==="onupgradeneeded"&&(jt(Yt),jt(le),jt(Zt))}catch(n){console.log("[\u6253\u5F00indexDb\u9519\u8BEF]",n)}}async load(n){if(this.clear(),Array.isArray(n))this.floors=n;else{let t=await fetch(n).then(e=>e.json());t.code==="0"&&(this.floors=t.data.list)}}setCacheData(n,t,e){return An(n,`${t}`,e)}getCacheData(n,t){return Pn(n,`${t}`)}getFloorCacheKey(n){return`${n.floor_id}`}async getFloorData(n){let t=this.floors.find(r=>r.floor===n);if(!t)return null;let e=this.getFloorCacheKey(t);try{if(await this.getCacheData(Yt,e)===t.version_id){let i=await this.getCacheData(le,e);if(i)return this.getDataByJson(i)}return this.getFloorDataByFloorInfo(t)}catch{return this.getFloorDataByFloorInfo(t)}}async getFloorDataByFloorInfo(n){let t=this.getFloorCacheKey(n);console.time("zstd_json");let e=await fetch(n.map_url).then(r=>r.json());return console.timeEnd("zstd_json"),this.setCacheData(le,t,e),this.setCacheData(Yt,t,n.version_id),this.getDataByJson(e)}async getRoadNetworkData(){return(await Promise.all(this.floors.map(async t=>{let e=this.getFloorCacheKey(t);try{if(await this.getCacheData(Yt,e)===t.version_id){let s=await this.getCacheData(Zt,e);if(s)return s}let i=await fetch(t.route_url).then(s=>s.json());return await this.setCacheData(Zt,e,i),i}catch{let r=await fetch(t.route_url).then(i=>i.json());return await this.setCacheData(Zt,e,r),r}}))).filter(t=>t.points)}async getOtherDataByFreeTime(){}async getMulFloorsData(n){return Promise.all(n.map(t=>this.getFloorData(t))).then(t=>t.filter(e=>e))}async getDataByUrl(n){let t=await fetch(n).then(e=>e.json());return this.getDataByJson(t)}getDataByJson(n){let t=new z(this.bmap.context),e=[0,0];return n.layers.forEach(r=>{switch(r.l_type){case"range":let i=r.elements[0];e=[i.center_x,i.center_y];break;case"graph":let s=[],l=new Map;H(r.elements,e),r.elements.forEach(h=>{if(h.group==="ground")t.createGround(h);else{let f=t.addGraphic(h);s.push(f),l.set(h.id,f)}}),t.userData.graphics=s,t.userData.graphicMap=l;break;case"ground":H(r.elements,e);let u=r.elements.map(h=>new M(this.bmap.context,h));t.addGrounds(u);break;case"wall":H(r.elements,e);let a=r.elements.reduce((h,f)=>{let{fillColor:m,fillOpacity:g,strokeColor:x,strokeOpacity:b}=f,_=`${m}-${g}-${x}-${b}`;return h[_]?h[_].push(f):h[_]=[f],h},{});Object.values(a).forEach(h=>{let f=new Lt(this.bmap.context,h);t.wallLayer.add(f)});break;case"lane":H(r.elements,e);let c=r.elements.reduce((h,f)=>{let{fillColor:m,fillOpacity:g,strokeColor:x,strokeOpacity:b}=f,_=`${m}-${g}-${x}-${b}`;return h[_]?h[_].push(f):h[_]=[f],h},{});Object.values(c).forEach(h=>{let f=new Dt(this.bmap.context,h);t.laneLayer.add(f)});break;case"texture2d":case"texture3d":H(r.elements,e),r.elements.forEach(h=>{let f=new It(this.bmap.context,h);t.textureLayer.add(f)});break;case"glb":H(r.elements,e),r.elements.forEach(h=>{let f=new Nt(this.bmap.context,{...h,url:h.secondUrl,rotate:h.secondRotate,width:h.secondWidth});t.glbModelLayer.add(f)});break;case"store":r.elements.map(h=>{let f=nt([h.center_x,h.center_y],e);t.poiLayer.createPoi({icon:h.poi_info.icon,texts:[{text:h.store_name||h.poi_info.name}],position:{x:f[0],y:f[1],z:h.airHeight}})});break;case"facility":r.elements.map(h=>{let f=nt(h.geometry.cds,e);t.poiLayer.createPoi({icon:h.poi_info.icon,texts:[{text:h.store_name||h.poi_info.name}],position:{x:f[0],y:f[1],z:h.airHeight}})});break;case"parkingSpace":H(r.elements,e);let p=[],d=new Map;r.elements.forEach(h=>{let f=t.addGraphic(h);p.push(f),d.set(h.id,f);let m=nt([h.center_x,h.center_y],e);t.poiLayer.createPoi({texts:[{text:h.poi_info.name}],position:{x:m[0],y:m[1],z:h.airHeight}})}),t.userData.parkingSpaces=p,t.userData.parkingSpacesGraphicMap=d;break}}),t.userData.center=e,t.userData.height=n.floorHeight,t}clear(){}dispose(){this.clear(),Rn()}};export{Ln as AibeeLoader,yn as BMap,F as BaseSvg,Wt as Context,_n as Equipment,Ce as Events,z as Floor,Nt as GlbModel,M as Graphic,Tt as GraphicLayer,It as GroundTexture,St as HeatmapElement,it as HooksName,Ut as HoverHelper,Dt as Lane,C as Layer,Wi as MapTypePolar,wt as Model,Tn as MulFloors,Sn as Navigation,Mt as Overlay,hr as PathDirection,at as Poi,tt as PoiLayer,Qe as RoadNetwork,sn as SelectBox,Ft as Selection,bt as Shadow,wn as SplitLoad,At as SvgLine,Rt as SvgPolygon,D as Timer,Q as UniqueKey,Lt as Wall,Oo as addAlphaToHexColor,Me as calc_angle,pr as calc_direction,be as clearCanvas,Ee as clearTextTexture,tn as convertToSnakeCase,nr as createCanvas,rt as createCircle,mt as createLine,$ as createRect,Se as createSvg,gt as createSvgElement,J as darkenColor,gh as defaultAibeeLoaderOption,zi as defaultConfig,ci as defaultOptions,P as dispose,Te as disposeLoader,Fe as distancePointToSegment,L as generatorKeyByObj,Jt as getCenter,gn as getConfig,Qo as getDirectPath,S as getLength,Co as getLongestSideDir,dt as getPathLength,bo as getTextureByText,ve as hasChinese,ge as initCamera,er as initCanvas,ye as initControl,_e as initDirectionalLight,me as initLight,de as initRenderer,fe as initScene,B as initShape,ft as isContain,Qt as isControl,xt as isMac,mn as loadBuildingGround,Xt as loadGraphics,vt as loadModel,Ue as moveOnRoute,K as proxyOptions,cr as removeWeightPath,Y as setCirclePosition,A as setLineStartEnd,R as setRectPosition,Oe as simplifyPath,we as sleepOnePromise,Io as sleepOneRf,De as smoothPath,Do as strToNumber,j as timeoutPromise,hs as toWebWorker,st as triggerWorker,y as vector3ToDevice,qo as xhrGet};
3753
3753
  //# sourceMappingURL=bmap.esm.min.js.map