tg-map-vue3 3.8.4 → 3.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('.baidu-info-box-container{transform:translateY(-11px);font-size:13px;font-weight:300;width:100vw;cursor:auto;-webkit-user-select:auto!important;user-select:auto!important}.baidu-info-box-container__border{position:absolute;padding:12px;background-color:#fff;box-shadow:0 2px 7px 1px #0000004d;border-radius:8px;transform:translate(-50%,-100%)}.baidu-info-box-container__inner{overflow:auto}.baidu-info-box-container__close{position:absolute;right:-6px;top:-6px;width:14px;height:14px;margin:8px;opacity:.6;cursor:pointer;-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M19%206.41L17.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012z%22/%3E%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22/%3E%3C/svg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20d%3D%22M19%206.41L17.59%205%2012%2010.59%206.41%205%205%206.41%2010.59%2012%205%2017.59%206.41%2019%2012%2013.41%2017.59%2019%2019%2017.59%2013.41%2012z%22/%3E%3Cpath%20d%3D%22M0%200h24v24H0z%22%20fill%3D%22none%22/%3E%3C/svg%3E);background-color:#000}.baidu-info-box-container__close:hover{opacity:1}.baidu-info-box-container:after{position:absolute;background-color:#fff;content:"";width:15px;height:15px;left:0;top:0;box-shadow:-2px 2px 2px #b2b2b266;transform:translate(-50%,-50%) rotate(-45deg)}.element-overlay{position:absolute}.tg-map{height:100%;position:relative}.tg-map__map{width:100%;height:100%}.tg-map__map--hide-logo-google .gm-style a[target=_blank]:has(>div>img){display:none!important}.tg-map__map--hide-logo-google .gm-style>div:last-child>div:last-child>div{display:none}.tg-map__map--hide-logo-baidu div.anchorBL>a[target=_blank]>img{display:none}.tg-map__map--hide-logo-baidu div.BMap_cpyCtrl{display:none}.tg-map-widget{position:absolute}.tg-map>.tg-custom-control{display:none}.tg-map .tg-element-overlay{display:none}.tg-map__map .tg-element-overlay{display:block}.tg-map .tg-info-box{display:none}.tg-map__map .tg-info-box{display:block}.tg-map .tg-label{display:none}.tg-map__map .tg-label{display:block}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- (function(a,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],y):(a=typeof globalThis<"u"?globalThis:a||self,y(a.TgMap={},a.Vue))})(this,function(a,y){"use strict";var Vn=Object.defineProperty;var jn=(a,y,$)=>y in a?Vn(a,y,{enumerable:!0,configurable:!0,writable:!0,value:$}):a[y]=$;var f=(a,y,$)=>(jn(a,typeof y!="symbol"?y+"":y,$),$);function $(r,t,e){Object.keys(r).forEach(i=>{i.startsWith("update:")||e!=null&&e.includes(i)||t.addEventListener(i,r[i])})}let gr=1;function mr(){return gr++}function $e(r,t){return t.__id__||(t.__id__=mr()),`${r}::${t.__id__}`}var It=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ze(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Jt={exports:{}};(function(r){(function(t,e){r.exports?r.exports=e():t.coordtransform=e()})(It,function(){var t=52.35987755982988,e=3.141592653589793,i=6378245,n=.006693421622965943;function s(h,p,_,b){this.west=Math.min(h,_),this.north=Math.max(p,b),this.east=Math.max(h,_),this.south=Math.min(p,b)}s.prototype.contain=function(h,p){return this.west<=h&&this.east>=h&&this.north>=p&&this.south<=p};var l=[new s(79.4462,49.2204,96.33,42.8899),new s(109.6872,54.1415,135.0002,39.3742),new s(73.1246,42.8899,124.143255,29.5297),new s(82.9684,29.5297,97.0352,26.7186),new s(97.0253,29.5297,124.367395,20.414096),new s(107.975793,20.414096,111.744104,17.871542)],d=[new s(119.921265,25.398623,122.497559,21.785006),new s(101.8652,22.284,106.665,20.0988),new s(106.4525,21.5422,108.051,20.4878),new s(109.0323,55.8175,119.127,50.3257),new s(127.4568,55.8175,137.0227,49.5574),new s(131.2662,44.8922,137.0227,42.5692),new s(73.1246,35.398637,77.948114,29.5297)],o=[new s(114.505238,22.138258,113.845,22.428903),new s(113.97,22.507833,114.45,22.428903)];function c(h,p,_=!0){for(var b=0;b<l.length;b++)if(l[b].contain(h,p)){for(var E=0;E<d.length;E++)if(d[E].contain(h,p))return!1;if(_){for(var E=0;E<o.length;E++)if(o[E].contain(h,p))return!1}return!0}return!1}function u(h,p){var _=h-.0065,b=p-.006,E=Math.sqrt(_*_+b*b)-2e-5*Math.sin(b*t),P=Math.atan2(b,_)-3e-6*Math.cos(_*t),B=E*Math.cos(P),D=E*Math.sin(P);return[B,D]}function g(h,p){var _=Math.sqrt(h*h+p*p)+2e-5*Math.sin(p*t),b=Math.atan2(p,h)+3e-6*Math.cos(h*t),E=_*Math.cos(b)+.0065,P=_*Math.sin(b)+.006;return[E,P]}function m(h,p){return C(h,p)}function v(h,p){var _=C(h,p);return[h*2-_[0],p*2-_[1]]}function C(h,p){var _=M(h-105,p-35),b=O(h-105,p-35),E=p/180*e,P=Math.sin(E);P=1-n*P*P;var B=Math.sqrt(P);_=_*180/(i*(1-n)/(P*B)*e),b=b*180/(i/B*Math.cos(E)*e);var D=p+_,Z=h+b;return[Z,D]}function M(h,p){var _=-100+2*h+3*p+.2*p*p+.1*h*p+.2*Math.sqrt(Math.abs(h));return _+=(20*Math.sin(6*h*e)+20*Math.sin(2*h*e))*2/3,_+=(20*Math.sin(p*e)+40*Math.sin(p/3*e))*2/3,_+=(160*Math.sin(p/12*e)+320*Math.sin(p*e/30))*2/3,_}function O(h,p){var _=300+h+2*p+.1*h*h+.1*h*p+.1*Math.sqrt(Math.abs(h));return _+=(20*Math.sin(6*h*e)+20*Math.sin(2*h*e))*2/3,_+=(20*Math.sin(h*e)+40*Math.sin(h/3*e))*2/3,_+=(150*Math.sin(h/12*e)+300*Math.sin(h/30*e))*2/3,_}return{rawBd09ToGcj02:u,rawGcj02ToBd09:g,rawWgs84ToGcj02:m,rawGcj02ToWgs84:v,bd09ToGcj02:u,gcj02ToBd09:g,wgs84ToGcj02:function(h,p){return c(h,p)?m(h,p):[h,p]},gcj02ToWgs84:function(h,p){return c(h,p)?v(h,p):[h,p]},bd09ToWgs84:function(h,p){if(!c(h,p,!1))return[h,p];var _=u(h,p);return v(_[0],_[1])},wgs84ToBd09:function(h,p){if(!c(h,p,!1))return[h,p];var _=m(h,p);return g(_[0],_[1])}}})})(Jt);var fr=Jt.exports;const ae=ze(fr);a.Arrays=void 0,(r=>{function t(d,o){return d.length===o.length&&d.every((c,u)=>c===o[u])}r.equals=t;function e(d,o){const c=d.indexOf(o);if(c!==-1)return d.splice(c,1)[0]}r.remove=e;function i(d,o){for(const c of d)if(c instanceof o)return c}r.findByType=i;function n(d,o){return d.includes(o)}r.includesTyped=n;function s(d,o,c){const u=o>=0?o:d.length+o;if(c===void 0)return d[u];d[u]=c}r.at=s;function l(d){return d.length>0}r.isNotEmpty=l})(a.Arrays||(a.Arrays={})),a.MVCArrays=void 0,(r=>{function t(n,s){const l=n.getLength();for(let d=0;d<l;d++)if(n.getAt(d)===s)return d;return-1}r.indexOf=t;function e(n,s){const l=t(n,s);if(l!==-1)return n.removeAt(l)}r.remove=e;function i(n,s){return[n.addListener("insert_at",s),n.addListener("remove_at",s),n.addListener("set_at",s)]}r.listenChanged=i})(a.MVCArrays||(a.MVCArrays={}));function ne(r,t){if(!r)throw new Error(`AssertionError: ${t}`)}function Ge(r){throw new Error(`Unexpected object: ${r}`)}function yr(){}function Ne(r){return r}function vr(r,t){return r instanceof t}function _r(r,t){if(r instanceof t)return r}function Ze(r,t){return(r==null?void 0:r.$options.name)===t.name}function St(r,t){return Ze(r,t)?r:void 0}function We(r,t,e){let i=t;for(;i;){if(Ze(i,r))return i;if(e&&Ze(i,e))return;i=i.$parent}}function br(r){return r}function I(r){throw new Error(r)}function He(r){throw new Error(`Unsupported: ${r}`)}function Mr(r){throw new Error(`todo: ${r}`)}function Tr(r){return r}function le(...r){}function Cr(r){return r!=null}function Qt(r){return r[1]!=null}function ei(r){let t=null;return()=>t??(t=r().catch(e=>(t=null,Promise.reject(e))))}var R=(r=>(r.wgs84="wgs84",r.gcj02="gcj02",r.bd09="bd09",r))(R||{});const kt="wgs84",G=class G{constructor(t,e,i){this.lat=t,this.lng=e,this.coord=i}static _normalize(t,e){const i=e>90?90:e<-90?-90:e;return[t>180?(t+180)%360-180:t<-180?(t-180)%360+180:t,i]}static fromBaidu(t,e){return new G(t.lat,t.lng,e)}static fromGoogle(t,e){return new G(t.lat(),t.lng(),e)}static fromHere(t,e){return new G(t.lat,t.lng,e)}static fromLiteral(t){return new G(t.lat,t.lng,t.coord||kt)}static fromLngLat(t,e,i=kt){return new G(e,t,i)}static create(t,e,i=kt){return new G(t,e,i)}to(t){const e=t;if(this.coord===e)return this;const[i,n]=this._convert(e);return new G(n,i,e)}toBaidu(t,e=!1){let i=this.lat,n=this.lng;return this.coord!==t&&([n,i]=this._convert(t)),e&&([n,i]=G._normalize(n,i)),new BMap.Point(n,i)}toGoogle(t){let e=this.lat,i=this.lng;return this.coord!==t&&([i,e]=this._convert(t)),new google.maps.LatLng(e,i)}toHere(t){let e=this.lat,i=this.lng;return this.coord!==t&&([i,e]=this._convert(t)),new H.geo.Point(e,i)}_convert(t){switch(this.coord){case"bd09":return t==="gcj02"?ae.bd09ToGcj02(this.lng,this.lat):ae.bd09ToWgs84(this.lng,this.lat);case"gcj02":return t==="wgs84"?ae.gcj02ToWgs84(this.lng,this.lat):ae.gcj02ToBd09(this.lng,this.lat);case"wgs84":return t==="bd09"?ae.wgs84ToBd09(this.lng,this.lat):ae.wgs84ToGcj02(this.lng,this.lat)}throw new Error(`不支持的坐标转换: ${this.coord}=>${t}`)}normalize(){const[t,e]=G._normalize(this.lng,this.lat);return e===this.lat&&t===this.lng?this:new G(e,t,this.coord)}equals(t){return this===t?!0:this.lat===t.lat&&this.lng===t.lng&&this.coord===t.coord}toString(){return JSON.stringify(this)}};f(G,"ZERO",G.create(0,0));let w=G;const re=class re{constructor(t,e){f(this,"coord");this.sw=t,this.ne=e,ne(t.coord===e.coord,"sw和ne的coord应该相同"),ne(Number.isFinite(t.lat)&&Number.isFinite(t.lng)&&Number.isFinite(e.lat)&&Number.isFinite(e.lng),`sw(${t})和ne(${e})不能包含NaN或Infinite`),ne(t.lat<=e.lat,`sw.lat(${t.lat})应该比ne.lat(${e.lat})小`),this.coord=t.coord}static isBetweenLng(t,e,i){return t<=e?t<=i&&i<=e:t<=i||i<=e}static fromArray(t){if(t.length===0)return;const e=new re.Builder(t[0]);for(let i=1;i<t.length;i++)e.include(t[i]);return e.build()}static from(...t){return this.fromArray(t)??I("positions中没有点")}static fromGoogle(t,e){return new re(w.fromGoogle(t.getSouthWest(),e),w.fromGoogle(t.getNorthEast(),e))}static fromBaidu(t,e){return new re(w.fromBaidu(t.getSouthWest(),e),w.fromBaidu(t.getNorthEast(),e))}static create(t,e){return this.from(t,e)}isEmpty(){return this.sw.equals(this.ne)}contains(t){const{lat:e,lng:i}=t.to(this.coord);return this.sw.lat<=e&&e<=this.ne.lat&&re.isBetweenLng(this.sw.lng,this.ne.lng,i)}getCenter(){if(this.sw.equals(this.ne))return this.sw;const t=(this.sw.lat+this.ne.lat)/2,e=(this.sw.lng+this.ne.lng+(this.sw.lng<this.ne.lng?0:360))/2;return w.create(t,e,this.coord)}toString(){return JSON.stringify(this)}equals(t){return this.sw.equals(t.sw)&&this.ne.equals(t.ne)}toRectArray(){const t=this.sw.coord;return[this.sw,w.fromLngLat(this.sw.lng,this.ne.lat,t),this.ne,w.fromLngLat(this.ne.lng,this.sw.lat,t)]}toGoogle(t){return new google.maps.LatLngBounds(this.sw.toGoogle(t),this.ne.toGoogle(t))}toBaidu(t){return new BMap.Bounds(this.sw.toBaidu(t),this.ne.toBaidu(t))}toBaiduArray(t){return[this.sw.toBaidu(t),this.ne.toBaidu(t)]}};f(re,"EMPTY",new re(w.ZERO,w.ZERO));let j=re;(r=>{class t{constructor(i){f(this,"coord");f(this,"minLat");f(this,"minLng");f(this,"maxLat");f(this,"maxLng");this.coord=i.coord,this.minLat=this.maxLat=i.lat,this.minLng=this.maxLng=i.lng}build(){return new r(w.create(this.minLat,this.minLng,this.coord),w.create(this.maxLat,this.maxLng,this.coord))}include(i){const{lat:n,lng:s}=i.to(this.coord);return this.minLat=Math.min(this.minLat,n),this.maxLat=Math.max(this.maxLat,n),r.isBetweenLng(this.minLng,this.maxLng,s)||(this.delta(this.minLng,s)<this.delta(s,this.maxLng)?this.minLng=s:this.maxLng=s),this}delta(i,n){return(i-n+360)%360}}r.Builder=t})(j||(j={})),a.Location=void 0,(r=>{function t(i,n){if(i==null)return;if(typeof i=="string")return i;const s=i.to(n);return`${s.lat},${s.lng}`}r.toString=t;function e(i){return typeof i=="string"||i==null?void 0:i.coord}r.getCoordType=e})(a.Location||(a.Location={}));var xt;(r=>{function t(e){return e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight}r.isScrollable=t})(xt||(xt={}));function ti(r,t,e){return r.addListener(t,e).remove}function Or(r,t,e){return r.addEventListener(t,e),()=>r.removeEventListener(t,e)}function wr(r,t,e,i){return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}function ii(r,t,e){return r.addEventListener(t,e),()=>r.removeEventListener(t,e)}class ri{constructor(t,e){f(this,"eventMap",new Map);f(this,"target",void 0);this.inner=t,this.coordTypeSupplier=e,this.addEventListener=this.addEventListener.bind(this),this.removeEventListener=this.removeEventListener.bind(this)}setTarget(t){return this.target=t,this}}class Ve{constructor(t,e){f(this,"eventHub",new ni);this.delegate=t,this.options=e}notify(t){this.eventHub.notify(t)}hasListener(t){return this.eventHub.hasListener(t)}setTarget(t){return this.delegate.setTarget(t),this}addEventListener(t,e){if(a.Arrays.includesTyped(this.options.types,t)){this.eventHub.hasListener(t)||this.options.onListen(t),this.eventHub.addEventListener(t,e);return}this.delegate.addEventListener(t,e)}removeEventListener(t,e){if(a.Arrays.includesTyped(this.options.types,t)){this.eventHub.removeEventListener(t,e),this.eventHub.hasListener(t)||this.options.onCancel(t);return}this.delegate.removeEventListener(t,e)}}const Lt=class Lt extends ri{addEventListener(t,e){const i=$e(t,e);if(this.eventMap.get(i)){console.warn("listener已经添加过了",i,e);return}const n=this.inner.addListener(Lt.EVENT_TYPE_MAP[t]||t,s=>{const l={type:t,target:this.target,originalEvent:s};s!=null&&s.latLng&&(l.position=w.fromGoogle(s.latLng,this.coordTypeSupplier.coordType)),e.call(this.target,l)});this.eventMap.set(i,n)}removeEventListener(t,e){const i=$e(t,e),n=this.eventMap.get(i);n?(n.remove(),this.eventMap.delete(i)):console.warn("移除失败, 不存在该listener",i,e)}};f(Lt,"EVENT_TYPE_MAP",{"center-changed":"center_changed","zoom-changed":"zoom_changed","radius-changed":"radius_changed","bounds-changed":"bounds_changed","map-type-changed":"maptypeid_changed","map-mousedown":"mousedown","map-mousemove":"mousemove","map-mouseup":"mouseup","map-dblclick":"dblclick"});let he=Lt;const ke=class ke extends ri{addEventListener(t,e){const i=$e(t,e);if(this.eventMap.get(i)){console.warn("listener已经添加过了",i,e);return}const n=s=>{const l={type:t,target:this.target,originalEvent:s};s.point&&(l.position=w.fromBaidu(s.point,this.coordTypeSupplier.coordType)),e.call(this.target,l)};this.inner.addEventListener(ke.EVENT_TYPE_MAP[t]||t,n),this.eventMap.set(i,n)}removeEventListener(t,e){const i=$e(t,e),n=this.eventMap.get(i);n?(this.inner.removeEventListener(ke.EVENT_TYPE_MAP[t]||t,n),this.eventMap.delete(i)):console.warn("移除失败, 不存在该listener",i,e)}};f(ke,"EVENT_TYPE_MAP",{drag:"dragging",closeclick:"clickclose",contextmenu:"rightclick","zoom-changed":"zoomend","map-type-changed":"maptypechange"});let _e=ke;class ni{constructor(){f(this,"typeMap",new Map)}addEventListener(t,e){let i=this.typeMap.get(t);i||(i=[],this.typeMap.set(t,i)),!i.includes(e)&&i.push(e)}removeEventListener(t,e){const i=this.typeMap.get(t);i&&a.Arrays.remove(i,e)}hasListener(t){const e=this.typeMap.get(t);return e!=null&&e.length>0}notify(t){const e=this.typeMap.get(t.type);e&&e.forEach(i=>i.call(t.target,t))}}class At{constructor(t,e){f(this,"keyToValue",new Map);f(this,"valueToKey",new Map);ne(t.length===e.length);for(let i=t.length-1;i>=0;i--)this.keyToValue.set(t[i],e[i]),this.valueToKey.set(e[i],t[i])}toKey(t){return this.valueToKey.get(t)??I()}toValue(t){return this.keyToValue.get(t)??I()}}class si{constructor(t,e=10){f(this,"map",new Map);this.values=t,this.maxSize4Debug=e}getValueMap(t){let e=this.map.get(t);if(!e){e=new Map;for(let i=this.values.length-1;i>=0;i--){const n=this.values[i];e.set(t.call(n),n)}this.map.set(t,e),process.env.NODE_ENV!=="production"&&this.map.size>this.maxSize4Debug&&console.warn(`this.map的大小(${this.map.size})超过了设置的最大大小(${this.maxSize4Debug}), 这可能是由于你每次都创建新的keySelector造成的, 请保证相同功能的keySelector只创建一个对象`)}return e}getOrNull(t,e){return this.getValueMap(t).get(e)}get(t,e){return this.getOrNull(t,e)??I(`key(${e})不存在与valueMap(${this.getValueMap(t)})中`)}}class ce{constructor(t){f(this,"value");this.creator=t}get(){return this.value===void 0&&(this.value=this.creator()),this.value}}var k=(r=>(r.TOP_LEFT="top-left",r.TOP_CENTER="top-center",r.TOP_RIGHT="top-right",r.BOTTOM_LEFT="bottom-left",r.BOTTOM_CENTER="bottom-center",r.BOTTOM_RIGHT="bottom-right",r.LEFT_TOP="left-top",r.LEFT_CENTER="left-center",r.LEFT_BOTTOM="left-bottom",r.RIGHT_TOP="right-top",r.RIGHT_CENTER="right-center",r.RIGHT_BOTTOM="right-bottom",r))(k||{});a.ControlPositionConverter=void 0,(r=>{let t,e;const i=["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right","left-top","left-center","left-bottom","right-top","right-center","right-bottom"];function n(){return t||(t=new At(i,[BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_TOP_RIGHT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_RIGHT,BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_TOP_RIGHT,BMAP_ANCHOR_BOTTOM_RIGHT,BMAP_ANCHOR_BOTTOM_RIGHT])),t}r.getBaidu=n;function s(){return e||(e=new At(i,[google.maps.ControlPosition.TOP_LEFT,google.maps.ControlPosition.TOP_CENTER,google.maps.ControlPosition.TOP_RIGHT,google.maps.ControlPosition.BOTTOM_LEFT,google.maps.ControlPosition.BOTTOM_CENTER,google.maps.ControlPosition.BOTTOM_RIGHT,google.maps.ControlPosition.LEFT_TOP,google.maps.ControlPosition.LEFT_CENTER,google.maps.ControlPosition.LEFT_BOTTOM,google.maps.ControlPosition.RIGHT_TOP,google.maps.ControlPosition.RIGHT_CENTER,google.maps.ControlPosition.RIGHT_BOTTOM])),e}r.getGoogle=s})(a.ControlPositionConverter||(a.ControlPositionConverter={}));class oi{constructor(t){f(this,"inner");this.position=t}}class je{}class ai extends je{constructor(t,e){super(),this.visible=t,this.position=e}isVisible(){return this.visible}setVisible(t){this.visible=t}getPosition(){return this.position}setPosition(t){this.position=t}addTo(t){}removeFrom(t){}}class Fe extends je{constructor(t,e){super(),this.inner=t,this.position=e}isVisible(){return this.inner.isVisible()}setVisible(t){t?this.inner.show():this.inner.hide()}getPosition(){return this.position??a.ControlPositionConverter.getBaidu().toKey(this.inner.getAnchor())}setPosition(t){this.position=t,this.inner.setAnchor(a.ControlPositionConverter.getBaidu().toValue(t))}addTo(t){t.innerMap.addControl(this.inner)}removeFrom(t){t.innerMap.removeControl(this.inner)}}class be extends je{constructor(e,i){super();f(this,"visible",!1);f(this,"map");this._type=e,this.position=i}isVisible(){return this.visible}setVisible(e){this.visible=e,this.tryUpdateOptions()}getPosition(){return this.position}setPosition(e){this.position=e,this.tryUpdateOptions()}addTo(e){this.map||(this.map=e,this.setVisible(!0))}removeFrom(){this.map&&(this.setVisible(!1),this.map=void 0)}onCreateOptions(){return{position:a.ControlPositionConverter.getGoogle().toValue(this.position)}}tryUpdateOptions(){this.map&&this.map.innerMap.setOptions({[`${this._type}Control`]:this.visible,[`${this._type}ControlOptions`]:this.onCreateOptions()})}}var Rt=(r=>(r.normal="normal",r.satellite="satellite",r.hybrid="hybrid",r))(Rt||{});class W{constructor(t,e,i,n){this.id=t,this.baidu=e,this.google=i,this.googleCoordType=n}getId(){return this.id}getBaiduCoordType(){return R.bd09}asBaiduMapType(){return this.baidu()}getGoogleCoordType(){return this.googleCoordType}getGoogleMapTypeId(){return this.google()}asGoogleMapType(){He("google的内置地图没有对应的实例")}}class Er{constructor(t,e){f(this,"baiduLayerCached",new ce(()=>{const t=new BMap.TileLayer({});return t.getTilesUrl=(e,i)=>{const n=Math.pow(2,i-1),s=e.x+n,l=n-1-e.y;return this.options.getTileUrl({x:s,y:l},i)},t}));f(this,"baiduMapTypeCached",new ce(()=>{const t=new BMap.MapType(this.options.name,this.baiduLayerCached.get(),{maxZoom:this.options.maxZoom,minZoom:this.options.minZoom,tips:this.options.describe});return t.__baidu_map_type__=this,t}));f(this,"googleCached",new ce(()=>{const t=new google.maps.ImageMapType({getTileUrl:(e,i)=>this.options.getTileUrl(e,i),tileSize:new google.maps.Size(256,256),name:this.options.name,alt:this.options.describe,maxZoom:this.options.maxZoom,minZoom:this.options.minZoom});return t.__google_map_type__=this,t}));this.coordType=t,this.options=e}get id(){return this.options.id}getBaiduCoordType(){return this.coordType}asBaiduMapType(){return this.baiduMapTypeCached.get()}asBaiduLayer(){return this.baiduLayerCached.get()}getGoogleCoordType(){return this.coordType}asGoogleMapType(){return this.googleCached.get()}asGoogleLayer(){He("这个方法不会被调用")}}class li{constructor(){f(this,"baiduCache",new ce(()=>new BMap.TrafficLayer));f(this,"googleCache",new ce(()=>new google.maps.TrafficLayer))}asBaiduLayer(){return this.baiduCache.get()}asGoogleLayer(){return this.googleCache.get()}}a.MapType=void 0,(r=>{r.NORMAL=new W("normal",()=>BMAP_NORMAL_MAP,()=>google.maps.MapTypeId.ROADMAP,R.gcj02),r.SATELLITE=new W("satellite",()=>BMAP_SATELLITE_MAP,()=>google.maps.MapTypeId.SATELLITE,R.wgs84),r.HYBRID=new W("hybrid",()=>BMAP_HYBRID_MAP,()=>google.maps.MapTypeId.HYBRID,R.gcj02),r.TERRAIN=new W("terrain",()=>BMAP_PERSPECTIVE_MAP,()=>google.maps.MapTypeId.TERRAIN,R.wgs84),r.BUILD_IN_MAP_TYPES=new si([r.NORMAL,r.SATELLITE,r.HYBRID,r.TERRAIN])})(a.MapType||(a.MapType={}));var Dt=(r=>(r.DEFAULT="default",r.HORIZONTAL="horizontal",r.DROPDOWN="dropdown",r))(Dt||{});const hi=[a.MapType.NORMAL,a.MapType.SATELLITE,a.MapType.HYBRID];class Ue extends Fe{static create(t){const e=t.mapTypes??hi,i={default:BMAP_MAPTYPE_CONTROL_HORIZONTAL,horizontal:BMAP_MAPTYPE_CONTROL_HORIZONTAL,dropdown:BMAP_MAPTYPE_CONTROL_DROPDOWN},n=new BMap.MapTypeControl({type:t.type&&i[t.type],mapTypes:e.map(s=>s.asBaiduMapType())});return t.position&&n.setAnchor(a.ControlPositionConverter.getBaidu().toValue(t.position)),new Ue(n,t.position)}}const oe=class oe extends be{constructor(t="default",e=k.TOP_LEFT,i=hi){super("mapType",e),this.type=t,this.mapTypes=i,oe.type2google||(oe.type2google={default:google.maps.MapTypeControlStyle.DEFAULT,horizontal:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,dropdown:google.maps.MapTypeControlStyle.DROPDOWN_MENU})}static create(t){return new oe(t.type,t.position,t.mapTypes)}onCreateOptions(){const t=super.onCreateOptions();return t.style=oe.type2google[this.type],t.mapTypeIds=this.mapTypes.map(e=>e instanceof W?e.getGoogleMapTypeId():e.id),t}addTo(t){super.addTo(t),this.mapTypes.forEach(e=>{e instanceof W||t.innerMap.mapTypes.set(e.id,e.asGoogleMapType())})}};f(oe,"type2google");let Ye=oe;class qe extends Fe{static create(t){const e=new BMap.ScaleControl({anchor:t.position&&a.ControlPositionConverter.getBaidu().toValue(t.position)});return new qe(e,t.position)}}class Ke extends be{static create(t){return new Ke(t.position)}constructor(t=k.BOTTOM_RIGHT){super("scale",t)}}class Xe extends ai{static create(t){return new Xe(!0,t.position??k.RIGHT_BOTTOM)}}class Je extends be{static create(t){return new Je(t.position)}constructor(t=k.RIGHT_BOTTOM){super("streetView",t)}}class Qe extends Fe{static create(t){const e=new BMap.NavigationControl({type:BMAP_NAVIGATION_CONTROL_ZOOM,anchor:t.position&&a.ControlPositionConverter.getBaidu().toValue(t.position)});return new Qe(e,t.position)}}class et extends be{static create(t){return new et(t.position)}constructor(t=k.RIGHT_BOTTOM){super("zoom",t)}}function Pr(r){let t,e,i;const n="The Google Maps JavaScript API",s="google",l="importLibrary",d="__ib__",o=document,c=window,u=c[s]||(c[s]={}),g=u.maps||(u.maps={}),m=new Set,v=new URLSearchParams,C=()=>t||(t=new Promise(async(M,O)=>{var h;await(e=o.createElement("script")),v.set("libraries",[...m]+"");for(i in r)v.set(i.replace(/[A-Z]/g,p=>"_"+p[0].toLowerCase()),r[i]);v.set("callback",s+".maps."+d),e.src=`https://maps.${s}apis.com/maps/api/js?`+v,g[d]=M,e.onerror=()=>t=O(Error(n+" could not load.")),e.nonce=((h=o.querySelector("script[nonce]"))==null?void 0:h.nonce)||"",o.head.append(e)}));g[l]?console.warn(n+" only loads once. Ignoring:",r):g[l]=(M,...O)=>m.add(M)&&C().then(()=>g[l](M,...O))}let Lr,Br;const ie={get LATLNG_ZERO(){return Lr??(Lr=new google.maps.LatLng({lat:0,lng:0}))},get BOUNDS_ZERO(){return Br??(Br=new google.maps.LatLngBounds(this.LATLNG_ZERO,this.LATLNG_ZERO))}};function ci(r,t={country:"",province:"",city:"",district:"",street:"",streetNumber:""}){for(const e of r)for(const i of e.types)switch(i){case"street_number":t.streetNumber=e.long_name;break;case"route":t.street=e.long_name;break;case"locality":t.city=e.long_name;break;case"sublocality":t.district=e.long_name;break;case"administrative_area_level_1":t.province=e.long_name;break;case"country":t.country=e.long_name;break}return t}function di(r,t){var i;const e=r.address_components&&ci(r.address_components);return{country:(e==null?void 0:e.country)??"",province:(e==null?void 0:e.province)??"",city:(e==null?void 0:e.city)??"",id:r.place_id??"",address:r.formatted_address??"",position:w.fromGoogle(((i=r.geometry)==null?void 0:i.location)??ie.LATLNG_ZERO,t.coordType),title:r.name??""}}class $t{}class ui extends $t{constructor(e,i){super();f(this,"inner");this.map=e,this.inner=new google.maps.places.Autocomplete(i.input,{fields:["address_components","name"]}),i.bindToMap&&this.inner.bindTo("bounds",e.innerMap)}setBounds(e){this.inner.setBounds(e.toGoogle(this.map.coordType))}addResultListener(e){return ti(this.inner,"place_changed",()=>{const i=this.inner.getPlace(),n={title:i.name??"",province:"",city:"",district:"",street:"",streetNumber:"",country:""};i.address_components&&ci(i.address_components,n),e(n)})}}class pi extends $t{constructor(e,i){super();f(this,"inner");f(this,"input");f(this,"removeableArray",[]);if(this.map=e,this.input=i.input,this.inner=new BMap.Autocomplete({input:i.input,location:i.bindToMap?e.innerMap:void 0}),i.bindToMap){const n=()=>{this.inner.setLocation(this.map.innerMap)};this.removeableArray.push(ii(this.map,"center-changed",n)),this.removeableArray.push(ii(this.map,"zoom-changed",n))}}setBounds(e){this.inner.setLocation(e.getCenter().toBaidu(this.map.coordType))}addResultListener(e){let i=0;const n=Or(this.inner,"confirm",l=>{const d=l.item.value;i=Date.now(),e(Object.assign({title:d.business,country:""},d))}),s=wr(this.input,"keyup",l=>{l.key==="Enter"&&Date.now()-i>100&&e({title:this.input.value,country:"",city:"",district:"",province:"",street:"",streetNumber:""})});return()=>{s(),n()}}}var gi={exports:{}};(function(r,t){(function(e,i){r.exports=i()})(It,function(){const e=function(){var s={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.45:"rgb(0,0,255)",.55:"rgb(0,255,255)",.65:"rgb(0,255,0)",.95:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},l=function(){var v=function(O){this._coordinator={},this._data=[],this._radi=[],this._min=0,this._max=1,this._xField=O.xField||O.defaultXField,this._yField=O.yField||O.defaultYField,this._valueField=O.valueField||O.defaultValueField,O.radius&&(this._cfgRadius=O.radius)},C=s.defaultRadius;return v.prototype={_organiseData:function(M,O){var h=M[this._xField],p=M[this._yField],_=this._radi,b=this._data,E=this._max,P=this._min,B=M[this._valueField]||1,D=M.radius||this._cfgRadius||C;return b[h]||(b[h]=[],_[h]=[]),b[h][p]?b[h][p]+=B:(b[h][p]=B,_[h][p]=D),b[h][p]>E?(O?this.setDataMax(b[h][p]):this._max=b[h][p],!1):{x:h,y:p,value:B,radius:D,min:P,max:E}},_unOrganizeData:function(){var M=[],O=this._data,h=this._radi;for(var p in O)for(var _ in O[p])M.push({x:p,y:_,radius:h[p][_],value:O[p][_]});return{min:this._min,max:this._max,data:M}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var M=arguments[0],O=M.length;O--;)this.addData.call(this,M[O]);else{var h=this._organiseData(arguments[0],!0);h&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[h]})}return this},setData:function(M){var O=M.data,h=O.length;this._data=[],this._radi=[];for(var p=0;p<h;p++)this._organiseData(O[p],!1);return this._max=M.max,this._min=M.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(M){return this._max=M,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(M){return this._min=M,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(M){this._coordinator=M},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},v}(),d=function(){var v=function(h){var p=h.gradient||h.defaultGradient,_=document.createElement("canvas"),b=_.getContext("2d");_.width=256,_.height=1;var E=b.createLinearGradient(0,0,256,1);for(var P in p)E.addColorStop(P,p[P]);return b.fillStyle=E,b.fillRect(0,0,256,1),b.getImageData(0,0,256,1).data},C=function(h,p){var _=document.createElement("canvas"),b=_.getContext("2d"),E=h,P=h;if(_.width=_.height=h*2,p==1)b.beginPath(),b.arc(E,P,h,0,2*Math.PI,!1),b.fillStyle="rgba(0,0,0,1)",b.fill();else{var B=b.createRadialGradient(E,P,h*p,E,P,h);B.addColorStop(0,"rgba(0,0,0,1)"),B.addColorStop(1,"rgba(0,0,0,0)"),b.fillStyle=B,b.fillRect(0,0,2*h,2*h)}return _},M=function(P){for(var p=[],_=P.min,b=P.max,E=P.radi,P=P.data,B=Object.keys(P),D=B.length;D--;)for(var Z=B[D],S=Object.keys(P[Z]),ee=S.length;ee--;){var A=S[ee],q=P[Z][A],te=E[Z][A];p.push({x:Z,y:A,value:q,radius:te})}return{min:_,max:b,data:p}};function O(h){var p=h.element,_=this.shadowCanvas=document.createElement("canvas"),b=this.canvas=h.canvas||document.createElement("canvas");this._renderBoundaries=[1e4,1e4,0,0];var E=getComputedStyle(h.element)||{};b.className="heatmap-canvas",this._width=b.width=_.width=+E.width.replace(/px/,""),this._height=b.height=_.height=+E.height.replace(/px/,""),this.shadowCtx=_.getContext("2d"),this.ctx=b.getContext("2d"),b.style.cssText=_.style.cssText="position:absolute;left:0;top:0;",p.style.position="relative",p.appendChild(b),this._palette=v(h),this._templates={},this._setStyles(h)}return O.prototype={renderPartial:function(h){this._drawAlpha(h),this._colorize()},renderAll:function(h){this._clear(),this._drawAlpha(M(h)),this._colorize()},_updateGradient:function(h){this._palette=v(h)},updateConfig:function(h,p){h.gradient!==p.gradient&&this._updateGradient(h),this._setStyles(h)},setDimensions:function(h,p){this._width=h,this._height=p,this.canvas.width=this.shadowCanvas.width=h,this.canvas.height=this.shadowCanvas.height=p},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(h){this._blur=h.blur==0?0:h.blur||h.defaultBlur,h.backgroundColor&&(this.canvas.style.backgroundColor=h.backgroundColor),this._opacity=(h.opacity||0)*255,this._maxOpacity=(h.maxOpacity||h.defaultMaxOpacity)*255,this._minOpacity=(h.minOpacity||h.defaultMinOpacity)*255,this._useGradientOpacity=!!h.useGradientOpacity},_drawAlpha:function(b){for(var p=this._min=b.min,_=this._max=b.max,b=b.data||[],E=b.length,P=1-this._blur;E--;){var B=b[E],D=B.x,Z=B.y,S=B.radius,ee=Math.min(B.value,_),A=D-S,q=Z-S,te=this.shadowCtx,K;this._templates[S]?K=this._templates[S]:this._templates[S]=K=C(S,P),te.globalAlpha=(ee-p)/(_-p),te.drawImage(K,A,q),A<this._renderBoundaries[0]&&(this._renderBoundaries[0]=A),q<this._renderBoundaries[1]&&(this._renderBoundaries[1]=q),A+2*S>this._renderBoundaries[2]&&(this._renderBoundaries[2]=A+2*S),q+2*S>this._renderBoundaries[3]&&(this._renderBoundaries[3]=q+2*S)}},_colorize:function(){var h=this._renderBoundaries[0],p=this._renderBoundaries[1],_=this._renderBoundaries[2]-h,b=this._renderBoundaries[3]-p,E=this._width,P=this._height,B=this._opacity,D=this._maxOpacity,Z=this._minOpacity,S=this._useGradientOpacity;h<0&&(h=0),p<0&&(p=0),h+_>E&&(_=E-h),p+b>P&&(b=P-p);for(var ee=this.shadowCtx.getImageData(h,p,_,b),A=ee.data,q=A.length,te=this._palette,K=3;K<q;K+=4){var Bt=A[K],Re=Bt*4;if(Re){var De;B>0?De=B:Bt<D?Bt<Z?De=Z:De=Bt:De=D,A[K-3]=te[Re],A[K-2]=te[Re+1],A[K-1]=te[Re+2],A[K]=S?te[Re+3]:De}}this.ctx.putImageData(ee,h,p),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(h){var p,_=this.shadowCtx,b=_.getImageData(h.x,h.y,1,1),E=b.data[3],P=this._max,B=this._min;return p=Math.abs(P-B)*(E/255)>>0,p},getDataURL:function(){return this.canvas.toDataURL()}},O}(),o=function(){var v=!1;return s.defaultRenderer==="canvas2d"&&(v=d),v}(),c={merge:function(){for(var m={},v=arguments.length,C=0;C<v;C++){var M=arguments[C];for(var O in M)m[O]=M[O]}return m}},u=function(){var v=function(){function h(){this.cStore={}}return h.prototype={on:function(p,_,b){var E=this.cStore;E[p]||(E[p]=[]),E[p].push(function(P){return _.call(b,P)})},emit:function(p,_){var b=this.cStore;if(b[p])for(var E=b[p].length,P=0;P<E;P++){var B=b[p][P];B(_)}}},h}(),C=function(O){var h=O._renderer,p=O._coordinator,_=O._store;p.on("renderpartial",h.renderPartial,h),p.on("renderall",h.renderAll,h),p.on("extremachange",function(b){O._config.onExtremaChange&&O._config.onExtremaChange({min:b.min,max:b.max,gradient:O._config.gradient||O._config.defaultGradient})}),_.setCoordinator(p)};function M(){var O=this._config=c.merge(s,arguments[0]||{});if(this._coordinator=new v,O.plugin){var h=O.plugin;if(s.plugins[h]){var p=s.plugins[h];this._renderer=new p.renderer(O),this._store=new p.store(O)}else throw new Error("Plugin '"+h+"' not found. Maybe it was not registered.")}else this._renderer=new o(O),this._store=new l(O);C(this)}return M.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(O){const h=this._config;return this._config=c.merge(this._config,O),this._renderer.updateConfig(this._config,h),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(O){return this._store.getValueAt?this._store.getValueAt(O):this._renderer.getValueAt?this._renderer.getValueAt(O):null}},M}(),g={create:function(m){return new u(m)},register:function(m,v){s.plugins[m]=v}};return g}();var i=function(s){Reflect.getPrototypeOf(i.prototype)!==BMap.Overlay.prototype&&Reflect.setPrototypeOf(i.prototype,BMap.Overlay.prototype),this.conf=s,this.conf.visible=s.visible===void 0?!0:s.visible,this.heatmap=null,this.latlngs=[],this.bounds=null};i.prototype=Object.create(typeof BMap>"u"?null:BMap.Overlay.prototype),i.prototype.initialize=function(s){this._map=s;var l=document.createElement("div");if(l.style.position="absolute",l.style.top=0,l.style.left=0,l.style.border=0,l.style.width=this._map.getSize().width+"px",l.style.height=this._map.getSize().height+"px",this.conf.element=l,!n())return l;s.getPanes().mapPane.appendChild(l),this.conf.valueField=this.conf.valueField||"count",this.heatmap=e.create(this.conf);var d=this;return s.addEventListener("resize",function(o){var c=o.size;l.style.width=c.width+"px",l.style.height=c.height+"px",d.heatmap._renderer.setDimensions(c.width,c.height),d.draw()}),this._div=l,l},i.prototype.draw=function(){if(n()){var s=this._map.getBounds();if(!s.equals(this.bounds)){this.bounds=s;var l=this._map.pointToOverlayPixel(s.getNorthEast()),d=this._map.pointToOverlayPixel(s.getSouthWest()),o=l.y,c=d.x,u=d.y-l.y,g=l.x-d.x;if(this.conf.element.style.left=c+"px",this.conf.element.style.top=o+"px",this.conf.element.style.width=g+"px",this.conf.element.style.height=u+"px",this.latlngs.length>0){this.heatmap.removeData();var m=this.latlngs.length;const h={max:this.heatmap._store.getData().max,data:[]};for(;m--;){var v=this.latlngs[m].latlng;if(s.containsPoint(v)){var C=this._map.pointToOverlayPixel(v),c=this._map.pointToOverlayPixel(s.getSouthWest()).x,o=this._map.pointToOverlayPixel(s.getNorthEast()).y,M=new BMap.Pixel(C.x-c,C.y-o),O=this.pixelTransform(M);h.data.push({x:O.x,y:O.y,count:this.latlngs[m].c})}}this.conf.radiusChangeByZoom&&(this.heatmap._store._cfgRadius=this.conf.radiusChangeByZoom(this._map.getZoom())),this.heatmap.setData(h)}}}},i.prototype.pixelTransform=function(s){for(var l=this.heatmap.width,d=this.heatmap.height;s.x<0;)s.x+=l;for(;s.x>l;)s.x-=l;for(;s.y<0;)s.y+=d;for(;s.y>d;)s.y-=d;return s.x=s.x>>0,s.y=s.y>>0,s},i.prototype.setDataSet=function(s){if(this.data=s,!!n()){var l=this._map.getBounds(),d={max:s.max,data:[]},o=s.data,c=o.length;for(this.latlngs=[],this.heatmap.removeData(),this.conf.radiusChangeByZoom&&(this.heatmap._store._cfgRadius=this.conf.radiusChangeByZoom(this._map.getZoom()));c--;){var u=new BMap.Point(o[c].lng,o[c].lat);if(this.latlngs.push({latlng:u,c:o[c].count}),!!l.containsPoint(u)){var g=this._map.pointToOverlayPixel(u),m=this._map.pointToOverlayPixel(l.getSouthWest()).x,v=this._map.pointToOverlayPixel(l.getNorthEast()).y,C=new BMap.Pixel(g.x-m,g.y-v),M=this.pixelTransform(C);d.data.push({x:M.x,y:M.y,count:o[c].count})}}this.heatmap.setData(d)}},i.prototype.addDataPoint=function(s,l,d){if(n()){this.data&&this.data.data&&this.data.data.push({lng:s,lat:l,count:d});var o=new BMap.Point(s,l),c=this.pixelTransform(this._map.pointToOverlayPixel(o));this.heatmap.store.addDataPoint(c.x,c.y,d),this.latlngs.push({latlng:o,c:d})}},i.prototype.toggle=function(){n()&&(this.conf.visible===!0?this.conf.visible=!1:this.conf.visible=!0,this.conf.visible?this.conf.element.style.display="block":this.conf.element.style.display="none")},i.prototype.setOptions=function(s){if(n()){for(var l in s)l=="radius"&&(this.heatmap._store._cfgRadius=s[l]);this.heatmap.configure(s),this.data&&this.setDataSet(this.data)}};function n(){var s=document.createElement("canvas");return!!(s.getContext&&s.getContext("2d"))}return i})})(gi);var Ir=gi.exports;const Sr=ze(Ir),mi=10,tt={toGoogle:(r,t)=>({opacity:r.opacity,radius:r.radius??mi,gradient:r.gradient&&Object.entries(r.gradient).sort(([e],[i])=>+e-+i).map(([e,i])=>i),maxIntensity:r.maxIntensity,data:it.toGoogle(r.data,t)}),toBaidu:(r,t,e)=>({opacity:r.opacity,radius:r.radius??mi,gradient:r.gradient,data:it.toBaidu(r.data,t,e)})},it={toGoogle:(r,t)=>r.map(e=>"weight"in e?{weight:e.weight,location:e.position.toGoogle(t)}:e.toGoogle(t)),toBaidu:(r,t,e)=>{let i=1;return{data:r.map(s=>{let l,d;return"weight"in s?(l=s.position.to(t),d=s.weight):(l=s.to(t),d=1),i<d&&(i=d),{lng:l.lng,lat:l.lat,count:d}}),max:e??i}}};class zt{}class fi extends zt{constructor(e,i){super();f(this,"inner");this.map=e,this.inner=new google.maps.visualization.HeatmapLayer(tt.toGoogle(i,this.map.coordType)),this.inner.setMap(e.innerMap)}setData(e){this.inner.setData(it.toGoogle(e,this.map.coordType))}setOptions(e){this.inner.setOptions(tt.toGoogle(e,this.map.coordType))}remove(){this.inner.setMap(null)}}class yi extends zt{constructor(e,i){super();f(this,"inner");this.map=e;const n=tt.toBaidu(i,this.map.coordType,i.maxIntensity);this.inner=new Sr(n),e.innerMap.addOverlay(this.inner),this.inner.setDataSet(n.data)}get innerDataMax(){var e;return(e=this.inner.data)==null?void 0:e.max}set innerDataMax(e){var i;((i=this.inner).data??(i.data={})).max=e}setData(e){this.inner.setDataSet(it.toBaidu(e,this.map.coordType,this.innerDataMax))}setOptions(e){const i=tt.toBaidu(e,this.map.coordType,e.maxIntensity??this.innerDataMax);e.data!==this.inner.data?this.inner.setDataSet(i.data):e.maxIntensity&&(this.innerDataMax=e.maxIntensity),this.inner.setOptions(i)}remove(){this.map.innerMap.removeOverlay(this.inner)}}class Gt{constructor(t){this.options=t}}function Me(r,t,e){const i=new URL(t,r),n=new URLSearchParams(Object.entries(e).filter(Qt));return i.search="?"+n.toString(),i}function Nt(){const r=window.location.hostname.split(".").filter(t=>!a.Strings.isInt(t));return r.length===3?r.join("."):[...r,"tg","map","urls"].slice(0,3).join(".")}const xe=class xe extends Gt{directions(t,e,i){return Me(xe.BASE_URL,"dir/",{api:"1",origin:a.Location.toString(t,R.gcj02),destination:a.Location.toString(e,R.gcj02),travelmode:i})}search(t){return Me(xe.BASE_URL,"search/",{api:"1",query:a.Location.toString(t,R.gcj02)})}};f(xe,"BASE_URL","https://www.google.com/maps/");let rt=xe;const ve=class ve extends Gt{directions(t,e,i="driving"){const n=a.Location.getCoordType(e)??a.Location.getCoordType(t)??R.bd09,s=a.Location.toString(e,n);return Me(ve.BASE_URL,"direction",{origin:a.Location.toString(t,n)??(typeof e!="string"?`name:请选择起点|latlng:${s}`:s),destination:s,coord_type:n===R.bd09?void 0:n,mode:i,output:"html",region:"中国",src:Nt()})}search(t){return typeof t=="string"?this.geocoderApi(t):this.latlngApi(t)}latlngApi(t){const e=t.to(R.bd09);return new URL(`https://map.baidu.com/?latlng=${e.lat},${e.lng}`)}markerApi(t,e,i){return Me(ve.BASE_URL,"marker",{location:`${t.lat},${t.lng}`,coord_type:t.coord===R.bd09?void 0:t.coord,title:e,content:i,output:"html",src:Nt()})}geocoderApi(t){return Me(ve.BASE_URL,"geocoder",{...typeof t=="string"?{address:t}:{location:`${t.lat},${t.lng}`,coord_type:t.coord===R.bd09?void 0:t.coord},output:"html",src:Nt()})}};f(ve,"BASE_URL","https://api.map.baidu.com/");let nt=ve,kr=class pr{constructor(t,e,i){this.extend(pr,google.maps.OverlayView),this.map_=t,this.MARKER_CLUSTER_IMAGE_PATH_="../images/m",this.MARKER_CLUSTER_IMAGE_EXTENSION_="png",this.markers_=[],this.clusters_=[],this.sizes=[53,56,66,78,90],this.styles_=[],this.ready_=!1;var n=i||{};this.zIndex_=n.zIndex||google.maps.Marker.MAX_ZINDEX+1,this.gridSize_=n.gridSize||60,this.minClusterSize_=n.minimumClusterSize||2,this.maxZoom_=n.maxZoom||null,this.styles_=n.styles||[],this.imagePath_=n.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_,this.imageExtension_=n.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_,this.zoomOnClick_=!0,n.zoomOnClick!=null&&(this.zoomOnClick_=n.zoomOnClick),this.averageCenter_=!1,n.averageCenter!=null&&(this.averageCenter_=n.averageCenter),this.setupStyles_(),this.setMap(t),this.prevZoom_=this.map_.getZoom();var s=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var l=s.map_.getZoom(),d=s.map_.minZoom||0,o=Math.min(s.map_.maxZoom||100,s.map_.mapTypes[s.map_.getMapTypeId()].maxZoom);l=Math.min(Math.max(l,d),o),s.prevZoom_!=l&&(s.prevZoom_=l,s.resetViewport())}),google.maps.event.addListener(this.map_,"idle",function(){s.redraw()}),e&&(e.length||Object.keys(e).length)&&this.addMarkers(e,!1)}extend(t,e){return(function(i){for(var n in i.prototype)this.prototype[n]=i.prototype[n];return this}).apply(t,[e])}onAdd(){this.setReady_(!0)}draw(){}setupStyles_(){if(!this.styles_.length)for(var t=0,e;e=this.sizes[t];t++)this.styles_.push({url:this.imagePath_+(t+1)+"."+this.imageExtension_,height:e,width:e})}fitMapToMarkers(){for(var t=this.getMarkers(),e=new google.maps.LatLngBounds,i=0,n;n=t[i];i++)e.extend(n.getPosition());this.map_.fitBounds(e)}setZIndex(t){this.zIndex_=t}getZIndex(){return this.zIndex_}setStyles(t){this.styles_=t}getStyles(){return this.styles_}isZoomOnClick(){return this.zoomOnClick_}isAverageCenter(){return this.averageCenter_}getMarkers(){return this.markers_}getTotalMarkers(){return this.markers_.length}setMaxZoom(t){this.maxZoom_=t}getMaxZoom(){return this.maxZoom_}calculator_(t,e){for(var i=0,n=t.length,s=n;s!==0;)s=parseInt(s/10,10),i++;return i=Math.min(i,e),{text:n,index:i}}setCalculator(t){this.calculator_=t}getCalculator(){return this.calculator_}addMarkers(t,e){if(t.length)for(let i=0,n;n=t[i];i++)this.pushMarkerTo_(n);else if(Object.keys(t).length)for(let i in t)this.pushMarkerTo_(t[i]);e||this.redraw()}pushMarkerTo_(t){if(t.isAdded=!1,t.draggable){var e=this;google.maps.event.addListener(t,"dragend",function(){t.isAdded=!1,e.repaint()})}this.markers_.push(t)}addMarker(t,e){this.pushMarkerTo_(t),e||this.redraw()}removeMarker_(t){var e=-1;if(this.markers_.indexOf)e=this.markers_.indexOf(t);else for(var i=0,n;n=this.markers_[i];i++)if(n==t){e=i;break}return e==-1?!1:(t.setMap(null),this.markers_.splice(e,1),!0)}removeMarker(t,e){var i=this.removeMarker_(t);return!e&&i?(this.resetViewport(),this.redraw(),!0):!1}removeMarkers(t,e){for(var i=t===this.getMarkers()?t.slice():t,n=!1,s=0,l;l=i[s];s++){var d=this.removeMarker_(l);n=n||d}if(!e&&n)return this.resetViewport(),this.redraw(),!0}setReady_(t){this.ready_||(this.ready_=t,this.createClusters_())}getTotalClusters(){return this.clusters_.length}getMap(){return this.map_}setMap(t){this.map_=t}getGridSize(){return this.gridSize_}setGridSize(t){this.gridSize_=t}getMinClusterSize(){return this.minClusterSize_}setMinClusterSize(t){this.minClusterSize_=t}getExtendedBounds(t){var e=this.getProjection(),i=new google.maps.LatLng(t.getNorthEast().lat(),t.getNorthEast().lng()),n=new google.maps.LatLng(t.getSouthWest().lat(),t.getSouthWest().lng()),s=e.fromLatLngToDivPixel(i);s.x+=this.gridSize_,s.y-=this.gridSize_;var l=e.fromLatLngToDivPixel(n);l.x-=this.gridSize_,l.y+=this.gridSize_;var d=e.fromDivPixelToLatLng(s),o=e.fromDivPixelToLatLng(l);return t.extend(d),t.extend(o),t}isMarkerInBounds_(t,e){return e.contains(t.getPosition())}clearMarkers(){this.resetViewport(!0),this.markers_=[]}resetViewport(t){for(let e=0,i;i=this.clusters_[e];e++)i.remove();for(let e=0,i;i=this.markers_[e];e++)i.isAdded=!1,t&&i.setMap(null);this.clusters_=[]}repaint(){var t=this.clusters_.slice();this.clusters_.length=0,this.resetViewport(),this.redraw(),setTimeout(function(){for(var e=0,i;i=t[e];e++)i.remove()},0)}redraw(){this.createClusters_()}distanceBetweenPoints_(t,e){if(!t||!e)return 0;var i=6371,n=(e.lat()-t.lat())*Math.PI/180,s=(e.lng()-t.lng())*Math.PI/180,l=Math.sin(n/2)*Math.sin(n/2)+Math.cos(t.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(s/2)*Math.sin(s/2),d=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),o=i*d;return o}addToClosestCluster_(t){for(var e=4e4,i=null,n=0,s;s=this.clusters_[n];n++){var l=s.getCenter();if(l){var d=this.distanceBetweenPoints_(l,t.getPosition());d<e&&(e=d,i=s)}}if(i&&i.isMarkerInClusterBounds(t))i.addMarker(t);else{var o=new xr(this);o.addMarker(t),this.clusters_.push(o)}}createClusters_(){if(this.ready_)for(var t=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast()),e=this.getExtendedBounds(t),i=0,n;n=this.markers_[i];i++)!n.isAdded&&this.isMarkerInBounds_(n,e)&&this.addToClosestCluster_(n)}},xr=class{constructor(t){this.markerClusterer_=t,this.map_=t.getMap(),this.gridSize_=t.getGridSize(),this.minClusterSize_=t.getMinClusterSize(),this.averageCenter_=t.isAverageCenter(),this.center_=null,this.markers_=[],this.bounds_=null,this.clusterIcon_=new Zt(this,t.getStyles(),t.getGridSize())}isMarkerAlreadyAdded(t){if(this.markers_.indexOf)return this.markers_.indexOf(t)!=-1;for(var e=0,i;i=this.markers_[e];e++)if(i==t)return!0;return!1}addMarker(t){if(this.isMarkerAlreadyAdded(t))return!1;if(!this.center_)this.center_=t.getPosition(),this.calculateBounds_();else if(this.averageCenter_){var e=this.markers_.length+1,i=(this.center_.lat()*(e-1)+t.getPosition().lat())/e,n=(this.center_.lng()*(e-1)+t.getPosition().lng())/e;this.center_=new google.maps.LatLng(i,n),this.calculateBounds_()}t.isAdded=!0,this.markers_.push(t);var s=this.markers_.length;if(s<this.minClusterSize_&&t.getMap()!=this.map_&&t.setMap(this.map_),s==this.minClusterSize_)for(var l=0;l<s;l++)this.markers_[l].setMap(null);return s>=this.minClusterSize_&&t.setMap(null),this.updateIcon(),!0}getMarkerClusterer(){return this.markerClusterer_}getBounds(){for(var t=new google.maps.LatLngBounds(this.center_,this.center_),e=this.getMarkers(),i=0,n;n=e[i];i++)t.extend(n.getPosition());return t}remove(){this.clusterIcon_.remove(),this.markers_.length=0,delete this.markers_}getSize(){return this.markers_.length}getMarkers(){return this.markers_}getCenter(){return this.center_}calculateBounds_(){var t=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(t)}isMarkerInClusterBounds(t){return this.bounds_.contains(t.getPosition())}getMap(){return this.map_}updateIcon(){var t=this.map_.getZoom(),e=this.markerClusterer_.getMaxZoom();if(e&&t>e){for(var i=0,n;n=this.markers_[i];i++)n.setMap(this.map_);return}if(this.markers_.length<this.minClusterSize_){this.clusterIcon_.hide();return}var s=this.markerClusterer_.getStyles().length,l=this.markerClusterer_.getCalculator()(this.markers_,s);this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.setSums(l),this.clusterIcon_.show()}};class Zt{constructor(t,e,i){t.getMarkerClusterer().extend(Zt,google.maps.OverlayView),this.styles_=e,this.padding_=i||0,this.cluster_=t,this.center_=null,this.map_=t.getMap(),this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(this.map_)}triggerClusterClick(){var t=this.cluster_.getBounds(),e=this.cluster_.getMarkerClusterer();google.maps.event.trigger(e.map_,"clusterclick",this.cluster_),e.isZoomOnClick()&&(this.map_.fitBounds(t),this.map_.setCenter(t.getCenter()))}onAdd(){if(this.div_=document.createElement("DIV"),this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(t),this.div_.innerHTML=this.sums_.text}var e=this.getPanes();e.overlayMouseTarget.appendChild(this.div_);var i=this;google.maps.event.addDomListener(this.div_,"click",function(){i.triggerClusterClick()})}getPosFromLatLng_(t){var e=this.getProjection().fromLatLngToDivPixel(t);return e.x-=parseInt(this.width_/2,10),e.y-=parseInt(this.height_/2,10),e}draw(){if(this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.top=t.y+"px",this.div_.style.left=t.x+"px"}}hide(){this.div_&&(this.div_.style.display="none"),this.visible_=!1}show(){if(this.div_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(t),this.div_.style.display=""}this.visible_=!0}remove(){this.setMap(null)}onRemove(){this.div_&&this.div_.parentNode&&(this.hide(),this.div_.parentNode.removeChild(this.div_),this.div_=null)}setSums(t){this.sums_=t,this.text_=t.text,this.index_=t.index,this.div_&&(this.div_.innerHTML=t.text),this.useStyle()}useStyle(){var t=Math.max(0,this.sums_.index-1);t=Math.min(this.styles_.length-1,t);var e=this.styles_[t];this.url_=e.url,this.height_=e.height,this.width_=e.width,this.textColor_=e.textColor,this.anchor_=e.anchor,this.textSize_=e.textSize,this.backgroundPosition_=e.backgroundPosition}setCenter(t){this.center_=t}createCss(t){var e=[];e.push("z-index:"+this.cluster_.markerClusterer_.getZIndex()+";"),e.push("background-image:url("+this.url_+");");var i=this.backgroundPosition_?this.backgroundPosition_:"0 0";e.push("background-position:"+i+";"),typeof this.anchor_=="object"?(typeof this.anchor_[0]=="number"&&this.anchor_[0]>0&&this.anchor_[0]<this.height_?e.push("height:"+(this.height_-this.anchor_[0])+"px; padding-top:"+this.anchor_[0]+"px;"):e.push("height:"+this.height_+"px; line-height:"+this.height_+"px;"),typeof this.anchor_[1]=="number"&&this.anchor_[1]>0&&this.anchor_[1]<this.width_?e.push("width:"+(this.width_-this.anchor_[1])+"px; padding-left:"+this.anchor_[1]+"px;"):e.push("width:"+this.width_+"px; text-align:center;")):e.push("height:"+this.height_+"px; line-height:"+this.height_+"px; width:"+this.width_+"px; text-align:center;");var n=this.textColor_?this.textColor_:"black",s=this.textSize_?this.textSize_:11;return e.push("cursor:pointer; top:"+t.y+"px; left:"+t.x+"px; color:"+n+"; position:absolute; font-size:"+s+"px; font-family:Arial,sans-serif; font-weight:bold"),e.join("")}}var vi={exports:{}};(function(r,t){(function(e,i){r.exports=i()})(It,function(){var e,i=e=i||{version:"1.3.8"},n={};i.guid="$BAIDU$",n[i.guid]=n[i.guid]||{},i.dom=i.dom||{},i.dom.g=function(o){return typeof o=="string"||o instanceof String?document.getElementById(o):o&&o.nodeName&&(o.nodeType==1||o.nodeType==9)?o:null},i.g=i.G=i.dom.g,i.dom.getDocument=function(o){return o=i.dom.g(o),o.nodeType==9?o:o.ownerDocument||o.document},i.lang=i.lang||{},i.lang.isString=function(o){return Object.prototype.toString.call(o)=="[object String]"},i.isString=i.lang.isString,i.dom._g=function(o){return i.lang.isString(o)?document.getElementById(o):o},i._g=i.dom._g,i.browser=i.browser||{},/msie (\d+\.\d)/i.test(navigator.userAgent)&&(i.browser.ie=i.ie=document.documentMode||+RegExp.$1),i.dom.getComputedStyle=function(o,c){o=i.dom._g(o);var u=i.dom.getDocument(o),g;return u.defaultView&&u.defaultView.getComputedStyle&&(g=u.defaultView.getComputedStyle(o,null),g)?g[c]||g.getPropertyValue(c):""},i.dom._styleFixer=i.dom._styleFixer||{},i.dom._styleFilter=i.dom._styleFilter||[],i.dom._styleFilter.filter=function(o,c,u){for(var g=0,m=i.dom._styleFilter,v;v=m[g];g++)(v=v[u])&&(c=v(o,c));return c},i.string=i.string||{},i.string.toCamelCase=function(o){return o.indexOf("-")<0&&o.indexOf("_")<0?o:o.replace(/[-_][^-_]/g,function(c){return c.charAt(1).toUpperCase()})},i.dom.getStyle=function(o,c){var u=i.dom;o=u.g(o),c=i.string.toCamelCase(c);var g=o.style[c]||(o.currentStyle?o.currentStyle[c]:"")||u.getComputedStyle(o,c);if(!g){var m=u._styleFixer[c];m&&(g=m.get?m.get(o):i.dom.getStyle(o,m))}return(m=u._styleFilter)&&(g=m.filter(c,g,"get")),g},i.getStyle=i.dom.getStyle,/opera\/(\d+\.\d)/i.test(navigator.userAgent)&&(i.browser.opera=+RegExp.$1),i.browser.isWebkit=/webkit/i.test(navigator.userAgent),i.browser.isGecko=/gecko/i.test(navigator.userAgent)&&!/like gecko/i.test(navigator.userAgent),i.browser.isStrict=document.compatMode=="CSS1Compat",i.dom.getPosition=function(o){o=i.dom.g(o);var c=i.dom.getDocument(o),u=i.browser,g=i.dom.getStyle;u.isGecko>0&&c.getBoxObjectFor&&g(o,"position")=="absolute"&&(o.style.top===""||o.style.left);var m={left:0,top:0},v=u.ie&&!u.isStrict?c.body:c.documentElement,C,M;if(o==v)return m;if(o.getBoundingClientRect){M=o.getBoundingClientRect(),m.left=Math.floor(M.left)+Math.max(c.documentElement.scrollLeft,c.body.scrollLeft),m.top=Math.floor(M.top)+Math.max(c.documentElement.scrollTop,c.body.scrollTop),m.left-=c.documentElement.clientLeft,m.top-=c.documentElement.clientTop;var O=c.body,h=parseInt(g(O,"borderLeftWidth")),p=parseInt(g(O,"borderTopWidth"));u.ie&&!u.isStrict&&(m.left-=isNaN(h)?2:h,m.top-=isNaN(p)?2:p)}else{C=o;do{if(m.left+=C.offsetLeft,m.top+=C.offsetTop,u.isWebkit>0&&g(C,"position")=="fixed"){m.left+=c.body.scrollLeft,m.top+=c.body.scrollTop;break}C=C.offsetParent}while(C&&C!=o);for((u.opera>0||u.isWebkit>0&&g(o,"position")=="absolute")&&(m.top-=c.body.offsetTop),C=o.offsetParent;C&&C!=c.body;)m.left-=C.scrollLeft,(!u.opera||C.tagName!="TR")&&(m.top-=C.scrollTop),C=C.offsetParent}return m},i.event=i.event||{},i.event._listeners=i.event._listeners||[],i.event.on=function(o,c,u){c=c.replace(/^on/i,""),o=i.dom._g(o);var g=function(O){u.call(o,O)},m=i.event._listeners,v=i.event._eventFilter,C,M=c;return c=c.toLowerCase(),v&&v[c]&&(C=v[c](o,c,g),M=C.type,g=C.listener),o.addEventListener?o.addEventListener(M,g,!1):o.attachEvent&&o.attachEvent("on"+M,g),m[m.length]=[o,c,u,g,M],o},i.on=i.event.on,function(){var o=n[i.guid];i.lang.guid=function(){return"TANGRAM__"+(o._counter++).toString(36)},o._counter=o._counter||1}(),n[i.guid]._instances=n[i.guid]._instances||{},i.lang.isFunction=function(o){return Object.prototype.toString.call(o)=="[object Function]"},i.lang.Class=function(o){this.guid=o||i.lang.guid(),n[i.guid]._instances[this.guid]=this},n[i.guid]._instances=n[i.guid]._instances||{},i.lang.Class.prototype.dispose=function(){delete n[i.guid]._instances[this.guid];for(var o in this)i.lang.isFunction(this[o])||delete this[o];this.disposed=!0},i.lang.Class.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"},i.lang.Event=function(o,c){this.type=o,this.returnValue=!0,this.target=c||null,this.currentTarget=null},i.lang.Class.prototype.addEventListener=function(o,c,u){if(i.lang.isFunction(c)){!this.__listeners&&(this.__listeners={});var g=this.__listeners,m;if(typeof u=="string"&&u){if(/[^\w\-]/.test(u))throw"nonstandard key:"+u;c.hashCode=u,m=u}o.indexOf("on")!=0&&(o="on"+o),typeof g[o]!="object"&&(g[o]={}),m=m||i.lang.guid(),c.hashCode=m,g[o][m]=c}},i.lang.Class.prototype.removeEventListener=function(o,c){if(!(typeof c<"u"&&(i.lang.isFunction(c)&&!(c=c.hashCode)||!i.lang.isString(c)))){!this.__listeners&&(this.__listeners={}),o.indexOf("on")!=0&&(o="on"+o);var u=this.__listeners;if(u[o])if(typeof c<"u")u[o][c]&&delete u[o][c];else for(var g in u[o])delete u[o][g]}},i.lang.Class.prototype.dispatchEvent=function(o,c){i.lang.isString(o)&&(o=new i.lang.Event(o)),!this.__listeners&&(this.__listeners={}),c=c||{};for(var u in c)o[u]=c[u];var u,g=this.__listeners,m=o.type;if(o.target=o.target||this,o.currentTarget=this,m.indexOf("on")!=0&&(m="on"+m),i.lang.isFunction(this[m])&&this[m].apply(this,arguments),typeof g[m]=="object")for(u in g[m])g[m][u].apply(this,arguments);return o.returnValue},i.lang.inherits=function(o,c,u){var g,m,v=o.prototype,C=new Function;C.prototype=c.prototype,m=o.prototype=new C;for(g in v)m[g]=v[g];o.prototype.constructor=o,o.superClass=c.prototype,typeof u=="string"&&(m._className=u)},i.inherits=i.lang.inherits;var s="http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m",l="png",d=function(o,c,u){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}e.lang.inherits(d,BMap.Overlay,"TextIconOverlay"),this._position=o,this._text=c,this._options=u||{},this._styles=this._options.styles||[],this._zIndex=this._options.zIndex,!this._styles.length&&this._setupDefaultStyles()};return d.prototype._setupDefaultStyles=function(){for(var o=[53,56,66,78,90],c=0,u;u=o[c];c++)this._styles.push({url:s+c+"."+l,size:new BMap.Size(u,u)})},d.prototype.initialize=function(o){return this._map=o,this._domElement=document.createElement("div"),this._updateCss(),this._updateText(),this._updatePosition(),this._bind(),this._map.getPanes().markerMouseTarget.appendChild(this._domElement),this._domElement},d.prototype.draw=function(){this._map&&this._updatePosition()},d.prototype.getText=function(){return this._text},d.prototype.setText=function(o){o&&(!this._text||this._text.toString()!=o.toString())&&(this._text=o,this._updateText(),this._updateCss(),this._updatePosition())},d.prototype.getPosition=function(){return this._position},d.prototype.setPosition=function(o){o&&(!this._position||!this._position.equals(o))&&(this._position=o,this._updatePosition())},d.prototype.getStyleByText=function(o,c){var u=parseInt(o),g=parseInt(u/10);return g=Math.max(0,g),g=Math.min(g,c.length-1),c[g]},d.prototype._updateCss=function(){if(this._domElement){var o=this.getStyleByText(this._text,this._styles);this._domElement.style.cssText=this._buildCssText(o)}},d.prototype._updateText=function(){this._domElement&&(this._domElement.innerHTML=this._text)},d.prototype._updatePosition=function(){if(this._domElement&&this._position){var o=this._domElement.style,c=this._map.pointToOverlayPixel(this._position);c.x-=Math.ceil(parseInt(o.width)/2),c.y-=Math.ceil(parseInt(o.height)/2),o.left=c.x+"px",o.top=c.y+"px"}},d.prototype._buildCssText=function(o){var c=o.url,u=o.size,g=o.anchor,m=o.offset,v=o.textColor||"black",C=o.textSize||10,M=[];if(this._zIndex&&M.push("z-index:"+this._zIndex+";"),e.browser.ie<7)M.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="'+c+'");');else{M.push("background-image:url("+c+");");var O="0 0";m instanceof BMap.Size&&(O=m.width+"px "+m.height+"px"),M.push("background-position:"+O+";")}return u instanceof BMap.Size&&(g instanceof BMap.Size?(g.height>0&&g.height<u.height&&M.push("height:"+(u.height-g.height)+"px; padding-top:"+g.height+"px;"),g.width>0&&g.width<u.width&&M.push("width:"+(u.width-g.width)+"px; padding-left:"+g.width+"px;")):(M.push("height:"+u.height+"px; line-height:"+u.height+"px;"),M.push("width:"+u.width+"px; text-align:center;"))),M.push("cursor:pointer; color:"+v+"; position:absolute; font-size:"+C+"px; font-family:Arial,sans-serif; font-weight:bold"),M.join("")},d.prototype._bind=function(){if(!this._domElement)return;var o=this,c=this._map,u=e.lang.Event;function g(m,v){var C=m.srcElement||m.target,M=m.clientX||m.pageX,O=m.clientY||m.pageY;if(m&&v&&M&&O&&C){var h=e.dom.getPosition(c.getContainer());v.pixel=new BMap.Pixel(M-h.left,O-h.top),v.point=c.pixelToPoint(v.pixel)}return v}e.event.on(this._domElement,"mouseover",function(m){o.dispatchEvent(g(m,new u("onmouseover")))}),e.event.on(this._domElement,"mouseout",function(m){o.dispatchEvent(g(m,new u("onmouseout")))}),e.event.on(this._domElement,"click",function(m){o.dispatchEvent(g(m,new u("onclick")))})},d})})(vi);var Ar=vi.exports;const _i=ze(Ar);var bi=function(r,t,e){t=Rr(t);var i=r.pointToPixel(t.getNorthEast()),n=r.pointToPixel(t.getSouthWest());i.x+=e,i.y-=e,n.x-=e,n.y+=e;var s=r.pixelToPoint(i),l=r.pixelToPoint(n);return new BMap.Bounds(l,s)},Rr=function(r){var t=st(r.getNorthEast().lng,-180,180),e=st(r.getSouthWest().lng,-180,180),i=st(r.getNorthEast().lat,-74,74),n=st(r.getSouthWest().lat,-74,74);return new BMap.Bounds(new BMap.Point(e,n),new BMap.Point(t,i))},st=function(r,t,e){return t&&(r=Math.max(r,t)),e&&(r=Math.min(r,e)),r},Mi=function(r){return Object.prototype.toString.call(r)==="[object Array]"},Ti=function(r,t){var e=-1;if(Mi(t)){if(t.indexOf)e=t.indexOf(r);else for(var i=0,n;n=t[i];i++)if(n===r){e=i;break}}return e},L=function(r,t){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}if(r){this._map=r,this._markers=[],this._clusters=[];var e=t||{};this._zIndex=e.zIndex,this._gridSize=e.gridSize||60,this._maxZoom=e.maxZoom||18,this._minClusterSize=e.minClusterSize||2,this._isAverageCenter=!1,e.isAverageCenter!=null&&(this._isAverageCenter=e.isAverageCenter),this._styles=e.styles||[];var i=this;this._map.addEventListener("zoomend",function(){i._redraw()}),this._map.addEventListener("moveend",function(){i._redraw()});var n=e.markers;Mi(n)&&this.addMarkers(n)}};L.prototype.addMarkers=function(r){if(r.length){for(var t=0,e=r.length;t<e;t++)this._pushMarkerTo(r[t]);this._createClusters()}},L.prototype._pushMarkerTo=function(r){var t=Ti(r,this._markers);t===-1&&(r.isInCluster=!1,this._markers.push(r))},L.prototype.addMarker=function(r){this._pushMarkerTo(r),this._createClusters()},L.prototype._createClusters=function(){var r=this._map.getBounds();if(r.getCenter()){for(var t=bi(this._map,r,this._gridSize),e=0,i;i=this._markers[e];e++)!i.isInCluster&&t.containsPoint(i.getPosition())&&this._addToClosestCluster(i);for(var n=this._markers.length,e=0;e<n;e++)this._clusters[e]&&this._clusters[e].render()}},L.prototype._addToClosestCluster=function(r){var t=4e6,e=null;r.getPosition();for(var i=0,n;n=this._clusters[i];i++){var s=n.getCenter();if(s){var l=this._map.getDistance(s,r.getPosition());l<t&&(t=l,e=n)}}if(e&&e.isMarkerInClusterBounds(r))e.addMarker(r);else{var n=new F(this);n.addMarker(r),this._clusters.push(n)}},L.prototype._clearLastClusters=function(){for(var r=0,t;t=this._clusters[r];r++)t.remove();this._clusters=[],this._removeMarkersFromCluster()},L.prototype._removeMarkersFromCluster=function(){for(var r=0,t;t=this._markers[r];r++)t.isInCluster=!1},L.prototype._removeMarkersFromMap=function(){for(var r=0,t;t=this._markers[r];r++){t.isInCluster=!1;var e=t.getLabel();this._map.removeOverlay(t),t.setLabel(e)}},L.prototype._removeMarker=function(r){var t=Ti(r,this._markers);return t===-1?!1:(this._map.removeOverlay(r),this._markers.splice(t,1),!0)},L.prototype.removeMarker=function(r){var t=this._removeMarker(r);return t&&(this._clearLastClusters(),this._createClusters()),t},L.prototype.removeMarkers=function(r){for(var t=!1,e=0;e<r.length;e++){var i=this._removeMarker(r[e]);t=t||i}return t&&(this._clearLastClusters(),this._createClusters()),t},L.prototype.clearMarkers=function(){this._clearLastClusters(),this._removeMarkersFromMap(),this._markers=[]},L.prototype._redraw=function(){this._clearLastClusters(),this._createClusters()},L.prototype.getGridSize=function(){return this._gridSize},L.prototype.setGridSize=function(r){this._gridSize=r,this._redraw()},L.prototype.getMaxZoom=function(){return this._maxZoom},L.prototype.setMaxZoom=function(r){this._maxZoom=r,this._redraw()},L.prototype.getZIndex=function(){return this._zIndex},L.prototype.setZIndex=function(r){this._zIndex!=r&&(this.zIndex=r,this._redraw())},L.prototype.getStyles=function(){return this._styles},L.prototype.setStyles=function(r){this._styles=r,this._redraw()},L.prototype.getMinClusterSize=function(){return this._minClusterSize},L.prototype.setMinClusterSize=function(r){this._minClusterSize=r,this._redraw()},L.prototype.isAverageCenter=function(){return this._isAverageCenter},L.prototype.getMap=function(){return this._map},L.prototype.getMarkers=function(){return this._markers},L.prototype.getClustersCount=function(){for(var r=0,t=0,e;e=this._clusters[t];t++)e.isReal()&&r++;return r},L.prototype._textCalculator=function(r){return r.length.toString()},L.prototype._stylesIndexCalculator=null,L.prototype.setTextCalculator=function(r){this._textCalculator=r},L.prototype.setStylesIndexCalculator=function(r){this._stylesIndexCalculator=r};function F(r){var t=this;this._markerClusterer=r,this._map=r.getMap(),this._minClusterSize=r.getMinClusterSize(),this._isAverageCenter=r.isAverageCenter(),this._center=null,this._markers=[],this._gridBounds=null,this._isReal=!1,this._clusterMarker=new _i(this._center,this._markers.length,{styles:this._markerClusterer.getStyles(),zIndex:r._zIndex}),this._clusterMarker.getStyleByText=function(e,i){if(t._markerClusterer._stylesIndexCalculator){var n=t._markerClusterer._stylesIndexCalculator(t._markers,i.length);return i[n]}return _i.prototype.getStyleByText.call(this,e,i)},this._clusterMarker.addEventListener&&this._clusterMarker.addEventListener("click",function(e){t._map.setViewport(t.getBounds())})}F.prototype.addMarker=function(r){if(this.isMarkerInCluster(r))return!1;if(!this._center)this._center=r.getPosition(),this.updateGridBounds();else if(this._isAverageCenter){var t=this._markers.length+1,e=(this._center.lat*(t-1)+r.getPosition().lat)/t,i=(this._center.lng*(t-1)+r.getPosition().lng)/t;this._center=new BMap.Point(i,e),this.updateGridBounds()}return r.isInCluster=!0,this._markers.push(r),!0},F.prototype.render=function(){var r=this._markers.length;if(r<this._minClusterSize)for(var t=0;t<r;t++)this._map.addOverlay(this._markers[t]);else this._map.addOverlay(this._clusterMarker),this._isReal=!0,this.updateClusterMarker()},F.prototype.isMarkerInCluster=function(r){if(this._markers.indexOf)return this._markers.indexOf(r)!=-1;for(var t=0,e;e=this._markers[t];t++)if(e===r)return!0;return!1},F.prototype.isMarkerInClusterBounds=function(r){return this._gridBounds.containsPoint(r.getPosition())},F.prototype.isReal=function(r){return this._isReal},F.prototype.updateGridBounds=function(){var r=new BMap.Bounds(this._center,this._center);this._gridBounds=bi(this._map,r,this._markerClusterer.getGridSize())},F.prototype.updateClusterMarker=function(){if(this._map.getZoom()>this._markerClusterer.getMaxZoom()){this._clusterMarker&&this._map.removeOverlay(this._clusterMarker);for(var r=0,t;t=this._markers[r];r++)this._map.addOverlay(t);return}if(this._markers.length<this._minClusterSize){this._clusterMarker.hide();return}this._clusterMarker.setPosition(this._center),this._clusterMarker.setText(this._markerClusterer._textCalculator(this._markers))},F.prototype.remove=function(){for(var r=0,t;t=this._markers[r];r++){var e=this._markers[r].getLabel();this._markers[r].getMap()&&this._map.removeOverlay(this._markers[r]),this._markers[r].setLabel(e)}this._map.removeOverlay(this._clusterMarker),this._markers.length=0,delete this._markers},F.prototype.getBounds=function(){for(var r=new BMap.Bounds(this._center,this._center),t=0,e;e=this._markers[t];t++)r.extend(e.getPosition());return r},F.prototype.getCenter=function(){return this._center};var ot;(r=>{function t(i){return{url:i.url,size:new BMap.Size(i.size.width,i.size.height),anchor:i.anchor&&new BMap.Size(i.anchor.x,i.anchor.y),offset:i.offset&&new BMap.Size(i.offset.x,i.offset.y),textColor:i.textColor,textSize:i.textSize}}r.toBaidu=t;function e(i){return{url:i.url,width:i.size.width,height:i.size.height,anchor:i.anchor&&[i.anchor.y,i.anchor.x],backgroundPosition:i.offset&&`${i.offset.x} ${i.offset.y}`,textColor:i.textColor,textSize:i.textSize}}r.toGoogle=e})(ot||(ot={}));class Wt{constructor(t){this.map=t}clearMarkers(){this.inner.clearMarkers()}addMarker(t){this.inner.addMarker(t.innerOverlay)}removeMarker(t){return this.inner.removeMarker(t.innerOverlay)}addMarkers(t){this.inner.addMarkers(t.map(e=>e.innerOverlay))}removeMarkers(t){return this.inner.removeMarkers(t.map(e=>e.innerOverlay))}}class Ci extends Wt{constructor(e,i){var s;super(e);f(this,"inner");this.inner=new L(e.innerMap,{gridSize:i.gridSize,maxZoom:i.maxZoom,minClusterSize:i.minClusterSize,isAverageCenter:i.averageCenter,styles:(s=i.styles)==null?void 0:s.map(l=>ot.toBaidu(l)),zIndex:i.zIndex});const n=i.stylesIndexCalculator;n&&this.inner.setStylesIndexCalculator((l,d)=>n(l.length,d)),i.markers&&this.addMarkers(i.markers)}recreate(){this.inner._redraw()}}class Oi extends Wt{constructor(e,i){var s,l;super(e);f(this,"inner");this.inner=new kr(e.innerMap,(s=i.markers)==null?void 0:s.map(d=>d.innerOverlay),{gridSize:i.gridSize,maxZoom:i.maxZoom,minimumClusterSize:i.minClusterSize,averageCenter:i.averageCenter,styles:(l=i.styles)==null?void 0:l.map(d=>ot.toGoogle(d)),zIndex:i.zIndex});const n=i.stylesIndexCalculator;n&&this.inner.setCalculator((d,o)=>({text:d.length,index:n(d.length,o)+1}))}recreate(){this.inner.repaint()}}class Ht{constructor(){}}class wi extends Ht{constructor(e,i){super();f(this,"inner");this.map=e,this.inner=new google.maps.places.PlacesService(e.innerMap)}search(e,i){return this.searchImpl(e,i instanceof w?i.toGoogle(this.map.coordType):i??this.map.innerMap.getCenter())}searchInBounds(e,i){return this.searchImpl(e,i.toGoogle(this.map.coordType))}searchNearBy(e,i,n){return this.searchImpl(e,{center:i.toGoogle(this.map.coordType),radius:n})}searchImpl(e,i){return new Promise((n,s)=>{this.inner.findPlaceFromQuery({query:e,fields:["formatted_address","geometry","name","place_id"],locationBias:i},(l,d)=>{switch(d){case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:case google.maps.places.PlacesServiceStatus.OK:{const o=(l??[]).map(c=>di(c,this.map));n(o);break}default:s(new Error(`status: ${d}`));break}})})}}class Ei extends Ht{constructor(e,i){super();f(this,"searchRequestMap",new Map);f(this,"currentSearch");this.map=e}get inner(){return this.currentSearch}search(e,i){return this.newSearch(i instanceof w?i.toBaidu(this.map.coordType):i??this.map.innerMap.getCenter(),n=>{n.search(e)})}searchInBounds(e,i){return this.newSearch(void 0,n=>{n.searchInBounds(e,i.toBaidu(this.map.coordType))})}searchNearBy(e,i,n){return this.newSearch(void 0,s=>{s.searchNearby(e,i.toBaidu(this.map.coordType),n)})}newSearch(e,i){return new Promise((n,s)=>{const l=new BMap.LocalSearch(e??this.map.innerMap,{onSearchComplete:d=>{Array.isArray(d)&&He("当前只支持一次搜索一条数据");const o=l.getStatus();switch(o){case BMAP_STATUS_SUCCESS:{const c=[];for(let u=0;u<d.getCurrentNumPois();u++){const g=d.getPoi(u);c.push({id:g.uid,city:g.city,country:"",position:w.fromBaidu(g.point,this.map.coordType),province:g.province,title:g.title,address:g.address})}n(c);break}case BMAP_STATUS_UNKNOWN_LOCATION:n([]);break;default:s(new Error(`status: ${o}`));break}}});i(l)})}}class Vt{constructor(t,e){f(this,"onData");f(this,"onError");this.map=t,this.input=e}setSearchListener(t,e){return this.onData&&I("setSearchListener只能调用一次"),this.onData=t,this.onError=e,le}}class Pi extends Vt{constructor(e,i){super(e,i.input);f(this,"searchBox");this.searchBox=new google.maps.places.SearchBox(i.input),this.searchBox.bindTo("bounds",e.innerMap)}setSearchListener(e,i){return super.setSearchListener(e,i),ti(this.searchBox,"places_changed",()=>{const n=this.searchBox.getPlaces();e((n??[]).map(s=>di(s,this.map)))})}search(){this.input.value&&(google.maps.event.trigger(this.input,"focus",{}),google.maps.event.trigger(this.input,"keydown",{keyCode:13}))}}class Li extends Vt{constructor(e,i){super(e,i.input);f(this,"autocomplete");f(this,"placesService");this.autocomplete=e.createAutocomplete({input:i.input,bindToMap:!0}),this.placesService=e.createPlacesService({})}setSearchListener(e,i){return super.setSearchListener(e,i),this.autocomplete.addResultListener(n=>{this.searchImpl(n.country+n.province+n.city+n.district+n.street+n.streetNumber+n.title)})}search(){this.input.value&&this.searchImpl(this.input.value)}searchImpl(e){this.placesService.search(e).then(this.onData,this.onError)}}var Bi=(r=>(r[r.WORLD=1]="WORLD",r[r.STATE=5]="STATE",r[r.CITY=10]="CITY",r[r.STREET=15]="STREET",r[r.BUILDING=20]="BUILDING",r))(Bi||{});class at{constructor(t){f(this,"latestInfoWindow");f(this,"delegate",void 0);this.element=t,process.env.NODE_ENV!=="production"&&setTimeout(()=>{this.delegate||console.warn(`${this.constructor.name}继承了AbstractMap, 但未调用setEventTargetDelegate(delegate)`)})}setEventTargetDelegate(t){this.delegate=t.setTarget(this)}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}getLatestInfoWindow(){return this.latestInfoWindow}setLatestInfoWindowInternal(t){this.latestInfoWindow=t}addOverlayMapType(t){this.addLayer(t)}removeOverlayMapType(t){this.removeLayer(t)}addControl(t){t.addTo(this)}removeControl(t){t.removeFrom(this)}getZoom(){return this.innerMap.getZoom()??0}setZoom(t){this.innerMap.setZoom(t)}}var Dr=function(t){return $r(t)&&!zr(t)};function $r(r){return!!r&&typeof r=="object"}function zr(r){var t=Object.prototype.toString.call(r);return t==="[object RegExp]"||t==="[object Date]"||Zr(r)}var Gr=typeof Symbol=="function"&&Symbol.for,Nr=Gr?Symbol.for("react.element"):60103;function Zr(r){return r.$$typeof===Nr}function Wr(r){return Array.isArray(r)?[]:{}}function Te(r,t){return t.clone!==!1&&t.isMergeableObject(r)?de(Wr(r),r,t):r}function Hr(r,t,e){return r.concat(t).map(function(i){return Te(i,e)})}function Vr(r,t){if(!t.customMerge)return de;var e=t.customMerge(r);return typeof e=="function"?e:de}function jr(r){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r).filter(function(t){return Object.propertyIsEnumerable.call(r,t)}):[]}function Ii(r){return Object.keys(r).concat(jr(r))}function Si(r,t){try{return t in r}catch{return!1}}function Fr(r,t){return Si(r,t)&&!(Object.hasOwnProperty.call(r,t)&&Object.propertyIsEnumerable.call(r,t))}function Ur(r,t,e){var i={};return e.isMergeableObject(r)&&Ii(r).forEach(function(n){i[n]=Te(r[n],e)}),Ii(t).forEach(function(n){Fr(r,n)||(Si(r,n)&&e.isMergeableObject(t[n])?i[n]=Vr(n,e)(r[n],t[n],e):i[n]=Te(t[n],e))}),i}function de(r,t,e){e=e||{},e.arrayMerge=e.arrayMerge||Hr,e.isMergeableObject=e.isMergeableObject||Dr,e.cloneUnlessOtherwiseSpecified=Te;var i=Array.isArray(t),n=Array.isArray(r),s=i===n;return s?i?e.arrayMerge(r,t,e):Ur(r,t,e):Te(t,e)}de.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(i,n){return de(i,n,e)},{})};var Yr=de,qr=Yr;const ki=ze(qr);/*!
2
+ (function(a,y){typeof exports=="object"&&typeof module<"u"?y(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],y):(a=typeof globalThis<"u"?globalThis:a||self,y(a.TgMap={},a.Vue))})(this,function(a,y){"use strict";var Vn=Object.defineProperty;var jn=(a,y,$)=>y in a?Vn(a,y,{enumerable:!0,configurable:!0,writable:!0,value:$}):a[y]=$;var f=(a,y,$)=>(jn(a,typeof y!="symbol"?y+"":y,$),$);function $(r,t,e){Object.keys(r).forEach(i=>{i.startsWith("update:")||e!=null&&e.includes(i)||t.addEventListener(i,r[i])})}let gr=1;function mr(){return gr++}function $e(r,t){return t.__id__||(t.__id__=mr()),`${r}::${t.__id__}`}var St=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ze(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Jt={exports:{}};(function(r){(function(t,e){r.exports?r.exports=e():t.coordtransform=e()})(St,function(){var t=52.35987755982988,e=3.141592653589793,i=6378245,n=.006693421622965943;function s(h,p,_,b){this.west=Math.min(h,_),this.north=Math.max(p,b),this.east=Math.max(h,_),this.south=Math.min(p,b)}s.prototype.contain=function(h,p){return this.west<=h&&this.east>=h&&this.north>=p&&this.south<=p};var l=[new s(79.4462,49.2204,96.33,42.8899),new s(109.6872,54.1415,135.0002,39.3742),new s(73.1246,42.8899,124.143255,29.5297),new s(82.9684,29.5297,97.0352,26.7186),new s(97.0253,29.5297,124.367395,20.414096),new s(107.975793,20.414096,111.744104,17.871542)],d=[new s(119.921265,25.398623,122.497559,21.785006),new s(101.8652,22.284,106.665,20.0988),new s(106.4525,21.5422,108.051,20.4878),new s(109.0323,55.8175,119.127,50.3257),new s(127.4568,55.8175,137.0227,49.5574),new s(131.2662,44.8922,137.0227,42.5692),new s(73.1246,35.398637,77.948114,29.5297)],o=[new s(114.505238,22.138258,113.845,22.428903),new s(113.97,22.507833,114.45,22.428903)];function c(h,p,_=!0){for(var b=0;b<l.length;b++)if(l[b].contain(h,p)){for(var E=0;E<d.length;E++)if(d[E].contain(h,p))return!1;if(_){for(var E=0;E<o.length;E++)if(o[E].contain(h,p))return!1}return!0}return!1}function u(h,p){var _=h-.0065,b=p-.006,E=Math.sqrt(_*_+b*b)-2e-5*Math.sin(b*t),P=Math.atan2(b,_)-3e-6*Math.cos(_*t),B=E*Math.cos(P),D=E*Math.sin(P);return[B,D]}function g(h,p){var _=Math.sqrt(h*h+p*p)+2e-5*Math.sin(p*t),b=Math.atan2(p,h)+3e-6*Math.cos(h*t),E=_*Math.cos(b)+.0065,P=_*Math.sin(b)+.006;return[E,P]}function m(h,p){return C(h,p)}function v(h,p){var _=C(h,p);return[h*2-_[0],p*2-_[1]]}function C(h,p){var _=M(h-105,p-35),b=O(h-105,p-35),E=p/180*e,P=Math.sin(E);P=1-n*P*P;var B=Math.sqrt(P);_=_*180/(i*(1-n)/(P*B)*e),b=b*180/(i/B*Math.cos(E)*e);var D=p+_,Z=h+b;return[Z,D]}function M(h,p){var _=-100+2*h+3*p+.2*p*p+.1*h*p+.2*Math.sqrt(Math.abs(h));return _+=(20*Math.sin(6*h*e)+20*Math.sin(2*h*e))*2/3,_+=(20*Math.sin(p*e)+40*Math.sin(p/3*e))*2/3,_+=(160*Math.sin(p/12*e)+320*Math.sin(p*e/30))*2/3,_}function O(h,p){var _=300+h+2*p+.1*h*h+.1*h*p+.1*Math.sqrt(Math.abs(h));return _+=(20*Math.sin(6*h*e)+20*Math.sin(2*h*e))*2/3,_+=(20*Math.sin(h*e)+40*Math.sin(h/3*e))*2/3,_+=(150*Math.sin(h/12*e)+300*Math.sin(h/30*e))*2/3,_}return{rawBd09ToGcj02:u,rawGcj02ToBd09:g,rawWgs84ToGcj02:m,rawGcj02ToWgs84:v,bd09ToGcj02:u,gcj02ToBd09:g,wgs84ToGcj02:function(h,p){return c(h,p)?m(h,p):[h,p]},gcj02ToWgs84:function(h,p){return c(h,p)?v(h,p):[h,p]},bd09ToWgs84:function(h,p){if(!c(h,p,!1))return[h,p];var _=u(h,p);return v(_[0],_[1])},wgs84ToBd09:function(h,p){if(!c(h,p,!1))return[h,p];var _=m(h,p);return g(_[0],_[1])}}})})(Jt);var fr=Jt.exports;const ae=ze(fr);a.Arrays=void 0,(r=>{function t(d,o){return d.length===o.length&&d.every((c,u)=>c===o[u])}r.equals=t;function e(d,o){const c=d.indexOf(o);if(c!==-1)return d.splice(c,1)[0]}r.remove=e;function i(d,o){for(const c of d)if(c instanceof o)return c}r.findByType=i;function n(d,o){return d.includes(o)}r.includesTyped=n;function s(d,o,c){const u=o>=0?o:d.length+o;if(c===void 0)return d[u];d[u]=c}r.at=s;function l(d){return d.length>0}r.isNotEmpty=l})(a.Arrays||(a.Arrays={})),a.MVCArrays=void 0,(r=>{function t(n,s){const l=n.getLength();for(let d=0;d<l;d++)if(n.getAt(d)===s)return d;return-1}r.indexOf=t;function e(n,s){const l=t(n,s);if(l!==-1)return n.removeAt(l)}r.remove=e;function i(n,s){return[n.addListener("insert_at",s),n.addListener("remove_at",s),n.addListener("set_at",s)]}r.listenChanged=i})(a.MVCArrays||(a.MVCArrays={}));function ne(r,t){if(!r)throw new Error(`AssertionError: ${t}`)}function Ge(r){throw new Error(`Unexpected object: ${r}`)}function yr(){}function Ne(r){return r}function vr(r,t){return r instanceof t}function _r(r,t){if(r instanceof t)return r}function Ze(r,t){return(r==null?void 0:r.$options.name)===t.name}function kt(r,t){return Ze(r,t)?r:void 0}function We(r,t,e){let i=t;for(;i;){if(Ze(i,r))return i;if(e&&Ze(i,e))return;i=i.$parent}}function br(r){return r}function I(r){throw new Error(r)}function He(r){throw new Error(`Unsupported: ${r}`)}function Mr(r){throw new Error(`todo: ${r}`)}function Tr(r){return r}function le(...r){}function Cr(r){return r!=null}function Qt(r){return r[1]!=null}function ei(r){let t=null;return()=>t??(t=r().catch(e=>(t=null,Promise.reject(e))))}var R=(r=>(r.wgs84="wgs84",r.gcj02="gcj02",r.bd09="bd09",r))(R||{});const Ve="wgs84",G=class G{constructor(t,e,i){this.lat=t,this.lng=e,this.coord=i}static _normalize(t,e){const i=e>90?90:e<-90?-90:e;return[t>180?(t+180)%360-180:t<-180?(t-180)%360+180:t,i]}static fromBaidu(t,e){return new G(t.lat,t.lng,e)}static fromGoogle(t,e){return new G(t.lat(),t.lng(),e)}static fromHere(t,e){return new G(t.lat,t.lng,e)}static fromLiteral(t){return new G(t.lat,t.lng,t.coord||Ve)}static fromPartialLiteral(t){return new G((t==null?void 0:t.lat)??0,(t==null?void 0:t.lng)??0,(t==null?void 0:t.coord)||Ve)}static fromLngLat(t,e,i=Ve){return new G(e,t,i)}static create(t,e,i=Ve){return new G(t,e,i)}to(t){const e=t;if(this.coord===e)return this;const[i,n]=this._convert(e);return new G(n,i,e)}toBaidu(t,e=!1){let i=this.lat,n=this.lng;return this.coord!==t&&([n,i]=this._convert(t)),e&&([n,i]=G._normalize(n,i)),new BMap.Point(n,i)}toGoogle(t){let e=this.lat,i=this.lng;return this.coord!==t&&([i,e]=this._convert(t)),new google.maps.LatLng(e,i)}toHere(t){let e=this.lat,i=this.lng;return this.coord!==t&&([i,e]=this._convert(t)),new H.geo.Point(e,i)}_convert(t){switch(this.coord){case"bd09":return t==="gcj02"?ae.bd09ToGcj02(this.lng,this.lat):ae.bd09ToWgs84(this.lng,this.lat);case"gcj02":return t==="wgs84"?ae.gcj02ToWgs84(this.lng,this.lat):ae.gcj02ToBd09(this.lng,this.lat);case"wgs84":return t==="bd09"?ae.wgs84ToBd09(this.lng,this.lat):ae.wgs84ToGcj02(this.lng,this.lat)}throw new Error(`不支持的坐标转换: ${this.coord}=>${t}`)}normalize(){const[t,e]=G._normalize(this.lng,this.lat);return e===this.lat&&t===this.lng?this:new G(e,t,this.coord)}equals(t){return this===t?!0:this.lat===t.lat&&this.lng===t.lng&&this.coord===t.coord}toString(){return JSON.stringify(this)}};f(G,"ZERO",G.create(0,0));let w=G;const re=class re{constructor(t,e){f(this,"coord");this.sw=t,this.ne=e,ne(t.coord===e.coord,"sw和ne的coord应该相同"),ne(Number.isFinite(t.lat)&&Number.isFinite(t.lng)&&Number.isFinite(e.lat)&&Number.isFinite(e.lng),`sw(${t})和ne(${e})不能包含NaN或Infinite`),ne(t.lat<=e.lat,`sw.lat(${t.lat})应该比ne.lat(${e.lat})小`),this.coord=t.coord}static isBetweenLng(t,e,i){return t<=e?t<=i&&i<=e:t<=i||i<=e}static fromArray(t){if(t.length===0)return;const e=new re.Builder(t[0]);for(let i=1;i<t.length;i++)e.include(t[i]);return e.build()}static from(...t){return this.fromArray(t)??I("positions中没有点")}static fromGoogle(t,e){return new re(w.fromGoogle(t.getSouthWest(),e),w.fromGoogle(t.getNorthEast(),e))}static fromBaidu(t,e){return new re(w.fromBaidu(t.getSouthWest(),e),w.fromBaidu(t.getNorthEast(),e))}static create(t,e){return this.from(t,e)}isEmpty(){return this.sw.equals(this.ne)}contains(t){const{lat:e,lng:i}=t.to(this.coord);return this.sw.lat<=e&&e<=this.ne.lat&&re.isBetweenLng(this.sw.lng,this.ne.lng,i)}getCenter(){if(this.sw.equals(this.ne))return this.sw;const t=(this.sw.lat+this.ne.lat)/2,e=(this.sw.lng+this.ne.lng+(this.sw.lng<this.ne.lng?0:360))/2;return w.create(t,e,this.coord)}toString(){return JSON.stringify(this)}equals(t){return this.sw.equals(t.sw)&&this.ne.equals(t.ne)}toRectArray(){const t=this.sw.coord;return[this.sw,w.fromLngLat(this.sw.lng,this.ne.lat,t),this.ne,w.fromLngLat(this.ne.lng,this.sw.lat,t)]}toGoogle(t){return new google.maps.LatLngBounds(this.sw.toGoogle(t),this.ne.toGoogle(t))}toBaidu(t){return new BMap.Bounds(this.sw.toBaidu(t),this.ne.toBaidu(t))}toBaiduArray(t){return[this.sw.toBaidu(t),this.ne.toBaidu(t)]}};f(re,"EMPTY",new re(w.ZERO,w.ZERO));let j=re;(r=>{class t{constructor(i){f(this,"coord");f(this,"minLat");f(this,"minLng");f(this,"maxLat");f(this,"maxLng");this.coord=i.coord,this.minLat=this.maxLat=i.lat,this.minLng=this.maxLng=i.lng}build(){return new r(w.create(this.minLat,this.minLng,this.coord),w.create(this.maxLat,this.maxLng,this.coord))}include(i){const{lat:n,lng:s}=i.to(this.coord);return this.minLat=Math.min(this.minLat,n),this.maxLat=Math.max(this.maxLat,n),r.isBetweenLng(this.minLng,this.maxLng,s)||(this.delta(this.minLng,s)<this.delta(s,this.maxLng)?this.minLng=s:this.maxLng=s),this}delta(i,n){return(i-n+360)%360}}r.Builder=t})(j||(j={})),a.Location=void 0,(r=>{function t(i,n){if(i==null)return;if(typeof i=="string")return i;const s=i.to(n);return`${s.lat},${s.lng}`}r.toString=t;function e(i){return typeof i=="string"||i==null?void 0:i.coord}r.getCoordType=e})(a.Location||(a.Location={}));var xt;(r=>{function t(e){return e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight}r.isScrollable=t})(xt||(xt={}));function ti(r,t,e){return r.addListener(t,e).remove}function Or(r,t,e){return r.addEventListener(t,e),()=>r.removeEventListener(t,e)}function wr(r,t,e,i){return r.addEventListener(t,e,i),()=>r.removeEventListener(t,e,i)}function ii(r,t,e){return r.addEventListener(t,e),()=>r.removeEventListener(t,e)}class ri{constructor(t,e){f(this,"eventMap",new Map);f(this,"target",void 0);this.inner=t,this.coordTypeSupplier=e,this.addEventListener=this.addEventListener.bind(this),this.removeEventListener=this.removeEventListener.bind(this)}setTarget(t){return this.target=t,this}}class je{constructor(t,e){f(this,"eventHub",new ni);this.delegate=t,this.options=e}notify(t){this.eventHub.notify(t)}hasListener(t){return this.eventHub.hasListener(t)}setTarget(t){return this.delegate.setTarget(t),this}addEventListener(t,e){if(a.Arrays.includesTyped(this.options.types,t)){this.eventHub.hasListener(t)||this.options.onListen(t),this.eventHub.addEventListener(t,e);return}this.delegate.addEventListener(t,e)}removeEventListener(t,e){if(a.Arrays.includesTyped(this.options.types,t)){this.eventHub.removeEventListener(t,e),this.eventHub.hasListener(t)||this.options.onCancel(t);return}this.delegate.removeEventListener(t,e)}}const Bt=class Bt extends ri{addEventListener(t,e){const i=$e(t,e);if(this.eventMap.get(i)){console.warn("listener已经添加过了",i,e);return}const n=this.inner.addListener(Bt.EVENT_TYPE_MAP[t]||t,s=>{const l={type:t,target:this.target,originalEvent:s};s!=null&&s.latLng&&(l.position=w.fromGoogle(s.latLng,this.coordTypeSupplier.coordType)),e.call(this.target,l)});this.eventMap.set(i,n)}removeEventListener(t,e){const i=$e(t,e),n=this.eventMap.get(i);n?(n.remove(),this.eventMap.delete(i)):console.warn("移除失败, 不存在该listener",i,e)}};f(Bt,"EVENT_TYPE_MAP",{"center-changed":"center_changed","zoom-changed":"zoom_changed","radius-changed":"radius_changed","bounds-changed":"bounds_changed","map-type-changed":"maptypeid_changed","map-mousedown":"mousedown","map-mousemove":"mousemove","map-mouseup":"mouseup","map-dblclick":"dblclick"});let he=Bt;const ke=class ke extends ri{addEventListener(t,e){const i=$e(t,e);if(this.eventMap.get(i)){console.warn("listener已经添加过了",i,e);return}const n=s=>{const l={type:t,target:this.target,originalEvent:s};s.point&&(l.position=w.fromBaidu(s.point,this.coordTypeSupplier.coordType)),e.call(this.target,l)};this.inner.addEventListener(ke.EVENT_TYPE_MAP[t]||t,n),this.eventMap.set(i,n)}removeEventListener(t,e){const i=$e(t,e),n=this.eventMap.get(i);n?(this.inner.removeEventListener(ke.EVENT_TYPE_MAP[t]||t,n),this.eventMap.delete(i)):console.warn("移除失败, 不存在该listener",i,e)}};f(ke,"EVENT_TYPE_MAP",{drag:"dragging",closeclick:"clickclose",contextmenu:"rightclick","zoom-changed":"zoomend","map-type-changed":"maptypechange"});let _e=ke;class ni{constructor(){f(this,"typeMap",new Map)}addEventListener(t,e){let i=this.typeMap.get(t);i||(i=[],this.typeMap.set(t,i)),!i.includes(e)&&i.push(e)}removeEventListener(t,e){const i=this.typeMap.get(t);i&&a.Arrays.remove(i,e)}hasListener(t){const e=this.typeMap.get(t);return e!=null&&e.length>0}notify(t){const e=this.typeMap.get(t.type);e&&e.forEach(i=>i.call(t.target,t))}}class At{constructor(t,e){f(this,"keyToValue",new Map);f(this,"valueToKey",new Map);ne(t.length===e.length);for(let i=t.length-1;i>=0;i--)this.keyToValue.set(t[i],e[i]),this.valueToKey.set(e[i],t[i])}toKey(t){return this.valueToKey.get(t)??I()}toValue(t){return this.keyToValue.get(t)??I()}}class si{constructor(t,e=10){f(this,"map",new Map);this.values=t,this.maxSize4Debug=e}getValueMap(t){let e=this.map.get(t);if(!e){e=new Map;for(let i=this.values.length-1;i>=0;i--){const n=this.values[i];e.set(t.call(n),n)}this.map.set(t,e),process.env.NODE_ENV!=="production"&&this.map.size>this.maxSize4Debug&&console.warn(`this.map的大小(${this.map.size})超过了设置的最大大小(${this.maxSize4Debug}), 这可能是由于你每次都创建新的keySelector造成的, 请保证相同功能的keySelector只创建一个对象`)}return e}getOrNull(t,e){return this.getValueMap(t).get(e)}get(t,e){return this.getOrNull(t,e)??I(`key(${e})不存在与valueMap(${this.getValueMap(t)})中`)}}class ce{constructor(t){f(this,"value");this.creator=t}get(){return this.value===void 0&&(this.value=this.creator()),this.value}}var k=(r=>(r.TOP_LEFT="top-left",r.TOP_CENTER="top-center",r.TOP_RIGHT="top-right",r.BOTTOM_LEFT="bottom-left",r.BOTTOM_CENTER="bottom-center",r.BOTTOM_RIGHT="bottom-right",r.LEFT_TOP="left-top",r.LEFT_CENTER="left-center",r.LEFT_BOTTOM="left-bottom",r.RIGHT_TOP="right-top",r.RIGHT_CENTER="right-center",r.RIGHT_BOTTOM="right-bottom",r))(k||{});a.ControlPositionConverter=void 0,(r=>{let t,e;const i=["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right","left-top","left-center","left-bottom","right-top","right-center","right-bottom"];function n(){return t||(t=new At(i,[BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_TOP_RIGHT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_RIGHT,BMAP_ANCHOR_TOP_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_BOTTOM_LEFT,BMAP_ANCHOR_TOP_RIGHT,BMAP_ANCHOR_BOTTOM_RIGHT,BMAP_ANCHOR_BOTTOM_RIGHT])),t}r.getBaidu=n;function s(){return e||(e=new At(i,[google.maps.ControlPosition.TOP_LEFT,google.maps.ControlPosition.TOP_CENTER,google.maps.ControlPosition.TOP_RIGHT,google.maps.ControlPosition.BOTTOM_LEFT,google.maps.ControlPosition.BOTTOM_CENTER,google.maps.ControlPosition.BOTTOM_RIGHT,google.maps.ControlPosition.LEFT_TOP,google.maps.ControlPosition.LEFT_CENTER,google.maps.ControlPosition.LEFT_BOTTOM,google.maps.ControlPosition.RIGHT_TOP,google.maps.ControlPosition.RIGHT_CENTER,google.maps.ControlPosition.RIGHT_BOTTOM])),e}r.getGoogle=s})(a.ControlPositionConverter||(a.ControlPositionConverter={}));class oi{constructor(t){f(this,"inner");this.position=t}}class Fe{}class ai extends Fe{constructor(t,e){super(),this.visible=t,this.position=e}isVisible(){return this.visible}setVisible(t){this.visible=t}getPosition(){return this.position}setPosition(t){this.position=t}addTo(t){}removeFrom(t){}}class Ue extends Fe{constructor(t,e){super(),this.inner=t,this.position=e}isVisible(){return this.inner.isVisible()}setVisible(t){t?this.inner.show():this.inner.hide()}getPosition(){return this.position??a.ControlPositionConverter.getBaidu().toKey(this.inner.getAnchor())}setPosition(t){this.position=t,this.inner.setAnchor(a.ControlPositionConverter.getBaidu().toValue(t))}addTo(t){t.innerMap.addControl(this.inner)}removeFrom(t){t.innerMap.removeControl(this.inner)}}class be extends Fe{constructor(e,i){super();f(this,"visible",!1);f(this,"map");this._type=e,this.position=i}isVisible(){return this.visible}setVisible(e){this.visible=e,this.tryUpdateOptions()}getPosition(){return this.position}setPosition(e){this.position=e,this.tryUpdateOptions()}addTo(e){this.map||(this.map=e,this.setVisible(!0))}removeFrom(){this.map&&(this.setVisible(!1),this.map=void 0)}onCreateOptions(){return{position:a.ControlPositionConverter.getGoogle().toValue(this.position)}}tryUpdateOptions(){this.map&&this.map.innerMap.setOptions({[`${this._type}Control`]:this.visible,[`${this._type}ControlOptions`]:this.onCreateOptions()})}}var Rt=(r=>(r.normal="normal",r.satellite="satellite",r.hybrid="hybrid",r))(Rt||{});class W{constructor(t,e,i,n){this.id=t,this.baidu=e,this.google=i,this.googleCoordType=n}getId(){return this.id}getBaiduCoordType(){return R.bd09}asBaiduMapType(){return this.baidu()}getGoogleCoordType(){return this.googleCoordType}getGoogleMapTypeId(){return this.google()}asGoogleMapType(){He("google的内置地图没有对应的实例")}}class Er{constructor(t,e){f(this,"baiduLayerCached",new ce(()=>{const t=new BMap.TileLayer({});return t.getTilesUrl=(e,i)=>{const n=Math.pow(2,i-1),s=e.x+n,l=n-1-e.y;return this.options.getTileUrl({x:s,y:l},i)},t}));f(this,"baiduMapTypeCached",new ce(()=>{const t=new BMap.MapType(this.options.name,this.baiduLayerCached.get(),{maxZoom:this.options.maxZoom,minZoom:this.options.minZoom,tips:this.options.describe});return t.__baidu_map_type__=this,t}));f(this,"googleCached",new ce(()=>{const t=new google.maps.ImageMapType({getTileUrl:(e,i)=>this.options.getTileUrl(e,i),tileSize:new google.maps.Size(256,256),name:this.options.name,alt:this.options.describe,maxZoom:this.options.maxZoom,minZoom:this.options.minZoom});return t.__google_map_type__=this,t}));this.coordType=t,this.options=e}get id(){return this.options.id}getBaiduCoordType(){return this.coordType}asBaiduMapType(){return this.baiduMapTypeCached.get()}asBaiduLayer(){return this.baiduLayerCached.get()}getGoogleCoordType(){return this.coordType}asGoogleMapType(){return this.googleCached.get()}asGoogleLayer(){He("这个方法不会被调用")}}class li{constructor(){f(this,"baiduCache",new ce(()=>new BMap.TrafficLayer));f(this,"googleCache",new ce(()=>new google.maps.TrafficLayer))}asBaiduLayer(){return this.baiduCache.get()}asGoogleLayer(){return this.googleCache.get()}}a.MapType=void 0,(r=>{r.NORMAL=new W("normal",()=>BMAP_NORMAL_MAP,()=>google.maps.MapTypeId.ROADMAP,R.gcj02),r.SATELLITE=new W("satellite",()=>BMAP_SATELLITE_MAP,()=>google.maps.MapTypeId.SATELLITE,R.wgs84),r.HYBRID=new W("hybrid",()=>BMAP_HYBRID_MAP,()=>google.maps.MapTypeId.HYBRID,R.gcj02),r.TERRAIN=new W("terrain",()=>BMAP_PERSPECTIVE_MAP,()=>google.maps.MapTypeId.TERRAIN,R.wgs84),r.BUILD_IN_MAP_TYPES=new si([r.NORMAL,r.SATELLITE,r.HYBRID,r.TERRAIN])})(a.MapType||(a.MapType={}));var Dt=(r=>(r.DEFAULT="default",r.HORIZONTAL="horizontal",r.DROPDOWN="dropdown",r))(Dt||{});const hi=[a.MapType.NORMAL,a.MapType.SATELLITE,a.MapType.HYBRID];class Ye extends Ue{static create(t){const e=t.mapTypes??hi,i={default:BMAP_MAPTYPE_CONTROL_HORIZONTAL,horizontal:BMAP_MAPTYPE_CONTROL_HORIZONTAL,dropdown:BMAP_MAPTYPE_CONTROL_DROPDOWN},n=new BMap.MapTypeControl({type:t.type&&i[t.type],mapTypes:e.map(s=>s.asBaiduMapType())});return t.position&&n.setAnchor(a.ControlPositionConverter.getBaidu().toValue(t.position)),new Ye(n,t.position)}}const oe=class oe extends be{constructor(t="default",e=k.TOP_LEFT,i=hi){super("mapType",e),this.type=t,this.mapTypes=i,oe.type2google||(oe.type2google={default:google.maps.MapTypeControlStyle.DEFAULT,horizontal:google.maps.MapTypeControlStyle.HORIZONTAL_BAR,dropdown:google.maps.MapTypeControlStyle.DROPDOWN_MENU})}static create(t){return new oe(t.type,t.position,t.mapTypes)}onCreateOptions(){const t=super.onCreateOptions();return t.style=oe.type2google[this.type],t.mapTypeIds=this.mapTypes.map(e=>e instanceof W?e.getGoogleMapTypeId():e.id),t}addTo(t){super.addTo(t),this.mapTypes.forEach(e=>{e instanceof W||t.innerMap.mapTypes.set(e.id,e.asGoogleMapType())})}};f(oe,"type2google");let qe=oe;class Ke extends Ue{static create(t){const e=new BMap.ScaleControl({anchor:t.position&&a.ControlPositionConverter.getBaidu().toValue(t.position)});return new Ke(e,t.position)}}class Xe extends be{static create(t){return new Xe(t.position)}constructor(t=k.BOTTOM_RIGHT){super("scale",t)}}class Je extends ai{static create(t){return new Je(!0,t.position??k.RIGHT_BOTTOM)}}class Qe extends be{static create(t){return new Qe(t.position)}constructor(t=k.RIGHT_BOTTOM){super("streetView",t)}}class et extends Ue{static create(t){const e=new BMap.NavigationControl({type:BMAP_NAVIGATION_CONTROL_ZOOM,anchor:t.position&&a.ControlPositionConverter.getBaidu().toValue(t.position)});return new et(e,t.position)}}class tt extends be{static create(t){return new tt(t.position)}constructor(t=k.RIGHT_BOTTOM){super("zoom",t)}}function Pr(r){let t,e,i;const n="The Google Maps JavaScript API",s="google",l="importLibrary",d="__ib__",o=document,c=window,u=c[s]||(c[s]={}),g=u.maps||(u.maps={}),m=new Set,v=new URLSearchParams,C=()=>t||(t=new Promise(async(M,O)=>{var h;await(e=o.createElement("script")),v.set("libraries",[...m]+"");for(i in r)v.set(i.replace(/[A-Z]/g,p=>"_"+p[0].toLowerCase()),r[i]);v.set("callback",s+".maps."+d),e.src=`https://maps.${s}apis.com/maps/api/js?`+v,g[d]=M,e.onerror=()=>t=O(Error(n+" could not load.")),e.nonce=((h=o.querySelector("script[nonce]"))==null?void 0:h.nonce)||"",o.head.append(e)}));g[l]?console.warn(n+" only loads once. Ignoring:",r):g[l]=(M,...O)=>m.add(M)&&C().then(()=>g[l](M,...O))}let Lr,Br;const ie={get LATLNG_ZERO(){return Lr??(Lr=new google.maps.LatLng({lat:0,lng:0}))},get BOUNDS_ZERO(){return Br??(Br=new google.maps.LatLngBounds(this.LATLNG_ZERO,this.LATLNG_ZERO))}};function ci(r,t={country:"",province:"",city:"",district:"",street:"",streetNumber:""}){for(const e of r)for(const i of e.types)switch(i){case"street_number":t.streetNumber=e.long_name;break;case"route":t.street=e.long_name;break;case"locality":t.city=e.long_name;break;case"sublocality":t.district=e.long_name;break;case"administrative_area_level_1":t.province=e.long_name;break;case"country":t.country=e.long_name;break}return t}function di(r,t){var i;const e=r.address_components&&ci(r.address_components);return{country:(e==null?void 0:e.country)??"",province:(e==null?void 0:e.province)??"",city:(e==null?void 0:e.city)??"",id:r.place_id??"",address:r.formatted_address??"",position:w.fromGoogle(((i=r.geometry)==null?void 0:i.location)??ie.LATLNG_ZERO,t.coordType),title:r.name??""}}class $t{}class ui extends $t{constructor(e,i){super();f(this,"inner");this.map=e,this.inner=new google.maps.places.Autocomplete(i.input,{fields:["address_components","name"]}),i.bindToMap&&this.inner.bindTo("bounds",e.innerMap)}setBounds(e){this.inner.setBounds(e.toGoogle(this.map.coordType))}addResultListener(e){return ti(this.inner,"place_changed",()=>{const i=this.inner.getPlace(),n={title:i.name??"",province:"",city:"",district:"",street:"",streetNumber:"",country:""};i.address_components&&ci(i.address_components,n),e(n)})}}class pi extends $t{constructor(e,i){super();f(this,"inner");f(this,"input");f(this,"removeableArray",[]);if(this.map=e,this.input=i.input,this.inner=new BMap.Autocomplete({input:i.input,location:i.bindToMap?e.innerMap:void 0}),i.bindToMap){const n=()=>{this.inner.setLocation(this.map.innerMap)};this.removeableArray.push(ii(this.map,"center-changed",n)),this.removeableArray.push(ii(this.map,"zoom-changed",n))}}setBounds(e){this.inner.setLocation(e.getCenter().toBaidu(this.map.coordType))}addResultListener(e){let i=0;const n=Or(this.inner,"confirm",l=>{const d=l.item.value;i=Date.now(),e(Object.assign({title:d.business,country:""},d))}),s=wr(this.input,"keyup",l=>{l.key==="Enter"&&Date.now()-i>100&&e({title:this.input.value,country:"",city:"",district:"",province:"",street:"",streetNumber:""})});return()=>{s(),n()}}}var gi={exports:{}};(function(r,t){(function(e,i){r.exports=i()})(St,function(){const e=function(){var s={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.45:"rgb(0,0,255)",.55:"rgb(0,255,255)",.65:"rgb(0,255,0)",.95:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},l=function(){var v=function(O){this._coordinator={},this._data=[],this._radi=[],this._min=0,this._max=1,this._xField=O.xField||O.defaultXField,this._yField=O.yField||O.defaultYField,this._valueField=O.valueField||O.defaultValueField,O.radius&&(this._cfgRadius=O.radius)},C=s.defaultRadius;return v.prototype={_organiseData:function(M,O){var h=M[this._xField],p=M[this._yField],_=this._radi,b=this._data,E=this._max,P=this._min,B=M[this._valueField]||1,D=M.radius||this._cfgRadius||C;return b[h]||(b[h]=[],_[h]=[]),b[h][p]?b[h][p]+=B:(b[h][p]=B,_[h][p]=D),b[h][p]>E?(O?this.setDataMax(b[h][p]):this._max=b[h][p],!1):{x:h,y:p,value:B,radius:D,min:P,max:E}},_unOrganizeData:function(){var M=[],O=this._data,h=this._radi;for(var p in O)for(var _ in O[p])M.push({x:p,y:_,radius:h[p][_],value:O[p][_]});return{min:this._min,max:this._max,data:M}},_onExtremaChange:function(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})},addData:function(){if(arguments[0].length>0)for(var M=arguments[0],O=M.length;O--;)this.addData.call(this,M[O]);else{var h=this._organiseData(arguments[0],!0);h&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[h]})}return this},setData:function(M){var O=M.data,h=O.length;this._data=[],this._radi=[];for(var p=0;p<h;p++)this._organiseData(O[p],!1);return this._max=M.max,this._min=M.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},removeData:function(){},setDataMax:function(M){return this._max=M,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setDataMin:function(M){return this._min=M,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this},setCoordinator:function(M){this._coordinator=M},_getInternalData:function(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}},getData:function(){return this._unOrganizeData()}},v}(),d=function(){var v=function(h){var p=h.gradient||h.defaultGradient,_=document.createElement("canvas"),b=_.getContext("2d");_.width=256,_.height=1;var E=b.createLinearGradient(0,0,256,1);for(var P in p)E.addColorStop(P,p[P]);return b.fillStyle=E,b.fillRect(0,0,256,1),b.getImageData(0,0,256,1).data},C=function(h,p){var _=document.createElement("canvas"),b=_.getContext("2d"),E=h,P=h;if(_.width=_.height=h*2,p==1)b.beginPath(),b.arc(E,P,h,0,2*Math.PI,!1),b.fillStyle="rgba(0,0,0,1)",b.fill();else{var B=b.createRadialGradient(E,P,h*p,E,P,h);B.addColorStop(0,"rgba(0,0,0,1)"),B.addColorStop(1,"rgba(0,0,0,0)"),b.fillStyle=B,b.fillRect(0,0,2*h,2*h)}return _},M=function(P){for(var p=[],_=P.min,b=P.max,E=P.radi,P=P.data,B=Object.keys(P),D=B.length;D--;)for(var Z=B[D],S=Object.keys(P[Z]),ee=S.length;ee--;){var A=S[ee],q=P[Z][A],te=E[Z][A];p.push({x:Z,y:A,value:q,radius:te})}return{min:_,max:b,data:p}};function O(h){var p=h.element,_=this.shadowCanvas=document.createElement("canvas"),b=this.canvas=h.canvas||document.createElement("canvas");this._renderBoundaries=[1e4,1e4,0,0];var E=getComputedStyle(h.element)||{};b.className="heatmap-canvas",this._width=b.width=_.width=+E.width.replace(/px/,""),this._height=b.height=_.height=+E.height.replace(/px/,""),this.shadowCtx=_.getContext("2d"),this.ctx=b.getContext("2d"),b.style.cssText=_.style.cssText="position:absolute;left:0;top:0;",p.style.position="relative",p.appendChild(b),this._palette=v(h),this._templates={},this._setStyles(h)}return O.prototype={renderPartial:function(h){this._drawAlpha(h),this._colorize()},renderAll:function(h){this._clear(),this._drawAlpha(M(h)),this._colorize()},_updateGradient:function(h){this._palette=v(h)},updateConfig:function(h,p){h.gradient!==p.gradient&&this._updateGradient(h),this._setStyles(h)},setDimensions:function(h,p){this._width=h,this._height=p,this.canvas.width=this.shadowCanvas.width=h,this.canvas.height=this.shadowCanvas.height=p},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(h){this._blur=h.blur==0?0:h.blur||h.defaultBlur,h.backgroundColor&&(this.canvas.style.backgroundColor=h.backgroundColor),this._opacity=(h.opacity||0)*255,this._maxOpacity=(h.maxOpacity||h.defaultMaxOpacity)*255,this._minOpacity=(h.minOpacity||h.defaultMinOpacity)*255,this._useGradientOpacity=!!h.useGradientOpacity},_drawAlpha:function(b){for(var p=this._min=b.min,_=this._max=b.max,b=b.data||[],E=b.length,P=1-this._blur;E--;){var B=b[E],D=B.x,Z=B.y,S=B.radius,ee=Math.min(B.value,_),A=D-S,q=Z-S,te=this.shadowCtx,K;this._templates[S]?K=this._templates[S]:this._templates[S]=K=C(S,P),te.globalAlpha=(ee-p)/(_-p),te.drawImage(K,A,q),A<this._renderBoundaries[0]&&(this._renderBoundaries[0]=A),q<this._renderBoundaries[1]&&(this._renderBoundaries[1]=q),A+2*S>this._renderBoundaries[2]&&(this._renderBoundaries[2]=A+2*S),q+2*S>this._renderBoundaries[3]&&(this._renderBoundaries[3]=q+2*S)}},_colorize:function(){var h=this._renderBoundaries[0],p=this._renderBoundaries[1],_=this._renderBoundaries[2]-h,b=this._renderBoundaries[3]-p,E=this._width,P=this._height,B=this._opacity,D=this._maxOpacity,Z=this._minOpacity,S=this._useGradientOpacity;h<0&&(h=0),p<0&&(p=0),h+_>E&&(_=E-h),p+b>P&&(b=P-p);for(var ee=this.shadowCtx.getImageData(h,p,_,b),A=ee.data,q=A.length,te=this._palette,K=3;K<q;K+=4){var It=A[K],Re=It*4;if(Re){var De;B>0?De=B:It<D?It<Z?De=Z:De=It:De=D,A[K-3]=te[Re],A[K-2]=te[Re+1],A[K-1]=te[Re+2],A[K]=S?te[Re+3]:De}}this.ctx.putImageData(ee,h,p),this._renderBoundaries=[1e3,1e3,0,0]},getValueAt:function(h){var p,_=this.shadowCtx,b=_.getImageData(h.x,h.y,1,1),E=b.data[3],P=this._max,B=this._min;return p=Math.abs(P-B)*(E/255)>>0,p},getDataURL:function(){return this.canvas.toDataURL()}},O}(),o=function(){var v=!1;return s.defaultRenderer==="canvas2d"&&(v=d),v}(),c={merge:function(){for(var m={},v=arguments.length,C=0;C<v;C++){var M=arguments[C];for(var O in M)m[O]=M[O]}return m}},u=function(){var v=function(){function h(){this.cStore={}}return h.prototype={on:function(p,_,b){var E=this.cStore;E[p]||(E[p]=[]),E[p].push(function(P){return _.call(b,P)})},emit:function(p,_){var b=this.cStore;if(b[p])for(var E=b[p].length,P=0;P<E;P++){var B=b[p][P];B(_)}}},h}(),C=function(O){var h=O._renderer,p=O._coordinator,_=O._store;p.on("renderpartial",h.renderPartial,h),p.on("renderall",h.renderAll,h),p.on("extremachange",function(b){O._config.onExtremaChange&&O._config.onExtremaChange({min:b.min,max:b.max,gradient:O._config.gradient||O._config.defaultGradient})}),_.setCoordinator(p)};function M(){var O=this._config=c.merge(s,arguments[0]||{});if(this._coordinator=new v,O.plugin){var h=O.plugin;if(s.plugins[h]){var p=s.plugins[h];this._renderer=new p.renderer(O),this._store=new p.store(O)}else throw new Error("Plugin '"+h+"' not found. Maybe it was not registered.")}else this._renderer=new o(O),this._store=new l(O);C(this)}return M.prototype={addData:function(){return this._store.addData.apply(this._store,arguments),this},removeData:function(){return this._store.removeData&&this._store.removeData.apply(this._store,arguments),this},setData:function(){return this._store.setData.apply(this._store,arguments),this},setDataMax:function(){return this._store.setDataMax.apply(this._store,arguments),this},setDataMin:function(){return this._store.setDataMin.apply(this._store,arguments),this},configure:function(O){const h=this._config;return this._config=c.merge(this._config,O),this._renderer.updateConfig(this._config,h),this._coordinator.emit("renderall",this._store._getInternalData()),this},repaint:function(){return this._coordinator.emit("renderall",this._store._getInternalData()),this},getData:function(){return this._store.getData()},getDataURL:function(){return this._renderer.getDataURL()},getValueAt:function(O){return this._store.getValueAt?this._store.getValueAt(O):this._renderer.getValueAt?this._renderer.getValueAt(O):null}},M}(),g={create:function(m){return new u(m)},register:function(m,v){s.plugins[m]=v}};return g}();var i=function(s){Reflect.getPrototypeOf(i.prototype)!==BMap.Overlay.prototype&&Reflect.setPrototypeOf(i.prototype,BMap.Overlay.prototype),this.conf=s,this.conf.visible=s.visible===void 0?!0:s.visible,this.heatmap=null,this.latlngs=[],this.bounds=null};i.prototype=Object.create(typeof BMap>"u"?null:BMap.Overlay.prototype),i.prototype.initialize=function(s){this._map=s;var l=document.createElement("div");if(l.style.position="absolute",l.style.top=0,l.style.left=0,l.style.border=0,l.style.width=this._map.getSize().width+"px",l.style.height=this._map.getSize().height+"px",this.conf.element=l,!n())return l;s.getPanes().mapPane.appendChild(l),this.conf.valueField=this.conf.valueField||"count",this.heatmap=e.create(this.conf);var d=this;return s.addEventListener("resize",function(o){var c=o.size;l.style.width=c.width+"px",l.style.height=c.height+"px",d.heatmap._renderer.setDimensions(c.width,c.height),d.draw()}),this._div=l,l},i.prototype.draw=function(){if(n()){var s=this._map.getBounds();if(!s.equals(this.bounds)){this.bounds=s;var l=this._map.pointToOverlayPixel(s.getNorthEast()),d=this._map.pointToOverlayPixel(s.getSouthWest()),o=l.y,c=d.x,u=d.y-l.y,g=l.x-d.x;if(this.conf.element.style.left=c+"px",this.conf.element.style.top=o+"px",this.conf.element.style.width=g+"px",this.conf.element.style.height=u+"px",this.latlngs.length>0){this.heatmap.removeData();var m=this.latlngs.length;const h={max:this.heatmap._store.getData().max,data:[]};for(;m--;){var v=this.latlngs[m].latlng;if(s.containsPoint(v)){var C=this._map.pointToOverlayPixel(v),c=this._map.pointToOverlayPixel(s.getSouthWest()).x,o=this._map.pointToOverlayPixel(s.getNorthEast()).y,M=new BMap.Pixel(C.x-c,C.y-o),O=this.pixelTransform(M);h.data.push({x:O.x,y:O.y,count:this.latlngs[m].c})}}this.conf.radiusChangeByZoom&&(this.heatmap._store._cfgRadius=this.conf.radiusChangeByZoom(this._map.getZoom())),this.heatmap.setData(h)}}}},i.prototype.pixelTransform=function(s){for(var l=this.heatmap.width,d=this.heatmap.height;s.x<0;)s.x+=l;for(;s.x>l;)s.x-=l;for(;s.y<0;)s.y+=d;for(;s.y>d;)s.y-=d;return s.x=s.x>>0,s.y=s.y>>0,s},i.prototype.setDataSet=function(s){if(this.data=s,!!n()){var l=this._map.getBounds(),d={max:s.max,data:[]},o=s.data,c=o.length;for(this.latlngs=[],this.heatmap.removeData(),this.conf.radiusChangeByZoom&&(this.heatmap._store._cfgRadius=this.conf.radiusChangeByZoom(this._map.getZoom()));c--;){var u=new BMap.Point(o[c].lng,o[c].lat);if(this.latlngs.push({latlng:u,c:o[c].count}),!!l.containsPoint(u)){var g=this._map.pointToOverlayPixel(u),m=this._map.pointToOverlayPixel(l.getSouthWest()).x,v=this._map.pointToOverlayPixel(l.getNorthEast()).y,C=new BMap.Pixel(g.x-m,g.y-v),M=this.pixelTransform(C);d.data.push({x:M.x,y:M.y,count:o[c].count})}}this.heatmap.setData(d)}},i.prototype.addDataPoint=function(s,l,d){if(n()){this.data&&this.data.data&&this.data.data.push({lng:s,lat:l,count:d});var o=new BMap.Point(s,l),c=this.pixelTransform(this._map.pointToOverlayPixel(o));this.heatmap.store.addDataPoint(c.x,c.y,d),this.latlngs.push({latlng:o,c:d})}},i.prototype.toggle=function(){n()&&(this.conf.visible===!0?this.conf.visible=!1:this.conf.visible=!0,this.conf.visible?this.conf.element.style.display="block":this.conf.element.style.display="none")},i.prototype.setOptions=function(s){if(n()){for(var l in s)l=="radius"&&(this.heatmap._store._cfgRadius=s[l]);this.heatmap.configure(s),this.data&&this.setDataSet(this.data)}};function n(){var s=document.createElement("canvas");return!!(s.getContext&&s.getContext("2d"))}return i})})(gi);var Ir=gi.exports;const Sr=ze(Ir),mi=10,it={toGoogle:(r,t)=>({opacity:r.opacity,radius:r.radius??mi,gradient:r.gradient&&Object.entries(r.gradient).sort(([e],[i])=>+e-+i).map(([e,i])=>i),maxIntensity:r.maxIntensity,data:rt.toGoogle(r.data,t)}),toBaidu:(r,t,e)=>({opacity:r.opacity,radius:r.radius??mi,gradient:r.gradient,data:rt.toBaidu(r.data,t,e)})},rt={toGoogle:(r,t)=>r.map(e=>"weight"in e?{weight:e.weight,location:e.position.toGoogle(t)}:e.toGoogle(t)),toBaidu:(r,t,e)=>{let i=1;return{data:r.map(s=>{let l,d;return"weight"in s?(l=s.position.to(t),d=s.weight):(l=s.to(t),d=1),i<d&&(i=d),{lng:l.lng,lat:l.lat,count:d}}),max:e??i}}};class zt{}class fi extends zt{constructor(e,i){super();f(this,"inner");this.map=e,this.inner=new google.maps.visualization.HeatmapLayer(it.toGoogle(i,this.map.coordType)),this.inner.setMap(e.innerMap)}setData(e){this.inner.setData(rt.toGoogle(e,this.map.coordType))}setOptions(e){this.inner.setOptions(it.toGoogle(e,this.map.coordType))}remove(){this.inner.setMap(null)}}class yi extends zt{constructor(e,i){super();f(this,"inner");this.map=e;const n=it.toBaidu(i,this.map.coordType,i.maxIntensity);this.inner=new Sr(n),e.innerMap.addOverlay(this.inner),this.inner.setDataSet(n.data)}get innerDataMax(){var e;return(e=this.inner.data)==null?void 0:e.max}set innerDataMax(e){var i;((i=this.inner).data??(i.data={})).max=e}setData(e){this.inner.setDataSet(rt.toBaidu(e,this.map.coordType,this.innerDataMax))}setOptions(e){const i=it.toBaidu(e,this.map.coordType,e.maxIntensity??this.innerDataMax);e.data!==this.inner.data?this.inner.setDataSet(i.data):e.maxIntensity&&(this.innerDataMax=e.maxIntensity),this.inner.setOptions(i)}remove(){this.map.innerMap.removeOverlay(this.inner)}}class Gt{constructor(t){this.options=t}}function Me(r,t,e){const i=new URL(t,r),n=new URLSearchParams(Object.entries(e).filter(Qt));return i.search="?"+n.toString(),i}function Nt(){const r=window.location.hostname.split(".").filter(t=>!a.Strings.isInt(t));return r.length===3?r.join("."):[...r,"tg","map","urls"].slice(0,3).join(".")}const xe=class xe extends Gt{directions(t,e,i){return Me(xe.BASE_URL,"dir/",{api:"1",origin:a.Location.toString(t,R.gcj02),destination:a.Location.toString(e,R.gcj02),travelmode:i})}search(t){return Me(xe.BASE_URL,"search/",{api:"1",query:a.Location.toString(t,R.gcj02)})}};f(xe,"BASE_URL","https://www.google.com/maps/");let nt=xe;const ve=class ve extends Gt{directions(t,e,i="driving"){const n=a.Location.getCoordType(e)??a.Location.getCoordType(t)??R.bd09,s=a.Location.toString(e,n);return Me(ve.BASE_URL,"direction",{origin:a.Location.toString(t,n)??(typeof e!="string"?`name:请选择起点|latlng:${s}`:s),destination:s,coord_type:n===R.bd09?void 0:n,mode:i,output:"html",region:"中国",src:Nt()})}search(t){return typeof t=="string"?this.geocoderApi(t):this.latlngApi(t)}latlngApi(t){const e=t.to(R.bd09);return new URL(`https://map.baidu.com/?latlng=${e.lat},${e.lng}`)}markerApi(t,e,i){return Me(ve.BASE_URL,"marker",{location:`${t.lat},${t.lng}`,coord_type:t.coord===R.bd09?void 0:t.coord,title:e,content:i,output:"html",src:Nt()})}geocoderApi(t){return Me(ve.BASE_URL,"geocoder",{...typeof t=="string"?{address:t}:{location:`${t.lat},${t.lng}`,coord_type:t.coord===R.bd09?void 0:t.coord},output:"html",src:Nt()})}};f(ve,"BASE_URL","https://api.map.baidu.com/");let st=ve,kr=class pr{constructor(t,e,i){this.extend(pr,google.maps.OverlayView),this.map_=t,this.MARKER_CLUSTER_IMAGE_PATH_="../images/m",this.MARKER_CLUSTER_IMAGE_EXTENSION_="png",this.markers_=[],this.clusters_=[],this.sizes=[53,56,66,78,90],this.styles_=[],this.ready_=!1;var n=i||{};this.zIndex_=n.zIndex||google.maps.Marker.MAX_ZINDEX+1,this.gridSize_=n.gridSize||60,this.minClusterSize_=n.minimumClusterSize||2,this.maxZoom_=n.maxZoom||null,this.styles_=n.styles||[],this.imagePath_=n.imagePath||this.MARKER_CLUSTER_IMAGE_PATH_,this.imageExtension_=n.imageExtension||this.MARKER_CLUSTER_IMAGE_EXTENSION_,this.zoomOnClick_=!0,n.zoomOnClick!=null&&(this.zoomOnClick_=n.zoomOnClick),this.averageCenter_=!1,n.averageCenter!=null&&(this.averageCenter_=n.averageCenter),this.setupStyles_(),this.setMap(t),this.prevZoom_=this.map_.getZoom();var s=this;google.maps.event.addListener(this.map_,"zoom_changed",function(){var l=s.map_.getZoom(),d=s.map_.minZoom||0,o=Math.min(s.map_.maxZoom||100,s.map_.mapTypes[s.map_.getMapTypeId()].maxZoom);l=Math.min(Math.max(l,d),o),s.prevZoom_!=l&&(s.prevZoom_=l,s.resetViewport())}),google.maps.event.addListener(this.map_,"idle",function(){s.redraw()}),e&&(e.length||Object.keys(e).length)&&this.addMarkers(e,!1)}extend(t,e){return(function(i){for(var n in i.prototype)this.prototype[n]=i.prototype[n];return this}).apply(t,[e])}onAdd(){this.setReady_(!0)}draw(){}setupStyles_(){if(!this.styles_.length)for(var t=0,e;e=this.sizes[t];t++)this.styles_.push({url:this.imagePath_+(t+1)+"."+this.imageExtension_,height:e,width:e})}fitMapToMarkers(){for(var t=this.getMarkers(),e=new google.maps.LatLngBounds,i=0,n;n=t[i];i++)e.extend(n.getPosition());this.map_.fitBounds(e)}setZIndex(t){this.zIndex_=t}getZIndex(){return this.zIndex_}setStyles(t){this.styles_=t}getStyles(){return this.styles_}isZoomOnClick(){return this.zoomOnClick_}isAverageCenter(){return this.averageCenter_}getMarkers(){return this.markers_}getTotalMarkers(){return this.markers_.length}setMaxZoom(t){this.maxZoom_=t}getMaxZoom(){return this.maxZoom_}calculator_(t,e){for(var i=0,n=t.length,s=n;s!==0;)s=parseInt(s/10,10),i++;return i=Math.min(i,e),{text:n,index:i}}setCalculator(t){this.calculator_=t}getCalculator(){return this.calculator_}addMarkers(t,e){if(t.length)for(let i=0,n;n=t[i];i++)this.pushMarkerTo_(n);else if(Object.keys(t).length)for(let i in t)this.pushMarkerTo_(t[i]);e||this.redraw()}pushMarkerTo_(t){if(t.isAdded=!1,t.draggable){var e=this;google.maps.event.addListener(t,"dragend",function(){t.isAdded=!1,e.repaint()})}this.markers_.push(t)}addMarker(t,e){this.pushMarkerTo_(t),e||this.redraw()}removeMarker_(t){var e=-1;if(this.markers_.indexOf)e=this.markers_.indexOf(t);else for(var i=0,n;n=this.markers_[i];i++)if(n==t){e=i;break}return e==-1?!1:(t.setMap(null),this.markers_.splice(e,1),!0)}removeMarker(t,e){var i=this.removeMarker_(t);return!e&&i?(this.resetViewport(),this.redraw(),!0):!1}removeMarkers(t,e){for(var i=t===this.getMarkers()?t.slice():t,n=!1,s=0,l;l=i[s];s++){var d=this.removeMarker_(l);n=n||d}if(!e&&n)return this.resetViewport(),this.redraw(),!0}setReady_(t){this.ready_||(this.ready_=t,this.createClusters_())}getTotalClusters(){return this.clusters_.length}getMap(){return this.map_}setMap(t){this.map_=t}getGridSize(){return this.gridSize_}setGridSize(t){this.gridSize_=t}getMinClusterSize(){return this.minClusterSize_}setMinClusterSize(t){this.minClusterSize_=t}getExtendedBounds(t){var e=this.getProjection(),i=new google.maps.LatLng(t.getNorthEast().lat(),t.getNorthEast().lng()),n=new google.maps.LatLng(t.getSouthWest().lat(),t.getSouthWest().lng()),s=e.fromLatLngToDivPixel(i);s.x+=this.gridSize_,s.y-=this.gridSize_;var l=e.fromLatLngToDivPixel(n);l.x-=this.gridSize_,l.y+=this.gridSize_;var d=e.fromDivPixelToLatLng(s),o=e.fromDivPixelToLatLng(l);return t.extend(d),t.extend(o),t}isMarkerInBounds_(t,e){return e.contains(t.getPosition())}clearMarkers(){this.resetViewport(!0),this.markers_=[]}resetViewport(t){for(let e=0,i;i=this.clusters_[e];e++)i.remove();for(let e=0,i;i=this.markers_[e];e++)i.isAdded=!1,t&&i.setMap(null);this.clusters_=[]}repaint(){var t=this.clusters_.slice();this.clusters_.length=0,this.resetViewport(),this.redraw(),setTimeout(function(){for(var e=0,i;i=t[e];e++)i.remove()},0)}redraw(){this.createClusters_()}distanceBetweenPoints_(t,e){if(!t||!e)return 0;var i=6371,n=(e.lat()-t.lat())*Math.PI/180,s=(e.lng()-t.lng())*Math.PI/180,l=Math.sin(n/2)*Math.sin(n/2)+Math.cos(t.lat()*Math.PI/180)*Math.cos(e.lat()*Math.PI/180)*Math.sin(s/2)*Math.sin(s/2),d=2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),o=i*d;return o}addToClosestCluster_(t){for(var e=4e4,i=null,n=0,s;s=this.clusters_[n];n++){var l=s.getCenter();if(l){var d=this.distanceBetweenPoints_(l,t.getPosition());d<e&&(e=d,i=s)}}if(i&&i.isMarkerInClusterBounds(t))i.addMarker(t);else{var o=new xr(this);o.addMarker(t),this.clusters_.push(o)}}createClusters_(){if(this.ready_)for(var t=new google.maps.LatLngBounds(this.map_.getBounds().getSouthWest(),this.map_.getBounds().getNorthEast()),e=this.getExtendedBounds(t),i=0,n;n=this.markers_[i];i++)!n.isAdded&&this.isMarkerInBounds_(n,e)&&this.addToClosestCluster_(n)}},xr=class{constructor(t){this.markerClusterer_=t,this.map_=t.getMap(),this.gridSize_=t.getGridSize(),this.minClusterSize_=t.getMinClusterSize(),this.averageCenter_=t.isAverageCenter(),this.center_=null,this.markers_=[],this.bounds_=null,this.clusterIcon_=new Zt(this,t.getStyles(),t.getGridSize())}isMarkerAlreadyAdded(t){if(this.markers_.indexOf)return this.markers_.indexOf(t)!=-1;for(var e=0,i;i=this.markers_[e];e++)if(i==t)return!0;return!1}addMarker(t){if(this.isMarkerAlreadyAdded(t))return!1;if(!this.center_)this.center_=t.getPosition(),this.calculateBounds_();else if(this.averageCenter_){var e=this.markers_.length+1,i=(this.center_.lat()*(e-1)+t.getPosition().lat())/e,n=(this.center_.lng()*(e-1)+t.getPosition().lng())/e;this.center_=new google.maps.LatLng(i,n),this.calculateBounds_()}t.isAdded=!0,this.markers_.push(t);var s=this.markers_.length;if(s<this.minClusterSize_&&t.getMap()!=this.map_&&t.setMap(this.map_),s==this.minClusterSize_)for(var l=0;l<s;l++)this.markers_[l].setMap(null);return s>=this.minClusterSize_&&t.setMap(null),this.updateIcon(),!0}getMarkerClusterer(){return this.markerClusterer_}getBounds(){for(var t=new google.maps.LatLngBounds(this.center_,this.center_),e=this.getMarkers(),i=0,n;n=e[i];i++)t.extend(n.getPosition());return t}remove(){this.clusterIcon_.remove(),this.markers_.length=0,delete this.markers_}getSize(){return this.markers_.length}getMarkers(){return this.markers_}getCenter(){return this.center_}calculateBounds_(){var t=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(t)}isMarkerInClusterBounds(t){return this.bounds_.contains(t.getPosition())}getMap(){return this.map_}updateIcon(){var t=this.map_.getZoom(),e=this.markerClusterer_.getMaxZoom();if(e&&t>e){for(var i=0,n;n=this.markers_[i];i++)n.setMap(this.map_);return}if(this.markers_.length<this.minClusterSize_){this.clusterIcon_.hide();return}var s=this.markerClusterer_.getStyles().length,l=this.markerClusterer_.getCalculator()(this.markers_,s);this.clusterIcon_.setCenter(this.center_),this.clusterIcon_.setSums(l),this.clusterIcon_.show()}};class Zt{constructor(t,e,i){t.getMarkerClusterer().extend(Zt,google.maps.OverlayView),this.styles_=e,this.padding_=i||0,this.cluster_=t,this.center_=null,this.map_=t.getMap(),this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(this.map_)}triggerClusterClick(){var t=this.cluster_.getBounds(),e=this.cluster_.getMarkerClusterer();google.maps.event.trigger(e.map_,"clusterclick",this.cluster_),e.isZoomOnClick()&&(this.map_.fitBounds(t),this.map_.setCenter(t.getCenter()))}onAdd(){if(this.div_=document.createElement("DIV"),this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(t),this.div_.innerHTML=this.sums_.text}var e=this.getPanes();e.overlayMouseTarget.appendChild(this.div_);var i=this;google.maps.event.addDomListener(this.div_,"click",function(){i.triggerClusterClick()})}getPosFromLatLng_(t){var e=this.getProjection().fromLatLngToDivPixel(t);return e.x-=parseInt(this.width_/2,10),e.y-=parseInt(this.height_/2,10),e}draw(){if(this.visible_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.top=t.y+"px",this.div_.style.left=t.x+"px"}}hide(){this.div_&&(this.div_.style.display="none"),this.visible_=!1}show(){if(this.div_){var t=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(t),this.div_.style.display=""}this.visible_=!0}remove(){this.setMap(null)}onRemove(){this.div_&&this.div_.parentNode&&(this.hide(),this.div_.parentNode.removeChild(this.div_),this.div_=null)}setSums(t){this.sums_=t,this.text_=t.text,this.index_=t.index,this.div_&&(this.div_.innerHTML=t.text),this.useStyle()}useStyle(){var t=Math.max(0,this.sums_.index-1);t=Math.min(this.styles_.length-1,t);var e=this.styles_[t];this.url_=e.url,this.height_=e.height,this.width_=e.width,this.textColor_=e.textColor,this.anchor_=e.anchor,this.textSize_=e.textSize,this.backgroundPosition_=e.backgroundPosition}setCenter(t){this.center_=t}createCss(t){var e=[];e.push("z-index:"+this.cluster_.markerClusterer_.getZIndex()+";"),e.push("background-image:url("+this.url_+");");var i=this.backgroundPosition_?this.backgroundPosition_:"0 0";e.push("background-position:"+i+";"),typeof this.anchor_=="object"?(typeof this.anchor_[0]=="number"&&this.anchor_[0]>0&&this.anchor_[0]<this.height_?e.push("height:"+(this.height_-this.anchor_[0])+"px; padding-top:"+this.anchor_[0]+"px;"):e.push("height:"+this.height_+"px; line-height:"+this.height_+"px;"),typeof this.anchor_[1]=="number"&&this.anchor_[1]>0&&this.anchor_[1]<this.width_?e.push("width:"+(this.width_-this.anchor_[1])+"px; padding-left:"+this.anchor_[1]+"px;"):e.push("width:"+this.width_+"px; text-align:center;")):e.push("height:"+this.height_+"px; line-height:"+this.height_+"px; width:"+this.width_+"px; text-align:center;");var n=this.textColor_?this.textColor_:"black",s=this.textSize_?this.textSize_:11;return e.push("cursor:pointer; top:"+t.y+"px; left:"+t.x+"px; color:"+n+"; position:absolute; font-size:"+s+"px; font-family:Arial,sans-serif; font-weight:bold"),e.join("")}}var vi={exports:{}};(function(r,t){(function(e,i){r.exports=i()})(St,function(){var e,i=e=i||{version:"1.3.8"},n={};i.guid="$BAIDU$",n[i.guid]=n[i.guid]||{},i.dom=i.dom||{},i.dom.g=function(o){return typeof o=="string"||o instanceof String?document.getElementById(o):o&&o.nodeName&&(o.nodeType==1||o.nodeType==9)?o:null},i.g=i.G=i.dom.g,i.dom.getDocument=function(o){return o=i.dom.g(o),o.nodeType==9?o:o.ownerDocument||o.document},i.lang=i.lang||{},i.lang.isString=function(o){return Object.prototype.toString.call(o)=="[object String]"},i.isString=i.lang.isString,i.dom._g=function(o){return i.lang.isString(o)?document.getElementById(o):o},i._g=i.dom._g,i.browser=i.browser||{},/msie (\d+\.\d)/i.test(navigator.userAgent)&&(i.browser.ie=i.ie=document.documentMode||+RegExp.$1),i.dom.getComputedStyle=function(o,c){o=i.dom._g(o);var u=i.dom.getDocument(o),g;return u.defaultView&&u.defaultView.getComputedStyle&&(g=u.defaultView.getComputedStyle(o,null),g)?g[c]||g.getPropertyValue(c):""},i.dom._styleFixer=i.dom._styleFixer||{},i.dom._styleFilter=i.dom._styleFilter||[],i.dom._styleFilter.filter=function(o,c,u){for(var g=0,m=i.dom._styleFilter,v;v=m[g];g++)(v=v[u])&&(c=v(o,c));return c},i.string=i.string||{},i.string.toCamelCase=function(o){return o.indexOf("-")<0&&o.indexOf("_")<0?o:o.replace(/[-_][^-_]/g,function(c){return c.charAt(1).toUpperCase()})},i.dom.getStyle=function(o,c){var u=i.dom;o=u.g(o),c=i.string.toCamelCase(c);var g=o.style[c]||(o.currentStyle?o.currentStyle[c]:"")||u.getComputedStyle(o,c);if(!g){var m=u._styleFixer[c];m&&(g=m.get?m.get(o):i.dom.getStyle(o,m))}return(m=u._styleFilter)&&(g=m.filter(c,g,"get")),g},i.getStyle=i.dom.getStyle,/opera\/(\d+\.\d)/i.test(navigator.userAgent)&&(i.browser.opera=+RegExp.$1),i.browser.isWebkit=/webkit/i.test(navigator.userAgent),i.browser.isGecko=/gecko/i.test(navigator.userAgent)&&!/like gecko/i.test(navigator.userAgent),i.browser.isStrict=document.compatMode=="CSS1Compat",i.dom.getPosition=function(o){o=i.dom.g(o);var c=i.dom.getDocument(o),u=i.browser,g=i.dom.getStyle;u.isGecko>0&&c.getBoxObjectFor&&g(o,"position")=="absolute"&&(o.style.top===""||o.style.left);var m={left:0,top:0},v=u.ie&&!u.isStrict?c.body:c.documentElement,C,M;if(o==v)return m;if(o.getBoundingClientRect){M=o.getBoundingClientRect(),m.left=Math.floor(M.left)+Math.max(c.documentElement.scrollLeft,c.body.scrollLeft),m.top=Math.floor(M.top)+Math.max(c.documentElement.scrollTop,c.body.scrollTop),m.left-=c.documentElement.clientLeft,m.top-=c.documentElement.clientTop;var O=c.body,h=parseInt(g(O,"borderLeftWidth")),p=parseInt(g(O,"borderTopWidth"));u.ie&&!u.isStrict&&(m.left-=isNaN(h)?2:h,m.top-=isNaN(p)?2:p)}else{C=o;do{if(m.left+=C.offsetLeft,m.top+=C.offsetTop,u.isWebkit>0&&g(C,"position")=="fixed"){m.left+=c.body.scrollLeft,m.top+=c.body.scrollTop;break}C=C.offsetParent}while(C&&C!=o);for((u.opera>0||u.isWebkit>0&&g(o,"position")=="absolute")&&(m.top-=c.body.offsetTop),C=o.offsetParent;C&&C!=c.body;)m.left-=C.scrollLeft,(!u.opera||C.tagName!="TR")&&(m.top-=C.scrollTop),C=C.offsetParent}return m},i.event=i.event||{},i.event._listeners=i.event._listeners||[],i.event.on=function(o,c,u){c=c.replace(/^on/i,""),o=i.dom._g(o);var g=function(O){u.call(o,O)},m=i.event._listeners,v=i.event._eventFilter,C,M=c;return c=c.toLowerCase(),v&&v[c]&&(C=v[c](o,c,g),M=C.type,g=C.listener),o.addEventListener?o.addEventListener(M,g,!1):o.attachEvent&&o.attachEvent("on"+M,g),m[m.length]=[o,c,u,g,M],o},i.on=i.event.on,function(){var o=n[i.guid];i.lang.guid=function(){return"TANGRAM__"+(o._counter++).toString(36)},o._counter=o._counter||1}(),n[i.guid]._instances=n[i.guid]._instances||{},i.lang.isFunction=function(o){return Object.prototype.toString.call(o)=="[object Function]"},i.lang.Class=function(o){this.guid=o||i.lang.guid(),n[i.guid]._instances[this.guid]=this},n[i.guid]._instances=n[i.guid]._instances||{},i.lang.Class.prototype.dispose=function(){delete n[i.guid]._instances[this.guid];for(var o in this)i.lang.isFunction(this[o])||delete this[o];this.disposed=!0},i.lang.Class.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"},i.lang.Event=function(o,c){this.type=o,this.returnValue=!0,this.target=c||null,this.currentTarget=null},i.lang.Class.prototype.addEventListener=function(o,c,u){if(i.lang.isFunction(c)){!this.__listeners&&(this.__listeners={});var g=this.__listeners,m;if(typeof u=="string"&&u){if(/[^\w\-]/.test(u))throw"nonstandard key:"+u;c.hashCode=u,m=u}o.indexOf("on")!=0&&(o="on"+o),typeof g[o]!="object"&&(g[o]={}),m=m||i.lang.guid(),c.hashCode=m,g[o][m]=c}},i.lang.Class.prototype.removeEventListener=function(o,c){if(!(typeof c<"u"&&(i.lang.isFunction(c)&&!(c=c.hashCode)||!i.lang.isString(c)))){!this.__listeners&&(this.__listeners={}),o.indexOf("on")!=0&&(o="on"+o);var u=this.__listeners;if(u[o])if(typeof c<"u")u[o][c]&&delete u[o][c];else for(var g in u[o])delete u[o][g]}},i.lang.Class.prototype.dispatchEvent=function(o,c){i.lang.isString(o)&&(o=new i.lang.Event(o)),!this.__listeners&&(this.__listeners={}),c=c||{};for(var u in c)o[u]=c[u];var u,g=this.__listeners,m=o.type;if(o.target=o.target||this,o.currentTarget=this,m.indexOf("on")!=0&&(m="on"+m),i.lang.isFunction(this[m])&&this[m].apply(this,arguments),typeof g[m]=="object")for(u in g[m])g[m][u].apply(this,arguments);return o.returnValue},i.lang.inherits=function(o,c,u){var g,m,v=o.prototype,C=new Function;C.prototype=c.prototype,m=o.prototype=new C;for(g in v)m[g]=v[g];o.prototype.constructor=o,o.superClass=c.prototype,typeof u=="string"&&(m._className=u)},i.inherits=i.lang.inherits;var s="http://api.map.baidu.com/library/TextIconOverlay/1.2/src/images/m",l="png",d=function(o,c,u){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}e.lang.inherits(d,BMap.Overlay,"TextIconOverlay"),this._position=o,this._text=c,this._options=u||{},this._styles=this._options.styles||[],this._zIndex=this._options.zIndex,!this._styles.length&&this._setupDefaultStyles()};return d.prototype._setupDefaultStyles=function(){for(var o=[53,56,66,78,90],c=0,u;u=o[c];c++)this._styles.push({url:s+c+"."+l,size:new BMap.Size(u,u)})},d.prototype.initialize=function(o){return this._map=o,this._domElement=document.createElement("div"),this._updateCss(),this._updateText(),this._updatePosition(),this._bind(),this._map.getPanes().markerMouseTarget.appendChild(this._domElement),this._domElement},d.prototype.draw=function(){this._map&&this._updatePosition()},d.prototype.getText=function(){return this._text},d.prototype.setText=function(o){o&&(!this._text||this._text.toString()!=o.toString())&&(this._text=o,this._updateText(),this._updateCss(),this._updatePosition())},d.prototype.getPosition=function(){return this._position},d.prototype.setPosition=function(o){o&&(!this._position||!this._position.equals(o))&&(this._position=o,this._updatePosition())},d.prototype.getStyleByText=function(o,c){var u=parseInt(o),g=parseInt(u/10);return g=Math.max(0,g),g=Math.min(g,c.length-1),c[g]},d.prototype._updateCss=function(){if(this._domElement){var o=this.getStyleByText(this._text,this._styles);this._domElement.style.cssText=this._buildCssText(o)}},d.prototype._updateText=function(){this._domElement&&(this._domElement.innerHTML=this._text)},d.prototype._updatePosition=function(){if(this._domElement&&this._position){var o=this._domElement.style,c=this._map.pointToOverlayPixel(this._position);c.x-=Math.ceil(parseInt(o.width)/2),c.y-=Math.ceil(parseInt(o.height)/2),o.left=c.x+"px",o.top=c.y+"px"}},d.prototype._buildCssText=function(o){var c=o.url,u=o.size,g=o.anchor,m=o.offset,v=o.textColor||"black",C=o.textSize||10,M=[];if(this._zIndex&&M.push("z-index:"+this._zIndex+";"),e.browser.ie<7)M.push('filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="'+c+'");');else{M.push("background-image:url("+c+");");var O="0 0";m instanceof BMap.Size&&(O=m.width+"px "+m.height+"px"),M.push("background-position:"+O+";")}return u instanceof BMap.Size&&(g instanceof BMap.Size?(g.height>0&&g.height<u.height&&M.push("height:"+(u.height-g.height)+"px; padding-top:"+g.height+"px;"),g.width>0&&g.width<u.width&&M.push("width:"+(u.width-g.width)+"px; padding-left:"+g.width+"px;")):(M.push("height:"+u.height+"px; line-height:"+u.height+"px;"),M.push("width:"+u.width+"px; text-align:center;"))),M.push("cursor:pointer; color:"+v+"; position:absolute; font-size:"+C+"px; font-family:Arial,sans-serif; font-weight:bold"),M.join("")},d.prototype._bind=function(){if(!this._domElement)return;var o=this,c=this._map,u=e.lang.Event;function g(m,v){var C=m.srcElement||m.target,M=m.clientX||m.pageX,O=m.clientY||m.pageY;if(m&&v&&M&&O&&C){var h=e.dom.getPosition(c.getContainer());v.pixel=new BMap.Pixel(M-h.left,O-h.top),v.point=c.pixelToPoint(v.pixel)}return v}e.event.on(this._domElement,"mouseover",function(m){o.dispatchEvent(g(m,new u("onmouseover")))}),e.event.on(this._domElement,"mouseout",function(m){o.dispatchEvent(g(m,new u("onmouseout")))}),e.event.on(this._domElement,"click",function(m){o.dispatchEvent(g(m,new u("onclick")))})},d})})(vi);var Ar=vi.exports;const _i=ze(Ar);var bi=function(r,t,e){t=Rr(t);var i=r.pointToPixel(t.getNorthEast()),n=r.pointToPixel(t.getSouthWest());i.x+=e,i.y-=e,n.x-=e,n.y+=e;var s=r.pixelToPoint(i),l=r.pixelToPoint(n);return new BMap.Bounds(l,s)},Rr=function(r){var t=ot(r.getNorthEast().lng,-180,180),e=ot(r.getSouthWest().lng,-180,180),i=ot(r.getNorthEast().lat,-74,74),n=ot(r.getSouthWest().lat,-74,74);return new BMap.Bounds(new BMap.Point(e,n),new BMap.Point(t,i))},ot=function(r,t,e){return t&&(r=Math.max(r,t)),e&&(r=Math.min(r,e)),r},Mi=function(r){return Object.prototype.toString.call(r)==="[object Array]"},Ti=function(r,t){var e=-1;if(Mi(t)){if(t.indexOf)e=t.indexOf(r);else for(var i=0,n;n=t[i];i++)if(n===r){e=i;break}}return e},L=function(r,t){try{BMap}catch{throw Error("Baidu Map JS API is not ready yet!")}if(r){this._map=r,this._markers=[],this._clusters=[];var e=t||{};this._zIndex=e.zIndex,this._gridSize=e.gridSize||60,this._maxZoom=e.maxZoom||18,this._minClusterSize=e.minClusterSize||2,this._isAverageCenter=!1,e.isAverageCenter!=null&&(this._isAverageCenter=e.isAverageCenter),this._styles=e.styles||[];var i=this;this._map.addEventListener("zoomend",function(){i._redraw()}),this._map.addEventListener("moveend",function(){i._redraw()});var n=e.markers;Mi(n)&&this.addMarkers(n)}};L.prototype.addMarkers=function(r){if(r.length){for(var t=0,e=r.length;t<e;t++)this._pushMarkerTo(r[t]);this._createClusters()}},L.prototype._pushMarkerTo=function(r){var t=Ti(r,this._markers);t===-1&&(r.isInCluster=!1,this._markers.push(r))},L.prototype.addMarker=function(r){this._pushMarkerTo(r),this._createClusters()},L.prototype._createClusters=function(){var r=this._map.getBounds();if(r.getCenter()){for(var t=bi(this._map,r,this._gridSize),e=0,i;i=this._markers[e];e++)!i.isInCluster&&t.containsPoint(i.getPosition())&&this._addToClosestCluster(i);for(var n=this._markers.length,e=0;e<n;e++)this._clusters[e]&&this._clusters[e].render()}},L.prototype._addToClosestCluster=function(r){var t=4e6,e=null;r.getPosition();for(var i=0,n;n=this._clusters[i];i++){var s=n.getCenter();if(s){var l=this._map.getDistance(s,r.getPosition());l<t&&(t=l,e=n)}}if(e&&e.isMarkerInClusterBounds(r))e.addMarker(r);else{var n=new F(this);n.addMarker(r),this._clusters.push(n)}},L.prototype._clearLastClusters=function(){for(var r=0,t;t=this._clusters[r];r++)t.remove();this._clusters=[],this._removeMarkersFromCluster()},L.prototype._removeMarkersFromCluster=function(){for(var r=0,t;t=this._markers[r];r++)t.isInCluster=!1},L.prototype._removeMarkersFromMap=function(){for(var r=0,t;t=this._markers[r];r++){t.isInCluster=!1;var e=t.getLabel();this._map.removeOverlay(t),t.setLabel(e)}},L.prototype._removeMarker=function(r){var t=Ti(r,this._markers);return t===-1?!1:(this._map.removeOverlay(r),this._markers.splice(t,1),!0)},L.prototype.removeMarker=function(r){var t=this._removeMarker(r);return t&&(this._clearLastClusters(),this._createClusters()),t},L.prototype.removeMarkers=function(r){for(var t=!1,e=0;e<r.length;e++){var i=this._removeMarker(r[e]);t=t||i}return t&&(this._clearLastClusters(),this._createClusters()),t},L.prototype.clearMarkers=function(){this._clearLastClusters(),this._removeMarkersFromMap(),this._markers=[]},L.prototype._redraw=function(){this._clearLastClusters(),this._createClusters()},L.prototype.getGridSize=function(){return this._gridSize},L.prototype.setGridSize=function(r){this._gridSize=r,this._redraw()},L.prototype.getMaxZoom=function(){return this._maxZoom},L.prototype.setMaxZoom=function(r){this._maxZoom=r,this._redraw()},L.prototype.getZIndex=function(){return this._zIndex},L.prototype.setZIndex=function(r){this._zIndex!=r&&(this.zIndex=r,this._redraw())},L.prototype.getStyles=function(){return this._styles},L.prototype.setStyles=function(r){this._styles=r,this._redraw()},L.prototype.getMinClusterSize=function(){return this._minClusterSize},L.prototype.setMinClusterSize=function(r){this._minClusterSize=r,this._redraw()},L.prototype.isAverageCenter=function(){return this._isAverageCenter},L.prototype.getMap=function(){return this._map},L.prototype.getMarkers=function(){return this._markers},L.prototype.getClustersCount=function(){for(var r=0,t=0,e;e=this._clusters[t];t++)e.isReal()&&r++;return r},L.prototype._textCalculator=function(r){return r.length.toString()},L.prototype._stylesIndexCalculator=null,L.prototype.setTextCalculator=function(r){this._textCalculator=r},L.prototype.setStylesIndexCalculator=function(r){this._stylesIndexCalculator=r};function F(r){var t=this;this._markerClusterer=r,this._map=r.getMap(),this._minClusterSize=r.getMinClusterSize(),this._isAverageCenter=r.isAverageCenter(),this._center=null,this._markers=[],this._gridBounds=null,this._isReal=!1,this._clusterMarker=new _i(this._center,this._markers.length,{styles:this._markerClusterer.getStyles(),zIndex:r._zIndex}),this._clusterMarker.getStyleByText=function(e,i){if(t._markerClusterer._stylesIndexCalculator){var n=t._markerClusterer._stylesIndexCalculator(t._markers,i.length);return i[n]}return _i.prototype.getStyleByText.call(this,e,i)},this._clusterMarker.addEventListener&&this._clusterMarker.addEventListener("click",function(e){t._map.setViewport(t.getBounds())})}F.prototype.addMarker=function(r){if(this.isMarkerInCluster(r))return!1;if(!this._center)this._center=r.getPosition(),this.updateGridBounds();else if(this._isAverageCenter){var t=this._markers.length+1,e=(this._center.lat*(t-1)+r.getPosition().lat)/t,i=(this._center.lng*(t-1)+r.getPosition().lng)/t;this._center=new BMap.Point(i,e),this.updateGridBounds()}return r.isInCluster=!0,this._markers.push(r),!0},F.prototype.render=function(){var r=this._markers.length;if(r<this._minClusterSize)for(var t=0;t<r;t++)this._map.addOverlay(this._markers[t]);else this._map.addOverlay(this._clusterMarker),this._isReal=!0,this.updateClusterMarker()},F.prototype.isMarkerInCluster=function(r){if(this._markers.indexOf)return this._markers.indexOf(r)!=-1;for(var t=0,e;e=this._markers[t];t++)if(e===r)return!0;return!1},F.prototype.isMarkerInClusterBounds=function(r){return this._gridBounds.containsPoint(r.getPosition())},F.prototype.isReal=function(r){return this._isReal},F.prototype.updateGridBounds=function(){var r=new BMap.Bounds(this._center,this._center);this._gridBounds=bi(this._map,r,this._markerClusterer.getGridSize())},F.prototype.updateClusterMarker=function(){if(this._map.getZoom()>this._markerClusterer.getMaxZoom()){this._clusterMarker&&this._map.removeOverlay(this._clusterMarker);for(var r=0,t;t=this._markers[r];r++)this._map.addOverlay(t);return}if(this._markers.length<this._minClusterSize){this._clusterMarker.hide();return}this._clusterMarker.setPosition(this._center),this._clusterMarker.setText(this._markerClusterer._textCalculator(this._markers))},F.prototype.remove=function(){for(var r=0,t;t=this._markers[r];r++){var e=this._markers[r].getLabel();this._markers[r].getMap()&&this._map.removeOverlay(this._markers[r]),this._markers[r].setLabel(e)}this._map.removeOverlay(this._clusterMarker),this._markers.length=0,delete this._markers},F.prototype.getBounds=function(){for(var r=new BMap.Bounds(this._center,this._center),t=0,e;e=this._markers[t];t++)r.extend(e.getPosition());return r},F.prototype.getCenter=function(){return this._center};var at;(r=>{function t(i){return{url:i.url,size:new BMap.Size(i.size.width,i.size.height),anchor:i.anchor&&new BMap.Size(i.anchor.x,i.anchor.y),offset:i.offset&&new BMap.Size(i.offset.x,i.offset.y),textColor:i.textColor,textSize:i.textSize}}r.toBaidu=t;function e(i){return{url:i.url,width:i.size.width,height:i.size.height,anchor:i.anchor&&[i.anchor.y,i.anchor.x],backgroundPosition:i.offset&&`${i.offset.x} ${i.offset.y}`,textColor:i.textColor,textSize:i.textSize}}r.toGoogle=e})(at||(at={}));class Wt{constructor(t){this.map=t}clearMarkers(){this.inner.clearMarkers()}addMarker(t){this.inner.addMarker(t.innerOverlay)}removeMarker(t){return this.inner.removeMarker(t.innerOverlay)}addMarkers(t){this.inner.addMarkers(t.map(e=>e.innerOverlay))}removeMarkers(t){return this.inner.removeMarkers(t.map(e=>e.innerOverlay))}}class Ci extends Wt{constructor(e,i){var s;super(e);f(this,"inner");this.inner=new L(e.innerMap,{gridSize:i.gridSize,maxZoom:i.maxZoom,minClusterSize:i.minClusterSize,isAverageCenter:i.averageCenter,styles:(s=i.styles)==null?void 0:s.map(l=>at.toBaidu(l)),zIndex:i.zIndex});const n=i.stylesIndexCalculator;n&&this.inner.setStylesIndexCalculator((l,d)=>n(l.length,d)),i.markers&&this.addMarkers(i.markers)}recreate(){this.inner._redraw()}}class Oi extends Wt{constructor(e,i){var s,l;super(e);f(this,"inner");this.inner=new kr(e.innerMap,(s=i.markers)==null?void 0:s.map(d=>d.innerOverlay),{gridSize:i.gridSize,maxZoom:i.maxZoom,minimumClusterSize:i.minClusterSize,averageCenter:i.averageCenter,styles:(l=i.styles)==null?void 0:l.map(d=>at.toGoogle(d)),zIndex:i.zIndex});const n=i.stylesIndexCalculator;n&&this.inner.setCalculator((d,o)=>({text:d.length,index:n(d.length,o)+1}))}recreate(){this.inner.repaint()}}class Ht{constructor(){}}class wi extends Ht{constructor(e,i){super();f(this,"inner");this.map=e,this.inner=new google.maps.places.PlacesService(e.innerMap)}search(e,i){return this.searchImpl(e,i instanceof w?i.toGoogle(this.map.coordType):i??this.map.innerMap.getCenter())}searchInBounds(e,i){return this.searchImpl(e,i.toGoogle(this.map.coordType))}searchNearBy(e,i,n){return this.searchImpl(e,{center:i.toGoogle(this.map.coordType),radius:n})}searchImpl(e,i){return new Promise((n,s)=>{this.inner.findPlaceFromQuery({query:e,fields:["formatted_address","geometry","name","place_id"],locationBias:i},(l,d)=>{switch(d){case google.maps.places.PlacesServiceStatus.ZERO_RESULTS:case google.maps.places.PlacesServiceStatus.OK:{const o=(l??[]).map(c=>di(c,this.map));n(o);break}default:s(new Error(`status: ${d}`));break}})})}}class Ei extends Ht{constructor(e,i){super();f(this,"searchRequestMap",new Map);f(this,"currentSearch");this.map=e}get inner(){return this.currentSearch}search(e,i){return this.newSearch(i instanceof w?i.toBaidu(this.map.coordType):i??this.map.innerMap.getCenter(),n=>{n.search(e)})}searchInBounds(e,i){return this.newSearch(void 0,n=>{n.searchInBounds(e,i.toBaidu(this.map.coordType))})}searchNearBy(e,i,n){return this.newSearch(void 0,s=>{s.searchNearby(e,i.toBaidu(this.map.coordType),n)})}newSearch(e,i){return new Promise((n,s)=>{const l=new BMap.LocalSearch(e??this.map.innerMap,{onSearchComplete:d=>{Array.isArray(d)&&He("当前只支持一次搜索一条数据");const o=l.getStatus();switch(o){case BMAP_STATUS_SUCCESS:{const c=[];for(let u=0;u<d.getCurrentNumPois();u++){const g=d.getPoi(u);c.push({id:g.uid,city:g.city,country:"",position:w.fromBaidu(g.point,this.map.coordType),province:g.province,title:g.title,address:g.address})}n(c);break}case BMAP_STATUS_UNKNOWN_LOCATION:n([]);break;default:s(new Error(`status: ${o}`));break}}});i(l)})}}class Vt{constructor(t,e){f(this,"onData");f(this,"onError");this.map=t,this.input=e}setSearchListener(t,e){return this.onData&&I("setSearchListener只能调用一次"),this.onData=t,this.onError=e,le}}class Pi extends Vt{constructor(e,i){super(e,i.input);f(this,"searchBox");this.searchBox=new google.maps.places.SearchBox(i.input),this.searchBox.bindTo("bounds",e.innerMap)}setSearchListener(e,i){return super.setSearchListener(e,i),ti(this.searchBox,"places_changed",()=>{const n=this.searchBox.getPlaces();e((n??[]).map(s=>di(s,this.map)))})}search(){this.input.value&&(google.maps.event.trigger(this.input,"focus",{}),google.maps.event.trigger(this.input,"keydown",{keyCode:13}))}}class Li extends Vt{constructor(e,i){super(e,i.input);f(this,"autocomplete");f(this,"placesService");this.autocomplete=e.createAutocomplete({input:i.input,bindToMap:!0}),this.placesService=e.createPlacesService({})}setSearchListener(e,i){return super.setSearchListener(e,i),this.autocomplete.addResultListener(n=>{this.searchImpl(n.country+n.province+n.city+n.district+n.street+n.streetNumber+n.title)})}search(){this.input.value&&this.searchImpl(this.input.value)}searchImpl(e){this.placesService.search(e).then(this.onData,this.onError)}}var Bi=(r=>(r[r.WORLD=1]="WORLD",r[r.STATE=5]="STATE",r[r.CITY=10]="CITY",r[r.STREET=15]="STREET",r[r.BUILDING=20]="BUILDING",r))(Bi||{});class lt{constructor(t){f(this,"latestInfoWindow");f(this,"delegate",void 0);this.element=t,process.env.NODE_ENV!=="production"&&setTimeout(()=>{this.delegate||console.warn(`${this.constructor.name}继承了AbstractMap, 但未调用setEventTargetDelegate(delegate)`)})}setEventTargetDelegate(t){this.delegate=t.setTarget(this)}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}getLatestInfoWindow(){return this.latestInfoWindow}setLatestInfoWindowInternal(t){this.latestInfoWindow=t}addOverlayMapType(t){this.addLayer(t)}removeOverlayMapType(t){this.removeLayer(t)}addControl(t){t.addTo(this)}removeControl(t){t.removeFrom(this)}getZoom(){return this.innerMap.getZoom()??0}setZoom(t){this.innerMap.setZoom(t)}}var Dr=function(t){return $r(t)&&!zr(t)};function $r(r){return!!r&&typeof r=="object"}function zr(r){var t=Object.prototype.toString.call(r);return t==="[object RegExp]"||t==="[object Date]"||Zr(r)}var Gr=typeof Symbol=="function"&&Symbol.for,Nr=Gr?Symbol.for("react.element"):60103;function Zr(r){return r.$$typeof===Nr}function Wr(r){return Array.isArray(r)?[]:{}}function Te(r,t){return t.clone!==!1&&t.isMergeableObject(r)?de(Wr(r),r,t):r}function Hr(r,t,e){return r.concat(t).map(function(i){return Te(i,e)})}function Vr(r,t){if(!t.customMerge)return de;var e=t.customMerge(r);return typeof e=="function"?e:de}function jr(r){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r).filter(function(t){return Object.propertyIsEnumerable.call(r,t)}):[]}function Ii(r){return Object.keys(r).concat(jr(r))}function Si(r,t){try{return t in r}catch{return!1}}function Fr(r,t){return Si(r,t)&&!(Object.hasOwnProperty.call(r,t)&&Object.propertyIsEnumerable.call(r,t))}function Ur(r,t,e){var i={};return e.isMergeableObject(r)&&Ii(r).forEach(function(n){i[n]=Te(r[n],e)}),Ii(t).forEach(function(n){Fr(r,n)||(Si(r,n)&&e.isMergeableObject(t[n])?i[n]=Vr(n,e)(r[n],t[n],e):i[n]=Te(t[n],e))}),i}function de(r,t,e){e=e||{},e.arrayMerge=e.arrayMerge||Hr,e.isMergeableObject=e.isMergeableObject||Dr,e.cloneUnlessOtherwiseSpecified=Te;var i=Array.isArray(t),n=Array.isArray(r),s=i===n;return s?i?e.arrayMerge(r,t,e):Ur(r,t,e):Te(t,e)}de.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(i,n){return de(i,n,e)},{})};var Yr=de,qr=Yr;const ki=ze(qr);/*!
3
3
  * isobject <https://github.com/jonschlinkert/isobject>
4
4
  *
5
5
  * Copyright (c) 2014-2017, Jon Schlinkert.
@@ -9,10 +9,10 @@
9
9
  *
10
10
  * Copyright (c) 2014-2017, Jon Schlinkert.
11
11
  * Released under the MIT License.
12
- */function xi(r){return Kr(r)===!0&&Object.prototype.toString.call(r)==="[object Object]"}function Ai(r){var t,e;return!(xi(r)===!1||(t=r.constructor,typeof t!="function")||(e=t.prototype,xi(e)===!1)||e.hasOwnProperty("isPrototypeOf")===!1)}a.Objects=void 0,(r=>{function t(u,g){return u.reduce((m,v)=>(m[g(v)]=v,m),{})}r.fromArray=t;function e(u){return u.reduce((g,m)=>(g[m[0]]=m[1],g),{})}r.fromEntries=e;function i(u){return JSON.stringify(u,(g,m)=>typeof m=="object"&&Object.getPrototypeOf(m)!==Object.prototype?m.toString!==Object.prototype.toString?m.toString():`[object ${Object.getPrototypeOf(m).constructor.name}]`:m)}r.toJsonSafely=i;function n(u){Ai(u)&&Object.keys(u).forEach(g=>{u[g]===void 0?delete u[g]:n(u[g])})}r.deleteUndefinedPropertyOnPlainObjectDeeply=n;function s(u,g,m){let v=u[g];return v===void 0&&(v=m(),u[g]=v),v}r.putIfAbsent=s;function l(u,...g){const m=Ri(g),v={};for(const C in u)m(C)||(v[C]=u[C]);return v}r.omit=l;function d(u,...g){const m=Ri(g),v={};for(const C in u)m(C)&&(v[C]=u[C]);return v}r.pick=d;function o(u,g){const m=typeof g=="string"?g.split("."):g;let v=u;for(const C of m){if(v==null)return;v=v[C]}return v}r.get=o;function c(u,g){const m=typeof g=="string"?g.split("."):g,v=o(u,m.slice(0,-1)),C=m[m.length-1];v!=null&&delete v[C]}r.del=c})(a.Objects||(a.Objects={}));function Ri(r){if(r.length<=4)return r.includes.bind(r);{const t=new Set(r);return t.has.bind(t)}}a.Objects.toJsonSafely;const Di=["single","multi"];var X=(r=>(r.auto="auto",r.none="none",r.greedy="greedy",r.cooperative="cooperative",r))(X||{});a.MapOptions=void 0,(r=>{function t(e){a.Objects.deleteUndefinedPropertyOnPlainObjectDeeply(e);const i={center:w.ZERO,zoom:5};return ki(i,e||{},{isMergeableObject:Ai})}r.create=t})(a.MapOptions||(a.MapOptions={}));class jt{constructor(t,e){f(this,"_delegate");this.innerOverlay=t,this.coordType=e}get delegate(){return this._delegate??(this._delegate=this.createDelegate().setTarget(this)),this._delegate}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}remove(){this.map.removeOverlay(this)}}class lt extends jt{constructor(t,e,i){super(t,e),this.map=i}createDelegate(){return new he(this.innerOverlay,this.map)}isVisible(){return this.innerOverlay.getVisible()}setVisible(t){this.innerOverlay.setVisible(t)}}class Ce extends jt{constructor(t,e,i){super(t,e),this.map=i}createDelegate(){return new _e(this.innerOverlay,this.map)}get overlay(){return this.innerOverlay}isVisible(){return this.overlay.isVisible()}setVisible(t){t?this.overlay.show():this.overlay.hide()}visibleOptionInternal(t){return t!==void 0&&(t||this.setVisible(!1)),this}}const Ae=class Ae extends Ce{constructor(t,e,i,n){super(t,e,i),this.state=n}isEditable(){return this.state.editable}setEditable(t){this.state.editable=t,t?this.innerOverlay.enableEditing():this.innerOverlay.disableEditing()}setStrokeColor(t){this.innerOverlay.setStrokeColor(t)}setStrokeOpacity(t){this.innerOverlay.setStrokeOpacity(t+Ae.OPACITY_DELTA)}setStrokeWeight(t){this.innerOverlay.setStrokeWeight(t)}setFillColor(t){this.innerOverlay.setFillColor(t)}setFillOpacity(t){this.innerOverlay.setFillOpacity(t+Ae.OPACITY_DELTA)}};f(Ae,"OPACITY_DELTA",.001);let U=Ae;class ht extends lt{isEditable(){return this.innerOverlay.getEditable()}setEditable(t){this.innerOverlay.setEditable(t)}setStrokeColor(t){this.innerOverlay.setOptions({strokeColor:t})}setStrokeOpacity(t){this.innerOverlay.setOptions({strokeOpacity:t})}setStrokeWeight(t){this.innerOverlay.setOptions({strokeWeight:t})}setFillColor(t){this.innerOverlay.setOptions({fillColor:t})}setFillOpacity(t){this.innerOverlay.setOptions({fillOpacity:t})}}class ct extends U{constructor(){super(...arguments);f(this,"prevCenter");f(this,"prevRadius");f(this,"isDoingSetCenter",!1);f(this,"isDoingSetRadius",!1);f(this,"eventHubDelegate");f(this,"onRadiusChanged",()=>{var i;const e=this.innerOverlay.getRadius();this.prevRadius!==e&&(this.isDoingSetRadius||(i=this.eventHubDelegate)==null||i.notify({type:"radius-changed",target:this}),this.prevRadius=e)});f(this,"onCenterChanged",()=>{var i;const e=this.innerOverlay.getCenter();this.prevCenter!==e&&(this.isDoingSetCenter||(i=this.eventHubDelegate)==null||i.notify({type:"center-changed",target:this}),this.prevCenter=e)});f(this,"resetEditableTimeoutId")}static create(e){const i=this.coordType,n=new BMap.Circle(e.center.toBaidu(i),e.radius,{enableClicking:e.clickable,enableEditing:!1,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+U.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity!=null?e.fillOpacity+U.OPACITY_DELTA:void 0}),s=new ct(n,i,this,{editable:!!e.editable}).visibleOptionInternal(e.visible);return s.state.editable&&setTimeout(()=>{s.state.editable&&n.enableEditing()},0),s}createDelegate(){return this.eventHubDelegate=new Ve(super.createDelegate(),{types:["radius-changed","center-changed"],onListen:e=>{e==="radius-changed"?(this.prevRadius=this.innerOverlay.getRadius(),this.innerOverlay.addEventListener("lineupdate",this.onRadiusChanged)):(this.prevCenter=this.innerOverlay.getCenter(),this.innerOverlay.addEventListener("lineupdate",this.onCenterChanged))},onCancel:e=>{this.innerOverlay.removeEventListener("lineupdate",e==="radius-changed"?this.onRadiusChanged:this.onCenterChanged)}})}setCenter(e){this.coordType=this.map.coordType,this.isDoingSetCenter=!0,this.innerOverlay.setCenter(e.toBaidu(this.coordType)),this.isDoingSetCenter=!1,this.state.editable&&(clearTimeout(this.resetEditableTimeoutId),this.resetEditableTimeoutId=setTimeout(()=>{this.state.editable&&(this.innerOverlay.disableEditing(),this.innerOverlay.enableEditing())},0))}getCenter(){return w.fromBaidu(this.innerOverlay.getCenter(),this.coordType)}setRadius(e){this.isDoingSetRadius=!0,this.innerOverlay.setRadius(e),this.isDoingSetRadius=!1}getRadius(){return this.innerOverlay.getRadius()}}class dt extends ht{static create(t){const e=this.coordType,i=new google.maps.Circle({center:t.center.toGoogle(e),radius:t.radius,clickable:t.clickable,editable:t.editable,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,strokeWeight:t.strokeWeight,fillColor:t.fillColor,fillOpacity:t.fillOpacity,visible:t.visible});return new dt(i,e,this)}setCenter(t){this.coordType=this.map.coordType,this.innerOverlay.setCenter(t.toGoogle(this.coordType))}getCenter(){return w.fromGoogle(this.innerOverlay.getCenter()??ie.LATLNG_ZERO,this.coordType)}setRadius(t){this.innerOverlay.setRadius(t)}getRadius(){return this.innerOverlay.getRadius()}}function $i(){BMap.OverlayV3||(BMap.OverlayV3=BMap.Overlay)}const zi={equals(r,t){return r.lat===t.lat&&r.lng===t.lng}};a.Point=void 0,(r=>{r.ZERO={x:0,y:0}})(a.Point||(a.Point={}));let Ft;function Xr(r,t,e,i,n,s){return Ft||(Ft=Jr()),new Ft(r,t,e,i,n,s)}function Jr(){$i();const r=new BMap.Point(0,0);return class extends BMap.OverlayV3{constructor(i,n=r,s=a.Point.ZERO,l,d=654,o=""){super();f(this,"container");f(this,"border");f(this,"inner");f(this,"map");f(this,"marker");this.content=i,this.position=n,this.offset=s;const c="baidu-info-box-container";this.container=document.createElement("div"),this.container.className=c,this.container.style.position="absolute";const u=m=>m.stopPropagation();this.container.onclick=u,this.container.ondblclick=u,this.container.oncontextmenu=u,this.container.onmousedown=u,this.container.onmousemove=u,this.container.onmousewheel=u,this.border=document.createElement("div"),this.border.className=`${c}__border ${o}`,this.inner=document.createElement("div"),this.inner.className=c+"__inner";const g=document.createElement("span");g.className=c+"__close",g.addEventListener("click",()=>{this.close(),this.dispatchEvent({type:"onclickclose"})}),this.inner.appendChild(i),this.border.appendChild(this.inner),this.border.appendChild(g),this.container.appendChild(this.border),l&&this.setZIndex(l),this.setMaxWidth(d),this.onMarkerPositionChanged=this.onMarkerPositionChanged.bind(this)}initialize(i){return this.map=i,i.getPanes().floatPane.appendChild(this.container),this.container}draw(){if(!this.map)return;const i=this.marker?this.marker.getPosition():this.position,n=this.map.pointToOverlayPixel(i),s=n.x+this.offset.x,l=n.y+this.offset.y;this.container.style.left=`${s}px`,this.container.style.top=`${l}px`}open(i,n){n&&n===this.marker||(this.marker&&this.detachMarker(this.marker),this.marker=n,this.marker&&this.attachMarker(this.marker),this.isOpen()?this.draw():this.marker&&!this.marker.getMap()||i.addOverlay(this))}attachMarker(i){i.__info_box__=this,i.addEventListener("dragging",this.onMarkerPositionChanged),i.addEventListener("dragend",this.onMarkerPositionChanged)}detachMarker(i){i.__info_box__=void 0,i.removeEventListener("dragging",this.onMarkerPositionChanged),i.removeEventListener("dragend",this.onMarkerPositionChanged)}close(){this.map&&(this.map.removeOverlay(this),this.marker&&(this.detachMarker(this.marker),this.marker=void 0),this.map=void 0)}isOpen(){return this.map&&this.map.getPanes().floatPane===this.container.parentNode}onMarkerPositionChanged(){this.draw()}setZIndex(i){this.container.style.zIndex=`${i}`}setMaxWidth(i){this.border.style.maxWidth=`${i}px`}setPosition(i){this.marker||(this.position=i,this.draw())}getPosition(){return this.position}setOffset(i){this.offset=i,this.draw()}getOffset(){return this.offset}}}class ut{constructor(t){this.delegate=t,this.delegate.setTarget(this)}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}}class pt extends ut{constructor(t,e,i){super(new _e(t,e)),this.inner=t,this.map=e,this.state=i}static create(t){const e=t.position||w.ZERO,i=new BMap.InfoWindow(t.content,{maxWidth:t.maxWidth,offset:t.offset&&new BMap.Size(t.offset.x,t.offset.y),enableAutoPan:!t.disableAutoPan});return new pt(i,this,{position:e})}isOpen(){return this.inner.isOpen()}open(t){t?t.innerOverlay.openInfoWindow(this.inner):this.map.innerMap.openInfoWindow(this.inner,(this.state.position||w.ZERO).toBaidu(this.map.coordType)),this.map.setLatestInfoWindowInternal(this)}close(){this.inner.isOpen()&&this.map.innerMap.closeInfoWindow()}getPosition(){const t=this.inner.getPosition();return t&&w.fromBaidu(t,this.map.coordType)||this.state.position||w.ZERO}setPosition(t){this.state.position=t,this.inner.isOpen()&&this.open()}}class gt extends ut{constructor(e,i){super(new he(e,i));f(this,"eventHub",new ni);f(this,"isOpened",!1);this.inner=e,this.map=i,e.addListener("closeclick",()=>{this.isOpened=!1,this.eventHub.hasListener("close")&&this.eventHub.notify({type:"close",target:this})}),e.addListener("map_changed",()=>{const n=this.isOpened;this.isOpened=!!e.getMap(),n&&!this.isOpened&&this.eventHub.hasListener("close")&&this.eventHub.notify({type:"close",target:this})})}static create(e){const i=e.position||w.ZERO,n=new google.maps.InfoWindow({content:e.content,maxWidth:e.maxWidth,pixelOffset:e.offset&&new google.maps.Size(e.offset.x,e.offset.y),position:i.toGoogle(this.coordType),disableAutoPan:e.disableAutoPan});return new gt(n,this)}isOpen(){return this.isOpened}addEventListener(e,i){if(e==="open"||e==="close"){this.eventHub.addEventListener(e,i);return}super.addEventListener(e,i)}removeEventListener(e,i){if(e==="open"||e==="close"){this.eventHub.removeEventListener(e,i);return}super.removeEventListener(e,i)}open(e){if(!this.isOpened){if(this.map.mapOptions.infoWindowMode==="single"){const i=this.map.getLatestInfoWindow();i&&i.close()}this.inner.open(this.map.innerMap,e==null?void 0:e.innerOverlay),this.isOpened=!0,this.map.setLatestInfoWindowInternal(this),this.eventHub.notify({type:"open",target:this})}}close(){this.isOpened&&(this.isOpened=!1,this.inner.close(),this.eventHub.notify({type:"close",target:this}))}getPosition(){return w.fromGoogle(this.inner.getPosition()??ie.LATLNG_ZERO,this.map.coordType)}setPosition(e){this.inner.setPosition(e.toGoogle(this.map.coordType))}}class mt extends Ce{constructor(t,e,i){super(t,e,i),this.baiduMap=i}static create(t){var n;const e=this.coordType,i=Xr(t.content,(n=t.position)==null?void 0:n.toBaidu(e),t.offset,t.zIndex,t.maxWidth,t.borderClass);return new mt(i,e,this)}open(t){this.innerOverlay.open(this.baiduMap.innerMap,t==null?void 0:t.innerOverlay)}close(){this.innerOverlay.close()}getPosition(){return w.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toBaidu(this.coordType))}setMaxWidth(t){this.innerOverlay.setMaxWidth(t)}setZIndex(t){this.innerOverlay.setZIndex(t)}}class ft extends ut{constructor(t,e,i){super(new he(t,i)),this.inner=t,this.coordType=e,this.map=i}static create(t){var s;const e=this.coordType,i=new google.maps.InfoWindow({content:t.content,position:(s=t.position)==null?void 0:s.toGoogle(e),pixelOffset:t.offset&&new google.maps.Size(t.offset.x,t.offset.y),zIndex:t.zIndex,maxWidth:t.maxWidth}),n=t.borderClass;return n&&i.addListener("domready",()=>{var d;const l=(d=t.content.parentElement)==null?void 0:d.parentElement;l&&l.className.includes("gm-style-iw-c")&&!l.className.includes(n)&&(l.className+=` ${n}`)}),new ft(i,e,this)}open(t){this.inner.open(this.map.innerMap,t==null?void 0:t.innerOverlay)}close(){this.inner.close()}getPosition(){return w.fromGoogle(this.inner.getPosition()??ie.LATLNG_ZERO,this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.inner.setPosition(t.toGoogle(this.coordType))}isOpen(){return this.inner.getMap()!=null}setMaxWidth(t){if(this.isOpen()){const e=this.inner.getMap(),i=this.inner.getAnchor();this.inner.close(),this.inner.setOptions({maxWidth:t}),this.inner.open(e,i)}else this.inner.setOptions({maxWidth:t})}setZIndex(t){this.inner.setZIndex(t)}}a.Strings=void 0,(r=>{function t(s,l){if(s!==void 0)return Object.values(l).includes(s)?s:void 0}r.toEnumOrNull=t;function e(s){return s.split(`
12
+ */function xi(r){return Kr(r)===!0&&Object.prototype.toString.call(r)==="[object Object]"}function Ai(r){var t,e;return!(xi(r)===!1||(t=r.constructor,typeof t!="function")||(e=t.prototype,xi(e)===!1)||e.hasOwnProperty("isPrototypeOf")===!1)}a.Objects=void 0,(r=>{function t(u,g){return u.reduce((m,v)=>(m[g(v)]=v,m),{})}r.fromArray=t;function e(u){return u.reduce((g,m)=>(g[m[0]]=m[1],g),{})}r.fromEntries=e;function i(u){return JSON.stringify(u,(g,m)=>typeof m=="object"&&Object.getPrototypeOf(m)!==Object.prototype?m.toString!==Object.prototype.toString?m.toString():`[object ${Object.getPrototypeOf(m).constructor.name}]`:m)}r.toJsonSafely=i;function n(u){Ai(u)&&Object.keys(u).forEach(g=>{u[g]===void 0?delete u[g]:n(u[g])})}r.deleteUndefinedPropertyOnPlainObjectDeeply=n;function s(u,g,m){let v=u[g];return v===void 0&&(v=m(),u[g]=v),v}r.putIfAbsent=s;function l(u,...g){const m=Ri(g),v={};for(const C in u)m(C)||(v[C]=u[C]);return v}r.omit=l;function d(u,...g){const m=Ri(g),v={};for(const C in u)m(C)&&(v[C]=u[C]);return v}r.pick=d;function o(u,g){const m=typeof g=="string"?g.split("."):g;let v=u;for(const C of m){if(v==null)return;v=v[C]}return v}r.get=o;function c(u,g){const m=typeof g=="string"?g.split("."):g,v=o(u,m.slice(0,-1)),C=m[m.length-1];v!=null&&delete v[C]}r.del=c})(a.Objects||(a.Objects={}));function Ri(r){if(r.length<=4)return r.includes.bind(r);{const t=new Set(r);return t.has.bind(t)}}a.Objects.toJsonSafely;const Di=["single","multi"];var X=(r=>(r.auto="auto",r.none="none",r.greedy="greedy",r.cooperative="cooperative",r))(X||{});a.MapOptions=void 0,(r=>{function t(e){a.Objects.deleteUndefinedPropertyOnPlainObjectDeeply(e);const i={center:w.ZERO,zoom:5};return ki(i,e||{},{isMergeableObject:Ai})}r.create=t})(a.MapOptions||(a.MapOptions={}));class jt{constructor(t,e){f(this,"_delegate");this.innerOverlay=t,this.coordType=e}get delegate(){return this._delegate??(this._delegate=this.createDelegate().setTarget(this)),this._delegate}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}remove(){this.map.removeOverlay(this)}}class ht extends jt{constructor(t,e,i){super(t,e),this.map=i}createDelegate(){return new he(this.innerOverlay,this.map)}isVisible(){return this.innerOverlay.getVisible()}setVisible(t){this.innerOverlay.setVisible(t)}}class Ce extends jt{constructor(t,e,i){super(t,e),this.map=i}createDelegate(){return new _e(this.innerOverlay,this.map)}get overlay(){return this.innerOverlay}isVisible(){return this.overlay.isVisible()}setVisible(t){t?this.overlay.show():this.overlay.hide()}visibleOptionInternal(t){return t!==void 0&&(t||this.setVisible(!1)),this}}const Ae=class Ae extends Ce{constructor(t,e,i,n){super(t,e,i),this.state=n}isEditable(){return this.state.editable}setEditable(t){this.state.editable=t,t?this.innerOverlay.enableEditing():this.innerOverlay.disableEditing()}setStrokeColor(t){this.innerOverlay.setStrokeColor(t)}setStrokeOpacity(t){this.innerOverlay.setStrokeOpacity(t+Ae.OPACITY_DELTA)}setStrokeWeight(t){this.innerOverlay.setStrokeWeight(t)}setFillColor(t){this.innerOverlay.setFillColor(t)}setFillOpacity(t){this.innerOverlay.setFillOpacity(t+Ae.OPACITY_DELTA)}};f(Ae,"OPACITY_DELTA",.001);let U=Ae;class ct extends ht{isEditable(){return this.innerOverlay.getEditable()}setEditable(t){this.innerOverlay.setEditable(t)}setStrokeColor(t){this.innerOverlay.setOptions({strokeColor:t})}setStrokeOpacity(t){this.innerOverlay.setOptions({strokeOpacity:t})}setStrokeWeight(t){this.innerOverlay.setOptions({strokeWeight:t})}setFillColor(t){this.innerOverlay.setOptions({fillColor:t})}setFillOpacity(t){this.innerOverlay.setOptions({fillOpacity:t})}}class dt extends U{constructor(){super(...arguments);f(this,"prevCenter");f(this,"prevRadius");f(this,"isDoingSetCenter",!1);f(this,"isDoingSetRadius",!1);f(this,"eventHubDelegate");f(this,"onRadiusChanged",()=>{var i;const e=this.innerOverlay.getRadius();this.prevRadius!==e&&(this.isDoingSetRadius||(i=this.eventHubDelegate)==null||i.notify({type:"radius-changed",target:this}),this.prevRadius=e)});f(this,"onCenterChanged",()=>{var i;const e=this.innerOverlay.getCenter();this.prevCenter!==e&&(this.isDoingSetCenter||(i=this.eventHubDelegate)==null||i.notify({type:"center-changed",target:this}),this.prevCenter=e)});f(this,"resetEditableTimeoutId")}static create(e){const i=this.coordType,n=new BMap.Circle(e.center.toBaidu(i),e.radius,{enableClicking:e.clickable,enableEditing:!1,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+U.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity!=null?e.fillOpacity+U.OPACITY_DELTA:void 0}),s=new dt(n,i,this,{editable:!!e.editable}).visibleOptionInternal(e.visible);return s.state.editable&&setTimeout(()=>{s.state.editable&&n.enableEditing()},0),s}createDelegate(){return this.eventHubDelegate=new je(super.createDelegate(),{types:["radius-changed","center-changed"],onListen:e=>{e==="radius-changed"?(this.prevRadius=this.innerOverlay.getRadius(),this.innerOverlay.addEventListener("lineupdate",this.onRadiusChanged)):(this.prevCenter=this.innerOverlay.getCenter(),this.innerOverlay.addEventListener("lineupdate",this.onCenterChanged))},onCancel:e=>{this.innerOverlay.removeEventListener("lineupdate",e==="radius-changed"?this.onRadiusChanged:this.onCenterChanged)}})}setCenter(e){this.coordType=this.map.coordType,this.isDoingSetCenter=!0,this.innerOverlay.setCenter(e.toBaidu(this.coordType)),this.isDoingSetCenter=!1,this.state.editable&&(clearTimeout(this.resetEditableTimeoutId),this.resetEditableTimeoutId=setTimeout(()=>{this.state.editable&&(this.innerOverlay.disableEditing(),this.innerOverlay.enableEditing())},0))}getCenter(){return w.fromBaidu(this.innerOverlay.getCenter(),this.coordType)}setRadius(e){this.isDoingSetRadius=!0,this.innerOverlay.setRadius(e),this.isDoingSetRadius=!1}getRadius(){return this.innerOverlay.getRadius()}}class ut extends ct{static create(t){const e=this.coordType,i=new google.maps.Circle({center:t.center.toGoogle(e),radius:t.radius,clickable:t.clickable,editable:t.editable,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,strokeWeight:t.strokeWeight,fillColor:t.fillColor,fillOpacity:t.fillOpacity,visible:t.visible});return new ut(i,e,this)}setCenter(t){this.coordType=this.map.coordType,this.innerOverlay.setCenter(t.toGoogle(this.coordType))}getCenter(){return w.fromGoogle(this.innerOverlay.getCenter()??ie.LATLNG_ZERO,this.coordType)}setRadius(t){this.innerOverlay.setRadius(t)}getRadius(){return this.innerOverlay.getRadius()}}function $i(){BMap.OverlayV3||(BMap.OverlayV3=BMap.Overlay)}const zi={equals(r,t){return r.lat===t.lat&&r.lng===t.lng}};a.Point=void 0,(r=>{r.ZERO={x:0,y:0}})(a.Point||(a.Point={}));let Ft;function Xr(r,t,e,i,n,s){return Ft||(Ft=Jr()),new Ft(r,t,e,i,n,s)}function Jr(){$i();const r=new BMap.Point(0,0);return class extends BMap.OverlayV3{constructor(i,n=r,s=a.Point.ZERO,l,d=654,o=""){super();f(this,"container");f(this,"border");f(this,"inner");f(this,"map");f(this,"marker");this.content=i,this.position=n,this.offset=s;const c="baidu-info-box-container";this.container=document.createElement("div"),this.container.className=c,this.container.style.position="absolute";const u=m=>m.stopPropagation();this.container.onclick=u,this.container.ondblclick=u,this.container.oncontextmenu=u,this.container.onmousedown=u,this.container.onmousemove=u,this.container.onmousewheel=u,this.border=document.createElement("div"),this.border.className=`${c}__border ${o}`,this.inner=document.createElement("div"),this.inner.className=c+"__inner";const g=document.createElement("span");g.className=c+"__close",g.addEventListener("click",()=>{this.close(),this.dispatchEvent({type:"onclickclose"})}),this.inner.appendChild(i),this.border.appendChild(this.inner),this.border.appendChild(g),this.container.appendChild(this.border),l&&this.setZIndex(l),this.setMaxWidth(d),this.onMarkerPositionChanged=this.onMarkerPositionChanged.bind(this)}initialize(i){return this.map=i,i.getPanes().floatPane.appendChild(this.container),this.container}draw(){if(!this.map)return;const i=this.marker?this.marker.getPosition():this.position,n=this.map.pointToOverlayPixel(i),s=n.x+this.offset.x,l=n.y+this.offset.y;this.container.style.left=`${s}px`,this.container.style.top=`${l}px`}open(i,n){n&&n===this.marker||(this.marker&&this.detachMarker(this.marker),this.marker=n,this.marker&&this.attachMarker(this.marker),this.isOpen()?this.draw():this.marker&&!this.marker.getMap()||i.addOverlay(this))}attachMarker(i){i.__info_box__=this,i.addEventListener("dragging",this.onMarkerPositionChanged),i.addEventListener("dragend",this.onMarkerPositionChanged)}detachMarker(i){i.__info_box__=void 0,i.removeEventListener("dragging",this.onMarkerPositionChanged),i.removeEventListener("dragend",this.onMarkerPositionChanged)}close(){this.map&&(this.map.removeOverlay(this),this.marker&&(this.detachMarker(this.marker),this.marker=void 0),this.map=void 0)}isOpen(){return this.map&&this.map.getPanes().floatPane===this.container.parentNode}onMarkerPositionChanged(){this.draw()}setZIndex(i){this.container.style.zIndex=`${i}`}setMaxWidth(i){this.border.style.maxWidth=`${i}px`}setPosition(i){this.marker||(this.position=i,this.draw())}getPosition(){return this.position}setOffset(i){this.offset=i,this.draw()}getOffset(){return this.offset}}}class pt{constructor(t){this.delegate=t,this.delegate.setTarget(this)}addEventListener(t,e){this.delegate.addEventListener(t,e)}removeEventListener(t,e){this.delegate.removeEventListener(t,e)}}class gt extends pt{constructor(t,e,i){super(new _e(t,e)),this.inner=t,this.map=e,this.state=i}static create(t){const e=t.position||w.ZERO,i=new BMap.InfoWindow(t.content,{maxWidth:t.maxWidth,offset:t.offset&&new BMap.Size(t.offset.x,t.offset.y),enableAutoPan:!t.disableAutoPan});return new gt(i,this,{position:e})}isOpen(){return this.inner.isOpen()}open(t){t?t.innerOverlay.openInfoWindow(this.inner):this.map.innerMap.openInfoWindow(this.inner,(this.state.position||w.ZERO).toBaidu(this.map.coordType)),this.map.setLatestInfoWindowInternal(this)}close(){this.inner.isOpen()&&this.map.innerMap.closeInfoWindow()}getPosition(){const t=this.inner.getPosition();return t&&w.fromBaidu(t,this.map.coordType)||this.state.position||w.ZERO}setPosition(t){this.state.position=t,this.inner.isOpen()&&this.open()}}class mt extends pt{constructor(e,i){super(new he(e,i));f(this,"eventHub",new ni);f(this,"isOpened",!1);this.inner=e,this.map=i,e.addListener("closeclick",()=>{this.isOpened=!1,this.eventHub.hasListener("close")&&this.eventHub.notify({type:"close",target:this})}),e.addListener("map_changed",()=>{const n=this.isOpened;this.isOpened=!!e.getMap(),n&&!this.isOpened&&this.eventHub.hasListener("close")&&this.eventHub.notify({type:"close",target:this})})}static create(e){const i=e.position||w.ZERO,n=new google.maps.InfoWindow({content:e.content,maxWidth:e.maxWidth,pixelOffset:e.offset&&new google.maps.Size(e.offset.x,e.offset.y),position:i.toGoogle(this.coordType),disableAutoPan:e.disableAutoPan});return new mt(n,this)}isOpen(){return this.isOpened}addEventListener(e,i){if(e==="open"||e==="close"){this.eventHub.addEventListener(e,i);return}super.addEventListener(e,i)}removeEventListener(e,i){if(e==="open"||e==="close"){this.eventHub.removeEventListener(e,i);return}super.removeEventListener(e,i)}open(e){if(!this.isOpened){if(this.map.mapOptions.infoWindowMode==="single"){const i=this.map.getLatestInfoWindow();i&&i.close()}this.inner.open(this.map.innerMap,e==null?void 0:e.innerOverlay),this.isOpened=!0,this.map.setLatestInfoWindowInternal(this),this.eventHub.notify({type:"open",target:this})}}close(){this.isOpened&&(this.isOpened=!1,this.inner.close(),this.eventHub.notify({type:"close",target:this}))}getPosition(){return w.fromGoogle(this.inner.getPosition()??ie.LATLNG_ZERO,this.map.coordType)}setPosition(e){this.inner.setPosition(e.toGoogle(this.map.coordType))}}class ft extends Ce{constructor(t,e,i){super(t,e,i),this.baiduMap=i}static create(t){var n;const e=this.coordType,i=Xr(t.content,(n=t.position)==null?void 0:n.toBaidu(e),t.offset,t.zIndex,t.maxWidth,t.borderClass);return new ft(i,e,this)}open(t){this.innerOverlay.open(this.baiduMap.innerMap,t==null?void 0:t.innerOverlay)}close(){this.innerOverlay.close()}getPosition(){return w.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toBaidu(this.coordType))}setMaxWidth(t){this.innerOverlay.setMaxWidth(t)}setZIndex(t){this.innerOverlay.setZIndex(t)}}class yt extends pt{constructor(t,e,i){super(new he(t,i)),this.inner=t,this.coordType=e,this.map=i}static create(t){var s;const e=this.coordType,i=new google.maps.InfoWindow({content:t.content,position:(s=t.position)==null?void 0:s.toGoogle(e),pixelOffset:t.offset&&new google.maps.Size(t.offset.x,t.offset.y),zIndex:t.zIndex,maxWidth:t.maxWidth}),n=t.borderClass;return n&&i.addListener("domready",()=>{var d;const l=(d=t.content.parentElement)==null?void 0:d.parentElement;l&&l.className.includes("gm-style-iw-c")&&!l.className.includes(n)&&(l.className+=` ${n}`)}),new yt(i,e,this)}open(t){this.inner.open(this.map.innerMap,t==null?void 0:t.innerOverlay)}close(){this.inner.close()}getPosition(){return w.fromGoogle(this.inner.getPosition()??ie.LATLNG_ZERO,this.coordType)}setPosition(t){this.coordType=this.map.coordType,this.inner.setPosition(t.toGoogle(this.coordType))}isOpen(){return this.inner.getMap()!=null}setMaxWidth(t){if(this.isOpen()){const e=this.inner.getMap(),i=this.inner.getAnchor();this.inner.close(),this.inner.setOptions({maxWidth:t}),this.inner.open(e,i)}else this.inner.setOptions({maxWidth:t})}setZIndex(t){this.inner.setZIndex(t)}}a.Strings=void 0,(r=>{function t(s,l){if(s!==void 0)return Object.values(l).includes(s)?s:void 0}r.toEnumOrNull=t;function e(s){return s.split(`
13
13
  `).map(l=>l.trim()).join(`
14
14
  `)}r.trimIndent=e;function i(s){return s.replace(/([^A-Z]?)([A-Z])/g,(l,d,o)=>d?`${d}-${o.toLowerCase()}`:o.toLowerCase())}r.pascal2kebab=i;function n(s){return/^-?\d+$/.test(s)}r.isInt=n})(a.Strings||(a.Strings={}));const Gi={basename(r,t){const e=r.endsWith("/")?r.slice(0,-1):r,i=e.lastIndexOf("/"),n=i>=0?e.substring(i+1):e;return t&&n.endsWith(t)?n.slice(0,-t.length):n}};var ue=(r=>(r.map="map",r.overlay="overlay",r.overlayMouseTarget="overlayMouseTarget",r.float="float",r))(ue||{});a.MapPanes=void 0,(r=>{function t(i,n){switch(i){case"float":return n.floatPane;case"overlayMouseTarget":return n.overlayMouseTarget;case"overlay":return n.overlayLayer;case"map":return n.mapPane;default:Ge(i)}}r.toGoogle=t;function e(i,n){switch(i){case"float":return n.floatPane;case"overlayMouseTarget":return n.markerMouseTarget;case"overlay":return n.markerPane;case"map":return n.mapPane;default:Ge(i)}}r.toBaidu=e})(a.MapPanes||(a.MapPanes={}));class Ni{constructor(t,e){f(this,"baidu");f(this,"google");f(this,"projection");f(this,"element",void 0);f(this,"mapPane");this.map=t,this.mapPane=e.mapPane}create(){return this.element=this.onCreate(),this.element.className+=" element-overlay",this.element}draw(){this.projection&&this.onDraw(this.projection)}getProjection(){return this.projection}asBaidu(){if(!this.baidu){const t=this;$i();class e extends BMap.OverlayV3{initialize(s){var o;const l=t.create(),d=s.getPanes();return(o=a.MapPanes.toBaidu(t.mapPane,d))==null||o.appendChild(l),l}draw(){t.draw()}}this.baidu=new e;const i=t.map.innerMap;this.projection={fromLatLngToOverlayPoint(n){return i.pointToOverlayPixel(n.toBaidu(t.map.coordType))},fromOverlayPointToLatLng(n){return w.fromBaidu(i.overlayPixelToPoint(new BMap.Pixel(n.x,n.y)),t.map.coordType)}}}return this.baidu}asGoogle(){if(!this.google){const t=this;class e extends google.maps.OverlayView{onAdd(){const n=t.create(),s=this.getPanes()??I("onAdd回调中一定会有panes");a.MapPanes.toGoogle(t.mapPane,s).appendChild(n)}draw(){t.draw()}onRemove(){var n;(n=t.element.parentNode)==null||n.removeChild(t.element)}}this.google=new e,this.projection={fromLatLngToOverlayPoint(i){return t.google.getProjection().fromLatLngToDivPixel(i.toGoogle(t.map.coordType))??a.Point.ZERO},fromOverlayPointToLatLng(i){return w.fromGoogle(t.google.getProjection().fromDivPixelToLatLng(new google.maps.Point(i.x,i.y))??ie.LATLNG_ZERO,t.map.coordType)}}}return this.google}}let Ut;function Qr(r,t,e,i,n){return Ut||(Ut=en()),new Ut(r,t,e,i,n)}function en(){return class extends google.maps.OverlayView{constructor(e,i,n,s=ue.overlayMouseTarget,l){super();f(this,"container");this.position=i,this.offset=n,this._mapPane=s,this.container=document.createElement("div"),this.container.className="label-container",this.container.style.position="absolute",l&&this.setZIndex(l),this.container.addEventListener("click",()=>{google.maps.event.trigger(this,"click")}),this.setElement(e)}setZIndex(e){this.container.style.zIndex=`${e}`}setElement(e){const i=this.container.firstChild;i!==e&&(i?this.container.replaceChild(i,e):this.container.appendChild(e))}onAdd(){const e=this.getPanes()??I("onAdd回调中一定能够获取panes");a.MapPanes.toGoogle(this._mapPane,e).appendChild(this.container)}draw(){var e,i;if(this.container.style.display=this.position?"block":"none",this.position){const n=this.getProjection();if(n){const s=n.fromLatLngToDivPixel(this.position);s&&(this.container.style.left=`${s.x+(((e=this.offset)==null?void 0:e.x)??0)}px`,this.container.style.top=`${s.y+(((i=this.offset)==null?void 0:i.y)??0)}px`)}}}onRemove(){var e;(e=this.container.parentNode)==null||e.removeChild(this.container)}setPosition(e){this.position=e,this.draw()}getPosition(){return this.position}setOffset(e){this.offset=e,this.draw()}getOffset(){return this.offset}getVisible(){return this.container.style.visibility!=="hidden"}setVisible(e){this.container.style.visibility=e?"visible":"hidden"}}}var pe;(r=>{function t(i){return typeof i=="string"?i:i.outerHTML}r.toString=t;function e(i){if(typeof i=="string"){const n=document.createElement("div");return n.innerHTML=i,n}return i}r.toElement=e})(pe||(pe={}));class Yt extends Ce{constructor(e,i,n,s){super(e,i,n);f(this,"icon");f(this,"iconAnchor");f(this,"content",void 0);f(this,"contentObserver");this.setContentInternal(s,!0)}static create(e){var l;const i=this.coordType,n=new BMap.Label(pe.toString(e.content),{position:(l=e.position)==null?void 0:l.toBaidu(i),offset:e.offset&&new BMap.Size(e.offset.x,e.offset.y)});e.zIndex&&n.setZIndex(e.zIndex),n.setStyle({border:"0px",padding:"0px",backgroundColor:"unset"});const s=new Yt(n,i,this,e.content);return n.__label__=s,s}setContentInternal(e,i=!1){this.content!==e&&(this.contentObserver&&(this.contentObserver.disconnect(),this.contentObserver=void 0),typeof e!="string"&&(this.contentObserver=new MutationObserver(()=>{this.innerOverlay.setContent(e.outerHTML)}),this.contentObserver.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0})),i||this.innerOverlay.setContent(pe.toString(e)),this.content=e)}setZIndex(e){this.innerOverlay.setZIndex(e)}getPosition(){return w.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(e){this.coordType=this.map.coordType,this.innerOverlay.setPosition(e.toBaidu(this.coordType))}getOffset(){const e=this.innerOverlay.getOffset();let i=0,n=0;return this.iconAnchor&&(i=this.iconAnchor.width,n=this.iconAnchor.height),{x:e.width-i,y:e.height-n}}setOffset(e){let i=0,n=0;this.iconAnchor&&(i=this.iconAnchor.width,n=this.iconAnchor.height),this.innerOverlay.setOffset(new BMap.Size(e.x+i,e.y+n))}setContent(e){this.setContentInternal(e)}attachIcon(e){var d;let i;if(e instanceof BMap.Icon)i=e.anchor;else if(e)if(e.anchor)i=e.anchor;else{const o=((d=e.__icon__)==null?void 0:d.baiduLabelOffset)??{x:0,y:0};i={width:e.style.anchor.width+o.x,height:e.style.anchor.height+o.y},process.env.NODE_ENV!=="production"&&setTimeout(()=>{var g,m;if(ne(e.__icon__,`${e}必须是由'SymbolIcon.toBaidu()'创建的`),!e.anchor){console.log("BaiduLabelOverlay.attachIcon","Bmap.Symbol.anchor尚未计算完成");return}const c=e.anchor.width-e.style.anchor.width,u=e.anchor.height-e.style.anchor.height;if(o.x!==c||o.y!==u){const v=[(g=e.__icon__.anchor)==null?void 0:g.x,(m=e.__icon__.anchor)==null?void 0:m.y,e.__icon__.rotation,e.__icon__.scale,e.__icon__.strokeWeight].map(C=>C??"").join(",");console.warn("BaiduLabelOverlay.attachIcon",e.__icon__,a.Strings.trimIndent(`
15
15
  为了保证Label的位置正确, 请将SymbolIcon(${v})中baiduLabelOffset的值改写成:
16
16
  ${JSON.stringify({x:c,y:u})}
17
- `))}},1)}const n=this.innerOverlay.getOffset();let s=n.width,l=n.height;this.iconAnchor&&(s-=this.iconAnchor.width,l-=this.iconAnchor.height),i&&(s+=i.width,l+=i.height),this.innerOverlay.setOffset(new BMap.Size(s,l)),this.icon=e,this.iconAnchor=i}}class qt extends lt{static create(t){var n;const e=this.coordType,i=Qr(pe.toElement(t.content),(n=t.position)==null?void 0:n.toGoogle(e),t.offset,t.mapPane,t.zIndex);return new qt(i,e,this)}setZIndex(t){this.innerOverlay.setZIndex(t)}setContent(t){this.innerOverlay.setElement(pe.toElement(t))}getPosition(){const t=this.innerOverlay.getPosition();return t?w.fromGoogle(t,this.coordType):w.ZERO}setPosition(t){this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toGoogle(this.coordType))}getOffset(){return this.innerOverlay.getOffset()??a.Point.ZERO}setOffset(t){this.innerOverlay.setOffset(t)}}const Oe={toGoogle:r=>"url"in r?a.Icon.toGoogle(r):a.SymbolIcon.toGoogle(r),toBaidu:r=>"url"in r?a.Icon.toBaidu(r):a.SymbolIcon.toBaidu(r)};a.Icon=void 0,(r=>{function t(i){return{url:i.url,size:new google.maps.Size(i.size.width,i.size.height),origin:i.origin&&new google.maps.Point(i.origin.x,i.origin.y),scaledSize:i.scaledSize&&new google.maps.Size(i.scaledSize.width,i.scaledSize.height),anchor:i.anchor&&new google.maps.Point(i.anchor.x,i.anchor.y)}}r.toGoogle=t;function e(i){return new BMap.Icon(i.url,new BMap.Size(i.size.width,i.size.height),{imageOffset:i.origin&&new BMap.Size(-i.origin.x,-i.origin.y),imageSize:i.scaledSize&&new BMap.Size(i.scaledSize.width,i.scaledSize.height),anchor:i.anchor?new BMap.Size(i.anchor.x,i.anchor.y):new BMap.Size(i.size.width/2,i.size.height)})}r.toBaidu=e})(a.Icon||(a.Icon={})),a.SymbolIcon=void 0,(r=>{function t(i){return{path:typeof i.path=="string"?i.path:i.path.google(),anchor:i.anchor&&new google.maps.Point(i.anchor.x,i.anchor.y),fillColor:i.fillColor,fillOpacity:i.fillOpacity,scale:i.scale,rotation:i.rotation,strokeColor:i.strokeColor,strokeOpacity:i.strokeOpacity,strokeWeight:i.strokeWeight}}r.toGoogle=t;function e(i){const n=new BMap.Symbol(typeof i.path=="string"?i.path:i.path.baidu(),{anchor:i.anchor&&new BMap.Size(i.anchor.x,i.anchor.y),fillColor:i.fillColor,fillOpacity:i.fillOpacity,scale:i.scale,rotation:i.rotation,strokeColor:i.strokeColor,strokeOpacity:i.strokeOpacity,strokeWeight:i.strokeWeight});return n.__icon__=i,n}r.toBaidu=e})(a.SymbolIcon||(a.SymbolIcon={}));const tn={CIRCLE:{baidu:()=>BMap_Symbol_SHAPE_CIRCLE,google:()=>google.maps.SymbolPath.CIRCLE},BACKWARD_CLOSED_ARROW:{baidu:()=>BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW,google:()=>google.maps.SymbolPath.BACKWARD_CLOSED_ARROW},BACKWARD_OPEN_ARROW:{baidu:()=>BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW,google:()=>google.maps.SymbolPath.BACKWARD_OPEN_ARROW},FORWARD_CLOSED_ARROW:{baidu:()=>BMap_Symbol_SHAPE_FORWARD_CLOSED_ARROW,google:()=>google.maps.SymbolPath.FORWARD_CLOSED_ARROW},FORWARD_OPEN_ARROW:{baidu:()=>BMap_Symbol_SHAPE_FORWARD_OPEN_ARROW,google:()=>google.maps.SymbolPath.FORWARD_OPEN_ARROW}};a.IconSequence=void 0,(r=>{function t(i){return{icon:a.SymbolIcon.toGoogle(i.icon),offset:i.offset,repeat:i.repeat,fixedRotation:i.fixedRotation}}r.toGoogle=t;function e(i){return new BMap.IconSequence(a.SymbolIcon.toBaidu(i.icon),i.offset,i.repeat??"",i.fixedRotation)}r.toBaidu=e})(a.IconSequence||(a.IconSequence={}));class ge extends Ce{constructor(t,e,i,n){super(t,e,i),this.state=n}static create(t){const e=this.coordType,i=t.icon,n={title:t.title,icon:i&&Oe.toBaidu(i),enableClicking:t.clickable,enableDragging:t.draggable,raiseOnDrag:t.crossOnDrag===void 0?!0:t.crossOnDrag,draggingCursor:t.cursor},s=new BMap.Marker(t.position.toBaidu(e,t.normalizePositionForBaidu),n);s.__create_by_tg__=!0,t.zIndex!==void 0&&s.setZIndex(t.zIndex);const l=t.clickable===void 0?!0:t.clickable,d=!!t.draggable;return new ge(s,e,this,{clickable:l,draggable:d,zIndex:t.zIndex,normalize:t.normalizePositionForBaidu}).visibleOptionInternal(t.visible)}getPosition(){return w.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(t){var e;this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toBaidu(this.coordType,this.state.normalize)),(e=this.innerOverlay.__info_box__)==null||e.onMarkerPositionChanged()}setTitle(t){this.innerOverlay.setTitle(t)}getTitle(){return this.innerOverlay.getTitle()}setIcon(t){const e=Oe.toBaidu(t);this.innerOverlay.setIcon(e);const i=this.getLabel();i&&i.attachIcon(e)}getIcon(){return this.innerOverlay.getIcon()}setClickable(t){this.state.clickable=t}isClickable(){return this.state.clickable}setDraggable(t){this.state.draggable=t,t?this.innerOverlay.enableDragging():this.innerOverlay.disableDragging()}isDraggable(){return this.state.draggable}setZIndex(t){this.state.zIndex=t,this.innerOverlay.setZIndex(t||0)}getZIndex(){return this.state.zIndex}setLabel(t){const e=this.getLabel();e&&e.attachIcon(void 0),t&&t.attachIcon(this.innerOverlay.getIcon()),this.innerOverlay.setLabel(t==null?void 0:t.innerOverlay)}getLabel(){var t;return(t=this.innerOverlay.getLabel())==null?void 0:t.__label__}}class yt extends lt{constructor(){super(...arguments);f(this,"label");f(this,"labelPositionListener");f(this,"labelVisibleListener");f(this,"labelMapChangedListener")}static create(e){const i=this.coordType,n=e.icon,s={position:e.position.toGoogle(i),title:e.title,zIndex:e.zIndex,visible:e.visible,icon:n&&Oe.toGoogle(n),clickable:e.clickable,draggable:e.draggable,crossOnDrag:e.crossOnDrag,cursor:e.cursor,anchorPoint:new google.maps.Point(0,0)};return new yt(new google.maps.Marker(s),i,this)}getPosition(){return w.fromGoogle(this.innerOverlay.getPosition(),this.coordType)}setPosition(e){this.coordType=this.map.coordType,this.innerOverlay.setPosition(e.toGoogle(this.coordType))}setTitle(e){this.innerOverlay.setTitle(e)}getTitle(){return this.innerOverlay.getTitle()||""}setIcon(e){this.innerOverlay.setIcon(Oe.toGoogle(e))}getIcon(){return this.innerOverlay.getIcon()}setClickable(e){this.innerOverlay.setClickable(e)}isClickable(){return this.innerOverlay.getClickable()}setDraggable(e){this.innerOverlay.setDraggable(e)}isDraggable(){return!!this.innerOverlay.getDraggable()}setZIndex(e){this.innerOverlay.setZIndex(e===void 0?null:e)}getZIndex(){const e=this.innerOverlay.getZIndex();return e===null?void 0:e}setLabel(e){if(this.label&&this.map.removeOverlay(this.label),this.labelPositionListener&&this.labelPositionListener.remove(),this.labelVisibleListener&&this.labelVisibleListener.remove(),this.labelMapChangedListener&&this.labelMapChangedListener.remove(),e){const i=()=>{e.innerOverlay.setPosition(this.innerOverlay.getPosition())},n=()=>{e.innerOverlay.setVisible(this.innerOverlay.getVisible())},s=()=>{this.innerOverlay.getMap()?this.map.addOverlay(e):this.map.removeOverlay(e)};s(),i(),n(),this.label=e,this.labelMapChangedListener=this.innerOverlay.addListener("map_changed",s),this.labelPositionListener=this.innerOverlay.addListener("position_changed",i),this.labelVisibleListener=this.innerOverlay.addListener("visible_changed",n)}else this.label=void 0,this.labelPositionListener=void 0,this.labelVisibleListener=void 0,this.labelMapChangedListener=void 0}}class vt extends U{constructor(){super(...arguments);f(this,"eventHubDelegate");f(this,"prevPath");f(this,"isDoingSetPath",!1);f(this,"onLineUpdate",()=>{var i;const e=this.innerOverlay.getPath();e!==this.prevPath&&(this.isDoingSetPath||(i=this.eventHubDelegate)==null||i.notify({type:this.pathEditedEventType,target:this,originalEvent:{prevPath:this.prevPath,path:e}}),this.prevPath=e)})}setPathInternal(e){this.isDoingSetPath=!0,this.innerOverlay.setPath(e),this.isDoingSetPath=!1}createDelegate(){return this.eventHubDelegate=new Ve(super.createDelegate(),{types:[this.pathEditedEventType],onListen:()=>{this.prevPath=this.innerOverlay.getPath(),this.innerOverlay.addEventListener("lineupdate",this.onLineUpdate)},onCancel:()=>{this.innerOverlay.removeEventListener("lineupdate",this.onLineUpdate),this.prevPath=void 0}})}}class _t extends vt{constructor(){super(...arguments);f(this,"pathEditedEventType","path-edited")}static create(e){var s,l;const i=this.coordType,n=new BMap.Polyline(e.path.map(d=>d.toBaidu(i)),{enableClicking:e.clickable,enableEditing:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+U.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,icons:(s=e.icons)==null?void 0:s.map(a.IconSequence.toBaidu)});return new _t(n,i,this,{editable:!!e.editable,symbolIcons:(l=e.icons)==null?void 0:l.map(d=>d.icon)}).visibleOptionInternal(e.visible)}getPath(){return this.innerOverlay.getPath().map(e=>w.fromBaidu(e,this.coordType))}setPath(e){this.coordType=this.map.coordType,this.setPathInternal(e.map(i=>i.toBaidu(this.coordType)))}remove(){var e;super.remove(),(e=this.state.symbolIcons)!=null&&e.length&&this.map.innerMap.getOverlays().filter(n=>{var o;if(!(n instanceof BMap.Marker))return!1;const s=n;if(s.__create_by_tg__)return!1;const l=s.getIcon();if(!(l instanceof BMap.Symbol))return!1;const d=l;return d.__icon__?(o=this.state.symbolIcons)==null?void 0:o.includes(d.__icon__):!1}).forEach(n=>this.map.innerMap.removeOverlay(n))}}class bt extends ht{constructor(){super(...arguments);f(this,"pathChangedListeners");f(this,"eventHubDelegate")}static create(e){var s;const i=this.coordType,n=new google.maps.Polyline({path:e.path.map(l=>l.toGoogle(i)),clickable:e.clickable,editable:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight,visible:e.visible,icons:(s=e.icons)==null?void 0:s.map(a.IconSequence.toGoogle)});return new bt(n,i,this)}setupPathChangedListeners(){const e=()=>{var n;return(n=this.eventHubDelegate)==null?void 0:n.notify({type:"path-edited",target:this})},i=this.innerOverlay.getPath();this.pathChangedListeners=a.MVCArrays.listenChanged(i,e)}clearPathChangedListeners(){var e;(e=this.pathChangedListeners)==null||e.forEach(i=>i.remove()),this.pathChangedListeners=void 0}createDelegate(){return this.eventHubDelegate=new Ve(super.createDelegate(),{types:["path-edited"],onListen:()=>this.setupPathChangedListeners(),onCancel:()=>this.clearPathChangedListeners()})}getPath(){const e=[];return this.innerOverlay.getPath().forEach(i=>{e.push(w.fromGoogle(i,this.coordType))}),e}setPath(e){var i;this.coordType=this.map.coordType,this.innerOverlay.setPath(e.map(n=>n.toGoogle(this.coordType))),(i=this.eventHubDelegate)!=null&&i.hasListener("path-edited")&&this.setupPathChangedListeners()}}class Mt extends vt{constructor(){super(...arguments);f(this,"pathEditedEventType","paths-edited")}static create(e){const i=this.coordType;e.paths.length>1&&console.warn("baidu不支持多path, 只会显示paths[0]");const n=e.paths[0]||[],s=new BMap.Polygon(n.map(l=>l.toBaidu(i)),{enableClicking:e.clickable,enableEditing:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+U.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity!=null?e.fillOpacity+U.OPACITY_DELTA:void 0});return new Mt(s,i,this,{editable:!!e.editable}).visibleOptionInternal(e.visible)}getPaths(){return[this.innerOverlay.getPath().map(e=>w.fromBaidu(e,this.coordType))]}setPaths(e){e.length>1&&console.warn("baidu不支持多path, 只会显示paths[0]"),this.coordType=this.map.coordType,this.setPathInternal((e[0]||[]).map(i=>i.toBaidu(this.coordType)))}}class Tt extends ht{constructor(){super(...arguments);f(this,"pathChangedListeners");f(this,"eventHubDelegate")}static create(e){const i=this.coordType,n=new google.maps.Polygon({paths:e.paths.map(s=>s.map(l=>l.toGoogle(i))),clickable:e.clickable,editable:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity,visible:e.visible});return new Tt(n,i,this)}setupPathChangedListeners(){const e=()=>{var n;return(n=this.eventHubDelegate)==null?void 0:n.notify({type:"paths-edited",target:this})},i=this.innerOverlay.getPaths();this.pathChangedListeners=[],i.forEach(n=>{this.pathChangedListeners.push(...a.MVCArrays.listenChanged(n,e))})}clearPathChangedListeners(){var e;(e=this.pathChangedListeners)==null||e.forEach(i=>i.remove()),this.pathChangedListeners=void 0}createDelegate(){return this.eventHubDelegate=new Ve(super.createDelegate(),{types:["paths-edited"],onListen:()=>this.setupPathChangedListeners(),onCancel:()=>this.clearPathChangedListeners()})}getPaths(){const e=this.innerOverlay.getPaths(),i=[];return e.forEach(n=>{const s=[];i.push(s),n.forEach(l=>{s.push(w.fromGoogle(l,this.coordType))})}),i}setPaths(e){var i;this.coordType=this.map.coordType,this.innerOverlay.setPaths(e.map(n=>n.map(s=>s.toGoogle(this.coordType)))),(i=this.eventHubDelegate)!=null&&i.hasListener("paths-edited")&&this.setupPathChangedListeners()}}class Ct extends vt{constructor(e,i,n,s){super(e,i,n,s);f(this,"pathEditedEventType","bounds-changed");f(this,"isDoingUpdateRectangle",!1);f(this,"onBoundsChanged",({originalEvent:e})=>{if(this.isDoingUpdateRectangle)return;const i=e.prevPath??[],n=e.path;setTimeout(()=>{let s=n;const l=n.length;if(i.length===4)if(l>i.length){for(let o=0;o<l;o++)if(i[o]==null||!zi.equals(n[o],i[o])){const c=n[(o-2+l)%l],u=n[(o-1+l)%l],g=n[o],m=n[(o+1)%l],v=n[(o+2)%l];let C;u.lat===m.lat?C=new BMap.Point(u.lng,g.lat):u.lng===m.lng?C=new BMap.Point(g.lng,u.lat):C=g,s=[c,v,C];break}}else if(l===i.length){for(let o=0;o<l;o++)if(!zi.equals(n[o],i[o])){s=[n[o],n[(o+2)%4]];break}}else l<i.length;const d=j.fromArray(s.map(o=>w.fromBaidu(o,this.coordType)));d&&(this.isDoingUpdateRectangle=!0,this.innerOverlay.setPath(d.toRectArray().map(o=>o.toBaidu(this.coordType))),this.isDoingUpdateRectangle=!1)},0)});this.addEventListener("bounds-changed",this.onBoundsChanged)}static create(e){const i=this.coordType,n=new BMap.Polygon(e.bounds.toRectArray().map(s=>s.toBaidu(i)),{enableClicking:e.clickable,enableEditing:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+U.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity!=null?e.fillOpacity+U.OPACITY_DELTA:void 0});return new Ct(n,i,this,{editable:!!e.editable}).visibleOptionInternal(e.visible)}getBounds(){return j.fromBaidu(this.innerOverlay.getBounds(),this.coordType)}setBounds(e){const i=e.toRectArray();this.innerOverlay.getPath().length===i.length?e.toRectArray().forEach((n,s)=>{this.innerOverlay.setPositionAt(s,n.toBaidu(this.coordType))}):this.setPathInternal(i.map(n=>n.toBaidu(this.coordType)))}}class Ot extends ht{static create(t){const e=this.coordType,i=new google.maps.Rectangle({bounds:t.bounds.toGoogle(e),clickable:t.clickable,editable:t.editable,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,strokeWeight:t.strokeWeight,fillColor:t.fillColor,fillOpacity:t.fillOpacity,visible:t.visible});return new Ot(i,e,this)}getBounds(){return j.fromGoogle(this.innerOverlay.getBounds()??ie.BOUNDS_ZERO,this.coordType)}setBounds(t){const e=t.toGoogle(this.coordType);e.equals(this.innerOverlay.getBounds())||this.innerOverlay.setBounds(e)}}const se=1;class rn extends at{constructor(e,i){var n;super(e);f(this,"buildInMapTypeId2BIMT");f(this,"baiduMapType2BIMT");f(this,"map");f(this,"createLabel",Yt.create);f(this,"createCircle",ct.create);f(this,"createPolygon",Mt.create);f(this,"createPolyline",_t.create);f(this,"createRectangle",Ct.create);f(this,"createInfoWindow",pt.create);f(this,"createInfoBox",mt.create);f(this,"createMarker",ge.create);f(this,"createMapTypeControl",Ue.create);f(this,"createZoomControl",Qe.create);f(this,"createStreetViewControl",Xe.create);f(this,"createScaleControl",qe.create);this.buildInMapTypeId2BIMT=a.MapType.BUILD_IN_MAP_TYPES.getValueMap(W.prototype.getId),this.baiduMapType2BIMT=a.MapType.BUILD_IN_MAP_TYPES.getValueMap(W.prototype.asBaiduMapType),this.map=new BMap.Map(e,{minZoom:i.minZoom&&i.minZoom+se,maxZoom:i.maxZoom&&i.maxZoom+se,mapType:i.buildInMapTypeId&&((n=this.buildInMapTypeId2BIMT.get(i.buildInMapTypeId))==null?void 0:n.asBaiduMapType()),enableMapClick:!1}),this.map.centerAndZoom(i.center.toBaidu(this.coordType),i.zoom+se),this.setGestureHandling(i.gestureHandling),i.infoWindowMode==="multi"&&console.warn("baidu不支持多个InfoWindow, 可能会出现未知问题"),i.mapStyle&&this.map.setMapStyleV2(i.mapStyle.baidu),this.setEventTargetDelegate(new _e(this.map,this)),this.map.addEventListener("addoverlay",s=>{const l=s.target.__info_box__;l&&(console.debug("add:info-box",l),this.map.addOverlay(l))}),this.map.addEventListener("removeoverlay",s=>{const l=s.target.__info_box__;l&&(console.debug("remove:info-box",l),this.map.removeOverlay(l))})}setGestureHandling(e=X.auto){switch(e===X.auto&&(e=this.element.parentElement&&xt.isScrollable(this.element.parentElement)?X.cooperative:X.greedy),e){case X.cooperative:this.map.disableScrollWheelZoom(),this.map.enableDragging(),this.map.enableDoubleClickZoom();break;case X.greedy:this.map.enableScrollWheelZoom(),this.map.enableDragging(),this.map.enableDoubleClickZoom();break;case X.none:this.map.disableDragging(),this.map.disableScrollWheelZoom(),this.map.disableDoubleClickZoom();break}}get innerMap(){return this.map}get coordType(){return this.getMapType().getBaiduCoordType()}addEventListener(e,i){if(e==="center-changed"){super.addEventListener("movestart",i),super.addEventListener("moving",i),super.addEventListener("moveend",i),super.addEventListener("zoomend",i);return}super.addEventListener(e,i)}removeEventListener(e,i){if(e==="center-changed"){super.removeEventListener("movestart",i),super.removeEventListener("moving",i),super.removeEventListener("moveend",i),super.removeEventListener("zoomend",i);return}super.removeEventListener(e,i)}fromContainerPointToLatLng(e){return w.fromBaidu(this.innerMap.pixelToPoint(new BMap.Pixel(e.x,e.y)),this.coordType)}fromLatLngToContainerPoint(e){return this.innerMap.pointToPixel(e.toBaidu(this.coordType))}setDefaultCursor(e){this.innerMap.setDefaultCursor(e)}setDraggable(e){e?this.innerMap.enableDragging():this.innerMap.disableDragging()}setDoubleClickZoom(e){e?this.map.enableDoubleClickZoom():this.map.disableDoubleClickZoom()}getCenter(){return w.fromBaidu(this.map.getCenter(),this.coordType)}setCenter(e){this.map.setCenter(e.toBaidu(this.coordType))}getZoom(){return super.getZoom()-se}setZoom(e){return super.setZoom(e+se)}setMinZoom(e){this.map.setMinZoom(e+se)}setMaxZoom(e){this.map.setMaxZoom(e+se)}setMapStyle(e){this.map.setMapStyleV2((e==null?void 0:e.baidu)??{styleJson:[]})}setBuildInMapTypeId(e){var n;const i=(n=this.buildInMapTypeId2BIMT.get(e))==null?void 0:n.asBaiduMapType();this.map.setMapType(i??I("理论上来说不可能为空"))}setMapType(e){this.map.setMapType(e.asBaiduMapType())}getMapType(){const e=this.map.getMapType(),i=this.baiduMapType2BIMT.get(e);return i||(e.__baidu_map_type__??I("实现asBaiduMapType()时, 忘了给实例设置__baidu_map_type__?"))}addLayer(e){this.map.addTileLayer(e.asBaiduLayer())}removeLayer(e){this.map.removeTileLayer(e.asBaiduLayer())}panTo(e){this.map.panTo(e.toBaidu(this.coordType))}panBy(e,i){this.map.panBy(e,i)}fitBounds(e,i){this.map.setViewport(e.toBaiduArray(this.coordType),{margins:i&&[i.top,i.right,i.bottom,i.left]})}getBounds(){return j.fromBaidu(this.map.getBounds(),this.coordType)}addElementOverlay(e){this.map.addOverlay(e.asBaidu())}removeElementOverlay(e){this.map.removeOverlay(e.asBaidu())}addOverlay(e){this.map.addOverlay(e.innerOverlay)}removeOverlay(e){this.map.removeOverlay(e.innerOverlay)}addCustomControl(e){if(!e.inner){const i=class extends BMap.Control{constructor(){super(...arguments);f(this,"defaultAnchor",a.ControlPositionConverter.getBaidu().toValue(e.position));f(this,"defaultOffset",new BMap.Size(0,0))}initialize(s){const l=e.onCreateElement();return s.getContainer().appendChild(l),l}};e.inner=new i,this.map.addControl(e.inner)}}removeCustomControl(e){e.inner&&(ne(e.inner instanceof BMap.Control,`control.inner(${e.inner})需要是BMap.Control`),this.map.removeControl(e.inner))}createMarkerClusterer(e){return new Ci(this,e)}createHeatmap(e){return new yi(this,e)}createAutocomplete(e){return new pi(this,e)}createSearchBox(e){return new Li(this,e)}createPlacesService(e){return new Ei(this,e)}createMapUrls(e){return new nt(e)}}class nn extends at{constructor(e,i){var s,l;super(e);f(this,"buildInMapTypeId2BIMT");f(this,"googleMapTypeId2BIMT");f(this,"map");f(this,"createLabel",qt.create);f(this,"createCircle",dt.create);f(this,"createPolygon",Tt.create);f(this,"createPolyline",bt.create);f(this,"createRectangle",Ot.create);f(this,"createInfoWindow",gt.create);f(this,"createInfoBox",ft.create);f(this,"createMarker",yt.create);f(this,"createMapTypeControl",Ye.create);f(this,"createZoomControl",et.create);f(this,"createStreetViewControl",Je.create);f(this,"createScaleControl",Ke.create);this.mapOptions=i,this.buildInMapTypeId2BIMT=a.MapType.BUILD_IN_MAP_TYPES.getValueMap(W.prototype.getId),this.googleMapTypeId2BIMT=a.MapType.BUILD_IN_MAP_TYPES.getValueMap(W.prototype.getGoogleMapTypeId);const n=i.buildInMapTypeId&&this.buildInMapTypeId2BIMT.get(i.buildInMapTypeId);this.map=new google.maps.Map(e,{center:i.center.toGoogle((n??a.MapType.NORMAL).getGoogleCoordType()),zoom:i.zoom,disableDefaultUI:!0,gestureHandling:i.gestureHandling,minZoom:i.minZoom,maxZoom:i.maxZoom,styles:(s=i.mapStyle)==null?void 0:s.google.styles,mapId:(l=i.mapStyle)==null?void 0:l.google.mapId,mapTypeId:n==null?void 0:n.getGoogleMapTypeId()}),this.setEventTargetDelegate(new he(this.map,this))}setGestureHandling(e){this.map.setOptions({gestureHandling:e})}get innerMap(){return this.map}get coordType(){return this.getMapType().getGoogleCoordType()}fromContainerPointToLatLng(e){const i=this.innerMap.getProjection(),n=this.innerMap.getBounds();if(i==null||n==null)return w.ZERO;const s=i.fromLatLngToPoint(n.getSouthWest()),l=i.fromLatLngToPoint(n.getNorthEast()),d=this.innerMap.getZoom();if(s==null||l==null||d==null)return w.ZERO;const o=Math.pow(2,d),c=new google.maps.Point(e.x/o+s.x,e.y/o+l.y);return w.fromGoogle(i.fromPointToLatLng(c)??ie.LATLNG_ZERO,this.coordType)}fromLatLngToContainerPoint(e){const i=this.innerMap.getProjection(),n=this.innerMap.getBounds();if(i==null||n==null)return a.Point.ZERO;const s=i.fromLatLngToPoint(n.getSouthWest()),l=i.fromLatLngToPoint(n.getNorthEast()),d=this.innerMap.getZoom();if(s==null||l==null||d==null)return a.Point.ZERO;const o=Math.pow(2,d),c=i.fromLatLngToPoint(e.toGoogle(this.coordType));return c==null?a.Point.ZERO:{x:(c.x-s.x)*o,y:(c.y-l.y)*o}}setDefaultCursor(e){this.innerMap.setOptions({draggableCursor:e})}setDraggable(e){this.innerMap.setOptions({draggable:e})}setDoubleClickZoom(e){this.map.setOptions({disableDoubleClickZoom:!e})}getCenter(){return w.fromGoogle(this.map.getCenter()??ie.LATLNG_ZERO,this.coordType)}setCenter(e){this.map.setCenter(e.toGoogle(this.coordType))}setMinZoom(e){this.map.setOptions({minZoom:e})}setMaxZoom(e){this.map.setOptions({maxZoom:e})}setMapStyle(e){this.map.setOptions({styles:e==null?void 0:e.google.styles,mapId:e==null?void 0:e.google.mapId})}setBuildInMapTypeId(e){var n;const i=(n=this.buildInMapTypeId2BIMT.get(e))==null?void 0:n.getGoogleMapTypeId();this.map.setMapTypeId(i??I("理论上来说不可能为空"))}setMapType(e){e instanceof W?this.map.setMapTypeId(e.getGoogleMapTypeId()):(this.map.mapTypes.set(e.id,e.asGoogleMapType()),this.map.setMapTypeId(e.id))}getMapType(){const e=this.map.getMapTypeId()??google.maps.MapTypeId.ROADMAP,i=this.googleMapTypeId2BIMT.get(e);return i||(this.map.mapTypes.get(e).__google_map_type__??I(`实现${e}的asGoogleMapType()时, 忘了给实例设置__google_map_type__?`))}addOverlayMapType(e){this.map.overlayMapTypes.push(e.asGoogleMapType())}removeOverlayMapType(e){a.MVCArrays.remove(this.map.overlayMapTypes,e.asGoogleMapType())}addLayer(e){e.asGoogleLayer().setMap(this.map)}removeLayer(e){e.asGoogleLayer().setMap(null)}panTo(e){this.map.panTo(e.toGoogle(this.coordType))}panBy(e,i){this.map.panBy(e,i)}fitBounds(e,i){this.map.fitBounds(e.toGoogle(this.coordType),i)}getBounds(){const e=this.map.getBounds();return e?j.fromGoogle(e,this.coordType):j.EMPTY}addElementOverlay(e){e.asGoogle().setMap(this.map)}removeElementOverlay(e){e.asGoogle().setMap(null)}addOverlay(e){e.innerOverlay.setMap(this.map)}removeOverlay(e){e.innerOverlay.setMap(null)}addCustomControl(e){e.inner||(e.inner=e.onCreateElement(),this.map.controls[a.ControlPositionConverter.getGoogle().toValue(e.position)].push(e.inner))}removeCustomControl(e){if(e.inner){const i=this.map.controls[a.ControlPositionConverter.getGoogle().toValue(e.position)];a.MVCArrays.remove(i,e.inner)}}createMarkerClusterer(e){return new Oi(this,e)}createHeatmap(e){return new fi(this,e)}createAutocomplete(e){return new ui(this,e)}createSearchBox(e){return new Pi(this,e)}createPlacesService(e){return new wi(this,e)}createMapUrls(e){return new rt(e)}}const wt=["3.0"],sn={baidu:{version:"3.0",key:"kXOq8Hg9BZbZEWAjXKuzd1oGreynup8h"},google:{version:"quarterly",key:"AIzaSyBcyzMel3dYFNcfcr0LOklbBQNpWycyZXo",language:"en-us",libraries:["places","visualization"]},here:{version:wt[0],key:""}};let Zi;function Kt(){return Zi||I("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})")}function Wi(r){r!=null&&(Zi=ki(sn,r))}class on extends at{constructor(e,i){var l;super(e);f(this,"map");f(this,"defaultLayers");this.mapOptions=i;const n=Kt().here;wt.includes(n.version)||I(`不支持${n.version}, HereMap当前只支持如下版本: ${wt}`);const s=new H.service.Platform({app_id:n.key.split(",")[0],app_code:n.key.split(",")[1]});this.defaultLayers=s.createDefaultLayers(),this.map=new H.Map(e,this.defaultLayers.normal.map,{zoom:i.zoom,center:(l=i.center)==null?void 0:l.toHere(this.coordType)}),new H.mapevents.Behavior(new H.mapevents.MapEvents(this.map)),H.ui.UI.createDefault(this.map,this.defaultLayers)}get innerMap(){return this.map}get coordType(){return R.wgs84}getCenter(){return w.fromHere(this.map.getCenter(),this.coordType)}setCenter(e){this.map.setCenter(e.toHere(this.coordType))}setGestureHandling(e){throw new Error("Method not implemented.")}fromContainerPointToLatLng(e){throw new Error("Method not implemented.")}fromLatLngToContainerPoint(e){throw new Error("Method not implemented.")}setDefaultCursor(e){throw new Error("Method not implemented.")}setDraggable(e){throw new Error("Method not implemented.")}setDoubleClickZoom(e){throw new Error("Method not implemented.")}setMinZoom(e){throw new Error("Method not implemented.")}setMaxZoom(e){throw new Error("Method not implemented.")}setMapStyle(e){throw new Error("Method not implemented.")}setBuildInMapTypeId(e){throw new Error("Method not implemented.")}setMapType(e){throw new Error("Method not implemented.")}getMapType(){throw new Error("Method not implemented.")}addLayer(e){throw new Error("Method not implemented.")}removeLayer(e){throw new Error("Method not implemented.")}panTo(e){throw new Error("Method not implemented.")}panBy(e,i){throw new Error("Method not implemented.")}fitBounds(e,i){throw new Error("Method not implemented.")}getBounds(){throw new Error("Method not implemented.")}addElementOverlay(e){throw new Error("Method not implemented.")}removeElementOverlay(e){throw new Error("Method not implemented.")}addOverlay(e){throw new Error("Method not implemented.")}removeOverlay(e){throw new Error("Method not implemented.")}createMarker(e){throw new Error("Method not implemented.")}createMarkerClusterer(e){throw new Error("Method not implemented.")}createHeatmap(e){throw new Error("Method not implemented.")}createAutocomplete(e){throw new Error("Method not implemented.")}createSearchBox(e){throw new Error("Method not implemented.")}createPlacesService(e){throw new Error("Method not implemented.")}createMapUrls(e){throw new Error("Method not implemented.")}createInfoWindow(e){throw new Error("Method not implemented.")}createInfoBox(e){throw new Error("Method not implemented.")}createPolyline(e){throw new Error("Method not implemented.")}createPolygon(e){throw new Error("Method not implemented.")}createRectangle(e){throw new Error("Method not implemented.")}createCircle(e){throw new Error("Method not implemented.")}createLabel(e){throw new Error("Method not implemented.")}addCustomControl(e){throw new Error("Method not implemented.")}removeCustomControl(e){throw new Error("Method not implemented.")}createMapTypeControl(e){throw new Error("Method not implemented.")}createZoomControl(e){throw new Error("Method not implemented.")}createStreetViewControl(e){throw new Error("Method not implemented.")}createScaleControl(e){throw new Error("Method not implemented.")}}var Y=(r=>(r.google="google",r.baidu="baidu",r.here="here",r))(Y||{});a.TgMapFactory=void 0,(r=>{function t(e,i,n){const s=a.MapOptions.create(n);switch(e){case"google":return new nn(i,s);case"baidu":return new rn(i,s);case"here":return new on(i,s)}}r.createMap=t})(a.TgMapFactory||(a.TgMapFactory={}));var an={VITE_APP_DEV_KEY_BAIDU:"kXOq8Hg9BZbZEWAjXKuzd1oGreynup8h",VITE_APP_DEV_KEY_GOOGLE:"AIzaSyBcyzMel3dYFNcfcr0LOklbBQNpWycyZXo",VITE_APP_DEV_KEY_HERE:"",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const ln={};function Hi(r){return a.Objects.putIfAbsent(ln,r,()=>ei(()=>hn({type:r,config:Kt()[r]})))()}function hn({type:r,config:t}){const e=window,i=cn(r);if(a.Objects.get(e,i))return Promise.resolve();switch(r!==Y.here&&!t.key&&I(`请先配置${r}地图的key`),r){case Y.google:return an.VITE_FALSE?(Pr({key:t.key,v:"3.52"}),google.maps.importLibrary("core")):Vi(`https://maps.googleapis.com/maps/api/js?key=${t.key}&language=${t.language}&v=${t.version}&libraries=${t.libraries.join(",")}`);case Y.baidu:return Vi(`https://api.map.baidu.com/api?v=${t.version}&ak=${t.key}`);case Y.here:return Ee(we("core",t.version)).then(()=>Promise.all([Ee(we("service",t.version)),Ee(we("mapevents",t.version)),Ee(we("clustering",t.version)),Ee(we("ui",t.version))])).catch(n=>(a.Objects.del(e,i),Promise.reject(n)));default:Ge(r)}}function we(r,t=wt[0]){return`https://js.api.here.com/v3/${t}/mapsjs-${r}.js`}function cn(r){switch(r){case Y.google:return"google.maps";case Y.baidu:return"BMap";case Y.here:return"H"}}let dn=0;function Vi(r,t="callback"){return new Promise((e,i)=>{const n=`__callback${dn++}`;window[n]=e;const s=document.createElement("script");s.src=`${r}&${t}=${n}`,s.onerror=i,document.body.appendChild(s)})}function Ee(r){return new Promise((t,e)=>{const i=document.createElement("script");i.src=r,i.onload=t,i.onerror=e,document.body.appendChild(i)})}function V(r,t){return{type:String,default:t,validator:e=>Object.values(r).includes(e)}}function ji(r,t){return{type:String,default:t,validator:e=>r.includes(e)}}function N(r){return{type:r,required:!0}}function T(r,t){return{type:r,default:t}}function un(r){const t={};return Object.entries(r).forEach(([e,i])=>{const n=`__${e}`;t[e]={get(){const s=this[n];return s===void 0?i:s},set(s){this[n]=s}}}),t}const Pe={enumerable:!0,configurable:!0,get:le,set:le};function Fi(r){return Object.keys(r).forEach(t=>{const e=r[t];let i=!1;typeof e=="function"?(Pe.get=e,Pe.set=le,i=!0):typeof e=="object"&&typeof e.get=="function"&&(Pe.get=e.get,Pe.set=e.set,i=!0),i&&(r[t]=Object.defineProperty(r,t,Pe))}),r}function pn(r){return Fi(r)}function Le(){return y.createCommentVNode()}function Be(r,t){const e=r.$options[t];if(e)for(const i of e)i.call(r)}function gn(r,t){for(const e of r)if(e.$options.name===t.name)return e}function mn(r,t){if(!r.default)return;const e=r.default();for(const i of e)if((i==null?void 0:i.type).name===t.name)return i}function Ui(r,t){const e={},i={},n={};return Object.keys(r).forEach(s=>{s.startsWith("on")?e[a.Strings.pascal2kebab(s.substring(2))]=r[s]:i[s]=r[s]}),t&&Object.keys(t).forEach(s=>{s.startsWith("on")&&(n[a.Strings.pascal2kebab(s.substring(2))]=t[s])}),{binds:i,listeners:e,listenerProps:n}}function J(r,t){return y.computed(()=>Ui(r,t))}function x(){return Function}const fn=()=>{let r,t;function e(n){console.log(n),r=n&&n.type,t=Date.now()}function i(n){((n&&n.type)!==r||Date.now()-(t??0)>1e3)&&e(n)}return{eventLog:e,eventLogLess:i}},Et="$map",me="onCreate",fe="onDestroy",z=y.defineComponent({inject:[Et],mounted(){Be(this,me)},beforeUnmount(){Be(this,fe)},methods:{recreate(){Be(this,fe),Be(this,me)}},render(){return Le()}}),yn=y.defineComponent({name:"tg-map",provide(){return{[Et]:y.computed(()=>this.map)}},inheritAttrs:!1,props:{type:V(Y,Y.google),center:N(w),centerSyncDelay:T(Number,300),currentCenter:T(w),lastCenter:T(w),zoom:N(Number),infoWindowMode:ji(Di),gestureHandling:V(X),minZoom:T(Number),maxZoom:T(Number),mapStyle:T(Object),mapTypeId:V(Rt),mapType:T(Object),hideLogo:T(Boolean),onLoad:x(),"onUpdate:center":x(),"onUpdate:current-center":x(),"onUpdate:last-center":x(),"onUpdate:map-type":x(),"onUpdate:map-type-id":x(),"onUpdate:zoom":x(),onError:x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),centerSyncTimeoutId:void 0}},data(){return{map:Ne(),isDestroyed:!1}},computed:{propsJson(){return a.Objects.toJsonSafely(this.$props)}},watch:{gestureHandling(r){var t;r&&((t=this.map)==null||t.setGestureHandling(r))},minZoom(r){var t;(t=this.map)==null||t.setMinZoom(r)},maxZoom(r){var t;(t=this.map)==null||t.setMaxZoom(r)},mapStyle(r){var t;(t=this.map)==null||t.setMapStyle(r)},mapTypeId(r){var t;r&&((t=this.map)==null||t.setBuildInMapTypeId(r))},mapType(r){var t;(t=this.map)==null||t.setMapType(r??a.MapType.NORMAL)}},async mounted(){const r=this.type;try{await Hi(r)}catch(n){this.$emit("error",n);return}if(this.isDestroyed){console.warn(`tg-map(type=${r})已销毁, 不需要继续执行`);return}const t=a.TgMapFactory.createMap(r,this.$refs.map,{center:this.center,zoom:this.zoom,infoWindowMode:this.infoWindowMode,gestureHandling:this.gestureHandling,minZoom:this.minZoom,maxZoom:this.maxZoom,mapStyle:this.mapStyle,buildInMapTypeId:this.mapTypeId});if(this.map=y.markRaw(t),this.mapType&&t.setMapType(this.mapType),"ready"in this.attrs.listeners&&console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"),$(this.attrs.listeners,t,["load"]),this.$emit("load",t),y.watch([()=>this.zoom,()=>this.center],([n,s],[l,d])=>{n!==l&&t.setZoom(n),s!==d&&(t.getCenter().equals(s)||t.setCenter(s))}),"update:center"in this.attrs.listenerProps){const n=()=>this.$emit("update:center",t.getCenter());t.addEventListener("center-changed",()=>{this.centerSyncDelay>0?(clearTimeout(this.centerSyncTimeoutId),this.centerSyncTimeoutId=setTimeout(n,this.centerSyncDelay)):n()})}"update:current-center"in this.attrs.listenerProps&&(this.$emit("update:current-center",this.center),t.addEventListener("center-changed",()=>{this.$emit("update:current-center",t.getCenter())})),"update:zoom"in this.attrs.listenerProps&&t.addEventListener("zoom-changed",()=>{this.$emit("update:zoom",t.getZoom())});const e="update:map-type"in this.attrs.listenerProps,i="update:map-type-id"in this.attrs.listenerProps;(e||i)&&t.addEventListener("map-type-changed",()=>{const n=t.getMapType();e&&this.$emit("update:map-type",n),i&&this.$emit("update:map-type-id",n.id)})},unmounted(){this.isDestroyed=!0,this.map&&("update:last-center"in this.attrs.listenerProps&&this.$emit("update:last-center",this.map.getCenter()),"update:center"in this.attrs.listenerProps&&(clearTimeout(this.centerSyncTimeoutId),this.$emit("update:center",this.map.getCenter())))},methods:{}}),Q=(r,t)=>{const e=r.__vccOpts||r;for(const[i,n]of t)e[i]=n;return e};function vn(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",y.mergeProps({class:"tg-map"},r.attrs.binds),[y.createElementVNode("div",{ref:"map",class:y.normalizeClass({"tg-map__map":!0,[`tg-map__map--hide-logo-${r.type}`]:r.hideLogo})},null,2),y.createCommentVNode("",!0),r.map?y.renderSlot(r.$slots,"default",{key:1}):y.createCommentVNode("",!0),y.renderSlot(r.$slots,"overlay")],16)}const ye=Q(yn,[["render",vn]]);function _n(r){if(r==null)return;let t;if(typeof r=="string"){if(t=+r,Number.isNaN(t))return r}else t=r;return`${t}px`}const bn=y.defineComponent({name:"tg-map-widget",props:{left:{type:[Number,String],default:null},top:{type:[Number,String],default:null},right:{type:[Number,String],default:null},bottom:{type:[Number,String],default:null}},computed:{topValue(){return this.top==null&&this.bottom==null?0:this.top}},methods:{dimen:_n}});function Mn(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(r.$options.name),style:y.normalizeStyle({left:r.dimen(r.left),top:r.dimen(r.topValue),right:r.dimen(r.right),bottom:r.dimen(r.bottom)})},[y.renderSlot(r.$slots,"default")],6)}const Yi=Q(bn,[["render",Mn]]),Tn=y.defineComponent({name:"tg-custom-control",mixins:[z],props:{position:V(k,k.RIGHT_BOTTOM)},setup(){return{control:void 0}},watch:{position(){this.recreate()}},onCreate(){St(this.$parent,ye)||console.warn("请将tg-custom-control放到tg-map中");const{$el:r}=this,t=class extends oi{onCreateElement(){return r}};this.control=new t(this.position),this.$map.addCustomControl(this.control)},onDestroy(){this.$map.removeCustomControl(this.control)}});function Cn(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(r.$options.name)},[y.renderSlot(r.$slots,"default")],2)}const qi=Q(Tn,[["render",Cn]]),Ki=y.defineComponent({name:"tg-map-type-control",mixins:[z],props:{position:V(k,k.TOP_LEFT),type:V(Dt),mapTypes:T(Array)},setup(){return{control:void 0}},watch:{position(r){this.control.setPosition(r)},type(){this.recreate()},mapTypes:{handler(){this.recreate()},deep:!0}},onCreate(){this.control=this.$map.createMapTypeControl(this),this.$map.addControl(this.control)},onDestroy(){this.$map.removeControl(this.control)}}),Xi=y.defineComponent({name:"tg-scale-control",mixins:[z],props:{position:V(k,k.BOTTOM_RIGHT)},setup(){return{control:void 0}},watch:{position(r){this.control.setPosition(r)}},onCreate(){this.control=this.$map.createScaleControl(this),this.$map.addControl(this.control)},onDestroy(){this.$map.removeControl(this.control)}});function Ji(){var e;const r=(e=y.getCurrentInstance())==null?void 0:e.type;let t=(r==null?void 0:r.name)??(r==null?void 0:r.__name);if(!t){const i=r==null?void 0:r.__file;i&&(t=Gi.basename(i,".vue"))}return t}function Pt(){const r=y.inject(Et);let t,e;return r==null&&I(`<${Ji()||"unknown"}>必须作为<tg-map>的子代组件`),{mapRef:r,get map(){return r.value??I("map尚未初始化")},[me](i){y.onMounted(i),t&&I(`${me}只能调用一次`),t=i},[fe](i){y.onBeforeUnmount(i),e&&I(`${fe}只能调用一次`),e=i},recreate(){e==null||e(),t==null||t()}}}const Qi=y.defineComponent({name:"tg-street-view-control",props:{position:V(k,k.RIGHT_BOTTOM)},setup(r){let t=void 0;const{map:e,onCreate:i,onDestroy:n}=Pt();return i(()=>{t=e.createStreetViewControl(r),e.addControl(t)}),n(()=>{e.removeControl(t)}),y.watch(()=>r.position,s=>{t.setPosition(s)}),Le}}),er=y.defineComponent({name:"tg-zoom-control",props:{position:V(k,k.RIGHT_BOTTOM)},setup(r){let t=void 0;const{map:e,onCreate:i,onDestroy:n}=Pt();return i(()=>{t=e.createZoomControl(r),e.addControl(t)}),n(()=>{e.removeControl(t)}),y.watch(()=>r.position,s=>{t.setPosition(s)}),Le}}),tr=y.defineComponent({name:"tg-heatmap",props:{maxIntensity:T(Number),gradient:T(Object),opacity:T(Number),radius:T(Number),data:N(Array)},setup(r){const{map:t,onCreate:e,onDestroy:i}=Pt();let n=void 0;return e(()=>{n=t.createHeatmap(r)}),i(()=>{n.remove()}),y.watch(()=>r.data,s=>n.setData(s)),y.watch([()=>r.maxIntensity,()=>r.gradient,()=>r.opacity,()=>r.radius],()=>n.setOptions(r)),Le}}),On=y.defineComponent({name:"tg-marker-clusterer",mixins:[z],props:{gridSize:T(Number),maxZoom:T(Number),minClusterSize:T(Number),averageCenter:T(Boolean),styles:T(Array),stylesIndexCalculator:T(Function),zIndex:T(Number)},setup(){return{clusterer:void 0,markers:[]}},watch:{gridSize(){this.recreate()},maxZoom(){this.recreate()},minClusterSize(){this.recreate()},averageCenter(){this.recreate()},styles:{handler(){this.recreate()},deep:!0},stylesIndexCalculator(){this.recreate()},zIndex(){this.recreate()}},onCreate(){this.clusterer=this.$map.createMarkerClusterer(this)},onDestroy(){this.clusterer.clearMarkers()},methods:{isInitiated(){return this.clusterer!=null},onAddMarker(r){this.markers.push(r),this.isInitiated()&&this.clusterer.addMarker(r)},onRemoveMarker(r){this.isInitiated()&&this.clusterer.removeMarker(r),a.Arrays.remove(this.markers,r)}}});function wn(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(r.$options.name)},[y.renderSlot(r.$slots,"default")],2)}const Xt=Q(On,[["render",wn]]),ir=y.defineComponent({name:"tg-traffic-layer",mixins:[z],setup(){return{layer:void 0}},watch:{},onCreate(){this.layer=new li,this.$map.addLayer(this.layer)},onDestroy(){this.$map.removeLayer(this.layer)}}),rr=y.defineComponent({name:"tg-circle",mixins:[z],inheritAttrs:!1,props:{center:N(w),radius:N(Number),clickable:T(Boolean),editable:T(Boolean),strokeColor:T(String),strokeOpacity:T(Number),strokeWeight:T(Number),visible:T(Boolean),fillColor:T(String),fillOpacity:T(Number),"onUpdate:center":x(),"onUpdate:radius":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),overlay:void 0,emittedRadius:void 0,emittedCenter:void 0}},watch:{center(r){if(this.emittedCenter!=null){const t=this.emittedCenter;if(this.emittedCenter=void 0,t===y.toRaw(r))return}this.overlay.setCenter(r)},radius(r){if(this.emittedRadius!=null){const t=this.emittedRadius;if(this.emittedRadius=void 0,t===r)return}this.overlay.setRadius(r)},clickable(){this.recreate()},editable(r){this.overlay.setEditable(r)},strokeColor(r){this.overlay.setStrokeColor(r)},strokeOpacity(r){this.overlay.setStrokeOpacity(r)},strokeWeight(r){this.overlay.setStrokeWeight(r)},fillColor(r){this.overlay.setFillColor(r)},fillOpacity(r){this.overlay.setFillOpacity(r)},visible(r){this.overlay.setVisible(r)}},onCreate(){this.overlay=this.$map.createCircle(this),this.$map.addOverlay(this.overlay),$(this.attrs.listeners,this.overlay),"update:center"in this.attrs.listenerProps&&this.overlay.addEventListener("center-changed",()=>{this.$emit("update:center",this.emittedCenter=this.overlay.getCenter())}),"update:radius"in this.attrs.listenerProps&&this.overlay.addEventListener("radius-changed",()=>{this.$emit("update:radius",this.emittedRadius=this.overlay.getRadius())})},onDestroy(){this.$map.removeOverlay(this.overlay)}});class En extends Ni{constructor(t,e,i,n){super(t,e),this.content=i,this.position=n}onCreate(){return this.content}onDraw(t){const e=t.fromLatLngToOverlayPoint(this.position);this.content.style.left=e.x+"px",this.content.style.top=e.y+"px"}setPosition(t){this.position=t,this.draw()}}const Pn=y.defineComponent({name:"tg-element-overlay",mixins:[z],props:{mapPane:V(ue,ue.overlayMouseTarget),position:N(w)},setup(){return{overlay:void 0}},watch:{position(r){this.overlay.setPosition(r)},mapPane(){this.recreate()}},methods:{content(){return this.$el}},onCreate(){this.overlay=new En(this.$map,this,this.content(),this.position),this.$map.addElementOverlay(this.overlay)},onDestroy(){this.$map.removeElementOverlay(this.overlay)}});function Ln(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",y.mergeProps({class:r.$options.name},r.$attrs),[y.renderSlot(r.$slots,"default")],16)}const nr=Q(Pn,[["render",Ln]]),Bn=y.defineComponent({name:"tg-marker",mixins:[z],inheritAttrs:!1,props:{position:N(w),title:T(String),icon:T(Object),clickable:T(Boolean),draggable:T(Boolean),crossOnDrag:T(Boolean),cursor:T(String),zIndex:T(Number),visible:T(Boolean),normalizePositionForBaidu:T(Boolean),autoAddToClusterer:T(Boolean,!0),"onUpdate:position":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),marker:void 0,label:Ne(),info:Ne(),emittedPosition:void 0,autoAddToClustererWhenCreate:r.autoAddToClusterer}},watch:{position(r){if(this.emittedPosition!=null){const t=this.emittedPosition;if(this.emittedPosition=void 0,t===y.toRaw(r))return}this.marker.setPosition(r)},title(r){this.marker.setTitle(r)},icon(r){r?this.marker.setIcon(r):this.recreate()},clickable(r){this.marker instanceof ge?this.recreate():this.marker.setClickable(r)},draggable(r){this.marker.setDraggable(r)},crossOnDrag(){this.recreate()},cursor(){this.recreate()},zIndex(r){this.marker instanceof ge?this.recreate():this.marker.setZIndex(r)},visible(r){this.marker.setVisible(r)},normalizePositionForBaidu(){this.recreate()},autoAddToClusterer(){this.recreate()}},onCreate(){this.marker=this.$map.createMarker(this),this.label&&this.marker.setLabel(this.label.overlay),this.$clusterer()&&this.autoAddToClusterer?this.$clusterer().onAddMarker(this.marker):this.$map.addOverlay(this.marker),this.autoAddToClustererWhenCreate=this.autoAddToClusterer,this.info&&this.info.show&&this.info.overlay.open(this.marker),$(this.attrs.listeners,this.marker),"update:position"in this.attrs.listenerProps&&this.marker.addEventListener("dragend",r=>{this.$emit("update:position",this.emittedPosition=r.position)})},onDestroy(){this.$clusterer()&&this.autoAddToClustererWhenCreate?this.$clusterer().onRemoveMarker(this.marker):this.$map.removeOverlay(this.marker)},methods:{$clusterer(){return St(this.$parent,Xt)},onAddLabel(r){this.label=r,this.marker&&this.marker.setLabel(r.overlay)},onRemoveLabel(r){this.marker.setLabel(void 0),this.label=void 0},onAddInfo(r){this.info=r,this.marker&&r.show&&r.overlay.open(this.marker)},onRemoveInfo(r){r.overlay.close(),this.info=void 0},onInfoShowChanged(r,t){t?r.overlay.open(this.marker):r.overlay.close()}}});function In(r,t,e,i,n,s){return y.renderSlot(r.$slots,"default")}const Ie=Q(Bn,[["render",In]]),Sn=y.defineComponent({name:"tg-info-box",mixins:[z],inheritAttrs:!1,props:{show:N(Boolean),position:T(w),offset:T(Object),maxWidth:T(Number),borderClass:T(String),zIndex:T(Number),"onUpdate:show":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),overlay:void 0}},watch:{show(r){this.$marker()?this.$marker().onInfoShowChanged(this,r):r?this.overlay.open():this.overlay.close()},position(r){this.overlay.setPosition(r)},offset(){this.recreate()},maxWidth(r){this.overlay.setMaxWidth(r)},borderClass(){this.recreate()},zIndex(r){this.overlay.setZIndex(r)}},onCreate(){this.overlay=this.$map.createInfoBox(this.getOptions()),this.$marker()?this.$marker().onAddInfo(this):this.show&&this.overlay.open(),"update:show"in this.attrs.listenerProps&&this.overlay.addEventListener("closeclick",()=>{this.$emit("update:show",!1)}),$(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveInfo(this):this.overlay.close()},methods:{getOptions(){return{content:this.content(),position:this.position,offset:this.offset,zIndex:this.zIndex,maxWidth:this.maxWidth,borderClass:this.borderClass}},content(){return this.$el},$marker(){return We(Ie,this.$parent,ye)},open(r){this.overlay.open(r)},close(){this.overlay.close()}}});function kn(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",y.mergeProps({class:r.$options.name},r.attrs.binds),[y.renderSlot(r.$slots,"default")],16)}const sr=Q(Sn,[["render",kn]]),xn=y.defineComponent({name:"tg-info-window",mixins:[z],inheritAttrs:!1,props:{show:N(Boolean),position:T(w),maxWidth:T(Number),offset:T(Object),disableAutoPan:T(Boolean),"onUpdate:show":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),overlay:void 0}},watch:{show(r){this.$marker()?this.$marker().onInfoShowChanged(this,r):r?this.overlay.open():this.overlay.close()},position(r){this.overlay.setPosition(r)},maxWidth(){this.recreate()},offset(){this.recreate()},disableAutoPan(){this.recreate()}},methods:{content(){return this.$el},$marker(){return We(Ie,this.$parent,ye)},getOptions(){return{content:this.content(),position:this.position,maxWidth:this.maxWidth,offset:this.offset,disableAutoPan:this.disableAutoPan}}},onCreate(){this.overlay=this.$map.createInfoWindow(this.getOptions()),this.$marker()?this.$marker().onAddInfo(this):this.show&&this.overlay.open(),this.overlay.addEventListener("open",()=>{this.$emit("update:show",!0)}),this.overlay.addEventListener("close",()=>{this.$emit("update:show",!1)}),$(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveInfo(this):this.overlay.close()}});function An(r,t,e,i,n,s){return y.withDirectives((y.openBlock(),y.createElementBlock("div",y.mergeProps({class:r.$options.name},r.attrs.binds),[y.renderSlot(r.$slots,"default")],16)),[[y.vShow,r.show]])}const or=Q(xn,[["render",An]]),Rn=y.defineComponent({name:"tg-label",mixins:[z],inheritAttrs:!1,props:{position:T(w),offset:T(Object),zIndex:T(Number),mapPane:V(ue)},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t),overlay:void 0}},watch:{position(r){this.overlay.setPosition(r)},offset(r){this.overlay.setOffset(r)},zIndex(r){this.overlay.setZIndex(r)},visible(r){this.overlay.setVisible(r)},mapPane(){this.recreate()}},methods:{content(){return this.$el},marker(){var r;return(r=this.$marker())==null?void 0:r.marker},$marker(){return We(Ie,this.$parent,ye)},getOptions(){return{content:this.content(),position:this.position,offset:this.offset,zIndex:this.zIndex,mapPane:this.mapPane}}},onCreate(){this.overlay=this.$map.createLabel(this.getOptions()),this.$marker()?this.$marker().onAddLabel(this):this.$map.addOverlay(this.overlay),$(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveLabel(this):this.$map.removeOverlay(this.overlay)}});function Dn(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",y.mergeProps({class:r.$options.name},r.attrs.binds),[y.renderSlot(r.$slots,"default")],16)}const ar=Q(Rn,[["render",Dn]]),lr=y.defineComponent({name:"tg-polygon",mixins:[z],inheritAttrs:!1,props:{paths:N(Array),clickable:T(Boolean),editable:T(Boolean),strokeColor:T(String),strokeOpacity:T(Number),strokeWeight:T(Number),visible:T(Boolean),fillColor:T(String),fillOpacity:T(Number),"onUpdate:paths":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),overlay:void 0,emittedPaths:void 0}},watch:{paths:{handler(r){if(this.emittedPaths!=null){const t=this.emittedPaths;if(this.emittedPaths=void 0,t.length===r.length&&t.every((e,i)=>e===y.toRaw(r[i])))return}this.overlay.setPaths(r)},deep:!0},clickable(){this.recreate()},editable(r){this.overlay.setEditable(r)},strokeColor(r){this.overlay.setStrokeColor(r)},strokeOpacity(r){this.overlay.setStrokeOpacity(r)},strokeWeight(r){this.overlay.setStrokeWeight(r)},fillColor(r){this.overlay.setFillColor(r)},fillOpacity(r){this.overlay.setFillOpacity(r)},visible(r){this.overlay.setVisible(r)}},onCreate(){this.overlay=this.$map.createPolygon(this),this.$map.addOverlay(this.overlay),$(this.attrs.listeners,this.overlay),"update:paths"in this.attrs.listenerProps&&this.overlay.addEventListener("paths-edited",()=>{this.$emit("update:paths",this.emittedPaths=this.overlay.getPaths())})},onDestroy(){this.$map.removeOverlay(this.overlay)}}),hr=y.defineComponent({name:"tg-polyline",mixins:[z],inheritAttrs:!1,props:{path:N(Array),icons:T(Array),clickable:T(Boolean),editable:T(Boolean),strokeColor:T(String),strokeOpacity:T(Number),strokeWeight:T(Number),visible:T(Boolean),"onUpdate:path":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),overlay:void 0,emittedPath:void 0}},watch:{path:{handler(r){if(this.emittedPath!=null){const t=this.emittedPath;if(this.emittedPath=void 0,t===y.toRaw(r))return}this.overlay.setPath(r)},deep:!0},icons:{handler(){this.recreate()},deep:!0},clickable(){this.recreate()},editable(r){this.overlay.setEditable(r)},strokeColor(r){this.overlay.setStrokeColor(r)},strokeOpacity(r){this.overlay.setStrokeOpacity(r)},strokeWeight(r){this.overlay.setStrokeWeight(r)},visible(r){this.overlay.setVisible(r)}},onCreate(){this.overlay=this.$map.createPolyline(this),this.$map.addOverlay(this.overlay),$(this.attrs.listeners,this.overlay),"update:path"in this.attrs.listenerProps&&this.overlay.addEventListener("path-edited",()=>{this.$emit("update:path",this.emittedPath=this.overlay.getPath())})},onDestroy(){this.overlay.remove()}}),cr=y.defineComponent({name:"tg-rectangle",mixins:[z],inheritAttrs:!1,props:{bounds:N(Object),clickable:T(Boolean),editable:T(Boolean),strokeColor:T(String),strokeOpacity:T(Number),strokeWeight:T(Number),visible:T(Boolean),fillColor:T(String),fillOpacity:T(Number),"onUpdate:bounds":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),overlay:void 0,emittedBounds:void 0}},watch:{bounds(r){if(this.emittedBounds!=null){const t=this.emittedBounds;if(this.emittedBounds=void 0,t.equals(r))return}this.overlay.setBounds(r)},clickable(){this.recreate()},editable(r){this.overlay.setEditable(r)},strokeColor(r){this.overlay.setStrokeColor(r)},strokeOpacity(r){this.overlay.setStrokeOpacity(r)},strokeWeight(r){this.overlay.setStrokeWeight(r)},fillColor(r){this.overlay.setFillColor(r)},fillOpacity(r){this.overlay.setFillOpacity(r)},visible(r){this.overlay.setVisible(r)}},onCreate(){this.overlay=this.$map.createRectangle(this),this.$map.addOverlay(this.overlay),$(this.attrs.listeners,this.overlay),"update:bounds"in this.attrs.listenerProps&&this.overlay.addEventListener("bounds-changed",()=>{this.$emit("update:bounds",this.emittedBounds=this.overlay.getBounds())})},onDestroy(){this.$map.removeOverlay(this.overlay)}}),$n=["beforeUpdate","updated"],zn={install(r,t={}){if(t.enable!==!1){const e=y.defineComponent({beforeCreate(){const i=Ji()??"",s=(t.nameRegex||/^[A-Z]/).test(i)?l=>{t.hookNames?t.hookNames.includes(l)&&console.debug("[lifecycle]",i,l):$n.includes(l)||console.debug("[lifecycle]",i,l)}:le;s("beforeCreate"),this.__life_impl=s},created(){this.__life("created")},beforeMount(){this.__life("beforeMount")},mounted(){this.__life("mounted")},beforeUpdate(){this.__life("beforeUpdate")},updated(){this.__life("updated")},beforeUnmount(){this.__life("beforeUnmount")},unmounted(){this.__life("unmounted")},methods:{__life(i){this.__life_impl(i)}},onCreate(){this.__life("onCreate")},onDestroy(){this.__life("onDestroy")}});r.mixin(e)}}},Gn=6378137;function Se(r){return r*Math.PI/180}function dr(r){return r*180/Math.PI}function Nn(r,t){if(r.lat===t.lat&&r.lng===t.lng)return 0;const e=Se((r.lat+t.lat)/2),i=Se((r.lat-t.lat)/2),n=Se((r.lng-t.lng)/2);let s=Math.sin(i),l=Math.sin(n),d=Math.sin(e);const o=Gn,c=1/298.257;s=s*s,l=l*l,d=d*d;const u=s*(1-l)+(1-d)*l,g=(1-s)*(1-l)+d*l,m=Math.atan(Math.sqrt(u/g)),v=Math.sqrt(u*g)/m,C=2*m*o,M=(3*v-1)/2/g,O=(3*v+1)/2/u;return C*(1+c*(M*d*(1-s)-O*(1-d)*s))}function ur(r,t,e){const n=63567523142e-4,s=1/298.257223563,l=Se(t),d=Math.sin(l),o=Math.cos(l),c=(1-s)*Math.tan(Se(r.lat)),u=1/Math.sqrt(1+c*c),g=c*u,m=Math.atan2(c,o),v=u*d,C=1-v*v,M=C*(6378137*6378137-n*n)/(n*n),O=1+M/16384*(4096+M*(-768+M*(320-175*M))),h=M/1024*(256+M*(-128+M*(74-47*M)));let p=0,_=0,b=0,E=e/(n*O),P=2*Math.PI;for(;Math.abs(E-P)>1e-12;){p=Math.cos(2*m+E),_=Math.sin(E),b=Math.cos(E);const q=h*_*(p+h/4*(b*(-1+2*p*p)-h/6*p*(-3+4*_*_)*(-3+4*p*p)));P=E,E=e/(n*O)+q}const B=g*_-u*b*o,D=Math.atan2(g*b+u*_*o,(1-s)*Math.sqrt(v*v+B*B)),Z=Math.atan2(_*d,u*b-g*_*o),S=s/16*C*(4+s*(4-3*C)),ee=Z-(1-S)*s*v*(E+S*_*(p+S*b*(-1+2*p*p)));return{lng:r.lng+dr(ee),lat:dr(D)}}const Zn={getDistance:Nn,getDestination:ur};var Wn={VITE_APP_DEV_KEY_BAIDU:"kXOq8Hg9BZbZEWAjXKuzd1oGreynup8h",VITE_APP_DEV_KEY_GOOGLE:"AIzaSyBcyzMel3dYFNcfcr0LOklbBQNpWycyZXo",VITE_APP_DEV_KEY_HERE:"",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Hn={install(r,t){if(Wi(t),Wn.VITE_FALSE){const i=Object.assign({"./TgMap.vue":ye,"./TgMapWidget.vue":Yi,"./controls/TgCustomControl.vue":qi,"./controls/TgMapTypeControl.vue":Ki,"./controls/TgScaleControl.vue":Xi,"./controls/TgStreetViewControl.vue":Qi,"./controls/TgZoomControl.vue":er,"./extra/TgHeatmap.vue":tr,"./extra/TgMarkerClusterer.vue":Xt,"./layers/TgTrafficLayer.vue":ir,"./overlays/TgCircle.vue":rr,"./overlays/TgElementOverlay.vue":nr,"./overlays/TgInfoBox.vue":sr,"./overlays/TgInfoWindow.vue":or,"./overlays/TgLabel.vue":ar,"./overlays/TgMarker.vue":Ie,"./overlays/TgPolygon.vue":lr,"./overlays/TgPolyline.vue":hr,"./overlays/TgRectangle.vue":cr});Object.keys(i).forEach(n=>{const s=i[n];r.component(s.name??I(`Tg开头的组件必须设置name: ${n}`),s)})}const e=r.config.optionMergeStrategies;e[me]=e[fe]=(i,n)=>i?[...new Set([].concat(i,n))]:Array.isArray(n)?n:[n]}};a.AbstractControl=je,a.AbstractMap=at,a.Autocomplete=$t,a.BaiduAutocomplete=pi,a.BaiduCircle=ct,a.BaiduControl=Fe,a.BaiduHeatmap=yi,a.BaiduInfoBoxOverlay=mt,a.BaiduInfoWindow=pt,a.BaiduMapTypeControl=Ue,a.BaiduMapUrls=nt,a.BaiduMarker=ge,a.BaiduMarkerClusterer=Ci,a.BaiduOverlay=Ce,a.BaiduPlacesService=Ei,a.BaiduPolyShape=vt,a.BaiduPolygon=Mt,a.BaiduPolyline=_t,a.BaiduRectangle=Ct,a.BaiduScaleControl=qe,a.BaiduSearchBox=Li,a.BaiduStreetViewControl=Xe,a.BaiduZoomControl=Qe,a.BuildInMapType=W,a.BuildInMapTypeId=Rt,a.CachedValue=ce,a.ControlPosition=k,a.CoordType=R,a.CustomControl=oi,a.ElementOverlay=Ni,a.EmptyControl=ai,a.FastFindValues=si,a.GestureHandlingOptions=X,a.GoogleAutocomplete=ui,a.GoogleCircle=dt,a.GoogleControl=be,a.GoogleHeatmap=fi,a.GoogleInfoBoxOverlay=ft,a.GoogleInfoWindow=gt,a.GoogleMapTypeControl=Ye,a.GoogleMapUrls=rt,a.GoogleMarker=yt,a.GoogleMarkerClusterer=Oi,a.GoogleOverlay=lt,a.GooglePlacesService=wi,a.GooglePolygon=Tt,a.GooglePolyline=bt,a.GoogleRectangle=Ot,a.GoogleScaleControl=Ke,a.GoogleSearchBox=Pi,a.GoogleStreetViewControl=Je,a.GoogleZoomControl=et,a.Heatmap=zt,a.ImageMapType=Er,a.InfoWindow=ut,a.InfoWindowModeValues=Di,a.KeyValue=At,a.LatLng=w,a.LatLngBounds=j,a.LifecycleLogPlugin=zn,a.MIXIN_HOOK_CREATE=me,a.MIXIN_HOOK_DESTROY=fe,a.MIXIN_MAP_NAME=Et,a.MapMixin=z,a.MapPane=ue,a.MapTypeControlType=Dt,a.MapUrls=Gt,a.MapZoom=Bi,a.MarkerClusterer=Wt,a.Overlay=jt,a.PlacesService=Ht,a.SearchBox=Vt,a.SphericalUtils=Zn,a.SymbolPath=tn,a.TgCircle=rr,a.TgCustomControl=qi,a.TgElementOverlay=nr,a.TgHeatmap=tr,a.TgInfoBox=sr,a.TgInfoWindow=or,a.TgLabel=ar,a.TgMap=ye,a.TgMapType=Y,a.TgMapTypeControl=Ki,a.TgMapWidget=Yi,a.TgMarker=Ie,a.TgMarkerClusterer=Xt,a.TgPolygon=lr,a.TgPolyline=hr,a.TgRectangle=cr,a.TgScaleControl=Xi,a.TgStreetViewControl=Qi,a.TgTrafficLayer=ir,a.TgZoomControl=er,a.TrafficLayer=li,a.UnionIcon=Oe,a.assert=ne,a.assertNever=Ge,a.callHook=Be,a.computedSaveOnThis=un,a.createAsyncSingleton=ei,a.createEmptyVNode=Le,a.createPropertyObject=Fi,a.createPropertyObjectTyped=pn,a.debug=Tr,a.default=Hn,a.eventProp=x,a.extractVNodeFromSlotsByComponent=mn,a.findAncestorComponentByType=We,a.findByComponentType=gn,a.getDestination=ur,a.getTgMapConfig=Kt,a.isComponentByType=Ze,a.isDef=Cr,a.isEntryValueDef=Qt,a.isInstanceOf=vr,a.lateinit=yr,a.loadCachedMap=Hi,a.noop=le,a.optionalProp=T,a.path=Gi,a.requiredProp=N,a.safeAs=_r,a.safeAsComponent=St,a.setTgMapConfig=Wi,a.splitAttrs=Ui,a.stringEnumProp=V,a.stringUnionPropFromValues=ji,a.throwError=I,a.throwUnsupported=He,a.todo=Mr,a.typed=Ne,a.unwrapStringEnumValue=br,a.useEventLogMethods=fn,a.useSplittedAttrs=J,a.useTgMapInner=Pt,Object.defineProperties(a,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
17
+ `))}},1)}const n=this.innerOverlay.getOffset();let s=n.width,l=n.height;this.iconAnchor&&(s-=this.iconAnchor.width,l-=this.iconAnchor.height),i&&(s+=i.width,l+=i.height),this.innerOverlay.setOffset(new BMap.Size(s,l)),this.icon=e,this.iconAnchor=i}}class qt extends ht{static create(t){var n;const e=this.coordType,i=Qr(pe.toElement(t.content),(n=t.position)==null?void 0:n.toGoogle(e),t.offset,t.mapPane,t.zIndex);return new qt(i,e,this)}setZIndex(t){this.innerOverlay.setZIndex(t)}setContent(t){this.innerOverlay.setElement(pe.toElement(t))}getPosition(){const t=this.innerOverlay.getPosition();return t?w.fromGoogle(t,this.coordType):w.ZERO}setPosition(t){this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toGoogle(this.coordType))}getOffset(){return this.innerOverlay.getOffset()??a.Point.ZERO}setOffset(t){this.innerOverlay.setOffset(t)}}const Oe={toGoogle:r=>"url"in r?a.Icon.toGoogle(r):a.SymbolIcon.toGoogle(r),toBaidu:r=>"url"in r?a.Icon.toBaidu(r):a.SymbolIcon.toBaidu(r)};a.Icon=void 0,(r=>{function t(i){return{url:i.url,size:new google.maps.Size(i.size.width,i.size.height),origin:i.origin&&new google.maps.Point(i.origin.x,i.origin.y),scaledSize:i.scaledSize&&new google.maps.Size(i.scaledSize.width,i.scaledSize.height),anchor:i.anchor&&new google.maps.Point(i.anchor.x,i.anchor.y)}}r.toGoogle=t;function e(i){return new BMap.Icon(i.url,new BMap.Size(i.size.width,i.size.height),{imageOffset:i.origin&&new BMap.Size(-i.origin.x,-i.origin.y),imageSize:i.scaledSize&&new BMap.Size(i.scaledSize.width,i.scaledSize.height),anchor:i.anchor?new BMap.Size(i.anchor.x,i.anchor.y):new BMap.Size(i.size.width/2,i.size.height)})}r.toBaidu=e})(a.Icon||(a.Icon={})),a.SymbolIcon=void 0,(r=>{function t(i){return{path:typeof i.path=="string"?i.path:i.path.google(),anchor:i.anchor&&new google.maps.Point(i.anchor.x,i.anchor.y),fillColor:i.fillColor,fillOpacity:i.fillOpacity,scale:i.scale,rotation:i.rotation,strokeColor:i.strokeColor,strokeOpacity:i.strokeOpacity,strokeWeight:i.strokeWeight}}r.toGoogle=t;function e(i){const n=new BMap.Symbol(typeof i.path=="string"?i.path:i.path.baidu(),{anchor:i.anchor&&new BMap.Size(i.anchor.x,i.anchor.y),fillColor:i.fillColor,fillOpacity:i.fillOpacity,scale:i.scale,rotation:i.rotation,strokeColor:i.strokeColor,strokeOpacity:i.strokeOpacity,strokeWeight:i.strokeWeight});return n.__icon__=i,n}r.toBaidu=e})(a.SymbolIcon||(a.SymbolIcon={}));const tn={CIRCLE:{baidu:()=>BMap_Symbol_SHAPE_CIRCLE,google:()=>google.maps.SymbolPath.CIRCLE},BACKWARD_CLOSED_ARROW:{baidu:()=>BMap_Symbol_SHAPE_BACKWARD_CLOSED_ARROW,google:()=>google.maps.SymbolPath.BACKWARD_CLOSED_ARROW},BACKWARD_OPEN_ARROW:{baidu:()=>BMap_Symbol_SHAPE_BACKWARD_OPEN_ARROW,google:()=>google.maps.SymbolPath.BACKWARD_OPEN_ARROW},FORWARD_CLOSED_ARROW:{baidu:()=>BMap_Symbol_SHAPE_FORWARD_CLOSED_ARROW,google:()=>google.maps.SymbolPath.FORWARD_CLOSED_ARROW},FORWARD_OPEN_ARROW:{baidu:()=>BMap_Symbol_SHAPE_FORWARD_OPEN_ARROW,google:()=>google.maps.SymbolPath.FORWARD_OPEN_ARROW}};a.IconSequence=void 0,(r=>{function t(i){return{icon:a.SymbolIcon.toGoogle(i.icon),offset:i.offset,repeat:i.repeat,fixedRotation:i.fixedRotation}}r.toGoogle=t;function e(i){return new BMap.IconSequence(a.SymbolIcon.toBaidu(i.icon),i.offset,i.repeat??"",i.fixedRotation)}r.toBaidu=e})(a.IconSequence||(a.IconSequence={}));class ge extends Ce{constructor(t,e,i,n){super(t,e,i),this.state=n}static create(t){const e=this.coordType,i=t.icon,n={title:t.title,icon:i&&Oe.toBaidu(i),enableClicking:t.clickable,enableDragging:t.draggable,raiseOnDrag:t.crossOnDrag===void 0?!0:t.crossOnDrag,draggingCursor:t.cursor},s=new BMap.Marker(t.position.toBaidu(e,t.normalizePositionForBaidu),n);s.__create_by_tg__=!0,t.zIndex!==void 0&&s.setZIndex(t.zIndex);const l=t.clickable===void 0?!0:t.clickable,d=!!t.draggable;return new ge(s,e,this,{clickable:l,draggable:d,zIndex:t.zIndex,normalize:t.normalizePositionForBaidu}).visibleOptionInternal(t.visible)}getPosition(){return w.fromBaidu(this.innerOverlay.getPosition(),this.coordType)}setPosition(t){var e;this.coordType=this.map.coordType,this.innerOverlay.setPosition(t.toBaidu(this.coordType,this.state.normalize)),(e=this.innerOverlay.__info_box__)==null||e.onMarkerPositionChanged()}setTitle(t){this.innerOverlay.setTitle(t)}getTitle(){return this.innerOverlay.getTitle()}setIcon(t){const e=Oe.toBaidu(t);this.innerOverlay.setIcon(e);const i=this.getLabel();i&&i.attachIcon(e)}getIcon(){return this.innerOverlay.getIcon()}setClickable(t){this.state.clickable=t}isClickable(){return this.state.clickable}setDraggable(t){this.state.draggable=t,t?this.innerOverlay.enableDragging():this.innerOverlay.disableDragging()}isDraggable(){return this.state.draggable}setZIndex(t){this.state.zIndex=t,this.innerOverlay.setZIndex(t||0)}getZIndex(){return this.state.zIndex}setLabel(t){const e=this.getLabel();e&&e.attachIcon(void 0),t&&t.attachIcon(this.innerOverlay.getIcon()),this.innerOverlay.setLabel(t==null?void 0:t.innerOverlay)}getLabel(){var t;return(t=this.innerOverlay.getLabel())==null?void 0:t.__label__}}class vt extends ht{constructor(){super(...arguments);f(this,"label");f(this,"labelPositionListener");f(this,"labelVisibleListener");f(this,"labelMapChangedListener")}static create(e){const i=this.coordType,n=e.icon,s={position:e.position.toGoogle(i),title:e.title,zIndex:e.zIndex,visible:e.visible,icon:n&&Oe.toGoogle(n),clickable:e.clickable,draggable:e.draggable,crossOnDrag:e.crossOnDrag,cursor:e.cursor,anchorPoint:new google.maps.Point(0,0)};return new vt(new google.maps.Marker(s),i,this)}getPosition(){return w.fromGoogle(this.innerOverlay.getPosition(),this.coordType)}setPosition(e){this.coordType=this.map.coordType,this.innerOverlay.setPosition(e.toGoogle(this.coordType))}setTitle(e){this.innerOverlay.setTitle(e)}getTitle(){return this.innerOverlay.getTitle()||""}setIcon(e){this.innerOverlay.setIcon(Oe.toGoogle(e))}getIcon(){return this.innerOverlay.getIcon()}setClickable(e){this.innerOverlay.setClickable(e)}isClickable(){return this.innerOverlay.getClickable()}setDraggable(e){this.innerOverlay.setDraggable(e)}isDraggable(){return!!this.innerOverlay.getDraggable()}setZIndex(e){this.innerOverlay.setZIndex(e===void 0?null:e)}getZIndex(){const e=this.innerOverlay.getZIndex();return e===null?void 0:e}setLabel(e){if(this.label&&this.map.removeOverlay(this.label),this.labelPositionListener&&this.labelPositionListener.remove(),this.labelVisibleListener&&this.labelVisibleListener.remove(),this.labelMapChangedListener&&this.labelMapChangedListener.remove(),e){const i=()=>{e.innerOverlay.setPosition(this.innerOverlay.getPosition())},n=()=>{e.innerOverlay.setVisible(this.innerOverlay.getVisible())},s=()=>{this.innerOverlay.getMap()?this.map.addOverlay(e):this.map.removeOverlay(e)};s(),i(),n(),this.label=e,this.labelMapChangedListener=this.innerOverlay.addListener("map_changed",s),this.labelPositionListener=this.innerOverlay.addListener("position_changed",i),this.labelVisibleListener=this.innerOverlay.addListener("visible_changed",n)}else this.label=void 0,this.labelPositionListener=void 0,this.labelVisibleListener=void 0,this.labelMapChangedListener=void 0}}class _t extends U{constructor(){super(...arguments);f(this,"eventHubDelegate");f(this,"prevPath");f(this,"isDoingSetPath",!1);f(this,"onLineUpdate",()=>{var i;const e=this.innerOverlay.getPath();e!==this.prevPath&&(this.isDoingSetPath||(i=this.eventHubDelegate)==null||i.notify({type:this.pathEditedEventType,target:this,originalEvent:{prevPath:this.prevPath,path:e}}),this.prevPath=e)})}setPathInternal(e){this.isDoingSetPath=!0,this.innerOverlay.setPath(e),this.isDoingSetPath=!1}createDelegate(){return this.eventHubDelegate=new je(super.createDelegate(),{types:[this.pathEditedEventType],onListen:()=>{this.prevPath=this.innerOverlay.getPath(),this.innerOverlay.addEventListener("lineupdate",this.onLineUpdate)},onCancel:()=>{this.innerOverlay.removeEventListener("lineupdate",this.onLineUpdate),this.prevPath=void 0}})}}class bt extends _t{constructor(){super(...arguments);f(this,"pathEditedEventType","path-edited")}static create(e){var s,l;const i=this.coordType,n=new BMap.Polyline(e.path.map(d=>d.toBaidu(i)),{enableClicking:e.clickable,enableEditing:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+U.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,icons:(s=e.icons)==null?void 0:s.map(a.IconSequence.toBaidu)});return new bt(n,i,this,{editable:!!e.editable,symbolIcons:(l=e.icons)==null?void 0:l.map(d=>d.icon)}).visibleOptionInternal(e.visible)}getPath(){return this.innerOverlay.getPath().map(e=>w.fromBaidu(e,this.coordType))}setPath(e){this.coordType=this.map.coordType,this.setPathInternal(e.map(i=>i.toBaidu(this.coordType)))}remove(){var e;super.remove(),(e=this.state.symbolIcons)!=null&&e.length&&this.map.innerMap.getOverlays().filter(n=>{var o;if(!(n instanceof BMap.Marker))return!1;const s=n;if(s.__create_by_tg__)return!1;const l=s.getIcon();if(!(l instanceof BMap.Symbol))return!1;const d=l;return d.__icon__?(o=this.state.symbolIcons)==null?void 0:o.includes(d.__icon__):!1}).forEach(n=>this.map.innerMap.removeOverlay(n))}}class Mt extends ct{constructor(){super(...arguments);f(this,"pathChangedListeners");f(this,"eventHubDelegate")}static create(e){var s;const i=this.coordType,n=new google.maps.Polyline({path:e.path.map(l=>l.toGoogle(i)),clickable:e.clickable,editable:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight,visible:e.visible,icons:(s=e.icons)==null?void 0:s.map(a.IconSequence.toGoogle)});return new Mt(n,i,this)}setupPathChangedListeners(){const e=()=>{var n;return(n=this.eventHubDelegate)==null?void 0:n.notify({type:"path-edited",target:this})},i=this.innerOverlay.getPath();this.pathChangedListeners=a.MVCArrays.listenChanged(i,e)}clearPathChangedListeners(){var e;(e=this.pathChangedListeners)==null||e.forEach(i=>i.remove()),this.pathChangedListeners=void 0}createDelegate(){return this.eventHubDelegate=new je(super.createDelegate(),{types:["path-edited"],onListen:()=>this.setupPathChangedListeners(),onCancel:()=>this.clearPathChangedListeners()})}getPath(){const e=[];return this.innerOverlay.getPath().forEach(i=>{e.push(w.fromGoogle(i,this.coordType))}),e}setPath(e){var i;this.coordType=this.map.coordType,this.innerOverlay.setPath(e.map(n=>n.toGoogle(this.coordType))),(i=this.eventHubDelegate)!=null&&i.hasListener("path-edited")&&this.setupPathChangedListeners()}}class Tt extends _t{constructor(){super(...arguments);f(this,"pathEditedEventType","paths-edited")}static create(e){const i=this.coordType;e.paths.length>1&&console.warn("baidu不支持多path, 只会显示paths[0]");const n=e.paths[0]||[],s=new BMap.Polygon(n.map(l=>l.toBaidu(i)),{enableClicking:e.clickable,enableEditing:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+U.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity!=null?e.fillOpacity+U.OPACITY_DELTA:void 0});return new Tt(s,i,this,{editable:!!e.editable}).visibleOptionInternal(e.visible)}getPaths(){return[this.innerOverlay.getPath().map(e=>w.fromBaidu(e,this.coordType))]}setPaths(e){e.length>1&&console.warn("baidu不支持多path, 只会显示paths[0]"),this.coordType=this.map.coordType,this.setPathInternal((e[0]||[]).map(i=>i.toBaidu(this.coordType)))}}class Ct extends ct{constructor(){super(...arguments);f(this,"pathChangedListeners");f(this,"eventHubDelegate")}static create(e){const i=this.coordType,n=new google.maps.Polygon({paths:e.paths.map(s=>s.map(l=>l.toGoogle(i))),clickable:e.clickable,editable:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity,visible:e.visible});return new Ct(n,i,this)}setupPathChangedListeners(){const e=()=>{var n;return(n=this.eventHubDelegate)==null?void 0:n.notify({type:"paths-edited",target:this})},i=this.innerOverlay.getPaths();this.pathChangedListeners=[],i.forEach(n=>{this.pathChangedListeners.push(...a.MVCArrays.listenChanged(n,e))})}clearPathChangedListeners(){var e;(e=this.pathChangedListeners)==null||e.forEach(i=>i.remove()),this.pathChangedListeners=void 0}createDelegate(){return this.eventHubDelegate=new je(super.createDelegate(),{types:["paths-edited"],onListen:()=>this.setupPathChangedListeners(),onCancel:()=>this.clearPathChangedListeners()})}getPaths(){const e=this.innerOverlay.getPaths(),i=[];return e.forEach(n=>{const s=[];i.push(s),n.forEach(l=>{s.push(w.fromGoogle(l,this.coordType))})}),i}setPaths(e){var i;this.coordType=this.map.coordType,this.innerOverlay.setPaths(e.map(n=>n.map(s=>s.toGoogle(this.coordType)))),(i=this.eventHubDelegate)!=null&&i.hasListener("paths-edited")&&this.setupPathChangedListeners()}}class Ot extends _t{constructor(e,i,n,s){super(e,i,n,s);f(this,"pathEditedEventType","bounds-changed");f(this,"isDoingUpdateRectangle",!1);f(this,"onBoundsChanged",({originalEvent:e})=>{if(this.isDoingUpdateRectangle)return;const i=e.prevPath??[],n=e.path;setTimeout(()=>{let s=n;const l=n.length;if(i.length===4)if(l>i.length){for(let o=0;o<l;o++)if(i[o]==null||!zi.equals(n[o],i[o])){const c=n[(o-2+l)%l],u=n[(o-1+l)%l],g=n[o],m=n[(o+1)%l],v=n[(o+2)%l];let C;u.lat===m.lat?C=new BMap.Point(u.lng,g.lat):u.lng===m.lng?C=new BMap.Point(g.lng,u.lat):C=g,s=[c,v,C];break}}else if(l===i.length){for(let o=0;o<l;o++)if(!zi.equals(n[o],i[o])){s=[n[o],n[(o+2)%4]];break}}else l<i.length;const d=j.fromArray(s.map(o=>w.fromBaidu(o,this.coordType)));d&&(this.isDoingUpdateRectangle=!0,this.innerOverlay.setPath(d.toRectArray().map(o=>o.toBaidu(this.coordType))),this.isDoingUpdateRectangle=!1)},0)});this.addEventListener("bounds-changed",this.onBoundsChanged)}static create(e){const i=this.coordType,n=new BMap.Polygon(e.bounds.toRectArray().map(s=>s.toBaidu(i)),{enableClicking:e.clickable,enableEditing:e.editable,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity!=null?e.strokeOpacity+U.OPACITY_DELTA:void 0,strokeWeight:e.strokeWeight,fillColor:e.fillColor,fillOpacity:e.fillOpacity!=null?e.fillOpacity+U.OPACITY_DELTA:void 0});return new Ot(n,i,this,{editable:!!e.editable}).visibleOptionInternal(e.visible)}getBounds(){return j.fromBaidu(this.innerOverlay.getBounds(),this.coordType)}setBounds(e){const i=e.toRectArray();this.innerOverlay.getPath().length===i.length?e.toRectArray().forEach((n,s)=>{this.innerOverlay.setPositionAt(s,n.toBaidu(this.coordType))}):this.setPathInternal(i.map(n=>n.toBaidu(this.coordType)))}}class wt extends ct{static create(t){const e=this.coordType,i=new google.maps.Rectangle({bounds:t.bounds.toGoogle(e),clickable:t.clickable,editable:t.editable,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,strokeWeight:t.strokeWeight,fillColor:t.fillColor,fillOpacity:t.fillOpacity,visible:t.visible});return new wt(i,e,this)}getBounds(){return j.fromGoogle(this.innerOverlay.getBounds()??ie.BOUNDS_ZERO,this.coordType)}setBounds(t){const e=t.toGoogle(this.coordType);e.equals(this.innerOverlay.getBounds())||this.innerOverlay.setBounds(e)}}const se=1;class rn extends lt{constructor(e,i){var n;super(e);f(this,"buildInMapTypeId2BIMT");f(this,"baiduMapType2BIMT");f(this,"map");f(this,"createLabel",Yt.create);f(this,"createCircle",dt.create);f(this,"createPolygon",Tt.create);f(this,"createPolyline",bt.create);f(this,"createRectangle",Ot.create);f(this,"createInfoWindow",gt.create);f(this,"createInfoBox",ft.create);f(this,"createMarker",ge.create);f(this,"createMapTypeControl",Ye.create);f(this,"createZoomControl",et.create);f(this,"createStreetViewControl",Je.create);f(this,"createScaleControl",Ke.create);this.buildInMapTypeId2BIMT=a.MapType.BUILD_IN_MAP_TYPES.getValueMap(W.prototype.getId),this.baiduMapType2BIMT=a.MapType.BUILD_IN_MAP_TYPES.getValueMap(W.prototype.asBaiduMapType),this.map=new BMap.Map(e,{minZoom:i.minZoom&&i.minZoom+se,maxZoom:i.maxZoom&&i.maxZoom+se,mapType:i.buildInMapTypeId&&((n=this.buildInMapTypeId2BIMT.get(i.buildInMapTypeId))==null?void 0:n.asBaiduMapType()),enableMapClick:!1}),this.map.centerAndZoom(i.center.toBaidu(this.coordType),i.zoom+se),this.setGestureHandling(i.gestureHandling),i.infoWindowMode==="multi"&&console.warn("baidu不支持多个InfoWindow, 可能会出现未知问题"),i.mapStyle&&this.map.setMapStyleV2(i.mapStyle.baidu),this.setEventTargetDelegate(new _e(this.map,this)),this.map.addEventListener("addoverlay",s=>{const l=s.target.__info_box__;l&&(console.debug("add:info-box",l),this.map.addOverlay(l))}),this.map.addEventListener("removeoverlay",s=>{const l=s.target.__info_box__;l&&(console.debug("remove:info-box",l),this.map.removeOverlay(l))})}setGestureHandling(e=X.auto){switch(e===X.auto&&(e=this.element.parentElement&&xt.isScrollable(this.element.parentElement)?X.cooperative:X.greedy),e){case X.cooperative:this.map.disableScrollWheelZoom(),this.map.enableDragging(),this.map.enableDoubleClickZoom();break;case X.greedy:this.map.enableScrollWheelZoom(),this.map.enableDragging(),this.map.enableDoubleClickZoom();break;case X.none:this.map.disableDragging(),this.map.disableScrollWheelZoom(),this.map.disableDoubleClickZoom();break}}get innerMap(){return this.map}get coordType(){return this.getMapType().getBaiduCoordType()}addEventListener(e,i){if(e==="center-changed"){super.addEventListener("movestart",i),super.addEventListener("moving",i),super.addEventListener("moveend",i),super.addEventListener("zoomend",i);return}super.addEventListener(e,i)}removeEventListener(e,i){if(e==="center-changed"){super.removeEventListener("movestart",i),super.removeEventListener("moving",i),super.removeEventListener("moveend",i),super.removeEventListener("zoomend",i);return}super.removeEventListener(e,i)}fromContainerPointToLatLng(e){return w.fromBaidu(this.innerMap.pixelToPoint(new BMap.Pixel(e.x,e.y)),this.coordType)}fromLatLngToContainerPoint(e){return this.innerMap.pointToPixel(e.toBaidu(this.coordType))}setDefaultCursor(e){this.innerMap.setDefaultCursor(e)}setDraggable(e){e?this.innerMap.enableDragging():this.innerMap.disableDragging()}setDoubleClickZoom(e){e?this.map.enableDoubleClickZoom():this.map.disableDoubleClickZoom()}getCenter(){return w.fromBaidu(this.map.getCenter(),this.coordType)}setCenter(e){this.map.setCenter(e.toBaidu(this.coordType))}getZoom(){return super.getZoom()-se}setZoom(e){return super.setZoom(e+se)}setMinZoom(e){this.map.setMinZoom(e+se)}setMaxZoom(e){this.map.setMaxZoom(e+se)}setMapStyle(e){this.map.setMapStyleV2((e==null?void 0:e.baidu)??{styleJson:[]})}setBuildInMapTypeId(e){var n;const i=(n=this.buildInMapTypeId2BIMT.get(e))==null?void 0:n.asBaiduMapType();this.map.setMapType(i??I("理论上来说不可能为空"))}setMapType(e){this.map.setMapType(e.asBaiduMapType())}getMapType(){const e=this.map.getMapType(),i=this.baiduMapType2BIMT.get(e);return i||(e.__baidu_map_type__??I("实现asBaiduMapType()时, 忘了给实例设置__baidu_map_type__?"))}addLayer(e){this.map.addTileLayer(e.asBaiduLayer())}removeLayer(e){this.map.removeTileLayer(e.asBaiduLayer())}panTo(e){this.map.panTo(e.toBaidu(this.coordType))}panBy(e,i){this.map.panBy(e,i)}fitBounds(e,i){this.map.setViewport(e.toBaiduArray(this.coordType),{margins:i&&[i.top,i.right,i.bottom,i.left]})}getBounds(){return j.fromBaidu(this.map.getBounds(),this.coordType)}addElementOverlay(e){this.map.addOverlay(e.asBaidu())}removeElementOverlay(e){this.map.removeOverlay(e.asBaidu())}addOverlay(e){this.map.addOverlay(e.innerOverlay)}removeOverlay(e){this.map.removeOverlay(e.innerOverlay)}addCustomControl(e){if(!e.inner){const i=class extends BMap.Control{constructor(){super(...arguments);f(this,"defaultAnchor",a.ControlPositionConverter.getBaidu().toValue(e.position));f(this,"defaultOffset",new BMap.Size(0,0))}initialize(s){const l=e.onCreateElement();return s.getContainer().appendChild(l),l}};e.inner=new i,this.map.addControl(e.inner)}}removeCustomControl(e){e.inner&&(ne(e.inner instanceof BMap.Control,`control.inner(${e.inner})需要是BMap.Control`),this.map.removeControl(e.inner))}createMarkerClusterer(e){return new Ci(this,e)}createHeatmap(e){return new yi(this,e)}createAutocomplete(e){return new pi(this,e)}createSearchBox(e){return new Li(this,e)}createPlacesService(e){return new Ei(this,e)}createMapUrls(e){return new st(e)}}class nn extends lt{constructor(e,i){var s,l;super(e);f(this,"buildInMapTypeId2BIMT");f(this,"googleMapTypeId2BIMT");f(this,"map");f(this,"createLabel",qt.create);f(this,"createCircle",ut.create);f(this,"createPolygon",Ct.create);f(this,"createPolyline",Mt.create);f(this,"createRectangle",wt.create);f(this,"createInfoWindow",mt.create);f(this,"createInfoBox",yt.create);f(this,"createMarker",vt.create);f(this,"createMapTypeControl",qe.create);f(this,"createZoomControl",tt.create);f(this,"createStreetViewControl",Qe.create);f(this,"createScaleControl",Xe.create);this.mapOptions=i,this.buildInMapTypeId2BIMT=a.MapType.BUILD_IN_MAP_TYPES.getValueMap(W.prototype.getId),this.googleMapTypeId2BIMT=a.MapType.BUILD_IN_MAP_TYPES.getValueMap(W.prototype.getGoogleMapTypeId);const n=i.buildInMapTypeId&&this.buildInMapTypeId2BIMT.get(i.buildInMapTypeId);this.map=new google.maps.Map(e,{center:i.center.toGoogle((n??a.MapType.NORMAL).getGoogleCoordType()),zoom:i.zoom,disableDefaultUI:!0,gestureHandling:i.gestureHandling,minZoom:i.minZoom,maxZoom:i.maxZoom,styles:(s=i.mapStyle)==null?void 0:s.google.styles,mapId:(l=i.mapStyle)==null?void 0:l.google.mapId,mapTypeId:n==null?void 0:n.getGoogleMapTypeId()}),this.setEventTargetDelegate(new he(this.map,this))}setGestureHandling(e){this.map.setOptions({gestureHandling:e})}get innerMap(){return this.map}get coordType(){return this.getMapType().getGoogleCoordType()}fromContainerPointToLatLng(e){const i=this.innerMap.getProjection(),n=this.innerMap.getBounds();if(i==null||n==null)return w.ZERO;const s=i.fromLatLngToPoint(n.getSouthWest()),l=i.fromLatLngToPoint(n.getNorthEast()),d=this.innerMap.getZoom();if(s==null||l==null||d==null)return w.ZERO;const o=Math.pow(2,d),c=new google.maps.Point(e.x/o+s.x,e.y/o+l.y);return w.fromGoogle(i.fromPointToLatLng(c)??ie.LATLNG_ZERO,this.coordType)}fromLatLngToContainerPoint(e){const i=this.innerMap.getProjection(),n=this.innerMap.getBounds();if(i==null||n==null)return a.Point.ZERO;const s=i.fromLatLngToPoint(n.getSouthWest()),l=i.fromLatLngToPoint(n.getNorthEast()),d=this.innerMap.getZoom();if(s==null||l==null||d==null)return a.Point.ZERO;const o=Math.pow(2,d),c=i.fromLatLngToPoint(e.toGoogle(this.coordType));return c==null?a.Point.ZERO:{x:(c.x-s.x)*o,y:(c.y-l.y)*o}}setDefaultCursor(e){this.innerMap.setOptions({draggableCursor:e})}setDraggable(e){this.innerMap.setOptions({draggable:e})}setDoubleClickZoom(e){this.map.setOptions({disableDoubleClickZoom:!e})}getCenter(){return w.fromGoogle(this.map.getCenter()??ie.LATLNG_ZERO,this.coordType)}setCenter(e){this.map.setCenter(e.toGoogle(this.coordType))}setMinZoom(e){this.map.setOptions({minZoom:e})}setMaxZoom(e){this.map.setOptions({maxZoom:e})}setMapStyle(e){this.map.setOptions({styles:e==null?void 0:e.google.styles,mapId:e==null?void 0:e.google.mapId})}setBuildInMapTypeId(e){var n;const i=(n=this.buildInMapTypeId2BIMT.get(e))==null?void 0:n.getGoogleMapTypeId();this.map.setMapTypeId(i??I("理论上来说不可能为空"))}setMapType(e){e instanceof W?this.map.setMapTypeId(e.getGoogleMapTypeId()):(this.map.mapTypes.set(e.id,e.asGoogleMapType()),this.map.setMapTypeId(e.id))}getMapType(){const e=this.map.getMapTypeId()??google.maps.MapTypeId.ROADMAP,i=this.googleMapTypeId2BIMT.get(e);return i||(this.map.mapTypes.get(e).__google_map_type__??I(`实现${e}的asGoogleMapType()时, 忘了给实例设置__google_map_type__?`))}addOverlayMapType(e){this.map.overlayMapTypes.push(e.asGoogleMapType())}removeOverlayMapType(e){a.MVCArrays.remove(this.map.overlayMapTypes,e.asGoogleMapType())}addLayer(e){e.asGoogleLayer().setMap(this.map)}removeLayer(e){e.asGoogleLayer().setMap(null)}panTo(e){this.map.panTo(e.toGoogle(this.coordType))}panBy(e,i){this.map.panBy(e,i)}fitBounds(e,i){this.map.fitBounds(e.toGoogle(this.coordType),i)}getBounds(){const e=this.map.getBounds();return e?j.fromGoogle(e,this.coordType):j.EMPTY}addElementOverlay(e){e.asGoogle().setMap(this.map)}removeElementOverlay(e){e.asGoogle().setMap(null)}addOverlay(e){e.innerOverlay.setMap(this.map)}removeOverlay(e){e.innerOverlay.setMap(null)}addCustomControl(e){e.inner||(e.inner=e.onCreateElement(),this.map.controls[a.ControlPositionConverter.getGoogle().toValue(e.position)].push(e.inner))}removeCustomControl(e){if(e.inner){const i=this.map.controls[a.ControlPositionConverter.getGoogle().toValue(e.position)];a.MVCArrays.remove(i,e.inner)}}createMarkerClusterer(e){return new Oi(this,e)}createHeatmap(e){return new fi(this,e)}createAutocomplete(e){return new ui(this,e)}createSearchBox(e){return new Pi(this,e)}createPlacesService(e){return new wi(this,e)}createMapUrls(e){return new nt(e)}}const Et=["3.0"],sn={baidu:{version:"3.0",key:"kXOq8Hg9BZbZEWAjXKuzd1oGreynup8h"},google:{version:"quarterly",key:"AIzaSyBcyzMel3dYFNcfcr0LOklbBQNpWycyZXo",language:"en-us",libraries:["places","visualization"]},here:{version:Et[0],key:""}};let Zi;function Kt(){return Zi||I("请先安装: Vue<PartialTgMapConfig>.use(TgMap, {})")}function Wi(r){r!=null&&(Zi=ki(sn,r))}class on extends lt{constructor(e,i){var l;super(e);f(this,"map");f(this,"defaultLayers");this.mapOptions=i;const n=Kt().here;Et.includes(n.version)||I(`不支持${n.version}, HereMap当前只支持如下版本: ${Et}`);const s=new H.service.Platform({app_id:n.key.split(",")[0],app_code:n.key.split(",")[1]});this.defaultLayers=s.createDefaultLayers(),this.map=new H.Map(e,this.defaultLayers.normal.map,{zoom:i.zoom,center:(l=i.center)==null?void 0:l.toHere(this.coordType)}),new H.mapevents.Behavior(new H.mapevents.MapEvents(this.map)),H.ui.UI.createDefault(this.map,this.defaultLayers)}get innerMap(){return this.map}get coordType(){return R.wgs84}getCenter(){return w.fromHere(this.map.getCenter(),this.coordType)}setCenter(e){this.map.setCenter(e.toHere(this.coordType))}setGestureHandling(e){throw new Error("Method not implemented.")}fromContainerPointToLatLng(e){throw new Error("Method not implemented.")}fromLatLngToContainerPoint(e){throw new Error("Method not implemented.")}setDefaultCursor(e){throw new Error("Method not implemented.")}setDraggable(e){throw new Error("Method not implemented.")}setDoubleClickZoom(e){throw new Error("Method not implemented.")}setMinZoom(e){throw new Error("Method not implemented.")}setMaxZoom(e){throw new Error("Method not implemented.")}setMapStyle(e){throw new Error("Method not implemented.")}setBuildInMapTypeId(e){throw new Error("Method not implemented.")}setMapType(e){throw new Error("Method not implemented.")}getMapType(){throw new Error("Method not implemented.")}addLayer(e){throw new Error("Method not implemented.")}removeLayer(e){throw new Error("Method not implemented.")}panTo(e){throw new Error("Method not implemented.")}panBy(e,i){throw new Error("Method not implemented.")}fitBounds(e,i){throw new Error("Method not implemented.")}getBounds(){throw new Error("Method not implemented.")}addElementOverlay(e){throw new Error("Method not implemented.")}removeElementOverlay(e){throw new Error("Method not implemented.")}addOverlay(e){throw new Error("Method not implemented.")}removeOverlay(e){throw new Error("Method not implemented.")}createMarker(e){throw new Error("Method not implemented.")}createMarkerClusterer(e){throw new Error("Method not implemented.")}createHeatmap(e){throw new Error("Method not implemented.")}createAutocomplete(e){throw new Error("Method not implemented.")}createSearchBox(e){throw new Error("Method not implemented.")}createPlacesService(e){throw new Error("Method not implemented.")}createMapUrls(e){throw new Error("Method not implemented.")}createInfoWindow(e){throw new Error("Method not implemented.")}createInfoBox(e){throw new Error("Method not implemented.")}createPolyline(e){throw new Error("Method not implemented.")}createPolygon(e){throw new Error("Method not implemented.")}createRectangle(e){throw new Error("Method not implemented.")}createCircle(e){throw new Error("Method not implemented.")}createLabel(e){throw new Error("Method not implemented.")}addCustomControl(e){throw new Error("Method not implemented.")}removeCustomControl(e){throw new Error("Method not implemented.")}createMapTypeControl(e){throw new Error("Method not implemented.")}createZoomControl(e){throw new Error("Method not implemented.")}createStreetViewControl(e){throw new Error("Method not implemented.")}createScaleControl(e){throw new Error("Method not implemented.")}}var Y=(r=>(r.google="google",r.baidu="baidu",r.here="here",r))(Y||{});a.TgMapFactory=void 0,(r=>{function t(e,i,n){const s=a.MapOptions.create(n);switch(e){case"google":return new nn(i,s);case"baidu":return new rn(i,s);case"here":return new on(i,s)}}r.createMap=t})(a.TgMapFactory||(a.TgMapFactory={}));var an={VITE_APP_DEV_KEY_BAIDU:"kXOq8Hg9BZbZEWAjXKuzd1oGreynup8h",VITE_APP_DEV_KEY_GOOGLE:"AIzaSyBcyzMel3dYFNcfcr0LOklbBQNpWycyZXo",VITE_APP_DEV_KEY_HERE:"",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const ln={};function Hi(r){return a.Objects.putIfAbsent(ln,r,()=>ei(()=>hn({type:r,config:Kt()[r]})))()}function hn({type:r,config:t}){const e=window,i=cn(r);if(a.Objects.get(e,i))return Promise.resolve();switch(r!==Y.here&&!t.key&&I(`请先配置${r}地图的key`),r){case Y.google:return an.VITE_FALSE?(Pr({key:t.key,v:"3.52"}),google.maps.importLibrary("core")):Vi(`https://maps.googleapis.com/maps/api/js?key=${t.key}&language=${t.language}&v=${t.version}&libraries=${t.libraries.join(",")}`);case Y.baidu:return Vi(`https://api.map.baidu.com/api?v=${t.version}&ak=${t.key}`);case Y.here:return Ee(we("core",t.version)).then(()=>Promise.all([Ee(we("service",t.version)),Ee(we("mapevents",t.version)),Ee(we("clustering",t.version)),Ee(we("ui",t.version))])).catch(n=>(a.Objects.del(e,i),Promise.reject(n)));default:Ge(r)}}function we(r,t=Et[0]){return`https://js.api.here.com/v3/${t}/mapsjs-${r}.js`}function cn(r){switch(r){case Y.google:return"google.maps";case Y.baidu:return"BMap";case Y.here:return"H"}}let dn=0;function Vi(r,t="callback"){return new Promise((e,i)=>{const n=`__callback${dn++}`;window[n]=e;const s=document.createElement("script");s.src=`${r}&${t}=${n}`,s.onerror=i,document.body.appendChild(s)})}function Ee(r){return new Promise((t,e)=>{const i=document.createElement("script");i.src=r,i.onload=t,i.onerror=e,document.body.appendChild(i)})}function V(r,t){return{type:String,default:t,validator:e=>Object.values(r).includes(e)}}function ji(r,t){return{type:String,default:t,validator:e=>r.includes(e)}}function N(r){return{type:r,required:!0}}function T(r,t){return{type:r,default:t}}function un(r){const t={};return Object.entries(r).forEach(([e,i])=>{const n=`__${e}`;t[e]={get(){const s=this[n];return s===void 0?i:s},set(s){this[n]=s}}}),t}const Pe={enumerable:!0,configurable:!0,get:le,set:le};function Fi(r){return Object.keys(r).forEach(t=>{const e=r[t];let i=!1;typeof e=="function"?(Pe.get=e,Pe.set=le,i=!0):typeof e=="object"&&typeof e.get=="function"&&(Pe.get=e.get,Pe.set=e.set,i=!0),i&&(r[t]=Object.defineProperty(r,t,Pe))}),r}function pn(r){return Fi(r)}function Le(){return y.createCommentVNode()}function Be(r,t){const e=r.$options[t];if(e)for(const i of e)i.call(r)}function gn(r,t){for(const e of r)if(e.$options.name===t.name)return e}function mn(r,t){if(!r.default)return;const e=r.default();for(const i of e)if((i==null?void 0:i.type).name===t.name)return i}function Ui(r,t){const e={},i={},n={};return Object.keys(r).forEach(s=>{s.startsWith("on")?e[a.Strings.pascal2kebab(s.substring(2))]=r[s]:i[s]=r[s]}),t&&Object.keys(t).forEach(s=>{s.startsWith("on")&&(n[a.Strings.pascal2kebab(s.substring(2))]=t[s])}),{binds:i,listeners:e,listenerProps:n}}function J(r,t){return y.computed(()=>Ui(r,t))}function x(){return Function}const fn=()=>{let r,t;function e(n){console.log(n),r=n&&n.type,t=Date.now()}function i(n){((n&&n.type)!==r||Date.now()-(t??0)>1e3)&&e(n)}return{eventLog:e,eventLogLess:i}},Pt="$map",me="onCreate",fe="onDestroy",z=y.defineComponent({inject:[Pt],mounted(){Be(this,me)},beforeUnmount(){Be(this,fe)},methods:{recreate(){Be(this,fe),Be(this,me)}},render(){return Le()}}),yn=y.defineComponent({name:"tg-map",provide(){return{[Pt]:y.computed(()=>this.map)}},inheritAttrs:!1,props:{type:V(Y,Y.google),center:N(w),centerSyncDelay:T(Number,300),currentCenter:T(w),lastCenter:T(w),zoom:N(Number),infoWindowMode:ji(Di),gestureHandling:V(X),minZoom:T(Number),maxZoom:T(Number),mapStyle:T(Object),mapTypeId:V(Rt),mapType:T(Object),hideLogo:T(Boolean),onLoad:x(),"onUpdate:center":x(),"onUpdate:current-center":x(),"onUpdate:last-center":x(),"onUpdate:map-type":x(),"onUpdate:map-type-id":x(),"onUpdate:zoom":x(),onError:x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),centerSyncTimeoutId:void 0}},data(){return{map:Ne(),isDestroyed:!1}},computed:{propsJson(){return a.Objects.toJsonSafely(this.$props)}},watch:{gestureHandling(r){var t;r&&((t=this.map)==null||t.setGestureHandling(r))},minZoom(r){var t;(t=this.map)==null||t.setMinZoom(r)},maxZoom(r){var t;(t=this.map)==null||t.setMaxZoom(r)},mapStyle(r){var t;(t=this.map)==null||t.setMapStyle(r)},mapTypeId(r){var t;r&&((t=this.map)==null||t.setBuildInMapTypeId(r))},mapType(r){var t;(t=this.map)==null||t.setMapType(r??a.MapType.NORMAL)}},async mounted(){const r=this.type;try{await Hi(r)}catch(n){this.$emit("error",n);return}if(this.isDestroyed){console.warn(`tg-map(type=${r})已销毁, 不需要继续执行`);return}const t=a.TgMapFactory.createMap(r,this.$refs.map,{center:this.center,zoom:this.zoom,infoWindowMode:this.infoWindowMode,gestureHandling:this.gestureHandling,minZoom:this.minZoom,maxZoom:this.maxZoom,mapStyle:this.mapStyle,buildInMapTypeId:this.mapTypeId});if(this.map=y.markRaw(t),this.mapType&&t.setMapType(this.mapType),"ready"in this.attrs.listeners&&console.error("地图载入完成的事件已经从ready改为了load, 请手动修改"),$(this.attrs.listeners,t,["load"]),this.$emit("load",t),y.watch([()=>this.zoom,()=>this.center],([n,s],[l,d])=>{n!==l&&t.setZoom(n),s!==d&&(t.getCenter().equals(s)||t.setCenter(s))}),this.attrs.listenerProps["update:center"]){const n=()=>this.$emit("update:center",t.getCenter());t.addEventListener("center-changed",()=>{this.centerSyncDelay>0?(clearTimeout(this.centerSyncTimeoutId),this.centerSyncTimeoutId=setTimeout(n,this.centerSyncDelay)):n()})}this.attrs.listenerProps["update:current-center"]&&(this.$emit("update:current-center",this.center),t.addEventListener("center-changed",()=>{this.$emit("update:current-center",t.getCenter())})),this.attrs.listenerProps["update:zoom"]&&t.addEventListener("zoom-changed",()=>{this.$emit("update:zoom",t.getZoom())});const e=this.attrs.listenerProps["update:map-type"],i=this.attrs.listenerProps["update:map-type-id"];(e||i)&&t.addEventListener("map-type-changed",()=>{const n=t.getMapType();e&&this.$emit("update:map-type",n),i&&this.$emit("update:map-type-id",n.id)})},unmounted(){this.isDestroyed=!0,this.map&&(this.attrs.listenerProps["update:last-center"]&&this.$emit("update:last-center",this.map.getCenter()),this.attrs.listenerProps["update:center"]&&(clearTimeout(this.centerSyncTimeoutId),this.$emit("update:center",this.map.getCenter())))},methods:{}}),Q=(r,t)=>{const e=r.__vccOpts||r;for(const[i,n]of t)e[i]=n;return e};function vn(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",y.mergeProps({class:"tg-map"},r.attrs.binds),[y.createElementVNode("div",{ref:"map",class:y.normalizeClass({"tg-map__map":!0,[`tg-map__map--hide-logo-${r.type}`]:r.hideLogo})},null,2),y.createCommentVNode("",!0),r.map?y.renderSlot(r.$slots,"default",{key:1}):y.createCommentVNode("",!0),y.renderSlot(r.$slots,"overlay")],16)}const ye=Q(yn,[["render",vn]]);function _n(r){if(r==null)return;let t;if(typeof r=="string"){if(t=+r,Number.isNaN(t))return r}else t=r;return`${t}px`}const bn=y.defineComponent({name:"tg-map-widget",props:{left:{type:[Number,String],default:null},top:{type:[Number,String],default:null},right:{type:[Number,String],default:null},bottom:{type:[Number,String],default:null}},computed:{topValue(){return this.top==null&&this.bottom==null?0:this.top}},methods:{dimen:_n}});function Mn(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(r.$options.name),style:y.normalizeStyle({left:r.dimen(r.left),top:r.dimen(r.topValue),right:r.dimen(r.right),bottom:r.dimen(r.bottom)})},[y.renderSlot(r.$slots,"default")],6)}const Yi=Q(bn,[["render",Mn]]),Tn=y.defineComponent({name:"tg-custom-control",mixins:[z],props:{position:V(k,k.RIGHT_BOTTOM)},setup(){return{control:void 0}},watch:{position(){this.recreate()}},onCreate(){kt(this.$parent,ye)||console.warn("请将tg-custom-control放到tg-map中");const{$el:r}=this,t=class extends oi{onCreateElement(){return r}};this.control=new t(this.position),this.$map.addCustomControl(this.control)},onDestroy(){this.$map.removeCustomControl(this.control)}});function Cn(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(r.$options.name)},[y.renderSlot(r.$slots,"default")],2)}const qi=Q(Tn,[["render",Cn]]),Ki=y.defineComponent({name:"tg-map-type-control",mixins:[z],props:{position:V(k,k.TOP_LEFT),type:V(Dt),mapTypes:T(Array)},setup(){return{control:void 0}},watch:{position(r){this.control.setPosition(r)},type(){this.recreate()},mapTypes:{handler(){this.recreate()},deep:!0}},onCreate(){this.control=this.$map.createMapTypeControl(this),this.$map.addControl(this.control)},onDestroy(){this.$map.removeControl(this.control)}}),Xi=y.defineComponent({name:"tg-scale-control",mixins:[z],props:{position:V(k,k.BOTTOM_RIGHT)},setup(){return{control:void 0}},watch:{position(r){this.control.setPosition(r)}},onCreate(){this.control=this.$map.createScaleControl(this),this.$map.addControl(this.control)},onDestroy(){this.$map.removeControl(this.control)}});function Ji(){var e;const r=(e=y.getCurrentInstance())==null?void 0:e.type;let t=(r==null?void 0:r.name)??(r==null?void 0:r.__name);if(!t){const i=r==null?void 0:r.__file;i&&(t=Gi.basename(i,".vue"))}return t}function Lt(){const r=y.inject(Pt);let t,e;return r==null&&I(`<${Ji()||"unknown"}>必须作为<tg-map>的子代组件`),{mapRef:r,get map(){return r.value??I("map尚未初始化")},[me](i){y.onMounted(i),t&&I(`${me}只能调用一次`),t=i},[fe](i){y.onBeforeUnmount(i),e&&I(`${fe}只能调用一次`),e=i},recreate(){e==null||e(),t==null||t()}}}const Qi=y.defineComponent({name:"tg-street-view-control",props:{position:V(k,k.RIGHT_BOTTOM)},setup(r){let t=void 0;const{map:e,onCreate:i,onDestroy:n}=Lt();return i(()=>{t=e.createStreetViewControl(r),e.addControl(t)}),n(()=>{e.removeControl(t)}),y.watch(()=>r.position,s=>{t.setPosition(s)}),Le}}),er=y.defineComponent({name:"tg-zoom-control",props:{position:V(k,k.RIGHT_BOTTOM)},setup(r){let t=void 0;const{map:e,onCreate:i,onDestroy:n}=Lt();return i(()=>{t=e.createZoomControl(r),e.addControl(t)}),n(()=>{e.removeControl(t)}),y.watch(()=>r.position,s=>{t.setPosition(s)}),Le}}),tr=y.defineComponent({name:"tg-heatmap",props:{maxIntensity:T(Number),gradient:T(Object),opacity:T(Number),radius:T(Number),data:N(Array)},setup(r){const{map:t,onCreate:e,onDestroy:i}=Lt();let n=void 0;return e(()=>{n=t.createHeatmap(r)}),i(()=>{n.remove()}),y.watch(()=>r.data,s=>n.setData(s)),y.watch([()=>r.maxIntensity,()=>r.gradient,()=>r.opacity,()=>r.radius],()=>n.setOptions(r)),Le}}),On=y.defineComponent({name:"tg-marker-clusterer",mixins:[z],props:{gridSize:T(Number),maxZoom:T(Number),minClusterSize:T(Number),averageCenter:T(Boolean),styles:T(Array),stylesIndexCalculator:T(Function),zIndex:T(Number)},setup(){return{clusterer:void 0,markers:[]}},watch:{gridSize(){this.recreate()},maxZoom(){this.recreate()},minClusterSize(){this.recreate()},averageCenter(){this.recreate()},styles:{handler(){this.recreate()},deep:!0},stylesIndexCalculator(){this.recreate()},zIndex(){this.recreate()}},onCreate(){this.clusterer=this.$map.createMarkerClusterer(this)},onDestroy(){this.clusterer.clearMarkers()},methods:{isInitiated(){return this.clusterer!=null},onAddMarker(r){this.markers.push(r),this.isInitiated()&&this.clusterer.addMarker(r)},onRemoveMarker(r){this.isInitiated()&&this.clusterer.removeMarker(r),a.Arrays.remove(this.markers,r)}}});function wn(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",{class:y.normalizeClass(r.$options.name)},[y.renderSlot(r.$slots,"default")],2)}const Xt=Q(On,[["render",wn]]),ir=y.defineComponent({name:"tg-traffic-layer",mixins:[z],setup(){return{layer:void 0}},watch:{},onCreate(){this.layer=new li,this.$map.addLayer(this.layer)},onDestroy(){this.$map.removeLayer(this.layer)}}),rr=y.defineComponent({name:"tg-circle",mixins:[z],inheritAttrs:!1,props:{center:N(w),radius:N(Number),clickable:T(Boolean),editable:T(Boolean),strokeColor:T(String),strokeOpacity:T(Number),strokeWeight:T(Number),visible:T(Boolean),fillColor:T(String),fillOpacity:T(Number),"onUpdate:center":x(),"onUpdate:radius":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),overlay:void 0,emittedRadius:void 0,emittedCenter:void 0}},watch:{center(r){if(this.emittedCenter!=null){const t=this.emittedCenter;if(this.emittedCenter=void 0,t===y.toRaw(r))return}this.overlay.setCenter(r)},radius(r){if(this.emittedRadius!=null){const t=this.emittedRadius;if(this.emittedRadius=void 0,t===r)return}this.overlay.setRadius(r)},clickable(){this.recreate()},editable(r){this.overlay.setEditable(r)},strokeColor(r){this.overlay.setStrokeColor(r)},strokeOpacity(r){this.overlay.setStrokeOpacity(r)},strokeWeight(r){this.overlay.setStrokeWeight(r)},fillColor(r){this.overlay.setFillColor(r)},fillOpacity(r){this.overlay.setFillOpacity(r)},visible(r){this.overlay.setVisible(r)}},onCreate(){this.overlay=this.$map.createCircle(this),this.$map.addOverlay(this.overlay),$(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:center"]&&this.overlay.addEventListener("center-changed",()=>{this.$emit("update:center",this.emittedCenter=this.overlay.getCenter())}),this.attrs.listenerProps["update:radius"]&&this.overlay.addEventListener("radius-changed",()=>{this.$emit("update:radius",this.emittedRadius=this.overlay.getRadius())})},onDestroy(){this.$map.removeOverlay(this.overlay)}});class En extends Ni{constructor(t,e,i,n){super(t,e),this.content=i,this.position=n}onCreate(){return this.content}onDraw(t){const e=t.fromLatLngToOverlayPoint(this.position);this.content.style.left=e.x+"px",this.content.style.top=e.y+"px"}setPosition(t){this.position=t,this.draw()}}const Pn=y.defineComponent({name:"tg-element-overlay",mixins:[z],props:{mapPane:V(ue,ue.overlayMouseTarget),position:N(w)},setup(){return{overlay:void 0}},watch:{position(r){this.overlay.setPosition(r)},mapPane(){this.recreate()}},methods:{content(){return this.$el}},onCreate(){this.overlay=new En(this.$map,this,this.content(),this.position),this.$map.addElementOverlay(this.overlay)},onDestroy(){this.$map.removeElementOverlay(this.overlay)}});function Ln(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",y.mergeProps({class:r.$options.name},r.$attrs),[y.renderSlot(r.$slots,"default")],16)}const nr=Q(Pn,[["render",Ln]]),Bn=y.defineComponent({name:"tg-marker",mixins:[z],inheritAttrs:!1,props:{position:N(w),title:T(String),icon:T(Object),clickable:T(Boolean),draggable:T(Boolean),crossOnDrag:T(Boolean),cursor:T(String),zIndex:T(Number),visible:T(Boolean),normalizePositionForBaidu:T(Boolean),autoAddToClusterer:T(Boolean,!0),"onUpdate:position":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),marker:void 0,label:Ne(),info:Ne(),emittedPosition:void 0,autoAddToClustererWhenCreate:r.autoAddToClusterer}},watch:{position(r){if(this.emittedPosition!=null){const t=this.emittedPosition;if(this.emittedPosition=void 0,t===y.toRaw(r))return}this.marker.setPosition(r)},title(r){this.marker.setTitle(r)},icon(r){r?this.marker.setIcon(r):this.recreate()},clickable(r){this.marker instanceof ge?this.recreate():this.marker.setClickable(r)},draggable(r){this.marker.setDraggable(r)},crossOnDrag(){this.recreate()},cursor(){this.recreate()},zIndex(r){this.marker instanceof ge?this.recreate():this.marker.setZIndex(r)},visible(r){this.marker.setVisible(r)},normalizePositionForBaidu(){this.recreate()},autoAddToClusterer(){this.recreate()}},onCreate(){this.marker=this.$map.createMarker(this),this.label&&this.marker.setLabel(this.label.overlay),this.$clusterer()&&this.autoAddToClusterer?this.$clusterer().onAddMarker(this.marker):this.$map.addOverlay(this.marker),this.autoAddToClustererWhenCreate=this.autoAddToClusterer,this.info&&this.info.show&&this.info.overlay.open(this.marker),$(this.attrs.listeners,this.marker),this.attrs.listenerProps["update:position"]&&this.marker.addEventListener("dragend",r=>{this.$emit("update:position",this.emittedPosition=r.position)})},onDestroy(){this.$clusterer()&&this.autoAddToClustererWhenCreate?this.$clusterer().onRemoveMarker(this.marker):this.$map.removeOverlay(this.marker)},methods:{$clusterer(){return kt(this.$parent,Xt)},onAddLabel(r){this.label=r,this.marker&&this.marker.setLabel(r.overlay)},onRemoveLabel(r){this.marker.setLabel(void 0),this.label=void 0},onAddInfo(r){this.info=r,this.marker&&r.show&&r.overlay.open(this.marker)},onRemoveInfo(r){r.overlay.close(),this.info=void 0},onInfoShowChanged(r,t){t?r.overlay.open(this.marker):r.overlay.close()}}});function In(r,t,e,i,n,s){return y.renderSlot(r.$slots,"default")}const Ie=Q(Bn,[["render",In]]),Sn=y.defineComponent({name:"tg-info-box",mixins:[z],inheritAttrs:!1,props:{show:N(Boolean),position:T(w),offset:T(Object),maxWidth:T(Number),borderClass:T(String),zIndex:T(Number),"onUpdate:show":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),overlay:void 0}},watch:{show(r){this.$marker()?this.$marker().onInfoShowChanged(this,r):r?this.overlay.open():this.overlay.close()},position(r){this.overlay.setPosition(r)},offset(){this.recreate()},maxWidth(r){this.overlay.setMaxWidth(r)},borderClass(){this.recreate()},zIndex(r){this.overlay.setZIndex(r)}},onCreate(){this.overlay=this.$map.createInfoBox(this.getOptions()),this.$marker()?this.$marker().onAddInfo(this):this.show&&this.overlay.open(),this.attrs.listenerProps["update:show"]&&this.overlay.addEventListener("closeclick",()=>{this.$emit("update:show",!1)}),$(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveInfo(this):this.overlay.close()},methods:{getOptions(){return{content:this.content(),position:this.position,offset:this.offset,zIndex:this.zIndex,maxWidth:this.maxWidth,borderClass:this.borderClass}},content(){return this.$el},$marker(){return We(Ie,this.$parent,ye)},open(r){this.overlay.open(r)},close(){this.overlay.close()}}});function kn(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",y.mergeProps({class:r.$options.name},r.attrs.binds),[y.renderSlot(r.$slots,"default")],16)}const sr=Q(Sn,[["render",kn]]),xn=y.defineComponent({name:"tg-info-window",mixins:[z],inheritAttrs:!1,props:{show:N(Boolean),position:T(w),maxWidth:T(Number),offset:T(Object),disableAutoPan:T(Boolean),"onUpdate:show":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),overlay:void 0}},watch:{show(r){this.$marker()?this.$marker().onInfoShowChanged(this,r):r?this.overlay.open():this.overlay.close()},position(r){this.overlay.setPosition(r)},maxWidth(){this.recreate()},offset(){this.recreate()},disableAutoPan(){this.recreate()}},methods:{content(){return this.$el},$marker(){return We(Ie,this.$parent,ye)},getOptions(){return{content:this.content(),position:this.position,maxWidth:this.maxWidth,offset:this.offset,disableAutoPan:this.disableAutoPan}}},onCreate(){this.overlay=this.$map.createInfoWindow(this.getOptions()),this.$marker()?this.$marker().onAddInfo(this):this.show&&this.overlay.open(),this.overlay.addEventListener("open",()=>{this.$emit("update:show",!0)}),this.overlay.addEventListener("close",()=>{this.$emit("update:show",!1)}),$(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveInfo(this):this.overlay.close()}});function An(r,t,e,i,n,s){return y.withDirectives((y.openBlock(),y.createElementBlock("div",y.mergeProps({class:r.$options.name},r.attrs.binds),[y.renderSlot(r.$slots,"default")],16)),[[y.vShow,r.show]])}const or=Q(xn,[["render",An]]),Rn=y.defineComponent({name:"tg-label",mixins:[z],inheritAttrs:!1,props:{position:T(w),offset:T(Object),zIndex:T(Number),mapPane:V(ue)},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t),overlay:void 0}},watch:{position(r){this.overlay.setPosition(r)},offset(r){this.overlay.setOffset(r)},zIndex(r){this.overlay.setZIndex(r)},visible(r){this.overlay.setVisible(r)},mapPane(){this.recreate()}},methods:{content(){return this.$el},marker(){var r;return(r=this.$marker())==null?void 0:r.marker},$marker(){return We(Ie,this.$parent,ye)},getOptions(){return{content:this.content(),position:this.position,offset:this.offset,zIndex:this.zIndex,mapPane:this.mapPane}}},onCreate(){this.overlay=this.$map.createLabel(this.getOptions()),this.$marker()?this.$marker().onAddLabel(this):this.$map.addOverlay(this.overlay),$(this.attrs.listeners,this.overlay)},onDestroy(){this.$marker()?this.$marker().onRemoveLabel(this):this.$map.removeOverlay(this.overlay)}});function Dn(r,t,e,i,n,s){return y.openBlock(),y.createElementBlock("div",y.mergeProps({class:r.$options.name},r.attrs.binds),[y.renderSlot(r.$slots,"default")],16)}const ar=Q(Rn,[["render",Dn]]),lr=y.defineComponent({name:"tg-polygon",mixins:[z],inheritAttrs:!1,props:{paths:N(Array),clickable:T(Boolean),editable:T(Boolean),strokeColor:T(String),strokeOpacity:T(Number),strokeWeight:T(Number),visible:T(Boolean),fillColor:T(String),fillOpacity:T(Number),"onUpdate:paths":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),overlay:void 0,emittedPaths:void 0}},watch:{paths:{handler(r){if(this.emittedPaths!=null){const t=this.emittedPaths;if(this.emittedPaths=void 0,t.length===r.length&&t.every((e,i)=>e===y.toRaw(r[i])))return}this.overlay.setPaths(r)},deep:!0},clickable(){this.recreate()},editable(r){this.overlay.setEditable(r)},strokeColor(r){this.overlay.setStrokeColor(r)},strokeOpacity(r){this.overlay.setStrokeOpacity(r)},strokeWeight(r){this.overlay.setStrokeWeight(r)},fillColor(r){this.overlay.setFillColor(r)},fillOpacity(r){this.overlay.setFillOpacity(r)},visible(r){this.overlay.setVisible(r)}},onCreate(){this.overlay=this.$map.createPolygon(this),this.$map.addOverlay(this.overlay),$(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:paths"]&&this.overlay.addEventListener("paths-edited",()=>{this.$emit("update:paths",this.emittedPaths=this.overlay.getPaths())})},onDestroy(){this.$map.removeOverlay(this.overlay)}}),hr=y.defineComponent({name:"tg-polyline",mixins:[z],inheritAttrs:!1,props:{path:N(Array),icons:T(Array),clickable:T(Boolean),editable:T(Boolean),strokeColor:T(String),strokeOpacity:T(Number),strokeWeight:T(Number),visible:T(Boolean),"onUpdate:path":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),overlay:void 0,emittedPath:void 0}},watch:{path:{handler(r){if(this.emittedPath!=null){const t=this.emittedPath;if(this.emittedPath=void 0,t===y.toRaw(r))return}this.overlay.setPath(r)},deep:!0},icons:{handler(){this.recreate()},deep:!0},clickable(){this.recreate()},editable(r){this.overlay.setEditable(r)},strokeColor(r){this.overlay.setStrokeColor(r)},strokeOpacity(r){this.overlay.setStrokeOpacity(r)},strokeWeight(r){this.overlay.setStrokeWeight(r)},visible(r){this.overlay.setVisible(r)}},onCreate(){this.overlay=this.$map.createPolyline(this),this.$map.addOverlay(this.overlay),$(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:path"]&&this.overlay.addEventListener("path-edited",()=>{this.$emit("update:path",this.emittedPath=this.overlay.getPath())})},onDestroy(){this.overlay.remove()}}),cr=y.defineComponent({name:"tg-rectangle",mixins:[z],inheritAttrs:!1,props:{bounds:N(Object),clickable:T(Boolean),editable:T(Boolean),strokeColor:T(String),strokeOpacity:T(Number),strokeWeight:T(Number),visible:T(Boolean),fillColor:T(String),fillOpacity:T(Number),"onUpdate:bounds":x()},emits:void 0,setup(r,{attrs:t}){return{attrs:J(t,r),overlay:void 0,emittedBounds:void 0}},watch:{bounds(r){if(this.emittedBounds!=null){const t=this.emittedBounds;if(this.emittedBounds=void 0,t.equals(r))return}this.overlay.setBounds(r)},clickable(){this.recreate()},editable(r){this.overlay.setEditable(r)},strokeColor(r){this.overlay.setStrokeColor(r)},strokeOpacity(r){this.overlay.setStrokeOpacity(r)},strokeWeight(r){this.overlay.setStrokeWeight(r)},fillColor(r){this.overlay.setFillColor(r)},fillOpacity(r){this.overlay.setFillOpacity(r)},visible(r){this.overlay.setVisible(r)}},onCreate(){this.overlay=this.$map.createRectangle(this),this.$map.addOverlay(this.overlay),$(this.attrs.listeners,this.overlay),this.attrs.listenerProps["update:bounds"]&&this.overlay.addEventListener("bounds-changed",()=>{this.$emit("update:bounds",this.emittedBounds=this.overlay.getBounds())})},onDestroy(){this.$map.removeOverlay(this.overlay)}}),$n=["beforeUpdate","updated"],zn={install(r,t={}){if(t.enable!==!1){const e=y.defineComponent({beforeCreate(){const i=Ji()??"",s=(t.nameRegex||/^[A-Z]/).test(i)?l=>{t.hookNames?t.hookNames.includes(l)&&console.debug("[lifecycle]",i,l):$n.includes(l)||console.debug("[lifecycle]",i,l)}:le;s("beforeCreate"),this.__life_impl=s},created(){this.__life("created")},beforeMount(){this.__life("beforeMount")},mounted(){this.__life("mounted")},beforeUpdate(){this.__life("beforeUpdate")},updated(){this.__life("updated")},beforeUnmount(){this.__life("beforeUnmount")},unmounted(){this.__life("unmounted")},methods:{__life(i){this.__life_impl(i)}},onCreate(){this.__life("onCreate")},onDestroy(){this.__life("onDestroy")}});r.mixin(e)}}},Gn=6378137;function Se(r){return r*Math.PI/180}function dr(r){return r*180/Math.PI}function Nn(r,t){if(r.lat===t.lat&&r.lng===t.lng)return 0;const e=Se((r.lat+t.lat)/2),i=Se((r.lat-t.lat)/2),n=Se((r.lng-t.lng)/2);let s=Math.sin(i),l=Math.sin(n),d=Math.sin(e);const o=Gn,c=1/298.257;s=s*s,l=l*l,d=d*d;const u=s*(1-l)+(1-d)*l,g=(1-s)*(1-l)+d*l,m=Math.atan(Math.sqrt(u/g)),v=Math.sqrt(u*g)/m,C=2*m*o,M=(3*v-1)/2/g,O=(3*v+1)/2/u;return C*(1+c*(M*d*(1-s)-O*(1-d)*s))}function ur(r,t,e){const n=63567523142e-4,s=1/298.257223563,l=Se(t),d=Math.sin(l),o=Math.cos(l),c=(1-s)*Math.tan(Se(r.lat)),u=1/Math.sqrt(1+c*c),g=c*u,m=Math.atan2(c,o),v=u*d,C=1-v*v,M=C*(6378137*6378137-n*n)/(n*n),O=1+M/16384*(4096+M*(-768+M*(320-175*M))),h=M/1024*(256+M*(-128+M*(74-47*M)));let p=0,_=0,b=0,E=e/(n*O),P=2*Math.PI;for(;Math.abs(E-P)>1e-12;){p=Math.cos(2*m+E),_=Math.sin(E),b=Math.cos(E);const q=h*_*(p+h/4*(b*(-1+2*p*p)-h/6*p*(-3+4*_*_)*(-3+4*p*p)));P=E,E=e/(n*O)+q}const B=g*_-u*b*o,D=Math.atan2(g*b+u*_*o,(1-s)*Math.sqrt(v*v+B*B)),Z=Math.atan2(_*d,u*b-g*_*o),S=s/16*C*(4+s*(4-3*C)),ee=Z-(1-S)*s*v*(E+S*_*(p+S*b*(-1+2*p*p)));return{lng:r.lng+dr(ee),lat:dr(D)}}const Zn={getDistance:Nn,getDestination:ur};var Wn={VITE_APP_DEV_KEY_BAIDU:"kXOq8Hg9BZbZEWAjXKuzd1oGreynup8h",VITE_APP_DEV_KEY_GOOGLE:"AIzaSyBcyzMel3dYFNcfcr0LOklbBQNpWycyZXo",VITE_APP_DEV_KEY_HERE:"",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const Hn={install(r,t){if(Wi(t),Wn.VITE_FALSE){const i=Object.assign({"./TgMap.vue":ye,"./TgMapWidget.vue":Yi,"./controls/TgCustomControl.vue":qi,"./controls/TgMapTypeControl.vue":Ki,"./controls/TgScaleControl.vue":Xi,"./controls/TgStreetViewControl.vue":Qi,"./controls/TgZoomControl.vue":er,"./extra/TgHeatmap.vue":tr,"./extra/TgMarkerClusterer.vue":Xt,"./layers/TgTrafficLayer.vue":ir,"./overlays/TgCircle.vue":rr,"./overlays/TgElementOverlay.vue":nr,"./overlays/TgInfoBox.vue":sr,"./overlays/TgInfoWindow.vue":or,"./overlays/TgLabel.vue":ar,"./overlays/TgMarker.vue":Ie,"./overlays/TgPolygon.vue":lr,"./overlays/TgPolyline.vue":hr,"./overlays/TgRectangle.vue":cr});Object.keys(i).forEach(n=>{const s=i[n];r.component(s.name??I(`Tg开头的组件必须设置name: ${n}`),s)})}const e=r.config.optionMergeStrategies;e[me]=e[fe]=(i,n)=>i?[...new Set([].concat(i,n))]:Array.isArray(n)?n:[n]}};a.AbstractControl=Fe,a.AbstractMap=lt,a.Autocomplete=$t,a.BaiduAutocomplete=pi,a.BaiduCircle=dt,a.BaiduControl=Ue,a.BaiduHeatmap=yi,a.BaiduInfoBoxOverlay=ft,a.BaiduInfoWindow=gt,a.BaiduMapTypeControl=Ye,a.BaiduMapUrls=st,a.BaiduMarker=ge,a.BaiduMarkerClusterer=Ci,a.BaiduOverlay=Ce,a.BaiduPlacesService=Ei,a.BaiduPolyShape=_t,a.BaiduPolygon=Tt,a.BaiduPolyline=bt,a.BaiduRectangle=Ot,a.BaiduScaleControl=Ke,a.BaiduSearchBox=Li,a.BaiduStreetViewControl=Je,a.BaiduZoomControl=et,a.BuildInMapType=W,a.BuildInMapTypeId=Rt,a.CachedValue=ce,a.ControlPosition=k,a.CoordType=R,a.CustomControl=oi,a.ElementOverlay=Ni,a.EmptyControl=ai,a.FastFindValues=si,a.GestureHandlingOptions=X,a.GoogleAutocomplete=ui,a.GoogleCircle=ut,a.GoogleControl=be,a.GoogleHeatmap=fi,a.GoogleInfoBoxOverlay=yt,a.GoogleInfoWindow=mt,a.GoogleMapTypeControl=qe,a.GoogleMapUrls=nt,a.GoogleMarker=vt,a.GoogleMarkerClusterer=Oi,a.GoogleOverlay=ht,a.GooglePlacesService=wi,a.GooglePolygon=Ct,a.GooglePolyline=Mt,a.GoogleRectangle=wt,a.GoogleScaleControl=Xe,a.GoogleSearchBox=Pi,a.GoogleStreetViewControl=Qe,a.GoogleZoomControl=tt,a.Heatmap=zt,a.ImageMapType=Er,a.InfoWindow=pt,a.InfoWindowModeValues=Di,a.KeyValue=At,a.LatLng=w,a.LatLngBounds=j,a.LifecycleLogPlugin=zn,a.MIXIN_HOOK_CREATE=me,a.MIXIN_HOOK_DESTROY=fe,a.MIXIN_MAP_NAME=Pt,a.MapMixin=z,a.MapPane=ue,a.MapTypeControlType=Dt,a.MapUrls=Gt,a.MapZoom=Bi,a.MarkerClusterer=Wt,a.Overlay=jt,a.PlacesService=Ht,a.SearchBox=Vt,a.SphericalUtils=Zn,a.SymbolPath=tn,a.TgCircle=rr,a.TgCustomControl=qi,a.TgElementOverlay=nr,a.TgHeatmap=tr,a.TgInfoBox=sr,a.TgInfoWindow=or,a.TgLabel=ar,a.TgMap=ye,a.TgMapType=Y,a.TgMapTypeControl=Ki,a.TgMapWidget=Yi,a.TgMarker=Ie,a.TgMarkerClusterer=Xt,a.TgPolygon=lr,a.TgPolyline=hr,a.TgRectangle=cr,a.TgScaleControl=Xi,a.TgStreetViewControl=Qi,a.TgTrafficLayer=ir,a.TgZoomControl=er,a.TrafficLayer=li,a.UnionIcon=Oe,a.assert=ne,a.assertNever=Ge,a.callHook=Be,a.computedSaveOnThis=un,a.createAsyncSingleton=ei,a.createEmptyVNode=Le,a.createPropertyObject=Fi,a.createPropertyObjectTyped=pn,a.debug=Tr,a.default=Hn,a.eventProp=x,a.extractVNodeFromSlotsByComponent=mn,a.findAncestorComponentByType=We,a.findByComponentType=gn,a.getDestination=ur,a.getTgMapConfig=Kt,a.isComponentByType=Ze,a.isDef=Cr,a.isEntryValueDef=Qt,a.isInstanceOf=vr,a.lateinit=yr,a.loadCachedMap=Hi,a.noop=le,a.optionalProp=T,a.path=Gi,a.requiredProp=N,a.safeAs=_r,a.safeAsComponent=kt,a.setTgMapConfig=Wi,a.splitAttrs=Ui,a.stringEnumProp=V,a.stringUnionPropFromValues=ji,a.throwError=I,a.throwUnsupported=He,a.todo=Mr,a.typed=Ne,a.unwrapStringEnumValue=br,a.useEventLogMethods=fn,a.useSplittedAttrs=J,a.useTgMapInner=Lt,Object.defineProperties(a,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
18
18
  //# sourceMappingURL=tg-map.umd.cjs.map