gaussian-id 2.34.1 → 2.34.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/iD.min.js CHANGED
@@ -1,4 +1,4 @@
1
- var DZ=Object.create;var ff=Object.defineProperty;var PZ=Object.getOwnPropertyDescriptor;var FZ=Object.getOwnPropertyNames;var OZ=Object.getPrototypeOf,RZ=Object.prototype.hasOwnProperty;var LZ=(e,t,r)=>t in e?ff(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var DC=e=>t=>{var r=e[t];if(r)return r();throw new Error("Module not found in bundle: "+t)};var q=(e,t)=>()=>(e&&(t=e(e=0)),t);var an=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),j=(e,t)=>{for(var r in t)ff(e,r,{get:t[r],enumerable:!0})},UZ=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of FZ(t))!RZ.call(e,i)&&i!==r&&ff(e,i,{get:()=>t[i],enumerable:!(n=PZ(t,i))||n.enumerable});return e};var or=(e,t,r)=>(r=e!=null?DZ(OZ(e)):{},UZ(t||!e||!e.__esModule?ff(r,"default",{value:e,enumerable:!0}):r,e));var Ge=(e,t,r)=>LZ(e,typeof t!="symbol"?t+"":t,r);var PC={};j(PC,{actionAddEntity:()=>In});function In(e){return function(t){return t.replace(e)}}var Xl=q(()=>{"use strict"});var FC={};j(FC,{actionReverse:()=>Ji});function Ji(e,t){var r=/^([+\-]?)(?=[\d.])/,n=/direction$/,i=[[/:right$/,":left"],[/:left$/,":right"],[/:forward$/,":backward"],[/:backward$/,":forward"],[/:right:/,":left:"],[/:left:/,":right:"],[/:forward:/,":backward:"],[/:backward:/,":forward:"]],a={left:"right",right:"left",up:"down",down:"up",forward:"backward",backward:"forward",forwards:"backward",backwards:"forward"};let o=[/^red_turn:(right|left):?/],s=[{keyRegex:/^.*(_|:)?(description|name|note|website|ref|source|comment|watch|attribution)(_|:)?/,prerequisiteTags:[{}]},{keyRegex:/^turn:lanes:?/,prerequisiteTags:[{}]},{keyRegex:/^side$/,prerequisiteTags:[{highway:"cyclist_waiting_aid"}]}];var l={forward:"backward",backward:"forward",forwards:"backward",backwards:"forward"},u={yes:"-1",1:"-1","-1":"yes"},c={N:"S",NNE:"SSW",NE:"SW",ENE:"WSW",E:"W",ESE:"WNW",SE:"NW",SSE:"NNW",S:"N",SSW:"NNE",SW:"NE",WSW:"ENE",W:"E",WNW:"ESE",NW:"SE",NNW:"SSE"};function f(A){if(o.some(w=>w.test(A)))return A;for(var v=0;v<i.length;++v){var _=i[v];if(_[0].test(A))return A.replace(_[0],_[1])}return A}function d(A,v,_,w){for(let{keyRegex:k,prerequisiteTags:x}of s)if(k.test(A)&&x.some(S=>Object.entries(S).every(([I,b])=>w[I]&&(b==="*"||w[I]===b))))return v;return A==="incline"&&r.test(v)?v.replace(r,function(k,x){return x==="-"?"":"-"}):t&&t.reverseOneway&&A==="oneway"?u[v]||v:_&&n.test(A)?v.split(";").map(k=>{if(c[k])return c[k];var x=Number(k);return isFinite(x)?(x<180?x+=180:x-=180,x.toString()):a[k]||k}).join(";"):a[v]||v}function m(A,v){for(var _=0;_<v.length;_++){var w=A.hasEntity(v[_]);if(!(!w||!Object.keys(w.tags).length)){var k={};for(var x in w.tags)k[f(x)]=d(x,w.tags[x],w.id===e,w.tags);A=A.replace(w.update({tags:k}))}}return A}function h(A,v){var _=v.nodes.slice().reverse(),w={},k;for(var x in v.tags)w[f(x)]=d(x,v.tags[x],!1,v.tags);return A.parentRelations(v).forEach(function(S){S.members.forEach(function(I,b){I.id===v.id&&(k=l[I.role])&&(S=S.updateMember({role:k},b),A=A.replace(S))})}),m(A,_).replace(v.update({nodes:_,tags:w}))}var g=function(A){var v=A.entity(e);return v.type==="way"?h(A,v):m(A,[e])};return g.disabled=function(A){var v=A.hasEntity(e);if(!v||v.type==="way")return!1;for(var _ in v.tags){var w=v.tags[_];if(f(_)!==_||d(_,w,!0,v.tags)!==w)return!1}return"nondirectional_node"},g.entityID=function(){return e},g}var c4=q(()=>{"use strict"});function Ni(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}var V6=q(()=>{});function f4(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}var vy=q(()=>{});function Zl(e){let t,r,n;e.length!==2?(t=Ni,r=(s,l)=>Ni(e(s),l),n=(s,l)=>e(s)-l):(t=e===Ni||e===f4?e:BZ,r=e,n=e);function i(s,l,u=0,c=s.length){if(u<c){if(t(l,l)!==0)return c;do{let f=u+c>>>1;r(s[f],l)<0?u=f+1:c=f}while(u<c)}return u}function a(s,l,u=0,c=s.length){if(u<c){if(t(l,l)!==0)return c;do{let f=u+c>>>1;r(s[f],l)<=0?u=f+1:c=f}while(u<c)}return u}function o(s,l,u=0,c=s.length){let f=i(s,l,u,c-1);return f>u&&n(s[f-1],l)>-n(s[f],l)?f-1:f}return{left:i,center:o,right:a}}function BZ(){return 0}var yy=q(()=>{V6();vy()});function df(e){return e===null?NaN:+e}function*OC(e,t){if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(yield r);else{let r=-1;for(let n of e)(n=t(n,++r,e))!=null&&(n=+n)>=n&&(yield n)}}var by=q(()=>{});var RC,LC,zZ,qZ,$6,UC=q(()=>{V6();yy();by();RC=Zl(Ni),LC=RC.right,zZ=RC.left,qZ=Zl(df).center,$6=LC});var on,BC=q(()=>{on=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){let r=this._partials,n=0;for(let i=0;i<this._n&&i<32;i++){let a=r[i],o=t+a,s=Math.abs(t)<Math.abs(a)?t-(o-a):a-(o-t);s&&(r[n++]=s),t=o}return r[n]=t,this._n=n+1,this}valueOf(){let t=this._partials,r=this._n,n,i,a,o=0;if(r>0){for(o=t[--r];r>0&&(n=o,i=t[--r],o=n+i,a=i-(o-n),!a););r>0&&(a<0&&t[r-1]<0||a>0&&t[r-1]>0)&&(i=a*2,n=o+i,i==n-o&&(o=n))}return o}}});function zC(e=Ni){if(e===Ni)return wy;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{let n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function wy(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var qC=q(()=>{V6()});function pf(e,t,r){let n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=VZ?10:a>=$Z?5:a>=GZ?2:1,s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(e*u),l=Math.round(t*u),s/u<e&&++s,l/u>t&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(e/u),l=Math.round(t/u),s*u<e&&++s,l*u>t&&--l),l<s&&.5<=r&&r<2?pf(e,t,r*2):[s,l,u]}function mf(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];let n=t<e,[i,a,o]=n?pf(t,e,r):pf(e,t,r);if(!(a>=i))return[];let s=a-i+1,l=new Array(s);if(n)if(o<0)for(let u=0;u<s;++u)l[u]=(a-u)/-o;else for(let u=0;u<s;++u)l[u]=(a-u)*o;else if(o<0)for(let u=0;u<s;++u)l[u]=(i+u)/-o;else for(let u=0;u<s;++u)l[u]=(i+u)*o;return l}function G6(e,t,r){return t=+t,e=+e,r=+r,pf(e,t,r)[2]}function xy(e,t,r){t=+t,e=+e,r=+r;let n=t<e,i=n?G6(t,e,r):G6(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}var VZ,$Z,GZ,VC=q(()=>{VZ=Math.sqrt(50),$Z=Math.sqrt(10),GZ=Math.sqrt(2)});function hf(e,t){let r;if(t===void 0)for(let n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}return r}var $C=q(()=>{});function gf(e,t){let r;if(t===void 0)for(let n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}var GC=q(()=>{});function vf(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?wy:zC(i);n>r;){if(n-r>600){let l=n-r+1,u=t-r+1,c=Math.log(l),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(l-f)/l)*(u-l/2<0?-1:1),m=Math.max(r,Math.floor(t-u*f/l+d)),h=Math.min(n,Math.floor(t+(l-u)*f/l+d));vf(e,t,m,h,i)}let a=e[t],o=r,s=n;for(W6(e,r,t),i(e[n],a)>0&&W6(e,r,n);o<s;){for(W6(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[r],a)===0?W6(e,r,s):(++s,W6(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function W6(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}var WC=q(()=>{qC()});function _y(e,t,r){if(e=Float64Array.from(OC(e,r)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return gf(e);if(t>=1)return hf(e);var n,i=(n-1)*t,a=Math.floor(i),o=hf(vf(e,a).subarray(0,a+1)),s=gf(e.subarray(a+1));return o+(s-o)*(i-a)}}var QC=q(()=>{$C();GC();WC();by()});function yf(e,t){return _y(e,.5,t)}var HC=q(()=>{QC()});function*WZ(e){for(let t of e)yield*t}function C0(e){return Array.from(WZ(e))}var jC=q(()=>{});function bf(e,t=QZ){let r=[],n,i=!1;for(let a of e)i&&r.push(t(n,a)),n=a,i=!0;return r}function QZ(e,t){return[e,t]}var YC=q(()=>{});function d4(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n<i;)a[n]=e+n*r;return a}var KC=q(()=>{});var bn=q(()=>{UC();V6();yy();vy();BC();HC();jC();YC();KC();VC()});function rI(e){return e>1?0:e<-1?Gt:Math.acos(e)}function ps(e){return e>1?Wn:e<-1?-Wn:Math.asin(e)}var $t,XC,Gt,Wn,I0,wn,sn,Ut,Zt,wf,Ca,Wt,ZC,JC,Jt,eI,Di,tI,ln=q(()=>{$t=1e-6,XC=1e-12,Gt=Math.PI,Wn=Gt/2,I0=Gt/4,wn=Gt*2,sn=180/Gt,Ut=Gt/180,Zt=Math.abs,wf=Math.atan,Ca=Math.atan2,Wt=Math.cos,ZC=Math.exp,JC=Math.log,Jt=Math.sin,eI=Math.sign||function(e){return e>0?1:e<0?-1:0},Di=Math.sqrt,tI=Math.tan});function _r(){}var p4=q(()=>{});function xf(e,t){e&&iI.hasOwnProperty(e.type)&&iI[e.type](e,t)}function ky(e,t,r){var n=-1,i=e.length-r,a;for(t.lineStart();++n<i;)a=e[n],t.point(a[0],a[1],a[2]);t.lineEnd()}function aI(e,t){var r=-1,n=e.length;for(t.polygonStart();++r<n;)ky(e[r],t,1);t.polygonEnd()}function ai(e,t){e&&nI.hasOwnProperty(e.type)?nI[e.type](e,t):xf(e,t)}var nI,iI,Jl=q(()=>{nI={Feature:function(e,t){xf(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,n=-1,i=r.length;++n<i;)xf(r[n].geometry,t)}},iI={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)e=r[n],t.point(e[0],e[1],e[2])},LineString:function(e,t){ky(e.coordinates,t,0)},MultiLineString:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)ky(r[n],t,0)},Polygon:function(e,t){aI(e.coordinates,t)},MultiPolygon:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)aI(r[n],t)},GeometryCollection:function(e,t){for(var r=e.geometries,n=-1,i=r.length;++n<i;)xf(r[n],t)}}});function HZ(){Bo.point=YZ}function jZ(){lI(oI,sI)}function YZ(e,t){Bo.point=lI,oI=e,sI=t,e*=Ut,t*=Ut,Ey=e,Ay=Wt(t=t/2+I0),Sy=Jt(t)}function lI(e,t){e*=Ut,t*=Ut,t=t/2+I0;var r=e-Ey,n=r>=0?1:-1,i=n*r,a=Wt(t),o=Jt(t),s=Sy*o,l=Ay*a+s*Wt(i),u=s*n*Jt(i);Q6.add(Ca(u,l)),Ey=e,Ay=a,Sy=o}function g1(e){return _f=new on,ai(e,Bo),_f*2}var Q6,_f,oI,sI,Ey,Ay,Sy,Bo,Cy=q(()=>{bn();ln();p4();Jl();Q6=new on,_f=new on,Bo={point:_r,lineStart:_r,lineEnd:_r,polygonStart:function(){Q6=new on,Bo.lineStart=HZ,Bo.lineEnd=jZ},polygonEnd:function(){var e=+Q6;_f.add(e<0?wn+e:e),this.lineStart=this.lineEnd=this.point=_r},sphere:function(){_f.add(wn)}}});function e2(e){return[Ca(e[1],e[0]),ps(e[2])]}function ro(e){var t=e[0],r=e[1],n=Wt(r);return[n*Wt(t),n*Jt(t),Jt(r)]}function H6(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ms(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function kf(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function j6(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function t2(e){var t=Di(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var M0=q(()=>{ln()});function Iy(e,t){m4.push(gs=[jr=e,un=e]),t<ea&&(ea=t),t>Ma&&(Ma=t)}function mI(e,t){var r=ro([e*Ut,t*Ut]);if(T0){var n=ms(T0,r),i=[n[1],-n[0],0],a=ms(i,n);t2(a),a=e2(a);var o=e-r2,s=o>0?1:-1,l=a[0]*sn*s,u,c=Zt(o)>180;c^(s*r2<l&&l<s*e)?(u=a[1]*sn,u>Ma&&(Ma=u)):(l=(l+360)%360-180,c^(s*r2<l&&l<s*e)?(u=-a[1]*sn,u<ea&&(ea=u)):(t<ea&&(ea=t),t>Ma&&(Ma=t))),c?e<r2?Ia(jr,e)>Ia(jr,un)&&(un=e):Ia(e,un)>Ia(jr,un)&&(jr=e):un>=jr?(e<jr&&(jr=e),e>un&&(un=e)):e>r2?Ia(jr,e)>Ia(jr,un)&&(un=e):Ia(e,un)>Ia(jr,un)&&(jr=e)}else m4.push(gs=[jr=e,un=e]);t<ea&&(ea=t),t>Ma&&(Ma=t),T0=r,r2=e}function uI(){hs.point=mI}function cI(){gs[0]=jr,gs[1]=un,hs.point=Iy,T0=null}function hI(e,t){if(T0){var r=e-r2;Y6.add(Zt(r)>180?r+(r>0?360:-360):r)}else dI=e,pI=t;Bo.point(e,t),mI(e,t)}function KZ(){Bo.lineStart()}function XZ(){hI(dI,pI),Bo.lineEnd(),Zt(Y6)>$t&&(jr=-(un=180)),gs[0]=jr,gs[1]=un,T0=null}function Ia(e,t){return(t-=e)<0?t+360:t}function ZZ(e,t){return e[0]-t[0]}function fI(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function N0(e){var t,r,n,i,a,o,s;if(Ma=un=-(jr=ea=1/0),m4=[],ai(e,hs),r=m4.length){for(m4.sort(ZZ),t=1,n=m4[0],a=[n];t<r;++t)i=m4[t],fI(n,i[0])||fI(n,i[1])?(Ia(n[0],i[1])>Ia(n[0],n[1])&&(n[1]=i[1]),Ia(i[0],n[1])>Ia(n[0],n[1])&&(n[0]=i[0])):a.push(n=i);for(o=-1/0,r=a.length-1,t=0,n=a[r];t<=r;n=i,++t)i=a[t],(s=Ia(n[1],i[0]))>o&&(o=s,jr=i[0],un=n[1])}return m4=gs=null,jr===1/0||ea===1/0?[[NaN,NaN],[NaN,NaN]]:[[jr,ea],[un,Ma]]}var jr,ea,un,Ma,r2,dI,pI,T0,Y6,m4,gs,hs,gI=q(()=>{bn();Cy();M0();ln();Jl();hs={point:Iy,lineStart:uI,lineEnd:cI,polygonStart:function(){hs.point=hI,hs.lineStart=KZ,hs.lineEnd=XZ,Y6=new on,Bo.polygonStart()},polygonEnd:function(){Bo.polygonEnd(),hs.point=Iy,hs.lineStart=uI,hs.lineEnd=cI,Q6<0?(jr=-(un=180),ea=-(Ma=90)):Y6>$t?Ma=90:Y6<-$t&&(ea=-90),gs[0]=jr,gs[1]=un},sphere:function(){jr=-(un=180),ea=-(Ma=90)}}});function K6(e,t){function r(n,i){return n=e(n,i),t(n[0],n[1])}return e.invert&&t.invert&&(r.invert=function(n,i){return n=t.invert(n,i),n&&e.invert(n[0],n[1])}),r}var My=q(()=>{});function Ty(e,t){return Zt(e)>Gt&&(e-=Math.round(e/wn)*wn),[e,t]}function Ny(e,t,r){return(e%=wn)?t||r?K6(yI(e),bI(t,r)):yI(e):t||r?bI(t,r):Ty}function vI(e){return function(t,r){return t+=e,Zt(t)>Gt&&(t-=Math.round(t/wn)*wn),[t,r]}}function yI(e){var t=vI(e);return t.invert=vI(-e),t}function bI(e,t){var r=Wt(e),n=Jt(e),i=Wt(t),a=Jt(t);function o(s,l){var u=Wt(l),c=Wt(s)*u,f=Jt(s)*u,d=Jt(l),m=d*r+c*n;return[Ca(f*i-m*a,c*r-d*n),ps(m*i+f*a)]}return o.invert=function(s,l){var u=Wt(l),c=Wt(s)*u,f=Jt(s)*u,d=Jt(l),m=d*i-f*a;return[Ca(f*i+d*a,c*r+m*n),ps(m*r-c*n)]},o}function wI(e){e=Ny(e[0]*Ut,e[1]*Ut,e.length>2?e[2]*Ut:0);function t(r){return r=e(r[0]*Ut,r[1]*Ut),r[0]*=sn,r[1]*=sn,r}return t.invert=function(r){return r=e.invert(r[0]*Ut,r[1]*Ut),r[0]*=sn,r[1]*=sn,r},t}var Dy=q(()=>{My();ln();Ty.invert=Ty});function _I(e,t,r,n,i,a){if(r){var o=Wt(t),s=Jt(t),l=n*r;i==null?(i=t+n*wn,a=t-l/2):(i=xI(o,i),a=xI(o,a),(n>0?i<a:i>a)&&(i+=n*wn));for(var u,c=i;n>0?c>a:c<a;c-=l)u=e2([o,-s*Wt(c),-s*Jt(c)]),e.point(u[0],u[1])}}function xI(e,t){t=ro(t),t[0]-=e,t2(t);var r=rI(-t[1]);return((-t[2]<0?-r:r)+wn-$t)%wn}var kI=q(()=>{M0();ln()});function Ef(){var e=[],t;return{point:function(r,n,i){t.push([r,n,i])},lineStart:function(){e.push(t=[])},lineEnd:_r,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var r=e;return e=[],t=null,r}}}var Py=q(()=>{p4()});function D0(e,t){return Zt(e[0]-t[0])<$t&&Zt(e[1]-t[1])<$t}var Fy=q(()=>{ln()});function Af(e,t,r,n){this.x=e,this.z=t,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function Sf(e,t,r,n,i){var a=[],o=[],s,l;if(e.forEach(function(h){if(!((g=h.length-1)<=0)){var g,A=h[0],v=h[g],_;if(D0(A,v)){if(!A[2]&&!v[2]){for(i.lineStart(),s=0;s<g;++s)i.point((A=h[s])[0],A[1]);i.lineEnd();return}v[0]+=2*$t}a.push(_=new Af(A,h,null,!0)),o.push(_.o=new Af(A,null,_,!1)),a.push(_=new Af(v,h,null,!1)),o.push(_.o=new Af(v,null,_,!0))}}),!!a.length){for(o.sort(t),EI(a),EI(o),s=0,l=o.length;s<l;++s)o[s].e=r=!r;for(var u=a[0],c,f;;){for(var d=u,m=!0;d.v;)if((d=d.n)===u)return;c=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(m)for(s=0,l=c.length;s<l;++s)i.point((f=c[s])[0],f[1]);else n(d.x,d.n.x,1,i);d=d.n}else{if(m)for(c=d.p.z,s=c.length-1;s>=0;--s)i.point((f=c[s])[0],f[1]);else n(d.x,d.p.x,-1,i);d=d.p}d=d.o,c=d.z,m=!m}while(!d.v);i.lineEnd()}}}function EI(e){if(t=e.length){for(var t,r=0,n=e[0],i;++r<t;)n.n=i=e[r],i.p=n,n=i;n.n=i=e[0],i.p=n}}var Oy=q(()=>{Fy();ln()});function Ry(e){return Zt(e[0])<=Gt?e[0]:eI(e[0])*((Zt(e[0])+Gt)%wn-Gt)}function AI(e,t){var r=Ry(t),n=t[1],i=Jt(n),a=[Jt(r),-Wt(r),0],o=0,s=0,l=new on;i===1?n=Wn+$t:i===-1&&(n=-Wn-$t);for(var u=0,c=e.length;u<c;++u)if(d=(f=e[u]).length)for(var f,d,m=f[d-1],h=Ry(m),g=m[1]/2+I0,A=Jt(g),v=Wt(g),_=0;_<d;++_,h=k,A=S,v=I,m=w){var w=f[_],k=Ry(w),x=w[1]/2+I0,S=Jt(x),I=Wt(x),b=k-h,y=b>=0?1:-1,E=y*b,M=E>Gt,F=A*S;if(l.add(Ca(F*y*Jt(E),v*I+F*Wt(E))),o+=M?b+y*wn:b,M^h>=r^k>=r){var N=ms(ro(m),ro(w));t2(N);var D=ms(a,N);t2(D);var O=(M^b>=0?-1:1)*ps(D[2]);(n>O||n===O&&(N[0]||N[1]))&&(s+=M^b>=0?1:-1)}}return(o<-$t||o<$t&&l<-XC)^s&1}var SI=q(()=>{bn();M0();ln()});function Cf(e,t,r,n){return function(i){var a=t(i),o=Ef(),s=t(o),l=!1,u,c,f,d={point:m,lineStart:g,lineEnd:A,polygonStart:function(){d.point=v,d.lineStart=_,d.lineEnd=w,c=[],u=[]},polygonEnd:function(){d.point=m,d.lineStart=g,d.lineEnd=A,c=C0(c);var k=AI(u,n);c.length?(l||(i.polygonStart(),l=!0),Sf(c,eJ,k,r,i)):k&&(l||(i.polygonStart(),l=!0),i.lineStart(),r(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),c=u=null},sphere:function(){i.polygonStart(),i.lineStart(),r(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function m(k,x){e(k,x)&&i.point(k,x)}function h(k,x){a.point(k,x)}function g(){d.point=h,a.lineStart()}function A(){d.point=m,a.lineEnd()}function v(k,x){f.push([k,x]),s.point(k,x)}function _(){s.lineStart(),f=[]}function w(){v(f[0][0],f[0][1]),s.lineEnd();var k=s.clean(),x=o.result(),S,I=x.length,b,y,E;if(f.pop(),u.push(f),f=null,!!I){if(k&1){if(y=x[0],(b=y.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),S=0;S<b;++S)i.point((E=y[S])[0],E[1]);i.lineEnd()}return}I>1&&k&2&&x.push(x.pop().concat(x.shift())),c.push(x.filter(JZ))}}return d}}function JZ(e){return e.length>1}function eJ(e,t){return((e=e.x)[0]<0?e[1]-Wn-$t:Wn-e[1])-((t=t.x)[0]<0?t[1]-Wn-$t:Wn-t[1])}var Ly=q(()=>{Py();Oy();ln();SI();bn()});function tJ(e){var t=NaN,r=NaN,n=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(a,o){var s=a>0?Gt:-Gt,l=Zt(a-t);Zt(l-Gt)<$t?(e.point(t,r=(r+o)/2>0?Wn:-Wn),e.point(n,r),e.lineEnd(),e.lineStart(),e.point(s,r),e.point(a,r),i=0):n!==s&&l>=Gt&&(Zt(t-n)<$t&&(t-=n*$t),Zt(a-s)<$t&&(a-=s*$t),r=rJ(t,r,a,o),e.point(n,r),e.lineEnd(),e.lineStart(),e.point(s,r),i=0),e.point(t=a,r=o),n=s},lineEnd:function(){e.lineEnd(),t=r=NaN},clean:function(){return 2-i}}}function rJ(e,t,r,n){var i,a,o=Jt(e-r);return Zt(o)>$t?wf((Jt(t)*(a=Wt(n))*Jt(r)-Jt(n)*(i=Wt(t))*Jt(e))/(i*a*o)):(t+n)/2}function nJ(e,t,r,n){var i;if(e==null)i=r*Wn,n.point(-Gt,i),n.point(0,i),n.point(Gt,i),n.point(Gt,0),n.point(Gt,-i),n.point(0,-i),n.point(-Gt,-i),n.point(-Gt,0),n.point(-Gt,i);else if(Zt(e[0]-t[0])>$t){var a=e[0]<t[0]?Gt:-Gt;i=r*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(t[0],t[1])}var Uy,CI=q(()=>{Ly();ln();Uy=Cf(function(){return!0},tJ,nJ,[-Gt,-Wn])});function II(e){var t=Wt(e),r=2*Ut,n=t>0,i=Zt(t)>$t;function a(c,f,d,m){_I(m,e,r,d,c,f)}function o(c,f){return Wt(c)*Wt(f)>t}function s(c){var f,d,m,h,g;return{lineStart:function(){h=m=!1,g=1},point:function(A,v){var _=[A,v],w,k=o(A,v),x=n?k?0:u(A,v):k?u(A+(A<0?Gt:-Gt),v):0;if(!f&&(h=m=k)&&c.lineStart(),k!==m&&(w=l(f,_),(!w||D0(f,w)||D0(_,w))&&(_[2]=1)),k!==m)g=0,k?(c.lineStart(),w=l(_,f),c.point(w[0],w[1])):(w=l(f,_),c.point(w[0],w[1],2),c.lineEnd()),f=w;else if(i&&f&&n^k){var S;!(x&d)&&(S=l(_,f,!0))&&(g=0,n?(c.lineStart(),c.point(S[0][0],S[0][1]),c.point(S[1][0],S[1][1]),c.lineEnd()):(c.point(S[1][0],S[1][1]),c.lineEnd(),c.lineStart(),c.point(S[0][0],S[0][1],3)))}k&&(!f||!D0(f,_))&&c.point(_[0],_[1]),f=_,m=k,d=x},lineEnd:function(){m&&c.lineEnd(),f=null},clean:function(){return g|(h&&m)<<1}}}function l(c,f,d){var m=ro(c),h=ro(f),g=[1,0,0],A=ms(m,h),v=H6(A,A),_=A[0],w=v-_*_;if(!w)return!d&&c;var k=t*v/w,x=-t*_/w,S=ms(g,A),I=j6(g,k),b=j6(A,x);kf(I,b);var y=S,E=H6(I,y),M=H6(y,y),F=E*E-M*(H6(I,I)-1);if(!(F<0)){var N=Di(F),D=j6(y,(-E-N)/M);if(kf(D,I),D=e2(D),!d)return D;var O=c[0],L=f[0],P=c[1],U=f[1],B;L<O&&(B=O,O=L,L=B);var z=L-O,V=Zt(z-Gt)<$t,G=V||z<$t;if(!V&&U<P&&(B=P,P=U,U=B),G?V?P+U>0^D[1]<(Zt(D[0]-O)<$t?P:U):P<=D[1]&&D[1]<=U:z>Gt^(O<=D[0]&&D[0]<=L)){var W=j6(y,(-E+N)/M);return kf(W,I),[D,e2(W)]}}}function u(c,f){var d=n?e:Gt-e,m=0;return c<-d?m|=1:c>d&&(m|=2),f<-d?m|=4:f>d&&(m|=8),m}return Cf(o,s,a,n?[0,-e]:[-Gt,e-Gt])}var MI=q(()=>{M0();kI();ln();Fy();Ly()});function TI(e,t,r,n,i,a){var o=e[0],s=e[1],l=t[0],u=t[1],c=0,f=1,d=l-o,m=u-s,h;if(h=r-o,!(!d&&h>0)){if(h/=d,d<0){if(h<c)return;h<f&&(f=h)}else if(d>0){if(h>f)return;h>c&&(c=h)}if(h=i-o,!(!d&&h<0)){if(h/=d,d<0){if(h>f)return;h>c&&(c=h)}else if(d>0){if(h<c)return;h<f&&(f=h)}if(h=n-s,!(!m&&h>0)){if(h/=m,m<0){if(h<c)return;h<f&&(f=h)}else if(m>0){if(h>f)return;h>c&&(c=h)}if(h=a-s,!(!m&&h<0)){if(h/=m,m<0){if(h>f)return;h>c&&(c=h)}else if(m>0){if(h<c)return;h<f&&(f=h)}return c>0&&(e[0]=o+c*d,e[1]=s+c*m),f<1&&(t[0]=o+f*d,t[1]=s+f*m),!0}}}}}var NI=q(()=>{});function Z6(e,t,r,n){function i(u,c){return e<=u&&u<=r&&t<=c&&c<=n}function a(u,c,f,d){var m=0,h=0;if(u==null||(m=o(u,f))!==(h=o(c,f))||l(u,c)<0^f>0)do d.point(m===0||m===3?e:r,m>1?n:t);while((m=(m+f+4)%4)!==h);else d.point(c[0],c[1])}function o(u,c){return Zt(u[0]-e)<$t?c>0?0:3:Zt(u[0]-r)<$t?c>0?2:1:Zt(u[1]-t)<$t?c>0?1:0:c>0?3:2}function s(u,c){return l(u.x,c.x)}function l(u,c){var f=o(u,1),d=o(c,1);return f!==d?f-d:f===0?c[1]-u[1]:f===1?u[0]-c[0]:f===2?u[1]-c[1]:c[0]-u[0]}return function(u){var c=u,f=Ef(),d,m,h,g,A,v,_,w,k,x,S,I={point:b,lineStart:F,lineEnd:N,polygonStart:E,polygonEnd:M};function b(O,L){i(O,L)&&c.point(O,L)}function y(){for(var O=0,L=0,P=m.length;L<P;++L)for(var U=m[L],B=1,z=U.length,V=U[0],G,W,Y=V[0],J=V[1];B<z;++B)G=Y,W=J,V=U[B],Y=V[0],J=V[1],W<=n?J>n&&(Y-G)*(n-W)>(J-W)*(e-G)&&++O:J<=n&&(Y-G)*(n-W)<(J-W)*(e-G)&&--O;return O}function E(){c=f,d=[],m=[],S=!0}function M(){var O=y(),L=S&&O,P=(d=C0(d)).length;(L||P)&&(u.polygonStart(),L&&(u.lineStart(),a(null,null,1,u),u.lineEnd()),P&&Sf(d,s,O,a,u),u.polygonEnd()),c=u,d=m=h=null}function F(){I.point=D,m&&m.push(h=[]),x=!0,k=!1,_=w=NaN}function N(){d&&(D(g,A),v&&k&&f.rejoin(),d.push(f.result())),I.point=b,k&&c.lineEnd()}function D(O,L){var P=i(O,L);if(m&&h.push([O,L]),x)g=O,A=L,v=P,x=!1,P&&(c.lineStart(),c.point(O,L));else if(P&&k)c.point(O,L);else{var U=[_=Math.max(If,Math.min(X6,_)),w=Math.max(If,Math.min(X6,w))],B=[O=Math.max(If,Math.min(X6,O)),L=Math.max(If,Math.min(X6,L))];TI(U,B,e,t,r,n)?(k||(c.lineStart(),c.point(U[0],U[1])),c.point(B[0],B[1]),P||c.lineEnd(),S=!1):P&&(c.lineStart(),c.point(O,L),S=!1)}_=O,w=L,k=P}return I}}var X6,If,By=q(()=>{ln();Py();NI();Oy();bn();X6=1e9,If=-X6});function iJ(){P0.point=oJ,P0.lineEnd=aJ}function aJ(){P0.point=P0.lineEnd=_r}function oJ(e,t){e*=Ut,t*=Ut,qy=e,Mf=Jt(t),Tf=Wt(t),P0.point=sJ}function sJ(e,t){e*=Ut,t*=Ut;var r=Jt(t),n=Wt(t),i=Zt(e-qy),a=Wt(i),o=Jt(i),s=n*o,l=Tf*r-Mf*n*a,u=Mf*r+Tf*n*a;zy.add(Ca(Di(s*s+l*l),u)),qy=e,Mf=r,Tf=n}function Vy(e){return zy=new on,ai(e,P0),+zy}var zy,qy,Mf,Tf,P0,DI=q(()=>{bn();ln();p4();Jl();P0={sphere:_r,point:_r,lineStart:iJ,lineEnd:_r,polygonStart:_r,polygonEnd:_r}});var h4,Nf=q(()=>{h4=e=>e});function lJ(){g4.point=uJ}function uJ(e,t){g4.point=OI,PI=Wy=e,FI=Qy=t}function OI(e,t){Gy.add(Qy*e-Wy*t),Wy=e,Qy=t}function cJ(){OI(PI,FI)}var $y,Gy,PI,FI,Wy,Qy,g4,Hy,RI=q(()=>{bn();ln();p4();$y=new on,Gy=new on,g4={point:_r,lineStart:_r,lineEnd:_r,polygonStart:function(){g4.lineStart=lJ,g4.lineEnd=cJ},polygonEnd:function(){g4.lineStart=g4.lineEnd=g4.point=_r,$y.add(Zt(Gy)),Gy=new on},result:function(){var e=$y/2;return $y=new on,e}};Hy=g4});function dJ(e,t){e<F0&&(F0=e),e>J6&&(J6=e),t<Df&&(Df=t),t>Pf&&(Pf=t)}var F0,Df,J6,Pf,fJ,O0,jy=q(()=>{p4();F0=1/0,Df=F0,J6=-F0,Pf=J6,fJ={point:dJ,lineStart:_r,lineEnd:_r,polygonStart:_r,polygonEnd:_r,result:function(){var e=[[F0,Df],[J6,Pf]];return J6=Pf=-(Df=F0=1/0),e}};O0=fJ});function n2(e,t){Yy+=e,Ky+=t,++e7}function LI(){zo.point=pJ}function pJ(e,t){zo.point=mJ,n2(v1=e,y1=t)}function mJ(e,t){var r=e-v1,n=t-y1,i=Di(r*r+n*n);Ff+=i*(v1+e)/2,Of+=i*(y1+t)/2,R0+=i,n2(v1=e,y1=t)}function UI(){zo.point=n2}function hJ(){zo.point=vJ}function gJ(){qI(BI,zI)}function vJ(e,t){zo.point=qI,n2(BI=v1=e,zI=y1=t)}function qI(e,t){var r=e-v1,n=t-y1,i=Di(r*r+n*n);Ff+=i*(v1+e)/2,Of+=i*(y1+t)/2,R0+=i,i=y1*e-v1*t,Xy+=i*(v1+e),Zy+=i*(y1+t),t7+=i*3,n2(v1=e,y1=t)}var Yy,Ky,e7,Ff,Of,R0,Xy,Zy,t7,BI,zI,v1,y1,zo,Jy,VI=q(()=>{ln();Yy=0,Ky=0,e7=0,Ff=0,Of=0,R0=0,Xy=0,Zy=0,t7=0,zo={point:n2,lineStart:LI,lineEnd:UI,polygonStart:function(){zo.lineStart=hJ,zo.lineEnd=gJ},polygonEnd:function(){zo.point=n2,zo.lineStart=LI,zo.lineEnd=UI},result:function(){var e=t7?[Xy/t7,Zy/t7]:R0?[Ff/R0,Of/R0]:e7?[Yy/e7,Ky/e7]:[NaN,NaN];return Yy=Ky=e7=Ff=Of=R0=Xy=Zy=t7=0,e}};Jy=zo});function Rf(e){this._context=e}var $I=q(()=>{ln();p4();Rf.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,wn);break}}},result:_r}});function yJ(e,t){Lf.point=QI,GI=r7=e,WI=n7=t}function QI(e,t){r7-=e,n7-=t,tb.add(Di(r7*r7+n7*n7)),r7=e,n7=t}var tb,eb,GI,WI,r7,n7,Lf,rb,HI=q(()=>{bn();ln();p4();tb=new on,Lf={point:_r,lineStart:function(){Lf.point=yJ},lineEnd:function(){eb&&QI(GI,WI),Lf.point=_r},polygonStart:function(){eb=!0},polygonEnd:function(){eb=null},result:function(){var e=+tb;return tb=new on,e}};rb=Lf});function XI(e){let t=1;this._+=e[0];for(let r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function bJ(e){let t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return XI;if(t!==jI){let r=10**t;jI=t,Uf=function(i){let a=1;this._+=i[0];for(let o=i.length;a<o;++a)this._+=Math.round(arguments[a]*r)/r+i[a]}}return Uf}var jI,Uf,YI,KI,L0,ZI=q(()=>{L0=class{constructor(t){this._append=t==null?XI:bJ(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,r){switch(this._point){case 0:{this._append`M${t},${r}`,this._point=1;break}case 1:{this._append`L${t},${r}`;break}default:{if(this._append`M${t},${r}`,this._radius!==YI||this._append!==Uf){let n=this._radius,i=this._;this._="",this._append`m0,${n}a${n},${n} 0 1,1 0,${-2*n}a${n},${n} 0 1,1 0,${2*n}z`,YI=n,Uf=this._append,KI=this._,this._=i}this._+=KI;break}}}result(){let t=this._;return this._="",t.length?t:null}}});function Pi(e,t){let r=3,n=4.5,i,a;function o(s){return s&&(typeof n=="function"&&a.pointRadius(+n.apply(this,arguments)),ai(s,i(a))),a.result()}return o.area=function(s){return ai(s,i(Hy)),Hy.result()},o.measure=function(s){return ai(s,i(rb)),rb.result()},o.bounds=function(s){return ai(s,i(O0)),O0.result()},o.centroid=function(s){return ai(s,i(Jy)),Jy.result()},o.projection=function(s){return arguments.length?(i=s==null?(e=null,h4):(e=s).stream,o):e},o.context=function(s){return arguments.length?(a=s==null?(t=null,new L0(r)):new Rf(t=s),typeof n!="function"&&a.pointRadius(n),o):t},o.pointRadius=function(s){return arguments.length?(n=typeof s=="function"?s:(a.pointRadius(+s),+s),o):n},o.digits=function(s){if(!arguments.length)return r;if(s==null)r=null;else{let l=Math.floor(s);if(!(l>=0))throw new RangeError(`invalid digits: ${s}`);r=l}return t===null&&(a=new L0(r)),o},o.projection(e).digits(r).context(t)}var JI=q(()=>{Nf();Jl();RI();jy();VI();$I();HI();ZI()});function ib(e){return{stream:v4(e)}}function v4(e){return function(t){var r=new nb;for(var n in e)r[n]=e[n];return r.stream=t,r}}function nb(){}var i7=q(()=>{nb.prototype={constructor:nb,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}}});function ab(e,t,r){var n=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),n!=null&&e.clipExtent(null),ai(r,e.stream(O0)),t(O0.result()),n!=null&&e.clipExtent(n),e}function a7(e,t,r){return ab(e,function(n){var i=t[1][0]-t[0][0],a=t[1][1]-t[0][1],o=Math.min(i/(n[1][0]-n[0][0]),a/(n[1][1]-n[0][1])),s=+t[0][0]+(i-o*(n[1][0]+n[0][0]))/2,l=+t[0][1]+(a-o*(n[1][1]+n[0][1]))/2;e.scale(150*o).translate([s,l])},r)}function Bf(e,t,r){return a7(e,[[0,0],t],r)}function zf(e,t,r){return ab(e,function(n){var i=+t,a=i/(n[1][0]-n[0][0]),o=(i-a*(n[1][0]+n[0][0]))/2,s=-a*n[0][1];e.scale(150*a).translate([o,s])},r)}function qf(e,t,r){return ab(e,function(n){var i=+t,a=i/(n[1][1]-n[0][1]),o=-a*n[0][0],s=(i-a*(n[1][1]+n[0][1]))/2;e.scale(150*a).translate([o,s])},r)}var ob=q(()=>{Jl();jy()});function sb(e,t){return+t?_J(e,t):xJ(e)}function xJ(e){return v4({point:function(t,r){t=e(t,r),this.stream.point(t[0],t[1])}})}function _J(e,t){function r(n,i,a,o,s,l,u,c,f,d,m,h,g,A){var v=u-n,_=c-i,w=v*v+_*_;if(w>4*t&&g--){var k=o+d,x=s+m,S=l+h,I=Di(k*k+x*x+S*S),b=ps(S/=I),y=Zt(Zt(S)-1)<$t||Zt(a-f)<$t?(a+f)/2:Ca(x,k),E=e(y,b),M=E[0],F=E[1],N=M-n,D=F-i,O=_*N-v*D;(O*O/w>t||Zt((v*N+_*D)/w-.5)>.3||o*d+s*m+l*h<wJ)&&(r(n,i,a,o,s,l,M,F,y,k/=I,x/=I,S,g,A),A.point(M,F),r(M,F,y,k,x,S,u,c,f,d,m,h,g,A))}}return function(n){var i,a,o,s,l,u,c,f,d,m,h,g,A={point:v,lineStart:_,lineEnd:k,polygonStart:function(){n.polygonStart(),A.lineStart=x},polygonEnd:function(){n.polygonEnd(),A.lineStart=_}};function v(b,y){b=e(b,y),n.point(b[0],b[1])}function _(){f=NaN,A.point=w,n.lineStart()}function w(b,y){var E=ro([b,y]),M=e(b,y);r(f,d,c,m,h,g,f=M[0],d=M[1],c=b,m=E[0],h=E[1],g=E[2],eM,n),n.point(f,d)}function k(){A.point=v,n.lineEnd()}function x(){_(),A.point=S,A.lineEnd=I}function S(b,y){w(i=b,y),a=f,o=d,s=m,l=h,u=g,A.point=w}function I(){r(f,d,c,m,h,g,a,o,i,s,l,u,eM,n),A.lineEnd=k,k()}return A}}var eM,wJ,tM=q(()=>{M0();ln();i7();eM=16,wJ=Wt(30*Ut)});function EJ(e){return v4({point:function(t,r){var n=e(t,r);return this.stream.point(n[0],n[1])}})}function AJ(e,t,r,n,i){function a(o,s){return o*=n,s*=i,[t+e*o,r-e*s]}return a.invert=function(o,s){return[(o-t)/e*n,(r-s)/e*i]},a}function rM(e,t,r,n,i,a){if(!a)return AJ(e,t,r,n,i);var o=Wt(a),s=Jt(a),l=o*e,u=s*e,c=o/e,f=s/e,d=(s*r-o*t)/e,m=(s*t+o*r)/e;function h(g,A){return g*=n,A*=i,[l*g-u*A+t,r-u*g-l*A]}return h.invert=function(g,A){return[n*(c*g-f*A+d),i*(m-f*g-c*A)]},h}function U0(e){return nM(function(){return e})()}function nM(e){var t,r=150,n=480,i=250,a=0,o=0,s=0,l=0,u=0,c,f=0,d=1,m=1,h=null,g=Uy,A=null,v,_,w,k=h4,x=.5,S,I,b,y,E;function M(O){return b(O[0]*Ut,O[1]*Ut)}function F(O){return O=b.invert(O[0],O[1]),O&&[O[0]*sn,O[1]*sn]}M.stream=function(O){return y&&E===O?y:y=kJ(EJ(c)(g(S(k(E=O)))))},M.preclip=function(O){return arguments.length?(g=O,h=void 0,D()):g},M.postclip=function(O){return arguments.length?(k=O,A=v=_=w=null,D()):k},M.clipAngle=function(O){return arguments.length?(g=+O?II(h=O*Ut):(h=null,Uy),D()):h*sn},M.clipExtent=function(O){return arguments.length?(k=O==null?(A=v=_=w=null,h4):Z6(A=+O[0][0],v=+O[0][1],_=+O[1][0],w=+O[1][1]),D()):A==null?null:[[A,v],[_,w]]},M.scale=function(O){return arguments.length?(r=+O,N()):r},M.translate=function(O){return arguments.length?(n=+O[0],i=+O[1],N()):[n,i]},M.center=function(O){return arguments.length?(a=O[0]%360*Ut,o=O[1]%360*Ut,N()):[a*sn,o*sn]},M.rotate=function(O){return arguments.length?(s=O[0]%360*Ut,l=O[1]%360*Ut,u=O.length>2?O[2]%360*Ut:0,N()):[s*sn,l*sn,u*sn]},M.angle=function(O){return arguments.length?(f=O%360*Ut,N()):f*sn},M.reflectX=function(O){return arguments.length?(d=O?-1:1,N()):d<0},M.reflectY=function(O){return arguments.length?(m=O?-1:1,N()):m<0},M.precision=function(O){return arguments.length?(S=sb(I,x=O*O),D()):Di(x)},M.fitExtent=function(O,L){return a7(M,O,L)},M.fitSize=function(O,L){return Bf(M,O,L)},M.fitWidth=function(O,L){return zf(M,O,L)},M.fitHeight=function(O,L){return qf(M,O,L)};function N(){var O=rM(r,0,0,d,m,f).apply(null,t(a,o)),L=rM(r,n-O[0],i-O[1],d,m,f);return c=Ny(s,l,u),I=K6(t,L),b=K6(c,I),S=sb(I,x),D()}function D(){return y=E=null,M}return function(){return t=e.apply(this,arguments),M.invert=t.invert&&F,N()}}var kJ,lb=q(()=>{CI();MI();By();My();Nf();ln();Dy();i7();ob();tM();kJ=v4({point:function(e,t){this.stream.point(e*Ut,t*Ut)}})});function y4(e,t){return[e,JC(tI((Wn+t)/2))]}function ub(){return SJ(y4).scale(961/wn)}function SJ(e){var t=U0(e),r=t.center,n=t.scale,i=t.translate,a=t.clipExtent,o=null,s,l,u;t.scale=function(f){return arguments.length?(n(f),c()):n()},t.translate=function(f){return arguments.length?(i(f),c()):i()},t.center=function(f){return arguments.length?(r(f),c()):r()},t.clipExtent=function(f){return arguments.length?(f==null?o=s=l=u=null:(o=+f[0][0],s=+f[0][1],l=+f[1][0],u=+f[1][1]),c()):o==null?null:[[o,s],[l,u]]};function c(){var f=Gt*n(),d=t(wI(t.rotate()).invert([0,0]));return a(o==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===y4?[[Math.max(d[0]-f,o),s],[Math.min(d[0]+f,l),u]]:[[o,Math.max(d[1]-f,s)],[l,Math.min(d[1]+f,u)]])}return c()}var iM=q(()=>{ln();Dy();lb();y4.invert=function(e,t){return[e,2*wf(ZC(t))-Wn]}});function cb(){var e=1,t=0,r=0,n=1,i=1,a=0,o,s,l=null,u,c,f,d=1,m=1,h=v4({point:function(k,x){var S=w([k,x]);this.stream.point(S[0],S[1])}}),g=h4,A,v;function _(){return d=e*n,m=e*i,A=v=null,w}function w(k){var x=k[0]*d,S=k[1]*m;if(a){var I=S*o-x*s;x=x*o+S*s,S=I}return[x+t,S+r]}return w.invert=function(k){var x=k[0]-t,S=k[1]-r;if(a){var I=S*o+x*s;x=x*o-S*s,S=I}return[x/d,S/m]},w.stream=function(k){return A&&v===k?A:A=h(g(v=k))},w.postclip=function(k){return arguments.length?(g=k,l=u=c=f=null,_()):g},w.clipExtent=function(k){return arguments.length?(g=k==null?(l=u=c=f=null,h4):Z6(l=+k[0][0],u=+k[0][1],c=+k[1][0],f=+k[1][1]),_()):l==null?null:[[l,u],[c,f]]},w.scale=function(k){return arguments.length?(e=+k,_()):e},w.translate=function(k){return arguments.length?(t=+k[0],r=+k[1],_()):[t,r]},w.angle=function(k){return arguments.length?(a=k%360*Ut,s=Jt(a),o=Wt(a),_()):a*sn},w.reflectX=function(k){return arguments.length?(n=k?-1:1,_()):n<0},w.reflectY=function(k){return arguments.length?(i=k?-1:1,_()):i<0},w.fitExtent=function(k,x){return a7(w,k,x)},w.fitSize=function(k,x){return Bf(w,k,x)},w.fitWidth=function(k,x){return zf(w,k,x)},w.fitHeight=function(k,x){return qf(w,k,x)},w}var aM=q(()=>{By();Nf();i7();ob();ln()});var Ta=q(()=>{Cy();gI();DI();JI();aM();lb();iM();Jl();i7()});var oM={};j(oM,{geoLatToMeters:()=>i2,geoLonToMeters:()=>vs,geoMetersToLat:()=>Ln,geoMetersToLon:()=>xn,geoMetersToOffset:()=>b4,geoOffsetToMeters:()=>w4,geoScaleToZoom:()=>Yt,geoSphericalClosestNode:()=>x4,geoSphericalDistance:()=>wt,geoZoomToScale:()=>Mn});function i2(e){return e*(b1*$f/360)}function vs(e,t){return Math.abs(t)>=90?0:e*(b1*Vf/360)*Math.abs(Math.cos(t*(Math.PI/180)))}function Ln(e){return e/(b1*$f/360)}function xn(e,t){return Math.abs(t)>=90?0:e/(b1*Vf/360)/Math.abs(Math.cos(t*(Math.PI/180)))}function b4(e,t){return t=t||256,[e[0]*t/(b1*Vf),-e[1]*t/(b1*$f)]}function w4(e,t){return t=t||256,[e[0]*b1*Vf/t,-e[1]*b1*$f/t]}function wt(e,t){var r=vs(e[0]-t[0],(e[1]+t[1])/2),n=i2(e[1]-t[1]);return Math.sqrt(r*r+n*n)}function Yt(e,t){t=t||256;var r=Math.log(t)*Math.LOG2E;return Math.log(e*b1)/Math.LN2-r}function Mn(e,t){return t=t||256,t*Math.pow(2,e)/b1}function x4(e,t){var r=1/0,n,i;for(var a in e)n=wt(e[a].loc,t),n<r&&(r=n,i=a);return i!==void 0?{index:i,distance:r,node:e[i]}:null}var b1,Vf,$f,yi=q(()=>{"use strict";b1=2*Math.PI,Vf=6378137,$f=63567523e-1});var sM={};j(sM,{geoExtent:()=>Me});function Me(e,t){if(this instanceof Me){if(e instanceof Me)return e;e&&e.length===2&&e[0].length===2&&e[1].length===2?(this[0]=e[0],this[1]=e[1]):(this[0]=e||[1/0,1/0],this[1]=t||e||[-1/0,-1/0])}else return new Me(e,t)}var w1=q(()=>{"use strict";yi();Me.prototype=new Array(2);Object.assign(Me.prototype,{equals:function(e){return this[0][0]===e[0][0]&&this[0][1]===e[0][1]&&this[1][0]===e[1][0]&&this[1][1]===e[1][1]},extend:function(e){return e instanceof Me||(e=new Me(e)),Me([Math.min(e[0][0],this[0][0]),Math.min(e[0][1],this[0][1])],[Math.max(e[1][0],this[1][0]),Math.max(e[1][1],this[1][1])])},_extend:function(e){this[0][0]=Math.min(e[0][0],this[0][0]),this[0][1]=Math.min(e[0][1],this[0][1]),this[1][0]=Math.max(e[1][0],this[1][0]),this[1][1]=Math.max(e[1][1],this[1][1])},area:function(){return Math.abs((this[1][0]-this[0][0])*(this[1][1]-this[0][1]))},center:function(){return[(this[0][0]+this[1][0])/2,(this[0][1]+this[1][1])/2]},rectangle:function(){return[this[0][0],this[0][1],this[1][0],this[1][1]]},bbox:function(){return{minX:this[0][0],minY:this[0][1],maxX:this[1][0],maxY:this[1][1]}},polygon:function(){return[[this[0][0],this[0][1]],[this[0][0],this[1][1]],[this[1][0],this[1][1]],[this[1][0],this[0][1]],[this[0][0],this[0][1]]]},contains:function(e){return e instanceof Me||(e=new Me(e)),e[0][0]>=this[0][0]&&e[0][1]>=this[0][1]&&e[1][0]<=this[1][0]&&e[1][1]<=this[1][1]},intersects:function(e){return e instanceof Me||(e=new Me(e)),e[0][0]<=this[1][0]&&e[0][1]<=this[1][1]&&e[1][0]>=this[0][0]&&e[1][1]>=this[0][1]},intersection:function(e){return this.intersects(e)?new Me([Math.max(e[0][0],this[0][0]),Math.max(e[0][1],this[0][1])],[Math.min(e[1][0],this[1][0]),Math.min(e[1][1],this[1][1])]):new Me},percentContainedIn:function(e){e instanceof Me||(e=new Me(e));var t=this.intersection(e).area(),r=this.area();return t===1/0||r===1/0?0:t===0||r===0?e.contains(this)?1:0:t/r},padByMeters:function(e){var t=Ln(e),r=xn(e,this.center()[1]);return Me([this[0][0]-r,this[0][1]-t],[this[1][0]+r,this[1][1]+t])},toParam:function(){return this.rectangle().join(",")},split:function(){let e=this.center();return[Me(this[0],e),Me([e[0],this[0][1]],[this[1][0],e[1]]),Me(e,this[1]),Me([this[0][0],e[1]],[e[0],this[1][1]])]}})});function B0(e){for(var t=-1,r=e.length,n,i=e[r-1],a=0;++t<r;)n=i,i=e[t],a+=n[1]*i[0]-n[0]*i[1];return a/2}var lM=q(()=>{});function x1(e){for(var t=-1,r=e.length,n=0,i=0,a,o=e[r-1],s,l=0;++t<r;)a=o,o=e[t],l+=s=a[0]*o[1]-o[0]*a[1],n+=(a[0]+o[0])*s,i+=(a[1]+o[1])*s;return l*=3,[n/l,i/l]}var uM=q(()=>{});function cM(e,t,r){return(t[0]-e[0])*(r[1]-e[1])-(t[1]-e[1])*(r[0]-e[0])}var fM=q(()=>{});function CJ(e,t){return e[0]-t[0]||e[1]-t[1]}function dM(e){let t=e.length,r=[0,1],n=2,i;for(i=2;i<t;++i){for(;n>1&&cM(e[r[n-2]],e[r[n-1]],e[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function ys(e){if((r=e.length)<3)return null;var t,r,n=new Array(r),i=new Array(r);for(t=0;t<r;++t)n[t]=[+e[t][0],+e[t][1],t];for(n.sort(CJ),t=0;t<r;++t)i[t]=[n[t][0],-n[t][1]];var a=dM(n),o=dM(i),s=o[0]===a[0],l=o[o.length-1]===a[a.length-1],u=[];for(t=a.length-1;t>=0;--t)u.push(e[n[a[t]][2]]);for(t=+s;t<o.length-l;++t)u.push(e[n[o[t]][2]]);return u}var pM=q(()=>{fM()});var o7=q(()=>{lM();uM();pM()});var mM={};j(mM,{geoVecAdd:()=>qr,geoVecAngle:()=>no,geoVecCross:()=>k1,geoVecDot:()=>bi,geoVecEqual:()=>zr,geoVecFloor:()=>Gf,geoVecInterp:()=>Qt,geoVecLength:()=>ft,geoVecLengthSquare:()=>_4,geoVecNormalize:()=>_1,geoVecNormalizedDot:()=>k4,geoVecProject:()=>z0,geoVecScale:()=>Na,geoVecSubtract:()=>Bt});function zr(e,t,r){return r?Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r:e[0]===t[0]&&e[1]===t[1]}function qr(e,t){return[e[0]+t[0],e[1]+t[1]]}function Bt(e,t){return[e[0]-t[0],e[1]-t[1]]}function Na(e,t){return[e[0]*t,e[1]*t]}function Gf(e){return[Math.floor(e[0]),Math.floor(e[1])]}function Qt(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function ft(e,t){return Math.sqrt(_4(e,t))}function _4(e,t){t=t||[0,0];var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function _1(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]);return t!==0?Na(e,1/t):[0,0]}function no(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])}function bi(e,t,r){r=r||[0,0];var n=Bt(e,r),i=Bt(t,r);return n[0]*i[0]+n[1]*i[1]}function k4(e,t,r){r=r||[0,0];var n=_1(Bt(e,r)),i=_1(Bt(t,r));return bi(n,i)}function k1(e,t,r){r=r||[0,0];var n=Bt(e,r),i=Bt(t,r);return n[0]*i[1]-n[1]*i[0]}function z0(e,t){for(var r=1/0,n,i,a=0;a<t.length-1;a++){var o=t[a],s=Bt(t[a+1],o),l=Bt(e,o),u=bi(l,s)/bi(s,s),c;u<0?c=o:u>1?c=t[a+1]:c=[o[0]+u*s[0],o[1]+u*s[1]];var f=ft(c,e);f<r&&(r=f,n=a+1,i=c)}return n!==void 0?{index:n,distance:r,target:i}:null}var cn=q(()=>{"use strict"});var hM={};j(hM,{geoAngle:()=>fn,geoChooseEdge:()=>_n,geoEdgeEqual:()=>q0,geoGetSmallestSurroundingRectangle:()=>S4,geoHasLineIntersections:()=>V0,geoHasSelfIntersections:()=>ta,geoLineIntersection:()=>ra,geoPathHasIntersections:()=>s7,geoPathIntersections:()=>E4,geoPathLength:()=>qo,geoPointInPolygon:()=>io,geoPolygonContainsPolygon:()=>A4,geoPolygonIntersectsPolygon:()=>ao,geoRotate:()=>E1,geoViewportEdge:()=>A1});function fn(e,t,r){return no(r(e.loc),r(t.loc))}function q0(e,t){return e[0]===t[0]&&e[1]===t[1]||e[0]===t[1]&&e[1]===t[0]}function E1(e,t,r){return e.map(function(n){var i=Bt(n,r);return[i[0]*Math.cos(t)-i[1]*Math.sin(t)+r[0],i[0]*Math.sin(t)+i[1]*Math.cos(t)+r[1]]})}function _n(e,t,r,n){for(var i=ft,a=e.map(function(v){return r(v.loc)}),o=e.map(function(v){return v.id}),s=1/0,l,u,c=0;c<a.length-1;c++)if(!(o[c]===n||o[c+1]===n)){var f=a[c],d=Bt(a[c+1],f),m=Bt(t,f),h=bi(m,d)/bi(d,d),g;h<0?g=f:h>1?g=a[c+1]:g=[f[0]+h*d[0],f[1]+h*d[1]];var A=i(g,t);A<s&&(s=A,l=c+1,u=r.invert(g))}return l!==void 0?{index:l,distance:s,loc:u}:null}function V0(e,t,r){var n=[],i=[],a,o,s,l,u;for(a=0;a<e.length-1;a++)s=e[a],l=e[a+1],u=[s.loc,l.loc],(s.id===r||l.id===r)&&n.push(u);for(a=0;a<t.length-1;a++)s=t[a],l=t[a+1],u=[s.loc,l.loc],i.push(u);for(a=0;a<n.length;a++)for(o=0;o<i.length;o++){var c=n[a],f=i[o],d=ra(c,f);if(d)return!0}return!1}function ta(e,t){var r=[],n=[],i,a;for(i=0;i<e.length-1;i++){var o=e[i],s=e[i+1],l=[o.loc,s.loc];o.id===t||s.id===t?r.push(l):n.push(l)}for(i=0;i<r.length;i++)for(a=0;a<n.length;a++){var u=r[i],c=n[a];if(!(zr(u[1],c[0])||zr(u[0],c[1])||zr(u[0],c[0])||zr(u[1],c[1]))){var f=ra(u,c);if(f){var d=1e-8;if(zr(u[1],f,d)||zr(u[0],f,d)||zr(c[1],f,d)||zr(c[0],f,d))continue;return!0}}}return!1}function ra(e,t){var r=[e[0][0],e[0][1]],n=[e[1][0],e[1][1]],i=[t[0][0],t[0][1]],a=[t[1][0],t[1][1]],o=Bt(n,r),s=Bt(a,i),l=k1(Bt(i,r),o),u=k1(o,s);if(l&&u){var c=l/u,f=k1(Bt(i,r),s)/u;if(f>=0&&f<=1&&c>=0&&c<=1)return Qt(r,n,f)}return null}function E4(e,t){for(var r=[],n=0;n<e.length-1;n++)for(var i=0;i<t.length-1;i++){var a=[e[n],e[n+1]],o=[t[i],t[i+1]],s=ra(a,o);s&&r.push(s)}return r}function s7(e,t){for(var r=0;r<e.length-1;r++)for(var n=0;n<t.length-1;n++){var i=[e[r],e[r+1]],a=[t[n],t[n+1]],o=ra(i,a);if(o)return!0}return!1}function io(e,t){for(var r=e[0],n=e[1],i=!1,a=0,o=t.length-1;a<t.length;o=a++){var s=t[a][0],l=t[a][1],u=t[o][0],c=t[o][1],f=l>n!=c>n&&r<(u-s)*(n-l)/(c-l)+s;f&&(i=!i)}return i}function A4(e,t){return t.every(function(r){return io(r,e)})}function ao(e,t,r){function n(i,a){return a.some(function(o){return io(o,i)})}return n(e,t)||!!r&&s7(e,t)}function S4(e){for(var t=ys(e),r=x1(t),n=1/0,i=[],a=0,o=t[0],s=0;s<=t.length-1;s++){var l=s===t.length-1?t[0]:t[s+1],u=Math.atan2(l[1]-o[1],l[0]-o[0]),c=E1(t,-u,r),f=c.reduce(function(m,h){return m.extend(Me(h))},Me()),d=f.area();d<n&&(n=d,i=f,a=u),o=l}return{poly:E1(i.polygon(),a,r),angle:a}}function qo(e){for(var t=0,r=0;r<e.length-1;r++)t+=ft(e[r],e[r+1]);return t}function A1(e,t){var r=[80,20,50,20],n=0,i=0;return e[0]>t[0]-r[1]&&(n=-10),e[0]<r[3]&&(n=10),e[1]>t[1]-r[2]&&(i=-10),e[1]<r[0]&&(i=10),n||i?[n,i]:null}var Qn=q(()=>{"use strict";o7();w1();cn()});function vM(){for(var e=0,t=arguments.length,r={},n;e<t;++e){if(!(n=arguments[e]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new Wf(r)}function Wf(e){this._=e}function MJ(e,t){return e.trim().split(/^|\s+/).map(function(r){var n="",i=r.indexOf(".");if(i>=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}function TJ(e,t){for(var r=0,n=e.length,i;r<n;++r)if((i=e[r]).name===t)return i.value}function gM(e,t,r){for(var n=0,i=e.length;n<i;++n)if(e[n].name===t){e[n]=IJ,e=e.slice(0,n).concat(e.slice(n+1));break}return r!=null&&e.push({name:t,value:r}),e}var IJ,xe,yM=q(()=>{IJ={value:()=>{}};Wf.prototype=vM.prototype={constructor:Wf,on:function(e,t){var r=this._,n=MJ(e+"",r),i,a=-1,o=n.length;if(arguments.length<2){for(;++a<o;)if((i=(e=n[a]).type)&&(i=TJ(r[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<o;)if(i=(e=n[a]).type)r[i]=gM(r[i],e.name,t);else if(t==null)for(i in r)r[i]=gM(r[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new Wf(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var r=new Array(i),n=0,i,a;n<i;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],n=0,i=a.length;n<i;++n)a[n].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],i=0,a=n.length;i<a;++i)n[i].value.apply(t,r)}};xe=vM});var Ye=q(()=>{yM()});var Qf,fb,db=q(()=>{Qf="http://www.w3.org/1999/xhtml",fb={svg:"http://www.w3.org/2000/svg",xhtml:Qf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}});function bs(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),fb.hasOwnProperty(t)?{space:fb[t],local:e}:e}var Hf=q(()=>{db()});function NJ(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Qf&&t.documentElement.namespaceURI===Qf?t.createElement(e):t.createElementNS(r,e)}}function DJ(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function jf(e){var t=bs(e);return(t.local?DJ:NJ)(t)}var pb=q(()=>{Hf();db()});function PJ(){}function a2(e){return e==null?PJ:function(){return this.querySelector(e)}}var Yf=q(()=>{});function bM(e){typeof e!="function"&&(e=a2(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a=t[i],o=a.length,s=n[i]=new Array(o),l,u,c=0;c<o;++c)(l=a[c])&&(u=e.call(l,l.__data__,c,a))&&("__data__"in l&&(u.__data__=l.__data__),s[c]=u);return new Vr(n,this._parents)}var wM=q(()=>{oo();Yf()});function l7(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}var mb=q(()=>{});function FJ(){return[]}function u7(e){return e==null?FJ:function(){return this.querySelectorAll(e)}}var hb=q(()=>{});function OJ(e){return function(){return l7(e.apply(this,arguments))}}function xM(e){typeof e=="function"?e=OJ(e):e=u7(e);for(var t=this._groups,r=t.length,n=[],i=[],a=0;a<r;++a)for(var o=t[a],s=o.length,l,u=0;u<s;++u)(l=o[u])&&(n.push(e.call(l,l.__data__,u,o)),i.push(l));return new Vr(n,i)}var _M=q(()=>{oo();mb();hb()});function c7(e){return function(){return this.matches(e)}}function Kf(e){return function(t){return t.matches(e)}}var f7=q(()=>{});function LJ(e){return function(){return RJ.call(this.children,e)}}function UJ(){return this.firstElementChild}function kM(e){return this.select(e==null?UJ:LJ(typeof e=="function"?e:Kf(e)))}var RJ,EM=q(()=>{f7();RJ=Array.prototype.find});function zJ(){return Array.from(this.children)}function qJ(e){return function(){return BJ.call(this.children,e)}}function AM(e){return this.selectAll(e==null?zJ:qJ(typeof e=="function"?e:Kf(e)))}var BJ,SM=q(()=>{f7();BJ=Array.prototype.filter});function CM(e){typeof e!="function"&&(e=c7(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a=t[i],o=a.length,s=n[i]=[],l,u=0;u<o;++u)(l=a[u])&&e.call(l,l.__data__,u,a)&&s.push(l);return new Vr(n,this._parents)}var IM=q(()=>{oo();f7()});function Xf(e){return new Array(e.length)}var gb=q(()=>{});function MM(){return new Vr(this._enter||this._groups.map(Xf),this._parents)}function d7(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}var vb=q(()=>{gb();oo();d7.prototype={constructor:d7,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}}});function TM(e){return function(){return e}}var NM=q(()=>{});function VJ(e,t,r,n,i,a){for(var o=0,s,l=t.length,u=a.length;o<u;++o)(s=t[o])?(s.__data__=a[o],n[o]=s):r[o]=new d7(e,a[o]);for(;o<l;++o)(s=t[o])&&(i[o]=s)}function $J(e,t,r,n,i,a,o){var s,l,u=new Map,c=t.length,f=a.length,d=new Array(c),m;for(s=0;s<c;++s)(l=t[s])&&(d[s]=m=o.call(l,l.__data__,s,t)+"",u.has(m)?i[s]=l:u.set(m,l));for(s=0;s<f;++s)m=o.call(e,a[s],s,a)+"",(l=u.get(m))?(n[s]=l,l.__data__=a[s],u.delete(m)):r[s]=new d7(e,a[s]);for(s=0;s<c;++s)(l=t[s])&&u.get(d[s])===l&&(i[s]=l)}function GJ(e){return e.__data__}function DM(e,t){if(!arguments.length)return Array.from(this,GJ);var r=t?$J:VJ,n=this._parents,i=this._groups;typeof e!="function"&&(e=TM(e));for(var a=i.length,o=new Array(a),s=new Array(a),l=new Array(a),u=0;u<a;++u){var c=n[u],f=i[u],d=f.length,m=WJ(e.call(c,c&&c.__data__,u,n)),h=m.length,g=s[u]=new Array(h),A=o[u]=new Array(h),v=l[u]=new Array(d);r(c,f,g,A,v,m,t);for(var _=0,w=0,k,x;_<h;++_)if(k=g[_]){for(_>=w&&(w=_+1);!(x=A[w])&&++w<h;);k._next=x||null}}return o=new Vr(o,n),o._enter=s,o._exit=l,o}function WJ(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}var PM=q(()=>{oo();vb();NM()});function FM(){return new Vr(this._exit||this._groups.map(Xf),this._parents)}var OM=q(()=>{gb();oo()});function RM(e,t,r){var n=this.enter(),i=this,a=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),r==null?a.remove():r(a),n&&i?n.merge(i).order():i}var LM=q(()=>{});function UM(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,i=r.length,a=n.length,o=Math.min(i,a),s=new Array(i),l=0;l<o;++l)for(var u=r[l],c=n[l],f=u.length,d=s[l]=new Array(f),m,h=0;h<f;++h)(m=u[h]||c[h])&&(d[h]=m);for(;l<i;++l)s[l]=r[l];return new Vr(s,this._parents)}var BM=q(()=>{oo()});function zM(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var n=e[t],i=n.length-1,a=n[i],o;--i>=0;)(o=n[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}var qM=q(()=>{});function VM(e){e||(e=QJ);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var r=this._groups,n=r.length,i=new Array(n),a=0;a<n;++a){for(var o=r[a],s=o.length,l=i[a]=new Array(s),u,c=0;c<s;++c)(u=o[c])&&(l[c]=u);l.sort(t)}return new Vr(i,this._parents).order()}function QJ(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var $M=q(()=>{oo()});function GM(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}var WM=q(()=>{});function QM(){return Array.from(this)}var HM=q(()=>{});function jM(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,a=n.length;i<a;++i){var o=n[i];if(o)return o}return null}var YM=q(()=>{});function KM(){let e=0;for(let t of this)++e;return e}var XM=q(()=>{});function ZM(){return!this.node()}var JM=q(()=>{});function eT(e){for(var t=this._groups,r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}var tT=q(()=>{});function HJ(e){return function(){this.removeAttribute(e)}}function jJ(e){return function(){this.removeAttributeNS(e.space,e.local)}}function YJ(e,t){return function(){this.setAttribute(e,t)}}function KJ(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function XJ(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function ZJ(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function rT(e,t){var r=bs(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((t==null?r.local?jJ:HJ:typeof t=="function"?r.local?ZJ:XJ:r.local?KJ:YJ)(r,t))}var nT=q(()=>{Hf()});function Zf(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}var yb=q(()=>{});function JJ(e){return function(){this.style.removeProperty(e)}}function eee(e,t,r){return function(){this.style.setProperty(e,t,r)}}function tee(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function iT(e,t,r){return arguments.length>1?this.each((t==null?JJ:typeof t=="function"?tee:eee)(e,t,r==null?"":r)):C4(this.node(),e)}function C4(e,t){return e.style.getPropertyValue(t)||Zf(e).getComputedStyle(e,null).getPropertyValue(t)}var bb=q(()=>{yb()});function ree(e){return function(){delete this[e]}}function nee(e,t){return function(){this[e]=t}}function iee(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function aT(e,t){return arguments.length>1?this.each((t==null?ree:typeof t=="function"?iee:nee)(e,t)):this.node()[e]}var oT=q(()=>{});function sT(e){return e.trim().split(/^|\s+/)}function wb(e){return e.classList||new lT(e)}function lT(e){this._node=e,this._names=sT(e.getAttribute("class")||"")}function uT(e,t){for(var r=wb(e),n=-1,i=t.length;++n<i;)r.add(t[n])}function cT(e,t){for(var r=wb(e),n=-1,i=t.length;++n<i;)r.remove(t[n])}function aee(e){return function(){uT(this,e)}}function oee(e){return function(){cT(this,e)}}function see(e,t){return function(){(t.apply(this,arguments)?uT:cT)(this,e)}}function fT(e,t){var r=sT(e+"");if(arguments.length<2){for(var n=wb(this.node()),i=-1,a=r.length;++i<a;)if(!n.contains(r[i]))return!1;return!0}return this.each((typeof t=="function"?see:t?aee:oee)(r,t))}var dT=q(()=>{lT.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}}});function lee(){this.textContent=""}function uee(e){return function(){this.textContent=e}}function cee(e){return function(){var t=e.apply(this,arguments);this.textContent=t==null?"":t}}function pT(e){return arguments.length?this.each(e==null?lee:(typeof e=="function"?cee:uee)(e)):this.node().textContent}var mT=q(()=>{});function fee(){this.innerHTML=""}function dee(e){return function(){this.innerHTML=e}}function pee(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t==null?"":t}}function hT(e){return arguments.length?this.each(e==null?fee:(typeof e=="function"?pee:dee)(e)):this.node().innerHTML}var gT=q(()=>{});function mee(){this.nextSibling&&this.parentNode.appendChild(this)}function vT(){return this.each(mee)}var yT=q(()=>{});function hee(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function bT(){return this.each(hee)}var wT=q(()=>{});function xT(e){var t=typeof e=="function"?e:jf(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}var _T=q(()=>{pb()});function gee(){return null}function kT(e,t){var r=typeof e=="function"?e:jf(e),n=t==null?gee:typeof t=="function"?t:a2(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}var ET=q(()=>{pb();Yf()});function vee(){var e=this.parentNode;e&&e.removeChild(this)}function AT(){return this.each(vee)}var ST=q(()=>{});function yee(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function bee(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function CT(e){return this.select(e?bee:yee)}var IT=q(()=>{});function MT(e){return arguments.length?this.property("__data__",e):this.node().__data__}var TT=q(()=>{});function wee(e){return function(t){e.call(this,t,this.__data__)}}function xee(e){return e.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");return n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),{type:t,name:r}})}function _ee(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,i=t.length,a;r<i;++r)a=t[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++n]=a;++n?t.length=n:delete this.__on}}}function kee(e,t,r){return function(){var n=this.__on,i,a=wee(t);if(n){for(var o=0,s=n.length;o<s;++o)if((i=n[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=r),i.value=t;return}}this.addEventListener(e.type,a,r),i={type:e.type,name:e.name,value:t,listener:a,options:r},n?n.push(i):this.__on=[i]}}function NT(e,t,r){var n=xee(e+""),i,a=n.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,u=s.length,c;l<u;++l)for(i=0,c=s[l];i<a;++i)if((o=n[i]).type===c.type&&o.name===c.name)return c.value}return}for(s=t?kee:_ee,i=0;i<a;++i)this.each(s(n[i],t,r));return this}var DT=q(()=>{});function PT(e,t,r){var n=Zf(e),i=n.CustomEvent;typeof i=="function"?i=new i(t,r):(i=n.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Eee(e,t){return function(){return PT(this,e,t)}}function Aee(e,t){return function(){return PT(this,e,t.apply(this,arguments))}}function FT(e,t){return this.each((typeof t=="function"?Aee:Eee)(e,t))}var OT=q(()=>{yb()});function*RT(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,a=n.length,o;i<a;++i)(o=n[i])&&(yield o)}var LT=q(()=>{});function Vr(e,t){this._groups=e,this._parents=t}function UT(){return new Vr([[document.documentElement]],p7)}function See(){return this}var p7,Vo,oo=q(()=>{wM();_M();EM();SM();IM();PM();vb();OM();LM();BM();qM();$M();WM();HM();YM();XM();JM();tT();nT();bb();oT();dT();mT();gT();yT();wT();_T();ET();ST();IT();TT();DT();OT();LT();p7=[null];Vr.prototype=UT.prototype={constructor:Vr,select:bM,selectAll:xM,selectChild:kM,selectChildren:AM,filter:CM,data:DM,enter:MM,exit:FM,join:RM,merge:UM,selection:See,order:zM,sort:VM,call:GM,nodes:QM,node:jM,size:KM,empty:ZM,each:eT,attr:rT,style:iT,property:aT,classed:fT,text:pT,html:hT,raise:vT,lower:bT,append:xT,insert:kT,remove:AT,clone:CT,datum:MT,on:NT,dispatch:FT,[Symbol.iterator]:RT};Vo=UT});function Q(e){return typeof e=="string"?new Vr([[document.querySelector(e)]],[document.documentElement]):new Vr([[e]],p7)}var BT=q(()=>{oo()});function zT(e){let t;for(;t=e.sourceEvent;)e=t;return e}var qT=q(()=>{});function so(e,t){if(e=zT(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,n=n.matrixTransform(t.getScreenCTM().inverse()),[n.x,n.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var VT=q(()=>{qT()});function xb(e){return typeof e=="string"?new Vr([document.querySelectorAll(e)],[document.documentElement]):new Vr([l7(e)],p7)}var $T=q(()=>{mb();oo()});var Ae=q(()=>{f7();Hf();VT();BT();$T();oo();Yf();hb();bb()});function Jf(e){e.stopImmediatePropagation()}function I4(e){e.preventDefault(),e.stopImmediatePropagation()}var GT,o2,_b=q(()=>{GT={passive:!1},o2={capture:!0,passive:!1}});function m7(e){var t=e.document.documentElement,r=Q(e).on("dragstart.drag",I4,o2);"onselectstart"in t?r.on("selectstart.drag",I4,o2):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function h7(e,t){var r=e.document.documentElement,n=Q(e).on("dragstart.drag",null);t&&(n.on("click.drag",I4,o2),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}var kb=q(()=>{Ae();_b()});var g7,WT=q(()=>{g7=e=>()=>e});function v7(e,{sourceEvent:t,subject:r,target:n,identifier:i,active:a,x:o,y:s,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}var QT=q(()=>{v7.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e}});function Cee(e){return!e.ctrlKey&&!e.button}function Iee(){return this.parentNode}function Mee(e,t){return t==null?{x:e.x,y:e.y}:t}function Tee(){return navigator.maxTouchPoints||"ontouchstart"in this}function y7(){var e=Cee,t=Iee,r=Mee,n=Tee,i={},a=xe("start","drag","end"),o=0,s,l,u,c,f=0;function d(k){k.on("mousedown.drag",m).filter(n).on("touchstart.drag",A).on("touchmove.drag",v,GT).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(k,x){if(!(c||!e.call(this,k,x))){var S=w(this,t.call(this,k,x),k,x,"mouse");S&&(Q(k.view).on("mousemove.drag",h,o2).on("mouseup.drag",g,o2),m7(k.view),Jf(k),u=!1,s=k.clientX,l=k.clientY,S("start",k))}}function h(k){if(I4(k),!u){var x=k.clientX-s,S=k.clientY-l;u=x*x+S*S>f}i.mouse("drag",k)}function g(k){Q(k.view).on("mousemove.drag mouseup.drag",null),h7(k.view,u),I4(k),i.mouse("end",k)}function A(k,x){if(e.call(this,k,x)){var S=k.changedTouches,I=t.call(this,k,x),b=S.length,y,E;for(y=0;y<b;++y)(E=w(this,I,k,x,S[y].identifier,S[y]))&&(Jf(k),E("start",k,S[y]))}}function v(k){var x=k.changedTouches,S=x.length,I,b;for(I=0;I<S;++I)(b=i[x[I].identifier])&&(I4(k),b("drag",k,x[I]))}function _(k){var x=k.changedTouches,S=x.length,I,b;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),I=0;I<S;++I)(b=i[x[I].identifier])&&(Jf(k),b("end",k,x[I]))}function w(k,x,S,I,b,y){var E=a.copy(),M=so(y||S,x),F,N,D;if((D=r.call(k,new v7("beforestart",{sourceEvent:S,target:d,identifier:b,active:o,x:M[0],y:M[1],dx:0,dy:0,dispatch:E}),I))!=null)return F=D.x-M[0]||0,N=D.y-M[1]||0,function O(L,P,U){var B=M,z;switch(L){case"start":i[b]=O,z=o++;break;case"end":delete i[b],--o;case"drag":M=so(U||P,x),z=o;break}E.call(L,k,new v7(L,{sourceEvent:P,subject:D,target:d,identifier:b,active:z,x:M[0]+F,y:M[1]+N,dx:M[0]-B[0],dy:M[1]-B[1],dispatch:E}),I)}}return d.filter=function(k){return arguments.length?(e=typeof k=="function"?k:g7(!!k),d):e},d.container=function(k){return arguments.length?(t=typeof k=="function"?k:g7(k),d):t},d.subject=function(k){return arguments.length?(r=typeof k=="function"?k:g7(k),d):r},d.touchable=function(k){return arguments.length?(n=typeof k=="function"?k:g7(!!k),d):n},d.on=function(){var k=a.on.apply(a,arguments);return k===a?d:k},d.clickDistance=function(k){return arguments.length?(f=(k=+k)*k,d):Math.sqrt(f)},d}var HT=q(()=>{Ye();Ae();kb();_b();WT();QT()});var b7=q(()=>{HT();kb()});function ed(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Eb(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}var jT=q(()=>{});function _7(){}function KT(){return this.rgb().formatHex()}function Uee(){return this.rgb().formatHex8()}function Bee(){return nN(this).formatHsl()}function XT(){return this.rgb().formatRgb()}function Go(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Nee.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?ZT(t):r===3?new na(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?td(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?td(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Dee.exec(e))?new na(t[1],t[2],t[3],1):(t=Pee.exec(e))?new na(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Fee.exec(e))?td(t[1],t[2],t[3],t[4]):(t=Oee.exec(e))?td(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ree.exec(e))?tN(t[1],t[2]/100,t[3]/100,1):(t=Lee.exec(e))?tN(t[1],t[2]/100,t[3]/100,t[4]):YT.hasOwnProperty(e)?ZT(YT[e]):e==="transparent"?new na(NaN,NaN,NaN,0):null}function ZT(e){return new na(e>>16&255,e>>8&255,e&255,1)}function td(e,t,r,n){return n<=0&&(e=t=r=NaN),new na(e,t,r,n)}function zee(e){return e instanceof _7||(e=Go(e)),e?(e=e.rgb(),new na(e.r,e.g,e.b,e.opacity)):new na}function G0(e,t,r,n){return arguments.length===1?zee(e):new na(e,t,r,n==null?1:n)}function na(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function JT(){return`#${s2(this.r)}${s2(this.g)}${s2(this.b)}`}function qee(){return`#${s2(this.r)}${s2(this.g)}${s2(this.b)}${s2((isNaN(this.opacity)?1:this.opacity)*255)}`}function eN(){let e=id(this.opacity);return`${e===1?"rgb(":"rgba("}${l2(this.r)}, ${l2(this.g)}, ${l2(this.b)}${e===1?")":`, ${e})`}`}function id(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function l2(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function s2(e){return e=l2(e),(e<16?"0":"")+e.toString(16)}function tN(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new $o(e,t,r,n)}function nN(e){if(e instanceof $o)return new $o(e.h,e.s,e.l,e.opacity);if(e instanceof _7||(e=Go(e)),!e)return new $o;if(e instanceof $o)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(t===a?o=(r-n)/s+(r<n)*6:r===a?o=(n-t)/s+2:o=(t-r)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=l>0&&l<1?0:o,new $o(o,s,l,e.opacity)}function iN(e,t,r,n){return arguments.length===1?nN(e):new $o(e,t,r,n==null?1:n)}function $o(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function rN(e){return e=(e||0)%360,e<0?e+360:e}function rd(e){return Math.max(0,Math.min(1,e||0))}function Ab(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}var w7,nd,$0,x7,S1,Nee,Dee,Pee,Fee,Oee,Ree,Lee,YT,aN=q(()=>{jT();w7=.7,nd=1/w7,$0="\\s*([+-]?\\d+)\\s*",x7="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",S1="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Nee=/^#([0-9a-f]{3,8})$/,Dee=new RegExp(`^rgb\\(${$0},${$0},${$0}\\)$`),Pee=new RegExp(`^rgb\\(${S1},${S1},${S1}\\)$`),Fee=new RegExp(`^rgba\\(${$0},${$0},${$0},${x7}\\)$`),Oee=new RegExp(`^rgba\\(${S1},${S1},${S1},${x7}\\)$`),Ree=new RegExp(`^hsl\\(${x7},${S1},${S1}\\)$`),Lee=new RegExp(`^hsla\\(${x7},${S1},${S1},${x7}\\)$`),YT={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ed(_7,Go,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:KT,formatHex:KT,formatHex8:Uee,formatHsl:Bee,formatRgb:XT,toString:XT});ed(na,G0,Eb(_7,{brighter(e){return e=e==null?nd:Math.pow(nd,e),new na(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?w7:Math.pow(w7,e),new na(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new na(l2(this.r),l2(this.g),l2(this.b),id(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:JT,formatHex:JT,formatHex8:qee,formatRgb:eN,toString:eN}));ed($o,iN,Eb(_7,{brighter(e){return e=e==null?nd:Math.pow(nd,e),new $o(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?w7:Math.pow(w7,e),new $o(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new na(Ab(e>=240?e-240:e+120,i,n),Ab(e,i,n),Ab(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new $o(rN(this.h),rd(this.s),rd(this.l),id(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=id(this.opacity);return`${e===1?"hsl(":"hsla("}${rN(this.h)}, ${rd(this.s)*100}%, ${rd(this.l)*100}%${e===1?")":`, ${e})`}`}}))});var k7=q(()=>{aN()});function Sb(e,t,r,n,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*r+(1+3*e+3*a-3*o)*n+o*i)/6}function oN(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),i=e[n],a=e[n+1],o=n>0?e[n-1]:2*i-a,s=n<t-1?e[n+2]:2*a-i;return Sb((r-n/t)*t,o,i,a,s)}}var Cb=q(()=>{});function sN(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),i=e[(n+t-1)%t],a=e[n%t],o=e[(n+1)%t],s=e[(n+2)%t];return Sb((r-n/t)*t,i,a,o,s)}}var lN=q(()=>{Cb()});var E7,Ib=q(()=>{E7=e=>()=>e});function Vee(e,t){return function(r){return e+r*t}}function $ee(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function uN(e){return(e=+e)==1?ad:function(t,r){return r-t?$ee(t,r,e):E7(isNaN(t)?r:t)}}function ad(e,t){var r=t-e;return r?Vee(e,r):E7(isNaN(e)?t:e)}var cN=q(()=>{Ib()});function fN(e){return function(t){var r=t.length,n=new Array(r),i=new Array(r),a=new Array(r),o,s;for(o=0;o<r;++o)s=G0(t[o]),n[o]=s.r||0,i[o]=s.g||0,a[o]=s.b||0;return n=e(n),i=e(i),a=e(a),s.opacity=1,function(l){return s.r=n(l),s.g=i(l),s.b=a(l),s+""}}}var C1,Gee,Wee,Mb=q(()=>{k7();Cb();lN();cN();C1=function e(t){var r=uN(t);function n(i,a){var o=r((i=G0(i)).r,(a=G0(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=ad(i.opacity,a.opacity);return function(c){return i.r=o(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return n.gamma=e,n}(1);Gee=fN(oN),Wee=fN(sN)});function dN(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;i<r;++i)n[i]=e[i]*(1-a)+t[i]*a;return n}}function pN(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}var mN=q(()=>{});function hN(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),a=new Array(r),o;for(o=0;o<n;++o)i[o]=lo(e[o],t[o]);for(;o<r;++o)a[o]=t[o];return function(s){for(o=0;o<n;++o)a[o]=i[o](s);return a}}var gN=q(()=>{od()});function vN(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}var yN=q(()=>{});function Rr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var A7=q(()=>{});function bN(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=lo(e[i],t[i]):n[i]=t[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var wN=q(()=>{od()});function Qee(e){return function(){return e}}function Hee(e){return function(t){return e(t)+""}}function S7(e,t){var r=Nb.lastIndex=Tb.lastIndex=0,n,i,a,o=-1,s=[],l=[];for(e=e+"",t=t+"";(n=Nb.exec(e))&&(i=Tb.exec(t));)(a=i.index)>r&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:Rr(n,i)})),r=Tb.lastIndex;return r<t.length&&(a=t.slice(r),s[o]?s[o]+=a:s[++o]=a),s.length<2?l[0]?Hee(l[0].x):Qee(t):(t=l.length,function(u){for(var c=0,f;c<t;++c)s[(f=l[c]).i]=f.x(u);return s.join("")})}var Nb,Tb,Db=q(()=>{A7();Nb=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Tb=new RegExp(Nb.source,"g")});function lo(e,t){var r=typeof t,n;return t==null||r==="boolean"?E7(t):(r==="number"?Rr:r==="string"?(n=Go(t))?(t=n,C1):S7:t instanceof Go?C1:t instanceof Date?vN:pN(t)?dN:Array.isArray(t)?hN:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?bN:Rr)(e,t)}var od=q(()=>{k7();Mb();gN();yN();A7();wN();Db();Ib();mN()});function Pb(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var xN=q(()=>{});function Fb(e,t,r,n,i,a){var o,s,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*r+t*n)&&(r-=e*l,n-=t*l),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,l/=s),e*n<t*r&&(e=-e,t=-t,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*_N,skewX:Math.atan(l)*_N,scaleX:o,scaleY:s}}var _N,sd,kN=q(()=>{_N=180/Math.PI,sd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function EN(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?sd:Fb(t.a,t.b,t.c,t.d,t.e,t.f)}function AN(e){return e==null?sd:(ld||(ld=document.createElementNS("http://www.w3.org/2000/svg","g")),ld.setAttribute("transform",e),(e=ld.transform.baseVal.consolidate())?(e=e.matrix,Fb(e.a,e.b,e.c,e.d,e.e,e.f)):sd)}var ld,SN=q(()=>{kN()});function CN(e,t,r,n){function i(u){return u.length?u.pop()+" ":""}function a(u,c,f,d,m,h){if(u!==f||c!==d){var g=m.push("translate(",null,t,null,r);h.push({i:g-4,x:Rr(u,f)},{i:g-2,x:Rr(c,d)})}else(f||d)&&m.push("translate("+f+t+d+r)}function o(u,c,f,d){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),d.push({i:f.push(i(f)+"rotate(",null,n)-2,x:Rr(u,c)})):c&&f.push(i(f)+"rotate("+c+n)}function s(u,c,f,d){u!==c?d.push({i:f.push(i(f)+"skewX(",null,n)-2,x:Rr(u,c)}):c&&f.push(i(f)+"skewX("+c+n)}function l(u,c,f,d,m,h){if(u!==f||c!==d){var g=m.push(i(m)+"scale(",null,",",null,")");h.push({i:g-4,x:Rr(u,f)},{i:g-2,x:Rr(c,d)})}else(f!==1||d!==1)&&m.push(i(m)+"scale("+f+","+d+")")}return function(u,c){var f=[],d=[];return u=e(u),c=e(c),a(u.translateX,u.translateY,c.translateX,c.translateY,f,d),o(u.rotate,c.rotate,f,d),s(u.skewX,c.skewX,f,d),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,d),u=c=null,function(m){for(var h=-1,g=d.length,A;++h<g;)f[(A=d[h]).i]=A.x(m);return f.join("")}}}var Ob,Rb,IN=q(()=>{A7();SN();Ob=CN(EN,"px, ","px)","deg)"),Rb=CN(AN,", ",")",")")});function MN(e){return((e=Math.exp(e))+1/e)/2}function Yee(e){return((e=Math.exp(e))-1/e)/2}function Kee(e){return((e=Math.exp(2*e))-1)/(e+1)}var jee,C7,TN=q(()=>{jee=1e-12;C7=function e(t,r,n){function i(a,o){var s=a[0],l=a[1],u=a[2],c=o[0],f=o[1],d=o[2],m=c-s,h=f-l,g=m*m+h*h,A,v;if(g<jee)v=Math.log(d/u)/t,A=function(I){return[s+I*m,l+I*h,u*Math.exp(t*I*v)]};else{var _=Math.sqrt(g),w=(d*d-u*u+n*g)/(2*u*r*_),k=(d*d-u*u-n*g)/(2*d*r*_),x=Math.log(Math.sqrt(w*w+1)-w),S=Math.log(Math.sqrt(k*k+1)-k);v=(S-x)/t,A=function(I){var b=I*v,y=MN(x),E=u/(r*_)*(y*Kee(t*b+x)-Yee(x));return[s+E*m,l+E*h,u*y/MN(t*b+x)]}}return A.duration=v*1e3*t/Math.SQRT2,A}return i.rho=function(a){var o=Math.max(.001,+a),s=o*o,l=s*s;return e(o,s,l)},i}(Math.SQRT2,2,4)});function Lb(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e(n/(t-1));return r}var NN=q(()=>{});var Fi=q(()=>{od();A7();xN();Db();IN();TN();Mb();NN()});function P7(){return u2||(FN(Xee),u2=N7.now()+fd)}function Xee(){u2=0}function D7(){this._call=this._time=this._next=null}function M4(e,t,r){var n=new D7;return n.restart(e,t,r),n}function dd(){P7(),++W0;for(var e=ud,t;e;)(t=u2-e._time)>=0&&e._call.call(void 0,t),e=e._next;--W0}function DN(){u2=(cd=N7.now())+fd,W0=M7=0;try{dd()}finally{W0=0,Jee(),u2=0}}function Zee(){var e=N7.now(),t=e-cd;t>PN&&(fd-=t,cd=e)}function Jee(){for(var e,t=ud,r,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:ud=r);T7=e,Ub(n)}function Ub(e){if(!W0){M7&&(M7=clearTimeout(M7));var t=e-u2;t>24?(e<1/0&&(M7=setTimeout(DN,e-N7.now()-fd)),I7&&(I7=clearInterval(I7))):(I7||(cd=N7.now(),I7=setInterval(Zee,PN)),W0=1,FN(DN))}}var W0,M7,I7,PN,ud,T7,cd,u2,fd,N7,FN,Bb=q(()=>{W0=0,M7=0,I7=0,PN=1e3,cd=0,u2=0,fd=0,N7=typeof performance=="object"&&performance.now?performance:Date,FN=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};D7.prototype=M4.prototype={constructor:D7,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?P7():+r)+(t==null?0:+t),!this._next&&T7!==this&&(T7?T7._next=this:ud=this,T7=this),this._call=e,this._time=r,Ub()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ub())}}});function Q0(e,t,r){var n=new D7;return t=t==null?0:+t,n.restart(i=>{n.stop(),e(i+t)},t,r),n}var ON=q(()=>{Bb()});var c2=q(()=>{Bb();ON()});function T4(e,t,r,n,i,a){var o=e.__transition;if(!o)e.__transition={};else if(r in o)return;rte(e,r,{name:t,index:n,group:i,on:ete,tween:tte,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:UN})}function O7(e,t){var r=Un(e,t);if(r.state>UN)throw new Error("too late; already scheduled");return r}function oi(e,t){var r=Un(e,t);if(r.state>pd)throw new Error("too late; already running");return r}function Un(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function rte(e,t,r){var n=e.__transition,i;n[t]=r,r.timer=M4(a,0,r.time);function a(u){r.state=RN,r.timer.restart(o,r.delay,r.time),r.delay<=u&&o(u-r.delay)}function o(u){var c,f,d,m;if(r.state!==RN)return l();for(c in n)if(m=n[c],m.name===r.name){if(m.state===pd)return Q0(o);m.state===LN?(m.state=F7,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete n[c]):+c<t&&(m.state=F7,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete n[c])}if(Q0(function(){r.state===pd&&(r.state=LN,r.timer.restart(s,r.delay,r.time),s(u))}),r.state=md,r.on.call("start",e,e.__data__,r.index,r.group),r.state===md){for(r.state=pd,i=new Array(d=r.tween.length),c=0,f=-1;c<d;++c)(m=r.tween[c].value.call(e,e.__data__,r.index,r.group))&&(i[++f]=m);i.length=f+1}}function s(u){for(var c=u<r.duration?r.ease.call(null,u/r.duration):(r.timer.restart(l),r.state=hd,1),f=-1,d=i.length;++f<d;)i[f].call(e,c);r.state===hd&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=F7,r.timer.stop(),delete n[t];for(var u in n)return;delete e.__transition}}var ete,tte,UN,RN,md,pd,LN,hd,F7,ia=q(()=>{Ye();c2();ete=xe("start","end","cancel","interrupt"),tte=[],UN=0,RN=1,md=2,pd=3,LN=4,hd=5,F7=6});function Wo(e,t){var r=e.__transition,n,i,a=!0,o;if(r){t=t==null?null:t+"";for(o in r){if((n=r[o]).name!==t){a=!1;continue}i=n.state>md&&n.state<hd,n.state=F7,n.timer.stop(),n.on.call(i?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete r[o]}a&&delete e.__transition}}var zb=q(()=>{ia()});function BN(e){return this.each(function(){Wo(this,e)})}var zN=q(()=>{zb()});function nte(e,t){var r,n;return function(){var i=oi(this,e),a=i.tween;if(a!==r){n=r=a;for(var o=0,s=n.length;o<s;++o)if(n[o].name===t){n=n.slice(),n.splice(o,1);break}}i.tween=n}}function ite(e,t,r){var n,i;if(typeof r!="function")throw new Error;return function(){var a=oi(this,e),o=a.tween;if(o!==n){i=(n=o).slice();for(var s={name:t,value:r},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=s;break}l===u&&i.push(s)}a.tween=i}}function qN(e,t){var r=this._id;if(e+="",arguments.length<2){for(var n=Un(this.node(),r).tween,i=0,a=n.length,o;i<a;++i)if((o=n[i]).name===e)return o.value;return null}return this.each((t==null?nte:ite)(r,e,t))}function H0(e,t,r){var n=e._id;return e.each(function(){var i=oi(this,n);(i.value||(i.value={}))[t]=r.apply(this,arguments)}),function(i){return Un(i,n).value[t]}}var R7=q(()=>{ia()});function gd(e,t){var r;return(typeof t=="number"?Rr:t instanceof Go?C1:(r=Go(t))?(t=r,C1):S7)(e,t)}var qb=q(()=>{k7();Fi()});function ate(e){return function(){this.removeAttribute(e)}}function ote(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ste(e,t,r){var n,i=r+"",a;return function(){var o=this.getAttribute(e);return o===i?null:o===n?a:a=t(n=o,r)}}function lte(e,t,r){var n,i=r+"",a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===n?a:a=t(n=o,r)}}function ute(e,t,r){var n,i,a;return function(){var o,s=r(this),l;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),l=s+"",o===l?null:o===n&&l===i?a:(i=l,a=t(n=o,s)))}}function cte(e,t,r){var n,i,a;return function(){var o,s=r(this),l;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),l=s+"",o===l?null:o===n&&l===i?a:(i=l,a=t(n=o,s)))}}function VN(e,t){var r=bs(e),n=r==="transform"?Rb:gd;return this.attrTween(e,typeof t=="function"?(r.local?cte:ute)(r,n,H0(this,"attr."+e,t)):t==null?(r.local?ote:ate)(r):(r.local?lte:ste)(r,n,t))}var $N=q(()=>{Fi();Ae();R7();qb()});function fte(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function dte(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function pte(e,t){var r,n;function i(){var a=t.apply(this,arguments);return a!==n&&(r=(n=a)&&dte(e,a)),r}return i._value=t,i}function mte(e,t){var r,n;function i(){var a=t.apply(this,arguments);return a!==n&&(r=(n=a)&&fte(e,a)),r}return i._value=t,i}function GN(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var n=bs(e);return this.tween(r,(n.local?pte:mte)(n,t))}var WN=q(()=>{Ae()});function hte(e,t){return function(){O7(this,e).delay=+t.apply(this,arguments)}}function gte(e,t){return t=+t,function(){O7(this,e).delay=t}}function QN(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?hte:gte)(t,e)):Un(this.node(),t).delay}var HN=q(()=>{ia()});function vte(e,t){return function(){oi(this,e).duration=+t.apply(this,arguments)}}function yte(e,t){return t=+t,function(){oi(this,e).duration=t}}function jN(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?vte:yte)(t,e)):Un(this.node(),t).duration}var YN=q(()=>{ia()});function bte(e,t){if(typeof t!="function")throw new Error;return function(){oi(this,e).ease=t}}function KN(e){var t=this._id;return arguments.length?this.each(bte(t,e)):Un(this.node(),t).ease}var XN=q(()=>{ia()});function wte(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;oi(this,e).ease=r}}function ZN(e){if(typeof e!="function")throw new Error;return this.each(wte(this._id,e))}var JN=q(()=>{ia()});function eD(e){typeof e!="function"&&(e=c7(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a=t[i],o=a.length,s=n[i]=[],l,u=0;u<o;++u)(l=a[u])&&e.call(l,l.__data__,u,a)&&s.push(l);return new Oi(n,this._parents,this._name,this._id)}var tD=q(()=>{Ae();f2()});function rD(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,n=t.length,i=r.length,a=Math.min(n,i),o=new Array(n),s=0;s<a;++s)for(var l=t[s],u=r[s],c=l.length,f=o[s]=new Array(c),d,m=0;m<c;++m)(d=l[m]||u[m])&&(f[m]=d);for(;s<n;++s)o[s]=t[s];return new Oi(o,this._parents,this._name,this._id)}var nD=q(()=>{f2()});function xte(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function _te(e,t,r){var n,i,a=xte(t)?O7:oi;return function(){var o=a(this,e),s=o.on;s!==n&&(i=(n=s).copy()).on(t,r),o.on=i}}function iD(e,t){var r=this._id;return arguments.length<2?Un(this.node(),r).on.on(e):this.each(_te(r,e,t))}var aD=q(()=>{ia()});function kte(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function oD(){return this.on("end.remove",kte(this._id))}var sD=q(()=>{});function lD(e){var t=this._name,r=this._id;typeof e!="function"&&(e=a2(e));for(var n=this._groups,i=n.length,a=new Array(i),o=0;o<i;++o)for(var s=n[o],l=s.length,u=a[o]=new Array(l),c,f,d=0;d<l;++d)(c=s[d])&&(f=e.call(c,c.__data__,d,s))&&("__data__"in c&&(f.__data__=c.__data__),u[d]=f,T4(u[d],t,r,d,u,Un(c,r)));return new Oi(a,this._parents,t,r)}var uD=q(()=>{Ae();f2();ia()});function cD(e){var t=this._name,r=this._id;typeof e!="function"&&(e=u7(e));for(var n=this._groups,i=n.length,a=[],o=[],s=0;s<i;++s)for(var l=n[s],u=l.length,c,f=0;f<u;++f)if(c=l[f]){for(var d=e.call(c,c.__data__,f,l),m,h=Un(c,r),g=0,A=d.length;g<A;++g)(m=d[g])&&T4(m,t,r,g,d,h);a.push(d),o.push(c)}return new Oi(a,o,t,r)}var fD=q(()=>{Ae();f2();ia()});function dD(){return new Ete(this._groups,this._parents)}var Ete,pD=q(()=>{Ae();Ete=Vo.prototype.constructor});function Ate(e,t){var r,n,i;return function(){var a=C4(this,e),o=(this.style.removeProperty(e),C4(this,e));return a===o?null:a===r&&o===n?i:i=t(r=a,n=o)}}function mD(e){return function(){this.style.removeProperty(e)}}function Ste(e,t,r){var n,i=r+"",a;return function(){var o=C4(this,e);return o===i?null:o===n?a:a=t(n=o,r)}}function Cte(e,t,r){var n,i,a;return function(){var o=C4(this,e),s=r(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(e),C4(this,e))),o===l?null:o===n&&l===i?a:(i=l,a=t(n=o,s))}}function Ite(e,t){var r,n,i,a="style."+t,o="end."+a,s;return function(){var l=oi(this,e),u=l.on,c=l.value[a]==null?s||(s=mD(t)):void 0;(u!==r||i!==c)&&(n=(r=u).copy()).on(o,i=c),l.on=n}}function hD(e,t,r){var n=(e+="")=="transform"?Ob:gd;return t==null?this.styleTween(e,Ate(e,n)).on("end.style."+e,mD(e)):typeof t=="function"?this.styleTween(e,Cte(e,n,H0(this,"style."+e,t))).each(Ite(this._id,e)):this.styleTween(e,Ste(e,n,t),r).on("end.style."+e,null)}var gD=q(()=>{Fi();Ae();ia();R7();qb()});function Mte(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function Tte(e,t,r){var n,i;function a(){var o=t.apply(this,arguments);return o!==i&&(n=(i=o)&&Mte(e,o,r)),n}return a._value=t,a}function vD(e,t,r){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,Tte(e,t,r==null?"":r))}var yD=q(()=>{});function Nte(e){return function(){this.textContent=e}}function Dte(e){return function(){var t=e(this);this.textContent=t==null?"":t}}function bD(e){return this.tween("text",typeof e=="function"?Dte(H0(this,"text",e)):Nte(e==null?"":e+""))}var wD=q(()=>{R7()});function Pte(e){return function(t){this.textContent=e.call(this,t)}}function Fte(e){var t,r;function n(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&Pte(i)),t}return n._value=e,n}function xD(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Fte(e))}var _D=q(()=>{});function kD(){for(var e=this._name,t=this._id,r=vd(),n=this._groups,i=n.length,a=0;a<i;++a)for(var o=n[a],s=o.length,l,u=0;u<s;++u)if(l=o[u]){var c=Un(l,t);T4(l,e,r,u,o,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Oi(n,this._parents,e,r)}var ED=q(()=>{f2();ia()});function AD(){var e,t,r=this,n=r._id,i=r.size();return new Promise(function(a,o){var s={value:o},l={value:function(){--i===0&&a()}};r.each(function(){var u=oi(this,n),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),u.on=t}),i===0&&a()})}var SD=q(()=>{ia()});function Oi(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function CD(e){return Vo().transition(e)}function vd(){return++Ote}var Ote,ws,f2=q(()=>{Ae();$N();WN();HN();YN();XN();JN();tD();nD();aD();sD();uD();fD();pD();gD();yD();wD();_D();ED();R7();SD();Ote=0;ws=Vo.prototype;Oi.prototype=CD.prototype={constructor:Oi,select:lD,selectAll:cD,selectChild:ws.selectChild,selectChildren:ws.selectChildren,filter:eD,merge:rD,selection:dD,transition:kD,call:ws.call,nodes:ws.nodes,node:ws.node,size:ws.size,empty:ws.empty,each:ws.each,on:iD,attr:VN,attrTween:GN,style:hD,styleTween:vD,text:bD,textTween:xD,remove:oD,tween:qN,delay:QN,duration:jN,ease:KN,easeVarying:ZN,end:AD,[Symbol.iterator]:ws[Symbol.iterator]}});var L7,ID=q(()=>{L7=e=>+e});function yd(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var MD=q(()=>{});var U7=q(()=>{ID();MD()});function Lte(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function TD(e){var t,r;e instanceof Oi?(t=e._id,e=e._name):(t=vd(),(r=Rte).time=P7(),e=e==null?null:e+"");for(var n=this._groups,i=n.length,a=0;a<i;++a)for(var o=n[a],s=o.length,l,u=0;u<s;++u)(l=o[u])&&T4(l,e,t,u,o,r||Lte(l,t));return new Oi(n,this._parents,e,t)}var Rte,ND=q(()=>{f2();ia();U7();c2();Rte={time:null,delay:0,duration:250,ease:yd}});var DD=q(()=>{Ae();zN();ND();Vo.prototype.interrupt=BN;Vo.prototype.transition=TD});var B7=q(()=>{DD();zb()});var z7,PD=q(()=>{z7=e=>()=>e});function Vb(e,{sourceEvent:t,target:r,transform:n,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:i}})}var FD=q(()=>{});function Ri(e,t,r){this.k=e,this.x=t,this.y=r}function $b(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Qr;return e.__zoom}var Qr,bd=q(()=>{Ri.prototype={constructor:Ri,scale:function(e){return e===1?this:new Ri(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ri(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};Qr=new Ri(1,0,0);$b.prototype=Ri.prototype});function wd(e){e.stopImmediatePropagation()}function j0(e){e.preventDefault(),e.stopImmediatePropagation()}var OD=q(()=>{});function Ute(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Bte(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function RD(){return this.__zoom||Qr}function zte(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function qte(){return navigator.maxTouchPoints||"ontouchstart"in this}function Vte(e,t,r){var n=e.invertX(t[0][0])-r[0][0],i=e.invertX(t[1][0])-r[1][0],a=e.invertY(t[0][1])-r[0][1],o=e.invertY(t[1][1])-r[1][1];return e.translate(i>n?(n+i)/2:Math.min(0,n)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function Qo(){var e=Ute,t=Bte,r=Vte,n=zte,i=qte,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,l=C7,u=xe("start","zoom","end"),c,f,d,m=500,h=150,g=0,A=10;function v(D){D.property("__zoom",RD).on("wheel.zoom",b,{passive:!1}).on("mousedown.zoom",y).on("dblclick.zoom",E).filter(i).on("touchstart.zoom",M).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}v.transform=function(D,O,L,P){var U=D.selection?D.selection():D;U.property("__zoom",RD),D!==U?x(D,O,L,P):U.interrupt().each(function(){S(this,arguments).event(P).start().zoom(null,typeof O=="function"?O.apply(this,arguments):O).end()})},v.scaleBy=function(D,O,L,P){v.scaleTo(D,function(){var U=this.__zoom.k,B=typeof O=="function"?O.apply(this,arguments):O;return U*B},L,P)},v.scaleTo=function(D,O,L,P){v.transform(D,function(){var U=t.apply(this,arguments),B=this.__zoom,z=L==null?k(U):typeof L=="function"?L.apply(this,arguments):L,V=B.invert(z),G=typeof O=="function"?O.apply(this,arguments):O;return r(w(_(B,G),z,V),U,o)},L,P)},v.translateBy=function(D,O,L,P){v.transform(D,function(){return r(this.__zoom.translate(typeof O=="function"?O.apply(this,arguments):O,typeof L=="function"?L.apply(this,arguments):L),t.apply(this,arguments),o)},null,P)},v.translateTo=function(D,O,L,P,U){v.transform(D,function(){var B=t.apply(this,arguments),z=this.__zoom,V=P==null?k(B):typeof P=="function"?P.apply(this,arguments):P;return r(Qr.translate(V[0],V[1]).scale(z.k).translate(typeof O=="function"?-O.apply(this,arguments):-O,typeof L=="function"?-L.apply(this,arguments):-L),B,o)},P,U)};function _(D,O){return O=Math.max(a[0],Math.min(a[1],O)),O===D.k?D:new Ri(O,D.x,D.y)}function w(D,O,L){var P=O[0]-L[0]*D.k,U=O[1]-L[1]*D.k;return P===D.x&&U===D.y?D:new Ri(D.k,P,U)}function k(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function x(D,O,L,P){D.on("start.zoom",function(){S(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(P).end()}).tween("zoom",function(){var U=this,B=arguments,z=S(U,B).event(P),V=t.apply(U,B),G=L==null?k(V):typeof L=="function"?L.apply(U,B):L,W=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),Y=U.__zoom,J=typeof O=="function"?O.apply(U,B):O,oe=l(Y.invert(G).concat(W/Y.k),J.invert(G).concat(W/J.k));return function(Ce){if(Ce===1)Ce=J;else{var se=oe(Ce),ne=W/se[2];Ce=new Ri(ne,G[0]-se[0]*ne,G[1]-se[1]*ne)}z.zoom(null,Ce)}})}function S(D,O,L){return!L&&D.__zooming||new I(D,O)}function I(D,O){this.that=D,this.args=O,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,O),this.taps=0}I.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,O){return this.mouse&&D!=="mouse"&&(this.mouse[1]=O.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=O.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=O.invert(this.touch1[0])),this.that.__zoom=O,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var O=Q(this.that).datum();u.call(D,this.that,new Vb(D,{sourceEvent:this.sourceEvent,target:v,type:D,transform:this.that.__zoom,dispatch:u}),O)}};function b(D,...O){if(!e.apply(this,arguments))return;var L=S(this,O).event(D),P=this.__zoom,U=Math.max(a[0],Math.min(a[1],P.k*Math.pow(2,n.apply(this,arguments)))),B=so(D);if(L.wheel)(L.mouse[0][0]!==B[0]||L.mouse[0][1]!==B[1])&&(L.mouse[1]=P.invert(L.mouse[0]=B)),clearTimeout(L.wheel);else{if(P.k===U)return;L.mouse=[B,P.invert(B)],Wo(this),L.start()}j0(D),L.wheel=setTimeout(z,h),L.zoom("mouse",r(w(_(P,U),L.mouse[0],L.mouse[1]),L.extent,o));function z(){L.wheel=null,L.end()}}function y(D,...O){if(d||!e.apply(this,arguments))return;var L=D.currentTarget,P=S(this,O,!0).event(D),U=Q(D.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",W,!0),B=so(D,L),z=D.clientX,V=D.clientY;m7(D.view),wd(D),P.mouse=[B,this.__zoom.invert(B)],Wo(this),P.start();function G(Y){if(j0(Y),!P.moved){var J=Y.clientX-z,oe=Y.clientY-V;P.moved=J*J+oe*oe>g}P.event(Y).zoom("mouse",r(w(P.that.__zoom,P.mouse[0]=so(Y,L),P.mouse[1]),P.extent,o))}function W(Y){U.on("mousemove.zoom mouseup.zoom",null),h7(Y.view,P.moved),j0(Y),P.event(Y).end()}}function E(D,...O){if(e.apply(this,arguments)){var L=this.__zoom,P=so(D.changedTouches?D.changedTouches[0]:D,this),U=L.invert(P),B=L.k*(D.shiftKey?.5:2),z=r(w(_(L,B),P,U),t.apply(this,O),o);j0(D),s>0?Q(this).transition().duration(s).call(x,z,P,D):Q(this).call(v.transform,z,P,D)}}function M(D,...O){if(e.apply(this,arguments)){var L=D.touches,P=L.length,U=S(this,O,D.changedTouches.length===P).event(D),B,z,V,G;for(wd(D),z=0;z<P;++z)V=L[z],G=so(V,this),G=[G,this.__zoom.invert(G),V.identifier],U.touch0?!U.touch1&&U.touch0[2]!==G[2]&&(U.touch1=G,U.taps=0):(U.touch0=G,B=!0,U.taps=1+!!c);c&&(c=clearTimeout(c)),B&&(U.taps<2&&(f=G[0],c=setTimeout(function(){c=null},m)),Wo(this),U.start())}}function F(D,...O){if(this.__zooming){var L=S(this,O).event(D),P=D.changedTouches,U=P.length,B,z,V,G;for(j0(D),B=0;B<U;++B)z=P[B],V=so(z,this),L.touch0&&L.touch0[2]===z.identifier?L.touch0[0]=V:L.touch1&&L.touch1[2]===z.identifier&&(L.touch1[0]=V);if(z=L.that.__zoom,L.touch1){var W=L.touch0[0],Y=L.touch0[1],J=L.touch1[0],oe=L.touch1[1],Ce=(Ce=J[0]-W[0])*Ce+(Ce=J[1]-W[1])*Ce,se=(se=oe[0]-Y[0])*se+(se=oe[1]-Y[1])*se;z=_(z,Math.sqrt(Ce/se)),V=[(W[0]+J[0])/2,(W[1]+J[1])/2],G=[(Y[0]+oe[0])/2,(Y[1]+oe[1])/2]}else if(L.touch0)V=L.touch0[0],G=L.touch0[1];else return;L.zoom("touch",r(w(z,V,G),L.extent,o))}}function N(D,...O){if(this.__zooming){var L=S(this,O).event(D),P=D.changedTouches,U=P.length,B,z;for(wd(D),d&&clearTimeout(d),d=setTimeout(function(){d=null},m),B=0;B<U;++B)z=P[B],L.touch0&&L.touch0[2]===z.identifier?delete L.touch0:L.touch1&&L.touch1[2]===z.identifier&&delete L.touch1;if(L.touch1&&!L.touch0&&(L.touch0=L.touch1,delete L.touch1),L.touch0)L.touch0[1]=this.__zoom.invert(L.touch0[0]);else if(L.end(),L.taps===2&&(z=so(z,this),Math.hypot(f[0]-z[0],f[1]-z[1])<A)){var V=Q(this).on("dblclick.zoom");V&&V.apply(this,arguments)}}}return v.wheelDelta=function(D){return arguments.length?(n=typeof D=="function"?D:z7(+D),v):n},v.filter=function(D){return arguments.length?(e=typeof D=="function"?D:z7(!!D),v):e},v.touchable=function(D){return arguments.length?(i=typeof D=="function"?D:z7(!!D),v):i},v.extent=function(D){return arguments.length?(t=typeof D=="function"?D:z7([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),v):t},v.scaleExtent=function(D){return arguments.length?(a[0]=+D[0],a[1]=+D[1],v):[a[0],a[1]]},v.translateExtent=function(D){return arguments.length?(o[0][0]=+D[0][0],o[1][0]=+D[1][0],o[0][1]=+D[0][1],o[1][1]=+D[1][1],v):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},v.constrain=function(D){return arguments.length?(r=D,v):r},v.duration=function(D){return arguments.length?(s=+D,v):s},v.interpolate=function(D){return arguments.length?(l=D,v):l},v.on=function(){var D=u.on.apply(u,arguments);return D===u?v:D},v.clickDistance=function(D){return arguments.length?(g=(D=+D)*D,v):Math.sqrt(g)},v.tapDistance=function(D){return arguments.length?(A=+D,v):A},v}var LD=q(()=>{Ye();b7();Fi();Ae();B7();PD();FD();bd();OD()});var xs=q(()=>{LD();bd()});var UD={};j(UD,{geoRawMercator:()=>si});function si(){let e=y4,t=512/Math.PI,r=0,n=0,i=[[0,0],[0,0]];function a(o){return o=e(o[0]*Math.PI/180,o[1]*Math.PI/180),[o[0]*t+r,n-o[1]*t]}return a.invert=function(o){return o=e.invert((o[0]-r)/t,(n-o[1])/t),o&&[o[0]*180/Math.PI,o[1]*180/Math.PI]},a.scale=function(o){return arguments.length?(t=+o,a):t},a.translate=function(o){return arguments.length?(r=+o[0],n=+o[1],a):[r,n]},a.clipExtent=function(o){return arguments.length?(i=o,a):i},a.transform=function(o){return arguments.length?(r=+o.x,n=+o.y,t=+o.k,a):Qr.translate(r,n).scale(t)},a.stream=ib({point:function(o,s){let l=a([o,s]);this.stream.point(l[0],l[1])}}).stream,a}var xd=q(()=>{"use strict";Ta();xs()});var zD={};j(zD,{geoOrthoCalcScore:()=>Y0,geoOrthoCanOrthogonalize:()=>N4,geoOrthoMaxOffsetAngle:()=>_d,geoOrthoNormalizedDotProduct:()=>_s});function _s(e,t,r){return zr(r,e)||zr(r,t)?1:k4(e,t,r)}function BD(e,t,r,n,i){var a=Math.abs(e);return a<t||i&&Math.abs(a-1)<t?0:a<r||a>n?e:null}function Y0(e,t,r,n){for(var i=0,a=t?0:1,o=t?e.length:e.length-1,s=e.map(function(g){return g.coord}),l=Math.cos((90-n)*Math.PI/180),u=Math.cos(n*Math.PI/180),c=a;c<o;c++){var f=s[(c-1+s.length)%s.length],d=s[c],m=s[(c+1)%s.length],h=BD(_s(f,m,d),r,l,u);h!==null&&(i=i+2*Math.min(Math.abs(h-1),Math.min(Math.abs(h),Math.abs(h+1))))}return i}function _d(e,t,r){for(var n=-1/0,i=t?0:1,a=t?e.length:e.length-1,o=i;o<a;o++){var s=e[(o-1+e.length)%e.length],l=e[o],u=e[(o+1)%e.length],c=_s(s,u,l),f=Math.acos(Math.abs(c))*180/Math.PI;f>45&&(f=90-f),!(f>=r)&&f>n&&(n=f)}return n===-1/0?null:n}function N4(e,t,r,n,i){for(var a=null,o=t?0:1,s=t?e.length:e.length-1,l=Math.cos((90-n)*Math.PI/180),u=Math.cos(n*Math.PI/180),c=o;c<s;c++){var f=e[(c-1+e.length)%e.length],d=e[c],m=e[(c+1)%e.length],h=BD(_s(f,m,d),r,l,u,i);if(h!==null){if(Math.abs(h)>0)return 1;a=0}}return a}var d2=q(()=>{"use strict";cn()});var qD={};j(qD,{geoAngle:()=>fn,geoChooseEdge:()=>_n,geoEdgeEqual:()=>q0,geoExtent:()=>Me,geoGetSmallestSurroundingRectangle:()=>S4,geoHasLineIntersections:()=>V0,geoHasSelfIntersections:()=>ta,geoLatToMeters:()=>i2,geoLineIntersection:()=>ra,geoLonToMeters:()=>vs,geoMetersToLat:()=>Ln,geoMetersToLon:()=>xn,geoMetersToOffset:()=>b4,geoOffsetToMeters:()=>w4,geoOrthoCalcScore:()=>Y0,geoOrthoCanOrthogonalize:()=>N4,geoOrthoMaxOffsetAngle:()=>_d,geoOrthoNormalizedDotProduct:()=>_s,geoPathHasIntersections:()=>s7,geoPathIntersections:()=>E4,geoPathLength:()=>qo,geoPointInPolygon:()=>io,geoPolygonContainsPolygon:()=>A4,geoPolygonIntersectsPolygon:()=>ao,geoRawMercator:()=>si,geoRotate:()=>E1,geoScaleToZoom:()=>Yt,geoSphericalClosestNode:()=>x4,geoSphericalDistance:()=>wt,geoVecAdd:()=>qr,geoVecAngle:()=>no,geoVecCross:()=>k1,geoVecDot:()=>bi,geoVecEqual:()=>zr,geoVecFloor:()=>Gf,geoVecInterp:()=>Qt,geoVecLength:()=>ft,geoVecLengthSquare:()=>_4,geoVecNormalize:()=>_1,geoVecNormalizedDot:()=>k4,geoVecProject:()=>z0,geoVecScale:()=>Na,geoVecSubtract:()=>Bt,geoViewportEdge:()=>A1,geoZoomToScale:()=>Mn});var He=q(()=>{"use strict";w1();yi();yi();yi();yi();yi();yi();yi();yi();yi();yi();Qn();Qn();Qn();Qn();Qn();Qn();Qn();Qn();Qn();Qn();Qn();Qn();Qn();Qn();Qn();xd();cn();cn();cn();cn();cn();cn();cn();cn();cn();cn();cn();cn();cn();cn();d2();d2();d2();d2()});var $D={};j($D,{allowUpperCaseTagValues:()=>q7,isColourValid:()=>jo,osmAreaKeys:()=>Ho,osmAreaKeysExceptions:()=>K0,osmFlowingWaterwayTagValues:()=>F4,osmIsInterestingTag:()=>I1,osmLifecyclePrefixes:()=>M1,osmLineTags:()=>VD,osmMutuallyExclusiveTagPairs:()=>Hb,osmNodeGeometriesForTags:()=>N1,osmOneWayBackwardTags:()=>Ed,osmOneWayBiDirectionalTags:()=>Ad,osmOneWayForwardTags:()=>kd,osmOneWayTags:()=>Wb,osmPathHighwayTagValues:()=>uo,osmPavedTags:()=>m2,osmPointTags:()=>D4,osmRailwayTrackTagValues:()=>t3,osmRemoveLifecyclePrefix:()=>p2,osmRightSideIsInsideTags:()=>e3,osmRoutableAerowayTags:()=>Qb,osmRoutableHighwayTagValues:()=>aa,osmSemipavedTags:()=>Sd,osmSetAreaKeys:()=>X0,osmSetLineTags:()=>Gb,osmSetPointTags:()=>Z0,osmSetVertexTags:()=>J0,osmShouldRenderDirection:()=>jb,osmTagSuggestingArea:()=>T1,osmVertexTags:()=>P4});import{merge as $te}from"lodash-es";function I1(e){return e!=="attribution"&&e!=="created_by"&&e!=="source"&&e!=="odbl"&&e.indexOf("source:")!==0&&e.indexOf("source_ref")!==0&&e.indexOf("tiger:")!==0}function p2(e){let t=e.split(":");return t.length===1?e:t[0]in M1?e.slice(t[0].length+1):e}function X0(e){Ho=e}function T1(e){if(e.area==="yes")return{area:"yes"};if(e.area==="no")return null;var t={};for(var r in e){let n=p2(r);if(n in Ho&&!(e[r]in Ho[n])||n in K0&&e[r]in K0[n])return t[r]=e[r],t}return null}function Gb(e){VD=e}function Z0(e){D4=e}function J0(e){P4=e}function N1(e){var t={};for(var r in e)if(D4[r]&&(D4[r]["*"]||D4[r][e[r]])&&(t.point=!0),P4[r]&&(P4[r]["*"]||P4[r][e[r]])&&(t.vertex=!0),t.point&&t.vertex)break;return t}function jo(e){return!(!e.match(/^(#([0-9a-fA-F]{3}){1,2}|\w+)$/)||!CSS.supports("color",e)||["unset","inherit","initial","revert"].includes(e))}function jb(e,t){return e.highway||e.traffic_sign||e.traffic_calming||e.barrier?!!(t.highway||t.railway):e.railway?!!t.railway:e.waterway?!!t.waterway:e.cycleway==="asl"?!!t.highway:!0}var M1,Ho,K0,VD,D4,P4,kd,Ed,Ad,Wb,m2,Sd,e3,aa,Qb,uo,t3,F4,q7,Hb,Dr=q(()=>{"use strict";M1={proposed:!0,planned:!0,construction:!0,disused:!0,abandoned:!0,was:!0,dismantled:!0,razed:!0,demolished:!0,destroyed:!0,removed:!0,obliterated:!0,intermittent:!0};Ho={};K0={highway:{elevator:!0,rest_area:!0,services:!0},public_transport:{platform:!0},railway:{platform:!0,roundhouse:!0,station:!0,traverser:!0,turntable:!0,wash:!0,ventilation_shaft:!0},waterway:{dam:!0},amenity:{bicycle_parking:!0}};VD={};D4={};P4={};kd={aerialway:{chair_lift:!0,drag_lift:!0,"j-bar":!0,magic_carpet:!0,mixed_lift:!0,platter:!0,rope_tow:!0,"t-bar":!0,zip_line:!0},conveying:{forward:!0},highway:{motorway:!0},junction:{circular:!0,roundabout:!0},man_made:{goods_conveyor:!0,"piste:halfpipe":!0},oneway:{yes:!0},"piste:type":{downhill:!0,sled:!0,yes:!0},"seamark:type":{"two-way_route":!0,recommended_traffic_lane:!0,separation_lane:!0,separation_roundabout:!0},waterway:{canal:!0,ditch:!0,drain:!0,fish_pass:!0,flowline:!0,pressurised:!0,river:!0,spillway:!0,stream:!0,tidal_channel:!0}},Ed={conveying:{backward:!0},oneway:{"-1":!0}},Ad={conveying:{reversible:!0},oneway:{alternating:!0,reversible:!0}},Wb=$te(kd,Ed,Ad),m2={surface:{paved:!0,asphalt:!0,concrete:!0,chipseal:!0,"concrete:lanes":!0,"concrete:plates":!0},tracktype:{grade1:!0}},Sd={surface:{cobblestone:!0,"cobblestone:flattened":!0,unhewn_cobblestone:!0,sett:!0,paving_stones:!0,metal:!0,wood:!0}},e3={natural:{cliff:!0,coastline:"coastline"},barrier:{retaining_wall:!0,kerb:!0,guard_rail:!0,city_wall:!0},man_made:{embankment:!0,quay:!0},waterway:{weir:!0}},aa={motorway:!0,trunk:!0,primary:!0,secondary:!0,tertiary:!0,residential:!0,motorway_link:!0,trunk_link:!0,primary_link:!0,secondary_link:!0,tertiary_link:!0,unclassified:!0,road:!0,service:!0,track:!0,living_street:!0,bus_guideway:!0,busway:!0,path:!0,footway:!0,cycleway:!0,bridleway:!0,pedestrian:!0,corridor:!0,steps:!0,ladder:!0},Qb={runway:!0,taxiway:!0},uo={path:!0,footway:!0,cycleway:!0,bridleway:!0,pedestrian:!0,corridor:!0,steps:!0,ladder:!0},t3={rail:!0,light_rail:!0,tram:!0,subway:!0,monorail:!0,funicular:!0,miniature:!0,narrow_gauge:!0,disused:!0,preserved:!0},F4={canal:!0,ditch:!0,drain:!0,fish_pass:!0,flowline:!0,river:!0,stream:!0,tidal_channel:!0},q7=/network|taxon|genus|species|brand|grape_variety|royal_cypher|listed_status|booth|rating|stars|:output|_hours|_times|_ref|manufacturer|country|target|brewery|cai_scale|traffic_sign/;Hb=[["noname","name"],["noref","ref"],["nohousenumber","addr:housenumber"],["noaddress","addr:housenumber"],["noaddress","addr:housename"],["noaddress","addr:unit"],["addr:nostreet","addr:street"]]});var GD={};j(GD,{utilArrayChunk:()=>ks,utilArrayDifference:()=>yr,utilArrayFlatten:()=>D1,utilArrayGroupBy:()=>pr,utilArrayIdentical:()=>dn,utilArrayIntersection:()=>Cr,utilArrayUnion:()=>Ht,utilArrayUniq:()=>Je,utilArrayUniqBy:()=>P1});function dn(e,t){if(e===t)return!0;var r=e.length;if(r!==t.length)return!1;for(;r--;)if(e[r]!==t[r])return!1;return!0}function yr(e,t){var r=new Set(t);return Array.from(new Set(e)).filter(function(n){return!r.has(n)})}function Cr(e,t){var r=new Set(t);return Array.from(new Set(e)).filter(function(n){return r.has(n)})}function Ht(e,t){var r=new Set(e);return t.forEach(function(n){r.add(n)}),Array.from(r)}function Je(e){return Array.from(new Set(e))}function ks(e,t){if(!t||t<0)return[e.slice()];var r=new Array(Math.ceil(e.length/t));return Array.from(r,function(n,i){return e.slice(i*t,i*t+t)})}function D1(e){return e.reduce(function(t,r){return t.concat(r)},[])}function pr(e,t){return e.reduce(function(r,n){var i=typeof t=="function"?t(n):n[t];return(r[i]=r[i]||[]).push(n),r},{})}function P1(e,t){var r=new Set;return e.reduce(function(n,i){var a=typeof t=="function"?t(i):i[t];return a&&!r.has(a)&&(r.add(a),n.push(i)),n},[])}var Mr=q(()=>{"use strict"});var Td=an(Md=>{Md.remove=Gte;var Id=[{base:" ",chars:"\xA0"},{base:"0",chars:"\u07C0"},{base:"A",chars:"\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"},{base:"AA",chars:"\uA732"},{base:"AE",chars:"\xC6\u01FC\u01E2"},{base:"AO",chars:"\uA734"},{base:"AU",chars:"\uA736"},{base:"AV",chars:"\uA738\uA73A"},{base:"AY",chars:"\uA73C"},{base:"B",chars:"\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0181"},{base:"C",chars:"\u24B8\uFF23\uA73E\u1E08\u0106C\u0108\u010A\u010C\xC7\u0187\u023B"},{base:"D",chars:"\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018A\u0189\u1D05\uA779"},{base:"Dh",chars:"\xD0"},{base:"DZ",chars:"\u01F1\u01C4"},{base:"Dz",chars:"\u01F2\u01C5"},{base:"E",chars:"\u025B\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E\u1D07"},{base:"F",chars:"\uA77C\u24BB\uFF26\u1E1E\u0191\uA77B"},{base:"G",chars:"\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E\u0262"},{base:"H",chars:"\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"},{base:"I",chars:"\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"},{base:"J",chars:"\u24BF\uFF2A\u0134\u0248\u0237"},{base:"K",chars:"\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"},{base:"L",chars:"\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"},{base:"LJ",chars:"\u01C7"},{base:"Lj",chars:"\u01C8"},{base:"M",chars:"\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C\u03FB"},{base:"N",chars:"\uA7A4\u0220\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u019D\uA790\u1D0E"},{base:"NJ",chars:"\u01CA"},{base:"Nj",chars:"\u01CB"},{base:"O",chars:"\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"},{base:"OE",chars:"\u0152"},{base:"OI",chars:"\u01A2"},{base:"OO",chars:"\uA74E"},{base:"OU",chars:"\u0222"},{base:"P",chars:"\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"},{base:"Q",chars:"\u24C6\uFF31\uA756\uA758\u024A"},{base:"R",chars:"\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"},{base:"S",chars:"\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"},{base:"T",chars:"\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"},{base:"Th",chars:"\xDE"},{base:"TZ",chars:"\uA728"},{base:"U",chars:"\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"},{base:"V",chars:"\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"},{base:"VY",chars:"\uA760"},{base:"W",chars:"\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"},{base:"X",chars:"\u24CD\uFF38\u1E8A\u1E8C"},{base:"Y",chars:"\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"},{base:"Z",chars:"\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"},{base:"a",chars:"\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250\u0251"},{base:"aa",chars:"\uA733"},{base:"ae",chars:"\xE6\u01FD\u01E3"},{base:"ao",chars:"\uA735"},{base:"au",chars:"\uA737"},{base:"av",chars:"\uA739\uA73B"},{base:"ay",chars:"\uA73D"},{base:"b",chars:"\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253\u0182"},{base:"c",chars:"\uFF43\u24D2\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"},{base:"d",chars:"\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\u018B\u13E7\u0501\uA7AA"},{base:"dh",chars:"\xF0"},{base:"dz",chars:"\u01F3\u01C6"},{base:"e",chars:"\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u01DD"},{base:"f",chars:"\u24D5\uFF46\u1E1F\u0192"},{base:"ff",chars:"\uFB00"},{base:"fi",chars:"\uFB01"},{base:"fl",chars:"\uFB02"},{base:"ffi",chars:"\uFB03"},{base:"ffl",chars:"\uFB04"},{base:"g",chars:"\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\uA77F\u1D79"},{base:"h",chars:"\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"},{base:"hv",chars:"\u0195"},{base:"i",chars:"\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"},{base:"j",chars:"\u24D9\uFF4A\u0135\u01F0\u0249"},{base:"k",chars:"\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"},{base:"l",chars:"\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747\u026D"},{base:"lj",chars:"\u01C9"},{base:"m",chars:"\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"},{base:"n",chars:"\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5\u043B\u0509"},{base:"nj",chars:"\u01CC"},{base:"o",chars:"\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\uA74B\uA74D\u0275\u0254\u1D11"},{base:"oe",chars:"\u0153"},{base:"oi",chars:"\u01A3"},{base:"oo",chars:"\uA74F"},{base:"ou",chars:"\u0223"},{base:"p",chars:"\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755\u03C1"},{base:"q",chars:"\u24E0\uFF51\u024B\uA757\uA759"},{base:"r",chars:"\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"},{base:"s",chars:"\u24E2\uFF53\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B\u0282"},{base:"ss",chars:"\xDF"},{base:"t",chars:"\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"},{base:"th",chars:"\xFE"},{base:"tz",chars:"\uA729"},{base:"u",chars:"\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"},{base:"v",chars:"\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"},{base:"vy",chars:"\uA761"},{base:"w",chars:"\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"},{base:"x",chars:"\u24E7\uFF58\u1E8B\u1E8D"},{base:"y",chars:"\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"},{base:"z",chars:"\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"}],Kb={};for(V7=0;V7<Id.length;V7+=1)for(Yb=Id[V7].chars,Cd=0;Cd<Yb.length;Cd+=1)Kb[Yb[Cd]]=Id[V7].base;var Yb,Cd,V7;function Gte(e){return e.replace(/[^\u0000-\u007e]/g,function(t){return Kb[t]||t})}Md.replacementList=Id;Md.diacriticsMap=Kb});var WD={};j(WD,{fixRTLTextForSvg:()=>Xb,rtlRegex:()=>Nd});import{WordShaper as Wte}from"alif-toolkit";function Xb(e){var t="",r=[],n=/[\u0600-\u06FF]/g,i=/[\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06ED]/g,a=/[\u0660-\u066C\u06F0-\u06F9]+/g,o=/[\u07A6-\u07B0]/,s=/[\u0591-\u05bd\u05bf\u05c1-\u05c5\u05c7]/;n.test(e)&&(e=Wte(e));for(var l=0;l<e.length;l++){var u=e[l];a.test(u)?(t+=r.reverse().join(""),r=[u]):(r.length&&a.test(r[r.length-1])&&(t+=r.reverse().join(""),r=[]),(o.test(u)||s.test(u)||i.test(u))&&r.length?r[r.length-1]+=u:Nd.test(u)||u.charCodeAt(0)>=64336&&u.charCodeAt(0)<=65023||u.charCodeAt(0)>=65136&&u.charCodeAt(0)<=65279?r.push(u):u===" "&&r.length?r=[r.reverse().join("")+" "]:(t+=r.reverse().join("")+u,r=[]))}return t+=r.reverse().join(""),t}var Nd,Zb=q(()=>{"use strict";Nd=/[\u0590-\u05FF\u0600-\u06FF\u0750-\u07BF\u08A0–\u08BF]/});var Jb=an((QD,$7)=>{(function(e){"use strict";function t(n){var i=n.replace(/[^0-9.]/g,"").match(/[0-9]*\.|[0-9]+/g)||[];return n={major:+i[0]||0,minor:+i[1]||0,patch:+i[2]||0,build:+i[3]||0},n.isEmpty=!n.major&&!n.minor&&!n.patch&&!n.build,n.parsed=[n.major,n.minor,n.patch,n.build],n.text=n.parsed.join("."),n.compare=r,n}function r(n){typeof n=="string"&&(n=t(n));for(var i=0;i<4;i++)if(this.parsed[i]!==n.parsed[i])return this.parsed[i]>n.parsed[i]?1:-1;return 0}typeof $7=="object"&&$7&&typeof $7.exports=="object"?$7.exports=t:e.parseVersion=t})(QD)});var r3,G7,Dd,jD,YD,HD,h2,KD,XD,ZD,O4=q(()=>{"use strict";r3="https://cdn.jsdelivr.net/npm/@openstreetmap/id-tagging-schema@{presets_version}/",G7="https://raw.githubusercontent.com/vindagollc/kepler-map-styles/refs/heads/test-preset/proviso-ai-presets/",Dd="https://cdn.jsdelivr.net/npm/osm-community-index@{version}/",jD="https://cdn.jsdelivr.net/npm/wmf-sitematrix@{version}/",YD="https://cdn.jsdelivr.net/npm/name-suggestion-index@{version}/",HD={live:{url:"https://www.openstreetmap.org",apiUrl:"https://api.openstreetmap.org",client_id:"0tmNTmd0Jo1dQp4AUmMBLtGiD9YpMuXzHefitcuVStc"},dev:{url:"https://api06.dev.openstreetmap.org",client_id:"Ee1wWJ6UlpERbF6BfTNOpwn0R8k_06mvMXdDUkeHMgw"}},h2=[];h2.push(HD.live),h2.push(HD.dev);KD="https://taginfo.openstreetmap.org/api/4/",XD="https://nominatim.openstreetmap.org/",ZD=!0});var Es,Pd=q(()=>{Es={name:"gaussian-id",version:"2.34.1",description:"A friendly editor for OpenStreetMap",main:"dist/iD.min.js",type:"module",exports:{".":{import:"./dist/iD.min.js"},"./dist/iD.css":{default:"./dist/iD.css"}},files:["dist","scripts","config","svg"],repository:"github:openstreetmap/iD",homepage:"https://github.com/openstreetmap/iD",bugs:"https://github.com/openstreetmap/iD/issues",keywords:["editor","openstreetmap"],license:"ISC",scripts:{all:"run-s clean build dist",build:"run-s build:css build:data build:js","build:css":"node scripts/build_css.js","build:data":"shx mkdir -p dist/data && node scripts/build_data.js","build:stats":"node config/esbuild.config.mjs --stats && esbuild-visualizer --metadata dist/esbuild.json --exclude *.png --filename docs/statistics.html && shx rm dist/esbuild.json","build:js":"node config/esbuild.config.mjs","build:js:watch":"node config/esbuild.config.mjs --watch",clean:"shx rm -f dist/esbuild.json dist/*.js dist/*.map dist/*.css dist/img/*.svg",dist:"run-p dist:**","dist:mapillary":"shx mkdir -p dist/mapillary-js && shx cp -R node_modules/mapillary-js/dist/* dist/mapillary-js/","dist:pannellum":"shx mkdir -p dist/pannellum && shx cp -R node_modules/pannellum/build/* dist/pannellum/","dist:min":"node config/esbuild.config.min.mjs","dist:svg:iD":'svg-sprite --symbol --symbol-dest . --shape-id-generator "iD-%s" --symbol-sprite dist/img/iD-sprite.svg "svg/iD-sprite/**/*.svg"',"dist:svg:community":'svg-sprite --symbol --symbol-dest . --shape-id-generator "community-%s" --symbol-sprite dist/img/community-sprite.svg node_modules/osm-community-index/dist/img/*.svg',"dist:svg:fa":"svg-sprite --symbol --symbol-dest . --symbol-sprite dist/img/fa-sprite.svg svg/fontawesome/*.svg","dist:svg:maki":'svg-sprite --symbol --symbol-dest . --shape-id-generator "maki-%s" --symbol-sprite dist/img/maki-sprite.svg node_modules/@mapbox/maki/icons/*.svg',"dist:svg:mapillary:signs":"svg-sprite --symbol --symbol-dest . --symbol-sprite dist/img/mapillary-sprite.svg node_modules/@rapideditor/mapillary_sprite_source/package_signs/*.svg","dist:svg:mapillary:objects":"svg-sprite --symbol --symbol-dest . --symbol-sprite dist/img/mapillary-object-sprite.svg node_modules/@rapideditor/mapillary_sprite_source/package_objects/*.svg","dist:svg:roentgen":'svg-sprite --shape-id-generator "roentgen-%s" --shape-dim-width 16 --shape-dim-height 16 --symbol --symbol-dest . --symbol-sprite dist/img/roentgen-sprite.svg svg/roentgen/*.svg',"dist:svg:temaki":'svg-sprite --symbol --symbol-dest . --shape-id-generator "temaki-%s" --symbol-sprite dist/img/temaki-sprite.svg node_modules/@rapideditor/temaki/icons/*.svg',imagery:"node scripts/update_imagery.js",lint:"eslint config scripts test/spec modules","lint:fix":"eslint scripts test/spec modules --fix",start:"run-s start:watch","start:single-build":"run-p build:js start:server","start:watch":"run-p build:js:watch start:server","start:server":"node scripts/server.js",test:"npm-run-all -s lint build test:spec","test:spec":"vitest --no-isolate",translations:"node scripts/update_locales.js",prepublishOnly:"npm run build && cp README.md LICENSE.md dist/ || true"},dependencies:{"@mapbox/geojson-area":"^0.2.2","@mapbox/sexagesimal":"1.2.0","@mapbox/vector-tile":"^2.0.3","@rapideditor/country-coder":"~5.3.1","@rapideditor/location-conflation":"~1.4.1","@tmcw/togeojson":"^7.0.0","@turf/bbox":"^7.2.0","@turf/bbox-clip":"^7.2.0","abortcontroller-polyfill":"^1.7.8","aes-js":"^3.1.2","alif-toolkit":"^1.3.0","core-js-bundle":"^3.41.0",diacritics:"1.3.0",exifr:"^7.1.3","fast-deep-equal":"~3.1.1","fast-json-stable-stringify":"2.1.0","lodash-es":"~4.17.15",marked:"~15.0.8","node-diff3":"~3.1.0","osm-auth":"~2.6.0",pannellum:"2.5.6",pbf:"^4.0.1","polygon-clipping":"~0.15.7",rbush:"4.0.1",vitest:"^3.1.1","whatwg-fetch":"^3.6.20","which-polygon":"2.2.1"},devDependencies:{"@fortawesome/fontawesome-svg-core":"~6.7.2","@fortawesome/free-brands-svg-icons":"~6.7.2","@fortawesome/free-regular-svg-icons":"~6.7.2","@fortawesome/free-solid-svg-icons":"~6.7.2","@mapbox/maki":"^8.2.0","@openstreetmap/id-tagging-schema":"^6.10.0","@rapideditor/mapillary_sprite_source":"^1.8.0","@rapideditor/temaki":"^5.9.0","@transifex/api":"^7.1.3","@types/chai":"^5.2.1","@types/d3":"^7.4.3","@types/geojson":"^7946.0.16","@types/happen":"^0.3.0","@types/lodash-es":"^4.17.12","@types/node":"^22.14.0","@types/sinon":"^17.0.3","@types/sinon-chai":"^4.0.0",autoprefixer:"^10.4.21",browserslist:"^4.24.4","browserslist-to-esbuild":"^2.1.1",chai:"^5.2.0",chalk:"^4.1.2","cldr-core":"^47.0.0","cldr-localenames-full":"^47.0.0","concat-files":"^0.1.1",d3:"~7.9.0",dotenv:"^16.4.7","editor-layer-index":"github:osmlab/editor-layer-index#gh-pages",esbuild:"^0.25.2","esbuild-visualizer":"^0.7.0",eslint:"^9.24.0","fetch-mock":"^11.1.1",gaze:"^1.1.3",glob:"^10.4.5",happen:"^0.3.2","js-yaml":"^4.0.0",jsdom:"^26.0.0","json-stringify-pretty-compact":"^3.0.0","mapillary-js":"4.1.2",minimist:"^1.2.8","name-suggestion-index":"~6.0","netlify-cli":"^19.1.5","npm-run-all":"^4.0.0","osm-community-index":"~5.9.1",postcss:"^8.5.3","postcss-prefix-selector":"^2.1.1","serve-handler":"^6.1.6",shelljs:"^0.9.2",shx:"^0.4.0",sinon:"^11.1.2","sinon-chai":"^4.0.0",smash:"0.0","svg-sprite":"2.0.4",vparse:"~1.1.0"},engines:{node:">=18"},browserslist:["> 0.3%, last 6 major versions, not dead, Firefox ESR, maintained node versions"]}});var eP=an((ew,JD)=>{(function(e){"use strict";function t(B){return parseInt(B)===B}function r(B){if(!t(B.length))return!1;for(var z=0;z<B.length;z++)if(!t(B[z])||B[z]<0||B[z]>255)return!1;return!0}function n(B,z){if(B.buffer&&B.name==="Uint8Array")return z&&(B.slice?B=B.slice():B=Array.prototype.slice.call(B)),B;if(Array.isArray(B)){if(!r(B))throw new Error("Array contains invalid value: "+B);return new Uint8Array(B)}if(t(B.length)&&r(B))return new Uint8Array(B);throw new Error("unsupported array-like object")}function i(B){return new Uint8Array(B)}function a(B,z,V,G,W){(G!=null||W!=null)&&(B.slice?B=B.slice(G,W):B=Array.prototype.slice.call(B,G,W)),z.set(B,V)}var o=function(){function B(V){var G=[],W=0;for(V=encodeURI(V);W<V.length;){var Y=V.charCodeAt(W++);Y===37?(G.push(parseInt(V.substr(W,2),16)),W+=2):G.push(Y)}return n(G)}function z(V){for(var G=[],W=0;W<V.length;){var Y=V[W];Y<128?(G.push(String.fromCharCode(Y)),W++):Y>191&&Y<224?(G.push(String.fromCharCode((Y&31)<<6|V[W+1]&63)),W+=2):(G.push(String.fromCharCode((Y&15)<<12|(V[W+1]&63)<<6|V[W+2]&63)),W+=3)}return G.join("")}return{toBytes:B,fromBytes:z}}(),s=function(){function B(G){for(var W=[],Y=0;Y<G.length;Y+=2)W.push(parseInt(G.substr(Y,2),16));return W}var z="0123456789abcdef";function V(G){for(var W=[],Y=0;Y<G.length;Y++){var J=G[Y];W.push(z[(J&240)>>4]+z[J&15])}return W.join("")}return{toBytes:B,fromBytes:V}}(),l={16:10,24:12,32:14},u=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],c=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],f=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],d=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],m=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],h=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],g=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],A=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],v=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],_=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],k=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],x=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],S=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],I=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function b(B){for(var z=[],V=0;V<B.length;V+=4)z.push(B[V]<<24|B[V+1]<<16|B[V+2]<<8|B[V+3]);return z}var y=function(B){if(!(this instanceof y))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:n(B,!0)}),this._prepare()};y.prototype._prepare=function(){var B=l[this.key.length];if(B==null)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var z=0;z<=B;z++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(var V=(B+1)*4,G=this.key.length/4,W=b(this.key),Y,z=0;z<G;z++)Y=z>>2,this._Ke[Y][z%4]=W[z],this._Kd[B-Y][z%4]=W[z];for(var J=0,oe=G,Ce;oe<V;){if(Ce=W[G-1],W[0]^=c[Ce>>16&255]<<24^c[Ce>>8&255]<<16^c[Ce&255]<<8^c[Ce>>24&255]^u[J]<<24,J+=1,G!=8)for(var z=1;z<G;z++)W[z]^=W[z-1];else{for(var z=1;z<G/2;z++)W[z]^=W[z-1];Ce=W[G/2-1],W[G/2]^=c[Ce&255]^c[Ce>>8&255]<<8^c[Ce>>16&255]<<16^c[Ce>>24&255]<<24;for(var z=G/2+1;z<G;z++)W[z]^=W[z-1]}for(var z=0,se,ne;z<G&&oe<V;)se=oe>>2,ne=oe%4,this._Ke[se][ne]=W[z],this._Kd[B-se][ne]=W[z++],oe++}for(var se=1;se<B;se++)for(var ne=0;ne<4;ne++)Ce=this._Kd[se][ne],this._Kd[se][ne]=k[Ce>>24&255]^x[Ce>>16&255]^S[Ce>>8&255]^I[Ce&255]},y.prototype.encrypt=function(B){if(B.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");for(var z=this._Ke.length-1,V=[0,0,0,0],G=b(B),W=0;W<4;W++)G[W]^=this._Ke[0][W];for(var Y=1;Y<z;Y++){for(var W=0;W<4;W++)V[W]=d[G[W]>>24&255]^m[G[(W+1)%4]>>16&255]^h[G[(W+2)%4]>>8&255]^g[G[(W+3)%4]&255]^this._Ke[Y][W];G=V.slice()}for(var J=i(16),oe,W=0;W<4;W++)oe=this._Ke[z][W],J[4*W]=(c[G[W]>>24&255]^oe>>24)&255,J[4*W+1]=(c[G[(W+1)%4]>>16&255]^oe>>16)&255,J[4*W+2]=(c[G[(W+2)%4]>>8&255]^oe>>8)&255,J[4*W+3]=(c[G[(W+3)%4]&255]^oe)&255;return J},y.prototype.decrypt=function(B){if(B.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var z=this._Kd.length-1,V=[0,0,0,0],G=b(B),W=0;W<4;W++)G[W]^=this._Kd[0][W];for(var Y=1;Y<z;Y++){for(var W=0;W<4;W++)V[W]=A[G[W]>>24&255]^v[G[(W+3)%4]>>16&255]^_[G[(W+2)%4]>>8&255]^w[G[(W+1)%4]&255]^this._Kd[Y][W];G=V.slice()}for(var J=i(16),oe,W=0;W<4;W++)oe=this._Kd[z][W],J[4*W]=(f[G[W]>>24&255]^oe>>24)&255,J[4*W+1]=(f[G[(W+3)%4]>>16&255]^oe>>16)&255,J[4*W+2]=(f[G[(W+2)%4]>>8&255]^oe>>8)&255,J[4*W+3]=(f[G[(W+1)%4]&255]^oe)&255;return J};var E=function(B){if(!(this instanceof E))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new y(B)};E.prototype.encrypt=function(B){if(B=n(B),B.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var z=i(B.length),V=i(16),G=0;G<B.length;G+=16)a(B,V,0,G,G+16),V=this._aes.encrypt(V),a(V,z,G);return z},E.prototype.decrypt=function(B){if(B=n(B),B.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var z=i(B.length),V=i(16),G=0;G<B.length;G+=16)a(B,V,0,G,G+16),V=this._aes.decrypt(V),a(V,z,G);return z};var M=function(B,z){if(!(this instanceof M))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",!z)z=i(16);else if(z.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastCipherblock=n(z,!0),this._aes=new y(B)};M.prototype.encrypt=function(B){if(B=n(B),B.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var z=i(B.length),V=i(16),G=0;G<B.length;G+=16){a(B,V,0,G,G+16);for(var W=0;W<16;W++)V[W]^=this._lastCipherblock[W];this._lastCipherblock=this._aes.encrypt(V),a(this._lastCipherblock,z,G)}return z},M.prototype.decrypt=function(B){if(B=n(B),B.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var z=i(B.length),V=i(16),G=0;G<B.length;G+=16){a(B,V,0,G,G+16),V=this._aes.decrypt(V);for(var W=0;W<16;W++)z[G+W]=V[W]^this._lastCipherblock[W];a(B,this._lastCipherblock,0,G,G+16)}return z};var F=function(B,z,V){if(!(this instanceof F))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",!z)z=i(16);else if(z.length!=16)throw new Error("invalid initialation vector size (must be 16 size)");V||(V=1),this.segmentSize=V,this._shiftRegister=n(z,!0),this._aes=new y(B)};F.prototype.encrypt=function(B){if(B.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var z=n(B,!0),V,G=0;G<z.length;G+=this.segmentSize){V=this._aes.encrypt(this._shiftRegister);for(var W=0;W<this.segmentSize;W++)z[G+W]^=V[W];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(z,this._shiftRegister,16-this.segmentSize,G,G+this.segmentSize)}return z},F.prototype.decrypt=function(B){if(B.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var z=n(B,!0),V,G=0;G<z.length;G+=this.segmentSize){V=this._aes.encrypt(this._shiftRegister);for(var W=0;W<this.segmentSize;W++)z[G+W]^=V[W];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(B,this._shiftRegister,16-this.segmentSize,G,G+this.segmentSize)}return z};var N=function(B,z){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",!z)z=i(16);else if(z.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastPrecipher=n(z,!0),this._lastPrecipherIndex=16,this._aes=new y(B)};N.prototype.encrypt=function(B){for(var z=n(B,!0),V=0;V<z.length;V++)this._lastPrecipherIndex===16&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),z[V]^=this._lastPrecipher[this._lastPrecipherIndex++];return z},N.prototype.decrypt=N.prototype.encrypt;var D=function(B){if(!(this instanceof D))throw Error("Counter must be instanitated with `new`");B!==0&&!B&&(B=1),typeof B=="number"?(this._counter=i(16),this.setValue(B)):this.setBytes(B)};D.prototype.setValue=function(B){if(typeof B!="number"||parseInt(B)!=B)throw new Error("invalid counter value (must be an integer)");if(B>Number.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var z=15;z>=0;--z)this._counter[z]=B%256,B=parseInt(B/256)},D.prototype.setBytes=function(B){if(B=n(B,!0),B.length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=B},D.prototype.increment=function(){for(var B=15;B>=0;B--)if(this._counter[B]===255)this._counter[B]=0;else{this._counter[B]++;break}};var O=function(B,z){if(!(this instanceof O))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",z instanceof D||(z=new D(z)),this._counter=z,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new y(B)};O.prototype.encrypt=function(B){for(var z=n(B,!0),V=0;V<z.length;V++)this._remainingCounterIndex===16&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),z[V]^=this._remainingCounter[this._remainingCounterIndex++];return z},O.prototype.decrypt=O.prototype.encrypt;function L(B){B=n(B,!0);var z=16-B.length%16,V=i(B.length+z);a(B,V);for(var G=B.length;G<V.length;G++)V[G]=z;return V}function P(B){if(B=n(B,!0),B.length<16)throw new Error("PKCS#7 invalid length");var z=B[B.length-1];if(z>16)throw new Error("PKCS#7 padding byte out of range");for(var V=B.length-z,G=0;G<z;G++)if(B[V+G]!==z)throw new Error("PKCS#7 invalid padding byte");var W=i(V);return a(B,W,0,0,V),W}var U={AES:y,Counter:D,ModeOfOperation:{ecb:E,cbc:M,cfb:F,ofb:N,ctr:O},utils:{hex:s,utf8:o},padding:{pkcs7:{pad:L,strip:P}},_arrayTest:{coerceArray:n,createArray:i,copyArray:a}};typeof ew<"u"?JD.exports=U:typeof define=="function"&&define.amd?define([],function(){return U}):(e.aesjs&&(U._aesjs=e.aesjs),e.aesjs=U)})(ew)});var rP={};j(rP,{utilAesDecrypt:()=>As,utilAesEncrypt:()=>Fd});function Fd(e,t){t=t||tP;let r=g2.default.utils.utf8.toBytes(e),i=new g2.default.ModeOfOperation.ctr(t).encrypt(r);return g2.default.utils.hex.fromBytes(i)}function As(e,t){t=t||tP;let r=g2.default.utils.hex.toBytes(e),i=new g2.default.ModeOfOperation.ctr(t).decrypt(r);return g2.default.utils.utf8.fromBytes(i)}var g2,tP,W7=q(()=>{"use strict";g2=or(eP(),1),tP=[250,157,60,79,142,134,229,129,138,126,210,129,29,71,160,208]});var nP={};j(nP,{utilCleanTags:()=>v2});function v2(e){var t={};for(var r in e)if(r){var n=e[r];n!==void 0&&(t[r]=i(r,n))}return t;function i(a,o){function s(c){return/_hours|_times|:conditional$/.test(c)}function l(c){return/^(description|note|fixme|inscription)$/.test(c)}if(l(a))return o;var u=o.split(";").map(function(c){return c.trim()}).join(s(a)?"; ":";");return(a.indexOf("website")!==-1||a.indexOf("email")!==-1||u.indexOf("http")===0)&&(u=u.replace(/[\u200B-\u200F\uFEFF]/g,"")),u}}var tw=q(()=>{"use strict"});var iP={};j(iP,{utilDetect:()=>sr});function sr(e){if(Tt&&!e)return Tt;Tt={};let t=navigator.userAgent,r=null;r=t.match(/(edge)\/?\s*(\.?\d+(\.\d+)*)/i),r!==null&&(Tt.browser=r[1],Tt.version=r[2]),Tt.browser||(r=t.match(/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/i),r!==null&&(Tt.browser="msie",Tt.version=r[1])),Tt.browser||(r=t.match(/(opr)\/?\s*(\.?\d+(\.\d+)*)/i),r!==null&&(Tt.browser="Opera",Tt.version=r[2])),Tt.browser||(r=t.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i),r!==null&&(Tt.browser=r[1],Tt.version=r[2],r=t.match(/version\/([\.\d]+)/i),r!==null&&(Tt.version=r[1]))),Tt.browser||(Tt.browser=navigator.appName,Tt.version=navigator.appVersion),Tt.version=Tt.version.split(/\W/).slice(0,2).join("."),Tt.opera=Tt.browser.toLowerCase()==="opera"&&Number(Tt.version)<15,Tt.browser.toLowerCase()==="msie"?(Tt.ie=!0,Tt.browser="Internet Explorer",Tt.support=!1):(Tt.ie=!1,Tt.support=!0),Tt.filedrop=window.FileReader&&"ondrop"in window,/Win/.test(t)?(Tt.os="win",Tt.platform="Windows"):/Mac/.test(t)?(Tt.os="mac",Tt.platform="Macintosh"):/X11/.test(t)||/Linux/.test(t)?(Tt.os="linux",Tt.platform="Linux"):(Tt.os="win",Tt.platform="Unknown"),Tt.isMobileWebKit=(/\b(iPad|iPhone|iPod)\b/.test(t)||navigator.platform==="MacIntel"&&"maxTouchPoints"in navigator&&navigator.maxTouchPoints>1)&&/WebKit/.test(t)&&!/Edge/.test(t)&&!window.MSStream,Tt.browserLocales=Array.from(new Set([navigator.language].concat(navigator.languages||[]).concat([navigator.userLanguage]).filter(Boolean)));let n=window.top.location,i=n.origin;return i||(i=n.protocol+"//"+n.hostname+(n.port?":"+n.port:"")),Tt.host=i+n.pathname,Tt}var Tt,Li=q(()=>{"use strict"});var aP={};j(aP,{utilGetSetValue:()=>$e});function $e(e,t,r){function n(i,a){function o(){delete this.value}function s(){a(this.value,i)&&(this.value=i)}function l(){var u=i.apply(this,arguments);u==null?delete this.value:a(this.value,u)&&(this.value=u)}return i==null?o:typeof i=="function"?l:s}return arguments.length===1?e.property("value"):(r===void 0&&(r=(i,a)=>i!==a),e.each(n(t,r)))}var rw=q(()=>{"use strict"});var oP={};j(oP,{utilKeybinding:()=>Xe});function Xe(e){var t={};function r(o,s){var l=!1,u=Object.keys(t).map(function(m){return t[m]}),c,f;for(c=0;c<u.length;c++)if(f=u[c],!!f.event.modifiers.shiftKey&&!!f.capture===s&&d(o,f,!0)){f.callback(o),l=!0;break}if(l)return;for(c=0;c<u.length;c++)if(f=u[c],!f.event.modifiers.shiftKey&&!!f.capture===s&&d(o,f,!1)){f.callback(o);break}function d(m,h,g){var A=m,v=!1,_=!0;return A.key!==void 0&&(_=A.key.charCodeAt(0)>127,v=!0,h.event.key===void 0?v=!1:Array.isArray(h.event.key)?h.event.key.map(function(w){return w.toLowerCase()}).indexOf(A.key.toLowerCase())===-1&&(v=!1):A.key.toLowerCase()!==h.event.key.toLowerCase()&&(v=!1)),!v&&(_||h.event.modifiers.altKey)&&(v=A.keyCode===h.event.keyCode),!(!v||!(A.ctrlKey&&A.altKey)&&(A.ctrlKey!==h.event.modifiers.ctrlKey||A.altKey!==h.event.modifiers.altKey)||A.metaKey!==h.event.modifiers.metaKey||g&&A.shiftKey!==h.event.modifiers.shiftKey)}}function n(o){r(o,!0)}function i(o){var s=Q(o.target).node().tagName;s==="INPUT"||s==="SELECT"||s==="TEXTAREA"||r(o,!1)}function a(o){return o=o||Q(document),o.on("keydown.capture."+e,n,!0),o.on("keydown.bubble."+e,i,!1),a}return a.unbind=function(o){return t=[],o=o||Q(document),o.on("keydown.capture."+e,null),o.on("keydown.bubble."+e,null),a},a.clear=function(){return t={},a},a.off=function(o,s){for(var l=Je([].concat(o)),u=0;u<l.length;u++){var c=l[u]+(s?"-capture":"-bubble");delete t[c]}return a},a.on=function(o,s,l){if(typeof s!="function")return a.off(o,l);for(var u=Je([].concat(o)),c=0;c<u.length;c++){var f=u[c]+(l?"-capture":"-bubble"),d={id:f,capture:l,callback:s,event:{key:void 0,keyCode:0,modifiers:{shiftKey:!1,ctrlKey:!1,altKey:!1,metaKey:!1}}};t[f]&&console.warn('warning: duplicate keybinding for "'+f+'"'),t[f]=d;for(var m=u[c].toLowerCase().match(/(?:(?:[^+⇧⌃⌥⌘])+|[⇧⌃⌥⌘]|\+\+|^\+$)/g),h=0;h<m.length;h++)if(m[h]==="++"&&(m[h]="+"),m[h]in Xe.modifierCodes){var g=Xe.modifierProperties[Xe.modifierCodes[m[h]]];d.event.modifiers[g]=!0}else d.event.key=Xe.keys[m[h]]||m[h],m[h]in Xe.keyCodes&&(d.event.keyCode=Xe.keyCodes[m[h]])}return a},a}var co,R4,n3=q(()=>{"use strict";Ae();Mr();Xe.modifierCodes={"\u21E7":16,shift:16,"\u2303":17,ctrl:17,"\u2325":18,alt:18,option:18,"\u2318":91,meta:91,cmd:91,super:91,win:91};Xe.modifierProperties={16:"shiftKey",17:"ctrlKey",18:"altKey",91:"metaKey"};Xe.plusKeys=["plus","ffplus","=","ffequals","\u2260","\xB1"];Xe.minusKeys=["_","-","ffminus","dash","\u2013","\u2014"];Xe.keys={"\u232B":"Backspace",backspace:"Backspace","\u21E5":"Tab","\u21C6":"Tab",tab:"Tab","\u21A9":"Enter","\u21B5":"Enter","\u23CE":"Enter",return:"Enter",enter:"Enter","\u2305":"Enter",pause:"Pause","pause-break":"Pause","\u21EA":"CapsLock",caps:"CapsLock","caps-lock":"CapsLock","\u238B":["Escape","Esc"],escape:["Escape","Esc"],esc:["Escape","Esc"],space:[" ","Spacebar"],"\u2196":"PageUp",pgup:"PageUp","page-up":"PageUp","\u2198":"PageDown",pgdown:"PageDown","page-down":"PageDown","\u21DF":"End",end:"End","\u21DE":"Home",home:"Home",ins:"Insert",insert:"Insert","\u2326":["Delete","Del"],del:["Delete","Del"],delete:["Delete","Del"],"\u2190":["ArrowLeft","Left"],left:["ArrowLeft","Left"],"arrow-left":["ArrowLeft","Left"],"\u2191":["ArrowUp","Up"],up:["ArrowUp","Up"],"arrow-up":["ArrowUp","Up"],"\u2192":["ArrowRight","Right"],right:["ArrowRight","Right"],"arrow-right":["ArrowRight","Right"],"\u2193":["ArrowDown","Down"],down:["ArrowDown","Down"],"arrow-down":["ArrowDown","Down"],"*":["*","Multiply"],star:["*","Multiply"],asterisk:["*","Multiply"],multiply:["*","Multiply"],"+":["+","Add"],plus:["+","Add"],"-":["-","Subtract"],subtract:["-","Subtract"],dash:["-","Subtract"],semicolon:";",equals:"=",comma:",",period:".","full-stop":".",slash:"/","forward-slash":"/",tick:"`","back-quote":"`","open-bracket":"[","back-slash":"\\","close-bracket":"]",quote:"'",apostrophe:"'","num-0":"0","num-1":"1","num-2":"2","num-3":"3","num-4":"4","num-5":"5","num-6":"6","num-7":"7","num-8":"8","num-9":"9",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",f13:"F13",f14:"F14",f15:"F15",f16:"F16",f17:"F17",f18:"F18",f19:"F19",f20:"F20",f21:"F21",f22:"F22",f23:"F23",f24:"F24",f25:"F25"};Xe.keyCodes={"\u232B":8,backspace:8,"\u21E5":9,"\u21C6":9,tab:9,"\u21A9":13,"\u21B5":13,"\u23CE":13,return:13,enter:13,"\u2305":13,pause:19,"pause-break":19,"\u21EA":20,caps:20,"caps-lock":20,"\u238B":27,escape:27,esc:27,space:32,"\u2196":33,pgup:33,"page-up":33,"\u2198":34,pgdown:34,"page-down":34,"\u21DF":35,end:35,"\u21DE":36,home:36,ins:45,insert:45,"\u2326":46,del:46,delete:46,"\u2190":37,left:37,"arrow-left":37,"\u2191":38,up:38,"arrow-up":38,"\u2192":39,right:39,"arrow-right":39,"\u2193":40,down:40,"arrow-down":40,ffequals:61,"*":106,star:106,asterisk:106,multiply:106,"+":107,plus:107,"-":109,subtract:109,"|":124,ffplus:171,ffminus:173,";":186,semicolon:186,"=":187,equals:187,",":188,comma:188,dash:189,".":190,period:190,"full-stop":190,"/":191,slash:191,"forward-slash":191,"`":192,tick:192,"back-quote":192,"[":219,"open-bracket":219,"\\":220,"back-slash":220,"]":221,"close-bracket":221,"'":222,quote:222,apostrophe:222};co=95,R4=0;for(;++co<106;)Xe.keyCodes["num-"+R4]=co,++R4;co=47;R4=0;for(;++co<58;)Xe.keyCodes[R4]=co,++R4;co=111;R4=1;for(;++co<136;)Xe.keyCodes["f"+R4]=co,++R4;co=64;for(;++co<91;)Xe.keyCodes[String.fromCharCode(co).toLowerCase()]=co});var sP={};j(sP,{utilCheckTagDictionary:()=>Ss,utilObjectOmit:()=>Tn});function Tn(e,t){return Object.keys(e).reduce(function(r,n){return t.indexOf(n)===-1&&(r[n]=e[n]),r},{})}function Ss(e,t){for(let r in e){let n=e[r];if(t[r]&&n in t[r])return t[r][n]}}var nw=q(()=>{"use strict"});var lP={};j(lP,{utilRebind:()=>_e});function _e(e,t,...r){for(let n of r)e[n]=Hte(e,t,t[n]);return e}function Hte(e,t,r){return function(){var n=r.apply(t,arguments);return n===t?e:n}}var Yr=q(()=>{"use strict"});var uP={};j(uP,{utilSessionMutex:()=>i3});function i3(e){var t={},r;function n(){if(!(typeof window>"u")){var i=new Date;i.setSeconds(i.getSeconds()+5),document.cookie=e+"=1; expires="+i.toUTCString()+"; sameSite=strict"}}return t.lock=function(){if(r)return!0;var i=document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+e+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1");return i?!1:(n(),r=window.setInterval(n,4e3),!0)},t.unlock=function(){r&&(document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; sameSite=strict",clearInterval(r),r=null)},t.locked=function(){return!!r},t}var iw=q(()=>{"use strict"});var cP={};j(cP,{utilTiler:()=>mr});function mr(){var e=[256,256],t=256,r=256,n=[0,20],i=[e[0]/2,e[1]/2],a=0,o=!1;function s(c,f,d){return Math.max(f,Math.min(c,d))}function l(c){var f=c[0],d=c[1],m=c[2];if(m>=7){var h=Math.pow(2,m-1),g=Math.pow(2,m-6),A=h-g/2,v=h+g/2-1;return f>=A&&f<=v&&d>=A&&d<=v}return!1}function u(){for(var c=Yt(t/(2*Math.PI),r),f=s(Math.round(c),n[0],n[1]),d=0,m=Math.pow(2,f)-1,h=Math.log(r)*Math.LOG2E,g=Math.pow(2,c-f+h),A=[(i[0]-t/2)/g,(i[1]-t/2)/g],v=d4(s(Math.floor(-A[0])-a,d,m+1),s(Math.ceil(e[0]/g-A[0])+a,d,m+1)),_=d4(s(Math.floor(-A[1])-a,d,m+1),s(Math.ceil(e[1]/g-A[1])+a,d,m+1)),w=[],k=0;k<_.length;k++)for(var x=_[k],S=0;S<v.length;S++){var I=v[S];k>=a&&k<=_.length-a&&S>=a&&S<=v.length-a?w.unshift([I,x,f]):w.push([I,x,f])}return w.translate=A,w.scale=g,w}return u.getTiles=function(c){var f=[c.scale()*Math.PI-c.translate()[0],c.scale()*Math.PI-c.translate()[1]];this.size(c.clipExtent()[1]).scale(c.scale()*2*Math.PI).translate(c.translate());var d=u(),m=d.scale;return d.map(function(h){if(o&&l(h))return!1;var g=h[0]*m-f[0],A=h[1]*m-f[1];return{id:h.toString(),xyz:h,extent:Me(c.invert([g,A+m]),c.invert([g+m,A]))}}).filter(Boolean)},u.getGeoJSON=function(c){var f=u.getTiles(c).map(function(d){return{type:"Feature",properties:{id:d.id,name:d.id},geometry:{type:"Polygon",coordinates:[d.extent.polygon()]}}});return{type:"FeatureCollection",features:f}},u.tileSize=function(c){return arguments.length?(r=c,u):r},u.zoomExtent=function(c){return arguments.length?(n=c,u):n},u.size=function(c){return arguments.length?(e=c,u):e},u.scale=function(c){return arguments.length?(t=c,u):t},u.translate=function(c){return arguments.length?(i=c,u):i},u.margin=function(c){return arguments.length?(a=+c,u):a},u.skipNullIsland=function(c){return arguments.length?(o=c,u):o},u}var aw=q(()=>{"use strict";bn();He()});var fP={};j(fP,{utilTriggerEvent:()=>F1});function F1(e,t,r){e.each(function(){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0);for(var i in r)n[i]=r[i];this.dispatchEvent(n)})}var ow=q(()=>{"use strict"});var vP={};j(vP,{decimalCoordinatePair:()=>y2,displayArea:()=>sw,displayLength:()=>a3,dmsCoordinatePair:()=>Da,dmsMatcher:()=>o3});function a3(e,t){var r=e*(t?3.28084:1),n;return t?r>=5280?(r/=5280,n="miles"):n="feet":r>=1e3?(r/=1e3,n="kilometers"):n="meters",T("units."+n,{quantity:r.toLocaleString(pe.localeCode(),{maximumSignificantDigits:4})})}function sw(e,t){var r=pe.localeCode(),n=e*(t?10.7639111056:1),i,a,o,s="",l="";return t?(n>=6969600?(i=n/27878400,s="square_miles"):(i=n,s="square_feet"),n>4356&&n<4356e4&&(a=n/43560,l="acres")):(n>=25e4?(i=n/1e6,s="square_kilometers"):(i=n,s="square_meters"),n>1e3&&n<1e7&&(a=n/1e4,l="hectares")),o=T("units."+s,{quantity:i.toLocaleString(r,{maximumSignificantDigits:4})}),a?T("units.area_pair",{area1:o,area2:T("units."+l,{quantity:a.toLocaleString(r,{maximumSignificantDigits:2})})}):o}function hP(e,t,r){var n=r-t;return((e-t)%n+n)%n+t}function gP(e,t,r){return Math.max(t,Math.min(e,r))}function pP(e,t){e=Number(e),t=Number(t);let r=Math.pow(10,t);return Math.round(e*r)/r}function mP(e,t,r){var n,i=pe.localeCode(),a=Math.floor(Math.abs(e)),o=(Math.abs(e)-a)*60,s=Math.floor(o),l=(o-s)*60,u=pP(l,8),c=pP(u,0);return c===60&&(c=0,s+=1,s===60&&(s=0,a+=1)),n=T("units.arcdegrees",{quantity:a.toLocaleString(i)})+(s!==0||c!==0?T("units.arcminutes",{quantity:s.toLocaleString(i)}):"")+(c!==0?T("units.arcseconds",{quantity:c.toLocaleString(i)}):""),e===0?n:T("units.coordinate",{coordinate:n,direction:T("units."+(e>0?t:r))})}function Da(e){return T("units.coordinate_pair",{latitude:mP(gP(e[1],-90,90),"north","south"),longitude:mP(hP(e[0],-180,180),"east","west")})}function y2(e){return T("units.coordinate_pair",{latitude:gP(e[1],-90,90).toFixed(dP),longitude:hP(e[0],-180,180).toFixed(dP)})}function o3(e,t=void 0){let r=[{condition:/^\s*(-?)\s*(\d+)\s+(\d+)\s+(\d+\.?\d*)\s*\,\s*(-?)\s*(\d+)\s+(\d+)\s+(\d+\.?\d*)\s*$/,parser:function(i){let a=this.condition.exec(i),o=+a[2]+ +a[3]/60+ +a[4]/3600,s=+a[6]+ +a[7]/60+ +a[8]/3600,l=a[1]==="-"?-o:o,u=a[5]==="-"?-s:s;return[l,u]}},{condition:/^\s*(-?)\s*(\d+)\s+(\d+\.?\d*)\s*\,\s*(-?)\s*(\d+)\s+(\d+\.?\d*)\s*$/,parser:function(i){let a=this.condition.exec(i),o=+a[2]+ +a[3]/60,s=+a[5]+ +a[6]/60,l=a[1]==="-"?-o:o,u=a[4]==="-"?-s:s;return[l,u]}},{condition:/^\s*(-?\d+\.?\d*)\s*\/\s*(-?\d+\.?\d*)\s*$/,parser:function(i){let a=this.condition.exec(i);return[+a[1],+a[2]]}},{condition:/^\s*(\d+\.?\d*)\s*\/\s*(-?\d+\.?\d*)\s*\/\s*(-?\d+\.?\d*)\s*$/,parser:function(i){let a=this.condition.exec(i),o=+a[2],s=+a[3],l=+a[1];return[o,s,l]}},{condition:{test:i=>!!n(i)},parser:n}];function n(i){let a=pe.floatParser(t||pe.localeCode()),o=i.split(/,?\s+|\s*[\/\\]\s*/);if(o.length!==2)return!1;let s=a(o[0]),l=a(o[1]);return isNaN(s)||isNaN(l)?!1:[s,l]}for(let i of r)if(i.condition.test(e))return i.parser(e);return null}var dP,L4=q(()=>{"use strict";ue();dP=7});var yP={};j(yP,{dmsCoordinatePair:()=>Da,dmsMatcher:()=>o3,utilAesDecrypt:()=>As,utilAesEncrypt:()=>Fd,utilArrayChunk:()=>ks,utilArrayDifference:()=>yr,utilArrayFlatten:()=>D1,utilArrayGroupBy:()=>pr,utilArrayIdentical:()=>dn,utilArrayIntersection:()=>Cr,utilArrayUnion:()=>Ht,utilArrayUniq:()=>Je,utilArrayUniqBy:()=>P1,utilAsyncMap:()=>Od,utilCheckTagDictionary:()=>Ss,utilCleanOsmString:()=>po,utilCleanTags:()=>v2,utilCombinedTags:()=>c3,utilCompareIDs:()=>d3,utilDeepMemberSelector:()=>l3,utilDetect:()=>sr,utilDisplayName:()=>hr,utilDisplayNameForPath:()=>w2,utilDisplayType:()=>li,utilEditDistance:()=>U4,utilEntityAndDeepMemberIDs:()=>Cs,utilEntityOrDeepMemberSelector:()=>b2,utilEntityOrMemberSelector:()=>Ko,utilEntityRoot:()=>u3,utilEntitySelector:()=>Ui,utilFastMouse:()=>$r,utilFunctor:()=>Et,utilGetAllNodes:()=>ar,utilGetSetValue:()=>$e,utilHashcode:()=>fo,utilHighlightEntities:()=>bt,utilKeybinding:()=>Xe,utilNoAuto:()=>st,utilObjectOmit:()=>Tn,utilOldestID:()=>Zo,utilPrefixCSSProperty:()=>Is,utilPrefixDOMProperty:()=>f3,utilQsString:()=>at,utilRebind:()=>_e,utilSafeClassName:()=>Ms,utilSessionMutex:()=>i3,utilSetTransform:()=>Bn,utilStringQs:()=>Ft,utilTagDiff:()=>Yo,utilTagText:()=>s3,utilTiler:()=>mr,utilTotalExtent:()=>cr,utilTriggerEvent:()=>F1,utilUnicodeCharsCount:()=>Xo,utilUnicodeCharsTruncated:()=>x2,utilUniqueDomId:()=>Hn,utilWrap:()=>B4});var Ie=q(()=>{"use strict";W7();W7();Mr();Mr();Mr();Mr();Mr();Mr();Mr();Mr();Mr();dt();tw();dt();dt();Li();dt();dt();dt();dt();dt();dt();dt();dt();dt();dt();dt();dt();rw();dt();dt();n3();dt();nw();dt();dt();dt();dt();dt();Yr();dt();dt();iw();dt();dt();dt();aw();dt();ow();dt();dt();dt();dt();dt();L4();L4()});var bP={};j(bP,{actionAddMidpoint:()=>Gr});function Gr(e,t){return function(r){r=r.replace(t.move(e.loc));var n=Cr(r.parentWays(r.entity(e.edge[0])),r.parentWays(r.entity(e.edge[1])));return n.forEach(function(i){for(var a=0;a<i.nodes.length-1;a++)if(q0([i.nodes[a],i.nodes[a+1]],e.edge)){r=r.replace(r.entity(i.id).addNode(t.id,a+1));return}}),r}}var Jo=q(()=>{"use strict";He();Ie()});var wP={};j(wP,{actionAddVertex:()=>oa});function oa(e,t,r){return function(n){return n.replace(n.entity(e).addNode(t,r))}}var p3=q(()=>{"use strict"});var xP={};j(xP,{actionChangeMember:()=>O1});function O1(e,t,r){return function(n){return n.replace(n.entity(e).updateMember(t,r))}}var m3=q(()=>{"use strict"});var _P={};j(_P,{actionChangePreset:()=>R1});function R1(e,t,r,n){return function(a){var o=a.entity(e),s=o.geometry(a),l=o.tags;let u=o.extent(a).center();var c;return r&&(c=[],r.addTags&&(c=c.concat(Object.keys(r.addTags))),t&&!t.id.startsWith(r.id)&&r.fields(u).concat(r.moreFields(u)).filter(f=>f.matchGeometry(s)).map(f=>f.key).filter(Boolean).forEach(f=>c.push(f))),t&&(l=t.unsetTags(l,s,c,!1,u)),r&&(l=r.setTags(l,s,n,u)),a.replace(o.update({tags:l}))}}var h3=q(()=>{"use strict"});var kP={};j(kP,{actionChangeTags:()=>tr});function tr(e,t){return function(r){var n=r.entity(e);return r.replace(n.update({tags:t}))}}var Bi=q(()=>{"use strict"});var EP={};j(EP,{cardinal:()=>g3,osmNode:()=>Nt});function Nt(){if(this instanceof Nt)arguments.length&&this.initialize(arguments);else return new Nt().initialize(arguments)}var g3,jte,e1=q(()=>{"use strict";t1();He();Ie();Dr();g3={north:0,n:0,northnortheast:22,nne:22,northeast:45,ne:45,eastnortheast:67,ene:67,east:90,e:90,eastsoutheast:112,ese:112,southeast:135,se:135,southsoutheast:157,sse:157,south:180,s:180,southsouthwest:202,ssw:202,southwest:225,sw:225,westsouthwest:247,wsw:247,west:270,w:270,westnorthwest:292,wnw:292,northwest:315,nw:315,northnorthwest:337,nnw:337};Le.node=Nt;Nt.prototype=Object.create(Le.prototype);jte={type:"node",loc:[9999,9999],extent:function(){return new Me(this.loc)},geometry:function(e){return e.transient(this,"geometry",function(){return e.isPoi(this)?"point":"vertex"})},move:function(e){return this.update({loc:e})},isDegenerate:function(){return!(Array.isArray(this.loc)&&this.loc.length===2&&this.loc[0]>=-180&&this.loc[0]<=180&&this.loc[1]>=-90&&this.loc[1]<=90)},directions:function(e,t){var r,n;if(this.isHighwayIntersection(e)&&(this.tags.stop||"").toLowerCase()==="all")r="all";else{r=(this.tags.direction||"").toLowerCase();var i=/:direction$/i,a=Object.keys(this.tags);for(n=0;n<a.length;n++)if(i.test(a[n])){r=this.tags[a[n]].toLowerCase();break}}if(r==="")return[];var o=r.split(";"),s=[];return o.forEach(function(l){if(g3[l]!==void 0&&(l=g3[l]),l!==""&&!isNaN(+l)){s.push(+l);return}var u=this.tags["traffic_sign:backward"]||l==="backward"||l==="both"||l==="all",c=this.tags["traffic_sign:forward"]||l==="forward"||l==="both"||l==="all";if(!(!c&&!u)){var f={};e.parentWays(this).filter(d=>jb(this.tags,d.tags)).forEach(function(d){var m=d.nodes;for(n=0;n<m.length;n++)m[n]===this.id&&(c&&n>0&&(f[m[n-1]]=!0),u&&n<m.length-1&&(f[m[n+1]]=!0))},this),Object.keys(f).forEach(function(d){s.push(fn(this,e.entity(d),t)*(180/Math.PI)+90)},this)}},this),Je(s)},isCrossing:function(){return this.tags.highway==="crossing"||this.tags.railway&&this.tags.railway.indexOf("crossing")!==-1},isEndpoint:function(e){return e.transient(this,"isEndpoint",function(){var t=this.id;return e.parentWays(this).filter(function(r){return!r.isClosed()&&!!r.affix(t)}).length>0})},isConnected:function(e){return e.transient(this,"isConnected",function(){var t=e.parentWays(this);if(t.length>1){for(var r in t)if(t[r].geometry(e)==="line"&&t[r].hasInterestingTags())return!0}else if(t.length===1){var n=t[0],i=n.nodes.slice();return n.isClosed()&&i.pop(),i.indexOf(this.id)!==i.lastIndexOf(this.id)}return!1})},parentIntersectionWays:function(e){return e.transient(this,"parentIntersectionWays",function(){return e.parentWays(this).filter(function(t){return(t.tags.highway||t.tags.waterway||t.tags.railway||t.tags.aeroway)&&t.geometry(e)==="line"})})},isIntersection:function(e){return this.parentIntersectionWays(e).length>1},isHighwayIntersection:function(e){return e.transient(this,"isHighwayIntersection",function(){return e.parentWays(this).filter(function(t){return t.tags.highway&&t.geometry(e)==="line"}).length>1})},isOnAddressLine:function(e){return e.transient(this,"isOnAddressLine",function(){return e.parentWays(this).filter(function(t){return t.tags.hasOwnProperty("addr:interpolation")&&t.geometry(e)==="line"}).length>0})},asJXON:function(e){var t={node:{"@id":this.osmId(),"@lon":this.loc[0],"@lat":this.loc[1],"@version":this.version||0,tag:Object.keys(this.tags).map(function(r){return{keyAttributes:{k:r,v:this.tags[r]}}},this)}};return e&&(t.node["@changeset"]=e),t},asGeoJSON:function(){return{type:"Point",coordinates:this.loc}}};Object.assign(Nt.prototype,jte)});var AP={};j(AP,{actionCircularize:()=>v3});function v3(e,t,r){r=(r||20)*Math.PI/180;var n=function(i,a){(a===null||!isFinite(a))&&(a=1),a=Math.min(Math.max(+a,0),1);var o=i.entity(e),s={};i.childNodes(o).forEach(function(we){s[we.id]||(s[we.id]=we)}),o.isConvex(i)||(i=n.makeConvex(i));var l=Je(i.childNodes(o)),u=l.filter(function(we){return i.parentWays(we).length!==1}),c=l.map(function(we){return t(we.loc)}),f=u.map(function(we){return t(we.loc)}),d=c.length===2?Qt(c[0],c[1],.5):x1(c),m=yf(c,function(we){return ft(d,we)}),h=B0(c)>0?1:-1,g,A,v,_;if(u.length||(u=[l[0]],f=[c[0]]),u.length===1){var w=l.indexOf(u[0]),k=Math.floor((w+l.length/2)%l.length);u.push(l[k]),f.push(c[k])}for(A=0;A<f.length;A++){var x=(A+1)%u.length,S=u[A],I=u[x],b=l.indexOf(S),y=l.indexOf(I),E=-1,M=y-b,F={},N=[],D,O,L,P,U,B,z,V;M<0&&(M+=l.length);var G=ft(d,f[A])||1e-4;f[A]=[d[0]+(f[A][0]-d[0])/G*m,d[1]+(f[A][1]-d[1])/G*m],B=t.invert(f[A]),z=u[A],V=s[z.id],z=z.move(Qt(V.loc,B,a)),i=i.replace(z),D=Math.atan2(f[A][1]-d[1],f[A][0]-d[0]),O=Math.atan2(f[x][1]-d[1],f[x][0]-d[0]),L=O-D,L*h>0&&(L=-h*(2*Math.PI-Math.abs(L)));do E++,P=L/(M+E);while(Math.abs(P)>r);for(v=1;v<M;v++)U=D+v*P,B=t.invert([d[0]+Math.cos(U)*m,d[1]+Math.sin(U)*m]),z=l[(v+b)%l.length],V=s[z.id],F[z.id]=U,z=z.move(Qt(V.loc,B,a)),i=i.replace(z);for(v=0;v<E;v++){U=D+(M+v)*P,B=t.invert([d[0]+Math.cos(U)*m,d[1]+Math.sin(U)*m]);var W=1/0;for(var Y in F){var J=F[Y],oe=Math.abs(J-U);oe<W&&(W=oe,V=s[Y])}z=Nt({loc:Qt(V.loc,B,a)}),i=i.replace(z),l.splice(y+v,0,z),N.push(z.id)}if(M===1&&N.length){var Ce=o.nodes.lastIndexOf(S.id),se=o.nodes.lastIndexOf(I.id),ne=se-Ce;ne<-1&&(ne=1);var he=i.parentWays(u[A]);for(v=0;v<he.length;v++){var Se=he[v];if(Se!==o&&Se.areAdjacent(S.id,I.id)){var re=Se.nodes.lastIndexOf(S.id),Z=Se.nodes.lastIndexOf(I.id),te=Z-re,ye=Z;for(te<-1&&(te=1),ne!==te&&(N.reverse(),ye=re),_=0;_<N.length;_++)Se=Se.addNode(N[_],ye+_);i=i.replace(Se)}}}}return g=l.map(function(we){return we.id}),g.push(g[0]),o=o.update({nodes:g}),i=i.replace(o),i};return n.makeConvex=function(i){var a=i.entity(e),o=Je(i.childNodes(a)),s=o.map(function(v){return t(v.loc)}),l=B0(s)>0?1:-1,u=ys(s),c,f;for(l===-1&&(o.reverse(),s.reverse()),c=0;c<u.length-1;c++){var d=s.indexOf(u[c]),m=s.indexOf(u[c+1]),h=m-d;for(h<0&&(h+=o.length),f=1;f<h;f++){var g=Qt(u[c],u[c+1],f/h),A=o[(f+d)%o.length].move(t.invert(g));i=i.replace(A)}}return i},n.disabled=function(i){if(!i.entity(e).isClosed())return"not_closed";var a=i.entity(e),o=Je(i.childNodes(a)),s=o.map(function(k){return t(k.loc)}),l=ys(s),u=Math.PI/180;if(l.length!==s.length||l.length<3)return!1;var c=x1(s),f=_4(c,s[0]),d,m;for(d=0;d<l.length;d++){m=l[d];var h=_4(m,c),g=Math.abs(h-f);if(g>.05*f)return!1}for(d=0;d<l.length;d++){m=l[d];var A=l[(d+1)%l.length],v=Math.atan2(m[1]-c[1],m[0]-c[0]),_=Math.atan2(A[1]-c[1],A[0]-c[0]),w=_-v;if(w<0&&(w=-w),w>Math.PI&&(w=2*Math.PI-w),w>r+u)return!1}return"already_circular"},n.transitionable=!0,n}var Rd=q(()=>{"use strict";bn();o7();He();e1();Ie();cn()});var SP={};j(SP,{actionDeleteWay:()=>sa});function sa(e){function t(n,i){if(i.parentWays(n).length||i.parentRelations(n).length)return!1;var a=N1(n.tags);return a.point?!1:a.vertex?!0:!n.hasInterestingTags()}var r=function(n){var i=n.entity(e);return n.parentRelations(i).forEach(function(a){a=a.removeMembersWithID(e),n=n.replace(a),a.isDegenerate()&&(n=Kr(a.id)(n))}),new Set(i.nodes).forEach(function(a){n=n.replace(i.removeNode(a));var o=n.entity(a);t(o,n)&&(n=n.remove(o))}),n.remove(i)};return r}var z4=q(()=>{"use strict";Dr();mo()});var CP={};j(CP,{actionDeleteMultiple:()=>r1});function r1(e){var t={way:sa,node:ho,relation:Kr},r=function(n){return e.forEach(function(i){n.hasEntity(i)&&(n=t[n.entity(i).type](i)(n))}),n};return r}var y3=q(()=>{"use strict";_2();mo();z4()});var IP={};j(IP,{actionDeleteRelation:()=>Kr});function Kr(e,t){function r(i,a){return!a.parentWays(i).length&&!a.parentRelations(i).length&&!i.hasInterestingTags()&&!t}var n=function(i){var a=i.entity(e);i.parentRelations(a).forEach(function(s){s=s.removeMembersWithID(e),i=i.replace(s),s.isDegenerate()&&(i=Kr(s.id)(i))});var o=Je(a.members.map(function(s){return s.id}));return o.forEach(function(s){i=i.replace(a.removeMembersWithID(s));var l=i.entity(s);r(l,i)&&(i=r1([s])(i))}),i.remove(a)};return n}var mo=q(()=>{"use strict";y3();Ie()});var MP={};j(MP,{actionDeleteNode:()=>ho});function ho(e){var t=function(r){var n=r.entity(e);return r.parentWays(n).forEach(function(i){i=i.removeNode(e),r=r.replace(i),i.isDegenerate()&&(r=sa(i.id)(r))}),r.parentRelations(n).forEach(function(i){i=i.removeMembersWithID(e),r=r.replace(i),i.isDegenerate()&&(r=Kr(i.id)(r))}),r.remove(n)};return t}var _2=q(()=>{"use strict";mo();z4()});var TP={};j(TP,{actionConnect:()=>L1});function L1(e){var t=function(r){var n,i,a,o,s;e.reverse();var l=[];for(o=0;o<e.length;o++)i=r.entity(e[o]),i.hasInterestingTags()&&(i.isNew()||l.push(i.id));for(n=r.entity(Zo(l.length>0?l:e)),o=0;o<e.length;o++)if(i=r.entity(e[o]),i.id!==n.id){for(a=r.parentWays(i),s=0;s<a.length;s++)r=r.replace(a[s].replaceNode(i.id,n.id));for(a=r.parentRelations(i),s=0;s<a.length;s++)r=r.replace(a[s].replaceMember(i,n));n=n.mergeTags(i.tags),r=ho(i.id)(r)}for(r=r.replace(n),a=r.parentWays(n),o=0;o<a.length;o++)a[o].isDegenerate()&&(r=sa(a[o].id)(r));return r};return t.disabled=function(r){var n={},i=[],a,o,s,l,u,c,f,d,m;for(a=r.entity(Zo(e)),f=0;f<e.length;f++)for(o=r.entity(e[f]),l=r.parentRelations(o),d=0;d<l.length;d++){if(u=l[d],c=u.memberById(o.id).role||"",u.hasFromViaTo()&&i.push(u.id),n[u.id]!==void 0&&n[u.id]!==c)return"relation";n[u.id]=c}for(f=0;f<e.length;f++){o=r.entity(e[f]);var h=r.parentWays(o);for(d=0;d<h.length;d++){var g=h[d];for(l=r.parentRelations(g),m=0;m<l.length;m++)u=l[m],u.hasFromViaTo()&&i.push(u.id)}}for(i=Je(i),f=0;f<i.length;f++)if(u=r.entity(i[f]),!!u.isComplete(r)){var A=u.members.filter(function(U){return U.type==="way"}).map(function(U){return r.entity(U.id)});A=Je(A);var v=u.memberByRole("from"),_=u.memberByRole("to"),w=v.id===_.id,k={from:[],via:[],to:[],keyfrom:[],keyto:[]};for(d=0;d<u.members.length;d++)P(u.members[d],k);k.keyfrom=Je(k.keyfrom.filter(O)),k.keyto=Je(k.keyto.filter(O));var x=L(k.keyfrom,k.keyto);k.from=k.from.filter(x),k.via=k.via.filter(x),k.to=k.to.filter(x);var S=!1,I=!1,b=!1,y=!1,E=!1;for(d=0;d<e.length;d++){var M=e[d];k.from.indexOf(M)!==-1&&(S=!0),k.via.indexOf(M)!==-1&&(I=!0),k.to.indexOf(M)!==-1&&(b=!0),k.keyfrom.indexOf(M)!==-1&&(y=!0),k.keyto.indexOf(M)!==-1&&(E=!0)}if(S&&b&&!w||S&&I||b&&I)return"restriction";if(y||E){if(e.length!==2)return"restriction";var F=null,N=null;for(d=0;d<A.length;d++)s=A[d],s.contains(e[0])&&(F=e[0]),s.contains(e[1])&&(N=e[1]);if(F&&N){var D=!1;for(d=0;d<A.length;d++)if(s=A[d],s.areAdjacent(F,N)){D=!0;break}if(!D)return"restriction"}}for(d=0;d<A.length;d++){for(s=A[d].update({}),m=0;m<e.length;m++)e[m]!==a.id&&(s.areAdjacent(e[m],a.id)?s=s.removeNode(e[m]):s=s.replaceNode(e[m],a.id));if(s.isDegenerate())return"restriction"}}return!1;function O(U,B,z){return z.indexOf(U)!==z.lastIndexOf(U)}function L(U,B){return function(z){return U.indexOf(z)===-1&&B.indexOf(z)===-1}}function P(U,B){var z=r.hasEntity(U.id);if(z){var V=U.role||"";B[V]||(B[V]=[]),U.type==="node"?(B[V].push(U.id),V==="via"&&(B.keyfrom.push(U.id),B.keyto.push(U.id))):U.type==="way"&&(B[V].push.apply(B[V],z.nodes),(V==="from"||V==="via")&&(B.keyfrom.push(z.first()),B.keyfrom.push(z.last())),(V==="to"||V==="via")&&(B.keyto.push(z.first()),B.keyto.push(z.last())))}}},t}var Q7=q(()=>{"use strict";_2();z4();Ie()});var NP={};j(NP,{actionCopyEntities:()=>q4});function q4(e,t){var r={},n=function(i){e.forEach(function(o){t.entity(o).copy(t,r)});for(var a in r)i=i.replace(r[a]);return i};return n.copies=function(){return r},n}var H7=q(()=>{"use strict"});var DP={};j(DP,{actionDeleteMember:()=>U1});function U1(e,t){return function(r){var n=r.entity(e).removeMember(t);return r=r.replace(n),n.isDegenerate()&&(r=Kr(n.id)(r)),r}}var b3=q(()=>{"use strict";mo()});var PP={};j(PP,{actionDeleteMembers:()=>lw});function lw(e,t){return function(r){t.sort((i,a)=>a-i);for(var n in t)r=U1(e,t[n])(r);return r}}var uw=q(()=>{"use strict";b3()});var FP={};j(FP,{actionDiscardTags:()=>Ts});function Ts(e,t){return t=t||{},r=>{return e.modified().forEach(n),e.created().forEach(n),r;function n(i){let a=Object.keys(i.tags),o=!1,s={};for(let l=0;l<a.length;l++){let u=a[l];t[u]||!i.tags[u]?o=!0:s[u]=i.tags[u]}o&&(r=r.replace(i.update({tags:s})))}}}var j7=q(()=>{"use strict"});var OP={};j(OP,{actionDisconnect:()=>k2});function k2(e,t){var r,n={associatedStreet:!0,enforcement:!0,site:!0},i=function(a){var o=a.entity(e),s=i.connections(a);return s.forEach(function(l){var u=a.entity(l.wayID),c=Nt({id:t,loc:o.loc,tags:o.tags});a=a.replace(c),l.index===0&&u.isArea()?a=a.replace(u.replaceNode(u.nodes[0],c.id)):u.isClosed()&&l.index===u.nodes.length-1?a=a.replace(u.unclose().addNode(c.id)):a=a.replace(u.updateNode(c.id,l.index))}),a};return i.connections=function(a){for(var o=[],s=!1,l=a.parentWays(a.entity(e)),u,c,f=0;f<l.length;f++){if(u=l[f],r&&r.indexOf(u.id)===-1){s=!0;continue}if(u.isArea()&&u.nodes[0]===e)o.push({wayID:u.id,index:0});else for(var d=0;d<u.nodes.length;d++)if(c=u.nodes[d],c===e){if(u.isClosed()&&l.length>1&&r&&r.indexOf(u.id)!==-1&&d===u.nodes.length-1)continue;o.push({wayID:u.id,index:d})}}return s?o:o.slice(1)},i.disabled=function(a){var o=i.connections(a);if(o.length===0)return"not_connected";var s=a.parentWays(a.entity(e)),l={},u;if(s.forEach(function(c){var f=a.parentRelations(c);f.filter(d=>!n[d.tags.type]).forEach(function(d){d.id in l?r?(r.indexOf(c.id)!==-1||r.indexOf(l[d.id])!==-1)&&(u=d):u=d:l[d.id]=c.id})}),u)return"relation"},i.limitWays=function(a){return arguments.length?(r=a,i):r},i}var Ld=q(()=>{"use strict";e1()});var RP={};j(RP,{actionExtract:()=>V4});function V4(e,t){var r,n=function(o,s){var l=o.entity(e);return l.type==="node"?i(l,o,s):a(l,o)};function i(o,s,l){r=o.id;var u=Nt({loc:o.loc});return s=s.replace(u),s=s.parentWays(o).reduce(function(c,f){return c.replace(f.replaceNode(e,u.id))},s),l?s.parentRelations(o).reduce(function(c,f){return c.replace(f.replaceMember(o,u))},s):s}function a(o,s){var l=o.geometry(s),u=["source","wheelchair"],c=["area"],f=["architect","building","height","layer","nycdoitt:bin"],d=Pi(t).centroid(o.asGeoJSON(s));d=d&&t.invert(d),(!d||!isFinite(d[0])||!isFinite(d[1]))&&(d=o.extent(s).center());var m={area:!0,corridor:!0,elevator:!0,level:!0,room:!0},h=o.tags.building&&o.tags.building!=="no"||o.tags["building:part"]&&o.tags["building:part"]!=="no",g=l==="area"&&o.tags.indoor&&m[o.tags.indoor],A=Object.assign({},o.tags),v={};for(var _ in A)o.type==="relation"&&_==="type"||c.indexOf(_)===-1&&(h&&(f.indexOf(_)!==-1||_.match(/^building:.{1,}/)||_.match(/^roof:.{1,}/))||g&&_==="indoor"||(v[_]=A[_],!(u.indexOf(_)!==-1||_.match(/^addr:.{1,}/))&&(g&&_==="level"||delete A[_])));!h&&!g&&l==="area"&&(A.area="yes");var w=Nt({loc:d,tags:v});return s=s.replace(w),r=w.id,s.replace(o.update({tags:A}))}return n.getExtractedNodeID=function(){return r},n}var Y7=q(()=>{"use strict";Ta();e1()});var LP={};j(LP,{actionJoin:()=>w3});function w3(e){function t(n){var i=e.map(function(a){return n.entity(a)});return Object.assign({line:[]},pr(i,function(a){return a.geometry(n)}))}var r=function(n){var i=e.map(n.entity,n),a=Zo(i.map(c=>c.id));i.sort(function(c,f){var d=c.isSided(),m=f.isSided();return d&&!m?-1:m&&!d?1:0});var o=jn(i,n),s=o[0];n=o.actions.reduce(function(c,f){return f(c)},n);var l=n.entity(a);l=l.update({nodes:s.nodes.map(function(c){return c.id})}),n=n.replace(l),s.forEach(function(c){c.id!==a&&(n.parentRelations(c).forEach(function(f){n=n.replace(f.replaceMember(c,l))}),l=l.mergeTags(c.tags),n=n.replace(l),n=sa(c.id)(n))});function u(){if(l.isClosed()){var c=n.parentMultipolygons(l).filter(function(h){return h.members.length===1});if(c.length===1){var f=c[0];for(var d in l.tags)if(f.tags[d]&&f.tags[d]!==l.tags[d])return;l=l.mergeTags(f.tags),n=n.replace(l),n=Kr(f.id,!0)(n);var m=Object.assign({},l.tags);l.geometry(n)!=="area"&&(m.area="yes"),delete m.type,l=l.update({tags:m}),n=n.replace(l)}}}return u(),n};return r.resultingWayNodesLength=function(n){return e.reduce(function(i,a){return i+n.entity(a).nodes.length},0)-e.length-1},r.disabled=function(n){var i=t(n);if(e.length<2||e.length!==i.line.length)return"not_eligible";var a=jn(e.map(n.entity,n),n);if(a.length>1)return"not_adjacent";var o,s=function(w){return n.parentRelations(n.entity(w)).filter(k=>!k.isRestriction()&&!k.isConnectivity()).sort((k,x)=>k.id.localeCompare(x.id))},l=s(e[0]);for(o=1;o<e.length;o++){var u=s(e[o]);if(!dn(l,u))return"conflicting_relations"}for(o=0;o<e.length-1;o++)for(var c=o+1;c<e.length;c++){var f=n.childNodes(n.entity(e[o])).map(function(w){return w.loc}),d=n.childNodes(n.entity(e[c])).map(function(w){return w.loc}),m=E4(f,d),h=Cr(a[0].nodes.map(function(w){return w.loc.toString()}),m.map(function(w){return w.toString()}));if(h.length!==m.length)return"paths_intersect"}var g=a[0].nodes.map(function(w){return w.id}).slice(1,-1),A,v={},_=!1;if(a[0].forEach(function(w){var k=n.parentRelations(w);k.forEach(function(S){(S.isRestriction()||S.isConnectivity())&&S.members.some(function(I){return g.indexOf(I.id)>=0})&&(A=S)});for(var x in w.tags)x in v?v[x]&&I1(x)&&v[x]!==w.tags[x]&&(_=!0):v[x]=w.tags[x]}),A)return A.isRestriction()?"restriction":"connectivity";if(_)return"conflicting_tags"},r}var Ud=q(()=>{"use strict";mo();z4();Dr();E2();He();Ie()});var UP={};j(UP,{actionMerge:()=>x3});function x3(e){function t(n){var i=e.map(function(a){return n.entity(a)});return Object.assign({point:[],area:[],line:[],relation:[]},pr(i,function(a){return a.geometry(n)}))}var r=function(n){var i=t(n),a=i.area[0]||i.line[0],o=i.point;if(o.forEach(function(l){a=a.mergeTags(l.tags),n=n.replace(a),n.parentRelations(l).forEach(function(A){n=n.replace(A.replaceMember(l,a))});var u=Je(n.childNodes(a)),c=l;if(!l.isNew()){var f=!1,d=function(A){return!(n.parentWays(A).length>1||n.parentRelations(A).length)},m=function(A){n=n.replace(l.update({tags:A.tags,loc:A.loc})),a=a.replaceNode(A.id,l.id),n=n.replace(a),c=A,f=!0},h,g;for(h=0;h<u.length;h++)if(g=u[h],d(g)&&g.isNew()){m(g);break}if(!f&&l.hasInterestingTags()){for(h=0;h<u.length;h++)if(g=u[h],d(g)&&!g.hasInterestingTags()){m(g);break}if(!f){for(h=0;h<u.length;h++)if(g=u[h],d(g)&&d3(l.id,g.id)<0){m(g);break}}}}n=n.remove(c)}),a.tags.area==="yes"){var s=Object.assign({},a.tags);delete s.area,T1(s)&&(a=a.update({tags:s}),n=n.replace(a))}return n};return r.disabled=function(n){var i=t(n);if(i.point.length===0||i.area.length+i.line.length!==1||i.relation.length!==0)return"not_eligible"},r}var Bd=q(()=>{"use strict";Dr();Ie()});var BP={};j(BP,{actionMergeNodes:()=>zi});function zi(e,t){function r(i){if(!e.length)return null;for(var a=[0,0],o=0,s,l=0;l<e.length;l++){var u=i.entity(e[l]);u.hasInterestingTags()&&(s=++o===1?u.loc:null),a=qr(a,u.loc)}return s||Na(a,1/e.length)}var n=function(i){if(e.length<2)return i;var a=t;a||(a=r(i));for(var o=0;o<e.length;o++){var s=i.entity(e[o]);s.loc!==a&&(i=i.replace(s.move(a)))}return L1(e)(i)};return n.disabled=function(i){if(e.length<2)return"not_eligible";for(var a=0;a<e.length;a++){var o=i.entity(e[a]);if(o.type!=="node")return"not_eligible"}return L1(e).disabled(i)},n}var $4=q(()=>{"use strict";Q7();He()});var zP={};j(zP,{osmChangeset:()=>qi});function qi(){if(this instanceof qi)arguments.length&&this.initialize(arguments);else return new qi().initialize(arguments)}var cw=q(()=>{"use strict";t1();He();Le.changeset=qi;qi.prototype=Object.create(Le.prototype);Object.assign(qi.prototype,{type:"changeset",extent:function(){return new Me},geometry:function(){return"changeset"},asJXON:function(){return{osm:{changeset:{tag:Object.keys(this.tags).map(function(e){return{"@k":e,"@v":this.tags[e]}},this),"@version":.6,"@generator":"iD"}}}},osmChangeJXON:function(e){var t=this.id;function r(a,o){for(var s={},l=0;l<a.length;l++){var u=Object.keys(a[l])[0];s[u]||(s[u]=[]),s[u].push(a[l][u])}var c={};return o.forEach(function(f){s[f]&&(c[f]=s[f])}),c}function n(a){function o(g){return c.find(function(A){return g.keyAttributes.type==="relation"&&g.keyAttributes.ref===A["@id"]})}function s(g){return!u[g["@id"]]&&!l.find(function(A){return A["@id"]===g["@id"]})}var l=[],u={},c=a.relation;if(!c)return a;for(var f=0;f<c.length;f++){var d=c[f];for(u[d["@id"]]||l.push(d);l.length>0;){var m=l[0],h=m.member.map(o).filter(Boolean).filter(s);h.length===0?(u[m["@id"]]=m,l.shift()):l=h.concat(l)}}return a.relation=Object.values(u),a}function i(a){return a.asJXON(t)}return{osmChange:{"@version":.6,"@generator":"iD",create:n(r(e.created.map(i),["node","way","relation"])),modify:r(e.modified.map(i),["node","way","relation"]),delete:Object.assign(r(e.deleted.map(i),["relation","way","node"]),{"@if-unused":!0})}}},asGeoJSON:function(){return{}}})});var qP={};j(qP,{osmNote:()=>br});function br(){if(this instanceof br)arguments.length&&this.initialize(arguments);else return new br().initialize(arguments)}var fw=q(()=>{"use strict";He();br.id=function(){return br.id.next--};br.id.next=-1;Object.assign(br.prototype,{type:"note",initialize:function(e){for(var t=0;t<e.length;++t){var r=e[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(r[n]===void 0?delete this[n]:this[n]=r[n])}return this.id||(this.id=br.id().toString()),this},extent:function(){return new Me(this.loc)},update:function(e){return br(this,e)},isNew:function(){return this.id<0},move:function(e){return this.update({loc:e})}})});var VP={};j(VP,{osmRelation:()=>pn});function pn(){if(this instanceof pn)arguments.length&&this.initialize(arguments);else return new pn().initialize(arguments)}var Yte,K7=q(()=>{"use strict";Ta();t1();E2();He();Le.relation=pn;pn.prototype=Object.create(Le.prototype);pn.creationOrder=function(e,t){var r=parseInt(Le.id.toOSM(e.id),10),n=parseInt(Le.id.toOSM(t.id),10);return r<0||n<0?r-n:n-r};Yte={type:"relation",members:[],copy:function(e,t){if(t[this.id])return t[this.id];var r=Le.prototype.copy.call(this,e,t),n=this.members.map(function(i){return Object.assign({},i,{id:e.entity(i.id).copy(e,t).id})});return r=r.update({members:n}),t[this.id]=r,r},extent:function(e,t){return e.transient(this,"extent",function(){if(t&&t[this.id])return Me();t=t||{},t[this.id]=!0;for(var r=Me(),n=0;n<this.members.length;n++){var i=e.hasEntity(this.members[n].id);i&&r._extend(i.extent(e,t))}return r})},geometry:function(e){return e.transient(this,"geometry",function(){return this.isMultipolygon()?"area":"relation"})},isDegenerate:function(){return this.members.length===0},indexedMembers:function(){for(var e=new Array(this.members.length),t=0;t<this.members.length;t++)e[t]=Object.assign({},this.members[t],{index:t});return e},memberByRole:function(e){for(var t=0;t<this.members.length;t++)if(this.members[t].role===e)return Object.assign({},this.members[t],{index:t})},membersByRole:function(e){for(var t=[],r=0;r<this.members.length;r++)this.members[r].role===e&&t.push(Object.assign({},this.members[r],{index:r}));return t},memberById:function(e){for(var t=0;t<this.members.length;t++)if(this.members[t].id===e)return Object.assign({},this.members[t],{index:t})},memberByIdAndRole:function(e,t){for(var r=0;r<this.members.length;r++)if(this.members[r].id===e&&this.members[r].role===t)return Object.assign({},this.members[r],{index:r})},addMember:function(e,t){var r=this.members.slice();return r.splice(t===void 0?r.length:t,0,e),this.update({members:r})},updateMember:function(e,t){var r=this.members.slice();return r.splice(t,1,Object.assign({},r[t],e)),this.update({members:r})},removeMember:function(e){var t=this.members.slice();return t.splice(e,1),this.update({members:t})},removeMembersWithID:function(e){var t=this.members.filter(function(r){return r.id!==e});return this.update({members:t})},moveMember:function(e,t){var r=this.members.slice();return r.splice(t,0,r.splice(e,1)[0]),this.update({members:r})},replaceMember:function(e,t,r){if(!this.memberById(e.id))return this;for(var n=[],i=0;i<this.members.length;i++){var a=this.members[i];a.id!==e.id?n.push(a):(r||!this.memberByIdAndRole(t.id,a.role))&&n.push({id:t.id,type:t.type,role:a.role})}return this.update({members:n})},asJXON:function(e){var t={relation:{"@id":this.osmId(),"@version":this.version||0,member:this.members.map(function(r){return{keyAttributes:{type:r.type,role:r.role,ref:Le.id.toOSM(r.id)}}},this),tag:Object.keys(this.tags).map(function(r){return{keyAttributes:{k:r,v:this.tags[r]}}},this)}};return e&&(t.relation["@changeset"]=e),t},asGeoJSON:function(e){return e.transient(this,"GeoJSON",function(){return this.isMultipolygon()?{type:"MultiPolygon",coordinates:this.multipolygon(e)}:{type:"FeatureCollection",properties:this.tags,features:this.members.map(function(t){return Object.assign({role:t.role},e.entity(t.id).asGeoJSON(e))})}})},area:function(e){return e.transient(this,"area",function(){return g1(this.asGeoJSON(e))})},isMultipolygon:function(){return this.tags.type==="multipolygon"},isComplete:function(e){for(var t=0;t<this.members.length;t++)if(!e.hasEntity(this.members[t].id))return!1;return!0},hasFromViaTo:function(){return this.members.some(function(e){return e.role==="from"})&&this.members.some(e=>e.role==="via"||e.role==="intersection"&&this.tags.type==="destination_sign")&&this.members.some(function(e){return e.role==="to"})},isRestriction:function(){return!!(this.tags.type&&this.tags.type.match(/^restriction:?/))},isValidRestriction:function(){if(!this.isRestriction())return!1;var e=this.members.filter(function(n){return n.role==="from"}),t=this.members.filter(function(n){return n.role==="via"}),r=this.members.filter(function(n){return n.role==="to"});return!(e.length!==1&&this.tags.restriction!=="no_entry"||e.some(function(n){return n.type!=="way"})||r.length!==1&&this.tags.restriction!=="no_exit"||r.some(function(n){return n.type!=="way"})||t.length===0||t.length>1&&t.some(function(n){return n.type!=="way"}))},isConnectivity:function(){return!!(this.tags.type&&this.tags.type.match(/^connectivity:?/))},multipolygon:function(e){var t=this.members.filter(function(u){return(u.role||"outer")==="outer"}),r=this.members.filter(function(u){return u.role==="inner"});t=jn(t,e),r=jn(r,e);var n=function(u){return u.nodes.length>2&&u.nodes[0]!==u.nodes[u.nodes.length-1]&&u.nodes.push(u.nodes[0]),u.nodes.map(function(c){return c.loc})};t=t.map(n),r=r.map(n);var i=t.map(function(u){return[g1({type:"Polygon",coordinates:[u]})>2*Math.PI?u.reverse():u]});function a(u){var c,f;for(c=0;c<t.length;c++)if(f=t[c],A4(f,u))return c;for(c=0;c<t.length;c++)if(f=t[c],ao(f,u,!1))return c}for(var o=0;o<r.length;o++){var s=r[o];g1({type:"Polygon",coordinates:[s]})<2*Math.PI&&(s=s.reverse());var l=a(r[o]);l!==void 0?i[l].push(r[o]):i.push([r[o]])}return i}};Object.assign(pn.prototype,Yte)});var $P={};j($P,{QAItem:()=>Lr});var Lr,dw=q(()=>{"use strict";Lr=class e{constructor(t,r,n,i,a){this.loc=t,this.service=r.title,this.itemType=n,this.id=i||`${e.id()}`,this.update(a),r&&typeof r.getIcon=="function"&&(this.icon=r.getIcon(n))}update(t){let{loc:r,service:n,itemType:i,id:a}=this;return Object.keys(t).forEach(o=>this[o]=t[o]),this.loc=r,this.service=n,this.itemType=i,this.id=a,this}static id(){return this.nextId--}};Lr.nextId=-1});var GP={};j(GP,{actionSplit:()=>n1});function n1(e,t){typeof e=="string"&&(e=[e]);var r,n="longest";let i=["roundabout","circular"];var a=[];function o(d,m,h){var g=d.entity(m).loc,A=d.entity(h).loc,v=1e-6;return g&&A?wt(g,A):v}function s(d,m,h){var g=new Array(d.length),A,v,_=0,w;function k(S){return B4(S,d.length)}for(A=0,v=k(m+1);v!==m;v=k(v+1))A+=o(h,d[v],d[k(v-1)]),g[v]=A;for(A=0,v=k(m-1);v!==m;v=k(v-1))A+=o(h,d[v],d[k(v+1)]),A<g[v]&&(g[v]=A);for(v=0;v<d.length;v++){var x=g[v]/o(h,d[m],d[v]);x>_&&(w=v,_=x)}return w}function l(d,m){for(var h=0,g=0;g<m.length-1;g++)h+=o(d,m[g],m[g+1]);return h}function u(d,m,h,g,A){var v=kr({id:g,tags:h.tags}),_,w,k=h.isArea();if(h.isClosed()){var x=h.nodes.slice(0,-1),S=x.indexOf(m),I=A.length>0?x.indexOf(A[0]):s(x,S,d);I<S?(_=x.slice(S).concat(x.slice(0,I+1)),w=x.slice(I,S+1)):(_=x.slice(S,I+1),w=x.slice(I).concat(x.slice(0,S+1)))}else{var b=h.nodes.indexOf(m,1);_=h.nodes.slice(0,b+1),w=h.nodes.slice(b)}var y=l(d,_),E=l(d,w);if(n==="longest"&&E>y){h=h.update({nodes:w}),v=v.update({nodes:_});var M=y;y=E,E=M}else h=h.update({nodes:_}),v=v.update({nodes:w});if(h.tags.step_count){var F=Number(h.tags.step_count);if(F&&isFinite(F)&&F>0&&Math.round(F)===F){var N=Object.assign({},h.tags),D=Object.assign({},v.tags),O=y/(y+E),L=Math.round(F*O);N.step_count=L.toString(),D.step_count=(F-L).toString(),h=h.update({tags:N}),v=v.update({tags:D})}}if(d=d.replace(h),d=d.replace(v),d.parentRelations(h).forEach(function(U){if(U.hasFromViaTo()){var B=U.memberByRole("from"),z=[...U.membersByRole("via"),...U.membersByRole("intersection")],V=U.memberByRole("to"),G;if(B.id===h.id||V.id===h.id){var W=!1;if(z.length===1&&z[0].type==="node")W=v.contains(z[0].id);else for(G=0;G<z.length;G++)if(z[G].type==="way"){var Y=d.hasEntity(z[G].id);if(Y&&Cr(v.nodes,Y.nodes).length){W=!0;break}}W&&(U=U.replaceMember(h,v),d=d.replace(U))}else for(G=0;G<z.length;G++)z[G].type==="way"&&z[G].id===h.id&&(d=c(d,U.id,h,v))}else d=c(d,U.id,h,v)}),k){var P=pn({tags:Object.assign({},h.tags,{type:"multipolygon"}),members:[{id:h.id,role:"outer",type:"way"},{id:v.id,role:"outer",type:"way"}]});d=d.replace(P),d=d.replace(h.update({tags:{}})),d=d.replace(v.update({tags:{}}))}return a.push(v.id),d}function c(d,m,h,g){function A(k,x){return k.nodes.length<2||x.nodes.length<2?!1:i.includes(k.tags.junction)&&k.isClosed()?k.nodes.some(S=>S===x.nodes[0]||S===x.nodes[x.nodes.length-1]):i.includes(x.tags.junction)&&x.isClosed()?x.nodes.some(S=>S===k.nodes[0]||S===k.nodes[k.nodes.length-1]):k.nodes[0]===x.nodes[0]||k.nodes[0]===x.nodes[x.nodes.length-1]||k.nodes[k.nodes.length-1]===x.nodes[x.nodes.length-1]||k.nodes[k.nodes.length-1]===x.nodes[0]}let v=d.entity(m),_=[],w=v.members;for(let k=0;k<w.length;k++){let x=w[k];if(x.id===h.id){let S=!1,I=!1,b=!1,y=!1;if(k>0&&d.hasEntity(w[k-1].id)){let E=d.entity(w[k-1].id);E.type==="way"&&(S=A(E,h),b=A(E,g))}if(k<w.length-1&&d.hasEntity(w[k+1].id)){let E=d.entity(w[k+1].id);E.type==="way"&&(I=A(E,h),y=A(E,g))}if(S&&!I||!b&&y&&!(!S&&I)){_.push({at:k+1,role:x.role});continue}if(!S&&I||b&&!y&&!(S&&!I)){_.push({at:k,role:x.role});continue}if(S&&b&&I&&y){if(k>2&&d.hasEntity(w[k-2].id)){let E=d.entity(w[k-2].id);if(A(E,h)&&!A(E,g)){_.push({at:k,role:x.role});continue}if(A(E,g)&&!A(E,h)){_.push({at:k+1,role:x.role});continue}}if(k<w.length-2&&d.hasEntity(w[k+2].id)){let E=d.entity(w[k+2].id);if(A(E,h)&&!A(E,g)){_.push({at:k+1,role:x.role});continue}if(A(E,g)&&!A(E,h)){_.push({at:k,role:x.role});continue}}}h.nodes[h.nodes.length-1]===g.nodes[0]?_.push({at:k+1,role:x.role}):_.push({at:k,role:x.role})}}return _.reverse().forEach(k=>{d=d.replace(v.addMember({id:g.id,type:"way",role:k.role},k.at)),v=d.entity(v.id)}),d}var f=function(d){a=[];for(var m=0,h=0;h<e.length;h++)for(var g=e[h],A=f.waysForNode(g,d),v=0;v<A.length;v++)d=u(d,g,A[v],t&&t[m],e.slice(v+1)),m+=1;return d};return f.getCreatedWayIDs=function(){return a},f.waysForNode=function(d,m){var h=m.entity(d),g=m.parentWays(h).filter(v);if(!r){var A=g.some(function(_){return _.geometry(m)==="line"});if(A)return g.filter(function(_){return _.geometry(m)==="line"})}return g;function v(_){if(r&&r.indexOf(_.id)===-1)return!1;if(_.isClosed())return!0;for(var w=1;w<_.nodes.length-1;w++)if(_.nodes[w]===d)return!0;return!1}},f.ways=function(d){return Je([].concat.apply([],e.map(function(m){return f.waysForNode(m,d)})))},f.disabled=function(d){for(let m of e){let h=f.waysForNode(m,d);if(h.length===0||r&&r.length!==h.length)return"not_eligible";for(let g of h){let A=d.parentRelations(g);for(let v of A){if(v.hasFromViaTo()){if(![...v.membersByRole("via"),...v.membersByRole("intersection")].every(k=>d.hasEntity(k.id)))return"parent_incomplete"}else for(let w=0;w<v.members.length;w++)if(v.members[w].id===g.id){let k=w>0&&d.hasEntity(v.members[w-1].id),x=w<v.members.length-1&&d.hasEntity(v.members[w+1].id);if(!k&&!x&&v.members.length>1)return"parent_incomplete"}let _=["junction","enforcement"];if(i.includes(g.tags.junction)&&g.isClosed()&&!_.includes(v.tags.type))return"simple_roundabout"}}}},f.limitWays=function(d){return arguments.length?(r=d,f):r},f.keepHistoryOn=function(d){return arguments.length?(n=d,f):n},f}var _3=q(()=>{"use strict";yi();K7();X7();Ie()});var WP={};j(WP,{coreGraph:()=>kn});function kn(e,t){if(!(this instanceof kn))return new kn(e,t);if(e instanceof kn){var r=e.base();this.entities=Object.assign(Object.create(r.entities),e.entities),this._parentWays=Object.assign(Object.create(r.parentWays),e._parentWays),this._parentRels=Object.assign(Object.create(r.parentRels),e._parentRels)}else this.entities=Object.create({}),this._parentWays=Object.create({}),this._parentRels=Object.create({}),this.rebase(e||[],[this]);this.transients={},this._childNodes={},this.frozen=!t}var G4=q(()=>{"use strict";Z7();Ie();kn.prototype={hasEntity:function(e){return this.entities[e]},entity:function(e){var t=this.entities[e];if(t||(t=this.entities.__proto__[e]),!t)throw new Error("entity "+e+" not found");return t},geometry:function(e){return this.entity(e).geometry(this)},transient:function(e,t,r){var n=e.id,i=this.transients[n]||(this.transients[n]={});return i[t]!==void 0||(i[t]=r.call(e)),i[t]},parentWays:function(e){var t=this._parentWays[e.id],r=[];return t&&t.forEach(function(n){r.push(this.entity(n))},this),r},isPoi:function(e){var t=this._parentWays[e.id];return!t||t.size===0},isShared:function(e){var t=this._parentWays[e.id];return t&&t.size>1},parentRelations:function(e){var t=this._parentRels[e.id],r=[];return t&&t.forEach(function(n){r.push(this.entity(n))},this),r},parentMultipolygons:function(e){return this.parentRelations(e).filter(function(t){return t.isMultipolygon()})},childNodes:function(e){if(this._childNodes[e.id])return this._childNodes[e.id];if(!e.nodes)return[];for(var t=[],r=0;r<e.nodes.length;r++)t[r]=this.entity(e.nodes[r]);return k3&&Object.freeze(t),this._childNodes[e.id]=t,this._childNodes[e.id]},base:function(){return{entities:Object.getPrototypeOf(this.entities),parentWays:Object.getPrototypeOf(this._parentWays),parentRels:Object.getPrototypeOf(this._parentRels)}},rebase:function(e,t,r){var n=this.base(),i,a,o,s;for(i=0;i<e.length;i++){var l=e[i];if(!(!l.visible||!r&&n.entities[l.id])&&(n.entities[l.id]=l,this._updateCalculated(void 0,l,n.parentWays,n.parentRels),l.type==="way"))for(a=0;a<l.nodes.length;a++)for(s=l.nodes[a],o=1;o<t.length;o++){var u=t[o].entities;u.hasOwnProperty(s)&&u[s]===void 0&&delete u[s]}}for(i=0;i<t.length;i++)t[i]._updateRebased()},_updateRebased:function(){var e=this.base();Object.keys(this._parentWays).forEach(function(t){e.parentWays[t]&&e.parentWays[t].forEach(function(r){this.entities.hasOwnProperty(r)||this._parentWays[t].add(r)},this)},this),Object.keys(this._parentRels).forEach(function(t){e.parentRels[t]&&e.parentRels[t].forEach(function(r){this.entities.hasOwnProperty(r)||this._parentRels[t].add(r)},this)},this),this.transients={}},_updateCalculated:function(e,t,r,n){r=r||this._parentWays,n=n||this._parentRels;var i=t&&t.type||e&&e.type,a,o,s;if(i==="way"){for(e&&t?(a=yr(e.nodes,t.nodes),o=yr(t.nodes,e.nodes)):e?(a=e.nodes,o=[]):t&&(a=[],o=t.nodes),s=0;s<a.length;s++)r[a[s]]=new Set(r[a[s]]),r[a[s]].delete(e.id);for(s=0;s<o.length;s++)r[o[s]]=new Set(r[o[s]]),r[o[s]].add(t.id)}else if(i==="relation"){var l=e?e.members.map(function(c){return c.id}):[],u=t?t.members.map(function(c){return c.id}):[];for(e&&t?(a=yr(l,u),o=yr(u,l)):e?(a=l,o=[]):t&&(a=[],o=u),s=0;s<a.length;s++)n[a[s]]=new Set(n[a[s]]),n[a[s]].delete(e.id);for(s=0;s<o.length;s++)n[o[s]]=new Set(n[o[s]]),n[o[s]].add(t.id)}},replace:function(e){return this.entities[e.id]===e?this:this.update(function(){this._updateCalculated(this.entities[e.id],e),this.entities[e.id]=e})},remove:function(e){return this.update(function(){this._updateCalculated(e,void 0),this.entities[e.id]=void 0})},revert:function(e){var t=this.base().entities[e],r=this.entities[e];return r===t?this:this.update(function(){this._updateCalculated(r,t),delete this.entities[e]})},update:function(){for(var e=this.frozen?kn(this,!0):this,t=0;t<arguments.length;t++)arguments[t].call(e,e);return this.frozen&&(e.frozen=!0),e},load:function(e){var t=this.base();this.entities=Object.create(t.entities);for(var r in e)this.entities[r]=e[r],this._updateCalculated(t.entities[r],this.entities[r]);return this}}});var QP={};j(QP,{osmInferRestriction:()=>W4,osmIntersection:()=>E3,osmTurn:()=>B1});function B1(e){if(!(this instanceof B1))return new B1(e);Object.assign(this,e)}function E3(e,t,r){r=r||30;var n=kn(),i,a,o;function s(G){return e.parentRelations(G).some(function(W){return W.isRestriction()})}function l(G){if(G.isArea()||G.isDegenerate())return!1;var W={motorway:!0,motorway_link:!0,trunk:!0,trunk_link:!0,primary:!0,primary_link:!0,secondary:!0,secondary_link:!0,tertiary:!0,tertiary_link:!0,residential:!0,unclassified:!0,living_street:!0,service:!0,busway:!0,road:!0,track:!0};return W[G.tags.highway]}for(var u=e.entity(t),c=[u],f,d=[],m=[],h,g=[],A=[],v,_=[],w,k=[],x,S=[];c.length;){h=c.pop(),f=e.parentWays(h);var I=!1;for(i=0;i<f.length;i++)if(v=f[i],!(!l(v)&&!s(v))){for(g.push(v),I=!0,_=Je(e.childNodes(v)),a=0;a<_.length;a++)if(w=_[a],w!==h&&d.indexOf(w)===-1&&!(wt(w.loc,u.loc)>r)){var b=!1;for(k=e.parentWays(w),o=0;o<k.length;o++)if(x=k[o],x!==v&&g.indexOf(x)===-1&&l(x)){b=!0;break}b&&c.push(w)}}I&&d.push(h)}d=Je(d),g=Je(g),g.forEach(function(G){e.childNodes(G).forEach(function(W){n=n.replace(W)}),n=n.replace(G),e.parentRelations(G).forEach(function(W){W.isRestriction()&&(W.isValidRestriction(e)?n=n.replace(W):W.isComplete(e)&&S.push(Kr(W.id)))})}),g.forEach(function(G){var W=n.entity(G.id);if(W.tags.oneway==="-1"){var Y=Ji(W.id,{reverseOneway:!0});S.push(Y),n=Y(n)}});var y=Le.id.next.way;d.forEach(function(G){var W=n1([G.id]).keepHistoryOn("first");W.disabled(n)||W.ways(n).forEach(function(Y){var J=n1([G.id]).limitWays([Y.id]).keepHistoryOn("first");S.push(J),n=J(n)})}),Le.id.next.way=y,m=d.map(function(G){return G.id}),d=[],g=[],m.forEach(function(G){var W=n.entity(G),Y=n.parentWays(W);d.push(W),g=g.concat(Y)}),d=Je(d),g=Je(g),m=d.map(function(G){return G.id}),A=g.map(function(G){return G.id});function E(G,W){var Y=G.isOneWay()&&!G.isBiDirectional(),J=W.indexOf(G.first())!==-1,oe=W.indexOf(G.last())!==-1,Ce=J&&oe,se=J&&!Y||oe,ne=J||oe&&!Y;return G.update({__first:J,__last:oe,__from:se,__via:Ce,__to:ne,__oneWay:Y})}g=[],A.forEach(function(G){var W=E(n.entity(G),m);n=n.replace(W),g.push(W)});var M,F=[],N=[];do for(M=!1,c=m.slice(),i=0;i<c.length;i++){var D=c[i];if(h=n.hasEntity(D),!h){m.indexOf(D)!==-1&&m.splice(m.indexOf(D),1),N.push(D);continue}if(k=n.parentWays(h),k.length<3&&m.indexOf(D)!==-1&&m.splice(m.indexOf(D),1),k.length===2){var O=k[0],L=k[1],P=O&&!O.__via,U=L&&!L.__via,B,z;P&&!U?(B=O,z=L):!P&&U&&(B=L,z=O),B&&z&&(z=E(z,m),n=n.replace(z).remove(B),F.push(B.id),M=!0)}k=n.parentWays(h),k.length<2&&(m.indexOf(D)!==-1&&m.splice(m.indexOf(D),1),N.push(D),M=!0),k.length<1&&(n=n.remove(h))}while(M);d=d.filter(function(G){return N.indexOf(G.id)===-1}).map(function(G){return n.entity(G.id)}),g=g.filter(function(G){return F.indexOf(G.id)===-1}).map(function(G){return n.entity(G.id)});var V={graph:n,actions:S,vertices:d,ways:g};return V.turns=function(G,W){if(!G)return[];W||(W=0);var Y=V.graph,J=V.vertices.map(function(Z){return Z.id}),oe=Y.entity(G);if(!oe||!(oe.__from||oe.__via))return[];var Ce=W*2+3,se=[];return ne(oe),se;function ne(Z,te,ye,we){te=(te||[]).slice(),!(te.length>=Ce)&&(te.push(Z.id),ye=(ye||[]).slice(),Z.type==="node"?he(Z,te,ye):Se(Z,te,ye,we))}function he(Z,te,ye){var we,Ne,Be=Y.parentWays(Z),le=[];for(we=0;we<Be.length;we++){var ie=Be[we];if(!(ie.__oneWay&&ie.nodes[0]!==Z.id)&&!(te.indexOf(ie.id)!==-1&&te.length>=3)){var ve=null;for(Ne=0;Ne<ye.length;Ne++){var be=ye[Ne],Te=be.memberByRole("from"),Oe=be.membersByRole("via"),Ve=be.memberByRole("to"),Qe=/^no_/.test(be.tags.restriction),ct=/^only_/.test(be.tags.restriction);if(Qe||ct){var rt=Te.id===G,We=!1,Rt=!1;if(Ve.id===ie.id)if(Oe.length===1&&Oe[0].type==="node")We=Oe[0].id===Z.id&&(rt&&te.length===2||!rt&&te.length>2);else{var lt=[];for(o=2;o<te.length;o+=2)lt.push(te[o]);var vt=[];for(o=0;o<Oe.length;o++)Oe[o].type==="way"&&vt.push(Oe[o].id);var _t=yr(lt,vt);We=!_t.length}else if(ct){for(o=0;o<Oe.length;o++)if(Oe[o].type==="way"&&Oe[o].id===ie.id){Rt=!0;break}}if(We?ct?ve={id:be.id,direct:rt,from:Te.id,only:!0,end:!0}:ve={id:be.id,direct:rt,from:Te.id,no:!0,end:!0}:Rt?ve={id:be.id,direct:!1,from:Te.id,only:!0,end:!1}:ct&&(ve={id:be.id,direct:!1,from:Te.id,no:!0,end:!0}),ve&&ve.direct)break}}le.push({way:ie,restrict:ve})}}le.forEach(function(wr){ne(wr.way,te,ye,wr.restrict)})}function Se(Z,te,ye,we){var Ne;if(te.length>=3){var Be=te.slice();if(we&&we.direct===!1){for(Ne=0;Ne<Be.length;Ne++)if(Be[Ne]===we.from){Be=Be.slice(Ne);break}}var le=re(Be);if(le&&(we&&(le.restrictionID=we.id,le.no=we.no,le.only=we.only,le.direct=we.direct),se.push(B1(le))),te[0]===te[2])return}if(!(we&&we.end)){var ie=Y.entity(Z.first()),ve=Y.entity(Z.last()),be=wt(ie.loc,ve.loc),Te=[];te.length>1&&(be>r||!Z.__via)||(!Z.__oneWay&&J.indexOf(ie.id)!==-1&&te.indexOf(ie.id)===-1&&Te.push(ie),J.indexOf(ve.id)!==-1&&te.indexOf(ve.id)===-1&&Te.push(ve),Te.forEach(function(Oe){var Ve=Y.parentRelations(Z).filter(function(Qe){if(!Qe.isRestriction())return!1;var ct=Qe.memberByRole("from");if(!ct||ct.id!==Z.id)return!1;var rt=/^only_/.test(Qe.tags.restriction);if(!rt)return!0;var We=!1,Rt=Qe.membersByRole("via");if(Rt.length===1&&Rt[0].type==="node")We=Rt[0].id===Oe.id;else for(var lt=0;lt<Rt.length;lt++)if(Rt[lt].type==="way"){var vt=Y.entity(Rt[lt].id);if(vt.first()===Oe.id||vt.last()===Oe.id){We=!0;break}}return We});ne(Oe,te,ye.concat(Ve),!1)}))}}function re(Z){if(Z.length<3)return;var te,ye,we,Ne,Be,le,ie,ve,be;if(te=Z[0],Ne=Z[Z.length-1],Z.length===3&&te===Ne){var Te=Y.entity(te);if(Te.__oneWay)return null;be=!0,ve=we=le=Z[1],ye=Be=Oe(te,ve)}else be=!1,we=Z[1],ye=Oe(te,we),le=Z[Z.length-2],Be=Oe(Ne,le),Z.length===3?ve=Z[1]:(ie=Z.filter(function(Ve){return Ve[0]==="w"}),ie=ie.slice(1,ie.length-1));return{key:Z.join("_"),path:Z,from:{node:ye,way:te,vertex:we},via:{node:ve,ways:ie},to:{node:Be,way:Ne,vertex:le},u:be};function Oe(Ve,Qe){var ct=Y.entity(Ve).nodes;return Qe===ct[0]?ct[1]:ct[ct.length-2]}}},V}function W4(e,t,r){for(var n=e.entity(t.from.way),i=e.entity(t.from.node),a=e.entity(t.from.vertex),o=e.entity(t.to.way),s=e.entity(t.to.node),l=e.entity(t.to.vertex),u=n.tags.oneway==="yes",c=o.tags.oneway==="yes",f=(fn(a,i,r)-fn(l,s,r))*180/Math.PI;f<0;)f+=360;return i===s||(f<23||f>336)&&u&&c||(f<40||f>319)&&u&&c&&t.from.vertex!==t.to.vertex?"no_u_turn":f<158?"no_right_turn":f>202?"no_left_turn":"no_straight_on"}var pw=q(()=>{"use strict";mo();c4();_3();G4();He();t1();Ie()});var HP={};j(HP,{osmLanes:()=>A3});function A3(e){if(e.type!=="way"||!e.tags.highway)return null;var t=e.tags,r=e.isOneWay(),n=Kte(t,r),i=Xte(t),a=Zte(t,r,n),o=a.forward,s=a.backward,l=a.bothways,u={};u.unspecified=mw(t["turn:lanes"]),u.forward=mw(t["turn:lanes:forward"]),u.backward=mw(t["turn:lanes:backward"]);var c={};c.unspecified=hw(t["maxspeed:lanes"],i),c.forward=hw(t["maxspeed:lanes:forward"],i),c.backward=hw(t["maxspeed:lanes:backward"],i);var f={};f.unspecified=Vi(t["psv:lanes"]),f.forward=Vi(t["psv:lanes:forward"]),f.backward=Vi(t["psv:lanes:backward"]);var d={};d.unspecified=Vi(t["bus:lanes"]),d.forward=Vi(t["bus:lanes:forward"]),d.backward=Vi(t["bus:lanes:backward"]);var m={};m.unspecified=Vi(t["taxi:lanes"]),m.forward=Vi(t["taxi:lanes:forward"]),m.backward=Vi(t["taxi:lanes:backward"]);var h={};h.unspecified=Vi(t["hov:lanes"]),h.forward=Vi(t["hov:lanes:forward"]),h.backward=Vi(t["hov:lanes:backward"]);var g={};g.unspecified=Vi(t["hgv:lanes"]),g.forward=Vi(t["hgv:lanes:forward"]),g.backward=Vi(t["hgv:lanes:backward"]);var A={};A.unspecified=gw(t["bicycleway:lanes"]),A.forward=gw(t["bicycleway:lanes:forward"]),A.backward=gw(t["bicycleway:lanes:backward"]);var v={forward:[],backward:[],unspecified:[]};return Q4(v,u,"turnLane"),Q4(v,c,"maxspeed"),Q4(v,f,"psv"),Q4(v,d,"bus"),Q4(v,m,"taxi"),Q4(v,h,"hov"),Q4(v,g,"hgv"),Q4(v,A,"bicycleway"),{metadata:{count:n,oneway:r,forward:o,backward:s,bothways:l,turnLanes:u,maxspeed:i,maxspeedLanes:c,psvLanes:f,busLanes:d,taxiLanes:m,hovLanes:h,hgvLanes:g,bicyclewayLanes:A},lanes:v}}function Kte(e,t){var r;if(e.lanes&&(r=parseInt(e.lanes,10),r>0))return r;switch(e.highway){case"trunk":case"motorway":r=t?2:4;break;default:r=t?1:2;break}return r}function Xte(e){var t=e.maxspeed;if(t){var r=/^([0-9][\.0-9]+?)(?:[ ]?(?:km\/h|kmh|kph|mph|knots))?$/;if(r.test(t))return parseInt(t,10)}}function Zte(e,t,r){var n=parseInt(e["lanes:forward"],10),i=parseInt(e["lanes:backward"],10),a=parseInt(e["lanes:both_ways"],10)>0?1:0;return parseInt(e.oneway,10)===-1?(n=0,a=0,i=r):t?(n=r,a=0,i=0):isNaN(n)&&isNaN(i)?(i=Math.floor((r-a)/2),n=r-a-i):isNaN(n)?(i>r-a&&(i=r-a),n=r-a-i):isNaN(i)&&(n>r-a&&(n=r-a),i=r-a-n),{forward:n,backward:i,bothways:a}}function mw(e){if(e){var t=["left","slight_left","sharp_left","through","right","slight_right","sharp_right","reverse","merge_to_left","merge_to_right","none"];return e.split("|").map(function(r){return r===""&&(r="none"),r.split(";").map(function(n){return t.indexOf(n)===-1?"unknown":n})})}}function hw(e,t){if(e)return e.split("|").map(function(r){if(r==="none")return r;var n=parseInt(r,10);return r===""||n===t?null:isNaN(n)?"unknown":n})}function Vi(e){if(e){var t=["yes","no","designated"];return e.split("|").map(function(r){return r===""&&(r="no"),t.indexOf(r)===-1?"unknown":r})}}function gw(e){if(e){var t=["yes","no","designated","lane"];return e.split("|").map(function(r){return r===""&&(r="no"),t.indexOf(r)===-1?"unknown":r})}}function Q4(e,t,r){t.forward&&t.forward.forEach(function(n,i){e.forward[i]||(e.forward[i]={}),e.forward[i][r]=n}),t.backward&&t.backward.forEach(function(n,i){e.backward[i]||(e.backward[i]={}),e.backward[i][r]=n}),t.unspecified&&t.unspecified.forEach(function(n,i){e.unspecified[i]||(e.unspecified[i]={}),e.unspecified[i][r]=n})}var zd=q(()=>{"use strict"});var jP={};j(jP,{QAItem:()=>Lr,osmAreaKeys:()=>Ho,osmChangeset:()=>qi,osmEntity:()=>Le,osmFlowingWaterwayTagValues:()=>F4,osmInferRestriction:()=>W4,osmIntersection:()=>E3,osmIsInterestingTag:()=>I1,osmJoinWays:()=>jn,osmLanes:()=>A3,osmLifecyclePrefixes:()=>M1,osmNode:()=>Nt,osmNodeGeometriesForTags:()=>N1,osmNote:()=>br,osmPavedTags:()=>m2,osmPointTags:()=>D4,osmRailwayTrackTagValues:()=>t3,osmRelation:()=>pn,osmRemoveLifecyclePrefix:()=>p2,osmRoutableHighwayTagValues:()=>aa,osmSetAreaKeys:()=>X0,osmSetPointTags:()=>Z0,osmSetVertexTags:()=>J0,osmTagSuggestingArea:()=>T1,osmTurn:()=>B1,osmVertexTags:()=>P4,osmWay:()=>kr});var lr=q(()=>{"use strict";cw();t1();e1();fw();K7();X7();dw();pw();zd();E2();Dr()});var YP={};j(YP,{actionMergePolygon:()=>S3});function S3(e,t){function r(i){var a=e.map(function(s){return i.entity(s)}),o=pr(a,function(s){return s.type==="way"&&s.isClosed()?"closedWay":s.type==="relation"&&s.isMultipolygon()?"multipolygon":"other"});return Object.assign({closedWay:[],multipolygon:[],other:[]},o)}var n=function(i){for(var a=r(i),o=a.multipolygon.reduce(function(g,A){return g.concat(jn(A.members,i))},[]).concat(a.closedWay.map(function(g){var A=[{id:g.id}];return A.nodes=i.childNodes(g),A})),s=o.map(function(g,A){return o.map(function(v,_){return A===_?null:A4(v.nodes.map(function(w){return w.loc}),g.nodes.map(function(w){return w.loc}))})}),l=[],u=!0;o.length;)d(o),o=o.filter(c),s=s.filter(c).map(f);function c(g,A){return s[A].some(function(v){return v})}function f(g){return g.filter(c)}function d(g){g.forEach(function(A,v){c(A,v)||A.forEach(function(_){l.push({type:"way",id:_.id,role:u?"outer":"inner"})})}),u=!u}var m;if(a.multipolygon.length>0){var h=Zo(a.multipolygon.map(g=>g.id));m=a.multipolygon.find(g=>g.id===h)}else m=pn({id:t,tags:{type:"multipolygon"}});return a.multipolygon.forEach(function(g){g.id!==m.id&&(m=m.mergeTags(g.tags),i=i.remove(g))}),a.closedWay.forEach(function(g){function A(v){return v.id===g.id&&v.role!=="inner"}l.some(A)&&(m=m.mergeTags(g.tags),i=i.replace(g.update({tags:{}})))}),i.replace(m.update({members:l,tags:Tn(m.tags,["area"])}))};return n.disabled=function(i){var a=r(i);if(a.other.length>0||a.closedWay.length+a.multipolygon.length<2)return"not_eligible";if(!a.multipolygon.every(function(s){return s.isComplete(i)}))return"incomplete_relation";if(a.multipolygon.length){if(a.closedWay.some(function(s){return Cr(i.parentMultipolygons(s),a.multipolygon).length}))return"not_eligible"}else{var o=[];if(a.closedWay.forEach(function(s,l){l===0?o=i.parentMultipolygons(s):o=Cr(o,i.parentMultipolygons(s))}),o=o.filter(function(s){return s.members.length===a.closedWay.length}),o.length)return"not_eligible"}},n}var qd=q(()=>{"use strict";He();lr();Ie()});var go=an((vde,KP)=>{"use strict";KP.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,a;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(a=Object.keys(t),n=a.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[i]))return!1;for(i=n;i--!==0;){var o=a[i];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}});function Jte(e,t){let r={};for(let a=0;a<t.length;a++){let o=t[a];r[o]?r[o].push(a):r[o]=[a]}let i=[{buffer1index:-1,buffer2index:-1,chain:null}];for(let a=0;a<e.length;a++){let o=e[a],s=r[o]||[],l=0,u=i[0];for(let c=0;c<s.length;c++){let f=s[c],d;for(d=l;d<i.length&&!(i[d].buffer2index<f&&(d===i.length-1||i[d+1].buffer2index>f));d++);if(d<i.length){let m={buffer1index:a,buffer2index:f,chain:i[d]};if(l===i.length?i.push(u):i[l]=u,l=d+1,u=m,l===i.length)break}}i[l]=u}return i[i.length-1]}function XP(e,t){let r=Jte(e,t),n=[],i=e.length,a=t.length;for(let o=r;o!==null;o=o.chain){let s=i-o.buffer1index-1,l=a-o.buffer2index-1;i=o.buffer1index,a=o.buffer2index,(s||l)&&n.push({buffer1:[i+1,s],buffer1Content:e.slice(i+1,i+1+s),buffer2:[a+1,l],buffer2Content:t.slice(a+1,a+1+l)})}return n.reverse(),n}function ere(e,t,r){let n=[];function i(l,u){n.push({ab:u,oStart:l.buffer1[0],oLength:l.buffer1[1],abStart:l.buffer2[0],abLength:l.buffer2[1]})}XP(t,e).forEach(l=>i(l,"a")),XP(t,r).forEach(l=>i(l,"b")),n.sort((l,u)=>l.oStart-u.oStart);let a=[],o=0;function s(l){l>o&&(a.push({stable:!0,buffer:"o",bufferStart:o,bufferLength:l-o,bufferContent:t.slice(o,l)}),o=l)}for(;n.length;){let l=n.shift(),u=l.oStart,c=l.oStart+l.oLength,f=[l];for(s(u);n.length;){let d=n[0],m=d.oStart;if(m>c)break;c=Math.max(c,m+d.oLength),f.push(n.shift())}if(f.length===1){if(l.abLength>0){let d=l.ab==="a"?e:r;a.push({stable:!0,buffer:l.ab,bufferStart:l.abStart,bufferLength:l.abLength,bufferContent:d.slice(l.abStart,l.abStart+l.abLength)})}}else{let d={a:[e.length,-1,t.length,-1],b:[r.length,-1,t.length,-1]};for(;f.length;){l=f.shift();let _=l.oStart,w=_+l.oLength,k=l.abStart,x=k+l.abLength,S=d[l.ab];S[0]=Math.min(k,S[0]),S[1]=Math.max(x,S[1]),S[2]=Math.min(_,S[2]),S[3]=Math.max(w,S[3])}let m=d.a[0]+(u-d.a[2]),h=d.a[1]+(c-d.a[3]),g=d.b[0]+(u-d.b[2]),A=d.b[1]+(c-d.b[3]),v={stable:!1,aStart:m,aLength:h-m,aContent:e.slice(m,h),oStart:u,oLength:c-u,oContent:t.slice(u,c),bStart:g,bLength:A-g,bContent:r.slice(g,A)};a.push(v)}o=c}return s(t.length),a}function ZP(e,t,r,n){n=Object.assign({excludeFalseConflicts:!0,stringSeparator:/\s+/},n),typeof e=="string"&&(e=e.split(n.stringSeparator)),typeof t=="string"&&(t=t.split(n.stringSeparator)),typeof r=="string"&&(r=r.split(n.stringSeparator));let a=[],o=ere(e,t,r),s=[];function l(){s.length&&a.push({ok:s}),s=[]}function u(c,f){if(c.length!==f.length)return!1;for(let d=0;d<c.length;d++)if(c[d]!==f[d])return!1;return!0}return o.forEach(c=>{c.stable?s.push(...c.bufferContent):n.excludeFalseConflicts&&u(c.aContent,c.bContent)?s.push(...c.aContent):(l(),a.push({conflict:{a:c.aContent,aIndex:c.aStart,o:c.oContent,oIndex:c.oStart,b:c.bContent,bIndex:c.bStart}}))}),l(),a}var JP=q(()=>{});var I3=an((C3,J7)=>{(function(){var e,t="4.17.21",r=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",a="Invalid `variable` option passed into `_.template`",o="__lodash_hash_undefined__",s=500,l="__lodash_placeholder__",u=1,c=2,f=4,d=1,m=2,h=1,g=2,A=4,v=8,_=16,w=32,k=64,x=128,S=256,I=512,b=30,y="...",E=800,M=16,F=1,N=2,D=3,O=1/0,L=9007199254740991,P=17976931348623157e292,U=NaN,B=4294967295,z=B-1,V=B>>>1,G=[["ary",x],["bind",h],["bindKey",g],["curry",v],["curryRight",_],["flip",I],["partial",w],["partialRight",k],["rearg",S]],W="[object Arguments]",Y="[object Array]",J="[object AsyncFunction]",oe="[object Boolean]",Ce="[object Date]",se="[object DOMException]",ne="[object Error]",he="[object Function]",Se="[object GeneratorFunction]",re="[object Map]",Z="[object Number]",te="[object Null]",ye="[object Object]",we="[object Promise]",Ne="[object Proxy]",Be="[object RegExp]",le="[object Set]",ie="[object String]",ve="[object Symbol]",be="[object Undefined]",Te="[object WeakMap]",Oe="[object WeakSet]",Ve="[object ArrayBuffer]",Qe="[object DataView]",ct="[object Float32Array]",rt="[object Float64Array]",We="[object Int8Array]",Rt="[object Int16Array]",lt="[object Int32Array]",vt="[object Uint8Array]",_t="[object Uint8ClampedArray]",wr="[object Uint16Array]",tn="[object Uint32Array]",rn=/\b__p \+= '';/g,Si=/\b(__p \+=) '' \+/g,Fo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,hn=/&(?:amp|lt|gt|quot|#39);/g,Ci=/[&<>"']/g,gn=RegExp(hn.source),Ha=RegExp(Ci.source),Hi=/<%-([\s\S]+?)%>/g,ns=/<%([\s\S]+?)%>/g,ba=/<%=([\s\S]+?)%>/g,wa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xs=/^\w*$/,gc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,f0=/[\\^$.*+?()[\]{}|]/g,vc=RegExp(f0.source),Rl=/^\s+/,d0=/\s/,yc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,bc=/\{\n\/\* \[wrapped with (.+)\] \*/,wc=/,? & /,xc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,iv=/[()=,{}\[\]\/\s]/,av=/\\(\\)?/g,ov=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Fn=/\w*$/,Ll=/^[-+]0x[0-9a-f]+$/i,_c=/^0b[01]+$/i,Ul=/^\[object .+?Constructor\]$/,A6=/^0o[0-7]+$/i,S6=/^(?:0|[1-9]\d*)$/,kc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Bl=/($^)/,Zs=/['\n\r\u2028\u2029\\]/g,ji="\\ud800-\\udfff",zl="\\u0300-\\u036f",ql="\\ufe20-\\ufe2f",Js="\\u20d0-\\u20ff",p0=zl+ql+Js,lA="\\u2700-\\u27bf",uA="a-z\\xdf-\\xf6\\xf8-\\xff",IW="\\xac\\xb1\\xd7\\xf7",MW="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",TW="\\u2000-\\u206f",NW=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",cA="A-Z\\xc0-\\xd6\\xd8-\\xde",fA="\\ufe0e\\ufe0f",dA=IW+MW+TW+NW,sv="['\u2019]",DW="["+ji+"]",pA="["+dA+"]",Ec="["+p0+"]",mA="\\d+",PW="["+lA+"]",hA="["+uA+"]",gA="[^"+ji+dA+mA+lA+uA+cA+"]",lv="\\ud83c[\\udffb-\\udfff]",FW="(?:"+Ec+"|"+lv+")",vA="[^"+ji+"]",uv="(?:\\ud83c[\\udde6-\\uddff]){2}",cv="[\\ud800-\\udbff][\\udc00-\\udfff]",m0="["+cA+"]",yA="\\u200d",bA="(?:"+hA+"|"+gA+")",OW="(?:"+m0+"|"+gA+")",wA="(?:"+sv+"(?:d|ll|m|re|s|t|ve))?",xA="(?:"+sv+"(?:D|LL|M|RE|S|T|VE))?",_A=FW+"?",kA="["+fA+"]?",RW="(?:"+yA+"(?:"+[vA,uv,cv].join("|")+")"+kA+_A+")*",LW="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",UW="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",EA=kA+_A+RW,BW="(?:"+[PW,uv,cv].join("|")+")"+EA,zW="(?:"+[vA+Ec+"?",Ec,uv,cv,DW].join("|")+")",qW=RegExp(sv,"g"),VW=RegExp(Ec,"g"),fv=RegExp(lv+"(?="+lv+")|"+zW+EA,"g"),$W=RegExp([m0+"?"+hA+"+"+wA+"(?="+[pA,m0,"$"].join("|")+")",OW+"+"+xA+"(?="+[pA,m0+bA,"$"].join("|")+")",m0+"?"+bA+"+"+wA,m0+"+"+xA,UW,LW,mA,BW].join("|"),"g"),GW=RegExp("["+yA+ji+p0+fA+"]"),WW=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,QW=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],HW=-1,Br={};Br[ct]=Br[rt]=Br[We]=Br[Rt]=Br[lt]=Br[vt]=Br[_t]=Br[wr]=Br[tn]=!0,Br[W]=Br[Y]=Br[Ve]=Br[oe]=Br[Qe]=Br[Ce]=Br[ne]=Br[he]=Br[re]=Br[Z]=Br[ye]=Br[Be]=Br[le]=Br[ie]=Br[Te]=!1;var Or={};Or[W]=Or[Y]=Or[Ve]=Or[Qe]=Or[oe]=Or[Ce]=Or[ct]=Or[rt]=Or[We]=Or[Rt]=Or[lt]=Or[re]=Or[Z]=Or[ye]=Or[Be]=Or[le]=Or[ie]=Or[ve]=Or[vt]=Or[_t]=Or[wr]=Or[tn]=!0,Or[ne]=Or[he]=Or[Te]=!1;var jW={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},YW={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},KW={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},XW={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ZW=parseFloat,JW=parseInt,AA=typeof global=="object"&&global&&global.Object===Object&&global,eQ=typeof self=="object"&&self&&self.Object===Object&&self,$n=AA||eQ||Function("return this")(),dv=typeof C3=="object"&&C3&&!C3.nodeType&&C3,Vl=dv&&typeof J7=="object"&&J7&&!J7.nodeType&&J7,SA=Vl&&Vl.exports===dv,pv=SA&&AA.process,ja=function(){try{var fe=Vl&&Vl.require&&Vl.require("util").types;return fe||pv&&pv.binding&&pv.binding("util")}catch{}}(),CA=ja&&ja.isArrayBuffer,IA=ja&&ja.isDate,MA=ja&&ja.isMap,TA=ja&&ja.isRegExp,NA=ja&&ja.isSet,DA=ja&&ja.isTypedArray;function xa(fe,De,Ee){switch(Ee.length){case 0:return fe.call(De);case 1:return fe.call(De,Ee[0]);case 2:return fe.call(De,Ee[0],Ee[1]);case 3:return fe.call(De,Ee[0],Ee[1],Ee[2])}return fe.apply(De,Ee)}function tQ(fe,De,Ee,et){for(var kt=-1,vr=fe==null?0:fe.length;++kt<vr;){var On=fe[kt];De(et,On,Ee(On),fe)}return et}function Ya(fe,De){for(var Ee=-1,et=fe==null?0:fe.length;++Ee<et&&De(fe[Ee],Ee,fe)!==!1;);return fe}function rQ(fe,De){for(var Ee=fe==null?0:fe.length;Ee--&&De(fe[Ee],Ee,fe)!==!1;);return fe}function PA(fe,De){for(var Ee=-1,et=fe==null?0:fe.length;++Ee<et;)if(!De(fe[Ee],Ee,fe))return!1;return!0}function e4(fe,De){for(var Ee=-1,et=fe==null?0:fe.length,kt=0,vr=[];++Ee<et;){var On=fe[Ee];De(On,Ee,fe)&&(vr[kt++]=On)}return vr}function Ac(fe,De){var Ee=fe==null?0:fe.length;return!!Ee&&h0(fe,De,0)>-1}function mv(fe,De,Ee){for(var et=-1,kt=fe==null?0:fe.length;++et<kt;)if(Ee(De,fe[et]))return!0;return!1}function Wr(fe,De){for(var Ee=-1,et=fe==null?0:fe.length,kt=Array(et);++Ee<et;)kt[Ee]=De(fe[Ee],Ee,fe);return kt}function t4(fe,De){for(var Ee=-1,et=De.length,kt=fe.length;++Ee<et;)fe[kt+Ee]=De[Ee];return fe}function hv(fe,De,Ee,et){var kt=-1,vr=fe==null?0:fe.length;for(et&&vr&&(Ee=fe[++kt]);++kt<vr;)Ee=De(Ee,fe[kt],kt,fe);return Ee}function nQ(fe,De,Ee,et){var kt=fe==null?0:fe.length;for(et&&kt&&(Ee=fe[--kt]);kt--;)Ee=De(Ee,fe[kt],kt,fe);return Ee}function gv(fe,De){for(var Ee=-1,et=fe==null?0:fe.length;++Ee<et;)if(De(fe[Ee],Ee,fe))return!0;return!1}var iQ=vv("length");function aQ(fe){return fe.split("")}function oQ(fe){return fe.match(xc)||[]}function FA(fe,De,Ee){var et;return Ee(fe,function(kt,vr,On){if(De(kt,vr,On))return et=vr,!1}),et}function Sc(fe,De,Ee,et){for(var kt=fe.length,vr=Ee+(et?1:-1);et?vr--:++vr<kt;)if(De(fe[vr],vr,fe))return vr;return-1}function h0(fe,De,Ee){return De===De?yQ(fe,De,Ee):Sc(fe,OA,Ee)}function sQ(fe,De,Ee,et){for(var kt=Ee-1,vr=fe.length;++kt<vr;)if(et(fe[kt],De))return kt;return-1}function OA(fe){return fe!==fe}function RA(fe,De){var Ee=fe==null?0:fe.length;return Ee?bv(fe,De)/Ee:U}function vv(fe){return function(De){return De==null?e:De[fe]}}function yv(fe){return function(De){return fe==null?e:fe[De]}}function LA(fe,De,Ee,et,kt){return kt(fe,function(vr,On,Nr){Ee=et?(et=!1,vr):De(Ee,vr,On,Nr)}),Ee}function lQ(fe,De){var Ee=fe.length;for(fe.sort(De);Ee--;)fe[Ee]=fe[Ee].value;return fe}function bv(fe,De){for(var Ee,et=-1,kt=fe.length;++et<kt;){var vr=De(fe[et]);vr!==e&&(Ee=Ee===e?vr:Ee+vr)}return Ee}function wv(fe,De){for(var Ee=-1,et=Array(fe);++Ee<fe;)et[Ee]=De(Ee);return et}function uQ(fe,De){return Wr(De,function(Ee){return[Ee,fe[Ee]]})}function UA(fe){return fe&&fe.slice(0,VA(fe)+1).replace(Rl,"")}function _a(fe){return function(De){return fe(De)}}function xv(fe,De){return Wr(De,function(Ee){return fe[Ee]})}function C6(fe,De){return fe.has(De)}function BA(fe,De){for(var Ee=-1,et=fe.length;++Ee<et&&h0(De,fe[Ee],0)>-1;);return Ee}function zA(fe,De){for(var Ee=fe.length;Ee--&&h0(De,fe[Ee],0)>-1;);return Ee}function cQ(fe,De){for(var Ee=fe.length,et=0;Ee--;)fe[Ee]===De&&++et;return et}var fQ=yv(jW),dQ=yv(YW);function pQ(fe){return"\\"+XW[fe]}function mQ(fe,De){return fe==null?e:fe[De]}function g0(fe){return GW.test(fe)}function hQ(fe){return WW.test(fe)}function gQ(fe){for(var De,Ee=[];!(De=fe.next()).done;)Ee.push(De.value);return Ee}function _v(fe){var De=-1,Ee=Array(fe.size);return fe.forEach(function(et,kt){Ee[++De]=[kt,et]}),Ee}function qA(fe,De){return function(Ee){return fe(De(Ee))}}function r4(fe,De){for(var Ee=-1,et=fe.length,kt=0,vr=[];++Ee<et;){var On=fe[Ee];(On===De||On===l)&&(fe[Ee]=l,vr[kt++]=Ee)}return vr}function Cc(fe){var De=-1,Ee=Array(fe.size);return fe.forEach(function(et){Ee[++De]=et}),Ee}function vQ(fe){var De=-1,Ee=Array(fe.size);return fe.forEach(function(et){Ee[++De]=[et,et]}),Ee}function yQ(fe,De,Ee){for(var et=Ee-1,kt=fe.length;++et<kt;)if(fe[et]===De)return et;return-1}function bQ(fe,De,Ee){for(var et=Ee+1;et--;)if(fe[et]===De)return et;return et}function v0(fe){return g0(fe)?xQ(fe):iQ(fe)}function Oo(fe){return g0(fe)?_Q(fe):aQ(fe)}function VA(fe){for(var De=fe.length;De--&&d0.test(fe.charAt(De)););return De}var wQ=yv(KW);function xQ(fe){for(var De=fv.lastIndex=0;fv.test(fe);)++De;return De}function _Q(fe){return fe.match(fv)||[]}function kQ(fe){return fe.match($W)||[]}var EQ=function fe(De){De=De==null?$n:n4.defaults($n.Object(),De,n4.pick($n,QW));var Ee=De.Array,et=De.Date,kt=De.Error,vr=De.Function,On=De.Math,Nr=De.Object,kv=De.RegExp,AQ=De.String,Ka=De.TypeError,Ic=Ee.prototype,SQ=vr.prototype,y0=Nr.prototype,Mc=De["__core-js_shared__"],Tc=SQ.toString,Sr=y0.hasOwnProperty,CQ=0,$A=function(){var p=/[^.]+$/.exec(Mc&&Mc.keys&&Mc.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""}(),Nc=y0.toString,IQ=Tc.call(Nr),MQ=$n._,TQ=kv("^"+Tc.call(Sr).replace(f0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Dc=SA?De.Buffer:e,i4=De.Symbol,Pc=De.Uint8Array,GA=Dc?Dc.allocUnsafe:e,Fc=qA(Nr.getPrototypeOf,Nr),WA=Nr.create,QA=y0.propertyIsEnumerable,Oc=Ic.splice,HA=i4?i4.isConcatSpreadable:e,I6=i4?i4.iterator:e,$l=i4?i4.toStringTag:e,Rc=function(){try{var p=jl(Nr,"defineProperty");return p({},"",{}),p}catch{}}(),NQ=De.clearTimeout!==$n.clearTimeout&&De.clearTimeout,DQ=et&&et.now!==$n.Date.now&&et.now,PQ=De.setTimeout!==$n.setTimeout&&De.setTimeout,Lc=On.ceil,Uc=On.floor,Ev=Nr.getOwnPropertySymbols,FQ=Dc?Dc.isBuffer:e,jA=De.isFinite,OQ=Ic.join,RQ=qA(Nr.keys,Nr),Rn=On.max,gi=On.min,LQ=et.now,UQ=De.parseInt,YA=On.random,BQ=Ic.reverse,Av=jl(De,"DataView"),M6=jl(De,"Map"),Sv=jl(De,"Promise"),b0=jl(De,"Set"),T6=jl(De,"WeakMap"),N6=jl(Nr,"create"),Bc=T6&&new T6,w0={},zQ=Yl(Av),qQ=Yl(M6),VQ=Yl(Sv),$Q=Yl(b0),GQ=Yl(T6),zc=i4?i4.prototype:e,D6=zc?zc.valueOf:e,KA=zc?zc.toString:e;function K(p){if(nn(p)&&!Ct(p)&&!(p instanceof er)){if(p instanceof Xa)return p;if(Sr.call(p,"__wrapped__"))return XS(p)}return new Xa(p)}var x0=function(){function p(){}return function(C){if(!Hr(C))return{};if(WA)return WA(C);p.prototype=C;var R=new p;return p.prototype=e,R}}();function qc(){}function Xa(p,C){this.__wrapped__=p,this.__actions__=[],this.__chain__=!!C,this.__index__=0,this.__values__=e}K.templateSettings={escape:Hi,evaluate:ns,interpolate:ba,variable:"",imports:{_:K}},K.prototype=qc.prototype,K.prototype.constructor=K,Xa.prototype=x0(qc.prototype),Xa.prototype.constructor=Xa;function er(p){this.__wrapped__=p,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=B,this.__views__=[]}function WQ(){var p=new er(this.__wrapped__);return p.__actions__=Yi(this.__actions__),p.__dir__=this.__dir__,p.__filtered__=this.__filtered__,p.__iteratees__=Yi(this.__iteratees__),p.__takeCount__=this.__takeCount__,p.__views__=Yi(this.__views__),p}function QQ(){if(this.__filtered__){var p=new er(this);p.__dir__=-1,p.__filtered__=!0}else p=this.clone(),p.__dir__*=-1;return p}function HQ(){var p=this.__wrapped__.value(),C=this.__dir__,R=Ct(p),$=C<0,H=R?p.length:0,X=aj(0,H,this.__views__),ee=X.start,ae=X.end,me=ae-ee,Fe=$?ae:ee-1,Re=this.__iteratees__,ze=Re.length,Ke=0,nt=gi(me,this.__takeCount__);if(!R||!$&&H==me&&nt==me)return wS(p,this.__actions__);var ht=[];e:for(;me--&&Ke<nt;){Fe+=C;for(var Lt=-1,gt=p[Fe];++Lt<ze;){var Xt=Re[Lt],ir=Xt.iteratee,Aa=Xt.type,Ti=ir(gt);if(Aa==N)gt=Ti;else if(!Ti){if(Aa==F)continue e;break e}}ht[Ke++]=gt}return ht}er.prototype=x0(qc.prototype),er.prototype.constructor=er;function Gl(p){var C=-1,R=p==null?0:p.length;for(this.clear();++C<R;){var $=p[C];this.set($[0],$[1])}}function jQ(){this.__data__=N6?N6(null):{},this.size=0}function YQ(p){var C=this.has(p)&&delete this.__data__[p];return this.size-=C?1:0,C}function KQ(p){var C=this.__data__;if(N6){var R=C[p];return R===o?e:R}return Sr.call(C,p)?C[p]:e}function XQ(p){var C=this.__data__;return N6?C[p]!==e:Sr.call(C,p)}function ZQ(p,C){var R=this.__data__;return this.size+=this.has(p)?0:1,R[p]=N6&&C===e?o:C,this}Gl.prototype.clear=jQ,Gl.prototype.delete=YQ,Gl.prototype.get=KQ,Gl.prototype.has=XQ,Gl.prototype.set=ZQ;function is(p){var C=-1,R=p==null?0:p.length;for(this.clear();++C<R;){var $=p[C];this.set($[0],$[1])}}function JQ(){this.__data__=[],this.size=0}function eH(p){var C=this.__data__,R=Vc(C,p);if(R<0)return!1;var $=C.length-1;return R==$?C.pop():Oc.call(C,R,1),--this.size,!0}function tH(p){var C=this.__data__,R=Vc(C,p);return R<0?e:C[R][1]}function rH(p){return Vc(this.__data__,p)>-1}function nH(p,C){var R=this.__data__,$=Vc(R,p);return $<0?(++this.size,R.push([p,C])):R[$][1]=C,this}is.prototype.clear=JQ,is.prototype.delete=eH,is.prototype.get=tH,is.prototype.has=rH,is.prototype.set=nH;function as(p){var C=-1,R=p==null?0:p.length;for(this.clear();++C<R;){var $=p[C];this.set($[0],$[1])}}function iH(){this.size=0,this.__data__={hash:new Gl,map:new(M6||is),string:new Gl}}function aH(p){var C=ef(this,p).delete(p);return this.size-=C?1:0,C}function oH(p){return ef(this,p).get(p)}function sH(p){return ef(this,p).has(p)}function lH(p,C){var R=ef(this,p),$=R.size;return R.set(p,C),this.size+=R.size==$?0:1,this}as.prototype.clear=iH,as.prototype.delete=aH,as.prototype.get=oH,as.prototype.has=sH,as.prototype.set=lH;function Wl(p){var C=-1,R=p==null?0:p.length;for(this.__data__=new as;++C<R;)this.add(p[C])}function uH(p){return this.__data__.set(p,o),this}function cH(p){return this.__data__.has(p)}Wl.prototype.add=Wl.prototype.push=uH,Wl.prototype.has=cH;function Ro(p){var C=this.__data__=new is(p);this.size=C.size}function fH(){this.__data__=new is,this.size=0}function dH(p){var C=this.__data__,R=C.delete(p);return this.size=C.size,R}function pH(p){return this.__data__.get(p)}function mH(p){return this.__data__.has(p)}function hH(p,C){var R=this.__data__;if(R instanceof is){var $=R.__data__;if(!M6||$.length<r-1)return $.push([p,C]),this.size=++R.size,this;R=this.__data__=new as($)}return R.set(p,C),this.size=R.size,this}Ro.prototype.clear=fH,Ro.prototype.delete=dH,Ro.prototype.get=pH,Ro.prototype.has=mH,Ro.prototype.set=hH;function XA(p,C){var R=Ct(p),$=!R&&Kl(p),H=!R&&!$&&u4(p),X=!R&&!$&&!H&&A0(p),ee=R||$||H||X,ae=ee?wv(p.length,AQ):[],me=ae.length;for(var Fe in p)(C||Sr.call(p,Fe))&&!(ee&&(Fe=="length"||H&&(Fe=="offset"||Fe=="parent")||X&&(Fe=="buffer"||Fe=="byteLength"||Fe=="byteOffset")||us(Fe,me)))&&ae.push(Fe);return ae}function ZA(p){var C=p.length;return C?p[Lv(0,C-1)]:e}function gH(p,C){return tf(Yi(p),Ql(C,0,p.length))}function vH(p){return tf(Yi(p))}function Cv(p,C,R){(R!==e&&!Lo(p[C],R)||R===e&&!(C in p))&&os(p,C,R)}function P6(p,C,R){var $=p[C];(!(Sr.call(p,C)&&Lo($,R))||R===e&&!(C in p))&&os(p,C,R)}function Vc(p,C){for(var R=p.length;R--;)if(Lo(p[R][0],C))return R;return-1}function yH(p,C,R,$){return a4(p,function(H,X,ee){C($,H,R(H),ee)}),$}function JA(p,C){return p&&m1(C,Gn(C),p)}function bH(p,C){return p&&m1(C,Xi(C),p)}function os(p,C,R){C=="__proto__"&&Rc?Rc(p,C,{configurable:!0,enumerable:!0,value:R,writable:!0}):p[C]=R}function Iv(p,C){for(var R=-1,$=C.length,H=Ee($),X=p==null;++R<$;)H[R]=X?e:ly(p,C[R]);return H}function Ql(p,C,R){return p===p&&(R!==e&&(p=p<=R?p:R),C!==e&&(p=p>=C?p:C)),p}function Za(p,C,R,$,H,X){var ee,ae=C&u,me=C&c,Fe=C&f;if(R&&(ee=H?R(p,$,H,X):R(p)),ee!==e)return ee;if(!Hr(p))return p;var Re=Ct(p);if(Re){if(ee=sj(p),!ae)return Yi(p,ee)}else{var ze=vi(p),Ke=ze==he||ze==Se;if(u4(p))return kS(p,ae);if(ze==ye||ze==W||Ke&&!H){if(ee=me||Ke?{}:VS(p),!ae)return me?KH(p,bH(ee,p)):YH(p,JA(ee,p))}else{if(!Or[ze])return H?p:{};ee=lj(p,ze,ae)}}X||(X=new Ro);var nt=X.get(p);if(nt)return nt;X.set(p,ee),vC(p)?p.forEach(function(gt){ee.add(Za(gt,C,R,gt,p,X))}):hC(p)&&p.forEach(function(gt,Xt){ee.set(Xt,Za(gt,C,R,Xt,p,X))});var ht=Fe?me?jv:Hv:me?Xi:Gn,Lt=Re?e:ht(p);return Ya(Lt||p,function(gt,Xt){Lt&&(Xt=gt,gt=p[Xt]),P6(ee,Xt,Za(gt,C,R,Xt,p,X))}),ee}function wH(p){var C=Gn(p);return function(R){return eS(R,p,C)}}function eS(p,C,R){var $=R.length;if(p==null)return!$;for(p=Nr(p);$--;){var H=R[$],X=C[H],ee=p[H];if(ee===e&&!(H in p)||!X(ee))return!1}return!0}function tS(p,C,R){if(typeof p!="function")throw new Ka(i);return z6(function(){p.apply(e,R)},C)}function F6(p,C,R,$){var H=-1,X=Ac,ee=!0,ae=p.length,me=[],Fe=C.length;if(!ae)return me;R&&(C=Wr(C,_a(R))),$?(X=mv,ee=!1):C.length>=r&&(X=C6,ee=!1,C=new Wl(C));e:for(;++H<ae;){var Re=p[H],ze=R==null?Re:R(Re);if(Re=$||Re!==0?Re:0,ee&&ze===ze){for(var Ke=Fe;Ke--;)if(C[Ke]===ze)continue e;me.push(Re)}else X(C,ze,$)||me.push(Re)}return me}var a4=IS(p1),rS=IS(Tv,!0);function xH(p,C){var R=!0;return a4(p,function($,H,X){return R=!!C($,H,X),R}),R}function $c(p,C,R){for(var $=-1,H=p.length;++$<H;){var X=p[$],ee=C(X);if(ee!=null&&(ae===e?ee===ee&&!Ea(ee):R(ee,ae)))var ae=ee,me=X}return me}function _H(p,C,R,$){var H=p.length;for(R=Pt(R),R<0&&(R=-R>H?0:H+R),$=$===e||$>H?H:Pt($),$<0&&($+=H),$=R>$?0:bC($);R<$;)p[R++]=C;return p}function nS(p,C){var R=[];return a4(p,function($,H,X){C($,H,X)&&R.push($)}),R}function ii(p,C,R,$,H){var X=-1,ee=p.length;for(R||(R=cj),H||(H=[]);++X<ee;){var ae=p[X];C>0&&R(ae)?C>1?ii(ae,C-1,R,$,H):t4(H,ae):$||(H[H.length]=ae)}return H}var Mv=MS(),iS=MS(!0);function p1(p,C){return p&&Mv(p,C,Gn)}function Tv(p,C){return p&&iS(p,C,Gn)}function Gc(p,C){return e4(C,function(R){return cs(p[R])})}function Hl(p,C){C=s4(C,p);for(var R=0,$=C.length;p!=null&&R<$;)p=p[h1(C[R++])];return R&&R==$?p:e}function aS(p,C,R){var $=C(p);return Ct(p)?$:t4($,R(p))}function Ii(p){return p==null?p===e?be:te:$l&&$l in Nr(p)?ij(p):vj(p)}function Nv(p,C){return p>C}function kH(p,C){return p!=null&&Sr.call(p,C)}function EH(p,C){return p!=null&&C in Nr(p)}function AH(p,C,R){return p>=gi(C,R)&&p<Rn(C,R)}function Dv(p,C,R){for(var $=R?mv:Ac,H=p[0].length,X=p.length,ee=X,ae=Ee(X),me=1/0,Fe=[];ee--;){var Re=p[ee];ee&&C&&(Re=Wr(Re,_a(C))),me=gi(Re.length,me),ae[ee]=!R&&(C||H>=120&&Re.length>=120)?new Wl(ee&&Re):e}Re=p[0];var ze=-1,Ke=ae[0];e:for(;++ze<H&&Fe.length<me;){var nt=Re[ze],ht=C?C(nt):nt;if(nt=R||nt!==0?nt:0,!(Ke?C6(Ke,ht):$(Fe,ht,R))){for(ee=X;--ee;){var Lt=ae[ee];if(!(Lt?C6(Lt,ht):$(p[ee],ht,R)))continue e}Ke&&Ke.push(ht),Fe.push(nt)}}return Fe}function SH(p,C,R,$){return p1(p,function(H,X,ee){C($,R(H),X,ee)}),$}function O6(p,C,R){C=s4(C,p),p=QS(p,C);var $=p==null?p:p[h1(eo(C))];return $==null?e:xa($,p,R)}function oS(p){return nn(p)&&Ii(p)==W}function CH(p){return nn(p)&&Ii(p)==Ve}function IH(p){return nn(p)&&Ii(p)==Ce}function R6(p,C,R,$,H){return p===C?!0:p==null||C==null||!nn(p)&&!nn(C)?p!==p&&C!==C:MH(p,C,R,$,R6,H)}function MH(p,C,R,$,H,X){var ee=Ct(p),ae=Ct(C),me=ee?Y:vi(p),Fe=ae?Y:vi(C);me=me==W?ye:me,Fe=Fe==W?ye:Fe;var Re=me==ye,ze=Fe==ye,Ke=me==Fe;if(Ke&&u4(p)){if(!u4(C))return!1;ee=!0,Re=!1}if(Ke&&!Re)return X||(X=new Ro),ee||A0(p)?BS(p,C,R,$,H,X):rj(p,C,me,R,$,H,X);if(!(R&d)){var nt=Re&&Sr.call(p,"__wrapped__"),ht=ze&&Sr.call(C,"__wrapped__");if(nt||ht){var Lt=nt?p.value():p,gt=ht?C.value():C;return X||(X=new Ro),H(Lt,gt,R,$,X)}}return Ke?(X||(X=new Ro),nj(p,C,R,$,H,X)):!1}function TH(p){return nn(p)&&vi(p)==re}function Pv(p,C,R,$){var H=R.length,X=H,ee=!$;if(p==null)return!X;for(p=Nr(p);H--;){var ae=R[H];if(ee&&ae[2]?ae[1]!==p[ae[0]]:!(ae[0]in p))return!1}for(;++H<X;){ae=R[H];var me=ae[0],Fe=p[me],Re=ae[1];if(ee&&ae[2]){if(Fe===e&&!(me in p))return!1}else{var ze=new Ro;if($)var Ke=$(Fe,Re,me,p,C,ze);if(!(Ke===e?R6(Re,Fe,d|m,$,ze):Ke))return!1}}return!0}function sS(p){if(!Hr(p)||dj(p))return!1;var C=cs(p)?TQ:Ul;return C.test(Yl(p))}function NH(p){return nn(p)&&Ii(p)==Be}function DH(p){return nn(p)&&vi(p)==le}function PH(p){return nn(p)&&lf(p.length)&&!!Br[Ii(p)]}function lS(p){return typeof p=="function"?p:p==null?Zi:typeof p=="object"?Ct(p)?fS(p[0],p[1]):cS(p):TC(p)}function Fv(p){if(!B6(p))return RQ(p);var C=[];for(var R in Nr(p))Sr.call(p,R)&&R!="constructor"&&C.push(R);return C}function FH(p){if(!Hr(p))return gj(p);var C=B6(p),R=[];for(var $ in p)$=="constructor"&&(C||!Sr.call(p,$))||R.push($);return R}function Ov(p,C){return p<C}function uS(p,C){var R=-1,$=Ki(p)?Ee(p.length):[];return a4(p,function(H,X,ee){$[++R]=C(H,X,ee)}),$}function cS(p){var C=Kv(p);return C.length==1&&C[0][2]?GS(C[0][0],C[0][1]):function(R){return R===p||Pv(R,p,C)}}function fS(p,C){return Zv(p)&&$S(C)?GS(h1(p),C):function(R){var $=ly(R,p);return $===e&&$===C?uy(R,p):R6(C,$,d|m)}}function Wc(p,C,R,$,H){p!==C&&Mv(C,function(X,ee){if(H||(H=new Ro),Hr(X))OH(p,C,ee,R,Wc,$,H);else{var ae=$?$(ey(p,ee),X,ee+"",p,C,H):e;ae===e&&(ae=X),Cv(p,ee,ae)}},Xi)}function OH(p,C,R,$,H,X,ee){var ae=ey(p,R),me=ey(C,R),Fe=ee.get(me);if(Fe){Cv(p,R,Fe);return}var Re=X?X(ae,me,R+"",p,C,ee):e,ze=Re===e;if(ze){var Ke=Ct(me),nt=!Ke&&u4(me),ht=!Ke&&!nt&&A0(me);Re=me,Ke||nt||ht?Ct(ae)?Re=ae:vn(ae)?Re=Yi(ae):nt?(ze=!1,Re=kS(me,!0)):ht?(ze=!1,Re=ES(me,!0)):Re=[]:q6(me)||Kl(me)?(Re=ae,Kl(ae)?Re=wC(ae):(!Hr(ae)||cs(ae))&&(Re=VS(me))):ze=!1}ze&&(ee.set(me,Re),H(Re,me,$,X,ee),ee.delete(me)),Cv(p,R,Re)}function dS(p,C){var R=p.length;if(R)return C+=C<0?R:0,us(C,R)?p[C]:e}function pS(p,C,R){C.length?C=Wr(C,function(X){return Ct(X)?function(ee){return Hl(ee,X.length===1?X[0]:X)}:X}):C=[Zi];var $=-1;C=Wr(C,_a(mt()));var H=uS(p,function(X,ee,ae){var me=Wr(C,function(Fe){return Fe(X)});return{criteria:me,index:++$,value:X}});return lQ(H,function(X,ee){return jH(X,ee,R)})}function RH(p,C){return mS(p,C,function(R,$){return uy(p,$)})}function mS(p,C,R){for(var $=-1,H=C.length,X={};++$<H;){var ee=C[$],ae=Hl(p,ee);R(ae,ee)&&L6(X,s4(ee,p),ae)}return X}function LH(p){return function(C){return Hl(C,p)}}function Rv(p,C,R,$){var H=$?sQ:h0,X=-1,ee=C.length,ae=p;for(p===C&&(C=Yi(C)),R&&(ae=Wr(p,_a(R)));++X<ee;)for(var me=0,Fe=C[X],Re=R?R(Fe):Fe;(me=H(ae,Re,me,$))>-1;)ae!==p&&Oc.call(ae,me,1),Oc.call(p,me,1);return p}function hS(p,C){for(var R=p?C.length:0,$=R-1;R--;){var H=C[R];if(R==$||H!==X){var X=H;us(H)?Oc.call(p,H,1):zv(p,H)}}return p}function Lv(p,C){return p+Uc(YA()*(C-p+1))}function UH(p,C,R,$){for(var H=-1,X=Rn(Lc((C-p)/(R||1)),0),ee=Ee(X);X--;)ee[$?X:++H]=p,p+=R;return ee}function Uv(p,C){var R="";if(!p||C<1||C>L)return R;do C%2&&(R+=p),C=Uc(C/2),C&&(p+=p);while(C);return R}function Vt(p,C){return ty(WS(p,C,Zi),p+"")}function BH(p){return ZA(S0(p))}function zH(p,C){var R=S0(p);return tf(R,Ql(C,0,R.length))}function L6(p,C,R,$){if(!Hr(p))return p;C=s4(C,p);for(var H=-1,X=C.length,ee=X-1,ae=p;ae!=null&&++H<X;){var me=h1(C[H]),Fe=R;if(me==="__proto__"||me==="constructor"||me==="prototype")return p;if(H!=ee){var Re=ae[me];Fe=$?$(Re,me,ae):e,Fe===e&&(Fe=Hr(Re)?Re:us(C[H+1])?[]:{})}P6(ae,me,Fe),ae=ae[me]}return p}var gS=Bc?function(p,C){return Bc.set(p,C),p}:Zi,qH=Rc?function(p,C){return Rc(p,"toString",{configurable:!0,enumerable:!1,value:fy(C),writable:!0})}:Zi;function VH(p){return tf(S0(p))}function Ja(p,C,R){var $=-1,H=p.length;C<0&&(C=-C>H?0:H+C),R=R>H?H:R,R<0&&(R+=H),H=C>R?0:R-C>>>0,C>>>=0;for(var X=Ee(H);++$<H;)X[$]=p[$+C];return X}function $H(p,C){var R;return a4(p,function($,H,X){return R=C($,H,X),!R}),!!R}function Qc(p,C,R){var $=0,H=p==null?$:p.length;if(typeof C=="number"&&C===C&&H<=V){for(;$<H;){var X=$+H>>>1,ee=p[X];ee!==null&&!Ea(ee)&&(R?ee<=C:ee<C)?$=X+1:H=X}return H}return Bv(p,C,Zi,R)}function Bv(p,C,R,$){var H=0,X=p==null?0:p.length;if(X===0)return 0;C=R(C);for(var ee=C!==C,ae=C===null,me=Ea(C),Fe=C===e;H<X;){var Re=Uc((H+X)/2),ze=R(p[Re]),Ke=ze!==e,nt=ze===null,ht=ze===ze,Lt=Ea(ze);if(ee)var gt=$||ht;else Fe?gt=ht&&($||Ke):ae?gt=ht&&Ke&&($||!nt):me?gt=ht&&Ke&&!nt&&($||!Lt):nt||Lt?gt=!1:gt=$?ze<=C:ze<C;gt?H=Re+1:X=Re}return gi(X,z)}function vS(p,C){for(var R=-1,$=p.length,H=0,X=[];++R<$;){var ee=p[R],ae=C?C(ee):ee;if(!R||!Lo(ae,me)){var me=ae;X[H++]=ee===0?0:ee}}return X}function yS(p){return typeof p=="number"?p:Ea(p)?U:+p}function ka(p){if(typeof p=="string")return p;if(Ct(p))return Wr(p,ka)+"";if(Ea(p))return KA?KA.call(p):"";var C=p+"";return C=="0"&&1/p==-O?"-0":C}function o4(p,C,R){var $=-1,H=Ac,X=p.length,ee=!0,ae=[],me=ae;if(R)ee=!1,H=mv;else if(X>=r){var Fe=C?null:ej(p);if(Fe)return Cc(Fe);ee=!1,H=C6,me=new Wl}else me=C?[]:ae;e:for(;++$<X;){var Re=p[$],ze=C?C(Re):Re;if(Re=R||Re!==0?Re:0,ee&&ze===ze){for(var Ke=me.length;Ke--;)if(me[Ke]===ze)continue e;C&&me.push(ze),ae.push(Re)}else H(me,ze,R)||(me!==ae&&me.push(ze),ae.push(Re))}return ae}function zv(p,C){return C=s4(C,p),p=QS(p,C),p==null||delete p[h1(eo(C))]}function bS(p,C,R,$){return L6(p,C,R(Hl(p,C)),$)}function Hc(p,C,R,$){for(var H=p.length,X=$?H:-1;($?X--:++X<H)&&C(p[X],X,p););return R?Ja(p,$?0:X,$?X+1:H):Ja(p,$?X+1:0,$?H:X)}function wS(p,C){var R=p;return R instanceof er&&(R=R.value()),hv(C,function($,H){return H.func.apply(H.thisArg,t4([$],H.args))},R)}function qv(p,C,R){var $=p.length;if($<2)return $?o4(p[0]):[];for(var H=-1,X=Ee($);++H<$;)for(var ee=p[H],ae=-1;++ae<$;)ae!=H&&(X[H]=F6(X[H]||ee,p[ae],C,R));return o4(ii(X,1),C,R)}function xS(p,C,R){for(var $=-1,H=p.length,X=C.length,ee={};++$<H;){var ae=$<X?C[$]:e;R(ee,p[$],ae)}return ee}function Vv(p){return vn(p)?p:[]}function $v(p){return typeof p=="function"?p:Zi}function s4(p,C){return Ct(p)?p:Zv(p,C)?[p]:KS(xr(p))}var GH=Vt;function l4(p,C,R){var $=p.length;return R=R===e?$:R,!C&&R>=$?p:Ja(p,C,R)}var _S=NQ||function(p){return $n.clearTimeout(p)};function kS(p,C){if(C)return p.slice();var R=p.length,$=GA?GA(R):new p.constructor(R);return p.copy($),$}function Gv(p){var C=new p.constructor(p.byteLength);return new Pc(C).set(new Pc(p)),C}function WH(p,C){var R=C?Gv(p.buffer):p.buffer;return new p.constructor(R,p.byteOffset,p.byteLength)}function QH(p){var C=new p.constructor(p.source,Fn.exec(p));return C.lastIndex=p.lastIndex,C}function HH(p){return D6?Nr(D6.call(p)):{}}function ES(p,C){var R=C?Gv(p.buffer):p.buffer;return new p.constructor(R,p.byteOffset,p.length)}function AS(p,C){if(p!==C){var R=p!==e,$=p===null,H=p===p,X=Ea(p),ee=C!==e,ae=C===null,me=C===C,Fe=Ea(C);if(!ae&&!Fe&&!X&&p>C||X&&ee&&me&&!ae&&!Fe||$&&ee&&me||!R&&me||!H)return 1;if(!$&&!X&&!Fe&&p<C||Fe&&R&&H&&!$&&!X||ae&&R&&H||!ee&&H||!me)return-1}return 0}function jH(p,C,R){for(var $=-1,H=p.criteria,X=C.criteria,ee=H.length,ae=R.length;++$<ee;){var me=AS(H[$],X[$]);if(me){if($>=ae)return me;var Fe=R[$];return me*(Fe=="desc"?-1:1)}}return p.index-C.index}function SS(p,C,R,$){for(var H=-1,X=p.length,ee=R.length,ae=-1,me=C.length,Fe=Rn(X-ee,0),Re=Ee(me+Fe),ze=!$;++ae<me;)Re[ae]=C[ae];for(;++H<ee;)(ze||H<X)&&(Re[R[H]]=p[H]);for(;Fe--;)Re[ae++]=p[H++];return Re}function CS(p,C,R,$){for(var H=-1,X=p.length,ee=-1,ae=R.length,me=-1,Fe=C.length,Re=Rn(X-ae,0),ze=Ee(Re+Fe),Ke=!$;++H<Re;)ze[H]=p[H];for(var nt=H;++me<Fe;)ze[nt+me]=C[me];for(;++ee<ae;)(Ke||H<X)&&(ze[nt+R[ee]]=p[H++]);return ze}function Yi(p,C){var R=-1,$=p.length;for(C||(C=Ee($));++R<$;)C[R]=p[R];return C}function m1(p,C,R,$){var H=!R;R||(R={});for(var X=-1,ee=C.length;++X<ee;){var ae=C[X],me=$?$(R[ae],p[ae],ae,R,p):e;me===e&&(me=p[ae]),H?os(R,ae,me):P6(R,ae,me)}return R}function YH(p,C){return m1(p,Xv(p),C)}function KH(p,C){return m1(p,zS(p),C)}function jc(p,C){return function(R,$){var H=Ct(R)?tQ:yH,X=C?C():{};return H(R,p,mt($,2),X)}}function _0(p){return Vt(function(C,R){var $=-1,H=R.length,X=H>1?R[H-1]:e,ee=H>2?R[2]:e;for(X=p.length>3&&typeof X=="function"?(H--,X):e,ee&&Mi(R[0],R[1],ee)&&(X=H<3?e:X,H=1),C=Nr(C);++$<H;){var ae=R[$];ae&&p(C,ae,$,X)}return C})}function IS(p,C){return function(R,$){if(R==null)return R;if(!Ki(R))return p(R,$);for(var H=R.length,X=C?H:-1,ee=Nr(R);(C?X--:++X<H)&&$(ee[X],X,ee)!==!1;);return R}}function MS(p){return function(C,R,$){for(var H=-1,X=Nr(C),ee=$(C),ae=ee.length;ae--;){var me=ee[p?ae:++H];if(R(X[me],me,X)===!1)break}return C}}function XH(p,C,R){var $=C&h,H=U6(p);function X(){var ee=this&&this!==$n&&this instanceof X?H:p;return ee.apply($?R:this,arguments)}return X}function TS(p){return function(C){C=xr(C);var R=g0(C)?Oo(C):e,$=R?R[0]:C.charAt(0),H=R?l4(R,1).join(""):C.slice(1);return $[p]()+H}}function k0(p){return function(C){return hv(IC(CC(C).replace(qW,"")),p,"")}}function U6(p){return function(){var C=arguments;switch(C.length){case 0:return new p;case 1:return new p(C[0]);case 2:return new p(C[0],C[1]);case 3:return new p(C[0],C[1],C[2]);case 4:return new p(C[0],C[1],C[2],C[3]);case 5:return new p(C[0],C[1],C[2],C[3],C[4]);case 6:return new p(C[0],C[1],C[2],C[3],C[4],C[5]);case 7:return new p(C[0],C[1],C[2],C[3],C[4],C[5],C[6])}var R=x0(p.prototype),$=p.apply(R,C);return Hr($)?$:R}}function ZH(p,C,R){var $=U6(p);function H(){for(var X=arguments.length,ee=Ee(X),ae=X,me=E0(H);ae--;)ee[ae]=arguments[ae];var Fe=X<3&&ee[0]!==me&&ee[X-1]!==me?[]:r4(ee,me);if(X-=Fe.length,X<R)return OS(p,C,Yc,H.placeholder,e,ee,Fe,e,e,R-X);var Re=this&&this!==$n&&this instanceof H?$:p;return xa(Re,this,ee)}return H}function NS(p){return function(C,R,$){var H=Nr(C);if(!Ki(C)){var X=mt(R,3);C=Gn(C),R=function(ae){return X(H[ae],ae,H)}}var ee=p(C,R,$);return ee>-1?H[X?C[ee]:ee]:e}}function DS(p){return ls(function(C){var R=C.length,$=R,H=Xa.prototype.thru;for(p&&C.reverse();$--;){var X=C[$];if(typeof X!="function")throw new Ka(i);if(H&&!ee&&Jc(X)=="wrapper")var ee=new Xa([],!0)}for($=ee?$:R;++$<R;){X=C[$];var ae=Jc(X),me=ae=="wrapper"?Yv(X):e;me&&Jv(me[0])&&me[1]==(x|v|w|S)&&!me[4].length&&me[9]==1?ee=ee[Jc(me[0])].apply(ee,me[3]):ee=X.length==1&&Jv(X)?ee[ae]():ee.thru(X)}return function(){var Fe=arguments,Re=Fe[0];if(ee&&Fe.length==1&&Ct(Re))return ee.plant(Re).value();for(var ze=0,Ke=R?C[ze].apply(this,Fe):Re;++ze<R;)Ke=C[ze].call(this,Ke);return Ke}})}function Yc(p,C,R,$,H,X,ee,ae,me,Fe){var Re=C&x,ze=C&h,Ke=C&g,nt=C&(v|_),ht=C&I,Lt=Ke?e:U6(p);function gt(){for(var Xt=arguments.length,ir=Ee(Xt),Aa=Xt;Aa--;)ir[Aa]=arguments[Aa];if(nt)var Ti=E0(gt),Sa=cQ(ir,Ti);if($&&(ir=SS(ir,$,H,nt)),X&&(ir=CS(ir,X,ee,nt)),Xt-=Sa,nt&&Xt<Fe){var yn=r4(ir,Ti);return OS(p,C,Yc,gt.placeholder,R,ir,yn,ae,me,Fe-Xt)}var Uo=ze?R:this,ds=Ke?Uo[p]:p;return Xt=ir.length,ae?ir=yj(ir,ae):ht&&Xt>1&&ir.reverse(),Re&&me<Xt&&(ir.length=me),this&&this!==$n&&this instanceof gt&&(ds=Lt||U6(ds)),ds.apply(Uo,ir)}return gt}function PS(p,C){return function(R,$){return SH(R,p,C($),{})}}function Kc(p,C){return function(R,$){var H;if(R===e&&$===e)return C;if(R!==e&&(H=R),$!==e){if(H===e)return $;typeof R=="string"||typeof $=="string"?(R=ka(R),$=ka($)):(R=yS(R),$=yS($)),H=p(R,$)}return H}}function Wv(p){return ls(function(C){return C=Wr(C,_a(mt())),Vt(function(R){var $=this;return p(C,function(H){return xa(H,$,R)})})})}function Xc(p,C){C=C===e?" ":ka(C);var R=C.length;if(R<2)return R?Uv(C,p):C;var $=Uv(C,Lc(p/v0(C)));return g0(C)?l4(Oo($),0,p).join(""):$.slice(0,p)}function JH(p,C,R,$){var H=C&h,X=U6(p);function ee(){for(var ae=-1,me=arguments.length,Fe=-1,Re=$.length,ze=Ee(Re+me),Ke=this&&this!==$n&&this instanceof ee?X:p;++Fe<Re;)ze[Fe]=$[Fe];for(;me--;)ze[Fe++]=arguments[++ae];return xa(Ke,H?R:this,ze)}return ee}function FS(p){return function(C,R,$){return $&&typeof $!="number"&&Mi(C,R,$)&&(R=$=e),C=fs(C),R===e?(R=C,C=0):R=fs(R),$=$===e?C<R?1:-1:fs($),UH(C,R,$,p)}}function Zc(p){return function(C,R){return typeof C=="string"&&typeof R=="string"||(C=to(C),R=to(R)),p(C,R)}}function OS(p,C,R,$,H,X,ee,ae,me,Fe){var Re=C&v,ze=Re?ee:e,Ke=Re?e:ee,nt=Re?X:e,ht=Re?e:X;C|=Re?w:k,C&=~(Re?k:w),C&A||(C&=~(h|g));var Lt=[p,C,H,nt,ze,ht,Ke,ae,me,Fe],gt=R.apply(e,Lt);return Jv(p)&&HS(gt,Lt),gt.placeholder=$,jS(gt,p,C)}function Qv(p){var C=On[p];return function(R,$){if(R=to(R),$=$==null?0:gi(Pt($),292),$&&jA(R)){var H=(xr(R)+"e").split("e"),X=C(H[0]+"e"+(+H[1]+$));return H=(xr(X)+"e").split("e"),+(H[0]+"e"+(+H[1]-$))}return C(R)}}var ej=b0&&1/Cc(new b0([,-0]))[1]==O?function(p){return new b0(p)}:my;function RS(p){return function(C){var R=vi(C);return R==re?_v(C):R==le?vQ(C):uQ(C,p(C))}}function ss(p,C,R,$,H,X,ee,ae){var me=C&g;if(!me&&typeof p!="function")throw new Ka(i);var Fe=$?$.length:0;if(Fe||(C&=~(w|k),$=H=e),ee=ee===e?ee:Rn(Pt(ee),0),ae=ae===e?ae:Pt(ae),Fe-=H?H.length:0,C&k){var Re=$,ze=H;$=H=e}var Ke=me?e:Yv(p),nt=[p,C,R,$,H,Re,ze,X,ee,ae];if(Ke&&hj(nt,Ke),p=nt[0],C=nt[1],R=nt[2],$=nt[3],H=nt[4],ae=nt[9]=nt[9]===e?me?0:p.length:Rn(nt[9]-Fe,0),!ae&&C&(v|_)&&(C&=~(v|_)),!C||C==h)var ht=XH(p,C,R);else C==v||C==_?ht=ZH(p,C,ae):(C==w||C==(h|w))&&!H.length?ht=JH(p,C,R,$):ht=Yc.apply(e,nt);var Lt=Ke?gS:HS;return jS(Lt(ht,nt),p,C)}function LS(p,C,R,$){return p===e||Lo(p,y0[R])&&!Sr.call($,R)?C:p}function US(p,C,R,$,H,X){return Hr(p)&&Hr(C)&&(X.set(C,p),Wc(p,C,e,US,X),X.delete(C)),p}function tj(p){return q6(p)?e:p}function BS(p,C,R,$,H,X){var ee=R&d,ae=p.length,me=C.length;if(ae!=me&&!(ee&&me>ae))return!1;var Fe=X.get(p),Re=X.get(C);if(Fe&&Re)return Fe==C&&Re==p;var ze=-1,Ke=!0,nt=R&m?new Wl:e;for(X.set(p,C),X.set(C,p);++ze<ae;){var ht=p[ze],Lt=C[ze];if($)var gt=ee?$(Lt,ht,ze,C,p,X):$(ht,Lt,ze,p,C,X);if(gt!==e){if(gt)continue;Ke=!1;break}if(nt){if(!gv(C,function(Xt,ir){if(!C6(nt,ir)&&(ht===Xt||H(ht,Xt,R,$,X)))return nt.push(ir)})){Ke=!1;break}}else if(!(ht===Lt||H(ht,Lt,R,$,X))){Ke=!1;break}}return X.delete(p),X.delete(C),Ke}function rj(p,C,R,$,H,X,ee){switch(R){case Qe:if(p.byteLength!=C.byteLength||p.byteOffset!=C.byteOffset)return!1;p=p.buffer,C=C.buffer;case Ve:return!(p.byteLength!=C.byteLength||!X(new Pc(p),new Pc(C)));case oe:case Ce:case Z:return Lo(+p,+C);case ne:return p.name==C.name&&p.message==C.message;case Be:case ie:return p==C+"";case re:var ae=_v;case le:var me=$&d;if(ae||(ae=Cc),p.size!=C.size&&!me)return!1;var Fe=ee.get(p);if(Fe)return Fe==C;$|=m,ee.set(p,C);var Re=BS(ae(p),ae(C),$,H,X,ee);return ee.delete(p),Re;case ve:if(D6)return D6.call(p)==D6.call(C)}return!1}function nj(p,C,R,$,H,X){var ee=R&d,ae=Hv(p),me=ae.length,Fe=Hv(C),Re=Fe.length;if(me!=Re&&!ee)return!1;for(var ze=me;ze--;){var Ke=ae[ze];if(!(ee?Ke in C:Sr.call(C,Ke)))return!1}var nt=X.get(p),ht=X.get(C);if(nt&&ht)return nt==C&&ht==p;var Lt=!0;X.set(p,C),X.set(C,p);for(var gt=ee;++ze<me;){Ke=ae[ze];var Xt=p[Ke],ir=C[Ke];if($)var Aa=ee?$(ir,Xt,Ke,C,p,X):$(Xt,ir,Ke,p,C,X);if(!(Aa===e?Xt===ir||H(Xt,ir,R,$,X):Aa)){Lt=!1;break}gt||(gt=Ke=="constructor")}if(Lt&&!gt){var Ti=p.constructor,Sa=C.constructor;Ti!=Sa&&"constructor"in p&&"constructor"in C&&!(typeof Ti=="function"&&Ti instanceof Ti&&typeof Sa=="function"&&Sa instanceof Sa)&&(Lt=!1)}return X.delete(p),X.delete(C),Lt}function ls(p){return ty(WS(p,e,eC),p+"")}function Hv(p){return aS(p,Gn,Xv)}function jv(p){return aS(p,Xi,zS)}var Yv=Bc?function(p){return Bc.get(p)}:my;function Jc(p){for(var C=p.name+"",R=w0[C],$=Sr.call(w0,C)?R.length:0;$--;){var H=R[$],X=H.func;if(X==null||X==p)return H.name}return C}function E0(p){var C=Sr.call(K,"placeholder")?K:p;return C.placeholder}function mt(){var p=K.iteratee||dy;return p=p===dy?lS:p,arguments.length?p(arguments[0],arguments[1]):p}function ef(p,C){var R=p.__data__;return fj(C)?R[typeof C=="string"?"string":"hash"]:R.map}function Kv(p){for(var C=Gn(p),R=C.length;R--;){var $=C[R],H=p[$];C[R]=[$,H,$S(H)]}return C}function jl(p,C){var R=mQ(p,C);return sS(R)?R:e}function ij(p){var C=Sr.call(p,$l),R=p[$l];try{p[$l]=e;var $=!0}catch{}var H=Nc.call(p);return $&&(C?p[$l]=R:delete p[$l]),H}var Xv=Ev?function(p){return p==null?[]:(p=Nr(p),e4(Ev(p),function(C){return QA.call(p,C)}))}:hy,zS=Ev?function(p){for(var C=[];p;)t4(C,Xv(p)),p=Fc(p);return C}:hy,vi=Ii;(Av&&vi(new Av(new ArrayBuffer(1)))!=Qe||M6&&vi(new M6)!=re||Sv&&vi(Sv.resolve())!=we||b0&&vi(new b0)!=le||T6&&vi(new T6)!=Te)&&(vi=function(p){var C=Ii(p),R=C==ye?p.constructor:e,$=R?Yl(R):"";if($)switch($){case zQ:return Qe;case qQ:return re;case VQ:return we;case $Q:return le;case GQ:return Te}return C});function aj(p,C,R){for(var $=-1,H=R.length;++$<H;){var X=R[$],ee=X.size;switch(X.type){case"drop":p+=ee;break;case"dropRight":C-=ee;break;case"take":C=gi(C,p+ee);break;case"takeRight":p=Rn(p,C-ee);break}}return{start:p,end:C}}function oj(p){var C=p.match(bc);return C?C[1].split(wc):[]}function qS(p,C,R){C=s4(C,p);for(var $=-1,H=C.length,X=!1;++$<H;){var ee=h1(C[$]);if(!(X=p!=null&&R(p,ee)))break;p=p[ee]}return X||++$!=H?X:(H=p==null?0:p.length,!!H&&lf(H)&&us(ee,H)&&(Ct(p)||Kl(p)))}function sj(p){var C=p.length,R=new p.constructor(C);return C&&typeof p[0]=="string"&&Sr.call(p,"index")&&(R.index=p.index,R.input=p.input),R}function VS(p){return typeof p.constructor=="function"&&!B6(p)?x0(Fc(p)):{}}function lj(p,C,R){var $=p.constructor;switch(C){case Ve:return Gv(p);case oe:case Ce:return new $(+p);case Qe:return WH(p,R);case ct:case rt:case We:case Rt:case lt:case vt:case _t:case wr:case tn:return ES(p,R);case re:return new $;case Z:case ie:return new $(p);case Be:return QH(p);case le:return new $;case ve:return HH(p)}}function uj(p,C){var R=C.length;if(!R)return p;var $=R-1;return C[$]=(R>1?"& ":"")+C[$],C=C.join(R>2?", ":" "),p.replace(yc,`{
1
+ var DZ=Object.create;var ff=Object.defineProperty;var PZ=Object.getOwnPropertyDescriptor;var FZ=Object.getOwnPropertyNames;var OZ=Object.getPrototypeOf,RZ=Object.prototype.hasOwnProperty;var LZ=(e,t,r)=>t in e?ff(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var DC=e=>t=>{var r=e[t];if(r)return r();throw new Error("Module not found in bundle: "+t)};var q=(e,t)=>()=>(e&&(t=e(e=0)),t);var an=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),j=(e,t)=>{for(var r in t)ff(e,r,{get:t[r],enumerable:!0})},UZ=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of FZ(t))!RZ.call(e,i)&&i!==r&&ff(e,i,{get:()=>t[i],enumerable:!(n=PZ(t,i))||n.enumerable});return e};var or=(e,t,r)=>(r=e!=null?DZ(OZ(e)):{},UZ(t||!e||!e.__esModule?ff(r,"default",{value:e,enumerable:!0}):r,e));var Ge=(e,t,r)=>LZ(e,typeof t!="symbol"?t+"":t,r);var PC={};j(PC,{actionAddEntity:()=>In});function In(e){return function(t){return t.replace(e)}}var Xl=q(()=>{"use strict"});var FC={};j(FC,{actionReverse:()=>Ji});function Ji(e,t){var r=/^([+\-]?)(?=[\d.])/,n=/direction$/,i=[[/:right$/,":left"],[/:left$/,":right"],[/:forward$/,":backward"],[/:backward$/,":forward"],[/:right:/,":left:"],[/:left:/,":right:"],[/:forward:/,":backward:"],[/:backward:/,":forward:"]],a={left:"right",right:"left",up:"down",down:"up",forward:"backward",backward:"forward",forwards:"backward",backwards:"forward"};let o=[/^red_turn:(right|left):?/],s=[{keyRegex:/^.*(_|:)?(description|name|note|website|ref|source|comment|watch|attribution)(_|:)?/,prerequisiteTags:[{}]},{keyRegex:/^turn:lanes:?/,prerequisiteTags:[{}]},{keyRegex:/^side$/,prerequisiteTags:[{highway:"cyclist_waiting_aid"}]}];var l={forward:"backward",backward:"forward",forwards:"backward",backwards:"forward"},u={yes:"-1",1:"-1","-1":"yes"},c={N:"S",NNE:"SSW",NE:"SW",ENE:"WSW",E:"W",ESE:"WNW",SE:"NW",SSE:"NNW",S:"N",SSW:"NNE",SW:"NE",WSW:"ENE",W:"E",WNW:"ESE",NW:"SE",NNW:"SSE"};function f(A){if(o.some(w=>w.test(A)))return A;for(var v=0;v<i.length;++v){var _=i[v];if(_[0].test(A))return A.replace(_[0],_[1])}return A}function d(A,v,_,w){for(let{keyRegex:k,prerequisiteTags:x}of s)if(k.test(A)&&x.some(S=>Object.entries(S).every(([I,b])=>w[I]&&(b==="*"||w[I]===b))))return v;return A==="incline"&&r.test(v)?v.replace(r,function(k,x){return x==="-"?"":"-"}):t&&t.reverseOneway&&A==="oneway"?u[v]||v:_&&n.test(A)?v.split(";").map(k=>{if(c[k])return c[k];var x=Number(k);return isFinite(x)?(x<180?x+=180:x-=180,x.toString()):a[k]||k}).join(";"):a[v]||v}function m(A,v){for(var _=0;_<v.length;_++){var w=A.hasEntity(v[_]);if(!(!w||!Object.keys(w.tags).length)){var k={};for(var x in w.tags)k[f(x)]=d(x,w.tags[x],w.id===e,w.tags);A=A.replace(w.update({tags:k}))}}return A}function h(A,v){var _=v.nodes.slice().reverse(),w={},k;for(var x in v.tags)w[f(x)]=d(x,v.tags[x],!1,v.tags);return A.parentRelations(v).forEach(function(S){S.members.forEach(function(I,b){I.id===v.id&&(k=l[I.role])&&(S=S.updateMember({role:k},b),A=A.replace(S))})}),m(A,_).replace(v.update({nodes:_,tags:w}))}var g=function(A){var v=A.entity(e);return v.type==="way"?h(A,v):m(A,[e])};return g.disabled=function(A){var v=A.hasEntity(e);if(!v||v.type==="way")return!1;for(var _ in v.tags){var w=v.tags[_];if(f(_)!==_||d(_,w,!0,v.tags)!==w)return!1}return"nondirectional_node"},g.entityID=function(){return e},g}var c4=q(()=>{"use strict"});function Ni(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}var V6=q(()=>{});function f4(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}var vy=q(()=>{});function Zl(e){let t,r,n;e.length!==2?(t=Ni,r=(s,l)=>Ni(e(s),l),n=(s,l)=>e(s)-l):(t=e===Ni||e===f4?e:BZ,r=e,n=e);function i(s,l,u=0,c=s.length){if(u<c){if(t(l,l)!==0)return c;do{let f=u+c>>>1;r(s[f],l)<0?u=f+1:c=f}while(u<c)}return u}function a(s,l,u=0,c=s.length){if(u<c){if(t(l,l)!==0)return c;do{let f=u+c>>>1;r(s[f],l)<=0?u=f+1:c=f}while(u<c)}return u}function o(s,l,u=0,c=s.length){let f=i(s,l,u,c-1);return f>u&&n(s[f-1],l)>-n(s[f],l)?f-1:f}return{left:i,center:o,right:a}}function BZ(){return 0}var yy=q(()=>{V6();vy()});function df(e){return e===null?NaN:+e}function*OC(e,t){if(t===void 0)for(let r of e)r!=null&&(r=+r)>=r&&(yield r);else{let r=-1;for(let n of e)(n=t(n,++r,e))!=null&&(n=+n)>=n&&(yield n)}}var by=q(()=>{});var RC,LC,zZ,qZ,$6,UC=q(()=>{V6();yy();by();RC=Zl(Ni),LC=RC.right,zZ=RC.left,qZ=Zl(df).center,$6=LC});var on,BC=q(()=>{on=class{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){let r=this._partials,n=0;for(let i=0;i<this._n&&i<32;i++){let a=r[i],o=t+a,s=Math.abs(t)<Math.abs(a)?t-(o-a):a-(o-t);s&&(r[n++]=s),t=o}return r[n]=t,this._n=n+1,this}valueOf(){let t=this._partials,r=this._n,n,i,a,o=0;if(r>0){for(o=t[--r];r>0&&(n=o,i=t[--r],o=n+i,a=i-(o-n),!a););r>0&&(a<0&&t[r-1]<0||a>0&&t[r-1]>0)&&(i=a*2,n=o+i,i==n-o&&(o=n))}return o}}});function zC(e=Ni){if(e===Ni)return wy;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{let n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function wy(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var qC=q(()=>{V6()});function pf(e,t,r){let n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=VZ?10:a>=$Z?5:a>=GZ?2:1,s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(e*u),l=Math.round(t*u),s/u<e&&++s,l/u>t&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(e/u),l=Math.round(t/u),s*u<e&&++s,l*u>t&&--l),l<s&&.5<=r&&r<2?pf(e,t,r*2):[s,l,u]}function mf(e,t,r){if(t=+t,e=+e,r=+r,!(r>0))return[];if(e===t)return[e];let n=t<e,[i,a,o]=n?pf(t,e,r):pf(e,t,r);if(!(a>=i))return[];let s=a-i+1,l=new Array(s);if(n)if(o<0)for(let u=0;u<s;++u)l[u]=(a-u)/-o;else for(let u=0;u<s;++u)l[u]=(a-u)*o;else if(o<0)for(let u=0;u<s;++u)l[u]=(i+u)/-o;else for(let u=0;u<s;++u)l[u]=(i+u)*o;return l}function G6(e,t,r){return t=+t,e=+e,r=+r,pf(e,t,r)[2]}function xy(e,t,r){t=+t,e=+e,r=+r;let n=t<e,i=n?G6(t,e,r):G6(e,t,r);return(n?-1:1)*(i<0?1/-i:i)}var VZ,$Z,GZ,VC=q(()=>{VZ=Math.sqrt(50),$Z=Math.sqrt(10),GZ=Math.sqrt(2)});function hf(e,t){let r;if(t===void 0)for(let n of e)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}return r}var $C=q(()=>{});function gf(e,t){let r;if(t===void 0)for(let n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);else{let n=-1;for(let i of e)(i=t(i,++n,e))!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}return r}var GC=q(()=>{});function vf(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?wy:zC(i);n>r;){if(n-r>600){let l=n-r+1,u=t-r+1,c=Math.log(l),f=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*f*(l-f)/l)*(u-l/2<0?-1:1),m=Math.max(r,Math.floor(t-u*f/l+d)),h=Math.min(n,Math.floor(t+(l-u)*f/l+d));vf(e,t,m,h,i)}let a=e[t],o=r,s=n;for(W6(e,r,t),i(e[n],a)>0&&W6(e,r,n);o<s;){for(W6(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[r],a)===0?W6(e,r,s):(++s,W6(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function W6(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}var WC=q(()=>{qC()});function _y(e,t,r){if(e=Float64Array.from(OC(e,r)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return gf(e);if(t>=1)return hf(e);var n,i=(n-1)*t,a=Math.floor(i),o=hf(vf(e,a).subarray(0,a+1)),s=gf(e.subarray(a+1));return o+(s-o)*(i-a)}}var QC=q(()=>{$C();GC();WC();by()});function yf(e,t){return _y(e,.5,t)}var HC=q(()=>{QC()});function*WZ(e){for(let t of e)yield*t}function C0(e){return Array.from(WZ(e))}var jC=q(()=>{});function bf(e,t=QZ){let r=[],n,i=!1;for(let a of e)i&&r.push(t(n,a)),n=a,i=!0;return r}function QZ(e,t){return[e,t]}var YC=q(()=>{});function d4(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n<i;)a[n]=e+n*r;return a}var KC=q(()=>{});var bn=q(()=>{UC();V6();yy();vy();BC();HC();jC();YC();KC();VC()});function rI(e){return e>1?0:e<-1?Gt:Math.acos(e)}function ps(e){return e>1?Wn:e<-1?-Wn:Math.asin(e)}var $t,XC,Gt,Wn,I0,wn,sn,Ut,Zt,wf,Ca,Wt,ZC,JC,Jt,eI,Di,tI,ln=q(()=>{$t=1e-6,XC=1e-12,Gt=Math.PI,Wn=Gt/2,I0=Gt/4,wn=Gt*2,sn=180/Gt,Ut=Gt/180,Zt=Math.abs,wf=Math.atan,Ca=Math.atan2,Wt=Math.cos,ZC=Math.exp,JC=Math.log,Jt=Math.sin,eI=Math.sign||function(e){return e>0?1:e<0?-1:0},Di=Math.sqrt,tI=Math.tan});function _r(){}var p4=q(()=>{});function xf(e,t){e&&iI.hasOwnProperty(e.type)&&iI[e.type](e,t)}function ky(e,t,r){var n=-1,i=e.length-r,a;for(t.lineStart();++n<i;)a=e[n],t.point(a[0],a[1],a[2]);t.lineEnd()}function aI(e,t){var r=-1,n=e.length;for(t.polygonStart();++r<n;)ky(e[r],t,1);t.polygonEnd()}function ai(e,t){e&&nI.hasOwnProperty(e.type)?nI[e.type](e,t):xf(e,t)}var nI,iI,Jl=q(()=>{nI={Feature:function(e,t){xf(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,n=-1,i=r.length;++n<i;)xf(r[n].geometry,t)}},iI={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)e=r[n],t.point(e[0],e[1],e[2])},LineString:function(e,t){ky(e.coordinates,t,0)},MultiLineString:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)ky(r[n],t,0)},Polygon:function(e,t){aI(e.coordinates,t)},MultiPolygon:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)aI(r[n],t)},GeometryCollection:function(e,t){for(var r=e.geometries,n=-1,i=r.length;++n<i;)xf(r[n],t)}}});function HZ(){Bo.point=YZ}function jZ(){lI(oI,sI)}function YZ(e,t){Bo.point=lI,oI=e,sI=t,e*=Ut,t*=Ut,Ey=e,Ay=Wt(t=t/2+I0),Sy=Jt(t)}function lI(e,t){e*=Ut,t*=Ut,t=t/2+I0;var r=e-Ey,n=r>=0?1:-1,i=n*r,a=Wt(t),o=Jt(t),s=Sy*o,l=Ay*a+s*Wt(i),u=s*n*Jt(i);Q6.add(Ca(u,l)),Ey=e,Ay=a,Sy=o}function g1(e){return _f=new on,ai(e,Bo),_f*2}var Q6,_f,oI,sI,Ey,Ay,Sy,Bo,Cy=q(()=>{bn();ln();p4();Jl();Q6=new on,_f=new on,Bo={point:_r,lineStart:_r,lineEnd:_r,polygonStart:function(){Q6=new on,Bo.lineStart=HZ,Bo.lineEnd=jZ},polygonEnd:function(){var e=+Q6;_f.add(e<0?wn+e:e),this.lineStart=this.lineEnd=this.point=_r},sphere:function(){_f.add(wn)}}});function e2(e){return[Ca(e[1],e[0]),ps(e[2])]}function ro(e){var t=e[0],r=e[1],n=Wt(r);return[n*Wt(t),n*Jt(t),Jt(r)]}function H6(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function ms(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function kf(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function j6(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function t2(e){var t=Di(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var M0=q(()=>{ln()});function Iy(e,t){m4.push(gs=[jr=e,un=e]),t<ea&&(ea=t),t>Ma&&(Ma=t)}function mI(e,t){var r=ro([e*Ut,t*Ut]);if(T0){var n=ms(T0,r),i=[n[1],-n[0],0],a=ms(i,n);t2(a),a=e2(a);var o=e-r2,s=o>0?1:-1,l=a[0]*sn*s,u,c=Zt(o)>180;c^(s*r2<l&&l<s*e)?(u=a[1]*sn,u>Ma&&(Ma=u)):(l=(l+360)%360-180,c^(s*r2<l&&l<s*e)?(u=-a[1]*sn,u<ea&&(ea=u)):(t<ea&&(ea=t),t>Ma&&(Ma=t))),c?e<r2?Ia(jr,e)>Ia(jr,un)&&(un=e):Ia(e,un)>Ia(jr,un)&&(jr=e):un>=jr?(e<jr&&(jr=e),e>un&&(un=e)):e>r2?Ia(jr,e)>Ia(jr,un)&&(un=e):Ia(e,un)>Ia(jr,un)&&(jr=e)}else m4.push(gs=[jr=e,un=e]);t<ea&&(ea=t),t>Ma&&(Ma=t),T0=r,r2=e}function uI(){hs.point=mI}function cI(){gs[0]=jr,gs[1]=un,hs.point=Iy,T0=null}function hI(e,t){if(T0){var r=e-r2;Y6.add(Zt(r)>180?r+(r>0?360:-360):r)}else dI=e,pI=t;Bo.point(e,t),mI(e,t)}function KZ(){Bo.lineStart()}function XZ(){hI(dI,pI),Bo.lineEnd(),Zt(Y6)>$t&&(jr=-(un=180)),gs[0]=jr,gs[1]=un,T0=null}function Ia(e,t){return(t-=e)<0?t+360:t}function ZZ(e,t){return e[0]-t[0]}function fI(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}function N0(e){var t,r,n,i,a,o,s;if(Ma=un=-(jr=ea=1/0),m4=[],ai(e,hs),r=m4.length){for(m4.sort(ZZ),t=1,n=m4[0],a=[n];t<r;++t)i=m4[t],fI(n,i[0])||fI(n,i[1])?(Ia(n[0],i[1])>Ia(n[0],n[1])&&(n[1]=i[1]),Ia(i[0],n[1])>Ia(n[0],n[1])&&(n[0]=i[0])):a.push(n=i);for(o=-1/0,r=a.length-1,t=0,n=a[r];t<=r;n=i,++t)i=a[t],(s=Ia(n[1],i[0]))>o&&(o=s,jr=i[0],un=n[1])}return m4=gs=null,jr===1/0||ea===1/0?[[NaN,NaN],[NaN,NaN]]:[[jr,ea],[un,Ma]]}var jr,ea,un,Ma,r2,dI,pI,T0,Y6,m4,gs,hs,gI=q(()=>{bn();Cy();M0();ln();Jl();hs={point:Iy,lineStart:uI,lineEnd:cI,polygonStart:function(){hs.point=hI,hs.lineStart=KZ,hs.lineEnd=XZ,Y6=new on,Bo.polygonStart()},polygonEnd:function(){Bo.polygonEnd(),hs.point=Iy,hs.lineStart=uI,hs.lineEnd=cI,Q6<0?(jr=-(un=180),ea=-(Ma=90)):Y6>$t?Ma=90:Y6<-$t&&(ea=-90),gs[0]=jr,gs[1]=un},sphere:function(){jr=-(un=180),ea=-(Ma=90)}}});function K6(e,t){function r(n,i){return n=e(n,i),t(n[0],n[1])}return e.invert&&t.invert&&(r.invert=function(n,i){return n=t.invert(n,i),n&&e.invert(n[0],n[1])}),r}var My=q(()=>{});function Ty(e,t){return Zt(e)>Gt&&(e-=Math.round(e/wn)*wn),[e,t]}function Ny(e,t,r){return(e%=wn)?t||r?K6(yI(e),bI(t,r)):yI(e):t||r?bI(t,r):Ty}function vI(e){return function(t,r){return t+=e,Zt(t)>Gt&&(t-=Math.round(t/wn)*wn),[t,r]}}function yI(e){var t=vI(e);return t.invert=vI(-e),t}function bI(e,t){var r=Wt(e),n=Jt(e),i=Wt(t),a=Jt(t);function o(s,l){var u=Wt(l),c=Wt(s)*u,f=Jt(s)*u,d=Jt(l),m=d*r+c*n;return[Ca(f*i-m*a,c*r-d*n),ps(m*i+f*a)]}return o.invert=function(s,l){var u=Wt(l),c=Wt(s)*u,f=Jt(s)*u,d=Jt(l),m=d*i-f*a;return[Ca(f*i+d*a,c*r+m*n),ps(m*r-c*n)]},o}function wI(e){e=Ny(e[0]*Ut,e[1]*Ut,e.length>2?e[2]*Ut:0);function t(r){return r=e(r[0]*Ut,r[1]*Ut),r[0]*=sn,r[1]*=sn,r}return t.invert=function(r){return r=e.invert(r[0]*Ut,r[1]*Ut),r[0]*=sn,r[1]*=sn,r},t}var Dy=q(()=>{My();ln();Ty.invert=Ty});function _I(e,t,r,n,i,a){if(r){var o=Wt(t),s=Jt(t),l=n*r;i==null?(i=t+n*wn,a=t-l/2):(i=xI(o,i),a=xI(o,a),(n>0?i<a:i>a)&&(i+=n*wn));for(var u,c=i;n>0?c>a:c<a;c-=l)u=e2([o,-s*Wt(c),-s*Jt(c)]),e.point(u[0],u[1])}}function xI(e,t){t=ro(t),t[0]-=e,t2(t);var r=rI(-t[1]);return((-t[2]<0?-r:r)+wn-$t)%wn}var kI=q(()=>{M0();ln()});function Ef(){var e=[],t;return{point:function(r,n,i){t.push([r,n,i])},lineStart:function(){e.push(t=[])},lineEnd:_r,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var r=e;return e=[],t=null,r}}}var Py=q(()=>{p4()});function D0(e,t){return Zt(e[0]-t[0])<$t&&Zt(e[1]-t[1])<$t}var Fy=q(()=>{ln()});function Af(e,t,r,n){this.x=e,this.z=t,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function Sf(e,t,r,n,i){var a=[],o=[],s,l;if(e.forEach(function(h){if(!((g=h.length-1)<=0)){var g,A=h[0],v=h[g],_;if(D0(A,v)){if(!A[2]&&!v[2]){for(i.lineStart(),s=0;s<g;++s)i.point((A=h[s])[0],A[1]);i.lineEnd();return}v[0]+=2*$t}a.push(_=new Af(A,h,null,!0)),o.push(_.o=new Af(A,null,_,!1)),a.push(_=new Af(v,h,null,!1)),o.push(_.o=new Af(v,null,_,!0))}}),!!a.length){for(o.sort(t),EI(a),EI(o),s=0,l=o.length;s<l;++s)o[s].e=r=!r;for(var u=a[0],c,f;;){for(var d=u,m=!0;d.v;)if((d=d.n)===u)return;c=d.z,i.lineStart();do{if(d.v=d.o.v=!0,d.e){if(m)for(s=0,l=c.length;s<l;++s)i.point((f=c[s])[0],f[1]);else n(d.x,d.n.x,1,i);d=d.n}else{if(m)for(c=d.p.z,s=c.length-1;s>=0;--s)i.point((f=c[s])[0],f[1]);else n(d.x,d.p.x,-1,i);d=d.p}d=d.o,c=d.z,m=!m}while(!d.v);i.lineEnd()}}}function EI(e){if(t=e.length){for(var t,r=0,n=e[0],i;++r<t;)n.n=i=e[r],i.p=n,n=i;n.n=i=e[0],i.p=n}}var Oy=q(()=>{Fy();ln()});function Ry(e){return Zt(e[0])<=Gt?e[0]:eI(e[0])*((Zt(e[0])+Gt)%wn-Gt)}function AI(e,t){var r=Ry(t),n=t[1],i=Jt(n),a=[Jt(r),-Wt(r),0],o=0,s=0,l=new on;i===1?n=Wn+$t:i===-1&&(n=-Wn-$t);for(var u=0,c=e.length;u<c;++u)if(d=(f=e[u]).length)for(var f,d,m=f[d-1],h=Ry(m),g=m[1]/2+I0,A=Jt(g),v=Wt(g),_=0;_<d;++_,h=k,A=S,v=I,m=w){var w=f[_],k=Ry(w),x=w[1]/2+I0,S=Jt(x),I=Wt(x),b=k-h,y=b>=0?1:-1,E=y*b,M=E>Gt,F=A*S;if(l.add(Ca(F*y*Jt(E),v*I+F*Wt(E))),o+=M?b+y*wn:b,M^h>=r^k>=r){var N=ms(ro(m),ro(w));t2(N);var D=ms(a,N);t2(D);var O=(M^b>=0?-1:1)*ps(D[2]);(n>O||n===O&&(N[0]||N[1]))&&(s+=M^b>=0?1:-1)}}return(o<-$t||o<$t&&l<-XC)^s&1}var SI=q(()=>{bn();M0();ln()});function Cf(e,t,r,n){return function(i){var a=t(i),o=Ef(),s=t(o),l=!1,u,c,f,d={point:m,lineStart:g,lineEnd:A,polygonStart:function(){d.point=v,d.lineStart=_,d.lineEnd=w,c=[],u=[]},polygonEnd:function(){d.point=m,d.lineStart=g,d.lineEnd=A,c=C0(c);var k=AI(u,n);c.length?(l||(i.polygonStart(),l=!0),Sf(c,eJ,k,r,i)):k&&(l||(i.polygonStart(),l=!0),i.lineStart(),r(null,null,1,i),i.lineEnd()),l&&(i.polygonEnd(),l=!1),c=u=null},sphere:function(){i.polygonStart(),i.lineStart(),r(null,null,1,i),i.lineEnd(),i.polygonEnd()}};function m(k,x){e(k,x)&&i.point(k,x)}function h(k,x){a.point(k,x)}function g(){d.point=h,a.lineStart()}function A(){d.point=m,a.lineEnd()}function v(k,x){f.push([k,x]),s.point(k,x)}function _(){s.lineStart(),f=[]}function w(){v(f[0][0],f[0][1]),s.lineEnd();var k=s.clean(),x=o.result(),S,I=x.length,b,y,E;if(f.pop(),u.push(f),f=null,!!I){if(k&1){if(y=x[0],(b=y.length-1)>0){for(l||(i.polygonStart(),l=!0),i.lineStart(),S=0;S<b;++S)i.point((E=y[S])[0],E[1]);i.lineEnd()}return}I>1&&k&2&&x.push(x.pop().concat(x.shift())),c.push(x.filter(JZ))}}return d}}function JZ(e){return e.length>1}function eJ(e,t){return((e=e.x)[0]<0?e[1]-Wn-$t:Wn-e[1])-((t=t.x)[0]<0?t[1]-Wn-$t:Wn-t[1])}var Ly=q(()=>{Py();Oy();ln();SI();bn()});function tJ(e){var t=NaN,r=NaN,n=NaN,i;return{lineStart:function(){e.lineStart(),i=1},point:function(a,o){var s=a>0?Gt:-Gt,l=Zt(a-t);Zt(l-Gt)<$t?(e.point(t,r=(r+o)/2>0?Wn:-Wn),e.point(n,r),e.lineEnd(),e.lineStart(),e.point(s,r),e.point(a,r),i=0):n!==s&&l>=Gt&&(Zt(t-n)<$t&&(t-=n*$t),Zt(a-s)<$t&&(a-=s*$t),r=rJ(t,r,a,o),e.point(n,r),e.lineEnd(),e.lineStart(),e.point(s,r),i=0),e.point(t=a,r=o),n=s},lineEnd:function(){e.lineEnd(),t=r=NaN},clean:function(){return 2-i}}}function rJ(e,t,r,n){var i,a,o=Jt(e-r);return Zt(o)>$t?wf((Jt(t)*(a=Wt(n))*Jt(r)-Jt(n)*(i=Wt(t))*Jt(e))/(i*a*o)):(t+n)/2}function nJ(e,t,r,n){var i;if(e==null)i=r*Wn,n.point(-Gt,i),n.point(0,i),n.point(Gt,i),n.point(Gt,0),n.point(Gt,-i),n.point(0,-i),n.point(-Gt,-i),n.point(-Gt,0),n.point(-Gt,i);else if(Zt(e[0]-t[0])>$t){var a=e[0]<t[0]?Gt:-Gt;i=r*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(t[0],t[1])}var Uy,CI=q(()=>{Ly();ln();Uy=Cf(function(){return!0},tJ,nJ,[-Gt,-Wn])});function II(e){var t=Wt(e),r=2*Ut,n=t>0,i=Zt(t)>$t;function a(c,f,d,m){_I(m,e,r,d,c,f)}function o(c,f){return Wt(c)*Wt(f)>t}function s(c){var f,d,m,h,g;return{lineStart:function(){h=m=!1,g=1},point:function(A,v){var _=[A,v],w,k=o(A,v),x=n?k?0:u(A,v):k?u(A+(A<0?Gt:-Gt),v):0;if(!f&&(h=m=k)&&c.lineStart(),k!==m&&(w=l(f,_),(!w||D0(f,w)||D0(_,w))&&(_[2]=1)),k!==m)g=0,k?(c.lineStart(),w=l(_,f),c.point(w[0],w[1])):(w=l(f,_),c.point(w[0],w[1],2),c.lineEnd()),f=w;else if(i&&f&&n^k){var S;!(x&d)&&(S=l(_,f,!0))&&(g=0,n?(c.lineStart(),c.point(S[0][0],S[0][1]),c.point(S[1][0],S[1][1]),c.lineEnd()):(c.point(S[1][0],S[1][1]),c.lineEnd(),c.lineStart(),c.point(S[0][0],S[0][1],3)))}k&&(!f||!D0(f,_))&&c.point(_[0],_[1]),f=_,m=k,d=x},lineEnd:function(){m&&c.lineEnd(),f=null},clean:function(){return g|(h&&m)<<1}}}function l(c,f,d){var m=ro(c),h=ro(f),g=[1,0,0],A=ms(m,h),v=H6(A,A),_=A[0],w=v-_*_;if(!w)return!d&&c;var k=t*v/w,x=-t*_/w,S=ms(g,A),I=j6(g,k),b=j6(A,x);kf(I,b);var y=S,E=H6(I,y),M=H6(y,y),F=E*E-M*(H6(I,I)-1);if(!(F<0)){var N=Di(F),D=j6(y,(-E-N)/M);if(kf(D,I),D=e2(D),!d)return D;var O=c[0],L=f[0],P=c[1],U=f[1],B;L<O&&(B=O,O=L,L=B);var z=L-O,V=Zt(z-Gt)<$t,G=V||z<$t;if(!V&&U<P&&(B=P,P=U,U=B),G?V?P+U>0^D[1]<(Zt(D[0]-O)<$t?P:U):P<=D[1]&&D[1]<=U:z>Gt^(O<=D[0]&&D[0]<=L)){var W=j6(y,(-E+N)/M);return kf(W,I),[D,e2(W)]}}}function u(c,f){var d=n?e:Gt-e,m=0;return c<-d?m|=1:c>d&&(m|=2),f<-d?m|=4:f>d&&(m|=8),m}return Cf(o,s,a,n?[0,-e]:[-Gt,e-Gt])}var MI=q(()=>{M0();kI();ln();Fy();Ly()});function TI(e,t,r,n,i,a){var o=e[0],s=e[1],l=t[0],u=t[1],c=0,f=1,d=l-o,m=u-s,h;if(h=r-o,!(!d&&h>0)){if(h/=d,d<0){if(h<c)return;h<f&&(f=h)}else if(d>0){if(h>f)return;h>c&&(c=h)}if(h=i-o,!(!d&&h<0)){if(h/=d,d<0){if(h>f)return;h>c&&(c=h)}else if(d>0){if(h<c)return;h<f&&(f=h)}if(h=n-s,!(!m&&h>0)){if(h/=m,m<0){if(h<c)return;h<f&&(f=h)}else if(m>0){if(h>f)return;h>c&&(c=h)}if(h=a-s,!(!m&&h<0)){if(h/=m,m<0){if(h>f)return;h>c&&(c=h)}else if(m>0){if(h<c)return;h<f&&(f=h)}return c>0&&(e[0]=o+c*d,e[1]=s+c*m),f<1&&(t[0]=o+f*d,t[1]=s+f*m),!0}}}}}var NI=q(()=>{});function Z6(e,t,r,n){function i(u,c){return e<=u&&u<=r&&t<=c&&c<=n}function a(u,c,f,d){var m=0,h=0;if(u==null||(m=o(u,f))!==(h=o(c,f))||l(u,c)<0^f>0)do d.point(m===0||m===3?e:r,m>1?n:t);while((m=(m+f+4)%4)!==h);else d.point(c[0],c[1])}function o(u,c){return Zt(u[0]-e)<$t?c>0?0:3:Zt(u[0]-r)<$t?c>0?2:1:Zt(u[1]-t)<$t?c>0?1:0:c>0?3:2}function s(u,c){return l(u.x,c.x)}function l(u,c){var f=o(u,1),d=o(c,1);return f!==d?f-d:f===0?c[1]-u[1]:f===1?u[0]-c[0]:f===2?u[1]-c[1]:c[0]-u[0]}return function(u){var c=u,f=Ef(),d,m,h,g,A,v,_,w,k,x,S,I={point:b,lineStart:F,lineEnd:N,polygonStart:E,polygonEnd:M};function b(O,L){i(O,L)&&c.point(O,L)}function y(){for(var O=0,L=0,P=m.length;L<P;++L)for(var U=m[L],B=1,z=U.length,V=U[0],G,W,Y=V[0],J=V[1];B<z;++B)G=Y,W=J,V=U[B],Y=V[0],J=V[1],W<=n?J>n&&(Y-G)*(n-W)>(J-W)*(e-G)&&++O:J<=n&&(Y-G)*(n-W)<(J-W)*(e-G)&&--O;return O}function E(){c=f,d=[],m=[],S=!0}function M(){var O=y(),L=S&&O,P=(d=C0(d)).length;(L||P)&&(u.polygonStart(),L&&(u.lineStart(),a(null,null,1,u),u.lineEnd()),P&&Sf(d,s,O,a,u),u.polygonEnd()),c=u,d=m=h=null}function F(){I.point=D,m&&m.push(h=[]),x=!0,k=!1,_=w=NaN}function N(){d&&(D(g,A),v&&k&&f.rejoin(),d.push(f.result())),I.point=b,k&&c.lineEnd()}function D(O,L){var P=i(O,L);if(m&&h.push([O,L]),x)g=O,A=L,v=P,x=!1,P&&(c.lineStart(),c.point(O,L));else if(P&&k)c.point(O,L);else{var U=[_=Math.max(If,Math.min(X6,_)),w=Math.max(If,Math.min(X6,w))],B=[O=Math.max(If,Math.min(X6,O)),L=Math.max(If,Math.min(X6,L))];TI(U,B,e,t,r,n)?(k||(c.lineStart(),c.point(U[0],U[1])),c.point(B[0],B[1]),P||c.lineEnd(),S=!1):P&&(c.lineStart(),c.point(O,L),S=!1)}_=O,w=L,k=P}return I}}var X6,If,By=q(()=>{ln();Py();NI();Oy();bn();X6=1e9,If=-X6});function iJ(){P0.point=oJ,P0.lineEnd=aJ}function aJ(){P0.point=P0.lineEnd=_r}function oJ(e,t){e*=Ut,t*=Ut,qy=e,Mf=Jt(t),Tf=Wt(t),P0.point=sJ}function sJ(e,t){e*=Ut,t*=Ut;var r=Jt(t),n=Wt(t),i=Zt(e-qy),a=Wt(i),o=Jt(i),s=n*o,l=Tf*r-Mf*n*a,u=Mf*r+Tf*n*a;zy.add(Ca(Di(s*s+l*l),u)),qy=e,Mf=r,Tf=n}function Vy(e){return zy=new on,ai(e,P0),+zy}var zy,qy,Mf,Tf,P0,DI=q(()=>{bn();ln();p4();Jl();P0={sphere:_r,point:_r,lineStart:iJ,lineEnd:_r,polygonStart:_r,polygonEnd:_r}});var h4,Nf=q(()=>{h4=e=>e});function lJ(){g4.point=uJ}function uJ(e,t){g4.point=OI,PI=Wy=e,FI=Qy=t}function OI(e,t){Gy.add(Qy*e-Wy*t),Wy=e,Qy=t}function cJ(){OI(PI,FI)}var $y,Gy,PI,FI,Wy,Qy,g4,Hy,RI=q(()=>{bn();ln();p4();$y=new on,Gy=new on,g4={point:_r,lineStart:_r,lineEnd:_r,polygonStart:function(){g4.lineStart=lJ,g4.lineEnd=cJ},polygonEnd:function(){g4.lineStart=g4.lineEnd=g4.point=_r,$y.add(Zt(Gy)),Gy=new on},result:function(){var e=$y/2;return $y=new on,e}};Hy=g4});function dJ(e,t){e<F0&&(F0=e),e>J6&&(J6=e),t<Df&&(Df=t),t>Pf&&(Pf=t)}var F0,Df,J6,Pf,fJ,O0,jy=q(()=>{p4();F0=1/0,Df=F0,J6=-F0,Pf=J6,fJ={point:dJ,lineStart:_r,lineEnd:_r,polygonStart:_r,polygonEnd:_r,result:function(){var e=[[F0,Df],[J6,Pf]];return J6=Pf=-(Df=F0=1/0),e}};O0=fJ});function n2(e,t){Yy+=e,Ky+=t,++e7}function LI(){zo.point=pJ}function pJ(e,t){zo.point=mJ,n2(v1=e,y1=t)}function mJ(e,t){var r=e-v1,n=t-y1,i=Di(r*r+n*n);Ff+=i*(v1+e)/2,Of+=i*(y1+t)/2,R0+=i,n2(v1=e,y1=t)}function UI(){zo.point=n2}function hJ(){zo.point=vJ}function gJ(){qI(BI,zI)}function vJ(e,t){zo.point=qI,n2(BI=v1=e,zI=y1=t)}function qI(e,t){var r=e-v1,n=t-y1,i=Di(r*r+n*n);Ff+=i*(v1+e)/2,Of+=i*(y1+t)/2,R0+=i,i=y1*e-v1*t,Xy+=i*(v1+e),Zy+=i*(y1+t),t7+=i*3,n2(v1=e,y1=t)}var Yy,Ky,e7,Ff,Of,R0,Xy,Zy,t7,BI,zI,v1,y1,zo,Jy,VI=q(()=>{ln();Yy=0,Ky=0,e7=0,Ff=0,Of=0,R0=0,Xy=0,Zy=0,t7=0,zo={point:n2,lineStart:LI,lineEnd:UI,polygonStart:function(){zo.lineStart=hJ,zo.lineEnd=gJ},polygonEnd:function(){zo.point=n2,zo.lineStart=LI,zo.lineEnd=UI},result:function(){var e=t7?[Xy/t7,Zy/t7]:R0?[Ff/R0,Of/R0]:e7?[Yy/e7,Ky/e7]:[NaN,NaN];return Yy=Ky=e7=Ff=Of=R0=Xy=Zy=t7=0,e}};Jy=zo});function Rf(e){this._context=e}var $I=q(()=>{ln();p4();Rf.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,wn);break}}},result:_r}});function yJ(e,t){Lf.point=QI,GI=r7=e,WI=n7=t}function QI(e,t){r7-=e,n7-=t,tb.add(Di(r7*r7+n7*n7)),r7=e,n7=t}var tb,eb,GI,WI,r7,n7,Lf,rb,HI=q(()=>{bn();ln();p4();tb=new on,Lf={point:_r,lineStart:function(){Lf.point=yJ},lineEnd:function(){eb&&QI(GI,WI),Lf.point=_r},polygonStart:function(){eb=!0},polygonEnd:function(){eb=null},result:function(){var e=+tb;return tb=new on,e}};rb=Lf});function XI(e){let t=1;this._+=e[0];for(let r=e.length;t<r;++t)this._+=arguments[t]+e[t]}function bJ(e){let t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return XI;if(t!==jI){let r=10**t;jI=t,Uf=function(i){let a=1;this._+=i[0];for(let o=i.length;a<o;++a)this._+=Math.round(arguments[a]*r)/r+i[a]}}return Uf}var jI,Uf,YI,KI,L0,ZI=q(()=>{L0=class{constructor(t){this._append=t==null?XI:bJ(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,r){switch(this._point){case 0:{this._append`M${t},${r}`,this._point=1;break}case 1:{this._append`L${t},${r}`;break}default:{if(this._append`M${t},${r}`,this._radius!==YI||this._append!==Uf){let n=this._radius,i=this._;this._="",this._append`m0,${n}a${n},${n} 0 1,1 0,${-2*n}a${n},${n} 0 1,1 0,${2*n}z`,YI=n,Uf=this._append,KI=this._,this._=i}this._+=KI;break}}}result(){let t=this._;return this._="",t.length?t:null}}});function Pi(e,t){let r=3,n=4.5,i,a;function o(s){return s&&(typeof n=="function"&&a.pointRadius(+n.apply(this,arguments)),ai(s,i(a))),a.result()}return o.area=function(s){return ai(s,i(Hy)),Hy.result()},o.measure=function(s){return ai(s,i(rb)),rb.result()},o.bounds=function(s){return ai(s,i(O0)),O0.result()},o.centroid=function(s){return ai(s,i(Jy)),Jy.result()},o.projection=function(s){return arguments.length?(i=s==null?(e=null,h4):(e=s).stream,o):e},o.context=function(s){return arguments.length?(a=s==null?(t=null,new L0(r)):new Rf(t=s),typeof n!="function"&&a.pointRadius(n),o):t},o.pointRadius=function(s){return arguments.length?(n=typeof s=="function"?s:(a.pointRadius(+s),+s),o):n},o.digits=function(s){if(!arguments.length)return r;if(s==null)r=null;else{let l=Math.floor(s);if(!(l>=0))throw new RangeError(`invalid digits: ${s}`);r=l}return t===null&&(a=new L0(r)),o},o.projection(e).digits(r).context(t)}var JI=q(()=>{Nf();Jl();RI();jy();VI();$I();HI();ZI()});function ib(e){return{stream:v4(e)}}function v4(e){return function(t){var r=new nb;for(var n in e)r[n]=e[n];return r.stream=t,r}}function nb(){}var i7=q(()=>{nb.prototype={constructor:nb,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}}});function ab(e,t,r){var n=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),n!=null&&e.clipExtent(null),ai(r,e.stream(O0)),t(O0.result()),n!=null&&e.clipExtent(n),e}function a7(e,t,r){return ab(e,function(n){var i=t[1][0]-t[0][0],a=t[1][1]-t[0][1],o=Math.min(i/(n[1][0]-n[0][0]),a/(n[1][1]-n[0][1])),s=+t[0][0]+(i-o*(n[1][0]+n[0][0]))/2,l=+t[0][1]+(a-o*(n[1][1]+n[0][1]))/2;e.scale(150*o).translate([s,l])},r)}function Bf(e,t,r){return a7(e,[[0,0],t],r)}function zf(e,t,r){return ab(e,function(n){var i=+t,a=i/(n[1][0]-n[0][0]),o=(i-a*(n[1][0]+n[0][0]))/2,s=-a*n[0][1];e.scale(150*a).translate([o,s])},r)}function qf(e,t,r){return ab(e,function(n){var i=+t,a=i/(n[1][1]-n[0][1]),o=-a*n[0][0],s=(i-a*(n[1][1]+n[0][1]))/2;e.scale(150*a).translate([o,s])},r)}var ob=q(()=>{Jl();jy()});function sb(e,t){return+t?_J(e,t):xJ(e)}function xJ(e){return v4({point:function(t,r){t=e(t,r),this.stream.point(t[0],t[1])}})}function _J(e,t){function r(n,i,a,o,s,l,u,c,f,d,m,h,g,A){var v=u-n,_=c-i,w=v*v+_*_;if(w>4*t&&g--){var k=o+d,x=s+m,S=l+h,I=Di(k*k+x*x+S*S),b=ps(S/=I),y=Zt(Zt(S)-1)<$t||Zt(a-f)<$t?(a+f)/2:Ca(x,k),E=e(y,b),M=E[0],F=E[1],N=M-n,D=F-i,O=_*N-v*D;(O*O/w>t||Zt((v*N+_*D)/w-.5)>.3||o*d+s*m+l*h<wJ)&&(r(n,i,a,o,s,l,M,F,y,k/=I,x/=I,S,g,A),A.point(M,F),r(M,F,y,k,x,S,u,c,f,d,m,h,g,A))}}return function(n){var i,a,o,s,l,u,c,f,d,m,h,g,A={point:v,lineStart:_,lineEnd:k,polygonStart:function(){n.polygonStart(),A.lineStart=x},polygonEnd:function(){n.polygonEnd(),A.lineStart=_}};function v(b,y){b=e(b,y),n.point(b[0],b[1])}function _(){f=NaN,A.point=w,n.lineStart()}function w(b,y){var E=ro([b,y]),M=e(b,y);r(f,d,c,m,h,g,f=M[0],d=M[1],c=b,m=E[0],h=E[1],g=E[2],eM,n),n.point(f,d)}function k(){A.point=v,n.lineEnd()}function x(){_(),A.point=S,A.lineEnd=I}function S(b,y){w(i=b,y),a=f,o=d,s=m,l=h,u=g,A.point=w}function I(){r(f,d,c,m,h,g,a,o,i,s,l,u,eM,n),A.lineEnd=k,k()}return A}}var eM,wJ,tM=q(()=>{M0();ln();i7();eM=16,wJ=Wt(30*Ut)});function EJ(e){return v4({point:function(t,r){var n=e(t,r);return this.stream.point(n[0],n[1])}})}function AJ(e,t,r,n,i){function a(o,s){return o*=n,s*=i,[t+e*o,r-e*s]}return a.invert=function(o,s){return[(o-t)/e*n,(r-s)/e*i]},a}function rM(e,t,r,n,i,a){if(!a)return AJ(e,t,r,n,i);var o=Wt(a),s=Jt(a),l=o*e,u=s*e,c=o/e,f=s/e,d=(s*r-o*t)/e,m=(s*t+o*r)/e;function h(g,A){return g*=n,A*=i,[l*g-u*A+t,r-u*g-l*A]}return h.invert=function(g,A){return[n*(c*g-f*A+d),i*(m-f*g-c*A)]},h}function U0(e){return nM(function(){return e})()}function nM(e){var t,r=150,n=480,i=250,a=0,o=0,s=0,l=0,u=0,c,f=0,d=1,m=1,h=null,g=Uy,A=null,v,_,w,k=h4,x=.5,S,I,b,y,E;function M(O){return b(O[0]*Ut,O[1]*Ut)}function F(O){return O=b.invert(O[0],O[1]),O&&[O[0]*sn,O[1]*sn]}M.stream=function(O){return y&&E===O?y:y=kJ(EJ(c)(g(S(k(E=O)))))},M.preclip=function(O){return arguments.length?(g=O,h=void 0,D()):g},M.postclip=function(O){return arguments.length?(k=O,A=v=_=w=null,D()):k},M.clipAngle=function(O){return arguments.length?(g=+O?II(h=O*Ut):(h=null,Uy),D()):h*sn},M.clipExtent=function(O){return arguments.length?(k=O==null?(A=v=_=w=null,h4):Z6(A=+O[0][0],v=+O[0][1],_=+O[1][0],w=+O[1][1]),D()):A==null?null:[[A,v],[_,w]]},M.scale=function(O){return arguments.length?(r=+O,N()):r},M.translate=function(O){return arguments.length?(n=+O[0],i=+O[1],N()):[n,i]},M.center=function(O){return arguments.length?(a=O[0]%360*Ut,o=O[1]%360*Ut,N()):[a*sn,o*sn]},M.rotate=function(O){return arguments.length?(s=O[0]%360*Ut,l=O[1]%360*Ut,u=O.length>2?O[2]%360*Ut:0,N()):[s*sn,l*sn,u*sn]},M.angle=function(O){return arguments.length?(f=O%360*Ut,N()):f*sn},M.reflectX=function(O){return arguments.length?(d=O?-1:1,N()):d<0},M.reflectY=function(O){return arguments.length?(m=O?-1:1,N()):m<0},M.precision=function(O){return arguments.length?(S=sb(I,x=O*O),D()):Di(x)},M.fitExtent=function(O,L){return a7(M,O,L)},M.fitSize=function(O,L){return Bf(M,O,L)},M.fitWidth=function(O,L){return zf(M,O,L)},M.fitHeight=function(O,L){return qf(M,O,L)};function N(){var O=rM(r,0,0,d,m,f).apply(null,t(a,o)),L=rM(r,n-O[0],i-O[1],d,m,f);return c=Ny(s,l,u),I=K6(t,L),b=K6(c,I),S=sb(I,x),D()}function D(){return y=E=null,M}return function(){return t=e.apply(this,arguments),M.invert=t.invert&&F,N()}}var kJ,lb=q(()=>{CI();MI();By();My();Nf();ln();Dy();i7();ob();tM();kJ=v4({point:function(e,t){this.stream.point(e*Ut,t*Ut)}})});function y4(e,t){return[e,JC(tI((Wn+t)/2))]}function ub(){return SJ(y4).scale(961/wn)}function SJ(e){var t=U0(e),r=t.center,n=t.scale,i=t.translate,a=t.clipExtent,o=null,s,l,u;t.scale=function(f){return arguments.length?(n(f),c()):n()},t.translate=function(f){return arguments.length?(i(f),c()):i()},t.center=function(f){return arguments.length?(r(f),c()):r()},t.clipExtent=function(f){return arguments.length?(f==null?o=s=l=u=null:(o=+f[0][0],s=+f[0][1],l=+f[1][0],u=+f[1][1]),c()):o==null?null:[[o,s],[l,u]]};function c(){var f=Gt*n(),d=t(wI(t.rotate()).invert([0,0]));return a(o==null?[[d[0]-f,d[1]-f],[d[0]+f,d[1]+f]]:e===y4?[[Math.max(d[0]-f,o),s],[Math.min(d[0]+f,l),u]]:[[o,Math.max(d[1]-f,s)],[l,Math.min(d[1]+f,u)]])}return c()}var iM=q(()=>{ln();Dy();lb();y4.invert=function(e,t){return[e,2*wf(ZC(t))-Wn]}});function cb(){var e=1,t=0,r=0,n=1,i=1,a=0,o,s,l=null,u,c,f,d=1,m=1,h=v4({point:function(k,x){var S=w([k,x]);this.stream.point(S[0],S[1])}}),g=h4,A,v;function _(){return d=e*n,m=e*i,A=v=null,w}function w(k){var x=k[0]*d,S=k[1]*m;if(a){var I=S*o-x*s;x=x*o+S*s,S=I}return[x+t,S+r]}return w.invert=function(k){var x=k[0]-t,S=k[1]-r;if(a){var I=S*o+x*s;x=x*o-S*s,S=I}return[x/d,S/m]},w.stream=function(k){return A&&v===k?A:A=h(g(v=k))},w.postclip=function(k){return arguments.length?(g=k,l=u=c=f=null,_()):g},w.clipExtent=function(k){return arguments.length?(g=k==null?(l=u=c=f=null,h4):Z6(l=+k[0][0],u=+k[0][1],c=+k[1][0],f=+k[1][1]),_()):l==null?null:[[l,u],[c,f]]},w.scale=function(k){return arguments.length?(e=+k,_()):e},w.translate=function(k){return arguments.length?(t=+k[0],r=+k[1],_()):[t,r]},w.angle=function(k){return arguments.length?(a=k%360*Ut,s=Jt(a),o=Wt(a),_()):a*sn},w.reflectX=function(k){return arguments.length?(n=k?-1:1,_()):n<0},w.reflectY=function(k){return arguments.length?(i=k?-1:1,_()):i<0},w.fitExtent=function(k,x){return a7(w,k,x)},w.fitSize=function(k,x){return Bf(w,k,x)},w.fitWidth=function(k,x){return zf(w,k,x)},w.fitHeight=function(k,x){return qf(w,k,x)},w}var aM=q(()=>{By();Nf();i7();ob();ln()});var Ta=q(()=>{Cy();gI();DI();JI();aM();lb();iM();Jl();i7()});var oM={};j(oM,{geoLatToMeters:()=>i2,geoLonToMeters:()=>vs,geoMetersToLat:()=>Ln,geoMetersToLon:()=>xn,geoMetersToOffset:()=>b4,geoOffsetToMeters:()=>w4,geoScaleToZoom:()=>Yt,geoSphericalClosestNode:()=>x4,geoSphericalDistance:()=>wt,geoZoomToScale:()=>Mn});function i2(e){return e*(b1*$f/360)}function vs(e,t){return Math.abs(t)>=90?0:e*(b1*Vf/360)*Math.abs(Math.cos(t*(Math.PI/180)))}function Ln(e){return e/(b1*$f/360)}function xn(e,t){return Math.abs(t)>=90?0:e/(b1*Vf/360)/Math.abs(Math.cos(t*(Math.PI/180)))}function b4(e,t){return t=t||256,[e[0]*t/(b1*Vf),-e[1]*t/(b1*$f)]}function w4(e,t){return t=t||256,[e[0]*b1*Vf/t,-e[1]*b1*$f/t]}function wt(e,t){var r=vs(e[0]-t[0],(e[1]+t[1])/2),n=i2(e[1]-t[1]);return Math.sqrt(r*r+n*n)}function Yt(e,t){t=t||256;var r=Math.log(t)*Math.LOG2E;return Math.log(e*b1)/Math.LN2-r}function Mn(e,t){return t=t||256,t*Math.pow(2,e)/b1}function x4(e,t){var r=1/0,n,i;for(var a in e)n=wt(e[a].loc,t),n<r&&(r=n,i=a);return i!==void 0?{index:i,distance:r,node:e[i]}:null}var b1,Vf,$f,yi=q(()=>{"use strict";b1=2*Math.PI,Vf=6378137,$f=63567523e-1});var sM={};j(sM,{geoExtent:()=>Me});function Me(e,t){if(this instanceof Me){if(e instanceof Me)return e;e&&e.length===2&&e[0].length===2&&e[1].length===2?(this[0]=e[0],this[1]=e[1]):(this[0]=e||[1/0,1/0],this[1]=t||e||[-1/0,-1/0])}else return new Me(e,t)}var w1=q(()=>{"use strict";yi();Me.prototype=new Array(2);Object.assign(Me.prototype,{equals:function(e){return this[0][0]===e[0][0]&&this[0][1]===e[0][1]&&this[1][0]===e[1][0]&&this[1][1]===e[1][1]},extend:function(e){return e instanceof Me||(e=new Me(e)),Me([Math.min(e[0][0],this[0][0]),Math.min(e[0][1],this[0][1])],[Math.max(e[1][0],this[1][0]),Math.max(e[1][1],this[1][1])])},_extend:function(e){this[0][0]=Math.min(e[0][0],this[0][0]),this[0][1]=Math.min(e[0][1],this[0][1]),this[1][0]=Math.max(e[1][0],this[1][0]),this[1][1]=Math.max(e[1][1],this[1][1])},area:function(){return Math.abs((this[1][0]-this[0][0])*(this[1][1]-this[0][1]))},center:function(){return[(this[0][0]+this[1][0])/2,(this[0][1]+this[1][1])/2]},rectangle:function(){return[this[0][0],this[0][1],this[1][0],this[1][1]]},bbox:function(){return{minX:this[0][0],minY:this[0][1],maxX:this[1][0],maxY:this[1][1]}},polygon:function(){return[[this[0][0],this[0][1]],[this[0][0],this[1][1]],[this[1][0],this[1][1]],[this[1][0],this[0][1]],[this[0][0],this[0][1]]]},contains:function(e){return e instanceof Me||(e=new Me(e)),e[0][0]>=this[0][0]&&e[0][1]>=this[0][1]&&e[1][0]<=this[1][0]&&e[1][1]<=this[1][1]},intersects:function(e){return e instanceof Me||(e=new Me(e)),e[0][0]<=this[1][0]&&e[0][1]<=this[1][1]&&e[1][0]>=this[0][0]&&e[1][1]>=this[0][1]},intersection:function(e){return this.intersects(e)?new Me([Math.max(e[0][0],this[0][0]),Math.max(e[0][1],this[0][1])],[Math.min(e[1][0],this[1][0]),Math.min(e[1][1],this[1][1])]):new Me},percentContainedIn:function(e){e instanceof Me||(e=new Me(e));var t=this.intersection(e).area(),r=this.area();return t===1/0||r===1/0?0:t===0||r===0?e.contains(this)?1:0:t/r},padByMeters:function(e){var t=Ln(e),r=xn(e,this.center()[1]);return Me([this[0][0]-r,this[0][1]-t],[this[1][0]+r,this[1][1]+t])},toParam:function(){return this.rectangle().join(",")},split:function(){let e=this.center();return[Me(this[0],e),Me([e[0],this[0][1]],[this[1][0],e[1]]),Me(e,this[1]),Me([this[0][0],e[1]],[e[0],this[1][1]])]}})});function B0(e){for(var t=-1,r=e.length,n,i=e[r-1],a=0;++t<r;)n=i,i=e[t],a+=n[1]*i[0]-n[0]*i[1];return a/2}var lM=q(()=>{});function x1(e){for(var t=-1,r=e.length,n=0,i=0,a,o=e[r-1],s,l=0;++t<r;)a=o,o=e[t],l+=s=a[0]*o[1]-o[0]*a[1],n+=(a[0]+o[0])*s,i+=(a[1]+o[1])*s;return l*=3,[n/l,i/l]}var uM=q(()=>{});function cM(e,t,r){return(t[0]-e[0])*(r[1]-e[1])-(t[1]-e[1])*(r[0]-e[0])}var fM=q(()=>{});function CJ(e,t){return e[0]-t[0]||e[1]-t[1]}function dM(e){let t=e.length,r=[0,1],n=2,i;for(i=2;i<t;++i){for(;n>1&&cM(e[r[n-2]],e[r[n-1]],e[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function ys(e){if((r=e.length)<3)return null;var t,r,n=new Array(r),i=new Array(r);for(t=0;t<r;++t)n[t]=[+e[t][0],+e[t][1],t];for(n.sort(CJ),t=0;t<r;++t)i[t]=[n[t][0],-n[t][1]];var a=dM(n),o=dM(i),s=o[0]===a[0],l=o[o.length-1]===a[a.length-1],u=[];for(t=a.length-1;t>=0;--t)u.push(e[n[a[t]][2]]);for(t=+s;t<o.length-l;++t)u.push(e[n[o[t]][2]]);return u}var pM=q(()=>{fM()});var o7=q(()=>{lM();uM();pM()});var mM={};j(mM,{geoVecAdd:()=>qr,geoVecAngle:()=>no,geoVecCross:()=>k1,geoVecDot:()=>bi,geoVecEqual:()=>zr,geoVecFloor:()=>Gf,geoVecInterp:()=>Qt,geoVecLength:()=>ft,geoVecLengthSquare:()=>_4,geoVecNormalize:()=>_1,geoVecNormalizedDot:()=>k4,geoVecProject:()=>z0,geoVecScale:()=>Na,geoVecSubtract:()=>Bt});function zr(e,t,r){return r?Math.abs(e[0]-t[0])<=r&&Math.abs(e[1]-t[1])<=r:e[0]===t[0]&&e[1]===t[1]}function qr(e,t){return[e[0]+t[0],e[1]+t[1]]}function Bt(e,t){return[e[0]-t[0],e[1]-t[1]]}function Na(e,t){return[e[0]*t,e[1]*t]}function Gf(e){return[Math.floor(e[0]),Math.floor(e[1])]}function Qt(e,t,r){return[e[0]+(t[0]-e[0])*r,e[1]+(t[1]-e[1])*r]}function ft(e,t){return Math.sqrt(_4(e,t))}function _4(e,t){t=t||[0,0];var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n}function _1(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]);return t!==0?Na(e,1/t):[0,0]}function no(e,t){return Math.atan2(t[1]-e[1],t[0]-e[0])}function bi(e,t,r){r=r||[0,0];var n=Bt(e,r),i=Bt(t,r);return n[0]*i[0]+n[1]*i[1]}function k4(e,t,r){r=r||[0,0];var n=_1(Bt(e,r)),i=_1(Bt(t,r));return bi(n,i)}function k1(e,t,r){r=r||[0,0];var n=Bt(e,r),i=Bt(t,r);return n[0]*i[1]-n[1]*i[0]}function z0(e,t){for(var r=1/0,n,i,a=0;a<t.length-1;a++){var o=t[a],s=Bt(t[a+1],o),l=Bt(e,o),u=bi(l,s)/bi(s,s),c;u<0?c=o:u>1?c=t[a+1]:c=[o[0]+u*s[0],o[1]+u*s[1]];var f=ft(c,e);f<r&&(r=f,n=a+1,i=c)}return n!==void 0?{index:n,distance:r,target:i}:null}var cn=q(()=>{"use strict"});var hM={};j(hM,{geoAngle:()=>fn,geoChooseEdge:()=>_n,geoEdgeEqual:()=>q0,geoGetSmallestSurroundingRectangle:()=>S4,geoHasLineIntersections:()=>V0,geoHasSelfIntersections:()=>ta,geoLineIntersection:()=>ra,geoPathHasIntersections:()=>s7,geoPathIntersections:()=>E4,geoPathLength:()=>qo,geoPointInPolygon:()=>io,geoPolygonContainsPolygon:()=>A4,geoPolygonIntersectsPolygon:()=>ao,geoRotate:()=>E1,geoViewportEdge:()=>A1});function fn(e,t,r){return no(r(e.loc),r(t.loc))}function q0(e,t){return e[0]===t[0]&&e[1]===t[1]||e[0]===t[1]&&e[1]===t[0]}function E1(e,t,r){return e.map(function(n){var i=Bt(n,r);return[i[0]*Math.cos(t)-i[1]*Math.sin(t)+r[0],i[0]*Math.sin(t)+i[1]*Math.cos(t)+r[1]]})}function _n(e,t,r,n){for(var i=ft,a=e.map(function(v){return r(v.loc)}),o=e.map(function(v){return v.id}),s=1/0,l,u,c=0;c<a.length-1;c++)if(!(o[c]===n||o[c+1]===n)){var f=a[c],d=Bt(a[c+1],f),m=Bt(t,f),h=bi(m,d)/bi(d,d),g;h<0?g=f:h>1?g=a[c+1]:g=[f[0]+h*d[0],f[1]+h*d[1]];var A=i(g,t);A<s&&(s=A,l=c+1,u=r.invert(g))}return l!==void 0?{index:l,distance:s,loc:u}:null}function V0(e,t,r){var n=[],i=[],a,o,s,l,u;for(a=0;a<e.length-1;a++)s=e[a],l=e[a+1],u=[s.loc,l.loc],(s.id===r||l.id===r)&&n.push(u);for(a=0;a<t.length-1;a++)s=t[a],l=t[a+1],u=[s.loc,l.loc],i.push(u);for(a=0;a<n.length;a++)for(o=0;o<i.length;o++){var c=n[a],f=i[o],d=ra(c,f);if(d)return!0}return!1}function ta(e,t){var r=[],n=[],i,a;for(i=0;i<e.length-1;i++){var o=e[i],s=e[i+1],l=[o.loc,s.loc];o.id===t||s.id===t?r.push(l):n.push(l)}for(i=0;i<r.length;i++)for(a=0;a<n.length;a++){var u=r[i],c=n[a];if(!(zr(u[1],c[0])||zr(u[0],c[1])||zr(u[0],c[0])||zr(u[1],c[1]))){var f=ra(u,c);if(f){var d=1e-8;if(zr(u[1],f,d)||zr(u[0],f,d)||zr(c[1],f,d)||zr(c[0],f,d))continue;return!0}}}return!1}function ra(e,t){var r=[e[0][0],e[0][1]],n=[e[1][0],e[1][1]],i=[t[0][0],t[0][1]],a=[t[1][0],t[1][1]],o=Bt(n,r),s=Bt(a,i),l=k1(Bt(i,r),o),u=k1(o,s);if(l&&u){var c=l/u,f=k1(Bt(i,r),s)/u;if(f>=0&&f<=1&&c>=0&&c<=1)return Qt(r,n,f)}return null}function E4(e,t){for(var r=[],n=0;n<e.length-1;n++)for(var i=0;i<t.length-1;i++){var a=[e[n],e[n+1]],o=[t[i],t[i+1]],s=ra(a,o);s&&r.push(s)}return r}function s7(e,t){for(var r=0;r<e.length-1;r++)for(var n=0;n<t.length-1;n++){var i=[e[r],e[r+1]],a=[t[n],t[n+1]],o=ra(i,a);if(o)return!0}return!1}function io(e,t){for(var r=e[0],n=e[1],i=!1,a=0,o=t.length-1;a<t.length;o=a++){var s=t[a][0],l=t[a][1],u=t[o][0],c=t[o][1],f=l>n!=c>n&&r<(u-s)*(n-l)/(c-l)+s;f&&(i=!i)}return i}function A4(e,t){return t.every(function(r){return io(r,e)})}function ao(e,t,r){function n(i,a){return a.some(function(o){return io(o,i)})}return n(e,t)||!!r&&s7(e,t)}function S4(e){for(var t=ys(e),r=x1(t),n=1/0,i=[],a=0,o=t[0],s=0;s<=t.length-1;s++){var l=s===t.length-1?t[0]:t[s+1],u=Math.atan2(l[1]-o[1],l[0]-o[0]),c=E1(t,-u,r),f=c.reduce(function(m,h){return m.extend(Me(h))},Me()),d=f.area();d<n&&(n=d,i=f,a=u),o=l}return{poly:E1(i.polygon(),a,r),angle:a}}function qo(e){for(var t=0,r=0;r<e.length-1;r++)t+=ft(e[r],e[r+1]);return t}function A1(e,t){var r=[80,20,50,20],n=0,i=0;return e[0]>t[0]-r[1]&&(n=-10),e[0]<r[3]&&(n=10),e[1]>t[1]-r[2]&&(i=-10),e[1]<r[0]&&(i=10),n||i?[n,i]:null}var Qn=q(()=>{"use strict";o7();w1();cn()});function vM(){for(var e=0,t=arguments.length,r={},n;e<t;++e){if(!(n=arguments[e]+"")||n in r||/[\s.]/.test(n))throw new Error("illegal type: "+n);r[n]=[]}return new Wf(r)}function Wf(e){this._=e}function MJ(e,t){return e.trim().split(/^|\s+/).map(function(r){var n="",i=r.indexOf(".");if(i>=0&&(n=r.slice(i+1),r=r.slice(0,i)),r&&!t.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:n}})}function TJ(e,t){for(var r=0,n=e.length,i;r<n;++r)if((i=e[r]).name===t)return i.value}function gM(e,t,r){for(var n=0,i=e.length;n<i;++n)if(e[n].name===t){e[n]=IJ,e=e.slice(0,n).concat(e.slice(n+1));break}return r!=null&&e.push({name:t,value:r}),e}var IJ,xe,yM=q(()=>{IJ={value:()=>{}};Wf.prototype=vM.prototype={constructor:Wf,on:function(e,t){var r=this._,n=MJ(e+"",r),i,a=-1,o=n.length;if(arguments.length<2){for(;++a<o;)if((i=(e=n[a]).type)&&(i=TJ(r[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<o;)if(i=(e=n[a]).type)r[i]=gM(r[i],e.name,t);else if(t==null)for(i in r)r[i]=gM(r[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new Wf(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var r=new Array(i),n=0,i,a;n<i;++n)r[n]=arguments[n+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],n=0,i=a.length;n<i;++n)a[n].value.apply(t,r)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],i=0,a=n.length;i<a;++i)n[i].value.apply(t,r)}};xe=vM});var Ye=q(()=>{yM()});var Qf,fb,db=q(()=>{Qf="http://www.w3.org/1999/xhtml",fb={svg:"http://www.w3.org/2000/svg",xhtml:Qf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"}});function bs(e){var t=e+="",r=t.indexOf(":");return r>=0&&(t=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),fb.hasOwnProperty(t)?{space:fb[t],local:e}:e}var Hf=q(()=>{db()});function NJ(e){return function(){var t=this.ownerDocument,r=this.namespaceURI;return r===Qf&&t.documentElement.namespaceURI===Qf?t.createElement(e):t.createElementNS(r,e)}}function DJ(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function jf(e){var t=bs(e);return(t.local?DJ:NJ)(t)}var pb=q(()=>{Hf();db()});function PJ(){}function a2(e){return e==null?PJ:function(){return this.querySelector(e)}}var Yf=q(()=>{});function bM(e){typeof e!="function"&&(e=a2(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a=t[i],o=a.length,s=n[i]=new Array(o),l,u,c=0;c<o;++c)(l=a[c])&&(u=e.call(l,l.__data__,c,a))&&("__data__"in l&&(u.__data__=l.__data__),s[c]=u);return new Vr(n,this._parents)}var wM=q(()=>{oo();Yf()});function l7(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}var mb=q(()=>{});function FJ(){return[]}function u7(e){return e==null?FJ:function(){return this.querySelectorAll(e)}}var hb=q(()=>{});function OJ(e){return function(){return l7(e.apply(this,arguments))}}function xM(e){typeof e=="function"?e=OJ(e):e=u7(e);for(var t=this._groups,r=t.length,n=[],i=[],a=0;a<r;++a)for(var o=t[a],s=o.length,l,u=0;u<s;++u)(l=o[u])&&(n.push(e.call(l,l.__data__,u,o)),i.push(l));return new Vr(n,i)}var _M=q(()=>{oo();mb();hb()});function c7(e){return function(){return this.matches(e)}}function Kf(e){return function(t){return t.matches(e)}}var f7=q(()=>{});function LJ(e){return function(){return RJ.call(this.children,e)}}function UJ(){return this.firstElementChild}function kM(e){return this.select(e==null?UJ:LJ(typeof e=="function"?e:Kf(e)))}var RJ,EM=q(()=>{f7();RJ=Array.prototype.find});function zJ(){return Array.from(this.children)}function qJ(e){return function(){return BJ.call(this.children,e)}}function AM(e){return this.selectAll(e==null?zJ:qJ(typeof e=="function"?e:Kf(e)))}var BJ,SM=q(()=>{f7();BJ=Array.prototype.filter});function CM(e){typeof e!="function"&&(e=c7(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a=t[i],o=a.length,s=n[i]=[],l,u=0;u<o;++u)(l=a[u])&&e.call(l,l.__data__,u,a)&&s.push(l);return new Vr(n,this._parents)}var IM=q(()=>{oo();f7()});function Xf(e){return new Array(e.length)}var gb=q(()=>{});function MM(){return new Vr(this._enter||this._groups.map(Xf),this._parents)}function d7(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}var vb=q(()=>{gb();oo();d7.prototype={constructor:d7,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}}});function TM(e){return function(){return e}}var NM=q(()=>{});function VJ(e,t,r,n,i,a){for(var o=0,s,l=t.length,u=a.length;o<u;++o)(s=t[o])?(s.__data__=a[o],n[o]=s):r[o]=new d7(e,a[o]);for(;o<l;++o)(s=t[o])&&(i[o]=s)}function $J(e,t,r,n,i,a,o){var s,l,u=new Map,c=t.length,f=a.length,d=new Array(c),m;for(s=0;s<c;++s)(l=t[s])&&(d[s]=m=o.call(l,l.__data__,s,t)+"",u.has(m)?i[s]=l:u.set(m,l));for(s=0;s<f;++s)m=o.call(e,a[s],s,a)+"",(l=u.get(m))?(n[s]=l,l.__data__=a[s],u.delete(m)):r[s]=new d7(e,a[s]);for(s=0;s<c;++s)(l=t[s])&&u.get(d[s])===l&&(i[s]=l)}function GJ(e){return e.__data__}function DM(e,t){if(!arguments.length)return Array.from(this,GJ);var r=t?$J:VJ,n=this._parents,i=this._groups;typeof e!="function"&&(e=TM(e));for(var a=i.length,o=new Array(a),s=new Array(a),l=new Array(a),u=0;u<a;++u){var c=n[u],f=i[u],d=f.length,m=WJ(e.call(c,c&&c.__data__,u,n)),h=m.length,g=s[u]=new Array(h),A=o[u]=new Array(h),v=l[u]=new Array(d);r(c,f,g,A,v,m,t);for(var _=0,w=0,k,x;_<h;++_)if(k=g[_]){for(_>=w&&(w=_+1);!(x=A[w])&&++w<h;);k._next=x||null}}return o=new Vr(o,n),o._enter=s,o._exit=l,o}function WJ(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}var PM=q(()=>{oo();vb();NM()});function FM(){return new Vr(this._exit||this._groups.map(Xf),this._parents)}var OM=q(()=>{gb();oo()});function RM(e,t,r){var n=this.enter(),i=this,a=this.exit();return typeof e=="function"?(n=e(n),n&&(n=n.selection())):n=n.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),r==null?a.remove():r(a),n&&i?n.merge(i).order():i}var LM=q(()=>{});function UM(e){for(var t=e.selection?e.selection():e,r=this._groups,n=t._groups,i=r.length,a=n.length,o=Math.min(i,a),s=new Array(i),l=0;l<o;++l)for(var u=r[l],c=n[l],f=u.length,d=s[l]=new Array(f),m,h=0;h<f;++h)(m=u[h]||c[h])&&(d[h]=m);for(;l<i;++l)s[l]=r[l];return new Vr(s,this._parents)}var BM=q(()=>{oo()});function zM(){for(var e=this._groups,t=-1,r=e.length;++t<r;)for(var n=e[t],i=n.length-1,a=n[i],o;--i>=0;)(o=n[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}var qM=q(()=>{});function VM(e){e||(e=QJ);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var r=this._groups,n=r.length,i=new Array(n),a=0;a<n;++a){for(var o=r[a],s=o.length,l=i[a]=new Array(s),u,c=0;c<s;++c)(u=o[c])&&(l[c]=u);l.sort(t)}return new Vr(i,this._parents).order()}function QJ(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}var $M=q(()=>{oo()});function GM(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}var WM=q(()=>{});function QM(){return Array.from(this)}var HM=q(()=>{});function jM(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,a=n.length;i<a;++i){var o=n[i];if(o)return o}return null}var YM=q(()=>{});function KM(){let e=0;for(let t of this)++e;return e}var XM=q(()=>{});function ZM(){return!this.node()}var JM=q(()=>{});function eT(e){for(var t=this._groups,r=0,n=t.length;r<n;++r)for(var i=t[r],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}var tT=q(()=>{});function HJ(e){return function(){this.removeAttribute(e)}}function jJ(e){return function(){this.removeAttributeNS(e.space,e.local)}}function YJ(e,t){return function(){this.setAttribute(e,t)}}function KJ(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function XJ(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttribute(e):this.setAttribute(e,r)}}function ZJ(e,t){return function(){var r=t.apply(this,arguments);r==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,r)}}function rT(e,t){var r=bs(e);if(arguments.length<2){var n=this.node();return r.local?n.getAttributeNS(r.space,r.local):n.getAttribute(r)}return this.each((t==null?r.local?jJ:HJ:typeof t=="function"?r.local?ZJ:XJ:r.local?KJ:YJ)(r,t))}var nT=q(()=>{Hf()});function Zf(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}var yb=q(()=>{});function JJ(e){return function(){this.style.removeProperty(e)}}function eee(e,t,r){return function(){this.style.setProperty(e,t,r)}}function tee(e,t,r){return function(){var n=t.apply(this,arguments);n==null?this.style.removeProperty(e):this.style.setProperty(e,n,r)}}function iT(e,t,r){return arguments.length>1?this.each((t==null?JJ:typeof t=="function"?tee:eee)(e,t,r==null?"":r)):C4(this.node(),e)}function C4(e,t){return e.style.getPropertyValue(t)||Zf(e).getComputedStyle(e,null).getPropertyValue(t)}var bb=q(()=>{yb()});function ree(e){return function(){delete this[e]}}function nee(e,t){return function(){this[e]=t}}function iee(e,t){return function(){var r=t.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function aT(e,t){return arguments.length>1?this.each((t==null?ree:typeof t=="function"?iee:nee)(e,t)):this.node()[e]}var oT=q(()=>{});function sT(e){return e.trim().split(/^|\s+/)}function wb(e){return e.classList||new lT(e)}function lT(e){this._node=e,this._names=sT(e.getAttribute("class")||"")}function uT(e,t){for(var r=wb(e),n=-1,i=t.length;++n<i;)r.add(t[n])}function cT(e,t){for(var r=wb(e),n=-1,i=t.length;++n<i;)r.remove(t[n])}function aee(e){return function(){uT(this,e)}}function oee(e){return function(){cT(this,e)}}function see(e,t){return function(){(t.apply(this,arguments)?uT:cT)(this,e)}}function fT(e,t){var r=sT(e+"");if(arguments.length<2){for(var n=wb(this.node()),i=-1,a=r.length;++i<a;)if(!n.contains(r[i]))return!1;return!0}return this.each((typeof t=="function"?see:t?aee:oee)(r,t))}var dT=q(()=>{lT.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}}});function lee(){this.textContent=""}function uee(e){return function(){this.textContent=e}}function cee(e){return function(){var t=e.apply(this,arguments);this.textContent=t==null?"":t}}function pT(e){return arguments.length?this.each(e==null?lee:(typeof e=="function"?cee:uee)(e)):this.node().textContent}var mT=q(()=>{});function fee(){this.innerHTML=""}function dee(e){return function(){this.innerHTML=e}}function pee(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t==null?"":t}}function hT(e){return arguments.length?this.each(e==null?fee:(typeof e=="function"?pee:dee)(e)):this.node().innerHTML}var gT=q(()=>{});function mee(){this.nextSibling&&this.parentNode.appendChild(this)}function vT(){return this.each(mee)}var yT=q(()=>{});function hee(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function bT(){return this.each(hee)}var wT=q(()=>{});function xT(e){var t=typeof e=="function"?e:jf(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}var _T=q(()=>{pb()});function gee(){return null}function kT(e,t){var r=typeof e=="function"?e:jf(e),n=t==null?gee:typeof t=="function"?t:a2(t);return this.select(function(){return this.insertBefore(r.apply(this,arguments),n.apply(this,arguments)||null)})}var ET=q(()=>{pb();Yf()});function vee(){var e=this.parentNode;e&&e.removeChild(this)}function AT(){return this.each(vee)}var ST=q(()=>{});function yee(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function bee(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function CT(e){return this.select(e?bee:yee)}var IT=q(()=>{});function MT(e){return arguments.length?this.property("__data__",e):this.node().__data__}var TT=q(()=>{});function wee(e){return function(t){e.call(this,t,this.__data__)}}function xee(e){return e.trim().split(/^|\s+/).map(function(t){var r="",n=t.indexOf(".");return n>=0&&(r=t.slice(n+1),t=t.slice(0,n)),{type:t,name:r}})}function _ee(e){return function(){var t=this.__on;if(t){for(var r=0,n=-1,i=t.length,a;r<i;++r)a=t[r],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++n]=a;++n?t.length=n:delete this.__on}}}function kee(e,t,r){return function(){var n=this.__on,i,a=wee(t);if(n){for(var o=0,s=n.length;o<s;++o)if((i=n[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=r),i.value=t;return}}this.addEventListener(e.type,a,r),i={type:e.type,name:e.name,value:t,listener:a,options:r},n?n.push(i):this.__on=[i]}}function NT(e,t,r){var n=xee(e+""),i,a=n.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var l=0,u=s.length,c;l<u;++l)for(i=0,c=s[l];i<a;++i)if((o=n[i]).type===c.type&&o.name===c.name)return c.value}return}for(s=t?kee:_ee,i=0;i<a;++i)this.each(s(n[i],t,r));return this}var DT=q(()=>{});function PT(e,t,r){var n=Zf(e),i=n.CustomEvent;typeof i=="function"?i=new i(t,r):(i=n.document.createEvent("Event"),r?(i.initEvent(t,r.bubbles,r.cancelable),i.detail=r.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Eee(e,t){return function(){return PT(this,e,t)}}function Aee(e,t){return function(){return PT(this,e,t.apply(this,arguments))}}function FT(e,t){return this.each((typeof t=="function"?Aee:Eee)(e,t))}var OT=q(()=>{yb()});function*RT(){for(var e=this._groups,t=0,r=e.length;t<r;++t)for(var n=e[t],i=0,a=n.length,o;i<a;++i)(o=n[i])&&(yield o)}var LT=q(()=>{});function Vr(e,t){this._groups=e,this._parents=t}function UT(){return new Vr([[document.documentElement]],p7)}function See(){return this}var p7,Vo,oo=q(()=>{wM();_M();EM();SM();IM();PM();vb();OM();LM();BM();qM();$M();WM();HM();YM();XM();JM();tT();nT();bb();oT();dT();mT();gT();yT();wT();_T();ET();ST();IT();TT();DT();OT();LT();p7=[null];Vr.prototype=UT.prototype={constructor:Vr,select:bM,selectAll:xM,selectChild:kM,selectChildren:AM,filter:CM,data:DM,enter:MM,exit:FM,join:RM,merge:UM,selection:See,order:zM,sort:VM,call:GM,nodes:QM,node:jM,size:KM,empty:ZM,each:eT,attr:rT,style:iT,property:aT,classed:fT,text:pT,html:hT,raise:vT,lower:bT,append:xT,insert:kT,remove:AT,clone:CT,datum:MT,on:NT,dispatch:FT,[Symbol.iterator]:RT};Vo=UT});function Q(e){return typeof e=="string"?new Vr([[document.querySelector(e)]],[document.documentElement]):new Vr([[e]],p7)}var BT=q(()=>{oo()});function zT(e){let t;for(;t=e.sourceEvent;)e=t;return e}var qT=q(()=>{});function so(e,t){if(e=zT(e),t===void 0&&(t=e.currentTarget),t){var r=t.ownerSVGElement||t;if(r.createSVGPoint){var n=r.createSVGPoint();return n.x=e.clientX,n.y=e.clientY,n=n.matrixTransform(t.getScreenCTM().inverse()),[n.x,n.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var VT=q(()=>{qT()});function xb(e){return typeof e=="string"?new Vr([document.querySelectorAll(e)],[document.documentElement]):new Vr([l7(e)],p7)}var $T=q(()=>{mb();oo()});var Ae=q(()=>{f7();Hf();VT();BT();$T();oo();Yf();hb();bb()});function Jf(e){e.stopImmediatePropagation()}function I4(e){e.preventDefault(),e.stopImmediatePropagation()}var GT,o2,_b=q(()=>{GT={passive:!1},o2={capture:!0,passive:!1}});function m7(e){var t=e.document.documentElement,r=Q(e).on("dragstart.drag",I4,o2);"onselectstart"in t?r.on("selectstart.drag",I4,o2):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function h7(e,t){var r=e.document.documentElement,n=Q(e).on("dragstart.drag",null);t&&(n.on("click.drag",I4,o2),setTimeout(function(){n.on("click.drag",null)},0)),"onselectstart"in r?n.on("selectstart.drag",null):(r.style.MozUserSelect=r.__noselect,delete r.__noselect)}var kb=q(()=>{Ae();_b()});var g7,WT=q(()=>{g7=e=>()=>e});function v7(e,{sourceEvent:t,subject:r,target:n,identifier:i,active:a,x:o,y:s,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}var QT=q(()=>{v7.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e}});function Cee(e){return!e.ctrlKey&&!e.button}function Iee(){return this.parentNode}function Mee(e,t){return t==null?{x:e.x,y:e.y}:t}function Tee(){return navigator.maxTouchPoints||"ontouchstart"in this}function y7(){var e=Cee,t=Iee,r=Mee,n=Tee,i={},a=xe("start","drag","end"),o=0,s,l,u,c,f=0;function d(k){k.on("mousedown.drag",m).filter(n).on("touchstart.drag",A).on("touchmove.drag",v,GT).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(k,x){if(!(c||!e.call(this,k,x))){var S=w(this,t.call(this,k,x),k,x,"mouse");S&&(Q(k.view).on("mousemove.drag",h,o2).on("mouseup.drag",g,o2),m7(k.view),Jf(k),u=!1,s=k.clientX,l=k.clientY,S("start",k))}}function h(k){if(I4(k),!u){var x=k.clientX-s,S=k.clientY-l;u=x*x+S*S>f}i.mouse("drag",k)}function g(k){Q(k.view).on("mousemove.drag mouseup.drag",null),h7(k.view,u),I4(k),i.mouse("end",k)}function A(k,x){if(e.call(this,k,x)){var S=k.changedTouches,I=t.call(this,k,x),b=S.length,y,E;for(y=0;y<b;++y)(E=w(this,I,k,x,S[y].identifier,S[y]))&&(Jf(k),E("start",k,S[y]))}}function v(k){var x=k.changedTouches,S=x.length,I,b;for(I=0;I<S;++I)(b=i[x[I].identifier])&&(I4(k),b("drag",k,x[I]))}function _(k){var x=k.changedTouches,S=x.length,I,b;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),I=0;I<S;++I)(b=i[x[I].identifier])&&(Jf(k),b("end",k,x[I]))}function w(k,x,S,I,b,y){var E=a.copy(),M=so(y||S,x),F,N,D;if((D=r.call(k,new v7("beforestart",{sourceEvent:S,target:d,identifier:b,active:o,x:M[0],y:M[1],dx:0,dy:0,dispatch:E}),I))!=null)return F=D.x-M[0]||0,N=D.y-M[1]||0,function O(L,P,U){var B=M,z;switch(L){case"start":i[b]=O,z=o++;break;case"end":delete i[b],--o;case"drag":M=so(U||P,x),z=o;break}E.call(L,k,new v7(L,{sourceEvent:P,subject:D,target:d,identifier:b,active:z,x:M[0]+F,y:M[1]+N,dx:M[0]-B[0],dy:M[1]-B[1],dispatch:E}),I)}}return d.filter=function(k){return arguments.length?(e=typeof k=="function"?k:g7(!!k),d):e},d.container=function(k){return arguments.length?(t=typeof k=="function"?k:g7(k),d):t},d.subject=function(k){return arguments.length?(r=typeof k=="function"?k:g7(k),d):r},d.touchable=function(k){return arguments.length?(n=typeof k=="function"?k:g7(!!k),d):n},d.on=function(){var k=a.on.apply(a,arguments);return k===a?d:k},d.clickDistance=function(k){return arguments.length?(f=(k=+k)*k,d):Math.sqrt(f)},d}var HT=q(()=>{Ye();Ae();kb();_b();WT();QT()});var b7=q(()=>{HT();kb()});function ed(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Eb(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}var jT=q(()=>{});function _7(){}function KT(){return this.rgb().formatHex()}function Uee(){return this.rgb().formatHex8()}function Bee(){return nN(this).formatHsl()}function XT(){return this.rgb().formatRgb()}function Go(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=Nee.exec(e))?(r=t[1].length,t=parseInt(t[1],16),r===6?ZT(t):r===3?new na(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?td(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?td(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Dee.exec(e))?new na(t[1],t[2],t[3],1):(t=Pee.exec(e))?new na(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Fee.exec(e))?td(t[1],t[2],t[3],t[4]):(t=Oee.exec(e))?td(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Ree.exec(e))?tN(t[1],t[2]/100,t[3]/100,1):(t=Lee.exec(e))?tN(t[1],t[2]/100,t[3]/100,t[4]):YT.hasOwnProperty(e)?ZT(YT[e]):e==="transparent"?new na(NaN,NaN,NaN,0):null}function ZT(e){return new na(e>>16&255,e>>8&255,e&255,1)}function td(e,t,r,n){return n<=0&&(e=t=r=NaN),new na(e,t,r,n)}function zee(e){return e instanceof _7||(e=Go(e)),e?(e=e.rgb(),new na(e.r,e.g,e.b,e.opacity)):new na}function G0(e,t,r,n){return arguments.length===1?zee(e):new na(e,t,r,n==null?1:n)}function na(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function JT(){return`#${s2(this.r)}${s2(this.g)}${s2(this.b)}`}function qee(){return`#${s2(this.r)}${s2(this.g)}${s2(this.b)}${s2((isNaN(this.opacity)?1:this.opacity)*255)}`}function eN(){let e=id(this.opacity);return`${e===1?"rgb(":"rgba("}${l2(this.r)}, ${l2(this.g)}, ${l2(this.b)}${e===1?")":`, ${e})`}`}function id(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function l2(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function s2(e){return e=l2(e),(e<16?"0":"")+e.toString(16)}function tN(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new $o(e,t,r,n)}function nN(e){if(e instanceof $o)return new $o(e.h,e.s,e.l,e.opacity);if(e instanceof _7||(e=Go(e)),!e)return new $o;if(e instanceof $o)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(t===a?o=(r-n)/s+(r<n)*6:r===a?o=(n-t)/s+2:o=(t-r)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=l>0&&l<1?0:o,new $o(o,s,l,e.opacity)}function iN(e,t,r,n){return arguments.length===1?nN(e):new $o(e,t,r,n==null?1:n)}function $o(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function rN(e){return e=(e||0)%360,e<0?e+360:e}function rd(e){return Math.max(0,Math.min(1,e||0))}function Ab(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}var w7,nd,$0,x7,S1,Nee,Dee,Pee,Fee,Oee,Ree,Lee,YT,aN=q(()=>{jT();w7=.7,nd=1/w7,$0="\\s*([+-]?\\d+)\\s*",x7="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",S1="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Nee=/^#([0-9a-f]{3,8})$/,Dee=new RegExp(`^rgb\\(${$0},${$0},${$0}\\)$`),Pee=new RegExp(`^rgb\\(${S1},${S1},${S1}\\)$`),Fee=new RegExp(`^rgba\\(${$0},${$0},${$0},${x7}\\)$`),Oee=new RegExp(`^rgba\\(${S1},${S1},${S1},${x7}\\)$`),Ree=new RegExp(`^hsl\\(${x7},${S1},${S1}\\)$`),Lee=new RegExp(`^hsla\\(${x7},${S1},${S1},${x7}\\)$`),YT={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};ed(_7,Go,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:KT,formatHex:KT,formatHex8:Uee,formatHsl:Bee,formatRgb:XT,toString:XT});ed(na,G0,Eb(_7,{brighter(e){return e=e==null?nd:Math.pow(nd,e),new na(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?w7:Math.pow(w7,e),new na(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new na(l2(this.r),l2(this.g),l2(this.b),id(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:JT,formatHex:JT,formatHex8:qee,formatRgb:eN,toString:eN}));ed($o,iN,Eb(_7,{brighter(e){return e=e==null?nd:Math.pow(nd,e),new $o(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?w7:Math.pow(w7,e),new $o(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new na(Ab(e>=240?e-240:e+120,i,n),Ab(e,i,n),Ab(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new $o(rN(this.h),rd(this.s),rd(this.l),id(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=id(this.opacity);return`${e===1?"hsl(":"hsla("}${rN(this.h)}, ${rd(this.s)*100}%, ${rd(this.l)*100}%${e===1?")":`, ${e})`}`}}))});var k7=q(()=>{aN()});function Sb(e,t,r,n,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*r+(1+3*e+3*a-3*o)*n+o*i)/6}function oN(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),i=e[n],a=e[n+1],o=n>0?e[n-1]:2*i-a,s=n<t-1?e[n+2]:2*a-i;return Sb((r-n/t)*t,o,i,a,s)}}var Cb=q(()=>{});function sN(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),i=e[(n+t-1)%t],a=e[n%t],o=e[(n+1)%t],s=e[(n+2)%t];return Sb((r-n/t)*t,i,a,o,s)}}var lN=q(()=>{Cb()});var E7,Ib=q(()=>{E7=e=>()=>e});function Vee(e,t){return function(r){return e+r*t}}function $ee(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function uN(e){return(e=+e)==1?ad:function(t,r){return r-t?$ee(t,r,e):E7(isNaN(t)?r:t)}}function ad(e,t){var r=t-e;return r?Vee(e,r):E7(isNaN(e)?t:e)}var cN=q(()=>{Ib()});function fN(e){return function(t){var r=t.length,n=new Array(r),i=new Array(r),a=new Array(r),o,s;for(o=0;o<r;++o)s=G0(t[o]),n[o]=s.r||0,i[o]=s.g||0,a[o]=s.b||0;return n=e(n),i=e(i),a=e(a),s.opacity=1,function(l){return s.r=n(l),s.g=i(l),s.b=a(l),s+""}}}var C1,Gee,Wee,Mb=q(()=>{k7();Cb();lN();cN();C1=function e(t){var r=uN(t);function n(i,a){var o=r((i=G0(i)).r,(a=G0(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=ad(i.opacity,a.opacity);return function(c){return i.r=o(c),i.g=s(c),i.b=l(c),i.opacity=u(c),i+""}}return n.gamma=e,n}(1);Gee=fN(oN),Wee=fN(sN)});function dN(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;i<r;++i)n[i]=e[i]*(1-a)+t[i]*a;return n}}function pN(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}var mN=q(()=>{});function hN(e,t){var r=t?t.length:0,n=e?Math.min(r,e.length):0,i=new Array(n),a=new Array(r),o;for(o=0;o<n;++o)i[o]=lo(e[o],t[o]);for(;o<r;++o)a[o]=t[o];return function(s){for(o=0;o<n;++o)a[o]=i[o](s);return a}}var gN=q(()=>{od()});function vN(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}var yN=q(()=>{});function Rr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var A7=q(()=>{});function bN(e,t){var r={},n={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?r[i]=lo(e[i],t[i]):n[i]=t[i];return function(a){for(i in r)n[i]=r[i](a);return n}}var wN=q(()=>{od()});function Qee(e){return function(){return e}}function Hee(e){return function(t){return e(t)+""}}function S7(e,t){var r=Nb.lastIndex=Tb.lastIndex=0,n,i,a,o=-1,s=[],l=[];for(e=e+"",t=t+"";(n=Nb.exec(e))&&(i=Tb.exec(t));)(a=i.index)>r&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:Rr(n,i)})),r=Tb.lastIndex;return r<t.length&&(a=t.slice(r),s[o]?s[o]+=a:s[++o]=a),s.length<2?l[0]?Hee(l[0].x):Qee(t):(t=l.length,function(u){for(var c=0,f;c<t;++c)s[(f=l[c]).i]=f.x(u);return s.join("")})}var Nb,Tb,Db=q(()=>{A7();Nb=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Tb=new RegExp(Nb.source,"g")});function lo(e,t){var r=typeof t,n;return t==null||r==="boolean"?E7(t):(r==="number"?Rr:r==="string"?(n=Go(t))?(t=n,C1):S7:t instanceof Go?C1:t instanceof Date?vN:pN(t)?dN:Array.isArray(t)?hN:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?bN:Rr)(e,t)}var od=q(()=>{k7();Mb();gN();yN();A7();wN();Db();Ib();mN()});function Pb(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var xN=q(()=>{});function Fb(e,t,r,n,i,a){var o,s,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*r+t*n)&&(r-=e*l,n-=t*l),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,l/=s),e*n<t*r&&(e=-e,t=-t,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*_N,skewX:Math.atan(l)*_N,scaleX:o,scaleY:s}}var _N,sd,kN=q(()=>{_N=180/Math.PI,sd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}});function EN(e){let t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?sd:Fb(t.a,t.b,t.c,t.d,t.e,t.f)}function AN(e){return e==null?sd:(ld||(ld=document.createElementNS("http://www.w3.org/2000/svg","g")),ld.setAttribute("transform",e),(e=ld.transform.baseVal.consolidate())?(e=e.matrix,Fb(e.a,e.b,e.c,e.d,e.e,e.f)):sd)}var ld,SN=q(()=>{kN()});function CN(e,t,r,n){function i(u){return u.length?u.pop()+" ":""}function a(u,c,f,d,m,h){if(u!==f||c!==d){var g=m.push("translate(",null,t,null,r);h.push({i:g-4,x:Rr(u,f)},{i:g-2,x:Rr(c,d)})}else(f||d)&&m.push("translate("+f+t+d+r)}function o(u,c,f,d){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),d.push({i:f.push(i(f)+"rotate(",null,n)-2,x:Rr(u,c)})):c&&f.push(i(f)+"rotate("+c+n)}function s(u,c,f,d){u!==c?d.push({i:f.push(i(f)+"skewX(",null,n)-2,x:Rr(u,c)}):c&&f.push(i(f)+"skewX("+c+n)}function l(u,c,f,d,m,h){if(u!==f||c!==d){var g=m.push(i(m)+"scale(",null,",",null,")");h.push({i:g-4,x:Rr(u,f)},{i:g-2,x:Rr(c,d)})}else(f!==1||d!==1)&&m.push(i(m)+"scale("+f+","+d+")")}return function(u,c){var f=[],d=[];return u=e(u),c=e(c),a(u.translateX,u.translateY,c.translateX,c.translateY,f,d),o(u.rotate,c.rotate,f,d),s(u.skewX,c.skewX,f,d),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,f,d),u=c=null,function(m){for(var h=-1,g=d.length,A;++h<g;)f[(A=d[h]).i]=A.x(m);return f.join("")}}}var Ob,Rb,IN=q(()=>{A7();SN();Ob=CN(EN,"px, ","px)","deg)"),Rb=CN(AN,", ",")",")")});function MN(e){return((e=Math.exp(e))+1/e)/2}function Yee(e){return((e=Math.exp(e))-1/e)/2}function Kee(e){return((e=Math.exp(2*e))-1)/(e+1)}var jee,C7,TN=q(()=>{jee=1e-12;C7=function e(t,r,n){function i(a,o){var s=a[0],l=a[1],u=a[2],c=o[0],f=o[1],d=o[2],m=c-s,h=f-l,g=m*m+h*h,A,v;if(g<jee)v=Math.log(d/u)/t,A=function(I){return[s+I*m,l+I*h,u*Math.exp(t*I*v)]};else{var _=Math.sqrt(g),w=(d*d-u*u+n*g)/(2*u*r*_),k=(d*d-u*u-n*g)/(2*d*r*_),x=Math.log(Math.sqrt(w*w+1)-w),S=Math.log(Math.sqrt(k*k+1)-k);v=(S-x)/t,A=function(I){var b=I*v,y=MN(x),E=u/(r*_)*(y*Kee(t*b+x)-Yee(x));return[s+E*m,l+E*h,u*y/MN(t*b+x)]}}return A.duration=v*1e3*t/Math.SQRT2,A}return i.rho=function(a){var o=Math.max(.001,+a),s=o*o,l=s*s;return e(o,s,l)},i}(Math.SQRT2,2,4)});function Lb(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e(n/(t-1));return r}var NN=q(()=>{});var Fi=q(()=>{od();A7();xN();Db();IN();TN();Mb();NN()});function P7(){return u2||(FN(Xee),u2=N7.now()+fd)}function Xee(){u2=0}function D7(){this._call=this._time=this._next=null}function M4(e,t,r){var n=new D7;return n.restart(e,t,r),n}function dd(){P7(),++W0;for(var e=ud,t;e;)(t=u2-e._time)>=0&&e._call.call(void 0,t),e=e._next;--W0}function DN(){u2=(cd=N7.now())+fd,W0=M7=0;try{dd()}finally{W0=0,Jee(),u2=0}}function Zee(){var e=N7.now(),t=e-cd;t>PN&&(fd-=t,cd=e)}function Jee(){for(var e,t=ud,r,n=1/0;t;)t._call?(n>t._time&&(n=t._time),e=t,t=t._next):(r=t._next,t._next=null,t=e?e._next=r:ud=r);T7=e,Ub(n)}function Ub(e){if(!W0){M7&&(M7=clearTimeout(M7));var t=e-u2;t>24?(e<1/0&&(M7=setTimeout(DN,e-N7.now()-fd)),I7&&(I7=clearInterval(I7))):(I7||(cd=N7.now(),I7=setInterval(Zee,PN)),W0=1,FN(DN))}}var W0,M7,I7,PN,ud,T7,cd,u2,fd,N7,FN,Bb=q(()=>{W0=0,M7=0,I7=0,PN=1e3,cd=0,u2=0,fd=0,N7=typeof performance=="object"&&performance.now?performance:Date,FN=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};D7.prototype=M4.prototype={constructor:D7,restart:function(e,t,r){if(typeof e!="function")throw new TypeError("callback is not a function");r=(r==null?P7():+r)+(t==null?0:+t),!this._next&&T7!==this&&(T7?T7._next=this:ud=this,T7=this),this._call=e,this._time=r,Ub()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ub())}}});function Q0(e,t,r){var n=new D7;return t=t==null?0:+t,n.restart(i=>{n.stop(),e(i+t)},t,r),n}var ON=q(()=>{Bb()});var c2=q(()=>{Bb();ON()});function T4(e,t,r,n,i,a){var o=e.__transition;if(!o)e.__transition={};else if(r in o)return;rte(e,r,{name:t,index:n,group:i,on:ete,tween:tte,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:UN})}function O7(e,t){var r=Un(e,t);if(r.state>UN)throw new Error("too late; already scheduled");return r}function oi(e,t){var r=Un(e,t);if(r.state>pd)throw new Error("too late; already running");return r}function Un(e,t){var r=e.__transition;if(!r||!(r=r[t]))throw new Error("transition not found");return r}function rte(e,t,r){var n=e.__transition,i;n[t]=r,r.timer=M4(a,0,r.time);function a(u){r.state=RN,r.timer.restart(o,r.delay,r.time),r.delay<=u&&o(u-r.delay)}function o(u){var c,f,d,m;if(r.state!==RN)return l();for(c in n)if(m=n[c],m.name===r.name){if(m.state===pd)return Q0(o);m.state===LN?(m.state=F7,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete n[c]):+c<t&&(m.state=F7,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete n[c])}if(Q0(function(){r.state===pd&&(r.state=LN,r.timer.restart(s,r.delay,r.time),s(u))}),r.state=md,r.on.call("start",e,e.__data__,r.index,r.group),r.state===md){for(r.state=pd,i=new Array(d=r.tween.length),c=0,f=-1;c<d;++c)(m=r.tween[c].value.call(e,e.__data__,r.index,r.group))&&(i[++f]=m);i.length=f+1}}function s(u){for(var c=u<r.duration?r.ease.call(null,u/r.duration):(r.timer.restart(l),r.state=hd,1),f=-1,d=i.length;++f<d;)i[f].call(e,c);r.state===hd&&(r.on.call("end",e,e.__data__,r.index,r.group),l())}function l(){r.state=F7,r.timer.stop(),delete n[t];for(var u in n)return;delete e.__transition}}var ete,tte,UN,RN,md,pd,LN,hd,F7,ia=q(()=>{Ye();c2();ete=xe("start","end","cancel","interrupt"),tte=[],UN=0,RN=1,md=2,pd=3,LN=4,hd=5,F7=6});function Wo(e,t){var r=e.__transition,n,i,a=!0,o;if(r){t=t==null?null:t+"";for(o in r){if((n=r[o]).name!==t){a=!1;continue}i=n.state>md&&n.state<hd,n.state=F7,n.timer.stop(),n.on.call(i?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete r[o]}a&&delete e.__transition}}var zb=q(()=>{ia()});function BN(e){return this.each(function(){Wo(this,e)})}var zN=q(()=>{zb()});function nte(e,t){var r,n;return function(){var i=oi(this,e),a=i.tween;if(a!==r){n=r=a;for(var o=0,s=n.length;o<s;++o)if(n[o].name===t){n=n.slice(),n.splice(o,1);break}}i.tween=n}}function ite(e,t,r){var n,i;if(typeof r!="function")throw new Error;return function(){var a=oi(this,e),o=a.tween;if(o!==n){i=(n=o).slice();for(var s={name:t,value:r},l=0,u=i.length;l<u;++l)if(i[l].name===t){i[l]=s;break}l===u&&i.push(s)}a.tween=i}}function qN(e,t){var r=this._id;if(e+="",arguments.length<2){for(var n=Un(this.node(),r).tween,i=0,a=n.length,o;i<a;++i)if((o=n[i]).name===e)return o.value;return null}return this.each((t==null?nte:ite)(r,e,t))}function H0(e,t,r){var n=e._id;return e.each(function(){var i=oi(this,n);(i.value||(i.value={}))[t]=r.apply(this,arguments)}),function(i){return Un(i,n).value[t]}}var R7=q(()=>{ia()});function gd(e,t){var r;return(typeof t=="number"?Rr:t instanceof Go?C1:(r=Go(t))?(t=r,C1):S7)(e,t)}var qb=q(()=>{k7();Fi()});function ate(e){return function(){this.removeAttribute(e)}}function ote(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ste(e,t,r){var n,i=r+"",a;return function(){var o=this.getAttribute(e);return o===i?null:o===n?a:a=t(n=o,r)}}function lte(e,t,r){var n,i=r+"",a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===n?a:a=t(n=o,r)}}function ute(e,t,r){var n,i,a;return function(){var o,s=r(this),l;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),l=s+"",o===l?null:o===n&&l===i?a:(i=l,a=t(n=o,s)))}}function cte(e,t,r){var n,i,a;return function(){var o,s=r(this),l;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),l=s+"",o===l?null:o===n&&l===i?a:(i=l,a=t(n=o,s)))}}function VN(e,t){var r=bs(e),n=r==="transform"?Rb:gd;return this.attrTween(e,typeof t=="function"?(r.local?cte:ute)(r,n,H0(this,"attr."+e,t)):t==null?(r.local?ote:ate)(r):(r.local?lte:ste)(r,n,t))}var $N=q(()=>{Fi();Ae();R7();qb()});function fte(e,t){return function(r){this.setAttribute(e,t.call(this,r))}}function dte(e,t){return function(r){this.setAttributeNS(e.space,e.local,t.call(this,r))}}function pte(e,t){var r,n;function i(){var a=t.apply(this,arguments);return a!==n&&(r=(n=a)&&dte(e,a)),r}return i._value=t,i}function mte(e,t){var r,n;function i(){var a=t.apply(this,arguments);return a!==n&&(r=(n=a)&&fte(e,a)),r}return i._value=t,i}function GN(e,t){var r="attr."+e;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;var n=bs(e);return this.tween(r,(n.local?pte:mte)(n,t))}var WN=q(()=>{Ae()});function hte(e,t){return function(){O7(this,e).delay=+t.apply(this,arguments)}}function gte(e,t){return t=+t,function(){O7(this,e).delay=t}}function QN(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?hte:gte)(t,e)):Un(this.node(),t).delay}var HN=q(()=>{ia()});function vte(e,t){return function(){oi(this,e).duration=+t.apply(this,arguments)}}function yte(e,t){return t=+t,function(){oi(this,e).duration=t}}function jN(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?vte:yte)(t,e)):Un(this.node(),t).duration}var YN=q(()=>{ia()});function bte(e,t){if(typeof t!="function")throw new Error;return function(){oi(this,e).ease=t}}function KN(e){var t=this._id;return arguments.length?this.each(bte(t,e)):Un(this.node(),t).ease}var XN=q(()=>{ia()});function wte(e,t){return function(){var r=t.apply(this,arguments);if(typeof r!="function")throw new Error;oi(this,e).ease=r}}function ZN(e){if(typeof e!="function")throw new Error;return this.each(wte(this._id,e))}var JN=q(()=>{ia()});function eD(e){typeof e!="function"&&(e=c7(e));for(var t=this._groups,r=t.length,n=new Array(r),i=0;i<r;++i)for(var a=t[i],o=a.length,s=n[i]=[],l,u=0;u<o;++u)(l=a[u])&&e.call(l,l.__data__,u,a)&&s.push(l);return new Oi(n,this._parents,this._name,this._id)}var tD=q(()=>{Ae();f2()});function rD(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,r=e._groups,n=t.length,i=r.length,a=Math.min(n,i),o=new Array(n),s=0;s<a;++s)for(var l=t[s],u=r[s],c=l.length,f=o[s]=new Array(c),d,m=0;m<c;++m)(d=l[m]||u[m])&&(f[m]=d);for(;s<n;++s)o[s]=t[s];return new Oi(o,this._parents,this._name,this._id)}var nD=q(()=>{f2()});function xte(e){return(e+"").trim().split(/^|\s+/).every(function(t){var r=t.indexOf(".");return r>=0&&(t=t.slice(0,r)),!t||t==="start"})}function _te(e,t,r){var n,i,a=xte(t)?O7:oi;return function(){var o=a(this,e),s=o.on;s!==n&&(i=(n=s).copy()).on(t,r),o.on=i}}function iD(e,t){var r=this._id;return arguments.length<2?Un(this.node(),r).on.on(e):this.each(_te(r,e,t))}var aD=q(()=>{ia()});function kte(e){return function(){var t=this.parentNode;for(var r in this.__transition)if(+r!==e)return;t&&t.removeChild(this)}}function oD(){return this.on("end.remove",kte(this._id))}var sD=q(()=>{});function lD(e){var t=this._name,r=this._id;typeof e!="function"&&(e=a2(e));for(var n=this._groups,i=n.length,a=new Array(i),o=0;o<i;++o)for(var s=n[o],l=s.length,u=a[o]=new Array(l),c,f,d=0;d<l;++d)(c=s[d])&&(f=e.call(c,c.__data__,d,s))&&("__data__"in c&&(f.__data__=c.__data__),u[d]=f,T4(u[d],t,r,d,u,Un(c,r)));return new Oi(a,this._parents,t,r)}var uD=q(()=>{Ae();f2();ia()});function cD(e){var t=this._name,r=this._id;typeof e!="function"&&(e=u7(e));for(var n=this._groups,i=n.length,a=[],o=[],s=0;s<i;++s)for(var l=n[s],u=l.length,c,f=0;f<u;++f)if(c=l[f]){for(var d=e.call(c,c.__data__,f,l),m,h=Un(c,r),g=0,A=d.length;g<A;++g)(m=d[g])&&T4(m,t,r,g,d,h);a.push(d),o.push(c)}return new Oi(a,o,t,r)}var fD=q(()=>{Ae();f2();ia()});function dD(){return new Ete(this._groups,this._parents)}var Ete,pD=q(()=>{Ae();Ete=Vo.prototype.constructor});function Ate(e,t){var r,n,i;return function(){var a=C4(this,e),o=(this.style.removeProperty(e),C4(this,e));return a===o?null:a===r&&o===n?i:i=t(r=a,n=o)}}function mD(e){return function(){this.style.removeProperty(e)}}function Ste(e,t,r){var n,i=r+"",a;return function(){var o=C4(this,e);return o===i?null:o===n?a:a=t(n=o,r)}}function Cte(e,t,r){var n,i,a;return function(){var o=C4(this,e),s=r(this),l=s+"";return s==null&&(l=s=(this.style.removeProperty(e),C4(this,e))),o===l?null:o===n&&l===i?a:(i=l,a=t(n=o,s))}}function Ite(e,t){var r,n,i,a="style."+t,o="end."+a,s;return function(){var l=oi(this,e),u=l.on,c=l.value[a]==null?s||(s=mD(t)):void 0;(u!==r||i!==c)&&(n=(r=u).copy()).on(o,i=c),l.on=n}}function hD(e,t,r){var n=(e+="")=="transform"?Ob:gd;return t==null?this.styleTween(e,Ate(e,n)).on("end.style."+e,mD(e)):typeof t=="function"?this.styleTween(e,Cte(e,n,H0(this,"style."+e,t))).each(Ite(this._id,e)):this.styleTween(e,Ste(e,n,t),r).on("end.style."+e,null)}var gD=q(()=>{Fi();Ae();ia();R7();qb()});function Mte(e,t,r){return function(n){this.style.setProperty(e,t.call(this,n),r)}}function Tte(e,t,r){var n,i;function a(){var o=t.apply(this,arguments);return o!==i&&(n=(i=o)&&Mte(e,o,r)),n}return a._value=t,a}function vD(e,t,r){var n="style."+(e+="");if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,Tte(e,t,r==null?"":r))}var yD=q(()=>{});function Nte(e){return function(){this.textContent=e}}function Dte(e){return function(){var t=e(this);this.textContent=t==null?"":t}}function bD(e){return this.tween("text",typeof e=="function"?Dte(H0(this,"text",e)):Nte(e==null?"":e+""))}var wD=q(()=>{R7()});function Pte(e){return function(t){this.textContent=e.call(this,t)}}function Fte(e){var t,r;function n(){var i=e.apply(this,arguments);return i!==r&&(t=(r=i)&&Pte(i)),t}return n._value=e,n}function xD(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Fte(e))}var _D=q(()=>{});function kD(){for(var e=this._name,t=this._id,r=vd(),n=this._groups,i=n.length,a=0;a<i;++a)for(var o=n[a],s=o.length,l,u=0;u<s;++u)if(l=o[u]){var c=Un(l,t);T4(l,e,r,u,o,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Oi(n,this._parents,e,r)}var ED=q(()=>{f2();ia()});function AD(){var e,t,r=this,n=r._id,i=r.size();return new Promise(function(a,o){var s={value:o},l={value:function(){--i===0&&a()}};r.each(function(){var u=oi(this,n),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),u.on=t}),i===0&&a()})}var SD=q(()=>{ia()});function Oi(e,t,r,n){this._groups=e,this._parents=t,this._name=r,this._id=n}function CD(e){return Vo().transition(e)}function vd(){return++Ote}var Ote,ws,f2=q(()=>{Ae();$N();WN();HN();YN();XN();JN();tD();nD();aD();sD();uD();fD();pD();gD();yD();wD();_D();ED();R7();SD();Ote=0;ws=Vo.prototype;Oi.prototype=CD.prototype={constructor:Oi,select:lD,selectAll:cD,selectChild:ws.selectChild,selectChildren:ws.selectChildren,filter:eD,merge:rD,selection:dD,transition:kD,call:ws.call,nodes:ws.nodes,node:ws.node,size:ws.size,empty:ws.empty,each:ws.each,on:iD,attr:VN,attrTween:GN,style:hD,styleTween:vD,text:bD,textTween:xD,remove:oD,tween:qN,delay:QN,duration:jN,ease:KN,easeVarying:ZN,end:AD,[Symbol.iterator]:ws[Symbol.iterator]}});var L7,ID=q(()=>{L7=e=>+e});function yd(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var MD=q(()=>{});var U7=q(()=>{ID();MD()});function Lte(e,t){for(var r;!(r=e.__transition)||!(r=r[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return r}function TD(e){var t,r;e instanceof Oi?(t=e._id,e=e._name):(t=vd(),(r=Rte).time=P7(),e=e==null?null:e+"");for(var n=this._groups,i=n.length,a=0;a<i;++a)for(var o=n[a],s=o.length,l,u=0;u<s;++u)(l=o[u])&&T4(l,e,t,u,o,r||Lte(l,t));return new Oi(n,this._parents,e,t)}var Rte,ND=q(()=>{f2();ia();U7();c2();Rte={time:null,delay:0,duration:250,ease:yd}});var DD=q(()=>{Ae();zN();ND();Vo.prototype.interrupt=BN;Vo.prototype.transition=TD});var B7=q(()=>{DD();zb()});var z7,PD=q(()=>{z7=e=>()=>e});function Vb(e,{sourceEvent:t,target:r,transform:n,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:n,enumerable:!0,configurable:!0},_:{value:i}})}var FD=q(()=>{});function Ri(e,t,r){this.k=e,this.x=t,this.y=r}function $b(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Qr;return e.__zoom}var Qr,bd=q(()=>{Ri.prototype={constructor:Ri,scale:function(e){return e===1?this:new Ri(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ri(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};Qr=new Ri(1,0,0);$b.prototype=Ri.prototype});function wd(e){e.stopImmediatePropagation()}function j0(e){e.preventDefault(),e.stopImmediatePropagation()}var OD=q(()=>{});function Ute(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Bte(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function RD(){return this.__zoom||Qr}function zte(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function qte(){return navigator.maxTouchPoints||"ontouchstart"in this}function Vte(e,t,r){var n=e.invertX(t[0][0])-r[0][0],i=e.invertX(t[1][0])-r[1][0],a=e.invertY(t[0][1])-r[0][1],o=e.invertY(t[1][1])-r[1][1];return e.translate(i>n?(n+i)/2:Math.min(0,n)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function Qo(){var e=Ute,t=Bte,r=Vte,n=zte,i=qte,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,l=C7,u=xe("start","zoom","end"),c,f,d,m=500,h=150,g=0,A=10;function v(D){D.property("__zoom",RD).on("wheel.zoom",b,{passive:!1}).on("mousedown.zoom",y).on("dblclick.zoom",E).filter(i).on("touchstart.zoom",M).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}v.transform=function(D,O,L,P){var U=D.selection?D.selection():D;U.property("__zoom",RD),D!==U?x(D,O,L,P):U.interrupt().each(function(){S(this,arguments).event(P).start().zoom(null,typeof O=="function"?O.apply(this,arguments):O).end()})},v.scaleBy=function(D,O,L,P){v.scaleTo(D,function(){var U=this.__zoom.k,B=typeof O=="function"?O.apply(this,arguments):O;return U*B},L,P)},v.scaleTo=function(D,O,L,P){v.transform(D,function(){var U=t.apply(this,arguments),B=this.__zoom,z=L==null?k(U):typeof L=="function"?L.apply(this,arguments):L,V=B.invert(z),G=typeof O=="function"?O.apply(this,arguments):O;return r(w(_(B,G),z,V),U,o)},L,P)},v.translateBy=function(D,O,L,P){v.transform(D,function(){return r(this.__zoom.translate(typeof O=="function"?O.apply(this,arguments):O,typeof L=="function"?L.apply(this,arguments):L),t.apply(this,arguments),o)},null,P)},v.translateTo=function(D,O,L,P,U){v.transform(D,function(){var B=t.apply(this,arguments),z=this.__zoom,V=P==null?k(B):typeof P=="function"?P.apply(this,arguments):P;return r(Qr.translate(V[0],V[1]).scale(z.k).translate(typeof O=="function"?-O.apply(this,arguments):-O,typeof L=="function"?-L.apply(this,arguments):-L),B,o)},P,U)};function _(D,O){return O=Math.max(a[0],Math.min(a[1],O)),O===D.k?D:new Ri(O,D.x,D.y)}function w(D,O,L){var P=O[0]-L[0]*D.k,U=O[1]-L[1]*D.k;return P===D.x&&U===D.y?D:new Ri(D.k,P,U)}function k(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function x(D,O,L,P){D.on("start.zoom",function(){S(this,arguments).event(P).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(P).end()}).tween("zoom",function(){var U=this,B=arguments,z=S(U,B).event(P),V=t.apply(U,B),G=L==null?k(V):typeof L=="function"?L.apply(U,B):L,W=Math.max(V[1][0]-V[0][0],V[1][1]-V[0][1]),Y=U.__zoom,J=typeof O=="function"?O.apply(U,B):O,oe=l(Y.invert(G).concat(W/Y.k),J.invert(G).concat(W/J.k));return function(Ce){if(Ce===1)Ce=J;else{var se=oe(Ce),ne=W/se[2];Ce=new Ri(ne,G[0]-se[0]*ne,G[1]-se[1]*ne)}z.zoom(null,Ce)}})}function S(D,O,L){return!L&&D.__zooming||new I(D,O)}function I(D,O){this.that=D,this.args=O,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,O),this.taps=0}I.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,O){return this.mouse&&D!=="mouse"&&(this.mouse[1]=O.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=O.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=O.invert(this.touch1[0])),this.that.__zoom=O,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var O=Q(this.that).datum();u.call(D,this.that,new Vb(D,{sourceEvent:this.sourceEvent,target:v,type:D,transform:this.that.__zoom,dispatch:u}),O)}};function b(D,...O){if(!e.apply(this,arguments))return;var L=S(this,O).event(D),P=this.__zoom,U=Math.max(a[0],Math.min(a[1],P.k*Math.pow(2,n.apply(this,arguments)))),B=so(D);if(L.wheel)(L.mouse[0][0]!==B[0]||L.mouse[0][1]!==B[1])&&(L.mouse[1]=P.invert(L.mouse[0]=B)),clearTimeout(L.wheel);else{if(P.k===U)return;L.mouse=[B,P.invert(B)],Wo(this),L.start()}j0(D),L.wheel=setTimeout(z,h),L.zoom("mouse",r(w(_(P,U),L.mouse[0],L.mouse[1]),L.extent,o));function z(){L.wheel=null,L.end()}}function y(D,...O){if(d||!e.apply(this,arguments))return;var L=D.currentTarget,P=S(this,O,!0).event(D),U=Q(D.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",W,!0),B=so(D,L),z=D.clientX,V=D.clientY;m7(D.view),wd(D),P.mouse=[B,this.__zoom.invert(B)],Wo(this),P.start();function G(Y){if(j0(Y),!P.moved){var J=Y.clientX-z,oe=Y.clientY-V;P.moved=J*J+oe*oe>g}P.event(Y).zoom("mouse",r(w(P.that.__zoom,P.mouse[0]=so(Y,L),P.mouse[1]),P.extent,o))}function W(Y){U.on("mousemove.zoom mouseup.zoom",null),h7(Y.view,P.moved),j0(Y),P.event(Y).end()}}function E(D,...O){if(e.apply(this,arguments)){var L=this.__zoom,P=so(D.changedTouches?D.changedTouches[0]:D,this),U=L.invert(P),B=L.k*(D.shiftKey?.5:2),z=r(w(_(L,B),P,U),t.apply(this,O),o);j0(D),s>0?Q(this).transition().duration(s).call(x,z,P,D):Q(this).call(v.transform,z,P,D)}}function M(D,...O){if(e.apply(this,arguments)){var L=D.touches,P=L.length,U=S(this,O,D.changedTouches.length===P).event(D),B,z,V,G;for(wd(D),z=0;z<P;++z)V=L[z],G=so(V,this),G=[G,this.__zoom.invert(G),V.identifier],U.touch0?!U.touch1&&U.touch0[2]!==G[2]&&(U.touch1=G,U.taps=0):(U.touch0=G,B=!0,U.taps=1+!!c);c&&(c=clearTimeout(c)),B&&(U.taps<2&&(f=G[0],c=setTimeout(function(){c=null},m)),Wo(this),U.start())}}function F(D,...O){if(this.__zooming){var L=S(this,O).event(D),P=D.changedTouches,U=P.length,B,z,V,G;for(j0(D),B=0;B<U;++B)z=P[B],V=so(z,this),L.touch0&&L.touch0[2]===z.identifier?L.touch0[0]=V:L.touch1&&L.touch1[2]===z.identifier&&(L.touch1[0]=V);if(z=L.that.__zoom,L.touch1){var W=L.touch0[0],Y=L.touch0[1],J=L.touch1[0],oe=L.touch1[1],Ce=(Ce=J[0]-W[0])*Ce+(Ce=J[1]-W[1])*Ce,se=(se=oe[0]-Y[0])*se+(se=oe[1]-Y[1])*se;z=_(z,Math.sqrt(Ce/se)),V=[(W[0]+J[0])/2,(W[1]+J[1])/2],G=[(Y[0]+oe[0])/2,(Y[1]+oe[1])/2]}else if(L.touch0)V=L.touch0[0],G=L.touch0[1];else return;L.zoom("touch",r(w(z,V,G),L.extent,o))}}function N(D,...O){if(this.__zooming){var L=S(this,O).event(D),P=D.changedTouches,U=P.length,B,z;for(wd(D),d&&clearTimeout(d),d=setTimeout(function(){d=null},m),B=0;B<U;++B)z=P[B],L.touch0&&L.touch0[2]===z.identifier?delete L.touch0:L.touch1&&L.touch1[2]===z.identifier&&delete L.touch1;if(L.touch1&&!L.touch0&&(L.touch0=L.touch1,delete L.touch1),L.touch0)L.touch0[1]=this.__zoom.invert(L.touch0[0]);else if(L.end(),L.taps===2&&(z=so(z,this),Math.hypot(f[0]-z[0],f[1]-z[1])<A)){var V=Q(this).on("dblclick.zoom");V&&V.apply(this,arguments)}}}return v.wheelDelta=function(D){return arguments.length?(n=typeof D=="function"?D:z7(+D),v):n},v.filter=function(D){return arguments.length?(e=typeof D=="function"?D:z7(!!D),v):e},v.touchable=function(D){return arguments.length?(i=typeof D=="function"?D:z7(!!D),v):i},v.extent=function(D){return arguments.length?(t=typeof D=="function"?D:z7([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),v):t},v.scaleExtent=function(D){return arguments.length?(a[0]=+D[0],a[1]=+D[1],v):[a[0],a[1]]},v.translateExtent=function(D){return arguments.length?(o[0][0]=+D[0][0],o[1][0]=+D[1][0],o[0][1]=+D[0][1],o[1][1]=+D[1][1],v):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},v.constrain=function(D){return arguments.length?(r=D,v):r},v.duration=function(D){return arguments.length?(s=+D,v):s},v.interpolate=function(D){return arguments.length?(l=D,v):l},v.on=function(){var D=u.on.apply(u,arguments);return D===u?v:D},v.clickDistance=function(D){return arguments.length?(g=(D=+D)*D,v):Math.sqrt(g)},v.tapDistance=function(D){return arguments.length?(A=+D,v):A},v}var LD=q(()=>{Ye();b7();Fi();Ae();B7();PD();FD();bd();OD()});var xs=q(()=>{LD();bd()});var UD={};j(UD,{geoRawMercator:()=>si});function si(){let e=y4,t=512/Math.PI,r=0,n=0,i=[[0,0],[0,0]];function a(o){return o=e(o[0]*Math.PI/180,o[1]*Math.PI/180),[o[0]*t+r,n-o[1]*t]}return a.invert=function(o){return o=e.invert((o[0]-r)/t,(n-o[1])/t),o&&[o[0]*180/Math.PI,o[1]*180/Math.PI]},a.scale=function(o){return arguments.length?(t=+o,a):t},a.translate=function(o){return arguments.length?(r=+o[0],n=+o[1],a):[r,n]},a.clipExtent=function(o){return arguments.length?(i=o,a):i},a.transform=function(o){return arguments.length?(r=+o.x,n=+o.y,t=+o.k,a):Qr.translate(r,n).scale(t)},a.stream=ib({point:function(o,s){let l=a([o,s]);this.stream.point(l[0],l[1])}}).stream,a}var xd=q(()=>{"use strict";Ta();xs()});var zD={};j(zD,{geoOrthoCalcScore:()=>Y0,geoOrthoCanOrthogonalize:()=>N4,geoOrthoMaxOffsetAngle:()=>_d,geoOrthoNormalizedDotProduct:()=>_s});function _s(e,t,r){return zr(r,e)||zr(r,t)?1:k4(e,t,r)}function BD(e,t,r,n,i){var a=Math.abs(e);return a<t||i&&Math.abs(a-1)<t?0:a<r||a>n?e:null}function Y0(e,t,r,n){for(var i=0,a=t?0:1,o=t?e.length:e.length-1,s=e.map(function(g){return g.coord}),l=Math.cos((90-n)*Math.PI/180),u=Math.cos(n*Math.PI/180),c=a;c<o;c++){var f=s[(c-1+s.length)%s.length],d=s[c],m=s[(c+1)%s.length],h=BD(_s(f,m,d),r,l,u);h!==null&&(i=i+2*Math.min(Math.abs(h-1),Math.min(Math.abs(h),Math.abs(h+1))))}return i}function _d(e,t,r){for(var n=-1/0,i=t?0:1,a=t?e.length:e.length-1,o=i;o<a;o++){var s=e[(o-1+e.length)%e.length],l=e[o],u=e[(o+1)%e.length],c=_s(s,u,l),f=Math.acos(Math.abs(c))*180/Math.PI;f>45&&(f=90-f),!(f>=r)&&f>n&&(n=f)}return n===-1/0?null:n}function N4(e,t,r,n,i){for(var a=null,o=t?0:1,s=t?e.length:e.length-1,l=Math.cos((90-n)*Math.PI/180),u=Math.cos(n*Math.PI/180),c=o;c<s;c++){var f=e[(c-1+e.length)%e.length],d=e[c],m=e[(c+1)%e.length],h=BD(_s(f,m,d),r,l,u,i);if(h!==null){if(Math.abs(h)>0)return 1;a=0}}return a}var d2=q(()=>{"use strict";cn()});var qD={};j(qD,{geoAngle:()=>fn,geoChooseEdge:()=>_n,geoEdgeEqual:()=>q0,geoExtent:()=>Me,geoGetSmallestSurroundingRectangle:()=>S4,geoHasLineIntersections:()=>V0,geoHasSelfIntersections:()=>ta,geoLatToMeters:()=>i2,geoLineIntersection:()=>ra,geoLonToMeters:()=>vs,geoMetersToLat:()=>Ln,geoMetersToLon:()=>xn,geoMetersToOffset:()=>b4,geoOffsetToMeters:()=>w4,geoOrthoCalcScore:()=>Y0,geoOrthoCanOrthogonalize:()=>N4,geoOrthoMaxOffsetAngle:()=>_d,geoOrthoNormalizedDotProduct:()=>_s,geoPathHasIntersections:()=>s7,geoPathIntersections:()=>E4,geoPathLength:()=>qo,geoPointInPolygon:()=>io,geoPolygonContainsPolygon:()=>A4,geoPolygonIntersectsPolygon:()=>ao,geoRawMercator:()=>si,geoRotate:()=>E1,geoScaleToZoom:()=>Yt,geoSphericalClosestNode:()=>x4,geoSphericalDistance:()=>wt,geoVecAdd:()=>qr,geoVecAngle:()=>no,geoVecCross:()=>k1,geoVecDot:()=>bi,geoVecEqual:()=>zr,geoVecFloor:()=>Gf,geoVecInterp:()=>Qt,geoVecLength:()=>ft,geoVecLengthSquare:()=>_4,geoVecNormalize:()=>_1,geoVecNormalizedDot:()=>k4,geoVecProject:()=>z0,geoVecScale:()=>Na,geoVecSubtract:()=>Bt,geoViewportEdge:()=>A1,geoZoomToScale:()=>Mn});var He=q(()=>{"use strict";w1();yi();yi();yi();yi();yi();yi();yi();yi();yi();yi();Qn();Qn();Qn();Qn();Qn();Qn();Qn();Qn();Qn();Qn();Qn();Qn();Qn();Qn();Qn();xd();cn();cn();cn();cn();cn();cn();cn();cn();cn();cn();cn();cn();cn();cn();d2();d2();d2();d2()});var $D={};j($D,{allowUpperCaseTagValues:()=>q7,isColourValid:()=>jo,osmAreaKeys:()=>Ho,osmAreaKeysExceptions:()=>K0,osmFlowingWaterwayTagValues:()=>F4,osmIsInterestingTag:()=>I1,osmLifecyclePrefixes:()=>M1,osmLineTags:()=>VD,osmMutuallyExclusiveTagPairs:()=>Hb,osmNodeGeometriesForTags:()=>N1,osmOneWayBackwardTags:()=>Ed,osmOneWayBiDirectionalTags:()=>Ad,osmOneWayForwardTags:()=>kd,osmOneWayTags:()=>Wb,osmPathHighwayTagValues:()=>uo,osmPavedTags:()=>m2,osmPointTags:()=>D4,osmRailwayTrackTagValues:()=>t3,osmRemoveLifecyclePrefix:()=>p2,osmRightSideIsInsideTags:()=>e3,osmRoutableAerowayTags:()=>Qb,osmRoutableHighwayTagValues:()=>aa,osmSemipavedTags:()=>Sd,osmSetAreaKeys:()=>X0,osmSetLineTags:()=>Gb,osmSetPointTags:()=>Z0,osmSetVertexTags:()=>J0,osmShouldRenderDirection:()=>jb,osmTagSuggestingArea:()=>T1,osmVertexTags:()=>P4});import{merge as $te}from"lodash-es";function I1(e){return e!=="attribution"&&e!=="created_by"&&e!=="source"&&e!=="odbl"&&e.indexOf("source:")!==0&&e.indexOf("source_ref")!==0&&e.indexOf("tiger:")!==0}function p2(e){let t=e.split(":");return t.length===1?e:t[0]in M1?e.slice(t[0].length+1):e}function X0(e){Ho=e}function T1(e){if(e.area==="yes")return{area:"yes"};if(e.area==="no")return null;var t={};for(var r in e){let n=p2(r);if(n in Ho&&!(e[r]in Ho[n])||n in K0&&e[r]in K0[n])return t[r]=e[r],t}return null}function Gb(e){VD=e}function Z0(e){D4=e}function J0(e){P4=e}function N1(e){var t={};for(var r in e)if(D4[r]&&(D4[r]["*"]||D4[r][e[r]])&&(t.point=!0),P4[r]&&(P4[r]["*"]||P4[r][e[r]])&&(t.vertex=!0),t.point&&t.vertex)break;return t}function jo(e){return!(!e.match(/^(#([0-9a-fA-F]{3}){1,2}|\w+)$/)||!CSS.supports("color",e)||["unset","inherit","initial","revert"].includes(e))}function jb(e,t){return e.highway||e.traffic_sign||e.traffic_calming||e.barrier?!!(t.highway||t.railway):e.railway?!!t.railway:e.waterway?!!t.waterway:e.cycleway==="asl"?!!t.highway:!0}var M1,Ho,K0,VD,D4,P4,kd,Ed,Ad,Wb,m2,Sd,e3,aa,Qb,uo,t3,F4,q7,Hb,Dr=q(()=>{"use strict";M1={proposed:!0,planned:!0,construction:!0,disused:!0,abandoned:!0,was:!0,dismantled:!0,razed:!0,demolished:!0,destroyed:!0,removed:!0,obliterated:!0,intermittent:!0};Ho={};K0={highway:{elevator:!0,rest_area:!0,services:!0},public_transport:{platform:!0},railway:{platform:!0,roundhouse:!0,station:!0,traverser:!0,turntable:!0,wash:!0,ventilation_shaft:!0},waterway:{dam:!0},amenity:{bicycle_parking:!0}};VD={};D4={};P4={};kd={aerialway:{chair_lift:!0,drag_lift:!0,"j-bar":!0,magic_carpet:!0,mixed_lift:!0,platter:!0,rope_tow:!0,"t-bar":!0,zip_line:!0},conveying:{forward:!0},highway:{motorway:!0},junction:{circular:!0,roundabout:!0},man_made:{goods_conveyor:!0,"piste:halfpipe":!0},oneway:{yes:!0},"piste:type":{downhill:!0,sled:!0,yes:!0},"seamark:type":{"two-way_route":!0,recommended_traffic_lane:!0,separation_lane:!0,separation_roundabout:!0},waterway:{canal:!0,ditch:!0,drain:!0,fish_pass:!0,flowline:!0,pressurised:!0,river:!0,spillway:!0,stream:!0,tidal_channel:!0}},Ed={conveying:{backward:!0},oneway:{"-1":!0}},Ad={conveying:{reversible:!0},oneway:{alternating:!0,reversible:!0}},Wb=$te(kd,Ed,Ad),m2={surface:{paved:!0,asphalt:!0,concrete:!0,chipseal:!0,"concrete:lanes":!0,"concrete:plates":!0},tracktype:{grade1:!0}},Sd={surface:{cobblestone:!0,"cobblestone:flattened":!0,unhewn_cobblestone:!0,sett:!0,paving_stones:!0,metal:!0,wood:!0}},e3={natural:{cliff:!0,coastline:"coastline"},barrier:{retaining_wall:!0,kerb:!0,guard_rail:!0,city_wall:!0},man_made:{embankment:!0,quay:!0},waterway:{weir:!0}},aa={motorway:!0,trunk:!0,primary:!0,secondary:!0,tertiary:!0,residential:!0,motorway_link:!0,trunk_link:!0,primary_link:!0,secondary_link:!0,tertiary_link:!0,unclassified:!0,road:!0,service:!0,track:!0,living_street:!0,bus_guideway:!0,busway:!0,path:!0,footway:!0,cycleway:!0,bridleway:!0,pedestrian:!0,corridor:!0,steps:!0,ladder:!0},Qb={runway:!0,taxiway:!0},uo={path:!0,footway:!0,cycleway:!0,bridleway:!0,pedestrian:!0,corridor:!0,steps:!0,ladder:!0},t3={rail:!0,light_rail:!0,tram:!0,subway:!0,monorail:!0,funicular:!0,miniature:!0,narrow_gauge:!0,disused:!0,preserved:!0},F4={canal:!0,ditch:!0,drain:!0,fish_pass:!0,flowline:!0,river:!0,stream:!0,tidal_channel:!0},q7=/network|taxon|genus|species|brand|grape_variety|royal_cypher|listed_status|booth|rating|stars|:output|_hours|_times|_ref|manufacturer|country|target|brewery|cai_scale|traffic_sign/;Hb=[["noname","name"],["noref","ref"],["nohousenumber","addr:housenumber"],["noaddress","addr:housenumber"],["noaddress","addr:housename"],["noaddress","addr:unit"],["addr:nostreet","addr:street"]]});var GD={};j(GD,{utilArrayChunk:()=>ks,utilArrayDifference:()=>yr,utilArrayFlatten:()=>D1,utilArrayGroupBy:()=>pr,utilArrayIdentical:()=>dn,utilArrayIntersection:()=>Cr,utilArrayUnion:()=>Ht,utilArrayUniq:()=>Je,utilArrayUniqBy:()=>P1});function dn(e,t){if(e===t)return!0;var r=e.length;if(r!==t.length)return!1;for(;r--;)if(e[r]!==t[r])return!1;return!0}function yr(e,t){var r=new Set(t);return Array.from(new Set(e)).filter(function(n){return!r.has(n)})}function Cr(e,t){var r=new Set(t);return Array.from(new Set(e)).filter(function(n){return r.has(n)})}function Ht(e,t){var r=new Set(e);return t.forEach(function(n){r.add(n)}),Array.from(r)}function Je(e){return Array.from(new Set(e))}function ks(e,t){if(!t||t<0)return[e.slice()];var r=new Array(Math.ceil(e.length/t));return Array.from(r,function(n,i){return e.slice(i*t,i*t+t)})}function D1(e){return e.reduce(function(t,r){return t.concat(r)},[])}function pr(e,t){return e.reduce(function(r,n){var i=typeof t=="function"?t(n):n[t];return(r[i]=r[i]||[]).push(n),r},{})}function P1(e,t){var r=new Set;return e.reduce(function(n,i){var a=typeof t=="function"?t(i):i[t];return a&&!r.has(a)&&(r.add(a),n.push(i)),n},[])}var Mr=q(()=>{"use strict"});var Td=an(Md=>{Md.remove=Gte;var Id=[{base:" ",chars:"\xA0"},{base:"0",chars:"\u07C0"},{base:"A",chars:"\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"},{base:"AA",chars:"\uA732"},{base:"AE",chars:"\xC6\u01FC\u01E2"},{base:"AO",chars:"\uA734"},{base:"AU",chars:"\uA736"},{base:"AV",chars:"\uA738\uA73A"},{base:"AY",chars:"\uA73C"},{base:"B",chars:"\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0181"},{base:"C",chars:"\u24B8\uFF23\uA73E\u1E08\u0106C\u0108\u010A\u010C\xC7\u0187\u023B"},{base:"D",chars:"\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018A\u0189\u1D05\uA779"},{base:"Dh",chars:"\xD0"},{base:"DZ",chars:"\u01F1\u01C4"},{base:"Dz",chars:"\u01F2\u01C5"},{base:"E",chars:"\u025B\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E\u1D07"},{base:"F",chars:"\uA77C\u24BB\uFF26\u1E1E\u0191\uA77B"},{base:"G",chars:"\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E\u0262"},{base:"H",chars:"\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"},{base:"I",chars:"\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"},{base:"J",chars:"\u24BF\uFF2A\u0134\u0248\u0237"},{base:"K",chars:"\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"},{base:"L",chars:"\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"},{base:"LJ",chars:"\u01C7"},{base:"Lj",chars:"\u01C8"},{base:"M",chars:"\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C\u03FB"},{base:"N",chars:"\uA7A4\u0220\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u019D\uA790\u1D0E"},{base:"NJ",chars:"\u01CA"},{base:"Nj",chars:"\u01CB"},{base:"O",chars:"\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"},{base:"OE",chars:"\u0152"},{base:"OI",chars:"\u01A2"},{base:"OO",chars:"\uA74E"},{base:"OU",chars:"\u0222"},{base:"P",chars:"\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"},{base:"Q",chars:"\u24C6\uFF31\uA756\uA758\u024A"},{base:"R",chars:"\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"},{base:"S",chars:"\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"},{base:"T",chars:"\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"},{base:"Th",chars:"\xDE"},{base:"TZ",chars:"\uA728"},{base:"U",chars:"\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"},{base:"V",chars:"\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"},{base:"VY",chars:"\uA760"},{base:"W",chars:"\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"},{base:"X",chars:"\u24CD\uFF38\u1E8A\u1E8C"},{base:"Y",chars:"\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"},{base:"Z",chars:"\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"},{base:"a",chars:"\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250\u0251"},{base:"aa",chars:"\uA733"},{base:"ae",chars:"\xE6\u01FD\u01E3"},{base:"ao",chars:"\uA735"},{base:"au",chars:"\uA737"},{base:"av",chars:"\uA739\uA73B"},{base:"ay",chars:"\uA73D"},{base:"b",chars:"\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253\u0182"},{base:"c",chars:"\uFF43\u24D2\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"},{base:"d",chars:"\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\u018B\u13E7\u0501\uA7AA"},{base:"dh",chars:"\xF0"},{base:"dz",chars:"\u01F3\u01C6"},{base:"e",chars:"\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u01DD"},{base:"f",chars:"\u24D5\uFF46\u1E1F\u0192"},{base:"ff",chars:"\uFB00"},{base:"fi",chars:"\uFB01"},{base:"fl",chars:"\uFB02"},{base:"ffi",chars:"\uFB03"},{base:"ffl",chars:"\uFB04"},{base:"g",chars:"\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\uA77F\u1D79"},{base:"h",chars:"\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"},{base:"hv",chars:"\u0195"},{base:"i",chars:"\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"},{base:"j",chars:"\u24D9\uFF4A\u0135\u01F0\u0249"},{base:"k",chars:"\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"},{base:"l",chars:"\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747\u026D"},{base:"lj",chars:"\u01C9"},{base:"m",chars:"\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"},{base:"n",chars:"\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5\u043B\u0509"},{base:"nj",chars:"\u01CC"},{base:"o",chars:"\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\uA74B\uA74D\u0275\u0254\u1D11"},{base:"oe",chars:"\u0153"},{base:"oi",chars:"\u01A3"},{base:"oo",chars:"\uA74F"},{base:"ou",chars:"\u0223"},{base:"p",chars:"\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755\u03C1"},{base:"q",chars:"\u24E0\uFF51\u024B\uA757\uA759"},{base:"r",chars:"\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"},{base:"s",chars:"\u24E2\uFF53\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B\u0282"},{base:"ss",chars:"\xDF"},{base:"t",chars:"\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"},{base:"th",chars:"\xFE"},{base:"tz",chars:"\uA729"},{base:"u",chars:"\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"},{base:"v",chars:"\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"},{base:"vy",chars:"\uA761"},{base:"w",chars:"\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"},{base:"x",chars:"\u24E7\uFF58\u1E8B\u1E8D"},{base:"y",chars:"\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"},{base:"z",chars:"\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"}],Kb={};for(V7=0;V7<Id.length;V7+=1)for(Yb=Id[V7].chars,Cd=0;Cd<Yb.length;Cd+=1)Kb[Yb[Cd]]=Id[V7].base;var Yb,Cd,V7;function Gte(e){return e.replace(/[^\u0000-\u007e]/g,function(t){return Kb[t]||t})}Md.replacementList=Id;Md.diacriticsMap=Kb});var WD={};j(WD,{fixRTLTextForSvg:()=>Xb,rtlRegex:()=>Nd});import{WordShaper as Wte}from"alif-toolkit";function Xb(e){var t="",r=[],n=/[\u0600-\u06FF]/g,i=/[\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06ED]/g,a=/[\u0660-\u066C\u06F0-\u06F9]+/g,o=/[\u07A6-\u07B0]/,s=/[\u0591-\u05bd\u05bf\u05c1-\u05c5\u05c7]/;n.test(e)&&(e=Wte(e));for(var l=0;l<e.length;l++){var u=e[l];a.test(u)?(t+=r.reverse().join(""),r=[u]):(r.length&&a.test(r[r.length-1])&&(t+=r.reverse().join(""),r=[]),(o.test(u)||s.test(u)||i.test(u))&&r.length?r[r.length-1]+=u:Nd.test(u)||u.charCodeAt(0)>=64336&&u.charCodeAt(0)<=65023||u.charCodeAt(0)>=65136&&u.charCodeAt(0)<=65279?r.push(u):u===" "&&r.length?r=[r.reverse().join("")+" "]:(t+=r.reverse().join("")+u,r=[]))}return t+=r.reverse().join(""),t}var Nd,Zb=q(()=>{"use strict";Nd=/[\u0590-\u05FF\u0600-\u06FF\u0750-\u07BF\u08A0–\u08BF]/});var Jb=an((QD,$7)=>{(function(e){"use strict";function t(n){var i=n.replace(/[^0-9.]/g,"").match(/[0-9]*\.|[0-9]+/g)||[];return n={major:+i[0]||0,minor:+i[1]||0,patch:+i[2]||0,build:+i[3]||0},n.isEmpty=!n.major&&!n.minor&&!n.patch&&!n.build,n.parsed=[n.major,n.minor,n.patch,n.build],n.text=n.parsed.join("."),n.compare=r,n}function r(n){typeof n=="string"&&(n=t(n));for(var i=0;i<4;i++)if(this.parsed[i]!==n.parsed[i])return this.parsed[i]>n.parsed[i]?1:-1;return 0}typeof $7=="object"&&$7&&typeof $7.exports=="object"?$7.exports=t:e.parseVersion=t})(QD)});var r3,G7,Dd,jD,YD,HD,h2,KD,XD,ZD,O4=q(()=>{"use strict";r3="https://cdn.jsdelivr.net/npm/@openstreetmap/id-tagging-schema@{presets_version}/",G7="https://raw.githubusercontent.com/vindagollc/kepler-map-styles/refs/heads/test-preset/proviso-ai-presets/",Dd="https://cdn.jsdelivr.net/npm/osm-community-index@{version}/",jD="https://cdn.jsdelivr.net/npm/wmf-sitematrix@{version}/",YD="https://cdn.jsdelivr.net/npm/name-suggestion-index@{version}/",HD={live:{url:"https://www.openstreetmap.org",apiUrl:"https://api.openstreetmap.org",client_id:"0tmNTmd0Jo1dQp4AUmMBLtGiD9YpMuXzHefitcuVStc"},dev:{url:"https://api06.dev.openstreetmap.org",client_id:"Ee1wWJ6UlpERbF6BfTNOpwn0R8k_06mvMXdDUkeHMgw"}},h2=[];h2.push(HD.live),h2.push(HD.dev);KD="https://taginfo.openstreetmap.org/api/4/",XD="https://nominatim.openstreetmap.org/",ZD=!0});var Es,Pd=q(()=>{Es={name:"gaussian-id",version:"2.34.2",description:"A friendly editor for OpenStreetMap",main:"dist/iD.min.js",type:"module",exports:{".":{import:"./dist/iD.min.js"},"./dist/iD.css":{default:"./dist/iD.css"}},files:["dist","scripts","config","svg"],repository:"github:openstreetmap/iD",homepage:"https://github.com/openstreetmap/iD",bugs:"https://github.com/openstreetmap/iD/issues",keywords:["editor","openstreetmap"],license:"ISC",scripts:{all:"run-s clean build dist",build:"run-s build:css build:data build:js","build:css":"node scripts/build_css.js","build:data":"shx mkdir -p dist/data && node scripts/build_data.js","build:stats":"node config/esbuild.config.mjs --stats && esbuild-visualizer --metadata dist/esbuild.json --exclude *.png --filename docs/statistics.html && shx rm dist/esbuild.json","build:js":"node config/esbuild.config.mjs","build:js:watch":"node config/esbuild.config.mjs --watch",clean:"shx rm -f dist/esbuild.json dist/*.js dist/*.map dist/*.css dist/img/*.svg",dist:"run-p dist:**","dist:mapillary":"shx mkdir -p dist/mapillary-js && shx cp -R node_modules/mapillary-js/dist/* dist/mapillary-js/","dist:pannellum":"shx mkdir -p dist/pannellum && shx cp -R node_modules/pannellum/build/* dist/pannellum/","dist:min":"node config/esbuild.config.min.mjs","dist:svg:iD":'svg-sprite --symbol --symbol-dest . --shape-id-generator "iD-%s" --symbol-sprite dist/img/iD-sprite.svg "svg/iD-sprite/**/*.svg"',"dist:svg:community":'svg-sprite --symbol --symbol-dest . --shape-id-generator "community-%s" --symbol-sprite dist/img/community-sprite.svg node_modules/osm-community-index/dist/img/*.svg',"dist:svg:fa":"svg-sprite --symbol --symbol-dest . --symbol-sprite dist/img/fa-sprite.svg svg/fontawesome/*.svg","dist:svg:maki":'svg-sprite --symbol --symbol-dest . --shape-id-generator "maki-%s" --symbol-sprite dist/img/maki-sprite.svg node_modules/@mapbox/maki/icons/*.svg',"dist:svg:mapillary:signs":"svg-sprite --symbol --symbol-dest . --symbol-sprite dist/img/mapillary-sprite.svg node_modules/@rapideditor/mapillary_sprite_source/package_signs/*.svg","dist:svg:mapillary:objects":"svg-sprite --symbol --symbol-dest . --symbol-sprite dist/img/mapillary-object-sprite.svg node_modules/@rapideditor/mapillary_sprite_source/package_objects/*.svg","dist:svg:roentgen":'svg-sprite --shape-id-generator "roentgen-%s" --shape-dim-width 16 --shape-dim-height 16 --symbol --symbol-dest . --symbol-sprite dist/img/roentgen-sprite.svg svg/roentgen/*.svg',"dist:svg:temaki":'svg-sprite --symbol --symbol-dest . --shape-id-generator "temaki-%s" --symbol-sprite dist/img/temaki-sprite.svg node_modules/@rapideditor/temaki/icons/*.svg',imagery:"node scripts/update_imagery.js",lint:"eslint config scripts test/spec modules","lint:fix":"eslint scripts test/spec modules --fix",start:"run-s start:watch","start:single-build":"run-p build:js start:server","start:watch":"run-p build:js:watch start:server","start:server":"node scripts/server.js",test:"npm-run-all -s lint build test:spec","test:spec":"vitest --no-isolate",translations:"node scripts/update_locales.js",prepublishOnly:"npm run build && cp README.md LICENSE.md dist/ || true"},dependencies:{"@mapbox/geojson-area":"^0.2.2","@mapbox/sexagesimal":"1.2.0","@mapbox/vector-tile":"^2.0.3","@rapideditor/country-coder":"~5.3.1","@rapideditor/location-conflation":"~1.4.1","@tmcw/togeojson":"^7.0.0","@turf/bbox":"^7.2.0","@turf/bbox-clip":"^7.2.0","abortcontroller-polyfill":"^1.7.8","aes-js":"^3.1.2","alif-toolkit":"^1.3.0","core-js-bundle":"^3.41.0",diacritics:"1.3.0",exifr:"^7.1.3","fast-deep-equal":"~3.1.1","fast-json-stable-stringify":"2.1.0","lodash-es":"~4.17.15",marked:"~15.0.8","node-diff3":"~3.1.0","osm-auth":"~2.6.0",pannellum:"2.5.6",pbf:"^4.0.1","polygon-clipping":"~0.15.7",rbush:"4.0.1",vitest:"^3.1.1","whatwg-fetch":"^3.6.20","which-polygon":"2.2.1"},devDependencies:{"@fortawesome/fontawesome-svg-core":"~6.7.2","@fortawesome/free-brands-svg-icons":"~6.7.2","@fortawesome/free-regular-svg-icons":"~6.7.2","@fortawesome/free-solid-svg-icons":"~6.7.2","@mapbox/maki":"^8.2.0","@openstreetmap/id-tagging-schema":"^6.10.0","@rapideditor/mapillary_sprite_source":"^1.8.0","@rapideditor/temaki":"^5.9.0","@transifex/api":"^7.1.3","@types/chai":"^5.2.1","@types/d3":"^7.4.3","@types/geojson":"^7946.0.16","@types/happen":"^0.3.0","@types/lodash-es":"^4.17.12","@types/node":"^22.14.0","@types/sinon":"^17.0.3","@types/sinon-chai":"^4.0.0",autoprefixer:"^10.4.21",browserslist:"^4.24.4","browserslist-to-esbuild":"^2.1.1",chai:"^5.2.0",chalk:"^4.1.2","cldr-core":"^47.0.0","cldr-localenames-full":"^47.0.0","concat-files":"^0.1.1",d3:"~7.9.0",dotenv:"^16.4.7","editor-layer-index":"github:osmlab/editor-layer-index#gh-pages",esbuild:"^0.25.2","esbuild-visualizer":"^0.7.0",eslint:"^9.24.0","fetch-mock":"^11.1.1",gaze:"^1.1.3",glob:"^10.4.5",happen:"^0.3.2","js-yaml":"^4.0.0",jsdom:"^26.0.0","json-stringify-pretty-compact":"^3.0.0","mapillary-js":"4.1.2",minimist:"^1.2.8","name-suggestion-index":"~6.0","netlify-cli":"^19.1.5","npm-run-all":"^4.0.0","osm-community-index":"~5.9.1",postcss:"^8.5.3","postcss-prefix-selector":"^2.1.1","serve-handler":"^6.1.6",shelljs:"^0.9.2",shx:"^0.4.0",sinon:"^11.1.2","sinon-chai":"^4.0.0",smash:"0.0","svg-sprite":"2.0.4",vparse:"~1.1.0"},engines:{node:">=18"},browserslist:["> 0.3%, last 6 major versions, not dead, Firefox ESR, maintained node versions"]}});var eP=an((ew,JD)=>{(function(e){"use strict";function t(B){return parseInt(B)===B}function r(B){if(!t(B.length))return!1;for(var z=0;z<B.length;z++)if(!t(B[z])||B[z]<0||B[z]>255)return!1;return!0}function n(B,z){if(B.buffer&&B.name==="Uint8Array")return z&&(B.slice?B=B.slice():B=Array.prototype.slice.call(B)),B;if(Array.isArray(B)){if(!r(B))throw new Error("Array contains invalid value: "+B);return new Uint8Array(B)}if(t(B.length)&&r(B))return new Uint8Array(B);throw new Error("unsupported array-like object")}function i(B){return new Uint8Array(B)}function a(B,z,V,G,W){(G!=null||W!=null)&&(B.slice?B=B.slice(G,W):B=Array.prototype.slice.call(B,G,W)),z.set(B,V)}var o=function(){function B(V){var G=[],W=0;for(V=encodeURI(V);W<V.length;){var Y=V.charCodeAt(W++);Y===37?(G.push(parseInt(V.substr(W,2),16)),W+=2):G.push(Y)}return n(G)}function z(V){for(var G=[],W=0;W<V.length;){var Y=V[W];Y<128?(G.push(String.fromCharCode(Y)),W++):Y>191&&Y<224?(G.push(String.fromCharCode((Y&31)<<6|V[W+1]&63)),W+=2):(G.push(String.fromCharCode((Y&15)<<12|(V[W+1]&63)<<6|V[W+2]&63)),W+=3)}return G.join("")}return{toBytes:B,fromBytes:z}}(),s=function(){function B(G){for(var W=[],Y=0;Y<G.length;Y+=2)W.push(parseInt(G.substr(Y,2),16));return W}var z="0123456789abcdef";function V(G){for(var W=[],Y=0;Y<G.length;Y++){var J=G[Y];W.push(z[(J&240)>>4]+z[J&15])}return W.join("")}return{toBytes:B,fromBytes:V}}(),l={16:10,24:12,32:14},u=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],c=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],f=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],d=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],m=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],h=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],g=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],A=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],v=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],_=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],k=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],x=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],S=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],I=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function b(B){for(var z=[],V=0;V<B.length;V+=4)z.push(B[V]<<24|B[V+1]<<16|B[V+2]<<8|B[V+3]);return z}var y=function(B){if(!(this instanceof y))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:n(B,!0)}),this._prepare()};y.prototype._prepare=function(){var B=l[this.key.length];if(B==null)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var z=0;z<=B;z++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);for(var V=(B+1)*4,G=this.key.length/4,W=b(this.key),Y,z=0;z<G;z++)Y=z>>2,this._Ke[Y][z%4]=W[z],this._Kd[B-Y][z%4]=W[z];for(var J=0,oe=G,Ce;oe<V;){if(Ce=W[G-1],W[0]^=c[Ce>>16&255]<<24^c[Ce>>8&255]<<16^c[Ce&255]<<8^c[Ce>>24&255]^u[J]<<24,J+=1,G!=8)for(var z=1;z<G;z++)W[z]^=W[z-1];else{for(var z=1;z<G/2;z++)W[z]^=W[z-1];Ce=W[G/2-1],W[G/2]^=c[Ce&255]^c[Ce>>8&255]<<8^c[Ce>>16&255]<<16^c[Ce>>24&255]<<24;for(var z=G/2+1;z<G;z++)W[z]^=W[z-1]}for(var z=0,se,ne;z<G&&oe<V;)se=oe>>2,ne=oe%4,this._Ke[se][ne]=W[z],this._Kd[B-se][ne]=W[z++],oe++}for(var se=1;se<B;se++)for(var ne=0;ne<4;ne++)Ce=this._Kd[se][ne],this._Kd[se][ne]=k[Ce>>24&255]^x[Ce>>16&255]^S[Ce>>8&255]^I[Ce&255]},y.prototype.encrypt=function(B){if(B.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");for(var z=this._Ke.length-1,V=[0,0,0,0],G=b(B),W=0;W<4;W++)G[W]^=this._Ke[0][W];for(var Y=1;Y<z;Y++){for(var W=0;W<4;W++)V[W]=d[G[W]>>24&255]^m[G[(W+1)%4]>>16&255]^h[G[(W+2)%4]>>8&255]^g[G[(W+3)%4]&255]^this._Ke[Y][W];G=V.slice()}for(var J=i(16),oe,W=0;W<4;W++)oe=this._Ke[z][W],J[4*W]=(c[G[W]>>24&255]^oe>>24)&255,J[4*W+1]=(c[G[(W+1)%4]>>16&255]^oe>>16)&255,J[4*W+2]=(c[G[(W+2)%4]>>8&255]^oe>>8)&255,J[4*W+3]=(c[G[(W+3)%4]&255]^oe)&255;return J},y.prototype.decrypt=function(B){if(B.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var z=this._Kd.length-1,V=[0,0,0,0],G=b(B),W=0;W<4;W++)G[W]^=this._Kd[0][W];for(var Y=1;Y<z;Y++){for(var W=0;W<4;W++)V[W]=A[G[W]>>24&255]^v[G[(W+3)%4]>>16&255]^_[G[(W+2)%4]>>8&255]^w[G[(W+1)%4]&255]^this._Kd[Y][W];G=V.slice()}for(var J=i(16),oe,W=0;W<4;W++)oe=this._Kd[z][W],J[4*W]=(f[G[W]>>24&255]^oe>>24)&255,J[4*W+1]=(f[G[(W+3)%4]>>16&255]^oe>>16)&255,J[4*W+2]=(f[G[(W+2)%4]>>8&255]^oe>>8)&255,J[4*W+3]=(f[G[(W+1)%4]&255]^oe)&255;return J};var E=function(B){if(!(this instanceof E))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new y(B)};E.prototype.encrypt=function(B){if(B=n(B),B.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var z=i(B.length),V=i(16),G=0;G<B.length;G+=16)a(B,V,0,G,G+16),V=this._aes.encrypt(V),a(V,z,G);return z},E.prototype.decrypt=function(B){if(B=n(B),B.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var z=i(B.length),V=i(16),G=0;G<B.length;G+=16)a(B,V,0,G,G+16),V=this._aes.decrypt(V),a(V,z,G);return z};var M=function(B,z){if(!(this instanceof M))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",!z)z=i(16);else if(z.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastCipherblock=n(z,!0),this._aes=new y(B)};M.prototype.encrypt=function(B){if(B=n(B),B.length%16!==0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var z=i(B.length),V=i(16),G=0;G<B.length;G+=16){a(B,V,0,G,G+16);for(var W=0;W<16;W++)V[W]^=this._lastCipherblock[W];this._lastCipherblock=this._aes.encrypt(V),a(this._lastCipherblock,z,G)}return z},M.prototype.decrypt=function(B){if(B=n(B),B.length%16!==0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var z=i(B.length),V=i(16),G=0;G<B.length;G+=16){a(B,V,0,G,G+16),V=this._aes.decrypt(V);for(var W=0;W<16;W++)z[G+W]=V[W]^this._lastCipherblock[W];a(B,this._lastCipherblock,0,G,G+16)}return z};var F=function(B,z,V){if(!(this instanceof F))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",!z)z=i(16);else if(z.length!=16)throw new Error("invalid initialation vector size (must be 16 size)");V||(V=1),this.segmentSize=V,this._shiftRegister=n(z,!0),this._aes=new y(B)};F.prototype.encrypt=function(B){if(B.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var z=n(B,!0),V,G=0;G<z.length;G+=this.segmentSize){V=this._aes.encrypt(this._shiftRegister);for(var W=0;W<this.segmentSize;W++)z[G+W]^=V[W];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(z,this._shiftRegister,16-this.segmentSize,G,G+this.segmentSize)}return z},F.prototype.decrypt=function(B){if(B.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var z=n(B,!0),V,G=0;G<z.length;G+=this.segmentSize){V=this._aes.encrypt(this._shiftRegister);for(var W=0;W<this.segmentSize;W++)z[G+W]^=V[W];a(this._shiftRegister,this._shiftRegister,0,this.segmentSize),a(B,this._shiftRegister,16-this.segmentSize,G,G+this.segmentSize)}return z};var N=function(B,z){if(!(this instanceof N))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",!z)z=i(16);else if(z.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)");this._lastPrecipher=n(z,!0),this._lastPrecipherIndex=16,this._aes=new y(B)};N.prototype.encrypt=function(B){for(var z=n(B,!0),V=0;V<z.length;V++)this._lastPrecipherIndex===16&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),z[V]^=this._lastPrecipher[this._lastPrecipherIndex++];return z},N.prototype.decrypt=N.prototype.encrypt;var D=function(B){if(!(this instanceof D))throw Error("Counter must be instanitated with `new`");B!==0&&!B&&(B=1),typeof B=="number"?(this._counter=i(16),this.setValue(B)):this.setBytes(B)};D.prototype.setValue=function(B){if(typeof B!="number"||parseInt(B)!=B)throw new Error("invalid counter value (must be an integer)");if(B>Number.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var z=15;z>=0;--z)this._counter[z]=B%256,B=parseInt(B/256)},D.prototype.setBytes=function(B){if(B=n(B,!0),B.length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=B},D.prototype.increment=function(){for(var B=15;B>=0;B--)if(this._counter[B]===255)this._counter[B]=0;else{this._counter[B]++;break}};var O=function(B,z){if(!(this instanceof O))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",z instanceof D||(z=new D(z)),this._counter=z,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new y(B)};O.prototype.encrypt=function(B){for(var z=n(B,!0),V=0;V<z.length;V++)this._remainingCounterIndex===16&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),z[V]^=this._remainingCounter[this._remainingCounterIndex++];return z},O.prototype.decrypt=O.prototype.encrypt;function L(B){B=n(B,!0);var z=16-B.length%16,V=i(B.length+z);a(B,V);for(var G=B.length;G<V.length;G++)V[G]=z;return V}function P(B){if(B=n(B,!0),B.length<16)throw new Error("PKCS#7 invalid length");var z=B[B.length-1];if(z>16)throw new Error("PKCS#7 padding byte out of range");for(var V=B.length-z,G=0;G<z;G++)if(B[V+G]!==z)throw new Error("PKCS#7 invalid padding byte");var W=i(V);return a(B,W,0,0,V),W}var U={AES:y,Counter:D,ModeOfOperation:{ecb:E,cbc:M,cfb:F,ofb:N,ctr:O},utils:{hex:s,utf8:o},padding:{pkcs7:{pad:L,strip:P}},_arrayTest:{coerceArray:n,createArray:i,copyArray:a}};typeof ew<"u"?JD.exports=U:typeof define=="function"&&define.amd?define([],function(){return U}):(e.aesjs&&(U._aesjs=e.aesjs),e.aesjs=U)})(ew)});var rP={};j(rP,{utilAesDecrypt:()=>As,utilAesEncrypt:()=>Fd});function Fd(e,t){t=t||tP;let r=g2.default.utils.utf8.toBytes(e),i=new g2.default.ModeOfOperation.ctr(t).encrypt(r);return g2.default.utils.hex.fromBytes(i)}function As(e,t){t=t||tP;let r=g2.default.utils.hex.toBytes(e),i=new g2.default.ModeOfOperation.ctr(t).decrypt(r);return g2.default.utils.utf8.fromBytes(i)}var g2,tP,W7=q(()=>{"use strict";g2=or(eP(),1),tP=[250,157,60,79,142,134,229,129,138,126,210,129,29,71,160,208]});var nP={};j(nP,{utilCleanTags:()=>v2});function v2(e){var t={};for(var r in e)if(r){var n=e[r];n!==void 0&&(t[r]=i(r,n))}return t;function i(a,o){function s(c){return/_hours|_times|:conditional$/.test(c)}function l(c){return/^(description|note|fixme|inscription)$/.test(c)}if(l(a))return o;var u=o.split(";").map(function(c){return c.trim()}).join(s(a)?"; ":";");return(a.indexOf("website")!==-1||a.indexOf("email")!==-1||u.indexOf("http")===0)&&(u=u.replace(/[\u200B-\u200F\uFEFF]/g,"")),u}}var tw=q(()=>{"use strict"});var iP={};j(iP,{utilDetect:()=>sr});function sr(e){if(Tt&&!e)return Tt;Tt={};let t=navigator.userAgent,r=null;r=t.match(/(edge)\/?\s*(\.?\d+(\.\d+)*)/i),r!==null&&(Tt.browser=r[1],Tt.version=r[2]),Tt.browser||(r=t.match(/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/i),r!==null&&(Tt.browser="msie",Tt.version=r[1])),Tt.browser||(r=t.match(/(opr)\/?\s*(\.?\d+(\.\d+)*)/i),r!==null&&(Tt.browser="Opera",Tt.version=r[2])),Tt.browser||(r=t.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i),r!==null&&(Tt.browser=r[1],Tt.version=r[2],r=t.match(/version\/([\.\d]+)/i),r!==null&&(Tt.version=r[1]))),Tt.browser||(Tt.browser=navigator.appName,Tt.version=navigator.appVersion),Tt.version=Tt.version.split(/\W/).slice(0,2).join("."),Tt.opera=Tt.browser.toLowerCase()==="opera"&&Number(Tt.version)<15,Tt.browser.toLowerCase()==="msie"?(Tt.ie=!0,Tt.browser="Internet Explorer",Tt.support=!1):(Tt.ie=!1,Tt.support=!0),Tt.filedrop=window.FileReader&&"ondrop"in window,/Win/.test(t)?(Tt.os="win",Tt.platform="Windows"):/Mac/.test(t)?(Tt.os="mac",Tt.platform="Macintosh"):/X11/.test(t)||/Linux/.test(t)?(Tt.os="linux",Tt.platform="Linux"):(Tt.os="win",Tt.platform="Unknown"),Tt.isMobileWebKit=(/\b(iPad|iPhone|iPod)\b/.test(t)||navigator.platform==="MacIntel"&&"maxTouchPoints"in navigator&&navigator.maxTouchPoints>1)&&/WebKit/.test(t)&&!/Edge/.test(t)&&!window.MSStream,Tt.browserLocales=Array.from(new Set([navigator.language].concat(navigator.languages||[]).concat([navigator.userLanguage]).filter(Boolean)));let n=window.top.location,i=n.origin;return i||(i=n.protocol+"//"+n.hostname+(n.port?":"+n.port:"")),Tt.host=i+n.pathname,Tt}var Tt,Li=q(()=>{"use strict"});var aP={};j(aP,{utilGetSetValue:()=>$e});function $e(e,t,r){function n(i,a){function o(){delete this.value}function s(){a(this.value,i)&&(this.value=i)}function l(){var u=i.apply(this,arguments);u==null?delete this.value:a(this.value,u)&&(this.value=u)}return i==null?o:typeof i=="function"?l:s}return arguments.length===1?e.property("value"):(r===void 0&&(r=(i,a)=>i!==a),e.each(n(t,r)))}var rw=q(()=>{"use strict"});var oP={};j(oP,{utilKeybinding:()=>Xe});function Xe(e){var t={};function r(o,s){var l=!1,u=Object.keys(t).map(function(m){return t[m]}),c,f;for(c=0;c<u.length;c++)if(f=u[c],!!f.event.modifiers.shiftKey&&!!f.capture===s&&d(o,f,!0)){f.callback(o),l=!0;break}if(l)return;for(c=0;c<u.length;c++)if(f=u[c],!f.event.modifiers.shiftKey&&!!f.capture===s&&d(o,f,!1)){f.callback(o);break}function d(m,h,g){var A=m,v=!1,_=!0;return A.key!==void 0&&(_=A.key.charCodeAt(0)>127,v=!0,h.event.key===void 0?v=!1:Array.isArray(h.event.key)?h.event.key.map(function(w){return w.toLowerCase()}).indexOf(A.key.toLowerCase())===-1&&(v=!1):A.key.toLowerCase()!==h.event.key.toLowerCase()&&(v=!1)),!v&&(_||h.event.modifiers.altKey)&&(v=A.keyCode===h.event.keyCode),!(!v||!(A.ctrlKey&&A.altKey)&&(A.ctrlKey!==h.event.modifiers.ctrlKey||A.altKey!==h.event.modifiers.altKey)||A.metaKey!==h.event.modifiers.metaKey||g&&A.shiftKey!==h.event.modifiers.shiftKey)}}function n(o){r(o,!0)}function i(o){var s=Q(o.target).node().tagName;s==="INPUT"||s==="SELECT"||s==="TEXTAREA"||r(o,!1)}function a(o){return o=o||Q(document),o.on("keydown.capture."+e,n,!0),o.on("keydown.bubble."+e,i,!1),a}return a.unbind=function(o){return t=[],o=o||Q(document),o.on("keydown.capture."+e,null),o.on("keydown.bubble."+e,null),a},a.clear=function(){return t={},a},a.off=function(o,s){for(var l=Je([].concat(o)),u=0;u<l.length;u++){var c=l[u]+(s?"-capture":"-bubble");delete t[c]}return a},a.on=function(o,s,l){if(typeof s!="function")return a.off(o,l);for(var u=Je([].concat(o)),c=0;c<u.length;c++){var f=u[c]+(l?"-capture":"-bubble"),d={id:f,capture:l,callback:s,event:{key:void 0,keyCode:0,modifiers:{shiftKey:!1,ctrlKey:!1,altKey:!1,metaKey:!1}}};t[f]&&console.warn('warning: duplicate keybinding for "'+f+'"'),t[f]=d;for(var m=u[c].toLowerCase().match(/(?:(?:[^+⇧⌃⌥⌘])+|[⇧⌃⌥⌘]|\+\+|^\+$)/g),h=0;h<m.length;h++)if(m[h]==="++"&&(m[h]="+"),m[h]in Xe.modifierCodes){var g=Xe.modifierProperties[Xe.modifierCodes[m[h]]];d.event.modifiers[g]=!0}else d.event.key=Xe.keys[m[h]]||m[h],m[h]in Xe.keyCodes&&(d.event.keyCode=Xe.keyCodes[m[h]])}return a},a}var co,R4,n3=q(()=>{"use strict";Ae();Mr();Xe.modifierCodes={"\u21E7":16,shift:16,"\u2303":17,ctrl:17,"\u2325":18,alt:18,option:18,"\u2318":91,meta:91,cmd:91,super:91,win:91};Xe.modifierProperties={16:"shiftKey",17:"ctrlKey",18:"altKey",91:"metaKey"};Xe.plusKeys=["plus","ffplus","=","ffequals","\u2260","\xB1"];Xe.minusKeys=["_","-","ffminus","dash","\u2013","\u2014"];Xe.keys={"\u232B":"Backspace",backspace:"Backspace","\u21E5":"Tab","\u21C6":"Tab",tab:"Tab","\u21A9":"Enter","\u21B5":"Enter","\u23CE":"Enter",return:"Enter",enter:"Enter","\u2305":"Enter",pause:"Pause","pause-break":"Pause","\u21EA":"CapsLock",caps:"CapsLock","caps-lock":"CapsLock","\u238B":["Escape","Esc"],escape:["Escape","Esc"],esc:["Escape","Esc"],space:[" ","Spacebar"],"\u2196":"PageUp",pgup:"PageUp","page-up":"PageUp","\u2198":"PageDown",pgdown:"PageDown","page-down":"PageDown","\u21DF":"End",end:"End","\u21DE":"Home",home:"Home",ins:"Insert",insert:"Insert","\u2326":["Delete","Del"],del:["Delete","Del"],delete:["Delete","Del"],"\u2190":["ArrowLeft","Left"],left:["ArrowLeft","Left"],"arrow-left":["ArrowLeft","Left"],"\u2191":["ArrowUp","Up"],up:["ArrowUp","Up"],"arrow-up":["ArrowUp","Up"],"\u2192":["ArrowRight","Right"],right:["ArrowRight","Right"],"arrow-right":["ArrowRight","Right"],"\u2193":["ArrowDown","Down"],down:["ArrowDown","Down"],"arrow-down":["ArrowDown","Down"],"*":["*","Multiply"],star:["*","Multiply"],asterisk:["*","Multiply"],multiply:["*","Multiply"],"+":["+","Add"],plus:["+","Add"],"-":["-","Subtract"],subtract:["-","Subtract"],dash:["-","Subtract"],semicolon:";",equals:"=",comma:",",period:".","full-stop":".",slash:"/","forward-slash":"/",tick:"`","back-quote":"`","open-bracket":"[","back-slash":"\\","close-bracket":"]",quote:"'",apostrophe:"'","num-0":"0","num-1":"1","num-2":"2","num-3":"3","num-4":"4","num-5":"5","num-6":"6","num-7":"7","num-8":"8","num-9":"9",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",f12:"F12",f13:"F13",f14:"F14",f15:"F15",f16:"F16",f17:"F17",f18:"F18",f19:"F19",f20:"F20",f21:"F21",f22:"F22",f23:"F23",f24:"F24",f25:"F25"};Xe.keyCodes={"\u232B":8,backspace:8,"\u21E5":9,"\u21C6":9,tab:9,"\u21A9":13,"\u21B5":13,"\u23CE":13,return:13,enter:13,"\u2305":13,pause:19,"pause-break":19,"\u21EA":20,caps:20,"caps-lock":20,"\u238B":27,escape:27,esc:27,space:32,"\u2196":33,pgup:33,"page-up":33,"\u2198":34,pgdown:34,"page-down":34,"\u21DF":35,end:35,"\u21DE":36,home:36,ins:45,insert:45,"\u2326":46,del:46,delete:46,"\u2190":37,left:37,"arrow-left":37,"\u2191":38,up:38,"arrow-up":38,"\u2192":39,right:39,"arrow-right":39,"\u2193":40,down:40,"arrow-down":40,ffequals:61,"*":106,star:106,asterisk:106,multiply:106,"+":107,plus:107,"-":109,subtract:109,"|":124,ffplus:171,ffminus:173,";":186,semicolon:186,"=":187,equals:187,",":188,comma:188,dash:189,".":190,period:190,"full-stop":190,"/":191,slash:191,"forward-slash":191,"`":192,tick:192,"back-quote":192,"[":219,"open-bracket":219,"\\":220,"back-slash":220,"]":221,"close-bracket":221,"'":222,quote:222,apostrophe:222};co=95,R4=0;for(;++co<106;)Xe.keyCodes["num-"+R4]=co,++R4;co=47;R4=0;for(;++co<58;)Xe.keyCodes[R4]=co,++R4;co=111;R4=1;for(;++co<136;)Xe.keyCodes["f"+R4]=co,++R4;co=64;for(;++co<91;)Xe.keyCodes[String.fromCharCode(co).toLowerCase()]=co});var sP={};j(sP,{utilCheckTagDictionary:()=>Ss,utilObjectOmit:()=>Tn});function Tn(e,t){return Object.keys(e).reduce(function(r,n){return t.indexOf(n)===-1&&(r[n]=e[n]),r},{})}function Ss(e,t){for(let r in e){let n=e[r];if(t[r]&&n in t[r])return t[r][n]}}var nw=q(()=>{"use strict"});var lP={};j(lP,{utilRebind:()=>_e});function _e(e,t,...r){for(let n of r)e[n]=Hte(e,t,t[n]);return e}function Hte(e,t,r){return function(){var n=r.apply(t,arguments);return n===t?e:n}}var Yr=q(()=>{"use strict"});var uP={};j(uP,{utilSessionMutex:()=>i3});function i3(e){var t={},r;function n(){if(!(typeof window>"u")){var i=new Date;i.setSeconds(i.getSeconds()+5),document.cookie=e+"=1; expires="+i.toUTCString()+"; sameSite=strict"}}return t.lock=function(){if(r)return!0;var i=document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+e+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1");return i?!1:(n(),r=window.setInterval(n,4e3),!0)},t.unlock=function(){r&&(document.cookie=e+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; sameSite=strict",clearInterval(r),r=null)},t.locked=function(){return!!r},t}var iw=q(()=>{"use strict"});var cP={};j(cP,{utilTiler:()=>mr});function mr(){var e=[256,256],t=256,r=256,n=[0,20],i=[e[0]/2,e[1]/2],a=0,o=!1;function s(c,f,d){return Math.max(f,Math.min(c,d))}function l(c){var f=c[0],d=c[1],m=c[2];if(m>=7){var h=Math.pow(2,m-1),g=Math.pow(2,m-6),A=h-g/2,v=h+g/2-1;return f>=A&&f<=v&&d>=A&&d<=v}return!1}function u(){for(var c=Yt(t/(2*Math.PI),r),f=s(Math.round(c),n[0],n[1]),d=0,m=Math.pow(2,f)-1,h=Math.log(r)*Math.LOG2E,g=Math.pow(2,c-f+h),A=[(i[0]-t/2)/g,(i[1]-t/2)/g],v=d4(s(Math.floor(-A[0])-a,d,m+1),s(Math.ceil(e[0]/g-A[0])+a,d,m+1)),_=d4(s(Math.floor(-A[1])-a,d,m+1),s(Math.ceil(e[1]/g-A[1])+a,d,m+1)),w=[],k=0;k<_.length;k++)for(var x=_[k],S=0;S<v.length;S++){var I=v[S];k>=a&&k<=_.length-a&&S>=a&&S<=v.length-a?w.unshift([I,x,f]):w.push([I,x,f])}return w.translate=A,w.scale=g,w}return u.getTiles=function(c){var f=[c.scale()*Math.PI-c.translate()[0],c.scale()*Math.PI-c.translate()[1]];this.size(c.clipExtent()[1]).scale(c.scale()*2*Math.PI).translate(c.translate());var d=u(),m=d.scale;return d.map(function(h){if(o&&l(h))return!1;var g=h[0]*m-f[0],A=h[1]*m-f[1];return{id:h.toString(),xyz:h,extent:Me(c.invert([g,A+m]),c.invert([g+m,A]))}}).filter(Boolean)},u.getGeoJSON=function(c){var f=u.getTiles(c).map(function(d){return{type:"Feature",properties:{id:d.id,name:d.id},geometry:{type:"Polygon",coordinates:[d.extent.polygon()]}}});return{type:"FeatureCollection",features:f}},u.tileSize=function(c){return arguments.length?(r=c,u):r},u.zoomExtent=function(c){return arguments.length?(n=c,u):n},u.size=function(c){return arguments.length?(e=c,u):e},u.scale=function(c){return arguments.length?(t=c,u):t},u.translate=function(c){return arguments.length?(i=c,u):i},u.margin=function(c){return arguments.length?(a=+c,u):a},u.skipNullIsland=function(c){return arguments.length?(o=c,u):o},u}var aw=q(()=>{"use strict";bn();He()});var fP={};j(fP,{utilTriggerEvent:()=>F1});function F1(e,t,r){e.each(function(){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0);for(var i in r)n[i]=r[i];this.dispatchEvent(n)})}var ow=q(()=>{"use strict"});var vP={};j(vP,{decimalCoordinatePair:()=>y2,displayArea:()=>sw,displayLength:()=>a3,dmsCoordinatePair:()=>Da,dmsMatcher:()=>o3});function a3(e,t){var r=e*(t?3.28084:1),n;return t?r>=5280?(r/=5280,n="miles"):n="feet":r>=1e3?(r/=1e3,n="kilometers"):n="meters",T("units."+n,{quantity:r.toLocaleString(pe.localeCode(),{maximumSignificantDigits:4})})}function sw(e,t){var r=pe.localeCode(),n=e*(t?10.7639111056:1),i,a,o,s="",l="";return t?(n>=6969600?(i=n/27878400,s="square_miles"):(i=n,s="square_feet"),n>4356&&n<4356e4&&(a=n/43560,l="acres")):(n>=25e4?(i=n/1e6,s="square_kilometers"):(i=n,s="square_meters"),n>1e3&&n<1e7&&(a=n/1e4,l="hectares")),o=T("units."+s,{quantity:i.toLocaleString(r,{maximumSignificantDigits:4})}),a?T("units.area_pair",{area1:o,area2:T("units."+l,{quantity:a.toLocaleString(r,{maximumSignificantDigits:2})})}):o}function hP(e,t,r){var n=r-t;return((e-t)%n+n)%n+t}function gP(e,t,r){return Math.max(t,Math.min(e,r))}function pP(e,t){e=Number(e),t=Number(t);let r=Math.pow(10,t);return Math.round(e*r)/r}function mP(e,t,r){var n,i=pe.localeCode(),a=Math.floor(Math.abs(e)),o=(Math.abs(e)-a)*60,s=Math.floor(o),l=(o-s)*60,u=pP(l,8),c=pP(u,0);return c===60&&(c=0,s+=1,s===60&&(s=0,a+=1)),n=T("units.arcdegrees",{quantity:a.toLocaleString(i)})+(s!==0||c!==0?T("units.arcminutes",{quantity:s.toLocaleString(i)}):"")+(c!==0?T("units.arcseconds",{quantity:c.toLocaleString(i)}):""),e===0?n:T("units.coordinate",{coordinate:n,direction:T("units."+(e>0?t:r))})}function Da(e){return T("units.coordinate_pair",{latitude:mP(gP(e[1],-90,90),"north","south"),longitude:mP(hP(e[0],-180,180),"east","west")})}function y2(e){return T("units.coordinate_pair",{latitude:gP(e[1],-90,90).toFixed(dP),longitude:hP(e[0],-180,180).toFixed(dP)})}function o3(e,t=void 0){let r=[{condition:/^\s*(-?)\s*(\d+)\s+(\d+)\s+(\d+\.?\d*)\s*\,\s*(-?)\s*(\d+)\s+(\d+)\s+(\d+\.?\d*)\s*$/,parser:function(i){let a=this.condition.exec(i),o=+a[2]+ +a[3]/60+ +a[4]/3600,s=+a[6]+ +a[7]/60+ +a[8]/3600,l=a[1]==="-"?-o:o,u=a[5]==="-"?-s:s;return[l,u]}},{condition:/^\s*(-?)\s*(\d+)\s+(\d+\.?\d*)\s*\,\s*(-?)\s*(\d+)\s+(\d+\.?\d*)\s*$/,parser:function(i){let a=this.condition.exec(i),o=+a[2]+ +a[3]/60,s=+a[5]+ +a[6]/60,l=a[1]==="-"?-o:o,u=a[4]==="-"?-s:s;return[l,u]}},{condition:/^\s*(-?\d+\.?\d*)\s*\/\s*(-?\d+\.?\d*)\s*$/,parser:function(i){let a=this.condition.exec(i);return[+a[1],+a[2]]}},{condition:/^\s*(\d+\.?\d*)\s*\/\s*(-?\d+\.?\d*)\s*\/\s*(-?\d+\.?\d*)\s*$/,parser:function(i){let a=this.condition.exec(i),o=+a[2],s=+a[3],l=+a[1];return[o,s,l]}},{condition:{test:i=>!!n(i)},parser:n}];function n(i){let a=pe.floatParser(t||pe.localeCode()),o=i.split(/,?\s+|\s*[\/\\]\s*/);if(o.length!==2)return!1;let s=a(o[0]),l=a(o[1]);return isNaN(s)||isNaN(l)?!1:[s,l]}for(let i of r)if(i.condition.test(e))return i.parser(e);return null}var dP,L4=q(()=>{"use strict";ue();dP=7});var yP={};j(yP,{dmsCoordinatePair:()=>Da,dmsMatcher:()=>o3,utilAesDecrypt:()=>As,utilAesEncrypt:()=>Fd,utilArrayChunk:()=>ks,utilArrayDifference:()=>yr,utilArrayFlatten:()=>D1,utilArrayGroupBy:()=>pr,utilArrayIdentical:()=>dn,utilArrayIntersection:()=>Cr,utilArrayUnion:()=>Ht,utilArrayUniq:()=>Je,utilArrayUniqBy:()=>P1,utilAsyncMap:()=>Od,utilCheckTagDictionary:()=>Ss,utilCleanOsmString:()=>po,utilCleanTags:()=>v2,utilCombinedTags:()=>c3,utilCompareIDs:()=>d3,utilDeepMemberSelector:()=>l3,utilDetect:()=>sr,utilDisplayName:()=>hr,utilDisplayNameForPath:()=>w2,utilDisplayType:()=>li,utilEditDistance:()=>U4,utilEntityAndDeepMemberIDs:()=>Cs,utilEntityOrDeepMemberSelector:()=>b2,utilEntityOrMemberSelector:()=>Ko,utilEntityRoot:()=>u3,utilEntitySelector:()=>Ui,utilFastMouse:()=>$r,utilFunctor:()=>Et,utilGetAllNodes:()=>ar,utilGetSetValue:()=>$e,utilHashcode:()=>fo,utilHighlightEntities:()=>bt,utilKeybinding:()=>Xe,utilNoAuto:()=>st,utilObjectOmit:()=>Tn,utilOldestID:()=>Zo,utilPrefixCSSProperty:()=>Is,utilPrefixDOMProperty:()=>f3,utilQsString:()=>at,utilRebind:()=>_e,utilSafeClassName:()=>Ms,utilSessionMutex:()=>i3,utilSetTransform:()=>Bn,utilStringQs:()=>Ft,utilTagDiff:()=>Yo,utilTagText:()=>s3,utilTiler:()=>mr,utilTotalExtent:()=>cr,utilTriggerEvent:()=>F1,utilUnicodeCharsCount:()=>Xo,utilUnicodeCharsTruncated:()=>x2,utilUniqueDomId:()=>Hn,utilWrap:()=>B4});var Ie=q(()=>{"use strict";W7();W7();Mr();Mr();Mr();Mr();Mr();Mr();Mr();Mr();Mr();dt();tw();dt();dt();Li();dt();dt();dt();dt();dt();dt();dt();dt();dt();dt();dt();dt();rw();dt();dt();n3();dt();nw();dt();dt();dt();dt();dt();Yr();dt();dt();iw();dt();dt();dt();aw();dt();ow();dt();dt();dt();dt();dt();L4();L4()});var bP={};j(bP,{actionAddMidpoint:()=>Gr});function Gr(e,t){return function(r){r=r.replace(t.move(e.loc));var n=Cr(r.parentWays(r.entity(e.edge[0])),r.parentWays(r.entity(e.edge[1])));return n.forEach(function(i){for(var a=0;a<i.nodes.length-1;a++)if(q0([i.nodes[a],i.nodes[a+1]],e.edge)){r=r.replace(r.entity(i.id).addNode(t.id,a+1));return}}),r}}var Jo=q(()=>{"use strict";He();Ie()});var wP={};j(wP,{actionAddVertex:()=>oa});function oa(e,t,r){return function(n){return n.replace(n.entity(e).addNode(t,r))}}var p3=q(()=>{"use strict"});var xP={};j(xP,{actionChangeMember:()=>O1});function O1(e,t,r){return function(n){return n.replace(n.entity(e).updateMember(t,r))}}var m3=q(()=>{"use strict"});var _P={};j(_P,{actionChangePreset:()=>R1});function R1(e,t,r,n){return function(a){var o=a.entity(e),s=o.geometry(a),l=o.tags;let u=o.extent(a).center();var c;return r&&(c=[],r.addTags&&(c=c.concat(Object.keys(r.addTags))),t&&!t.id.startsWith(r.id)&&r.fields(u).concat(r.moreFields(u)).filter(f=>f.matchGeometry(s)).map(f=>f.key).filter(Boolean).forEach(f=>c.push(f))),t&&(l=t.unsetTags(l,s,c,!1,u)),r&&(l=r.setTags(l,s,n,u)),a.replace(o.update({tags:l}))}}var h3=q(()=>{"use strict"});var kP={};j(kP,{actionChangeTags:()=>tr});function tr(e,t){return function(r){var n=r.entity(e);return r.replace(n.update({tags:t}))}}var Bi=q(()=>{"use strict"});var EP={};j(EP,{cardinal:()=>g3,osmNode:()=>Nt});function Nt(){if(this instanceof Nt)arguments.length&&this.initialize(arguments);else return new Nt().initialize(arguments)}var g3,jte,e1=q(()=>{"use strict";t1();He();Ie();Dr();g3={north:0,n:0,northnortheast:22,nne:22,northeast:45,ne:45,eastnortheast:67,ene:67,east:90,e:90,eastsoutheast:112,ese:112,southeast:135,se:135,southsoutheast:157,sse:157,south:180,s:180,southsouthwest:202,ssw:202,southwest:225,sw:225,westsouthwest:247,wsw:247,west:270,w:270,westnorthwest:292,wnw:292,northwest:315,nw:315,northnorthwest:337,nnw:337};Le.node=Nt;Nt.prototype=Object.create(Le.prototype);jte={type:"node",loc:[9999,9999],extent:function(){return new Me(this.loc)},geometry:function(e){return e.transient(this,"geometry",function(){return e.isPoi(this)?"point":"vertex"})},move:function(e){return this.update({loc:e})},isDegenerate:function(){return!(Array.isArray(this.loc)&&this.loc.length===2&&this.loc[0]>=-180&&this.loc[0]<=180&&this.loc[1]>=-90&&this.loc[1]<=90)},directions:function(e,t){var r,n;if(this.isHighwayIntersection(e)&&(this.tags.stop||"").toLowerCase()==="all")r="all";else{r=(this.tags.direction||"").toLowerCase();var i=/:direction$/i,a=Object.keys(this.tags);for(n=0;n<a.length;n++)if(i.test(a[n])){r=this.tags[a[n]].toLowerCase();break}}if(r==="")return[];var o=r.split(";"),s=[];return o.forEach(function(l){if(g3[l]!==void 0&&(l=g3[l]),l!==""&&!isNaN(+l)){s.push(+l);return}var u=this.tags["traffic_sign:backward"]||l==="backward"||l==="both"||l==="all",c=this.tags["traffic_sign:forward"]||l==="forward"||l==="both"||l==="all";if(!(!c&&!u)){var f={};e.parentWays(this).filter(d=>jb(this.tags,d.tags)).forEach(function(d){var m=d.nodes;for(n=0;n<m.length;n++)m[n]===this.id&&(c&&n>0&&(f[m[n-1]]=!0),u&&n<m.length-1&&(f[m[n+1]]=!0))},this),Object.keys(f).forEach(function(d){s.push(fn(this,e.entity(d),t)*(180/Math.PI)+90)},this)}},this),Je(s)},isCrossing:function(){return this.tags.highway==="crossing"||this.tags.railway&&this.tags.railway.indexOf("crossing")!==-1},isEndpoint:function(e){return e.transient(this,"isEndpoint",function(){var t=this.id;return e.parentWays(this).filter(function(r){return!r.isClosed()&&!!r.affix(t)}).length>0})},isConnected:function(e){return e.transient(this,"isConnected",function(){var t=e.parentWays(this);if(t.length>1){for(var r in t)if(t[r].geometry(e)==="line"&&t[r].hasInterestingTags())return!0}else if(t.length===1){var n=t[0],i=n.nodes.slice();return n.isClosed()&&i.pop(),i.indexOf(this.id)!==i.lastIndexOf(this.id)}return!1})},parentIntersectionWays:function(e){return e.transient(this,"parentIntersectionWays",function(){return e.parentWays(this).filter(function(t){return(t.tags.highway||t.tags.waterway||t.tags.railway||t.tags.aeroway)&&t.geometry(e)==="line"})})},isIntersection:function(e){return this.parentIntersectionWays(e).length>1},isHighwayIntersection:function(e){return e.transient(this,"isHighwayIntersection",function(){return e.parentWays(this).filter(function(t){return t.tags.highway&&t.geometry(e)==="line"}).length>1})},isOnAddressLine:function(e){return e.transient(this,"isOnAddressLine",function(){return e.parentWays(this).filter(function(t){return t.tags.hasOwnProperty("addr:interpolation")&&t.geometry(e)==="line"}).length>0})},asJXON:function(e){var t={node:{"@id":this.osmId(),"@lon":this.loc[0],"@lat":this.loc[1],"@version":this.version||0,tag:Object.keys(this.tags).map(function(r){return{keyAttributes:{k:r,v:this.tags[r]}}},this)}};return e&&(t.node["@changeset"]=e),t},asGeoJSON:function(){return{type:"Point",coordinates:this.loc}}};Object.assign(Nt.prototype,jte)});var AP={};j(AP,{actionCircularize:()=>v3});function v3(e,t,r){r=(r||20)*Math.PI/180;var n=function(i,a){(a===null||!isFinite(a))&&(a=1),a=Math.min(Math.max(+a,0),1);var o=i.entity(e),s={};i.childNodes(o).forEach(function(we){s[we.id]||(s[we.id]=we)}),o.isConvex(i)||(i=n.makeConvex(i));var l=Je(i.childNodes(o)),u=l.filter(function(we){return i.parentWays(we).length!==1}),c=l.map(function(we){return t(we.loc)}),f=u.map(function(we){return t(we.loc)}),d=c.length===2?Qt(c[0],c[1],.5):x1(c),m=yf(c,function(we){return ft(d,we)}),h=B0(c)>0?1:-1,g,A,v,_;if(u.length||(u=[l[0]],f=[c[0]]),u.length===1){var w=l.indexOf(u[0]),k=Math.floor((w+l.length/2)%l.length);u.push(l[k]),f.push(c[k])}for(A=0;A<f.length;A++){var x=(A+1)%u.length,S=u[A],I=u[x],b=l.indexOf(S),y=l.indexOf(I),E=-1,M=y-b,F={},N=[],D,O,L,P,U,B,z,V;M<0&&(M+=l.length);var G=ft(d,f[A])||1e-4;f[A]=[d[0]+(f[A][0]-d[0])/G*m,d[1]+(f[A][1]-d[1])/G*m],B=t.invert(f[A]),z=u[A],V=s[z.id],z=z.move(Qt(V.loc,B,a)),i=i.replace(z),D=Math.atan2(f[A][1]-d[1],f[A][0]-d[0]),O=Math.atan2(f[x][1]-d[1],f[x][0]-d[0]),L=O-D,L*h>0&&(L=-h*(2*Math.PI-Math.abs(L)));do E++,P=L/(M+E);while(Math.abs(P)>r);for(v=1;v<M;v++)U=D+v*P,B=t.invert([d[0]+Math.cos(U)*m,d[1]+Math.sin(U)*m]),z=l[(v+b)%l.length],V=s[z.id],F[z.id]=U,z=z.move(Qt(V.loc,B,a)),i=i.replace(z);for(v=0;v<E;v++){U=D+(M+v)*P,B=t.invert([d[0]+Math.cos(U)*m,d[1]+Math.sin(U)*m]);var W=1/0;for(var Y in F){var J=F[Y],oe=Math.abs(J-U);oe<W&&(W=oe,V=s[Y])}z=Nt({loc:Qt(V.loc,B,a)}),i=i.replace(z),l.splice(y+v,0,z),N.push(z.id)}if(M===1&&N.length){var Ce=o.nodes.lastIndexOf(S.id),se=o.nodes.lastIndexOf(I.id),ne=se-Ce;ne<-1&&(ne=1);var he=i.parentWays(u[A]);for(v=0;v<he.length;v++){var Se=he[v];if(Se!==o&&Se.areAdjacent(S.id,I.id)){var re=Se.nodes.lastIndexOf(S.id),Z=Se.nodes.lastIndexOf(I.id),te=Z-re,ye=Z;for(te<-1&&(te=1),ne!==te&&(N.reverse(),ye=re),_=0;_<N.length;_++)Se=Se.addNode(N[_],ye+_);i=i.replace(Se)}}}}return g=l.map(function(we){return we.id}),g.push(g[0]),o=o.update({nodes:g}),i=i.replace(o),i};return n.makeConvex=function(i){var a=i.entity(e),o=Je(i.childNodes(a)),s=o.map(function(v){return t(v.loc)}),l=B0(s)>0?1:-1,u=ys(s),c,f;for(l===-1&&(o.reverse(),s.reverse()),c=0;c<u.length-1;c++){var d=s.indexOf(u[c]),m=s.indexOf(u[c+1]),h=m-d;for(h<0&&(h+=o.length),f=1;f<h;f++){var g=Qt(u[c],u[c+1],f/h),A=o[(f+d)%o.length].move(t.invert(g));i=i.replace(A)}}return i},n.disabled=function(i){if(!i.entity(e).isClosed())return"not_closed";var a=i.entity(e),o=Je(i.childNodes(a)),s=o.map(function(k){return t(k.loc)}),l=ys(s),u=Math.PI/180;if(l.length!==s.length||l.length<3)return!1;var c=x1(s),f=_4(c,s[0]),d,m;for(d=0;d<l.length;d++){m=l[d];var h=_4(m,c),g=Math.abs(h-f);if(g>.05*f)return!1}for(d=0;d<l.length;d++){m=l[d];var A=l[(d+1)%l.length],v=Math.atan2(m[1]-c[1],m[0]-c[0]),_=Math.atan2(A[1]-c[1],A[0]-c[0]),w=_-v;if(w<0&&(w=-w),w>Math.PI&&(w=2*Math.PI-w),w>r+u)return!1}return"already_circular"},n.transitionable=!0,n}var Rd=q(()=>{"use strict";bn();o7();He();e1();Ie();cn()});var SP={};j(SP,{actionDeleteWay:()=>sa});function sa(e){function t(n,i){if(i.parentWays(n).length||i.parentRelations(n).length)return!1;var a=N1(n.tags);return a.point?!1:a.vertex?!0:!n.hasInterestingTags()}var r=function(n){var i=n.entity(e);return n.parentRelations(i).forEach(function(a){a=a.removeMembersWithID(e),n=n.replace(a),a.isDegenerate()&&(n=Kr(a.id)(n))}),new Set(i.nodes).forEach(function(a){n=n.replace(i.removeNode(a));var o=n.entity(a);t(o,n)&&(n=n.remove(o))}),n.remove(i)};return r}var z4=q(()=>{"use strict";Dr();mo()});var CP={};j(CP,{actionDeleteMultiple:()=>r1});function r1(e){var t={way:sa,node:ho,relation:Kr},r=function(n){return e.forEach(function(i){n.hasEntity(i)&&(n=t[n.entity(i).type](i)(n))}),n};return r}var y3=q(()=>{"use strict";_2();mo();z4()});var IP={};j(IP,{actionDeleteRelation:()=>Kr});function Kr(e,t){function r(i,a){return!a.parentWays(i).length&&!a.parentRelations(i).length&&!i.hasInterestingTags()&&!t}var n=function(i){var a=i.entity(e);i.parentRelations(a).forEach(function(s){s=s.removeMembersWithID(e),i=i.replace(s),s.isDegenerate()&&(i=Kr(s.id)(i))});var o=Je(a.members.map(function(s){return s.id}));return o.forEach(function(s){i=i.replace(a.removeMembersWithID(s));var l=i.entity(s);r(l,i)&&(i=r1([s])(i))}),i.remove(a)};return n}var mo=q(()=>{"use strict";y3();Ie()});var MP={};j(MP,{actionDeleteNode:()=>ho});function ho(e){var t=function(r){var n=r.entity(e);return r.parentWays(n).forEach(function(i){i=i.removeNode(e),r=r.replace(i),i.isDegenerate()&&(r=sa(i.id)(r))}),r.parentRelations(n).forEach(function(i){i=i.removeMembersWithID(e),r=r.replace(i),i.isDegenerate()&&(r=Kr(i.id)(r))}),r.remove(n)};return t}var _2=q(()=>{"use strict";mo();z4()});var TP={};j(TP,{actionConnect:()=>L1});function L1(e){var t=function(r){var n,i,a,o,s;e.reverse();var l=[];for(o=0;o<e.length;o++)i=r.entity(e[o]),i.hasInterestingTags()&&(i.isNew()||l.push(i.id));for(n=r.entity(Zo(l.length>0?l:e)),o=0;o<e.length;o++)if(i=r.entity(e[o]),i.id!==n.id){for(a=r.parentWays(i),s=0;s<a.length;s++)r=r.replace(a[s].replaceNode(i.id,n.id));for(a=r.parentRelations(i),s=0;s<a.length;s++)r=r.replace(a[s].replaceMember(i,n));n=n.mergeTags(i.tags),r=ho(i.id)(r)}for(r=r.replace(n),a=r.parentWays(n),o=0;o<a.length;o++)a[o].isDegenerate()&&(r=sa(a[o].id)(r));return r};return t.disabled=function(r){var n={},i=[],a,o,s,l,u,c,f,d,m;for(a=r.entity(Zo(e)),f=0;f<e.length;f++)for(o=r.entity(e[f]),l=r.parentRelations(o),d=0;d<l.length;d++){if(u=l[d],c=u.memberById(o.id).role||"",u.hasFromViaTo()&&i.push(u.id),n[u.id]!==void 0&&n[u.id]!==c)return"relation";n[u.id]=c}for(f=0;f<e.length;f++){o=r.entity(e[f]);var h=r.parentWays(o);for(d=0;d<h.length;d++){var g=h[d];for(l=r.parentRelations(g),m=0;m<l.length;m++)u=l[m],u.hasFromViaTo()&&i.push(u.id)}}for(i=Je(i),f=0;f<i.length;f++)if(u=r.entity(i[f]),!!u.isComplete(r)){var A=u.members.filter(function(U){return U.type==="way"}).map(function(U){return r.entity(U.id)});A=Je(A);var v=u.memberByRole("from"),_=u.memberByRole("to"),w=v.id===_.id,k={from:[],via:[],to:[],keyfrom:[],keyto:[]};for(d=0;d<u.members.length;d++)P(u.members[d],k);k.keyfrom=Je(k.keyfrom.filter(O)),k.keyto=Je(k.keyto.filter(O));var x=L(k.keyfrom,k.keyto);k.from=k.from.filter(x),k.via=k.via.filter(x),k.to=k.to.filter(x);var S=!1,I=!1,b=!1,y=!1,E=!1;for(d=0;d<e.length;d++){var M=e[d];k.from.indexOf(M)!==-1&&(S=!0),k.via.indexOf(M)!==-1&&(I=!0),k.to.indexOf(M)!==-1&&(b=!0),k.keyfrom.indexOf(M)!==-1&&(y=!0),k.keyto.indexOf(M)!==-1&&(E=!0)}if(S&&b&&!w||S&&I||b&&I)return"restriction";if(y||E){if(e.length!==2)return"restriction";var F=null,N=null;for(d=0;d<A.length;d++)s=A[d],s.contains(e[0])&&(F=e[0]),s.contains(e[1])&&(N=e[1]);if(F&&N){var D=!1;for(d=0;d<A.length;d++)if(s=A[d],s.areAdjacent(F,N)){D=!0;break}if(!D)return"restriction"}}for(d=0;d<A.length;d++){for(s=A[d].update({}),m=0;m<e.length;m++)e[m]!==a.id&&(s.areAdjacent(e[m],a.id)?s=s.removeNode(e[m]):s=s.replaceNode(e[m],a.id));if(s.isDegenerate())return"restriction"}}return!1;function O(U,B,z){return z.indexOf(U)!==z.lastIndexOf(U)}function L(U,B){return function(z){return U.indexOf(z)===-1&&B.indexOf(z)===-1}}function P(U,B){var z=r.hasEntity(U.id);if(z){var V=U.role||"";B[V]||(B[V]=[]),U.type==="node"?(B[V].push(U.id),V==="via"&&(B.keyfrom.push(U.id),B.keyto.push(U.id))):U.type==="way"&&(B[V].push.apply(B[V],z.nodes),(V==="from"||V==="via")&&(B.keyfrom.push(z.first()),B.keyfrom.push(z.last())),(V==="to"||V==="via")&&(B.keyto.push(z.first()),B.keyto.push(z.last())))}}},t}var Q7=q(()=>{"use strict";_2();z4();Ie()});var NP={};j(NP,{actionCopyEntities:()=>q4});function q4(e,t){var r={},n=function(i){e.forEach(function(o){t.entity(o).copy(t,r)});for(var a in r)i=i.replace(r[a]);return i};return n.copies=function(){return r},n}var H7=q(()=>{"use strict"});var DP={};j(DP,{actionDeleteMember:()=>U1});function U1(e,t){return function(r){var n=r.entity(e).removeMember(t);return r=r.replace(n),n.isDegenerate()&&(r=Kr(n.id)(r)),r}}var b3=q(()=>{"use strict";mo()});var PP={};j(PP,{actionDeleteMembers:()=>lw});function lw(e,t){return function(r){t.sort((i,a)=>a-i);for(var n in t)r=U1(e,t[n])(r);return r}}var uw=q(()=>{"use strict";b3()});var FP={};j(FP,{actionDiscardTags:()=>Ts});function Ts(e,t){return t=t||{},r=>{return e.modified().forEach(n),e.created().forEach(n),r;function n(i){let a=Object.keys(i.tags),o=!1,s={};for(let l=0;l<a.length;l++){let u=a[l];t[u]||!i.tags[u]?o=!0:s[u]=i.tags[u]}o&&(r=r.replace(i.update({tags:s})))}}}var j7=q(()=>{"use strict"});var OP={};j(OP,{actionDisconnect:()=>k2});function k2(e,t){var r,n={associatedStreet:!0,enforcement:!0,site:!0},i=function(a){var o=a.entity(e),s=i.connections(a);return s.forEach(function(l){var u=a.entity(l.wayID),c=Nt({id:t,loc:o.loc,tags:o.tags});a=a.replace(c),l.index===0&&u.isArea()?a=a.replace(u.replaceNode(u.nodes[0],c.id)):u.isClosed()&&l.index===u.nodes.length-1?a=a.replace(u.unclose().addNode(c.id)):a=a.replace(u.updateNode(c.id,l.index))}),a};return i.connections=function(a){for(var o=[],s=!1,l=a.parentWays(a.entity(e)),u,c,f=0;f<l.length;f++){if(u=l[f],r&&r.indexOf(u.id)===-1){s=!0;continue}if(u.isArea()&&u.nodes[0]===e)o.push({wayID:u.id,index:0});else for(var d=0;d<u.nodes.length;d++)if(c=u.nodes[d],c===e){if(u.isClosed()&&l.length>1&&r&&r.indexOf(u.id)!==-1&&d===u.nodes.length-1)continue;o.push({wayID:u.id,index:d})}}return s?o:o.slice(1)},i.disabled=function(a){var o=i.connections(a);if(o.length===0)return"not_connected";var s=a.parentWays(a.entity(e)),l={},u;if(s.forEach(function(c){var f=a.parentRelations(c);f.filter(d=>!n[d.tags.type]).forEach(function(d){d.id in l?r?(r.indexOf(c.id)!==-1||r.indexOf(l[d.id])!==-1)&&(u=d):u=d:l[d.id]=c.id})}),u)return"relation"},i.limitWays=function(a){return arguments.length?(r=a,i):r},i}var Ld=q(()=>{"use strict";e1()});var RP={};j(RP,{actionExtract:()=>V4});function V4(e,t){var r,n=function(o,s){var l=o.entity(e);return l.type==="node"?i(l,o,s):a(l,o)};function i(o,s,l){r=o.id;var u=Nt({loc:o.loc});return s=s.replace(u),s=s.parentWays(o).reduce(function(c,f){return c.replace(f.replaceNode(e,u.id))},s),l?s.parentRelations(o).reduce(function(c,f){return c.replace(f.replaceMember(o,u))},s):s}function a(o,s){var l=o.geometry(s),u=["source","wheelchair"],c=["area"],f=["architect","building","height","layer","nycdoitt:bin"],d=Pi(t).centroid(o.asGeoJSON(s));d=d&&t.invert(d),(!d||!isFinite(d[0])||!isFinite(d[1]))&&(d=o.extent(s).center());var m={area:!0,corridor:!0,elevator:!0,level:!0,room:!0},h=o.tags.building&&o.tags.building!=="no"||o.tags["building:part"]&&o.tags["building:part"]!=="no",g=l==="area"&&o.tags.indoor&&m[o.tags.indoor],A=Object.assign({},o.tags),v={};for(var _ in A)o.type==="relation"&&_==="type"||c.indexOf(_)===-1&&(h&&(f.indexOf(_)!==-1||_.match(/^building:.{1,}/)||_.match(/^roof:.{1,}/))||g&&_==="indoor"||(v[_]=A[_],!(u.indexOf(_)!==-1||_.match(/^addr:.{1,}/))&&(g&&_==="level"||delete A[_])));!h&&!g&&l==="area"&&(A.area="yes");var w=Nt({loc:d,tags:v});return s=s.replace(w),r=w.id,s.replace(o.update({tags:A}))}return n.getExtractedNodeID=function(){return r},n}var Y7=q(()=>{"use strict";Ta();e1()});var LP={};j(LP,{actionJoin:()=>w3});function w3(e){function t(n){var i=e.map(function(a){return n.entity(a)});return Object.assign({line:[]},pr(i,function(a){return a.geometry(n)}))}var r=function(n){var i=e.map(n.entity,n),a=Zo(i.map(c=>c.id));i.sort(function(c,f){var d=c.isSided(),m=f.isSided();return d&&!m?-1:m&&!d?1:0});var o=jn(i,n),s=o[0];n=o.actions.reduce(function(c,f){return f(c)},n);var l=n.entity(a);l=l.update({nodes:s.nodes.map(function(c){return c.id})}),n=n.replace(l),s.forEach(function(c){c.id!==a&&(n.parentRelations(c).forEach(function(f){n=n.replace(f.replaceMember(c,l))}),l=l.mergeTags(c.tags),n=n.replace(l),n=sa(c.id)(n))});function u(){if(l.isClosed()){var c=n.parentMultipolygons(l).filter(function(h){return h.members.length===1});if(c.length===1){var f=c[0];for(var d in l.tags)if(f.tags[d]&&f.tags[d]!==l.tags[d])return;l=l.mergeTags(f.tags),n=n.replace(l),n=Kr(f.id,!0)(n);var m=Object.assign({},l.tags);l.geometry(n)!=="area"&&(m.area="yes"),delete m.type,l=l.update({tags:m}),n=n.replace(l)}}}return u(),n};return r.resultingWayNodesLength=function(n){return e.reduce(function(i,a){return i+n.entity(a).nodes.length},0)-e.length-1},r.disabled=function(n){var i=t(n);if(e.length<2||e.length!==i.line.length)return"not_eligible";var a=jn(e.map(n.entity,n),n);if(a.length>1)return"not_adjacent";var o,s=function(w){return n.parentRelations(n.entity(w)).filter(k=>!k.isRestriction()&&!k.isConnectivity()).sort((k,x)=>k.id.localeCompare(x.id))},l=s(e[0]);for(o=1;o<e.length;o++){var u=s(e[o]);if(!dn(l,u))return"conflicting_relations"}for(o=0;o<e.length-1;o++)for(var c=o+1;c<e.length;c++){var f=n.childNodes(n.entity(e[o])).map(function(w){return w.loc}),d=n.childNodes(n.entity(e[c])).map(function(w){return w.loc}),m=E4(f,d),h=Cr(a[0].nodes.map(function(w){return w.loc.toString()}),m.map(function(w){return w.toString()}));if(h.length!==m.length)return"paths_intersect"}var g=a[0].nodes.map(function(w){return w.id}).slice(1,-1),A,v={},_=!1;if(a[0].forEach(function(w){var k=n.parentRelations(w);k.forEach(function(S){(S.isRestriction()||S.isConnectivity())&&S.members.some(function(I){return g.indexOf(I.id)>=0})&&(A=S)});for(var x in w.tags)x in v?v[x]&&I1(x)&&v[x]!==w.tags[x]&&(_=!0):v[x]=w.tags[x]}),A)return A.isRestriction()?"restriction":"connectivity";if(_)return"conflicting_tags"},r}var Ud=q(()=>{"use strict";mo();z4();Dr();E2();He();Ie()});var UP={};j(UP,{actionMerge:()=>x3});function x3(e){function t(n){var i=e.map(function(a){return n.entity(a)});return Object.assign({point:[],area:[],line:[],relation:[]},pr(i,function(a){return a.geometry(n)}))}var r=function(n){var i=t(n),a=i.area[0]||i.line[0],o=i.point;if(o.forEach(function(l){a=a.mergeTags(l.tags),n=n.replace(a),n.parentRelations(l).forEach(function(A){n=n.replace(A.replaceMember(l,a))});var u=Je(n.childNodes(a)),c=l;if(!l.isNew()){var f=!1,d=function(A){return!(n.parentWays(A).length>1||n.parentRelations(A).length)},m=function(A){n=n.replace(l.update({tags:A.tags,loc:A.loc})),a=a.replaceNode(A.id,l.id),n=n.replace(a),c=A,f=!0},h,g;for(h=0;h<u.length;h++)if(g=u[h],d(g)&&g.isNew()){m(g);break}if(!f&&l.hasInterestingTags()){for(h=0;h<u.length;h++)if(g=u[h],d(g)&&!g.hasInterestingTags()){m(g);break}if(!f){for(h=0;h<u.length;h++)if(g=u[h],d(g)&&d3(l.id,g.id)<0){m(g);break}}}}n=n.remove(c)}),a.tags.area==="yes"){var s=Object.assign({},a.tags);delete s.area,T1(s)&&(a=a.update({tags:s}),n=n.replace(a))}return n};return r.disabled=function(n){var i=t(n);if(i.point.length===0||i.area.length+i.line.length!==1||i.relation.length!==0)return"not_eligible"},r}var Bd=q(()=>{"use strict";Dr();Ie()});var BP={};j(BP,{actionMergeNodes:()=>zi});function zi(e,t){function r(i){if(!e.length)return null;for(var a=[0,0],o=0,s,l=0;l<e.length;l++){var u=i.entity(e[l]);u.hasInterestingTags()&&(s=++o===1?u.loc:null),a=qr(a,u.loc)}return s||Na(a,1/e.length)}var n=function(i){if(e.length<2)return i;var a=t;a||(a=r(i));for(var o=0;o<e.length;o++){var s=i.entity(e[o]);s.loc!==a&&(i=i.replace(s.move(a)))}return L1(e)(i)};return n.disabled=function(i){if(e.length<2)return"not_eligible";for(var a=0;a<e.length;a++){var o=i.entity(e[a]);if(o.type!=="node")return"not_eligible"}return L1(e).disabled(i)},n}var $4=q(()=>{"use strict";Q7();He()});var zP={};j(zP,{osmChangeset:()=>qi});function qi(){if(this instanceof qi)arguments.length&&this.initialize(arguments);else return new qi().initialize(arguments)}var cw=q(()=>{"use strict";t1();He();Le.changeset=qi;qi.prototype=Object.create(Le.prototype);Object.assign(qi.prototype,{type:"changeset",extent:function(){return new Me},geometry:function(){return"changeset"},asJXON:function(){return{osm:{changeset:{tag:Object.keys(this.tags).map(function(e){return{"@k":e,"@v":this.tags[e]}},this),"@version":.6,"@generator":"iD"}}}},osmChangeJXON:function(e){var t=this.id;function r(a,o){for(var s={},l=0;l<a.length;l++){var u=Object.keys(a[l])[0];s[u]||(s[u]=[]),s[u].push(a[l][u])}var c={};return o.forEach(function(f){s[f]&&(c[f]=s[f])}),c}function n(a){function o(g){return c.find(function(A){return g.keyAttributes.type==="relation"&&g.keyAttributes.ref===A["@id"]})}function s(g){return!u[g["@id"]]&&!l.find(function(A){return A["@id"]===g["@id"]})}var l=[],u={},c=a.relation;if(!c)return a;for(var f=0;f<c.length;f++){var d=c[f];for(u[d["@id"]]||l.push(d);l.length>0;){var m=l[0],h=m.member.map(o).filter(Boolean).filter(s);h.length===0?(u[m["@id"]]=m,l.shift()):l=h.concat(l)}}return a.relation=Object.values(u),a}function i(a){return a.asJXON(t)}return{osmChange:{"@version":.6,"@generator":"iD",create:n(r(e.created.map(i),["node","way","relation"])),modify:r(e.modified.map(i),["node","way","relation"]),delete:Object.assign(r(e.deleted.map(i),["relation","way","node"]),{"@if-unused":!0})}}},asGeoJSON:function(){return{}}})});var qP={};j(qP,{osmNote:()=>br});function br(){if(this instanceof br)arguments.length&&this.initialize(arguments);else return new br().initialize(arguments)}var fw=q(()=>{"use strict";He();br.id=function(){return br.id.next--};br.id.next=-1;Object.assign(br.prototype,{type:"note",initialize:function(e){for(var t=0;t<e.length;++t){var r=e[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(r[n]===void 0?delete this[n]:this[n]=r[n])}return this.id||(this.id=br.id().toString()),this},extent:function(){return new Me(this.loc)},update:function(e){return br(this,e)},isNew:function(){return this.id<0},move:function(e){return this.update({loc:e})}})});var VP={};j(VP,{osmRelation:()=>pn});function pn(){if(this instanceof pn)arguments.length&&this.initialize(arguments);else return new pn().initialize(arguments)}var Yte,K7=q(()=>{"use strict";Ta();t1();E2();He();Le.relation=pn;pn.prototype=Object.create(Le.prototype);pn.creationOrder=function(e,t){var r=parseInt(Le.id.toOSM(e.id),10),n=parseInt(Le.id.toOSM(t.id),10);return r<0||n<0?r-n:n-r};Yte={type:"relation",members:[],copy:function(e,t){if(t[this.id])return t[this.id];var r=Le.prototype.copy.call(this,e,t),n=this.members.map(function(i){return Object.assign({},i,{id:e.entity(i.id).copy(e,t).id})});return r=r.update({members:n}),t[this.id]=r,r},extent:function(e,t){return e.transient(this,"extent",function(){if(t&&t[this.id])return Me();t=t||{},t[this.id]=!0;for(var r=Me(),n=0;n<this.members.length;n++){var i=e.hasEntity(this.members[n].id);i&&r._extend(i.extent(e,t))}return r})},geometry:function(e){return e.transient(this,"geometry",function(){return this.isMultipolygon()?"area":"relation"})},isDegenerate:function(){return this.members.length===0},indexedMembers:function(){for(var e=new Array(this.members.length),t=0;t<this.members.length;t++)e[t]=Object.assign({},this.members[t],{index:t});return e},memberByRole:function(e){for(var t=0;t<this.members.length;t++)if(this.members[t].role===e)return Object.assign({},this.members[t],{index:t})},membersByRole:function(e){for(var t=[],r=0;r<this.members.length;r++)this.members[r].role===e&&t.push(Object.assign({},this.members[r],{index:r}));return t},memberById:function(e){for(var t=0;t<this.members.length;t++)if(this.members[t].id===e)return Object.assign({},this.members[t],{index:t})},memberByIdAndRole:function(e,t){for(var r=0;r<this.members.length;r++)if(this.members[r].id===e&&this.members[r].role===t)return Object.assign({},this.members[r],{index:r})},addMember:function(e,t){var r=this.members.slice();return r.splice(t===void 0?r.length:t,0,e),this.update({members:r})},updateMember:function(e,t){var r=this.members.slice();return r.splice(t,1,Object.assign({},r[t],e)),this.update({members:r})},removeMember:function(e){var t=this.members.slice();return t.splice(e,1),this.update({members:t})},removeMembersWithID:function(e){var t=this.members.filter(function(r){return r.id!==e});return this.update({members:t})},moveMember:function(e,t){var r=this.members.slice();return r.splice(t,0,r.splice(e,1)[0]),this.update({members:r})},replaceMember:function(e,t,r){if(!this.memberById(e.id))return this;for(var n=[],i=0;i<this.members.length;i++){var a=this.members[i];a.id!==e.id?n.push(a):(r||!this.memberByIdAndRole(t.id,a.role))&&n.push({id:t.id,type:t.type,role:a.role})}return this.update({members:n})},asJXON:function(e){var t={relation:{"@id":this.osmId(),"@version":this.version||0,member:this.members.map(function(r){return{keyAttributes:{type:r.type,role:r.role,ref:Le.id.toOSM(r.id)}}},this),tag:Object.keys(this.tags).map(function(r){return{keyAttributes:{k:r,v:this.tags[r]}}},this)}};return e&&(t.relation["@changeset"]=e),t},asGeoJSON:function(e){return e.transient(this,"GeoJSON",function(){return this.isMultipolygon()?{type:"MultiPolygon",coordinates:this.multipolygon(e)}:{type:"FeatureCollection",properties:this.tags,features:this.members.map(function(t){return Object.assign({role:t.role},e.entity(t.id).asGeoJSON(e))})}})},area:function(e){return e.transient(this,"area",function(){return g1(this.asGeoJSON(e))})},isMultipolygon:function(){return this.tags.type==="multipolygon"},isComplete:function(e){for(var t=0;t<this.members.length;t++)if(!e.hasEntity(this.members[t].id))return!1;return!0},hasFromViaTo:function(){return this.members.some(function(e){return e.role==="from"})&&this.members.some(e=>e.role==="via"||e.role==="intersection"&&this.tags.type==="destination_sign")&&this.members.some(function(e){return e.role==="to"})},isRestriction:function(){return!!(this.tags.type&&this.tags.type.match(/^restriction:?/))},isValidRestriction:function(){if(!this.isRestriction())return!1;var e=this.members.filter(function(n){return n.role==="from"}),t=this.members.filter(function(n){return n.role==="via"}),r=this.members.filter(function(n){return n.role==="to"});return!(e.length!==1&&this.tags.restriction!=="no_entry"||e.some(function(n){return n.type!=="way"})||r.length!==1&&this.tags.restriction!=="no_exit"||r.some(function(n){return n.type!=="way"})||t.length===0||t.length>1&&t.some(function(n){return n.type!=="way"}))},isConnectivity:function(){return!!(this.tags.type&&this.tags.type.match(/^connectivity:?/))},multipolygon:function(e){var t=this.members.filter(function(u){return(u.role||"outer")==="outer"}),r=this.members.filter(function(u){return u.role==="inner"});t=jn(t,e),r=jn(r,e);var n=function(u){return u.nodes.length>2&&u.nodes[0]!==u.nodes[u.nodes.length-1]&&u.nodes.push(u.nodes[0]),u.nodes.map(function(c){return c.loc})};t=t.map(n),r=r.map(n);var i=t.map(function(u){return[g1({type:"Polygon",coordinates:[u]})>2*Math.PI?u.reverse():u]});function a(u){var c,f;for(c=0;c<t.length;c++)if(f=t[c],A4(f,u))return c;for(c=0;c<t.length;c++)if(f=t[c],ao(f,u,!1))return c}for(var o=0;o<r.length;o++){var s=r[o];g1({type:"Polygon",coordinates:[s]})<2*Math.PI&&(s=s.reverse());var l=a(r[o]);l!==void 0?i[l].push(r[o]):i.push([r[o]])}return i}};Object.assign(pn.prototype,Yte)});var $P={};j($P,{QAItem:()=>Lr});var Lr,dw=q(()=>{"use strict";Lr=class e{constructor(t,r,n,i,a){this.loc=t,this.service=r.title,this.itemType=n,this.id=i||`${e.id()}`,this.update(a),r&&typeof r.getIcon=="function"&&(this.icon=r.getIcon(n))}update(t){let{loc:r,service:n,itemType:i,id:a}=this;return Object.keys(t).forEach(o=>this[o]=t[o]),this.loc=r,this.service=n,this.itemType=i,this.id=a,this}static id(){return this.nextId--}};Lr.nextId=-1});var GP={};j(GP,{actionSplit:()=>n1});function n1(e,t){typeof e=="string"&&(e=[e]);var r,n="longest";let i=["roundabout","circular"];var a=[];function o(d,m,h){var g=d.entity(m).loc,A=d.entity(h).loc,v=1e-6;return g&&A?wt(g,A):v}function s(d,m,h){var g=new Array(d.length),A,v,_=0,w;function k(S){return B4(S,d.length)}for(A=0,v=k(m+1);v!==m;v=k(v+1))A+=o(h,d[v],d[k(v-1)]),g[v]=A;for(A=0,v=k(m-1);v!==m;v=k(v-1))A+=o(h,d[v],d[k(v+1)]),A<g[v]&&(g[v]=A);for(v=0;v<d.length;v++){var x=g[v]/o(h,d[m],d[v]);x>_&&(w=v,_=x)}return w}function l(d,m){for(var h=0,g=0;g<m.length-1;g++)h+=o(d,m[g],m[g+1]);return h}function u(d,m,h,g,A){var v=kr({id:g,tags:h.tags}),_,w,k=h.isArea();if(h.isClosed()){var x=h.nodes.slice(0,-1),S=x.indexOf(m),I=A.length>0?x.indexOf(A[0]):s(x,S,d);I<S?(_=x.slice(S).concat(x.slice(0,I+1)),w=x.slice(I,S+1)):(_=x.slice(S,I+1),w=x.slice(I).concat(x.slice(0,S+1)))}else{var b=h.nodes.indexOf(m,1);_=h.nodes.slice(0,b+1),w=h.nodes.slice(b)}var y=l(d,_),E=l(d,w);if(n==="longest"&&E>y){h=h.update({nodes:w}),v=v.update({nodes:_});var M=y;y=E,E=M}else h=h.update({nodes:_}),v=v.update({nodes:w});if(h.tags.step_count){var F=Number(h.tags.step_count);if(F&&isFinite(F)&&F>0&&Math.round(F)===F){var N=Object.assign({},h.tags),D=Object.assign({},v.tags),O=y/(y+E),L=Math.round(F*O);N.step_count=L.toString(),D.step_count=(F-L).toString(),h=h.update({tags:N}),v=v.update({tags:D})}}if(d=d.replace(h),d=d.replace(v),d.parentRelations(h).forEach(function(U){if(U.hasFromViaTo()){var B=U.memberByRole("from"),z=[...U.membersByRole("via"),...U.membersByRole("intersection")],V=U.memberByRole("to"),G;if(B.id===h.id||V.id===h.id){var W=!1;if(z.length===1&&z[0].type==="node")W=v.contains(z[0].id);else for(G=0;G<z.length;G++)if(z[G].type==="way"){var Y=d.hasEntity(z[G].id);if(Y&&Cr(v.nodes,Y.nodes).length){W=!0;break}}W&&(U=U.replaceMember(h,v),d=d.replace(U))}else for(G=0;G<z.length;G++)z[G].type==="way"&&z[G].id===h.id&&(d=c(d,U.id,h,v))}else d=c(d,U.id,h,v)}),k){var P=pn({tags:Object.assign({},h.tags,{type:"multipolygon"}),members:[{id:h.id,role:"outer",type:"way"},{id:v.id,role:"outer",type:"way"}]});d=d.replace(P),d=d.replace(h.update({tags:{}})),d=d.replace(v.update({tags:{}}))}return a.push(v.id),d}function c(d,m,h,g){function A(k,x){return k.nodes.length<2||x.nodes.length<2?!1:i.includes(k.tags.junction)&&k.isClosed()?k.nodes.some(S=>S===x.nodes[0]||S===x.nodes[x.nodes.length-1]):i.includes(x.tags.junction)&&x.isClosed()?x.nodes.some(S=>S===k.nodes[0]||S===k.nodes[k.nodes.length-1]):k.nodes[0]===x.nodes[0]||k.nodes[0]===x.nodes[x.nodes.length-1]||k.nodes[k.nodes.length-1]===x.nodes[x.nodes.length-1]||k.nodes[k.nodes.length-1]===x.nodes[0]}let v=d.entity(m),_=[],w=v.members;for(let k=0;k<w.length;k++){let x=w[k];if(x.id===h.id){let S=!1,I=!1,b=!1,y=!1;if(k>0&&d.hasEntity(w[k-1].id)){let E=d.entity(w[k-1].id);E.type==="way"&&(S=A(E,h),b=A(E,g))}if(k<w.length-1&&d.hasEntity(w[k+1].id)){let E=d.entity(w[k+1].id);E.type==="way"&&(I=A(E,h),y=A(E,g))}if(S&&!I||!b&&y&&!(!S&&I)){_.push({at:k+1,role:x.role});continue}if(!S&&I||b&&!y&&!(S&&!I)){_.push({at:k,role:x.role});continue}if(S&&b&&I&&y){if(k>2&&d.hasEntity(w[k-2].id)){let E=d.entity(w[k-2].id);if(A(E,h)&&!A(E,g)){_.push({at:k,role:x.role});continue}if(A(E,g)&&!A(E,h)){_.push({at:k+1,role:x.role});continue}}if(k<w.length-2&&d.hasEntity(w[k+2].id)){let E=d.entity(w[k+2].id);if(A(E,h)&&!A(E,g)){_.push({at:k+1,role:x.role});continue}if(A(E,g)&&!A(E,h)){_.push({at:k,role:x.role});continue}}}h.nodes[h.nodes.length-1]===g.nodes[0]?_.push({at:k+1,role:x.role}):_.push({at:k,role:x.role})}}return _.reverse().forEach(k=>{d=d.replace(v.addMember({id:g.id,type:"way",role:k.role},k.at)),v=d.entity(v.id)}),d}var f=function(d){a=[];for(var m=0,h=0;h<e.length;h++)for(var g=e[h],A=f.waysForNode(g,d),v=0;v<A.length;v++)d=u(d,g,A[v],t&&t[m],e.slice(v+1)),m+=1;return d};return f.getCreatedWayIDs=function(){return a},f.waysForNode=function(d,m){var h=m.entity(d),g=m.parentWays(h).filter(v);if(!r){var A=g.some(function(_){return _.geometry(m)==="line"});if(A)return g.filter(function(_){return _.geometry(m)==="line"})}return g;function v(_){if(r&&r.indexOf(_.id)===-1)return!1;if(_.isClosed())return!0;for(var w=1;w<_.nodes.length-1;w++)if(_.nodes[w]===d)return!0;return!1}},f.ways=function(d){return Je([].concat.apply([],e.map(function(m){return f.waysForNode(m,d)})))},f.disabled=function(d){for(let m of e){let h=f.waysForNode(m,d);if(h.length===0||r&&r.length!==h.length)return"not_eligible";for(let g of h){let A=d.parentRelations(g);for(let v of A){if(v.hasFromViaTo()){if(![...v.membersByRole("via"),...v.membersByRole("intersection")].every(k=>d.hasEntity(k.id)))return"parent_incomplete"}else for(let w=0;w<v.members.length;w++)if(v.members[w].id===g.id){let k=w>0&&d.hasEntity(v.members[w-1].id),x=w<v.members.length-1&&d.hasEntity(v.members[w+1].id);if(!k&&!x&&v.members.length>1)return"parent_incomplete"}let _=["junction","enforcement"];if(i.includes(g.tags.junction)&&g.isClosed()&&!_.includes(v.tags.type))return"simple_roundabout"}}}},f.limitWays=function(d){return arguments.length?(r=d,f):r},f.keepHistoryOn=function(d){return arguments.length?(n=d,f):n},f}var _3=q(()=>{"use strict";yi();K7();X7();Ie()});var WP={};j(WP,{coreGraph:()=>kn});function kn(e,t){if(!(this instanceof kn))return new kn(e,t);if(e instanceof kn){var r=e.base();this.entities=Object.assign(Object.create(r.entities),e.entities),this._parentWays=Object.assign(Object.create(r.parentWays),e._parentWays),this._parentRels=Object.assign(Object.create(r.parentRels),e._parentRels)}else this.entities=Object.create({}),this._parentWays=Object.create({}),this._parentRels=Object.create({}),this.rebase(e||[],[this]);this.transients={},this._childNodes={},this.frozen=!t}var G4=q(()=>{"use strict";Z7();Ie();kn.prototype={hasEntity:function(e){return this.entities[e]},entity:function(e){var t=this.entities[e];if(t||(t=this.entities.__proto__[e]),!t)throw new Error("entity "+e+" not found");return t},geometry:function(e){return this.entity(e).geometry(this)},transient:function(e,t,r){var n=e.id,i=this.transients[n]||(this.transients[n]={});return i[t]!==void 0||(i[t]=r.call(e)),i[t]},parentWays:function(e){var t=this._parentWays[e.id],r=[];return t&&t.forEach(function(n){r.push(this.entity(n))},this),r},isPoi:function(e){var t=this._parentWays[e.id];return!t||t.size===0},isShared:function(e){var t=this._parentWays[e.id];return t&&t.size>1},parentRelations:function(e){var t=this._parentRels[e.id],r=[];return t&&t.forEach(function(n){r.push(this.entity(n))},this),r},parentMultipolygons:function(e){return this.parentRelations(e).filter(function(t){return t.isMultipolygon()})},childNodes:function(e){if(this._childNodes[e.id])return this._childNodes[e.id];if(!e.nodes)return[];for(var t=[],r=0;r<e.nodes.length;r++)t[r]=this.entity(e.nodes[r]);return k3&&Object.freeze(t),this._childNodes[e.id]=t,this._childNodes[e.id]},base:function(){return{entities:Object.getPrototypeOf(this.entities),parentWays:Object.getPrototypeOf(this._parentWays),parentRels:Object.getPrototypeOf(this._parentRels)}},rebase:function(e,t,r){var n=this.base(),i,a,o,s;for(i=0;i<e.length;i++){var l=e[i];if(!(!l.visible||!r&&n.entities[l.id])&&(n.entities[l.id]=l,this._updateCalculated(void 0,l,n.parentWays,n.parentRels),l.type==="way"))for(a=0;a<l.nodes.length;a++)for(s=l.nodes[a],o=1;o<t.length;o++){var u=t[o].entities;u.hasOwnProperty(s)&&u[s]===void 0&&delete u[s]}}for(i=0;i<t.length;i++)t[i]._updateRebased()},_updateRebased:function(){var e=this.base();Object.keys(this._parentWays).forEach(function(t){e.parentWays[t]&&e.parentWays[t].forEach(function(r){this.entities.hasOwnProperty(r)||this._parentWays[t].add(r)},this)},this),Object.keys(this._parentRels).forEach(function(t){e.parentRels[t]&&e.parentRels[t].forEach(function(r){this.entities.hasOwnProperty(r)||this._parentRels[t].add(r)},this)},this),this.transients={}},_updateCalculated:function(e,t,r,n){r=r||this._parentWays,n=n||this._parentRels;var i=t&&t.type||e&&e.type,a,o,s;if(i==="way"){for(e&&t?(a=yr(e.nodes,t.nodes),o=yr(t.nodes,e.nodes)):e?(a=e.nodes,o=[]):t&&(a=[],o=t.nodes),s=0;s<a.length;s++)r[a[s]]=new Set(r[a[s]]),r[a[s]].delete(e.id);for(s=0;s<o.length;s++)r[o[s]]=new Set(r[o[s]]),r[o[s]].add(t.id)}else if(i==="relation"){var l=e?e.members.map(function(c){return c.id}):[],u=t?t.members.map(function(c){return c.id}):[];for(e&&t?(a=yr(l,u),o=yr(u,l)):e?(a=l,o=[]):t&&(a=[],o=u),s=0;s<a.length;s++)n[a[s]]=new Set(n[a[s]]),n[a[s]].delete(e.id);for(s=0;s<o.length;s++)n[o[s]]=new Set(n[o[s]]),n[o[s]].add(t.id)}},replace:function(e){return this.entities[e.id]===e?this:this.update(function(){this._updateCalculated(this.entities[e.id],e),this.entities[e.id]=e})},remove:function(e){return this.update(function(){this._updateCalculated(e,void 0),this.entities[e.id]=void 0})},revert:function(e){var t=this.base().entities[e],r=this.entities[e];return r===t?this:this.update(function(){this._updateCalculated(r,t),delete this.entities[e]})},update:function(){for(var e=this.frozen?kn(this,!0):this,t=0;t<arguments.length;t++)arguments[t].call(e,e);return this.frozen&&(e.frozen=!0),e},load:function(e){var t=this.base();this.entities=Object.create(t.entities);for(var r in e)this.entities[r]=e[r],this._updateCalculated(t.entities[r],this.entities[r]);return this}}});var QP={};j(QP,{osmInferRestriction:()=>W4,osmIntersection:()=>E3,osmTurn:()=>B1});function B1(e){if(!(this instanceof B1))return new B1(e);Object.assign(this,e)}function E3(e,t,r){r=r||30;var n=kn(),i,a,o;function s(G){return e.parentRelations(G).some(function(W){return W.isRestriction()})}function l(G){if(G.isArea()||G.isDegenerate())return!1;var W={motorway:!0,motorway_link:!0,trunk:!0,trunk_link:!0,primary:!0,primary_link:!0,secondary:!0,secondary_link:!0,tertiary:!0,tertiary_link:!0,residential:!0,unclassified:!0,living_street:!0,service:!0,busway:!0,road:!0,track:!0};return W[G.tags.highway]}for(var u=e.entity(t),c=[u],f,d=[],m=[],h,g=[],A=[],v,_=[],w,k=[],x,S=[];c.length;){h=c.pop(),f=e.parentWays(h);var I=!1;for(i=0;i<f.length;i++)if(v=f[i],!(!l(v)&&!s(v))){for(g.push(v),I=!0,_=Je(e.childNodes(v)),a=0;a<_.length;a++)if(w=_[a],w!==h&&d.indexOf(w)===-1&&!(wt(w.loc,u.loc)>r)){var b=!1;for(k=e.parentWays(w),o=0;o<k.length;o++)if(x=k[o],x!==v&&g.indexOf(x)===-1&&l(x)){b=!0;break}b&&c.push(w)}}I&&d.push(h)}d=Je(d),g=Je(g),g.forEach(function(G){e.childNodes(G).forEach(function(W){n=n.replace(W)}),n=n.replace(G),e.parentRelations(G).forEach(function(W){W.isRestriction()&&(W.isValidRestriction(e)?n=n.replace(W):W.isComplete(e)&&S.push(Kr(W.id)))})}),g.forEach(function(G){var W=n.entity(G.id);if(W.tags.oneway==="-1"){var Y=Ji(W.id,{reverseOneway:!0});S.push(Y),n=Y(n)}});var y=Le.id.next.way;d.forEach(function(G){var W=n1([G.id]).keepHistoryOn("first");W.disabled(n)||W.ways(n).forEach(function(Y){var J=n1([G.id]).limitWays([Y.id]).keepHistoryOn("first");S.push(J),n=J(n)})}),Le.id.next.way=y,m=d.map(function(G){return G.id}),d=[],g=[],m.forEach(function(G){var W=n.entity(G),Y=n.parentWays(W);d.push(W),g=g.concat(Y)}),d=Je(d),g=Je(g),m=d.map(function(G){return G.id}),A=g.map(function(G){return G.id});function E(G,W){var Y=G.isOneWay()&&!G.isBiDirectional(),J=W.indexOf(G.first())!==-1,oe=W.indexOf(G.last())!==-1,Ce=J&&oe,se=J&&!Y||oe,ne=J||oe&&!Y;return G.update({__first:J,__last:oe,__from:se,__via:Ce,__to:ne,__oneWay:Y})}g=[],A.forEach(function(G){var W=E(n.entity(G),m);n=n.replace(W),g.push(W)});var M,F=[],N=[];do for(M=!1,c=m.slice(),i=0;i<c.length;i++){var D=c[i];if(h=n.hasEntity(D),!h){m.indexOf(D)!==-1&&m.splice(m.indexOf(D),1),N.push(D);continue}if(k=n.parentWays(h),k.length<3&&m.indexOf(D)!==-1&&m.splice(m.indexOf(D),1),k.length===2){var O=k[0],L=k[1],P=O&&!O.__via,U=L&&!L.__via,B,z;P&&!U?(B=O,z=L):!P&&U&&(B=L,z=O),B&&z&&(z=E(z,m),n=n.replace(z).remove(B),F.push(B.id),M=!0)}k=n.parentWays(h),k.length<2&&(m.indexOf(D)!==-1&&m.splice(m.indexOf(D),1),N.push(D),M=!0),k.length<1&&(n=n.remove(h))}while(M);d=d.filter(function(G){return N.indexOf(G.id)===-1}).map(function(G){return n.entity(G.id)}),g=g.filter(function(G){return F.indexOf(G.id)===-1}).map(function(G){return n.entity(G.id)});var V={graph:n,actions:S,vertices:d,ways:g};return V.turns=function(G,W){if(!G)return[];W||(W=0);var Y=V.graph,J=V.vertices.map(function(Z){return Z.id}),oe=Y.entity(G);if(!oe||!(oe.__from||oe.__via))return[];var Ce=W*2+3,se=[];return ne(oe),se;function ne(Z,te,ye,we){te=(te||[]).slice(),!(te.length>=Ce)&&(te.push(Z.id),ye=(ye||[]).slice(),Z.type==="node"?he(Z,te,ye):Se(Z,te,ye,we))}function he(Z,te,ye){var we,Ne,Be=Y.parentWays(Z),le=[];for(we=0;we<Be.length;we++){var ie=Be[we];if(!(ie.__oneWay&&ie.nodes[0]!==Z.id)&&!(te.indexOf(ie.id)!==-1&&te.length>=3)){var ve=null;for(Ne=0;Ne<ye.length;Ne++){var be=ye[Ne],Te=be.memberByRole("from"),Oe=be.membersByRole("via"),Ve=be.memberByRole("to"),Qe=/^no_/.test(be.tags.restriction),ct=/^only_/.test(be.tags.restriction);if(Qe||ct){var rt=Te.id===G,We=!1,Rt=!1;if(Ve.id===ie.id)if(Oe.length===1&&Oe[0].type==="node")We=Oe[0].id===Z.id&&(rt&&te.length===2||!rt&&te.length>2);else{var lt=[];for(o=2;o<te.length;o+=2)lt.push(te[o]);var vt=[];for(o=0;o<Oe.length;o++)Oe[o].type==="way"&&vt.push(Oe[o].id);var _t=yr(lt,vt);We=!_t.length}else if(ct){for(o=0;o<Oe.length;o++)if(Oe[o].type==="way"&&Oe[o].id===ie.id){Rt=!0;break}}if(We?ct?ve={id:be.id,direct:rt,from:Te.id,only:!0,end:!0}:ve={id:be.id,direct:rt,from:Te.id,no:!0,end:!0}:Rt?ve={id:be.id,direct:!1,from:Te.id,only:!0,end:!1}:ct&&(ve={id:be.id,direct:!1,from:Te.id,no:!0,end:!0}),ve&&ve.direct)break}}le.push({way:ie,restrict:ve})}}le.forEach(function(wr){ne(wr.way,te,ye,wr.restrict)})}function Se(Z,te,ye,we){var Ne;if(te.length>=3){var Be=te.slice();if(we&&we.direct===!1){for(Ne=0;Ne<Be.length;Ne++)if(Be[Ne]===we.from){Be=Be.slice(Ne);break}}var le=re(Be);if(le&&(we&&(le.restrictionID=we.id,le.no=we.no,le.only=we.only,le.direct=we.direct),se.push(B1(le))),te[0]===te[2])return}if(!(we&&we.end)){var ie=Y.entity(Z.first()),ve=Y.entity(Z.last()),be=wt(ie.loc,ve.loc),Te=[];te.length>1&&(be>r||!Z.__via)||(!Z.__oneWay&&J.indexOf(ie.id)!==-1&&te.indexOf(ie.id)===-1&&Te.push(ie),J.indexOf(ve.id)!==-1&&te.indexOf(ve.id)===-1&&Te.push(ve),Te.forEach(function(Oe){var Ve=Y.parentRelations(Z).filter(function(Qe){if(!Qe.isRestriction())return!1;var ct=Qe.memberByRole("from");if(!ct||ct.id!==Z.id)return!1;var rt=/^only_/.test(Qe.tags.restriction);if(!rt)return!0;var We=!1,Rt=Qe.membersByRole("via");if(Rt.length===1&&Rt[0].type==="node")We=Rt[0].id===Oe.id;else for(var lt=0;lt<Rt.length;lt++)if(Rt[lt].type==="way"){var vt=Y.entity(Rt[lt].id);if(vt.first()===Oe.id||vt.last()===Oe.id){We=!0;break}}return We});ne(Oe,te,ye.concat(Ve),!1)}))}}function re(Z){if(Z.length<3)return;var te,ye,we,Ne,Be,le,ie,ve,be;if(te=Z[0],Ne=Z[Z.length-1],Z.length===3&&te===Ne){var Te=Y.entity(te);if(Te.__oneWay)return null;be=!0,ve=we=le=Z[1],ye=Be=Oe(te,ve)}else be=!1,we=Z[1],ye=Oe(te,we),le=Z[Z.length-2],Be=Oe(Ne,le),Z.length===3?ve=Z[1]:(ie=Z.filter(function(Ve){return Ve[0]==="w"}),ie=ie.slice(1,ie.length-1));return{key:Z.join("_"),path:Z,from:{node:ye,way:te,vertex:we},via:{node:ve,ways:ie},to:{node:Be,way:Ne,vertex:le},u:be};function Oe(Ve,Qe){var ct=Y.entity(Ve).nodes;return Qe===ct[0]?ct[1]:ct[ct.length-2]}}},V}function W4(e,t,r){for(var n=e.entity(t.from.way),i=e.entity(t.from.node),a=e.entity(t.from.vertex),o=e.entity(t.to.way),s=e.entity(t.to.node),l=e.entity(t.to.vertex),u=n.tags.oneway==="yes",c=o.tags.oneway==="yes",f=(fn(a,i,r)-fn(l,s,r))*180/Math.PI;f<0;)f+=360;return i===s||(f<23||f>336)&&u&&c||(f<40||f>319)&&u&&c&&t.from.vertex!==t.to.vertex?"no_u_turn":f<158?"no_right_turn":f>202?"no_left_turn":"no_straight_on"}var pw=q(()=>{"use strict";mo();c4();_3();G4();He();t1();Ie()});var HP={};j(HP,{osmLanes:()=>A3});function A3(e){if(e.type!=="way"||!e.tags.highway)return null;var t=e.tags,r=e.isOneWay(),n=Kte(t,r),i=Xte(t),a=Zte(t,r,n),o=a.forward,s=a.backward,l=a.bothways,u={};u.unspecified=mw(t["turn:lanes"]),u.forward=mw(t["turn:lanes:forward"]),u.backward=mw(t["turn:lanes:backward"]);var c={};c.unspecified=hw(t["maxspeed:lanes"],i),c.forward=hw(t["maxspeed:lanes:forward"],i),c.backward=hw(t["maxspeed:lanes:backward"],i);var f={};f.unspecified=Vi(t["psv:lanes"]),f.forward=Vi(t["psv:lanes:forward"]),f.backward=Vi(t["psv:lanes:backward"]);var d={};d.unspecified=Vi(t["bus:lanes"]),d.forward=Vi(t["bus:lanes:forward"]),d.backward=Vi(t["bus:lanes:backward"]);var m={};m.unspecified=Vi(t["taxi:lanes"]),m.forward=Vi(t["taxi:lanes:forward"]),m.backward=Vi(t["taxi:lanes:backward"]);var h={};h.unspecified=Vi(t["hov:lanes"]),h.forward=Vi(t["hov:lanes:forward"]),h.backward=Vi(t["hov:lanes:backward"]);var g={};g.unspecified=Vi(t["hgv:lanes"]),g.forward=Vi(t["hgv:lanes:forward"]),g.backward=Vi(t["hgv:lanes:backward"]);var A={};A.unspecified=gw(t["bicycleway:lanes"]),A.forward=gw(t["bicycleway:lanes:forward"]),A.backward=gw(t["bicycleway:lanes:backward"]);var v={forward:[],backward:[],unspecified:[]};return Q4(v,u,"turnLane"),Q4(v,c,"maxspeed"),Q4(v,f,"psv"),Q4(v,d,"bus"),Q4(v,m,"taxi"),Q4(v,h,"hov"),Q4(v,g,"hgv"),Q4(v,A,"bicycleway"),{metadata:{count:n,oneway:r,forward:o,backward:s,bothways:l,turnLanes:u,maxspeed:i,maxspeedLanes:c,psvLanes:f,busLanes:d,taxiLanes:m,hovLanes:h,hgvLanes:g,bicyclewayLanes:A},lanes:v}}function Kte(e,t){var r;if(e.lanes&&(r=parseInt(e.lanes,10),r>0))return r;switch(e.highway){case"trunk":case"motorway":r=t?2:4;break;default:r=t?1:2;break}return r}function Xte(e){var t=e.maxspeed;if(t){var r=/^([0-9][\.0-9]+?)(?:[ ]?(?:km\/h|kmh|kph|mph|knots))?$/;if(r.test(t))return parseInt(t,10)}}function Zte(e,t,r){var n=parseInt(e["lanes:forward"],10),i=parseInt(e["lanes:backward"],10),a=parseInt(e["lanes:both_ways"],10)>0?1:0;return parseInt(e.oneway,10)===-1?(n=0,a=0,i=r):t?(n=r,a=0,i=0):isNaN(n)&&isNaN(i)?(i=Math.floor((r-a)/2),n=r-a-i):isNaN(n)?(i>r-a&&(i=r-a),n=r-a-i):isNaN(i)&&(n>r-a&&(n=r-a),i=r-a-n),{forward:n,backward:i,bothways:a}}function mw(e){if(e){var t=["left","slight_left","sharp_left","through","right","slight_right","sharp_right","reverse","merge_to_left","merge_to_right","none"];return e.split("|").map(function(r){return r===""&&(r="none"),r.split(";").map(function(n){return t.indexOf(n)===-1?"unknown":n})})}}function hw(e,t){if(e)return e.split("|").map(function(r){if(r==="none")return r;var n=parseInt(r,10);return r===""||n===t?null:isNaN(n)?"unknown":n})}function Vi(e){if(e){var t=["yes","no","designated"];return e.split("|").map(function(r){return r===""&&(r="no"),t.indexOf(r)===-1?"unknown":r})}}function gw(e){if(e){var t=["yes","no","designated","lane"];return e.split("|").map(function(r){return r===""&&(r="no"),t.indexOf(r)===-1?"unknown":r})}}function Q4(e,t,r){t.forward&&t.forward.forEach(function(n,i){e.forward[i]||(e.forward[i]={}),e.forward[i][r]=n}),t.backward&&t.backward.forEach(function(n,i){e.backward[i]||(e.backward[i]={}),e.backward[i][r]=n}),t.unspecified&&t.unspecified.forEach(function(n,i){e.unspecified[i]||(e.unspecified[i]={}),e.unspecified[i][r]=n})}var zd=q(()=>{"use strict"});var jP={};j(jP,{QAItem:()=>Lr,osmAreaKeys:()=>Ho,osmChangeset:()=>qi,osmEntity:()=>Le,osmFlowingWaterwayTagValues:()=>F4,osmInferRestriction:()=>W4,osmIntersection:()=>E3,osmIsInterestingTag:()=>I1,osmJoinWays:()=>jn,osmLanes:()=>A3,osmLifecyclePrefixes:()=>M1,osmNode:()=>Nt,osmNodeGeometriesForTags:()=>N1,osmNote:()=>br,osmPavedTags:()=>m2,osmPointTags:()=>D4,osmRailwayTrackTagValues:()=>t3,osmRelation:()=>pn,osmRemoveLifecyclePrefix:()=>p2,osmRoutableHighwayTagValues:()=>aa,osmSetAreaKeys:()=>X0,osmSetPointTags:()=>Z0,osmSetVertexTags:()=>J0,osmTagSuggestingArea:()=>T1,osmTurn:()=>B1,osmVertexTags:()=>P4,osmWay:()=>kr});var lr=q(()=>{"use strict";cw();t1();e1();fw();K7();X7();dw();pw();zd();E2();Dr()});var YP={};j(YP,{actionMergePolygon:()=>S3});function S3(e,t){function r(i){var a=e.map(function(s){return i.entity(s)}),o=pr(a,function(s){return s.type==="way"&&s.isClosed()?"closedWay":s.type==="relation"&&s.isMultipolygon()?"multipolygon":"other"});return Object.assign({closedWay:[],multipolygon:[],other:[]},o)}var n=function(i){for(var a=r(i),o=a.multipolygon.reduce(function(g,A){return g.concat(jn(A.members,i))},[]).concat(a.closedWay.map(function(g){var A=[{id:g.id}];return A.nodes=i.childNodes(g),A})),s=o.map(function(g,A){return o.map(function(v,_){return A===_?null:A4(v.nodes.map(function(w){return w.loc}),g.nodes.map(function(w){return w.loc}))})}),l=[],u=!0;o.length;)d(o),o=o.filter(c),s=s.filter(c).map(f);function c(g,A){return s[A].some(function(v){return v})}function f(g){return g.filter(c)}function d(g){g.forEach(function(A,v){c(A,v)||A.forEach(function(_){l.push({type:"way",id:_.id,role:u?"outer":"inner"})})}),u=!u}var m;if(a.multipolygon.length>0){var h=Zo(a.multipolygon.map(g=>g.id));m=a.multipolygon.find(g=>g.id===h)}else m=pn({id:t,tags:{type:"multipolygon"}});return a.multipolygon.forEach(function(g){g.id!==m.id&&(m=m.mergeTags(g.tags),i=i.remove(g))}),a.closedWay.forEach(function(g){function A(v){return v.id===g.id&&v.role!=="inner"}l.some(A)&&(m=m.mergeTags(g.tags),i=i.replace(g.update({tags:{}})))}),i.replace(m.update({members:l,tags:Tn(m.tags,["area"])}))};return n.disabled=function(i){var a=r(i);if(a.other.length>0||a.closedWay.length+a.multipolygon.length<2)return"not_eligible";if(!a.multipolygon.every(function(s){return s.isComplete(i)}))return"incomplete_relation";if(a.multipolygon.length){if(a.closedWay.some(function(s){return Cr(i.parentMultipolygons(s),a.multipolygon).length}))return"not_eligible"}else{var o=[];if(a.closedWay.forEach(function(s,l){l===0?o=i.parentMultipolygons(s):o=Cr(o,i.parentMultipolygons(s))}),o=o.filter(function(s){return s.members.length===a.closedWay.length}),o.length)return"not_eligible"}},n}var qd=q(()=>{"use strict";He();lr();Ie()});var go=an((vde,KP)=>{"use strict";KP.exports=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,i,a;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(a=Object.keys(t),n=a.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[i]))return!1;for(i=n;i--!==0;){var o=a[i];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}});function Jte(e,t){let r={};for(let a=0;a<t.length;a++){let o=t[a];r[o]?r[o].push(a):r[o]=[a]}let i=[{buffer1index:-1,buffer2index:-1,chain:null}];for(let a=0;a<e.length;a++){let o=e[a],s=r[o]||[],l=0,u=i[0];for(let c=0;c<s.length;c++){let f=s[c],d;for(d=l;d<i.length&&!(i[d].buffer2index<f&&(d===i.length-1||i[d+1].buffer2index>f));d++);if(d<i.length){let m={buffer1index:a,buffer2index:f,chain:i[d]};if(l===i.length?i.push(u):i[l]=u,l=d+1,u=m,l===i.length)break}}i[l]=u}return i[i.length-1]}function XP(e,t){let r=Jte(e,t),n=[],i=e.length,a=t.length;for(let o=r;o!==null;o=o.chain){let s=i-o.buffer1index-1,l=a-o.buffer2index-1;i=o.buffer1index,a=o.buffer2index,(s||l)&&n.push({buffer1:[i+1,s],buffer1Content:e.slice(i+1,i+1+s),buffer2:[a+1,l],buffer2Content:t.slice(a+1,a+1+l)})}return n.reverse(),n}function ere(e,t,r){let n=[];function i(l,u){n.push({ab:u,oStart:l.buffer1[0],oLength:l.buffer1[1],abStart:l.buffer2[0],abLength:l.buffer2[1]})}XP(t,e).forEach(l=>i(l,"a")),XP(t,r).forEach(l=>i(l,"b")),n.sort((l,u)=>l.oStart-u.oStart);let a=[],o=0;function s(l){l>o&&(a.push({stable:!0,buffer:"o",bufferStart:o,bufferLength:l-o,bufferContent:t.slice(o,l)}),o=l)}for(;n.length;){let l=n.shift(),u=l.oStart,c=l.oStart+l.oLength,f=[l];for(s(u);n.length;){let d=n[0],m=d.oStart;if(m>c)break;c=Math.max(c,m+d.oLength),f.push(n.shift())}if(f.length===1){if(l.abLength>0){let d=l.ab==="a"?e:r;a.push({stable:!0,buffer:l.ab,bufferStart:l.abStart,bufferLength:l.abLength,bufferContent:d.slice(l.abStart,l.abStart+l.abLength)})}}else{let d={a:[e.length,-1,t.length,-1],b:[r.length,-1,t.length,-1]};for(;f.length;){l=f.shift();let _=l.oStart,w=_+l.oLength,k=l.abStart,x=k+l.abLength,S=d[l.ab];S[0]=Math.min(k,S[0]),S[1]=Math.max(x,S[1]),S[2]=Math.min(_,S[2]),S[3]=Math.max(w,S[3])}let m=d.a[0]+(u-d.a[2]),h=d.a[1]+(c-d.a[3]),g=d.b[0]+(u-d.b[2]),A=d.b[1]+(c-d.b[3]),v={stable:!1,aStart:m,aLength:h-m,aContent:e.slice(m,h),oStart:u,oLength:c-u,oContent:t.slice(u,c),bStart:g,bLength:A-g,bContent:r.slice(g,A)};a.push(v)}o=c}return s(t.length),a}function ZP(e,t,r,n){n=Object.assign({excludeFalseConflicts:!0,stringSeparator:/\s+/},n),typeof e=="string"&&(e=e.split(n.stringSeparator)),typeof t=="string"&&(t=t.split(n.stringSeparator)),typeof r=="string"&&(r=r.split(n.stringSeparator));let a=[],o=ere(e,t,r),s=[];function l(){s.length&&a.push({ok:s}),s=[]}function u(c,f){if(c.length!==f.length)return!1;for(let d=0;d<c.length;d++)if(c[d]!==f[d])return!1;return!0}return o.forEach(c=>{c.stable?s.push(...c.bufferContent):n.excludeFalseConflicts&&u(c.aContent,c.bContent)?s.push(...c.aContent):(l(),a.push({conflict:{a:c.aContent,aIndex:c.aStart,o:c.oContent,oIndex:c.oStart,b:c.bContent,bIndex:c.bStart}}))}),l(),a}var JP=q(()=>{});var I3=an((C3,J7)=>{(function(){var e,t="4.17.21",r=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",i="Expected a function",a="Invalid `variable` option passed into `_.template`",o="__lodash_hash_undefined__",s=500,l="__lodash_placeholder__",u=1,c=2,f=4,d=1,m=2,h=1,g=2,A=4,v=8,_=16,w=32,k=64,x=128,S=256,I=512,b=30,y="...",E=800,M=16,F=1,N=2,D=3,O=1/0,L=9007199254740991,P=17976931348623157e292,U=NaN,B=4294967295,z=B-1,V=B>>>1,G=[["ary",x],["bind",h],["bindKey",g],["curry",v],["curryRight",_],["flip",I],["partial",w],["partialRight",k],["rearg",S]],W="[object Arguments]",Y="[object Array]",J="[object AsyncFunction]",oe="[object Boolean]",Ce="[object Date]",se="[object DOMException]",ne="[object Error]",he="[object Function]",Se="[object GeneratorFunction]",re="[object Map]",Z="[object Number]",te="[object Null]",ye="[object Object]",we="[object Promise]",Ne="[object Proxy]",Be="[object RegExp]",le="[object Set]",ie="[object String]",ve="[object Symbol]",be="[object Undefined]",Te="[object WeakMap]",Oe="[object WeakSet]",Ve="[object ArrayBuffer]",Qe="[object DataView]",ct="[object Float32Array]",rt="[object Float64Array]",We="[object Int8Array]",Rt="[object Int16Array]",lt="[object Int32Array]",vt="[object Uint8Array]",_t="[object Uint8ClampedArray]",wr="[object Uint16Array]",tn="[object Uint32Array]",rn=/\b__p \+= '';/g,Si=/\b(__p \+=) '' \+/g,Fo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,hn=/&(?:amp|lt|gt|quot|#39);/g,Ci=/[&<>"']/g,gn=RegExp(hn.source),Ha=RegExp(Ci.source),Hi=/<%-([\s\S]+?)%>/g,ns=/<%([\s\S]+?)%>/g,ba=/<%=([\s\S]+?)%>/g,wa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Xs=/^\w*$/,gc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,f0=/[\\^$.*+?()[\]{}|]/g,vc=RegExp(f0.source),Rl=/^\s+/,d0=/\s/,yc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,bc=/\{\n\/\* \[wrapped with (.+)\] \*/,wc=/,? & /,xc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,iv=/[()=,{}\[\]\/\s]/,av=/\\(\\)?/g,ov=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Fn=/\w*$/,Ll=/^[-+]0x[0-9a-f]+$/i,_c=/^0b[01]+$/i,Ul=/^\[object .+?Constructor\]$/,A6=/^0o[0-7]+$/i,S6=/^(?:0|[1-9]\d*)$/,kc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Bl=/($^)/,Zs=/['\n\r\u2028\u2029\\]/g,ji="\\ud800-\\udfff",zl="\\u0300-\\u036f",ql="\\ufe20-\\ufe2f",Js="\\u20d0-\\u20ff",p0=zl+ql+Js,lA="\\u2700-\\u27bf",uA="a-z\\xdf-\\xf6\\xf8-\\xff",IW="\\xac\\xb1\\xd7\\xf7",MW="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",TW="\\u2000-\\u206f",NW=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",cA="A-Z\\xc0-\\xd6\\xd8-\\xde",fA="\\ufe0e\\ufe0f",dA=IW+MW+TW+NW,sv="['\u2019]",DW="["+ji+"]",pA="["+dA+"]",Ec="["+p0+"]",mA="\\d+",PW="["+lA+"]",hA="["+uA+"]",gA="[^"+ji+dA+mA+lA+uA+cA+"]",lv="\\ud83c[\\udffb-\\udfff]",FW="(?:"+Ec+"|"+lv+")",vA="[^"+ji+"]",uv="(?:\\ud83c[\\udde6-\\uddff]){2}",cv="[\\ud800-\\udbff][\\udc00-\\udfff]",m0="["+cA+"]",yA="\\u200d",bA="(?:"+hA+"|"+gA+")",OW="(?:"+m0+"|"+gA+")",wA="(?:"+sv+"(?:d|ll|m|re|s|t|ve))?",xA="(?:"+sv+"(?:D|LL|M|RE|S|T|VE))?",_A=FW+"?",kA="["+fA+"]?",RW="(?:"+yA+"(?:"+[vA,uv,cv].join("|")+")"+kA+_A+")*",LW="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",UW="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",EA=kA+_A+RW,BW="(?:"+[PW,uv,cv].join("|")+")"+EA,zW="(?:"+[vA+Ec+"?",Ec,uv,cv,DW].join("|")+")",qW=RegExp(sv,"g"),VW=RegExp(Ec,"g"),fv=RegExp(lv+"(?="+lv+")|"+zW+EA,"g"),$W=RegExp([m0+"?"+hA+"+"+wA+"(?="+[pA,m0,"$"].join("|")+")",OW+"+"+xA+"(?="+[pA,m0+bA,"$"].join("|")+")",m0+"?"+bA+"+"+wA,m0+"+"+xA,UW,LW,mA,BW].join("|"),"g"),GW=RegExp("["+yA+ji+p0+fA+"]"),WW=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,QW=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],HW=-1,Br={};Br[ct]=Br[rt]=Br[We]=Br[Rt]=Br[lt]=Br[vt]=Br[_t]=Br[wr]=Br[tn]=!0,Br[W]=Br[Y]=Br[Ve]=Br[oe]=Br[Qe]=Br[Ce]=Br[ne]=Br[he]=Br[re]=Br[Z]=Br[ye]=Br[Be]=Br[le]=Br[ie]=Br[Te]=!1;var Or={};Or[W]=Or[Y]=Or[Ve]=Or[Qe]=Or[oe]=Or[Ce]=Or[ct]=Or[rt]=Or[We]=Or[Rt]=Or[lt]=Or[re]=Or[Z]=Or[ye]=Or[Be]=Or[le]=Or[ie]=Or[ve]=Or[vt]=Or[_t]=Or[wr]=Or[tn]=!0,Or[ne]=Or[he]=Or[Te]=!1;var jW={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},YW={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},KW={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},XW={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ZW=parseFloat,JW=parseInt,AA=typeof global=="object"&&global&&global.Object===Object&&global,eQ=typeof self=="object"&&self&&self.Object===Object&&self,$n=AA||eQ||Function("return this")(),dv=typeof C3=="object"&&C3&&!C3.nodeType&&C3,Vl=dv&&typeof J7=="object"&&J7&&!J7.nodeType&&J7,SA=Vl&&Vl.exports===dv,pv=SA&&AA.process,ja=function(){try{var fe=Vl&&Vl.require&&Vl.require("util").types;return fe||pv&&pv.binding&&pv.binding("util")}catch{}}(),CA=ja&&ja.isArrayBuffer,IA=ja&&ja.isDate,MA=ja&&ja.isMap,TA=ja&&ja.isRegExp,NA=ja&&ja.isSet,DA=ja&&ja.isTypedArray;function xa(fe,De,Ee){switch(Ee.length){case 0:return fe.call(De);case 1:return fe.call(De,Ee[0]);case 2:return fe.call(De,Ee[0],Ee[1]);case 3:return fe.call(De,Ee[0],Ee[1],Ee[2])}return fe.apply(De,Ee)}function tQ(fe,De,Ee,et){for(var kt=-1,vr=fe==null?0:fe.length;++kt<vr;){var On=fe[kt];De(et,On,Ee(On),fe)}return et}function Ya(fe,De){for(var Ee=-1,et=fe==null?0:fe.length;++Ee<et&&De(fe[Ee],Ee,fe)!==!1;);return fe}function rQ(fe,De){for(var Ee=fe==null?0:fe.length;Ee--&&De(fe[Ee],Ee,fe)!==!1;);return fe}function PA(fe,De){for(var Ee=-1,et=fe==null?0:fe.length;++Ee<et;)if(!De(fe[Ee],Ee,fe))return!1;return!0}function e4(fe,De){for(var Ee=-1,et=fe==null?0:fe.length,kt=0,vr=[];++Ee<et;){var On=fe[Ee];De(On,Ee,fe)&&(vr[kt++]=On)}return vr}function Ac(fe,De){var Ee=fe==null?0:fe.length;return!!Ee&&h0(fe,De,0)>-1}function mv(fe,De,Ee){for(var et=-1,kt=fe==null?0:fe.length;++et<kt;)if(Ee(De,fe[et]))return!0;return!1}function Wr(fe,De){for(var Ee=-1,et=fe==null?0:fe.length,kt=Array(et);++Ee<et;)kt[Ee]=De(fe[Ee],Ee,fe);return kt}function t4(fe,De){for(var Ee=-1,et=De.length,kt=fe.length;++Ee<et;)fe[kt+Ee]=De[Ee];return fe}function hv(fe,De,Ee,et){var kt=-1,vr=fe==null?0:fe.length;for(et&&vr&&(Ee=fe[++kt]);++kt<vr;)Ee=De(Ee,fe[kt],kt,fe);return Ee}function nQ(fe,De,Ee,et){var kt=fe==null?0:fe.length;for(et&&kt&&(Ee=fe[--kt]);kt--;)Ee=De(Ee,fe[kt],kt,fe);return Ee}function gv(fe,De){for(var Ee=-1,et=fe==null?0:fe.length;++Ee<et;)if(De(fe[Ee],Ee,fe))return!0;return!1}var iQ=vv("length");function aQ(fe){return fe.split("")}function oQ(fe){return fe.match(xc)||[]}function FA(fe,De,Ee){var et;return Ee(fe,function(kt,vr,On){if(De(kt,vr,On))return et=vr,!1}),et}function Sc(fe,De,Ee,et){for(var kt=fe.length,vr=Ee+(et?1:-1);et?vr--:++vr<kt;)if(De(fe[vr],vr,fe))return vr;return-1}function h0(fe,De,Ee){return De===De?yQ(fe,De,Ee):Sc(fe,OA,Ee)}function sQ(fe,De,Ee,et){for(var kt=Ee-1,vr=fe.length;++kt<vr;)if(et(fe[kt],De))return kt;return-1}function OA(fe){return fe!==fe}function RA(fe,De){var Ee=fe==null?0:fe.length;return Ee?bv(fe,De)/Ee:U}function vv(fe){return function(De){return De==null?e:De[fe]}}function yv(fe){return function(De){return fe==null?e:fe[De]}}function LA(fe,De,Ee,et,kt){return kt(fe,function(vr,On,Nr){Ee=et?(et=!1,vr):De(Ee,vr,On,Nr)}),Ee}function lQ(fe,De){var Ee=fe.length;for(fe.sort(De);Ee--;)fe[Ee]=fe[Ee].value;return fe}function bv(fe,De){for(var Ee,et=-1,kt=fe.length;++et<kt;){var vr=De(fe[et]);vr!==e&&(Ee=Ee===e?vr:Ee+vr)}return Ee}function wv(fe,De){for(var Ee=-1,et=Array(fe);++Ee<fe;)et[Ee]=De(Ee);return et}function uQ(fe,De){return Wr(De,function(Ee){return[Ee,fe[Ee]]})}function UA(fe){return fe&&fe.slice(0,VA(fe)+1).replace(Rl,"")}function _a(fe){return function(De){return fe(De)}}function xv(fe,De){return Wr(De,function(Ee){return fe[Ee]})}function C6(fe,De){return fe.has(De)}function BA(fe,De){for(var Ee=-1,et=fe.length;++Ee<et&&h0(De,fe[Ee],0)>-1;);return Ee}function zA(fe,De){for(var Ee=fe.length;Ee--&&h0(De,fe[Ee],0)>-1;);return Ee}function cQ(fe,De){for(var Ee=fe.length,et=0;Ee--;)fe[Ee]===De&&++et;return et}var fQ=yv(jW),dQ=yv(YW);function pQ(fe){return"\\"+XW[fe]}function mQ(fe,De){return fe==null?e:fe[De]}function g0(fe){return GW.test(fe)}function hQ(fe){return WW.test(fe)}function gQ(fe){for(var De,Ee=[];!(De=fe.next()).done;)Ee.push(De.value);return Ee}function _v(fe){var De=-1,Ee=Array(fe.size);return fe.forEach(function(et,kt){Ee[++De]=[kt,et]}),Ee}function qA(fe,De){return function(Ee){return fe(De(Ee))}}function r4(fe,De){for(var Ee=-1,et=fe.length,kt=0,vr=[];++Ee<et;){var On=fe[Ee];(On===De||On===l)&&(fe[Ee]=l,vr[kt++]=Ee)}return vr}function Cc(fe){var De=-1,Ee=Array(fe.size);return fe.forEach(function(et){Ee[++De]=et}),Ee}function vQ(fe){var De=-1,Ee=Array(fe.size);return fe.forEach(function(et){Ee[++De]=[et,et]}),Ee}function yQ(fe,De,Ee){for(var et=Ee-1,kt=fe.length;++et<kt;)if(fe[et]===De)return et;return-1}function bQ(fe,De,Ee){for(var et=Ee+1;et--;)if(fe[et]===De)return et;return et}function v0(fe){return g0(fe)?xQ(fe):iQ(fe)}function Oo(fe){return g0(fe)?_Q(fe):aQ(fe)}function VA(fe){for(var De=fe.length;De--&&d0.test(fe.charAt(De)););return De}var wQ=yv(KW);function xQ(fe){for(var De=fv.lastIndex=0;fv.test(fe);)++De;return De}function _Q(fe){return fe.match(fv)||[]}function kQ(fe){return fe.match($W)||[]}var EQ=function fe(De){De=De==null?$n:n4.defaults($n.Object(),De,n4.pick($n,QW));var Ee=De.Array,et=De.Date,kt=De.Error,vr=De.Function,On=De.Math,Nr=De.Object,kv=De.RegExp,AQ=De.String,Ka=De.TypeError,Ic=Ee.prototype,SQ=vr.prototype,y0=Nr.prototype,Mc=De["__core-js_shared__"],Tc=SQ.toString,Sr=y0.hasOwnProperty,CQ=0,$A=function(){var p=/[^.]+$/.exec(Mc&&Mc.keys&&Mc.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""}(),Nc=y0.toString,IQ=Tc.call(Nr),MQ=$n._,TQ=kv("^"+Tc.call(Sr).replace(f0,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Dc=SA?De.Buffer:e,i4=De.Symbol,Pc=De.Uint8Array,GA=Dc?Dc.allocUnsafe:e,Fc=qA(Nr.getPrototypeOf,Nr),WA=Nr.create,QA=y0.propertyIsEnumerable,Oc=Ic.splice,HA=i4?i4.isConcatSpreadable:e,I6=i4?i4.iterator:e,$l=i4?i4.toStringTag:e,Rc=function(){try{var p=jl(Nr,"defineProperty");return p({},"",{}),p}catch{}}(),NQ=De.clearTimeout!==$n.clearTimeout&&De.clearTimeout,DQ=et&&et.now!==$n.Date.now&&et.now,PQ=De.setTimeout!==$n.setTimeout&&De.setTimeout,Lc=On.ceil,Uc=On.floor,Ev=Nr.getOwnPropertySymbols,FQ=Dc?Dc.isBuffer:e,jA=De.isFinite,OQ=Ic.join,RQ=qA(Nr.keys,Nr),Rn=On.max,gi=On.min,LQ=et.now,UQ=De.parseInt,YA=On.random,BQ=Ic.reverse,Av=jl(De,"DataView"),M6=jl(De,"Map"),Sv=jl(De,"Promise"),b0=jl(De,"Set"),T6=jl(De,"WeakMap"),N6=jl(Nr,"create"),Bc=T6&&new T6,w0={},zQ=Yl(Av),qQ=Yl(M6),VQ=Yl(Sv),$Q=Yl(b0),GQ=Yl(T6),zc=i4?i4.prototype:e,D6=zc?zc.valueOf:e,KA=zc?zc.toString:e;function K(p){if(nn(p)&&!Ct(p)&&!(p instanceof er)){if(p instanceof Xa)return p;if(Sr.call(p,"__wrapped__"))return XS(p)}return new Xa(p)}var x0=function(){function p(){}return function(C){if(!Hr(C))return{};if(WA)return WA(C);p.prototype=C;var R=new p;return p.prototype=e,R}}();function qc(){}function Xa(p,C){this.__wrapped__=p,this.__actions__=[],this.__chain__=!!C,this.__index__=0,this.__values__=e}K.templateSettings={escape:Hi,evaluate:ns,interpolate:ba,variable:"",imports:{_:K}},K.prototype=qc.prototype,K.prototype.constructor=K,Xa.prototype=x0(qc.prototype),Xa.prototype.constructor=Xa;function er(p){this.__wrapped__=p,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=B,this.__views__=[]}function WQ(){var p=new er(this.__wrapped__);return p.__actions__=Yi(this.__actions__),p.__dir__=this.__dir__,p.__filtered__=this.__filtered__,p.__iteratees__=Yi(this.__iteratees__),p.__takeCount__=this.__takeCount__,p.__views__=Yi(this.__views__),p}function QQ(){if(this.__filtered__){var p=new er(this);p.__dir__=-1,p.__filtered__=!0}else p=this.clone(),p.__dir__*=-1;return p}function HQ(){var p=this.__wrapped__.value(),C=this.__dir__,R=Ct(p),$=C<0,H=R?p.length:0,X=aj(0,H,this.__views__),ee=X.start,ae=X.end,me=ae-ee,Fe=$?ae:ee-1,Re=this.__iteratees__,ze=Re.length,Ke=0,nt=gi(me,this.__takeCount__);if(!R||!$&&H==me&&nt==me)return wS(p,this.__actions__);var ht=[];e:for(;me--&&Ke<nt;){Fe+=C;for(var Lt=-1,gt=p[Fe];++Lt<ze;){var Xt=Re[Lt],ir=Xt.iteratee,Aa=Xt.type,Ti=ir(gt);if(Aa==N)gt=Ti;else if(!Ti){if(Aa==F)continue e;break e}}ht[Ke++]=gt}return ht}er.prototype=x0(qc.prototype),er.prototype.constructor=er;function Gl(p){var C=-1,R=p==null?0:p.length;for(this.clear();++C<R;){var $=p[C];this.set($[0],$[1])}}function jQ(){this.__data__=N6?N6(null):{},this.size=0}function YQ(p){var C=this.has(p)&&delete this.__data__[p];return this.size-=C?1:0,C}function KQ(p){var C=this.__data__;if(N6){var R=C[p];return R===o?e:R}return Sr.call(C,p)?C[p]:e}function XQ(p){var C=this.__data__;return N6?C[p]!==e:Sr.call(C,p)}function ZQ(p,C){var R=this.__data__;return this.size+=this.has(p)?0:1,R[p]=N6&&C===e?o:C,this}Gl.prototype.clear=jQ,Gl.prototype.delete=YQ,Gl.prototype.get=KQ,Gl.prototype.has=XQ,Gl.prototype.set=ZQ;function is(p){var C=-1,R=p==null?0:p.length;for(this.clear();++C<R;){var $=p[C];this.set($[0],$[1])}}function JQ(){this.__data__=[],this.size=0}function eH(p){var C=this.__data__,R=Vc(C,p);if(R<0)return!1;var $=C.length-1;return R==$?C.pop():Oc.call(C,R,1),--this.size,!0}function tH(p){var C=this.__data__,R=Vc(C,p);return R<0?e:C[R][1]}function rH(p){return Vc(this.__data__,p)>-1}function nH(p,C){var R=this.__data__,$=Vc(R,p);return $<0?(++this.size,R.push([p,C])):R[$][1]=C,this}is.prototype.clear=JQ,is.prototype.delete=eH,is.prototype.get=tH,is.prototype.has=rH,is.prototype.set=nH;function as(p){var C=-1,R=p==null?0:p.length;for(this.clear();++C<R;){var $=p[C];this.set($[0],$[1])}}function iH(){this.size=0,this.__data__={hash:new Gl,map:new(M6||is),string:new Gl}}function aH(p){var C=ef(this,p).delete(p);return this.size-=C?1:0,C}function oH(p){return ef(this,p).get(p)}function sH(p){return ef(this,p).has(p)}function lH(p,C){var R=ef(this,p),$=R.size;return R.set(p,C),this.size+=R.size==$?0:1,this}as.prototype.clear=iH,as.prototype.delete=aH,as.prototype.get=oH,as.prototype.has=sH,as.prototype.set=lH;function Wl(p){var C=-1,R=p==null?0:p.length;for(this.__data__=new as;++C<R;)this.add(p[C])}function uH(p){return this.__data__.set(p,o),this}function cH(p){return this.__data__.has(p)}Wl.prototype.add=Wl.prototype.push=uH,Wl.prototype.has=cH;function Ro(p){var C=this.__data__=new is(p);this.size=C.size}function fH(){this.__data__=new is,this.size=0}function dH(p){var C=this.__data__,R=C.delete(p);return this.size=C.size,R}function pH(p){return this.__data__.get(p)}function mH(p){return this.__data__.has(p)}function hH(p,C){var R=this.__data__;if(R instanceof is){var $=R.__data__;if(!M6||$.length<r-1)return $.push([p,C]),this.size=++R.size,this;R=this.__data__=new as($)}return R.set(p,C),this.size=R.size,this}Ro.prototype.clear=fH,Ro.prototype.delete=dH,Ro.prototype.get=pH,Ro.prototype.has=mH,Ro.prototype.set=hH;function XA(p,C){var R=Ct(p),$=!R&&Kl(p),H=!R&&!$&&u4(p),X=!R&&!$&&!H&&A0(p),ee=R||$||H||X,ae=ee?wv(p.length,AQ):[],me=ae.length;for(var Fe in p)(C||Sr.call(p,Fe))&&!(ee&&(Fe=="length"||H&&(Fe=="offset"||Fe=="parent")||X&&(Fe=="buffer"||Fe=="byteLength"||Fe=="byteOffset")||us(Fe,me)))&&ae.push(Fe);return ae}function ZA(p){var C=p.length;return C?p[Lv(0,C-1)]:e}function gH(p,C){return tf(Yi(p),Ql(C,0,p.length))}function vH(p){return tf(Yi(p))}function Cv(p,C,R){(R!==e&&!Lo(p[C],R)||R===e&&!(C in p))&&os(p,C,R)}function P6(p,C,R){var $=p[C];(!(Sr.call(p,C)&&Lo($,R))||R===e&&!(C in p))&&os(p,C,R)}function Vc(p,C){for(var R=p.length;R--;)if(Lo(p[R][0],C))return R;return-1}function yH(p,C,R,$){return a4(p,function(H,X,ee){C($,H,R(H),ee)}),$}function JA(p,C){return p&&m1(C,Gn(C),p)}function bH(p,C){return p&&m1(C,Xi(C),p)}function os(p,C,R){C=="__proto__"&&Rc?Rc(p,C,{configurable:!0,enumerable:!0,value:R,writable:!0}):p[C]=R}function Iv(p,C){for(var R=-1,$=C.length,H=Ee($),X=p==null;++R<$;)H[R]=X?e:ly(p,C[R]);return H}function Ql(p,C,R){return p===p&&(R!==e&&(p=p<=R?p:R),C!==e&&(p=p>=C?p:C)),p}function Za(p,C,R,$,H,X){var ee,ae=C&u,me=C&c,Fe=C&f;if(R&&(ee=H?R(p,$,H,X):R(p)),ee!==e)return ee;if(!Hr(p))return p;var Re=Ct(p);if(Re){if(ee=sj(p),!ae)return Yi(p,ee)}else{var ze=vi(p),Ke=ze==he||ze==Se;if(u4(p))return kS(p,ae);if(ze==ye||ze==W||Ke&&!H){if(ee=me||Ke?{}:VS(p),!ae)return me?KH(p,bH(ee,p)):YH(p,JA(ee,p))}else{if(!Or[ze])return H?p:{};ee=lj(p,ze,ae)}}X||(X=new Ro);var nt=X.get(p);if(nt)return nt;X.set(p,ee),vC(p)?p.forEach(function(gt){ee.add(Za(gt,C,R,gt,p,X))}):hC(p)&&p.forEach(function(gt,Xt){ee.set(Xt,Za(gt,C,R,Xt,p,X))});var ht=Fe?me?jv:Hv:me?Xi:Gn,Lt=Re?e:ht(p);return Ya(Lt||p,function(gt,Xt){Lt&&(Xt=gt,gt=p[Xt]),P6(ee,Xt,Za(gt,C,R,Xt,p,X))}),ee}function wH(p){var C=Gn(p);return function(R){return eS(R,p,C)}}function eS(p,C,R){var $=R.length;if(p==null)return!$;for(p=Nr(p);$--;){var H=R[$],X=C[H],ee=p[H];if(ee===e&&!(H in p)||!X(ee))return!1}return!0}function tS(p,C,R){if(typeof p!="function")throw new Ka(i);return z6(function(){p.apply(e,R)},C)}function F6(p,C,R,$){var H=-1,X=Ac,ee=!0,ae=p.length,me=[],Fe=C.length;if(!ae)return me;R&&(C=Wr(C,_a(R))),$?(X=mv,ee=!1):C.length>=r&&(X=C6,ee=!1,C=new Wl(C));e:for(;++H<ae;){var Re=p[H],ze=R==null?Re:R(Re);if(Re=$||Re!==0?Re:0,ee&&ze===ze){for(var Ke=Fe;Ke--;)if(C[Ke]===ze)continue e;me.push(Re)}else X(C,ze,$)||me.push(Re)}return me}var a4=IS(p1),rS=IS(Tv,!0);function xH(p,C){var R=!0;return a4(p,function($,H,X){return R=!!C($,H,X),R}),R}function $c(p,C,R){for(var $=-1,H=p.length;++$<H;){var X=p[$],ee=C(X);if(ee!=null&&(ae===e?ee===ee&&!Ea(ee):R(ee,ae)))var ae=ee,me=X}return me}function _H(p,C,R,$){var H=p.length;for(R=Pt(R),R<0&&(R=-R>H?0:H+R),$=$===e||$>H?H:Pt($),$<0&&($+=H),$=R>$?0:bC($);R<$;)p[R++]=C;return p}function nS(p,C){var R=[];return a4(p,function($,H,X){C($,H,X)&&R.push($)}),R}function ii(p,C,R,$,H){var X=-1,ee=p.length;for(R||(R=cj),H||(H=[]);++X<ee;){var ae=p[X];C>0&&R(ae)?C>1?ii(ae,C-1,R,$,H):t4(H,ae):$||(H[H.length]=ae)}return H}var Mv=MS(),iS=MS(!0);function p1(p,C){return p&&Mv(p,C,Gn)}function Tv(p,C){return p&&iS(p,C,Gn)}function Gc(p,C){return e4(C,function(R){return cs(p[R])})}function Hl(p,C){C=s4(C,p);for(var R=0,$=C.length;p!=null&&R<$;)p=p[h1(C[R++])];return R&&R==$?p:e}function aS(p,C,R){var $=C(p);return Ct(p)?$:t4($,R(p))}function Ii(p){return p==null?p===e?be:te:$l&&$l in Nr(p)?ij(p):vj(p)}function Nv(p,C){return p>C}function kH(p,C){return p!=null&&Sr.call(p,C)}function EH(p,C){return p!=null&&C in Nr(p)}function AH(p,C,R){return p>=gi(C,R)&&p<Rn(C,R)}function Dv(p,C,R){for(var $=R?mv:Ac,H=p[0].length,X=p.length,ee=X,ae=Ee(X),me=1/0,Fe=[];ee--;){var Re=p[ee];ee&&C&&(Re=Wr(Re,_a(C))),me=gi(Re.length,me),ae[ee]=!R&&(C||H>=120&&Re.length>=120)?new Wl(ee&&Re):e}Re=p[0];var ze=-1,Ke=ae[0];e:for(;++ze<H&&Fe.length<me;){var nt=Re[ze],ht=C?C(nt):nt;if(nt=R||nt!==0?nt:0,!(Ke?C6(Ke,ht):$(Fe,ht,R))){for(ee=X;--ee;){var Lt=ae[ee];if(!(Lt?C6(Lt,ht):$(p[ee],ht,R)))continue e}Ke&&Ke.push(ht),Fe.push(nt)}}return Fe}function SH(p,C,R,$){return p1(p,function(H,X,ee){C($,R(H),X,ee)}),$}function O6(p,C,R){C=s4(C,p),p=QS(p,C);var $=p==null?p:p[h1(eo(C))];return $==null?e:xa($,p,R)}function oS(p){return nn(p)&&Ii(p)==W}function CH(p){return nn(p)&&Ii(p)==Ve}function IH(p){return nn(p)&&Ii(p)==Ce}function R6(p,C,R,$,H){return p===C?!0:p==null||C==null||!nn(p)&&!nn(C)?p!==p&&C!==C:MH(p,C,R,$,R6,H)}function MH(p,C,R,$,H,X){var ee=Ct(p),ae=Ct(C),me=ee?Y:vi(p),Fe=ae?Y:vi(C);me=me==W?ye:me,Fe=Fe==W?ye:Fe;var Re=me==ye,ze=Fe==ye,Ke=me==Fe;if(Ke&&u4(p)){if(!u4(C))return!1;ee=!0,Re=!1}if(Ke&&!Re)return X||(X=new Ro),ee||A0(p)?BS(p,C,R,$,H,X):rj(p,C,me,R,$,H,X);if(!(R&d)){var nt=Re&&Sr.call(p,"__wrapped__"),ht=ze&&Sr.call(C,"__wrapped__");if(nt||ht){var Lt=nt?p.value():p,gt=ht?C.value():C;return X||(X=new Ro),H(Lt,gt,R,$,X)}}return Ke?(X||(X=new Ro),nj(p,C,R,$,H,X)):!1}function TH(p){return nn(p)&&vi(p)==re}function Pv(p,C,R,$){var H=R.length,X=H,ee=!$;if(p==null)return!X;for(p=Nr(p);H--;){var ae=R[H];if(ee&&ae[2]?ae[1]!==p[ae[0]]:!(ae[0]in p))return!1}for(;++H<X;){ae=R[H];var me=ae[0],Fe=p[me],Re=ae[1];if(ee&&ae[2]){if(Fe===e&&!(me in p))return!1}else{var ze=new Ro;if($)var Ke=$(Fe,Re,me,p,C,ze);if(!(Ke===e?R6(Re,Fe,d|m,$,ze):Ke))return!1}}return!0}function sS(p){if(!Hr(p)||dj(p))return!1;var C=cs(p)?TQ:Ul;return C.test(Yl(p))}function NH(p){return nn(p)&&Ii(p)==Be}function DH(p){return nn(p)&&vi(p)==le}function PH(p){return nn(p)&&lf(p.length)&&!!Br[Ii(p)]}function lS(p){return typeof p=="function"?p:p==null?Zi:typeof p=="object"?Ct(p)?fS(p[0],p[1]):cS(p):TC(p)}function Fv(p){if(!B6(p))return RQ(p);var C=[];for(var R in Nr(p))Sr.call(p,R)&&R!="constructor"&&C.push(R);return C}function FH(p){if(!Hr(p))return gj(p);var C=B6(p),R=[];for(var $ in p)$=="constructor"&&(C||!Sr.call(p,$))||R.push($);return R}function Ov(p,C){return p<C}function uS(p,C){var R=-1,$=Ki(p)?Ee(p.length):[];return a4(p,function(H,X,ee){$[++R]=C(H,X,ee)}),$}function cS(p){var C=Kv(p);return C.length==1&&C[0][2]?GS(C[0][0],C[0][1]):function(R){return R===p||Pv(R,p,C)}}function fS(p,C){return Zv(p)&&$S(C)?GS(h1(p),C):function(R){var $=ly(R,p);return $===e&&$===C?uy(R,p):R6(C,$,d|m)}}function Wc(p,C,R,$,H){p!==C&&Mv(C,function(X,ee){if(H||(H=new Ro),Hr(X))OH(p,C,ee,R,Wc,$,H);else{var ae=$?$(ey(p,ee),X,ee+"",p,C,H):e;ae===e&&(ae=X),Cv(p,ee,ae)}},Xi)}function OH(p,C,R,$,H,X,ee){var ae=ey(p,R),me=ey(C,R),Fe=ee.get(me);if(Fe){Cv(p,R,Fe);return}var Re=X?X(ae,me,R+"",p,C,ee):e,ze=Re===e;if(ze){var Ke=Ct(me),nt=!Ke&&u4(me),ht=!Ke&&!nt&&A0(me);Re=me,Ke||nt||ht?Ct(ae)?Re=ae:vn(ae)?Re=Yi(ae):nt?(ze=!1,Re=kS(me,!0)):ht?(ze=!1,Re=ES(me,!0)):Re=[]:q6(me)||Kl(me)?(Re=ae,Kl(ae)?Re=wC(ae):(!Hr(ae)||cs(ae))&&(Re=VS(me))):ze=!1}ze&&(ee.set(me,Re),H(Re,me,$,X,ee),ee.delete(me)),Cv(p,R,Re)}function dS(p,C){var R=p.length;if(R)return C+=C<0?R:0,us(C,R)?p[C]:e}function pS(p,C,R){C.length?C=Wr(C,function(X){return Ct(X)?function(ee){return Hl(ee,X.length===1?X[0]:X)}:X}):C=[Zi];var $=-1;C=Wr(C,_a(mt()));var H=uS(p,function(X,ee,ae){var me=Wr(C,function(Fe){return Fe(X)});return{criteria:me,index:++$,value:X}});return lQ(H,function(X,ee){return jH(X,ee,R)})}function RH(p,C){return mS(p,C,function(R,$){return uy(p,$)})}function mS(p,C,R){for(var $=-1,H=C.length,X={};++$<H;){var ee=C[$],ae=Hl(p,ee);R(ae,ee)&&L6(X,s4(ee,p),ae)}return X}function LH(p){return function(C){return Hl(C,p)}}function Rv(p,C,R,$){var H=$?sQ:h0,X=-1,ee=C.length,ae=p;for(p===C&&(C=Yi(C)),R&&(ae=Wr(p,_a(R)));++X<ee;)for(var me=0,Fe=C[X],Re=R?R(Fe):Fe;(me=H(ae,Re,me,$))>-1;)ae!==p&&Oc.call(ae,me,1),Oc.call(p,me,1);return p}function hS(p,C){for(var R=p?C.length:0,$=R-1;R--;){var H=C[R];if(R==$||H!==X){var X=H;us(H)?Oc.call(p,H,1):zv(p,H)}}return p}function Lv(p,C){return p+Uc(YA()*(C-p+1))}function UH(p,C,R,$){for(var H=-1,X=Rn(Lc((C-p)/(R||1)),0),ee=Ee(X);X--;)ee[$?X:++H]=p,p+=R;return ee}function Uv(p,C){var R="";if(!p||C<1||C>L)return R;do C%2&&(R+=p),C=Uc(C/2),C&&(p+=p);while(C);return R}function Vt(p,C){return ty(WS(p,C,Zi),p+"")}function BH(p){return ZA(S0(p))}function zH(p,C){var R=S0(p);return tf(R,Ql(C,0,R.length))}function L6(p,C,R,$){if(!Hr(p))return p;C=s4(C,p);for(var H=-1,X=C.length,ee=X-1,ae=p;ae!=null&&++H<X;){var me=h1(C[H]),Fe=R;if(me==="__proto__"||me==="constructor"||me==="prototype")return p;if(H!=ee){var Re=ae[me];Fe=$?$(Re,me,ae):e,Fe===e&&(Fe=Hr(Re)?Re:us(C[H+1])?[]:{})}P6(ae,me,Fe),ae=ae[me]}return p}var gS=Bc?function(p,C){return Bc.set(p,C),p}:Zi,qH=Rc?function(p,C){return Rc(p,"toString",{configurable:!0,enumerable:!1,value:fy(C),writable:!0})}:Zi;function VH(p){return tf(S0(p))}function Ja(p,C,R){var $=-1,H=p.length;C<0&&(C=-C>H?0:H+C),R=R>H?H:R,R<0&&(R+=H),H=C>R?0:R-C>>>0,C>>>=0;for(var X=Ee(H);++$<H;)X[$]=p[$+C];return X}function $H(p,C){var R;return a4(p,function($,H,X){return R=C($,H,X),!R}),!!R}function Qc(p,C,R){var $=0,H=p==null?$:p.length;if(typeof C=="number"&&C===C&&H<=V){for(;$<H;){var X=$+H>>>1,ee=p[X];ee!==null&&!Ea(ee)&&(R?ee<=C:ee<C)?$=X+1:H=X}return H}return Bv(p,C,Zi,R)}function Bv(p,C,R,$){var H=0,X=p==null?0:p.length;if(X===0)return 0;C=R(C);for(var ee=C!==C,ae=C===null,me=Ea(C),Fe=C===e;H<X;){var Re=Uc((H+X)/2),ze=R(p[Re]),Ke=ze!==e,nt=ze===null,ht=ze===ze,Lt=Ea(ze);if(ee)var gt=$||ht;else Fe?gt=ht&&($||Ke):ae?gt=ht&&Ke&&($||!nt):me?gt=ht&&Ke&&!nt&&($||!Lt):nt||Lt?gt=!1:gt=$?ze<=C:ze<C;gt?H=Re+1:X=Re}return gi(X,z)}function vS(p,C){for(var R=-1,$=p.length,H=0,X=[];++R<$;){var ee=p[R],ae=C?C(ee):ee;if(!R||!Lo(ae,me)){var me=ae;X[H++]=ee===0?0:ee}}return X}function yS(p){return typeof p=="number"?p:Ea(p)?U:+p}function ka(p){if(typeof p=="string")return p;if(Ct(p))return Wr(p,ka)+"";if(Ea(p))return KA?KA.call(p):"";var C=p+"";return C=="0"&&1/p==-O?"-0":C}function o4(p,C,R){var $=-1,H=Ac,X=p.length,ee=!0,ae=[],me=ae;if(R)ee=!1,H=mv;else if(X>=r){var Fe=C?null:ej(p);if(Fe)return Cc(Fe);ee=!1,H=C6,me=new Wl}else me=C?[]:ae;e:for(;++$<X;){var Re=p[$],ze=C?C(Re):Re;if(Re=R||Re!==0?Re:0,ee&&ze===ze){for(var Ke=me.length;Ke--;)if(me[Ke]===ze)continue e;C&&me.push(ze),ae.push(Re)}else H(me,ze,R)||(me!==ae&&me.push(ze),ae.push(Re))}return ae}function zv(p,C){return C=s4(C,p),p=QS(p,C),p==null||delete p[h1(eo(C))]}function bS(p,C,R,$){return L6(p,C,R(Hl(p,C)),$)}function Hc(p,C,R,$){for(var H=p.length,X=$?H:-1;($?X--:++X<H)&&C(p[X],X,p););return R?Ja(p,$?0:X,$?X+1:H):Ja(p,$?X+1:0,$?H:X)}function wS(p,C){var R=p;return R instanceof er&&(R=R.value()),hv(C,function($,H){return H.func.apply(H.thisArg,t4([$],H.args))},R)}function qv(p,C,R){var $=p.length;if($<2)return $?o4(p[0]):[];for(var H=-1,X=Ee($);++H<$;)for(var ee=p[H],ae=-1;++ae<$;)ae!=H&&(X[H]=F6(X[H]||ee,p[ae],C,R));return o4(ii(X,1),C,R)}function xS(p,C,R){for(var $=-1,H=p.length,X=C.length,ee={};++$<H;){var ae=$<X?C[$]:e;R(ee,p[$],ae)}return ee}function Vv(p){return vn(p)?p:[]}function $v(p){return typeof p=="function"?p:Zi}function s4(p,C){return Ct(p)?p:Zv(p,C)?[p]:KS(xr(p))}var GH=Vt;function l4(p,C,R){var $=p.length;return R=R===e?$:R,!C&&R>=$?p:Ja(p,C,R)}var _S=NQ||function(p){return $n.clearTimeout(p)};function kS(p,C){if(C)return p.slice();var R=p.length,$=GA?GA(R):new p.constructor(R);return p.copy($),$}function Gv(p){var C=new p.constructor(p.byteLength);return new Pc(C).set(new Pc(p)),C}function WH(p,C){var R=C?Gv(p.buffer):p.buffer;return new p.constructor(R,p.byteOffset,p.byteLength)}function QH(p){var C=new p.constructor(p.source,Fn.exec(p));return C.lastIndex=p.lastIndex,C}function HH(p){return D6?Nr(D6.call(p)):{}}function ES(p,C){var R=C?Gv(p.buffer):p.buffer;return new p.constructor(R,p.byteOffset,p.length)}function AS(p,C){if(p!==C){var R=p!==e,$=p===null,H=p===p,X=Ea(p),ee=C!==e,ae=C===null,me=C===C,Fe=Ea(C);if(!ae&&!Fe&&!X&&p>C||X&&ee&&me&&!ae&&!Fe||$&&ee&&me||!R&&me||!H)return 1;if(!$&&!X&&!Fe&&p<C||Fe&&R&&H&&!$&&!X||ae&&R&&H||!ee&&H||!me)return-1}return 0}function jH(p,C,R){for(var $=-1,H=p.criteria,X=C.criteria,ee=H.length,ae=R.length;++$<ee;){var me=AS(H[$],X[$]);if(me){if($>=ae)return me;var Fe=R[$];return me*(Fe=="desc"?-1:1)}}return p.index-C.index}function SS(p,C,R,$){for(var H=-1,X=p.length,ee=R.length,ae=-1,me=C.length,Fe=Rn(X-ee,0),Re=Ee(me+Fe),ze=!$;++ae<me;)Re[ae]=C[ae];for(;++H<ee;)(ze||H<X)&&(Re[R[H]]=p[H]);for(;Fe--;)Re[ae++]=p[H++];return Re}function CS(p,C,R,$){for(var H=-1,X=p.length,ee=-1,ae=R.length,me=-1,Fe=C.length,Re=Rn(X-ae,0),ze=Ee(Re+Fe),Ke=!$;++H<Re;)ze[H]=p[H];for(var nt=H;++me<Fe;)ze[nt+me]=C[me];for(;++ee<ae;)(Ke||H<X)&&(ze[nt+R[ee]]=p[H++]);return ze}function Yi(p,C){var R=-1,$=p.length;for(C||(C=Ee($));++R<$;)C[R]=p[R];return C}function m1(p,C,R,$){var H=!R;R||(R={});for(var X=-1,ee=C.length;++X<ee;){var ae=C[X],me=$?$(R[ae],p[ae],ae,R,p):e;me===e&&(me=p[ae]),H?os(R,ae,me):P6(R,ae,me)}return R}function YH(p,C){return m1(p,Xv(p),C)}function KH(p,C){return m1(p,zS(p),C)}function jc(p,C){return function(R,$){var H=Ct(R)?tQ:yH,X=C?C():{};return H(R,p,mt($,2),X)}}function _0(p){return Vt(function(C,R){var $=-1,H=R.length,X=H>1?R[H-1]:e,ee=H>2?R[2]:e;for(X=p.length>3&&typeof X=="function"?(H--,X):e,ee&&Mi(R[0],R[1],ee)&&(X=H<3?e:X,H=1),C=Nr(C);++$<H;){var ae=R[$];ae&&p(C,ae,$,X)}return C})}function IS(p,C){return function(R,$){if(R==null)return R;if(!Ki(R))return p(R,$);for(var H=R.length,X=C?H:-1,ee=Nr(R);(C?X--:++X<H)&&$(ee[X],X,ee)!==!1;);return R}}function MS(p){return function(C,R,$){for(var H=-1,X=Nr(C),ee=$(C),ae=ee.length;ae--;){var me=ee[p?ae:++H];if(R(X[me],me,X)===!1)break}return C}}function XH(p,C,R){var $=C&h,H=U6(p);function X(){var ee=this&&this!==$n&&this instanceof X?H:p;return ee.apply($?R:this,arguments)}return X}function TS(p){return function(C){C=xr(C);var R=g0(C)?Oo(C):e,$=R?R[0]:C.charAt(0),H=R?l4(R,1).join(""):C.slice(1);return $[p]()+H}}function k0(p){return function(C){return hv(IC(CC(C).replace(qW,"")),p,"")}}function U6(p){return function(){var C=arguments;switch(C.length){case 0:return new p;case 1:return new p(C[0]);case 2:return new p(C[0],C[1]);case 3:return new p(C[0],C[1],C[2]);case 4:return new p(C[0],C[1],C[2],C[3]);case 5:return new p(C[0],C[1],C[2],C[3],C[4]);case 6:return new p(C[0],C[1],C[2],C[3],C[4],C[5]);case 7:return new p(C[0],C[1],C[2],C[3],C[4],C[5],C[6])}var R=x0(p.prototype),$=p.apply(R,C);return Hr($)?$:R}}function ZH(p,C,R){var $=U6(p);function H(){for(var X=arguments.length,ee=Ee(X),ae=X,me=E0(H);ae--;)ee[ae]=arguments[ae];var Fe=X<3&&ee[0]!==me&&ee[X-1]!==me?[]:r4(ee,me);if(X-=Fe.length,X<R)return OS(p,C,Yc,H.placeholder,e,ee,Fe,e,e,R-X);var Re=this&&this!==$n&&this instanceof H?$:p;return xa(Re,this,ee)}return H}function NS(p){return function(C,R,$){var H=Nr(C);if(!Ki(C)){var X=mt(R,3);C=Gn(C),R=function(ae){return X(H[ae],ae,H)}}var ee=p(C,R,$);return ee>-1?H[X?C[ee]:ee]:e}}function DS(p){return ls(function(C){var R=C.length,$=R,H=Xa.prototype.thru;for(p&&C.reverse();$--;){var X=C[$];if(typeof X!="function")throw new Ka(i);if(H&&!ee&&Jc(X)=="wrapper")var ee=new Xa([],!0)}for($=ee?$:R;++$<R;){X=C[$];var ae=Jc(X),me=ae=="wrapper"?Yv(X):e;me&&Jv(me[0])&&me[1]==(x|v|w|S)&&!me[4].length&&me[9]==1?ee=ee[Jc(me[0])].apply(ee,me[3]):ee=X.length==1&&Jv(X)?ee[ae]():ee.thru(X)}return function(){var Fe=arguments,Re=Fe[0];if(ee&&Fe.length==1&&Ct(Re))return ee.plant(Re).value();for(var ze=0,Ke=R?C[ze].apply(this,Fe):Re;++ze<R;)Ke=C[ze].call(this,Ke);return Ke}})}function Yc(p,C,R,$,H,X,ee,ae,me,Fe){var Re=C&x,ze=C&h,Ke=C&g,nt=C&(v|_),ht=C&I,Lt=Ke?e:U6(p);function gt(){for(var Xt=arguments.length,ir=Ee(Xt),Aa=Xt;Aa--;)ir[Aa]=arguments[Aa];if(nt)var Ti=E0(gt),Sa=cQ(ir,Ti);if($&&(ir=SS(ir,$,H,nt)),X&&(ir=CS(ir,X,ee,nt)),Xt-=Sa,nt&&Xt<Fe){var yn=r4(ir,Ti);return OS(p,C,Yc,gt.placeholder,R,ir,yn,ae,me,Fe-Xt)}var Uo=ze?R:this,ds=Ke?Uo[p]:p;return Xt=ir.length,ae?ir=yj(ir,ae):ht&&Xt>1&&ir.reverse(),Re&&me<Xt&&(ir.length=me),this&&this!==$n&&this instanceof gt&&(ds=Lt||U6(ds)),ds.apply(Uo,ir)}return gt}function PS(p,C){return function(R,$){return SH(R,p,C($),{})}}function Kc(p,C){return function(R,$){var H;if(R===e&&$===e)return C;if(R!==e&&(H=R),$!==e){if(H===e)return $;typeof R=="string"||typeof $=="string"?(R=ka(R),$=ka($)):(R=yS(R),$=yS($)),H=p(R,$)}return H}}function Wv(p){return ls(function(C){return C=Wr(C,_a(mt())),Vt(function(R){var $=this;return p(C,function(H){return xa(H,$,R)})})})}function Xc(p,C){C=C===e?" ":ka(C);var R=C.length;if(R<2)return R?Uv(C,p):C;var $=Uv(C,Lc(p/v0(C)));return g0(C)?l4(Oo($),0,p).join(""):$.slice(0,p)}function JH(p,C,R,$){var H=C&h,X=U6(p);function ee(){for(var ae=-1,me=arguments.length,Fe=-1,Re=$.length,ze=Ee(Re+me),Ke=this&&this!==$n&&this instanceof ee?X:p;++Fe<Re;)ze[Fe]=$[Fe];for(;me--;)ze[Fe++]=arguments[++ae];return xa(Ke,H?R:this,ze)}return ee}function FS(p){return function(C,R,$){return $&&typeof $!="number"&&Mi(C,R,$)&&(R=$=e),C=fs(C),R===e?(R=C,C=0):R=fs(R),$=$===e?C<R?1:-1:fs($),UH(C,R,$,p)}}function Zc(p){return function(C,R){return typeof C=="string"&&typeof R=="string"||(C=to(C),R=to(R)),p(C,R)}}function OS(p,C,R,$,H,X,ee,ae,me,Fe){var Re=C&v,ze=Re?ee:e,Ke=Re?e:ee,nt=Re?X:e,ht=Re?e:X;C|=Re?w:k,C&=~(Re?k:w),C&A||(C&=~(h|g));var Lt=[p,C,H,nt,ze,ht,Ke,ae,me,Fe],gt=R.apply(e,Lt);return Jv(p)&&HS(gt,Lt),gt.placeholder=$,jS(gt,p,C)}function Qv(p){var C=On[p];return function(R,$){if(R=to(R),$=$==null?0:gi(Pt($),292),$&&jA(R)){var H=(xr(R)+"e").split("e"),X=C(H[0]+"e"+(+H[1]+$));return H=(xr(X)+"e").split("e"),+(H[0]+"e"+(+H[1]-$))}return C(R)}}var ej=b0&&1/Cc(new b0([,-0]))[1]==O?function(p){return new b0(p)}:my;function RS(p){return function(C){var R=vi(C);return R==re?_v(C):R==le?vQ(C):uQ(C,p(C))}}function ss(p,C,R,$,H,X,ee,ae){var me=C&g;if(!me&&typeof p!="function")throw new Ka(i);var Fe=$?$.length:0;if(Fe||(C&=~(w|k),$=H=e),ee=ee===e?ee:Rn(Pt(ee),0),ae=ae===e?ae:Pt(ae),Fe-=H?H.length:0,C&k){var Re=$,ze=H;$=H=e}var Ke=me?e:Yv(p),nt=[p,C,R,$,H,Re,ze,X,ee,ae];if(Ke&&hj(nt,Ke),p=nt[0],C=nt[1],R=nt[2],$=nt[3],H=nt[4],ae=nt[9]=nt[9]===e?me?0:p.length:Rn(nt[9]-Fe,0),!ae&&C&(v|_)&&(C&=~(v|_)),!C||C==h)var ht=XH(p,C,R);else C==v||C==_?ht=ZH(p,C,ae):(C==w||C==(h|w))&&!H.length?ht=JH(p,C,R,$):ht=Yc.apply(e,nt);var Lt=Ke?gS:HS;return jS(Lt(ht,nt),p,C)}function LS(p,C,R,$){return p===e||Lo(p,y0[R])&&!Sr.call($,R)?C:p}function US(p,C,R,$,H,X){return Hr(p)&&Hr(C)&&(X.set(C,p),Wc(p,C,e,US,X),X.delete(C)),p}function tj(p){return q6(p)?e:p}function BS(p,C,R,$,H,X){var ee=R&d,ae=p.length,me=C.length;if(ae!=me&&!(ee&&me>ae))return!1;var Fe=X.get(p),Re=X.get(C);if(Fe&&Re)return Fe==C&&Re==p;var ze=-1,Ke=!0,nt=R&m?new Wl:e;for(X.set(p,C),X.set(C,p);++ze<ae;){var ht=p[ze],Lt=C[ze];if($)var gt=ee?$(Lt,ht,ze,C,p,X):$(ht,Lt,ze,p,C,X);if(gt!==e){if(gt)continue;Ke=!1;break}if(nt){if(!gv(C,function(Xt,ir){if(!C6(nt,ir)&&(ht===Xt||H(ht,Xt,R,$,X)))return nt.push(ir)})){Ke=!1;break}}else if(!(ht===Lt||H(ht,Lt,R,$,X))){Ke=!1;break}}return X.delete(p),X.delete(C),Ke}function rj(p,C,R,$,H,X,ee){switch(R){case Qe:if(p.byteLength!=C.byteLength||p.byteOffset!=C.byteOffset)return!1;p=p.buffer,C=C.buffer;case Ve:return!(p.byteLength!=C.byteLength||!X(new Pc(p),new Pc(C)));case oe:case Ce:case Z:return Lo(+p,+C);case ne:return p.name==C.name&&p.message==C.message;case Be:case ie:return p==C+"";case re:var ae=_v;case le:var me=$&d;if(ae||(ae=Cc),p.size!=C.size&&!me)return!1;var Fe=ee.get(p);if(Fe)return Fe==C;$|=m,ee.set(p,C);var Re=BS(ae(p),ae(C),$,H,X,ee);return ee.delete(p),Re;case ve:if(D6)return D6.call(p)==D6.call(C)}return!1}function nj(p,C,R,$,H,X){var ee=R&d,ae=Hv(p),me=ae.length,Fe=Hv(C),Re=Fe.length;if(me!=Re&&!ee)return!1;for(var ze=me;ze--;){var Ke=ae[ze];if(!(ee?Ke in C:Sr.call(C,Ke)))return!1}var nt=X.get(p),ht=X.get(C);if(nt&&ht)return nt==C&&ht==p;var Lt=!0;X.set(p,C),X.set(C,p);for(var gt=ee;++ze<me;){Ke=ae[ze];var Xt=p[Ke],ir=C[Ke];if($)var Aa=ee?$(ir,Xt,Ke,C,p,X):$(Xt,ir,Ke,p,C,X);if(!(Aa===e?Xt===ir||H(Xt,ir,R,$,X):Aa)){Lt=!1;break}gt||(gt=Ke=="constructor")}if(Lt&&!gt){var Ti=p.constructor,Sa=C.constructor;Ti!=Sa&&"constructor"in p&&"constructor"in C&&!(typeof Ti=="function"&&Ti instanceof Ti&&typeof Sa=="function"&&Sa instanceof Sa)&&(Lt=!1)}return X.delete(p),X.delete(C),Lt}function ls(p){return ty(WS(p,e,eC),p+"")}function Hv(p){return aS(p,Gn,Xv)}function jv(p){return aS(p,Xi,zS)}var Yv=Bc?function(p){return Bc.get(p)}:my;function Jc(p){for(var C=p.name+"",R=w0[C],$=Sr.call(w0,C)?R.length:0;$--;){var H=R[$],X=H.func;if(X==null||X==p)return H.name}return C}function E0(p){var C=Sr.call(K,"placeholder")?K:p;return C.placeholder}function mt(){var p=K.iteratee||dy;return p=p===dy?lS:p,arguments.length?p(arguments[0],arguments[1]):p}function ef(p,C){var R=p.__data__;return fj(C)?R[typeof C=="string"?"string":"hash"]:R.map}function Kv(p){for(var C=Gn(p),R=C.length;R--;){var $=C[R],H=p[$];C[R]=[$,H,$S(H)]}return C}function jl(p,C){var R=mQ(p,C);return sS(R)?R:e}function ij(p){var C=Sr.call(p,$l),R=p[$l];try{p[$l]=e;var $=!0}catch{}var H=Nc.call(p);return $&&(C?p[$l]=R:delete p[$l]),H}var Xv=Ev?function(p){return p==null?[]:(p=Nr(p),e4(Ev(p),function(C){return QA.call(p,C)}))}:hy,zS=Ev?function(p){for(var C=[];p;)t4(C,Xv(p)),p=Fc(p);return C}:hy,vi=Ii;(Av&&vi(new Av(new ArrayBuffer(1)))!=Qe||M6&&vi(new M6)!=re||Sv&&vi(Sv.resolve())!=we||b0&&vi(new b0)!=le||T6&&vi(new T6)!=Te)&&(vi=function(p){var C=Ii(p),R=C==ye?p.constructor:e,$=R?Yl(R):"";if($)switch($){case zQ:return Qe;case qQ:return re;case VQ:return we;case $Q:return le;case GQ:return Te}return C});function aj(p,C,R){for(var $=-1,H=R.length;++$<H;){var X=R[$],ee=X.size;switch(X.type){case"drop":p+=ee;break;case"dropRight":C-=ee;break;case"take":C=gi(C,p+ee);break;case"takeRight":p=Rn(p,C-ee);break}}return{start:p,end:C}}function oj(p){var C=p.match(bc);return C?C[1].split(wc):[]}function qS(p,C,R){C=s4(C,p);for(var $=-1,H=C.length,X=!1;++$<H;){var ee=h1(C[$]);if(!(X=p!=null&&R(p,ee)))break;p=p[ee]}return X||++$!=H?X:(H=p==null?0:p.length,!!H&&lf(H)&&us(ee,H)&&(Ct(p)||Kl(p)))}function sj(p){var C=p.length,R=new p.constructor(C);return C&&typeof p[0]=="string"&&Sr.call(p,"index")&&(R.index=p.index,R.input=p.input),R}function VS(p){return typeof p.constructor=="function"&&!B6(p)?x0(Fc(p)):{}}function lj(p,C,R){var $=p.constructor;switch(C){case Ve:return Gv(p);case oe:case Ce:return new $(+p);case Qe:return WH(p,R);case ct:case rt:case We:case Rt:case lt:case vt:case _t:case wr:case tn:return ES(p,R);case re:return new $;case Z:case ie:return new $(p);case Be:return QH(p);case le:return new $;case ve:return HH(p)}}function uj(p,C){var R=C.length;if(!R)return p;var $=R-1;return C[$]=(R>1?"& ":"")+C[$],C=C.join(R>2?", ":" "),p.replace(yc,`{
2
2
  /* [wrapped with `+C+`] */
3
3
  `)}function cj(p){return Ct(p)||Kl(p)||!!(HA&&p&&p[HA])}function us(p,C){var R=typeof p;return C=C==null?L:C,!!C&&(R=="number"||R!="symbol"&&S6.test(p))&&p>-1&&p%1==0&&p<C}function Mi(p,C,R){if(!Hr(R))return!1;var $=typeof C;return($=="number"?Ki(R)&&us(C,R.length):$=="string"&&C in R)?Lo(R[C],p):!1}function Zv(p,C){if(Ct(p))return!1;var R=typeof p;return R=="number"||R=="symbol"||R=="boolean"||p==null||Ea(p)?!0:Xs.test(p)||!wa.test(p)||C!=null&&p in Nr(C)}function fj(p){var C=typeof p;return C=="string"||C=="number"||C=="symbol"||C=="boolean"?p!=="__proto__":p===null}function Jv(p){var C=Jc(p),R=K[C];if(typeof R!="function"||!(C in er.prototype))return!1;if(p===R)return!0;var $=Yv(R);return!!$&&p===$[0]}function dj(p){return!!$A&&$A in p}var pj=Mc?cs:gy;function B6(p){var C=p&&p.constructor,R=typeof C=="function"&&C.prototype||y0;return p===R}function $S(p){return p===p&&!Hr(p)}function GS(p,C){return function(R){return R==null?!1:R[p]===C&&(C!==e||p in Nr(R))}}function mj(p){var C=of(p,function($){return R.size===s&&R.clear(),$}),R=C.cache;return C}function hj(p,C){var R=p[1],$=C[1],H=R|$,X=H<(h|g|x),ee=$==x&&R==v||$==x&&R==S&&p[7].length<=C[8]||$==(x|S)&&C[7].length<=C[8]&&R==v;if(!(X||ee))return p;$&h&&(p[2]=C[2],H|=R&h?0:A);var ae=C[3];if(ae){var me=p[3];p[3]=me?SS(me,ae,C[4]):ae,p[4]=me?r4(p[3],l):C[4]}return ae=C[5],ae&&(me=p[5],p[5]=me?CS(me,ae,C[6]):ae,p[6]=me?r4(p[5],l):C[6]),ae=C[7],ae&&(p[7]=ae),$&x&&(p[8]=p[8]==null?C[8]:gi(p[8],C[8])),p[9]==null&&(p[9]=C[9]),p[0]=C[0],p[1]=H,p}function gj(p){var C=[];if(p!=null)for(var R in Nr(p))C.push(R);return C}function vj(p){return Nc.call(p)}function WS(p,C,R){return C=Rn(C===e?p.length-1:C,0),function(){for(var $=arguments,H=-1,X=Rn($.length-C,0),ee=Ee(X);++H<X;)ee[H]=$[C+H];H=-1;for(var ae=Ee(C+1);++H<C;)ae[H]=$[H];return ae[C]=R(ee),xa(p,this,ae)}}function QS(p,C){return C.length<2?p:Hl(p,Ja(C,0,-1))}function yj(p,C){for(var R=p.length,$=gi(C.length,R),H=Yi(p);$--;){var X=C[$];p[$]=us(X,R)?H[X]:e}return p}function ey(p,C){if(!(C==="constructor"&&typeof p[C]=="function")&&C!="__proto__")return p[C]}var HS=YS(gS),z6=PQ||function(p,C){return $n.setTimeout(p,C)},ty=YS(qH);function jS(p,C,R){var $=C+"";return ty(p,uj($,bj(oj($),R)))}function YS(p){var C=0,R=0;return function(){var $=LQ(),H=M-($-R);if(R=$,H>0){if(++C>=E)return arguments[0]}else C=0;return p.apply(e,arguments)}}function tf(p,C){var R=-1,$=p.length,H=$-1;for(C=C===e?$:C;++R<C;){var X=Lv(R,H),ee=p[X];p[X]=p[R],p[R]=ee}return p.length=C,p}var KS=mj(function(p){var C=[];return p.charCodeAt(0)===46&&C.push(""),p.replace(gc,function(R,$,H,X){C.push(H?X.replace(av,"$1"):$||R)}),C});function h1(p){if(typeof p=="string"||Ea(p))return p;var C=p+"";return C=="0"&&1/p==-O?"-0":C}function Yl(p){if(p!=null){try{return Tc.call(p)}catch{}try{return p+""}catch{}}return""}function bj(p,C){return Ya(G,function(R){var $="_."+R[0];C&R[1]&&!Ac(p,$)&&p.push($)}),p.sort()}function XS(p){if(p instanceof er)return p.clone();var C=new Xa(p.__wrapped__,p.__chain__);return C.__actions__=Yi(p.__actions__),C.__index__=p.__index__,C.__values__=p.__values__,C}function wj(p,C,R){(R?Mi(p,C,R):C===e)?C=1:C=Rn(Pt(C),0);var $=p==null?0:p.length;if(!$||C<1)return[];for(var H=0,X=0,ee=Ee(Lc($/C));H<$;)ee[X++]=Ja(p,H,H+=C);return ee}function xj(p){for(var C=-1,R=p==null?0:p.length,$=0,H=[];++C<R;){var X=p[C];X&&(H[$++]=X)}return H}function _j(){var p=arguments.length;if(!p)return[];for(var C=Ee(p-1),R=arguments[0],$=p;$--;)C[$-1]=arguments[$];return t4(Ct(R)?Yi(R):[R],ii(C,1))}var kj=Vt(function(p,C){return vn(p)?F6(p,ii(C,1,vn,!0)):[]}),Ej=Vt(function(p,C){var R=eo(C);return vn(R)&&(R=e),vn(p)?F6(p,ii(C,1,vn,!0),mt(R,2)):[]}),Aj=Vt(function(p,C){var R=eo(C);return vn(R)&&(R=e),vn(p)?F6(p,ii(C,1,vn,!0),e,R):[]});function Sj(p,C,R){var $=p==null?0:p.length;return $?(C=R||C===e?1:Pt(C),Ja(p,C<0?0:C,$)):[]}function Cj(p,C,R){var $=p==null?0:p.length;return $?(C=R||C===e?1:Pt(C),C=$-C,Ja(p,0,C<0?0:C)):[]}function Ij(p,C){return p&&p.length?Hc(p,mt(C,3),!0,!0):[]}function Mj(p,C){return p&&p.length?Hc(p,mt(C,3),!0):[]}function Tj(p,C,R,$){var H=p==null?0:p.length;return H?(R&&typeof R!="number"&&Mi(p,C,R)&&(R=0,$=H),_H(p,C,R,$)):[]}function ZS(p,C,R){var $=p==null?0:p.length;if(!$)return-1;var H=R==null?0:Pt(R);return H<0&&(H=Rn($+H,0)),Sc(p,mt(C,3),H)}function JS(p,C,R){var $=p==null?0:p.length;if(!$)return-1;var H=$-1;return R!==e&&(H=Pt(R),H=R<0?Rn($+H,0):gi(H,$-1)),Sc(p,mt(C,3),H,!0)}function eC(p){var C=p==null?0:p.length;return C?ii(p,1):[]}function Nj(p){var C=p==null?0:p.length;return C?ii(p,O):[]}function Dj(p,C){var R=p==null?0:p.length;return R?(C=C===e?1:Pt(C),ii(p,C)):[]}function Pj(p){for(var C=-1,R=p==null?0:p.length,$={};++C<R;){var H=p[C];$[H[0]]=H[1]}return $}function tC(p){return p&&p.length?p[0]:e}function Fj(p,C,R){var $=p==null?0:p.length;if(!$)return-1;var H=R==null?0:Pt(R);return H<0&&(H=Rn($+H,0)),h0(p,C,H)}function Oj(p){var C=p==null?0:p.length;return C?Ja(p,0,-1):[]}var Rj=Vt(function(p){var C=Wr(p,Vv);return C.length&&C[0]===p[0]?Dv(C):[]}),Lj=Vt(function(p){var C=eo(p),R=Wr(p,Vv);return C===eo(R)?C=e:R.pop(),R.length&&R[0]===p[0]?Dv(R,mt(C,2)):[]}),Uj=Vt(function(p){var C=eo(p),R=Wr(p,Vv);return C=typeof C=="function"?C:e,C&&R.pop(),R.length&&R[0]===p[0]?Dv(R,e,C):[]});function Bj(p,C){return p==null?"":OQ.call(p,C)}function eo(p){var C=p==null?0:p.length;return C?p[C-1]:e}function zj(p,C,R){var $=p==null?0:p.length;if(!$)return-1;var H=$;return R!==e&&(H=Pt(R),H=H<0?Rn($+H,0):gi(H,$-1)),C===C?bQ(p,C,H):Sc(p,OA,H,!0)}function qj(p,C){return p&&p.length?dS(p,Pt(C)):e}var Vj=Vt(rC);function rC(p,C){return p&&p.length&&C&&C.length?Rv(p,C):p}function $j(p,C,R){return p&&p.length&&C&&C.length?Rv(p,C,mt(R,2)):p}function Gj(p,C,R){return p&&p.length&&C&&C.length?Rv(p,C,e,R):p}var Wj=ls(function(p,C){var R=p==null?0:p.length,$=Iv(p,C);return hS(p,Wr(C,function(H){return us(H,R)?+H:H}).sort(AS)),$});function Qj(p,C){var R=[];if(!(p&&p.length))return R;var $=-1,H=[],X=p.length;for(C=mt(C,3);++$<X;){var ee=p[$];C(ee,$,p)&&(R.push(ee),H.push($))}return hS(p,H),R}function ry(p){return p==null?p:BQ.call(p)}function Hj(p,C,R){var $=p==null?0:p.length;return $?(R&&typeof R!="number"&&Mi(p,C,R)?(C=0,R=$):(C=C==null?0:Pt(C),R=R===e?$:Pt(R)),Ja(p,C,R)):[]}function jj(p,C){return Qc(p,C)}function Yj(p,C,R){return Bv(p,C,mt(R,2))}function Kj(p,C){var R=p==null?0:p.length;if(R){var $=Qc(p,C);if($<R&&Lo(p[$],C))return $}return-1}function Xj(p,C){return Qc(p,C,!0)}function Zj(p,C,R){return Bv(p,C,mt(R,2),!0)}function Jj(p,C){var R=p==null?0:p.length;if(R){var $=Qc(p,C,!0)-1;if(Lo(p[$],C))return $}return-1}function eY(p){return p&&p.length?vS(p):[]}function tY(p,C){return p&&p.length?vS(p,mt(C,2)):[]}function rY(p){var C=p==null?0:p.length;return C?Ja(p,1,C):[]}function nY(p,C,R){return p&&p.length?(C=R||C===e?1:Pt(C),Ja(p,0,C<0?0:C)):[]}function iY(p,C,R){var $=p==null?0:p.length;return $?(C=R||C===e?1:Pt(C),C=$-C,Ja(p,C<0?0:C,$)):[]}function aY(p,C){return p&&p.length?Hc(p,mt(C,3),!1,!0):[]}function oY(p,C){return p&&p.length?Hc(p,mt(C,3)):[]}var sY=Vt(function(p){return o4(ii(p,1,vn,!0))}),lY=Vt(function(p){var C=eo(p);return vn(C)&&(C=e),o4(ii(p,1,vn,!0),mt(C,2))}),uY=Vt(function(p){var C=eo(p);return C=typeof C=="function"?C:e,o4(ii(p,1,vn,!0),e,C)});function cY(p){return p&&p.length?o4(p):[]}function fY(p,C){return p&&p.length?o4(p,mt(C,2)):[]}function dY(p,C){return C=typeof C=="function"?C:e,p&&p.length?o4(p,e,C):[]}function ny(p){if(!(p&&p.length))return[];var C=0;return p=e4(p,function(R){if(vn(R))return C=Rn(R.length,C),!0}),wv(C,function(R){return Wr(p,vv(R))})}function nC(p,C){if(!(p&&p.length))return[];var R=ny(p);return C==null?R:Wr(R,function($){return xa(C,e,$)})}var pY=Vt(function(p,C){return vn(p)?F6(p,C):[]}),mY=Vt(function(p){return qv(e4(p,vn))}),hY=Vt(function(p){var C=eo(p);return vn(C)&&(C=e),qv(e4(p,vn),mt(C,2))}),gY=Vt(function(p){var C=eo(p);return C=typeof C=="function"?C:e,qv(e4(p,vn),e,C)}),vY=Vt(ny);function yY(p,C){return xS(p||[],C||[],P6)}function bY(p,C){return xS(p||[],C||[],L6)}var wY=Vt(function(p){var C=p.length,R=C>1?p[C-1]:e;return R=typeof R=="function"?(p.pop(),R):e,nC(p,R)});function iC(p){var C=K(p);return C.__chain__=!0,C}function xY(p,C){return C(p),p}function rf(p,C){return C(p)}var _Y=ls(function(p){var C=p.length,R=C?p[0]:0,$=this.__wrapped__,H=function(X){return Iv(X,p)};return C>1||this.__actions__.length||!($ instanceof er)||!us(R)?this.thru(H):($=$.slice(R,+R+(C?1:0)),$.__actions__.push({func:rf,args:[H],thisArg:e}),new Xa($,this.__chain__).thru(function(X){return C&&!X.length&&X.push(e),X}))});function kY(){return iC(this)}function EY(){return new Xa(this.value(),this.__chain__)}function AY(){this.__values__===e&&(this.__values__=yC(this.value()));var p=this.__index__>=this.__values__.length,C=p?e:this.__values__[this.__index__++];return{done:p,value:C}}function SY(){return this}function CY(p){for(var C,R=this;R instanceof qc;){var $=XS(R);$.__index__=0,$.__values__=e,C?H.__wrapped__=$:C=$;var H=$;R=R.__wrapped__}return H.__wrapped__=p,C}function IY(){var p=this.__wrapped__;if(p instanceof er){var C=p;return this.__actions__.length&&(C=new er(this)),C=C.reverse(),C.__actions__.push({func:rf,args:[ry],thisArg:e}),new Xa(C,this.__chain__)}return this.thru(ry)}function MY(){return wS(this.__wrapped__,this.__actions__)}var TY=jc(function(p,C,R){Sr.call(p,R)?++p[R]:os(p,R,1)});function NY(p,C,R){var $=Ct(p)?PA:xH;return R&&Mi(p,C,R)&&(C=e),$(p,mt(C,3))}function DY(p,C){var R=Ct(p)?e4:nS;return R(p,mt(C,3))}var PY=NS(ZS),FY=NS(JS);function OY(p,C){return ii(nf(p,C),1)}function RY(p,C){return ii(nf(p,C),O)}function LY(p,C,R){return R=R===e?1:Pt(R),ii(nf(p,C),R)}function aC(p,C){var R=Ct(p)?Ya:a4;return R(p,mt(C,3))}function oC(p,C){var R=Ct(p)?rQ:rS;return R(p,mt(C,3))}var UY=jc(function(p,C,R){Sr.call(p,R)?p[R].push(C):os(p,R,[C])});function BY(p,C,R,$){p=Ki(p)?p:S0(p),R=R&&!$?Pt(R):0;var H=p.length;return R<0&&(R=Rn(H+R,0)),uf(p)?R<=H&&p.indexOf(C,R)>-1:!!H&&h0(p,C,R)>-1}var zY=Vt(function(p,C,R){var $=-1,H=typeof C=="function",X=Ki(p)?Ee(p.length):[];return a4(p,function(ee){X[++$]=H?xa(C,ee,R):O6(ee,C,R)}),X}),qY=jc(function(p,C,R){os(p,R,C)});function nf(p,C){var R=Ct(p)?Wr:uS;return R(p,mt(C,3))}function VY(p,C,R,$){return p==null?[]:(Ct(C)||(C=C==null?[]:[C]),R=$?e:R,Ct(R)||(R=R==null?[]:[R]),pS(p,C,R))}var $Y=jc(function(p,C,R){p[R?0:1].push(C)},function(){return[[],[]]});function GY(p,C,R){var $=Ct(p)?hv:LA,H=arguments.length<3;return $(p,mt(C,4),R,H,a4)}function WY(p,C,R){var $=Ct(p)?nQ:LA,H=arguments.length<3;return $(p,mt(C,4),R,H,rS)}function QY(p,C){var R=Ct(p)?e4:nS;return R(p,sf(mt(C,3)))}function HY(p){var C=Ct(p)?ZA:BH;return C(p)}function jY(p,C,R){(R?Mi(p,C,R):C===e)?C=1:C=Pt(C);var $=Ct(p)?gH:zH;return $(p,C)}function YY(p){var C=Ct(p)?vH:VH;return C(p)}function KY(p){if(p==null)return 0;if(Ki(p))return uf(p)?v0(p):p.length;var C=vi(p);return C==re||C==le?p.size:Fv(p).length}function XY(p,C,R){var $=Ct(p)?gv:$H;return R&&Mi(p,C,R)&&(C=e),$(p,mt(C,3))}var ZY=Vt(function(p,C){if(p==null)return[];var R=C.length;return R>1&&Mi(p,C[0],C[1])?C=[]:R>2&&Mi(C[0],C[1],C[2])&&(C=[C[0]]),pS(p,ii(C,1),[])}),af=DQ||function(){return $n.Date.now()};function JY(p,C){if(typeof C!="function")throw new Ka(i);return p=Pt(p),function(){if(--p<1)return C.apply(this,arguments)}}function sC(p,C,R){return C=R?e:C,C=p&&C==null?p.length:C,ss(p,x,e,e,e,e,C)}function lC(p,C){var R;if(typeof C!="function")throw new Ka(i);return p=Pt(p),function(){return--p>0&&(R=C.apply(this,arguments)),p<=1&&(C=e),R}}var iy=Vt(function(p,C,R){var $=h;if(R.length){var H=r4(R,E0(iy));$|=w}return ss(p,$,C,R,H)}),uC=Vt(function(p,C,R){var $=h|g;if(R.length){var H=r4(R,E0(uC));$|=w}return ss(C,$,p,R,H)});function cC(p,C,R){C=R?e:C;var $=ss(p,v,e,e,e,e,e,C);return $.placeholder=cC.placeholder,$}function fC(p,C,R){C=R?e:C;var $=ss(p,_,e,e,e,e,e,C);return $.placeholder=fC.placeholder,$}function dC(p,C,R){var $,H,X,ee,ae,me,Fe=0,Re=!1,ze=!1,Ke=!0;if(typeof p!="function")throw new Ka(i);C=to(C)||0,Hr(R)&&(Re=!!R.leading,ze="maxWait"in R,X=ze?Rn(to(R.maxWait)||0,C):X,Ke="trailing"in R?!!R.trailing:Ke);function nt(yn){var Uo=$,ds=H;return $=H=e,Fe=yn,ee=p.apply(ds,Uo),ee}function ht(yn){return Fe=yn,ae=z6(Xt,C),Re?nt(yn):ee}function Lt(yn){var Uo=yn-me,ds=yn-Fe,NC=C-Uo;return ze?gi(NC,X-ds):NC}function gt(yn){var Uo=yn-me,ds=yn-Fe;return me===e||Uo>=C||Uo<0||ze&&ds>=X}function Xt(){var yn=af();if(gt(yn))return ir(yn);ae=z6(Xt,Lt(yn))}function ir(yn){return ae=e,Ke&&$?nt(yn):($=H=e,ee)}function Aa(){ae!==e&&_S(ae),Fe=0,$=me=H=ae=e}function Ti(){return ae===e?ee:ir(af())}function Sa(){var yn=af(),Uo=gt(yn);if($=arguments,H=this,me=yn,Uo){if(ae===e)return ht(me);if(ze)return _S(ae),ae=z6(Xt,C),nt(me)}return ae===e&&(ae=z6(Xt,C)),ee}return Sa.cancel=Aa,Sa.flush=Ti,Sa}var eK=Vt(function(p,C){return tS(p,1,C)}),tK=Vt(function(p,C,R){return tS(p,to(C)||0,R)});function rK(p){return ss(p,I)}function of(p,C){if(typeof p!="function"||C!=null&&typeof C!="function")throw new Ka(i);var R=function(){var $=arguments,H=C?C.apply(this,$):$[0],X=R.cache;if(X.has(H))return X.get(H);var ee=p.apply(this,$);return R.cache=X.set(H,ee)||X,ee};return R.cache=new(of.Cache||as),R}of.Cache=as;function sf(p){if(typeof p!="function")throw new Ka(i);return function(){var C=arguments;switch(C.length){case 0:return!p.call(this);case 1:return!p.call(this,C[0]);case 2:return!p.call(this,C[0],C[1]);case 3:return!p.call(this,C[0],C[1],C[2])}return!p.apply(this,C)}}function nK(p){return lC(2,p)}var iK=GH(function(p,C){C=C.length==1&&Ct(C[0])?Wr(C[0],_a(mt())):Wr(ii(C,1),_a(mt()));var R=C.length;return Vt(function($){for(var H=-1,X=gi($.length,R);++H<X;)$[H]=C[H].call(this,$[H]);return xa(p,this,$)})}),ay=Vt(function(p,C){var R=r4(C,E0(ay));return ss(p,w,e,C,R)}),pC=Vt(function(p,C){var R=r4(C,E0(pC));return ss(p,k,e,C,R)}),aK=ls(function(p,C){return ss(p,S,e,e,e,C)});function oK(p,C){if(typeof p!="function")throw new Ka(i);return C=C===e?C:Pt(C),Vt(p,C)}function sK(p,C){if(typeof p!="function")throw new Ka(i);return C=C==null?0:Rn(Pt(C),0),Vt(function(R){var $=R[C],H=l4(R,0,C);return $&&t4(H,$),xa(p,this,H)})}function lK(p,C,R){var $=!0,H=!0;if(typeof p!="function")throw new Ka(i);return Hr(R)&&($="leading"in R?!!R.leading:$,H="trailing"in R?!!R.trailing:H),dC(p,C,{leading:$,maxWait:C,trailing:H})}function uK(p){return sC(p,1)}function cK(p,C){return ay($v(C),p)}function fK(){if(!arguments.length)return[];var p=arguments[0];return Ct(p)?p:[p]}function dK(p){return Za(p,f)}function pK(p,C){return C=typeof C=="function"?C:e,Za(p,f,C)}function mK(p){return Za(p,u|f)}function hK(p,C){return C=typeof C=="function"?C:e,Za(p,u|f,C)}function gK(p,C){return C==null||eS(p,C,Gn(C))}function Lo(p,C){return p===C||p!==p&&C!==C}var vK=Zc(Nv),yK=Zc(function(p,C){return p>=C}),Kl=oS(function(){return arguments}())?oS:function(p){return nn(p)&&Sr.call(p,"callee")&&!QA.call(p,"callee")},Ct=Ee.isArray,bK=CA?_a(CA):CH;function Ki(p){return p!=null&&lf(p.length)&&!cs(p)}function vn(p){return nn(p)&&Ki(p)}function wK(p){return p===!0||p===!1||nn(p)&&Ii(p)==oe}var u4=FQ||gy,xK=IA?_a(IA):IH;function _K(p){return nn(p)&&p.nodeType===1&&!q6(p)}function kK(p){if(p==null)return!0;if(Ki(p)&&(Ct(p)||typeof p=="string"||typeof p.splice=="function"||u4(p)||A0(p)||Kl(p)))return!p.length;var C=vi(p);if(C==re||C==le)return!p.size;if(B6(p))return!Fv(p).length;for(var R in p)if(Sr.call(p,R))return!1;return!0}function EK(p,C){return R6(p,C)}function AK(p,C,R){R=typeof R=="function"?R:e;var $=R?R(p,C):e;return $===e?R6(p,C,e,R):!!$}function oy(p){if(!nn(p))return!1;var C=Ii(p);return C==ne||C==se||typeof p.message=="string"&&typeof p.name=="string"&&!q6(p)}function SK(p){return typeof p=="number"&&jA(p)}function cs(p){if(!Hr(p))return!1;var C=Ii(p);return C==he||C==Se||C==J||C==Ne}function mC(p){return typeof p=="number"&&p==Pt(p)}function lf(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=L}function Hr(p){var C=typeof p;return p!=null&&(C=="object"||C=="function")}function nn(p){return p!=null&&typeof p=="object"}var hC=MA?_a(MA):TH;function CK(p,C){return p===C||Pv(p,C,Kv(C))}function IK(p,C,R){return R=typeof R=="function"?R:e,Pv(p,C,Kv(C),R)}function MK(p){return gC(p)&&p!=+p}function TK(p){if(pj(p))throw new kt(n);return sS(p)}function NK(p){return p===null}function DK(p){return p==null}function gC(p){return typeof p=="number"||nn(p)&&Ii(p)==Z}function q6(p){if(!nn(p)||Ii(p)!=ye)return!1;var C=Fc(p);if(C===null)return!0;var R=Sr.call(C,"constructor")&&C.constructor;return typeof R=="function"&&R instanceof R&&Tc.call(R)==IQ}var sy=TA?_a(TA):NH;function PK(p){return mC(p)&&p>=-L&&p<=L}var vC=NA?_a(NA):DH;function uf(p){return typeof p=="string"||!Ct(p)&&nn(p)&&Ii(p)==ie}function Ea(p){return typeof p=="symbol"||nn(p)&&Ii(p)==ve}var A0=DA?_a(DA):PH;function FK(p){return p===e}function OK(p){return nn(p)&&vi(p)==Te}function RK(p){return nn(p)&&Ii(p)==Oe}var LK=Zc(Ov),UK=Zc(function(p,C){return p<=C});function yC(p){if(!p)return[];if(Ki(p))return uf(p)?Oo(p):Yi(p);if(I6&&p[I6])return gQ(p[I6]());var C=vi(p),R=C==re?_v:C==le?Cc:S0;return R(p)}function fs(p){if(!p)return p===0?p:0;if(p=to(p),p===O||p===-O){var C=p<0?-1:1;return C*P}return p===p?p:0}function Pt(p){var C=fs(p),R=C%1;return C===C?R?C-R:C:0}function bC(p){return p?Ql(Pt(p),0,B):0}function to(p){if(typeof p=="number")return p;if(Ea(p))return U;if(Hr(p)){var C=typeof p.valueOf=="function"?p.valueOf():p;p=Hr(C)?C+"":C}if(typeof p!="string")return p===0?p:+p;p=UA(p);var R=_c.test(p);return R||A6.test(p)?JW(p.slice(2),R?2:8):Ll.test(p)?U:+p}function wC(p){return m1(p,Xi(p))}function BK(p){return p?Ql(Pt(p),-L,L):p===0?p:0}function xr(p){return p==null?"":ka(p)}var zK=_0(function(p,C){if(B6(C)||Ki(C)){m1(C,Gn(C),p);return}for(var R in C)Sr.call(C,R)&&P6(p,R,C[R])}),xC=_0(function(p,C){m1(C,Xi(C),p)}),cf=_0(function(p,C,R,$){m1(C,Xi(C),p,$)}),qK=_0(function(p,C,R,$){m1(C,Gn(C),p,$)}),VK=ls(Iv);function $K(p,C){var R=x0(p);return C==null?R:JA(R,C)}var GK=Vt(function(p,C){p=Nr(p);var R=-1,$=C.length,H=$>2?C[2]:e;for(H&&Mi(C[0],C[1],H)&&($=1);++R<$;)for(var X=C[R],ee=Xi(X),ae=-1,me=ee.length;++ae<me;){var Fe=ee[ae],Re=p[Fe];(Re===e||Lo(Re,y0[Fe])&&!Sr.call(p,Fe))&&(p[Fe]=X[Fe])}return p}),WK=Vt(function(p){return p.push(e,US),xa(_C,e,p)});function QK(p,C){return FA(p,mt(C,3),p1)}function HK(p,C){return FA(p,mt(C,3),Tv)}function jK(p,C){return p==null?p:Mv(p,mt(C,3),Xi)}function YK(p,C){return p==null?p:iS(p,mt(C,3),Xi)}function KK(p,C){return p&&p1(p,mt(C,3))}function XK(p,C){return p&&Tv(p,mt(C,3))}function ZK(p){return p==null?[]:Gc(p,Gn(p))}function JK(p){return p==null?[]:Gc(p,Xi(p))}function ly(p,C,R){var $=p==null?e:Hl(p,C);return $===e?R:$}function eX(p,C){return p!=null&&qS(p,C,kH)}function uy(p,C){return p!=null&&qS(p,C,EH)}var tX=PS(function(p,C,R){C!=null&&typeof C.toString!="function"&&(C=Nc.call(C)),p[C]=R},fy(Zi)),rX=PS(function(p,C,R){C!=null&&typeof C.toString!="function"&&(C=Nc.call(C)),Sr.call(p,C)?p[C].push(R):p[C]=[R]},mt),nX=Vt(O6);function Gn(p){return Ki(p)?XA(p):Fv(p)}function Xi(p){return Ki(p)?XA(p,!0):FH(p)}function iX(p,C){var R={};return C=mt(C,3),p1(p,function($,H,X){os(R,C($,H,X),$)}),R}function aX(p,C){var R={};return C=mt(C,3),p1(p,function($,H,X){os(R,H,C($,H,X))}),R}var oX=_0(function(p,C,R){Wc(p,C,R)}),_C=_0(function(p,C,R,$){Wc(p,C,R,$)}),sX=ls(function(p,C){var R={};if(p==null)return R;var $=!1;C=Wr(C,function(X){return X=s4(X,p),$||($=X.length>1),X}),m1(p,jv(p),R),$&&(R=Za(R,u|c|f,tj));for(var H=C.length;H--;)zv(R,C[H]);return R});function lX(p,C){return kC(p,sf(mt(C)))}var uX=ls(function(p,C){return p==null?{}:RH(p,C)});function kC(p,C){if(p==null)return{};var R=Wr(jv(p),function($){return[$]});return C=mt(C),mS(p,R,function($,H){return C($,H[0])})}function cX(p,C,R){C=s4(C,p);var $=-1,H=C.length;for(H||(H=1,p=e);++$<H;){var X=p==null?e:p[h1(C[$])];X===e&&($=H,X=R),p=cs(X)?X.call(p):X}return p}function fX(p,C,R){return p==null?p:L6(p,C,R)}function dX(p,C,R,$){return $=typeof $=="function"?$:e,p==null?p:L6(p,C,R,$)}var EC=RS(Gn),AC=RS(Xi);function pX(p,C,R){var $=Ct(p),H=$||u4(p)||A0(p);if(C=mt(C,4),R==null){var X=p&&p.constructor;H?R=$?new X:[]:Hr(p)?R=cs(X)?x0(Fc(p)):{}:R={}}return(H?Ya:p1)(p,function(ee,ae,me){return C(R,ee,ae,me)}),R}function mX(p,C){return p==null?!0:zv(p,C)}function hX(p,C,R){return p==null?p:bS(p,C,$v(R))}function gX(p,C,R,$){return $=typeof $=="function"?$:e,p==null?p:bS(p,C,$v(R),$)}function S0(p){return p==null?[]:xv(p,Gn(p))}function vX(p){return p==null?[]:xv(p,Xi(p))}function yX(p,C,R){return R===e&&(R=C,C=e),R!==e&&(R=to(R),R=R===R?R:0),C!==e&&(C=to(C),C=C===C?C:0),Ql(to(p),C,R)}function bX(p,C,R){return C=fs(C),R===e?(R=C,C=0):R=fs(R),p=to(p),AH(p,C,R)}function wX(p,C,R){if(R&&typeof R!="boolean"&&Mi(p,C,R)&&(C=R=e),R===e&&(typeof C=="boolean"?(R=C,C=e):typeof p=="boolean"&&(R=p,p=e)),p===e&&C===e?(p=0,C=1):(p=fs(p),C===e?(C=p,p=0):C=fs(C)),p>C){var $=p;p=C,C=$}if(R||p%1||C%1){var H=YA();return gi(p+H*(C-p+ZW("1e-"+((H+"").length-1))),C)}return Lv(p,C)}var xX=k0(function(p,C,R){return C=C.toLowerCase(),p+(R?SC(C):C)});function SC(p){return cy(xr(p).toLowerCase())}function CC(p){return p=xr(p),p&&p.replace(kc,fQ).replace(VW,"")}function _X(p,C,R){p=xr(p),C=ka(C);var $=p.length;R=R===e?$:Ql(Pt(R),0,$);var H=R;return R-=C.length,R>=0&&p.slice(R,H)==C}function kX(p){return p=xr(p),p&&Ha.test(p)?p.replace(Ci,dQ):p}function EX(p){return p=xr(p),p&&vc.test(p)?p.replace(f0,"\\$&"):p}var AX=k0(function(p,C,R){return p+(R?"-":"")+C.toLowerCase()}),SX=k0(function(p,C,R){return p+(R?" ":"")+C.toLowerCase()}),CX=TS("toLowerCase");function IX(p,C,R){p=xr(p),C=Pt(C);var $=C?v0(p):0;if(!C||$>=C)return p;var H=(C-$)/2;return Xc(Uc(H),R)+p+Xc(Lc(H),R)}function MX(p,C,R){p=xr(p),C=Pt(C);var $=C?v0(p):0;return C&&$<C?p+Xc(C-$,R):p}function TX(p,C,R){p=xr(p),C=Pt(C);var $=C?v0(p):0;return C&&$<C?Xc(C-$,R)+p:p}function NX(p,C,R){return R||C==null?C=0:C&&(C=+C),UQ(xr(p).replace(Rl,""),C||0)}function DX(p,C,R){return(R?Mi(p,C,R):C===e)?C=1:C=Pt(C),Uv(xr(p),C)}function PX(){var p=arguments,C=xr(p[0]);return p.length<3?C:C.replace(p[1],p[2])}var FX=k0(function(p,C,R){return p+(R?"_":"")+C.toLowerCase()});function OX(p,C,R){return R&&typeof R!="number"&&Mi(p,C,R)&&(C=R=e),R=R===e?B:R>>>0,R?(p=xr(p),p&&(typeof C=="string"||C!=null&&!sy(C))&&(C=ka(C),!C&&g0(p))?l4(Oo(p),0,R):p.split(C,R)):[]}var RX=k0(function(p,C,R){return p+(R?" ":"")+cy(C)});function LX(p,C,R){return p=xr(p),R=R==null?0:Ql(Pt(R),0,p.length),C=ka(C),p.slice(R,R+C.length)==C}function UX(p,C,R){var $=K.templateSettings;R&&Mi(p,C,R)&&(C=e),p=xr(p),C=cf({},C,$,LS);var H=cf({},C.imports,$.imports,LS),X=Gn(H),ee=xv(H,X),ae,me,Fe=0,Re=C.interpolate||Bl,ze="__p += '",Ke=kv((C.escape||Bl).source+"|"+Re.source+"|"+(Re===ba?ov:Bl).source+"|"+(C.evaluate||Bl).source+"|$","g"),nt="//# sourceURL="+(Sr.call(C,"sourceURL")?(C.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++HW+"]")+`
4
4
  `;p.replace(Ke,function(gt,Xt,ir,Aa,Ti,Sa){return ir||(ir=Aa),ze+=p.slice(Fe,Sa).replace(Zs,pQ),Xt&&(ae=!0,ze+=`' +
@@ -77,7 +77,7 @@ ${t}</tr>
77
77
  `+this.renderer.text(u);r?n+=this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):n+=c;continue}default:{let u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}parseInline(t,r=this.renderer){var i,a;let n="";for(let o=0;o<t.length;o++){let s=t[o];if((a=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&a[s.type]){let u=this.options.extensions.renderers[s.type].call({parser:this},s);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){n+=u||"";continue}}let l=s;switch(l.type){case"escape":{n+=r.text(l);break}case"html":{n+=r.html(l);break}case"link":{n+=r.link(l);break}case"image":{n+=r.image(l);break}case"strong":{n+=r.strong(l);break}case"em":{n+=r.em(l);break}case"codespan":{n+=r.codespan(l);break}case"br":{n+=r.br(l);break}case"del":{n+=r.del(l);break}case"text":{n+=r.text(l);break}default:{let u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return n}},L2=class{constructor(t){Ge(this,"options");Ge(this,"block");this.options=t||B2}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?a1.lex:a1.lexInline}provideParser(){return this.block?o1.parse:o1.parseInline}};Ge(L2,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));Tx=class{constructor(...t){Ge(this,"defaults",Nx());Ge(this,"options",this.setOptions);Ge(this,"parse",this.parseMarkdown(!0));Ge(this,"parseInline",this.parseMarkdown(!1));Ge(this,"Parser",o1);Ge(this,"Renderer",Z3);Ge(this,"TextRenderer",V9);Ge(this,"Lexer",a1);Ge(this,"Tokenizer",X3);Ge(this,"Hooks",L2);this.use(...t)}walkTokens(t,r){var i,a;let n=[];for(let o of t)switch(n=n.concat(r.call(this,o)),o.type){case"table":{let s=o;for(let l of s.header)n=n.concat(this.walkTokens(l.tokens,r));for(let l of s.rows)for(let u of l)n=n.concat(this.walkTokens(u.tokens,r));break}case"list":{let s=o;n=n.concat(this.walkTokens(s.items,r));break}default:{let s=o;(a=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&a[s.type]?this.defaults.extensions.childTokens[s.type].forEach(l=>{let u=s[l].flat(1/0);n=n.concat(this.walkTokens(u,r))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,r)))}}return n}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){let o=r.renderers[a.name];o?r.renderers[a.name]=function(...s){let l=a.renderer.apply(this,s);return l===!1&&(l=o.apply(this,s)),l}:r.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=r[a.level];o?o.unshift(a.tokenizer):r[a.level]=[a.tokenizer],a.start&&(a.level==="block"?r.startBlock?r.startBlock.push(a.start):r.startBlock=[a.start]:a.level==="inline"&&(r.startInline?r.startInline.push(a.start):r.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(r.childTokens[a.name]=a.childTokens)}),i.extensions=r),n.renderer){let a=this.defaults.renderer||new Z3(this.defaults);for(let o in n.renderer){if(!(o in a))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let s=o,l=n.renderer[s],u=a[s];a[s]=(...c)=>{let f=l.apply(a,c);return f===!1&&(f=u.apply(a,c)),f||""}}i.renderer=a}if(n.tokenizer){let a=this.defaults.tokenizer||new X3(this.defaults);for(let o in n.tokenizer){if(!(o in a))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let s=o,l=n.tokenizer[s],u=a[s];a[s]=(...c)=>{let f=l.apply(a,c);return f===!1&&(f=u.apply(a,c)),f}}i.tokenizer=a}if(n.hooks){let a=this.defaults.hooks||new L2;for(let o in n.hooks){if(!(o in a))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let s=o,l=n.hooks[s],u=a[s];L2.passThroughHooks.has(o)?a[s]=c=>{if(this.defaults.async)return Promise.resolve(l.call(a,c)).then(d=>u.call(a,d));let f=l.call(a,c);return u.call(a,f)}:a[s]=(...c)=>{let f=l.apply(a,c);return f===!1&&(f=u.apply(a,c)),f}}i.hooks=a}if(n.walkTokens){let a=this.defaults.walkTokens,o=n.walkTokens;i.walkTokens=function(s){let l=[];return l.push(o.call(this,s)),a&&(l=l.concat(a.call(this,s))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return a1.lex(t,r!=null?r:this.defaults)}parser(t,r){return o1.parse(t,r!=null?r:this.defaults)}parseMarkdown(t){return(n,i)=>{let a={...i},o={...this.defaults,...a},s=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&a.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=t);let l=o.hooks?o.hooks.provideLexer():t?a1.lex:a1.lexInline,u=o.hooks?o.hooks.provideParser():t?o1.parse:o1.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then(c=>l(c,o)).then(c=>o.hooks?o.hooks.processAllTokens(c):c).then(c=>o.walkTokens?Promise.all(this.walkTokens(c,o.walkTokens)).then(()=>c):c).then(c=>u(c,o)).then(c=>o.hooks?o.hooks.postprocess(c):c).catch(s);try{o.hooks&&(n=o.hooks.preprocess(n));let c=l(n,o);o.hooks&&(c=o.hooks.processAllTokens(c)),o.walkTokens&&this.walkTokens(c,o.walkTokens);let f=u(c,o);return o.hooks&&(f=o.hooks.postprocess(f)),f}catch(c){return s(c)}}}onError(t,r){return n=>{if(n.message+=`
78
78
  Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+W1(n.message+"",!0)+"</pre>";return r?Promise.resolve(i):i}if(r)return Promise.reject(n);throw n}}},U2=new Tx;Ot.options=Ot.setOptions=function(e){return U2.setOptions(e),Ot.defaults=U2.defaults,SL(Ot.defaults),Ot};Ot.getDefaults=Nx;Ot.defaults=B2;Ot.use=function(...e){return U2.use(...e),Ot.defaults=U2.defaults,SL(Ot.defaults),Ot};Ot.walkTokens=function(e,t){return U2.walkTokens(e,t)};Ot.parseInline=U2.parseInline;Ot.Parser=o1;Ot.parser=o1.parse;Ot.Renderer=Z3;Ot.TextRenderer=V9;Ot.Lexer=a1;Ot.lexer=a1.lex;Ot.Tokenizer=X3;Ot.Hooks=L2;Ot.parse=Ot;Uve=Ot.options,Bve=Ot.setOptions,zve=Ot.use,qve=Ot.walkTokens,Vve=Ot.parseInline,$ve=o1.parse,Gve=a1.lex});var qL={};j(qL,{default:()=>G9});function zL(e){e&&e.abort()}function vae(e,t){Object.keys(e.inflightTile).forEach(r=>{t.find(i=>r===i.id)||(zL(e.inflightTile[r]),delete e.inflightTile[r])})}function Bx(e){return{minX:e.loc[0],minY:e.loc[1],maxX:e.loc[0],maxY:e.loc[1],data:e}}function BL(e,t){St.rtree.remove(e,(r,n)=>r.data.id===n.data.id),t&&St.rtree.insert(e)}function yae(e){let t=!1;do{e=qr(e,t?[1e-5,0]:[0,1e-5]);let n=Me(e).bbox();t=St.rtree.search(n).length}while(t);return e}var gae,LL,UL,Dp,e5,St,G9,zx=q(()=>{"use strict";Fa();Ye();wi();J3();An();ue();He();lr();Ie();gae=mr(),LL=xe("loaded"),UL=14,Dp="https://osmose.openstreetmap.fr/api/0.3",e5={icons:{},items:[]};G9={title:"osmose",init(){it.get("qa_data").then(e=>{e5=e.osmose,e5.items=Object.keys(e.osmose.icons).map(t=>t.split("-")[0]).reduce((t,r)=>t.indexOf(r)!==-1?t:[...t,r],[])}),St||this.reset(),this.event=_e(this,LL,"on")},reset(){let e={},t={};St&&(Object.values(St.inflightTile).forEach(zL),e=St.strings,t=St.colors),St={data:{},loadedTile:{},inflightTile:{},inflightPost:{},closed:{},rtree:new zt,strings:e,colors:t}},loadIssues(e){let t={item:e5.items},r=gae.zoomExtent([UL,UL]).getTiles(e);vae(St,r),r.forEach(n=>{if(St.loadedTile[n.id]||St.inflightTile[n.id])return;let[i,a,o]=n.xyz,s=`${Dp}/issues/${o}/${i}/${a}.geojson?`+at(t),l=new AbortController;St.inflightTile[n.id]=l,rr(s,{signal:l.signal}).then(u=>{delete St.inflightTile[n.id],St.loadedTile[n.id]=!0,u.features&&u.features.forEach(c=>{let{item:f,class:d,uuid:m}=c.properties,h=`${f}-${d}`;if(h in e5.icons){let g=c.geometry.coordinates;g=yae(g);let A=new Lr(g,this,h,m,{item:f});(f===8300||f===8360)&&(A.elems=[]),St.data[A.id]=A,St.rtree.insert(Bx(A))}}),LL.call("loaded")}).catch(()=>{delete St.inflightTile[n.id],St.loadedTile[n.id]=!0})})},loadIssueDetail(e){if(e.elems!==void 0)return Promise.resolve(e);let t=`${Dp}/issue/${e.id}?langs=${pe.localeCode()}`,r=n=>{e.elems=n.elems.map(i=>i.type.substring(0,1)+i.id),e.detail=n.subtitle?Ot(n.subtitle.auto):"",this.replaceItem(e)};return rr(t).then(r).then(()=>e)},loadStrings(e=pe.localeCode()){let t=Object.keys(e5.icons);if(e in St.strings&&Object.keys(St.strings[e]).length===t.length)return Promise.resolve(St.strings[e]);e in St.strings||(St.strings[e]={});let r=t.map(n=>{if(n in St.strings[e])return null;let i=l=>{let[u={items:[]}]=l.categories,[c={class:[]}]=u.items,[f=null]=c.class;if(!f){console.log(`Osmose strings request (${n}) had unexpected data`);return}let{item:d,color:m}=c;/^#[A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}/.test(m)&&(St.colors[d]=m);let{title:h,detail:g,fix:A,trap:v}=f,_={};h&&(_.title=h.auto),g&&(_.detail=Ot(g.auto)),v&&(_.trap=Ot(v.auto)),A&&(_.fix=Ot(A.auto)),St.strings[e][n]=_},[a,o]=n.split("-"),s=`${Dp}/items/${a}/class/${o}?langs=${e}`;return rr(s).then(i)}).filter(Boolean);return Promise.all(r).then(()=>St.strings[e])},getStrings(e,t=pe.localeCode()){return t in St.strings?St.strings[t][e]:{}},getColor(e){return e in St.colors?St.colors[e]:"#FFFFFF"},postUpdate(e,t){if(St.inflightPost[e.id])return t({message:"Issue update already inflight",status:-2},e);let r=`${Dp}/issue/${e.id}/${e.newStatus}`,n=new AbortController,i=()=>{delete St.inflightPost[e.id],this.removeItem(e),e.newStatus==="done"&&(e.item in St.closed||(St.closed[e.item]=0),St.closed[e.item]+=1),t&&t(null,e)};St.inflightPost[e.id]=n,fetch(r,{signal:n.signal}).then(i).catch(a=>{delete St.inflightPost[e.id],t&&t(a.message)})},getItems(e){let t=e.clipExtent(),r=[t[0][0],t[1][1]],n=[t[1][0],t[0][1]],i=Me(e.invert(r),e.invert(n)).bbox();return St.rtree.search(i).map(a=>a.data)},getError(e){return St.data[e]},getIcon(e){return e5.icons[e]},replaceItem(e){if(!(!(e instanceof Lr)||!e.id))return St.data[e.id]=e,BL(Bx(e),!0),e},removeItem(e){!(e instanceof Lr)||!e.id||(delete St.data[e.id],BL(Bx(e),!1))},getClosedCounts(){return St.closed},itemURL(e){return`https://osmose.openstreetmap.fr/en/error/${e.id}`}}});function wae(e,t,r){let n=r.buf,i,a;if(a=n[r.pos++],i=(a&112)>>4,a<128||(a=n[r.pos++],i|=(a&127)<<3,a<128)||(a=n[r.pos++],i|=(a&127)<<10,a<128)||(a=n[r.pos++],i|=(a&127)<<17,a<128)||(a=n[r.pos++],i|=(a&127)<<24,a<128)||(a=n[r.pos++],i|=(a&1)<<31,a<128))return t5(e,i,t);throw new Error("Expected varint not more than 10 bytes")}function t5(e,t,r){return r?t*4294967296+(e>>>0):(t>>>0)*4294967296+(e>>>0)}function xae(e,t){let r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(r=~(-e%4294967296),n=~(-e/4294967296),r^4294967295?r=r+1|0:(r=0,n=n+1|0)),e>=18446744073709552e3||e<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),_ae(r,n,t),kae(n,t)}function _ae(e,t,r){r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos++]=e&127|128,e>>>=7,r.buf[r.pos]=e&127}function kae(e,t){let r=(e&7)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=e&127)))))}function GL(e,t,r){let n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(Math.LN2*7));r.realloc(n);for(let i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function Eae(e,t){for(let r=0;r<e.length;r++)t.writeVarint(e[r])}function Aae(e,t){for(let r=0;r<e.length;r++)t.writeSVarint(e[r])}function Sae(e,t){for(let r=0;r<e.length;r++)t.writeFloat(e[r])}function Cae(e,t){for(let r=0;r<e.length;r++)t.writeDouble(e[r])}function Iae(e,t){for(let r=0;r<e.length;r++)t.writeBoolean(e[r])}function Mae(e,t){for(let r=0;r<e.length;r++)t.writeFixed32(e[r])}function Tae(e,t){for(let r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Nae(e,t){for(let r=0;r<e.length;r++)t.writeFixed64(e[r])}function Dae(e,t){for(let r=0;r<e.length;r++)t.writeSFixed64(e[r])}function Pae(e,t,r){let n="",i=t;for(;i<r;){let a=e[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s>r)break;let l,u,c;s===1?a<128&&(o=a):s===2?(l=e[i+1],(l&192)===128&&(o=(a&31)<<6|l&63,o<=127&&(o=null))):s===3?(l=e[i+1],u=e[i+2],(l&192)===128&&(u&192)===128&&(o=(a&15)<<12|(l&63)<<6|u&63,(o<=2047||o>=55296&&o<=57343)&&(o=null))):s===4&&(l=e[i+1],u=e[i+2],c=e[i+3],(l&192)===128&&(u&192)===128&&(c&192)===128&&(o=(a&15)<<18|(l&63)<<12|(u&63)<<6|c&63,(o<=65535||o>=1114112)&&(o=null))),o===null?(o=65533,s=1):o>65535&&(o-=65536,n+=String.fromCharCode(o>>>10&1023|55296),o=56320|o&1023),n+=String.fromCharCode(o),i+=s}return n}function Fae(e,t,r){for(let n=0,i,a;n<t.length;n++){if(i=t.charCodeAt(n),i>55295&&i<57344)if(a)if(i<56320){e[r++]=239,e[r++]=191,e[r++]=189,a=i;continue}else i=a-55296<<10|i-56320|65536,a=null;else{i>56319||n+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):a=i;continue}else a&&(e[r++]=239,e[r++]=191,e[r++]=189,a=null);i<128?e[r++]=i:(i<2048?e[r++]=i>>6|192:(i<65536?e[r++]=i>>12|224:(e[r++]=i>>18|240,e[r++]=i>>12&63|128),e[r++]=i>>6&63|128),e[r++]=i&63|128)}return r}var VL,bae,$L,qx,Pp,W9,Fp,ko,Q9=q(()=>{VL=23283064365386963e-26,bae=12,$L=typeof TextDecoder>"u"?null:new TextDecoder("utf-8"),qx=0,Pp=1,W9=2,Fp=5,ko=class{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(t,r,n=this.length){for(;this.pos<n;){let i=this.readVarint(),a=i>>3,o=this.pos;this.type=i&7,t(a,r,this),this.pos===o&&this.skip(i)}return r}readMessage(t,r){return this.readFields(t,r,this.readVarint()+this.pos)}readFixed32(){let t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){let t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*4294967296;return this.pos+=8,t}readSFixed64(){let t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*4294967296;return this.pos+=8,t}readFloat(){let t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){let t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){let r=this.buf,n,i;return i=r[this.pos++],n=i&127,i<128||(i=r[this.pos++],n|=(i&127)<<7,i<128)||(i=r[this.pos++],n|=(i&127)<<14,i<128)||(i=r[this.pos++],n|=(i&127)<<21,i<128)?n:(i=r[this.pos],n|=(i&15)<<28,wae(n,t,this))}readVarint64(){return this.readVarint(!0)}readSVarint(){let t=this.readVarint();return t%2===1?(t+1)/-2:t/2}readBoolean(){return!!this.readVarint()}readString(){let t=this.readVarint()+this.pos,r=this.pos;return this.pos=t,t-r>=bae&&$L?$L.decode(this.buf.subarray(r,t)):Pae(this.buf,r,t)}readBytes(){let t=this.readVarint()+this.pos,r=this.buf.subarray(this.pos,t);return this.pos=t,r}readPackedVarint(t=[],r){let n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readVarint(r));return t}readPackedSVarint(t=[]){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readFloat());return t}readPackedDouble(t=[]){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){let r=this.readPackedEnd();for(;this.pos<r;)t.push(this.readSFixed64());return t}readPackedEnd(){return this.type===W9?this.readVarint()+this.pos:this.pos+1}skip(t){let r=t&7;if(r===qx)for(;this.buf[this.pos++]>127;);else if(r===W9)this.pos=this.readVarint()+this.pos;else if(r===Fp)this.pos+=4;else if(r===Pp)this.pos+=8;else throw new Error(`Unimplemented type: ${r}`)}writeTag(t,r){this.writeVarint(t<<3|r)}realloc(t){let r=this.length||16;for(;r<this.pos+t;)r*=2;if(r!==this.length){let n=new Uint8Array(r);n.set(this.buf),this.buf=n,this.dataView=new DataView(n.buffer),this.length=r}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*VL),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,t&-1,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*VL),!0),this.pos+=8}writeVarint(t){if(t=+t||0,t>268435455||t<0){xae(t,this);return}this.realloc(4),this.buf[this.pos++]=t&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=(t>>>=7)&127|(t>127?128:0),!(t<=127)&&(this.buf[this.pos++]=t>>>7&127)))}writeSVarint(t){this.writeVarint(t<0?-t*2-1:t*2)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(t.length*4),this.pos++;let r=this.pos;this.pos=Fae(this.buf,t,this.pos);let n=this.pos-r;n>=128&&GL(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){let r=t.length;this.writeVarint(r),this.realloc(r);for(let n=0;n<r;n++)this.buf[this.pos++]=t[n]}writeRawMessage(t,r){this.pos++;let n=this.pos;t(r,this);let i=this.pos-n;i>=128&&GL(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i}writeMessage(t,r,n){this.writeTag(t,W9),this.writeRawMessage(r,n)}writePackedVarint(t,r){r.length&&this.writeMessage(t,Eae,r)}writePackedSVarint(t,r){r.length&&this.writeMessage(t,Aae,r)}writePackedBoolean(t,r){r.length&&this.writeMessage(t,Iae,r)}writePackedFloat(t,r){r.length&&this.writeMessage(t,Sae,r)}writePackedDouble(t,r){r.length&&this.writeMessage(t,Cae,r)}writePackedFixed32(t,r){r.length&&this.writeMessage(t,Mae,r)}writePackedSFixed32(t,r){r.length&&this.writeMessage(t,Tae,r)}writePackedFixed64(t,r){r.length&&this.writeMessage(t,Nae,r)}writePackedSFixed64(t,r){r.length&&this.writeMessage(t,Dae,r)}writeBytesField(t,r){this.writeTag(t,W9),this.writeBytes(r)}writeFixed32Field(t,r){this.writeTag(t,Fp),this.writeFixed32(r)}writeSFixed32Field(t,r){this.writeTag(t,Fp),this.writeSFixed32(r)}writeFixed64Field(t,r){this.writeTag(t,Pp),this.writeFixed64(r)}writeSFixed64Field(t,r){this.writeTag(t,Pp),this.writeSFixed64(r)}writeVarintField(t,r){this.writeTag(t,qx),this.writeVarint(r)}writeSVarintField(t,r){this.writeTag(t,qx),this.writeSVarint(r)}writeStringField(t,r){this.writeTag(t,W9),this.writeString(r)}writeFloatField(t,r){this.writeTag(t,Fp),this.writeFloat(r)}writeDoubleField(t,r){this.writeTag(t,Pp),this.writeDouble(r)}writeBooleanField(t,r){this.writeVarintField(t,+r)}}});function Q1(e,t){this.x=e,this.y=t}var WL=q(()=>{Q1.prototype={clone(){return new Q1(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},unit(){return this.clone()._unit()},perp(){return this.clone()._perp()},round(){return this.clone()._round()},mag(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){let t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){let t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){let e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){let t=Math.cos(e),r=Math.sin(e),n=t*this.x-r*this.y,i=r*this.x+t*this.y;return this.x=n,this.y=i,this},_rotateAround(e,t){let r=Math.cos(e),n=Math.sin(e),i=t.x+r*(this.x-t.x)-n*(this.y-t.y),a=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=i,this.y=a,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:Q1};Q1.convert=function(e){if(e instanceof Q1)return e;if(Array.isArray(e))return new Q1(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new Q1(+e.x,+e.y);throw new Error("Expected [x, y] or {x, y} point format")}});function Oae(e,t,r){e===1?t.id=r.readVarint():e===2?Rae(r,t):e===3?t.type=r.readVarint():e===4&&(t._geometry=r.pos)}function Rae(e,t){let r=e.readVarint()+e.pos;for(;e.pos<r;){let n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}function Lae(e){let t=e.length;if(t<=1)return[e];let r=[],n,i;for(let a=0;a<t;a++){let o=Uae(e[a]);o!==0&&(i===void 0&&(i=o<0),i===o<0?(n&&r.push(n),n=[e[a]]):n&&n.push(e[a]))}return n&&r.push(n),r}function Uae(e){let t=0;for(let r=0,n=e.length,i=n-1,a,o;r<n;i=r++)a=e[r],o=e[i],t+=(o.x-a.x)*(a.y+o.y);return t}function Bae(e,t,r){e===15?t.version=r.readVarint():e===1?t.name=r.readString():e===5?t.extent=r.readVarint():e===2?t._features.push(r.pos):e===3?t._keys.push(r.readString()):e===4&&t._values.push(zae(r))}function zae(e){let t=null,r=e.readVarint()+e.pos;for(;e.pos<r;){let n=e.readVarint()>>3;t=n===1?e.readString():n===2?e.readFloat():n===3?e.readDouble():n===4?e.readVarint64():n===5?e.readVarint():n===6?e.readSVarint():n===7?e.readBoolean():null}return t}function qae(e,t,r){if(e===3){let n=new Vx(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}var Op,Vx,s1,H9=q(()=>{WL();Op=class{constructor(t,r,n,i,a){this.properties={},this.extent=n,this.type=0,this.id=void 0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=a,t.readFields(Oae,this,r)}loadGeometry(){let t=this._pbf;t.pos=this._geometry;let r=t.readVarint()+t.pos,n=[],i,a=1,o=0,s=0,l=0;for(;t.pos<r;){if(o<=0){let u=t.readVarint();a=u&7,o=u>>3}if(o--,a===1||a===2)s+=t.readSVarint(),l+=t.readSVarint(),a===1&&(i&&n.push(i),i=[]),i&&i.push(new Q1(s,l));else if(a===7)i&&i.push(i[0].clone());else throw new Error(`unknown command ${a}`)}return i&&n.push(i),n}bbox(){let t=this._pbf;t.pos=this._geometry;let r=t.readVarint()+t.pos,n=1,i=0,a=0,o=0,s=1/0,l=-1/0,u=1/0,c=-1/0;for(;t.pos<r;){if(i<=0){let f=t.readVarint();n=f&7,i=f>>3}if(i--,n===1||n===2)a+=t.readSVarint(),o+=t.readSVarint(),a<s&&(s=a),a>l&&(l=a),o<u&&(u=o),o>c&&(c=o);else if(n!==7)throw new Error(`unknown command ${n}`)}return[s,u,l,c]}toGeoJSON(t,r,n){let i=this.extent*Math.pow(2,n),a=this.extent*t,o=this.extent*r,s=this.loadGeometry();function l(d){return[(d.x+a)*360/i-180,360/Math.PI*Math.atan(Math.exp((1-(d.y+o)*2/i)*Math.PI))-90]}function u(d){return d.map(l)}let c;if(this.type===1){let d=[];for(let h of s)d.push(h[0]);let m=u(d);c=d.length===1?{type:"Point",coordinates:m[0]}:{type:"MultiPoint",coordinates:m}}else if(this.type===2){let d=s.map(u);c=d.length===1?{type:"LineString",coordinates:d[0]}:{type:"MultiLineString",coordinates:d}}else if(this.type===3){let d=Lae(s),m=[];for(let h of d)m.push(h.map(u));c=m.length===1?{type:"Polygon",coordinates:m[0]}:{type:"MultiPolygon",coordinates:m}}else throw new Error("unknown feature type");let f={type:"Feature",geometry:c,properties:this.properties};return this.id!=null&&(f.id=this.id),f}};Op.types=["Unknown","Point","LineString","Polygon"];Vx=class{constructor(t,r){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Bae,this,r),this.length=this._features.length}feature(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];let r=this._pbf.readVarint()+this._pbf.pos;return new Op(this._pbf,r,this.extent,this._keys,this._values)}};s1=class{constructor(t,r){this.layers=t.readFields(qae,{},r)}}});var jL={};j(jL,{default:()=>Y9});function Qx(e,t,r,n){mr().zoomExtent([Hae,r]).skipNullIsland(!0).getTiles(n).forEach(function(o){jae(e,t,o)})}function jae(e,t,r){let n=Dn.requests,i=`${r.id}-${e}`;if(n.loaded[i]||n.inflight[i])return;let a=new AbortController;n.inflight[i]=a;let o=t.replace("{x}",r.xyz[0]).replace("{y}",r.xyz[1]).replace("{z}",r.xyz[2]);fetch(o,{signal:a.signal}).then(function(s){if(!s.ok)throw new Error(s.status+" "+s.statusText);return n.loaded[i]=!0,delete n.inflight[i],s.arrayBuffer()}).then(function(s){if(!s)throw new Error("No Data");Yae(s,r,e),e==="images"?zs.call("loadedImages"):e==="signs"?zs.call("loadedSigns"):e==="points"&&zs.call("loadedMapFeatures")}).catch(function(){n.loaded[i]=!0,delete n.inflight[i]})}function Yae(e,t,r){let n=new s1(new ko(e)),i,a,o,s,l,u,c;if(n.layers.hasOwnProperty("image")){for(i=[],a=Dn.images,o=n.layers.image,s=0;s<o.length;s++)l=o.feature(s).toGeoJSON(t.xyz[0],t.xyz[1],t.xyz[2]),u=l.geometry.coordinates,c={loc:u,captured_at:l.properties.captured_at,ca:l.properties.compass_angle,id:l.properties.id,is_pano:l.properties.is_pano,sequence_id:l.properties.sequence_id},a.forImageId[c.id]=c,i.push({minX:u[0],minY:u[1],maxX:u[0],maxY:u[1],data:c});a.rtree&&a.rtree.load(i)}if(n.layers.hasOwnProperty("sequence"))for(i=[],a=Dn.sequences,o=n.layers.sequence,s=0;s<o.length;s++)l=o.feature(s).toGeoJSON(t.xyz[0],t.xyz[1],t.xyz[2]),a.lineString[l.properties.id]?a.lineString[l.properties.id].push(l):a.lineString[l.properties.id]=[l];if(n.layers.hasOwnProperty("point")){for(i=[],a=Dn[r],o=n.layers.point,s=0;s<o.length;s++)l=o.feature(s).toGeoJSON(t.xyz[0],t.xyz[1],t.xyz[2]),u=l.geometry.coordinates,c={loc:u,id:l.properties.id,first_seen_at:l.properties.first_seen_at,last_seen_at:l.properties.last_seen_at,value:l.properties.value},i.push({minX:u[0],minY:u[1],maxX:u[0],maxY:u[1],data:c});a.rtree&&a.rtree.load(i)}if(n.layers.hasOwnProperty("traffic_sign")){for(i=[],a=Dn[r],o=n.layers.traffic_sign,s=0;s<o.length;s++)l=o.feature(s).toGeoJSON(t.xyz[0],t.xyz[1],t.xyz[2]),u=l.geometry.coordinates,c={loc:u,id:l.properties.id,first_seen_at:l.properties.first_seen_at,last_seen_at:l.properties.last_seen_at,value:l.properties.value},i.push({minX:u[0],minY:u[1],maxX:u[0],maxY:u[1],data:c});a.rtree&&a.rtree.load(i)}}function HL(e){return fetch(e).then(function(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.json()}).then(function(t){return t?t.data||[]:[]})}function Kae(e){let t=Yt(e.scale()),r=Math.ceil(t*2)/2+2.5;return mr().zoomExtent([r,r]).getTiles(e).map(function(i){return i.extent})}function Hx(e,t,r){return e=e||5,Kae(t).reduce(function(n,i){let a=r.search(i.bbox()).slice(0,e).map(function(o){return o.data});return a.length?n.concat(a):n},[])}var r5,QL,jx,Vae,$ae,Gae,Wae,Qae,Hae,zs,j9,z2,Dn,Rp,$x,Lp,Up,Jn,Gx,Wx,Y9,Yx=q(()=>{"use strict";Ye();Ae();Q9();Fa();H9();He();Ie();r5="MLY|4100327730013843|5bb78b81720791946a9a7b956c57b7cf",QL="https://graph.mapillary.com/",jx="https://tiles.mapillary.com/maps/vtp",Vae=`${jx}/mly_map_feature_point/2/{z}/{x}/{y}?access_token=${r5}`,$ae=`${jx}/mly1_public/2/{z}/{x}/{y}?access_token=${r5}`,Gae=`${jx}/mly_map_feature_traffic_sign/2/{z}/{x}/{y}?access_token=${r5}`,Wae="mapillary-js/mapillary.css",Qae="mapillary-js/mapillary.js",Hae=14,zs=xe("change","loadedImages","loadedSigns","loadedMapFeatures","bearingChanged","imageChanged"),Rp=!1,Lp=!1,Up=!1,Gx=["all"],Wx=!1;Y9={init:function(){Dn||this.reset(),this.event=_e(this,zs,"on")},reset:function(){Dn&&Object.values(Dn.requests.inflight).forEach(function(e){e.abort()}),Dn={images:{rtree:new zt,forImageId:{}},image_detections:{forImageId:{}},signs:{rtree:new zt},points:{rtree:new zt},sequences:{rtree:new zt,lineString:{}},requests:{loaded:{},inflight:{}}},z2=null},images:function(e){return Hx(5,e,Dn.images.rtree)},signs:function(e){return Hx(5,e,Dn.signs.rtree)},mapFeatures:function(e){return Hx(5,e,Dn.points.rtree)},cachedImage:function(e){return Dn.images.forImageId[e]},sequences:function(e){let t=e.clipExtent(),r=[t[0][0],t[1][1]],n=[t[1][0],t[0][1]],i=Me(e.invert(r),e.invert(n)).bbox(),a={},o=[];return Dn.images.rtree.search(i).forEach(function(s){s.data.sequence_id&&(a[s.data.sequence_id]=!0)}),Object.keys(a).forEach(function(s){Dn.sequences.lineString[s]&&(o=o.concat(Dn.sequences.lineString[s]))}),o},loadImages:function(e){Qx("images",$ae,14,e)},loadSigns:function(e){Qx("signs",Gae,14,e)},loadMapFeatures:function(e){Qx("points",Vae,14,e)},ensureViewerLoaded:function(e){if(j9)return j9;e.container().select(".photoviewer").selectAll(".mly-wrapper").data([0]).enter().append("div").attr("id","ideditor-mly").attr("class","photo-wrapper mly-wrapper").classed("hide",!0);let r=this;return j9=new Promise((n,i)=>{let a=0;function o(){a+=1,a===2&&n()}let s=Q("head");s.selectAll("#ideditor-mapillary-viewercss").data([0]).enter().append("link").attr("id","ideditor-mapillary-viewercss").attr("rel","stylesheet").attr("crossorigin","anonymous").attr("href",e.asset(Wae)).on("load.serviceMapillary",o).on("error.serviceMapillary",function(){i()}),s.selectAll("#ideditor-mapillary-viewerjs").data([0]).enter().append("script").attr("id","ideditor-mapillary-viewerjs").attr("crossorigin","anonymous").attr("src",e.asset(Qae)).on("load.serviceMapillary",o).on("error.serviceMapillary",function(){i()})}).catch(function(){j9=null}).then(function(){r.initViewer(e)}),j9},loadSignResources:function(e){return e.ui().svgDefs.addSprites(["mapillary-sprite"],!1),this},loadObjectResources:function(e){return e.ui().svgDefs.addSprites(["mapillary-object-sprite"],!1),this},resetTags:function(){Jn&&!Rp&&Jn.getComponent("tag").removeAll()},showFeatureDetections:function(e){Lp=e,!Lp&&!Up&&this.resetTags()},showSignDetections:function(e){Up=e,!Lp&&!Up&&this.resetTags()},filterViewer:function(e){let t=e.photos().showsPanoramic(),r=e.photos().showsFlat(),n=e.photos().fromDate(),i=e.photos().toDate(),a=["all"];return t||a.push(["!=","cameraType","spherical"]),!r&&t&&a.push(["==","pano",!0]),n&&a.push([">=","capturedAt",new Date(n).getTime()]),i&&a.push([">=","capturedAt",new Date(i).getTime()]),Jn&&Jn.setFilter(a),Gx=a,a},showViewer:function(e){let t=e.container().select(".photoviewer").classed("hide",!1);return t.selectAll(".photo-wrapper.mly-wrapper.hide").size()&&Jn&&(t.selectAll(".photo-wrapper:not(.mly-wrapper)").classed("hide",!0),t.selectAll(".photo-wrapper.mly-wrapper").classed("hide",!1),Jn.resize()),Wx=!0,this},hideViewer:function(e){z2=null,!Rp&&Jn&&Jn.getComponent("sequence").stop();let t=e.container().select(".photoviewer");return t.empty()||t.datum(null),t.classed("hide",!0).selectAll(".photo-wrapper").classed("hide",!0),this.updateUrlImage(null),zs.call("imageChanged"),zs.call("loadedMapFeatures"),zs.call("loadedSigns"),Wx=!1,this.setStyles(e,null)},isViewerOpen:function(){return Wx},updateUrlImage:function(e){if(!window.mocha){let t=Ft(window.location.hash);e?t.photo="mapillary/"+e:delete t.photo,window.location.replace("#"+at(t,!0))}},highlightDetection:function(e){return e&&($x=e.id),this},initViewer:function(e){let t=this;if(!window.mapillary)return;let r={accessToken:r5,component:{cover:!1,keyboard:!1,tag:!0},container:"ideditor-mly"};!mapillary.isSupported()&&mapillary.isFallbackSupported()&&(Rp=!0,r.component={cover:!1,direction:!1,imagePlane:!1,keyboard:!1,mouse:!1,sequence:!1,tag:!1,image:!0,navigation:!0}),Jn=new mapillary.Viewer(r),Jn.on("image",n),Jn.on("bearing",i),Gx&&Jn.setFilter(Gx),e.ui().photoviewer.on("resize.mapillary",function(){Jn&&Jn.resize()});function n(a){t.resetTags();let o=a.image;t.setActiveImage(o),t.setStyles(e,null);let s=[o.originalLngLat.lng,o.originalLngLat.lat];e.map().centerEase(s),t.updateUrlImage(o.id),(Lp||Up)&&t.updateDetections(o.id,`${QL}/${o.id}/detections?access_token=${r5}&fields=id,image,geometry,value`),zs.call("imageChanged")}function i(a){zs.call("bearingChanged",void 0,a)}},selectImage:function(e,t){return Jn&&t&&Jn.moveTo(t).catch(function(r){console.error("mly3",r)}),this},getActiveImage:function(){return z2},getDetections:function(e){return HL(`${QL}/${e}/detections?access_token=${r5}&fields=id,value,image`)},setActiveImage:function(e){e?z2={ca:e.originalCompassAngle,id:e.id,loc:[e.originalLngLat.lng,e.originalLngLat.lat],is_pano:e.cameraType==="spherical",sequence_id:e.sequenceId}:z2=null},setStyles:function(e,t){let r=t&&t.id,n=t&&t.sequence_id,i=z2&&z2.sequence_id;return e.container().selectAll(".layer-mapillary .viewfield-group").classed("highlighted",function(a){return a.sequence_id===i||a.id===r}).classed("hovered",function(a){return a.id===r}),e.container().selectAll(".layer-mapillary .sequence").classed("highlighted",function(a){return a.properties.id===n}).classed("currentView",function(a){return a.properties.id===i}),this},updateDetections:function(e,t){if(!Jn||Rp||!e)return;let r=Dn.image_detections;r.forImageId[e]?n(Dn.image_detections.forImageId[e]):HL(t).then(a=>{a.forEach(function(o){r.forImageId[e]||(r.forImageId[e]=[]),r.forImageId[e].push({geometry:o.geometry,id:o.id,image_id:e,value:o.value})}),n(Dn.image_detections.forImageId[e]||[])});function n(a){let o=Jn.getComponent("tag");a.forEach(function(s){let l=i(s);l&&o.add([l])})}function i(a){let o=a.value.split("--");if(!o.length)return;let s,l,u=16777215;$x===a.id&&(u=16776960,l=o[1],(l==="flat"||l==="discrete"||l==="sign")&&(l=o[2]),l=l.replace(/-/g," "),l=l.charAt(0).toUpperCase()+l.slice(1),$x=null);for(var c=window.atob(a.geometry),f=new Uint8Array(c.length),d=0;d<c.length;d++)f[d]=c.charCodeAt(d);let h=new s1(new ko(f.buffer)).layers["mpy-or"],A=h.feature(0).loadGeometry().map(v=>v.map(_=>[_.x/h.extent,_.y/h.extent]));return s=new mapillary.OutlineTag(a.id,new mapillary.PolygonGeometry(A[0]),{text:l,textColor:u,lineColor:u,lineWidth:2,fillColor:u,fillOpacity:.3}),s}},cache:function(){return Dn}}});var YL={};j(YL,{validationIssue:()=>xt,validationIssueFix:()=>ut});function xt(e){this.type=e.type,this.subtype=e.subtype,this.severity=e.severity,this.message=e.message,this.reference=e.reference,this.entityIds=e.entityIds,this.loc=e.loc,this.data=e.data,this.dynamicFixes=e.dynamicFixes,this.hash=e.hash,this.id=t.apply(this),this.key=r.apply(this),this.autoFix=null;function t(){var n=[this.type];if(this.hash&&n.push(this.hash),this.subtype&&n.push(this.subtype),this.entityIds){var i=this.entityIds.slice().sort();n.push.apply(n,i)}return n.join(":")}function r(){return this.id+":"+Date.now().toString()}this.extent=function(n){return this.loc?Me(this.loc):this.entityIds&&this.entityIds.length?this.entityIds.reduce(function(i,a){return i.extend(n.entity(a).extent(n))},Me()):null},this.fixes=function(n){var i=this.dynamicFixes?this.dynamicFixes(n):[],a=this;return a.severity==="warning"&&i.push(new ut({title:T.append("issues.fix.ignore_issue.title"),icon:"iD-icon-close",onClick:function(){n.validator().ignoreIssue(this.issue.id)}})),i.forEach(function(o){o.id=o.title.stringId,o.issue=a,o.autoArgs&&(a.autoFix=o)}),i}}function ut(e){this.title=e.title,this.onClick=e.onClick,this.disabledReason=e.disabledReason,this.icon=e.icon,this.entityIds=e.entityIds||[],this.autoArgs=e.autoArgs,this.issue=null}var Kx=q(()=>{"use strict";He();ue()});var KL={};j(KL,{validationIssue:()=>xt,validationIssueFix:()=>ut});var Pn=q(()=>{"use strict";Kx()});var XL={};j(XL,{default:()=>K9});var Xae,Zae,K9,Xx=q(()=>{"use strict";Dr();Ie();Pn();Xae=function(){return{equals:function(e){return function(t){return Object.keys(e).every(function(r){return e[r]===t[r]})}},notEquals:function(e){return function(t){return Object.keys(e).some(function(r){return e[r]!==t[r]})}},absence:function(e){return function(t){return Object.keys(t).indexOf(e)===-1}},presence:function(e){return function(t){return Object.keys(t).indexOf(e)>-1}},greaterThan:function(e){var t=Object.keys(e)[0],r=e[t];return function(n){return n[t]>r}},greaterThanEqual:function(e){var t=Object.keys(e)[0],r=e[t];return function(n){return n[t]>=r}},lessThan:function(e){var t=Object.keys(e)[0],r=e[t];return function(n){return n[t]<r}},lessThanEqual:function(e){var t=Object.keys(e)[0],r=e[t];return function(n){return n[t]<=r}},positiveRegex:function(e){var t=Object.keys(e)[0],r=e[t].join("|"),n=new RegExp(r);return function(i){return n.test(i[t])}},negativeRegex:function(e){var t=Object.keys(e)[0],r=e[t].join("|"),n=new RegExp(r);return function(i){return!n.test(i[t])}}}},Zae=function(){return{highway:{rest_area:!0,services:!0},railway:{roundhouse:!0,station:!0,traverser:!0,turntable:!0,wash:!0}}},K9={init:function(){this._ruleChecks=Xae(),this._validationRules=[],this._areaKeys=Ho,this._lineKeys=Zae()},filterRuleChecks:function(e){var t=this._ruleChecks;return Object.keys(e).reduce(function(r,n){return["geometry","error","warning"].indexOf(n)===-1&&r.push(t[n](e[n])),r},[])},buildTagMap:function(e){var t=function(n){return n.map(function(i){return i.replace(/\$|\^/g,"")})},r=Object.keys(e).reduce(function(n,i){var a,o=/regex/gi.test(i),s=/equals/gi.test(i);if(o||s)Object.keys(e[i]).forEach(function(u){a=s?[e[i][u]]:t(e[i][u]),n.hasOwnProperty(u)&&(a=a.concat(n[u])),n[u]=a});else if(/(greater|less)Than(Equal)?|presence/g.test(i)){var l=/presence/.test(i)?e[i]:Object.keys(e[i])[0];a=[e[i][l]],n.hasOwnProperty(l)&&(a=a.concat(n[l])),n[l]=a}return n},{});return r},inferGeometry:function(e){var t=this._lineKeys,r=this._areaKeys,n=function(o){return Cr(e[o],Object.keys(r[o])).length>0},i=function(o){return Cr(e[o],Object.keys(t[o])).length>0};if(e.hasOwnProperty("area")){if(e.area.indexOf("yes")>-1)return"area";if(e.area.indexOf("no")>-1)return"line"}for(var a in e)if(a in r&&!n(a)||a in t&&i(a))return"area";return"line"},addRule:function(e){var t={checks:this.filterRuleChecks(e),matches:function(r){return this.checks.every(function(n){return n(r.tags)})},inferredGeometry:this.inferGeometry(this.buildTagMap(e),this._areaKeys),geometryMatches:function(r,n){if(r.type==="node"||r.type==="relation")return e.geometry===r.type;if(r.type==="way")return this.inferredGeometry===r.geometry(n)},findIssues:function(r,n,i){if(this.geometryMatches(r,n)&&this.matches(r)){var a=Object.keys(e).indexOf("error")>-1?"error":"warning",o=e[a];i.push(new xt({type:"maprules",severity:a,message:function(){return o},entityIds:[r.id]}))}}};this._validationRules.push(t)},clearRules:function(){this._validationRules=[]},validationRules:function(){return this._validationRules},ruleChecks:function(){return this._ruleChecks}}});var ZL={};j(ZL,{coreDifference:()=>Eo});function Eo(e,t){var r={},n={},i={};function a(s){var l=t.entities[s],u=e.entities[s];if(l!==u&&!r[s]){if(!l&&u){r[s]={base:u,head:l},n.deletion=!0;return}if(l&&!u){r[s]={base:u,head:l},n.addition=!0;return}if(l&&u){if(l.members&&u.members&&!(0,n5.default)(l.members,u.members)){r[s]={base:u,head:l},n.geometry=!0,n.properties=!0;return}l.loc&&u.loc&&!zr(l.loc,u.loc)&&(r[s]={base:u,head:l},n.geometry=!0),l.nodes&&u.nodes&&!(0,n5.default)(l.nodes,u.nodes)&&(r[s]={base:u,head:l},n.geometry=!0),l.tags&&u.tags&&!(0,n5.default)(l.tags,u.tags)&&(r[s]={base:u,head:l},n.properties=!0)}}}function o(){for(var s=Je(Object.keys(t.entities).concat(Object.keys(e.entities))),l=0;l<s.length;l++)a(s[l])}return o(),i.length=function(){return Object.keys(r).length},i.changes=function(){return r},i.didChange=n,i.extantIDs=function(l){var u=new Set;return Object.keys(r).forEach(function(c){r[c].head&&u.add(c);var f=r[c].head,d=r[c].base,m=f||d;if(l&&m.type==="relation"){var h=f?f.members.map(function(A){return A.id}):[],g=d?d.members.map(function(A){return A.id}):[];Ht(h,g).forEach(function(A){t.hasEntity(A)&&u.add(A)})}}),Array.from(u)},i.modified=function(){var l=[];return Object.values(r).forEach(function(u){u.base&&u.head&&l.push(u.head)}),l},i.created=function(){var l=[];return Object.values(r).forEach(function(u){!u.base&&u.head&&l.push(u.head)}),l},i.deleted=function(){var l=[];return Object.values(r).forEach(function(u){u.base&&!u.head&&l.push(u.base)}),l},i.summary=function(){for(var l={},u=Object.keys(r),c=0;c<u.length;c++){var f=r[u[c]];if(f.head&&f.head.geometry(t)!=="vertex")h(f.head,t,f.base?"modified":"created");else if(f.base&&f.base.geometry(e)!=="vertex")h(f.base,e,"deleted");else if(f.base&&f.head){var d=!(0,n5.default)(f.base.loc,f.head.loc),m=!(0,n5.default)(f.base.tags,f.head.tags);d&&g(f.head),(m||d&&f.head.hasInterestingTags())&&h(f.head,t,"modified")}else f.head&&f.head.hasInterestingTags()?h(f.head,t,"created"):f.base&&f.base.hasInterestingTags()&&h(f.base,e,"deleted")}return Object.values(l);function h(A,v,_){l[A.id]={entity:A,graph:v,changeType:_}}function g(A){for(var v=t.parentWays(A),_=v.length-1;_>=0;_--){var w=v[_];w.id in l||h(w,t,"modified")}}},i.complete=function(l){var u={},c,f;for(c in r){f=r[c];var d=f.head,m=f.base,h=d||m,g;if(!(l&&(!d||!d.intersects(l,t))&&(!m||!m.intersects(l,e)))){if(u[c]=d,h.type==="way"){var A=d?d.nodes:[],v=m?m.nodes:[],_;for(_=yr(A,v),g=0;g<_.length;g++)u[_[g]]=t.hasEntity(_[g]);for(_=yr(v,A),g=0;g<_.length;g++)u[_[g]]=t.hasEntity(_[g])}if(h.type==="relation"&&h.isMultipolygon()){var w=d?d.members.map(function(b){return b.id}):[],k=m?m.members.map(function(b){return b.id}):[],x=Ht(w,k);for(g=0;g<x.length;g++){var S=t.hasEntity(x[g]);S&&(l&&!S.intersects(l,t)||(u[x[g]]=S))}}I(t.parentWays(h),u),I(t.parentRelations(h),u)}}return u;function I(b,y){for(var E=0;E<b.length;E++){var M=b[E];M.id in y||(y[M.id]=M,I(t.parentRelations(M),y))}}},i}var n5,i5=q(()=>{"use strict";n5=or(go(),1);He();Mr()});var JL={};j(JL,{coreTree:()=>a5});function a5(e){var t=new zt,r={},n=new zt,i={},a={},o={};function s(m){var h=m.extent(e).bbox();return h.id=m.id,r[m.id]=h,h}function l(m){var h=m.extent(e);if(!h)return null;var g=h.bbox();return g.segment=m,i[m.id]=g,g}function u(m){t.remove(r[m.id]),delete r[m.id],a[m.id]&&(a[m.id].forEach(function(h){n.remove(i[h.id]),delete i[h.id]}),delete a[m.id])}function c(m){t.load(m.map(s));var h=[];m.forEach(function(g){if(g.segments){var A=g.segments(e);a[g.id]=A,h=h.concat(A)}}),h.length&&n.load(h.map(l).filter(Boolean))}function f(m,h,g){e.parentWays(m).forEach(function(A){r[A.id]&&(u(A),h[A.id]=A),f(A,h,g)}),e.parentRelations(m).forEach(function(A){g[A.id]||(g[A.id]=!0,r[A.id]&&(u(A),h[A.id]=A),f(A,h,g))})}o.rebase=function(m,h){for(var g={},A=0;A<m.length;A++){var v=m[A];if(v.visible){if(e.entities.hasOwnProperty(v.id)||r[v.id])if(h)r[v.id]&&u(v);else continue;g[v.id]=v,f(v,g,{})}}return c(Object.values(g)),o};function d(m){if(m!==e){var h=Eo(e,m);e=m;var g=h.didChange;if(!(!g.addition&&!g.deletion&&!g.geometry)){var A={};g.deletion&&h.deleted().forEach(function(v){u(v)}),g.geometry&&h.modified().forEach(function(v){u(v),A[v.id]=v,f(v,A,{})}),g.addition&&h.created().forEach(function(v){A[v.id]=v}),c(Object.values(A))}}}return o.intersects=function(m,h){return d(h),t.search(m.bbox()).map(function(g){return h.entity(g.id)})},o.waySegments=function(m,h){return d(h),n.search(m.bbox()).map(function(g){return g.segment})},o}var Bp=q(()=>{"use strict";Fa();i5()});var eU={};j(eU,{svgIcon:()=>ce});function ce(e,t,r){return function(i){i.selectAll("svg.icon"+(t?"."+t.split(" ")[0]:"")).data([0]).enter().append("svg").attr("class","icon "+(t||"")).append("use").attr("xlink:href",e).attr("class",r)}}var ot=q(()=>{"use strict"});var tU={};j(tU,{uiModal:()=>ci});function ci(e,t){let r=Xe("modal"),n=e.select("div.modal"),i=n.empty();n.transition().duration(200).style("opacity",0).remove();let a=e.append("div").attr("class","shaded").style("opacity",0);a.close=()=>{a.transition().duration(200).style("opacity",0).remove(),o.transition().duration(200).style("top","0px"),Q(document).call(r.unbind)};let o=a.append("div").attr("class","modal fillL");return o.append("input").attr("class","keytrap keytrap-first").on("focus.keytrap",l),t||(a.on("click.remove-modal",u=>{u.target===this&&a.close()}),o.append("button").attr("class","close").attr("title",T("icons.close")).on("click",a.close).call(ce("#iD-icon-close")),r.on("\u232B",a.close).on("\u238B",a.close),Q(document).call(r)),o.append("div").attr("class","content"),o.append("input").attr("class","keytrap keytrap-last").on("focus.keytrap",s),i?a.transition().style("opacity",1):a.style("opacity",1),a;function s(){let u=o.select("a, button, input:not(.keytrap), select, textarea").node();u?u.focus():Q(this).node().blur()}function l(){let u=o.selectAll("a, button, input:not(.keytrap), select, textarea").nodes();u.length?u[u.length-1].focus():Q(this).node().blur()}}var qs=q(()=>{"use strict";Ae();ue();ot();Ie()});var rU={};j(rU,{uiLoading:()=>l1});function l1(e){let t=Q(null),r="",n=!1,i=a=>{t=ci(a,n);let o=t.select(".content").classed("loading-modal",!0).append("div").attr("class","modal-section fillL");return o.append("img").attr("class","loader").attr("src",e.imagePath("loader-white.gif")),o.append("h3").html(r),t.select("button.close").attr("class","hide"),i};return i.message=function(a){return arguments.length?(r=a,i):r},i.blocking=function(a){return arguments.length?(n=a,i):n},i.close=()=>{t.remove()},i.isShown=()=>t&&!t.empty()&&t.node().parentNode,i}var o5=q(()=>{"use strict";Ae();qs()});var nU={};j(nU,{coreHistory:()=>s5});function s5(e){var t=xe("reset","change","merge","restore","undone","redone","storage_error"),r=i3("lock"),n=r.lock()&&!!ke(v("saved_history")),i=150,a=[],o=[],s={},l,u,c,f;function d(w,k){w=Array.prototype.slice.call(w);var x;typeof w[w.length-1]!="function"&&(x=w.pop());for(var S=u[c].graph,I=0;I<w.length;I++)S=w[I](S,k);return{graph:S,annotation:x,imageryUsed:a,photoOverlaysUsed:o,transform:e.projection.transform(),selectedIDs:e.selectedIDs()}}function m(w,k){var x=u[c].graph;u=u.slice(0,c+1);var S=d(w,k);return u.push(S),c++,A(x)}function h(w,k){var x=u[c].graph,S=d(w,k);return u[c]=S,A(x)}function g(w,k){var x=u[c].graph;c>0&&(c--,u.pop()),u=u.slice(0,c+1);var S=d(w,k);return u.push(S),c++,A(x)}function A(w){var k=Eo(w,_.graph());return l||t.call("change",this,k),k}function v(w){return"iD_"+window.location.origin+"_"+w}var _={graph:function(){return u[c].graph},tree:function(){return f},base:function(){return u[0].graph},merge:function(w){var k=u.map(function(x){return x.graph});u[0].graph.rebase(w,k,!1),f.rebase(w,!1),t.call("merge",this,w)},perform:function(){Q(document).interrupt("history.perform");var w=!1,k=arguments[0];if((arguments.length===1||arguments.length===2&&typeof arguments[1]!="function")&&(w=!!k.transitionable),w){var x=arguments;Q(document).transition("history.perform").duration(i).ease(L7).tween("history.tween",function(){return function(S){S<1&&g([k],S)}}).on("start",function(){m([k],0)}).on("end interrupt",function(){g(x,1)})}else return m(arguments)},replace:function(){return Q(document).interrupt("history.perform"),h(arguments,1)},overwrite:function(){return Q(document).interrupt("history.perform"),g(arguments,1)},pop:function(w){Q(document).interrupt("history.perform");var k=u[c].graph;for((isNaN(+w)||+w<0)&&(w=1);w-- >0&&c>0;)c--,u.pop();return A(k)},undo:function(){Q(document).interrupt("history.perform");for(var w=u[c],k=w.graph;c>0&&(c--,!u[c].annotation););return t.call("undone",this,u[c],w),A(k)},redo:function(){Q(document).interrupt("history.perform");for(var w=u[c],k=w.graph,x=c;x<u.length-1;)if(x++,u[x].annotation){c=x,t.call("redone",this,u[c],w);break}return A(k)},pauseChangeDispatch:function(){l||(l=u[c].graph)},resumeChangeDispatch:function(){if(l){var w=l;return l=null,A(w)}},undoAnnotation:function(){for(var w=c;w>=0;){if(u[w].annotation)return u[w].annotation;w--}},redoAnnotation:function(){for(var w=c+1;w<=u.length-1;){if(u[w].annotation)return u[w].annotation;w++}},intersects:function(w){return f.intersects(w,u[c].graph)},difference:function(){var w=u[0].graph,k=u[c].graph;return Eo(w,k)},changes:function(w){var k=u[0].graph,x=u[c].graph;w&&(x=w(x));var S=Eo(k,x);return{modified:S.modified(),created:S.created(),deleted:S.deleted()}},hasChanges:function(){return this.difference().length()>0},imageryUsed:function(w){if(w)return a=w,_;var k=new Set;return u.slice(1,c+1).forEach(function(x){x.imageryUsed.forEach(function(S){S!=="Custom"&&k.add(S)})}),Array.from(k)},photoOverlaysUsed:function(w){if(w)return o=w,_;var k=new Set;return u.slice(1,c+1).forEach(function(x){x.photoOverlaysUsed&&Array.isArray(x.photoOverlaysUsed)&&x.photoOverlaysUsed.forEach(function(S){k.add(S)})}),Array.from(k)},checkpoint:function(w){return s[w]={stack:u,index:c},_},reset:function(w){return w!==void 0&&s.hasOwnProperty(w)?(u=s[w].stack,c=s[w].index):(u=[{graph:kn()}],c=0,f=a5(u[0].graph),s={}),t.call("reset"),t.call("change"),_},toIntroGraph:function(){var w={n:0,r:0,w:0},k={},x=this.graph(),S={};return Object.values(x.base().entities).forEach(function(b){var y=I(b);S[y.id]=y}),Object.keys(x.entities).forEach(function(b){var y=x.entities[b];if(y){var E=I(y);S[E.id]=E}else delete S[b]}),Object.values(S).forEach(function(b){Array.isArray(b.nodes)&&(b.nodes=b.nodes.map(function(y){return k[y]||y})),Array.isArray(b.members)&&(b.members=b.members.map(function(y){return y.id=k[y.id]||y.id,y}))}),JSON.stringify({dataIntroGraph:S});function I(b){var y=Tn(b,["type","user","v","version","visible"]);y.tags&&!Object.keys(y.tags)&&delete y.tags,Array.isArray(y.loc)&&(y.loc[0]=+y.loc[0].toFixed(6),y.loc[1]=+y.loc[1].toFixed(6));var E=b.id.match(/([nrw])-\d*/);if(E!==null){var M=E[1],F;do F=M+ ++w[M];while(S.hasOwnProperty(F));y.id=k[b.id]=F}return y}},toJSON:function(){if(this.hasChanges()){var w={},k={},x=u[0],S=u.map(function(I){var b=[],y=[];Object.keys(I.graph.entities).forEach(function(M){var F=I.graph.entities[M];if(F){var N=Le.key(F);w[N]=F,b.push(N)}else y.push(M);M in x.graph.entities&&(k[M]=x.graph.entities[M]),F&&F.nodes&&F.nodes.forEach(function(O){O in x.graph.entities&&(k[O]=x.graph.entities[O])});var D=x.graph._parentWays[M];D&&D.forEach(function(O){O in x.graph.entities&&(k[O]=x.graph.entities[O])})});var E={};return b.length&&(E.modified=b),y.length&&(E.deleted=y),I.imageryUsed&&(E.imageryUsed=I.imageryUsed),I.photoOverlaysUsed&&(E.photoOverlaysUsed=I.photoOverlaysUsed),I.annotation&&(E.annotation=I.annotation),I.transform&&(E.transform=I.transform),I.selectedIDs&&(E.selectedIDs=I.selectedIDs),E});return JSON.stringify({version:3,entities:Object.values(w),baseEntities:Object.values(k),stack:S,nextIDs:Le.id.next,index:c,timestamp:new Date().getTime()})}},fromJSON:function(w,k){var x=JSON.parse(w),S=!0;if(Le.id.next=x.nextIDs,c=x.index,x.version===2||x.version===3){var I={};if(x.entities.forEach(function(P){I[Le.key(P)]=Le(P)}),x.version===3){var b=x.baseEntities.map(function(P){return Le(P)}),y=u.map(function(P){return P.graph});if(u[0].graph.rebase(b,y,!0),f.rebase(b,!0),k){var E=e.connection(),M=b.filter(function(P){return P.type==="way"}),F=M.reduce(function(P,U){return Ht(P,U.nodes)},[]),N=F.filter(function(P){return!u[0].graph.hasEntity(P)});if(N.length&&E){S=!1,e.map().redrawEnable(!1);var D=l1(e).blocking(!0);e.container().call(D);var O=function(P,U){if(!P){var B=pr(U.data,"visible"),z=B.true||[],V=B.false||[];if(z.length){var G=z.map(function(Y){return Y.id}),W=u.map(function(Y){return Y.graph});N=yr(N,G),u[0].graph.rebase(z,W,!0),f.rebase(z,!0)}V.forEach(function(Y){E.loadEntityVersion(Y.id,+Y.version-1,O)})}(P||!N.length)&&(D.close(),e.map().redrawEnable(!0),t.call("change"),t.call("restore",this))};E.loadMultiple(N,O)}}}u=x.stack.map(function(P){var U={},B;return P.modified&&P.modified.forEach(function(z){B=I[z],U[B.id]=B}),P.deleted&&P.deleted.forEach(function(z){U[z]=void 0}),{graph:kn(u[0].graph).load(U),annotation:P.annotation,imageryUsed:P.imageryUsed,photoOverlaysUsed:P.photoOverlaysUsed,transform:P.transform,selectedIDs:P.selectedIDs}})}else u=x.stack.map(function(P){var U={};for(var B in P.entities){var z=P.entities[B];U[B]=z==="undefined"?void 0:Le(z)}return P.graph=kn(u[0].graph).load(U),P});var L=u[c].transform;return L&&e.map().transformEase(L,0),S&&(t.call("change"),t.call("restore",this)),_},lock:function(){return r.lock()},unlock:function(){r.unlock()},save:function(){return r.locked()&&!n&&(ke(v("saved_history"),_.toJSON()||null)||t.call("storage_error")),_},clearSaved:function(){return e.debouncedSave.cancel(),r.locked()&&(n=!1,ke(v("saved_history"),null),ke("comment",null),ke("hashtags",null),ke("source",null)),_},savedHistoryJSON:function(){return ke(v("saved_history"))},hasRestorableChanges:function(){return n},restore:function(){if(r.locked()){n=!1;var w=this.savedHistoryJSON();w&&_.fromJSON(w,!0)}},_getKey:v};return _.reset(),_e(_,t,"on")}var zp=q(()=>{"use strict";Ye();U7();Ae();fr();i5();G4();Bp();t1();o5();Ie()});var iU={};j(iU,{utilDisplayLabel:()=>yt});function yt(e,t,r){var n,i=hr(e),a=typeof t=="string"?Pe.matchTags(e.tags,t):Pe.match(e,t),o=a&&(a.suggestion?a.subtitle():a.name());return r?n=[o,i].filter(Boolean).join(" "):n=i||o,n||li(e.id)}var qn=q(()=>{"use strict";At();dt()});var aU={};j(aU,{validationAlmostJunction:()=>qp});function qp(e){let t="almost_junction",a=Math.atan(.15);function o(u){return u.type==="way"&&aa[u.tags.highway]}function s(u){return u.tags.noexit==="yes"||u.tags.amenity==="parking_entrance"||u.tags.entrance&&u.tags.entrance!=="no"}let l=function(c,f){if(!o(c))return[];if(c.isDegenerate())return[];let d=e.history().tree(),m=_(c),h=[];return m.forEach(b=>{h.push(new xt({type:t,subtype:"highway-highway",severity:"warning",message:function(y){let E=y.hasEntity(this.entityIds[0]);if(this.entityIds[0]===this.entityIds[2])return E?T.append("issues.almost_junction.self.message",{feature:yt(E,y.graph())}):"";{let M=y.hasEntity(this.entityIds[2]);return E&&M?T.append("issues.almost_junction.message",{feature:yt(E,y.graph()),feature2:yt(M,y.graph())}):""}},reference:A,entityIds:[c.id,b.node.id,b.wid],loc:b.node.loc,hash:JSON.stringify(b.node.loc),data:{midId:b.mid.id,edge:b.edge,cross_loc:b.cross_loc},dynamicFixes:g}))}),h;function g(b){let y=[new ut({icon:"iD-icon-abutment",title:T.append("issues.fix.connect_features.title"),onClick:function(M){let F=T("issues.fix.connect_almost_junction.annotation"),[,N,D]=this.issue.entityIds,O=M.entity(this.issue.data.midId),L=M.entity(N),P=M.entity(D),U=w(L,P);if(U.length>0){let W=k(O,L,U);if(W){M.perform(zi([W.id,L.id],W.loc),F);return}}let B=this.issue.data.edge,z=this.issue.data.cross_loc,V=[M.entity(B[0]),M.entity(B[1])],G=x4(V,z);G.distance<.75?M.perform(zi([G.node.id,L.id],G.node.loc),F):M.perform(Gr({loc:z,edge:B},L),F)}})],E=b.hasEntity(this.entityIds[1]);return E&&!E.hasInterestingTags()&&y.push(new ut({icon:"maki-barrier",title:T.append("issues.fix.tag_as_disconnected.title"),onClick:function(M){let F=this.issue.entityIds[1],N=Object.assign({},M.entity(F).tags);N.noexit="yes",M.perform(tr(F,N),T("issues.fix.tag_as_disconnected.annotation"))}})),y}function A(b){b.selectAll(".issue-reference").data([0]).enter().append("div").attr("class","issue-reference").call(T.append("issues.almost_junction.highway-highway.reference"))}function v(b,y){let E=de.osm;if(E&&!E.isDataLoaded(b.loc)||s(b)||f.parentWays(b).length!==1)return!1;let M=0;for(let F in y.nodes)if(y.nodes[F]===b.id&&(M+=1,M>1))return!1;return!0}function _(b){let y=[];if(b.isClosed())return y;let E;return[0,b.nodes.length-1].forEach(F=>{let N=b.nodes[F],D=f.entity(N);if(!v(D,b))return;let O=I(b,F);O&&(E=f.childNodes(b).slice(),E[F]=E[F].move(O.cross_loc),!ta(E,N)&&y.push(O))}),y}function w(b,y){return[y.nodes[0],y.nodes[y.nodes.length-1]].map(E=>f.entity(E)).filter(E=>E.id!==b.id&&wt(b.loc,E.loc)<=4.25)}function k(b,y,E){let M,F=1/0;return E.forEach(N=>{let D=fn(b,y,e.projection)+Math.PI,O=fn(b,N,e.projection)+Math.PI,L=Math.max(D,O)-Math.min(D,O);L<F&&(M=N,F=L)}),F<=a?M:null}function x(b,y){return b[y]!==void 0&&b[y]!=="no"}function S(b,y){if(b.id===y.id)return!0;if((x(b.tags,"bridge")||x(y.tags,"bridge"))&&!(x(b.tags,"bridge")&&x(y.tags,"bridge"))||(x(b.tags,"tunnel")||x(y.tags,"tunnel"))&&!(x(b.tags,"tunnel")&&x(y.tags,"tunnel")))return!1;let E=b.tags.layer||"0",M=y.tags.layer||"0";if(E!==M)return!1;let F=b.tags.level||"0",N=y.tags.level||"0";return F===N}function I(b,y){let E=b.nodes[y],M=y===0?b.nodes[1]:b.nodes[b.nodes.length-2],F=f.entity(E),N=f.entity(M),D=F.loc[0],O=F.loc[1],L=xn(5,O)/2,P=Ln(5)/2,U=Me([[D-L,O-P],[D+L,O+P]]),z=5/wt(N.loc,F.loc)+1,V=Qt(N.loc,F.loc,z),G=d.waySegments(U,f);for(let W=0;W<G.length;W++){let Y=G[W],J=f.entity(Y.wayId);if(!o(J)||!S(b,J))continue;let oe=Y.nodes[0],Ce=Y.nodes[1];if(oe===E||Ce===E)continue;let se=f.entity(oe),ne=f.entity(Ce),he=ra([F.loc,V],[se.loc,ne.loc]);if(he)return{mid:N,node:F,wid:J.id,edge:[se.id,ne.id],cross_loc:he}}return null}};return l.type=t,l}var Zx=q(()=>{"use strict";He();Jo();Bi();$4();ue();qn();Dr();Pn();pt()});var oU={};j(oU,{validationCloseNodes:()=>Vp});function Vp(e){var t="close_nodes",r=.2,n=function(i,a){if(i.type==="node")return o(i);if(i.type==="way")return u(i);return[];function o(h){var g=a.parentWays(h);return g.length?c(h,g):d(h)}function s(h){if(h.tags.boundary&&h.tags.boundary!=="no")return"boundary";if(h.tags.indoor&&h.tags.indoor!=="no")return"indoor";if(h.tags.building&&h.tags.building!=="no"||h.tags["building:part"]&&h.tags["building:part"]!=="no")return"building";if(uo[h.tags.highway])return"path";var g=a.parentRelations(h);for(var A in g){var v=g[A];if(v.tags.type==="boundary")return"boundary";if(v.isMultipolygon()){if(v.tags.indoor&&v.tags.indoor!=="no")return"indoor";if(v.tags.building&&v.tags.building!=="no"||v.tags["building:part"]&&v.tags["building:part"]!=="no")return"building"}}return"other"}function l(h){if(h.nodes.length<=2||h.isClosed()&&h.nodes.length<=4)return!1;var g=h.extent(a).bbox(),A=wt([g.minX,g.minY],[g.maxX,g.maxY]);return!(A<1.5)}function u(h){if(!l(h))return[];for(var g=[],A=a.childNodes(h),v=0;v<A.length-1;v++){var _=A[v],w=A[v+1],k=m(_,w,h);k&&g.push(k)}return g}function c(h,g){var A=[];function v(S,I,b){var y=m(S,I,b);y&&A.push(y)}for(var _=0;_<g.length;_++){var w=g[_];if(l(w))for(var k=w.nodes.length-1,x=0;x<w.nodes.length;x++)x!==0&&w.nodes[x-1]===h.id&&v(h,a.entity(w.nodes[x]),w),x!==k&&w.nodes[x+1]===h.id&&v(a.entity(w.nodes[x]),h,w)}return A}function f(h){if(!l(h))return 0;var g=s(h);return g==="boundary"?0:g==="indoor"?.01:g==="building"?.05:g==="path"?.1:.2}function d(h){for(var g=[],A=h.loc[0],v=h.loc[1],_=xn(r,v)/2,w=Ln(r)/2,k=Me([[A-_,v-w],[A+_,v+w]]),x=e.history().tree().intersects(k,a),S=0;S<x.length;S++){var I=x[S];if(I.id!==h.id&&!(I.type!=="node"||I.geometry(a)!=="point")&&(I.loc===h.loc||wt(h.loc,I.loc)<r)){if("memorial:type"in h.tags&&"memorial:type"in I.tags&&h.tags["memorial:type"]==="stolperstein"&&I.tags["memorial:type"]==="stolperstein"||"memorial"in h.tags&&"memorial"in I.tags&&h.tags.memorial==="stolperstein"&&I.tags.memorial==="stolperstein")continue;var b={layer:!0,level:!0,"addr:housenumber":!0,"addr:unit":!0},y=!1;for(var E in b){var M=h.tags[E]||"0",F=I.tags[E]||"0";if(M!==F){y=!0;break}}if(y)continue;g.push(new xt({type:t,subtype:"detached",severity:"warning",message:function(D){var O=D.hasEntity(this.entityIds[0]),L=D.hasEntity(this.entityIds[1]);return O&&L?T.append("issues.close_nodes.detached.message",{feature:yt(O,D.graph()),feature2:yt(L,D.graph())}):""},reference:N,entityIds:[h.id,I.id],dynamicFixes:function(){return[new ut({icon:"iD-operation-disconnect",title:T.append("issues.fix.move_points_apart.title")}),new ut({icon:"iD-icon-layers",title:T.append("issues.fix.use_different_layers_or_levels.title")})]}}))}}return g;function N(D){var O=T("issues.close_nodes.detached.reference");D.selectAll(".issue-reference").data([0]).enter().append("div").attr("class","issue-reference").html(O)}}function m(h,g,A){if(h.id===g.id||h.hasInterestingTags()&&g.hasInterestingTags())return null;if(h.loc!==g.loc){var v=a.parentWays(h),_=new Set(a.parentWays(g)),w=v.filter(function(b){return _.has(b)}),k=w.map(function(b){return f(b)}),x=Math.min(...k),S=wt(h.loc,g.loc);if(S>x)return null}return new xt({type:t,subtype:"vertices",severity:"warning",message:function(b){var y=b.hasEntity(this.entityIds[0]);return y?T.append("issues.close_nodes.message",{way:yt(y,b.graph())}):""},reference:I,entityIds:[A.id,h.id,g.id],loc:h.loc,dynamicFixes:function(){return[new ut({icon:"iD-icon-plus",title:T.append("issues.fix.merge_points.title"),onClick:function(b){var y=this.issue.entityIds,E=zi([y[1],y[2]]);b.perform(E,T("issues.fix.merge_close_vertices.annotation"))}}),new ut({icon:"iD-operation-disconnect",title:T.append("issues.fix.move_points_apart.title")})]}});function I(b){var y=T("issues.close_nodes.reference");b.selectAll(".issue-reference").data([0]).enter().append("div").attr("class","issue-reference").html(y)}}};return n.type=t,n}var Jx=q(()=>{"use strict";$4();qn();ue();Pn();Dr();yi();w1()});var lU={};j(lU,{validationCrossingWays:()=>$p});function $p(e){var t="crossing_ways";function r(w,k){if(l(w,k)===null)for(var x=k.parentRelations(w),S=0;S<x.length;S++){var I=x[S];if(l(I,k)!==null)return I}return w}function n(w,k){return w[k]!==void 0&&w[k]!=="no"}function i(w){return n(w,"indoor")||n(w,"level")||w.highway==="corridor"}function a(w){return w==="highway"||w==="railway"||w==="waterway"||w==="aeroway"}function o(w){return w==="highway"||w==="railway"||w==="waterway"}var s={demolished:!0,dismantled:!0,proposed:!0,razed:!0};function l(w,k){var x=w.geometry(k);if(x!=="line"&&x!=="area")return null;var S=w.tags;return S.aeroway in Qb?"aeroway":n(S,"building")&&!s[S.building]?"building":n(S,"highway")&&aa[S.highway]?"highway":x!=="line"?null:n(S,"railway")&&t3[S.railway]?"railway":n(S,"waterway")&&F4[S.waterway]?"waterway":null}function u(w,k,x,S){var I=w.level||"0",b=x.level||"0";if(i(w)&&i(x)&&I!==b)return!0;var y=w.layer||"0",E=x.layer||"0";if(a(k)&&a(S)){if(n(w,"bridge")&&!n(x,"bridge")||!n(w,"bridge")&&n(x,"bridge")||n(w,"bridge")&&n(x,"bridge")&&y!==E)return!0}else{if(a(k)&&n(w,"bridge"))return!0;if(a(S)&&n(x,"bridge"))return!0}if(o(k)&&o(S)){if(n(w,"tunnel")&&!n(x,"tunnel")||!n(w,"tunnel")&&n(x,"tunnel")||n(w,"tunnel")&&n(x,"tunnel")&&y!==E)return!0}else{if(o(k)&&n(w,"tunnel"))return!0;if(o(S)&&n(x,"tunnel"))return!0}return!!(k==="waterway"&&S==="highway"&&x.man_made==="pier"||S==="waterway"&&k==="highway"&&w.man_made==="pier"||(k==="building"||S==="building"||i(w)||i(x))&&y!==E)}var c={motorway:!0,motorway_link:!0,trunk:!0,trunk_link:!0,primary:!0,primary_link:!0,secondary:!0,secondary_link:!0};function f(w,k,x,S){var I=l(w,x),b=l(k,x),y=w.geometry(x),E=k.geometry(x),M=y==="line"&&E==="line";let F=[I,b].sort().join("-");if(F==="aeroway-aeroway")return{};if(F==="aeroway-highway"){let B=w.tags.highway==="service"||k.tags.highway==="service",z=w.tags.highway in uo||k.tags.highway in uo;return B||z?{}:{aeroway:"aircraft_crossing"}}if(F==="aeroway-railway")return{aeroway:"aircraft_crossing",railway:"level_crossing"};if(F==="aeroway-waterway")return null;if(I===b){if(I==="highway"){var N=uo[w.tags.highway],D=uo[k.tags.highway];if((N||D)&&N!==D){if(!M)return{};var O=N?k:w,L=N?w:k;if(O.tags.highway==="track")return{};if(!S&&O.tags.highway==="service"&&L.tags.highway==="footway"&&L.tags.footway==="sidewalk")return{};if(["marked","unmarked","traffic_signals","uncontrolled"].indexOf(L.tags.crossing)!==-1){var P={highway:"crossing",crossing:L.tags.crossing};return"crossing:markings"in L.tags&&(P["crossing:markings"]=L.tags["crossing:markings"]),P}return M?{highway:"crossing"}:{}}return{}}if(I==="waterway")return{};if(I==="railway")return{}}else if(F.indexOf("highway")!==-1){if(F.indexOf("railway")!==-1){if(!M)return{};var U=w.tags.railway==="tram"||k.tags.railway==="tram";return uo[w.tags.highway]||uo[k.tags.highway]?U?{railway:"tram_crossing"}:{railway:"crossing"}:U?{railway:"tram_level_crossing"}:{railway:"level_crossing"}}if(F.indexOf("waterway")!==-1)return n(w.tags,"tunnel")&&n(k.tags,"tunnel")||n(w.tags,"bridge")&&n(k.tags,"bridge")||c[w.tags.highway]||c[k.tags.highway]?null:M?{ford:"yes"}:{}}return null}function d(w,k,x){var S=[];if(w.type!=="way")return S;var I=r(w,k),b=l(I,k);if(b===null)return S;var y={},E,M,F,N,D,O,L,P,U,B,z,V,G,W,Y,J,oe,Ce=k.childNodes(w),se={};for(E=0;E<Ce.length-1;E++)for(N=Ce[E],D=Ce[E+1],F=Me([[Math.min(N.loc[0],D.loc[0]),Math.min(N.loc[1],D.loc[1])],[Math.max(N.loc[0],D.loc[0]),Math.max(N.loc[1],D.loc[1])]]),G=x.waySegments(F,k),M=0;M<G.length;M++)if(W=G[M],W.wayId!==w.id&&!y[W.wayId]&&(se[W.wayId]=!0,Y=k.hasEntity(W.wayId),!!Y&&(J=r(Y,k),oe=l(J,k),!(oe===null||u(I.tags,b,J.tags,oe))&&(V=b==="building"||oe==="building",P=W.nodes[0],U=W.nodes[1],!(P===N.id||P===D.id||U===N.id||U===D.id)&&(O=k.hasEntity(P),!!O&&(L=k.hasEntity(U),!!L)))))){B=[N.loc,D.loc],z=[O.loc,L.loc];var ne=ra(B,z);if(ne&&(S.push({wayInfos:[{way:w,featureType:b,edge:[N.id,D.id]},{way:Y,featureType:oe,edge:[O.id,L.id]}],crossPoint:ne}),V)){y[Y.id]=!0;break}}return S}function m(w,k){var x=l(w,k);return x?w.type==="way"?[w]:w.type==="relation"?w.members.reduce(function(S,I){if(I.type==="way"&&(!I.role||I.role==="outer"||I.role==="inner")){var b=k.hasEntity(I.id);b&&S.indexOf(b)===-1&&S.push(b)}return S},[]):[]:[]}var h=function(k,x){var S=e.history().tree(),I=m(k,x),b=[],y,E,M;for(y in I){M=d(I[y],x,S);for(E in M)b.push(g(M[E],x))}return b};function g(w,k){w.wayInfos.sort(function(U,B){var z=U.featureType,V=B.featureType;return z===V?yt(U.way,k)>yt(B.way,k):z==="waterway"?!0:V==="waterway"?!1:z<V});var x=w.wayInfos.map(function(U){return r(U.way,k)}),S=[w.wayInfos[0].edge,w.wayInfos[1].edge],I=[w.wayInfos[0].featureType,w.wayInfos[1].featureType],b=f(x[0],x[1],k),y=w.wayInfos[0].featureType,E=w.wayInfos[1].featureType,M=i(x[0].tags)&&i(x[1].tags),F=o(y)&&n(x[0].tags,"tunnel")&&o(E)&&n(x[1].tags,"tunnel"),N=a(y)&&n(x[0].tags,"bridge")&&a(E)&&n(x[1].tags,"bridge"),D=[y,E].sort().join("-"),O=D;M?O="indoor-indoor":F?O="tunnel-tunnel":N&&(O="bridge-bridge"),b&&(M||F||N)&&(O+="_connectable");var L=w.crossPoint[0].toFixed(4)+","+w.crossPoint[1].toFixed(4);return new xt({type:t,subtype:D,severity:"warning",message:function(U){var B=U.graph(),z=B.hasEntity(this.entityIds[0]),V=B.hasEntity(this.entityIds[1]);return z&&V?T.append("issues.crossing_ways.message",{feature:yt(z,B),feature2:yt(V,B)}):""},reference:P,entityIds:x.map(function(U){return U.id}),data:{edges:S,featureTypes:I,connectionTags:b},hash:L,loc:w.crossPoint,dynamicFixes:function(U){var B=U.mode();if(!B||B.id!=="select"||B.selectedIDs().length!==1)return[];var z=this.entityIds[0]===B.selectedIDs()[0]?0:1,V=this.data.featureTypes[z],G=this.data.featureTypes[z===0?1:0],W=[];if(b){W.push(v(this.data.connectionTags));let J=f(x[0],x[1],k,!0);J&&!(0,sU.isEqual)(b,J)&&W.push(v(J))}if(M)W.push(new ut({icon:"iD-icon-layers",title:T.append("issues.fix.use_different_levels.title")}));else if(F||N||y==="building"||E==="building")W.push(_("higher")),W.push(_("lower"));else if(U.graph().geometry(this.entityIds[0])==="line"&&U.graph().geometry(this.entityIds[1])==="line"){a(V)&&V!=="waterway"&&W.push(A("add_a_bridge","temaki-bridge","bridge"));var Y=G==="waterway"&&V!=="waterway";o(V)&&!Y&&(V==="waterway"?W.push(A("add_a_culvert","temaki-waste","tunnel")):W.push(A("add_a_tunnel","temaki-tunnel","tunnel")))}return W.push(new ut({icon:"iD-operation-move",title:T.append("issues.fix.reposition_features.title")})),W}});function P(U){U.selectAll(".issue-reference").data([0]).enter().append("div").attr("class","issue-reference").call(T.append("issues.crossing_ways."+O+".reference"))}}function A(w,k,x){return new ut({icon:k,title:T.append("issues.fix."+w+".title"),onClick:function(S){var I=S.mode();if(!(!I||I.id!=="select")){var b=I.selectedIDs();if(b.length===1){var y=b[0];if(S.hasEntity(y)){var E=[y],M,F,N;this.issue.entityIds[0]===y?(M=this.issue.data.edges[0],F=this.issue.data.edges[1],N=this.issue.entityIds[1]):(M=this.issue.data.edges[1],F=this.issue.data.edges[0],N=this.issue.entityIds[0]);var D=this.issue.loc,O=S.projection,L=function(U){var B=[U.entity(M[0]),U.entity(M[1])],z=U.hasEntity(N),V=z&&isFinite(z.tags.width)&&Number(z.tags.width);V||(V=z&&z.impliedLineWidthMeters()),V?l(z,U)==="railway"&&(V*=2):V=8;var G=fn(B[0],B[1],O)+Math.PI,W=fn(U.entity(F[0]),U.entity(F[1]),O)+Math.PI,Y=Math.max(G,W)-Math.min(G,W);Y>Math.PI&&(Y-=Math.PI),V=V/2/Math.sin(Y)*2,V+=4,V=Math.min(Math.max(V,4),50);function J(be){return[vs(be[0],be[1]),i2(be[1])]}function oe(be){var Te=Ln(be[1]);return[xn(be[0],Te),Te]}var Ce=J(B[0].loc),se=J(B[1].loc),ne=no(Ce,se),he=J(D),Se=ft(Ce,se)/wt(B[0].loc,B[1].loc);function re(be,Te){var Oe=Te*Se;return oe([he[0]+Math.cos(be)*Oe,he[1]+Math.sin(be)*Oe])}var Z=function(be){return re(ne,be)},te=function(be){return re(ne+Math.PI,be)},ye=.55;function we(be,Te,Oe){var Ve,Qe=V/2,ct=wt(D,Te.loc);if(ct-Qe>ye){var rt=Oe(Qe);Ve=Nt(),U=Gr({loc:rt,edge:be},Ve)(U)}else{var We=0;if(Te.parentIntersectionWays(U).forEach(function(_t){_t.nodes.forEach(function(wr){wr===Te.id&&(Te.id===_t.first()&&Te.id!==_t.last()||Te.id===_t.last()&&Te.id!==_t.first()?We+=1:We+=2)})}),We>=3){var Rt=ct-ye;if(Rt>ye){var lt=Oe(Rt);Ve=Nt(),U=Gr({loc:lt,edge:be},Ve)(U)}}}Ve||(Ve=Te);var vt=n1([Ve.id]).limitWays(E);return U=vt(U),vt.getCreatedWayIDs().length&&E.push(vt.getCreatedWayIDs()[0]),Ve}var Ne=we(M,B[1],Z),Be=we([B[0].id,Ne.id],B[0],te),le=E.map(function(be){return U.entity(be)}).find(function(be){return be.nodes.indexOf(Ne.id)!==-1&&be.nodes.indexOf(Be.id)!==-1}),ie=Object.assign({},le.tags);if(x==="bridge")ie.bridge="yes",ie.layer="1";else{var ve="yes";l(le,U)==="waterway"&&(ve="culvert"),ie.tunnel=ve,ie.layer="-1"}return U=tr(le.id,ie)(U),U};S.perform(L,T("issues.fix."+w+".annotation")),S.enter(je(S,E))}}}}})}function v(w){var k="connect_features",x="iD-icon-crossing";w.highway==="crossing"&&(k="connect_using_crossing",x="temaki-pedestrian"),w.ford&&(k="connect_using_ford",x="roentgen-ford");let S=new ut({icon:x,title:T.append("issues.fix."+k+".title"),onClick:function(I){var b=this.issue.loc,y=this.issue.data.edges;I.perform(function(M){var F=Nt({loc:b,tags:w});M=M.replace(F);var N=[F.id],D=.75;return y.forEach(function(O){var L=[M.entity(O[0]),M.entity(O[1])],P=x4(L,b);(!P.node.hasInterestingTags()||P.node.isCrossing())&&P.distance<D?N.push(P.node.id):M=Gr({loc:b,edge:O},F)(M)}),N.length>1&&(M=zi(N,b)(M)),M},T("issues.fix.connect_crossing_features.annotation"))}});return S._connectionTags=w,S}function _(w){return new ut({icon:"iD-icon-"+(w==="higher"?"up":"down"),title:T.append("issues.fix.tag_this_as_"+w+".title"),onClick:function(k){var x=k.mode();if(!(!x||x.id!=="select")){var S=x.selectedIDs();if(S.length===1){var I=S[0];if(this.issue.entityIds.some(function(M){return M===I})){var b=k.hasEntity(I);if(b){var y=Object.assign({},b.tags),E=y.layer&&Number(y.layer);E&&!isNaN(E)?w==="higher"?E+=1:E-=1:w==="higher"?E=1:E=-1,y.layer=E.toString(),k.perform(tr(b.id,y),T("operations.change_tags.annotation"))}}}}}})}return h.type=t,h}var sU,e_=q(()=>{"use strict";sU=or(I3(),1);Jo();Bi();$4();_3();Er();He();e1();Dr();ue();qn();Pn()});var uU={};j(uU,{behaviorDrawWay:()=>ml});function ml(e,t,r,n){let i=Xe("drawWay");var a=xe("rejectedSelfIntersection"),o=_o(e),s,l,u,c,f,d=!1,m,h=!1;function g(D){m=Nt({loc:D}),e.pauseChangeDispatch(),e.replace(function(L){var P=L.entity(t);return L.replace(m).replace(P.addNode(m.id,s))},f),e.resumeChangeDispatch(),b()}function A(){e.pauseChangeDispatch(),e.replace(function(O){var L=O.entity(t);return O.replace(L.removeNode(m.id)).remove(m)},f),m=void 0,e.resumeChangeDispatch()}function v(D){D.keyCode===Xe.modifierCodes.alt&&(e.surface().classed("nope")&&e.surface().classed("nope-suppressed",!0),e.surface().classed("nope",!1).classed("nope-disabled",!0))}function _(D){D.keyCode===Xe.modifierCodes.alt&&(e.surface().classed("nope-suppressed")&&e.surface().classed("nope",!0),e.surface().classed("nope-suppressed",!1).classed("nope-disabled",!1))}function w(D){return D.geometry(e.graph())==="vertex"||Pe.allowsVertex(D,e.graph())}function k(D,O){var L=e.map().mouseCoordinates();m||g(L),e.surface().classed("nope-disabled",D.altKey);var P=O&&O.properties&&O.properties.entity&&w(O.properties.entity)&&O.properties.entity.loc,U=O&&O.properties&&O.properties.nodes;if(P)L=P;else if(U){var B=_n(U,e.map().mouse(),e.projection,m.id);B&&(L=B.loc)}e.replace(z1(m.id,L),f),m=e.entity(m.id),x(!0)}function x(D){var O=e.surface().classed("nope-disabled"),L=S(D);O?e.surface().classed("nope",!1).classed("nope-suppressed",L):e.surface().classed("nope",L).classed("nope-suppressed",!1)}function S(D){var O=m,L=e.graph().entity(t),P=e.graph().childNodes(L).slice();if(D)L.isClosed()&&P.pop();else if(L.isClosed()){if(P.length<3)return!1;m&&P.splice(-2,1),O=P[P.length-2]}else return!1;return O&&ta(P,O.id)}function I(){h=!0,e.pauseChangeDispatch();var D;e.graph()===n?D=je(e,[t]):(e.pop(1),D=r),e.perform(En()),e.pop(1),e.resumeChangeDispatch(),e.enter(D)}function b(){m&&e.surface().selectAll("."+m.id).classed("active",!0)}function y(){for(;e.graph()!==n;)e.pop()}var E=function(D){m=void 0,h=!1,l=e.entity(t),typeof s=="number"?c=l.nodes[s]:l.isClosed()?c=l.nodes[l.nodes.length-2]:c=l.nodes[l.nodes.length-1],u=l.geometry(e.graph()),f=T((l.nodes.length===(l.isClosed()?2:1)?"operations.start.annotation.":"operations.continue.annotation.")+u),d=!1,e.pauseChangeDispatch(),e.perform(En(),f),e.resumeChangeDispatch(),o.hover().initialNodeID(c),o.on("move",function(){d=!0,k.apply(this,arguments)}).on("down",function(){k.apply(this,arguments)}).on("downcancel",function(){m&&A()}).on("click",E.add).on("clickWay",E.addWay).on("clickNode",E.addNode).on("undo",e.undo).on("cancel",E.cancel).on("finish",E.finish),Q(window).on("keydown.drawWay",v).on("keyup.drawWay",_),e.map().dblclickZoomEnable(!1).on("drawn.draw",b),b(),D.call(o),e.history().on("undone.draw",I)};E.off=function(D){h||(e.pauseChangeDispatch(),y(),e.resumeChangeDispatch()),m=void 0,s=void 0,e.map().on("drawn.draw",null),D.call(o.off).selectAll(".active").classed("active",!1),D.classed("nope",!1).classed("nope-suppressed",!1).classed("nope-disabled",!1),Q(window).on("keydown.drawWay",null).on("keyup.drawWay",null),e.history().on("undone.draw",null)};function M(D,O,L){if(m?(e.replace(z1(m.id,O),f),m=e.entity(m.id)):g(O),x(!0),D&&D.properties&&D.properties.nope||e.surface().classed("nope")){d||A(),a.call("rejectedSelfIntersection",this);return}e.pauseChangeDispatch(),L(),h=!0,e.resumeChangeDispatch(),e.enter(r)}E.add=function(D,O){M(O,D,function(){})},E.addWay=function(D,O,L){M(L,D,function(){e.replace(Gr({loc:D,edge:O},m),f)})},E.addNode=function(D,O){if(D.id===c||l.isClosed()&&D.id===l.first()){E.finish();return}M(O,D.loc,function(){e.replace(function(P){return P=P.replace(P.entity(t).removeNode(m.id)).remove(m),P.replace(P.entity(t).addNode(D.id,s))},f)})};function F(D){return D.every(O=>O.isClosed())?"area":D.every(O=>!O.isClosed())?"line":"generic"}function N(){if(!h)try{let D=l.nodes[0]===l.nodes.slice(-1)[0],[O,L]=l.nodes.slice(D?-3:-2),P=e.history().graph();if(!L||!O||!P.hasEntity(L)||!P.hasEntity(O)){e.ui().flash.duration(4e3).iconName("#iD-icon-no").label(T.append("operations.follow.error.needs_more_initial_nodes"))();return}let U=P.parentWays(P.entity(L)).filter(Ce=>Ce.id!==t),B=P.parentWays(P.entity(O)).filter(Ce=>Ce.id!==t),z=F(U);if(U.length!==1||B.length===0){e.ui().flash.duration(4e3).iconName("#iD-icon-no").label(T.append(`operations.follow.error.intersection_of_multiple_ways.${z}`))();return}if(!B.some(Ce=>Ce.id===U[0].id)){e.ui().flash.duration(4e3).iconName("#iD-icon-no").label(T.append(`operations.follow.error.intersection_of_different_ways.${z}`))();return}let V=U[0],G=V.nodes.indexOf(L),W=V.nodes.indexOf(O),Y=G===V.nodes.length-2&&W===0,J=G+(G>W&&!Y?1:-1);J===-1&&(J=W===1?V.nodes.length-2:1);let oe=P.entity(V.nodes[J]);E.addNode(oe,{geometry:{type:"Point",coordinates:oe.loc},id:oe.id,properties:{target:!0,entity:oe}})}catch{e.ui().flash.duration(4e3).iconName("#iD-icon-no").label(T.append("operations.follow.error.unknown"))()}}return i.on(T("operations.follow.key"),N),Q(document).call(i),E.finish=function(){if(x(!1),e.surface().classed("nope")){a.call("rejectedSelfIntersection",this);return}e.pauseChangeDispatch(),e.pop(1),h=!0,e.resumeChangeDispatch();var D=e.hasEntity(t);if(!D||D.isDegenerate()){E.cancel();return}window.setTimeout(function(){e.map().dblclickZoomEnable(!0)},1e3);var O=!r.isContinuing;e.enter(je(e,[t]).newFeature(O))},E.cancel=function(){e.pauseChangeDispatch(),y(),e.resumeChangeDispatch(),window.setTimeout(function(){e.map().dblclickZoomEnable(!0)},1e3),e.surface().classed("nope",!1).classed("nope-disabled",!1).classed("nope-suppressed",!1),e.enter(Ue(e))},E.nodeIndex=function(D){return arguments.length?(s=D,E):s},E.activeID=function(){return arguments.length?E:m&&m.id},_e(E,a,"on")}var X9=q(()=>{"use strict";Ye();Ae();At();ue();Jo();e9();Ns();P2();He();Kt();Er();e1();Yr();Ie()});var cU={};j(cU,{modeDrawLine:()=>da});function da(e,t,r,n,i,a){var o={button:n,id:"draw-line"},s=ml(e,t,o,r).on("rejectedSelfIntersection.modeDrawLine",function(){e.ui().flash.iconName("#iD-icon-no").label(T.append("self_intersection.error.lines"))()});return o.wayID=t,o.isContinuing=a,o.enter=function(){s.nodeIndex(i==="prefix"?0:void 0),e.install(s)},o.exit=function(){e.uninstall(s)},o.selectedIDs=function(){return[t]},o.activeID=function(){return s&&s.activeID()||[]},o}var q2=q(()=>{"use strict";ue();X9()});var fU={};j(fU,{validationDisconnectedWay:()=>Gp});function Gp(){var e="disconnected_way";function t(n){return aa[n.tags.highway]}var r=function(i,a){var o=u(i);if(!o)return[];return[new xt({type:e,subtype:"highway",severity:"warning",message:function(h){var g=this.entityIds.length&&h.hasEntity(this.entityIds[0]),A=g&&yt(g,h.graph());return T.append("issues.disconnected_way.routable.message",{count:this.entityIds.length,highway:A})},reference:l,entityIds:Array.from(o).map(function(h){return h.id}),dynamicFixes:s})];function s(h){var g=[],A=this.entityIds.length===1&&h.hasEntity(this.entityIds[0]);if(A){if(A.type==="way"&&!A.isClosed()){var v=pe.textDirection(),_=m(v,A.first(),"start");_&&g.push(_);var w=m(v,A.last(),"end");w&&g.push(w)}g.length||g.push(new ut({title:T.append("issues.fix.connect_feature.title")})),g.push(new ut({icon:"iD-operation-delete",title:T.append("issues.fix.delete_feature.title"),entityIds:[A.id],onClick:function(k){var x=this.issue.entityIds[0],S=ui(k,[x]);S.disabled()||S()}}))}else g.push(new ut({title:T.append("issues.fix.connect_features.title")}));return g}function l(h){h.selectAll(".issue-reference").data([0]).enter().append("div").attr("class","issue-reference").call(T.append("issues.disconnected_way.routable.reference"))}function u(h){var g=new Set,A=[];function v(S){a.parentWays(S).forEach(function(I){!g.has(I)&&d(I,!1)&&(g.add(I),A.push(I))})}if(h.type==="way"&&d(h,!0))g.add(h),A.push(h);else if(h.type==="node"&&f(h))g.add(h),v(h);else return null;for(;A.length;){var _=A.pop(),w=a.childNodes(_);for(var k in w){var x=w[k];if(c(x))return null;f(x)&&g.add(x),v(x)}}return g}function c(h){var g=de.osm;return!!(g&&!g.isDataLoaded(h.loc)||h.tags.entrance&&h.tags.entrance!=="no"||h.tags.amenity==="parking_entrance")}function f(h){return h.tags.highway==="elevator"}function d(h,g){return t(h)||h.tags.route==="ferry"?!0:a.parentRelations(h).some(function(A){return!!(A.tags.type==="route"&&A.tags.route==="ferry"||A.isMultipolygon()&&t(A)&&(!g||A.memberById(h.id).role!=="inner"))})}function m(h,g,A){var v=a.hasEntity(g);if(!v||v.tags.noexit==="yes")return null;var _=A==="start"&&h==="ltr"||A==="end"&&h==="rtl";return new ut({icon:"iD-operation-continue"+(_?"-left":""),title:T.append("issues.fix.continue_from_"+A+".title"),entityIds:[g],onClick:function(w){var k=this.issue.entityIds[0],x=w.hasEntity(k),S=this.entityIds[0],I=w.hasEntity(S);if(!(!x||!I)){var b=w.map();(!w.editable()||!b.trimmedExtent().contains(I.loc))&&b.zoomToEase(I),w.enter(da(w,k,w.graph(),"line",x.affix(S),!0))}}})}};return r.type=e,r}var t_=q(()=>{"use strict";ue();q2();il();qn();Dr();Pn();pt()});var dU={};j(dU,{validationFormatting:()=>Wp});function Wp(){var e="invalid_format",t=function(r){var n=[];function i(s){var l=/^[^\(\)\\,":;<>@\[\]]+@[^\(\)\\,":;<>@\[\]\.]+(?:\.[a-z0-9-]+)*$/i;return!s||l.test(s)}function a(s){s.selectAll(".issue-reference").data([0]).enter().append("div").attr("class","issue-reference").call(T.append("issues.invalid_format.email.reference"))}if(r.tags.email){var o=r.tags.email.split(";").map(function(s){return s.trim()}).filter(function(s){return!i(s)});o.length&&n.push(new xt({type:e,subtype:"email",severity:"warning",message:function(s){var l=s.hasEntity(this.entityIds[0]);return l?T.append("issues.invalid_format.email.message"+this.data,{feature:yt(l,s.graph()),email:o.join(", ")}):""},reference:a,entityIds:[r.id],hash:o.join(),data:o.length>1?"_multi":""}))}return n};return t.type=e,t}var r_=q(()=>{"use strict";ue();qn();Pn()});var pU={};j(pU,{validationHelpRequest:()=>Qp});function Qp(e){var t="help_request",r=function(i){if(!i.tags.fixme)return[];if(i.version===void 0)return[];if(i.v!==void 0){var a=e.history().base().hasEntity(i.id);if(!a||!a.tags.fixme)return[]}return[new xt({type:t,subtype:"fixme_tag",severity:"warning",message:function(s){var l=s.hasEntity(this.entityIds[0]);return l?T.append("issues.fixme_tag.message",{feature:yt(l,s.graph(),!0)}):""},dynamicFixes:function(){return[new ut({title:T.append("issues.fix.address_the_concern.title")})]},reference:o,entityIds:[i.id]})];function o(s){s.selectAll(".issue-reference").data([0]).enter().append("div").attr("class","issue-reference").call(T.append("issues.fixme_tag.reference"))}};return r.type=t,r}var n_=q(()=>{"use strict";ue();qn();Pn()});var mU={};j(mU,{validationImpossibleOneway:()=>Hp});function Hp(){var e="impossible_oneway",t=function(i,a){if(i.type!=="way"||i.geometry(a)!=="line")return[];if(i.isClosed())return[];if(!l(i))return[];if(!i.isOneWay())return[];var o=f(i,i.first()),s=f(i,i.last());return o.concat(s);function l(d){return d.geometry(a)!=="line"?null:aa[d.tags.highway]?"highway":F4[d.tags.waterway]?"waterway":null}function u(d,m){var h=0;for(var g in d.nodes)if(d.nodes[g]===m&&(h+=1,h>1))return!0;return!1}function c(d,m){var h=l(d);if(h==="highway"){if(m.tags.entrance&&m.tags.entrance!=="no"||m.tags.amenity==="parking_entrance")return!0}else if(h==="waterway"){if(m.id===d.first()){if(m.tags.natural==="spring")return!0}else if(m.tags.manhole==="drain")return!0}return a.parentWays(m).some(function(g){return g.id===d.id?!1:h==="highway"?g.geometry(a)==="area"&&aa[g.tags.highway]||g.tags.route==="ferry"?!0:a.parentRelations(g).some(function(A){return A.tags.type==="route"&&A.tags.route==="ferry"?!0:A.isMultipolygon()&&aa[A.tags.highway]}):h==="waterway"&&(g.tags.natural==="water"||g.tags.natural==="coastline")})}function f(d,m){var h=m===d.first(),g=l(d);if(u(d,m))return[];var A=de.osm;if(!A)return[];var v=a.hasEntity(m);if(!v||!A.isDataLoaded(v.loc))return[];if(c(d,v))return[];var _=a.parentWays(v).filter(function(y){return y.id===d.id?!1:l(y)===g});if(g==="waterway"&&_.length===0)return[];var w=_.filter(function(y){return y.isOneWay()});if(w.length<_.length)return[];if(w.length){var k=w.some(function(y){return!!((h?y.first():y.last())!==m||u(y,m))});if(k)return[]}var x=h?"start":"end",S=g+".",I=g+".";return g==="waterway"?(S+="connected."+x,I+="connected"):(S+=x,I+=x),[new xt({type:e,subtype:g,severity:"warning",message:function(y){var E=y.hasEntity(this.entityIds[0]);return E?T.append("issues.impossible_oneway."+S+".message",{feature:yt(E,y.graph())}):""},reference:b(I),entityIds:[d.id,v.id],dynamicFixes:function(){var y=[];if(w.length&&y.push(new ut({icon:"iD-operation-reverse",title:T.append("issues.fix.reverse_feature.title"),entityIds:[d.id],onClick:function(F){var N=this.issue.entityIds[0];F.perform(Ji(N),T("operations.reverse.annotation.line",{n:1}))}})),v.tags.noexit!=="yes"){var E=pe.textDirection(),M=h&&E==="ltr"||!h&&E==="rtl";y.push(new ut({icon:"iD-operation-continue"+(M?"-left":""),title:T.append("issues.fix.continue_from_"+(h?"start":"end")+".title"),onClick:function(F){var N=this.issue.entityIds[0],D=this.issue.entityIds[1],O=F.entity(N),L=F.entity(D);r(O,L,F)}}))}return y},loc:v.loc})];function b(y){return function(M){M.selectAll(".issue-reference").data([0]).enter().append("div").attr("class","issue-reference").call(T.append("issues.impossible_oneway."+y+".reference"))}}}};function r(n,i,a){var o=a.map();(!a.editable()||!o.trimmedExtent().contains(i.loc))&&o.zoomToEase(i),a.enter(da(a,n.id,a.graph(),"line",n.affix(i.id),!0))}return t.type=e,t}var i_=q(()=>{"use strict";ue();q2();c4();qn();Dr();Pn();pt()});var hU={};j(hU,{validationIncompatibleSource:()=>jp});function jp(){let e="incompatible_source",t=[{id:"amap",regex:/(^amap$|^amap\.com|autonavi|mapabc|高德)/i},{id:"baidu",regex:/(baidu|mapbar|百度)/i},{id:"google",regex:/google/i,exceptRegex:/((books|drive)\.google|google\s?(books|drive|plus))|(esri\/Google_Africa_Buildings)/i}],r=function(i){let a=i.tags&&i.tags.source&&i.tags.source.split(";");if(!a)return[];let o=i.id;return a.map(l=>{let u=t.find(c=>!(!c.regex.test(l)||c.exceptRegex&&c.exceptRegex.test(l)));return u?new xt({type:e,severity:"warning",message:c=>{let f=c.hasEntity(o);return f?T.append("issues.incompatible_source.feature.message",{feature:yt(f,c.graph(),!0),value:l}):""},reference:s(u.id),entityIds:[o],hash:l,dynamicFixes:()=>[new ut({title:T.append("issues.fix.remove_proprietary_data.title")})]}):null}).filter(Boolean);function s(l){return function(c){c.selectAll(".issue-reference").data([0]).enter().append("div").attr("class","issue-reference").call(T.append(`issues.incompatible_source.reference.${l}`))}}};return r.type=e,r}var a_=q(()=>{"use strict";ue();qn();Pn()});var gU={};j(gU,{validationMaprules:()=>Yp});function Yp(){var e="maprules",t=function(n,i){if(!de.maprules)return[];for(var a=de.maprules.validationRules(),o=[],s=0;s<a.length;s++){var l=a[s];l.findIssues(n,i,o)}return o};return t.type=e,t}var o_=q(()=>{"use strict";pt()});var vU={};j(vU,{validationMismatchedGeometry:()=>Xp});function Xp(){var e="mismatched_geometry";function t(c){if(c.type!=="way"||c.isClosed())return null;var f=c.tagSuggestingArea();if(!f)return null;var d=Pe.matchTags(f,"line"),m=Pe.matchTags(f,"area");return d&&m&&(0,Kp.default)(d.tags,m.tags)||d.isFallback()&&m.isFallback()&&!(0,Kp.default)(f,{area:"yes"})?null:f}function r(c,f){if(c.nodes.length<3)return null;var d=f.childNodes(c),m,h=wt(d[0].loc,d[d.length-1].loc);if(h<.75&&(m=d.slice(),m.pop(),m.push(m[0]),!ta(m,m[0].id)))return function(g){var A=g.entity(this.issue.entityIds[0]);g.perform(zi([A.nodes[0],A.nodes[A.nodes.length-1]],d[0].loc),T("issues.fix.connect_endpoints.annotation"))};if(m=d.slice(),m.push(m[0]),!ta(m,m[0].id))return function(g){var A=this.issue.entityIds[0],v=g.entity(A),_=v.nodes[0],w=v.nodes.length;g.perform(oa(A,_,w),T("issues.fix.connect_endpoints.annotation"))}}function n(c){var f=t(c);if(!f)return null;var d=!1,m=Pe.matchTags(c.tags,"line");if(m){d=!0;var h=Object.keys(f)[0];m.tags[h]&&m.tags[h]==="*"&&(d=!1),Object.keys(m.tags).length===0&&(d=!1)}return new xt({type:e,subtype:"area_as_line",severity:"warning",message:function(A){var v=A.hasEntity(this.entityIds[0]);return v?T.append("issues.tag_suggests_area.message",{feature:yt(v,"area",!0),tag:s3({tags:f})}):""},reference:g,entityIds:[c.id],hash:JSON.stringify(f),dynamicFixes:function(A){var v=[],_=A.entity(this.entityIds[0]),w=r(_,A.graph());return d||v.push(new ut({title:T.append("issues.fix.connect_endpoints.title"),onClick:w})),v.push(new ut({icon:"iD-operation-delete",title:T.append("issues.fix.remove_tag.title"),onClick:function(k){var x=this.issue.entityIds[0],S=k.entity(x),I=Object.assign({},S.tags);for(var b in f)delete I[b];k.perform(tr(x,I),T("issues.fix.remove_tag.annotation"))}})),v}});function g(A){A.selectAll(".issue-reference").data([0]).enter().append("div").attr("class","issue-reference").call(T.append("issues.tag_suggests_area.reference"))}}function i(c,f){if(c.type!=="node"||Object.keys(c.tags).length===0||c.isOnAddressLine(f))return null;var d=c.geometry(f),m=N1(c.tags);return d==="point"&&!m.point&&m.vertex?new xt({type:e,subtype:"vertex_as_point",severity:"warning",message:function(h){var g=h.hasEntity(this.entityIds[0]);return g?T.append("issues.vertex_as_point.message",{feature:yt(g,"vertex",!0)}):""},reference:function(g){g.selectAll(".issue-reference").data([0]).enter().append("div").attr("class","issue-reference").call(T.append("issues.vertex_as_point.reference"))},entityIds:[c.id]}):d==="vertex"&&!m.vertex&&m.point?new xt({type:e,subtype:"point_as_vertex",severity:"warning",message:function(h){var g=h.hasEntity(this.entityIds[0]);return g?T.append("issues.point_as_vertex.message",{feature:yt(g,"point",!0)}):""},reference:function(g){g.selectAll(".issue-reference").data([0]).enter().append("div").attr("class","issue-reference").call(T.append("issues.point_as_vertex.reference"))},entityIds:[c.id],dynamicFixes:s}):null}function a(c,f){if(!c.hasInterestingTags()||c.type!=="node"&&c.type!=="way"||c.type==="node"&&c.isOnAddressLine(f))return null;var d=c.geometry(f),m=c.type==="way"?["point","vertex"]:["line","area"];d==="area"&&m.unshift("line");var h=Pe.match(c,f),g=m.find(w=>{let k=Pe.matchTags(c.tags,w,c.extent(f).center());if(!h||!k||h===k||(0,Kp.default)(h.tags,k.tags)||k.isFallback())return!1;var x=Object.keys(k.tags)[0];return x==="building"||k.tags[x]==="*"?!1:h.isFallback()||h.tags[x]==="*"});if(!g)return null;var A=g+"_as_"+d;g==="vertex"&&(g="point"),d==="vertex"&&(d="point");var v=g+"_as_"+d,_;return g==="point"?_=s:d==="area"&&g==="line"&&(_=o),new xt({type:e,subtype:A,severity:"warning",message:function(w){var k=w.hasEntity(this.entityIds[0]);return k?T.append("issues."+v+".message",{feature:yt(k,g,!0)}):""},reference:function(k){k.selectAll(".issue-reference").data([0]).enter().append("div").attr("class","issue-reference").call(T.append("issues.mismatched_geometry.reference"))},entityIds:[c.id],dynamicFixes:_})}function o(c){var f,d=this.entityIds[0],m=c.entity(d),h=Object.assign({},m.tags);return delete h.area,T1(h)||(f=function(g){var A=this.issue.entityIds[0],v=g.entity(A),_=Object.assign({},v.tags);_.area&&delete _.area,g.perform(tr(A,_),T("issues.fix.convert_to_line.annotation"))}),[new ut({icon:"iD-icon-line",title:T.append("issues.fix.convert_to_line.title"),onClick:f})]}function s(c){var f=this.entityIds[0],d=null;return c.hasHiddenConnections(f)||(d=function(m){var h=this.issue.entityIds[0],g=V4(h,m.projection);m.perform(g,T("operations.extract.annotation",{n:1})),m.enter(je(m,[g.getExtractedNodeID()]))}),[new ut({icon:"iD-operation-extract",title:T.append("issues.fix.extract_point.title"),onClick:d})]}function l(c,f){if(c.type!=="relation"||!c.isMultipolygon()||c.isDegenerate()||!c.isComplete(f))return[];var d=jn(c.members,f),m=[];for(var h in d){var g=d[h];if(g.nodes){var A=g.nodes[0],v=g.nodes[g.nodes.length-1];if(A!==v){var _=new xt({type:e,subtype:"unclosed_multipolygon_part",severity:"warning",message:function(k){var x=k.hasEntity(this.entityIds[0]);return x?T.append("issues.unclosed_multipolygon_part.message",{feature:yt(x,k.graph(),!0)}):""},reference:w,loc:g.nodes[0].loc,entityIds:[c.id],hash:g.map(function(k){return k.id}).join()});m.push(_)}}}return m;function w(k){k.selectAll(".issue-reference").data([0]).enter().append("div").attr("class","issue-reference").call(T.append("issues.unclosed_multipolygon_part.reference"))}}var u=function(f,d){var m=i(f,d);if(m)return[m];var h=n(f);if(h)return[h];var g=a(f,d);return g?[g]:l(f,d)};return u.type=e,u}var Kp,s_=q(()=>{"use strict";Kp=or(go(),1);p3();Bi();$4();Y7();Er();E2();Dr();At();He();ue();Ie();qn();Pn()});var yU={};j(yU,{validationMissingRole:()=>Zp});function Zp(){var e="missing_role",t=function(o,s){var l=[];return o.type==="way"?s.parentRelations(o).forEach(function(u){if(u.isMultipolygon()){var c=u.memberById(o.id);c&&r(c)&&l.push(n(o,u,c))}}):o.type==="relation"&&o.isMultipolygon()&&o.indexedMembers().forEach(function(u){var c=s.hasEntity(u.id);c&&r(u)&&l.push(n(c,o,u))}),l};function r(a){return!a.role||!a.role.trim().length}function n(a,o,s){return new xt({type:e,severity:"warning",message:function(u){var c=u.hasEntity(this.entityIds[1]),f=u.hasEntity(this.entityIds[0]);return c&&f?T.append("issues.missing_role.message",{member:yt(c,u.graph()),relation:yt(f,u.graph())}):""},reference:l,entityIds:[o.id,a.id],data:{member:s},hash:s.index.toString(),dynamicFixes:function(){return[i("inner"),i("outer"),new ut({icon:"iD-operation-delete",title:T.append("issues.fix.remove_from_relation.title"),onClick:function(u){u.perform(U1(this.issue.entityIds[0],this.issue.data.member.index),T("operations.delete_member.annotation",{n:1}))}})]}});function l(u){u.selectAll(".issue-reference").data([0]).enter().append("div").attr("class","issue-reference").call(T.append("issues.missing_role.multipolygon.reference"))}}function i(a){return new ut({title:T.append("issues.fix.set_as_"+a+".title"),onClick:function(o){var s=this.issue.data.member,l={id:this.issue.entityIds[1],type:s.type,role:a};o.perform(O1(this.issue.entityIds[0],l,s.index),T("operations.change_role.annotation",{n:1}))}})}return t.type=e,t}var l_=q(()=>{"use strict";m3();b3();ue();qn();Pn()});var bU={};j(bU,{validationMissingTag:()=>Jp});function Jp(e){var t="missing_tag";function r(o){var s=["description","name","note","start_date","oneway"],l=Object.keys(o.tags).filter(function(u){return u==="area"||!I1(u)?!1:!s.some(function(c){return u===c||u.indexOf(c+":")===0})});return o.type==="relation"&&l.length===1&&o.tags.type==="multipolygon"?!1:l.length>0}function n(o){return o.type==="way"&&o.tags.highway==="road"}function i(o){return o.type==="relation"&&!o.tags.type}var a=function(s,l){var u,c=e.connection(),f=s.type==="node"&&c&&!c.isDataLoaded(s.loc);if(!f&&s.geometry(l)!=="vertex"&&!s.hasParentRelations(l)&&(Object.keys(s.tags).length===0?u="any":r(s)?i(s)&&(u="relation_type"):u="descriptive"),!u&&n(s)&&(u="highway_classification"),!u)return[];var d=u==="highway_classification"?"unknown_road":"missing_tag."+u,m=u==="highway_classification"?"unknown_road":"missing_tag",h=s.version===void 0||s.v!==void 0,g=h&&u!=="highway_classification"?"error":"warning";return[new xt({type:t,subtype:u,severity:g,message:function(v){var _=v.hasEntity(this.entityIds[0]);return _?T.append("issues."+d+".message",{feature:yt(_,v.graph())}):""},reference:A,entityIds:[s.id],dynamicFixes:function(v){var _=[],w=u==="highway_classification"?"select_road_type":"select_preset";_.push(new ut({icon:"iD-icon-search",title:T.append("issues.fix."+w+".title"),onClick:function(b){b.ui().sidebar.showPresetList()}}));var k,x=this.entityIds[0],S=ui(v,[x]),I=S.disabled();return I||(k=function(b){var y=this.issue.entityIds[0],E=ui(b,[y]);E.disabled()||E()}),_.push(new ut({icon:"iD-operation-delete",title:T.append("issues.fix.delete_feature.title"),disabledReason:I?T("operations.delete."+I+".single"):void 0,onClick:k})),_}})];function A(v){v.selectAll(".issue-reference").data([0]).enter().append("div").attr("class","issue-reference").call(T.append("issues."+m+".reference"))}};return a.type=t,a}var u_=q(()=>{"use strict";il();Dr();ue();qn();Pn()});var wU={};j(wU,{validationMutuallyExclusiveTags:()=>em});function em(){let e="mutually_exclusive_tags",t=Hb,r=function(i){let a=t.filter(u=>u[0]in i.tags&&u[1]in i.tags).filter(u=>!(u[0].match(/^(addr:)?no[a-z]/)&&i.tags[u[0]]==="no"||u[1].match(/^(addr:)?no[a-z]/)&&i.tags[u[1]]==="no"));Object.keys(i.tags).forEach(u=>{let c="not:"+u;c in i.tags&&i.tags[c].split(";").includes(i.tags[u])&&a.push([c,u,"same_value"]),u.match(/^name:[a-z]+/)&&(c="not:name",c in i.tags&&i.tags[c].split(";").includes(i.tags[u])&&a.push([c,u,"same_value"]))});let o=a.map(u=>{let c=u[2]||"default";return new xt({type:e,subtype:c,severity:"warning",message:function(f){let d=f.hasEntity(this.entityIds[0]);return d?T.append(`issues.${e}.${c}.message`,{feature:yt(d,f.graph()),tag1:u[0],tag2:u[1]}):""},reference:f=>l(f,u,c),entityIds:[i.id],dynamicFixes:()=>u.slice(0,2).map(f=>s(f))})});function s(u){return new ut({icon:"iD-operation-delete",title:T.append("issues.fix.remove_named_tag.title",{tag:u}),onClick:function(c){let f=this.issue.entityIds[0],d=c.entity(f),m=Object.assign({},d.tags);delete m[u],c.perform(tr(f,m),T("issues.fix.remove_named_tag.annotation",{tag:u}))}})}function l(u,c,f){u.selectAll(".issue-reference").data([0]).enter().append("div").attr("class","issue-reference").call(T.append(`issues.${e}.${f}.reference`,{tag1:c[0],tag2:c[1]}))}return o};return r.type=e,r}var c_=q(()=>{"use strict";Bi();ue();qn();Pn();Dr()});var xU={};j(xU,{operationSplit:()=>l5});function l5(e,t){var r=t.filter(function(d){return e.graph().geometry(d)==="vertex"}),n=t.filter(function(d){var m=e.graph().hasEntity(d);return m&&m.type==="way"}),i=r.length>0&&r.length+n.length===t.length,a=n1(r),o=[],s="feature",l="single",u=r.length===1?"single":"multiple";if(i){n.length&&a.limitWays(n),o=a.ways(e.graph());var c={};o.forEach(function(d){c[d.geometry(e.graph())]=!0}),Object.keys(c).length===1&&(s=Object.keys(c)[0]),l=o.length===1?"single":"multiple"}var f=function(){var d=e.perform(a,f.annotation()),m=r.concat(d.extantIDs().filter(function(h){return e.entity(h).type==="way"}));e.enter(je(e,m))};return f.relatedEntityIds=function(){return n.length?[]:o.map(d=>d.id)},f.available=function(){return i},f.disabled=function(){var d=a.disabled(e.graph());return d||(t.some(e.hasHiddenConnections)?"connected_to_hidden":!1)},f.tooltip=function(){var d=f.disabled();return d?T.append("operations.split."+d):T.append("operations.split.description."+s+"."+l+"."+u+"_node")},f.annotation=function(){return T("operations.split.annotation."+s,{n:o.length})},f.icon=function(){return l==="multiple"?"#iD-operation-split-multiple":"#iD-operation-split"},f.id="split",f.keys=[T("operations.split.key")],f.title=T.append("operations.split.title"),f.behavior=ur(e).which(f),f}var tm=q(()=>{"use strict";ue();_3();Zn();Er()});var _U={};j(_U,{validationOsmApiLimits:()=>rm});function rm(e){let t="osm_api_limits",r=function(a){let o=[],s=e.connection();if(!s)return o;let l=s.maxWayNodes();return a.type==="way"&&a.nodes.length>l&&o.push(new xt({type:t,subtype:"exceededMaxWayNodes",severity:"error",message:function(){return T.html("issues.osm_api_limits.max_way_nodes.message")},reference:function(u){u.selectAll(".issue-reference").data([0]).enter().append("div").attr("class","issue-reference").html(T.html("issues.osm_api_limits.max_way_nodes.reference",{maxWayNodes:l}))},entityIds:[a.id],dynamicFixes:n})),o};function n(){return[new ut({icon:"iD-operation-split",title:T.html("issues.fix.split_way.title"),entityIds:this.entityIds,onClick:function(a){let o=a.connection().maxWayNodes(),s=a.graph(),l=this.entityIds[0],u=a.graph().entities[l],c=Math.ceil(u.nodes.length/o),f;if(c===2){let m=u.nodes.map(h=>s.entity(h)).filter(h=>s.parentWays(h).length>1).map(h=>h.id).filter(h=>{let g=u.nodes.indexOf(h);return g<o&&u.nodes.length-g<o});m.length>0&&(f=[m[Math.floor(m.length/2)]])}f===void 0&&(f=[...Array(c-1)].map((m,h)=>u.nodes[Math.floor(u.nodes.length*(h+1)/c)])),u.isClosed()&&f.push(u.nodes[0]);let d=l5(a,f.concat(l));d.disabled()||d()}})]}return r.type=t,r}var f_=q(()=>{"use strict";ue();Pn();tm()});var kU={};j(kU,{deprecatedTagValuesByKey:()=>p_,getDeprecatedTags:()=>d_});function d_(e,t){if(Object.keys(e).length===0)return[];var r=[];return t.forEach(n=>{var i=Object.keys(n.old);if(n.replace){var a=Object.keys(n.replace).some(s=>{if(!e[s]||n.old[s])return!1;var l=n.replace[s];return!(l==="*"||l===e[s])});if(a)return}var o=i.every(s=>{if(!e[s])return!1;if(n.old[s]==="*"||n.old[s]===e[s])return!0;var l=e[s].split(";").filter(Boolean);if(l.length===0)return!1;if(l.length>1)return l.indexOf(n.old[s])!==-1;if(e[s]===n.old[s])if(n.replace&&n.old[s]===n.replace[s]){var u=Object.keys(n.replace);return!u.every(c=>e[c]===n.replace[c])}else return!0;return!1});o&&r.push(n)}),r}function p_(e){return u5||(u5={},e.forEach(t=>{var r=Object.keys(t.old);if(r.length===1){var n=r[0],i=t.old[n];i!=="*"&&(u5[n]?u5[n].push(i):u5[n]=[i])}})),u5}var u5,nm=q(()=>{"use strict"});var EU={};j(EU,{validationOutdatedTags:()=>im});function im(){let e="outdated_tags",t=!0,r;it.get("deprecated").then(a=>r=a).catch(()=>{}).finally(()=>t=!1);function n(a,o){if(!a.hasInterestingTags())return[];let s=Pe.match(a,o);if(!s)return[];let l=Object.assign({},a.tags);if(s.replacement){let w=Pe.item(s.replacement);o=R1(a.id,s,w,!0)(o),a=o.entity(a.id),s=w}let u=de.nsi,c=!1,f;if(u&&(c=u.status()==="loading",!c)){let w=a.extent(o).center();f=u.upgradeTags(l,w)}let d=f?Yo(l,f.newTags):[];if(r){let w=d_(a.tags,r);a.type==="way"&&a.isClosed()&&a.tags.traffic_calming==="island"&&!a.tags.highway&&w.push({old:{traffic_calming:"island"},replace:{"area:highway":"traffic_island"}}),w.length&&(w.forEach(k=>{o=R3(a.id,k.old,k.replace)(o)}),a=o.entity(a.id))}let m=Object.assign({},a.tags);s.tags!==s.addTags&&Object.keys(s.addTags).filter(w=>!(f!=null&&f.newTags[w])).forEach(w=>{m[w]||(s.addTags[w]==="*"?m[w]="yes":s.addTags[w]&&(m[w]=s.addTags[w]))});let h=Yo(l,m),g=[];if(g.provisional=t||c,h.length){let w=h.every(x=>x.type==="+"),k=w?"incomplete.":"";g.push(new xt({type:e,subtype:w?"incomplete_tags":"deprecated_tags",severity:"warning",message:x=>{let S=x.hasEntity(a.id);if(!S)return"";let I=yt(S,x.graph(),!0);return T.append(`issues.outdated_tags.${k}message`,{feature:I})},reference:x=>_(x,T.append(`issues.outdated_tags.${k}reference`),h),entityIds:[a.id],hash:fo(JSON.stringify(h)),dynamicFixes:()=>[new ut({title:T.append("issues.fix.upgrade_tags.title"),onClick:S=>{S.perform(I=>A(I,h),T("issues.fix.upgrade_tags.annotation"))}})]}))}if(d.length){let w=d.every(k=>k.type==="+");g.push(new xt({type:e,subtype:"noncanonical_brand",severity:"warning",message:k=>{let x=k.hasEntity(a.id);if(!x)return"";let S=yt(x,k.graph(),!0);return w?T.append("issues.outdated_tags.noncanonical_brand.message_incomplete",{feature:S}):T.append("issues.outdated_tags.noncanonical_brand.message",{feature:S})},reference:k=>_(k,T.append("issues.outdated_tags.noncanonical_brand.reference"),d),entityIds:[a.id],hash:fo(JSON.stringify(d)),dynamicFixes:()=>[new ut({title:T.append("issues.fix.upgrade_tags.title"),onClick:x=>{x.perform(S=>A(S,d),T("issues.fix.upgrade_tags.annotation"))}}),new ut({title:T.append("issues.fix.tag_as_not.title",{name:f.matched.displayName}),onClick:x=>{x.perform(v,T("issues.fix.tag_as_not.annotation"))}})]}))}return g;function A(w,k){let x=w.hasEntity(a.id);if(!x)return w;let S=Object.assign({},x.tags);return k.forEach(I=>{I.type==="-"?delete S[I.key]:I.type==="+"&&(S[I.key]=I.newVal)}),tr(x.id,S)(w)}function v(w){let k=w.hasEntity(a.id);if(!k)return w;let x=f&&f.matched;if(!x)return w;let S=Object.assign({},k.tags),I=x.mainTag,b=`not:${I}`,y=x.tags[I];if(S[b]=y,S[I]===y){let E=x.mainTag.replace("wikidata","wikipedia");delete S[I],delete S[E]}return tr(k.id,S)(w)}function _(w,k,x){let S=w.selectAll(".issue-reference").data([0]).enter();S.append("div").attr("class","issue-reference").call(k),S.append("strong").call(T.append("issues.suggested")),S.append("table").attr("class","tagDiff-table").selectAll(".tagDiff-row").data(x).enter().append("tr").attr("class","tagDiff-row").append("td").attr("class",I=>`tagDiff-cell tagDiff-cell-${I.type==="+"?"add":"remove"}`).html(I=>I.display)}}let i=n;return i.type=e,i}var m_=q(()=>{"use strict";ue();h3();Bi();Zd();V2();At();pt();Ie();qn();Pn();nm()});var AU={};j(AU,{validationPrivateData:()=>am});function am(){var e="private_data",t={detached:!0,farm:!0,house:!0,houseboat:!0,residential:!0,semidetached_house:!0,static_caravan:!0},r={amenity:!0,craft:!0,historic:!0,leisure:!0,office:!0,shop:!0,tourism:!0},n={"contact:email":!0,"contact:fax":!0,"contact:phone":!0,email:!0,fax:!0,phone:!0},i=function(o){var s=o.tags;if(!s.building||!t[s.building])return[];var l={};for(var u in s){if(r[u])return[];n[u]||(l[u]=s[u])}var c=Yo(s,l);if(!c.length)return[];var f=c.length===1?"remove_tag":"remove_tags";return[new xt({type:e,severity:"warning",message:m,reference:h,entityIds:[o.id],dynamicFixes:function(){return[new ut({icon:"iD-operation-delete",title:T.append("issues.fix."+f+".title"),onClick:function(g){g.perform(d,T("issues.fix.remove_tag.annotation"))}})]}})];function d(g){var A=g.hasEntity(o.id);if(!A)return g;var v=Object.assign({},A.tags);return c.forEach(function(_){_.type==="-"?delete v[_.key]:_.type==="+"&&(v[_.key]=_.newVal)}),tr(A.id,v)(g)}function m(g){var A=g.hasEntity(this.entityIds[0]);return A?T.append("issues.private_data.contact.message",{feature:yt(A,g.graph())}):""}function h(g){var A=g.selectAll(".issue-reference").data([0]).enter();A.append("div").attr("class","issue-reference").call(T.append("issues.private_data.reference")),A.append("strong").call(T.append("issues.suggested")),A.append("table").attr("class","tagDiff-table").selectAll(".tagDiff-row").data(c).enter().append("tr").attr("class","tagDiff-row").append("td").attr("class",function(v){var _=v.type==="+"?"add":"remove";return"tagDiff-cell tagDiff-cell-"+_}).html(function(v){return v.display})}};return i.type=e,i}var h_=q(()=>{"use strict";Bi();ue();Ie();qn();Pn()});var SU={};j(SU,{validationSuspiciousName:()=>om});function om(e){let t="suspicious_name",r=["aerialway","aeroway","amenity","building","craft","highway","leisure","railway","man_made","office","shop","tourism","waterway"],n=new Set(["amenity/place_of_worship/christian/jehovahs_witness","__test__ignored_preset"]),i=!1;function a(f){let d=de.nsi;return d&&(i=d.status()==="loading",!i)?d.isGenericName(f):!1}function o(f,d){for(let m=0;m<r.length;m++){let h=r[m],g=d[h];if(g&&(g=g.toLowerCase(),h===f||g===f||h.replace(/\_/g," ")===f||g.replace(/\_/g," ")===f))return!0}return!1}function s(f,d){return!d||n.has(d.id)?!1:(f=f.toLowerCase(),f===d.name().toLowerCase()||d.aliases().some(m=>f===m.toLowerCase()))}function l(f,d,m){return f=f.toLowerCase(),o(f,d)||s(f,m)||a(d)}function u(f,d,m,h){return new xt({type:t,subtype:"generic_name",severity:"warning",message:function(A){let v=A.hasEntity(this.entityIds[0]);if(!v)return"";let _=Pe.match(v,A.graph()),w=h&&pe.languageName(h);return T.append("issues.generic_name.message"+(w?"_language":""),{feature:_.name(),name:m,language:w})},reference:g,entityIds:[f],hash:`${d}=${m}`,dynamicFixes:function(){return[new ut({icon:"iD-operation-delete",title:T.append("issues.fix.remove_the_name.title"),onClick:function(A){let v=this.issue.entityIds[0],_=A.entity(v),w=Object.assign({},_.tags);delete w[d],A.perform(tr(v,w),T("issues.fix.remove_generic_name.annotation"))}})]}});function g(A){A.selectAll(".issue-reference").data([0]).enter().append("div").attr("class","issue-reference").call(T.append("issues.generic_name.reference"))}}let c=function(d){let m=d.tags;if(!!m.wikidata||!!m["brand:wikidata"]||!!m["operator:wikidata"])return[];let g=[],A=Pe.match(d,e.graph());for(let v in m){let _=v.match(/^name(?:(?::)([a-zA-Z_-]+))?$/);if(!_)continue;let w=_.length>=2?_[1]:null,k=m[v];l(k,m,A)&&(g.provisional=i,g.push(u(d.id,v,k,w)))}return g};return c.type=t,c}var g_=q(()=>{"use strict";Bi();At();pt();ue();Pn()});var CU={};j(CU,{validationUnsquareWay:()=>sm});function sm(e){var t="unsquare_way",r=5,n=.05,i=10;function a(s,l){return s.type!=="way"||s.geometry(l)!=="area"?!1:s.tags.building&&s.tags.building!=="no"}var o=function(l,u){if(!a(l,u))return[];if(l.tags.nonsquare==="yes")return[];var c=l.isClosed();if(!c)return[];var f=u.childNodes(l).slice();if(f.length>i+1)return[];var d=de.osm;if(!d||f.some(function(k){return!d.isDataLoaded(k.loc)}))return[];var m=f.some(function(k){return u.parentWays(k).some(function(x){return x.id===l.id?!1:a(x,u)?!0:u.parentRelations(x).some(function(S){return S.isMultipolygon()&&S.tags.building&&S.tags.building!=="no"})})});if(m)return[];var h=ke("validate-square-degrees"),g=isFinite(h)?Number(h):r,A=f.map(function(k){return e.projection(k.loc)});if(!N4(A,c,n,g,!0))return[];var v;if(!l.tags.wikidata){var _=q1(l.id,e.projection,void 0,g);_.transitionable=!1,v=[_,T("operations.orthogonalize.annotation.feature",{n:1})]}return[new xt({type:t,subtype:"building",severity:"warning",message:function(k){var x=k.hasEntity(this.entityIds[0]);return x?T.append("issues.unsquare_way.message",{feature:yt(x,k.graph())}):""},reference:w,entityIds:[l.id],hash:g,dynamicFixes:function(){return[new ut({icon:"iD-operation-orthogonalize",title:T.append("issues.fix.square_feature.title"),autoArgs:v,onClick:function(k,x){var S=this.issue.entityIds[0];k.perform(q1(S,k.projection,void 0,g),T("operations.orthogonalize.annotation.feature",{n:1})),window.setTimeout(function(){x()},175)}})]}})];function w(k){k.selectAll(".issue-reference").data([0]).enter().append("div").attr("class","issue-reference").call(T.append("issues.unsquare_way.buildings.reference"))}};return o.type=t,o}var v_=q(()=>{"use strict";fr();ue();t9();d2();qn();Pn();pt()});var lm={};j(lm,{validationAlmostJunction:()=>qp,validationCloseNodes:()=>Vp,validationCrossingWays:()=>$p,validationDisconnectedWay:()=>Gp,validationFormatting:()=>Wp,validationHelpRequest:()=>Qp,validationImpossibleOneway:()=>Hp,validationIncompatibleSource:()=>jp,validationMaprules:()=>Yp,validationMismatchedGeometry:()=>Xp,validationMissingRole:()=>Zp,validationMissingTag:()=>Jp,validationMutuallyExclusiveTags:()=>em,validationOsmApiLimits:()=>rm,validationOutdatedTags:()=>im,validationPrivateData:()=>am,validationSuspiciousName:()=>om,validationUnsquareWay:()=>sm});var um=q(()=>{"use strict";Zx();Jx();e_();t_();r_();n_();i_();a_();o_();s_();l_();u_();c_();f_();m_();h_();g_();v_()});var IU={};j(IU,{coreValidator:()=>c5});function c5(e){let t=xe("validated","focusedIssue"),r={},n={},i={},a=new Set,o=new Set,s=cm("base"),l=cm("head"),u={},c=!1,f={},d=new Set,m,h=5e3,g=_(e.initialHashParams.validationError),A=_(e.initialHashParams.validationWarning),v=_(e.initialHashParams.validationDisable);function _(E){let M=[];return(E||"").split(",").forEach(D=>{D=D.trim();let O=D.split("/",2),L=O[0],P=O[1]||"*";!L||!P||M.push({type:N(L),subtype:N(P)})}),M;function N(D){let O=D.replace(/[-\/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*");return new RegExp("^"+O+"$")}}r.init=()=>{Object.values(lm).forEach(M=>{if(typeof M!="function")return;let F=M(e),N=F.type;n[N]=F});let E=ke("validate-disabledRules");E&&E.split(",").forEach(M=>i[M]=!0)};function w(E){s.queue=[],l.queue=[],Object.keys(f).forEach(M=>{window.cancelIdleCallback(M),f[M]()}),f={},d.forEach(window.clearTimeout),d.clear(),E&&a.clear(),o.clear(),s=cm("base"),l=cm("head"),u={},c=!1}r.reset=()=>{w(!0)},r.resetIgnoredIssues=()=>{a.clear(),t.call("validated")},r.revalidateUnsquare=()=>{k(l),k(s),t.call("validated")};function k(E){let M=n.unsquare_way;if(!E.graph||typeof M!="function")return;E.uncacheIssuesOfType("unsquare_way"),e.history().tree().intersects(Me([-180,-90],[180,90]),E.graph).filter(N=>N.type==="way"&&N.tags.building&&N.tags.building!=="no").forEach(N=>{let D=M(N,E.graph);D.length&&E.cacheIssues(D)})}r.getIssues=E=>{let M=Object.assign({what:"all",where:"all",includeIgnored:!1,includeDisabledRules:!1},E),F=e.map().extent(),N=new Set,D=[];return l.graph&&l.graph!==s.graph&&Object.values(l.issuesByIssueID).forEach(L=>{let P=(L.entityIds||[]).some(U=>u.hasOwnProperty(U));M.what==="edited"&&!P||O(L)&&(N.add(L.id),D.push(L))}),M.what==="all"&&Object.values(s.issuesByIssueID).forEach(L=>{O(L)&&(N.add(L.id),D.push(L))}),D;function O(L){if(!L||N.has(L.id)||o.has(L.id)||M.includeDisabledRules==="only"&&!i[L.type]||!M.includeDisabledRules&&i[L.type]||M.includeIgnored==="only"&&!a.has(L.id)||!M.includeIgnored&&a.has(L.id)||(L.entityIds||[]).some(P=>!e.hasEntity(P)))return!1;if(M.where==="visible"){let P=L.extent(e.graph());if(!F.intersects(P))return!1}return!0}},r.getResolvedIssues=()=>Array.from(o).map(E=>s.issuesByIssueID[E]).filter(Boolean),r.focusIssue=E=>{let M=e.graph(),F,N,D=E.extent(M);if(D&&(N=D.center()),E.entityIds&&E.entityIds.length&&(F=E.entityIds[0],F&&F.charAt(0)==="r")){let O=Cs([F],M),L=O.find(P=>P.charAt(0)==="n"&&M.hasEntity(P));if(!L){let P=O.find(U=>U.charAt(0)==="w"&&M.hasEntity(U));P&&(L=M.entity(P).first())}L&&(N=M.entity(L).loc)}if(N){let O=Math.max(e.map().zoom(),19);e.map().unobscuredCenterZoomEase(N,O)}F&&window.setTimeout(()=>{e.enter(je(e,[F])),t.call("focusedIssue",this,E)},250)},r.getIssuesBySeverity=E=>{let M=pr(r.getIssues(E),"severity");return M.error=M.error||[],M.warning=M.warning||[],M},r.getSharedEntityIssues=(E,M)=>{let F=["missing_tag","missing_role","outdated_tags","mismatched_geometry","crossing_ways","almost_junction","disconnected_way","impossible_oneway"],N=r.getIssues(M),D=new Set(E);return N.filter(O=>(O.entityIds||[]).some(L=>D.has(L))).sort((O,L)=>{if(O.type===L.type)return O.id<L.id?-1:1;let P=F.indexOf(O.type),U=F.indexOf(L.type);return P!==-1&&U!==-1?P-U:P===-1&&U===-1?O.type<L.type?-1:1:P!==-1?-1:1})},r.getEntityIssues=(E,M)=>r.getSharedEntityIssues([E],M),r.getRuleKeys=()=>Object.keys(n),r.isRuleEnabled=E=>!i[E],r.toggleRule=E=>{i[E]?delete i[E]:i[E]=!0,ke("validate-disabledRules",Object.keys(i).join(",")),r.validate()},r.disableRules=E=>{i={},E.forEach(M=>i[M]=!0),ke("validate-disabledRules",Object.keys(i).join(",")),r.validate()},r.ignoreIssue=E=>{a.add(E)},r.validate=()=>{let E=e.history().base();l.graph||(l.graph=E),s.graph||(s.graph=E);let M=l.graph,F=e.graph();if(F===M)return c=!0,t.call("validated"),Promise.resolve();if(m)return c=!1,m;l.graph=F,u=e.history().difference().complete();let N=Eo(M,F),D=Object.keys(N.complete()),O=l.withAllRelatedEntities(D);if(!O.size)return t.call("validated"),Promise.resolve();let L=P=>D.filter(U=>P.hasEntity(U)).map(U=>P.entity(U)).flatMap(U=>P.childNodes(U)).flatMap(U=>P.parentWays(U)).forEach(U=>O.add(U.id));return L(F),L(M),Object.values({...N.created(),...N.deleted()}).filter(P=>P.type==="relation").flatMap(P=>P.members).forEach(P=>O.add(P.id)),Object.values(N.modified()).filter(P=>P.type==="relation").map(P=>({baseEntity:M.entity(P.id),headEntity:P})).forEach(({baseEntity:P,headEntity:U})=>{let B=P.members.map(G=>G.id),z=U.members.map(G=>G.id);yr(Ht(B,z),Cr(B,z)).forEach(G=>O.add(G))}),m=I(O,l).then(()=>S(O)).then(()=>t.call("validated")).catch(()=>{}).then(()=>{m=null,c||r.validate()}),m},e.history().on("restore.validator",r.validate).on("undone.validator",r.validate).on("redone.validator",r.validate).on("reset.validator",()=>{w(!1),r.validate()}),e.on("exit.validator",r.validate),e.history().on("merge.validator",E=>{if(!E)return;let M=e.history().base();l.graph||(l.graph=M),s.graph||(s.graph=M);let F=E.map(N=>N.id);F=s.withAllRelatedEntities(F),I(F,s)});function x(E,M){let F={issues:[],provisional:!1};return Object.keys(n).forEach(N),F;function N(D){let O=n[D];if(typeof O!="function"){console.error("no such validation rule = "+D);return}let L=O(E,M);L.provisional&&(F.provisional=!0),L=L.filter(P),F.issues=F.issues.concat(L);function P(U){let B=U.type,z=U.subtype||"",V;for(V=0;V<g.length;V++)if(g[V].type.test(B)&&g[V].subtype.test(z))return U.severity="error",!0;for(V=0;V<A.length;V++)if(A[V].type.test(B)&&A[V].subtype.test(z))return U.severity="warning",!0;for(V=0;V<v.length;V++)if(v[V].type.test(B)&&v[V].subtype.test(z))return!1;return!0}}}function S(E){E.forEach(M=>{let F=s.issuesByEntityID[M];F&&F.forEach(N=>{(s.issuesByIssueID[N].entityIds||[]).some(L=>u.hasOwnProperty(L))&&!l.issuesByIssueID[N]?o.add(N):o.delete(N)})})}function I(E,M){let F=Array.from(E).map(N=>M.queuedEntityIDs.has(N)?null:(M.queuedEntityIDs.add(N),M.uncacheEntityID(N),()=>{M.queuedEntityIDs.delete(N);let D=M.graph;if(!D)return;let O=D.hasEntity(N);if(!O)return;let L=x(O,D);L.provisional&&M.provisionalEntityIDs.add(N),M.cacheIssues(L.issues)})).filter(Boolean);return M.queue=M.queue.concat(ks(F,100)),M.queuePromise||(M.queuePromise=y(M).then(()=>b(M)).catch(()=>{}).finally(()=>M.queuePromise=null)),M.queuePromise}function b(E){if(!E.provisionalEntityIDs.size)return;let M=window.setTimeout(()=>{d.delete(M),E.provisionalEntityIDs.size&&I(Array.from(E.provisionalEntityIDs),E)},h);d.add(M)}function y(E){if(!E.queue.length)return Promise.resolve();let M=E.queue.pop();return new Promise((F,N)=>{let D=window.requestIdleCallback(()=>{delete f[D],M.forEach(O=>O()),F()});f[D]=N}).then(()=>{E.queue.length%25===0&&t.call("validated")}).then(()=>y(E))}return _e(r,t,"on")}function cm(e){let t={which:e,graph:null,queue:[],queuePromise:null,queuedEntityIDs:new Set,provisionalEntityIDs:new Set,issuesByIssueID:{},issuesByEntityID:{}};return t.cacheIssue=r=>{(r.entityIds||[]).forEach(n=>{t.issuesByEntityID[n]||(t.issuesByEntityID[n]=new Set),t.issuesByEntityID[n].add(r.id)}),t.issuesByIssueID[r.id]=r},t.uncacheIssue=r=>{(r.entityIds||[]).forEach(n=>{t.issuesByEntityID[n]&&t.issuesByEntityID[n].delete(r.id)}),delete t.issuesByIssueID[r.id]},t.cacheIssues=r=>{r.forEach(t.cacheIssue)},t.uncacheIssues=r=>{r.forEach(t.uncacheIssue)},t.uncacheIssuesOfType=r=>{let n=Object.values(t.issuesByIssueID).filter(i=>i.type===r);t.uncacheIssues(n)},t.uncacheEntityID=r=>{let n=t.issuesByEntityID[r];n&&n.forEach(i=>{let a=t.issuesByIssueID[i];a?t.uncacheIssue(a):delete t.issuesByIssueID[i]}),delete t.issuesByEntityID[r],t.provisionalEntityIDs.delete(r)},t.withAllRelatedEntities=r=>{let n=new Set;return(r||[]).forEach(i=>{n.add(i);let a=t.issuesByEntityID[i];a&&a.forEach(o=>{let s=t.issuesByIssueID[o];s?(s.entityIds||[]).forEach(l=>n.add(l)):delete t.issuesByIssueID[o]})}),n},t}var fm=q(()=>{"use strict";Ye();fr();i5();w1();Er();Ie();um()});var MU={};j(MU,{coreUploader:()=>f5});import{escape as Jae}from"lodash-es";function f5(e){var t=xe("saveStarted","saveEnded","willAttemptUpload","progressChanged","resultNoChanges","resultErrors","resultConflicts","resultSuccess"),r=!1;let n=!1;var i=[],a=[],o,s={};it.get("discarded").then(function(v){s=v}).catch(function(){});let l={};l.isSaving=function(){return r},l.save=function(v,_,w){if(!(r&&!_)){var k=e.connection();if(k){if(!k.authenticated()){k.authenticate(function(S){S||l.save(v,_,w)});return}r||(r=!0,t.call("saveStarted",this));var x=e.history();n=!1,i=[],a=[],o=x.changes(Ts(x.difference(),s)),_||x.perform(En()),w?u(v):c(v)}}};function u(v){var _=e.connection();if(!_)return;for(var w=e.history(),k=e.graph(),x=kn(w.base(),!0),S=w.difference().summary(),I=[],b=0;b<S.length;b++){var y=S[b];y.changeType==="modified"&&I.push(y.entity.id)}var E=D(I,k),M={},F=0,N=E.length;I.length?(t.call("progressChanged",this,F,N),E.forEach(function(P){M[P]=!1}),_.loadMultiple(E,O)):c(v);return;function D(P,U){var B=new Set(P);return P.forEach(function(z){var V=U.entity(z);V.type==="way"&&U.childNodes(V).forEach(function(G){G.version!==void 0&&B.add(G.id)})}),Array.from(B)}function O(P,U){if(!a.length)if(P)a.push({msg:P.message||P.responseText,details:[T("save.status_code",{code:P.status})]}),m();else{var B=[];U.data.forEach(function(z){if(x.replace(z),M[z.id]=!0,E=E.filter(function(W){return W!==z.id}),!!z.visible){var V,G;if(z.type==="way")for(V=0;V<z.nodes.length;V++)G=z.nodes[V],M[G]===void 0&&(M[G]=!1,B.push(G));else if(z.type==="relation"&&z.isMultipolygon())for(V=0;V<z.members.length;V++)G=z.members[V].id,M[G]===void 0&&(M[G]=!1,B.push(G))}}),F+=U.data.length,N+=B.length,t.call("progressChanged",this,F,N),B.length&&(E.push.apply(E,B),_.loadMultiple(B,O)),E.length||(L(),c(v))}}function L(){function P(V,G,W){return{id:V,text:G,action:function(){w.replace(W)}}}function U(V){return'<a href="'+_.userURL(V)+'" target="_blank">'+Jae(V)+"</a>"}function B(V){return hr(V)||li(V.id)+" "+V.id}function z(V,G){if(V.version!==G.version)return!1;if(V.type==="way")for(var W=Ht(V.nodes,G.nodes),Y=0;Y<W.length;Y++){var J=k.hasEntity(W[Y]),oe=x.hasEntity(W[Y]);if(J&&oe&&J.version!==oe.version)return!1}return!0}I.forEach(function(V){var G=k.entity(V),W=x.entity(V);if(!z(G,W)){var Y=H4(V,k,x,s,U);w.replace(Y);var J=Y.conflicts();if(!J.length){n=!0;return}var oe=H4(V,k,x,s).withOption("force_local"),Ce=H4(V,k,x,s).withOption("force_remote"),se=T("save.conflict."+(W.visible?"keep_local":"restore")),ne=T("save.conflict."+(W.visible?"keep_remote":"delete"));i.push({id:V,name:B(G),details:J,chosen:1,choices:[P(V,se,oe),P(V,ne,Ce)]})}})}}async function c(v){var _=e.connection();if(_||a.push({msg:"No OSM Service"}),i.length)h(v);else if(a.length)m();else{n&&(v.tags.merge_conflict_resolved="automatically",await _.updateChangesetTags(v));var w=e.history(),k=w.changes(Ts(w.difference(),s));k.modified.length||k.created.length||k.deleted.length?(t.call("willAttemptUpload",this),_.putChangeset(v,k,f)):d()}}function f(v,_){v?v.status===409?l.save(_,!0,!0):(a.push({msg:v.message||v.responseText,details:[T("save.status_code",{code:v.status})]}),m()):g(_)}function d(){t.call("resultNoChanges",this),A(),e.flush()}function m(){e.history().pop(),t.call("resultErrors",this,a),A()}function h(v){v.tags.merge_conflict_resolved="manually",e.connection().updateChangesetTags(v),i.sort(function(_,w){return w.id.localeCompare(_.id)}),t.call("resultConflicts",this,v,i,o),A()}function g(v){e.history().clearSaved(),t.call("resultSuccess",this,v),window.setTimeout(function(){A(),e.flush()},2500)}function A(){r=!1,t.call("saveEnded",this)}return l.cancelConflictResolution=function(){e.history().pop()},l.processResolvedConflicts=function(v){for(var _=e.history(),w=0;w<i.length;w++)if(i[w].chosen===1){var k=e.hasEntity(i[w].id);if(k&&k.type==="way")for(var x=Je(k.nodes),S=0;S<x.length;S++)_.replace(S2(x[S]));_.replace(S2(i[w].id))}l.save(v,!0,!1)},l.reset=function(){},_e(l,t,"on")}var dm=q(()=>{"use strict";Ye();An();j7();Vd();Ns();Qd();G4();ue();Ie()});var TU={};j(TU,{modeDrawArea:()=>hl});function hl(e,t,r,n){var i={button:n,id:"draw-area"},a=ml(e,t,i,r).on("rejectedSelfIntersection.modeDrawArea",function(){e.ui().flash.iconName("#iD-icon-no").label(T.append("self_intersection.error.areas"))()});return i.wayID=t,i.enter=function(){e.install(a)},i.exit=function(){e.uninstall(a)},i.selectedIDs=function(){return[t]},i.activeID=function(){return a&&a.activeID()||[]},i}var pm=q(()=>{"use strict";ue();X9()});var NU={};j(NU,{modeAddArea:()=>d5});function d5(e,t){t.id="add-area";var r=gl(e).on("start",a).on("startFromWay",o).on("startFromNode",s);function n(l){var u={area:"yes"};return t.preset&&(u=t.preset.setTags(u,"area",!1,l)),u}function i(l){return function(u){return u.replace(u.entity(l).close())}}function a(l){var u=e.graph(),c=Nt({loc:l}),f=kr({tags:n(l)});e.perform(In(c),In(f),oa(f.id,c.id),i(f.id)),e.enter(hl(e,f.id,u,t.button))}function o(l,u){var c=e.graph(),f=Nt({loc:l}),d=kr({tags:n(l)});e.perform(In(f),In(d),oa(d.id,f.id),i(d.id),Gr({loc:l,edge:u},f)),e.enter(hl(e,d.id,c,t.button))}function s(l){var u=e.graph(),c=kr({tags:n(l.loc)});e.perform(In(c),oa(c.id,l.id),i(c.id)),e.enter(hl(e,c.id,u,t.button))}return t.enter=function(){e.install(r)},t.exit=function(){e.uninstall(r)},t}var y_=q(()=>{"use strict";Xl();Jo();p3();Z9();pm();lr()});var DU={};j(DU,{modeAddLine:()=>p5});function p5(e,t){t.id="add-line";var r=gl(e).on("start",i).on("startFromWay",a).on("startFromNode",o);function n(s){var l={};return t.preset&&(l=t.preset.setTags(l,"line",!1,s)),l}function i(s){var l=e.graph(),u=Nt({loc:s}),c=kr({tags:n(s)});e.perform(In(u),In(c),oa(c.id,u.id)),e.enter(da(e,c.id,l,t.button))}function a(s,l){var u=e.graph(),c=Nt({loc:s}),f=kr({tags:n(s)});e.perform(In(c),In(f),oa(f.id,c.id),Gr({loc:s,edge:l},c)),e.enter(da(e,f.id,u,t.button))}function o(s){var l=e.graph(),u=kr({tags:n(s.loc)});e.perform(In(u),oa(u.id,s.id)),e.enter(da(e,u.id,l,t.button))}return t.enter=function(){e.install(r)},t.exit=function(){e.uninstall(r)},t}var b_=q(()=>{"use strict";Xl();Jo();p3();Z9();q2();lr()});var PU={};j(PU,{modeAddPoint:()=>m5});function m5(e,t){t.id="add-point";var r=_o(e).on("click",i).on("clickWay",a).on("clickNode",s).on("cancel",l).on("finish",l);function n(u){var c={};return t.preset&&(c=t.preset.setTags(c,"point",!1,u)),c}function i(u){var c=Nt({loc:u,tags:n(u)});e.perform(In(c),T("operations.add.annotation.point")),o(c)}function a(u,c){var f=Nt({tags:n(u)});e.perform(Gr({loc:u,edge:c},f),T("operations.add.annotation.vertex")),o(f)}function o(u){e.enter(je(e,[u.id]).newFeature(!0))}function s(u){let c=n(u.loc);if(Object.keys(c).length===0){o(u);return}var f=Object.assign({},u.tags);for(var d in c)f[d]=c[d];e.perform(tr(u.id,f),T("operations.add.annotation.point")),o(u)}function l(){e.enter(Ue(e))}return t.enter=function(){e.install(r)},t.exit=function(){e.uninstall(r)},t}var w_=q(()=>{"use strict";ue();P2();Kt();Er();e1();Xl();Bi();Jo()});var FU={};j(FU,{uiNoteComments:()=>h5});function h5(){var e;function t(i){if(!e.isNew()){var a=i.selectAll(".comments-container").data([0]);a=a.enter().append("div").attr("class","comments-container").merge(a);var o=a.selectAll(".comment").data(e.comments).enter().append("div").attr("class","comment");o.append("div").attr("class",function(u){return"comment-avatar user-"+u.uid}).call(ce("#iD-icon-avatar","comment-avatar-icon"));var s=o.append("div").attr("class","comment-main"),l=s.append("div").attr("class","comment-metadata");l.append("div").attr("class","comment-author").each(function(u){var c=Q(this),f=de.osm;f&&u.user&&(c=c.append("a").attr("class","comment-author-link").attr("href",f.userURL(u.user)).attr("target","_blank")),u.user?c.text(u.user):c.call(T.append("note.anonymous"))}),l.append("div").attr("class","comment-date").html(function(u){return T.html("note.status."+u.action,{when:n(u.date)})}),s.append("div").attr("class","comment-text").html(function(u){return u.html}).selectAll("a").attr("rel","noopener nofollow").attr("target","_blank"),a.call(r)}}function r(i){var a=ke("preferences.privacy.thirdpartyicons")||"true",o=de.osm;if(!(a!=="true"||!o)){var s={};e.comments.forEach(function(l){l.uid&&(s[l.uid]=!0)}),Object.keys(s).forEach(function(l){o.loadUser(l,function(u,c){!c||!c.image_url||i.selectAll(".comment-avatar.user-"+l).html("").append("img").attr("class","icon comment-avatar-icon").attr("src",c.image_url).attr("alt",c.display_name)})})}}function n(i){if(!i)return null;var a={day:"numeric",month:"short",year:"numeric"};i=i.replace(/-/g,"/");var o=new Date(i);return isNaN(o.getTime())?null:o.toLocaleDateString(pe.localeCode(),a)}return t.note=function(i){return arguments.length?(e=i,t):e},t}var mm=q(()=>{"use strict";Ae();fr();ue();ot();pt()});var OU={};j(OU,{uiNoteHeader:()=>g5});function g5(){var e;function t(r){var n=r.selectAll(".note-header").data(e?[e]:[],function(o){return o.status+o.id});n.exit().remove();var i=n.enter().append("div").attr("class","note-header"),a=i.append("div").attr("class",function(o){return"note-header-icon "+o.status}).classed("new",function(o){return o.id<0});a.append("div").attr("class","preset-icon-28").call(ce("#iD-icon-note","note-fill")),a.each(function(o){var s;o.id<0?s="#iD-icon-plus":o.status==="open"?s="#iD-icon-close":s="#iD-icon-apply",a.append("div").attr("class","note-icon-annotation").attr("title",T("icons.close")).call(ce(s,"icon-annotation"))}),i.append("div").attr("class","note-header-label").html(function(o){return e.isNew()?T.html("note.new"):T.html("note.note")+" "+o.id+" "+(o.status==="closed"?T.html("note.closed"):"")})}return t.note=function(r){return arguments.length?(e=r,t):e},t}var hm=q(()=>{"use strict";ue();ot()});var RU={};j(RU,{uiNoteReport:()=>v5});function v5(){var e;function t(r){var n;de.osm&&e instanceof br&&!e.isNew()&&(n=de.osm.noteReportURL(e));var i=r.selectAll(".note-report").data(n?[n]:[]);i.exit().remove();var a=i.enter().append("a").attr("class","note-report").attr("target","_blank").attr("href",function(o){return o}).call(ce("#iD-icon-out-link","inline"));a.append("span").call(T.append("note.report"))}return t.note=function(r){return arguments.length?(e=r,t):e},t}var gm=q(()=>{"use strict";ue();lr();pt();ot()});var LU={};j(LU,{uiViewOnOSM:()=>vl});function vl(e){var t;function r(n){var i;t instanceof Le?i=e.connection().entityURL(t):t instanceof br&&(i=e.connection().noteURL(t));var a=!t||t.isNew()?[]:[t],o=n.selectAll(".view-on-osm").data(a,function(l){return l.id});o.exit().remove();var s=o.enter().append("a").attr("class","view-on-osm").attr("target","_blank").attr("href",i).call(ce("#iD-icon-out-link","inline"));s.append("span").call(T.append("inspector.view_on_osm"))}return r.what=function(n){return arguments.length?(t=n,r):t},r}var J9=q(()=>{"use strict";ue();lr();ot()});var UU={};j(UU,{uiNoteEditor:()=>yl});function yl(e){var t=xe("change"),r=h5(e),n=g5(),i,a;function o(h){var g=h.selectAll(".header").data([0]),A=g.enter().append("div").attr("class","header fillL");A.append("button").attr("class","close").attr("title",T("icons.close")).on("click",function(){e.enter(Ue(e))}).call(ce("#iD-icon-close")),A.append("h2").call(T.append("note.title"));var v=h.selectAll(".body").data([0]);v=v.enter().append("div").attr("class","body").merge(v);var _=v.selectAll(".note-editor").data([0]);_.enter().append("div").attr("class","modal-section note-editor").merge(_).call(n.note(i)).call(r.note(i)).call(s);var w=h.selectAll(".footer").data([0]);w.enter().append("div").attr("class","footer").merge(w).call(vl(e).what(i)).call(v5(e).note(i));var k=de.osm;k&&k.on("change.note-save",function(){h.call(o)})}function s(h){var g=i&&i.id===e.selectedNoteID(),A=h.selectAll(".note-save").data(g?[i]:[],function(x){return x.status+x.id});A.exit().remove();var v=A.enter().append("div").attr("class","note-save save-section cf");v.append("h4").attr("class",".note-save-header").text("").each(function(){i.isNew()?T.append("note.newDescription")(Q(this)):T.append("note.newComment")(Q(this))});var _=v.append("textarea").attr("class","new-comment-input").attr("placeholder",T("note.inputPlaceholder")).attr("maxlength",1e3).property("value",function(x){return x.newComment}).call(st).on("keydown.note-input",w).on("input.note-input",k).on("blur.note-input",k);!_.empty()&&a&&_.node().focus(),A=v.merge(A).call(l).call(u);function w(x){if(x.keyCode===13&&x.metaKey){var S=de.osm;if(S){var I=S.authenticated();I&&i.newComment&&(x.preventDefault(),Q(this).on("keydown.note-input",null),window.setTimeout(function(){i.isNew()?(A.selectAll(".save-button").node().focus(),f(i)):(A.selectAll(".comment-button").node().focus(),m(i))},10))}}}function k(){var x=Q(this),S=x.property("value").trim()||void 0;i=i.update({newComment:S});var I=de.osm;I&&I.replaceNote(i),A.call(u)}}function l(h){var g=h.selectAll(".detail-section").data([0]);g=g.enter().append("div").attr("class","detail-section").merge(g);var A=de.osm;if(A){var v=A.authenticated(),_=g.selectAll(".auth-warning").data(v?[]:[0]);_.exit().transition().duration(200).style("opacity",0).remove();var w=_.enter().insert("div",".tag-reference-body").attr("class","field-warning auth-warning").style("opacity",0);w.call(ce("#iD-icon-alert","inline")),w.append("span").call(T.append("note.login")),w.append("a").attr("target","_blank").call(ce("#iD-icon-out-link","inline")).append("span").call(T.append("login")).on("click.note-login",function(x){x.preventDefault(),A.authenticate()}),w.transition().duration(200).style("opacity",1);var k=g.selectAll(".note-save-prose").data(v?[0]:[]);k.exit().remove(),k=k.enter().append("p").attr("class","note-save-prose").call(T.append("note.upload_explanation")).merge(k),A.userDetails(function(x,S){if(!x){var I=Q(document.createElement("div"));S.image_url&&I.append("img").attr("src",S.image_url).attr("class","icon pre-text user-icon"),I.append("a").attr("class","user-info").text(S.display_name).attr("href",A.userURL(S.display_name)).attr("target","_blank"),k.html(T.html("note.upload_explanation_with_user",{user:{html:I.html()}}))}})}}function u(h){var g=de.osm,A=g&&g.authenticated(),v=i&&i.id===e.selectedNoteID(),_=h.selectAll(".buttons").data(v?[i]:[],function(x){return x.status+x.id});_.exit().remove();var w=_.enter().append("div").attr("class","buttons");i.isNew()?(w.append("button").attr("class","button cancel-button secondary-action").call(T.append("confirm.cancel")),w.append("button").attr("class","button save-button action").call(T.append("note.save"))):(w.append("button").attr("class","button status-button action"),w.append("button").attr("class","button comment-button action").call(T.append("note.comment"))),_=_.merge(w),_.select(".cancel-button").on("click.cancel",c),_.select(".save-button").attr("disabled",k).on("click.save",f),_.select(".status-button").attr("disabled",A?null:!0).each(function(x){var S=x.status==="open"?"close":"open",I=x.newComment?"_comment":"";T.addOrUpdate("note."+S+I)(Q(this))}).on("click.status",d),_.select(".comment-button").attr("disabled",k).on("click.comment",m);function k(x){return A&&x.status==="open"&&x.newComment?null:!0}}function c(h,g){this.blur();var A=de.osm;A&&A.removeNote(g),e.enter(Ue(e)),t.call("change")}function f(h,g){this.blur();var A=de.osm;A&&A.postNoteCreate(g,function(v,_){t.call("change",_)})}function d(h,g){this.blur();var A=de.osm;if(A){var v=g.status==="open"?"closed":"open";A.postNoteUpdate(g,v,function(_,w){t.call("change",w)})}}function m(h,g){this.blur();var A=de.osm;A&&A.postNoteUpdate(g,g.status,function(v,_){t.call("change",_)})}return o.note=function(h){return arguments.length?(i=h,o):i},o.newNote=function(h){return arguments.length?(a=h,o):a},_e(o,t,"on")}var e8=q(()=>{"use strict";Ye();Ae();ue();pt();Kt();ot();mm();hm();gm();J9();Ie()});var BU={};j(BU,{modeSelectNote:()=>pa});function pa(e,t){var r={id:"select-note",button:"browse"},n=Xe("select-note"),i=yl(e).on("change",function(){e.map().pan([0,0]);var c=s();c&&e.ui().sidebar.show(i.note(c))}),a=[ca(e),Kn(e),ha(e),ga(e),fa(e).behavior,ma(e).behavior],o=!1;function s(){if(de.osm){var c=de.osm.getNote(t);return c||e.enter(Ue(e)),c}}function l(c,f){if(s()){var d=e.surface().selectAll(".layer-notes .note-"+t);if(d.empty()){var m=c&&c.type==="zoom"&&c.sourceEvent;f&&m&&(m.type==="pointermove"||m.type==="mousemove"||m.type==="touchmove")&&e.enter(Ue(e))}else d.classed("selected",!0),e.selectedNoteID(t)}}function u(){e.container().select(".combobox").size()||e.enter(Ue(e))}return r.zoomToSelected=function(){if(de.osm){var c=de.osm.getNote(t);c&&e.map().centerZoomEase(c.loc,20)}},r.newFeature=function(c){return arguments.length?(o=c,r):o},r.enter=function(){var c=s();if(c){a.forEach(e.install),n.on(T("inspector.zoom_to.key"),r.zoomToSelected).on("\u238B",u,!0),Q(document).call(n),l();var f=e.ui().sidebar;f.show(i.note(c).newNote(o)),f.expand(f.intersects(c.extent())),e.map().on("drawn.select",l)}},r.exit=function(){a.forEach(e.uninstall),Q(document).call(n.unbind),e.surface().selectAll(".layer-notes .selected").classed("selected hover",!1),e.map().on("drawn.select",null),e.ui().sidebar.hide(),e.selectedNoteID(null)},r}var y5=q(()=>{"use strict";Ae();rl();$1();xl();wl();ue();Kt();dl();bl();pt();e8();Ie()});var zU={};j(zU,{modeAddNote:()=>b5});function b5(e){var t={id:"add-note",button:"note",description:T.append("modes.add_note.description"),key:T("modes.add_note.key")},r=_o(e).on("click",n).on("cancel",i).on("finish",i);function n(a){var o=de.osm;if(o){var s=br({loc:a,status:"open",comments:[]});o.replaceNote(s),e.map().pan([0,0]),e.selectedNoteID(s.id).enter(pa(e,s.id).newFeature(!0))}}function i(){e.enter(Ue(e))}return t.enter=function(){e.install(r)},t.exit=function(){e.uninstall(r)},t}var x_=q(()=>{"use strict";ue();P2();Kt();y5();lr();pt()});var qU={};j(qU,{JXON:()=>H1});var H1,t8=q(()=>{"use strict";H1=new function(){var e="keyValue",t="keyAttributes",r="@",n=[],i=/^\s*$/,a=/^(?:true|false)$/i;function o(f){return i.test(f)?null:a.test(f)?f.toLowerCase()==="true":isFinite(f)?parseFloat(f):isFinite(Date.parse(f))?new Date(f):f}function s(){}s.prototype.toString=function(){return"null"},s.prototype.valueOf=function(){return null};function l(f){return f===null?new s:f instanceof Object?f:new f.constructor(f)}function u(f,d,m,h){var g=n.length,A=f.hasChildNodes(),v=f.hasAttributes(),_=!!(d&2),w,k,x=0,S="",I=_?{}:!0;if(A)for(var b,y=0;y<f.childNodes.length;y++)b=f.childNodes.item(y),b.nodeType===4?S+=b.nodeValue:b.nodeType===3?S+=b.nodeValue.trim():b.nodeType===1&&!b.prefix&&n.push(b);var E=n.length,M=o(S);!_&&(A||v)&&(I=d===0?l(M):{});for(var F=g;F<E;F++)w=n[F].nodeName.toLowerCase(),k=u(n[F],d,m,h),I.hasOwnProperty(w)?(I[w].constructor!==Array&&(I[w]=[I[w]]),I[w].push(k)):(I[w]=k,x++);if(v){for(var N=f.attributes.length,D=h?"":r,O=h?{}:I,L,P=0;P<N;x++,P++)L=f.attributes.item(P),O[D+L.name.toLowerCase()]=o(L.value.trim());h&&(m&&Object.freeze(O),I[t]=O,x-=N-1)}return d===3||(d===2||d===1&&x>0)&&S?I[e]=M:!_&&x===0&&S&&(I=M),m&&(_||x>0)&&Object.freeze(I),n.length=g,I}function c(f,d,m){var h,g;m instanceof String||m instanceof Number||m instanceof Boolean?d.appendChild(f.createTextNode(m.toString())):m.constructor===Date&&d.appendChild(f.createTextNode(m.toGMTString()));for(var A in m)if(h=m[A],!(isFinite(A)||h instanceof Function))if(A===e)h!==null&&h!==!0&&d.appendChild(f.createTextNode(h.constructor===Date?h.toGMTString():String(h)));else if(A===t)for(var v in h)d.setAttribute(v,h[v]);else if(A.charAt(0)===r)d.setAttribute(A.slice(1),h);else if(h.constructor===Array)for(var _=0;_<h.length;_++)g=f.createElement(A),c(f,g,h[_]),d.appendChild(g);else g=f.createElement(A),h instanceof Object?c(f,g,h):h!==null&&h!==!0&&g.appendChild(f.createTextNode(h.toString())),d.appendChild(g)}this.build=function(f,d,m,h){var g=arguments.length>1&&typeof d=="number"?d&3:1;return u(f,g,m||!1,arguments.length>3?h:g===3)},this.unbuild=function(f){var d=document.implementation.createDocument("","",null);return c(d,d,f),d},this.stringify=function(f){return new XMLSerializer().serializeToString(H1.unbuild(f))}}});var VU={};j(VU,{uiConflicts:()=>w5});function w5(e){var t=xe("cancel","save"),r=Xe("conflicts"),n,i,a;function o(){Q(document).call(r.on("\u238B",u,!0))}function s(){Q(document).call(r.unbind)}function l(){s(),t.call("save")}function u(){s(),t.call("cancel")}function c(g){o();var A=g.selectAll(".header").data([0]).enter().append("div").attr("class","header fillL");A.append("button").attr("class","fr").attr("title",T("icons.close")).on("click",u).call(ce("#iD-icon-close")),A.append("h2").call(T.append("save.conflict.header"));var v=g.selectAll(".body").data([0]).enter().append("div").attr("class","body fillL"),_=v.append("div").attr("class","conflicts-help").call(T.append("save.conflict.help")),w=new qi;delete w.id;var k=H1.stringify(w.osmChangeJXON(n)),x=new Blob([k],{type:"text/xml;charset=utf-8;"}),S="changes.osc",I=_.selectAll(".download-changes").append("a").attr("class","download-changes");I.attr("href",window.URL.createObjectURL(x)).attr("download",S),I.call(ce("#iD-icon-load","inline")).append("span").call(T.append("save.conflict.download_changes")),v.append("div").attr("class","conflict-container fillL3").call(f,0),v.append("div").attr("class","conflicts-done").attr("opacity",0).style("display","none").call(T.append("save.conflict.done"));var b=v.append("div").attr("class","buttons col12 joined conflicts-buttons");b.append("button").attr("disabled",i.length>1).attr("class","action conflicts-button col6").call(T.append("save.title")).on("click.try_again",l),b.append("button").attr("class","secondary-action conflicts-button col6").call(T.append("confirm.cancel")).on("click.cancel",u)}function f(g,A){A=B4(A,i.length),a=A;var v=Q(g.node().parentNode);A===i.length-1&&window.setTimeout(function(){v.select(".conflicts-button").attr("disabled",null),v.select(".conflicts-done").transition().attr("opacity",1).style("display","block")},250);var _=g.selectAll(".conflict").data([i[A]]);_.exit().remove();var w=_.enter().append("div").attr("class","conflict");w.append("h4").attr("class","conflict-count").call(T.append("save.conflict.count",{num:A+1,total:i.length})),w.append("a").attr("class","conflict-description").attr("href","#").text(function(x){return x.name}).on("click",function(x,S){x.preventDefault(),h(S.id)});var k=w.append("div").attr("class","conflict-detail-container");k.append("ul").attr("class","conflict-detail-list").selectAll("li").data(function(x){return x.details||[]}).enter().append("li").attr("class","conflict-detail-item").html(function(x){return x}),k.append("div").attr("class","conflict-choices").call(d),k.append("div").attr("class","conflict-nav-buttons joined cf").selectAll("button").data(["previous","next"]).enter().append("button").attr("class","conflict-nav-button action col6").attr("disabled",function(x,S){return S===0&&A===0||S===1&&A===i.length-1||null}).on("click",function(x,S){x.preventDefault();var I=v.selectAll(".conflict-container"),b=S==="previous"?-1:1;I.selectAll(".conflict").remove(),I.call(f,A+b)}).each(function(x){T.append("save.conflict."+x)(Q(this))})}function d(g){var A=g.append("ul").attr("class","layer-list").selectAll("li").data(function(w){return w.choices||[]}),v=A.enter().append("li").attr("class","layer"),_=v.append("label");_.append("input").attr("type","radio").attr("name",function(w){return w.id}).on("change",function(w,k){var x=this.parentNode.parentNode.parentNode;x.__data__.chosen=k.id,m(w,x,k)}),_.append("span").text(function(w){return w.text}),v.merge(A).each(function(w){var k=this.parentNode;k.__data__.chosen===w.id&&m(null,k,w)})}function m(g,A,v){g&&g.preventDefault(),Q(A).selectAll("li").classed("active",function(k){return k===v}).selectAll("input").property("checked",function(k){return k===v});var _=Me(),w;w=e.graph().hasEntity(v.id),w&&_._extend(w.extent(e.graph())),v.action(),w=e.graph().hasEntity(v.id),w&&_._extend(w.extent(e.graph())),h(v.id,_)}function h(g,A){e.surface().selectAll(".hover").classed("hover",!1);var v=e.graph().hasEntity(g);v&&(A?e.map().trimmedExtent(A):e.map().zoomToEase(v),e.surface().selectAll(Ko([v.id],e.graph())).classed("hover",!0))}return c.conflictList=function(g){return arguments.length?(i=g,c):i},c.origChanges=function(g){return arguments.length?(n=g,c):n},c.shownEntityIds=function(){return i&&typeof a=="number"?[i[a].id]:[]},_e(c,t,"on")}var vm=q(()=>{"use strict";Ye();Ae();ue();t8();He();lr();ot();Ie()});var $U={};j($U,{uiConfirm:()=>Ao});function Ao(e){var t=ci(e);t.select(".modal").classed("modal-alert",!0);var r=t.select(".content");r.append("div").attr("class","modal-section header"),r.append("div").attr("class","modal-section message-text");var n=r.append("div").attr("class","modal-section buttons cf");return t.okButton=function(){return n.append("button").attr("class","button ok-button action").on("click.confirm",function(){t.remove()}).call(T.append("confirm.okay")).node().focus(),t},t}var $2=q(()=>{"use strict";ue();qs()});var GU={};j(GU,{uiPopover:()=>_l});function _l(e){var t=eoe++,r=Q(null),n=function(_){r=_,_.each(d)},i=Et(!1),a=Et("top"),o=Et("center"),s=Et(Q(null)),l,u=Et(""),c=Et(!0),f="PointerEvent"in window?"pointer":"mouse";n.displayType=function(_){return arguments.length?(u=Et(_),n):u},n.hasArrow=function(_){return arguments.length?(c=Et(_),n):c},n.placement=function(_){return arguments.length?(a=Et(_),n):a},n.alignment=function(_){return arguments.length?(o=Et(_),n):o},n.scrollContainer=function(_){return arguments.length?(s=Et(_),n):s},n.content=function(_){return arguments.length?(l=_,n):l},n.isShown=function(){var _=r.select(".popover-"+t);return!_.empty()&&_.classed("in")},n.show=function(){r.each(m)},n.updateContent=function(){r.each(h)},n.hide=function(){r.each(A)},n.toggle=function(){r.each(v)},n.destroy=function(_,w){w=w||".popover-"+t,_.on(f+"enter.popover",null).on(f+"leave.popover",null).on(f+"up.popover",null).on(f+"down.popover",null).on("click.popover",null).attr("title",function(){return this.getAttribute("data-original-title")||this.getAttribute("title")}).attr("data-original-title",null).selectAll(w).remove()},n.destroyAny=function(_){_.call(n.destroy,".popover")};function d(){var _=Q(this),w=i.apply(this,arguments),k=_.selectAll(".popover-"+t).data([0]),x=k.enter().append("div").attr("class","popover popover-"+t+" "+(e||"")).classed("arrowed",c.apply(this,arguments));x.append("div").attr("class","popover-arrow"),x.append("div").attr("class","popover-inner"),k=x.merge(k),w&&k.classed("fade",!0);var S=u.apply(this,arguments);if(S==="hover"){var I;_.on(f+"enter.popover",function(b){if(b.pointerType){if(b.pointerType!=="mouse"){I=b.timeStamp;return}else if(I&&b.timeStamp-I<1500)return}b.buttons===0&&m.apply(this,arguments)}).on(f+"leave.popover",function(){A.apply(this,arguments)}).on("focus.popover",function(){m.apply(this,arguments)}).on("blur.popover",function(){A.apply(this,arguments)})}else S==="clickFocus"&&(_.on(f+"down.popover",function(b){b.preventDefault(),b.stopPropagation()}).on(f+"up.popover",function(b){b.preventDefault(),b.stopPropagation()}).on("click.popover",v),k.attr("tabindex",0).on("blur.popover",function(){_.each(function(){A.apply(this,arguments)})}))}function m(){var _=Q(this),w=_.selectAll(".popover-"+t);w.empty()&&(_.call(n.destroy),_.each(d),w=_.selectAll(".popover-"+t)),w.classed("in",!0);var k=u.apply(this,arguments);k==="clickFocus"&&(_.classed("active",!0),w.node().focus()),_.each(h)}function h(){var _=Q(this);l&&_.selectAll(".popover-"+t+" > .popover-inner").call(l.apply(this,arguments)),g.apply(this,arguments),g.apply(this,arguments),g.apply(this,arguments)}function g(){var _=Q(this),w=_.selectAll(".popover-"+t),k=s&&s.apply(this,arguments),x=k&&!k.empty()&&k.node(),S=x?x.scrollLeft:0,I=x?x.scrollTop:0,b=a.apply(this,arguments);w.classed("left",!1).classed("right",!1).classed("top",!1).classed("bottom",!1).classed(b,!0);var y=o.apply(this,arguments),E=.5;y==="leading"?E=0:y==="trailing"&&(E=1);var M=P(_.node()),F=P(w.node()),N;switch(b){case"top":N={x:M.x+(M.w-F.w)*E,y:M.y-F.h};break;case"bottom":N={x:M.x+(M.w-F.w)*E,y:M.y+M.h};break;case"left":N={x:M.x-F.w,y:M.y+(M.h-F.h)*E};break;case"right":N={x:M.x+M.w,y:M.y+(M.h-F.h)*E};break}if(N){if(x&&(b==="top"||b==="bottom")){var D=N.x;N.x+F.w>x.offsetWidth-10?N.x=x.offsetWidth-10-F.w:N.x<10&&(N.x=10);var O=_.selectAll(".popover-"+t+" > .popover-arrow"),L=Math.min(Math.max(F.w/2-(N.x-D),10),F.w-10);O.style("left",~~L+"px")}w.style("left",~~N.x+"px").style("top",~~N.y+"px")}else w.style("left",null).style("top",null);function P(U){var B=Q(U).style("position");return B==="absolute"||B==="static"?{x:U.offsetLeft-S,y:U.offsetTop-I,w:U.offsetWidth,h:U.offsetHeight}:{x:0,y:0,w:U.offsetWidth,h:U.offsetHeight}}}function A(){var _=Q(this);u.apply(this,arguments)==="clickFocus"&&_.classed("active",!1),_.selectAll(".popover-"+t).classed("in",!1)}function v(){Q(this).select(".popover-"+t).classed("in")?A.apply(this,arguments):m.apply(this,arguments)}return n}var eoe,r8=q(()=>{"use strict";Ae();dt();eoe=0});var WU={};j(WU,{uiTooltip:()=>qe});function qe(e){var t=_l((e||"")+" tooltip").displayType("hover"),r=function(){var a=this.getAttribute("data-original-title");return a||(a=this.getAttribute("title"),this.removeAttribute("title"),this.setAttribute("data-original-title",a),a)},n=Et(null),i=Et(null);return t.title=function(a){return arguments.length?(r=Et(a),t):r},t.heading=function(a){return arguments.length?(n=Et(a),t):n},t.keys=function(a){return arguments.length?(i=Et(a),t):i},t.content(function(){var a=n.apply(this,arguments),o=r.apply(this,arguments),s=i.apply(this,arguments),l=typeof a=="function"?a:c=>c.text(a),u=typeof o=="function"?o:c=>c.text(o);return function(c){var f=c.selectAll(".tooltip-heading").data(a?[a]:[]);f.exit().remove(),f.enter().append("div").attr("class","tooltip-heading").merge(f).text("").call(l);var d=c.selectAll(".tooltip-text").data(o?[o]:[]);d.exit().remove(),d.enter().append("div").attr("class","tooltip-text").merge(d).text("").call(u);var m=c.selectAll(".keyhint-wrap").data(s&&s.length?[0]:[]);m.exit().remove();var h=m.enter().append("div").attr("class","keyhint-wrap");h.append("span").call(T.append("tooltip_keyhint")),m=h.merge(m),m.selectAll("kbd.shortcut").data(s&&s.length?s:[]).enter().append("kbd").attr("class","shortcut").text(function(g){return g})}}),t}var nr=q(()=>{"use strict";dt();ue();r8()});var HU={};j(HU,{uiCombobox:()=>qt});function qt(e,t){var r=xe("accept","cancel","update"),n=e.container(),i=[],a=[],o={},s=null,l=!0,u=!1,c=!1,f=2,d=0,m,h,g=function(v,_){_(a.filter(function(w){var k=w.terms||[];return k.push(w.value),w.key&&k.push(w.key),k.some(function(x){return x.toString().toLowerCase().indexOf(v.toLowerCase())!==-1})}))},A=function(v,_){if(!v||v.empty())return;v.classed("combobox-input",!0).on("focus.combo-input",x).on("blur.combo-input",S).on("keydown.combo-input",y).on("keyup.combo-input",E).on("input.combo-input",M).on("mousedown.combo-input",w).each(function(){var z=this.parentNode,V=this.nextSibling;Q(z).selectAll(".combobox-caret").filter(function(G){return G===v.node()}).data([v.node()]).enter().insert("div",function(){return V}).attr("class","combobox-caret").on("mousedown.combo-caret",function(G){G.preventDefault(),v.node().focus(),w(G)}).on("mouseup.combo-caret",function(G){G.preventDefault(),k(G)})});function w(z){if(z.button===0&&!v.classed("disabled")){d=+new Date;var V=v.property("selectionStart"),G=v.property("selectionEnd");if(V!==G){var W=$e(v);v.node().setSelectionRange(W.length,W.length);return}v.on("mouseup.combo-input",k)}}function k(z){if(v.on("mouseup.combo-input",null),z.button===0&&!v.classed("disabled")&&v.node()===document.activeElement){var V=v.property("selectionStart"),G=v.property("selectionEnd");if(V===G){var W=n.selectAll(".combobox");if(W.empty()||W.datum()!==v.node()){var Y=d;window.setTimeout(function(){Y===d&&O("",function(){I(),P()})},250)}else b()}}}function x(){O("")}function S(){ym=window.setTimeout(b,75)}function I(){b(),n.insert("div",":first-child").datum(v.node()).attr("class","combobox"+(t?" combobox-"+t:"")).style("position","absolute").style("display","block").style("left","0px").on("mousedown.combo-container",function(z){z.preventDefault()}),n.on("scroll.combo-scroll",P,!0)}function b(){QU(n)}function y(z){var V=!n.selectAll(".combobox").empty(),G=v.node()?v.node().tagName.toLowerCase():"";switch(z.keyCode){case 8:case 46:z.stopPropagation(),s=null,P(),v.on("input.combo-input",function(){var W=v.property("selectionStart");v.node().setSelectionRange(W,W),v.on("input.combo-input",M),M(!1)});break;case 9:U(z);break;case 13:z.preventDefault(),z.stopPropagation(),U(z);break;case 38:if(G==="textarea"&&!V)return;z.preventDefault(),G==="input"&&!V&&I(),F(-1);break;case 40:if(G==="textarea"&&!V)return;z.preventDefault(),G==="input"&&!V&&I(),F(1);break}}function E(z){switch(z.keyCode){case 27:B();break}}function M(z){z===void 0&&(z=!0),O(D(),function(V){s=null;var G=v.property("value");if(i.length&&(z&&!V&&v.property("selectionEnd")===G.length&&(s=L()),s||(s=G)),G.length){var W=n.selectAll(".combobox");W.empty()&&I()}else b();P()})}function F(z){if(i.length){for(var V=-1,G=0;G<i.length;G++)if(s&&i[G].value===s){V=G;break}V=Math.max(Math.min(V+z,i.length-1),0),s=i[V].value,$e(v,s),r.call("update")}P(),N()}function N(){var J;var z=n.selectAll(".combobox");if(!z.empty()){var V=n.node().getBoundingClientRect(),G=z.node().getBoundingClientRect();if(G.bottom>V.bottom){var W=_?_.node():v.node();W.scrollIntoView({behavior:"instant",block:"center"}),P()}var Y=z.selectAll(".combobox-option.selected").node();Y&&((J=Y.scrollIntoView)==null||J.call(Y,{behavior:"smooth",block:"nearest"}))}}function D(){var z=v.property("value"),V=v.property("selectionStart"),G=v.property("selectionEnd");return V&&G&&(z=z.substring(0,V)),z}function O(z,V){c=!1,g.call(v,z,function(G,W){c||(i=G,G.forEach(function(Y){o[Y.value]=Y}),V&&V(W))})}function L(){if(!l)return;var z=u?D():D().toLowerCase();if(!z||isFinite(z))return;let V=[];i.forEach(Ce=>{V.push(Ce.value),Ce.key&&Ce.key!==Ce.value&&V.push(Ce.key)});for(var G=-1,W=0;W<V.length;W++){var Y=V[W],J=u?Y:Y.toLowerCase();if(J===z){G=W;break}else G===-1&&J.indexOf(z)===0&&(G=W)}if(G!==-1){var oe=V[G];return v.property("value",oe),v.node().setSelectionRange(z.length,oe.length),r.call("update"),oe}}function P(){if(i.length<f||document.activeElement!==v.node()){b();return}var z=!n.selectAll(".combobox").empty();if(z){var V=n.selectAll(".combobox"),G=V.selectAll(".combobox-option").data(i,function(oe){return oe.value});G.exit().remove(),G.enter().append("a").attr("class",function(oe){return"combobox-option "+(oe.klass||"")}).attr("title",function(oe){return oe.title}).each(function(oe){oe.display?oe.display(Q(this)):Q(this).text(oe.value)}).on("mouseenter",m).on("mouseleave",h).merge(G).classed("selected",function(oe){return oe.value===s||oe.key===s}).on("click.combo-option",U).order();var W=_?_.node():v.node(),Y=n.node().getBoundingClientRect(),J=W.getBoundingClientRect();V.style("left",J.left+5-Y.left+"px").style("width",J.width-10+"px").style("top",J.height+J.top-Y.top+"px")}}function U(z,V){c=!0;var G=v.node();V&&($e(v,V.value),F1(v,"change"));var W=$e(v);G.setSelectionRange(W.length,W.length),V||(V=o[W]),r.call("accept",G,V,W),b()}function B(){c=!0;var z=v.node(),V=$e(v),G=v.property("selectionStart"),W=v.property("selectionEnd");V=V.slice(0,G)+V.slice(W),$e(v,V),z.setSelectionRange(V.length,V.length),r.call("cancel",z),b()}};return A.canAutocomplete=function(v){return arguments.length?(l=v,A):l},A.caseSensitive=function(v){return arguments.length?(u=v,A):u},A.data=function(v){return arguments.length?(a=v,A):a},A.fetcher=function(v){return arguments.length?(g=v,A):g},A.minItems=function(v){return arguments.length?(f=v,A):f},A.itemsMouseEnter=function(v){return arguments.length?(m=v,A):m},A.itemsMouseLeave=function(v){return arguments.length?(h=v,A):h},_e(A,r,"on")}function QU(e){ym&&(window.clearTimeout(ym),ym=void 0),e.selectAll(".combobox").remove(),e.on("scroll.combo-scroll",null)}var ym,xi=q(()=>{"use strict";Ye();Ae();Ie();qt.off=function(e,t){QU(t.container()),e.on("focus.combo-input",null).on("blur.combo-input",null).on("keydown.combo-input",null).on("keyup.combo-input",null).on("input.combo-input",null).on("mousedown.combo-input",null).on("mouseup.combo-input",null),t.container().on("scroll.combo-scroll",null)}});var KU={};j(KU,{helpHtml:()=>ge,icon:()=>tt,isMostlySquare:()=>E_,localize:()=>k_,missingStrings:()=>__,pad:()=>Dt,pointBox:()=>Oa,selectMenuItem:()=>ei,transitionTime:()=>_i});function Oa(e,t){var r=t.surfaceRect(),n=t.curtainProjection(e);return{left:n[0]+r.left-40,top:n[1]+r.top-60,width:80,height:90}}function Dt(e,t,r){var n;if(e instanceof Array){var i=r.surfaceRect(),a=r.curtainProjection(e);n={left:a[0]+i.left,top:a[1]+i.top}}else n=e;return{left:n.left-t,top:n.top-t,width:(n.width||0)+2*t,height:(n.width||0)+2*t}}function tt(e,t,r){return'<svg class="icon '+(t||"")+'"><use xlink:href="'+e+'"'+(r?' class="'+r+'"':"")+"></use></svg>"}function ge(e,t){if(!G2){G2={point_icon:tt("#iD-icon-point","inline"),line_icon:tt("#iD-icon-line","inline"),area_icon:tt("#iD-icon-area","inline"),note_icon:tt("#iD-icon-note","inline add-note"),plus:tt("#iD-icon-plus","inline"),minus:tt("#iD-icon-minus","inline"),layers_icon:tt("#iD-icon-layers","inline"),data_icon:tt("#iD-icon-data","inline"),inspect:tt("#iD-icon-inspect","inline"),help_icon:tt("#iD-icon-help","inline"),undo_icon:tt(pe.textDirection()==="rtl"?"#iD-icon-redo":"#iD-icon-undo","inline"),redo_icon:tt(pe.textDirection()==="rtl"?"#iD-icon-undo":"#iD-icon-redo","inline"),save_icon:tt("#iD-icon-save","inline"),circularize_icon:tt("#iD-operation-circularize","inline operation"),continue_icon:tt("#iD-operation-continue","inline operation"),copy_icon:tt("#iD-operation-copy","inline operation"),delete_icon:tt("#iD-operation-delete","inline operation"),disconnect_icon:tt("#iD-operation-disconnect","inline operation"),downgrade_icon:tt("#iD-operation-downgrade","inline operation"),extract_icon:tt("#iD-operation-extract","inline operation"),merge_icon:tt("#iD-operation-merge","inline operation"),move_icon:tt("#iD-operation-move","inline operation"),orthogonalize_icon:tt("#iD-operation-orthogonalize","inline operation"),paste_icon:tt("#iD-operation-paste","inline operation"),reflect_long_icon:tt("#iD-operation-reflect-long","inline operation"),reflect_short_icon:tt("#iD-operation-reflect-short","inline operation"),reverse_icon:tt("#iD-operation-reverse","inline operation"),rotate_icon:tt("#iD-operation-rotate","inline operation"),split_icon:tt("#iD-operation-split","inline operation"),straighten_icon:tt("#iD-operation-straighten","inline operation"),leftclick:tt("#iD-walkthrough-mouse-left","inline operation"),rightclick:tt("#iD-walkthrough-mouse-right","inline operation"),mousewheel_icon:tt("#iD-walkthrough-mousewheel","inline operation"),tap_icon:tt("#iD-walkthrough-tap","inline operation"),doubletap_icon:tt("#iD-walkthrough-doubletap","inline operation"),longpress_icon:tt("#iD-walkthrough-longpress","inline operation"),touchdrag_icon:tt("#iD-walkthrough-touchdrag","inline operation"),pinch_icon:tt("#iD-walkthrough-pinch-apart","inline operation"),shift:Ze.display("\u21E7"),alt:Ze.display("\u2325"),return:Ze.display("\u21B5"),esc:T.html("shortcuts.key.esc"),space:T.html("shortcuts.key.space"),add_note_key:T.html("modes.add_note.key"),help_key:T.html("help.key"),shortcuts_key:T.html("shortcuts.toggle.key"),save:T.html("save.title"),undo:T.html("undo.title"),redo:T.html("redo.title"),upload:T.html("commit.save"),point:T.html("modes.add_point.title"),line:T.html("modes.add_line.title"),area:T.html("modes.add_area.title"),note:T.html("modes.add_note.label"),circularize:T.html("operations.circularize.title"),continue:T.html("operations.continue.title"),copy:T.html("operations.copy.title"),delete:T.html("operations.delete.title"),disconnect:T.html("operations.disconnect.title"),downgrade:T.html("operations.downgrade.title"),extract:T.html("operations.extract.title"),merge:T.html("operations.merge.title"),move:T.html("operations.move.title"),orthogonalize:T.html("operations.orthogonalize.title"),paste:T.html("operations.paste.title"),reflect_long:T.html("operations.reflect.title.long"),reflect_short:T.html("operations.reflect.title.short"),reverse:T.html("operations.reverse.title"),rotate:T.html("operations.rotate.title"),split:T.html("operations.split.title"),straighten:T.html("operations.straighten.title"),map_data:T.html("map_data.title"),osm_notes:T.html("map_data.layers.notes.title"),fields:T.html("inspector.fields"),tags:T.html("inspector.tags"),relations:T.html("inspector.relations"),new_relation:T.html("inspector.new_relation"),turn_restrictions:T.html("_tagging.presets.fields.restrictions.label"),background_settings:T.html("background.description"),imagery_offset:T.html("background.fix_misalignment"),start_the_walkthrough:T.html("splash.walkthrough"),help:T.html("help.title"),ok:T.html("intro.ok")};for(var r in G2)G2[r]={html:G2[r]}}var n;return t?n=Object.assign(t,G2):n=G2,T.html(e,n).replace(/\`(.*?)\`/g,"<kbd>$1</kbd>")}function jU(e){return e.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}function YU(e,t){if(T(e,{default:void 0})===void 0){if(__.hasOwnProperty(e))return;__[e]=t;var r=e+": "+t;typeof console<"u"&&console.log(r)}}function k_(e){var t,r=e.tags&&e.tags.name;r&&(t="intro.graph.name."+jU(r),e.tags.name=T(t,{default:r}),YU(t,r));var n=e.tags&&e.tags["addr:street"];if(n){t="intro.graph.name."+jU(n),e.tags["addr:street"]=T(t,{default:n}),YU(t,n);var i=["block_number","city","county","district","hamlet","neighbourhood","postcode","province","quarter","state","subdistrict","suburb"];i.forEach(function(a){var o="intro.graph."+a,s="addr:"+a,l=e.tags&&e.tags[s],u=T(o,{default:l});u&&(u.match(/^<.*>$/)!==null?delete e.tags[s]:e.tags[s]=u)})}return e}function E_(e){for(var t=15,r=Math.cos((90-t)*Math.PI/180),n=Math.cos(t*Math.PI/180),i=0;i<e.length;i++){var a=e[(i-1+e.length)%e.length],o=e[i],s=e[(i+1)%e.length],l=k4(a,s,o),u=Math.abs(l);if(u>r&&u<n)return!1}return!0}function ei(e,t){return e.container().select(".edit-menu .edit-menu-item-"+t)}function _i(e,t){var r=wt(e,t);return r===0?0:r<80?500:1e3}var G2,__,So=q(()=>{"use strict";ue();He();Nn();__={}});var XU={};j(XU,{uiFieldHelp:()=>x5});function x5(e,t){var r={},n=Q(null),i=Q(null),a=Q(null),o={restrictions:[["about",["about","from_via_to","maxdist","maxvia"]],["inspecting",["about","from_shadow","allow_shadow","restrict_shadow","only_shadow","restricted","only"]],["modifying",["about","indicators","allow_turn","restrict_turn","only_turn"]],["tips",["simple","simple_example","indirect","indirect_example","indirect_noedit"]]]},s={},l={distField:{html:T.html("restriction.controls.distance")},viaField:{html:T.html("restriction.controls.via")},fromShadow:{html:tt("#iD-turn-shadow","inline shadow from")},allowShadow:{html:tt("#iD-turn-shadow","inline shadow allow")},restrictShadow:{html:tt("#iD-turn-shadow","inline shadow restrict")},onlyShadow:{html:tt("#iD-turn-shadow","inline shadow only")},allowTurn:{html:tt("#iD-turn-yes","inline turn")},restrictTurn:{html:tt("#iD-turn-no","inline turn")},onlyTurn:{html:tt("#iD-turn-only","inline turn")}},u=o[t].map(function(h){var g="help.field."+t+"."+h[0],A=h[1].reduce(function(v,_){var w=g+"."+_,k=s[w],x=k?Array(k+1).join("#")+" ":"";return v+x+T.html(w,l)+`
79
79
 
80
- `},"");return{key:g,title:T.html(g+".title"),html:Ot(A.trim())}});function c(){m(),a.classed("hide",!1).style("opacity","0").transition().duration(200).style("opacity","1")}function f(){a.classed("hide",!0).transition().duration(200).style("opacity","0").on("end",function(){a.classed("hide",!0)})}function d(h){var g=u[h],A=o[t][h][1];a.selectAll(".field-help-nav-item").classed("active",function(_,w){return w===h});var v=a.selectAll(".field-help-content").html(g.html);v.selectAll("p").attr("class",function(_,w){return A[w]}),g.key==="help.field.restrictions.inspecting"?v.insert("img","p.from_shadow").attr("class","field-help-image cf").attr("src",e.imagePath("tr_inspect.gif")):g.key==="help.field.restrictions.modifying"&&v.insert("img","p.allow_turn").attr("class","field-help-image cf").attr("src",e.imagePath("tr_modify.gif"))}r.button=function(h){if(!a.empty()){var g=h.selectAll(".field-help-button").data([0]);g.enter().append("button").attr("class","field-help-button").call(ce("#iD-icon-help")).merge(g).on("click",function(A){A.stopPropagation(),A.preventDefault(),a.classed("hide")?c():f()})}};function m(){var h=i.node(),g=n.node(),A=h.getBoundingClientRect(),v=g.getBoundingClientRect();a.style("top",A.top+g.scrollTop-v.top+"px")}return r.body=function(h){if(i=h.selectAll(".form-field-input-wrap"),!i.empty()&&(n=e.container().select(".sidebar .entity-editor-pane .inspector-body"),!n.empty())){a=n.selectAll(".field-help-body").data([0]);var g=a.enter().append("div").attr("class","field-help-body hide"),A=g.append("div").attr("class","field-help-title cf");A.append("h2").attr("class",pe.textDirection()==="rtl"?"fr":"fl").call(T.append("help.field."+t+".title")),A.append("button").attr("class","fr close").attr("title",T("icons.close")).on("click",function(w){w.stopPropagation(),w.preventDefault(),f()}).call(ce("#iD-icon-close"));var v=g.append("div").attr("class","field-help-nav cf"),_=u.map(function(w){return w.title});v.selectAll(".field-help-nav-item").data(_).enter().append("div").attr("class","field-help-nav-item").html(function(w){return w}).on("click",function(w,k){w.stopPropagation(),w.preventDefault(),d(_.indexOf(k))}),g.append("div").attr("class","field-help-content"),a=a.merge(g),d(0)}},r}var bm=q(()=>{"use strict";Ae();J3();ue();ot();So()});var ZU={};j(ZU,{uiFieldCheck:()=>Vs,uiFieldDefaultCheck:()=>Vs,uiFieldOnewayCheck:()=>Vs});function Vs(e,t){var r=xe("change"),n=e.options,i=[],a=[],o,s=Q(null),l=Q(null),u=Q(null),c=Q(null),f,d=[],m,h=e.resolveReference("stringsCrossReference");if(!n&&h.options&&(n=h.options),n)for(var g in n){var A=n[g];i.push(A==="undefined"?void 0:A),a.push(h.t.html("options."+A,{default:A}))}else i=[void 0,"yes"],a=[T.html("inspector.unknown"),T.html("inspector.check.yes")],e.type!=="defaultCheck"&&(i.push("no"),a.push(T.html("inspector.check.no")));function v(){if(f=e.id==="oneway_yes",e.id==="oneway"){var x=t.entity(d[0]);x.type==="way"&&x.isOneWay()&&(f=!0,a[0]=T.html("_tagging.presets.fields.oneway_yes.options.undefined"))}}function _(){return t.container().select("div.inspector-hover").empty()?!(m==="yes"||f&&!m):!0}function w(x){var S=d.length&&t.hasEntity(d[0]);if(_()||!S)return x;var I=S.first(),b=S.isClosed()?S.nodes[S.nodes.length-2]:S.last(),y=I<b,E=y?"#iD-icon-forward":"#iD-icon-backward";return x.selectAll(".reverser-span").html("").call(T.append("inspector.check.reverser")).call(ce(E,"inline")),x}var k=function(x){v(),u=x.selectAll(".form-field-input-wrap").data([0]);var S=u.enter().append("label").attr("class","form-field-input-wrap form-field-input-check");S.append("input").property("indeterminate",e.type!=="defaultCheck").attr("type","checkbox").attr("id",e.domId),S.append("span").html(a[0]).attr("class","value"),e.type==="onewayCheck"&&S.append("button").attr("class","reverser"+(_()?" hide":"")).append("span").attr("class","reverser-span"),u=u.merge(S),s=u.selectAll("input"),l=u.selectAll("span.value"),s.on("click",function(I){I.stopPropagation();var b={};Array.isArray(o[e.key])?i.indexOf("yes")!==-1?b[e.key]="yes":b[e.key]=i[0]:b[e.key]=i[(i.indexOf(m)+1)%i.length],(b[e.key]==="reversible"||b[e.key]==="alternating")&&(b[e.key]=i[0]),r.call("change",this,b)}),e.type==="onewayCheck"&&(c=u.selectAll(".reverser"),c.call(w).on("click",function(I){I.preventDefault(),I.stopPropagation(),t.perform(function(b){for(var y in d)b=Ji(d[y])(b);return b},T("operations.reverse.annotation.line",{n:1})),t.validator().validate(),Q(this).call(w)}))};return k.entityIDs=function(x){return arguments.length?(d=x,k):d},k.tags=function(x){o=x;function S(y){return y!=="no"&&y!==""&&y!==void 0&&y!==null}function I(y){y===""&&(y=void 0);var E=i.indexOf(y);return E!==-1?a[E]:'"'+y+'"'}v();var b=Array.isArray(x[e.key]);m=!b&&x[e.key]&&x[e.key].toLowerCase(),e.type==="onewayCheck"&&(m==="1"||m==="-1")&&(m="yes"),s.property("indeterminate",b||e.type!=="defaultCheck"&&!m).property("checked",S(m)),l.html(b?T.html("inspector.multiple_values"):I(m)).classed("mixed",b),u.classed("set",!!m),e.type==="onewayCheck"&&c.classed("hide",_()).call(w)},k.focus=function(){s.node().focus()},_e(k,r,"on")}var wm=q(()=>{"use strict";Ye();Ae();Yr();ue();c4();ot()});var eB={};j(eB,{svgMarkerSegments:()=>Q2,svgPassiveVertex:()=>W2,svgPath:()=>Pr,svgPointTransform:()=>jt,svgRelationMemberTags:()=>_5,svgSegmentWay:()=>kl});function W2(e,t,r){if(!r)return 1;if(r===e.id)return 0;var n=t.parentWays(e),i,a,o,s,l,u,c,f,d;for(i=0;i<n.length;i++)for(o=n[i].nodes,s=n[i].isClosed(),a=0;a<o.length;a++)if(o[a]===e.id){if(l=a-2,u=a-1,c=a+1,f=a+2,s&&(d=o.length-1,l<0&&(l=d+l),u<0&&(u=d+u),c>d&&(c=c-d),f>d&&(f=f-d)),o[l]===r)return 0;if(o[u]===r)return 2;if(o[c]===r)return 2;if(o[f]===r)return 0;if(s&&o.indexOf(r)!==-1)return 0}return 1}function Q2(e,t,r,n=()=>!1,i=()=>!1){return function(a){let o=0,s=r/2,l=[],u=JU(e),c=t.childNodes(a).map(function(g){return g.loc}),f,d,m=n(a),h=i(a);return ai({type:"LineString",coordinates:c},e.stream(u({lineStart:function(){},lineEnd:function(){f=null},point:function(g,A){if(d=[g,A],f){let v=ft(f,d)-s;if(v>=0){let _=no(f,d),w=r*Math.cos(_),k=r*Math.sin(_),x=[f[0]+s*Math.cos(_),f[1]+s*Math.sin(_)],S=[f,x];for(v-=r;v>=0;v-=r)x=qr(x,[w,k]),S.push(x);S.push(d);let I="";if(!m||h){for(let b=0;b<S.length;b++)I+=(b===0?"M":"L")+S[b][0]+","+S[b][1];l.push({id:a.id,index:o++,d:I})}if(m||h){I="";for(let b=S.length-1;b>=0;b--)I+=(b===S.length-1?"M":"L")+S[b][0]+","+S[b][1];l.push({id:a.id,index:o++,d:I})}}s=-v}f=d}}))),l}}function Pr(e,t,r){let n={},i=e.stream,a=JU(e,r),o=Pi().projection({stream:function(l){return i(a(l))}}),s=function(l){return l.id in n?n[l.id]:n[l.id]=o(l.asGeoJSON(t))};return s.geojson=function(l){return l.__featurehash__!==void 0?l.__featurehash__ in n?n[l.__featurehash__]:n[l.__featurehash__]=o(l):o(l)},s}function jt(e){var t=function(r){var n=e(r.loc);return"translate("+n[0]+","+n[1]+")"};return t.geojson=function(r){return t(r.properties.entity)},t}function _5(e){return function(t){var r=t.tags,n=!t.hasInterestingTags();return e.parentRelations(t).forEach(function(i){var a=i.tags.type;(a==="multipolygon"&&n||a==="boundary")&&(r=Object.assign({},i.tags,r))}),r}}function kl(e,t,r){if(r===void 0)return t.transient(e,"waySegments",n);return n();function n(){for(var i=e.nodes.indexOf(r)!==-1,a={passive:[],active:[]},o={},s={},l,u,c=0;c<e.nodes.length;c++)l=t.entity(e.nodes[c]),u=W2(l,t,r),s={node:l,type:u},o.type!==void 0&&(o.node.id===r||s.node.id===r||(i&&(o.type===2||s.type===2)||o.type===0&&s.type===0?f(o,s,c):d(o,s,c))),o=s;return a;function f(m,h,g){a.active.push({type:"Feature",id:e.id+"-"+g+"-nope",properties:{nope:!0,target:!0,entity:e,nodes:[m.node,h.node],index:g},geometry:{type:"LineString",coordinates:[m.node.loc,h.node.loc]}})}function d(m,h,g){a.passive.push({type:"Feature",id:e.id+"-"+g,properties:{target:!0,entity:e,nodes:[m.node,h.node],index:g},geometry:{type:"LineString",coordinates:[m.node.loc,h.node.loc]}})}}}function JU(e,t=!1){var r=t?65:5,n=e.clipExtent(),i=[[n[0][0]-r,n[0][1]-r],[n[1][0]+r,n[1][1]+r]];return cb().clipExtent(i).stream}var Tr=q(()=>{"use strict";Ta();He()});var tB={};j(tB,{svgTagClasses:()=>ti});function ti(){var e=["building","highway","railway","waterway","aeroway","aerialway","piste:type","boundary","power","amenity","natural","landuse","leisure","military","place","man_made","route","attraction","roller_coaster","building:part","indoor"],t=Object.keys(M1),r=["oneway","bridge","tunnel","embankment","cutting","barrier","surface","tracktype","footway","crossing","service","sport","public_transport","location","parking","golf","type","leisure","man_made","indoor","construction","proposed"],n=function(a){return a.tags},i=function(a){a.each(function(s){var l=this.className;l.baseVal!==void 0&&(l=l.baseVal);var u=n(s),c=i.getClassesString(u,l);c!==l&&Q(this).attr("class",c)})};return i.getClassesString=function(a,o){var s,l,u,c,f,d,m;/\bstroke\b/.test(o)&&a.barrier&&a.barrier!=="no"&&(m="line");var h=o.trim().split(/\s+/).filter(function(b){return b.length&&!/^(tag|custom)-/.test(b)}).map(function(b){return(b==="line"||b==="area")&&m||b});for(u=0;u<e.length;u++)if(f=e[u],d=a[f],!(!d||d==="no")){f==="piste:type"?f="piste":f==="building:part"&&(f="building_part"),s=f,t.indexOf(d)!==-1?(l=d,h.push("tag-"+f)):(h.push("tag-"+f),h.push("tag-"+f+"-"+d));break}if(!s){for(u=0;u<t.length;u++)for(c=0;c<e.length;c++)if(f=t[u]+":"+e[c],d=a[f],!(!d||d==="no")){l=t[u];break}}if(!l)for(u=0;u<t.length&&(f=t[u],d=a[f],!(!(!d||d==="no")&&(d==="yes"||s&&s===d?l=f:!s&&e.indexOf(d)!==-1&&(l=f,s=d,h.push("tag-"+d)),l)));u++);for(l&&(h.push("tag-status"),h.push("tag-status-"+l)),u=0;u<r.length;u++)f=r[u],d=a[f],!(!d||d==="no"||f===s)&&(h.push("tag-"+f),h.push("tag-"+f+"-"+d));if(s==="highway"&&!uo[a.highway]||s==="aeroway"){var g=a.highway==="track"?"unpaved":"paved";for(f in a)d=a[f],f in m2&&(g=m2[f][d]?"paved":"unpaved"),f in Sd&&Sd[f][d]&&(g="semipaved");h.push("tag-"+g)}var A=a.wikidata||a["flag:wikidata"]||a["brand:wikidata"]||a["network:wikidata"]||a["operator:wikidata"];A&&h.push("tag-wikidata");var v=a["custom:element_type"];v&&(h.push("tag-custom"),h.push("tag-custom-"+v));var _=a["ext:data_change"];_&&(h.push("tag-ext-data-change"),h.push("tag-ext-data-change-"+_));var w=a["ext:addition"];w&&(h.push("tag-ext-addition"),h.push("tag-ext-addition-"+w));var k=a["ext:deletion"];k&&(h.push("tag-ext-deletion"),h.push("tag-ext-deletion-"+k));var x=/^(roadside|paved_shoulder|unpaved_shoulder|sideslope):(left|right|both)$/;for(f in a)if(d=a[f],!(!d||!x.test(f))){var S="highway-"+f.replace(/:/g,"-");h.push(S),h.push(S+"-"+d)}var I=a["custom:visited"];return I==="yes"?h.push("tag-visited"):I==="no"?h.push("tag-unvisited"):I&&h.push("tag-visited-unknown"),h.filter(b=>/^[-_a-z0-9]+$/.test(b)).join(" ").trim()},i.tags=function(a){return arguments.length?(n=a,i):n},i}var El=q(()=>{"use strict";Ae();Dr()});var rB={};j(rB,{svgTagPattern:()=>k5});function k5(e){if(e.building&&e.building!=="no")return null;for(var t in xm){var r=e[t];if(r){if(typeof xm[t]=="string")return"pattern-"+xm[t];var n=xm[t];for(var i in n)if(r===i){var a=n[i];if(typeof a=="string")return"pattern-"+a;for(var o in a){var s=a[o],l=!0;for(var u in s)if(u!=="pattern"){var c=e[u];if(!c||c!==s[u]){l=!1;break}}if(l)return"pattern-"+s.pattern}}}}return null}var xm,_m=q(()=>{"use strict";xm={amenity:{grave_yard:"cemetery",fountain:"water_standing"},landuse:{cemetery:[{religion:"christian",pattern:"cemetery_christian"},{religion:"buddhist",pattern:"cemetery_buddhist"},{religion:"muslim",pattern:"cemetery_muslim"},{religion:"jewish",pattern:"cemetery_jewish"},{pattern:"cemetery"}],construction:"construction",farmland:"farmland",farmyard:"farmyard",forest:[{leaf_type:"broadleaved",pattern:"forest_broadleaved"},{leaf_type:"needleleaved",pattern:"forest_needleleaved"},{leaf_type:"leafless",pattern:"forest_leafless"},{pattern:"forest"}],grave_yard:"cemetery",grass:"grass",landfill:"landfill",meadow:"meadow",military:"construction",orchard:"orchard",quarry:"quarry",vineyard:"vineyard"},leisure:{horse_riding:"farmyard"},natural:{beach:"beach",grassland:"grass",sand:"beach",scrub:"scrub",water:[{water:"pond",pattern:"pond"},{water:"reservoir",pattern:"water_standing"},{pattern:"waves"}],wetland:[{wetland:"marsh",pattern:"wetland_marsh"},{wetland:"swamp",pattern:"wetland_swamp"},{wetland:"bog",pattern:"wetland_bog"},{wetland:"reedbed",pattern:"wetland_reedbed"},{pattern:"wetland"}],wood:[{leaf_type:"broadleaved",pattern:"forest_broadleaved"},{leaf_type:"needleleaved",pattern:"forest_needleleaved"},{leaf_type:"leafless",pattern:"forest_leafless"},{pattern:"forest"}]},golf:{green:"golf_green",tee:"grass",fairway:"grass",rough:"scrub"},surface:{grass:"grass",sand:"beach"}}});var nB={};j(nB,{svgAreas:()=>E5});function E5(e,t){function r(a){var o=k5(a);return o?'url("#ideditor-'+o+'")':""}function n(a,o,s,l){var u=t.getDebug("target")?"pink ":"nocolor ",c=t.getDebug("target")?"red ":"nocolor ",f=Pr(e).geojson,d=t.activeID(),m=t.history().base(),h={targets:[],nopes:[]};s.forEach(function(k){var x=kl(k,o,d);h.targets.push.apply(h.targets,x.passive),h.nopes.push.apply(h.nopes,x.active)});var g=h.targets.filter(f),A=a.selectAll(".area.target-allowed").filter(function(k){return l(k.properties.entity)}).data(g,function(x){return x.id});A.exit().remove();var v=function(k){var x=k.properties.entity.id;return!m.entities[x]||!(0,n8.default)(o.entities[x].nodes,m.entities[x].nodes)?!1:k.properties.nodes.some(function(S){return!m.entities[S.id]||!(0,n8.default)(o.entities[S.id].loc,m.entities[S.id].loc)})};A.enter().append("path").merge(A).attr("d",f).attr("class",function(k){return"way area target target-allowed "+u+k.id}).classed("segment-edited",v);var _=h.nopes.filter(f),w=a.selectAll(".area.target-nope").filter(function(k){return l(k.properties.entity)}).data(_,function(x){return x.id});w.exit().remove(),w.enter().append("path").merge(w).attr("d",f).attr("class",function(k){return"way area target target-nope "+c+k.id}).classed("segment-edited",v)}function i(a,o,s,l){for(var u=Pr(e,o,!0),c={},f=t.history().base(),d=0;d<s.length;d++){var m=s[d];m.geometry(o)==="area"&&(c[m.id]||(c[m.id]={entity:m,area:Math.abs(m.area(o))}))}var h=Object.values(c).filter(function(M){return u(M.entity)});h.sort(function(M,F){return F.area-M.area}),h=h.map(function(E){return E.entity});var g=h.filter(function(E){return E.type==="way"}),A={clip:h,shadow:g,stroke:g,fill:h},v=t.surface().selectAll("defs").selectAll(".clipPath-osm").filter(l).data(A.clip,Le.key);v.exit().remove();var _=v.enter().append("clipPath").attr("class","clipPath-osm").attr("id",function(E){return"ideditor-"+E.id+"-clippath"});_.append("path"),v.merge(_).selectAll("path").attr("d",u);var w=a.selectAll(".layer-osm.areas"),k=a.selectAll(".layer-touch.areas"),x=w.selectAll("g.areagroup").data(["fill","shadow","stroke"]);x=x.enter().append("g").attr("class",function(E){return"areagroup area-"+E}).merge(x);var S=x.selectAll("path").filter(l).data(function(E){return A[E]},Le.key);S.exit().remove();var I=a.selectAll(".area-fill path.area").nodes(),b=Zl(function(E){return-E.__data__.area(o)}).left;function y(E){if(this._parent.__data__==="fill")return I[b(I,-E.area(o))]}S=S.enter().insert("path",y).merge(S).each(function(E){var M=this.parentNode.__data__;this.setAttribute("class",E.type+" area "+M+" "+E.id),M==="fill"&&(this.setAttribute("clip-path","url(#ideditor-"+E.id+"-clippath)"),this.style.fill=this.style.stroke=r(E.tags))}).classed("added",function(E){return!f.entities[E.id]}).classed("geometry-edited",function(E){return o.entities[E.id]&&f.entities[E.id]&&!(0,n8.default)(o.entities[E.id].nodes,f.entities[E.id].nodes)}).classed("retagged",function(E){return o.entities[E.id]&&f.entities[E.id]&&!(0,n8.default)(o.entities[E.id].tags,f.entities[E.id].tags)}).call(ti()).attr("d",u),k.call(n,o,A.stroke,l)}return i}var n8,A_=q(()=>{"use strict";n8=or(go(),1);bn();lr();Tr();El();_m()});var S_=an((qke,iB)=>{"use strict";iB.exports=function(e,t){t||(t={}),typeof t=="function"&&(t={cmp:t});var r=typeof t.cycles=="boolean"?t.cycles:!1,n=t.cmp&&function(a){return function(o){return function(s,l){var u={key:s,value:o[s]},c={key:l,value:o[l]};return a(u,c)}}}(t.cmp),i=[];return function a(o){if(o&&o.toJSON&&typeof o.toJSON=="function"&&(o=o.toJSON()),o!==void 0){if(typeof o=="number")return isFinite(o)?""+o:"null";if(typeof o!="object")return JSON.stringify(o);var s,l;if(Array.isArray(o)){for(l="[",s=0;s<o.length;s++)s&&(l+=","),l+=a(o[s])||"null";return l+"]"}if(o===null)return"null";if(i.indexOf(o)!==-1){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var u=i.push(o)-1,c=Object.keys(o).sort(n&&n(o));for(l="",s=0;s<c.length;s++){var f=c[s],d=a(o[f]);d&&(l&&(l+=","),l+=JSON.stringify(f)+":"+d)}return i.splice(u,1),"{"+l+"}"}}(e)}});function ki(e,t){return Array.from(e.getElementsByTagName(t))}function Em(e){return e[0]==="#"?e:`#${e}`}function toe(e,t,r){return Array.from(e.getElementsByTagNameNS(r,t))}function fi(e){return e==null||e.normalize(),(e==null?void 0:e.textContent)||""}function Gi(e,t,r){let n=e.getElementsByTagName(t),i=n.length?n[0]:null;return i&&r&&r(i),i}function Co(e,t,r){let n={};if(!e)return n;let i=e.getElementsByTagName(t),a=i.length?i[0]:null;return a&&r?r(a,n):n}function j2(e,t,r){let n=fi(Gi(e,t));return n&&r?r(n)||{}:{}}function aB(e,t,r){let n=Number.parseFloat(fi(Gi(e,t)));if(!Number.isNaN(n))return n&&r?r(n)||{}:{}}function H2(e,t,r){let n=Number.parseFloat(fi(Gi(e,t)));if(!Number.isNaN(n))return r&&r(n),n}function i8(e,t){let r={};for(let n of t)j2(e,n,i=>{r[n]=i});return r}function M_(e){return(e==null?void 0:e.nodeType)===1}function oB(e){let t=[];if(e===null)return t;for(let r of Array.from(e.childNodes)){if(!M_(r))continue;let n=roe(r.nodeName);if(n==="gpxtpx:TrackPointExtension")t=t.concat(oB(r));else{let i=fi(r);t.push([n,noe(i)])}}return t}function roe(e){return["heart","gpxtpx:hr","hr"].includes(e)?"heart":e}function noe(e){let t=Number.parseFloat(e);return Number.isNaN(t)?e:t}function sB(e){let t=[Number.parseFloat(e.getAttribute("lon")||""),Number.parseFloat(e.getAttribute("lat")||"")];if(Number.isNaN(t[0])||Number.isNaN(t[1]))return null;H2(e,"ele",n=>{t.push(n)});let r=Gi(e,"time");return{coordinates:t,time:r?fi(r):null,extendedValues:oB(Gi(e,"extensions"))}}function lB(e){return Co(e,"line",t=>Object.assign({},j2(t,"color",n=>({stroke:`#${n}`})),aB(t,"opacity",n=>({"stroke-opacity":n})),aB(t,"width",n=>({"stroke-width":n*96/25.4}))))}function T_(e,t){var i;let r=i8(t,["name","cmt","desc","type","time","keywords"]);for(let[a,o]of e)for(let s of Array.from(t.getElementsByTagNameNS(o,"*")))r[s.tagName.replace(":","_")]=(i=fi(s))==null?void 0:i.trim();let n=ki(t,"link");return n.length&&(r.links=n.map(a=>Object.assign({href:a.getAttribute("href")},i8(a,["text","type"])))),r}function uB(e,t){let r=ki(e,t),n=[],i=[],a={};for(let o=0;o<r.length;o++){let s=sB(r[o]);if(s){n.push(s.coordinates),s.time&&i.push(s.time);for(let[l,u]of s.extendedValues){let c=l==="heart"?l:`${l.replace("gpxtpx:","")}s`;a[c]||(a[c]=Array(r.length).fill(null)),a[c][o]=u}}}if(!(n.length<2))return{line:n,times:i,extendedValues:a}}function ioe(e,t){let r=uB(t,"rtept");if(r)return{type:"Feature",properties:Object.assign({_gpxType:"rte"},T_(e,t),lB(Gi(t,"extensions"))),geometry:{type:"LineString",coordinates:r.line}}}function aoe(e,t){var l;let r=ki(t,"trkseg"),n=[],i=[],a=[];for(let u of r){let c=uB(u,"trkpt");c&&(a.push(c),(l=c.times)!=null&&l.length&&i.push(c.times))}if(a.length===0)return null;let o=a.length>1,s=Object.assign({_gpxType:"trk"},T_(e,t),lB(Gi(t,"extensions")),i.length?{coordinateProperties:{times:o?i:i[0]}}:{});for(let u of a){n.push(u.line),s.coordinateProperties||(s.coordinateProperties={});let c=s.coordinateProperties,f=Object.entries(u.extendedValues);for(let d=0;d<f.length;d++){let[m,h]=f[d];o?(c[m]||(c[m]=a.map(g=>new Array(g.line.length).fill(null))),c[m][d]=h):c[m]=h}}return{type:"Feature",properties:s,geometry:o?{type:"MultiLineString",coordinates:n}:{type:"LineString",coordinates:n[0]}}}function ooe(e,t){let r=Object.assign(T_(e,t),i8(t,["sym"])),n=sB(t);return n?{type:"Feature",properties:r,geometry:{type:"Point",coordinates:n.coordinates}}:null}function*soe(e){var o,s;let t=e,r="gpxx",n="http://www.garmin.com/xmlschemas/GpxExtensions/v3",i=[[r,n]],a=(o=t.getElementsByTagName("gpx")[0])==null?void 0:o.attributes;if(a)for(let l of Array.from(a))(s=l.name)!=null&&s.startsWith("xmlns:")&&l.value!==n&&i.push([l.name,l.value]);for(let l of ki(t,"trk")){let u=aoe(i,l);u&&(yield u)}for(let l of ki(t,"rte")){let u=ioe(i,l);u&&(yield u)}for(let l of ki(t,"wpt")){let u=ooe(i,l);u&&(yield u)}}function cB(e){return{type:"FeatureCollection",features:Array.from(soe(e))}}function fB(e,t){let r={},n=t==="stroke"||t==="fill"?t:`${t}-color`;return e[0]==="#"&&(e=e.substring(1)),e.length===6||e.length===3?r[n]=`#${e}`:e.length===8&&(r[`${t}-opacity`]=Number.parseInt(e.substring(0,2),16)/255,r[n]=`#${e.substring(6,8)}${e.substring(4,6)}${e.substring(2,4)}`),r}function Am(e,t,r){let n={};return H2(e,t,i=>{n[r]=i}),n}function N_(e,t){return Co(e,"color",r=>fB(fi(r),t))}function dB(e){return Co(e,"Icon",(t,r)=>(j2(t,"href",n=>{r.icon=n}),r))}function loe(e){return Co(e,"IconStyle",t=>Object.assign(N_(t,"icon"),Am(t,"scale","icon-scale"),Am(t,"heading","icon-heading"),Co(t,"hotSpot",r=>{let n=Number.parseFloat(r.getAttribute("x")||""),i=Number.parseFloat(r.getAttribute("y")||""),a=r.getAttribute("xunits")||"",o=r.getAttribute("yunits")||"";return!Number.isNaN(n)&&!Number.isNaN(i)?{"icon-offset":[n,i],"icon-offset-units":[a,o]}:{}}),dB(t)))}function uoe(e){return Co(e,"LabelStyle",t=>Object.assign(N_(t,"label"),Am(t,"scale","label-scale")))}function coe(e){return Co(e,"LineStyle",t=>Object.assign(N_(t,"stroke"),Am(t,"width","stroke-width")))}function foe(e){return Co(e,"PolyStyle",(t,r)=>Object.assign(r,Co(t,"color",n=>fB(fi(n),"fill")),j2(t,"fill",n=>{if(n==="0")return{"fill-opacity":0}}),j2(t,"outline",n=>{if(n==="0")return{"stroke-opacity":0}})))}function D_(e){return Object.assign({},foe(e),coe(e),uoe(e),loe(e))}function pB(e){return e.replace(doe,"").split(",").map(Number.parseFloat).filter(t=>!Number.isNaN(t)).slice(0,3)}function C_(e){return e.replace(poe,"").split(moe).map(pB).filter(t=>t.length>=2)}function hoe(e){let t=ki(e,"coord");t.length===0&&(t=toe(e,"coord","*"));let r=t.map(n=>fi(n).split(" ").map(Number.parseFloat));return r.length===0?null:{geometry:r.length>2?{type:"LineString",coordinates:r}:{type:"Point",coordinates:r[0]},times:ki(e,"when").map(n=>fi(n))}}function mB(e){if(e.length===0)return e;let t=e[0],r=e[e.length-1],n=!0;for(let i=0;i<Math.max(t.length,r.length);i++)if(t[i]!==r[i]){n=!1;break}return n?e:e.concat([e[0]])}function km(e){return fi(Gi(e,"coordinates"))}function hB(e){let t=[],r=[];for(let n=0;n<e.childNodes.length;n++){let i=e.childNodes.item(n);if(M_(i))switch(i.tagName){case"MultiGeometry":case"MultiTrack":case"gx:MultiTrack":{let a=hB(i);t=t.concat(a.geometries),r=r.concat(a.coordTimes);break}case"Point":{let a=pB(km(i));a.length>=2&&t.push({type:"Point",coordinates:a});break}case"LinearRing":case"LineString":{let a=C_(km(i));a.length>=2&&t.push({type:"LineString",coordinates:a});break}case"Polygon":{let a=[];for(let o of ki(i,"LinearRing")){let s=mB(C_(km(o)));s.length>=4&&a.push(s)}a.length&&t.push({type:"Polygon",coordinates:a});break}case"Track":case"gx:Track":{let a=hoe(i);if(!a)break;let{times:o,geometry:s}=a;t.push(s),o.length&&r.push(o);break}}}return{geometries:t,coordTimes:r}}function gB(e,t){return Co(e,"ExtendedData",(r,n)=>{for(let i of ki(r,"Data"))n[i.getAttribute("name")||""]=fi(Gi(i,"value"));for(let i of ki(r,"SimpleData")){let a=i.getAttribute("name")||"",o=t[a]||I_.string;n[a]=o(fi(i))}return n})}function vB(e){let t=Gi(e,"description");for(let r of Array.from((t==null?void 0:t.childNodes)||[]))if(r.nodeType===4)return{description:{"@type":"html",value:fi(r)}};return{}}function yB(e){return Co(e,"TimeSpan",t=>({timespan:{begin:fi(Gi(t,"begin")),end:fi(Gi(t,"end"))}}))}function bB(e){return Co(e,"TimeStamp",t=>({timestamp:fi(Gi(t,"when"))}))}function wB(e,t){return j2(e,"styleUrl",r=>(r=Em(r),t[r]?Object.assign({styleUrl:r},t[r]):{styleUrl:r}))}function goe(e){return Gi(e,"gx:LatLonQuad")?{geometry:{type:"Polygon",coordinates:[mB(C_(km(e)))]}}:boe(e)}function yoe(e,t,r){let n=[(e[0]+e[2])/2,(e[1]+e[3])/2];return[t[0].map(i=>{let a=i[1]-n[1],o=i[0]-n[0],s=Math.sqrt(a**2+o**2),l=Math.atan2(a,o)+r*voe;return[n[0]+Math.cos(l)*s,n[1]+Math.sin(l)*s]})]}function boe(e){let t=Gi(e,"LatLonBox");if(t){let r=H2(t,"north"),n=H2(t,"west"),i=H2(t,"east"),a=H2(t,"south"),o=H2(t,"rotation");if(typeof r=="number"&&typeof a=="number"&&typeof n=="number"&&typeof i=="number"){let s=[n,a,i,r],l=[[[n,r],[i,r],[i,a],[n,a],[n,r]]];return typeof o=="number"&&(l=yoe(s,l,o)),{bbox:s,geometry:{type:"Polygon",coordinates:l}}}}return null}function woe(e,t,r,n){var l;let i=goe(e),a=(i==null?void 0:i.geometry)||null;if(!a&&n.skipNullGeometry)return null;let o={type:"Feature",geometry:a,properties:Object.assign({"@geometry-type":"groundoverlay"},i8(e,["name","address","visibility","open","phoneNumber","description"]),vB(e),wB(e,t),D_(e),dB(e),gB(e,r),yB(e),bB(e))};i!=null&&i.bbox&&(o.bbox=i.bbox),((l=o.properties)==null?void 0:l.visibility)!==void 0&&(o.properties.visibility=o.properties.visibility!=="0");let s=e.getAttribute("id");return s!==null&&s!==""&&(o.id=s),o}function xoe(e){return e.length===0?null:e.length===1?e[0]:{type:"GeometryCollection",geometries:e}}function _oe(e,t,r,n){var u;let{coordTimes:i,geometries:a}=hB(e),o=xoe(a);if(!o&&n.skipNullGeometry)return null;let s={type:"Feature",geometry:o,properties:Object.assign(i8(e,["name","address","visibility","open","phoneNumber","description"]),vB(e),wB(e,t),D_(e),gB(e,r),yB(e),bB(e),i.length?{coordinateProperties:{times:i.length===1?i[0]:i}}:{})};((u=s.properties)==null?void 0:u.visibility)!==void 0&&(s.properties.visibility=s.properties.visibility!=="0");let l=e.getAttribute("id");return l!==null&&l!==""&&(s.id=l),s}function koe(e){let t=e.getAttribute("id"),r=e.parentNode;return!t&&M_(r)&&r.localName==="CascadingStyle"&&(t=r.getAttribute("kml:id")||r.getAttribute("id")),Em(t||"")}function Eoe(e){let t={};for(let r of ki(e,"Style"))t[koe(r)]=D_(r);for(let r of ki(e,"StyleMap")){let n=Em(r.getAttribute("id")||"");j2(r,"styleUrl",i=>{i=Em(i),t[i]&&(t[n]=t[i])})}return t}function Aoe(e){let t={};for(let r of ki(e,"SimpleField"))t[r.getAttribute("name")||""]=I_[r.getAttribute("type")||""]||I_.string;return t}function*Soe(e,t={skipNullGeometry:!1}){let r=e,n=Eoe(r),i=Aoe(r);for(let a of ki(r,"Placemark")){let o=_oe(a,n,i,t);o&&(yield o)}for(let a of ki(r,"GroundOverlay")){let o=woe(a,n,i,t);o&&(yield o)}}function xB(e,t={skipNullGeometry:!1}){return{type:"FeatureCollection",features:Array.from(Soe(e,t))}}var doe,poe,moe,A5,I_,voe,_B=q(()=>{doe=/\s*/g,poe=/^\s*|\s*$/g,moe=/\s+/;A5=e=>Number(e),I_={string:e=>e,int:A5,uint:A5,short:A5,ushort:A5,float:A5,double:A5,bool:e=>!!e};voe=Math.PI/180});var AB={};j(AB,{svgData:()=>Al});import Coe from"lodash-es/throttle.js";function Al(e,t,r){var n=Coe(function(){r.call("change")},1e3),i=!0,a=sr(),o=Q(null),s,l,u,c;let f=[".gpx",".kml",".geojson",".json"];function d(){if(kB)return;Io={},a8=!0;function N(D){D.stopPropagation(),D.preventDefault(),D.dataTransfer.dropEffect="copy"}t.container().attr("dropzone","copy").on("drop.svgData",function(D){if(D.stopPropagation(),D.preventDefault(),!!a.filedrop){var O=D.dataTransfer.files[0],L=E(O.name);f.includes(L)&&y.fileList(D.dataTransfer.files)}}).on("dragenter.svgData",N).on("dragexit.svgData",N).on("dragover.svgData",N),kB=!0}function m(){return de.vectorTile&&!s?(s=de.vectorTile,s.event.on("loadedData",n)):!de.vectorTile&&s&&(s=null),s}function h(){A(),o.style("opacity",0).transition().duration(250).style("opacity",1).on("end",function(){r.call("change")})}function g(){n.cancel(),o.transition().duration(250).style("opacity",0).on("end",v)}function A(){o.style("display","block")}function v(){o.selectAll(".viewfield-group").remove(),o.style("display","none")}function _(N){if(!N)return null;if(N.type==="FeatureCollection")for(var D=0;D<N.features.length;D++)w(N.features[D]);else w(N);return N}function w(N){if(N)return N.__featurehash__=fo((0,EB.default)(N)),N}function k(N){return N?N.type==="FeatureCollection"?N.features:[N]:[]}function x(N){return N.__featurehash__}function S(N){return N.geometry.type==="Polygon"||N.geometry.type==="MultiPolygon"}function I(N){return"ideditor-data-"+N.__featurehash__+"-clippath"}function b(N){return["data"+N.__featurehash__,N.geometry.type,S(N)?"area":"",N.__layerID__||""].filter(Boolean).join(" ")}function y(N){var D=m(),O=Pr(e).geojson,L=Pr(e,null,!0).geojson,P=y.hasData();o=N.selectAll(".layer-mapdata").data(a8&&P?[0]:[]),o.exit().remove(),o=o.enter().append("g").attr("class","layer-mapdata").merge(o);var U=t.surface();if(!U||U.empty())return;var B,z;if(u&&D){var V=u;D.loadTiles(V,u,e),B=D.data(V,e)}else B=k(Io);B=B.filter(O),z=B.filter(S);var G=U.selectAll("defs").selectAll(".clipPath-data").data(z,x);G.exit().remove();var W=G.enter().append("clipPath").attr("class","clipPath-data").attr("id",I);W.append("path"),G.merge(W).selectAll("path").attr("d",L);var Y=o.selectAll("g.datagroup").data(["fill","shadow","stroke"]);Y=Y.enter().append("g").attr("class",function(se){return"datagroup datagroup-"+se}).merge(Y);var J={fill:z,shadow:B,stroke:B},oe=Y.selectAll("path").data(function(se){return J[se]},x);oe.exit().remove(),oe=oe.enter().append("path").attr("class",function(se){var ne=this.parentNode.__data__;return"pathdata "+ne+" "+b(se)}).attr("clip-path",function(se){var ne=this.parentNode.__data__;return ne==="fill"?"url(#"+I(se)+")":null}).merge(oe).attr("d",function(se){var ne=this.parentNode.__data__;return ne==="fill"?L(se):O(se)}),o.call(Ce,"label-halo",B).call(Ce,"label",B);function Ce(se,ne,he){var Se=Pi(e),re=he.filter(function(te){return i&&te.properties&&(te.properties.desc||te.properties.name)}),Z=se.selectAll("text."+ne).data(re,x);Z.exit().remove(),Z=Z.enter().append("text").attr("class",function(te){return ne+" "+b(te)}).merge(Z).text(function(te){return te.properties.desc||te.properties.name}).attr("x",function(te){var ye=Se.centroid(te);return ye[0]+11}).attr("y",function(te){var ye=Se.centroid(te);return ye[1]})}}function E(N){if(N){var D=/\.(gpx|kml|(geo)?json|png)$/i,O=N.toLowerCase().match(D);return O&&O.length&&O[0]}}function M(N){return new DOMParser().parseFromString(N,"text/xml")}function F(N){let D=N.properties;for(let O in D){let L=D[O];typeof L=="number"||typeof L=="boolean"||Array.isArray(L)?D[O]=L.toString():L===null?D[O]="null":typeof L=="object"&&(D[O]=JSON.stringify(L))}}return y.setFile=function(N,D){u=null,l=null,Io=null,c=null;var O;switch(N){case".gpx":O=cB(M(D));break;case".kml":O=xB(M(D));break;case".geojson":case".json":O=JSON.parse(D),O.type==="FeatureCollection"?O.features.forEach(F):O.type==="Feature"&&F(O);break}return O=O||{},Object.keys(O).length&&(Io=_(O),c=N+" data file",this.fitZoom()),r.call("change"),this},y.showLabels=function(N){return arguments.length?(i=N,this):i},y.enabled=function(N){return arguments.length?(a8=N,a8?h():g(),r.call("change"),this):a8},y.hasData=function(){var N=Io||{};return!!(u||Object.keys(N).length)},y.template=function(N,D){if(!arguments.length)return u;var O=t.connection();if(O){for(var L=O.imageryBlocklists(),P=!1,U=0,B,z=0;z<L.length&&(B=L[z],P=B.test(N),U++,!P);z++);U||(B=/.*\.google(apis)?\..*\/(vt|kh)[\?\/].*([xyz]=.*){3}.*/,P=B.test(N))}return u=N,l=null,Io=null,c=D||"vectortile:"+N.split(/[?#]/)[0],r.call("change"),this},y.geojson=function(N,D){return arguments.length?(u=null,l=null,Io=null,c=null,N=N||{},Object.keys(N).length&&(Io=_(N),c=D||"unknown.geojson"),r.call("change"),this):Io},y.fileList=function(N){if(!arguments.length)return l;if(u=null,Io=null,c=null,l=N,!N||!N.length)return this;var D=N[0],O=E(D.name),L=new FileReader;return L.onload=function(){return function(P){y.setFile(O,P.target.result)}}(D),L.readAsText(D),this},y.url=function(N,D){u=null,l=null,Io=null,c=null;var O=N.split(/[?#]/)[0],L=E(O)||D;return L?(u=null,L9(N).then(function(P){y.setFile(L,P)}).catch(function(){})):y.template(N),this},y.getSrc=function(){return c||""},y.fitZoom=function(){var N=k(Io);if(N.length){var D=t.map(),O=D.trimmedExtent().polygon(),L=N.reduce(function(U,B){var z=B.geometry;if(!z)return U;var V=z.coordinates;switch(z.type){case"Point":V=[V];case"MultiPoint":case"LineString":break;case"MultiPolygon":V=D1(V);case"Polygon":case"MultiLineString":V=D1(V);break}return Ht(U,V)},[]);if(!ao(O,L,!0)){var P=Me(N0({type:"LineString",coordinates:L}));D.centerZoom(P.center(),D.trimmedExtentZoom(P))}return this}},d(),y}var EB,kB,a8,Io,Sm=q(()=>{"use strict";Ta();wi();Ae();EB=or(S_(),1);_B();He();pt();Tr();Li();Ie();kB=!1,a8=!1});var SB={};j(SB,{svgDebug:()=>Sl});function Sl(e,t){function r(n){let i=t.getDebug("tile"),a=t.getDebug("collision"),o=t.getDebug("imagery"),s=t.getDebug("target"),l=t.getDebug("downloaded"),u=[];i&&u.push({class:"red",label:"tile"}),a&&u.push({class:"yellow",label:"collision"}),o&&u.push({class:"orange",label:"imagery"}),s&&u.push({class:"pink",label:"touchTargets"}),l&&u.push({class:"purple",label:"downloaded"});let c=t.container().select(".main-content").selectAll(".debug-legend").data(u.length?[0]:[]);c.exit().remove(),c=c.enter().append("div").attr("class","fillD debug-legend").merge(c);let f=c.selectAll(".debug-legend-item").data(u,v=>v.label);f.exit().remove(),f.enter().append("span").attr("class",v=>`debug-legend-item ${v.class}`).text(v=>v.label);let d=n.selectAll(".layer-debug").data(o||l?[0]:[]);d.exit().remove(),d=d.enter().append("g").attr("class","layer-debug").merge(d);let m=t.map().extent();it.get("imagery").then(v=>{let w=(o&&v.query.bbox(m.rectangle(),!0)||[]).map(x=>x.features[x.id]),k=d.selectAll("path.debug-imagery").data(w);k.exit().remove(),k.enter().append("path").attr("class","debug-imagery debug orange")}).catch(()=>{});let h=t.connection(),g=[];h&&l&&(g=h.caches("get").tile.rtree.all().map(_=>({type:"Feature",properties:{id:_.id},geometry:{type:"Polygon",coordinates:[[[_.minX,_.minY],[_.minX,_.maxY],[_.maxX,_.maxY],[_.maxX,_.minY],[_.minX,_.minY]]]}})));let A=d.selectAll("path.debug-downloaded").data(l?g:[]);A.exit().remove(),A.enter().append("path").attr("class","debug-downloaded debug purple"),d.selectAll("path").attr("d",Pr(e).geojson)}return r.enabled=function(){return arguments.length?this:t.getDebug("tile")||t.getDebug("collision")||t.getDebug("imagery")||t.getDebug("target")||t.getDebug("downloaded")},r}var Cm=q(()=>{"use strict";An();Tr()});var CB={};j(CB,{svgDefs:()=>S5});function S5(e){var t=Q(null),r=["iD-sprite","maki-sprite","temaki-sprite","fa-sprite","roentgen-sprite","community-sprite"];function n(a){t=a.append("defs");function o(f,d){t.append("marker").attr("id",`ideditor-oneway-marker-${f}`).attr("viewBox","0 0 10 5").attr("refX",4).attr("refY",2.5).attr("markerWidth",2).attr("markerHeight",2).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("class","oneway-marker-path").attr("d","M 6,3 L 0,3 L 0,2 L 6,2 L 5,0 L 10,2.5 L 5,5 z").attr("stroke","none").attr("fill",d).attr("opacity","1")}o("black","#333"),o("white","#fff"),o("gray","#eee");function s(f,d,m){t.append("marker").attr("id","ideditor-sided-marker-"+f).attr("viewBox","0 0 2 2").attr("refX",1).attr("refY",-m).attr("markerWidth",1.5).attr("markerHeight",1.5).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("class","sided-marker-path sided-marker-"+f+"-path").attr("d","M 0,0 L 1,1 L 2,0 z").attr("stroke","none").attr("fill",d)}s("natural","rgb(170, 170, 170)",0),s("coastline","#77dede",1),s("waterway","#77dede",1),s("barrier","#ddd",1),s("man_made","#fff",0),t.append("marker").attr("id","ideditor-viewfield-marker").attr("viewBox","0 0 16 16").attr("refX",8).attr("refY",16).attr("markerWidth",4).attr("markerHeight",4).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("class","viewfield-marker-path").attr("d","M 6,14 C 8,13.4 8,13.4 10,14 L 16,3 C 12,0 4,0 0,3 z").attr("fill","#333").attr("fill-opacity","0.75").attr("stroke","#fff").attr("stroke-width","0.5px").attr("stroke-opacity","0.75"),t.append("marker").attr("id","ideditor-viewfield-marker-wireframe").attr("viewBox","0 0 16 16").attr("refX",8).attr("refY",16).attr("markerWidth",4).attr("markerHeight",4).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("class","viewfield-marker-path").attr("d","M 6,14 C 8,13.4 8,13.4 10,14 L 16,3 C 12,0 4,0 0,3 z").attr("fill","none").attr("stroke","#fff").attr("stroke-width","0.5px").attr("stroke-opacity","0.75");var l=t.selectAll("pattern").data([["beach","dots"],["construction","construction"],["cemetery","cemetery"],["cemetery_christian","cemetery_christian"],["cemetery_buddhist","cemetery_buddhist"],["cemetery_muslim","cemetery_muslim"],["cemetery_jewish","cemetery_jewish"],["farmland","farmland"],["farmyard","farmyard"],["forest","forest"],["forest_broadleaved","forest_broadleaved"],["forest_needleleaved","forest_needleleaved"],["forest_leafless","forest_leafless"],["golf_green","grass"],["grass","grass"],["landfill","landfill"],["meadow","grass"],["orchard","orchard"],["pond","pond"],["quarry","quarry"],["scrub","bushes"],["vineyard","vineyard"],["water_standing","lines"],["waves","waves"],["wetland","wetland"],["wetland_marsh","wetland_marsh"],["wetland_swamp","wetland_swamp"],["wetland_bog","wetland_bog"],["wetland_reedbed","wetland_reedbed"]]).enter().append("pattern").attr("id",function(f){return"ideditor-pattern-"+f[0]}).attr("width",32).attr("height",32).attr("patternUnits","userSpaceOnUse");l.append("rect").attr("x",0).attr("y",0).attr("width",32).attr("height",32).attr("class",function(f){return"pattern-color-"+f[0]}),l.append("image").attr("x",0).attr("y",0).attr("width",32).attr("height",32).attr("xlink:href",function(f){return e.imagePath("pattern/"+f[1]+".png")}),t.selectAll("clipPath").data([12,18,20,32,45]).enter().append("clipPath").attr("id",function(f){return"ideditor-clip-square-"+f}).append("rect").attr("x",0).attr("y",0).attr("width",function(f){return f}).attr("height",function(f){return f});let c=t.selectAll("filter").data(["alpha-slope5"]).enter().append("filter").attr("id",f=>f).filter("#alpha-slope5").append("feComponentTransfer");c.append("feFuncR").attr("type","identity"),c.append("feFuncG").attr("type","identity"),c.append("feFuncB").attr("type","identity"),c.append("feFuncA").attr("type","linear").attr("slope",5),i(r,!0)}function i(a,o){r=Je(r.concat(a));var s=t.selectAll(".spritesheet").data(r);s.enter().append("g").attr("class",function(l){return"spritesheet spritesheet-"+l}).each(function(l){var u=e.imagePath(l+".svg"),c=Q(this).node();Ax(u).then(function(f){c.appendChild(Q(f.documentElement).attr("id","ideditor-"+l).node()),o&&l!=="iD-sprite"&&Q(c).selectAll("path").attr("fill","currentColor")}).catch(function(){})}),s.exit().remove()}return n.addSprites=i,n}var P_=q(()=>{"use strict";wi();Ae();Ie()});var IB={};j(IB,{svgKeepRight:()=>M5});import Ioe from"lodash-es/throttle.js";function M5(e,t,r){let n=Ioe(()=>r.call("change"),1e3),i=12,a=Q(null),o=Q(null),s=!1;function l(A,v){A.attr("class",v).attr("transform","translate(-4, -24)").attr("d","M11.6,6.2H7.1l1.4-5.1C8.6,0.6,8.1,0,7.5,0H2.2C1.7,0,1.3,0.3,1.3,0.8L0,10.2c-0.1,0.6,0.4,1.1,0.9,1.1h4.6l-1.8,7.6C3.6,19.4,4.1,20,4.7,20c0.3,0,0.6-0.2,0.8-0.5l6.9-11.9C12.7,7,12.3,6.2,11.6,6.2z")}function u(){return de.keepRight&&!I5?(I5=de.keepRight,I5.on("loaded",n)):!de.keepRight&&I5&&(I5=null),I5}function c(){s||(s=!0,o.style("display","block"))}function f(){s&&(s=!1,o.style("display","none"),o.selectAll(".qaItem.keepRight").remove(),a.selectAll(".qaItem.keepRight").remove())}function d(){c(),o.style("opacity",0).transition().duration(250).style("opacity",1).on("end interrupt",()=>r.call("change"))}function m(){n.cancel(),o.interrupt(),a.selectAll(".qaItem.keepRight").remove(),o.transition().duration(250).style("opacity",0).on("end interrupt",()=>{f(),r.call("change")})}function h(){if(!s||!C5)return;let A=u(),v=t.selectedErrorID(),_=A?A.getItems(e):[],w=jt(e),k=o.selectAll(".qaItem.keepRight").data(_,y=>y.id);k.exit().remove();let x=k.enter().append("g").attr("class",y=>`qaItem ${y.service} itemId-${y.id} itemType-${y.parentIssueType}`);if(x.append("ellipse").attr("cx",.5).attr("cy",1).attr("rx",6.5).attr("ry",3).attr("class","stroke"),x.append("path").call(l,"shadow"),x.append("use").attr("class","qaItem-fill").attr("width","20px").attr("height","20px").attr("x","-8px").attr("y","-22px").attr("xlink:href","#iD-icon-bolt"),k.merge(x).sort(b).classed("selected",y=>y.id===v).attr("transform",w),a.empty())return;let S=t.getDebug("target")?"pink ":"nocolor ",I=a.selectAll(".qaItem.keepRight").data(_,y=>y.id);I.exit().remove(),I.enter().append("rect").attr("width","20px").attr("height","20px").attr("x","-8px").attr("y","-22px").merge(I).sort(b).attr("class",y=>`qaItem ${y.service} target ${S} itemId-${y.id}`).attr("transform",w);function b(y,E){return y.id===v?1:E.id===v?-1:y.severity==="error"&&E.severity!=="error"?1:E.severity==="error"&&y.severity!=="error"?-1:E.loc[1]-y.loc[1]}}function g(A){let v=u(),_=t.surface();_&&!_.empty()&&(a=_.selectAll(".data-layer.touch .layer-touch.markers")),o=A.selectAll(".layer-keepRight").data(v?[0]:[]),o.exit().remove(),o=o.enter().append("g").attr("class","layer-keepRight").style("display",C5?"block":"none").merge(o),C5&&(v&&~~t.map().zoom()>=i?(c(),v.loadIssues(e),h()):f())}return g.enabled=function(A){return arguments.length?(C5=A,C5?d():(m(),t.selectedErrorID()&&t.enter(Ue(t))),r.call("change"),this):C5},g.supported=()=>!!u(),g}var C5,I5,Im=q(()=>{"use strict";Ae();Kt();Tr();pt();C5=!1});var MB={};j(MB,{svgGeolocate:()=>Ra});function Ra(e){var t=Q(null),r;function n(){Ra.initialized||(Ra.enabled=!1,Ra.initialized=!0)}function i(){t.style("display","block")}function a(){t.transition().duration(250).style("opacity",0)}function o(){t.style("opacity",0).transition().duration(250).style("opacity",1)}function s(){t.style("display","none")}function l(d){return jt(e)(d)}function u(d,m){var h=Ln(d),g=[m[0],m[1]+h],A=e(g),v=e([m[0],m[1]]);return Math.round(v[1]-A[1]).toString()}function c(){var d={loc:[r.coords.longitude,r.coords.latitude]},m=t.selectAll(".geolocations").selectAll(".geolocation").data([d]);m.exit().remove();var h=m.enter().append("g").attr("class","geolocation");h.append("circle").attr("class","geolocate-radius").attr("dx","0").attr("dy","0").attr("fill","rgb(15,128,225)").attr("fill-opacity","0.3").attr("r","0"),h.append("circle").attr("dx","0").attr("dy","0").attr("fill","rgb(15,128,225)").attr("stroke","white").attr("stroke-width","1.5").attr("r","6"),m.merge(h).attr("transform",l),t.select(".geolocate-radius").attr("r",u(r.coords.accuracy,d.loc))}function f(d){var m=Ra.enabled;t=d.selectAll(".layer-geolocate").data([0]),t.exit().remove();var h=t.enter().append("g").attr("class","layer-geolocate").style("display",m?"block":"none");h.append("g").attr("class","geolocations"),t=h.merge(t),m?c():s()}return f.enabled=function(d,m){return arguments.length?(r=d,Ra.enabled=m,Ra.enabled?(i(),o()):a(),this):Ra.enabled},n(),f}var Mm=q(()=>{"use strict";Ae();Tr();He()});var TB={};j(TB,{svgLabels:()=>T5});import Moe from"lodash-es/throttle.js";function T5(e,t){var r=Pi(e),n=sr(),i=n.ie||n.browser.toLowerCase()==="edge"||n.browser.toLowerCase()==="firefox"&&n.version>=70,a=new zt,o=new zt,s={},l={},u=[["line","aeroway","*",12],["line","highway","motorway",12],["line","highway","trunk",12],["line","highway","primary",12],["line","highway","secondary",12],["line","highway","tertiary",12],["line","highway","*",12],["line","railway","*",12],["line","waterway","*",12],["area","aeroway","*",12],["area","amenity","*",12],["area","building","*",12],["area","historic","*",12],["area","leisure","*",12],["area","man_made","*",12],["area","natural","*",12],["area","shop","*",12],["area","tourism","*",12],["area","camp_site","*",12],["point","aeroway","*",10],["point","amenity","*",10],["point","building","*",10],["point","historic","*",10],["point","leisure","*",10],["point","man_made","*",10],["point","natural","*",10],["point","shop","*",10],["point","tourism","*",10],["point","camp_site","*",10],["line","ref","*",12],["area","ref","*",12],["point","ref","*",10],["line","name","*",12],["area","name","*",12],["point","name","*",10]];function c(S){var I=["building","landuse","natural"];return I.some(function(b){return S.id.indexOf(b)>=0})}function f(S,I){return function(b,y){return S[y][I]}}function d(S,I,b){var y=s[I];if(y||(y=s[I]={}),y[S])return y[S];if(b)return y[S]=b.getComputedTextLength(),y[S];var E=encodeURIComponent(S).match(/%[CDEFcdef]/g);return E===null?I/3*2*S.length:I/3*(2*S.length+E.length)}function m(S,I,b,y,E){var M=S.selectAll("path").filter(b).data(I,Le.key);M.exit().remove(),M.enter().append("path").style("stroke-width",f(E,"font-size")).attr("id",function(F){return"ideditor-labelpath-"+F.id}).attr("class",y).merge(M).attr("d",f(E,"lineString"))}function h(S,I,b,y,E){var M=S.selectAll("text."+y).filter(b).data(I,Le.key);M.exit().remove(),M.enter().append("text").attr("class",function(F,N){return y+" "+E[N].classes+" "+F.id}).attr("dy",i?"0.35em":null).append("textPath").attr("class","textpath"),S.selectAll("text."+y).selectAll(".textpath").filter(b).data(I,Le.key).attr("startOffset","50%").attr("xlink:href",function(F){return"#ideditor-labelpath-"+F.id}).text(w2)}function g(S,I,b,y,E){var M=S.selectAll("text."+y).filter(b).data(I,Le.key);M.exit().remove(),M.enter().append("text").attr("class",function(F,N){return y+" "+E[N].classes+" "+F.id}).merge(M).attr("x",f(E,"x")).attr("y",f(E,"y")).style("text-anchor",f(E,"textAnchor")).text(hr).each(function(F,N){d(hr(F),E[N].height,this)})}function A(S,I,b,y,E){I=I.filter(M),E=E.filter(M),g(S,I,b,y,E);function M(F,N){return E[N].hasOwnProperty("x")&&E[N].hasOwnProperty("y")}}function v(S,I,b,y,E){var M=S.selectAll("use."+y).filter(b).data(I,Le.key);M.exit().remove(),M.enter().append("use").attr("class","icon "+y).attr("width","17px").attr("height","17px").merge(M).attr("transform",f(E,"transform")).attr("xlink:href",function(F){var N=Pe.match(F,t.graph()),D=N&&N.icon;return D?"#"+D:""})}function _(S,I,b){var y="debug "+b+" "+(b==="debug-skipped"?"orange":"yellow"),E=[];t.getDebug("collision")&&(E=I.all().map(function(F){return{type:"Polygon",coordinates:[[[F.minX,F.minY],[F.maxX,F.minY],[F.maxX,F.maxY],[F.minX,F.maxY],[F.minX,F.minY]]]}}));var M=S.selectAll("."+b).data(E);M.exit().remove(),M.enter().append("path").attr("class",y).merge(M).attr("d",Pi())}function w(S,I,b,y,E,M){var F=t.surface().classed("fill-wireframe"),N=Yt(e.scale()),D=[],O={},L,P,U,B,z;for(L=0;L<u.length;L++)D.push([]);if(M)a.clear(),o.clear(),l={};else for(L=0;L<b.length;L++){B=b[L];var V=[].concat(l[B.id]||[]).concat(l[B.id+"I"]||[]);for(P=0;P<V.length;P++)a.remove(V[P]),o.remove(V[P])}for(L=0;L<b.length;L++){if(B=b[L],z=B.geometry(I),z==="point"||z==="vertex"&&ve(B)){var G=B.directions(I,e).length,W;!F&&z==="point"&&!(N>=18&&G)?(O[B.id]="point",W=20):(O[B.id]="vertex",W=0);var Y=e(B.loc),J=10,oe={minX:Y[0]-J,minY:Y[1]-J-W,maxX:Y[0]+J,maxY:Y[1]+J};Ve(oe,B.id+"P")}z==="vertex"&&(z="point");var Ce=z==="area"&&Pe.match(B,I),se=Ce&&!c(Ce)&&Ce.icon;if(!(!se&&!hr(B)))for(U=0;U<u.length;U++){var ne=u[U][0],he=u[U][1],Se=u[U][2],re=B.tags[he];if(z===ne&&re&&(Se==="*"||Se===re)){D[U].push(B);break}}}var Z={point:[],line:[],area:[]},te={point:[],line:[],area:[]};for(U=0;U<D.length;U++){var ye=u[U][3];for(L=0;L<D[U].length;L++){B=D[U][L],z=B.geometry(I);var we=z==="line"?w2:hr,Ne=we(B),Be=Ne&&d(Ne,ye),le=null;if(z==="point"||z==="vertex"){if(F)continue;var ie=O[B.id];if(ie==="vertex"&&N<17)continue;le=be(B,Be,ye,ie)}else z==="line"?le=Te(B,Be,ye):z==="area"&&(le=Oe(B,Be,ye));le&&(z==="vertex"&&(z="point"),le.classes=z+" tag-"+u[U][1],Z[z].push(le),te[z].push(B))}}function ve(lt){var vt=t.selectedIDs();return lt.hasInterestingTags()||lt.isEndpoint(I)||lt.isConnected(I)||vt.indexOf(lt.id)!==-1||I.parentWays(lt).some(function(_t){return vt.indexOf(_t.id)!==-1})}function be(lt,vt,_t,wr){var tn=wr==="point"?-12:0,rn={ltr:[15,tn,"start"],rtl:[-15,tn,"end"]},Si=pe.textDirection(),Fo=e(lt.loc),hn=2,Ci=rn[Si],gn={height:_t,width:vt,x:Fo[0]+Ci[0],y:Fo[1]+Ci[1],textAnchor:Ci[2]},Ha;if(Si==="rtl"?Ha={minX:gn.x-vt-hn,minY:gn.y-_t/2-hn,maxX:gn.x+hn,maxY:gn.y+_t/2+hn}:Ha={minX:gn.x-hn,minY:gn.y-_t/2-hn,maxX:gn.x+vt+hn,maxY:gn.y+_t/2+hn},Qe([Ha],lt.id,!0))return gn}function Te(lt,vt,_t){var wr=Me(t.projection.clipExtent()).polygon(),tn=I.childNodes(lt).map(function(Fn){return e(Fn.loc)}),rn=qo(tn);if(rn<vt+20)return;for(var Si=[50,45,55,40,60,35,65,30,70,25,75,20,80,15,95,10,90,5,95],Fo=3,hn=0;hn<Si.length;hn++){var Ci=Si[hn],gn=Ci/100*rn,Ha=gn-vt/2;if(!(Ha<0||Ha+vt>rn)){var Hi=ov(tn,Ha,Ha+vt);if(!(!Hi||!ao(wr,Hi,!0))){var ns=iv(Hi);ns&&(Hi=Hi.reverse());for(var ba=[],wa=(_t+2)/2,Xs=0;Xs<Hi.length-1;Xs++)for(var gc=Hi[Xs],f0=Hi[Xs+1],vc=Math.max(1,Math.floor(ft(gc,f0)/wa/2)),Rl=0;Rl<vc;Rl++){var d0=Qt(gc,f0,Rl/vc),yc=d0[0]-wa-Fo,bc=d0[1]-wa-Fo,wc=d0[0]+wa+Fo,xc=d0[1]+wa+Fo;ba.push({minX:Math.min(yc,wc),minY:Math.min(bc,xc),maxX:Math.max(yc,wc),maxY:Math.max(bc,xc)})}if(Qe(ba,lt.id,!1))return{"font-size":_t+2,lineString:av(Hi),startOffset:Ci+"%"}}}}function iv(Fn){var Ll=Math.atan2(Fn[1][1]-Fn[0][1],Fn[1][0]-Fn[0][0]);return!(Fn[0][0]<Fn[Fn.length-1][0]&&Ll<Math.PI/2&&Ll>-Math.PI/2)}function av(Fn){return"M"+Fn.join("L")}function ov(Fn,Ll,_c){for(var Ul=0,A6,S6,kc,Bl,Zs=0;Zs<Fn.length-1;Zs++){var ji=Fn[Zs],zl=Fn[Zs+1],ql=ft(ji,zl),Js;!A6&&Ul+ql>=Ll&&(Js=(Ll-Ul)/ql,A6=[ji[0]+Js*(zl[0]-ji[0]),ji[1]+Js*(zl[1]-ji[1])],kc=Zs+1),!S6&&Ul+ql>=_c&&(Js=(_c-Ul)/ql,S6=[ji[0]+Js*(zl[0]-ji[0]),ji[1]+Js*(zl[1]-ji[1])],Bl=Zs+1),Ul+=ql}var p0=Fn.slice(kc,Bl);return p0.unshift(A6),p0.push(S6),p0}}function Oe(lt,vt,_t){var wr=r.centroid(lt.asGeoJSON(I)),tn=lt.extent(I),rn=e(tn[1])[0]-e(tn[0])[0];if(isNaN(wr[0])||rn<20)return;var Si=Pe.match(lt,t.graph()),Fo=Si&&Si.icon,hn=17,Ci=2,gn={};if(Fo){if(Ha())return Hi(hn+Ci),gn}else if(Hi(0))return gn;function Ha(){var ns=wr[0]-hn/2,ba=wr[1]-hn/2,wa={minX:ns,minY:ba,maxX:ns+hn,maxY:ba+hn};return Qe([wa],lt.id+"I",!0)?(gn.transform="translate("+ns+","+ba+")",!0):!1}function Hi(ns){if(vt&&rn>=vt+20){var ba=wr[0],wa=wr[1]+ns,Xs={minX:ba-vt/2-Ci,minY:wa-_t/2-Ci,maxX:ba+vt/2+Ci,maxY:wa+_t/2+Ci};if(Qe([Xs],lt.id,!0))return gn.x=ba,gn.y=wa,gn.textAnchor="middle",gn.height=_t,!0}return!1}}function Ve(lt,vt){lt.id=vt;var _t=l[vt];_t&&a.remove(_t),l[vt]=lt,a.insert(lt)}function Qe(lt,vt,_t){for(var wr=!1,tn=0;tn<lt.length;tn++){var rn=lt[tn];if(rn.id=vt,rn.minX<0||rn.minY<0||rn.maxX>E[0]||rn.maxY>E[1]){wr=!0;break}if(a.collides(rn)){wr=!0;break}}return l[vt]=lt,wr?_t&&o.load(lt):a.load(lt),!wr}var ct=S.selectAll(".layer-osm.labels");ct.selectAll(".labels-group").data(["halo","label","debug"]).enter().append("g").attr("class",function(lt){return"labels-group "+lt});var rt=ct.selectAll(".labels-group.halo"),We=ct.selectAll(".labels-group.label"),Rt=ct.selectAll(".labels-group.debug");g(We,te.point,y,"pointlabel",Z.point),g(rt,te.point,y,"pointlabel-halo",Z.point),m(ct,te.line,y,"",Z.line),h(We,te.line,y,"linelabel",Z.line),h(rt,te.line,y,"linelabel-halo",Z.line),A(We,te.area,y,"arealabel",Z.area),A(rt,te.area,y,"arealabel-halo",Z.area),v(We,te.area,y,"areaicon",Z.area),v(rt,te.area,y,"areaicon-halo",Z.area),_(Rt,o,"debug-skipped"),_(Rt,a,"debug-drawn"),ct.call(k)}function k(S){var I=S.selectAll(".layer-osm.labels"),b=I.selectAll(".labels-group.halo, .labels-group.label");b.selectAll(".nolabel").classed("nolabel",!1);var y=t.map().mouse(),E=t.graph(),M=t.selectedIDs(),F=[],N,D;if(y){N=20,D={minX:y[0]-N,minY:y[1]-N,maxX:y[0]+N,maxY:y[1]+N};var O=a.search(D).map(function(V){return V.id});F.push.apply(F,O)}for(var L=0;L<M.length;L++){var P=E.hasEntity(M[L]);P&&P.type==="node"&&F.push(M[L])}b.selectAll(Ui(F)).classed("nolabel",!0);var U=S.selectAll(".labels-group.debug"),B=[];t.getDebug("collision")&&(B=D?[{type:"Polygon",coordinates:[[[D.minX,D.minY],[D.maxX,D.minY],[D.maxX,D.maxY],[D.minX,D.maxY],[D.minX,D.minY]]]}]:[]);var z=U.selectAll(".debug-mouse").data(B);z.exit().remove(),z.enter().append("path").attr("class","debug debug-mouse yellow").merge(z).attr("d",Pi())}var x=Moe(k,100);return w.observe=function(S){var I=function(){x(S)};S.on("mousemove.hidelabels",I),t.on("enter.hidelabels",I)},w.off=function(S){x.cancel(),S.on("mousemove.hidelabels",null),t.on("enter.hidelabels",null)},w}var F_=q(()=>{"use strict";Ta();Fa();ue();He();At();lr();Li();Ie()});var PB={};j(PB,{default:()=>Y2});function Toe(e){let t=e.transform;L_.call(Bn,t.x,t.y,t.k)}function DB(e,t){return new Promise(r=>{e.attr("src",t),e.on("load",()=>{r(e)})})}var NB,O_,L_,Tm,R_,Y2,o8=q(()=>{"use strict";Ye();xs();Ie();NB=xe("viewerChanged"),R_=Qo().extent([[0,0],[320,240]]).translateExtent([[0,0],[320,240]]).scaleExtent([1,15]);Y2={init:async function(e,t){return this.event=_e(this,NB,"on"),Tm=t,Tm.call(R_.on("zoom",Toe)),L_=Tm.append("div").attr("class","photo-frame plane-frame").classed("hide",!0),O_=L_.append("img").attr("class","plane-photo"),e.ui().photoviewer.on("resize.plane",function(r){R_.extent([[0,0],r]).translateExtent([[0,0],r])}),await Promise.resolve(),this},showPhotoFrame:function(e){return e.selectAll(".photo-frame.plane-frame.hide").size()&&(e.selectAll(".photo-frame:not(.plane-frame)").classed("hide",!0),e.selectAll(".photo-frame.plane-frame").classed("hide",!1)),this},hidePhotoFrame:function(e){return e.select("photo-frame.plane-frame").classed("hide",!1),this},selectPhoto:function(e){return NB.call("viewerChanged"),DB(O_,""),DB(O_,e.image_path).then(()=>{Tm.call(R_.transform,Qr)}),this},getYaw:function(){return 0}}});var OB={};j(OB,{svgLocalPhotos:()=>B_});import Noe from"exifr";import{isArray as U_,isNumber as s8}from"lodash-es";function B_(e,t,r){let n=sr(),i=Q(null),a,o=[],s=0,l,u;function c(){if(FB)return;Nm=!0;function S(I){I.stopPropagation(),I.preventDefault(),I.dataTransfer.dropEffect="copy"}t.container().attr("dropzone","copy").on("drop.svgLocalPhotos",function(I){I.stopPropagation(),I.preventDefault(),n.filedrop&&v.fileList(I.dataTransfer.files,b=>{b.length>0&&v.fitZoom(!1)})}).on("dragenter.svgLocalPhotos",S).on("dragexit.svgLocalPhotos",S).on("dragover.svgLocalPhotos",S),FB=!0}function f(S){if(l)return Promise.resolve(l);let b=S.container().select(".photoviewer").selectAll(".local-photos-wrapper").data([0]).enter().append("div").attr("class","photo-wrapper local-photos-wrapper").classed("hide",!0);b.append("div").attr("class","photo-attribution photo-attribution-dual fillD");let y=b.append("div").attr("class","photo-controls-wrap").append("div").attr("class","photo-controls-local");return y.append("button").classed("back",!0).on("click.back",()=>d(-1)).text("\u25C0"),y.append("button").classed("forward",!0).on("click.forward",()=>d(1)).text("\u25B6"),Y2.init(S,b).then(E=>{l=E})}function d(S){if(!o||o.length===0)return;u===void 0&&(u=0);let I=u+S;u=Math.max(0,Math.min(o.length-1,I)),m(null,o[u],!1)}function m(S,I,b){u=o.indexOf(I),f(t).then(()=>{let y=t.container().select(".photoviewer").datum(I).classed("hide",!1),E=y.select(".local-photos-wrapper").classed("hide",!1),M=y.select(".photo-controls-wrap");M.select(".back").attr("disabled",u<=0?!0:null),M.select(".forward").attr("disabled",u>=o.length-1?!0:null);let F=E.selectAll(".photo-attribution").text("");I.date&&F.append("span").text(I.date.toLocaleString(pe.localeCode())),I.name&&F.append("span").classed("filename",!0).text(I.name),l.selectPhoto({image_path:""}),I.getSrc().then(N=>{l.selectPhoto({image_path:N}).showPhotoFrame(E),g()})}),b&&t.map().centerEase(I.loc)}function h(S){var I=e(S.loc);return"translate("+I[0]+","+I[1]+")"}function g(S){let I=t.container().select(".photoviewer"),b=I.empty()?void 0:I.datum();t.container().selectAll(".layer-local-photos .viewfield-group").classed("hovered",y=>y.id===(S==null?void 0:S.id)).classed("highlighted",y=>y.id===(S==null?void 0:S.id)||y.id===(b==null?void 0:b.id)).classed("currentView",y=>y.id===(b==null?void 0:b.id))}function A(S){S=S.filter(F=>U_(F.loc)&&s8(F.loc[0])&&s8(F.loc[1]));let I=i.selectAll(".markers").selectAll(".viewfield-group").data(S,function(F){return F.id});I.exit().remove();let b=I.enter().append("g").attr("class","viewfield-group").on("mouseenter",(F,N)=>g(N)).on("mouseleave",()=>g(null)).on("click",m);b.append("g").attr("class","viewfield-scale");let y=I.merge(b).attr("transform",h).select(".viewfield-scale");y.selectAll("circle").data([0]).enter().append("circle").attr("dx","0").attr("dy","0").attr("r","6");let E=t.map().zoom()>=Doe,M=y.selectAll(".viewfield").data(E?[0]:[]);M.exit().remove(),M.enter().insert("path","circle").attr("class","viewfield").attr("transform",function(){var N;let F=this.parentNode.__data__;return`rotate(${Math.round((N=F.direction)!=null?N:0)},0,0),scale(1.5,1.5),translate(-8,-13)`}).attr("d","M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z").style("visibility",function(){let F=this.parentNode.__data__;return s8(F.direction)?"visible":"hidden"})}function v(S){i=S.selectAll(".layer-local-photos").data(o?[0]:[]),i.exit().remove();let I=i.enter().append("g").attr("class","layer-local-photos");I.append("g").attr("class","markers"),i=I.merge(i),o&&A(o)}function _(S){return new Promise((I,b)=>{let y=new FileReader;y.onload=()=>I(y.result),y.onerror=E=>b(E),y.readAsDataURL(S)})}async function w(S,I){let b=[];for(let y of S)try{let E=await Noe.parse(y),M={id:s++,name:y.name,getSrc:()=>_(y),file:y,loc:[E.longitude,E.latitude],direction:E.GPSImgDirection,date:E.CreateDate||E.DateTimeOriginal||E.ModifyDate};b.push(M);let F=o.filter(N=>N.name===M.name);if(F.length===0)o.push(M);else{let N=await M.getSrc();(await Promise.allSettled(F.map(O=>O.getSrc()))).some(O=>O.value===N)||o.push(M)}}catch{}typeof I=="function"&&I(b),r.call("change")}v.setFiles=function(S,I){return w(Array.from(S),I),this},v.fileList=function(S,I){return arguments.length?(a=S,!S||!S.length?this:(v.setFiles(a,I),this)):a},v.getPhotos=function(){return o},v.removePhoto=function(S){return o=o.filter(I=>I.id!==S),r.call("change"),o},v.openPhoto=m,v.fitZoom=function(S){let I=o.map(M=>M.loc).filter(M=>U_(M)&&s8(M[0])&&s8(M[1]));if(I.length===0)return;let b=I.map(M=>Me(M,M)).reduce((M,F)=>M.extend(F)),y=t.map();var E=y.trimmedExtent().polygon();(S!==!1||!ao(E,I,!0))&&y.centerZoom(b.center(),Math.min(18,y.trimmedExtentZoom(b)))};function k(){i.style("display","block"),i.style("opacity",0).transition().duration(250).style("opacity",1).on("end",function(){r.call("change")})}function x(){i.transition().duration(250).style("opacity",0).on("end",()=>{i.selectAll(".viewfield-group").remove(),i.style("display","none")})}return v.enabled=function(S){return arguments.length?(Nm=S,Nm?k():x(),r.call("change"),this):Nm},v.hasData=function(){return U_(o)&&o.length>0},c(),v}var FB,Nm,Doe,z_=q(()=>{"use strict";Ae();ue();Li();He();o8();FB=!1,Nm=!1,Doe=16});var RB={};j(RB,{svgOsmose:()=>q_});import Poe from"lodash-es/throttle.js";function q_(e,t,r){let n=Poe(()=>r.call("change"),1e3),i=12,a=Q(null),o=Q(null),s=!1;function l(A,v){A.attr("class",v).attr("transform","translate(-10, -28)").attr("points","16,3 4,3 1,6 1,17 4,20 7,20 10,27 13,20 16,20 19,17.033 19,6")}function u(){return de.osmose&&!D5?(D5=de.osmose,D5.on("loaded",n)):!de.osmose&&D5&&(D5=null),D5}function c(){s||(s=!0,o.style("display","block"))}function f(){s&&(s=!1,o.style("display","none"),o.selectAll(".qaItem.osmose").remove(),a.selectAll(".qaItem.osmose").remove())}function d(){c(),o.style("opacity",0).transition().duration(250).style("opacity",1).on("end interrupt",()=>r.call("change"))}function m(){n.cancel(),o.interrupt(),a.selectAll(".qaItem.osmose").remove(),o.transition().duration(250).style("opacity",0).on("end interrupt",()=>{f(),r.call("change")})}function h(){if(!s||!N5)return;let A=u(),v=t.selectedErrorID(),_=A?A.getItems(e):[],w=jt(e),k=o.selectAll(".qaItem.osmose").data(_,y=>y.id);k.exit().remove();let x=k.enter().append("g").attr("class",y=>`qaItem ${y.service} itemId-${y.id} itemType-${y.itemType}`);if(x.append("polygon").call(l,"shadow"),x.append("ellipse").attr("cx",0).attr("cy",0).attr("rx",4.5).attr("ry",2).attr("class","stroke"),x.append("polygon").attr("fill",y=>A.getColor(y.item)).call(l,"qaItem-fill"),x.append("use").attr("class","icon-annotation").attr("transform","translate(-6, -22)").attr("width","12px").attr("height","12px").attr("xlink:href",y=>y.icon?"#"+y.icon:""),k.merge(x).sort(b).classed("selected",y=>y.id===v).attr("transform",w),a.empty())return;let S=t.getDebug("target")?"pink":"nocolor",I=a.selectAll(".qaItem.osmose").data(_,y=>y.id);I.exit().remove(),I.enter().append("rect").attr("width","20px").attr("height","30px").attr("x","-10px").attr("y","-28px").merge(I).sort(b).attr("class",y=>`qaItem ${y.service} target ${S} itemId-${y.id}`).attr("transform",w);function b(y,E){return y.id===v?1:E.id===v?-1:E.loc[1]-y.loc[1]}}function g(A){let v=u(),_=t.surface();_&&!_.empty()&&(a=_.selectAll(".data-layer.touch .layer-touch.markers")),o=A.selectAll(".layer-osmose").data(v?[0]:[]),o.exit().remove(),o=o.enter().append("g").attr("class","layer-osmose").style("display",N5?"block":"none").merge(o),N5&&(v&&~~t.map().zoom()>=i?(c(),v.loadIssues(e),h()):f())}return g.enabled=function(A){return arguments.length?(N5=A,N5?u().loadStrings().then(d).catch(v=>{console.log(v)}):(m(),t.selectedErrorID()&&t.enter(Ue(t))),r.call("change"),this):N5},g.supported=()=>!!u(),g}var N5,D5,V_=q(()=>{"use strict";Ae();Kt();Tr();pt();N5=!1});var LB={};j(LB,{svgStreetside:()=>La});import Foe from"lodash-es/throttle.js";function La(e,t,r){var n=Foe(function(){r.call("change")},1e3),i=14,a=16,o=18,s=Q(null),l=0,u=null,c;function f(){La.initialized||(La.enabled=!1,La.initialized=!0)}function d(){return de.streetside&&!c?(c=de.streetside,c.event.on("viewerChanged.svgStreetside",x).on("loadedImages.svgStreetside",n)):!de.streetside&&c&&(c=null),c}function m(){var E=d();E&&(g(),s.style("opacity",0).transition().duration(250).style("opacity",1).on("end",function(){r.call("change")}))}function h(){n.cancel(),s.transition().duration(250).style("opacity",0).on("end",A)}function g(){s.style("display","block")}function A(){s.selectAll(".viewfield-group").remove(),s.style("display","none")}function v(E,M){var F=d();F&&(M.sequenceKey!==u&&(l=0),u=M.sequenceKey,F.ensureViewerLoaded(t).then(function(){F.selectImage(t,M.key).yaw(l).showViewer(t)}),t.map().centerEase(M.loc))}function _(E,M){var F=d();F&&F.setStyles(t,M)}function w(){var E=d();E&&E.setStyles(t,null)}function k(E){var M=jt(e)(E),F=E.ca+l;return F&&(M+=" rotate("+Math.floor(F)+",0,0)"),M}function x(){var E=d();if(E){var M=E.viewer();M&&(l=M.getYaw(),!t.map().isTransformed()&&s.selectAll(".viewfield-group.currentView").attr("transform",k))}}function S(E){var M=t.photos().fromDate(),F=t.photos().toDate(),N=t.photos().usernames();if(M){var D=new Date(M).getTime();E=E.filter(function(L){return new Date(L.captured_at).getTime()>=D})}if(F){var O=new Date(F).getTime();E=E.filter(function(L){return new Date(L.captured_at).getTime()<=O})}return N&&(E=E.filter(function(L){return N.indexOf(L.captured_by)!==-1})),E}function I(E){var M=t.photos().fromDate(),F=t.photos().toDate(),N=t.photos().usernames();if(M){var D=new Date(M).getTime();E=E.filter(function(L){return new Date(L.properties.captured_at).getTime()>=D})}if(F){var O=new Date(F).getTime();E=E.filter(function(L){return new Date(L.properties.captured_at).getTime()<=O})}return N&&(E=E.filter(function(L){return N.indexOf(L.properties.captured_by)!==-1})),E}function b(){var E=t.container().select(".photoviewer"),M=E.empty()?void 0:E.datum(),F=~~t.map().zoom(),N=F>=a,D=F>=o,O=d(),L=[],P=[];t.photos().showsPanoramic()&&(L=O?O.sequences(e):[],P=O&&N?O.bubbles(e):[],L=I(L),P=S(P));var U=s.selectAll(".sequences").selectAll(".sequence").data(L,function(Y){return Y.properties.key});r.call("photoDatesChanged",this,"streetside",[...P.map(Y=>Y.captured_at),...L.map(Y=>Y.properties.vintageStart)]),U.exit().remove(),U=U.enter().append("path").attr("class","sequence").merge(U).attr("d",Pr(e).geojson);var B=s.selectAll(".markers").selectAll(".viewfield-group").data(P,function(Y){return Y.key+(Y.sequenceKey?"v1":"v0")});B.exit().remove();var z=B.enter().append("g").attr("class","viewfield-group").on("mouseenter",_).on("mouseleave",w).on("click",v);z.append("g").attr("class","viewfield-scale");var V=B.merge(z).sort(function(Y,J){return Y===M?1:J===M?-1:J.loc[1]-Y.loc[1]}).attr("transform",k).select(".viewfield-scale");V.selectAll("circle").data([0]).enter().append("circle").attr("dx","0").attr("dy","0").attr("r","6");var G=V.selectAll(".viewfield").data(D?[0]:[]);G.exit().remove(),G.enter().insert("path","circle").attr("class","viewfield").attr("transform","scale(1.5,1.5),translate(-8, -13)").attr("d",W);function W(){var Y=this.parentNode.__data__;return Y.pano?"M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0":"M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z"}}function y(E){var M=La.enabled,F=d();s=E.selectAll(".layer-streetside-images").data(F?[0]:[]),s.exit().remove();var N=s.enter().append("g").attr("class","layer-streetside-images").style("display",M?"block":"none");N.append("g").attr("class","sequences"),N.append("g").attr("class","markers"),s=N.merge(s),M?F&&~~t.map().zoom()>=i?(g(),b(),F.loadBubbles(e)):(r.call("photoDatesChanged",this,"streetside",[]),A()):r.call("photoDatesChanged",this,"streetside",[])}return y.enabled=function(E){return arguments.length?(La.enabled=E,La.enabled?(m(),t.photos().on("change.streetside",b)):(h(),t.photos().on("change.streetside",null)),r.call("change"),this):La.enabled},y.supported=function(){return!!d()},y.rendered=function(E){return E>=i},f(),y}var Dm=q(()=>{"use strict";Ae();Tr();pt()});var UB={};j(UB,{svgVegbilder:()=>Ua});import Ooe from"lodash-es/throttle.js";function Ua(e,t,r){let n=Ooe(()=>r.call("change"),1e3),i=14,a=16,o=18,s=Q(null),l=0,u;function c(){Ua.initialized||(Ua.enabled=!1,Ua.initialized=!0)}function f(){return de.vegbilder&&!u?(u=de.vegbilder,u.event.on("viewerChanged.svgVegbilder",k).on("loadedImages.svgVegbilder",n)):!de.vegbilder&&u&&(u=null),u}function d(){f()&&(h(),s.style("opacity",0).transition().duration(250).style("opacity",1).on("end",()=>r.call("change")))}function m(){n.cancel(),s.transition().duration(250).style("opacity",0).on("end",g)}function h(){s.style("display","block")}function g(){s.selectAll(".viewfield-group").remove(),s.style("display","none")}function A(y,E){let M=f();M&&(M.ensureViewerLoaded(t).then(()=>{M.selectImage(t,E.key).showViewer(t)}),t.map().centerEase(E.loc))}function v(y,E){let M=f();M&&M.setStyles(t,E)}function _(){let y=f();y&&y.setStyles(t,null)}function w(y,E){let M=jt(e)(y),F=y.ca;return y===E&&(F+=l),F&&(M+=" rotate("+Math.floor(F)+",0,0)"),M}function k(){let y=f();!y||(l=y.photoFrame().getYaw(),t.map().isTransformed())||s.selectAll(".viewfield-group.currentView").attr("transform",M=>w(M,M))}function x(y){let E=t.photos(),M=E.fromDate(),F=E.toDate(),N=E.showsFlat(),D=E.showsPanoramic();if(M){let O=new Date(M);y=y.filter(L=>L.captured_at.getTime()>=O.getTime())}if(F){let O=new Date(F);y=y.filter(L=>L.captured_at.getTime()<=O.getTime())}return D||(y=y.filter(O=>!O.is_sphere)),N||(y=y.filter(O=>O.is_sphere)),y}function S(y){let E=t.photos(),M=E.fromDate(),F=E.toDate(),N=E.showsFlat(),D=E.showsPanoramic();if(M){let O=new Date(M);y=y.filter(({images:L})=>L[0].captured_at.getTime()>=O.getTime())}if(F){let O=new Date(F);y=y.filter(({images:L})=>L[L.length-1].captured_at.getTime()<=O.getTime())}return D||(y=y.filter(({images:O})=>!O[0].is_sphere)),N||(y=y.filter(({images:O})=>O[0].is_sphere)),y}function I(){let y=t.container().select(".photoviewer"),E=y.empty()?void 0:y.datum(),M=~~t.map().zoom(),F=M>=a,N=M>=o,D=f(),O=[],L=[];D&&(D.loadImages(t),O=D.sequences(e),L=F?D.images(e):[],r.call("photoDatesChanged",this,"vegbilder",L.map(W=>W.captured_at)),L=x(L),O=S(O));let P=s.selectAll(".sequences").selectAll(".sequence").data(O,W=>W.key);P.exit().remove(),P.enter().append("path").attr("class","sequence").merge(P).attr("d",Pr(e).geojson);let U=s.selectAll(".markers").selectAll(".viewfield-group").data(L,W=>W.key);U.exit().remove();let B=U.enter().append("g").attr("class","viewfield-group").on("mouseenter",v).on("mouseleave",_).on("click",A);B.append("g").attr("class","viewfield-scale");let z=U.merge(B).sort((W,Y)=>W===E?1:Y===E?-1:Y.loc[1]-W.loc[1]).attr("transform",W=>w(W,E)).select(".viewfield-scale");z.selectAll("circle").data([0]).enter().append("circle").attr("dx","0").attr("dy","0").attr("r","6");let V=z.selectAll(".viewfield").data(N?[0]:[]);V.exit().remove(),V.enter().insert("path","circle").attr("class","viewfield").attr("transform","scale(1.5,1.5),translate(-8, -13)").attr("d",G);function G(){return this.parentNode.__data__.is_sphere?"M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0":"M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z"}}function b(y){let E=Ua.enabled,M=f();s=y.selectAll(".layer-vegbilder").data(M?[0]:[]),s.exit().remove();let F=s.enter().append("g").attr("class","layer-vegbilder").style("display",E?"block":"none");F.append("g").attr("class","sequences"),F.append("g").attr("class","markers"),s=F.merge(s),E&&(M&&~~t.map().zoom()>=i?(h(),I(),M.loadImages(t)):g())}return b.enabled=function(y){return arguments.length?(Ua.enabled=y,Ua.enabled?(d(),t.photos().on("change.vegbilder",I)):(m(),t.photos().on("change.vegbilder",null)),r.call("change"),this):Ua.enabled},b.supported=function(){return!!f()},b.rendered=function(y){return y>=i},b.validHere=function(y,E){return E>=i-2&&f().validHere(y)},c(),b}var Pm=q(()=>{"use strict";Ae();Tr();pt()});var BB={};j(BB,{svgMapillaryImages:()=>Ba});import Roe from"lodash-es/throttle.js";function Ba(e,t,r){let n=Roe(function(){r.call("change")},1e3),i=12,a=16,o=18,s=Q(null),l;function u(){Ba.initialized||(Ba.enabled=!1,Ba.initialized=!0)}function c(){return de.mapillary&&!l?(l=de.mapillary,l.event.on("loadedImages",n)):!de.mapillary&&l&&(l=null),l}function f(){c()&&(m(),s.style("opacity",0).transition().duration(250).style("opacity",1).on("end",function(){r.call("change")}))}function d(){n.cancel(),s.transition().duration(250).style("opacity",0).on("end",h)}function m(){s.style("display","block")}function h(){s.selectAll(".viewfield-group").remove(),s.style("display","none")}function g(I,b){let y=c();y&&(y.ensureViewerLoaded(t).then(function(){y.selectImage(t,b.id).showViewer(t)}),t.map().centerEase(b.loc))}function A(I,b){let y=c();y&&y.setStyles(t,b)}function v(){let I=c();I&&I.setStyles(t,null)}function _(I){let b=jt(e)(I);return I.ca&&(b+=" rotate("+Math.floor(I.ca)+",0,0)"),b}function w(I){let b=t.photos().showsPanoramic(),y=t.photos().showsFlat(),E=t.photos().fromDate(),M=t.photos().toDate();return(!b||!y)&&(I=I.filter(function(F){return F.is_pano?b:y})),E&&(I=I.filter(function(F){return new Date(F.captured_at).getTime()>=new Date(E).getTime()})),M&&(I=I.filter(function(F){return new Date(F.captured_at).getTime()<=new Date(M).getTime()})),I}function k(I){let b=t.photos().showsPanoramic(),y=t.photos().showsFlat(),E=t.photos().fromDate(),M=t.photos().toDate();return(!b||!y)&&(I=I.filter(function(F){return F.properties.hasOwnProperty("is_pano")?F.properties.is_pano?b:y:!1})),E&&(I=I.filter(function(F){return new Date(F.properties.captured_at).getTime()>=new Date(E).getTime().toString()})),M&&(I=I.filter(function(F){return new Date(F.properties.captured_at).getTime()<=new Date(M).getTime().toString()})),I}function x(){let I=~~t.map().zoom(),b=I>=a,y=I>=o,E=c(),M=E?E.sequences(e):[],F=E&&b?E.images(e):[];r.call("photoDatesChanged",this,"mapillary",[...F.map(B=>B.captured_at),...M.map(B=>B.properties.captured_at)]),F=w(F),M=k(M,E),E.filterViewer(t);let N=s.selectAll(".sequences").selectAll(".sequence").data(M,function(B){return B.properties.id});N.exit().remove(),N=N.enter().append("path").attr("class","sequence").merge(N).attr("d",Pr(e).geojson);let D=s.selectAll(".markers").selectAll(".viewfield-group").data(F,function(B){return B.id});D.exit().remove();let O=D.enter().append("g").attr("class","viewfield-group").on("mouseenter",A).on("mouseleave",v).on("click",g);O.append("g").attr("class","viewfield-scale");let L=D.merge(O).sort(function(B,z){return z.loc[1]-B.loc[1]}).attr("transform",_).select(".viewfield-scale");L.selectAll("circle").data([0]).enter().append("circle").attr("dx","0").attr("dy","0").attr("r","6");let P=L.selectAll(".viewfield").data(y?[0]:[]);P.exit().remove(),P.enter().insert("path","circle").attr("class","viewfield").classed("pano",function(){return this.parentNode.__data__.is_pano}).attr("transform","scale(1.5,1.5),translate(-8, -13)").attr("d",U);function U(){return this.parentNode.__data__.is_pano?"M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0":"M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z"}}function S(I){let b=Ba.enabled,y=c();s=I.selectAll(".layer-mapillary").data(y?[0]:[]),s.exit().remove();let E=s.enter().append("g").attr("class","layer-mapillary").style("display",b?"block":"none");E.append("g").attr("class","sequences"),E.append("g").attr("class","markers"),s=E.merge(s),b?y&&~~t.map().zoom()>=i?(m(),x(),y.loadImages(e)):(r.call("photoDatesChanged",this,"mapillary",[]),h()):r.call("photoDatesChanged",this,"mapillary",[])}return S.enabled=function(I){return arguments.length?(Ba.enabled=I,Ba.enabled?(f(),t.photos().on("change.mapillary_images",x)):(d(),t.photos().on("change.mapillary_images",null)),r.call("change"),this):Ba.enabled},S.supported=function(){return!!c()},S.rendered=function(I){return I>=i},u(),S}var Fm=q(()=>{"use strict";Ae();Tr();pt()});var zB={};j(zB,{svgMapillaryPosition:()=>l8});import Loe from"lodash-es/throttle.js";function l8(e,t){let r=Loe(function(){m()},1e3),n=12,i=18,a=Q(null),o,s;function l(){l8.initialized||(l8.initialized=!0)}function u(){return de.mapillary&&!o?(o=de.mapillary,o.event.on("imageChanged",r),o.event.on("bearingChanged",function(g){s=g.bearing,!t.map().isTransformed()&&a.selectAll(".viewfield-group.currentView").filter(function(A){return A.is_pano}).attr("transform",d)})):!de.mapillary&&o&&(o=null),o}function c(){a.style("display","block")}function f(){a.selectAll(".viewfield-group").remove(),a.style("display","none")}function d(g){let A=jt(e)(g);return g.is_pano&&s!==null&&isFinite(s)?A+=" rotate("+Math.floor(s)+",0,0)":g.ca&&(A+=" rotate("+Math.floor(g.ca)+",0,0)"),A}function m(){let A=~~t.map().zoom()>=i,v=u(),_=v&&v.getActiveImage(),w=a.selectAll(".markers").selectAll(".viewfield-group").data(_?[_]:[],function(I){return I.id});w.exit().remove();let k=w.enter().append("g").attr("class","viewfield-group currentView highlighted");k.append("g").attr("class","viewfield-scale");let x=w.merge(k).attr("transform",d).select(".viewfield-scale");x.selectAll("circle").data([0]).enter().append("circle").attr("dx","0").attr("dy","0").attr("r","6");let S=x.selectAll(".viewfield").data(A?[0]:[]);S.exit().remove(),S.enter().insert("path","circle").attr("class","viewfield").attr("transform","scale(1.5,1.5),translate(-8, -13)").attr("d","M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z")}function h(g){let A=u();a=g.selectAll(".layer-mapillary-position").data(A?[0]:[]),a.exit().remove();let v=a.enter().append("g").attr("class","layer-mapillary-position");v.append("g").attr("class","markers"),a=v.merge(a),A&&~~t.map().zoom()>=n?(c(),m()):f()}return h.enabled=function(){return m(),this},h.supported=function(){return!!u()},h.rendered=function(g){return g>=n},l(),h}var $_=q(()=>{"use strict";Ae();Tr();pt()});var qB={};j(qB,{svgMapillarySigns:()=>za});import Uoe from"lodash-es/throttle.js";function za(e,t,r){let n=Uoe(function(){r.call("change")},1e3),i=12,a=Q(null),o;function s(){za.initialized||(za.enabled=!1,za.initialized=!0)}function l(){return de.mapillary&&!o?(o=de.mapillary,o.event.on("loadedSigns",n)):!de.mapillary&&o&&(o=null),o}function u(){let v=l();v&&(v.loadSignResources(t),f())}function c(){n.cancel(),d()}function f(){a.style("display","block")}function d(){a.selectAll(".icon-sign").remove(),a.style("display","none")}function m(v,_){let w=l();if(!w)return;t.map().centerEase(_.loc);let k=w.getActiveImage()&&w.getActiveImage().id;w.getDetections(_.id).then(x=>{if(x.length){let S=x[0].image.id;S===k?w.highlightDetection(x[0]).selectImage(t,S):w.ensureViewerLoaded(t).then(function(){w.highlightDetection(x[0]).selectImage(t,S).showViewer(t)})}})}function h(v){var _=t.photos().fromDate(),w=t.photos().toDate();if(_){var k=new Date(_).getTime();v=v.filter(function(S){return new Date(S.last_seen_at).getTime()>=k})}if(w){var x=new Date(w).getTime();v=v.filter(function(S){return new Date(S.first_seen_at).getTime()<=x})}return v}function g(){let v=l(),_=v?v.signs(e):[];_=h(_);let w=jt(e),k=a.selectAll(".icon-sign").data(_,function(S){return S.id});k.exit().remove();let x=k.enter().append("g").attr("class","icon-sign icon-detected").on("click",m);x.append("use").attr("width","24px").attr("height","24px").attr("x","-12px").attr("y","-12px").attr("xlink:href",function(S){return"#"+S.value}),x.append("rect").attr("width","24px").attr("height","24px").attr("x","-12px").attr("y","-12px"),k.merge(x).attr("transform",w)}function A(v){let _=za.enabled,w=l();a=v.selectAll(".layer-mapillary-signs").data(w?[0]:[]),a.exit().remove(),a=a.enter().append("g").attr("class","layer-mapillary-signs layer-mapillary-detections").style("display",_?"block":"none").merge(a),_?w&&~~t.map().zoom()>=i?(f(),g(),w.loadSigns(e),w.showSignDetections(!0)):d():w&&w.showSignDetections(!1)}return A.enabled=function(v){return arguments.length?(za.enabled=v,za.enabled?(u(),t.photos().on("change.mapillary_signs",g)):(c(),t.photos().on("change.mapillary_signs",null)),r.call("change"),this):za.enabled},A.supported=function(){return!!l()},A.rendered=function(v){return v>=i},s(),A}var Om=q(()=>{"use strict";Ae();Tr();pt()});var VB={};j(VB,{svgMapillaryMapFeatures:()=>j1});import Boe from"lodash-es/throttle.js";function j1(e,t,r){let n=Boe(function(){r.call("change")},1e3),i=12,a=Q(null),o;function s(){j1.initialized||(j1.enabled=!1,j1.initialized=!0)}function l(){return de.mapillary&&!o?(o=de.mapillary,o.event.on("loadedMapFeatures",n)):!de.mapillary&&o&&(o=null),o}function u(){let v=l();v&&(v.loadObjectResources(t),f())}function c(){n.cancel(),d()}function f(){a.style("display","block")}function d(){a.selectAll(".icon-map-feature").remove(),a.style("display","none")}function m(v,_){let w=l();if(!w)return;t.map().centerEase(_.loc);let k=w.getActiveImage()&&w.getActiveImage().id;w.getDetections(_.id).then(x=>{if(x.length){let S=x[0].image.id;S===k?w.highlightDetection(x[0]).selectImage(t,S):w.ensureViewerLoaded(t).then(function(){w.highlightDetection(x[0]).selectImage(t,S).showViewer(t)})}})}function h(v){let _=t.photos().fromDate(),w=t.photos().toDate();return _&&(v=v.filter(function(k){return new Date(k.last_seen_at).getTime()>=new Date(_).getTime()})),w&&(v=v.filter(function(k){return new Date(k.first_seen_at).getTime()<=new Date(w).getTime()})),v}function g(){let v=l(),_=v?v.mapFeatures(e):[];_=h(_);let w=jt(e),k=a.selectAll(".icon-map-feature").data(_,function(S){return S.id});k.exit().remove();let x=k.enter().append("g").attr("class","icon-map-feature icon-detected").on("click",m);x.append("title").text(function(S){var I=S.value.replace(/--/g,".").replace(/-/g,"_");return T("mapillary_map_features."+I)}),x.append("use").attr("width","24px").attr("height","24px").attr("x","-12px").attr("y","-12px").attr("xlink:href",function(S){return S.value==="object--billboard"?"#object--sign--advertisement":"#"+S.value}),x.append("rect").attr("width","24px").attr("height","24px").attr("x","-12px").attr("y","-12px"),k.merge(x).attr("transform",w)}function A(v){let _=j1.enabled,w=l();a=v.selectAll(".layer-mapillary-map-features").data(w?[0]:[]),a.exit().remove(),a=a.enter().append("g").attr("class","layer-mapillary-map-features layer-mapillary-detections").style("display",_?"block":"none").merge(a),_?w&&~~t.map().zoom()>=i?(f(),g(),w.loadMapFeatures(e),w.showFeatureDetections(!0)):d():w&&w.showFeatureDetections(!1)}return A.enabled=function(v){return arguments.length?(j1.enabled=v,j1.enabled?(u(),t.photos().on("change.mapillary_map_features",g)):(c(),t.photos().on("change.mapillary_map_features",null)),r.call("change"),this):j1.enabled},A.supported=function(){return!!l()},A.rendered=function(v){return v>=i},s(),A}var G_=q(()=>{"use strict";Ae();Tr();pt();ue()});var $B={};j($B,{svgKartaviewImages:()=>qa});import zoe from"lodash-es/throttle.js";function qa(e,t,r){var n=zoe(function(){r.call("change")},1e3),i=12,a=16,o=18,s=Q(null),l;function u(){qa.initialized||(qa.enabled=!1,qa.initialized=!0)}function c(){return de.kartaview&&!l?(l=de.kartaview,l.event.on("loadedImages",n)):!de.kartaview&&l&&(l=null),l}function f(){var I=c();I&&(m(),s.style("opacity",0).transition().duration(250).style("opacity",1).on("end",function(){r.call("change")}))}function d(){n.cancel(),s.transition().duration(250).style("opacity",0).on("end",h)}function m(){s.style("display","block")}function h(){s.selectAll(".viewfield-group").remove(),s.style("display","none")}function g(I,b){var y=c();y&&(y.ensureViewerLoaded(t).then(function(){y.selectImage(t,b.key).showViewer(t)}),t.map().centerEase(b.loc))}function A(I,b){var y=c();y&&y.setStyles(t,b)}function v(){var I=c();I&&I.setStyles(t,null)}function _(I){var b=jt(e)(I);return I.ca&&(b+=" rotate("+Math.floor(I.ca)+",0,0)"),b}function w(I){var b=t.photos().fromDate(),y=t.photos().toDate(),E=t.photos().usernames();if(b){var M=new Date(b).getTime();I=I.filter(function(N){return new Date(N.captured_at).getTime()>=M})}if(y){var F=new Date(y).getTime();I=I.filter(function(N){return new Date(N.captured_at).getTime()<=F})}return E&&(I=I.filter(function(N){return E.indexOf(N.captured_by)!==-1})),I}function k(I){var b=t.photos().fromDate(),y=t.photos().toDate(),E=t.photos().usernames();if(b){var M=new Date(b).getTime();I=I.filter(function(N){return new Date(N.properties.captured_at).getTime()>=M})}if(y){var F=new Date(y).getTime();I=I.filter(function(N){return new Date(N.properties.captured_at).getTime()<=F})}return E&&(I=I.filter(function(N){return E.indexOf(N.properties.captured_by)!==-1})),I}function x(){var I=t.container().select(".photoviewer"),b=I.empty()?void 0:I.datum(),y=~~t.map().zoom(),E=y>=a,M=y>=o,F=c(),N=[],D=[];N=F?F.sequences(e):[],D=F&&E?F.images(e):[],r.call("photoDatesChanged",this,"kartaview",[...D.map(z=>z.captured_at),...N.map(z=>z.properties.captured_at)]),N=k(N),D=w(D);var O=s.selectAll(".sequences").selectAll(".sequence").data(N,function(z){return z.properties.key});O.exit().remove(),O=O.enter().append("path").attr("class","sequence").merge(O).attr("d",Pr(e).geojson);var L=s.selectAll(".markers").selectAll(".viewfield-group").data(D,function(z){return z.key});L.exit().remove();var P=L.enter().append("g").attr("class","viewfield-group").on("mouseenter",A).on("mouseleave",v).on("click",g);P.append("g").attr("class","viewfield-scale");var U=L.merge(P).sort(function(z,V){return z===b?1:V===b?-1:V.loc[1]-z.loc[1]}).attr("transform",_).select(".viewfield-scale");U.selectAll("circle").data([0]).enter().append("circle").attr("dx","0").attr("dy","0").attr("r","6");var B=U.selectAll(".viewfield").data(M?[0]:[]);B.exit().remove(),B.enter().insert("path","circle").attr("class","viewfield").attr("transform","scale(1.5,1.5),translate(-8, -13)").attr("d","M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z")}function S(I){var b=qa.enabled,y=c();s=I.selectAll(".layer-kartaview").data(y?[0]:[]),s.exit().remove();var E=s.enter().append("g").attr("class","layer-kartaview").style("display",b?"block":"none");E.append("g").attr("class","sequences"),E.append("g").attr("class","markers"),s=E.merge(s),b?y&&~~t.map().zoom()>=i?(m(),x(),y.loadImages(e)):(r.call("photoDatesChanged",this,"kartaview",[]),h()):r.call("photoDatesChanged",this,"kartaview",[])}return S.enabled=function(I){return arguments.length?(qa.enabled=I,qa.enabled?(f(),t.photos().on("change.kartaview_images",x)):(d(),t.photos().on("change.kartaview_images",null)),r.call("change"),this):qa.enabled},S.supported=function(){return!!c()},S.rendered=function(I){return I>=i},u(),S}var Rm=q(()=>{"use strict";Ae();Tr();pt()});var GB={};j(GB,{svgMapilioImages:()=>Va});import qoe from"lodash-es/throttle.js";function Va(e,t,r){let n=qoe(function(){r.call("change")},1e3),i=12,a=Q(null),o,s=18;function l(){Va.initialized||(Va.enabled=!1,Va.initialized=!0)}function u(){return de.mapilio&&!o?(o=de.mapilio,o.event.on("loadedImages",n)):!de.mapilio&&o&&(o=null),o}function c(){u()&&(m(),a.style("opacity",0).transition().duration(250).style("opacity",1).on("end",function(){r.call("change")}))}function f(){n.cancel(),a.transition().duration(250).style("opacity",0).on("end",h)}function d(S){let I=jt(e)(S);return S.heading&&(I+=" rotate("+Math.floor(S.heading)+",0,0)"),I}function m(){a.style("display","block")}function h(){a.selectAll(".viewfield-group").remove(),a.style("display","none")}function g(S,I){let b=u();b&&(b.ensureViewerLoaded(t,I.id).then(function(){b.selectImage(t,I.id).showViewer(t)}),t.map().centerEase(I.loc))}function A(S,I){let b=u();b&&b.setStyles(t,I)}function v(){let S=u();S&&S.setStyles(t,null)}function _(S){var I=t.photos().fromDate(),b=t.photos().toDate();if(I){var y=new Date(I).getTime();S=S.filter(function(M){return new Date(M.capture_time).getTime()>=y})}if(b){var E=new Date(b).getTime();S=S.filter(function(M){return new Date(M.capture_time).getTime()<=E})}return S}function w(S){var I=t.photos().fromDate(),b=t.photos().toDate();if(I){var y=new Date(I).getTime();S=S.filter(function(M){return new Date(M.properties.capture_time).getTime()>=y})}if(b){var E=new Date(b).getTime();S=S.filter(function(M){return new Date(M.properties.capture_time).getTime()<=E})}return S}function k(){let I=~~t.map().zoom()>=s,b=u(),y=b?b.sequences(e):[],E=b?b.images(e):[];r.call("photoDatesChanged",this,"mapilio",[...E.map(P=>P.capture_time),...y.map(P=>P.properties.capture_time)]),y=w(y),E=_(E);let M=a.selectAll(".sequences").selectAll(".sequence").data(y,function(P){return P.properties.id});M.exit().remove(),M.enter().append("path").attr("class","sequence").merge(M).attr("d",Pr(e).geojson);let F=a.selectAll(".markers").selectAll(".viewfield-group").data(E,function(P){return P.id});F.exit().remove();let N=F.enter().append("g").attr("class","viewfield-group").on("mouseenter",A).on("mouseleave",v).on("click",g);N.append("g").attr("class","viewfield-scale");let D=F.merge(N).sort(function(P,U){return U.loc[1]-P.loc[1]}).attr("transform",d).select(".viewfield-scale");D.selectAll("circle").data([0]).enter().append("circle").attr("dx","0").attr("dy","0").attr("r","6");let O=D.selectAll(".viewfield").data(I?[0]:[]);O.exit().remove(),O.enter().insert("path","circle").attr("class","viewfield").attr("transform","scale(1.5,1.5),translate(-8, -13)").attr("d",L);function L(){return this.parentNode.__data__.isPano?"M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0":"M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z"}}function x(S){let I=Va.enabled,b=u();a=S.selectAll(".layer-mapilio").data(b?[0]:[]),a.exit().remove();let y=a.enter().append("g").attr("class","layer-mapilio").style("display",I?"block":"none");y.append("g").attr("class","sequences"),y.append("g").attr("class","markers"),a=y.merge(a),I?b&&~~t.map().zoom()>=i?(m(),k(),b.loadImages(e),b.loadLines(e)):(r.call("photoDatesChanged",this,"mapilio",[]),h()):r.call("photoDatesChanged",this,"mapilio",[])}return x.enabled=function(S){return arguments.length?(Va.enabled=S,Va.enabled?(c(),t.photos().on("change.mapilio_images",k)):(f(),t.photos().on("change.mapilio_images",null)),r.call("change"),this):Va.enabled},x.supported=function(){return!!u()},x.rendered=function(S){return S>=i},l(),x}var Lm=q(()=>{"use strict";Ae();pt();Tr()});var WB={};j(WB,{svgPanoramaxImages:()=>$a});import Voe from"lodash-es/throttle.js";function $a(e,t,r){let n=Voe(function(){r.call("change")},1e3),i=15,a=10,o=18,s=Q(null),l,u=0,c,f;function d(){$a.initialized||($a.enabled=!1,$a.initialized=!0)}function m(){return de.panoramax&&!l?(l=de.panoramax,l.event.on("viewerChanged",y).on("loadedLines",n).on("loadedImages",n)):!de.panoramax&&l&&(l=null),l}async function h(M){let F=t.photos().showsPanoramic(),N=t.photos().showsFlat(),D=t.photos().fromDate(),O=t.photos().toDate(),L=t.photos().usernames(),P=m();if((!F||!N)&&(M=M.filter(function(U){return U.isPano?F:N})),D&&(M=M.filter(function(U){return new Date(U.capture_time).getTime()>=new Date(D).getTime()})),O&&(M=M.filter(function(U){return new Date(U.capture_time).getTime()<=new Date(O).getTime()})),L&&P){if(c!==L){c=L;let U=await P.getUserIds(L);f={},U.forEach(B=>{f[B]=!0})}M=M.filter(function(U){return f[U.account_id]})}return M}async function g(M){let F=t.photos().showsPanoramic(),N=t.photos().showsFlat(),D=t.photos().fromDate(),O=t.photos().toDate(),L=t.photos().usernames(),P=m();if((!F||!N)&&(M=M.filter(function(U){return U.properties.type==="equirectangular"?F:N})),D&&(M=M.filter(function(U){return new Date(U.properties.date).getTime()>=new Date(D).getTime().toString()})),O&&(M=M.filter(function(U){return new Date(U.properties.date).getTime()<=new Date(O).getTime().toString()})),L&&P){if(c!==L){c=L;let U=await P.getUserIds(L);f={},U.forEach(B=>{f[B]=!0})}M=M.filter(function(U){return f[U.properties.account_id]})}return M}function A(){m()&&(w(),s.style("opacity",0).transition().duration(250).style("opacity",1).on("end",function(){r.call("change")}))}function v(){n.cancel(),s.transition().duration(250).style("opacity",0).on("end",k)}function _(M,F){let N=jt(e)(M),D=M.heading;return M.id===F&&(D+=u),D&&(N+=" rotate("+Math.floor(D)+",0,0)"),N}function w(){s.style("display","block")}function k(){m().hideViewer(t),s.selectAll(".viewfield-group").remove(),s.style("display","none")}function x(M,F){let N=m();N&&(N.ensureViewerLoaded(t).then(function(){N.selectImage(t,F.id).showViewer(t)}),t.map().centerEase(F.loc))}function S(M,F){let N=m();N&&N.setStyles(t,F)}function I(){let M=m();M&&M.setStyles(t,null)}async function b(){var Y;let M=~~t.map().zoom(),F=M>=o,N=m(),D=N?N.sequences(e,M):[],O=N&&M>=i?N.images(e):[];r.call("photoDatesChanged",this,"panoramax",[...O.map(J=>J.capture_time),...D.map(J=>J.properties.date)]),Q(".photo-wrapper.panoramax-wrapper.hide").size()&&N.setActiveImage(null),O=await h(O),D=await g(D,N);let P=s.selectAll(".sequences").selectAll(".sequence").data(D,function(J){return J.properties.id});P.exit().remove(),P.enter().append("path").attr("class","sequence").merge(P).attr("d",Pr(e).geojson);let U=s.selectAll(".markers").selectAll(".viewfield-group").data(O,function(J){return J.id});U.exit().remove();let B=U.enter().append("g").attr("class","viewfield-group").on("mouseenter",S).on("mouseleave",I).on("click",x);B.append("g").attr("class","viewfield-scale");let z=(Y=N.getActiveImage())==null?void 0:Y.id,V=U.merge(B).sort(function(J,oe){return J.id===z?1:oe.id===z?-1:J.capture_time_parsed-oe.capture_time_parsed}).attr("transform",J=>_(J,z)).select(".viewfield-scale");V.selectAll("circle").data([0]).enter().append("circle").attr("dx","0").attr("dy","0").attr("r","6");let G=V.selectAll(".viewfield").data(F?[0]:[]);G.exit().remove(),G.enter().insert("path","circle").attr("class","viewfield").attr("transform","scale(1.5,1.5),translate(-8, -13)").attr("d",W),N.setStyles(t,null);function W(){return this.parentNode.__data__.isPano?"M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0":"M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z"}}function y(){let M=m();if(!M)return;let F=M.photoFrame();F&&(u=F.getYaw(),!t.map().isTransformed()&&s.selectAll(".viewfield-group.currentView").attr("transform",N=>_(N,N.id)))}function E(M){let F=$a.enabled,N=m();s=M.selectAll(".layer-panoramax").data(N?[0]:[]),s.exit().remove();let D=s.enter().append("g").attr("class","layer-panoramax").style("display",F?"block":"none");if(D.append("g").attr("class","sequences"),D.append("g").attr("class","markers"),s=D.merge(s),F){let O=~~t.map().zoom();N?O>=i?(w(),b(),N.loadImages(e)):O>=a?(w(),b(),N.loadLines(e,O)):(k(),r.call("photoDatesChanged",this,"panoramax",[])):k()}else r.call("photoDatesChanged",this,"panoramax",[])}return E.enabled=function(M){return arguments.length?($a.enabled=M,$a.enabled?(A(),t.photos().on("change.panoramax_images",b)):(v(),t.photos().on("change.panoramax_images",null)),r.call("change"),this):$a.enabled},E.supported=function(){return!!m()},E.rendered=function(M){return M>=a},d(),E}var Um=q(()=>{"use strict";Ae();pt();Tr()});var QB={};j(QB,{svgOsm:()=>P5});function P5(e,t,r){var n=!0;function i(s){s.selectAll(".layer-osm").data(["covered","areas","lines","points","labels"]).enter().append("g").attr("class",function(l){return"layer-osm "+l}),s.selectAll(".layer-osm.points").selectAll(".points-group").data(["points","midpoints","vertices","turns"]).enter().append("g").attr("class",function(l){return"points-group "+l})}function a(){var s=t.surface().selectAll(".data-layer.osm");s.interrupt(),s.classed("disabled",!1).style("opacity",0).transition().duration(250).style("opacity",1).on("end interrupt",function(){r.call("change")})}function o(){var s=t.surface().selectAll(".data-layer.osm");s.interrupt(),s.transition().duration(250).style("opacity",0).on("end interrupt",function(){s.classed("disabled",!0),r.call("change")})}return i.enabled=function(s){return arguments.length?(n=s,n?a():o(),r.call("change"),this):n},i}var Bm=q(()=>{"use strict"});var HB={};j(HB,{svgNotes:()=>R5});import $oe from"lodash-es/throttle.js";function R5(e,t,r){r||(r=xe("change"));var n=$oe(function(){r.call("change")},1e3),i=12,a=Q(null),o=Q(null),s=!1;function l(A,v){A.attr("class",v).attr("transform","translate(-8, -22)").attr("d","m17.5,0l-15,0c-1.37,0 -2.5,1.12 -2.5,2.5l0,11.25c0,1.37 1.12,2.5 2.5,2.5l3.75,0l0,3.28c0,0.38 0.43,0.6 0.75,0.37l4.87,-3.65l5.62,0c1.37,0 2.5,-1.12 2.5,-2.5l0,-11.25c0,-1.37 -1.12,-2.5 -2.5,-2.5z")}function u(){return de.osm&&!O5?(O5=de.osm,O5.on("loadedNotes",n)):!de.osm&&O5&&(O5=null),O5}function c(){s||(s=!0,o.style("display","block"))}function f(){s&&(s=!1,o.style("display","none"),o.selectAll(".note").remove(),a.selectAll(".note").remove())}function d(){c(),o.style("opacity",0).transition().duration(250).style("opacity",1).on("end interrupt",function(){r.call("change")})}function m(){n.cancel(),o.interrupt(),a.selectAll(".note").remove(),o.transition().duration(250).style("opacity",0).on("end interrupt",function(){f(),r.call("change")})}function h(){if(!s||!F5)return;var A=u(),v=t.selectedNoteID(),_=A?A.notes(e):[],w=jt(e),k=o.selectAll(".note").data(_,function(y){return y.status+y.id});k.exit().remove();var x=k.enter().append("g").attr("class",function(y){return"note note-"+y.id+" "+y.status}).classed("new",function(y){return y.id<0});if(x.append("ellipse").attr("cx",.5).attr("cy",1).attr("rx",6.5).attr("ry",3).attr("class","stroke"),x.append("path").call(l,"shadow"),x.append("use").attr("class","note-fill").attr("width","20px").attr("height","20px").attr("x","-8px").attr("y","-22px").attr("xlink:href","#iD-icon-note"),x.selectAll(".icon-annotation").data(function(y){return[y]}).enter().append("use").attr("class","icon-annotation").attr("width","10px").attr("height","10px").attr("x","-3px").attr("y","-19px").attr("xlink:href",function(y){return y.id<0?"#iD-icon-plus":y.status==="open"?"#iD-icon-close":"#iD-icon-apply"}),k.merge(x).sort(b).classed("selected",function(y){var E=t.mode(),M=E&&E.id==="drag-note";return!M&&y.id===v}).attr("transform",w),a.empty())return;var S=t.getDebug("target")?"pink ":"nocolor ",I=a.selectAll(".note").data(_,function(y){return y.id});I.exit().remove(),I.enter().append("rect").attr("width","20px").attr("height","20px").attr("x","-8px").attr("y","-22px").merge(I).sort(b).attr("class",function(y){var E=y.id<0?"new":"";return"note target note-"+y.id+" "+S+E}).attr("transform",w);function b(y,E){return y.id===v?1:E.id===v?-1:E.loc[1]-y.loc[1]}}function g(A){var v=u(),_=t.surface();_&&!_.empty()&&(a=_.selectAll(".data-layer.touch .layer-touch.markers")),o=A.selectAll(".layer-notes").data(v?[0]:[]),o.exit().remove(),o=o.enter().append("g").attr("class","layer-notes").style("display",F5?"block":"none").merge(o),F5&&(v&&~~t.map().zoom()>=i?(c(),v.loadNotes(e),h()):f())}return g.enabled=function(A){return arguments.length?(F5=A,F5?d():(m(),t.selectedNoteID()&&t.enter(Ue(t))),r.call("change"),this):F5},g}var Goe,F5,O5,zm=q(()=>{"use strict";Ae();Ye();Kt();Tr();pt();Ie();Goe=Ft(window.location.hash),F5=!!Goe.notes});var jB={};j(jB,{svgTouch:()=>L5});function L5(){function e(t){t.selectAll(".layer-touch").data(["areas","lines","points","turns","markers"]).enter().append("g").attr("class",function(r){return"layer-touch "+r})}return e}var qm=q(()=>{"use strict"});var KB={};j(KB,{utilGetDimensions:()=>Jr,utilSetDimensions:()=>U5});function YB(e,t){var r=t.getBoundingClientRect(),n=[r.width,r.height];return e.property("__dimensions__",n),n}function Jr(e,t){if(!e||e.empty())return[0,0];var r=e.node(),n=e.property("__dimensions__");return!n||t?YB(e,r):n}function U5(e,t){if(!e||e.empty())return e;var r=e.node();return t===null?(YB(e,r),e):e.property("__dimensions__",[t[0],t[1]]).attr("width",t[0]).attr("height",t[1])}var $s=q(()=>{"use strict"});var XB={};j(XB,{svgLayers:()=>Cl});function Cl(e,t){var r=xe("change","photoDatesChanged"),n=Q(null),i=[{id:"osm",layer:P5(e,t,r)},{id:"notes",layer:R5(e,t,r)},{id:"data",layer:Al(e,t,r)},{id:"keepRight",layer:M5(e,t,r)},{id:"osmose",layer:q_(e,t,r)},{id:"streetside",layer:La(e,t,r)},{id:"mapillary",layer:Ba(e,t,r)},{id:"mapillary-position",layer:l8(e,t,r)},{id:"mapillary-map-features",layer:j1(e,t,r)},{id:"mapillary-signs",layer:za(e,t,r)},{id:"kartaview",layer:qa(e,t,r)},{id:"mapilio",layer:Va(e,t,r)},{id:"vegbilder",layer:Ua(e,t,r)},{id:"panoramax",layer:$a(e,t,r)},{id:"local-photos",layer:B_(e,t,r)},{id:"debug",layer:Sl(e,t,r)},{id:"geolocate",layer:Ra(e,t,r)},{id:"touch",layer:L5(e,t,r)}];function a(o){n=o.selectAll(".surface").data([0]),n=n.enter().append("svg").attr("class","surface").merge(n);var s=n.selectAll(".surface-defs").data([0]);s.enter().append("defs").attr("class","surface-defs");var l=n.selectAll(".data-layer").data(i);l.exit().remove(),l.enter().append("g").attr("class",function(u){return"data-layer "+u.id}).merge(l).each(function(u){Q(this).call(u.layer)})}return a.all=function(){return i},a.layer=function(o){var s=i.find(function(l){return l.id===o});return s&&s.layer},a.only=function(o){var s=[].concat(o),l=i.map(function(u){return u.id});return a.remove(yr(l,s))},a.remove=function(o){var s=[].concat(o);return s.forEach(function(l){i=i.filter(function(u){return u.id!==l})}),r.call("change"),this},a.add=function(o){var s=[].concat(o);return s.forEach(function(l){"id"in l&&"layer"in l&&i.push(l)}),r.call("change"),this},a.dimensions=function(o){return arguments.length?(U5(n,o),this):Jr(n)},_e(a,r,"on")}var W_=q(()=>{"use strict";Ye();Ae();Sm();z_();Cm();Mm();Im();V_();Dm();Pm();Fm();$_();Om();G_();Rm();Lm();Um();Bm();zm();qm();Ie();$s()});var ZB={};j(ZB,{svgLines:()=>Il});function Woe(e){return e.highway==="construction"&&e.bridge?"white":e.highway==="pedestrian"||e.railway?"gray":e.aeroway==="runway"?"white":"black"}function Il(e,t){var r=sr(),n={motorway:0,motorway_link:1,trunk:2,trunk_link:3,primary:4,primary_link:5,secondary:6,tertiary:7,unclassified:8,residential:9,service:10,busway:11,footway:12};function i(o,s,l,u){var c=t.getDebug("target")?"pink ":"nocolor ",f=t.getDebug("target")?"red ":"nocolor ",d=Pr(e).geojson,m=t.activeID(),h=t.history().base(),g={targets:[],nopes:[]};l.forEach(function(x){var S=kl(x,s,m);g.targets.push.apply(g.targets,S.passive),g.nopes.push.apply(g.nopes,S.active)});var A=g.targets.filter(d),v=o.selectAll(".line.target-allowed").filter(function(x){return u(x.properties.entity)}).data(A,function(S){return S.id});v.exit().remove();var _=function(x){var S=x.properties.entity.id;return!h.entities[S]||!(0,u8.default)(s.entities[S].nodes,h.entities[S].nodes)?!1:x.properties.nodes.some(function(I){return!h.entities[I.id]||!(0,u8.default)(s.entities[I.id].loc,h.entities[I.id].loc)})};v.enter().append("path").merge(v).attr("d",d).attr("class",function(x){return"way line target target-allowed "+c+x.id}).classed("segment-edited",_);var w=g.nopes.filter(d),k=o.selectAll(".line.target-nope").filter(function(x){return u(x.properties.entity)}).data(w,function(S){return S.id});k.exit().remove(),k.enter().append("path").merge(k).attr("d",d).attr("class",function(x){return"way line target target-nope "+f+x.id}).classed("segment-edited",_)}function a(o,s,l,u){var c=t.history().base();function f(E,M){var F=t.selectedIDs(),N=F.indexOf(E.id)!==-1?20:0,D=F.indexOf(M.id)!==-1?20:0;return E.tags.highway&&(N-=n[E.tags.highway]),M.tags.highway&&(D-=n[M.tags.highway]),N-D}function d(E,M,F){var N=t.mode(),D=N&&/^draw/.test(N.id),O=!D&&F?"selected ":"",L=E.selectAll("path").filter(u).data(m(F),Le.key);return L.exit().remove(),L.enter().append("path").attr("class",function(P){var U="way line";if(!P.hasInterestingTags()){var B=s.parentRelations(P),z=B.filter(function(G){return G.isMultipolygon()});z.length>0&&B.length===z.length&&(U="relation area")}var V=w[P.id]?"old-multipolygon ":"";return U+" "+M+" "+O+V+P.id}).classed("added",function(P){return!c.entities[P.id]}).classed("geometry-edited",function(P){return s.entities[P.id]&&c.entities[P.id]&&!(0,u8.default)(s.entities[P.id].nodes,c.entities[P.id].nodes)}).classed("retagged",function(P){return s.entities[P.id]&&c.entities[P.id]&&!(0,u8.default)(s.entities[P.id].tags,c.entities[P.id].tags)}).call(ti()).merge(L).sort(f).attr("d",g).call(ti().tags(_5(s))),E}function m(E){return function(){var M=this.parentNode.__data__,F=S[M]||[];return F.filter(function(N){return E?t.selectedIDs().indexOf(N.id)!==-1:t.selectedIDs().indexOf(N.id)===-1})}}function h(E,M,F,N,D){var O=E.selectAll("g."+F).data([M]);O=O.enter().append("g").attr("class",F).merge(O);var L=O.selectAll("path").filter(u).data(function(){return N[this.parentNode.__data__]||[]},function(U){return[U.id,U.index]});L.exit().remove(),L=L.enter().append("path").attr("class",M).merge(L).attr("marker-mid",D).attr("d",function(P){return P.d}),r.ie&&L.each(function(){this.parentNode.insertBefore(this,this)})}for(var g=Pr(e,s),A=[],v={},_={},w={},k=0;k<l.length;k++){var x=l[k];(x.geometry(s)==="line"||x.geometry(s)==="area"&&x.sidednessIdentifier&&x.sidednessIdentifier()==="coastline")&&A.push(x)}A=A.filter(g);let S=pr(A,E=>Math.trunc(E.layer()));Object.keys(S).forEach(function(E){var M=S[E],F=M.filter(function(L){return L.isOneWay()}),N=Q2(e,s,36,L=>L.isOneWayBackwards(),L=>L.isBiDirectional());v[E]=D1(F.map(N));var D=M.filter(function(L){return L.isSided()}),O=Q2(e,s,30);_[E]=D1(D.map(O))});var I=o.selectAll(".layer-osm.covered"),b=o.selectAll(".layer-osm.lines"),y=o.selectAll(".layer-touch.lines");[I,b].forEach(function(E){var M=E===I?d4(-10,0):d4(0,11),F=E.selectAll("g.layergroup").data(M);F=F.enter().append("g").attr("class",function(N){return"layergroup layer"+String(N)}).merge(F),F.selectAll("g.linegroup").data(["shadow","casing","stroke","shadow-highlighted","casing-highlighted","stroke-highlighted"]).enter().append("g").attr("class",function(N){return"linegroup line-"+N}),F.selectAll("g.line-shadow").call(d,"shadow",!1),F.selectAll("g.line-casing").call(d,"casing",!1),F.selectAll("g.line-stroke").call(d,"stroke",!1),F.selectAll("g.line-shadow-highlighted").call(d,"shadow",!0),F.selectAll("g.line-casing-highlighted").call(d,"casing",!0),F.selectAll("g.line-stroke-highlighted").call(d,"stroke",!0),h(F,"oneway","onewaygroup",v,N=>`url(#ideditor-oneway-marker-${Woe(s.entity(N.id).tags)})`),h(F,"sided","sidedgroup",_,function(D){var O=s.entity(D.id).sidednessIdentifier();return"url(#ideditor-sided-marker-"+O+")"})}),y.call(i,s,A,u)}return a}var u8,Q_=q(()=>{"use strict";u8=or(go(),1);bn();Tr();El();lr();Ie();Li()});var JB={};j(JB,{svgMidpoints:()=>B5});function B5(e,t){var r=8;function n(a,o,s,l){var u=t.getDebug("target")?"pink ":"nocolor ",c=jt(e).geojson,f=s.map(function(m){return{type:"Feature",id:m.id,properties:{target:!0,entity:m},geometry:{type:"Point",coordinates:m.loc}}}),d=a.selectAll(".midpoint.target").filter(function(m){return l(m.properties.entity)}).data(f,function(h){return h.id});d.exit().remove(),d.enter().append("circle").attr("r",r).merge(d).attr("class",function(m){return"node midpoint target "+u+m.id}).attr("transform",c)}function i(a,o,s,l,u){var c=a.selectAll(".layer-osm.points .points-group.midpoints"),f=a.selectAll(".layer-touch.points"),d=t.mode();if(d&&d.id!=="select"||!t.map().withinEditableZoom()){c.selectAll(".midpoint").remove(),f.selectAll(".midpoint.target").remove();return}for(var m=u.polygon(),h={},g=0;g<s.length;g++){var A=s[g];if(A.type==="way"&&l(A)&&!(t.selectedIDs().indexOf(A.id)<0))for(var v=o.childNodes(A),_=0;_<v.length-1;_++){var w=v[_],k=v[_+1],x=[w.id,k.id].sort().join("-");if(h[x])h[x].parents.push(A);else if(ft(e(w.loc),e(k.loc))>40){var S=Qt(w.loc,k.loc,.5),I=null;if(u.intersects(S))I=S;else for(var b=0;b<4;b++)if(S=ra([w.loc,k.loc],[m[b],m[b+1]]),S&&ft(e(w.loc),e(S))>20&&ft(e(k.loc),e(S))>20){I=S;break}I&&(h[x]={type:"midpoint",id:x,loc:I,edge:[w.id,k.id],parents:[A]})}}}function y(F){if(h[F.id])return!0;for(var N=0;N<F.parents.length;N++)if(l(F.parents[N]))return!0;return!1}var E=c.selectAll(".midpoint").filter(y).data(Object.values(h),function(F){return F.id});E.exit().remove();var M=E.enter().insert("g",":first-child").attr("class","midpoint");M.append("polygon").attr("points","-6,8 10,0 -6,-8").attr("class","shadow"),M.append("polygon").attr("points","-3,4 5,0 -3,-4").attr("class","fill"),E=E.merge(M).attr("transform",function(F){var N=jt(e),D=o.entity(F.edge[0]),O=o.entity(F.edge[1]),L=fn(D,O,e)*(180/Math.PI);return N(F)+" rotate("+L+")"}).call(ti().tags(function(F){return F.parents[0].tags})),E.select("polygon.shadow"),E.select("polygon.fill"),f.call(n,o,Object.values(h),y)}return i}var H_=q(()=>{"use strict";Tr();El();He()});var ez={};j(ez,{svgPoints:()=>z5});function z5(e,t){function r(s,l){s.attr("class",l).attr("transform","translate(-8, -23)").attr("d","M 17,8 C 17,13 11,21 8.5,23.5 C 6,21 0,13 0,8 C 0,4 4,-0.5 8.5,-0.5 C 13,-0.5 17,4 17,8 z")}function n(s,l){return l.loc[1]-s.loc[1]}function i(s){var l=t.mode(),u=l&&/^(add|draw|drag|move|rotate)/.test(l.id);return u?s.id:Le.key(s)}function a(s,l,u,c){var f=t.getDebug("target")?"pink ":"nocolor ",d=jt(e).geojson,m=t.activeID(),h=[];u.forEach(function(A){m!==A.id&&h.push({type:"Feature",id:A.id,properties:{target:!0,entity:A},geometry:A.asGeoJSON()})});var g=s.selectAll(".point.target").filter(function(A){return c(A.properties.entity)}).data(h,function(v){return v.id});g.exit().remove(),g.enter().append("rect").attr("x",-10).attr("y",-26).attr("width",20).attr("height",30).merge(g).attr("class",function(A){return"node point target "+f+A.id}).attr("transform",d)}function o(s,l,u,c){var f=t.surface().classed("fill-wireframe"),d=Yt(e.scale()),m=t.history().base();function h(k){return k.geometry(l)==="point"&&!(d>=18&&k.directions(l,e).length)}var g=f?[]:u.filter(h);g.sort(n);var A=s.selectAll(".layer-osm.points .points-group.points"),v=s.selectAll(".layer-touch.points"),_=A.selectAll("g.point").filter(c).data(g,i);_.exit().remove();var w=_.enter().append("g").attr("class",function(k){return"node point "+k.id}).order();w.append("path").call(r,"shadow"),w.append("ellipse").attr("cx",.5).attr("cy",1).attr("rx",6.5).attr("ry",3).attr("class","stroke"),w.append("path").call(r,"stroke"),w.append("use").attr("transform","translate(-5.5, -20)").attr("class","icon").attr("width","12px").attr("height","12px"),_=_.merge(w).attr("transform",jt(e)).classed("added",function(k){return!m.entities[k.id]}).classed("moved",function(k){return m.entities[k.id]&&!(0,j_.default)(l.entities[k.id].loc,m.entities[k.id].loc)}).classed("retagged",function(k){return m.entities[k.id]&&!(0,j_.default)(l.entities[k.id].tags,m.entities[k.id].tags)}).call(ti()),_.select(".shadow"),_.select(".stroke"),_.select(".icon").attr("xlink:href",function(k){var x=Pe.match(k,l),S=x&&x.icon;return S?"#"+S:""}),v.call(a,l,g,c)}return o}var j_,Y_=q(()=>{"use strict";j_=or(go(),1);He();lr();Tr();El();At()});var tz={};j(tz,{svgTurns:()=>q5});function q5(e,t){function r(i){var a=i.u?"-u":"";return i.no?"#iD-turn-no"+a:i.only?"#iD-turn-only"+a:"#iD-turn-yes"+a}function n(i,a,o){function s(g){var A=50,v=a.entity(g.to.way),_=a.childNodes(v).map(function(E){return E.loc}).map(e),w=qo(_),k=w/2,x=a.entity(g.to.node),S=a.entity(g.to.vertex),I=fn(S,x,e),b=e(S.loc),y=g.u?0:v.__via?Math.min(k,A):A;return"translate("+(y*Math.cos(I)+b[0])+","+(y*Math.sin(I)+b[1])+") rotate("+I*180/Math.PI+")"}var l=i.selectAll(".layer-osm.points .points-group.turns"),u=i.selectAll(".layer-touch.turns"),c=l.selectAll("g.turn").data(o,function(g){return g.key});c.exit().remove();var f=c.enter().append("g").attr("class",function(g){return"turn "+g.key}),d=f.filter(function(g){return!g.u});d.append("rect").attr("transform","translate(-22, -12)").attr("width","44").attr("height","24"),d.append("use").attr("transform","translate(-22, -12)").attr("width","44").attr("height","24");var m=f.filter(function(g){return g.u});m.append("circle").attr("r","16"),m.append("use").attr("transform","translate(-16, -16)").attr("width","32").attr("height","32"),c=c.merge(f).attr("opacity",function(g){return g.direct===!1?"0.7":null}).attr("transform",s),c.select("use").attr("xlink:href",r),c.select("rect"),c.select("circle");var h=t.getDebug("target")?"pink ":"nocolor ";return c=u.selectAll("g.turn").data(o,function(g){return g.key}),c.exit().remove(),f=c.enter().append("g").attr("class",function(g){return"turn "+g.key}),d=f.filter(function(g){return!g.u}),d.append("rect").attr("class","target "+h).attr("transform","translate(-22, -12)").attr("width","44").attr("height","24"),m=f.filter(function(g){return g.u}),m.append("circle").attr("class","target "+h).attr("r","16"),c=c.merge(f).attr("transform",s),c.select("rect"),c.select("circle"),this}return n}var K_=q(()=>{"use strict";He()});var rz={};j(rz,{svgVertices:()=>Ml});function Ml(e,t){var r={shadow:[6,7.5,7.5,12],stroke:[2.5,3.5,3.5,8],fill:[1,1.5,1.5,1.5]},n,i={},a={},o={},s={},l={},u={};function c(_,w){return w.loc[1]-_.loc[1]}function f(_){var w=t.mode(),k=w&&/^(add|draw|drag|move|rotate)/.test(w.id);return k?_.id:Le.key(_)}function d(_,w,k,x,S){x=x||{selected:{},important:{},hovered:{}};var I={},b={},y=t.surface().classed("fill-wireframe"),E=Yt(e.scale()),M=E<17?0:E<18?1:2,F=t.activeID(),N=t.history().base();function D(G){var W=w.entity(G.id);return W.id in I||(I[W.id]=W.hasInterestingTags()&&Pe.match(W,w).icon),I[W.id]}function O(G){if(G.id in b)return b[G.id];var W=G.directions(w,e);return b[G.id]=W.length?W:!1,W}function L(G){["shadow","stroke","fill"].forEach(function(W){var Y=r[W];G.selectAll("."+W).each(function(J){var oe=M&&D(J),Ce=Y[oe?3:M];J.id!==F&&J.isEndpoint(w)&&!J.isConnected(w)&&(Ce+=1.5),W==="shadow"&&(u[J.id]=Ce),Q(this).attr("r",Ce).attr("visibility",oe&&W==="fill"?"hidden":null)})})}k.sort(c);var P=_.selectAll("g.vertex").filter(S).data(k,f);P.exit().remove();var U=P.enter().append("g").attr("class",function(G){return"node vertex "+G.id}).order();U.append("circle").attr("class","shadow"),U.append("circle").attr("class","stroke"),U.filter(function(G){return G.hasInterestingTags()}).append("circle").attr("class","fill"),P=P.merge(U).attr("transform",jt(e)).classed("sibling",function(G){return G.id in x.selected}).classed("shared",function(G){return w.isShared(G)}).classed("endpoint",function(G){return G.isEndpoint(w)}).classed("added",function(G){return!N.entities[G.id]}).classed("moved",function(G){return N.entities[G.id]&&!(0,c8.default)(w.entities[G.id].loc,N.entities[G.id].loc)}).classed("retagged",function(G){return N.entities[G.id]&&!(0,c8.default)(w.entities[G.id].tags,N.entities[G.id].tags)}).call(ti()).call(L);var B=P.selectAll(".icon").data(function(W){return E>=17&&D(W)?[W]:[]},f);B.exit().remove(),B.enter().append("use").attr("class","icon").attr("width","12px").attr("height","12px").attr("transform","translate(-6, -6)").attr("xlink:href",function(G){var W=D(G);return W?"#"+W:""});var z=P.selectAll(".viewfieldgroup").data(function(W){return E>=18&&O(W)?[W]:[]},f);z.exit().remove(),z=z.enter().insert("g",".shadow").attr("class","viewfieldgroup").merge(z);var V=z.selectAll(".viewfield").data(O,function(W){return Le.key(W)});V.exit().remove(),V.enter().append("path").attr("class","viewfield").attr("d","M0,0H0").merge(V).attr("marker-start","url(#ideditor-viewfield-marker"+(y?"-wireframe":"")+")").attr("transform",function(G){return"rotate("+G+")"})}function m(_,w,k,x){var S=t.getDebug("target")?"pink ":"nocolor ",I=t.getDebug("target")?"red ":"nocolor ",b=jt(e).geojson,y=t.activeID(),E={targets:[],nopes:[]};k.forEach(function(N){if(y!==N.id){var D=W2(N,w,y);D!==0?E.targets.push({type:"Feature",id:N.id,properties:{target:!0,entity:N},geometry:N.asGeoJSON()}):E.nopes.push({type:"Feature",id:N.id+"-nope",properties:{nope:!0,target:!0,entity:N},geometry:N.asGeoJSON()})}});var M=_.selectAll(".vertex.target-allowed").filter(function(N){return x(N.properties.entity)}).data(E.targets,function(D){return D.id});M.exit().remove(),M.enter().append("circle").attr("r",function(N){return u[N.id]||r.shadow[3]}).merge(M).attr("class",function(N){return"node vertex target target-allowed "+S+N.id}).attr("transform",b);var F=_.selectAll(".vertex.target-nope").filter(function(N){return x(N.properties.entity)}).data(E.nopes,function(D){return D.id});F.exit().remove(),F.enter().append("circle").attr("r",function(N){return u[N.properties.entity.id]||r.shadow[3]}).merge(F).attr("class",function(N){return"node vertex target target-nope "+I+N.id}).attr("transform",b)}function h(_,w,k,x){var S=_.geometry(w);return S==="vertex"||S==="point"&&(k||x>=18&&_.directions(w,e).length)}function g(_,w,k){var x=w.entities[_.id],S=k.entities[_.id];return!S||!x||!(0,c8.default)(S.tags,x.tags)||!(0,c8.default)(S.loc,x.loc)}function A(_,w,k,x){var S={},I={};function b(y){if(!I[y.id]){I[y.id]=!0;var E=y.geometry(w);if(!t.features().isHiddenFeature(y,w,E)){var M;if(y.type==="way")for(M=0;M<y.nodes.length;M++){var F=w.hasEntity(y.nodes[M]);F&&b(F)}else if(y.type==="relation")for(M=0;M<y.members.length;M++){var N=w.hasEntity(y.members[M].id);N&&b(N)}else h(y,w,k,x)&&(S[y.id]=y)}}}return _.forEach(function(y){var E=w.hasEntity(y);E&&(E.type==="node"?h(E,w,k,x)&&(S[E.id]=E,w.parentWays(E).forEach(function(M){b(M)})):b(E))}),S}function v(_,w,k,x,S,I){var b=t.surface().classed("fill-wireframe"),y=t.surface().classed("highlight-edited"),E=Yt(e.scale()),M=t.mode(),F=M&&/^(add|draw|drag|move|rotate)/.test(M.id),N=t.history().base(),D=_.selectAll(".layer-osm.points .points-group.vertices"),O=_.selectAll(".layer-touch.points");I&&(i={},u={});for(var L=0;L<k.length;L++){var P=k[L],U=P.geometry(w),B=!1;(U==="point"&&h(P,w,b,E)||U==="vertex"&&(P.hasInterestingTags()||P.isEndpoint(w)||P.isConnected(w)||y&&g(P,N,w)))&&(i[P.id]=P,B=!0),!B&&!I&&delete i[P.id]}var z={persistent:i,selected:s,hovered:a},V=Object.assign({},F?a:{},s,i),G=function(J){return J.id in i||J.id in s||J.id in a||x(J)};D.call(d,w,Y(V),z,G);var W=function(J){return F?!0:G(J)};O.call(m,w,Y(V),W);function Y(J){return Object.keys(J).map(w.hasEntity,w).filter(function(oe){return oe&&oe.intersects(S,w)})}}return v.drawSelected=function(_,w,k){var x=t.surface().classed("fill-wireframe"),S=Yt(e.scale());l=s||{},t.map().isInWideSelection()?(s={},t.selectedIDs().forEach(function(b){var y=w.hasEntity(b);y&&y.type==="node"&&h(y,w,x,S)&&(s[y.id]=y)})):s=A(t.selectedIDs(),w,x,S);var I=function(b){return b.id in l};v(_,w,Object.values(l),I,k,!1)},v.drawHover=function(_,w,k,x){if(k!==n){var S=t.surface().classed("fill-wireframe"),I=Yt(e.scale());o=a||{},n=k;var b=k&&k.properties&&k.properties.entity;b?a=A([b.id],w,S,I):a={};var y=function(E){return E.id in o};v(_,w,Object.values(o),y,x,!1)}},v}var c8,X_=q(()=>{"use strict";c8=or(go(),1);Ae();At();He();lr();Tr();El()});var nz={};j(nz,{svgAreas:()=>E5,svgData:()=>Al,svgDebug:()=>Sl,svgDefs:()=>S5,svgGeolocate:()=>Ra,svgIcon:()=>ce,svgKartaviewImages:()=>qa,svgKeepRight:()=>M5,svgLabels:()=>T5,svgLayers:()=>Cl,svgLines:()=>Il,svgMapilioImages:()=>Va,svgMapillaryImages:()=>Ba,svgMapillarySigns:()=>za,svgMarkerSegments:()=>Q2,svgMidpoints:()=>B5,svgNotes:()=>R5,svgOsm:()=>P5,svgPanoramaxImages:()=>$a,svgPassiveVertex:()=>W2,svgPath:()=>Pr,svgPointTransform:()=>jt,svgPoints:()=>z5,svgRelationMemberTags:()=>_5,svgSegmentWay:()=>kl,svgStreetside:()=>La,svgTagClasses:()=>ti,svgTagPattern:()=>k5,svgTouch:()=>L5,svgTurns:()=>q5,svgVegbilder:()=>Ua,svgVertices:()=>Ml});var Sn=q(()=>{"use strict";A_();Sm();Cm();P_();Im();ot();Mm();F_();W_();Q_();Fm();Om();H_();zm();Tr();Rm();Bm();Tr();Tr();Tr();Y_();Tr();Tr();Dm();Pm();El();_m();qm();K_();X_();Lm();Um()});var iz={};j(iz,{uiLengthIndicator:()=>Mo});function Mo(e){var t=Q(null),r=_l("tooltip max-length-warning").placement("bottom").hasArrow(!0).content(()=>a=>{a.text(""),a.call(ce("#iD-icon-alert","inline")),a.call(T.append("inspector.max_length_reached",{maxChars:e}))}),n=!1,i=function(a){t=a.selectAll("span.length-indicator-wrap").data([0]),t=t.enter().append("span").merge(t).classed("length-indicator-wrap",!0),a.call(r)};return i.update=function(a){let o=Xo(po(a,Number.POSITIVE_INFINITY)),s=t.selectAll("span.length-indicator").data([o]);s.enter().append("span").merge(s).classed("length-indicator",!0).classed("limit-reached",l=>l>e).style("border-right-width",l=>`${Math.abs(e-l)*2}px`).style("margin-right",l=>l>e?`${(e-l)*2}px`:0).style("opacity",l=>l>e*.8?Math.min(1,(l/e-.8)/(1-.8)):0).style("pointer-events",l=>l>e*.8?null:"none"),!n&&(o>e?r.show():r.hide())},i.silent=function(a){return arguments.length?(n=a,i):n},i}var f8=q(()=>{"use strict";Ae();ue();Sn();Ie();r8()});var az={};j(az,{uiFieldCombo:()=>di,uiFieldManyCombo:()=>di,uiFieldMultiCombo:()=>di,uiFieldNetworkCombo:()=>di,uiFieldSemiCombo:()=>di,uiFieldTypeCombo:()=>di});function di(e,t){var r=xe("change"),n=e.type==="multiCombo"||e.type==="manyCombo",i=e.type==="networkCombo",a=e.type==="semiCombo",o=e.type!=="manyCombo"&&e.autoSuggestions!==!1,s=e.type!=="manyCombo"&&e.customValues!==!1,l=e.snake_case||e.snake_case===void 0,u=qt(t,"combo-"+e.safeid).caseSensitive(e.caseSensitive).minItems(1),c=Q(null),f=Q(null),d=Q(null),m=Mo(t.maxCharsForTagValue()),h=[],g=[],A=[],v,_,w,k=[],x=[];it.get("deprecated").then(function(se){x=se}).catch(function(){}),n&&e.key&&/[^:]$/.test(e.key)&&(e.key+=":");function S(se){return se.replace(/\s+/g,"_")}function I(se){return se.split(";").map(function(ne){return ne.trim()}).join(";")}function b(se){se=I(se||"");var ne=O(!0).find(function(he){return he.key&&I(he.value)===se});return ne?ne.key:e.type==="typeCombo"&&!se?"yes":y(se)||void 0}function y(se){return l&&(se=S(se)),e.caseSensitive||(se=se.toLowerCase()),se}function E(se,ne){return se.hasTextForStringId(`options.${ne}.title`)?`options.${ne}.title`:`options.${ne}`}function M(se){se=se||"";var ne=e.resolveReference("stringsCrossReference");let he=E(ne,se);return ne.hasTextForStringId(he)?ne.t(he,{default:se}):e.type==="typeCombo"&&se.toLowerCase()==="yes"?"":se}function F(se){se=se||"";var ne=e.resolveReference("stringsCrossReference");let he=E(ne,se);return ne.hasTextForStringId(he)?ne.t.append(he,{default:se}):(e.type==="typeCombo"&&se.toLowerCase()==="yes"&&(se=""),Se=>Se.text(se))}function N(se,ne){return se.filter(function(he){return!ne.some(function(Se){return he.value===Se.value})})}function D(se,ne){s||se.attr("readonly","readonly"),o&&de.taginfo?(se.call(u.fetcher(U),ne),U("",z)):(se.call(u,ne),setTimeout(()=>P(z),0))}function O(se){var ne=e.resolveReference("stringsCrossReference");if(!(e.options||ne.options))return[];let he;return se!==!0?he=e.options||ne.options:he=[].concat(e.options,ne.options).filter(Boolean),[...he.map(function(re){let Z=E(ne,re);return{key:re,value:ne.t(Z,{default:re}),title:ne.t(`options.${re}.description`,{default:re}),display:B(ne.t.append(Z,{default:re}),re),klass:ne.hasTextForStringId(Z)?"":"raw-option"}}),...k]}function L(){return O().length>0}function P(se,ne){h=O(),ne!==void 0&&(h=h.filter(ne)),h=N(h,g),u.data(h),c.classed("empty-combobox",h.length===0),se&&se(h)}function U(se,ne){var he=we=>we.value.toLowerCase().includes(se.toLowerCase())||we.key.toLowerCase().includes(se.toLowerCase());L()&&P(ne,he);var Se=e.resolveReference("stringsCrossReference"),re=n?"multikeys":"values",Z=(n?e.key:"")+se,te=i&&_&&_.indexOf(se.toLowerCase())===0;te&&(Z=_+":");var ye={debounce:se!=="",key:e.key,query:Z};A.length&&(ye.geometry=t.graph().geometry(A[0])),de.taginfo[re](ye,function(we,Ne){if(we)return;Ne=Ne.filter(ie=>e.type!=="typeCombo"||ie.value!=="yes"),Ne=Ne.filter(ie=>{var ve=ie.value;return n&&(ve=ve.slice(e.key.length)),ve===y(ve)});var Be=p_(x)[e.key];Be&&(Ne=Ne.filter(ie=>!Be.includes(ie.value))),te&&(Ne=Ne.filter(ie=>ie.value.toLowerCase().indexOf(_+":")===0));let le=(e.options||Se.options||[]).filter(ie=>!Ne.some(ve=>ve.value===(n?e.key+ie:ie))).map(ie=>({value:ie}));c.classed("empty-combobox",Ne.length===0),h=Ne.concat(le).map(function(ie){var ve=ie.value;n&&(ve=ve.replace(e.key,""));let be=E(Se,ve);var Te=Se.hasTextForStringId(be),Oe=Se.t(be,{default:ve});return{key:ve,value:Oe,title:Se.t(`options.${ve}.description`,{default:Te?ve:ie.title!==Oe?ie.title:""}),display:B(Se.t.append(be,{default:ve}),ve),klass:Te?"":"raw-option"}}),h=h.filter(he),h=N(h,g),ne&&ne(h,L())})}function B(se,ne){let he=e.resolveReference("iconsCrossReference");return he.icons?function(Se){var re=Se.insert("span",":first-child").attr("class","tag-value-icon");he.icons[ne]&&re.call(ce(`#${he.icons[ne]}`)),se.call(this,Se)}:se}function z(se){if(n||a)w=e.placeholder()||T("inspector.add");else{var ne=se.map(function(Z){return Z.value}).filter(function(Z){return Z.length<20}),he=ne.length>1?ne:se.map(function(Z){return Z.key});w=e.placeholder()||he.slice(0,3).join(", ")}/(…|\.\.\.)$/.test(w)||(w+="\u2026");var Se;!n&&!a&&v&&Array.isArray(v[e.key])?Se=T("inspector.multiple_values"):Se=w,c.selectAll("input").attr("placeholder",Se);var re=!s&&!se.length;c.selectAll(".chiplist .input-wrap").style("display",re?"none":null)}function V(){var se={},ne;if(n||a){var he;if(n?he=[b($e(d))]:a&&(ne=b($e(d))||"",ne=ne.replace(/,/g,";"),he=ne.split(";")),he=he.filter(Boolean),!he.length)return;if(c.classed("active",!1),$e(d,""),n)Je(he).forEach(function(Z){var te=(e.key||"")+Z;if(v){var ye=v[te];if(typeof ye=="string"&&ye.toLowerCase()!=="no")return}te=t.cleanTagKey(te),e.keys.push(te),se[te]="yes"});else if(a){var Se=g.map(function(Z){return Z.key});Se=Se.concat(he),se[e.key]=t.cleanTagValue(Je(Se).filter(Boolean).join(";"))}window.setTimeout(function(){d.node().focus()},10)}else{var re=$e(d);if(!re&&Array.isArray(v[e.key]))return;ne=t.cleanTagValue(b(re)),se[e.key]=ne||void 0}r.call("change",this,se)}function G(se,ne){se.preventDefault(),se.stopPropagation();var he={};if(n)he[ne.key]=void 0;else if(a){var Se=g.map(function(re){return re.key===ne.key?null:re.key}).filter(Boolean);Se=Je(Se),he[e.key]=Se.length?Se.join(";"):void 0,m.update(he[e.key])}r.call("change",this,he)}function W(se,ne){se.preventDefault(),se.stopPropagation();var he={};n&&(he[ne.key]=v[ne.key]==="yes"?"no":"yes"),r.call("change",this,he)}function Y(se){c=se.selectAll(".form-field-input-wrap").data([0]);var ne=n||a?"multicombo":"combo";if(c=c.enter().append("div").attr("class","form-field-input-wrap form-field-input-"+ne).merge(c),n||a){c=c.selectAll(".chiplist").data([0]);var he="chiplist";(e.key==="destination"||e.key==="via")&&(he+=" full-line-chips"),c=c.enter().append("ul").attr("class",he).on("click",function(){window.setTimeout(function(){d.node().focus()},10)}).merge(c),f=c.selectAll(".input-wrap").data([0]),f=f.enter().append("li").attr("class","input-wrap").merge(f);var Se=!s&&!h.length;f.style("display",Se?"none":null),d=f.selectAll("input").data([0])}else d=c.selectAll("input").data([0]);if(d=d.enter().append("input").attr("type","text").attr("id",e.domId).call(st).call(D,c).merge(d),a?f.call(m):n||c.call(m),i){var re=Ce(),Z=re&&Y4(re.center());_=Z&&Z.toLowerCase()}d.on("change",V).on("blur",V).on("input",function(){let te=$e(d);J(te),a&&v[e.key]&&(te+=";"+v[e.key]),m.update(te)}),d.on("keydown.field",function(te){switch(te.keyCode){case 13:d.node().blur(),te.stopPropagation();break}}),(n||a)&&(u.on("accept",function(){d.node().blur(),d.node().focus()}),d.on("focus",function(){c.classed("active",!0)})),u.on("cancel",function(){d.node().blur()}).on("update",function(){J($e(d))})}function J(se){se=b(se);let ne=c;(e.type==="multiCombo"||e.type==="semiCombo")&&(ne=c.select(".input-wrap"));let he=e.resolveReference("iconsCrossReference");he.icons&&(ne.selectAll(".tag-value-icon").remove(),he.icons[se]&&ne.selectAll(".tag-value-icon").data([se]).enter().insert("div","input").attr("class","tag-value-icon").call(ce(`#${he.icons[se]}`)))}Y.tags=function(se){v=se;var ne=e.resolveReference("stringsCrossReference"),he=Array.isArray(se[e.key]),Se=rt=>!he&&rt&&!(e.type==="typeCombo"&&rt==="yes"),re=rt=>Se(rt)&&!ne.hasTextForStringId(`options.${rt}`)&&!ne.hasTextForStringId(`options.${rt}.title`),Z=rt=>Se(rt)&&!re(rt),te=!s;if(n||a){g=[];var ye;if(n){for(var we in se)if(!(e.key&&we.indexOf(e.key)!==0)&&!(!e.key&&e.keys.indexOf(we)===-1)){var Ne=se[we],Be=e.key?we.slice(e.key.length):we;g.push({key:we,value:M(Be),display:B(F(Be),Be),state:typeof Ne=="string"?Ne.toLowerCase():"",isMixed:Array.isArray(Ne)})}e.key?(e.keys=g.map(function(We){return We.key}),ye=t.maxCharsForTagKey()-Xo(e.key)):ye=t.maxCharsForTagKey()}else if(a){var le=[],ie;Array.isArray(se[e.key])?(se[e.key].forEach(function(We){var Rt=Je((We||"").split(";")).filter(Boolean);le=le.concat(Rt),ie?ie=ie.filter(lt=>Rt.includes(lt)):ie=Rt}),le=Je(le).filter(Boolean)):(le=Je((se[e.key]||"").split(";")).filter(Boolean),ie=le),g=le.map(function(We){return{key:We,value:M(We),display:B(F(We),We),isMixed:!ie.includes(We)}});var ve=Xo(ie.join(";"));ye=t.maxCharsForTagValue()-ve,ve>0&&(ye-=1)}ye=Math.max(0,ye);var be=ye<=0||!s&&!h.length;c.selectAll(".chiplist .input-wrap").style("display",be?"none":null);var Te=a&&!Array.isArray(se[e.key]),Oe=c.selectAll(".chip").data(g);Oe.exit().remove();var Ve=Oe.enter().insert("li",".input-wrap").attr("class","chip");Ve.append("span"),Ve.append("div").attr("class","field_buttons").append("a").attr("class","remove"),Oe=Oe.merge(Ve).order().classed("raw-value",function(We){var Rt=We.key;return n&&(Rt=Rt.replace(e.key,"")),!ne.hasTextForStringId("options."+Rt)}).classed("draggable",Te).classed("mixed",function(We){return We.isMixed}).attr("title",function(We){return We.isMixed?T("inspector.unshared_value_tooltip"):["yes","no"].includes(We.state)?null:We.state}).classed("negated",We=>We.state==="no"),a||(Oe.selectAll("input[type=checkbox]").remove(),Oe.insert("input","span").attr("type","checkbox").property("checked",We=>We.state==="yes").property("indeterminate",We=>We.isMixed||!["yes","no"].includes(We.state)).on("click",W)),Te&&oe(Oe),Oe.each(function(We){let Rt=Q(this),lt=Rt.select("span"),vt=Rt.select(".field_buttons"),_t=We.value.trim();if(lt.text(""),vt.select("button").empty()||vt.select("button").remove(),_t.startsWith("https://")){lt.text(_t),vt.append("button").call(ce("#iD-icon-out-link")).attr("class","form-field-button foreign-id-permalink").attr("title",()=>T("icons.visit_website")).attr("aria-label",()=>T("icons.visit_website")).on("click",function(wr){wr.preventDefault(),window.open(_t,"_blank")});return}if(We.display){We.display(lt);return}lt.text(We.value)}),Oe.select("a.remove").attr("href","#").on("click",G).attr("class","remove").text("\xD7"),J("")}else{var Qe=he&&se[e.key].map(function(rt){return M(rt)}).filter(Boolean);$e(d,he?"":M(se[e.key])).data([se[e.key]]).classed("raw-value",re).classed("known-value",Z).attr("readonly",te?"readonly":void 0).attr("title",he?Qe.join(`
80
+ `},"");return{key:g,title:T.html(g+".title"),html:Ot(A.trim())}});function c(){m(),a.classed("hide",!1).style("opacity","0").transition().duration(200).style("opacity","1")}function f(){a.classed("hide",!0).transition().duration(200).style("opacity","0").on("end",function(){a.classed("hide",!0)})}function d(h){var g=u[h],A=o[t][h][1];a.selectAll(".field-help-nav-item").classed("active",function(_,w){return w===h});var v=a.selectAll(".field-help-content").html(g.html);v.selectAll("p").attr("class",function(_,w){return A[w]}),g.key==="help.field.restrictions.inspecting"?v.insert("img","p.from_shadow").attr("class","field-help-image cf").attr("src",e.imagePath("tr_inspect.gif")):g.key==="help.field.restrictions.modifying"&&v.insert("img","p.allow_turn").attr("class","field-help-image cf").attr("src",e.imagePath("tr_modify.gif"))}r.button=function(h){if(!a.empty()){var g=h.selectAll(".field-help-button").data([0]);g.enter().append("button").attr("class","field-help-button").call(ce("#iD-icon-help")).merge(g).on("click",function(A){A.stopPropagation(),A.preventDefault(),a.classed("hide")?c():f()})}};function m(){var h=i.node(),g=n.node(),A=h.getBoundingClientRect(),v=g.getBoundingClientRect();a.style("top",A.top+g.scrollTop-v.top+"px")}return r.body=function(h){if(i=h.selectAll(".form-field-input-wrap"),!i.empty()&&(n=e.container().select(".sidebar .entity-editor-pane .inspector-body"),!n.empty())){a=n.selectAll(".field-help-body").data([0]);var g=a.enter().append("div").attr("class","field-help-body hide"),A=g.append("div").attr("class","field-help-title cf");A.append("h2").attr("class",pe.textDirection()==="rtl"?"fr":"fl").call(T.append("help.field."+t+".title")),A.append("button").attr("class","fr close").attr("title",T("icons.close")).on("click",function(w){w.stopPropagation(),w.preventDefault(),f()}).call(ce("#iD-icon-close"));var v=g.append("div").attr("class","field-help-nav cf"),_=u.map(function(w){return w.title});v.selectAll(".field-help-nav-item").data(_).enter().append("div").attr("class","field-help-nav-item").html(function(w){return w}).on("click",function(w,k){w.stopPropagation(),w.preventDefault(),d(_.indexOf(k))}),g.append("div").attr("class","field-help-content"),a=a.merge(g),d(0)}},r}var bm=q(()=>{"use strict";Ae();J3();ue();ot();So()});var ZU={};j(ZU,{uiFieldCheck:()=>Vs,uiFieldDefaultCheck:()=>Vs,uiFieldOnewayCheck:()=>Vs});function Vs(e,t){var r=xe("change"),n=e.options,i=[],a=[],o,s=Q(null),l=Q(null),u=Q(null),c=Q(null),f,d=[],m,h=e.resolveReference("stringsCrossReference");if(!n&&h.options&&(n=h.options),n)for(var g in n){var A=n[g];i.push(A==="undefined"?void 0:A),a.push(h.t.html("options."+A,{default:A}))}else i=[void 0,"yes"],a=[T.html("inspector.unknown"),T.html("inspector.check.yes")],e.type!=="defaultCheck"&&(i.push("no"),a.push(T.html("inspector.check.no")));function v(){if(f=e.id==="oneway_yes",e.id==="oneway"){var x=t.entity(d[0]);x.type==="way"&&x.isOneWay()&&(f=!0,a[0]=T.html("_tagging.presets.fields.oneway_yes.options.undefined"))}}function _(){return t.container().select("div.inspector-hover").empty()?!(m==="yes"||f&&!m):!0}function w(x){var S=d.length&&t.hasEntity(d[0]);if(_()||!S)return x;var I=S.first(),b=S.isClosed()?S.nodes[S.nodes.length-2]:S.last(),y=I<b,E=y?"#iD-icon-forward":"#iD-icon-backward";return x.selectAll(".reverser-span").html("").call(T.append("inspector.check.reverser")).call(ce(E,"inline")),x}var k=function(x){v(),u=x.selectAll(".form-field-input-wrap").data([0]);var S=u.enter().append("label").attr("class","form-field-input-wrap form-field-input-check");S.append("input").property("indeterminate",e.type!=="defaultCheck").attr("type","checkbox").attr("id",e.domId),S.append("span").html(a[0]).attr("class","value"),e.type==="onewayCheck"&&S.append("button").attr("class","reverser"+(_()?" hide":"")).append("span").attr("class","reverser-span"),u=u.merge(S),s=u.selectAll("input"),l=u.selectAll("span.value"),s.on("click",function(I){I.stopPropagation();var b={};Array.isArray(o[e.key])?i.indexOf("yes")!==-1?b[e.key]="yes":b[e.key]=i[0]:b[e.key]=i[(i.indexOf(m)+1)%i.length],(b[e.key]==="reversible"||b[e.key]==="alternating")&&(b[e.key]=i[0]),r.call("change",this,b)}),e.type==="onewayCheck"&&(c=u.selectAll(".reverser"),c.call(w).on("click",function(I){I.preventDefault(),I.stopPropagation(),t.perform(function(b){for(var y in d)b=Ji(d[y])(b);return b},T("operations.reverse.annotation.line",{n:1})),t.validator().validate(),Q(this).call(w)}))};return k.entityIDs=function(x){return arguments.length?(d=x,k):d},k.tags=function(x){o=x;function S(y){return y!=="no"&&y!==""&&y!==void 0&&y!==null}function I(y){y===""&&(y=void 0);var E=i.indexOf(y);return E!==-1?a[E]:'"'+y+'"'}v();var b=Array.isArray(x[e.key]);m=!b&&x[e.key]&&x[e.key].toLowerCase(),e.type==="onewayCheck"&&(m==="1"||m==="-1")&&(m="yes"),s.property("indeterminate",b||e.type!=="defaultCheck"&&!m).property("checked",S(m)),l.html(b?T.html("inspector.multiple_values"):I(m)).classed("mixed",b),u.classed("set",!!m),e.type==="onewayCheck"&&c.classed("hide",_()).call(w)},k.focus=function(){s.node().focus()},_e(k,r,"on")}var wm=q(()=>{"use strict";Ye();Ae();Yr();ue();c4();ot()});var eB={};j(eB,{svgMarkerSegments:()=>Q2,svgPassiveVertex:()=>W2,svgPath:()=>Pr,svgPointTransform:()=>jt,svgRelationMemberTags:()=>_5,svgSegmentWay:()=>kl});function W2(e,t,r){if(!r)return 1;if(r===e.id)return 0;var n=t.parentWays(e),i,a,o,s,l,u,c,f,d;for(i=0;i<n.length;i++)for(o=n[i].nodes,s=n[i].isClosed(),a=0;a<o.length;a++)if(o[a]===e.id){if(l=a-2,u=a-1,c=a+1,f=a+2,s&&(d=o.length-1,l<0&&(l=d+l),u<0&&(u=d+u),c>d&&(c=c-d),f>d&&(f=f-d)),o[l]===r)return 0;if(o[u]===r)return 2;if(o[c]===r)return 2;if(o[f]===r)return 0;if(s&&o.indexOf(r)!==-1)return 0}return 1}function Q2(e,t,r,n=()=>!1,i=()=>!1){return function(a){let o=0,s=r/2,l=[],u=JU(e),c=t.childNodes(a).map(function(g){return g.loc}),f,d,m=n(a),h=i(a);return ai({type:"LineString",coordinates:c},e.stream(u({lineStart:function(){},lineEnd:function(){f=null},point:function(g,A){if(d=[g,A],f){let v=ft(f,d)-s;if(v>=0){let _=no(f,d),w=r*Math.cos(_),k=r*Math.sin(_),x=[f[0]+s*Math.cos(_),f[1]+s*Math.sin(_)],S=[f,x];for(v-=r;v>=0;v-=r)x=qr(x,[w,k]),S.push(x);S.push(d);let I="";if(!m||h){for(let b=0;b<S.length;b++)I+=(b===0?"M":"L")+S[b][0]+","+S[b][1];l.push({id:a.id,index:o++,d:I})}if(m||h){I="";for(let b=S.length-1;b>=0;b--)I+=(b===S.length-1?"M":"L")+S[b][0]+","+S[b][1];l.push({id:a.id,index:o++,d:I})}}s=-v}f=d}}))),l}}function Pr(e,t,r){let n={},i=e.stream,a=JU(e,r),o=Pi().projection({stream:function(l){return i(a(l))}}),s=function(l){return l.id in n?n[l.id]:n[l.id]=o(l.asGeoJSON(t))};return s.geojson=function(l){return l.__featurehash__!==void 0?l.__featurehash__ in n?n[l.__featurehash__]:n[l.__featurehash__]=o(l):o(l)},s}function jt(e){var t=function(r){var n=e(r.loc);return"translate("+n[0]+","+n[1]+")"};return t.geojson=function(r){return t(r.properties.entity)},t}function _5(e){return function(t){var r=t.tags,n=!t.hasInterestingTags();return e.parentRelations(t).forEach(function(i){var a=i.tags.type;(a==="multipolygon"&&n||a==="boundary")&&(r=Object.assign({},i.tags,r))}),r}}function kl(e,t,r){if(r===void 0)return t.transient(e,"waySegments",n);return n();function n(){for(var i=e.nodes.indexOf(r)!==-1,a={passive:[],active:[]},o={},s={},l,u,c=0;c<e.nodes.length;c++)l=t.entity(e.nodes[c]),u=W2(l,t,r),s={node:l,type:u},o.type!==void 0&&(o.node.id===r||s.node.id===r||(i&&(o.type===2||s.type===2)||o.type===0&&s.type===0?f(o,s,c):d(o,s,c))),o=s;return a;function f(m,h,g){a.active.push({type:"Feature",id:e.id+"-"+g+"-nope",properties:{nope:!0,target:!0,entity:e,nodes:[m.node,h.node],index:g},geometry:{type:"LineString",coordinates:[m.node.loc,h.node.loc]}})}function d(m,h,g){a.passive.push({type:"Feature",id:e.id+"-"+g,properties:{target:!0,entity:e,nodes:[m.node,h.node],index:g},geometry:{type:"LineString",coordinates:[m.node.loc,h.node.loc]}})}}}function JU(e,t=!1){var r=t?65:5,n=e.clipExtent(),i=[[n[0][0]-r,n[0][1]-r],[n[1][0]+r,n[1][1]+r]];return cb().clipExtent(i).stream}var Tr=q(()=>{"use strict";Ta();He()});var tB={};j(tB,{svgTagClasses:()=>ti});function ti(){var e=["building","highway","railway","waterway","aeroway","aerialway","piste:type","boundary","power","amenity","natural","landuse","leisure","military","place","man_made","route","attraction","roller_coaster","building:part","indoor"],t=Object.keys(M1),r=["oneway","bridge","tunnel","embankment","cutting","barrier","surface","tracktype","footway","crossing","service","sport","public_transport","location","parking","golf","type","leisure","man_made","indoor","construction","proposed"],n=function(a){return a.tags},i=function(a){a.each(function(s){var l=this.className;l.baseVal!==void 0&&(l=l.baseVal);var u=n(s),c=i.getClassesString(u,l);c!==l&&Q(this).attr("class",c)})};return i.getClassesString=function(a,o){var s,l,u,c,f,d,m;/\bstroke\b/.test(o)&&a.barrier&&a.barrier!=="no"&&(m="line");var h=o.trim().split(/\s+/).filter(function(E){return E.length&&!/^(tag|custom)-/.test(E)}).map(function(E){return(E==="line"||E==="area")&&m||E});for(u=0;u<e.length;u++)if(f=e[u],d=a[f],!(!d||d==="no")){f==="piste:type"?f="piste":f==="building:part"&&(f="building_part"),s=f,t.indexOf(d)!==-1?(l=d,h.push("tag-"+f)):(h.push("tag-"+f),h.push("tag-"+f+"-"+d));break}if(!s){for(u=0;u<t.length;u++)for(c=0;c<e.length;c++)if(f=t[u]+":"+e[c],d=a[f],!(!d||d==="no")){l=t[u];break}}if(!l)for(u=0;u<t.length&&(f=t[u],d=a[f],!(!(!d||d==="no")&&(d==="yes"||s&&s===d?l=f:!s&&e.indexOf(d)!==-1&&(l=f,s=d,h.push("tag-"+d)),l)));u++);for(l&&(h.push("tag-status"),h.push("tag-status-"+l)),u=0;u<r.length;u++)f=r[u],d=a[f],!(!d||d==="no"||f===s)&&(h.push("tag-"+f),h.push("tag-"+f+"-"+d));if(s==="highway"&&!uo[a.highway]||s==="aeroway"){var g=a.highway==="track"?"unpaved":"paved";for(f in a)d=a[f],f in m2&&(g=m2[f][d]?"paved":"unpaved"),f in Sd&&Sd[f][d]&&(g="semipaved");h.push("tag-"+g)}var A=a.wikidata||a["flag:wikidata"]||a["brand:wikidata"]||a["network:wikidata"]||a["operator:wikidata"];A&&h.push("tag-wikidata");var v=a["custom:element_type"];v&&(h.push("tag-custom"),h.push("tag-custom-"+v));var _=a["ext:data_change"];_&&(h.push("tag-ext-data-change"),h.push("tag-ext-data-change-"+_));var w=a["ext:addition"];w&&(h.push("tag-ext-addition"),h.push("tag-ext-addition-"+w));var k=a["ext:deletion"];k&&(h.push("tag-ext-deletion"),h.push("tag-ext-deletion-"+k));var x=a.element_type;x&&(h.push("tag-element-type"),h.push("tag-element-type-"+x));var S=a.lane_marking_type;S&&(h.push("tag-lane-marking-type"),h.push("tag-lane-marking-type-"+S));var I=/^(roadside|paved_shoulder|unpaved_shoulder|sideslope):(left|right|both)$/;for(f in a)if(d=a[f],!(!d||!I.test(f))){var b="highway-"+f.replace(/:/g,"-");h.push(b),h.push(b+"-"+d)}var y=a["custom:visited"];return y==="yes"?h.push("tag-visited"):y==="no"?h.push("tag-unvisited"):y&&h.push("tag-visited-unknown"),h.filter(E=>/^[-_a-z0-9]+$/.test(E)).join(" ").trim()},i.tags=function(a){return arguments.length?(n=a,i):n},i}var El=q(()=>{"use strict";Ae();Dr()});var rB={};j(rB,{svgTagPattern:()=>k5});function k5(e){if(e.building&&e.building!=="no")return null;for(var t in xm){var r=e[t];if(r){if(typeof xm[t]=="string")return"pattern-"+xm[t];var n=xm[t];for(var i in n)if(r===i){var a=n[i];if(typeof a=="string")return"pattern-"+a;for(var o in a){var s=a[o],l=!0;for(var u in s)if(u!=="pattern"){var c=e[u];if(!c||c!==s[u]){l=!1;break}}if(l)return"pattern-"+s.pattern}}}}return null}var xm,_m=q(()=>{"use strict";xm={amenity:{grave_yard:"cemetery",fountain:"water_standing"},landuse:{cemetery:[{religion:"christian",pattern:"cemetery_christian"},{religion:"buddhist",pattern:"cemetery_buddhist"},{religion:"muslim",pattern:"cemetery_muslim"},{religion:"jewish",pattern:"cemetery_jewish"},{pattern:"cemetery"}],construction:"construction",farmland:"farmland",farmyard:"farmyard",forest:[{leaf_type:"broadleaved",pattern:"forest_broadleaved"},{leaf_type:"needleleaved",pattern:"forest_needleleaved"},{leaf_type:"leafless",pattern:"forest_leafless"},{pattern:"forest"}],grave_yard:"cemetery",grass:"grass",landfill:"landfill",meadow:"meadow",military:"construction",orchard:"orchard",quarry:"quarry",vineyard:"vineyard"},leisure:{horse_riding:"farmyard"},natural:{beach:"beach",grassland:"grass",sand:"beach",scrub:"scrub",water:[{water:"pond",pattern:"pond"},{water:"reservoir",pattern:"water_standing"},{pattern:"waves"}],wetland:[{wetland:"marsh",pattern:"wetland_marsh"},{wetland:"swamp",pattern:"wetland_swamp"},{wetland:"bog",pattern:"wetland_bog"},{wetland:"reedbed",pattern:"wetland_reedbed"},{pattern:"wetland"}],wood:[{leaf_type:"broadleaved",pattern:"forest_broadleaved"},{leaf_type:"needleleaved",pattern:"forest_needleleaved"},{leaf_type:"leafless",pattern:"forest_leafless"},{pattern:"forest"}]},golf:{green:"golf_green",tee:"grass",fairway:"grass",rough:"scrub"},surface:{grass:"grass",sand:"beach"}}});var nB={};j(nB,{svgAreas:()=>E5});function E5(e,t){function r(a){var o=k5(a);return o?'url("#ideditor-'+o+'")':""}function n(a,o,s,l){var u=t.getDebug("target")?"pink ":"nocolor ",c=t.getDebug("target")?"red ":"nocolor ",f=Pr(e).geojson,d=t.activeID(),m=t.history().base(),h={targets:[],nopes:[]};s.forEach(function(k){var x=kl(k,o,d);h.targets.push.apply(h.targets,x.passive),h.nopes.push.apply(h.nopes,x.active)});var g=h.targets.filter(f),A=a.selectAll(".area.target-allowed").filter(function(k){return l(k.properties.entity)}).data(g,function(x){return x.id});A.exit().remove();var v=function(k){var x=k.properties.entity.id;return!m.entities[x]||!(0,n8.default)(o.entities[x].nodes,m.entities[x].nodes)?!1:k.properties.nodes.some(function(S){return!m.entities[S.id]||!(0,n8.default)(o.entities[S.id].loc,m.entities[S.id].loc)})};A.enter().append("path").merge(A).attr("d",f).attr("class",function(k){return"way area target target-allowed "+u+k.id}).classed("segment-edited",v);var _=h.nopes.filter(f),w=a.selectAll(".area.target-nope").filter(function(k){return l(k.properties.entity)}).data(_,function(x){return x.id});w.exit().remove(),w.enter().append("path").merge(w).attr("d",f).attr("class",function(k){return"way area target target-nope "+c+k.id}).classed("segment-edited",v)}function i(a,o,s,l){for(var u=Pr(e,o,!0),c={},f=t.history().base(),d=0;d<s.length;d++){var m=s[d];m.geometry(o)==="area"&&(c[m.id]||(c[m.id]={entity:m,area:Math.abs(m.area(o))}))}var h=Object.values(c).filter(function(M){return u(M.entity)});h.sort(function(M,F){return F.area-M.area}),h=h.map(function(E){return E.entity});var g=h.filter(function(E){return E.type==="way"}),A={clip:h,shadow:g,stroke:g,fill:h},v=t.surface().selectAll("defs").selectAll(".clipPath-osm").filter(l).data(A.clip,Le.key);v.exit().remove();var _=v.enter().append("clipPath").attr("class","clipPath-osm").attr("id",function(E){return"ideditor-"+E.id+"-clippath"});_.append("path"),v.merge(_).selectAll("path").attr("d",u);var w=a.selectAll(".layer-osm.areas"),k=a.selectAll(".layer-touch.areas"),x=w.selectAll("g.areagroup").data(["fill","shadow","stroke"]);x=x.enter().append("g").attr("class",function(E){return"areagroup area-"+E}).merge(x);var S=x.selectAll("path").filter(l).data(function(E){return A[E]},Le.key);S.exit().remove();var I=a.selectAll(".area-fill path.area").nodes(),b=Zl(function(E){return-E.__data__.area(o)}).left;function y(E){if(this._parent.__data__==="fill")return I[b(I,-E.area(o))]}S=S.enter().insert("path",y).merge(S).each(function(E){var M=this.parentNode.__data__;this.setAttribute("class",E.type+" area "+M+" "+E.id),M==="fill"&&(this.setAttribute("clip-path","url(#ideditor-"+E.id+"-clippath)"),this.style.fill=this.style.stroke=r(E.tags))}).classed("added",function(E){return!f.entities[E.id]}).classed("geometry-edited",function(E){return o.entities[E.id]&&f.entities[E.id]&&!(0,n8.default)(o.entities[E.id].nodes,f.entities[E.id].nodes)}).classed("retagged",function(E){return o.entities[E.id]&&f.entities[E.id]&&!(0,n8.default)(o.entities[E.id].tags,f.entities[E.id].tags)}).call(ti()).attr("d",u),k.call(n,o,A.stroke,l)}return i}var n8,A_=q(()=>{"use strict";n8=or(go(),1);bn();lr();Tr();El();_m()});var S_=an((qke,iB)=>{"use strict";iB.exports=function(e,t){t||(t={}),typeof t=="function"&&(t={cmp:t});var r=typeof t.cycles=="boolean"?t.cycles:!1,n=t.cmp&&function(a){return function(o){return function(s,l){var u={key:s,value:o[s]},c={key:l,value:o[l]};return a(u,c)}}}(t.cmp),i=[];return function a(o){if(o&&o.toJSON&&typeof o.toJSON=="function"&&(o=o.toJSON()),o!==void 0){if(typeof o=="number")return isFinite(o)?""+o:"null";if(typeof o!="object")return JSON.stringify(o);var s,l;if(Array.isArray(o)){for(l="[",s=0;s<o.length;s++)s&&(l+=","),l+=a(o[s])||"null";return l+"]"}if(o===null)return"null";if(i.indexOf(o)!==-1){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var u=i.push(o)-1,c=Object.keys(o).sort(n&&n(o));for(l="",s=0;s<c.length;s++){var f=c[s],d=a(o[f]);d&&(l&&(l+=","),l+=JSON.stringify(f)+":"+d)}return i.splice(u,1),"{"+l+"}"}}(e)}});function ki(e,t){return Array.from(e.getElementsByTagName(t))}function Em(e){return e[0]==="#"?e:`#${e}`}function toe(e,t,r){return Array.from(e.getElementsByTagNameNS(r,t))}function fi(e){return e==null||e.normalize(),(e==null?void 0:e.textContent)||""}function Gi(e,t,r){let n=e.getElementsByTagName(t),i=n.length?n[0]:null;return i&&r&&r(i),i}function Co(e,t,r){let n={};if(!e)return n;let i=e.getElementsByTagName(t),a=i.length?i[0]:null;return a&&r?r(a,n):n}function j2(e,t,r){let n=fi(Gi(e,t));return n&&r?r(n)||{}:{}}function aB(e,t,r){let n=Number.parseFloat(fi(Gi(e,t)));if(!Number.isNaN(n))return n&&r?r(n)||{}:{}}function H2(e,t,r){let n=Number.parseFloat(fi(Gi(e,t)));if(!Number.isNaN(n))return r&&r(n),n}function i8(e,t){let r={};for(let n of t)j2(e,n,i=>{r[n]=i});return r}function M_(e){return(e==null?void 0:e.nodeType)===1}function oB(e){let t=[];if(e===null)return t;for(let r of Array.from(e.childNodes)){if(!M_(r))continue;let n=roe(r.nodeName);if(n==="gpxtpx:TrackPointExtension")t=t.concat(oB(r));else{let i=fi(r);t.push([n,noe(i)])}}return t}function roe(e){return["heart","gpxtpx:hr","hr"].includes(e)?"heart":e}function noe(e){let t=Number.parseFloat(e);return Number.isNaN(t)?e:t}function sB(e){let t=[Number.parseFloat(e.getAttribute("lon")||""),Number.parseFloat(e.getAttribute("lat")||"")];if(Number.isNaN(t[0])||Number.isNaN(t[1]))return null;H2(e,"ele",n=>{t.push(n)});let r=Gi(e,"time");return{coordinates:t,time:r?fi(r):null,extendedValues:oB(Gi(e,"extensions"))}}function lB(e){return Co(e,"line",t=>Object.assign({},j2(t,"color",n=>({stroke:`#${n}`})),aB(t,"opacity",n=>({"stroke-opacity":n})),aB(t,"width",n=>({"stroke-width":n*96/25.4}))))}function T_(e,t){var i;let r=i8(t,["name","cmt","desc","type","time","keywords"]);for(let[a,o]of e)for(let s of Array.from(t.getElementsByTagNameNS(o,"*")))r[s.tagName.replace(":","_")]=(i=fi(s))==null?void 0:i.trim();let n=ki(t,"link");return n.length&&(r.links=n.map(a=>Object.assign({href:a.getAttribute("href")},i8(a,["text","type"])))),r}function uB(e,t){let r=ki(e,t),n=[],i=[],a={};for(let o=0;o<r.length;o++){let s=sB(r[o]);if(s){n.push(s.coordinates),s.time&&i.push(s.time);for(let[l,u]of s.extendedValues){let c=l==="heart"?l:`${l.replace("gpxtpx:","")}s`;a[c]||(a[c]=Array(r.length).fill(null)),a[c][o]=u}}}if(!(n.length<2))return{line:n,times:i,extendedValues:a}}function ioe(e,t){let r=uB(t,"rtept");if(r)return{type:"Feature",properties:Object.assign({_gpxType:"rte"},T_(e,t),lB(Gi(t,"extensions"))),geometry:{type:"LineString",coordinates:r.line}}}function aoe(e,t){var l;let r=ki(t,"trkseg"),n=[],i=[],a=[];for(let u of r){let c=uB(u,"trkpt");c&&(a.push(c),(l=c.times)!=null&&l.length&&i.push(c.times))}if(a.length===0)return null;let o=a.length>1,s=Object.assign({_gpxType:"trk"},T_(e,t),lB(Gi(t,"extensions")),i.length?{coordinateProperties:{times:o?i:i[0]}}:{});for(let u of a){n.push(u.line),s.coordinateProperties||(s.coordinateProperties={});let c=s.coordinateProperties,f=Object.entries(u.extendedValues);for(let d=0;d<f.length;d++){let[m,h]=f[d];o?(c[m]||(c[m]=a.map(g=>new Array(g.line.length).fill(null))),c[m][d]=h):c[m]=h}}return{type:"Feature",properties:s,geometry:o?{type:"MultiLineString",coordinates:n}:{type:"LineString",coordinates:n[0]}}}function ooe(e,t){let r=Object.assign(T_(e,t),i8(t,["sym"])),n=sB(t);return n?{type:"Feature",properties:r,geometry:{type:"Point",coordinates:n.coordinates}}:null}function*soe(e){var o,s;let t=e,r="gpxx",n="http://www.garmin.com/xmlschemas/GpxExtensions/v3",i=[[r,n]],a=(o=t.getElementsByTagName("gpx")[0])==null?void 0:o.attributes;if(a)for(let l of Array.from(a))(s=l.name)!=null&&s.startsWith("xmlns:")&&l.value!==n&&i.push([l.name,l.value]);for(let l of ki(t,"trk")){let u=aoe(i,l);u&&(yield u)}for(let l of ki(t,"rte")){let u=ioe(i,l);u&&(yield u)}for(let l of ki(t,"wpt")){let u=ooe(i,l);u&&(yield u)}}function cB(e){return{type:"FeatureCollection",features:Array.from(soe(e))}}function fB(e,t){let r={},n=t==="stroke"||t==="fill"?t:`${t}-color`;return e[0]==="#"&&(e=e.substring(1)),e.length===6||e.length===3?r[n]=`#${e}`:e.length===8&&(r[`${t}-opacity`]=Number.parseInt(e.substring(0,2),16)/255,r[n]=`#${e.substring(6,8)}${e.substring(4,6)}${e.substring(2,4)}`),r}function Am(e,t,r){let n={};return H2(e,t,i=>{n[r]=i}),n}function N_(e,t){return Co(e,"color",r=>fB(fi(r),t))}function dB(e){return Co(e,"Icon",(t,r)=>(j2(t,"href",n=>{r.icon=n}),r))}function loe(e){return Co(e,"IconStyle",t=>Object.assign(N_(t,"icon"),Am(t,"scale","icon-scale"),Am(t,"heading","icon-heading"),Co(t,"hotSpot",r=>{let n=Number.parseFloat(r.getAttribute("x")||""),i=Number.parseFloat(r.getAttribute("y")||""),a=r.getAttribute("xunits")||"",o=r.getAttribute("yunits")||"";return!Number.isNaN(n)&&!Number.isNaN(i)?{"icon-offset":[n,i],"icon-offset-units":[a,o]}:{}}),dB(t)))}function uoe(e){return Co(e,"LabelStyle",t=>Object.assign(N_(t,"label"),Am(t,"scale","label-scale")))}function coe(e){return Co(e,"LineStyle",t=>Object.assign(N_(t,"stroke"),Am(t,"width","stroke-width")))}function foe(e){return Co(e,"PolyStyle",(t,r)=>Object.assign(r,Co(t,"color",n=>fB(fi(n),"fill")),j2(t,"fill",n=>{if(n==="0")return{"fill-opacity":0}}),j2(t,"outline",n=>{if(n==="0")return{"stroke-opacity":0}})))}function D_(e){return Object.assign({},foe(e),coe(e),uoe(e),loe(e))}function pB(e){return e.replace(doe,"").split(",").map(Number.parseFloat).filter(t=>!Number.isNaN(t)).slice(0,3)}function C_(e){return e.replace(poe,"").split(moe).map(pB).filter(t=>t.length>=2)}function hoe(e){let t=ki(e,"coord");t.length===0&&(t=toe(e,"coord","*"));let r=t.map(n=>fi(n).split(" ").map(Number.parseFloat));return r.length===0?null:{geometry:r.length>2?{type:"LineString",coordinates:r}:{type:"Point",coordinates:r[0]},times:ki(e,"when").map(n=>fi(n))}}function mB(e){if(e.length===0)return e;let t=e[0],r=e[e.length-1],n=!0;for(let i=0;i<Math.max(t.length,r.length);i++)if(t[i]!==r[i]){n=!1;break}return n?e:e.concat([e[0]])}function km(e){return fi(Gi(e,"coordinates"))}function hB(e){let t=[],r=[];for(let n=0;n<e.childNodes.length;n++){let i=e.childNodes.item(n);if(M_(i))switch(i.tagName){case"MultiGeometry":case"MultiTrack":case"gx:MultiTrack":{let a=hB(i);t=t.concat(a.geometries),r=r.concat(a.coordTimes);break}case"Point":{let a=pB(km(i));a.length>=2&&t.push({type:"Point",coordinates:a});break}case"LinearRing":case"LineString":{let a=C_(km(i));a.length>=2&&t.push({type:"LineString",coordinates:a});break}case"Polygon":{let a=[];for(let o of ki(i,"LinearRing")){let s=mB(C_(km(o)));s.length>=4&&a.push(s)}a.length&&t.push({type:"Polygon",coordinates:a});break}case"Track":case"gx:Track":{let a=hoe(i);if(!a)break;let{times:o,geometry:s}=a;t.push(s),o.length&&r.push(o);break}}}return{geometries:t,coordTimes:r}}function gB(e,t){return Co(e,"ExtendedData",(r,n)=>{for(let i of ki(r,"Data"))n[i.getAttribute("name")||""]=fi(Gi(i,"value"));for(let i of ki(r,"SimpleData")){let a=i.getAttribute("name")||"",o=t[a]||I_.string;n[a]=o(fi(i))}return n})}function vB(e){let t=Gi(e,"description");for(let r of Array.from((t==null?void 0:t.childNodes)||[]))if(r.nodeType===4)return{description:{"@type":"html",value:fi(r)}};return{}}function yB(e){return Co(e,"TimeSpan",t=>({timespan:{begin:fi(Gi(t,"begin")),end:fi(Gi(t,"end"))}}))}function bB(e){return Co(e,"TimeStamp",t=>({timestamp:fi(Gi(t,"when"))}))}function wB(e,t){return j2(e,"styleUrl",r=>(r=Em(r),t[r]?Object.assign({styleUrl:r},t[r]):{styleUrl:r}))}function goe(e){return Gi(e,"gx:LatLonQuad")?{geometry:{type:"Polygon",coordinates:[mB(C_(km(e)))]}}:boe(e)}function yoe(e,t,r){let n=[(e[0]+e[2])/2,(e[1]+e[3])/2];return[t[0].map(i=>{let a=i[1]-n[1],o=i[0]-n[0],s=Math.sqrt(a**2+o**2),l=Math.atan2(a,o)+r*voe;return[n[0]+Math.cos(l)*s,n[1]+Math.sin(l)*s]})]}function boe(e){let t=Gi(e,"LatLonBox");if(t){let r=H2(t,"north"),n=H2(t,"west"),i=H2(t,"east"),a=H2(t,"south"),o=H2(t,"rotation");if(typeof r=="number"&&typeof a=="number"&&typeof n=="number"&&typeof i=="number"){let s=[n,a,i,r],l=[[[n,r],[i,r],[i,a],[n,a],[n,r]]];return typeof o=="number"&&(l=yoe(s,l,o)),{bbox:s,geometry:{type:"Polygon",coordinates:l}}}}return null}function woe(e,t,r,n){var l;let i=goe(e),a=(i==null?void 0:i.geometry)||null;if(!a&&n.skipNullGeometry)return null;let o={type:"Feature",geometry:a,properties:Object.assign({"@geometry-type":"groundoverlay"},i8(e,["name","address","visibility","open","phoneNumber","description"]),vB(e),wB(e,t),D_(e),dB(e),gB(e,r),yB(e),bB(e))};i!=null&&i.bbox&&(o.bbox=i.bbox),((l=o.properties)==null?void 0:l.visibility)!==void 0&&(o.properties.visibility=o.properties.visibility!=="0");let s=e.getAttribute("id");return s!==null&&s!==""&&(o.id=s),o}function xoe(e){return e.length===0?null:e.length===1?e[0]:{type:"GeometryCollection",geometries:e}}function _oe(e,t,r,n){var u;let{coordTimes:i,geometries:a}=hB(e),o=xoe(a);if(!o&&n.skipNullGeometry)return null;let s={type:"Feature",geometry:o,properties:Object.assign(i8(e,["name","address","visibility","open","phoneNumber","description"]),vB(e),wB(e,t),D_(e),gB(e,r),yB(e),bB(e),i.length?{coordinateProperties:{times:i.length===1?i[0]:i}}:{})};((u=s.properties)==null?void 0:u.visibility)!==void 0&&(s.properties.visibility=s.properties.visibility!=="0");let l=e.getAttribute("id");return l!==null&&l!==""&&(s.id=l),s}function koe(e){let t=e.getAttribute("id"),r=e.parentNode;return!t&&M_(r)&&r.localName==="CascadingStyle"&&(t=r.getAttribute("kml:id")||r.getAttribute("id")),Em(t||"")}function Eoe(e){let t={};for(let r of ki(e,"Style"))t[koe(r)]=D_(r);for(let r of ki(e,"StyleMap")){let n=Em(r.getAttribute("id")||"");j2(r,"styleUrl",i=>{i=Em(i),t[i]&&(t[n]=t[i])})}return t}function Aoe(e){let t={};for(let r of ki(e,"SimpleField"))t[r.getAttribute("name")||""]=I_[r.getAttribute("type")||""]||I_.string;return t}function*Soe(e,t={skipNullGeometry:!1}){let r=e,n=Eoe(r),i=Aoe(r);for(let a of ki(r,"Placemark")){let o=_oe(a,n,i,t);o&&(yield o)}for(let a of ki(r,"GroundOverlay")){let o=woe(a,n,i,t);o&&(yield o)}}function xB(e,t={skipNullGeometry:!1}){return{type:"FeatureCollection",features:Array.from(Soe(e,t))}}var doe,poe,moe,A5,I_,voe,_B=q(()=>{doe=/\s*/g,poe=/^\s*|\s*$/g,moe=/\s+/;A5=e=>Number(e),I_={string:e=>e,int:A5,uint:A5,short:A5,ushort:A5,float:A5,double:A5,bool:e=>!!e};voe=Math.PI/180});var AB={};j(AB,{svgData:()=>Al});import Coe from"lodash-es/throttle.js";function Al(e,t,r){var n=Coe(function(){r.call("change")},1e3),i=!0,a=sr(),o=Q(null),s,l,u,c;let f=[".gpx",".kml",".geojson",".json"];function d(){if(kB)return;Io={},a8=!0;function N(D){D.stopPropagation(),D.preventDefault(),D.dataTransfer.dropEffect="copy"}t.container().attr("dropzone","copy").on("drop.svgData",function(D){if(D.stopPropagation(),D.preventDefault(),!!a.filedrop){var O=D.dataTransfer.files[0],L=E(O.name);f.includes(L)&&y.fileList(D.dataTransfer.files)}}).on("dragenter.svgData",N).on("dragexit.svgData",N).on("dragover.svgData",N),kB=!0}function m(){return de.vectorTile&&!s?(s=de.vectorTile,s.event.on("loadedData",n)):!de.vectorTile&&s&&(s=null),s}function h(){A(),o.style("opacity",0).transition().duration(250).style("opacity",1).on("end",function(){r.call("change")})}function g(){n.cancel(),o.transition().duration(250).style("opacity",0).on("end",v)}function A(){o.style("display","block")}function v(){o.selectAll(".viewfield-group").remove(),o.style("display","none")}function _(N){if(!N)return null;if(N.type==="FeatureCollection")for(var D=0;D<N.features.length;D++)w(N.features[D]);else w(N);return N}function w(N){if(N)return N.__featurehash__=fo((0,EB.default)(N)),N}function k(N){return N?N.type==="FeatureCollection"?N.features:[N]:[]}function x(N){return N.__featurehash__}function S(N){return N.geometry.type==="Polygon"||N.geometry.type==="MultiPolygon"}function I(N){return"ideditor-data-"+N.__featurehash__+"-clippath"}function b(N){return["data"+N.__featurehash__,N.geometry.type,S(N)?"area":"",N.__layerID__||""].filter(Boolean).join(" ")}function y(N){var D=m(),O=Pr(e).geojson,L=Pr(e,null,!0).geojson,P=y.hasData();o=N.selectAll(".layer-mapdata").data(a8&&P?[0]:[]),o.exit().remove(),o=o.enter().append("g").attr("class","layer-mapdata").merge(o);var U=t.surface();if(!U||U.empty())return;var B,z;if(u&&D){var V=u;D.loadTiles(V,u,e),B=D.data(V,e)}else B=k(Io);B=B.filter(O),z=B.filter(S);var G=U.selectAll("defs").selectAll(".clipPath-data").data(z,x);G.exit().remove();var W=G.enter().append("clipPath").attr("class","clipPath-data").attr("id",I);W.append("path"),G.merge(W).selectAll("path").attr("d",L);var Y=o.selectAll("g.datagroup").data(["fill","shadow","stroke"]);Y=Y.enter().append("g").attr("class",function(se){return"datagroup datagroup-"+se}).merge(Y);var J={fill:z,shadow:B,stroke:B},oe=Y.selectAll("path").data(function(se){return J[se]},x);oe.exit().remove(),oe=oe.enter().append("path").attr("class",function(se){var ne=this.parentNode.__data__;return"pathdata "+ne+" "+b(se)}).attr("clip-path",function(se){var ne=this.parentNode.__data__;return ne==="fill"?"url(#"+I(se)+")":null}).merge(oe).attr("d",function(se){var ne=this.parentNode.__data__;return ne==="fill"?L(se):O(se)}),o.call(Ce,"label-halo",B).call(Ce,"label",B);function Ce(se,ne,he){var Se=Pi(e),re=he.filter(function(te){return i&&te.properties&&(te.properties.desc||te.properties.name)}),Z=se.selectAll("text."+ne).data(re,x);Z.exit().remove(),Z=Z.enter().append("text").attr("class",function(te){return ne+" "+b(te)}).merge(Z).text(function(te){return te.properties.desc||te.properties.name}).attr("x",function(te){var ye=Se.centroid(te);return ye[0]+11}).attr("y",function(te){var ye=Se.centroid(te);return ye[1]})}}function E(N){if(N){var D=/\.(gpx|kml|(geo)?json|png)$/i,O=N.toLowerCase().match(D);return O&&O.length&&O[0]}}function M(N){return new DOMParser().parseFromString(N,"text/xml")}function F(N){let D=N.properties;for(let O in D){let L=D[O];typeof L=="number"||typeof L=="boolean"||Array.isArray(L)?D[O]=L.toString():L===null?D[O]="null":typeof L=="object"&&(D[O]=JSON.stringify(L))}}return y.setFile=function(N,D){u=null,l=null,Io=null,c=null;var O;switch(N){case".gpx":O=cB(M(D));break;case".kml":O=xB(M(D));break;case".geojson":case".json":O=JSON.parse(D),O.type==="FeatureCollection"?O.features.forEach(F):O.type==="Feature"&&F(O);break}return O=O||{},Object.keys(O).length&&(Io=_(O),c=N+" data file",this.fitZoom()),r.call("change"),this},y.showLabels=function(N){return arguments.length?(i=N,this):i},y.enabled=function(N){return arguments.length?(a8=N,a8?h():g(),r.call("change"),this):a8},y.hasData=function(){var N=Io||{};return!!(u||Object.keys(N).length)},y.template=function(N,D){if(!arguments.length)return u;var O=t.connection();if(O){for(var L=O.imageryBlocklists(),P=!1,U=0,B,z=0;z<L.length&&(B=L[z],P=B.test(N),U++,!P);z++);U||(B=/.*\.google(apis)?\..*\/(vt|kh)[\?\/].*([xyz]=.*){3}.*/,P=B.test(N))}return u=N,l=null,Io=null,c=D||"vectortile:"+N.split(/[?#]/)[0],r.call("change"),this},y.geojson=function(N,D){return arguments.length?(u=null,l=null,Io=null,c=null,N=N||{},Object.keys(N).length&&(Io=_(N),c=D||"unknown.geojson"),r.call("change"),this):Io},y.fileList=function(N){if(!arguments.length)return l;if(u=null,Io=null,c=null,l=N,!N||!N.length)return this;var D=N[0],O=E(D.name),L=new FileReader;return L.onload=function(){return function(P){y.setFile(O,P.target.result)}}(D),L.readAsText(D),this},y.url=function(N,D){u=null,l=null,Io=null,c=null;var O=N.split(/[?#]/)[0],L=E(O)||D;return L?(u=null,L9(N).then(function(P){y.setFile(L,P)}).catch(function(){})):y.template(N),this},y.getSrc=function(){return c||""},y.fitZoom=function(){var N=k(Io);if(N.length){var D=t.map(),O=D.trimmedExtent().polygon(),L=N.reduce(function(U,B){var z=B.geometry;if(!z)return U;var V=z.coordinates;switch(z.type){case"Point":V=[V];case"MultiPoint":case"LineString":break;case"MultiPolygon":V=D1(V);case"Polygon":case"MultiLineString":V=D1(V);break}return Ht(U,V)},[]);if(!ao(O,L,!0)){var P=Me(N0({type:"LineString",coordinates:L}));D.centerZoom(P.center(),D.trimmedExtentZoom(P))}return this}},d(),y}var EB,kB,a8,Io,Sm=q(()=>{"use strict";Ta();wi();Ae();EB=or(S_(),1);_B();He();pt();Tr();Li();Ie();kB=!1,a8=!1});var SB={};j(SB,{svgDebug:()=>Sl});function Sl(e,t){function r(n){let i=t.getDebug("tile"),a=t.getDebug("collision"),o=t.getDebug("imagery"),s=t.getDebug("target"),l=t.getDebug("downloaded"),u=[];i&&u.push({class:"red",label:"tile"}),a&&u.push({class:"yellow",label:"collision"}),o&&u.push({class:"orange",label:"imagery"}),s&&u.push({class:"pink",label:"touchTargets"}),l&&u.push({class:"purple",label:"downloaded"});let c=t.container().select(".main-content").selectAll(".debug-legend").data(u.length?[0]:[]);c.exit().remove(),c=c.enter().append("div").attr("class","fillD debug-legend").merge(c);let f=c.selectAll(".debug-legend-item").data(u,v=>v.label);f.exit().remove(),f.enter().append("span").attr("class",v=>`debug-legend-item ${v.class}`).text(v=>v.label);let d=n.selectAll(".layer-debug").data(o||l?[0]:[]);d.exit().remove(),d=d.enter().append("g").attr("class","layer-debug").merge(d);let m=t.map().extent();it.get("imagery").then(v=>{let w=(o&&v.query.bbox(m.rectangle(),!0)||[]).map(x=>x.features[x.id]),k=d.selectAll("path.debug-imagery").data(w);k.exit().remove(),k.enter().append("path").attr("class","debug-imagery debug orange")}).catch(()=>{});let h=t.connection(),g=[];h&&l&&(g=h.caches("get").tile.rtree.all().map(_=>({type:"Feature",properties:{id:_.id},geometry:{type:"Polygon",coordinates:[[[_.minX,_.minY],[_.minX,_.maxY],[_.maxX,_.maxY],[_.maxX,_.minY],[_.minX,_.minY]]]}})));let A=d.selectAll("path.debug-downloaded").data(l?g:[]);A.exit().remove(),A.enter().append("path").attr("class","debug-downloaded debug purple"),d.selectAll("path").attr("d",Pr(e).geojson)}return r.enabled=function(){return arguments.length?this:t.getDebug("tile")||t.getDebug("collision")||t.getDebug("imagery")||t.getDebug("target")||t.getDebug("downloaded")},r}var Cm=q(()=>{"use strict";An();Tr()});var CB={};j(CB,{svgDefs:()=>S5});function S5(e){var t=Q(null),r=["iD-sprite","maki-sprite","temaki-sprite","fa-sprite","roentgen-sprite","community-sprite"];function n(a){t=a.append("defs");function o(f,d){t.append("marker").attr("id",`ideditor-oneway-marker-${f}`).attr("viewBox","0 0 10 5").attr("refX",4).attr("refY",2.5).attr("markerWidth",2).attr("markerHeight",2).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("class","oneway-marker-path").attr("d","M 6,3 L 0,3 L 0,2 L 6,2 L 5,0 L 10,2.5 L 5,5 z").attr("stroke","none").attr("fill",d).attr("opacity","1")}o("black","#333"),o("white","#fff"),o("gray","#eee");function s(f,d,m){t.append("marker").attr("id","ideditor-sided-marker-"+f).attr("viewBox","0 0 2 2").attr("refX",1).attr("refY",-m).attr("markerWidth",1.5).attr("markerHeight",1.5).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("class","sided-marker-path sided-marker-"+f+"-path").attr("d","M 0,0 L 1,1 L 2,0 z").attr("stroke","none").attr("fill",d)}s("natural","rgb(170, 170, 170)",0),s("coastline","#77dede",1),s("waterway","#77dede",1),s("barrier","#ddd",1),s("man_made","#fff",0),t.append("marker").attr("id","ideditor-viewfield-marker").attr("viewBox","0 0 16 16").attr("refX",8).attr("refY",16).attr("markerWidth",4).attr("markerHeight",4).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("class","viewfield-marker-path").attr("d","M 6,14 C 8,13.4 8,13.4 10,14 L 16,3 C 12,0 4,0 0,3 z").attr("fill","#333").attr("fill-opacity","0.75").attr("stroke","#fff").attr("stroke-width","0.5px").attr("stroke-opacity","0.75"),t.append("marker").attr("id","ideditor-viewfield-marker-wireframe").attr("viewBox","0 0 16 16").attr("refX",8).attr("refY",16).attr("markerWidth",4).attr("markerHeight",4).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("class","viewfield-marker-path").attr("d","M 6,14 C 8,13.4 8,13.4 10,14 L 16,3 C 12,0 4,0 0,3 z").attr("fill","none").attr("stroke","#fff").attr("stroke-width","0.5px").attr("stroke-opacity","0.75");var l=t.selectAll("pattern").data([["beach","dots"],["construction","construction"],["cemetery","cemetery"],["cemetery_christian","cemetery_christian"],["cemetery_buddhist","cemetery_buddhist"],["cemetery_muslim","cemetery_muslim"],["cemetery_jewish","cemetery_jewish"],["farmland","farmland"],["farmyard","farmyard"],["forest","forest"],["forest_broadleaved","forest_broadleaved"],["forest_needleleaved","forest_needleleaved"],["forest_leafless","forest_leafless"],["golf_green","grass"],["grass","grass"],["landfill","landfill"],["meadow","grass"],["orchard","orchard"],["pond","pond"],["quarry","quarry"],["scrub","bushes"],["vineyard","vineyard"],["water_standing","lines"],["waves","waves"],["wetland","wetland"],["wetland_marsh","wetland_marsh"],["wetland_swamp","wetland_swamp"],["wetland_bog","wetland_bog"],["wetland_reedbed","wetland_reedbed"]]).enter().append("pattern").attr("id",function(f){return"ideditor-pattern-"+f[0]}).attr("width",32).attr("height",32).attr("patternUnits","userSpaceOnUse");l.append("rect").attr("x",0).attr("y",0).attr("width",32).attr("height",32).attr("class",function(f){return"pattern-color-"+f[0]}),l.append("image").attr("x",0).attr("y",0).attr("width",32).attr("height",32).attr("xlink:href",function(f){return e.imagePath("pattern/"+f[1]+".png")}),t.selectAll("clipPath").data([12,18,20,32,45]).enter().append("clipPath").attr("id",function(f){return"ideditor-clip-square-"+f}).append("rect").attr("x",0).attr("y",0).attr("width",function(f){return f}).attr("height",function(f){return f});let c=t.selectAll("filter").data(["alpha-slope5"]).enter().append("filter").attr("id",f=>f).filter("#alpha-slope5").append("feComponentTransfer");c.append("feFuncR").attr("type","identity"),c.append("feFuncG").attr("type","identity"),c.append("feFuncB").attr("type","identity"),c.append("feFuncA").attr("type","linear").attr("slope",5),i(r,!0)}function i(a,o){r=Je(r.concat(a));var s=t.selectAll(".spritesheet").data(r);s.enter().append("g").attr("class",function(l){return"spritesheet spritesheet-"+l}).each(function(l){var u=e.imagePath(l+".svg"),c=Q(this).node();Ax(u).then(function(f){c.appendChild(Q(f.documentElement).attr("id","ideditor-"+l).node()),o&&l!=="iD-sprite"&&Q(c).selectAll("path").attr("fill","currentColor")}).catch(function(){})}),s.exit().remove()}return n.addSprites=i,n}var P_=q(()=>{"use strict";wi();Ae();Ie()});var IB={};j(IB,{svgKeepRight:()=>M5});import Ioe from"lodash-es/throttle.js";function M5(e,t,r){let n=Ioe(()=>r.call("change"),1e3),i=12,a=Q(null),o=Q(null),s=!1;function l(A,v){A.attr("class",v).attr("transform","translate(-4, -24)").attr("d","M11.6,6.2H7.1l1.4-5.1C8.6,0.6,8.1,0,7.5,0H2.2C1.7,0,1.3,0.3,1.3,0.8L0,10.2c-0.1,0.6,0.4,1.1,0.9,1.1h4.6l-1.8,7.6C3.6,19.4,4.1,20,4.7,20c0.3,0,0.6-0.2,0.8-0.5l6.9-11.9C12.7,7,12.3,6.2,11.6,6.2z")}function u(){return de.keepRight&&!I5?(I5=de.keepRight,I5.on("loaded",n)):!de.keepRight&&I5&&(I5=null),I5}function c(){s||(s=!0,o.style("display","block"))}function f(){s&&(s=!1,o.style("display","none"),o.selectAll(".qaItem.keepRight").remove(),a.selectAll(".qaItem.keepRight").remove())}function d(){c(),o.style("opacity",0).transition().duration(250).style("opacity",1).on("end interrupt",()=>r.call("change"))}function m(){n.cancel(),o.interrupt(),a.selectAll(".qaItem.keepRight").remove(),o.transition().duration(250).style("opacity",0).on("end interrupt",()=>{f(),r.call("change")})}function h(){if(!s||!C5)return;let A=u(),v=t.selectedErrorID(),_=A?A.getItems(e):[],w=jt(e),k=o.selectAll(".qaItem.keepRight").data(_,y=>y.id);k.exit().remove();let x=k.enter().append("g").attr("class",y=>`qaItem ${y.service} itemId-${y.id} itemType-${y.parentIssueType}`);if(x.append("ellipse").attr("cx",.5).attr("cy",1).attr("rx",6.5).attr("ry",3).attr("class","stroke"),x.append("path").call(l,"shadow"),x.append("use").attr("class","qaItem-fill").attr("width","20px").attr("height","20px").attr("x","-8px").attr("y","-22px").attr("xlink:href","#iD-icon-bolt"),k.merge(x).sort(b).classed("selected",y=>y.id===v).attr("transform",w),a.empty())return;let S=t.getDebug("target")?"pink ":"nocolor ",I=a.selectAll(".qaItem.keepRight").data(_,y=>y.id);I.exit().remove(),I.enter().append("rect").attr("width","20px").attr("height","20px").attr("x","-8px").attr("y","-22px").merge(I).sort(b).attr("class",y=>`qaItem ${y.service} target ${S} itemId-${y.id}`).attr("transform",w);function b(y,E){return y.id===v?1:E.id===v?-1:y.severity==="error"&&E.severity!=="error"?1:E.severity==="error"&&y.severity!=="error"?-1:E.loc[1]-y.loc[1]}}function g(A){let v=u(),_=t.surface();_&&!_.empty()&&(a=_.selectAll(".data-layer.touch .layer-touch.markers")),o=A.selectAll(".layer-keepRight").data(v?[0]:[]),o.exit().remove(),o=o.enter().append("g").attr("class","layer-keepRight").style("display",C5?"block":"none").merge(o),C5&&(v&&~~t.map().zoom()>=i?(c(),v.loadIssues(e),h()):f())}return g.enabled=function(A){return arguments.length?(C5=A,C5?d():(m(),t.selectedErrorID()&&t.enter(Ue(t))),r.call("change"),this):C5},g.supported=()=>!!u(),g}var C5,I5,Im=q(()=>{"use strict";Ae();Kt();Tr();pt();C5=!1});var MB={};j(MB,{svgGeolocate:()=>Ra});function Ra(e){var t=Q(null),r;function n(){Ra.initialized||(Ra.enabled=!1,Ra.initialized=!0)}function i(){t.style("display","block")}function a(){t.transition().duration(250).style("opacity",0)}function o(){t.style("opacity",0).transition().duration(250).style("opacity",1)}function s(){t.style("display","none")}function l(d){return jt(e)(d)}function u(d,m){var h=Ln(d),g=[m[0],m[1]+h],A=e(g),v=e([m[0],m[1]]);return Math.round(v[1]-A[1]).toString()}function c(){var d={loc:[r.coords.longitude,r.coords.latitude]},m=t.selectAll(".geolocations").selectAll(".geolocation").data([d]);m.exit().remove();var h=m.enter().append("g").attr("class","geolocation");h.append("circle").attr("class","geolocate-radius").attr("dx","0").attr("dy","0").attr("fill","rgb(15,128,225)").attr("fill-opacity","0.3").attr("r","0"),h.append("circle").attr("dx","0").attr("dy","0").attr("fill","rgb(15,128,225)").attr("stroke","white").attr("stroke-width","1.5").attr("r","6"),m.merge(h).attr("transform",l),t.select(".geolocate-radius").attr("r",u(r.coords.accuracy,d.loc))}function f(d){var m=Ra.enabled;t=d.selectAll(".layer-geolocate").data([0]),t.exit().remove();var h=t.enter().append("g").attr("class","layer-geolocate").style("display",m?"block":"none");h.append("g").attr("class","geolocations"),t=h.merge(t),m?c():s()}return f.enabled=function(d,m){return arguments.length?(r=d,Ra.enabled=m,Ra.enabled?(i(),o()):a(),this):Ra.enabled},n(),f}var Mm=q(()=>{"use strict";Ae();Tr();He()});var TB={};j(TB,{svgLabels:()=>T5});import Moe from"lodash-es/throttle.js";function T5(e,t){var r=Pi(e),n=sr(),i=n.ie||n.browser.toLowerCase()==="edge"||n.browser.toLowerCase()==="firefox"&&n.version>=70,a=new zt,o=new zt,s={},l={},u=[["line","aeroway","*",12],["line","highway","motorway",12],["line","highway","trunk",12],["line","highway","primary",12],["line","highway","secondary",12],["line","highway","tertiary",12],["line","highway","*",12],["line","railway","*",12],["line","waterway","*",12],["area","aeroway","*",12],["area","amenity","*",12],["area","building","*",12],["area","historic","*",12],["area","leisure","*",12],["area","man_made","*",12],["area","natural","*",12],["area","shop","*",12],["area","tourism","*",12],["area","camp_site","*",12],["point","aeroway","*",10],["point","amenity","*",10],["point","building","*",10],["point","historic","*",10],["point","leisure","*",10],["point","man_made","*",10],["point","natural","*",10],["point","shop","*",10],["point","tourism","*",10],["point","camp_site","*",10],["line","ref","*",12],["area","ref","*",12],["point","ref","*",10],["line","name","*",12],["area","name","*",12],["point","name","*",10]];function c(S){var I=["building","landuse","natural"];return I.some(function(b){return S.id.indexOf(b)>=0})}function f(S,I){return function(b,y){return S[y][I]}}function d(S,I,b){var y=s[I];if(y||(y=s[I]={}),y[S])return y[S];if(b)return y[S]=b.getComputedTextLength(),y[S];var E=encodeURIComponent(S).match(/%[CDEFcdef]/g);return E===null?I/3*2*S.length:I/3*(2*S.length+E.length)}function m(S,I,b,y,E){var M=S.selectAll("path").filter(b).data(I,Le.key);M.exit().remove(),M.enter().append("path").style("stroke-width",f(E,"font-size")).attr("id",function(F){return"ideditor-labelpath-"+F.id}).attr("class",y).merge(M).attr("d",f(E,"lineString"))}function h(S,I,b,y,E){var M=S.selectAll("text."+y).filter(b).data(I,Le.key);M.exit().remove(),M.enter().append("text").attr("class",function(F,N){return y+" "+E[N].classes+" "+F.id}).attr("dy",i?"0.35em":null).append("textPath").attr("class","textpath"),S.selectAll("text."+y).selectAll(".textpath").filter(b).data(I,Le.key).attr("startOffset","50%").attr("xlink:href",function(F){return"#ideditor-labelpath-"+F.id}).text(w2)}function g(S,I,b,y,E){var M=S.selectAll("text."+y).filter(b).data(I,Le.key);M.exit().remove(),M.enter().append("text").attr("class",function(F,N){return y+" "+E[N].classes+" "+F.id}).merge(M).attr("x",f(E,"x")).attr("y",f(E,"y")).style("text-anchor",f(E,"textAnchor")).text(hr).each(function(F,N){d(hr(F),E[N].height,this)})}function A(S,I,b,y,E){I=I.filter(M),E=E.filter(M),g(S,I,b,y,E);function M(F,N){return E[N].hasOwnProperty("x")&&E[N].hasOwnProperty("y")}}function v(S,I,b,y,E){var M=S.selectAll("use."+y).filter(b).data(I,Le.key);M.exit().remove(),M.enter().append("use").attr("class","icon "+y).attr("width","17px").attr("height","17px").merge(M).attr("transform",f(E,"transform")).attr("xlink:href",function(F){var N=Pe.match(F,t.graph()),D=N&&N.icon;return D?"#"+D:""})}function _(S,I,b){var y="debug "+b+" "+(b==="debug-skipped"?"orange":"yellow"),E=[];t.getDebug("collision")&&(E=I.all().map(function(F){return{type:"Polygon",coordinates:[[[F.minX,F.minY],[F.maxX,F.minY],[F.maxX,F.maxY],[F.minX,F.maxY],[F.minX,F.minY]]]}}));var M=S.selectAll("."+b).data(E);M.exit().remove(),M.enter().append("path").attr("class",y).merge(M).attr("d",Pi())}function w(S,I,b,y,E,M){var F=t.surface().classed("fill-wireframe"),N=Yt(e.scale()),D=[],O={},L,P,U,B,z;for(L=0;L<u.length;L++)D.push([]);if(M)a.clear(),o.clear(),l={};else for(L=0;L<b.length;L++){B=b[L];var V=[].concat(l[B.id]||[]).concat(l[B.id+"I"]||[]);for(P=0;P<V.length;P++)a.remove(V[P]),o.remove(V[P])}for(L=0;L<b.length;L++){if(B=b[L],z=B.geometry(I),z==="point"||z==="vertex"&&ve(B)){var G=B.directions(I,e).length,W;!F&&z==="point"&&!(N>=18&&G)?(O[B.id]="point",W=20):(O[B.id]="vertex",W=0);var Y=e(B.loc),J=10,oe={minX:Y[0]-J,minY:Y[1]-J-W,maxX:Y[0]+J,maxY:Y[1]+J};Ve(oe,B.id+"P")}z==="vertex"&&(z="point");var Ce=z==="area"&&Pe.match(B,I),se=Ce&&!c(Ce)&&Ce.icon;if(!(!se&&!hr(B)))for(U=0;U<u.length;U++){var ne=u[U][0],he=u[U][1],Se=u[U][2],re=B.tags[he];if(z===ne&&re&&(Se==="*"||Se===re)){D[U].push(B);break}}}var Z={point:[],line:[],area:[]},te={point:[],line:[],area:[]};for(U=0;U<D.length;U++){var ye=u[U][3];for(L=0;L<D[U].length;L++){B=D[U][L],z=B.geometry(I);var we=z==="line"?w2:hr,Ne=we(B),Be=Ne&&d(Ne,ye),le=null;if(z==="point"||z==="vertex"){if(F)continue;var ie=O[B.id];if(ie==="vertex"&&N<17)continue;le=be(B,Be,ye,ie)}else z==="line"?le=Te(B,Be,ye):z==="area"&&(le=Oe(B,Be,ye));le&&(z==="vertex"&&(z="point"),le.classes=z+" tag-"+u[U][1],Z[z].push(le),te[z].push(B))}}function ve(lt){var vt=t.selectedIDs();return lt.hasInterestingTags()||lt.isEndpoint(I)||lt.isConnected(I)||vt.indexOf(lt.id)!==-1||I.parentWays(lt).some(function(_t){return vt.indexOf(_t.id)!==-1})}function be(lt,vt,_t,wr){var tn=wr==="point"?-12:0,rn={ltr:[15,tn,"start"],rtl:[-15,tn,"end"]},Si=pe.textDirection(),Fo=e(lt.loc),hn=2,Ci=rn[Si],gn={height:_t,width:vt,x:Fo[0]+Ci[0],y:Fo[1]+Ci[1],textAnchor:Ci[2]},Ha;if(Si==="rtl"?Ha={minX:gn.x-vt-hn,minY:gn.y-_t/2-hn,maxX:gn.x+hn,maxY:gn.y+_t/2+hn}:Ha={minX:gn.x-hn,minY:gn.y-_t/2-hn,maxX:gn.x+vt+hn,maxY:gn.y+_t/2+hn},Qe([Ha],lt.id,!0))return gn}function Te(lt,vt,_t){var wr=Me(t.projection.clipExtent()).polygon(),tn=I.childNodes(lt).map(function(Fn){return e(Fn.loc)}),rn=qo(tn);if(rn<vt+20)return;for(var Si=[50,45,55,40,60,35,65,30,70,25,75,20,80,15,95,10,90,5,95],Fo=3,hn=0;hn<Si.length;hn++){var Ci=Si[hn],gn=Ci/100*rn,Ha=gn-vt/2;if(!(Ha<0||Ha+vt>rn)){var Hi=ov(tn,Ha,Ha+vt);if(!(!Hi||!ao(wr,Hi,!0))){var ns=iv(Hi);ns&&(Hi=Hi.reverse());for(var ba=[],wa=(_t+2)/2,Xs=0;Xs<Hi.length-1;Xs++)for(var gc=Hi[Xs],f0=Hi[Xs+1],vc=Math.max(1,Math.floor(ft(gc,f0)/wa/2)),Rl=0;Rl<vc;Rl++){var d0=Qt(gc,f0,Rl/vc),yc=d0[0]-wa-Fo,bc=d0[1]-wa-Fo,wc=d0[0]+wa+Fo,xc=d0[1]+wa+Fo;ba.push({minX:Math.min(yc,wc),minY:Math.min(bc,xc),maxX:Math.max(yc,wc),maxY:Math.max(bc,xc)})}if(Qe(ba,lt.id,!1))return{"font-size":_t+2,lineString:av(Hi),startOffset:Ci+"%"}}}}function iv(Fn){var Ll=Math.atan2(Fn[1][1]-Fn[0][1],Fn[1][0]-Fn[0][0]);return!(Fn[0][0]<Fn[Fn.length-1][0]&&Ll<Math.PI/2&&Ll>-Math.PI/2)}function av(Fn){return"M"+Fn.join("L")}function ov(Fn,Ll,_c){for(var Ul=0,A6,S6,kc,Bl,Zs=0;Zs<Fn.length-1;Zs++){var ji=Fn[Zs],zl=Fn[Zs+1],ql=ft(ji,zl),Js;!A6&&Ul+ql>=Ll&&(Js=(Ll-Ul)/ql,A6=[ji[0]+Js*(zl[0]-ji[0]),ji[1]+Js*(zl[1]-ji[1])],kc=Zs+1),!S6&&Ul+ql>=_c&&(Js=(_c-Ul)/ql,S6=[ji[0]+Js*(zl[0]-ji[0]),ji[1]+Js*(zl[1]-ji[1])],Bl=Zs+1),Ul+=ql}var p0=Fn.slice(kc,Bl);return p0.unshift(A6),p0.push(S6),p0}}function Oe(lt,vt,_t){var wr=r.centroid(lt.asGeoJSON(I)),tn=lt.extent(I),rn=e(tn[1])[0]-e(tn[0])[0];if(isNaN(wr[0])||rn<20)return;var Si=Pe.match(lt,t.graph()),Fo=Si&&Si.icon,hn=17,Ci=2,gn={};if(Fo){if(Ha())return Hi(hn+Ci),gn}else if(Hi(0))return gn;function Ha(){var ns=wr[0]-hn/2,ba=wr[1]-hn/2,wa={minX:ns,minY:ba,maxX:ns+hn,maxY:ba+hn};return Qe([wa],lt.id+"I",!0)?(gn.transform="translate("+ns+","+ba+")",!0):!1}function Hi(ns){if(vt&&rn>=vt+20){var ba=wr[0],wa=wr[1]+ns,Xs={minX:ba-vt/2-Ci,minY:wa-_t/2-Ci,maxX:ba+vt/2+Ci,maxY:wa+_t/2+Ci};if(Qe([Xs],lt.id,!0))return gn.x=ba,gn.y=wa,gn.textAnchor="middle",gn.height=_t,!0}return!1}}function Ve(lt,vt){lt.id=vt;var _t=l[vt];_t&&a.remove(_t),l[vt]=lt,a.insert(lt)}function Qe(lt,vt,_t){for(var wr=!1,tn=0;tn<lt.length;tn++){var rn=lt[tn];if(rn.id=vt,rn.minX<0||rn.minY<0||rn.maxX>E[0]||rn.maxY>E[1]){wr=!0;break}if(a.collides(rn)){wr=!0;break}}return l[vt]=lt,wr?_t&&o.load(lt):a.load(lt),!wr}var ct=S.selectAll(".layer-osm.labels");ct.selectAll(".labels-group").data(["halo","label","debug"]).enter().append("g").attr("class",function(lt){return"labels-group "+lt});var rt=ct.selectAll(".labels-group.halo"),We=ct.selectAll(".labels-group.label"),Rt=ct.selectAll(".labels-group.debug");g(We,te.point,y,"pointlabel",Z.point),g(rt,te.point,y,"pointlabel-halo",Z.point),m(ct,te.line,y,"",Z.line),h(We,te.line,y,"linelabel",Z.line),h(rt,te.line,y,"linelabel-halo",Z.line),A(We,te.area,y,"arealabel",Z.area),A(rt,te.area,y,"arealabel-halo",Z.area),v(We,te.area,y,"areaicon",Z.area),v(rt,te.area,y,"areaicon-halo",Z.area),_(Rt,o,"debug-skipped"),_(Rt,a,"debug-drawn"),ct.call(k)}function k(S){var I=S.selectAll(".layer-osm.labels"),b=I.selectAll(".labels-group.halo, .labels-group.label");b.selectAll(".nolabel").classed("nolabel",!1);var y=t.map().mouse(),E=t.graph(),M=t.selectedIDs(),F=[],N,D;if(y){N=20,D={minX:y[0]-N,minY:y[1]-N,maxX:y[0]+N,maxY:y[1]+N};var O=a.search(D).map(function(V){return V.id});F.push.apply(F,O)}for(var L=0;L<M.length;L++){var P=E.hasEntity(M[L]);P&&P.type==="node"&&F.push(M[L])}b.selectAll(Ui(F)).classed("nolabel",!0);var U=S.selectAll(".labels-group.debug"),B=[];t.getDebug("collision")&&(B=D?[{type:"Polygon",coordinates:[[[D.minX,D.minY],[D.maxX,D.minY],[D.maxX,D.maxY],[D.minX,D.maxY],[D.minX,D.minY]]]}]:[]);var z=U.selectAll(".debug-mouse").data(B);z.exit().remove(),z.enter().append("path").attr("class","debug debug-mouse yellow").merge(z).attr("d",Pi())}var x=Moe(k,100);return w.observe=function(S){var I=function(){x(S)};S.on("mousemove.hidelabels",I),t.on("enter.hidelabels",I)},w.off=function(S){x.cancel(),S.on("mousemove.hidelabels",null),t.on("enter.hidelabels",null)},w}var F_=q(()=>{"use strict";Ta();Fa();ue();He();At();lr();Li();Ie()});var PB={};j(PB,{default:()=>Y2});function Toe(e){let t=e.transform;L_.call(Bn,t.x,t.y,t.k)}function DB(e,t){return new Promise(r=>{e.attr("src",t),e.on("load",()=>{r(e)})})}var NB,O_,L_,Tm,R_,Y2,o8=q(()=>{"use strict";Ye();xs();Ie();NB=xe("viewerChanged"),R_=Qo().extent([[0,0],[320,240]]).translateExtent([[0,0],[320,240]]).scaleExtent([1,15]);Y2={init:async function(e,t){return this.event=_e(this,NB,"on"),Tm=t,Tm.call(R_.on("zoom",Toe)),L_=Tm.append("div").attr("class","photo-frame plane-frame").classed("hide",!0),O_=L_.append("img").attr("class","plane-photo"),e.ui().photoviewer.on("resize.plane",function(r){R_.extent([[0,0],r]).translateExtent([[0,0],r])}),await Promise.resolve(),this},showPhotoFrame:function(e){return e.selectAll(".photo-frame.plane-frame.hide").size()&&(e.selectAll(".photo-frame:not(.plane-frame)").classed("hide",!0),e.selectAll(".photo-frame.plane-frame").classed("hide",!1)),this},hidePhotoFrame:function(e){return e.select("photo-frame.plane-frame").classed("hide",!1),this},selectPhoto:function(e){return NB.call("viewerChanged"),DB(O_,""),DB(O_,e.image_path).then(()=>{Tm.call(R_.transform,Qr)}),this},getYaw:function(){return 0}}});var OB={};j(OB,{svgLocalPhotos:()=>B_});import Noe from"exifr";import{isArray as U_,isNumber as s8}from"lodash-es";function B_(e,t,r){let n=sr(),i=Q(null),a,o=[],s=0,l,u;function c(){if(FB)return;Nm=!0;function S(I){I.stopPropagation(),I.preventDefault(),I.dataTransfer.dropEffect="copy"}t.container().attr("dropzone","copy").on("drop.svgLocalPhotos",function(I){I.stopPropagation(),I.preventDefault(),n.filedrop&&v.fileList(I.dataTransfer.files,b=>{b.length>0&&v.fitZoom(!1)})}).on("dragenter.svgLocalPhotos",S).on("dragexit.svgLocalPhotos",S).on("dragover.svgLocalPhotos",S),FB=!0}function f(S){if(l)return Promise.resolve(l);let b=S.container().select(".photoviewer").selectAll(".local-photos-wrapper").data([0]).enter().append("div").attr("class","photo-wrapper local-photos-wrapper").classed("hide",!0);b.append("div").attr("class","photo-attribution photo-attribution-dual fillD");let y=b.append("div").attr("class","photo-controls-wrap").append("div").attr("class","photo-controls-local");return y.append("button").classed("back",!0).on("click.back",()=>d(-1)).text("\u25C0"),y.append("button").classed("forward",!0).on("click.forward",()=>d(1)).text("\u25B6"),Y2.init(S,b).then(E=>{l=E})}function d(S){if(!o||o.length===0)return;u===void 0&&(u=0);let I=u+S;u=Math.max(0,Math.min(o.length-1,I)),m(null,o[u],!1)}function m(S,I,b){u=o.indexOf(I),f(t).then(()=>{let y=t.container().select(".photoviewer").datum(I).classed("hide",!1),E=y.select(".local-photos-wrapper").classed("hide",!1),M=y.select(".photo-controls-wrap");M.select(".back").attr("disabled",u<=0?!0:null),M.select(".forward").attr("disabled",u>=o.length-1?!0:null);let F=E.selectAll(".photo-attribution").text("");I.date&&F.append("span").text(I.date.toLocaleString(pe.localeCode())),I.name&&F.append("span").classed("filename",!0).text(I.name),l.selectPhoto({image_path:""}),I.getSrc().then(N=>{l.selectPhoto({image_path:N}).showPhotoFrame(E),g()})}),b&&t.map().centerEase(I.loc)}function h(S){var I=e(S.loc);return"translate("+I[0]+","+I[1]+")"}function g(S){let I=t.container().select(".photoviewer"),b=I.empty()?void 0:I.datum();t.container().selectAll(".layer-local-photos .viewfield-group").classed("hovered",y=>y.id===(S==null?void 0:S.id)).classed("highlighted",y=>y.id===(S==null?void 0:S.id)||y.id===(b==null?void 0:b.id)).classed("currentView",y=>y.id===(b==null?void 0:b.id))}function A(S){S=S.filter(F=>U_(F.loc)&&s8(F.loc[0])&&s8(F.loc[1]));let I=i.selectAll(".markers").selectAll(".viewfield-group").data(S,function(F){return F.id});I.exit().remove();let b=I.enter().append("g").attr("class","viewfield-group").on("mouseenter",(F,N)=>g(N)).on("mouseleave",()=>g(null)).on("click",m);b.append("g").attr("class","viewfield-scale");let y=I.merge(b).attr("transform",h).select(".viewfield-scale");y.selectAll("circle").data([0]).enter().append("circle").attr("dx","0").attr("dy","0").attr("r","6");let E=t.map().zoom()>=Doe,M=y.selectAll(".viewfield").data(E?[0]:[]);M.exit().remove(),M.enter().insert("path","circle").attr("class","viewfield").attr("transform",function(){var N;let F=this.parentNode.__data__;return`rotate(${Math.round((N=F.direction)!=null?N:0)},0,0),scale(1.5,1.5),translate(-8,-13)`}).attr("d","M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z").style("visibility",function(){let F=this.parentNode.__data__;return s8(F.direction)?"visible":"hidden"})}function v(S){i=S.selectAll(".layer-local-photos").data(o?[0]:[]),i.exit().remove();let I=i.enter().append("g").attr("class","layer-local-photos");I.append("g").attr("class","markers"),i=I.merge(i),o&&A(o)}function _(S){return new Promise((I,b)=>{let y=new FileReader;y.onload=()=>I(y.result),y.onerror=E=>b(E),y.readAsDataURL(S)})}async function w(S,I){let b=[];for(let y of S)try{let E=await Noe.parse(y),M={id:s++,name:y.name,getSrc:()=>_(y),file:y,loc:[E.longitude,E.latitude],direction:E.GPSImgDirection,date:E.CreateDate||E.DateTimeOriginal||E.ModifyDate};b.push(M);let F=o.filter(N=>N.name===M.name);if(F.length===0)o.push(M);else{let N=await M.getSrc();(await Promise.allSettled(F.map(O=>O.getSrc()))).some(O=>O.value===N)||o.push(M)}}catch{}typeof I=="function"&&I(b),r.call("change")}v.setFiles=function(S,I){return w(Array.from(S),I),this},v.fileList=function(S,I){return arguments.length?(a=S,!S||!S.length?this:(v.setFiles(a,I),this)):a},v.getPhotos=function(){return o},v.removePhoto=function(S){return o=o.filter(I=>I.id!==S),r.call("change"),o},v.openPhoto=m,v.fitZoom=function(S){let I=o.map(M=>M.loc).filter(M=>U_(M)&&s8(M[0])&&s8(M[1]));if(I.length===0)return;let b=I.map(M=>Me(M,M)).reduce((M,F)=>M.extend(F)),y=t.map();var E=y.trimmedExtent().polygon();(S!==!1||!ao(E,I,!0))&&y.centerZoom(b.center(),Math.min(18,y.trimmedExtentZoom(b)))};function k(){i.style("display","block"),i.style("opacity",0).transition().duration(250).style("opacity",1).on("end",function(){r.call("change")})}function x(){i.transition().duration(250).style("opacity",0).on("end",()=>{i.selectAll(".viewfield-group").remove(),i.style("display","none")})}return v.enabled=function(S){return arguments.length?(Nm=S,Nm?k():x(),r.call("change"),this):Nm},v.hasData=function(){return U_(o)&&o.length>0},c(),v}var FB,Nm,Doe,z_=q(()=>{"use strict";Ae();ue();Li();He();o8();FB=!1,Nm=!1,Doe=16});var RB={};j(RB,{svgOsmose:()=>q_});import Poe from"lodash-es/throttle.js";function q_(e,t,r){let n=Poe(()=>r.call("change"),1e3),i=12,a=Q(null),o=Q(null),s=!1;function l(A,v){A.attr("class",v).attr("transform","translate(-10, -28)").attr("points","16,3 4,3 1,6 1,17 4,20 7,20 10,27 13,20 16,20 19,17.033 19,6")}function u(){return de.osmose&&!D5?(D5=de.osmose,D5.on("loaded",n)):!de.osmose&&D5&&(D5=null),D5}function c(){s||(s=!0,o.style("display","block"))}function f(){s&&(s=!1,o.style("display","none"),o.selectAll(".qaItem.osmose").remove(),a.selectAll(".qaItem.osmose").remove())}function d(){c(),o.style("opacity",0).transition().duration(250).style("opacity",1).on("end interrupt",()=>r.call("change"))}function m(){n.cancel(),o.interrupt(),a.selectAll(".qaItem.osmose").remove(),o.transition().duration(250).style("opacity",0).on("end interrupt",()=>{f(),r.call("change")})}function h(){if(!s||!N5)return;let A=u(),v=t.selectedErrorID(),_=A?A.getItems(e):[],w=jt(e),k=o.selectAll(".qaItem.osmose").data(_,y=>y.id);k.exit().remove();let x=k.enter().append("g").attr("class",y=>`qaItem ${y.service} itemId-${y.id} itemType-${y.itemType}`);if(x.append("polygon").call(l,"shadow"),x.append("ellipse").attr("cx",0).attr("cy",0).attr("rx",4.5).attr("ry",2).attr("class","stroke"),x.append("polygon").attr("fill",y=>A.getColor(y.item)).call(l,"qaItem-fill"),x.append("use").attr("class","icon-annotation").attr("transform","translate(-6, -22)").attr("width","12px").attr("height","12px").attr("xlink:href",y=>y.icon?"#"+y.icon:""),k.merge(x).sort(b).classed("selected",y=>y.id===v).attr("transform",w),a.empty())return;let S=t.getDebug("target")?"pink":"nocolor",I=a.selectAll(".qaItem.osmose").data(_,y=>y.id);I.exit().remove(),I.enter().append("rect").attr("width","20px").attr("height","30px").attr("x","-10px").attr("y","-28px").merge(I).sort(b).attr("class",y=>`qaItem ${y.service} target ${S} itemId-${y.id}`).attr("transform",w);function b(y,E){return y.id===v?1:E.id===v?-1:E.loc[1]-y.loc[1]}}function g(A){let v=u(),_=t.surface();_&&!_.empty()&&(a=_.selectAll(".data-layer.touch .layer-touch.markers")),o=A.selectAll(".layer-osmose").data(v?[0]:[]),o.exit().remove(),o=o.enter().append("g").attr("class","layer-osmose").style("display",N5?"block":"none").merge(o),N5&&(v&&~~t.map().zoom()>=i?(c(),v.loadIssues(e),h()):f())}return g.enabled=function(A){return arguments.length?(N5=A,N5?u().loadStrings().then(d).catch(v=>{console.log(v)}):(m(),t.selectedErrorID()&&t.enter(Ue(t))),r.call("change"),this):N5},g.supported=()=>!!u(),g}var N5,D5,V_=q(()=>{"use strict";Ae();Kt();Tr();pt();N5=!1});var LB={};j(LB,{svgStreetside:()=>La});import Foe from"lodash-es/throttle.js";function La(e,t,r){var n=Foe(function(){r.call("change")},1e3),i=14,a=16,o=18,s=Q(null),l=0,u=null,c;function f(){La.initialized||(La.enabled=!1,La.initialized=!0)}function d(){return de.streetside&&!c?(c=de.streetside,c.event.on("viewerChanged.svgStreetside",x).on("loadedImages.svgStreetside",n)):!de.streetside&&c&&(c=null),c}function m(){var E=d();E&&(g(),s.style("opacity",0).transition().duration(250).style("opacity",1).on("end",function(){r.call("change")}))}function h(){n.cancel(),s.transition().duration(250).style("opacity",0).on("end",A)}function g(){s.style("display","block")}function A(){s.selectAll(".viewfield-group").remove(),s.style("display","none")}function v(E,M){var F=d();F&&(M.sequenceKey!==u&&(l=0),u=M.sequenceKey,F.ensureViewerLoaded(t).then(function(){F.selectImage(t,M.key).yaw(l).showViewer(t)}),t.map().centerEase(M.loc))}function _(E,M){var F=d();F&&F.setStyles(t,M)}function w(){var E=d();E&&E.setStyles(t,null)}function k(E){var M=jt(e)(E),F=E.ca+l;return F&&(M+=" rotate("+Math.floor(F)+",0,0)"),M}function x(){var E=d();if(E){var M=E.viewer();M&&(l=M.getYaw(),!t.map().isTransformed()&&s.selectAll(".viewfield-group.currentView").attr("transform",k))}}function S(E){var M=t.photos().fromDate(),F=t.photos().toDate(),N=t.photos().usernames();if(M){var D=new Date(M).getTime();E=E.filter(function(L){return new Date(L.captured_at).getTime()>=D})}if(F){var O=new Date(F).getTime();E=E.filter(function(L){return new Date(L.captured_at).getTime()<=O})}return N&&(E=E.filter(function(L){return N.indexOf(L.captured_by)!==-1})),E}function I(E){var M=t.photos().fromDate(),F=t.photos().toDate(),N=t.photos().usernames();if(M){var D=new Date(M).getTime();E=E.filter(function(L){return new Date(L.properties.captured_at).getTime()>=D})}if(F){var O=new Date(F).getTime();E=E.filter(function(L){return new Date(L.properties.captured_at).getTime()<=O})}return N&&(E=E.filter(function(L){return N.indexOf(L.properties.captured_by)!==-1})),E}function b(){var E=t.container().select(".photoviewer"),M=E.empty()?void 0:E.datum(),F=~~t.map().zoom(),N=F>=a,D=F>=o,O=d(),L=[],P=[];t.photos().showsPanoramic()&&(L=O?O.sequences(e):[],P=O&&N?O.bubbles(e):[],L=I(L),P=S(P));var U=s.selectAll(".sequences").selectAll(".sequence").data(L,function(Y){return Y.properties.key});r.call("photoDatesChanged",this,"streetside",[...P.map(Y=>Y.captured_at),...L.map(Y=>Y.properties.vintageStart)]),U.exit().remove(),U=U.enter().append("path").attr("class","sequence").merge(U).attr("d",Pr(e).geojson);var B=s.selectAll(".markers").selectAll(".viewfield-group").data(P,function(Y){return Y.key+(Y.sequenceKey?"v1":"v0")});B.exit().remove();var z=B.enter().append("g").attr("class","viewfield-group").on("mouseenter",_).on("mouseleave",w).on("click",v);z.append("g").attr("class","viewfield-scale");var V=B.merge(z).sort(function(Y,J){return Y===M?1:J===M?-1:J.loc[1]-Y.loc[1]}).attr("transform",k).select(".viewfield-scale");V.selectAll("circle").data([0]).enter().append("circle").attr("dx","0").attr("dy","0").attr("r","6");var G=V.selectAll(".viewfield").data(D?[0]:[]);G.exit().remove(),G.enter().insert("path","circle").attr("class","viewfield").attr("transform","scale(1.5,1.5),translate(-8, -13)").attr("d",W);function W(){var Y=this.parentNode.__data__;return Y.pano?"M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0":"M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z"}}function y(E){var M=La.enabled,F=d();s=E.selectAll(".layer-streetside-images").data(F?[0]:[]),s.exit().remove();var N=s.enter().append("g").attr("class","layer-streetside-images").style("display",M?"block":"none");N.append("g").attr("class","sequences"),N.append("g").attr("class","markers"),s=N.merge(s),M?F&&~~t.map().zoom()>=i?(g(),b(),F.loadBubbles(e)):(r.call("photoDatesChanged",this,"streetside",[]),A()):r.call("photoDatesChanged",this,"streetside",[])}return y.enabled=function(E){return arguments.length?(La.enabled=E,La.enabled?(m(),t.photos().on("change.streetside",b)):(h(),t.photos().on("change.streetside",null)),r.call("change"),this):La.enabled},y.supported=function(){return!!d()},y.rendered=function(E){return E>=i},f(),y}var Dm=q(()=>{"use strict";Ae();Tr();pt()});var UB={};j(UB,{svgVegbilder:()=>Ua});import Ooe from"lodash-es/throttle.js";function Ua(e,t,r){let n=Ooe(()=>r.call("change"),1e3),i=14,a=16,o=18,s=Q(null),l=0,u;function c(){Ua.initialized||(Ua.enabled=!1,Ua.initialized=!0)}function f(){return de.vegbilder&&!u?(u=de.vegbilder,u.event.on("viewerChanged.svgVegbilder",k).on("loadedImages.svgVegbilder",n)):!de.vegbilder&&u&&(u=null),u}function d(){f()&&(h(),s.style("opacity",0).transition().duration(250).style("opacity",1).on("end",()=>r.call("change")))}function m(){n.cancel(),s.transition().duration(250).style("opacity",0).on("end",g)}function h(){s.style("display","block")}function g(){s.selectAll(".viewfield-group").remove(),s.style("display","none")}function A(y,E){let M=f();M&&(M.ensureViewerLoaded(t).then(()=>{M.selectImage(t,E.key).showViewer(t)}),t.map().centerEase(E.loc))}function v(y,E){let M=f();M&&M.setStyles(t,E)}function _(){let y=f();y&&y.setStyles(t,null)}function w(y,E){let M=jt(e)(y),F=y.ca;return y===E&&(F+=l),F&&(M+=" rotate("+Math.floor(F)+",0,0)"),M}function k(){let y=f();!y||(l=y.photoFrame().getYaw(),t.map().isTransformed())||s.selectAll(".viewfield-group.currentView").attr("transform",M=>w(M,M))}function x(y){let E=t.photos(),M=E.fromDate(),F=E.toDate(),N=E.showsFlat(),D=E.showsPanoramic();if(M){let O=new Date(M);y=y.filter(L=>L.captured_at.getTime()>=O.getTime())}if(F){let O=new Date(F);y=y.filter(L=>L.captured_at.getTime()<=O.getTime())}return D||(y=y.filter(O=>!O.is_sphere)),N||(y=y.filter(O=>O.is_sphere)),y}function S(y){let E=t.photos(),M=E.fromDate(),F=E.toDate(),N=E.showsFlat(),D=E.showsPanoramic();if(M){let O=new Date(M);y=y.filter(({images:L})=>L[0].captured_at.getTime()>=O.getTime())}if(F){let O=new Date(F);y=y.filter(({images:L})=>L[L.length-1].captured_at.getTime()<=O.getTime())}return D||(y=y.filter(({images:O})=>!O[0].is_sphere)),N||(y=y.filter(({images:O})=>O[0].is_sphere)),y}function I(){let y=t.container().select(".photoviewer"),E=y.empty()?void 0:y.datum(),M=~~t.map().zoom(),F=M>=a,N=M>=o,D=f(),O=[],L=[];D&&(D.loadImages(t),O=D.sequences(e),L=F?D.images(e):[],r.call("photoDatesChanged",this,"vegbilder",L.map(W=>W.captured_at)),L=x(L),O=S(O));let P=s.selectAll(".sequences").selectAll(".sequence").data(O,W=>W.key);P.exit().remove(),P.enter().append("path").attr("class","sequence").merge(P).attr("d",Pr(e).geojson);let U=s.selectAll(".markers").selectAll(".viewfield-group").data(L,W=>W.key);U.exit().remove();let B=U.enter().append("g").attr("class","viewfield-group").on("mouseenter",v).on("mouseleave",_).on("click",A);B.append("g").attr("class","viewfield-scale");let z=U.merge(B).sort((W,Y)=>W===E?1:Y===E?-1:Y.loc[1]-W.loc[1]).attr("transform",W=>w(W,E)).select(".viewfield-scale");z.selectAll("circle").data([0]).enter().append("circle").attr("dx","0").attr("dy","0").attr("r","6");let V=z.selectAll(".viewfield").data(N?[0]:[]);V.exit().remove(),V.enter().insert("path","circle").attr("class","viewfield").attr("transform","scale(1.5,1.5),translate(-8, -13)").attr("d",G);function G(){return this.parentNode.__data__.is_sphere?"M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0":"M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z"}}function b(y){let E=Ua.enabled,M=f();s=y.selectAll(".layer-vegbilder").data(M?[0]:[]),s.exit().remove();let F=s.enter().append("g").attr("class","layer-vegbilder").style("display",E?"block":"none");F.append("g").attr("class","sequences"),F.append("g").attr("class","markers"),s=F.merge(s),E&&(M&&~~t.map().zoom()>=i?(h(),I(),M.loadImages(t)):g())}return b.enabled=function(y){return arguments.length?(Ua.enabled=y,Ua.enabled?(d(),t.photos().on("change.vegbilder",I)):(m(),t.photos().on("change.vegbilder",null)),r.call("change"),this):Ua.enabled},b.supported=function(){return!!f()},b.rendered=function(y){return y>=i},b.validHere=function(y,E){return E>=i-2&&f().validHere(y)},c(),b}var Pm=q(()=>{"use strict";Ae();Tr();pt()});var BB={};j(BB,{svgMapillaryImages:()=>Ba});import Roe from"lodash-es/throttle.js";function Ba(e,t,r){let n=Roe(function(){r.call("change")},1e3),i=12,a=16,o=18,s=Q(null),l;function u(){Ba.initialized||(Ba.enabled=!1,Ba.initialized=!0)}function c(){return de.mapillary&&!l?(l=de.mapillary,l.event.on("loadedImages",n)):!de.mapillary&&l&&(l=null),l}function f(){c()&&(m(),s.style("opacity",0).transition().duration(250).style("opacity",1).on("end",function(){r.call("change")}))}function d(){n.cancel(),s.transition().duration(250).style("opacity",0).on("end",h)}function m(){s.style("display","block")}function h(){s.selectAll(".viewfield-group").remove(),s.style("display","none")}function g(I,b){let y=c();y&&(y.ensureViewerLoaded(t).then(function(){y.selectImage(t,b.id).showViewer(t)}),t.map().centerEase(b.loc))}function A(I,b){let y=c();y&&y.setStyles(t,b)}function v(){let I=c();I&&I.setStyles(t,null)}function _(I){let b=jt(e)(I);return I.ca&&(b+=" rotate("+Math.floor(I.ca)+",0,0)"),b}function w(I){let b=t.photos().showsPanoramic(),y=t.photos().showsFlat(),E=t.photos().fromDate(),M=t.photos().toDate();return(!b||!y)&&(I=I.filter(function(F){return F.is_pano?b:y})),E&&(I=I.filter(function(F){return new Date(F.captured_at).getTime()>=new Date(E).getTime()})),M&&(I=I.filter(function(F){return new Date(F.captured_at).getTime()<=new Date(M).getTime()})),I}function k(I){let b=t.photos().showsPanoramic(),y=t.photos().showsFlat(),E=t.photos().fromDate(),M=t.photos().toDate();return(!b||!y)&&(I=I.filter(function(F){return F.properties.hasOwnProperty("is_pano")?F.properties.is_pano?b:y:!1})),E&&(I=I.filter(function(F){return new Date(F.properties.captured_at).getTime()>=new Date(E).getTime().toString()})),M&&(I=I.filter(function(F){return new Date(F.properties.captured_at).getTime()<=new Date(M).getTime().toString()})),I}function x(){let I=~~t.map().zoom(),b=I>=a,y=I>=o,E=c(),M=E?E.sequences(e):[],F=E&&b?E.images(e):[];r.call("photoDatesChanged",this,"mapillary",[...F.map(B=>B.captured_at),...M.map(B=>B.properties.captured_at)]),F=w(F),M=k(M,E),E.filterViewer(t);let N=s.selectAll(".sequences").selectAll(".sequence").data(M,function(B){return B.properties.id});N.exit().remove(),N=N.enter().append("path").attr("class","sequence").merge(N).attr("d",Pr(e).geojson);let D=s.selectAll(".markers").selectAll(".viewfield-group").data(F,function(B){return B.id});D.exit().remove();let O=D.enter().append("g").attr("class","viewfield-group").on("mouseenter",A).on("mouseleave",v).on("click",g);O.append("g").attr("class","viewfield-scale");let L=D.merge(O).sort(function(B,z){return z.loc[1]-B.loc[1]}).attr("transform",_).select(".viewfield-scale");L.selectAll("circle").data([0]).enter().append("circle").attr("dx","0").attr("dy","0").attr("r","6");let P=L.selectAll(".viewfield").data(y?[0]:[]);P.exit().remove(),P.enter().insert("path","circle").attr("class","viewfield").classed("pano",function(){return this.parentNode.__data__.is_pano}).attr("transform","scale(1.5,1.5),translate(-8, -13)").attr("d",U);function U(){return this.parentNode.__data__.is_pano?"M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0":"M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z"}}function S(I){let b=Ba.enabled,y=c();s=I.selectAll(".layer-mapillary").data(y?[0]:[]),s.exit().remove();let E=s.enter().append("g").attr("class","layer-mapillary").style("display",b?"block":"none");E.append("g").attr("class","sequences"),E.append("g").attr("class","markers"),s=E.merge(s),b?y&&~~t.map().zoom()>=i?(m(),x(),y.loadImages(e)):(r.call("photoDatesChanged",this,"mapillary",[]),h()):r.call("photoDatesChanged",this,"mapillary",[])}return S.enabled=function(I){return arguments.length?(Ba.enabled=I,Ba.enabled?(f(),t.photos().on("change.mapillary_images",x)):(d(),t.photos().on("change.mapillary_images",null)),r.call("change"),this):Ba.enabled},S.supported=function(){return!!c()},S.rendered=function(I){return I>=i},u(),S}var Fm=q(()=>{"use strict";Ae();Tr();pt()});var zB={};j(zB,{svgMapillaryPosition:()=>l8});import Loe from"lodash-es/throttle.js";function l8(e,t){let r=Loe(function(){m()},1e3),n=12,i=18,a=Q(null),o,s;function l(){l8.initialized||(l8.initialized=!0)}function u(){return de.mapillary&&!o?(o=de.mapillary,o.event.on("imageChanged",r),o.event.on("bearingChanged",function(g){s=g.bearing,!t.map().isTransformed()&&a.selectAll(".viewfield-group.currentView").filter(function(A){return A.is_pano}).attr("transform",d)})):!de.mapillary&&o&&(o=null),o}function c(){a.style("display","block")}function f(){a.selectAll(".viewfield-group").remove(),a.style("display","none")}function d(g){let A=jt(e)(g);return g.is_pano&&s!==null&&isFinite(s)?A+=" rotate("+Math.floor(s)+",0,0)":g.ca&&(A+=" rotate("+Math.floor(g.ca)+",0,0)"),A}function m(){let A=~~t.map().zoom()>=i,v=u(),_=v&&v.getActiveImage(),w=a.selectAll(".markers").selectAll(".viewfield-group").data(_?[_]:[],function(I){return I.id});w.exit().remove();let k=w.enter().append("g").attr("class","viewfield-group currentView highlighted");k.append("g").attr("class","viewfield-scale");let x=w.merge(k).attr("transform",d).select(".viewfield-scale");x.selectAll("circle").data([0]).enter().append("circle").attr("dx","0").attr("dy","0").attr("r","6");let S=x.selectAll(".viewfield").data(A?[0]:[]);S.exit().remove(),S.enter().insert("path","circle").attr("class","viewfield").attr("transform","scale(1.5,1.5),translate(-8, -13)").attr("d","M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z")}function h(g){let A=u();a=g.selectAll(".layer-mapillary-position").data(A?[0]:[]),a.exit().remove();let v=a.enter().append("g").attr("class","layer-mapillary-position");v.append("g").attr("class","markers"),a=v.merge(a),A&&~~t.map().zoom()>=n?(c(),m()):f()}return h.enabled=function(){return m(),this},h.supported=function(){return!!u()},h.rendered=function(g){return g>=n},l(),h}var $_=q(()=>{"use strict";Ae();Tr();pt()});var qB={};j(qB,{svgMapillarySigns:()=>za});import Uoe from"lodash-es/throttle.js";function za(e,t,r){let n=Uoe(function(){r.call("change")},1e3),i=12,a=Q(null),o;function s(){za.initialized||(za.enabled=!1,za.initialized=!0)}function l(){return de.mapillary&&!o?(o=de.mapillary,o.event.on("loadedSigns",n)):!de.mapillary&&o&&(o=null),o}function u(){let v=l();v&&(v.loadSignResources(t),f())}function c(){n.cancel(),d()}function f(){a.style("display","block")}function d(){a.selectAll(".icon-sign").remove(),a.style("display","none")}function m(v,_){let w=l();if(!w)return;t.map().centerEase(_.loc);let k=w.getActiveImage()&&w.getActiveImage().id;w.getDetections(_.id).then(x=>{if(x.length){let S=x[0].image.id;S===k?w.highlightDetection(x[0]).selectImage(t,S):w.ensureViewerLoaded(t).then(function(){w.highlightDetection(x[0]).selectImage(t,S).showViewer(t)})}})}function h(v){var _=t.photos().fromDate(),w=t.photos().toDate();if(_){var k=new Date(_).getTime();v=v.filter(function(S){return new Date(S.last_seen_at).getTime()>=k})}if(w){var x=new Date(w).getTime();v=v.filter(function(S){return new Date(S.first_seen_at).getTime()<=x})}return v}function g(){let v=l(),_=v?v.signs(e):[];_=h(_);let w=jt(e),k=a.selectAll(".icon-sign").data(_,function(S){return S.id});k.exit().remove();let x=k.enter().append("g").attr("class","icon-sign icon-detected").on("click",m);x.append("use").attr("width","24px").attr("height","24px").attr("x","-12px").attr("y","-12px").attr("xlink:href",function(S){return"#"+S.value}),x.append("rect").attr("width","24px").attr("height","24px").attr("x","-12px").attr("y","-12px"),k.merge(x).attr("transform",w)}function A(v){let _=za.enabled,w=l();a=v.selectAll(".layer-mapillary-signs").data(w?[0]:[]),a.exit().remove(),a=a.enter().append("g").attr("class","layer-mapillary-signs layer-mapillary-detections").style("display",_?"block":"none").merge(a),_?w&&~~t.map().zoom()>=i?(f(),g(),w.loadSigns(e),w.showSignDetections(!0)):d():w&&w.showSignDetections(!1)}return A.enabled=function(v){return arguments.length?(za.enabled=v,za.enabled?(u(),t.photos().on("change.mapillary_signs",g)):(c(),t.photos().on("change.mapillary_signs",null)),r.call("change"),this):za.enabled},A.supported=function(){return!!l()},A.rendered=function(v){return v>=i},s(),A}var Om=q(()=>{"use strict";Ae();Tr();pt()});var VB={};j(VB,{svgMapillaryMapFeatures:()=>j1});import Boe from"lodash-es/throttle.js";function j1(e,t,r){let n=Boe(function(){r.call("change")},1e3),i=12,a=Q(null),o;function s(){j1.initialized||(j1.enabled=!1,j1.initialized=!0)}function l(){return de.mapillary&&!o?(o=de.mapillary,o.event.on("loadedMapFeatures",n)):!de.mapillary&&o&&(o=null),o}function u(){let v=l();v&&(v.loadObjectResources(t),f())}function c(){n.cancel(),d()}function f(){a.style("display","block")}function d(){a.selectAll(".icon-map-feature").remove(),a.style("display","none")}function m(v,_){let w=l();if(!w)return;t.map().centerEase(_.loc);let k=w.getActiveImage()&&w.getActiveImage().id;w.getDetections(_.id).then(x=>{if(x.length){let S=x[0].image.id;S===k?w.highlightDetection(x[0]).selectImage(t,S):w.ensureViewerLoaded(t).then(function(){w.highlightDetection(x[0]).selectImage(t,S).showViewer(t)})}})}function h(v){let _=t.photos().fromDate(),w=t.photos().toDate();return _&&(v=v.filter(function(k){return new Date(k.last_seen_at).getTime()>=new Date(_).getTime()})),w&&(v=v.filter(function(k){return new Date(k.first_seen_at).getTime()<=new Date(w).getTime()})),v}function g(){let v=l(),_=v?v.mapFeatures(e):[];_=h(_);let w=jt(e),k=a.selectAll(".icon-map-feature").data(_,function(S){return S.id});k.exit().remove();let x=k.enter().append("g").attr("class","icon-map-feature icon-detected").on("click",m);x.append("title").text(function(S){var I=S.value.replace(/--/g,".").replace(/-/g,"_");return T("mapillary_map_features."+I)}),x.append("use").attr("width","24px").attr("height","24px").attr("x","-12px").attr("y","-12px").attr("xlink:href",function(S){return S.value==="object--billboard"?"#object--sign--advertisement":"#"+S.value}),x.append("rect").attr("width","24px").attr("height","24px").attr("x","-12px").attr("y","-12px"),k.merge(x).attr("transform",w)}function A(v){let _=j1.enabled,w=l();a=v.selectAll(".layer-mapillary-map-features").data(w?[0]:[]),a.exit().remove(),a=a.enter().append("g").attr("class","layer-mapillary-map-features layer-mapillary-detections").style("display",_?"block":"none").merge(a),_?w&&~~t.map().zoom()>=i?(f(),g(),w.loadMapFeatures(e),w.showFeatureDetections(!0)):d():w&&w.showFeatureDetections(!1)}return A.enabled=function(v){return arguments.length?(j1.enabled=v,j1.enabled?(u(),t.photos().on("change.mapillary_map_features",g)):(c(),t.photos().on("change.mapillary_map_features",null)),r.call("change"),this):j1.enabled},A.supported=function(){return!!l()},A.rendered=function(v){return v>=i},s(),A}var G_=q(()=>{"use strict";Ae();Tr();pt();ue()});var $B={};j($B,{svgKartaviewImages:()=>qa});import zoe from"lodash-es/throttle.js";function qa(e,t,r){var n=zoe(function(){r.call("change")},1e3),i=12,a=16,o=18,s=Q(null),l;function u(){qa.initialized||(qa.enabled=!1,qa.initialized=!0)}function c(){return de.kartaview&&!l?(l=de.kartaview,l.event.on("loadedImages",n)):!de.kartaview&&l&&(l=null),l}function f(){var I=c();I&&(m(),s.style("opacity",0).transition().duration(250).style("opacity",1).on("end",function(){r.call("change")}))}function d(){n.cancel(),s.transition().duration(250).style("opacity",0).on("end",h)}function m(){s.style("display","block")}function h(){s.selectAll(".viewfield-group").remove(),s.style("display","none")}function g(I,b){var y=c();y&&(y.ensureViewerLoaded(t).then(function(){y.selectImage(t,b.key).showViewer(t)}),t.map().centerEase(b.loc))}function A(I,b){var y=c();y&&y.setStyles(t,b)}function v(){var I=c();I&&I.setStyles(t,null)}function _(I){var b=jt(e)(I);return I.ca&&(b+=" rotate("+Math.floor(I.ca)+",0,0)"),b}function w(I){var b=t.photos().fromDate(),y=t.photos().toDate(),E=t.photos().usernames();if(b){var M=new Date(b).getTime();I=I.filter(function(N){return new Date(N.captured_at).getTime()>=M})}if(y){var F=new Date(y).getTime();I=I.filter(function(N){return new Date(N.captured_at).getTime()<=F})}return E&&(I=I.filter(function(N){return E.indexOf(N.captured_by)!==-1})),I}function k(I){var b=t.photos().fromDate(),y=t.photos().toDate(),E=t.photos().usernames();if(b){var M=new Date(b).getTime();I=I.filter(function(N){return new Date(N.properties.captured_at).getTime()>=M})}if(y){var F=new Date(y).getTime();I=I.filter(function(N){return new Date(N.properties.captured_at).getTime()<=F})}return E&&(I=I.filter(function(N){return E.indexOf(N.properties.captured_by)!==-1})),I}function x(){var I=t.container().select(".photoviewer"),b=I.empty()?void 0:I.datum(),y=~~t.map().zoom(),E=y>=a,M=y>=o,F=c(),N=[],D=[];N=F?F.sequences(e):[],D=F&&E?F.images(e):[],r.call("photoDatesChanged",this,"kartaview",[...D.map(z=>z.captured_at),...N.map(z=>z.properties.captured_at)]),N=k(N),D=w(D);var O=s.selectAll(".sequences").selectAll(".sequence").data(N,function(z){return z.properties.key});O.exit().remove(),O=O.enter().append("path").attr("class","sequence").merge(O).attr("d",Pr(e).geojson);var L=s.selectAll(".markers").selectAll(".viewfield-group").data(D,function(z){return z.key});L.exit().remove();var P=L.enter().append("g").attr("class","viewfield-group").on("mouseenter",A).on("mouseleave",v).on("click",g);P.append("g").attr("class","viewfield-scale");var U=L.merge(P).sort(function(z,V){return z===b?1:V===b?-1:V.loc[1]-z.loc[1]}).attr("transform",_).select(".viewfield-scale");U.selectAll("circle").data([0]).enter().append("circle").attr("dx","0").attr("dy","0").attr("r","6");var B=U.selectAll(".viewfield").data(M?[0]:[]);B.exit().remove(),B.enter().insert("path","circle").attr("class","viewfield").attr("transform","scale(1.5,1.5),translate(-8, -13)").attr("d","M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z")}function S(I){var b=qa.enabled,y=c();s=I.selectAll(".layer-kartaview").data(y?[0]:[]),s.exit().remove();var E=s.enter().append("g").attr("class","layer-kartaview").style("display",b?"block":"none");E.append("g").attr("class","sequences"),E.append("g").attr("class","markers"),s=E.merge(s),b?y&&~~t.map().zoom()>=i?(m(),x(),y.loadImages(e)):(r.call("photoDatesChanged",this,"kartaview",[]),h()):r.call("photoDatesChanged",this,"kartaview",[])}return S.enabled=function(I){return arguments.length?(qa.enabled=I,qa.enabled?(f(),t.photos().on("change.kartaview_images",x)):(d(),t.photos().on("change.kartaview_images",null)),r.call("change"),this):qa.enabled},S.supported=function(){return!!c()},S.rendered=function(I){return I>=i},u(),S}var Rm=q(()=>{"use strict";Ae();Tr();pt()});var GB={};j(GB,{svgMapilioImages:()=>Va});import qoe from"lodash-es/throttle.js";function Va(e,t,r){let n=qoe(function(){r.call("change")},1e3),i=12,a=Q(null),o,s=18;function l(){Va.initialized||(Va.enabled=!1,Va.initialized=!0)}function u(){return de.mapilio&&!o?(o=de.mapilio,o.event.on("loadedImages",n)):!de.mapilio&&o&&(o=null),o}function c(){u()&&(m(),a.style("opacity",0).transition().duration(250).style("opacity",1).on("end",function(){r.call("change")}))}function f(){n.cancel(),a.transition().duration(250).style("opacity",0).on("end",h)}function d(S){let I=jt(e)(S);return S.heading&&(I+=" rotate("+Math.floor(S.heading)+",0,0)"),I}function m(){a.style("display","block")}function h(){a.selectAll(".viewfield-group").remove(),a.style("display","none")}function g(S,I){let b=u();b&&(b.ensureViewerLoaded(t,I.id).then(function(){b.selectImage(t,I.id).showViewer(t)}),t.map().centerEase(I.loc))}function A(S,I){let b=u();b&&b.setStyles(t,I)}function v(){let S=u();S&&S.setStyles(t,null)}function _(S){var I=t.photos().fromDate(),b=t.photos().toDate();if(I){var y=new Date(I).getTime();S=S.filter(function(M){return new Date(M.capture_time).getTime()>=y})}if(b){var E=new Date(b).getTime();S=S.filter(function(M){return new Date(M.capture_time).getTime()<=E})}return S}function w(S){var I=t.photos().fromDate(),b=t.photos().toDate();if(I){var y=new Date(I).getTime();S=S.filter(function(M){return new Date(M.properties.capture_time).getTime()>=y})}if(b){var E=new Date(b).getTime();S=S.filter(function(M){return new Date(M.properties.capture_time).getTime()<=E})}return S}function k(){let I=~~t.map().zoom()>=s,b=u(),y=b?b.sequences(e):[],E=b?b.images(e):[];r.call("photoDatesChanged",this,"mapilio",[...E.map(P=>P.capture_time),...y.map(P=>P.properties.capture_time)]),y=w(y),E=_(E);let M=a.selectAll(".sequences").selectAll(".sequence").data(y,function(P){return P.properties.id});M.exit().remove(),M.enter().append("path").attr("class","sequence").merge(M).attr("d",Pr(e).geojson);let F=a.selectAll(".markers").selectAll(".viewfield-group").data(E,function(P){return P.id});F.exit().remove();let N=F.enter().append("g").attr("class","viewfield-group").on("mouseenter",A).on("mouseleave",v).on("click",g);N.append("g").attr("class","viewfield-scale");let D=F.merge(N).sort(function(P,U){return U.loc[1]-P.loc[1]}).attr("transform",d).select(".viewfield-scale");D.selectAll("circle").data([0]).enter().append("circle").attr("dx","0").attr("dy","0").attr("r","6");let O=D.selectAll(".viewfield").data(I?[0]:[]);O.exit().remove(),O.enter().insert("path","circle").attr("class","viewfield").attr("transform","scale(1.5,1.5),translate(-8, -13)").attr("d",L);function L(){return this.parentNode.__data__.isPano?"M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0":"M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z"}}function x(S){let I=Va.enabled,b=u();a=S.selectAll(".layer-mapilio").data(b?[0]:[]),a.exit().remove();let y=a.enter().append("g").attr("class","layer-mapilio").style("display",I?"block":"none");y.append("g").attr("class","sequences"),y.append("g").attr("class","markers"),a=y.merge(a),I?b&&~~t.map().zoom()>=i?(m(),k(),b.loadImages(e),b.loadLines(e)):(r.call("photoDatesChanged",this,"mapilio",[]),h()):r.call("photoDatesChanged",this,"mapilio",[])}return x.enabled=function(S){return arguments.length?(Va.enabled=S,Va.enabled?(c(),t.photos().on("change.mapilio_images",k)):(f(),t.photos().on("change.mapilio_images",null)),r.call("change"),this):Va.enabled},x.supported=function(){return!!u()},x.rendered=function(S){return S>=i},l(),x}var Lm=q(()=>{"use strict";Ae();pt();Tr()});var WB={};j(WB,{svgPanoramaxImages:()=>$a});import Voe from"lodash-es/throttle.js";function $a(e,t,r){let n=Voe(function(){r.call("change")},1e3),i=15,a=10,o=18,s=Q(null),l,u=0,c,f;function d(){$a.initialized||($a.enabled=!1,$a.initialized=!0)}function m(){return de.panoramax&&!l?(l=de.panoramax,l.event.on("viewerChanged",y).on("loadedLines",n).on("loadedImages",n)):!de.panoramax&&l&&(l=null),l}async function h(M){let F=t.photos().showsPanoramic(),N=t.photos().showsFlat(),D=t.photos().fromDate(),O=t.photos().toDate(),L=t.photos().usernames(),P=m();if((!F||!N)&&(M=M.filter(function(U){return U.isPano?F:N})),D&&(M=M.filter(function(U){return new Date(U.capture_time).getTime()>=new Date(D).getTime()})),O&&(M=M.filter(function(U){return new Date(U.capture_time).getTime()<=new Date(O).getTime()})),L&&P){if(c!==L){c=L;let U=await P.getUserIds(L);f={},U.forEach(B=>{f[B]=!0})}M=M.filter(function(U){return f[U.account_id]})}return M}async function g(M){let F=t.photos().showsPanoramic(),N=t.photos().showsFlat(),D=t.photos().fromDate(),O=t.photos().toDate(),L=t.photos().usernames(),P=m();if((!F||!N)&&(M=M.filter(function(U){return U.properties.type==="equirectangular"?F:N})),D&&(M=M.filter(function(U){return new Date(U.properties.date).getTime()>=new Date(D).getTime().toString()})),O&&(M=M.filter(function(U){return new Date(U.properties.date).getTime()<=new Date(O).getTime().toString()})),L&&P){if(c!==L){c=L;let U=await P.getUserIds(L);f={},U.forEach(B=>{f[B]=!0})}M=M.filter(function(U){return f[U.properties.account_id]})}return M}function A(){m()&&(w(),s.style("opacity",0).transition().duration(250).style("opacity",1).on("end",function(){r.call("change")}))}function v(){n.cancel(),s.transition().duration(250).style("opacity",0).on("end",k)}function _(M,F){let N=jt(e)(M),D=M.heading;return M.id===F&&(D+=u),D&&(N+=" rotate("+Math.floor(D)+",0,0)"),N}function w(){s.style("display","block")}function k(){m().hideViewer(t),s.selectAll(".viewfield-group").remove(),s.style("display","none")}function x(M,F){let N=m();N&&(N.ensureViewerLoaded(t).then(function(){N.selectImage(t,F.id).showViewer(t)}),t.map().centerEase(F.loc))}function S(M,F){let N=m();N&&N.setStyles(t,F)}function I(){let M=m();M&&M.setStyles(t,null)}async function b(){var Y;let M=~~t.map().zoom(),F=M>=o,N=m(),D=N?N.sequences(e,M):[],O=N&&M>=i?N.images(e):[];r.call("photoDatesChanged",this,"panoramax",[...O.map(J=>J.capture_time),...D.map(J=>J.properties.date)]),Q(".photo-wrapper.panoramax-wrapper.hide").size()&&N.setActiveImage(null),O=await h(O),D=await g(D,N);let P=s.selectAll(".sequences").selectAll(".sequence").data(D,function(J){return J.properties.id});P.exit().remove(),P.enter().append("path").attr("class","sequence").merge(P).attr("d",Pr(e).geojson);let U=s.selectAll(".markers").selectAll(".viewfield-group").data(O,function(J){return J.id});U.exit().remove();let B=U.enter().append("g").attr("class","viewfield-group").on("mouseenter",S).on("mouseleave",I).on("click",x);B.append("g").attr("class","viewfield-scale");let z=(Y=N.getActiveImage())==null?void 0:Y.id,V=U.merge(B).sort(function(J,oe){return J.id===z?1:oe.id===z?-1:J.capture_time_parsed-oe.capture_time_parsed}).attr("transform",J=>_(J,z)).select(".viewfield-scale");V.selectAll("circle").data([0]).enter().append("circle").attr("dx","0").attr("dy","0").attr("r","6");let G=V.selectAll(".viewfield").data(F?[0]:[]);G.exit().remove(),G.enter().insert("path","circle").attr("class","viewfield").attr("transform","scale(1.5,1.5),translate(-8, -13)").attr("d",W),N.setStyles(t,null);function W(){return this.parentNode.__data__.isPano?"M 8,13 m -10,0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0":"M 6,9 C 8,8.4 8,8.4 10,9 L 16,-2 C 12,-5 4,-5 0,-2 z"}}function y(){let M=m();if(!M)return;let F=M.photoFrame();F&&(u=F.getYaw(),!t.map().isTransformed()&&s.selectAll(".viewfield-group.currentView").attr("transform",N=>_(N,N.id)))}function E(M){let F=$a.enabled,N=m();s=M.selectAll(".layer-panoramax").data(N?[0]:[]),s.exit().remove();let D=s.enter().append("g").attr("class","layer-panoramax").style("display",F?"block":"none");if(D.append("g").attr("class","sequences"),D.append("g").attr("class","markers"),s=D.merge(s),F){let O=~~t.map().zoom();N?O>=i?(w(),b(),N.loadImages(e)):O>=a?(w(),b(),N.loadLines(e,O)):(k(),r.call("photoDatesChanged",this,"panoramax",[])):k()}else r.call("photoDatesChanged",this,"panoramax",[])}return E.enabled=function(M){return arguments.length?($a.enabled=M,$a.enabled?(A(),t.photos().on("change.panoramax_images",b)):(v(),t.photos().on("change.panoramax_images",null)),r.call("change"),this):$a.enabled},E.supported=function(){return!!m()},E.rendered=function(M){return M>=a},d(),E}var Um=q(()=>{"use strict";Ae();pt();Tr()});var QB={};j(QB,{svgOsm:()=>P5});function P5(e,t,r){var n=!0;function i(s){s.selectAll(".layer-osm").data(["covered","areas","lines","points","labels"]).enter().append("g").attr("class",function(l){return"layer-osm "+l}),s.selectAll(".layer-osm.points").selectAll(".points-group").data(["points","midpoints","vertices","turns"]).enter().append("g").attr("class",function(l){return"points-group "+l})}function a(){var s=t.surface().selectAll(".data-layer.osm");s.interrupt(),s.classed("disabled",!1).style("opacity",0).transition().duration(250).style("opacity",1).on("end interrupt",function(){r.call("change")})}function o(){var s=t.surface().selectAll(".data-layer.osm");s.interrupt(),s.transition().duration(250).style("opacity",0).on("end interrupt",function(){s.classed("disabled",!0),r.call("change")})}return i.enabled=function(s){return arguments.length?(n=s,n?a():o(),r.call("change"),this):n},i}var Bm=q(()=>{"use strict"});var HB={};j(HB,{svgNotes:()=>R5});import $oe from"lodash-es/throttle.js";function R5(e,t,r){r||(r=xe("change"));var n=$oe(function(){r.call("change")},1e3),i=12,a=Q(null),o=Q(null),s=!1;function l(A,v){A.attr("class",v).attr("transform","translate(-8, -22)").attr("d","m17.5,0l-15,0c-1.37,0 -2.5,1.12 -2.5,2.5l0,11.25c0,1.37 1.12,2.5 2.5,2.5l3.75,0l0,3.28c0,0.38 0.43,0.6 0.75,0.37l4.87,-3.65l5.62,0c1.37,0 2.5,-1.12 2.5,-2.5l0,-11.25c0,-1.37 -1.12,-2.5 -2.5,-2.5z")}function u(){return de.osm&&!O5?(O5=de.osm,O5.on("loadedNotes",n)):!de.osm&&O5&&(O5=null),O5}function c(){s||(s=!0,o.style("display","block"))}function f(){s&&(s=!1,o.style("display","none"),o.selectAll(".note").remove(),a.selectAll(".note").remove())}function d(){c(),o.style("opacity",0).transition().duration(250).style("opacity",1).on("end interrupt",function(){r.call("change")})}function m(){n.cancel(),o.interrupt(),a.selectAll(".note").remove(),o.transition().duration(250).style("opacity",0).on("end interrupt",function(){f(),r.call("change")})}function h(){if(!s||!F5)return;var A=u(),v=t.selectedNoteID(),_=A?A.notes(e):[],w=jt(e),k=o.selectAll(".note").data(_,function(y){return y.status+y.id});k.exit().remove();var x=k.enter().append("g").attr("class",function(y){return"note note-"+y.id+" "+y.status}).classed("new",function(y){return y.id<0});if(x.append("ellipse").attr("cx",.5).attr("cy",1).attr("rx",6.5).attr("ry",3).attr("class","stroke"),x.append("path").call(l,"shadow"),x.append("use").attr("class","note-fill").attr("width","20px").attr("height","20px").attr("x","-8px").attr("y","-22px").attr("xlink:href","#iD-icon-note"),x.selectAll(".icon-annotation").data(function(y){return[y]}).enter().append("use").attr("class","icon-annotation").attr("width","10px").attr("height","10px").attr("x","-3px").attr("y","-19px").attr("xlink:href",function(y){return y.id<0?"#iD-icon-plus":y.status==="open"?"#iD-icon-close":"#iD-icon-apply"}),k.merge(x).sort(b).classed("selected",function(y){var E=t.mode(),M=E&&E.id==="drag-note";return!M&&y.id===v}).attr("transform",w),a.empty())return;var S=t.getDebug("target")?"pink ":"nocolor ",I=a.selectAll(".note").data(_,function(y){return y.id});I.exit().remove(),I.enter().append("rect").attr("width","20px").attr("height","20px").attr("x","-8px").attr("y","-22px").merge(I).sort(b).attr("class",function(y){var E=y.id<0?"new":"";return"note target note-"+y.id+" "+S+E}).attr("transform",w);function b(y,E){return y.id===v?1:E.id===v?-1:E.loc[1]-y.loc[1]}}function g(A){var v=u(),_=t.surface();_&&!_.empty()&&(a=_.selectAll(".data-layer.touch .layer-touch.markers")),o=A.selectAll(".layer-notes").data(v?[0]:[]),o.exit().remove(),o=o.enter().append("g").attr("class","layer-notes").style("display",F5?"block":"none").merge(o),F5&&(v&&~~t.map().zoom()>=i?(c(),v.loadNotes(e),h()):f())}return g.enabled=function(A){return arguments.length?(F5=A,F5?d():(m(),t.selectedNoteID()&&t.enter(Ue(t))),r.call("change"),this):F5},g}var Goe,F5,O5,zm=q(()=>{"use strict";Ae();Ye();Kt();Tr();pt();Ie();Goe=Ft(window.location.hash),F5=!!Goe.notes});var jB={};j(jB,{svgTouch:()=>L5});function L5(){function e(t){t.selectAll(".layer-touch").data(["areas","lines","points","turns","markers"]).enter().append("g").attr("class",function(r){return"layer-touch "+r})}return e}var qm=q(()=>{"use strict"});var KB={};j(KB,{utilGetDimensions:()=>Jr,utilSetDimensions:()=>U5});function YB(e,t){var r=t.getBoundingClientRect(),n=[r.width,r.height];return e.property("__dimensions__",n),n}function Jr(e,t){if(!e||e.empty())return[0,0];var r=e.node(),n=e.property("__dimensions__");return!n||t?YB(e,r):n}function U5(e,t){if(!e||e.empty())return e;var r=e.node();return t===null?(YB(e,r),e):e.property("__dimensions__",[t[0],t[1]]).attr("width",t[0]).attr("height",t[1])}var $s=q(()=>{"use strict"});var XB={};j(XB,{svgLayers:()=>Cl});function Cl(e,t){var r=xe("change","photoDatesChanged"),n=Q(null),i=[{id:"osm",layer:P5(e,t,r)},{id:"notes",layer:R5(e,t,r)},{id:"data",layer:Al(e,t,r)},{id:"keepRight",layer:M5(e,t,r)},{id:"osmose",layer:q_(e,t,r)},{id:"streetside",layer:La(e,t,r)},{id:"mapillary",layer:Ba(e,t,r)},{id:"mapillary-position",layer:l8(e,t,r)},{id:"mapillary-map-features",layer:j1(e,t,r)},{id:"mapillary-signs",layer:za(e,t,r)},{id:"kartaview",layer:qa(e,t,r)},{id:"mapilio",layer:Va(e,t,r)},{id:"vegbilder",layer:Ua(e,t,r)},{id:"panoramax",layer:$a(e,t,r)},{id:"local-photos",layer:B_(e,t,r)},{id:"debug",layer:Sl(e,t,r)},{id:"geolocate",layer:Ra(e,t,r)},{id:"touch",layer:L5(e,t,r)}];function a(o){n=o.selectAll(".surface").data([0]),n=n.enter().append("svg").attr("class","surface").merge(n);var s=n.selectAll(".surface-defs").data([0]);s.enter().append("defs").attr("class","surface-defs");var l=n.selectAll(".data-layer").data(i);l.exit().remove(),l.enter().append("g").attr("class",function(u){return"data-layer "+u.id}).merge(l).each(function(u){Q(this).call(u.layer)})}return a.all=function(){return i},a.layer=function(o){var s=i.find(function(l){return l.id===o});return s&&s.layer},a.only=function(o){var s=[].concat(o),l=i.map(function(u){return u.id});return a.remove(yr(l,s))},a.remove=function(o){var s=[].concat(o);return s.forEach(function(l){i=i.filter(function(u){return u.id!==l})}),r.call("change"),this},a.add=function(o){var s=[].concat(o);return s.forEach(function(l){"id"in l&&"layer"in l&&i.push(l)}),r.call("change"),this},a.dimensions=function(o){return arguments.length?(U5(n,o),this):Jr(n)},_e(a,r,"on")}var W_=q(()=>{"use strict";Ye();Ae();Sm();z_();Cm();Mm();Im();V_();Dm();Pm();Fm();$_();Om();G_();Rm();Lm();Um();Bm();zm();qm();Ie();$s()});var ZB={};j(ZB,{svgLines:()=>Il});function Woe(e){return e.highway==="construction"&&e.bridge?"white":e.highway==="pedestrian"||e.railway?"gray":e.aeroway==="runway"?"white":"black"}function Il(e,t){var r=sr(),n={motorway:0,motorway_link:1,trunk:2,trunk_link:3,primary:4,primary_link:5,secondary:6,tertiary:7,unclassified:8,residential:9,service:10,busway:11,footway:12};function i(o,s,l,u){var c=t.getDebug("target")?"pink ":"nocolor ",f=t.getDebug("target")?"red ":"nocolor ",d=Pr(e).geojson,m=t.activeID(),h=t.history().base(),g={targets:[],nopes:[]};l.forEach(function(x){var S=kl(x,s,m);g.targets.push.apply(g.targets,S.passive),g.nopes.push.apply(g.nopes,S.active)});var A=g.targets.filter(d),v=o.selectAll(".line.target-allowed").filter(function(x){return u(x.properties.entity)}).data(A,function(S){return S.id});v.exit().remove();var _=function(x){var S=x.properties.entity.id;return!h.entities[S]||!(0,u8.default)(s.entities[S].nodes,h.entities[S].nodes)?!1:x.properties.nodes.some(function(I){return!h.entities[I.id]||!(0,u8.default)(s.entities[I.id].loc,h.entities[I.id].loc)})};v.enter().append("path").merge(v).attr("d",d).attr("class",function(x){return"way line target target-allowed "+c+x.id}).classed("segment-edited",_);var w=g.nopes.filter(d),k=o.selectAll(".line.target-nope").filter(function(x){return u(x.properties.entity)}).data(w,function(S){return S.id});k.exit().remove(),k.enter().append("path").merge(k).attr("d",d).attr("class",function(x){return"way line target target-nope "+f+x.id}).classed("segment-edited",_)}function a(o,s,l,u){var c=t.history().base();function f(E,M){var F=t.selectedIDs(),N=F.indexOf(E.id)!==-1?20:0,D=F.indexOf(M.id)!==-1?20:0;return E.tags.highway&&(N-=n[E.tags.highway]),M.tags.highway&&(D-=n[M.tags.highway]),N-D}function d(E,M,F){var N=t.mode(),D=N&&/^draw/.test(N.id),O=!D&&F?"selected ":"",L=E.selectAll("path").filter(u).data(m(F),Le.key);return L.exit().remove(),L.enter().append("path").attr("class",function(P){var U="way line";if(!P.hasInterestingTags()){var B=s.parentRelations(P),z=B.filter(function(G){return G.isMultipolygon()});z.length>0&&B.length===z.length&&(U="relation area")}var V=w[P.id]?"old-multipolygon ":"";return U+" "+M+" "+O+V+P.id}).classed("added",function(P){return!c.entities[P.id]}).classed("geometry-edited",function(P){return s.entities[P.id]&&c.entities[P.id]&&!(0,u8.default)(s.entities[P.id].nodes,c.entities[P.id].nodes)}).classed("retagged",function(P){return s.entities[P.id]&&c.entities[P.id]&&!(0,u8.default)(s.entities[P.id].tags,c.entities[P.id].tags)}).call(ti()).merge(L).sort(f).attr("d",g).call(ti().tags(_5(s))),E}function m(E){return function(){var M=this.parentNode.__data__,F=S[M]||[];return F.filter(function(N){return E?t.selectedIDs().indexOf(N.id)!==-1:t.selectedIDs().indexOf(N.id)===-1})}}function h(E,M,F,N,D){var O=E.selectAll("g."+F).data([M]);O=O.enter().append("g").attr("class",F).merge(O);var L=O.selectAll("path").filter(u).data(function(){return N[this.parentNode.__data__]||[]},function(U){return[U.id,U.index]});L.exit().remove(),L=L.enter().append("path").attr("class",M).merge(L).attr("marker-mid",D).attr("d",function(P){return P.d}),r.ie&&L.each(function(){this.parentNode.insertBefore(this,this)})}for(var g=Pr(e,s),A=[],v={},_={},w={},k=0;k<l.length;k++){var x=l[k];(x.geometry(s)==="line"||x.geometry(s)==="area"&&x.sidednessIdentifier&&x.sidednessIdentifier()==="coastline")&&A.push(x)}A=A.filter(g);let S=pr(A,E=>Math.trunc(E.layer()));Object.keys(S).forEach(function(E){var M=S[E],F=M.filter(function(L){return L.isOneWay()}),N=Q2(e,s,36,L=>L.isOneWayBackwards(),L=>L.isBiDirectional());v[E]=D1(F.map(N));var D=M.filter(function(L){return L.isSided()}),O=Q2(e,s,30);_[E]=D1(D.map(O))});var I=o.selectAll(".layer-osm.covered"),b=o.selectAll(".layer-osm.lines"),y=o.selectAll(".layer-touch.lines");[I,b].forEach(function(E){var M=E===I?d4(-10,0):d4(0,11),F=E.selectAll("g.layergroup").data(M);F=F.enter().append("g").attr("class",function(N){return"layergroup layer"+String(N)}).merge(F),F.selectAll("g.linegroup").data(["shadow","casing","stroke","shadow-highlighted","casing-highlighted","stroke-highlighted"]).enter().append("g").attr("class",function(N){return"linegroup line-"+N}),F.selectAll("g.line-shadow").call(d,"shadow",!1),F.selectAll("g.line-casing").call(d,"casing",!1),F.selectAll("g.line-stroke").call(d,"stroke",!1),F.selectAll("g.line-shadow-highlighted").call(d,"shadow",!0),F.selectAll("g.line-casing-highlighted").call(d,"casing",!0),F.selectAll("g.line-stroke-highlighted").call(d,"stroke",!0),h(F,"oneway","onewaygroup",v,N=>`url(#ideditor-oneway-marker-${Woe(s.entity(N.id).tags)})`),h(F,"sided","sidedgroup",_,function(D){var O=s.entity(D.id).sidednessIdentifier();return"url(#ideditor-sided-marker-"+O+")"})}),y.call(i,s,A,u)}return a}var u8,Q_=q(()=>{"use strict";u8=or(go(),1);bn();Tr();El();lr();Ie();Li()});var JB={};j(JB,{svgMidpoints:()=>B5});function B5(e,t){var r=8;function n(a,o,s,l){var u=t.getDebug("target")?"pink ":"nocolor ",c=jt(e).geojson,f=s.map(function(m){return{type:"Feature",id:m.id,properties:{target:!0,entity:m},geometry:{type:"Point",coordinates:m.loc}}}),d=a.selectAll(".midpoint.target").filter(function(m){return l(m.properties.entity)}).data(f,function(h){return h.id});d.exit().remove(),d.enter().append("circle").attr("r",r).merge(d).attr("class",function(m){return"node midpoint target "+u+m.id}).attr("transform",c)}function i(a,o,s,l,u){var c=a.selectAll(".layer-osm.points .points-group.midpoints"),f=a.selectAll(".layer-touch.points"),d=t.mode();if(d&&d.id!=="select"||!t.map().withinEditableZoom()){c.selectAll(".midpoint").remove(),f.selectAll(".midpoint.target").remove();return}for(var m=u.polygon(),h={},g=0;g<s.length;g++){var A=s[g];if(A.type==="way"&&l(A)&&!(t.selectedIDs().indexOf(A.id)<0))for(var v=o.childNodes(A),_=0;_<v.length-1;_++){var w=v[_],k=v[_+1],x=[w.id,k.id].sort().join("-");if(h[x])h[x].parents.push(A);else if(ft(e(w.loc),e(k.loc))>40){var S=Qt(w.loc,k.loc,.5),I=null;if(u.intersects(S))I=S;else for(var b=0;b<4;b++)if(S=ra([w.loc,k.loc],[m[b],m[b+1]]),S&&ft(e(w.loc),e(S))>20&&ft(e(k.loc),e(S))>20){I=S;break}I&&(h[x]={type:"midpoint",id:x,loc:I,edge:[w.id,k.id],parents:[A]})}}}function y(F){if(h[F.id])return!0;for(var N=0;N<F.parents.length;N++)if(l(F.parents[N]))return!0;return!1}var E=c.selectAll(".midpoint").filter(y).data(Object.values(h),function(F){return F.id});E.exit().remove();var M=E.enter().insert("g",":first-child").attr("class","midpoint");M.append("polygon").attr("points","-6,8 10,0 -6,-8").attr("class","shadow"),M.append("polygon").attr("points","-3,4 5,0 -3,-4").attr("class","fill"),E=E.merge(M).attr("transform",function(F){var N=jt(e),D=o.entity(F.edge[0]),O=o.entity(F.edge[1]),L=fn(D,O,e)*(180/Math.PI);return N(F)+" rotate("+L+")"}).call(ti().tags(function(F){return F.parents[0].tags})),E.select("polygon.shadow"),E.select("polygon.fill"),f.call(n,o,Object.values(h),y)}return i}var H_=q(()=>{"use strict";Tr();El();He()});var ez={};j(ez,{svgPoints:()=>z5});function z5(e,t){function r(s,l){s.attr("class",l).attr("transform","translate(-8, -23)").attr("d","M 17,8 C 17,13 11,21 8.5,23.5 C 6,21 0,13 0,8 C 0,4 4,-0.5 8.5,-0.5 C 13,-0.5 17,4 17,8 z")}function n(s,l){return l.loc[1]-s.loc[1]}function i(s){var l=t.mode(),u=l&&/^(add|draw|drag|move|rotate)/.test(l.id);return u?s.id:Le.key(s)}function a(s,l,u,c){var f=t.getDebug("target")?"pink ":"nocolor ",d=jt(e).geojson,m=t.activeID(),h=[];u.forEach(function(A){m!==A.id&&h.push({type:"Feature",id:A.id,properties:{target:!0,entity:A},geometry:A.asGeoJSON()})});var g=s.selectAll(".point.target").filter(function(A){return c(A.properties.entity)}).data(h,function(v){return v.id});g.exit().remove(),g.enter().append("rect").attr("x",-10).attr("y",-26).attr("width",20).attr("height",30).merge(g).attr("class",function(A){return"node point target "+f+A.id}).attr("transform",d)}function o(s,l,u,c){var f=t.surface().classed("fill-wireframe"),d=Yt(e.scale()),m=t.history().base();function h(k){return k.geometry(l)==="point"&&!(d>=18&&k.directions(l,e).length)}var g=f?[]:u.filter(h);g.sort(n);var A=s.selectAll(".layer-osm.points .points-group.points"),v=s.selectAll(".layer-touch.points"),_=A.selectAll("g.point").filter(c).data(g,i);_.exit().remove();var w=_.enter().append("g").attr("class",function(k){return"node point "+k.id}).order();w.append("path").call(r,"shadow"),w.append("ellipse").attr("cx",.5).attr("cy",1).attr("rx",6.5).attr("ry",3).attr("class","stroke"),w.append("path").call(r,"stroke"),w.append("use").attr("transform","translate(-5.5, -20)").attr("class","icon").attr("width","12px").attr("height","12px"),_=_.merge(w).attr("transform",jt(e)).classed("added",function(k){return!m.entities[k.id]}).classed("moved",function(k){return m.entities[k.id]&&!(0,j_.default)(l.entities[k.id].loc,m.entities[k.id].loc)}).classed("retagged",function(k){return m.entities[k.id]&&!(0,j_.default)(l.entities[k.id].tags,m.entities[k.id].tags)}).call(ti()),_.select(".shadow"),_.select(".stroke"),_.select(".icon").attr("xlink:href",function(k){var x=Pe.match(k,l),S=x&&x.icon;return S?"#"+S:""}),v.call(a,l,g,c)}return o}var j_,Y_=q(()=>{"use strict";j_=or(go(),1);He();lr();Tr();El();At()});var tz={};j(tz,{svgTurns:()=>q5});function q5(e,t){function r(i){var a=i.u?"-u":"";return i.no?"#iD-turn-no"+a:i.only?"#iD-turn-only"+a:"#iD-turn-yes"+a}function n(i,a,o){function s(g){var A=50,v=a.entity(g.to.way),_=a.childNodes(v).map(function(E){return E.loc}).map(e),w=qo(_),k=w/2,x=a.entity(g.to.node),S=a.entity(g.to.vertex),I=fn(S,x,e),b=e(S.loc),y=g.u?0:v.__via?Math.min(k,A):A;return"translate("+(y*Math.cos(I)+b[0])+","+(y*Math.sin(I)+b[1])+") rotate("+I*180/Math.PI+")"}var l=i.selectAll(".layer-osm.points .points-group.turns"),u=i.selectAll(".layer-touch.turns"),c=l.selectAll("g.turn").data(o,function(g){return g.key});c.exit().remove();var f=c.enter().append("g").attr("class",function(g){return"turn "+g.key}),d=f.filter(function(g){return!g.u});d.append("rect").attr("transform","translate(-22, -12)").attr("width","44").attr("height","24"),d.append("use").attr("transform","translate(-22, -12)").attr("width","44").attr("height","24");var m=f.filter(function(g){return g.u});m.append("circle").attr("r","16"),m.append("use").attr("transform","translate(-16, -16)").attr("width","32").attr("height","32"),c=c.merge(f).attr("opacity",function(g){return g.direct===!1?"0.7":null}).attr("transform",s),c.select("use").attr("xlink:href",r),c.select("rect"),c.select("circle");var h=t.getDebug("target")?"pink ":"nocolor ";return c=u.selectAll("g.turn").data(o,function(g){return g.key}),c.exit().remove(),f=c.enter().append("g").attr("class",function(g){return"turn "+g.key}),d=f.filter(function(g){return!g.u}),d.append("rect").attr("class","target "+h).attr("transform","translate(-22, -12)").attr("width","44").attr("height","24"),m=f.filter(function(g){return g.u}),m.append("circle").attr("class","target "+h).attr("r","16"),c=c.merge(f).attr("transform",s),c.select("rect"),c.select("circle"),this}return n}var K_=q(()=>{"use strict";He()});var rz={};j(rz,{svgVertices:()=>Ml});function Ml(e,t){var r={shadow:[6,7.5,7.5,12],stroke:[2.5,3.5,3.5,8],fill:[1,1.5,1.5,1.5]},n,i={},a={},o={},s={},l={},u={};function c(_,w){return w.loc[1]-_.loc[1]}function f(_){var w=t.mode(),k=w&&/^(add|draw|drag|move|rotate)/.test(w.id);return k?_.id:Le.key(_)}function d(_,w,k,x,S){x=x||{selected:{},important:{},hovered:{}};var I={},b={},y=t.surface().classed("fill-wireframe"),E=Yt(e.scale()),M=E<17?0:E<18?1:2,F=t.activeID(),N=t.history().base();function D(G){var W=w.entity(G.id);return W.id in I||(I[W.id]=W.hasInterestingTags()&&Pe.match(W,w).icon),I[W.id]}function O(G){if(G.id in b)return b[G.id];var W=G.directions(w,e);return b[G.id]=W.length?W:!1,W}function L(G){["shadow","stroke","fill"].forEach(function(W){var Y=r[W];G.selectAll("."+W).each(function(J){var oe=M&&D(J),Ce=Y[oe?3:M];J.id!==F&&J.isEndpoint(w)&&!J.isConnected(w)&&(Ce+=1.5),W==="shadow"&&(u[J.id]=Ce),Q(this).attr("r",Ce).attr("visibility",oe&&W==="fill"?"hidden":null)})})}k.sort(c);var P=_.selectAll("g.vertex").filter(S).data(k,f);P.exit().remove();var U=P.enter().append("g").attr("class",function(G){return"node vertex "+G.id}).order();U.append("circle").attr("class","shadow"),U.append("circle").attr("class","stroke"),U.filter(function(G){return G.hasInterestingTags()}).append("circle").attr("class","fill"),P=P.merge(U).attr("transform",jt(e)).classed("sibling",function(G){return G.id in x.selected}).classed("shared",function(G){return w.isShared(G)}).classed("endpoint",function(G){return G.isEndpoint(w)}).classed("added",function(G){return!N.entities[G.id]}).classed("moved",function(G){return N.entities[G.id]&&!(0,c8.default)(w.entities[G.id].loc,N.entities[G.id].loc)}).classed("retagged",function(G){return N.entities[G.id]&&!(0,c8.default)(w.entities[G.id].tags,N.entities[G.id].tags)}).call(ti()).call(L);var B=P.selectAll(".icon").data(function(W){return E>=17&&D(W)?[W]:[]},f);B.exit().remove(),B.enter().append("use").attr("class","icon").attr("width","12px").attr("height","12px").attr("transform","translate(-6, -6)").attr("xlink:href",function(G){var W=D(G);return W?"#"+W:""});var z=P.selectAll(".viewfieldgroup").data(function(W){return E>=18&&O(W)?[W]:[]},f);z.exit().remove(),z=z.enter().insert("g",".shadow").attr("class","viewfieldgroup").merge(z);var V=z.selectAll(".viewfield").data(O,function(W){return Le.key(W)});V.exit().remove(),V.enter().append("path").attr("class","viewfield").attr("d","M0,0H0").merge(V).attr("marker-start","url(#ideditor-viewfield-marker"+(y?"-wireframe":"")+")").attr("transform",function(G){return"rotate("+G+")"})}function m(_,w,k,x){var S=t.getDebug("target")?"pink ":"nocolor ",I=t.getDebug("target")?"red ":"nocolor ",b=jt(e).geojson,y=t.activeID(),E={targets:[],nopes:[]};k.forEach(function(N){if(y!==N.id){var D=W2(N,w,y);D!==0?E.targets.push({type:"Feature",id:N.id,properties:{target:!0,entity:N},geometry:N.asGeoJSON()}):E.nopes.push({type:"Feature",id:N.id+"-nope",properties:{nope:!0,target:!0,entity:N},geometry:N.asGeoJSON()})}});var M=_.selectAll(".vertex.target-allowed").filter(function(N){return x(N.properties.entity)}).data(E.targets,function(D){return D.id});M.exit().remove(),M.enter().append("circle").attr("r",function(N){return u[N.id]||r.shadow[3]}).merge(M).attr("class",function(N){return"node vertex target target-allowed "+S+N.id}).attr("transform",b);var F=_.selectAll(".vertex.target-nope").filter(function(N){return x(N.properties.entity)}).data(E.nopes,function(D){return D.id});F.exit().remove(),F.enter().append("circle").attr("r",function(N){return u[N.properties.entity.id]||r.shadow[3]}).merge(F).attr("class",function(N){return"node vertex target target-nope "+I+N.id}).attr("transform",b)}function h(_,w,k,x){var S=_.geometry(w);return S==="vertex"||S==="point"&&(k||x>=18&&_.directions(w,e).length)}function g(_,w,k){var x=w.entities[_.id],S=k.entities[_.id];return!S||!x||!(0,c8.default)(S.tags,x.tags)||!(0,c8.default)(S.loc,x.loc)}function A(_,w,k,x){var S={},I={};function b(y){if(!I[y.id]){I[y.id]=!0;var E=y.geometry(w);if(!t.features().isHiddenFeature(y,w,E)){var M;if(y.type==="way")for(M=0;M<y.nodes.length;M++){var F=w.hasEntity(y.nodes[M]);F&&b(F)}else if(y.type==="relation")for(M=0;M<y.members.length;M++){var N=w.hasEntity(y.members[M].id);N&&b(N)}else h(y,w,k,x)&&(S[y.id]=y)}}}return _.forEach(function(y){var E=w.hasEntity(y);E&&(E.type==="node"?h(E,w,k,x)&&(S[E.id]=E,w.parentWays(E).forEach(function(M){b(M)})):b(E))}),S}function v(_,w,k,x,S,I){var b=t.surface().classed("fill-wireframe"),y=t.surface().classed("highlight-edited"),E=Yt(e.scale()),M=t.mode(),F=M&&/^(add|draw|drag|move|rotate)/.test(M.id),N=t.history().base(),D=_.selectAll(".layer-osm.points .points-group.vertices"),O=_.selectAll(".layer-touch.points");I&&(i={},u={});for(var L=0;L<k.length;L++){var P=k[L],U=P.geometry(w),B=!1;(U==="point"&&h(P,w,b,E)||U==="vertex"&&(P.hasInterestingTags()||P.isEndpoint(w)||P.isConnected(w)||y&&g(P,N,w)))&&(i[P.id]=P,B=!0),!B&&!I&&delete i[P.id]}var z={persistent:i,selected:s,hovered:a},V=Object.assign({},F?a:{},s,i),G=function(J){return J.id in i||J.id in s||J.id in a||x(J)};D.call(d,w,Y(V),z,G);var W=function(J){return F?!0:G(J)};O.call(m,w,Y(V),W);function Y(J){return Object.keys(J).map(w.hasEntity,w).filter(function(oe){return oe&&oe.intersects(S,w)})}}return v.drawSelected=function(_,w,k){var x=t.surface().classed("fill-wireframe"),S=Yt(e.scale());l=s||{},t.map().isInWideSelection()?(s={},t.selectedIDs().forEach(function(b){var y=w.hasEntity(b);y&&y.type==="node"&&h(y,w,x,S)&&(s[y.id]=y)})):s=A(t.selectedIDs(),w,x,S);var I=function(b){return b.id in l};v(_,w,Object.values(l),I,k,!1)},v.drawHover=function(_,w,k,x){if(k!==n){var S=t.surface().classed("fill-wireframe"),I=Yt(e.scale());o=a||{},n=k;var b=k&&k.properties&&k.properties.entity;b?a=A([b.id],w,S,I):a={};var y=function(E){return E.id in o};v(_,w,Object.values(o),y,x,!1)}},v}var c8,X_=q(()=>{"use strict";c8=or(go(),1);Ae();At();He();lr();Tr();El()});var nz={};j(nz,{svgAreas:()=>E5,svgData:()=>Al,svgDebug:()=>Sl,svgDefs:()=>S5,svgGeolocate:()=>Ra,svgIcon:()=>ce,svgKartaviewImages:()=>qa,svgKeepRight:()=>M5,svgLabels:()=>T5,svgLayers:()=>Cl,svgLines:()=>Il,svgMapilioImages:()=>Va,svgMapillaryImages:()=>Ba,svgMapillarySigns:()=>za,svgMarkerSegments:()=>Q2,svgMidpoints:()=>B5,svgNotes:()=>R5,svgOsm:()=>P5,svgPanoramaxImages:()=>$a,svgPassiveVertex:()=>W2,svgPath:()=>Pr,svgPointTransform:()=>jt,svgPoints:()=>z5,svgRelationMemberTags:()=>_5,svgSegmentWay:()=>kl,svgStreetside:()=>La,svgTagClasses:()=>ti,svgTagPattern:()=>k5,svgTouch:()=>L5,svgTurns:()=>q5,svgVegbilder:()=>Ua,svgVertices:()=>Ml});var Sn=q(()=>{"use strict";A_();Sm();Cm();P_();Im();ot();Mm();F_();W_();Q_();Fm();Om();H_();zm();Tr();Rm();Bm();Tr();Tr();Tr();Y_();Tr();Tr();Dm();Pm();El();_m();qm();K_();X_();Lm();Um()});var iz={};j(iz,{uiLengthIndicator:()=>Mo});function Mo(e){var t=Q(null),r=_l("tooltip max-length-warning").placement("bottom").hasArrow(!0).content(()=>a=>{a.text(""),a.call(ce("#iD-icon-alert","inline")),a.call(T.append("inspector.max_length_reached",{maxChars:e}))}),n=!1,i=function(a){t=a.selectAll("span.length-indicator-wrap").data([0]),t=t.enter().append("span").merge(t).classed("length-indicator-wrap",!0),a.call(r)};return i.update=function(a){let o=Xo(po(a,Number.POSITIVE_INFINITY)),s=t.selectAll("span.length-indicator").data([o]);s.enter().append("span").merge(s).classed("length-indicator",!0).classed("limit-reached",l=>l>e).style("border-right-width",l=>`${Math.abs(e-l)*2}px`).style("margin-right",l=>l>e?`${(e-l)*2}px`:0).style("opacity",l=>l>e*.8?Math.min(1,(l/e-.8)/(1-.8)):0).style("pointer-events",l=>l>e*.8?null:"none"),!n&&(o>e?r.show():r.hide())},i.silent=function(a){return arguments.length?(n=a,i):n},i}var f8=q(()=>{"use strict";Ae();ue();Sn();Ie();r8()});var az={};j(az,{uiFieldCombo:()=>di,uiFieldManyCombo:()=>di,uiFieldMultiCombo:()=>di,uiFieldNetworkCombo:()=>di,uiFieldSemiCombo:()=>di,uiFieldTypeCombo:()=>di});function di(e,t){var r=xe("change"),n=e.type==="multiCombo"||e.type==="manyCombo",i=e.type==="networkCombo",a=e.type==="semiCombo",o=e.type!=="manyCombo"&&e.autoSuggestions!==!1,s=e.type!=="manyCombo"&&e.customValues!==!1,l=e.snake_case||e.snake_case===void 0,u=qt(t,"combo-"+e.safeid).caseSensitive(e.caseSensitive).minItems(1),c=Q(null),f=Q(null),d=Q(null),m=Mo(t.maxCharsForTagValue()),h=[],g=[],A=[],v,_,w,k=[],x=[];it.get("deprecated").then(function(se){x=se}).catch(function(){}),n&&e.key&&/[^:]$/.test(e.key)&&(e.key+=":");function S(se){return se.replace(/\s+/g,"_")}function I(se){return se.split(";").map(function(ne){return ne.trim()}).join(";")}function b(se){se=I(se||"");var ne=O(!0).find(function(he){return he.key&&I(he.value)===se});return ne?ne.key:e.type==="typeCombo"&&!se?"yes":y(se)||void 0}function y(se){return l&&(se=S(se)),e.caseSensitive||(se=se.toLowerCase()),se}function E(se,ne){return se.hasTextForStringId(`options.${ne}.title`)?`options.${ne}.title`:`options.${ne}`}function M(se){se=se||"";var ne=e.resolveReference("stringsCrossReference");let he=E(ne,se);return ne.hasTextForStringId(he)?ne.t(he,{default:se}):e.type==="typeCombo"&&se.toLowerCase()==="yes"?"":se}function F(se){se=se||"";var ne=e.resolveReference("stringsCrossReference");let he=E(ne,se);return ne.hasTextForStringId(he)?ne.t.append(he,{default:se}):(e.type==="typeCombo"&&se.toLowerCase()==="yes"&&(se=""),Se=>Se.text(se))}function N(se,ne){return se.filter(function(he){return!ne.some(function(Se){return he.value===Se.value})})}function D(se,ne){s||se.attr("readonly","readonly"),o&&de.taginfo?(se.call(u.fetcher(U),ne),U("",z)):(se.call(u,ne),setTimeout(()=>P(z),0))}function O(se){var ne=e.resolveReference("stringsCrossReference");if(!(e.options||ne.options))return[];let he;return se!==!0?he=e.options||ne.options:he=[].concat(e.options,ne.options).filter(Boolean),[...he.map(function(re){let Z=E(ne,re);return{key:re,value:ne.t(Z,{default:re}),title:ne.t(`options.${re}.description`,{default:re}),display:B(ne.t.append(Z,{default:re}),re),klass:ne.hasTextForStringId(Z)?"":"raw-option"}}),...k]}function L(){return O().length>0}function P(se,ne){h=O(),ne!==void 0&&(h=h.filter(ne)),h=N(h,g),u.data(h),c.classed("empty-combobox",h.length===0),se&&se(h)}function U(se,ne){var he=we=>we.value.toLowerCase().includes(se.toLowerCase())||we.key.toLowerCase().includes(se.toLowerCase());L()&&P(ne,he);var Se=e.resolveReference("stringsCrossReference"),re=n?"multikeys":"values",Z=(n?e.key:"")+se,te=i&&_&&_.indexOf(se.toLowerCase())===0;te&&(Z=_+":");var ye={debounce:se!=="",key:e.key,query:Z};A.length&&(ye.geometry=t.graph().geometry(A[0])),de.taginfo[re](ye,function(we,Ne){if(we)return;Ne=Ne.filter(ie=>e.type!=="typeCombo"||ie.value!=="yes"),Ne=Ne.filter(ie=>{var ve=ie.value;return n&&(ve=ve.slice(e.key.length)),ve===y(ve)});var Be=p_(x)[e.key];Be&&(Ne=Ne.filter(ie=>!Be.includes(ie.value))),te&&(Ne=Ne.filter(ie=>ie.value.toLowerCase().indexOf(_+":")===0));let le=(e.options||Se.options||[]).filter(ie=>!Ne.some(ve=>ve.value===(n?e.key+ie:ie))).map(ie=>({value:ie}));c.classed("empty-combobox",Ne.length===0),h=Ne.concat(le).map(function(ie){var ve=ie.value;n&&(ve=ve.replace(e.key,""));let be=E(Se,ve);var Te=Se.hasTextForStringId(be),Oe=Se.t(be,{default:ve});return{key:ve,value:Oe,title:Se.t(`options.${ve}.description`,{default:Te?ve:ie.title!==Oe?ie.title:""}),display:B(Se.t.append(be,{default:ve}),ve),klass:Te?"":"raw-option"}}),h=h.filter(he),h=N(h,g),ne&&ne(h,L())})}function B(se,ne){let he=e.resolveReference("iconsCrossReference");return he.icons?function(Se){var re=Se.insert("span",":first-child").attr("class","tag-value-icon");he.icons[ne]&&re.call(ce(`#${he.icons[ne]}`)),se.call(this,Se)}:se}function z(se){if(n||a)w=e.placeholder()||T("inspector.add");else{var ne=se.map(function(Z){return Z.value}).filter(function(Z){return Z.length<20}),he=ne.length>1?ne:se.map(function(Z){return Z.key});w=e.placeholder()||he.slice(0,3).join(", ")}/(…|\.\.\.)$/.test(w)||(w+="\u2026");var Se;!n&&!a&&v&&Array.isArray(v[e.key])?Se=T("inspector.multiple_values"):Se=w,c.selectAll("input").attr("placeholder",Se);var re=!s&&!se.length;c.selectAll(".chiplist .input-wrap").style("display",re?"none":null)}function V(){var se={},ne;if(n||a){var he;if(n?he=[b($e(d))]:a&&(ne=b($e(d))||"",ne=ne.replace(/,/g,";"),he=ne.split(";")),he=he.filter(Boolean),!he.length)return;if(c.classed("active",!1),$e(d,""),n)Je(he).forEach(function(Z){var te=(e.key||"")+Z;if(v){var ye=v[te];if(typeof ye=="string"&&ye.toLowerCase()!=="no")return}te=t.cleanTagKey(te),e.keys.push(te),se[te]="yes"});else if(a){var Se=g.map(function(Z){return Z.key});Se=Se.concat(he),se[e.key]=t.cleanTagValue(Je(Se).filter(Boolean).join(";"))}window.setTimeout(function(){d.node().focus()},10)}else{var re=$e(d);if(!re&&Array.isArray(v[e.key]))return;ne=t.cleanTagValue(b(re)),se[e.key]=ne||void 0}r.call("change",this,se)}function G(se,ne){se.preventDefault(),se.stopPropagation();var he={};if(n)he[ne.key]=void 0;else if(a){var Se=g.map(function(re){return re.key===ne.key?null:re.key}).filter(Boolean);Se=Je(Se),he[e.key]=Se.length?Se.join(";"):void 0,m.update(he[e.key])}r.call("change",this,he)}function W(se,ne){se.preventDefault(),se.stopPropagation();var he={};n&&(he[ne.key]=v[ne.key]==="yes"?"no":"yes"),r.call("change",this,he)}function Y(se){c=se.selectAll(".form-field-input-wrap").data([0]);var ne=n||a?"multicombo":"combo";if(c=c.enter().append("div").attr("class","form-field-input-wrap form-field-input-"+ne).merge(c),n||a){c=c.selectAll(".chiplist").data([0]);var he="chiplist";(e.key==="destination"||e.key==="via")&&(he+=" full-line-chips"),c=c.enter().append("ul").attr("class",he).on("click",function(){window.setTimeout(function(){d.node().focus()},10)}).merge(c),f=c.selectAll(".input-wrap").data([0]),f=f.enter().append("li").attr("class","input-wrap").merge(f);var Se=!s&&!h.length;f.style("display",Se?"none":null),d=f.selectAll("input").data([0])}else d=c.selectAll("input").data([0]);if(d=d.enter().append("input").attr("type","text").attr("id",e.domId).call(st).call(D,c).merge(d),a?f.call(m):n||c.call(m),i){var re=Ce(),Z=re&&Y4(re.center());_=Z&&Z.toLowerCase()}d.on("change",V).on("blur",V).on("input",function(){let te=$e(d);J(te),a&&v[e.key]&&(te+=";"+v[e.key]),m.update(te)}),d.on("keydown.field",function(te){switch(te.keyCode){case 13:d.node().blur(),te.stopPropagation();break}}),(n||a)&&(u.on("accept",function(){d.node().blur(),d.node().focus()}),d.on("focus",function(){c.classed("active",!0)})),u.on("cancel",function(){d.node().blur()}).on("update",function(){J($e(d))})}function J(se){se=b(se);let ne=c;(e.type==="multiCombo"||e.type==="semiCombo")&&(ne=c.select(".input-wrap"));let he=e.resolveReference("iconsCrossReference");he.icons&&(ne.selectAll(".tag-value-icon").remove(),he.icons[se]&&ne.selectAll(".tag-value-icon").data([se]).enter().insert("div","input").attr("class","tag-value-icon").call(ce(`#${he.icons[se]}`)))}Y.tags=function(se){v=se;var ne=e.resolveReference("stringsCrossReference"),he=Array.isArray(se[e.key]),Se=rt=>!he&&rt&&!(e.type==="typeCombo"&&rt==="yes"),re=rt=>Se(rt)&&!ne.hasTextForStringId(`options.${rt}`)&&!ne.hasTextForStringId(`options.${rt}.title`),Z=rt=>Se(rt)&&!re(rt),te=!s;if(n||a){g=[];var ye;if(n){for(var we in se)if(!(e.key&&we.indexOf(e.key)!==0)&&!(!e.key&&e.keys.indexOf(we)===-1)){var Ne=se[we],Be=e.key?we.slice(e.key.length):we;g.push({key:we,value:M(Be),display:B(F(Be),Be),state:typeof Ne=="string"?Ne.toLowerCase():"",isMixed:Array.isArray(Ne)})}e.key?(e.keys=g.map(function(We){return We.key}),ye=t.maxCharsForTagKey()-Xo(e.key)):ye=t.maxCharsForTagKey()}else if(a){var le=[],ie;Array.isArray(se[e.key])?(se[e.key].forEach(function(We){var Rt=Je((We||"").split(";")).filter(Boolean);le=le.concat(Rt),ie?ie=ie.filter(lt=>Rt.includes(lt)):ie=Rt}),le=Je(le).filter(Boolean)):(le=Je((se[e.key]||"").split(";")).filter(Boolean),ie=le),g=le.map(function(We){return{key:We,value:M(We),display:B(F(We),We),isMixed:!ie.includes(We)}});var ve=Xo(ie.join(";"));ye=t.maxCharsForTagValue()-ve,ve>0&&(ye-=1)}ye=Math.max(0,ye);var be=ye<=0||!s&&!h.length;c.selectAll(".chiplist .input-wrap").style("display",be?"none":null);var Te=a&&!Array.isArray(se[e.key]),Oe=c.selectAll(".chip").data(g);Oe.exit().remove();var Ve=Oe.enter().insert("li",".input-wrap").attr("class","chip");Ve.append("span"),Ve.append("div").attr("class","field_buttons").append("a").attr("class","remove"),Oe=Oe.merge(Ve).order().classed("raw-value",function(We){var Rt=We.key;return n&&(Rt=Rt.replace(e.key,"")),!ne.hasTextForStringId("options."+Rt)}).classed("draggable",Te).classed("mixed",function(We){return We.isMixed}).attr("title",function(We){return We.isMixed?T("inspector.unshared_value_tooltip"):["yes","no"].includes(We.state)?null:We.state}).classed("negated",We=>We.state==="no"),a||(Oe.selectAll("input[type=checkbox]").remove(),Oe.insert("input","span").attr("type","checkbox").property("checked",We=>We.state==="yes").property("indeterminate",We=>We.isMixed||!["yes","no"].includes(We.state)).on("click",W)),Te&&oe(Oe),Oe.each(function(We){let Rt=Q(this),lt=Rt.select("span"),vt=Rt.select(".field_buttons"),_t=We.value.trim();if(lt.text(""),vt.select("button").empty()||vt.select("button").remove(),_t.startsWith("https://")){lt.text(_t),vt.append("button").call(ce("#iD-icon-out-link")).attr("class","form-field-button foreign-id-permalink").attr("title",()=>T("icons.visit_website")).attr("aria-label",()=>T("icons.visit_website")).on("click",function(wr){wr.preventDefault(),window.open(_t,"_blank")});return}if(We.display){We.display(lt);return}lt.text(We.value)}),Oe.select("a.remove").attr("href","#").on("click",G).attr("class","remove").text("\xD7"),J("")}else{var Qe=he&&se[e.key].map(function(rt){return M(rt)}).filter(Boolean);$e(d,he?"":M(se[e.key])).data([se[e.key]]).classed("raw-value",re).classed("known-value",Z).attr("readonly",te?"readonly":void 0).attr("title",he?Qe.join(`
81
81
  `):void 0).attr("placeholder",he?T("inspector.multiple_values"):w||"").classed("mixed",he).on("keydown.deleteCapture",function(rt){if(te&&Z(se[e.key])&&(rt.keyCode===Xe.keyCodes["\u232B"]||rt.keyCode===Xe.keyCodes["\u2326"])){rt.preventDefault(),rt.stopPropagation();var We={};We[e.key]=void 0,r.call("change",this,We)}}),Array.isArray(se[e.key])||J(se[e.key]),he||m.update(se[e.key])}let ct=()=>{d.data([b($e(d))]).classed("raw-value",re).classed("known-value",Z)};d.on("input.refreshStyles",ct),u.on("update.refreshStyles",ct),ct()};function oe(se){var ne,he;se.call(y7().on("start",function(Se){ne={x:Se.x,y:Se.y},he=null}).on("drag",function(Se){var re=Se.x-ne.x,Z=Se.y-ne.y;if(!(!Q(this).classed("dragging")&&Math.sqrt(Math.pow(re,2)+Math.pow(Z,2))<=5)){var te=se.nodes().indexOf(this);Q(this).classed("dragging",!0),he=null;var ye=null,we=Q(this).node().offsetWidth;e.key==="destination"||e.key==="via"?c.selectAll(".chip").style("transform",function(Ne,Be){var le=Q(this).node();return te===Be?"translate("+re+"px, "+Z+"px)":Be>te&&Se.y>le.offsetTop?((he===null||Be>he)&&(he=Be),"translateY(-100%)"):Be<te&&Se.y<le.offsetTop+le.offsetHeight?((he===null||Be<he)&&(he=Be),"translateY(100%)"):null}):c.selectAll(".chip").each(function(Ne,Be){var le=Q(this).node();te!==Be&&Se.x<le.offsetLeft+le.offsetWidth+5&&Se.x>le.offsetLeft&&Se.y<le.offsetTop+le.offsetHeight&&Se.y>le.offsetTop&&(he=Be,ye=le.offsetTop)}).style("transform",function(Ne,Be){var le=Q(this).node();if(te===Be)return"translate("+re+"px, "+Z+"px)";if(le.offsetTop===ye){if(Be<te&&Be>=he)return"translateX("+we+"px)";if(Be>te&&Be<=he)return"translateX(-"+we+"px)"}return null})}}).on("end",function(){if(Q(this).classed("dragging")){var Se=se.nodes().indexOf(this);if(Q(this).classed("dragging",!1),c.selectAll(".chip").style("transform",null),typeof he=="number"){var re=g[Se];g.splice(Se,1),g.splice(he,0,re);var Z={};g.length?Z[e.key]=g.map(function(te){return te.key}).join(";"):Z[e.key]=void 0,r.call("change",this,Z)}ne=void 0,he=void 0}}))}Y.setCustomOptions=se=>{k=se},Y.focus=function(){d.node().focus()},Y.entityIDs=function(se){return arguments.length?(A=se,Y):A};function Ce(){return A&&A.length&&cr(A,t.graph())}return _e(Y,r,"on")}var d8=q(()=>{"use strict";Ye();Ae();b7();Ps();An();ue();pt();xi();ot();n3();Ie();f8();nm()});var sz={};j(sz,{behaviorHash:()=>V5});import oz from"lodash-es/throttle.js";function V5(e){var t=null,r=90-1e-8;function n(){var d=e.map(),m=d.center(),h=d.zoom(),g=Math.max(0,Math.ceil(Math.log(h)/Math.LN2)),A=Tn(Ft(window.location.hash),["comment","source","hashtags","walkthrough"]),v={};delete A.id;var _=e.selectedIDs().filter(function(w){return e.hasEntity(w)});return _.length?v.id=_.join(","):e.selectedNoteID()&&(v.id=`note/${e.selectedNoteID()}`),v.map=h.toFixed(2)+"/"+m[1].toFixed(g)+"/"+m[0].toFixed(g),Object.assign(A,v)}function i(){return"#"+at(n(),!0)}function a(d){var m=e.documentTitleBase()||"iD",h,g,A,v=e.selectedIDs().filter(function(w){return e.hasEntity(w)});if(v.length){var _=yt(e.entity(v[0]),e.graph());v.length>1?h=T("title.labeled_and_more",{labeled:_,count:v.length-1}):h=_,A="context"}return d&&(g=e.history().difference().summary().length,g>0&&(A=h?"changes_context":"changes")),A?T("title.format."+A,{changes:g,base:m,context:h}):m}function o(d){if(e.setsDocumentTitle()){var m=a(d);document.title!==m&&(document.title=m)}}function s(){if(!e.inIntro()){var d=i();if(t!==d){t=d,window.history.replaceState(null,a(!1),d),o(!0);let m=Ft(d);m.map&&ke("map-location",m.map)}}}var l=oz(s,500),u=oz(function(){o(!0)},500);function c(){if(window.location.hash!==t){t=window.location.hash;var d=Ft(t),m=(d.map||"").split("/").map(Number);if(m.length<3||m.some(isNaN))s();else{if(t===i())return;var h=e.mode();if(e.map().centerZoom([m[2],Math.min(r,Math.max(-r,m[1]))],m[0]),d.id&&h){var g=d.id.split(",").filter(function(w){return e.hasEntity(w)||w.startsWith("note/")});if(g.length&&["browse","select-note","select"].includes(h.id)){g.length===1&&g[0].startsWith("note/")?e.enter(pa(e,g[0])):dn(h.selectedIDs(),g)||e.enter(je(e,g));return}}var A=e.map().center(),v=wt(A,[m[2],m[1]]),_=500;if(h&&h.id.match(/^draw/)!==null&&v>_){e.enter(Ue(e));return}}}}function f(){e.map().on("move.behaviorHash",l),e.history().on("change.behaviorHash",u),e.on("enter.behaviorHash",l),Q(window).on("hashchange.behaviorHash",c);var d=Ft(window.location.hash);if(d.id){let m=d.id.split(",");if(m.length===1&&m[0].startsWith("note/")){let h=m[0].split("/")[1];e.moveToNote(h,!d.map)}else e.zoomToEntities(m.map(h=>h.replace(/([nwr])[^/]*\//,"$1")),!d.map)}if(d.walkthrough==="true"&&(f.startWalkthrough=!0),d.map)f.hadLocation=!0;else if(!d.id&&ke("map-location")){let m=ke("map-location").split("/").map(Number);e.map().centerZoom([m[2],Math.min(r,Math.max(-r,m[1]))],m[0]),s(),f.hadLocation=!0}c(),o(!1)}return f.off=function(){l.cancel(),u.cancel(),e.map().on("move.behaviorHash",null),e.on("enter.behaviorHash",null),Q(window).on("hashchange.behaviorHash",null),window.location.hash=""},f}var Z_=q(()=>{"use strict";Ae();He();Kt();Tl();Ie();Mr();qn();ue();fr()});var lz={};j(lz,{behaviorAddWay:()=>gl,behaviorBreathe:()=>ca,behaviorDrag:()=>fl,behaviorDraw:()=>_o,behaviorDrawWay:()=>ml,behaviorEdit:()=>ua,behaviorHash:()=>V5,behaviorHover:()=>Kn,behaviorLasso:()=>ga,behaviorOperation:()=>ur,behaviorPaste:()=>cl,behaviorSelect:()=>ha});var Vm=q(()=>{"use strict";Z9();rl();P9();X9();P2();Z4();Z_();$1();xl();Zn();D9();wl()});var uz={};j(uz,{uiAccount:()=>$5});function $5(e){let t=e.connection();function r(i){t&&(t.authenticated()?t.userDetails((a,o)=>{a&&a.status===401&&t.logout(),n(i,o)}):n(i,null))}function n(i,a){let o=i.select(".userInfo"),s=i.select(".loginLogout");if(a){o.html("").classed("hide",!1);let l=o.append("a").attr("href",t.userURL(a.display_name)).attr("target","_blank");a.image_url?l.append("img").attr("class","icon pre-text user-icon").attr("src",a.image_url):l.call(ce("#iD-icon-avatar","pre-text light")),l.append("span").attr("class","label").text(a.display_name),s.classed("hide",!1).select("a").text(T("logout")).on("click",u=>{u.preventDefault(),t.logout(),t.authenticate(void 0,{switchUser:!0})})}else o.html("").classed("hide",!0),s.classed("hide",!1).select("a").text(T("login")).on("click",l=>{l.preventDefault(),t.authenticate()})}return function(i){t&&(i.append("li").attr("class","userInfo").classed("hide",!0),i.append("li").attr("class","loginLogout").classed("hide",!0).append("a").attr("href","#"),t.on("change.account",()=>r(i)),r(i))}}var $m=q(()=>{"use strict";ue();ot()});var cz={};j(cz,{uiAttribution:()=>G5});import Qoe from"lodash-es/throttle.js";function G5(e){let t=Q(null);function r(i,a,o){let s=i.selectAll(`.${o}`).data([0]);s=s.enter().append("div").attr("class",o).merge(s);let l=s.selectAll(".attribution").data(a,c=>c.id);l.exit().remove(),l=l.enter().append("span").attr("class","attribution").each((c,f,d)=>{let m=Q(d[f]);if(c.terms_html){m.html(c.terms_html);return}c.terms_url&&(m=m.append("a").attr("href",c.terms_url).attr("target","_blank"));let h=c.id.replace(/\./g,"<TX_DOT>"),g=T(`imagery.${h}.attribution.text`,{default:c.terms_text||c.id||c.name()});c.icon&&!c.overlay&&m.append("img").attr("class","source-image").attr("src",c.icon),m.append("span").attr("class","attribution-text").text(g)}).merge(l);let u=l.selectAll(".copyright-notice").data(c=>{let f=c.copyrightNotices(e.map().zoom(),e.map().extent());return f?[f]:[]});u.exit().remove(),u=u.enter().append("span").attr("class","copyright-notice").merge(u),u.text(String)}function n(){let i=e.background().baseLayerSource();t.call(r,i?[i]:[],"base-layer-attribution");let a=e.map().zoom(),o=e.background().overlayLayerSources()||[];t.call(r,o.filter(s=>s.validZoom(a)),"overlay-layer-attribution")}return function(i){t=i,e.background().on("change.attribution",n),e.map().on("move.attribution",Qoe(n,400,{leading:!1})),n()}}var Gm=q(()=>{"use strict";Ae();ue()});var fz={};j(fz,{uiContributors:()=>W5});import Hoe from"lodash-es/debounce.js";function W5(e){var t=e.connection(),r=Hoe(function(){o()},1e3),n=4,i=!1,a=Q(null);function o(){if(t){var s={},l=e.history().intersects(e.map().extent());l.forEach(function(h){h&&h.user&&(s[h.user]=!0)});var u=Object.keys(s),c=u.slice(0,u.length>n?n-1:n);a.html("").call(ce("#iD-icon-nearby","pre-text light"));var f=Q(document.createElement("span"));if(f.selectAll().data(c).enter().append("a").attr("class","user-link").attr("href",function(h){return t.userURL(h)}).attr("target","_blank").text(String),u.length>n){var d=Q(document.createElement("span")),m=u.length-n+1;d.append("a").attr("target","_blank").attr("href",function(){return t.changesetsURL(e.map().center(),e.map().zoom())}).text(m),a.append("span").html(T.html("contributors.truncated_list",{n:m,users:{html:f.html()},count:{html:d.html()}}))}else a.append("span").html(T.html("contributors.list",{users:{html:f.html()}}));u.length?i&&a.transition().style("opacity",1):(i=!0,a.transition().style("opacity",0))}}return function(s){t&&(a=s,o(),t.on("loaded.contributors",r),e.map().on("move.contributors",r))}}var Wm=q(()=>{"use strict";Ae();ue();Sn()});var dz={};j(dz,{uiEditMenu:()=>Q5});function Q5(e){var t=xe("toggled"),r=Q(null),n=[],i=[0,0],a=[0,0],o="",s=85,l=45,u=35,c=!1,f,d,m=4,h=210,g=10,A=[],v=function(w){var k=o.includes("touch")||o.includes("pen"),x=n.filter(function(D){return!k||!D.mouseOnly});if(!x.length)return;A=[],c=k;var S=k,I=S?32:34;S?d=52+Math.min(120,6*Math.max.apply(Math,x.map(function(D){return D.title.length}))):d=44,f=m*2+x.length*I,r=w.append("div").attr("class","edit-menu").classed("touch-menu",k).style("padding",m+"px 0");var b=r.selectAll(".edit-menu-item").data(x),y=b.enter().append("button").attr("class",function(D){return"edit-menu-item edit-menu-item-"+D.id}).style("height",I+"px").on("click",N).on("pointerup",F).on("pointerdown mousedown",function(O){O.stopPropagation()}).on("mouseenter.highlight",function(D,O){!O.relatedEntityIds||Q(this).classed("disabled")||bt(O.relatedEntityIds(),!0,e)}).on("mouseleave.highlight",function(D,O){O.relatedEntityIds&&bt(O.relatedEntityIds(),!1,e)});y.each(function(D){var O=qe().heading(()=>D.title).title(D.tooltip).keys([D.keys[0]]);A.push(O),Q(this).call(O).append("div").attr("class","icon-wrap").call(ce(D.icon&&D.icon()||"#iD-operation-"+D.id,"operation"))}),S&&y.append("span").attr("class","label").each(function(D){Q(this).call(D.title)}),y.merge(b).classed("disabled",function(D){return D.disabled()}),_();var E=e.projection.scale();e.map().on("move.edit-menu",function(){E!==e.projection.scale()&&v.close()}).on("drawn.edit-menu",function(D){D.full&&_()});var M;function F(D){M=D.pointerType}function N(D,O){D.stopPropagation(),O.relatedEntityIds&&bt(O.relatedEntityIds(),!1,e),O.disabled()?(M==="touch"||M==="pen")&&e.ui().flash.duration(4e3).iconName("#iD-operation-"+O.id).iconClass("operation disabled").label(O.tooltip())():((M==="touch"||M==="pen")&&e.ui().flash.duration(2e3).iconName("#iD-operation-"+O.id).iconClass("operation").label(O.annotation()||O.title)(),O(),v.close()),M=null}t.call("toggled",this,!0)};function _(){if(!r||r.empty())return;var w=e.projection(a),k=e.surfaceRect();if(w[0]<0||w[0]>k.width||w[1]<0||w[1]>k.height){v.close();return}var x=E(k),S=[0,0];S[0]=x?-1*(g+d):g,c?w[1]-f<s?S[1]=-w[1]+s:S[1]=-f:w[1]+f>k.height-l?S[1]=-w[1]-f+k.height-l:S[1]=0;var I=qr(w,S),b=parseFloat(Jr(Q(".top-toolbar-wrap"))[1]);I[1]-=b,r.style("left",I[0]+"px").style("top",I[1]+"px");var y=M(k,x);A.forEach(function(F){F.placement(y)});function E(F){return pe.textDirection()==="ltr"?w[0]+g+d>F.width-u:!(w[0]-g-d<u)}function M(F,N){return pe.textDirection()==="ltr"?N||w[0]+g+d+h>F.width-u?"left":"right":!N||w[0]-g-d-h<u?"right":"left"}}return v.close=function(){e.map().on("move.edit-menu",null).on("drawn.edit-menu",null),r.remove(),A=[],t.call("toggled",this,!1)},v.anchorLoc=function(w){return arguments.length?(i=w,a=e.projection.invert(i),v):i},v.triggerType=function(w){return arguments.length?(o=w,v):o},v.operations=function(w){return arguments.length?(n=w,v):n},_e(v,t,"on")}var Qm=q(()=>{"use strict";Ae();Ye();He();ue();nr();Yr();dt();$s();ot()});var pz={};j(pz,{uiFeatureInfo:()=>H5});function H5(e){function t(r){var n=e.features(),i=n.stats(),a=0,o=n.hidden().map(function(l){return i[l]?(a+=i[l],T.append("inspector.title_count",{title:T("feature."+l+".description"),count:i[l]})):null}).filter(Boolean);if(r.text(""),o.length){var s=qe().placement("top").title(function(){return l=>{o.forEach(u=>{l.append("div").call(u)})}});r.append("a").attr("class","chip").attr("href","#").call(T.append("feature_info.hidden_warning",{count:a})).call(s).on("click",function(l){s.hide(),l.preventDefault(),e.ui().togglePanes(e.container().select(".map-panes .map-data-pane"))})}r.classed("hide",!o.length)}return function(r){t(r),e.features().on("change.feature_info",function(){t(r)})}}var Hm=q(()=>{"use strict";ue();nr()});var mz={};j(mz,{uiFlash:()=>j5});function j5(e){var t,r=2e3,n="#iD-icon-no",i="disabled",a=s=>s.text("");function o(){t&&t.stop(),e.container().select(".main-footer-wrap").classed("footer-hide",!0).classed("footer-show",!1),e.container().select(".flash-wrap").classed("footer-hide",!1).classed("footer-show",!0);var s=e.container().select(".flash-wrap").selectAll(".flash-content").data([0]),l=s.enter().append("div").attr("class","flash-content"),u=l.append("svg").attr("class","flash-icon icon").append("g").attr("transform","translate(10,10)");return u.append("circle").attr("r",9),u.append("use").attr("transform","translate(-7,-7)").attr("width","14").attr("height","14"),l.append("div").attr("class","flash-text"),s=s.merge(l),s.selectAll(".flash-icon").attr("class","icon flash-icon "+(i||"")),s.selectAll(".flash-icon use").attr("xlink:href",n),s.selectAll(".flash-text").attr("class","flash-text").call(a),t=Q0(function(){t=null,e.container().select(".main-footer-wrap").classed("footer-hide",!1).classed("footer-show",!0),e.container().select(".flash-wrap").classed("footer-hide",!0).classed("footer-show",!1)},r),s}return o.duration=function(s){return arguments.length?(r=s,o):r},o.label=function(s){return arguments.length?(typeof s!="function"?a=l=>l.text(s):a=l=>l.text("").call(s),o):a},o.iconName=function(s){return arguments.length?(n=s,o):n},o.iconClass=function(s){return arguments.length?(i=s,o):i},o}var jm=q(()=>{"use strict";c2()});var hz={};j(hz,{uiFullScreen:()=>Y5});function Y5(e){var t=e.container().node();function r(){if(t.requestFullscreen)return t.requestFullscreen;if(t.msRequestFullscreen)return t.msRequestFullscreen;if(t.mozRequestFullScreen)return t.mozRequestFullScreen;if(t.webkitRequestFullscreen)return t.webkitRequestFullscreen}function n(){if(document.exitFullscreen)return document.exitFullscreen;if(document.msExitFullscreen)return document.msExitFullscreen;if(document.mozCancelFullScreen)return document.mozCancelFullScreen;if(document.webkitExitFullscreen)return document.webkitExitFullscreen}function i(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement}function a(){return!!r()}function o(s){s.preventDefault(),i()?n().apply(document):r().apply(t)}return function(){if(a()){var s=sr(),l=s.os==="mac"?[Ze("\u2303\u2318F"),"f11"]:["f11"];e.keybinding().on(l,o)}}}var Ym=q(()=>{"use strict";Nn();Li()});var gz={};j(gz,{uiGeolocate:()=>K5});function K5(e){var t={enableHighAccuracy:!1,timeout:6e3},r=l1(e).message(T.html("geolocate.locating")).blocking(!0),n=e.layers().layer("geolocate"),i,a,o,s=Q(null);function l(){e.inIntro()||(!n.enabled()&&!r.isShown()?(o=setTimeout(f,1e4),e.container().call(r),navigator.geolocation.getCurrentPosition(c,f,t)):(r.close(),n.enabled(null,!1),m()))}function u(){e.enter(Ue(e));var h=e.map();n.enabled(i,!0),m(),h.centerZoomEase(a.center(),Math.min(20,h.extentZoom(a)))}function c(h){i=h;var g=i.coords;a=Me([g.longitude,g.latitude]).padByMeters(g.accuracy),u(),d()}function f(){i?u():e.ui().flash.label(T.append("geolocate.location_unavailable")).iconName("#iD-icon-geolocate")(),d()}function d(){r.close(),o&&clearTimeout(o),o=void 0}function m(){s.classed("active",n.enabled()),s.attr("aria-pressed",n.enabled())}return function(h){!navigator.geolocation||!navigator.geolocation.getCurrentPosition||(s=h.append("button").on("click",l).attr("aria-pressed",!1).call(ce("#iD-icon-geolocate","light")).call(qe().placement(pe.textDirection()==="rtl"?"right":"left").title(()=>T.append("geolocate.title"))))}}var Km=q(()=>{"use strict";Ae();ue();nr();He();Kt();ot();o5()});var yz={};j(yz,{uiPanelBackground:()=>p8});import vz from"lodash-es/debounce.js";function p8(e){var t=e.background(),r=null,n={},i=["zoom","vintage","source","description","resolution","accuracy"],a=vz(o,250);function o(c){var f=t.baseLayerSource();if(f){var d=f.id.match(/^DigitalGlobe/i)!==null,m=f.label();r!==m&&(r=m,n={}),c.text("");var h=c.append("ul").attr("class","background-info");h.append("li").call(r),i.forEach(function(k){d&&k==="vintage"||h.append("li").attr("class","background-info-list-"+k).classed("hide",!n[k]).call(T.append("info_panels.background."+k,{suffix:":"})).append("span").attr("class","background-info-span-"+k).text(n[k])}),s(c);var g=e.getDebug("tile")?"hide_tiles":"show_tiles";if(c.append("a").call(T.append("info_panels.background."+g)).attr("href","#").attr("class","button button-toggle-tiles").on("click",function(k){k.preventDefault(),e.setDebug("tile",!e.getDebug("tile")),c.call(o)}),d){var A=f.id+"-vintage",v=e.background().findSource(A),_=e.background().showsLayer(v),w=_?"hide_vintage":"show_vintage";c.append("a").call(T.append("info_panels.background."+w)).attr("href","#").attr("class","button button-toggle-vintage").on("click",function(k){k.preventDefault(),e.background().toggleOverlayLayer(v),c.call(o)})}["DigitalGlobe-Premium","DigitalGlobe-Standard"].forEach(function(k){if(f.id!==k){var x=k+"-vintage",S=e.background().findSource(x);e.background().showsLayer(S)&&e.background().toggleOverlayLayer(S)}})}}var s=vz(l,250);function l(c){var f=e.container().select(".layer-background img.tile-center");if(!f.empty()){var d=r,m=f.datum(),h=m&&m.length>=3&&m[2]||Math.floor(e.map().zoom()),g=e.map().center();n.zoom=String(h),c.selectAll(".background-info-list-zoom").classed("hide",!1).selectAll(".background-info-span-zoom").text(n.zoom),!(!m||!m.length>=3)&&t.baseLayerSource().getMetadata(g,m,function(A,v){if(!(A||r!==d)){var _=v.vintage;n.vintage=_&&_.range||T("info_panels.background.unknown"),c.selectAll(".background-info-list-vintage").classed("hide",!1).selectAll(".background-info-span-vintage").text(n.vintage),i.forEach(function(w){if(!(w==="zoom"||w==="vintage")){var k=v[w];n[w]=k,c.selectAll(".background-info-list-"+w).classed("hide",!k).selectAll(".background-info-span-"+w).text(k)}})}})}}var u=function(c){c.call(o),e.map().on("drawn.info-background",function(){c.call(a)}).on("move.info-background",function(){c.call(s)})};return u.off=function(){e.map().on("drawn.info-background",null).on("move.info-background",null)},u.id="background",u.label=T.append("info_panels.background.title"),u.key=T("info_panels.background.key"),u}var Xm=q(()=>{"use strict";ue()});var bz={};j(bz,{uiPanelHistory:()=>m8});function m8(e){var t;function r(u){if(!u)return T("info_panels.history.unknown");var c={day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric"},f=new Date(u);return isNaN(f.getTime())?T("info_panels.history.unknown"):f.toLocaleString(pe.localeCode(),c)}function n(u,c){if(!c){u.append("span").call(T.append("info_panels.history.unknown"));return}u.append("span").attr("class","user-name").text(c);var f=u.append("div").attr("class","links");t&&f.append("a").attr("class","user-osm-link").attr("href",t.userURL(c)).attr("target","_blank").call(T.append("info_panels.history.profile_link")),f.append("a").attr("class","user-hdyc-link").attr("href","https://hdyc.neis-one.org/?"+c).attr("target","_blank").attr("tabindex",-1).text("HDYC")}function i(u,c){if(!c){u.append("span").call(T.append("info_panels.history.unknown"));return}u.append("span").attr("class","changeset-id").text(c);var f=u.append("div").attr("class","links");t&&f.append("a").attr("class","changeset-osm-link").attr("href",t.changesetURL(c)).attr("target","_blank").call(T.append("info_panels.history.changeset_link")),f.append("a").attr("class","changeset-osmcha-link").attr("href","https://osmcha.org/changesets/"+c).attr("target","_blank").text("OSMCha"),f.append("a").attr("class","changeset-achavi-link").attr("href","https://overpass-api.de/achavi/?changeset="+c).attr("target","_blank").text("Achavi")}function a(u){var c=e.selectedNoteID();t=e.connection();var f,d,m;c&&t?(f=[T.html("note.note")+" "+c],d=t.getNote(c)):(f=e.selectedIDs().filter(function(g){return e.hasEntity(g)}),f.length&&(m=e.entity(f[0])));var h=f.length===1?f[0]:null;u.html(""),h?u.append("h4").attr("class","history-heading").html(h):u.append("h4").attr("class","history-heading").call(T.append("info_panels.selected",{n:f.length})),h&&(m?u.call(s,m):d&&u.call(o,d))}function o(u,c){if(!c||c.isNew()){u.append("div").call(T.append("info_panels.history.note_no_history"));return}var f=u.append("ul");f.append("li").call(T.append("info_panels.history.note_comments",{suffix:":"})).append("span").text(c.comments.length),c.comments.length&&(f.append("li").call(T.append("info_panels.history.note_created_date",{suffix:":"})).append("span").text(r(c.comments[0].date)),f.append("li").call(T.append("info_panels.history.note_created_user",{suffix:":"})).call(n,c.comments[0].user)),t&&u.append("a").attr("class","view-history-on-osm").attr("target","_blank").attr("href",t.noteURL(c)).call(ce("#iD-icon-out-link","inline")).append("span").call(T.append("info_panels.history.note_link_text"))}function s(u,c){if(!c||c.isNew()){u.append("div").call(T.append("info_panels.history.no_history"));return}var f=u.append("div").attr("class","links");t&&f.append("a").attr("class","view-history-on-osm").attr("href",t.historyURL(c)).attr("target","_blank").call(T.append("info_panels.history.history_link")),f.append("a").attr("class","pewu-history-viewer-link").attr("href","https://pewu.github.io/osm-history/#/"+c.type+"/"+c.osmId()).attr("target","_blank").attr("tabindex",-1).text("PeWu");var d=u.append("ul");d.append("li").call(T.append("info_panels.history.version",{suffix:":"})).append("span").text(c.version),d.append("li").call(T.append("info_panels.history.last_edit",{suffix:":"})).append("span").text(r(c.timestamp)),d.append("li").call(T.append("info_panels.history.edited_by",{suffix:":"})).call(n,c.user),d.append("li").call(T.append("info_panels.history.changeset",{suffix:":"})).call(i,c.changeset)}var l=function(u){u.call(a),e.map().on("drawn.info-history",function(){u.call(a)}),e.on("enter.info-history",function(){u.call(a)})};return l.off=function(){e.map().on("drawn.info-history",null),e.on("enter.info-history",null)},l.id="history",l.label=T.append("info_panels.history.title"),l.key=T("info_panels.history.key"),l}var Zm=q(()=>{"use strict";ue();Sn()});var wz={};j(wz,{uiPanelLocation:()=>h8});import joe from"lodash-es/debounce.js";function h8(e){var t="";function r(o){o.html("");var s=o.append("ul"),l=e.map().mouseCoordinates();l.some(isNaN)&&(l=e.map().center()),s.append("li").text(Da(l)).append("li").text(y2(l)),o.append("div").attr("class","location-info").text(t||" "),n(o,l)}var n=joe(i,250);function i(o,s){de.geocoder?de.geocoder.reverse(s,function(l,u){t=u?u.display_name:T("info_panels.location.unknown_location"),o.selectAll(".location-info").text(t)}):(t=T("info_panels.location.unknown_location"),o.selectAll(".location-info").text(t))}var a=function(o){o.call(r),e.surface().on(("PointerEvent"in window?"pointer":"mouse")+"move.info-location",function(){o.call(r)})};return a.off=function(){e.surface().on(".info-location",null)},a.id="location",a.label=T.append("info_panels.location.title"),a.key=T("info_panels.location.key"),a}var Jm=q(()=>{"use strict";L4();ue();pt()});var xz={};j(xz,{uiPanelMeasurement:()=>g8});function g8(e){function t(s){return s*63710071809e-4}function r(s){return s/(4*Math.PI)*510065621724e3}function n(s){if(s.type==="LineString")return s;var l={type:"LineString",coordinates:[]};return s.type==="Polygon"?l.coordinates=s.coordinates[0]:s.type==="MultiPolygon"&&(l.coordinates=s.coordinates[0][0]),l}var i=!pe.usesMetric();function a(s){var l=e.graph(),u=e.selectedNoteID(),c=de.osm,f=pe.localeCode(),d,m,h,g,A,v,_,w=0,k=0,x;if(u&&c){var S=c.getNote(u);d=T.html("note.note")+" "+u,h=S.loc,v="note"}else{var I=e.selectedIDs().filter(function(L){return e.hasEntity(L)}),b=I.map(function(L){return e.entity(L)});if(d=b.length===1?b[0].id:T.html("info_panels.selected",{n:b.length}),b.length){var y=Me();for(var E in b){var M=b[E];if(y._extend(M.extent(l)),v=M.geometry(l),v==="line"||v==="area"){A=M.type==="relation"||M.isClosed()&&!M.isDegenerate();var F=M.asGeoJSON(l);w+=t(Vy(n(F))),g=Pi(e.projection).centroid(M.asGeoJSON(l)),g=g&&e.projection.invert(g),(!g||!isFinite(g[0])||!isFinite(g[1]))&&(g=M.extent(l).center()),A&&(k+=r(M.area(l)))}}b.length>1&&(v=null,A=null,g=null),b.length===2&&b[0].type==="node"&&b[1].type==="node"&&(x=wt(b[0].loc,b[1].loc)),b.length===1&&b[0].type==="node"?h=b[0].loc:_=ar(I,e.graph()).length,!h&&!g&&(m=y.center())}}s.html(""),d&&s.append("h4").attr("class","measurement-heading").html(d);var N=s.append("ul"),D;if(v&&N.append("li").call(T.append("info_panels.measurement.geometry",{suffix:":"})).append("span").html(A?T.html("info_panels.measurement.closed_"+v):T.html("geometry."+v)),_&&N.append("li").call(T.append("info_panels.measurement.node_count",{suffix:":"})).append("span").text(_.toLocaleString(f)),k&&N.append("li").call(T.append("info_panels.measurement.area",{suffix:":"})).append("span").text(sw(k,i)),w&&N.append("li").call(T.append("info_panels.measurement."+(A?"perimeter":"length"),{suffix:":"})).append("span").text(a3(w,i)),typeof x=="number"&&N.append("li").call(T.append("info_panels.measurement.distance",{suffix:":"})).append("span").text(a3(x,i)),h&&(D=N.append("li").call(T.append("info_panels.measurement.location",{suffix:":"})),D.append("span").text(Da(h)),D.append("span").text(y2(h))),g&&(D=N.append("li").call(T.append("info_panels.measurement.centroid",{suffix:":"})),D.append("span").text(Da(g)),D.append("span").text(y2(g))),m&&(D=N.append("li").call(T.append("info_panels.measurement.center",{suffix:":"})),D.append("span").text(Da(m)),D.append("span").text(y2(m))),w||k||typeof x=="number"){var O=i?"imperial":"metric";s.append("a").call(T.append("info_panels.measurement."+O)).attr("href","#").attr("class","button button-toggle-units").on("click",function(L){L.preventDefault(),i=!i,s.call(a)})}}var o=function(s){s.call(a),e.map().on("drawn.info-measurement",function(){s.call(a)}),e.on("enter.info-measurement",function(){s.call(a)})};return o.off=function(){e.map().on("drawn.info-measurement",null),e.on("enter.info-measurement",null)},o.id="measurement",o.label=T.append("info_panels.measurement.title"),o.key=T("info_panels.measurement.key"),o}var eh=q(()=>{"use strict";Ta();ue();L4();He();pt();Ie()});var _z={};j(_z,{uiInfoPanels:()=>v8,uiPanelBackground:()=>p8,uiPanelHistory:()=>m8,uiPanelLocation:()=>h8,uiPanelMeasurement:()=>g8});var v8,th=q(()=>{"use strict";Xm();Zm();Jm();eh();Xm();Zm();Jm();eh();v8={background:p8,history:m8,location:h8,measurement:g8}});var kz={};j(kz,{uiInfo:()=>X5});function X5(e){var t=Object.keys(v8),r=["measurement"],n={},i={};t.forEach(function(o){n[o]||(n[o]=v8[o](e),i[o]=!1)});function a(o){function s(){var u=t.filter(function(m){return i[m]}).sort(),c=l.selectAll(".panel-container").data(u,function(m){return m});c.exit().style("opacity",1).transition().duration(200).style("opacity",0).on("end",function(m){Q(this).call(n[m].off).remove()});var f=c.enter().append("div").attr("class",function(m){return"fillD2 panel-container panel-container-"+m});f.style("opacity",0).transition().duration(200).style("opacity",1);var d=f.append("div").attr("class","panel-title fillD2");d.append("h3").each(function(m){return n[m].label(Q(this))}),d.append("button").attr("class","close").attr("title",T("icons.close")).on("click",function(m,h){m.stopImmediatePropagation(),m.preventDefault(),a.toggle(h)}).call(ce("#iD-icon-close")),f.append("div").attr("class",function(m){return"panel-content panel-content-"+m}),l.selectAll(".panel-content").each(function(m){Q(this).call(n[m])})}a.toggle=function(u){var c=t.filter(function(f){return i[f]});u?(i[u]=!i[u],c.length===1&&c[0]===u&&(r=[u]),e.container().select("."+u+"-panel-toggle-item").classed("active",i[u]).select("input").property("checked",i[u])):c.length?(r=c,c.forEach(function(f){i[f]=!1})):r.forEach(function(f){i[f]=!0}),s()};var l=o.selectAll(".info-panels").data([0]);l=l.enter().append("div").attr("class","info-panels").merge(l),s(),e.keybinding().on(Ze("\u2318"+T("info_panels.key")),function(u){u.shiftKey||(u.stopImmediatePropagation(),u.preventDefault(),a.toggle())}),t.forEach(function(u){var c=T("info_panels."+u+".key",{default:null});c&&e.keybinding().on(Ze("\u2318\u21E7"+c),function(f){f.stopImmediatePropagation(),f.preventDefault(),a.toggle(u)})})}return a}var rh=q(()=>{"use strict";Ae();ue();ot();Nn();th()});var Ez={};j(Ez,{uiToggle:()=>To});function To(e,t){return function(r){r.style("opacity",e?0:1).classed("hide",!1).transition().style("opacity",e?1:0).on("end",function(){Q(this).classed("hide",!e).style("opacity",null),t&&t.apply(this)})}}var Z5=q(()=>{"use strict";Ae()});var Az={};j(Az,{uiCurtain:()=>J5});function J5(e){var t=Q(null),r=Q(null),n=Q(null);function i(o){t=o.append("svg").attr("class","curtain").style("top",0).style("left",0),n=t.append("path").attr("x",0).attr("y",0).attr("class","curtain-darkness"),Q(window).on("resize.curtain",s),r=o.append("div").attr("class","tooltip"),r.append("div").attr("class","popover-arrow"),r.append("div").attr("class","popover-inner"),s();function s(){t.attr("width",e.clientWidth).attr("height",e.clientHeight),i.cut(n.datum())}}i.reveal=function(o,s,l){if(l=l||{},typeof o=="string"&&(o=Q(o).node()),o&&o.getBoundingClientRect&&(o=a(o.getBoundingClientRect())),o){var u=e.getBoundingClientRect();o.top-=u.top,o.left-=u.left}o&&l.padding&&(o.top-=l.padding,o.left-=l.padding,o.bottom+=l.padding,o.right+=l.padding,o.height+=l.padding*2,o.width+=l.padding*2);var c;if(l.tooltipBox?(c=l.tooltipBox,typeof c=="string"&&(c=Q(c).node()),c&&c.getBoundingClientRect&&(c=a(c.getBoundingClientRect()))):c=o,c&&s){s.indexOf("**")!==-1&&(s.indexOf("<span")===0?s=s.replace(/^(<span.*?>)(.+?)(\*\*)/,"$1<span>$2</span>$3"):s=s.replace(/^(.+?)(\*\*)/,"<span>$1</span>$2"),s=s.replace(/\*\*(.*?)\*\*/g,'<span class="instruction">$1</span>')),s=s.replace(/\*(.*?)\*/g,"<em>$1</em>"),s=s.replace(/\{br\}/g,"<br/><br/>"),l.buttonText&&l.buttonCallback&&(s+='<div class="button-section"><button href="#" class="button action">'+l.buttonText+"</button></div>");var f="curtain-tooltip popover tooltip arrowed in "+(l.tooltipClass||"");if(r.classed(f,!0).selectAll(".popover-inner").html(s),l.buttonText&&l.buttonCallback){var d=r.selectAll(".button-section .button.action");d.on("click",function(I){I.preventDefault(),l.buttonCallback()})}var m=a(r.node().getBoundingClientRect()),h=e.clientWidth,g=e.clientHeight,A=200,v=5,_,w;l.tooltipClass==="intro-mouse"&&(m.height+=80),c.top+c.height>g&&(c.height-=c.top+c.height-g),c.left+c.width>h&&(c.width-=c.left+c.width-h);let S=c.left+c.width/2>h-100||c.left+c.width/2<100;if(c.top+c.height<100&&!S)_="bottom",w=[c.left+c.width/2-m.width/2,c.top+c.height];else if(c.top>g-140&&!S)_="top",w=[c.left+c.width/2-m.width/2,c.top-m.height];else{var k=c.top+c.height/2-m.height/2;pe.textDirection()==="rtl"?c.left-A-v<70?(_="right",w=[c.left+c.width+v,k]):(_="left",w=[c.left-A-v,k]):c.left+c.width+v+A>h-70?(_="left",w=[c.left-A-v,k]):(_="right",w=[c.left+c.width+v,k])}(l.duration!==0||!r.classed(_))&&r.call(To(!0)),r.style("top",w[1]+"px").style("left",w[0]+"px").attr("class",f+" "+_);var x=0;(_==="left"||_==="right")&&(w[1]<60?x=60-w[1]:w[1]+m.height>g-100&&(x=g-w[1]-m.height-100)),r.selectAll(".popover-inner").style("top",x+"px")}else r.classed("in",!1).call(To(!1));return i.cut(o,l.duration),r},i.cut=function(o,s){n.datum(o).interrupt();var l;s===0?l=n:l=n.transition().duration(s||600).ease(L7),l.attr("d",function(u){var c=e.clientWidth,f=e.clientHeight,d="M 0,0 L 0,"+f+" L "+c+","+f+"L"+c+",0 Z";return u?d+"M"+u.left+","+u.top+"L"+u.left+","+(u.top+u.height)+"L"+(u.left+u.width)+","+(u.top+u.height)+"L"+(u.left+u.width)+","+u.top+"Z":d})},i.remove=function(){t.remove(),r.remove(),Q(window).on("resize.curtain",null)};function a(o){return{top:o.top,right:o.right,bottom:o.bottom,left:o.left,width:o.width,height:o.height}}return i}var nh=q(()=>{"use strict";U7();Ae();ue();Z5()});var Sz={};j(Sz,{uiIntroWelcome:()=>J_});function J_(e,t){var r=xe("done"),n={title:"intro.welcome.title"};function i(){e.map().centerZoom([-85.63591,41.94285],19),t(".intro-nav-wrap .chapter-welcome",ge("intro.welcome.welcome"),{buttonText:T.html("intro.ok"),buttonCallback:a})}function a(){t(".intro-nav-wrap .chapter-welcome",ge("intro.welcome.practice"),{buttonText:T.html("intro.ok"),buttonCallback:o})}function o(){t(".intro-nav-wrap .chapter-welcome",ge("intro.welcome.words"),{buttonText:T.html("intro.ok"),buttonCallback:s})}function s(){r.call("done"),t(".intro-nav-wrap .chapter-navigation",ge("intro.welcome.chapters",{next:T("intro.navigation.title")}))}return n.enter=function(){i()},n.exit=function(){e.container().select(".curtain-tooltip.intro-mouse").selectAll(".counter").remove()},n.restart=function(){n.exit(),n.enter()},_e(n,r,"on")}var ek=q(()=>{"use strict";Ye();So();ue();Yr()});var Cz={};j(Cz,{uiIntroNavigation:()=>tk});function tk(e,t){var r=xe("done"),n=[],i="n2061",a=[-85.63591,41.94285],o="w397",s="n1834",l=[-85.63582,41.94255],u=Pe.field("oneway"),c=Pe.field("maxspeed"),f={title:"intro.navigation.title"};function d(O,L){n.push(window.setTimeout(O,L))}function m(O){O.stopPropagation(),O.preventDefault()}function h(){var O=e.selectedIDs();return O.length===1&&O[0]===i}function g(){e.enter(Ue(e)),e.history().reset("initial");var O=_i(a,e.map().center());O&&t(null,null,{duration:0}),e.map().centerZoomEase(a,19,O),d(function(){var P=e.map().center(),U=e.lastPointerType()==="mouse"?"drag":"drag_touch",B=ge("intro.navigation.map_info")+"{br}"+ge("intro.navigation."+U);t(".main-map .surface",B),e.map().on("drawn.intro",function(){t(".main-map .surface",B,{duration:0})}),e.map().on("move.intro",function(){var z=e.map().center();(P[0]!==z[0]||P[1]!==z[1])&&(e.map().on("move.intro",null),d(function(){L(A)},3e3))})},O+100);function L(P){e.map().on("move.intro drawn.intro",null),P()}}function A(){var O=e.map().zoom(),L=e.lastPointerType()==="mouse"?"zoom":"zoom_touch",P=ge("intro.navigation."+L);t(".main-map .surface",P),e.map().on("drawn.intro",function(){t(".main-map .surface",P,{duration:0})}),e.map().on("move.intro",function(){e.map().zoom()!==O&&(e.map().on("move.intro",null),d(function(){U(v)},3e3))});function U(B){e.map().on("move.intro drawn.intro",null),B()}}function v(){var O=function(){L(_)};t(".main-map .surface",ge("intro.navigation.features"),{buttonText:T.html("intro.ok"),buttonCallback:O}),e.map().on("drawn.intro",function(){t(".main-map .surface",ge("intro.navigation.features"),{duration:0,buttonText:T.html("intro.ok"),buttonCallback:O})});function L(P){e.map().on("drawn.intro",null),P()}}function _(){var O=function(){L(w)};t(".main-map .surface",ge("intro.navigation.points_lines_areas"),{buttonText:T.html("intro.ok"),buttonCallback:O}),e.map().on("drawn.intro",function(){t(".main-map .surface",ge("intro.navigation.points_lines_areas"),{duration:0,buttonText:T.html("intro.ok"),buttonCallback:O})});function L(P){e.map().on("drawn.intro",null),P()}}function w(){var O=function(){L(k)};t(".main-map .surface",ge("intro.navigation.nodes_ways"),{buttonText:T.html("intro.ok"),buttonCallback:O}),e.map().on("drawn.intro",function(){t(".main-map .surface",ge("intro.navigation.nodes_ways"),{duration:0,buttonText:T.html("intro.ok"),buttonCallback:O})});function L(P){e.map().on("drawn.intro",null),P()}}function k(){e.enter(Ue(e)),e.history().reset("initial");var O=e.hasEntity(i);if(!O)return;t(null,null,{duration:0}),e.map().centerZoomEase(O.loc,19,500),d(function(){var P=e.hasEntity(i);if(P){var U=Oa(P.loc,e),B=e.lastPointerType()==="mouse"?"click_townhall":"tap_townhall";t(U,ge("intro.navigation."+B)),e.map().on("move.intro drawn.intro",function(){var z=e.hasEntity(i);if(z){var V=Oa(z.loc,e);t(V,ge("intro.navigation."+B),{duration:0})}}),e.on("enter.intro",function(){h()&&L(x)})}},550),e.history().on("change.intro",function(){e.hasEntity(i)||L(k)});function L(P){e.on("enter.intro",null),e.map().on("move.intro drawn.intro",null),e.history().on("change.intro",null),P()}}function x(){if(!h())return k();var O=e.hasEntity(i);if(!O)return k();var L=Oa(O.loc,e),P=function(){U(S)};t(L,ge("intro.navigation.selected_townhall"),{buttonText:T.html("intro.ok"),buttonCallback:P}),e.map().on("move.intro drawn.intro",function(){var B=e.hasEntity(i);if(B){var z=Oa(B.loc,e);t(z,ge("intro.navigation.selected_townhall"),{duration:0,buttonText:T.html("intro.ok"),buttonCallback:P})}}),e.history().on("change.intro",function(){e.hasEntity(i)||U(k)});function U(B){e.map().on("move.intro drawn.intro",null),e.history().on("change.intro",null),B()}}function S(){if(!h())return k();e.container().select(".inspector-wrap").on("wheel.intro",m);var O=function(){L(I)};t(".entity-editor-pane",ge("intro.navigation.editor_townhall"),{buttonText:T.html("intro.ok"),buttonCallback:O}),e.on("exit.intro",function(){L(k)}),e.history().on("change.intro",function(){e.hasEntity(i)||L(k)});function L(P){e.on("exit.intro",null),e.history().on("change.intro",null),e.container().select(".inspector-wrap").on("wheel.intro",null),P()}}function I(){if(!h())return k();e.container().select(".inspector-wrap .panewrap").style("right","0%"),e.container().select(".inspector-wrap").on("wheel.intro",m);var O=e.entity(e.selectedIDs()[0]),L=Pe.match(O,e.graph()),P=function(){U(b)};t(".entity-editor-pane .section-feature-type",ge("intro.navigation.preset_townhall",{preset:L.name()}),{buttonText:T.html("intro.ok"),buttonCallback:P}),e.on("exit.intro",function(){U(k)}),e.history().on("change.intro",function(){e.hasEntity(i)||U(k)});function U(B){e.on("exit.intro",null),e.history().on("change.intro",null),e.container().select(".inspector-wrap").on("wheel.intro",null),B()}}function b(){if(!h())return k();e.container().select(".inspector-wrap .panewrap").style("right","0%"),e.container().select(".inspector-wrap").on("wheel.intro",m);var O=function(){L(y)};t(".entity-editor-pane .section-preset-fields",ge("intro.navigation.fields_townhall"),{buttonText:T.html("intro.ok"),buttonCallback:O}),e.on("exit.intro",function(){L(k)}),e.history().on("change.intro",function(){e.hasEntity(i)||L(k)});function L(P){e.on("exit.intro",null),e.history().on("change.intro",null),e.container().select(".inspector-wrap").on("wheel.intro",null),P()}}function y(){if(!h())return k();var O=".entity-editor-pane button.close svg use",L=Q(O).attr("href")||"#iD-icon-close";t(".entity-editor-pane",ge("intro.navigation.close_townhall",{button:{html:tt(L,"inline")}})),e.on("exit.intro",function(){P(E)}),e.history().on("change.intro",function(){var U=".entity-editor-pane button.close svg use",B=Q(U).attr("href")||"#iD-icon-close";t(".entity-editor-pane",ge("intro.navigation.close_townhall",{button:{html:tt(B,"inline")}}),{duration:0})});function P(U){e.on("exit.intro",null),e.history().on("change.intro",null),U()}}function E(){e.enter(Ue(e)),e.history().reset("initial");var O=_i(l,e.map().center());O&&t(null,null,{duration:0}),e.map().centerZoomEase(l,19,O),d(function(){t(".search-header input",ge("intro.navigation.search_street",{name:T("intro.graph.name.spring-street")})),e.container().select(".search-header input").on("keyup.intro",M)},O+100)}function M(){var O=e.container().select(".feature-list-item:nth-child(0n+2)"),L=O.select(".entity-name"),P=T("intro.graph.name.spring-street");!L.empty()&&L.html()===P&&(t(O.node(),ge("intro.navigation.choose_street",{name:P}),{duration:300}),e.on("exit.intro",function(){U(F)}),e.container().select(".search-header input").on("keydown.intro",m,!0).on("keyup.intro",null));function U(B){e.on("exit.intro",null),e.container().select(".search-header input").on("keydown.intro",null).on("keyup.intro",null),B()}}function F(){if(!e.hasEntity(s)||!e.hasEntity(o))return E();var O=function(){U(N)},L=e.entity(s),P=Oa(L.loc,e);P.height=500,t(P,ge("intro.navigation.selected_street",{name:T("intro.graph.name.spring-street")}),{duration:600,buttonText:T.html("intro.ok"),buttonCallback:O}),d(function(){e.map().on("move.intro drawn.intro",function(){var B=e.hasEntity(s);if(B){var z=Oa(B.loc,e);z.height=500,t(z,ge("intro.navigation.selected_street",{name:T("intro.graph.name.spring-street")}),{duration:0,buttonText:T.html("intro.ok"),buttonCallback:O})}})},600),e.on("enter.intro",function(B){if(!e.hasEntity(o))return U(E);var z=e.selectedIDs();(B.id!=="select"||!z.length||z[0]!==o)&&e.enter(je(e,[o]))}),e.history().on("change.intro",function(){(!e.hasEntity(s)||!e.hasEntity(o))&&d(function(){U(E)},300)});function U(B){e.map().on("move.intro drawn.intro",null),e.on("enter.intro",null),e.history().on("change.intro",null),B()}}function N(){var O=".entity-editor-pane button.close svg use",L=Q(O).attr("href")||"#iD-icon-close";t(".entity-editor-pane",ge("intro.navigation.street_different_fields")+"{br}"+ge("intro.navigation.editor_street",{button:{html:tt(L,"inline")},field1:u.title(),field2:c.title()})),e.on("exit.intro",function(){P(D)}),e.history().on("change.intro",function(){var U=".entity-editor-pane button.close svg use",B=Q(U).attr("href")||"#iD-icon-close";t(".entity-editor-pane",ge("intro.navigation.street_different_fields")+"{br}"+ge("intro.navigation.editor_street",{button:{html:tt(B,"inline")},field1:u.title(),field2:c.title()}),{duration:0})});function P(U){e.on("exit.intro",null),e.history().on("change.intro",null),U()}}function D(){r.call("done"),t(".ideditor",ge("intro.navigation.play",{next:T("intro.points.title")}),{tooltipBox:".intro-nav-wrap .chapter-point",buttonText:T.html("intro.ok"),buttonCallback:function(){t(".ideditor")}})}return f.enter=function(){g()},f.exit=function(){n.forEach(window.clearTimeout),e.on("enter.intro exit.intro",null),e.map().on("move.intro drawn.intro",null),e.history().on("change.intro",null),e.container().select(".inspector-wrap").on("wheel.intro",null),e.container().select(".search-header input").on("keydown.intro keyup.intro",null)},f.restart=function(){f.exit(),f.enter()},_e(f,r,"on")}var rk=q(()=>{"use strict";Ye();Ae();At();ue();Kt();Er();Yr();So()});var Iz={};j(Iz,{uiIntroPoint:()=>nk});function nk(e,t){var r=xe("done"),n=[],i=[-85.63279,41.94394],a=[-85.632422,41.944045],o=Pe.item("amenity/cafe"),s=null,l={title:"intro.points.title"};function u(b,y){n.push(window.setTimeout(b,y))}function c(b){b.stopPropagation(),b.preventDefault()}function f(){e.enter(Ue(e)),e.history().reset("initial");var b=_i(i,e.map().center());b&&t(null,null,{duration:0}),e.map().centerZoomEase(i,19,b),u(function(){var E=t("button.add-point",ge("intro.points.points_info")+"{br}"+ge("intro.points.add_point"));s=null,E.selectAll(".popover-inner").insert("svg","span").attr("class","tooltip-illustration").append("use").attr("xlink:href","#iD-graphic-points"),e.on("enter.intro",function(M){M.id==="add-point"&&y(d)})},b+100);function y(E){e.on("enter.intro",null),E()}}function d(){if(e.mode().id!=="add-point")return l.restart();var b=Dt(a,150,e),y=e.lastPointerType()==="mouse"?"place_point":"place_point_touch";t(b,ge("intro.points."+y)),e.map().on("move.intro drawn.intro",function(){b=Dt(a,150,e),t(b,ge("intro.points."+y),{duration:0})}),e.on("enter.intro",function(M){if(M.id!=="select")return l.restart();s=e.mode().selectedIDs()[0],e.graph().geometry(s)==="vertex"?(e.map().on("move.intro drawn.intro",null),e.on("enter.intro",null),t(b,ge("intro.points.place_point_error"),{buttonText:T.html("intro.ok"),buttonCallback:function(){return l.restart()}})):E(m)});function E(M){e.map().on("move.intro drawn.intro",null),e.on("enter.intro",null),M()}}function m(){if(e.mode().id!=="select"||!s||!e.hasEntity(s))return f();e.container().select(".inspector-wrap").on("wheel.intro",c),e.container().select(".preset-search-input").on("keydown.intro",null).on("keyup.intro",b),t(".preset-search-input",ge("intro.points.search_cafe",{preset:o.name()})),e.on("enter.intro",function(E){if(!s||!e.hasEntity(s))return y(f);var M=e.selectedIDs();(E.id!=="select"||!M.length||M[0]!==s)&&(e.enter(je(e,[s])),e.container().select(".inspector-wrap").on("wheel.intro",c),e.container().select(".preset-search-input").on("keydown.intro",null).on("keyup.intro",b),t(".preset-search-input",ge("intro.points.search_cafe",{preset:o.name()})),e.history().on("change.intro",null))});function b(){var E=e.container().select(".preset-list-item:first-child");E.classed("preset-amenity-cafe")&&(e.container().select(".preset-search-input").on("keydown.intro",c,!0).on("keyup.intro",null),t(E.select(".preset-list-button").node(),ge("intro.points.choose_cafe",{preset:o.name()}),{duration:300}),e.history().on("change.intro",function(){y(h)}))}function y(E){e.on("enter.intro",null),e.history().on("change.intro",null),e.container().select(".inspector-wrap").on("wheel.intro",null),e.container().select(".preset-search-input").on("keydown.intro keyup.intro",null),E()}}function h(){if(e.mode().id!=="select"||!s||!e.hasEntity(s))return f();u(function(){t(".entity-editor-pane",ge("intro.points.feature_editor"),{tooltipClass:"intro-points-describe",buttonText:T.html("intro.ok"),buttonCallback:function(){b(g)}})},400),e.on("exit.intro",function(){b(v)});function b(y){e.on("exit.intro",null),y()}}function g(){if(e.mode().id!=="select"||!s||!e.hasEntity(s))return f();e.container().select(".inspector-wrap .panewrap").style("right","0%");var b=ge("intro.points.fields_info")+"{br}"+ge("intro.points.add_name")+"{br}"+ge("intro.points.add_reminder");u(function(){var E=e.entity(s);if(E.tags.name){var M=t(".entity-editor-pane",b,{tooltipClass:"intro-points-describe",buttonText:T.html("intro.ok"),buttonCallback:function(){y(A)}});M.select(".instruction").style("display","none")}else t(".entity-editor-pane",b,{tooltipClass:"intro-points-describe"})},400),e.history().on("change.intro",function(){y(A)}),e.on("exit.intro",function(){y(v)});function y(E){e.on("exit.intro",null),e.history().on("change.intro",null),E()}}function A(){e.container().select(".inspector-wrap .panewrap").style("right","0%");var b=".entity-editor-pane button.close svg use",y=Q(b).attr("href")||"#iD-icon-close";e.on("exit.intro",function(){E(v)}),t(".entity-editor-pane",ge("intro.points.add_close",{button:{html:tt(y,"inline")}}));function E(M){e.on("exit.intro",null),M()}}function v(){if(!s)return l.restart();var b=e.hasEntity(s);if(!b)return l.restart();var y=Pe.match(b,e.graph());e.replace(R1(s,y,o)),e.enter(Ue(e));var E=_i(b.loc,e.map().center());E&&t(null,null,{duration:0}),e.map().centerEase(b.loc,E),u(function(){var F=Oa(b.loc,e);t(F,ge("intro.points.reselect"),{duration:600}),u(function(){e.map().on("move.intro drawn.intro",function(){var N=e.hasEntity(s);if(!N)return l.restart();var D=Oa(N.loc,e);t(D,ge("intro.points.reselect"),{duration:0})})},600),e.on("enter.intro",function(N){N.id==="select"&&M(_)})},E+100);function M(F){e.map().on("move.intro drawn.intro",null),e.on("enter.intro",null),F()}}function _(){if(e.mode().id!=="select"||!s||!e.hasEntity(s))return b(v);e.container().select(".inspector-wrap .panewrap").style("right","0%"),e.on("exit.intro",function(){b(v)}),e.history().on("change.intro",function(){b(w)}),u(function(){t(".entity-editor-pane",ge("intro.points.update"),{tooltipClass:"intro-points-describe"})},400);function b(y){e.on("exit.intro",null),e.history().on("change.intro",null),y()}}function w(){if(e.mode().id!=="select"||!s||!e.hasEntity(s))return b(v);e.container().select(".inspector-wrap .panewrap").style("right","0%"),e.on("exit.intro",function(){b(k)}),u(function(){t(".entity-editor-pane",ge("intro.points.update_close",{button:{html:tt("#iD-icon-close","inline")}}))},500);function b(y){e.on("exit.intro",null),y()}}function k(){if(!s)return l.restart();var b=e.hasEntity(s);if(!b)return l.restart();e.enter(Ue(e));var y=Oa(b.loc,e),E=e.lastPointerType()==="mouse"?"rightclick":"edit_menu_touch";t(y,ge("intro.points."+E),{duration:600}),u(function(){e.map().on("move.intro",function(){var F=e.hasEntity(s);if(!F)return l.restart();var N=Oa(F.loc,e);t(N,ge("intro.points."+E),{duration:0})})},600),e.on("enter.intro",function(F){if(F.id==="select"){var N=e.selectedIDs();N.length!==1||N[0]!==s||u(function(){var D=ei(e,"delete").node();D&&M(x)},50)}});function M(F){e.on("enter.intro",null),e.map().on("move.intro",null),F()}}function x(){if(!s)return l.restart();var b=e.hasEntity(s);if(!b)return l.restart();var y=ei(e,"delete").node();if(!y)return E(k);t(".edit-menu",ge("intro.points.delete"),{padding:50}),u(function(){e.map().on("move.intro",function(){if(ei(e,"delete").empty())return E(k);t(".edit-menu",ge("intro.points.delete"),{duration:0,padding:50})})},300),e.on("exit.intro",function(){if(!s)return l.restart();var M=e.hasEntity(s);if(M)return E(k)}),e.history().on("change.intro",function(M){M.deleted().length&&E(S)});function E(M){e.map().on("move.intro",null),e.history().on("change.intro",null),e.on("exit.intro",null),M()}}function S(){e.history().on("change.intro",function(){b(I)}),t(".top-toolbar button.undo-button",ge("intro.points.undo"));function b(y){e.history().on("change.intro",null),y()}}function I(){r.call("done"),t(".ideditor",ge("intro.points.play",{next:T("intro.areas.title")}),{tooltipBox:".intro-nav-wrap .chapter-area",buttonText:T.html("intro.ok"),buttonCallback:function(){t(".ideditor")}})}return l.enter=function(){f()},l.exit=function(){n.forEach(window.clearTimeout),e.on("enter.intro exit.intro",null),e.map().on("move.intro drawn.intro",null),e.history().on("change.intro",null),e.container().select(".inspector-wrap").on("wheel.intro",c),e.container().select(".preset-search-input").on("keydown.intro keyup.intro",null)},l.restart=function(){l.exit(),l.enter()},_e(l,r,"on")}var ik=q(()=>{"use strict";Ye();Ae();At();ue();h3();Kt();Er();Yr();So()});var Mz={};j(Mz,{uiIntroArea:()=>ak});function ak(e,t){var r=xe("done"),n=[-85.63552,41.94159],i=Pe.item("leisure/playground"),a=Pe.field("name"),o=Pe.field("description"),s=[],l,u={title:"intro.areas.title"};function c(I,b){s.push(window.setTimeout(I,b))}function f(I){I.stopPropagation(),I.preventDefault()}function d(I,b,y){var E=180*Math.pow(2,e.map().zoom()-19.5),M=Dt(I,E,e);t(M,b,y)}function m(){e.enter(Ue(e)),e.history().reset("initial"),l=null;var I=_i(n,e.map().center());I&&t(null,null,{duration:0}),e.map().centerZoomEase(n,19,I),c(function(){var y=t("button.add-area",ge("intro.areas.add_playground"));y.selectAll(".popover-inner").insert("svg","span").attr("class","tooltip-illustration").append("use").attr("xlink:href","#iD-graphic-areas"),e.on("enter.intro",function(E){E.id==="add-area"&&b(h)})},I+100);function b(y){e.on("enter.intro",null),y()}}function h(){if(e.mode().id!=="add-area")return u.restart();l=null,e.map().zoomEase(19.5,500),c(function(){var b=e.lastPointerType()==="mouse"?"starting_node_click":"starting_node_tap",y=ge("intro.areas.start_playground")+ge("intro.areas."+b);d(n,y,{duration:250}),c(function(){e.map().on("move.intro drawn.intro",function(){d(n,y,{duration:0})}),e.on("enter.intro",function(E){if(E.id!=="draw-area")return u.restart();I(g)})},250)},550);function I(b){e.map().on("move.intro drawn.intro",null),e.on("enter.intro",null),b()}}function g(){if(e.mode().id!=="draw-area")return u.restart();l=null,d(n,ge("intro.areas.continue_playground"),{duration:250}),c(function(){e.map().on("move.intro drawn.intro",function(){d(n,ge("intro.areas.continue_playground"),{duration:0})})},250),e.on("enter.intro",function(b){if(b.id==="draw-area"){var y=e.hasEntity(e.selectedIDs()[0]);return y&&y.nodes.length>=6?I(A):void 0}else return b.id==="select"?(l=e.selectedIDs()[0],I(v)):u.restart()});function I(b){e.map().on("move.intro drawn.intro",null),e.on("enter.intro",null),b()}}function A(){if(e.mode().id!=="draw-area")return u.restart();l=null;var I=ge("intro.areas.finish_area_"+(e.lastPointerType()==="mouse"?"click":"tap"))+ge("intro.areas.finish_playground");d(n,I,{duration:250}),c(function(){e.map().on("move.intro drawn.intro",function(){d(n,I,{duration:0})})},250),e.on("enter.intro",function(y){if(y.id!=="draw-area")return y.id==="select"?(l=e.selectedIDs()[0],b(v)):u.restart()});function b(y){e.map().on("move.intro drawn.intro",null),e.on("enter.intro",null),y()}}function v(){if(!l||!e.hasEntity(l))return m();var I=e.selectedIDs();(e.mode().id!=="select"||!I.length||I[0]!==l)&&e.enter(je(e,[l])),e.container().select(".inspector-wrap").on("wheel.intro",f),c(function(){e.container().select(".inspector-wrap .panewrap").style("right","-100%"),e.container().select(".preset-search-input").on("keydown.intro",null).on("keyup.intro",b),t(".preset-search-input",ge("intro.areas.search_playground",{preset:i.name()}))},400),e.on("enter.intro",function(E){if(!l||!e.hasEntity(l))return y(m);var M=e.selectedIDs();(E.id!=="select"||!M.length||M[0]!==l)&&(e.enter(je(e,[l])),e.container().select(".inspector-wrap .panewrap").style("right","-100%"),e.container().select(".inspector-wrap").on("wheel.intro",f),e.container().select(".preset-search-input").on("keydown.intro",null).on("keyup.intro",b),t(".preset-search-input",ge("intro.areas.search_playground",{preset:i.name()})),e.history().on("change.intro",null))});function b(){var E=e.container().select(".preset-list-item:first-child");E.classed("preset-leisure-playground")&&(t(E.select(".preset-list-button").node(),ge("intro.areas.choose_playground",{preset:i.name()}),{duration:300}),e.container().select(".preset-search-input").on("keydown.intro",f,!0).on("keyup.intro",null),e.history().on("change.intro",function(){y(_)}))}function y(E){e.container().select(".inspector-wrap").on("wheel.intro",null),e.on("enter.intro",null),e.history().on("change.intro",null),e.container().select(".preset-search-input").on("keydown.intro keyup.intro",null),E()}}function _(){if(!l||!e.hasEntity(l))return m();var I=e.selectedIDs();if(e.mode().id!=="select"||!I.length||I[0]!==l)return v();if(!e.container().select(".form-field-description").empty())return b(k);e.container().select(".inspector-wrap").on("wheel.intro",f),c(function(){e.container().select(".inspector-wrap .panewrap").style("right","0%");var y=e.entity(l);if(y.tags.description)return b(S);var E=e.container().select(".more-fields").node().getBoundingClientRect();if(E.top>300){var M=e.container().select(".entity-editor-pane .inspector-body"),F=M.node().scrollTop,N=F+(E.top-300);M.transition().duration(250).tween("scroll.inspector",function(){var D=this,O=Rr(F,N);return function(L){D.scrollTop=O(L)}})}c(function(){t(".more-fields .combobox-input",ge("intro.areas.add_field",{name:a.title(),description:o.title()}),{duration:300}),e.container().select(".more-fields .combobox-input").on("click.intro",function(){var D;D=window.setInterval(function(){e.container().select("div.combobox").empty()||(window.clearInterval(D),b(w))},300)})},300)},400),e.on("exit.intro",function(){return b(v)});function b(y){e.container().select(".inspector-wrap").on("wheel.intro",null),e.container().select(".more-fields .combobox-input").on("click.intro",null),e.on("exit.intro",null),y()}}function w(){if(!l||!e.hasEntity(l))return m();var I=e.selectedIDs();if(e.mode().id!=="select"||!I.length||I[0]!==l)return v();if(!e.container().select(".form-field-description").empty())return y(k);if(e.container().select("div.combobox").empty())return y(_);var b;b=window.setInterval(function(){e.container().select("div.combobox").empty()&&(window.clearInterval(b),c(function(){e.container().select(".form-field-description").empty()?y(x):y(k)},300))},300),t("div.combobox",ge("intro.areas.choose_field",{field:o.title()}),{duration:300}),e.on("exit.intro",function(){return y(v)});function y(E){b&&window.clearInterval(b),e.on("exit.intro",null),E()}}function k(){if(!l||!e.hasEntity(l))return m();var I=e.selectedIDs();if(e.mode().id!=="select"||!I.length||I[0]!==l)return v();if(e.container().select(".inspector-wrap .panewrap").style("right","0%"),e.container().select(".form-field-description").empty())return b(x);e.on("exit.intro",function(){b(S)}),t(".entity-editor-pane",ge("intro.areas.describe_playground",{button:{html:tt("#iD-icon-close","inline")}}),{duration:300});function b(y){e.on("exit.intro",null),y()}}function x(){if(!l||!e.hasEntity(l))return m();var I=e.selectedIDs();if(e.mode().id!=="select"||!I.length||I[0]!==l)return v();e.container().select(".inspector-wrap .panewrap").style("right","0%"),t(".entity-editor-pane",ge("intro.areas.retry_add_field",{field:o.title()}),{buttonText:T.html("intro.ok"),buttonCallback:function(){b(_)}}),e.on("exit.intro",function(){return b(v)});function b(y){e.on("exit.intro",null),y()}}function S(){r.call("done"),t(".ideditor",ge("intro.areas.play",{next:T("intro.lines.title")}),{tooltipBox:".intro-nav-wrap .chapter-line",buttonText:T.html("intro.ok"),buttonCallback:function(){t(".ideditor")}})}return u.enter=function(){m()},u.exit=function(){s.forEach(window.clearTimeout),e.on("enter.intro exit.intro",null),e.map().on("move.intro drawn.intro",null),e.history().on("change.intro",null),e.container().select(".inspector-wrap").on("wheel.intro",null),e.container().select(".preset-search-input").on("keydown.intro keyup.intro",null),e.container().select(".more-fields .combobox-input").on("click.intro",null)},u.restart=function(){u.exit(),u.enter()},_e(u,r,"on")}var ok=q(()=>{"use strict";Ye();Fi();At();ue();Kt();Er();Yr();So()});var Tz={};j(Tz,{uiIntroLine:()=>sk});function sk(e,t){var r=xe("done"),n=[],i=null,a="w646",o=[-85.6297754121684,41.95805253325314],s=[-85.62975395449628,41.95787501510204],l=[-85.62974496187628,41.95742515554585],u=Pe.item("category-road_minor"),c=Pe.item("highway/residential"),f="w525",d="n2862",m=[-85.62390110349587,41.95397111462291],h=[-85.623867390213,41.95466987786487],g=[-85.62386254803509,41.95430395953872],A="w522",v="w1",_="n3550",w="n5",k=null,x=e.entity(_).loc,S=e.entity(w).loc,I=[-85.6219395542764,41.95228033922477],b=[-85.62219310052491,41.952505413152956],y={title:"intro.lines.title"};function E(le,ie){n.push(window.setTimeout(le,ie))}function M(le){le.stopPropagation(),le.preventDefault()}function F(){e.enter(Ue(e)),e.history().reset("initial");var le=_i(o,e.map().center());le&&t(null,null,{duration:0}),e.map().centerZoomEase(o,18.5,le),E(function(){var ve=t("button.add-line",ge("intro.lines.add_line"));ve.selectAll(".popover-inner").insert("svg","span").attr("class","tooltip-illustration").append("use").attr("xlink:href","#iD-graphic-lines"),e.on("enter.intro",function(be){be.id==="add-line"&&ie(N)})},le+100);function ie(ve){e.on("enter.intro",null),ve()}}function N(){if(e.mode().id!=="add-line")return y.restart();i=null;var le=70*Math.pow(2,e.map().zoom()-18),ie=Dt(o,le,e);ie.height=ie.height+100;var ve=e.lastPointerType()==="mouse"?"start_line":"start_line_tap",be=ge("intro.lines.missing_road")+"{br}"+ge("intro.lines.line_draw_info")+ge("intro.lines."+ve);t(ie,be),e.map().on("move.intro drawn.intro",function(){le=70*Math.pow(2,e.map().zoom()-18),ie=Dt(o,le,e),ie.height=ie.height+100,t(ie,be,{duration:0})}),e.on("enter.intro",function(Oe){if(Oe.id!=="draw-line")return y.restart();Te(D)});function Te(Oe){e.map().on("move.intro drawn.intro",null),e.on("enter.intro",null),Oe()}}function D(){if(e.mode().id!=="draw-line")return y.restart();i=e.mode().selectedIDs()[0],e.map().centerEase(s,500),E(function(){var ie=200*Math.pow(2,e.map().zoom()-18.5),ve=Dt(s,ie,e);ve.height=ve.height*2,t(ve,ge("intro.lines.intersect",{name:T("intro.graph.name.flower-street")})),e.map().on("move.intro drawn.intro",function(){ie=200*Math.pow(2,e.map().zoom()-18.5),ve=Dt(s,ie,e),ve.height=ve.height*2,t(ve,ge("intro.lines.intersect",{name:T("intro.graph.name.flower-street")}),{duration:0})})},550),e.history().on("change.intro",function(){O()&&le(P)}),e.on("enter.intro",function(ie){if(ie.id!=="draw-line")if(ie.id==="select"){le(L);return}else return y.restart()});function le(ie){e.map().on("move.intro drawn.intro",null),e.history().on("change.intro",null),e.on("enter.intro",null),ie()}}function O(){var le=i&&e.hasEntity(i);if(!le)return!1;var ie=e.graph().childNodes(le);return ie.some(function(ve){return e.graph().parentWays(ve).some(function(be){return be.id===a})})}function L(){Q(window).on("pointerdown.intro mousedown.intro",M,!0);var le=Dt(l,80,e);t(le,ge("intro.lines.retry_intersect",{name:T("intro.graph.name.flower-street")})),E(y.restart,3e3)}function P(){if(e.mode().id!=="draw-line")return y.restart();var le=i&&e.hasEntity(i);if(!le)return y.restart();e.map().centerEase(l,500);var ie=ge("intro.lines.continue_line")+"{br}"+ge("intro.lines.finish_line_"+(e.lastPointerType()==="mouse"?"click":"tap"))+ge("intro.lines.finish_road");t(".main-map .surface",ie),e.on("enter.intro",function(be){if(be.id!=="draw-line")return be.id==="select"?ve(U):y.restart()});function ve(be){e.on("enter.intro",null),be()}}function U(){if(e.mode().id!=="select")return y.restart();e.on("exit.intro",function(){return y.restart()});var le=e.container().select(".preset-category-road_minor .preset-list-button");if(le.empty())return y.restart();e.container().select(".inspector-wrap").on("wheel.intro",M),E(function(){e.container().select(".inspector-wrap .panewrap").style("right","-100%"),t(le.node(),ge("intro.lines.choose_category_road",{category:u.name()})),le.on("click.intro",function(){ie(B)})},400);function ie(ve){e.container().select(".inspector-wrap").on("wheel.intro",null),e.container().select(".preset-list-button").on("click.intro",null),e.on("exit.intro",null),ve()}}function B(){if(e.mode().id!=="select")return y.restart();e.on("exit.intro",function(){return y.restart()});var le=e.container().select(".preset-category-road_minor .subgrid");if(le.empty())return y.restart();le.selectAll(":not(.preset-highway-residential) .preset-list-button").on("click.intro",function(){ie(z)}),le.selectAll(".preset-highway-residential .preset-list-button").on("click.intro",function(){ie(V)}),E(function(){t(le.node(),ge("intro.lines.choose_preset_residential",{preset:c.name()}),{tooltipBox:".preset-highway-residential .preset-list-button",duration:300})},300);function ie(ve){e.container().select(".preset-list-button").on("click.intro",null),e.on("exit.intro",null),ve()}}function z(){if(e.mode().id!=="select")return y.restart();e.on("exit.intro",function(){return y.restart()}),e.container().select(".inspector-wrap").on("wheel.intro",M),E(function(){var ie=e.container().select(".entity-editor-pane .preset-list-button");t(ie.node(),ge("intro.lines.retry_preset_residential",{preset:c.name()})),ie.on("click.intro",function(){le(U)})},500);function le(ie){e.container().select(".inspector-wrap").on("wheel.intro",null),e.container().select(".preset-list-button").on("click.intro",null),e.on("exit.intro",null),ie()}}function V(){e.on("exit.intro",function(){le(G)}),E(function(){t(".entity-editor-pane",ge("intro.lines.name_road",{button:{html:tt("#iD-icon-close","inline")}}),{tooltipClass:"intro-lines-name_road"})},500);function le(ie){e.on("exit.intro",null),ie()}}function G(){e.history().checkpoint("doneAddLine"),E(function(){t(".main-map .surface",ge("intro.lines.did_name_road"),{buttonText:T.html("intro.ok"),buttonCallback:function(){le(W)}})},500);function le(ie){ie()}}function W(){if(e.history().reset("doneAddLine"),!e.hasEntity(f)||!e.hasEntity(d))return y.restart();var le=_i(g,e.map().center());le&&t(null,null,{duration:0}),e.map().centerZoomEase(g,19,le),E(function(){var ve=250*Math.pow(2,e.map().zoom()-19),be=Dt(g,ve,e),Te=function(){ie(Y)};t(be,ge("intro.lines.update_line"),{buttonText:T.html("intro.ok"),buttonCallback:Te}),e.map().on("move.intro drawn.intro",function(){var Oe=250*Math.pow(2,e.map().zoom()-19),Ve=Dt(g,Oe,e);t(Ve,ge("intro.lines.update_line"),{duration:0,buttonText:T.html("intro.ok"),buttonCallback:Te})})},le+100);function ie(ve){e.map().on("move.intro drawn.intro",null),ve()}}function Y(){if(e.history().reset("doneAddLine"),!e.hasEntity(f)||!e.hasEntity(d))return y.restart();var le=40*Math.pow(2,e.map().zoom()-19),ie=Dt(m,le,e),ve=ge("intro.lines.add_node"+(e.lastPointerType()==="mouse"?"":"_touch"));t(ie,ve),e.map().on("move.intro drawn.intro",function(){var Te=40*Math.pow(2,e.map().zoom()-19),Oe=Dt(m,Te,e);t(Oe,ve,{duration:0})}),e.history().on("change.intro",function(Te){if(!e.hasEntity(f)||!e.hasEntity(d))return be(W);Te.created().length===1&&E(function(){be(J)},500)}),e.on("enter.intro",function(Te){Te.id!=="select"&&be(W)});function be(Te){e.map().on("move.intro drawn.intro",null),e.history().on("change.intro",null),e.on("enter.intro",null),Te()}}function J(){if(!e.hasEntity(f)||!e.hasEntity(d))return be(W);var le=100*Math.pow(2,e.map().zoom()-19),ie=Dt(h,le,e),ve=ge("intro.lines.start_drag_endpoint"+(e.lastPointerType()==="mouse"?"":"_touch"))+ge("intro.lines.drag_to_intersection");t(ie,ve),e.map().on("move.intro drawn.intro",function(){if(!e.hasEntity(f)||!e.hasEntity(d))return be(W);var Te=100*Math.pow(2,e.map().zoom()-19),Oe=Dt(h,Te,e);t(Oe,ve,{duration:0});var Ve=e.entity(d);wt(Ve.loc,h)<=4&&be(oe)});function be(Te){e.map().on("move.intro drawn.intro",null),Te()}}function oe(){if(!e.hasEntity(f)||!e.hasEntity(d))return be(W);var le=100*Math.pow(2,e.map().zoom()-19),ie=Dt(h,le,e),ve=ge("intro.lines.spot_looks_good")+ge("intro.lines.finish_drag_endpoint"+(e.lastPointerType()==="mouse"?"":"_touch"));t(ie,ve),e.map().on("move.intro drawn.intro",function(){if(!e.hasEntity(f)||!e.hasEntity(d))return be(W);var Te=100*Math.pow(2,e.map().zoom()-19),Oe=Dt(h,Te,e);t(Oe,ve,{duration:0});var Ve=e.entity(d);wt(Ve.loc,h)>4&&be(J)}),e.on("enter.intro",function(){be(Ce)});function be(Te){e.map().on("move.intro drawn.intro",null),e.on("enter.intro",null),Te()}}function Ce(){if(!e.hasEntity(f)||!e.hasEntity(d))return ve(W);e.selectedIDs().indexOf(f)===-1&&e.enter(je(e,[f]));var le=80*Math.pow(2,e.map().zoom()-19),ie=Dt(g,le,e);t(ie,ge("intro.lines.start_drag_midpoint")),e.map().on("move.intro drawn.intro",function(){if(!e.hasEntity(f)||!e.hasEntity(d))return ve(W);var be=80*Math.pow(2,e.map().zoom()-19),Te=Dt(g,be,e);t(Te,ge("intro.lines.start_drag_midpoint"),{duration:0})}),e.history().on("change.intro",function(be){be.created().length===1&&ve(se)}),e.on("enter.intro",function(be){be.id!=="select"&&e.enter(je(e,[f]))});function ve(be){e.map().on("move.intro drawn.intro",null),e.history().on("change.intro",null),e.on("enter.intro",null),be()}}function se(){if(!e.hasEntity(f)||!e.hasEntity(d))return be(W);var le=100*Math.pow(2,e.map().zoom()-19),ie=Dt(h,le,e);ie.height+=400;var ve=function(){e.history().checkpoint("doneUpdateLine"),be(ne)};t(ie,ge("intro.lines.continue_drag_midpoint"),{buttonText:T.html("intro.ok"),buttonCallback:ve}),e.map().on("move.intro drawn.intro",function(){if(!e.hasEntity(f)||!e.hasEntity(d))return be(W);var Te=100*Math.pow(2,e.map().zoom()-19),Oe=Dt(h,Te,e);Oe.height+=400,t(Oe,ge("intro.lines.continue_drag_midpoint"),{duration:0,buttonText:T.html("intro.ok"),buttonCallback:ve})});function be(Te){e.map().on("move.intro drawn.intro",null),Te()}}function ne(){if(e.history().reset("doneUpdateLine"),e.enter(Ue(e)),!e.hasEntity(A)||!e.hasEntity(v)||!e.hasEntity(_))return y.restart();var le=_i(I,e.map().center());le&&t(null,null,{duration:0}),e.map().centerZoomEase(I,18,le),E(function(){var ve=200*Math.pow(2,e.map().zoom()-18),be=Dt(I,ve,e);be.top-=200,be.height+=400;var Te=function(){ie(he)};t(be,ge("intro.lines.delete_lines",{street:T("intro.graph.name.12th-avenue")}),{buttonText:T.html("intro.ok"),buttonCallback:Te}),e.map().on("move.intro drawn.intro",function(){var Oe=200*Math.pow(2,e.map().zoom()-18),Ve=Dt(I,Oe,e);Ve.top-=200,Ve.height+=400,t(Ve,ge("intro.lines.delete_lines",{street:T("intro.graph.name.12th-avenue")}),{duration:0,buttonText:T.html("intro.ok"),buttonCallback:Te})}),e.history().on("change.intro",function(){E(function(){ie(ne)},500)})},le+100);function ie(ve){e.map().on("move.intro drawn.intro",null),e.history().on("change.intro",null),ve()}}function he(){e.history().reset("doneUpdateLine"),e.enter(Ue(e)),e.map().centerZoomEase(x,18,500);var le=ge("intro.lines.split_street",{street1:T("intro.graph.name.11th-avenue"),street2:T("intro.graph.name.washington-street")})+ge("intro.lines."+(e.lastPointerType()==="mouse"?"rightclick_intersection":"edit_menu_intersection_touch"));E(function(){var ve=60*Math.pow(2,e.map().zoom()-18),be=Dt(x,ve,e);t(be,le),e.map().on("move.intro drawn.intro",function(){var Te=60*Math.pow(2,e.map().zoom()-18),Oe=Dt(x,Te,e);t(Oe,le,{duration:0})}),e.on("enter.intro",function(Te){if(Te.id==="select"){var Oe=e.selectedIDs();Oe.length!==1||Oe[0]!==_||E(function(){var Ve=ei(e,"split").node();Ve&&ie(Se)},50)}}),e.history().on("change.intro",function(){E(function(){ie(ne)},300)})},600);function ie(ve){e.map().on("move.intro drawn.intro",null),e.on("enter.intro",null),e.history().on("change.intro",null),ve()}}function Se(){if(!e.hasEntity(A)||!e.hasEntity(v)||!e.hasEntity(_))return ve(ne);var le=ei(e,"split").node();if(!le)return ve(he);var ie=!1;k=null,t(".edit-menu",ge("intro.lines.split_intersection",{street:T("intro.graph.name.washington-street")}),{padding:50}),e.map().on("move.intro drawn.intro",function(){var be=ei(e,"split").node();if(!ie&&!be)return ve(he);t(".edit-menu",ge("intro.lines.split_intersection",{street:T("intro.graph.name.washington-street")}),{duration:0,padding:50})}),e.history().on("change.intro",function(be){ie=!0,E(function(){e.history().undoAnnotation()===T("operations.split.annotation.line",{n:1})?(k=be.created()[0].id,ve(Z)):(k=null,ve(re))},300)});function ve(be){e.map().on("move.intro drawn.intro",null),e.history().on("change.intro",null),be()}}function re(){e.enter(Ue(e)),e.map().centerZoomEase(x,18,500);var le=function(){be(he)},ie=60*Math.pow(2,e.map().zoom()-18),ve=Dt(x,ie,e);t(ve,ge("intro.lines.retry_split"),{buttonText:T.html("intro.ok"),buttonCallback:le}),e.map().on("move.intro drawn.intro",function(){var Te=60*Math.pow(2,e.map().zoom()-18),Oe=Dt(x,Te,e);t(Oe,ge("intro.lines.retry_split"),{duration:0,buttonText:T.html("intro.ok"),buttonCallback:le})});function be(Te){e.map().on("move.intro drawn.intro",null),Te()}}function Z(){if(!k||!e.hasEntity(k)||!e.hasEntity(A)||!e.hasEntity(v)||!e.hasEntity(_))return Oe(he);var le=e.selectedIDs(),ie="intro.lines.did_split_"+(le.length>1?"multi":"single"),ve=T("intro.graph.name.washington-street"),be=200*Math.pow(2,e.map().zoom()-18),Te=Dt(b,be,e);Te.width=Te.width/2,t(Te,ge(ie,{street1:ve,street2:ve}),{duration:500}),E(function(){e.map().centerZoomEase(b,18,500),e.map().on("move.intro drawn.intro",function(){var Ve=200*Math.pow(2,e.map().zoom()-18),Qe=Dt(b,Ve,e);Qe.width=Qe.width/2,t(Qe,ge(ie,{street1:ve,street2:ve}),{duration:0})})},600),e.on("enter.intro",function(){var Ve=e.selectedIDs();Ve.length===1&&Ve[0]===k&&Oe(te)}),e.history().on("change.intro",function(){if(!k||!e.hasEntity(k)||!e.hasEntity(A)||!e.hasEntity(v)||!e.hasEntity(_))return Oe(he)});function Oe(Ve){e.map().on("move.intro drawn.intro",null),e.on("enter.intro",null),e.history().on("change.intro",null),Ve()}}function te(){if(!k||!e.hasEntity(k)||!e.hasEntity(A)||!e.hasEntity(v)||!e.hasEntity(_))return be(he);var le=e.selectedIDs(),ie=le.indexOf(k)!==-1,ve=le.indexOf(v)!==-1;if(ie&&ve)return be(ye);if(!ie&&!ve)return be(Z);e.map().centerZoomEase(b,18,500),E(function(){var Te,Oe,Ve,Qe;ie?(Te=T("intro.graph.name.washington-street"),Oe=T("intro.graph.name.12th-avenue"),Ve=60*Math.pow(2,e.map().zoom()-18),Qe=Dt(S,Ve,e),Qe.width*=3):(Te=T("intro.graph.name.12th-avenue"),Oe=T("intro.graph.name.washington-street"),Ve=200*Math.pow(2,e.map().zoom()-18),Qe=Dt(b,Ve,e),Qe.width/=2),t(Qe,ge("intro.lines.multi_select",{selected:Te,other1:Oe})+" "+ge("intro.lines.add_to_selection_"+(e.lastPointerType()==="mouse"?"click":"touch"),{selected:Te,other2:Oe})),e.map().on("move.intro drawn.intro",function(){ie?(Te=T("intro.graph.name.washington-street"),Oe=T("intro.graph.name.12th-avenue"),Ve=60*Math.pow(2,e.map().zoom()-18),Qe=Dt(S,Ve,e),Qe.width*=3):(Te=T("intro.graph.name.12th-avenue"),Oe=T("intro.graph.name.washington-street"),Ve=200*Math.pow(2,e.map().zoom()-18),Qe=Dt(b,Ve,e),Qe.width/=2),t(Qe,ge("intro.lines.multi_select",{selected:Te,other1:Oe})+" "+ge("intro.lines.add_to_selection_"+(e.lastPointerType()==="mouse"?"click":"touch"),{selected:Te,other2:Oe}),{duration:0})}),e.on("enter.intro",function(){be(te)}),e.history().on("change.intro",function(){if(!k||!e.hasEntity(k)||!e.hasEntity(A)||!e.hasEntity(v)||!e.hasEntity(_))return be(he)})},600);function be(Te){e.map().on("move.intro drawn.intro",null),e.on("enter.intro",null),e.history().on("change.intro",null),Te()}}function ye(){if(!k||!e.hasEntity(k)||!e.hasEntity(A)||!e.hasEntity(v)||!e.hasEntity(_))return be(he);var le=200*Math.pow(2,e.map().zoom()-18),ie=Dt(b,le,e),ve=ge("intro.lines.multi_select_success")+ge("intro.lines.multi_"+(e.lastPointerType()==="mouse"?"rightclick":"edit_menu_touch"));t(ie,ve),e.map().on("move.intro drawn.intro",function(){var Te=200*Math.pow(2,e.map().zoom()-18),Oe=Dt(b,Te,e);t(Oe,ve,{duration:0})}),e.ui().editMenu().on("toggled.intro",function(Te){Te&&E(function(){var Oe=e.selectedIDs();if(Oe.length===2&&Oe.indexOf(v)!==-1&&Oe.indexOf(k)!==-1){var Ve=ei(e,"delete").node();if(!Ve)return;be(we)}else return Oe.length===1&&Oe.indexOf(k)!==-1?be(te):be(Z)},300)}),e.history().on("change.intro",function(){if(!k||!e.hasEntity(k)||!e.hasEntity(A)||!e.hasEntity(v)||!e.hasEntity(_))return be(he)});function be(Te){e.map().on("move.intro drawn.intro",null),e.ui().editMenu().on("toggled.intro",null),e.history().on("change.intro",null),Te()}}function we(){if(!k||!e.hasEntity(k)||!e.hasEntity(A)||!e.hasEntity(v)||!e.hasEntity(_))return ie(he);var le=ei(e,"delete").node();if(!le)return ie(ye);t(".edit-menu",ge("intro.lines.multi_delete"),{padding:50}),e.map().on("move.intro drawn.intro",function(){t(".edit-menu",ge("intro.lines.multi_delete"),{duration:0,padding:50})}),e.on("exit.intro",function(){if(e.hasEntity(k)||e.hasEntity(v))return ie(te)}),e.history().on("change.intro",function(){e.hasEntity(k)||e.hasEntity(v)?ie(Ne):ie(Be)});function ie(ve){e.map().on("move.intro drawn.intro",null),e.on("exit.intro",null),e.history().on("change.intro",null),ve()}}function Ne(){e.enter(Ue(e));var le=200*Math.pow(2,e.map().zoom()-18),ie=Dt(b,le,e);t(ie,ge("intro.lines.retry_delete"),{buttonText:T.html("intro.ok"),buttonCallback:function(){ve(te)}});function ve(be){be()}}function Be(){r.call("done"),t(".ideditor",ge("intro.lines.play",{next:T("intro.buildings.title")}),{tooltipBox:".intro-nav-wrap .chapter-building",buttonText:T.html("intro.ok"),buttonCallback:function(){t(".ideditor")}})}return y.enter=function(){F()},y.exit=function(){n.forEach(window.clearTimeout),Q(window).on("pointerdown.intro mousedown.intro",null,!0),e.on("enter.intro exit.intro",null),e.map().on("move.intro drawn.intro",null),e.history().on("change.intro",null),e.container().select(".inspector-wrap").on("wheel.intro",null),e.container().select(".preset-list-button").on("click.intro",null)},y.restart=function(){y.exit(),y.enter()},_e(y,r,"on")}var lk=q(()=>{"use strict";Ye();Ae();At();ue();He();Kt();Er();Yr();So()});var Nz={};j(Nz,{uiIntroBuilding:()=>uk});function uk(e,t){var r=xe("done"),n=[-85.62815,41.95638],i=[-85.62732,41.95347],a=Pe.item("category-building"),o=Pe.item("building/house"),s=Pe.item("man_made/storage_tank"),l=[],u=null,c=null,f={title:"intro.buildings.title"};function d(z,V){l.push(window.setTimeout(z,V))}function m(z){z.stopPropagation(),z.preventDefault()}function h(z,V,G){var W=160*Math.pow(2,e.map().zoom()-20),Y=Dt(z,W,e);t(Y,V,G)}function g(z,V,G){var W=190*Math.pow(2,e.map().zoom()-19.5),Y=Dt(z,W,e);t(Y,V,G)}function A(){e.enter(Ue(e)),e.history().reset("initial"),u=null;var z=_i(n,e.map().center());z&&t(null,null,{duration:0}),e.map().centerZoomEase(n,19,z),d(function(){var G=t("button.add-area",ge("intro.buildings.add_building"));G.selectAll(".popover-inner").insert("svg","span").attr("class","tooltip-illustration").append("use").attr("xlink:href","#iD-graphic-buildings"),e.on("enter.intro",function(W){W.id==="add-area"&&V(v)})},z+100);function V(G){e.on("enter.intro",null),G()}}function v(){if(e.mode().id!=="add-area")return z(A);u=null,e.map().zoomEase(20,500),d(function(){var V=ge("intro.buildings.start_building")+ge("intro.buildings.building_corner_"+(e.lastPointerType()==="mouse"?"click":"tap"));h(n,V),e.map().on("move.intro drawn.intro",function(){h(n,V,{duration:0})}),e.on("enter.intro",function(G){if(G.id!=="draw-area")return f.restart();z(_)})},550);function z(V){e.map().on("move.intro drawn.intro",null),e.on("enter.intro",null),V()}}function _(){if(e.mode().id!=="draw-area")return V(A);u=null;var z=ge("intro.buildings.continue_building")+"{br}"+ge("intro.areas.finish_area_"+(e.lastPointerType()==="mouse"?"click":"tap"))+ge("intro.buildings.finish_building");h(n,z),e.map().on("move.intro drawn.intro",function(){h(n,z,{duration:0})}),e.on("enter.intro",function(G){if(G.id!=="draw-area")if(G.id==="select"){var W=e.graph(),Y=e.entity(e.selectedIDs()[0]),J=W.childNodes(Y),oe=Je(J).map(function(Ce){return e.projection(Ce.loc)});return E_(oe)?(u=Y.id,V(k)):V(w)}else return f.restart()});function V(G){e.map().on("move.intro drawn.intro",null),e.on("enter.intro",null),G()}}function w(){var z=function(){V(A)};h(n,ge("intro.buildings.retry_building"),{buttonText:T.html("intro.ok"),buttonCallback:z}),e.map().on("move.intro drawn.intro",function(){h(n,ge("intro.buildings.retry_building"),{duration:0,buttonText:T.html("intro.ok"),buttonCallback:z})});function V(G){e.map().on("move.intro drawn.intro",null),G()}}function k(){if(!u||!e.hasEntity(u))return A();var z=e.selectedIDs();(e.mode().id!=="select"||!z.length||z[0]!==u)&&e.enter(je(e,[u])),e.container().select(".inspector-wrap").on("wheel.intro",m),d(function(){e.container().select(".inspector-wrap .panewrap").style("right","-100%");var G=e.container().select(".preset-category-building .preset-list-button");t(G.node(),ge("intro.buildings.choose_category_building",{category:a.name()})),G.on("click.intro",function(){G.on("click.intro",null),V(x)})},400),e.on("enter.intro",function(G){if(!u||!e.hasEntity(u))return V(A);var W=e.selectedIDs();if(G.id!=="select"||!W.length||W[0]!==u)return V(k)});function V(G){e.container().select(".inspector-wrap").on("wheel.intro",null),e.container().select(".preset-list-button").on("click.intro",null),e.on("enter.intro",null),G()}}function x(){if(!u||!e.hasEntity(u))return A();var z=e.selectedIDs();(e.mode().id!=="select"||!z.length||z[0]!==u)&&e.enter(je(e,[u])),e.container().select(".inspector-wrap").on("wheel.intro",m),d(function(){e.container().select(".inspector-wrap .panewrap").style("right","-100%");var G=e.container().select(".preset-building-house .preset-list-button");t(G.node(),ge("intro.buildings.choose_preset_house",{preset:o.name()}),{duration:300}),G.on("click.intro",function(){G.on("click.intro",null),V(S)})},400),e.on("enter.intro",function(G){if(!u||!e.hasEntity(u))return V(A);var W=e.selectedIDs();if(G.id!=="select"||!W.length||W[0]!==u)return V(k)});function V(G){e.container().select(".inspector-wrap").on("wheel.intro",null),e.container().select(".preset-list-button").on("click.intro",null),e.on("enter.intro",null),G()}}function S(){if(!u||!e.hasEntity(u))return A();var z=e.selectedIDs();(e.mode().id!=="select"||!z.length||z[0]!==u)&&e.enter(je(e,[u])),e.history().checkpoint("hasHouse"),e.on("exit.intro",function(){V(I)}),d(function(){t(".entity-editor-pane",ge("intro.buildings.close",{button:{html:tt("#iD-icon-close","inline")}}))},500);function V(G){e.on("exit.intro",null),G()}}function I(){if(!u)return f.restart();e.enter(Ue(e)),e.history().reset("hasHouse");var z=e.map().zoom();z<20&&(z=20),e.map().centerZoomEase(n,z,500),e.on("enter.intro",function(G){if(G.id==="select"){var W=e.selectedIDs();W.length!==1||W[0]!==u||d(function(){var Y=ei(e,"orthogonalize").node();Y&&V(b)},50)}}),e.map().on("move.intro drawn.intro",function(){var G=ge("intro.buildings."+(e.lastPointerType()==="mouse"?"rightclick_building":"edit_menu_building_touch"));h(n,G,{duration:0})}),e.history().on("change.intro",function(){V(I)});function V(G){e.on("enter.intro",null),e.map().on("move.intro drawn.intro",null),e.history().on("change.intro",null),G()}}function b(){if(!u)return f.restart();var z=e.hasEntity(u);if(!z)return W(I);var V=ei(e,"orthogonalize").node();if(!V)return W(I);var G=!1;t(".edit-menu",ge("intro.buildings.square_building"),{padding:50}),e.on("enter.intro",function(Y){Y.id==="browse"?W(I):(Y.id==="move"||Y.id==="rotate")&&W(y)}),e.map().on("move.intro",function(){var Y=ei(e,"orthogonalize").node();if(!G&&!Y)return W(I);t(".edit-menu",ge("intro.buildings.square_building"),{duration:0,padding:50})}),e.history().on("change.intro",function(){G=!0,e.history().on("change.intro",null),d(function(){e.history().undoAnnotation()===T("operations.orthogonalize.annotation.feature",{n:1})?W(E):W(y)},500)});function W(Y){e.on("enter.intro",null),e.map().on("move.intro",null),e.history().on("change.intro",null),Y()}}function y(){e.enter(Ue(e)),h(n,ge("intro.buildings.retry_square"),{buttonText:T.html("intro.ok"),buttonCallback:function(){z(I)}});function z(V){V()}}function E(){e.history().checkpoint("doneSquare"),h(n,ge("intro.buildings.done_square"),{buttonText:T.html("intro.ok"),buttonCallback:function(){z(M)}});function z(V){V()}}function M(){e.enter(Ue(e)),e.history().reset("doneSquare"),c=null;var z=_i(i,e.map().center());z&&t(null,null,{duration:0}),e.map().centerZoomEase(i,19.5,z),d(function(){t("button.add-area",ge("intro.buildings.add_tank")),e.on("enter.intro",function(G){G.id==="add-area"&&V(F)})},z+100);function V(G){e.on("enter.intro",null),G()}}function F(){if(e.mode().id!=="add-area")return z(M);c=null,d(function(){var V=ge("intro.buildings.start_tank")+ge("intro.buildings.tank_edge_"+(e.lastPointerType()==="mouse"?"click":"tap"));g(i,V),e.map().on("move.intro drawn.intro",function(){g(i,V,{duration:0})}),e.on("enter.intro",function(G){if(G.id!=="draw-area")return f.restart();z(N)})},550);function z(V){e.map().on("move.intro drawn.intro",null),e.on("enter.intro",null),V()}}function N(){if(e.mode().id!=="draw-area")return V(M);c=null;var z=ge("intro.buildings.continue_tank")+"{br}"+ge("intro.areas.finish_area_"+(e.lastPointerType()==="mouse"?"click":"tap"))+ge("intro.buildings.finish_tank");g(i,z),e.map().on("move.intro drawn.intro",function(){g(i,z,{duration:0})}),e.on("enter.intro",function(G){if(G.id!=="draw-area")return G.id==="select"?(c=e.selectedIDs()[0],V(D)):V(M)});function V(G){e.map().on("move.intro drawn.intro",null),e.on("enter.intro",null),G()}}function D(){if(!c||!e.hasEntity(c))return M();var z=e.selectedIDs();(e.mode().id!=="select"||!z.length||z[0]!==c)&&e.enter(je(e,[c])),e.container().select(".inspector-wrap").on("wheel.intro",m),d(function(){e.container().select(".inspector-wrap .panewrap").style("right","-100%"),e.container().select(".preset-search-input").on("keydown.intro",null).on("keyup.intro",V),t(".preset-search-input",ge("intro.buildings.search_tank",{preset:s.name()}))},400),e.on("enter.intro",function(W){if(!c||!e.hasEntity(c))return G(M);var Y=e.selectedIDs();(W.id!=="select"||!Y.length||Y[0]!==c)&&(e.enter(je(e,[c])),e.container().select(".inspector-wrap .panewrap").style("right","-100%"),e.container().select(".inspector-wrap").on("wheel.intro",m),e.container().select(".preset-search-input").on("keydown.intro",null).on("keyup.intro",V),t(".preset-search-input",ge("intro.buildings.search_tank",{preset:s.name()})),e.history().on("change.intro",null))});function V(){var W=e.container().select(".preset-list-item:first-child");W.classed("preset-man_made-storage_tank")&&(t(W.select(".preset-list-button").node(),ge("intro.buildings.choose_tank",{preset:s.name()}),{duration:300}),e.container().select(".preset-search-input").on("keydown.intro",m,!0).on("keyup.intro",null),e.history().on("change.intro",function(){G(O)}))}function G(W){e.container().select(".inspector-wrap").on("wheel.intro",null),e.on("enter.intro",null),e.history().on("change.intro",null),e.container().select(".preset-search-input").on("keydown.intro keyup.intro",null),W()}}function O(){if(!c||!e.hasEntity(c))return M();var z=e.selectedIDs();(e.mode().id!=="select"||!z.length||z[0]!==c)&&e.enter(je(e,[c])),e.history().checkpoint("hasTank"),e.on("exit.intro",function(){V(L)}),d(function(){t(".entity-editor-pane",ge("intro.buildings.close",{button:{html:tt("#iD-icon-close","inline")}}))},500);function V(G){e.on("exit.intro",null),G()}}function L(){if(!c)return z(M);e.enter(Ue(e)),e.history().reset("hasTank"),e.map().centerEase(i,500),d(function(){e.on("enter.intro",function(G){if(G.id==="select"){var W=e.selectedIDs();W.length!==1||W[0]!==c||d(function(){var Y=ei(e,"circularize").node();Y&&z(P)},50)}});var V=ge("intro.buildings."+(e.lastPointerType()==="mouse"?"rightclick_tank":"edit_menu_tank_touch"));g(i,V),e.map().on("move.intro drawn.intro",function(){g(i,V,{duration:0})}),e.history().on("change.intro",function(){z(L)})},600);function z(V){e.on("enter.intro",null),e.map().on("move.intro drawn.intro",null),e.history().on("change.intro",null),V()}}function P(){if(!c)return f.restart();var z=e.hasEntity(c);if(!z)return W(L);var V=ei(e,"circularize").node();if(!V)return W(L);var G=!1;t(".edit-menu",ge("intro.buildings.circle_tank"),{padding:50}),e.on("enter.intro",function(Y){Y.id==="browse"?W(L):(Y.id==="move"||Y.id==="rotate")&&W(U)}),e.map().on("move.intro",function(){var Y=ei(e,"circularize").node();if(!G&&!Y)return W(L);t(".edit-menu",ge("intro.buildings.circle_tank"),{duration:0,padding:50})}),e.history().on("change.intro",function(){G=!0,e.history().on("change.intro",null),d(function(){e.history().undoAnnotation()===T("operations.circularize.annotation.feature",{n:1})?W(B):W(U)},500)});function W(Y){e.on("enter.intro",null),e.map().on("move.intro",null),e.history().on("change.intro",null),Y()}}function U(){e.enter(Ue(e)),g(i,ge("intro.buildings.retry_circle"),{buttonText:T.html("intro.ok"),buttonCallback:function(){z(L)}});function z(V){V()}}function B(){r.call("done"),t(".ideditor",ge("intro.buildings.play",{next:T("intro.startediting.title")}),{tooltipBox:".intro-nav-wrap .chapter-startEditing",buttonText:T.html("intro.ok"),buttonCallback:function(){t(".ideditor")}})}return f.enter=function(){A()},f.exit=function(){l.forEach(window.clearTimeout),e.on("enter.intro exit.intro",null),e.map().on("move.intro drawn.intro",null),e.history().on("change.intro",null),e.container().select(".inspector-wrap").on("wheel.intro",null),e.container().select(".preset-search-input").on("keydown.intro keyup.intro",null),e.container().select(".more-fields .combobox-input").on("click.intro",null)},f.restart=function(){f.exit(),f.enter()},_e(f,r,"on")}var ck=q(()=>{"use strict";Ye();At();ue();Kt();Er();Ie();So()});var Dz={};j(Dz,{uiIntroStartEditing:()=>fk});function fk(e,t){var r=xe("done","startEditing"),n=Q(null),i={title:"intro.startediting.title"};function a(){t(".map-control.help-control",ge("intro.startediting.help"),{buttonText:T.html("intro.ok"),buttonCallback:function(){o()}})}function o(){t(".map-control.help-control",ge("intro.startediting.shortcuts"),{buttonText:T.html("intro.ok"),buttonCallback:function(){s()}})}function s(){e.container().selectAll(".shaded").remove(),t(".top-toolbar button.save",ge("intro.startediting.save"),{buttonText:T.html("intro.ok"),buttonCallback:function(){l()}})}function l(){e.container().selectAll(".shaded").remove(),n=ci(e.container()),n.select(".modal").attr("class","modal-splash modal"),n.selectAll(".close").remove();var u=n.select(".content").attr("class","fillL").append("button").attr("class","modal-section huge-modal-button").on("click",function(){n.remove()});u.append("svg").attr("class","illustration").append("use").attr("xlink:href","#iD-logo-walkthrough"),u.append("h2").call(T.append("intro.startediting.start")),r.call("startEditing")}return i.enter=function(){a()},i.exit=function(){n.remove(),e.container().selectAll(".shaded").remove()},_e(i,r,"on")}var dk=q(()=>{"use strict";Ye();Ae();ue();So();qs();Yr()});var Pz={};j(Pz,{uiIntro:()=>Y1});function Y1(e){let t="EsriWorldImageryClarity",r={},n;function i(o){it.get("intro_graph").then(s=>{for(let l in s)r[l]||(r[l]=Le(k_(s[l])));o.call(a)}).catch(function(){})}function a(o){e.enter(Ue(e));let s=e.connection(),l=e.history().toJSON(),u=window.location.hash,c=e.map().center(),f=e.map().zoom(),d=e.background().baseLayerSource(),m=e.background().overlayLayerSources(),h=e.container().selectAll(".main-map .layer-background").style("opacity"),g=s&&s.caches(),A=e.history().graph().base().entities;e.ui().sidebar.expand(),e.container().selectAll("button.sidebar-toggle").classed("disabled",!0),e.inIntro(!0),s&&s.toggle(!1).reset(),e.history().reset(),e.history().merge(Object.values(kn().load(r).entities)),e.history().checkpoint("initial");let v=e.background().findSource(t);v?e.background().baseLayerSource(v):e.background().bing(),m.forEach(M=>e.background().toggleOverlayLayer(M)),e.layers().all().forEach(M=>{typeof M.layer.enabled=="function"&&M.layer.enabled(M.id==="osm")}),e.container().selectAll(".main-map .layer-background").style("opacity",1);let w=J5(e.container().node());o.call(w),ke("walkthrough_started","yes");let x=(ke("walkthrough_progress")||"").split(";").filter(Boolean),S=y8.map((M,F)=>{let N=Yoe[M](e,w.reveal).on("done",()=>{if(y.filter(D=>D.title===N.title).classed("finished",!0),F<y8.length-1){let D=y8[F+1];e.container().select(`button.chapter-${D}`).classed("next",!0)}x.push(M),ke("walkthrough_progress",Je(x).join(";"))});return N});S[S.length-1].on("startEditing",()=>{x.push("startEditing"),ke("walkthrough_progress",Je(x).join(";")),yr(y8,x).length||ke("walkthrough_completed","yes"),w.remove(),I.remove(),e.container().selectAll(".main-map .layer-background").style("opacity",h),e.container().selectAll("button.sidebar-toggle").classed("disabled",!1),s&&s.toggle(!0).reset().caches(g),e.history().reset().merge(Object.values(A)),e.background().baseLayerSource(d),m.forEach(F=>e.background().toggleOverlayLayer(F)),l&&e.history().fromJSON(l,!1),e.map().centerZoom(c,f),window.location.replace(u),e.inIntro(!1)});let I=o.append("div").attr("class","intro-nav-wrap fillD");I.append("svg").attr("class","intro-nav-wrap-logo").append("use").attr("xlink:href","#iD-logo-walkthrough");let y=I.append("div").attr("class","joined").selectAll("button.chapter").data(S).enter().append("button").attr("class",(M,F)=>`chapter chapter-${y8[F]}`).on("click",E);y.append("span").html(M=>T.html(M.title)),y.append("span").attr("class","status").call(ce(pe.textDirection()==="rtl"?"#iD-icon-backward":"#iD-icon-forward","inline")),E(null,S[0]);function E(M,F){n&&n.exit(),e.enter(Ue(e)),n=F,n.enter(),y.classed("next",!1).classed("active",N=>N.title===n.title)}}return i}var Yoe,y8,ih=q(()=>{"use strict";ue();So();fr();An();G4();Kt();t1();ot();nh();Ie();ek();rk();ik();ok();lk();ck();dk();Yoe={welcome:J_,navigation:tk,point:nk,area:ak,line:sk,building:uk,startEditing:fk},y8=["welcome","navigation","point","area","line","building","startEditing"]});var Fz={};j(Fz,{uiIntro:()=>Y1});var b8=q(()=>{"use strict";ih()});var Oz={};j(Oz,{uiIssuesInfo:()=>eu});function eu(e){var t={id:"warnings",count:0,iconID:"iD-icon-alert",descriptionID:"issues.warnings_and_errors"},r={id:"resolved",count:0,iconID:"iD-icon-apply",descriptionID:"issues.user_resolved_issues"};function n(i){var a=[],o=e.validator().getIssues({what:ke("validate-what")||"edited",where:ke("validate-where")||"all"});if(o.length&&(t.count=o.length,a.push(t)),ke("validate-what")==="all"){var s=e.validator().getResolvedIssues();s.length&&(r.count=s.length,a.push(r))}var l=i.selectAll(".chip").data(a,function(c){return c.id});l.exit().remove();var u=l.enter().append("a").attr("class",function(c){return"chip "+c.id+"-count"}).attr("href","#").each(function(c){var f=Q(this),d=qe().placement("top").title(()=>T.append(c.descriptionID));f.call(d).on("click",function(m){m.preventDefault(),d.hide(Q(this)),e.ui().togglePanes(e.container().select(".map-panes .issues-pane"))}),f.call(ce("#"+c.iconID))});u.append("span").attr("class","count"),u.merge(l).selectAll("span.count").text(function(c){return c.count.toString()})}return function(i){n(i),e.validator().on("validated.infobox",function(){n(i)})}}var ah=q(()=>{"use strict";Ae();fr();ot();ue();nr()});var Rz={};j(Rz,{IntervalTasksQueue:()=>w8});var w8,pk=q(()=>{"use strict";w8=class{constructor(t){this.intervalInMs=t,this.pendingHandles=[],this.time=0}enqueue(t){let r=this.time;this.time+=this.intervalInMs,this.pendingHandles.push(setTimeout(()=>{this.time-=this.intervalInMs,t()},r))}clear(){this.pendingHandles.forEach(t=>{clearTimeout(t)}),this.pendingHandles=[],this.time=0}}});var zz={};j(zz,{rendererBackgroundSource:()=>ri});function _8(e){if(!e)return null;var t={day:"numeric",month:"short",year:"numeric"},r=new Date(e);return isNaN(r.getTime())?null:r.toLocaleDateString(pe.localeCode(),t)}function Bz(e){var t;return(e.start||e.end)&&(t=e.start||"?",e.start!==e.end&&(t+=" - "+(e.end||"?"))),t}function ri(e){var t=Object.assign({},e),r=[0,0],n=t.name,i=t.description,a=!!t.best,o=t.encrypted?As(t.template):t.template;return t.tileSize=e.tileSize||256,t.zoomExtent=e.zoomExtent||[0,22],t.overzoom=e.overzoom!==!1,t.offset=function(s){return arguments.length?(r=s,t):r},t.nudge=function(s,l){return r[0]+=s[0]/Math.pow(2,l),r[1]+=s[1]/Math.pow(2,l),t},t.name=function(){var s=t.id.replace(/\./g,"<TX_DOT>");return T("imagery."+s+".name",{default:(0,x8.escape)(n)})},t.label=function(){var s=t.id.replace(/\./g,"<TX_DOT>");return T.append("imagery."+s+".name",{default:(0,x8.escape)(n)})},t.hasDescription=function(){var s=t.id.replace(/\./g,"<TX_DOT>"),l=pe.tInfo("imagery."+s+".description",{default:(0,x8.escape)(i)}).text;return l!==""},t.description=function(){var s=t.id.replace(/\./g,"<TX_DOT>");return T.append("imagery."+s+".description",{default:(0,x8.escape)(i)})},t.best=function(){return a},t.area=function(){if(!e.polygon)return Number.MAX_VALUE;var s=g1({type:"MultiPolygon",coordinates:[e.polygon]});return isNaN(s)?0:s},t.imageryUsed=function(){return n||t.id},t.template=function(s){return arguments.length?((t.id==="custom"||t.id==="Bing")&&(o=s),t):o},t.url=function(s){var l=o.replace(/#[\s\S]*/u,"");if(l==="")return l;if((!t.type||t.id==="custom")&&(/SERVICE=WMS|\{(proj|wkid|bbox)\}/.test(l)?(t.type="wms",t.projection="EPSG:3857"):/\{(x|y)\}/.test(l)?t.type="tms":/\{u\}/.test(l)&&(t.type="bing")),t.type==="wms"){var u=function(h,g,A){var v=Math.pow(2,A),_=h/v*Math.PI*2-Math.PI,w=Math.atan(Math.sinh(Math.PI*(1-2*g/v)));switch(t.projection){case"EPSG:4326":return{x:_*180/Math.PI,y:w*180/Math.PI};default:var k=y4(_,w);return{x:2003750834e-2/Math.PI*k[0],y:2003750834e-2/Math.PI*k[1]}}},c=t.tileSize,f=t.projection,d=u(s[0],s[1],s[2]),m=u(s[0]+1,s[1]+1,s[2]);l=l.replace(/\{(\w+)\}/g,function(h,g){switch(g){case"width":case"height":return c;case"proj":return f;case"wkid":return f.replace(/^EPSG:/,"");case"bbox":return f==="EPSG:4326"&&/VERSION=1.3|CRS={proj}/.test(t.template().toUpperCase())?m.y+","+d.x+","+d.y+","+m.x:d.x+","+m.y+","+m.x+","+d.y;case"w":return d.x;case"s":return m.y;case"n":return m.x;case"e":return d.y;default:return h}})}else t.type==="tms"?l=l.replace("{x}",s[0]).replace("{y}",s[1]).replace(/\{[t-]y\}/,Math.pow(2,s[2])-s[1]-1).replace(/\{z(oom)?\}/,s[2]).replace(/\{@2x\}|\{r\}/,Uz?"@2x":""):t.type==="bing"&&(l=l.replace("{u}",function(){for(var h="",g=s[2];g>0;g--){var A=0,v=1<<g-1;(s[0]&v)!==0&&A++,(s[1]&v)!==0&&(A+=2),h+=A.toString()}return h}));return l=l.replace(/\{switch:([^}]+)\}/,function(h,g){var A=g.split(",");return A[(s[0]+s[1])%A.length]}),l},t.validZoom=function(s,l){return l===void 0&&(l=0),t.zoomExtent[0]-l<=s&&(t.overzoom||t.zoomExtent[1]>s)},t.isLocatorOverlay=function(){return t.id==="mapbox_locator_overlay"},t.isHidden=function(){return t.id==="DigitalGlobe-Premium-vintage"||t.id==="DigitalGlobe-Standard-vintage"},t.copyrightNotices=function(){},t.getMetadata=function(s,l,u){var c={start:_8(t.startDate),end:_8(t.endDate)};c.range=Bz(c);var f={vintage:c};u(null,f)},t}var x8,Uz,Lz,oh=q(()=>{"use strict";Ta();wi();x8=or(I3(),1);ue();He();Ie();W7();pk();Uz=window.devicePixelRatio&&window.devicePixelRatio>=2;(Lz=window.matchMedia)==null||Lz.call(window,`
82
82
  (-webkit-min-device-pixel-ratio: 2), /* Safari */
83
83
  (min-resolution: 2dppx), /* standard */