@aibee/crc-bmap 0.14.14 → 0.14.15

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/index.cjs CHANGED
@@ -698,4 +698,4 @@
698
698
  float uvx = prevUv + (vUv.y + 1.0) / 2.0 * vCustomUv;
699
699
  gl_FragColor = diffuseColor * texture2D(map, vec2(uvx, (vUv.x + 1.0) / 2.0) * repeat);
700
700
  }
701
- `};var co=class extends mt.ShaderMaterial{constructor(t){super({type:"ArrowLineMaterial",uniforms:Object.assign({},mt.UniformsUtils.clone(mt.ShaderLib["custom-line"].uniforms),{map:{value:null}}),vertexShader:mt.ShaderLib["custom-line"].vertexShader,fragmentShader:mt.ShaderLib["custom-line"].fragmentShader,clipping:!0}),this.dashed=!1,Object.defineProperties(this,{map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(e){this.uniforms.repeat.value.copy(e)}},allDistance:{enumerable:!0,get:function(){return this.uniforms.allDistance.value},set:function(e){this.uniforms.allDistance.value=e}}}),this.setValues(t),this.isLineMaterial=!0}};var Pa=require("three/examples/jsm/lines/LineGeometry.js"),ba=require("three/examples/jsm/lines/Line2.js");var _a={texture_url:Rs,lineWidth:8,color:16777215},lo=class extends ft.Object3D{registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:i,height:s}}}}}=this,o=t.map(r=>{let[h,c,l]=r;return D(new ft.Vector3(h,c,l),e,i,s)}).map(r=>{let{x:h,y:c}=r;return[h,c]});return Et(o)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new ft.Vector2(t,1)}loadTexture(t){return new Promise((e,i)=>{new ft.TextureLoader().load(t,e,void 0,i)})}transformPoints(t){let e=[];for(let i=0;i<t.length;i++)e.push(...t[i]);return e}updatePoints(t){if(this.points=t,this.mesh){var e,i;this.remove(this.mesh),(e=this.material)==null||e.dispose(),(i=this.geometry)==null||i.dispose()}this.geometry=new Pa.LineGeometry,this.geometry.setPositions(t.flat(2));let s=Et(t.map(r=>{let[h,c]=r;return[h,c]})),o=this.material=new co({color:new ft.Color(this.config.color),transparent:!0,resolution:new ft.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!0,depthWrite:!0,linewidth:this.config.lineWidth,map:this.texture,blending:ft.NormalBlending,repeat:new ft.Vector2(this.getRepeat(),1),allDistance:s}),n=this.mesh=new ba.Line2(this.geometry,o);return n.computeLineDistances(),n.renderOrder=9,this.add(n),n}movePath(t){this.material&&(this.material.thresholdRatio=t)}create(t){return f(this,null,function*(){if(!this.texture){let e=this.texture=yield this.loadTexture(this.config.texture_url);e.wrapS=e.wrapT=ft.RepeatWrapping}return this.updatePoints(t)})}getBoundingBox(){return this.mesh?(this.mesh.geometry.computeBoundingBox(),new ft.Box3().copy(this.mesh.geometry.boundingBox).applyMatrix4(this.mesh.matrixWorld)):null}dispose(){var t,e,i;this.unRegistryEvent(),this.clear(),(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(i=this.texture)==null||i.dispose(),this.navigation=null}constructor(t,e){super(),this.navigation=t,this.mesh=null,this.geometry=null,this.material=null,this.texture=null,this.config=_a,this.points=[],this.basicRepeat=1,this.prevCameraZoom=0,this.onControlChange=()=>{let i=this.navigation.bmap.context.camera.zoom;i!==this.prevCameraZoom&&(this.prevCameraZoom=i,this.changeRepeat())},this.onUpdate=()=>{this.texture},this.onResize=()=>{if(this.material){let{width:i,height:s}=this.navigation.bmap.context.clientSize;this.material.resolution.set(i,s)}},this.config=Object.assign({},_a,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}};var Sa=require("@tweenjs/tween.js");var Zt=require("three"),po=class extends Zt.Object3D{meshSetMaterial(t){t instanceof Zt.Mesh&&(t.material.emissiveIntensity=.5,t.material.shininess=0,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map,t.material.transparent=!0,t.material.depthTest=!1,t.renderOrder=1e6),t.children.forEach(i=>{this.meshSetMaterial(i)})}getBaseScale(t){let{clientSize:{height:e},camera:i}=this.bmap.context,o=(i.top-i.bottom)/i.zoom/e;return this.options.size*o/this.modelMaxLength}registryEvent(){this.bmap.context.addEventListener("update",this._update),this.bmap.context.addEventListener("control-zoom-change",this._onChangeZoom)}unRegistryEvent(){this.bmap.context.removeEventListener("update",this._update),this.bmap.context.removeEventListener("control-zoom-change",this._onChangeZoom)}lookAtCamera(){if(this.model&&this.bmap&&this.bmap.context){let t=this.bmap.context.camera,e=new Zt.Euler;e.setFromQuaternion(t.quaternion,"ZYX"),this.group.rotation.copy(e)}}setClips(t){this.clearClips(),t.length&&(this.mixer=new Zt.AnimationMixer(this.model.scene),t.forEach(e=>this.mixer.clipAction(e).play()))}startClips(){var t;this.setClips(((t=this.model)==null?void 0:t.animations)||[])}clearClips(){this.mixer&&(this.mixer.stopAllAction(),this.mixer.uncacheRoot(this.mixer.getRoot()),this.mixer=null)}dispose(){this.unRegistryEvent(),this.clearClips(),this.clear(),this.model&&I(this.model.scene),this.bmap=null}constructor(t,e,i={}){super(),this.bmap=t,this.group=new Zt.Object3D,this.mixer=null,this.previewTime=0,this.modelMaxLength=0,this.options={size:40},this._update=()=>{let s=Date.now();if(!this.previewTime)this.previewTime=s;else{var o;let n=s-this.previewTime;this.previewTime=s,(o=this.mixer)==null||o.update(n/1e3)}this.lookAtCamera()},this._onChangeZoom=s=>{let{zoom:o}=s;var n;if(!this.model)return;let r=this.getBaseScale(this.model.scene);(n=this.model)==null||n.scene.scale.set(r,r,r)},this.options=w({},this.options,i),this.add(this.group),St.loadModel(e,!1).then(s=>{this.model=s;let n=new Zt.Box3().setFromObject(s.scene).getSize(new Zt.Vector3),r=Math.max(n.x,n.y,n.z);this.modelMaxLength=r;let h=this.getBaseScale(s.scene);s.scene.scale.set(h,h,h),this.meshSetMaterial(s.scene),this.group.add(s.scene),this.setClips(s.animations),this.group.rotation.set(Math.PI/2,Math.PI,0),this.dispatchEvent({type:"loaded"})}),this.registryEvent()}};var uo=require("three");var xn=class extends X{registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate)}pauseAnimation(){this.tweenUtil.pause()}continueAnimation(){this.tweenUtil.continue()}clearTween(){this.tweenUtil.clear(),this.bmap.context.control.enabled=!0}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate)}clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.movedDistance=0,this.clearTween()),this.startModel&&(this.startModel.visible=!1),this.translatePath=null}addPath(t){this.paths=t;let e=t.map(i=>w({},i,{points:this.translatePoints(i.points)}));if(this.clearTween(),this.movedDistance=0,this.bmap.currentBuildGround)this.renderPath(e);else{let i=()=>{this.bmap.removeEventListener("center-change",i),this.renderPath(e)};this.bmap.addEventListener("center-change",i)}this.dispatchEvent({type:"add-path",paths:t})}translatePoints(t){let[e,i]=this.bmap.buildingCenter;return t.map(s=>[s[0]-e,s[1]-i])}renderPath(t){return f(this,null,function*(){if(!t.length)return this.clearPath();let e=[];t.forEach((i,s,o)=>{let n=this.mulFloor.floors.find(r=>r.name===i.floor);e.push(...i.points.map(r=>{let[h,c]=r;return[h,c,n.position.z+n.groundMaxHeight]}))}),this.cPath=e,this.animationPathOptions={cPathIndex:0},this.path?this.path.updatePoints(e):(this.path=new lo(this),yield this.path.create(e),this.path.position.z=.5,this.bmap.context.scene.add(this.path)),this.startModel&&(this.startModel.position.set(e[0][0],e[0][1],e[0][2]),this.startModel.visible=!0),this.dispatchEvent({type:"render-path",path:this.path})})}catmullRomCurve3(t){return Di(t,!1,!0,.1,170,2.5)}getPathDirection(t,e){if(t.length<2)return null;let i=he(t,e),s=t[i],o=t[i+1],n=new uo.Vector3(o[0]-s[0],o[1]-s[1],0).normalize(),r=new uo.Vector3(0,1,0).normalize(),h=n.angleTo(r),c=new uo.Vector3().crossVectors(r,n);return(Object.is(c.y,0)?-1:1)*h}startSimulation(t){return f(this,null,function*(){t===void 0&&(t=1);let{paths:e,movedDistance:i}=this;if(!e.length)return;let s=e.reduce((n,r)=>n+r.distance,0);if(!s||i>=s)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let o=s/t;return this.startModel.startClips(),new Promise(n=>{let r=this.simulationTween=new Sa.Tween({distance:this.movedDistance},this.tweenUtil.group).to({distance:s},o*1e3).onUpdate(h=>{var c;this.movedDistance=h.distance;let l=h.distance,p=0;for(let g=0;g<e.length;g++)if(e[g].distance>=l){p=g;break}else l-=e[g].distance;let d=Ze(e[p].points,l);if(d===null)return;this.currentPathPosition=d;let u=this.translatePoints([d])[0],m=this.mulFloor.floors.find(g=>g.name===e[p].floor),v=m?m.position.z+m.groundMaxHeight:(c=this.startModel)==null?void 0:c.position.z;this.startModel&&this.startModel.position.set(u[0],u[1],v)}).onComplete(()=>{if(this.tweenUtil.remove(r),this.startModel.clearClips(),this.startModel){var h,c,l,p;let d=(l=e.slice(-1)[0])==null||(c=l.points)==null||(h=c.slice(-1))==null?void 0:h[0];if(!d)return;let u=this.mulFloor.floors.find(g=>{var x;return g.name===((x=e.slice(-1)[0])==null?void 0:x.floor)});if(!u)return;let m=u?u.position.z+u.groundMaxHeight:(p=this.startModel)==null?void 0:p.position.z,v=this.translatePoints([d])[0];this.startModel.position.set(v[0],v[1],m)}n(!0)}).start()})})}setStartPoiRotate(t){if(this.startPoi){let i=(this.bmap.context.control.getAzimuthalAngle()*180/Math.PI+360)%360;this.startPoi.options.icon_rotate=(360-t-i)%360}}dispose(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose()),this.startModel&&(this.bmap.context.scene.remove(this.startModel),this.startModel.dispose()),this.tweenUtil.dispose(),this.unRegistryEvent(),super.dispose()}constructor(t,e,i={}){super(t),this.mulFloor=e,this.path=null,this.fetchRoadStatus=!1,this.paths=[],this.curFloorPath=null,this.translatePath=null,this.currentPathPosition=null,this.pathTween=null,this.startPoi=null,this.movedDistance=0,this.tweenUtil=new _e,this.animationPathOptions={cPathIndex:0},this.cPath=[],this.onUpdate=()=>{this.tweenUtil.update()},this.startModel=new po(t,Er,i.startModel),this.startModel.visible=!1,this.bmap.context.scene.add(this.startModel),this.registryEvent()}};var W_=require("core-js/modules/es.array.flat.js"),U_=require("core-js/modules/es.array.unscopables.flat.js"),mo=require("three");var wn=class extends X{registryEvent(){this.clickHelper.addEventListener("click",this._click)}unRegistryEvent(){this.clickHelper.removeEventListener("click",this._click)}dispose(){this.unRegistryEvent(),this.clickHelper.dispose(),this.mulFloors=null,super.dispose()}constructor(t,e){super(t),this.mulFloors=e,this._click=i=>{let{e:s}=i;if(!this.mulFloors.showStatus)return;let o=new mo.Vector2,{offsetX:n,offsetY:r}=s,h=this.mulFloors.floors.map(d=>d.poiLayer2.getPoiByDeviceXy(n,r)).flat(2),{clientSize:c}=this.bmap.context;o.x=n/c.width*2-1,o.y=r/c.height*-2+1;let l=new mo.Raycaster;l.setFromCamera(o,this.bmap.context.camera),l.ray.origin.sub(l.ray.direction.clone().multiplyScalar(1e4));let p=this.mulFloors.floors.map(d=>d.graphicLayer.getGraphicByRaycaster(l).graphics).flat();this.dispatchEvent({type:"select",pois:h,graphics:p})},this.clickHelper=new Ri(this.bmap.context.container),this.registryEvent()}};var $_=require("core-js/modules/es.array.find-last-index.js"),J_=require("core-js/modules/es.array.find-last.js"),Q_=require("core-js/modules/es.array.push.js");var j_=require("core-js/modules/web.dom-collections.iterator.js"),V_=require("core-js/modules/es.array.push.js"),K_=require("core-js/modules/es.array.sort.js"),yi=require("three");function sc(a){let t=a.length,e=0,i=0,s=0,o=0;a.forEach(h=>{e+=h[0],i+=h[1],s+=h[0]*h[1],o+=h[0]*h[0]});let n=(t*s-e*i)/(t*o-e*e),r=(i-n*e)/t;return{m:n,b:r}}function oc(a,t,e){let i=e[0][0],s=e.slice(-1)[0][0],o=a*i+t,n=a*s+t;return{start:[i,o],end:[s,n]}}function Ms(a){if(a.length<2)return null;let t=a.filter((h,c)=>{let l=[...a];return l.splice(c,1),l.every(p=>p[0]!==h[0]&&p[1]!==h[1])});if(t.length<2)return null;let{m:e,b:i}=sc(t),{start:s,end:o}=oc(e,i,t),r=360-(new yi.Vector2().subVectors(new yi.Vector2(o[0],o[1]),new yi.Vector2(s[0],s[1])).angle()/Math.PI*180-90+360)%360;return Number.isNaN(r)?null:r}function nc(a){let t=[];for(let e=1;e<a.length;e++){let i=a[e-1],s=a[e],o=s.position[0]-i.position[0],n=s.position[1]-i.position[1],r=Math.sqrt(o**2+n**2),h=s.time-i.time;if(h>0){let c=r/h;console.log("speedDelta",i.type,s.type,fo(c),r,h),t.push(c)}else t.push(0)}return t}function rc(a,t){let e=a[0],i=a.slice(-1)[0],s=O(i.position,e.position),o=i.time-e.time;return o<100||s<3?null:s/o}function fo(a){return a*60*60}function vi(a,t,e,i){let s=(e+90)%360*(Math.PI/180),o=t*i,n=new yi.Vector2(a[0],a[1]),r=Math.cos(s),h=Math.sin(s),c=new yi.Vector2(r,h);return n.add(c.normalize().multiplyScalar(o)),[n.x,n.y]}function ac(a){let t=[...a].sort((c,l)=>c-l),e=Ea(t,25),i=Ea(t,75),s=i-e,o=e-1.5*s,n=i+1.5*s,r=t.filter(c=>c>=o&&c<=n);return a.filter(c=>r.includes(c))}function Ea(a,t){let e=t/100*(a.length-1),i=Math.floor(e),s=Math.ceil(e);if(i===s)return a[i];let o=e-i;return a[i]*(1-o)+a[s]*o}var _s=require("lodash"),Ps=class extends st{setPathAngle(t){this.pathAngle=t,this.dispatchEvent({type:"change-compass",value:this.pathAngle}),(0,_s.isNil)(this.angle)&&(this.angle=t)}changeSpeed(){let t=this.history.filter(h=>["vision"].includes(h.type));if(t.length<2){this.speedFilter.filter(0),this.speed=0;return}let e=t[0],i=t.slice(-1)[0],s=O(i.position,e.position),o=i.time-e.time,n=o>0?s/o:0,r=this.speedFilter.filter(n);this.speed=r}changeAngle(t){t===void 0&&(t=this.visionHistory),t.length<2&&(this.angle=null);let e=Ms(t.map(i=>i.position));e!==null&&this.setAngle(e)}setAngle(t,e){e===void 0&&(e=!0),this.angle=t,e&&this.dispatchEvent({type:"change-position-compass",value:t})}setPosition(t,e,i){let s={position:t,time:e,clientTime:Date.now()-i,type:"vision"};if(this._setVisionHistoryForAngle(s),(0,_s.isNil)(this.angle)||!this.speed){this.addHistory(s);return}let o=this.history.findLastIndex(r=>r.type==="vision"),n=this.history[o];if(n){if(n.time>e)return;let r=Ms([this.history.slice(-1)[0].position,t]);if(r&&Math.abs(r-this.angle)<60){this.addHistory(s);return}let h=vi(t,this.speed,360-this.pathAngle,i);O(h,this.history.slice(-1)[0].position)>5?this.visionExcessesCount++:this.visionExcessesCount=0,this.visionExcessesCount>3&&(console.warn("\u8FDE\u7EED\u4E09\u6B21\u89C6\u89C9\u548Cpdr\u5DEE\u8DDD\u5927\u4E8E5\u7C73\uFF0C\u4F7F\u7528\u89C6\u89C9\u6821\u51C6"),this.addHistory(s),this.visionExcessesCount=0)}}resetPdrPosition(){let t=this.history.findLast(e=>e.type==="vision");if(t&&this.speed){let e=vi(t.position,this.speed,360-this.pathAngle,Date.now()-t.clientTime);e&&this.history.push({position:e,time:Date.now(),clientTime:Date.now(),type:"pdr"})}}getLastVisionPdrPos(){let t=this.history.findLastIndex(i=>i.type==="vision");if(t!==-1){var e;return(e=this.history[t+1])!=null?e:this.history[t]}return null}_setVisionHistoryForAngle(t){if(!this.visionHistory.length){this.visionHistory.push(t);return}let e=Ms([this.visionHistory.slice(-1)[0].position,t.position]);if(e!==null&&(this.angle&&Math.abs(this.angle-e)>60?this.angleExcessesCount++:(this.angleExcessesCount=0,this.visionHistory.push(t))),this.angleExcessesCount>3)console.warn("\u8FDE\u7EED\u4E09\u6B21\u89D2\u5EA6\u6BD4\u8F83\u6B6A\uFF0C\u91CD\u65B0\u77EB\u6B63"),this.visionHistory=[t],this.angleExcessesCount=0;else{let i=O(this.visionHistory[0].position,this.visionHistory.slice(-1)[0].position);for(;i>5&&this.visionHistory.length>15;)this.visionHistory.shift(),i=O(this.visionHistory[0].position,this.visionHistory.slice(-1)[0].position)}this.changeAngle()}addHistory(t){this.history.push(t);let e=this.history.filter(r=>r.type==="vision"),i=e.length?Date.now()-e.slice(-1)[0].clientTime:0,s=O(this.history[0].position,this.history.slice(-1)[0].position),o=i>5e3?10:3,n=i>5e3?0:5;for(i>5e3&&console.warn("\u89C6\u89C9\u7ED3\u679C\u8D85\u51FA5s\u4E0D\u53EF\u7528\uFF0C\u5168\u90E8\u6E05\u7A7A");e.length>n&&s>o;)this.history.shift(),e=this.history.filter(r=>r.type==="vision"),s=O(this.history[0].position,this.history.slice(-1)[0].position);n===0?this.changeSpeed():t.type==="vision"&&this.changeSpeed(),this.changePosition(t.type)}setBeaconPosition(t,e,i){let s=Date.now()-i,o={position:t,time:e,clientTime:s,type:"beacon"},n=this.history.findLastIndex(l=>l.type!=="pdr"),r=this.history[n];if(!r){this.addHistory(o);return}if((0,_s.isNil)(this.pathAngle)||!this.speed){this.addHistory(o);return}if(r&&r.time>e)return;let h=vi(t,this.speed,360-this.pathAngle,i);O(h,this.history.slice(-1)[0].position)>5?this.beaconExcessesCount++:this.beaconExcessesCount=0,this.beaconExcessesCount>3&&(console.warn("\u8FDE\u7EED\u4E09\u6B21beacon\u548Cpdr\u5DEE\u8DDD\u5927\u4E8E5\u7C73\uFF0C\u4F7F\u7528beacon\u6821\u51C6"),this.addHistory(o),this.beaconExcessesCount=0)}startPositionTimer(){this.positionTimer&&this.timer.clearInterval(this.positionTimer),this.positionTimer=this.timer.setInterval(()=>{this.changePosition()},20)}stopPositionTimer(){this.positionTimer&&(this.timer.clearInterval(this.positionTimer),this.positionTimer=null)}changePosition(t){t===void 0&&(t="pdr");let e=this.getPosition(t);e.success&&(this.history.push({position:e.pos,time:Date.now(),clientTime:Date.now(),type:"pdr"}),this.speed?this.dispatchEvent({type:"change-pos",value:w({},e)}):this.dispatchEvent({type:"change-pos",value:e}))}getPosition(t){if(this.history.length===0)return{success:!1,pos:[0,0],compass:null,speed:0};let e=this.history.slice(-1)[0];if(this.history.length<2)return{success:!0,pos:e.position,compass:this.pathAngle,speed:this.speed};if((0,_s.isNil)(this.pathAngle)||!this.speed)return{success:!0,pos:e.position,compass:this.pathAngle,speed:this.speed};let i=e.clientTime,s=Date.now()-i;return{success:!0,pos:this.pathAngle?vi(e.position,this.speed,360-this.pathAngle,s):e.position,compass:this.pathAngle,speed:fo(this.speed)}}dispose(){this.timer.dispose()}constructor(){super(),this.history=[],this.visionHistory=[],this.speed=0,this.angle=null,this.timer=new j,this.positionTimer=null,this.speedFilter=new Fi,this.visionExcessesCount=0,this.beaconExcessesCount=0,this.angleExcessesCount=0,this.pathAngle=0,this.startPositionTimer()}};var rP=require("core-js/modules/es.json.stringify.js");var hc={};function Mn(){return new Worker(new URL("./worker/recommend.worker-DNMNFDYX.js",hc.url))}var cc={placeId:0,catLotStatusApi:"https://vrapi.aibee.cn/parking/cat-lot-status"},_n=class{setRoadData(t,e){return Z(this.worker,"set_road_info",{roadData:t,facilities:e})}recommend(t){return f(this,null,function*(){let e=yield fetch(this.options.catLotStatusApi,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({place_id:+this.options.placeId})}).then(i=>i.json()).then(i=>i.data.filter(s=>s.status===0)).then(i=>{var s;return i.filter((s=this.options.filterCarLotStatus)!=null?s:()=>!0)});return Z(this.worker,"recommend",w({},t,{carLotStatus:e}))})}dispose(){this.worker.terminate()}constructor(t={}){this.worker=Mn(),this.options=w({},cc,t)}};var yP=require("core-js/modules/es.json.stringify.js"),vP=require("core-js/modules/web.dom-collections.iterator.js"),xP=require("core-js/modules/es.array.sort.js"),wP=require("core-js/modules/es.array.push.js"),MP=require("core-js/modules/es.regexp.exec.js"),_P=require("core-js/modules/web.url-search-params.js"),PP=require("core-js/modules/web.url-search-params.delete.js"),bP=require("core-js/modules/web.url-search-params.has.js"),SP=require("core-js/modules/web.url-search-params.size.js");var dP=require("core-js/modules/es.json.stringify.js");var lc={url:"",reconnect:!0,heartBeat:2e3,heartMsg:JSON.stringify({command:"PING"}),reconnectTime:3e3,reconnectMaxCount:1e6,noMessageTime:6e3},xi=class extends st{initWebsocket(){this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.alive=!0,this.startHeart(),this.startOnMessageTimer(),this.stopReconnect(),this.dispatchEvent({type:"open"})},this.ws.onerror=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect(),this.registryEvent()},this.ws.onclose=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect()},this.ws.onmessage=t=>{this.startOnMessageTimer(),this.dispatchEvent({type:"message",message:t})}}startHeart(){this.stopHeart(),this.heartTimer=this.timer.setInterval(()=>{this.send(this.options.heartMsg)&&this.dispatchEvent({type:"send-heart"})},this.options.heartBeat)}stopHeart(){this.heartTimer&&(this.timer.clearInterval(this.heartTimer),this.heartTimer=null)}startReconnect(t){t===void 0&&(t=this.options.reconnectTime),this.stopReconnect(),this.options.reconnect&&(this.options.reconnectMaxCount--,this.options.reconnectMaxCount>=0&&(this.reconnectTimer=this.timer.setTimeout(()=>{this.initWebsocket()},t)))}stopReconnect(){this.reconnectTimer&&(this.timer.clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}startOnMessageTimer(){this.stopOnMessageTimer(),this.noMessageTimer=this.timer.setTimeout(()=>{var t;(t=this.ws)==null||t.close(),this.dispatchEvent({type:"no-message-timeout"})},this.options.noMessageTime)}stopOnMessageTimer(){this.noMessageTimer&&(this.timer.clearTimeout(this.noMessageTimer),this.noMessageTimer=null)}send(t){var e;let i=typeof t=="string"?t:JSON.stringify(t);return this.alive&&((e=this.ws)==null?void 0:e.readyState)===1?(this.ws.send(i),this.dispatchEvent({type:"send-success",msg:i}),!0):(this.dispatchEvent({type:"send-fail",msg:i}),!1)}registryEvent(){window.addEventListener("online",this.onOnline)}unRegistryEvent(){window.removeEventListener("online",this.onOnline)}close(){var t;this.unRegistryEvent(),this.options.reconnect=!1,this.alive=!1,this.stopHeart(),this.stopReconnect(),this.stopOnMessageTimer(),(t=this.ws)==null||t.close(),this.ws=null,this.dispatchEvent({type:"close"})}dispose(){this.close(),this.timer.dispose(),super.dispose()}constructor(t){super(),this.ws=null,this.alive=!1,this.timer=new j,this.heartTimer=null,this.reconnectTimer=null,this.noMessageTimer=null,this.onOnline=()=>{this.startReconnect()},this.options=w({},lc,t||{}),this.options.url&&this.initWebsocket()}};var bn=require("lodash");var Pn=a=>{let t=a.toString(2),e=""+Array(16-t.length+1).join("0")+t,i=parseInt(e.slice(0,4),2)*10,s=parseInt(e.slice(4,16),2);return[i,s]};var Sn=class extends st{initPositionWebSocket(){let t=w({},this.options.ext_position_params,{place_id:this.options.place_id,token:this.options.access_token}),e=Object.keys(t).filter(i=>!(0,bn.isNil)(t[i])).map(i=>i+"="+t[i]).join("&");this.positionWebSocket=new xi({url:this.options.wss_position_url+"?"+e}),this.positionWebSocket.addEventListener("message",i=>{let{message:s}=i,o=(()=>{try{return JSON.parse(s.data)}catch(U){return s.data}})();if(this.dispatchEvent({type:"ws-message",data:o}),o.command==="POSITION_RESULT"&&o.data.success)if(["POSITION","FLOOR","PARK_POSITION","AOA"].includes(o.data.success_type)&&this.useGpsFloorTimer&&(this.positionFloor=o.data.floor,this.timer.clearTimeout(this.useGpsFloorTimer),this.useGpsFloorTimer=null),o.data.success_type==="AOA"){let{x:U,y:H,time:et,floor:J,ts:ne}=o.data,re=this.positionFloor!==J;if(this.positionFloor=J,this.dispatchEvent({type:"ws-position",floor:J,x:U,y:H,time:et,_type:"aoa"}),this.options.upload_position){var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:U,y:H,floor:J,type:"aoa"}),serverData:JSON.stringify(o)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:J,x:U,y:H,time:new Date(ne).getTime()-o.lag-o.duration});return}if(this.options.type!==1){var r;if(re){var h,c,l;(l=this.pdrPosition)==null||(c=l.pdr)==null||(h=c.particleFilter)==null||h.setPosInitFlag(!1)}(r=this.pdrPosition)==null||r.setBeaconPosition({x:U,y:H},new Date(ne).getTime()-o.lag-o.duration)}else if(re){var p;if(this.resetPdr(),(p=this.carInertialPosition)==null||p.stopPositionTimer(),this.path){let Ee=this.path.findIndex(Mi=>Mi.floor===J),ge=this.path[Ee];if(ge){var d;this.resetPdr(),(d=this.carInertialPosition)==null||d.setBeaconPosition(ge.points[0],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}else{var u;(u=this.carInertialPosition)==null||u.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var m;(m=this.carInertialPosition)==null||m.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var v;(v=this.carInertialPosition)==null||v.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else if(o.data.success_type==="POSITION"){let{x:U,y:H,time:et,floor:J,ts:ne}=o.data,re=this.positionFloor!==J;if(this.positionFloor=J,this.dispatchEvent({type:"ws-position",floor:J,x:U,y:H,time:et,_type:"beacon"}),console.log("positionFloor",J,re),this.options.upload_position){var g;(g=this.positionWebSocket)==null||g.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:U,y:H,floor:J,type:"originBeacon"}),serverData:JSON.stringify(o)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:J,x:U,y:H,time:new Date(ne).getTime()-o.lag-o.duration});return}if(this.options.type!==1){var x;if(re){var M,P,C;(C=this.pdrPosition)==null||(P=C.pdr)==null||(M=P.particleFilter)==null||M.setPosInitFlag(!1)}(x=this.pdrPosition)==null||x.setBeaconPosition({x:U,y:H},new Date(ne).getTime()-o.lag-o.duration)}else if(re){var S;if(this.resetPdr(),(S=this.carInertialPosition)==null||S.stopPositionTimer(),this.path){let Ee=this.path.findIndex(Mi=>Mi.floor===J),ge=this.path[Ee];if(ge){var G;this.resetPdr(),(G=this.carInertialPosition)==null||G.setBeaconPosition(ge.points[0],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}else{var E;(E=this.carInertialPosition)==null||E.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var rt;(rt=this.carInertialPosition)==null||rt.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var Tt;(Tt=this.carInertialPosition)==null||Tt.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else if(o.data.success_type==="PARK_POSITION"&&o.data.success){if(this.options.type===1){let{x:U,y:H,time:et,floor:J}=o.data,ne=this.positionFloor!==J;if(this.positionFloor=o.data.floor,this.dispatchEvent({type:"ws-position",floor:J,x:U,y:H,time:et,_type:"vision"}),!this.options.use_pdr){this.dispatchEvent({type:"position",floor:J,x:U,y:H,time:new Date(et).getTime()});return}if(ne){var gt;if(this.resetPdr(),(gt=this.carInertialPosition)==null||gt.stopPositionTimer(),this.path){let re=this.path.findIndex(ge=>ge.floor===J),Ee=this.path[re];if(Ee){var Ot;this.resetPdr(),(Ot=this.carInertialPosition)==null||Ot.setPosition(Ee.points[0],new Date(et).getTime(),o.duration)}else{var kt;(kt=this.carInertialPosition)==null||kt.setPosition([U,H],new Date(et).getTime(),o.duration)}}else{var oe;(oe=this.carInertialPosition)==null||oe.setPosition([U,H],new Date(et).getTime(),o.duration)}}else{var Se,ct;if((Se=this.carInertialPosition)==null||Se.setPosition([U,H],new Date(et).getTime(),o.duration),!((ct=this.carInertialPosition)!=null&&ct.positionTimer)){var $e;($e=this.carInertialPosition)==null||$e.startPositionTimer()}}if(this.options.upload_position){var wi;(wi=this.positionWebSocket)==null||wi.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:U,y:H,floor:J,type:"vision"}),serverData:JSON.stringify(o)})}}}else this.dispatchEvent({type:"floor",floor:o.data.floor,time:o.data.time})})}initSensorWebSocket(){let t=w({},this.options.ext_sensor_params,{token:this.options.access_token,place_id:this.options.place_id,record_sensor:1}),e=Object.keys(t).filter(i=>!(0,bn.isNil)(t[i])).map(i=>i+"="+t[i]).join("&");this.sensorWebSocket=new xi({url:this.options.wss_sensor_url+"?"+e})}initPdr(){this.options.type===1?(this.carInertialPosition=new Ps,this.carInertialPosition.addEventListener("change-pos",t=>{let{value:e}=t,{pos:i,success:s,speed:o}=e;if(s&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:i[0],y:i[1],time:Date.now(),speed:o}),this.options.upload_position)){var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:i[0],y:i[1],floor:this.positionFloor,type:"vision_pdr"})})}}),this.carInertialPosition.addEventListener("change-compass",t=>{let{value:e}=t;this.dispatchEvent({type:"compass",value:e})})):(this.pdrPosition=new ws(this.bmap,{pdr:{using_gps:this.options.use_gps},sensor:{elements:[F.COMPASS,F.ACCELERATION,F.DEVICE_MOTION].concat(this.options.use_gps?[F.GPS]:[])}}),this.requestDeviceOrientationPermission(),this.options.upload_position&&this.pdrPosition.sensor.addEventListener("sensor-data",t=>{let{data:e}=t;var i;(i=this.positionWebSocket)==null||i.send({command:"UPLOAD_SENSOR",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify(e)})}),this.pdrPosition.sensor.addEventListener("add-data-item",t=>{t.item.type==="compass"&&this.dispatchEvent({type:"compass",value:t.item.res})}),this.pdrPosition.addEventListener("position",t=>{let{x:e,y:i,_type:s}=t;if(console.log("_type",s,e,i,this.positionFloor,this.gpsFloor),s==="gps"&&!this.useGpsFloorTimer){let n=()=>{this.useGpsFloorTimer=this.timer.setTimeout(()=>{this.gpsFloor?this.positionFloor=this.gpsFloor:n()},5e3)};n()}if(this.positionFloor&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:e,y:i,time:Date.now()}),this.options.upload_position)){var o;(o=this.positionWebSocket)==null||o.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:e,y:i,floor:this.positionFloor,type:s})})}}))}setSensor(t){this.pdrPosition&&this.pdrPosition.setSensor(t)}requestDeviceOrientationPermission(){return f(this,null,function*(){if(this.pdrPosition){let t=yield this.pdrPosition.checkSensor();return t.deviceOrientation?this.pdrPosition.start():(this.dispatchEvent(w({type:"check-sensor"},t)),!t.deviceOrientation&&this.options.use_default_permission),t}else return null})}getGpsFloor(){return f(this,null,function*(){if(this.options.use_gps&&this.options.get_gps_floor_url){let t=yield fetch(this.options.get_gps_floor_url+"/"+this.options.place_id).then(e=>e.json());t.code===200&&(this.gpsFloor=t.data.gps_floor)}})}pausePdr(){if(this.options.type===1){var t;(t=this.carInertialPosition)==null||t.stopPositionTimer()}else{var e;(e=this.pdrPosition)==null||e.pause()}}continuePdr(){if(this.options.type===1)this.carInertialPosition&&(this.carInertialPosition.positionTimer||this.carInertialPosition.startPositionTimer());else{var t;(t=this.pdrPosition)==null||t.continue()}}setPathAngle(t){if(this.options.type===1){var e;(e=this.carInertialPosition)==null||e.setPathAngle(t)}}getForwardAngle(){if(this.options.type===1){var t,e;return(e=(t=this.carInertialPosition)==null?void 0:t.angle)!=null?e:null}else return null}resetPdr(){this.carInertialPosition&&(this.carInertialPosition.history=[],this.carInertialPosition.setPathAngle(0),this.carInertialPosition.speed=0),this.pdrPosition&&this.pdrPosition.pdr.particleFilter.setPosInitFlag(!1)}setPath(t){this.path=t}sendBeacon(t){var e;let i=[];if(le)i=t.map(o=>{let[n,r]=Pn(o.major);return[o.uuid,r,o.minor,o.rssi,o.accuracy,n]}).filter(o=>o[3]!==0).sort((o,n)=>n[3]-o[3]);else{let o=t.reduce((n,r)=>{var h,c;let[l,p]=Pn(r.major),d=""+p+r.minor;return(h=n)[c=d]||(h[c]=[]),n[d].push(w({},r,{battery:l,major:p})),n},{});Object.entries(o).forEach(n=>{let[r,h]=n,{uuid:c,major:l,minor:p,accuracy:d,battery:u}=h[0];if(h.length>1){let m=h.filter(g=>g.rssi<0),v=m.reduce((g,x)=>g+x.rssi,0);i.push([c,l,p,v/m.length,d,u])}else i.push([c,l,p,h[0].rssi,d,u])})}let s={command:"POSITION",index:this.uploadIndex++,ts:Date.now(),beacons:JSON.stringify([{type:"ibeacon",timestamp:Date.now()/1e3,res:i}]),ext_sensors:JSON.stringify({})};(e=this.sensorWebSocket)==null||e.send(s)}dispose(){var t,e,i,s;this.timer.dispose(),(t=this.positionWebSocket)==null||t.dispose(),this.positionWebSocket=null,(e=this.sensorWebSocket)==null||e.dispose(),this.sensorWebSocket=null,(i=this.pdrPosition)==null||i.dispose(),this.pdrPosition=null,(s=this.carInertialPosition)==null||s.dispose(),this.carInertialPosition=null,super.dispose()}constructor(t,e){super(),this.bmap=t,this.positionWebSocket=null,this.sensorWebSocket=null,this.pdrPosition=null,this.carInertialPosition=null,this.gpsFloor="",this.positionFloor="",this.useGpsFloorTimer=null,this.uploadIndex=0,this.path=null,this.timer=new j;let i=location.href.indexOf("?"),s=i!==-1?location.href.slice(i):location.search,o=new URLSearchParams(s),n=o.get("server_env")||"prod",r={test:"nav-test.aibee.cn",prod:"nav.aibee.cn"},h="wss://"+r[n]+"/aether-walker/indoor/position",c="wss://"+r[n]+"/aether-walker/indoor/sensor";this.options=w({place_id:o.get("place_id"),access_token:o.get("access_token"),env:n,wss_position_url:h,wss_sensor_url:c,get_gps_floor_url:"https://"+r[n]+"/aether-walker/indoor/conf",use_sensor:!1,type:-1,use_gps:!0,use_pdr:!0,upload_position:!0,use_default_permission:!0,ext_position_params:{},ext_sensor_params:{}},e),this.initPositionWebSocket(),this.options.use_sensor&&this.initSensorWebSocket(),this.options.use_pdr&&this.initPdr(),this.options.use_gps&&this.getGpsFloor()}};var IP=require("core-js/modules/web.dom-collections.iterator.js");var En=class extends X{showMyPosition(t,e){var i;let s=(i=this.bmap.context.currentFloor)==null?void 0:i.getGraphicPosition(t);if(s){let o=new Ke(this.bmap.context,{autoUpdate:!0,appendToBody:!1});o.div.appendChild(e),o.position.copy(this.bmap.mercatorToWorld(s)),this.myPositionOverlay=o,console.log("graphicPos",s,this)}else console.warn("[showMyPosition] \u6CA1\u6709\u627E\u5230\u56FE\u5143\u6240\u5728\u7684\u4F4D\u7F6E")}hideMyPosition(){this.myPositionOverlay&&(this.myPositionOverlay.dispose(),this.myPositionOverlay=null)}dispose(){this.hideMyPosition()}constructor(...t){super(...t),this.myPositionOverlay=null}};var Ln=class extends X{highlightPoi(t,e){e===void 0&&(e={icon_size:[40,40],collision_enable:!1}),t.map(s=>this.bmap.getPoiById(s)).filter(s=>!!s).forEach(s=>{var o;(o=s.userData).restore||(o.restore={});for(let h in e)if(h in s.options){var n,r;(n=s.userData.restore)[r=h]||(n[r]=s.options[h]),s.options[h]=e[h]}})}restorePoi(t){t.map(i=>this.bmap.getPoiById(i)).filter(i=>!!i).forEach(i=>{console.log("poi.userData.restore",i.userData.restore);for(let s in i.userData.restore)s in i.options&&(i.options[s]=i.userData.restore[s]);i.userData.restore={}})}};var WP=require("core-js/modules/web.dom-collections.iterator.js"),UP=require("core-js/modules/es.array.sort.js");var Cn=class extends X{sortByDistance(t,e,i){return f(this,null,function*(){i===void 0&&(i=!1);let s=[...e];if(i||e.length<20)return yield Promise.all(s.map(o=>f(this,null,function*(){o.distance=yield this._getDistance(t,{floor:o.floor,x:o.center_x,y:o.center_y})}))),s.sort((o,n)=>o.distance-n.distance);{let o=s.sort((r,h)=>{let c=Math.sqrt((r.center_x-t.x)**2+(r.center_y-t.y)**2)+(t.floor===r.floor?0:100),l=Math.sqrt((h.center_x-t.x)**2+(h.center_y-t.y)**2)+(t.floor===h.floor?0:100);return c-l});return[...(yield Promise.all(o.slice(0,20).map(r=>f(this,null,function*(){return r.distance=yield this._getDistance(t,{floor:r.floor,x:r.center_x,y:r.center_y}),r})))).sort((r,h)=>r.distance-h.distance),...o.slice(20)]}})}_getDistance(t,e){return f(this,null,function*(){return this.navPath.getPath({floor:t.floor,coord:[t.x,t.y]},{floor:e.floor,coord:[e.x,e.y]},"",0).then(i=>i.reduce((s,o,n)=>{if(s+=o.distance,n!==i.length-1)switch(o.endType){case"escalator":case"straightLadder":case"staircase":case"ramp":s+=100;break}return s},0)).catch(i=>i==="near"?0:1/0)})}dispose(){super.dispose(),this.needDisposeNavPath&&this.navPath.dispose()}constructor(t,e){if(super(t),this.needDisposeNavPath=!1,e)this.navPath=e;else{this.navPath=new ys;let i=new qe(t);this.needDisposeNavPath=!0,i.load(t.config.apiPath.loadPlaceInfo+"?place_id="+t.config.placeId+"&env=prod").then(s=>f(this,null,function*(){let[o,n]=yield Promise.all([i.getRoadNetworkData(),i.getFacilitiesData()]);this.navPath.setRoadData(o,n.infrastructures)}))}}};var pc="https://robot-vr-public.bj.bcebos.com/v1/static_resource/satellite_tiles",dc={base_url:pc},Tn=class extends X{setVisible(t){this.tileLayer.setVisibility(t)}dispose(){this.bmap.context.scene.remove(this.tileLayer),this.tileLayer.dispose(),super.dispose()}constructor(t,e){super(t),this.options=w({},dc,e),this.tileLayer=new Re(t.context,this.options),this.tileLayer.position.z=-1,this.bmap.context.scene.add(this.tileLayer)}};var go=require("three");var kn=class extends X{addHeatmap(t,e){this.heatmap||(this.heatmap=new $i(this.bmap.context),this.group.add(this.heatmap)),this.heatmap.loadData(t);let i=new go.Box3().setFromObject(e.graphicLayer);return this.heatmap.position.setZ(i.max.z+.1),this.heatmap}removeHeatMap(){this.heatmap&&(this.group.remove(this.heatmap),this.heatmap.dispose(),this.heatmap=null)}dispose(){this.removeHeatMap(),this.bmap.context.scene.remove(this.group)}constructor(t){super(t),this.heatmap=null,this.group=new go.Group,this.bmap.context.scene.add(this.group)}};
701
+ `};var co=class extends mt.ShaderMaterial{constructor(t){super({type:"ArrowLineMaterial",uniforms:Object.assign({},mt.UniformsUtils.clone(mt.ShaderLib["custom-line"].uniforms),{map:{value:null}}),vertexShader:mt.ShaderLib["custom-line"].vertexShader,fragmentShader:mt.ShaderLib["custom-line"].fragmentShader,clipping:!0}),this.dashed=!1,Object.defineProperties(this,{map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(e){this.uniforms.repeat.value.copy(e)}},allDistance:{enumerable:!0,get:function(){return this.uniforms.allDistance.value},set:function(e){this.uniforms.allDistance.value=e}}}),this.setValues(t),this.isLineMaterial=!0}};var Pa=require("three/examples/jsm/lines/LineGeometry.js"),ba=require("three/examples/jsm/lines/Line2.js");var _a={texture_url:Rs,lineWidth:8,color:16777215},lo=class extends ft.Object3D{registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:i,height:s}}}}}=this,o=t.map(r=>{let[h,c,l]=r;return D(new ft.Vector3(h,c,l),e,i,s)}).map(r=>{let{x:h,y:c}=r;return[h,c]});return Et(o)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new ft.Vector2(t,1)}loadTexture(t){return new Promise((e,i)=>{new ft.TextureLoader().load(t,e,void 0,i)})}transformPoints(t){let e=[];for(let i=0;i<t.length;i++)e.push(...t[i]);return e}updatePoints(t){if(this.points=t,this.mesh){var e,i;this.remove(this.mesh),(e=this.material)==null||e.dispose(),(i=this.geometry)==null||i.dispose()}this.geometry=new Pa.LineGeometry,this.geometry.setPositions(t.flat(2));let s=Et(t.map(r=>{let[h,c]=r;return[h,c]})),o=this.material=new co({color:new ft.Color(this.config.color),transparent:!0,resolution:new ft.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!0,depthWrite:!0,linewidth:this.config.lineWidth,map:this.texture,blending:ft.NormalBlending,repeat:new ft.Vector2(this.getRepeat(),1),allDistance:s}),n=this.mesh=new ba.Line2(this.geometry,o);return n.computeLineDistances(),n.renderOrder=9,this.add(n),n}movePath(t){this.material&&(this.material.thresholdRatio=t)}create(t){return f(this,null,function*(){if(!this.texture){let e=this.texture=yield this.loadTexture(this.config.texture_url);e.wrapS=e.wrapT=ft.RepeatWrapping}return this.updatePoints(t)})}getBoundingBox(){return this.mesh?(this.mesh.geometry.computeBoundingBox(),new ft.Box3().copy(this.mesh.geometry.boundingBox).applyMatrix4(this.mesh.matrixWorld)):null}dispose(){var t,e,i;this.unRegistryEvent(),this.clear(),(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(i=this.texture)==null||i.dispose(),this.navigation=null}constructor(t,e){super(),this.navigation=t,this.mesh=null,this.geometry=null,this.material=null,this.texture=null,this.config=_a,this.points=[],this.basicRepeat=1,this.prevCameraZoom=0,this.onControlChange=()=>{let i=this.navigation.bmap.context.camera.zoom;i!==this.prevCameraZoom&&(this.prevCameraZoom=i,this.changeRepeat())},this.onUpdate=()=>{this.texture},this.onResize=()=>{if(this.material){let{width:i,height:s}=this.navigation.bmap.context.clientSize;this.material.resolution.set(i,s)}},this.config=Object.assign({},_a,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}};var Sa=require("@tweenjs/tween.js");var Zt=require("three"),po=class extends Zt.Object3D{meshSetMaterial(t){t instanceof Zt.Mesh&&(t.material.emissiveIntensity=.5,t.material.shininess=0,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map,t.material.transparent=!0,t.material.depthTest=!1,t.renderOrder=1e6),t.children.forEach(i=>{this.meshSetMaterial(i)})}getBaseScale(t){let{clientSize:{height:e},camera:i}=this.bmap.context,o=(i.top-i.bottom)/i.zoom/e;return this.options.size*o/this.modelMaxLength}registryEvent(){this.bmap.context.addEventListener("update",this._update),this.bmap.context.addEventListener("control-zoom-change",this._onChangeZoom)}unRegistryEvent(){this.bmap.context.removeEventListener("update",this._update),this.bmap.context.removeEventListener("control-zoom-change",this._onChangeZoom)}lookAtCamera(){if(this.model&&this.bmap&&this.bmap.context){let t=this.bmap.context.camera,e=new Zt.Euler;e.setFromQuaternion(t.quaternion,"ZYX"),this.group.rotation.copy(e)}}setClips(t){this.clearClips(),t.length&&(this.mixer=new Zt.AnimationMixer(this.model.scene),t.forEach(e=>this.mixer.clipAction(e).play()))}startClips(){var t;this.setClips(((t=this.model)==null?void 0:t.animations)||[])}clearClips(){this.mixer&&(this.mixer.stopAllAction(),this.mixer.uncacheRoot(this.mixer.getRoot()),this.mixer=null)}dispose(){this.unRegistryEvent(),this.clearClips(),this.clear(),this.model&&I(this.model.scene),this.bmap=null}constructor(t,e,i={}){super(),this.bmap=t,this.group=new Zt.Object3D,this.mixer=null,this.previewTime=0,this.modelMaxLength=0,this.options={size:40},this._update=()=>{let s=Date.now();if(!this.previewTime)this.previewTime=s;else{var o;let n=s-this.previewTime;this.previewTime=s,(o=this.mixer)==null||o.update(n/1e3)}this.lookAtCamera()},this._onChangeZoom=s=>{let{zoom:o}=s;var n;if(!this.model)return;let r=this.getBaseScale(this.model.scene);(n=this.model)==null||n.scene.scale.set(r,r,r)},this.options=w({},this.options,i),this.add(this.group),St.loadModel(e,!1).then(s=>{this.model=s;let n=new Zt.Box3().setFromObject(s.scene).getSize(new Zt.Vector3),r=Math.max(n.x,n.y,n.z);this.modelMaxLength=r;let h=this.getBaseScale(s.scene);s.scene.scale.set(h,h,h),this.meshSetMaterial(s.scene),this.group.add(s.scene),this.setClips(s.animations),this.group.rotation.set(Math.PI/2,Math.PI,0),this.dispatchEvent({type:"loaded"})}),this.registryEvent()}};var uo=require("three");var xn=class extends X{registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate)}pauseAnimation(){this.tweenUtil.pause()}continueAnimation(){this.tweenUtil.continue()}clearTween(){this.tweenUtil.clear(),this.bmap.context.control.enabled=!0}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate)}clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.movedDistance=0,this.clearTween()),this.startModel&&(this.startModel.visible=!1),this.translatePath=null}addPath(t){this.paths=t;let e=t.map(i=>w({},i,{points:this.translatePoints(i.points)}));if(this.clearTween(),this.movedDistance=0,this.bmap.currentBuildGround)this.renderPath(e);else{let i=()=>{this.bmap.removeEventListener("center-change",i),this.renderPath(e)};this.bmap.addEventListener("center-change",i)}this.dispatchEvent({type:"add-path",paths:t})}translatePoints(t){let[e,i]=this.bmap.buildingCenter;return t.map(s=>[s[0]-e,s[1]-i])}renderPath(t){return f(this,null,function*(){if(!t.length)return this.clearPath();let e=[];t.forEach((i,s,o)=>{let n=this.mulFloor.floors.find(r=>r.name===i.floor);e.push(...i.points.map(r=>{let[h,c]=r;return[h,c,n.position.z+n.groundMaxHeight]}))}),this.cPath=e,this.animationPathOptions={cPathIndex:0},this.path?this.path.updatePoints(e):(this.path=new lo(this),yield this.path.create(e),this.path.position.z=.5,this.bmap.context.scene.add(this.path)),this.startModel&&(this.startModel.position.set(e[0][0],e[0][1],e[0][2]),this.startModel.visible=!0),this.dispatchEvent({type:"render-path",path:this.path})})}catmullRomCurve3(t){return Di(t,!1,!0,.1,170,2.5)}getPathDirection(t,e){if(t.length<2)return null;let i=he(t,e),s=t[i],o=t[i+1],n=new uo.Vector3(o[0]-s[0],o[1]-s[1],0).normalize(),r=new uo.Vector3(0,1,0).normalize(),h=n.angleTo(r),c=new uo.Vector3().crossVectors(r,n);return(Object.is(c.y,0)?-1:1)*h}startSimulation(t){return f(this,null,function*(){t===void 0&&(t=1);let{paths:e,movedDistance:i}=this;if(!e.length)return;let s=e.reduce((n,r)=>n+r.distance,0);if(!s||i>=s)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let o=s/t;return this.startModel.startClips(),new Promise(n=>{let r=this.simulationTween=new Sa.Tween({distance:this.movedDistance},this.tweenUtil.group).to({distance:s},o*1e3).onUpdate(h=>{var c;this.movedDistance=h.distance;let l=h.distance,p=0;for(let g=0;g<e.length;g++)if(e[g].distance>=l){p=g;break}else l-=e[g].distance;let d=Ze(e[p].points,l);if(d===null)return;this.currentPathPosition=d;let u=this.translatePoints([d])[0],m=this.mulFloor.floors.find(g=>g.name===e[p].floor),v=m?m.position.z+m.groundMaxHeight:(c=this.startModel)==null?void 0:c.position.z;this.startModel&&this.startModel.position.set(u[0],u[1],v)}).onComplete(()=>{if(this.tweenUtil.remove(r),this.startModel.clearClips(),this.startModel){var h,c,l,p;let d=(l=e.slice(-1)[0])==null||(c=l.points)==null||(h=c.slice(-1))==null?void 0:h[0];if(!d)return;let u=this.mulFloor.floors.find(g=>{var x;return g.name===((x=e.slice(-1)[0])==null?void 0:x.floor)});if(!u)return;let m=u?u.position.z+u.groundMaxHeight:(p=this.startModel)==null?void 0:p.position.z,v=this.translatePoints([d])[0];this.startModel.position.set(v[0],v[1],m)}n(!0)}).start()})})}setStartPoiRotate(t){if(this.startPoi){let i=(this.bmap.context.control.getAzimuthalAngle()*180/Math.PI+360)%360;this.startPoi.options.icon_rotate=(360-t-i)%360}}dispose(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose()),this.startModel&&(this.bmap.context.scene.remove(this.startModel),this.startModel.dispose()),this.tweenUtil.dispose(),this.unRegistryEvent(),super.dispose()}constructor(t,e,i={}){super(t),this.mulFloor=e,this.path=null,this.fetchRoadStatus=!1,this.paths=[],this.curFloorPath=null,this.translatePath=null,this.currentPathPosition=null,this.pathTween=null,this.startPoi=null,this.movedDistance=0,this.tweenUtil=new _e,this.animationPathOptions={cPathIndex:0},this.cPath=[],this.onUpdate=()=>{this.tweenUtil.update()},this.startModel=new po(t,Er,i.startModel),this.startModel.visible=!1,this.bmap.context.scene.add(this.startModel),this.registryEvent()}};var W_=require("core-js/modules/es.array.flat.js"),U_=require("core-js/modules/es.array.unscopables.flat.js"),mo=require("three");var wn=class extends X{registryEvent(){this.clickHelper.addEventListener("click",this._click)}unRegistryEvent(){this.clickHelper.removeEventListener("click",this._click)}dispose(){this.unRegistryEvent(),this.clickHelper.dispose(),this.mulFloors=null,super.dispose()}constructor(t,e){super(t),this.mulFloors=e,this._click=i=>{let{e:s}=i;if(!this.mulFloors.showStatus)return;let o=new mo.Vector2,{offsetX:n,offsetY:r}=s,h=this.mulFloors.floors.map(d=>d.poiLayer2.getPoiByDeviceXy(n,r)).flat(2),{clientSize:c}=this.bmap.context;o.x=n/c.width*2-1,o.y=r/c.height*-2+1;let l=new mo.Raycaster;l.setFromCamera(o,this.bmap.context.camera),l.ray.origin.sub(l.ray.direction.clone().multiplyScalar(1e4));let p=this.mulFloors.floors.map(d=>d.graphicLayer.getGraphicByRaycaster(l).graphics).flat();this.dispatchEvent({type:"select",pois:h,graphics:p})},this.clickHelper=new Ri(this.bmap.context.container),this.registryEvent()}};var $_=require("core-js/modules/es.array.find-last-index.js"),J_=require("core-js/modules/es.array.find-last.js"),Q_=require("core-js/modules/es.array.push.js");var j_=require("core-js/modules/web.dom-collections.iterator.js"),V_=require("core-js/modules/es.array.push.js"),K_=require("core-js/modules/es.array.sort.js"),yi=require("three");function sc(a){let t=a.length,e=0,i=0,s=0,o=0;a.forEach(h=>{e+=h[0],i+=h[1],s+=h[0]*h[1],o+=h[0]*h[0]});let n=(t*s-e*i)/(t*o-e*e),r=(i-n*e)/t;return{m:n,b:r}}function oc(a,t,e){let i=e[0][0],s=e.slice(-1)[0][0],o=a*i+t,n=a*s+t;return{start:[i,o],end:[s,n]}}function Ms(a){if(a.length<2)return null;let t=a.filter((h,c)=>{let l=[...a];return l.splice(c,1),l.every(p=>p[0]!==h[0]&&p[1]!==h[1])});if(t.length<2)return null;let{m:e,b:i}=sc(t),{start:s,end:o}=oc(e,i,t),r=360-(new yi.Vector2().subVectors(new yi.Vector2(o[0],o[1]),new yi.Vector2(s[0],s[1])).angle()/Math.PI*180-90+360)%360;return Number.isNaN(r)?null:r}function nc(a){let t=[];for(let e=1;e<a.length;e++){let i=a[e-1],s=a[e],o=s.position[0]-i.position[0],n=s.position[1]-i.position[1],r=Math.sqrt(o**2+n**2),h=s.time-i.time;if(h>0){let c=r/h;console.log("speedDelta",i.type,s.type,fo(c),r,h),t.push(c)}else t.push(0)}return t}function rc(a,t){let e=a[0],i=a.slice(-1)[0],s=O(i.position,e.position),o=i.time-e.time;return o<100||s<3?null:s/o}function fo(a){return a*60*60}function vi(a,t,e,i){let s=(e+90)%360*(Math.PI/180),o=t*i,n=new yi.Vector2(a[0],a[1]),r=Math.cos(s),h=Math.sin(s),c=new yi.Vector2(r,h);return n.add(c.normalize().multiplyScalar(o)),[n.x,n.y]}function ac(a){let t=[...a].sort((c,l)=>c-l),e=Ea(t,25),i=Ea(t,75),s=i-e,o=e-1.5*s,n=i+1.5*s,r=t.filter(c=>c>=o&&c<=n);return a.filter(c=>r.includes(c))}function Ea(a,t){let e=t/100*(a.length-1),i=Math.floor(e),s=Math.ceil(e);if(i===s)return a[i];let o=e-i;return a[i]*(1-o)+a[s]*o}var _s=require("lodash"),Ps=class extends st{setPathAngle(t){this.pathAngle=t,this.dispatchEvent({type:"change-compass",value:this.pathAngle}),(0,_s.isNil)(this.angle)&&(this.angle=t)}changeSpeed(){let t=this.history.filter(h=>["vision"].includes(h.type));if(t.length<2){this.speedFilter.filter(0),this.speed=0;return}let e=t[0],i=t.slice(-1)[0],s=O(i.position,e.position),o=i.time-e.time,n=o>0?s/o:0,r=this.speedFilter.filter(n);this.speed=r}changeAngle(t){t===void 0&&(t=this.visionHistory),t.length<2&&(this.angle=null);let e=Ms(t.map(i=>i.position));e!==null&&this.setAngle(e)}setAngle(t,e){e===void 0&&(e=!0),this.angle=t,e&&this.dispatchEvent({type:"change-position-compass",value:t})}setPosition(t,e,i){let s={position:t,time:e,clientTime:Date.now()-i,type:"vision"};if(this._setVisionHistoryForAngle(s),(0,_s.isNil)(this.angle)||!this.speed){this.addHistory(s);return}let o=this.history.findLastIndex(r=>r.type==="vision"),n=this.history[o];if(n){if(n.time>e)return;let r=Ms([this.history.slice(-1)[0].position,t]);if(r&&Math.abs(r-this.angle)<60){this.addHistory(s);return}let h=vi(t,this.speed,360-this.pathAngle,i);O(h,this.history.slice(-1)[0].position)>5?this.visionExcessesCount++:this.visionExcessesCount=0,this.visionExcessesCount>3&&(console.warn("\u8FDE\u7EED\u4E09\u6B21\u89C6\u89C9\u548Cpdr\u5DEE\u8DDD\u5927\u4E8E5\u7C73\uFF0C\u4F7F\u7528\u89C6\u89C9\u6821\u51C6"),this.addHistory(s),this.visionExcessesCount=0)}}resetPdrPosition(){let t=this.history.findLast(e=>e.type==="vision");if(t&&this.speed){let e=vi(t.position,this.speed,360-this.pathAngle,Date.now()-t.clientTime);e&&this.history.push({position:e,time:Date.now(),clientTime:Date.now(),type:"pdr"})}}getLastVisionPdrPos(){let t=this.history.findLastIndex(i=>i.type==="vision");if(t!==-1){var e;return(e=this.history[t+1])!=null?e:this.history[t]}return null}_setVisionHistoryForAngle(t){if(!this.visionHistory.length){this.visionHistory.push(t);return}let e=Ms([this.visionHistory.slice(-1)[0].position,t.position]);if(e!==null&&(this.angle&&Math.abs(this.angle-e)>60?this.angleExcessesCount++:(this.angleExcessesCount=0,this.visionHistory.push(t))),this.angleExcessesCount>3)console.warn("\u8FDE\u7EED\u4E09\u6B21\u89D2\u5EA6\u6BD4\u8F83\u6B6A\uFF0C\u91CD\u65B0\u77EB\u6B63"),this.visionHistory=[t],this.angleExcessesCount=0;else{let i=O(this.visionHistory[0].position,this.visionHistory.slice(-1)[0].position);for(;i>5&&this.visionHistory.length>15;)this.visionHistory.shift(),i=O(this.visionHistory[0].position,this.visionHistory.slice(-1)[0].position)}this.changeAngle()}addHistory(t){this.history.push(t);let e=this.history.filter(r=>r.type==="vision"),i=e.length?Date.now()-e.slice(-1)[0].clientTime:0,s=O(this.history[0].position,this.history.slice(-1)[0].position),o=i>5e3?10:3,n=i>5e3?0:5;for(i>5e3&&console.warn("\u89C6\u89C9\u7ED3\u679C\u8D85\u51FA5s\u4E0D\u53EF\u7528\uFF0C\u5168\u90E8\u6E05\u7A7A");e.length>n&&s>o;)this.history.shift(),e=this.history.filter(r=>r.type==="vision"),s=O(this.history[0].position,this.history.slice(-1)[0].position);n===0?this.changeSpeed():t.type==="vision"&&this.changeSpeed(),this.changePosition(t.type)}setBeaconPosition(t,e,i){let s=Date.now()-i,o={position:t,time:e,clientTime:s,type:"beacon"},n=this.history.findLastIndex(l=>l.type!=="pdr"),r=this.history[n];if(!r){this.addHistory(o);return}if((0,_s.isNil)(this.pathAngle)||!this.speed){this.addHistory(o);return}if(r&&r.time>e)return;let h=vi(t,this.speed,360-this.pathAngle,i);O(h,this.history.slice(-1)[0].position)>5?this.beaconExcessesCount++:this.beaconExcessesCount=0,this.beaconExcessesCount>3&&(console.warn("\u8FDE\u7EED\u4E09\u6B21beacon\u548Cpdr\u5DEE\u8DDD\u5927\u4E8E5\u7C73\uFF0C\u4F7F\u7528beacon\u6821\u51C6"),this.addHistory(o),this.beaconExcessesCount=0)}startPositionTimer(){this.positionTimer&&this.timer.clearInterval(this.positionTimer),this.positionTimer=this.timer.setInterval(()=>{this.changePosition()},20)}stopPositionTimer(){this.positionTimer&&(this.timer.clearInterval(this.positionTimer),this.positionTimer=null)}changePosition(t){t===void 0&&(t="pdr");let e=this.getPosition(t);e.success&&(this.history.push({position:e.pos,time:Date.now(),clientTime:Date.now(),type:"pdr"}),this.speed?this.dispatchEvent({type:"change-pos",value:w({},e)}):this.dispatchEvent({type:"change-pos",value:e}))}getPosition(t){if(this.history.length===0)return{success:!1,pos:[0,0],compass:null,speed:0};let e=this.history.slice(-1)[0];if(this.history.length<2)return{success:!0,pos:e.position,compass:this.pathAngle,speed:this.speed};if((0,_s.isNil)(this.pathAngle)||!this.speed)return{success:!0,pos:e.position,compass:this.pathAngle,speed:this.speed};let i=e.clientTime,s=Date.now()-i;return{success:!0,pos:this.pathAngle?vi(e.position,this.speed,360-this.pathAngle,s):e.position,compass:this.pathAngle,speed:fo(this.speed)}}dispose(){this.timer.dispose()}constructor(){super(),this.history=[],this.visionHistory=[],this.speed=0,this.angle=null,this.timer=new j,this.positionTimer=null,this.speedFilter=new Fi,this.visionExcessesCount=0,this.beaconExcessesCount=0,this.angleExcessesCount=0,this.pathAngle=0,this.startPositionTimer()}};var rP=require("core-js/modules/es.json.stringify.js");var hc={};function Mn(){return new Worker(new URL("./worker/recommend.worker-DNMNFDYX.js",hc.url))}var cc={placeId:0,catLotStatusApi:"https://screen.aibee.cn/ai-map/car-park/car-lot-status"},_n=class{setRoadData(t,e){return Z(this.worker,"set_road_info",{roadData:t,facilities:e})}recommend(t){return f(this,null,function*(){let e=yield fetch(this.options.catLotStatusApi,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({place_id:+this.options.placeId})}).then(i=>i.json()).then(i=>i.data.filter(s=>s.status===0)).then(i=>{var s;return i.filter((s=this.options.filterCarLotStatus)!=null?s:()=>!0)});return Z(this.worker,"recommend",w({},t,{carLotStatus:e}))})}dispose(){this.worker.terminate()}constructor(t={}){this.worker=Mn(),this.options=w({},cc,t)}};var yP=require("core-js/modules/es.json.stringify.js"),vP=require("core-js/modules/web.dom-collections.iterator.js"),xP=require("core-js/modules/es.array.sort.js"),wP=require("core-js/modules/es.array.push.js"),MP=require("core-js/modules/es.regexp.exec.js"),_P=require("core-js/modules/web.url-search-params.js"),PP=require("core-js/modules/web.url-search-params.delete.js"),bP=require("core-js/modules/web.url-search-params.has.js"),SP=require("core-js/modules/web.url-search-params.size.js");var dP=require("core-js/modules/es.json.stringify.js");var lc={url:"",reconnect:!0,heartBeat:2e3,heartMsg:JSON.stringify({command:"PING"}),reconnectTime:3e3,reconnectMaxCount:1e6,noMessageTime:6e3},xi=class extends st{initWebsocket(){this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.alive=!0,this.startHeart(),this.startOnMessageTimer(),this.stopReconnect(),this.dispatchEvent({type:"open"})},this.ws.onerror=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect(),this.registryEvent()},this.ws.onclose=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect()},this.ws.onmessage=t=>{this.startOnMessageTimer(),this.dispatchEvent({type:"message",message:t})}}startHeart(){this.stopHeart(),this.heartTimer=this.timer.setInterval(()=>{this.send(this.options.heartMsg)&&this.dispatchEvent({type:"send-heart"})},this.options.heartBeat)}stopHeart(){this.heartTimer&&(this.timer.clearInterval(this.heartTimer),this.heartTimer=null)}startReconnect(t){t===void 0&&(t=this.options.reconnectTime),this.stopReconnect(),this.options.reconnect&&(this.options.reconnectMaxCount--,this.options.reconnectMaxCount>=0&&(this.reconnectTimer=this.timer.setTimeout(()=>{this.initWebsocket()},t)))}stopReconnect(){this.reconnectTimer&&(this.timer.clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}startOnMessageTimer(){this.stopOnMessageTimer(),this.noMessageTimer=this.timer.setTimeout(()=>{var t;(t=this.ws)==null||t.close(),this.dispatchEvent({type:"no-message-timeout"})},this.options.noMessageTime)}stopOnMessageTimer(){this.noMessageTimer&&(this.timer.clearTimeout(this.noMessageTimer),this.noMessageTimer=null)}send(t){var e;let i=typeof t=="string"?t:JSON.stringify(t);return this.alive&&((e=this.ws)==null?void 0:e.readyState)===1?(this.ws.send(i),this.dispatchEvent({type:"send-success",msg:i}),!0):(this.dispatchEvent({type:"send-fail",msg:i}),!1)}registryEvent(){window.addEventListener("online",this.onOnline)}unRegistryEvent(){window.removeEventListener("online",this.onOnline)}close(){var t;this.unRegistryEvent(),this.options.reconnect=!1,this.alive=!1,this.stopHeart(),this.stopReconnect(),this.stopOnMessageTimer(),(t=this.ws)==null||t.close(),this.ws=null,this.dispatchEvent({type:"close"})}dispose(){this.close(),this.timer.dispose(),super.dispose()}constructor(t){super(),this.ws=null,this.alive=!1,this.timer=new j,this.heartTimer=null,this.reconnectTimer=null,this.noMessageTimer=null,this.onOnline=()=>{this.startReconnect()},this.options=w({},lc,t||{}),this.options.url&&this.initWebsocket()}};var bn=require("lodash");var Pn=a=>{let t=a.toString(2),e=""+Array(16-t.length+1).join("0")+t,i=parseInt(e.slice(0,4),2)*10,s=parseInt(e.slice(4,16),2);return[i,s]};var Sn=class extends st{initPositionWebSocket(){let t=w({},this.options.ext_position_params,{place_id:this.options.place_id,token:this.options.access_token}),e=Object.keys(t).filter(i=>!(0,bn.isNil)(t[i])).map(i=>i+"="+t[i]).join("&");this.positionWebSocket=new xi({url:this.options.wss_position_url+"?"+e}),this.positionWebSocket.addEventListener("message",i=>{let{message:s}=i,o=(()=>{try{return JSON.parse(s.data)}catch(U){return s.data}})();if(this.dispatchEvent({type:"ws-message",data:o}),o.command==="POSITION_RESULT"&&o.data.success)if(["POSITION","FLOOR","PARK_POSITION","AOA"].includes(o.data.success_type)&&this.useGpsFloorTimer&&(this.positionFloor=o.data.floor,this.timer.clearTimeout(this.useGpsFloorTimer),this.useGpsFloorTimer=null),o.data.success_type==="AOA"){let{x:U,y:H,time:et,floor:J,ts:ne}=o.data,re=this.positionFloor!==J;if(this.positionFloor=J,this.dispatchEvent({type:"ws-position",floor:J,x:U,y:H,time:et,_type:"aoa"}),this.options.upload_position){var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:U,y:H,floor:J,type:"aoa"}),serverData:JSON.stringify(o)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:J,x:U,y:H,time:new Date(ne).getTime()-o.lag-o.duration});return}if(this.options.type!==1){var r;if(re){var h,c,l;(l=this.pdrPosition)==null||(c=l.pdr)==null||(h=c.particleFilter)==null||h.setPosInitFlag(!1)}(r=this.pdrPosition)==null||r.setBeaconPosition({x:U,y:H},new Date(ne).getTime()-o.lag-o.duration)}else if(re){var p;if(this.resetPdr(),(p=this.carInertialPosition)==null||p.stopPositionTimer(),this.path){let Ee=this.path.findIndex(Mi=>Mi.floor===J),ge=this.path[Ee];if(ge){var d;this.resetPdr(),(d=this.carInertialPosition)==null||d.setBeaconPosition(ge.points[0],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}else{var u;(u=this.carInertialPosition)==null||u.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var m;(m=this.carInertialPosition)==null||m.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var v;(v=this.carInertialPosition)==null||v.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else if(o.data.success_type==="POSITION"){let{x:U,y:H,time:et,floor:J,ts:ne}=o.data,re=this.positionFloor!==J;if(this.positionFloor=J,this.dispatchEvent({type:"ws-position",floor:J,x:U,y:H,time:et,_type:"beacon"}),console.log("positionFloor",J,re),this.options.upload_position){var g;(g=this.positionWebSocket)==null||g.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:U,y:H,floor:J,type:"originBeacon"}),serverData:JSON.stringify(o)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:J,x:U,y:H,time:new Date(ne).getTime()-o.lag-o.duration});return}if(this.options.type!==1){var x;if(re){var M,P,C;(C=this.pdrPosition)==null||(P=C.pdr)==null||(M=P.particleFilter)==null||M.setPosInitFlag(!1)}(x=this.pdrPosition)==null||x.setBeaconPosition({x:U,y:H},new Date(ne).getTime()-o.lag-o.duration)}else if(re){var S;if(this.resetPdr(),(S=this.carInertialPosition)==null||S.stopPositionTimer(),this.path){let Ee=this.path.findIndex(Mi=>Mi.floor===J),ge=this.path[Ee];if(ge){var G;this.resetPdr(),(G=this.carInertialPosition)==null||G.setBeaconPosition(ge.points[0],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}else{var E;(E=this.carInertialPosition)==null||E.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var rt;(rt=this.carInertialPosition)==null||rt.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var Tt;(Tt=this.carInertialPosition)==null||Tt.setBeaconPosition([U,H],new Date(et).getTime()-o.lag-o.duration,o.lag+o.duration)}}else if(o.data.success_type==="PARK_POSITION"&&o.data.success){if(this.options.type===1){let{x:U,y:H,time:et,floor:J}=o.data,ne=this.positionFloor!==J;if(this.positionFloor=o.data.floor,this.dispatchEvent({type:"ws-position",floor:J,x:U,y:H,time:et,_type:"vision"}),!this.options.use_pdr){this.dispatchEvent({type:"position",floor:J,x:U,y:H,time:new Date(et).getTime()});return}if(ne){var gt;if(this.resetPdr(),(gt=this.carInertialPosition)==null||gt.stopPositionTimer(),this.path){let re=this.path.findIndex(ge=>ge.floor===J),Ee=this.path[re];if(Ee){var Ot;this.resetPdr(),(Ot=this.carInertialPosition)==null||Ot.setPosition(Ee.points[0],new Date(et).getTime(),o.duration)}else{var kt;(kt=this.carInertialPosition)==null||kt.setPosition([U,H],new Date(et).getTime(),o.duration)}}else{var oe;(oe=this.carInertialPosition)==null||oe.setPosition([U,H],new Date(et).getTime(),o.duration)}}else{var Se,ct;if((Se=this.carInertialPosition)==null||Se.setPosition([U,H],new Date(et).getTime(),o.duration),!((ct=this.carInertialPosition)!=null&&ct.positionTimer)){var $e;($e=this.carInertialPosition)==null||$e.startPositionTimer()}}if(this.options.upload_position){var wi;(wi=this.positionWebSocket)==null||wi.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:U,y:H,floor:J,type:"vision"}),serverData:JSON.stringify(o)})}}}else this.dispatchEvent({type:"floor",floor:o.data.floor,time:o.data.time})})}initSensorWebSocket(){let t=w({},this.options.ext_sensor_params,{token:this.options.access_token,place_id:this.options.place_id,record_sensor:1}),e=Object.keys(t).filter(i=>!(0,bn.isNil)(t[i])).map(i=>i+"="+t[i]).join("&");this.sensorWebSocket=new xi({url:this.options.wss_sensor_url+"?"+e})}initPdr(){this.options.type===1?(this.carInertialPosition=new Ps,this.carInertialPosition.addEventListener("change-pos",t=>{let{value:e}=t,{pos:i,success:s,speed:o}=e;if(s&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:i[0],y:i[1],time:Date.now(),speed:o}),this.options.upload_position)){var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:i[0],y:i[1],floor:this.positionFloor,type:"vision_pdr"})})}}),this.carInertialPosition.addEventListener("change-compass",t=>{let{value:e}=t;this.dispatchEvent({type:"compass",value:e})})):(this.pdrPosition=new ws(this.bmap,{pdr:{using_gps:this.options.use_gps},sensor:{elements:[F.COMPASS,F.ACCELERATION,F.DEVICE_MOTION].concat(this.options.use_gps?[F.GPS]:[])}}),this.requestDeviceOrientationPermission(),this.options.upload_position&&this.pdrPosition.sensor.addEventListener("sensor-data",t=>{let{data:e}=t;var i;(i=this.positionWebSocket)==null||i.send({command:"UPLOAD_SENSOR",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify(e)})}),this.pdrPosition.sensor.addEventListener("add-data-item",t=>{t.item.type==="compass"&&this.dispatchEvent({type:"compass",value:t.item.res})}),this.pdrPosition.addEventListener("position",t=>{let{x:e,y:i,_type:s}=t;if(console.log("_type",s,e,i,this.positionFloor,this.gpsFloor),s==="gps"&&!this.useGpsFloorTimer){let n=()=>{this.useGpsFloorTimer=this.timer.setTimeout(()=>{this.gpsFloor?this.positionFloor=this.gpsFloor:n()},5e3)};n()}if(this.positionFloor&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:e,y:i,time:Date.now()}),this.options.upload_position)){var o;(o=this.positionWebSocket)==null||o.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:e,y:i,floor:this.positionFloor,type:s})})}}))}setSensor(t){this.pdrPosition&&this.pdrPosition.setSensor(t)}requestDeviceOrientationPermission(){return f(this,null,function*(){if(this.pdrPosition){let t=yield this.pdrPosition.checkSensor();return t.deviceOrientation?this.pdrPosition.start():(this.dispatchEvent(w({type:"check-sensor"},t)),!t.deviceOrientation&&this.options.use_default_permission),t}else return null})}getGpsFloor(){return f(this,null,function*(){if(this.options.use_gps&&this.options.get_gps_floor_url){let t=yield fetch(this.options.get_gps_floor_url+"/"+this.options.place_id).then(e=>e.json());t.code===200&&(this.gpsFloor=t.data.gps_floor)}})}pausePdr(){if(this.options.type===1){var t;(t=this.carInertialPosition)==null||t.stopPositionTimer()}else{var e;(e=this.pdrPosition)==null||e.pause()}}continuePdr(){if(this.options.type===1)this.carInertialPosition&&(this.carInertialPosition.positionTimer||this.carInertialPosition.startPositionTimer());else{var t;(t=this.pdrPosition)==null||t.continue()}}setPathAngle(t){if(this.options.type===1){var e;(e=this.carInertialPosition)==null||e.setPathAngle(t)}}getForwardAngle(){if(this.options.type===1){var t,e;return(e=(t=this.carInertialPosition)==null?void 0:t.angle)!=null?e:null}else return null}resetPdr(){this.carInertialPosition&&(this.carInertialPosition.history=[],this.carInertialPosition.setPathAngle(0),this.carInertialPosition.speed=0),this.pdrPosition&&this.pdrPosition.pdr.particleFilter.setPosInitFlag(!1)}setPath(t){this.path=t}sendBeacon(t){var e;let i=[];if(le)i=t.map(o=>{let[n,r]=Pn(o.major);return[o.uuid,r,o.minor,o.rssi,o.accuracy,n]}).filter(o=>o[3]!==0).sort((o,n)=>n[3]-o[3]);else{let o=t.reduce((n,r)=>{var h,c;let[l,p]=Pn(r.major),d=""+p+r.minor;return(h=n)[c=d]||(h[c]=[]),n[d].push(w({},r,{battery:l,major:p})),n},{});Object.entries(o).forEach(n=>{let[r,h]=n,{uuid:c,major:l,minor:p,accuracy:d,battery:u}=h[0];if(h.length>1){let m=h.filter(g=>g.rssi<0),v=m.reduce((g,x)=>g+x.rssi,0);i.push([c,l,p,v/m.length,d,u])}else i.push([c,l,p,h[0].rssi,d,u])})}let s={command:"POSITION",index:this.uploadIndex++,ts:Date.now(),beacons:JSON.stringify([{type:"ibeacon",timestamp:Date.now()/1e3,res:i}]),ext_sensors:JSON.stringify({})};(e=this.sensorWebSocket)==null||e.send(s)}dispose(){var t,e,i,s;this.timer.dispose(),(t=this.positionWebSocket)==null||t.dispose(),this.positionWebSocket=null,(e=this.sensorWebSocket)==null||e.dispose(),this.sensorWebSocket=null,(i=this.pdrPosition)==null||i.dispose(),this.pdrPosition=null,(s=this.carInertialPosition)==null||s.dispose(),this.carInertialPosition=null,super.dispose()}constructor(t,e){super(),this.bmap=t,this.positionWebSocket=null,this.sensorWebSocket=null,this.pdrPosition=null,this.carInertialPosition=null,this.gpsFloor="",this.positionFloor="",this.useGpsFloorTimer=null,this.uploadIndex=0,this.path=null,this.timer=new j;let i=location.href.indexOf("?"),s=i!==-1?location.href.slice(i):location.search,o=new URLSearchParams(s),n=o.get("server_env")||"prod",r={test:"nav-test.aibee.cn",prod:"nav.aibee.cn"},h="wss://"+r[n]+"/aether-walker/indoor/position",c="wss://"+r[n]+"/aether-walker/indoor/sensor";this.options=w({place_id:o.get("place_id"),access_token:o.get("access_token"),env:n,wss_position_url:h,wss_sensor_url:c,get_gps_floor_url:"https://"+r[n]+"/aether-walker/indoor/conf",use_sensor:!1,type:-1,use_gps:!0,use_pdr:!0,upload_position:!0,use_default_permission:!0,ext_position_params:{},ext_sensor_params:{}},e),this.initPositionWebSocket(),this.options.use_sensor&&this.initSensorWebSocket(),this.options.use_pdr&&this.initPdr(),this.options.use_gps&&this.getGpsFloor()}};var IP=require("core-js/modules/web.dom-collections.iterator.js");var En=class extends X{showMyPosition(t,e){var i;let s=(i=this.bmap.context.currentFloor)==null?void 0:i.getGraphicPosition(t);if(s){let o=new Ke(this.bmap.context,{autoUpdate:!0,appendToBody:!1});o.div.appendChild(e),o.position.copy(this.bmap.mercatorToWorld(s)),this.myPositionOverlay=o,console.log("graphicPos",s,this)}else console.warn("[showMyPosition] \u6CA1\u6709\u627E\u5230\u56FE\u5143\u6240\u5728\u7684\u4F4D\u7F6E")}hideMyPosition(){this.myPositionOverlay&&(this.myPositionOverlay.dispose(),this.myPositionOverlay=null)}dispose(){this.hideMyPosition()}constructor(...t){super(...t),this.myPositionOverlay=null}};var Ln=class extends X{highlightPoi(t,e){e===void 0&&(e={icon_size:[40,40],collision_enable:!1}),t.map(s=>this.bmap.getPoiById(s)).filter(s=>!!s).forEach(s=>{var o;(o=s.userData).restore||(o.restore={});for(let h in e)if(h in s.options){var n,r;(n=s.userData.restore)[r=h]||(n[r]=s.options[h]),s.options[h]=e[h]}})}restorePoi(t){t.map(i=>this.bmap.getPoiById(i)).filter(i=>!!i).forEach(i=>{console.log("poi.userData.restore",i.userData.restore);for(let s in i.userData.restore)s in i.options&&(i.options[s]=i.userData.restore[s]);i.userData.restore={}})}};var WP=require("core-js/modules/web.dom-collections.iterator.js"),UP=require("core-js/modules/es.array.sort.js");var Cn=class extends X{sortByDistance(t,e,i){return f(this,null,function*(){i===void 0&&(i=!1);let s=[...e];if(i||e.length<20)return yield Promise.all(s.map(o=>f(this,null,function*(){o.distance=yield this._getDistance(t,{floor:o.floor,x:o.center_x,y:o.center_y})}))),s.sort((o,n)=>o.distance-n.distance);{let o=s.sort((r,h)=>{let c=Math.sqrt((r.center_x-t.x)**2+(r.center_y-t.y)**2)+(t.floor===r.floor?0:100),l=Math.sqrt((h.center_x-t.x)**2+(h.center_y-t.y)**2)+(t.floor===h.floor?0:100);return c-l});return[...(yield Promise.all(o.slice(0,20).map(r=>f(this,null,function*(){return r.distance=yield this._getDistance(t,{floor:r.floor,x:r.center_x,y:r.center_y}),r})))).sort((r,h)=>r.distance-h.distance),...o.slice(20)]}})}_getDistance(t,e){return f(this,null,function*(){return this.navPath.getPath({floor:t.floor,coord:[t.x,t.y]},{floor:e.floor,coord:[e.x,e.y]},"",0).then(i=>i.reduce((s,o,n)=>{if(s+=o.distance,n!==i.length-1)switch(o.endType){case"escalator":case"straightLadder":case"staircase":case"ramp":s+=100;break}return s},0)).catch(i=>i==="near"?0:1/0)})}dispose(){super.dispose(),this.needDisposeNavPath&&this.navPath.dispose()}constructor(t,e){if(super(t),this.needDisposeNavPath=!1,e)this.navPath=e;else{this.navPath=new ys;let i=new qe(t);this.needDisposeNavPath=!0,i.load(t.config.apiPath.loadPlaceInfo+"?place_id="+t.config.placeId+"&env=prod").then(s=>f(this,null,function*(){let[o,n]=yield Promise.all([i.getRoadNetworkData(),i.getFacilitiesData()]);this.navPath.setRoadData(o,n.infrastructures)}))}}};var pc="https://robot-vr-public.bj.bcebos.com/v1/static_resource/satellite_tiles",dc={base_url:pc},Tn=class extends X{setVisible(t){this.tileLayer.setVisibility(t)}dispose(){this.bmap.context.scene.remove(this.tileLayer),this.tileLayer.dispose(),super.dispose()}constructor(t,e){super(t),this.options=w({},dc,e),this.tileLayer=new Re(t.context,this.options),this.tileLayer.position.z=-1,this.bmap.context.scene.add(this.tileLayer)}};var go=require("three");var kn=class extends X{addHeatmap(t,e){this.heatmap||(this.heatmap=new $i(this.bmap.context),this.group.add(this.heatmap)),this.heatmap.loadData(t);let i=new go.Box3().setFromObject(e.graphicLayer);return this.heatmap.position.setZ(i.max.z+.1),this.heatmap}removeHeatMap(){this.heatmap&&(this.group.remove(this.heatmap),this.heatmap.dispose(),this.heatmap=null)}dispose(){this.removeHeatMap(),this.bmap.context.scene.remove(this.group)}constructor(t){super(t),this.heatmap=null,this.group=new go.Group,this.bmap.context.scene.add(this.group)}};
@@ -698,4 +698,4 @@ var ha=Object.create;var Fs=Object.defineProperty;var ca=Object.getOwnPropertyDe
698
698
  float uvx = prevUv + (vUv.y + 1.0) / 2.0 * vCustomUv;
