Files
MeshTender/internal/web/static/leaflet-geoman.js
T
2026-07-11 22:23:22 -04:00

2 lines
281 KiB
JavaScript

"use strict";(()=>{var Ol=Object.create;var Yi=Object.defineProperty;var Il=Object.getOwnPropertyDescriptor;var Al=Object.getOwnPropertyNames;var Gl=Object.getPrototypeOf,ql=Object.prototype.hasOwnProperty;var B=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(i){throw e=0,i}};var Nl=(t,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Al(e))!ql.call(t,n)&&n!==i&&Yi(t,n,{get:()=>e[n],enumerable:!(r=Il(e,n))||r.enumerable});return t};var wt=(t,e,i)=>(i=t!=null?Ol(Gl(t)):{},Nl(e||!t||!t.__esModule?Yi(i,"default",{value:t,enumerable:!0}):i,t));var Zi=B((d_,$i)=>{function Fl(){this.__data__=[],this.size=0}$i.exports=Fl});var se=B((g_,Wi)=>{function jl(t,e){return t===e||t!==t&&e!==e}Wi.exports=jl});var ae=B((m_,Qi)=>{var Vl=se();function Ul(t,e){for(var i=t.length;i--;)if(Vl(t[i][0],e))return i;return-1}Qi.exports=Ul});var er=B((__,tr)=>{var Kl=ae(),Hl=Array.prototype,Xl=Hl.splice;function Yl(t){var e=this.__data__,i=Kl(e,t);if(i<0)return!1;var r=e.length-1;return i==r?e.pop():Xl.call(e,i,1),--this.size,!0}tr.exports=Yl});var rr=B((y_,ir)=>{var Jl=ae();function $l(t){var e=this.__data__,i=Jl(e,t);return i<0?void 0:e[i][1]}ir.exports=$l});var sr=B((L_,nr)=>{var Zl=ae();function Wl(t){return Zl(this.__data__,t)>-1}nr.exports=Wl});var or=B((b_,ar)=>{var Ql=ae();function th(t,e){var i=this.__data__,r=Ql(i,t);return r<0?(++this.size,i.push([t,e])):i[r][1]=e,this}ar.exports=th});var oe=B((k_,lr)=>{var eh=Zi(),ih=er(),rh=rr(),nh=sr(),sh=or();function jt(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}jt.prototype.clear=eh;jt.prototype.delete=ih;jt.prototype.get=rh;jt.prototype.has=nh;jt.prototype.set=sh;lr.exports=jt});var cr=B((M_,hr)=>{var ah=oe();function oh(){this.__data__=new ah,this.size=0}hr.exports=oh});var pr=B((v_,ur)=>{function lh(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i}ur.exports=lh});var dr=B((x_,fr)=>{function hh(t){return this.__data__.get(t)}fr.exports=hh});var mr=B((w_,gr)=>{function ch(t){return this.__data__.has(t)}gr.exports=ch});var ti=B((C_,_r)=>{var uh=typeof global=="object"&&global&&global.Object===Object&&global;_r.exports=uh});var It=B((E_,yr)=>{var ph=ti(),fh=typeof self=="object"&&self&&self.Object===Object&&self,dh=ph||fh||Function("return this")();yr.exports=dh});var Se=B((P_,Lr)=>{var gh=It(),mh=gh.Symbol;Lr.exports=mh});var vr=B((S_,Mr)=>{var br=Se(),kr=Object.prototype,_h=kr.hasOwnProperty,yh=kr.toString,le=br?br.toStringTag:void 0;function Lh(t){var e=_h.call(t,le),i=t[le];try{t[le]=void 0;var r=!0}catch{}var n=yh.call(t);return r&&(e?t[le]=i:delete t[le]),n}Mr.exports=Lh});var wr=B((T_,xr)=>{var bh=Object.prototype,kh=bh.toString;function Mh(t){return kh.call(t)}xr.exports=Mh});var Vt=B((B_,Pr)=>{var Cr=Se(),vh=vr(),xh=wr(),wh="[object Null]",Ch="[object Undefined]",Er=Cr?Cr.toStringTag:void 0;function Eh(t){return t==null?t===void 0?Ch:wh:Er&&Er in Object(t)?vh(t):xh(t)}Pr.exports=Eh});var Ct=B((D_,Sr)=>{function Ph(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}Sr.exports=Ph});var Te=B((R_,Tr)=>{var Sh=Vt(),Th=Ct(),Bh="[object AsyncFunction]",Dh="[object Function]",Rh="[object GeneratorFunction]",Oh="[object Proxy]";function Ih(t){if(!Th(t))return!1;var e=Sh(t);return e==Dh||e==Rh||e==Bh||e==Oh}Tr.exports=Ih});var Dr=B((O_,Br)=>{var Ah=It(),Gh=Ah["__core-js_shared__"];Br.exports=Gh});var Ir=B((I_,Or)=>{var ei=Dr(),Rr=(function(){var t=/[^.]+$/.exec(ei&&ei.keys&&ei.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function qh(t){return!!Rr&&Rr in t}Or.exports=qh});var Gr=B((A_,Ar)=>{var Nh=Function.prototype,zh=Nh.toString;function Fh(t){if(t!=null){try{return zh.call(t)}catch{}try{return t+""}catch{}}return""}Ar.exports=Fh});var Nr=B((G_,qr)=>{var jh=Te(),Vh=Ir(),Uh=Ct(),Kh=Gr(),Hh=/[\\^$.*+?()[\]{}|]/g,Xh=/^\[object .+?Constructor\]$/,Yh=Function.prototype,Jh=Object.prototype,$h=Yh.toString,Zh=Jh.hasOwnProperty,Wh=RegExp("^"+$h.call(Zh).replace(Hh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Qh(t){if(!Uh(t)||Vh(t))return!1;var e=jh(t)?Wh:Xh;return e.test(Kh(t))}qr.exports=Qh});var Fr=B((q_,zr)=>{function tc(t,e){return t?.[e]}zr.exports=tc});var Be=B((N_,jr)=>{var ec=Nr(),ic=Fr();function rc(t,e){var i=ic(t,e);return ec(i)?i:void 0}jr.exports=rc});var ii=B((z_,Vr)=>{var nc=Be(),sc=It(),ac=nc(sc,"Map");Vr.exports=ac});var he=B((F_,Ur)=>{var oc=Be(),lc=oc(Object,"create");Ur.exports=lc});var Xr=B((j_,Hr)=>{var Kr=he();function hc(){this.__data__=Kr?Kr(null):{},this.size=0}Hr.exports=hc});var Jr=B((V_,Yr)=>{function cc(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}Yr.exports=cc});var Zr=B((U_,$r)=>{var uc=he(),pc="__lodash_hash_undefined__",fc=Object.prototype,dc=fc.hasOwnProperty;function gc(t){var e=this.__data__;if(uc){var i=e[t];return i===pc?void 0:i}return dc.call(e,t)?e[t]:void 0}$r.exports=gc});var Qr=B((K_,Wr)=>{var mc=he(),_c=Object.prototype,yc=_c.hasOwnProperty;function Lc(t){var e=this.__data__;return mc?e[t]!==void 0:yc.call(e,t)}Wr.exports=Lc});var en=B((H_,tn)=>{var bc=he(),kc="__lodash_hash_undefined__";function Mc(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=bc&&e===void 0?kc:e,this}tn.exports=Mc});var nn=B((X_,rn)=>{var vc=Xr(),xc=Jr(),wc=Zr(),Cc=Qr(),Ec=en();function Ut(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}Ut.prototype.clear=vc;Ut.prototype.delete=xc;Ut.prototype.get=wc;Ut.prototype.has=Cc;Ut.prototype.set=Ec;rn.exports=Ut});var on=B((Y_,an)=>{var sn=nn(),Pc=oe(),Sc=ii();function Tc(){this.size=0,this.__data__={hash:new sn,map:new(Sc||Pc),string:new sn}}an.exports=Tc});var hn=B((J_,ln)=>{function Bc(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}ln.exports=Bc});var ce=B(($_,cn)=>{var Dc=hn();function Rc(t,e){var i=t.__data__;return Dc(e)?i[typeof e=="string"?"string":"hash"]:i.map}cn.exports=Rc});var pn=B((Z_,un)=>{var Oc=ce();function Ic(t){var e=Oc(this,t).delete(t);return this.size-=e?1:0,e}un.exports=Ic});var dn=B((W_,fn)=>{var Ac=ce();function Gc(t){return Ac(this,t).get(t)}fn.exports=Gc});var mn=B((Q_,gn)=>{var qc=ce();function Nc(t){return qc(this,t).has(t)}gn.exports=Nc});var yn=B((ty,_n)=>{var zc=ce();function Fc(t,e){var i=zc(this,t),r=i.size;return i.set(t,e),this.size+=i.size==r?0:1,this}_n.exports=Fc});var ri=B((ey,Ln)=>{var jc=on(),Vc=pn(),Uc=dn(),Kc=mn(),Hc=yn();function Kt(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var r=t[e];this.set(r[0],r[1])}}Kt.prototype.clear=jc;Kt.prototype.delete=Vc;Kt.prototype.get=Uc;Kt.prototype.has=Kc;Kt.prototype.set=Hc;Ln.exports=Kt});var kn=B((iy,bn)=>{var Xc=oe(),Yc=ii(),Jc=ri(),$c=200;function Zc(t,e){var i=this.__data__;if(i instanceof Xc){var r=i.__data__;if(!Yc||r.length<$c-1)return r.push([t,e]),this.size=++i.size,this;i=this.__data__=new Jc(r)}return i.set(t,e),this.size=i.size,this}bn.exports=Zc});var vn=B((ry,Mn)=>{var Wc=oe(),Qc=cr(),tu=pr(),eu=dr(),iu=mr(),ru=kn();function Ht(t){var e=this.__data__=new Wc(t);this.size=e.size}Ht.prototype.clear=Qc;Ht.prototype.delete=tu;Ht.prototype.get=eu;Ht.prototype.has=iu;Ht.prototype.set=ru;Mn.exports=Ht});var ni=B((ny,xn)=>{var nu=Be(),su=(function(){try{var t=nu(Object,"defineProperty");return t({},"",{}),t}catch{}})();xn.exports=su});var De=B((sy,Cn)=>{var wn=ni();function au(t,e,i){e=="__proto__"&&wn?wn(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}Cn.exports=au});var si=B((ay,En)=>{var ou=De(),lu=se();function hu(t,e,i){(i!==void 0&&!lu(t[e],i)||i===void 0&&!(e in t))&&ou(t,e,i)}En.exports=hu});var Sn=B((oy,Pn)=>{function cu(t){return function(e,i,r){for(var n=-1,s=Object(e),a=r(e),o=a.length;o--;){var h=a[t?o:++n];if(i(s[h],h,s)===!1)break}return e}}Pn.exports=cu});var Bn=B((ly,Tn)=>{var uu=Sn(),pu=uu();Tn.exports=pu});var An=B((ue,Xt)=>{var fu=It(),In=typeof ue=="object"&&ue&&!ue.nodeType&&ue,Dn=In&&typeof Xt=="object"&&Xt&&!Xt.nodeType&&Xt,du=Dn&&Dn.exports===In,Rn=du?fu.Buffer:void 0,On=Rn?Rn.allocUnsafe:void 0;function gu(t,e){if(e)return t.slice();var i=t.length,r=On?On(i):new t.constructor(i);return t.copy(r),r}Xt.exports=gu});var qn=B((hy,Gn)=>{var mu=It(),_u=mu.Uint8Array;Gn.exports=_u});var Fn=B((cy,zn)=>{var Nn=qn();function yu(t){var e=new t.constructor(t.byteLength);return new Nn(e).set(new Nn(t)),e}zn.exports=yu});var Vn=B((uy,jn)=>{var Lu=Fn();function bu(t,e){var i=e?Lu(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}jn.exports=bu});var Kn=B((py,Un)=>{function ku(t,e){var i=-1,r=t.length;for(e||(e=Array(r));++i<r;)e[i]=t[i];return e}Un.exports=ku});var Yn=B((fy,Xn)=>{var Mu=Ct(),Hn=Object.create,vu=(function(){function t(){}return function(e){if(!Mu(e))return{};if(Hn)return Hn(e);t.prototype=e;var i=new t;return t.prototype=void 0,i}})();Xn.exports=vu});var $n=B((dy,Jn)=>{function xu(t,e){return function(i){return t(e(i))}}Jn.exports=xu});var ai=B((gy,Zn)=>{var wu=$n(),Cu=wu(Object.getPrototypeOf,Object);Zn.exports=Cu});var oi=B((my,Wn)=>{var Eu=Object.prototype;function Pu(t){var e=t&&t.constructor,i=typeof e=="function"&&e.prototype||Eu;return t===i}Wn.exports=Pu});var ts=B((_y,Qn)=>{var Su=Yn(),Tu=ai(),Bu=oi();function Du(t){return typeof t.constructor=="function"&&!Bu(t)?Su(Tu(t)):{}}Qn.exports=Du});var At=B((yy,es)=>{function Ru(t){return t!=null&&typeof t=="object"}es.exports=Ru});var rs=B((Ly,is)=>{var Ou=Vt(),Iu=At(),Au="[object Arguments]";function Gu(t){return Iu(t)&&Ou(t)==Au}is.exports=Gu});var li=B((by,as)=>{var ns=rs(),qu=At(),ss=Object.prototype,Nu=ss.hasOwnProperty,zu=ss.propertyIsEnumerable,Fu=ns((function(){return arguments})())?ns:function(t){return qu(t)&&Nu.call(t,"callee")&&!zu.call(t,"callee")};as.exports=Fu});var Yt=B((ky,os)=>{var ju=Array.isArray;os.exports=ju});var hi=B((My,ls)=>{var Vu=9007199254740991;function Uu(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Vu}ls.exports=Uu});var Re=B((vy,hs)=>{var Ku=Te(),Hu=hi();function Xu(t){return t!=null&&Hu(t.length)&&!Ku(t)}hs.exports=Xu});var us=B((xy,cs)=>{var Yu=Re(),Ju=At();function $u(t){return Ju(t)&&Yu(t)}cs.exports=$u});var fs=B((wy,ps)=>{function Zu(){return!1}ps.exports=Zu});var ci=B((pe,Jt)=>{var Wu=It(),Qu=fs(),ms=typeof pe=="object"&&pe&&!pe.nodeType&&pe,ds=ms&&typeof Jt=="object"&&Jt&&!Jt.nodeType&&Jt,tp=ds&&ds.exports===ms,gs=tp?Wu.Buffer:void 0,ep=gs?gs.isBuffer:void 0,ip=ep||Qu;Jt.exports=ip});var Ls=B((Cy,ys)=>{var rp=Vt(),np=ai(),sp=At(),ap="[object Object]",op=Function.prototype,lp=Object.prototype,_s=op.toString,hp=lp.hasOwnProperty,cp=_s.call(Object);function up(t){if(!sp(t)||rp(t)!=ap)return!1;var e=np(t);if(e===null)return!0;var i=hp.call(e,"constructor")&&e.constructor;return typeof i=="function"&&i instanceof i&&_s.call(i)==cp}ys.exports=up});var ks=B((Ey,bs)=>{var pp=Vt(),fp=hi(),dp=At(),gp="[object Arguments]",mp="[object Array]",_p="[object Boolean]",yp="[object Date]",Lp="[object Error]",bp="[object Function]",kp="[object Map]",Mp="[object Number]",vp="[object Object]",xp="[object RegExp]",wp="[object Set]",Cp="[object String]",Ep="[object WeakMap]",Pp="[object ArrayBuffer]",Sp="[object DataView]",Tp="[object Float32Array]",Bp="[object Float64Array]",Dp="[object Int8Array]",Rp="[object Int16Array]",Op="[object Int32Array]",Ip="[object Uint8Array]",Ap="[object Uint8ClampedArray]",Gp="[object Uint16Array]",qp="[object Uint32Array]",J={};J[Tp]=J[Bp]=J[Dp]=J[Rp]=J[Op]=J[Ip]=J[Ap]=J[Gp]=J[qp]=!0;J[gp]=J[mp]=J[Pp]=J[_p]=J[Sp]=J[yp]=J[Lp]=J[bp]=J[kp]=J[Mp]=J[vp]=J[xp]=J[wp]=J[Cp]=J[Ep]=!1;function Np(t){return dp(t)&&fp(t.length)&&!!J[pp(t)]}bs.exports=Np});var vs=B((Py,Ms)=>{function zp(t){return function(e){return t(e)}}Ms.exports=zp});var ws=B((fe,$t)=>{var Fp=ti(),xs=typeof fe=="object"&&fe&&!fe.nodeType&&fe,de=xs&&typeof $t=="object"&&$t&&!$t.nodeType&&$t,jp=de&&de.exports===xs,ui=jp&&Fp.process,Vp=(function(){try{var t=de&&de.require&&de.require("util").types;return t||ui&&ui.binding&&ui.binding("util")}catch{}})();$t.exports=Vp});var pi=B((Sy,Ps)=>{var Up=ks(),Kp=vs(),Cs=ws(),Es=Cs&&Cs.isTypedArray,Hp=Es?Kp(Es):Up;Ps.exports=Hp});var fi=B((Ty,Ss)=>{function Xp(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}Ss.exports=Xp});var Bs=B((By,Ts)=>{var Yp=De(),Jp=se(),$p=Object.prototype,Zp=$p.hasOwnProperty;function Wp(t,e,i){var r=t[e];(!(Zp.call(t,e)&&Jp(r,i))||i===void 0&&!(e in t))&&Yp(t,e,i)}Ts.exports=Wp});var Rs=B((Dy,Ds)=>{var Qp=Bs(),tf=De();function ef(t,e,i,r){var n=!i;i||(i={});for(var s=-1,a=e.length;++s<a;){var o=e[s],h=r?r(i[o],t[o],o,i,t):void 0;h===void 0&&(h=t[o]),n?tf(i,o,h):Qp(i,o,h)}return i}Ds.exports=ef});var Is=B((Ry,Os)=>{function rf(t,e){for(var i=-1,r=Array(t);++i<t;)r[i]=e(i);return r}Os.exports=rf});var di=B((Oy,As)=>{var nf=9007199254740991,sf=/^(?:0|[1-9]\d*)$/;function af(t,e){var i=typeof t;return e=e??nf,!!e&&(i=="number"||i!="symbol"&&sf.test(t))&&t>-1&&t%1==0&&t<e}As.exports=af});var qs=B((Iy,Gs)=>{var of=Is(),lf=li(),hf=Yt(),cf=ci(),uf=di(),pf=pi(),ff=Object.prototype,df=ff.hasOwnProperty;function gf(t,e){var i=hf(t),r=!i&&lf(t),n=!i&&!r&&cf(t),s=!i&&!r&&!n&&pf(t),a=i||r||n||s,o=a?of(t.length,String):[],h=o.length;for(var l in t)(e||df.call(t,l))&&!(a&&(l=="length"||n&&(l=="offset"||l=="parent")||s&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||uf(l,h)))&&o.push(l);return o}Gs.exports=gf});var zs=B((Ay,Ns)=>{function mf(t){var e=[];if(t!=null)for(var i in Object(t))e.push(i);return e}Ns.exports=mf});var js=B((Gy,Fs)=>{var _f=Ct(),yf=oi(),Lf=zs(),bf=Object.prototype,kf=bf.hasOwnProperty;function Mf(t){if(!_f(t))return Lf(t);var e=yf(t),i=[];for(var r in t)r=="constructor"&&(e||!kf.call(t,r))||i.push(r);return i}Fs.exports=Mf});var gi=B((qy,Vs)=>{var vf=qs(),xf=js(),wf=Re();function Cf(t){return wf(t)?vf(t,!0):xf(t)}Vs.exports=Cf});var Ks=B((Ny,Us)=>{var Ef=Rs(),Pf=gi();function Sf(t){return Ef(t,Pf(t))}Us.exports=Sf});var Zs=B((zy,$s)=>{var Hs=si(),Tf=An(),Bf=Vn(),Df=Kn(),Rf=ts(),Xs=li(),Ys=Yt(),Of=us(),If=ci(),Af=Te(),Gf=Ct(),qf=Ls(),Nf=pi(),Js=fi(),zf=Ks();function Ff(t,e,i,r,n,s,a){var o=Js(t,i),h=Js(e,i),l=a.get(h);if(l){Hs(t,i,l);return}var d=s?s(o,h,i+"",t,e,a):void 0,f=d===void 0;if(f){var k=Ys(h),w=!k&&If(h),S=!k&&!w&&Nf(h);d=h,k||w||S?Ys(o)?d=o:Of(o)?d=Df(o):w?(f=!1,d=Tf(h,!0)):S?(f=!1,d=Bf(h,!0)):d=[]:qf(h)||Xs(h)?(d=o,Xs(o)?d=zf(o):(!Gf(o)||Af(o))&&(d=Rf(h))):f=!1}f&&(a.set(h,d),n(d,h,r,s,a),a.delete(h)),Hs(t,i,d)}$s.exports=Ff});var ta=B((Fy,Qs)=>{var jf=vn(),Vf=si(),Uf=Bn(),Kf=Zs(),Hf=Ct(),Xf=gi(),Yf=fi();function Ws(t,e,i,r,n){t!==e&&Uf(e,function(s,a){if(n||(n=new jf),Hf(s))Kf(t,e,a,i,Ws,r,n);else{var o=r?r(Yf(t,a),s,a+"",t,e,n):void 0;o===void 0&&(o=s),Vf(t,a,o)}},Xf)}Qs.exports=Ws});var mi=B((jy,ea)=>{function Jf(t){return t}ea.exports=Jf});var ra=B((Vy,ia)=>{function $f(t,e,i){switch(i.length){case 0:return t.call(e);case 1:return t.call(e,i[0]);case 2:return t.call(e,i[0],i[1]);case 3:return t.call(e,i[0],i[1],i[2])}return t.apply(e,i)}ia.exports=$f});var aa=B((Uy,sa)=>{var Zf=ra(),na=Math.max;function Wf(t,e,i){return e=na(e===void 0?t.length-1:e,0),function(){for(var r=arguments,n=-1,s=na(r.length-e,0),a=Array(s);++n<s;)a[n]=r[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=r[n];return o[e]=i(a),Zf(t,this,o)}}sa.exports=Wf});var la=B((Ky,oa)=>{function Qf(t){return function(){return t}}oa.exports=Qf});var ua=B((Hy,ca)=>{var td=la(),ha=ni(),ed=mi(),id=ha?function(t,e){return ha(t,"toString",{configurable:!0,enumerable:!1,value:td(e),writable:!0})}:ed;ca.exports=id});var fa=B((Xy,pa)=>{var rd=800,nd=16,sd=Date.now;function ad(t){var e=0,i=0;return function(){var r=sd(),n=nd-(r-i);if(i=r,n>0){if(++e>=rd)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}pa.exports=ad});var ga=B((Yy,da)=>{var od=ua(),ld=fa(),hd=ld(od);da.exports=hd});var _a=B((Jy,ma)=>{var cd=mi(),ud=aa(),pd=ga();function fd(t,e){return pd(ud(t,e,cd),t+"")}ma.exports=fd});var La=B(($y,ya)=>{var dd=se(),gd=Re(),md=di(),_d=Ct();function yd(t,e,i){if(!_d(i))return!1;var r=typeof e;return(r=="number"?gd(i)&&md(e,i.length):r=="string"&&e in i)?dd(i[e],t):!1}ya.exports=yd});var ka=B((Zy,ba)=>{var Ld=_a(),bd=La();function kd(t){return Ld(function(e,i){var r=-1,n=i.length,s=n>1?i[n-1]:void 0,a=n>2?i[2]:void 0;for(s=t.length>3&&typeof s=="function"?(n--,s):void 0,a&&bd(i[0],i[1],a)&&(s=n<3?void 0:s,n=1),e=Object(e);++r<n;){var o=i[r];o&&t(e,o,r,s)}return e})}ba.exports=kd});var Oe=B((Wy,Ma)=>{var Md=ta(),vd=ka(),xd=vd(function(t,e,i){Md(t,e,i)});Ma.exports=xd});var Ie=B((ab,eo)=>{var sg=Vt(),ag=At(),og="[object Symbol]";function lg(t){return typeof t=="symbol"||ag(t)&&sg(t)==og}eo.exports=lg});var ro=B((ob,io)=>{var hg=Yt(),cg=Ie(),ug=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,pg=/^\w*$/;function fg(t,e){if(hg(t))return!1;var i=typeof t;return i=="number"||i=="symbol"||i=="boolean"||t==null||cg(t)?!0:pg.test(t)||!ug.test(t)||e!=null&&t in Object(e)}io.exports=fg});var ao=B((lb,so)=>{var no=ri(),dg="Expected a function";function yi(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(dg);var i=function(){var r=arguments,n=e?e.apply(this,r):r[0],s=i.cache;if(s.has(n))return s.get(n);var a=t.apply(this,r);return i.cache=s.set(n,a)||s,a};return i.cache=new(yi.Cache||no),i}yi.Cache=no;so.exports=yi});var lo=B((hb,oo)=>{var gg=ao(),mg=500;function _g(t){var e=gg(t,function(r){return i.size===mg&&i.clear(),r}),i=e.cache;return e}oo.exports=_g});var co=B((cb,ho)=>{var yg=lo(),Lg=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,bg=/\\(\\)?/g,kg=yg(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Lg,function(i,r,n,s){e.push(n?s.replace(bg,"$1"):r||i)}),e});ho.exports=kg});var po=B((ub,uo)=>{function Mg(t,e){for(var i=-1,r=t==null?0:t.length,n=Array(r);++i<r;)n[i]=e(t[i],i,t);return n}uo.exports=Mg});var Lo=B((pb,yo)=>{var fo=Se(),vg=po(),xg=Yt(),wg=Ie(),Cg=1/0,go=fo?fo.prototype:void 0,mo=go?go.toString:void 0;function _o(t){if(typeof t=="string")return t;if(xg(t))return vg(t,_o)+"";if(wg(t))return mo?mo.call(t):"";var e=t+"";return e=="0"&&1/t==-Cg?"-0":e}yo.exports=_o});var ko=B((fb,bo)=>{var Eg=Lo();function Pg(t){return t==null?"":Eg(t)}bo.exports=Pg});var vo=B((db,Mo)=>{var Sg=Yt(),Tg=ro(),Bg=co(),Dg=ko();function Rg(t,e){return Sg(t)?t:Tg(t,e)?[t]:Bg(Dg(t))}Mo.exports=Rg});var wo=B((gb,xo)=>{var Og=Ie(),Ig=1/0;function Ag(t){if(typeof t=="string"||Og(t))return t;var e=t+"";return e=="0"&&1/t==-Ig?"-0":e}xo.exports=Ag});var Eo=B((mb,Co)=>{var Gg=vo(),qg=wo();function Ng(t,e){e=Gg(e,t);for(var i=0,r=e.length;t!=null&&i<r;)t=t[qg(e[i++])];return i&&i==r?t:void 0}Co.exports=Ng});var ge=B((_b,Po)=>{var zg=Eo();function Fg(t,e,i){var r=t==null?void 0:zg(t,e);return r===void 0?i:r}Po.exports=Fg});var Fo=B((Ei,Pi)=>{(function(t,e){typeof Ei=="object"&&typeof Pi<"u"?Pi.exports=e():typeof define=="function"&&define.amd?define(e):(t=t||self).RBush=e()})(Ei,function(){"use strict";function t(g,M,m,O,R){(function I(G,q,c,u,p){for(;u>c;){if(u-c>600){var y=u-c+1,_=q-c+1,v=Math.log(y),E=.5*Math.exp(2*v/3),b=.5*Math.sqrt(v*E*(y-E)/y)*(_-y/2<0?-1:1),x=Math.max(c,Math.floor(q-_*E/y+b)),P=Math.min(u,Math.floor(q+(y-_)*E/y+b));I(G,q,x,P,p)}var C=G[q],T=c,N=u;for(e(G,c,q),p(G[u],C)>0&&e(G,c,u);T<N;){for(e(G,T,N),T++,N--;p(G[T],C)<0;)T++;for(;p(G[N],C)>0;)N--}p(G[c],C)===0?e(G,c,N):e(G,++N,u),N<=q&&(c=N+1),q<=N&&(u=N-1)}})(g,M,m||0,O||g.length-1,R||i)}function e(g,M,m){var O=g[M];g[M]=g[m],g[m]=O}function i(g,M){return g<M?-1:g>M?1:0}var r=function(g){g===void 0&&(g=9),this._maxEntries=Math.max(4,g),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function n(g,M,m){if(!m)return M.indexOf(g);for(var O=0;O<M.length;O++)if(m(g,M[O]))return O;return-1}function s(g,M){a(g,0,g.children.length,M,g)}function a(g,M,m,O,R){R||(R=S(null)),R.minX=1/0,R.minY=1/0,R.maxX=-1/0,R.maxY=-1/0;for(var I=M;I<m;I++){var G=g.children[I];o(R,g.leaf?O(G):G)}return R}function o(g,M){return g.minX=Math.min(g.minX,M.minX),g.minY=Math.min(g.minY,M.minY),g.maxX=Math.max(g.maxX,M.maxX),g.maxY=Math.max(g.maxY,M.maxY),g}function h(g,M){return g.minX-M.minX}function l(g,M){return g.minY-M.minY}function d(g){return(g.maxX-g.minX)*(g.maxY-g.minY)}function f(g){return g.maxX-g.minX+(g.maxY-g.minY)}function k(g,M){return g.minX<=M.minX&&g.minY<=M.minY&&M.maxX<=g.maxX&&M.maxY<=g.maxY}function w(g,M){return M.minX<=g.maxX&&M.minY<=g.maxY&&M.maxX>=g.minX&&M.maxY>=g.minY}function S(g){return{children:g,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function A(g,M,m,O,R){for(var I=[M,m];I.length;)if(!((m=I.pop())-(M=I.pop())<=O)){var G=M+Math.ceil((m-M)/O/2)*O;t(g,G,M,m,R),I.push(M,G,G,m)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(g){var M=this.data,m=[];if(!w(g,M))return m;for(var O=this.toBBox,R=[];M;){for(var I=0;I<M.children.length;I++){var G=M.children[I],q=M.leaf?O(G):G;w(g,q)&&(M.leaf?m.push(G):k(g,q)?this._all(G,m):R.push(G))}M=R.pop()}return m},r.prototype.collides=function(g){var M=this.data;if(!w(g,M))return!1;for(var m=[];M;){for(var O=0;O<M.children.length;O++){var R=M.children[O],I=M.leaf?this.toBBox(R):R;if(w(g,I)){if(M.leaf||k(g,I))return!0;m.push(R)}}M=m.pop()}return!1},r.prototype.load=function(g){if(!g||!g.length)return this;if(g.length<this._minEntries){for(var M=0;M<g.length;M++)this.insert(g[M]);return this}var m=this._build(g.slice(),0,g.length-1,0);if(this.data.children.length)if(this.data.height===m.height)this._splitRoot(this.data,m);else{if(this.data.height<m.height){var O=this.data;this.data=m,m=O}this._insert(m,this.data.height-m.height-1,!0)}else this.data=m;return this},r.prototype.insert=function(g){return g&&this._insert(g,this.data.height-1),this},r.prototype.clear=function(){return this.data=S([]),this},r.prototype.remove=function(g,M){if(!g)return this;for(var m,O,R,I=this.data,G=this.toBBox(g),q=[],c=[];I||q.length;){if(I||(I=q.pop(),O=q[q.length-1],m=c.pop(),R=!0),I.leaf){var u=n(g,I.children,M);if(u!==-1)return I.children.splice(u,1),q.push(I),this._condense(q),this}R||I.leaf||!k(I,G)?O?(m++,I=O.children[m],R=!1):I=null:(q.push(I),c.push(m),m=0,O=I,I=I.children[0])}return this},r.prototype.toBBox=function(g){return g},r.prototype.compareMinX=function(g,M){return g.minX-M.minX},r.prototype.compareMinY=function(g,M){return g.minY-M.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(g){return this.data=g,this},r.prototype._all=function(g,M){for(var m=[];g;)g.leaf?M.push.apply(M,g.children):m.push.apply(m,g.children),g=m.pop();return M},r.prototype._build=function(g,M,m,O){var R,I=m-M+1,G=this._maxEntries;if(I<=G)return s(R=S(g.slice(M,m+1)),this.toBBox),R;O||(O=Math.ceil(Math.log(I)/Math.log(G)),G=Math.ceil(I/Math.pow(G,O-1))),(R=S([])).leaf=!1,R.height=O;var q=Math.ceil(I/G),c=q*Math.ceil(Math.sqrt(G));A(g,M,m,c,this.compareMinX);for(var u=M;u<=m;u+=c){var p=Math.min(u+c-1,m);A(g,u,p,q,this.compareMinY);for(var y=u;y<=p;y+=q){var _=Math.min(y+q-1,p);R.children.push(this._build(g,y,_,O-1))}}return s(R,this.toBBox),R},r.prototype._chooseSubtree=function(g,M,m,O){for(;O.push(M),!M.leaf&&O.length-1!==m;){for(var R=1/0,I=1/0,G=void 0,q=0;q<M.children.length;q++){var c=M.children[q],u=d(c),p=(y=g,_=c,(Math.max(_.maxX,y.maxX)-Math.min(_.minX,y.minX))*(Math.max(_.maxY,y.maxY)-Math.min(_.minY,y.minY))-u);p<I?(I=p,R=u<R?u:R,G=c):p===I&&u<R&&(R=u,G=c)}M=G||M.children[0]}var y,_;return M},r.prototype._insert=function(g,M,m){var O=m?g:this.toBBox(g),R=[],I=this._chooseSubtree(O,this.data,M,R);for(I.children.push(g),o(I,O);M>=0&&R[M].children.length>this._maxEntries;)this._split(R,M),M--;this._adjustParentBBoxes(O,R,M)},r.prototype._split=function(g,M){var m=g[M],O=m.children.length,R=this._minEntries;this._chooseSplitAxis(m,R,O);var I=this._chooseSplitIndex(m,R,O),G=S(m.children.splice(I,m.children.length-I));G.height=m.height,G.leaf=m.leaf,s(m,this.toBBox),s(G,this.toBBox),M?g[M-1].children.push(G):this._splitRoot(m,G)},r.prototype._splitRoot=function(g,M){this.data=S([g,M]),this.data.height=g.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(g,M,m){for(var O,R,I,G,q,c,u,p=1/0,y=1/0,_=M;_<=m-M;_++){var v=a(g,0,_,this.toBBox),E=a(g,_,m,this.toBBox),b=(R=v,I=E,G=void 0,q=void 0,c=void 0,u=void 0,G=Math.max(R.minX,I.minX),q=Math.max(R.minY,I.minY),c=Math.min(R.maxX,I.maxX),u=Math.min(R.maxY,I.maxY),Math.max(0,c-G)*Math.max(0,u-q)),x=d(v)+d(E);b<p?(p=b,O=_,y=x<y?x:y):b===p&&x<y&&(y=x,O=_)}return O||m-M},r.prototype._chooseSplitAxis=function(g,M,m){var O=g.leaf?this.compareMinX:h,R=g.leaf?this.compareMinY:l;this._allDistMargin(g,M,m,O)<this._allDistMargin(g,M,m,R)&&g.children.sort(O)},r.prototype._allDistMargin=function(g,M,m,O){g.children.sort(O);for(var R=this.toBBox,I=a(g,0,M,R),G=a(g,m-M,m,R),q=f(I)+f(G),c=M;c<m-M;c++){var u=g.children[c];o(I,g.leaf?R(u):u),q+=f(I)}for(var p=m-M-1;p>=M;p--){var y=g.children[p];o(G,g.leaf?R(y):y),q+=f(G)}return q},r.prototype._adjustParentBBoxes=function(g,M,m){for(var O=m;O>=0;O--)o(M[O],g)},r.prototype._condense=function(g){for(var M=g.length-1,m=void 0;M>=0;M--)g[M].children.length===0?M>0?(m=g[M-1].children).splice(m.indexOf(g[M]),1):this.clear():s(g[M],this.toBBox)},r})});Array.prototype.findIndex=Array.prototype.findIndex||function(t){if(this===null)throw new TypeError("Array.prototype.findIndex called on null or undefined");if(typeof t!="function")throw new TypeError("callback must be a function");for(var e=Object(this),i=e.length>>>0,r=arguments[1],n=0;n<i;n++)if(t.call(r,e[n],n,e))return n;return-1};Array.prototype.find=Array.prototype.find||function(t){if(this===null)throw new TypeError("Array.prototype.find called on null or undefined");if(typeof t!="function")throw new TypeError("callback must be a function");for(var e=Object(this),i=e.length>>>0,r=arguments[1],n=0;n<i;n++){var s=e[n];if(t.call(r,s,n,e))return s}};typeof Object.assign!="function"&&(Object.assign=function(t){"use strict";if(t==null)throw new TypeError("Cannot convert undefined or null to object");t=Object(t);for(var e=1;e<arguments.length;e++){var i=arguments[e];if(i!=null)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t});(function(t){t.forEach(function(e){e.hasOwnProperty("remove")||Object.defineProperty(e,"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(t,e){if(this==null)throw new TypeError('"this" is null or not defined');var i=Object(this),r=i.length>>>0;if(r===0)return!1;var n=e|0,s=Math.max(n>=0?n:r-Math.abs(n),0);function a(o,h){return o===h||typeof o=="number"&&typeof h=="number"&&isNaN(o)&&isNaN(h)}for(;s<r;){if(a(i[s],t))return!0;s++}return!1}});var Ji={name:"@geoman-io/leaflet-geoman-free",version:"2.20.0",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.3.5","@turf/kinks":"^7.3.5","@turf/line-intersect":"^7.3.5","@turf/line-split":"^7.3.5",lodash:"4.18.1","polyclip-ts":"^0.16.8"},devDependencies:{"@types/leaflet":"^1.9.21","@vitest/coverage-v8":"^4.1.5","cross-env":"^10.1.0",cypress:"^15.14.2",esbuild:"^0.28.0",husky:"^9.1.7",leaflet:"1.9.4","lint-staged":"^17.0.2",oxfmt:"^0.55.0",oxlint:"^1.70.0","prosthetic-hand":"2.2.2",typescript:"^6.0.3",vitest:"^4.1.5"},peerDependencies:{leaflet:"^1.2.0"},engines:{node:">=20.0.0"},packageManager:"pnpm@10.30.3",scripts:{start:"pnpm run dev",dev:"cross-env DEV=true node bundle.mjs",build:"node bundle.mjs",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 --fix && oxfmt --write src demo","lint:check":"oxlint src demo && oxfmt --check src demo",typecheck:"tsc --noEmit"},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":"oxlint --fix","*.{js,css}":"oxfmt --write"}};var Mi=wt(Oe());var va={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 xa={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 wa={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 Ca={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 Ea={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 Pa={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 Sa={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 Ta={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 Ba={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 Da={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 Ra={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 Oa={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 _i={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 Ia={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 Aa={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 Ga={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 qa={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 Na={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 za={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 Fa={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 ja={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 Va={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 Ua={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 Ka={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 Ha={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 Xa={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 Ya={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 Wd=_i,Et={en:va,de:xa,it:wa,id:Ca,ro:Ea,ru:Pa,es:Sa,nl:Ta,fr:Ba,pt:Wd,pt_br:Oa,pt_pt:_i,zh:Da,zh_tw:Ra,pl:Ia,sv:Aa,el:Ga,hu:qa,da:Na,no:za,fa:Fa,ua:ja,tr:Va,cz:Ua,ja:Ka,fi:Ha,ko:Xa,ky:Ya};var Qd={_globalEditModeEnabled:!1,enableGlobalEditMode(t){let e={...t};this._globalEditModeEnabled=!0,this.Toolbar.toggleButton("editMode",this.globalEditModeEnabled()),L.PM.Utils.findLayers(this.map).forEach(r=>{this._isRelevantForEdit(r)&&r.pm.enable(e)}),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(e=>{e.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(t=this.globalOptions){this.globalEditModeEnabled()?this.disableGlobalEditMode():this.enableGlobalEditMode(t)},handleLayerAdditionInGlobalEditMode(){let t=this._addedLayersEdit;if(this._addedLayersEdit={},this.globalEditModeEnabled())for(let e in t){let i=t[e];this._isRelevantForEdit(i)&&i.pm.enable({...this.globalOptions})}},_layerAddedEdit({layer:t}){this._addedLayersEdit[L.stamp(t)]=t},_isRelevantForEdit(t){return t.pm&&!(t instanceof L.LayerGroup)&&(!L.PM.optIn&&!t.options.pmIgnore||L.PM.optIn&&t.options.pmIgnore===!1)&&!t._pmTempLayer&&t.pm.options.allowEditing}},Ja=Qd;var tg={_globalDragModeEnabled:!1,enableGlobalDragMode(){let t=L.PM.Utils.findLayers(this.map);this._globalDragModeEnabled=!0,this._addedLayersDrag={},t.forEach(e=>{this._isRelevantForDrag(e)&&e.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 t=L.PM.Utils.findLayers(this.map);this._globalDragModeEnabled=!1,t.forEach(e=>{e.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 t=this._addedLayersDrag;if(this._addedLayersDrag={},this.globalDragModeEnabled())for(let e in t){let i=t[e];this._isRelevantForDrag(i)&&i.pm.enableLayerDrag()}},_layerAddedDrag({layer:t}){this._addedLayersDrag[L.stamp(t)]=t},_isRelevantForDrag(t){return t.pm&&!(t instanceof L.LayerGroup)&&(!L.PM.optIn&&!t.options.pmIgnore||L.PM.optIn&&t.options.pmIgnore===!1)&&!t._pmTempLayer&&t.pm.options.draggable}},$a=tg;var eg={_globalRemovalModeEnabled:!1,enableGlobalRemovalMode(){this._globalRemovalModeEnabled=!0,this.map.eachLayer(t=>{this._isRelevantForRemoval(t)&&(t.pm.enabled()&&t.pm.disable(),t.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(t=>{t.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(t){let e=t.target;this._isRelevantForRemoval(e)&&!e.pm.dragging()&&(e.removeFrom(this.map.pm._getContainingLayer()),e.remove(),e instanceof L.LayerGroup?(this._fireRemoveLayerGroup(e),this._fireRemoveLayerGroup(this.map,e)):(e.pm._fireRemove(e),e.pm._fireRemove(this.map,e)))},_isRelevantForRemoval(t){return t.pm&&!(t instanceof L.LayerGroup)&&(!L.PM.optIn&&!t.options.pmIgnore||L.PM.optIn&&t.options.pmIgnore===!1)&&!t._pmTempLayer&&t.pm.options.allowRemoval},handleLayerAdditionInGlobalRemovalMode(){let t=this._addedLayersRemoval;if(this._addedLayersRemoval={},this.globalRemovalModeEnabled())for(let e in t){let i=t[e];this._isRelevantForRemoval(i)&&(i.pm.enabled()&&i.pm.disable(),i.on("click",this.removeLayer,this))}},_layerAddedRemoval({layer:t}){this._addedLayersRemoval[L.stamp(t)]=t}},Za=eg;var ig={_globalRotateModeEnabled:!1,enableGlobalRotateMode(){this._globalRotateModeEnabled=!0,L.PM.Utils.findLayers(this.map).filter(e=>e instanceof L.Polyline).forEach(e=>{this._isRelevantForRotate(e)&&e.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(e=>e instanceof L.Polyline).forEach(e=>{e.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(t){return t.pm&&t instanceof L.Polyline&&!(t instanceof L.LayerGroup)&&(!L.PM.optIn&&!t.options.pmIgnore||L.PM.optIn&&t.options.pmIgnore===!1)&&!t._pmTempLayer&&t.pm.options.allowRotation},handleLayerAdditionInGlobalRotateMode(){let t=this._addedLayersRotate;if(this._addedLayersRotate={},this.globalRotateModeEnabled())for(let e in t){let i=t[e];this._isRelevantForRemoval(i)&&i.pm.enableRotate()}},_layerAddedRotate({layer:t}){this._addedLayersRotate[L.stamp(t)]=t}},Wa=ig;var Qa=wt(Oe()),rg={_fireDrawStart(t="Draw",e={}){this.__fire(this._map,"pm:drawstart",{shape:this._shape,workingLayer:this._layer},t,e)},_fireDrawEnd(t="Draw",e={}){this.__fire(this._map,"pm:drawend",{shape:this._shape},t,e)},_fireCreate(t,e="Draw",i={}){this.__fire(this._map,"pm:create",{shape:this._shape,marker:t,layer:t},e,i)},_fireCenterPlaced(t="Draw",e={}){let i=t==="Draw"?this._layer:void 0,r=t!=="Draw"?this._layer:void 0;this.__fire(this._layer,"pm:centerplaced",{shape:this._shape,workingLayer:i,layer:r,latlng:this._layer.getLatLng()},t,e)},_fireCut(t,e,i,r="Draw",n={}){this.__fire(t,"pm:cut",{shape:this._shape,layer:e,originalLayer:i},r,n)},_fireEdit(t=this._layer,e="Edit",i={}){this.__fire(t,"pm:edit",{layer:this._layer,shape:this.getShape()},e,i)},_fireEnable(t="Edit",e={}){this.__fire(this._layer,"pm:enable",{layer:this._layer,shape:this.getShape()},t,e)},_fireDisable(t="Edit",e={}){this.__fire(this._layer,"pm:disable",{layer:this._layer,shape:this.getShape()},t,e)},_fireUpdate(t="Edit",e={}){this.__fire(this._layer,"pm:update",{layer:this._layer,shape:this.getShape()},t,e)},_fireMarkerDragStart(t,e=void 0,i="Edit",r={}){this.__fire(this._layer,"pm:markerdragstart",{layer:this._layer,markerEvent:t,shape:this.getShape(),indexPath:e},i,r)},_fireMarkerDrag(t,e=void 0,i="Edit",r={}){this.__fire(this._layer,"pm:markerdrag",{layer:this._layer,markerEvent:t,shape:this.getShape(),indexPath:e},i,r)},_fireMarkerDragEnd(t,e=void 0,i=void 0,r="Edit",n={}){this.__fire(this._layer,"pm:markerdragend",{layer:this._layer,markerEvent:t,shape:this.getShape(),indexPath:e,intersectionReset:i},r,n)},_fireDragStart(t="Edit",e={}){this.__fire(this._layer,"pm:dragstart",{layer:this._layer,shape:this.getShape()},t,e)},_fireDrag(t,e="Edit",i={}){this.__fire(this._layer,"pm:drag",{...t,shape:this.getShape()},e,i)},_fireDragEnd(t="Edit",e={}){this.__fire(this._layer,"pm:dragend",{layer:this._layer,shape:this.getShape()},t,e)},_fireDragEnable(t="Edit",e={}){this.__fire(this._layer,"pm:dragenable",{layer:this._layer,shape:this.getShape()},t,e)},_fireDragDisable(t="Edit",e={}){this.__fire(this._layer,"pm:dragdisable",{layer:this._layer,shape:this.getShape()},t,e)},_fireRemove(t,e=t,i="Edit",r={}){this.__fire(t,"pm:remove",{layer:e,shape:this.getShape()},i,r)},_fireVertexAdded(t,e,i,r="Edit",n={}){this.__fire(this._layer,"pm:vertexadded",{layer:this._layer,workingLayer:this._layer,marker:t,indexPath:e,latlng:i,shape:this.getShape()},r,n)},_fireVertexRemoved(t,e,i="Edit",r={}){this.__fire(this._layer,"pm:vertexremoved",{layer:this._layer,marker:t,indexPath:e,shape:this.getShape()},i,r)},_fireVertexClick(t,e,i="Edit",r={}){this.__fire(this._layer,"pm:vertexclick",{layer:this._layer,markerEvent:t,indexPath:e,shape:this.getShape()},i,r)},_fireIntersect(t,e=this._layer,i="Edit",r={}){this.__fire(e,"pm:intersect",{layer:this._layer,intersection:t,shape:this.getShape()},i,r)},_fireLayerReset(t,e,i="Edit",r={}){this.__fire(this._layer,"pm:layerreset",{layer:this._layer,markerEvent:t,indexPath:e,shape:this.getShape()},i,r)},_fireChange(t,e="Edit",i={}){this.__fire(this._layer,"pm:change",{layer:this._layer,latlngs:t,shape:this.getShape()},e,i)},_fireTextChange(t,e="Edit",i={}){this.__fire(this._layer,"pm:textchange",{layer:this._layer,text:t,shape:this.getShape()},e,i)},_fireTextFocus(t="Edit",e={}){this.__fire(this._layer,"pm:textfocus",{layer:this._layer,shape:this.getShape()},t,e)},_fireTextBlur(t="Edit",e={}){this.__fire(this._layer,"pm:textblur",{layer:this._layer,shape:this.getShape()},t,e)},_fireSnapDrag(t,e,i="Snapping",r={}){this.__fire(t,"pm:snapdrag",e,i,r)},_fireSnap(t,e,i="Snapping",r={}){this.__fire(t,"pm:snap",e,i,r)},_fireUnsnap(t,e,i="Snapping",r={}){this.__fire(t,"pm:unsnap",e,i,r)},_fireRotationEnable(t,e,i="Rotation",r={}){this.__fire(t,"pm:rotateenable",{layer:this._layer,helpLayer:this._rotatePoly,shape:this.getShape()},i,r)},_fireRotationDisable(t,e="Rotation",i={}){this.__fire(t,"pm:rotatedisable",{layer:this._layer,shape:this.getShape()},e,i)},_fireRotationStart(t,e,i="Rotation",r={}){this.__fire(t,"pm:rotatestart",{layer:this._rotationLayer,helpLayer:this._layer,startAngle:this._startAngle,originLatLngs:e},i,r)},_fireRotation(t,e,i,r=this._rotationLayer,n="Rotation",s={}){this.__fire(t,"pm:rotate",{layer:r,helpLayer:this._layer,startAngle:this._startAngle,angle:r.pm.getAngle(),angleDiff:e,oldLatLngs:i,newLatLngs:r.getLatLngs()},n,s)},_fireRotationEnd(t,e,i,r="Rotation",n={}){this.__fire(t,"pm:rotateend",{layer:this._rotationLayer,helpLayer:this._layer,startAngle:e,angle:this._rotationLayer.pm.getAngle(),originLatLngs:i,newLatLngs:this._rotationLayer.getLatLngs()},r,n)},_fireActionClick(t,e,i,r="Toolbar",n={}){this.__fire(this._map,"pm:actionclick",{text:t.text,action:t,btnName:e,button:i},r,n)},_fireButtonClick(t,e,i="Toolbar",r={}){this.__fire(this._map,"pm:buttonclick",{btnName:t,button:e},i,r)},_fireLangChange(t,e,i,r,n="Global",s={}){this.__fire(this.map,"pm:langchange",{oldLang:t,activeLang:e,fallback:i,translations:r},n,s)},_fireGlobalDragModeToggled(t,e="Global",i={}){this.__fire(this.map,"pm:globaldragmodetoggled",{enabled:t,map:this.map},e,i)},_fireGlobalEditModeToggled(t,e="Global",i={}){this.__fire(this.map,"pm:globaleditmodetoggled",{enabled:t,map:this.map},e,i)},_fireGlobalRemovalModeToggled(t,e="Global",i={}){this.__fire(this.map,"pm:globalremovalmodetoggled",{enabled:t,map:this.map},e,i)},_fireGlobalCutModeToggled(t="Global",e={}){this.__fire(this._map,"pm:globalcutmodetoggled",{enabled:!!this._enabled,map:this._map},t,e)},_fireGlobalDrawModeToggled(t="Global",e={}){this.__fire(this._map,"pm:globaldrawmodetoggled",{enabled:this._enabled,shape:this._shape,map:this._map},t,e)},_fireGlobalRotateModeToggled(t="Global",e={}){this.__fire(this.map,"pm:globalrotatemodetoggled",{enabled:this.globalRotateModeEnabled(),map:this.map},t,e)},_fireRemoveLayerGroup(t,e=t,i="Edit",r={}){this.__fire(t,"pm:remove",{layer:e,shape:void 0},i,r)},_fireKeyeventEvent(t,e,i,r="Global",n={}){this.__fire(this.map,"pm:keyevent",{event:t,eventType:e,focusOn:i},r,n)},__fire(t,e,i,r,n={}){i=(0,Qa.default)(i,n,{source:r}),L.PM.Utils._fireEvent(t,e,i)}},Pt=rg;var ng=()=>({_lastEvents:{keydown:void 0,keyup:void 0,current:void 0},_initKeyListener(t){this.map=t,L.DomEvent.on(document,"keydown keyup",this._onKeyListener,this),L.DomEvent.on(window,"blur",this._onBlur,this),t.once("unload",this._unbindKeyListenerEvents,this)},_handleEscapeKey(t){let e=this.map.pm;return!e.getGlobalOptions().exitModeOnEscape||!(e.globalDrawModeEnabled()||e.globalEditModeEnabled()||e.globalDragModeEnabled()||e.globalRemovalModeEnabled()||e.globalRotateModeEnabled()||e.globalCutModeEnabled())?!1:(t.preventDefault(),e.globalDrawModeEnabled()&&e.disableDraw(),e.globalEditModeEnabled()&&e.disableGlobalEditMode(),e.globalDragModeEnabled()&&e.disableGlobalDragMode(),e.globalRemovalModeEnabled()&&e.disableGlobalRemovalMode(),e.globalRotateModeEnabled()&&e.disableGlobalRotateMode(),e.globalCutModeEnabled()&&e.disableGlobalCutMode(),!0)},_handleEnterKey(t){let e=this.map.pm;if(!e.getGlobalOptions().finishOnEnter)return!1;let r=e.Draw.getActiveShape();if(!r)return!1;let n=e.Draw[r];return!n||!n._finishShape||!this._canFinishShape(n,r)?!1:(t.preventDefault(),n._finishShape(),!0)},_canFinishShape(t,e){if(["Marker","CircleMarker","Text"].includes(e))return!1;if(e==="Rectangle")return t._startMarker!==void 0;if(e==="Circle")return t._centerMarker&&t._layerGroup?.hasLayer(t._centerMarker);if(t._layer&&t._layer.getLatLngs){let i=t._layer.getLatLngs();if(e==="Line")return(i.flat?i.flat():i).length>=2;if(e==="Polygon"||e==="Cut")return i.length>=3}return!1},_unbindKeyListenerEvents(){L.DomEvent.off(document,"keydown keyup",this._onKeyListener,this),L.DomEvent.off(window,"blur",this._onBlur,this)},_onKeyListener(t){let e="document";this.map.getContainer().contains(t.target)&&(e="map");let i={event:t,eventType:t.type,focusOn:e};this._lastEvents[t.type]=i,this._lastEvents.current=i,this.map.pm._fireKeyeventEvent(t,t.type,e),t.type==="keydown"&&(t.key==="Escape"&&this._handleEscapeKey(t),t.key==="Enter"&&this._handleEnterKey(t))},_onBlur(t){t.altKey=!1;let e={event:t,eventType:t.type,focusOn:"document"};this._lastEvents[t.type]=e,this._lastEvents.current=e},getLastKeyEvent(t="current"){return this._lastEvents[t]},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}}),to=ng;var Li=wt(ge());function F(t){let e=L.PM.activeLang;return(0,Li.default)(Et[e],t)||(0,Li.default)(Et.en,t)||t}function So(){return window.matchMedia?!window.matchMedia("(pointer: coarse)").matches:!0}function me(t){for(let e=0;e<t.length;e+=1){let i=t[e];if(Array.isArray(i)){if(me(i))return!0}else if(i!=null&&i!=="")return!0}return!1}function _e(t){return t.reduce((e,i)=>{if(i.length!==0){let r=Array.isArray(i)?_e(i):i;Array.isArray(r)?r.length!==0&&e.push(r):e.push(r)}return e},[])}function jg(t,e,i){let r={a:L.CRS.Earth.R,b:63567523142e-4,f:.0033528106647474805},{a:n,b:s,f:a}=r,o=t.lng,h=t.lat,l=i,d=Math.PI,f=e*d/180,k=Math.sin(f),w=Math.cos(f),S=(1-a)*Math.tan(h*d/180),A=1/Math.sqrt(1+S*S),g=S*A,M=Math.atan2(S,w),m=A*k,O=1-m*m,R=O*(n*n-s*s)/(s*s),I=1+R/16384*(4096+R*(-768+R*(320-175*R))),G=R/1024*(256+R*(-128+R*(74-47*R))),q=l/(s*I),c=2*Math.PI,u,p,y;for(;Math.abs(q-c)>1e-12;){u=Math.cos(2*M+q),p=Math.sin(q),y=Math.cos(q);let T=G*p*(u+G/4*(y*(-1+2*u*u)-G/6*u*(-3+4*p*p)*(-3+4*u*u)));c=q,q=l/(s*I)+T}let _=g*p-A*y*w,v=Math.atan2(g*y+A*p*w,(1-a)*Math.sqrt(m*m+_*_)),E=Math.atan2(p*k,A*y-g*p*w),b=a/16*O*(4+a*(4-3*O)),x=E-(1-b)*a*m*(q+b*p*(u+b*y*(-1+2*u*u))),P=o+x*180/d,C=v*180/d;return L.latLng(P,C)}function bi(t,e,i,r,n=!0){let s,a,o,h=[];for(let l=0;l<i;l+=1){if(n)s=l*360/i+r,a=jg(t,s,e),o=L.latLng(a.lng,a.lat);else{let d=t.lat+Math.cos(2*l*Math.PI/i)*e,f=t.lng+Math.sin(2*l*Math.PI/i)*e;o=L.latLng(d,f)}h.push(o)}return h}function Vg(t,e,i){e=(e+360)%360;let r=Math.PI/180,n=180/Math.PI,{R:s}=L.CRS.Earth,a=t.lng*r,o=t.lat*r,h=e*r,l=Math.sin(o),d=Math.cos(o),f=Math.cos(i/s),k=Math.sin(i/s),w=Math.asin(l*f+d*k*Math.cos(h)),S=a+Math.atan2(Math.sin(h)*k*d,f-l*Math.sin(w));S*=n;let A=S-360,g=S<-180?S+360:S;return S=S>180?A:g,L.latLng([w*n,S])}function ye(t,e,i){let r=t.latLngToContainerPoint(e),n=t.latLngToContainerPoint(i),s=Math.atan2(n.y-r.y,n.x-r.x)*180/Math.PI+90;return s+=s<0?360:0,s}function Zt(t,e,i,r){let n=ye(t,e,i);return Vg(e,n,r)}function To(t,e,i="asc"){if(!e||Object.keys(e).length===0)return(h,l)=>h-l;let r=Object.keys(e),n,s=r.length-1,a={};for(;s>=0;)n=r[s],a[n.toLowerCase()]=e[n],s-=1;function o(h){if(h instanceof L.Marker)return"Marker";if(h instanceof L.Circle)return"Circle";if(h instanceof L.CircleMarker)return"CircleMarker";if(h instanceof L.Rectangle)return"Rectangle";if(h instanceof L.Polygon)return"Polygon";if(h instanceof L.Polyline)return"Line"}return(h,l)=>{let d,f;if(t==="instanceofShape"){if(d=o(h.layer).toLowerCase(),f=o(l.layer).toLowerCase(),!d||!f)return 0}else{if(!h.hasOwnProperty(t)||!l.hasOwnProperty(t))return 0;d=h[t].toLowerCase(),f=l[t].toLowerCase()}let k=d in a?a[d]:Number.MAX_SAFE_INTEGER,w=f in a?a[f]:Number.MAX_SAFE_INTEGER,S=0;return k<w?S=-1:k>w&&(S=1),i==="desc"?S*-1:S}}function Lt(t,e=t.getLatLngs()){return t instanceof L.Polygon?L.polygon(e).getLatLngs():L.polyline(e).getLatLngs()}function ki(t,e){if(e.options.crs?.projection?.MAX_LATITUDE){let i=e.options.crs?.projection?.MAX_LATITUDE;t.lat=Math.max(Math.min(i,t.lat),-i)}return t}function St(t){return t.options.renderer||t._map&&(t._map._getPaneRenderer(t.options.pane)||t._map.options.renderer||t._map._renderer)||t._renderer}function Bo(t,e){if(t=t.trim().toLowerCase(),e[t])return t;let r=t.replace(/[-_\s]/g,"_").match(/^([a-z]{2,3})(?:_([a-z]{2,3}))?$/);if(r){let n=[];r[2]&&n.push(`${r[1]}_${r[2]}`),n.push(r[1]);for(let s of n)if(e[s])return s}return t}var Ug=L.Class.extend({includes:[Ja,$a,Za,Wa,Pt],initialize(t){this.map=t,this.Draw=new L.PM.Draw(t),this.Toolbar=new L.PM.Toolbar(t),this.Keyboard=to(),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(t)},setLang(t="en",e,i="en"){t=Bo(t,Et);let r=L.PM.activeLang;e&&(Et[t]=(0,Mi.default)(Et[i],e)),L.PM.activeLang=t,this.map.pm.Toolbar.reinit(),this._fireLangChange(r,t,i,Et[t])},addControls(t){this.Toolbar.addControls(t)},removeControls(){this.Toolbar.removeControls()},toggleControls(){this.Toolbar.toggleControls()},controlsVisible(){return this.Toolbar.isVisible},enableDraw(t="Polygon",e){t==="Poly"&&(t="Polygon"),this.Draw.enable(t,e)},disableDraw(t="Polygon"){t==="Poly"&&(t="Polygon"),this.Draw.disable(t)},setPathOptions(t,e={}){let i=e.ignoreShapes||[],r=e.merge||!1;this.map.pm.Draw.shapes.forEach(n=>{i.indexOf(n)===-1&&this.map.pm.Draw[n].setPathOptions(t,r)})},getGlobalOptions(){return this.globalOptions},setGlobalOptions(t){let e=(0,Mi.default)(this.globalOptions,t);e.editable&&(e.resizeableCircleMarker=e.editable,delete e.editable);let i=!1;this.map.pm.Draw.CircleMarker.enabled()&&!!this.map.pm.Draw.CircleMarker.options.resizeableCircleMarker!=!!e.resizeableCircleMarker&&(this.map.pm.Draw.CircleMarker.disable(),i=!0);let r=!1;this.map.pm.Draw.Circle.enabled()&&!!this.map.pm.Draw.Circle.options.resizeableCircle!=!!e.resizeableCircle&&(this.map.pm.Draw.Circle.disable(),r=!0),this.map.pm.Draw.shapes.forEach(s=>{this.map.pm.Draw[s].setOptions(e)}),i&&this.map.pm.Draw.CircleMarker.enable(),r&&this.map.pm.Draw.Circle.enable(),L.PM.Utils.findLayers(this.map).forEach(s=>{s.pm.setOptions(e)}),this.map.fire("pm:globaloptionschanged"),this.globalOptions=e,this.applyGlobalOptions()},applyGlobalOptions(){L.PM.Utils.findLayers(this.map).forEach(e=>{e.pm.enabled()&&e.pm.applyOptions()})},globalDrawModeEnabled(){return!!this.Draw.getActiveShape()},globalCutModeEnabled(){return!!this.Draw.Cut.enabled()},enableGlobalCutMode(t){return this.Draw.Cut.enable(t)},toggleGlobalCutMode(t){return this.Draw.Cut.toggle(t)},disableGlobalCutMode(){return this.Draw.Cut.disable()},getGeomanLayers(t=!1){let e=L.PM.Utils.findLayers(this.map);if(!t)return e;let i=L.featureGroup();return i._pmTempLayer=!0,e.forEach(r=>{i.addLayer(r)}),i},getGeomanDrawLayers(t=!1){let e=L.PM.Utils.findLayers(this.map).filter(r=>r._drawnByGeoman===!0);if(!t)return e;let i=L.featureGroup();return i._pmTempLayer=!0,e.forEach(r=>{i.addLayer(r)}),i},_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(t){this._touchEventCounter===0&&(L.DomEvent.on(t,"touchmove",this._canvasTouchMove,this),L.DomEvent.on(t,"touchstart touchend touchcancel",this._canvasTouchClick,this)),this._touchEventCounter+=1},_removeTouchEvents(t){this._touchEventCounter===1&&(L.DomEvent.off(t,"touchmove",this._canvasTouchMove,this),L.DomEvent.off(t,"touchstart touchend touchcancel",this._canvasTouchClick,this)),this._touchEventCounter=this._touchEventCounter<=1?0:this._touchEventCounter-1},_canvasTouchMove(t){St(this.map)._onMouseMove(this._createMouseEvent("mousemove",t))},_canvasTouchClick(t){let e="";t.type==="touchstart"||t.type==="pointerdown"?e="mousedown":(t.type==="touchend"||t.type==="pointerup"||t.type==="touchcancel"||t.type==="pointercancel")&&(e="mouseup"),e&&St(this.map)._onClick(this._createMouseEvent(e,t))},_createMouseEvent(t,e){let i,r=e.touches[0]||e.changedTouches[0];try{i=new MouseEvent(t,{bubbles:e.bubbles,cancelable:e.cancelable,view:e.view,detail:r.detail,screenX:r.screenX,screenY:r.screenY,clientX:r.clientX,clientY:r.clientY,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey,button:e.button,relatedTarget:e.relatedTarget})}catch{i=document.createEvent("MouseEvents"),i.initMouseEvent(t,e.bubbles,e.cancelable,e.view,r.detail,r.screenX,r.screenY,r.clientX,r.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}return i}}),Do=Ug;var Kg=L.Control.extend({includes:[Pt],options:{position:"topleft",disableByOtherButtons:!0},initialize(t){this._button=L.Util.extend({},this.options,t)},onAdd(t){return this._map=t,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 t=this.buttonsDomNode;this.buttonsDomNode=this._makeButton(this._button),t?t.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._update()},toggle(t){return typeof t=="boolean"?this._button.toggleStatus=t: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(t){t&&t.preventDefault(),!this._button.disabled&&(this._button.onClick(t,{button:this,event:t}),this._clicked(t),this._button.afterClick(t,{button:this,event:t}))},_makeButton(t){let e=this.options.position.indexOf("right")>-1?"pos-right":"",i=L.DomUtil.create("div",`button-container ${e}`,this._container);t.title&&i.setAttribute("title",t.title);let r=L.DomUtil.create("a","leaflet-buttons-control-button",i);r.setAttribute("role","button"),r.setAttribute("tabindex","0"),r.href="#";let n=L.DomUtil.create("div",`leaflet-pm-actions-container ${e}`,i),s=t.actions,a={cancel:{text:F("actions.cancel"),title:F("actions.cancel"),onClick(){this._triggerClick()}},finishMode:{text:F("actions.finish"),title:F("actions.finish"),onClick(){this._triggerClick()}},removeLastVertex:{text:F("actions.removeLastVertex"),title:F("actions.removeLastVertex"),onClick(){this._map.pm.Draw[t.jsClass]._removeLastVertex()}},finish:{text:F("actions.finish"),title:F("actions.finish"),onClick(h){this._map.pm.Draw[t.jsClass]._finishShape(h)}}};t._preparedActions=s.map(h=>{let l=typeof h=="string"?h:h.name,d;if(a[l])d=a[l];else if(h.text)d=h;else return d;let f=L.DomUtil.create("a",`leaflet-pm-action ${e} action-${l}`,n);if(f.setAttribute("role","button"),f.setAttribute("tabindex","0"),f.href="#",d.title&&(f.title=d.title),f.innerHTML=d.text,L.DomEvent.disableClickPropagation(f),L.DomEvent.on(f,"click",L.DomEvent.stop),d._node=f,!t.disabled&&d.onClick){let k=w=>{w.preventDefault();let S="",{buttons:A}=this._map.pm.Toolbar;for(let g in A)if(A[g]._button===t){S=g;break}this._fireActionClick(d,S,t)};L.DomEvent.addListener(f,"click",k,this),L.DomEvent.addListener(f,"click",d.onClick,this),L.DomEvent.addListener(f,"click",()=>this._updateActiveAction(t))}return d}),this._updateActiveAction(t),t.toggleStatus&&L.DomUtil.addClass(i,"active");let o=L.DomUtil.create("div","control-icon",r);return t.iconUrl&&o.setAttribute("src",t.iconUrl),t.className&&L.DomUtil.addClass(o,t.className),L.DomEvent.disableClickPropagation(r),L.DomEvent.on(r,"click",L.DomEvent.stop),t.disabled||(L.DomEvent.addListener(r,"click",this._onBtnClick,this),L.DomEvent.addListener(r,"click",this._triggerClick,this)),t.disabled&&(L.DomUtil.addClass(r,"pm-disabled"),r.setAttribute("aria-disabled","true")),i},_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 t="",{buttons:e}=this._map.pm.Toolbar;for(let i in e)if(e[i]._button===this._button){t=i;break}this._fireButtonClick(t,this._button)},_clicked(){this._button.doToggle&&this.toggle()},_updateDisabled(){if(!this._container)return;let t="pm-disabled",e=this.buttonsDomNode.children[0];this._button.disabled?(L.DomUtil.addClass(e,t),e.setAttribute("aria-disabled","true")):(L.DomUtil.removeClass(e,t),e.setAttribute("aria-disabled","false"))},_updateActiveAction(t){t._preparedActions?.forEach(e=>{e?._node&&(e.isActive&&e.isActive.call(this)?L.DomUtil.addClass(e._node,"active-action"):L.DomUtil.removeClass(e._node,"active-action"))})}}),Ro=Kg;L.Control.PMButton=Ro;var Hg=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(t){this.customButtons=[],this.options.positions={draw:"",edit:"",options:"",custom:""},this.init(t)},reinit(){let t=this.isVisible;this.removeControls(),this._defineButtons(),t&&this.addControls()},init(t){this.map=t,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(t){let e=`${t}Container`;return this[e]||(this[e]=L.DomUtil.create("div",`leaflet-pm-toolbar leaflet-pm-${t} leaflet-bar leaflet-control`)),this[e]},getButtons(){return this.buttons},addControls(t=this.options){typeof t.editPolygon<"u"&&(t.editMode=t.editPolygon),typeof t.deleteLayer<"u"&&(t.removalMode=t.deleteLayer),L.Util.setOptions(this,t),this.applyIconStyle(),this.isVisible=!0,this._showHideButtons()},applyIconStyle(){let t=this.getButtons(),e={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 i in t){let r=t[i];L.Util.setOptions(r,{className:e.geomanIcons[i]})}},removeControls(){let t=this.getButtons();for(let e in t)t[e].remove();this.isVisible=!1},deleteControl(t){let e=this._btnNameMapping(t);this.buttons[e]&&(this.buttons[e].remove(),delete this.buttons[e])},toggleControls(t=this.options){this.isVisible?this.removeControls():this.addControls(t)},_addButton(t,e){return this.buttons[t]=e,this.options[t]=!!this.options[t]||!1,this.buttons[t]},triggerClickOnToggledButtons(t){for(let e in this.buttons){let i=this.buttons[e];i._button.disableByOtherButtons&&i!==t&&i.toggled()&&i._triggerClick()}},toggleButton(t,e,i=!0){t==="editPolygon"&&(t="editMode"),t==="deleteLayer"&&(t="removalMode");let r=t;return i&&this.triggerClickOnToggledButtons(this.buttons[r]),this.buttons[r]?this.buttons[r].toggle(e):!1},_defineButtons(){let t={className:"control-icon leaflet-pm-icon-marker",title:F("buttonTitles.drawMarkerButton"),jsClass:"Marker",onClick:()=>{},afterClick:(k,w)=>{this.map.pm.Draw[w.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},e={title:F("buttonTitles.drawPolyButton"),className:"control-icon leaflet-pm-icon-polygon",jsClass:"Polygon",onClick:()=>{},afterClick:(k,w)=>{this.map.pm.Draw[w.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["finish","removeLastVertex","cancel"]},i={className:"control-icon leaflet-pm-icon-polyline",title:F("buttonTitles.drawLineButton"),jsClass:"Line",onClick:()=>{},afterClick:(k,w)=>{this.map.pm.Draw[w.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["finish","removeLastVertex","cancel"]},r={title:F("buttonTitles.drawCircleButton"),className:"control-icon leaflet-pm-icon-circle",jsClass:"Circle",onClick:()=>{},afterClick:(k,w)=>{this.map.pm.Draw[w.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},n={title:F("buttonTitles.drawCircleMarkerButton"),className:"control-icon leaflet-pm-icon-circle-marker",jsClass:"CircleMarker",onClick:()=>{},afterClick:(k,w)=>{this.map.pm.Draw[w.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},s={title:F("buttonTitles.drawRectButton"),className:"control-icon leaflet-pm-icon-rectangle",jsClass:"Rectangle",onClick:()=>{},afterClick:(k,w)=>{this.map.pm.Draw[w.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},a={title:F("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"]},o={title:F("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"]},h={title:F("buttonTitles.cutButton"),className:"control-icon leaflet-pm-icon-cut",jsClass:"Cut",onClick:()=>{},afterClick:(k,w)=>{this.map.pm.Draw[w.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:F("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"]},d={title:F("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"]},f={className:"control-icon leaflet-pm-icon-text",title:F("buttonTitles.drawTextButton"),jsClass:"Text",onClick:()=>{},afterClick:(k,w)=>{this.map.pm.Draw[w.button._button.jsClass].toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]};this._addButton("drawMarker",new L.Control.PMButton(t)),this._addButton("drawPolyline",new L.Control.PMButton(i)),this._addButton("drawRectangle",new L.Control.PMButton(s)),this._addButton("drawPolygon",new L.Control.PMButton(e)),this._addButton("drawCircle",new L.Control.PMButton(r)),this._addButton("drawCircleMarker",new L.Control.PMButton(n)),this._addButton("drawText",new L.Control.PMButton(f)),this._addButton("editMode",new L.Control.PMButton(a)),this._addButton("dragMode",new L.Control.PMButton(o)),this._addButton("cutPolygon",new L.Control.PMButton(h)),this._addButton("removalMode",new L.Control.PMButton(l)),this._addButton("rotateMode",new L.Control.PMButton(d))},_showHideButtons(){if(!this.isVisible)return;this.removeControls(),this.isVisible=!0;let t=this.getButtons(),e=[];this.options.drawControls===!1&&(e=e.concat(Object.keys(t).filter(i=>!t[i]._button.tool))),this.options.editControls===!1&&(e=e.concat(Object.keys(t).filter(i=>t[i]._button.tool==="edit"))),this.options.optionsControls===!1&&(e=e.concat(Object.keys(t).filter(i=>t[i]._button.tool==="options"))),this.options.customControls===!1&&(e=e.concat(Object.keys(t).filter(i=>t[i]._button.tool==="custom")));for(let i in t)if(this.options[i]&&e.indexOf(i)===-1){let r=t[i]._button.tool;r||(r="draw"),t[i].setPosition(this._getBtnPosition(r)),t[i].addTo(this.map)}},_getBtnPosition(t){return this.options.positions&&this.options.positions[t]?this.options.positions[t]:this.options.position},setBlockPosition(t,e){this.options.positions[t]=e,this._showHideButtons(),this.changeControlOrder()},getBlockPositions(){return this.options.positions},copyDrawControl(t,e){if(e)typeof e!="object"&&(e={name:e});else throw new TypeError("Button has no name");let i=this._btnNameMapping(t);if(!e.name)throw new TypeError("Button has no name");if(this.buttons[e.name])throw new TypeError("Button with this name already exists");let r=this.map.pm.Draw.createNewDrawInstance(e.name,i);e={...this.buttons[i]._button,...e};let s=this.createCustomControl(e);return{drawInstance:r,control:s}},createCustomControl(t){if(!t.name)throw new TypeError("Button has no name");if(this.buttons[t.name])throw new TypeError("Button with this name already exists");t.onClick||(t.onClick=()=>{}),t.afterClick||(t.afterClick=()=>{}),t.toggle!==!1&&(t.toggle=!0),t.block&&(t.block=t.block.toLowerCase()),(!t.block||t.block==="draw")&&(t.block=""),t.className?t.className.indexOf("control-icon")===-1&&(t.className=`control-icon ${t.className}`):t.className="control-icon";let e={tool:t.block,className:t.className,title:t.title||"",jsClass:t.name,onClick:t.onClick,afterClick:t.afterClick,doToggle:t.toggle,toggleStatus:!1,disableOtherButtons:t.disableOtherButtons??!0,disableByOtherButtons:t.disableByOtherButtons??!0,cssToggle:t.toggle,position:this.options.position,actions:t.actions||[],disabled:!!t.disabled};this.options[t.name]!==!1&&(this.options[t.name]=!0);let i=this._addButton(t.name,new L.Control.PMButton(e));return this.changeControlOrder(),i},controlExists(t){return!!this.getButton(t)},getButton(t){return this.getButtons()[t]},getButtonsInBlock(t){let e={};if(t)for(let i in this.getButtons()){let r=this.getButtons()[i];(r._button.tool===t||t==="draw"&&!r._button.tool)&&(e[i]=r)}return e},changeControlOrder(t=[]){let e=this._shapeMapping(),i=[];t.forEach(l=>{e[l]?i.push(e[l]):i.push(l)});let r=this.getButtons(),n={};i.forEach(l=>{r[l]&&(n[l]=r[l])}),Object.keys(r).filter(l=>!r[l]._button.tool||r[l]._button.tool==="draw").forEach(l=>{i.indexOf(l)===-1&&(n[l]=r[l])}),Object.keys(r).filter(l=>r[l]._button.tool==="edit").forEach(l=>{i.indexOf(l)===-1&&(n[l]=r[l])}),Object.keys(r).filter(l=>r[l]._button.tool==="options").forEach(l=>{i.indexOf(l)===-1&&(n[l]=r[l])}),Object.keys(r).filter(l=>r[l]._button.tool==="custom").forEach(l=>{i.indexOf(l)===-1&&(n[l]=r[l])}),Object.keys(r).forEach(l=>{i.indexOf(l)===-1&&(n[l]=r[l])}),this.map.pm.Toolbar.buttons=n,this._showHideButtons()},getControlOrder(){let t=this.getButtons(),e=[];for(let i in t)e.push(i);return e},changeActionsOfControl(t,e){let i=this._btnNameMapping(t);if(!i)throw new TypeError("No name passed");if(!e)throw new TypeError("No actions passed");if(!this.buttons[i])throw new TypeError("Button with this name not exists");this.buttons[i]._button.actions=e,this.changeControlOrder()},setButtonDisabled(t,e){let i=this._btnNameMapping(t);e?this.buttons[i].disable():this.buttons[i].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(t){let e=this._shapeMapping();return e[t]?e[t]:t}}),Oo=Hg;var Io=wt(Oe());var Xg={_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(t){t.forEach(e=>{if(Array.isArray(e)){this._assignEvents(e);return}e.off("drag",this._handleSnapping,this),e.on("drag",this._handleSnapping,this),e.off("dragend",this._cleanupSnapping,this),e.on("dragend",this._cleanupSnapping,this)})},_cleanupSnapping(t){if(t){let e=t.target;e._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(e=>{e.remove()})},_handleThrottleSnapping(){this.throttledList&&this._createSnapList()},_handleSnapping(t,e=!1){let i=t.target;if(i._snapped=!1,this.throttledList||(this.throttledList=L.Util.throttle(this._handleThrottleSnapping,100,this)),t?.originalEvent?.altKey||this._map?.pm?.Keyboard.isAltKeyPressed())return!1;let r;if(e){if(!this._otherSnapLayers||this._otherSnapLayers.length===0)return!1;r=this._otherSnapLayers}else this._snapList===void 0&&(this._createSnapList(),this._map.off("layeradd",this.throttledList,this),this._map.on("layeradd",this.throttledList,this)),r=this._snapList;if(r.length<=0)return!1;let n=this._calcClosestLayer(i.getLatLng(),r);if(Object.keys(n).length===0)return!1;let s=n.layer instanceof L.Marker||n.layer instanceof L.CircleMarker||!this.options.snapSegment,a;s?a=n.latlng:a=this._checkPrioritiySnapping(n);let o=this.options.snapDistance,h={marker:i,shape:this._shape,snapLatLng:a,segment:n.segment,layer:this._layer,workingLayer:this._layer,layerInteractedWith:n.layer,distance:n.distance};if(this._fireSnapDrag(h.marker,h),this._fireSnapDrag(this._layer,h),n.distance<o){i._orgLatLng=i.getLatLng(),i.setLatLng(a),i._snapped=!0,i._snapInfo=h;let l=()=>{this._snapLatLng=a,this._fireSnap(i,h),this._fireSnap(this._layer,h)},d=this._snapLatLng||{},f=a||{};(d.lat!==f.lat||d.lng!==f.lng)&&l()}else this._snapLatLng&&(this._unsnap(h),i._snapped=!1,i._snapInfo=void 0,this._fireUnsnap(h.marker,h),this._fireUnsnap(this._layer,h));return!0},_createSnapList(){let t=[],e=[],i=this._map;i.off("layerremove",this._handleSnapLayerRemoval,this),i.on("layerremove",this._handleSnapLayerRemoval,this),i.eachLayer(r=>{if((r instanceof L.Polyline||r instanceof L.Marker||r instanceof L.CircleMarker||r instanceof L.ImageOverlay)&&r.options.snapIgnore!==!0){if(r.options.snapIgnore===void 0&&(!L.PM.optIn&&r.options.pmIgnore===!0||L.PM.optIn&&r.options.pmIgnore!==!1))return;(r instanceof L.Circle||r instanceof L.CircleMarker)&&r.pm&&r.pm._hiddenPolyCircle?t.push(r.pm._hiddenPolyCircle):r instanceof L.ImageOverlay&&(r=L.rectangle(r.getBounds())),t.push(r);let n=L.polyline([],{color:"red",pmIgnore:!0});n._pmTempLayer=!0,e.push(n),(r instanceof L.Circle||r instanceof L.CircleMarker)&&e.push(n)}}),t=t.filter(r=>this._layer!==r),t=t.filter(r=>r._latlng||r._latlngs&&me(r._latlngs)),t=t.filter(r=>!r._pmTempLayer),this._otherSnapLayers?(this._otherSnapLayers.forEach(()=>{let r=L.polyline([],{color:"red",pmIgnore:!0});r._pmTempLayer=!0,e.push(r)}),this._snapList=t.concat(this._otherSnapLayers)):this._snapList=t,this.debugIndicatorLines=e},_handleSnapLayerRemoval({layer:t}){if(!t._leaflet_id)return;let e=this._snapList.findIndex(i=>i._leaflet_id===t._leaflet_id);e>-1&&this._snapList.splice(e,1)},_calcClosestLayer(t,e){return this._calcClosestLayers(t,e,1)[0]},_calcClosestLayers(t,e,i=1){let r=[],n={};e.forEach((a,o)=>{if(a._parentCopy&&a._parentCopy===this._layer||a.getLatLngs?.().flat(5).length<2)return;let h=this._calcLayerDistances(t,a);if(h.distance=Math.floor(h.distance),this.debugIndicatorLines){if(!this.debugIndicatorLines[o]){let l=L.polyline([],{color:"red",pmIgnore:!0});l._pmTempLayer=!0,this.debugIndicatorLines[o]=l}this.debugIndicatorLines[o].setLatLngs([t,h.latlng])}i===1&&(n.distance===void 0||h.distance-5<=n.distance)?(h.distance+5<n.distance&&(r=[]),n=h,n.layer=a,r.push(n)):i!==1&&(n={},n=h,n.layer=a,r.push(n))}),i!==1&&(r=r.sort((a,o)=>a.distance-o.distance)),i===-1&&(i=r.length);let s=this._getClosestLayerByPriority(r,i);return L.Util.isArray(s)?s:[s]},_calcLayerDistances(t,e){let i=this._map,r=e instanceof L.Marker||e instanceof L.CircleMarker,n=e instanceof L.Polygon,s=t;if(r){let a=e.getLatLng();return{latlng:{...a},distance:this._getDistance(i,a,s)}}return this._calcLatLngDistances(s,e.getLatLngs(),i,n)},_calcLatLngDistances(t,e,i,r=!1){let n,s,a,o=h=>{h.forEach((l,d)=>{if(Array.isArray(l)){o(l);return}if(this.options.snapSegment){let f=l,k;r?k=d+1===h.length?0:d+1:k=d+1===h.length?void 0:d+1;let w=h[k];if(w){let S=this._getDistanceToSegment(i,t,f,w);(s===void 0||S<s)&&(s=S,a=[f,w])}}else{let f=this._getDistance(i,t,l);(s===void 0||f<s)&&(s=f,n=l)}})};return o(e),this.options.snapSegment?{latlng:{...this._getClosestPointOnSegment(i,t,a[0],a[1])},segment:a,distance:s}:{latlng:n,distance:s}},_getClosestLayerByPriority(t,e=1){t=t.sort((a,o)=>a._leaflet_id-o._leaflet_id);let i=["Marker","CircleMarker","Circle","Line","Polygon","Rectangle"],r=this._map.pm.globalOptions.snappingOrder||[],n=0,s={};return r.concat(i).forEach(a=>{s[a]||(n+=1,s[a]=n)}),t.sort(To("instanceofShape",s)),e===1?t[0]||{}:t.slice(0,e)},_checkPrioritiySnapping(t){let e=this._map,i=t.segment[0],r=t.segment[1],n=t.latlng,s=n;if(this.options.snapVertex){let a=this._getDistance(e,i,n),o=this._getDistance(e,r,n),h=a<o?i:r,l=a<o?a:o;if(this.options.snapMiddle){let f=L.PM.Utils.calcMiddleLatLng(e,i,r),k=this._getDistance(e,f,n);k<a&&k<o&&(h=f,l=k)}let d=this.options.snapDistance;l<d&&(s=h)}return{...s}},_unsnap(){delete this._snapLatLng},_getClosestPointOnSegment(t,e,i,r){let n=t.getMaxZoom();n===1/0&&(n=t.getZoom());let s=t.project(e,n),a=t.project(i,n),o=t.project(r,n),h=L.LineUtil.closestPointOnSegment(s,a,o);return t.unproject(h,n)},_getDistanceToSegment(t,e,i,r){let n=t.latLngToContainerPoint(e),s=t.latLngToContainerPoint(i),a=t.latLngToContainerPoint(r);return L.LineUtil.pointToSegmentDistance(n,s,a)},_getDistance(t,e,i){return t.latLngToContainerPoint(e).distanceTo(t.latLngToContainerPoint(i))}},Ae=Xg;var Yg=L.Class.extend({includes:[Ae,Pt],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(t){L.Util.setOptions(this,t),this.setStyle(this.options)},setStyle(){},getOptions(){return this.options},initialize(t){let e=new L.Icon.Default;e.options.tooltipAnchor=[0,0],this.options.markerStyle.icon=e,this._map=t,this.shapes=["Marker","CircleMarker","Line","Polygon","Rectangle","Circle","Cut","Text"],this.shapes.forEach(i=>{this[i]=new L.PM.Draw[i](this._map)}),this.Marker.setOptions({continueDrawing:!0}),this.CircleMarker.setOptions({continueDrawing:!0})},setPathOptions(t,e=!1){e?this.options.pathOptions=(0,Io.default)(this.options.pathOptions,t):this.options.pathOptions=t},getShapes(){return this.shapes},getShape(){return this._shape},enable(t,e){if(!t)throw new Error(`Error: Please pass a shape as a parameter. Possible shapes are: ${this.getShapes().join(",")}`);this.disable(),this[t].enable(e)},disable(){this.shapes.forEach(t=>{this[t].disable()})},addControls(){this.shapes.forEach(t=>{this[t].addButton()})},getActiveShape(){let t;return this.shapes.forEach(e=>{this[e]._enabled&&(t=e)}),t},_setGlobalDrawMode(){this._shape==="Cut"?this._fireGlobalCutModeToggled():this._fireGlobalDrawModeToggled();let t=[];this._map.eachLayer(e=>{(e instanceof L.Polyline||e instanceof L.Marker||e instanceof L.Circle||e instanceof L.CircleMarker||e instanceof L.ImageOverlay)&&(e._pmTempLayer||t.push(e))}),this._enabled?t.forEach(e=>{L.PM.Utils.disablePopup(e)}):t.forEach(e=>{L.PM.Utils.enablePopup(e)})},createNewDrawInstance(t,e){let i=this._getShapeFromBtnName(e);if(this[t])throw new TypeError("Draw Type already exists");if(!L.PM.Draw[i])throw new TypeError(`There is no class L.PM.Draw.${i}`);return this[t]=new L.PM.Draw[i](this._map),this[t].toolbarButtonName=t,this[t]._shape=t,this.shapes.push(t),this[e]&&this[t].setOptions(this[e].options),this[t].setOptions(this[t].options),this[t]},_getShapeFromBtnName(t){let e={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 e[t]?e[t]:this[t]?this[t]._shape:t},_finishLayer(t){t.pm&&(t.pm.setOptions(this.options),t.pm._shape=this._shape,t.pm._map=this._map),this._addDrawnLayerProp(t)},_addDrawnLayerProp(t){t._drawnByGeoman=!0},_setPane(t,e){e==="layerPane"?t.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.layerPane||"overlayPane":e==="vertexPane"?t.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.vertexPane||"markerPane":e==="markerPane"&&(t.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}}),Y=Yg;Y.Marker=Y.extend({initialize(t){this._map=t,this._shape="Marker",this.toolbarButtonName="drawMarker",this._layerIsDragging=!1},enable(t){L.Util.setOptions(this,t),this._enabled=!0,this._isTouchDevice=!So(),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(F("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(e=>{this.isRelevantMarker(e)&&e.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(t=>{this.isRelevantMarker(t)&&t.pm.disable()}),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping(),this._fireDrawEnd(),this._setGlobalDrawMode())},enabled(){return this._enabled},toggle(t){this.enabled()?this.disable():this.enable(t)},isRelevantMarker(t){return t instanceof L.Marker&&t.pm&&!t._pmTempLayer&&!t.pm._initTextMarker},_syncHintMarker(t){if(this._hintMarker.setLatLng(t.latlng),this.options.snappable){let e=t;e.target=this._hintMarker,this._handleSnapping(e)}this._fireChange(this._hintMarker.getLatLng(),"Draw")},_createMarker(t){if(!t.latlng||this._layerIsDragging||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);let e=this._hintMarker.getLatLng(),i=new L.Marker(e,this.options.markerStyle);this._setPane(i,"markerPane"),this._finishLayer(i),i.pm||(i.options.draggable=!1),i.addTo(this._map.pm._getContainingLayer()),i.pm&&this.options.markerEditable?i.pm.enable():i.dragging&&i.dragging.disable(),this._fireCreate(i),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=F("tooltips.placeMarkerTouch"),this._map.getContainer().appendChild(this._touchHint))},_removeTouchHint(){this._touchHint&&this._touchHint.parentNode&&(this._touchHint.parentNode.removeChild(this._touchHint),this._touchHint=null)}});var lt=63710088e-1,Jg={centimeters:lt*100,centimetres:lt*100,degrees:360/(2*Math.PI),feet:lt*3.28084,inches:lt*39.37,kilometers:lt/1e3,kilometres:lt/1e3,meters:lt,metres:lt,miles:lt/1609.344,millimeters:lt*1e3,millimetres:lt*1e3,nauticalmiles:lt/1852,radians:1,yards:lt*1.0936};function ct(t,e,i={}){let r={type:"Feature"};return(i.id===0||i.id)&&(r.id=i.id),i.bbox&&(r.bbox=i.bbox),r.properties=e||{},r.geometry=t,r}function bt(t,e,i={}){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Ao(t[0])||!Ao(t[1]))throw new Error("coordinates must contain numbers");return ct({type:"Point",coordinates:t},e,i)}function Tt(t,e,i={}){if(t.length<2)throw new Error("coordinates must be an array of two or more positions");return ct({type:"LineString",coordinates:t},e,i)}function rt(t,e={}){let i={type:"FeatureCollection"};return e.id&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.features=t,i}function Go(t,e="kilometers"){let i=Jg[e];if(!i)throw new Error(e+" units is invalid");return t*i}function vi(t){return t%(2*Math.PI)*180/Math.PI}function Bt(t){return t%360*Math.PI/180}function Ao(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function xi(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function $g(t){let e,i,r={type:"FeatureCollection",features:[]};if(t.type==="Feature"?i=t.geometry:i=t,i.type==="LineString")e=[i.coordinates];else if(i.type==="MultiLineString")e=i.coordinates;else if(i.type==="MultiPolygon")e=[].concat(...i.coordinates);else if(i.type==="Polygon")e=i.coordinates;else throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");return e.forEach(n=>{e.forEach(s=>{for(let a=0;a<n.length-1;a++)for(let o=a;o<s.length-1;o++){if(n===s&&(Math.abs(a-o)===1||a===0&&o===n.length-2&&n[a][0]===n[n.length-1][0]&&n[a][1]===n[n.length-1][1]))continue;let h=Zg(n[a][0],n[a][1],n[a+1][0],n[a+1][1],s[o][0],s[o][1],s[o+1][0],s[o+1][1]);h&&r.features.push(bt([h[0],h[1]]))}})}),r}function Zg(t,e,i,r,n,s,a,o){let h,l,d,f,k,w={x:null,y:null,onLine1:!1,onLine2:!1};return h=(o-s)*(i-t)-(a-n)*(r-e),h===0?w.x!==null&&w.y!==null?w:!1:(l=e-s,d=t-n,f=(a-n)*l-(o-s)*d,k=(i-t)*l-(r-e)*d,l=f/h,d=k/h,w.x=t+l*(i-t),w.y=e+l*(r-e),l>=0&&l<=1&&(w.onLine1=!0),d>=0&&d<=1&&(w.onLine2=!0),w.onLine1&&w.onLine2?[w.x,w.y]:!1)}var Wt=$g;Y.Line=Y.extend({initialize(t){this._map=t,this._shape="Line",this.toolbarButtonName="drawPolyline",this._doesSelfIntersect=!1},enable(t){L.Util.setOptions(this,t),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(F("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(t){this.enabled()?this.disable():this.enable(t)},_syncHintLine(){let t=this._layer.getLatLngs();if(t.length>0){let e=t[t.length-1];this._hintline.setLatLngs([e,this._hintMarker.getLatLng()])}},_syncHintMarker(t){if(this._hintMarker.setLatLng(t.latlng),this.options.snappable){let i=t;i.target=this._hintMarker,this._handleSnapping(i)}else if(this._otherSnapLayers&&this._otherSnapLayers.length>0){let i=t;i.target=this._hintMarker,this._handleSnapping(i,!0)}this.options.allowSelfIntersection||this._handleSelfIntersection(!0,this._hintMarker.getLatLng());let e=this._layer._defaultShape().slice();e.push(this._hintMarker.getLatLng()),this._change(e)},hasSelfIntersection(){return Wt(this._layer.toGeoJSON(15)).features.length>0},_handleSelfIntersection(t,e){let i=L.polyline(this._layer.getLatLngs());t&&(e||(e=this._hintMarker.getLatLng()),i.addLatLng(e));let r=Wt(i.toGeoJSON(15));this._doesSelfIntersect=r.features.length>0,this._doesSelfIntersect?this.isRed||(this.isRed=!0,this._hintline.setStyle({color:"#f00000ff"}),this._fireIntersect(r,this._map,"Draw")):this._hintline.isEmpty()||(this.isRed=!1,this._hintline.setStyle(this.options.hintlineStyle))},_createVertex(t){if(!this.options.allowSelfIntersection&&(this._handleSelfIntersection(!0,t.latlng),this._doesSelfIntersect))return;this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);let e=this._hintMarker.getLatLng(),i=this._layer.getLatLngs(),r=i[i.length-1];if(e.equals(i[0])||i.length>0&&e.equals(r)){this._finishShape();return}this._layer._latlngInfo=this._layer._latlngInfo||[],this._layer._latlngInfo.push({latlng:e,snapInfo:this._hintMarker._snapInfo}),this._layer.addLatLng(e);let n=this._createMarker(e);this._setTooltipText(),this._setHintLineAfterNewVertex(e),this._fireVertexAdded(n,void 0,e,"Draw"),this._change(this._layer.getLatLngs()),this.options.finishOn==="snap"&&this._hintMarker._snapped&&this._finishShape(t)},_setHintLineAfterNewVertex(t){this._hintline.setLatLngs([t,t])},_removeLastVertex(){let t=this._markers;if(t.length<=1){this.disable();return}let e=this._layer.getLatLngs(),i=t[t.length-1],{indexPath:r}=L.PM.Utils.findDeepMarkerIndex(t,i);t.pop(),this._layerGroup.removeLayer(i);let n=t[t.length-1],s=e.indexOf(n.getLatLng());e=e.slice(0,s+1),this._layer.setLatLngs(e),this._layer._latlngInfo.pop(),this._syncHintLine(),this._setTooltipText(),this._fireVertexRemoved(i,r,"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 t=this._layer.getLatLngs();if(t.length<=1)return;let e=L.polyline(t,this.options.pathOptions);this._setPane(e,"layerPane"),this._finishLayer(e),e.addTo(this._map.pm._getContainingLayer()),this._fireCreate(e),this.options.snappable&&this._cleanupSnapping();let i=this._hintMarker.getLatLng();this.disable(),this.options.continueDrawing&&(this.enable(),this._hintMarker.setLatLng(i))},_createMarker(t){let e=new L.Marker(t,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return this._setPane(e,"vertexPane"),e._pmTempLayer=!0,this._layerGroup.addLayer(e),this._markers.push(e),e.on("click",this._finishShape,this),e},_setTooltipText(){let{length:t}=this._layer.getLatLngs().flat(),e="";t<=1?e=F("tooltips.continueLine"):e=F("tooltips.finishLine"),this._hintMarker.setTooltipContent(e)},_change(t){this._fireChange(t,"Draw")},setStyle(){this._layer?.setStyle(this.options.templineStyle),this._hintline?.setStyle(this.options.hintlineStyle)}});Y.Polygon=Y.Line.extend({initialize(t){this._map=t,this._shape="Polygon",this.toolbarButtonName="drawPolygon"},enable(t){L.PM.Draw.Line.prototype.enable.call(this,t),this._layer.pm._shape="Polygon"},_createMarker(t){let e=new L.Marker(t,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return this._setPane(e,"vertexPane"),e._pmTempLayer=!0,this._layerGroup.addLayer(e),this._markers.push(e),this._layer.getLatLngs().flat().length===1?(e.on("click",this._finishShape,this),this._tempSnapLayerIndex=this._otherSnapLayers.push(e)-1,this.options.snappable&&this._cleanupSnapping()):e.on("click",()=>1),e},_setTooltipText(){let{length:t}=this._layer.getLatLngs().flat(),e="";t<=2?e=F("tooltips.continueLine"):e=F("tooltips.finishPoly"),this._hintMarker.setTooltipContent(e)},_finishShape(){if(!this.options.allowSelfIntersection&&(this._handleSelfIntersection(!0,this._layer.getLatLngs()[0]),this._doesSelfIntersect)||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;let t=this._layer.getLatLngs();if(t.length<=2)return;let e=L.polygon(t,this.options.pathOptions);this._setPane(e,"layerPane"),this._finishLayer(e),e.addTo(this._map.pm._getContainingLayer()),this._fireCreate(e),this._cleanupSnapping(),this._otherSnapLayers.splice(this._tempSnapLayerIndex,1),delete this._tempSnapLayerIndex;let i=this._hintMarker.getLatLng();this.disable(),this.options.continueDrawing&&(this.enable(),this._hintMarker.setLatLng(i))}});Y.Rectangle=Y.extend({initialize(t){this._map=t,this._shape="Rectangle",this.toolbarButtonName="drawRectangle"},enable(t){if(L.Util.setOptions(this,t),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(F("tooltips.firstVertex"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this.options.cursorMarker){this._styleMarkers=[];for(let e=0;e<2;e+=1){let i=L.marker(this._map.getCenter(),{icon:L.divIcon({className:"marker-icon rect-style-marker"}),draggable:!1,zIndexOffset:100});this._setPane(i,"vertexPane"),i._pmTempLayer=!0,this._layerGroup.addLayer(i),this._styleMarkers.push(i)}}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(t){this.enabled()?this.disable():this.enable(t)},_placeStartingMarkers(t){this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);let e=this._hintMarker.getLatLng();L.DomUtil.addClass(this._startMarker._icon,"visible"),this._startMarker.setLatLng(e),this.options.cursorMarker&&this._styleMarkers&&this._styleMarkers.forEach(i=>{L.DomUtil.addClass(i._icon,"visible"),i.setLatLng(e)}),this._map.off("click",this._placeStartingMarkers,this),this._map.on("click",this._finishShape,this),this._hintMarker.setTooltipContent(F("tooltips.finishRect")),this._setRectangleOrigin()},_setRectangleOrigin(){let t=this._startMarker.getLatLng();t&&(this._layerGroup.addLayer(this._layer),this._layer.setLatLngs([t,t]),this._hintMarker.on("move",this._syncRectangleSize,this))},_syncHintMarker(t){if(this._hintMarker.setLatLng(t.latlng),this.options.snappable){let i=t;i.target=this._hintMarker,this._handleSnapping(i)}let e=this._layerGroup&&this._layerGroup.hasLayer(this._layer)?this._layer.getLatLngs():[this._hintMarker.getLatLng()];this._fireChange(e,"Draw")},_syncRectangleSize(){let t=ki(this._startMarker.getLatLng(),this._map),e=ki(this._hintMarker.getLatLng(),this._map),i=L.PM.Utils._getRotatedRectangle(t,e,this.options.rectangleAngle||0,this._map);if(this._layer.setLatLngs(i),this.options.cursorMarker&&this._styleMarkers){let r=[];i.forEach(n=>{!n.equals(t,1e-8)&&!n.equals(e,1e-8)&&r.push(n)}),r.forEach((n,s)=>{try{this._styleMarkers[s].setLatLng(n)}catch{}})}},_findCorners(){let t=this._layer.getLatLngs()[0];return L.PM.Utils._getRotatedRectangle(t[0],t[2],this.options.rectangleAngle||0,this._map)},_finishShape(t){t?.latlng&&!this._hintMarker._snapped&&this._hintMarker.setLatLng(t.latlng);let e=this._hintMarker.getLatLng(),i=this._startMarker.getLatLng();if(this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer()||i.equals(e))return;let r=L.rectangle([i,e],this.options.pathOptions);if(this.options.rectangleAngle){let s=L.PM.Utils._getRotatedRectangle(i,e,this.options.rectangleAngle||0,this._map);r.setLatLngs(s),r.pm&&r.pm._setAngle(this.options.rectangleAngle||0)}this._setPane(r,"layerPane"),this._finishLayer(r),r.addTo(this._map.pm._getContainingLayer()),this._fireCreate(r);let n=this._hintMarker.getLatLng();this.disable(),this.options.continueDrawing&&(this.enable(),this._hintMarker.setLatLng(n))},setStyle(){this._layer?.setStyle(this.options.pathOptions)}});Y.CircleMarker=Y.extend({initialize(t){this._map=t,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(t){if(L.Util.setOptions(this,t),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 e={};L.extend(e,this.options.templineStyle),e.radius=0,this._layerGroup=new L.FeatureGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=new this._BaseCircleClass(this._map.getCenter(),e),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(F("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(F("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(t=>{this.isRelevantMarker(t)&&t.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(t=>{this.isRelevantMarker(t)&&t.pm.disable()})},enabled(){return this._enabled},toggle(t){this.enabled()?this.disable():this.enable(t)},_placeCenterMarker(t){this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng),this._layerGroup.addLayer(this._layer),this._layerGroup.addLayer(this._centerMarker);let e=this._hintMarker.getLatLng();this._centerMarker.setLatLng(e),this._map.off("click",this._placeCenterMarker,this),this._map.on("click",this._finishShape,this),this._placeCircleCenter()},_placeCircleCenter(){let t=this._centerMarker.getLatLng();t&&(this._layer.setLatLng(t),this._hintMarker.on("move",this._syncHintLine,this),this._hintMarker.on("move",this._syncCircleRadius,this),this._hintMarker.setTooltipContent(F("tooltips.finishCircle")),this._fireCenterPlaced(),this._fireChange(this._layer.getLatLng(),"Draw"))},_syncHintLine(){let t=this._centerMarker.getLatLng(),e=this._getNewDestinationOfHintMarker();this._hintline.setLatLngs([t,e])},_syncCircleRadius(){let t=this._centerMarker.getLatLng(),e=this._hintMarker.getLatLng(),i=this._distanceCalculation(t,e);this.options[this._minRadiusOption]&&i<this.options[this._minRadiusOption]?this._layer.setRadius(this.options[this._minRadiusOption]):this.options[this._maxRadiusOption]&&i>this.options[this._maxRadiusOption]?this._layer.setRadius(this.options[this._maxRadiusOption]):this._layer.setRadius(i)},_syncHintMarker(t){if(this._hintMarker.setLatLng(t.latlng),this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker()),this.options.snappable){let i=t;i.target=this._hintMarker,this._handleSnapping(i)}this._handleHintMarkerSnapping();let e=this._layerGroup&&this._layerGroup.hasLayer(this._centerMarker)?this._centerMarker.getLatLng():this._hintMarker.getLatLng();this._fireChange(e,"Draw")},isRelevantMarker(t){return t instanceof L.CircleMarker&&!(t instanceof L.Circle)&&t.pm&&!t._pmTempLayer},_createMarker(t){if(this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer()||!t.latlng||this._layerIsDragging)return;this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);let e=this._hintMarker.getLatLng(),i=new this._BaseCircleClass(e,{radius:this._defaultRadius,...this.options.pathOptions});this._setPane(i,"layerPane"),this._finishLayer(i),i.addTo(this._map.pm._getContainingLayer()),this._extendingCreateMarker(i),this._fireCreate(i),this._cleanupSnapping(),this.options.continueDrawing||this.disable()},_extendingCreateMarker(t){t.pm&&this.options.markerEditable&&t.pm.enable()},_finishShape(t){if(this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;t?.latlng&&!this._hintMarker._snapped&&this._hintMarker.setLatLng(t.latlng);let e=this._centerMarker.getLatLng(),i=this._defaultRadius;if(this.options[this._editableOption]){let a=this._hintMarker.getLatLng();i=this._distanceCalculation(e,a),this.options[this._minRadiusOption]&&i<this.options[this._minRadiusOption]?i=this.options[this._minRadiusOption]:this.options[this._maxRadiusOption]&&i>this.options[this._maxRadiusOption]&&(i=this.options[this._maxRadiusOption])}let r={...this.options.pathOptions,radius:i},n=new this._BaseCircleClass(e,r);this._setPane(n,"layerPane"),this._finishLayer(n),n.addTo(this._map.pm._getContainingLayer()),n.pm&&n.pm._updateHiddenPolyCircle(),this._fireCreate(n);let s=this._hintMarker.getLatLng();this.disable(),this.options.continueDrawing&&(this.enable(),this._hintMarker.setLatLng(s))},_getNewDestinationOfHintMarker(){let t=this._hintMarker.getLatLng();if(this.options[this._editableOption]){if(!this._layerGroup.hasLayer(this._centerMarker))return t;let e=this._centerMarker.getLatLng(),i=this._distanceCalculation(e,t);this.options[this._minRadiusOption]&&i<this.options[this._minRadiusOption]?t=Zt(this._map,e,t,this._getMinDistanceInMeter()):this.options[this._maxRadiusOption]&&i>this.options[this._maxRadiusOption]&&(t=Zt(this._map,e,t,this._getMaxDistanceInMeter()))}return t},_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 t=this._centerMarker.getLatLng(),e=this._hintMarker.getLatLng(),i=this._distanceCalculation(t,e);this._layerGroup.hasLayer(this._centerMarker)&&(this.options[this._minRadiusOption]&&i<this.options[this._minRadiusOption]?this._hintMarker.setLatLng(this._hintMarker._orgLatLng):this.options[this._maxRadiusOption]&&i>this.options[this._maxRadiusOption]&&this._hintMarker.setLatLng(this._hintMarker._orgLatLng))}this._hintMarker.setLatLng(this._getNewDestinationOfHintMarker())}},setStyle(){let t={};L.extend(t,this.options.templineStyle),this.options[this._editableOption]&&(t.radius=0),this._layer?.setStyle(t),this._hintline?.setStyle(this.options.hintlineStyle)},_distanceCalculation(t,e){return this._map.project(t).distanceTo(this._map.project(e))}});Y.Circle=Y.CircleMarker.extend({initialize(t){this._map=t,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(t,e){return this._map.distance(t,e)}});var ze=class{constructor(e=[],i=Wg){if(this.data=e,this.length=this.data.length,this.compare=i,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;let e=this.data[0],i=this.data.pop();return this.length--,this.length>0&&(this.data[0]=i,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:i,compare:r}=this,n=i[e];for(;e>0;){let s=e-1>>1,a=i[s];if(r(n,a)>=0)break;i[e]=a,e=s}i[e]=n}_down(e){let{data:i,compare:r}=this,n=this.length>>1,s=i[e];for(;e<n;){let a=(e<<1)+1,o=i[a],h=a+1;if(h<this.length&&r(i[h],o)<0&&(a=h,o=i[h]),r(o,s)>=0)break;i[e]=o,e=a}i[e]=s}};function Wg(t,e){return t<e?-1:t>e?1:0}function No(t,e){return t.p.x>e.p.x?1:t.p.x<e.p.x?-1:t.p.y!==e.p.y?t.p.y>e.p.y?1:-1:1}function Qg(t,e){return t.rightSweepEvent.p.x>e.rightSweepEvent.p.x?1:t.rightSweepEvent.p.x<e.rightSweepEvent.p.x?-1:t.rightSweepEvent.p.y!==e.rightSweepEvent.p.y?t.rightSweepEvent.p.y<e.rightSweepEvent.p.y?1:-1:1}var Fe=class{constructor(e,i,r,n){this.p={x:e[0],y:e[1]},this.featureId=i,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}};function tm(t,e){if(t.type==="FeatureCollection"){let i=t.features;for(let r=0;r<i.length;r++)qo(i[r],e)}else qo(t,e)}var Ge=0,qe=0,Ne=0;function qo(t,e){let i=t.type==="Feature"?t.geometry:t,r=i.coordinates;(i.type==="Polygon"||i.type==="MultiLineString")&&(r=[r]),i.type==="LineString"&&(r=[[r]]);for(let n=0;n<r.length;n++)for(let s=0;s<r[n].length;s++){let a=r[n][s][0],o=null;qe=qe+1;for(let h=0;h<r[n][s].length-1;h++){o=r[n][s][h+1];let l=new Fe(a,Ge,qe,Ne),d=new Fe(o,Ge,qe,Ne+1);l.otherEvent=d,d.otherEvent=l,No(l,d)>0?(d.isLeftEndpoint=!0,l.isLeftEndpoint=!1):(l.isLeftEndpoint=!0,d.isLeftEndpoint=!1),e.push(l),e.push(d),a=o,Ne=Ne+1}}Ge=Ge+1}var wi=class{constructor(e){this.leftSweepEvent=e,this.rightSweepEvent=e.otherEvent}};function em(t,e){if(t===null||e===null||t.leftSweepEvent.ringId===e.leftSweepEvent.ringId&&(t.rightSweepEvent.isSamePoint(e.leftSweepEvent)||t.rightSweepEvent.isSamePoint(e.leftSweepEvent)||t.rightSweepEvent.isSamePoint(e.rightSweepEvent)||t.leftSweepEvent.isSamePoint(e.leftSweepEvent)||t.leftSweepEvent.isSamePoint(e.rightSweepEvent)))return!1;let i=t.leftSweepEvent.p.x,r=t.leftSweepEvent.p.y,n=t.rightSweepEvent.p.x,s=t.rightSweepEvent.p.y,a=e.leftSweepEvent.p.x,o=e.leftSweepEvent.p.y,h=e.rightSweepEvent.p.x,l=e.rightSweepEvent.p.y,d=(l-o)*(n-i)-(h-a)*(s-r),f=(h-a)*(r-o)-(l-o)*(i-a),k=(n-i)*(r-o)-(s-r)*(i-a);if(d===0)return!1;let w=f/d,S=k/d;if(w>=0&&w<=1&&S>=0&&S<=1){let A=i+w*(n-i),g=r+w*(s-r);return[A,g]}return!1}function im(t,e){e=e||!1;let i=[],r=new ze([],Qg);for(;t.length;){let n=t.pop();if(n.isLeftEndpoint){let s=new wi(n);for(let a=0;a<r.data.length;a++){let o=r.data[a];if(e&&o.leftSweepEvent.featureId===n.featureId)continue;let h=em(s,o);h!==!1&&i.push(h)}r.push(s)}else n.isLeftEndpoint===!1&&r.pop()}return i}function rm(t,e){let i=new ze([],No);return tm(t,i),im(i,e)}var zo=rm;var nm=zo;function Ci(t,e,i={}){let{removeDuplicates:r=!0,ignoreSelfIntersections:n=!0}=i,s=[];t.type==="FeatureCollection"?s=s.concat(t.features):t.type==="Feature"?s.push(t):(t.type==="LineString"||t.type==="Polygon"||t.type==="MultiLineString"||t.type==="MultiPolygon")&&s.push(ct(t)),e.type==="FeatureCollection"?s=s.concat(e.features):e.type==="Feature"?s.push(e):(e.type==="LineString"||e.type==="Polygon"||e.type==="MultiLineString"||e.type==="MultiPolygon")&&s.push(ct(e));let a=nm(rt(s),n),o=[];if(r){let h={};a.forEach(l=>{let d=l.join(",");h[d]||(h[d]=!0,o.push(l))})}else o=a;return rt(o.map(h=>bt(h)))}var Dt=Ci;var Vo=wt(Fo(),1);function Le(t,e,i){if(t!==null)for(var r,n,s,a,o,h,l,d=0,f=0,k,w=t.type,S=w==="FeatureCollection",A=w==="Feature",g=S?t.features.length:1,M=0;M<g;M++){l=S?t.features[M].geometry:A?t.geometry:t,k=l?l.type==="GeometryCollection":!1,o=k?l.geometries.length:1;for(var m=0;m<o;m++){var O=0,R=0;if(a=k?l.geometries[m]:l,a!==null){h=a.coordinates;var I=a.type;switch(d=i&&(I==="Polygon"||I==="MultiPolygon")?1:0,I){case null:break;case"Point":if(e(h,f,M,O,R)===!1)return!1;f++,O++;break;case"LineString":case"MultiPoint":for(r=0;r<h.length;r++){if(e(h[r],f,M,O,R)===!1)return!1;f++,I==="MultiPoint"&&O++}I==="LineString"&&O++;break;case"Polygon":case"MultiLineString":for(r=0;r<h.length;r++){for(n=0;n<h[r].length-d;n++){if(e(h[r][n],f,M,O,R)===!1)return!1;f++}I==="MultiLineString"&&O++,I==="Polygon"&&R++}I==="Polygon"&&O++;break;case"MultiPolygon":for(r=0;r<h.length;r++){for(R=0,n=0;n<h[r].length;n++){for(s=0;s<h[r][n].length-d;s++){if(e(h[r][n][s],f,M,O,R)===!1)return!1;f++}R++}O++}break;case"GeometryCollection":for(r=0;r<a.geometries.length;r++)if(Le(a.geometries[r],e,i)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Qt(t,e){if(t.type==="Feature")e(t,0);else if(t.type==="FeatureCollection")for(var i=0;i<t.features.length&&e(t.features[i],i)!==!1;i++);}function jo(t,e,i){var r=i;return Qt(t,function(n,s){s===0&&i===void 0?r=n:r=e(r,n,s)}),r}function sm(t,e){var i,r,n,s,a,o,h,l,d,f,k=0,w=t.type==="FeatureCollection",S=t.type==="Feature",A=w?t.features.length:1;for(i=0;i<A;i++){for(o=w?t.features[i].geometry:S?t.geometry:t,l=w?t.features[i].properties:S?t.properties:{},d=w?t.features[i].bbox:S?t.bbox:void 0,f=w?t.features[i].id:S?t.id:void 0,h=o?o.type==="GeometryCollection":!1,a=h?o.geometries.length:1,n=0;n<a;n++){if(s=h?o.geometries[n]:o,s===null){if(e(null,k,l,d,f)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(e(s,k,l,d,f)===!1)return!1;break}case"GeometryCollection":{for(r=0;r<s.geometries.length;r++)if(e(s.geometries[r],k,l,d,f)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}k++}}function te(t,e){sm(t,function(i,r,n,s,a){var o=i===null?null:i.type;switch(o){case null:case"Point":case"LineString":case"Polygon":return e(ct(i,n,{bbox:s,id:a}),r,0)===!1?!1:void 0}var h;switch(o){case"MultiPoint":h="Point";break;case"MultiLineString":h="LineString";break;case"MultiPolygon":h="Polygon";break}for(var l=0;l<i.coordinates.length;l++){var d=i.coordinates[l],f={type:h,coordinates:d};if(e(ct(f,n),r,l)===!1)return!1}})}function ut(t,e={}){if(t.bbox!=null&&e.recompute!==!0)return t.bbox;let i=[1/0,1/0,-1/0,-1/0];return Le(t,r=>{i[0]>r[0]&&(i[0]=r[0]),i[1]>r[1]&&(i[1]=r[1]),i[2]<r[0]&&(i[2]=r[0]),i[3]<r[1]&&(i[3]=r[1])}),i}function Si(t){var e;if(t.bbox)e=t.bbox;else if(Array.isArray(t)&&t.length===4)e=t;else if(Array.isArray(t)&&t.length===6)e=[t[0],t[1],t[3],t[4]];else if(t.type==="Feature")e=ut(t);else if(t.type==="FeatureCollection")e=ut(t);else throw new Error("invalid geojson");return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}}var am=class{constructor(t=9){this.tree=new Vo.default(t),this.tree.toBBox=Si}insert(t){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:ut(t),this.tree.insert(t),this}load(t){var e=[];return Array.isArray(t)?t.forEach(function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:ut(i),e.push(i)}):Qt(t,function(i){if(i.type!=="Feature")throw new Error("invalid features");i.bbox=i.bbox?i.bbox:ut(i),e.push(i)}),this.tree.load(e),this}remove(t,e){if(t.type!=="Feature")throw new Error("invalid feature");return t.bbox=t.bbox?t.bbox:ut(t),this.tree.remove(t,e),this}clear(){return this.tree.clear(),this}search(t){var e=this.tree.search(Si(t));return rt(e)}collides(t){return this.tree.collides(Si(t))}all(){let t=this.tree.all();return rt(t)}toJSON(){return this.tree.toJSON()}fromJSON(t){return this.tree.fromJSON(t),this}};function Ti(t){return new am(t)}function Uo(t,e){if(e=e??{},!xi(e))throw new Error("options is invalid");var i=e.precision,r=e.coordinates,n=e.mutate;if(i=i==null||isNaN(i)?6:i,r=r==null||isNaN(r)?3:r,!t)throw new Error("<geojson> is required");if(typeof i!="number")throw new Error("<precision> must be a number");if(typeof r!="number")throw new Error("<coordinates> must be a number");(n===!1||n===void 0)&&(t=JSON.parse(JSON.stringify(t)));var s=Math.pow(10,i);return Le(t,function(a){om(a,s,r)}),t}function om(t,e,i){t.length>i&&t.splice(i,t.length);for(var r=0;r<t.length;r++)t[r]=Math.round(t[r]*e)/e;return t}function st(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return[...t.geometry.coordinates];if(t.type==="Point")return[...t.coordinates]}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return[...t];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function mt(t){if(Array.isArray(t))return t;if(t.type==="Feature"){if(t.geometry!==null)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function ee(t){return t.type==="Feature"?t.geometry:t}function Bi(t,e){return t.type==="FeatureCollection"?"FeatureCollection":t.type==="GeometryCollection"?"GeometryCollection":t.type==="Feature"&&t.geometry!==null?t.geometry.type:t.type}function Ko(t){if(!t)throw new Error("geojson is required");let e=[];return te(t,i=>{lm(i,e)}),rt(e)}function lm(t,e){let i=[],r=t.geometry;if(r!==null){switch(r.type){case"Polygon":i=mt(r);break;case"LineString":i=[mt(r)]}i.forEach(n=>{hm(n,t.properties).forEach(a=>{a.id=e.length,e.push(a)})})}}function hm(t,e){let i=[];return t.reduce((r,n)=>{let s=Tt([r,n],e);return s.bbox=cm(r,n),i.push(s),n}),i}function cm(t,e){let i=t[0],r=t[1],n=e[0],s=e[1],a=i<n?i:n,o=r<s?r:s,h=i>n?i:n,l=r>s?r:s;return[a,o,h,l]}function je(t,e,i={}){var r=st(t),n=st(e),s=Bt(n[1]-r[1]),a=Bt(n[0]-r[0]),o=Bt(r[1]),h=Bt(n[1]),l=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(o)*Math.cos(h);return Go(2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l)),i.units)}var um=Object.defineProperty,pm=Object.defineProperties,fm=Object.getOwnPropertyDescriptors,Ho=Object.getOwnPropertySymbols,dm=Object.prototype.hasOwnProperty,gm=Object.prototype.propertyIsEnumerable,Xo=(t,e,i)=>e in t?um(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,mm=(t,e)=>{for(var i in e||(e={}))dm.call(e,i)&&Xo(t,i,e[i]);if(Ho)for(var i of Ho(e))gm.call(e,i)&&Xo(t,i,e[i]);return t},_m=(t,e)=>pm(t,fm(e));function Jo(t,e,i={}){if(!t||!e)throw new Error("lines and inputPoint are required arguments");let r=st(e),n=bt([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}),s=0,a=0,o=-1;return te(t,function(h,l,d){o!==d&&(o=d,a=0);let f=mt(h);for(let k=0;k<f.length-1;k++){let w=bt(f[k]),S=st(w),A=bt(f[k+1]),g=st(A),M=je(w,A,i),m,O;g[0]===r[0]&&g[1]===r[1]?[m,O]=[g,!0]:S[0]===r[0]&&S[1]===r[1]?[m,O]=[S,!1]:[m,O]=bm(S,g,r);let R=je(e,m,i);if(R<n.properties.pointDistance){let I=je(w,m,i);n=bt(m,{lineStringIndex:d,segmentIndex:O?k+1:k,totalDistance:s+I,lineDistance:a+I,segmentDistance:I,pointDistance:R,multiFeatureIndex:-1,index:-1,location:-1,dist:1/0}),n.properties=_m(mm({},n.properties),{multiFeatureIndex:n.properties.lineStringIndex,index:n.properties.segmentIndex,location:n.properties.totalDistance,dist:n.properties.pointDistance})}s+=M,a+=M}}),n}function Gt(t,e){let[i,r,n]=t,[s,a,o]=e;return i*s+r*a+n*o}function be(t,e){let[i,r,n]=t,[s,a,o]=e;return[r*o-n*a,n*s-i*o,i*a-r*s]}function ym(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2)+Math.pow(t[2],2))}function Yo(t){let e=ym(t);return[t[0]/e,t[1]/e,t[2]/e]}function Di(t){let e=Bt(t[1]),i=Bt(t[0]);return[Math.cos(e)*Math.cos(i),Math.cos(e)*Math.sin(i),Math.sin(e)]}function Lm(t){let[e,i,r]=t,n=Math.min(Math.max(r,-1),1),s=vi(Math.asin(n));return[vi(Math.atan2(i,e)),s]}function bm(t,e,i){let r=Di(t),n=Di(e),s=Di(i),a=be(r,n);if(a[0]===0&&a[1]===0&&a[2]===0)return Gt(r,n)>0?[[...e],!0]:[[...i],!1];let o=be(a,s);if(o[0]===0&&o[1]===0&&o[2]===0)return[[...e],!0];let h=be(o,a),l=Yo(h),d=[-l[0],-l[1],-l[2]],f=Gt(s,l)>Gt(s,d)?l:d,k=Yo(a),w=Gt(be(r,f),k),S=Gt(be(f,n),k);return w>=0&&S>=0?[Lm(f),!1]:Gt(r,s)>Gt(n,s)?[[...t],!1]:[[...e],!0]}function Ii(t,e){if(!t)throw new Error("line is required");if(!e)throw new Error("splitter is required");let i=Bi(t),r=Bi(e);if(i!=="LineString")throw new Error("line must be LineString");if(r==="FeatureCollection")throw new Error("splitter cannot be a FeatureCollection");if(r==="GeometryCollection")throw new Error("splitter cannot be a GeometryCollection");var n=Uo(e,{precision:7});switch(t.type!=="Feature"&&(t=ct(t)),r){case"Point":return Oi(t,n);case"MultiPoint":return $o(t,n);case"LineString":case"MultiLineString":case"Polygon":case"MultiPolygon":return $o(t,Ci(t,n,{ignoreSelfIntersections:!0}))}}function $o(t,e){var i=[],r=Ti();return te(e,function(n){if(i.forEach(function(o,h){o.id=h}),!i.length)i=Oi(t,n).features,r.load(rt(i));else{var s=r.search(n);if(s.features.length){var a=Zo(n,s);i=i.filter(function(o){return o.id!==a.id}),r.remove(a),Qt(Oi(a,n),function(o){i.push(o),r.insert(o)})}}}),rt(i)}function Oi(t,e){var i=[],r=mt(t)[0],n=mt(t)[t.geometry.coordinates.length-1];if(Ri(r,st(e))||Ri(n,st(e)))return rt([t]);var s=Ti(),a=Ko(t);s.load(a);var o=s.search(e);if(!o.features.length)return rt([t]);var h=Zo(e,o),l=[r],d=jo(a,function(f,k,w){var S=mt(k)[1],A=st(e);return w===h.id?(f.push(A),i.push(Tt(f)),Ri(A,S)?[A]:[A,S]):(f.push(S),f)},l);return d.length>1&&i.push(Tt(d)),rt(i)}function Zo(t,e){if(!e.features.length)throw new Error("lines must contain features");if(e.features.length===1)return e.features[0];var i,r=1/0;return Qt(e,function(n){var s=Jo(n,t),a=s.properties.pointDistance;a<r&&(i=n,r=a)}),i}function Ri(t,e){return t[0]===e[0]&&t[1]===e[1]}var Wo=Ii;var V=11102230246251565e-32,Q=134217729,ke=(3+8*V)*V;function qt(t,e,i,r,n){let s,a,o,h,l=e[0],d=r[0],f=0,k=0;d>l==d>-l?(s=l,l=e[++f]):(s=d,d=r[++k]);let w=0;if(f<t&&k<i)for(d>l==d>-l?(a=l+s,o=s-(a-l),l=e[++f]):(a=d+s,o=s-(a-d),d=r[++k]),s=a,o!==0&&(n[w++]=o);f<t&&k<i;)d>l==d>-l?(a=s+l,h=a-s,o=s-(a-h)+(l-h),l=e[++f]):(a=s+d,h=a-s,o=s-(a-h)+(d-h),d=r[++k]),s=a,o!==0&&(n[w++]=o);for(;f<t;)a=s+l,h=a-s,o=s-(a-h)+(l-h),l=e[++f],s=a,o!==0&&(n[w++]=o);for(;k<i;)a=s+d,h=a-s,o=s-(a-h)+(d-h),d=r[++k],s=a,o!==0&&(n[w++]=o);return(s!==0||w===0)&&(n[w++]=s),w}function Me(t,e){let i=e[0];for(let r=1;r<t;r++)i+=e[r];return i}function D(t){return new Float64Array(t)}var km=(3+16*V)*V,Mm=(2+12*V)*V,vm=(9+64*V)*V*V,ie=D(4),Qo=D(8),tl=D(12),el=D(16),at=D(4);function xm(t,e,i,r,n,s,a){let o,h,l,d,f,k,w,S,A,g,M,m,O,R,I,G,q,c,u=t-n,p=i-n,y=e-s,_=r-s;R=u*_,k=Q*u,w=k-(k-u),S=u-w,k=Q*_,A=k-(k-_),g=_-A,I=S*g-(R-w*A-S*A-w*g),G=y*p,k=Q*y,w=k-(k-y),S=y-w,k=Q*p,A=k-(k-p),g=p-A,q=S*g-(G-w*A-S*A-w*g),M=I-q,f=I-M,ie[0]=I-(M+f)+(f-q),m=R+M,f=m-R,O=R-(m-f)+(M-f),M=O-G,f=O-M,ie[1]=O-(M+f)+(f-G),c=m+M,f=c-m,ie[2]=m-(c-f)+(M-f),ie[3]=c;let v=Me(4,ie),E=Mm*a;if(v>=E||-v>=E||(f=t-u,o=t-(u+f)+(f-n),f=i-p,l=i-(p+f)+(f-n),f=e-y,h=e-(y+f)+(f-s),f=r-_,d=r-(_+f)+(f-s),o===0&&h===0&&l===0&&d===0)||(E=vm*a+ke*Math.abs(v),v+=u*d+_*o-(y*l+p*h),v>=E||-v>=E))return v;R=o*_,k=Q*o,w=k-(k-o),S=o-w,k=Q*_,A=k-(k-_),g=_-A,I=S*g-(R-w*A-S*A-w*g),G=h*p,k=Q*h,w=k-(k-h),S=h-w,k=Q*p,A=k-(k-p),g=p-A,q=S*g-(G-w*A-S*A-w*g),M=I-q,f=I-M,at[0]=I-(M+f)+(f-q),m=R+M,f=m-R,O=R-(m-f)+(M-f),M=O-G,f=O-M,at[1]=O-(M+f)+(f-G),c=m+M,f=c-m,at[2]=m-(c-f)+(M-f),at[3]=c;let b=qt(4,ie,4,at,Qo);R=u*d,k=Q*u,w=k-(k-u),S=u-w,k=Q*d,A=k-(k-d),g=d-A,I=S*g-(R-w*A-S*A-w*g),G=y*l,k=Q*y,w=k-(k-y),S=y-w,k=Q*l,A=k-(k-l),g=l-A,q=S*g-(G-w*A-S*A-w*g),M=I-q,f=I-M,at[0]=I-(M+f)+(f-q),m=R+M,f=m-R,O=R-(m-f)+(M-f),M=O-G,f=O-M,at[1]=O-(M+f)+(f-G),c=m+M,f=c-m,at[2]=m-(c-f)+(M-f),at[3]=c;let x=qt(b,Qo,4,at,tl);R=o*d,k=Q*o,w=k-(k-o),S=o-w,k=Q*d,A=k-(k-d),g=d-A,I=S*g-(R-w*A-S*A-w*g),G=h*l,k=Q*h,w=k-(k-h),S=h-w,k=Q*l,A=k-(k-l),g=l-A,q=S*g-(G-w*A-S*A-w*g),M=I-q,f=I-M,at[0]=I-(M+f)+(f-q),m=R+M,f=m-R,O=R-(m-f)+(M-f),M=O-G,f=O-M,at[1]=O-(M+f)+(f-G),c=m+M,f=c-m,at[2]=m-(c-f)+(M-f),at[3]=c;let P=qt(x,tl,4,at,el);return el[P-1]}function Ai(t,e,i,r,n,s){let a=(e-s)*(i-n),o=(t-n)*(r-s),h=a-o,l=Math.abs(a+o);return Math.abs(h)>=km*l?h:-xm(t,e,i,r,n,s,l)}var Kk=(7+56*V)*V,Hk=(3+28*V)*V,Xk=(26+288*V)*V*V,Yk=D(4),Jk=D(4),$k=D(4),Zk=D(4),Wk=D(4),Qk=D(4),tM=D(4),eM=D(4),iM=D(4),rM=D(8),nM=D(8),sM=D(8),aM=D(4),oM=D(8),lM=D(8),hM=D(16),cM=D(12),uM=D(192),pM=D(192);var gM=(10+96*V)*V,mM=(4+48*V)*V,_M=(44+576*V)*V*V,yM=D(4),LM=D(4),bM=D(4),kM=D(4),MM=D(4),vM=D(4),xM=D(4),wM=D(4),CM=D(8),EM=D(8),PM=D(8),SM=D(8),TM=D(8),BM=D(8),DM=D(8),RM=D(8),OM=D(8),IM=D(4),AM=D(4),GM=D(4),qM=D(8),NM=D(16),zM=D(16),FM=D(16),jM=D(32),VM=D(32),UM=D(48),KM=D(64),HM=D(1152),XM=D(1152);var ZM=(16+224*V)*V,WM=(5+72*V)*V,QM=(71+1408*V)*V*V,tv=D(4),ev=D(4),iv=D(4),rv=D(4),nv=D(4),sv=D(4),av=D(4),ov=D(4),lv=D(4),hv=D(4),cv=D(24),uv=D(24),pv=D(24),fv=D(24),dv=D(24),gv=D(24),mv=D(24),_v=D(24),yv=D(24),Lv=D(24),bv=D(1152),kv=D(1152),Mv=D(1152),vv=D(1152),xv=D(1152),wv=D(2304),Cv=D(2304),Ev=D(3456),Pv=D(5760),Sv=D(8),Tv=D(8),Bv=D(8),Dv=D(16),Rv=D(24),Ov=D(48),Iv=D(48),Av=D(96),Gv=D(192),qv=D(384),Nv=D(384),zv=D(384),Fv=D(768);var jv=D(96),Vv=D(96),Uv=D(96),Kv=D(1152);function rl(t,e){var i,r,n=0,s,a,o,h,l,d,f,k=t[0],w=t[1],S=e.length;for(i=0;i<S;i++){r=0;var A=e[i],g=A.length-1;if(d=A[0],d[0]!==A[g][0]&&d[1]!==A[g][1])throw new Error("First and last coordinates in a ring must be the same");for(a=d[0]-k,o=d[1]-w,r;r<g;r++){if(f=A[r+1],h=f[0]-k,l=f[1]-w,o===0&&l===0){if(h<=0&&a>=0||a<=0&&h>=0)return 0}else if(l>=0&&o<=0||l<=0&&o>=0){if(s=Ai(a,h,o,l,0,0),s===0)return 0;(s>0&&l>0&&o<=0||s<0&&l<=0&&o>0)&&n++}d=f,o=l,a=h}}return n%2!==0}function Nt(t,e,i={}){if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");let r=st(t),n=ee(e),s=n.type,a=e.bbox,o=n.coordinates;if(a&&Cm(r,a)===!1)return!1;s==="Polygon"&&(o=[o]);let h=!1;for(var l=0;l<o.length;++l){let d=rl(r,o[l]);if(d===0)return!i.ignoreBoundary;d&&(h=!0)}return h}function Cm(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}function re(t,e,i={}){let r=st(t),n=mt(e);for(let s=0;s<n.length-1;s++){let a=!1;if(i.ignoreEndVertices&&(s===0&&(a="start"),s===n.length-2&&(a="end"),s===0&&s+1===n.length-1&&(a="both")),Em(n[s],n[s+1],r,a,typeof i.epsilon>"u"?null:i.epsilon))return!0}return!1}function Em(t,e,i,r,n){let s=i[0],a=i[1],o=t[0],h=t[1],l=e[0],d=e[1],f=i[0]-o,k=i[1]-h,w=l-o,S=d-h,A=f*S-k*w;if(n!==null){if(Math.abs(A)>n)return!1}else if(A!==0)return!1;if(Math.abs(w)===Math.abs(S)&&Math.abs(w)===0)return r?!1:i[0]===t[0]&&i[1]===t[1];if(r){if(r==="start")return Math.abs(w)>=Math.abs(S)?w>0?o<s&&s<=l:l<=s&&s<o:S>0?h<a&&a<=d:d<=a&&a<h;if(r==="end")return Math.abs(w)>=Math.abs(S)?w>0?o<=s&&s<l:l<s&&s<=o:S>0?h<=a&&a<d:d<a&&a<=h;if(r==="both")return Math.abs(w)>=Math.abs(S)?w>0?o<s&&s<l:l<s&&s<o:S>0?h<a&&a<d:d<a&&a<h}else return Math.abs(w)>=Math.abs(S)?w>0?o<=s&&s<=l:l<=s&&s<=o:S>0?h<=a&&a<=d:d<=a&&a<=h;return!1}function Pm(t,e){let i=ee(t),r=ee(e),n=i.type,s=r.type,a=i.coordinates,o=r.coordinates;switch(n){case"Point":if(s==="Point")return qi(a,o);throw new Error("feature2 "+s+" geometry not supported");case"MultiPoint":switch(s){case"Point":return Bm(i,r);case"MultiPoint":return Dm(i,r);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"Point":return re(r,i,{ignoreEndVertices:!0});case"LineString":return Im(i,r);case"MultiPoint":return Rm(i,r);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Point":return Nt(r,i,{ignoreBoundary:!0});case"LineString":return Gm(i,r);case"Polygon":return Gi(i,r);case"MultiPoint":return Om(i,r);case"MultiPolygon":return Tm(i,r);default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPolygon":if(s==="Polygon")return Sm(i,r);throw new Error("feature2 "+s+" geometry not supported");default:throw new Error("feature1 "+n+" geometry not supported")}}function Sm(t,e){return t.coordinates.some(i=>Gi({type:"Polygon",coordinates:i},e))}function Tm(t,e){return e.coordinates.every(i=>Gi(t,{type:"Polygon",coordinates:i}))}function Bm(t,e){let i,r=!1;for(i=0;i<t.coordinates.length;i++)if(qi(t.coordinates[i],e.coordinates)){r=!0;break}return r}function Dm(t,e){for(let i of e.coordinates){let r=!1;for(let n of t.coordinates)if(qi(i,n)){r=!0;break}if(!r)return!1}return!0}function Rm(t,e){let i=!1;for(let r of e.coordinates)if(re(r,t,{ignoreEndVertices:!0})&&(i=!0),!re(r,t))return!1;return!!i}function Om(t,e){for(let i of e.coordinates)if(!Nt(i,t,{ignoreBoundary:!0}))return!1;return!0}function Im(t,e){let i=!1;for(let r of e.coordinates)if(re({type:"Point",coordinates:r},t,{ignoreEndVertices:!0})&&(i=!0),!re({type:"Point",coordinates:r},t,{ignoreEndVertices:!1}))return!1;return i}function Am(t,e){let i=t.coordinates,r=[];for(let n=0;n<i.length-1;n++){let s=Tt([i[n],i[n+1]]),a=Ii(s,ct(e));a.features.length===0?r.push(s):r.push(...a.features)}return rt(r)}function Gm(t,e){let i=ut(t),r=ut(e);if(!nl(i,r))return!1;for(let a of e.coordinates)if(!Nt(a,t))return!1;let n=!1,s=Am(e,t);for(let a of s.features){let o=qm(a.geometry.coordinates[0],a.geometry.coordinates[1]);if(!Nt(o,t))return!1;!n&&Nt(o,t,{ignoreBoundary:!0})&&(n=!0)}return n}function Gi(t,e){if(t.type==="Feature"&&t.geometry===null||e.type==="Feature"&&e.geometry===null)return!1;let i=ut(t),r=ut(e);if(!nl(i,r))return!1;let n=ee(e).coordinates;for(let s of n)for(let a of s)if(!Nt(a,t))return!1;return!0}function nl(t,e){return!(t[0]>e[0]||t[2]<e[2]||t[1]>e[1]||t[3]<e[3])}function qi(t,e){return t[0]===e[0]&&t[1]===e[1]}function qm(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}var sl=Pm;var El=wt(ge());var Nm=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Ni=Math.ceil,ft=Math.floor,ot="[BigNumber Error] ",al=ot+"Number primitive has more than 15 significant digits: ",_t=1e14,j=14,zi=9007199254740991,Fi=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Rt=1e7,et=1e9;function ol(t){var e,i,r,n=m.prototype={constructor:m,toString:null,valueOf:null},s=new m(1),a=20,o=4,h=-7,l=21,d=-1e7,f=1e7,k=!1,w=1,S=0,A={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},g="0123456789abcdefghijklmnopqrstuvwxyz",M=!0;function m(c,u){var p,y,_,v,E,b,x,P,C=this;if(!(C instanceof m))return new m(c,u);if(u==null){if(c&&c._isBigNumber===!0){C.s=c.s,!c.c||c.e>f?C.c=C.e=null:c.e<d?C.c=[C.e=0]:(C.e=c.e,C.c=c.c.slice());return}if((b=typeof c=="number")&&c*0==0){if(C.s=1/c<0?(c=-c,-1):1,c===~~c){for(v=0,E=c;E>=10;E/=10,v++);v>f?C.c=C.e=null:(C.e=v,C.c=[c]);return}P=String(c)}else{if(!Nm.test(P=String(c)))return r(C,P,b);C.s=P.charCodeAt(0)==45?(P=P.slice(1),-1):1}(v=P.indexOf("."))>-1&&(P=P.replace(".","")),(E=P.search(/e/i))>0?(v<0&&(v=E),v+=+P.slice(E+1),P=P.substring(0,E)):v<0&&(v=P.length)}else{if($(u,2,g.length,"Base"),u==10&&M)return C=new m(c),G(C,a+C.e+1,o);if(P=String(c),b=typeof c=="number"){if(c*0!=0)return r(C,P,b,u);if(C.s=1/c<0?(P=P.slice(1),-1):1,m.DEBUG&&P.replace(/^0\.0*|\./,"").length>15)throw Error(al+c)}else C.s=P.charCodeAt(0)===45?(P=P.slice(1),-1):1;for(p=g.slice(0,u),v=E=0,x=P.length;E<x;E++)if(p.indexOf(y=P.charAt(E))<0){if(y=="."){if(E>v){v=x;continue}}else if(!_&&(P==P.toUpperCase()&&(P=P.toLowerCase())||P==P.toLowerCase()&&(P=P.toUpperCase()))){_=!0,E=-1,v=0;continue}return r(C,String(c),b,u)}b=!1,P=i(P,u,10,C.s),(v=P.indexOf("."))>-1?P=P.replace(".",""):v=P.length}for(E=0;P.charCodeAt(E)===48;E++);for(x=P.length;P.charCodeAt(--x)===48;);if(P=P.slice(E,++x)){if(x-=E,b&&m.DEBUG&&x>15&&(c>zi||c!==ft(c)))throw Error(al+C.s*c);if((v=v-E-1)>f)C.c=C.e=null;else if(v<d)C.c=[C.e=0];else{if(C.e=v,C.c=[],E=(v+1)%j,v<0&&(E+=j),E<x){for(E&&C.c.push(+P.slice(0,E)),x-=j;E<x;)C.c.push(+P.slice(E,E+=j));E=j-(P=P.slice(E)).length}else E-=x;for(;E--;P+="0");C.c.push(+P)}}else C.c=[C.e=0]}m.clone=ol,m.ROUND_UP=0,m.ROUND_DOWN=1,m.ROUND_CEIL=2,m.ROUND_FLOOR=3,m.ROUND_HALF_UP=4,m.ROUND_HALF_DOWN=5,m.ROUND_HALF_EVEN=6,m.ROUND_HALF_CEIL=7,m.ROUND_HALF_FLOOR=8,m.EUCLID=9,m.config=m.set=function(c){var u,p;if(c!=null)if(typeof c=="object"){if(c.hasOwnProperty(u="DECIMAL_PLACES")&&(p=c[u],$(p,0,et,u),a=p),c.hasOwnProperty(u="ROUNDING_MODE")&&(p=c[u],$(p,0,8,u),o=p),c.hasOwnProperty(u="EXPONENTIAL_AT")&&(p=c[u],p&&p.pop?($(p[0],-et,0,u),$(p[1],0,et,u),h=p[0],l=p[1]):($(p,-et,et,u),h=-(l=p<0?-p:p))),c.hasOwnProperty(u="RANGE"))if(p=c[u],p&&p.pop)$(p[0],-et,-1,u),$(p[1],1,et,u),d=p[0],f=p[1];else if($(p,-et,et,u),p)d=-(f=p<0?-p:p);else throw Error(ot+u+" cannot be zero: "+p);if(c.hasOwnProperty(u="CRYPTO"))if(p=c[u],p===!!p)if(p)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))k=p;else throw k=!p,Error(ot+"crypto unavailable");else k=p;else throw Error(ot+u+" not true or false: "+p);if(c.hasOwnProperty(u="MODULO_MODE")&&(p=c[u],$(p,0,9,u),w=p),c.hasOwnProperty(u="POW_PRECISION")&&(p=c[u],$(p,0,et,u),S=p),c.hasOwnProperty(u="FORMAT"))if(p=c[u],typeof p=="object")A=p;else throw Error(ot+u+" not an object: "+p);if(c.hasOwnProperty(u="ALPHABET"))if(p=c[u],typeof p=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(p))M=p.slice(0,10)=="0123456789",g=p;else throw Error(ot+u+" invalid: "+p)}else throw Error(ot+"Object expected: "+c);return{DECIMAL_PLACES:a,ROUNDING_MODE:o,EXPONENTIAL_AT:[h,l],RANGE:[d,f],CRYPTO:k,MODULO_MODE:w,POW_PRECISION:S,FORMAT:A,ALPHABET:g}},m.isBigNumber=function(c){if(!c||c._isBigNumber!==!0)return!1;if(!m.DEBUG)return!0;var u,p,y=c.c,_=c.e,v=c.s;t:if({}.toString.call(y)=="[object Array]"){if((v===1||v===-1)&&_>=-et&&_<=et&&_===ft(_)){if(y[0]===0){if(_===0&&y.length===1)return!0;break t}if(u=(_+1)%j,u<1&&(u+=j),String(y[0]).length==u){for(u=0;u<y.length;u++)if(p=y[u],p<0||p>=_t||p!==ft(p))break t;if(p!==0)return!0}}}else if(y===null&&_===null&&(v===null||v===1||v===-1))return!0;throw Error(ot+"Invalid BigNumber: "+c)},m.maximum=m.max=function(){return R(arguments,-1)},m.minimum=m.min=function(){return R(arguments,1)},m.random=(function(){var c=9007199254740992,u=Math.random()*c&2097151?function(){return ft(Math.random()*c)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(p){var y,_,v,E,b,x=0,P=[],C=new m(s);if(p==null?p=a:$(p,0,et),E=Ni(p/j),k)if(crypto.getRandomValues){for(y=crypto.getRandomValues(new Uint32Array(E*=2));x<E;)b=y[x]*131072+(y[x+1]>>>11),b>=9e15?(_=crypto.getRandomValues(new Uint32Array(2)),y[x]=_[0],y[x+1]=_[1]):(P.push(b%1e14),x+=2);x=E/2}else if(crypto.randomBytes){for(y=crypto.randomBytes(E*=7);x<E;)b=(y[x]&31)*281474976710656+y[x+1]*1099511627776+y[x+2]*4294967296+y[x+3]*16777216+(y[x+4]<<16)+(y[x+5]<<8)+y[x+6],b>=9e15?crypto.randomBytes(7).copy(y,x):(P.push(b%1e14),x+=7);x=E/7}else throw k=!1,Error(ot+"crypto unavailable");if(!k)for(;x<E;)b=u(),b<9e15&&(P[x++]=b%1e14);for(E=P[--x],p%=j,E&&p&&(b=Fi[j-p],P[x]=ft(E/b)*b);P[x]===0;P.pop(),x--);if(x<0)P=[v=0];else{for(v=-1;P[0]===0;P.splice(0,1),v-=j);for(x=1,b=P[0];b>=10;b/=10,x++);x<j&&(v-=j-x)}return C.e=v,C.c=P,C}})(),m.sum=function(){for(var c=1,u=arguments,p=new m(u[0]);c<u.length;)p=p.plus(u[c++]);return p},i=(function(){var c="0123456789";function u(p,y,_,v){for(var E,b=[0],x,P=0,C=p.length;P<C;){for(x=b.length;x--;b[x]*=y);for(b[0]+=v.indexOf(p.charAt(P++)),E=0;E<b.length;E++)b[E]>_-1&&(b[E+1]==null&&(b[E+1]=0),b[E+1]+=b[E]/_|0,b[E]%=_)}return b.reverse()}return function(p,y,_,v,E){var b,x,P,C,T,N,z,K,Z=p.indexOf("."),tt=a,U=o;for(Z>=0&&(C=S,S=0,p=p.replace(".",""),K=new m(y),N=K.pow(p.length-Z),S=C,K.c=u(Mt(pt(N.c),N.e,"0"),10,_,c),K.e=K.c.length),z=u(p,y,_,E?(b=g,c):(b=c,g)),P=C=z.length;z[--C]==0;z.pop());if(!z[0])return b.charAt(0);if(Z<0?--P:(N.c=z,N.e=P,N.s=v,N=e(N,K,tt,U,_),z=N.c,T=N.r,P=N.e),x=P+tt+1,Z=z[x],C=_/2,T=T||x<0||z[x+1]!=null,T=U<4?(Z!=null||T)&&(U==0||U==(N.s<0?3:2)):Z>C||Z==C&&(U==4||T||U==6&&z[x-1]&1||U==(N.s<0?8:7)),x<1||!z[0])p=T?Mt(b.charAt(1),-tt,b.charAt(0)):b.charAt(0);else{if(z.length=x,T)for(--_;++z[--x]>_;)z[x]=0,x||(++P,z=[1].concat(z));for(C=z.length;!z[--C];);for(Z=0,p="";Z<=C;p+=b.charAt(z[Z++]));p=Mt(p,P,b.charAt(0))}return p}})(),e=(function(){function c(y,_,v){var E,b,x,P,C=0,T=y.length,N=_%Rt,z=_/Rt|0;for(y=y.slice();T--;)x=y[T]%Rt,P=y[T]/Rt|0,E=z*x+P*N,b=N*x+E%Rt*Rt+C,C=(b/v|0)+(E/Rt|0)+z*P,y[T]=b%v;return C&&(y=[C].concat(y)),y}function u(y,_,v,E){var b,x;if(v!=E)x=v>E?1:-1;else for(b=x=0;b<v;b++)if(y[b]!=_[b]){x=y[b]>_[b]?1:-1;break}return x}function p(y,_,v,E){for(var b=0;v--;)y[v]-=b,b=y[v]<_[v]?1:0,y[v]=b*E+y[v]-_[v];for(;!y[0]&&y.length>1;y.splice(0,1));}return function(y,_,v,E,b){var x,P,C,T,N,z,K,Z,tt,U,H,it,Pe,We,Qe,yt,ne,ht=y.s==_.s?1:-1,nt=y.c,W=_.c;if(!nt||!nt[0]||!W||!W[0])return new m(!y.s||!_.s||(nt?W&&nt[0]==W[0]:!W)?NaN:nt&&nt[0]==0||!W?ht*0:ht/0);for(Z=new m(ht),tt=Z.c=[],P=y.e-_.e,ht=v+P+1,b||(b=_t,P=dt(y.e/j)-dt(_.e/j),ht=ht/j|0),C=0;W[C]==(nt[C]||0);C++);if(W[C]>(nt[C]||0)&&P--,ht<0)tt.push(1),T=!0;else{for(We=nt.length,yt=W.length,C=0,ht+=2,N=ft(b/(W[0]+1)),N>1&&(W=c(W,N,b),nt=c(nt,N,b),yt=W.length,We=nt.length),Pe=yt,U=nt.slice(0,yt),H=U.length;H<yt;U[H++]=0);ne=W.slice(),ne=[0].concat(ne),Qe=W[0],W[1]>=b/2&&Qe++;do{if(N=0,x=u(W,U,yt,H),x<0){if(it=U[0],yt!=H&&(it=it*b+(U[1]||0)),N=ft(it/Qe),N>1)for(N>=b&&(N=b-1),z=c(W,N,b),K=z.length,H=U.length;u(z,U,K,H)==1;)N--,p(z,yt<K?ne:W,K,b),K=z.length,x=1;else N==0&&(x=N=1),z=W.slice(),K=z.length;if(K<H&&(z=[0].concat(z)),p(U,z,H,b),H=U.length,x==-1)for(;u(W,U,yt,H)<1;)N++,p(U,yt<H?ne:W,H,b),H=U.length}else x===0&&(N++,U=[0]);tt[C++]=N,U[0]?U[H++]=nt[Pe]||0:(U=[nt[Pe]],H=1)}while((Pe++<We||U[0]!=null)&&ht--);T=U[0]!=null,tt[0]||tt.splice(0,1)}if(b==_t){for(C=1,ht=tt[0];ht>=10;ht/=10,C++);G(Z,v+(Z.e=C+P*j-1)+1,E,T)}else Z.e=P,Z.r=+T;return Z}})();function O(c,u,p,y){var _,v,E,b,x;if(p==null?p=o:$(p,0,8),!c.c)return c.toString();if(_=c.c[0],E=c.e,u==null)x=pt(c.c),x=y==1||y==2&&(E<=h||E>=l)?Ue(x,E):Mt(x,E,"0");else if(c=G(new m(c),u,p),v=c.e,x=pt(c.c),b=x.length,y==1||y==2&&(u<=v||v<=h)){for(;b<u;x+="0",b++);x=Ue(x,v)}else if(u-=E+(y===2&&v>E),x=Mt(x,v,"0"),v+1>b){if(--u>0)for(x+=".";u--;x+="0");}else if(u+=v-b,u>0)for(v+1==b&&(x+=".");u--;x+="0");return c.s<0&&_?"-"+x:x}function R(c,u){for(var p,y,_=1,v=new m(c[0]);_<c.length;_++)y=new m(c[_]),(!y.s||(p=zt(v,y))===u||p===0&&v.s===u)&&(v=y);return v}function I(c,u,p){for(var y=1,_=u.length;!u[--_];u.pop());for(_=u[0];_>=10;_/=10,y++);return(p=y+p*j-1)>f?c.c=c.e=null:p<d?c.c=[c.e=0]:(c.e=p,c.c=u),c}r=(function(){var c=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,p=/^\.([^.]+)$/,y=/^-?(Infinity|NaN)$/,_=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(v,E,b,x){var P,C=b?E:E.replace(_,"");if(y.test(C))v.s=isNaN(C)?null:C<0?-1:1;else{if(!b&&(C=C.replace(c,function(T,N,z){return P=(z=z.toLowerCase())=="x"?16:z=="b"?2:8,!x||x==P?N:T}),x&&(P=x,C=C.replace(u,"$1").replace(p,"0.$1")),E!=C))return new m(C,P);if(m.DEBUG)throw Error(ot+"Not a"+(x?" base "+x:"")+" number: "+E);v.s=null}v.c=v.e=null}})();function G(c,u,p,y){var _,v,E,b,x,P,C,T=c.c,N=Fi;if(T){t:{for(_=1,b=T[0];b>=10;b/=10,_++);if(v=u-_,v<0)v+=j,E=u,x=T[P=0],C=ft(x/N[_-E-1]%10);else if(P=Ni((v+1)/j),P>=T.length)if(y){for(;T.length<=P;T.push(0));x=C=0,_=1,v%=j,E=v-j+1}else break t;else{for(x=b=T[P],_=1;b>=10;b/=10,_++);v%=j,E=v-j+_,C=E<0?0:ft(x/N[_-E-1]%10)}if(y=y||u<0||T[P+1]!=null||(E<0?x:x%N[_-E-1]),y=p<4?(C||y)&&(p==0||p==(c.s<0?3:2)):C>5||C==5&&(p==4||y||p==6&&(v>0?E>0?x/N[_-E]:0:T[P-1])%10&1||p==(c.s<0?8:7)),u<1||!T[0])return T.length=0,y?(u-=c.e+1,T[0]=N[(j-u%j)%j],c.e=-u||0):T[0]=c.e=0,c;if(v==0?(T.length=P,b=1,P--):(T.length=P+1,b=N[j-v],T[P]=E>0?ft(x/N[_-E]%N[E])*b:0),y)for(;;)if(P==0){for(v=1,E=T[0];E>=10;E/=10,v++);for(E=T[0]+=b,b=1;E>=10;E/=10,b++);v!=b&&(c.e++,T[0]==_t&&(T[0]=1));break}else{if(T[P]+=b,T[P]!=_t)break;T[P--]=0,b=1}for(v=T.length;T[--v]===0;T.pop());}c.e>f?c.c=c.e=null:c.e<d&&(c.c=[c.e=0])}return c}function q(c){var u,p=c.e;return p===null?c.toString():(u=pt(c.c),u=p<=h||p>=l?Ue(u,p):Mt(u,p,"0"),c.s<0?"-"+u:u)}return n.absoluteValue=n.abs=function(){var c=new m(this);return c.s<0&&(c.s=1),c},n.comparedTo=function(c,u){return zt(this,new m(c,u))},n.decimalPlaces=n.dp=function(c,u){var p,y,_,v=this;if(c!=null)return $(c,0,et),u==null?u=o:$(u,0,8),G(new m(v),c+v.e+1,u);if(!(p=v.c))return null;if(y=((_=p.length-1)-dt(this.e/j))*j,_=p[_])for(;_%10==0;_/=10,y--);return y<0&&(y=0),y},n.dividedBy=n.div=function(c,u){return e(this,new m(c,u),a,o)},n.dividedToIntegerBy=n.idiv=function(c,u){return e(this,new m(c,u),0,1)},n.exponentiatedBy=n.pow=function(c,u){var p,y,_,v,E,b,x,P,C,T=this;if(c=new m(c),c.c&&!c.isInteger())throw Error(ot+"Exponent not an integer: "+q(c));if(u!=null&&(u=new m(u)),b=c.e>14,!T.c||!T.c[0]||T.c[0]==1&&!T.e&&T.c.length==1||!c.c||!c.c[0])return C=new m(Math.pow(+q(T),b?c.s*(2-Ve(c)):+q(c))),u?C.mod(u):C;if(x=c.s<0,u){if(u.c?!u.c[0]:!u.s)return new m(NaN);y=!x&&T.isInteger()&&u.isInteger(),y&&(T=T.mod(u))}else{if(c.e>9&&(T.e>0||T.e<-1||(T.e==0?T.c[0]>1||b&&T.c[1]>=24e7:T.c[0]<8e13||b&&T.c[0]<=9999975e7)))return v=T.s<0&&Ve(c)?-0:0,T.e>-1&&(v=1/v),new m(x?1/v:v);S&&(v=Ni(S/j+2))}for(b?(p=new m(.5),x&&(c.s=1),P=Ve(c)):(_=Math.abs(+q(c)),P=_%2),C=new m(s);;){if(P){if(C=C.times(T),!C.c)break;v?C.c.length>v&&(C.c.length=v):y&&(C=C.mod(u))}if(_){if(_=ft(_/2),_===0)break;P=_%2}else if(c=c.times(p),G(c,c.e+1,1),c.e>14)P=Ve(c);else{if(_=+q(c),_===0)break;P=_%2}T=T.times(T),v?T.c&&T.c.length>v&&(T.c.length=v):y&&(T=T.mod(u))}return y?C:(x&&(C=s.div(C)),u?C.mod(u):v?G(C,S,o,E):C)},n.integerValue=function(c){var u=new m(this);return c==null?c=o:$(c,0,8),G(u,u.e+1,c)},n.isEqualTo=n.eq=function(c,u){return zt(this,new m(c,u))===0},n.isFinite=function(){return!!this.c},n.isGreaterThan=n.gt=function(c,u){return zt(this,new m(c,u))>0},n.isGreaterThanOrEqualTo=n.gte=function(c,u){return(u=zt(this,new m(c,u)))===1||u===0},n.isInteger=function(){return!!this.c&&dt(this.e/j)>this.c.length-2},n.isLessThan=n.lt=function(c,u){return zt(this,new m(c,u))<0},n.isLessThanOrEqualTo=n.lte=function(c,u){return(u=zt(this,new m(c,u)))===-1||u===0},n.isNaN=function(){return!this.s},n.isNegative=function(){return this.s<0},n.isPositive=function(){return this.s>0},n.isZero=function(){return!!this.c&&this.c[0]==0},n.minus=function(c,u){var p,y,_,v,E=this,b=E.s;if(c=new m(c,u),u=c.s,!b||!u)return new m(NaN);if(b!=u)return c.s=-u,E.plus(c);var x=E.e/j,P=c.e/j,C=E.c,T=c.c;if(!x||!P){if(!C||!T)return C?(c.s=-u,c):new m(T?E:NaN);if(!C[0]||!T[0])return T[0]?(c.s=-u,c):new m(C[0]?E:o==3?-0:0)}if(x=dt(x),P=dt(P),C=C.slice(),b=x-P){for((v=b<0)?(b=-b,_=C):(P=x,_=T),_.reverse(),u=b;u--;_.push(0));_.reverse()}else for(y=(v=(b=C.length)<(u=T.length))?b:u,b=u=0;u<y;u++)if(C[u]!=T[u]){v=C[u]<T[u];break}if(v&&(_=C,C=T,T=_,c.s=-c.s),u=(y=T.length)-(p=C.length),u>0)for(;u--;C[p++]=0);for(u=_t-1;y>b;){if(C[--y]<T[y]){for(p=y;p&&!C[--p];C[p]=u);--C[p],C[y]+=_t}C[y]-=T[y]}for(;C[0]==0;C.splice(0,1),--P);return C[0]?I(c,C,P):(c.s=o==3?-1:1,c.c=[c.e=0],c)},n.modulo=n.mod=function(c,u){var p,y,_=this;return c=new m(c,u),!_.c||!c.s||c.c&&!c.c[0]?new m(NaN):!c.c||_.c&&!_.c[0]?new m(_):(w==9?(y=c.s,c.s=1,p=e(_,c,0,3),c.s=y,p.s*=y):p=e(_,c,0,w),c=_.minus(p.times(c)),!c.c[0]&&w==1&&(c.s=_.s),c)},n.multipliedBy=n.times=function(c,u){var p,y,_,v,E,b,x,P,C,T,N,z,K,Z,tt,U=this,H=U.c,it=(c=new m(c,u)).c;if(!H||!it||!H[0]||!it[0])return!U.s||!c.s||H&&!H[0]&&!it||it&&!it[0]&&!H?c.c=c.e=c.s=null:(c.s*=U.s,!H||!it?c.c=c.e=null:(c.c=[0],c.e=0)),c;for(y=dt(U.e/j)+dt(c.e/j),c.s*=U.s,x=H.length,T=it.length,x<T&&(K=H,H=it,it=K,_=x,x=T,T=_),_=x+T,K=[];_--;K.push(0));for(Z=_t,tt=Rt,_=T;--_>=0;){for(p=0,N=it[_]%tt,z=it[_]/tt|0,E=x,v=_+E;v>_;)P=H[--E]%tt,C=H[E]/tt|0,b=z*P+C*N,P=N*P+b%tt*tt+K[v]+p,p=(P/Z|0)+(b/tt|0)+z*C,K[v--]=P%Z;K[v]=p}return p?++y:K.splice(0,1),I(c,K,y)},n.negated=function(){var c=new m(this);return c.s=-c.s||null,c},n.plus=function(c,u){var p,y=this,_=y.s;if(c=new m(c,u),u=c.s,!_||!u)return new m(NaN);if(_!=u)return c.s=-u,y.minus(c);var v=y.e/j,E=c.e/j,b=y.c,x=c.c;if(!v||!E){if(!b||!x)return new m(_/0);if(!b[0]||!x[0])return x[0]?c:new m(b[0]?y:_*0)}if(v=dt(v),E=dt(E),b=b.slice(),_=v-E){for(_>0?(E=v,p=x):(_=-_,p=b),p.reverse();_--;p.push(0));p.reverse()}for(_=b.length,u=x.length,_-u<0&&(p=x,x=b,b=p,u=_),_=0;u;)_=(b[--u]=b[u]+x[u]+_)/_t|0,b[u]=_t===b[u]?0:b[u]%_t;return _&&(b=[_].concat(b),++E),I(c,b,E)},n.precision=n.sd=function(c,u){var p,y,_,v=this;if(c!=null&&c!==!!c)return $(c,1,et),u==null?u=o:$(u,0,8),G(new m(v),c,u);if(!(p=v.c))return null;if(_=p.length-1,y=_*j+1,_=p[_]){for(;_%10==0;_/=10,y--);for(_=p[0];_>=10;_/=10,y++);}return c&&v.e+1>y&&(y=v.e+1),y},n.shiftedBy=function(c){return $(c,-zi,zi),this.times("1e"+c)},n.squareRoot=n.sqrt=function(){var c,u,p,y,_,v=this,E=v.c,b=v.s,x=v.e,P=a+4,C=new m("0.5");if(b!==1||!E||!E[0])return new m(!b||b<0&&(!E||E[0])?NaN:E?v:1/0);if(b=Math.sqrt(+q(v)),b==0||b==1/0?(u=pt(E),(u.length+x)%2==0&&(u+="0"),b=Math.sqrt(+u),x=dt((x+1)/2)-(x<0||x%2),b==1/0?u="5e"+x:(u=b.toExponential(),u=u.slice(0,u.indexOf("e")+1)+x),p=new m(u)):p=new m(b+""),p.c[0]){for(x=p.e,b=x+P,b<3&&(b=0);;)if(_=p,p=C.times(_.plus(e(v,_,P,1))),pt(_.c).slice(0,b)===(u=pt(p.c)).slice(0,b))if(p.e<x&&--b,u=u.slice(b-3,b+1),u=="9999"||!y&&u=="4999"){if(!y&&(G(_,_.e+a+2,0),_.times(_).eq(v))){p=_;break}P+=4,b+=4,y=1}else{(!+u||!+u.slice(1)&&u.charAt(0)=="5")&&(G(p,p.e+a+2,1),c=!p.times(p).eq(v));break}}return G(p,p.e+a+1,o,c)},n.toExponential=function(c,u){return c!=null&&($(c,0,et),c++),O(this,c,u,1)},n.toFixed=function(c,u){return c!=null&&($(c,0,et),c=c+this.e+1),O(this,c,u)},n.toFormat=function(c,u,p){var y,_=this;if(p==null)c!=null&&u&&typeof u=="object"?(p=u,u=null):c&&typeof c=="object"?(p=c,c=u=null):p=A;else if(typeof p!="object")throw Error(ot+"Argument not an object: "+p);if(y=_.toFixed(c,u),_.c){var v,E=y.split("."),b=+p.groupSize,x=+p.secondaryGroupSize,P=p.groupSeparator||"",C=E[0],T=E[1],N=_.s<0,z=N?C.slice(1):C,K=z.length;if(x&&(v=b,b=x,x=v,K-=v),b>0&&K>0){for(v=K%b||b,C=z.substr(0,v);v<K;v+=b)C+=P+z.substr(v,b);x>0&&(C+=P+z.slice(v)),N&&(C="-"+C)}y=T?C+(p.decimalSeparator||"")+((x=+p.fractionGroupSize)?T.replace(new RegExp("\\d{"+x+"}\\B","g"),"$&"+(p.fractionGroupSeparator||"")):T):C}return(p.prefix||"")+y+(p.suffix||"")},n.toFraction=function(c){var u,p,y,_,v,E,b,x,P,C,T,N,z=this,K=z.c;if(c!=null&&(b=new m(c),!b.isInteger()&&(b.c||b.s!==1)||b.lt(s)))throw Error(ot+"Argument "+(b.isInteger()?"out of range: ":"not an integer: ")+q(b));if(!K)return new m(z);for(u=new m(s),P=p=new m(s),y=x=new m(s),N=pt(K),v=u.e=N.length-z.e-1,u.c[0]=Fi[(E=v%j)<0?j+E:E],c=!c||b.comparedTo(u)>0?v>0?u:P:b,E=f,f=1/0,b=new m(N),x.c[0]=0;C=e(b,u,0,1),_=p.plus(C.times(y)),_.comparedTo(c)!=1;)p=y,y=_,P=x.plus(C.times(_=P)),x=_,u=b.minus(C.times(_=u)),b=_;return _=e(c.minus(p),y,0,1),x=x.plus(_.times(P)),p=p.plus(_.times(y)),x.s=P.s=z.s,v=v*2,T=e(P,y,v,o).minus(z).abs().comparedTo(e(x,p,v,o).minus(z).abs())<1?[P,y]:[x,p],f=E,T},n.toNumber=function(){return+q(this)},n.toPrecision=function(c,u){return c!=null&&$(c,1,et),O(this,c,u,2)},n.toString=function(c){var u,p=this,y=p.s,_=p.e;return _===null?y?(u="Infinity",y<0&&(u="-"+u)):u="NaN":(c==null?u=_<=h||_>=l?Ue(pt(p.c),_):Mt(pt(p.c),_,"0"):c===10&&M?(p=G(new m(p),a+_+1,o),u=Mt(pt(p.c),p.e,"0")):($(c,2,g.length,"Base"),u=i(Mt(pt(p.c),_,"0"),10,c,y,!0)),y<0&&p.c[0]&&(u="-"+u)),u},n.valueOf=n.toJSON=function(){return q(this)},n._isBigNumber=!0,n[Symbol.toStringTag]="BigNumber",n[Symbol.for("nodejs.util.inspect.custom")]=n.valueOf,t!=null&&m.set(t),m}function dt(t){var e=t|0;return t>0||t===e?e:e-1}function pt(t){for(var e,i,r=1,n=t.length,s=t[0]+"";r<n;){for(e=t[r++]+"",i=j-e.length;i--;e="0"+e);s+=e}for(n=s.length;s.charCodeAt(--n)===48;);return s.slice(0,n+1||1)}function zt(t,e){var i,r,n=t.c,s=e.c,a=t.s,o=e.s,h=t.e,l=e.e;if(!a||!o)return null;if(i=n&&!n[0],r=s&&!s[0],i||r)return i?r?0:-o:a;if(a!=o)return a;if(i=a<0,r=h==l,!n||!s)return r?0:!n^i?1:-1;if(!r)return h>l^i?1:-1;for(o=(h=n.length)<(l=s.length)?h:l,a=0;a<o;a++)if(n[a]!=s[a])return n[a]>s[a]^i?1:-1;return h==l?0:h>l^i?1:-1}function $(t,e,i,r){if(t<e||t>i||t!==ft(t))throw Error(ot+(r||"Argument")+(typeof t=="number"?t<e||t>i?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function Ve(t){var e=t.c.length-1;return dt(t.e/j)==e&&t.c[e]%2!=0}function Ue(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function Mt(t,e,i){var r,n;if(e<0){for(n=i+".";++e;n+=i);t=n+t}else if(r=t.length,++e>r){for(n=i,e-=r;--e;n+=i);t+=n}else e<r&&(t=t.slice(0,e)+"."+t.slice(e));return t}var zm=ol(),gt=zm;var Fm=class{key;left=null;right=null;constructor(t){this.key=t}},ve=class extends Fm{constructor(t){super(t)}};var jm=class{size=0;modificationCount=0;splayCount=0;splay(t){let e=this.root;if(e==null)return this.compare(t,t),-1;let i=null,r=null,n=null,s=null,a=e,o=this.compare,h;for(;;)if(h=o(a.key,t),h>0){let l=a.left;if(l==null||(h=o(l.key,t),h>0&&(a.left=l.right,l.right=a,a=l,l=a.left,l==null)))break;i==null?r=a:i.left=a,i=a,a=l}else if(h<0){let l=a.right;if(l==null||(h=o(l.key,t),h<0&&(a.right=l.left,l.left=a,a=l,l=a.right,l==null)))break;n==null?s=a:n.right=a,n=a,a=l}else break;return n!=null&&(n.right=a.left,a.left=s),i!=null&&(i.left=a.right,a.right=r),this.root!==a&&(this.root=a,this.splayCount++),h}splayMin(t){let e=t,i=e.left;for(;i!=null;){let r=i;e.left=r.right,r.right=e,e=r,i=e.left}return e}splayMax(t){let e=t,i=e.right;for(;i!=null;){let r=i;e.right=r.left,r.left=e,e=r,i=e.right}return e}_delete(t){if(this.root==null||this.splay(t)!=0)return null;let i=this.root,r=i,n=i.left;if(this.size--,n==null)this.root=i.right;else{let s=i.right;i=this.splayMax(n),i.right=s,this.root=i}return this.modificationCount++,r}addNewRoot(t,e){this.size++,this.modificationCount++;let i=this.root;if(i==null){this.root=t;return}e<0?(t.left=i,t.right=i.right,i.right=null):(t.right=i,t.left=i.left,i.left=null),this.root=t}_first(){let t=this.root;return t==null?null:(this.root=this.splayMin(t),this.root)}_last(){let t=this.root;return t==null?null:(this.root=this.splayMax(t),this.root)}clear(){this.root=null,this.size=0,this.modificationCount++}has(t){return this.validKey(t)&&this.splay(t)==0}defaultCompare(){return(t,e)=>t<e?-1:t>e?1:0}wrap(){return{getRoot:()=>this.root,setRoot:t=>{this.root=t},getSize:()=>this.size,getModificationCount:()=>this.modificationCount,getSplayCount:()=>this.splayCount,setSplayCount:t=>{this.splayCount=t},splay:t=>this.splay(t),has:t=>this.has(t)}}};var Ft=class xe extends jm{root=null;compare;validKey;constructor(e,i){super(),this.compare=e??this.defaultCompare(),this.validKey=i??(r=>r!=null&&r!=null)}delete(e){return this.validKey(e)?this._delete(e)!=null:!1}deleteAll(e){for(let i of e)this.delete(i)}forEach(e){let i=this[Symbol.iterator](),r;for(;r=i.next(),!r.done;)e(r.value,r.value,this)}add(e){let i=this.splay(e);return i!=0&&this.addNewRoot(new ve(e),i),this}addAndReturn(e){let i=this.splay(e);return i!=0&&this.addNewRoot(new ve(e),i),this.root.key}addAll(e){for(let i of e)this.add(i)}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(e){if(e==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(e)<0)return this.root.key;let r=this.root.left;if(r==null)return null;let n=r.right;for(;n!=null;)r=n,n=r.right;return r.key}firstAfter(e){if(e==null)throw"Invalid arguments(s)";if(this.root==null)return null;if(this.splay(e)>0)return this.root.key;let r=this.root.right;if(r==null)return null;let n=r.left;for(;n!=null;)r=n,n=r.left;return r.key}retainAll(e){let i=new xe(this.compare,this.validKey),r=this.modificationCount;for(let n of e){if(r!=this.modificationCount)throw"Concurrent modification during iteration.";this.validKey(n)&&this.splay(n)==0&&i.add(this.root.key)}i.size!=this.size&&(this.root=i.root,this.size=i.size,this.modificationCount++)}lookup(e){return!this.validKey(e)||this.splay(e)!=0?null:this.root.key}intersection(e){let i=new xe(this.compare,this.validKey);for(let r of this)e.has(r)&&i.add(r);return i}difference(e){let i=new xe(this.compare,this.validKey);for(let r of this)e.has(r)||i.add(r);return i}union(e){let i=this.clone();return i.addAll(e),i}clone(){let e=new xe(this.compare,this.validKey);return e.size=this.size,e.root=this.copyNode(this.root),e}copyNode(e){if(e==null)return null;function i(n,s){let a,o;do{if(a=n.left,o=n.right,a!=null){let h=new ve(a.key);s.left=h,i(a,h)}if(o!=null){let h=new ve(o.key);s.right=h,n=o,s=h}}while(o!=null)}let r=new ve(e.key);return i(e,r),r}toSet(){return this.clone()}entries(){return new Um(this.wrap())}keys(){return this[Symbol.iterator]()}values(){return this[Symbol.iterator]()}[Symbol.iterator](){return new Vm(this.wrap())}[Symbol.toStringTag]="[object Set]"},ll=class{tree;path=new Array;modificationCount=null;splayCount;constructor(t){this.tree=t,this.splayCount=t.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 t=this.path[this.path.length-1];return this.getValue(t)}rebuildPath(t){this.path.splice(0,this.path.length),this.tree.splay(t),this.path.push(this.tree.getRoot()),this.splayCount=this.tree.getSplayCount()}findLeftMostDescendent(t){for(;t!=null;)this.path.push(t),t=t.left}moveNext(){if(this.modificationCount!=this.tree.getModificationCount()){if(this.modificationCount==null){this.modificationCount=this.tree.getModificationCount();let i=this.tree.getRoot();for(;i!=null;)this.path.push(i),i=i.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 t=this.path[this.path.length-1],e=t.right;if(e!=null){for(;e!=null;)this.path.push(e),e=e.left;return!0}for(this.path.pop();this.path.length&&this.path[this.path.length-1].right===t;)t=this.path.pop();return this.path.length>0}},Vm=class extends ll{getValue(t){return t.key}},Um=class extends ll{getValue(t){return[t.key,t.key]}};var dl=t=>()=>t,ji=t=>{let e=t?(i,r)=>r.minus(i).abs().isLessThanOrEqualTo(t):dl(!1);return(i,r)=>e(i,r)?0:i.comparedTo(r)};function Km(t){let e=t?(i,r,n,s,a)=>i.exponentiatedBy(2).isLessThanOrEqualTo(s.minus(r).exponentiatedBy(2).plus(a.minus(n).exponentiatedBy(2)).times(t)):dl(!1);return(i,r,n)=>{let s=i.x,a=i.y,o=n.x,h=n.y,l=a.minus(h).times(r.x.minus(o)).minus(s.minus(o).times(r.y.minus(h)));return e(l,s,a,o,h)?0:l.comparedTo(0)}}var Hm=t=>t,Xm=t=>{if(t){let e=new Ft(ji(t)),i=new Ft(ji(t)),r=(s,a)=>a.addAndReturn(s),n=s=>({x:r(s.x,e),y:r(s.y,i)});return n({x:new gt(0),y:new gt(0)}),n}return Hm},Vi=t=>({set:e=>{vt=Vi(e)},reset:()=>Vi(t),compare:ji(t),snap:Xm(t),orient:Km(t)}),vt=Vi(),we=(t,e)=>t.ll.x.isLessThanOrEqualTo(e.x)&&e.x.isLessThanOrEqualTo(t.ur.x)&&t.ll.y.isLessThanOrEqualTo(e.y)&&e.y.isLessThanOrEqualTo(t.ur.y),Ui=(t,e)=>{if(e.ur.x.isLessThan(t.ll.x)||t.ur.x.isLessThan(e.ll.x)||e.ur.y.isLessThan(t.ll.y)||t.ur.y.isLessThan(e.ll.y))return null;let i=t.ll.x.isLessThan(e.ll.x)?e.ll.x:t.ll.x,r=t.ur.x.isLessThan(e.ur.x)?t.ur.x:e.ur.x,n=t.ll.y.isLessThan(e.ll.y)?e.ll.y:t.ll.y,s=t.ur.y.isLessThan(e.ur.y)?t.ur.y:e.ur.y;return{ll:{x:i,y:n},ur:{x:r,y:s}}},Ke=(t,e)=>t.x.times(e.y).minus(t.y.times(e.x)),gl=(t,e)=>t.x.times(e.x).plus(t.y.times(e.y)),Xe=t=>gl(t,t).sqrt(),Ym=(t,e,i)=>{let r={x:e.x.minus(t.x),y:e.y.minus(t.y)},n={x:i.x.minus(t.x),y:i.y.minus(t.y)};return Ke(n,r).div(Xe(n)).div(Xe(r))},Jm=(t,e,i)=>{let r={x:e.x.minus(t.x),y:e.y.minus(t.y)},n={x:i.x.minus(t.x),y:i.y.minus(t.y)};return gl(n,r).div(Xe(n)).div(Xe(r))},hl=(t,e,i)=>e.y.isZero()?null:{x:t.x.plus(e.x.div(e.y).times(i.minus(t.y))),y:i},cl=(t,e,i)=>e.x.isZero()?null:{x:i,y:t.y.plus(e.y.div(e.x).times(i.minus(t.x)))},$m=(t,e,i,r)=>{if(e.x.isZero())return cl(i,r,t.x);if(r.x.isZero())return cl(t,e,i.x);if(e.y.isZero())return hl(i,r,t.y);if(r.y.isZero())return hl(t,e,i.y);let n=Ke(e,r);if(n.isZero())return null;let s={x:i.x.minus(t.x),y:i.y.minus(t.y)},a=Ke(s,e).div(n),o=Ke(s,r).div(n),h=t.x.plus(o.times(e.x)),l=i.x.plus(a.times(r.x)),d=t.y.plus(o.times(e.y)),f=i.y.plus(a.times(r.y)),k=h.plus(l).div(2),w=d.plus(f).div(2);return{x:k,y:w}},kt=class ml{point;isLeft;segment;otherSE;consumedBy;static compare(e,i){let r=ml.comparePoints(e.point,i.point);return r!==0?r:(e.point!==i.point&&e.link(i),e.isLeft!==i.isLeft?e.isLeft?1:-1:Je.compare(e.segment,i.segment))}static comparePoints(e,i){return e.x.isLessThan(i.x)?-1:e.x.isGreaterThan(i.x)?1:e.y.isLessThan(i.y)?-1:e.y.isGreaterThan(i.y)?1:0}constructor(e,i){e.events===void 0?e.events=[this]:e.events.push(this),this.point=e,this.isLeft=i}link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");let i=e.point.events;for(let r=0,n=i.length;r<n;r++){let s=i[r];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}checkForConsuming(){let e=this.point.events.length;for(let i=0;i<e;i++){let r=this.point.events[i];if(r.segment.consumedBy===void 0)for(let n=i+1;n<e;n++){let s=this.point.events[n];s.consumedBy===void 0&&r.otherSE.point.events===s.otherSE.point.events&&r.segment.consume(s.segment)}}}getAvailableLinkedEvents(){let e=[];for(let i=0,r=this.point.events.length;i<r;i++){let n=this.point.events[i];n!==this&&!n.segment.ringOut&&n.segment.isInResult()&&e.push(n)}return e}getLeftmostComparator(e){let i=new Map,r=n=>{let s=n.otherSE;i.set(n,{sine:Ym(this.point,e.point,s.point),cosine:Jm(this.point,e.point,s.point)})};return(n,s)=>{i.has(n)||r(n),i.has(s)||r(s);let{sine:a,cosine:o}=i.get(n),{sine:h,cosine:l}=i.get(s);return a.isGreaterThanOrEqualTo(0)&&h.isGreaterThanOrEqualTo(0)?o.isLessThan(l)?1:o.isGreaterThan(l)?-1:0:a.isLessThan(0)&&h.isLessThan(0)?o.isLessThan(l)?-1:o.isGreaterThan(l)?1:0:h.isLessThan(a)?-1:h.isGreaterThan(a)?1:0}}},Zm=class Ki{events;poly;_isExteriorRing;_enclosingRing;static factory(e){let i=[];for(let r=0,n=e.length;r<n;r++){let s=e[r];if(!s.isInResult()||s.ringOut)continue;let a=null,o=s.leftSE,h=s.rightSE,l=[o],d=o.point,f=[];for(;a=o,o=h,l.push(o),o.point!==d;)for(;;){let k=o.getAvailableLinkedEvents();if(k.length===0){let A=l[0].point,g=l[l.length-1].point;throw new Error(`Unable to complete output ring starting at [${A.x}, ${A.y}]. Last matching segment found ends at [${g.x}, ${g.y}].`)}if(k.length===1){h=k[0].otherSE;break}let w=null;for(let A=0,g=f.length;A<g;A++)if(f[A].point===o.point){w=A;break}if(w!==null){let A=f.splice(w)[0],g=l.splice(A.index);g.unshift(g[0].otherSE),i.push(new Ki(g.reverse()));continue}f.push({index:l.length,point:o.point});let S=o.getLeftmostComparator(a);h=k.sort(S)[0].otherSE;break}i.push(new Ki(l))}return i}constructor(e){this.events=e;for(let i=0,r=e.length;i<r;i++)e[i].segment.ringOut=this;this.poly=null}getGeom(){let e=this.events[0].point,i=[e];for(let l=1,d=this.events.length-1;l<d;l++){let f=this.events[l].point,k=this.events[l+1].point;vt.orient(f,e,k)!==0&&(i.push(f),e=f)}if(i.length===1)return null;let r=i[0],n=i[1];vt.orient(r,e,n)===0&&i.shift(),i.push(i[0]);let s=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:i.length-1,o=this.isExteriorRing()?i.length:-1,h=[];for(let l=a;l!=o;l+=s)h.push([i[l].x.toNumber(),i[l].y.toNumber()]);return h}isExteriorRing(){if(this._isExteriorRing===void 0){let e=this.enclosingRing();this._isExteriorRing=e?!e.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let e=this.events[0];for(let n=1,s=this.events.length;n<s;n++){let a=this.events[n];kt.compare(e,a)>0&&(e=a)}let i=e.segment.prevInResult(),r=i?i.prevInResult():null;for(;;){if(!i)return null;if(!r)return i.ringOut;if(r.ringOut!==i.ringOut)return r.ringOut?.enclosingRing()!==i.ringOut?i.ringOut:i.ringOut?.enclosingRing();i=r.prevInResult(),r=i?i.prevInResult():null}}},ul=class{exteriorRing;interiorRings;constructor(t){this.exteriorRing=t,t.poly=this,this.interiorRings=[]}addInterior(t){this.interiorRings.push(t),t.poly=this}getGeom(){let t=this.exteriorRing.getGeom();if(t===null)return null;let e=[t];for(let i=0,r=this.interiorRings.length;i<r;i++){let n=this.interiorRings[i].getGeom();n!==null&&e.push(n)}return e}},Wm=class{rings;polys;constructor(t){this.rings=t,this.polys=this._composePolys(t)}getGeom(){let t=[];for(let e=0,i=this.polys.length;e<i;e++){let r=this.polys[e].getGeom();r!==null&&t.push(r)}return t}_composePolys(t){let e=[];for(let i=0,r=t.length;i<r;i++){let n=t[i];if(!n.poly)if(n.isExteriorRing())e.push(new ul(n));else{let s=n.enclosingRing();s?.poly||e.push(new ul(s)),s?.poly?.addInterior(n)}}return e}},Qm=class{queue;tree;segments;constructor(t,e=Je.compare){this.queue=t,this.tree=new Ft(e),this.segments=[]}process(t){let e=t.segment,i=[];if(t.consumedBy)return t.isLeft?this.queue.delete(t.otherSE):this.tree.delete(e),i;t.isLeft&&this.tree.add(e);let r=e,n=e;do r=this.tree.lastBefore(r);while(r!=null&&r.consumedBy!=null);do n=this.tree.firstAfter(n);while(n!=null&&n.consumedBy!=null);if(t.isLeft){let s=null;if(r){let o=r.getIntersection(e);if(o!==null&&(e.isAnEndpoint(o)||(s=o),!r.isAnEndpoint(o))){let h=this._splitSafely(r,o);for(let l=0,d=h.length;l<d;l++)i.push(h[l])}}let a=null;if(n){let o=n.getIntersection(e);if(o!==null&&(e.isAnEndpoint(o)||(a=o),!n.isAnEndpoint(o))){let h=this._splitSafely(n,o);for(let l=0,d=h.length;l<d;l++)i.push(h[l])}}if(s!==null||a!==null){let o=null;s===null?o=a:a===null?o=s:o=kt.comparePoints(s,a)<=0?s:a,this.queue.delete(e.rightSE),i.push(e.rightSE);let h=e.split(o);for(let l=0,d=h.length;l<d;l++)i.push(h[l])}i.length>0?(this.tree.delete(e),i.push(t)):(this.segments.push(e),e.prev=r)}else{if(r&&n){let s=r.getIntersection(n);if(s!==null){if(!r.isAnEndpoint(s)){let a=this._splitSafely(r,s);for(let o=0,h=a.length;o<h;o++)i.push(a[o])}if(!n.isAnEndpoint(s)){let a=this._splitSafely(n,s);for(let o=0,h=a.length;o<h;o++)i.push(a[o])}}}this.tree.delete(e)}return i}_splitSafely(t,e){this.tree.delete(t);let i=t.rightSE;this.queue.delete(i);let r=t.split(e);return r.push(i),t.consumedBy===void 0&&this.tree.add(t),r}},t_=class{type;numMultiPolys;run(t,e,i){Ce.type=t;let r=[new fl(e,!0)];for(let l=0,d=i.length;l<d;l++)r.push(new fl(i[l],!1));if(Ce.numMultiPolys=r.length,Ce.type==="difference"){let l=r[0],d=1;for(;d<r.length;)Ui(r[d].bbox,l.bbox)!==null?d++:r.splice(d,1)}if(Ce.type==="intersection")for(let l=0,d=r.length;l<d;l++){let f=r[l];for(let k=l+1,w=r.length;k<w;k++)if(Ui(f.bbox,r[k].bbox)===null)return[]}let n=new Ft(kt.compare);for(let l=0,d=r.length;l<d;l++){let f=r[l].getSweepEvents();for(let k=0,w=f.length;k<w;k++)n.add(f[k])}let s=new Qm(n),a=null;for(n.size!=0&&(a=n.first(),n.delete(a));a;){let l=s.process(a);for(let d=0,f=l.length;d<f;d++){let k=l[d];k.consumedBy===void 0&&n.add(k)}n.size!=0?(a=n.first(),n.delete(a)):a=null}vt.reset();let o=Zm.factory(s.segments);return new Wm(o).getGeom()}},Ce=new t_,Ye=Ce,e_=0,Je=class He{id;leftSE;rightSE;rings;windings;ringOut;consumedBy;prev;_prevInResult;_beforeState;_afterState;_isInResult;static compare(e,i){let r=e.leftSE.point.x,n=i.leftSE.point.x,s=e.rightSE.point.x,a=i.rightSE.point.x;if(a.isLessThan(r))return 1;if(s.isLessThan(n))return-1;let o=e.leftSE.point.y,h=i.leftSE.point.y,l=e.rightSE.point.y,d=i.rightSE.point.y;if(r.isLessThan(n)){if(h.isLessThan(o)&&h.isLessThan(l))return 1;if(h.isGreaterThan(o)&&h.isGreaterThan(l))return-1;let f=e.comparePoint(i.leftSE.point);if(f<0)return 1;if(f>0)return-1;let k=i.comparePoint(e.rightSE.point);return k!==0?k:-1}if(r.isGreaterThan(n)){if(o.isLessThan(h)&&o.isLessThan(d))return-1;if(o.isGreaterThan(h)&&o.isGreaterThan(d))return 1;let f=i.comparePoint(e.leftSE.point);if(f!==0)return f;let k=e.comparePoint(i.rightSE.point);return k<0?1:k>0?-1:1}if(o.isLessThan(h))return-1;if(o.isGreaterThan(h))return 1;if(s.isLessThan(a)){let f=i.comparePoint(e.rightSE.point);if(f!==0)return f}if(s.isGreaterThan(a)){let f=e.comparePoint(i.rightSE.point);if(f<0)return 1;if(f>0)return-1}if(!s.eq(a)){let f=l.minus(o),k=s.minus(r),w=d.minus(h),S=a.minus(n);if(f.isGreaterThan(k)&&w.isLessThan(S))return 1;if(f.isLessThan(k)&&w.isGreaterThan(S))return-1}return s.isGreaterThan(a)?1:s.isLessThan(a)||l.isLessThan(d)?-1:l.isGreaterThan(d)?1:e.id<i.id?-1:e.id>i.id?1:0}constructor(e,i,r,n){this.id=++e_,this.leftSE=e,e.segment=this,e.otherSE=i,this.rightSE=i,i.segment=this,i.otherSE=e,this.rings=r,this.windings=n}static fromRing(e,i,r){let n,s,a,o=kt.comparePoints(e,i);if(o<0)n=e,s=i,a=1;else if(o>0)n=i,s=e,a=-1;else throw new Error(`Tried to create degenerate segment at [${e.x}, ${e.y}]`);let h=new kt(n,!0),l=new kt(s,!1);return new He(h,l,[r],[a])}replaceRightSE(e){this.rightSE=e,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){let e=this.leftSE.point.y,i=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:e.isLessThan(i)?e:i},ur:{x:this.rightSE.point.x,y:e.isGreaterThan(i)?e:i}}}vector(){return{x:this.rightSE.point.x.minus(this.leftSE.point.x),y:this.rightSE.point.y.minus(this.leftSE.point.y)}}isAnEndpoint(e){return e.x.eq(this.leftSE.point.x)&&e.y.eq(this.leftSE.point.y)||e.x.eq(this.rightSE.point.x)&&e.y.eq(this.rightSE.point.y)}comparePoint(e){return vt.orient(this.leftSE.point,e,this.rightSE.point)}getIntersection(e){let i=this.bbox(),r=e.bbox(),n=Ui(i,r);if(n===null)return null;let s=this.leftSE.point,a=this.rightSE.point,o=e.leftSE.point,h=e.rightSE.point,l=we(i,o)&&this.comparePoint(o)===0,d=we(r,s)&&e.comparePoint(s)===0,f=we(i,h)&&this.comparePoint(h)===0,k=we(r,a)&&e.comparePoint(a)===0;if(d&&l)return k&&!f?a:!k&&f?h:null;if(d)return f&&s.x.eq(h.x)&&s.y.eq(h.y)?null:s;if(l)return k&&a.x.eq(o.x)&&a.y.eq(o.y)?null:o;if(k&&f)return null;if(k)return a;if(f)return h;let w=$m(s,this.vector(),o,e.vector());return w===null||!we(n,w)?null:vt.snap(w)}split(e){let i=[],r=e.events!==void 0,n=new kt(e,!0),s=new kt(e,!1),a=this.rightSE;this.replaceRightSE(s),i.push(s),i.push(n);let o=new He(n,a,this.rings.slice(),this.windings.slice());return kt.comparePoints(o.leftSE.point,o.rightSE.point)>0&&o.swapEvents(),kt.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),r&&(n.checkForConsuming(),s.checkForConsuming()),i}swapEvents(){let e=this.rightSE;this.rightSE=this.leftSE,this.leftSE=e,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let i=0,r=this.windings.length;i<r;i++)this.windings[i]*=-1}consume(e){let i=this,r=e;for(;i.consumedBy;)i=i.consumedBy;for(;r.consumedBy;)r=r.consumedBy;let n=He.compare(i,r);if(n!==0){if(n>0){let s=i;i=r,r=s}if(i.prev===r){let s=i;i=r,r=s}for(let s=0,a=r.rings.length;s<a;s++){let o=r.rings[s],h=r.windings[s],l=i.rings.indexOf(o);l===-1?(i.rings.push(o),i.windings.push(h)):i.windings[l]+=h}r.rings=null,r.windings=null,r.consumedBy=i,r.leftSE.consumedBy=i.leftSE,r.rightSE.consumedBy=i.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 e=this.prev.consumedBy||this.prev;this._beforeState=e.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;let e=this.beforeState();this._afterState={rings:e.rings.slice(0),windings:e.windings.slice(0),multiPolys:[]};let i=this._afterState.rings,r=this._afterState.windings,n=this._afterState.multiPolys;for(let o=0,h=this.rings.length;o<h;o++){let l=this.rings[o],d=this.windings[o],f=i.indexOf(l);f===-1?(i.push(l),r.push(d)):r[f]+=d}let s=[],a=[];for(let o=0,h=i.length;o<h;o++){if(r[o]===0)continue;let l=i[o],d=l.poly;if(a.indexOf(d)===-1)if(l.isExterior)s.push(d);else{a.indexOf(d)===-1&&a.push(d);let f=s.indexOf(l.poly);f!==-1&&s.splice(f,1)}}for(let o=0,h=s.length;o<h;o++){let l=s[o].multiPoly;n.indexOf(l)===-1&&n.push(l)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;let e=this.beforeState().multiPolys,i=this.afterState().multiPolys;switch(Ye.type){case"union":{let r=e.length===0,n=i.length===0;this._isInResult=r!==n;break}case"intersection":{let r,n;e.length<i.length?(r=e.length,n=i.length):(r=i.length,n=e.length),this._isInResult=n===Ye.numMultiPolys&&r<n;break}case"xor":{let r=Math.abs(e.length-i.length);this._isInResult=r%2===1;break}case"difference":{let r=n=>n.length===1&&n[0].isSubject;this._isInResult=r(e)!==r(i);break}}return this._isInResult}},pl=class{poly;isExterior;segments;bbox;constructor(t,e,i){if(!Array.isArray(t)||t.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=i,this.segments=[],typeof t[0][0]!="number"||typeof t[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let r=vt.snap({x:new gt(t[0][0]),y:new gt(t[0][1])});this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};let n=r;for(let s=1,a=t.length;s<a;s++){if(typeof t[s][0]!="number"||typeof t[s][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let o=vt.snap({x:new gt(t[s][0]),y:new gt(t[s][1])});o.x.eq(n.x)&&o.y.eq(n.y)||(this.segments.push(Je.fromRing(n,o,this)),o.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=o.x),o.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=o.y),o.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=o.x),o.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=o.y),n=o)}(!r.x.eq(n.x)||!r.y.eq(n.y))&&this.segments.push(Je.fromRing(n,r,this))}getSweepEvents(){let t=[];for(let e=0,i=this.segments.length;e<i;e++){let r=this.segments[e];t.push(r.leftSE),t.push(r.rightSE)}return t}},i_=class{multiPoly;exteriorRing;interiorRings;bbox;constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new pl(t[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 i=1,r=t.length;i<r;i++){let n=new pl(t[i],this,!1);n.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=n.bbox.ll.x),n.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=n.bbox.ll.y),n.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=n.bbox.ur.x),n.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=n.bbox.ur.y),this.interiorRings.push(n)}this.multiPoly=e}getSweepEvents(){let t=this.exteriorRing.getSweepEvents();for(let e=0,i=this.interiorRings.length;e<i;e++){let r=this.interiorRings[e].getSweepEvents();for(let n=0,s=r.length;n<s;n++)t.push(r[n])}return t}},fl=class{isSubject;polys;bbox;constructor(t,e){if(!Array.isArray(t))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof t[0][0][0]=="number"&&(t=[t])}catch{}this.polys=[],this.bbox={ll:{x:new gt(Number.POSITIVE_INFINITY),y:new gt(Number.POSITIVE_INFINITY)},ur:{x:new gt(Number.NEGATIVE_INFINITY),y:new gt(Number.NEGATIVE_INFINITY)}};for(let i=0,r=t.length;i<r;i++){let n=new i_(t[i],this);n.bbox.ll.x.isLessThan(this.bbox.ll.x)&&(this.bbox.ll.x=n.bbox.ll.x),n.bbox.ll.y.isLessThan(this.bbox.ll.y)&&(this.bbox.ll.y=n.bbox.ll.y),n.bbox.ur.x.isGreaterThan(this.bbox.ur.x)&&(this.bbox.ur.x=n.bbox.ur.x),n.bbox.ur.y.isGreaterThan(this.bbox.ur.y)&&(this.bbox.ur.y=n.bbox.ur.y),this.polys.push(n)}this.isSubject=e}getSweepEvents(){let t=[];for(let e=0,i=this.polys.length;e<i;e++){let r=this.polys[e].getSweepEvents();for(let n=0,s=r.length;n<s;n++)t.push(r[n])}return t}};var _l=(t,...e)=>Ye.run("intersection",t,e);var yl=(t,...e)=>Ye.run("difference",t,e),D0=vt.set;function Ze(t){let e={type:"Feature"};return e.geometry=t,e}function $e(t){return t.type==="Feature"?t.geometry:t}function Ll(t){return t&&t.geometry&&t.geometry.coordinates?t.geometry.coordinates:t}function n_(t){return Ze({type:"LineString",coordinates:t})}function s_(t){return Ze({type:"MultiLineString",coordinates:t})}function bl(t){return Ze({type:"Polygon",coordinates:t})}function kl(t){return Ze({type:"MultiPolygon",coordinates:t})}function Ml(t,e){let i=$e(t),r=$e(e),n=_l(i.coordinates,r.coordinates);return n.length===0?null:n.length===1?bl(n[0]):kl(n)}function vl(t,e){let i=$e(t),r=$e(e),n=yl(i.coordinates,r.coordinates);return n.length===0?null:n.length===1?bl(n[0]):kl(n)}function xl(t){return Array.isArray(t)?1+xl(t[0]):-1}function wl(t){t instanceof L.Polyline&&(t=t.toGeoJSON(15));let e=Ll(t),i=xl(e),r=[];return i>1?e.forEach(n=>{r.push(n_(n))}):r.push(t),r}function Cl(t){let e=[];return t.eachLayer(i=>{e.push(Ll(i.toGeoJSON(15)))}),s_(e)}Y.Cut=Y.Polygon.extend({initialize(t){this._map=t,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 t=this._layer.getLatLngs();if(t.length<=2)return;let e=L.polygon(t,this.options.pathOptions);e._latlngInfos=this._layer._latlngInfo,this.cut(e),this._cleanupSnapping(),this._otherSnapLayers.splice(this._tempSnapLayerIndex,1),delete this._tempSnapLayerIndex,this._editedLayers.forEach(({layer:r,originalLayer:n})=>{this._fireCut(n,r,n),this._fireCut(this._map,r,n),n.pm._fireEdit()}),this._editedLayers=[];let i=this._hintMarker.getLatLng();this.disable(),this.options.continueDrawing&&(this.enable(),this._hintMarker.setLatLng(i))},cut(t){let e=this._map._layers,i=t._latlngInfos||[];Object.keys(e).map(n=>e[n]).filter(n=>n.pm).filter(n=>!n._pmTempLayer).filter(n=>!L.PM.optIn&&!n.options.pmIgnore||L.PM.optIn&&n.options.pmIgnore===!1).filter(n=>n instanceof L.Polyline).filter(n=>n!==t).filter(n=>n.pm.options.allowCutting).filter(n=>this.options.layersToCut&&L.Util.isArray(this.options.layersToCut)&&this.options.layersToCut.length>0?this.options.layersToCut.indexOf(n)>-1:!0).filter(n=>!this._layerGroup.hasLayer(n)).filter(n=>{try{let s=!!Dt(t.toGeoJSON(15),n.toGeoJSON(15)).features.length>0;return s||n instanceof L.Polyline&&!(n instanceof L.Polygon)?s:!!Ml(t.toGeoJSON(15),n.toGeoJSON(15))}catch{return n instanceof L.Polygon&&console.error("You can't cut polygons with self-intersections"),!1}}).forEach(n=>{let s;if(n instanceof L.Polygon){s=L.polygon(n.getLatLngs());let l=s.getLatLngs();i.forEach(d=>{if(d&&d.snapInfo){let{latlng:f}=d,k=this._calcClosestLayer(f,[s]);if(k&&k.segment&&k.distance<this.options.snapDistance){let{segment:w}=k;if(w&&w.length===2){let{indexPath:S,parentPath:A,newIndex:g}=L.PM.Utils._getIndexFromSegment(l,w);(S.length>1?(0,El.default)(l,A):l).splice(g,0,f)}}}})}else s=n;let a=this._cutLayer(t,s),o=L.geoJSON(a,n.options);o.getLayers().length===1&&([o]=o.getLayers()),this._setPane(o,"layerPane");let h=o.addTo(this._map.pm._getContainingLayer());if(h.pm.enable(n.pm.options),h.pm.disable(),n._pmTempLayer=!0,t._pmTempLayer=!0,n.remove(),n.removeFrom(this._map.pm._getContainingLayer()),t.remove(),t.removeFrom(this._map.pm._getContainingLayer()),h.getLayers&&h.getLayers().length===0&&this._map.pm.removeLayer({target:h}),h instanceof L.LayerGroup?(h.eachLayer(l=>{this._addDrawnLayerProp(l)}),this._addDrawnLayerProp(h)):this._addDrawnLayerProp(h),this.options.layersToCut&&L.Util.isArray(this.options.layersToCut)&&this.options.layersToCut.length>0){let l=this.options.layersToCut.indexOf(n);l>-1&&this.options.layersToCut.splice(l,1)}this._editedLayers.push({layer:h,originalLayer:n})})},_cutLayer(t,e){let i=L.geoJSON(),r;if(e instanceof L.Polygon)r=vl(e.toGeoJSON(15),t.toGeoJSON(15));else{let n=wl(e);n.forEach(s=>{let a=Wo(s,t.toGeoJSON(15)),o;a&&a.features.length>0?o=L.geoJSON(a):o=L.geoJSON(s),o.getLayers().forEach(h=>{sl(t.toGeoJSON(15),h.toGeoJSON(15))||h.addTo(i)})}),n.length>1?r=Cl(i):r=i.toGeoJSON(15)}return r},_change:L.Util.falseFn});Y.Text=Y.extend({initialize(t){this._map=t,this._shape="Text",this.toolbarButtonName="drawText"},enable(t){L.Util.setOptions(this,t),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(F("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(t){this.enabled()?this.disable():this.enable(t)},_syncHintMarker(t){if(this._hintMarker.setLatLng(t.latlng),this.options.snappable){let e=t;e.target=this._hintMarker,this._handleSnapping(e)}},_createMarker(t){if(!t.latlng||this.options.requireSnapToFinish&&!this._hintMarker._snapped&&!this._isFirstLayer())return;this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);let e=this._hintMarker.getLatLng();if(this.textArea=this._createTextArea(),this.options.textOptions?.className){let n=this.options.textOptions.className.split(" ");this.textArea.classList.add(...n)}let i=this._createTextIcon(this.textArea),r=new L.Marker(e,{textMarker:!0,_textMarkerOverPM:!0,icon:i});if(this._setPane(r,"markerPane"),this._finishLayer(r),r.pm||(r.options.draggable=!1),r.addTo(this._map.pm._getContainingLayer()),r.pm){r.pm.textArea=this.textArea,L.setOptions(r.pm,{removeIfEmpty:this.options.textOptions?.removeIfEmpty??!0});let n=this.options.textOptions?.focusAfterDraw??!0;r.pm._createTextMarker(n),this.options.textOptions?.text&&r.pm.setText(this.options.textOptions.text)}this._fireCreate(r),this._cleanupSnapping(),this.disable(),this.options.continueDrawing&&this._map.once("mousemove",this._showHintMarkerAfterMoving,this)},_showHintMarkerAfterMoving(t){this.enable(),this._hintMarker.setLatLng(t.latlng)},_createTextArea(){let t=document.createElement("textarea");return t.readOnly=!0,t.classList.add("pm-textarea","pm-disabled"),t},_createTextIcon(t){return L.divIcon({className:"pm-text-marker",html:t})}});var a_={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,St(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 t=this._getDOMElem();t&&(St(this._layer)instanceof L.Canvas?(this._layer.on("touchstart mousedown",this._dragMixinOnMouseDown,this),this._map.pm._addTouchEvents(t)):L.DomEvent.on(t,"touchstart mousedown",this._simulateMouseDownEvent,this)),this._fireDragEnable()},disableLayerDrag(){this._layerDragEnabled=!1,St(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 t=this._getDOMElem();t&&(St(this._layer)instanceof L.Canvas?(this._layer.off("touchstart mousedown",this._dragMixinOnMouseDown,this),this._map.pm._removeTouchEvents(t)):L.DomEvent.off(t,"touchstart mousedown",this._simulateMouseDownEvent,this)),this._layerDragged&&this._fireUpdate(),this._layerDragged=!1,this._fireDragDisable()},dragging(){return this._dragging},layerDragEnabled(){return!!this._layerDragEnabled},_simulateMouseDownEvent(t){let e=t.touches?t.touches[0]:t,i={originalEvent:e,target:this._layer};return i.containerPoint=this._map.mouseEventToContainerPoint(e),i.latlng=this._map.containerPointToLatLng(i.containerPoint),this._dragMixinOnMouseDown(i),!1},_simulateMouseMoveEvent(t){let e=t.touches?t.touches[0]:t,i={originalEvent:e,target:this._layer};return i.containerPoint=this._map.mouseEventToContainerPoint(e),i.latlng=this._map.containerPointToLatLng(i.containerPoint),this._dragMixinOnMouseMove(i),!1},_simulateMouseUpEvent(t){let i={originalEvent:t.touches?t.touches[0]:t,target:this._layer};return t.type.indexOf("touch")===-1&&(i.containerPoint=this._map.mouseEventToContainerPoint(t),i.latlng=this._map.containerPointToLatLng(i.containerPoint)),this._dragMixinOnMouseUp(i),!1},_dragMixinOnMouseDown(t){if(t.originalEvent.button>0)return;this._overwriteEventIfItComesFromMarker(t);let e=t._fromLayerSync,i=this._syncLayers("_dragMixinOnMouseDown",t);if(this._layer instanceof L.Marker&&(this.options.snappable&&!e&&!i?this._initSnappableMarkers():this._disableSnapping()),this._layer instanceof L.CircleMarker){let r="resizeableCircleMarker";this._layer instanceof L.Circle&&(r="resizeableCircle"),this.options.snappable&&!e&&!i?this._layer.pm.options[r]||this._initSnappableMarkersDrag():this._layer.pm.options[r]?this._layer.pm._disableSnapping():this._layer.pm._disableSnappingDrag()}this._safeToCacheDragState&&(this._originalMapDragState=this._layer._map.dragging._enabled,this._safeToCacheDragState=!1),this._tempDragCoord=t.latlng,L.DomEvent.on(this._map.getContainer(),"touchend mouseup",this._simulateMouseUpEvent,this),L.DomEvent.on(this._map.getContainer(),"touchmove mousemove",this._simulateMouseMoveEvent,this)},_dragMixinOnMouseMove(t){this._overwriteEventIfItComesFromMarker(t);let e=this._getDOMElem();this._syncLayers("_dragMixinOnMouseMove",t),this._dragging||(this._dragging=!0,L.DomUtil.addClass(e,"leaflet-pm-dragging"),this._layer instanceof L.Marker||this._layer.bringToFront(),this._originalMapDragState&&this._map.dragging.disable(),this._fireDragStart()),this._tempDragCoord||(this._tempDragCoord=t.latlng),this._onLayerDrag(t),this._layer instanceof L.CircleMarker&&this._layer.pm._updateHiddenPolyCircle()},_dragMixinOnMouseUp(t){let e=this._getDOMElem();return this._syncLayers("_dragMixinOnMouseUp",t),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,e&&L.DomUtil.removeClass(e,"leaflet-pm-dragging"),this._fireDragEnd(),this._fireEdit(),this._layerEdited=!0},10),!0):!1},_onLayerDrag(t){let{latlng:e}=t,i={lat:e.lat-this._tempDragCoord.lat,lng:e.lng-this._tempDragCoord.lng},r=n=>n.map(s=>{if(Array.isArray(s))return r(s);let a={lat:s.lat+i.lat,lng:s.lng+i.lng};return(s.alt||s.alt===0)&&(a.alt=s.alt),a});if(this._layer instanceof L.Circle&&this._layer.options.resizeableCircle||this._layer instanceof L.CircleMarker&&this._layer.options.resizeableCircleMarker){let n=r([this._layer.getLatLng()]);this._layer.setLatLng(n[0]),this._fireChange(this._layer.getLatLng(),"Edit")}else if(this._layer instanceof L.CircleMarker||this._layer instanceof L.Marker){let n=this._layer.getLatLng();this._layer._snapped&&(n=this._layer._orgLatLng);let s=r([n]);this._layer.setLatLng(s[0]),this._fireChange(this._layer.getLatLng(),"Edit")}else if(this._layer instanceof L.ImageOverlay){let n=r([this._layer.getBounds().getNorthWest(),this._layer.getBounds().getSouthEast()]);this._layer.setBounds(n),this._fireChange(this._layer.getBounds(),"Edit")}else{let n=r(this._layer.getLatLngs());this._layer.setLatLngs(n),this._fireChange(this._layer.getLatLngs(),"Edit")}this._tempDragCoord=e,t.layer=this._layer,this._fireDrag(t)},addDraggingClass(){let t=this._getDOMElem();t&&L.DomUtil.addClass(t,"leaflet-pm-draggable")},removeDraggingClass(){let t=this._getDOMElem();t&&L.DomUtil.removeClass(t,"leaflet-pm-draggable")},_getDOMElem(){let t=null;return this._layer._path?t=this._layer._path:this._layer._renderer&&this._layer._renderer._container?t=this._layer._renderer._container:this._layer._image?t=this._layer._image:this._layer._icon&&(t=this._layer._icon),t},_overwriteEventIfItComesFromMarker(t){t.target.getLatLng&&(!t.target._radius||t.target._radius<=10)&&(t.containerPoint=this._map.mouseEventToContainerPoint(t.originalEvent),t.latlng=this._map.containerPointToLatLng(t.containerPoint))},_syncLayers(t,e){if(this.enabled())return!1;if(!e._fromLayerSync&&this._layer===e.target&&this.options.syncLayersOnDrag){e._fromLayerSync=!0;let i=[];if(L.Util.isArray(this.options.syncLayersOnDrag))i=this.options.syncLayersOnDrag,this.options.syncLayersOnDrag.forEach(r=>{r instanceof L.LayerGroup&&(i=i.concat(r.pm.getLayers(!0)))});else if(this.options.syncLayersOnDrag===!0&&this._parentLayerGroup)for(let r in this._parentLayerGroup){let n=this._parentLayerGroup[r];n.pm&&(i=n.pm.getLayers(!0))}return L.Util.isArray(i)&&i.length>0&&(i=i.filter(r=>!!r.pm).filter(r=>!!r.pm.options.draggable),i.forEach(r=>{r!==this._layer&&r.pm[t]&&(r._snapped=!1,r.pm[t](e))})),i.length>0}return!1},_stopDOMImageDrag(t){return t.preventDefault(),!1}},Pl=a_;var Sl=wt(ge());function o_(t,e,i,r){return i.unproject(e.transform(i.project(t,r)),r)}function Hi(t,e,i){let r=i.getMaxZoom();if(r===1/0&&(r=i.getZoom()),L.Util.isArray(t)){let n=[];return t.forEach(s=>{n.push(Hi(s,e,i))}),n}return t instanceof L.LatLng?o_(t,e,i,r):null}function Ot(t,e){e instanceof L.Layer&&(e=e.getLatLng());let i=t.getMaxZoom();return i===1/0&&(i=t.getZoom()),t.project(e,i)}function Ee(t,e){let i=t.getMaxZoom();return i===1/0&&(i=t.getZoom()),t.unproject(e,i)}var l_={_onRotateStart(t){this._preventRenderingMarkers(!0),this._rotationOriginLatLng=this._getRotationCenter().clone(),this._rotationOriginPoint=Ot(this._map,this._rotationOriginLatLng),this._rotationStartPoint=Ot(this._map,t.target.getLatLng()),this._initialRotateLatLng=Lt(this._layer),this._startAngle=this.getAngle();let e=Lt(this._rotationLayer,this._rotationLayer.pm._rotateOrgLatLng);this._fireRotationStart(this._rotationLayer,e),this._fireRotationStart(this._map,e)},_onRotate(t){let e=Ot(this._map,t.target.getLatLng()),i=this._rotationStartPoint,r=this._rotationOriginPoint,n=Math.atan2(e.y-r.y,e.x-r.x)-Math.atan2(i.y-r.y,i.x-r.x);this._layer.setLatLngs(this._rotateLayer(n,this._initialRotateLatLng,this._rotationOriginLatLng,L.PM.Matrix.init(),this._map));let s=this;function a(d,f=[],k=-1){if(k>-1&&f.push(k),L.Util.isArray(d[0]))d.forEach((w,S)=>a(w,f.slice(),S));else{let w=f.length>0?(0,Sl.default)(s._markers,f):s._markers[0];d.forEach((S,A)=>{w[A].setLatLng(S)})}}a(this._layer.getLatLngs());let o=Lt(this._rotationLayer);this._rotationLayer.setLatLngs(this._rotateLayer(n,this._rotationLayer.pm._rotateOrgLatLng,this._rotationOriginLatLng,L.PM.Matrix.init(),this._map));let h=n*180/Math.PI;h=h<0?h+360:h;let l=h+this._startAngle;this._setAngle(l),this._rotationLayer.pm._setAngle(l),this._fireRotation(this._rotationLayer,h,o),this._fireRotation(this._map,h,o),this._rotationLayer.pm._fireChange(this._rotationLayer.getLatLngs(),"Rotation")},_onRotateEnd(){let t=this._startAngle;delete this._rotationOriginLatLng,delete this._rotationOriginPoint,delete this._rotationStartPoint,delete this._initialRotateLatLng,delete this._startAngle;let e=Lt(this._rotationLayer,this._rotationLayer.pm._rotateOrgLatLng);this._rotationLayer.pm._rotateOrgLatLng=Lt(this._rotationLayer),this._fireRotationEnd(this._rotationLayer,t,e),this._fireRotationEnd(this._map,t,e),this._rotationLayer.pm._fireEdit(this._rotationLayer,"Rotation"),this._preventRenderingMarkers(!1),this._layerRotated=!0},_rotateLayer(t,e,i,r,n){let s=Ot(n,i);return this._matrix=r.clone().rotate(t,s).flip(),Hi(e,this._matrix,n)},_setAngle(t){t=t<0?t+360:t,this._angle=t%360},_getRotationCenter(){if(this._rotationCenter)return this._rotationCenter;let t=L.polygon(this._layer.getLatLngs(),{stroke:!1,fill:!1,pmIgnore:!0}).addTo(this._layer._map),e=t.getCenter();return t.removeFrom(this._layer._map),e},enableRotate(){if(!this.options.allowRotation){this.disableRotate();return}this.rotateEnabled()&&this.disableRotate(),this._layer instanceof L.Rectangle&&this._angle===void 0&&this.setInitAngle(ye(this._layer._map,this._layer.getLatLngs()[0][0],this._layer.getLatLngs()[0][1])||0);let t={fill:!1,stroke:!1,pmIgnore:!1,snapIgnore:!0};this._rotatePoly=L.polygon(this._layer.getLatLngs(),t),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=Lt(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(t){let e=this.getAngle(),i=this._layer.getLatLngs(),r=t*(Math.PI/180);this._layer.setLatLngs(this._rotateLayer(r,this._layer.getLatLngs(),this._getRotationCenter(),L.PM.Matrix.init(),this._layer._map)),this._rotateOrgLatLng=L.polygon(this._layer.getLatLngs()).getLatLngs(),this._setAngle(this.getAngle()+t),this.rotateEnabled()&&this._rotatePoly&&this._rotatePoly.pm.enabled()&&(this._rotatePoly.setLatLngs(this._rotateLayer(r,this._rotatePoly.getLatLngs(),this._getRotationCenter(),L.PM.Matrix.init(),this._rotatePoly._map)),this._rotatePoly.pm._initMarkers());let n=this.getAngle()-e;n=n<0?n+360:n,this._startAngle=e,this._fireRotation(this._layer,n,i,this._layer),this._fireRotation(this._map||this._layer._map,n,i,this._layer),delete this._startAngle,this._fireChange(this._layer.getLatLngs(),"Rotation")},rotateLayerToAngle(t){let e=t-this.getAngle();this.rotateLayer(e)},getAngle(){return this._angle||0},setInitAngle(t){this._setAngle(t)},getRotationCenter(){return this._getRotationCenter()},setRotationCenter(t){this._rotationCenter=t,this._rotatePoly&&this._rotatePoly.pm.setRotationCenter(t)}},Tl=l_;var h_=L.Class.extend({includes:[Pl,Ae,Tl,Pt],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(t){L.Util.setOptions(this,t)},getOptions(){return this.options},applyOptions(){},isPolygon(){return this._layer instanceof L.Polygon},getShape(){return this._shape},_setPane(t,e){e==="layerPane"?t.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.layerPane||"overlayPane":e==="vertexPane"?t.options.pane=this._map.pm.globalOptions.panes&&this._map.pm.globalOptions.panes.vertexPane||"markerPane":e==="markerPane"&&(t.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(t,e){let i=e.target,r={layer:this._layer,marker:i,event:e},n="";return t==="move"?n="moveVertexValidation":t==="add"?n="addVertexValidation":t==="remove"&&(n="removeVertexValidation"),this.options[n]&&typeof this.options[n]=="function"&&!this.options[n](r)?(t==="move"&&(i._cancelDragEventChain=i.getLatLng()),!1):(i._cancelDragEventChain=null,!0)},_vertexValidationDrag(t){return t._cancelDragEventChain?(t._latlng=t._cancelDragEventChain,t.update(),!1):!0},_vertexValidationDragEnd(t){return t._cancelDragEventChain?(t._cancelDragEventChain=null,!1):!0}}),X=h_;X.LayerGroup=L.Class.extend({initialize(t){this._layerGroup=t,this._layers=this.getLayers(),this._getMap(),this._layers.forEach(r=>this._initLayer(r));let e=r=>{if(r.layer._pmTempLayer)return;this._layers=this.getLayers();let n=this._layers.filter(s=>!s.pm._parentLayerGroup||!(this._layerGroup._leaflet_id in s.pm._parentLayerGroup));n.forEach(s=>{this._initLayer(s)}),n.length>0&&this._getMap()&&this._getMap().pm.globalEditModeEnabled()&&this.enabled()&&this.enable(this.getOptions())};this._layerGroup.on("layeradd",L.Util.throttle(e,100,this),this),this._layerGroup.on("layerremove",r=>{this._removeLayerFromGroup(r.target)},this);let i=r=>{r.target._pmTempLayer||(this._layers=this.getLayers())};this._layerGroup.on("layerremove",L.Util.throttle(i,100,this),this)},enable(t,e=[]){e.length===0&&(this._layers=this.getLayers()),this._options=t,this._layers.forEach(i=>{i instanceof L.LayerGroup?e.indexOf(i._leaflet_id)===-1&&(e.push(i._leaflet_id),i.pm.enable(t,e)):i.pm.enable(t)})},disable(t=[]){t.length===0&&(this._layers=this.getLayers()),this._layers.forEach(e=>{e instanceof L.LayerGroup?t.indexOf(e._leaflet_id)===-1&&(t.push(e._leaflet_id),e.pm.disable(t)):e.pm.disable()})},enabled(t=[]){return t.length===0&&(this._layers=this.getLayers()),!!this._layers.find(i=>i instanceof L.LayerGroup?t.indexOf(i._leaflet_id)===-1?(t.push(i._leaflet_id),i.pm.enabled(t)):!1:i.pm.enabled())},toggleEdit(t,e=[]){e.length===0&&(this._layers=this.getLayers()),this._options=t,this._layers.forEach(i=>{i instanceof L.LayerGroup?e.indexOf(i._leaflet_id)===-1&&(e.push(i._leaflet_id),i.pm.toggleEdit(t,e)):i.pm.toggleEdit(t)})},_initLayer(t){let e=L.Util.stamp(this._layerGroup);t.pm._parentLayerGroup||(t.pm._parentLayerGroup={}),t.pm._parentLayerGroup[e]=this._layerGroup},_removeLayerFromGroup(t){if(t.pm&&t.pm._layerGroup){let e=L.Util.stamp(this._layerGroup);delete t.pm._layerGroup[e]}},dragging(){return this._layers=this.getLayers(),this._layers?!!this._layers.find(e=>e.pm.dragging()):!1},getOptions(){return this.options},_getMap(){return this._map||this._layers.find(t=>!!t._map)?._map||null},getLayers(t=!1,e=!0,i=!0,r=[]){let n=[];return t?this._layerGroup.getLayers().forEach(s=>{n.push(s),s instanceof L.LayerGroup&&r.indexOf(s._leaflet_id)===-1&&(r.push(s._leaflet_id),n=n.concat(s.pm.getLayers(!0,!0,!0,r)))}):n=this._layerGroup.getLayers(),i&&(n=n.filter(s=>!(s instanceof L.LayerGroup))),e&&(n=n.filter(s=>!!s.pm),n=n.filter(s=>!s._pmTempLayer),n=n.filter(s=>!L.PM.optIn&&!s.options.pmIgnore||L.PM.optIn&&s.options.pmIgnore===!1)),n},setOptions(t,e=[]){e.length===0&&(this._layers=this.getLayers()),this.options=t,this._layers.forEach(i=>{i.pm&&(i instanceof L.LayerGroup?e.indexOf(i._leaflet_id)===-1&&(e.push(i._leaflet_id),i.pm.setOptions(t,e)):i.pm.setOptions(t))})}});X.Marker=X.extend({_shape:"Marker",initialize(t){this._layer=t,this._enabled=!1,this._layer.on("dragend",this._onDragEnd,this)},enable(t={draggable:!0}){if(L.Util.setOptions(this,t),!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(t){this.enabled()?this.disable():this.enable(t)},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(t){let e=t.target;e.remove(),this._fireRemove(e),this._fireRemove(this._map,e)},_onDragStart(){this._map.pm.Draw.Marker._layerIsDragging=!0},_onMarkerDragEnd(){this._map.pm.Draw.Marker._layerIsDragging=!1},_onDragEnd(){this._fireEdit(),this._layerEdited=!0},_initSnappableMarkers(){let t=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=this.options.snapSegment===void 0?!0:this.options.snapSegment,t.off("pm:drag",this._handleSnapping,this),t.on("pm:drag",this._handleSnapping,this),t.off("pm:dragend",this._cleanupSnapping,this),t.on("pm:dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this),t.on("pm:dragstart",this._unsnap,this)},_disableSnapping(){let t=this._layer;t.off("pm:drag",this._handleSnapping,this),t.off("pm:dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this)}});var xt=wt(ge());var c_={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 t=[...this._markerGroup.getLayers(),...this.markerCache];this.markerCache=t.filter((e,i,r)=>r.indexOf(e)===i)},_removeFromCache(t){let e=this.markerCache.indexOf(t);e>-1&&this.markerCache.splice(e,1)},renderLimits(t){this.markerCache.forEach(e=>{t.includes(e)?this._markerGroup.addLayer(e):this._markerGroup.removeLayer(e)})},applyLimitFilters({latlng:t={lat:0,lng:0}}){if(this._preventRenderMarkers)return;let i=[...this._filterClosestMarkers(t)];this.renderLimits(i)},_filterClosestMarkers(t){let e=[...this.markerCache],i=this.options.limitMarkersToCount;return i===-1?e:(e.sort((n,s)=>{let a=n._latlng.distanceTo(t),o=s._latlng.distanceTo(t);return a-o}),e.filter((n,s)=>i>-1?s<i:!0))},_preventRenderMarkers:!1,_preventRenderingMarkers(t){this._preventRenderMarkers=!!t}},Bl=c_;X.Line=X.extend({includes:[Bl],_shape:"Line",initialize(t){this._layer=t,this._enabled=!1},enable(t){if(L.Util.setOptions(this,t),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 t=this._layer._path?this._layer._path:this._layer._renderer._container;L.DomUtil.removeClass(t,"leaflet-pm-draggable"),this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable()},enabled(){return this._enabled},toggleEdit(t){return this.enabled()?this.disable():this.enable(t),this.enabled()},applyOptions(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping()},_initMarkers(){let t=this._map,e=this._layer.getLatLngs();this._markerGroup&&(this._markerGroup.removeFrom(t),this._markerGroup.clearLayers()),this._markerGroup=new L.FeatureGroup,this._markerGroup._pmTempLayer=!0;let i=r=>{if(Array.isArray(r[0]))return r.map(i,this);let n=r.map(this._createMarker,this);return this.options.hideMiddleMarkers!==!0&&r.map((s,a)=>{let o=this.isPolygon()?(a+1)%r.length:a+1;return this._createMiddleMarker(n[a],n[o])}),n};this._markers=i(e),this.filterMarkerGroup(),t.addLayer(this._markerGroup)},_createMarker(t){let e=new L.Marker(t,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(e,"vertexPane"),e._pmTempLayer=!0,this.options.rotate?(e.on("dragstart",this._onRotateStart,this),e.on("drag",this._onRotate,this),e.on("dragend",this._onRotateEnd,this)):(e.on("click",this._onVertexClick,this),e.on("dragstart",this._onMarkerDragStart,this),e.on("move",this._onMarkerDrag,this),e.on("dragend",this._onMarkerDragEnd,this),this.options.preventMarkerRemoval||e.on(this.options.removeVertexOn,this._removeMarker,this)),this._markerGroup.addLayer(e),e},_createMiddleMarker(t,e){if(!t||!e)return!1;let i=L.PM.Utils.calcMiddleLatLng(this._map,t.getLatLng(),e.getLatLng()),r=this._createMarker(i),n=L.divIcon({className:"marker-icon marker-icon-middle"});return r.setIcon(n),r.leftM=t,r.rightM=e,t._middleMarkerNext=r,e._middleMarkerPrev=r,r.on(this.options.addVertexOn,this._onMiddleMarkerClick,this),r.on("movestart",this._onMiddleMarkerMoveStart,this),r},_onMiddleMarkerClick(t){let e=t.target;if(!this._vertexValidation("add",t))return;let i=L.divIcon({className:"marker-icon"});e.setIcon(i),this._addMarker(e,e.leftM,e.rightM)},_onMiddleMarkerMoveStart(t){let e=t.target;if(e.on("moveend",this._onMiddleMarkerMoveEnd,this),!this._vertexValidation("add",t)){e.on("move",this._onMiddleMarkerMovePrevent,this);return}e._dragging=!0,this._addMarker(e,e.leftM,e.rightM)},_onMiddleMarkerMovePrevent(t){let e=t.target;this._vertexValidationDrag(e)},_onMiddleMarkerMoveEnd(t){let e=t.target;if(e.off("move",this._onMiddleMarkerMovePrevent,this),e.off("moveend",this._onMiddleMarkerMoveEnd,this),!this._vertexValidationDragEnd(e))return;let i=L.divIcon({className:"marker-icon"});e.setIcon(i),setTimeout(()=>{delete e._dragging},100)},_addMarker(t,e,i){t.off("movestart",this._onMiddleMarkerMoveStart,this),t.off(this.options.addVertexOn,this._onMiddleMarkerClick,this);let r=t.getLatLng(),n=this._layer._latlngs;delete t.leftM,delete t.rightM;let{indexPath:s,index:a,parentPath:o}=L.PM.Utils.findDeepMarkerIndex(this._markers,e),h=s.length>1?(0,xt.default)(n,o):n,l=s.length>1?(0,xt.default)(this._markers,o):this._markers;h.splice(a+1,0,r),l.splice(a+1,0,t),this._layer.setLatLngs(n),this.options.hideMiddleMarkers!==!0&&(this._createMiddleMarker(e,t),this._createMiddleMarker(t,i)),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit"),this._fireVertexAdded(t,L.PM.Utils.findDeepMarkerIndex(this._markers,t).indexPath,r),this.options.snappable&&this._initSnappableMarkers()},hasSelfIntersection(){return Wt(this._layer.toGeoJSON(15)).features.length>0},_handleSelfIntersectionOnVertexRemoval(){this._handleLayerStyle(!0)&&(this._layer.setLatLngs(this._coordsBeforeEdit),this._coordsBeforeEdit=null,this._initMarkers())},_handleLayerStyle(t){let e=this._layer,i,r;if(this.options.allowSelfIntersection?i=!1:(r=Wt(this._layer.toGeoJSON(15)),i=r.features.length>0),i){if(!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._updateDisabledMarkerStyle(this._markers,!0),this.isRed)return i;t?this._flashLayer():(e.setStyle({color:"#f00000ff"}),this.isRed=!0),this._fireIntersect(r)}else e.setStyle({color:this.cachedColor}),this.isRed=!1,!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._updateDisabledMarkerStyle(this._markers,!1);return i},_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(t,e){t.forEach(i=>{Array.isArray(i)?this._updateDisabledMarkerStyle(i,e):i._icon&&(e&&!this._checkMarkerAllowedToDrag(i)?L.DomUtil.addClass(i._icon,"vertexmarker-disabled"):L.DomUtil.removeClass(i._icon,"vertexmarker-disabled"))})},_removeMarker(t){let e=t.target;if(!this._vertexValidation("remove",t))return;this.options.allowSelfIntersection||(this._coordsBeforeEdit=Lt(this._layer,this._layer.getLatLngs()));let i=this._layer.getLatLngs(),{indexPath:r,index:n,parentPath:s}=L.PM.Utils.findDeepMarkerIndex(this._markers,e);if(!r)return;let a=r.length>1?(0,xt.default)(i,s):i,o=r.length>1?(0,xt.default)(this._markers,s):this._markers,h=s[s.length-1]>0&&this._layer instanceof L.Polygon;if(!this.options.removeLayerBelowMinVertexCount&&!h&&(a.length<=2||this.isPolygon()&&a.length<=3)){this._flashLayer();return}a.splice(n,1),this._layer.setLatLngs(i),this.isPolygon()&&a.length<=2&&a.splice(0,a.length);let l=!1;if(a.length<=1&&(a.splice(0,a.length),s.length>1&&r.length>1&&(i=_e(i)),this._layer.setLatLngs(i),this._initMarkers(),l=!0),me(i)||this._layer.remove(),i=_e(i),this._layer.setLatLngs(i),this._markers=_e(this._markers),!l&&(o=r.length>1?(0,xt.default)(this._markers,s):this._markers,e._middleMarkerPrev&&(this._markerGroup.removeLayer(e._middleMarkerPrev),this._removeFromCache(e._middleMarkerPrev)),e._middleMarkerNext&&(this._markerGroup.removeLayer(e._middleMarkerNext),this._removeFromCache(e._middleMarkerNext)),this._markerGroup.removeLayer(e),this._removeFromCache(e),o)){let d,f;if(this.isPolygon()?(d=(n+1)%o.length,f=(n+(o.length-1))%o.length):(f=n-1<0?void 0:n-1,d=n+1>=o.length?void 0:n+1),d!==f){let k=o[f],w=o[d];this.options.hideMiddleMarkers!==!0&&this._createMiddleMarker(k,w)}o.splice(n,1)}this._fireEdit(),this._layerEdited=!0,this._fireVertexRemoved(e,r),this._fireChange(this._layer.getLatLngs(),"Edit")},updatePolygonCoordsFromMarkerDrag(t){let e=this._layer.getLatLngs(),i=t.getLatLng(),{indexPath:r,index:n,parentPath:s}=L.PM.Utils.findDeepMarkerIndex(this._markers,t),a=r.length>1?(0,xt.default)(e,s):e;i.alt=a[n].alt,a.splice(n,1,i),this._layer.setLatLngs(e)},_getNeighborMarkers(t){let{indexPath:e,index:i,parentPath:r}=L.PM.Utils.findDeepMarkerIndex(this._markers,t),n=e.length>1?(0,xt.default)(this._markers,r):this._markers,s=(i+1)%n.length,a=(i+(n.length-1))%n.length,o=n[a],h=n[s];return{prevMarker:o,nextMarker:h}},_checkMarkerAllowedToDrag(t){let{prevMarker:e,nextMarker:i}=this._getNeighborMarkers(t),r=L.polyline([e.getLatLng(),t.getLatLng()]),n=L.polyline([t.getLatLng(),i.getLatLng()]),a=Dt(this._layer.toGeoJSON(15),r.toGeoJSON(15)).features.filter(l=>{let d=l.geometry.coordinates,f=L.latLng(d[1],d[0]);return!f.equals(e.getLatLng())&&!f.equals(t.getLatLng())}).length,h=Dt(this._layer.toGeoJSON(15),n.toGeoJSON(15)).features.filter(l=>{let d=l.geometry.coordinates,f=L.latLng(d[1],d[0]);return!f.equals(i.getLatLng())&&!f.equals(t.getLatLng())}).length;return!(a<1&&h<1)},_onMarkerDragStart(t){let e=t.target;if(this._preventRenderingMarkers(!0),this.cachedColor||(this.cachedColor=this._layer.options.color),!this._vertexValidation("move",t))return;let{indexPath:i}=L.PM.Utils.findDeepMarkerIndex(this._markers,e);this._fireMarkerDragStart(t,i),this.options.allowSelfIntersection||(this._coordsBeforeEdit=Lt(this._layer,this._layer.getLatLngs())),!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this.hasSelfIntersection()?this._markerAllowedToDrag=this._checkMarkerAllowedToDrag(e):this._markerAllowedToDrag=null},_onMarkerDrag(t){let e=t.target;if(!this._vertexValidationDrag(e))return;let{indexPath:i,index:r,parentPath:n}=L.PM.Utils.findDeepMarkerIndex(this._markers,e);if(!i)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(e);let s=i.length>1?(0,xt.default)(this._markers,n):this._markers,a=(r+1)%s.length,o=(r+(s.length-1))%s.length,h=e.getLatLng(),l=s[o].getLatLng(),d=s[a].getLatLng();if(e._middleMarkerNext){let f=L.PM.Utils.calcMiddleLatLng(this._map,h,d);e._middleMarkerNext.setLatLng(f)}if(e._middleMarkerPrev){let f=L.PM.Utils.calcMiddleLatLng(this._map,h,l);e._middleMarkerPrev.setLatLng(f)}this.options.allowSelfIntersection||this._handleLayerStyle(),this._fireMarkerDrag(t,i),this._fireChange(this._layer.getLatLngs(),"Edit")},_onMarkerDragEnd(t){let e=t.target;if(this._preventRenderingMarkers(!1),!this._vertexValidationDragEnd(e))return;let{indexPath:i}=L.PM.Utils.findDeepMarkerIndex(this._markers,e),r=!this.options.allowSelfIntersection&&this.hasSelfIntersection();r&&this.options.allowSelfIntersectionEdit&&this._markerAllowedToDrag&&(r=!1);let n=!this.options.allowSelfIntersection&&r;if(this._fireMarkerDragEnd(t,i,n),n){this._layer.setLatLngs(this._coordsBeforeEdit),this._coordsBeforeEdit=null,this._initMarkers(),this.options.snappable&&this._initSnappableMarkers(),this._handleLayerStyle(),this._fireLayerReset(t,i);return}!this.options.allowSelfIntersection&&this.options.allowSelfIntersectionEdit&&this._handleLayerStyle(),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit")},_onVertexClick(t){let e=t.target;if(e._dragging)return;let{indexPath:i}=L.PM.Utils.findDeepMarkerIndex(this._markers,e);this._fireVertexClick(t,i)}});X.Polygon=X.Line.extend({_shape:"Polygon",_checkMarkerAllowedToDrag(t){let{prevMarker:e,nextMarker:i}=this._getNeighborMarkers(t),r=L.polyline([e.getLatLng(),t.getLatLng()]),n=L.polyline([t.getLatLng(),i.getLatLng()]),a=Dt(this._layer.toGeoJSON(15),r.toGeoJSON(15)).features.filter(l=>{let d=l.geometry.coordinates,f=L.latLng(d[1],d[0]);return!f.equals(e.getLatLng())&&!f.equals(t.getLatLng())}).length,h=Dt(this._layer.toGeoJSON(15),n.toGeoJSON(15)).features.filter(l=>{let d=l.geometry.coordinates,f=L.latLng(d[1],d[0]);return!f.equals(i.getLatLng())&&!f.equals(t.getLatLng())}).length;return!(a<1&&h<1)}});X.Rectangle=X.Polygon.extend({_shape:"Rectangle",_initMarkers(){let t=this._map,e=this._findCorners();this._markerGroup&&this._markerGroup.clearLayers(),this._markerGroup=new L.FeatureGroup,this._markerGroup._pmTempLayer=!0,t.addLayer(this._markerGroup),this._markers=[],this._markers[0]=e.map(this._createMarker,this),[this._cornerMarkers]=this._markers,this._layer.getLatLngs()[0].forEach((i,r)=>{let n=this._cornerMarkers.find(s=>s._index===r);n&&n.setLatLng(i)})},applyOptions(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping(),this._addMarkerEvents()},_createMarker(t,e){let i=new L.Marker(t,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(i,"vertexPane"),i._origLatLng=t,i._index=e,i._pmTempLayer=!0,i.on("click",this._onVertexClick,this),this._markerGroup.addLayer(i),i},_addMarkerEvents(){this._markers[0].forEach(t=>{t.on("dragstart",this._onMarkerDragStart,this),t.on("drag",this._onMarkerDrag,this),t.on("dragend",this._onMarkerDragEnd,this),this.options.preventMarkerRemoval||t.on("contextmenu",this._removeMarker,this)})},_removeMarker(){return null},_onMarkerDragStart(t){if(!this._vertexValidation("move",t))return;let e=t.target,i=this._cornerMarkers;e._oppositeCornerLatLng=i.find(n=>n._index===(e._index+2)%4).getLatLng(),e._snapped=!1;let{indexPath:r}=L.PM.Utils.findDeepMarkerIndex(this._markers,e);this._fireMarkerDragStart(t,r)},_onMarkerDrag(t){let e=t.target;if(!this._vertexValidationDrag(e)||e._index===void 0)return;this._adjustRectangleForMarkerMove(e);let{indexPath:i}=L.PM.Utils.findDeepMarkerIndex(this._markers,e);this._fireMarkerDrag(t,i),this._fireChange(this._layer.getLatLngs(),"Edit")},_onMarkerDragEnd(t){let e=t.target;if(!this._vertexValidationDragEnd(e))return;this._cornerMarkers.forEach(r=>{delete r._oppositeCornerLatLng});let{indexPath:i}=L.PM.Utils.findDeepMarkerIndex(this._markers,e);this._fireMarkerDragEnd(t,i),this._fireEdit(),this._layerEdited=!0,this._fireChange(this._layer.getLatLngs(),"Edit")},_adjustRectangleForMarkerMove(t){L.extend(t._origLatLng,t._latlng);let e=L.PM.Utils._getRotatedRectangle(t.getLatLng(),t._oppositeCornerLatLng,this.getAngle(),this._map);this._layer.setLatLngs(e),this._adjustAllMarkers(t),this._layer.redraw()},_adjustAllMarkers(t){let e=this._layer.getLatLngs()[0];if(e&&e.length!==4&&e.length>0)e.forEach((r,n)=>{this._cornerMarkers[n].setLatLng(r)}),this._cornerMarkers.slice(e.length).forEach(r=>{r.setLatLng(e[0])});else if(!e||!e.length)console.error("The layer has no LatLngs");else{let i=e.findIndex(r=>t.getLatLng().equals(r));i>-1?(this._cornerMarkers[(t._index+1)%4].setLatLng(e[(i+1)%4]),this._cornerMarkers[(t._index+2)%4].setLatLng(e[(i+2)%4]),this._cornerMarkers[(t._index+3)%4].setLatLng(e[(i+3)%4])):this._cornerMarkers.forEach(r=>{r.setLatLng(e[r._index])})}},_findCorners(){this._angle===void 0&&this.setInitAngle(ye(this._map,this._layer.getLatLngs()[0][0],this._layer.getLatLngs()[0][1])||0);let t=this._layer.getLatLngs()[0];return L.PM.Utils._getRotatedRectangle(t[0],t[2],this.getAngle(),this._map||this)}});X.CircleMarker=X.extend({_shape:"CircleMarker",initialize(t){this._layer=t,this._enabled=!1,this._minRadiusOption="minRadiusCircleMarker",this._maxRadiusOption="maxRadiusCircleMarker",this._editableOption="resizeableCircleMarker",this._updateHiddenPolyCircle()},enable(t={draggable:!0,snappable:!0}){if(L.Util.setOptions(this,t),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(t){this.enabled()?this.disable():this.enable(t)},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 t=this._map;this._helperLayers&&(this._helperLayers.removeFrom(t),this._helperLayers.clearLayers()),this._helperLayers=new L.FeatureGroup,this._helperLayers._pmTempLayer=!0,this._helperLayers.addTo(t);let e=this._layer.getLatLng(),i=this._layer._radius,r=this._getLatLngOnCircle(e,i);this._centerMarker=this._createCenterMarker(e),this._outerMarker=this._createOuterMarker(r),this._markers=[this._centerMarker,this._outerMarker],this._createHintLine(this._centerMarker,this._outerMarker)},_getLatLngOnCircle(t,e){let i=this._map.project(t),r=L.point(i.x+e,i.y);return this._map.unproject(r)},_createHintLine(t,e){let i=t.getLatLng(),r=e.getLatLng();this._hintline=L.polyline([i,r],this.options.hintlineStyle),this._setPane(this._hintline,"layerPane"),this._hintline._pmTempLayer=!0,this._helperLayers.addLayer(this._hintline)},_createCenterMarker(t){let e=this._createMarker(t);return this.options.draggable?(L.DomUtil.addClass(e._icon,"leaflet-pm-draggable"),e.on("move",this._moveCircle,this)):e.dragging.disable(),e},_createOuterMarker(t){let e=this._createMarker(t);return e.on("drag",this._resizeCircle,this),e},_createMarker(t){let e=new L.Marker(t,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return this._setPane(e,"vertexPane"),e._origLatLng=t,e._pmTempLayer=!0,e.on("dragstart",this._onMarkerDragStart,this),e.on("drag",this._onMarkerDrag,this),e.on("dragend",this._onMarkerDragEnd,this),e.on("click",this._onVertexClick,this),this._helperLayers.addLayer(e),e},_moveCircle(t){if(t.target._cancelDragEventChain)return;let i=this._centerMarker.getLatLng();this._layer.setLatLng(i);let r=this._layer._radius,n=this._getLatLngOnCircle(i,r);this._outerMarker._latlng=n,this._outerMarker.update(),this._syncHintLine(),this._updateHiddenPolyCircle(),this._fireCenterPlaced("Edit"),this._fireChange(this._layer.getLatLng(),"Edit")},_syncMarkers(){let t=this._layer.getLatLng(),e=this._layer._radius,i=this._getLatLngOnCircle(t,e);this._outerMarker.setLatLng(i),this._centerMarker.setLatLng(t),this._syncHintLine(),this._updateHiddenPolyCircle()},_resizeCircle(){this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker()),this._syncHintLine(),this._syncCircleRadius()},_syncCircleRadius(){let t=this._centerMarker.getLatLng(),e=this._outerMarker.getLatLng(),i=this._distanceCalculation(t,e);this.options[this._minRadiusOption]&&i<this.options[this._minRadiusOption]?this._layer.setRadius(this.options[this._minRadiusOption]):this.options[this._maxRadiusOption]&&i>this.options[this._maxRadiusOption]?this._layer.setRadius(this.options[this._maxRadiusOption]):this._layer.setRadius(i),this._updateHiddenPolyCircle(),this._fireChange(this._layer.getLatLng(),"Edit")},_syncHintLine(){let t=this._centerMarker.getLatLng(),e=this._outerMarker.getLatLng();this._hintline.setLatLngs([t,e])},_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(t){this._vertexValidation("move",t)&&this._fireMarkerDragStart(t)},_onMarkerDrag(t){let e=t.target;e instanceof L.Marker&&!this._vertexValidationDrag(e)||this._fireMarkerDrag(t)},_onMarkerDragEnd(t){this._extedingMarkerDragEnd();let e=t.target;this._vertexValidationDragEnd(e)&&(this.options[this._editableOption]&&(this._fireEdit(),this._layerEdited=!0),this._fireMarkerDragEnd(t))},_extedingMarkerDragEnd(){this._map.pm.Draw.CircleMarker._layerIsDragging=!1},_initSnappableMarkersDrag(){let t=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=this.options.snapSegment===void 0?!0:this.options.snapSegment,t.off("pm:drag",this._handleSnapping,this),t.on("pm:drag",this._handleSnapping,this),t.off("pm:dragend",this._cleanupSnapping,this),t.on("pm:dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this),t.on("pm:dragstart",this._unsnap,this)},_disableSnappingDrag(){let t=this._layer;t.off("pm:drag",this._handleSnapping,this),t.off("pm:dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this)},_updateHiddenPolyCircle(){let t=this._layer._map||this._map;if(t){let e=L.PM.Utils.pxRadiusToMeterRadius(this._layer.getRadius(),t,this._layer.getLatLng()),i=L.circle(this._layer.getLatLng(),this._layer.options);i.setRadius(e);let r=t&&t.pm._isCRSSimple();this._hiddenPolyCircle?this._hiddenPolyCircle.setLatLngs(L.PM.Utils.circleToPolygon(i,200,!r).getLatLngs()):this._hiddenPolyCircle=L.PM.Utils.circleToPolygon(i,200,!r),this._hiddenPolyCircle._parentCopy||(this._hiddenPolyCircle._parentCopy=this._layer)}},_getNewDestinationOfOuterMarker(){let t=this._centerMarker.getLatLng(),e=this._outerMarker.getLatLng(),i=this._distanceCalculation(t,e);return this.options[this._minRadiusOption]&&i<this.options[this._minRadiusOption]?e=Zt(this._map,t,e,this._getMinDistanceInMeter(t)):this.options[this._maxRadiusOption]&&i>this.options[this._maxRadiusOption]&&(e=Zt(this._map,t,e,this._getMaxDistanceInMeter(t))),e},_handleOuterMarkerSnapping(){if(this._outerMarker._snapped){let t=this._centerMarker.getLatLng(),e=this._outerMarker.getLatLng(),i=this._distanceCalculation(t,e);this.options[this._minRadiusOption]&&i<this.options[this._minRadiusOption]?this._outerMarker.setLatLng(this._outerMarker._orgLatLng):this.options[this._maxRadiusOption]&&i>this.options[this._maxRadiusOption]&&this._outerMarker.setLatLng(this._outerMarker._orgLatLng)}this._outerMarker.setLatLng(this._getNewDestinationOfOuterMarker())},_distanceCalculation(t,e){return this._map.project(t).distanceTo(this._map.project(e))},_getMinDistanceInMeter(t){return L.PM.Utils.pxRadiusToMeterRadius(this.options[this._minRadiusOption],this._map,t)},_getMaxDistanceInMeter(t){return L.PM.Utils.pxRadiusToMeterRadius(this.options[this._maxRadiusOption],this._map,t)},_onVertexClick(t){t.target._dragging||this._fireVertexClick(t,void 0)}});X.Circle=X.CircleMarker.extend({_shape:"Circle",initialize(t){this._layer=t,this._enabled=!1,this._minRadiusOption="minRadiusCircle",this._maxRadiusOption="maxRadiusCircle",this._editableOption="resizeableCircle",this._updateHiddenPolyCircle()},enable(t){L.PM.Edit.CircleMarker.prototype.enable.call(this,t||{})},_extendingEnable(){},_extendingDisable(){this._layer.off("remove",this.disable,this);let t=this._layer._path?this._layer._path:this._layer._renderer._container;L.DomUtil.removeClass(t,"leaflet-pm-draggable")},_extendingApplyOptions(){},_syncMarkers(){},_removeMarker(){},_onDragStart(){},_extedingMarkerDragEnd(){},_updateHiddenPolyCircle(){let t=this._map&&this._map.pm._isCRSSimple();this._hiddenPolyCircle?this._hiddenPolyCircle.setLatLngs(L.PM.Utils.circleToPolygon(this._layer,200,!t).getLatLngs()):this._hiddenPolyCircle=L.PM.Utils.circleToPolygon(this._layer,200,!t),this._hiddenPolyCircle._parentCopy||(this._hiddenPolyCircle._parentCopy=this._layer)},_distanceCalculation(t,e){return this._map.distance(t,e)},_getMinDistanceInMeter(){return this.options[this._minRadiusOption]},_getMaxDistanceInMeter(){return this.options[this._maxRadiusOption]},_onVertexClick(t){t.target._dragging||this._fireVertexClick(t,void 0)}});X.ImageOverlay=X.extend({_shape:"ImageOverlay",initialize(t){this._layer=t,this._enabled=!1},toggleEdit(t){this.enabled()?this.disable():this.enable(t)},enabled(){return this._enabled},enable(t={draggable:!0,snappable:!0}){if(L.Util.setOptions(this,t),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 t=this._layer.getBounds(),e=t.getNorthWest(),i=t.getNorthEast(),r=t.getSouthEast(),n=t.getSouthWest();return[e,i,r,n]}});X.Text=X.extend({_shape:"Text",initialize(t){this._layer=t,this._enabled=!1},enable(t){if(L.Util.setOptions(this,t),!!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 t=document.activeElement;this.textArea.focus(),this.textArea.selectionStart=0,this.textArea.selectionEnd=0,L.DomEvent.on(this.textArea,"mousedown",this._preventTextSelection),t.focus(),this._disableOnBlurActive=!1,this._layerEdited&&this._fireUpdate(),this._layerEdited=!1,this._fireDisable(),this._enabled=!1},enabled(){return this._enabled},toggleEdit(t){this.enabled()?this.disable():this.enable(t)},applyOptions(){this.options.snappable?this._initSnappableMarkers():this._disableSnapping()},_initSnappableMarkers(){let t=this._layer;this.options.snapDistance=this.options.snapDistance||30,this.options.snapSegment=this.options.snapSegment===void 0?!0:this.options.snapSegment,t.off("pm:drag",this._handleSnapping,this),t.on("pm:drag",this._handleSnapping,this),t.off("pm:dragend",this._cleanupSnapping,this),t.on("pm:dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this),t.on("pm:dragstart",this._unsnap,this)},_disableSnapping(){let t=this._layer;t.off("pm:drag",this._handleSnapping,this),t.off("pm:dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this)},_autoResize(){this.textArea.style.height="1px",this.textArea.style.width="1px";let t=this.textArea.scrollHeight>21?this.textArea.scrollHeight:21,e=this.textArea.scrollWidth>16?this.textArea.scrollWidth:16;this.textArea.style.height=`${t}px`,this.textArea.style.width=`${e}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(t){t.target!==this.textArea&&(this.disable(),!this.getText()&&this.options.removeIfEmpty&&this.remove())},_focusChange(t={}){let e=this._hasFocus;this._hasFocus=t.type==="focus",!e!=!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(t){t&&(this.textArea.value=t),this._autoResize()},getText(){return this.textArea.value},_initTextMarker(){if(this.textArea=L.PM.Draw.Text.prototype._createTextArea.call(this),this.options.className){let e=this.options.className.split(" ");this.textArea.classList.add(...e)}let t=L.PM.Draw.Text.prototype._createTextIcon.call(this,this.textArea);this._layer.setIcon(t),this._layer.once("add",this._createTextMarker,this)},_createTextMarker(t=!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(),t===!0&&(this.enable(),this.focus(),this._disableOnBlur())},_preventTextSelection(t){t.preventDefault()}});var Xi=function(e,i,r,n,s,a){this._matrix=[e,i,r,n,s,a]};Xi.init=()=>new L.PM.Matrix(1,0,0,1,0,0);Xi.prototype={transform(t){return this._transform(t.clone())},_transform(t){let e=this._matrix,{x:i,y:r}=t;return t.x=e[0]*i+e[1]*r+e[4],t.y=e[2]*i+e[3]*r+e[5],t},untransform(t){let e=this._matrix;return new L.Point((t.x/e[0]-e[4])/e[0],(t.y/e[2]-e[5])/e[2])},clone(){let t=this._matrix;return new L.PM.Matrix(t[0],t[1],t[2],t[3],t[4],t[5])},translate(t){if(t===void 0)return new L.Point(this._matrix[4],this._matrix[5]);let e,i;return typeof t=="number"?(e=t,i=t):(e=t.x,i=t.y),this._add(1,0,0,1,e,i)},scale(t,e){if(t===void 0)return new L.Point(this._matrix[0],this._matrix[3]);let i,r;return e=e||L.point(0,0),typeof t=="number"?(i=t,r=t):(i=t.x,r=t.y),this._add(i,0,0,r,e.x,e.y)._add(1,0,0,1,-e.x,-e.y)},rotate(t,e){let i=Math.cos(t),r=Math.sin(t);return e=e||new L.Point(0,0),this._add(i,r,-r,i,e.x,e.y)._add(1,0,0,1,-e.x,-e.y)},flip(){return this._matrix[1]*=-1,this._matrix[2]*=-1,this},_add(t,e,i,r,n,s){let a=[[],[],[]],o=this._matrix,h=[[o[0],o[2],o[4]],[o[1],o[3],o[5]],[0,0,1]],l=[[t,i,n],[e,r,s],[0,0,1]],d;t&&t instanceof L.PM.Matrix&&(o=t._matrix,l=[[o[0],o[2],o[4]],[o[1],o[3],o[5]],[0,0,1]]);for(let f=0;f<3;f+=1)for(let k=0;k<3;k+=1){d=0;for(let w=0;w<3;w+=1)d+=h[f][w]*l[w][k];a[f][k]=d}return this._matrix=[a[0][0],a[1][0],a[0][1],a[1][1],a[0][2],a[1][2]],this}};var Dl=Xi;var u_={calcMiddleLatLng(t,e,i){let r=t.project(e),n=t.project(i);return t.unproject(r._add(n)._divideBy(2))},findLayers(t){let e=[];return t.eachLayer(i=>{(i instanceof L.Polyline||i instanceof L.Marker||i instanceof L.Circle||i instanceof L.CircleMarker||i instanceof L.ImageOverlay)&&e.push(i)}),e=e.filter(i=>!!i.pm),e=e.filter(i=>!i._pmTempLayer),e=e.filter(i=>!L.PM.optIn&&!i.options.pmIgnore||L.PM.optIn&&i.options.pmIgnore===!1),e},circleToPolygon(t,e=60,i=!0){let r=t.getLatLng(),n=t.getRadius(),s=bi(r,n,e,0,i),a=[];for(let o=0;o<s.length;o+=1){let h=[s[o].lat,s[o].lng];a.push(h)}return L.polygon(a,t.options)},disablePopup(t){t.getPopup()&&(t._tempPopupCopy=t.getPopup(),t.unbindPopup())},enablePopup(t){t._tempPopupCopy&&(t.bindPopup(t._tempPopupCopy),delete t._tempPopupCopy)},_fireEvent(t,e,i,r=!1){t.fire(e,i,r);let{groups:n}=this.getAllParentGroups(t);n.forEach(s=>{s.fire(e,i,r)})},getAllParentGroups(t){let e=[],i=[],r=n=>{for(let s in n._eventParents)if(e.indexOf(s)===-1){e.push(s);let a=n._eventParents[s];i.push(a),r(a)}};return!t._pmLastGroupFetch||!t._pmLastGroupFetch.time||new Date().getTime()-t._pmLastGroupFetch.time>1e3?(r(t),t._pmLastGroupFetch={time:new Date().getTime(),groups:i,groupIds:e},{groupIds:e,groups:i}):{groups:t._pmLastGroupFetch.groups,groupIds:t._pmLastGroupFetch.groupIds}},createGeodesicPolygon:bi,getTranslation:F,findDeepCoordIndex(t,e,i=!0){let r,n=a=>(o,h)=>{let l=a.concat(h);if(i){if(o.lat&&o.lat===e.lat&&o.lng===e.lng)return r=l,!0}else if(o.lat&&L.latLng(o).equals(e))return r=l,!0;return Array.isArray(o)&&o.some(n(l))};t.some(n([]));let s={};return r&&(s={indexPath:r,index:r[r.length-1],parentPath:r.slice(0,r.length-1)}),s},findDeepMarkerIndex(t,e){let i,r=s=>(a,o)=>{let h=s.concat(o);return a._leaflet_id===e._leaflet_id?(i=h,!0):Array.isArray(a)&&a.some(r(h))};t.some(r([]));let n={};return i&&(n={indexPath:i,index:i[i.length-1],parentPath:i.slice(0,i.length-1)}),n},_getIndexFromSegment(t,e){if(e&&e.length===2){let i=this.findDeepCoordIndex(t,e[0]),r=this.findDeepCoordIndex(t,e[1]),n=Math.max(i.index,r.index);return(i.index===0||r.index===0)&&n!==1&&(n+=1),{indexA:i,indexB:r,newIndex:n,indexPath:i.indexPath,parentPath:i.parentPath}}return null},_getRotatedRectangle(t,e,i,r){let n=Ot(r,t),s=Ot(r,e),a=i*Math.PI/180,o=Math.cos(a),h=Math.sin(a),l=(s.x-n.x)*o+(s.y-n.y)*h,d=(s.y-n.y)*o-(s.x-n.x)*h,f=l*o+n.x,k=l*h+n.y,w=-d*h+n.x,S=d*o+n.y,A=Ee(r,n),g=Ee(r,{x:f,y:k}),M=Ee(r,s),m=Ee(r,{x:w,y:S});return[A,g,M,m]},pxRadiusToMeterRadius(t,e,i){let r=e.project(i),n=L.point(r.x+t,r.y);return e.distance(e.unproject(n),i)}},Rl=u_;L.PM=L.PM||{version:Ji.version,Map:Do,Toolbar:Oo,Draw:Y,Edit:X,Utils:Rl,Matrix:Dl,activeLang:"en",optIn:!1,initialize(t){this.addInitHooks(t)},setOptIn(t){this.optIn=!!t},addInitHooks(){function t(){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(t);function e(){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(e);function i(){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(i);function r(){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(r);function n(){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(n);function s(){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(s);function a(){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(a);function o(){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(o);function h(){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(h)},reInitLayer(t){t instanceof L.LayerGroup&&t.eachLayer(e=>{this.reInitLayer(e)}),t.pm||L.PM.optIn&&t.options.pmIgnore!==!1||t.options.pmIgnore||(t instanceof L.Map?t.pm=new L.PM.Map(t):t instanceof L.Marker?t.options.textMarker?(t.pm=new L.PM.Edit.Text(t),t.pm._initTextMarker(),t.pm._createTextMarker(!1)):t.pm=new L.PM.Edit.Marker(t):t instanceof L.Circle?t.pm=new L.PM.Edit.Circle(t):t instanceof L.CircleMarker?t.pm=new L.PM.Edit.CircleMarker(t):t instanceof L.Rectangle?t.pm=new L.PM.Edit.Rectangle(t):t instanceof L.Polygon?t.pm=new L.PM.Edit.Polygon(t):t instanceof L.Polyline?t.pm=new L.PM.Edit.Line(t):t instanceof L.LayerGroup?t.pm=new L.PM.Edit.LayerGroup(t):t instanceof L.ImageOverlay&&(t.pm=new L.PM.Edit.ImageOverlay(t)))}};L.version==="1.7.1"&&L.Canvas.include({_onClick(t){let e=this._map.mouseEventToLayerPoint(t),i,r;for(let n=this._drawFirst;n;n=n.next)i=n.layer,i.options.interactive&&i._containsPoint(e)&&(!(t.type==="click"||t.type==="preclick")||!this._map._draggableMoved(i))&&(r=i);r&&(L.DomEvent.fakeStop(t),this._fireEvent([r],t))}});L.PM.initialize();})();