@geoman-io/leaflet-geoman-free
Version:
A Leaflet Plugin For Editing Geometry Layers in Leaflet 1.0
3 lines • 294 kB
JavaScript
"use strict";(()=>{var Yl=Object.create;var tn=Object.defineProperty;var $l=Object.getOwnPropertyDescriptor;var Zl=Object.getOwnPropertyNames;var Wl=Object.getPrototypeOf,Ql=Object.prototype.hasOwnProperty;var B=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}};var ec=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zl(t))!Ql.call(e,i)&&i!==r&&tn(e,i,{get:()=>t[i],enumerable:!(n=$l(t,i))||n.enumerable});return e};var Te=(e,t,r)=>(r=e!=null?Yl(Wl(e)):{},ec(t||!e||!e.__esModule?tn(r,"default",{value:e,enumerable:!0}):r,e));var an=B((FL,nn)=>{function rc(){this.__data__=[],this.size=0}nn.exports=rc});var pt=B((qL,on)=>{function nc(e,t){return e===t||e!==e&&t!==t}on.exports=nc});var ut=B((jL,sn)=>{var ic=pt();function ac(e,t){for(var r=e.length;r--;)if(ic(e[r][0],t))return r;return-1}sn.exports=ac});var cn=B((VL,ln)=>{var oc=ut(),sc=Array.prototype,lc=sc.splice;function cc(e){var t=this.__data__,r=oc(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():lc.call(t,r,1),--this.size,!0}ln.exports=cc});var dn=B((UL,hn)=>{var hc=ut();function dc(e){var t=this.__data__,r=hc(t,e);return r<0?void 0:t[r][1]}hn.exports=dc});var un=B((KL,pn)=>{var pc=ut();function uc(e){return pc(this.__data__,e)>-1}pn.exports=uc});var gn=B((zL,fn)=>{var fc=ut();function gc(e,t){var r=this.__data__,n=fc(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}fn.exports=gc});var ft=B((HL,mn)=>{var mc=an(),Lc=cn(),_c=dn(),yc=un(),bc=gn();function Ye(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ye.prototype.clear=mc;Ye.prototype.delete=Lc;Ye.prototype.get=_c;Ye.prototype.has=yc;Ye.prototype.set=bc;mn.exports=Ye});var _n=B((JL,Ln)=>{var Mc=ft();function vc(){this.__data__=new Mc,this.size=0}Ln.exports=vc});var bn=B((XL,yn)=>{function kc(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}yn.exports=kc});var vn=B((YL,Mn)=>{function Ec(e){return this.__data__.get(e)}Mn.exports=Ec});var En=B(($L,kn)=>{function xc(e){return this.__data__.has(e)}kn.exports=xc});var cr=B((ZL,xn)=>{var wc=typeof global=="object"&&global&&global.Object===Object&&global;xn.exports=wc});var qe=B((WL,wn)=>{var Pc=cr(),Cc=typeof self=="object"&&self&&self.Object===Object&&self,Ic=Pc||Cc||Function("return this")();wn.exports=Ic});var Nt=B((QL,Pn)=>{var Tc=qe(),Dc=Tc.Symbol;Pn.exports=Dc});var Dn=B((e_,Tn)=>{var Cn=Nt(),In=Object.prototype,Sc=In.hasOwnProperty,Oc=In.toString,gt=Cn?Cn.toStringTag:void 0;function Rc(e){var t=Sc.call(e,gt),r=e[gt];try{e[gt]=void 0;var n=!0}catch{}var i=Oc.call(e);return n&&(t?e[gt]=r:delete e[gt]),i}Tn.exports=Rc});var On=B((t_,Sn)=>{var Bc=Object.prototype,Gc=Bc.toString;function Ac(e){return Gc.call(e)}Sn.exports=Ac});var $e=B((r_,Gn)=>{var Rn=Nt(),Nc=Dn(),Fc=On(),qc="[object Null]",jc="[object Undefined]",Bn=Rn?Rn.toStringTag:void 0;function Vc(e){return e==null?e===void 0?jc:qc:Bn&&Bn in Object(e)?Nc(e):Fc(e)}Gn.exports=Vc});var De=B((n_,An)=>{function Uc(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}An.exports=Uc});var Ft=B((i_,Nn)=>{var Kc=$e(),zc=De(),Hc="[object AsyncFunction]",Jc="[object Function]",Xc="[object GeneratorFunction]",Yc="[object Proxy]";function $c(e){if(!zc(e))return!1;var t=Kc(e);return t==Jc||t==Xc||t==Hc||t==Yc}Nn.exports=$c});var qn=B((a_,Fn)=>{var Zc=qe(),Wc=Zc["__core-js_shared__"];Fn.exports=Wc});var Un=B((o_,Vn)=>{var hr=qn(),jn=(function(){var e=/[^.]+$/.exec(hr&&hr.keys&&hr.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function Qc(e){return!!jn&&jn in e}Vn.exports=Qc});var zn=B((s_,Kn)=>{var eh=Function.prototype,th=eh.toString;function rh(e){if(e!=null){try{return th.call(e)}catch{}try{return e+""}catch{}}return""}Kn.exports=rh});var Jn=B((l_,Hn)=>{var nh=Ft(),ih=Un(),ah=De(),oh=zn(),sh=/[\\^$.*+?()[\]{}|]/g,lh=/^\[object .+?Constructor\]$/,ch=Function.prototype,hh=Object.prototype,dh=ch.toString,ph=hh.hasOwnProperty,uh=RegExp("^"+dh.call(ph).replace(sh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function fh(e){if(!ah(e)||ih(e))return!1;var t=nh(e)?uh:lh;return t.test(oh(e))}Hn.exports=fh});var Yn=B((c_,Xn)=>{function gh(e,t){return e?.[t]}Xn.exports=gh});var qt=B((h_,$n)=>{var mh=Jn(),Lh=Yn();function _h(e,t){var r=Lh(e,t);return mh(r)?r:void 0}$n.exports=_h});var dr=B((d_,Zn)=>{var yh=qt(),bh=qe(),Mh=yh(bh,"Map");Zn.exports=Mh});var mt=B((p_,Wn)=>{var vh=qt(),kh=vh(Object,"create");Wn.exports=kh});var ti=B((u_,ei)=>{var Qn=mt();function Eh(){this.__data__=Qn?Qn(null):{},this.size=0}ei.exports=Eh});var ni=B((f_,ri)=>{function xh(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}ri.exports=xh});var ai=B((g_,ii)=>{var wh=mt(),Ph="__lodash_hash_undefined__",Ch=Object.prototype,Ih=Ch.hasOwnProperty;function Th(e){var t=this.__data__;if(wh){var r=t[e];return r===Ph?void 0:r}return Ih.call(t,e)?t[e]:void 0}ii.exports=Th});var si=B((m_,oi)=>{var Dh=mt(),Sh=Object.prototype,Oh=Sh.hasOwnProperty;function Rh(e){var t=this.__data__;return Dh?t[e]!==void 0:Oh.call(t,e)}oi.exports=Rh});var ci=B((L_,li)=>{var Bh=mt(),Gh="__lodash_hash_undefined__";function Ah(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Bh&&t===void 0?Gh:t,this}li.exports=Ah});var di=B((__,hi)=>{var Nh=ti(),Fh=ni(),qh=ai(),jh=si(),Vh=ci();function Ze(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ze.prototype.clear=Nh;Ze.prototype.delete=Fh;Ze.prototype.get=qh;Ze.prototype.has=jh;Ze.prototype.set=Vh;hi.exports=Ze});var fi=B((y_,ui)=>{var pi=di(),Uh=ft(),Kh=dr();function zh(){this.size=0,this.__data__={hash:new pi,map:new(Kh||Uh),string:new pi}}ui.exports=zh});var mi=B((b_,gi)=>{function Hh(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}gi.exports=Hh});var Lt=B((M_,Li)=>{var Jh=mi();function Xh(e,t){var r=e.__data__;return Jh(t)?r[typeof t=="string"?"string":"hash"]:r.map}Li.exports=Xh});var yi=B((v_,_i)=>{var Yh=Lt();function $h(e){var t=Yh(this,e).delete(e);return this.size-=t?1:0,t}_i.exports=$h});var Mi=B((k_,bi)=>{var Zh=Lt();function Wh(e){return Zh(this,e).get(e)}bi.exports=Wh});var ki=B((E_,vi)=>{var Qh=Lt();function ed(e){return Qh(this,e).has(e)}vi.exports=ed});var xi=B((x_,Ei)=>{var td=Lt();function rd(e,t){var r=td(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}Ei.exports=rd});var pr=B((w_,wi)=>{var nd=fi(),id=yi(),ad=Mi(),od=ki(),sd=xi();function We(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}We.prototype.clear=nd;We.prototype.delete=id;We.prototype.get=ad;We.prototype.has=od;We.prototype.set=sd;wi.exports=We});var Ci=B((P_,Pi)=>{var ld=ft(),cd=dr(),hd=pr(),dd=200;function pd(e,t){var r=this.__data__;if(r instanceof ld){var n=r.__data__;if(!cd||n.length<dd-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new hd(n)}return r.set(e,t),this.size=r.size,this}Pi.exports=pd});var Ti=B((C_,Ii)=>{var ud=ft(),fd=_n(),gd=bn(),md=vn(),Ld=En(),_d=Ci();function Qe(e){var t=this.__data__=new ud(e);this.size=t.size}Qe.prototype.clear=fd;Qe.prototype.delete=gd;Qe.prototype.get=md;Qe.prototype.has=Ld;Qe.prototype.set=_d;Ii.exports=Qe});var ur=B((I_,Di)=>{var yd=qt(),bd=(function(){try{var e=yd(Object,"defineProperty");return e({},"",{}),e}catch{}})();Di.exports=bd});var jt=B((T_,Oi)=>{var Si=ur();function Md(e,t,r){t=="__proto__"&&Si?Si(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}Oi.exports=Md});var fr=B((D_,Ri)=>{var vd=jt(),kd=pt();function Ed(e,t,r){(r!==void 0&&!kd(e[t],r)||r===void 0&&!(t in e))&&vd(e,t,r)}Ri.exports=Ed});var Gi=B((S_,Bi)=>{function xd(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var c=o[e?s:++i];if(r(a[c],c,a)===!1)break}return t}}Bi.exports=xd});var Ni=B((O_,Ai)=>{var wd=Gi(),Pd=wd();Ai.exports=Pd});var Ui=B((_t,et)=>{var Cd=qe(),Vi=typeof _t=="object"&&_t&&!_t.nodeType&&_t,Fi=Vi&&typeof et=="object"&&et&&!et.nodeType&&et,Id=Fi&&Fi.exports===Vi,qi=Id?Cd.Buffer:void 0,ji=qi?qi.allocUnsafe:void 0;function Td(e,t){if(t)return e.slice();var r=e.length,n=ji?ji(r):new e.constructor(r);return e.copy(n),n}et.exports=Td});var zi=B((R_,Ki)=>{var Dd=qe(),Sd=Dd.Uint8Array;Ki.exports=Sd});var Xi=B((B_,Ji)=>{var Hi=zi();function Od(e){var t=new e.constructor(e.byteLength);return new Hi(t).set(new Hi(e)),t}Ji.exports=Od});var $i=B((G_,Yi)=>{var Rd=Xi();function Bd(e,t){var r=t?Rd(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}Yi.exports=Bd});var Wi=B((A_,Zi)=>{function Gd(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}Zi.exports=Gd});var ta=B((N_,ea)=>{var Ad=De(),Qi=Object.create,Nd=(function(){function e(){}return function(t){if(!Ad(t))return{};if(Qi)return Qi(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}})();ea.exports=Nd});var na=B((F_,ra)=>{function Fd(e,t){return function(r){return e(t(r))}}ra.exports=Fd});var gr=B((q_,ia)=>{var qd=na(),jd=qd(Object.getPrototypeOf,Object);ia.exports=jd});var mr=B((j_,aa)=>{var Vd=Object.prototype;function Ud(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Vd;return e===r}aa.exports=Ud});var sa=B((V_,oa)=>{var Kd=ta(),zd=gr(),Hd=mr();function Jd(e){return typeof e.constructor=="function"&&!Hd(e)?Kd(zd(e)):{}}oa.exports=Jd});var je=B((U_,la)=>{function Xd(e){return e!=null&&typeof e=="object"}la.exports=Xd});var ha=B((K_,ca)=>{var Yd=$e(),$d=je(),Zd="[object Arguments]";function Wd(e){return $d(e)&&Yd(e)==Zd}ca.exports=Wd});var Lr=B((z_,ua)=>{var da=ha(),Qd=je(),pa=Object.prototype,ep=pa.hasOwnProperty,tp=pa.propertyIsEnumerable,rp=da((function(){return arguments})())?da:function(e){return Qd(e)&&ep.call(e,"callee")&&!tp.call(e,"callee")};ua.exports=rp});var tt=B((H_,fa)=>{var np=Array.isArray;fa.exports=np});var _r=B((J_,ga)=>{var ip=9007199254740991;function ap(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ip}ga.exports=ap});var Vt=B((X_,ma)=>{var op=Ft(),sp=_r();function lp(e){return e!=null&&sp(e.length)&&!op(e)}ma.exports=lp});var _a=B((Y_,La)=>{var cp=Vt(),hp=je();function dp(e){return hp(e)&&cp(e)}La.exports=dp});var ba=B(($_,ya)=>{function pp(){return!1}ya.exports=pp});var yr=B((yt,rt)=>{var up=qe(),fp=ba(),ka=typeof yt=="object"&&yt&&!yt.nodeType&&yt,Ma=ka&&typeof rt=="object"&&rt&&!rt.nodeType&&rt,gp=Ma&&Ma.exports===ka,va=gp?up.Buffer:void 0,mp=va?va.isBuffer:void 0,Lp=mp||fp;rt.exports=Lp});var wa=B((Z_,xa)=>{var _p=$e(),yp=gr(),bp=je(),Mp="[object Object]",vp=Function.prototype,kp=Object.prototype,Ea=vp.toString,Ep=kp.hasOwnProperty,xp=Ea.call(Object);function wp(e){if(!bp(e)||_p(e)!=Mp)return!1;var t=yp(e);if(t===null)return!0;var r=Ep.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Ea.call(r)==xp}xa.exports=wp});var Ca=B((W_,Pa)=>{var Pp=$e(),Cp=_r(),Ip=je(),Tp="[object Arguments]",Dp="[object Array]",Sp="[object Boolean]",Op="[object Date]",Rp="[object Error]",Bp="[object Function]",Gp="[object Map]",Ap="[object Number]",Np="[object Object]",Fp="[object RegExp]",qp="[object Set]",jp="[object String]",Vp="[object WeakMap]",Up="[object ArrayBuffer]",Kp="[object DataView]",zp="[object Float32Array]",Hp="[object Float64Array]",Jp="[object Int8Array]",Xp="[object Int16Array]",Yp="[object Int32Array]",$p="[object Uint8Array]",Zp="[object Uint8ClampedArray]",Wp="[object Uint16Array]",Qp="[object Uint32Array]",Z={};Z[zp]=Z[Hp]=Z[Jp]=Z[Xp]=Z[Yp]=Z[$p]=Z[Zp]=Z[Wp]=Z[Qp]=!0;Z[Tp]=Z[Dp]=Z[Up]=Z[Sp]=Z[Kp]=Z[Op]=Z[Rp]=Z[Bp]=Z[Gp]=Z[Ap]=Z[Np]=Z[Fp]=Z[qp]=Z[jp]=Z[Vp]=!1;function eu(e){return Ip(e)&&Cp(e.length)&&!!Z[Pp(e)]}Pa.exports=eu});var Ta=B((Q_,Ia)=>{function tu(e){return function(t){return e(t)}}Ia.exports=tu});var Sa=B((bt,nt)=>{var ru=cr(),Da=typeof bt=="object"&&bt&&!bt.nodeType&&bt,Mt=Da&&typeof nt=="object"&&nt&&!nt.nodeType&&nt,nu=Mt&&Mt.exports===Da,br=nu&&ru.process,iu=(function(){try{var e=Mt&&Mt.require&&Mt.require("util").types;return e||br&&br.binding&&br.binding("util")}catch{}})();nt.exports=iu});var Mr=B((ey,Ba)=>{var au=Ca(),ou=Ta(),Oa=Sa(),Ra=Oa&&Oa.isTypedArray,su=Ra?ou(Ra):au;Ba.exports=su});var vr=B((ty,Ga)=>{function lu(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}Ga.exports=lu});var Na=B((ry,Aa)=>{var cu=jt(),hu=pt(),du=Object.prototype,pu=du.hasOwnProperty;function uu(e,t,r){var n=e[t];(!(pu.call(e,t)&&hu(n,r))||r===void 0&&!(t in e))&&cu(e,t,r)}Aa.exports=uu});var qa=B((ny,Fa)=>{var fu=Na(),gu=jt();function mu(e,t,r,n){var i=!r;r||(r={});for(var a=-1,o=t.length;++a<o;){var s=t[a],c=n?n(r[s],e[s],s,r,e):void 0;c===void 0&&(c=e[s]),i?gu(r,s,c):fu(r,s,c)}return r}Fa.exports=mu});var Va=B((iy,ja)=>{function Lu(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}ja.exports=Lu});var kr=B((ay,Ua)=>{var _u=9007199254740991,yu=/^(?:0|[1-9]\d*)$/;function bu(e,t){var r=typeof e;return t=t??_u,!!t&&(r=="number"||r!="symbol"&&yu.test(e))&&e>-1&&e%1==0&&e<t}Ua.exports=bu});var za=B((oy,Ka)=>{var Mu=Va(),vu=Lr(),ku=tt(),Eu=yr(),xu=kr(),wu=Mr(),Pu=Object.prototype,Cu=Pu.hasOwnProperty;function Iu(e,t){var r=ku(e),n=!r&&vu(e),i=!r&&!n&&Eu(e),a=!r&&!n&&!i&&wu(e),o=r||n||i||a,s=o?Mu(e.length,String):[],c=s.length;for(var l in e)(t||Cu.call(e,l))&&!(o&&(l=="length"||i&&(l=="offset"||l=="parent")||a&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||xu(l,c)))&&s.push(l);return s}Ka.exports=Iu});var Ja=B((sy,Ha)=>{function Tu(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}Ha.exports=Tu});var Ya=B((ly,Xa)=>{var Du=De(),Su=mr(),Ou=Ja(),Ru=Object.prototype,Bu=Ru.hasOwnProperty;function Gu(e){if(!Du(e))return Ou(e);var t=Su(e),r=[];for(var n in e)n=="constructor"&&(t||!Bu.call(e,n))||r.push(n);return r}Xa.exports=Gu});var Er=B((cy,$a)=>{var Au=za(),Nu=Ya(),Fu=Vt();function qu(e){return Fu(e)?Au(e,!0):Nu(e)}$a.exports=qu});var Wa=B((hy,Za)=>{var ju=qa(),Vu=Er();function Uu(e){return ju(e,Vu(e))}Za.exports=Uu});var io=B((dy,no)=>{var Qa=fr(),Ku=Ui(),zu=$i(),Hu=Wi(),Ju=sa(),eo=Lr(),to=tt(),Xu=_a(),Yu=yr(),$u=Ft(),Zu=De(),Wu=wa(),Qu=Mr(),ro=vr(),ef=Wa();function tf(e,t,r,n,i,a,o){var s=ro(e,r),c=ro(t,r),l=o.get(c);if(l){Qa(e,r,l);return}var f=a?a(s,c,r+"",e,t,o):void 0,d=f===void 0;if(d){var g=to(c),M=!g&&Yu(c),I=!g&&!M&&Qu(c);f=c,g||M||I?to(s)?f=s:Xu(s)?f=Hu(s):M?(d=!1,f=Ku(c,!0)):I?(d=!1,f=zu(c,!0)):f=[]:Wu(c)||eo(c)?(f=s,eo(s)?f=ef(s):(!Zu(s)||$u(s))&&(f=Ju(c))):d=!1}d&&(o.set(c,f),i(f,c,n,a,o),o.delete(c)),Qa(e,r,f)}no.exports=tf});var so=B((py,oo)=>{var rf=Ti(),nf=fr(),af=Ni(),of=io(),sf=De(),lf=Er(),cf=vr();function ao(e,t,r,n,i){e!==t&&af(t,function(a,o){if(i||(i=new rf),sf(a))of(e,t,o,r,ao,n,i);else{var s=n?n(cf(e,o),a,o+"",e,t,i):void 0;s===void 0&&(s=a),nf(e,o,s)}},lf)}oo.exports=ao});var xr=B((uy,lo)=>{function hf(e){return e}lo.exports=hf});var ho=B((fy,co)=>{function df(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}co.exports=df});var fo=B((gy,uo)=>{var pf=ho(),po=Math.max;function uf(e,t,r){return t=po(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=po(n.length-t,0),o=Array(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),pf(e,this,s)}}uo.exports=uf});var mo=B((my,go)=>{function ff(e){return function(){return e}}go.exports=ff});var yo=B((Ly,_o)=>{var gf=mo(),Lo=ur(),mf=xr(),Lf=Lo?function(e,t){return Lo(e,"toString",{configurable:!0,enumerable:!1,value:gf(t),writable:!0})}:mf;_o.exports=Lf});var Mo=B((_y,bo)=>{var _f=800,yf=16,bf=Date.now;function Mf(e){var t=0,r=0;return function(){var n=bf(),i=yf-(n-r);if(r=n,i>0){if(++t>=_f)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}bo.exports=Mf});var ko=B((yy,vo)=>{var vf=yo(),kf=Mo(),Ef=kf(vf);vo.exports=Ef});var xo=B((by,Eo)=>{var xf=xr(),wf=fo(),Pf=ko();function Cf(e,t){return Pf(wf(e,t,xf),e+"")}Eo.exports=Cf});var Po=B((My,wo)=>{var If=pt(),Tf=Vt(),Df=kr(),Sf=De();function Of(e,t,r){if(!Sf(r))return!1;var n=typeof t;return(n=="number"?Tf(r)&&Df(t,r.length):n=="string"&&t in r)?If(r[t],e):!1}wo.exports=Of});var Io=B((vy,Co)=>{var Rf=xo(),Bf=Po();function Gf(e){return Rf(function(t,r){var n=-1,i=r.length,a=i>1?r[i-1]:void 0,o=i>2?r[2]:void 0;for(a=e.length>3&&typeof a=="function"?(i--,a):void 0,o&&Bf(r[0],r[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++n<i;){var s=r[n];s&&e(t,s,n,a)}return t})}Co.exports=Gf});var Ut=B((ky,To)=>{var Af=so(),Nf=Io(),Ff=Nf(function(e,t,r){Af(e,t,r)});To.exports=Ff});var Kt=B((Db,cs)=>{var bg=$e(),Mg=je(),vg="[object Symbol]";function kg(e){return typeof e=="symbol"||Mg(e)&&bg(e)==vg}cs.exports=kg});var ds=B((Sb,hs)=>{var Eg=tt(),xg=Kt(),wg=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pg=/^\w*$/;function Cg(e,t){if(Eg(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||xg(e)?!0:Pg.test(e)||!wg.test(e)||t!=null&&e in Object(t)}hs.exports=Cg});var fs=B((Ob,us)=>{var ps=pr(),Ig="Expected a function";function Pr(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Ig);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(Pr.Cache||ps),r}Pr.Cache=ps;us.exports=Pr});var ms=B((Rb,gs)=>{var Tg=fs(),Dg=500;function Sg(e){var t=Tg(e,function(n){return r.size===Dg&&r.clear(),n}),r=t.cache;return t}gs.exports=Sg});var _s=B((Bb,Ls)=>{var Og=ms(),Rg=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Bg=/\\(\\)?/g,Gg=Og(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Rg,function(r,n,i,a){t.push(i?a.replace(Bg,"$1"):n||r)}),t});Ls.exports=Gg});var bs=B((Gb,ys)=>{function Ag(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}ys.exports=Ag});var ws=B((Ab,xs)=>{var Ms=Nt(),Ng=bs(),Fg=tt(),qg=Kt(),jg=1/0,vs=Ms?Ms.prototype:void 0,ks=vs?vs.toString:void 0;function Es(e){if(typeof e=="string")return e;if(Fg(e))return Ng(e,Es)+"";if(qg(e))return ks?ks.call(e):"";var t=e+"";return t=="0"&&1/e==-jg?"-0":t}xs.exports=Es});var Cs=B((Nb,Ps)=>{var Vg=ws();function Ug(e){return e==null?"":Vg(e)}Ps.exports=Ug});var Ts=B((Fb,Is)=>{var Kg=tt(),zg=ds(),Hg=_s(),Jg=Cs();function Xg(e,t){return Kg(e)?e:zg(e,t)?[e]:Hg(Jg(e))}Is.exports=Xg});var Ss=B((qb,Ds)=>{var Yg=Kt(),$g=1/0;function Zg(e){if(typeof e=="string"||Yg(e))return e;var t=e+"";return t=="0"&&1/e==-$g?"-0":t}Ds.exports=Zg});var Rs=B((jb,Os)=>{var Wg=Ts(),Qg=Ss();function em(e,t){t=Wg(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[Qg(t[r++])];return r&&r==n?e:void 0}Os.exports=em});var vt=B((Vb,Bs)=>{var tm=Rs();function rm(e,t,r){var n=e==null?void 0:tm(e,t);return n===void 0?r:n}Bs.exports=rm});var Ws=B((Br,Gr)=>{(function(e,t){typeof Br=="object"&&typeof Gr<"u"?Gr.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(Br,function(){"use strict";function e(m,y,_,S,D){(function O(N,F,h,p,u){for(;p>h;){if(p-h>600){var v=p-h+1,b=F-h+1,E=Math.log(v),w=.5*Math.exp(2*E/3),k=.5*Math.sqrt(E*w*(v-w)/v)*(b-v/2<0?-1:1),x=Math.max(h,Math.floor(F-b*w/v+k)),C=Math.min(p,Math.floor(F+(v-b)*w/v+k));O(N,F,x,C,u)}var P=N[F],R=h,q=p;for(t(N,h,F),u(N[p],P)>0&&t(N,h,p);R<q;){for(t(N,R,q),R++,q--;u(N[R],P)<0;)R++;for(;u(N[q],P)>0;)q--}u(N[h],P)===0?t(N,h,q):t(N,++q,p),q<=F&&(h=q+1),F<=q&&(p=q-1)}})(m,y,_||0,S||m.length-1,D||r)}function t(m,y,_){var S=m[y];m[y]=m[_],m[_]=S}function r(m,y){return m<y?-1:m>y?1:0}var n=function(m){m===void 0&&(m=9),this._maxEntries=Math.max(4,m),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(m,y,_){if(!_)return y.indexOf(m);for(var S=0;S<y.length;S++)if(_(m,y[S]))return S;return-1}function a(m,y){o(m,0,m.children.length,y,m)}function o(m,y,_,S,D){D||(D=I(null)),D.minX=1/0,D.minY=1/0,D.maxX=-1/0,D.maxY=-1/0;for(var O=y;O<_;O++){var N=m.children[O];s(D,m.leaf?S(N):N)}return D}function s(m,y){return m.minX=Math.min(m.minX,y.minX),m.minY=Math.min(m.minY,y.minY),m.maxX=Math.max(m.maxX,y.maxX),m.maxY=Math.max(m.maxY,y.maxY),m}function c(m,y){return m.minX-y.minX}function l(m,y){return m.minY-y.minY}function f(m){return(m.maxX-m.minX)*(m.maxY-m.minY)}function d(m){return m.maxX-m.minX+(m.maxY-m.minY)}function g(m,y){return m.minX<=y.minX&&m.minY<=y.minY&&y.maxX<=m.maxX&&y.maxY<=m.maxY}function M(m,y){return y.minX<=m.maxX&&y.minY<=m.maxY&&y.maxX>=m.minX&&y.maxY>=m.minY}function I(m){return{children:m,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function T(m,y,_,S,D){for(var O=[y,_];O.length;)if(!((_=O.pop())-(y=O.pop())<=S)){var N=y+Math.ceil((_-y)/S/2)*S;e(m,N,y,_,D),O.push(y,N,N,_)}}return n.prototype.all=function(){return this._all(this.data,[])},n.prototype.search=function(m){var y=this.data,_=[];if(!M(m,y))return _;for(var S=this.toBBox,D=[];y;){for(var O=0;O<y.children.length;O++){var N=y.children[O],F=y.leaf?S(N):N;M(m,F)&&(y.leaf?_.push(N):g(m,F)?this._all(N,_):D.push(N))}y=D.pop()}return _},n.prototype.collides=function(m){var y=this.data;if(!M(m,y))return!1;for(var _=[];y;){for(var S=0;S<y.children.length;S++){var D=y.children[S],O=y.leaf?this.toBBox(D):D;if(M(m,O)){if(y.leaf||g(m,O))return!0;_.push(D)}}y=_.pop()}return!1},n.prototype.load=function(m){if(!m||!m.length)return this;if(m.length<this._minEntries){for(var y=0;y<m.length;y++)this.insert(m[y]);return this}var _=this._build(m.slice(),0,m.length-1,0);if(this.data.children.length)if(this.data.height===_.height)this._splitRoot(this.data,_);else{if(this.data.height<_.height){var S=this.data;this.data=_,_=S}this._insert(_,this.data.height-_.height-1,!0)}else this.data=_;return this},n.prototype.insert=function(m){return m&&this._insert(m,this.data.height-1),this},n.prototype.clear=function(){return this.data=I([]),this},n.prototype.remove=function(m,y){if(!m)return this;for(var _,S,D,O=this.data,N=this.toBBox(m),F=[],h=[];O||F.length;){if(O||(O=F.pop(),S=F[F.length-1],_=h.pop(),D=!0),O.leaf){var p=i(m,O.children,y);if(p!==-1)return O.children.splice(p,1),F.push(O),this._condense(F),this}D||O.leaf||!g(O,N)?S?(_++,O=S.children[_],D=!1):O=null:(F.push(O),h.push(_),_=0,S=O,O=O.children[0])}return this},n.prototype.toBBox=function(m){return m},n.prototype.compareMinX=function(m,y){return m.minX-y.minX},n.prototype.compareMinY=function(m,y){return m.minY-y.minY},n.prototype.toJSON=function(){return this.data},n.prototype.fromJSON=function(m){return this.data=m,this},n.prototype._all=function(m,y){for(var _=[];m;)m.leaf?y.push.apply(y,m.children):_.push.apply(_,m.children),m=_.pop();return y},n.prototype._build=function(m,y,_,S){var D,O=_-y+1,N=this._maxEntries;if(O<=N)return a(D=I(m.slice(y,_+1)),this.toBBox),D;S||(S=Math.ceil(Math.log(O)/Math.log(N)),N=Math.ceil(O/Math.pow(N,S-1))),(D=I([])).leaf=!1,D.height=S;var F=Math.ceil(O/N),h=F*Math.ceil(Math.sqrt(N));T(m,y,_,h,this.compareMinX);for(var p=y;p<=_;p+=h){var u=Math.min(p+h-1,_);T(m,p,u,F,this.compareMinY);for(var v=p;v<=u;v+=F){var b=Math.min(v+F-1,u);D.children.push(this._build(m,v,b,S-1))}}return a(D,this.toBBox),D},n.prototype._chooseSubtree=function(m,y,_,S){for(;S.push(y),!y.leaf&&S.length-1!==_;){for(var D=1/0,O=1/0,N=void 0,F=0;F<y.children.length;F++){var h=y.children[F],p=f(h),u=(v=m,b=h,(Math.max(b.maxX,v.maxX)-Math.min(b.minX,v.minX))*(Math.max(b.maxY,v.maxY)-Math.min(b.minY,v.minY))-p);u<O?(O=u,D=p<D?p:D,N=h):u===O&&p<D&&(D=p,N=h)}y=N||y.children[0]}var v,b;return y},n.prototype._insert=function(m,y,_){var S=_?m:this.toBBox(m),D=[],O=this._chooseSubtree(S,this.data,y,D);for(O.children.push(m),s(O,S);y>=0&&D[y].children.length>this._maxEntries;)this._split(D,y),y--;this._adjustParentBBoxes(S,D,y)},n.prototype._split=function(m,y){var _=m[y],S=_.children.length,D=this._minEntries;this._chooseSplitAxis(_,D,S);var O=this._chooseSplitIndex(_,D,S),N=I(_.children.splice(O,_.children.length-O));N.height=_.height,N.leaf=_.leaf,a(_,this.toBBox),a(N,this.toBBox),y?m[y-1].children.push(N):this._splitRoot(_,N)},n.prototype._splitRoot=function(m,y){this.data=I([m,y]),this.data.height=m.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},n.prototype._chooseSplitIndex=function(m,y,_){for(var S,D,O,N,F,h,p,u=1/0,v=1/0,b=y;b<=_-y;b++){var E=o(m,0,b,this.toBBox),w=o(m,b,_,this.toBBox),k=(D=E,O=w,N=void 0,F=void 0,h=void 0,p=void 0,N=Math.max(D.minX,O.minX),F=Math.max(D.minY,O.minY),h=Math.min(D.maxX,O.maxX),p=Math.min(D.maxY,O.maxY),Math.max(0,h-N)*Math.max(0,p-F)),x=f(E)+f(w);k<u?(u=k,S=b,v=x<v?x:v):k===u&&x<v&&(v=x,S=b)}return S||_-y},n.prototype._chooseSplitAxis=function(m,y,_){var S=m.leaf?this.compareMinX:c,D=m.leaf?this.compareMinY:l;this._allDistMargin(m,y,_,S)<this._allDistMargin(m,y,_,D)&&m.children.sort(S)},n.prototype._allDistMargin=function(m,y,_,S){m.children.sort(S);for(var D=this.toBBox,O=o(m,0,y,D),N=o(m,_-y,_,D),F=d(O)+d(N),h=y;h<_-y;h++){var p=m.children[h];s(O,m.leaf?D(p):p),F+=d(O)}for(var u=_-y-1;u>=y;u--){var v=m.children[u];s(N,m.leaf?D(v):v),F+=d(N)}return F},n.prototype._adjustParentBBoxes=function(m,y,_){for(var S=_;S>=0;S--)s(y[S],m)},n.prototype._condense=function(m){for(var y=m.length-1,_=void 0;y>=0;y--)m[y].children.length===0?y>0?(_=m[y-1].children).splice(_.indexOf(m[y]),1):this.clear():a(m[y],this.toBBox)},n})});Array.prototype.findIndex=Array.prototype.findIndex||function(e){if(this===null)throw new TypeError("Array.prototype.findIndex called on null or undefined");if(typeof e!="function")throw new TypeError("callback must be a function");for(var t=Object(this),r=t.length>>>0,n=arguments[1],i=0;i<r;i++)if(e.call(n,t[i],i,t))return i;return-1};Array.prototype.find=Array.prototype.find||function(e){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof e!="function")throw new TypeError("callback must be a function");for(var t=Object(this),r=t.length>>>0,n=arguments[1],i=0;i<r;i++){var a=t[i];if(e.call(n,a,i,t))return a}};typeof Object.assign!="function"&&(Object.assign=function(e){"use strict";if(e==null)throw new TypeError("Cannot convert undefined or null to object");e=Object(e);for(var t=1;t<arguments.length;t++){var r=arguments[t];if(r!=null)for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e});(function(e){e.forEach(function(t){t.hasOwnProperty("remove")||Object.defineProperty(t,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){this.parentNode.removeChild(this)}})})})([Element.prototype,CharacterData.prototype,DocumentType.prototype]);Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(e,t){if(this==null)throw new TypeError('"this" is null or not defined');var r=Object(this),n=r.length>>>0;if(n===0)return!1;var i=t|0,a=Math.max(i>=0?i:n-Math.abs(i),0);function o(s,c){return s===c||typeof s=="number"&&typeof c=="number"&&isNaN(s)&&isNaN(c)}for(;a<n;){if(o(r[a],e))return!0;a++}return!1}});var rn={name:"@geoman-io/leaflet-geoman-free",version:"2.20.4",description:"A Leaflet Plugin For Editing Geometry Layers in Leaflet 1.0",keywords:["leaflet","geoman","polygon management","geometry editing","map data","map overlay","polygon","geojson","leaflet-draw","data-field-geojson","ui-leaflet-draw"],files:["dist/leaflet-geoman.js","dist/leaflet-geoman.min.js","dist/leaflet-geoman.css","dist/leaflet-geoman.d.ts","dist/leaflet-geoman.js.map","dist/leaflet-geoman.min.js.map","dist/leaflet-geoman.css.map"],main:"dist/leaflet-geoman.js",module:"dist/leaflet-geoman.js",types:"dist/leaflet-geoman.d.ts",exports:{".":{types:"./dist/leaflet-geoman.d.ts",import:"./dist/leaflet-geoman.js",require:"./dist/leaflet-geoman.js",default:"./dist/leaflet-geoman.js"},"./dist/leaflet-geoman.css":"./dist/leaflet-geoman.css"},dependencies:{"@turf/boolean-contains":"^7.4.0","@turf/kinks":"^7.4.0","@turf/line-intersect":"^7.4.0","@turf/line-split":"^7.4.0",lodash:"4.18.1","polyclip-ts":"^0.16.8"},devDependencies:{"@types/geojson":"^7946.0.16","@types/leaflet":"^1.9.22","@types/lodash":"^4.17.26","@types/node":"^20.19.43","@vitest/coverage-v8":"^5.0.4","cross-env":"^10.1.0",cypress:"^16.1.1",esbuild:"^0.28.2",husky:"^9.1.7",leaflet:"1.9.4","lint-staged":"^17.6.0",oxfmt:"^0.73.0",oxlint:"^1.88.0","prosthetic-hand":"2.2.2",tsx:"^4.23.15",typescript:"^6.0.3",vitest:"^5.0.4"},peerDependencies:{leaflet:"^1.2.0"},engines:{node:">=20.0.0"},packageManager:"pnpm@12.5.1",scripts:{start:"pnpm run dev",dev:"cross-env DEV=true tsx bundle.mts",build:"tsx bundle.mts",test:"cypress run --browser chrome","test:unit":"vitest run","test:unit:watch":"vitest","test:unit:coverage":"vitest run --coverage","test:all":"pnpm run test:unit && pnpm run test",cypress:"cypress open",prepare:"pnpm run build && husky",lint:"oxlint src demo cypress test test-page.ts bundle.mts vitest.config.ts cypress.config.ts --fix && oxfmt --write src demo cypress test test-page.ts bundle.mts vitest.config.ts cypress.config.ts","lint:check":"oxlint src demo cypress test test-page.ts bundle.mts vitest.config.ts cypress.config.ts && oxfmt --check src demo cypress test test-page.ts bundle.mts vitest.config.ts cypress.config.ts",typecheck:"tsc --noEmit && tsc --noEmit -p tsconfig.tools.json && tsc --noEmit -p cypress/tsconfig.json && tsc --noEmit -p demo/tsconfig.json && tsc --noEmit -p test/types/tsconfig.json"},repository:{type:"git",url:"git://github.com/geoman-io/leaflet-geoman.git"},author:{name:"Geoman.io",email:"sales@geoman.io",url:"http://geoman.io"},license:"MIT",bugs:{url:"https://github.com/geoman-io/leaflet-geoman/issues"},homepage:"https://geoman.io","lint-staged":{"*.{js,ts,mjs,mts,cts}":"oxlint --fix","*.{js,ts,mjs,mts,cts,css}":"oxfmt --write"}};var Dr=Te(Ut());var Do={tooltips:{placeMarker:"Click to place marker",placeMarkerTouch:"Tap the map to place a marker",firstVertex:"Click to place first vertex",continueLine:"Click to continue drawing",finishLine:"Click any existing marker to finish",finishPoly:"Click first marker to finish",finishRect:"Click to finish",startCircle:"Click to place circle center",finishCircle:"Click to finish circle",placeCircleMarker:"Click to place circle marker",placeText:"Click to place text",selectFirstLayerFor:"Select first layer for {action}",selectSecondLayerFor:"Select second layer for {action}"},actions:{finish:"Finish",cancel:"Cancel",removeLastVertex:"Remove Last Vertex"},buttonTitles:{drawMarkerButton:"Draw Marker",drawPolyButton:"Draw Polygons",drawLineButton:"Draw Polyline",drawCircleButton:"Draw Circle",drawRectButton:"Draw Rectangle",editButton:"Edit Layers",dragButton:"Drag Layers",cutButton:"Cut Layers",deleteButton:"Remove Layers",drawCircleMarkerButton:"Draw Circle Marker",snappingButton:"Snap dragged marker to other layers and vertices",pinningButton:"Pin shared vertices together",rotateButton:"Rotate Layers",drawTextButton:"Draw Text",scaleButton:"Scale Layers",autoTracingButton:"Auto trace Line",snapGuidesButton:"Show SnapGuides",unionButton:"Union layers",differenceButton:"Subtract layers"},measurements:{totalLength:"Length",segmentLength:"Segment length",area:"Area",radius:"Radius",perimeter:"Perimeter",height:"Height",width:"Width",coordinates:"Position",coordinatesMarker:"Position Marker"}};var So={tooltips:{placeMarker:"Platziere den Marker mit Klick",placeMarkerTouch:"Tippe auf die Karte, um einen Marker zu platzieren",firstVertex:"Platziere den ersten Marker mit Klick",continueLine:"Klicke, um weiter zu zeichnen",finishLine:"Beende mit Klick auf existierenden Marker",finishPoly:"Beende mit Klick auf ersten Marker",finishRect:"Beende mit Klick",startCircle:"Platziere das Kreiszentrum mit Klick",finishCircle:"Beende den Kreis mit Klick",placeCircleMarker:"Platziere den Kreismarker mit Klick",placeText:"Platziere den Text mit Klick"},actions:{finish:"Beenden",cancel:"Abbrechen",removeLastVertex:"Letzten Vertex l\xF6schen"},buttonTitles:{drawMarkerButton:"Marker zeichnen",drawPolyButton:"Polygon zeichnen",drawLineButton:"Polyline zeichnen",drawCircleButton:"Kreis zeichnen",drawRectButton:"Rechteck zeichnen",editButton:"Layer editieren",dragButton:"Layer bewegen",cutButton:"Layer schneiden",deleteButton:"Layer l\xF6schen",drawCircleMarkerButton:"Kreismarker zeichnen",snappingButton:"Bewegter Layer an andere Layer oder Vertexe einhacken",pinningButton:"Vertexe an der gleichen Position verkn\xFCpfen",rotateButton:"Layer drehen",drawTextButton:"Text zeichnen",scaleButton:"Layer skalieren",autoTracingButton:"Linie automatisch nachzeichen"},measurements:{totalLength:"L\xE4nge",segmentLength:"Segment L\xE4nge",area:"Fl\xE4che",radius:"Radius",perimeter:"Umfang",height:"H\xF6he",width:"Breite",coordinates:"Position",coordinatesMarker:"Position Marker"}};var Oo={tooltips:{placeMarker:"Clicca per posizionare un Marker",placeMarkerTouch:"Tocca la mappa per posizionare un marker",firstVertex:"Clicca per posizionare il primo vertice",continueLine:"Clicca per continuare a disegnare",finishLine:"Clicca qualsiasi marker esistente per terminare",finishPoly:"Clicca il primo marker per terminare",finishRect:"Clicca per terminare",startCircle:"Clicca per posizionare il punto centrale del cerchio",finishCircle:"Clicca per terminare il cerchio",placeCircleMarker:"Clicca per posizionare un Marker del cherchio"},actions:{finish:"Termina",cancel:"Annulla",removeLastVertex:"Rimuovi l'ultimo vertice"},buttonTitles:{drawMarkerButton:"Disegna Marker",drawPolyButton:"Disegna Poligoni",drawLineButton:"Disegna Polilinea",drawCircleButton:"Disegna Cerchio",drawRectButton:"Disegna Rettangolo",editButton:"Modifica Livelli",dragButton:"Sposta Livelli",cutButton:"Ritaglia Livelli",deleteButton:"Elimina Livelli",drawCircleMarkerButton:"Disegna Marker del Cerchio",snappingButton:"Snap ha trascinato il pennarello su altri strati e vertici",pinningButton:"Pin condiviso vertici insieme",rotateButton:"Ruota livello"}};var Ro={tooltips:{placeMarker:"Klik untuk menempatkan marker",placeMarkerTouch:"Ketuk peta untuk menempatkan marker",firstVertex:"Klik untuk menempatkan vertex pertama",continueLine:"Klik untuk meneruskan digitasi",finishLine:"Klik pada sembarang marker yang ada untuk mengakhiri",finishPoly:"Klik marker pertama untuk mengakhiri",finishRect:"Klik untuk mengakhiri",startCircle:"Klik untuk menempatkan titik pusat lingkaran",finishCircle:"Klik untuk mengakhiri lingkaran",placeCircleMarker:"Klik untuk menempatkan penanda lingkarann"},actions:{finish:"Selesai",cancel:"Batal",removeLastVertex:"Hilangkan Vertex Terakhir"},buttonTitles:{drawMarkerButton:"Digitasi Marker",drawPolyButton:"Digitasi Polygon",drawLineButton:"Digitasi Polyline",drawCircleButton:"Digitasi Lingkaran",drawRectButton:"Digitasi Segi Empat",editButton:"Edit Layer",dragButton:"Geser Layer",cutButton:"Potong Layer",deleteButton:"Hilangkan Layer",drawCircleMarkerButton:"Digitasi Penanda Lingkaran",snappingButton:"Jepretkan penanda yang ditarik ke lapisan dan simpul lain",pinningButton:"Sematkan simpul bersama bersama",rotateButton:"Putar lapisan"}};var Bo={tooltips:{placeMarker:"Adaug\u0103 un punct",placeMarkerTouch:"Atinge\u021Bi harta pentru a plasa un punct",firstVertex:"Apas\u0103 aici pentru a ad\u0103uga primul Vertex",continueLine:"Apas\u0103 aici pentru a continua desenul",finishLine:"Apas\u0103 pe orice obiect pentru a finisa desenul",finishPoly:"Apas\u0103 pe primul obiect pentru a finisa",finishRect:"Apas\u0103 pentru a finisa",startCircle:"Apas\u0103 pentru a desena un cerc",finishCircle:"Apas\u0103 pentru a finisa un cerc",placeCircleMarker:"Adaug\u0103 un punct"},actions:{finish:"Termin\u0103",cancel:"Anuleaz\u0103",removeLastVertex:"\u0218terge ultimul Vertex"},buttonTitles:{drawMarkerButton:"Adaug\u0103 o bulin\u0103",drawPolyButton:"Deseneaz\u0103 un poligon",drawLineButton:"Deseneaz\u0103 o linie",drawCircleButton:"Deseneaz\u0103 un cerc",drawRectButton:"Deseneaz\u0103 un dreptunghi",editButton:"Editeaz\u0103 straturile",dragButton:"Mut\u0103 straturile",cutButton:"Taie straturile",deleteButton:"\u0218terge straturile",drawCircleMarkerButton:"Deseneaz\u0103 marcatorul cercului",snappingButton:"Fixa\u021Bi marcatorul glisat pe alte straturi \u0219i v\xE2rfuri",pinningButton:"Fixa\u021Bi v\xE2rfurile partajate \xEEmpreun\u0103",rotateButton:"Roti\u021Bi stratul"}};var Go={tooltips:{placeMarker:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u043D\u0430\u043D\u0435\u0441\u0442\u0438 \u043C\u0430\u0440\u043A\u0435\u0440",placeMarkerTouch:"\u041A\u043E\u0441\u043D\u0438\u0442\u0435\u0441\u044C \u043A\u0430\u0440\u0442\u044B, \u0447\u0442\u043E\u0431\u044B \u0440\u0430\u0437\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u043C\u0430\u0440\u043A\u0435\u0440",firstVertex:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u043D\u0430\u043D\u0435\u0441\u0442\u0438 \u043F\u0435\u0440\u0432\u044B\u0439 \u043E\u0431\u044A\u0435\u043A\u0442",continueLine:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0440\u0438\u0441\u043E\u0432\u0430\u043D\u0438\u0435",finishLine:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u043B\u044E\u0431\u043E\u0439 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0439 \u043C\u0430\u0440\u043A\u0435\u0440 \u0434\u043B\u044F \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u0438\u044F",finishPoly:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043F\u0435\u0440\u0432\u0443\u044E \u0442\u043E\u0447\u043A\u0443, \u0447\u0442\u043E\u0431\u044B \u0437\u0430\u043A\u043E\u043D\u0447\u0438\u0442\u044C",finishRect:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u0437\u0430\u043A\u043E\u043D\u0447\u0438\u0442\u044C",startCircle:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u0434\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0446\u0435\u043D\u0442\u0440 \u043A\u0440\u0443\u0433\u0430",finishCircle:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u0437\u0430\u0434\u0430\u0442\u044C \u0440\u0430\u0434\u0438\u0443\u0441",placeCircleMarker:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u043D\u0430\u043D\u0435\u0441\u0442\u0438 \u043A\u0440\u0443\u0433\u043E\u0432\u043E\u0439 \u043C\u0430\u0440\u043A\u0435\u0440"},actions:{finish:"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u044C",cancel:"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C",removeLastVertex:"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435"},buttonTitles:{drawMarkerButton:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043C\u0430\u0440\u043A\u0435\u0440",drawPolyButton:"\u0420\u0438\u0441\u043E\u0432\u0430\u0442\u044C \u043F\u043E\u043B\u0438\u0433\u043E\u043D",drawLineButton:"\u0420\u0438\u0441\u043E\u0432\u0430\u0442\u044C \u043A\u0440\u0438\u0432\u0443\u044E",drawCircleButton:"\u0420\u0438\u0441\u043E\u0432\u0430\u0442\u044C \u043A\u0440\u0443\u0433",drawRectButton:"\u0420\u0438\u0441\u043E\u0432\u0430\u0442\u044C \u043F\u0440\u044F\u043C\u043E\u0443\u0433\u043E\u043B\u044C\u043D\u0438\u043A",editButton:"\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u043B\u043E\u0439",dragButton:"\u041F\u0435\u0440\u0435\u043D\u0435\u0441\u0442\u0438 \u0441\u043B\u043E\u0439",cutButton:"\u0412\u044B\u0440\u0435\u0437\u0430\u0442\u044C \u0441\u043B\u043E\u0439",deleteButton:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0441\u043B\u043E\u0439",drawCircleMarkerButton:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A\u0440\u0443\u0433\u043E\u0432\u043E\u0439 \u043C\u0430\u0440\u043A\u0435\u0440",snappingButton:"\u041F\u0440\u0438\u0432\u044F\u0437\u0430\u0442\u044C \u043F\u0435\u0440\u0435\u0442\u0430\u0441\u043A\u0438\u0432\u0430\u0435\u043C\u044B\u0439 \u043C\u0430\u0440\u043A\u0435\u0440 \u043A \u0434\u0440\u0443\u0433\u0438\u043C \u0441\u043B\u043E\u044F\u043C \u0438 \u0432\u0435\u0440\u0448\u0438\u043D\u0430\u043C",pinningButton:"\u0421\u0432\u044F\u0437\u0430\u0442\u044C \u043E\u0431\u0449\u0438\u0435 \u0442\u043E\u0447\u043A\u0438 \u0432\u043C\u0435\u0441\u0442\u0435",rotateButton:"\u041F\u043E\u0432\u043E\u0440\u043E\u0442 \u0441\u043B\u043E\u044F"}};var Ao={tooltips:{placeMarker:"Presiona para colocar un marcador",placeMarkerTouch:"Toca el mapa para colocar un marcador",firstVertex:"Presiona para colocar el primer v\xE9rtice",continueLine:"Presiona para continuar dibujando",finishLine:"Presiona cualquier marcador existente para finalizar",finishPoly:"Presiona el primer marcador para finalizar",finishRect:"Presiona para finalizar",startCircle:"Presiona para colocar el centro del c\xEDrculo",finishCircle:"Presiona para finalizar el c\xEDrculo",placeCircleMarker:"Presiona para colocar un marcador de c\xEDrculo"},actions:{finish:"Finalizar",cancel:"Cancelar",removeLastVertex:"Eliminar \xFAltimo v\xE9rtice"},buttonTitles:{drawMarkerButton:"Dibujar Marcador",drawPolyButton:"Dibujar Pol\xEDgono",drawLineButton:"Dibujar L\xEDnea",drawCircleButton:"Dibujar C\xEDrculo",drawRectButton:"Dibujar Rect\xE1ngulo",editButton:"Editar Capas",dragButton:"Arrastrar Capas",cutButton:"Cortar Capas",deleteButton:"Eliminar Capas",drawCircleMarkerButton:"Dibujar Marcador de C\xEDrculo",snappingButton:"El marcador de Snap arrastrado a otras capas y v\xE9rtices",pinningButton:"Fijar juntos los v\xE9rtices compartidos",rotateButton:"Rotar capa"}};var No={tooltips:{placeMarker:"Klik om een marker te plaatsen",placeMarkerTouch:"Tik op de kaart om een marker te plaatsen",firstVertex:"Klik om het eerste punt te plaatsen",continueLine:"Klik om te blijven tekenen",finishLine:"Klik op een bestaand punt om te be\xEBindigen",finishPoly:"Klik op het eerst punt om te be\xEBindigen",finishRect:"Klik om te be\xEBindigen",startCircle:"Klik om het middelpunt te plaatsen",finishCircle:"Klik om de cirkel te be\xEBindigen",placeCircleMarker:"Klik om een marker te plaatsen"},actions:{finish:"Bewaar",cancel:"Annuleer",removeLastVertex:"Verwijder laatste punt"},buttonTitles:{drawMarkerButton:"Plaats Marker",drawPolyButton:"Teken een vlak",drawLineButton:"Teken een lijn",drawCircleButton:"Teken een cirkel",drawRectButton:"Teken een vierkant",editButton:"Bewerk",dragButton:"Verplaats",cutButton:"Knip",deleteButton:"Verwijder",drawCircleMarkerButton:"Plaats Marker",snappingButton:"Snap gesleepte marker naar andere lagen en hoekpunten",pinningButton:"Speld gedeelde hoekpunten samen",rotateButton:"Laag roteren"}};var Fo={tooltips:{placeMarker:"Cliquez pour placer un marqueur",placeMarkerTouch:"Appuyez sur la carte pour placer un marqueur",firstVertex:"Cliquez pour placer le premier sommet",continueLine:"Cliquez pour continuer \xE0 dessiner",finishLine:"Cliquez sur n'importe quel marqueur pour terminer",finishPoly:"Cliquez sur le premier marqueur pour terminer",finishRect:"Cliquez pour terminer",startCircle:"Cliquez pour placer le centre du cercle",finishCircle:"Cliquez pour finir le cercle",placeCircleMarker:"Cliquez pour placer le marqueur circulaire"},actions:{finish:"Terminer",cancel:"Annuler",removeLastVertex:"Retirer le dernier sommet"},buttonTitles:{drawMarkerButton:"Placer des marqueurs",drawPolyButton:"Dessiner des polygones",drawLineButton:"Dessiner des polylignes",drawCircleButton:"Dessiner un cercle",drawRectButton:"Dessiner un rectangle",editButton:"\xC9diter des calques",dragButton:"D\xE9placer des calques",cutButton:"Couper des calques",deleteButton:"Supprimer des calques",drawCircleMarkerButton:"Dessiner un marqueur circulaire",snappingButton:"Glisser le marqueur vers d'autres couches et sommets",pinningButton:"\xC9pingler ensemble les sommets partag\xE9s",rotateButton:"Tourner des calques"}};var qo={tooltips:{placeMarker:"\u5355\u51FB\u653E\u7F6E\u6807\u8BB0",placeMarkerTouch:"\u70B9\u51FB\u5730\u56FE\u653E\u7F6E\u6807\u8BB0",firstVertex:"\u5355\u51FB\u653E\u7F6E\u9996\u4E2A\u9876\u70B9",continueLine:"\u5355\u51FB\u7EE7\u7EED\u7ED8\u5236",finishLine:"\u5355\u51FB\u4EFB\u4F55\u5B58\u5728\u7684\u6807\u8BB0\u4EE5\u5B8C\u6210",finishPoly:"\u5355\u51FB\u7B2C\u4E00\u4E2A\u6807\u8BB0\u4EE5\u5B8C\u6210",finishRect:"\u5355\u51FB\u5B8C\u6210",startCircle:"\u5355\u51FB\u653E\u7F6E\u5706\u5FC3",finishCircle:"\u5355\u51FB\u5B8C\u6210\u5706\u5F62",placeCircleMarker:"\u70B9\u51FB\u653E\u7F6E\u5706\u5F62\u6807\u8BB0"},actions:{finish:"\u5B8C\u6210",cancel:"\u53D6\u6D88",removeLastVertex:"\u79FB\u9664\u6700\u540E\u7684\u9876\u70B9"},buttonTitles:{drawMarkerButton:"\u7ED8\u5236\u6807\u8BB0",drawPolyButton:"\u7ED8\u5236\u591A\u8FB9\u5F62",drawLineButton:"\u7ED8\u5236\u7EBF\u6BB5",drawCircleButton:"\u7ED8\u5236\u5706\u5F62",drawRectButton:"\u7ED8\u5236\u957F\u65B9\u5F62",editButton:"\u7F16\u8F91\u56FE\u5C42",dragButton:"\u62D6\u62FD\u56FE\u5C42",cutButton:"\u526A\u5207\u56FE\u5C42",deleteButton:"\u5220\u9664\u56FE\u5C42",drawCircleMarkerButton:"\u753B\u5706\u5708\u6807\u8BB0",snappingButton:"\u5C06\u62D6\u52A8\u7684\u6807\u8BB0\u6355\u6349\u5230\u5176\u4ED6\u56FE\u5C42\u548C\u9876\u70B9",pinningButton:"\u5C06\u5171\u4EAB\u9876\u70B9\u56FA\u5B9A\u5728\u4E00\u8D77",rotateButton:"\u65CB\u8F6C\u56FE\u5C42"}};var jo={tooltips:{placeMarker:"\u55AE\u64CA\u653E\u7F6E\u6A19\u8A18",placeMarkerTouch:"\u9EDE\u64CA\u5730\u5716\u653E\u7F6E\u6A19\u8A18",firstVertex:"\u55AE\u64CA\u653E\u7F6E\u7B2C\u4E00\u500B\u9802\u9EDE",continueLine:"\u55AE\u64CA\u7E7C\u7E8C\u7E6A\u88FD",finishLine:"\u55AE\u64CA\u4EFB\u4F55\u5B58\u5728\u7684\u6A19\u8A18\u4EE5\u5B8C\u6210",finishPoly:"\u55AE\u64CA\u7B2C\u4E00\u500B\u6A19\u8A18\u4EE5\u5B8C\u6210",finishRect:"\u55AE\u64CA\u5B8C\u6210",startCircle:"\u55AE\u64CA\u653E\u7F6E\u5713\u5FC3",finishCircle:"\u55AE\u64CA\u5B8C\u6210\u5713\u5F62",placeCircleMarker:"\u9EDE\u64CA\u653E\u7F6E\u5713\u5F62\u6A19\u8A18"},actions:{finish:"\u5B8C\u6210",cancel:"\u53D6\u6D88",removeLastVertex:"\u79FB\u9664\u6700\u5F8C\u4E00\u500B\u9802\u9EDE"},buttonTitles:{drawMarkerButton:"\u653E\u7F6E\u6A19\u8A18",drawPolyButton:"\u7E6A\u88FD\u591A\u908A\u5F62",drawLineButton:"\u7E6A\u88FD\u7DDA\u6BB5",drawCircleButton:"\u7E6A\u88FD\u5713\u5F62",drawRectButton:"\u7E6A\u88FD\u65B9\u5F62",editButton:"\u7DE8\u8F2F\u5716\u5F62",dragButton:"\u79FB\u52D5\u5716\u5F62",cutButton:"\u88C1\u5207\u5716\u5F62",deleteButton:"\u522A\u9664\u5716\u5F62",drawCircleMarkerButton:"\u756B\u5713\u5708\u6A19\u8A18",snappingButton:"\u5C07\u62D6\u52D5\u7684\u6A19\u8A18\u5C0D\u9F4A\u5230\u5176\u4ED6\u5716\u5C64\u548C\u9802\u9EDE",pinningButton:"\u5C07\u5171\u4EAB\u9802\u9EDE\u56FA\u5B9A\u5728\u4E00\u8D77",rotateButton:"\u65CB\u8F49\u5716\u5F62"}};var Vo={tooltips:{placeMarker:"Clique para posicionar o marcador",placeMarkerTouch:"Toque no mapa para posicionar um marcador",firstVertex:"Clique para posicionar o primeiro v\xE9rtice",continueLine:"Clique para continuar desenhando",finishLine:"Clique em qualquer marcador existente para finalizar",finishPoly:"Clique no primeiro marcador para finalizar",finishRect:"Clique para finalizar",startCircle:"Clique para posicionar o centro do c\xEDrculo",finishCircle:"Clique para finalizar o c\xEDrculo",placeCircleMarker:"Clique para posicionar o marcador circular",placeText:"Clique para inserir texto"},actions:{finish:"Finalizar",cancel:"Cancelar",removeLastVertex:"Remover \xFAltimo v\xE9rtice"},buttonTitles:{drawMarkerButton:"Desenhar Marcador",drawPolyButton:"Desenhar Pol\xEDgonos",drawLineButton:"Desenhar Linha Poligonal",drawCircleButton:"Desenhar C\xEDrculo",drawRectButton:"Desenhar Ret\xE2ngulo",editButton:"Editar Camadas",dragButton:"Arrastar Camadas",cutButton:"Recortar Camadas",deleteButton:"Remover Camadas",drawCircleMarkerButton:"Desenhar Marcador de C\xEDrculo",snappingButton:"Ajustar marcador arrastado a outras camadas e v\xE9rtices",pinningButton:"Unir v\xE9rtices compartilhados",rotateButton:"Rotacionar Camadas",drawTextButton:"Desenhar Texto",scaleButton:"Redimensionar Camadas",autoTracingButton:"Tra\xE7ado Autom\xE1tico de Linha"},measurements:{totalLength:"Comprimento",segmentLength:"Comprimento do Segmento",area:"\xC1rea",radius:"Raio",perimeter:"Per\xEDmetro",height:"Altura",width:"Largura",coordinates:"Posi\xE7\xE3o",coordinatesMarker:"Marcador de Posi\xE7\xE3o"}};var wr={tooltips:{placeMarker:"Clique para colocar marcador",placeMarkerTouch:"Toque no mapa para colocar um marcador",firstVertex:"Clique para colocar primeiro v\xE9rtice",continueLine:"Clique para continuar a desenhar",finishLine:"Clique num marcador existente para terminar",finishPoly:"Clique no primeiro marcador para terminar",finishRect:"Clique para terminar",startCircle:"Clique para colocar o centro do c\xEDrculo",finishCircle:"Clique para terminar o c\xEDrculo",placeCircleMarker:"Clique para colocar marcador de c\xEDrculo",placeText:"Clique para colocar texto"},actions:{finish:"Terminar",cancel:"Cancelar",removeLastVertex:"Remover \xDAltimo V\xE9rtice"},buttonTitles:{drawMarkerButton:"Desenhar Marcador",drawPolyButton:"Desenhar Pol\xEDgonos",drawLineButton:"Desenhar Polilinha",drawCircleButton:"Desenhar C\xEDrculo",drawRectButton:"Desenhar Ret\xE2ngulo",editButton:"Editar Camadas",dragButton:"Arrastar Camadas",cutButton:"Cortar Camadas",deleteButton:"Remover Camadas",drawCircleMarkerButton:"Desenhar Marcador de C\xEDrculo",snappingButton:"Ajustar marcador arrastado a outras camadas e v\xE9rtices",pinningButton:"Unir v\xE9rtices partilhados",rotateButton:"Rodar Camadas",drawTextButton:"Desenhar Texto",scaleButton:"Escalar Camadas",autoTracingButton:"Tra\xE7ado Autom\xE1tico de Linha"},measurements:{totalLength:"Comprimento",segmentLength:"Comprimento do Segmento",area:"\xC1rea",radius:"Raio",perimeter:"Per\xEDmetro",height:"Altura",width:"Largura",coordinates:"Posi\xE7\xE3o",coordinatesMarker:"Marcador de Posi\xE7\xE3o"}};var Uo={tooltips:{placeMarker:"Kliknij, aby umie\u015Bci\u0107 znacznik",placeMarkerTouch:"Dotknij map\u0119, aby umie\u015Bci\u0107 znacznik",firstVertex:"Kliknij, aby umie\u015Bci\u0107 pierwszy wierzcho\u0142ek",continueLine:"Kliknij, aby kontynuowa\u0107 rysowanie",finishLine:"Kliknij dowolny istniej\u0105cy znacznik, aby zako\u0144czy\u0107",finishPoly:"Kliknij pierwszy znacznik, aby zako\u0144czy\u0107",finishRect:"Kliknij, aby zako\u0144czy\u0107",startCircle:"Kliknij, aby umie\u015Bci\u0107 \u015Brodek okr\u0119gu",finishCircle:"Kliknij, aby zako\u0144czy\u0107 okr\u0105g",placeCircleMarker:"Kliknij, aby umie\u015Bci\u0107 znacznik okr\u0119gu",placeText:"Kliknij, aby umie\u015Bci\u0107 tekst"},actions:{finish:"Zako\u0144cz",cancel:"Anuluj",removeLastVertex:"Usu\u0144 ostatni wierzcho\u0142ek"},buttonTitles:{drawMarkerButton:"Rysuj znacznik",drawPolyButton:"Rysuj wielok\u0105t",drawLineButton:"Rysuj lini\u0119",drawCircleButton:"Rysuj okr\u0105g",drawRectButton:"Rysuj prostok\u0105t",editButton:"Edytuj warstwy",dragButton:"Przeci\u0105gnij warstwy",cutButton:"Wytnij warstwy",deleteButton:"Usu\u0144 warstwy",drawCircleMarkerButton:"Rysuj znacznik okr\u0105g\u0142y",snappingButton:"Przyci\u0105gnij przenoszony znacznik do innych warstw i wierzcho\u0142k\xF3w",pinningButton:"Przypnij wsp\xF3lne wierzcho\u0142ki razem",rotateButton:"Obr\xF3\u0107 warstwy",drawTextButton:"Rysuj tekst",scaleButton:"Skaluj warstwy",autoTracingButton:"Automatyczne \u015Bledzenie linii"},measurements:{totalLength:"D\u0142ugo\u015B\u0107",segmentLength:"D\u0142ugo\u015B\u0107 odcinka",area:"Obszar",radius:"Promie\u0144",perimeter:"Obw\xF3d",height:"Wysoko\u015B\u0107",width:"Szeroko\u015B\u0107",coordinates:"Pozycja",coordinatesMarker:"Znacznik pozycji"}};var Ko={tooltips:{placeMarker:"Klicka f\xF6r att placera mark\xF6r",placeMarkerTouch:"Tryck p\xE5 kartan f\xF6r att placera en mark\xF6r",firstVertex:"Klicka f\xF6r att placera f\xF6rsta h\xF6rnet",continueLine:"Klicka f\xF6r att forts\xE4tta rita",finishLine:"Klicka p\xE5 en existerande punkt f\xF6r att slutf\xF6ra",finishPoly:"Klicka p\xE5 den f\xF6rsta punkten f\xF6r att slutf\xF6ra",finishRect:"Klicka f\xF6r att slutf\xF6ra",startCircle:"Klicka f\xF6r att placera cirkelns centrum",finishCircle:"Klicka f\xF6r att slutf\xF6ra cirkeln",placeCircleMarker:"Klicka f\xF6r att placera cirkelmark\xF6r"},actions:{finish:"Slutf\xF6r",cancel:"Avbryt",removeLastVertex:"Ta bort sista h\xF6rnet"},buttonTitles:{drawMarkerButton:"Rita Mark\xF6r",drawPolyButton:"Rita Polygoner",drawLineButton:"Rita Linje",drawCircleButton:"Rita Cirkel",drawRectButton:"Rita Rektangel",editButton:"Redigera Lager",dragButton:"Dra Lager",cutButton:"Klipp i Lager",deleteButton:"Ta bort Lager",drawCircleMarkerButton:"Rita Cirkelmark\xF6r",snappingButton:"Sn\xE4pp dra mark\xF6ren till andra lager och h\xF6rn",pinningButton:"F\xE4st delade h\xF6rn tillsammans",rotateButton:"Rotera lagret"}};var zo={tooltips:{placeMarker:"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C4\u03BF\u03C0\u03BF\u03B8\u03B5\u03C4\u03AE\u03C3\u03B5\u03C4\u03B5 \u0394\u03B5\u03AF\u03BA\u03C4\u03B7",placeMarkerTouch:"\u03A0\u03B1\u03C4\u03AE\u03C3\u03C4\u03B5 \u03C3\u03C4\u03BF \u03C7\u03AC\u03C1\u03C4\u03B7 \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C4\u03BF\u03C0\u03BF\u03B8\u03B5\u03C4\u03AE\u03C3\u03B5\u03C4\u03B5 \u03B4\u03B5\u03AF\u03BA\u03C4\u03B7",firstVertex:"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C4\u03BF\u03C0\u03BF\u03B8\u03B5\u03C4\u03AE\u03C3\u03B5\u03C4\u03B5 \u03C4\u03BF \u03C0\u03C1\u03CE\u03C4\u03BF \u03C3\u03B7\u03BC\u03B5\u03AF\u03BF",continueLine:"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C3\u03C5\u03BD\u03B5\u03C7\u03AF\u03C3\u03B5\u03C4\u03B5 \u03BD\u03B1 \u03C3\u03C7\u03B5\u03B4\u03B9\u03AC\u03B6\u03B5\u03C4\u03B5",finishLine:"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03C3\u03B5 \u03BF\u03C0\u03BF\u03B9\u03BF\u03BD\u03B4\u03AE\u03C0\u03BF\u03C4\u03B5 \u03C5\u03C0\u03AC\u03C1\u03C7\u03BF\u03BD \u03C3\u03B7\u03BC\u03B5\u03AF\u03BF \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03BF\u03BB\u03BF\u03BA\u03BB\u03B7\u03C1\u03C9\u03B8\u03B5\u03AF",finishPoly:"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03C3\u03C4\u03BF \u03C0\u03C1\u03CE\u03C4\u03BF \u03C3\u03B7\u03BC\u03B5\u03AF\u03BF \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03C3\u03B5\u03C4\u03B5",finishRect:"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03C3\u03B5\u03C4\u03B5",startCircle:"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C4\u03BF\u03C0\u03BF\u03B8\u03B5\u03C4\u03AE\u03C3\u03B5\u03C4\u03B5 \u03BA\u03AD\u03BD\u03C4\u03C1\u03BF \u039A\u03CD\u03BA\u03BB\u03BF\u03C5",finishCircle:"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03BF\u03BB\u03BF\u03BA\u03BB\u03B7\u03C1\u03CE\u03C3\u03B5\u03C4\u03B5 \u03C4\u03BF\u03BD \u039A\u03CD\u03BA\u03BB\u03BF",placeCircleMarker:"\u039A\u03AC\u03BD\u03C4\u03B5 \u03BA\u03BB\u03B9\u03BA \u03B3\u03B9\u03B1 \u03BD\u03B1 \u03C4\u03BF\u03C0\u03BF\u03B8\u03B5\u03C4\u03AE\u03C3\u03B5\u03C4\u03B5 \u039A\u03C5\u03BA\u03BB\u03B9\u03BA\u03CC \u0394\u03B5\u03AF\u03BA\u03C4\u03B7"},actions:{finish:"\u03A4\u03AD\u03BB\u03BF\u03C2",cancel:"\u0391\u03BA\u03CD\u03C1\u03C9\u03C3\u03B7",removeLastVertex:"\u039A\u03B1\u03C4\u03AC\u03C1\u03B3\u03B7\u03C3\u03B7 \u03C4\u03B5\u03BB\u03B5\u03C5\u03C4\u03B1\u03AF\u03BF\u03C5 \u03C3\u03B7\u03BC\u03B5\u03AF\u03BF\u03C5"},buttonTitles:{drawMarkerButton:"\u03A3\u03C7\u03B5\u03B4\u03AF\u03B1\u03C3\u03B7 \u0394\u03B5\u03AF\u03BA\u03C4\u03B7",drawPolyButton:"\u03A3\u03C7\u03B5\u03B4\u03AF\u03B1\u03C3\u03B7 \u03A0\u03BF\u03BB\u03C5\u03B3\u03CE\u03BD\u03BF\u03C5",drawLineButton:"\u03A3\u03C7\u03B5\u03B4\u03AF\u03B1\u03C3\u03B7 \u0393\u03C1\u03B1\u03BC\u03BC\u03AE\u03C2",drawCircleButton:"\u03A3\u03C7\u03B5\u03B4\u03AF\u03B1\u03C3\u03B7 \u039A\u03CD\u03BA\u03BB\u03BF\u03C5",drawRectButton:"\u03A3\u03C7\u03B5\u03B4\u03AF\u03B1\u03C3\u03B7 \u039F\u03C1\u03B8\u03BF\u03B3\u03C9\u03BD\u03AF\u03BF\u03C5",editButton:"\u0395\u03C0\u03B5\u03BE\u03B5\u03C1\u03B3\u03B1\u03C3\u03AF\u03B1 \u0395\u03C0\u03B9\u03C0\u03AD\u03B4\u03C9\u03BD",dragButton:"\u039C\u03B5\u03C4\u03B1\u03C6\u03BF\u03C1\u03AC \u0395\u03C0\u03B9\u03C0\u03AD\u03B4\u03C9\u03BD",cutButton:"\u0391\u03C0\u03BF\u03BA\u03BF\u03C0\u03AE \u0395\u03C0\u03B9\u03C0\u03AD\u03B4\u03C9\u03BD",deleteButton:"\u039A\u03B1\u03C4\u03AC\u03C1\u03B3\u03B7\u03C3\u03B7 \u0395\u03C0\u03B9\u03C0\u03AD\u03B4\u03C9\u03BD",drawCircleMarkerButton:"\u03A3\u03C7\u03B5\u03B4\u03AF\u03B1\u03C3\u03B7 \u039A\u03C5\u03BA\u03BB\u03B9\u03BA\u03BF\u03CD \u0394\u03B5\u03AF\u03BA\u03C4\u03B7",snappingButton:"\u03A0\u03C1\u03BF\u03C3\u03BA\u03CC\u03BB\u03BB\u03B7\u03C3\u03B7 \u03C4\u03BF\u03C5 \u0394\u03B5\u03AF\u03BA\u03C4\u03B7 \u03BC\u03B5\u03C4\u03B1\u03C6\u03BF\u03C1\u03AC\u03C2 \u03C3\u03B5 \u03AC\u03BB\u03BB\u03B1 \u0395\u03C0\u03AF\u03C0\u03B5\u03B4\u03B1 \u03BA\u03B1\u03B9 \u039A\u03BF\u03C1\u03C5\u03C6\u03AD\u03C2",pinningButton:"\u03A0\u03B5\u03C1\u03B9\u03BA\u03BF\u03C0\u03AE \u03BA\u03BF\u03B9\u03BD\u03CE\u03BD \u03BA\u03BF\u03C1\u03C5\u03C6\u03CE\u03BD \u03BC\u03B1\u03B6\u03AF",rotateButton:"\u03A0\u03B5\u03C1\u03B9\u03C3\u03C4\u03C1\u03AD\u03C8\u03C4\u03B5 \u03C4\u03BF \u03C3\u03C4\u03C1\u03CE\u03BC\u03B1"}};var Ho={tooltips:{placeMarker:"Kattintson a jel\xF6l\u0151 elhelyez\xE9s\xE9hez",placeMarkerTouch:"\xC9rintse meg a t\xE9rk\xE9pet a jel\xF6l\u0151 elhelyez\xE9s\xE9hez",firstVertex:"Kattintson az els\u0151 pont elhelyez\xE9s\xE9hez",continueLine:"Kattintson a k\xF6vetkez\u0151 pont elhelyez\xE9s\xE9hez",finishLine:"A befejez\xE9shez kattintson egy megl\xE9v\u0151 pontra",finishPoly:"A befejez\xE9shez kattintson az els\u0151 pontra",finishRect:"Kattintson a befejez\xE9shez",startCircle:"Kattintson a k\xF6r k\xF6z\xE9ppontj\xE1nak elhelyez\xE9s\xE9hez",finishCircle:"Kattintson a k\xF6r befejez\xE9s\xE9hez",placeCircleMarker:"Kattintson a k\xF6rjel\xF6l\u0151 elhelyez\xE9s\xE9hez"},actions:{finish:"Befejez\xE9s",cancel:"M\xE9gse",removeLastVertex:"Utols\xF3 pont elt\xE1vol\xEDt\xE1sa"},buttonTitles:{drawMarkerButton:"Jel\xF6l\u0151 rajzol\xE1sa",drawPolyButton:"Poligon rajzol\xE1sa",drawLineButton:"Vonal rajzol\xE1sa",drawCircleButton:"K\xF6r rajzol\xE1sa",drawRectButton:"N\xE9gyzet rajzol\xE1sa",editButton:"Elemek szerkeszt\xE9se",dragButton:"Elemek mozgat\xE1sa",cutButton:"Elemek v\xE1g\xE1sa",deleteButton:"Elemek t\xF6rl\xE9se",drawCircleMarkerButton:"K\xF6r jel\xF6l\u0151 rajzol\xE1sa",snappingButton:"Kapcsolja a jel\xF6lt\u0151t m\xE1sik elemhez vagy ponthoz",pinningButton:"K\xF6z\xF6s pontok \xF6sszek\xF6t\xE9se",rotateButton:"F\xF3lia elforgat\xE1sa"}};var Jo={tooltips:{placeMarker:"Tryk for at placere en mark\xF8r",placeMarkerTouch:"Tryk p\xE5 kortet for at placere en mark\xF8r",firstVertex:"Tryk for at placere det f\xF8rste punkt",continueLine:"Tryk for at forts\xE6tte linjen",finishLine:"Tryk p\xE5 et eksisterende punkt for at afslutte",finishPoly:"Tryk p\xE5 det f\xF8rste punkt for at afslutte",finishRect:"Tryk for at afslutte",startCircle:"Tryk for at placere cirklens center",finishCircle:"Tryk for at afslutte cirklen",placeCircleMarker:"Tryk for at placere en cirkelmark\xF8r"},actions:{finish:"Afslut",cancel:"Afbryd",removeLastVertex:"Fjern sidste punkt"},buttonTitles:{drawMarkerButton:"Placer mark\xF8r",drawPolyButton:"Tegn polygon",drawLineButton:"Tegn linje",drawCircleButton:"Tegn cirkel",drawRectButton:"Tegn firkant",editButton:"Rediger",dragButton:"Tr\xE6k",cutButton:"Klip",deleteButton:"Fjern",drawCircleMarkerButton:"Tegn cirkelmark\xF8r",snappingButton:"Fastg\xF8r trukket mark\xF8r til andre elementer",pinningButton:"Sammenl\xE6g delte elementer",rotateButton:"Roter laget"}};var Xo={tooltips:{placeMarker:"Klikk for \xE5 plassere punkt",placeMarkerTouch:"Trykk p\xE5 kartet for \xE5 plassere et punkt",firstVertex:"Klikk for \xE5 plassere f\xF8rste punkt",continueLine:"Klikk for \xE5 tegne videre",finishLine:"Klikk p\xE5 et eksisterende punkt for \xE5 fullf\xF8re",finishPoly:"Klikk f\xF8rste punkt for \xE5 fullf\xF8re",finishRect:"Klikk for \xE5 fullf\xF8re",startCircle:"Klikk for \xE5 sette sirkel midtpunkt",finishCircle:"Klikk for \xE5 fullf\xF8re sirkel",placeCircleMarker:"Klikk for \xE5 plassere sirkel",placeText:"Klikk for \xE5 plassere tekst"},actions:{finish:"Fullf\xF8r",cancel:"Kanseller",removeLastVertex:"Fjern forrige punkt"},buttonTitles:{drawMarkerButton:"Tegn punkt",drawPolyButton:"Tegn flate",drawLineButton:"Tegn linje",drawCircleButton:"Tegn sirkel",drawRectButton:"Tegn rektangel",editButton:"Rediger objekter",dragButton:"Dra objekter",cutButton:"Kutt objekter",deleteButton:"Fjern objekter",drawCircleMarkerButton:"Tegn sirkel-punkt",snappingButton:"Fest dratt punkt til andre objekter og punkt",pinningButton:"Pin delte punkter sammen",rotateButton:"Rot\xE9r objekter",drawTextButton:"Tegn tekst",scaleButton:"Skal\xE9r objekter",autoTracingButton:"Automatisk sporing av linje"},measurements:{totalLength:"Lengde",segmentLength:"Segmentlengde",area:"Omr\xE5de",radius:"Radius",perimeter:"Omriss",height:"H\xF8yde",width:"Bredde",coordinates:"Posisjon",coordinatesMarker:"Posisjonsmark\xF8r"}};var Yo={tooltips:{placeMarker:"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u062C\u0627\u0646\u0645\u0627\u06CC\u06CC \u0646\u0634\u0627\u0646",placeMarkerTouch:"\u0631\u0648\u06CC \u0646\u0642\u0634\u0647 \u0636\u0631\u0628\u0647 \u0628\u0632\u0646\u06CC\u062F \u062A\u0627 \u0646\u0634\u0627\u0646 \u0628\u06AF\u0630\u0627\u0631\u06CC\u062F",firstVertex:"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u0631\u0633\u0645 \u0627\u0648\u0644\u06CC\u0646 \u0631\u0623\u0633",continueLine:"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u0627\u062F\u0627\u0645\u0647 \u0631\u0633\u0645",finishLine:"\u06A9\u0644\u06CC\u06A9 \u0631\u0648\u06CC \u0647\u0631 \u0646\u0634\u0627\u0646 \u0645\u0648\u062C\u0648\u062F \u0628\u0631\u0627\u06CC \u067E\u0627\u06CC\u0627\u0646",finishPoly:"\u06A9\u0644\u06CC\u06A9 \u0631\u0648\u06CC \u0627\u0648\u0644\u06CC\u0646 \u0646\u0634\u0627\u0646 \u0628\u0631\u0627\u06CC \u067E\u0627\u06CC\u0627\u0646",finishRect:"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u067E\u0627\u06CC\u0627\u0646",startCircle:"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u0631\u0633\u0645 \u0645\u0631\u06A9\u0632 \u062F\u0627\u06CC\u0631\u0647",finishCircle:"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u067E\u0627\u06CC\u0627\u0646 \u0631\u0633\u0645 \u062F\u0627\u06CC\u0631\u0647",placeCircleMarker:"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u0631\u0633\u0645 \u0646\u0634\u0627\u0646 \u062F\u0627\u06CC\u0631\u0647",placeText:"\u06A9\u0644\u06CC\u06A9 \u0628\u0631\u0627\u06CC \u0646\u0648\u0634\u062A\u0646 \u0645\u062A\u0646"},actions:{finish:"\u067E\u0627\u06CC\u0627\u0646",cancel:"\u0644\u0641\u0648",removeLastVertex:"\u062D\u0630\u0641 \u0622\u062E\u0631\u06CC\u0646 \u0631\u0623\u0633"},buttonTitles:{drawMarkerButton:"\u062F\u0631\u062C \u0646\u0634\u0627\u0646",drawPolyButton:"\u0631\u0633\u0645 \u0686\u0646\u062F\u0636\u0644\u0639\u06CC",drawLineButton:"\u0631\u0633\u0645 \u062E\u0637",drawCircleButton:"\u0631\u0633\u0645 \u062F\u0627\u06CC\u0631\u0647",drawRectButton:"\u0631\u0633\u0645 \u0686\u0647\u0627\u0631\u0636\u0644\u0639\u06CC",editButton:"\u0648\u06CC\u0631\u0627\u06CC\u0634 \u0644\u0627\u06CC\u0647\u200C\u0647\u0627",dragButton:"\u062C\u0627\u0628\u062C\u0627\u06CC\u06CC \u0644\u0627\u06CC\u0647\u200C\u0647\u0627",cutButton:"\u0628\u0631\u0634 \u0644\u0627\u06CC\u0647\u200C\u0647\u0627",deleteButton:"\u062D\u0630\u0641 \u0644\u0627\u06CC\u0647\u200C\u0647\u0627",drawCircleMarkerButton:"\u0631\u0633\u0645 \u0646\u0634\u0627\u0646 \u062F\u0627\u06CC\u0631\u0647",snappingButton:"\u0646\u0634\u0627\u0646\u06AF\u0631 \u0631\u0627 \u0628\u0647 \u0644\u0627\u06CC\u0647\u200C\u0647\u0627 \u0648 \u0631\u0626\u0648\u0633 \u062F\u06CC\u06AF\u0631 \u0628\u06A9\u0634\u06CC\u062F",pinningButton:"\u0631\u0626\u0648\u0633 \u0645\u0634\u062A\u0631\u06A9 \u0631\u0627 \u0628\u0627 \u0647\u0645 \u067E\u06CC\u0646 \u06A9\u0646\u06CC\u062F",rotateButton:"\u0686\u0631\u062E\u0634 \u0644\u0627\u06CC\u0647",drawTextButton:"\u0631\u0633\u0645 \u0645\u062A\u0646",scaleButton:"\u0645\u0642\u06CC\u0627\u0633\u200C\u06AF\u0630\u0627\u0631\u06CC",autoTracingButton:"\u0631\u062F\u06CC\u0627\u0628 \u062E\u0648\u062F\u06A9\u0627\u0631"},measurements:{totalLength:"\u0637\u0648\u0644",segmentLength:"\u0637\u0648\u0644 \u0628\u062E\u0634",area:"\u0646\u0627\u062D\u06CC\u0647",radius:"\u0634\u0639\u0627\u0639",perimeter:"\u0645\u062D\u06CC\u0637",height:"\u0627\u0631\u062A\u0641\u0627\u0639",width:"\u0639\u0631\u0636",coordinates:"\u0645\u0648\u0642\u0639\u06CC\u062A",coordinatesMarker:"\u0645\u0648\u0642\u0639\u06CC\u062A \u0646\u0634\u0627\u0646"}};var $o={tooltips:{placeMarker:"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u043D\u0430\u043D\u0435\u0441\u0442\u0438 \u043C\u0430\u0440\u043A\u0435\u0440",placeMarkerTouch:"\u0422\u043E\u0440\u043A\u043D\u0456\u0442\u044C\u0441\u044F \u043A\u0430\u0440\u0442\u0438, \u0449\u043E\u0431 \u0440\u043E\u0437\u043C\u0456\u0441\u0442\u0438\u0442\u0438 \u043C\u0430\u0440\u043A\u0435\u0440",firstVertex:"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u043D\u0430\u043D\u0435\u0441\u0442\u0438 \u043F\u0435\u0440\u0448\u0443 \u0432\u0435\u0440\u0448\u0438\u043D\u0443",continueLine:"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u043F\u0440\u043E\u0434\u043E\u0432\u0436\u0438\u0442\u0438 \u043C\u0430\u043B\u044E\u0432\u0430\u0442\u0438",finishLine:"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C \u0431\u0443\u0434\u044C-\u044F\u043A\u0438\u0439 \u0456\u0441\u043D\u0443\u044E\u0447\u0438\u0439 \u043C\u0430\u0440\u043A\u0435\u0440 \u0434\u043B\u044F \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D\u043D\u044F",finishPoly:"\u0412\u0438\u0431\u0435\u0440\u0456\u0442\u044C \u043F\u0435\u0440\u0448\u0438\u0439 \u043C\u0430\u0440\u043A\u0435\u0440, \u0449\u043E\u0431 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0438",finishRect:"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0438",startCircle:"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u0434\u043E\u0434\u0430\u0442\u0438 \u0446\u0435\u043D\u0442\u0440 \u043A\u043E\u043B\u0430",finishCircle:"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0438 \u043A\u043E\u043B\u043E",placeCircleMarker:"\u041D\u0430\u0442\u0438\u0441\u043D\u0456\u0442\u044C, \u0449\u043E\u0431 \u043D\u0430\u043D\u0435\u0441\u0442\u0438 \u043A\u0440\u0443\u0433\u043E\u0432\u0438\u0439 \u043C\u0430\u0440\u043A\u0435\u0440"},actions:{finish:"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0438",cancel:"\u0412\u0456\u0434\u043C\u0456\u043D\u0438\u0442\u0438",removeLastVertex:"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u043F\u043E\u043F\u0435\u0440\u0435\u0434\u043D\u044E \u0432\u0435\u0440\u0448\u0438\u043D\u0443"},buttonTitles:{drawMarkerButton:"\u041C\u0430\u043B\u044E\u0432\u0430\u0442\u0438 \u043C\u0430\u0440\u043A\u0435\u0440",drawPolyButton:"\u041C\u0430\u043B\u044E\u0432\u0430\u0442\u0438 \u043F\u043E\u043B\u0456\u0433\u043E\u043D",drawLineButton:"\u041C\u0430\u043B\u044E\u0432\u0430\u0442\u0438 \u043A\u0440\u0438\u0432\u0443",drawCircleButton:"\u041C\u0430\u043B\u044E\u0432\u0430\u0442\u0438 \u043A\u043E\u043B\u043E",drawRectButton:"\u041C\u0430\u043B\u044E\u0432\u0430\u0442\u0438 \u043F\u0440\u044F\u043C\u043E\u043A\u0443\u0442\u043D\u0438\u043A",editButton:"\u0420\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438 \u0448\u0430\u0440\u0438",dragButton:"\u041F\u0435\u0440\u0435\u043D\u0435\u0441\u0442\u0438 \u0448\u0430\u0440\u0438",cutButton:"\u0412\u0438\u0440\u0456\u0437\u0430\u0442\u0438 \u0448\u0430\u0440\u0438",deleteButton:"\u0412\u0438\u0434\u0430\u043B\u0438\u0442\u0438 \u0448\u0430\u0440\u0438",drawCircleMarkerButton:"\u041C\u0430\u043B\u044E\u0432\u0430\u0442\u0438 \u043A\u0440\u0443\u0433\u043E\u0432\u0438\u0439 \u043C\u0430\u0440\u043A\u0435\u0440",snappingButton:"\u041F\u0440\u0438\u0432\u2019\u044F\u0437\u0430\u0442\u0438 \u043F\u0435\u0440\u0435\u0442\u044F\u0433\u043D\u0443\u0442\u0438\u0439 \u043C\u0430\u0440\u043A\u0435\u0440 \u0434\u043E \u0456\u043D\u0448\u0438\u0445 \u0448\u0430\u0440\u0456\u0432 \u0442\u0430 \u0432\u0435\u0440\u0448\u0438\u043D",pinningButton:"\u0417\u0432'\u044F\u0437\u0430\u0442\u0438 \u0441\u043F\u0456\u043B\u044C\u043D\u0456 \u0432\u0435\u0440\u0448\u0438\u043D\u0438 \u0440\u0430\u0437\u043E\u043C",rotateButton:"\u041F\u043E\u0432\u0435\u0440\u043D\u0443\u0442\u0438 \u0448\u0430\u0440"}};var Zo={tooltips:{placeMarker:"\u0130\u015Faret\xE7i yerle\u015Ftirmek i\xE7in t\u0131klay\u0131n",placeMarkerTouch:"\u0130\u015Faret\xE7i yerle\u015Ftirmek i\xE7in haritaya dokunun",firstVertex:"\u0130lk tepe noktas\u0131n\u0131 yerle\u015Ftirmek i\xE7in t\u0131klay\u0131n",continueLine:"\xC7izime devam etmek i\xE7in t\u0131klay\u0131n",finishLine:"Bitirmek i\xE7in mevcut herhangi bir i\u015Faret\xE7iyi t\u0131klay\u0131n",finishPoly:"Bitirmek i\xE7in ilk i\u015Faret\xE7iyi t\u0131klay\u0131n",finishRect:"Bitirmek i\xE7in t\u0131klay\u0131n",startCircle:"Daire merkezine yerle\u015Ftirmek i\xE7in t\u0131klay\u0131n",finishCircle:"Daireyi bitirmek i\xE7in t\u0131klay\u0131n",placeCircleMarker:"Daire i\u015Faret\xE7isi yerle\u015Ftirmek i\xE7in t\u0131klay\u0131n"},actions:{finish:"Bitir",cancel:"\u0130ptal",removeLastVertex:"Son k\xF6\u015Feyi kald\u0131r"},buttonTitles:{drawMarkerButton:"\xC7izim \u0130\u015Faret\xE7isi",drawPolyButton:"\xC7okgenler \xE7iz",drawLineButton:"\xC7oklu \xE7izgi \xE7iz",drawCircleButton:"\xC7ember \xE7iz",drawRectButton:"Dikd\xF6rtgen \xE7iz",editButton:"Katmanlar\u0131 d\xFCzenle",dragButton:"Katmanlar\u0131 s\xFCr\xFCkle",cutButton:"Katmanlar\u0131 kes",deleteButton:"Katmanlar\u0131 kald\u0131r",drawCircleMarkerButton:"Daire i\u015Faret\xE7isi \xE7iz",snappingButton:"S\xFCr\xFCklenen i\u015Faret\xE7iyi di\u011Fer katmanlara ve k\xF6\u015Felere yap\u0131\u015Ft\u0131r",pinningButton:"Payla\u015F\u0131lan k\xF6\u015Feleri birbirine sabitle",rotateButton:"Katman\u0131 d\xF6nd\xFCr"}};var Wo={tooltips:{placeMarker:"Kliknut\xEDm vytvo\u0159\xEDte zna\u010Dku",placeMarkerTouch:"Klepnut\xEDm na mapu um\xEDst\xEDte zna\u010Dku",firstVertex:"Kliknut\xEDm vytvo\u0159\xEDte prvn\xED objekt",continueLine:"Kliknut\xEDm pokra\u010Dujte v kreslen\xED",finishLine:"Kliknut\xED na libovolnou existuj\xEDc\xED zna\u010Dku pro dokon\u010Den\xED",finishPoly:"Vyberte prvn\xED bod pro dokon\u010Den\xED",finishRect:"Klikn\u011Bte pro dokon\u010Den\xED",startCircle:"Kliknut\xEDm p\u0159idejte st\u0159ed kruhu",finishCircle:"\u041D\u0430\u0436\u043C\u0438\u0442\u0435, \u0447\u0442\u043E\u0431\u044B \u0437\u0430\u0434\u0430\u0442\u044C \u0440\u0430\u0434\u0438\u0443\u0441",placeCircleMarker:"Kliknut\xEDm nastavte polom\u011Br"},actions:{finish:"Dokon\u010Dit",cancel:"Zru\u0161it",removeLastVertex:"Zru\u0161it posledn\xED akci"},buttonTitles:{drawMarkerButton:"P\u0159idat zna\u010Dku",drawPolyButton:"Nakreslit polygon",drawLineButton:"Nakreslit k\u0159ivku",drawCircleButton:"Nakreslit kruh",drawRectButton:"Nakreslit obd\xE9ln\xEDk",editButton:"Upravit vrstvu",dragButton:"P\u0159eneste vrstvu",cutButton:"Vyjmout vrstvu",deleteButton:"Smazat vrstvu",drawCircleMarkerButton:"P\u0159idat kruhovou zna\u010Dku",snappingButton:"Nav\xE1zat ta\u017Enou zna\u010Dku k dal\u0161\xEDm vrstv\xE1m a vrchol\u016Fm",pinningButton:"Spojit spole\u010Dn\xE9 body dohromady",rotateButton:"Oto\u010Dte vrstvu"}};var Qo={tooltips:{placeMarker:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30DE\u30FC\u30AB\u30FC\u3092\u914D\u7F6E",placeMarkerTouch:"\u5730\u56F3\u3092\u30BF\u30C3\u30D7\u3057\u3066\u30DE\u30FC\u30AB\u30FC\u3092\u914D\u7F6E",firstVertex:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u6700\u521D\u306E\u9802\u70B9\u3092\u914D\u7F6E",continueLine:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u63CF\u753B\u3092\u7D9A\u3051\u308B",finishLine:"\u4EFB\u610F\u306E\u30DE\u30FC\u30AB\u30FC\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7D42\u4E86",finishPoly:"\u6700\u521D\u306E\u30DE\u30FC\u30AB\u30FC\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7D42\u4E86",finishRect:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7D42\u4E86",startCircle:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u5186\u306E\u4E2D\u5FC3\u3092\u914D\u7F6E",finishCircle:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u5186\u306E\u63CF\u753B\u3092\u7D42\u4E86",placeCircleMarker:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u5186\u30DE\u30FC\u30AB\u30FC\u3092\u914D\u7F6E",placeText:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30C6\u30AD\u30B9\u30C8\u3092\u914D\u7F6E"},actions:{finish:"\u7D42\u4E86",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",removeLastVertex:"\u6700\u5F8C\u306E\u9802\u70B9\u3092\u524A\u9664"},buttonTitles:{drawMarkerButton:"\u30DE\u30FC\u30AB\u30FC\u3092\u63CF\u753B",drawPolyButton:"\u30DD\u30EA\u30B4\u30F3\u3092\u63CF\u753B",drawLineButton:"\u6298\u308C\u7DDA\u3092\u63CF\u753B",drawCircleButton:"\u5186\u3092\u63CF\u753B",drawRectButton:"\u77E9\u5F62\u3092\u63CF\u753B",editButton:"\u30EC\u30A4\u30E4\u30FC\u3092\u7DE8\u96C6",dragButton:"\u30EC\u30A4\u30E4\u30FC\u3092\u30C9\u30E9\u30C3\u30B0",cutButton:"\u30EC\u30A4\u30E4\u30FC\u3092\u5207\u308A\u53D6\u308A",deleteButton:"\u30EC\u30A4\u30E4\u30FC\u3092\u524A\u9664",drawCircleMarkerButton:"\u5186\u30DE\u30FC\u30AB\u30FC\u3092\u63CF\u753B",snappingButton:"\u30C9\u30E9\u30C3\u30B0\u3057\u305F\u30DE\u30FC\u30AB\u30FC\u3092\u4ED6\u306E\u30EC\u30A4\u30E4\u30FC\u3084\u9802\u70B9\u306B\u30B9\u30CA\u30C3\u30D7\u3059\u308B",pinningButton:"\u5171\u6709\u3059\u308B\u9802\u70B9\u3092\u540C\u6642\u306B\u52D5\u304B\u3059",rotateButton:"\u30EC\u30A4\u30E4\u30FC\u3092\u56DE\u8EE2",drawTextButton:"\u30C6\u30AD\u30B9\u30C8\u3092\u63CF\u753B"}};var es={tooltips:{placeMarker:"Klikkaa asettaaksesi merkin",placeMarkerTouch:"Napauta karttaa asettaaksesi merkin",firstVertex:"Klikkaa asettaakseni ensimm\xE4isen osuuden",continueLine:"Klikkaa jatkaaksesi piirt\xE4mist\xE4",finishLine:"Klikkaa olemassa olevaa merkki\xE4 lopettaaksesi",finishPoly:"Klikkaa ensimm\xE4ist\xE4 merkki\xE4 lopettaaksesi",finishRect:"Klikkaa lopettaaksesi",startCircle:"Klikkaa asettaaksesi ympyr\xE4n keskipisteen",finishCircle:"Klikkaa lopettaaksesi ympyr\xE4n",placeCircleMarker:"Klikkaa asettaaksesi ympyr\xE4merkin",placeText:"Klikkaa asettaaksesi tekstin"},actions:{finish:"Valmis",cancel:"Peruuta",removeLastVertex:"Poista viimeinen osuus"},buttonTitles:{drawMarkerButton:"Piirr\xE4 merkkej\xE4",drawPolyButton:"Piirr\xE4 monikulmioita",drawLineButton:"Piirr\xE4 viivoja",drawCircleButton:"Piirr\xE4 ympyr\xE4",drawRectButton:"Piirr\xE4 neliskulmioita",editButton:"Muokkaa",dragButton:"Siirr\xE4",cutButton:"Leikkaa",deleteButton:"Poista",drawCircleMarkerButton:"Piirr\xE4 ympyr\xE4merkki",snappingButton:"Kiinnit\xE4 siirrett\xE4v\xE4 merkki toisiin muotoihin",pinningButton:"Kiinnit\xE4 jaetut muodot yhteen",rotateButton:"K\xE4\xE4nn\xE4",drawTextButton:"Piirr\xE4 teksti\xE4"}};var ts={tooltips:{placeMarker:"\uB9C8\uCEE4 \uC704\uCE58\uB97C \uD074\uB9AD\uD558\uC138\uC694",placeMarkerTouch:"\uC9C0\uB3C4\uB97C \uD0ED\uD558\uC5EC \uB9C8\uCEE4\uB97C \uBC30\uCE58\uD558\uC138\uC694",firstVertex:"\uCCAB\uBC88\uC9F8 \uAF2D\uC9C0\uC810 \uC704\uCE58\uC744 \uD074\uB9AD\uD558\uC138\uC694",continueLine:"\uACC4\uC18D \uADF8\uB9AC\uB824\uBA74 \uD074\uB9AD\uD558\uC138\uC694",finishLine:"\uB05D\uB0B4\uB824\uBA74 \uAE30\uC874 \uB9C8\uCEE4\uB97C \uD074\uB9AD\uD558\uC138\uC694",finishPoly:"\uB05D\uB0B4\uB824\uBA74 \uCC98\uC74C \uB9C8\uCEE4\uB97C \uD074\uB9AD\uD558\uC138\uC694",finishRect:"\uB05D\uB0B4\uB824\uBA74 \uD074\uB9AD\uD558\uC138\uC694",startCircle:"\uC6D0\uC758 \uC911\uC2EC\uC774 \uB420 \uC704\uCE58\uB97C \uD074\uB9AD\uD558\uC138\uC694",finishCircle:"\uC6D0\uC744 \uB05D\uB0B4\uB824\uBA74 \uD074\uB9AD\uD558\uC138\uC694",placeCircleMarker:"\uC6D0 \uB9C8\uCEE4 \uC704\uCE58\uB97C \uD074\uB9AD\uD558\uC138\uC694",placeText:"\uD14D\uC2A4\uD2B8 \uC704\uCE58\uB97C \uD074\uB9AD\uD558\uC138\uC694"},actions:{finish:"\uB05D\uB0B4\uAE30",cancel:"\uCDE8\uC18C",removeLastVertex:"\uB9C8\uC9C0\uB9C9 \uAF2D\uC9C0\uC810 \uC81C\uAC70"},buttonTitles:{drawMarkerButton:"\uB9C8\uCEE4 \uADF8\uB9AC\uAE30",drawPolyButton:"\uB2E4\uAC01\uD615 \uADF8\uB9AC\uAE30",drawLineButton:"\uB2E4\uAC01\uC120 \uADF8\uB9AC\uAE30",drawCircleButton:"\uC6D0 \uADF8\uB9AC\uAE30",drawRectButton:"\uC9C1\uC0AC\uAC01\uD615 \uADF8\uB9AC\uAE30",editButton:"\uB808\uC774\uC5B4 \uD3B8\uC9D1\uD558\uAE30",dragButton:"\uB808\uC774\uC5B4 \uB04C\uAE30",cutButton:"\uB808\uC774\uC5B4 \uC790\uB974\uAE30",deleteButton:"\uB808\uC774\uC5B4 \uC81C\uAC70\uD558\uAE30",drawCircleMarkerButton:"\uC6D0 \uB9C8\uCEE4 \uADF8\uB9AC\uAE30",snappingButton:"\uC7A1\uC544\uB048 \uB9C8\uCEE4\uB97C \uB2E4\uB978 \uB808\uC774\uC5B4 \uBC0F \uAF2D\uC9C0\uC810\uC5D0 \uB4E4\uB7EC\uBD99\uAC8C \uD558\uAE30",pinningButton:"\uACF5\uC720 \uAF2D\uC9C0\uC810\uC744 \uD568\uAED8 \uCC0D\uAE30",rotateButton:"\uB808\uC774\uC5B4 \uD68C\uC804\uD558\uAE30",drawTextButton:"\uD14D\uC2A4\uD2B8 \uADF8\uB9AC\uAE30"}};var rs={tooltips:{placeMarker:"\u041C\u0430\u0440\u043A\u0435\u0440\u0434\u0438 \u0436\u0430\u0439\u0433\u0430\u0448\u0442\u044B\u0440\u0443\u0443 \u04AF\u0447\u04AF\u043D \u0431\u0430\u0441\u044B\u04A3\u044B\u0437",placeMarkerTouch:"\u041C\u0430\u0440\u043A\u0435\u0440\u0434\u0438 \u0436\u0430\u0439\u0433\u0430\u0448\u0442\u044B\u0440\u0443\u0443 \u04AF\u0447\u04AF\u043D \u043A\u0430\u0440\u0442\u0430\u0433\u0430 \u0442\u0438\u0439\u0438\u04A3\u0438\u0437",firstVertex:"\u0411\u0438\u0440\u0438\u043D\u0447\u0438 \u0447\u043E\u043A\u0443\u043D\u0443 \u0436\u0430\u0439\u0433\u0430\u0448\u0442\u044B\u0440\u0443\u0443\u043D\u0443 \u04AF\u0447\u04AF\u043D \u0431\u0430\u0441\u044B\u04A3\u044B\u0437",continueLine:"\u0421\u04AF\u0440\u04E9\u0442 \u0442\u0430\u0440\u0442\u0443\u0443\u043D\u0443 \u0443\u043B\u0430\u043D\u0442\u0443\u0443 \u04AF\u0447\u04AF\u043D \u0431\u0430\u0441\u044B\u04A3\u044B\u0437",finishLine:"\u0410\u044F\u043A\u0442\u043E\u043E \u04AF\u0447\u04AF\u043D \u0443\u0447\u0443\u0440\u0434\u0430\u0433\u044B \u043C\u0430\u0440\u043A\u0435\u0440\u0434\u0438 \u0431\u0430\u0441\u044B\u04A3\u044B\u0437",finishPoly:"\u0411\u04AF\u0442\u04AF\u0440\u04AF\u04AF \u04AF\u0447\u04AF\u043D \u0431\u0438\u0440\u0438\u043D\u0447\u0438 \u043C\u0430\u0440\u043A\u0435\u0440\u0434\u0438 \u0431\u0430\u0441\u044B\u04A3\u044B\u0437",finishRect:"\u0411\u04AF\u0442\u04AF\u0440\u04AF\u04AF \u04AF\u0447\u04AF\u043D \u0431\u0430\u0441\u044B\u04A3\u044B\u0437",startCircle:"\u0410\u0439\u043B\u0430\u043D\u0430\u043D\u044B\u043D \u0431\u043E\u0440\u0431\u043E\u0440\u0443\u043D \u0436\u0430\u0439\u0433\u0430\u0448\u0442\u044B\u0440\u0443\u0443\u043D\u0443 \u04AF\u0447\u04AF\u043D \u0431\u0430\u0441\u044B\u04A3\u044B\u0437",finishCircle:"\u0410\u0439\u043B\u0430\u043D\u0430\u043D\u044B \u0431\u04AF\u0442\u04AF\u0440\u04AF\u04AF \u04AF\u0447\u04AF\u043D \u0431\u0430\u0441\u044B\u04A3\u044B\u0437",placeCircleMarker:"\u0422\u0435\u0433\u0435\u0440\u0435\u043A \u043C\u0430\u0440\u043A\u0435\u0440\u0434\u0438 \u0436\u0430\u0439\u0433\u0430\u0448\u0442\u044B\u0440\u0443\u0443 \u04AF\u0447\u04AF\u043D \u0431\u0430\u0441\u044B\u04A3\u044B\u0437",placeText:"\u0422\u0435\u043A\u0441\u0442\u0442\u0438 \u0436\u0430\u0439\u0433\u0430\u0448\u0442\u044B\u0440\u0443\u0443 \u04AF\u0447\u04AF\u043D \u0431\u0430\u0441\u044B\u04A3\u044B\u0437"},actions:{finish:"\u0410\u044F\u0433\u044B",cancel:"\u0416\u043E\u043A \u043A\u044B\u043B\u0443\u0443",removeLastVertex:"\u0410\u043A\u044B\u0440\u043A\u044B \u0447\u043E\u043A\u0443\u043D\u0443 \u04E9\u0447\u04AF\u0440\u04AF\u04AF"},buttonTitles:{drawMarkerButton:"\u041C\u0430\u0440\u043A\u0435\u0440\u0434\u0438 \u0447\u0438\u0437\u0443\u0443",drawPolyButton:"\u041F\u043E\u043B\u0438\u0433\u043E\u043D \u0447\u0438\u0437\u0443\u0443",drawLineButton:"\u041F\u043E\u043B\u0438\u043B\u0438\u043D\u0438\u044F \u0447\u0438\u0437\u0443\u0443",drawCircleButton:"\u0414\u0430\u0439\u044B\u043D\u0434\u044B \u0447\u0438\u0437\u0443\u0443",drawRectButton:"\u041F\u0440\u044F\u043C\u043E\u0443\u0433\u043E\u043B\u044C\u043D\u0438\u043A \u0447\u0438\u0437\u0443\u0443",editButton:"\u0421\u043B\u043E\u043E\u043F\u0442\u0443 \u0442\u04AF\u0437\u04E9\u0442\u04AF\u04AF",dragButton:"\u0421\u043B\u043E\u043E\u043F\u0442\u0443 \u043A\u0430\u0440\u0430\u043F \u0441\u04AF\u0439\u043B\u04E9\u04AF",cutButton:"\u0421\u043B\u043E\u043E\u043F\u0442\u0443\u043D \u0431\u0430\u0448\u044B\u043D \u043A\u0435\u0441\u04AF\u04AF",deleteButton:"\u0421\u043B\u043E\u043E\u043F\u0442\u0443\u043D \u04E9\u0447\u04AF\u0440\u04AF\u04AF",drawCircleMarkerButton:"\u0414\u0430\u0439\u044B\u043D\u0434\u044B \u043C\u0430\u0440\u043A\u0435\u0440\u0434\u0438 \u0447\u0438\u0437\u0443\u0443",snappingButton:"\u0411\u0430\u0448\u043A\u0430 \u0441\u043B\u043E\u043E\u043F\u0442\u043E\u0440\u0434\u0443\u043D \u0436\u0430\u043D\u0430 \u0432\u0435\u0440\u0442\u0435\u043A\u0441\u0442\u0435\u0440\u0434\u0438\u043D \u0430\u0440\u0430\u0441\u044B\u043D\u0430 \u0447\u0435\u043A\u0438\u043B\u0434\u04E9\u04E9",pinningButton:"\u0411\u04E9\u043B\u04AF\u0448\u043A\u04E9\u043D \u0432\u0435\u0440\u0442\u0435\u043A\u0441\u0442\u0435\u0440\u0434\u0438 \u0431\u0438\u0440\u0433\u0435 \u0442\u0443\u0442\u0443\u0448\u0442\u0443\u0440\u0443\u0443",rotateButton:"\u0421\u043B\u043E\u043E\u043F\u0442\u0443\u043D \u04E9\u0437\u0433\u04E9\u0440\u0442\u04AF\u04AF",drawTextButton:"\u0422\u0435\u043A\u0441\u0442 \u0447\u0438\u0437\u0443\u0443",scaleButton:"\u0421\u043B\u043E\u043E\u043F\u0442\u0443\u043D \u04E9\u043B\u0447\u04E9\u043C\u04AF\u043D \u04E9\u0437\u0433\u04E9\u0440\u0442\u04AF\u04AF",autoTracingButton:"\u0410\u0432\u0442\u043E\u043C\u0430\u0442\u0442\u044B\u043A \u0442\u0438\u0437\u043C\u0435\u0433\u0438 \u0447\u0438\u0437\u0443\u0443"},measurements:{totalLength:"\u0423\u0437\u0443\u043D\u0434\u0443\u043A",segmentLength:"\u0421\u0435\u0433\u043C\u0435\u043D\u0442 \u0443\u0437\u0443\u043D\u0434\u0443\u0433\u0443",area:"\u0410\u0439\u043C\u0430\u043A",radius:"\u0420\u0430\u0434\u0438\u0443\u0441",perimeter:"\u041F\u0435\u0440\u0438\u043C\u0435\u0442\u0440",height:"\u0414\u0438\u0430\u043C\u0435\u0442\u0440",width:"\u041A\u0435\u043D\u0447\u0438\u043B\u0438\u043A",coordinates:"\u041A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u0442\u0430\u0440",coordinatesMarker:"\u041C\u0430\u0440\u043A\u0435\u0440\u0434\u0438\u043D \u043A\u043E\u043E\u0440\u0434\u0438\u043D\u0430\u0442\u0442\u0430\u0440\u044B"}};var ug=wr,Se={en:Do,de:So,it:Oo,id:Ro,ro:Bo,ru:Go,es:Ao,nl:No,fr:Fo,pt:ug,pt_br:Vo,pt_pt:wr,zh:qo,zh_tw:jo,pl:Uo,sv:Ko,el:zo,hu:Ho,da:Jo,no:Xo,fa:Yo,ua:$o,tr:Zo,cz:Wo,ja:Qo,fi:es,ko:ts,ky:rs};var fg={_globalEditModeEnabled:!1,enableGlobalEditMode(e){let t={...e};this._globalEditModeEnabled=!0,this.Toolbar.toggleButton("editMode",this.globalEditModeEnabled()),L.PM.Utils.findLayers(this.map).forEach(n=>{this._isRelevantForEdit(n)&&n.pm.enable(t)}),this.throttledReInitEdit||(this.throttledReInitEdit=L.Util.throttle(this.handleLayerAdditionInGlobalEditMode,100,this)),this._addedLayersEdit={},this.map.on("layeradd",this._layerAddedEdit,this),this.map.on("layeradd",this.throttledReInitEdit,this),this._fireGlobalEditModeToggled(!0)},disableGlobalEditMode(){this._globalEditModeEnabled=!1,L.PM.Utils.findLayers(this.map).forEach(t=>{t.pm.disable()}),this.map.off("layeradd",this._layerAddedEdit,this),this.map.off("layeradd",this.throttledReInitEdit,this),this.Toolbar.toggleButton("editMode",this.globalEditModeEnabled()),this._fireGlobalEditModeToggled(!1)},globalEditEnabled(){return this.globalEditModeEnabled()},globalEditModeEnabled(){return this._globalEditModeEnabled},toggleGlobalEditMode(e=this.globalOptions){this.globalEditModeEnabled()?this.disableGlobalEditMode():this.enableGlobalEditMode(e)},handleLayerAdditionInGlobalEditMode(){let e=this._addedLayersEdit;if(this._addedLayersEdit={},this.globalEditModeEnabled())for(let t in e){let r=e[t];this._isRelevantForEdit(r)&&r.pm.enable({...this.globalOptions})}},_layerAddedEdit({layer:e}){this._addedLayersEdit[L.stamp(e)]=e},_isRelevantForEdit(e){return e.pm&&!(e instanceof L.LayerGroup)&&(!L.PM.optIn&&!e.options.pmIgnore||L.PM.optIn&&e.options.pmIgnore===!1)&&!e._pmTempLayer&&e.pm.options.allowEditing}},ns=fg;var gg={_globalDragModeEnabled:!1,enableGlobalDragMode(){let e=L.PM.Utils.findLayers(this.map);this._globalDragModeEnabled=!0,this._addedLayersDrag={},e.forEach(t=>{this._isRelevantForDrag(t)&&t.pm.enableLayerDrag()}),this.throttledReInitDrag||(this.throttledReInitDrag=L.Util.throttle(this.reinitGlobalDragMode,100,this)),this.map.on("layeradd",this._layerAddedDrag,this),this.map.on("layeradd",this.throttledReInitDrag,this),this.Toolbar.toggleButton("dragMode",this.globalDragModeEnabled()),this._fireGlobalDragModeToggled(!0)},disableGlobalDragMode(){let e=L.PM.Utils.findLayers(this.map);this._globalDragModeEnabled=!1,e.forEach(t=>{t.pm.disableLayerDrag()}),this.map.off("layeradd",this._layerAddedDrag,this),this.map.off("layeradd",this.throttledReInitDrag,this),this.Toolbar.toggleButton("dragMode",this.globalDragModeEnabled()),this._fireGlobalDragModeToggled(!1)},globalDragModeEnabled(){return!!this._globalDragModeEnabled},toggleGlobalDragMode(){this.globalDragModeEnabled()?this.disableGlobalDragMode():this.enableGlobalDragMode()},reinitGlobalDragMode(){let e=this._addedLayersDrag;if(this._addedLayersDrag={},this.globalDragModeEnabled())for(let t in e){let r=e[t];this._isRelevantForDrag(r)&&r.pm.enableLayerDrag()}},_layerAddedDrag({layer:e}){this._addedLayersDrag[L.stamp(e)]=e},_isRelevantForDrag(e){return e.pm&&!(e instanceof L.LayerGroup)&&(!L.PM.optIn&&!e.options.pmIgnore||L.PM.optIn&&e.options.pmIgnore===!1)&&!e._pmTempLayer&&e.pm.options.draggable}},is=gg;var mg={_globalRemovalModeEnabled:!1,enableGlobalRemovalMode(){this._globalRemovalModeEnabled=!0,this.map.eachLayer(e=>{this._isRelevantForRemoval(e)&&(e.pm.enabled()&&e.pm.disable(),e.on("click",this.removeLayer,this))}),this.throttledReInitRemoval||(this.throttledReInitRemoval=L.Util.throttle(this.handleLayerAdditionInGlobalRemovalMode,100,this)),this._addedLayersRemoval={},this.map.on("layeradd",this._layerAddedRemoval,this),this.map.on("layeradd",this.throttledReInitRemoval,this),this.Toolbar.toggleButton("removalMode",this.globalRemovalModeEnabled()),this._fireGlobalRemovalModeToggled(!0)},disableGlobalRemovalMode(){this._globalRemovalModeEnabled=!1,this.map.eachLayer(e=>{e.off("click",this.removeLayer,this)}),this.map.off("layeradd",this._layerAddedRemoval,this),this.map.off("layeradd",this.throttledReInitRemoval,this),this.Toolbar.toggleButton("removalMode",this.globalRemovalModeEnabled()),this._fireGlobalRemovalModeToggled(!1)},globalRemovalEnabled(){return this.globalRemovalModeEnabled()},globalRemovalModeEnabled(){return!!this._globalRemovalModeEnabled},toggleGlobalRemovalMode(){this.globalRemovalModeEnabled()?this.disableGlobalRemovalMode():this.enableGlobalRemovalMode()},removeLayer(e){let t=e.target;this._isRelevantForRemoval(t)&&!t.pm.dragging()&&(t.removeFrom(this.map.pm._getContainingLayer()),t.remove(),t instanceof L.LayerGroup?(this._fireRemoveLayerGroup(t),this._fireRemoveLayerGroup(this.map,t)):(t.pm._fireRemove(t),t.pm._fireRemove(this.map,t)))},_isRelevantForRemoval(e){return e.pm&&!(e instanceof L.LayerGroup)&&(!L.PM.optIn&&!e.options.pmIgnore||L.PM.optIn&&e.options.pmIgnore===!1)&&!e._pmTempLayer&&e.pm.options.allowRemoval},handleLayerAdditionInGlobalRemovalMode(){let e=this._addedLayersRemoval;if(this._addedLayersRemoval={},this.globalRemovalModeEnabled())for(let t in e){let r=e[t];this._isRelevantForRemoval(r)&&(r.pm.enabled()&&r.pm.disable(),r.on("click",this.removeLayer,this))}},_layerAddedRemoval({layer:e}){this._addedLayersRemoval[L.stamp(e)]=e}},as=mg;var Lg={_globalRotateModeEnabled:!1,enableGlobalRotateMode(){this._globalRotateModeEnabled=!0,L.PM.Utils.findLayers(this.map).filter(t=>t instanceof L.Polyline).forEach(t=>{this._isRelevantForRotate(t)&&t.pm.enableRotate()}),this.throttledReInitRotate||(this.throttledReInitRotate=L.Util.throttle(this.handleLayerAdditionInGlobalRotateMode,100,this)),this._addedLayersRotate={},this.map.on("layeradd",this._layerAddedRotate,this),this.map.on("layeradd",this.throttledReInitRotate,this),this.Toolbar.toggleButton("rotateMode",this.globalRotateModeEnabled()),this._fireGlobalRotateModeToggled()},disableGlobalRotateMode(){this._globalRotateModeEnabled=!1,L.PM.Utils.findLayers(this.map).filter(t=>t instanceof L.Polyline).forEach(t=>{t.pm.disableRotate()}),this.map.off("layeradd",this._layerAddedRotate,this),this.map.off("layeradd",this.throttledReInitRotate,this),this.Toolbar.toggleButton("rotateMode",this.globalRotateModeEnabled()),this._fireGlobalRotateModeToggled()},globalRotateModeEnabled(){return!!this._globalRotateModeEnabled},toggleGlobalRotateMode(){this.globalRotateModeEnabled()?this.disableGlobalRotateMode():this.enableGlobalRotateMode()},_isRelevantForRotate(e){return e.pm&&e instanceof L.Polyline&&!(e instanceof L.LayerGroup)&&(!L.PM.optIn&&!e.options.pmIgnore||L.PM.optIn&&e.options.pmIgnore===!1)&&!e._pmTempLayer&&e.pm.options.allowRotation},handleLayerAdditionInGlobalRotateMode(){let e=this._addedLayersRotate;if(this._addedLayersRotate={},this.globalRotateModeEnabled())for(let t in e){let r=e[t];this._isRelevantForRotate(r)&&r.pm.enableRotate()}},_layerAddedRotate({layer:e}){this._addedLayersRotate[L.stamp(e)]=e}},os=Lg;var ss=Te(Ut()),_g={_fireDrawStart(e="Draw",t={}){this.__fire(this._map,"pm:drawstart",{shape:this._shape,workingLayer:this._layer},e,t)},_fireDrawEnd(e="Draw",t={}){this.__fire(this._map,"pm:drawend",{shape:this._shape},e,t)},_fireCreate(e,t="Draw",r={}){this.__fire(this._map,"pm:create",{shape:this._shape,marker:e,layer:e},t,r)},_fireCenterPlaced(e="Draw",t={}){let r=e==="Draw"?this._layer:void 0,n=e!=="Draw"?this._layer:void 0;this.__fire(this._layer,"pm:centerplaced",{shape:this._shape,workingLayer:r,layer:n,latlng:this._layer.getLatLng()},e,t)},_fireCut(e,t,r,n="Draw",i={}){this.__fire(e,"pm:cut",{shape:this._shape,layer:t,originalLayer:r},n,i)},_fireEdit(e=this._layer,t="Edit",r={}){this.__fire(e,"pm:edit",{layer:this._layer,shape:this.getShape()},t,r)},_fireEnable(e="Edit",t={}){this.__fire(this._layer,"pm:enable",{layer:this._layer,shape:this.getShape()},e,t)},_fireDisable(e="Edit",t={}){this.__fire(this._layer,"pm:disable",{layer:this._layer,shape:this.getShape()},e,t)},_fireUpdate(e="Edit",t={}){this.__fire(this._layer,"pm:update",{layer:this._layer,shape:this.getShape()},e,t)},_fireMarkerDragStart(e,t=void 0,r="Edit",n={}){this.__fire(this._layer,"pm:markerdragstart",{layer:this._layer,markerEvent:e,shape:this.getShape(),indexPath:t},r,n)},_fireMarkerDrag(e,t=void 0,r="Edit",n={}){this.__fire(this._layer,"pm:markerdrag",{layer:this._layer,markerEvent:e,shape:this.getShape(),indexPath:t},r,n)},_fireMarkerDragEnd(e,t=void 0,r=void 0,n="Edit",i={}){this.__fire(this._layer,"pm:markerdragend",{layer:this._layer,markerEvent:e,shape:this.getShape(),indexPath:t,intersectionReset:r},n,i)},_fireDragStart(e="Edit",t={}){this.__fire(this._layer,"pm:dragstart",{layer:this._layer,shape:this.getShape()},e,t)},_fireDrag(e,t="Edit",r={}){this.__fire(this._layer,"pm:drag",{...e,shape:this.getShape()},t,r)},_fireDragEnd(e="Edit",t={}){this.__fire(this._layer,"pm:dragend",{layer:this._layer,shape:this.getShape()},e,t)},_fireDragEnable(e="Edit",t={}){this.__fire(this._layer,"pm:dragenable",{layer:this._layer,shape:this.getShape()},e,t)},_fireDragDisable(e="Edit",t={}){this.__fire(this._layer,"pm:dragdisable",{layer:this._layer,shape:this.getShape()},e,t)},_fireRemove(e,t=e,r="Edit",n={}){this.__fire(e,"pm:remove",{layer:t,shape:this.getShape()},r,n)},_fireVertexAdded(e,t,r,n="Edit",i={}){this.__fire(this._layer,"pm:vertexadded",{layer:this._layer,workingLayer:this._layer,marker:e,indexPath:t,latlng:r,shape:this.getShape()},n,i)},_fireVertexRemoved(e,t,r="Edit",n={}){this.__fire(this._layer,"pm:vertexremoved",{layer:this._layer,marker:e,indexPath:t,shape:this.getShape()},r,n)},_fireVertexClick(e,t,r="Edit",n={}){this.__fire(this._layer,"pm:vertexclick",{layer:this._layer,markerEvent:e,indexPath:t,shape:this.getShape()},r,n)},_fireIntersect(e,t=this._layer,r="Edit",n={}){this.__fire(t,"pm:intersect",{layer:this._layer,intersection:e,shape:this.getShape()},r,n)},_fireLayerReset(e,t,r="Edit",n={}){this.__fire(this._layer,"pm:layerreset",{layer:this._layer,markerEvent:e,indexPath:t,shape:this.getShape()},r,n)},_fireChange(e,t="Edit",r={}){this.__fire(this._layer,"pm:change",{layer:this._layer,latlngs:e,shape:this.getShape()},t,r)},_fireTextChange(e,t="Edit",r={}){this.__fire(this._layer,"pm:textchange",{layer:this._layer,text:e,shape:this.getShape()},t,r)},_fireTextFocus(e="Edit",t={}){this.__fire(this._layer,"pm:textfocus",{layer:this._layer,shape:this.getShape()},e,t)},_fireTextBlur(e="Edit",t={}){this.__fire(this._layer,"pm:textblur",{layer:this._layer,shape:this.getShape()},e,t)},_fireSnapDrag(e,t,r="Snapping",n={}){this.__fire(e,"pm:snapdrag",t,r,n)},_fireSnap(e,t,r="Snapping",n={}){this.__fire(e,"pm:snap",t,r,n)},_fireUnsnap(e,t,r="Snapping",n={}){this.__fire(e,"pm:unsnap",t,r,n)},_fireRotationEnable(e,t,r="Rotation",n={}){this.__fire(e,"pm:rotateenable",{layer:this._layer,helpLayer:this._rotatePoly,shape:this.getShape()},r,n)},_fireRotationDisable(e,t="Rotation",r={}){this.__fire(e,"pm:rotatedisable",{layer:this._layer,shape:this.getShape()},t,r)},_fireRotationStart(e,t,r="Rotation",n={}){this.__fire(e,"pm:rotatestart",{layer:this._rotationLayer,helpLayer:this._layer,startAngle:this._startAngle,originLatLngs:t},r,n)},_fireRotation(e,t,r,n=this._rotationLayer,i="Rotation",a={}){this.__fire(e,"pm:rotate",{layer:n,helpLayer:this._layer,startAngle:this._startAngle,angle:n.pm.getAngle(),angleDiff:t,oldLatLngs:r,newLatLngs:n.getLatLngs()},i,a)},_fireRotationEnd(e,t,r,n="Rotation",i={}){this.__fire(e,"pm:rotateend",{layer:this._rotationLayer,helpLayer:this._layer,startAngle:t,angle:this._rotationLayer.pm.getAngle(),originLatLngs:r,newLatLngs:this._rotationLayer.getLatLngs()},n,i)},_fireActionClick(e,t,r,n="Toolbar",i={}){this.__fire(this._map,"pm:actionclick",{text:e.text,action:e,btnName:t,button:r},n,i)},_fireButtonClick(e,t,r="Toolbar",n={}){this.__fire(this._map,"pm:buttonclick",{btnName:e,button:t},r,n)},_fireLangChange(e,t,r,n,i="Global",a={}){this.__fire(this.map,"pm:langchange",{oldLang:e,activeLang:t,fallback:r,translations:n},i,a)},_fireGlobalDragModeToggled(e,t="Global",r={}){this.__fire(this.map,"pm:globaldragmodetoggled",{enabled:e,map:this.map},t,r)},_fireGlobalEditModeToggled(e,t="Global",r={}){this.__fire(this.map,"pm:globaleditmodetoggled",{enabled:e,map:this.map},t,r)},_fireGlobalRemovalModeToggled(e,t="Global",r={}){this.__fire(this.map,"pm:globalremovalmodetoggled",{enabled:e,map:this.map},t,r)},_fireGlobalCutModeToggled(e="Global",t={}){this.__fire(this._map,"pm:globalcutmodetoggled",{enabled:!!this._enabled,map:this._map},e,t)},_fireGlobalDrawModeToggled(e="Global",t={}){this.__fire(this._map,"pm:globaldrawmodetoggled",{enabled:this._enabled,shape:this._shape,map:this._map},e,t)},_fireGlobalRotateModeToggled(e="Global",t={}){this.__fire(this.map,"pm:globalrotatemodetoggled",{enabled:this.globalRotateModeEnabled(),map:this.map},e,t)},_fireRemoveLayerGroup(e,t=e,r="Edit",n={}){this.__fire(e,"pm:remove",{layer:t,shape:void 0},r,n)},_fireKeyeventEvent(e,t,r,n="Global",i={}){this.__fire(this.map,"pm:keyevent",{event:e,eventType:t,focusOn:r},n,i)},__fire(e,t,r,n,i={}){r=(0,ss.default)(r,i,{source:n}),L.PM.Utils._fireEvent(e,t,r)}},Oe=_g;var yg=()=>({_lastEvents:{keydown:void 0,keyup:void 0,current:void 0},_initKeyListener(e){this.map=e,L.DomEvent.on(document,"keydown keyup",this._onKeyListener,this),L.DomEvent.on(window,"blur",this._onBlur,this),e.once("unload",this._unbindKeyListenerEvents,this)},_handleEscapeKey(e){let t=this.map.pm;return!t.getGlobalOptions().exitModeOnEscape||!(t.globalDrawModeEnabled()||t.globalEditModeEnabled()||t.globalDragModeEnabled()||t.globalRemovalModeEnabled()||t.globalRotateModeEnabled()||t.globalCutModeEnabled())?!1:(e.preventDefault(),t.globalDrawModeEnabled()&&t.disableDraw(),t.globalEditModeEnabled()&&t.disableGlobalEditMode(),t.globalDragModeEnabled()&&t.disableGlobalDragMode(),t.globalRemovalModeEnabled()&&t.disableGlobalRemovalMode(),t.globalRotateModeEnabled()&&t.disableGlobalRotateMode(),t.globalCutModeEnabled()&&t.disableGlobalCutMode(),!0)},_handleEnterKey(e){let t=this.map.pm;return!t.getGlobalOptions().finishOnEnter||!t.Draw.getActiveShape()||!t.finishDraw()?!1:(e.preventDefault(),!0)},_canFinishShape(e,t){if(["Marker","CircleMarker","Text"].includes(t))return!1;if(t==="Rectangle")return e._startMarker!==void 0;if(t==="Circle")return e._centerMarker&&e._layerGroup?.hasLayer(e._centerMarker);if(e._layer&&e._layer.getLatLngs){let r=e._layer.getLatLngs();if(t==="Line")return(r.flat?r.flat():r).length>=2;if(t==="Polygon"||t==="Cut")return r.length>=3}return!1},_unbindKeyListenerEvents(){L.DomEvent.off(document,"keydown keyup",this._onKeyListener,this),L.DomEvent.off(window,"blur",this._onBlur,this)},_onKeyListener(e){let t="document";this.map.getContainer().contains(e.target)&&(t="map");let r={event:e,eventType:e.type,focusOn:t};this._lastEvents[e.type]=r,this._lastEvents.current=r,this.map.pm._fireKeyeventEvent(e,e.type,t),e.type==="keydown"&&(e.key==="Escape"&&this._handleEscapeKey(e),e.key==="Enter"&&this._handleEnterKey(e))},_onBlur(e){e.altKey=!1;let t={event:e,eventType:e.type,focusOn:"document"};this._lastEvents[e.type]=t,this._lastEvents.current=t},getLastKeyEvent(e="current"){return this._lastEvents[e]},isShiftKeyPressed(){return this._lastEvents.current?.event.shiftKey},isAltKeyPressed(){return this._lastEvents.current?.event.altKey},isCtrlKeyPressed(){return this._lastEvents.current?.event.ctrlKey},isMetaKeyPressed(){return this._lastEvents.current?.event.metaKey},getPressedKey(){return this._lastEvents.current?.event.key}}),ls=yg;var Cr=Te(vt());function V(e){let t=L.PM.activeLang;return(0,Cr.default)(Se[t],e)||(0,Cr.default)(Se.en,e)||e}function Gs(){return window.matchMedia?!window.matchMedia("(pointer: coarse)").matches:!0}function kt(e){for(let t=0;t<e.length;t+=1){let r=e[t];if(Array.isArray(r)){if(kt(r))return!0}else if(r!=null&&r!=="")return!0}return!1}function Et(e){return e.reduce((t,r)=>{if(r.length!==0){let n=Array.isArray(r)?Et(r):r;Array.isArray(n)?n.length!==0&&t.push(n):t.push(n)}return t},[])}function nm(e,t,r){let n={a:L.CRS.Earth.R,b:63567523142e-4,f:.0033528106647474805},{a:i,b:a,f:o}=n,s=e.lng,c=e.lat,l=r,f=Math.PI,d=t*f/180,g=Math.sin(d),M=Math.cos(d),I=(1-o)*Math.tan(c*f/180),T=1/Math.sqrt(1+I*I),m=I*T,y=Math.atan2(I,M),_=T*g,S=1-_*_,D=S*(i*i-a*a)/(a*a),O=1+D/16384*(4096+D*(-768+D*(320-175*D))),N=D/1024*(256+D*(-128+D*(74-47*D))),F=l/(a*O),h=2*Math.PI,p,u,v;for(;Math.abs(F-h)>1e-12;){p=Math.cos(2*y+F),u=Math.sin(F),v=Math.cos(F);let R=N*u*(p+N/4*(v*(-1+2*p*p)-N/6*p*(-3+4*u*u)*(-3+4*p*p)));h=F,F=l/(a*O)+R}let b=m*u-T*v*M,E=Math.atan2(m*v+T*u*M,(1-o)*Math.sqrt(_*_+b*b)),w=Math.atan2(u*g,T*v-m*u*M),k=o/16*S*(4+o*(4-3*S)),x=w-(1-k)*o*_*(F+k*u*(p+k*v*(-1+2*p*p))),C=s+x*180/f,P=E*180/f;return L.latLng(C,P)}function Ir(e,t,r,n,i=!0){let a,o,s,c=[];for(let l=0;l<r;l+=1){if(i)a=l*360/r+n,o=nm(e,a,t),s=L.latLng(o.lng,o.lat);else{let f=e.lat+Math.cos(2*l*Math.PI/r)*t,d=e.lng+Math.sin(2*l*Math.PI/r)*t;s=L.latLng(f,d)}c.push(s)}return c}function im(e,t,r){t=(t+360)%360;let n=Math.PI/180,i=180/Math.PI,{R:a}=L.CRS.Earth,o=e.lng*n,s=e.lat*n,c=t*n,l=Math.sin(s),f=Math.cos(s),d=Math.cos(r/a),g=Math.sin(r/a),M=Math.asin(l*d+f*g*Math.cos(c)),I=o+Math.atan2(Math.sin(c)*g*f,d-l*Math.sin(M));I*=i;let T=I-360,m=I<-180?I+360:I;return I=I>180?T:m,L.latLng([M*i,I])}function xt(e,t,r){let n=e.latLngToContainerPoint(t),i=e.latLngToContainerPoint(r),a=Math.atan2(i.y-n.y,i.x-n.x)*180/Math.PI+90;return a+=a<0?360:0,a}function it(e,t,r,n){let i=xt(e,t,r);return im(t,i,n)}function As(e,t,r="asc"){if(!t||Object.keys(t).length===0)return(c,l)=>c-l;let n=Object.keys(t),i,a=n.length-1,o={};for(;a>=0;)i=n[a],o[i.toLowerCase()]=t[i],a-=1;function s(c){if(c instanceof L.Marker)return"Marker";if(c instanceof L.Circle)return"Circle";if(c instanceof L.CircleMarker)return"CircleMarker";if(c instanceof L.Rectangle)return"Rectangle";if(c instanceof L.Polygon)return"Polygon";if(c instanceof L.Polyline)return"Line"}return(c,l)=>{let f,d;if(e==="instanceofShape"){if(f=s(c.layer).toLowerCase(),d=s(l.layer).toLowerCase(),!f||!d)return 0}else{if(!c.hasOwnProperty(e)||!l.hasOwnProperty(e))return 0;f=c[e].toLowerCase(),d=l[e].toLowerCase()}let g=f in o?o[f]:Number.MAX_SAFE_INTEGER,M=d in o?o[d]:Number.MAX_SAFE_INTEGER,I=0;return g<M?I=-1:g>M&&(I=1),r==="desc"?I*-1:I}}function Ee(e,t=e.getLatLngs()){return e instanceof L.Polygon?L.polygon(t).getLatLngs():L.polyline(t).getLatLngs()}function Tr(e,t){if(t.options.crs?.projection?.MAX_LATITUDE){let r=t.options.crs?.projection?.MAX_LATITUDE;e.lat=Math.max(Math.min(r,e.lat),-r)}return e}function Re(e){return e.options.renderer||e._map&&(e._map._getPaneRenderer(e.options.pane)||e._map.options.renderer||e._map._renderer)||e._renderer}function Ns(e,t){if(e=e.trim().toLowerCase(),t[e])return e;let n=e.replace(/[-_\s]/g,"_").match(/^([a-z]{2,3})(?:_([a-z]{2,3}))?$/);if(n){let i=[];n[2]&&i.push(`${n[1]}_${n[2]}`),i.push(n[1]);for(let a of i)if(t[a])return a}return e}var am=L.Class.extend({includes:[ns,is,as,os,Oe],initialize(e){this.map=e,this.Draw=new L.PM.Draw(e),this.Toolbar=new L.PM.Toolbar(e),this.Keyboard=ls(),this.globalOptions={snappable:!0,layerGroup:void 0,snappingOrder:["Marker","CircleMarker","Circle","Line","Polygon","Rectangle"],panes:{vertexPane:"markerPane",layerPane:"overlayPane",markerPane:"markerPane"},draggable:!0,exitModeOnEscape:!1,finishOnEnter:!1},this.Keyboard._initKeyListener(e)},setLang(e="en",t,r="en"){e=Ns(e,Se);let n=L.PM.activeLang;t&&(Se[e]=(0,Dr.default)(Se[r],t)),L.PM.activeLang=e,this.map.pm.Toolbar.reinit(),this._fireLangChange(n,e,r,Se[e])},addControls(e){this.Toolbar.addControls(e)},removeControls(){this.Toolbar.removeControls()},toggleControls(){this.Toolbar.toggleControls()},controlsVisible(){return this.Toolbar.isVisible},enableDraw(e="Polygon",t){e==="Poly"&&(e="Polygon"),this.Draw.enable(e,t)},disableDraw(e="Polygon"){e==="Poly"&&(e="Polygon"),this.Draw.disable(e)},finishDraw(){let e=this.Draw.getActiveShape();if(!e)return!1;let t=this.Draw[e];return!t?._finishShape||!this.Keyboard._canFinishShape(t,e)?!1:(t._finishShape(),!0)},setPathOptions(e,t={}){let r=t.ignoreShapes||[],n=t.merge||!1;this.map.pm.Draw.shapes.forEach(i=>{r.indexOf(i)===-1&&this.map.pm.Draw[i].setPathOptions(e,n)})},getGlobalOptions(){return this.globalOptions},setGlobalOptions(e){let t=(0,Dr.default)(this.globalOptions,e);t.editable&&(t.resizeableCircleMarker=t.editable,delete t.editable);let r=!1;this.map.pm.Draw.CircleMarker.enabled()&&!!this.map.pm.Draw.CircleMarker.options.resizeableCircleMarker!=!!t.resizeableCircleMarker&&(this.map.pm.Draw.CircleMarker.disable(),r=!0);let n=!1;this.map.pm.Draw.Circle.enabled()&&!!this.map.pm.Draw.Circle.options.resizeableCircle!=!!t.resizeableCircle&&(this.map.pm.Draw.Circle.disable(),n=!0),this.map.pm.Draw.shapes.forEach(a=>{this.map.pm.Draw[a].setOptions(t)}),r&&this.map.pm.Draw.CircleMarker.enable(),n&&this.map.pm.Draw.Circle.enable(),L.PM.Utils.findLayers(this.map).forEach(a=>{a.pm.setOptions(t)}),this.map.fire("pm:globaloptionschanged"),this.globalOptions=t,this.applyGlobalOptions()},applyGlobalOptions(){L.PM.Utils.findLayers(this.map).forEach(t=>{t.pm.enabled()&&t.pm.applyOptions()})},globalDrawModeEnabled(){return!!this.Draw.getActiveShape()},globalCutModeEnabled(){return!!this.Draw.Cut.enabled()},enableGlobalCutMode(e){return this.Draw.Cut.enable(e)},toggleGlobalCutMode(e){return this.Draw.Cut.toggle(e)},disableGlobalCutMode(){return this.Draw.Cut.disable()},getGeomanLayers(e=!1){let t=L.PM.Utils.findLayers(this.map);if(!e)return t;let r=L.featureGroup();return r._pmTempLayer=!0,t.forEach(n=>{r.addLayer(n)}),r},getGeomanDrawLayers(e=!1){let t=L.PM.Utils.findLayers(this.map).filter(n=>n._drawnByGeoman===!0);if(!e)return t;let r=L.featureGroup();return r._pmTempLayer=!0,t.forEach(n=>{r.addLayer(n)}),r},_getContainingLayer(){return this.globalOptions.layerGroup&&this.globalOptions.layerGroup instanceof L.LayerGroup?this.globalOptions.layerGroup:this.map},_isCRSSimple(){return this.map.options.crs===L.CRS.Simple},_touchEventCounter:0,_addTouchEvents(e){this._touchEventCounter===0&&(L.DomEvent.on(e,"touchmove",this._canvasTouchMove,this),L.DomEvent.on(e,"touchstart touchend touchcancel",this._canvasTouchClick,this)),this._touchEventCounter+=1},_removeTouchEvents(e){this._touchEventCounter===1&&(L.DomEvent.off(e,"touchmove",this._canvasTouchMove,this),L.DomEvent.off(e,"touchstart touchend touchcancel",this._canvasTouchClick,this)),this._touchEventCounter=this._touchEventCounter<=1?0:this._touchEventCounter-1},_canvasTouchMove(e){Re(this.map)._onMouseMove(this._createMouseEvent("mousemove",e))},_canvasTouchClick(e){let t="";e.type==="touchstart"||e.type==="pointerdown"?t="mousedown":(e.type==="touchend"||e.type==="pointerup"||e.type==="touchcancel"||e.type==="pointercancel")&&(t="mouseup"),t&&Re(this.map)._onClick(this._createMouseEvent(t,e))},_createMouseEvent(e,t){let r,n=t.touches[0]||t.changedTouches[0];try{r=new MouseEvent(e,{bubbles:t.bubbles,cancelable:t.cancelable,view:t.view,detail:n.detail,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey,metaKey:t.metaKey,button:t.button,relatedTarget:t.relatedTarget})}catch{r=document.createEvent("MouseEvents"),r.initMouseEvent(e,t.bubbles,t.cancelable,t.view,n.detail,n.screenX,n.screenY,n.clientX,n.clientY,t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget)}return r}}),Fs=am;var om=L.Control.extend({includes:[Oe],options:{position:"topleft",disableByOtherButtons:!0},initialize(e){this._button=L.Util.extend({},this.options,e)},onAdd(e){return this._map=e,this._map.pm.Toolbar.options.oneBlock?this._container=this._map.pm.Toolbar._createContainer(this.options.position):this._button.tool==="edit"?this._container=this._map.pm.Toolbar.editContainer:this._button.tool==="options"?this._container=this._map.pm.Toolbar.optionsContainer:this._button.tool==="custom"?this._container=this._map.pm.Toolbar.customContainer:this._container=this._map.pm.Toolbar.drawContainer,this._renderButton(),this._container},_renderButton(){let e=this.buttonsDomNode;this.buttonsDomNode=this._makeButton(this._button),e?e.replaceWith(this.buttonsDomNode):this._container.appendChild(this.buttonsDomNode)},onRemove(){return this.buttonsDomNode.remove(),this._container},getText(){return this._button.text},getIconUrl(){return this._button.iconUrl},destroy(){this._button={},this.buttonsDomNode?.remove()},toggle(e){return typeof e=="boolean"?this._button.toggleStatus=e:this._button.toggleStatus=!this._button.toggleStatus,this._applyStyleClasses(),this._updateActiveAction(this._button),this._button.toggleStatus},toggled(){return this._button.toggleStatus},onCreate(){this.toggle(!1)},disable(){this.toggle(!1),this._button.disabled=!0,this._updateDisabled()},enable(){this._button.disabled=!1,this._updateDisabled(),this._updateActiveAction(this._button)},_triggerClick(e){e&&e.preventDefault(),!this._button.disabled&&(this._button.onClick(e,{button:this,event:e}),this._clicked(e),this._button.afterClick(e,{button:this,event:e}))},_makeButton(e){let t=this.options.position.indexOf("right")>-1?"pos-right":"",r=L.DomUtil.create("div",`button-container ${t}`,this._container);e.title&&r.setAttribute("title",e.title);let n=L.DomUtil.create("a","leaflet-buttons-control-button",r);n.setAttribute("role","button"),n.setAttribute("tabindex","0"),n.href="#";let i=L.DomUtil.create("div",`leaflet-pm-actions-container ${t}`,r),a=e.actions,o={cancel:{text:V("actions.cancel"),title:V("actions.cancel"),onClick(){this._triggerClick()}},finishMode:{text:V("actions.finish"),title:V("actions.finish"),onClick(){this._triggerClick()}},removeLastVertex:{text:V("actions.removeLastVertex"),title:V("actions.removeLastVertex"),onClick(){this._map.pm.Draw[e.jsClass]._removeLastVertex()}},finish:{text:V("actions.finish"),title:V("actions.finish"),onClick(c){this._map.pm.Draw[e.jsClass]._finishShape(c)}}};e._preparedActions=a.map(c=>{let l=typeof c=="string"?c:c.name,f;if(o[l])f=o[l];else if(c.text)f=c;else return f;let d=L.DomUtil.create("a",`leaflet-pm-action ${t} action-${l}`,i);if(d.setAttribute("role","button"),d.setAttribute("tabindex","0"),d.href="#",f.title&&(d.title=f.title),d.innerHTML=f.text,L.DomEvent.disableClickPropagation(d),L.DomEvent.on(d,"click",L.DomEvent.stop),f._node=d,!e.disabled&&f.onClick){let g=M=>{M.preventDefault();let I="",{buttons:T}=this._map.pm.Toolbar;for(let m in T)if(T[m]._button===e){I=m;break}this._fireActionClick(f,I,e)};L.DomEvent.addListener(d,"click",g,this),L.DomEvent.addListener(d,"click",f.onClick,this),L.DomEvent.addListener(d,"click",()=>this._updateActiveAction(e))}return f}),this._updateActiveAction(e),e.toggleStatus&&L.DomUtil.addClass(r,"active");let s=L.DomUtil.create("div","control-icon",n);return e.iconUrl&&s.setAttribute("src",e.iconUrl),e.className&&L.DomUtil.addClass(s,e.className),L.DomEvent.disableClickPropagation(n),L.DomEvent.on(n,"click",L.DomEvent.stop),e.disabled||(L.DomEvent.addListener(n,"click",this._onBtnClick,this),L.DomEvent.addListener(n,"click",this._triggerClick,this)),e.disabled&&(L.DomUtil.addClass(n,"pm-disabled"),n.setAttribute("aria-disabled","true")),r},_applyStyleClasses(){this._container&&(!this._button.toggleStatus||this._button.cssToggle===!1?(L.DomUtil.removeClass(this.buttonsDomNode,"active"),L.DomUtil.removeClass(this._container,"activeChild")):(L.DomUtil.addClass(this.buttonsDomNode,"active"),L.DomUtil.addClass(this._container,"activeChild")))},_onBtnClick(){if(this._button.disabled)return;this._button.disableOtherButtons&&this._map.pm.Toolbar.triggerClickOnToggledButtons(this);let e="",{buttons:t}=this._map.pm.Toolbar;for(let r in t)if(t[r]._button===this._button){e=r;break}this._fireButtonClick(e,this._button)},_clicked(){this._button.doToggle&&this.toggle()},_updateDisabled(){if(!this._container)return;let e="pm-disabled",t=this.buttonsDomNode.children[0];this._button.disabled?(L.DomUtil.addClass(t,e),t.setAttribute("aria-disabled","true")):(L.DomUtil.removeClass(t,e),t.setAttribute("aria-disabled","false"))},_updateActiveAction(e){e._preparedActions?.forEach(t=>{t?._node&&(t.isActive&&t.isActive.call(this)?L.DomUtil.addClass(t._node,"active-action"):L.DomUtil.removeClass(t._node,"active-action"))})}}),qs=om;L.Control.PMButton=qs;var sm=L.Class.extend({options:{drawMarker:!0,drawRectangle:!0,drawPolyline:!0,drawPolygon:!0,drawCircle:!0,drawCircleMarker:!0,drawText:!0,editMode:!0,dragMode:!0,cutPolygon:!0,removalMode:!0,rotateMode:!0,snappingOption:!0,drawControls:!0,editControls:!0,optionsControls:!0,customControls:!0,oneBlock:!1,position:"topleft",positions:{draw:"",edit:"",options:"",custom:""}},customButtons:[],initialize(e){this.customButtons=[],this.options.positions={draw:"",edit:"",options:"",custom:""},this.init(e)},reinit(){let e=this.isVisible;this.removeControls(),this._defineButtons(),e&&this.addControls()},init(e){this.map=e,this.buttons={},this.isVisible=!1,this.drawContainer=L.DomUtil.create("div","leaflet-pm-toolbar leaflet-pm-draw leaflet-bar leaflet-control"),this.editContainer=L.DomUtil.create("div","leaflet-pm-toolbar leaflet-pm-edit leaflet-bar leaflet-control"),this.optionsContainer=L.DomUtil.create("div","leaflet-pm-toolbar leaflet-pm-options leaflet-bar leaflet-control"),this.customContainer=L.DomUtil.create("div","leaflet-pm-toolbar leaflet-pm-custom leaflet-bar leaflet-control"),this._defineButtons()},_createContainer(e){let t=`${e}Container`;return this[t]||(this[t]=L.DomUtil.create("div",`leaflet-pm-toolbar leaflet-pm-${e} leaflet-bar leaflet-control`)),this[t]},getButtons(){return this.buttons},addControls(e=this.options){typeof e.editPolygon<"u"&&(e.editMode=e.editPolygon),typeof e.deleteLayer<"u"&&(e.removalMode=e.deleteLayer),L.Util.setOptions(this,e),this.applyIconStyle(),this.isVisible=!0,this._showHideButtons()},applyIconStyle(){let e=this.getButtons(),t={geomanIcons:{drawMarker:"control-icon leaflet-pm-icon-marker",drawPolyline:"control-icon leaflet-pm-icon-polyline",drawRectangle:"control-icon leaflet-pm-icon-rectangle",drawPolygon:"control-icon leaflet-pm-icon-polygon",drawCircle:"control-icon leaflet-pm-icon-circle",drawCircleMarker:"control-icon leaflet-pm-icon-circle-marker",editMode:"control-icon leaflet-pm-icon-edit",dragMode:"control-icon leaflet-pm-icon-drag",cutPolygon:"control-icon leaflet-pm-icon-cut",removalMode:"control-icon leaflet-pm-icon-delete",drawText:"control-icon leaflet-pm-icon-text"}};for(let r in e){let n=e[r];L.Util.setOptions(n,{className:t.geomanIcons[r]})}},removeControls(){let e=this.getButtons();for(let t in e)e[t].remove();this.isVisible=!1},deleteControl(e){let t=this._btnNameMapping(e);this.buttons[t]&&(this.buttons[t].remove(),delete this.buttons[t])},toggleControls(e=this.options){this.isVisible?this.removeControls():this.addControls(e)},_addButton(e,t){return this.buttons[e]=t,this.options[e]=!!this.options[e]||!1,this.buttons[e]},triggerClickOnToggledButtons(e){for(let t in this.buttons){let r=this.buttons[t];r._button.disableByOtherButtons&&r!==e&&r.toggled()&&r._triggerClick()}},toggleButton(e,t,r=!0){e==="editPolygon"&&(e="editMode"),e==="deleteLayer"&&(e="removalMode");let n=e;return r&&this.triggerClickOnToggledButtons(this.buttons[n]),this.buttons[n]?this.buttons[n].toggle(t):!1},_defineButtons(){let e={className:"control-icon leaflet-pm-icon-marker",title:V("buttonTitles.drawMarkerButton"),jsClass:"Marker",onClick:()=>{},afterClick:(g,M)=>{this.map.pm.Draw[M.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},t={title:V("buttonTitles.drawPolyButton"),className:"control-icon leaflet-pm-icon-polygon",jsClass:"Polygon",onClick:()=>{},afterClick:(g,M)=>{this.map.pm.Draw[M.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["finish","removeLastVertex","cancel"]},r={className:"control-icon leaflet-pm-icon-polyline",title:V("buttonTitles.drawLineButton"),jsClass:"Line",onClick:()=>{},afterClick:(g,M)=>{this.map.pm.Draw[M.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["finish","removeLastVertex","cancel"]},n={title:V("buttonTitles.drawCircleButton"),className:"control-icon leaflet-pm-icon-circle",jsClass:"Circle",onClick:()=>{},afterClick:(g,M)=>{this.map.pm.Draw[M.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},i={title:V("buttonTitles.drawCircleMarkerButton"),className:"control-icon leaflet-pm-icon-circle-marker",jsClass:"CircleMarker",onClick:()=>{},afterClick:(g,M)=>{this.map.pm.Draw[M.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},a={title:V("buttonTitles.drawRectButton"),className:"control-icon leaflet-pm-icon-rectangle",jsClass:"Rectangle",onClick:()=>{},afterClick:(g,M)=>{this.map.pm.Draw[M.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},o={title:V("buttonTitles.editButton"),className:"control-icon leaflet-pm-icon-edit",onClick:()=>{},afterClick:()=>{this.map.pm.toggleGlobalEditMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},s={title:V("buttonTitles.dragButton"),className:"control-icon leaflet-pm-icon-drag",onClick:()=>{},afterClick:()=>{this.map.pm.toggleGlobalDragMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},c={title:V("buttonTitles.cutButton"),className:"control-icon leaflet-pm-icon-cut",jsClass:"Cut",onClick:()=>{},afterClick:(g,M)=>{this.map.pm.Draw[M.button._button.jsClass].toggle({snappable:!0,cursorMarker:!0,allowSelfIntersection:!1})},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finish","removeLastVertex","cancel"]},l={title:V("buttonTitles.deleteButton"),className:"control-icon leaflet-pm-icon-delete",onClick:()=>{},afterClick:()=>{this.map.pm.toggleGlobalRemovalMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},f={title:V("buttonTitles.rotateButton"),className:"control-icon leaflet-pm-icon-rotate",onClick:()=>{},afterClick:()=>{this.map.pm.toggleGlobalRotateMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finishMode"]},d={className:"control-icon leaflet-pm-icon-text",title:V("buttonTitles.drawTextButton"),jsClass:"Text",onClick:()=>{},afterClick:(g,M)=>{this.map.pm.Draw[M.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]};this._addButton("drawMarker",new L.Control.PMButton(e)),this._addButton("drawPolyline",new L.Control.PMButton(r)),this._addButton("drawRectangle",new L.Control.PMButton(a)),this._addButton("drawPolygon",new L.Control.PMButton(t)),this._addButton("drawCircle",new L.Control.PMButton(n)),this._addButton("drawCircleMarker",new L.Control.PMButton(i)),this._addButton("drawText",new L.Control.PMButton(d)),this._addButton("editMode",new L.Control.PMButton(o)),this._addButton("dragMode",new L.Control.PMButton(s)),this._addButton("cutPolygon",new L.Control.PMButton(c)),this._addButton("removalMode",new L.Control.PMButton(l)),this._addButton("rotateMode",new L.Control.PMButton(f))},_showHideButtons(){if(!this.isVisible)return;this.removeControls(),this.isVisible=!0;let e=this.getButtons(),t=[];this.options.drawControls===!1&&(t=t.concat(Object.keys(e).filter(r=>!e[r]._button.tool))),this.options.editControls===!1&&(t=t.concat(Object.keys(e).filter(r=>e[r]._button.tool==="edit"))),this.options.optionsControls===!1&&(t=t.concat(Object.keys(e).filter(r=>e[r]._button.tool==="options"))),this.options.customControls===!1&&(t=t.concat(Object.keys(e).filter(r=>e[r]._button.tool==="custom")));for(let r in e)if(this.options[r]&&t.indexOf(r)===-1){let n=e[r]._button.tool;n||(n="draw"),e[r].setPosition(this._getBtnPosition(n)),e[r].addTo(this.map)}},_getBtnPosition(e){return this.options.positions&&this.options.positions[e]?this.options.positions[e]:this.options.position},setBlockPosition(e,t){this.options.positions[e]=t,this._showHideButtons(),this.changeControlOrder()},getBlockPositions(){return this.options.positions},copyDrawControl(e,t){if(t)typeof t!="object"&&(t={name:t});else throw new TypeError("Button has no name");let r=this._btnNameMapping(e);if(!t.name)throw new TypeError("Button has no name");if(this.buttons[t.name])throw new TypeError("Button with this name already exists");let n=this.map.pm.Draw.createNewDrawInstance(t.name,r);t={...this.buttons[r]._button,...t};let a=this.createCustomControl(t);return{drawInstance:n,control:a}},createCustomControl(e){if(!e.name)throw new TypeError("Button has no name");if(this.buttons[e.name])throw new TypeError("Button with this name already exists");e.onClick||(e.onClick=()=>{}),e.afterClick||(e.afterClick=()=>{}),e.toggle!==!1&&(e.toggle=!0),e.block&&(e.block=e.block.toLowerCase()),(!e.block||e.block==="draw")&&(e.block=""),e.className?e.className.indexOf("control-icon")===-1&&(e.className=`control-icon ${e.className}`):e.className="control-icon";let t={tool:e.block,className:e.className,title:e.title||"",jsClass:e.name,onClick:e.onClick,afterClick:e.afterClick,doToggle:e.toggle,toggleStatus:!1,disableOtherButtons:e.disableOtherButtons??!0,disableByOtherButtons:e.disableByOtherButtons??!0,cssToggle:e.toggle,position:this.options.position,actions:e.actions||[],disabled:!!e.disabled};this.options[e.name]!==!1&&(this.options[e.name]=!0);let r=this._addButton(e.name,new L.Control.PMButton(t));return this.changeControlOrder(),r},controlExists(e){return!!this.getButton(e)},getButton(e){return this.getButtons()[e]},getButtonsInBlock(e){let t={};if(e)for(let r in this.getButtons()){let n=this.getButtons()[r];(n._button.tool===e||e==="draw"&&!n._button.tool)&&(t[r]=n)}return t},changeControlOrder(e=[]){let t=this._shapeMapping(),r=[];e.forEach(l=>{t[l]?r.push(t[l]):r.push(l)});let n=this.getButtons(),i={};r.forEach(l=>{n[l]&&(i[l]=n[l])}),Object.keys(n).filter(l=>!n[l]._button.tool||n[l]._button.tool==="draw").forEach(l=>{r.indexOf(l)===-1&&(i[l]=n[l])}),Object.keys(n).filter(l=>n[l]._button.tool==="edit").forEach(l=>{r.indexOf(l)===-1&&(i[l]=n[l])}),Object.keys(n).filter(l=>n[l]._button.tool==="options").forEach(l=>{r.indexOf(l)===-1&&(i[l]=n[l])}),Object.keys(n).filter(l=>n[l]._button.tool==="custom").forEach(l=>{r.indexOf(l)===-1&&(i[l]=n[l])}),Object.keys(n).forEach(l=>{r.indexOf(l)===-1&&(i[l]=n[l])}),this.map.pm.Toolbar.buttons=i,this._showHideButtons()},getControlOrder(){let e=this.getButtons(),t=[];for(let r in e)t.push(r);return t},changeActionsOfControl(e,t){let r=this._btnNameMapping(e);if(!r)throw new TypeError("No name passed");if(!t)throw new TypeError("No actions passed");if(!this.buttons[r])throw new TypeError("Button with this name not exists");this.buttons[r]._button.actions=t,this.changeControlOrder()},setButtonDisabled(e,t){let r=this._btnNameMapping(e);t?this.buttons[r].disable():this.buttons[r].enable()},_shapeMapping(){return{Marker:"drawMarker",Circle:"drawCircle",Polygon:"drawPolygon",Rectangle:"drawRectangle",Polyline:"drawPolyline",Line:"drawPolyline",CircleMarker:"drawCircleMarker",Edit:"editMode",Drag:"dragMode",Cut:"cutPolygon",Removal:"removalMode",Rotate:"rotateMode",Text:"drawText"}},_btnNameMapping(e){let t=this._shapeMapping();return t[e]?t[e]:e}}),js=sm;var Vs=Te(Ut());var lm={_initSnappableMarkers(){this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=this.options.snapSegment===void 0?!0:this.options.snapSegment,this._assignEvents(this._markers),this._layer.off("pm:dragstart",this._unsnap,this),this._layer.on("pm:dragstart",this._unsnap,this)},_disableSnapping(){this._layer.off("pm:dragstart",this._unsnap,this)},_assignEvents(e){e.forEach(t=>{if(Array.isArray(t)){this._assignEvents(t);return}t.off("drag",this._handleSnapping,this),t.on("drag",this._handleSnapping,this),t.off("dragend",this._cleanupSnapping,this),t.on("dragend",this._cleanupSnapping,this)})},_cleanupSnapping(e){if(e){let t=e.target;t._snapped=!1}delete this._snapList,this.throttledList&&(this._map.off("layeradd",this.throttledList,this),this.throttledList=void 0),this._map.off("layerremove",this._handleSnapLayerRemoval,this),this.debugIndicatorLines&&this.debugIndicatorLines.forEach(t=>{t.remove()})},_handleThrottleSnapping(){this.throttledList&&this._createSnapList()},_handleSnapping(e,t=!1){let r=e.target;if(r._snapped=!1,this.throttledList||(this.throttledList=L.Util.throttle(this._handleThrottleSnapping,100,this)),e?.originalEvent?.altKey||this._map?.pm?.Keyboard.isAltKeyPressed())return!1;let n;if(t){if(!this._otherSnapLayers||this._otherSnapLayers.length===0)return!1;n=this._otherSnapLayers}else this._snapList===void 0&&(this._createSnapList(),this._map.off("layeradd",this.throttledList,this),this._map.on("layeradd",this.throttledList,this)),n=this._snapList;if(n.length<=0)return!1;let i=this._calcClosestLayer(r.getLatLng(),n);if(Object.keys(i).length===0)return!1;let a=i.layer instanceof L.Marker||i.layer instanceof L.CircleMarker||!this.options.snapSegment,o;a?o=i.latlng:o=this._checkPrioritiySnapping(i);let s=this.options.snapDistance,c={marker:r,shape:this._shape,snapLatLng:o,segment:i.segment,layer:this._layer,workingLayer:this._layer,layerInteractedWith:i.layer,distance:i.distance};if(this._fireSnapDrag(c.marker,c),this._fireSnapDrag(this._layer,c),i.distance<s){r._orgLatLng=r.getLatLng(),r.setLatLng(o),r._snapped=!0,r._snapInfo=c;let l=()=>{this._snapLatLng=o,this._fireSnap(r,c),this._fireSnap(this._layer,c)},f=this._snapLatLng||{},d=o||{};(f.lat!==d.lat||f.lng!==d.lng)&&l()}else this._snapLatLng&&(this._unsnap(c),r._snapped=!1,r._snapInfo=void 0,this._fireUnsnap(c.marker,c),this._fireUnsnap(this._layer,c));return!0},_createSnapList(){let e=[],t=[],r=this._map;r.off("layerremove",this._handleSnapLayerRemoval,this),r.on("layerremove",this._handleSnapLayerRemoval,this),r.eachLayer(n=>{if((n instanceof L.Polyline||n instanceof L.Marker||n instanceof L.CircleMarker||n instanceof L.ImageOverlay)&&n.options.snapIgnore!==!0){if(n.options.snapIgnore===void 0&&(!L.PM.optIn&&n.options.pmIgnore===!0||L.PM.optIn&&n.options.pmIgnore!==!1))return;(n instanceof L.Circle||n instanceof L.CircleMarker)&&n.pm&&n.pm._hiddenPolyCircle?e.push(n.pm._hiddenPolyCircle):n instanceof L.ImageOverlay&&(n=L.rectangle(n.getBounds())),e.push(n);let i=L.polyline([],{color:"red",pmIgnore:!0});i._pmTempLayer=!0,t.push(i),(n instanceof L.Circle||n instanceof L.CircleMarker)&&t.push(i)}}),e=e.filter(n=>this._layer!==n),e=e.filter(n=>n._latlng||n._latlngs&&kt(n._latlngs)),e=e.filter(n=>!n._pmTempLayer),this._otherSnapLayers?(this._otherSnapLayers.forEach(()=>{let n=L.polyline([],{color:"red",pmIgnore:!0});n._pmTempLayer=!0,t.push(n)}),this._snapList=e.concat(this._otherSnapLayers)):this._snapList=e,this.debugIndicatorLines=t},_handleSnapLayerRemoval({layer:e}){if(!e._leaflet_id)return;let t=this._snapList.findIndex(r=>r._leaflet_id===e._leaflet_id);t>-1&&this._snapList.splice(t,1)},_calcClosestLayer(e,t){return this._calcClosestLayers(e,t,1)[0]},_calcClosestLayers(e,t,r=1){let n=[],i={};t.forEach((o,s)=>{if(o._parentCopy&&o._parentCopy===this._layer||o.getLatLngs?.().flat(5).length<2)return;let c=this._calcLayerDistances(e,o);if(c.distance=Math.floor(c.distance),this.debugIndicatorLines){if(!this.debugIndicatorLines[s]){let l=L.polyline([],{color:"red",pmIgnore:!0});l._pmTempLayer=!0,this.debugIndicatorLines[s]=l}this.debugIndicatorLines[s].setLatLngs([e,c.latlng])}r===1&&(i.distance===void 0||c.distance-5<=i.distance)?(c.distance+5<i.distance&&(n=[]),i=c,i.layer=o,n.push(i)):r!==1&&(i={},i=c,i.layer=o,n.push(i))}),r!==1&&(n=n.sort((o,s)=>o.distance-s.distance)),r===-1&&(r=n.length);let a=this._getClosestLayerByPriority(n,r);return L.Util.isArray(a)?a:[a]},_calcLayerDistances(e,t){let r=this._map,n=t instanceof L.Marker||t instanceof L.CircleMarker,i=t instanceof L.Polygon,a=e;if(n){let o=t.getLatLng();return{latlng:{...o},distance:this._getDistance(r,o,a)}}return this._calcLatLngDistances(a,t.getLatLngs(),r,i)},_calcLatLngDistances(e,t,r,n=!1){let i,a,o,s=c=>{c.forEach((l,f)=>{if(Array.isArray(l)){s(l);return}if(this.options.snapSegment){let d=l,g;n?g=f+1===c.length?0:f+1:g=f+1===c.length?void 0:f+1;let M=c[g];if(M){let I=this._getDistanceToSegment(r,e,d,M);(a===void 0||I<a)&&(a=I,o=[d,M])}}else{let d=this._getDistance(r,e,l);(a===void 0||d<a)&&(a=d,i=l)}})};return s(t),this.options.snapSegment?{latlng:{...this._getClosestPointOnSegment(r,e,o[0],o[1])},segment:o,distance:a}:{latlng:i,distance:a}},_getClosestLayerByPriority(e,t=1){e=e.sort((o,s)=>o._leaflet_id-s._leaflet_id);let r=["Marker","CircleMarker","Circle","Line","Polygon","Rectangle"],n=this._map.pm.globalOptions.snappingOrder||[],i=0,a={};return n.concat(r).forEach(o=>{a[o]||(i+=1,a[o]=i)}),e.sort(As("instanceofShape",a)),t===1?e[0]||{}:e.slice(0,t)},_checkPrioritiySnapping(e){let t=this._map,r=e.segment[0],n=e.segment[1],i=e.latlng,a=i;if(this.options.snapVertex){let o=this._getDistance(t,r,i),s=this._getDistance(t,n,i),c=o<s?r:n,l=o<s?o:s;if(this.options.snapMiddle){let d=L.PM.Utils.calcMiddleLatLng(t,r,n),g=this._getDistance(t,d,i);g<o&&g<s&&(c=d,l=g)}let f=this.options.snapDistance;l<f&&(a=c)}return{...a}},_unsnap(){delete this._snapLatLng},_getClosestPointOnSegment(e,t,r,n){let i=e.getMaxZoom();i===1/0&&(i=e.getZoom());let a=e.project(t,i),o=e.project(r,i),s=e.project(n,i),c=L.LineUtil.closestPointOnSegment(a,o,s);return e.unproject(c,i)},_getDistanceToSegment(e,t,r,n){let i=e.latLngToContainerPoint(t),a=e.latLngToContainerPoint(r),o=e.latLngToContainerPoint(n);return L.LineUtil.pointToSegmentDistance(i,a,o)},_getDistance(e,t,r){return e.latLngToContainerPoint(t).distanceTo(e.latLngToContainerPoint(r))}},zt=lm;var cm=L.Class.extend({includes:[zt,Oe],options:{snappable:!0,snapDistance:20,snapMiddle:!1,allowSelfIntersection:!0,tooltips:!0,templineStyle:{},hintlineStyle:{color:"#3388ff",dashArray:"5,5"},pathOptions:null,cursorMarker:!0,finishOn:null,markerStyle:{draggable:!0,icon:L.icon()},hideMiddleMarkers:!1,minRadiusCircle:null,maxRadiusCircle:null,minRadiusCircleMarker:null,maxRadiusCircleMarker:null,resizeableCircleMarker:!1,resizeableCircle:!0,markerEditable:!0,continueDrawing:!1,snapSegment:!0,requireSnapToFinish:!1,rectangleAngle:0,textOptions:{text:null,focusAfterDraw:null,removeIfEmpty:null,className:null},snapVertex:!0},setOptions(e){L.Util.setOptions(this,e),this.setStyle(this.options)},setStyle(){},getOptions(){return this.options},initialize(e){let t=new L.Icon.Default;t.options.tooltipAnchor=[0,0],this.options.markerStyle.icon=t,this._map=e,this.shapes=["Marker","CircleMarker","Line","Polygon","Rectangle","Circle","Cut","Text"],this.shapes.forEach(r=>{this[r]=new L.PM.Draw[r](this._map)}),this.Marker.setOptions({continueDrawing:!0}),this.CircleMarker.setOptions({continueDrawing:!0})},setPathOptions(e,t=!1){t?this.options.pathOptions=(0,Vs.default)(this.options.pathOptions,e):this.options.pathOptions=e},getShapes(){return this.shapes},getShape(){return this._shape},enable(e,t){if(!e)throw new Error(`Error: Please pass a shape as a parameter. Possible shapes are: ${this.getShapes().join(",")}`);this.disable(),this[e].enable(t)},disable(){this.shapes.forEach(e=>{this[e].disable()})},addControls(){this.shapes.forEach(e=>{this[e].addButton()})},getActiveShape(){let e;return this.shapes.forEach(t=>{this[t]._enabled&&(e=t)}),e},_setGlobalDrawMode(){this._shape==="Cut"?this._fireGlobalCutModeToggled():this._fireGlobalDrawModeToggled();let e=[];this._map.eachLayer(t=>{(t instanceof L.Polyline||t instanceof L.Marker||t instanceof L.Circle||t instanceof L.CircleMarker||t instanceof L.ImageOverlay)&&(t._pmTempLayer||e.push(t))}),this._enabled?e.forEach(t=>{L.PM.Utils.disablePopup(t)}):e.forEach(t=>{L.PM.Utils.enablePopup(t)})},createNewDrawInstance(e,t){let r=this._getShapeFromBtnName(t);if(this[e])throw new TypeError("Draw Type already exists");if(!L.PM.Draw[r])throw new TypeError(`There is no class L.PM.Draw.${r}`);return this[e]=new L.PM.Draw[r](this._map),this[e].toolbarButtonName=e,this[e]._shape=e,this.shapes.push(e),this[t]&&this[e].setOptions(this[t].options),this[e].setOptions(this[e].options),this[e]},_getShapeFromBtnName(e){let t={drawMarker:"Marker",drawCircle:"Circle",drawPolygon:"Polygon",drawPolyline:"Line",drawRectangle:"Rectangle",drawCircleMarker:"CircleMarker",editMode:"Edit",dragMode:"Drag",cutPolygon:"Cut",removalMode:"Removal",rotateMode:"Rotate",drawText:"Text"};return t[e]?t[e]:this[e]?this[e]._shape:e},_finishLayer(e){e.pm&&(e.pm.setOptions(this.options),e.pm._shape=this._shape,e.pm._map=this._map),this._addDrawnLayerProp(e)},_addDrawnLayerProp(e){e._drawnByGeoman=!0},_setPane(e,t){t==="layerPane"?e.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.layerPane||"overlayPane":t==="vertexPane"?e.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.vertexPane||"markerPane":t==="markerPane"&&(e.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.markerPane||"markerPane")},_isFirstLayer(){return(this._map||this._layer._map).pm.getGeomanLayers().length===0}}),$=cm;$.Marker=$.extend({initialize(e){this._map=e,this._shape="Marker",this.toolbarButtonName="drawMarker",this._layerIsDragging=!1},enable(e){L.Util.setOptions(this,e),this._enabled=!0,this._isTouchDevice=!Gs(),this._map.getContainer().classList.add("geoman-draw-cursor"),this._map.on("click",this._createMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._isTouchDevice?(this._createTouchHint(),this._hintMarker=L.marker(this._map.getCenter(),{...this.options.markerStyle,opacity:0,interactive:!1}),this._setPane(this._hintMarker,"markerPane"),this._hintMarker._pmTempLayer=!0):(this._hintMarker=L.marker(this._map.getCenter(),this.options.markerStyle),this._setPane(this._hintMarker,"markerPane"),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this.options.tooltips&&this._hintMarker.bindTooltip(V("tooltips.placeMarker"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._map.on("mousemove",this._syncHintMarker,this)),this._layer=this._hintMarker,this.options.markerEditable&&this._map.eachLayer(t=>{this.isRelevantMarker(t)&&t.pm.enable()}),this._fireDrawStart(),this._setGlobalDrawMode()},disable(){this._enabled&&(this._enabled=!1,this._map.getContainer().classList.remove("geoman-draw-cursor"),this._map.off("click",this._createMarker,this),this._isTouchDevice?(this._removeTouchHint(),this._hintMarker=null):(this._hintMarker.remove(),this._map.off("mousemove",this._syncHintMarker,this)),this._map.eachLayer(e=>{this.isRelevantMarker(e)&&e.pm.disable()}),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled(){return this._enabled},toggle(e){this.enabled()?this.disable():this.enable(e)},isRelevantMarker(e){return e instanceof L.Marker&&e.pm&&!e._pmTempLayer&&!e.pm._initTextMarker},_syncHintMarker(e){if(this._hintMarker.setLatLng(e.latlng),this.options.snappable){let t=e;t.target=this._hintMarker,this._handleSnapping(t)}this._fireChange(this._hintMarker.getLatLng(),"Draw")},_createMarker(e){if(!e.latlng||this._layerIsDragging||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;this._hintMarker._snapped||this._hintMarker.setLatLng(e.latlng);let t=this._hintMarker.getLatLng(),r=new L.Marker(t,this.options.markerStyle);this._setPane(r,"markerPane"),this._finishLayer(r),r.pm||(r.options.draggable=!1),r.addTo(this._map.pm._getContainingLayer()),r.pm&&this.options.markerEditable?r.pm.enable():r.dragging&&r.dragging.disable(),this._fireCreate(r),this._cleanupSnapping(),this.options.continueDrawing||this.disable()},setStyle(){this.options.markerStyle?.icon&&this._hintMarker?.setIcon(this.options.markerStyle.icon)},_createTouchHint(){this.options.tooltips&&(this._touchHint=L.DomUtil.create("div","leaflet-pm-touch-hint"),this._touchHint.textContent=V("tooltips.placeMarkerTouch"),this._map.getContainer().appendChild(this._touchHint))},_removeTouchHint(){this._touchHint&&this._touchHint.parentNode&&(this._touchHint.parentNode.removeChild(this._touchHint),this._touchHint=null)}});var te=63710088e-1,hm={centimeters:te*100,centimetres:te*100,cm:te*100,degrees:360/(2*Math.PI),deg:360/(2*Math.PI),feet:te*3.28084,ft:te*3.28084,inches:te*39.37,in:te*39.37,kilometers:te/1e3,kilometres:te/1e3,km:te/1e3,meters:te,metres:te,m:te,miles:te/1609.344,mi:te/1609.344,millimeters:te*1e3,millimetres:te*1e3,mm:te*1e3,nauticalmiles:te/1852,nmi:te/1852,radians:1,rad:1,yards:te*1.0936,yd:te*1.0936};function ge(e,t,r={}){let n={type:"Feature"};return(r.id===0||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}function xe(e,t,r={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Us(e[0])||!Us(e[1]))throw new Error("coordinates must contain numbers");return ge({type:"Point",coordinates:e},t,r)}function Be(e,t,r={}){if(e.length<2)throw new Error("coordinates must be an array of two or more positions");return ge({type:"LineString",coordinates:e},t,r)}function se(e,t={}){let r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}function Ks(e,t="kilometers"){let r=hm[t];if(!r)throw new Error(t+" units is invalid");return e*r}function Sr(e){return e%(2*Math.PI)*180/Math.PI}function Ge(e){return e%360*Math.PI/180}function Us(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}function Or(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function dm(e){let t,r,n={type:"FeatureCollection",features:[]};if(e.type==="Feature"?r=e.geometry:r=e,r.type==="LineString")t=[r.coordinates];else if(r.type==="MultiLineString")t=r.coordinates;else if(r.type==="MultiPolygon")t=[].concat(...r.coordinates);else if(r.type==="Polygon")t=r.coordinates;else throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");return t.forEach(i=>{t.forEach(a=>{for(let o=0;o<i.length-1;o++)for(let s=o;s<a.length-1;s++){if(i===a&&(Math.abs(o-s)===1||o===0&&s===i.length-2&&i[o][0]===i[i.length-1][0]&&i[o][1]===i[i.length-1][1]))continue;let c=pm(i[o][0],i[o][1],i[o+1][0],i[o+1][1],a[s][0],a[s][1],a[s+1][0],a[s+1][1]);c&&n.features.push(xe([c[0],c[1]]))}})}),n}function pm(e,t,r,n,i,a,o,s){let c,l,f,d,g,M={x:null,y:null,onLine1:!1,onLine2:!1};return c=(s-a)*(r-e)-(o-i)*(n-t),c===0?M.x!==null&&M.y!==null?M:!1:(l=t-a,f=e-i,d=(o-i)*l-(s-a)*f,g=(r-e)*l-(n-t)*f,l=d/c,f=g/c,M.x=e+l*(r-e),M.y=t+l*(n-t),l>=0&&l<=1&&(M.onLine1=!0),f>=0&&f<=1&&(M.onLine2=!0),M.onLine1&&M.onLine2?[M.x,M.y]:!1)}var at=dm;$.Line=$.extend({initialize(e){this._map=e,this._shape="Line",this.toolbarButtonName="drawPolyline",this._doesSelfIntersect=!1},enable(e){L.Util.setOptions(this,e),this._enabled=!0,this._markers=[],this._layerGroup=new L.FeatureGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=L.polyline([],{...this.options.templineStyle,pmIgnore:!1}),this._setPane(this._layer,"layerPane"),this._layer._pmTempLayer=!0,this._layerGroup.addLayer(this._layer),this._hintline=L.polyline([],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._layerGroup.addLayer(this._hintline),this._hintMarker=L.marker(this._map.getCenter(),{interactive:!1,zIndexOffset:100,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(V("tooltips.firstVertex"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._map.getContainer().classList.add("geoman-draw-cursor"),this._map.on("click",this._createVertex,this),this.options.finishOn&&this.options.finishOn!=="snap"&&this._map.on(this.options.finishOn,this._finishShape,this),this.options.finishOn==="dblclick"&&(this.tempMapDoubleClickZoomState=this._map.doubleClickZoom._enabled,this.tempMapDoubleClickZoomState&&this._map.doubleClickZoom.disable()),this._map.on("mousemove",this._syncHintMarker,this),this._hintMarker.on("move",this._syncHintLine,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._otherSnapLayers=[],this.isRed=!1,this._fireDrawStart(),this._setGlobalDrawMode()},disable(){this._enabled&&(this._enabled=!1,this._map.getContainer().classList.remove("geoman-draw-cursor"),this._map.off("click",this._createVertex,this),this._map.off("mousemove",this._syncHintMarker,this),this.options.finishOn&&this.options.finishOn!=="snap"&&this._map.off(this.options.finishOn,this._finishShape,this),this.tempMapDoubleClickZoomState&&this._map.doubleClickZoom.enable(),this._map.removeLayer(this._layerGroup),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled(){return this._enabled},toggle(e){this.enabled()?this.disable():this.enable(e)},_syncHintLine(){let e=this._layer.getLatLngs();if(e.length>0){let t=e[e.length-1];this._hintline.setLatLngs([t,this._hintMarker.getLatLng()])}},_syncHintMarker(e){if(this._hintMarker.setLatLng(e.latlng),this.options.snappable){let r=e;r.target=this._hintMarker,this._handleSnapping(r)}else if(this._otherSnapLayers&&this._otherSnapLayers.length>0){let r=e;r.target=this._hintMarker,this._handleSnapping(r,!0)}this.options.allowSelfIntersection||this._handleSelfIntersection(!0,this._hintMarker.getLatLng());let t=this._layer._defaultShape().slice();t.push(this._hintMarker.getLatLng()),this._change(t)},hasSelfIntersection(){return at(this._layer.toGeoJSON(15)).features.length>0},_handleSelfIntersection(e,t){let r=L.polyline(this._layer.getLatLngs());e&&(t||(t=this._hintMarker.getLatLng()),r.addLatLng(t));let n=at(r.toGeoJSON(15));this._doesSelfIntersect=n.features.length>0,this._doesSelfIntersect?this.isRed||(this.isRed=!0,this._hintline.setStyle({color:"#f00000ff"}),this._fireIntersect(n,this._map,"Draw")):this._hintline.isEmpty()||(this.isRed=!1,this._hintline.setStyle(this.options.hintlineStyle))},_createVertex(e){if(!this.options.allowSelfIntersection&&(this._handleSelfIntersection(!0,e.latlng),this._doesSelfIntersect))return;this._hintMarker._snapped||this._hintMarker.setLatLng(e.latlng);let t=this._hintMarker.getLatLng(),r=this._layer.getLatLngs(),n=r[r.length-1];if(t.equals(r[0])||r.length>0&&t.equals(n)){this._finishShape();return}this._layer._latlngInfo=this._layer._latlngInfo||[],this._layer._latlngInfo.push({latlng:t,snapInfo:this._hintMarker._snapInfo}),this._layer.addLatLng(t);let i=this._createMarker(t);this._setTooltipText(),this._setHintLineAfterNewVertex(t),this._fireVertexAdded(i,void 0,t,"Draw"),this._change(this._layer.getLatLngs()),this.options.finishOn==="snap"&&this._hintMarker._snapped&&this._finishShape(e)},_setHintLineAfterNewVertex(e){this._hintline.setLatLngs([e,e])},_removeLastVertex(){let e=this._markers;if(e.length<=1){this.disable();return}let t=this._layer.getLatLngs(),r=e[e.length-1],{indexPath:n}=L.PM.Utils.findDeepMarkerIndex(e,r);e.pop(),this._layerGroup.removeLayer(r);let i=e[e.length-1],a=t.indexOf(i.getLatLng());t=t.slice(0,a+1),this._layer.setLatLngs(t),this._layer._latlngInfo.pop(),this._syncHintLine(),this._setTooltipText(),this._fireVertexRemoved(r,n,"Draw"),this._change(this._layer.getLatLngs())},_finishShape(){if(!this.options.allowSelfIntersection&&(this._handleSelfIntersection(!1),this._doesSelfIntersect)||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;let e=this._layer.getLatLngs();if(e.length<=1)return;let t=L.polyline(e,this.options.pathOptions);this._setPane(t,"layerPane"),this._finishLayer(t),t.addTo(this._map.pm._getContainingLayer()),this._fireCreate(t),this.options.snappable&&this._cleanupSnapping();let r=this._hintMarker.getLatLng();this.disable(),this.options.continueDrawing&&(this.enable(),this._hintMarker.setLatLng(r))},_createMarker(e){let t=new L.Marker(e,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return this._setPane(t,"vertexPane"),t._pmTempLayer=!0,this._layerGroup.addLayer(t),this._markers.push(t),t.on("click",this._finishShape,this),t},_setTooltipText(){let{length:e}=this._layer.getLatLngs().flat(),t="";e<=1?t=V("tooltips.continueLine"):t=V("tooltips.finishLine"),this._hintMarker.setTooltipContent(t)},_change(e){this._fireChange(e,"Draw")},setStyle(){this._layer?.setStyle(this.options.templineStyle),this._hintline?.setStyle(this.options.hintlineStyle)}});$.Polygon=$.Line.extend({initialize(e){this._map=e,this._shape="Polygon",this.toolbarButtonName="drawPolygon"},enable(e){L.PM.Draw.Line.prototype.enable.call(this,e),this._layer.pm._shape="Polygon"},_createMarker(e){let t=new L.Marker(e,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return this._setPane(t,"vertexPane"),t._pmTempLayer=!0,this._layerGroup.addLayer(t),this._markers.push(t),this._layer.getLatLngs().flat().length===1?(t.on("click",this._finishShape,this),this._tempSnapLayerIndex=this._otherSnapLayers.push(t)-1,this.options.snappable&&this._cleanupSnapping()):t.on("click",()=>1),t},_setTooltipText(){let{length:e}=this._layer.getLatLngs().flat(),t="";e<=2?t=V("tooltips.continueLine"):t=V("tooltips.finishPoly"),this._hintMarker.setTooltipContent(t)},_finishShape(){if(!this.options.allowSelfIntersection&&(this._handleSelfIntersection(!0,this._layer.getLatLngs()[0]),this._doesSelfIntersect)||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;let e=this._layer.getLatLngs();if(e.length<=2)return;let t=L.polygon(e,this.options.pathOptions);this._setPane(t,"layerPane"),this._finishLayer(t),t.addTo(this._map.pm._getContainingLayer()),this._fireCreate(t),this._cleanupSnapping(),this._otherSnapLayers.splice(this._tempSnapLayerIndex,1),delete this._tempSnapLayerIndex;let r=this._hintMarker.getLatLng();this.disable(),this.options.continueDrawing&&(this.enable(),this._hintMarker.setLatLng(r))}});$.Rectangle=$.extend({initialize(e){this._map=e,this._shape="Rectangle",this.toolbarButtonName="drawRectangle"},enable(e){if(L.Util.setOptions(this,e),this._enabled=!0,this._layerGroup=new L.FeatureGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=L.rectangle([[0,0],[0,0]],this.options.pathOptions),this._setPane(this._layer,"layerPane"),this._layer._pmTempLayer=!0,this._startMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon rect-start-marker"}),draggable:!1,zIndexOffset:-100,opacity:this.options.cursorMarker?1:0}),this._setPane(this._startMarker,"vertexPane"),this._startMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._startMarker),this._hintMarker=L.marker(this._map.getCenter(),{zIndexOffset:150,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(V("tooltips.firstVertex"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this.options.cursorMarker){this._styleMarkers=[];for(let t=0;t<2;t+=1){let r=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon rect-style-marker"}),draggable:!1,zIndexOffset:100});this._setPane(r,"vertexPane"),r._pmTempLayer=!0,this._layerGroup.addLayer(r),this._styleMarkers.push(r)}}this._map.getContainer().classList.add("geoman-draw-cursor"),this._map.on("click",this._placeStartingMarkers,this),this._map.on("mousemove",this._syncHintMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._otherSnapLayers=[],this._fireDrawStart(),this._setGlobalDrawMode()},disable(){this._enabled&&(this._enabled=!1,this._map.getContainer().classList.remove("geoman-draw-cursor"),this._map.off("click",this._finishShape,this),this._map.off("click",this._placeStartingMarkers,this),this._map.off("mousemove",this._syncHintMarker,this),this._map.removeLayer(this._layerGroup),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled(){return this._enabled},toggle(e){this.enabled()?this.disable():this.enable(e)},_placeStartingMarkers(e){this._hintMarker._snapped||this._hintMarker.setLatLng(e.latlng);let t=this._hintMarker.getLatLng();L.DomUtil.addClass(this._startMarker._icon,"visible"),this._startMarker.setLatLng(t),this.options.cursorMarker&&this._styleMarkers&&this._styleMarkers.forEach(r=>{L.DomUtil.addClass(r._icon,"visible"),r.setLatLng(t)}),this._map.off("click",this._placeStartingMarkers,this),this._map.on("click",this._finishShape,this),this._hintMarker.setTooltipContent(V("tooltips.finishRect")),this._setRectangleOrigin()},_setRectangleOrigin(){let e=this._startMarker.getLatLng();e&&(this._layerGroup.addLayer(this._layer),this._layer.setLatLngs([e,e]),this._hintMarker.on("move",this._syncRectangleSize,this))},_syncHintMarker(e){if(this._hintMarker.setLatLng(e.latlng),this.options.snappable){let r=e;r.target=this._hintMarker,this._handleSnapping(r)}let t=this._layerGroup&&this._layerGroup.hasLayer(this._layer)?this._layer.getLatLngs():[this._hintMarker.getLatLng()];this._fireChange(t,"Draw")},_syncRectangleSize(){let e=Tr(this._startMarker.getLatLng(),this._map),t=Tr(this._hintMarker.getLatLng(),this._map),r=L.PM.Utils._getRotatedRectangle(e,t,this.options.rectangleAngle||0,this._map);if(this._layer.setLatLngs(r),this.options.cursorMarker&&this._styleMarkers){let n=[];r.forEach(i=>{!i.equals(e,1e-8)&&!i.equals(t,1e-8)&&n.push(i)}),n.forEach((i,a)=>{try{this._styleMarkers[a].setLatLng(i)}catch{}})}},_findCorners(){let e=this._layer.getLatLngs()[0];return L.PM.Utils._getRotatedRectangle(e[0],e[2],this.options.rectangleAngle||0,this._map)},_finishShape(e){e?.latlng&&!this._hintMarker._snapped&&this._hintMarker.setLatLng(e.latlng);let t=this._hintMarker.getLatLng(),r=this._startMarker.getLatLng();if(this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer()||r.equals(t))return;let n=L.rectangle([r,t],this.options.pathOptions);if(this.options.rectangleAngle){let a=L.PM.Utils._getRotatedRectangle(r,t,this.options.rectangleAngle||0,this._map);n.setLatLngs(a),n.pm&&n.pm._setAngle(this.options.rectangleAngle||0)}this._setPane(n,"layerPane"),this._finishLayer(n),n.addTo(this._map.pm._getContainingLayer()),this._fireCreate(n);let i=this._hintMarker.getLatLng();this.disable(),this.options.continueDrawing&&(this.enable(),this._hintMarker.setLatLng(i))},setStyle(){this._layer?.setStyle(this.options.pathOptions)}});$.CircleMarker=$.extend({initialize(e){this._map=e,this._shape="CircleMarker",this.toolbarButtonName="drawCircleMarker",this._layerIsDragging=!1,this._BaseCircleClass=L.CircleMarker,this._minRadiusOption="minRadiusCircleMarker",this._maxRadiusOption="maxRadiusCircleMarker",this._editableOption="resizeableCircleMarker",this._defaultRadius=10},enable(e){if(L.Util.setOptions(this,e),this.options.editable&&(this.options.resizeableCircleMarker=this.options.editable,delete this.options.editable),this._enabled=!0,this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._map.getContainer().classList.add("geoman-draw-cursor"),this.options[this._editableOption]){let t={};L.extend(t,this.options.templineStyle),t.radius=0,this._layerGroup=new L.FeatureGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=new this._BaseCircleClass(this._map.getCenter(),t),this._setPane(this._layer,"layerPane"),this._layer._pmTempLayer=!0,this._centerMarker=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon"}),draggable:!1,zIndexOffset:100}),this._setPane(this._centerMarker,"vertexPane"),this._centerMarker._pmTempLayer=!0,this._hintMarker=L.marker(this._map.getCenter(),{zIndexOffset:110,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(V("tooltips.startCircle"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._hintline=L.polyline([],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._layerGroup.addLayer(this._hintline),this._map.on("click",this._placeCenterMarker,this)}else this._map.on("click",this._createMarker,this),this._hintMarker=new this._BaseCircleClass(this._map.getCenter(),{radius:this._defaultRadius,...this.options.templineStyle}),this._setPane(this._hintMarker,"layerPane"),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this._layer=this._hintMarker,this.options.tooltips&&this._hintMarker.bindTooltip(V("tooltips.placeCircleMarker"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip();this._map.on("mousemove",this._syncHintMarker,this),this._extendingEnable(),this._otherSnapLayers=[],this._fireDrawStart(),this._setGlobalDrawMode()},_extendingEnable(){!this.options[this._editableOption]&&this.options.markerEditable&&this._map.eachLayer(e=>{this.isRelevantMarker(e)&&e.pm.enable()}),this._layer.bringToBack()},disable(){this._enabled&&(this._enabled=!1,this._map.getContainer().classList.remove("geoman-draw-cursor"),this.options[this._editableOption]?(this._map.off("click",this._finishShape,this),this._map.off("click",this._placeCenterMarker,this),this._map.removeLayer(this._layerGroup)):(this._map.off("click",this._createMarker,this),this._extendingDisable(),this._hintMarker.remove()),this._map.off("mousemove",this._syncHintMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},_extendingDisable(){this._map.eachLayer(e=>{this.isRelevantMarker(e)&&e.pm.disable()})},enabled(){return this._enabled},toggle(e){this.enabled()?this.disable():this.enable(e)},_placeCenterMarker(e){this._hintMarker._snapped||this._hintMarker.setLatLng(e.latlng),this._layerGroup.addLayer(this._layer),this._layerGroup.addLayer(this._centerMarker);let t=this._hintMarker.getLatLng();this._centerMarker.setLatLng(t),this._map.off("click",this._placeCenterMarker,this),this._map.on("click",this._finishShape,this),this._placeCircleCenter()},_placeCircleCenter(){let e=this._centerMarker.getLatLng();e&&(this._layer.setLatLng(e),this._hintMarker.on("move",this._syncHintLine,this),this._hintMarker.on("move",this._syncCircleRadius,this),this._hintMarker.setTooltipContent(V("tooltips.finishCircle")),this._fireCenterPlaced(),this._fireChange(this._layer.getLatLng(),"Draw"))},_syncHintLine(){let e=this._centerMarker.getLatLng(),t=this._getNewDestinationOfHintMarker();this._hintline.setLatLngs([e,t])},_syncCircleRadius(){let e=this._centerMarker.getLatLng(),t=this._hintMarker.getLatLng(),r=this._distanceCalculation(e,t);this.options[this._minRadiusOption]&&r<this.options[this._minRadiusOption]?this._layer.setRadius(this.options[this._minRadiusOption]):this.options[this._maxRadiusOption]&&r>this.options[this._maxRadiusOption]?this._layer.setRadius(this.options[this._maxRadiusOption]):this._layer.setRadius(r)},_syncHintMarker(e){if(this._hintMarker.setLatLng(e.latlng),this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker()),this.options.snappable){let r=e;r.target=this._hintMarker,this._handleSnapping(r)}this._handleHintMarkerSnapping();let t=this._layerGroup&&this._layerGroup.hasLayer(this._centerMarker)?this._centerMarker.getLatLng():this._hintMarker.getLatLng();this._fireChange(t,"Draw")},isRelevantMarker(e){return e instanceof L.CircleMarker&&!(e instanceof L.Circle)&&e.pm&&!e._pmTempLayer},_createMarker(e){if(this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer()||!e.latlng||this._layerIsDragging)return;this._hintMarker._snapped||this._hintMarker.setLatLng(e.latlng);let t=this._hintMarker.getLatLng(),r=new this._BaseCircleClass(t,{radius:this._defaultRadius,...this.options.pathOptions});this._setPane(r,"layerPane"),this._finishLayer(r),r.addTo(this._map.pm._getContainingLayer()),this._extendingCreateMarker(r),this._fireCreate(r),this._cleanupSnapping(),this.options.continueDrawing||this.disable()},_extendingCreateMarker(e){e.pm&&this.options.markerEditable&&e.pm.enable()},_finishShape(e){if(this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;e?.latlng&&!this._hintMarker._snapped&&this._hintMarker.setLatLng(e.latlng);let t=this._centerMarker.getLatLng(),r=this._defaultRadius;if(this.options[this._editableOption]){let o=this._hintMarker.getLatLng();r=this._distanceCalculation(t,o),this.options[this._minRadiusOption]&&r<this.options[this._minRadiusOption]?r=this.options[this._minRadiusOption]:this.options[this._maxRadiusOption]&&r>this.options[this._maxRadiusOption]&&(r=this.options[this._maxRadiusOption])}let n={...this.options.pathOptions,radius:r},i=new this._BaseCircleClass(t,n);this._setPane(i,"layerPane"),this._finishLayer(i),i.addTo(this._map.pm._getContainingLayer()),i.pm&&i.pm._updateHiddenPolyCircle(),this._fireCreate(i);let a=this._hintMarker.getLatLng();this.disable(),this.options.continueDrawing&&(this.enable(),this._hintMarker.setLatLng(a))},_getNewDestinationOfHintMarker(){let e=this._hintMarker.getLatLng();if(this.options[this._editableOption]){if(!this._layerGroup.hasLayer(this._centerMarker))return e;let t=this._centerMarker.getLatLng(),r=this._distanceCalculation(t,e);this.options[this._minRadiusOption]&&r<this.options[this._minRadiusOption]?e=it(this._map,t,e,this._getMinDistanceInMeter()):this.options[this._maxRadiusOption]&&r>this.options[this._maxRadiusOption]&&(e=it(this._map,t,e,this._getMaxDistanceInMeter()))}return e},_getMinDistanceInMeter(){return L.PM.Utils.pxRadiusToMeterRadius(this.options[this._minRadiusOption],this._map,this._centerMarker.getLatLng())},_getMaxDistanceInMeter(){return L.PM.Utils.pxRadiusToMeterRadius(this.options[this._maxRadiusOption],this._map,this._centerMarker.getLatLng())},_handleHintMarkerSnapping(){if(this.options[this._editableOption]){if(this._hintMarker._snapped){let e=this._centerMarker.getLatLng(),t=this._hintMarker.getLatLng(),r=this._distanceCalculation(e,t);this._layerGroup.hasLayer(this._centerMarker)&&(this.options[this._minRadiusOption]&&r<this.options[this._minRadiusOption]?this._hintMarker.setLatLng(this._hintMarker._orgLatLng):this.options[this._maxRadiusOption]&&r>this.options[this._maxRadiusOption]&&this._hintMarker.setLatLng(this._hintMarker._orgLatLng))}this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker())}},setStyle(){let e={};L.extend(e,this.options.templineStyle),this.options[this._editableOption]&&(e.radius=0),this._layer?.setStyle(e),this._hintline?.setStyle(this.options.hintlineStyle)},_distanceCalculation(e,t){return this._map.project(e).distanceTo(this._map.project(t))}});$.Circle=$.CircleMarker.extend({initialize(e){this._map=e,this._shape="Circle",this.toolbarButtonName="drawCircle",this._BaseCircleClass=L.Circle,this._minRadiusOption="minRadiusCircle",this._maxRadiusOption="maxRadiusCircle",this._editableOption="resizeableCircle",this._defaultRadius=100},_extendingEnable(){},_extendingDisable(){},_extendingCreateMarker(){},isRelevantMarker(){},_getMinDistanceInMeter(){return this.options[this._minRadiusOption]},_getMaxDistanceInMeter(){return this.options[this._maxRadiusOption]},_distanceCalculation(e,t){return this._map.distance(e,t)}});var ot=class{constructor(t=[],r=um){if(this.data=t,this.length=this.data.length,this.compare=r,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;let t=this.data[0],r=this.data.pop();return this.length--,this.length>0&&(this.data[0]=r,this._down(0)),t}peek(){return this.data[0]}_up(t){let{data:r,compare:n}=this,i=r[t];for(;t>0;){let a=t-1>>1,o=r[a];if(n(i,o)>=0)break;r[t]=o,t=a}r[t]=i}_down(t){let{data:r,compare:n}=this,i=this.length>>1,a=r[t];for(;t<i;){let o=(t<<1)+1,s=r[o],c=o+1;if(c<this.length&&n(r[c],s)<0&&(o=c,s=r[c]),n(s,a)>=0)break;r[t]=s,t=o}r[t]=a}};function um(e,t){return e<t?-1:e>t?1:0}var K=11102230246251565e-32,re=134217729,wt=(3+8*K)*K;function Ve(e,t,r,n,i){let a,o,s,c,l=t[0],f=n[0],d=0,g=0;f>l==f>-l?(a=l,l=t[++d]):(a=f,f=n[++g]);let M=0;if(d<e&&g<r)for(f>l==f>-l?(o=l+a,s=a-(o-l),l=t[++d]):(o=f+a,s=a-(o-f),f=n[++g]),a=o,s!==0&&(i[M++]=s);d<e&&g<r;)f>l==f>-l?(o=a+l,c=o-a,s=a-(o-c)+(l-c),l=t[++d]):(o=a+f,c=o-a,s=a-(o-c)+(f-c),f=n[++g]),a=o,s!==0&&(i[M++]=s);for(;d<e;)o=a+l,c=o-a,s=a-(o-c)+(l-c),l=t[++d],a=o,s!==0&&(i[M++]=s);for(;g<r;)o=a+f,c=o-a,s=a-(o-c)+(f-c),f=n[++g],a=o,s!==0&&(i[M++]=s);return(a!==0||M===0)&&(i[M++]=a),M}function Pt(e,t){let r=t[0];for(let n=1;n<e;n++)r+=t[n];return r}function G(e){return new Float64Array(e)}var fm=(3+16*K)*K,gm=(2+12*K)*K,mm=(9+64*K)*K*K,st=G(4),zs=G(8),Hs=G(12),Js=G(16),ce=G(4);function Lm(e,t,r,n,i,a,o){let s,c,l,f,d,g,M,I,T,m,y,_,S,D,O,N,F,h,p=e-i,u=r-i,v=t-a,b=n-a;D=p*b,g=re*p,M=g-(g-p),I=p-M,g=re*b,T=g-(g-b),m=b-T,O=I*m-(D-M*T-I*T-M*m),N=v*u,g=re*v,M=g-(g-v),I=v-M,g=re*u,T=g-(g-u),m=u-T,F=I*m-(N-M*T-I*T-M*m),y=O-F,d=O-y,st[0]=O-(y+d)+(d-F),_=D+y,d=_-D,S=D-(_-d)+(y-d),y=S-N,d=S-y,st[1]=S-(y+d)+(d-N),h=_+y,d=h-_,st[2]=_-(h-d)+(y-d),st[3]=h;let E=Pt(4,st),w=gm*o;if(E>=w||-E>=w||(d=e-p,s=e-(p+d)+(d-i),d=r-u,l=r-(u+d)+(d-i),d=t-v,c=t-(v+d)+(d-a),d=n-b,f=n-(b+d)+(d-a),s===0&&c===0&&l===0&&f===0)||(w=mm*o+wt*Math.abs(E),E+=p*f+b*s-(v*l+u*c),E>=w||-E>=w))return E;D=s*b,g=re*s,M=g-(g-s),I=s-M,g=re*b,T=g-(g-b),m=b-T,O=I*m-(D-M*T-I*T-M*m),N=c*u,g=re*c,M=g-(g-c),I=c-M,g=re*u,T=g-(g-u),m=u-T,F=I*m-(N-M*T-I*T-M*m),y=O-F,d=O-y,ce[0]=O-(y+d)+(d-F),_=D+y,d=_-D,S=D-(_-d)+(y-d),y=S-N,d=S-y,ce[1]=S-(y+d)+(d-N),h=_+y,d=h-_,ce[2]=_-(h-d)+(y-d),ce[3]=h;let k=Ve(4,st,4,ce,zs);D=p*f,g=re*p,M=g-(g-p),I=p-M,g=re*f,T=g-(g-f),m=f-T,O=I*m-(D-M*T-I*T-M*m),N=v*l,g=re*v,M=g-(g-v),I=v-M,g=re*l,T=g-(g-l),m=l-T,F=I*m-(N-M*T-I*T-M*m),y=O-F,d=O-y,ce[0]=O-(y+d)+(d-F),_=D+y,d=_-D,S=D-(_-d)+(y-d),y=S-N,d=S-y,ce[1]=S-(y+d)+(d-N),h=_+y,d=h-_,ce[2]=_-(h-d)+(y-d),ce[3]=h;let x=Ve(k,zs,4,ce,Hs);D=s*f,g=re*s,M=g-(g-s),I=s-M,g=re*f,T=g-(g-f),m=f-T,O=I*m-(D-M*T-I*T-M*m),N=c*l,g=re*c,M=g-(g-c),I=c-M,g=re*l,T=g-(g-l),m=l-T,F=I*m-(N-M*T-I*T-M*m),y=O-F,d=O-y,ce[0]=O-(y+d)+(d-F),_=D+y,d=_-D,S=D-(_-d)+(y-d),y=S-N,d=S-y,ce[1]=S-(y+d)+(d-N),h=_+y,d=h-_,ce[2]=_-(h-d)+(y-d),ce[3]=h;let C=Ve(x,Hs,4,ce,Js);return Js[C-1]}function Ht(e,t,r,n,i,a){let o=(t-a)*(r-i),s=(e-i)*(n-a),c=o-s;if(o===0||s===0||o>0!=s>0)return c;let l=Math.abs(o+s);return Math.abs(c)>=fm*l?c:-Lm(e,t,r,n,i,a,l)}var OM=(7+56*K)*K,RM=(3+28*K)*K,BM=(26+288*K)*K*K,GM=G(4),AM=G(4),NM=G(4),FM=G(4),qM=G(4),jM=G(4),VM=G(4),UM=G(4),KM=G(4),zM=G(8),HM=G(8),JM=G(8),XM=G(4),YM=G(8),$M=G(8),ZM=G(8),WM=G(12),QM=G(192),ev=G(192);var nv=(10+96*K)*K,iv=(4+48*K)*K,av=(44+576*K)*K*K,ov=G(4),sv=G(4),lv=G(4),cv=G(4),hv=G(4),dv=G(4),pv=G(4),uv=G(4),fv=G(8),gv=G(8),mv=G(8),Lv=G(8),_v=G(8),yv=G(8),bv=G(8),Mv=G(8),vv=G(8),kv=G(4),Ev=G(4),xv=G(4),wv=G(8),Pv=G(16),Cv=G(16),Iv=G(16),Tv=G(32),Dv=G(32),Sv=G(48),Ov=G(64),Rv=G(1152),Bv=G(1152);var Fv=(16+224*K)*K,qv=(5+72*K)*K,jv=(71+1408*K)*K*K,Vv=G(4),Uv=G(4),Kv=G(4),zv=G(4),Hv=G(4),Jv=G(4),Xv=G(4),Yv=G(4),$v=G(4),Zv=G(4),Wv=G(24),Qv=G(24),ek=G(24),tk=G(24),rk=G(24),nk=G(24),ik=G(24),ak=G(24),ok=G(24),sk=G(24),lk=G(1152),ck=G(1152),hk=G(1152),dk=G(1152),pk=G(1152),uk=G(2304),fk=G(2304),gk=G(3456),mk=G(5760),Lk=G(8),_k=G(8),yk=G(8),bk=G(16),Mk=G(24),vk=G(48),kk=G(48),Ek=G(96),xk=G(192),wk=G(384),Pk=G(384),Ck=G(384),Ik=G(768);var Tk=G(96),Dk=G(96),Sk=G(96),Ok=G(1152);function ym(e,t){let r=new ot([],Zs);return Mm(e,r),vm(r,t)}function Zs(e,t){return e.p.x>t.p.x?1:e.p.x<t.p.x||e.p.x===t.p.x&&(e.featureId!==t.featureId||e.ringId!==t.ringId)&&e.isLeftEndpoint&&!t.isLeftEndpoint?-1:e.p.y!==t.p.y?e.p.y>t.p.y?1:-1:1}function bm(e,t){return e.rightSweepEvent.p.x>t.rightSweepEvent.p.x?1:e.rightSweepEvent.p.x<t.rightSweepEvent.p.x?-1:e.rightSweepEvent.p.y!==t.rightSweepEvent.p.y?e.rightSweepEvent.p.y<t.rightSweepEvent.p.y?1:-1:1}function Mm(e,t){if(e.type==="FeatureCollection"){let r=e.features;for(let n=0;n<r.length;n++)Ys(r[n],t)}else Ys(e,t)}var Jt=0,Xt=0,Yt=0;function Ys(e,t){let r=e.type==="Feature"?e.geometry:e,n=r.coordinates;(r.type==="Polygon"||r.type==="MultiLineString")&&(n=[n]),r.type==="LineString"&&(n=[[n]]);for(let i=0;i<n.length;i++)for(let a=0;a<n[i].length;a++){let o=n[i][a][0],s=null;Xt=Xt+1;for(let c=0;c<n[i][a].length-1;c++){s=n[i][a][c+1];let l=new $s(o,Jt,Xt,Yt),f=new $s(s,Jt,Xt,Yt+1);l.otherEvent=f,f.otherEvent=l,Zs(l,f)>0?(f.isLeftEndpoint=!0,l.isLeftEndpoint=!1):(l.isLeftEndpoint=!0,f.isLeftEndpoint=!1),t.push(l),t.push(f),o=s,Yt=Yt+1}}Jt=Jt+1}var $s=class{constructor(e,t,r,n){this.p={x:e[0],y:e[1]},this.featureId=t,this.ringId=r,this.eventId=n,this.otherEvent=null,this.isLeftEndpoint=null}isSamePoint(e){return this.p.x===e.p.x&&this.p.y===e.p.y}asNewXY(){return[this.p.x,this.p.y]}};function vm(e,t=!1){let r=[],n=new ot([],bm);for(;e.length;){let i=e.pop();if(i.isLeftEndpoint){let a=new km(i);for(let o=0;o<n.data.length;o++){let s=n.data[o];if(t&&s.leftSweepEvent.featureId===i.featureId)continue;let c=Em(a,s);c!==!1&&r.push(c)}n.push(a)}else i.isLeftEndpoint===!1&&n.pop()}return r}var km=class{constructor(e){this.leftSweepEvent=e,this.rightSweepEvent=e.otherEvent}};function Em(e,t){if(e===null||t===null)return!1;let r=e.leftSweepEvent.p.x,n=e.leftSweepEvent.p.y,i=e.rightSweepEvent.p.x,a=e.rightSweepEvent.p.y,o=t.leftSweepEvent.p.x,s=t.leftSweepEvent.p.y,c=t.rightSweepEvent.p.x,l=t.rightSweepEvent.p.y,f=Ht(r,n,i,a,o,s),d=Ht(r,n,i,a,c,l);if(f>0&&d>0)return!1;if(f<0&&d<0)return!1;if(e.leftSweepEvent.ringId===t.leftSweepEvent.ringId){if(e.rightSweepEvent.isSamePoint(t.leftSweepEvent)||e.rightSweepEvent.isSamePoint(t.rightSweepEvent)||e.leftSweepEvent.isSamePoint(t.leftSweepEvent)||e.leftSweepEvent.isSamePoint(t.rightSweepEvent))return!1}else{if(e.rightSweepEvent.isSamePoint(t.leftSweepEvent))return t.leftSweepEvent.asNewXY();if(e.rightSweepEvent.isSamePoint(t.rightSweepEvent))return t.rightSweepEvent.asNewXY();if(e.leftSweepEvent.isSamePoint(t.leftSweepEvent))return t.leftSweepEvent.asNewXY();if(e.leftSweepEvent.isSamePoint(t.rightSweepEvent))return t.rightSweepEvent.asNewXY()}let g=(l-s)*(i-r)-(c-o)*(a-n),M=(c-o)*(n-s)-(l-s)*(r-o),I=(i-r)*(n-s)-(a-n)*(r-o);if(g===0)return!1;let T=M/g,m=I/g;if(T>=0&&T<=1&&m>=0&&m<=1){let y=r+T*(i-r),_=n+T*(a-n);return[y,_]}return!1}function Rr(e,t,r={}){let{removeDuplicates:n=!0,ignoreSelfIntersections:i=!0}=r,a=[];e.type==="FeatureCollection"?a=a.concat(e.features):e.type==="Feature"?a.push(e):(e.type==="LineString"||e.type==="Polygon"||e.type==="MultiLineString"||e.type==="MultiPolygon")&&a.push(ge(e)),t.type==="FeatureCollection"?a=a.concat(t.features):t.type==="Feature"?a.push(t):(t.type==="LineString"||t.type==="Polygon"||t.type==="MultiLineString"||t.type==="MultiPolygon")&&a.push(ge(t));let o=ym(se(a),i),s=[];if(n){let c={};o.forEach(l=>{let f=l.join(",");c[f]||(c[f]=!0,s.push(l))})}else s=o;return se(s.map(c=>xe(c)))}var Ae=Rr;var el=Te(Ws(),1);function Ct(e,t,r){if(e!==null)for(var n,i,a,o,s,c,l,f=0,d=0,g,M=e.type,I=M==="FeatureCollection",T=M==="Feature",m=I?e.features.length:1,y=0;y<m;y++){l=I?e.features[y].geometry:T?e.geometry:e,g=l?l.type==="GeometryCollection":!1,s=g?l.geometries.length:1;for(var _=0;_<s;_++){var S=0,D=0;if(o=g?l.geometries[_]:l,o!==null){c=o.coordinates;var O=o.type;switch(f=r&&(O==="Polygon"||O==="MultiPolygon")?1:0,O){case null:break;case"Point":if(t(c,d,y,S,D)===!1)return!1;d++,S++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(t(c[n],d,y,S,D)===!1)return!1;d++,O==="MultiPoint"&&S++}O==="LineString"&&S++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(i=0;i<c[n].length-f;i++){if(t(c[n][i],d,y,S,D)===!1)return!1;d++}O==="MultiLineString"&&S++,O==="Polygon"&&D++}O==="Polygon"&&S++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(D=0,i=0;i<c[n].length;i++){for(a=0;a<c[n][i].length-f;a++){if(t(c[n][i][a],d,y,S,D)===!1)return!1;d++}D++}S++}break;case"GeometryCollection":for(n=0;n<o.geometries.length;n++)if(Ct(o.geometries[n],t,r)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function lt(e,t){if(e.type==="Feature")t(e,0);else if(e.type==="FeatureCollection")for(var r=0;r<e.features.length&&t(e.features[r],r)!==!1;r++);}function Qs(e,t,r){var n=r;return lt(e,function(i,a){a===0&&r===void 0?n=i:n=t(n,i,a)}),n}function xm(e,t){var r,n,i,a,o,s,c,l,f,d,g=0,M=e.type==="FeatureCollection",I=e.type==="Feature",T=M?e.features.length:1;for(r=0;r<T;r++){for(s=M?e.features[r].geometry:I?e.geometry:e,l=M?e.features[r].properties:I?e.properties:{},f=M?e.features[r].bbox:I?e.bbox:void 0,d=M?e.features[r].id:I?e.id:void 0,c=s?s.type==="GeometryCollection":!1,o=c?s.geometries.length:1,i=0;i<o;i++){if(a=c?s.geometries[i]:s,a===null){if(t(null,g,l,f,d)===!1)return!1;continue}switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(a,g,l,f,d)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<a.geometries.length;n++)if(t(a.geometries[n],g,l,f,d)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}g++}}function ct(e,t){xm(e,function(r,n,i,a,o){var s=r===null?null:r.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return t(ge(r,i,{bbox:a,id:o}),n,0)===!1?!1:void 0}var c;switch(s){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var l=0;l<r.coordinates.length;l++){var f=r.coordinates[l],d={type:c,coordinates:f};if(t(ge(d,i),n,l)===!1)return!1}})}function pe(e,t={}){if(e.bbox!=null&&t.recompute!==!0)return e.bbox;let r=[1/0,1/0,-1/0,-1/0];return Ct(e,n=>{r[0]>n[0]&&(r[0]=n[0]),r[1]>n[1]&&(r[1]=n[1]),r[2]<n[0]&&(r[2]=n[0]),r[3]<n[1]&&(r[3]=n[1])}),r}function Ar(e){var t;if(e.bbox)t=e.bbox;else if(Array.isArray(e)&&e.length===4)t=e;else if(Array.isArray(e)&&e.length===6)t=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")t=pe(e);else if(e.type==="FeatureCollection")t=pe(e);else throw new Error("invalid geojson");return{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}}var wm=class{constructor(e=9){this.tree=new el.default(e),this.tree.toBBox=Ar}insert(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:pe(e),this.tree.insert(e),this}load(e){var t=[];return Array.isArray(e)?e.forEach(function(r){if(r.type!=="Feature")throw new Error("invalid features");r.bbox=r.bbox?r.bbox:pe(r),t.push(r)}):lt(e,function(r){if(r.type!=="Feature")throw new Error("invalid features");r.bbox=r.bbox?r.bbox:pe(r),t.push(r)}),this.tree.load(t),this}remove(e,t){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:pe(e),this.tree.remove(e,t),this}clear(){return this.tree.clear(),this}search(e){var t=this.tree.search(Ar(e));return se(t)}collides(e){return this.tree.collides(Ar(e))}all(){let e=this.tree.all();return se(e)}toJSON(){return this.tree.toJSON()}fromJSON(e){return this.tree.fromJSON(e),this}};function Nr(e){return new wm(e)}function tl(e,t){if(t=t??{},!Or(t))throw new Error("options is invalid");var r=t.precision,n=t.coordinates,i=t.mutate;if(r=r==null||isNaN(r)?6:r,n=n==null||isNaN(n)?3:n,!e)throw new Error("<geojson> is required");if(typeof r!="number")throw new Error("<precision> must be a number");if(typeof n!="number")throw new Error("<coordinates> must be a number");(i===!1||i===void 0)&&(e=JSON.parse(JSON.stringify(e)));var a=Math.pow(10,r);return Ct(e,function(o){Pm(o,a,n)}),e}function Pm(e,t,r){e.length>r&&e.splice(r,e.length);for(var n=0;n<e.length;n++)e[n]=Math.round(e[n]*t)/t;return e}function he(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if(e.type==="Feature"&&e.geometry!==null&&e.geometry.type==="Point")return[...e.geometry.coordinates];if(e.type==="Point")return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Me(e){if(Array.isArray(e))return e;if(e.type==="Feature"){if(e.geometry!==null)return e.geometry.coordinates}else if(e.coordinates)return e.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function Ue(e){return e.type==="Feature"?e.geometry:e}function Fr(e,t){return e.type==="FeatureCollection"?"FeatureCollection":e.type==="GeometryCollection"?"GeometryCollection":e.type==="Feature"&&e.geometry!==null?e.geometry.type:e.type}function rl(e){if(!e)throw new Error("geojson is required");let t=[];return ct(e,r=>{Cm(r,t)}),se(t)}function Cm(e,t){let r=[],n=e.geometry;if(n!==null){switch(n.type){case"Polygon":r=Me(n);break;case"LineString":r=[Me(n)]}r.forEach(i=>{Im(i,e.properties).forEach(o=>{o.id=t.length,t.push(o)})})}}function Im(e,t){let r=[];return e.reduce((n,i)=>{let a=Be([n,i],t);return a.bbox=Tm(n,i),r.push(a),i}),r}function Tm(e,t){let r=e[0],n=e[1],i=t[0],a=t[1],o=r<i?r:i,s=n<a?n:a,c=r>i?r:i,l=n>a?n:a;return[o,s,c,l]}function $t(e,t,r={}){var n=he(e),i=he(t),a=Ge(i[1]-n[1]),o=Ge(i[0]-n[0]),s=Ge(n[1]),c=Ge(i[1]),l=Math.pow(Math.sin(a/2),2)+Math.pow(Math.sin(o/2),2)*Math.cos(s)*Math.cos(c);return Ks(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),r.units)}var Dm=Object.defineProperty,Sm=Object.defineProperties,Om=Object.getOwnPropertyDescriptors,nl=Object.getOwnPropertySymbols,Rm=Object.prototype.hasOwnProperty,Bm=Object.prototype.propertyIsEnumerable,il=(e,t,r)=>t in e?Dm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Gm=(e,t)=>{for(var r in t||(t={}))Rm.call(t,r)&&il(e,r,t[r]);if(nl)for(var r of nl(t))Bm.call(t,r)&&il(e,r,t[r]);return e},Am=(e,t)=>Sm(e,Om(t));function ol(e,t,r={}){if(!e||!t)throw new Error("lines and inputPoint are required arguments");let n=he(t),i=xe([1/0,1/0],{lineStringIndex:-1,segmentIndex:-1,totalDistance:-1,lineDistance:-1,segmentDistance:-1,pointDistance:1/0,multiFeatureIndex:-1,index:-1,location:-1,dist:1/0}),a=0,o=0,s=-1;return ct(e,function(c,l,f){s!==f&&(s=f,o=0);let d=Me(c);for(let g=0;g<d.length-1;g++){let M=xe(d[g]),I=he(M),T=xe(d[g+1]),m=he(T),y=$t(M,T,r),_,S;m[0]===n[0]&&m[1]===n[1]?[_,S]=[m,!0]:I[0]===n[0]&&I[1]===n[1]?[_,S]=[I,!1]:[_,S]=qm(I,m,n);let D=$t(t,_,r);if(D<i.properties.pointDistance){let O=$t(M,_,r);i=xe(_,{lineStringIndex:f,segmentIndex:S?g+1:g,totalDistance:a+O,lineDistance:o+O,segmentDistance:O,pointDistance:D,multiFeatureIndex:-1,index:-1,location:-1,dist:1/0}),i.properties=Am(Gm({},i.properties),{multiFeatureIndex:i.properties.lineStringIndex,index:i.properties.segmentIndex,location:i.properties.totalDistance,dist:i.properties.pointDistance})}a+=y,o+=y}}),i}function Ke(e,t){let[r,n,i]=e,[a,o,s]=t;return r*a+n*o+i*s}function It(e,t){let[r,n,i]=e,[a,o,s]=t;return[n*s-i*o,i*a-r*s,r*o-n*a]}function Nm(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2)+Math.pow(e[2],2))}function al(e){let t=Nm(e);return[e[0]/t,e[1]/t,e[2]/t]}function qr(e){let t=Ge(e[1]),r=Ge(e[0]);return[Math.cos(t)*Math.cos(r),Math.cos(t)*Math.sin(r),Math.sin(t)]}function Fm(e){let[t,r,n]=e,i=Math.min(Math.max(n,-1),1),a=Sr(Math.asin(i));return[Sr(Math.atan2(r,t)),a]}function qm(e,t,r){let n=qr(e),i=qr(t),a=qr(r),o=It(n,i);if(o[0]===0&&o[1]===0&&o[2]===0)return Ke(n,i)>0?[[...t],!0]:[[...r],!1];let s=It(o,a);if(s[0]===0&&s[1]===0&&s[2]===0)return[[...t],!0];let c=It(s,o),l=al(c),f=[-l[0],-l[1],-l[2]],d=Ke(a,l)>Ke(a,f)?l:f,g=al(o),M=Ke(It(n,d),g),I=Ke(It(d,i),g);return M>=0&&I>=0?[Fm(d),!1]:Ke(n,a)>Ke(i,a)?[[...e],!1]:[[...t],!0]}function Ur(e,t){if(!e)throw new Error("line is required");if(!t)throw new Error("splitter is required");let r=Fr(e),n=Fr(t);if(r!=="LineString")throw new Error("line must be LineString");if(n==="FeatureCollection")throw new Error("splitter cannot be a FeatureCollection");if(n==="GeometryCollection")throw new Error("splitter cannot be a GeometryCollection");var i=tl(t,{precision:7});switch(e.type!=="Feature"&&(e=ge(e)),n){case"Point":return Vr(e,i);case"MultiPoint":return sl(e,i);case"LineString":case"MultiLineString":case"Polygon":case"MultiPolygon":return sl(e,Rr(e,i,{ignoreSelfIntersections:!0}))}}function sl(e,t){var r=[],n=Nr();return ct(t,function(i){if(r.forEach(function(s,c){s.id=c}),!r.length)r=Vr(e,i).features,n.load(se(r));else{var a=n.search(i);if(a.features.length){var o=ll(i,a);r=r.filter(function(s){return s.id!==o.id}),n.remove(o),lt(Vr(o,i),function(s){r.push(s),n.insert(s)})}}}),se(r)}function Vr(e,t){var r=[],n=Me(e)[0],i=Me(e)[e.geometry.coordinates.length-1];if(jr(n,he(t))||jr(i,he(t)))return se([e]);var a=Nr(),o=rl(e);a.load(o);var s=a.search(t);if(!s.features.length)return se([e]);var c=ll(t,s),l=[n],f=Qs(o,function(d,g,M){var I=Me(g)[1],T=he(t);return M===c.id?(d.push(T),r.push(Be(d)),jr(T,I)?[T]:[T,I]):(d.push(I),d)},l);return f.length>1&&r.push(Be(f)),se(r)}function ll(e,t){if(!t.features.length)throw new Error("lines must contain features");if(t.features.length===1)return t.features[0];var r,n=1/0;return lt(t,function(i){var a=ol(i,e),o=a.properties.pointDistance;o<n&&(r=i,n=o)}),r}function jr(e,t){return e[0]===t[0]&&e[1]===t[1]}var cl=Ur;var z=11102230246251565e-32,ne=134217729,Tt=(3+8*z)*z;function ze(e,t,r,n,i){let a,o,s,c,l=t[0],f=n[0],d=0,g=0;f>l==f>-l?(a=l,l=t[++d]):(a=f,f=n[++g]);let M=0;if(d<e&&g<r)for(f>l==f>-l?(o=l+a,s=a-(o-l),l=t[++d]):(o=f+a,s=a-(o-f),f=n[++g]),a=o,s!==0&&(i[M++]=s);d<e&&g<r;)f>l==f>-l?(o=a+l,c=o-a,s=a-(o-c)+(l-c),l=t[++d]):(o=a+f,c=o-a,s=a-(o-c)+(f-c),f=n[++g]),a=o,s!==0&&(i[M++]=s);for(;d<e;)o=a+l,c=o-a,s=a-(o-c)+(l-c),l=t[++d],a=o,s!==0&&(i[M++]=s);for(;g<r;)o=a+f,c=o-a,s=a-(o-c)+(f-c),f=n[++g],a=o,s!==0&&(i[M++]=s);return(a!==0||M===0)&&(i[M++]=a),M}function Dt(e,t){let r=t[0];for(let n=1;n<e;n++)r+=t[n];return r}function A(e){return new Float64Array(e)}var jm=(3+16*z)*z,Vm=(2+12*z)*z,Um=(9+64*z)*z*z,ht=A(4),hl=A(8),dl=A(12),pl=A(16),de=A(4);function Km(e,t,r,n,i,a,o){let s,c,l,f,d,g,M,I,T,m,y,_,S,D,O,N,F,h,p=e-i,u=r-i,v=t-a,b=n-a;D=p*b,g=ne*p,M=g-(g-p),I=p-M,g=ne*b,T=g-(g-b),m=b-T,O=I*m-(D-M*T-I*T-M*m),N=v*u,g=ne*v,M=g-(g-v),I=v-M,g=ne*u,T=g-(g-u),m=u-T,F=I*m-(N-M*T-I*T-M*m),y=O-F,d=O-y,ht[0]=O-(y+d)+(d-F),_=D+y,d=_-D,S=D-(_-d)+(y-d),y=S-N,d=S-y,ht[1]=S-(y+d)+(d-N),h=_+y,d=h-_,ht[2]=_-(h-d)+(y-d),ht[3]=h;let E=Dt(4,ht),w=Vm*o;if(E>=w||-E>=w||(d=e-p,s=e-(p+d)+(d-i),d=r-u,l=r-(u+d)+(d-i),d=t-v,c=t-(v+d)+(d-a),d=n-b,f=n-(b+d)+(d-a),s===0&&c===0&&l===0&&f===0)||(w=Um*o+Tt*Math.abs(E),E+=p*f+b*s-(v*l+u*c),E>=w||-E>=w))return E;D=s*b,g=ne*s,M=g-(g-s),I=s-M,g=ne*b,T=g-(g-b),m=b-T,O=I*m-(D-M*T-I*T-M*m),N=c*u,g=ne*c,M=g-(g-c),I=c-M,g=ne*u,T=g-(g-u),m=u-T,F=I*m-(N-M*T-I*T-M*m),y=O-F,d=O-y,de[0]=O-(y+d)+(d-F),_=D+y,d=_-D,S=D-(_-d)+(y-d),y=S-N,d=S-y,de[1]=S-(y+d)+(d-N),h=_+y,d=h-_,de[2]=_-(h-d)+(y-d),de[3]=h;let k=ze(4,ht,4,de,hl);D=p*f,g=ne*p,M=g-(g-p),I=p-M,g=ne*f,T=g-(g-f),m=f-T,O=I*m-(D-M*T-I*T-M*m),N=v*l,g=ne*v,M=g-(g-v),I=v-M,g=ne*l,T=g-(g-l),m=l-T,F=I*m-(N-M*T-I*T-M*m),y=O-F,d=O-y,de[0]=O-(y+d)+(d-F),_=D+y,d=_-D,S=D-(_-d)+(y-d),y=S-N,d=S-y,de[1]=S-(y+d)+(d-N),h=_+y,d=h-_,de[2]=_-(h-d)+(y-d),de[3]=h;let x=ze(k,hl,4,de,dl);D=s*f,g=ne*s,M=g-(g-s),I=s-M,g=ne*f,T=g-(g-f),m=f-T,O=I*m-(D-M*T-I*T-M*m),N=c*l,g=ne*c,M=g-(g-c),I=c-M,g=ne*l,T=g-(g-l),m=l-T,F=I*m-(N-M*T-I*T-M*m),y=O-F,d=O-y,de[0]=O-(y+d)+(d-F),_=D+y,d=_-D,S=D-(_-d)+(y-d),y=S-N,d=S-y,de[1]=S-(y+d)+(d-N),h=_+y,d=h-_,de[2]=_-(h-d)+(y-d),de[3]=h;let C=ze(x,dl,4,de,pl);return pl[C-1]}function Kr(e,t,r,n,i,a){let o=(t-a)*(r-i),s=(e-i)*(n-a),c=o-s,l=Math.abs(o+s);return Math.abs(c)>=jm*l?c:-Km(e,t,r,n,i,a,l)}var AE=(7+56*z)*z,NE=(3+28*z)*z,FE=(26+288*z)*z*z,qE=A(4),jE=A(4),VE=A(4),UE=A(4),KE=A(4),zE=A(4),HE=A(4),JE=A(4),XE=A(4),YE=A(8),$E=A(8),ZE=A(8),WE=A(4),QE=A(8),ex=A(8),tx=A(16),rx=A(12),nx=A(192),ix=A(192);var sx=(10+96*z)*z,lx=(4+48*z)*z,cx=(44+576*z)*z*z,hx=A(4),dx=A(4),px=A(4),ux=A(4),fx=A(4),gx=A(4),mx=A(4),Lx=A(4),_x=A(8),yx=A(8),bx=A(8),Mx=A(8),vx=A(8),kx=A(8),Ex=A(8),xx=A(8),wx=A(8),Px=A(4),Cx=A(4),Ix=A(4),Tx=A(8),Dx=A(16),Sx=A(16),Ox=A(16),Rx=A(32),Bx=A(32),Gx=A(48),Ax=A(64),Nx=A(1152),Fx=A(1152);var Ux=(16+224*z)*z,Kx=(5+72*z)*z,zx=(71+1408*z)*z*z,Hx=A(4),Jx=A(4),Xx=A(4),Yx=A(4),$x=A(4),Zx=A(4),Wx=A(4),Qx=A(4),e0=A(4),t0=A(4),r0=A(24),n0=A(24),i0=A(24),a0=A(24),o0=A(24),s0=A(24),l0=A(24),c0=A(24),h0=A(24),d0=A(24),p0=A(1152),u0=A(1152),f0=A(1152),g0=A(1152),m0=A(1152),L0=A(2304),_0=A(2304),y0=A(3456),b0=A(5760),M0=A(8),v0=A(8),k0=A(8),E0=A(16),x0=A(24),w0=A(48),P0=A(48),C0=A(96),I0=A(192),T0=A(384),D0=A(384),S0=A(384),O0=A(768);var R0=A(96),B0=A(96),G0=A(96),A0=A(1152);function fl(e,t){var r,n,i=0,a,o,s,c,l,f,d,g=e[0],M=e[1],I=t.length;for(r=0;r<I;r++){n=0;var T=t[r],m=T.length-1;if(f=T[0],f[0]!==T[m][0]&&f[1]!==T[m][1])throw new Error("First and last coordinates in a ring must be the same");for(o=f[0]-g,s=f[1]-M,n;n<m;n++){if(d=T[n+1],c=d[0]-g,l=d[1]-M,s===0&&l===0){if(c<=0&&o>=0||o<=0&&c>=0)return 0}else if(l>=0&&s<=0||l<=0&&s>=0){if(a=Kr(o,c,s,l,0,0),a===0)return 0;(a>0&&l>0&&s<=0||a<0&&l<=0&&s>0)&&i++}f=d,s=l,o=c}}return i%2!==0}function me(e,t,r={}){if(!e)throw new Error("point is required");if(!t)throw new Error("polygon is required");let n=he(e),i=Ue(t),a=i.type,o=t.bbox,s=i.coordinates;if(o&&Hm(n,o)===!1)return!1;a==="Polygon"&&(s=[s]);for(var c=0;c<s.length;++c){let l=fl(n,s[c]);if(l===0&&!r.ignoreBoundary)return!0;if(l)return!0}return!1}function Hm(e,t){return t[0]<=e[0]&&t[1]<=e[1]&&t[2]>=e[0]&&t[3]>=e[1]}function He(e,t,r={}){let n=he(e),i=Me(t);for(let a=0;a<i.length-1;a++){let o=!1;if(r.ignoreEndVertices&&(a===0&&(o="start"),a===i.length-2&&(o="end"),a===0&&a+1===i.length-1&&(o="both")),Jm(i[a],i[a+1],n,o,typeof r.epsilon>"u"?null:r.epsilon))return!0}return!1}function Jm(e,t,r,n,i){let a=r[0],o=r[1],s=e[0],c=e[1],l=t[0],f=t[1],d=r[0]-s,g=r[1]-c,M=l-s,I=f-c,T=d*I-g*M;if(i!==null){if(Math.abs(T)>i)return!1}else if(T!==0)return!1;if(Math.abs(M)===Math.abs(I)&&Math.abs(M)===0)return n?!1:r[0]===e[0]&&r[1]===e[1];if(n){if(n==="start")return Math.abs(M)>=Math.abs(I)?M>0?s<a&&a<=l:l<=a&&a<s:I>0?c<o&&o<=f:f<=o&&o<c;if(n==="end")return Math.abs(M)>=Math.abs(I)?M>0?s<=a&&a<l:l<a&&a<=s:I>0?c<=o&&o<f:f<o&&o<=c;if(n==="both")return Math.abs(M)>=Math.abs(I)?M>0?s<a&&a<l:l<a&&a<s:I>0?c<o&&o<f:f<o&&o<c}else return Math.abs(M)>=Math.abs(I)?M>0?s<=a&&a<=l:l<=a&&a<=s:I>0?c<=o&&o<=f:f<=o&&o<=c;return!1}function Xm(e,t){let r=Ue(e),n=Ue(t),i=r.type,a=n.type,o=r.coordinates,s=n.coordinates;switch(i){case"Point":if(a==="Point")return zr(o,s);throw new Error("feature2 "+a+" geometry not supported");case"MultiPoint":switch(a){case"Point":return rL(r,n);case"MultiPoint":return nL(r,n);default:throw new Error("feature2 "+a+" geometry not supported")}case"LineString":switch(a){case"Point":return He(n,r,{ignoreEndVertices:!0});case"LineString":return oL(r,n);case"MultiPoint":return iL(r,n);default:throw new Error("feature2 "+a+" geometry not supported")}case"Polygon":switch(a){case"Point":return me(n,r,{ignoreBoundary:!0});case"LineString":return ml(r,n);case"Polygon":return Zt(r,n);case"MultiPoint":return aL(r,n);case"MultiPolygon":return tL(r,n);default:throw new Error("feature2 "+a+" geometry not supported")}case"MultiPolygon":switch(a){case"Point":return $m(r,n);case"MultiPoint":return Zm(r,n);case"LineString":return Wm(r,n);case"MultiLineString":return Qm(r,n);case"Polygon":return Ym(r,n);case"MultiPolygon":return eL(r,n);default:throw new Error("feature2 "+a+" geometry not supported")}default:throw new Error("feature1 "+i+" geometry not supported")}}function Ym(e,t){let r=pe(t);return e.coordinates.some(n=>Zt({type:"Polygon",coordinates:n},t,r))}function $m(e,t){return me(t,e,{ignoreBoundary:!0})}function Zm(e,t){let r=!1;for(let n of t.coordinates){if(!me(n,e))return!1;r||(r=me(n,e,{ignoreBoundary:!0}))}return r}function Wm(e,t){return e.coordinates.some(r=>ml({type:"Polygon",coordinates:r},t))}function Qm(e,t){let r=!1;for(let n of t.coordinates){let i={type:"LineString",coordinates:n},a="outside";for(let o of e.coordinates){let s=Ll({type:"Polygon",coordinates:o},i);if(s==="interior"){a=s;break}s==="boundary"&&(a=s)}if(a==="outside")return!1;a==="interior"&&(r=!0)}return r}function eL(e,t){for(let r of t.coordinates){let n={type:"Polygon",coordinates:r},i=pe(n);if(!e.coordinates.some(o=>Zt({type:"Polygon",coordinates:o},n,i)))return!1}return!0}function tL(e,t){return t.coordinates.every(r=>Zt(e,{type:"Polygon",coordinates:r}))}function rL(e,t){let r,n=!1;for(r=0;r<e.coordinates.length;r++)if(zr(e.coordinates[r],t.coordinates)){n=!0;break}return n}function nL(e,t){for(let r of t.coordinates){let n=!1;for(let i of e.coordinates)if(zr(r,i)){n=!0;break}if(!n)return!1}return!0}function iL(e,t){let r=!1;for(let n of t.coordinates){if(!He(n,e))return!1;!r&&He(n,e,{ignoreEndVertices:!0})&&(r=!0)}return r}function aL(e,t){let r=!1;for(let n of t.coordinates){if(!me(n,e))return!1;r||(r=me(n,e,{ignoreBoundary:!0}))}return r}function oL(e,t){let r=!1,n=t.coordinates;for(let i=0;i<n.length;i++){let a=n[i];if(!He(a,e))return!1;if(!r){if(He(a,e,{ignoreEndVertices:!0}))r=!0;else if(i>0){let o=[(n[i-1][0]+a[0])/2,(n[i-1][1]+a[1])/2];He(o,e,{ignoreEndVertices:!0})&&(r=!0)}}}return r}function gl(e,t){let r=e.coordinates,n=[];for(let i=0;i<r.length-1;i++){let a=Be([r[i],r[i+1]]),o=Ur(a,ge(t));o.features.length===0?n.push(a):n.push(...o.features)}return se(n)}function ml(e,t){return Ll(e,t)==="interior"}function Ll(e,t){let r=pe(e),n=pe(t);if(!_l(r,n))return"outside";for(let o of t.coordinates)if(!me(o,e))return"outside";let i=!1,a=gl(t,e);for(let o of a.features){let s=yl(o.geometry.coordinates[0],o.geometry.coordinates[1]);if(!me(s,e))return"outside";!i&&me(s,e,{ignoreBoundary:!0})&&(i=!0)}return i?"interior":"boundary"}function Zt(e,t,r){if(e.type==="Feature"&&e.geometry===null||t.type==="Feature"&&t.geometry===null)return!1;let n=pe(e),i=r??pe(t);if(!_l(n,i))return!1;let a=Ue(e),o=Ue(t).coordinates;for(let s of o){for(let l of s)if(!me(l,e))return!1;let c=gl({type:"LineString",coordinates:s},a);for(let l of c.features){let f=yl(l.geometry.coordinates[0],l.geometry.coordinates[1]);if(!me(f,e)&&!cL(f,a))return!1}}return!0}var sL=1e-6;function lL(e,t,r){let n=r[0]-t[0],i=r[1]-t[1],a=n*n+i*i,o=0;a>0&&(o=((e[0]-t[0])*n+(e[1]-t[1])*i)/a,o=Math.max(0,Math.min(1,o)));let s=t[0]+o*n,c=t[1]+o*i,l=e[0]-s,f=e[1]-c;return Math.sqrt(l*l+f*f)}function cL(e,t){return t.coordinates.some(r=>{for(let n=0;n<r.length-1;n++)if(lL(e,r[n],r[n+1])<=sL)return!0;return!1})}function _l(e,t){return!(e[0]>t[0]||e[2]<t[2]||e[1]>t[1]||e[3]<t[3])}function zr(e,t){return e[0]===t[0]&&e[1]===t[1]}function yl(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]}var bl=Xm;var Vl=Te(vt());var hL=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Hr=Math.ceil,_e=Math.floor,ue="[BigNumber Error] ",Ml=ue+"Number primitive has more than 15 significant digits: ",ve=1e14,U=14,Jr=9007199254740991,Xr=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ne=1e7,ae=1e9;function vl(e){var t,r,n,i=_.prototype={constructor:_,toString:null,valueOf:null},a=new _(1),o=20,s=4,c=-7,l=21,f=-1e7,d=1e7,g=!1,M=1,I=0,T={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},m="0123456789abcdefghijklmnopqrstuvwxyz",y=!0;function _(h,p){var u,v,b,E,w,k,x,C,P=this;if(!(P instanceof _))return new _(h,p);if(p==null){if(h&&h._isBigNumber===!0){P.s=h.s,!h.c||h.e>d?P.c=P.e=null:h.e<f?P.c=[P.e=0]:(P.e=h.e,P.c=h.c.slice());return}if((k=typeof h=="number")&&h*0==0){if(P.s=1/h<0?(h=-h,-1):1,h===~~h){for(E=0,w=h;w>=10;w/=10,E++);E>d?P.c=P.e=null:(P.e=E,P.c=[h]);return}C=String(h)}else{if(!hL.test(C=String(h)))return n(P,C,k);P.s=C.charCodeAt(0)==45?(C=C.slice(1),-1):1}(E=C.indexOf("."))>-1&&(C=C.replace(".","")),(w=C.search(/e/i))>0?(E<0&&(E=w),E+=+C.slice(w+1),C=C.substring(0,w)):E<0&&(E=C.length)}else{if(W(p,2,m.length,"Base"),p==10&&y)return P=new _(h),N(P,o+P.e+1,s);if(C=String(h),k=typeof h=="number"){if(h*0!=0)return n(P,C,k,p);if(P.s=1/h<0?(C=C.slice(1),-1):1,_.DEBUG&&C.replace(/^0\.0*|\./,"").length>15)throw Error(Ml+h)}else P.s=C.charCodeAt(0)===45?(C=C.slice(1),-1):1;for(u=m.slice(0,p),E=w=0,x=C.length;w<x;w++)if(u.indexOf(v=C.charAt(w))<0){if(v=="."){if(w>E){E=x;continue}}else if(!b&&(C==C.toUpperCase()&&(C=C.toLowerCase())||C==C.toLowerCase()&&(C=C.toUpperCase()))){b=!0,w=-1,E=0;continue}return n(P,String(h),k,p)}k=!1,C=r(C,p,10,P.s),(E=C.indexOf("."))>-1?C=C.replace(".",""):E=C.length}for(w=0;C.charCodeAt(w)===48;w++);for(x=C.length;C.charCodeAt(--x)===48;);if(C=C.slice(w,++x)){if(x-=w,k&&_.DEBUG&&x>15&&(h>Jr||h!==_e(h)))throw Error(Ml+P.s*h);if((E=E-w-1)>d)P.c=P.e=null;else if(E<f)P.c=[P.e=0];else{if(P.e=E,P.c=[],w=(E+1)%U,E<0&&(w+=U),w<x){for(w&&P.c.push(+C.slice(0,w)),x-=U;w<x;)P.c.push(+C.slice(w,w+=U));w=U-(C=C.slice(w)).length}else w-=x;for(;w--;C+="0");P.c.push(+C)}}else P.c=[P.e=0]}_.clone=vl,_.ROUND_UP=0,_.ROUND_DOWN=1,_.ROUND_CEIL=2,_.ROUND_FLOOR=3,_.ROUND_HALF_UP=4,_.ROUND_HALF_DOWN=5,_.ROUND_HALF_EVEN=6,_.ROUND_HALF_CEIL=7,_.ROUND_HALF_FLOOR=8,_.EUCLID=9,_.config=_.set=function(h){var p,u;if(h!=null)if(typeof h=="object"){if(h.hasOwnProperty(p="DECIMAL_PLACES")&&(u=h[p],W(u,0,ae,p),o=u),h.hasOwnProperty(p="ROUNDING_MODE")&&(u=h[p],W(u,0,8,p),s=u),h.hasOwnProperty(p="EXPONENTIAL_AT")&&(u=h[p],u&&u.pop?(W(u[0],-ae,0,p),W(u[1],0,ae,p),c=u[0],l=u[1]):(W(u,-ae,ae,p),c=-(l=u<0?-u:u))),h.hasOwnProperty(p="RANGE"))if(u=h[p],u&&u.pop)W(u[0],-ae,-1,p),W(u[1],1,ae,p),f=u[0],d=u[1];else if(W(u,-ae,ae,p),u)f=-(d=u<0?-u:u);else throw Error(ue+p+" cannot be zero: "+u);if(h.hasOwnProperty(p="CRYPTO"))if(u=h[p],u===!!u)if(u)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))g=u;else throw g=!u,Error(ue+"crypto unavailable");else g=u;else throw Error(ue+p+" not true or false: "+u);if(h.hasOwnProperty(p="MODULO_MODE")&&(u=h[p],W(u,0,9,p),M=u),h.hasOwnProperty(p="POW_PRECISION")&&(u=h[p],W(u,0,ae,p),I=u),h.hasOwnProperty(p="FORMAT"))if(u=h[p],typeof u=="object")T=u;else throw Error(ue+p+" not an object: "+u);if(h.hasOwnProperty(p="ALPHABET"))if(u=h[p],typeof u=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(u))y=u.slice(0,10)=="0123456789",m=u;else throw Error(ue+p+" invalid: "+u)}else throw Error(ue+"Object expected: "+h);return{DECIMAL_PLACES:o,ROUNDING_MODE:s,EXPONENTIAL_AT:[c,l],RANGE:[f,d],CRYPTO:g,MODULO_MODE:M,POW_PRECISION:I,FORMAT:T,ALPHABET:m}},_.isBigNumber=function(h){if(!h||h._isBigNumber!==!0)return!1;if(!_.DEBUG)return!0;var p,u,v=h.c,b=h.e,E=h.s;e:if({}.toString.call(v)=="[object Array]"){if((E===1||E===-1)&&b>=-ae&&b<=ae&&b===_e(b)){if(v[0]===0){if(b===0&&v.length===1)return!0;break e}if(p=(b+1)%U,p<1&&(p+=U),String(v[0]).length==p){for(p=0;p<v.length;p++)if(u=v[p],u<0||u>=ve||u!==_e(u))break e;if(u!==0)return!0}}}else if(v===null&&b===null&&(E===null||E===1||E===-1))return!0;throw Error(ue+"Invalid BigNumber: "+h)},_.maximum=_.max=function(){return D(arguments,-1)},_.minimum=_.min=function(){return D(arguments,1)},_.random=(function(){var h=9007199254740992,p=Math.random()*h&2097151?function(){return _e(Math.random()*h)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(u){var v,b,E,w,k,x=0,C=[],P=new _(a);if(u==null?u=o:W(u,0,ae),w=Hr(u/U),g)if(crypto.getRandomValues){for(v=crypto.getRandomValues(new Uint32Array(w*=2));x<w;)k=v[x]*131072+(v[x+1]>>>11),k>=9e15?(b=crypto.getRandomValues(new Uint32Array(2)),v[x]=b[0],v[x+1]=b[1]):(C.push(k%1e14),x+=2);x=w/2}else if(crypto.randomBytes){for(v=crypto.randomBytes(w*=7);x<w;)k=(v[x]&31)*281474976710656+v[x+1]*1099511627776+v[x+2]*4294967296+v[x+3]*16777216+(v[x+4]<<16)+(v[x+5]<<8)+v[x+6],k>=9e15?crypto.randomBytes(7).copy(v,x):(C.push(k%1e14),x+=7);x=w/7}else throw g=!1,Error(ue+"crypto unavailable");if(!g)for(;x<w;)k=p(),k<9e15&&(C[x++]=k%1e14);for(w=C[--x],u%=U,w&&u&&(k=Xr[U-u],C[x]=_e(w/k)*k);C[x]===0;C.pop(),x--);if(x<0)C=[E=0];else{for(E=-1;C[0]===0;C.splice(0,1),E-=U);for(x=1,k=C[0];k>=10;k/=10,x++);x<U&&(E-=U-x)}return P.e=E,P.c=C,P}})(),_.sum=function(){for(var h=1,p=arguments,u=new _(p[0]);h<p.length;)u=u.plus(p[h++]);return u},r=(function(){var h="0123456789";function p(u,v,b,E){for(var w,k=[0],x,C=0,P=u.length;C<P;){for(x=k.length;x--;k[x]*=v);for(k[0]+=E.indexOf(u.charAt(C++)),w=0;w<k.length;w++)k[w]>b-1&&(k[w+1]==null&&(k[w+1]=0),k[w+1]+=k[w]/b|0,k[w]%=b)}return k.reverse()}return function(u,v,b,E,w){var k,x,C,P,R,q,j,J,Q=u.indexOf("."),ie=o,H=s;for(Q>=0&&(P=I,I=0,u=u.replace(".",""),J=new _(v),q=J.pow(u.length-Q),I=P,J.c=p(Pe(Le(q.c),q.e,"0"),10,b,h),J.e=J.c.length),j=p(u,v,b,w?(k=m,h):(k=h,m)),C=P=j.length;j[--P]==0;j.pop());if(!j[0])return k.charAt(0);if(Q<0?--C:(q.c=j,q.e=C,q.s=E,q=t(q,J,ie,H,b),j=q.c,R=q.r,C=q.e),x=C+ie+1,Q=j[x],P=b/2,R=R||x<0||j[x+1]!=null,R=H<4?(Q!=null||R)&&(H==0||H==(q.s<0?3:2)):Q>P||Q==P&&(H==4||R||H==6&&j[x-1]&1||H==(q.s<0?8:7)),x<1||!j[0])u=R?Pe(k.charAt(1),-ie,k.charAt(0)):k.charAt(0);else{if(j.length=x,R)for(--b;++j[--x]>b;)j[x]=0,x||(++C,j=[1].concat(j));for(P=j.length;!j[--P];);for(Q=0,u="";Q<=P;u+=k.charAt(j[Q++]));u=Pe(u,C,k.charAt(0))}return u}})(),t=(function(){function h(v,b,E){var w,k,x,C,P=0,R=v.length,q=b%Ne,j=b/Ne|0;for(v=v.slice();R--;)x=v[R]%Ne,C=v[R]/Ne|0,w=j*x+C*q,k=q*x+w%Ne*Ne+P,P=(k/E|0)+(w/Ne|0)+j*C,v[R]=k%E;return P&&(v=[P].concat(v)),v}function p(v,b,E,w){var k,x;if(E!=w)x=E>w?1:-1;else for(k=x=0;k<E;k++)if(v[k]!=b[k]){x=v[k]>b[k]?1:-1;break}return x}function u(v,b,E,w){for(var k=0;E--;)v[E]-=k,k=v[E]<b[E]?1:0,v[E]=k*w+v[E]-b[E];for(;!v[0]&&v.length>1;v.splice(0,1));}return function(v,b,E,w,k){var x,C,P,R,q,j,J,Q,ie,H,X,oe,At,sr,lr,ke,dt,fe=v.s==b.s?1:-1,le=v.c,ee=b.c;if(!le||!le[0]||!ee||!ee[0])return new _(!v.s||!b.s||(le?ee&&le[0]==ee[0]:!ee)?NaN:le&&le[0]==0||!ee?fe*0:fe/0);for(Q=new _(fe),ie=Q.c=[],C=v.e-b.e,fe=E+C+1,k||(k=ve,C=ye(v.e/U)-ye(b.e/U),fe=fe/U|0),P=0;ee[P]==(le[P]||0);P++);if(ee[P]>(le[P]||0)&&C--,fe<0)ie.push(1),R=!0;else{for(sr=le.length,ke=ee.length,P=0,fe+=2,q=_e(k/(ee[0]+1)),q>1&&(ee=h(ee,q,k),le=h(le,q,k),ke=ee.length,sr=le.length),At=ke,H=le.slice(0,ke),X=H.length;X<ke;H[X++]=0);dt=ee.slice(),dt=[0].concat(dt),lr=ee[0],ee[1]>=k/2&&lr++;do{if(q=0,x=p(ee,H,ke,X),x<0){if(oe=H[0],ke!=X&&(oe=oe*k+(H[1]||0)),q=_e(oe/lr),q>1)for(q>=k&&(q=k-1),j=h(ee,q,k),J=j.length,X=H.length;p(j,H,J,X)==1;)q--,u(j,ke<J?dt:ee,J,k),J=j.length,x=1;else q==0&&(x=q=1),j=ee.slice(),J=j.length;if(J<X&&(j=[0].concat(j)),u(H,j,X,k),X=H.length,x==-1)for(;p(ee,H,ke,X)<1;)q++,u(H,ke<X?dt:ee,X,k),X=H.length}else x===0&&(q++,H=[0]);ie[P++]=q,H[0]?H[X++]=le[At]||0:(H=[le[At]],X=1)}while((At++<sr||H[0]!=null)&&fe--);R=H[0]!=null,ie[0]||ie.splice(0,1)}if(k==ve){for(P=1,fe=ie[0];fe>=10;fe/=10,P++);N(Q,E+(Q.e=P+C*U-1)+1,w,R)}else Q.e=C,Q.r=+R;return Q}})();function S(h,p,u,v){var b,E,w,k,x;if(u==null?u=s:W(u,0,8),!h.c)return h.toString();if(b=h.c[0],w=h.e,p==null)x=Le(h.c),x=v==1||v==2&&(w<=c||w>=l)?Qt(x,w):Pe(x,w,"0");else if(h=N(new _(h),p,u),E=h.e,x=Le(h.c),k=x.length,v==1||v==2&&(p<=E||E<=c)){for(;k<p;x+="0",k++);x=Qt(x,E)}else if(p-=w+(v===2&&E>w),x=Pe(x,E,"0"),E+1>k){if(--p>0)for(x+=".";p--;x+="0");}else if(p+=E-k,p>0)for(E+1==k&&(x+=".");p--;x+="0");return h.s<0&&b?"-"+x:x}function D(h,p){for(var u,v,b=1,E=new _(h[0]);b<h.length;b++)v=new _(h[b]),(!v.s||(u=Je(E,v))===p||u===0&&E.s===p)&&(E=v);return E}function O(h,p,u){for(var v=1,b=p.length;!p[--b];p.pop());for(b=p[0];b>=10;b/=10,v++);return(u=v+u*U-1)>d?h.c=h.e=null:u<f?h.c=[h.e=0]:(h.e=u,h.c=p),h}n=(function(){var h=/^(-?)0([xbo])(?=\w[\w.]*$)/i,p=/^([^.]+)\.$/,u=/^\.([^.]+)$/,v=/^-?(Infinity|NaN)$/,b=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(E,w,k,x){var C,P=k?w:w.replace(b,"");if(v.test(P))E.s=isNaN(P)?null:P<0?-1:1;else{if(!k&&(P=P.replace(h,function(R,q,j){return C=(j=j.toLowerCase())=="x"?16:j=="b"?2:8,!x||x==C?q:R}),x&&(C=x,P=P.replace(p,"$1").replace(u,"0.$1")),w!=P))return new _(P,C);if(_.DEBUG)throw Error(ue+"Not a"+(x?" base "+x:"")+" number: "+w);E.s=null}E.c=E.e=null}})();function N(h,p,u,v){var b,E,w,k,x,C,P,R=h.c,q=Xr;if(R){e:{for(b=1,k=R[0];k>=10;k/=10,b++);if(E=p-b,E<0)E+=U,w=p,x=R[C=0],P=_e(x/q[b-w-1]%10);else if(C=Hr((E+1)/U),C>=R.length)if(v){for(;R.length<=C;R.push(0));x=P=0,b=1,E%=U,w=E-U+1}else break e;else{for(x=k=R[C],b=1;k>=10;k/=10,b++);E%=U,w=E-U+b,P=w<0?0:_e(x/q[b-w-1]%10)}if(v=v||p<0||R[C+1]!=null||(w<0?x:x%q[b-w-1]),v=u<4?(P||v)&&(u==0||u==(h.s<0?3:2)):P>5||P==5&&(u==4||v||u==6&&(E>0?w>0?x/q[b-w]:0:R[C-1])%10&1||u==(h.s<0?8:7)),p<1||!R[0])return R.length=0,v?(p-=h.e+1,R[0]=q[(U-p%U)%U],h.e=-p||0):R[0]=h.e=0,h;if(E==0?(R.length=C,k=1,C--):(R.length=C+1,k=q[U-E],R[C]=w>0?_e(x/q[b-w]%q[w])*k:0),v)for(;;)if(C==0){for(E=1,w=R[0];w>=10;w/=10,E++);for(w=R[0]+=k,k=1;w>=10;w/=10,k++);E!=k&&(h.e++,R[0]==ve&&(R[0]=1));break}else{if(R[C]+=k,R[C]!=ve)break;R[C--]=0,k=1}for(E=R.length;R[--E]===0;R.pop());}h.e>d?h.c=h.e=null:h.e<f&&(h.c=[h.e=0])}return h}function F(h){var p,u=h.e;return u===null?h.toString():(p=Le(h.c),p=u<=c||u>=l?Qt(p,u):Pe(p,u,"0"),h.s<0?"-"+p:p)}return i.absoluteValue=i.abs=function(){var h=new _(this);return h.s<0&&(h.s=1),h},i.comparedTo=function(h,p){return Je(this,new _(h,p))},i.decimalPlaces=i.dp=function(h,p){var u,v,b,E=this;if(h!=null)return W(h,0,ae),p==null?p=s:W(p,0,8),N(new _(E),h+E.e+1,p);if(!(u=E.c))return null;if(v=((b=u.length-1)-ye(this.e/U))*U,b=u[b])for(;b%10==0;b/=10,v--);return v<0&&(v=0),v},i.dividedBy=i.div=function(h,p){return t(this,new _(h,p),o,s)},i.dividedToIntegerBy=i.idiv=function(h,p){return t(this,new _(h,p),0,1)},i.exponentiatedBy=i.pow=function(h,p){var u,v,b,E,w,k,x,C,P,R=this;if(h=new _(h),h.c&&!h.isInteger())throw Error(ue+"Exponent not an integer: "+F(h));if(p!=null&&(p=new _(p)),k=h.e>14,!R.c||!R.c[0]||R.c[0]==1&&!R.e&&R.c.length==1||!h.c||!h.c[0])return P=new _(Math.pow(+F(R),k?h.s*(2-Wt(h)):+F(h))),p?P.mod(p):P;if(x=h.s<0,p){if(p.c?!p.c[0]:!p.s)return new _(NaN);v=!x&&R.isInteger()&&p.isInteger(),v&&(R=R.mod(p))}else{if(h.e>9&&(R.e>0||R.e<-1||(R.e==0?R.c[0]>1||k&&R.c[1]>=24e7:R.c[0]<8e13||k&&R.c[0]<=9999975e7)))return E=R.s<0&&Wt(h)?-0:0,R.e>-1&&(E=1/E),new _(x?1/E:E);I&&(E=Hr(I/U+2))}for(k?(u=new _(.5),x&&(h.s=1),C=Wt(h)):(b=Math.abs(+F(h)),C=b%2),P=new _(a);;){if(C){if(P=P.times(R),!P.c)break;E?P.c.length>E&&(P.c.length=E):v&&(P=P.mod(p))}if(b){if(b=_e(b/2),b===0)break;C=b%2}else if(h=h.times(u),N(h,h.e+1,1),h.e>14)C=Wt(h);else{if(b=+F(h),b===0)break;C=b%2}R=R.times(R),E?R.c&&R.c.length>E&&(R.c.length=E):v&&(R=R.mod(p))}return v?P:(x&&(P=a.div(P)),p?P.mod(p):E?N(P,I,s,w):P)},i.integerValue=function(h){var p=new _(this);return h==null?h=s:W(h,0,8),N(p,p.e+1,h)},i.isEqualTo=i.eq=function(h,p){return Je(this,new _(h,p))===0},i.isFinite=function(){return!!this.c},i.isGreaterThan=i.gt=function(h,p){return Je(this,new _(h,p))>0},i.isGreaterThanOrEqualTo=i.gte=function(h,p){return(p=Je(this,new _(h,p)))===1||p===0},i.isInteger=function(){return!!this.c&&ye(this.e/U)>this.c.length-2},i.isLessThan=i.lt=function(h,p){return Je(this,new _(h,p))<0},i.isLessThanOrEqualTo=i.lte=function(h,p){return(p=Je(this,new _(h,p)))===-1||p===0},i.isNaN=function(){return!this.s},i.isNegative=function(){return this.s<0},i.isPositive=function(){return this.s>0},i.isZero=function(){return!!this.c&&this.c[0]==0},i.minus=function(h,p){var u,v,b,E,w=this,k=w.s;if(h=new _(h,p),p=h.s,!k||!p)return new _(NaN);if(k!=p)return h.s=-p,w.plus(h);var x=w.e/U,C=h.e/U,P=w.c,R=h.c;if(!x||!C){if(!P||!R)return P?(h.s=-p,h):new _(R?w:NaN);if(!P[0]||!R[0])return R[0]?(h.s=-p,h):new _(P[0]?w:s==3?-0:0)}if(x=ye(x),C=ye(C),P=P.slice(),k=x-C){for((E=k<0)?(k=-k,b=P):(C=x,b=R),b.reverse(),p=k;p--;b.push(0));b.reverse()}else for(v=(E=(k=P.length)<(p=R.length))?k:p,k=p=0;p<v;p++)if(P[p]!=R[p]){E=P[p]<R[p];break}if(E&&(b=P,P=R,R=b,h.s=-h.s),p=(v=R.length)-(u=P.length),p>0)for(;p--;P[u++]=0);for(p=ve-1;v>k;){if(P[--v]<R[v]){for(u=v;u&&!P[--u];P[u]=p);--P[u],P[v]+=ve}P[v]-=R[v]}for(;P[0]==0;P.splice(0,1),--C);return P[0]?O(h,P,C):(h.s=s==3?-1:1,h.c=[h.e=0],h)},i.modulo=i.mod=function(h,p){var u,v,b=this;return h=new _(h,p),!b.c||!h.s||h.c&&!h.c[0]?new _(NaN):!h.c||b.c&&!b.c[0]?new _(b):(M==9?(v=h.s,h.s=1,u=t(b,h,0,3),h.s=v,u.s*=v):u=t(b,h,0,M),h=b.minus(u.times(h)),!h.c[0]&&M==1&&(h.s=b.s),h)},i.multipliedBy=i.times=function(h,p){var u,v,b,E,w,k,x,C,P,R,q,j,J,Q,ie,H=this,X=H.c,oe=(h=new _(h,p)).c;if(!X||!oe||!X[0]||!oe[0])return!H.s||!h.s||X&&!X[0]&&!oe||oe&&!oe[0]&&!X?h.c=h.e=h.s=null:(h.s*=H.s,!X||!oe?h.c=h.e=null:(h.c=[0],h.e=0)),h;for(v=ye(H.e/U)+ye(h.e/U),h.s*=H.s,x=X.length,R=oe.length,x<R&&(J=X,X=oe,oe=J,b=x,x=R,R=b),b=x+R,J=[];b--;J.push(0));for(Q=ve,ie=Ne,b=R;--b>=0;){for(u=0,q=oe[b]%ie,j=oe[b]/ie|0,w=x,E=b+w;E>b;)C=X[--w]%ie,P=X[w]/ie|0,k=j*C+P*q,C=q*C+k%ie*ie+J[E]+u,u=(C/Q|0)+(k/ie|0)+j*P,J[E--]=C%Q;J[E]=u}return u?++v:J.splice(0,1),O(h,J,v)},i.negated=function(){var h=new _(this);return h.s=-h.s||null,h},i.plus=function(h,p){var u,v=this,b=v.s;if(h=new _(h,p),p=h.s,!b||!p)return new _(NaN);if(b!=p)return h.s=-p,v.minus(h);var E=v.e/U,w=h.e/U,k=v.c,x=h.c;if(!E||!w){if(!k||!x)return new _(b/0);if(!k[0]||!x[0])return x[0]?h:new _(k[0]?v:b*0)}if(E=ye(E),w=ye(w),k=k.slice(),b=E-w){for(b>0?(w=E,u=x):(b=-b,u=k),u.reverse();b--;u.push(0));u.reverse()}for(b=k.length,p=x.length,b-p<0&&(u=x,x=k,k=u,p=b),b=0;p;)b=(k[--p]=k[p]+x[p]+b)/ve|0,k[p]=ve===k[p]?0:k[p]%ve;return b&&(k=[b].concat(k),++w),O(h,k,w)},i.precision=i.sd=function(h,p){var u,v,b,E=this;if(h!=null&&h!==!!h)return W(h,1,ae),p==null?p=s:W(p,0,8),N(new _(E),h,p);if(!(u=E.c))return null;if(b=u.length-1,v=b*U+1,b=u[b]){for(;b%10==0;b/=10,v--);for(b=u[0];b>=10;b/=10,v++);}return h&&E.e+1>v&&(v=E.e+1),v},i.shiftedBy=function(h){return W(h,-Jr,Jr),this.times("1e"+h)},i.squareRoot=i.sqrt=function(){var h,p,u,v,b,E=this,w=E.c,k=E.s,x=E.e,C=o+4,P=new _("0.5");if(k!==1||!w||!w[0])return new _(!k||k<0&&(!w||w[0])?NaN:w?E:1/0);if(k=Math.sqrt(+F(E)),k==0||k==1/0?(p=Le(w),(p.length+x)%2==0&&(p+="0"),k=Math.sqrt(+p),x=ye((x+1)/2)-(x<0||x%2),k==1/0?p="5e"+x:(p=k.toExponential(),p=p.slice(0,p.indexOf("e")+1)+x),u=new _(p)):u=new _(k+""),u.c[0]){for(x=u.e,k=x+C,k<3&&(k=0);;)if(b=u,u=P.times(b.plus(t(E,b,C,1))),Le(b.c).slice(0,k)===(p=Le(u.c)).slice(0,k))if(u.e<x&&--k,p=p.slice(k-3,k+1),p=="9999"||!v&&p=="4999"){if(!v&&(N(b,b.e+o+2,0),b.times(b).eq(E))){u=b;break}C+=4,k+=4,v=1}else{(!+p||!+p.slice(1)&&p.charAt(0)=="5")&&(N(u,u.e+o+2,1),h=!u.times(u).eq(E));break}}return N(u,u.e+o+1,s,h)},i.toExponential=function(h,p){return h!=null&&(W(h,0,ae),h++),S(this,h,p,1)},i.toFixed=function(h,p){return h!=null&&(W(h,0,ae),h=h+this.e+1),S(this,h,p)},i.toFormat=function(h,p,u){var v,b=this;if(u==null)h!=null&&p&&typeof p=="object"?(u=p,p=null):h&&typeof h=="object"?(u=h,h=p=null):u=T;else if(typeof u!="object")throw Error(ue+"Argument not an object: "+u);if(v=b.toFixed(h,p),b.c){var E,w=v.split("."),k=+u.groupSize,x=+u.secondaryGroupSize,C=u.groupSeparator||"",P=w[0],R=w[1],q=b.s<0,j=q?P.slice(1):P,J=j.length;if(x&&(E=k,k=x,x=E,J-=E),k>0&&J>0){for(E=J%k||k,P=j.substr(0,E);E<J;E+=k)P+=C+j.substr(E,k);x>0&&(P+=C+j.slice(E)),q&&(P="-"+P)}v=R?P+(u.decimalSeparator||"")+((x=+u.fractionGroupSize)?R.replace(new RegExp("\\d{"+x+"}\\B","g"),"$&"+(u.fractionGroupSeparator||"")):R):P}return(u.prefix||"")+v+(u.suffix||"")},i.toFraction=function(h){var p,u,v,b,E,w,k,x,C,P,R,q,j=this,J=j.c;if(h!=null&&(k=new _(h),!k.isInteger()&&(k.c||k.s!==1)||k.lt(a)))throw Error(ue+"Argument "+(k.isInteger()?"out of range: ":"not an integer: ")+F(k));if(!J)return new _(j);for(p=new _(a),C=u=new _(a),v=x=new _(a),q=Le(J),E=p.e=q.length-j.e-1,p.c[0]=Xr[(w=E%U)<0?U+w:w],h=!h||k.comparedTo(p)>0?E>0?p:C:k,w=d,d=1/0,k=new _(q),x.c[0]=0;P=t(k,p,0,1),b=u.plus(P.times(v)),b.comparedTo(h)!=1;)u=v,v=b,C=x.plus(P.times(b=C)),x=b,p=k.minus(P.times(b=p)),k=b;return b=t(h.minus(u),v,0,1),x=x.plus(b.times(C)),u=u.plus(b.times(v)),x.s=C.s=j.s,E=E*2,R=t(C,v,E,s).minus(j).abs().comparedTo(t(x,u,E,s).minus(j).abs())<1?[C,v]:[x,u],d=w,R},i.toNumber=function(){return+F(this)},i.toPrecision=function(h,p){return h!=null&&W(h,1,ae),S(this,h,p,2)},i.toString=function(h){var p,u=this,v=u.s,b=u.e;return b===null?v?(p="Infinity",v<0&&(p="-"+p)):p="NaN":(h==null?p=b<=c||b>=l?Qt(Le(u.c),b):Pe(Le(u.c),b,"0"):h===10&&y?(u=N(new _(u),o+b+1,s),p=Pe(Le(u.c),u.e,"0")):(W(h,2,m.length,"Base"),p=r(Pe(Le(u.c),b,"0"),10,h,v,!0)),v<0&&u.c[0]&&(p="-"+p)),p},i.valueOf=i.toJSON=function(){return F(this)},i._isBigNumber=!0,i[Symbol.toStringTag]="BigNumber",i[Symbol.for("nodejs.util.inspect.custom")]=i.valueOf,e!=null&&_.set(e),_}function ye(e){var t=e|0;return e>0||e===t?t:t-1}function Le(e){for(var t,r,n=1,i=e.length,a=e[0]+"";n<i;){for(t=e[n++]+"",r=U-t.length;r--;t="0"+t);a+=t}for(i=a.length;a.charCodeAt(--i)===48;);return a.slice(0,i+1||1)}function Je(e,t){var r,n,i=e.c,a=t.c,o=e.s,s=t.s,c=e.e,l=t.e;if(!o||!s)return null;if(r=i&&!i[0],n=a&&!a[0],r||n)return r?n?0:-s:o;if(o!=s)return o;if(r=o<0,n=c==l,!i||!a)return n?0:!i^r?1:-1;if(!n)return c>l^r?1:-1;for(s=(c=i.length)<(l=a.length)?c:l,o=0;o<s;o++)if(i[o]!=a[o])return i[o]>a[o]^r?1:-1;return c==l?0:c>l^r?1:-1}function W(e,t,r,n){if(e<t||e>r||e!==_e(e))throw Error(ue+(n||"Argument")+(typeof e=="number"?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Wt(e){var t=e.c.length-1;return ye(e.e/U)==t&&e.c[t]%2!=0}function Qt(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Pe(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(n=e.length,++t>n){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var dL=vl(),be=dL;var pL=class{key;left=null;right=null;constructor(e){this.key=e}},St=class extends pL{constructor(e){super(e)}};var uL=class{size=0;modificationCount=0;splayCount=0;splay(e){let t=this.root;if(t==null)return this.compare(e,e),-1;let r=null,n=null,i=null,a=null,o=t,s=this.compare,c;for(;;)if(c=s(o.key,e),c>0){let l=o.left;if(l==null||(c=s(l.key,e),c>0&&(o.left=l.right,l.right=o,o=l,l=o.left,l==null)))break;r==null?n=o:r.left=o,r=o,o=l}else if(c<0){let l=o.right;if(l==null||(c=s(l.key,e),c<0&&(o.right=l.left,l.left=o,o=l,l=o.right,l==null)))break;i==null?a=o:i.right=o,i=o,o=l}else break;return i!=null&&(i.right=o.left,o.left=a),r!=null&&(r.left=o.right,o.right=n),this.root!==o&&(this.root=o,this.splayCount++),c}splayMin(e){let t=e,r=t.left;for(;r!=null;){let n=r;t.left=n.right,n.right=t,t=n,r=t.left}return t}splayMax(e){let t=e,r=t.right;for(;r!=null;){let n=r;t.right=n.left,n.left=t,t=n,r=t.right}return t}_delete(e){if(this.root==null||this.splay(e)!=0)return null;let r=this.root,n=r,i=r.left;if(this.size--,i==null)this.root=r.right;else{let a=r.right;r=this.splayMax(i),r.right=a,this.root=r}return this.modificationCount++,n}addNewRoot(e,t){this.size++,this.modificationCount++;let r=this.root;if(r==null){this.root=e;return}t<0?(e.left=r,e.right=r.right,r.right=null):(e.right=r,e.left=r.left,r.left=null),this.root=e}_first(){let e=this.root;return e==null?null:(this.root=this.splayMin(e),this.root)}_last(){let e=this.root;return e==null?null:(this.root=this.splayMax(e),this.root)}clear(){this.root=null,this.size=0,this.modificationCount++}has(e){return this.validKey(e)&&this.splay(e)==0}defaultCompare(){return(e,t)=>e<t?-1:e>t?1:0}wrap(){return{getRoot:()=>this.root,setRoot:e=>{this.root=e},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:e=>{this.splayCount=e},splay:e=>this.splay(e),has:e=>this.has(e)}}};var Xe=class Ot extends uL{root=null;compare;validKey;constructor(t,r){super(),this.compare=t??this.defaultCompare(),this.validKey=r??(n=>n!=null&&n!=null)}delete(t){return this.validKey(t)?this._delete(t)!=null:!1}deleteAll(t){for(let r of t)this.delete(r)}forEach(t){let r=this[Symbol.iterator](),n;for(;n=r.next(),!n.done;)t(n.value,n.value,this)}add(t){let r=this.splay(t);return r!=0&&this.addNewRoot(new St(t),r),this}addAndReturn(t){let r=this.splay(t);return r!=0&&this.addNewRoot(new St(t),r),this.root.key}addAll(t){for(let r of t)this.add(r)}isEmpty(){return this.root==null}isNotEmpty(){return this.root!=null}single(){if(this.size==0)throw"Bad state: No element";if(this.size>1)throw"Bad state: Too many element";return this.root.key}first(){if(this.size==0)throw"Bad state: No element";return this._first().key}last(){if(this.size==0)throw"Bad state: No element";return this._last().key}lastBefore(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)<0)return this.root.key;let n=this.root.left;if(n==null)return null;let i=n.right;for(;i!=null;)n=i,i=n.right;return n.key}firstAfter(t){if(t==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(t)>0)return this.root.key;let n=this.root.right;if(n==null)return null;let i=n.left;for(;i!=null;)n=i,i=n.left;return n.key}retainAll(t){let r=new Ot(this.compare,this.validKey),n=this.modificationCount;for(let i of t){if(n!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(i)&&this.splay(i)==0&&r.add(this.root.key)}r.size!=this.size&&(this.root=r.root,this.size=r.size,this.modificationCount++)}lookup(t){return!this.validKey(t)||this.splay(t)!=0?null:this.root.key}intersection(t){let r=new Ot(this.compare,this.validKey);for(let n of this)t.has(n)&&r.add(n);return r}difference(t){let r=new Ot(this.compare,this.validKey);for(let n of this)t.has(n)||r.add(n);return r}union(t){let r=this.clone();return r.addAll(t),r}clone(){let t=new Ot(this.compare,this.validKey);return t.size=this.size,t.root=this.copyNode(this.root),t}copyNode(t){if(t==null)return null;function r(i,a){let o,s;do{if(o=i.left,s=i.right,o!=null){let c=new St(o.key);a.left=c,r(o,c)}if(s!=null){let c=new St(s.key);a.right=c,i=s,a=c}}while(s!=null)}let n=new St(t.key);return r(t,n),n}toSet(){return this.clone()}entries(){return new gL(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[Symbol.iterator](){return new fL(this.wrap())}[Symbol.toStringTag]="[object Set]"},kl=class{tree;path=new Array;modificationCount=null;splayCount;constructor(e){this.tree=e,this.splayCount=e.getSplayCount()}[Symbol.iterator](){return this}next(){return this.moveNext()?{done:!1,value:this.current()}:{done:!0,value:null}}current(){if(!this.path.length)return null;let e=this.path[this.path.length-1];return this.getValue(e)}rebuildPath(e){this.path.splice(0,this.path.length),this.tree.splay(e),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(e){for(;e!=null;)this.path.push(e),e=e.left}moveNext(){if(this.modificationCount!=this.tree.getModificationCount()){if(this.modificationCount==null){this.modificationCount=this.tree.getModificationCount();let r=this.tree.getRoot();for(;r!=null;)this.path.push(r),r=r.left;return this.path.length>0}throw"Concurrent modification during iteration."}if(!this.path.length)return!1;this.splayCount!=this.tree.getSplayCount()&&this.rebuildPath(this.path[this.path.length-1].key);let e=this.path[this.path.length-1],t=e.right;if(t!=null){for(;t!=null;)this.path.push(t),t=t.left;return!0}for(this.path.pop();this.path.length&&this.path[this.path.length-1].right===e;)e=this.path.pop();return this.path.length>0}},fL=class extends kl{getValue(e){return e.key}},gL=class extends kl{getValue(e){return[e.key,e.key]}};var Il=e=>()=>e,Yr=e=>{let t=e?(r,n)=>n.minus(r).abs().isLessThanOrEqualTo(e):Il(!1);return(r,n)=>t(r,n)?0:r.comparedTo(n)};function mL(e){let t=e?(r,n,i,a,o)=>r.exponentiatedBy(2).isLessThanOrEqualTo(a.minus(n).exponentiatedBy(2).plus(o.minus(i).exponentiatedBy(2)).times(e)):Il(!1);return(r,n,i)=>{let a=r.x,o=r.y,s=i.x,c=i.y,l=o.minus(c).times(n.x.minus(s)).minus(a.minus(s).times(n.y.minus(c)));return t(l,a,o,s,c)?0:l.comparedTo(0)}}var LL=e=>e,_L=e=>{if(e){let t=new Xe(Yr(e)),r=new Xe(Yr(e)),n=(a,o)=>o.addAndReturn(a),i=a=>({x:n(a.x,t),y:n(a.y,r)});return i({x:new be(0),y:new be(0)}),i}return LL},$r=e=>({set:t=>{Ce=$r(t)},reset:()=>$r(e),compare:Yr(e),snap:_L(e),orient:mL(e)}),Ce=$r(),Rt=(e,t)=>e.ll.x.isLessThanOrEqualTo(t.x)&&t.x.isLessThanOrEqualTo(e.ur.x)&&e.ll.y.isLessThanOrEqualTo(t.y)&&t.y.isLessThanOrEqualTo(e.ur.y),Zr=(e,t)=>{if(t.ur.x.isLessThan(e.ll.x)||e.ur.x.isLessThan(t.ll.x)||t.ur.y.isLessThan(e.ll.y)||e.ur.y.isLessThan(t.ll.y))return null;let r=e.ll.x.isLessThan(t.ll.x)?t.ll.x:e.ll.x,n=e.ur.x.isLessThan(t.ur.x)?e.ur.x:t.ur.x,i=e.ll.y.isLessThan(t.ll.y)?t.ll.y:e.ll.y,a=e.ur.y.isLessThan(t.ur.y)?e.ur.y:t.ur.y;return{ll:{x:r,y:i},ur:{x:n,y:a}}},er=(e,t)=>e.x.times(t.y).minus(e.y.times(t.x)),Tl=(e,t)=>e.x.times(t.x).plus(e.y.times(t.y)),rr=e=>Tl(e,e).sqrt(),yL=(e,t,r)=>{let n={x:t.x.minus(e.x),y:t.y.minus(e.y)},i={x:r.x.minus(e.x),y:r.y.minus(e.y)};return er(i,n).div(rr(i)).div(rr(n))},bL=(e,t,r)=>{let n={x:t.x.minus(e.x),y:t.y.minus(e.y)},i={x:r.x.minus(e.x),y:r.y.minus(e.y)};return Tl(i,n).div(rr(i)).div(rr(n))},El=(e,t,r)=>t.y.isZero()?null:{x:e.x.plus(t.x.div(t.y).times(r.minus(e.y))),y:r},xl=(e,t,r)=>t.x.isZero()?null:{x:r,y:e.y.plus(t.y.div(t.x).times(r.minus(e.x)))},ML=(e,t,r,n)=>{if(t.x.isZero())return xl(r,n,e.x);if(n.x.isZero())return xl(e,t,r.x);if(t.y.isZero())return El(r,n,e.y);if(n.y.isZero())return El(e,t,r.y);let i=er(t,n);if(i.isZero())return null;let a={x:r.x.minus(e.x),y:r.y.minus(e.y)},o=er(a,t).div(i),s=er(a,n).div(i),c=e.x.plus(s.times(t.x)),l=r.x.plus(o.times(n.x)),f=e.y.plus(s.times(t.y)),d=r.y.plus(o.times(n.y)),g=c.plus(l).div(2),M=f.plus(d).div(2);return{x:g,y:M}},we=class Dl{point;isLeft;segment;otherSE;consumedBy;static compare(t,r){let n=Dl.comparePoints(t.point,r.point);return n!==0?n:(t.point!==r.point&&t.link(r),t.isLeft!==r.isLeft?t.isLeft?1:-1:ir.compare(t.segment,r.segment))}static comparePoints(t,r){return t.x.isLessThan(r.x)?-1:t.x.isGreaterThan(r.x)?1:t.y.isLessThan(r.y)?-1:t.y.isGreaterThan(r.y)?1:0}constructor(t,r){t.events===void 0?t.events=[this]:t.events.push(this),this.point=t,this.isLeft=r}link(t){if(t.point===this.point)throw new Error("Tried to link already linked events");let r=t.point.events;for(let n=0,i=r.length;n<i;n++){let a=r[n];this.point.events.push(a),a.point=this.point}this.checkForConsuming()}checkForConsuming(){let t=this.point.events.length;for(let r=0;r<t;r++){let n=this.point.events[r];if(n.segment.consumedBy===void 0)for(let i=r+1;i<t;i++){let a=this.point.events[i];a.consumedBy===void 0&&n.otherSE.point.events===a.otherSE.point.events&&n.segment.consume(a.segment)}}}getAvailableLinkedEvents(){let t=[];for(let r=0,n=this.point.events.length;r<n;r++){let i=this.point.events[r];i!==this&&!i.segment.ringOut&&i.segment.isInResult()&&t.push(i)}return t}getLeftmostComparator(t){let r=new Map,n=i=>{let a=i.otherSE;r.set(i,{sine:yL(this.point,t.point,a.point),cosine:bL(this.point,t.point,a.point)})};return(i,a)=>{r.has(i)||n(i),r.has(a)||n(a);let{sine:o,cosine:s}=r.get(i),{sine:c,cosine:l}=r.get(a);return o.isGreaterThanOrEqualTo(0)&&c.isGreaterThanOrEqualTo(0)?s.isLessThan(l)?1:s.isGreaterThan(l)?-1:0:o.isLessThan(0)&&c.isLessThan(0)?s.isLessThan(l)?-1:s.isGreaterThan(l)?1:0:c.isLessThan(o)?-1:c.isGreaterThan(o)?1:0}}},vL=class Wr{events;poly;_isExteriorRing;_enclosingRing;static factory(t){let r=[];for(let n=0,i=t.length;n<i;n++){let a=t[n];if(!a.isInResult()||a.ringOut)continue;let o=null,s=a.leftSE,c=a.rightSE,l=[s],f=s.point,d=[];for(;o=s,s=c,l.push(s),s.point!==f;)for(;;){let g=s.getAvailableLinkedEvents();if(g.length===0){let T=l[0].point,m=l[l.length-1].point;throw new Error(`Unable to complete output ring starting at [${T.x}, ${T.y}]. Last matching segment found ends at [${m.x}, ${m.y}].`)}if(g.length===1){c=g[0].otherSE;break}let M=null;for(let T=0,m=d.length;T<m;T++)if(d[T].point===s.point){M=T;break}if(M!==null){let T=d.splice(M)[0],m=l.splice(T.index);m.unshift(m[0].otherSE),r.push(new Wr(m.reverse()));continue}d.push({index:l.length,point:s.point});let I=s.getLeftmostComparator(o);c=g.sort(I)[0].otherSE;break}r.push(new Wr(l))}return r}constructor(t){this.events=t;for(let r=0,n=t.length;r<n;r++)t[r].segment.ringOut=this;this.poly=null}getGeom(){let t=this.events[0].point,r=[t];for(let l=1,f=this.events.length-1;l<f;l++){let d=this.events[l].point,g=this.events[l+1].point;Ce.orient(d,t,g)!==0&&(r.push(d),t=d)}if(r.length===1)return null;let n=r[0],i=r[1];Ce.orient(n,t,i)===0&&r.shift(),r.push(r[0]);let a=this.isExteriorRing()?1:-1,o=this.isExteriorRing()?0:r.length-1,s=this.isExteriorRing()?r.length:-1,c=[];for(let l=o;l!=s;l+=a)c.push([r[l].x.toNumber(),r[l].y.toNumber()]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){let t=this.enclosingRing();this._isExteriorRing=t?!t.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let t=this.events[0];for(let i=1,a=this.events.length;i<a;i++){let o=this.events[i];we.compare(t,o)>0&&(t=o)}let r=t.segment.prevInResult(),n=r?r.prevInResult():null;for(;;){if(!r)return null;if(!n)return r.ringOut;if(n.ringOut!==r.ringOut)return n.ringOut?.enclosingRing()!==r.ringOut?r.ringOut:r.ringOut?.enclosingRing();r=n.prevInResult(),n=r?r.prevInResult():null}}},wl=class{exteriorRing;interiorRings;constructor(e){this.exteriorRing=e,e.poly=this,this.interiorRings=[]}addInterior(e){this.interiorRings.push(e),e.poly=this}getGeom(){let e=this.exteriorRing.getGeom();if(e===null)return null;let t=[e];for(let r=0,n=this.interiorRings.length;r<n;r++){let i=this.interiorRings[r].getGeom();i!==null&&t.push(i)}return t}},kL=class{rings;polys;constructor(e){this.rings=e,this.polys=this._composePolys(e)}getGeom(){let e=[];for(let t=0,r=this.polys.length;t<r;t++){let n=this.polys[t].getGeom();n!==null&&e.push(n)}return e}_composePolys(e){let t=[];for(let r=0,n=e.length;r<n;r++){let i=e[r];if(!i.poly)if(i.isExteriorRing())t.push(new wl(i));else{let a=i.enclosingRing();a?.poly||t.push(new wl(a)),a?.poly?.addInterior(i)}}return t}},EL=class{queue;tree;segments;constructor(e,t=ir.compare){this.queue=e,this.tree=new Xe(t),this.segments=[]}process(e){let t=e.segment,r=[];if(e.consumedBy)return e.isLeft?this.queue.delete(e.otherSE):this.tree.delete(t),r;e.isLeft&&this.tree.add(t);let n=t,i=t;do n=this.tree.lastBefore(n);while(n!=null&&n.consumedBy!=null);do i=this.tree.firstAfter(i);while(i!=null&&i.consumedBy!=null);if(e.isLeft){let a=null;if(n){let s=n.getIntersection(t);if(s!==null&&(t.isAnEndpoint(s)||(a=s),!n.isAnEndpoint(s))){let c=this._splitSafely(n,s);for(let l=0,f=c.length;l<f;l++)r.push(c[l])}}let o=null;if(i){let s=i.getIntersection(t);if(s!==null&&(t.isAnEndpoint(s)||(o=s),!i.isAnEndpoint(s))){let c=this._splitSafely(i,s);for(let l=0,f=c.length;l<f;l++)r.push(c[l])}}if(a!==null||o!==null){let s=null;a===null?s=o:o===null?s=a:s=we.comparePoints(a,o)<=0?a:o,this.queue.delete(t.rightSE),r.push(t.rightSE);let c=t.split(s);for(let l=0,f=c.length;l<f;l++)r.push(c[l])}r.length>0?(this.tree.delete(t),r.push(e)):(this.segments.push(t),t.prev=n)}else{if(n&&i){let a=n.getIntersection(i);if(a!==null){if(!n.isAnEndpoint(a)){let o=this._splitSafely(n,a);for(let s=0,c=o.length;s<c;s++)r.push(o[s])}if(!i.isAnEndpoint(a)){let o=this._splitSafely(i,a);for(let s=0,c=o.length;s<c;s++)r.push(o[s])}}}this.tree.delete(t)}return r}_splitSafely(e,t){this.tree.delete(e);let r=e.rightSE;this.queue.delete(r);let n=e.split(t);return n.push(r),e.consumedBy===void 0&&this.tree.add(e),n}},xL=class{type;numMultiPolys;run(e,t,r){Bt.type=e;let n=[new Cl(t,!0)];for(let l=0,f=r.length;l<f;l++)n.push(new Cl(r[l],!1));if(Bt.numMultiPolys=n.length,Bt.type==="difference"){let l=n[0],f=1;for(;f<n.length;)Zr(n[f].bbox,l.bbox)!==null?f++:n.splice(f,1)}if(Bt.type==="intersection")for(let l=0,f=n.length;l<f;l++){let d=n[l];for(let g=l+1,M=n.length;g<M;g++)if(Zr(d.bbox,n[g].bbox)===null)return[]}let i=new Xe(we.compare);for(let l=0,f=n.length;l<f;l++){let d=n[l].getSweepEvents();for(let g=0,M=d.length;g<M;g++)i.add(d[g])}let a=new EL(i),o=null;for(i.size!=0&&(o=i.first(),i.delete(o));o;){let l=a.process(o);for(let f=0,d=l.length;f<d;f++){let g=l[f];g.consumedBy===void 0&&i.add(g)}i.size!=0?(o=i.first(),i.delete(o)):o=null}Ce.reset();let s=vL.factory(a.segments);return new kL(s).getGeom()}},Bt=new xL,nr=Bt,wL=0,ir=class tr{id;leftSE;rightSE;rings;windings;ringOut;consumedBy;prev;_prevInResult;_beforeState;_afterState;_isInResult;static compare(t,r){let n=t.leftSE.point.x,i=r.leftSE.point.x,a=t.rightSE.point.x,o=r.rightSE.point.x;if(o.isLessThan(n))return 1;if(a.isLessThan(i))return-1;let s=t.leftSE.point.y,c=r.leftSE.point.y,l=t.rightSE.point.y,f=r.rightSE.point.y;if(n.isLessThan(i)){if(c.isLessThan(s)&&c.isLessThan(l))return 1;if(c.isGreaterThan(s)&&c.isGreaterThan(l))return-1;let d=t.comparePoint(r.leftSE.point);if(d<0)return 1;if(d>0)return-1;let g=r.comparePoint(t.rightSE.point);return g!==0?g:-1}if(n.isGreaterThan(i)){if(s.isLessThan(c)&&s.isLessThan(f))return-1;if(s.isGreaterThan(c)&&s.isGreaterThan(f))return 1;let d=r.comparePoint(t.leftSE.point);if(d!==0)return d;let g=t.comparePoint(r.rightSE.point);return g<0?1:g>0?-1:1}if(s.isLessThan(c))return-1;if(s.isGreaterThan(c))return 1;if(a.isLessThan(o)){let d=r.comparePoint(t.rightSE.point);if(d!==0)return d}if(a.isGreaterThan(o)){let d=t.comparePoint(r.rightSE.point);if(d<0)return 1;if(d>0)return-1}if(!a.eq(o)){let d=l.minus(s),g=a.minus(n),M=f.minus(c),I=o.minus(i);if(d.isGreaterThan(g)&&M.isLessThan(I))return 1;if(d.isLessThan(g)&&M.isGreaterThan(I))return-1}return a.isGreaterThan(o)?1:a.isLessThan(o)||l.isLessThan(f)?-1:l.isGreaterThan(f)?1:t.id<r.id?-1:t.id>r.id?1:0}constructor(t,r,n,i){this.id=++wL,this.leftSE=t,t.segment=this,t.otherSE=r,this.rightSE=r,r.segment=this,r.otherSE=t,this.rings=n,this.windings=i}static fromRing(t,r,n){let i,a,o,s=we.comparePoints(t,r);if(s<0)i=t,a=r,o=1;else if(s>0)i=r,a=t,o=-1;else throw new Error(`Tried to create degenerate segment at [${t.x}, ${t.y}]`);let c=new we(i,!0),l=new we(a,!1);return new tr(c,l,[n],[o])}replaceRightSE(t){this.rightSE=t,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let t=this.leftSE.point.y,r=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:t.isLessThan(r)?t:r},ur:{x:this.rightSE.point.x,y:t.isGreaterThan(r)?t:r}}}vector(){return{x:this.rightSE.point.x.minus(this.leftSE.point.x),y:this.rightSE.point.y.minus(this.leftSE.point.y)}}isAnEndpoint(t){return t.x.eq(this.leftSE.point.x)&&t.y.eq(this.leftSE.point.y)||t.x.eq(this.rightSE.point.x)&&t.y.eq(this.rightSE.point.y)}comparePoint(t){return Ce.orient(this.leftSE.point,t,this.rightSE.point)}getIntersection(t){let r=this.bbox(),n=t.bbox(),i=Zr(r,n);if(i===null)return null;let a=this.leftSE.point,o=this.rightSE.point,s=t.leftSE.point,c=t.rightSE.point,l=Rt(r,s)&&this.comparePoint(s)===0,f=Rt(n,a)&&t.comparePoint(a)===0,d=Rt(r,c)&&this.comparePoint(c)===0,g=Rt(n,o)&&t.comparePoint(o)===0;if(f&&l)return g&&!d?o:!g&&d?c:null;if(f)return d&&a.x.eq(c.x)&&a.y.eq(c.y)?null:a;if(l)return g&&o.x.eq(s.x)&&o.y.eq(s.y)?null:s;if(g&&d)return null;if(g)return o;if(d)return c;let M=ML(a,this.vector(),s,t.vector());return M===null||!Rt(i,M)?null:Ce.snap(M)}split(t){let r=[],n=t.events!==void 0,i=new we(t,!0),a=new we(t,!1),o=this.rightSE;this.replaceRightSE(a),r.push(a),r.push(i);let s=new tr(i,o,this.rings.slice(),this.windings.slice());return we.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),we.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(i.checkForConsuming(),a.checkForConsuming()),r}swapEvents(){let t=this.rightSE;this.rightSE=this.leftSE,this.leftSE=t,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let r=0,n=this.windings.length;r<n;r++)this.windings[r]*=-1}consume(t){let r=this,n=t;for(;r.consumedBy;)r=r.consumedBy;for(;n.consumedBy;)n=n.consumedBy;let i=tr.compare(r,n);if(i!==0){if(i>0){let a=r;r=n,n=a}if(r.prev===n){let a=r;r=n,n=a}for(let a=0,o=n.rings.length;a<o;a++){let s=n.rings[a],c=n.windings[a],l=r.rings.indexOf(s);l===-1?(r.rings.push(s),r.windings.push(c)):r.windings[l]+=c}n.rings=null,n.windings=null,n.consumedBy=r,n.leftSE.consumedBy=r.leftSE,n.rightSE.consumedBy=r.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{let t=this.prev.consumedBy||this.prev;this._beforeState=t.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let t=this.beforeState();this._afterState={rings:t.rings.slice(0),windings:t.windings.slice(0),multiPolys:[]};let r=this._afterState.rings,n=this._afterState.windings,i=this._afterState.multiPolys;for(let s=0,c=this.rings.length;s<c;s++){let l=this.rings[s],f=this.windings[s],d=r.indexOf(l);d===-1?(r.push(l),n.push(f)):n[d]+=f}let a=[],o=[];for(let s=0,c=r.length;s<c;s++){if(n[s]===0)continue;let l=r[s],f=l.poly;if(o.indexOf(f)===-1)if(l.isExterior)a.push(f);else{o.indexOf(f)===-1&&o.push(f);let d=a.indexOf(l.poly);d!==-1&&a.splice(d,1)}}for(let s=0,c=a.length;s<c;s++){let l=a[s].multiPoly;i.indexOf(l)===-1&&i.push(l)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let t=this.beforeState().multiPolys,r=this.afterState().multiPolys;switch(nr.type){case"union":{let n=t.length===0,i=r.length===0;this._isInResult=n!==i;break}case"intersection":{let n,i;t.length<r.length?(n=t.length,i=r.length):(n=r.length,i=t.length),this._isInResult=i===nr.numMultiPolys&&n<i;break}case"xor":{let n=Math.abs(t.length-r.length);this._isInResult=n%2===1;break}case"difference":{let n=i=>i.length===1&&i[0].isSubject;this._isInResult=n(t)!==n(r);break}}return this._isInResult}},Pl=class{poly;isExterior;segments;bbox;constructor(e,t,r){if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=t,this.isExterior=r,this.segments=[],typeof e[0][0]!="number"||typeof e[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let n=Ce.snap({x:new be(e[0][0]),y:new be(e[0][1])});this.bbox={ll:{x:n.x,y:n.y},ur:{x:n.x,y:n.y}};let i=n;for(let a=1,o=e.length;a<o;a++){if(typeof e[a][0]!="number"||typeof e[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let s=Ce.snap({x:new be(e[a][0]),y:new be(e[a][1])});s.x.eq(i.x)&&s.y.eq(i.y)||(this.segments.push(ir.fromRing(i,s,this)),s.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=s.x),s.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=s.y),s.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=s.x),s.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=s.y),i=s)}(!n.x.eq(i.x)||!n.y.eq(i.y))&&this.segments.push(ir.fromRing(i,n,this))}getSweepEvents(){let e=[];for(let t=0,r=this.segments.length;t<r;t++){let n=this.segments[t];e.push(n.leftSE),e.push(n.rightSE)}return e}},PL=class{multiPoly;exteriorRing;interiorRings;bbox;constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new Pl(e[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let r=1,n=e.length;r<n;r++){let i=new Pl(e[r],this,!1);i.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=i.bbox.ur.y),this.interiorRings.push(i)}this.multiPoly=t}getSweepEvents(){let e=this.exteriorRing.getSweepEvents();for(let t=0,r=this.interiorRings.length;t<r;t++){let n=this.interiorRings[t].getSweepEvents();for(let i=0,a=n.length;i<a;i++)e.push(n[i])}return e}},Cl=class{isSubject;polys;bbox;constructor(e,t){if(!Array.isArray(e))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof e[0][0][0]=="number"&&(e=[e])}catch{}this.polys=[],this.bbox={ll:{x:new be(Number.POSITIVE_INFINITY),y:new be(Number.POSITIVE_INFINITY)},ur:{x:new be(Number.NEGATIVE_INFINITY),y:new be(Number.NEGATIVE_INFINITY)}};for(let r=0,n=e.length;r<n;r++){let i=new PL(e[r],this);i.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=i.bbox.ll.x),i.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=i.bbox.ll.y),i.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=i.bbox.ur.x),i.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=i.bbox.ur.y),this.polys.push(i)}this.isSubject=t}getSweepEvents(){let e=[];for(let t=0,r=this.polys.length;t<r;t++){let n=this.polys[t].getSweepEvents();for(let i=0,a=n.length;i<a;i++)e.push(n[i])}return e}};var Sl=(e,...t)=>nr.run("intersection",e,t);var Ol=(e,...t)=>nr.run("difference",e,t),Ew=Ce.set;function or(e){let t={type:"Feature"};return t.geometry=e,t}function ar(e){return e.type==="Feature"?e.geometry:e}function Rl(e){return e&&e.geometry&&e.geometry.coordinates?e.geometry.coordinates:e}function IL(e){return or({type:"LineString",coordinates:e})}function TL(e){return or({type:"MultiLineString",coordinates:e})}function Bl(e){return or({type:"Polygon",coordinates:e})}function Gl(e){return or({type:"MultiPolygon",coordinates:e})}function Al(e,t){let r=ar(e),n=ar(t),i=Sl(r.coordinates,n.coordinates);return i.length===0?null:i.length===1?Bl(i[0]):Gl(i)}function Nl(e,t){let r=ar(e),n=ar(t),i=Ol(r.coordinates,n.coordinates);return i.length===0?null:i.length===1?Bl(i[0]):Gl(i)}function Fl(e){return Array.isArray(e)?1+Fl(e[0]):-1}function ql(e){e instanceof L.Polyline&&(e=e.toGeoJSON(15));let t=Rl(e),r=Fl(t),n=[];return r>1?t.forEach(i=>{n.push(IL(i))}):n.push(e),n}function jl(e){let t=[];return e.eachLayer(r=>{t.push(Rl(r.toGeoJSON(15)))}),TL(t)}$.Cut=$.Polygon.extend({initialize(e){this._map=e,this._shape="Cut",this.toolbarButtonName="cutPolygon"},_finishShape(){if(this._editedLayers=[],!this.options.allowSelfIntersection&&(this._handleSelfIntersection(!0,this._layer.getLatLngs()[0]),this._doesSelfIntersect)||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;let e=this._layer.getLatLngs();if(e.length<=2)return;let t=L.polygon(e,this.options.pathOptions);t._latlngInfos=this._layer._latlngInfo,this.cut(t),this._cleanupSnapping(),this._otherSnapLayers.splice(this._tempSnapLayerIndex,1),delete this._tempSnapLayerIndex,this._editedLayers.forEach(({layer:n,originalLayer:i})=>{this._fireCut(i,n,i),this._fireCut(this._map,n,i),i.pm._fireEdit()}),this._editedLayers=[];let r=this._hintMarker.getLatLng();this.disable(),this.options.continueDrawing&&(this.enable(),this._hintMarker.setLatLng(r))},cut(e){let t=this._map._layers,r=e._latlngInfos||[];Object.keys(t).map(i=>t[i]).filter(i=>i.pm).filter(i=>!i._pmTempLayer).filter(i=>!L.PM.optIn&&!i.options.pmIgnore||L.PM.optIn&&i.options.pmIgnore===!1).filter(i=>i instanceof L.Polyline).filter(i=>i!==e).filter(i=>i.pm.options.allowCutting).filter(i=>this.options.layersToCut&&L.Util.isArray(this.options.layersToCut)&&this.options.layersToCut.length>0?this.options.layersToCut.indexOf(i)>-1:!0).filter(i=>!this._layerGroup.hasLayer(i)).filter(i=>{try{let a=!!Ae(e.toGeoJSON(15),i.toGeoJSON(15)).features.length>0;return a||i instanceof L.Polyline&&!(i instanceof L.Polygon)?a:!!Al(e.toGeoJSON(15),i.toGeoJSON(15))}catch{return i instanceof L.Polygon&&console.error("You can't cut polygons with self-intersections"),!1}}).forEach(i=>{let a;if(i instanceof L.Polygon){a=L.polygon(i.getLatLngs());let l=a.getLatLngs();r.forEach(f=>{if(f&&f.snapInfo){let{latlng:d}=f,g=this._calcClosestLayer(d,[a]);if(g&&g.segment&&g.distance<this.options.snapDistance){let{segment:M}=g;if(M&&M.length===2){let{indexPath:I,parentPath:T,newIndex:m}=L.PM.Utils._getIndexFromSegment(l,M);(I.length>1?(0,Vl.default)(l,T):l).splice(m,0,d)}}}})}else a=i;let o=this._cutLayer(e,a),s=L.geoJSON(o,i.options);s.getLayers().length===1&&([s]=s.getLayers()),this._setPane(s,"layerPane");let c=s.addTo(this._map.pm._getContainingLayer());if(c.pm.enable(i.pm.options),c.pm.disable(),i._pmTempLayer=!0,e._pmTempLayer=!0,i.remove(),i.removeFrom(this._map.pm._getContainingLayer()),e.remove(),e.removeFrom(this._map.pm._getContainingLayer()),c.getLayers&&c.getLayers().length===0&&this._map.pm.removeLayer({target:c}),c instanceof L.LayerGroup?(c.eachLayer(l=>{this._addDrawnLayerProp(l)}),this._addDrawnLayerProp(c)):this._addDrawnLayerProp(c),this.options.layersToCut&&L.Util.isArray(this.options.layersToCut)&&this.options.layersToCut.length>0){let l=this.options.layersToCut.indexOf(i);l>-1&&this.options.layersToCut.splice(l,1)}this._editedLayers.push({layer:c,originalLayer:i})})},_cutLayer(e,t){let r=L.geoJSON(),n;if(t instanceof L.Polygon)n=Nl(t.toGeoJSON(15),e.toGeoJSON(15));else{let i=ql(t);i.forEach(a=>{let o=cl(a,e.toGeoJSON(15)),s;o&&o.features.length>0?s=L.geoJSON(o):s=L.geoJSON(a),s.getLayers().forEach(c=>{bl(e.toGeoJSON(15),c.toGeoJSON(15))||c.addTo(r)})}),i.length>1?n=jl(r):n=r.toGeoJSON(15)}return n},_change:L.Util.falseFn});$.Text=$.extend({initialize(e){this._map=e,this._shape="Text",this.toolbarButtonName="drawText"},enable(e){L.Util.setOptions(this,e),this._enabled=!0,this._map.on("click",this._createMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._hintMarker=L.marker(this._map.getCenter(),{interactive:!1,zIndexOffset:100,icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._setPane(this._hintMarker,"vertexPane"),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(V("tooltips.placeText"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._layer=this._hintMarker,this._map.on("mousemove",this._syncHintMarker,this),this._map.getContainer().classList.add("geoman-draw-cursor"),this._fireDrawStart(),this._setGlobalDrawMode()},disable(){this._enabled&&(this._enabled=!1,this._map.off("click",this._createMarker,this),this._hintMarker?.remove(),this._map.getContainer().classList.remove("geoman-draw-cursor"),this._map.off("mousemove",this._syncHintMarker,this),this._map.off("mousemove",this._showHintMarkerAfterMoving,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled(){return this._enabled},toggle(e){this.enabled()?this.disable():this.enable(e)},_syncHintMarker(e){if(this._hintMarker.setLatLng(e.latlng),this.options.snappable){let t=e;t.target=this._hintMarker,this._handleSnapping(t)}},_createMarker(e){if(!e.latlng||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;this._hintMarker._snapped||this._hintMarker.setLatLng(e.latlng);let t=this._hintMarker.getLatLng();if(this.textArea=this._createTextArea(),this.options.textOptions?.className){let i=this.options.textOptions.className.split(" ");this.textArea.classList.add(...i)}let r=this._createTextIcon(this.textArea),n=new L.Marker(t,{textMarker:!0,_textMarkerOverPM:!0,icon:r});if(this._setPane(n,"markerPane"),this._finishLayer(n),n.pm||(n.options.draggable=!1),n.addTo(this._map.pm._getContainingLayer()),n.pm){n.pm.textArea=this.textArea,L.setOptions(n.pm,{removeIfEmpty:this.options.textOptions?.removeIfEmpty??!0});let i=this.options.textOptions?.focusAfterDraw??!0;n.pm._createTextMarker(i),this.options.textOptions?.text&&n.pm.setText(this.options.textOptions.text)}this._fireCreate(n),this._cleanupSnapping(),this.disable(),this.options.continueDrawing&&this._map.once("mousemove",this._showHintMarkerAfterMoving,this)},_showHintMarkerAfterMoving(e){this.enable(),this._hintMarker.setLatLng(e.latlng)},_createTextArea(){let e=document.createElement("textarea");return e.readOnly=!0,e.classList.add("pm-textarea","pm-disabled"),e},_createTextIcon(e){return L.divIcon({className:"pm-text-marker",html:e})}});var DL={enableLayerDrag(){if(!this.options.draggable||!this._layer._map)return;this.disable(),this._layerDragEnabled=!0,this._map||(this._map=this._layer._map),(this._layer instanceof L.Marker||this._layer instanceof L.ImageOverlay)&&L.DomEvent.on(this._getDOMElem(),"dragstart",this._stopDOMImageDrag),this._layer.dragging&&this._layer.dragging.disable(),this._tempDragCoord=null,Re(this._layer)instanceof L.Canvas?(this._layer.on("mouseout",this.removeDraggingClass,this),this._layer.on("mouseover",this.addDraggingClass,this)):this.addDraggingClass(),this._originalMapDragState=this._layer._map.dragging._enabled,this._safeToCacheDragState=!0;let e=this._getDOMElem();e&&(Re(this._layer)instanceof L.Canvas?(this._layer.on("touchstart mousedown",this._dragMixinOnMouseDown,this),this._map.pm._addTouchEvents(e)):L.DomEvent.on(e,"touchstart mousedown",this._simulateMouseDownEvent,this)),this._fireDragEnable()},disableLayerDrag(){this._layerDragEnabled=!1,Re(this._layer)instanceof L.Canvas?(this._layer.off("mouseout",this.removeDraggingClass,this),this._layer.off("mouseover",this.addDraggingClass,this)):this.removeDraggingClass(),this._originalMapDragState&&this._dragging&&this._map.dragging.enable(),this._safeToCacheDragState=!1,this._layer.dragging&&this._layer.dragging.disable();let e=this._getDOMElem();e&&(Re(this._layer)instanceof L.Canvas?(this._layer.off("touchstart mousedown",this._dragMixinOnMouseDown,this),this._map.pm._removeTouchEvents(e)):L.DomEvent.off(e,"touchstart mousedown",this._simulateMouseDownEvent,this)),this._layerDragged&&this._fireUpdate(),this._layerDragged=!1,this._fireDragDisable()},dragging(){return this._dragging},layerDragEnabled(){return!!this._layerDragEnabled},_simulateMouseDownEvent(e){let t=e.touches?e.touches[0]:e,r={originalEvent:t,target:this._layer};return r.containerPoint=this._map.mouseEventToContainerPoint(t),r.latlng=this._map.containerPointToLatLng(r.containerPoint),this._dragMixinOnMouseDown(r),!1},_simulateMouseMoveEvent(e){let t=e.touches?e.touches[0]:e,r={originalEvent:t,target:this._layer};return r.containerPoint=this._map.mouseEventToContainerPoint(t),r.latlng=this._map.containerPointToLatLng(r.containerPoint),this._dragMixinOnMouseMove(r),!1},_simulateMouseUpEvent(e){let r={originalEvent:e.touches?e.touches[0]:e,target:this._layer};return e.type.indexOf("touch")===-1&&(r.containerPoint=this._map.mouseEventToContainerPoint(e),r.latlng=this._map.containerPointToLatLng(r.containerPoint)),this._dragMixinOnMouseUp(r),!1},_dragMixinOnMouseDown(e){if(e.originalEvent.button>0)return;this._overwriteEventIfItComesFromMarker(e);let t=e._fromLayerSync,r=this._syncLayers("_dragMixinOnMouseDown",e);if(this._layer instanceof L.Marker&&(this.options.snappable&&!t&&!r?this._initSnappableMarkers():this._disableSnapping()),this._layer instanceof L.CircleMarker){let n="resizeableCircleMarker";this._layer instanceof L.Circle&&(n="resizeableCircle"),this.options.snappable&&!t&&!r?this._layer.pm.options[n]||this._initSnappableMarkersDrag():this._layer.pm.options[n]?this._layer.pm._disableSnapping():this._layer.pm._disableSnappingDrag()}this._safeToCacheDragState&&(this._originalMapDragState=this._layer._map.dragging._enabled,this._safeToCacheDragState=!1),this._tempDragCoord=e.latlng,L.DomEvent.on(this._map.getContainer(),"touchend mouseup",this._simulateMouseUpEvent,this),L.DomEvent.on(this._map.getContainer(),"touchmove mousemove",this._simulateMouseMoveEvent,this)},_dragMixinOnMouseMove(e){this._overwriteEventIfItComesFromMarker(e);let t=this._getDOMElem();this._syncLayers("_dragMixinOnMouseMove",e),this._dragging||(this._dragging=!0,L.DomUtil.addClass(t,"leaflet-pm-dragging"),this._layer instanceof L.Marker||this._layer.bringToFront(),this._originalMapDragState&&this._map.dragging.disable(),this._fireDragStart()),this._tempDragCoord||(this._tempDragCoord=e.latlng),this._onLayerDrag(e),this._layer instanceof L.CircleMarker&&this._layer.pm._updateHiddenPolyCircle()},_dragMixinOnMouseUp(e){let t=this._getDOMElem();return this._syncLayers("_dragMixinOnMouseUp",e),this._originalMapDragState&&this._map.dragging.enable(),this._safeToCacheDragState=!0,L.DomEvent.off(this._map.getContainer(),"touchmove mousemove",this._simulateMouseMoveEvent,this),L.DomEvent.off(this._map.getContainer(),"touchend mouseup",this._simulateMouseUpEvent,this),this._dragging?(this._layer instanceof L.CircleMarker&&this._layer.pm._updateHiddenPolyCircle(),this._layerDragged=!0,window.setTimeout(()=>{this._dragging=!1,t&&L.DomUtil.removeClass(t,"leaflet-pm-dragging"),this._fireDragEnd(),this._fireEdit(),this._layerEdited=!0},10),!0):!1},_onLayerDrag(e){let{latlng:t}=e,r={lat:t.lat-this._tempDragCoord.lat,lng:t.lng-this._tempDragCoord.lng},n=i=>i.map(a=>{if(Array.isArray(a))return n(a);let o={lat:a.lat+r.lat,lng:a.lng+r.lng};return(a.alt||a.alt===0)&&(o.alt=a.alt),o});if(this._layer instanceof L.Circle&&this._layer.options.resizeableCircle||this._layer instanceof L.CircleMarker&&this._layer.options.resizeableCircleMarker){let i=n([this._layer.getLatLng()]);this._layer.setLatLng(i[0]),this._fireChange(this._layer.getLatLng(),"Edit")}else if(this._layer instanceof L.CircleMarker||this._layer instanceof L.Marker){let i=this._layer.getLatLng();this._layer._snapped&&(i=this._layer._orgLatLng);let a=n([i]);this._layer.setLatLng(a[0]),this._fireChange(this._layer.getLatLng(),"Edit")}else if(this._layer instanceof L.ImageOverlay){let i=n([this._layer.getBounds().getNorthWest(),this._layer.getBounds().getSouthEast()]);this._layer.setBounds(i),this._fireChange(this._layer.getBounds(),"Edit")}else{let i=n(this._layer.getLatLngs());this._layer.setLatLngs(i),this._fireChange(this._layer.getLatLngs(),"Edit")}this._tempDragCoord=t,e.layer=this._layer,this._fireDrag(e)},addDraggingClass(){let e=this._getDOMElem();e&&L.DomUtil.addClass(e,"leaflet-pm-draggable")},removeDraggingClass(){let e=this._getDOMElem();e&&L.DomUtil.removeClass(e,"leaflet-pm-draggable")},_getDOMElem(){let e=null;return this._layer._path?e=this._layer._path:this._layer._renderer&&this._layer._renderer._container?e=this._layer._renderer._container:this._layer._image?e=this._layer._image:this._layer._icon&&(e=this._layer._icon),e},_overwriteEventIfItComesFromMarker(e){e.target.getLatLng&&(!e.target._radius||e.target._radius<=10)&&(e.containerPoint=this._map.mouseEventToContainerPoint(e.originalEvent),e.latlng=this._map.containerPointToLatLng(e.containerPoint))},_syncLayers(e,t){if(this.enabled())return!1;if(!t._fromLayerSync&&this._layer===t.target&&this.options.syncLayersOnDrag){t._fromLayerSync=!0;let r=[];if(L.Util.isArray(this.options.syncLayersOnDrag))r=this.options.syncLayersOnDrag,this.options.syncLayersOnDrag.forEach(n=>{n instanceof L.LayerGroup&&(r=r.concat(n.pm.getLayers(!0)))});else if(this.options.syncLayersOnDrag===!0&&this._parentLayerGroup)for(let n in this._parentLayerGroup){let i=this._parentLayerGroup[n];i.pm&&(r=i.pm.getLayers(!0))}return L.Util.isArray(r)&&r.length>0&&(r=r.filter(n=>!!n.pm).filter(n=>!!n.pm.options.draggable),r.forEach(n=>{n!==this._layer&&n.pm[e]&&(n._snapped=!1,n.pm[e](t))})),r.length>0}return!1},_stopDOMImageDrag(e){return e.preventDefault(),!1}},Ul=DL;var Kl=Te(vt());function SL(e,t,r,n){return r.unproject(t.transform(r.project(e,n)),n)}function Qr(e,t,r){let n=r.getMaxZoom();if(n===1/0&&(n=r.getZoom()),L.Util.isArray(e)){let i=[];return e.forEach(a=>{i.push(Qr(a,t,r))}),i}return e instanceof L.LatLng?SL(e,t,r,n):null}function Fe(e,t){t instanceof L.Layer&&(t=t.getLatLng());let r=e.getMaxZoom();return r===1/0&&(r=e.getZoom()),e.project(t,r)}function Gt(e,t){let r=e.getMaxZoom();return r===1/0&&(r=e.getZoom()),e.unproject(t,r)}var OL={_onRotateStart(e){this._preventRenderingMarkers(!0),this._rotationOriginLatLng=this._getRotationCenter().clone(),this._rotationOriginPoint=Fe(this._map,this._rotationOriginLatLng),this._rotationStartPoint=Fe(this._map,e.target.getLatLng()),this._initialRotateLatLng=Ee(this._layer),this._startAngle=this.getAngle();let t=Ee(this._rotationLayer,this._rotationLayer.pm._rotateOrgLatLng);this._fireRotationStart(this._rotationLayer,t),this._fireRotationStart(this._map,t)},_onRotate(e){let t=Fe(this._map,e.target.getLatLng()),r=this._rotationStartPoint,n=this._rotationOriginPoint,i=Math.atan2(t.y-n.y,t.x-n.x)-Math.atan2(r.y-n.y,r.x-n.x);this._layer.setLatLngs(this._rotateLayer(i,this._initialRotateLatLng,this._rotationOriginLatLng,L.PM.Matrix.init(),this._map));let a=this;function o(f,d=[],g=-1){if(g>-1&&d.push(g),L.Util.isArray(f[0]))f.forEach((M,I)=>o(M,d.slice(),I));else{let M=d.length>0?(0,Kl.default)(a._markers,d):a._markers[0];f.forEach((I,T)=>{M[T].setLatLng(I)})}}o(this._layer.getLatLngs());let s=Ee(this._rotationLayer);this._rotationLayer.setLatLngs(this._rotateLayer(i,this._rotationLayer.pm._rotateOrgLatLng,this._rotationOriginLatLng,L.PM.Matrix.init(),this._map));let c=i*180/Math.PI;c=c<0?c+360:c;let l=c+this._startAngle;this._setAngle(l),this._rotationLayer.pm._setAngle(l),this._fireRotation(this._rotationLayer,c,s),this._fireRotation(this._map,c,s),this._rotationLayer.pm._fireChange(this._rotationLayer.getLatLngs(),"Rotation")},_onRotateEnd(){let e=this._startAngle;delete this._rotationOriginLatLng,delete this._rotationOriginPoint,delete this._rotationStartPoint,delete this._initialRotateLatLng,delete this._startAngle;let t=Ee(this._rotationLayer,this._rotationLayer.pm._rotateOrgLatLng);this._rotationLayer.pm._rotateOrgLatLng=Ee(this._rotationLayer),this._fireRotationEnd(this._rotationLayer,e,t),this._fireRotationEnd(this._map,e,t),this._rotationLayer.pm._fireEdit(this._rotationLayer,"Rotation"),this._preventRenderingMarkers(!1),this._layerRotated=!0},_rotateLayer(e,t,r,n,i){let a=Fe(i,r);return this._matrix=n.clone().rotate(e,a).flip(),Qr(t,this._matrix,i)},_setAngle(e){e=e<0?e+360:e,this._angle=e%360},_getRotationCenter(){if(this._rotationCenter)return this._rotationCenter;let e=L.polygon(this._layer.getLatLngs(),{stroke:!1,fill:!1,pmIgnore:!0}).addTo(this._layer._map),t=e.getCenter();return e.removeFrom(this._layer._map),t},enableRotate(){if(!this.options.allowRotation){this.disableRotate();return}this.rotateEnabled()&&this.disableRotate(),this._layer instanceof L.Rectangle&&this._angle===void 0&&this.setInitAngle(xt(this._layer._map,this._layer.getLatLngs()[0][0],this._layer.getLatLngs()[0][1])||0);let e={fill:!1,stroke:!1,pmIgnore:!1,snapIgnore:!0};this._rotatePoly=L.polygon(this._layer.getLatLngs(),e),this._rotatePoly._pmTempLayer=!0,this._rotatePoly.addTo(this._layer._map),this._rotatePoly.pm._setAngle(this.getAngle()),this._rotatePoly.pm.setRotationCenter(this.getRotationCenter()),this._rotatePoly.pm.setOptions(this._layer._map.pm.getGlobalOptions()),this._rotatePoly.pm.setOptions({rotate:!0,snappable:!1,hideMiddleMarkers:!0}),this._rotatePoly.pm._rotationLayer=this._layer,this._rotatePoly.pm.enable(),this._rotateOrgLatLng=Ee(this._layer),this._rotateEnabled=!0,this._layer.on("remove",this.disableRotate,this),this._fireRotationEnable(this._layer),this._fireRotationEnable(this._layer._map)},disableRotate(){this.rotateEnabled()&&(this._rotatePoly.pm._layerRotated&&this._fireUpdate(),this._rotatePoly.pm._layerRotated=!1,this._rotatePoly.pm.disable(),this._rotatePoly.remove(),this._rotatePoly.pm.setOptions({rotate:!1}),this._rotatePoly=void 0,this._rotateOrgLatLng=void 0,this._layer.off("remove",this.disableRotate,this),this._rotateEnabled=!1,this._fireRotationDisable(this._layer),this._fireRotationDisable(this._layer._map))},rotateEnabled(){return!!this._rotateEnabled},rotateLayer(e){let t=this.getAngle(),r=this._layer.getLatLngs(),n=e*(Math.PI/180);this._layer.setLatLngs(this._rotateLayer(n,this._layer.getLatLngs(),this._getRotationCenter(),L.PM.Matrix.init(),this._layer._map)),this._rotateOrgLatLng=L.polygon(this._layer.getLatLngs()).getLatLngs(),this._setAngle(this.getAngle()+e),this.rotateEnabled()&&this._rotatePoly&&this._rotatePoly.pm.enabled()&&(this._rotatePoly.setLatLngs(this._rotateLayer(n,this._rotatePoly.getLatLngs(),this._getRotationCenter(),L.PM.Matrix.init(),this._rotatePoly._map)),this._rotatePoly.pm._initMarkers());let i=this.getAngle()-t;i=i<0?i+360:i,this._startAngle=t,this._fireRotation(this._layer,i,r,this._layer),this._fireRotation(this._map||this._layer._map,i,r,this._layer),delete this._startAngle,this._fireChange(this._layer.getLatLngs(),"Rotation")},rotateLayerToAngle(e){let t=e-this.getAngle();this.rotateLayer(t)},getAngle(){return this._angle||0},setInitAngle(e){this._setAngle(e)},getRotationCenter(){return this._getRotationCenter()},setRotationCenter(e){this._rotationCenter=e,this._rotatePoly&&this._rotatePoly.pm.setRotationCenter(e)}},zl=OL;var RL=L.Class.extend({includes:[Ul,zt,zl,Oe],options:{snappable:!0,snapDistance:20,allowSelfIntersection:!0,allowSelfIntersectionEdit:!1,preventMarkerRemoval:!1,removeLayerBelowMinVertexCount:!0,limitMarkersToCount:-1,hideMiddleMarkers:!1,snapSegment:!0,syncLayersOnDrag:!1,draggable:!0,allowEditing:!0,allowRemoval:!0,allowCutting:!0,allowRotation:!0,addVertexOn:"click",removeVertexOn:"contextmenu",removeVertexValidation:void 0,addVertexValidation:void 0,moveVertexValidation:void 0,resizeableCircleMarker:!1,resizeableCircle:!0,snapMiddle:!1,snapVertex:!0},setOptions(e){L.Util.setOptions(this,e)},getOptions(){return this.options},applyOptions(){},isPolygon(){return this._layer instanceof L.Polygon},getShape(){return this._shape},_setPane(e,t){t==="layerPane"?e.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.layerPane||"overlayPane":t==="vertexPane"?e.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.vertexPane||"markerPane":t==="markerPane"&&(e.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.markerPane||"markerPane")},remove(){(this._map||this._layer._map).pm.removeLayer({target:this._layer})},_vertexValidation(e,t){let r=t.target,n={layer:this._layer,marker:r,event:t},i="";return e==="move"?i="moveVertexValidation":e==="add"?i="addVertexValidation":e==="remove"&&(i="removeVertexValidation"),this.options[i]&&typeof this.options[i]=="function"&&!this.options[i](n)?(e==="move"&&(r._cancelDragEventChain=r.getLatLng()),!1):(r._cancelDragEventChain=null,!0)},_vertexValidationDrag(e){return e._cancelDragEventChain?(e._latlng=e._cancelDragEventChain,e.update(),!1):!0},_vertexValidationDragEnd(e){return e._cancelDragEventChain?(e._cancelDragEventChain=null,!1):!0}}),Y=RL;Y.LayerGroup=L.Class.extend({initialize(e){this._layerGroup=e,this._layers=this.getLayers(),this._getMap(),this._layers.forEach(n=>this._initLayer(n));let t=n=>{if(n.layer._pmTempLayer)return;this._layers=this.getLayers();let i=this._layers.filter(a=>!a.pm._parentLayerGroup||!(this._layerGroup._leaflet_id in a.pm._parentLayerGroup));i.forEach(a=>{this._initLayer(a)}),i.length>0&&this._getMap()&&this._getMap().pm.globalEditModeEnabled()&&this.enabled()&&this.enable(this.getOptions())};this._layerGroup.on("layeradd",L.Util.throttle(t,100,this),this),this._layerGroup.on("layerremove",n=>{this._removeLayerFromGroup(n.target)},this);let r=n=>{n.target._pmTempLayer||(this._layers=this.getLayers())};this._layerGroup.on("layerremove",L.Util.throttle(r,100,this),this)},enable(e,t=[]){t.length===0&&(this._layers=this.getLayers()),this._options=e,this._layers.forEach(r=>{r instanceof L.LayerGroup?t.indexOf(r._leaflet_id)===-1&&(t.push(r._leaflet_id),r.pm.enable(e,t)):r.pm.enable(e)})},disable(e=[]){e.length===0&&(this._layers=this.getLayers()),this._layers.forEach(t=>{t instanceof L.LayerGroup?e.indexOf(t._leaflet_id)===-1&&(e.push(t._leaflet_id),t.pm.disable(e)):t.pm.disable()})},enabled(e=[]){return e.length===0&&(this._layers=this.getLayers()),!!this._layers.find(r=>r instanceof L.LayerGroup?e.indexOf(r._leaflet_id)===-1?(e.push(r._leaflet_id),r.pm.enabled(e)):!1:r.pm.enabled())},toggleEdit(e,t=[]){t.length===0&&(this._layers=this.getLayers()),this._options=e,this._layers.forEach(r=>{r instanceof L.LayerGroup?t.indexOf(r._leaflet_id)===-1&&(t.push(r._leaflet_id),r.pm.toggleEdit(e,t)):r.pm.toggleEdit(e)})},_initLayer(e){let t=L.Util.stamp(this._layerGroup);e.pm._parentLayerGroup||(e.pm._parentLayerGroup={}),e.pm._parentLayerGroup[t]=this._layerGroup},_removeLayerFromGroup(e){if(e.pm&&e.pm._layerGroup){let t=L.Util.stamp(this._layerGroup);delete e.pm._layerGroup[t]}},dragging(){return this._layers=this.getLayers(),this._layers?!!this._layers.find(t=>t.pm.dragging()):!1},getOptions(){return this.options},_getMap(){return this._map||this._layers.find(e=>!!e._map)?._map||null},getLayers(e=!1,t=!0,r=!0,n=[]){let i=[];return e?this._layerGroup.getLayers().forEach(a=>{i.push(a),a instanceof L.LayerGroup&&n.indexOf(a._leaflet_id)===-1&&(n.push(a._leaflet_id),i=i.concat(a.pm.getLayers(!0,!0,!0,n)))}):i=this._layerGroup.getLayers(),r&&(i=i.filter(a=>!(a instanceof L.LayerGroup))),t&&(i=i.filter(a=>!!a.pm),i=i.filter(a=>!a._pmTempLayer),i=i.filter(a=>!L.PM.optIn&&!a.options.pmIgnore||L.PM.optIn&&a.options.pmIgnore===!1)),i},setOptions(e,t=[]){t.length===0&&(this._layers=this.getLayers()),this.options=e,this._layers.forEach(r=>{r.pm&&(r instanceof L.LayerGroup?t.indexOf(r._leaflet_id)===-1&&(t.push(r._leaflet_id),r.pm.setOptions(e,t)):r.pm.setOptions(e))})}});Y.Marker=Y.extend({_shape:"Marker",initialize(e){this._layer=e,this._enabled=!1,this._layer.on("dragend",this._onDragEnd,this)},enable(e={draggable:!0}){if(L.Util.setOptions(this,e),!this.options.allowEditing||!this._layer._map){this.disable();return}this._map=this._layer._map,this.enabled()&&this.disable(),this.applyOptions(),this._layer.on("remove",this.disable,this),this._enabled=!0,this._layer.on("pm:dragstart",this._onDragStart,this),this._layer.on("pm:dragend",this._onMarkerDragEnd,this),this._fireEnable()},disable(){this.enabled()&&(this.disableLayerDrag(),this._layer.off("remove",this.disable,this),this._layer.off("contextmenu",this._removeMarker,this),this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable(),this._enabled=!1)},enabled(){return this._enabled},toggleEdit(e){this.enabled()?this.disable():this.enable(e)},applyOptions(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping(),this.options.draggable?this.enableLayerDrag():this.disableLayerDrag(),this.options.preventMarkerRemoval||this._layer.on("contextmenu",this._removeMarker,this)},_removeMarker(e){let t=e.target;t.remove(),this._fireRemove(t),this._fireRemove(this._map,t)},_onDragStart(){this._map.pm.Draw.Marker._layerIsDragging=!0},_onMarkerDragEnd(){this._map.pm.Draw.Marker._layerIsDragging=!1},_onDragEnd(){this._fireEdit(),this._layerEdited=!0},_initSnappableMarkers(){let e=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=this.options.snapSegment===void 0?!0:this.options.snapSegment,e.off("pm:drag",this._handleSnapping,this),e.on("pm:drag",this._handleSnapping,this),e.off("pm:dragend",this._cleanupSnapping,this),e.on("pm:dragend",this._cleanupSnapping,this),e.off("pm:dragstart",this._unsnap,this),e.on("pm:dragstart",this._unsnap,this)},_disableSnapping(){let e=this._layer;e.off("pm:drag",this._handleSnapping,this),e.off("pm:dragend",this._cleanupSnapping,this),e.off("pm:dragstart",this._unsnap,this)}});var Ie=Te(vt());var BL={filterMarkerGroup(){this.markerCache=[],this.createCache(),this._layer.on("pm:edit",this.createCache,this),this.applyLimitFilters({}),this.throttledApplyLimitFilters||(this.throttledApplyLimitFilters=L.Util.throttle(this.applyLimitFilters,100,this)),this._layer.on("pm:disable",this._removeMarkerLimitEvents,this),this._layer.on("remove",this._removeMarkerLimitEvents,this),this.options.limitMarkersToCount>-1&&(this._layer.on("pm:vertexremoved",this._initMarkers,this),this._map.on("mousemove",this.throttledApplyLimitFilters,this))},_removeMarkerLimitEvents(){this._map.off("mousemove",this.throttledApplyLimitFilters,this),this._layer.off("pm:edit",this.createCache,this),this._layer.off("pm:disable",this._removeMarkerLimitEvents,this),this._layer.off("pm:vertexremoved",this._initMarkers,this)},createCache(){let e=[...this._markerGroup.getLayers(),...this.markerCache];this.markerCache=e.filter((t,r,n)=>n.indexOf(t)===r)},_removeFromCache(e){let t=this.markerCache.indexOf(e);t>-1&&this.markerCache.splice(t,1)},renderLimits(e){this.markerCache.forEach(t=>{e.includes(t)?this._markerGroup.addLayer(t):this._markerGroup.removeLayer(t)})},applyLimitFilters({latlng:e={lat:0,lng:0}}){if(this._preventRenderMarkers)return;let r=[...this._filterClosestMarkers(e)];this.renderLimits(r)},_filterClosestMarkers(e){let t=[...this.markerCache],r=this.options.limitMarkersToCount;return r===-1?t:(t.sort((i,a)=>{let o=i._latlng.distanceTo(e),s=a._latlng.distanceTo(e);return o-s}),t.filter((i,a)=>r>-1?a<r:!0))},_preventRenderMarkers:!1,_preventRenderingMarkers(e){this._preventRenderMarkers=!!e}},Hl=BL;Y.Line=Y.extend({includes:[Hl],_shape:"Line",initialize(e){this._layer=e,this._enabled=!1},enable(e){if(L.Util.setOptions(this,e),this._map=this._layer._map,!!this._map){if(!this.options.allowEditing){this.disable();return}this.enabled()&&this.disable(),this._enabled=!0,this._initMarkers(),this.applyOptions(),this._layer.on("remove",this.disable,this),this.options.allowSelfIntersection||this._layer.on("pm:vertexremoved",this._handleSelfIntersectionOnVertexRemoval,this),this.options.allowSelfIntersection?this.cachedColor=void 0:(this._layer.options.color!=="#f00000ff"?(this.cachedColor=this._layer.options.color,this.isRed=!1):this.isRed=!0,this._handleLayerStyle()),this._fireEnable()}},disable(){if(!this.enabled()||this._dragging)return;this._enabled=!1,this._markerGroup.clearLayers(),this._markerGroup.removeFrom(this._map),this._layer.off("remove",this.disable,this),this.options.allowSelfIntersection||this._layer.off("pm:vertexremoved",this._handleSelfIntersectionOnVertexRemoval,this);let e=this._layer._path?this._layer._path:this._layer._renderer._container;L.DomUtil.removeClass(e,"leaflet-pm-draggable"),this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable()},enabled(){return this._enabled},toggleEdit(e){return this.enabled()?this.disable():this.enable(e),this.enabled()},applyOptions(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping()},_initMarkers(){let e=this._map,t=this._layer.getLatLngs();this._markerGroup&&(this._markerGroup.removeFrom(e),this._markerGroup.clearLayers()),this._markerGroup=new L.FeatureGroup,this._markerGroup._pmTempLayer=!0;let r=n=>{if(Array.isArray(n[0]))return n.map(r,this);let i=n.map(this._createMarker,this);return this.options.hideMiddleMarkers!==!0&&n.map((a,o)=>{let s=this.isPolygon()?(o+1)%n.length:o+1;return this._createMiddleMarker(i[o],i[s])}),i};this._markers=r(t),this.filterMarkerGroup(),e.addLayer(this._markerGroup)},_createMarker(e){let t=new L.Marker(e,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(t,"vertexPane"),t._pmTempLayer=!0,this.options.rotate?(t.on("dragstart",this._onRotateStart,this),t.on("drag",this._onRotate,this),t.on("dragend",this._onRotateEnd,this)):(t.on("click",this._onVertexClick,this),t.on("dragstart",this._onMarkerDragStart,this),t.on("move",this._onMarkerDrag,this),t.on("dragend",this._onMarkerDragEnd,this),this.options.preventMarkerRemoval||t.on(this.options.removeVertexOn,this._removeMarker,this)),this._markerGroup.addLayer(t),t},_createMiddleMarker(e,t){if(!e||!t)return!1;let r=L.PM.Utils.calcMiddleLatLng(this._map,e.getLatLng(),t.getLatLng()),n=this._createMarker(r),i=L.divIcon({className:"marker-icon marker-icon-middle"});return n.setIcon(i),n.leftM=e,n.rightM=t,e._middleMarkerNext=n,t._middleMarkerPrev=n,n.on(this.options.addVertexOn,this._onMiddleMarkerClick,this),n.on("movestart",this._onMiddleMarkerMoveStart,this),n},_onMiddleMarkerClick(e){let t=e.target;if(!this._vertexValidation("add",e))return;let r=L.divIcon({className:"marker-icon"});t.setIcon(r),this._addMarker(t,t.leftM,t.rightM)},_onMiddleMarkerMoveStart(e){let t=e.target;if(t.on("moveend",this._onMiddleMarkerMoveEnd,this),!this._vertexValidation("add",e)){t.on("move",this._onMiddleMarkerMovePrevent,this);return}t._dragging=!0,this._addMarker(t,t.leftM,t.rightM)},_onMiddleMarkerMovePrevent(e){let t=e.target;this._vertexValidationDrag(t)},_onMiddleMarkerMoveEnd(e){let t=e.target;if(t.off("move",this._onMiddleMarkerMovePrevent,this),t.off("moveend",this._onMiddleMarkerMoveEnd,this),!this._vertexValidationDragEnd(t))return;let r=L.divIcon({className:"marker-icon"});t.setIcon(r),setTimeout(()=>{delete t._dragging},100)},_addMarker(e,t,r){e.off("movestart",this._onMiddleMarkerMoveStart,this),e.off(this.options.addVertexOn,this._onMiddleMarkerClick,this);let n=e.getLatLng(),i=this._layer._latlngs;delete e.leftM,delete e.rightM;let{indexPath:a,index:o,parentPath:s}=L.PM.Utils.findDeepMarkerIndex(this._markers,t),c=a.length>1?(0,Ie.default)(i,s):i,l=a.length>1?(0,Ie.default)(this._markers,s):this._markers;c.splice(o+1,0,n),l.splice(o+1,0,e),this._layer.setLatLngs(i),this.options.hideMiddleMarkers!==!0&&(this._createMiddleMarker(t,e),this._createMiddleMarker(e,r)),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit"),this._fireVertexAdded(e,L.PM.Utils.findDeepMarkerIndex(this._markers,e).indexPath,n),this.options.snappable&&this._initSnappableMarkers()},hasSelfIntersection(){return at(this._layer.toGeoJSON(15)).features.length>0},_handleSelfIntersectionOnVertexRemoval(){this._handleLayerStyle(!0)&&(this._layer.setLatLngs(this._coordsBeforeEdit),this._coordsBeforeEdit=null,this._initMarkers())},_handleLayerStyle(e){let t=this._layer,r,n;if(this.options.allowSelfIntersection?r=!1:(n=at(this._layer.toGeoJSON(15)),r=n.features.length>0),r){if(!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._updateDisabledMarkerStyle(this._markers,!0),this.isRed)return r;e?this._flashLayer():(t.setStyle({color:"#f00000ff"}),this.isRed=!0),this._fireIntersect(n)}else t.setStyle({color:this.cachedColor}),this.isRed=!1,!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._updateDisabledMarkerStyle(this._markers,!1);return r},_flashLayer(){this.cachedColor||(this.cachedColor=this._layer.options.color),this._layer.setStyle({color:"#f00000ff"}),this.isRed=!0,window.setTimeout(()=>{this._layer.setStyle({color:this.cachedColor}),this.isRed=!1},200)},_updateDisabledMarkerStyle(e,t){e.forEach(r=>{Array.isArray(r)?this._updateDisabledMarkerStyle(r,t):r._icon&&(t&&!this._checkMarkerAllowedToDrag(r)?L.DomUtil.addClass(r._icon,"vertexmarker-disabled"):L.DomUtil.removeClass(r._icon,"vertexmarker-disabled"))})},_removeMarker(e){let t=e.target;if(!this._vertexValidation("remove",e))return;this.options.allowSelfIntersection||(this._coordsBeforeEdit=Ee(this._layer,this._layer.getLatLngs()));let r=this._layer.getLatLngs(),{indexPath:n,index:i,parentPath:a}=L.PM.Utils.findDeepMarkerIndex(this._markers,t);if(!n)return;let o=n.length>1?(0,Ie.default)(r,a):r,s=n.length>1?(0,Ie.default)(this._markers,a):this._markers,c=a[a.length-1]>0&&this._layer instanceof L.Polygon;if(!this.options.removeLayerBelowMinVertexCount&&!c&&(o.length<=2||this.isPolygon()&&o.length<=3)){this._flashLayer();return}o.splice(i,1),this._layer.setLatLngs(r),this.isPolygon()&&o.length<=2&&o.splice(0,o.length);let l=!1;if(o.length<=1&&(o.splice(0,o.length),a.length>1&&n.length>1&&(r=Et(r)),this._layer.setLatLngs(r),this._initMarkers(),l=!0),kt(r)||this._layer.remove(),r=Et(r),this._layer.setLatLngs(r),this._markers=Et(this._markers),!l&&(s=n.length>1?(0,Ie.default)(this._markers,a):this._markers,t._middleMarkerPrev&&(this._markerGroup.removeLayer(t._middleMarkerPrev),this._removeFromCache(t._middleMarkerPrev)),t._middleMarkerNext&&(this._markerGroup.removeLayer(t._middleMarkerNext),this._removeFromCache(t._middleMarkerNext)),this._markerGroup.removeLayer(t),this._removeFromCache(t),s)){let f,d;if(this.isPolygon()?(f=(i+1)%s.length,d=(i+(s.length-1))%s.length):(d=i-1<0?void 0:i-1,f=i+1>=s.length?void 0:i+1),f!==d){let g=s[d],M=s[f];this.options.hideMiddleMarkers!==!0&&this._createMiddleMarker(g,M)}s.splice(i,1)}this._fireEdit(),this._layerEdited=!0,this._fireVertexRemoved(t,n),this._fireChange(this._layer.getLatLngs(),"Edit")},updatePolygonCoordsFromMarkerDrag(e){let t=this._layer.getLatLngs(),r=e.getLatLng(),{indexPath:n,index:i,parentPath:a}=L.PM.Utils.findDeepMarkerIndex(this._markers,e),o=n.length>1?(0,Ie.default)(t,a):t;r.alt=o[i].alt,o.splice(i,1,r),this._layer.setLatLngs(t)},_getNeighborMarkers(e){let{indexPath:t,index:r,parentPath:n}=L.PM.Utils.findDeepMarkerIndex(this._markers,e),i=t.length>1?(0,Ie.default)(this._markers,n):this._markers,a=(r+1)%i.length,o=(r+(i.length-1))%i.length,s=i[o],c=i[a];return{prevMarker:s,nextMarker:c}},_checkMarkerAllowedToDrag(e){let{prevMarker:t,nextMarker:r}=this._getNeighborMarkers(e),n=L.polyline([t.getLatLng(),e.getLatLng()]),i=L.polyline([e.getLatLng(),r.getLatLng()]),o=Ae(this._layer.toGeoJSON(15),n.toGeoJSON(15)).features.filter(l=>{let f=l.geometry.coordinates,d=L.latLng(f[1],f[0]);return!d.equals(t.getLatLng())&&!d.equals(e.getLatLng())}).length,c=Ae(this._layer.toGeoJSON(15),i.toGeoJSON(15)).features.filter(l=>{let f=l.geometry.coordinates,d=L.latLng(f[1],f[0]);return!d.equals(r.getLatLng())&&!d.equals(e.getLatLng())}).length;return!(o<1&&c<1)},_onMarkerDragStart(e){let t=e.target;if(this._preventRenderingMarkers(!0),this.cachedColor||(this.cachedColor=this._layer.options.color),!this._vertexValidation("move",e))return;let{indexPath:r}=L.PM.Utils.findDeepMarkerIndex(this._markers,t);this._fireMarkerDragStart(e,r),this.options.allowSelfIntersection||(this._coordsBeforeEdit=Ee(this._layer,this._layer.getLatLngs())),!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this.hasSelfIntersection()?this._markerAllowedToDrag=this._checkMarkerAllowedToDrag(t):this._markerAllowedToDrag=null},_onMarkerDrag(e){let t=e.target;if(!this._vertexValidationDrag(t))return;let{indexPath:r,index:n,parentPath:i}=L.PM.Utils.findDeepMarkerIndex(this._markers,t);if(!r)return;if(!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this.hasSelfIntersection()&&this._markerAllowedToDrag===!1){this._layer.setLatLngs(this._coordsBeforeEdit),this._initMarkers(),this._handleLayerStyle();return}this.updatePolygonCoordsFromMarkerDrag(t);let a=r.length>1?(0,Ie.default)(this._markers,i):this._markers,o=(n+1)%a.length,s=(n+(a.length-1))%a.length,c=t.getLatLng(),l=a[s].getLatLng(),f=a[o].getLatLng();if(t._middleMarkerNext){let d=L.PM.Utils.calcMiddleLatLng(this._map,c,f);t._middleMarkerNext.setLatLng(d)}if(t._middleMarkerPrev){let d=L.PM.Utils.calcMiddleLatLng(this._map,c,l);t._middleMarkerPrev.setLatLng(d)}this.options.allowSelfIntersection||this._handleLayerStyle(),this._fireMarkerDrag(e,r),this._fireChange(this._layer.getLatLngs(),"Edit")},_onMarkerDragEnd(e){let t=e.target;if(this._preventRenderingMarkers(!1),!this._vertexValidationDragEnd(t))return;let{indexPath:r}=L.PM.Utils.findDeepMarkerIndex(this._markers,t),n=!this.options.allowSelfIntersection&&this.hasSelfIntersection();n&&this.options.allowSelfIntersectionEdit&&this._markerAllowedToDrag&&(n=!1);let i=!this.options.allowSelfIntersection&&n;if(this._fireMarkerDragEnd(e,r,i),i){this._layer.setLatLngs(this._coordsBeforeEdit),this._coordsBeforeEdit=null,this._initMarkers(),this.options.snappable&&this._initSnappableMarkers(),this._handleLayerStyle(),this._fireLayerReset(e,r);return}!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._handleLayerStyle(),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit")},_onVertexClick(e){let t=e.target;if(t._dragging)return;let{indexPath:r}=L.PM.Utils.findDeepMarkerIndex(this._markers,t);this._fireVertexClick(e,r)}});Y.Polygon=Y.Line.extend({_shape:"Polygon",_checkMarkerAllowedToDrag(e){let{prevMarker:t,nextMarker:r}=this._getNeighborMarkers(e),n=L.polyline([t.getLatLng(),e.getLatLng()]),i=L.polyline([e.getLatLng(),r.getLatLng()]),o=Ae(this._layer.toGeoJSON(15),n.toGeoJSON(15)).features.filter(l=>{let f=l.geometry.coordinates,d=L.latLng(f[1],f[0]);return!d.equals(t.getLatLng())&&!d.equals(e.getLatLng())}).length,c=Ae(this._layer.toGeoJSON(15),i.toGeoJSON(15)).features.filter(l=>{let f=l.geometry.coordinates,d=L.latLng(f[1],f[0]);return!d.equals(r.getLatLng())&&!d.equals(e.getLatLng())}).length;return!(o<1&&c<1)}});Y.Rectangle=Y.Polygon.extend({_shape:"Rectangle",_initMarkers(){let e=this._map,t=this._findCorners();this._markerGroup&&this._markerGroup.clearLayers(),this._markerGroup=new L.FeatureGroup,this._markerGroup._pmTempLayer=!0,e.addLayer(this._markerGroup),this._markers=[],this._markers[0]=t.map(this._createMarker,this),[this._cornerMarkers]=this._markers,this._layer.getLatLngs()[0].forEach((r,n)=>{let i=this._cornerMarkers.find(a=>a._index===n);i&&i.setLatLng(r)})},applyOptions(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping(),this._addMarkerEvents()},_createMarker(e,t){let r=new L.Marker(e,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(r,"vertexPane"),r._origLatLng=e,r._index=t,r._pmTempLayer=!0,r.on("click",this._onVertexClick,this),this._markerGroup.addLayer(r),r},_addMarkerEvents(){this._markers[0].forEach(e=>{e.on("dragstart",this._onMarkerDragStart,this),e.on("drag",this._onMarkerDrag,this),e.on("dragend",this._onMarkerDragEnd,this),this.options.preventMarkerRemoval||e.on("contextmenu",this._removeMarker,this)})},_removeMarker(){return null},_onMarkerDragStart(e){if(!this._vertexValidation("move",e))return;let t=e.target,r=this._cornerMarkers;t._oppositeCornerLatLng=r.find(i=>i._index===(t._index+2)%4).getLatLng(),t._snapped=!1;let{indexPath:n}=L.PM.Utils.findDeepMarkerIndex(this._markers,t);this._fireMarkerDragStart(e,n)},_onMarkerDrag(e){let t=e.target;if(!this._vertexValidationDrag(t)||t._index===void 0)return;this._adjustRectangleForMarkerMove(t);let{indexPath:r}=L.PM.Utils.findDeepMarkerIndex(this._markers,t);this._fireMarkerDrag(e,r),this._fireChange(this._layer.getLatLngs(),"Edit")},_onMarkerDragEnd(e){let t=e.target;if(!this._vertexValidationDragEnd(t))return;this._cornerMarkers.forEach(n=>{delete n._oppositeCornerLatLng});let{indexPath:r}=L.PM.Utils.findDeepMarkerIndex(this._markers,t);this._fireMarkerDragEnd(e,r),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit")},_adjustRectangleForMarkerMove(e){L.extend(e._origLatLng,e._latlng);let t=L.PM.Utils._getRotatedRectangle(e.getLatLng(),e._oppositeCornerLatLng,this.getAngle(),this._map);this._layer.setLatLngs(t),this._adjustAllMarkers(e),this._layer.redraw()},_adjustAllMarkers(e){let t=this._layer.getLatLngs()[0];if(t&&t.length!==4&&t.length>0)t.forEach((n,i)=>{this._cornerMarkers[i].setLatLng(n)}),this._cornerMarkers.slice(t.length).forEach(n=>{n.setLatLng(t[0])});else if(!t||!t.length)console.error("The layer has no LatLngs");else{let r=t.findIndex(n=>e.getLatLng().equals(n));r>-1?(this._cornerMarkers[(e._index+1)%4].setLatLng(t[(r+1)%4]),this._cornerMarkers[(e._index+2)%4].setLatLng(t[(r+2)%4]),this._cornerMarkers[(e._index+3)%4].setLatLng(t[(r+3)%4])):this._cornerMarkers.forEach(n=>{n.setLatLng(t[n._index])})}},_findCorners(){this._angle===void 0&&this.setInitAngle(xt(this._map,this._layer.getLatLngs()[0][0],this._layer.getLatLngs()[0][1])||0);let e=this._layer.getLatLngs()[0];return L.PM.Utils._getRotatedRectangle(e[0],e[2],this.getAngle(),this._map||this)}});Y.CircleMarker=Y.extend({_shape:"CircleMarker",initialize(e){this._layer=e,this._enabled=!1,this._minRadiusOption="minRadiusCircleMarker",this._maxRadiusOption="maxRadiusCircleMarker",this._editableOption="resizeableCircleMarker",this._updateHiddenPolyCircle()},enable(e={draggable:!0,snappable:!0}){if(L.Util.setOptions(this,e),this.options.editable&&(this.options.resizeableCircleMarker=this.options.editable,delete this.options.editable),!this.options.allowEditing||!this._layer._map){this.disable();return}this._map=this._layer._map,this.enabled()&&this.disable(),this.applyOptions(),this._layer.on("remove",this.disable,this),this._enabled=!0,this._extendingEnable(),this._updateHiddenPolyCircle(),this._fireEnable()},_extendingEnable(){this._layer.on("pm:dragstart",this._onDragStart,this),this._layer.on("pm:drag",this._onMarkerDrag,this),this._layer.on("pm:dragend",this._onMarkerDragEnd,this)},disable(){this.dragging()||(this._map||(this._map=this._layer._map),this._map&&this.enabled()&&(this.layerDragEnabled()&&this.disableLayerDrag(),this._helperLayers&&(this._helperLayers.clearLayers(),this._helperLayers.removeFrom(this._map)),this.options[this._editableOption]?(this._map.off("move",this._syncMarkers,this),this._outerMarker.off("drag",this._handleOuterMarkerSnapping,this)):this._map.off("move",this._updateHiddenPolyCircle,this),this._extendingDisable(),this._layer.off("remove",this.disable,this),this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable(),this._enabled=!1))},_extendingDisable(){this._layer.off("contextmenu",this._removeMarker,this)},enabled(){return this._enabled},toggleEdit(e){this.enabled()?this.disable():this.enable(e)},applyOptions(){this.options[this._editableOption]?(this._initMarkers(),this._map.on("move",this._syncMarkers,this),this.options.snappable?(this._initSnappableMarkers(),this._outerMarker.on("drag",this._handleOuterMarkerSnapping,this),this._outerMarker.on("move",this._syncHintLine,this),this._outerMarker.on("move",this._syncCircleRadius,this)):this._disableSnapping()):(this.options.draggable&&this.enableLayerDrag(),this._map.on("move",this._updateHiddenPolyCircle,this),this.options.snappable?this._initSnappableMarkersDrag():this._disableSnappingDrag()),this._extendingApplyOptions()},_extendingApplyOptions(){this.options.preventMarkerRemoval||this._layer.on("contextmenu",this._removeMarker,this)},_initMarkers(){let e=this._map;this._helperLayers&&(this._helperLayers.removeFrom(e),this._helperLayers.clearLayers()),this._helperLayers=new L.FeatureGroup,this._helperLayers._pmTempLayer=!0,this._helperLayers.addTo(e);let t=this._layer.getLatLng(),r=this._layer._radius,n=this._getLatLngOnCircle(t,r);this._centerMarker=this._createCenterMarker(t),this._outerMarker=this._createOuterMarker(n),this._markers=[this._centerMarker,this._outerMarker],this._createHintLine(this._centerMarker,this._outerMarker)},_getLatLngOnCircle(e,t){let r=this._map.project(e),n=L.point(r.x+t,r.y);return this._map.unproject(n)},_createHintLine(e,t){let r=e.getLatLng(),n=t.getLatLng();this._hintline=L.polyline([r,n],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._helperLayers.addLayer(this._hintline)},_createCenterMarker(e){let t=this._createMarker(e);return this.options.draggable?(L.DomUtil.addClass(t._icon,"leaflet-pm-draggable"),t.on("move",this._moveCircle,this)):t.dragging.disable(),t},_createOuterMarker(e){let t=this._createMarker(e);return t.on("drag",this._resizeCircle,this),t},_createMarker(e){let t=new L.Marker(e,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(t,"vertexPane"),t._origLatLng=e,t._pmTempLayer=!0,t.on("dragstart",this._onMarkerDragStart,this),t.on("drag",this._onMarkerDrag,this),t.on("dragend",this._onMarkerDragEnd,this),t.on("click",this._onVertexClick,this),this._helperLayers.addLayer(t),t},_moveCircle(e){if(e.target._cancelDragEventChain)return;let r=this._centerMarker.getLatLng();this._layer.setLatLng(r);let n=this._layer._radius,i=this._getLatLngOnCircle(r,n);this._outerMarker._latlng=i,this._outerMarker.update(),this._syncHintLine(),this._updateHiddenPolyCircle(),this._fireCenterPlaced("Edit"),this._fireChange(this._layer.getLatLng(),"Edit")},_syncMarkers(){let e=this._layer.getLatLng(),t=this._layer._radius,r=this._getLatLngOnCircle(e,t);this._outerMarker.setLatLng(r),this._centerMarker.setLatLng(e),this._syncHintLine(),this._updateHiddenPolyCircle()},_resizeCircle(){this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker()),this._syncHintLine(),this._syncCircleRadius()},_syncCircleRadius(){let e=this._centerMarker.getLatLng(),t=this._outerMarker.getLatLng(),r=this._distanceCalculation(e,t);this.options[this._minRadiusOption]&&r<this.options[this._minRadiusOption]?this._layer.setRadius(this.options[this._minRadiusOption]):this.options[this._maxRadiusOption]&&r>this.options[this._maxRadiusOption]?this._layer.setRadius(this.options[this._maxRadiusOption]):this._layer.setRadius(r),this._updateHiddenPolyCircle(),this._fireChange(this._layer.getLatLng(),"Edit")},_syncHintLine(){let e=this._centerMarker.getLatLng(),t=this._outerMarker.getLatLng();this._hintline.setLatLngs([e,t])},_removeMarker(){this.options[this._editableOption]&&this.disable(),this._layer.remove(),this._fireRemove(this._layer),this._fireRemove(this._map,this._layer)},_onDragStart(){this._map.pm.Draw.CircleMarker._layerIsDragging=!0},_onMarkerDragStart(e){this._vertexValidation("move",e)&&this._fireMarkerDragStart(e)},_onMarkerDrag(e){let t=e.target;t instanceof L.Marker&&!this._vertexValidationDrag(t)||this._fireMarkerDrag(e)},_onMarkerDragEnd(e){this._extedingMarkerDragEnd();let t=e.target;this._vertexValidationDragEnd(t)&&(this.options[this._editableOption]&&(this._fireEdit(),this._layerEdited=!0),this._fireMarkerDragEnd(e))},_extedingMarkerDragEnd(){this._map.pm.Draw.CircleMarker._layerIsDragging=!1},_initSnappableMarkersDrag(){let e=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=this.options.snapSegment===void 0?!0:this.options.snapSegment,e.off("pm:drag",this._handleSnapping,this),e.on("pm:drag",this._handleSnapping,this),e.off("pm:dragend",this._cleanupSnapping,this),e.on("pm:dragend",this._cleanupSnapping,this),e.off("pm:dragstart",this._unsnap,this),e.on("pm:dragstart",this._unsnap,this)},_disableSnappingDrag(){let e=this._layer;e.off("pm:drag",this._handleSnapping,this),e.off("pm:dragend",this._cleanupSnapping,this),e.off("pm:dragstart",this._unsnap,this)},_updateHiddenPolyCircle(){let e=this._layer._map||this._map;if(e){let t=L.PM.Utils.pxRadiusToMeterRadius(this._layer.getRadius(),e,this._layer.getLatLng()),r=L.circle(this._layer.getLatLng(),this._layer.options);r.setRadius(t);let n=e&&e.pm._isCRSSimple();this._hiddenPolyCircle?this._hiddenPolyCircle.setLatLngs(L.PM.Utils.circleToPolygon(r,200,!n).getLatLngs()):this._hiddenPolyCircle=L.PM.Utils.circleToPolygon(r,200,!n),this._hiddenPolyCircle._parentCopy||(this._hiddenPolyCircle._parentCopy=this._layer)}},_getNewDestinationOfOuterMarker(){let e=this._centerMarker.getLatLng(),t=this._outerMarker.getLatLng(),r=this._distanceCalculation(e,t);return this.options[this._minRadiusOption]&&r<this.options[this._minRadiusOption]?t=it(this._map,e,t,this._getMinDistanceInMeter(e)):this.options[this._maxRadiusOption]&&r>this.options[this._maxRadiusOption]&&(t=it(this._map,e,t,this._getMaxDistanceInMeter(e))),t},_handleOuterMarkerSnapping(){if(this._outerMarker._snapped){let e=this._centerMarker.getLatLng(),t=this._outerMarker.getLatLng(),r=this._distanceCalculation(e,t);this.options[this._minRadiusOption]&&r<this.options[this._minRadiusOption]?this._outerMarker.setLatLng(this._outerMarker._orgLatLng):this.options[this._maxRadiusOption]&&r>this.options[this._maxRadiusOption]&&this._outerMarker.setLatLng(this._outerMarker._orgLatLng)}this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker())},_distanceCalculation(e,t){return this._map.project(e).distanceTo(this._map.project(t))},_getMinDistanceInMeter(e){return L.PM.Utils.pxRadiusToMeterRadius(this.options[this._minRadiusOption],this._map,e)},_getMaxDistanceInMeter(e){return L.PM.Utils.pxRadiusToMeterRadius(this.options[this._maxRadiusOption],this._map,e)},_onVertexClick(e){e.target._dragging||this._fireVertexClick(e,void 0)}});Y.Circle=Y.CircleMarker.extend({_shape:"Circle",initialize(e){this._layer=e,this._enabled=!1,this._minRadiusOption="minRadiusCircle",this._maxRadiusOption="maxRadiusCircle",this._editableOption="resizeableCircle",this._updateHiddenPolyCircle()},enable(e){L.PM.Edit.CircleMarker.prototype.enable.call(this,e||{})},_extendingEnable(){},_extendingDisable(){this._layer.off("remove",this.disable,this);let e=this._layer._path?this._layer._path:this._layer._renderer._container;L.DomUtil.removeClass(e,"leaflet-pm-draggable")},_extendingApplyOptions(){},_syncMarkers(){},_removeMarker(){},_onDragStart(){},_extedingMarkerDragEnd(){},_updateHiddenPolyCircle(){let e=this._map&&this._map.pm._isCRSSimple();this._hiddenPolyCircle?this._hiddenPolyCircle.setLatLngs(L.PM.Utils.circleToPolygon(this._layer,200,!e).getLatLngs()):this._hiddenPolyCircle=L.PM.Utils.circleToPolygon(this._layer,200,!e),this._hiddenPolyCircle._parentCopy||(this._hiddenPolyCircle._parentCopy=this._layer)},_distanceCalculation(e,t){return this._map.distance(e,t)},_getMinDistanceInMeter(){return this.options[this._minRadiusOption]},_getMaxDistanceInMeter(){return this.options[this._maxRadiusOption]},_onVertexClick(e){e.target._dragging||this._fireVertexClick(e,void 0)}});Y.ImageOverlay=Y.extend({_shape:"ImageOverlay",initialize(e){this._layer=e,this._enabled=!1},toggleEdit(e){this.enabled()?this.disable():this.enable(e)},enabled(){return this._enabled},enable(e={draggable:!0,snappable:!0}){if(L.Util.setOptions(this,e),this._map=this._layer._map,!!this._map){if(!this.options.allowEditing){this.disable();return}this.enabled()||this.disable(),this.enableLayerDrag(),this._layer.on("remove",this.disable,this),this._enabled=!0,this._otherSnapLayers=this._findCorners(),this._fireEnable()}},disable(){this._dragging||(this._map||(this._map=this._layer._map),this.disableLayerDrag(),this._layer.off("remove",this.disable,this),this.enabled()||(this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable()),this._enabled=!1)},_findCorners(){let e=this._layer.getBounds(),t=e.getNorthWest(),r=e.getNorthEast(),n=e.getSouthEast(),i=e.getSouthWest();return[t,r,n,i]}});Y.Text=Y.extend({_shape:"Text",initialize(e){this._layer=e,this._enabled=!1},enable(e){if(L.Util.setOptions(this,e),!!this.textArea){if(!this.options.allowEditing||!this._layer._map){this.disable();return}this._map=this._layer._map,this.enabled()&&this.disable(),this.applyOptions(),this._safeToCacheDragState=!0,this._focusChange(),this.textArea.readOnly=!1,this.textArea.classList.remove("pm-disabled"),this._layer.on("remove",this.disable,this),L.DomEvent.on(this.textArea,"input",this._autoResize,this),L.DomEvent.on(this.textArea,"focus",this._focusChange,this),L.DomEvent.on(this.textArea,"blur",this._focusChange,this),this._layer.on("dblclick",L.DomEvent.stop),L.DomEvent.off(this.textArea,"mousedown",this._preventTextSelection),this._enabled=!0,this._fireEnable()}},disable(){if(!this.enabled())return;this._layer.off("remove",this.disable,this),L.DomEvent.off(this.textArea,"input",this._autoResize,this),L.DomEvent.off(this.textArea,"focus",this._focusChange,this),L.DomEvent.off(this.textArea,"blur",this._focusChange,this),document.removeEventListener("click",this._documentClickThis,{capture:!0}),this._focusChange(),this.textArea.readOnly=!0,this.textArea.classList.add("pm-disabled");let e=document.activeElement;this.textArea.focus(),this.textArea.selectionStart=0,this.textArea.selectionEnd=0,L.DomEvent.on(this.textArea,"mousedown",this._preventTextSelection),e.focus(),this._disableOnBlurActive=!1,this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable(),this._enabled=!1},enabled(){return this._enabled},toggleEdit(e){this.enabled()?this.disable():this.enable(e)},applyOptions(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping()},_initSnappableMarkers(){let e=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=this.options.snapSegment===void 0?!0:this.options.snapSegment,e.off("pm:drag",this._handleSnapping,this),e.on("pm:drag",this._handleSnapping,this),e.off("pm:dragend",this._cleanupSnapping,this),e.on("pm:dragend",this._cleanupSnapping,this),e.off("pm:dragstart",this._unsnap,this),e.on("pm:dragstart",this._unsnap,this)},_disableSnapping(){let e=this._layer;e.off("pm:drag",this._handleSnapping,this),e.off("pm:dragend",this._cleanupSnapping,this),e.off("pm:dragstart",this._unsnap,this)},_autoResize(){this.textArea.style.height="1px",this.textArea.style.width="1px";let e=this.textArea.scrollHeight>21?this.textArea.scrollHeight:21,t=this.textArea.scrollWidth>16?this.textArea.scrollWidth:16;this.textArea.style.height=`${e}px`,this.textArea.style.width=`${t}px`,this._layer.options.text=this.getText(),this._fireTextChange(this.getText())},_disableOnBlur(){this._disableOnBlurActive=!0,setTimeout(()=>{this.enabled()&&(this._documentClickThis=this._documentClickThis||this._documentClick.bind(this),document.addEventListener("click",this._documentClickThis,{capture:!0}))},100)},_documentClick(e){e.target!==this.textArea&&(this.disable(),!this.getText()&&this.options.removeIfEmpty&&this.remove())},_focusChange(e={}){let t=this._hasFocus;this._hasFocus=e.type==="focus",!t!=!this._hasFocus&&(this._hasFocus?(this._applyFocus(),this._focusText=this.getText(),this._fireTextFocus()):(this._removeFocus(),this._fireTextBlur(),this._focusText!==this.getText()&&(this._fireEdit(),this._layerEdited=!0)))},_applyFocus(){this.textArea.classList.add("pm-hasfocus"),this._map.dragging&&(this._safeToCacheDragState&&(this._originalMapDragState=this._map.dragging._enabled,this._safeToCacheDragState=!1),this._map.dragging.disable())},_removeFocus(){this._map.dragging&&(this._originalMapDragState&&this._map.dragging.enable(),this._safeToCacheDragState=!0),this.textArea.classList.remove("pm-hasfocus")},focus(){if(!this.enabled())throw new TypeError("Layer is not enabled");this.textArea.focus()},blur(){if(!this.enabled())throw new TypeError("Layer is not enabled");this.textArea.blur(),this._disableOnBlurActive&&this.disable()},hasFocus(){return this._hasFocus},getElement(){return this.textArea},setText(e){e!==void 0&&(this.textArea.value=e),this._autoResize()},getText(){return this.textArea.value},_initTextMarker(){if(this.textArea=L.PM.Draw.Text.prototype._createTextArea.call(this),this.options.className){let t=this.options.className.split(" ");this.textArea.classList.add(...t)}let e=L.PM.Draw.Text.prototype._createTextIcon.call(this,this.textArea);this._layer.setIcon(e),this._layer.once("add",this._createTextMarker,this)},_createTextMarker(e=!1){this._layer.off("add",this._createTextMarker,this),this._layer.getElement().tabIndex=-1,this.textArea.wrap="off",this.textArea.style.overflow="hidden",this.textArea.style.height=L.DomUtil.getStyle(this.textArea,"font-size"),this.textArea.style.width="1px",this._layer.options.text&&this.setText(this._layer.options.text),this._autoResize(),e===!0&&(this.enable(),this.focus(),this._disableOnBlur())},_preventTextSelection(e){e.preventDefault()}});var en=function(t,r,n,i,a,o){this._matrix=[t,r,n,i,a,o]};en.init=()=>new L.PM.Matrix(1,0,0,1,0,0);en.prototype={transform(e){return this._transform(e.clone())},_transform(e){let t=this._matrix,{x:r,y:n}=e;return e.x=t[0]*r+t[1]*n+t[4],e.y=t[2]*r+t[3]*n+t[5],e},untransform(e){let t=this._matrix;return new L.Point((e.x/t[0]-t[4])/t[0],(e.y/t[2]-t[5])/t[2])},clone(){let e=this._matrix;return new L.PM.Matrix(e[0],e[1],e[2],e[3],e[4],e[5])},translate(e){if(e===void 0)return new L.Point(this._matrix[4],this._matrix[5]);let t,r;return typeof e=="number"?(t=e,r=e):(t=e.x,r=e.y),this._add(1,0,0,1,t,r)},scale(e,t){if(e===void 0)return new L.Point(this._matrix[0],this._matrix[3]);let r,n;return t=t||L.point(0,0),typeof e=="number"?(r=e,n=e):(r=e.x,n=e.y),this._add(r,0,0,n,t.x,t.y)._add(1,0,0,1,-t.x,-t.y)},rotate(e,t){let r=Math.cos(e),n=Math.sin(e);return t=t||new L.Point(0,0),this._add(r,n,-n,r,t.x,t.y)._add(1,0,0,1,-t.x,-t.y)},flip(){return this._matrix[1]*=-1,this._matrix[2]*=-1,this},_add(e,t,r,n,i,a){let o=[[],[],[]],s=this._matrix,c=[[s[0],s[2],s[4]],[s[1],s[3],s[5]],[0,0,1]],l=[[e,r,i],[t,n,a],[0,0,1]],f;e&&e instanceof L.PM.Matrix&&(s=e._matrix,l=[[s[0],s[2],s[4]],[s[1],s[3],s[5]],[0,0,1]]);for(let d=0;d<3;d+=1)for(let g=0;g<3;g+=1){f=0;for(let M=0;M<3;M+=1)f+=c[d][M]*l[M][g];o[d][g]=f}return this._matrix=[o[0][0],o[1][0],o[0][1],o[1][1],o[0][2],o[1][2]],this}};var Jl=en;var GL={calcMiddleLatLng(e,t,r){let n=e.project(t),i=e.project(r);return e.unproject(n._add(i)._divideBy(2))},findLayers(e){let t=[];return e.eachLayer(r=>{(r instanceof L.Polyline||r instanceof L.Marker||r instanceof L.Circle||r instanceof L.CircleMarker||r instanceof L.ImageOverlay)&&t.push(r)}),t=t.filter(r=>!!r.pm),t=t.filter(r=>!r._pmTempLayer),t=t.filter(r=>!L.PM.optIn&&!r.options.pmIgnore||L.PM.optIn&&r.options.pmIgnore===!1),t},circleToPolygon(e,t=60,r=!0){let n=e.getLatLng(),i=e.getRadius(),a=Ir(n,i,t,0,r),o=[];for(let s=0;s<a.length;s+=1){let c=[a[s].lat,a[s].lng];o.push(c)}return L.polygon(o,e.options)},disablePopup(e){e.getPopup()&&(e._tempPopupCopy=e.getPopup(),e.unbindPopup())},enablePopup(e){e._tempPopupCopy&&(e.bindPopup(e._tempPopupCopy),delete e._tempPopupCopy)},_fireEvent(e,t,r,n=!1){e.fire(t,r,n);let{groups:i}=this.getAllParentGroups(e);i.forEach(a=>{a.fire(t,r,n)})},getAllParentGroups(e){let t=[],r=[],n=i=>{for(let a in i._eventParents)if(t.indexOf(a)===-1){t.push(a);let o=i._eventParents[a];r.push(o),n(o)}};return!e._pmLastGroupFetch||!e._pmLastGroupFetch.time||new Date().getTime()-e._pmLastGroupFetch.time>1e3?(n(e),e._pmLastGroupFetch={time:new Date().getTime(),groups:r,groupIds:t},{groupIds:t,groups:r}):{groups:e._pmLastGroupFetch.groups,groupIds:e._pmLastGroupFetch.groupIds}},createGeodesicPolygon:Ir,getTranslation:V,findDeepCoordIndex(e,t,r=!0){let n,i=o=>(s,c)=>{let l=o.concat(c);if(r){if(s.lat&&s.lat===t.lat&&s.lng===t.lng)return n=l,!0}else if(s.lat&&L.latLng(s).equals(t))return n=l,!0;return Array.isArray(s)&&s.some(i(l))};e.some(i([]));let a={};return n&&(a={indexPath:n,index:n[n.length-1],parentPath:n.slice(0,n.length-1)}),a},findDeepMarkerIndex(e,t){let r,n=a=>(o,s)=>{let c=a.concat(s);return o._leaflet_id===t._leaflet_id?(r=c,!0):Array.isArray(o)&&o.some(n(c))};e.some(n([]));let i={};return r&&(i={indexPath:r,index:r[r.length-1],parentPath:r.slice(0,r.length-1)}),i},_getIndexFromSegment(e,t){if(t&&t.length===2){let r=this.findDeepCoordIndex(e,t[0]),n=this.findDeepCoordIndex(e,t[1]),i=Math.max(r.index,n.index);return(r.index===0||n.index===0)&&i!==1&&(i+=1),{indexA:r,indexB:n,newIndex:i,indexPath:r.indexPath,parentPath:r.parentPath}}return null},_getRotatedRectangle(e,t,r,n){let i=Fe(n,e),a=Fe(n,t),o=r*Math.PI/180,s=Math.cos(o),c=Math.sin(o),l=(a.x-i.x)*s+(a.y-i.y)*c,f=(a.y-i.y)*s-(a.x-i.x)*c,d=l*s+i.x,g=l*c+i.y,M=-f*c+i.x,I=f*s+i.y,T=Gt(n,i),m=Gt(n,{x:d,y:g}),y=Gt(n,a),_=Gt(n,{x:M,y:I});return[T,m,y,_]},pxRadiusToMeterRadius(e,t,r){let n=t.project(r),i=L.point(n.x+e,n.y);return t.distance(t.unproject(i),r)}},Xl=GL;L.PM=L.PM||{version:rn.version,Map:Fs,Toolbar:js,Draw:$,Edit:Y,Utils:Xl,Matrix:Jl,activeLang:"en",optIn:!1,initialize(e){this.addInitHooks(e)},setOptIn(e){this.optIn=!!e},addInitHooks(){function e(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Map(this)):this.options.pmIgnore||(this.pm=new L.PM.Map(this)),this.pm&&this.pm.setGlobalOptions({})}L.Map.addInitHook(e);function t(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.LayerGroup(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.LayerGroup(this))}L.LayerGroup.addInitHook(t);function r(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.options.textMarker?(this.pm=new L.PM.Edit.Text(this),this.options._textMarkerOverPM||this.pm._initTextMarker(),delete this.options._textMarkerOverPM):this.pm=new L.PM.Edit.Marker(this)):this.options.pmIgnore||(this.options.textMarker?(this.pm=new L.PM.Edit.Text(this),this.options._textMarkerOverPM||this.pm._initTextMarker(),delete this.options._textMarkerOverPM):this.pm=new L.PM.Edit.Marker(this))}L.Marker.addInitHook(r);function n(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.CircleMarker(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.CircleMarker(this))}L.CircleMarker.addInitHook(n);function i(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.Line(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Line(this))}L.Polyline.addInitHook(i);function a(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.Polygon(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Polygon(this))}L.Polygon.addInitHook(a);function o(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.Rectangle(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Rectangle(this))}L.Rectangle.addInitHook(o);function s(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.Circle(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.Circle(this))}L.Circle.addInitHook(s);function c(){this.pm=void 0,L.PM.optIn?this.options.pmIgnore===!1&&(this.pm=new L.PM.Edit.ImageOverlay(this)):this.options.pmIgnore||(this.pm=new L.PM.Edit.ImageOverlay(this))}L.ImageOverlay.addInitHook(c)},reInitLayer(e){e instanceof L.LayerGroup&&e.eachLayer(t=>{this.reInitLayer(t)}),e.pm||L.PM.optIn&&e.options.pmIgnore!==!1||e.options.pmIgnore||(e instanceof L.Map?e.pm=new L.PM.Map(e):e instanceof L.Marker?e.options.textMarker?(e.pm=new L.PM.Edit.Text(e),e.pm._initTextMarker(),e.pm._createTextMarker(!1)):e.pm=new L.PM.Edit.Marker(e):e instanceof L.Circle?e.pm=new L.PM.Edit.Circle(e):e instanceof L.CircleMarker?e.pm=new L.PM.Edit.CircleMarker(e):e instanceof L.Rectangle?e.pm=new L.PM.Edit.Rectangle(e):e instanceof L.Polygon?e.pm=new L.PM.Edit.Polygon(e):e instanceof L.Polyline?e.pm=new L.PM.Edit.Line(e):e instanceof L.LayerGroup?e.pm=new L.PM.Edit.LayerGroup(e):e instanceof L.ImageOverlay&&(e.pm=new L.PM.Edit.ImageOverlay(e)))}};L.version==="1.7.1"&&L.Canvas.include({_onClick(e){let t=this._map.mouseEventToLayerPoint(e),r,n;for(let i=this._drawFirst;i;i=i.next)r=i.layer,r.options.interactive&&r._containsPoint(t)&&(!(e.type==="click"||e.type==="preclick")||!this._map._draggableMoved(r))&&(n=r);n&&(L.DomEvent.fakeStop(e),this._fireEvent([n],e))}});L.PM.initialize();})();
//# sourceMappingURL=leaflet-geoman.min.js.map