@aibee/crc-bmap 0.14.33 → 0.14.34

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
@@ -545,7 +545,7 @@ void main() {
545
545
  gl_FragColor = vec4(uColor2, uOpacity); // \u5176\u4ED6\u9762\u989C\u8272\uFF09
546
546
  }
547
547
  }
548
- `,i=-1/0,s=this.geometry.getAttribute("position");if(s)for(let n=0;n<s.count;n++){let r=s.getZ(n);r>i&&(i=r)}let o=new Pt.ShaderMaterial({uniforms:{maxZ:{value:i},uColor:{value:new Pt.Color(this.options[0].fillColor).convertLinearToSRGB()},uColor2:{value:new Pt.Color(ge(this.options[0].fillColor)).convertLinearToSRGB()},uOpacity:{value:this.options[0].fillOpacity}},vertexShader:t,fragmentShader:e,transparent:!0});this.material=o}initLineMaterial(){let t=T.createLineMaterial({color:this.options[0].strokeColor,opacity:this.options[0].strokeOpacity});return this.lineMaterial=t,t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new Pt.Mesh(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],e=this.options[0].height+this.options[0].deltaHeight;return this.options.map(i=>{let{coords:s}=i.geometry;for(let o=0;o<s.length;o++){let n=s[o];for(let r=0;r<n.length;r++){let h=n[r],c=r+1===n.length?n[0]:n[r+1];t.push(new Pt.Vector3(h[0],h[1],e)),t.push(new Pt.Vector3(c[0],c[1],e))}}}),t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),e=new Pt.BufferGeometry().setFromPoints(t);this.lineGeometry=e}createBorder(){this.line&&this.remove(this.line);let t=new Pt.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t,e;this.geometry?(this.geometry.dispose(),this._listeners={}):this.addEventListener("init-geometry",()=>{var i;(i=this.geometry)==null||i.dispose(),this._listeners={}}),(t=this.material)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e,i){super(),this.context=t,this.mergedElement=i,this.options=[],i?(this.options=[i],this.initMergedElement()):(this.options=e.map(s=>w({},te,s)),this.init())}};var yv=require("core-js/modules/web.dom-collections.iterator.js"),vv=require("core-js/modules/es.array.push.js"),xv=require("core-js/modules/es.string.trim.js"),We=require("three"),xa=require("three/examples/jsm/utils/BufferGeometryUtils.js");var wa={airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},texts:[],fillColor:"#ffffff",fillOpacity:0,strokeColor:"#ffffff",strokeOpacity:0,secondHeight:0,secondRotate:0,center_x:0,center_y:0},Dc={fontFamily:"sans-serif",fontWeight:"normal",fontSize:64},Oc=2048,Rc=1,hs=class extends We.Object3D{init(){return f(this,null,function*(){let t=yield Promise.all(this.options.map(n=>f(this,null,function*(){let r=yield yt.ensureText(n.texts[0],Dc);return{options:n,atlas:r,layout:Gi(n.texts[0],r.charMap,r.spec,Oc)}}))),e=[],i=[];for(let n of t){let{options:r,layout:h,atlas:c}=n,l=si(h,{pivotX:.5,pivotY:.5,normalizeBottom:h.inkBottom,normalizeHeight:h.inkHeight});if(!l.length)continue;let p=new We.Matrix4().makeTranslation(r.center_x,r.center_y,r.airHeight+r.deltaHeight+r.height).multiply(new We.Matrix4().makeRotationZ(r.secondRotate)).multiply(new We.Matrix4().makeScale(r.secondHeight,r.secondHeight,1));for(let d of l)d.geometry.applyMatrix4(p),d.geometry.computeBoundingSphere(),e.push(d.geometry),i.push(this.createMaterial(n,c.pages[d.page].texture))}if(!e.length)return;let s=(0,xa.mergeGeometries)(e,!0);e.forEach(n=>n.dispose());let o=new We.Mesh(s,i);o.frustumCulled=!1,o.renderOrder=9e5,this.mesh=o,this.position.z+=.04,this.add(o)})}createMaterial(t,e){let{options:i,atlas:s}=t,o=typeof window!="undefined"&&window.devicePixelRatio||1;return Ws({atlas:e,fillColor:i.fillColor,fillOpacity:i.fillOpacity,outlineColor:i.strokeColor,outlineOpacity:i.strokeOpacity,outlineWidth:Rc*o,edge:1-s.spec.cutoff,depthWrite:!1})}get materials(){var t;let e=(t=this.mesh)==null?void 0:t.material;return e?Array.isArray(e)?e:[e]:[]}setOpacity(t){this.materials.forEach(e=>{e.uniforms.uOpacity.value=t})}dispose(){var t;(t=this.mesh)==null||t.geometry.dispose(),this.materials.forEach(e=>e.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e.map(i=>w({},wa,i)).filter(i=>i.texts[0].trim()),this.options.length&&this.init()}};var Pa=require("three"),Ma=require("three/examples/jsm/lines/Line2.js"),_a=require("three/examples/jsm/lines/LineGeometry.js"),ba=require("three/examples/jsm/lines/LineMaterial.js"),di=class extends Pa.Object3D{registryEvent(){this.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.context.removeEventListener("resize",this.onResize)}setPosition(t,e){this.lineGeometry.setPositions([t.x,t.y,t.z,e.x,e.y,e.z]),this.line||this.createLine()}createLine(){this.line=new Ma.Line2(this.lineGeometry,this.lineMaterial),this.line.renderOrder=100003,this.add(this.line)}dispose(){var t;this.unRegistryEvent(),this.line&&I(this.line),this.lineGeometry=null,this.lineMaterial=null,this.clear(),(t=this.line)==null||t.clear(),this.line=null}constructor(t,e,i){super(),this.context=t,this.lineGeometry=new _a.LineGeometry,this.lineMaterial=new ba.LineMaterial({color:0,transparent:!0,depthTest:!1,linewidth:2}),this.line=null,this.onResize=()=>{let{width:s,height:o}=this.context.clientSize;this.lineMaterial.resolution.set(s,o)},this.onResize(),this.registryEvent(),e&&i&&this.setPosition(e,i)}};var Sv=require("core-js/modules/es.array.push.js"),Cv=require("core-js/modules/web.dom-collections.iterator.js"),Ue=require("three");var ui=require("three");var Qi=class extends Ue.Object3D{loadModel(){return f(this,null,function*(){let t=yield At.loadModel(this.options[0].url);t.scene.updateMatrixWorld(!0);let e=t.scene.matrixWorld.clone().invert();t.scene.traverse(h=>{if(h.isMesh){let c=e.clone().multiply(h.matrixWorld),l=h.material;this.subMeshes.push({geometry:h.geometry,material:h.material,initialMatrix:c}),Array.isArray(l)?l.forEach(p=>{p.transparent=!0,this.materialOriginParams.set(p,{opacity:p.opacity})}):(l.transparent=!0,this.materialOriginParams.set(l,{opacity:l.opacity}))}});let i=this.subMeshes.map(h=>{let{geometry:c,material:l}=h;return new Ue.InstancedMesh(c,l,this.options.length)});t.scene.rotation.set(Math.PI/2,0,0);let o=new Ue.Box3().setFromObject(t.scene).getSize(new Ue.Vector3),n=Math.max(o.x,o.y);this.options.map(h=>{let c=new ui.Matrix4,l=h.width/n;return c.multiply(new ui.Matrix4().makeTranslation(h.center_x,h.center_y,h.airHeight+h.deltaHeight)).multiply(new ui.Matrix4().makeScale(l,l,l)).multiply(new ui.Matrix4().makeRotationZ(h.rotate)).multiply(new ui.Matrix4().makeRotationX(Math.PI/2)),h.url==="https://robot-vr-public.cdn.bcebos.com/ai-map-resource/757/1865371442288267264/smzsdrc.glb"&&console.log(h,c),c}).forEach((h,c)=>{i.forEach((l,p)=>{let d=h.clone().multiply(this.subMeshes[p].initialMatrix);l.setMatrixAt(c,d)})}),i.forEach(h=>{h.instanceMatrix.needsUpdate=!0,this.meshSetMaterial(h),this.add(h)})})}meshSetMaterial(t){t.isMesh&&(t.frustumCulled=!1,t.castShadow=!0,Array.isArray(t.material)?t.material.map(e=>{e.emissiveIntensity*=.95}):(t.material.emissiveIntensity*=.95,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map))}setOpacity(t,e){e===void 0&&(e=!1),this.subMeshes.forEach(i=>{let{material:s}=i;if(Array.isArray(s))s.forEach(o=>{if(e)o.opacity=t;else{let n=this.materialOriginParams.get(o)||{opacity:1};t>n.opacity?o.opacity=n.opacity:o.opacity=t}o.needsUpdate=!0});else{let o=this.materialOriginParams.get(s)||{opacity:1};t>o.opacity?s.opacity=o.opacity:s.opacity=t,s.needsUpdate=!0}}),this.children.forEach(i=>{i.instanceMatrix.needsUpdate=!0})}dispose(){this.children.forEach(t=>t.dispose()),I(this),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.subMeshes=[],this.materialOriginParams=new Map,this.loadModel()}};var He=require("three");var li=class extends He.Object3D{init(){return f(this,null,function*(){this.geometry=this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options.deltaHeight+this.options.airHeight,this.options.lineGeometry&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initGeometry(){return this.loader.parseGeometries([this.options.mergedGeometry])[this.options.mergedGeometry.uuid]}initMaterial(){this.material=T.GetMergeAttributeGraphicMaterial()}initLineMaterial(){return this.lineMaterial=T.GetMergeAttributeGraphicLineMaterial()}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new He.Mesh(this.geometry,this.material),this.add(this.mesh)}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.loader.parseGeometries([this.options.lineGeometry]);this.lineGeometry=t[this.options.lineGeometry.uuid]}createBorder(){this.line&&this.remove(this.line);let t=new He.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t;this.geometry&&this.geometry.dispose(),(t=this.line)==null||t.geometry.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.loader=new He.ObjectLoader,this.options=w({},te,e),this.init()}};var mi=require("three");var cs=class extends mi.Object3D{initGeometry(){return f(this,null,function*(){let t=new mi.ObjectLoader().parseGeometries([this.options.mergedGeometry]);this.geometry=t[this.options.mergedGeometry.uuid]})}init(){return f(this,null,function*(){var t;yield this.initGeometry();let e=new mi.Mesh(this.geometry,It.GetMergeAttributeWallMaterial());this.add(e);let i=(t=this.geometry)==null?void 0:t.getAttribute("opacity");i&&(this.originOpacities=Array.from(i.array))})}setOpacity(t,e){e===void 0&&(e=!1);var i;let s=(i=this.geometry)==null?void 0:i.getAttribute("opacity");if(s){for(let n=0;n<s.count;n++)if(e)s.setX(n,t);else{var o;s.setX(n,Math.min(t,(o=this.originOpacities[n])!=null?o:1))}s.needsUpdate=!0}}dispose(){var t;(t=this.geometry)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.originOpacities=[],this.init()}};var Uv=require("core-js/modules/es.typed-array.float32-array.js"),Hv=require("core-js/modules/es.typed-array.at.js"),Nv=require("core-js/modules/es.typed-array.fill.js"),Zv=require("core-js/modules/es.typed-array.find-last.js"),jv=require("core-js/modules/es.typed-array.find-last-index.js"),Vv=require("core-js/modules/es.typed-array.set.js"),Kv=require("core-js/modules/es.typed-array.sort.js"),Xv=require("core-js/modules/es.typed-array.to-reversed.js"),Yv=require("core-js/modules/es.typed-array.to-sorted.js"),qv=require("core-js/modules/es.typed-array.with.js"),$v=require("core-js/modules/es.array-buffer.constructor.js"),Jv=require("core-js/modules/es.array-buffer.slice.js"),Qv=require("core-js/modules/es.array-buffer.detached.js"),tx=require("core-js/modules/es.array-buffer.transfer.js"),ex=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js");var dt=require("three");var Ge=class extends dt.Object3D{init(){return f(this,null,function*(){let t=this.options.iconUrl,e=yield vt.getTextureByUrl(t),i=new dt.MeshBasicMaterial({map:e,transparent:!0,alphaTest:.2,side:dt.FrontSide}),s=new dt.InstancedMesh(this.geometry,i,this.options.mergedMatrixes.size);s.instanceMatrix=new dt.InstancedBufferAttribute(new Float32Array(this.options.mergedMatrixes.array),16),this.add(s),this.mesh=s,this.position.z+=.004})}setOpacity(t){this.mesh&&(this.mesh.material.opacity=t,this.mesh.material.needsUpdate=!0,this.mesh.instanceMatrix.needsUpdate=!0)}dispose(){var t;this.mesh&&I(this.mesh),(t=this.mesh)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new dt.ShapeGeometry(new dt.Shape([new dt.Vector2(-.5,-.5),new dt.Vector2(-.5,.5),new dt.Vector2(.5,.5),new dt.Vector2(.5,-.5)])),this.options=w({},$s,e);let i=new dt.Float32BufferAttribute([0,0,0,1,1,1,1,0],2);this.geometry.setAttribute("uv",i),this.init()}};var ax=require("core-js/modules/es.array.push.js"),Te=require("three");var dn=require("three/examples/jsm/lines/LineSegments2.js"),un=require("three/examples/jsm/lines/LineSegmentsGeometry.js");var ls=class extends Te.Object3D{initGeometry(){return f(this,null,function*(){let t=this.loader.parseGeometries([this.options.mergedGeometry]);this.geometry=t[this.options.mergedGeometry.uuid]})}initMaterial(){let t=T.createMeshBasicMaterial({color:"#ffffff",opacity:1,vertexColors:!0});return this.material=t,t}initDoubleLine(){if(this.options.dashedLineGeometry){let t=T.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:!0,resolution:new Te.Vector2(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0});t.transparent=!0,t.needsUpdate=!0;let e=new un.LineSegmentsGeometry;e.setPositions(this.options.dashedLineGeometry.positions),e.setColors(this.options.dashedLineGeometry.colors);let i=new dn.LineSegments2(e,t);i.computeLineDistances(),i.position.z+=.01,this.add(i),this.doubleLines.push(i)}if(this.options.lineGeometry){let t=T.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:!1,resolution:new Te.Vector2(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0}),e=new un.LineSegmentsGeometry;e.setPositions(this.options.lineGeometry.positions),e.setColors(this.options.lineGeometry.colors);let i=new dn.LineSegments2(e,t);i.position.z+=.01,this.add(i),this.doubleLines.push(i)}}init(){return f(this,null,function*(){yield this.initGeometry(),this.initMaterial();let t=new Te.Mesh(this.geometry,this.material);this.add(t),this.initDoubleLine(),this.position.z+=.02})}setOpacity(t){this.material.opacity=t,this.material.needsUpdate=!0,this.doubleLines.forEach(e=>{e.material.opacity=t,e.material.needsUpdate=!0})}dispose(){var t,e;(t=this.geometry)==null||t.dispose(),(e=this.lineGeometry)==null||e.dispose(),this.doubleLines.map(i=>i.geometry.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.doubleLines=[],this.loader=new Te.ObjectLoader,this.init()}};var dx=require("core-js/modules/es.typed-array.float32-array.js"),ux=require("core-js/modules/es.typed-array.at.js"),mx=require("core-js/modules/es.typed-array.fill.js"),fx=require("core-js/modules/es.typed-array.find-last.js"),gx=require("core-js/modules/es.typed-array.find-last-index.js"),yx=require("core-js/modules/es.typed-array.set.js"),vx=require("core-js/modules/es.typed-array.sort.js"),xx=require("core-js/modules/es.typed-array.to-reversed.js"),wx=require("core-js/modules/es.typed-array.to-sorted.js"),Px=require("core-js/modules/es.typed-array.with.js"),Mx=require("core-js/modules/es.array-buffer.constructor.js"),_x=require("core-js/modules/es.array-buffer.slice.js"),bx=require("core-js/modules/es.array-buffer.detached.js"),Ex=require("core-js/modules/es.array-buffer.transfer.js"),Sx=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),Cx=require("core-js/modules/web.dom-collections.iterator.js"),V=require("three");var ri=class extends V.Object3D{setColorByIndex(t,e){this.mesh&&(this.mesh.setColorAt(t,new V.Color(e).convertLinearToSRGB()),this.mesh.instanceColor.needsUpdate=!0)}init(){return f(this,null,function*(){this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight+this.options[0].airHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initMaterial(){this.material=T.GetInstancedGraphicMaterial()}initLineMaterial(){let t=T.GetMergeAttributeGraphicLineMaterial();this.lineMaterial=t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new V.InstancedMesh(this.geometry,this.material,this.options.length);let t=new V.InstancedBufferAttribute(new Float32Array(this.options.length),1),e=new V.InstancedBufferAttribute(new Float32Array(this.options.length),1);this.options.forEach((i,s)=>{let o=i.geometry.coords[0],[n,r,h]=o.slice(0,3),c=Math.sqrt((r[0]-n[0])**2+(r[1]-n[1])**2),l=Math.sqrt((h[0]-r[0])**2+(h[1]-r[1])**2),p=[c,l],d=Math.max(...p),u=Math.min(...p),g;d===c?g=[r[0]-n[0],r[1]-n[1]]:g=[h[0]-r[0],h[1]-r[1]];let[x,m]=g,v=Math.atan2(m,x)-Math.PI/2,P=new V.Matrix4().compose(new V.Vector3(i.center_coord_x,i.center_coord_y,(i.deltaHeight||0)+i.airHeight+i.height/2),new V.Quaternion().setFromAxisAngle(new V.Vector3(0,0,1),v),new V.Vector3(u,d,i.height));this.mesh.setMatrixAt(s,P),this.mesh.setColorAt(s,new V.Color(i.fillColor).convertLinearToSRGB());var _;t.array[s]=(_=i.fillOpacity)!=null?_:1;var L;e.array[s]=((L=i.deltaHeight)!=null?L:0)+i.airHeight+i.height}),this.originOpacity=[...t.array],this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.add(this.mesh),this.mesh.instanceMatrix.needsUpdate=!0}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let{points:t,colors:e,opacities:i}=Is(this.options),s=new V.BufferGeometry().setFromPoints(t);s.setAttribute("color",new V.BufferAttribute(new Float32Array(e),3)),s.setAttribute("opacity",new V.BufferAttribute(new Float32Array(i),1)),this.lineOriginOpacity=[...i],this.lineGeometry=s}createBorder(){this.line&&this.remove(this.line);let t=new V.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}setOpacity(t,e){e===void 0&&(e=!1);let i=this.geometry.getAttribute("opacity");for(let n=0;n<i.count;n++)if(e)i.array[n]=t;else{var s;i.array[n]=Math.min(t,(s=this.originOpacity[n])!=null?s:1)}if(i.needsUpdate=!0,this.lineGeometry){let n=this.lineGeometry.getAttribute("opacity");for(let r=0;r<n.count;r++)if(e)n.array[r]=t;else{var o;n.array[r]=Math.min(t,(o=this.lineOriginOpacity[r])!=null?o:1)}n.needsUpdate=!0}}dispose(){var t,e;this.geometry.dispose(),(t=this.mesh)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new V.BoxGeometry(1,1,1),this.options=[],this.originOpacity=[],this.lineOriginOpacity=[],this.options=e.map(i=>w({},te,i)),this.init()}};var Ox=require("core-js/modules/es.typed-array.float32-array.js"),Rx=require("core-js/modules/es.typed-array.at.js"),Fx=require("core-js/modules/es.typed-array.fill.js"),Gx=require("core-js/modules/es.typed-array.find-last.js"),Ix=require("core-js/modules/es.typed-array.find-last-index.js"),Bx=require("core-js/modules/es.typed-array.set.js"),zx=require("core-js/modules/es.typed-array.sort.js"),Wx=require("core-js/modules/es.typed-array.to-reversed.js"),Ux=require("core-js/modules/es.typed-array.to-sorted.js"),Hx=require("core-js/modules/es.typed-array.with.js"),Nx=require("core-js/modules/es.array-buffer.constructor.js"),Zx=require("core-js/modules/es.array-buffer.slice.js"),jx=require("core-js/modules/es.array-buffer.detached.js"),Vx=require("core-js/modules/es.array-buffer.transfer.js"),Kx=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),Xx=require("core-js/modules/web.dom-collections.iterator.js"),ie=require("three");var Qe=class extends ie.Object3D{init(){return f(this,null,function*(){this.initMaterial(),this.initMesh()})}initMaterial(){this.material=T.GetInstancedGraphicMaterial()}initMesh(){if(this.mesh&&this.remove(this.mesh),!this.elements)return;this.mesh=new ie.InstancedMesh(this.geometry,this.material,this.elements.size);let t=new ie.InstancedBufferAttribute(new Float32Array(this.elements.opacities),1),e=new ie.InstancedBufferAttribute(new Float32Array(this.elements.maxZs),1);this.originOpacities=[...t.array],this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.mesh.instanceMatrix.set(this.elements.matrixes),this.mesh.instanceColor=new ie.InstancedBufferAttribute(new Float32Array(this.elements.colors),3),this.add(this.mesh),this.mesh.instanceMatrix.needsUpdate=!0}setColorByIndex(t,e){this.mesh&&(this.mesh.setColorAt(t,new ie.Color(e).convertLinearToSRGB()),this.mesh.instanceColor.needsUpdate=!0)}setOpacityByIndex(t,e){if(this.mesh){let i=this.geometry.getAttribute("opacity");i.setX(t,e),i.needsUpdate=!0}}setMatrixByIndex(t,e){this.mesh&&(this.mesh.setMatrixAt(t,e),this.mesh.instanceMatrix.needsUpdate=!0)}setMaxZByIndex(t,e){if(this.mesh){let i=this.geometry.getAttribute("maxZ");i.setX(t,e),i.needsUpdate=!0}}setColorById(t,e){if(!this.elements)return;let i=this.elements.ids.findIndex(s=>s===t);i!==-1&&this.setColorByIndex(i,e)}setOpacityById(t,e){if(!this.elements)return;let i=this.elements.ids.findIndex(s=>s===t);i!==-1&&this.setOpacityByIndex(i,e)}setMatrixById(t,e){if(!this.elements)return;let i=this.elements.ids.findIndex(s=>s===t);i!==-1&&this.setMatrixByIndex(i,e)}setMaxZById(t,e){if(!this.elements)return;let i=this.elements.ids.findIndex(s=>s===t);i!==-1&&this.setMaxZByIndex(i,e)}setOpacity(t,e){if(e===void 0&&(e=!1),!this.geometry)return;let i=this.geometry.getAttribute("opacity");for(let o=0;o<i.count;o++)if(e)i.array[o]=t;else{var s;i.array[o]=Math.min(t,(s=this.originOpacities[o])!=null?s:1)}i.needsUpdate=!0}pushElements(t){this.elements?(this.elements.size+=t.size,this.elements.colors=[...this.elements.colors,...t.colors],this.elements.matrixes=[...this.elements.matrixes,...t.matrixes],this.elements.opacities=[...this.elements.opacities,...t.opacities],this.elements.maxZs=[...this.elements.maxZs,...t.maxZs],this.elements.ids=[...this.elements.ids,...t.ids],this.originOpacities=[...this.originOpacities,...t.opacities]):this.elements=t,this.refesh()}removeInstanceById(t){if(this.elements){if(this.mesh){let e=this.elements.ids.indexOf(t);e!==-1&&(this.elements.size--,this.elements.colors.splice(e*3,3),this.elements.matrixes.splice(e*16,16),this.elements.opacities.splice(e,1),this.elements.maxZs.splice(e,1),this.elements.ids.splice(e,1),this.originOpacities.splice(e,1))}this.refesh()}}refesh(){this.mesh&&(this.mesh.dispose(),this.remove(this.mesh)),this.init()}dispose(){var t;this.material=null,this.originOpacities.length=0,this.geometry.dispose(),(t=this.mesh)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.geometry=new ie.BoxGeometry(1,1,1),this.material=null,this.elements=null,this.originOpacities=[],this.elements=e,this.init()}};var Jx=require("core-js/modules/es.typed-array.float32-array.js"),Qx=require("core-js/modules/es.typed-array.at.js"),t0=require("core-js/modules/es.typed-array.fill.js"),e0=require("core-js/modules/es.typed-array.find-last.js"),i0=require("core-js/modules/es.typed-array.find-last-index.js"),s0=require("core-js/modules/es.typed-array.set.js"),o0=require("core-js/modules/es.typed-array.sort.js"),n0=require("core-js/modules/es.typed-array.to-reversed.js"),r0=require("core-js/modules/es.typed-array.to-sorted.js"),a0=require("core-js/modules/es.typed-array.with.js"),h0=require("core-js/modules/es.array-buffer.constructor.js"),c0=require("core-js/modules/es.array-buffer.slice.js"),l0=require("core-js/modules/es.array-buffer.detached.js"),p0=require("core-js/modules/es.array-buffer.transfer.js"),d0=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),u0=require("core-js/modules/web.dom-collections.iterator.js"),le=require("three");var ps=class extends le.Object3D{init(){return f(this,null,function*(){this.initMaterial(),this.initMesh()})}initMaterial(){this.material=T.GetInstancedWallMaterial()}initMesh(){if(this.mesh&&this.remove(this.mesh),!this.elements)return;this.mesh=new le.InstancedMesh(this.geometry,this.material,this.elements.size);let t=new le.InstancedBufferAttribute(new Float32Array(this.elements.opacities),1),e=new le.InstancedBufferAttribute(new Float32Array(this.elements.maxZs),1),i=new le.InstancedBufferAttribute(new Float32Array(this.elements.minZs),1);this.originOpacities=[...t.array],this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.geometry.setAttribute("minZ",i),this.mesh.instanceMatrix.set(this.elements.matrixes),this.mesh.instanceColor=new le.InstancedBufferAttribute(new Float32Array(this.elements.colors),3),this.add(this.mesh),this.mesh.instanceMatrix.needsUpdate=!0}setOpacityByIndex(t,e){if(this.mesh){let i=this.geometry.getAttribute("opacity");i.setX(t,e),i.needsUpdate=!0}}setOpacity(t,e){e===void 0&&(e=!1),this.elements&&this.elements.opacities.forEach((i,s)=>{let o=e?t:Math.min(t,this.originOpacities[s]);this.setOpacityByIndex(s,o)})}dispose(){this.mesh&&(this.mesh.dispose(),this.remove(this.mesh)),this.material=null,this.geometry&&this.geometry.dispose(),this.elements=null}constructor(t,e){super(),this.geometry=new le.BoxGeometry(1,1,1),this.material=null,this.elements=null,this.originOpacities=[],this.elements=e,this.init()}};var fi=require("three");var Ie=class extends fi.Object3D{init(){return f(this,null,function*(){this.initLineGeometry(),this.initLineMaterial(),this.createBorder()})}initLineMaterial(){return this.lineMaterial=T.GetMergeAttributeGraphicLineMaterial()}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.loader.parseGeometries([this.options]);this.lineGeometry=t[this.options.uuid]}createBorder(){this.line&&this.remove(this.line);let t=new fi.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t;(t=this.lineGeometry)==null||t.dispose(),this.lineMaterial=null,this.clear()}constructor(t,e){super(),this.context=t,this.lineMaterial=null,this.loader=new fi.ObjectLoader,this.options=w({},te,e),this.init()}};var Ea=require("three"),Js=class extends Tt{setEnable(t){super.setEnable(t),Y(this.rect,0,0,0,0),t?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:e,container:{clientWidth:i,clientHeight:s}}}=this,o=A(this.startPoint,e,i,s),n=A(this.endPoint,e,i,s),r={x:Math.min(o.x,n.x),y:Math.min(o.y,n.y)},h={x:Math.max(o.x,n.x),y:Math.max(o.y,n.y)},c=this.searchMapInFrustum(r,h);this.dispatchEvent({type:"selected",list:c})}}searchMapInFrustum(t,e){var i;let{context:s}=this;return((i=s.currentFloor)==null?void 0:i.graphicLayer.children.filter(o=>o instanceof st&&this.searchChildInFrustum(o,t,e)))||[]}searchChildInFrustum(t,e,i){let{context:{camera:s,container:{clientWidth:o,clientHeight:n}}}=this;if(!t)return!1;if(!t.mesh){let d=t.getPosition();if(d){let u=A(d,s,o,n);return Ee(u,e,i)}return!1}t.mesh.geometry.boundingBox||t.mesh.geometry.computeBoundingBox();let r=t.mesh.geometry.boundingBox;if(!r)return!1;let{min:h,max:c}=r,l=A(h,s,o,n),p=A(c,s,o,n);return!(!Ee(l,e,i)||!Ee(p,e,i))}dispose(){super.dispose(),this.rect=null,this.unRegistryEvent()}constructor(t){super(t),this.frustum=new Ea.Frustum,this.onPointerDown=s=>{if(!this.enable)return;let o=this.getIntersectByPointerEvent(s);o&&(this.startPoint=o),this.endPoint=void 0},this.onPointerMove=s=>{if(!this.enable||!this.startPoint)return;let o=this.getIntersectByPointerEvent(s);o&&(this.endPoint=o)},this.onPointerUp=s=>{if(!this.enable)return;let o=this.getIntersectByPointerEvent(s);o&&(this.endPoint=o),this.doSelect(),this.startPoint=void 0},this.onUpdate=()=>{if(this.startPoint){let s=this.getSvgCoordinate(this.startPoint),o=w({},s);this.endPoint&&(o=this.getSvgCoordinate(this.endPoint));let n={x:Math.min(s.x,o.x),y:Math.min(s.y,o.y)},r=Math.abs(o.x-s.x),h=Math.abs(o.y-s.y);Y(this.rect,n.x,n.y,r,h)}else Y(this.rect,0,0,0,0)};let{config:{selectBox:{fill:e,stroke:i}}}=t;this.rect=Rt(i,e),this.svg.appendChild(this.rect),this.registryEvent()}};var ds=class extends Sa.EventDispatcher{get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.context.config.enableBoxSelect||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.context.control.enablePan,this.prevRotateStatus=this.context.control.enableRotate,this.context.control.enablePan=!1,this.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.context.control.enablePan=!!this.prevPanStatus,this.context.control.enableRotate=!!this.prevRotateStatus)}selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.container.addEventListener("pointerout",this.onPointerOut),this.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.container.removeEventListener("pointerout",this.onPointerOut),this.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(t){this._list.delete(t)}dispose(){this.unRegistryEvent()}constructor(t){super(),this.context=t,this._list=new Set,this.downPoint=null,this.downTime=0,this.isMultipleSelect=!1,this.onPointerDown=e=>{Date.now()-this.downTime<200||(this.downPoint={x:e.offsetX,y:e.offsetY},this.downTime=Date.now())},this.onPointerUp=e=>{if(!this.downPoint)return;let{offsetX:i,offsetY:s}=e,{x:o,y:n}=this.downPoint;if(Math.sqrt((o-i)**2+(n-s)**2)>3)return;let{graphics:r}=this.context.getGraphicsByDeviceXy(i,s),h=new Set(r.map(l=>l.options.id));this.context.getPoisByDeviceXy(i,s).forEach(l=>{if(!h.has(l.options.id)){var p;let d=((p=this.context.currentFloor)==null?void 0:p.graphicLayer.graphicMap.get(l.options.id))||null;d&&d.options.geometry.type==="point"&&(r.push(d),h.add(l.options.id))}}),(Ve?e.metaKey:e.ctrlKey)||this._list.clear(),r.forEach(l=>this._list.add(l)),this.selectEnd(),this.downPoint=null},this.onPointerOut=e=>{this.disableBoxSelection()},this.onKeyDown=e=>{Ke(e.key)&&this.enableBoxSelection()},this.onKeyUp=e=>{Ke(e.key)&&this.disableBoxSelection()},this.onBoxSelected=e=>{let{list:i}=e;this._list.clear(),i.forEach(s=>{this._list.add(s)}),this.selectEnd()},this.boxSelection=new Js(t),this.boxSelection.setEnable(!1),this.registryEvent()}};var B0=require("core-js/modules/es.set.difference.v2.js"),z0=require("core-js/modules/es.set.intersection.v2.js"),W0=require("core-js/modules/es.set.is-disjoint-from.v2.js"),U0=require("core-js/modules/es.set.is-subset-of.v2.js"),H0=require("core-js/modules/es.set.is-superset-of.v2.js"),N0=require("core-js/modules/es.set.symmetric-difference.v2.js"),Z0=require("core-js/modules/es.set.union.v2.js"),j0=require("core-js/modules/web.dom-collections.iterator.js");var Qs=require("three");var us=class extends Qs.EventDispatcher{handleHoverGraphicsChange(t){t===void 0&&(t=this.curGraphics),this.dispatchEvent({type:"hover-change",graphics:Array.from(t)})}registryEvent(){this.context.addEventListener("pointer-over",this.onPointerMove),this.context.addEventListener("pointer-move",this.onPointerMove),this.context.addEventListener("pointer-level",this.onPointerLevel),document.body.addEventListener("pointermove",this.onBodyPointerMove)}unRegistryEvent(){this.context.removeEventListener("pointer-over",this.onPointerMove),this.context.removeEventListener("pointer-move",this.onPointerMove),this.context.removeEventListener("pointer-level",this.onPointerLevel),document.body.removeEventListener("pointermove",this.onBodyPointerMove)}dispose(){this.unRegistryEvent(),this.timer.dispose()}constructor(t){super(),this.context=t,this.curGraphics=new Set,this.timer=new J,this.graphicTimerMap=new Map,this.onPointerMove=e=>{let{graphics:i,pois:s,e:o}=e,n=s.map(l=>{var p;return(p=this.context.currentFloor)==null?void 0:p.graphicLayer.graphicMap.get(l.options.id)}).filter(l=>l&&l.options.geometry.type==="point");if(!i.length&&!n.length&&this.curGraphics.size){this.curGraphics.clear(),this.handleHoverGraphicsChange();return}let{time:r}=this.context.config.hover,h=new Set;if(n.length){let l,p=1e4;n.forEach(d=>{let u=s.find(g=>g.options.id===d.options.id);if(u instanceof Re){let{x:g,y:x}=u.clientPos,m=Math.sqrt((g-o.offsetX)**2+(x-o.offsetY)**2);m<p&&(p=m,l=d)}else if(u instanceof rt){let{x:g,y:x}=u.box.getCenter(new Qs.Vector2),m=Math.sqrt((g-o.offsetX)**2+(x-o.offsetY)**2);m<p&&(p=m,l=d)}}),h.add(l)}h.size||i.forEach(l=>h.add(l)),h.forEach(l=>{if(this.graphicTimerMap.get(l)||this.curGraphics.has(l))return;let p=this.timer.setTimeout(()=>{this.curGraphics.add(l),this.graphicTimerMap.delete(l),this.timer.clearTimeout(p),this.handleHoverGraphicsChange()},r);this.graphicTimerMap.set(l,p)}),this.graphicTimerMap.forEach((l,p)=>{h.has(p)||(this.timer.clearTimeout(l),this.graphicTimerMap.delete(p))});let c=this.curGraphics.size;this.curGraphics.forEach(l=>{h.has(l)||this.curGraphics.delete(l)}),c!==this.curGraphics.size&&this.handleHoverGraphicsChange()},this.onPointerLevel=()=>{this.curGraphics.clear(),this.handleHoverGraphicsChange()},this.onBodyPointerMove=e=>{if(this.curGraphics.size){let i=this.context.container.getBoundingClientRect();(e.clientX<i.left||e.clientX>i.right||e.clientY<i.top||e.clientY>i.bottom)&&this.onPointerLevel()}},this.registryEvent()}};var Y0=require("core-js/modules/web.dom-collections.iterator.js"),Xt=require("three");var ms=require("@turf/turf"),to=class{updateBox(){this.box.setFromObject(this.context.scene)}setEnable(t){this.enable=t,t?this.registryEvent():this.unRegistryEvent()}changePrevCamera(){this.prevCamera={position:this.context.camera.position.clone(),zoom:this.context.camera.zoom,target:this.context.control.target.clone()}}backToPrevCamera(){this.setEnable(!1),this.context.camera.position.copy(this.prevCamera.position),this.context.camera.zoom=this.prevCamera.zoom,this.context.control.target.copy(this.prevCamera.target),this.context.control.update(),this.setEnable(!0)}registryEvent(){this.context.addEventListener("control-change",this.onCameraChange)}unRegistryEvent(){this.context.removeEventListener("control-change",this.onCameraChange)}getCurFloorScreenPosition(){if(!this.context.scene.children.filter(g=>g instanceof ce).length)return null;let e=this.box,{camera:i,clientSize:{width:s,height:o}}=this.context,{min:n,max:r}=e,c=[new Xt.Vector3(n.x,n.y,n.z),new Xt.Vector3(r.x,n.y,n.z),new Xt.Vector3(n.x,r.y,n.z),new Xt.Vector3(r.x,r.y,n.z),new Xt.Vector3(n.x,n.y,r.z),new Xt.Vector3(r.x,n.y,r.z),new Xt.Vector3(n.x,r.y,r.z),new Xt.Vector3(r.x,r.y,r.z)].map(g=>A(g,i,s,o)),l=Math.min(...c.map(g=>g.x)),p=Math.max(...c.map(g=>g.x)),d=Math.min(...c.map(g=>g.y)),u=Math.max(...c.map(g=>g.y));return{left:l,right:p,top:d,bottom:u}}checkDistanceToScreenEdge(t){let{left:e,right:i,top:s,bottom:o}=t,{width:n,height:r}=this.context.clientSize,[h,c,l,p]=this.context.config.cameraBound.padding,d=(0,ms.polygon)([[[e,s],[i,s],[i,o],[e,o],[e,s]]]),u=(0,ms.polygon)([[[p,h],[n-c,h],[n-c,r-l],[p,r-l],[p,h]]]);try{return(0,ms.intersect)(d,u)!==null}catch(g){return console.warn("\u8BA1\u7B97\u4EA4\u96C6\u51FA\u9519:",g),!1}}dispose(){this.unRegistryEvent()}constructor(t){this.context=t,this.prevCamera={position:new Xt.Vector3,zoom:1,target:new Xt.Vector3},this.enable=!0,this.box=new Xt.Box3,this.onCameraChange=()=>{let e=this.getCurFloorScreenPosition();if(e){let{left:i,right:s,top:o,bottom:n}=e;if([i,s,o,n].every(h=>!h))return;this.checkDistanceToScreenEdge({left:i,right:s,top:o,bottom:n})?this.changePrevCamera():this.backToPrevCamera()}},this.registryEvent(),this.changePrevCamera()}};var iw=require("core-js/modules/es.promise.finally.js"),mn=require("three"),ti=require("@tweenjs/tween.js");var Q0=require("core-js/modules/web.dom-collections.iterator.js"),tw=require("core-js/modules/es.array.push.js"),E=require("three"),eo=new E.Ray,Ca=new E.Plane,Fc=Math.cos(70*E.MathUtils.DEG2RAD),io=class extends E.EventDispatcher{dispose(){this.domElement.removeEventListener("contextmenu",this.onContextMenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("pointercancel",this.onPointerUp),this.domElement.removeEventListener("wheel",this.onMouseWheel),this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp),this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=null)}constructor(t,e){super(),this.rotateLineStart=new E.Vector2,this.rotateLineEnd=new E.Vector2,this.spherical=new E.Spherical,this.sphericalDelta=new E.Spherical,this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new E.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.screenSpacePanning=!1,this.mouseButtons={LEFT:E.MOUSE.PAN,MIDDLE:E.MOUSE.DOLLY,RIGHT:E.MOUSE.ROTATE},this.touches={ONE:E.TOUCH.PAN,TWO:E.TOUCH.DOLLY_ROTATE},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return r.phi},this.getAzimuthalAngle=function(){return r.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(y){y.addEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=y},this.stopListenToKeyEvents=function(){var y;(y=this._domElementKeyEvents)==null||y.removeEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=null},this.saveState=function(){i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=function(){i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent({type:"change"}),i.update(),o=s.NONE},this.update=function(){let y=new E.Vector3,M=new E.Quaternion().setFromUnitVectors(t.up,new E.Vector3(0,1,0)),X=M.clone().invert(),lt=new E.Vector3,Nt=new E.Quaternion,ue=new E.Vector3,ne=2*Math.PI;return function(Si){Si===void 0&&(Si=null);let Me=i.object.position;y.copy(Me).sub(i.target),y.applyQuaternion(M),r.setFromVector3(y),i.autoRotate&&o===s.NONE&&at(B(Si)),i.enableDamping?(r.theta+=h.theta*i.dampingFactor,r.phi+=h.phi*i.dampingFactor):(r.theta+=h.theta,r.phi+=h.phi);let _e=i.minAzimuthAngle,be=i.maxAzimuthAngle;isFinite(_e)&&isFinite(be)&&(_e<-Math.PI?_e+=ne:_e>Math.PI&&(_e-=ne),be<-Math.PI?be+=ne:be>Math.PI&&(be-=ne),_e<=be?r.theta=Math.max(_e,Math.min(be,r.theta)):r.theta=r.theta>(_e+be)/2?Math.max(_e,r.theta):Math.min(be,r.theta)),r.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,r.phi)),r.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(l,i.dampingFactor):i.target.add(l),i.zoomToCursor&&R||i.object.isOrthographicCamera?r.radius=G(r.radius):r.radius=G(r.radius*c),y.setFromSpherical(r),y.applyQuaternion(X),Me.copy(i.target).add(y),i.object.lookAt(i.target),i.enableDamping===!0?(h.theta*=1-i.dampingFactor,h.phi*=1-i.dampingFactor,l.multiplyScalar(1-i.dampingFactor)):(h.set(0,0,0),l.set(0,0,0));let ks=!1;if(i.zoomToCursor&&R){let Ci=null;if(i.object.isPerspectiveCamera){let Li=y.length();Ci=G(Li*c);let As=Li-Ci;i.object.position.addScaledVector(L,As),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){let Li=new E.Vector3(C.x,C.y,0);Li.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/c)),i.object.updateProjectionMatrix(),ks=!0;let As=new E.Vector3(C.x,C.y,0);As.unproject(i.object),i.object.position.sub(As).add(Li),i.object.updateMatrixWorld(),Ci=y.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;Ci!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(Ci).add(i.object.position):(eo.origin.copy(i.object.position),eo.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(eo.direction))<Fc?t.lookAt(i.target):(Ca.setFromNormalAndCoplanarPoint(i.object.up,i.target),eo.intersectPlane(Ca,i.target))))}else i.object.isOrthographicCamera&&(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/c)),i.object.updateProjectionMatrix(),ks=!0);return c=1,R=!1,ks||lt.distanceToSquared(i.object.position)>n||8*(1-Nt.dot(i.object.quaternion))>n||ue.distanceToSquared(i.target)>0?(i.dispatchEvent({type:"change"}),lt.copy(i.object.position),Nt.copy(i.object.quaternion),ue.copy(i.target),ks=!1,!0):!1}}();let i=this,s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},o=s.NONE,n=1e-6,r=new E.Spherical,h=new E.Spherical,c=1,l=new E.Vector3,p=new E.Vector2,d=new E.Vector2,u=new E.Vector2,g=new E.Vector2,x=new E.Vector2,m=new E.Vector2,v=new E.Vector2,P=new E.Vector2,_=new E.Vector2,L=new E.Vector3,C=new E.Vector2,R=!1,b=[],U={};function B(y){return y!==null?2*Math.PI/60*i.autoRotateSpeed*y:2*Math.PI/60/60*i.autoRotateSpeed}function z(){return Math.pow(.95,i.zoomSpeed)}function at(y){h.theta-=y}function ft(y){h.phi-=y}let K=function(){let y=new E.Vector3;return function(X,lt){y.setFromMatrixColumn(lt,0),y.multiplyScalar(-X),l.add(y)}}(),ht=function(){let y=new E.Vector3;return function(X,lt){i.screenSpacePanning===!0?y.setFromMatrixColumn(lt,1):(y.setFromMatrixColumn(lt,0),y.crossVectors(i.object.up,y)),y.multiplyScalar(X),l.add(y)}}(),N=function(){let y=new E.Vector3;return function(X,lt){let Nt=i.domElement;if(i.object.isPerspectiveCamera){let ue=i.object.position;y.copy(ue).sub(i.target);let ne=y.length();ne*=Math.tan(i.object.fov/2*Math.PI/180),K(2*X*ne/Nt.clientHeight,i.object.matrix),ht(2*lt*ne/Nt.clientHeight,i.object.matrix)}else i.object.isOrthographicCamera?(K(X*(i.object.right-i.object.left)/i.object.zoom/Nt.clientWidth,i.object.matrix),ht(lt*(i.object.top-i.object.bottom)/i.object.zoom/Nt.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}}();function zt(y){i.object.isPerspectiveCamera||i.object.isOrthographicCamera?c/=y:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function ct(y){i.object.isPerspectiveCamera||i.object.isOrthographicCamera?c*=y:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function W(y){if(!i.zoomToCursor)return;R=!0;let M=i.domElement.getBoundingClientRect(),X=y.clientX-M.left,lt=y.clientY-M.top,Nt=M.width,ue=M.height;C.x=X/Nt*2-1,C.y=-(lt/ue)*2+1,L.set(C.x,C.y,1).unproject(i.object).sub(i.object.position).normalize()}function G(y){return Math.max(i.minDistance,Math.min(i.maxDistance,y))}function tt(y){p.set(y.clientX,y.clientY)}function $(y){W(y),v.set(y.clientX,y.clientY)}function pe(y){g.set(y.clientX,y.clientY)}function de(y){d.set(y.clientX,y.clientY),u.subVectors(d,p).multiplyScalar(i.rotateSpeed);let M=i.domElement;at(2*Math.PI*u.x/M.clientHeight),ft(2*Math.PI*u.y/M.clientHeight),p.copy(d),i.update()}function Ae(y){P.set(y.clientX,y.clientY),_.subVectors(P,v),_.y>0?zt(z()):_.y<0&&ct(z()),v.copy(P),i.update()}function Pe(y){x.set(y.clientX,y.clientY),m.subVectors(x,g).multiplyScalar(i.panSpeed),N(m.x,m.y),g.copy(x),i.update()}function Ei(y){W(y),y.deltaY<0?ct(z()):y.deltaY>0&&zt(z()),i.update()}function eh(y){let M=!1;switch(y.code){case i.keys.UP:y.ctrlKey||y.metaKey||y.shiftKey?ft(2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):N(0,i.keyPanSpeed),M=!0;break;case i.keys.BOTTOM:y.ctrlKey||y.metaKey||y.shiftKey?ft(-2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):N(0,-i.keyPanSpeed),M=!0;break;case i.keys.LEFT:y.ctrlKey||y.metaKey||y.shiftKey?at(2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):N(i.keyPanSpeed,0),M=!0;break;case i.keys.RIGHT:y.ctrlKey||y.metaKey||y.shiftKey?at(-2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):N(-i.keyPanSpeed,0),M=!0;break}M&&(y.preventDefault(),i.update())}function Vn(){if(b.length===1)p.set(b[0].pageX,b[0].pageY);else{let y=(b[0].pageX-b[0].pageY)/(b[1].pageX-b[1].pageY),M=b[0].pageY-y*b[0].pageX;i.rotateLineStart.set(y,M);let X=.5*(b[0].pageX+b[1].pageX),lt=.5*(b[0].pageY+b[1].pageY);p.set(X,lt)}}function Kn(){if(b.length===1)g.set(b[0].pageX,b[0].pageY);else{let y=.5*(b[0].pageX+b[1].pageX),M=.5*(b[0].pageY+b[1].pageY);g.set(y,M)}}function Xn(){let y=b[0].pageX-b[1].pageX,M=b[0].pageY-b[1].pageY,X=Math.sqrt(y*y+M*M);v.set(0,X)}function ih(){i.enableZoom&&Xn(),i.enablePan&&Kn()}function sh(){i.enableZoom&&Xn(),i.enableRotate&&Vn()}function Yn(y){if(b.length==1)d.set(y.pageX,y.pageY);else{let X=To(y),lt=.5*(y.pageX+X.x),Nt=.5*(y.pageY+X.y);d.set(lt,Nt);let ue=(y.pageY-X.y)/(y.pageX-X.x),ne=X.y-ue*X.x;if(i.rotateLineEnd.set(ue,ne),Number.isFinite(i.rotateLineEnd.x)&&Number.isFinite(i.rotateLineStart.x)){let ko=(i.rotateLineStart.y-i.rotateLineEnd.y)/(i.rotateLineEnd.x-i.rotateLineStart.x),Si=ue*ko+ne;if(Number.isFinite(ko)&&Number.isFinite(Si)){let Me=Math.atan(i.rotateLineEnd.x)-Math.atan(i.rotateLineStart.x);Math.PI-Math.abs(Me)<.5&&(Me=-Math.sign(Me)*(Math.PI-Math.abs(Me))),Math.abs(Me)<.1&&(h.theta+=Me)}}i.rotateLineStart.copy(i.rotateLineEnd)}u.subVectors(d,p).multiplyScalar(i.rotateSpeed);let M=i.domElement;ft(2*Math.PI*u.y/M.clientHeight),p.copy(d)}function qn(y){if(b.length===1)x.set(y.pageX,y.pageY);else{let M=To(y),X=.5*(y.pageX+M.x),lt=.5*(y.pageY+M.y);x.set(X,lt)}m.subVectors(x,g).multiplyScalar(i.panSpeed),N(m.x,m.y),g.copy(x)}function $n(y){let M=To(y),X=y.pageX-M.x,lt=y.pageY-M.y,Nt=Math.sqrt(X*X+lt*lt);P.set(0,Nt),_.set(0,Math.pow(P.y/v.y,i.zoomSpeed)),zt(_.y),v.copy(P)}function oh(y){i.enableZoom&&$n(y),i.enablePan&&qn(y)}function nh(y){i.enableZoom&&$n(y),i.enableRotate&&Yn(y)}this.onPointerDown=function(M){i.enabled!==!1&&(b.length===0&&(i.domElement.setPointerCapture(M.pointerId),i.domElement.addEventListener("pointermove",i.onPointerMove),i.domElement.addEventListener("pointerup",i.onPointerUp)),lh(M),M.pointerType==="touch"?hh(M):rh(M))},this.onPointerMove=function(M){i.enabled!==!1&&(M.pointerType==="touch"?ch(M):ah(M))},this.onPointerUp=function(M){ph(M),b.length===0&&(i.domElement.releasePointerCapture(M.pointerId),i.domElement.removeEventListener("pointermove",i.onPointerMove),i.domElement.removeEventListener("pointerup",i.onPointerUp)),i.dispatchEvent({type:"end"}),o=s.NONE};function rh(y){let M;switch(y.button){case 0:M=i.mouseButtons.LEFT;break;case 1:M=i.mouseButtons.MIDDLE;break;case 2:M=i.mouseButtons.RIGHT;break;default:M=-1}switch(M){case E.MOUSE.DOLLY:if(i.enableZoom===!1)return;$(y),o=s.DOLLY;break;case E.MOUSE.ROTATE:if(y.ctrlKey||y.metaKey||y.shiftKey){if(i.enablePan===!1)return;pe(y),o=s.PAN}else{if(i.enableRotate===!1)return;tt(y),o=s.ROTATE}break;case E.MOUSE.PAN:if(y.ctrlKey||y.metaKey||y.shiftKey){if(i.enableRotate===!1)return;tt(y),o=s.ROTATE}else{if(i.enablePan===!1)return;pe(y),o=s.PAN}break;default:o=s.NONE}o!==s.NONE&&i.dispatchEvent({type:"start"})}function ah(y){switch(o){case s.ROTATE:if(i.enableRotate===!1)return;de(y);break;case s.DOLLY:if(i.enableZoom===!1)return;Ae(y);break;case s.PAN:if(i.enablePan===!1)return;Pe(y);break}}this.onMouseWheel=function(M){i.enabled===!1||i.enableZoom===!1||o!==s.NONE||(M.preventDefault(),i.dispatchEvent({type:"start"}),Ei(M),i.dispatchEvent({type:"end"}))},this.onKeyDown=function(M){i.enabled===!1||i.enablePan===!1||eh(M)};function hh(y){switch(Jn(y),b.length){case 1:switch(i.touches.ONE){case E.TOUCH.ROTATE:if(i.enableRotate===!1)return;Vn(),o=s.TOUCH_ROTATE;break;case E.TOUCH.PAN:if(i.enablePan===!1)return;Kn(),o=s.TOUCH_PAN;break;default:o=s.NONE}break;case 2:switch(i.touches.TWO){case E.TOUCH.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;ih(),o=s.TOUCH_DOLLY_PAN;break;case E.TOUCH.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;sh(),o=s.TOUCH_DOLLY_ROTATE;break;default:o=s.NONE}break;default:o=s.NONE}o!==s.NONE&&i.dispatchEvent({type:"start"})}function ch(y){switch(Jn(y),o){case s.TOUCH_ROTATE:if(i.enableRotate===!1)return;Yn(y),i.update();break;case s.TOUCH_PAN:if(i.enablePan===!1)return;qn(y),i.update();break;case s.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;oh(y),i.update();break;case s.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;nh(y),i.update();break;default:o=s.NONE}}this.onContextMenu=function(M){i.enabled!==!1&&M.preventDefault()};function lh(y){b.push(y)}function ph(y){delete U[y.pointerId];for(let M=0;M<b.length;M++)if(b[M].pointerId==y.pointerId){b.splice(M,1);return}}function Jn(y){let M=U[y.pointerId];M===void 0&&(M=new E.Vector2,U[y.pointerId]=M),M.set(y.pageX,y.pageY)}function To(y){let M=y.pointerId===b[0].pointerId?b[1]:b[0];return U[M.pointerId]}i.domElement.addEventListener("contextmenu",this.onContextMenu),i.domElement.addEventListener("pointerdown",this.onPointerDown),i.domElement.addEventListener("pointercancel",this.onPointerUp),i.domElement.addEventListener("wheel",this.onMouseWheel,{passive:!1}),this.update()}};var fs=class extends io{registryEvent(){this.addEventListener("change",this.onChange),this.context.addEventListener("update",this.tweenUpdate)}unRegistryEvent(){this.removeEventListener("change",this.onChange),this.context.removeEventListener("update",this.tweenUpdate)}setPolarAngle(t,e){e===void 0&&(e=!1);let{maxPolarAngle:i,minPolarAngle:s}=this,o=i===s;(e||t<=i&&t>=s)&&(this.maxPolarAngle=t,this.minPolarAngle=t,this.update()),o||(this.maxPolarAngle=i,this.minPolarAngle=s)}setPolarAngleByDuration(t,e,i){return f(this,null,function*(){return e===void 0&&(e=!1),i===void 0&&(i=500),i<=0?this.setPolarAngle(t,e):jt(new Promise(s=>{let o={polar:this.getPolarAngle()},n={polar:t},r=new ti.Tween(o,this.tweenGroup).to(n,i).onUpdate(()=>{this.setPolarAngle(o.polar,e)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(r),s(!0)}).onStart(()=>{this.enabled=!1}).start()}),i+500)})}setAzimuthalAngle(t,e){let{maxAzimuthAngle:i,minAzimuthAngle:s}=this,o=i===s;(e||t<=i&&t>=s)&&(this.maxAzimuthAngle=t,this.minAzimuthAngle=t,this.update()),o||(this.maxAzimuthAngle=i,this.minAzimuthAngle=s)}setAzimuthalAngleDuration(t,e,i){return e===void 0&&(e=!1),i===void 0&&(i=500),i<=0?this.setAzimuthalAngle(t,e):jt(new Promise(s=>{let o={azimuthal:this.getAzimuthalAngle()},n={azimuthal:t},r=new ti.Tween(o,this.tweenGroup).to(n,i).onUpdate(()=>{this.setAzimuthalAngle(o.azimuthal,e)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(r),s(!0)}).onStart(()=>{this.enabled=!1}).start()}),i+500)}getCameraLookAt(){return new mn.Vector3().subVectors(this.target,this.camera.position)}setCameraPositionByTarget(t,e){return f(this,null,function*(){let i=this.target.clone(),s=this.getCameraLookAt();if(!e){this.camera.position.copy(t.clone().sub(s)),this.target.copy(t.clone()),this.update();return}return jt(new Promise(o=>{let n=new ti.Tween(i,this.tweenGroup).to(t,e).onUpdate(()=>{this.camera.position.copy(i.clone().sub(s)),this.target.copy(i.clone()),this.update()}).onComplete(()=>{this.tweenGroup.remove(n),this.enabled=!0,o(!0)}).onStart(()=>{this.enabled=!1}).start()}),e+500)})}setZoom(t,e,i){i===void 0&&(i=!1);let{minZoom:s,maxZoom:o}=this;(i||t>=s&&t<=o)&&(this.camera.position.copy(e.clone().sub(this.getCameraLookAt())),this.target.copy(e),this.camera.zoom=t,this.update())}setZoomByDuration(t,e,i,s){return f(this,null,function*(){i===void 0&&(i=!1),s===void 0&&(s=500);let o={zoom:this.camera.zoom,target:this.target.clone()};if(!(t===this.camera.zoom&&!i))return s?jt(new Promise(n=>{let r=new ti.Tween(o,this.tweenGroup).to({zoom:t,target:e},s).onUpdate(()=>{this.setZoom(o.zoom,o.target,i)}).onComplete(()=>{this.tweenGroup.remove(r),this.enabled=!0,n(!0)}).onStart(()=>{this.enabled=!1}).start()}),s+500).finally(()=>{this.enabled=!0}):this.setZoom(t,e,i)})}setTargetByOffset(t,e){if(e===void 0&&(e=this.target.clone()),this.camera.updateMatrix(),t){let i=new mn.Vector3;i.setFromMatrixColumn(this.camera.matrix,1),i.normalize(),i.multiplyScalar(t/this.camera.zoom),e.add(i)}this.setCameraPositionByTarget(e,0)}clearTween(){this.tweenGroup.getAll().forEach(t=>t.stop()),this.tweenGroup.removeAll()}dispose(){super.dispose(),this.unRegistryEvent(),this.clearTween()}constructor(t,e,i){super(e,i),this.context=t,this.camera=e,this.domElement=i,this.prevCameraZoom=1,this.tweenGroup=new ti.Group,this.offsetY=0,this.onChange=()=>{let s=this.camera.zoom;s!==this.prevCameraZoom&&(this.prevCameraZoom=s,this.dispatchEvent({type:"change-zoom",zoom:s}))},this.tweenUpdate=()=>{this.tweenGroup.update()},this.enableDamping=!1,this.zoomSpeed=.5,this.prevCameraZoom=e.zoom,this.registryEvent()}};var gi=require("three");var gs=class extends gi.WebGLRenderer{setCameraAndScene(t,e){this.scene=t,this.camera=e}autoRender(){if(this.scene&&this.camera&&this.enable&&(this.event.dispatchEvent({type:"update"}),this.render(this.scene,this.camera)),this.context.config.renderAnimation==="requestAnimationFrame")this.timer.requestAnimationFrame(()=>{this.autoRender()});else{let t=1e3/this.context.config.fps;this.timer.setTimeout(()=>{this.autoRender()},t)}}pauseRender(){this.enable=!1}continueRender(){this.enable=!0}addEventListener(t,e){this.event.addEventListener(t,e)}removeEventListener(t,e){this.event.removeEventListener(t,e)}constructor(t,e){super(w({antialias:!0,alpha:!0},e)),this.context=t,this.event=new gi.EventDispatcher,this.enable=!0,this.timer=new J,this.autoClear=!0,this.setPixelRatio(window.devicePixelRatio),this.toneMapping=gi.LinearToneMapping,this.toneMappingExposure=1;let i=this.dispose;this.dispose=()=>{this.timer.dispose(),this.enable=!1,i.call(this),this.domElement.remove(),this.domElement=null,this.shadowMap=null,this.info.programs&&(this.info.programs.length=0),this.info=null}}};var Aa=require("three");var La=require("three"),Ta=require("three/examples/jsm/environments/RoomEnvironment.js");function ka(a,t){t===void 0&&(t=.85);let e=new La.PMREMGenerator(a);return e.compileEquirectangularShader(),e.fromScene(new Ta.RoomEnvironment).texture}var ys=class extends Aa.Scene{dispose(){var t;(t=this.environment)==null||t.dispose(),this.environment=null,I(this),this.clear()}constructor(t){super(),this.environment=ka(t)}};var Da=require("three"),vs=class extends Da.OrthographicCamera{constructor(t,e){super(-t/2,t/2,e/2,-e/2,-1e4,5e4),this.up.set(0,0,1),this.position.set(0,0,100),this.lookAt(0,0,0)}};var fn=require("@turf/turf");var fw=require("core-js/modules/es.array.unshift.js"),gw=require("core-js/modules/es.array.push.js"),Oa=require("three"),so=class{registryEvent(){this.context.addEventListener("update",this.onUpdate),this.context.addEventListener("control-change",this.onControlChange),this.context.addEventListener("resize",this.onControlChange)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate),this.context.removeEventListener("control-change",this.onControlChange),this.context.removeEventListener("resize",this.onControlChange)}changePoiLevelOrCollisionEnable(t){let e=this.objects.findIndex(i=>i===t);e!==-1&&(this.objects.splice(e,1),this.addObject(t))}addObject(t){if(!this.objects.includes(t)){if(this.needsUpdate=!0,!t.options.collision_enable){this.objects.unshift(t);return}if(t.options.level===0){this.objects.push(t);return}for(let e=0;e<this.objects.length;e++){let i=this.objects[e];if(i.options.collision_enable&&i.options.level<=t.options.level){this.objects.splice(e,0,t);return}}this.objects.push(t)}}removeObject(t){let e=this.objects.indexOf(t);e!==-1&&(this.objects.splice(e,1),this.needsUpdate=!0)}removeObjects(t){this.objects=this.objects.filter(e=>!t.includes(e)),this.needsUpdate=!0}getObjectById(t){return this.objects.find(e=>e.options.id===t)||null}validShowParkingSpace(t){t===void 0&&(t=60);let{clientSize:{width:e,height:i},control:s,camera:o}=this.context,n=Math.min(e/t,i/t,s.maxZoom-1);return o.zoom>=n}detectCollisions(){if(!this.needsUpdate)return;let t=[],{camera:e}=this.context;e.updateMatrixWorld();let i=l=>l<=1&&l>=-1,s=e.projectionMatrix.clone();s.multiply(e.matrixWorldInverse);let o=e.zoom/this.context.basicZoom,n=25/30,r=Math.min(25,Math.max(1,o*n)),h=this.validShowParkingSpace();this.objects.filter(l=>{if(l.visible){if(!(r<=l.options.maxWeight&&r>=l.options.minWeight)||!h&&l.userData.type==="parkingSpace")return l.parentSetVisible(!1),!1;let p=l.getLabelOriginWorldPosition(new Oa.Vector3);return p.applyMatrix4(s),l.screenPosition=p,i(p.x)&&i(p.y)&&i(p.z)?!0:(l.parentSetVisible(!1),!1)}return!1}).forEach((l,p)=>{let d=l.getBox(l.screenPosition);if(d===null){l.parentSetVisible(!1);return}if(p===0||!l.options.collision_enable){t.push(d),l.parentSetVisible(!0);return}let u=t.some(g=>g.intersectsBox(d));l.parentSetVisible(!u),u||t.push(d)}),this.needsUpdate=!1}markForUpdate(){this.needsUpdate=!0}clear(){this.objects=[],this.needsUpdate=!0}dispose(){this.objects=[],this.unRegistryEvent()}constructor(t){this.context=t,this.objects=[],this.needsUpdate=!0,this.onUpdate=()=>{this.detectCollisions()},this.onControlChange=()=>{this.needsUpdate=!0},this.registryEvent()}};var xs=class extends F.EventDispatcher{get config(){return this.bmap.config}get center(){return this.bmap.buildingCenter}setRange(t){this.range=(0,fn.polygon)([t])}resizeClientSize(){let{x:t,y:e,width:i,height:s}=this.container.getBoundingClientRect();this.clientSize={width:i||this.container.clientWidth,height:s||this.container.clientHeight,x:t,y:e}}init(){let{clientWidth:t,clientHeight:e}=this.container;this.camera=new vs(t,e),this.renderer.setSize(t,e),this.renderer.setCameraAndScene(this.scene,this.camera),this.renderer.autoRender(),this.control=new fs(this,this.camera,this.renderer.domElement),this.control.maxPolarAngle=this.config.control.maxPolar,this.container.appendChild(this.renderer.domElement),this.scene.add(this.lights),this.basicRatio=this.getRatio(),this.control.addEventListener("change",this.onControlChange),this.control.addEventListener("change-zoom",this.onControlChangeZoom),this.renderer.addEventListener("update",this.onRendererUpdate),this.cameraBound=new to(this)}getRatio(t,e){t===void 0&&(t=new F.Vector3(0,0,0)),e===void 0&&(e=new F.Vector3(100,0,0));let{clientWidth:i,clientHeight:s}=this.container,o=A(t,this.camera,i,s),n=A(e,this.camera,i,s);return Math.ceil(Math.sqrt((n.x-o.x)**2+(n.y-o.y)**2))}changeAmbientLightColor(t){this.lights.children.forEach(e=>{e instanceof F.AmbientLight&&(e.color=new F.Color(t))})}switchFloor(t,e){e===void 0&&(e=!0),console.log("switchFloor",e),this.currentFloor&&(this.scene.remove(this.currentFloor),e?this.currentFloor.dispose():this.currentFloor.onRemoveFromScene()),this.currentFloor=t,this.setRange(t.userData.range||[]),this.scene.add(t),t.onAddToScene("scene"),this.cameraBound.updateBox()}getGraphicsByDeviceXy(t,e){var i,s;let o=new F.Vector2;o.x=t/this.clientSize.width*2-1,o.y=e/this.clientSize.height*-2+1;let n=new F.Raycaster;n.setFromCamera(o,this.camera),n.ray.origin.sub(n.ray.direction.clone().multiplyScalar(100));let r=(i=this.currentFloor)==null?void 0:i.graphicLayer.getGraphicByRaycaster(n),h=(s=this.currentFloor)==null?void 0:s.parkingSpaceLayer.getParkingSpaceByRaycaster(n);return r!=null&&r.graphics.length&&(h!=null&&h.graphics.length)?r.distance<h.distance?r:h:r!=null&&r.graphics.length?r:h!=null&&h.graphics.length?h:{graphics:[],position:null}}getPoisByDeviceXy(t,e){var i,s;let o=(i=this.currentFloor)==null?void 0:i.poiLayer.getPoiByDeviceXy(t,e),n=(s=this.currentFloor)==null?void 0:s.poiLayer2.getPoiByDeviceXy(t,e);return(o||[]).concat(n||[])}registryEvent(){window.addEventListener("resize",this.onWindowResize),this.container.addEventListener("click",this.onClick),this.container.addEventListener("pointerover",this.onPointerover),this.container.addEventListener("pointermove",this.onPointermove),this.container.addEventListener("pointerleave",this.onPointerleave),this.container.addEventListener("pointercancel",this.onPointerleave),this.container.addEventListener("pointerout",this.onPointerleave),this.selection.addEventListener("select",this.onSelectionSelect),this.hoverHelper.addEventListener("hover-change",this.onHoverChange)}unRegistryEvent(){window.removeEventListener("resize",this.onWindowResize),this.container.removeEventListener("click",this.onClick),this.container.removeEventListener("pointerover",this.onPointerover),this.container.removeEventListener("pointermove",this.onPointermove),this.container.removeEventListener("pointerleave",this.onPointerleave),this.container.removeEventListener("pointercancel",this.onPointerleave),this.container.removeEventListener("pointerout",this.onPointerleave),this.selection.removeEventListener("select",this.onSelectionSelect),this.hoverHelper.removeEventListener("hover-change",this.onHoverChange),this.control.removeEventListener("change",this.onControlChange),this.control.removeEventListener("change-zoom",this.onControlChangeZoom),this.renderer.removeEventListener("update",this.onRendererUpdate)}setPolarAngle(t,e){return e===void 0&&(e=500),this.control.setPolarAngleByDuration(t,!0,e)}setAzimuthalAngle(t,e){return e===void 0&&(e=500),this.control.setAzimuthalAngleDuration(t,!0,e)}getCameraLookAt(){return this.control.getCameraLookAt()}setZoom(t,e,i){return i===void 0&&(i=500),this.control.setZoomByDuration(t,e,!0,i)}getFitCameraToObjectZoom(t,e,i){return e===void 0&&(e=[20,20,20,20]),i===void 0&&(i=!0),this.getFitCameraToBoxZoom(new F.Box3().setFromObject(t),e,i)}getFitCameraToBoxZoom(t,e,i){e===void 0&&(e=[20,20,20,20]),i===void 0&&(i=!0);let[s,o,n,r]=e,{clientSize:{width:h,height:c}}=this,l=this.control.getPolarAngle();i&&this.setPolarAngle(0,0),this.setPolarAngle(l,0),this.camera.updateMatrixWorld(),this.camera.updateProjectionMatrix();let{max:p,min:d}=t,u=new F.Vector3(d.x,p.y,p.z),g=new F.Vector3(p.x,p.y,p.z),x=new F.Vector3(p.x,d.y,d.z),m=new F.Vector3(d.x,d.y,d.z),v=A(u,this.camera,h,c),P=A(g,this.camera,h,c),_=A(m,this.camera,h,c),L=A(x,this.camera,h,c),R=new F.Box2().setFromPoints([new F.Vector2(v.x,v.y),new F.Vector2(P.x,P.y),new F.Vector2(_.x,_.y),new F.Vector2(L.x,L.y)]).getSize(new F.Vector2),b=(h-o-r)/R.x,U=(c-s-n)/R.y,B=Math.min(b,U),z=new F.Vector3((p.x+d.x)/2,(p.y+d.y)/2,(p.z+d.z)/2),at=B*this.camera.zoom,ft=this.camera.clone();ft.zoom=at,ft.updateMatrix();let K=(o-r)/2,ht=(s-n)/2;if(K){let N=new F.Vector3;N.setFromMatrixColumn(ft.matrix,0),N.normalize(),N.multiplyScalar(K/at),z.add(N)}if(ht){let N=new F.Vector3;N.setFromMatrixColumn(ft.matrix,1),N.normalize(),N.multiplyScalar(ht/at),z.add(N)}return{zoom:B*this.camera.zoom,center:z}}fitCameraToObject(t,e,i,s){e===void 0&&(e=[20,20,20,20]),i===void 0&&(i=500),s===void 0&&(s=!0);let{zoom:o,center:n}=this.getFitCameraToObjectZoom(t,e,s);return this.setZoom(o,n,i)}fitCameraToBox(t,e,i,s){e===void 0&&(e=[20,20,20,20]),i===void 0&&(i=500),s===void 0&&(s=!0);let{zoom:o,center:n}=this.getFitCameraToBoxZoom(t,e,s);return this.setZoom(o,n,i)}getFitCameraToGroundZoom(t,e,i){if(t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),i===void 0&&(i=!0),this.currentFloor&&this.currentFloor.hasElement)return this.getFitCameraToObjectZoom(this.currentFloor.groundUpper,t,i).zoom}fitCameraToGround(t,e,i){return t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),i===void 0&&(i=!0),this.currentFloor&&this.currentFloor.hasElement?this.fitCameraToObject(this.currentFloor.groundLayer,t,e,i):Promise.resolve(!1)}setCameraPosition(t,e){return f(this,null,function*(){return this.control.setCameraPositionByTarget(t,e)})}pauseRender(){this.renderer.pauseRender()}continueRender(){this.renderer.continueRender()}forceUpdate(){this.collisionSystem.needsUpdate=!0}dispose(){var t;this.collisionSystem.dispose(),(t=this.currentFloor)==null||t.dispose(),this.control.dispose(),this.cameraBound.dispose(),this.selection.dispose(),this.hoverHelper.dispose(),this.unRegistryEvent(),this.renderer.dispose(),this.lights.children.forEach(e=>e.dispose()),this.scene.dispose(),this.container=null,this.renderer=null}constructor(t,e){super(),this.container=t,this.lights=Oo(),this.range=(0,fn.polygon)([]),this.clientSize={width:0,height:0,x:0,y:0},this.renderRf=0,this.basicZoom=1,this.debugCollisionBox=!1,this.onControlChange=()=>{this.dispatchEvent({type:"change-ratio",px:(this.basicRatio||0)*this.camera.zoom}),this.dispatchEvent({type:"control-change"})},this.onControlChangeZoom=i=>{let{zoom:s}=i;this.dispatchEvent({type:"control-zoom-change",zoom:s})},this.onRendererUpdate=()=>{this.dispatchEvent({type:"update"})},this.onWindowResize=()=>{let{container:i,camera:s,renderer:o}=this,{clientWidth:n,clientHeight:r}=i;n=Math.max(1,n),r=Math.max(1,r),s.left=-n/2,s.right=n/2,s.top=r/2,s.bottom=-r/2,s.updateProjectionMatrix(),o.setSize(n,r),this.resizeClientSize(),this.dispatchEvent({type:"resize",width:n,height:r})},this.onClick=i=>{let{graphics:s,position:o}=this.getGraphicsByDeviceXy(i.offsetX,i.offsetY);s.length&&this.dispatchEvent({type:"graphic-click",graphics:s,position:o});let n=this.getPoisByDeviceXy(i.offsetX,i.offsetY);n.length&&this.dispatchEvent({type:"poi-click",pois:n});let r=null,h=new F.Vector2;h.x=i.offsetX/this.clientSize.width*2-1,h.y=i.offsetY/this.clientSize.height*-2+1;let c=new F.Raycaster;c.setFromCamera(h,this.camera);let l=new F.Plane(new F.Vector3(0,0,1),0),p=new F.Vector3;if(c.ray.intersectPlane(l,p)?r=p:(c.ray.direction.negate(),c.ray.intersectPlane(l,p)&&(r=p)),r){let d=this.bmap.coordinateTransform.worldToMercator(r);this.dispatchEvent({type:"click",position:r,mercator:d})}},this.onPointerover=i=>{let{graphics:s,position:o}=this.getGraphicsByDeviceXy(i.offsetX,i.offsetY),n=this.getPoisByDeviceXy(i.offsetX,i.offsetY);this.dispatchEvent({type:"pointer-over",e:i,graphics:s,pois:n,position:o})},this.onPointermove=i=>{let{graphics:s,position:o}=this.getGraphicsByDeviceXy(i.offsetX,i.offsetY),n=this.getPoisByDeviceXy(i.offsetX,i.offsetY);this.dispatchEvent({type:"pointer-move",e:i,graphics:s,pois:n,position:o})},this.onPointerleave=i=>{this.dispatchEvent({type:"pointer-level"})},this.onSelectionSelect=i=>{let{graphics:s,isMultipleSelect:o}=i;this.dispatchEvent({type:"select-graphic",graphics:s,isMultipleSelect:o})},this.onHoverChange=i=>{let{graphics:s}=i;this.dispatchEvent({type:"hover",graphics:s})},this.bmap=e,this.container.style.position="relative",this.container.style.overflow="hidden",this.renderer=new gs(this),this.scene=new ys(this.renderer),this.collisionSystem=new so(this),this.init(),this.selection=new ds(this),this.hoverHelper=new us(this),this.resizeClientSize(),this.registryEvent()}};var Ra=require("lodash"),Fa={placeId:0,fps:30,apiDomain:"",apiInfo:{},apiPath:{floorGraphic:"/api/inception-map/floor/get",floorRange:"/api/inception-map/range/get",equipmentList:"/api/inception-map/equipment/get",roadNetwork:"/api/inception-map/road_network/get",loadPlaceInfo:"https://screen.aibee.cn/ai-map/map/get-floor-map"},enableBoxSelect:!0,resizeObserver:{enable:!1,debounceTime:5},initTransToMark:!1,heatMap:{radius:50,minOpacity:.1,gradient:{0:"#8F9FCD",.5:"#6284FF",1:"#F95D5D"}},useFloorCache:!0,control:{maxPolar:1.2,defaultPolar:1.1,defaultAzimuthal:0,maxZoomScale:30},defaultPadding:[20,20,20,20],svg:{circle:{radius:"2",fill:"#1CADFF"},line:{stroke:"#1CADFF"}},selectBox:{stroke:"#1CADFF",fill:"rgba(28, 173, 255, 0.3)"},hover:{time:100},ground:{color:"#F6F6F6",opacity:1,height:.001,stroke:!1,strokeColor:"#E6E6E6",strokeOpacity:1},markGraphic:{color:"#EEF0F3",opacity:1,height:.001,stroke:!1,strokeColor:"#000",strokeOpacity:1},graphic:{fillOpacity:1},cameraBound:{padding:[150,150,150,150]},poi:{boxScale:1},loaderPlaceConfig:{textFontSize:14},poiTextBackground:{enable:!1,color:"#FFFFFF",opacity:1},renderAnimation:"setTimeout"};function gn(a){return typeof a.resizeObserver=="boolean"&&(a.resizeObserver={enable:a.resizeObserver}),(0,Ra.merge)({},Fa,a)}var za=require("lodash");var Nw=require("core-js/modules/es.regexp.exec.js"),Zw=require("core-js/modules/web.dom-collections.iterator.js");var ro=require("three");var Fw=require("core-js/modules/es.array.push.js"),Gw=require("core-js/modules/web.dom-collections.iterator.js");var Aw=require("core-js/modules/es.array.sort.js");var yi=function(a){return a.LAYERED_RENDER_VERSION="layeredRender",a.MERGED_RENDER_VERSION="mergedRender",a}({});function oo(a,t){let e=a.poi_info.showName||a.store_name||a.poi_info.text;switch(t){case"zh-cn":return e;case"en":var i;return((i=a.store_info_ext)==null?void 0:i.poi_name)||e;case"zh-hk":var s;return((s=a.store_info_ext)==null?void 0:s.traditional_name)||e}}function no(a,t){let e=a.poi_info.showName||a.store_name||a.poi_info.text;switch(t){case"zh-cn":return e;case"en":var i;return((i=a.infra_info_ext)==null?void 0:i.poi_name)||e;case"zh-hk":var s;return((s=a.infra_info_ext)==null?void 0:s.traditional_name)||e}}var yn=["range","ground","store","facility","parkingSpace"];function Ga(a){return yn.indexOf(a.l_type)===-1?yn.length:yn.indexOf(a.l_type)}function Gc(a){a.layers.sort((t,e)=>Ga(t)-Ga(e))}function Ic(a){let t=a.layers.find(i=>i.l_type==="range"),e=[t.elements[0].center_x,t.elements[0].center_y];a.layers.map(i=>{if(i.l_type!=="range")return Bi(i.elements,e)})}function ws(a){Gc(a),Ic(a)}function vi(a,t){return t===void 0&&(t=6),a.floor_id+"_"+a.version_id+(t?"_"+t:"")}function Ia(a,t,e){switch(a.l_type){case"ground":return vn(a,t);case"graph":return Bc(a,t,e);case"wall":return zc(a,t);case"lane":return Wc(a,t);case"texture2d":case"texture3d":return Uc(a,t);case"glb":return Hc(a,t);case"store":return Nc(a,t,e);case"facility":return jc(a,t,e);case"parkingSpace":return Kc(a,t,e);case"text":return Yc(a,t)}}function Ba(a,t,e,i,s){switch(a.l_type){case"store":return Zc(a,t,e,i,s);case"facility":return Vc(a,t,e,i,s);case"parkingSpace":return Xc(a,t,i,s)}}function Bc(a,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(a.elements,a.mergedElements):a.elements.map(i=>{let s=t.addGraphic(w({},i,{dashed:!1}));t.userData.graphics.push(s),t.userData.graphicMap.set(i.id,s)})}function vn(a,t){let e=a.elements.map(i=>new st(t.context,w({},i,{dashed:!1})));t.addGrounds(e)}function zc(a,t){if(a.mergedElements)a.mergedElements.map(e=>{if(e.instancedGeometry){let i=new ps(t.context,e.instancedGeometry);t.wallLayer.add(i)}if(e.mergedGeometry){let i=new cs(t.context,e);t.wallLayer.add(i)}});else{let e=a.elements.reduce((i,s)=>{let{fillColor:o,fillOpacity:n,strokeColor:r,strokeOpacity:h,height:c}=s,l=o.toLowerCase()+"-"+n+"-"+r.toLowerCase()+"-"+h+"-"+c;return h===0&&(l=o.toLowerCase()+"-"+n+"-"+c),i[l]?i[l].push(s):i[l]=[s],i},{});Object.values(e).forEach(i=>{let s=new rs(t.context,i);t.wallLayer.add(s)})}}function Wc(a,t){if(a.mergedElements){let e=new ls(t.context,a.mergedElements);t.laneLayer.add(e)}else{let e=new as(t.context,a.elements);t.laneLayer.add(e)}}function Uc(a,t){if(a.mergedMatrixes)a.mergedMatrixes.map(e=>{let i=new Ge(t.context,e);t.textureLayer.add(i)});else if(a.elements.length){let e=new Fe(t.context,a.elements);t.textureLayer.add(e)}}function Hc(a,t){t.glbModelLayer.addModels(a.elements.map(e=>w({},e,{url:e.secondUrl,rotate:e.secondRotate,width:e.secondWidth,center_x:e.center_coord_x,center_y:e.center_coord_y,deltaHeight:0})))}function Nc(a,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(a.elements,a.mergedElements):a.elements.map(i=>{let s=t.addGraphic(w({},i,{dashed:!1}));t.userData.graphics.push(s),t.userData.graphicMap.set(i.id,s)})}function Zc(a,t,e,i,s){a.elements.filter(o=>s.filterPoi(o)).map(o=>{try{let n=oo(o,e),r=new rt(t.context,{id:o.id,icon:o.poi_info.showImageUrl||o.poi_info.icon,text:n,position:{x:o.center_coord_x,y:o.center_coord_y,z:o.airHeight+o.height},icon_size:[24,24],level:o.poi_info.level||0,hide_text:!i.showStoreName,maxWeight:o.poi_info.maxWeight||25,minWeight:o.poi_info.minWeight||1,text_font_size:i.textFontSize});t.poiLayer2.pushPoi(r),r&&(r.userData.type="store",r.userData.data=o,r.userData.floor=t.name)}catch(n){console.log("\u521B\u5EFA\u5E97\u94FApoi\u5931\u8D25",n,o)}})}function jc(a,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(a.elements,a.mergedElements):a.elements.map(i=>{let s=t.addGraphic(w({},i,{dashed:!1}));t.userData.graphics.push(s),t.userData.graphicMap.set(i.id,s)})}function Vc(a,t,e,i,s){a.elements.filter(o=>o.poi_info).filter(o=>s.filterPoi(o)).map(o=>{try{let n=no(o,e),r=new rt(t.context,{id:o.id,icon:o.poi_info.showImageUrl||o.poi_info.icon,text:n,position:{x:o.center_coord_x,y:o.center_coord_y,z:o.airHeight+o.height},icon_size:[24,24],level:o.poi_info.level||0,hide_text:!i.showFacilityName,maxWeight:o.poi_info.maxWeight||25,minWeight:o.poi_info.minWeight||1,text_font_size:i.textFontSize});t.poiLayer2.pushPoi(r),r.userData.type="facility",r.userData.data=o,r.userData.floor=t.name}catch(n){console.log("\u6DFB\u52A0facility\u5931\u8D25",n,o)}})}function Kc(a,t,e){t.parkingSpaceLayer.load(a,e.mergeParkingSpace),t.userData.parkingSpaces=t.parkingSpaceLayer.graphicMap.values(),t.userData.parkingSpacesGraphicMap=t.parkingSpaceLayer.graphicMap}function Xc(a,t,e,i){return f(this,null,function*(){a.elements.filter(o=>o.texts[0]).filter(o=>i.filterPoi(o)).forEach(o=>{try{let n=o.displayName||o.texts[0],r=new rt(t.context,{id:o.id,text:n,position:{x:o.center_coord_x,y:o.center_coord_y,z:o.airHeight+o.height},text_font_size:e.textFontSize});r&&(r.userData.type="parkingSpace",r.userData.data=o,r.userData.floor=t.name),t.poiLayer2.pushPoi(r)}catch(n){console.log("\u6DFB\u52A0\u8F66\u4F4Dpoi\u5931\u8D25",n,o)}})})}function Yc(a,t){let e=new hs(t.context,a.elements.map(i=>w({},i,{center_x:i.center_coord_x,center_y:i.center_coord_y})));t.textTextureLayer.add(e)}var qc={};function xn(){return new Worker(new URL("./worker/loader.worker-52WGVNK2.js",qc.url))}var $c={mergeParkingSpace:!0,mergeGraphic:!0,renderVersion:yi.MERGED_RENDER_VERSION,layers:["graph","wall","lane","texture2d","texture3d","glb","store","facility","parkingSpace","text"],filterPoi:()=>!0},ei=class extends pt{initDb(){return f(this,null,function*(){try{let{db:t}=yield Bs();this.db=t}catch(t){console.log("[\u6253\u5F00indexDb\u9519\u8BEF]",t)}})}load(t,e){return f(this,null,function*(){if(Array.isArray(t))this.floors=t,e&&(this.placeConfig=w({},this.placeConfig,e));else if(typeof t=="string"){let i=yield fetch(t).then(s=>s.json());if(i.code===200){let s=location.origin;this.floors=i.data.list.map(o=>{let n=/^http(s?):\/\//.test(o.entry_infra_url),r=/^http(s?):\/\//.test(o.map_url),h=/^http(s?):\/\//.test(o.route_url);return w({},o,{entry_infra_url:n?o.entry_infra_url:""+s+o.entry_infra_url,map_url:r?o.map_url:""+s+o.map_url,route_url:h?o.route_url:""+s+o.route_url})}),this.placeConfig=w({},this.placeConfig,JSON.parse(i.data.config||"{}"),e)}}else return this.load("https://screen.aibee.cn/ai-map/map/get-floor-map?place_id="+t,e);this.getOtherDataByFreeTime()})}setCacheData(t,e,i){return f(this,null,function*(){return this.initDbPromise.then(()=>zs(t,""+e,i))})}getCacheData(t,e){return f(this,null,function*(){return this.initDbPromise.then(()=>Zi(t,""+e))})}getFloorData(t){return f(this,null,function*(){let e=yield this.getFloorJsonData(t);return e?this.getDataByJson(e):null})}getFloorDataByFloorInfo(t){return f(this,null,function*(){let e=yield this.getFloorJsonDataByFloorInfo(t);return this.getDataByJson(e)})}setLocale(t){this.locale=t,this.bmap.context.currentFloor&&this.bmap.context.currentFloor.poiLayer2.pois.forEach(e=>{e.userData.type==="store"&&(e.options.text=oo(e.userData.data,t)),e.userData.type==="facility"&&(e.options.text=no(e.userData.data,t))})}getFloorJsonDataByFloorInfo(t){return f(this,null,function*(){if(this.getFloorDataPromise.has(t.floor))return this.getFloorDataPromise.get(t.floor);let e=new Promise(i=>f(this,null,function*(){let s=vi(t),o=yield fetch(t.map_url).then(n=>n.json());o.floor=t.floor,ws(o),this.setCacheData(Gt.MAP_DATA,s,o),this.setCacheData(Gt.MAP_VERSION,s,t.version_id),i(o)}));return this.getFloorDataPromise.set(t.floor,e),e})}getFloorJsonData(t){return f(this,null,function*(){let e=this.floors.find(i=>i.floor===t);return e?new Promise(i=>f(this,null,function*(){let s=vi(e,this.options.renderVersion===yi.LAYERED_RENDER_VERSION?1:void 0);try{let o=vi(e),n=yield this.getCacheData(Gt.MAP_DATA,o);if(n&&n.transformed){console.log("\u4ECE\u7F13\u5B58\u4E2D\u53D6\u5230\u4E86\u5408\u5E76\u540E\u7684\u6570\u636E"),i(n);return}if(this.options.renderVersion===yi.LAYERED_RENDER_VERSION){let r=yield this.getCacheData(Gt.MAP_DATA,s);if(r){console.log("\u4ECE\u7F13\u5B58\u4E2D\u53D6\u5230\u4E86\u6570\u636E"),i(r);return}}if(console.log("\u7F13\u5B58\u4E2D\u6CA1\u6709\u6570\u636E"),this.loadWorker){Z(this.loadWorker,"adjust_floor_priority",{floor:t});let r=h=>{if(h.data.type==="floor_success"&&h.data.data.floor===t){var c;(c=this.loadWorker)==null||c.removeEventListener("message",r),i(this.getFloorJsonData(t))}};this.loadWorker.addEventListener("message",r)}else i(this.getFloorJsonDataByFloorInfo(e))}catch(o){console.log("[get floor data error]",o),i(this.getFloorJsonDataByFloorInfo(e))}})):null})}getRoadNetworkData(){return f(this,null,function*(){return(yield Promise.all(this.floors.map(e=>f(this,null,function*(){let i=vi(e,0);try{let s=yield this.getCacheData(Gt.ROAD_NETWORK_DATA,i);if(s)return s;let o=yield fetch(e.route_url).then(n=>n.json());return this.setCacheData(Gt.ROAD_NETWORK_DATA,i,o),this.setCacheData(Gt.ROUTE_VERSION,i,e.version_id),o}catch(s){let o=yield fetch(e.route_url).then(n=>n.json());return this.setCacheData(Gt.ROAD_NETWORK_DATA,i,o),o}})))).filter(e=>e.points)})}getFacilitiesData(){return f(this,null,function*(){let t=this.floors.reduce((s,o)=>s.updated_at>o.updated_at?s:o,this.floors[0]);if(!t)return null;let e=vi(t,0),i=()=>f(this,null,function*(){let s=yield fetch(t.entry_infra_url).then(o=>o.json());return s&&(this.setCacheData(Gt.FACILITY_DATA,e,s),this.setCacheData(Gt.FACILITY_VERSION,e,t.version_id)),s});try{let s=yield this.getCacheData(Gt.FACILITY_DATA,e);return s||i()}catch(s){return console.log("[get facility error]",s),i()}})}getOtherDataByFreeTime(){return f(this,null,function*(){yield this.initDbPromise,this.loadWorker&&(yield Z(this.loadWorker,"load",{floors:this.floors,version:this.options.renderVersion})),this.closeWorker()})}getMulFloorsData(t){return f(this,null,function*(){return Promise.all(t.map(e=>this.getFloorData(e))).then(e=>e.filter(i=>i))})}getDataByUrl(t){return f(this,null,function*(){let e=yield fetch(t).then(i=>i.json());return this.getDataByJson(e)})}getDataByJson(t,e,i){return f(this,null,function*(){ws(t),e=this.getFloorBaseLayer(t,e);let s=w({},this.placeConfig,i);return yield this.getFloorContentLayer(t,e),yield this.getFloorPoi(t,e,s),this.changeFloorBox(t,e),e})}getDataByJsonStep(t,e,i){return f(this,null,function*(){ws(t),e=this.getFloorBaseLayer(t,e);let s=w({},this.placeConfig,i);return this.changeFloorBox(t,e),requestAnimationFrame(()=>f(this,null,function*(){yield this.getFloorContentLayer(t,e),this.changeFloorBox(t,e),requestAnimationFrame(()=>f(this,null,function*(){yield this.getFloorPoi(t,e,s),this.changeFloorBox(t,e)}))})),e})}changeFloorBox(t,e){e.updateBox();let i=e.box.getSize(new ro.Vector3),s=Math.max(i.x,i.y,i.z);e.userData.height=s/4+t.floorHeight}switchFloor(t,e){return f(this,null,function*(){return new Promise(i=>{let s={run:()=>this._switchFloor(t,e),meta:{type:"switchFloor"}},o=this.taskQueue.replaceByMetaType(s),n=r=>{let{task:h,res:c}=r;h.tid===o&&(this.taskQueue.removeEventListener("active-task-end",n),i(c))};this.taskQueue.addEventListener("active-task-end",n)})})}_switchFloor(t,e){return f(this,null,function*(){var i;let s=t;if(typeof t=="string"){let l=yield this.getFloorJsonData(t);if(l)s=l;else return null}else ws(t);let o=w({},this.placeConfig,e),n=new ce(this.bmap.context);n.userData.data=t;let r=this.floors.find(l=>l.floor===s.floor);var h;let c=(h=r==null?void 0:r.map_angle)!=null?h:0;return this.bmap.dispatchEvent({type:Et.SWITCH_FLOOR_BEFORE,data:{curFloor:n,graphics:[]}}),this.dispatchEvent({type:"switch-floor-before",data:{curFloor:n,graphics:[],floorData:s}}),this.bmap.context.scene.background=new ro.Color(o.backgroundColor),this.getFloorBaseLayer(s,n),this.changeFloorBox(s,n),this.bmap.buildingCenter=n.userData.center,this.bmap.currentBuildGround=(i=n.userData.data.layers.find(l=>l.l_type==="range"))==null?void 0:i.elements[0],this.bmap.context.switchFloor(n),this.bmap.config.control.defaultAzimuthal=c/180*Math.PI,this.bmap.initialFloorCamera(),this.bmap.context.cameraBound.updateBox(),this.dispatchEvent({type:"switch-floor-ground",data:{curFloor:n,graphics:[]}}),this.bmap.dispatchEvent({type:Et.SWITCH_FLOOR_GROUND,data:{curFloor:n}}),yield Ds(),yield this.getFloorContentLayer(s,n),this.changeFloorBox(s,n),this.bmap.context.cameraBound.updateBox(),this.dispatchEvent({type:"switch-floor-content",data:{curFloor:n,graphics:[]}}),yield zo(2),yield this.getFloorPoi(s,n,o),this.dispatchEvent({type:"switch-floor-after",data:{curFloor:n,graphics:n.graphicLayer.children}}),this.bmap.dispatchEvent({type:Et.SWITCH_FLOOR_AFTER,data:{curFloor:n,graphics:n.graphicLayer.children}}),n})}getFloorBaseLayer(t,e){e||(e=new ce(this.bmap.context));let i=[0,0];return t.layers.forEach(s=>{switch(s.l_type){case"range":let o=s.elements[0];i=[o.center_x,o.center_y],e.userData.range=o.geometry.cds[0],e.userData.rangeGraphic=o;break;case"ground":vn(s,e);break;default:break}}),e.userData.center=i,e.name=t.floor,e.userData.data=t,e}getFloorContentLayer(t,e){return f(this,null,function*(){e||(e=new ce(this.bmap.context)),e.userData.graphics=[],e.userData.graphicMap=new Map;let i=Date.now();for(let s=0;s<t.layers.length;s++){let o=t.layers[s];["range","ground"].includes(o.l_type)||this.options.layers.includes(o.l_type)&&(Ia(o,e,this.options),console.log("time",Date.now()-i,o.l_type),i=Date.now())}return e})}getFloorPoi(t,e,i){return f(this,null,function*(){i===void 0&&(i=this.placeConfig);let s=Date.now();yield Promise.all(t.layers.map(n=>{if(this.options.layers.includes(n.l_type))return Ba(n,e,this.locale,i,this.options)})),console.log("poi time",Date.now()-s);let o=Date.now();Ds().then(()=>{console.log("poi render time",Date.now()-o)})})}clear(){return f(this,null,function*(){zr(),this.db=null})}closeWorker(){this.loadWorker&&(this.loadWorker.terminate(),this.loadWorker=null)}dispose(){super.dispose(),this.clear(),this.closeWorker(),this.getFloorDataPromise.clear()}constructor(t,e={}){super(),this.bmap=t,this.floors=[],this.initDbPromise=Promise.resolve(),this.db=null,this.taskQueue=new $e,this.loadWorker=xn(),this.locale="zh-cn",this.placeConfig={backgroundColor:"#f1f7f6",showFacilityName:!0,showStoreName:!0,textFontSize:14},this.getFloorDataPromise=new Map,this.options=w({},$c,e),this.placeConfig=w({},this.placeConfig,t.config.loaderPlaceConfig),this.initDbPromise=this.initDb()}};var sP=require("core-js/modules/web.dom-collections.iterator.js");function wn(a,t){return f(this,null,function*(){let{brand:e,project:i}=a,{apiDomain:s,apiPath:{floorRange:o},apiInfo:n}=t,r=""+s+o+"?brand="+e+"&project="+i+"&phase="+i+"&building="+i;return yield fetch(r,n).then(c=>c.json()).then(c=>c.data).then(c=>{let l=(c||[])[0];return l&&(l.info=JSON.parse(l.info)),l})})}function Pn(a,t){return f(this,null,function*(){let{brand:e,project:i,floor:s,ts:o,resource_type_list:n}=a,{apiDomain:r,apiPath:{floorGraphic:h},apiInfo:c}=t,l=""+r+h+"?brand="+e+"&project="+i+"&phase="+i+"&building="+i+"&floor="+s+"&ts="+o+"&resource_type_list="+n;return yield fetch(l,c).then(d=>d.json()).then(d=>d.data).then(d=>((d||[]).map(u=>u.info=JSON.parse(u.info)),d||[]))})}function Jc(a,t){return f(this,null,function*(){let{project:e,floor:i}=a,{apiDomain:s,apiInfo:o}=t,n=s+"/api/inception-map/external_street/get?projectCode="+e+"&floorCode="+i;return yield fetch(n,o).then(h=>h.json()).then(h=>h.data).then(h=>JSON.parse(h[0].streetInfo||"{}")).then(h=>h.fileId?Qc(h.fileId,t):null)})}function Qc(a,t){return f(this,null,function*(){let{apiDomain:e,apiInfo:i}=t;return fetch(e+"/api/inception-map/file/getFileStream?fileId="+a,i).then(s=>s.arrayBuffer()).then(s=>{let n=new TextDecoder("utf-8").decode(s);return n?JSON.parse(n):null})})}var Mn=class{load(t){return f(this,null,function*(){let e=Oe(t);if(this.cacheData.has(e))return this.cacheData.get(e);let[,i]=yield Promise.all([this.loadBuildGround(t),Pn(t,this.bmap.config)]),s=Oe({floor:t.floor,ts:t.ts});Bi(i.map(n=>n.info),this.bmap.buildingCenter,this.floorDataLengthMap.get(s)||0),i.forEach(n=>n.info.transformToBuildingGround=!1),this.cacheData.set(e,i);let o=this.floorDataLengthMap.get(s)||0;return this.floorDataLengthMap.set(s,o+i.length),this.loadExternalStreet(t),i})}loadExternalStreet(t){return f(this,null,function*(){})}switchFloorByData(t,e){if(!t.length)return;let i=e.userData.legacyToGraphicMap||new Map,s=e.userData.graphicMap||new Map,{ground:o,markGraphic:n,graphic:r}=this.bmap.config;for(let h=0;h<t.length;h++){let c=t[h],l=w({},c,{info:w({},c.info)});if(c.info.group==="ground"){l.info.fillColor=o.color,l.info.fillOpacity=o.opacity,l.info.height=o.height,l.info.stroke=o.stroke,l.info.strokeColor=o.strokeColor,l.info.strokeOpacity=o.strokeOpacity,e.createGround(l.info);continue}else c.info.userData.mark?(l.info.height=n.height,l.info.fillColor=n.color,l.info.fillOpacity=n.opacity,l.info.stroke=n.stroke,l.info.strokeColor=n.strokeColor,l.info.strokeOpacity=n.strokeOpacity):(l.info.fillOpacity=r.fillOpacity,this.bmap.config.initTransToMark&&(l.info.height=n.height,l.info.fillColor=n.color,l.info.stroke=n.stroke,l.info.strokeColor=n.strokeColor,l.info.strokeOpacity=n.strokeOpacity));let p=e.addGraphic(l.info);p.userData.data=c,i.set(c.legacy_id,p),s.set(c.element_uuid,c)}e.userData.legacyToGraphicMap=i,e.userData.graphicMap=s,e.userData.rangeGraphic=this.bmap.currentBuildGround,e.userData.range=this.bmap.currentBuildGround.geometry.cds[0],e.userData.center=this.bmap.buildingCenter,e.updateBox(),e===this.bmap.context.currentFloor?(this.bmap.triggerHooks(Et.SWITCH_FLOOR_BEFORE,{curFloor:e,graphics:e.graphicLayer.children}),this.bmap.initialFloorCamera(),this.bmap.triggerHooks(Et.SWITCH_FLOOR_AFTER,{curFloor:e,graphics:e.graphicLayer.children})):this.bmap.switchFloorByFloor(e)}filterData(t,e){let i=e.userData.graphicMap||new Map;return t.filter(s=>!i.has(s.element_uuid))}switchFloorByStoreData(t,e){return f(this,null,function*(){let i=yield this.load(w({},t,{resource_type_list:"6"})),s=this.filterData(i,e);this.switchFloorByData(s,e)})}switchFloorByOtherData(t,e){return f(this,null,function*(){let i=yield this.load(w({},t,{resource_type_list:"1,2,3,4"})),s=this.filterData(i,e);this.switchFloorByData(s,e)})}loadBuildGround(t){return f(this,null,function*(){let{brand:e,project:i}=t,s=yield this.loadBuildingGround({brand:e,project:i});var o;return this.bmap.currentBuildGround=(o=s==null?void 0:s.info)!=null?o:null,this.bmap.changeBuildingCenter(s,{brand:e,project:i}),this.bmap.currentBuildGround})}loadBuildingGround(t){return f(this,null,function*(){let{brand:e,project:i}=t,s=Oe({brand:e,project:i});if(this.buildingGroundMap.has(s))return this.buildingGroundMap.get(s);let o=wn({brand:e,project:i},this.bmap.config).then(n=>(this.buildingGroundMap.set(s,n),n));return this.buildingGroundMap.set(s,o),o})}switchFloor(t){return f(this,null,function*(){let e=new ce(this.bmap.context);e.userData.graphicMap=new Map,e.name=t.floor;try{yield Promise.all([this.switchFloorByStoreData(t,e),this.switchFloorByOtherData(t,e)])}catch(i){console.log(i)}return e})}dispose(){this.cacheData.clear(),this.floorDataLengthMap.clear(),this.buildingGroundMap.clear()}constructor(t){this.bmap=t,this.cacheData=new Map,this.floorDataLengthMap=new Map,this.buildingGroundMap=new Map,this.externalStreetMap=new Map}};var tl=function(a){return a[a.D2=0]="D2",a[a.D3=1.1]="D3",a}({}),_n=class extends se.EventDispatcher{get buildingCenter(){return this.coordinateTransform.getBuildingCenter()}set buildingCenter(t){this.coordinateTransform.setBuildingCenter(t)}get basicZoom(){return this.context.basicZoom}set basicZoom(t){this.context.basicZoom=t}changeBuildingCenter(t,e){let{brand:i,project:s}=e,o=t?Di(t.info.geometry.cds[0]):[0,0];this.buildingCenter=o,this.coordinateTransform.setBuildingCenter(o),this.dispatchEvent({type:"center-change",center:o,project:s,brand:i})}use(t){t.bmap=this,this.plugins.push(t)}unUse(t){this.plugins=this.plugins.filter(e=>e!==t)}triggerHooks(t,e){this.dispatchEvent({type:t,data:e})}switchFloor(t){return f(this,null,function*(){return this.loader||(this.loader=new ei(this),this.loader.placeConfig=w({},this.loader.placeConfig,this.config.loaderPlaceConfig),yield this.loader.load(this.config.apiPath.loadPlaceInfo+"?place_id="+this.config.placeId+"&env=prod")),this.loader.switchFloor(t)})}switchFloorByFloor(t,e,i){e===void 0&&(e=!0),i===void 0&&(i=t.graphicLayer.children),this.triggerHooks(Et.SWITCH_FLOOR_BEFORE,{curFloor:t,graphics:i}),this.buildingCenter=t.userData.center,this.coordinateTransform.setBuildingCenter(t.userData.center),this.currentBuildGround=t.userData.rangeGraphic,this.context.switchFloor(t,e),this.initialFloorCamera(),this.triggerHooks(Et.SWITCH_FLOOR_AFTER,{curFloor:t,graphics:i})}initialFloorCamera(){this.context.cameraBound.setEnable(!1),this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,0),this.context.setPolarAngle(this.config.control.defaultPolar,0),this.context.fitCameraToGround(this.config.defaultPadding,0);let t=this.context.camera.zoom;this.context.control.minZoom=t,this.context.control.maxZoom=t*this.config.control.maxZoomScale,this.type==="3d"&&this.context.fitCameraToGround(this.config.defaultPadding,0,!1),this.basicZoom=this.context.camera.zoom,this.context.control.addEventListener("change",this.onControlChange),this.onControlChange(),this.context.cameraBound.setEnable(!0),this.context.cameraBound.changePrevCamera()}addModel(t,e){if(t.options.geometry.type==="polygon"){var i;let s=(i=this.context.currentFloor)==null?void 0:i.addModel(w({},e,{position:t.getPosition().setZ(.1),id:t.options.id}));if(s){let{facilityAngle:o=0,facilityXScale:n=1,facilityYScale:r=1}=t.options.userData;s.rotateZ((180-o)/180*Math.PI),s.scale.set(n,r,1)}}}getLegacyToGraphicMap(){var t;return((t=this.context.currentFloor)==null?void 0:t.userData.legacyToGraphicMap)||new Map}getFloorAllGraphics(){var t;return((t=this.context.currentFloor)==null?void 0:t.getGraphics())||[]}createGraphicPoi(t,e){if(this.context.currentFloor){e.id===void 0&&(e.id=t.options.id);let i=t.options.centerCoords,s=t.getCenter(),o=(i==null?void 0:i[0])||s.x,n=(i==null?void 0:i[1])||s.y;return console.log(o,n,i,s),this.context.currentFloor.addPoi(w({},e,{position:{x:o,y:n,z:s.z+t.options.height/2}}))}return null}createPoi2ByPosition(t,e){if(this.context.currentFloor){let i=this.mercatorToWorld([t.x,t.y]),s=new rt(this.context,w({},e,{position:{x:i.x,y:i.y,z:t.z}}));return this.context.currentFloor.poiLayer2.pushPoi(s),s}return null}translateElementToCenter(t,e,i,s){e===void 0&&(e=500),i===void 0&&(i=0),s===void 0&&(s=0);let o=t.getPosition().clone(),{context:{camera:n}}=this;if(n.updateMatrix(),s){let r=new se.Vector3;r.setFromMatrixColumn(n.matrix,1),r.normalize(),r.multiplyScalar(s/n.zoom),o.add(r)}if(i){let r=new se.Vector3;r.setFromMatrixColumn(n.matrix,0),r.normalize(),r.multiplyScalar(i/n.zoom),o.add(r)}return this.context.setCameraPosition(o,e)}translateElementToCenterX(t,e){return f(this,null,function*(){return e===void 0&&(e=500),jt(new Promise(i=>{let s=this.context.control.target.clone(),o=t.getPosition();this.timer.requestAnimationFrame(()=>{let{clientSize:{width:n,height:r},camera:h}=this.context,l=A(o,h,n,r).x-n/2,p=new se.Vector3;p.setFromMatrixColumn(this.context.camera.matrix,0),p.normalize(),p.multiplyScalar(l/this.context.camera.zoom),s.add(p),this.context.setCameraPosition(s,e).then(i)})}),e+500)})}getElementDeviceCoordinate(t){let e=t.position.clone(),{clientWidth:i,clientHeight:s}=this.container;return A(e,this.context.camera,i,s)}changeMapType(t,e){return e===void 0&&(e=500),this.type=t,t==="2d"?this.context.setPolarAngle(0,e):this.context.setPolarAngle(1.1,e)}resetView(t){return f(this,null,function*(){t===void 0&&(t=300);let e=t/3;yield this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,e),yield this.context.setPolarAngle(this.config.control.defaultPolar,e),yield this.context.fitCameraToGround(this.config.defaultPadding,e,!1)})}reduceMap(t,e){t===void 0&&(t=.5),e===void 0&&(e=500);let i=this.context.camera.zoom;return this.context.setZoom(i-t,this.context.control.target,e)}enlargeMap(t,e){t===void 0&&(t=.5),e===void 0&&(e=500);let i=this.context.camera.zoom;return this.context.setZoom(i+t,this.context.control.target,e)}registryEvent(){if(window.addEventListener("keydown",this.onKeydown),window.addEventListener("keyup",this.onKeyUp),this.config.resizeObserver.enable){let t=new ResizeObserver(this.debounceResize);t.observe(this.container),this.observe=t}}unRegistryEvent(){var t;this.context.control.removeEventListener("change",this.onControlChange),window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("keyup",this.onKeyUp),(t=this.observe)==null||t.disconnect(),this.observe=null}configurePolarShortcutKeys(t){this.polarKeys=t}configureAzimuthalShortcutKeys(t){this.azimuthalKeys=t}rotateMap(t,e){t===void 0&&(t=.1),e===void 0&&(e=500);let i=this.context.control.getAzimuthalAngle();return this.context.setAzimuthalAngle(i+t,e)}showCollisionBox(){this.context.debugCollisionBox=!0,this.context.forceUpdate()}hideCollisionBox(){this.context.debugCollisionBox=!1,this.context.forceUpdate()}measureDistance(){return f(this,null,function*(){return this.cancelDistance(),new Promise((t,e)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgLine=new os(this.context);let i=this.svgLine.dispose.bind(this.svgLine);this.svgLine.dispose=function(){i(),e("cancel")},this.svgLine.addEventListener("distance",s=>{let{distance:o}=s;t(o)})})})}cancelDistance(){this.svgLine&&(this.svgLine.dispose(),this.svgLine=void 0,this.context.control.enableRotate=!0)}measureArea(){return this.cancelArea(),new Promise((t,e)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgPolygon=new ns(this.context);let i=this.svgPolygon.dispose.bind(this.svgPolygon);this.svgPolygon.dispose=function(){i(),e("cancel")},this.svgPolygon.addEventListener("area",s=>{let{area:o}=s;t(o)})})}cancelArea(){this.svgPolygon&&(this.svgPolygon.dispose(),this.svgPolygon=void 0,this.context.control.enableRotate=!0)}fitCameraByPois(t,e,i){return f(this,null,function*(){if(e===void 0&&(e=[20,20,20,20]),i===void 0&&(i=500),!t.length)return;let s=new se.Box3;return t.forEach(o=>{let{position:n}=o;s.expandByPoint(n)}),this.context.fitCameraToBox(s,e,i,!1)})}fitCameraByPoiNodeIds(t,e,i){return f(this,null,function*(){e===void 0&&(e=[20,20,20,20]),i===void 0&&(i=500);let s=t.map(o=>this.getPoiById(o)).filter(o=>!!o);if(s.length)return this.fitCameraByPois(s,e,i)})}getGraphicByNodeId(t){var e,i;return((e=this.context.currentFloor)==null?void 0:e.graphicLayer.getGraphicByNodeId(t))||((i=this.context.currentFloor)==null?void 0:i.parkingSpaceLayer.graphicMap.get(t))||null}deleteGraphic(t){var e;(e=this.context.currentFloor)==null||e.graphicLayer.removeGraphic(t)}createGraphicByOptions(t){var e;if(!t.transformToBuildingGround&&this.currentBuildGround){let i=Di(this.currentBuildGround.geometry.cds[0]);if(t.geometry.type==="polygon")t.geometry.coords=JSON.parse(JSON.stringify(t.geometry.cds)),t.geometry.coords.map(s=>{Array.isArray(s)&&s.forEach(o=>{o[0]-=i[0],o[1]-=i[1]})});else{let[s,o]=t.geometry.cds;t.geometry.coords=[s-i[0],o-i[1]]}}return(e=this.context.currentFloor)==null?void 0:e.graphicLayer.createGraphic(t)}mercatorToWorld(t){return this.coordinateTransform.mercatorToWorld(t)}worldToMercator(t){return this.coordinateTransform.worldToMercator(t)}removePoiById(t){var e,i;(e=this.context.currentFloor)==null||e.poiLayer.removePoiById(t),(i=this.context.currentFloor)==null||i.poiLayer2.removePoiById(t)}getPoiById(t){var e;let i=this.context.collisionSystem.objects;return((e=this.context.currentFloor)==null?void 0:e.poiLayer.getPoiById(t))||i.find(s=>s.options.id===t)}getPois(){var t;return[...(((t=this.context.currentFloor)==null?void 0:t.poiLayer.pois)||[]).filter(e=>!e.options.built_in),...this.context.collisionSystem.objects||[]]}clearPoi(){this.context.currentFloor&&this.context.currentFloor.poiLayer.clear()}removeSelectGraphic(t){this.context.selection.remove(t)}dispose(){this.loader&&(this.loader.dispose(),this.loader=null),this.unRegistryEvent(),this.timer.dispose(),this.plugins.forEach(t=>t.dispose()),this.plugins=[],this.context.dispose(),this.context=null,this.container=null,yt.dispose(),vt.dispose(),Wt.dispose(),At.dispose(),T.dispose(),he.dispose(),this.debounceResize=null,se.Sprite.Dispose==null||se.Sprite.Dispose.call(se.Sprite)}constructor(t,e={}){super(),this.container=t,this.polarKeys=[],this.azimuthalKeys=[],this.prevCameraZoom=1,this.type="2d",this.currentBuildGround=null,this.observe=null,this.coordinateTransform=new Hi([0,0]),this.timer=new J,this.plugins=[],this.loader=null,this.onControlChange=()=>{let{camera:{zoom:i}}=this.context;i!==this.prevCameraZoom&&(this.dispatchEvent({type:"zoom-change",basicZoom:this.basicZoom,cameraZoom:this.context.camera.zoom}),this.prevCameraZoom=i)},this.onKeydown=i=>{this.polarKeys.includes(i.code)&&(this.context.control.maxPolarAngle=this.config.control.maxPolar,this.context.control.minPolarAngle=0),this.azimuthalKeys.includes(i.code)&&(this.context.control.maxAzimuthAngle=1/0,this.context.control.minAzimuthAngle=1/0)},this.onKeyUp=i=>{if(this.polarKeys.includes(i.code)){let s=this.context.control.getPolarAngle();this.context.control.maxPolarAngle=s,this.context.control.minPolarAngle=s}if(this.azimuthalKeys.includes(i.code)){let s=this.context.control.getAzimuthalAngle();this.context.control.maxAzimuthAngle=s,this.context.control.minAzimuthAngle=s}},this.resize=()=>{this.context.cameraBound.setEnable(!1),this.context.onWindowResize();let i=this.context.control.getAzimuthalAngle(),s=this.context.camera.zoom;this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(0,0);let o=this.context.getFitCameraToGroundZoom(this.config.defaultPadding,0)||1;this.context.camera.zoom=s,this.context.control.minZoom=o,this.context.control.maxZoom=o*this.config.control.maxZoomScale,this.basicZoom=s,this.context.control.addEventListener("change",this.onControlChange),this.context.setAzimuthalAngle(i,0),this.context.cameraBound.setEnable(!0)},this.config=gn(e),this.context=new xs(t,this),this.debounceResize=(0,za.debounce)(this.resize,this.config.resizeObserver.debounceTime),this.registryEvent()}};var el=function(a){return a.HALF="half",a.POWER="power",a.MECHANICAL="mechanical",a.NORMAL="normal",a.VIP="vip",a.GSADV="gsadv",a}({});var SP=require("core-js/modules/web.dom-collections.iterator.js");var q=class extends pt{dispose(){let t=this.bmap.plugins.findIndex(e=>e===this);t!==-1&&this.bmap.plugins.splice(t,1),this.bmap=null,super.dispose()}constructor(t){super(),this.bmap=t,this.bmap.use(this)}};var bn=class extends q{fetchEquipment(){return f(this,null,function*(){let{apiDomain:t,apiPath:{equipmentList:e},apiInfo:i}=this.bmap.config,s=""+t+e;yield fetch(s,i).then(o=>o.json()).then(o=>o.data).then(o=>{this.equipmentList=o,this.equipmentMap=new Map(o.map(n=>[n.equipment_id,n]))}),this.dispatchEvent({type:"change-equipment-list",data:this.equipmentList}),this.bmap.context.currentFloor&&this.changeGraphicToEquipment(this.bmap.context.currentFloor.graphicLayer.children)})}getGraphicEquipment(t){return t.userData.data.info.userData.equipment}changeGraphicToEquipment(t){t.filter(e=>{let i=this.getGraphicEquipment(e);return i&&this.equipmentMap.has(i)}).forEach(e=>{let i=this.equipmentMap.get(this.getGraphicEquipment(e)),s=this.bmap.createGraphicPoi(e,{icon:i==null?void 0:i.equipment_icon,built_in:!0,icon_size:[14,14]});s&&(s.userData.data=i,s.userData.type="equipment")})}dispose(){var t;this.bmap.removeEventListener(Et.SWITCH_FLOOR_AFTER,this.onSwitchFloor),Array.from(((t=this.bmap.context.currentFloor)==null?void 0:t.poiLayer.pois)||[]).forEach(e=>{if(e.userData.type==="equipment"){var i;(i=this.bmap.context.currentFloor)==null||i.poiLayer.removePoi(e)}}),super.dispose()}constructor(t){super(t),this.equipmentList=[],this.equipmentMap=new Map,this.onSwitchFloor=e=>{let{data:{graphics:i}}=e;this.equipmentList.length&&this.changeGraphicToEquipment(i)},this.fetchEquipment(),this.bmap.addEventListener(Et.SWITCH_FLOOR_AFTER,this.onSwitchFloor)}};var TM=require("core-js/modules/es.string.replace.js"),kM=require("core-js/modules/es.regexp.exec.js"),AM=require("core-js/modules/web.dom-collections.iterator.js"),DM=require("core-js/modules/es.promise.finally.js");var YP=require("core-js/modules/web.dom-collections.iterator.js"),qP=require("core-js/modules/es.array.push.js"),Mt=require("three");var AP=require("core-js/modules/es.typed-array.float32-array.js"),DP=require("core-js/modules/es.typed-array.at.js"),OP=require("core-js/modules/es.typed-array.fill.js"),RP=require("core-js/modules/es.typed-array.find-last.js"),FP=require("core-js/modules/es.typed-array.find-last-index.js"),GP=require("core-js/modules/es.typed-array.set.js"),IP=require("core-js/modules/es.typed-array.sort.js"),BP=require("core-js/modules/es.typed-array.to-reversed.js"),zP=require("core-js/modules/es.typed-array.to-sorted.js"),WP=require("core-js/modules/es.typed-array.with.js"),UP=require("core-js/modules/es.array-buffer.constructor.js"),HP=require("core-js/modules/es.array-buffer.slice.js"),NP=require("core-js/modules/es.array-buffer.detached.js"),ZP=require("core-js/modules/es.array-buffer.transfer.js"),jP=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),VP=require("core-js/modules/es.array.push.js"),KP=require("core-js/modules/es.typed-array.uint16-array.js"),S=require("three"),Yt=class extends S.BufferGeometry{constructor(){super(),this.isMeshLine=!0,this.type="MeshLine",this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this._points=[],this._geom=null,this.widthCallback=null,this.matrixWorld=new S.Matrix4,Object.defineProperties(this,{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}})}};Yt.prototype.setMatrixWorld=function(a){this.matrixWorld=a};Yt.prototype.setGeometry=function(a,t){this._geometry=a,this.setPoints(a.getAttribute("position").array,t)};Yt.prototype.setPoints=function(a,t){if(!(a instanceof Float32Array)&&!(a instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=a,this.widthCallback=t,this.positions=[],this.counters=[],a.length&&a[0]instanceof S.Vector3)for(var e=0;e<a.length;e++){var i=a[e],s=e/a.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.z),this.counters.push(s),this.counters.push(s)}else for(var e=0;e<a.length;e+=3){var s=e/a.length;this.positions.push(a[e],a[e+1],a[e+2]),this.positions.push(a[e],a[e+1],a[e+2]),this.counters.push(s),this.counters.push(s)}this.process()};function il(a,t){var e=new S.Matrix4,i=new S.Ray,s=new S.Sphere,o=new S.Vector3,n=this.geometry;if(n.boundingSphere||n.computeBoundingSphere(),s.copy(n.boundingSphere),s.applyMatrix4(this.matrixWorld),a.ray.intersectSphere(s,o)!==!1){e.copy(this.matrixWorld).invert(),i.copy(a.ray).applyMatrix4(e);var r=new S.Vector3,h=new S.Vector3,c=new S.Vector3,l=this instanceof S.LineSegments?2:1,p=n.index,d=n.attributes;if(p!==null)for(var u=p.array,g=d.position.array,x=d.width.array,m=0,v=u.length-1;m<v;m+=l){var P=u[m],_=u[m+1];r.fromArray(g,P*3),h.fromArray(g,_*3);var L=x[Math.floor(m/3)]!==void 0?x[Math.floor(m/3)]:1,C=a.params.Line.threshold+this.material.lineWidth*L/2,R=C*C,b=i.distanceSqToSegment(r,h,o,c);if(!(b>R)){o.applyMatrix4(this.matrixWorld);var U=a.ray.origin.distanceTo(o);U<a.near||U>a.far||(t.push({distance:U,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}),m=v)}}}}Yt.prototype.raycast=il;Yt.prototype.compareV3=function(a,t){var e=a*6,i=t*6;return this.positions[e]===this.positions[i]&&this.positions[e+1]===this.positions[i+1]&&this.positions[e+2]===this.positions[i+2]};Yt.prototype.copyV3=function(a){var t=a*6;return[this.positions[t],this.positions[t+1],this.positions[t+2]]};Yt.prototype.getDistance=function(a){let t=0;for(let e=0;e<a;e++){let i=6*e,s=new S.Vector3(this.positions[i],this.positions[i+1],this.positions[i+2]),o=new S.Vector3(this.positions[i+6],this.positions[i+7],this.positions[i+8]),n=s.distanceTo(o);t+=n}return t};Yt.prototype.process=function(){var a=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var t;let e=this.getDistance(a-1);var i;this.compareV3(0,a-1)?i=this.copyV3(a-2):i=this.copyV3(0),this.previous.push(i[0],i[1],i[2]),this.previous.push(i[0],i[1],i[2]);for(var s=0;s<a;s++){if(this.side.push(1),this.side.push(-1),this.widthCallback?t=this.widthCallback(s/(a-1)):t=1,this.width.push(t),this.width.push(t),s===0)this.uvs.push(0,0),this.uvs.push(0,1);else if(s===a-1)this.uvs.push(1,0),this.uvs.push(1,1);else{let n=this.getDistance(s)/e;this.uvs.push(n,0),this.uvs.push(n,1)}if(s<a-1){i=this.copyV3(s),this.previous.push(i[0],i[1],i[2]),this.previous.push(i[0],i[1],i[2]);var o=s*2;this.indices_array.push(o,o+1,o+2),this.indices_array.push(o+2,o+1,o+3)}s>0&&(i=this.copyV3(s),this.next.push(i[0],i[1],i[2]),this.next.push(i[0],i[1],i[2]))}this.compareV3(a-1,0)?i=this.copyV3(1):i=this.copyV3(a-1),this.next.push(i[0],i[1],i[2]),this.next.push(i[0],i[1],i[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new S.BufferAttribute(new Float32Array(this.positions),3),previous:new S.BufferAttribute(new Float32Array(this.previous),3),next:new S.BufferAttribute(new Float32Array(this.next),3),side:new S.BufferAttribute(new Float32Array(this.side),1),width:new S.BufferAttribute(new Float32Array(this.width),1),uv:new S.BufferAttribute(new Float32Array(this.uvs),2),index:new S.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new S.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function En(a,t,e,i,s){var o;if(a=a.subarray||a.slice?a:a.buffer,e=e.subarray||e.slice?e:e.buffer,a=t?a.subarray?a.subarray(t,s&&t+s):a.slice(t,s&&t+s):a,e.set)e.set(a,i);else for(o=0;o<a.length;o++)e[o+i]=a[o];return e}Yt.prototype.advance=function(a){var t=this._attributes.position.array,e=this._attributes.previous.array,i=this._attributes.next.array,s=t.length;En(t,0,e,0,s),En(t,6,t,0,s-6),t[s-6]=a.x,t[s-5]=a.y,t[s-4]=a.z,t[s-3]=a.x,t[s-2]=a.y,t[s-1]=a.z,En(t,6,i,0,s-6),i[s-6]=a.x,i[s-5]=a.y,i[s-4]=a.z,i[s-3]=a.x,i[s-2]=a.y,i[s-1]=a.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0};S.ShaderChunk.meshline_vert=["",S.ShaderChunk.logdepthbuf_pars_vertex,S.ShaderChunk.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;"," vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",S.ShaderChunk.logdepthbuf_vertex,S.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",S.ShaderChunk.fog_vertex,"}"].join(`
548
+ `,i=-1/0,s=this.geometry.getAttribute("position");if(s)for(let n=0;n<s.count;n++){let r=s.getZ(n);r>i&&(i=r)}let o=new Pt.ShaderMaterial({uniforms:{maxZ:{value:i},uColor:{value:new Pt.Color(this.options[0].fillColor).convertLinearToSRGB()},uColor2:{value:new Pt.Color(ge(this.options[0].fillColor)).convertLinearToSRGB()},uOpacity:{value:this.options[0].fillOpacity}},vertexShader:t,fragmentShader:e,transparent:!0});this.material=o}initLineMaterial(){let t=T.createLineMaterial({color:this.options[0].strokeColor,opacity:this.options[0].strokeOpacity});return this.lineMaterial=t,t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new Pt.Mesh(this.geometry,this.material),this.add(this.mesh)}getBorderPoints(){let t=[],e=this.options[0].height+this.options[0].deltaHeight;return this.options.map(i=>{let{coords:s}=i.geometry;for(let o=0;o<s.length;o++){let n=s[o];for(let r=0;r<n.length;r++){let h=n[r],c=r+1===n.length?n[0]:n[r+1];t.push(new Pt.Vector3(h[0],h[1],e)),t.push(new Pt.Vector3(c[0],c[1],e))}}}),t}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.getBorderPoints(),e=new Pt.BufferGeometry().setFromPoints(t);this.lineGeometry=e}createBorder(){this.line&&this.remove(this.line);let t=new Pt.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t,e;this.geometry?(this.geometry.dispose(),this._listeners={}):this.addEventListener("init-geometry",()=>{var i;(i=this.geometry)==null||i.dispose(),this._listeners={}}),(t=this.material)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e,i){super(),this.context=t,this.mergedElement=i,this.options=[],i?(this.options=[i],this.initMergedElement()):(this.options=e.map(s=>w({},te,s)),this.init())}};var yv=require("core-js/modules/web.dom-collections.iterator.js"),vv=require("core-js/modules/es.array.push.js"),xv=require("core-js/modules/es.string.trim.js"),We=require("three"),xa=require("three/examples/jsm/utils/BufferGeometryUtils.js");var wa={airHeight:0,deltaHeight:0,height:0,geometry:{cds:[],type:"polygon",coords:[],curveCpt:[],curveIndex:[]},texts:[],fillColor:"#ffffff",fillOpacity:0,strokeColor:"#ffffff",strokeOpacity:0,secondHeight:0,secondRotate:0,center_x:0,center_y:0},Dc={fontFamily:"sans-serif",fontWeight:"normal",fontSize:64},Oc=2048,Rc=1,hs=class extends We.Object3D{init(){return f(this,null,function*(){let t=yield Promise.all(this.options.map(n=>f(this,null,function*(){let r=yield yt.ensureText(n.texts[0],Dc);return{options:n,atlas:r,layout:Gi(n.texts[0],r.charMap,r.spec,Oc)}}))),e=[],i=[];for(let n of t){let{options:r,layout:h,atlas:c}=n,l=si(h,{pivotX:.5,pivotY:.5,normalizeBottom:h.inkBottom,normalizeHeight:h.inkHeight});if(!l.length)continue;let p=new We.Matrix4().makeTranslation(r.center_x,r.center_y,r.airHeight+r.deltaHeight+r.height).multiply(new We.Matrix4().makeRotationZ(r.secondRotate)).multiply(new We.Matrix4().makeScale(r.secondHeight,r.secondHeight,1));for(let d of l)d.geometry.applyMatrix4(p),d.geometry.computeBoundingSphere(),e.push(d.geometry),i.push(this.createMaterial(n,c.pages[d.page].texture))}if(!e.length)return;let s=(0,xa.mergeGeometries)(e,!0);e.forEach(n=>n.dispose());let o=new We.Mesh(s,i);o.frustumCulled=!1,o.renderOrder=9e5,this.mesh=o,this.position.z+=.04,this.add(o)})}createMaterial(t,e){let{options:i,atlas:s}=t,o=typeof window!="undefined"&&window.devicePixelRatio||1;return Ws({atlas:e,fillColor:i.fillColor,fillOpacity:i.fillOpacity,outlineColor:i.strokeColor,outlineOpacity:i.strokeOpacity,outlineWidth:Rc*o,edge:1-s.spec.cutoff,depthWrite:!1})}get materials(){var t;let e=(t=this.mesh)==null?void 0:t.material;return e?Array.isArray(e)?e:[e]:[]}setOpacity(t){this.materials.forEach(e=>{e.uniforms.uOpacity.value=t})}dispose(){var t;(t=this.mesh)==null||t.geometry.dispose(),this.materials.forEach(e=>e.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e.map(i=>w({},wa,i)).filter(i=>i.texts[0].trim()),this.options.length&&this.init()}};var Pa=require("three"),Ma=require("three/examples/jsm/lines/Line2.js"),_a=require("three/examples/jsm/lines/LineGeometry.js"),ba=require("three/examples/jsm/lines/LineMaterial.js"),di=class extends Pa.Object3D{registryEvent(){this.context.addEventListener("resize",this.onResize)}unRegistryEvent(){this.context.removeEventListener("resize",this.onResize)}setPosition(t,e){this.lineGeometry.setPositions([t.x,t.y,t.z,e.x,e.y,e.z]),this.line||this.createLine()}createLine(){this.line=new Ma.Line2(this.lineGeometry,this.lineMaterial),this.line.renderOrder=100003,this.add(this.line)}dispose(){var t;this.unRegistryEvent(),this.line&&I(this.line),this.lineGeometry=null,this.lineMaterial=null,this.clear(),(t=this.line)==null||t.clear(),this.line=null}constructor(t,e,i){super(),this.context=t,this.lineGeometry=new _a.LineGeometry,this.lineMaterial=new ba.LineMaterial({color:0,transparent:!0,depthTest:!1,linewidth:2}),this.line=null,this.onResize=()=>{let{width:s,height:o}=this.context.clientSize;this.lineMaterial.resolution.set(s,o)},this.onResize(),this.registryEvent(),e&&i&&this.setPosition(e,i)}};var Sv=require("core-js/modules/es.array.push.js"),Cv=require("core-js/modules/web.dom-collections.iterator.js"),Ue=require("three");var ui=require("three");var Qi=class extends Ue.Object3D{loadModel(){return f(this,null,function*(){let t=yield At.loadModel(this.options[0].url);t.scene.updateMatrixWorld(!0);let e=t.scene.matrixWorld.clone().invert();t.scene.traverse(h=>{if(h.isMesh){let c=e.clone().multiply(h.matrixWorld),l=h.material;this.subMeshes.push({geometry:h.geometry,material:h.material,initialMatrix:c}),Array.isArray(l)?l.forEach(p=>{p.transparent=!0,this.materialOriginParams.set(p,{opacity:p.opacity})}):(l.transparent=!0,this.materialOriginParams.set(l,{opacity:l.opacity}))}});let i=this.subMeshes.map(h=>{let{geometry:c,material:l}=h;return new Ue.InstancedMesh(c,l,this.options.length)});t.scene.rotation.set(Math.PI/2,0,0);let o=new Ue.Box3().setFromObject(t.scene).getSize(new Ue.Vector3),n=Math.max(o.x,o.y);this.options.map(h=>{let c=new ui.Matrix4,l=h.width/n;return c.multiply(new ui.Matrix4().makeTranslation(h.center_x,h.center_y,h.airHeight+h.deltaHeight)).multiply(new ui.Matrix4().makeScale(l,l,l)).multiply(new ui.Matrix4().makeRotationZ(h.rotate)).multiply(new ui.Matrix4().makeRotationX(Math.PI/2)),h.url==="https://robot-vr-public.cdn.bcebos.com/ai-map-resource/757/1865371442288267264/smzsdrc.glb"&&console.log(h,c),c}).forEach((h,c)=>{i.forEach((l,p)=>{let d=h.clone().multiply(this.subMeshes[p].initialMatrix);l.setMatrixAt(c,d)})}),i.forEach(h=>{h.instanceMatrix.needsUpdate=!0,this.meshSetMaterial(h),this.add(h)})})}meshSetMaterial(t){t.isMesh&&(t.frustumCulled=!1,t.castShadow=!0,Array.isArray(t.material)?t.material.map(e=>{e.emissiveIntensity*=.95}):(t.material.emissiveIntensity*=.95,t.material.emissive=t.material.color,t.material.emissiveMap=t.material.map))}setOpacity(t,e){e===void 0&&(e=!1),this.subMeshes.forEach(i=>{let{material:s}=i;if(Array.isArray(s))s.forEach(o=>{if(e)o.opacity=t;else{let n=this.materialOriginParams.get(o)||{opacity:1};t>n.opacity?o.opacity=n.opacity:o.opacity=t}o.needsUpdate=!0});else{let o=this.materialOriginParams.get(s)||{opacity:1};t>o.opacity?s.opacity=o.opacity:s.opacity=t,s.needsUpdate=!0}}),this.children.forEach(i=>{i.instanceMatrix.needsUpdate=!0})}dispose(){this.children.forEach(t=>t.dispose()),I(this),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.subMeshes=[],this.materialOriginParams=new Map,this.loadModel()}};var He=require("three");var li=class extends He.Object3D{init(){return f(this,null,function*(){this.geometry=this.initGeometry(),this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options.deltaHeight+this.options.airHeight,this.options.lineGeometry&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initGeometry(){return this.loader.parseGeometries([this.options.mergedGeometry])[this.options.mergedGeometry.uuid]}initMaterial(){this.material=T.GetMergeAttributeGraphicMaterial()}initLineMaterial(){return this.lineMaterial=T.GetMergeAttributeGraphicLineMaterial()}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new He.Mesh(this.geometry,this.material),this.add(this.mesh)}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.loader.parseGeometries([this.options.lineGeometry]);this.lineGeometry=t[this.options.lineGeometry.uuid]}createBorder(){this.line&&this.remove(this.line);let t=new He.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t;this.geometry&&this.geometry.dispose(),(t=this.line)==null||t.geometry.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.loader=new He.ObjectLoader,this.options=w({},te,e),this.init()}};var mi=require("three");var cs=class extends mi.Object3D{initGeometry(){return f(this,null,function*(){let t=new mi.ObjectLoader().parseGeometries([this.options.mergedGeometry]);this.geometry=t[this.options.mergedGeometry.uuid]})}init(){return f(this,null,function*(){var t;yield this.initGeometry();let e=new mi.Mesh(this.geometry,It.GetMergeAttributeWallMaterial());this.add(e);let i=(t=this.geometry)==null?void 0:t.getAttribute("opacity");i&&(this.originOpacities=Array.from(i.array))})}setOpacity(t,e){e===void 0&&(e=!1);var i;let s=(i=this.geometry)==null?void 0:i.getAttribute("opacity");if(s){for(let n=0;n<s.count;n++)if(e)s.setX(n,t);else{var o;s.setX(n,Math.min(t,(o=this.originOpacities[n])!=null?o:1))}s.needsUpdate=!0}}dispose(){var t;(t=this.geometry)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.originOpacities=[],this.init()}};var Uv=require("core-js/modules/es.typed-array.float32-array.js"),Hv=require("core-js/modules/es.typed-array.at.js"),Nv=require("core-js/modules/es.typed-array.fill.js"),Zv=require("core-js/modules/es.typed-array.find-last.js"),jv=require("core-js/modules/es.typed-array.find-last-index.js"),Vv=require("core-js/modules/es.typed-array.set.js"),Kv=require("core-js/modules/es.typed-array.sort.js"),Xv=require("core-js/modules/es.typed-array.to-reversed.js"),Yv=require("core-js/modules/es.typed-array.to-sorted.js"),qv=require("core-js/modules/es.typed-array.with.js"),$v=require("core-js/modules/es.array-buffer.constructor.js"),Jv=require("core-js/modules/es.array-buffer.slice.js"),Qv=require("core-js/modules/es.array-buffer.detached.js"),tx=require("core-js/modules/es.array-buffer.transfer.js"),ex=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js");var dt=require("three");var Ge=class extends dt.Object3D{init(){return f(this,null,function*(){let t=this.options.iconUrl,e=yield vt.getTextureByUrl(t),i=new dt.MeshBasicMaterial({map:e,transparent:!0,alphaTest:.2,side:dt.FrontSide}),s=new dt.InstancedMesh(this.geometry,i,this.options.mergedMatrixes.size);s.instanceMatrix=new dt.InstancedBufferAttribute(new Float32Array(this.options.mergedMatrixes.array),16),this.add(s),this.mesh=s,this.position.z+=.004})}setOpacity(t){this.mesh&&(this.mesh.material.opacity=t,this.mesh.material.needsUpdate=!0,this.mesh.instanceMatrix.needsUpdate=!0)}dispose(){var t;this.mesh&&I(this.mesh),(t=this.mesh)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new dt.ShapeGeometry(new dt.Shape([new dt.Vector2(-.5,-.5),new dt.Vector2(-.5,.5),new dt.Vector2(.5,.5),new dt.Vector2(.5,-.5)])),this.options=w({},$s,e);let i=new dt.Float32BufferAttribute([0,0,0,1,1,1,1,0],2);this.geometry.setAttribute("uv",i),this.init()}};var ax=require("core-js/modules/es.array.push.js"),Te=require("three");var dn=require("three/examples/jsm/lines/LineSegments2.js"),un=require("three/examples/jsm/lines/LineSegmentsGeometry.js");var ls=class extends Te.Object3D{initGeometry(){return f(this,null,function*(){let t=this.loader.parseGeometries([this.options.mergedGeometry]);this.geometry=t[this.options.mergedGeometry.uuid]})}initMaterial(){let t=T.createMeshBasicMaterial({color:"#ffffff",opacity:1,vertexColors:!0});return this.material=t,t}initDoubleLine(){if(this.options.dashedLineGeometry){let t=T.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:!0,resolution:new Te.Vector2(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0});t.transparent=!0,t.needsUpdate=!0;let e=new un.LineSegmentsGeometry;e.setPositions(this.options.dashedLineGeometry.positions),e.setColors(this.options.dashedLineGeometry.colors);let i=new dn.LineSegments2(e,t);i.computeLineDistances(),i.position.z+=.01,this.add(i),this.doubleLines.push(i)}if(this.options.lineGeometry){let t=T.createLine2MaterialMap({color:"#ffffff",width:.2,dashed:!1,resolution:new Te.Vector2(this.context.clientSize.width,this.context.clientSize.height),vertexColors:!0}),e=new un.LineSegmentsGeometry;e.setPositions(this.options.lineGeometry.positions),e.setColors(this.options.lineGeometry.colors);let i=new dn.LineSegments2(e,t);i.position.z+=.01,this.add(i),this.doubleLines.push(i)}}init(){return f(this,null,function*(){yield this.initGeometry(),this.initMaterial();let t=new Te.Mesh(this.geometry,this.material);this.add(t),this.initDoubleLine(),this.position.z+=.02})}setOpacity(t){this.material.opacity=t,this.material.needsUpdate=!0,this.doubleLines.forEach(e=>{e.material.opacity=t,e.material.needsUpdate=!0})}dispose(){var t,e;(t=this.geometry)==null||t.dispose(),(e=this.lineGeometry)==null||e.dispose(),this.doubleLines.map(i=>i.geometry.dispose()),this.clear()}constructor(t,e){super(),this.context=t,this.options=e,this.doubleLines=[],this.loader=new Te.ObjectLoader,this.init()}};var dx=require("core-js/modules/es.typed-array.float32-array.js"),ux=require("core-js/modules/es.typed-array.at.js"),mx=require("core-js/modules/es.typed-array.fill.js"),fx=require("core-js/modules/es.typed-array.find-last.js"),gx=require("core-js/modules/es.typed-array.find-last-index.js"),yx=require("core-js/modules/es.typed-array.set.js"),vx=require("core-js/modules/es.typed-array.sort.js"),xx=require("core-js/modules/es.typed-array.to-reversed.js"),wx=require("core-js/modules/es.typed-array.to-sorted.js"),Px=require("core-js/modules/es.typed-array.with.js"),Mx=require("core-js/modules/es.array-buffer.constructor.js"),_x=require("core-js/modules/es.array-buffer.slice.js"),bx=require("core-js/modules/es.array-buffer.detached.js"),Ex=require("core-js/modules/es.array-buffer.transfer.js"),Sx=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),Cx=require("core-js/modules/web.dom-collections.iterator.js"),V=require("three");var ri=class extends V.Object3D{setColorByIndex(t,e){this.mesh&&(this.mesh.setColorAt(t,new V.Color(e).convertLinearToSRGB()),this.mesh.instanceColor.needsUpdate=!0)}init(){return f(this,null,function*(){this.initMaterial(),this.initMesh(),this.mesh.position.z=this.options[0].deltaHeight+this.options[0].airHeight,this.options[0].strokeOpacity!==0&&(this.initLineMaterial(),this.initLineGeometry(),this.createBorder())})}initMaterial(){this.material=T.GetInstancedGraphicMaterial()}initLineMaterial(){let t=T.GetMergeAttributeGraphicLineMaterial();this.lineMaterial=t}initMesh(){this.mesh&&this.remove(this.mesh),this.mesh=new V.InstancedMesh(this.geometry,this.material,this.options.length);let t=new V.InstancedBufferAttribute(new Float32Array(this.options.length),1),e=new V.InstancedBufferAttribute(new Float32Array(this.options.length),1);this.options.forEach((i,s)=>{let o=i.geometry.coords[0],[n,r,h]=o.slice(0,3),c=Math.sqrt((r[0]-n[0])**2+(r[1]-n[1])**2),l=Math.sqrt((h[0]-r[0])**2+(h[1]-r[1])**2),p=[c,l],d=Math.max(...p),u=Math.min(...p),g;d===c?g=[r[0]-n[0],r[1]-n[1]]:g=[h[0]-r[0],h[1]-r[1]];let[x,m]=g,v=Math.atan2(m,x)-Math.PI/2,P=new V.Matrix4().compose(new V.Vector3(i.center_coord_x,i.center_coord_y,(i.deltaHeight||0)+i.airHeight+i.height/2),new V.Quaternion().setFromAxisAngle(new V.Vector3(0,0,1),v),new V.Vector3(u,d,i.height));this.mesh.setMatrixAt(s,P),this.mesh.setColorAt(s,new V.Color(i.fillColor).convertLinearToSRGB());var _;t.array[s]=(_=i.fillOpacity)!=null?_:1;var L;e.array[s]=((L=i.deltaHeight)!=null?L:0)+i.airHeight+i.height}),this.originOpacity=[...t.array],this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.add(this.mesh),this.mesh.instanceMatrix.needsUpdate=!0}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let{points:t,colors:e,opacities:i}=Is(this.options),s=new V.BufferGeometry().setFromPoints(t);s.setAttribute("color",new V.BufferAttribute(new Float32Array(e),3)),s.setAttribute("opacity",new V.BufferAttribute(new Float32Array(i),1)),this.lineOriginOpacity=[...i],this.lineGeometry=s}createBorder(){this.line&&this.remove(this.line);let t=new V.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}setOpacity(t,e){e===void 0&&(e=!1);let i=this.geometry.getAttribute("opacity");for(let n=0;n<i.count;n++)if(e)i.array[n]=t;else{var s;i.array[n]=Math.min(t,(s=this.originOpacity[n])!=null?s:1)}if(i.needsUpdate=!0,this.lineGeometry){let n=this.lineGeometry.getAttribute("opacity");for(let r=0;r<n.count;r++)if(e)n.array[r]=t;else{var o;n.array[r]=Math.min(t,(o=this.lineOriginOpacity[r])!=null?o:1)}n.needsUpdate=!0}}dispose(){var t,e;this.geometry.dispose(),(t=this.mesh)==null||t.dispose(),(e=this.line)==null||e.geometry.dispose(),this.clear()}constructor(t,e){super(),this.context=t,this.geometry=new V.BoxGeometry(1,1,1),this.options=[],this.originOpacity=[],this.lineOriginOpacity=[],this.options=e.map(i=>w({},te,i)),this.init()}};var Ox=require("core-js/modules/es.typed-array.float32-array.js"),Rx=require("core-js/modules/es.typed-array.at.js"),Fx=require("core-js/modules/es.typed-array.fill.js"),Gx=require("core-js/modules/es.typed-array.find-last.js"),Ix=require("core-js/modules/es.typed-array.find-last-index.js"),Bx=require("core-js/modules/es.typed-array.set.js"),zx=require("core-js/modules/es.typed-array.sort.js"),Wx=require("core-js/modules/es.typed-array.to-reversed.js"),Ux=require("core-js/modules/es.typed-array.to-sorted.js"),Hx=require("core-js/modules/es.typed-array.with.js"),Nx=require("core-js/modules/es.array-buffer.constructor.js"),Zx=require("core-js/modules/es.array-buffer.slice.js"),jx=require("core-js/modules/es.array-buffer.detached.js"),Vx=require("core-js/modules/es.array-buffer.transfer.js"),Kx=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),Xx=require("core-js/modules/web.dom-collections.iterator.js"),ie=require("three");var Qe=class extends ie.Object3D{init(){return f(this,null,function*(){this.initMaterial(),this.initMesh()})}initMaterial(){this.material=T.GetInstancedGraphicMaterial()}initMesh(){if(this.mesh&&this.remove(this.mesh),!this.elements)return;this.mesh=new ie.InstancedMesh(this.geometry,this.material,this.elements.size);let t=new ie.InstancedBufferAttribute(new Float32Array(this.elements.opacities),1),e=new ie.InstancedBufferAttribute(new Float32Array(this.elements.maxZs),1);this.originOpacities=[...t.array],this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.mesh.instanceMatrix.set(this.elements.matrixes),this.mesh.instanceColor=new ie.InstancedBufferAttribute(new Float32Array(this.elements.colors),3),this.add(this.mesh),this.mesh.instanceMatrix.needsUpdate=!0}setColorByIndex(t,e){this.mesh&&(this.mesh.setColorAt(t,new ie.Color(e).convertLinearToSRGB()),this.mesh.instanceColor.needsUpdate=!0)}setOpacityByIndex(t,e){if(this.mesh){let i=this.geometry.getAttribute("opacity");i.setX(t,e),i.needsUpdate=!0}}setMatrixByIndex(t,e){this.mesh&&(this.mesh.setMatrixAt(t,e),this.mesh.instanceMatrix.needsUpdate=!0)}setMaxZByIndex(t,e){if(this.mesh){let i=this.geometry.getAttribute("maxZ");i.setX(t,e),i.needsUpdate=!0}}setColorById(t,e){if(!this.elements)return;let i=this.elements.ids.findIndex(s=>s===t);i!==-1&&this.setColorByIndex(i,e)}setOpacityById(t,e){if(!this.elements)return;let i=this.elements.ids.findIndex(s=>s===t);i!==-1&&this.setOpacityByIndex(i,e)}setMatrixById(t,e){if(!this.elements)return;let i=this.elements.ids.findIndex(s=>s===t);i!==-1&&this.setMatrixByIndex(i,e)}setMaxZById(t,e){if(!this.elements)return;let i=this.elements.ids.findIndex(s=>s===t);i!==-1&&this.setMaxZByIndex(i,e)}setOpacity(t,e){if(e===void 0&&(e=!1),!this.geometry)return;let i=this.geometry.getAttribute("opacity");for(let o=0;o<i.count;o++)if(e)i.array[o]=t;else{var s;i.array[o]=Math.min(t,(s=this.originOpacities[o])!=null?s:1)}i.needsUpdate=!0}pushElements(t){this.elements?(this.elements.size+=t.size,this.elements.colors=[...this.elements.colors,...t.colors],this.elements.matrixes=[...this.elements.matrixes,...t.matrixes],this.elements.opacities=[...this.elements.opacities,...t.opacities],this.elements.maxZs=[...this.elements.maxZs,...t.maxZs],this.elements.ids=[...this.elements.ids,...t.ids],this.originOpacities=[...this.originOpacities,...t.opacities]):this.elements=t,this.refesh()}removeInstanceById(t){if(this.elements){if(this.mesh){let e=this.elements.ids.indexOf(t);e!==-1&&(this.elements.size--,this.elements.colors.splice(e*3,3),this.elements.matrixes.splice(e*16,16),this.elements.opacities.splice(e,1),this.elements.maxZs.splice(e,1),this.elements.ids.splice(e,1),this.originOpacities.splice(e,1))}this.refesh()}}refesh(){this.mesh&&(this.mesh.dispose(),this.remove(this.mesh)),this.init()}dispose(){var t;this.material=null,this.originOpacities.length=0,this.geometry.dispose(),(t=this.mesh)==null||t.dispose(),this.clear()}constructor(t,e){super(),this.geometry=new ie.BoxGeometry(1,1,1),this.material=null,this.elements=null,this.originOpacities=[],this.elements=e,this.init()}};var Jx=require("core-js/modules/es.typed-array.float32-array.js"),Qx=require("core-js/modules/es.typed-array.at.js"),t0=require("core-js/modules/es.typed-array.fill.js"),e0=require("core-js/modules/es.typed-array.find-last.js"),i0=require("core-js/modules/es.typed-array.find-last-index.js"),s0=require("core-js/modules/es.typed-array.set.js"),o0=require("core-js/modules/es.typed-array.sort.js"),n0=require("core-js/modules/es.typed-array.to-reversed.js"),r0=require("core-js/modules/es.typed-array.to-sorted.js"),a0=require("core-js/modules/es.typed-array.with.js"),h0=require("core-js/modules/es.array-buffer.constructor.js"),c0=require("core-js/modules/es.array-buffer.slice.js"),l0=require("core-js/modules/es.array-buffer.detached.js"),p0=require("core-js/modules/es.array-buffer.transfer.js"),d0=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),u0=require("core-js/modules/web.dom-collections.iterator.js"),le=require("three");var ps=class extends le.Object3D{init(){return f(this,null,function*(){this.initMaterial(),this.initMesh()})}initMaterial(){this.material=T.GetInstancedWallMaterial()}initMesh(){if(this.mesh&&this.remove(this.mesh),!this.elements)return;this.mesh=new le.InstancedMesh(this.geometry,this.material,this.elements.size);let t=new le.InstancedBufferAttribute(new Float32Array(this.elements.opacities),1),e=new le.InstancedBufferAttribute(new Float32Array(this.elements.maxZs),1),i=new le.InstancedBufferAttribute(new Float32Array(this.elements.minZs),1);this.originOpacities=[...t.array],this.geometry.setAttribute("opacity",t),this.geometry.setAttribute("maxZ",e),this.geometry.setAttribute("minZ",i),this.mesh.instanceMatrix.set(this.elements.matrixes),this.mesh.instanceColor=new le.InstancedBufferAttribute(new Float32Array(this.elements.colors),3),this.add(this.mesh),this.mesh.instanceMatrix.needsUpdate=!0}setOpacityByIndex(t,e){if(this.mesh){let i=this.geometry.getAttribute("opacity");i.setX(t,e),i.needsUpdate=!0}}setOpacity(t,e){e===void 0&&(e=!1),this.elements&&this.elements.opacities.forEach((i,s)=>{let o=e?t:Math.min(t,this.originOpacities[s]);this.setOpacityByIndex(s,o)})}dispose(){this.mesh&&(this.mesh.dispose(),this.remove(this.mesh)),this.material=null,this.geometry&&this.geometry.dispose(),this.elements=null}constructor(t,e){super(),this.geometry=new le.BoxGeometry(1,1,1),this.material=null,this.elements=null,this.originOpacities=[],this.elements=e,this.init()}};var fi=require("three");var Ie=class extends fi.Object3D{init(){return f(this,null,function*(){this.initLineGeometry(),this.initLineMaterial(),this.createBorder()})}initLineMaterial(){return this.lineMaterial=T.GetMergeAttributeGraphicLineMaterial()}initLineGeometry(){this.lineGeometry&&this.lineGeometry.dispose();let t=this.loader.parseGeometries([this.options]);this.lineGeometry=t[this.options.uuid]}createBorder(){this.line&&this.remove(this.line);let t=new fi.LineSegments(this.lineGeometry,this.lineMaterial);return t.position.z=.01,this.line=t,this.add(t),t}dispose(){var t;(t=this.lineGeometry)==null||t.dispose(),this.lineMaterial=null,this.clear()}constructor(t,e){super(),this.context=t,this.lineMaterial=null,this.loader=new fi.ObjectLoader,this.options=w({},te,e),this.init()}};var Ea=require("three"),Js=class extends Tt{setEnable(t){super.setEnable(t),Y(this.rect,0,0,0,0),t?this.registryEvent():(this.startPoint=void 0,this.unRegistryEvent())}registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointermove",this.onPointerMove),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.addEventListener("update",this.onUpdate)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointermove",this.onPointerMove),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.removeEventListener("update",this.onUpdate)}doSelect(){if(this.startPoint&&this.endPoint){if(this.startPoint.distanceTo(this.endPoint)<.1)return;let{context:{camera:e,container:{clientWidth:i,clientHeight:s}}}=this,o=A(this.startPoint,e,i,s),n=A(this.endPoint,e,i,s),r={x:Math.min(o.x,n.x),y:Math.min(o.y,n.y)},h={x:Math.max(o.x,n.x),y:Math.max(o.y,n.y)},c=this.searchMapInFrustum(r,h);this.dispatchEvent({type:"selected",list:c})}}searchMapInFrustum(t,e){var i;let{context:s}=this;return((i=s.currentFloor)==null?void 0:i.graphicLayer.children.filter(o=>o instanceof st&&this.searchChildInFrustum(o,t,e)))||[]}searchChildInFrustum(t,e,i){let{context:{camera:s,container:{clientWidth:o,clientHeight:n}}}=this;if(!t)return!1;if(!t.mesh){let d=t.getPosition();if(d){let u=A(d,s,o,n);return Ee(u,e,i)}return!1}t.mesh.geometry.boundingBox||t.mesh.geometry.computeBoundingBox();let r=t.mesh.geometry.boundingBox;if(!r)return!1;let{min:h,max:c}=r,l=A(h,s,o,n),p=A(c,s,o,n);return!(!Ee(l,e,i)||!Ee(p,e,i))}dispose(){super.dispose(),this.rect=null,this.unRegistryEvent()}constructor(t){super(t),this.frustum=new Ea.Frustum,this.onPointerDown=s=>{if(!this.enable)return;let o=this.getIntersectByPointerEvent(s);o&&(this.startPoint=o),this.endPoint=void 0},this.onPointerMove=s=>{if(!this.enable||!this.startPoint)return;let o=this.getIntersectByPointerEvent(s);o&&(this.endPoint=o)},this.onPointerUp=s=>{if(!this.enable)return;let o=this.getIntersectByPointerEvent(s);o&&(this.endPoint=o),this.doSelect(),this.startPoint=void 0},this.onUpdate=()=>{if(this.startPoint){let s=this.getSvgCoordinate(this.startPoint),o=w({},s);this.endPoint&&(o=this.getSvgCoordinate(this.endPoint));let n={x:Math.min(s.x,o.x),y:Math.min(s.y,o.y)},r=Math.abs(o.x-s.x),h=Math.abs(o.y-s.y);Y(this.rect,n.x,n.y,r,h)}else Y(this.rect,0,0,0,0)};let{config:{selectBox:{fill:e,stroke:i}}}=t;this.rect=Rt(i,e),this.svg.appendChild(this.rect),this.registryEvent()}};var ds=class extends Sa.EventDispatcher{get list(){return this._list}enableBoxSelection(){this.isMultipleSelect||!this.context.config.enableBoxSelect||(this.isMultipleSelect=!0,this.boxSelection.setEnable(!0),this.prevPanStatus=this.context.control.enablePan,this.prevRotateStatus=this.context.control.enableRotate,this.context.control.enablePan=!1,this.context.control.enableRotate=!1)}disableBoxSelection(){this.isMultipleSelect&&(this.isMultipleSelect=!1,this.boxSelection.setEnable(!1),this.context.control.enablePan=!!this.prevPanStatus,this.context.control.enableRotate=!!this.prevRotateStatus)}selectEnd(){this.dispatchEvent({type:"select",graphics:[...this._list],isMultipleSelect:this.isMultipleSelect})}registryEvent(){this.context.container.addEventListener("pointerdown",this.onPointerDown),this.context.container.addEventListener("pointerup",this.onPointerUp),this.context.container.addEventListener("pointerout",this.onPointerOut),this.context.container.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp),this.boxSelection.addEventListener("selected",this.onBoxSelected)}unRegistryEvent(){this.context.container.removeEventListener("pointerdown",this.onPointerDown),this.context.container.removeEventListener("pointerup",this.onPointerUp),this.context.container.removeEventListener("pointerout",this.onPointerOut),this.context.container.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp),this.boxSelection.removeEventListener("selected",this.onBoxSelected)}clear(){this._list.clear()}remove(t){this._list.delete(t)}dispose(){this.unRegistryEvent()}constructor(t){super(),this.context=t,this._list=new Set,this.downPoint=null,this.downTime=0,this.isMultipleSelect=!1,this.onPointerDown=e=>{Date.now()-this.downTime<200||(this.downPoint={x:e.offsetX,y:e.offsetY},this.downTime=Date.now())},this.onPointerUp=e=>{if(!this.downPoint)return;let{offsetX:i,offsetY:s}=e,{x:o,y:n}=this.downPoint;if(Math.sqrt((o-i)**2+(n-s)**2)>3)return;let{graphics:r}=this.context.getGraphicsByDeviceXy(i,s),h=new Set(r.map(l=>l.options.id));this.context.getPoisByDeviceXy(i,s).forEach(l=>{if(!h.has(l.options.id)){var p;let d=((p=this.context.currentFloor)==null?void 0:p.graphicLayer.graphicMap.get(l.options.id))||null;d&&d.options.geometry.type==="point"&&(r.push(d),h.add(l.options.id))}}),(Ve?e.metaKey:e.ctrlKey)||this._list.clear(),r.forEach(l=>this._list.add(l)),this.selectEnd(),this.downPoint=null},this.onPointerOut=e=>{this.disableBoxSelection()},this.onKeyDown=e=>{Ke(e.key)&&this.enableBoxSelection()},this.onKeyUp=e=>{Ke(e.key)&&this.disableBoxSelection()},this.onBoxSelected=e=>{let{list:i}=e;this._list.clear(),i.forEach(s=>{this._list.add(s)}),this.selectEnd()},this.boxSelection=new Js(t),this.boxSelection.setEnable(!1),this.registryEvent()}};var B0=require("core-js/modules/es.set.difference.v2.js"),z0=require("core-js/modules/es.set.intersection.v2.js"),W0=require("core-js/modules/es.set.is-disjoint-from.v2.js"),U0=require("core-js/modules/es.set.is-subset-of.v2.js"),H0=require("core-js/modules/es.set.is-superset-of.v2.js"),N0=require("core-js/modules/es.set.symmetric-difference.v2.js"),Z0=require("core-js/modules/es.set.union.v2.js"),j0=require("core-js/modules/web.dom-collections.iterator.js");var Qs=require("three");var us=class extends Qs.EventDispatcher{handleHoverGraphicsChange(t){t===void 0&&(t=this.curGraphics),this.dispatchEvent({type:"hover-change",graphics:Array.from(t)})}registryEvent(){this.context.addEventListener("pointer-over",this.onPointerMove),this.context.addEventListener("pointer-move",this.onPointerMove),this.context.addEventListener("pointer-level",this.onPointerLevel),document.body.addEventListener("pointermove",this.onBodyPointerMove)}unRegistryEvent(){this.context.removeEventListener("pointer-over",this.onPointerMove),this.context.removeEventListener("pointer-move",this.onPointerMove),this.context.removeEventListener("pointer-level",this.onPointerLevel),document.body.removeEventListener("pointermove",this.onBodyPointerMove)}dispose(){this.unRegistryEvent(),this.timer.dispose()}constructor(t){super(),this.context=t,this.curGraphics=new Set,this.timer=new J,this.graphicTimerMap=new Map,this.onPointerMove=e=>{let{graphics:i,pois:s,e:o}=e,n=s.map(l=>{var p;return(p=this.context.currentFloor)==null?void 0:p.graphicLayer.graphicMap.get(l.options.id)}).filter(l=>l&&l.options.geometry.type==="point");if(!i.length&&!n.length&&this.curGraphics.size){this.curGraphics.clear(),this.handleHoverGraphicsChange();return}let{time:r}=this.context.config.hover,h=new Set;if(n.length){let l,p=1e4;n.forEach(d=>{let u=s.find(g=>g.options.id===d.options.id);if(u instanceof Re){let{x:g,y:x}=u.clientPos,m=Math.sqrt((g-o.offsetX)**2+(x-o.offsetY)**2);m<p&&(p=m,l=d)}else if(u instanceof rt){let{x:g,y:x}=u.box.getCenter(new Qs.Vector2),m=Math.sqrt((g-o.offsetX)**2+(x-o.offsetY)**2);m<p&&(p=m,l=d)}}),h.add(l)}h.size||i.forEach(l=>h.add(l)),h.forEach(l=>{if(this.graphicTimerMap.get(l)||this.curGraphics.has(l))return;let p=this.timer.setTimeout(()=>{this.curGraphics.add(l),this.graphicTimerMap.delete(l),this.timer.clearTimeout(p),this.handleHoverGraphicsChange()},r);this.graphicTimerMap.set(l,p)}),this.graphicTimerMap.forEach((l,p)=>{h.has(p)||(this.timer.clearTimeout(l),this.graphicTimerMap.delete(p))});let c=this.curGraphics.size;this.curGraphics.forEach(l=>{h.has(l)||this.curGraphics.delete(l)}),c!==this.curGraphics.size&&this.handleHoverGraphicsChange()},this.onPointerLevel=()=>{this.curGraphics.clear(),this.handleHoverGraphicsChange()},this.onBodyPointerMove=e=>{if(this.curGraphics.size){let i=this.context.container.getBoundingClientRect();(e.clientX<i.left||e.clientX>i.right||e.clientY<i.top||e.clientY>i.bottom)&&this.onPointerLevel()}},this.registryEvent()}};var Y0=require("core-js/modules/web.dom-collections.iterator.js"),Xt=require("three");var ms=require("@turf/turf"),to=class{updateBox(){this.box.setFromObject(this.context.scene)}setEnable(t){this.enable=t,t?this.registryEvent():this.unRegistryEvent()}changePrevCamera(){this.prevCamera={position:this.context.camera.position.clone(),zoom:this.context.camera.zoom,target:this.context.control.target.clone()}}backToPrevCamera(){this.setEnable(!1),this.context.camera.position.copy(this.prevCamera.position),this.context.camera.zoom=this.prevCamera.zoom,this.context.control.target.copy(this.prevCamera.target),this.context.control.update(),this.setEnable(!0)}registryEvent(){this.context.addEventListener("control-change",this.onCameraChange)}unRegistryEvent(){this.context.removeEventListener("control-change",this.onCameraChange)}getCurFloorScreenPosition(){if(!this.context.scene.children.filter(g=>g instanceof ce).length)return null;let e=this.box,{camera:i,clientSize:{width:s,height:o}}=this.context,{min:n,max:r}=e,c=[new Xt.Vector3(n.x,n.y,n.z),new Xt.Vector3(r.x,n.y,n.z),new Xt.Vector3(n.x,r.y,n.z),new Xt.Vector3(r.x,r.y,n.z),new Xt.Vector3(n.x,n.y,r.z),new Xt.Vector3(r.x,n.y,r.z),new Xt.Vector3(n.x,r.y,r.z),new Xt.Vector3(r.x,r.y,r.z)].map(g=>A(g,i,s,o)),l=Math.min(...c.map(g=>g.x)),p=Math.max(...c.map(g=>g.x)),d=Math.min(...c.map(g=>g.y)),u=Math.max(...c.map(g=>g.y));return{left:l,right:p,top:d,bottom:u}}checkDistanceToScreenEdge(t){let{left:e,right:i,top:s,bottom:o}=t,{width:n,height:r}=this.context.clientSize,[h,c,l,p]=this.context.config.cameraBound.padding,d=(0,ms.polygon)([[[e,s],[i,s],[i,o],[e,o],[e,s]]]),u=(0,ms.polygon)([[[p,h],[n-c,h],[n-c,r-l],[p,r-l],[p,h]]]);try{return(0,ms.intersect)(d,u)!==null}catch(g){return console.warn("\u8BA1\u7B97\u4EA4\u96C6\u51FA\u9519:",g),!1}}dispose(){this.unRegistryEvent()}constructor(t){this.context=t,this.prevCamera={position:new Xt.Vector3,zoom:1,target:new Xt.Vector3},this.enable=!0,this.box=new Xt.Box3,this.onCameraChange=()=>{let e=this.getCurFloorScreenPosition();if(e){let{left:i,right:s,top:o,bottom:n}=e;if([i,s,o,n].every(h=>!h))return;this.checkDistanceToScreenEdge({left:i,right:s,top:o,bottom:n})?this.changePrevCamera():this.backToPrevCamera()}},this.registryEvent(),this.changePrevCamera()}};var iw=require("core-js/modules/es.promise.finally.js"),mn=require("three"),ti=require("@tweenjs/tween.js");var Q0=require("core-js/modules/web.dom-collections.iterator.js"),tw=require("core-js/modules/es.array.push.js"),E=require("three"),eo=new E.Ray,Ca=new E.Plane,Fc=Math.cos(70*E.MathUtils.DEG2RAD),io=class extends E.EventDispatcher{dispose(){this.domElement.removeEventListener("contextmenu",this.onContextMenu),this.domElement.removeEventListener("pointerdown",this.onPointerDown),this.domElement.removeEventListener("pointercancel",this.onPointerUp),this.domElement.removeEventListener("wheel",this.onMouseWheel),this.domElement.removeEventListener("pointermove",this.onPointerMove),this.domElement.removeEventListener("pointerup",this.onPointerUp),this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=null)}constructor(t,e){super(),this.rotateLineStart=new E.Vector2,this.rotateLineEnd=new E.Vector2,this.spherical=new E.Spherical,this.sphericalDelta=new E.Spherical,this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new E.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.screenSpacePanning=!1,this.mouseButtons={LEFT:E.MOUSE.PAN,MIDDLE:E.MOUSE.DOLLY,RIGHT:E.MOUSE.ROTATE},this.touches={ONE:E.TOUCH.PAN,TWO:E.TOUCH.DOLLY_ROTATE},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return r.phi},this.getAzimuthalAngle=function(){return r.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(y){y.addEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=y},this.stopListenToKeyEvents=function(){var y;(y=this._domElementKeyEvents)==null||y.removeEventListener("keydown",this.onKeyDown),this._domElementKeyEvents=null},this.saveState=function(){i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=function(){i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent({type:"change"}),i.update(),o=s.NONE},this.update=function(){let y=new E.Vector3,M=new E.Quaternion().setFromUnitVectors(t.up,new E.Vector3(0,1,0)),X=M.clone().invert(),lt=new E.Vector3,Nt=new E.Quaternion,ue=new E.Vector3,ne=2*Math.PI;return function(Si){Si===void 0&&(Si=null);let Me=i.object.position;y.copy(Me).sub(i.target),y.applyQuaternion(M),r.setFromVector3(y),i.autoRotate&&o===s.NONE&&at(B(Si)),i.enableDamping?(r.theta+=h.theta*i.dampingFactor,r.phi+=h.phi*i.dampingFactor):(r.theta+=h.theta,r.phi+=h.phi);let _e=i.minAzimuthAngle,be=i.maxAzimuthAngle;isFinite(_e)&&isFinite(be)&&(_e<-Math.PI?_e+=ne:_e>Math.PI&&(_e-=ne),be<-Math.PI?be+=ne:be>Math.PI&&(be-=ne),_e<=be?r.theta=Math.max(_e,Math.min(be,r.theta)):r.theta=r.theta>(_e+be)/2?Math.max(_e,r.theta):Math.min(be,r.theta)),r.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,r.phi)),r.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(l,i.dampingFactor):i.target.add(l),i.zoomToCursor&&R||i.object.isOrthographicCamera?r.radius=G(r.radius):r.radius=G(r.radius*c),y.setFromSpherical(r),y.applyQuaternion(X),Me.copy(i.target).add(y),i.object.lookAt(i.target),i.enableDamping===!0?(h.theta*=1-i.dampingFactor,h.phi*=1-i.dampingFactor,l.multiplyScalar(1-i.dampingFactor)):(h.set(0,0,0),l.set(0,0,0));let ks=!1;if(i.zoomToCursor&&R){let Ci=null;if(i.object.isPerspectiveCamera){let Li=y.length();Ci=G(Li*c);let As=Li-Ci;i.object.position.addScaledVector(L,As),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){let Li=new E.Vector3(C.x,C.y,0);Li.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/c)),i.object.updateProjectionMatrix(),ks=!0;let As=new E.Vector3(C.x,C.y,0);As.unproject(i.object),i.object.position.sub(As).add(Li),i.object.updateMatrixWorld(),Ci=y.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;Ci!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(Ci).add(i.object.position):(eo.origin.copy(i.object.position),eo.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(eo.direction))<Fc?t.lookAt(i.target):(Ca.setFromNormalAndCoplanarPoint(i.object.up,i.target),eo.intersectPlane(Ca,i.target))))}else i.object.isOrthographicCamera&&(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/c)),i.object.updateProjectionMatrix(),ks=!0);return c=1,R=!1,ks||lt.distanceToSquared(i.object.position)>n||8*(1-Nt.dot(i.object.quaternion))>n||ue.distanceToSquared(i.target)>0?(i.dispatchEvent({type:"change"}),lt.copy(i.object.position),Nt.copy(i.object.quaternion),ue.copy(i.target),ks=!1,!0):!1}}();let i=this,s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},o=s.NONE,n=1e-6,r=new E.Spherical,h=new E.Spherical,c=1,l=new E.Vector3,p=new E.Vector2,d=new E.Vector2,u=new E.Vector2,g=new E.Vector2,x=new E.Vector2,m=new E.Vector2,v=new E.Vector2,P=new E.Vector2,_=new E.Vector2,L=new E.Vector3,C=new E.Vector2,R=!1,b=[],U={};function B(y){return y!==null?2*Math.PI/60*i.autoRotateSpeed*y:2*Math.PI/60/60*i.autoRotateSpeed}function z(){return Math.pow(.95,i.zoomSpeed)}function at(y){h.theta-=y}function ft(y){h.phi-=y}let K=function(){let y=new E.Vector3;return function(X,lt){y.setFromMatrixColumn(lt,0),y.multiplyScalar(-X),l.add(y)}}(),ht=function(){let y=new E.Vector3;return function(X,lt){i.screenSpacePanning===!0?y.setFromMatrixColumn(lt,1):(y.setFromMatrixColumn(lt,0),y.crossVectors(i.object.up,y)),y.multiplyScalar(X),l.add(y)}}(),N=function(){let y=new E.Vector3;return function(X,lt){let Nt=i.domElement;if(i.object.isPerspectiveCamera){let ue=i.object.position;y.copy(ue).sub(i.target);let ne=y.length();ne*=Math.tan(i.object.fov/2*Math.PI/180),K(2*X*ne/Nt.clientHeight,i.object.matrix),ht(2*lt*ne/Nt.clientHeight,i.object.matrix)}else i.object.isOrthographicCamera?(K(X*(i.object.right-i.object.left)/i.object.zoom/Nt.clientWidth,i.object.matrix),ht(lt*(i.object.top-i.object.bottom)/i.object.zoom/Nt.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}}();function zt(y){i.object.isPerspectiveCamera||i.object.isOrthographicCamera?c/=y:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function ct(y){i.object.isPerspectiveCamera||i.object.isOrthographicCamera?c*=y:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function W(y){if(!i.zoomToCursor)return;R=!0;let M=i.domElement.getBoundingClientRect(),X=y.clientX-M.left,lt=y.clientY-M.top,Nt=M.width,ue=M.height;C.x=X/Nt*2-1,C.y=-(lt/ue)*2+1,L.set(C.x,C.y,1).unproject(i.object).sub(i.object.position).normalize()}function G(y){return Math.max(i.minDistance,Math.min(i.maxDistance,y))}function tt(y){p.set(y.clientX,y.clientY)}function $(y){W(y),v.set(y.clientX,y.clientY)}function pe(y){g.set(y.clientX,y.clientY)}function de(y){d.set(y.clientX,y.clientY),u.subVectors(d,p).multiplyScalar(i.rotateSpeed);let M=i.domElement;at(2*Math.PI*u.x/M.clientHeight),ft(2*Math.PI*u.y/M.clientHeight),p.copy(d),i.update()}function Ae(y){P.set(y.clientX,y.clientY),_.subVectors(P,v),_.y>0?zt(z()):_.y<0&&ct(z()),v.copy(P),i.update()}function Pe(y){x.set(y.clientX,y.clientY),m.subVectors(x,g).multiplyScalar(i.panSpeed),N(m.x,m.y),g.copy(x),i.update()}function Ei(y){W(y),y.deltaY<0?ct(z()):y.deltaY>0&&zt(z()),i.update()}function eh(y){let M=!1;switch(y.code){case i.keys.UP:y.ctrlKey||y.metaKey||y.shiftKey?ft(2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):N(0,i.keyPanSpeed),M=!0;break;case i.keys.BOTTOM:y.ctrlKey||y.metaKey||y.shiftKey?ft(-2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):N(0,-i.keyPanSpeed),M=!0;break;case i.keys.LEFT:y.ctrlKey||y.metaKey||y.shiftKey?at(2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):N(i.keyPanSpeed,0),M=!0;break;case i.keys.RIGHT:y.ctrlKey||y.metaKey||y.shiftKey?at(-2*Math.PI*i.rotateSpeed/i.domElement.clientHeight):N(-i.keyPanSpeed,0),M=!0;break}M&&(y.preventDefault(),i.update())}function Vn(){if(b.length===1)p.set(b[0].pageX,b[0].pageY);else{let y=(b[0].pageX-b[0].pageY)/(b[1].pageX-b[1].pageY),M=b[0].pageY-y*b[0].pageX;i.rotateLineStart.set(y,M);let X=.5*(b[0].pageX+b[1].pageX),lt=.5*(b[0].pageY+b[1].pageY);p.set(X,lt)}}function Kn(){if(b.length===1)g.set(b[0].pageX,b[0].pageY);else{let y=.5*(b[0].pageX+b[1].pageX),M=.5*(b[0].pageY+b[1].pageY);g.set(y,M)}}function Xn(){let y=b[0].pageX-b[1].pageX,M=b[0].pageY-b[1].pageY,X=Math.sqrt(y*y+M*M);v.set(0,X)}function ih(){i.enableZoom&&Xn(),i.enablePan&&Kn()}function sh(){i.enableZoom&&Xn(),i.enableRotate&&Vn()}function Yn(y){if(b.length==1)d.set(y.pageX,y.pageY);else{let X=To(y),lt=.5*(y.pageX+X.x),Nt=.5*(y.pageY+X.y);d.set(lt,Nt);let ue=(y.pageY-X.y)/(y.pageX-X.x),ne=X.y-ue*X.x;if(i.rotateLineEnd.set(ue,ne),Number.isFinite(i.rotateLineEnd.x)&&Number.isFinite(i.rotateLineStart.x)){let ko=(i.rotateLineStart.y-i.rotateLineEnd.y)/(i.rotateLineEnd.x-i.rotateLineStart.x),Si=ue*ko+ne;if(Number.isFinite(ko)&&Number.isFinite(Si)){let Me=Math.atan(i.rotateLineEnd.x)-Math.atan(i.rotateLineStart.x);Math.PI-Math.abs(Me)<.5&&(Me=-Math.sign(Me)*(Math.PI-Math.abs(Me))),Math.abs(Me)<.1&&(h.theta+=Me)}}i.rotateLineStart.copy(i.rotateLineEnd)}u.subVectors(d,p).multiplyScalar(i.rotateSpeed);let M=i.domElement;ft(2*Math.PI*u.y/M.clientHeight),p.copy(d)}function qn(y){if(b.length===1)x.set(y.pageX,y.pageY);else{let M=To(y),X=.5*(y.pageX+M.x),lt=.5*(y.pageY+M.y);x.set(X,lt)}m.subVectors(x,g).multiplyScalar(i.panSpeed),N(m.x,m.y),g.copy(x)}function $n(y){let M=To(y),X=y.pageX-M.x,lt=y.pageY-M.y,Nt=Math.sqrt(X*X+lt*lt);P.set(0,Nt),_.set(0,Math.pow(P.y/v.y,i.zoomSpeed)),zt(_.y),v.copy(P)}function oh(y){i.enableZoom&&$n(y),i.enablePan&&qn(y)}function nh(y){i.enableZoom&&$n(y),i.enableRotate&&Yn(y)}this.onPointerDown=function(M){i.enabled!==!1&&(b.length===0&&(i.domElement.setPointerCapture(M.pointerId),i.domElement.addEventListener("pointermove",i.onPointerMove),i.domElement.addEventListener("pointerup",i.onPointerUp)),lh(M),M.pointerType==="touch"?hh(M):rh(M))},this.onPointerMove=function(M){i.enabled!==!1&&(M.pointerType==="touch"?ch(M):ah(M))},this.onPointerUp=function(M){ph(M),b.length===0&&(i.domElement.releasePointerCapture(M.pointerId),i.domElement.removeEventListener("pointermove",i.onPointerMove),i.domElement.removeEventListener("pointerup",i.onPointerUp)),i.dispatchEvent({type:"end"}),o=s.NONE};function rh(y){let M;switch(y.button){case 0:M=i.mouseButtons.LEFT;break;case 1:M=i.mouseButtons.MIDDLE;break;case 2:M=i.mouseButtons.RIGHT;break;default:M=-1}switch(M){case E.MOUSE.DOLLY:if(i.enableZoom===!1)return;$(y),o=s.DOLLY;break;case E.MOUSE.ROTATE:if(y.ctrlKey||y.metaKey||y.shiftKey){if(i.enablePan===!1)return;pe(y),o=s.PAN}else{if(i.enableRotate===!1)return;tt(y),o=s.ROTATE}break;case E.MOUSE.PAN:if(y.ctrlKey||y.metaKey||y.shiftKey){if(i.enableRotate===!1)return;tt(y),o=s.ROTATE}else{if(i.enablePan===!1)return;pe(y),o=s.PAN}break;default:o=s.NONE}o!==s.NONE&&i.dispatchEvent({type:"start"})}function ah(y){switch(o){case s.ROTATE:if(i.enableRotate===!1)return;de(y);break;case s.DOLLY:if(i.enableZoom===!1)return;Ae(y);break;case s.PAN:if(i.enablePan===!1)return;Pe(y);break}}this.onMouseWheel=function(M){i.enabled===!1||i.enableZoom===!1||o!==s.NONE||(M.preventDefault(),i.dispatchEvent({type:"start"}),Ei(M),i.dispatchEvent({type:"end"}))},this.onKeyDown=function(M){i.enabled===!1||i.enablePan===!1||eh(M)};function hh(y){switch(Jn(y),b.length){case 1:switch(i.touches.ONE){case E.TOUCH.ROTATE:if(i.enableRotate===!1)return;Vn(),o=s.TOUCH_ROTATE;break;case E.TOUCH.PAN:if(i.enablePan===!1)return;Kn(),o=s.TOUCH_PAN;break;default:o=s.NONE}break;case 2:switch(i.touches.TWO){case E.TOUCH.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;ih(),o=s.TOUCH_DOLLY_PAN;break;case E.TOUCH.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;sh(),o=s.TOUCH_DOLLY_ROTATE;break;default:o=s.NONE}break;default:o=s.NONE}o!==s.NONE&&i.dispatchEvent({type:"start"})}function ch(y){switch(Jn(y),o){case s.TOUCH_ROTATE:if(i.enableRotate===!1)return;Yn(y),i.update();break;case s.TOUCH_PAN:if(i.enablePan===!1)return;qn(y),i.update();break;case s.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;oh(y),i.update();break;case s.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;nh(y),i.update();break;default:o=s.NONE}}this.onContextMenu=function(M){i.enabled!==!1&&M.preventDefault()};function lh(y){b.push(y)}function ph(y){delete U[y.pointerId];for(let M=0;M<b.length;M++)if(b[M].pointerId==y.pointerId){b.splice(M,1);return}}function Jn(y){let M=U[y.pointerId];M===void 0&&(M=new E.Vector2,U[y.pointerId]=M),M.set(y.pageX,y.pageY)}function To(y){let M=y.pointerId===b[0].pointerId?b[1]:b[0];return U[M.pointerId]}i.domElement.addEventListener("contextmenu",this.onContextMenu),i.domElement.addEventListener("pointerdown",this.onPointerDown),i.domElement.addEventListener("pointercancel",this.onPointerUp),i.domElement.addEventListener("wheel",this.onMouseWheel,{passive:!1}),this.update()}};var fs=class extends io{registryEvent(){this.addEventListener("change",this.onChange),this.context.addEventListener("update",this.tweenUpdate)}unRegistryEvent(){this.removeEventListener("change",this.onChange),this.context.removeEventListener("update",this.tweenUpdate)}setPolarAngle(t,e){e===void 0&&(e=!1);let{maxPolarAngle:i,minPolarAngle:s}=this,o=i===s;(e||t<=i&&t>=s)&&(this.maxPolarAngle=t,this.minPolarAngle=t,this.update()),o||(this.maxPolarAngle=i,this.minPolarAngle=s)}setPolarAngleByDuration(t,e,i){return f(this,null,function*(){return e===void 0&&(e=!1),i===void 0&&(i=500),i<=0?this.setPolarAngle(t,e):jt(new Promise(s=>{let o={polar:this.getPolarAngle()},n={polar:t},r=new ti.Tween(o,this.tweenGroup).to(n,i).onUpdate(()=>{this.setPolarAngle(o.polar,e)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(r),s(!0)}).onStart(()=>{this.enabled=!1}).start()}),i+500)})}setAzimuthalAngle(t,e){let{maxAzimuthAngle:i,minAzimuthAngle:s}=this,o=i===s;(e||t<=i&&t>=s)&&(this.maxAzimuthAngle=t,this.minAzimuthAngle=t,this.update()),o||(this.maxAzimuthAngle=i,this.minAzimuthAngle=s)}setAzimuthalAngleDuration(t,e,i){return e===void 0&&(e=!1),i===void 0&&(i=500),i<=0?this.setAzimuthalAngle(t,e):jt(new Promise(s=>{let o={azimuthal:this.getAzimuthalAngle()},n={azimuthal:t},r=new ti.Tween(o,this.tweenGroup).to(n,i).onUpdate(()=>{this.setAzimuthalAngle(o.azimuthal,e)}).onComplete(()=>{this.enabled=!0,this.tweenGroup.remove(r),s(!0)}).onStart(()=>{this.enabled=!1}).start()}),i+500)}getCameraLookAt(){return new mn.Vector3().subVectors(this.target,this.camera.position)}setCameraPositionByTarget(t,e){return f(this,null,function*(){let i=this.target.clone(),s=this.getCameraLookAt();if(!e){this.camera.position.copy(t.clone().sub(s)),this.target.copy(t.clone()),this.update();return}return jt(new Promise(o=>{let n=new ti.Tween(i,this.tweenGroup).to(t,e).onUpdate(()=>{this.camera.position.copy(i.clone().sub(s)),this.target.copy(i.clone()),this.update()}).onComplete(()=>{this.tweenGroup.remove(n),this.enabled=!0,o(!0)}).onStart(()=>{this.enabled=!1}).start()}),e+500)})}setZoom(t,e,i){i===void 0&&(i=!1);let{minZoom:s,maxZoom:o}=this;(i||t>=s&&t<=o)&&(this.camera.position.copy(e.clone().sub(this.getCameraLookAt())),this.target.copy(e),this.camera.zoom=t,this.update())}setZoomByDuration(t,e,i,s){return f(this,null,function*(){i===void 0&&(i=!1),s===void 0&&(s=500);let o={zoom:this.camera.zoom,target:this.target.clone()};if(!(t===this.camera.zoom&&!i))return s?jt(new Promise(n=>{let r=new ti.Tween(o,this.tweenGroup).to({zoom:t,target:e},s).onUpdate(()=>{this.setZoom(o.zoom,o.target,i)}).onComplete(()=>{this.tweenGroup.remove(r),this.enabled=!0,n(!0)}).onStart(()=>{this.enabled=!1}).start()}),s+500).finally(()=>{this.enabled=!0}):this.setZoom(t,e,i)})}setTargetByOffset(t,e){if(e===void 0&&(e=this.target.clone()),this.camera.updateMatrix(),t){let i=new mn.Vector3;i.setFromMatrixColumn(this.camera.matrix,1),i.normalize(),i.multiplyScalar(t/this.camera.zoom),e.add(i)}this.setCameraPositionByTarget(e,0)}clearTween(){this.tweenGroup.getAll().forEach(t=>t.stop()),this.tweenGroup.removeAll()}dispose(){super.dispose(),this.unRegistryEvent(),this.clearTween()}constructor(t,e,i){super(e,i),this.context=t,this.camera=e,this.domElement=i,this.prevCameraZoom=1,this.tweenGroup=new ti.Group,this.offsetY=0,this.onChange=()=>{let s=this.camera.zoom;s!==this.prevCameraZoom&&(this.prevCameraZoom=s,this.dispatchEvent({type:"change-zoom",zoom:s}))},this.tweenUpdate=()=>{this.tweenGroup.update()},this.enableDamping=!1,this.zoomSpeed=.5,this.prevCameraZoom=e.zoom,this.registryEvent()}};var gi=require("three");var gs=class extends gi.WebGLRenderer{setCameraAndScene(t,e){this.scene=t,this.camera=e}autoRender(){if(this.scene&&this.camera&&this.enable&&(this.event.dispatchEvent({type:"update"}),this.render(this.scene,this.camera)),this.context.config.renderAnimation==="requestAnimationFrame")this.timer.requestAnimationFrame(()=>{this.autoRender()});else{let t=1e3/this.context.config.fps;this.timer.setTimeout(()=>{this.autoRender()},t)}}pauseRender(){this.enable=!1}continueRender(){this.enable=!0}addEventListener(t,e){this.event.addEventListener(t,e)}removeEventListener(t,e){this.event.removeEventListener(t,e)}constructor(t,e){super(w({antialias:!0,alpha:!0},e)),this.context=t,this.event=new gi.EventDispatcher,this.enable=!0,this.timer=new J,this.autoClear=!0,this.setPixelRatio(window.devicePixelRatio),this.toneMapping=gi.LinearToneMapping,this.toneMappingExposure=1;let i=this.dispose;this.dispose=()=>{this.timer.dispose(),this.enable=!1,i.call(this),this.domElement.remove(),this.domElement=null,this.shadowMap=null,this.info.programs&&(this.info.programs.length=0),this.info=null}}};var Aa=require("three");var La=require("three"),Ta=require("three/examples/jsm/environments/RoomEnvironment.js");function ka(a,t){t===void 0&&(t=.85);let e=new La.PMREMGenerator(a);return e.compileEquirectangularShader(),e.fromScene(new Ta.RoomEnvironment).texture}var ys=class extends Aa.Scene{dispose(){var t;(t=this.environment)==null||t.dispose(),this.environment=null,I(this),this.clear()}constructor(t){super(),this.environment=ka(t)}};var Da=require("three"),vs=class extends Da.OrthographicCamera{constructor(t,e){super(-t/2,t/2,e/2,-e/2,-1e4,5e4),this.up.set(0,0,1),this.position.set(0,0,100),this.lookAt(0,0,0)}};var fn=require("@turf/turf");var fw=require("core-js/modules/es.array.unshift.js"),gw=require("core-js/modules/es.array.push.js"),Oa=require("three"),so=class{registryEvent(){this.context.addEventListener("update",this.onUpdate),this.context.addEventListener("control-change",this.onControlChange),this.context.addEventListener("resize",this.onControlChange)}unRegistryEvent(){this.context.removeEventListener("update",this.onUpdate),this.context.removeEventListener("control-change",this.onControlChange),this.context.removeEventListener("resize",this.onControlChange)}changePoiLevelOrCollisionEnable(t){let e=this.objects.findIndex(i=>i===t);e!==-1&&(this.objects.splice(e,1),this.addObject(t))}addObject(t){if(!this.objects.includes(t)){if(this.needsUpdate=!0,!t.options.collision_enable){this.objects.unshift(t);return}if(t.options.level===0){this.objects.push(t);return}for(let e=0;e<this.objects.length;e++){let i=this.objects[e];if(i.options.collision_enable&&i.options.level<=t.options.level){this.objects.splice(e,0,t);return}}this.objects.push(t)}}removeObject(t){let e=this.objects.indexOf(t);e!==-1&&(this.objects.splice(e,1),this.needsUpdate=!0)}removeObjects(t){this.objects=this.objects.filter(e=>!t.includes(e)),this.needsUpdate=!0}getObjectById(t){return this.objects.find(e=>e.options.id===t)||null}validShowParkingSpace(t){t===void 0&&(t=60);let{clientSize:{width:e,height:i},control:s,camera:o}=this.context,n=Math.min(e/t,i/t,s.maxZoom-1);return o.zoom>=n}detectCollisions(){if(!this.needsUpdate)return;let t=[],{camera:e}=this.context;e.updateMatrixWorld();let i=l=>l<=1&&l>=-1,s=e.projectionMatrix.clone();s.multiply(e.matrixWorldInverse);let o=e.zoom/this.context.basicZoom,n=25/30,r=Math.min(25,Math.max(1,o*n)),h=this.validShowParkingSpace();this.objects.filter(l=>{if(l.visible){if(!(r<=l.options.maxWeight&&r>=l.options.minWeight)||!h&&l.userData.type==="parkingSpace")return l.parentSetVisible(!1),!1;let p=l.getLabelOriginWorldPosition(new Oa.Vector3);return p.applyMatrix4(s),l.screenPosition=p,i(p.x)&&i(p.y)&&i(p.z)?!0:(l.parentSetVisible(!1),!1)}return!1}).forEach((l,p)=>{let d=l.getBox(l.screenPosition);if(d===null){l.parentSetVisible(!1);return}if(p===0||!l.options.collision_enable){t.push(d),l.parentSetVisible(!0);return}let u=t.some(g=>g.intersectsBox(d));l.parentSetVisible(!u),u||t.push(d)}),this.needsUpdate=!1}markForUpdate(){this.needsUpdate=!0}clear(){this.objects=[],this.needsUpdate=!0}dispose(){this.objects=[],this.unRegistryEvent()}constructor(t){this.context=t,this.objects=[],this.needsUpdate=!0,this.onUpdate=()=>{this.detectCollisions()},this.onControlChange=()=>{this.needsUpdate=!0},this.registryEvent()}};var xs=class extends F.EventDispatcher{get config(){return this.bmap.config}get center(){return this.bmap.buildingCenter}setRange(t){this.range=(0,fn.polygon)([t])}resizeClientSize(){let{x:t,y:e,width:i,height:s}=this.container.getBoundingClientRect();this.clientSize={width:i||this.container.clientWidth,height:s||this.container.clientHeight,x:t,y:e}}init(){let{clientWidth:t,clientHeight:e}=this.container;this.camera=new vs(t,e),this.renderer.setSize(t,e),this.renderer.setCameraAndScene(this.scene,this.camera),this.renderer.autoRender(),this.control=new fs(this,this.camera,this.renderer.domElement),this.control.maxPolarAngle=this.config.control.maxPolar,this.container.appendChild(this.renderer.domElement),this.scene.add(this.lights),this.basicRatio=this.getRatio(),this.control.addEventListener("change",this.onControlChange),this.control.addEventListener("change-zoom",this.onControlChangeZoom),this.renderer.addEventListener("update",this.onRendererUpdate),this.cameraBound=new to(this)}getRatio(t,e){t===void 0&&(t=new F.Vector3(0,0,0)),e===void 0&&(e=new F.Vector3(100,0,0));let{clientWidth:i,clientHeight:s}=this.container,o=A(t,this.camera,i,s),n=A(e,this.camera,i,s);return Math.ceil(Math.sqrt((n.x-o.x)**2+(n.y-o.y)**2))}changeAmbientLightColor(t){this.lights.children.forEach(e=>{e instanceof F.AmbientLight&&(e.color=new F.Color(t))})}switchFloor(t,e){e===void 0&&(e=!0),console.log("switchFloor",e),this.currentFloor&&(this.scene.remove(this.currentFloor),e?this.currentFloor.dispose():this.currentFloor.onRemoveFromScene()),this.currentFloor=t,this.setRange(t.userData.range||[]),this.scene.add(t),t.onAddToScene("scene"),this.cameraBound.updateBox()}getGraphicsByDeviceXy(t,e){var i,s;let o=new F.Vector2;o.x=t/this.clientSize.width*2-1,o.y=e/this.clientSize.height*-2+1;let n=new F.Raycaster;n.setFromCamera(o,this.camera),n.ray.origin.sub(n.ray.direction.clone().multiplyScalar(100));let r=(i=this.currentFloor)==null?void 0:i.graphicLayer.getGraphicByRaycaster(n),h=(s=this.currentFloor)==null?void 0:s.parkingSpaceLayer.getParkingSpaceByRaycaster(n);return r!=null&&r.graphics.length&&(h!=null&&h.graphics.length)?r.distance<h.distance?r:h:r!=null&&r.graphics.length?r:h!=null&&h.graphics.length?h:{graphics:[],position:null}}getPoisByDeviceXy(t,e){var i,s;let o=(i=this.currentFloor)==null?void 0:i.poiLayer.getPoiByDeviceXy(t,e),n=(s=this.currentFloor)==null?void 0:s.poiLayer2.getPoiByDeviceXy(t,e);return(o||[]).concat(n||[])}registryEvent(){window.addEventListener("resize",this.onWindowResize),this.container.addEventListener("click",this.onClick),this.container.addEventListener("pointerover",this.onPointerover),this.container.addEventListener("pointermove",this.onPointermove),this.container.addEventListener("pointerleave",this.onPointerleave),this.container.addEventListener("pointercancel",this.onPointerleave),this.container.addEventListener("pointerout",this.onPointerleave),this.selection.addEventListener("select",this.onSelectionSelect),this.hoverHelper.addEventListener("hover-change",this.onHoverChange)}unRegistryEvent(){window.removeEventListener("resize",this.onWindowResize),this.container.removeEventListener("click",this.onClick),this.container.removeEventListener("pointerover",this.onPointerover),this.container.removeEventListener("pointermove",this.onPointermove),this.container.removeEventListener("pointerleave",this.onPointerleave),this.container.removeEventListener("pointercancel",this.onPointerleave),this.container.removeEventListener("pointerout",this.onPointerleave),this.selection.removeEventListener("select",this.onSelectionSelect),this.hoverHelper.removeEventListener("hover-change",this.onHoverChange),this.control.removeEventListener("change",this.onControlChange),this.control.removeEventListener("change-zoom",this.onControlChangeZoom),this.renderer.removeEventListener("update",this.onRendererUpdate)}setPolarAngle(t,e){return e===void 0&&(e=500),this.control.setPolarAngleByDuration(t,!0,e)}setAzimuthalAngle(t,e){return e===void 0&&(e=500),this.control.setAzimuthalAngleDuration(t,!0,e)}getCameraLookAt(){return this.control.getCameraLookAt()}setZoom(t,e,i){return i===void 0&&(i=500),this.control.setZoomByDuration(t,e,!0,i)}getFitCameraToObjectZoom(t,e,i){return e===void 0&&(e=[20,20,20,20]),i===void 0&&(i=!0),this.getFitCameraToBoxZoom(new F.Box3().setFromObject(t),e,i)}getFitCameraToBoxZoom(t,e,i){e===void 0&&(e=[20,20,20,20]),i===void 0&&(i=!0);let[s,o,n,r]=e,{clientSize:{width:h,height:c}}=this,l=this.control.getPolarAngle();i&&this.setPolarAngle(0,0),this.camera.updateMatrixWorld(),this.camera.updateProjectionMatrix();let{max:p,min:d}=t,u=new F.Vector3(d.x,p.y,p.z),g=new F.Vector3(p.x,p.y,p.z),x=new F.Vector3(p.x,d.y,d.z),m=new F.Vector3(d.x,d.y,d.z),v=A(u,this.camera,h,c),P=A(g,this.camera,h,c),_=A(m,this.camera,h,c),L=A(x,this.camera,h,c),R=new F.Box2().setFromPoints([new F.Vector2(v.x,v.y),new F.Vector2(P.x,P.y),new F.Vector2(_.x,_.y),new F.Vector2(L.x,L.y)]).getSize(new F.Vector2),b=(h-o-r)/R.x,U=(c-s-n)/R.y,B=Math.min(b,U),z=new F.Vector3((p.x+d.x)/2,(p.y+d.y)/2,(p.z+d.z)/2),at=B*this.camera.zoom,ft=this.camera.clone();ft.zoom=at,ft.updateMatrix();let K=(o-r)/2,ht=(s-n)/2;if(K){let N=new F.Vector3;N.setFromMatrixColumn(ft.matrix,0),N.normalize(),N.multiplyScalar(K/at),z.add(N)}if(ht){let N=new F.Vector3;N.setFromMatrixColumn(ft.matrix,1),N.normalize(),N.multiplyScalar(ht/at),z.add(N)}return i&&this.setPolarAngle(l,0),{zoom:B*this.camera.zoom,center:z}}fitCameraToObject(t,e,i,s){e===void 0&&(e=[20,20,20,20]),i===void 0&&(i=500),s===void 0&&(s=!0);let{zoom:o,center:n}=this.getFitCameraToObjectZoom(t,e,s);return this.setZoom(o,n,i)}fitCameraToBox(t,e,i,s){e===void 0&&(e=[20,20,20,20]),i===void 0&&(i=500),s===void 0&&(s=!0);let{zoom:o,center:n}=this.getFitCameraToBoxZoom(t,e,s);return this.setZoom(o,n,i)}getFitCameraToGroundZoom(t,e,i){if(t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),i===void 0&&(i=!0),this.currentFloor&&this.currentFloor.hasElement)return this.getFitCameraToObjectZoom(this.currentFloor.groundUpper,t,i).zoom}fitCameraToGround(t,e,i){return t===void 0&&(t=[20,20,20,20]),e===void 0&&(e=500),i===void 0&&(i=!0),this.currentFloor&&this.currentFloor.hasElement?this.fitCameraToObject(this.currentFloor.groundLayer,t,e,i):Promise.resolve(!1)}setCameraPosition(t,e){return f(this,null,function*(){return this.control.setCameraPositionByTarget(t,e)})}pauseRender(){this.renderer.pauseRender()}continueRender(){this.renderer.continueRender()}forceUpdate(){this.collisionSystem.needsUpdate=!0}dispose(){var t;this.collisionSystem.dispose(),(t=this.currentFloor)==null||t.dispose(),this.control.dispose(),this.cameraBound.dispose(),this.selection.dispose(),this.hoverHelper.dispose(),this.unRegistryEvent(),this.renderer.dispose(),this.lights.children.forEach(e=>e.dispose()),this.scene.dispose(),this.container=null,this.renderer=null}constructor(t,e){super(),this.container=t,this.lights=Oo(),this.range=(0,fn.polygon)([]),this.clientSize={width:0,height:0,x:0,y:0},this.renderRf=0,this.basicZoom=1,this.debugCollisionBox=!1,this.onControlChange=()=>{this.dispatchEvent({type:"change-ratio",px:(this.basicRatio||0)*this.camera.zoom}),this.dispatchEvent({type:"control-change"})},this.onControlChangeZoom=i=>{let{zoom:s}=i;this.dispatchEvent({type:"control-zoom-change",zoom:s})},this.onRendererUpdate=()=>{this.dispatchEvent({type:"update"})},this.onWindowResize=()=>{let{container:i,camera:s,renderer:o}=this,{clientWidth:n,clientHeight:r}=i;n=Math.max(1,n),r=Math.max(1,r),s.left=-n/2,s.right=n/2,s.top=r/2,s.bottom=-r/2,s.updateProjectionMatrix(),o.setSize(n,r),this.resizeClientSize(),this.dispatchEvent({type:"resize",width:n,height:r})},this.onClick=i=>{let{graphics:s,position:o}=this.getGraphicsByDeviceXy(i.offsetX,i.offsetY);s.length&&this.dispatchEvent({type:"graphic-click",graphics:s,position:o});let n=this.getPoisByDeviceXy(i.offsetX,i.offsetY);n.length&&this.dispatchEvent({type:"poi-click",pois:n});let r=null,h=new F.Vector2;h.x=i.offsetX/this.clientSize.width*2-1,h.y=i.offsetY/this.clientSize.height*-2+1;let c=new F.Raycaster;c.setFromCamera(h,this.camera);let l=new F.Plane(new F.Vector3(0,0,1),0),p=new F.Vector3;if(c.ray.intersectPlane(l,p)?r=p:(c.ray.direction.negate(),c.ray.intersectPlane(l,p)&&(r=p)),r){let d=this.bmap.coordinateTransform.worldToMercator(r);this.dispatchEvent({type:"click",position:r,mercator:d})}},this.onPointerover=i=>{let{graphics:s,position:o}=this.getGraphicsByDeviceXy(i.offsetX,i.offsetY),n=this.getPoisByDeviceXy(i.offsetX,i.offsetY);this.dispatchEvent({type:"pointer-over",e:i,graphics:s,pois:n,position:o})},this.onPointermove=i=>{let{graphics:s,position:o}=this.getGraphicsByDeviceXy(i.offsetX,i.offsetY),n=this.getPoisByDeviceXy(i.offsetX,i.offsetY);this.dispatchEvent({type:"pointer-move",e:i,graphics:s,pois:n,position:o})},this.onPointerleave=i=>{this.dispatchEvent({type:"pointer-level"})},this.onSelectionSelect=i=>{let{graphics:s,isMultipleSelect:o}=i;this.dispatchEvent({type:"select-graphic",graphics:s,isMultipleSelect:o})},this.onHoverChange=i=>{let{graphics:s}=i;this.dispatchEvent({type:"hover",graphics:s})},this.bmap=e,this.container.style.position="relative",this.container.style.overflow="hidden",this.renderer=new gs(this),this.scene=new ys(this.renderer),this.collisionSystem=new so(this),this.init(),this.selection=new ds(this),this.hoverHelper=new us(this),this.resizeClientSize(),this.registryEvent()}};var Ra=require("lodash"),Fa={placeId:0,fps:30,apiDomain:"",apiInfo:{},apiPath:{floorGraphic:"/api/inception-map/floor/get",floorRange:"/api/inception-map/range/get",equipmentList:"/api/inception-map/equipment/get",roadNetwork:"/api/inception-map/road_network/get",loadPlaceInfo:"https://screen.aibee.cn/ai-map/map/get-floor-map"},enableBoxSelect:!0,resizeObserver:{enable:!1,debounceTime:5},initTransToMark:!1,heatMap:{radius:50,minOpacity:.1,gradient:{0:"#8F9FCD",.5:"#6284FF",1:"#F95D5D"}},useFloorCache:!0,control:{maxPolar:1.2,defaultPolar:1.1,defaultAzimuthal:0,maxZoomScale:30},defaultPadding:[20,20,20,20],svg:{circle:{radius:"2",fill:"#1CADFF"},line:{stroke:"#1CADFF"}},selectBox:{stroke:"#1CADFF",fill:"rgba(28, 173, 255, 0.3)"},hover:{time:100},ground:{color:"#F6F6F6",opacity:1,height:.001,stroke:!1,strokeColor:"#E6E6E6",strokeOpacity:1},markGraphic:{color:"#EEF0F3",opacity:1,height:.001,stroke:!1,strokeColor:"#000",strokeOpacity:1},graphic:{fillOpacity:1},cameraBound:{padding:[150,150,150,150]},poi:{boxScale:1},loaderPlaceConfig:{textFontSize:14},poiTextBackground:{enable:!1,color:"#FFFFFF",opacity:1},renderAnimation:"setTimeout"};function gn(a){return typeof a.resizeObserver=="boolean"&&(a.resizeObserver={enable:a.resizeObserver}),(0,Ra.merge)({},Fa,a)}var za=require("lodash");var Nw=require("core-js/modules/es.regexp.exec.js"),Zw=require("core-js/modules/web.dom-collections.iterator.js");var ro=require("three");var Fw=require("core-js/modules/es.array.push.js"),Gw=require("core-js/modules/web.dom-collections.iterator.js");var Aw=require("core-js/modules/es.array.sort.js");var yi=function(a){return a.LAYERED_RENDER_VERSION="layeredRender",a.MERGED_RENDER_VERSION="mergedRender",a}({});function oo(a,t){let e=a.poi_info.showName||a.store_name||a.poi_info.text;switch(t){case"zh-cn":return e;case"en":var i;return((i=a.store_info_ext)==null?void 0:i.poi_name)||e;case"zh-hk":var s;return((s=a.store_info_ext)==null?void 0:s.traditional_name)||e}}function no(a,t){let e=a.poi_info.showName||a.store_name||a.poi_info.text;switch(t){case"zh-cn":return e;case"en":var i;return((i=a.infra_info_ext)==null?void 0:i.poi_name)||e;case"zh-hk":var s;return((s=a.infra_info_ext)==null?void 0:s.traditional_name)||e}}var yn=["range","ground","store","facility","parkingSpace"];function Ga(a){return yn.indexOf(a.l_type)===-1?yn.length:yn.indexOf(a.l_type)}function Gc(a){a.layers.sort((t,e)=>Ga(t)-Ga(e))}function Ic(a){let t=a.layers.find(i=>i.l_type==="range"),e=[t.elements[0].center_x,t.elements[0].center_y];a.layers.map(i=>{if(i.l_type!=="range")return Bi(i.elements,e)})}function ws(a){Gc(a),Ic(a)}function vi(a,t){return t===void 0&&(t=6),a.floor_id+"_"+a.version_id+(t?"_"+t:"")}function Ia(a,t,e){switch(a.l_type){case"ground":return vn(a,t);case"graph":return Bc(a,t,e);case"wall":return zc(a,t);case"lane":return Wc(a,t);case"texture2d":case"texture3d":return Uc(a,t);case"glb":return Hc(a,t);case"store":return Nc(a,t,e);case"facility":return jc(a,t,e);case"parkingSpace":return Kc(a,t,e);case"text":return Yc(a,t)}}function Ba(a,t,e,i,s){switch(a.l_type){case"store":return Zc(a,t,e,i,s);case"facility":return Vc(a,t,e,i,s);case"parkingSpace":return Xc(a,t,i,s)}}function Bc(a,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(a.elements,a.mergedElements):a.elements.map(i=>{let s=t.addGraphic(w({},i,{dashed:!1}));t.userData.graphics.push(s),t.userData.graphicMap.set(i.id,s)})}function vn(a,t){let e=a.elements.map(i=>new st(t.context,w({},i,{dashed:!1})));t.addGrounds(e)}function zc(a,t){if(a.mergedElements)a.mergedElements.map(e=>{if(e.instancedGeometry){let i=new ps(t.context,e.instancedGeometry);t.wallLayer.add(i)}if(e.mergedGeometry){let i=new cs(t.context,e);t.wallLayer.add(i)}});else{let e=a.elements.reduce((i,s)=>{let{fillColor:o,fillOpacity:n,strokeColor:r,strokeOpacity:h,height:c}=s,l=o.toLowerCase()+"-"+n+"-"+r.toLowerCase()+"-"+h+"-"+c;return h===0&&(l=o.toLowerCase()+"-"+n+"-"+c),i[l]?i[l].push(s):i[l]=[s],i},{});Object.values(e).forEach(i=>{let s=new rs(t.context,i);t.wallLayer.add(s)})}}function Wc(a,t){if(a.mergedElements){let e=new ls(t.context,a.mergedElements);t.laneLayer.add(e)}else{let e=new as(t.context,a.elements);t.laneLayer.add(e)}}function Uc(a,t){if(a.mergedMatrixes)a.mergedMatrixes.map(e=>{let i=new Ge(t.context,e);t.textureLayer.add(i)});else if(a.elements.length){let e=new Fe(t.context,a.elements);t.textureLayer.add(e)}}function Hc(a,t){t.glbModelLayer.addModels(a.elements.map(e=>w({},e,{url:e.secondUrl,rotate:e.secondRotate,width:e.secondWidth,center_x:e.center_coord_x,center_y:e.center_coord_y,deltaHeight:0})))}function Nc(a,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(a.elements,a.mergedElements):a.elements.map(i=>{let s=t.addGraphic(w({},i,{dashed:!1}));t.userData.graphics.push(s),t.userData.graphicMap.set(i.id,s)})}function Zc(a,t,e,i,s){a.elements.filter(o=>s.filterPoi(o)).map(o=>{try{let n=oo(o,e),r=new rt(t.context,{id:o.id,icon:o.poi_info.showImageUrl||o.poi_info.icon,text:n,position:{x:o.center_coord_x,y:o.center_coord_y,z:o.airHeight+o.height},icon_size:[24,24],level:o.poi_info.level||0,hide_text:!i.showStoreName,maxWeight:o.poi_info.maxWeight||25,minWeight:o.poi_info.minWeight||1,text_font_size:i.textFontSize});t.poiLayer2.pushPoi(r),r&&(r.userData.type="store",r.userData.data=o,r.userData.floor=t.name)}catch(n){console.log("\u521B\u5EFA\u5E97\u94FApoi\u5931\u8D25",n,o)}})}function jc(a,t,e){e.mergeGraphic?t.mergeGraphicLayer.addGraphics(a.elements,a.mergedElements):a.elements.map(i=>{let s=t.addGraphic(w({},i,{dashed:!1}));t.userData.graphics.push(s),t.userData.graphicMap.set(i.id,s)})}function Vc(a,t,e,i,s){a.elements.filter(o=>o.poi_info).filter(o=>s.filterPoi(o)).map(o=>{try{let n=no(o,e),r=new rt(t.context,{id:o.id,icon:o.poi_info.showImageUrl||o.poi_info.icon,text:n,position:{x:o.center_coord_x,y:o.center_coord_y,z:o.airHeight+o.height},icon_size:[24,24],level:o.poi_info.level||0,hide_text:!i.showFacilityName,maxWeight:o.poi_info.maxWeight||25,minWeight:o.poi_info.minWeight||1,text_font_size:i.textFontSize});t.poiLayer2.pushPoi(r),r.userData.type="facility",r.userData.data=o,r.userData.floor=t.name}catch(n){console.log("\u6DFB\u52A0facility\u5931\u8D25",n,o)}})}function Kc(a,t,e){t.parkingSpaceLayer.load(a,e.mergeParkingSpace),t.userData.parkingSpaces=t.parkingSpaceLayer.graphicMap.values(),t.userData.parkingSpacesGraphicMap=t.parkingSpaceLayer.graphicMap}function Xc(a,t,e,i){return f(this,null,function*(){a.elements.filter(o=>o.texts[0]).filter(o=>i.filterPoi(o)).forEach(o=>{try{let n=o.displayName||o.texts[0],r=new rt(t.context,{id:o.id,text:n,position:{x:o.center_coord_x,y:o.center_coord_y,z:o.airHeight+o.height},text_font_size:e.textFontSize});r&&(r.userData.type="parkingSpace",r.userData.data=o,r.userData.floor=t.name),t.poiLayer2.pushPoi(r)}catch(n){console.log("\u6DFB\u52A0\u8F66\u4F4Dpoi\u5931\u8D25",n,o)}})})}function Yc(a,t){let e=new hs(t.context,a.elements.map(i=>w({},i,{center_x:i.center_coord_x,center_y:i.center_coord_y})));t.textTextureLayer.add(e)}var qc={};function xn(){return new Worker(new URL("./worker/loader.worker-52WGVNK2.js",qc.url))}var $c={mergeParkingSpace:!0,mergeGraphic:!0,renderVersion:yi.MERGED_RENDER_VERSION,layers:["graph","wall","lane","texture2d","texture3d","glb","store","facility","parkingSpace","text"],filterPoi:()=>!0},ei=class extends pt{initDb(){return f(this,null,function*(){try{let{db:t}=yield Bs();this.db=t}catch(t){console.log("[\u6253\u5F00indexDb\u9519\u8BEF]",t)}})}load(t,e){return f(this,null,function*(){if(Array.isArray(t))this.floors=t,e&&(this.placeConfig=w({},this.placeConfig,e));else if(typeof t=="string"){let i=yield fetch(t).then(s=>s.json());if(i.code===200){let s=location.origin;this.floors=i.data.list.map(o=>{let n=/^http(s?):\/\//.test(o.entry_infra_url),r=/^http(s?):\/\//.test(o.map_url),h=/^http(s?):\/\//.test(o.route_url);return w({},o,{entry_infra_url:n?o.entry_infra_url:""+s+o.entry_infra_url,map_url:r?o.map_url:""+s+o.map_url,route_url:h?o.route_url:""+s+o.route_url})}),this.placeConfig=w({},this.placeConfig,JSON.parse(i.data.config||"{}"),e)}}else return this.load("https://screen.aibee.cn/ai-map/map/get-floor-map?place_id="+t,e);this.getOtherDataByFreeTime()})}setCacheData(t,e,i){return f(this,null,function*(){return this.initDbPromise.then(()=>zs(t,""+e,i))})}getCacheData(t,e){return f(this,null,function*(){return this.initDbPromise.then(()=>Zi(t,""+e))})}getFloorData(t){return f(this,null,function*(){let e=yield this.getFloorJsonData(t);return e?this.getDataByJson(e):null})}getFloorDataByFloorInfo(t){return f(this,null,function*(){let e=yield this.getFloorJsonDataByFloorInfo(t);return this.getDataByJson(e)})}setLocale(t){this.locale=t,this.bmap.context.currentFloor&&this.bmap.context.currentFloor.poiLayer2.pois.forEach(e=>{e.userData.type==="store"&&(e.options.text=oo(e.userData.data,t)),e.userData.type==="facility"&&(e.options.text=no(e.userData.data,t))})}getFloorJsonDataByFloorInfo(t){return f(this,null,function*(){if(this.getFloorDataPromise.has(t.floor))return this.getFloorDataPromise.get(t.floor);let e=new Promise(i=>f(this,null,function*(){let s=vi(t),o=yield fetch(t.map_url).then(n=>n.json());o.floor=t.floor,ws(o),this.setCacheData(Gt.MAP_DATA,s,o),this.setCacheData(Gt.MAP_VERSION,s,t.version_id),i(o)}));return this.getFloorDataPromise.set(t.floor,e),e})}getFloorJsonData(t){return f(this,null,function*(){let e=this.floors.find(i=>i.floor===t);return e?new Promise(i=>f(this,null,function*(){let s=vi(e,this.options.renderVersion===yi.LAYERED_RENDER_VERSION?1:void 0);try{let o=vi(e),n=yield this.getCacheData(Gt.MAP_DATA,o);if(n&&n.transformed){console.log("\u4ECE\u7F13\u5B58\u4E2D\u53D6\u5230\u4E86\u5408\u5E76\u540E\u7684\u6570\u636E"),i(n);return}if(this.options.renderVersion===yi.LAYERED_RENDER_VERSION){let r=yield this.getCacheData(Gt.MAP_DATA,s);if(r){console.log("\u4ECE\u7F13\u5B58\u4E2D\u53D6\u5230\u4E86\u6570\u636E"),i(r);return}}if(console.log("\u7F13\u5B58\u4E2D\u6CA1\u6709\u6570\u636E"),this.loadWorker){Z(this.loadWorker,"adjust_floor_priority",{floor:t});let r=h=>{if(h.data.type==="floor_success"&&h.data.data.floor===t){var c;(c=this.loadWorker)==null||c.removeEventListener("message",r),i(this.getFloorJsonData(t))}};this.loadWorker.addEventListener("message",r)}else i(this.getFloorJsonDataByFloorInfo(e))}catch(o){console.log("[get floor data error]",o),i(this.getFloorJsonDataByFloorInfo(e))}})):null})}getRoadNetworkData(){return f(this,null,function*(){return(yield Promise.all(this.floors.map(e=>f(this,null,function*(){let i=vi(e,0);try{let s=yield this.getCacheData(Gt.ROAD_NETWORK_DATA,i);if(s)return s;let o=yield fetch(e.route_url).then(n=>n.json());return this.setCacheData(Gt.ROAD_NETWORK_DATA,i,o),this.setCacheData(Gt.ROUTE_VERSION,i,e.version_id),o}catch(s){let o=yield fetch(e.route_url).then(n=>n.json());return this.setCacheData(Gt.ROAD_NETWORK_DATA,i,o),o}})))).filter(e=>e.points)})}getFacilitiesData(){return f(this,null,function*(){let t=this.floors.reduce((s,o)=>s.updated_at>o.updated_at?s:o,this.floors[0]);if(!t)return null;let e=vi(t,0),i=()=>f(this,null,function*(){let s=yield fetch(t.entry_infra_url).then(o=>o.json());return s&&(this.setCacheData(Gt.FACILITY_DATA,e,s),this.setCacheData(Gt.FACILITY_VERSION,e,t.version_id)),s});try{let s=yield this.getCacheData(Gt.FACILITY_DATA,e);return s||i()}catch(s){return console.log("[get facility error]",s),i()}})}getOtherDataByFreeTime(){return f(this,null,function*(){yield this.initDbPromise,this.loadWorker&&(yield Z(this.loadWorker,"load",{floors:this.floors,version:this.options.renderVersion})),this.closeWorker()})}getMulFloorsData(t){return f(this,null,function*(){return Promise.all(t.map(e=>this.getFloorData(e))).then(e=>e.filter(i=>i))})}getDataByUrl(t){return f(this,null,function*(){let e=yield fetch(t).then(i=>i.json());return this.getDataByJson(e)})}getDataByJson(t,e,i){return f(this,null,function*(){ws(t),e=this.getFloorBaseLayer(t,e);let s=w({},this.placeConfig,i);return yield this.getFloorContentLayer(t,e),yield this.getFloorPoi(t,e,s),this.changeFloorBox(t,e),e})}getDataByJsonStep(t,e,i){return f(this,null,function*(){ws(t),e=this.getFloorBaseLayer(t,e);let s=w({},this.placeConfig,i);return this.changeFloorBox(t,e),requestAnimationFrame(()=>f(this,null,function*(){yield this.getFloorContentLayer(t,e),this.changeFloorBox(t,e),requestAnimationFrame(()=>f(this,null,function*(){yield this.getFloorPoi(t,e,s),this.changeFloorBox(t,e)}))})),e})}changeFloorBox(t,e){e.updateBox();let i=e.box.getSize(new ro.Vector3),s=Math.max(i.x,i.y,i.z);e.userData.height=s/4+t.floorHeight}switchFloor(t,e){return f(this,null,function*(){return new Promise(i=>{let s={run:()=>this._switchFloor(t,e),meta:{type:"switchFloor"}},o=this.taskQueue.replaceByMetaType(s),n=r=>{let{task:h,res:c}=r;h.tid===o&&(this.taskQueue.removeEventListener("active-task-end",n),i(c))};this.taskQueue.addEventListener("active-task-end",n)})})}_switchFloor(t,e){return f(this,null,function*(){var i;let s=t;if(typeof t=="string"){let l=yield this.getFloorJsonData(t);if(l)s=l;else return null}else ws(t);let o=w({},this.placeConfig,e),n=new ce(this.bmap.context);n.userData.data=t;let r=this.floors.find(l=>l.floor===s.floor);var h;let c=(h=r==null?void 0:r.map_angle)!=null?h:0;return this.bmap.dispatchEvent({type:Et.SWITCH_FLOOR_BEFORE,data:{curFloor:n,graphics:[]}}),this.dispatchEvent({type:"switch-floor-before",data:{curFloor:n,graphics:[],floorData:s}}),this.bmap.context.scene.background=new ro.Color(o.backgroundColor),this.getFloorBaseLayer(s,n),this.changeFloorBox(s,n),this.bmap.buildingCenter=n.userData.center,this.bmap.currentBuildGround=(i=n.userData.data.layers.find(l=>l.l_type==="range"))==null?void 0:i.elements[0],this.bmap.context.switchFloor(n),this.bmap.config.control.defaultAzimuthal=c/180*Math.PI,this.bmap.initialFloorCamera(),this.bmap.context.cameraBound.updateBox(),this.dispatchEvent({type:"switch-floor-ground",data:{curFloor:n,graphics:[]}}),this.bmap.dispatchEvent({type:Et.SWITCH_FLOOR_GROUND,data:{curFloor:n}}),yield Ds(),yield this.getFloorContentLayer(s,n),this.changeFloorBox(s,n),this.bmap.context.cameraBound.updateBox(),this.dispatchEvent({type:"switch-floor-content",data:{curFloor:n,graphics:[]}}),yield zo(2),yield this.getFloorPoi(s,n,o),this.dispatchEvent({type:"switch-floor-after",data:{curFloor:n,graphics:n.graphicLayer.children}}),this.bmap.dispatchEvent({type:Et.SWITCH_FLOOR_AFTER,data:{curFloor:n,graphics:n.graphicLayer.children}}),n})}getFloorBaseLayer(t,e){e||(e=new ce(this.bmap.context));let i=[0,0];return t.layers.forEach(s=>{switch(s.l_type){case"range":let o=s.elements[0];i=[o.center_x,o.center_y],e.userData.range=o.geometry.cds[0],e.userData.rangeGraphic=o;break;case"ground":vn(s,e);break;default:break}}),e.userData.center=i,e.name=t.floor,e.userData.data=t,e}getFloorContentLayer(t,e){return f(this,null,function*(){e||(e=new ce(this.bmap.context)),e.userData.graphics=[],e.userData.graphicMap=new Map;let i=Date.now();for(let s=0;s<t.layers.length;s++){let o=t.layers[s];["range","ground"].includes(o.l_type)||this.options.layers.includes(o.l_type)&&(Ia(o,e,this.options),console.log("time",Date.now()-i,o.l_type),i=Date.now())}return e})}getFloorPoi(t,e,i){return f(this,null,function*(){i===void 0&&(i=this.placeConfig);let s=Date.now();yield Promise.all(t.layers.map(n=>{if(this.options.layers.includes(n.l_type))return Ba(n,e,this.locale,i,this.options)})),console.log("poi time",Date.now()-s);let o=Date.now();Ds().then(()=>{console.log("poi render time",Date.now()-o)})})}clear(){return f(this,null,function*(){zr(),this.db=null})}closeWorker(){this.loadWorker&&(this.loadWorker.terminate(),this.loadWorker=null)}dispose(){super.dispose(),this.clear(),this.closeWorker(),this.getFloorDataPromise.clear()}constructor(t,e={}){super(),this.bmap=t,this.floors=[],this.initDbPromise=Promise.resolve(),this.db=null,this.taskQueue=new $e,this.loadWorker=xn(),this.locale="zh-cn",this.placeConfig={backgroundColor:"#f1f7f6",showFacilityName:!0,showStoreName:!0,textFontSize:14},this.getFloorDataPromise=new Map,this.options=w({},$c,e),this.placeConfig=w({},this.placeConfig,t.config.loaderPlaceConfig),this.initDbPromise=this.initDb()}};var sP=require("core-js/modules/web.dom-collections.iterator.js");function wn(a,t){return f(this,null,function*(){let{brand:e,project:i}=a,{apiDomain:s,apiPath:{floorRange:o},apiInfo:n}=t,r=""+s+o+"?brand="+e+"&project="+i+"&phase="+i+"&building="+i;return yield fetch(r,n).then(c=>c.json()).then(c=>c.data).then(c=>{let l=(c||[])[0];return l&&(l.info=JSON.parse(l.info)),l})})}function Pn(a,t){return f(this,null,function*(){let{brand:e,project:i,floor:s,ts:o,resource_type_list:n}=a,{apiDomain:r,apiPath:{floorGraphic:h},apiInfo:c}=t,l=""+r+h+"?brand="+e+"&project="+i+"&phase="+i+"&building="+i+"&floor="+s+"&ts="+o+"&resource_type_list="+n;return yield fetch(l,c).then(d=>d.json()).then(d=>d.data).then(d=>((d||[]).map(u=>u.info=JSON.parse(u.info)),d||[]))})}function Jc(a,t){return f(this,null,function*(){let{project:e,floor:i}=a,{apiDomain:s,apiInfo:o}=t,n=s+"/api/inception-map/external_street/get?projectCode="+e+"&floorCode="+i;return yield fetch(n,o).then(h=>h.json()).then(h=>h.data).then(h=>JSON.parse(h[0].streetInfo||"{}")).then(h=>h.fileId?Qc(h.fileId,t):null)})}function Qc(a,t){return f(this,null,function*(){let{apiDomain:e,apiInfo:i}=t;return fetch(e+"/api/inception-map/file/getFileStream?fileId="+a,i).then(s=>s.arrayBuffer()).then(s=>{let n=new TextDecoder("utf-8").decode(s);return n?JSON.parse(n):null})})}var Mn=class{load(t){return f(this,null,function*(){let e=Oe(t);if(this.cacheData.has(e))return this.cacheData.get(e);let[,i]=yield Promise.all([this.loadBuildGround(t),Pn(t,this.bmap.config)]),s=Oe({floor:t.floor,ts:t.ts});Bi(i.map(n=>n.info),this.bmap.buildingCenter,this.floorDataLengthMap.get(s)||0),i.forEach(n=>n.info.transformToBuildingGround=!1),this.cacheData.set(e,i);let o=this.floorDataLengthMap.get(s)||0;return this.floorDataLengthMap.set(s,o+i.length),this.loadExternalStreet(t),i})}loadExternalStreet(t){return f(this,null,function*(){})}switchFloorByData(t,e){if(!t.length)return;let i=e.userData.legacyToGraphicMap||new Map,s=e.userData.graphicMap||new Map,{ground:o,markGraphic:n,graphic:r}=this.bmap.config;for(let h=0;h<t.length;h++){let c=t[h],l=w({},c,{info:w({},c.info)});if(c.info.group==="ground"){l.info.fillColor=o.color,l.info.fillOpacity=o.opacity,l.info.height=o.height,l.info.stroke=o.stroke,l.info.strokeColor=o.strokeColor,l.info.strokeOpacity=o.strokeOpacity,e.createGround(l.info);continue}else c.info.userData.mark?(l.info.height=n.height,l.info.fillColor=n.color,l.info.fillOpacity=n.opacity,l.info.stroke=n.stroke,l.info.strokeColor=n.strokeColor,l.info.strokeOpacity=n.strokeOpacity):(l.info.fillOpacity=r.fillOpacity,this.bmap.config.initTransToMark&&(l.info.height=n.height,l.info.fillColor=n.color,l.info.stroke=n.stroke,l.info.strokeColor=n.strokeColor,l.info.strokeOpacity=n.strokeOpacity));let p=e.addGraphic(l.info);p.userData.data=c,i.set(c.legacy_id,p),s.set(c.element_uuid,c)}e.userData.legacyToGraphicMap=i,e.userData.graphicMap=s,e.userData.rangeGraphic=this.bmap.currentBuildGround,e.userData.range=this.bmap.currentBuildGround.geometry.cds[0],e.userData.center=this.bmap.buildingCenter,e.updateBox(),e===this.bmap.context.currentFloor?(this.bmap.triggerHooks(Et.SWITCH_FLOOR_BEFORE,{curFloor:e,graphics:e.graphicLayer.children}),this.bmap.initialFloorCamera(),this.bmap.triggerHooks(Et.SWITCH_FLOOR_AFTER,{curFloor:e,graphics:e.graphicLayer.children})):this.bmap.switchFloorByFloor(e)}filterData(t,e){let i=e.userData.graphicMap||new Map;return t.filter(s=>!i.has(s.element_uuid))}switchFloorByStoreData(t,e){return f(this,null,function*(){let i=yield this.load(w({},t,{resource_type_list:"6"})),s=this.filterData(i,e);this.switchFloorByData(s,e)})}switchFloorByOtherData(t,e){return f(this,null,function*(){let i=yield this.load(w({},t,{resource_type_list:"1,2,3,4"})),s=this.filterData(i,e);this.switchFloorByData(s,e)})}loadBuildGround(t){return f(this,null,function*(){let{brand:e,project:i}=t,s=yield this.loadBuildingGround({brand:e,project:i});var o;return this.bmap.currentBuildGround=(o=s==null?void 0:s.info)!=null?o:null,this.bmap.changeBuildingCenter(s,{brand:e,project:i}),this.bmap.currentBuildGround})}loadBuildingGround(t){return f(this,null,function*(){let{brand:e,project:i}=t,s=Oe({brand:e,project:i});if(this.buildingGroundMap.has(s))return this.buildingGroundMap.get(s);let o=wn({brand:e,project:i},this.bmap.config).then(n=>(this.buildingGroundMap.set(s,n),n));return this.buildingGroundMap.set(s,o),o})}switchFloor(t){return f(this,null,function*(){let e=new ce(this.bmap.context);e.userData.graphicMap=new Map,e.name=t.floor;try{yield Promise.all([this.switchFloorByStoreData(t,e),this.switchFloorByOtherData(t,e)])}catch(i){console.log(i)}return e})}dispose(){this.cacheData.clear(),this.floorDataLengthMap.clear(),this.buildingGroundMap.clear()}constructor(t){this.bmap=t,this.cacheData=new Map,this.floorDataLengthMap=new Map,this.buildingGroundMap=new Map,this.externalStreetMap=new Map}};var tl=function(a){return a[a.D2=0]="D2",a[a.D3=1.1]="D3",a}({}),_n=class extends se.EventDispatcher{get buildingCenter(){return this.coordinateTransform.getBuildingCenter()}set buildingCenter(t){this.coordinateTransform.setBuildingCenter(t)}get basicZoom(){return this.context.basicZoom}set basicZoom(t){this.context.basicZoom=t}changeBuildingCenter(t,e){let{brand:i,project:s}=e,o=t?Di(t.info.geometry.cds[0]):[0,0];this.buildingCenter=o,this.coordinateTransform.setBuildingCenter(o),this.dispatchEvent({type:"center-change",center:o,project:s,brand:i})}use(t){t.bmap=this,this.plugins.push(t)}unUse(t){this.plugins=this.plugins.filter(e=>e!==t)}triggerHooks(t,e){this.dispatchEvent({type:t,data:e})}switchFloor(t){return f(this,null,function*(){return this.loader||(this.loader=new ei(this),this.loader.placeConfig=w({},this.loader.placeConfig,this.config.loaderPlaceConfig),yield this.loader.load(this.config.apiPath.loadPlaceInfo+"?place_id="+this.config.placeId+"&env=prod")),this.loader.switchFloor(t)})}switchFloorByFloor(t,e,i){e===void 0&&(e=!0),i===void 0&&(i=t.graphicLayer.children),this.triggerHooks(Et.SWITCH_FLOOR_BEFORE,{curFloor:t,graphics:i}),this.buildingCenter=t.userData.center,this.coordinateTransform.setBuildingCenter(t.userData.center),this.currentBuildGround=t.userData.rangeGraphic,this.context.switchFloor(t,e),this.initialFloorCamera(),this.triggerHooks(Et.SWITCH_FLOOR_AFTER,{curFloor:t,graphics:i})}initialFloorCamera(){this.context.cameraBound.setEnable(!1),this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,0),this.context.setPolarAngle(this.config.control.defaultPolar,0),this.context.fitCameraToGround(this.config.defaultPadding,0);let t=this.context.camera.zoom;this.context.control.minZoom=t,this.context.control.maxZoom=t*this.config.control.maxZoomScale,this.type==="3d"&&this.context.fitCameraToGround(this.config.defaultPadding,0,!1),this.basicZoom=this.context.camera.zoom,this.context.control.addEventListener("change",this.onControlChange),this.onControlChange(),this.context.cameraBound.setEnable(!0),this.context.cameraBound.changePrevCamera()}addModel(t,e){if(t.options.geometry.type==="polygon"){var i;let s=(i=this.context.currentFloor)==null?void 0:i.addModel(w({},e,{position:t.getPosition().setZ(.1),id:t.options.id}));if(s){let{facilityAngle:o=0,facilityXScale:n=1,facilityYScale:r=1}=t.options.userData;s.rotateZ((180-o)/180*Math.PI),s.scale.set(n,r,1)}}}getLegacyToGraphicMap(){var t;return((t=this.context.currentFloor)==null?void 0:t.userData.legacyToGraphicMap)||new Map}getFloorAllGraphics(){var t;return((t=this.context.currentFloor)==null?void 0:t.getGraphics())||[]}createGraphicPoi(t,e){if(this.context.currentFloor){e.id===void 0&&(e.id=t.options.id);let i=t.options.centerCoords,s=t.getCenter(),o=(i==null?void 0:i[0])||s.x,n=(i==null?void 0:i[1])||s.y;return console.log(o,n,i,s),this.context.currentFloor.addPoi(w({},e,{position:{x:o,y:n,z:s.z+t.options.height/2}}))}return null}createPoi2ByPosition(t,e){if(this.context.currentFloor){let i=this.mercatorToWorld([t.x,t.y]),s=new rt(this.context,w({},e,{position:{x:i.x,y:i.y,z:t.z}}));return this.context.currentFloor.poiLayer2.pushPoi(s),s}return null}translateElementToCenter(t,e,i,s){e===void 0&&(e=500),i===void 0&&(i=0),s===void 0&&(s=0);let o=t.getPosition().clone(),{context:{camera:n}}=this;if(n.updateMatrix(),s){let r=new se.Vector3;r.setFromMatrixColumn(n.matrix,1),r.normalize(),r.multiplyScalar(s/n.zoom),o.add(r)}if(i){let r=new se.Vector3;r.setFromMatrixColumn(n.matrix,0),r.normalize(),r.multiplyScalar(i/n.zoom),o.add(r)}return this.context.setCameraPosition(o,e)}translateElementToCenterX(t,e){return f(this,null,function*(){return e===void 0&&(e=500),jt(new Promise(i=>{let s=this.context.control.target.clone(),o=t.getPosition();this.timer.requestAnimationFrame(()=>{let{clientSize:{width:n,height:r},camera:h}=this.context,l=A(o,h,n,r).x-n/2,p=new se.Vector3;p.setFromMatrixColumn(this.context.camera.matrix,0),p.normalize(),p.multiplyScalar(l/this.context.camera.zoom),s.add(p),this.context.setCameraPosition(s,e).then(i)})}),e+500)})}getElementDeviceCoordinate(t){let e=t.position.clone(),{clientWidth:i,clientHeight:s}=this.container;return A(e,this.context.camera,i,s)}changeMapType(t,e){return e===void 0&&(e=500),this.type=t,t==="2d"?this.context.setPolarAngle(0,e):this.context.setPolarAngle(1.1,e)}resetView(t){return f(this,null,function*(){t===void 0&&(t=300);let e=t/3;yield this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal,e),yield this.context.setPolarAngle(this.config.control.defaultPolar,e),yield this.context.fitCameraToGround(this.config.defaultPadding,e,!1)})}reduceMap(t,e){t===void 0&&(t=.5),e===void 0&&(e=500);let i=this.context.camera.zoom;return this.context.setZoom(i-t,this.context.control.target,e)}enlargeMap(t,e){t===void 0&&(t=.5),e===void 0&&(e=500);let i=this.context.camera.zoom;return this.context.setZoom(i+t,this.context.control.target,e)}registryEvent(){if(window.addEventListener("keydown",this.onKeydown),window.addEventListener("keyup",this.onKeyUp),this.config.resizeObserver.enable){let t=new ResizeObserver(this.debounceResize);t.observe(this.container),this.observe=t}}unRegistryEvent(){var t;this.context.control.removeEventListener("change",this.onControlChange),window.removeEventListener("keydown",this.onKeydown),window.removeEventListener("keyup",this.onKeyUp),(t=this.observe)==null||t.disconnect(),this.observe=null}configurePolarShortcutKeys(t){this.polarKeys=t}configureAzimuthalShortcutKeys(t){this.azimuthalKeys=t}rotateMap(t,e){t===void 0&&(t=.1),e===void 0&&(e=500);let i=this.context.control.getAzimuthalAngle();return this.context.setAzimuthalAngle(i+t,e)}showCollisionBox(){this.context.debugCollisionBox=!0,this.context.forceUpdate()}hideCollisionBox(){this.context.debugCollisionBox=!1,this.context.forceUpdate()}measureDistance(){return f(this,null,function*(){return this.cancelDistance(),new Promise((t,e)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgLine=new os(this.context);let i=this.svgLine.dispose.bind(this.svgLine);this.svgLine.dispose=function(){i(),e("cancel")},this.svgLine.addEventListener("distance",s=>{let{distance:o}=s;t(o)})})})}cancelDistance(){this.svgLine&&(this.svgLine.dispose(),this.svgLine=void 0,this.context.control.enableRotate=!0)}measureArea(){return this.cancelArea(),new Promise((t,e)=>{this.changeMapType("2d",0),this.context.control.enableRotate=!1,this.svgPolygon=new ns(this.context);let i=this.svgPolygon.dispose.bind(this.svgPolygon);this.svgPolygon.dispose=function(){i(),e("cancel")},this.svgPolygon.addEventListener("area",s=>{let{area:o}=s;t(o)})})}cancelArea(){this.svgPolygon&&(this.svgPolygon.dispose(),this.svgPolygon=void 0,this.context.control.enableRotate=!0)}fitCameraByPois(t,e,i){return f(this,null,function*(){if(e===void 0&&(e=[20,20,20,20]),i===void 0&&(i=500),!t.length)return;let s=new se.Box3;return t.forEach(o=>{let{position:n}=o;s.expandByPoint(n)}),this.context.fitCameraToBox(s,e,i,!1)})}fitCameraByPoiNodeIds(t,e,i){return f(this,null,function*(){e===void 0&&(e=[20,20,20,20]),i===void 0&&(i=500);let s=t.map(o=>this.getPoiById(o)).filter(o=>!!o);if(s.length)return this.fitCameraByPois(s,e,i)})}getGraphicByNodeId(t){var e,i;return((e=this.context.currentFloor)==null?void 0:e.graphicLayer.getGraphicByNodeId(t))||((i=this.context.currentFloor)==null?void 0:i.parkingSpaceLayer.graphicMap.get(t))||null}deleteGraphic(t){var e;(e=this.context.currentFloor)==null||e.graphicLayer.removeGraphic(t)}createGraphicByOptions(t){var e;if(!t.transformToBuildingGround&&this.currentBuildGround){let i=Di(this.currentBuildGround.geometry.cds[0]);if(t.geometry.type==="polygon")t.geometry.coords=JSON.parse(JSON.stringify(t.geometry.cds)),t.geometry.coords.map(s=>{Array.isArray(s)&&s.forEach(o=>{o[0]-=i[0],o[1]-=i[1]})});else{let[s,o]=t.geometry.cds;t.geometry.coords=[s-i[0],o-i[1]]}}return(e=this.context.currentFloor)==null?void 0:e.graphicLayer.createGraphic(t)}mercatorToWorld(t){return this.coordinateTransform.mercatorToWorld(t)}worldToMercator(t){return this.coordinateTransform.worldToMercator(t)}removePoiById(t){var e,i;(e=this.context.currentFloor)==null||e.poiLayer.removePoiById(t),(i=this.context.currentFloor)==null||i.poiLayer2.removePoiById(t)}getPoiById(t){var e;let i=this.context.collisionSystem.objects;return((e=this.context.currentFloor)==null?void 0:e.poiLayer.getPoiById(t))||i.find(s=>s.options.id===t)}getPois(){var t;return[...(((t=this.context.currentFloor)==null?void 0:t.poiLayer.pois)||[]).filter(e=>!e.options.built_in),...this.context.collisionSystem.objects||[]]}clearPoi(){this.context.currentFloor&&this.context.currentFloor.poiLayer.clear()}removeSelectGraphic(t){this.context.selection.remove(t)}dispose(){this.loader&&(this.loader.dispose(),this.loader=null),this.unRegistryEvent(),this.timer.dispose(),this.plugins.forEach(t=>t.dispose()),this.plugins=[],this.context.dispose(),this.context=null,this.container=null,yt.dispose(),vt.dispose(),Wt.dispose(),At.dispose(),T.dispose(),he.dispose(),this.debounceResize=null,se.Sprite.Dispose==null||se.Sprite.Dispose.call(se.Sprite)}constructor(t,e={}){super(),this.container=t,this.polarKeys=[],this.azimuthalKeys=[],this.prevCameraZoom=1,this.type="2d",this.currentBuildGround=null,this.observe=null,this.coordinateTransform=new Hi([0,0]),this.timer=new J,this.plugins=[],this.loader=null,this.onControlChange=()=>{let{camera:{zoom:i}}=this.context;i!==this.prevCameraZoom&&(this.dispatchEvent({type:"zoom-change",basicZoom:this.basicZoom,cameraZoom:this.context.camera.zoom}),this.prevCameraZoom=i)},this.onKeydown=i=>{this.polarKeys.includes(i.code)&&(this.context.control.maxPolarAngle=this.config.control.maxPolar,this.context.control.minPolarAngle=0),this.azimuthalKeys.includes(i.code)&&(this.context.control.maxAzimuthAngle=1/0,this.context.control.minAzimuthAngle=1/0)},this.onKeyUp=i=>{if(this.polarKeys.includes(i.code)){let s=this.context.control.getPolarAngle();this.context.control.maxPolarAngle=s,this.context.control.minPolarAngle=s}if(this.azimuthalKeys.includes(i.code)){let s=this.context.control.getAzimuthalAngle();this.context.control.maxAzimuthAngle=s,this.context.control.minAzimuthAngle=s}},this.resize=()=>{this.context.cameraBound.setEnable(!1),this.context.onWindowResize();let i=this.context.control.getAzimuthalAngle(),s=this.context.camera.zoom;this.context.control.minZoom=0,this.context.control.maxZoom=1/0,this.context.camera.zoom=1,this.context.setAzimuthalAngle(0,0);let o=this.context.getFitCameraToGroundZoom(this.config.defaultPadding,0)||1;this.context.camera.zoom=s,this.context.control.minZoom=o,this.context.control.maxZoom=o*this.config.control.maxZoomScale,this.basicZoom=s,this.context.control.addEventListener("change",this.onControlChange),this.context.setAzimuthalAngle(i,0),this.context.cameraBound.setEnable(!0)},this.config=gn(e),this.context=new xs(t,this),this.debounceResize=(0,za.debounce)(this.resize,this.config.resizeObserver.debounceTime),this.registryEvent()}};var el=function(a){return a.HALF="half",a.POWER="power",a.MECHANICAL="mechanical",a.NORMAL="normal",a.VIP="vip",a.GSADV="gsadv",a}({});var SP=require("core-js/modules/web.dom-collections.iterator.js");var q=class extends pt{dispose(){let t=this.bmap.plugins.findIndex(e=>e===this);t!==-1&&this.bmap.plugins.splice(t,1),this.bmap=null,super.dispose()}constructor(t){super(),this.bmap=t,this.bmap.use(this)}};var bn=class extends q{fetchEquipment(){return f(this,null,function*(){let{apiDomain:t,apiPath:{equipmentList:e},apiInfo:i}=this.bmap.config,s=""+t+e;yield fetch(s,i).then(o=>o.json()).then(o=>o.data).then(o=>{this.equipmentList=o,this.equipmentMap=new Map(o.map(n=>[n.equipment_id,n]))}),this.dispatchEvent({type:"change-equipment-list",data:this.equipmentList}),this.bmap.context.currentFloor&&this.changeGraphicToEquipment(this.bmap.context.currentFloor.graphicLayer.children)})}getGraphicEquipment(t){return t.userData.data.info.userData.equipment}changeGraphicToEquipment(t){t.filter(e=>{let i=this.getGraphicEquipment(e);return i&&this.equipmentMap.has(i)}).forEach(e=>{let i=this.equipmentMap.get(this.getGraphicEquipment(e)),s=this.bmap.createGraphicPoi(e,{icon:i==null?void 0:i.equipment_icon,built_in:!0,icon_size:[14,14]});s&&(s.userData.data=i,s.userData.type="equipment")})}dispose(){var t;this.bmap.removeEventListener(Et.SWITCH_FLOOR_AFTER,this.onSwitchFloor),Array.from(((t=this.bmap.context.currentFloor)==null?void 0:t.poiLayer.pois)||[]).forEach(e=>{if(e.userData.type==="equipment"){var i;(i=this.bmap.context.currentFloor)==null||i.poiLayer.removePoi(e)}}),super.dispose()}constructor(t){super(t),this.equipmentList=[],this.equipmentMap=new Map,this.onSwitchFloor=e=>{let{data:{graphics:i}}=e;this.equipmentList.length&&this.changeGraphicToEquipment(i)},this.fetchEquipment(),this.bmap.addEventListener(Et.SWITCH_FLOOR_AFTER,this.onSwitchFloor)}};var TM=require("core-js/modules/es.string.replace.js"),kM=require("core-js/modules/es.regexp.exec.js"),AM=require("core-js/modules/web.dom-collections.iterator.js"),DM=require("core-js/modules/es.promise.finally.js");var YP=require("core-js/modules/web.dom-collections.iterator.js"),qP=require("core-js/modules/es.array.push.js"),Mt=require("three");var AP=require("core-js/modules/es.typed-array.float32-array.js"),DP=require("core-js/modules/es.typed-array.at.js"),OP=require("core-js/modules/es.typed-array.fill.js"),RP=require("core-js/modules/es.typed-array.find-last.js"),FP=require("core-js/modules/es.typed-array.find-last-index.js"),GP=require("core-js/modules/es.typed-array.set.js"),IP=require("core-js/modules/es.typed-array.sort.js"),BP=require("core-js/modules/es.typed-array.to-reversed.js"),zP=require("core-js/modules/es.typed-array.to-sorted.js"),WP=require("core-js/modules/es.typed-array.with.js"),UP=require("core-js/modules/es.array-buffer.constructor.js"),HP=require("core-js/modules/es.array-buffer.slice.js"),NP=require("core-js/modules/es.array-buffer.detached.js"),ZP=require("core-js/modules/es.array-buffer.transfer.js"),jP=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),VP=require("core-js/modules/es.array.push.js"),KP=require("core-js/modules/es.typed-array.uint16-array.js"),S=require("three"),Yt=class extends S.BufferGeometry{constructor(){super(),this.isMeshLine=!0,this.type="MeshLine",this.positions=[],this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[],this.counters=[],this._points=[],this._geom=null,this.widthCallback=null,this.matrixWorld=new S.Matrix4,Object.defineProperties(this,{geometry:{enumerable:!0,get:function(){return this}},geom:{enumerable:!0,get:function(){return this._geom},set:function(t){this.setGeometry(t,this.widthCallback)}},points:{enumerable:!0,get:function(){return this._points},set:function(t){this.setPoints(t,this.widthCallback)}}})}};Yt.prototype.setMatrixWorld=function(a){this.matrixWorld=a};Yt.prototype.setGeometry=function(a,t){this._geometry=a,this.setPoints(a.getAttribute("position").array,t)};Yt.prototype.setPoints=function(a,t){if(!(a instanceof Float32Array)&&!(a instanceof Array)){console.error("ERROR: The BufferArray of points is not instancied correctly.");return}if(this._points=a,this.widthCallback=t,this.positions=[],this.counters=[],a.length&&a[0]instanceof S.Vector3)for(var e=0;e<a.length;e++){var i=a[e],s=e/a.length;this.positions.push(i.x,i.y,i.z),this.positions.push(i.x,i.y,i.z),this.counters.push(s),this.counters.push(s)}else for(var e=0;e<a.length;e+=3){var s=e/a.length;this.positions.push(a[e],a[e+1],a[e+2]),this.positions.push(a[e],a[e+1],a[e+2]),this.counters.push(s),this.counters.push(s)}this.process()};function il(a,t){var e=new S.Matrix4,i=new S.Ray,s=new S.Sphere,o=new S.Vector3,n=this.geometry;if(n.boundingSphere||n.computeBoundingSphere(),s.copy(n.boundingSphere),s.applyMatrix4(this.matrixWorld),a.ray.intersectSphere(s,o)!==!1){e.copy(this.matrixWorld).invert(),i.copy(a.ray).applyMatrix4(e);var r=new S.Vector3,h=new S.Vector3,c=new S.Vector3,l=this instanceof S.LineSegments?2:1,p=n.index,d=n.attributes;if(p!==null)for(var u=p.array,g=d.position.array,x=d.width.array,m=0,v=u.length-1;m<v;m+=l){var P=u[m],_=u[m+1];r.fromArray(g,P*3),h.fromArray(g,_*3);var L=x[Math.floor(m/3)]!==void 0?x[Math.floor(m/3)]:1,C=a.params.Line.threshold+this.material.lineWidth*L/2,R=C*C,b=i.distanceSqToSegment(r,h,o,c);if(!(b>R)){o.applyMatrix4(this.matrixWorld);var U=a.ray.origin.distanceTo(o);U<a.near||U>a.far||(t.push({distance:U,point:c.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this}),m=v)}}}}Yt.prototype.raycast=il;Yt.prototype.compareV3=function(a,t){var e=a*6,i=t*6;return this.positions[e]===this.positions[i]&&this.positions[e+1]===this.positions[i+1]&&this.positions[e+2]===this.positions[i+2]};Yt.prototype.copyV3=function(a){var t=a*6;return[this.positions[t],this.positions[t+1],this.positions[t+2]]};Yt.prototype.getDistance=function(a){let t=0;for(let e=0;e<a;e++){let i=6*e,s=new S.Vector3(this.positions[i],this.positions[i+1],this.positions[i+2]),o=new S.Vector3(this.positions[i+6],this.positions[i+7],this.positions[i+8]),n=s.distanceTo(o);t+=n}return t};Yt.prototype.process=function(){var a=this.positions.length/6;this.previous=[],this.next=[],this.side=[],this.width=[],this.indices_array=[],this.uvs=[];var t;let e=this.getDistance(a-1);var i;this.compareV3(0,a-1)?i=this.copyV3(a-2):i=this.copyV3(0),this.previous.push(i[0],i[1],i[2]),this.previous.push(i[0],i[1],i[2]);for(var s=0;s<a;s++){if(this.side.push(1),this.side.push(-1),this.widthCallback?t=this.widthCallback(s/(a-1)):t=1,this.width.push(t),this.width.push(t),s===0)this.uvs.push(0,0),this.uvs.push(0,1);else if(s===a-1)this.uvs.push(1,0),this.uvs.push(1,1);else{let n=this.getDistance(s)/e;this.uvs.push(n,0),this.uvs.push(n,1)}if(s<a-1){i=this.copyV3(s),this.previous.push(i[0],i[1],i[2]),this.previous.push(i[0],i[1],i[2]);var o=s*2;this.indices_array.push(o,o+1,o+2),this.indices_array.push(o+2,o+1,o+3)}s>0&&(i=this.copyV3(s),this.next.push(i[0],i[1],i[2]),this.next.push(i[0],i[1],i[2]))}this.compareV3(a-1,0)?i=this.copyV3(1):i=this.copyV3(a-1),this.next.push(i[0],i[1],i[2]),this.next.push(i[0],i[1],i[2]),!this._attributes||this._attributes.position.count!==this.positions.length?this._attributes={position:new S.BufferAttribute(new Float32Array(this.positions),3),previous:new S.BufferAttribute(new Float32Array(this.previous),3),next:new S.BufferAttribute(new Float32Array(this.next),3),side:new S.BufferAttribute(new Float32Array(this.side),1),width:new S.BufferAttribute(new Float32Array(this.width),1),uv:new S.BufferAttribute(new Float32Array(this.uvs),2),index:new S.BufferAttribute(new Uint16Array(this.indices_array),1),counters:new S.BufferAttribute(new Float32Array(this.counters),1)}:(this._attributes.position.copyArray(new Float32Array(this.positions)),this._attributes.position.needsUpdate=!0,this._attributes.previous.copyArray(new Float32Array(this.previous)),this._attributes.previous.needsUpdate=!0,this._attributes.next.copyArray(new Float32Array(this.next)),this._attributes.next.needsUpdate=!0,this._attributes.side.copyArray(new Float32Array(this.side)),this._attributes.side.needsUpdate=!0,this._attributes.width.copyArray(new Float32Array(this.width)),this._attributes.width.needsUpdate=!0,this._attributes.uv.copyArray(new Float32Array(this.uvs)),this._attributes.uv.needsUpdate=!0,this._attributes.index.copyArray(new Uint16Array(this.indices_array)),this._attributes.index.needsUpdate=!0),this.setAttribute("position",this._attributes.position),this.setAttribute("previous",this._attributes.previous),this.setAttribute("next",this._attributes.next),this.setAttribute("side",this._attributes.side),this.setAttribute("width",this._attributes.width),this.setAttribute("uv",this._attributes.uv),this.setAttribute("counters",this._attributes.counters),this.setIndex(this._attributes.index),this.computeBoundingSphere(),this.computeBoundingBox()};function En(a,t,e,i,s){var o;if(a=a.subarray||a.slice?a:a.buffer,e=e.subarray||e.slice?e:e.buffer,a=t?a.subarray?a.subarray(t,s&&t+s):a.slice(t,s&&t+s):a,e.set)e.set(a,i);else for(o=0;o<a.length;o++)e[o+i]=a[o];return e}Yt.prototype.advance=function(a){var t=this._attributes.position.array,e=this._attributes.previous.array,i=this._attributes.next.array,s=t.length;En(t,0,e,0,s),En(t,6,t,0,s-6),t[s-6]=a.x,t[s-5]=a.y,t[s-4]=a.z,t[s-3]=a.x,t[s-2]=a.y,t[s-1]=a.z,En(t,6,i,0,s-6),i[s-6]=a.x,i[s-5]=a.y,i[s-4]=a.z,i[s-3]=a.x,i[s-2]=a.y,i[s-1]=a.z,this._attributes.position.needsUpdate=!0,this._attributes.previous.needsUpdate=!0,this._attributes.next.needsUpdate=!0};S.ShaderChunk.meshline_vert=["",S.ShaderChunk.logdepthbuf_pars_vertex,S.ShaderChunk.fog_pars_vertex,"","attribute vec3 previous;","attribute vec3 next;","attribute float side;","attribute float width;","attribute float counters;","","uniform vec2 resolution;","uniform float lineWidth;","uniform vec3 color;","uniform float opacity;","uniform float sizeAttenuation;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","vec2 fix( vec4 i, float aspect ) {",""," vec2 res = i.xy / i.w;"," res.x *= aspect;"," vCounters = counters;"," return res;","","}","","void main() {",""," float aspect = resolution.x / resolution.y;",""," vColor = vec4( color, opacity );"," vUV = uv;",""," mat4 m = projectionMatrix * modelViewMatrix;"," vec4 finalPosition = m * vec4( position, 1.0 );"," vec4 prevPos = m * vec4( previous, 1.0 );"," vec4 nextPos = m * vec4( next, 1.0 );",""," vec2 currentP = fix( finalPosition, aspect );"," vec2 prevP = fix( prevPos, aspect );"," vec2 nextP = fix( nextPos, aspect );",""," float w = lineWidth * width;",""," vec2 dir;"," if( nextP == currentP ) dir = normalize( currentP - prevP );"," else if( prevP == currentP ) dir = normalize( nextP - currentP );"," else {"," vec2 dir1 = normalize( currentP - prevP );"," vec2 dir2 = normalize( nextP - currentP );"," dir = normalize( dir1 + dir2 );",""," vec2 perp = vec2( -dir1.y, dir1.x );"," vec2 miter = vec2( -dir.y, dir.x );"," //w = clamp( w / dot( miter, perp ), 0., 4. * lineWidth * width );",""," }",""," //vec2 normal = ( cross( vec3( dir, 0. ), vec3( 0., 0., 1. ) ) ).xy;"," vec4 normal = vec4( -dir.y, dir.x, 0., 1. );"," normal.xy *= .5 * w;"," normal *= projectionMatrix;"," if( sizeAttenuation == 0. ) {"," normal.xy *= finalPosition.w;"," normal.xy /= ( vec4( resolution, 0., 1. ) * projectionMatrix ).xy;"," }",""," finalPosition.xy += normal.xy * side;",""," gl_Position = finalPosition;","",S.ShaderChunk.logdepthbuf_vertex,S.ShaderChunk.fog_vertex&&" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",S.ShaderChunk.fog_vertex,"}"].join(`
549
549
  `);S.ShaderChunk.meshline_frag=["",S.ShaderChunk.fog_pars_fragment,S.ShaderChunk.logdepthbuf_pars_fragment,"","uniform sampler2D map;","uniform sampler2D alphaMap;","uniform float useMap;","uniform float useAlphaMap;","uniform float useDash;","uniform float dashArray;","uniform float dashOffset;","uniform float dashRatio;","uniform float visibility;","uniform float alphaTest;","uniform vec2 repeat;","uniform float thresholdRatio;","","varying vec2 vUV;","varying vec4 vColor;","varying float vCounters;","","void main() {",""," if (vUV.x <= thresholdRatio) {"," discard;"," }",S.ShaderChunk.logdepthbuf_fragment,""," vec4 c = vColor;"," if( useMap == 1. ) c *= texture2D( map, vUV * repeat );"," if( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).a;"," if( c.a < alphaTest ) discard;"," if( useDash == 1. ){"," c.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));"," }"," gl_FragColor = c;"," gl_FragColor.a *= step(vCounters, visibility);","",S.ShaderChunk.fog_fragment,"}"].join(`
