@aibee/crc-bmap 0.0.132 → 0.0.133
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/lib/bmap.cjs.min.js +1 -1
- package/lib/bmap.cjs.min.js.map +2 -2
- package/lib/bmap.esm.js +2 -3
- package/lib/bmap.esm.js.map +2 -2
- package/lib/bmap.esm.min.js +1 -1
- package/lib/bmap.esm.min.js.map +2 -2
- package/lib/bmap.min.js +1 -1
- package/lib/bmap.min.js.map +2 -2
- package/package.json +1 -1
package/lib/bmap.cjs.min.js
CHANGED
|
@@ -3775,5 +3775,5 @@ three/build/three.module.js:
|
|
|
3775
3775
|
*/
|
|
3776
3776
|
`)}var N=require("three");var m=require("three"),X=class extends m.BufferGeometry{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 m.Matrix4,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)}}})}};X.prototype.setMatrixWorld=function(o){this.matrixWorld=o};X.prototype.setGeometry=function(o,n){this._geometry=o,this.setPoints(o.getAttribute("position").array,n)};X.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 m.Vector3)for(var t=0;t<o.length;t++){var e=o[t],i=t/o.length;this.positions.push(e.x,e.y,e.z),this.positions.push(e.x,e.y,e.z),this.counters.push(i),this.counters.push(i)}else for(var t=0;t<o.length;t+=3){var i=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(i),this.counters.push(i)}this.process()};function tr(o,n){var t=new m.Matrix4,e=new m.Ray,i=new m.Sphere,r=new m.Vector3,s=this.geometry;if(s.boundingSphere||s.computeBoundingSphere(),i.copy(s.boundingSphere),i.applyMatrix4(this.matrixWorld),o.ray.intersectSphere(i,r)!==!1){t.copy(this.matrixWorld).invert(),e.copy(o.ray).applyMatrix4(t);var a=new m.Vector3,u=new m.Vector3,l=new m.Vector3,c=this instanceof m.LineSegments?2:1,p=s.index,f=s.attributes;if(p!==null)for(var d=p.array,y=f.position.array,_=f.width.array,h=0,g=d.length-1;h<g;h+=c){var x=d[h],E=d[h+1];a.fromArray(y,x*3),u.fromArray(y,E*3);var M=_[Math.floor(h/3)]!==void 0?_[Math.floor(h/3)]:1,C=o.params.Line.threshold+this.material.lineWidth*M/2,G=C*C,D=e.distanceSqToSegment(a,u,r,l);if(!(D>G)){r.applyMatrix4(this.matrixWorld);var oe=o.ray.origin.distanceTo(r);oe<o.near||oe>o.far||(n.push({distance:oe,point:l.clone().applyMatrix4(this.matrixWorld),index:h,face:null,faceIndex:null,object:this}),h=g)}}}}X.prototype.raycast=tr;X.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]};X.prototype.copyV3=function(o){var n=o*6;return[this.positions[n],this.positions[n+1],this.positions[n+2]]};X.prototype.getDistance=function(o){let n=0;for(let t=0;t<o;t++){let e=6*t,i=new m.Vector3(this.positions[e],this.positions[e+1],this.positions[e+2]),r=new m.Vector3(this.positions[e+6],this.positions[e+7],this.positions[e+8]),s=i.distanceTo(r);n+=s}return n};X.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 i=0;i<o;i++){if(this.side.push(1),this.side.push(-1),this.widthCallback?n=this.widthCallback(i/(o-1)):n=1,this.width.push(n),this.width.push(n),i===0)this.uvs.push(0,0),this.uvs.push(0,1);else if(i===o-1)this.uvs.push(1,0),this.uvs.push(1,1);else{let s=this.getDistance(i)/t;this.uvs.push(s,0),this.uvs.push(s,1)}if(i<o-1){e=this.copyV3(i),this.previous.push(e[0],e[1],e[2]),this.previous.push(e[0],e[1],e[2]);var r=i*2;this.indices_array.push(r,r+1,r+2),this.indices_array.push(r+2,r+1,r+3)}i>0&&(e=this.copyV3(i),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 m.BufferAttribute(new Float32Array(this.positions),3),previous:new m.BufferAttribute(new Float32Array(this.previous),3),next:new m.BufferAttribute(new Float32Array(this.next),3),side:new m.BufferAttribute(new Float32Array(this.side),1),width:new m.BufferAttribute(new Float32Array(this.width),1),uv:new m.BufferAttribute(new Float32Array(this.uvs),2),index:new m.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new m.BufferAttribute(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 hn(o,n,t,e,i){var r;if(o=o.subarray||o.slice?o:o.buffer,t=t.subarray||t.slice?t:t.buffer,o=n?o.subarray?o.subarray(n,i&&n+i):o.slice(n,i&&n+i):o,t.set)t.set(o,e);else for(r=0;r<o.length;r++)t[r+e]=o[r];return t}X.prototype.advance=function(o){var n=this._attributes.position.array,t=this._attributes.previous.array,e=this._attributes.next.array,i=n.length;hn(n,0,t,0,i),hn(n,6,n,0,i-6),n[i-6]=o.x,n[i-5]=o.y,n[i-4]=o.z,n[i-3]=o.x,n[i-2]=o.y,n[i-1]=o.z,hn(n,6,e,0,i-6),e[i-6]=o.x,e[i-5]=o.y,e[i-4]=o.z,e[i-3]=o.x,e[i-2]=o.y,e[i-1]=o.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0};m.ShaderChunk.meshline_vert=["",m.ShaderChunk.logdepthbuf_pars_vertex,m.ShaderChunk.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;","",m.ShaderChunk.logdepthbuf_vertex,m.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",m.ShaderChunk.fog_vertex,"}"].join(`
|
|
3777
3777
|
`);m.ShaderChunk.meshline_frag=["",m.ShaderChunk.fog_pars_fragment,m.ShaderChunk.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;","uniform float thresholdRatio;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {","",m.ShaderChunk.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);","",m.ShaderChunk.fog_fragment,"if (vUV.x <= thresholdRatio) {","gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);","}","}"].join(`
|
|
3778
|
-
`);var ie=class extends m.ShaderMaterial{constructor(n){super({uniforms:Object.assign({},m.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new m.Color(16777215)},opacity:{value:1},resolution:{value:new m.Vector2(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 m.Vector2(1,1)},thresholdRatio:{value:0},transparent:{value:!0},depthTest:{vale:!1},depthWrite:{value:!1},alphaTest:{value:.2}}),vertexShader:m.ShaderChunk.meshline_vert,fragmentShader:m.ShaderChunk.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)}},thresholdRatio:{enumerable:!0,get:function(){return this.uniforms.thresholdRatio.value},set:function(t){this.uniforms.thresholdRatio.value=t}}}),this.setValues(n)}};ie.prototype.copy=function(o){return m.ShaderMaterial.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 di="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 gi={texture_url:di,lineWidth:8,color:16777215},be=class extends N.Object3D{constructor(t,e){super();this.navigation=t;this.config=Object.assign({},gi,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}mesh=null;geometry=null;material=null;texture=null;config=gi;points=[];pathDistance=0;basicRepeat=1;prevCameraZoom=0;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=()=>{let t=this.navigation.bmap.context.camera.zoom;t!==this.prevCameraZoom&&(this.prevCameraZoom=t,this.changeRepeat())};onUpdate=()=>{this.texture};getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:i,height:r}}}}}=this,s=t.map(([u,l])=>v(new N.Vector3(u,l,0),e,i,r)).map(({x:u,y:l})=>[u,l]);return lt(s)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new N.Vector2(t,1)}loadTexture(t){return new Promise((e,i)=>{new N.TextureLoader().load(t,e,void 0,i)})}transformPoints(t){let e=[];for(let i=0;i<t.length;i++)e.push(...t[i],0);return e}updatePoints(t){this.points=t,this.pathDistance=lt(t),this.changeRepeat();let e=this.transformPoints(t);this.geometry&&this.geometry.setPoints(e)}movePath(t){if(!this.material||!this.pathDistance)return;let e=t/this.pathDistance;this.material.thresholdRatio=e}async create(t){let e=this.geometry=new X;if(this.updatePoints(t),!this.texture){let s=this.texture=await this.loadTexture(this.config.texture_url);s.wrapS=s.wrapT=N.RepeatWrapping}let i=this.material=new ie({useMap:!0,color:new N.Color(this.config.color),transparent:!0,resolution:new N.Vector2(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:N.NormalBlending,repeat:new N.Vector2(this.getRepeat(),1)}),r=this.mesh=new N.Mesh(e,i);return r.renderOrder=9,this.add(r),r}dispose(){this.unRegistryEvent(),this.clear(),this.geometry?.dispose(),this.material?.dispose(),this.texture?.dispose()}};var re=require("@tweenjs/tween.js"),it=require("three"),nr={path:{},speed:10,cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},loadRoad:!0,roadNetwork:"RoadNetwork"},pn=class extends st{path=null;worker=cn();fetchRoadStatus=!1;uniqueKey=new xt;paths=[];options;pathTween=new re.Group;startPoi=null;movedDistance=0;pathStart=[0,0];animationPathOptions={cPathIndex:0};cPath=[];constructor(n,t,e={}){super(n),this.options=Object.assign({},nr,e);let{apiDomain:i,apiPath:{roadNetwork:r},apiInfo:s}=this.bmap.config;this.registryEvent(),this.options.loadRoad&&Et(this.worker,"load_road",{url:`${i||location.origin}${r}?project=${t}`,...s}).then(a=>{this.fetchRoadStatus=!0,this.dispatchEvent({type:"fetch-road-status",status:!0}),this.dispatchEvent({type:"fetch-road-data",roadInfo:a})}).catch(a=>{console.log("[\u52A0\u8F7D\u8DEF\u7F51\u5931\u8D25]",a)}),this.options.roadNetwork!=="RoadNetwork"&&Et(this.worker,"change_road_network",this.options.roadNetwork)}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 Et(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()),this.startPoi&&(this.bmap.context.currentFloor?.poiLayer2.removePoi(this.startPoi),this.startPoi=null)}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 Et(this.worker,"get_direction_path",n)}addPath(n){this.paths=n;let t=this.bmap.context.currentFloor?.name,e=n.find(i=>i.floor===t);if(e)if(this.bmap.currentBuildGround)this.renderPath(this.translatePoints(e.points));else{let i=()=>{this.bmap.removeEventListener("center-change",i),this.renderPath(this.translatePoints(e.points))};this.bmap.addEventListener("center-change",i)}else this.clearPath()}translatePoints(n){let[t,e]=this.bmap.buildingCenter;return n.map(i=>[i[0]-t,i[1]-e])}getPath(n,t,e=""){return new Promise((i,r)=>{let s=()=>{Et(this.worker,"get_path",{start:n,end:t,type:e}).then(a=>{a?typeof a=="string"?r(a):i(a):r("no-path")})};if(this.fetchRoadStatus)s();else{let a=({status:u})=>{u&&(this.removeEventListener("fetch-road-status",a),s())};this.addEventListener("fetch-road-status",a)}})}renderPath(n){let t=this.catmullRomCurve3(n);this.cPath=t,this.animationPathOptions={cPathIndex:0},this.movedDistance=0,this.pathStart=t[0],this.path?this.path.updatePoints(t):(this.path=new be(this,this.options.path),this.path.create(t),this.path.position.z=this.bmap.context.currentFloor.groundMaxHeight+.5,this.bmap.context.scene.add(this.path)),this.startPoi&&(this.bmap.context.currentFloor?.poiLayer2.removePoi(this.startPoi),this.startPoi=null),this.options.needStartPoi&&(this.startPoi=new V(this.bmap.context,{...this.options.startPoi,id:"navigation_start_poi",position:{x:t[0][0],y:t[0][1],z:1e-4},collision_enable:!1})||null,this.bmap.context.currentFloor?.poiLayer2.pushPoi(this.startPoi))}catmullRomCurve3(n){return qe(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,i=[this.pathStart,...this.cPath.slice(e+1)],r=this.translatePoints([n.pos])[0],{distance:s,pos:a,index:u}=i.reduce((h,g,x,E)=>{if(x===E.length-1)return h;let{distance:M,closestPoint:C}=je(r,g,E[x+1]);return M<h.distance&&(h.distance=M,h.pos=C,h.index=x),h},{distance:Number.MAX_SAFE_INTEGER,pos:n.pos,index:0});if(s>this.options.cheapMaximumDistance||this.path.points[0][0]===a[0]&&this.path.points[0][1]===a[1])return;let l=0,c=[];if(u===0)l=L(i[0],a),c=[l];else{c=[L(i[0],i[1])];for(let h=1;h<u;h++)c.push(L(i[h],i[h+1]));c.push(L(i[u],a)),l=c.reduce((h,g)=>h+g,0)}let p=l/t;this.pathTween.getAll().forEach(h=>h.stop()),this.pathTween.removeAll();let f={distance:0},d=this.animationPathOptions.cPathIndex,y=0,_=0;return new Promise(h=>{let g=new re.Tween(f,this.pathTween).to({distance:l},p*1e3).onUpdate(async()=>{let x=f.distance-y;for(;c.length&&x>c[0];)y+=c.shift(),_++,x=f.distance-y;let E=i[_],M=i[_+1];if(!M)return;let C=Ye(E,M,x);if(this.pathStart=C,this.path?.movePath(this.movedDistance+f.distance),this.animationPathOptions.cPathIndex=d+_,this.startPoi){this.startPoi.position.setX(C[0]).setY(C[1]);let G=new it.Vector3(C[0],C[1],0),D=new it.Vector3;D.setFromMatrixColumn(this.bmap.context.camera.matrix,1),D.normalize(),D.multiplyScalar(150/this.bmap.context.camera.zoom),G.add(D),this.bmap.context.setCameraPosition(G,0)}g.pause(),await this.changeCameraToPathUp(200),g.resume(),this.dispatchEvent({type:"path-animation",pathIndex:this.animationPathOptions.cPathIndex})}).onComplete(()=>{this.pathTween.remove(g),this.dispatchEvent({type:"path-animation-end"}),this.movedDistance+=l,h(!0)}).start()})}getPathDirection(){let n=this.cPath.slice(this.animationPathOptions.cPathIndex);if(n.length<3)return null;let t=n[0],e=n[1],i=n[2],r=Ft(t,e,i);if(Math.abs(r)>=179&&Math.abs(r)<=180){let s=new it.Vector3(i[0]-e[0],i[1]-e[1],0).normalize(),a=new it.Vector3(0,1,0).normalize(),u=s.angleTo(a),l=new it.Vector3().crossVectors(a,s);return(Object.is(l.y,0)?-1:1)*u}else return null}async changeCameraToPathUp(n=100){let t=this.getPathDirection();if(t===null)return;let e=this.bmap.context.control.getAzimuthalAngle();Math.abs(e-t)>Math.PI&&(e>0?t=Math.PI*2+t:t=t-Math.PI*2);let i=Math.abs(t-this.bmap.context.control.getAzimuthalAngle());if(i<.01)return;let{control:r}=this.bmap.context,s=n/Math.PI*4*i*10,a=150/this.bmap.context.camera.zoom,u=this.bmap.context.control.getPolarAngle(),l=this.bmap.context.control.maxPolarAngle,c=this.bmap.context.control.minPolarAngle;return this.bmap.context.control.minPolarAngle=this.bmap.context.control.maxPolarAngle=u,new Promise(p=>{let f={azimuthal:r.getAzimuthalAngle()},d={azimuthal:t},y=new re.Tween(f,this.pathTween).to(d,s).onUpdate(async()=>{this.bmap.context.control.target.copy(this.startPoi.position),this.bmap.context.setAzimuthalAngle(f.azimuthal,0);let _=r.target.clone(),h=new it.Vector3;h.setFromMatrixColumn(this.bmap.context.camera.matrix,1),h.normalize(),h.multiplyScalar(a),_.add(h),this.bmap.context.setCameraPosition(_,0)}).onComplete(()=>{r.enabled=!0,this.pathTween.remove(y),this.bmap.context.control.minPolarAngle=c,this.bmap.context.control.maxPolarAngle=l,p(!0)}).onStart(()=>{r.enabled=!1}).start()})}async initNavigationCamera(){await this.translateCameraToStartPoi(300),await this.changeCameraToPathUp(300)}async translateCameraToStartPoi(n=100){if(!this.startPoi)return;let{clientSize:{width:t,height:e},camera:i,control:r}=this.bmap.context,s=Math.round(t/2),a=Math.round(e/2),u=r.target.clone(),l=v(this.startPoi.position,i,t,e),c=l.x-s,p=a-l.y+150;if(console.log(l,c,p,this.startPoi.position,s,a),!(Math.abs(c)<1&&Math.abs(p)<1)){if(Math.abs(c)>=1){let f=new it.Vector3;f.setFromMatrixColumn(i.matrix,0),f.normalize(),f.multiplyScalar(c/i.zoom),u.add(new it.Vector3(f.x,0,0))}if(Math.abs(p)>=1){let f=new it.Vector3;f.setFromMatrixColumn(i.matrix,1),f.normalize(),f.multiplyScalar(p/i.zoom),u.add(new it.Vector3(0,f.y,0))}return this.bmap.context.setCameraPosition(u,n)}}async initCameraZoom(n=100){if(!this.startPoi)return;let{clientSize:{width:t,height:e},currentFloor:i}=this.bmap.context,{max:r,min:s}=i.box,u=Math.min(t/(r.x-s.x),e/(r.y-s.y))*(r.x-s.x)/20;return this.bmap.context.setZoom(u,this.startPoi.position,n)}dispose(){this.worker.terminate(),this.unRegistryEvent(),this.path?.dispose(),this.uniqueKey.dispose(),this.startPoi?.dispose()}};var fn=class extends st{cacheData=new Map;floorDataLengthMap=new Map;async load(n){let t=K(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),ne(n,this.bmap.config)]);console.timeEnd("floor/get\u8BF7\u6C42"+n.resource_type_list);let i=K({floor:n.floor,ts:n.ts});this.bmap.transformGraphicData(e,this.bmap.buildingCenter,this.floorDataLengthMap.get(i)||0),e.forEach(s=>s.info.transformToBuildingGround=!1),this.cacheData.set(t,e);let r=this.floorDataLengthMap.get(i)||0;return this.floorDataLengthMap.set(i,r+e.length),e}isSameFloor(n){return this.bmap.context.currentFloor?.key===K(n)}switchFloorByData(n,t){if(this.isSameFloor(t)){if(!n.length)return;let e=this.bmap.context.currentFloor,i=e.userData.legacyToGraphicMap,r=e.userData.graphicMap,s=[];for(let a of n){if(a.info.group==="ground")e.createGround(a.info);else{let u=e.addGraphic(a.info);u.userData.data=a,i.set(a.legacy_id,u),s.push(u)}r.set(a.element_uuid,a)}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=K(t),{curFloor:i,graphics:r}=this.bmap.createFloor(n);i.name=t.floor,i.key=e;let s=new Map;n.forEach(a=>{s.set(a.element_uuid,a)}),i.userData.graphicMap=s,this.bmap.triggerHooks("switch_floor_before",{curFloor:i,graphics:r}),this.bmap.context.switchFloor(i),this.bmap.initialFloorCamera(),this.bmap.triggerHooks("switch_floor_after",{curFloor:i,graphics:r})}}filterData(n,t){if(!this.isSameFloor(t))return n;let e=this.bmap.context.currentFloor.userData.graphicMap;return n.filter(i=>!e.has(i.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=K({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())}};var mi=require("three"),dn=class extends st{poiLayer;floors=[];group=new mi.Group;constructor(n){super(n),this.poiLayer=new bt(n.context)}show(n){let t=n[0].userData.height;n.forEach(r=>{r.poiLayer.pois.forEach(s=>{this.poiLayer.pushPoi(s)}),r.poiLayer.pois.length=0,r.poiLayer.dispose(),r.position.z=t,t+=r.userData.height});let{scene:e,currentFloor:i}=this.bmap.context;i&&(e.remove(i),i.dispose()),this.group.add(this.poiLayer,...n),e.add(this.group),this.floors=n,this.bmap.context.cameraBound.updateBox()}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 i=n.camera.zoom;n.control.minZoom=i,n.control.maxZoom=i*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 rt;function yi(o="aibee_map"){return new Promise((n,t)=>{if(rt)return n({db:rt,type:"success"});let e=indexedDB.open(o);e.onupgradeneeded=function(i){rt=i.target.result,console.log("onupgradeneeded"),n({db:rt,type:"onupgradeneeded"})},e.onsuccess=i=>{rt=i.target.result,n({db:rt,type:"success"})},e.onerror=i=>{t(i)}})}function _i(o,n,t=rt){return new Promise((e,i)=>{t||i("\u6CA1\u6709db");let s=t.transaction([o],"readonly").objectStore(o).get(n);s.onsuccess=()=>{s.result?e(s.result.value):e(null)},s.onerror=a=>{console.log("[getVersionByKey]",a),e(null)}})}function vi(o,n,t,e=rt){return new Promise((i,r)=>(e||r("\u6CA1\u6709db"),new Promise((s,a)=>{let l=e.transaction([o],"readwrite").objectStore(o).add({key:n,value:t});l.onsuccess=function(c){s(c)},l.onerror=function(c){a(c)}})))}function Me(o,n=rt){n&&(n.objectStoreNames.contains(o)||n.createObjectStore(o,{keyPath:"key"}))}function xi(){rt?.close(),rt=null}function at(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(i=>{Array.isArray(i)&&i.forEach(r=>{r[0]-=n[0],r[1]-=n[1]})}),e.geometry.otherCds&&(e.geometry.otherCoords=e.geometry.otherCds.map(i=>i.map(r=>gt(r,n))))):e.geometry.coords=gt(e.geometry.cds,n)});for(let e=0;e<o.length;e++){let i=o[e];i.deltaHeight=1e-5*(t+e+1)}}function gt(o,n){return[o[0]-n[0],o[1]-n[1]]}var Ei='data:image/svg+xml,<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1722508608758" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1737" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M671.672075 807.841824l-12.086033-1.711297-5.561715 10.695605a235.303309 235.303309 0 1 1-328.889852-310.172544l8.128659-4.813022v-9.519089c0.855648-28.236397-13.369506-48.45109-38.183309-54.226717l-6.738232-1.497385-5.989538 3.52955a314.450786 314.450786 0 1 0 438.519803 419.695539l3.850418-6.952143-2.887813-7.807792a60.216256 60.216256 0 0 0-50.162388-37.220705z" fill="%23ffffff" p-id="1738"></path><path d="M893.498922 805.167922c-2.994769-21.39121-16.578188-37.541573-30.268562-35.616364l-70.911861 9.839956-57.64931-189.633075a10.695605 10.695605 0 0 1 0-1.069561 37.969398 37.969398 0 0 0-35.830277-25.99032H435.620074V414.029649h157.760173v-78.826609H435.620074v-50.162387a39.466782 39.466782 0 1 0-78.826609 0v305.787346a44.065892 44.065892 0 0 0-1.711297 11.337341 39.680694 39.680694 0 0 0 17.540793 33.156376A37.755486 37.755486 0 0 0 407.918457 641.846035h260.117113l61.71364 203.216494a30.268562 30.268562 0 0 0 28.98509 19.145133h0.855648a48.985871 48.985871 0 0 0 16.364276-2.139121h0.641736l97.330005-13.369506c13.79733-2.887813 22.567726-21.92599 19.572957-43.531113zM406.955852 197.229736a98.613478 98.613478 0 1 0-98.506521-98.506521 98.506522 98.506522 0 0 0 98.506521 98.506521z" fill="%23ffffff" p-id="1739"></path></svg>';var bi='data:image/svg+xml,<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1722508633972" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3840" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M568 171.84v285.312h144.64a12.8 12.8 0 0 1 10.816 19.648l-243.84 382.208a12.8 12.8 0 0 1-23.616-6.848V566.848h-144.64a12.8 12.8 0 0 1-10.816-19.648l243.84-382.208a12.8 12.8 0 0 1 23.616 6.848z" fill="%23ffffff" fill-opacity=".88" p-id="3841"></path></svg>';var Mi='data:image/svg+xml,<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1722508689425" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9597" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M354.1 768.4l-63.1-7.1v24.1c0 0.3 0 0.6 0.1 0.9h63.1c0.1-0.3 0.1-0.6 0.1-0.9v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><path d="M354.3 769.6v15.9c0 0.3 0 0.6-0.1 0.9h-63.1c-0.1-0.3-0.1-0.6-0.1-0.9V762v-0.6l63.1 7.1c0.1 0.3 0.2 0.7 0.2 1.1zM729.7 761.9v23.5c0 0.3 0 0.6-0.1 0.9h-63.1c-0.1-0.3-0.1-0.6-0.1-0.9v-15.9c0-0.4 0.1-0.8 0.2-1.1l63.1-7.1v0.6z" p-id="9600" fill="%23ffffff"></path><path d="M729.7 761.9v23.5c0 0.3 0 0.6-0.1 0.9h-63.1c-0.1-0.3-0.1-0.6-0.1-0.9v-15.9c0-0.4 0.1-0.8 0.2-1.1l63.1-7.1v0.6zM158.3 132.8h50.6v38h-50.6zM253.8 132.8h50.6v38h-50.6zM353.8 132.8h50.6v38h-50.6zM441.3 132.8h139.2v38H441.3zM614.8 132.8h50.6v38h-50.6zM711.6 132.8h50.6v38h-50.6zM809.1 132.8h50.6v38h-50.6z" p-id="9601" fill="%23ffffff"></path><path d="M158.3 132.8h50.6v38h-50.6zM253.8 132.8h50.6v38h-50.6zM353.8 132.8h50.6v38h-50.6zM441.3 132.8h139.2v38H441.3zM614.8 132.8h50.6v38h-50.6zM711.6 132.8h50.6v38h-50.6zM809.1 132.8h50.6v38h-50.6z" p-id="9602" fill="%23ffffff"></path><path d="M967.6 202.4V101.2c0-24.4-19.8-44.3-44.3-44.3H100.7c-24.5 0-44.3 19.8-44.3 44.3v101.3c0 24 19.2 43.6 43 44.3v673.8h-24c-10.5 0-19 8.5-19 19s8.5 19 19 19h873.2c10.5 0 19-8.5 19-19s-8.5-19-19-19h-22.8v-674c23.3-1.3 41.8-20.6 41.8-44.2z m-873.2 0V101.2c0-3.5 2.8-6.3 6.3-6.3h822.6c3.5 0.1 6.3 2.9 6.3 6.3v101.3c0 3.5-2.8 6.3-6.3 6.3H100.7c-3.4-0.1-6.3-3-6.3-6.4zM253 785.5V762c0-11.9 4.9-23 13.5-30.4 7.5-6.6 17.5-9.5 27.4-8.1l66.7 7.5c18.3 2.8 31.6 19.3 31.6 38.6v15.9c0 21.4-16.1 38.9-35.9 38.9H289c-19.9-0.1-36-17.5-36-38.9z m60.3 116c0 10.5-8.5 19-19 19s-19-8.5-19-19V884l38 0.2v17.3z m34.5 19c2.1-6 3.5-12.3 3.5-19v-17.1l159.7 0.8h0.2l155.2-0.8v17.1c0 6.7 1.4 13 3.5 19H347.8z m394.5-19c0 10.5-8.5 19-19 19s-19-8.5-19-19v-17.3l38-0.2v17.5z m25.3-116.1c0 21.4-16.1 38.9-35.9 38.9h-67.3c-19.8 0-35.9-17.4-35.9-38.9v-15.9c0-19.3 13.3-35.8 30.9-38.5l68.1-7.7c9.1-1.4 19 1.6 26.7 8.2 8.6 7.4 13.5 18.5 13.5 30.4v23.5zM611.1 661.7c4.1-12.8 15.9-22.1 30-22.1s26 9.4 30 22.1h-60z m98.8-0.2c-4.7-33.8-33.8-59.9-68.8-59.9-35.1 0-64.2 26.2-68.9 60.1H315.9c-27 0-45.6-10.5-63.7-26.7 2.9-7.8 5.7-15.4 8.2-22.2 3.7-10 6.7-18.2 8.3-22.7 0.9-2.6 1.7-5.2 2.2-7.8l27.9-75.6c20.8-54.4 74.5-55.6 76.7-55.7h270c0.6 0 55.3 0.6 77.9 55.4l27.9 75.8c0.6 2.7 1.3 5.2 2.2 7.8l8.3 22.6c2.4 6.4 5.1 13.9 7.9 21.6-19.7 16.3-35.4 26.3-59.8 27.3z m178 259H776.8c2.1-6 3.5-12.3 3.5-19v-17.7h2c15.1 0.1 29.6-5.8 40.3-16.5 11.3-11.2 17.6-26.4 17.5-42.3v-83.2c0-17.6-13.8-62.2-13.9-62.7-2.7-8.4-15.1-42.4-28.8-79.5l-8.2-22.4c-0.4-1.1-0.7-2.3-0.9-3.5-0.2-1.1-0.5-2.1-0.9-3.1l-28.7-77.9c-32.3-78.7-110-79.6-113.2-79.6h-270c-3.3 0-81.9 0.9-112.2 80.3l-28.4 77.2c-0.4 1-0.7 2.1-0.9 3.1-0.2 1.2-0.5 2.3-0.9 3.5-1.6 4.4-4.6 12.6-8.3 22.5-10.6 28.8-25.2 68.1-28.7 79.5-0.2 0.4-13.9 44.9-13.9 62.6V825c-0.1 15.9 6.2 31.1 17.5 42.3 10.3 10.2 23.9 15.6 37.8 16.3v17.9c0 6.7 1.4 13 3.5 19H137.4V246.7h750.5v673.8z" p-id="9603" fill="%23ffffff"></path><path d="M441.3 132.8h139.2v38H441.3zM353.8 132.8h50.6v38h-50.6zM253.8 132.8h50.6v38h-50.6zM158.3 132.8h50.6v38h-50.6zM809.1 132.8h50.6v38h-50.6zM711.6 132.8h50.6v38h-50.6zM614.8 132.8h50.6v38h-50.6z" p-id="9604" fill="%23ffffff"></path></svg>';var sr={loadRoadNetwork:!1},Se="version",gn="map_data",we="road_network_data",Si={half:Ei,power:bi,mechanical:Mi},mn=class{constructor(n){this.bmap=n;this.initDb()}floors=[];async initDb(){try{let{db:n,type:t}=await yi();t==="onupgradeneeded"&&(Me(Se),Me(gn),Me(we))}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 vi(n,`${t}`,e)}getCacheData(n,t){return _i(n,`${t}`)}getFloorCacheKey(n){return`${n.floor_id}`}async getFloorData(n){let t=this.floors.find(i=>i.floor===n);if(!t)return null;let e=this.getFloorCacheKey(t);try{if(await this.getCacheData(Se,e)===t.version_id){let r=await this.getCacheData(gn,e);if(r)return this.getDataByJson(r)}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(i=>i.json());return e.floor=n.floor,console.timeEnd("zstd_json"),this.setCacheData(gn,t,e),this.setCacheData(Se,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(Se,e)===t.version_id){let s=await this.getCacheData(we,e);if(s)return s}let r=await fetch(t.route_url).then(s=>s.json());return this.setCacheData(we,e,r),r}catch{let i=await fetch(t.route_url).then(r=>r.json());return this.setCacheData(we,e,i),i}}))).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 ct(this.bmap.context),e=[0,0];return n.layers.forEach(i=>{switch(i.l_type){case"range":let r=i.elements[0];e=[r.center_x,r.center_y];break;case"graph":let s=[],a=new Map;at(i.elements,e);let u=[];i.elements.forEach(h=>{if(h.group==="ground")t.createGround(h);else if(h.canMerge)u.push(h);else{let g=t.addGraphic(h);s.push(g),a.set(h.id,g)}}),t.userData.graphics=s,t.userData.graphicMap=a;let l=u.reduce((h,g)=>{let{fillColor:x,fillOpacity:E,strokeColor:M,strokeOpacity:C,height:G}=g,D=`${x}-${E}-${M}-${C}-${G}`;return h[D]?h[D].push(g):h[D]=[g],h},{});Object.values(l).forEach(h=>{let g=new Jt(this.bmap.context,h);t.mergeGraphicLayer.add(g)});break;case"ground":at(i.elements,e);let c=i.elements.map(h=>new U(this.bmap.context,h));t.addGrounds(c);break;case"wall":at(i.elements,e);let p=i.elements.reduce((h,g)=>{let{fillColor:x,fillOpacity:E,strokeColor:M,strokeOpacity:C,height:G}=g,D=`${x}-${E}-${M}-${C}-${G}`;return h[D]?h[D].push(g):h[D]=[g],h},{});Object.values(p).forEach(h=>{let g=new $t(this.bmap.context,h);t.wallLayer.add(g)});break;case"lane":at(i.elements,e);let f=i.elements.reduce((h,g)=>{let{fillColor:x,fillOpacity:E,strokeColor:M,strokeOpacity:C}=g,G=`${x}-${E}-${M}-${C}`;return h[G]?h[G].push(g):h[G]=[g],h},{});Object.values(f).forEach(h=>{let g=new Zt(this.bmap.context,h);t.laneLayer.add(g)});break;case"texture2d":case"texture3d":if(at(i.elements,e),i.elements.length){let h=new Rt(this.bmap.context,i.elements);t.textureLayer.add(h)}break;case"glb":at(i.elements,e),i.elements.forEach(h=>{let g=gt([h.center_x,h.center_y],e),x=new Kt(this.bmap.context,{...h,url:h.secondUrl,rotate:h.secondRotate,width:h.secondWidth,center_x:g[0],center_y:g[1]});t.glbModelLayer.add(x)});break;case"store":at(i.elements,e),i.elements.map(h=>{let g=gt([h.center_x,h.center_y],e),x=t.addGraphic(h);t.userData.graphics.push(x),t.userData.graphicMap.set(h.id,x);let E=new V(this.bmap.context,{id:h.id,icon:h.poi_info.icon,text:h.poi_info.showName||h.store_name||h.poi_info.text,position:{x:g[0],y:g[1],z:h.airHeight+h.height},icon_size:[18,18]});t.poiLayer2.pushPoi(E),E&&(E.userData.type="store",E.userData.data=h)});break;case"facility":at(i.elements,e),i.elements.map(h=>{let g=gt(h.geometry.cds,e),x=t.addGraphic(h);if(t.userData.graphics.push(x),t.userData.graphicMap.set(h.id,x),h.poi_info){let E=new V(this.bmap.context,{id:h.id,icon:h.poi_info.icon,text:h.poi_info.showName||h.store_name||h.poi_info.text,position:{x:g[0],y:g[1],z:h.airHeight+h.height},icon_size:[18,18]});t.poiLayer2.pushPoi(E),E.userData.type="facility",E.userData.data=h}});break;case"parkingSpace":at(i.elements,e);let d=[],y=new Map;i.elements.forEach(h=>{let g=t.addGraphic(h);d.push(g),y.set(h.id,g);let x=gt([h.center_x,h.center_y],e);if(h.texts[0]){let E=new V(this.bmap.context,{id:h.id,text:h.texts[0],position:{x:x[0],y:x[1],z:h.airHeight+h.height}});E&&(E.userData.type="parkingSpace",E.userData.data=h),t.poiLayer2.pushPoi(E)}});let _=i.elements.filter(h=>Si[h.parkingType]).map(h=>{let g=gt([h.center_x,h.center_y],e),x=Ge(h.geometry.coords,g);return{uuid:h.id,iconUrl:Si[h.parkingType],name:h.texts[0],deltaHeight:h.deltaHeight,airHeight:h.airHeight,height:h.height,geometry:{...h.geometry,coords:x},opacity:h.fillOpacity,visible:!0}});if(_.length){let h=new Rt(this.bmap.context,_);t.textureLayer.add(h)}t.userData.parkingSpaces=d,t.userData.parkingSpacesGraphicMap=y;break}}),t.userData.center=e,t.userData.height=n.floorHeight,t.name=n.floor,t.userData.data=n,t.updateBox(),t}clear(){}dispose(){this.clear(),xi()}};
|
|
3778
|
+
`);var ie=class extends m.ShaderMaterial{constructor(n){super({uniforms:Object.assign({},m.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new m.Color(16777215)},opacity:{value:1},resolution:{value:new m.Vector2(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 m.Vector2(1,1)},thresholdRatio:{value:0},transparent:{value:!0},depthTest:{vale:!1},depthWrite:{value:!1}}),vertexShader:m.ShaderChunk.meshline_vert,fragmentShader:m.ShaderChunk.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)}},thresholdRatio:{enumerable:!0,get:function(){return this.uniforms.thresholdRatio.value},set:function(t){this.uniforms.thresholdRatio.value=t}}}),this.setValues(n)}};ie.prototype.copy=function(o){return m.ShaderMaterial.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 di="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 gi={texture_url:di,lineWidth:8,color:16777215},be=class extends N.Object3D{constructor(t,e){super();this.navigation=t;this.config=Object.assign({},gi,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}mesh=null;geometry=null;material=null;texture=null;config=gi;points=[];pathDistance=0;basicRepeat=1;prevCameraZoom=0;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=()=>{let t=this.navigation.bmap.context.camera.zoom;t!==this.prevCameraZoom&&(this.prevCameraZoom=t,this.changeRepeat())};onUpdate=()=>{this.texture};getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:i,height:r}}}}}=this,s=t.map(([u,l])=>v(new N.Vector3(u,l,0),e,i,r)).map(({x:u,y:l})=>[u,l]);return lt(s)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new N.Vector2(t,1)}loadTexture(t){return new Promise((e,i)=>{new N.TextureLoader().load(t,e,void 0,i)})}transformPoints(t){let e=[];for(let i=0;i<t.length;i++)e.push(...t[i],0);return e}updatePoints(t){this.points=t,this.pathDistance=lt(t),this.changeRepeat();let e=this.transformPoints(t);this.geometry&&this.geometry.setPoints(e)}movePath(t){if(!this.material||!this.pathDistance)return;let e=t/this.pathDistance;this.material.thresholdRatio=e}async create(t){let e=this.geometry=new X;if(this.updatePoints(t),!this.texture){let s=this.texture=await this.loadTexture(this.config.texture_url);s.wrapS=s.wrapT=N.RepeatWrapping}let i=this.material=new ie({useMap:!0,color:new N.Color(this.config.color),transparent:!0,resolution:new N.Vector2(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:N.NormalBlending,repeat:new N.Vector2(this.getRepeat(),1)}),r=this.mesh=new N.Mesh(e,i);return r.renderOrder=9,this.add(r),r}dispose(){this.unRegistryEvent(),this.clear(),this.geometry?.dispose(),this.material?.dispose(),this.texture?.dispose()}};var re=require("@tweenjs/tween.js"),it=require("three"),nr={path:{},speed:10,cheapMaximumDistance:20,needStartPoi:!1,startPoi:{},loadRoad:!0,roadNetwork:"RoadNetwork"},pn=class extends st{path=null;worker=cn();fetchRoadStatus=!1;uniqueKey=new xt;paths=[];options;pathTween=new re.Group;startPoi=null;movedDistance=0;pathStart=[0,0];animationPathOptions={cPathIndex:0};cPath=[];constructor(n,t,e={}){super(n),this.options=Object.assign({},nr,e);let{apiDomain:i,apiPath:{roadNetwork:r},apiInfo:s}=this.bmap.config;this.registryEvent(),this.options.loadRoad&&Et(this.worker,"load_road",{url:`${i||location.origin}${r}?project=${t}`,...s}).then(a=>{this.fetchRoadStatus=!0,this.dispatchEvent({type:"fetch-road-status",status:!0}),this.dispatchEvent({type:"fetch-road-data",roadInfo:a})}).catch(a=>{console.log("[\u52A0\u8F7D\u8DEF\u7F51\u5931\u8D25]",a)}),this.options.roadNetwork!=="RoadNetwork"&&Et(this.worker,"change_road_network",this.options.roadNetwork)}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 Et(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()),this.startPoi&&(this.bmap.context.currentFloor?.poiLayer2.removePoi(this.startPoi),this.startPoi=null)}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 Et(this.worker,"get_direction_path",n)}addPath(n){this.paths=n;let t=this.bmap.context.currentFloor?.name,e=n.find(i=>i.floor===t);if(e)if(this.bmap.currentBuildGround)this.renderPath(this.translatePoints(e.points));else{let i=()=>{this.bmap.removeEventListener("center-change",i),this.renderPath(this.translatePoints(e.points))};this.bmap.addEventListener("center-change",i)}else this.clearPath()}translatePoints(n){let[t,e]=this.bmap.buildingCenter;return n.map(i=>[i[0]-t,i[1]-e])}getPath(n,t,e=""){return new Promise((i,r)=>{let s=()=>{Et(this.worker,"get_path",{start:n,end:t,type:e}).then(a=>{a?typeof a=="string"?r(a):i(a):r("no-path")})};if(this.fetchRoadStatus)s();else{let a=({status:u})=>{u&&(this.removeEventListener("fetch-road-status",a),s())};this.addEventListener("fetch-road-status",a)}})}renderPath(n){let t=this.catmullRomCurve3(n);this.cPath=t,this.animationPathOptions={cPathIndex:0},this.movedDistance=0,this.pathStart=t[0],this.path?this.path.updatePoints(t):(this.path=new be(this,this.options.path),this.path.create(t),this.path.position.z=this.bmap.context.currentFloor.groundMaxHeight+.5,this.bmap.context.scene.add(this.path)),this.startPoi&&(this.bmap.context.currentFloor?.poiLayer2.removePoi(this.startPoi),this.startPoi=null),this.options.needStartPoi&&(this.startPoi=new V(this.bmap.context,{...this.options.startPoi,id:"navigation_start_poi",position:{x:t[0][0],y:t[0][1],z:1e-4},collision_enable:!1})||null,this.bmap.context.currentFloor?.poiLayer2.pushPoi(this.startPoi))}catmullRomCurve3(n){return qe(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,i=[this.pathStart,...this.cPath.slice(e+1)],r=this.translatePoints([n.pos])[0],{distance:s,pos:a,index:u}=i.reduce((h,g,x,E)=>{if(x===E.length-1)return h;let{distance:M,closestPoint:C}=je(r,g,E[x+1]);return M<h.distance&&(h.distance=M,h.pos=C,h.index=x),h},{distance:Number.MAX_SAFE_INTEGER,pos:n.pos,index:0});if(s>this.options.cheapMaximumDistance||this.path.points[0][0]===a[0]&&this.path.points[0][1]===a[1])return;let l=0,c=[];if(u===0)l=L(i[0],a),c=[l];else{c=[L(i[0],i[1])];for(let h=1;h<u;h++)c.push(L(i[h],i[h+1]));c.push(L(i[u],a)),l=c.reduce((h,g)=>h+g,0)}let p=l/t;this.pathTween.getAll().forEach(h=>h.stop()),this.pathTween.removeAll();let f={distance:0},d=this.animationPathOptions.cPathIndex,y=0,_=0;return new Promise(h=>{let g=new re.Tween(f,this.pathTween).to({distance:l},p*1e3).onUpdate(async()=>{let x=f.distance-y;for(;c.length&&x>c[0];)y+=c.shift(),_++,x=f.distance-y;let E=i[_],M=i[_+1];if(!M)return;let C=Ye(E,M,x);if(this.pathStart=C,this.path?.movePath(this.movedDistance+f.distance),this.animationPathOptions.cPathIndex=d+_,this.startPoi){this.startPoi.position.setX(C[0]).setY(C[1]);let G=new it.Vector3(C[0],C[1],0),D=new it.Vector3;D.setFromMatrixColumn(this.bmap.context.camera.matrix,1),D.normalize(),D.multiplyScalar(150/this.bmap.context.camera.zoom),G.add(D),this.bmap.context.setCameraPosition(G,0)}g.pause(),await this.changeCameraToPathUp(200),g.resume(),this.dispatchEvent({type:"path-animation",pathIndex:this.animationPathOptions.cPathIndex})}).onComplete(()=>{this.pathTween.remove(g),this.dispatchEvent({type:"path-animation-end"}),this.movedDistance+=l,h(!0)}).start()})}getPathDirection(){let n=this.cPath.slice(this.animationPathOptions.cPathIndex);if(n.length<3)return null;let t=n[0],e=n[1],i=n[2],r=Ft(t,e,i);if(Math.abs(r)>=179&&Math.abs(r)<=180){let s=new it.Vector3(i[0]-e[0],i[1]-e[1],0).normalize(),a=new it.Vector3(0,1,0).normalize(),u=s.angleTo(a),l=new it.Vector3().crossVectors(a,s);return(Object.is(l.y,0)?-1:1)*u}else return null}async changeCameraToPathUp(n=100){let t=this.getPathDirection();if(t===null)return;let e=this.bmap.context.control.getAzimuthalAngle();Math.abs(e-t)>Math.PI&&(e>0?t=Math.PI*2+t:t=t-Math.PI*2);let i=Math.abs(t-this.bmap.context.control.getAzimuthalAngle());if(i<.01)return;let{control:r}=this.bmap.context,s=n/Math.PI*4*i,a=150/this.bmap.context.camera.zoom,u=this.bmap.context.control.getPolarAngle(),l=this.bmap.context.control.maxPolarAngle,c=this.bmap.context.control.minPolarAngle;return this.bmap.context.control.minPolarAngle=this.bmap.context.control.maxPolarAngle=u,new Promise(p=>{let f={azimuthal:r.getAzimuthalAngle()},d={azimuthal:t},y=new re.Tween(f,this.pathTween).to(d,s).onUpdate(async()=>{this.bmap.context.control.target.copy(this.startPoi.position),this.bmap.context.setAzimuthalAngle(f.azimuthal,0);let _=r.target.clone(),h=new it.Vector3;h.setFromMatrixColumn(this.bmap.context.camera.matrix,1),h.normalize(),h.multiplyScalar(a),_.add(h),this.bmap.context.setCameraPosition(_,0)}).onComplete(()=>{r.enabled=!0,this.pathTween.remove(y),this.bmap.context.control.minPolarAngle=c,this.bmap.context.control.maxPolarAngle=l,p(!0)}).onStart(()=>{r.enabled=!1}).start()})}async initNavigationCamera(){await this.translateCameraToStartPoi(300),await this.changeCameraToPathUp(300)}async translateCameraToStartPoi(n=100){if(!this.startPoi)return;let{clientSize:{width:t,height:e},camera:i,control:r}=this.bmap.context,s=Math.round(t/2),a=Math.round(e/2),u=r.target.clone(),l=v(this.startPoi.position,i,t,e),c=l.x-s,p=a-l.y+150;if(console.log(l,c,p,this.startPoi.position,s,a),!(Math.abs(c)<1&&Math.abs(p)<1)){if(Math.abs(c)>=1){let f=new it.Vector3;f.setFromMatrixColumn(i.matrix,0),f.normalize(),f.multiplyScalar(c/i.zoom),u.add(new it.Vector3(f.x,0,0))}if(Math.abs(p)>=1){let f=new it.Vector3;f.setFromMatrixColumn(i.matrix,1),f.normalize(),f.multiplyScalar(p/i.zoom),u.add(new it.Vector3(0,f.y,0))}return this.bmap.context.setCameraPosition(u,n)}}async initCameraZoom(n=100){if(!this.startPoi)return;let{clientSize:{width:t,height:e},currentFloor:i}=this.bmap.context,{max:r,min:s}=i.box,u=Math.min(t/(r.x-s.x),e/(r.y-s.y))*(r.x-s.x)/20;return this.bmap.context.setZoom(u,this.startPoi.position,n)}dispose(){this.worker.terminate(),this.unRegistryEvent(),this.path?.dispose(),this.uniqueKey.dispose(),this.startPoi?.dispose()}};var fn=class extends st{cacheData=new Map;floorDataLengthMap=new Map;async load(n){let t=K(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),ne(n,this.bmap.config)]);console.timeEnd("floor/get\u8BF7\u6C42"+n.resource_type_list);let i=K({floor:n.floor,ts:n.ts});this.bmap.transformGraphicData(e,this.bmap.buildingCenter,this.floorDataLengthMap.get(i)||0),e.forEach(s=>s.info.transformToBuildingGround=!1),this.cacheData.set(t,e);let r=this.floorDataLengthMap.get(i)||0;return this.floorDataLengthMap.set(i,r+e.length),e}isSameFloor(n){return this.bmap.context.currentFloor?.key===K(n)}switchFloorByData(n,t){if(this.isSameFloor(t)){if(!n.length)return;let e=this.bmap.context.currentFloor,i=e.userData.legacyToGraphicMap,r=e.userData.graphicMap,s=[];for(let a of n){if(a.info.group==="ground")e.createGround(a.info);else{let u=e.addGraphic(a.info);u.userData.data=a,i.set(a.legacy_id,u),s.push(u)}r.set(a.element_uuid,a)}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=K(t),{curFloor:i,graphics:r}=this.bmap.createFloor(n);i.name=t.floor,i.key=e;let s=new Map;n.forEach(a=>{s.set(a.element_uuid,a)}),i.userData.graphicMap=s,this.bmap.triggerHooks("switch_floor_before",{curFloor:i,graphics:r}),this.bmap.context.switchFloor(i),this.bmap.initialFloorCamera(),this.bmap.triggerHooks("switch_floor_after",{curFloor:i,graphics:r})}}filterData(n,t){if(!this.isSameFloor(t))return n;let e=this.bmap.context.currentFloor.userData.graphicMap;return n.filter(i=>!e.has(i.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=K({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())}};var mi=require("three"),dn=class extends st{poiLayer;floors=[];group=new mi.Group;constructor(n){super(n),this.poiLayer=new bt(n.context)}show(n){let t=n[0].userData.height;n.forEach(r=>{r.poiLayer.pois.forEach(s=>{this.poiLayer.pushPoi(s)}),r.poiLayer.pois.length=0,r.poiLayer.dispose(),r.position.z=t,t+=r.userData.height});let{scene:e,currentFloor:i}=this.bmap.context;i&&(e.remove(i),i.dispose()),this.group.add(this.poiLayer,...n),e.add(this.group),this.floors=n,this.bmap.context.cameraBound.updateBox()}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 i=n.camera.zoom;n.control.minZoom=i,n.control.maxZoom=i*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 rt;function yi(o="aibee_map"){return new Promise((n,t)=>{if(rt)return n({db:rt,type:"success"});let e=indexedDB.open(o);e.onupgradeneeded=function(i){rt=i.target.result,console.log("onupgradeneeded"),n({db:rt,type:"onupgradeneeded"})},e.onsuccess=i=>{rt=i.target.result,n({db:rt,type:"success"})},e.onerror=i=>{t(i)}})}function _i(o,n,t=rt){return new Promise((e,i)=>{t||i("\u6CA1\u6709db");let s=t.transaction([o],"readonly").objectStore(o).get(n);s.onsuccess=()=>{s.result?e(s.result.value):e(null)},s.onerror=a=>{console.log("[getVersionByKey]",a),e(null)}})}function vi(o,n,t,e=rt){return new Promise((i,r)=>(e||r("\u6CA1\u6709db"),new Promise((s,a)=>{let l=e.transaction([o],"readwrite").objectStore(o).add({key:n,value:t});l.onsuccess=function(c){s(c)},l.onerror=function(c){a(c)}})))}function Me(o,n=rt){n&&(n.objectStoreNames.contains(o)||n.createObjectStore(o,{keyPath:"key"}))}function xi(){rt?.close(),rt=null}function at(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(i=>{Array.isArray(i)&&i.forEach(r=>{r[0]-=n[0],r[1]-=n[1]})}),e.geometry.otherCds&&(e.geometry.otherCoords=e.geometry.otherCds.map(i=>i.map(r=>gt(r,n))))):e.geometry.coords=gt(e.geometry.cds,n)});for(let e=0;e<o.length;e++){let i=o[e];i.deltaHeight=1e-5*(t+e+1)}}function gt(o,n){return[o[0]-n[0],o[1]-n[1]]}var Ei='data:image/svg+xml,<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1722508608758" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1737" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M671.672075 807.841824l-12.086033-1.711297-5.561715 10.695605a235.303309 235.303309 0 1 1-328.889852-310.172544l8.128659-4.813022v-9.519089c0.855648-28.236397-13.369506-48.45109-38.183309-54.226717l-6.738232-1.497385-5.989538 3.52955a314.450786 314.450786 0 1 0 438.519803 419.695539l3.850418-6.952143-2.887813-7.807792a60.216256 60.216256 0 0 0-50.162388-37.220705z" fill="%23ffffff" p-id="1738"></path><path d="M893.498922 805.167922c-2.994769-21.39121-16.578188-37.541573-30.268562-35.616364l-70.911861 9.839956-57.64931-189.633075a10.695605 10.695605 0 0 1 0-1.069561 37.969398 37.969398 0 0 0-35.830277-25.99032H435.620074V414.029649h157.760173v-78.826609H435.620074v-50.162387a39.466782 39.466782 0 1 0-78.826609 0v305.787346a44.065892 44.065892 0 0 0-1.711297 11.337341 39.680694 39.680694 0 0 0 17.540793 33.156376A37.755486 37.755486 0 0 0 407.918457 641.846035h260.117113l61.71364 203.216494a30.268562 30.268562 0 0 0 28.98509 19.145133h0.855648a48.985871 48.985871 0 0 0 16.364276-2.139121h0.641736l97.330005-13.369506c13.79733-2.887813 22.567726-21.92599 19.572957-43.531113zM406.955852 197.229736a98.613478 98.613478 0 1 0-98.506521-98.506521 98.506522 98.506522 0 0 0 98.506521 98.506521z" fill="%23ffffff" p-id="1739"></path></svg>';var bi='data:image/svg+xml,<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1722508633972" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3840" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M568 171.84v285.312h144.64a12.8 12.8 0 0 1 10.816 19.648l-243.84 382.208a12.8 12.8 0 0 1-23.616-6.848V566.848h-144.64a12.8 12.8 0 0 1-10.816-19.648l243.84-382.208a12.8 12.8 0 0 1 23.616 6.848z" fill="%23ffffff" fill-opacity=".88" p-id="3841"></path></svg>';var Mi='data:image/svg+xml,<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1722508689425" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9597" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M354.1 768.4l-63.1-7.1v24.1c0 0.3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.1 0.3 0.2 0.7 0.2 1.1z" p-id="9599" fill="%23ffffff"></path><path d="M354.3 769.6v15.9c0 0.3 0 0.6-0.1 0.9h-63.1c-0.1-0.3-0.1-0.6-0.1-0.9V762v-0.6l63.1 7.1c0.1 0.3 0.2 0.7 0.2 1.1zM729.7 761.9v23.5c0 0.3 0 0.6-0.1 0.9h-63.1c-0.1-0.3-0.1-0.6-0.1-0.9v-15.9c0-0.4 0.1-0.8 0.2-1.1l63.1-7.1v0.6z" p-id="9600" fill="%23ffffff"></path><path d="M729.7 761.9v23.5c0 0.3 0 0.6-0.1 0.9h-63.1c-0.1-0.3-0.1-0.6-0.1-0.9v-15.9c0-0.4 0.1-0.8 0.2-1.1l63.1-7.1v0.6zM158.3 132.8h50.6v38h-50.6zM253.8 132.8h50.6v38h-50.6zM353.8 132.8h50.6v38h-50.6zM441.3 132.8h139.2v38H441.3zM614.8 132.8h50.6v38h-50.6zM711.6 132.8h50.6v38h-50.6zM809.1 132.8h50.6v38h-50.6z" p-id="9601" fill="%23ffffff"></path><path d="M158.3 132.8h50.6v38h-50.6zM253.8 132.8h50.6v38h-50.6zM353.8 132.8h50.6v38h-50.6zM441.3 132.8h139.2v38H441.3zM614.8 132.8h50.6v38h-50.6zM711.6 132.8h50.6v38h-50.6zM809.1 132.8h50.6v38h-50.6z" p-id="9602" fill="%23ffffff"></path><path d="M967.6 202.4V101.2c0-24.4-19.8-44.3-44.3-44.3H100.7c-24.5 0-44.3 19.8-44.3 44.3v101.3c0 24 19.2 43.6 43 44.3v673.8h-24c-10.5 0-19 8.5-19 19s8.5 19 19 19h873.2c10.5 0 19-8.5 19-19s-8.5-19-19-19h-22.8v-674c23.3-1.3 41.8-20.6 41.8-44.2z m-873.2 0V101.2c0-3.5 2.8-6.3 6.3-6.3h822.6c3.5 0.1 6.3 2.9 6.3 6.3v101.3c0 3.5-2.8 6.3-6.3 6.3H100.7c-3.4-0.1-6.3-3-6.3-6.4zM253 785.5V762c0-11.9 4.9-23 13.5-30.4 7.5-6.6 17.5-9.5 27.4-8.1l66.7 7.5c18.3 2.8 31.6 19.3 31.6 38.6v15.9c0 21.4-16.1 38.9-35.9 38.9H289c-19.9-0.1-36-17.5-36-38.9z m60.3 116c0 10.5-8.5 19-19 19s-19-8.5-19-19V884l38 0.2v17.3z m34.5 19c2.1-6 3.5-12.3 3.5-19v-17.1l159.7 0.8h0.2l155.2-0.8v17.1c0 6.7 1.4 13 3.5 19H347.8z m394.5-19c0 10.5-8.5 19-19 19s-19-8.5-19-19v-17.3l38-0.2v17.5z m25.3-116.1c0 21.4-16.1 38.9-35.9 38.9h-67.3c-19.8 0-35.9-17.4-35.9-38.9v-15.9c0-19.3 13.3-35.8 30.9-38.5l68.1-7.7c9.1-1.4 19 1.6 26.7 8.2 8.6 7.4 13.5 18.5 13.5 30.4v23.5zM611.1 661.7c4.1-12.8 15.9-22.1 30-22.1s26 9.4 30 22.1h-60z m98.8-0.2c-4.7-33.8-33.8-59.9-68.8-59.9-35.1 0-64.2 26.2-68.9 60.1H315.9c-27 0-45.6-10.5-63.7-26.7 2.9-7.8 5.7-15.4 8.2-22.2 3.7-10 6.7-18.2 8.3-22.7 0.9-2.6 1.7-5.2 2.2-7.8l27.9-75.6c20.8-54.4 74.5-55.6 76.7-55.7h270c0.6 0 55.3 0.6 77.9 55.4l27.9 75.8c0.6 2.7 1.3 5.2 2.2 7.8l8.3 22.6c2.4 6.4 5.1 13.9 7.9 21.6-19.7 16.3-35.4 26.3-59.8 27.3z m178 259H776.8c2.1-6 3.5-12.3 3.5-19v-17.7h2c15.1 0.1 29.6-5.8 40.3-16.5 11.3-11.2 17.6-26.4 17.5-42.3v-83.2c0-17.6-13.8-62.2-13.9-62.7-2.7-8.4-15.1-42.4-28.8-79.5l-8.2-22.4c-0.4-1.1-0.7-2.3-0.9-3.5-0.2-1.1-0.5-2.1-0.9-3.1l-28.7-77.9c-32.3-78.7-110-79.6-113.2-79.6h-270c-3.3 0-81.9 0.9-112.2 80.3l-28.4 77.2c-0.4 1-0.7 2.1-0.9 3.1-0.2 1.2-0.5 2.3-0.9 3.5-1.6 4.4-4.6 12.6-8.3 22.5-10.6 28.8-25.2 68.1-28.7 79.5-0.2 0.4-13.9 44.9-13.9 62.6V825c-0.1 15.9 6.2 31.1 17.5 42.3 10.3 10.2 23.9 15.6 37.8 16.3v17.9c0 6.7 1.4 13 3.5 19H137.4V246.7h750.5v673.8z" p-id="9603" fill="%23ffffff"></path><path d="M441.3 132.8h139.2v38H441.3zM353.8 132.8h50.6v38h-50.6zM253.8 132.8h50.6v38h-50.6zM158.3 132.8h50.6v38h-50.6zM809.1 132.8h50.6v38h-50.6zM711.6 132.8h50.6v38h-50.6zM614.8 132.8h50.6v38h-50.6z" p-id="9604" fill="%23ffffff"></path></svg>';var sr={loadRoadNetwork:!1},Se="version",gn="map_data",we="road_network_data",Si={half:Ei,power:bi,mechanical:Mi},mn=class{constructor(n){this.bmap=n;this.initDb()}floors=[];async initDb(){try{let{db:n,type:t}=await yi();t==="onupgradeneeded"&&(Me(Se),Me(gn),Me(we))}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 vi(n,`${t}`,e)}getCacheData(n,t){return _i(n,`${t}`)}getFloorCacheKey(n){return`${n.floor_id}`}async getFloorData(n){let t=this.floors.find(i=>i.floor===n);if(!t)return null;let e=this.getFloorCacheKey(t);try{if(await this.getCacheData(Se,e)===t.version_id){let r=await this.getCacheData(gn,e);if(r)return this.getDataByJson(r)}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(i=>i.json());return e.floor=n.floor,console.timeEnd("zstd_json"),this.setCacheData(gn,t,e),this.setCacheData(Se,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(Se,e)===t.version_id){let s=await this.getCacheData(we,e);if(s)return s}let r=await fetch(t.route_url).then(s=>s.json());return this.setCacheData(we,e,r),r}catch{let i=await fetch(t.route_url).then(r=>r.json());return this.setCacheData(we,e,i),i}}))).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 ct(this.bmap.context),e=[0,0];return n.layers.forEach(i=>{switch(i.l_type){case"range":let r=i.elements[0];e=[r.center_x,r.center_y];break;case"graph":let s=[],a=new Map;at(i.elements,e);let u=[];i.elements.forEach(h=>{if(h.group==="ground")t.createGround(h);else if(h.canMerge)u.push(h);else{let g=t.addGraphic(h);s.push(g),a.set(h.id,g)}}),t.userData.graphics=s,t.userData.graphicMap=a;let l=u.reduce((h,g)=>{let{fillColor:x,fillOpacity:E,strokeColor:M,strokeOpacity:C,height:G}=g,D=`${x}-${E}-${M}-${C}-${G}`;return h[D]?h[D].push(g):h[D]=[g],h},{});Object.values(l).forEach(h=>{let g=new Jt(this.bmap.context,h);t.mergeGraphicLayer.add(g)});break;case"ground":at(i.elements,e);let c=i.elements.map(h=>new U(this.bmap.context,h));t.addGrounds(c);break;case"wall":at(i.elements,e);let p=i.elements.reduce((h,g)=>{let{fillColor:x,fillOpacity:E,strokeColor:M,strokeOpacity:C,height:G}=g,D=`${x}-${E}-${M}-${C}-${G}`;return h[D]?h[D].push(g):h[D]=[g],h},{});Object.values(p).forEach(h=>{let g=new $t(this.bmap.context,h);t.wallLayer.add(g)});break;case"lane":at(i.elements,e);let f=i.elements.reduce((h,g)=>{let{fillColor:x,fillOpacity:E,strokeColor:M,strokeOpacity:C}=g,G=`${x}-${E}-${M}-${C}`;return h[G]?h[G].push(g):h[G]=[g],h},{});Object.values(f).forEach(h=>{let g=new Zt(this.bmap.context,h);t.laneLayer.add(g)});break;case"texture2d":case"texture3d":if(at(i.elements,e),i.elements.length){let h=new Rt(this.bmap.context,i.elements);t.textureLayer.add(h)}break;case"glb":at(i.elements,e),i.elements.forEach(h=>{let g=gt([h.center_x,h.center_y],e),x=new Kt(this.bmap.context,{...h,url:h.secondUrl,rotate:h.secondRotate,width:h.secondWidth,center_x:g[0],center_y:g[1]});t.glbModelLayer.add(x)});break;case"store":at(i.elements,e),i.elements.map(h=>{let g=gt([h.center_x,h.center_y],e),x=t.addGraphic(h);t.userData.graphics.push(x),t.userData.graphicMap.set(h.id,x);let E=new V(this.bmap.context,{id:h.id,icon:h.poi_info.icon,text:h.poi_info.showName||h.store_name||h.poi_info.text,position:{x:g[0],y:g[1],z:h.airHeight+h.height},icon_size:[18,18]});t.poiLayer2.pushPoi(E),E&&(E.userData.type="store",E.userData.data=h)});break;case"facility":at(i.elements,e),i.elements.map(h=>{let g=gt(h.geometry.cds,e),x=t.addGraphic(h);if(t.userData.graphics.push(x),t.userData.graphicMap.set(h.id,x),h.poi_info){let E=new V(this.bmap.context,{id:h.id,icon:h.poi_info.icon,text:h.poi_info.showName||h.store_name||h.poi_info.text,position:{x:g[0],y:g[1],z:h.airHeight+h.height},icon_size:[18,18]});t.poiLayer2.pushPoi(E),E.userData.type="facility",E.userData.data=h}});break;case"parkingSpace":at(i.elements,e);let d=[],y=new Map;i.elements.forEach(h=>{let g=t.addGraphic(h);d.push(g),y.set(h.id,g);let x=gt([h.center_x,h.center_y],e);if(h.texts[0]){let E=new V(this.bmap.context,{id:h.id,text:h.texts[0],position:{x:x[0],y:x[1],z:h.airHeight+h.height}});E&&(E.userData.type="parkingSpace",E.userData.data=h),t.poiLayer2.pushPoi(E)}});let _=i.elements.filter(h=>Si[h.parkingType]).map(h=>{let g=gt([h.center_x,h.center_y],e),x=Ge(h.geometry.coords,g);return{uuid:h.id,iconUrl:Si[h.parkingType],name:h.texts[0],deltaHeight:h.deltaHeight,airHeight:h.airHeight,height:h.height,geometry:{...h.geometry,coords:x},opacity:h.fillOpacity,visible:!0}});if(_.length){let h=new Rt(this.bmap.context,_);t.textureLayer.add(h)}t.userData.parkingSpaces=d,t.userData.parkingSpacesGraphicMap=y;break}}),t.userData.center=e,t.userData.height=n.floorHeight,t.name=n.floor,t.userData.data=n,t.updateBox(),t}clear(){}dispose(){this.clear(),xi()}};
|
|
3779
3779
|
//# sourceMappingURL=bmap.cjs.min.js.map
|