699
699
  gl_FragColor = diffuseColor * texture2D(map, vec2(uvx, (vUv.x + 1.0) / 2.0) * repeat);
700
700
  }
701
- `};var Cs=class extends Cd{constructor(t){super({type:"ArrowLineMaterial",uniforms:Object.assign({},Fr.clone(Es["custom-line"].uniforms),{map:{value:null}}),vertexShader:Es["custom-line"].vertexShader,fragmentShader:Es["custom-line"].fragmentShader,clipping:!0}),this.dashed=!1,Object.defineProperties(this,{map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(e){this.uniforms.repeat.value.copy(e)}},allDistance:{enumerable:!0,get:function(){return this.uniforms.allDistance.value},set:function(e){this.uniforms.allDistance.value=e}}}),this.setValues(t),this.isLineMaterial=!0}};import{LineGeometry as Gd}from"three/examples/jsm/lines/LineGeometry.js";import{Line2 as Fd}from"three/examples/jsm/lines/Line2.js";var zr={texture_url:bi,lineWidth:8,color:16777215},Ts=class extends Td{registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:i,height:s}}}}}=this,o=t.map(r=>{let[h,c,l]=r;return C(new Ad(h,c,l),e,i,s)}).map(r=>{let{x:h,y:c}=r;return[h,c]});return ht(o)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new So(t,1)}loadTexture(t){return new Promise((e,i)=>{new kd().load(t,e,void 0,i)})}transformPoints(t){let e=[];for(let i=0;i<t.length;i++)e.push(...t[i]);return e}updatePoints(t){if(this.points=t,this.mesh){var e,i;this.remove(this.mesh),(e=this.material)==null||e.dispose(),(i=this.geometry)==null||i.dispose()}this.geometry=new Gd,this.geometry.setPositions(t.flat(2));let s=ht(t.map(r=>{let[h,c]=r;return[h,c]})),o=this.material=new Cs({color:new Dd(this.config.color),transparent:!0,resolution:new So(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!0,depthWrite:!0,linewidth:this.config.lineWidth,map:this.texture,blending:Od,repeat:new So(this.getRepeat(),1),allDistance:s}),n=this.mesh=new Fd(this.geometry,o);return n.computeLineDistances(),n.renderOrder=9,this.add(n),n}movePath(t){this.material&&(this.material.thresholdRatio=t)}create(t){return f(this,null,function*(){if(!this.texture){let e=this.texture=yield this.loadTexture(this.config.texture_url);e.wrapS=e.wrapT=Id}return this.updatePoints(t)})}getBoundingBox(){return this.mesh?(this.mesh.geometry.computeBoundingBox(),new Rd().copy(this.mesh.geometry.boundingBox).applyMatrix4(this.mesh.matrixWorld)):null}dispose(){var t,e,i;this.unRegistryEvent(),this.clear(),(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(i=this.texture)==null||i.dispose(),this.navigation=null}constructor(t,e){super(),this.navigation=t,this.mesh=null,this.geometry=null,this.material=null,this.texture=null,this.config=zr,this.points=[],this.basicRepeat=1,this.prevCameraZoom=0,this.onControlChange=()=>{let i=this.navigation.bmap.context.camera.zoom;i!==this.prevCameraZoom&&(this.prevCameraZoom=i,this.changeRepeat())},this.onUpdate=()=>{this.texture},this.onResize=()=>{if(this.material){let{width:i,height:s}=this.navigation.bmap.context.clientSize;this.material.resolution.set(i,s)}},this.config=Object.assign({},zr,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}};import{Tween as Nd}from"@tweenjs/tween.js";import{AnimationMixer as zd,Box3 as Bd,Object3D as Br,Vector3 as Wd,Mesh as Ud,Euler as Hd}from"three";var ks=class extends Br{meshSetMaterial(t){t instanceof Ud&&(t.material.emissiveIntensity=.5,t.material.shininess=0,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map,t.material.transparent=!0,t.material.depthTest=!1,t.renderOrder=1e6),t.children.forEach(i=>{this.meshSetMaterial(i)})}getBaseScale(t){let{clientSize:{height:e},camera:i}=this.bmap.context,o=(i.top-i.bottom)/i.zoom/e;return this.options.size*o/this.modelMaxLength}registryEvent(){this.bmap.context.addEventListener("update",this._update),this.bmap.context.addEventListener("control-zoom-change",this._onChangeZoom)}unRegistryEvent(){this.bmap.context.removeEventListener("update",this._update),this.bmap.context.removeEventListener("control-zoom-change",this._onChangeZoom)}lookAtCamera(){if(this.model&&this.bmap&&this.bmap.context){let t=this.bmap.context.camera,e=new Hd;e.setFromQuaternion(t.quaternion,"ZYX"),this.group.rotation.copy(e)}}setClips(t){this.clearClips(),t.length&&(this.mixer=new zd(this.model.scene),t.forEach(e=>this.mixer.clipAction(e).play()))}startClips(){var t;this.setClips(((t=this.model)==null?void 0:t.animations)||[])}clearClips(){this.mixer&&(this.mixer.stopAllAction(),this.mixer.uncacheRoot(this.mixer.getRoot()),this.mixer=null)}dispose(){this.unRegistryEvent(),this.clearClips(),this.clear(),this.model&&D(this.model.scene),this.bmap=null}constructor(t,e,i={}){super(),this.bmap=t,this.group=new Br,this.mixer=null,this.previewTime=0,this.modelMaxLength=0,this.options={size:40},this._update=()=>{let s=Date.now();if(!this.previewTime)this.previewTime=s;else{var o;let n=s-this.previewTime;this.previewTime=s,(o=this.mixer)==null||o.update(n/1e3)}this.lookAtCamera()},this._onChangeZoom=s=>{let{zoom:o}=s;var n;if(!this.model)return;let r=this.getBaseScale(this.model.scene);(n=this.model)==null||n.scene.scale.set(r,r,r)},this.options=w({},this.options,i),this.add(this.group),st.loadModel(e,!1).then(s=>{this.model=s;let n=new Bd().setFromObject(s.scene).getSize(new Wd),r=Math.max(n.x,n.y,n.z);this.modelMaxLength=r;let h=this.getBaseScale(s.scene);s.scene.scale.set(h,h,h),this.meshSetMaterial(s.scene),this.group.add(s.scene),this.setClips(s.animations),this.group.rotation.set(Math.PI/2,Math.PI,0),this.dispatchEvent({type:"loaded"})}),this.registryEvent()}};import{Vector3 as Eo}from"three";var Wr=class extends B{registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate)}pauseAnimation(){this.tweenUtil.pause()}continueAnimation(){this.tweenUtil.continue()}clearTween(){this.tweenUtil.clear(),this.bmap.context.control.enabled=!0}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate)}clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.movedDistance=0,this.clearTween()),this.startModel&&(this.startModel.visible=!1),this.translatePath=null}addPath(t){this.paths=t;let e=t.map(i=>w({},i,{points:this.translatePoints(i.points)}));if(this.clearTween(),this.movedDistance=0,this.bmap.currentBuildGround)this.renderPath(e);else{let i=()=>{this.bmap.removeEventListener("center-change",i),this.renderPath(e)};this.bmap.addEventListener("center-change",i)}this.dispatchEvent({type:"add-path",paths:t})}translatePoints(t){let[e,i]=this.bmap.buildingCenter;return t.map(s=>[s[0]-e,s[1]-i])}renderPath(t){return f(this,null,function*(){if(!t.length)return this.clearPath();let e=[];t.forEach((i,s,o)=>{let n=this.mulFloor.floors.find(r=>r.name===i.floor);e.push(...i.points.map(r=>{let[h,c]=r;return[h,c,n.position.z+n.groundMaxHeight]}))}),this.cPath=e,this.animationPathOptions={cPathIndex:0},this.path?this.path.updatePoints(e):(this.path=new Ts(this),yield this.path.create(e),this.path.position.z=.5,this.bmap.context.scene.add(this.path)),this.startModel&&(this.startModel.position.set(e[0][0],e[0][1],e[0][2]),this.startModel.visible=!0),this.dispatchEvent({type:"render-path",path:this.path})})}catmullRomCurve3(t){return mi(t,!1,!0,.1,170,2.5)}getPathDirection(t,e){if(t.length<2)return null;let i=Bt(t,e),s=t[i],o=t[i+1],n=new Eo(o[0]-s[0],o[1]-s[1],0).normalize(),r=new Eo(0,1,0).normalize(),h=n.angleTo(r),c=new Eo().crossVectors(r,n);return(Object.is(c.y,0)?-1:1)*h}startSimulation(t){return f(this,null,function*(){t===void 0&&(t=1);let{paths:e,movedDistance:i}=this;if(!e.length)return;let s=e.reduce((n,r)=>n+r.distance,0);if(!s||i>=s)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let o=s/t;return this.startModel.startClips(),new Promise(n=>{let r=this.simulationTween=new Nd({distance:this.movedDistance},this.tweenUtil.group).to({distance:s},o*1e3).onUpdate(h=>{var c;this.movedDistance=h.distance;let l=h.distance,p=0;for(let g=0;g<e.length;g++)if(e[g].distance>=l){p=g;break}else l-=e[g].distance;let d=ve(e[p].points,l);if(d===null)return;this.currentPathPosition=d;let u=this.translatePoints([d])[0],m=this.mulFloor.floors.find(g=>g.name===e[p].floor),v=m?m.position.z+m.groundMaxHeight:(c=this.startModel)==null?void 0:c.position.z;this.startModel&&this.startModel.position.set(u[0],u[1],v)}).onComplete(()=>{if(this.tweenUtil.remove(r),this.startModel.clearClips(),this.startModel){var h,c,l,p;let d=(l=e.slice(-1)[0])==null||(c=l.points)==null||(h=c.slice(-1))==null?void 0:h[0];if(!d)return;let u=this.mulFloor.floors.find(g=>{var x;return g.name===((x=e.slice(-1)[0])==null?void 0:x.floor)});if(!u)return;let m=u?u.position.z+u.groundMaxHeight:(p=this.startModel)==null?void 0:p.position.z,v=this.translatePoints([d])[0];this.startModel.position.set(v[0],v[1],m)}n(!0)}).start()})})}setStartPoiRotate(t){if(this.startPoi){let i=(this.bmap.context.control.getAzimuthalAngle()*180/Math.PI+360)%360;this.startPoi.options.icon_rotate=(360-t-i)%360}}dispose(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose()),this.startModel&&(this.bmap.context.scene.remove(this.startModel),this.startModel.dispose()),this.tweenUtil.dispose(),this.unRegistryEvent(),super.dispose()}constructor(t,e,i={}){super(t),this.mulFloor=e,this.path=null,this.fetchRoadStatus=!1,this.paths=[],this.curFloorPath=null,this.translatePath=null,this.currentPathPosition=null,this.pathTween=null,this.startPoi=null,this.movedDistance=0,this.tweenUtil=new Qt,this.animationPathOptions={cPathIndex:0},this.cPath=[],this.onUpdate=()=>{this.tweenUtil.update()},this.startModel=new ks(t,An,i.startModel),this.startModel.visible=!1,this.bmap.context.scene.add(this.startModel),this.registryEvent()}};import"core-js/modules/es.array.flat.js";import"core-js/modules/es.array.unscopables.flat.js";import{Raycaster as Zd,Vector2 as jd}from"three";var Ur=class extends B{registryEvent(){this.clickHelper.addEventListener("click",this._click)}unRegistryEvent(){this.clickHelper.removeEventListener("click",this._click)}dispose(){this.unRegistryEvent(),this.clickHelper.dispose(),this.mulFloors=null,super.dispose()}constructor(t,e){super(t),this.mulFloors=e,this._click=i=>{let{e:s}=i;if(!this.mulFloors.showStatus)return;let o=new jd,{offsetX:n,offsetY:r}=s,h=this.mulFloors.floors.map(d=>d.poiLayer2.getPoiByDeviceXy(n,r)).flat(2),{clientSize:c}=this.bmap.context;o.x=n/c.width*2-1,o.y=r/c.height*-2+1;let l=new Zd;l.setFromCamera(o,this.bmap.context.camera),l.ray.origin.sub(l.ray.direction.clone().multiplyScalar(1e4));let p=this.mulFloors.floors.map(d=>d.graphicLayer.getGraphicByRaycaster(l).graphics).flat();this.dispatchEvent({type:"select",pois:h,graphics:p})},this.clickHelper=new vi(this.bmap.context.container),this.registryEvent()}};import"core-js/modules/es.array.find-last-index.js";import"core-js/modules/es.array.find-last.js";import"core-js/modules/es.array.push.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.push.js";import"core-js/modules/es.array.sort.js";import{Vector2 as si}from"three";function Vd(a){let t=a.length,e=0,i=0,s=0,o=0;a.forEach(h=>{e+=h[0],i+=h[1],s+=h[0]*h[1],o+=h[0]*h[0]});let n=(t*s-e*i)/(t*o-e*e),r=(i-n*e)/t;return{m:n,b:r}}function Kd(a,t,e){let i=e[0][0],s=e.slice(-1)[0][0],o=a*i+t,n=a*s+t;return{start:[i,o],end:[s,n]}}function Ds(a){if(a.length<2)return null;let t=a.filter((h,c)=>{let l=[...a];return l.splice(c,1),l.every(p=>p[0]!==h[0]&&p[1]!==h[1])});if(t.length<2)return null;let{m:e,b:i}=Vd(t),{start:s,end:o}=Kd(e,i,t),r=360-(new si().subVectors(new si(o[0],o[1]),new si(s[0],s[1])).angle()/Math.PI*180-90+360)%360;return Number.isNaN(r)?null:r}function mC(a){let t=[];for(let e=1;e<a.length;e++){let i=a[e-1],s=a[e],o=s.position[0]-i.position[0],n=s.position[1]-i.position[1],r=Math.sqrt(o**2+n**2),h=s.time-i.time;if(h>0){let c=r/h;console.log("speedDelta",i.type,s.type,Lo(c),r,h),t.push(c)}else t.push(0)}return t}function fC(a,t){let e=a[0],i=a.slice(-1)[0],s=k(i.position,e.position),o=i.time-e.time;return o<100||s<3?null:s/o}function Lo(a){return a*60*60}function oi(a,t,e,i){let s=(e+90)%360*(Math.PI/180),o=t*i,n=new si(a[0],a[1]),r=Math.cos(s),h=Math.sin(s),c=new si(r,h);return n.add(c.normalize().multiplyScalar(o)),[n.x,n.y]}function gC(a){let t=[...a].sort((c,l)=>c-l),e=Hr(t,25),i=Hr(t,75),s=i-e,o=e-1.5*s,n=i+1.5*s,r=t.filter(c=>c>=o&&c<=n);return a.filter(c=>r.includes(c))}function Hr(a,t){let e=t/100*(a.length-1),i=Math.floor(e),s=Math.ceil(e);if(i===s)return a[i];let o=e-i;return a[i]*(1-o)+a[s]*o}import{isNil as As}from"lodash";var Os=class extends X{setPathAngle(t){this.pathAngle=t,this.dispatchEvent({type:"change-compass",value:this.pathAngle}),As(this.angle)&&(this.angle=t)}changeSpeed(){let t=this.history.filter(h=>["vision"].includes(h.type));if(t.length<2){this.speedFilter.filter(0),this.speed=0;return}let e=t[0],i=t.slice(-1)[0],s=k(i.position,e.position),o=i.time-e.time,n=o>0?s/o:0,r=this.speedFilter.filter(n);this.speed=r}changeAngle(t){t===void 0&&(t=this.visionHistory),t.length<2&&(this.angle=null);let e=Ds(t.map(i=>i.position));e!==null&&this.setAngle(e)}setAngle(t,e){e===void 0&&(e=!0),this.angle=t,e&&this.dispatchEvent({type:"change-position-compass",value:t})}setPosition(t,e,i){let s={position:t,time:e,clientTime:Date.now()-i,type:"vision"};if(this._setVisionHistoryForAngle(s),As(this.angle)||!this.speed){this.addHistory(s);return}let o=this.history.findLastIndex(r=>r.type==="vision"),n=this.history[o];if(n){if(n.time>e)return;let r=Ds([this.history.slice(-1)[0].position,t]);if(r&&Math.abs(r-this.angle)<60){this.addHistory(s);return}let h=oi(t,this.speed,360-this.pathAngle,i);k(h,this.history.slice(-1)[0].position)>5?this.visionExcessesCount++:this.visionExcessesCount=0,this.visionExcessesCount>3&&(console.warn("\u8FDE\u7EED\u4E09\u6B21\u89C6\u89C9\u548Cpdr\u5DEE\u8DDD\u5927\u4E8E5\u7C73\uFF0C\u4F7F\u7528\u89C6\u89C9\u6821\u51C6"),this.addHistory(s),this.visionExcessesCount=0)}}resetPdrPosition(){let t=this.history.findLast(e=>e.type==="vision");if(t&&this.speed){let e=oi(t.position,this.speed,360-this.pathAngle,Date.now()-t.clientTime);e&&this.history.push({position:e,time:Date.now(),clientTime:Date.now(),type:"pdr"})}}getLastVisionPdrPos(){let t=this.history.findLastIndex(i=>i.type==="vision");if(t!==-1){var e;return(e=this.history[t+1])!=null?e:this.history[t]}return null}_setVisionHistoryForAngle(t){if(!this.visionHistory.length){this.visionHistory.push(t);return}let e=Ds([this.visionHistory.slice(-1)[0].position,t.position]);if(e!==null&&(this.angle&&Math.abs(this.angle-e)>60?this.angleExcessesCount++:(this.angleExcessesCount=0,this.visionHistory.push(t))),this.angleExcessesCount>3)console.warn("\u8FDE\u7EED\u4E09\u6B21\u89D2\u5EA6\u6BD4\u8F83\u6B6A\uFF0C\u91CD\u65B0\u77EB\u6B63"),this.visionHistory=[t],this.angleExcessesCount=0;else{let i=k(this.visionHistory[0].position,this.visionHistory.slice(-1)[0].position);for(;i>5&&this.visionHistory.length>15;)this.visionHistory.shift(),i=k(this.visionHistory[0].position,this.visionHistory.slice(-1)[0].position)}this.changeAngle()}addHistory(t){this.history.push(t);let e=this.history.filter(r=>r.type==="vision"),i=e.length?Date.now()-e.slice(-1)[0].clientTime:0,s=k(this.history[0].position,this.history.slice(-1)[0].position),o=i>5e3?10:3,n=i>5e3?0:5;for(i>5e3&&console.warn("\u89C6\u89C9\u7ED3\u679C\u8D85\u51FA5s\u4E0D\u53EF\u7528\uFF0C\u5168\u90E8\u6E05\u7A7A");e.length>n&&s>o;)this.history.shift(),e=this.history.filter(r=>r.type==="vision"),s=k(this.history[0].position,this.history.slice(-1)[0].position);n===0?this.changeSpeed():t.type==="vision"&&this.changeSpeed(),this.changePosition(t.type)}setBeaconPosition(t,e,i){let s=Date.now()-i,o={position:t,time:e,clientTime:s,type:"beacon"},n=this.history.findLastIndex(l=>l.type!=="pdr"),r=this.history[n];if(!r){this.addHistory(o);return}if(As(this.pathAngle)||!this.speed){this.addHistory(o);return}if(r&&r.time>e)return;let h=oi(t,this.speed,360-this.pathAngle,i);k(h,this.history.slice(-1)[0].position)>5?this.beaconExcessesCount++:this.beaconExcessesCount=0,this.beaconExcessesCount>3&&(console.warn("\u8FDE\u7EED\u4E09\u6B21beacon\u548Cpdr\u5DEE\u8DDD\u5927\u4E8E5\u7C73\uFF0C\u4F7F\u7528beacon\u6821\u51C6"),this.addHistory(o),this.beaconExcessesCount=0)}startPositionTimer(){this.positionTimer&&this.timer.clearInterval(this.positionTimer),this.positionTimer=this.timer.setInterval(()=>{this.changePosition()},20)}stopPositionTimer(){this.positionTimer&&(this.timer.clearInterval(this.positionTimer),this.positionTimer=null)}changePosition(t){t===void 0&&(t="pdr");let e=this.getPosition(t);e.success&&(this.history.push({position:e.pos,time:Date.now(),clientTime:Date.now(),type:"pdr"}),this.speed?this.dispatchEvent({type:"change-pos",value:w({},e)}):this.dispatchEvent({type:"change-pos",value:e}))}getPosition(t){if(this.history.length===0)return{success:!1,pos:[0,0],compass:null,speed:0};let e=this.history.slice(-1)[0];if(this.history.length<2)return{success:!0,pos:e.position,compass:this.pathAngle,speed:this.speed};if(As(this.pathAngle)||!this.speed)return{success:!0,pos:e.position,compass:this.pathAngle,speed:this.speed};let i=e.clientTime,s=Date.now()-i;return{success:!0,pos:this.pathAngle?oi(e.position,this.speed,360-this.pathAngle,s):e.position,compass:this.pathAngle,speed:Lo(this.speed)}}dispose(){this.timer.dispose()}constructor(){super(),this.history=[],this.visionHistory=[],this.speed=0,this.angle=null,this.timer=new z,this.positionTimer=null,this.speedFilter=new wi,this.visionExcessesCount=0,this.beaconExcessesCount=0,this.angleExcessesCount=0,this.pathAngle=0,this.startPositionTimer()}};import"core-js/modules/es.json.stringify.js";function Co(){return new Worker(new URL("./worker/recommend.worker-DNMNFDYX.js",import.meta.url))}var Xd={placeId:0,catLotStatusApi:"https://vrapi.aibee.cn/parking/cat-lot-status"},Nr=class{setRoadData(t,e){return F(this.worker,"set_road_info",{roadData:t,facilities:e})}recommend(t){return f(this,null,function*(){let e=yield fetch(this.options.catLotStatusApi,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({place_id:+this.options.placeId})}).then(i=>i.json()).then(i=>i.data.filter(s=>s.status===0)).then(i=>{var s;return i.filter((s=this.options.filterCarLotStatus)!=null?s:()=>!0)});return F(this.worker,"recommend",w({},t,{carLotStatus:e}))})}dispose(){this.worker.terminate()}constructor(t={}){this.worker=Co(),this.options=w({},Xd,t)}};import"core-js/modules/es.json.stringify.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.sort.js";import"core-js/modules/es.array.push.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/web.url-search-params.js";import"core-js/modules/web.url-search-params.delete.js";import"core-js/modules/web.url-search-params.has.js";import"core-js/modules/web.url-search-params.size.js";import"core-js/modules/es.json.stringify.js";var Yd={url:"",reconnect:!0,heartBeat:2e3,heartMsg:JSON.stringify({command:"PING"}),reconnectTime:3e3,reconnectMaxCount:1e6,noMessageTime:6e3},ni=class extends X{initWebsocket(){this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.alive=!0,this.startHeart(),this.startOnMessageTimer(),this.stopReconnect(),this.dispatchEvent({type:"open"})},this.ws.onerror=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect(),this.registryEvent()},this.ws.onclose=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect()},this.ws.onmessage=t=>{this.startOnMessageTimer(),this.dispatchEvent({type:"message",message:t})}}startHeart(){this.stopHeart(),this.heartTimer=this.timer.setInterval(()=>{this.send(this.options.heartMsg)&&this.dispatchEvent({type:"send-heart"})},this.options.heartBeat)}stopHeart(){this.heartTimer&&(this.timer.clearInterval(this.heartTimer),this.heartTimer=null)}startReconnect(t){t===void 0&&(t=this.options.reconnectTime),this.stopReconnect(),this.options.reconnect&&(this.options.reconnectMaxCount--,this.options.reconnectMaxCount>=0&&(this.reconnectTimer=this.timer.setTimeout(()=>{this.initWebsocket()},t)))}stopReconnect(){this.reconnectTimer&&(this.timer.clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}startOnMessageTimer(){this.stopOnMessageTimer(),this.noMessageTimer=this.timer.setTimeout(()=>{var t;(t=this.ws)==null||t.close(),this.dispatchEvent({type:"no-message-timeout"})},this.options.noMessageTime)}stopOnMessageTimer(){this.noMessageTimer&&(this.timer.clearTimeout(this.noMessageTimer),this.noMessageTimer=null)}send(t){var e;let i=typeof t=="string"?t:JSON.stringify(t);return this.alive&&((e=this.ws)==null?void 0:e.readyState)===1?(this.ws.send(i),this.dispatchEvent({type:"send-success",msg:i}),!0):(this.dispatchEvent({type:"send-fail",msg:i}),!1)}registryEvent(){window.addEventListener("online",this.onOnline)}unRegistryEvent(){window.removeEventListener("online",this.onOnline)}close(){var t;this.unRegistryEvent(),this.options.reconnect=!1,this.alive=!1,this.stopHeart(),this.stopReconnect(),this.stopOnMessageTimer(),(t=this.ws)==null||t.close(),this.ws=null,this.dispatchEvent({type:"close"})}dispose(){this.close(),this.timer.dispose(),super.dispose()}constructor(t){super(),this.ws=null,this.alive=!1,this.timer=new z,this.heartTimer=null,this.reconnectTimer=null,this.noMessageTimer=null,this.onOnline=()=>{this.startReconnect()},this.options=w({},Yd,t||{}),this.options.url&&this.initWebsocket()}};import{isNil as Zr}from"lodash";var To=a=>{let t=a.toString(2),e=""+Array(16-t.length+1).join("0")+t,i=parseInt(e.slice(0,4),2)*10,s=parseInt(e.slice(4,16),2);return[i,s]};var jr=class extends X{initPositionWebSocket(){let t=w({},this.options.ext_position_params,{place_id:this.options.place_id,token:this.options.access_token}),e=Object.keys(t).filter(i=>!Zr(t[i])).map(i=>i+"="+t[i]).join("&");this.positionWebSocket=new ni({url:this.options.wss_position_url+"?"+e}),this.positionWebSocket.addEventListener("message",i=>{let{message:s}=i,o=(()=>{try{return JSON.parse(s.data)}catch(I){return s.data}})();if(this.dispatchEvent({type:"ws-message",data:o}),o.command==="POSITION_RESULT"&&o.data.success)if(["POSITION","FLOOR","PARK_POSITION","AOA"].includes(o.data.success_type)&&this.useGpsFloorTimer&&(this.positionFloor=o.data.floor,this.timer.clearTimeout(this.useGpsFloorTimer),this.useGpsFloorTimer=null),o.data.success_type==="AOA"){let{x:I,y:R,time:N,floor:W,ts:Et}=o.data,Lt=this.positionFloor!==W;if(this.positionFloor=W,this.dispatchEvent({type:"ws-position",floor:W,x:I,y:R,time:N,_type:"aoa"}),this.options.upload_position){var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:I,y:R,floor:W,type:"aoa"}),serverData:JSON.stringify(o)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:W,x:I,y:R,time:new Date(Et).getTime()-o.lag-o.duration});return}if(this.options.type!==1){var r;if(Lt){var h,c,l;(l=this.pdrPosition)==null||(c=l.pdr)==null||(h=c.particleFilter)==null||h.setPosInitFlag(!1)}(r=this.pdrPosition)==null||r.setBeaconPosition({x:I,y:R},new Date(Et).getTime()-o.lag-o.duration)}else if(Lt){var p;if(this.resetPdr(),(p=this.carInertialPosition)==null||p.stopPositionTimer(),this.path){let Xt=this.path.findIndex(Fe=>Fe.floor===W),It=this.path[Xt];if(It){var d;this.resetPdr(),(d=this.carInertialPosition)==null||d.setBeaconPosition(It.points[0],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}else{var u;(u=this.carInertialPosition)==null||u.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var m;(m=this.carInertialPosition)==null||m.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var v;(v=this.carInertialPosition)==null||v.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else if(o.data.success_type==="POSITION"){let{x:I,y:R,time:N,floor:W,ts:Et}=o.data,Lt=this.positionFloor!==W;if(this.positionFloor=W,this.dispatchEvent({type:"ws-position",floor:W,x:I,y:R,time:N,_type:"beacon"}),console.log("positionFloor",W,Lt),this.options.upload_position){var g;(g=this.positionWebSocket)==null||g.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:I,y:R,floor:W,type:"originBeacon"}),serverData:JSON.stringify(o)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:W,x:I,y:R,time:new Date(Et).getTime()-o.lag-o.duration});return}if(this.options.type!==1){var x;if(Lt){var M,P,E;(E=this.pdrPosition)==null||(P=E.pdr)==null||(M=P.particleFilter)==null||M.setPosInitFlag(!1)}(x=this.pdrPosition)==null||x.setBeaconPosition({x:I,y:R},new Date(Et).getTime()-o.lag-o.duration)}else if(Lt){var b;if(this.resetPdr(),(b=this.carInertialPosition)==null||b.stopPositionTimer(),this.path){let Xt=this.path.findIndex(Fe=>Fe.floor===W),It=this.path[Xt];if(It){var A;this.resetPdr(),(A=this.carInertialPosition)==null||A.setBeaconPosition(It.points[0],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}else{var S;(S=this.carInertialPosition)==null||S.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var V;(V=this.carInertialPosition)==null||V.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var rt;(rt=this.carInertialPosition)==null||rt.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else if(o.data.success_type==="PARK_POSITION"&&o.data.success){if(this.options.type===1){let{x:I,y:R,time:N,floor:W}=o.data,Et=this.positionFloor!==W;if(this.positionFloor=o.data.floor,this.dispatchEvent({type:"ws-position",floor:W,x:I,y:R,time:N,_type:"vision"}),!this.options.use_pdr){this.dispatchEvent({type:"position",floor:W,x:I,y:R,time:new Date(N).getTime()});return}if(Et){var Q;if(this.resetPdr(),(Q=this.carInertialPosition)==null||Q.stopPositionTimer(),this.path){let Lt=this.path.findIndex(It=>It.floor===W),Xt=this.path[Lt];if(Xt){var lt;this.resetPdr(),(lt=this.carInertialPosition)==null||lt.setPosition(Xt.points[0],new Date(N).getTime(),o.duration)}else{var at;(at=this.carInertialPosition)==null||at.setPosition([I,R],new Date(N).getTime(),o.duration)}}else{var St;(St=this.carInertialPosition)==null||St.setPosition([I,R],new Date(N).getTime(),o.duration)}}else{var Kt,$;if((Kt=this.carInertialPosition)==null||Kt.setPosition([I,R],new Date(N).getTime(),o.duration),!(($=this.carInertialPosition)!=null&&$.positionTimer)){var ue;(ue=this.carInertialPosition)==null||ue.startPositionTimer()}}if(this.options.upload_position){var Ge;(Ge=this.positionWebSocket)==null||Ge.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:I,y:R,floor:W,type:"vision"}),serverData:JSON.stringify(o)})}}}else this.dispatchEvent({type:"floor",floor:o.data.floor,time:o.data.time})})}initSensorWebSocket(){let t=w({},this.options.ext_sensor_params,{token:this.options.access_token,place_id:this.options.place_id,record_sensor:1}),e=Object.keys(t).filter(i=>!Zr(t[i])).map(i=>i+"="+t[i]).join("&");this.sensorWebSocket=new ni({url:this.options.wss_sensor_url+"?"+e})}initPdr(){this.options.type===1?(this.carInertialPosition=new Os,this.carInertialPosition.addEventListener("change-pos",t=>{let{value:e}=t,{pos:i,success:s,speed:o}=e;if(s&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:i[0],y:i[1],time:Date.now(),speed:o}),this.options.upload_position)){var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:i[0],y:i[1],floor:this.positionFloor,type:"vision_pdr"})})}}),this.carInertialPosition.addEventListener("change-compass",t=>{let{value:e}=t;this.dispatchEvent({type:"compass",value:e})})):(this.pdrPosition=new Ss(this.bmap,{pdr:{using_gps:this.options.use_gps},sensor:{elements:[O.COMPASS,O.ACCELERATION,O.DEVICE_MOTION].concat(this.options.use_gps?[O.GPS]:[])}}),this.requestDeviceOrientationPermission(),this.options.upload_position&&this.pdrPosition.sensor.addEventListener("sensor-data",t=>{let{data:e}=t;var i;(i=this.positionWebSocket)==null||i.send({command:"UPLOAD_SENSOR",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify(e)})}),this.pdrPosition.sensor.addEventListener("add-data-item",t=>{t.item.type==="compass"&&this.dispatchEvent({type:"compass",value:t.item.res})}),this.pdrPosition.addEventListener("position",t=>{let{x:e,y:i,_type:s}=t;if(console.log("_type",s,e,i,this.positionFloor,this.gpsFloor),s==="gps"&&!this.useGpsFloorTimer){let n=()=>{this.useGpsFloorTimer=this.timer.setTimeout(()=>{this.gpsFloor?this.positionFloor=this.gpsFloor:n()},5e3)};n()}if(this.positionFloor&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:e,y:i,time:Date.now()}),this.options.upload_position)){var o;(o=this.positionWebSocket)==null||o.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:e,y:i,floor:this.positionFloor,type:s})})}}))}setSensor(t){this.pdrPosition&&this.pdrPosition.setSensor(t)}requestDeviceOrientationPermission(){return f(this,null,function*(){if(this.pdrPosition){let t=yield this.pdrPosition.checkSensor();return t.deviceOrientation?this.pdrPosition.start():(this.dispatchEvent(w({type:"check-sensor"},t)),!t.deviceOrientation&&this.options.use_default_permission),t}else return null})}getGpsFloor(){return f(this,null,function*(){if(this.options.use_gps&&this.options.get_gps_floor_url){let t=yield fetch(this.options.get_gps_floor_url+"/"+this.options.place_id).then(e=>e.json());t.code===200&&(this.gpsFloor=t.data.gps_floor)}})}pausePdr(){if(this.options.type===1){var t;(t=this.carInertialPosition)==null||t.stopPositionTimer()}else{var e;(e=this.pdrPosition)==null||e.pause()}}continuePdr(){if(this.options.type===1)this.carInertialPosition&&(this.carInertialPosition.positionTimer||this.carInertialPosition.startPositionTimer());else{var t;(t=this.pdrPosition)==null||t.continue()}}setPathAngle(t){if(this.options.type===1){var e;(e=this.carInertialPosition)==null||e.setPathAngle(t)}}getForwardAngle(){if(this.options.type===1){var t,e;return(e=(t=this.carInertialPosition)==null?void 0:t.angle)!=null?e:null}else return null}resetPdr(){this.carInertialPosition&&(this.carInertialPosition.history=[],this.carInertialPosition.setPathAngle(0),this.carInertialPosition.speed=0),this.pdrPosition&&this.pdrPosition.pdr.particleFilter.setPosInitFlag(!1)}setPath(t){this.path=t}sendBeacon(t){var e;let i=[];if(Ut)i=t.map(o=>{let[n,r]=To(o.major);return[o.uuid,r,o.minor,o.rssi,o.accuracy,n]}).filter(o=>o[3]!==0).sort((o,n)=>n[3]-o[3]);else{let o=t.reduce((n,r)=>{var h,c;let[l,p]=To(r.major),d=""+p+r.minor;return(h=n)[c=d]||(h[c]=[]),n[d].push(w({},r,{battery:l,major:p})),n},{});Object.entries(o).forEach(n=>{let[r,h]=n,{uuid:c,major:l,minor:p,accuracy:d,battery:u}=h[0];if(h.length>1){let m=h.filter(g=>g.rssi<0),v=m.reduce((g,x)=>g+x.rssi,0);i.push([c,l,p,v/m.length,d,u])}else i.push([c,l,p,h[0].rssi,d,u])})}let s={command:"POSITION",index:this.uploadIndex++,ts:Date.now(),beacons:JSON.stringify([{type:"ibeacon",timestamp:Date.now()/1e3,res:i}]),ext_sensors:JSON.stringify({})};(e=this.sensorWebSocket)==null||e.send(s)}dispose(){var t,e,i,s;this.timer.dispose(),(t=this.positionWebSocket)==null||t.dispose(),this.positionWebSocket=null,(e=this.sensorWebSocket)==null||e.dispose(),this.sensorWebSocket=null,(i=this.pdrPosition)==null||i.dispose(),this.pdrPosition=null,(s=this.carInertialPosition)==null||s.dispose(),this.carInertialPosition=null,super.dispose()}constructor(t,e){super(),this.bmap=t,this.positionWebSocket=null,this.sensorWebSocket=null,this.pdrPosition=null,this.carInertialPosition=null,this.gpsFloor="",this.positionFloor="",this.useGpsFloorTimer=null,this.uploadIndex=0,this.path=null,this.timer=new z;let i=location.href.indexOf("?"),s=i!==-1?location.href.slice(i):location.search,o=new URLSearchParams(s),n=o.get("server_env")||"prod",r={test:"nav-test.aibee.cn",prod:"nav.aibee.cn"},h="wss://"+r[n]+"/aether-walker/indoor/position",c="wss://"+r[n]+"/aether-walker/indoor/sensor";this.options=w({place_id:o.get("place_id"),access_token:o.get("access_token"),env:n,wss_position_url:h,wss_sensor_url:c,get_gps_floor_url:"https://"+r[n]+"/aether-walker/indoor/conf",use_sensor:!1,type:-1,use_gps:!0,use_pdr:!0,upload_position:!0,use_default_permission:!0,ext_position_params:{},ext_sensor_params:{}},e),this.initPositionWebSocket(),this.options.use_sensor&&this.initSensorWebSocket(),this.options.use_pdr&&this.initPdr(),this.options.use_gps&&this.getGpsFloor()}};import"core-js/modules/web.dom-collections.iterator.js";var Vr=class extends B{showMyPosition(t,e){var i;let s=(i=this.bmap.context.currentFloor)==null?void 0:i.getGraphicPosition(t);if(s){let o=new be(this.bmap.context,{autoUpdate:!0,appendToBody:!1});o.div.appendChild(e),o.position.copy(this.bmap.mercatorToWorld(s)),this.myPositionOverlay=o,console.log("graphicPos",s,this)}else console.warn("[showMyPosition] \u6CA1\u6709\u627E\u5230\u56FE\u5143\u6240\u5728\u7684\u4F4D\u7F6E")}hideMyPosition(){this.myPositionOverlay&&(this.myPositionOverlay.dispose(),this.myPositionOverlay=null)}dispose(){this.hideMyPosition()}constructor(...t){super(...t),this.myPositionOverlay=null}};var Kr=class extends B{highlightPoi(t,e){e===void 0&&(e={icon_size:[40,40],collision_enable:!1}),t.map(s=>this.bmap.getPoiById(s)).filter(s=>!!s).forEach(s=>{var o;(o=s.userData).restore||(o.restore={});for(let h in e)if(h in s.options){var n,r;(n=s.userData.restore)[r=h]||(n[r]=s.options[h]),s.options[h]=e[h]}})}restorePoi(t){t.map(i=>this.bmap.getPoiById(i)).filter(i=>!!i).forEach(i=>{console.log("poi.userData.restore",i.userData.restore);for(let s in i.userData.restore)s in i.options&&(i.options[s]=i.userData.restore[s]);i.userData.restore={}})}};import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.sort.js";var Xr=class extends B{sortByDistance(t,e,i){return f(this,null,function*(){i===void 0&&(i=!1);let s=[...e];if(i||e.length<20)return yield Promise.all(s.map(o=>f(this,null,function*(){o.distance=yield this._getDistance(t,{floor:o.floor,x:o.center_x,y:o.center_y})}))),s.sort((o,n)=>o.distance-n.distance);{let o=s.sort((r,h)=>{let c=Math.sqrt((r.center_x-t.x)**2+(r.center_y-t.y)**2)+(t.floor===r.floor?0:100),l=Math.sqrt((h.center_x-t.x)**2+(h.center_y-t.y)**2)+(t.floor===h.floor?0:100);return c-l});return[...(yield Promise.all(o.slice(0,20).map(r=>f(this,null,function*(){return r.distance=yield this._getDistance(t,{floor:r.floor,x:r.center_x,y:r.center_y}),r})))).sort((r,h)=>r.distance-h.distance),...o.slice(20)]}})}_getDistance(t,e){return f(this,null,function*(){return this.navPath.getPath({floor:t.floor,coord:[t.x,t.y]},{floor:e.floor,coord:[e.x,e.y]},"",0).then(i=>i.reduce((s,o,n)=>{if(s+=o.distance,n!==i.length-1)switch(o.endType){case"escalator":case"straightLadder":case"staircase":case"ramp":s+=100;break}return s},0)).catch(i=>i==="near"?0:1/0)})}dispose(){super.dispose(),this.needDisposeNavPath&&this.navPath.dispose()}constructor(t,e){if(super(t),this.needDisposeNavPath=!1,e)this.navPath=e;else{this.navPath=new vs;let i=new Ie(t);this.needDisposeNavPath=!0,i.load(t.config.apiPath.loadPlaceInfo+"?place_id="+t.config.placeId+"&env=prod").then(s=>f(this,null,function*(){let[o,n]=yield Promise.all([i.getRoadNetworkData(),i.getFacilitiesData()]);this.navPath.setRoadData(o,n.infrastructures)}))}}};var qd="https://robot-vr-public.bj.bcebos.com/v1/static_resource/satellite_tiles",$d={base_url:qd},Yr=class extends B{setVisible(t){this.tileLayer.setVisibility(t)}dispose(){this.bmap.context.scene.remove(this.tileLayer),this.tileLayer.dispose(),super.dispose()}constructor(t,e){super(t),this.options=w({},$d,e),this.tileLayer=new pe(t.context,this.options),this.tileLayer.position.z=-1,this.bmap.context.scene.add(this.tileLayer)}};import{Box3 as Jd,Group as Qd}from"three";var qr=class extends B{addHeatmap(t,e){this.heatmap||(this.heatmap=new Ui(this.bmap.context),this.group.add(this.heatmap)),this.heatmap.loadData(t);let i=new Jd().setFromObject(e.graphicLayer);return this.heatmap.position.setZ(i.max.z+.1),this.heatmap}removeHeatMap(){this.heatmap&&(this.group.remove(this.heatmap),this.heatmap.dispose(),this.heatmap=null)}dispose(){this.removeHeatMap(),this.bmap.context.scene.remove(this.group)}constructor(t){super(t),this.heatmap=null,this.group=new Qd,this.bmap.context.scene.add(this.group)}};export{Ie as AibeeLoader,wr as BMap,Or as BMapSelect,vt as BaseSvg,Os as CarInertialPosition,vi as ClickHelper,ds as Context,ls as ContextCamera,cs as ContextScene,as as Control,xr as CrLoader,Ar as CrNavPath,Mr as Equipment,X as EventDispatcher,Xo as Events,At as Floor,Yn as GlbModel,Y as Graphic,Ti as GraphicLayer,he as GroundTexture,qr as Heatmap,Ui as HeatmapElement,Kr as HighlightPoi,it as HooksName,es as HoverHelper,Se as InstancedGraphic,Ii as InstancedModel,Ke as InstancedParkingSpace,Ji as InstancedWall,wi as KalmanFilter,Vi as Lane,H as Layer,$e as LineElement,OS as MapTypePolar,Ye as MergeAttributeGraphic,ce as MergeAttributeGroundTexture,qi as MergeAttributeLane,Xi as MergeAttributeWall,Qn as MergeGraphic,le as MergedAttributeGraphicLine,Gi as MergedGraphicLayer,Oi as MergedModelLayer,Ci as Model,Wr as MulFloorNavigation,Ur as MulFloorSelect,kr as MulFloors,vs as NavPath,Cr as Navigation,be as Overlay,Ai as ParkingLayer,GS as ParkingType,Ht as PathDirection,Ss as PdrPosition,ae as Poi,j as Poi2,ki as PoiLayer,Di as PoiLayer2,jr as Position,Qe as RENDER_VERSION,Nr as RecommendParkingSpace,hs as Renderer,wn as RoadNetwork,gi as RoadNetwork2,O as SENSOR_TYPE,Yr as SatelliteTile,Kn as SelectBox,ts as Selection,ws as Sensor,Li as Shadow,ni as Socket,Xr as SortByDistance,Hi as SvgLine,Ni as SvgPolygon,we as TaskQueue,Ki as TextTexture,pe as TileLayer,Fi as TileLoader,z as Timer,Qt as TweenUtil,Ko as UA,Vr as UseMyPosition,Zi as Wall,xi as WorkerPool,Gu as addAlphaToHexColor,me as calc_angle,Hs as calc_direction,mC as calculateInstantaneousSpeed,Ds as calculateLineDirection,Mn as convertToSnakeCase,He as createCircle,ui as createLine,qt as createRect,Zo as createSvg,di as createSvgElement,rf as createThreeBox,nf as createThreeLine,Wt as darkenColor,_p as defaultConfig,Zt as defaultGraphicOptions,uo as defaultOptions,nl as defaultTextTextureOptions,Mu as deviceToVector3,D as dispose,sn as distancePointToSegment,oe as generatorKeyByObj,Pa as getAngle,Ys as getBorderPoints,pi as getCenter,ur as getConfig,on as getDirectPath,Ns as getDirectionByAngle,nn as getDistanceByPathPos,k as getLength,_u as getLongestSideDir,Pu as getMinEdgeSquare,ht as getPathLength,Bt as getPointEdgeIndex,ve as getPosByPathDistance,Ho as hasChinese,Ws as hexToRgb,Uo as initDirectionalLight,Wo as initLight,hi as initShape,ag as instancedGeometiesAttributes,Bu as isAndroid,Yt as isContain,ye as isControl,Ut as isIphone,ge as isMac,No as isPointInPolygon,hg as isRectangle,yr as loadBuildingGround,lS as loadExternalStreet,vr as loadGraphics,rg as mergeGraphicGeometries,Xa as mergeGraphicLineGeometries,cm as moveOnRoute,oi as predictFuturePosition,fC as predictFutureSpeed,fe as proxyOptions,gC as removeOutliers,Sa as removeWeightPath,se as setCirclePosition,Mt as setLineStartEnd,ot as setRectPosition,mi as simplifyPath,Vo as sleepByRf,jo as sleepOnePromise,Bs as sleepOneRf,en as smoothPath,_n as splitStrByBracket,Ru as strToNumber,ft as timeoutPromise,tf as toWebWorker,yi as transformGraphicData,Lo as transformSpeed,xe as translatePosToCenter,F as triggerWorker,C as vector3ToDevice,em as xhrGet};
701
+ `};var Cs=class extends Cd{constructor(t){super({type:"ArrowLineMaterial",uniforms:Object.assign({},Fr.clone(Es["custom-line"].uniforms),{map:{value:null}}),vertexShader:Es["custom-line"].vertexShader,fragmentShader:Es["custom-line"].fragmentShader,clipping:!0}),this.dashed=!1,Object.defineProperties(this,{map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(e){this.uniforms.repeat.value.copy(e)}},allDistance:{enumerable:!0,get:function(){return this.uniforms.allDistance.value},set:function(e){this.uniforms.allDistance.value=e}}}),this.setValues(t),this.isLineMaterial=!0}};import{LineGeometry as Gd}from"three/examples/jsm/lines/LineGeometry.js";import{Line2 as Fd}from"three/examples/jsm/lines/Line2.js";var zr={texture_url:bi,lineWidth:8,color:16777215},Ts=class extends Td{registryEvent(){this.navigation.bmap.context.addEventListener("control-change",this.onControlChange),this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.bmap.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("control-change",this.onControlChange),this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.bmap.context.removeEventListener("resize",this.onResize)}getRepeat(){let{points:t,navigation:{bmap:{context:{camera:e,clientSize:{width:i,height:s}}}}}=this,o=t.map(r=>{let[h,c,l]=r;return C(new Ad(h,c,l),e,i,s)}).map(r=>{let{x:h,y:c}=r;return[h,c]});return ht(o)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new So(t,1)}loadTexture(t){return new Promise((e,i)=>{new kd().load(t,e,void 0,i)})}transformPoints(t){let e=[];for(let i=0;i<t.length;i++)e.push(...t[i]);return e}updatePoints(t){if(this.points=t,this.mesh){var e,i;this.remove(this.mesh),(e=this.material)==null||e.dispose(),(i=this.geometry)==null||i.dispose()}this.geometry=new Gd,this.geometry.setPositions(t.flat(2));let s=ht(t.map(r=>{let[h,c]=r;return[h,c]})),o=this.material=new Cs({color:new Dd(this.config.color),transparent:!0,resolution:new So(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!0,depthWrite:!0,linewidth:this.config.lineWidth,map:this.texture,blending:Od,repeat:new So(this.getRepeat(),1),allDistance:s}),n=this.mesh=new Fd(this.geometry,o);return n.computeLineDistances(),n.renderOrder=9,this.add(n),n}movePath(t){this.material&&(this.material.thresholdRatio=t)}create(t){return f(this,null,function*(){if(!this.texture){let e=this.texture=yield this.loadTexture(this.config.texture_url);e.wrapS=e.wrapT=Id}return this.updatePoints(t)})}getBoundingBox(){return this.mesh?(this.mesh.geometry.computeBoundingBox(),new Rd().copy(this.mesh.geometry.boundingBox).applyMatrix4(this.mesh.matrixWorld)):null}dispose(){var t,e,i;this.unRegistryEvent(),this.clear(),(t=this.geometry)==null||t.dispose(),(e=this.material)==null||e.dispose(),(i=this.texture)==null||i.dispose(),this.navigation=null}constructor(t,e){super(),this.navigation=t,this.mesh=null,this.geometry=null,this.material=null,this.texture=null,this.config=zr,this.points=[],this.basicRepeat=1,this.prevCameraZoom=0,this.onControlChange=()=>{let i=this.navigation.bmap.context.camera.zoom;i!==this.prevCameraZoom&&(this.prevCameraZoom=i,this.changeRepeat())},this.onUpdate=()=>{this.texture},this.onResize=()=>{if(this.material){let{width:i,height:s}=this.navigation.bmap.context.clientSize;this.material.resolution.set(i,s)}},this.config=Object.assign({},zr,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}};import{Tween as Nd}from"@tweenjs/tween.js";import{AnimationMixer as zd,Box3 as Bd,Object3D as Br,Vector3 as Wd,Mesh as Ud,Euler as Hd}from"three";var ks=class extends Br{meshSetMaterial(t){t instanceof Ud&&(t.material.emissiveIntensity=.5,t.material.shininess=0,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map,t.material.transparent=!0,t.material.depthTest=!1,t.renderOrder=1e6),t.children.forEach(i=>{this.meshSetMaterial(i)})}getBaseScale(t){let{clientSize:{height:e},camera:i}=this.bmap.context,o=(i.top-i.bottom)/i.zoom/e;return this.options.size*o/this.modelMaxLength}registryEvent(){this.bmap.context.addEventListener("update",this._update),this.bmap.context.addEventListener("control-zoom-change",this._onChangeZoom)}unRegistryEvent(){this.bmap.context.removeEventListener("update",this._update),this.bmap.context.removeEventListener("control-zoom-change",this._onChangeZoom)}lookAtCamera(){if(this.model&&this.bmap&&this.bmap.context){let t=this.bmap.context.camera,e=new Hd;e.setFromQuaternion(t.quaternion,"ZYX"),this.group.rotation.copy(e)}}setClips(t){this.clearClips(),t.length&&(this.mixer=new zd(this.model.scene),t.forEach(e=>this.mixer.clipAction(e).play()))}startClips(){var t;this.setClips(((t=this.model)==null?void 0:t.animations)||[])}clearClips(){this.mixer&&(this.mixer.stopAllAction(),this.mixer.uncacheRoot(this.mixer.getRoot()),this.mixer=null)}dispose(){this.unRegistryEvent(),this.clearClips(),this.clear(),this.model&&D(this.model.scene),this.bmap=null}constructor(t,e,i={}){super(),this.bmap=t,this.group=new Br,this.mixer=null,this.previewTime=0,this.modelMaxLength=0,this.options={size:40},this._update=()=>{let s=Date.now();if(!this.previewTime)this.previewTime=s;else{var o;let n=s-this.previewTime;this.previewTime=s,(o=this.mixer)==null||o.update(n/1e3)}this.lookAtCamera()},this._onChangeZoom=s=>{let{zoom:o}=s;var n;if(!this.model)return;let r=this.getBaseScale(this.model.scene);(n=this.model)==null||n.scene.scale.set(r,r,r)},this.options=w({},this.options,i),this.add(this.group),st.loadModel(e,!1).then(s=>{this.model=s;let n=new Bd().setFromObject(s.scene).getSize(new Wd),r=Math.max(n.x,n.y,n.z);this.modelMaxLength=r;let h=this.getBaseScale(s.scene);s.scene.scale.set(h,h,h),this.meshSetMaterial(s.scene),this.group.add(s.scene),this.setClips(s.animations),this.group.rotation.set(Math.PI/2,Math.PI,0),this.dispatchEvent({type:"loaded"})}),this.registryEvent()}};import{Vector3 as Eo}from"three";var Wr=class extends B{registryEvent(){this.bmap.context.addEventListener("update",this.onUpdate)}pauseAnimation(){this.tweenUtil.pause()}continueAnimation(){this.tweenUtil.continue()}clearTween(){this.tweenUtil.clear(),this.bmap.context.control.enabled=!0}unRegistryEvent(){this.bmap.context.removeEventListener("update",this.onUpdate)}clearPath(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose(),this.path=null,this.movedDistance=0,this.clearTween()),this.startModel&&(this.startModel.visible=!1),this.translatePath=null}addPath(t){this.paths=t;let e=t.map(i=>w({},i,{points:this.translatePoints(i.points)}));if(this.clearTween(),this.movedDistance=0,this.bmap.currentBuildGround)this.renderPath(e);else{let i=()=>{this.bmap.removeEventListener("center-change",i),this.renderPath(e)};this.bmap.addEventListener("center-change",i)}this.dispatchEvent({type:"add-path",paths:t})}translatePoints(t){let[e,i]=this.bmap.buildingCenter;return t.map(s=>[s[0]-e,s[1]-i])}renderPath(t){return f(this,null,function*(){if(!t.length)return this.clearPath();let e=[];t.forEach((i,s,o)=>{let n=this.mulFloor.floors.find(r=>r.name===i.floor);e.push(...i.points.map(r=>{let[h,c]=r;return[h,c,n.position.z+n.groundMaxHeight]}))}),this.cPath=e,this.animationPathOptions={cPathIndex:0},this.path?this.path.updatePoints(e):(this.path=new Ts(this),yield this.path.create(e),this.path.position.z=.5,this.bmap.context.scene.add(this.path)),this.startModel&&(this.startModel.position.set(e[0][0],e[0][1],e[0][2]),this.startModel.visible=!0),this.dispatchEvent({type:"render-path",path:this.path})})}catmullRomCurve3(t){return mi(t,!1,!0,.1,170,2.5)}getPathDirection(t,e){if(t.length<2)return null;let i=Bt(t,e),s=t[i],o=t[i+1],n=new Eo(o[0]-s[0],o[1]-s[1],0).normalize(),r=new Eo(0,1,0).normalize(),h=n.angleTo(r),c=new Eo().crossVectors(r,n);return(Object.is(c.y,0)?-1:1)*h}startSimulation(t){return f(this,null,function*(){t===void 0&&(t=1);let{paths:e,movedDistance:i}=this;if(!e.length)return;let s=e.reduce((n,r)=>n+r.distance,0);if(!s||i>=s)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let o=s/t;return this.startModel.startClips(),new Promise(n=>{let r=this.simulationTween=new Nd({distance:this.movedDistance},this.tweenUtil.group).to({distance:s},o*1e3).onUpdate(h=>{var c;this.movedDistance=h.distance;let l=h.distance,p=0;for(let g=0;g<e.length;g++)if(e[g].distance>=l){p=g;break}else l-=e[g].distance;let d=ve(e[p].points,l);if(d===null)return;this.currentPathPosition=d;let u=this.translatePoints([d])[0],m=this.mulFloor.floors.find(g=>g.name===e[p].floor),v=m?m.position.z+m.groundMaxHeight:(c=this.startModel)==null?void 0:c.position.z;this.startModel&&this.startModel.position.set(u[0],u[1],v)}).onComplete(()=>{if(this.tweenUtil.remove(r),this.startModel.clearClips(),this.startModel){var h,c,l,p;let d=(l=e.slice(-1)[0])==null||(c=l.points)==null||(h=c.slice(-1))==null?void 0:h[0];if(!d)return;let u=this.mulFloor.floors.find(g=>{var x;return g.name===((x=e.slice(-1)[0])==null?void 0:x.floor)});if(!u)return;let m=u?u.position.z+u.groundMaxHeight:(p=this.startModel)==null?void 0:p.position.z,v=this.translatePoints([d])[0];this.startModel.position.set(v[0],v[1],m)}n(!0)}).start()})})}setStartPoiRotate(t){if(this.startPoi){let i=(this.bmap.context.control.getAzimuthalAngle()*180/Math.PI+360)%360;this.startPoi.options.icon_rotate=(360-t-i)%360}}dispose(){this.path&&(this.bmap.context.scene.remove(this.path),this.path.dispose()),this.startModel&&(this.bmap.context.scene.remove(this.startModel),this.startModel.dispose()),this.tweenUtil.dispose(),this.unRegistryEvent(),super.dispose()}constructor(t,e,i={}){super(t),this.mulFloor=e,this.path=null,this.fetchRoadStatus=!1,this.paths=[],this.curFloorPath=null,this.translatePath=null,this.currentPathPosition=null,this.pathTween=null,this.startPoi=null,this.movedDistance=0,this.tweenUtil=new Qt,this.animationPathOptions={cPathIndex:0},this.cPath=[],this.onUpdate=()=>{this.tweenUtil.update()},this.startModel=new ks(t,An,i.startModel),this.startModel.visible=!1,this.bmap.context.scene.add(this.startModel),this.registryEvent()}};import"core-js/modules/es.array.flat.js";import"core-js/modules/es.array.unscopables.flat.js";import{Raycaster as Zd,Vector2 as jd}from"three";var Ur=class extends B{registryEvent(){this.clickHelper.addEventListener("click",this._click)}unRegistryEvent(){this.clickHelper.removeEventListener("click",this._click)}dispose(){this.unRegistryEvent(),this.clickHelper.dispose(),this.mulFloors=null,super.dispose()}constructor(t,e){super(t),this.mulFloors=e,this._click=i=>{let{e:s}=i;if(!this.mulFloors.showStatus)return;let o=new jd,{offsetX:n,offsetY:r}=s,h=this.mulFloors.floors.map(d=>d.poiLayer2.getPoiByDeviceXy(n,r)).flat(2),{clientSize:c}=this.bmap.context;o.x=n/c.width*2-1,o.y=r/c.height*-2+1;let l=new Zd;l.setFromCamera(o,this.bmap.context.camera),l.ray.origin.sub(l.ray.direction.clone().multiplyScalar(1e4));let p=this.mulFloors.floors.map(d=>d.graphicLayer.getGraphicByRaycaster(l).graphics).flat();this.dispatchEvent({type:"select",pois:h,graphics:p})},this.clickHelper=new vi(this.bmap.context.container),this.registryEvent()}};import"core-js/modules/es.array.find-last-index.js";import"core-js/modules/es.array.find-last.js";import"core-js/modules/es.array.push.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.push.js";import"core-js/modules/es.array.sort.js";import{Vector2 as si}from"three";function Vd(a){let t=a.length,e=0,i=0,s=0,o=0;a.forEach(h=>{e+=h[0],i+=h[1],s+=h[0]*h[1],o+=h[0]*h[0]});let n=(t*s-e*i)/(t*o-e*e),r=(i-n*e)/t;return{m:n,b:r}}function Kd(a,t,e){let i=e[0][0],s=e.slice(-1)[0][0],o=a*i+t,n=a*s+t;return{start:[i,o],end:[s,n]}}function Ds(a){if(a.length<2)return null;let t=a.filter((h,c)=>{let l=[...a];return l.splice(c,1),l.every(p=>p[0]!==h[0]&&p[1]!==h[1])});if(t.length<2)return null;let{m:e,b:i}=Vd(t),{start:s,end:o}=Kd(e,i,t),r=360-(new si().subVectors(new si(o[0],o[1]),new si(s[0],s[1])).angle()/Math.PI*180-90+360)%360;return Number.isNaN(r)?null:r}function mC(a){let t=[];for(let e=1;e<a.length;e++){let i=a[e-1],s=a[e],o=s.position[0]-i.position[0],n=s.position[1]-i.position[1],r=Math.sqrt(o**2+n**2),h=s.time-i.time;if(h>0){let c=r/h;console.log("speedDelta",i.type,s.type,Lo(c),r,h),t.push(c)}else t.push(0)}return t}function fC(a,t){let e=a[0],i=a.slice(-1)[0],s=k(i.position,e.position),o=i.time-e.time;return o<100||s<3?null:s/o}function Lo(a){return a*60*60}function oi(a,t,e,i){let s=(e+90)%360*(Math.PI/180),o=t*i,n=new si(a[0],a[1]),r=Math.cos(s),h=Math.sin(s),c=new si(r,h);return n.add(c.normalize().multiplyScalar(o)),[n.x,n.y]}function gC(a){let t=[...a].sort((c,l)=>c-l),e=Hr(t,25),i=Hr(t,75),s=i-e,o=e-1.5*s,n=i+1.5*s,r=t.filter(c=>c>=o&&c<=n);return a.filter(c=>r.includes(c))}function Hr(a,t){let e=t/100*(a.length-1),i=Math.floor(e),s=Math.ceil(e);if(i===s)return a[i];let o=e-i;return a[i]*(1-o)+a[s]*o}import{isNil as As}from"lodash";var Os=class extends X{setPathAngle(t){this.pathAngle=t,this.dispatchEvent({type:"change-compass",value:this.pathAngle}),As(this.angle)&&(this.angle=t)}changeSpeed(){let t=this.history.filter(h=>["vision"].includes(h.type));if(t.length<2){this.speedFilter.filter(0),this.speed=0;return}let e=t[0],i=t.slice(-1)[0],s=k(i.position,e.position),o=i.time-e.time,n=o>0?s/o:0,r=this.speedFilter.filter(n);this.speed=r}changeAngle(t){t===void 0&&(t=this.visionHistory),t.length<2&&(this.angle=null);let e=Ds(t.map(i=>i.position));e!==null&&this.setAngle(e)}setAngle(t,e){e===void 0&&(e=!0),this.angle=t,e&&this.dispatchEvent({type:"change-position-compass",value:t})}setPosition(t,e,i){let s={position:t,time:e,clientTime:Date.now()-i,type:"vision"};if(this._setVisionHistoryForAngle(s),As(this.angle)||!this.speed){this.addHistory(s);return}let o=this.history.findLastIndex(r=>r.type==="vision"),n=this.history[o];if(n){if(n.time>e)return;let r=Ds([this.history.slice(-1)[0].position,t]);if(r&&Math.abs(r-this.angle)<60){this.addHistory(s);return}let h=oi(t,this.speed,360-this.pathAngle,i);k(h,this.history.slice(-1)[0].position)>5?this.visionExcessesCount++:this.visionExcessesCount=0,this.visionExcessesCount>3&&(console.warn("\u8FDE\u7EED\u4E09\u6B21\u89C6\u89C9\u548Cpdr\u5DEE\u8DDD\u5927\u4E8E5\u7C73\uFF0C\u4F7F\u7528\u89C6\u89C9\u6821\u51C6"),this.addHistory(s),this.visionExcessesCount=0)}}resetPdrPosition(){let t=this.history.findLast(e=>e.type==="vision");if(t&&this.speed){let e=oi(t.position,this.speed,360-this.pathAngle,Date.now()-t.clientTime);e&&this.history.push({position:e,time:Date.now(),clientTime:Date.now(),type:"pdr"})}}getLastVisionPdrPos(){let t=this.history.findLastIndex(i=>i.type==="vision");if(t!==-1){var e;return(e=this.history[t+1])!=null?e:this.history[t]}return null}_setVisionHistoryForAngle(t){if(!this.visionHistory.length){this.visionHistory.push(t);return}let e=Ds([this.visionHistory.slice(-1)[0].position,t.position]);if(e!==null&&(this.angle&&Math.abs(this.angle-e)>60?this.angleExcessesCount++:(this.angleExcessesCount=0,this.visionHistory.push(t))),this.angleExcessesCount>3)console.warn("\u8FDE\u7EED\u4E09\u6B21\u89D2\u5EA6\u6BD4\u8F83\u6B6A\uFF0C\u91CD\u65B0\u77EB\u6B63"),this.visionHistory=[t],this.angleExcessesCount=0;else{let i=k(this.visionHistory[0].position,this.visionHistory.slice(-1)[0].position);for(;i>5&&this.visionHistory.length>15;)this.visionHistory.shift(),i=k(this.visionHistory[0].position,this.visionHistory.slice(-1)[0].position)}this.changeAngle()}addHistory(t){this.history.push(t);let e=this.history.filter(r=>r.type==="vision"),i=e.length?Date.now()-e.slice(-1)[0].clientTime:0,s=k(this.history[0].position,this.history.slice(-1)[0].position),o=i>5e3?10:3,n=i>5e3?0:5;for(i>5e3&&console.warn("\u89C6\u89C9\u7ED3\u679C\u8D85\u51FA5s\u4E0D\u53EF\u7528\uFF0C\u5168\u90E8\u6E05\u7A7A");e.length>n&&s>o;)this.history.shift(),e=this.history.filter(r=>r.type==="vision"),s=k(this.history[0].position,this.history.slice(-1)[0].position);n===0?this.changeSpeed():t.type==="vision"&&this.changeSpeed(),this.changePosition(t.type)}setBeaconPosition(t,e,i){let s=Date.now()-i,o={position:t,time:e,clientTime:s,type:"beacon"},n=this.history.findLastIndex(l=>l.type!=="pdr"),r=this.history[n];if(!r){this.addHistory(o);return}if(As(this.pathAngle)||!this.speed){this.addHistory(o);return}if(r&&r.time>e)return;let h=oi(t,this.speed,360-this.pathAngle,i);k(h,this.history.slice(-1)[0].position)>5?this.beaconExcessesCount++:this.beaconExcessesCount=0,this.beaconExcessesCount>3&&(console.warn("\u8FDE\u7EED\u4E09\u6B21beacon\u548Cpdr\u5DEE\u8DDD\u5927\u4E8E5\u7C73\uFF0C\u4F7F\u7528beacon\u6821\u51C6"),this.addHistory(o),this.beaconExcessesCount=0)}startPositionTimer(){this.positionTimer&&this.timer.clearInterval(this.positionTimer),this.positionTimer=this.timer.setInterval(()=>{this.changePosition()},20)}stopPositionTimer(){this.positionTimer&&(this.timer.clearInterval(this.positionTimer),this.positionTimer=null)}changePosition(t){t===void 0&&(t="pdr");let e=this.getPosition(t);e.success&&(this.history.push({position:e.pos,time:Date.now(),clientTime:Date.now(),type:"pdr"}),this.speed?this.dispatchEvent({type:"change-pos",value:w({},e)}):this.dispatchEvent({type:"change-pos",value:e}))}getPosition(t){if(this.history.length===0)return{success:!1,pos:[0,0],compass:null,speed:0};let e=this.history.slice(-1)[0];if(this.history.length<2)return{success:!0,pos:e.position,compass:this.pathAngle,speed:this.speed};if(As(this.pathAngle)||!this.speed)return{success:!0,pos:e.position,compass:this.pathAngle,speed:this.speed};let i=e.clientTime,s=Date.now()-i;return{success:!0,pos:this.pathAngle?oi(e.position,this.speed,360-this.pathAngle,s):e.position,compass:this.pathAngle,speed:Lo(this.speed)}}dispose(){this.timer.dispose()}constructor(){super(),this.history=[],this.visionHistory=[],this.speed=0,this.angle=null,this.timer=new z,this.positionTimer=null,this.speedFilter=new wi,this.visionExcessesCount=0,this.beaconExcessesCount=0,this.angleExcessesCount=0,this.pathAngle=0,this.startPositionTimer()}};import"core-js/modules/es.json.stringify.js";function Co(){return new Worker(new URL("./worker/recommend.worker-DNMNFDYX.js",import.meta.url))}var Xd={placeId:0,catLotStatusApi:"https://screen.aibee.cn/ai-map/car-park/car-lot-status"},Nr=class{setRoadData(t,e){return F(this.worker,"set_road_info",{roadData:t,facilities:e})}recommend(t){return f(this,null,function*(){let e=yield fetch(this.options.catLotStatusApi,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({place_id:+this.options.placeId})}).then(i=>i.json()).then(i=>i.data.filter(s=>s.status===0)).then(i=>{var s;return i.filter((s=this.options.filterCarLotStatus)!=null?s:()=>!0)});return F(this.worker,"recommend",w({},t,{carLotStatus:e}))})}dispose(){this.worker.terminate()}constructor(t={}){this.worker=Co(),this.options=w({},Xd,t)}};import"core-js/modules/es.json.stringify.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.sort.js";import"core-js/modules/es.array.push.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/web.url-search-params.js";import"core-js/modules/web.url-search-params.delete.js";import"core-js/modules/web.url-search-params.has.js";import"core-js/modules/web.url-search-params.size.js";import"core-js/modules/es.json.stringify.js";var Yd={url:"",reconnect:!0,heartBeat:2e3,heartMsg:JSON.stringify({command:"PING"}),reconnectTime:3e3,reconnectMaxCount:1e6,noMessageTime:6e3},ni=class extends X{initWebsocket(){this.ws=new WebSocket(this.options.url),this.ws.onopen=()=>{this.alive=!0,this.startHeart(),this.startOnMessageTimer(),this.stopReconnect(),this.dispatchEvent({type:"open"})},this.ws.onerror=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect(),this.registryEvent()},this.ws.onclose=()=>{this.alive=!1,this.ws=null,this.stopHeart(),this.stopOnMessageTimer(),this.startReconnect()},this.ws.onmessage=t=>{this.startOnMessageTimer(),this.dispatchEvent({type:"message",message:t})}}startHeart(){this.stopHeart(),this.heartTimer=this.timer.setInterval(()=>{this.send(this.options.heartMsg)&&this.dispatchEvent({type:"send-heart"})},this.options.heartBeat)}stopHeart(){this.heartTimer&&(this.timer.clearInterval(this.heartTimer),this.heartTimer=null)}startReconnect(t){t===void 0&&(t=this.options.reconnectTime),this.stopReconnect(),this.options.reconnect&&(this.options.reconnectMaxCount--,this.options.reconnectMaxCount>=0&&(this.reconnectTimer=this.timer.setTimeout(()=>{this.initWebsocket()},t)))}stopReconnect(){this.reconnectTimer&&(this.timer.clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}startOnMessageTimer(){this.stopOnMessageTimer(),this.noMessageTimer=this.timer.setTimeout(()=>{var t;(t=this.ws)==null||t.close(),this.dispatchEvent({type:"no-message-timeout"})},this.options.noMessageTime)}stopOnMessageTimer(){this.noMessageTimer&&(this.timer.clearTimeout(this.noMessageTimer),this.noMessageTimer=null)}send(t){var e;let i=typeof t=="string"?t:JSON.stringify(t);return this.alive&&((e=this.ws)==null?void 0:e.readyState)===1?(this.ws.send(i),this.dispatchEvent({type:"send-success",msg:i}),!0):(this.dispatchEvent({type:"send-fail",msg:i}),!1)}registryEvent(){window.addEventListener("online",this.onOnline)}unRegistryEvent(){window.removeEventListener("online",this.onOnline)}close(){var t;this.unRegistryEvent(),this.options.reconnect=!1,this.alive=!1,this.stopHeart(),this.stopReconnect(),this.stopOnMessageTimer(),(t=this.ws)==null||t.close(),this.ws=null,this.dispatchEvent({type:"close"})}dispose(){this.close(),this.timer.dispose(),super.dispose()}constructor(t){super(),this.ws=null,this.alive=!1,this.timer=new z,this.heartTimer=null,this.reconnectTimer=null,this.noMessageTimer=null,this.onOnline=()=>{this.startReconnect()},this.options=w({},Yd,t||{}),this.options.url&&this.initWebsocket()}};import{isNil as Zr}from"lodash";var To=a=>{let t=a.toString(2),e=""+Array(16-t.length+1).join("0")+t,i=parseInt(e.slice(0,4),2)*10,s=parseInt(e.slice(4,16),2);return[i,s]};var jr=class extends X{initPositionWebSocket(){let t=w({},this.options.ext_position_params,{place_id:this.options.place_id,token:this.options.access_token}),e=Object.keys(t).filter(i=>!Zr(t[i])).map(i=>i+"="+t[i]).join("&");this.positionWebSocket=new ni({url:this.options.wss_position_url+"?"+e}),this.positionWebSocket.addEventListener("message",i=>{let{message:s}=i,o=(()=>{try{return JSON.parse(s.data)}catch(I){return s.data}})();if(this.dispatchEvent({type:"ws-message",data:o}),o.command==="POSITION_RESULT"&&o.data.success)if(["POSITION","FLOOR","PARK_POSITION","AOA"].includes(o.data.success_type)&&this.useGpsFloorTimer&&(this.positionFloor=o.data.floor,this.timer.clearTimeout(this.useGpsFloorTimer),this.useGpsFloorTimer=null),o.data.success_type==="AOA"){let{x:I,y:R,time:N,floor:W,ts:Et}=o.data,Lt=this.positionFloor!==W;if(this.positionFloor=W,this.dispatchEvent({type:"ws-position",floor:W,x:I,y:R,time:N,_type:"aoa"}),this.options.upload_position){var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:I,y:R,floor:W,type:"aoa"}),serverData:JSON.stringify(o)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:W,x:I,y:R,time:new Date(Et).getTime()-o.lag-o.duration});return}if(this.options.type!==1){var r;if(Lt){var h,c,l;(l=this.pdrPosition)==null||(c=l.pdr)==null||(h=c.particleFilter)==null||h.setPosInitFlag(!1)}(r=this.pdrPosition)==null||r.setBeaconPosition({x:I,y:R},new Date(Et).getTime()-o.lag-o.duration)}else if(Lt){var p;if(this.resetPdr(),(p=this.carInertialPosition)==null||p.stopPositionTimer(),this.path){let Xt=this.path.findIndex(Fe=>Fe.floor===W),It=this.path[Xt];if(It){var d;this.resetPdr(),(d=this.carInertialPosition)==null||d.setBeaconPosition(It.points[0],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}else{var u;(u=this.carInertialPosition)==null||u.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var m;(m=this.carInertialPosition)==null||m.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var v;(v=this.carInertialPosition)==null||v.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else if(o.data.success_type==="POSITION"){let{x:I,y:R,time:N,floor:W,ts:Et}=o.data,Lt=this.positionFloor!==W;if(this.positionFloor=W,this.dispatchEvent({type:"ws-position",floor:W,x:I,y:R,time:N,_type:"beacon"}),console.log("positionFloor",W,Lt),this.options.upload_position){var g;(g=this.positionWebSocket)==null||g.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:I,y:R,floor:W,type:"originBeacon"}),serverData:JSON.stringify(o)})}if(!this.options.use_pdr){this.dispatchEvent({type:"position",floor:W,x:I,y:R,time:new Date(Et).getTime()-o.lag-o.duration});return}if(this.options.type!==1){var x;if(Lt){var M,P,E;(E=this.pdrPosition)==null||(P=E.pdr)==null||(M=P.particleFilter)==null||M.setPosInitFlag(!1)}(x=this.pdrPosition)==null||x.setBeaconPosition({x:I,y:R},new Date(Et).getTime()-o.lag-o.duration)}else if(Lt){var b;if(this.resetPdr(),(b=this.carInertialPosition)==null||b.stopPositionTimer(),this.path){let Xt=this.path.findIndex(Fe=>Fe.floor===W),It=this.path[Xt];if(It){var A;this.resetPdr(),(A=this.carInertialPosition)==null||A.setBeaconPosition(It.points[0],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}else{var S;(S=this.carInertialPosition)==null||S.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var V;(V=this.carInertialPosition)==null||V.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else{var rt;(rt=this.carInertialPosition)==null||rt.setBeaconPosition([I,R],new Date(N).getTime()-o.lag-o.duration,o.lag+o.duration)}}else if(o.data.success_type==="PARK_POSITION"&&o.data.success){if(this.options.type===1){let{x:I,y:R,time:N,floor:W}=o.data,Et=this.positionFloor!==W;if(this.positionFloor=o.data.floor,this.dispatchEvent({type:"ws-position",floor:W,x:I,y:R,time:N,_type:"vision"}),!this.options.use_pdr){this.dispatchEvent({type:"position",floor:W,x:I,y:R,time:new Date(N).getTime()});return}if(Et){var Q;if(this.resetPdr(),(Q=this.carInertialPosition)==null||Q.stopPositionTimer(),this.path){let Lt=this.path.findIndex(It=>It.floor===W),Xt=this.path[Lt];if(Xt){var lt;this.resetPdr(),(lt=this.carInertialPosition)==null||lt.setPosition(Xt.points[0],new Date(N).getTime(),o.duration)}else{var at;(at=this.carInertialPosition)==null||at.setPosition([I,R],new Date(N).getTime(),o.duration)}}else{var St;(St=this.carInertialPosition)==null||St.setPosition([I,R],new Date(N).getTime(),o.duration)}}else{var Kt,$;if((Kt=this.carInertialPosition)==null||Kt.setPosition([I,R],new Date(N).getTime(),o.duration),!(($=this.carInertialPosition)!=null&&$.positionTimer)){var ue;(ue=this.carInertialPosition)==null||ue.startPositionTimer()}}if(this.options.upload_position){var Ge;(Ge=this.positionWebSocket)==null||Ge.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:I,y:R,floor:W,type:"vision"}),serverData:JSON.stringify(o)})}}}else this.dispatchEvent({type:"floor",floor:o.data.floor,time:o.data.time})})}initSensorWebSocket(){let t=w({},this.options.ext_sensor_params,{token:this.options.access_token,place_id:this.options.place_id,record_sensor:1}),e=Object.keys(t).filter(i=>!Zr(t[i])).map(i=>i+"="+t[i]).join("&");this.sensorWebSocket=new ni({url:this.options.wss_sensor_url+"?"+e})}initPdr(){this.options.type===1?(this.carInertialPosition=new Os,this.carInertialPosition.addEventListener("change-pos",t=>{let{value:e}=t,{pos:i,success:s,speed:o}=e;if(s&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:i[0],y:i[1],time:Date.now(),speed:o}),this.options.upload_position)){var n;(n=this.positionWebSocket)==null||n.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:i[0],y:i[1],floor:this.positionFloor,type:"vision_pdr"})})}}),this.carInertialPosition.addEventListener("change-compass",t=>{let{value:e}=t;this.dispatchEvent({type:"compass",value:e})})):(this.pdrPosition=new Ss(this.bmap,{pdr:{using_gps:this.options.use_gps},sensor:{elements:[O.COMPASS,O.ACCELERATION,O.DEVICE_MOTION].concat(this.options.use_gps?[O.GPS]:[])}}),this.requestDeviceOrientationPermission(),this.options.upload_position&&this.pdrPosition.sensor.addEventListener("sensor-data",t=>{let{data:e}=t;var i;(i=this.positionWebSocket)==null||i.send({command:"UPLOAD_SENSOR",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify(e)})}),this.pdrPosition.sensor.addEventListener("add-data-item",t=>{t.item.type==="compass"&&this.dispatchEvent({type:"compass",value:t.item.res})}),this.pdrPosition.addEventListener("position",t=>{let{x:e,y:i,_type:s}=t;if(console.log("_type",s,e,i,this.positionFloor,this.gpsFloor),s==="gps"&&!this.useGpsFloorTimer){let n=()=>{this.useGpsFloorTimer=this.timer.setTimeout(()=>{this.gpsFloor?this.positionFloor=this.gpsFloor:n()},5e3)};n()}if(this.positionFloor&&(this.dispatchEvent({type:"position",floor:this.positionFloor,x:e,y:i,time:Date.now()}),this.options.upload_position)){var o;(o=this.positionWebSocket)==null||o.send({command:"UPLOAD_POSITION",ts:Date.now(),index:this.uploadIndex++,data:JSON.stringify({x:e,y:i,floor:this.positionFloor,type:s})})}}))}setSensor(t){this.pdrPosition&&this.pdrPosition.setSensor(t)}requestDeviceOrientationPermission(){return f(this,null,function*(){if(this.pdrPosition){let t=yield this.pdrPosition.checkSensor();return t.deviceOrientation?this.pdrPosition.start():(this.dispatchEvent(w({type:"check-sensor"},t)),!t.deviceOrientation&&this.options.use_default_permission),t}else return null})}getGpsFloor(){return f(this,null,function*(){if(this.options.use_gps&&this.options.get_gps_floor_url){let t=yield fetch(this.options.get_gps_floor_url+"/"+this.options.place_id).then(e=>e.json());t.code===200&&(this.gpsFloor=t.data.gps_floor)}})}pausePdr(){if(this.options.type===1){var t;(t=this.carInertialPosition)==null||t.stopPositionTimer()}else{var e;(e=this.pdrPosition)==null||e.pause()}}continuePdr(){if(this.options.type===1)this.carInertialPosition&&(this.carInertialPosition.positionTimer||this.carInertialPosition.startPositionTimer());else{var t;(t=this.pdrPosition)==null||t.continue()}}setPathAngle(t){if(this.options.type===1){var e;(e=this.carInertialPosition)==null||e.setPathAngle(t)}}getForwardAngle(){if(this.options.type===1){var t,e;return(e=(t=this.carInertialPosition)==null?void 0:t.angle)!=null?e:null}else return null}resetPdr(){this.carInertialPosition&&(this.carInertialPosition.history=[],this.carInertialPosition.setPathAngle(0),this.carInertialPosition.speed=0),this.pdrPosition&&this.pdrPosition.pdr.particleFilter.setPosInitFlag(!1)}setPath(t){this.path=t}sendBeacon(t){var e;let i=[];if(Ut)i=t.map(o=>{let[n,r]=To(o.major);return[o.uuid,r,o.minor,o.rssi,o.accuracy,n]}).filter(o=>o[3]!==0).sort((o,n)=>n[3]-o[3]);else{let o=t.reduce((n,r)=>{var h,c;let[l,p]=To(r.major),d=""+p+r.minor;return(h=n)[c=d]||(h[c]=[]),n[d].push(w({},r,{battery:l,major:p})),n},{});Object.entries(o).forEach(n=>{let[r,h]=n,{uuid:c,major:l,minor:p,accuracy:d,battery:u}=h[0];if(h.length>1){let m=h.filter(g=>g.rssi<0),v=m.reduce((g,x)=>g+x.rssi,0);i.push([c,l,p,v/m.length,d,u])}else i.push([c,l,p,h[0].rssi,d,u])})}let s={command:"POSITION",index:this.uploadIndex++,ts:Date.now(),beacons:JSON.stringify([{type:"ibeacon",timestamp:Date.now()/1e3,res:i}]),ext_sensors:JSON.stringify({})};(e=this.sensorWebSocket)==null||e.send(s)}dispose(){var t,e,i,s;this.timer.dispose(),(t=this.positionWebSocket)==null||t.dispose(),this.positionWebSocket=null,(e=this.sensorWebSocket)==null||e.dispose(),this.sensorWebSocket=null,(i=this.pdrPosition)==null||i.dispose(),this.pdrPosition=null,(s=this.carInertialPosition)==null||s.dispose(),this.carInertialPosition=null,super.dispose()}constructor(t,e){super(),this.bmap=t,this.positionWebSocket=null,this.sensorWebSocket=null,this.pdrPosition=null,this.carInertialPosition=null,this.gpsFloor="",this.positionFloor="",this.useGpsFloorTimer=null,this.uploadIndex=0,this.path=null,this.timer=new z;let i=location.href.indexOf("?"),s=i!==-1?location.href.slice(i):location.search,o=new URLSearchParams(s),n=o.get("server_env")||"prod",r={test:"nav-test.aibee.cn",prod:"nav.aibee.cn"},h="wss://"+r[n]+"/aether-walker/indoor/position",c="wss://"+r[n]+"/aether-walker/indoor/sensor";this.options=w({place_id:o.get("place_id"),access_token:o.get("access_token"),env:n,wss_position_url:h,wss_sensor_url:c,get_gps_floor_url:"https://"+r[n]+"/aether-walker/indoor/conf",use_sensor:!1,type:-1,use_gps:!0,use_pdr:!0,upload_position:!0,use_default_permission:!0,ext_position_params:{},ext_sensor_params:{}},e),this.initPositionWebSocket(),this.options.use_sensor&&this.initSensorWebSocket(),this.options.use_pdr&&this.initPdr(),this.options.use_gps&&this.getGpsFloor()}};import"core-js/modules/web.dom-collections.iterator.js";var Vr=class extends B{showMyPosition(t,e){var i;let s=(i=this.bmap.context.currentFloor)==null?void 0:i.getGraphicPosition(t);if(s){let o=new be(this.bmap.context,{autoUpdate:!0,appendToBody:!1});o.div.appendChild(e),o.position.copy(this.bmap.mercatorToWorld(s)),this.myPositionOverlay=o,console.log("graphicPos",s,this)}else console.warn("[showMyPosition] \u6CA1\u6709\u627E\u5230\u56FE\u5143\u6240\u5728\u7684\u4F4D\u7F6E")}hideMyPosition(){this.myPositionOverlay&&(this.myPositionOverlay.dispose(),this.myPositionOverlay=null)}dispose(){this.hideMyPosition()}constructor(...t){super(...t),this.myPositionOverlay=null}};var Kr=class extends B{highlightPoi(t,e){e===void 0&&(e={icon_size:[40,40],collision_enable:!1}),t.map(s=>this.bmap.getPoiById(s)).filter(s=>!!s).forEach(s=>{var o;(o=s.userData).restore||(o.restore={});for(let h in e)if(h in s.options){var n,r;(n=s.userData.restore)[r=h]||(n[r]=s.options[h]),s.options[h]=e[h]}})}restorePoi(t){t.map(i=>this.bmap.getPoiById(i)).filter(i=>!!i).forEach(i=>{console.log("poi.userData.restore",i.userData.restore);for(let s in i.userData.restore)s in i.options&&(i.options[s]=i.userData.restore[s]);i.userData.restore={}})}};import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.sort.js";var Xr=class extends B{sortByDistance(t,e,i){return f(this,null,function*(){i===void 0&&(i=!1);let s=[...e];if(i||e.length<20)return yield Promise.all(s.map(o=>f(this,null,function*(){o.distance=yield this._getDistance(t,{floor:o.floor,x:o.center_x,y:o.center_y})}))),s.sort((o,n)=>o.distance-n.distance);{let o=s.sort((r,h)=>{let c=Math.sqrt((r.center_x-t.x)**2+(r.center_y-t.y)**2)+(t.floor===r.floor?0:100),l=Math.sqrt((h.center_x-t.x)**2+(h.center_y-t.y)**2)+(t.floor===h.floor?0:100);return c-l});return[...(yield Promise.all(o.slice(0,20).map(r=>f(this,null,function*(){return r.distance=yield this._getDistance(t,{floor:r.floor,x:r.center_x,y:r.center_y}),r})))).sort((r,h)=>r.distance-h.distance),...o.slice(20)]}})}_getDistance(t,e){return f(this,null,function*(){return this.navPath.getPath({floor:t.floor,coord:[t.x,t.y]},{floor:e.floor,coord:[e.x,e.y]},"",0).then(i=>i.reduce((s,o,n)=>{if(s+=o.distance,n!==i.length-1)switch(o.endType){case"escalator":case"straightLadder":case"staircase":case"ramp":s+=100;break}return s},0)).catch(i=>i==="near"?0:1/0)})}dispose(){super.dispose(),this.needDisposeNavPath&&this.navPath.dispose()}constructor(t,e){if(super(t),this.needDisposeNavPath=!1,e)this.navPath=e;else{this.navPath=new vs;let i=new Ie(t);this.needDisposeNavPath=!0,i.load(t.config.apiPath.loadPlaceInfo+"?place_id="+t.config.placeId+"&env=prod").then(s=>f(this,null,function*(){let[o,n]=yield Promise.all([i.getRoadNetworkData(),i.getFacilitiesData()]);this.navPath.setRoadData(o,n.infrastructures)}))}}};var qd="https://robot-vr-public.bj.bcebos.com/v1/static_resource/satellite_tiles",$d={base_url:qd},Yr=class extends B{setVisible(t){this.tileLayer.setVisibility(t)}dispose(){this.bmap.context.scene.remove(this.tileLayer),this.tileLayer.dispose(),super.dispose()}constructor(t,e){super(t),this.options=w({},$d,e),this.tileLayer=new pe(t.context,this.options),this.tileLayer.position.z=-1,this.bmap.context.scene.add(this.tileLayer)}};import{Box3 as Jd,Group as Qd}from"three";var qr=class extends B{addHeatmap(t,e){this.heatmap||(this.heatmap=new Ui(this.bmap.context),this.group.add(this.heatmap)),this.heatmap.loadData(t);let i=new Jd().setFromObject(e.graphicLayer);return this.heatmap.position.setZ(i.max.z+.1),this.heatmap}removeHeatMap(){this.heatmap&&(this.group.remove(this.heatmap),this.heatmap.dispose(),this.heatmap=null)}dispose(){this.removeHeatMap(),this.bmap.context.scene.remove(this.group)}constructor(t){super(t),this.heatmap=null,this.group=new Qd,this.bmap.context.scene.add(this.group)}};export{Ie as AibeeLoader,wr as BMap,Or as BMapSelect,vt as BaseSvg,Os as CarInertialPosition,vi as ClickHelper,ds as Context,ls as ContextCamera,cs as ContextScene,as as Control,xr as CrLoader,Ar as CrNavPath,Mr as Equipment,X as EventDispatcher,Xo as Events,At as Floor,Yn as GlbModel,Y as Graphic,Ti as GraphicLayer,he as GroundTexture,qr as Heatmap,Ui as HeatmapElement,Kr as HighlightPoi,it as HooksName,es as HoverHelper,Se as InstancedGraphic,Ii as InstancedModel,Ke as InstancedParkingSpace,Ji as InstancedWall,wi as KalmanFilter,Vi as Lane,H as Layer,$e as LineElement,OS as MapTypePolar,Ye as MergeAttributeGraphic,ce as MergeAttributeGroundTexture,qi as MergeAttributeLane,Xi as MergeAttributeWall,Qn as MergeGraphic,le as MergedAttributeGraphicLine,Gi as MergedGraphicLayer,Oi as MergedModelLayer,Ci as Model,Wr as MulFloorNavigation,Ur as MulFloorSelect,kr as MulFloors,vs as NavPath,Cr as Navigation,be as Overlay,Ai as ParkingLayer,GS as ParkingType,Ht as PathDirection,Ss as PdrPosition,ae as Poi,j as Poi2,ki as PoiLayer,Di as PoiLayer2,jr as Position,Qe as RENDER_VERSION,Nr as RecommendParkingSpace,hs as Renderer,wn as RoadNetwork,gi as RoadNetwork2,O as SENSOR_TYPE,Yr as SatelliteTile,Kn as SelectBox,ts as Selection,ws as Sensor,Li as Shadow,ni as Socket,Xr as SortByDistance,Hi as SvgLine,Ni as SvgPolygon,we as TaskQueue,Ki as TextTexture,pe as TileLayer,Fi as TileLoader,z as Timer,Qt as TweenUtil,Ko as UA,Vr as UseMyPosition,Zi as Wall,xi as WorkerPool,Gu as addAlphaToHexColor,me as calc_angle,Hs as calc_direction,mC as calculateInstantaneousSpeed,Ds as calculateLineDirection,Mn as convertToSnakeCase,He as createCircle,ui as createLine,qt as createRect,Zo as createSvg,di as createSvgElement,rf as createThreeBox,nf as createThreeLine,Wt as darkenColor,_p as defaultConfig,Zt as defaultGraphicOptions,uo as defaultOptions,nl as defaultTextTextureOptions,Mu as deviceToVector3,D as dispose,sn as distancePointToSegment,oe as generatorKeyByObj,Pa as getAngle,Ys as getBorderPoints,pi as getCenter,ur as getConfig,on as getDirectPath,Ns as getDirectionByAngle,nn as getDistanceByPathPos,k as getLength,_u as getLongestSideDir,Pu as getMinEdgeSquare,ht as getPathLength,Bt as getPointEdgeIndex,ve as getPosByPathDistance,Ho as hasChinese,Ws as hexToRgb,Uo as initDirectionalLight,Wo as initLight,hi as initShape,ag as instancedGeometiesAttributes,Bu as isAndroid,Yt as isContain,ye as isControl,Ut as isIphone,ge as isMac,No as isPointInPolygon,hg as isRectangle,yr as loadBuildingGround,lS as loadExternalStreet,vr as loadGraphics,rg as mergeGraphicGeometries,Xa as mergeGraphicLineGeometries,cm as moveOnRoute,oi as predictFuturePosition,fC as predictFutureSpeed,fe as proxyOptions,gC as removeOutliers,Sa as removeWeightPath,se as setCirclePosition,Mt as setLineStartEnd,ot as setRectPosition,mi as simplifyPath,Vo as sleepByRf,jo as sleepOnePromise,Bs as sleepOneRf,en as smoothPath,_n as splitStrByBracket,Ru as strToNumber,ft as timeoutPromise,tf as toWebWorker,yi as transformGraphicData,Lo as transformSpeed,xe as translatePosToCenter,F as triggerWorker,C as vector3ToDevice,em as xhrGet};
package/lib/meta.json CHANGED
@@ -6140,7 +6140,7 @@
6140
6140
  "format": "esm"