550
550
  `);var Ps=class extends S.ShaderMaterial{constructor(t){super({uniforms:Object.assign({},S.UniformsLib.fog,{lineWidth:{value:1},map:{value:null},useMap:{value:0},alphaMap:{value:null},useAlphaMap:{value:0},color:{value:new S.Color(16777215)},opacity:{value:1},resolution:{value:new S.Vector2(1,1)},sizeAttenuation:{value:1},dashArray:{value:0},dashOffset:{value:0},dashRatio:{value:.5},useDash:{value:0},visibility:{value:1},alphaTest:{value:0},repeat:{value:new S.Vector2(1,1)},thresholdRatio:{value:0},transparent:{value:!0},depthTest:{vale:!1},depthWrite:{value:!1}}),vertexShader:S.ShaderChunk.meshline_vert,fragmentShader:S.ShaderChunk.meshline_frag}),this.isMeshLineMaterial=!0,this.type="MeshLineMaterial",Object.defineProperties(this,{lineWidth:{enumerable:!0,get:function(){return this.uniforms.lineWidth.value},set:function(e){this.uniforms.lineWidth.value=e}},map:{enumerable:!0,get:function(){return this.uniforms.map.value},set:function(e){this.uniforms.map.value=e}},useMap:{enumerable:!0,get:function(){return this.uniforms.useMap.value},set:function(e){this.uniforms.useMap.value=e}},alphaMap:{enumerable:!0,get:function(){return this.uniforms.alphaMap.value},set:function(e){this.uniforms.alphaMap.value=e}},useAlphaMap:{enumerable:!0,get:function(){return this.uniforms.useAlphaMap.value},set:function(e){this.uniforms.useAlphaMap.value=e}},color:{enumerable:!0,get:function(){return this.uniforms.color.value},set:function(e){this.uniforms.color.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},sizeAttenuation:{enumerable:!0,get:function(){return this.uniforms.sizeAttenuation.value},set:function(e){this.uniforms.sizeAttenuation.value=e}},dashArray:{enumerable:!0,get:function(){return this.uniforms.dashArray.value},set:function(e){this.uniforms.dashArray.value=e,this.useDash=e!==0?1:0}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},dashRatio:{enumerable:!0,get:function(){return this.uniforms.dashRatio.value},set:function(e){this.uniforms.dashRatio.value=e}},useDash:{enumerable:!0,get:function(){return this.uniforms.useDash.value},set:function(e){this.uniforms.useDash.value=e}},visibility:{enumerable:!0,get:function(){return this.uniforms.visibility.value},set:function(e){this.uniforms.visibility.value=e}},alphaTest:{enumerable:!0,get:function(){return this.uniforms.alphaTest.value},set:function(e){this.uniforms.alphaTest.value=e}},repeat:{enumerable:!0,get:function(){return this.uniforms.repeat.value},set:function(e){this.uniforms.repeat.value.copy(e)}},thresholdRatio:{enumerable:!0,get:function(){return this.uniforms.thresholdRatio.value},set:function(e){this.uniforms.thresholdRatio.value=e}}}),this.setValues(t)}};Ps.prototype.copy=function(a){return S.ShaderMaterial.prototype.copy.call(this,a),this.lineWidth=a.lineWidth,this.map=a.map,this.useMap=a.useMap,this.alphaMap=a.alphaMap,this.useAlphaMap=a.useAlphaMap,this.color.copy(a.color),this.opacity=a.opacity,this.resolution.copy(a.resolution),this.sizeAttenuation=a.sizeAttenuation,this.dashArray.copy(a.dashArray),this.dashOffset.copy(a.dashOffset),this.dashRatio.copy(a.dashRatio),this.useDash=a.useDash,this.visibility=a.visibility,this.alphaTest=a.alphaTest,this.repeat.copy(a.repeat),this};var Wa={texture_url:Hs,lineWidth:10,color:16777215},ao=class extends Mt.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]=r;return A(new Mt.Vector3(h,c,0),e,i,s)}).map(r=>{let{x:h,y:c}=r;return[h,c]});return Ot(o)/32}changeRepeat(){if(!this.material)return;let t=this.getRepeat();this.material.repeat=new Mt.Vector2(t,1)}loadTexture(t){return new Promise((e,i)=>{new Mt.TextureLoader().load(t,e,void 0,i)})}transformPoints(t){let e=[];for(let i=0;i<t.length;i++)e.push(...t[i],0);return e}updatePoints(t){this.points=t,this.changeRepeat();let e=this.transformPoints(t);this.geometry&&this.geometry.setPoints(e)}movePath(t){this.material&&(this.material.thresholdRatio=t)}create(t){return f(this,null,function*(){let e=this.geometry=new Yt;if(this.updatePoints(t),!this.texture){let o=this.texture=yield this.loadTexture(this.config.texture_url);o.wrapS=o.wrapT=Mt.RepeatWrapping}let i=this.material=new Ps({useMap:!0,color:new Mt.Color(this.config.color),transparent:!0,resolution:new Mt.Vector2(this.navigation.bmap.context.clientSize.width,this.navigation.bmap.context.clientSize.height),depthTest:!1,sizeAttenuation:!1,lineWidth:this.config.lineWidth*2,map:this.texture,blending:Mt.NormalBlending,repeat:new Mt.Vector2(this.getRepeat(),1)}),s=this.mesh=new Mt.Mesh(e,i);return s.renderOrder=99999,this.add(s),s})}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=Wa,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({},Wa,e),this.registryEvent(),this.prevCameraZoom=this.navigation.bmap.context.camera.zoom}};var wi=require("@tweenjs/tween.js"),Ut=require("three");var sM=require("core-js/modules/es.array.unshift.js"),oM=require("core-js/modules/web.dom-collections.iterator.js"),nM=require("core-js/modules/es.array.push.js"),ho=require("three");var Ua=require("@tweenjs/tween.js"),Ha=require("lodash"),xi=require("@turf/turf");var sl={offsetDistance:15,offsetToResetTime:3e3,directionEmitThreshold:5,simulationSpeed:1,destinationDistanceThreshold:10},co=class extends pt{get curRoutePath(){return this.paths[this.routeIndex]||null}get curRoutePathPoints(){var t;return((t=this.curRoutePath)==null?void 0:t.points)||[]}registryEvent(){this.navigation.bmap.context.addEventListener("update",this.onUpdate),this.navigation.addEventListener("add-path",this.onAddPaths)}unRegistryEvent(){this.navigation.bmap.context.removeEventListener("update",this.onUpdate),this.navigation.removeEventListener("add-path",this.onAddPaths)}setRoadData(t){this.roadData=t}resetStatus(t){this.offset=!1,this.reset=!1,this.routeIndex=0,this.pointIndex=0,this.offsetDistance=0,this.resetTimer&&(this.timer.clearTimeout(this.resetTimer),this.resetTimer=null),t.length&&(this.position=t[0].points[0])}emitNavigationStatus(){let t=this.getNavigationInfo();t&&this.dispatchEvent({type:"navigation-info",info:t})}adsorb(t,e){let{curRoutePathPoints:i,position:s,curRoutePath:o,paths:n,routeIndex:r}=this;if(!i.length)return null;let h=i,c=this.paths[this.routeIndex].floor,l=this.getCurRouteRemainDistance();if(s){let m=me(i,s);h=h.slice(m+1),h.unshift(s)}let p=[{floor:o==null?void 0:o.floor,points:h},...n.slice(r+1)],{distance:d,closestPoint:u,index:g,i:x}=p.reduce((m,v,P)=>{if(v.floor!==t)return m;let{distance:_,closestPoint:L,index:C}=v.points.reduce((R,b,U,B)=>{if(!B[U+1])return w({},R,{distance:R.distance===1/0?O(b,e):R.distance});let{distance:z,closestPoint:at}=Ko(e,b,B[U+1]);if(!this.navigation.options.canBack&&c===t){let ft=[e,...B.slice(U+1)],K=Ot(ft);if(l-K>10)return R}return z<R.distance?{distance:z,closestPoint:at,index:U}:R},{distance:1/0,closestPoint:v.points[0],index:0});return _<m.distance?{distance:_,closestPoint:L,index:P,i:C}:m},{distance:1/0,closestPoint:h[0],index:0,i:0});return{distance:d,closestPoint:u,routeIndex:g+r,pointIndex:g===0?x+this.pointIndex:x}}toPosition(t,e){this.actualPosition=e;let i=this.adsorb(t,e);if(!i)return;let{distance:s,closestPoint:o,routeIndex:n,pointIndex:r}=i;this.offsetDistance=s,s>this.options.offsetDistance?(this.offset=!0,this.resetTimer||(this.resetTimer=this.timer.setTimeout(()=>{this.reset=!0,this.resetTimer=null},this.options.offsetToResetTime))):(this.offset=!1,this.reset=!1,this.resetTimer&&(this.timer.clearTimeout(this.resetTimer),this.resetTimer=null)),this.routeIndex=n,this.pointIndex=r,this.position=o,this.emitNavigationStatus()}startSimulation(){this.resetStatus(this.paths),this.emitNavigationStatus(),this.startCurRouteSimulation()}pause(){var t;this.tweenUtil.clear(),(t=this.throttleUpdatePosition)==null||t.cancel(),this.paused=!0}continue(){this.paused=!1,this.startCurRouteSimulation()}startCurRouteSimulation(){return f(this,null,function*(){let{curRoutePath:t}=this;if(!t)return;this.simulationTween&&this.tweenUtil.remove(this.simulationTween);let e=[];return new Promise(i=>{let s=[this.position,...this.curRoutePathPoints.slice(this.pointIndex+1)],o=this.getCurRouteRemainDistance(),n=o/this.options.simulationSpeed,r=this.throttleUpdatePosition=(0,Ha.throttle)(c=>{let l=Xe(s,c.distance);l&&(e.push({floor:t.floor,pos:l}),this.toPosition(t.floor,l))},100),h=this.simulationTween=new Ua.Tween({distance:0},this.tweenUtil.group).to({distance:o},n*1e3).onUpdate(r).onComplete(()=>{this.tweenUtil.remove(h),r.flush(),r.cancel(),this.routeIndex+1<this.paths.length?(this.routeIndex++,this.position=this.paths[this.routeIndex].points[0],this.pointIndex=0,setTimeout(()=>{i(this.startCurRouteSimulation())},3e3)):(i(!0),console.log(e,this.routeIndex,this.paths))}).start()})})}changeSimulationSpeed(t){this.options.simulationSpeed=t,this.paused||this.startCurRouteSimulation()}getCurRouteRemainDistance(){let{curRoutePathPoints:t,pointIndex:e,position:i}=this;if(!t.length)return 0;let s=[i,...t.slice(e+1)];return Ot(s)}getCurRouteToStartDistance(){let{curRoutePathPoints:t,pointIndex:e,position:i}=this;if(!t.length)return 0;let s=[...t.slice(0,e+1),i];return Ot(s)}getRemainDistance(){let t=this.getCurRouteRemainDistance();return{total:this.paths.slice(this.routeIndex+1).reduce((s,o)=>s+o.distance,0)+t,curRoute:t}}getNextDirDistance(){var t;if(!this.position)return null;let{pointIndex:e,curRoutePathPoints:i,position:s,curRoutePath:o}=this,n=e,r=ye.FRONT,h=(o==null||(t=o.pointInfos[n])==null?void 0:t.crossName)||"",c=0,l=0,p=0;for(;r===ye.FRONT&&n<=i.length;){let x=i[n],m=i[n+1],v=i[n+2];if(!x||!m)r=ye.END;else if(c+=O(x,m),!v)r=ye.END;else{r=Os(x,m,v),l=Ze(x,m,v),p=(new ho.Vector2(v[0]-m[0],v[1]-m[1]).angle()*180/Math.PI-90+360)%360;var d;h=(d=o==null?void 0:o.pointInfos[n+1].crossName)!=null?d:"",n+=1}}i[n]&&(c=O(s,i[n]));let u=Rs(l);if(r===ye.END&&c<=this.options.directionEmitThreshold)return{dir:r,distance:c,crossName:h,angle:l,nextAngle:p,nextDir:u};let g=this.getCurRouteToStartDistance();return e===0&&g<=5?{dir:ye.START,distance:c,crossName:h,angle:l,nextAngle:p,nextDir:u}:(c>=this.options.directionEmitThreshold&&(r=ye.FRONT),{dir:r,distance:c,crossName:h,angle:l,nextAngle:p,nextDir:u})}calcReverseAngle(t){let e=t!=null?t:this.actualPosition;if(!e||!this.position)return null;let{curRoutePathPoints:i,pointIndex:s}=this,o=this.position;if(!i.length)return null;let n=o,r=null;if(i[s+1]?r=i[s+1]:i[s-1]&&(n=i[s-1],r=o),!r)return null;let h=new ho.Vector2(r[0]-n[0],r[1]-n[1]),c=new ho.Vector2(e[0]-o[0],e[1]-o[1]);return h.length()===0||c.length()===0?null:h.angleTo(c)*180/Math.PI}getCurPointAreaInfo(){let t=this.roadData.find(e=>e.floor===this.paths[this.routeIndex].floor);if(t){let e=(t.areas||[]).find(i=>{let s=(0,xi.polygon)(i.cds),o=(0,xi.point)(this.position);return(0,xi.booleanPointInPolygon)(o,s)});if(e)return e}return{imageUrl:null}}getNavigationInfo(){let{total:t,curRoute:e}=this.getRemainDistance(),i=this.getNextDirDistance();if(!i)return null;let{dir:s,distance:o,crossName:n,angle:r,nextAngle:h,nextDir:c}=i;e<=this.options.destinationDistanceThreshold&&(s=ye.END);let{imageUrl:l}=this.getCurPointAreaInfo(),p=this.calcReverseAngle();return{distance:t,curRouteDistance:e,nextDirDistance:o,dir:s,angle:r,nextAngle:h,pos:this.position,routeIndex:this.routeIndex,crossName:n,offset:this.offset,reset:this.reset,imageUrl:l,nextDir:c,offsetDistance:this.offsetDistance,reverseAngle:p}}dispose(){this.timer.dispose(),this.unRegistryEvent(),this.tweenUtil.clear(),this.navigation=null}constructor(t,e,i){super(),this.navigation=t,this.offset=!1,this.reset=!1,this.position=[0,0],this.routeIndex=0,this.pointIndex=0,this.paths=[],this.timer=new J,this.resetTimer=null,this.tweenUtil=new Ce,this.paused=!1,this.offsetDistance=0,this.actualPosition=null,this.onAddPaths=s=>{let{paths:o}=s;this.paths=o,this.resetStatus(o),this.simulationTween&&!this.paused&&this.startSimulation()},this.onUpdate=()=>{this.tweenUtil.update()},this.options=Object.assign({},sl,e),this.roadData=i,this.registryEvent()}};var cM=require("core-js/modules/es.typed-array.uint8-array.js"),lM=require("core-js/modules/es.typed-array.at.js"),pM=require("core-js/modules/es.typed-array.fill.js"),dM=require("core-js/modules/es.typed-array.find-last.js"),uM=require("core-js/modules/es.typed-array.find-last-index.js"),mM=require("core-js/modules/es.typed-array.set.js"),fM=require("core-js/modules/es.typed-array.sort.js"),gM=require("core-js/modules/es.typed-array.to-reversed.js"),yM=require("core-js/modules/es.typed-array.to-sorted.js"),vM=require("core-js/modules/es.typed-array.with.js"),xM=require("core-js/modules/es.array-buffer.constructor.js"),wM=require("core-js/modules/es.array-buffer.slice.js"),PM=require("core-js/modules/es.array-buffer.detached.js"),MM=require("core-js/modules/es.array-buffer.transfer.js"),_M=require("core-js/modules/es.array-buffer.transfer-to-fixed-length.js"),bM=require("core-js/modules/es.typed-array.from.js"),EM=require("core-js/modules/web.dom-collections.iterator.js"),oe=require("three");var ke=class a extends rt{addDebug(){a.canvas.style.cssText=`
551
551
  position: fixed;