6141
6141
  },
6142
6142
  "../lib/src/plugins/recommend-parking-space/recommand-parking-space.js": {
6143
- "bytes": 1514,
6143
+ "bytes": 1523,
6144
6144
  "imports": [
6145
6145
  {
6146
6146
  "path": "../../../node_modules/.pnpm/@swc+helpers@0.5.17/node_modules/@swc/helpers/esm/_extends.js",
@@ -9734,7 +9734,7 @@
9734
9734
  "bytesInOutput": 1638
9735
9735
  },
9736
9736
  "../lib/src/plugins/recommend-parking-space/recommand-parking-space.js": {
9737
- "bytesInOutput": 723
9737
+ "bytesInOutput": 732
9738
9738
  },
9739
9739
  "../lib/src/plugins/recommend-parking-space/recommend.worker.js": {
9740
9740
  "bytesInOutput": 98
@@ -9764,7 +9764,7 @@
9764
9764
  "bytesInOutput": 575
9765
9765
  }
9766
9766
  },
9767
- "bytes": 406133
9767
+ "bytes": 406142
9768
9768
  }
9769
9769
  }
9770
9770
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aibee/crc-bmap",
3
- "version": "0.14.14",
3
+ "version": "0.14.15",
4
4
  "description": "",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "lib/index.esm.min.js",