diff --git a/feature/improve-hooks/assets/index-cd14f0bc.js b/feature/improve-hooks/assets/index-59c5da4b.js similarity index 98% rename from feature/improve-hooks/assets/index-cd14f0bc.js rename to feature/improve-hooks/assets/index-59c5da4b.js index d17ea9a3..f99914c0 100644 --- a/feature/improve-hooks/assets/index-cd14f0bc.js +++ b/feature/improve-hooks/assets/index-59c5da4b.js @@ -916,7 +916,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho */class X1e{static getParser(t,n=!1){if(typeof t!="string")throw new Error("UserAgent should be a string");return new xA(t,n)}static parse(t){return new xA(t).getResult()}static get BROWSER_MAP(){return KF}static get ENGINE_MAP(){return Ea}static get OS_MAP(){return pr}static get PLATFORMS_MAP(){return on}}const Im="Others",J1e=["Android Browser","Chrome","Chromium","Firefox","Internet Explorer","Microsoft Edge","Opera","Safari","Samsung Internet for Android","Vivaldi","WeChat"],ebe=e=>{if(!co(e))return{browser:Im,os:Im};const{browser:{name:t},os:{name:n}}=X1e.parse(e);return{os:n??Im,browser:t&&J1e.includes(t)?t:Im}},tbe=e=>{var t;return co(e)?((t=e.split("/")[e.includes("://")?2:0])==null?void 0:t.split(":")[0])??"":"Direct"},aO=(e,t)=>Object.values({...Y5(t,t.map(()=>0)),...e}),SA={monthly:"Month",weekly:"Week",daily:"Day",hourly:"Hour"},nbe={hourly:e=>({hours:e}),daily:e=>({days:e}),weekly:e=>({weeks:e}),monthly:e=>({months:e})},rbe={hourly:ofe,daily:ST,weekly:lfe,monthly:Zv},sO={hourly:e=>Cu(e,"yyyy-MM-dd HH:00"),daily:e=>Js(e),weekly(e){const t=Js(vh(e)),n=Js(dfe(e));return`${t} - ${n}`},monthly:e=>Cu(e,"yyyy-MM")},ibe=e=>{const t=new Date,n=ra(e);return vT([[()=>ST(t,n)<=2,y1("hourly")],[()=>Zv(t,n)<=1,y1("daily")],[()=>Zv(t,n)<=6,y1("weekly")]])()??"monthly"},EA=(e,t)=>V5(n=>sO[e](ra(n.date)),t),obe=(e,t)=>t.reduce((n,r)=>{const i=sO[e](ra(r.date));return n[i]=n[i]??[],n[i].push(r),n},{}),abe=(e,t)=>{const n=rbe[e],r=sO[e],i=ra(t[0].date),o=ra(t[t.length-1].date),a=n(i,o),s=nbe[e];return[r(o),...RT(a,l=>r(qde(o,s(l))))]},sbe=(e,t,n,r)=>{if(r)return[Object.keys(t),Object.values(t)];const i=abe(n,e);return[i,aO(t,i)]},TA=(e,t,n)=>({label:t,data:e,fill:!1,tension:.2,borderColor:n,backgroundColor:n});let H1=null;const lbe=(e,t,[n],r)=>{if(!r||!n)return;const{index:i}=n;H1===e[i]?(r([]),H1=null):(r(e[i]&&t[e[i]]?t[e[i]]:[]),H1=e[i]??null)},cbe=({title:e,visits:t,highlightedVisits:n,highlightedLabel:r="Selected",setSelectedVisits:i})=>{const[o,a]=$.useState(t.length>0?ibe(t[t.length-1].date):"monthly"),[s,l]=Tn(!0),c=$.useRef(null),d=$.useRef(null),f=$.useMemo(()=>obe(o,t),[o,t]),p=$.useMemo(()=>EA(o,Qx(t)),[o,t]),[m,v]=$.useMemo(()=>sbe(t,p,o,s),[t,o,s]),y=$.useMemo(()=>aO(EA(o,Qx(n)),m),[n,o,m]),x=()=>{const E=TA(v,"Visits",OE);if(n.length===0)return[E];const C=TA(y,r,WI);return[E,C]},_=()=>({labels:m,datasets:x()}),w={maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{intersect:!1,axis:"x",callbacks:{label:qF}}},scales:{y:{beginAtZero:!0,ticks:{precision:0,callback:Sn}},x:{title:{display:!0,text:SA[o]}}},onHover:GF},S=E=>g.jsx($1e,{ref:E,data:_(),options:w,onClick:C=>lbe(m,f,YF(E.current,C),i)});return g.jsxs(Zr,{children:[g.jsxs(mu,{role:"heading",children:[e,g.jsx("div",{className:"float-end",children:g.jsxs(zh,{children:[g.jsx(Uu,{caret:!0,color:"link",className:"btn-sm p-0",children:"Group by"}),g.jsx($u,{end:!0,children:Object.entries(SA).map(([E,C])=>g.jsx(Ue,{active:o===E,onClick:()=>a(E),children:C},E))})]})}),g.jsx("div",{className:"float-end me-2",children:g.jsx(gu,{checked:s,onChange:l,children:g.jsx("small",{children:"Skip dates with no visits"})})})]}),g.jsxs(pu,{className:"line-chart-card__body",children:[n.length>0&&S(c),n.length===0&&S(d)]})]})},ube=({toggleClassName:e,ranges:t,value:n,setValue:r})=>g.jsxs(zh,{children:[g.jsx(Uu,{caret:!0,color:"link",className:e,children:"Paginate"}),g.jsxs($u,{end:!0,children:[t.map(i=>g.jsxs(Ue,{active:i===n,onClick:()=>r(i),children:[g.jsx("b",{children:i})," items per page"]},i)),g.jsx(Ue,{divider:!0}),g.jsx(Ue,{disabled:n===1/0,onClick:()=>r(1/0),children:g.jsx("i",{children:"Clear pagination"})})]})]}),dbe=e=>e.startsWith("hidden")?"":e,fbe=e=>!!e&&Object.keys(e).length>0,hbe=e=>e.length>20?e.length*10:void 0,pbe=(e,t,n)=>{const r={data:e,label:n?"Non-selected":"Visits",backgroundColor:pte,borderColor:OE,borderWidth:2};return t.every(i=>i===0)?[r]:[r,{label:n??"Selected",data:t,backgroundColor:mte,borderColor:WI,borderWidth:2}]},mbe=(e,t,n,r)=>({labels:e,datasets:pbe(t,n,r)}),gbe=(e,[t],n)=>{!n||!t||n(e[t.index])},vbe=({stats:e,highlightedStats:t,highlightedLabel:n,onClick:r,max:i})=>{const o=xo(e).map(dbe),a=fT(fbe(t)?xo(t).reduce((v,y)=>(v[y]&&(v[y]-=t[y]),v),{...e}):e),s=aO(t??{},o),l=$.useRef(null),c=$.useRef(null),d={plugins:{legend:{display:!1},tooltip:{mode:"y",filter:({label:v})=>v!=="",callbacks:{label:qF}}},scales:{x:{beginAtZero:!0,stacked:!0,max:i,ticks:{precision:0,callback:Sn}},y:{stacked:!0}},onHover:GF,indexAxis:"y"},f=mbe(o,a,s,n),p=hbe(o),m=(v,y)=>g.jsx(U1e,{ref:y,data:f,options:d,height:p,onClick:x=>gbe(o,YF(y.current,x),r)},`${p}_${v}`);return g.jsxs(g.Fragment,{children:[t!==void 0&&m("with_stats",l),t===void 0&&m("without_stats",c)]})},ybe=e=>Yv(e)==="String"?Pde(e):e,OA=([e])=>e,CA=([,e])=>e,Fm=({stats:e,highlightedStats:t,title:n,sortingItems:r,extraHeaderContent:i,withPagination:o=!0,...a})=>{const[s,l]=$.useState({}),[c,d]=$.useState(1),[f,p]=$.useState(50),m=(k,j)=>{const A=I3(k),U=s.field?Ode(Qn(s.field===Object.keys(j)[0]?OA:CA,ybe),A):A;return!s.dir||s.dir==="ASC"?U:Qx(U)},v=k=>{const j=k[c-1];if(c[`hidden_${U}`,0])]},y=k=>g.jsx(XT,{currentPage:c,pagesCount:k,setCurrentPage:d}),x=(k,j,A)=>{const U=m(k,j),N=U.map(OA),z=A&&I3({...Y5(N,N.map(()=>0)),...A});if(U.length<=f)return{currentPageStats:Cm(U),currentPageHighlightedStats:z&&Cm(z)};const W=gh(f,U),X=z&&gh(f,z);return{currentPageStats:Cm(v(W)),currentPageHighlightedStats:X&&Cm(v(X)),pagination:y(W.length),max:wme(Math.max(...U.map(CA)))}},{currentPageStats:_,currentPageHighlightedStats:w,pagination:S,max:E}=x(e,r,t&&Object.keys(t).length>0?t:void 0),C=Object.keys(_);return g.jsx(zF,{title:()=>g.jsxs(g.Fragment,{children:[n,g.jsx("div",{className:"float-end",children:g.jsx(Hh,{isButton:!1,right:!0,items:r,order:s,onChange:(k,j)=>{l({field:k,dir:j}),d(1)}})}),o&&Object.keys(e).length>50&&g.jsx("div",{className:"float-end",children:g.jsx(ube,{toggleClassName:"btn-sm p-0 me-3",ranges:[50,100,200,500],value:f,setValue:k=>{p(k),d(1)}})}),i&&g.jsx("div",{className:"float-end",children:i(S?C:void 0)})]}),footer:S,children:g.jsx(vbe,{stats:_,highlightedStats:w,max:E,...a})})},_be=()=>{const e=Eo(),{search:t}=yn(),{filtering:n,domain:r}=$.useMemo(Qn(()=>Dl(t),({startDate:i,endDate:o,orphanVisitsType:a,excludeBots:s,domain:l})=>({domain:l,filtering:{dateRange:i!=null||o!=null?E8(i,o):void 0,visitsFilter:{orphanVisitsType:a,excludeBots:$l(s)?void 0:s==="true"}}})),[t]);return[n,i=>{const{dateRange:o,visitsFilter:a}=_de(n,i),{excludeBots:s,orphanVisitsType:l}=a,c={startDate:(o==null?void 0:o.startDate)&&hs(o.startDate)||"",endDate:(o==null?void 0:o.endDate)&&hs(o.endDate)||"",excludeBots:s===void 0?void 0:P8(s),orphanVisitsType:l,domain:r},d=c0(c),f=ki(d)?"":`?${d}`;e(f,{replace:!0,relative:"route"})}]};function ZF(e,t){const n=$.useRef(t);$.useEffect(function(){t!==n.current&&e.attributionControl!=null&&(n.current!=null&&e.attributionControl.removeAttribution(n.current),t!=null&&e.attributionControl.addAttribution(t)),n.current=t},[e,t])}const bbe=1;function wbe(e){return Object.freeze({__version:bbe,map:e})}function xbe(e,t){return Object.freeze({...e,...t})}const QF=$.createContext(null),XF=QF.Provider;function JF(){const e=$.useContext(QF);if(e==null)throw new Error("No context provided: useLeafletContext() can only be used in a descendant of ");return e}function Sbe(e){function t(n,r){const{instance:i,context:o}=e(n).current;return $.useImperativeHandle(r,()=>i),n.children==null?null:Y.createElement(XF,{value:o},n.children)}return $.forwardRef(t)}function Ebe(e){function t(n,r){const[i,o]=$.useState(!1),{instance:a}=e(n,o).current;$.useImperativeHandle(r,()=>a),$.useEffect(function(){i&&a.update()},[a,i,n.children]);const s=a._contentNode;return s?jl.createPortal(n.children,s):null}return $.forwardRef(t)}function Tbe(e){function t(n,r){const{instance:i}=e(n).current;return $.useImperativeHandle(r,()=>i),null}return $.forwardRef(t)}function e$(e,t){const n=$.useRef();$.useEffect(function(){return t!=null&&e.instance.on(t),n.current=t,function(){n.current!=null&&e.instance.off(n.current),n.current=null}},[e,t])}function lO(e,t){const n=e.pane??t.pane;return n?{...e,pane:n}:e}function Obe(e,t){return function(n,r){const i=JF(),o=e(lO(n,i),i);return ZF(i.map,n.attribution),e$(o.current,n.eventHandlers),t(o.current,i,n,r),o}}var S2={exports:{}};/* @preserve * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade - */(function(e,t){(function(n,r){r(t)})(Dc,function(n){var r="1.9.4";function i(u){var h,b,T,P;for(b=1,T=arguments.length;b"u"||!L||!L.Mixin)){u=S(u)?u:[u];for(var h=0;h0?Math.floor(u):Math.ceil(u)};q.prototype={clone:function(){return new q(this.x,this.y)},add:function(u){return this.clone()._add(D(u))},_add:function(u){return this.x+=u.x,this.y+=u.y,this},subtract:function(u){return this.clone()._subtract(D(u))},_subtract:function(u){return this.x-=u.x,this.y-=u.y,this},divideBy:function(u){return this.clone()._divideBy(u)},_divideBy:function(u){return this.x/=u,this.y/=u,this},multiplyBy:function(u){return this.clone()._multiplyBy(u)},_multiplyBy:function(u){return this.x*=u,this.y*=u,this},scaleBy:function(u){return new q(this.x*u.x,this.y*u.y)},unscaleBy:function(u){return new q(this.x/u.x,this.y/u.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=I(this.x),this.y=I(this.y),this},distanceTo:function(u){u=D(u);var h=u.x-this.x,b=u.y-this.y;return Math.sqrt(h*h+b*b)},equals:function(u){return u=D(u),u.x===this.x&&u.y===this.y},contains:function(u){return u=D(u),Math.abs(u.x)<=Math.abs(this.x)&&Math.abs(u.y)<=Math.abs(this.y)},toString:function(){return"Point("+p(this.x)+", "+p(this.y)+")"}};function D(u,h,b){return u instanceof q?u:S(u)?new q(u[0],u[1]):u==null?u:typeof u=="object"&&"x"in u&&"y"in u?new q(u.x,u.y):new q(u,h,b)}function H(u,h){if(u)for(var b=h?[u,h]:u,T=0,P=b.length;T=this.min.x&&b.x<=this.max.x&&h.y>=this.min.y&&b.y<=this.max.y},intersects:function(u){u=ie(u);var h=this.min,b=this.max,T=u.min,P=u.max,B=P.x>=h.x&&T.x<=b.x,oe=P.y>=h.y&&T.y<=b.y;return B&&oe},overlaps:function(u){u=ie(u);var h=this.min,b=this.max,T=u.min,P=u.max,B=P.x>h.x&&T.xh.y&&T.y=h.lat&&P.lat<=b.lat&&T.lng>=h.lng&&P.lng<=b.lng},intersects:function(u){u=K(u);var h=this._southWest,b=this._northEast,T=u.getSouthWest(),P=u.getNorthEast(),B=P.lat>=h.lat&&T.lat<=b.lat,oe=P.lng>=h.lng&&T.lng<=b.lng;return B&&oe},overlaps:function(u){u=K(u);var h=this._southWest,b=this._northEast,T=u.getSouthWest(),P=u.getNorthEast(),B=P.lat>h.lat&&T.lath.lng&&T.lng1,nn=function(){var u=!1;try{var h=Object.defineProperty({},"passive",{get:function(){u=!0}});window.addEventListener("testPassiveEventSupport",f,h),window.removeEventListener("testPassiveEventSupport",f,h)}catch{}return u}(),fr=function(){return!!document.createElement("canvas").getContext}(),Vn=!!(document.createElementNS&&Me("svg").createSVGRect),Hn=!!Vn&&function(){var u=document.createElement("div");return u.innerHTML="",(u.firstChild&&u.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),_n=!Vn&&function(){try{var u=document.createElement("div");u.innerHTML='';var h=u.firstChild;return h.style.behavior="url(#default#VML)",h&&typeof h.adj=="object"}catch{return!1}}(),Pi=navigator.platform.indexOf("Mac")===0,Li=navigator.platform.indexOf("Linux")===0;function Wn(u){return navigator.userAgent.toLowerCase().indexOf(u)>=0}var ze={ie:_e,ielt9:Se,edge:ke,webkit:Ce,android:je,android23:ce,androidStock:ye,opera:ve,chrome:xe,gecko:Pe,safari:Ne,phantom:Qe,opera12:et,win:Ge,ie3d:Kt,webkit3d:Vt,gecko3d:On,any3d:dr,mobile:qi,mobileWebkit:zn,mobileWebkit3d:Zu,msPointer:Ki,pointer:dp,touch:hp,touchNative:fp,mobileOpera:Qu,mobileGecko:Es,retina:hn,passiveEvents:nn,canvas:fr,svg:Vn,vml:_n,inlineSvg:Hn,mac:Pi,linux:Li},bO=ze.msPointer?"MSPointerDown":"pointerdown",wO=ze.msPointer?"MSPointerMove":"pointermove",xO=ze.msPointer?"MSPointerUp":"pointerup",SO=ze.msPointer?"MSPointerCancel":"pointercancel",R0={touchstart:bO,touchmove:wO,touchend:xO,touchcancel:SO},EO={touchstart:W$,touchmove:pp,touchend:pp,touchcancel:pp},Yl={},TO=!1;function U$(u,h,b){return h==="touchstart"&&H$(),EO[h]?(b=EO[h].bind(this,b),u.addEventListener(R0[h],b,!1),b):(console.warn("wrong event specified:",h),f)}function B$(u,h,b){if(!R0[h]){console.warn("wrong event specified:",h);return}u.removeEventListener(R0[h],b,!1)}function z$(u){Yl[u.pointerId]=u}function V$(u){Yl[u.pointerId]&&(Yl[u.pointerId]=u)}function OO(u){delete Yl[u.pointerId]}function H$(){TO||(document.addEventListener(bO,z$,!0),document.addEventListener(wO,V$,!0),document.addEventListener(xO,OO,!0),document.addEventListener(SO,OO,!0),TO=!0)}function pp(u,h){if(h.pointerType!==(h.MSPOINTER_TYPE_MOUSE||"mouse")){h.touches=[];for(var b in Yl)h.touches.push(Yl[b]);h.changedTouches=[h],u(h)}}function W$(u,h){h.MSPOINTER_TYPE_TOUCH&&h.pointerType===h.MSPOINTER_TYPE_TOUCH&&Yn(h),pp(u,h)}function Y$(u){var h={},b,T;for(T in u)b=u[T],h[T]=b&&b.bind?b.bind(u):b;return u=h,h.type="dblclick",h.detail=2,h.isTrusted=!1,h._simulated=!0,h}var G$=200;function q$(u,h){u.addEventListener("dblclick",h);var b=0,T;function P(B){if(B.detail!==1){T=B.detail;return}if(!(B.pointerType==="mouse"||B.sourceCapabilities&&!B.sourceCapabilities.firesTouchEvents)){var oe=jO(B);if(!(oe.some(function(pe){return pe instanceof HTMLLabelElement&&pe.attributes.for})&&!oe.some(function(pe){return pe instanceof HTMLInputElement||pe instanceof HTMLSelectElement}))){var de=Date.now();de-b<=G$?(T++,T===2&&h(Y$(B))):T=1,b=de}}}return u.addEventListener("click",P),{dblclick:h,simDblclick:P}}function K$(u,h){u.removeEventListener("dblclick",h.dblclick),u.removeEventListener("click",h.simDblclick)}var N0=vp(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Xu=vp(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),CO=Xu==="webkitTransition"||Xu==="OTransition"?Xu+"End":"transitionend";function kO(u){return typeof u=="string"?document.getElementById(u):u}function Ju(u,h){var b=u.style[h]||u.currentStyle&&u.currentStyle[h];if((!b||b==="auto")&&document.defaultView){var T=document.defaultView.getComputedStyle(u,null);b=T?T[h]:null}return b==="auto"?null:b}function pt(u,h,b){var T=document.createElement(u);return T.className=h||"",b&&b.appendChild(T),T}function Ht(u){var h=u.parentNode;h&&h.removeChild(u)}function mp(u){for(;u.firstChild;)u.removeChild(u.firstChild)}function Gl(u){var h=u.parentNode;h&&h.lastChild!==u&&h.appendChild(u)}function ql(u){var h=u.parentNode;h&&h.firstChild!==u&&h.insertBefore(u,h.firstChild)}function D0(u,h){if(u.classList!==void 0)return u.classList.contains(h);var b=gp(u);return b.length>0&&new RegExp("(^|\\s)"+h+"(\\s|$)").test(b)}function Ze(u,h){if(u.classList!==void 0)for(var b=v(h),T=0,P=b.length;T0?2*window.devicePixelRatio:1;function AO(u){return ze.edge?u.wheelDeltaY/2:u.deltaY&&u.deltaMode===0?-u.deltaY/X$:u.deltaY&&u.deltaMode===1?-u.deltaY*20:u.deltaY&&u.deltaMode===2?-u.deltaY*60:u.deltaX||u.deltaZ?0:u.wheelDelta?(u.wheelDeltaY||u.wheelDelta)/2:u.detail&&Math.abs(u.detail)<32765?-u.detail*20:u.detail?u.detail/-32765*60:0}function q0(u,h){var b=h.relatedTarget;if(!b)return!0;try{for(;b&&b!==u;)b=b.parentNode}catch{return!1}return b!==u}var J$={__proto__:null,on:qe,off:Ct,stopPropagation:Cs,disableScrollPropagation:G0,disableClickPropagation:rd,preventDefault:Yn,stop:ks,getPropagationPath:jO,getMousePosition:MO,getWheelDelta:AO,isExternalTarget:q0,addListener:qe,removeListener:Ct},RO=le.extend({run:function(u,h,b,T){this.stop(),this._el=u,this._inProgress=!0,this._duration=b||.25,this._easeOutPower=1/Math.max(T||.5,.2),this._startPos=Os(u),this._offset=h.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=z(this._animate,this),this._step()},_step:function(u){var h=+new Date-this._startTime,b=this._duration*1e3;hthis.options.maxZoom)?this.setZoom(u):this},panInsideBounds:function(u,h){this._enforcingBounds=!0;var b=this.getCenter(),T=this._limitCenter(b,this._zoom,K(u));return b.equals(T)||this.panTo(T,h),this._enforcingBounds=!1,this},panInside:function(u,h){h=h||{};var b=D(h.paddingTopLeft||h.padding||[0,0]),T=D(h.paddingBottomRight||h.padding||[0,0]),P=this.project(this.getCenter()),B=this.project(u),oe=this.getPixelBounds(),de=ie([oe.min.add(b),oe.max.subtract(T)]),pe=de.getSize();if(!de.contains(B)){this._enforcingBounds=!0;var we=B.subtract(de.getCenter()),De=de.extend(B).getSize().subtract(pe);P.x+=we.x<0?-De.x:De.x,P.y+=we.y<0?-De.y:De.y,this.panTo(this.unproject(P),h),this._enforcingBounds=!1}return this},invalidateSize:function(u){if(!this._loaded)return this;u=i({animate:!1,pan:!0},u===!0?{animate:!0}:u);var h=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var b=this.getSize(),T=h.divideBy(2).round(),P=b.divideBy(2).round(),B=T.subtract(P);return!B.x&&!B.y?this:(u.animate&&u.pan?this.panBy(B):(u.pan&&this._rawPanBy(B),this.fire("move"),u.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:h,newSize:b}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(u){if(u=this._locateOptions=i({timeout:1e4,watch:!1},u),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var h=a(this._handleGeolocationResponse,this),b=a(this._handleGeolocationError,this);return u.watch?this._locationWatchId=navigator.geolocation.watchPosition(h,b,u):navigator.geolocation.getCurrentPosition(h,b,u),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(u){if(this._container._leaflet_id){var h=u.code,b=u.message||(h===1?"permission denied":h===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:h,message:"Geolocation error: "+b+"."})}},_handleGeolocationResponse:function(u){if(this._container._leaflet_id){var h=u.coords.latitude,b=u.coords.longitude,T=new re(h,b),P=T.toBounds(u.coords.accuracy*2),B=this._locateOptions;if(B.setView){var oe=this.getBoundsZoom(P);this.setView(T,B.maxZoom?Math.min(oe,B.maxZoom):oe)}var de={latlng:T,bounds:P,timestamp:u.timestamp};for(var pe in u.coords)typeof u.coords[pe]=="number"&&(de[pe]=u.coords[pe]);this.fire("locationfound",de)}},addHandler:function(u,h){if(!h)return this;var b=this[u]=new h(this);return this._handlers.push(b),this.options[u]&&b.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Ht(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(W(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var u;for(u in this._layers)this._layers[u].remove();for(u in this._panes)Ht(this._panes[u]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(u,h){var b="leaflet-pane"+(u?" leaflet-"+u.replace("Pane","")+"-pane":""),T=pt("div",b,h||this._mapPane);return u&&(this._panes[u]=T),T},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var u=this.getPixelBounds(),h=this.unproject(u.getBottomLeft()),b=this.unproject(u.getTopRight());return new V(h,b)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(u,h,b){u=K(u),b=D(b||[0,0]);var T=this.getZoom()||0,P=this.getMinZoom(),B=this.getMaxZoom(),oe=u.getNorthWest(),de=u.getSouthEast(),pe=this.getSize().subtract(b),we=ie(this.project(de,T),this.project(oe,T)).getSize(),De=ze.any3d?this.options.zoomSnap:1,We=pe.x/we.x,Xe=pe.y/we.y,hr=h?Math.max(We,Xe):Math.min(We,Xe);return T=this.getScaleZoom(hr,T),De&&(T=Math.round(T/(De/100))*(De/100),T=h?Math.ceil(T/De)*De:Math.floor(T/De)*De),Math.max(P,Math.min(B,T))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new q(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(u,h){var b=this._getTopLeftPoint(u,h);return new H(b,b.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(u){return this.options.crs.getProjectedBounds(u===void 0?this.getZoom():u)},getPane:function(u){return typeof u=="string"?this._panes[u]:u},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(u,h){var b=this.options.crs;return h=h===void 0?this._zoom:h,b.scale(u)/b.scale(h)},getScaleZoom:function(u,h){var b=this.options.crs;h=h===void 0?this._zoom:h;var T=b.zoom(u*b.scale(h));return isNaN(T)?1/0:T},project:function(u,h){return h=h===void 0?this._zoom:h,this.options.crs.latLngToPoint(ae(u),h)},unproject:function(u,h){return h=h===void 0?this._zoom:h,this.options.crs.pointToLatLng(D(u),h)},layerPointToLatLng:function(u){var h=D(u).add(this.getPixelOrigin());return this.unproject(h)},latLngToLayerPoint:function(u){var h=this.project(ae(u))._round();return h._subtract(this.getPixelOrigin())},wrapLatLng:function(u){return this.options.crs.wrapLatLng(ae(u))},wrapLatLngBounds:function(u){return this.options.crs.wrapLatLngBounds(K(u))},distance:function(u,h){return this.options.crs.distance(ae(u),ae(h))},containerPointToLayerPoint:function(u){return D(u).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(u){return D(u).add(this._getMapPanePos())},containerPointToLatLng:function(u){var h=this.containerPointToLayerPoint(D(u));return this.layerPointToLatLng(h)},latLngToContainerPoint:function(u){return this.layerPointToContainerPoint(this.latLngToLayerPoint(ae(u)))},mouseEventToContainerPoint:function(u){return MO(u,this._container)},mouseEventToLayerPoint:function(u){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(u))},mouseEventToLatLng:function(u){return this.layerPointToLatLng(this.mouseEventToLayerPoint(u))},_initContainer:function(u){var h=this._container=kO(u);if(h){if(h._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");qe(h,"scroll",this._onScroll,this),this._containerId=l(h)},_initLayout:function(){var u=this._container;this._fadeAnimated=this.options.fadeAnimation&&ze.any3d,Ze(u,"leaflet-container"+(ze.touch?" leaflet-touch":"")+(ze.retina?" leaflet-retina":"")+(ze.ielt9?" leaflet-oldie":"")+(ze.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var h=Ju(u,"position");h!=="absolute"&&h!=="relative"&&h!=="fixed"&&h!=="sticky"&&(u.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var u=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),pn(this._mapPane,new q(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Ze(u.markerPane,"leaflet-zoom-hide"),Ze(u.shadowPane,"leaflet-zoom-hide"))},_resetView:function(u,h,b){pn(this._mapPane,new q(0,0));var T=!this._loaded;this._loaded=!0,h=this._limitZoom(h),this.fire("viewprereset");var P=this._zoom!==h;this._moveStart(P,b)._move(u,h)._moveEnd(P),this.fire("viewreset"),T&&this.fire("load")},_moveStart:function(u,h){return u&&this.fire("zoomstart"),h||this.fire("movestart"),this},_move:function(u,h,b,T){h===void 0&&(h=this._zoom);var P=this._zoom!==h;return this._zoom=h,this._lastCenter=u,this._pixelOrigin=this._getNewPixelOrigin(u),T?b&&b.pinch&&this.fire("zoom",b):((P||b&&b.pinch)&&this.fire("zoom",b),this.fire("move",b)),this},_moveEnd:function(u){return u&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return W(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(u){pn(this._mapPane,this._getMapPanePos().subtract(u))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(u){this._targets={},this._targets[l(this._container)]=this;var h=u?Ct:qe;h(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&h(window,"resize",this._onResize,this),ze.any3d&&this.options.transform3DLimit&&(u?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){W(this._resizeRequest),this._resizeRequest=z(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var u=this._getMapPanePos();Math.max(Math.abs(u.x),Math.abs(u.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(u,h){for(var b=[],T,P=h==="mouseout"||h==="mouseover",B=u.target||u.srcElement,oe=!1;B;){if(T=this._targets[l(B)],T&&(h==="click"||h==="preclick")&&this._draggableMoved(T)){oe=!0;break}if(T&&T.listens(h,!0)&&(P&&!q0(B,u)||(b.push(T),P))||B===this._container)break;B=B.parentNode}return!b.length&&!oe&&!P&&this.listens(h,!0)&&(b=[this]),b},_isClickDisabled:function(u){for(;u&&u!==this._container;){if(u._leaflet_disable_click)return!0;u=u.parentNode}},_handleDOMEvent:function(u){var h=u.target||u.srcElement;if(!(!this._loaded||h._leaflet_disable_events||u.type==="click"&&this._isClickDisabled(h))){var b=u.type;b==="mousedown"&&z0(h),this._fireDOMEvent(u,b)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(u,h,b){if(u.type==="click"){var T=i({},u);T.type="preclick",this._fireDOMEvent(T,T.type,b)}var P=this._findEventTargets(u,h);if(b){for(var B=[],oe=0;oe0?Math.round(u-h)/2:Math.max(0,Math.ceil(u))-Math.max(0,Math.floor(h))},_limitZoom:function(u){var h=this.getMinZoom(),b=this.getMaxZoom(),T=ze.any3d?this.options.zoomSnap:1;return T&&(u=Math.round(u/T)*T),Math.max(h,Math.min(b,u))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){rn(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(u,h){var b=this._getCenterOffset(u)._trunc();return(h&&h.animate)!==!0&&!this.getSize().contains(b)?!1:(this.panBy(b,h),!0)},_createAnimProxy:function(){var u=this._proxy=pt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(u),this.on("zoomanim",function(h){var b=N0,T=this._proxy.style[b];Ts(this._proxy,this.project(h.center,h.zoom),this.getZoomScale(h.zoom,1)),T===this._proxy.style[b]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Ht(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var u=this.getCenter(),h=this.getZoom();Ts(this._proxy,this.project(u,h),this.getZoomScale(h,1))},_catchTransitionEnd:function(u){this._animatingZoom&&u.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(u,h,b){if(this._animatingZoom)return!0;if(b=b||{},!this._zoomAnimated||b.animate===!1||this._nothingToAnimate()||Math.abs(h-this._zoom)>this.options.zoomAnimationThreshold)return!1;var T=this.getZoomScale(h),P=this._getCenterOffset(u)._divideBy(1-1/T);return b.animate!==!0&&!this.getSize().contains(P)?!1:(z(function(){this._moveStart(!0,b.noMoveStart||!1)._animateZoom(u,h,!0)},this),!0)},_animateZoom:function(u,h,b,T){this._mapPane&&(b&&(this._animatingZoom=!0,this._animateToCenter=u,this._animateToZoom=h,Ze(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:u,zoom:h,noUpdate:T}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&rn(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function eU(u,h){return new ct(u,h)}var ji=G.extend({options:{position:"topright"},initialize:function(u){y(this,u)},getPosition:function(){return this.options.position},setPosition:function(u){var h=this._map;return h&&h.removeControl(this),this.options.position=u,h&&h.addControl(this),this},getContainer:function(){return this._container},addTo:function(u){this.remove(),this._map=u;var h=this._container=this.onAdd(u),b=this.getPosition(),T=u._controlCorners[b];return Ze(h,"leaflet-control"),b.indexOf("bottom")!==-1?T.insertBefore(h,T.firstChild):T.appendChild(h),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Ht(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(u){this._map&&u&&u.screenX>0&&u.screenY>0&&this._map.getContainer().focus()}}),id=function(u){return new ji(u)};ct.include({addControl:function(u){return u.addTo(this),this},removeControl:function(u){return u.remove(),this},_initControlPos:function(){var u=this._controlCorners={},h="leaflet-",b=this._controlContainer=pt("div",h+"control-container",this._container);function T(P,B){var oe=h+P+" "+h+B;u[P+B]=pt("div",oe,b)}T("top","left"),T("top","right"),T("bottom","left"),T("bottom","right")},_clearControlPos:function(){for(var u in this._controlCorners)Ht(this._controlCorners[u]);Ht(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var NO=ji.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(u,h,b,T){return b1,this._baseLayersList.style.display=u?"":"none"),this._separator.style.display=h&&u?"":"none",this},_onLayerChange:function(u){this._handlingClick||this._update();var h=this._getLayer(l(u.target)),b=h.overlay?u.type==="add"?"overlayadd":"overlayremove":u.type==="add"?"baselayerchange":null;b&&this._map.fire(b,h)},_createRadioElement:function(u,h){var b='",T=document.createElement("div");return T.innerHTML=b,T.firstChild},_addItem:function(u){var h=document.createElement("label"),b=this._map.hasLayer(u.layer),T;u.overlay?(T=document.createElement("input"),T.type="checkbox",T.className="leaflet-control-layers-selector",T.defaultChecked=b):T=this._createRadioElement("leaflet-base-layers_"+l(this),b),this._layerControlInputs.push(T),T.layerId=l(u.layer),qe(T,"click",this._onInputClick,this);var P=document.createElement("span");P.innerHTML=" "+u.name;var B=document.createElement("span");h.appendChild(B),B.appendChild(T),B.appendChild(P);var oe=u.overlay?this._overlaysList:this._baseLayersList;return oe.appendChild(h),this._checkDisabledLayers(),h},_onInputClick:function(){if(!this._preventClick){var u=this._layerControlInputs,h,b,T=[],P=[];this._handlingClick=!0;for(var B=u.length-1;B>=0;B--)h=u[B],b=this._getLayer(h.layerId).layer,h.checked?T.push(b):h.checked||P.push(b);for(B=0;B=0;P--)h=u[P],b=this._getLayer(h.layerId).layer,h.disabled=b.options.minZoom!==void 0&&Tb.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var u=this._section;this._preventClick=!0,qe(u,"click",Yn),this.expand();var h=this;setTimeout(function(){Ct(u,"click",Yn),h._preventClick=!1})}}),tU=function(u,h,b){return new NO(u,h,b)},K0=ji.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(u){var h="leaflet-control-zoom",b=pt("div",h+" leaflet-bar"),T=this.options;return this._zoomInButton=this._createButton(T.zoomInText,T.zoomInTitle,h+"-in",b,this._zoomIn),this._zoomOutButton=this._createButton(T.zoomOutText,T.zoomOutTitle,h+"-out",b,this._zoomOut),this._updateDisabled(),u.on("zoomend zoomlevelschange",this._updateDisabled,this),b},onRemove:function(u){u.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(u){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(u.shiftKey?3:1))},_createButton:function(u,h,b,T,P){var B=pt("a",b,T);return B.innerHTML=u,B.href="#",B.title=h,B.setAttribute("role","button"),B.setAttribute("aria-label",h),rd(B),qe(B,"click",ks),qe(B,"click",P,this),qe(B,"click",this._refocusOnMap,this),B},_updateDisabled:function(){var u=this._map,h="leaflet-disabled";rn(this._zoomInButton,h),rn(this._zoomOutButton,h),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||u._zoom===u.getMinZoom())&&(Ze(this._zoomOutButton,h),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||u._zoom===u.getMaxZoom())&&(Ze(this._zoomInButton,h),this._zoomInButton.setAttribute("aria-disabled","true"))}});ct.mergeOptions({zoomControl:!0}),ct.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new K0,this.addControl(this.zoomControl))});var nU=function(u){return new K0(u)},DO=ji.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(u){var h="leaflet-control-scale",b=pt("div",h),T=this.options;return this._addScales(T,h+"-line",b),u.on(T.updateWhenIdle?"moveend":"move",this._update,this),u.whenReady(this._update,this),b},onRemove:function(u){u.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(u,h,b){u.metric&&(this._mScale=pt("div",h,b)),u.imperial&&(this._iScale=pt("div",h,b))},_update:function(){var u=this._map,h=u.getSize().y/2,b=u.distance(u.containerPointToLatLng([0,h]),u.containerPointToLatLng([this.options.maxWidth,h]));this._updateScales(b)},_updateScales:function(u){this.options.metric&&u&&this._updateMetric(u),this.options.imperial&&u&&this._updateImperial(u)},_updateMetric:function(u){var h=this._getRoundNum(u),b=h<1e3?h+" m":h/1e3+" km";this._updateScale(this._mScale,b,h/u)},_updateImperial:function(u){var h=u*3.2808399,b,T,P;h>5280?(b=h/5280,T=this._getRoundNum(b),this._updateScale(this._iScale,T+" mi",T/b)):(P=this._getRoundNum(h),this._updateScale(this._iScale,P+" ft",P/h))},_updateScale:function(u,h,b){u.style.width=Math.round(this.options.maxWidth*b)+"px",u.innerHTML=h},_getRoundNum:function(u){var h=Math.pow(10,(Math.floor(u)+"").length-1),b=u/h;return b=b>=10?10:b>=5?5:b>=3?3:b>=2?2:1,h*b}}),rU=function(u){return new DO(u)},iU='',Z0=ji.extend({options:{position:"bottomright",prefix:''+(ze.inlineSvg?iU+" ":"")+"Leaflet"},initialize:function(u){y(this,u),this._attributions={}},onAdd:function(u){u.attributionControl=this,this._container=pt("div","leaflet-control-attribution"),rd(this._container);for(var h in u._layers)u._layers[h].getAttribution&&this.addAttribution(u._layers[h].getAttribution());return this._update(),u.on("layeradd",this._addAttribution,this),this._container},onRemove:function(u){u.off("layeradd",this._addAttribution,this)},_addAttribution:function(u){u.layer.getAttribution&&(this.addAttribution(u.layer.getAttribution()),u.layer.once("remove",function(){this.removeAttribution(u.layer.getAttribution())},this))},setPrefix:function(u){return this.options.prefix=u,this._update(),this},addAttribution:function(u){return u?(this._attributions[u]||(this._attributions[u]=0),this._attributions[u]++,this._update(),this):this},removeAttribution:function(u){return u?(this._attributions[u]&&(this._attributions[u]--,this._update()),this):this},_update:function(){if(this._map){var u=[];for(var h in this._attributions)this._attributions[h]&&u.push(h);var b=[];this.options.prefix&&b.push(this.options.prefix),u.length&&b.push(u.join(", ")),this._container.innerHTML=b.join(' ')}}});ct.mergeOptions({attributionControl:!0}),ct.addInitHook(function(){this.options.attributionControl&&new Z0().addTo(this)});var oU=function(u){return new Z0(u)};ji.Layers=NO,ji.Zoom=K0,ji.Scale=DO,ji.Attribution=Z0,id.layers=tU,id.zoom=nU,id.scale=rU,id.attribution=oU;var Qi=G.extend({initialize:function(u){this._map=u},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Qi.addTo=function(u,h){return u.addHandler(h,this),this};var aU={Events:te},IO=ze.touch?"touchstart mousedown":"mousedown",ga=le.extend({options:{clickTolerance:3},initialize:function(u,h,b,T){y(this,T),this._element=u,this._dragStartTarget=h||u,this._preventOutline=b},enable:function(){this._enabled||(qe(this._dragStartTarget,IO,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ga._dragging===this&&this.finishDrag(!0),Ct(this._dragStartTarget,IO,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(u){if(this._enabled&&(this._moved=!1,!D0(this._element,"leaflet-zoom-anim"))){if(u.touches&&u.touches.length!==1){ga._dragging===this&&this.finishDrag();return}if(!(ga._dragging||u.shiftKey||u.which!==1&&u.button!==1&&!u.touches)&&(ga._dragging=this,this._preventOutline&&z0(this._element),$0(),ed(),!this._moving)){this.fire("down");var h=u.touches?u.touches[0]:u,b=PO(this._element);this._startPoint=new q(h.clientX,h.clientY),this._startPos=Os(this._element),this._parentScale=V0(b);var T=u.type==="mousedown";qe(document,T?"mousemove":"touchmove",this._onMove,this),qe(document,T?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(u){if(this._enabled){if(u.touches&&u.touches.length>1){this._moved=!0;return}var h=u.touches&&u.touches.length===1?u.touches[0]:u,b=new q(h.clientX,h.clientY)._subtract(this._startPoint);!b.x&&!b.y||Math.abs(b.x)+Math.abs(b.y)B&&(oe=de,B=pe);B>b&&(h[oe]=1,X0(u,h,b,T,oe),X0(u,h,b,oe,P))}function uU(u,h){for(var b=[u[0]],T=1,P=0,B=u.length;Th&&(b.push(u[T]),P=T);return Ph.max.x&&(b|=2),u.yh.max.y&&(b|=8),b}function dU(u,h){var b=h.x-u.x,T=h.y-u.y;return b*b+T*T}function od(u,h,b,T){var P=h.x,B=h.y,oe=b.x-P,de=b.y-B,pe=oe*oe+de*de,we;return pe>0&&(we=((u.x-P)*oe+(u.y-B)*de)/pe,we>1?(P=b.x,B=b.y):we>0&&(P+=oe*we,B+=de*we)),oe=u.x-P,de=u.y-B,T?oe*oe+de*de:new q(P,B)}function oi(u){return!S(u[0])||typeof u[0][0]!="object"&&typeof u[0][0]<"u"}function HO(u){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),oi(u)}function WO(u,h){var b,T,P,B,oe,de,pe,we;if(!u||u.length===0)throw new Error("latlngs not passed");oi(u)||(console.warn("latlngs are not flat! Only the first ring will be used"),u=u[0]);var De=ae([0,0]),We=K(u),Xe=We.getNorthWest().distanceTo(We.getSouthWest())*We.getNorthEast().distanceTo(We.getNorthWest());Xe<1700&&(De=Q0(u));var hr=u.length,Cn=[];for(b=0;bT){pe=(B-T)/P,we=[de.x-pe*(de.x-oe.x),de.y-pe*(de.y-oe.y)];break}var Sr=h.unproject(D(we));return ae([Sr.lat+De.lat,Sr.lng+De.lng])}var fU={__proto__:null,simplify:UO,pointToSegmentDistance:BO,closestPointOnSegment:lU,clipSegment:VO,_getEdgeIntersection:bp,_getBitCode:Ps,_sqClosestPointOnSegment:od,isFlat:oi,_flat:HO,polylineCenter:WO},J0={project:function(u){return new q(u.lng,u.lat)},unproject:function(u){return new re(u.y,u.x)},bounds:new H([-180,-90],[180,90])},e_={R:6378137,R_MINOR:6356752314245179e-9,bounds:new H([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(u){var h=Math.PI/180,b=this.R,T=u.lat*h,P=this.R_MINOR/b,B=Math.sqrt(1-P*P),oe=B*Math.sin(T),de=Math.tan(Math.PI/4-T/2)/Math.pow((1-oe)/(1+oe),B/2);return T=-b*Math.log(Math.max(de,1e-10)),new q(u.lng*h*b,T)},unproject:function(u){for(var h=180/Math.PI,b=this.R,T=this.R_MINOR/b,P=Math.sqrt(1-T*T),B=Math.exp(-u.y/b),oe=Math.PI/2-2*Math.atan(B),de=0,pe=.1,we;de<15&&Math.abs(pe)>1e-7;de++)we=P*Math.sin(oe),we=Math.pow((1-we)/(1+we),P/2),pe=Math.PI/2-2*Math.atan(B*we)-oe,oe+=pe;return new re(oe*h,u.x*h/b)}},hU={__proto__:null,LonLat:J0,Mercator:e_,SphericalMercator:F},pU=i({},O,{code:"EPSG:3395",projection:e_,transformation:function(){var u=.5/(Math.PI*e_.R);return J(u,.5,-u,.5)}()}),YO=i({},O,{code:"EPSG:4326",projection:J0,transformation:J(1/180,1,-1/180,.5)}),mU=i({},he,{projection:J0,transformation:J(1,0,-1,0),scale:function(u){return Math.pow(2,u)},zoom:function(u){return Math.log(u)/Math.LN2},distance:function(u,h){var b=h.lng-u.lng,T=h.lat-u.lat;return Math.sqrt(b*b+T*T)},infinite:!0});he.Earth=O,he.EPSG3395=pU,he.EPSG3857=se,he.EPSG900913=ge,he.EPSG4326=YO,he.Simple=mU;var Mi=le.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(u){return u.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(u){return u&&u.removeLayer(this),this},getPane:function(u){return this._map.getPane(u?this.options[u]||u:this.options.pane)},addInteractiveTarget:function(u){return this._map._targets[l(u)]=this,this},removeInteractiveTarget:function(u){return delete this._map._targets[l(u)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(u){var h=u.target;if(h.hasLayer(this)){if(this._map=h,this._zoomAnimated=h._zoomAnimated,this.getEvents){var b=this.getEvents();h.on(b,this),this.once("remove",function(){h.off(b,this)},this)}this.onAdd(h),this.fire("add"),h.fire("layeradd",{layer:this})}}});ct.include({addLayer:function(u){if(!u._layerAdd)throw new Error("The provided object is not a Layer.");var h=l(u);return this._layers[h]?this:(this._layers[h]=u,u._mapToAdd=this,u.beforeAdd&&u.beforeAdd(this),this.whenReady(u._layerAdd,u),this)},removeLayer:function(u){var h=l(u);return this._layers[h]?(this._loaded&&u.onRemove(this),delete this._layers[h],this._loaded&&(this.fire("layerremove",{layer:u}),u.fire("remove")),u._map=u._mapToAdd=null,this):this},hasLayer:function(u){return l(u)in this._layers},eachLayer:function(u,h){for(var b in this._layers)u.call(h,this._layers[b]);return this},_addLayers:function(u){u=u?S(u)?u:[u]:[];for(var h=0,b=u.length;hthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&h[0]instanceof re&&h[0].equals(h[b-1])&&h.pop(),h},_setLatLngs:function(u){ko.prototype._setLatLngs.call(this,u),oi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return oi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var u=this._renderer._bounds,h=this.options.weight,b=new q(h,h);if(u=new H(u.min.subtract(b),u.max.add(b)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(u))){if(this.options.noClip){this._parts=this._rings;return}for(var T=0,P=this._rings.length,B;Tu.y!=P.y>u.y&&u.x<(P.x-T.x)*(u.y-T.y)/(P.y-T.y)+T.x&&(h=!h);return h||ko.prototype._containsPoint.call(this,u,!0)}});function SU(u,h){return new Ql(u,h)}var Po=Co.extend({initialize:function(u,h){y(this,h),this._layers={},u&&this.addData(u)},addData:function(u){var h=S(u)?u:u.features,b,T,P;if(h){for(b=0,T=h.length;b0&&P.push(P[0].slice()),P}function Xl(u,h){return u.feature?i({},u.feature,{geometry:h}):Op(h)}function Op(u){return u.type==="Feature"||u.type==="FeatureCollection"?u:{type:"Feature",properties:{},geometry:u}}var i_={toGeoJSON:function(u){return Xl(this,{type:"Point",coordinates:r_(this.getLatLng(),u)})}};wp.include(i_),t_.include(i_),xp.include(i_),ko.include({toGeoJSON:function(u){var h=!oi(this._latlngs),b=Tp(this._latlngs,h?1:0,!1,u);return Xl(this,{type:(h?"Multi":"")+"LineString",coordinates:b})}}),Ql.include({toGeoJSON:function(u){var h=!oi(this._latlngs),b=h&&!oi(this._latlngs[0]),T=Tp(this._latlngs,b?2:h?1:0,!0,u);return h||(T=[T]),Xl(this,{type:(b?"Multi":"")+"Polygon",coordinates:T})}}),Kl.include({toMultiPoint:function(u){var h=[];return this.eachLayer(function(b){h.push(b.toGeoJSON(u).geometry.coordinates)}),Xl(this,{type:"MultiPoint",coordinates:h})},toGeoJSON:function(u){var h=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(h==="MultiPoint")return this.toMultiPoint(u);var b=h==="GeometryCollection",T=[];return this.eachLayer(function(P){if(P.toGeoJSON){var B=P.toGeoJSON(u);if(b)T.push(B.geometry);else{var oe=Op(B);oe.type==="FeatureCollection"?T.push.apply(T,oe.features):T.push(oe)}}}),b?Xl(this,{geometries:T,type:"GeometryCollection"}):{type:"FeatureCollection",features:T}}});function KO(u,h){return new Po(u,h)}var EU=KO,Cp=Mi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(u,h,b){this._url=u,this._bounds=K(h),y(this,b)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Ze(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Ht(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(u){return this.options.opacity=u,this._image&&this._updateOpacity(),this},setStyle:function(u){return u.opacity&&this.setOpacity(u.opacity),this},bringToFront:function(){return this._map&&Gl(this._image),this},bringToBack:function(){return this._map&&ql(this._image),this},setUrl:function(u){return this._url=u,this._image&&(this._image.src=u),this},setBounds:function(u){return this._bounds=K(u),this._map&&this._reset(),this},getEvents:function(){var u={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(u.zoomanim=this._animateZoom),u},setZIndex:function(u){return this.options.zIndex=u,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var u=this._url.tagName==="IMG",h=this._image=u?this._url:pt("img");if(Ze(h,"leaflet-image-layer"),this._zoomAnimated&&Ze(h,"leaflet-zoom-animated"),this.options.className&&Ze(h,this.options.className),h.onselectstart=f,h.onmousemove=f,h.onload=a(this.fire,this,"load"),h.onerror=a(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(h.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),u){this._url=h.src;return}h.src=this._url,h.alt=this.options.alt},_animateZoom:function(u){var h=this._map.getZoomScale(u.zoom),b=this._map._latLngBoundsToNewLayerBounds(this._bounds,u.zoom,u.center).min;Ts(this._image,b,h)},_reset:function(){var u=this._image,h=new H(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),b=h.getSize();pn(u,h.min),u.style.width=b.x+"px",u.style.height=b.y+"px"},_updateOpacity:function(){ii(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var u=this.options.errorOverlayUrl;u&&this._url!==u&&(this._url=u,this._image.src=u)},getCenter:function(){return this._bounds.getCenter()}}),TU=function(u,h,b){return new Cp(u,h,b)},ZO=Cp.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var u=this._url.tagName==="VIDEO",h=this._image=u?this._url:pt("video");if(Ze(h,"leaflet-image-layer"),this._zoomAnimated&&Ze(h,"leaflet-zoom-animated"),this.options.className&&Ze(h,this.options.className),h.onselectstart=f,h.onmousemove=f,h.onloadeddata=a(this.fire,this,"load"),u){for(var b=h.getElementsByTagName("source"),T=[],P=0;P0?T:[h.src];return}S(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(h.style,"objectFit")&&(h.style.objectFit="fill"),h.autoplay=!!this.options.autoplay,h.loop=!!this.options.loop,h.muted=!!this.options.muted,h.playsInline=!!this.options.playsInline;for(var B=0;BP?(h.height=P+"px",Ze(u,B)):rn(u,B),this._containerWidth=this._container.offsetWidth},_animateZoom:function(u){var h=this._map._latLngToNewLayerPoint(this._latlng,u.zoom,u.center),b=this._getAnchor();pn(this._container,h.add(b))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var u=this._map,h=parseInt(Ju(this._container,"marginBottom"),10)||0,b=this._container.offsetHeight+h,T=this._containerWidth,P=new q(this._containerLeft,-b-this._containerBottom);P._add(Os(this._container));var B=u.layerPointToContainerPoint(P),oe=D(this.options.autoPanPadding),de=D(this.options.autoPanPaddingTopLeft||oe),pe=D(this.options.autoPanPaddingBottomRight||oe),we=u.getSize(),De=0,We=0;B.x+T+pe.x>we.x&&(De=B.x+T-we.x+pe.x),B.x-De-de.x<0&&(De=B.x-de.x),B.y+b+pe.y>we.y&&(We=B.y+b-we.y+pe.y),B.y-We-de.y<0&&(We=B.y-de.y),(De||We)&&(this.options.keepInView&&(this._autopanning=!0),u.fire("autopanstart").panBy([De,We]))}},_getAnchor:function(){return D(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),kU=function(u,h){return new kp(u,h)};ct.mergeOptions({closePopupOnClick:!0}),ct.include({openPopup:function(u,h,b){return this._initOverlay(kp,u,h,b).openOn(this),this},closePopup:function(u){return u=arguments.length?u:this._popup,u&&u.close(),this}}),Mi.include({bindPopup:function(u,h){return this._popup=this._initOverlay(kp,this._popup,u,h),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(u){return this._popup&&(this instanceof Co||(this._popup._source=this),this._popup._prepareOpen(u||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(u){return this._popup&&this._popup.setContent(u),this},getPopup:function(){return this._popup},_openPopup:function(u){if(!(!this._popup||!this._map)){ks(u);var h=u.layer||u.target;if(this._popup._source===h&&!(h instanceof va)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(u.latlng);return}this._popup._source=h,this.openPopup(u.latlng)}},_movePopup:function(u){this._popup.setLatLng(u.latlng)},_onKeyPress:function(u){u.originalEvent.keyCode===13&&this._openPopup(u)}});var Pp=Xi.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(u){Xi.prototype.onAdd.call(this,u),this.setOpacity(this.options.opacity),u.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(u){Xi.prototype.onRemove.call(this,u),u.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var u=Xi.prototype.getEvents.call(this);return this.options.permanent||(u.preclick=this.close),u},_initLayout:function(){var u="leaflet-tooltip",h=u+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=pt("div",h),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+l(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(u){var h,b,T=this._map,P=this._container,B=T.latLngToContainerPoint(T.getCenter()),oe=T.layerPointToContainerPoint(u),de=this.options.direction,pe=P.offsetWidth,we=P.offsetHeight,De=D(this.options.offset),We=this._getAnchor();de==="top"?(h=pe/2,b=we):de==="bottom"?(h=pe/2,b=0):de==="center"?(h=pe/2,b=we/2):de==="right"?(h=0,b=we/2):de==="left"?(h=pe,b=we/2):oe.xthis.options.maxZoom||bT?this._retainParent(P,B,oe,T):!1)},_retainChildren:function(u,h,b,T){for(var P=2*u;P<2*u+2;P++)for(var B=2*h;B<2*h+2;B++){var oe=new q(P,B);oe.z=b+1;var de=this._tileCoordsToKey(oe),pe=this._tiles[de];if(pe&&pe.active){pe.retain=!0;continue}else pe&&pe.loaded&&(pe.retain=!0);b+1this.options.maxZoom||this.options.minZoom!==void 0&&P1){this._setView(u,b);return}for(var We=P.min.y;We<=P.max.y;We++)for(var Xe=P.min.x;Xe<=P.max.x;Xe++){var hr=new q(Xe,We);if(hr.z=this._tileZoom,!!this._isValidTile(hr)){var Cn=this._tiles[this._tileCoordsToKey(hr)];Cn?Cn.current=!0:oe.push(hr)}}if(oe.sort(function(Sr,ec){return Sr.distanceTo(B)-ec.distanceTo(B)}),oe.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var ai=document.createDocumentFragment();for(Xe=0;Xeb.max.x)||!h.wrapLat&&(u.yb.max.y))return!1}if(!this.options.bounds)return!0;var T=this._tileCoordsToBounds(u);return K(this.options.bounds).overlaps(T)},_keyToBounds:function(u){return this._tileCoordsToBounds(this._keyToTileCoords(u))},_tileCoordsToNwSe:function(u){var h=this._map,b=this.getTileSize(),T=u.scaleBy(b),P=T.add(b),B=h.unproject(T,u.z),oe=h.unproject(P,u.z);return[B,oe]},_tileCoordsToBounds:function(u){var h=this._tileCoordsToNwSe(u),b=new V(h[0],h[1]);return this.options.noWrap||(b=this._map.wrapLatLngBounds(b)),b},_tileCoordsToKey:function(u){return u.x+":"+u.y+":"+u.z},_keyToTileCoords:function(u){var h=u.split(":"),b=new q(+h[0],+h[1]);return b.z=+h[2],b},_removeTile:function(u){var h=this._tiles[u];h&&(Ht(h.el),delete this._tiles[u],this.fire("tileunload",{tile:h.el,coords:this._keyToTileCoords(u)}))},_initTile:function(u){Ze(u,"leaflet-tile");var h=this.getTileSize();u.style.width=h.x+"px",u.style.height=h.y+"px",u.onselectstart=f,u.onmousemove=f,ze.ielt9&&this.options.opacity<1&&ii(u,this.options.opacity)},_addTile:function(u,h){var b=this._getTilePos(u),T=this._tileCoordsToKey(u),P=this.createTile(this._wrapCoords(u),a(this._tileReady,this,u));this._initTile(P),this.createTile.length<2&&z(a(this._tileReady,this,u,null,P)),pn(P,b),this._tiles[T]={el:P,coords:u,current:!0},h.appendChild(P),this.fire("tileloadstart",{tile:P,coords:u})},_tileReady:function(u,h,b){h&&this.fire("tileerror",{error:h,tile:b,coords:u});var T=this._tileCoordsToKey(u);b=this._tiles[T],b&&(b.loaded=+new Date,this._map._fadeAnimated?(ii(b.el,0),W(this._fadeFrame),this._fadeFrame=z(this._updateOpacity,this)):(b.active=!0,this._pruneTiles()),h||(Ze(b.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:b.el,coords:u})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),ze.ielt9||!this._map._fadeAnimated?z(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(u){return u.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(u){var h=new q(this._wrapX?d(u.x,this._wrapX):u.x,this._wrapY?d(u.y,this._wrapY):u.y);return h.z=u.z,h},_pxBoundsToTileRange:function(u){var h=this.getTileSize();return new H(u.min.unscaleBy(h).floor(),u.max.unscaleBy(h).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var u in this._tiles)if(!this._tiles[u].loaded)return!1;return!0}});function jU(u){return new sd(u)}var Jl=sd.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(u,h){this._url=u,h=y(this,h),h.detectRetina&&ze.retina&&h.maxZoom>0?(h.tileSize=Math.floor(h.tileSize/2),h.zoomReverse?(h.zoomOffset--,h.minZoom=Math.min(h.maxZoom,h.minZoom+1)):(h.zoomOffset++,h.maxZoom=Math.max(h.minZoom,h.maxZoom-1)),h.minZoom=Math.max(0,h.minZoom)):h.zoomReverse?h.minZoom=Math.min(h.maxZoom,h.minZoom):h.maxZoom=Math.max(h.minZoom,h.maxZoom),typeof h.subdomains=="string"&&(h.subdomains=h.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(u,h){return this._url===u&&h===void 0&&(h=!0),this._url=u,h||this.redraw(),this},createTile:function(u,h){var b=document.createElement("img");return qe(b,"load",a(this._tileOnLoad,this,h,b)),qe(b,"error",a(this._tileOnError,this,h,b)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(b.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(b.referrerPolicy=this.options.referrerPolicy),b.alt="",b.src=this.getTileUrl(u),b},getTileUrl:function(u){var h={r:ze.retina?"@2x":"",s:this._getSubdomain(u),x:u.x,y:u.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var b=this._globalTileRange.max.y-u.y;this.options.tms&&(h.y=b),h["-y"]=b}return w(this._url,i(h,this.options))},_tileOnLoad:function(u,h){ze.ielt9?setTimeout(a(u,this,null,h),0):u(null,h)},_tileOnError:function(u,h,b){var T=this.options.errorTileUrl;T&&h.getAttribute("src")!==T&&(h.src=T),u(b,h)},_onTileRemove:function(u){u.tile.onload=null},_getZoomForUrl:function(){var u=this._tileZoom,h=this.options.maxZoom,b=this.options.zoomReverse,T=this.options.zoomOffset;return b&&(u=h-u),u+T},_getSubdomain:function(u){var h=Math.abs(u.x+u.y)%this.options.subdomains.length;return this.options.subdomains[h]},_abortLoading:function(){var u,h;for(u in this._tiles)if(this._tiles[u].coords.z!==this._tileZoom&&(h=this._tiles[u].el,h.onload=f,h.onerror=f,!h.complete)){h.src=C;var b=this._tiles[u].coords;Ht(h),delete this._tiles[u],this.fire("tileabort",{tile:h,coords:b})}},_removeTile:function(u){var h=this._tiles[u];if(h)return h.el.setAttribute("src",C),sd.prototype._removeTile.call(this,u)},_tileReady:function(u,h,b){if(!(!this._map||b&&b.getAttribute("src")===C))return sd.prototype._tileReady.call(this,u,h,b)}});function JO(u,h){return new Jl(u,h)}var eC=Jl.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(u,h){this._url=u;var b=i({},this.defaultWmsParams);for(var T in h)T in this.options||(b[T]=h[T]);h=y(this,h);var P=h.detectRetina&&ze.retina?2:1,B=this.getTileSize();b.width=B.x*P,b.height=B.y*P,this.wmsParams=b},onAdd:function(u){this._crs=this.options.crs||u.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var h=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[h]=this._crs.code,Jl.prototype.onAdd.call(this,u)},getTileUrl:function(u){var h=this._tileCoordsToNwSe(u),b=this._crs,T=ie(b.project(h[0]),b.project(h[1])),P=T.min,B=T.max,oe=(this._wmsVersion>=1.3&&this._crs===YO?[P.y,P.x,B.y,B.x]:[P.x,P.y,B.x,B.y]).join(","),de=Jl.prototype.getTileUrl.call(this,u);return de+x(this.wmsParams,de,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+oe},setParams:function(u,h){return i(this.wmsParams,u),h||this.redraw(),this}});function MU(u,h){return new eC(u,h)}Jl.WMS=eC,JO.wms=MU;var Lo=Mi.extend({options:{padding:.1},initialize:function(u){y(this,u),l(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Ze(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var u={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(u.zoomanim=this._onAnimZoom),u},_onAnimZoom:function(u){this._updateTransform(u.center,u.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(u,h){var b=this._map.getZoomScale(h,this._zoom),T=this._map.getSize().multiplyBy(.5+this.options.padding),P=this._map.project(this._center,h),B=T.multiplyBy(-b).add(P).subtract(this._map._getNewPixelOrigin(u,h));ze.any3d?Ts(this._container,B,b):pn(this._container,B)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var u in this._layers)this._layers[u]._reset()},_onZoomEnd:function(){for(var u in this._layers)this._layers[u]._project()},_updatePaths:function(){for(var u in this._layers)this._layers[u]._update()},_update:function(){var u=this.options.padding,h=this._map.getSize(),b=this._map.containerPointToLayerPoint(h.multiplyBy(-u)).round();this._bounds=new H(b,b.add(h.multiplyBy(1+u*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),tC=Lo.extend({options:{tolerance:0},getEvents:function(){var u=Lo.prototype.getEvents.call(this);return u.viewprereset=this._onViewPreReset,u},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Lo.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var u=this._container=document.createElement("canvas");qe(u,"mousemove",this._onMouseMove,this),qe(u,"click dblclick mousedown mouseup contextmenu",this._onClick,this),qe(u,"mouseout",this._handleMouseOut,this),u._leaflet_disable_events=!0,this._ctx=u.getContext("2d")},_destroyContainer:function(){W(this._redrawRequest),delete this._ctx,Ht(this._container),Ct(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var u;this._redrawBounds=null;for(var h in this._layers)u=this._layers[h],u._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Lo.prototype._update.call(this);var u=this._bounds,h=this._container,b=u.getSize(),T=ze.retina?2:1;pn(h,u.min),h.width=T*b.x,h.height=T*b.y,h.style.width=b.x+"px",h.style.height=b.y+"px",ze.retina&&this._ctx.scale(2,2),this._ctx.translate(-u.min.x,-u.min.y),this.fire("update")}},_reset:function(){Lo.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(u){this._updateDashArray(u),this._layers[l(u)]=u;var h=u._order={layer:u,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=h),this._drawLast=h,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(u){this._requestRedraw(u)},_removePath:function(u){var h=u._order,b=h.next,T=h.prev;b?b.prev=T:this._drawLast=T,T?T.next=b:this._drawFirst=b,delete u._order,delete this._layers[l(u)],this._requestRedraw(u)},_updatePath:function(u){this._extendRedrawBounds(u),u._project(),u._update(),this._requestRedraw(u)},_updateStyle:function(u){this._updateDashArray(u),this._requestRedraw(u)},_updateDashArray:function(u){if(typeof u.options.dashArray=="string"){var h=u.options.dashArray.split(/[, ]+/),b=[],T,P;for(P=0;P')}}catch{}return function(u){return document.createElement("<"+u+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),AU={_initContainer:function(){this._container=pt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Lo.prototype._update.call(this),this.fire("update"))},_initPath:function(u){var h=u._container=ld("shape");Ze(h,"leaflet-vml-shape "+(this.options.className||"")),h.coordsize="1 1",u._path=ld("path"),h.appendChild(u._path),this._updateStyle(u),this._layers[l(u)]=u},_addPath:function(u){var h=u._container;this._container.appendChild(h),u.options.interactive&&u.addInteractiveTarget(h)},_removePath:function(u){var h=u._container;Ht(h),u.removeInteractiveTarget(h),delete this._layers[l(u)]},_updateStyle:function(u){var h=u._stroke,b=u._fill,T=u.options,P=u._container;P.stroked=!!T.stroke,P.filled=!!T.fill,T.stroke?(h||(h=u._stroke=ld("stroke")),P.appendChild(h),h.weight=T.weight+"px",h.color=T.color,h.opacity=T.opacity,T.dashArray?h.dashStyle=S(T.dashArray)?T.dashArray.join(" "):T.dashArray.replace(/( *, *)/g," "):h.dashStyle="",h.endcap=T.lineCap.replace("butt","flat"),h.joinstyle=T.lineJoin):h&&(P.removeChild(h),u._stroke=null),T.fill?(b||(b=u._fill=ld("fill")),P.appendChild(b),b.color=T.fillColor||T.color,b.opacity=T.fillOpacity):b&&(P.removeChild(b),u._fill=null)},_updateCircle:function(u){var h=u._point.round(),b=Math.round(u._radius),T=Math.round(u._radiusY||b);this._setPath(u,u._empty()?"M0 0":"AL "+h.x+","+h.y+" "+b+","+T+" 0,"+65535*360)},_setPath:function(u,h){u._path.v=h},_bringToFront:function(u){Gl(u._container)},_bringToBack:function(u){ql(u._container)}},Lp=ze.vml?ld:Me,cd=Lo.extend({_initContainer:function(){this._container=Lp("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Lp("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Ht(this._container),Ct(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Lo.prototype._update.call(this);var u=this._bounds,h=u.getSize(),b=this._container;(!this._svgSize||!this._svgSize.equals(h))&&(this._svgSize=h,b.setAttribute("width",h.x),b.setAttribute("height",h.y)),pn(b,u.min),b.setAttribute("viewBox",[u.min.x,u.min.y,h.x,h.y].join(" ")),this.fire("update")}},_initPath:function(u){var h=u._path=Lp("path");u.options.className&&Ze(h,u.options.className),u.options.interactive&&Ze(h,"leaflet-interactive"),this._updateStyle(u),this._layers[l(u)]=u},_addPath:function(u){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(u._path),u.addInteractiveTarget(u._path)},_removePath:function(u){Ht(u._path),u.removeInteractiveTarget(u._path),delete this._layers[l(u)]},_updatePath:function(u){u._project(),u._update()},_updateStyle:function(u){var h=u._path,b=u.options;h&&(b.stroke?(h.setAttribute("stroke",b.color),h.setAttribute("stroke-opacity",b.opacity),h.setAttribute("stroke-width",b.weight),h.setAttribute("stroke-linecap",b.lineCap),h.setAttribute("stroke-linejoin",b.lineJoin),b.dashArray?h.setAttribute("stroke-dasharray",b.dashArray):h.removeAttribute("stroke-dasharray"),b.dashOffset?h.setAttribute("stroke-dashoffset",b.dashOffset):h.removeAttribute("stroke-dashoffset")):h.setAttribute("stroke","none"),b.fill?(h.setAttribute("fill",b.fillColor||b.color),h.setAttribute("fill-opacity",b.fillOpacity),h.setAttribute("fill-rule",b.fillRule||"evenodd")):h.setAttribute("fill","none"))},_updatePoly:function(u,h){this._setPath(u,ue(u._parts,h))},_updateCircle:function(u){var h=u._point,b=Math.max(Math.round(u._radius),1),T=Math.max(Math.round(u._radiusY),1)||b,P="a"+b+","+T+" 0 1,0 ",B=u._empty()?"M0 0":"M"+(h.x-b)+","+h.y+P+b*2+",0 "+P+-b*2+",0 ";this._setPath(u,B)},_setPath:function(u,h){u._path.setAttribute("d",h)},_bringToFront:function(u){Gl(u._path)},_bringToBack:function(u){ql(u._path)}});ze.vml&&cd.include(AU);function rC(u){return ze.svg||ze.vml?new cd(u):null}ct.include({getRenderer:function(u){var h=u.options.renderer||this._getPaneRenderer(u.options.pane)||this.options.renderer||this._renderer;return h||(h=this._renderer=this._createRenderer()),this.hasLayer(h)||this.addLayer(h),h},_getPaneRenderer:function(u){if(u==="overlayPane"||u===void 0)return!1;var h=this._paneRenderers[u];return h===void 0&&(h=this._createRenderer({pane:u}),this._paneRenderers[u]=h),h},_createRenderer:function(u){return this.options.preferCanvas&&nC(u)||rC(u)}});var iC=Ql.extend({initialize:function(u,h){Ql.prototype.initialize.call(this,this._boundsToLatLngs(u),h)},setBounds:function(u){return this.setLatLngs(this._boundsToLatLngs(u))},_boundsToLatLngs:function(u){return u=K(u),[u.getSouthWest(),u.getNorthWest(),u.getNorthEast(),u.getSouthEast()]}});function RU(u,h){return new iC(u,h)}cd.create=Lp,cd.pointsToPath=ue,Po.geometryToLayer=Sp,Po.coordsToLatLng=n_,Po.coordsToLatLngs=Ep,Po.latLngToCoords=r_,Po.latLngsToCoords=Tp,Po.getFeature=Xl,Po.asFeature=Op,ct.mergeOptions({boxZoom:!0});var oC=Qi.extend({initialize:function(u){this._map=u,this._container=u._container,this._pane=u._panes.overlayPane,this._resetStateTimeout=0,u.on("unload",this._destroy,this)},addHooks:function(){qe(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ct(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Ht(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(u){if(!u.shiftKey||u.which!==1&&u.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),ed(),$0(),this._startPoint=this._map.mouseEventToContainerPoint(u),qe(document,{contextmenu:ks,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(u){this._moved||(this._moved=!0,this._box=pt("div","leaflet-zoom-box",this._container),Ze(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(u);var h=new H(this._point,this._startPoint),b=h.getSize();pn(this._box,h.min),this._box.style.width=b.x+"px",this._box.style.height=b.y+"px"},_finish:function(){this._moved&&(Ht(this._box),rn(this._container,"leaflet-crosshair")),td(),U0(),Ct(document,{contextmenu:ks,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(u){if(!(u.which!==1&&u.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0);var h=new V(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(h).fire("boxzoomend",{boxZoomBounds:h})}},_onKeyDown:function(u){u.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});ct.addInitHook("addHandler","boxZoom",oC),ct.mergeOptions({doubleClickZoom:!0});var aC=Qi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(u){var h=this._map,b=h.getZoom(),T=h.options.zoomDelta,P=u.originalEvent.shiftKey?b-T:b+T;h.options.doubleClickZoom==="center"?h.setZoom(P):h.setZoomAround(u.containerPoint,P)}});ct.addInitHook("addHandler","doubleClickZoom",aC),ct.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var sC=Qi.extend({addHooks:function(){if(!this._draggable){var u=this._map;this._draggable=new ga(u._mapPane,u._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),u.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),u.on("zoomend",this._onZoomEnd,this),u.whenReady(this._onZoomEnd,this))}Ze(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){rn(this._map._container,"leaflet-grab"),rn(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var u=this._map;if(u._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var h=K(this._map.options.maxBounds);this._offsetLimit=ie(this._map.latLngToContainerPoint(h.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(h.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;u.fire("movestart").fire("dragstart"),u.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(u){if(this._map.options.inertia){var h=this._lastTime=+new Date,b=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(b),this._times.push(h),this._prunePositions(h)}this._map.fire("move",u).fire("drag",u)},_prunePositions:function(u){for(;this._positions.length>1&&u-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var u=this._map.getSize().divideBy(2),h=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=h.subtract(u).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(u,h){return u-(u-h)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var u=this._draggable._newPos.subtract(this._draggable._startPos),h=this._offsetLimit;u.xh.max.x&&(u.x=this._viscousLimit(u.x,h.max.x)),u.y>h.max.y&&(u.y=this._viscousLimit(u.y,h.max.y)),this._draggable._newPos=this._draggable._startPos.add(u)}},_onPreDragWrap:function(){var u=this._worldWidth,h=Math.round(u/2),b=this._initialWorldOffset,T=this._draggable._newPos.x,P=(T-h+b)%u+h-b,B=(T+h+b)%u-h-b,oe=Math.abs(P+b)0?B:-B))-h;this._delta=0,this._startTime=null,oe&&(u.options.scrollWheelZoom==="center"?u.setZoom(h+oe):u.setZoomAround(this._lastMousePos,h+oe))}});ct.addInitHook("addHandler","scrollWheelZoom",cC);var NU=600;ct.mergeOptions({tapHold:ze.touchNative&&ze.safari&&ze.mobile,tapTolerance:15});var uC=Qi.extend({addHooks:function(){qe(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ct(this._map._container,"touchstart",this._onDown,this)},_onDown:function(u){if(clearTimeout(this._holdTimeout),u.touches.length===1){var h=u.touches[0];this._startPos=this._newPos=new q(h.clientX,h.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(qe(document,"touchend",Yn),qe(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",h))},this),NU),qe(document,"touchend touchcancel contextmenu",this._cancel,this),qe(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function u(){Ct(document,"touchend",Yn),Ct(document,"touchend touchcancel",u)},_cancel:function(){clearTimeout(this._holdTimeout),Ct(document,"touchend touchcancel contextmenu",this._cancel,this),Ct(document,"touchmove",this._onMove,this)},_onMove:function(u){var h=u.touches[0];this._newPos=new q(h.clientX,h.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(u,h){var b=new MouseEvent(u,{bubbles:!0,cancelable:!0,view:window,screenX:h.screenX,screenY:h.screenY,clientX:h.clientX,clientY:h.clientY});b._simulated=!0,h.target.dispatchEvent(b)}});ct.addInitHook("addHandler","tapHold",uC),ct.mergeOptions({touchZoom:ze.touch,bounceAtZoomLimits:!0});var dC=Qi.extend({addHooks:function(){Ze(this._map._container,"leaflet-touch-zoom"),qe(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){rn(this._map._container,"leaflet-touch-zoom"),Ct(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(u){var h=this._map;if(!(!u.touches||u.touches.length!==2||h._animatingZoom||this._zooming)){var b=h.mouseEventToContainerPoint(u.touches[0]),T=h.mouseEventToContainerPoint(u.touches[1]);this._centerPoint=h.getSize()._divideBy(2),this._startLatLng=h.containerPointToLatLng(this._centerPoint),h.options.touchZoom!=="center"&&(this._pinchStartLatLng=h.containerPointToLatLng(b.add(T)._divideBy(2))),this._startDist=b.distanceTo(T),this._startZoom=h.getZoom(),this._moved=!1,this._zooming=!0,h._stop(),qe(document,"touchmove",this._onTouchMove,this),qe(document,"touchend touchcancel",this._onTouchEnd,this),Yn(u)}},_onTouchMove:function(u){if(!(!u.touches||u.touches.length!==2||!this._zooming)){var h=this._map,b=h.mouseEventToContainerPoint(u.touches[0]),T=h.mouseEventToContainerPoint(u.touches[1]),P=b.distanceTo(T)/this._startDist;if(this._zoom=h.getScaleZoom(P,this._startZoom),!h.options.bounceAtZoomLimits&&(this._zoomh.getMaxZoom()&&P>1)&&(this._zoom=h._limitZoom(this._zoom)),h.options.touchZoom==="center"){if(this._center=this._startLatLng,P===1)return}else{var B=b._add(T)._divideBy(2)._subtract(this._centerPoint);if(P===1&&B.x===0&&B.y===0)return;this._center=h.unproject(h.project(this._pinchStartLatLng,this._zoom).subtract(B),this._zoom)}this._moved||(h._moveStart(!0,!1),this._moved=!0),W(this._animRequest);var oe=a(h._move,h,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=z(oe,this,!0),Yn(u)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,W(this._animRequest),Ct(document,"touchmove",this._onTouchMove,this),Ct(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});ct.addInitHook("addHandler","touchZoom",dC),ct.BoxZoom=oC,ct.DoubleClickZoom=aC,ct.Drag=sC,ct.Keyboard=lC,ct.ScrollWheelZoom=cC,ct.TapHold=uC,ct.TouchZoom=dC,n.Bounds=H,n.Browser=ze,n.CRS=he,n.Canvas=tC,n.Circle=t_,n.CircleMarker=xp,n.Class=G,n.Control=ji,n.DivIcon=XO,n.DivOverlay=Xi,n.DomEvent=J$,n.DomUtil=Q$,n.Draggable=ga,n.Evented=le,n.FeatureGroup=Co,n.GeoJSON=Po,n.GridLayer=sd,n.Handler=Qi,n.Icon=Zl,n.ImageOverlay=Cp,n.LatLng=re,n.LatLngBounds=V,n.Layer=Mi,n.LayerGroup=Kl,n.LineUtil=fU,n.Map=ct,n.Marker=wp,n.Mixin=aU,n.Path=va,n.Point=q,n.PolyUtil=sU,n.Polygon=Ql,n.Polyline=ko,n.Popup=kp,n.PosAnimation=RO,n.Projection=hU,n.Rectangle=iC,n.Renderer=Lo,n.SVG=cd,n.SVGOverlay=QO,n.TileLayer=Jl,n.Tooltip=Pp,n.Transformation=ee,n.Util=X,n.VideoOverlay=ZO,n.bind=a,n.bounds=ie,n.canvas=nC,n.circle=wU,n.circleMarker=bU,n.control=id,n.divIcon=LU,n.extend=i,n.featureGroup=vU,n.geoJSON=KO,n.geoJson=EU,n.gridLayer=jU,n.icon=yU,n.imageOverlay=TU,n.latLng=ae,n.latLngBounds=K,n.layerGroup=gU,n.map=eU,n.marker=_U,n.point=D,n.polygon=SU,n.polyline=xU,n.popup=kU,n.rectangle=RU,n.setOptions=y,n.stamp=l,n.svg=rC,n.svgOverlay=CU,n.tileLayer=JO,n.tooltip=PU,n.transformation=J,n.version=r,n.videoOverlay=OU;var DU=window.L;n.noConflict=function(){return window.L=DU,this},window.L=n})})(S2,S2.exports);var lp=S2.exports;const kA=Wu(lp);function cO(e,t,n){return Object.freeze({instance:e,context:t,container:n})}function uO(e,t){return t==null?function(n,r){const i=$.useRef();return i.current||(i.current=e(n,r)),i}:function(n,r){const i=$.useRef();i.current||(i.current=e(n,r));const o=$.useRef(n),{instance:a}=i.current;return $.useEffect(function(){o.current!==n&&(t(a,n,o.current),o.current=n)},[a,n,r]),i}}function Cbe(e,t){$.useEffect(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){var n;(n=t.layerContainer)==null||n.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function t$(e){return function(t){const n=JF(),r=e(lO(t,n),n);return ZF(n.map,t.attribution),e$(r.current,t.eventHandlers),Cbe(r.current,n),r}}function kbe(e,t){const n=uO(e,t),r=t$(n);return Sbe(r)}function Pbe(e,t){const n=uO(e),r=Obe(n,t);return Ebe(r)}function Lbe(e,t){const n=uO(e,t),r=t$(n);return Tbe(r)}function jbe(e,t,n){const{opacity:r,zIndex:i}=t;r!=null&&r!==n.opacity&&e.setOpacity(r),i!=null&&i!==n.zIndex&&e.setZIndex(i)}function E2(){return E2=Object.assign||function(e){for(var t=1;t(m==null?void 0:m.map)??null,[m]);const y=$.useCallback(_=>{if(_!==null&&m===null){const w=new lp.Map(_,d);n!=null&&c!=null?w.setView(n,c):e!=null&&w.fitBounds(e,t),l!=null&&w.whenReady(l),v(wbe(w))}},[]);$.useEffect(()=>()=>{m==null||m.map.remove()},[m]);const x=m?Y.createElement(XF,{value:m},r):a??null;return Y.createElement("div",E2({},p,{ref:y}),x)}const Abe=$.forwardRef(Mbe),Rbe=kbe(function({position:e,...t},n){const r=new lp.Marker(e,t);return cO(r,xbe(n,{overlayContainer:r}))},function(e,t,n){t.position!==n.position&&e.setLatLng(t.position),t.icon!=null&&t.icon!==n.icon&&e.setIcon(t.icon),t.zIndexOffset!=null&&t.zIndexOffset!==n.zIndexOffset&&e.setZIndexOffset(t.zIndexOffset),t.opacity!=null&&t.opacity!==n.opacity&&e.setOpacity(t.opacity),e.dragging!=null&&t.draggable!==n.draggable&&(t.draggable===!0?e.dragging.enable():e.dragging.disable())}),Nbe=Pbe(function(e,t){const n=new lp.Popup(e,t.overlayContainer);return cO(n,t)},function(e,t,{position:n},r){$.useEffect(function(){const{instance:i}=e;function o(s){s.popup===i&&(i.update(),r(!0))}function a(s){s.popup===i&&r(!1)}return t.map.on({popupopen:o,popupclose:a}),t.overlayContainer==null?(n!=null&&i.setLatLng(n),i.openOn(t.map)):t.overlayContainer.bindPopup(i),function(){var s;t.map.off({popupopen:o,popupclose:a}),(s=t.overlayContainer)==null||s.unbindPopup(),t.map.removeLayer(i)}},[e,t,r,n])}),Dbe=Lbe(function({url:e,...t},n){const r=new lp.TileLayer(e,lO(t,n));return cO(r,n)},function(e,t,n){jbe(e,t,n);const{url:r}=t;r!=null&&r!==n.url&&e.setUrl(r)}),Ibe=()=>g.jsx(Dbe,{attribution:'© OpenStreetMap contributors',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),Fbe=e=>{if(e.length===0)return{};if(e.length>1)return{bounds:e.map(mt("latLong"))};const[{latLong:t}]=e;return{zoom:10,center:t}},n$=({toggle:e,isOpen:t,title:n,locations:r=[]})=>g.jsx(ua,{toggle:e,isOpen:t,className:"map-modal__modal",contentClassName:"map-modal__modal-content",children:g.jsxs(To,{className:"map-modal__modal-body",children:[g.jsxs("h3",{className:"map-modal__modal-title",children:[n,g.jsx("button",{type:"button",className:"btn-close float-end","aria-label":"Close",onClick:e})]}),g.jsxs(Abe,{...Fbe(r),children:[g.jsx(Ibe,{}),r.map(({cityName:i,latLong:o,count:a},s)=>g.jsx(Rbe,{position:o,children:g.jsxs(Nbe,{children:[g.jsx("b",{children:a})," visit",a>1?"s":""," from ",g.jsx("b",{children:i})]})},s))]})]})}),$be=({modalTitle:e,activeCities:t,locations:n=[]})=>{const[r,,i,o]=Tn(),[a,s]=Tn(),[l,c]=$.useState([]),d=a0(),f=$.useCallback(p=>{c(p?n.filter(p):n),i()},[n]);return g.jsxs(g.Fragment,{children:[!t&&g.jsx(yt,{color:"link",className:"open-map-modal-btn__btn",id:d,onClick:()=>f(),children:g.jsx(Ae,{icon:Yb})}),t&&g.jsxs($h,{isOpen:a,toggle:s,children:[g.jsx(Uu,{color:"link",className:"open-map-modal-btn__btn",id:d,children:g.jsx(Ae,{icon:Yb})}),g.jsxs($u,{end:!0,children:[g.jsx(Ue,{onClick:()=>f(),children:"Show all locations"}),g.jsx(Ue,{onClick:()=>f(({cityName:p})=>t.includes(p)),children:"Show locations in current page"})]})]}),g.jsx(Dr,{placement:"left",target:d,children:"Show in map"}),g.jsx(n$,{toggle:o,isOpen:r,title:e,locations:l})]})},Ube=({onChange:e,selected:t={},className:n,isOrphanVisits:r})=>{const{orphanVisitsType:i,excludeBots:o=!1}=t,a=s=>({active:i===s,onClick:()=>e({...t,orphanVisitsType:s===(t==null?void 0:t.orphanVisitsType)?void 0:s})});return g.jsxs(fa,{text:"Filters",dropdownClassName:n,inline:!0,end:!0,minWidth:250,children:[g.jsx(Ue,{header:!0,children:"Bots:"}),g.jsx(Ue,{active:o,onClick:()=>e({...t,excludeBots:!(t!=null&&t.excludeBots)}),children:"Exclude potential bots"}),r&&g.jsxs(g.Fragment,{children:[g.jsx(Ue,{divider:!0}),g.jsx(Ue,{header:!0,children:"Orphan visits type:"}),g.jsx(Ue,{...a("base_url"),children:"Base URL"}),g.jsx(Ue,{...a("invalid_short_url"),children:"Invalid short URL"}),g.jsx(Ue,{...a("regular_404"),children:"Regular 404"})]}),g.jsx(Ue,{divider:!0}),g.jsx(Ue,{disabled:!co(t),onClick:()=>e({excludeBots:!1,orphanVisitsType:void 0}),children:g.jsx("i",{children:"Clear filters"})})]})},r$=(e,t)=>!$l(e)&&co(e[t]),PA=e=>typeof e=="number"?e:e?parseFloat(e):0,Bbe=(e,{os:t})=>{e[t]=(e[t]||0)+1},zbe=(e,{browser:t})=>{e[t]=(e[t]||0)+1},Vbe=(e,{referer:t})=>{e[t]=(e[t]||0)+1},i$=e=>(t,n)=>{const r=r$(n,e)?n[e]:"Unknown";t[r]=(t[r]||0)+1},Hbe=i$("country"),Wbe=i$("city"),Ybe=(e,t)=>{if(!r$(t,"city")||t.city==="Unknown")return;const{city:n,latitude:r,longitude:i}=t,o=e[n]||{cityName:n,count:0,latLong:[PA(r),PA(i)]};o.count+=1,e[n]=o},Gbe=(e,t)=>{if(!A1e(t))return;const{visitedUrl:n}=t;e[n]=(e[n]||0)+1},o$=e=>e.reduce((t,n)=>(Bbe(t.os,n),zbe(t.browsers,n),Vbe(t.referrers,n),Hbe(t.countries,n),Wbe(t.cities,n),Ybe(t.citiesForMap,n),Gbe(t.visitedUrls,n),t),{os:{},browsers:{},referrers:{},countries:{},cities:{},citiesForMap:{},visitedUrls:{}}),a$=N5(e=>{const{userAgent:t,date:n,referer:r,visitLocation:i,potentialBot:o}=e,a={date:n,potentialBot:o,...ebe(t),referer:tbe(r),country:(i==null?void 0:i.countryName)||"Unknown",city:(i==null?void 0:i.cityName)||"Unknown",latitude:i==null?void 0:i.latitude,longitude:i==null?void 0:i.longitude};return iO(e)?{...a,type:e.type,visitedUrl:e.visitedUrl}:a}),qbe=Object.freeze(Object.defineProperty({__proto__:null,normalizeVisits:a$,processStatsFromVisits:o$},Symbol.toStringTag,{value:"Module"})),Yd=20,Kbe=({browser:e,os:t,referer:n,country:r,city:i,...o},a)=>`${e} ${t} ${n} ${r} ${i} ${o.visitedUrl}`.toLowerCase().includes(a.toLowerCase()),Zbe=(e,t)=>t.filter(n=>Kbe(n,e)),Qbe=(e,t)=>HI(t,e),Xbe=(e,t,n)=>{const r=t?Zbe(t,e):[...e],i=Qbe(n,r),o=i.length;return{visitsGroups:gh(Yd,i),total:o}},Jbe=({visits:e,selectedVisits:t=[],setSelectedVisits:n,matchMedia:r=window.matchMedia,isOrphanVisits:i=!1})=>{var o,a;const s="visits-table__header-cell visits-table__sticky",l=()=>r("(max-width: 767px)").matches,[c,d]=$.useState(l()),[f,p]=$.useState(void 0),[m,v]=$.useState({}),y=$.useMemo(()=>Xbe(e,f,m),[f,m]),x=$.useRef(!0),[_,w]=$.useState(1),S=_*Yd,E=S-Yd,C=8+Number(i),k=A=>()=>v({field:A,dir:l0(A,m.field,m.dir)}),j=A=>g.jsx(Cf,{currentOrder:m,field:A,className:"visits-table__header-icon"});return $.useEffect(()=>{const A=()=>d(l());return window.addEventListener("resize",A),()=>window.removeEventListener("resize",A)},[]),$.useEffect(()=>{w(1),!x.current&&n([]),x.current=!1},[f]),g.jsx("div",{className:"table-responsive-md",children:g.jsxs("table",{className:"table table-bordered table-hover table-sm visits-table",children:[g.jsxs("thead",{className:"visits-table__header",children:[g.jsxs("tr",{children:[g.jsx("th",{className:`${s} text-center`,onClick:()=>n(t.length0})})}),g.jsxs("th",{className:`${s} text-center`,onClick:k("potentialBot"),children:[g.jsx(Ae,{icon:nP}),j("potentialBot")]}),g.jsxs("th",{className:s,onClick:k("date"),children:["Date",j("date")]}),g.jsxs("th",{className:s,onClick:k("country"),children:["Country",j("country")]}),g.jsxs("th",{className:s,onClick:k("city"),children:["City",j("city")]}),g.jsxs("th",{className:s,onClick:k("browser"),children:["Browser",j("browser")]}),g.jsxs("th",{className:s,onClick:k("os"),children:["OS",j("os")]}),g.jsxs("th",{className:s,onClick:k("referer"),children:["Referrer",j("referer")]}),i&&g.jsxs("th",{className:s,onClick:k("visitedUrl"),children:["Visited URL",j("visitedUrl")]})]}),g.jsx("tr",{children:g.jsx("td",{colSpan:C,className:"p-0",children:g.jsx(Vh,{noBorder:!0,large:!1,onChange:p})})})]}),g.jsxs("tbody",{children:[!((o=y.visitsGroups[_-1])!=null&&o.length)&&g.jsx("tr",{children:g.jsx("td",{colSpan:C,className:"text-center",children:"No visits found with current filtering"})}),(a=y.visitsGroups[_-1])==null?void 0:a.map((A,U)=>{const N=t.includes(A);return g.jsxs("tr",{style:{cursor:"pointer"},className:rt({"table-active":N}),onClick:()=>n(N?t.filter(z=>z!==A):[...t,A]),children:[g.jsx("td",{className:"text-center",children:N&&g.jsx(Ae,{icon:Yf,className:"text-primary"})}),g.jsx("td",{className:"text-center",children:A.potentialBot&&g.jsxs(g.Fragment,{children:[g.jsx(Ae,{icon:nP,id:`botIcon${U}`}),g.jsx(Dr,{placement:"right",target:`botIcon${U}`,children:"Potentially a visit from a bot or crawler"})]})}),g.jsx("td",{children:g.jsx(ry,{date:A.date})}),g.jsx("td",{children:A.country}),g.jsx("td",{children:A.city}),g.jsx("td",{children:A.browser}),g.jsx("td",{children:A.os}),g.jsx("td",{children:A.referer}),i&&g.jsx("td",{children:A.visitedUrl})]},U)})]}),y.total>Yd&&g.jsx("tfoot",{children:g.jsx("tr",{children:g.jsx("td",{colSpan:C,className:"visits-table__footer-cell visits-table__sticky",children:g.jsxs("div",{className:"row",children:[g.jsx("div",{className:"col-md-6",children:g.jsx(XT,{pagesCount:Math.ceil(y.total/Yd),currentPage:_,setCurrentPage:w,centered:c})}),g.jsx("div",{className:rt("col-md-6",{"d-flex align-items-center flex-row-reverse":!c,"text-center mt-3":c}),children:g.jsxs("div",{children:["Visits ",g.jsx("b",{children:Sn(E+1)})," to"," ",g.jsx("b",{children:Sn(H5(S,y.total))})," of"," ",g.jsx("b",{children:Sn(y.total)})]})})]})})})})]})})},pc={byTime:{title:"By time",subPath:"by-time",icon:jW},byContext:{title:"By context",subPath:"by-context",icon:GS},byLocation:{title:"By location",subPath:"by-location",icon:Yb},list:{title:"List",subPath:"list",icon:u4}};let $m;const cp=({children:e,visitsInfo:t,getVisits:n,cancelGetVisits:r,exportCsv:i,isOrphanVisits:o=!1})=>{const{visits:a,loading:s,loadingLarge:l,error:c,errorData:d,progress:f,fallbackInterval:p}=t,[{dateRange:m,visitsFilter:v},y]=_be(),x=zl("visits"),_=Qn(({startDate:V,endDate:K})=>({dateRange:{startDate:V??void 0,endDate:K??void 0}}),y),w=$.useRef(m??p??(x==null?void 0:x.defaultInterval)??"last30Days"),[S,E]=$.useState([]),[C,k]=$.useState(),j=$.useRef(!0),{search:A}=yn(),U=V=>V?`${V}${A}`:A,N=$.useMemo(()=>a$(a),[a]),{os:z,browsers:W,referrers:X,countries:G,cities:Z,citiesForMap:te,visitedUrls:le}=$.useMemo(()=>o$(N),[N]),q=$.useMemo(()=>({...v,excludeBots:v.excludeBots??(x==null?void 0:x.excludeBots)}),[v]),I=fT(te),D=V=>{$m=void 0,E(V)},H=V=>K=>{const re=`${V}_${K}`;$m===re?(E([]),k(void 0),$m=void 0):(E(N.filter(Sde(V,K))),k(K),$m=re)};$.useEffect(()=>r,[]),$.useEffect(()=>{const V=j.current?m??Gpe(w.current):m;n({dateRange:V,filter:q},j.current),j.current=!1},[m,v]),$.useEffect(()=>{p&&w.current===((x==null?void 0:x.defaultInterval)??"last30Days")&&(w.current=p)},[p]);const ie=()=>l?g.jsxs(Wo,{loading:!0,children:["This is going to take a while... :S",g.jsx(LI,{value:f,striped:f===100,className:"mt-3"})]}):s?g.jsx(Wo,{loading:!0}):c?g.jsx(Yr,{type:"error",children:g.jsx(na,{errorData:d,fallbackMessage:"An error occurred while loading visits :("})}):ki(a)?g.jsx(Wo,{children:"There are no visits matching current filter"}):g.jsxs(g.Fragment,{children:[g.jsx(VI,{fill:!0,children:Object.values(pc).map(({title:V,icon:K,subPath:re},ae)=>g.jsxs(cf,{to:U(re),replace:!0,children:[g.jsx(Ae,{icon:K}),g.jsx("span",{className:"ms-2 d-none d-sm-inline",children:V})]},ae))}),g.jsx(yr,{children:g.jsxs(Gy,{children:[g.jsx(vt,{path:pc.byTime.subPath,element:g.jsx("div",{className:"col-12 mt-3",children:g.jsx(cbe,{title:"Visits during time",visits:N,highlightedVisits:S,highlightedLabel:C,setSelectedVisits:D})})}),g.jsx(vt,{path:pc.byContext.subPath,element:g.jsxs(g.Fragment,{children:[g.jsx("div",{className:rt("mt-3 col-lg-6",{"col-xl-4":!o}),children:g.jsx(wA,{title:"Operating systems",stats:z})}),g.jsx("div",{className:rt("mt-3 col-lg-6",{"col-xl-4":!o}),children:g.jsx(wA,{title:"Browsers",stats:W})}),g.jsx("div",{className:rt("mt-3",{"col-xl-4":!o,"col-lg-6":o}),children:g.jsx(Fm,{title:"Referrers",stats:X,withPagination:!1,highlightedStats:Dm(S,"referer"),highlightedLabel:C,sortingItems:{name:"Referrer name",amount:"Visits amount"},onClick:H("referer")})}),o&&g.jsx("div",{className:"mt-3 col-lg-6",children:g.jsx(Fm,{title:"Visited URLs",stats:le,highlightedLabel:C,highlightedStats:Dm(S,"visitedUrl"),sortingItems:{visitedUrl:"Visited URL",amount:"Visits amount"},onClick:H("visitedUrl")})})]})}),g.jsx(vt,{path:pc.byLocation.subPath,element:g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"col-lg-6 mt-3",children:g.jsx(Fm,{title:"Countries",stats:G,highlightedStats:Dm(S,"country"),highlightedLabel:C,sortingItems:{name:"Country name",amount:"Visits amount"},onClick:H("country")})}),g.jsx("div",{className:"col-lg-6 mt-3",children:g.jsx(Fm,{title:"Cities",stats:Z,highlightedStats:Dm(S,"city"),highlightedLabel:C,extraHeaderContent:V=>I.length>0&&g.jsx($be,{modalTitle:"Cities",locations:I,activeCities:V}),sortingItems:{name:"City name",amount:"Visits amount"},onClick:H("city")})})]})}),g.jsx(vt,{path:pc.list.subPath,element:g.jsx("div",{className:"col-12",children:g.jsx(Jbe,{visits:N,selectedVisits:S,setSelectedVisits:D,isOrphanVisits:o})})}),g.jsx(vt,{path:"*",element:g.jsx(DS,{replace:!0,to:U(pc.byTime.subPath)})})]})})]});return g.jsxs(g.Fragment,{children:[e,g.jsx("section",{className:"mt-3",children:g.jsxs("div",{className:"row flex-md-row-reverse",children:[g.jsx("div",{className:"col-lg-7 col-xl-6",children:g.jsxs("div",{className:"d-md-flex",children:[g.jsx("div",{className:"flex-fill",children:g.jsx(gF,{updatable:!0,disabled:s,initialDateRange:w.current,defaultText:"All visits",onDatesChange:_})}),g.jsx(Ube,{className:"ms-0 ms-md-2 mt-3 mt-md-0",isOrphanVisits:o,selected:q,onChange:V=>y({visitsFilter:V})})]})}),a.length>0&&g.jsx("div",{className:"col-lg-5 col-xl-6 mt-3 mt-lg-0",children:g.jsxs("div",{className:"d-flex",children:[g.jsx($8,{className:"btn-md-block",amount:N.length,onClick:()=>i(N)}),g.jsxs(yt,{outline:!0,disabled:S.length===0,className:"btn-md-block ms-2",onClick:()=>D([]),children:["Clear selection ",S.length>0&&g.jsxs(g.Fragment,{children:["(",Sn(S.length),")"]})]})]})})]})}),g.jsx("section",{className:"mt-3",children:ie()})]})},ewe=({exportVisits:e})=>xs(({getDomainVisits:t,domainVisits:n,cancelGetDomainVisits:r})=>{const i=Yu(),{domain:o=""}=Rl(),[a,s=a]=o.split("_");return g.jsx(cp,{getVisits:(l,c)=>t({domain:s,query:ap(l),doIntervalFallback:c}),cancelGetVisits:r,visitsInfo:n,exportCsv:l=>e(`domain_${a}_visits.csv`,l),children:g.jsx(sp,{goBack:i,visits:n.visits,title:`"${a}" visits`})})},()=>[yi.visits]),twe=({exportVisits:e})=>xs(({getNonOrphanVisits:t,nonOrphanVisits:n,cancelGetNonOrphanVisits:r})=>{const i=Yu();return g.jsx(cp,{getVisits:(o,a)=>t({query:ap(o),doIntervalFallback:a}),cancelGetVisits:r,visitsInfo:n,exportCsv:o=>e("non_orphan_visits.csv",o),children:g.jsx(sp,{title:"Non-orphan visits",goBack:i,visits:n.visits})})},()=>[yi.visits]),nwe=({exportVisits:e})=>xs(({getOrphanVisits:t,orphanVisits:n,cancelGetOrphanVisits:r})=>{const i=Yu();return g.jsx(cp,{getVisits:(o,a)=>{var s;return t({query:ap(o),orphanVisitsType:(s=o.filter)==null?void 0:s.orphanVisitsType,doIntervalFallback:a})},cancelGetVisits:r,visitsInfo:n,exportCsv:o=>e("orphan_visits.csv",o),isOrphanVisits:!0,children:g.jsx(sp,{title:"Orphan visits",goBack:i,visits:n.visits})})},()=>[yi.orphanVisits]),s$="shlink/orphanVisits",rwe={visits:[],loading:!1,loadingLarge:!1,error:!1,cancelLoad:!1,progress:0},iwe=e=>tp({typePrefix:`${s$}/getNonOrphanVisits`,createLoaders:({query:t={},doIntervalFallback:n=!1})=>{const r=e(),i=async(a,s)=>r.getNonOrphanVisits({...t,page:a,itemsPerPage:s}),o=np(n,a=>r.getNonOrphanVisits(a));return[i,o]},getExtraFulfilledPayload:({query:t={}})=>({query:t}),shouldCancel:t=>t().orphanVisits.cancelLoad}),owe=e=>rp({name:s$,initialState:rwe,asyncThunkCreator:e,filterCreatedVisits:({query:t={}},n)=>{const{startDate:r,endDate:i}=t;return n.filter(({visit:o})=>Xh(o.date,r,i))}}),l$="shlink/orphanVisits",awe={visits:[],loading:!1,loadingLarge:!1,error:!1,cancelLoad:!1,progress:0},swe=(e,t)=>!t||t===e.type,lwe=e=>tp({typePrefix:`${l$}/getOrphanVisits`,createLoaders:({orphanVisitsType:t,query:n={},doIntervalFallback:r=!1})=>{const i=e(),o=async(s,l)=>i.getOrphanVisits({...n,page:s,itemsPerPage:l}).then(c=>{const d=c.data.filter(f=>iO(f)&&swe(f,t));return{...c,data:d}}),a=np(r,s=>i.getOrphanVisits(s));return[o,a]},getExtraFulfilledPayload:({query:t={}})=>({query:t}),shouldCancel:t=>t().orphanVisits.cancelLoad}),cwe=e=>rp({name:l$,initialState:awe,asyncThunkCreator:e,filterCreatedVisits:({query:t={}},n)=>{const{startDate:r,endDate:i}=t;return n.filter(({visit:o,shortUrl:a})=>!a&&Xh(o.date,r,i))}}),c$="shlink/shortUrlVisits",uwe={visits:[],shortCode:"",domain:void 0,loading:!1,loadingLarge:!1,error:!1,cancelLoad:!1,progress:0},dwe=e=>tp({typePrefix:`${c$}/getShortUrlVisits`,createLoaders:({shortCode:t,query:n={},doIntervalFallback:r=!1})=>{const i=e(),o=async(s,l)=>i.getShortUrlVisits(t,{...n,page:s,itemsPerPage:l}),a=np(r,async s=>i.getShortUrlVisits(t,{...s,domain:n.domain}));return[o,a]},getExtraFulfilledPayload:({shortCode:t,query:n={}})=>({shortCode:t,query:n,domain:n.domain}),shouldCancel:t=>t().shortUrlVisits.cancelLoad}),fwe=e=>rp({name:c$,initialState:uwe,asyncThunkCreator:e,filterCreatedVisits:({shortCode:t,domain:n,query:r={}},i)=>{const{startDate:o,endDate:a}=r;return i.filter(({shortUrl:s,visit:l})=>s&&wf(s,t,n)&&Xh(l.date,o,a))}}),u$="shlink/tagVisits",hwe={visits:[],tag:"",loading:!1,loadingLarge:!1,error:!1,cancelLoad:!1,progress:0},pwe=e=>tp({typePrefix:`${u$}/getTagVisits`,createLoaders:({tag:t,query:n={},doIntervalFallback:r=!1})=>{const i=e(),o=async(s,l)=>i.getTagVisits(t,{...n,page:s,itemsPerPage:l}),a=np(r,async s=>i.getTagVisits(t,s));return[o,a]},getExtraFulfilledPayload:({tag:t,query:n={}})=>({tag:t,query:n}),shouldCancel:t=>t().tagVisits.cancelLoad}),mwe=e=>rp({name:u$,initialState:hwe,asyncThunkCreator:e,filterCreatedVisits:({tag:t,query:n={}},r)=>{const{startDate:i,endDate:o}=n;return r.filter(({shortUrl:a,visit:s})=>(a==null?void 0:a.tags.includes(t))&&Xh(s.date,i,o))}}),d$="shlink/visitsOverview",Um={nonOrphanVisits:{total:0},orphanVisits:{total:0},loading:!1,error:!1},LA=e=>e.filter(({visit:t})=>t.potentialBot).length,gwe=e=>Nr(`${d$}/loadVisitsOverview`,()=>e().getVisitsOverview().then(({nonOrphanVisits:t,visitsCount:n,orphanVisits:r,orphanVisitsCount:i})=>({nonOrphanVisits:{total:(t==null?void 0:t.total)??n,nonBots:t==null?void 0:t.nonBots,bots:t==null?void 0:t.bots},orphanVisits:{total:(r==null?void 0:r.total)??i,nonBots:r==null?void 0:r.nonBots,bots:r==null?void 0:r.bots}}))),vwe=e=>ur({name:d$,initialState:Um,reducers:{},extraReducers:t=>{t.addCase(e.pending,()=>({...Um,loading:!0})),t.addCase(e.rejected,()=>({...Um,error:!0})),t.addCase(e.fulfilled,(n,{payload:r})=>({...Um,...r})),t.addCase(ep,({nonOrphanVisits:n,orphanVisits:r,...i},{payload:o})=>{const{nonOrphanVisits:a,orphanVisits:s}=R1e(o.createdVisits),l=a.length,c=LA(a),d=l-c,f=s.length,p=LA(s),m=f-p;return{...i,nonOrphanVisits:{total:n.total+l,bots:n.bots&&n.bots+c,nonBots:n.nonBots&&n.nonBots+d},orphanVisits:{total:r.total+f,bots:r.bots&&r.bots+p,nonBots:r.nonBots&&r.nonBots+m}}})}}),ywe=({shortUrlDetail:e,shortUrlVisits:t,goBack:n})=>{const{shortUrl:r,loading:i}=e,{visits:o}=t,a=(r==null?void 0:r.shortUrl)??"",s=(r==null?void 0:r.longUrl)??"",l=r==null?void 0:r.title;return g.jsxs(sp,{title:g.jsxs(g.Fragment,{children:["Visits for ",g.jsx(Yo,{href:a})]}),goBack:n,visits:o,shortUrl:r,children:[g.jsx("hr",{}),g.jsxs("div",{children:["Created: ",(()=>r?g.jsxs("span",{children:[g.jsx("b",{id:"created",className:"short-url-visits-header__created-at",children:g.jsx(ry,{date:r.dateCreated,relative:!0})}),g.jsx(Dr,{placement:"bottom",target:"created",children:g.jsx(ry,{date:r.dateCreated})})]}):g.jsx("small",{children:"Loading..."}))()]}),g.jsxs("div",{className:"long-url-container",children:[`${l?"Title":"Long URL"}: `,i&&g.jsx("small",{children:"Loading..."}),!i&&g.jsx(Yo,{href:s,children:l??s})]})]})},_we=({exportVisits:e})=>xs(({shortUrlVisits:t,shortUrlDetail:n,getShortUrlVisits:r,getShortUrlDetail:i,cancelGetShortUrlVisits:o})=>{const{shortCode:a=""}=Rl(),{search:s}=yn(),l=Yu(),{domain:c}=Dl(s),d=(p,m)=>r({shortCode:gg(a),query:{...ap(p),domain:c},doIntervalFallback:m}),f=p=>{var m;return e(`short-url_${(m=n.shortUrl)==null?void 0:m.shortUrl.replace(/https?:\/\//g,"")}_visits.csv`,p)};return $.useEffect(()=>{i({shortCode:gg(a),domain:c})},[]),g.jsx(cp,{getVisits:d,cancelGetVisits:o,visitsInfo:t,exportCsv:f,children:g.jsx(ywe,{shortUrlDetail:n,shortUrlVisits:t,goBack:l})})},(t,n)=>n.shortCode?[yi.shortUrlVisits(gg(n.shortCode))]:[]),bwe=({tagVisits:e,goBack:t,colorGenerator:n})=>{const{visits:r,tag:i}=e;return g.jsx(sp,{title:g.jsxs("span",{className:"d-flex align-items-center justify-content-center",children:[g.jsx("span",{className:"me-2",children:"Visits for"}),g.jsx(FT,{text:i,colorGenerator:n})]}),goBack:t,visits:r})},wwe=(e,{exportVisits:t})=>xs(({getTagVisits:n,tagVisits:r,cancelGetTagVisits:i})=>{const o=Yu(),{tag:a=""}=Rl();return g.jsx(cp,{getVisits:(s,l)=>n({tag:a,query:ap(s),doIntervalFallback:l}),cancelGetVisits:i,visitsInfo:r,exportCsv:s=>t(`tag_${a}_visits.csv`,s),children:g.jsx(bwe,{tagVisits:r,goBack:o,colorGenerator:e})})},()=>[yi.visits]),xwe=(e,t)=>{e.serviceFactory("MapModal",()=>n$),e.serviceFactory("ShortUrlVisits",_we,"ReportExporter"),e.decorator("ShortUrlVisits",t(["shortUrlVisits","shortUrlDetail","mercureInfo"],["getShortUrlVisits","getShortUrlDetail","cancelGetShortUrlVisits","createNewVisits","loadMercureInfo"])),e.serviceFactory("TagVisits",wwe,"ColorGenerator","ReportExporter"),e.decorator("TagVisits",t(["tagVisits","mercureInfo"],["getTagVisits","cancelGetTagVisits","createNewVisits","loadMercureInfo"])),e.serviceFactory("DomainVisits",ewe,"ReportExporter"),e.decorator("DomainVisits",t(["domainVisits","mercureInfo"],["getDomainVisits","cancelGetDomainVisits","createNewVisits","loadMercureInfo"])),e.serviceFactory("OrphanVisits",nwe,"ReportExporter"),e.decorator("OrphanVisits",t(["orphanVisits","mercureInfo"],["getOrphanVisits","cancelGetOrphanVisits","createNewVisits","loadMercureInfo"])),e.serviceFactory("NonOrphanVisits",twe,"ReportExporter"),e.decorator("NonOrphanVisits",t(["nonOrphanVisits","mercureInfo"],["getNonOrphanVisits","cancelGetNonOrphanVisits","createNewVisits","loadMercureInfo"])),e.serviceFactory("VisitsParser",()=>qbe),e.serviceFactory("getShortUrlVisits",dwe,"apiClientFactory"),e.serviceFactory("cancelGetShortUrlVisits",mt("cancelGetVisits"),"shortUrlVisitsReducerCreator"),e.serviceFactory("getTagVisits",pwe,"apiClientFactory"),e.serviceFactory("cancelGetTagVisits",mt("cancelGetVisits"),"tagVisitsReducerCreator"),e.serviceFactory("getDomainVisits",Qpe,"apiClientFactory"),e.serviceFactory("cancelGetDomainVisits",mt("cancelGetVisits"),"domainVisitsReducerCreator"),e.serviceFactory("getOrphanVisits",lwe,"apiClientFactory"),e.serviceFactory("cancelGetOrphanVisits",mt("cancelGetVisits"),"orphanVisitsReducerCreator"),e.serviceFactory("getNonOrphanVisits",iwe,"apiClientFactory"),e.serviceFactory("cancelGetNonOrphanVisits",mt("cancelGetVisits"),"nonOrphanVisitsReducerCreator"),e.serviceFactory("createNewVisits",()=>ep),e.serviceFactory("loadVisitsOverview",gwe,"apiClientFactory"),e.serviceFactory("visitsOverviewReducerCreator",vwe,"loadVisitsOverview"),e.serviceFactory("visitsOverviewReducer",mt("reducer"),"visitsOverviewReducerCreator"),e.serviceFactory("domainVisitsReducerCreator",Xpe,"getDomainVisits"),e.serviceFactory("domainVisitsReducer",mt("reducer"),"domainVisitsReducerCreator"),e.serviceFactory("nonOrphanVisitsReducerCreator",owe,"getNonOrphanVisits"),e.serviceFactory("nonOrphanVisitsReducer",mt("reducer"),"nonOrphanVisitsReducerCreator"),e.serviceFactory("orphanVisitsReducerCreator",cwe,"getOrphanVisits"),e.serviceFactory("orphanVisitsReducer",mt("reducer"),"orphanVisitsReducerCreator"),e.serviceFactory("shortUrlVisitsReducerCreator",fwe,"getShortUrlVisits"),e.serviceFactory("shortUrlVisitsReducer",mt("reducer"),"shortUrlVisitsReducerCreator"),e.serviceFactory("tagVisitsReducerCreator",mwe,"getTagVisits"),e.serviceFactory("tagVisitsReducer",mt("reducer"),"tagVisitsReducerCreator")},jd=({children:e,to:t,className:n,...r})=>g.jsx(BD,{className:({isActive:i})=>rt("aside-menu__item",n,{"aside-menu__item--selected":i}),to:t,...r,children:e}),Swe=({routePrefix:e,showOnMobile:t=!1})=>{const{pathname:n}=yn(),r=rt("aside-menu",{"aside-menu--hidden":!t}),i=o=>`${e}${o}`;return g.jsx("aside",{className:r,children:g.jsxs("nav",{className:"nav flex-column aside-menu__nav",children:[g.jsxs(jd,{to:i("/overview"),children:[g.jsx(Ae,{fixedWidth:!0,icon:sY}),g.jsx("span",{className:"aside-menu__item-text",children:"Overview"})]}),g.jsxs(jd,{to:i("/list-short-urls/1"),className:rt({"aside-menu__item--selected":n.match("/list-short-urls")!==null}),children:[g.jsx(Ae,{fixedWidth:!0,icon:u4}),g.jsx("span",{className:"aside-menu__item-text",children:"List short URLs"})]}),g.jsxs(jd,{to:i("/create-short-url"),children:[g.jsx(Ae,{fixedWidth:!0,icon:fY,flip:"horizontal"}),g.jsx("span",{className:"aside-menu__item-text",children:"Create short URL"})]}),g.jsxs(jd,{to:i("/manage-tags"),children:[g.jsx(Ae,{fixedWidth:!0,icon:d4}),g.jsx("span",{className:"aside-menu__item-text",children:"Manage tags"})]}),g.jsxs(jd,{to:i("/manage-domains"),children:[g.jsx(Ae,{fixedWidth:!0,icon:BW}),g.jsx("span",{className:"aside-menu__item-text",children:"Manage domains"})]})]})})},Ewe=(e,t,n,r,i,o,a,s,l,c,d)=>({createNotFound:f})=>{const p=yn(),m=Ul(),[v,y,x,_]=Tn();$.useEffect(()=>_(),[p]);const w=Qh("domainVisits"),S=rt("shlink-layout__burger-icon",{"shlink-layout__burger-icon--active":v}),E=zme(x,_);return g.jsxs(g.Fragment,{children:[g.jsx(Ae,{icon:DW,className:S,onClick:y}),g.jsx("div",{...E,className:"shlink-layout__swipeable",children:g.jsxs("div",{className:"shlink-layout__swipeable-inner",children:[g.jsx(Swe,{routePrefix:m,showOnMobile:v}),g.jsx("div",{className:"shlink-layout__container",onClick:()=>_(),children:g.jsx("div",{className:"container-xl",children:g.jsxs(Gy,{children:[g.jsx(vt,{index:!0,element:g.jsx(DS,{replace:!0,to:"overview"})}),g.jsx(vt,{path:"/overview",element:g.jsx(l,{})}),g.jsx(vt,{path:"/list-short-urls/:page",element:g.jsx(t,{})}),g.jsx(vt,{path:"/create-short-url",element:g.jsx(n,{})}),g.jsx(vt,{path:"/short-code/:shortCode/visits/*",element:g.jsx(r,{})}),g.jsx(vt,{path:"/short-code/:shortCode/edit",element:g.jsx(c,{})}),g.jsx(vt,{path:"/tag/:tag/visits/*",element:g.jsx(i,{})}),w&&g.jsx(vt,{path:"/domain/:domain/visits/*",element:g.jsx(o,{})}),g.jsx(vt,{path:"/orphan-visits/*",element:g.jsx(a,{})}),g.jsx(vt,{path:"/non-orphan-visits/*",element:g.jsx(s,{})}),g.jsx(vt,{path:"/manage-tags",element:g.jsx(e,{})}),g.jsx(vt,{path:"/manage-domains",element:g.jsx(d,{})}),f&&g.jsx(vt,{path:"*",element:f("/list-short-urls/1")})]})})})]})})]})},Twe=!0,Owe=e=>y6({devTools:!Twe,reducer:BE({mercureInfo:e.mercureInfoReducer,shortUrlsList:e.shortUrlsListReducer,shortUrlCreation:e.shortUrlCreationReducer,shortUrlDeletion:e.shortUrlDeletionReducer,shortUrlEdition:e.shortUrlEditionReducer,shortUrlDetail:e.shortUrlDetailReducer,shortUrlVisits:e.shortUrlVisitsReducer,tagVisits:e.tagVisitsReducer,domainVisits:e.domainVisitsReducer,orphanVisits:e.orphanVisitsReducer,nonOrphanVisits:e.nonOrphanVisitsReducer,tagsList:e.tagsListReducer,tagDelete:e.tagDeleteReducer,tagEdit:e.tagEditReducer,domainsList:e.domainsListReducer,visitsOverview:e.visitsOverviewReducer}),middleware:t=>t({immutableCheck:!1,serializableCheck:!1})}),Cwe=e=>{e.serviceFactory("Main",Ewe,"TagsList","ShortUrlsList","CreateShortUrl","ShortUrlVisits","TagVisits","DomainVisits","OrphanVisits","NonOrphanVisits","Overview","EditShortUrl","ManageDomains"),e.factory("store",Owe)},Oo=new Hce,{container:kwe}=Oo,Pwe=(e,t)=>(...n)=>e[t](...n),Lwe=(e,t)=>({...e,[t]:Pwe(kwe,t)}),up=(e,t=[])=>PD(e?W5(e):null,t.reduce(Lwe,{}));Cwe(Oo);Zye(Oo,up);p_e(Oo,up);xwe(Oo,up);dme(Oo);lme(Oo,up);Ome(Oo,up);M1e(Oo);let jA;const jwe=e=>({serverVersion:t,apiClient:n,settings:r,routesPrefix:i="",createNotFound:o,tagColorsStorage:a})=>{const s=zde(t),l=$.useRef(),[c,d]=$.useState(),f=Al(),[p,m]=$.useMemo(()=>f?[$.Fragment,{}]:[UD,{basename:i}],[f,i]);return $.useEffect(()=>{jA=n,e.value("apiClientFactory",()=>jA),a&&e.value("TagColorsStorage",a);const{container:v}=e,{Main:y,store:x,loadMercureInfo:_,listTags:w}=v;l.current=g.jsx(y,{createNotFound:o}),d(x),x.dispatch(_(r)),x.dispatch(w())},[n,a]),c?g.jsx(LD,{store:c,children:g.jsx(Sme,{value:r,children:g.jsx(Vde,{value:s,children:g.jsx(Hde,{value:i,children:g.jsx(p,{...m,children:l.current})})})})}):g.jsx(g.Fragment,{})},Mwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",Awe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",Rwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC",Nwe=()=>{delete kA.Icon.Default.prototype._getIconUrl,kA.Icon.Default.mergeOptions({iconRetinaUrl:Awe,iconUrl:Mwe,shadowUrl:Rwe})};Nwe();const Dwe=jwe(Oo);function ly(e){return t=>{const{resetSelectedServer:n}=t;return $.useEffect(()=>{n()},[n]),g.jsx(e,{...t})}}const Iwe=({location:e},{error:t})=>class extends $.Component{constructor(n){super(n),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n){t(n)}render(){const{hasError:n}=this.state;if(n)return g.jsx("div",{className:"home",children:g.jsxs(gn,{className:"p-4",children:[g.jsx("h1",{children:"Oops! This is awkward :S"}),g.jsx("p",{children:"It seems that something went wrong. Try refreshing the page or just click this button."}),g.jsx("br",{}),g.jsx(yt,{outline:!0,color:"primary",onClick:()=>e.reload(),children:"Take me back"})]})});const{children:r}=this.props;return r}},f$=({href:e,children:t,rel:n,...r})=>g.jsx("a",{target:"_blank",rel:`noopener noreferrer${n?` ${n}`:""}`,href:e,...r,children:t??e});const Fwe=({id:e,name:t})=>g.jsxs(DI,{tag:Ft,to:`/server/${e}`,className:"servers-list__server-item",children:[t,g.jsx(Ae,{icon:vY,className:"servers-list__server-item-icon"})]}),h$=({servers:e,children:t,embedded:n=!1})=>g.jsxs(g.Fragment,{children:[t&&g.jsx("h5",{className:"mb-md-3",children:t}),e.length>0&&g.jsx(AI,{className:Ve("servers-list__list-group",{"servers-list__list-group--embedded":n}),children:e.map(({id:r,name:i})=>g.jsx(Fwe,{id:r,name:i},r))})]}),p$=({color:e=OE,className:t})=>g.jsx("svg",{className:t,viewBox:"0 0 512 512",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:g.jsxs("g",{fill:e,children:[g.jsx("path",{d:" M 23.71 85.08 C 17.22 49.81 49.44 14.86 85.08 18.12 C 118.83 19.21 145.72 53.33 139.45 86.37 C 155.64 102.30 171.32 118.83 187.87 134.36 C 198.32 111.73 208.84 89.12 219.57 66.62 C 226.05 53.84 243.47 48.74 255.73 56.27 C 263.76 62.10 270.34 69.69 277.25 76.75 C 286.28 86.61 285.72 102.89 276.31 112.31 C 223.38 165.37 170.38 218.37 117.35 271.34 C 107.72 280.99 91.01 281.25 81.11 271.86 C 74.39 264.94 66.82 258.69 61.24 250.77 C 53.72 238.52 58.85 221.07 71.64 214.62 C 94.11 203.87 116.72 193.38 139.33 182.91 C 123.81 166.36 107.30 150.68 91.37 134.49 C 60.20 140.28 27.37 116.78 23.71 85.08 Z"}),g.jsx("path",{d:" M 205.21 201.23 C 225.32 181.36 260.88 181.11 281.14 200.86 C 299.25 218.75 317.37 236.65 335.10 254.93 C 356.73 278.01 352.01 318.70 326.03 336.56 C 320.07 330.47 313.73 324.65 308.12 318.28 C 323.86 309.39 328.76 286.18 316.63 272.39 C 301.73 256.95 286.30 242.03 271.24 226.75 C 264.49 219.65 256.80 212.00 246.37 211.52 C 224.65 208.64 205.52 233.36 214.49 253.58 C 221.09 266.81 234.22 275.12 243.62 286.24 C 240.43 295.96 238.09 306.13 238.29 316.46 C 225.55 304.29 213.16 291.73 200.89 279.09 C 180.97 257.57 183.10 220.45 205.21 201.23 Z"}),g.jsx("path",{d:" M 273.90 352.07 C 252.28 328.99 256.98 288.31 282.96 270.46 C 288.93 276.54 295.26 282.36 300.88 288.72 C 285.14 297.62 280.23 320.82 292.38 334.61 C 307.27 350.05 322.70 364.96 337.75 380.25 C 344.51 387.35 352.20 395.00 362.64 395.48 C 384.35 398.37 403.49 373.64 394.51 353.42 C 387.92 340.18 374.78 331.88 365.38 320.76 C 368.56 311.04 370.91 300.86 370.71 290.54 C 383.45 302.70 395.84 315.27 408.11 327.91 C 428.03 349.43 425.90 386.55 403.78 405.77 C 383.68 425.64 348.13 425.89 327.86 406.14 C 309.75 388.25 291.60 370.37 273.90 352.07 Z"}),g.jsx("path",{d:" M 422.11 403.83 C 431.96 394.07 441.60 384.06 451.66 374.51 C 460.90 383.74 471.89 392.70 474.89 406.11 C 480.16 429.97 484.08 454.13 488.76 478.12 C 490.00 483.41 484.47 488.29 479.35 486.63 C 454.66 481.52 429.55 478.12 405.14 471.84 C 393.17 467.97 385.20 457.75 376.55 449.27 C 386.39 439.49 396.13 429.60 406.06 419.91 C 416.37 433.45 435.74 414.00 422.11 403.83 Z"})]})});const $we=({servers:e})=>{const t=Eo(),n=VS(e),r=!r4(n);return $.useEffect(()=>{const i=n.find(({autoConnect:o})=>o);i&&t(`/server/${i.id}`)},[n,t]),g.jsx("div",{className:"home",children:g.jsx(Zr,{className:"home__main-card",children:g.jsxs(yr,{className:"g-0",children:[g.jsx("div",{className:"col-md-5 d-none d-md-block",children:g.jsx("div",{className:"home__logo-wrapper",children:g.jsx("div",{className:"home__logo",children:g.jsx(p$,{})})})}),g.jsxs("div",{className:"col-md-7 home__servers-container",children:[g.jsx("div",{className:"home__title-wrapper",children:g.jsx("h1",{className:"home__title",children:"Welcome!"})}),g.jsx(h$,{embedded:!0,servers:n,children:!r&&g.jsxs("div",{className:"p-4 text-center",children:[g.jsx("p",{className:"mb-5",children:"This application will help you manage your Shlink servers."}),g.jsx("p",{children:g.jsxs(Ft,{to:"/server/create",className:"btn btn-outline-primary btn-lg me-2",children:[g.jsx(Ae,{icon:KS})," ",g.jsx("span",{className:"ms-1",children:"Add a server"})]})}),g.jsx("p",{className:"mb-0 mt-5",children:g.jsx(f$,{href:"https://shlink.io/documentation",children:g.jsxs("small",{children:[g.jsx("span",{className:"me-1",children:"Learn more about Shlink"})," ",g.jsx(Ae,{icon:XW})]})})})]})})]})]})})})};const Uwe=e=>()=>{const[t,n,,r]=Tn(),i=yn(),{pathname:o}=i;$.useEffect(r,[i,r]);const a="/settings",s=Ve("main-header__toggle-icon",{"main-header__toggle-icon--opened":t});return g.jsxs(X4,{color:"primary",dark:!0,fixed:"top",className:"main-header",expand:"md",children:[g.jsxs(J4,{tag:Ft,to:"/",children:[g.jsx(p$,{className:"main-header__brand-logo",color:"white"})," Shlink"]}),g.jsx(eI,{onClick:n,children:g.jsx(Ae,{icon:mY,className:s})}),g.jsx(pX,{navbar:!0,isOpen:t,children:g.jsxs(dE,{navbar:!0,className:"ms-auto",children:[g.jsx(tI,{children:g.jsxs(iI,{tag:Ft,to:a,active:o.startsWith(a),children:[g.jsx(Ae,{icon:wY}),"  Settings"]})}),g.jsx(e,{})]})})]})},Bwe=({children:e})=>{const t=yn();return $.useEffect(()=>{scrollTo(0,0)},[t]),g.jsx(g.Fragment,{children:e})},zwe=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,MA=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(zwe);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},AA=e=>e==="*"||e==="x"||e==="X",RA=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},Vwe=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Hwe=(e,t)=>{if(AA(e)||AA(t))return 0;const[n,r]=Vwe(RA(e),RA(t));return n>r?1:n{for(let n=0;n{const n=MA(e),r=MA(t),i=n.pop(),o=r.pop(),a=NA(n,r);return a!==0?a:i&&o?NA(i.split("."),o.split(".")):i||o?i?-1:1:0},Ywe=(e,t,n)=>{Gwe(n);const r=Wwe(e,t);return m$[n].includes(r)},m$={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},DA=Object.keys(m$),Gwe=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(DA.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${DA.join("|")}`)},g$=i4(n4,e=>{try{return Ywe(e,e,"=")}catch{return!1}}),v$=e=>g$(e)?`v${e}`:e,y$=(e="latest")=>t=>g$(t)?t:e,qwe="%_VERSION_%",Kwe=Qy(y$(),v$),IA=({project:e,version:t})=>g.jsx(f$,{href:`https://github.com/shlinkio/${e}/releases/${t}`,className:"text-muted",children:g.jsx("b",{children:t})}),Zwe=({selectedServer:e,clientVersion:t=qwe})=>{const n=Kwe(t);return g.jsxs("small",{className:"text-muted",children:[l4(e)&&g.jsxs(g.Fragment,{children:["Server: ",g.jsx(IA,{project:"shlink",version:e.printableVersion})," - "]}),"Client: ",g.jsx(IA,{project:"shlink-web-client",version:n})]})};const Qwe=/^\/server\/[a-zA-Z0-9-]*\/(?!edit)/,Xwe=({selectedServer:e})=>{const{pathname:t}=yn(),n=$.useMemo(()=>Qwe.test(t),[t]),r=Ve("text-center",{"shlink-versions-container--with-sidebar":n});return g.jsx("div",{className:r,children:g.jsx(Zwe,{selectedServer:e})})};const qu=({children:e})=>g.jsx("div",{className:"no-menu-wrapper container-xl",children:e});function _$(e,t){return n=>{const r=Rl(),{selectServer:i,selectedServer:o}=n;return $.useEffect(()=>{r.serverId&&i(r.serverId)},[r.serverId,i]),o?SW(o)?g.jsx(t,{}):g.jsx(e,{...n}):g.jsx(qu,{children:g.jsx(Wo,{loading:!0})})}}const Jwe=(e,t,n,r)=>_$(({selectedServer:i,settings:o})=>{const a=l4(i),s=a?`/server/${i.id}`:"";return a?g.jsx(n,{serverVersion:i.version,apiClient:e(i),settings:o,routesPrefix:s,tagColorsStorage:t,createNotFound:l=>g.jsx(l6,{to:`${s}${l}`,children:"List short URLs"})}):g.jsx(r,{})},r),exe=(e,t)=>{e.constant("window",window),e.constant("console",console),e.constant("fetch",window.fetch.bind(window)),e.service("HttpClient",uie,"fetch"),e.serviceFactory("ScrollToTop",()=>Bwe),e.serviceFactory("MainHeader",Uwe,"ServersDropdown"),e.serviceFactory("Home",()=>$we),e.decorator("Home",ly),e.decorator("Home",t(["servers"],["resetSelectedServer"])),e.serviceFactory("ShlinkWebComponent",()=>Dwe),e.serviceFactory("ShlinkWebComponentContainer",Jwe,"buildShlinkApiClient","TagColorsStorage","ShlinkWebComponent","ServerError"),e.decorator("ShlinkWebComponentContainer",t(["selectedServer","settings"],["selectServer"])),e.serviceFactory("ShlinkVersionsContainer",()=>Xwe),e.decorator("ShlinkVersionsContainer",t(["selectedServer"])),e.serviceFactory("ErrorHandler",Iwe,"window","console")};let Bm;const txe=new Uint8Array(16);function nxe(){if(!Bm&&(Bm=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Bm))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bm(txe)}const qn=[];for(let e=0;e<256;++e)qn.push((e+256).toString(16).slice(1));function rxe(e,t=0){return(qn[e[t+0]]+qn[e[t+1]]+qn[e[t+2]]+qn[e[t+3]]+"-"+qn[e[t+4]]+qn[e[t+5]]+"-"+qn[e[t+6]]+qn[e[t+7]]+"-"+qn[e[t+8]]+qn[e[t+9]]+"-"+qn[e[t+10]]+qn[e[t+11]]+qn[e[t+12]]+qn[e[t+13]]+qn[e[t+14]]+qn[e[t+15]]).toLowerCase()}const ixe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),FA={randomUUID:ixe};function b$(e,t,n){if(FA.randomUUID&&!t&&!e)return FA.randomUUID();e=e||{};const r=e.random||(e.rng||nxe)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return rxe(r)}const oxe=2e3,axe=(e,t)=>(n=!1,r=oxe)=>{const[i,o]=$.useState(n),a=$.useRef(void 0);return[i,()=>{o(!n),a.current&&t(a.current),a.current=e(()=>o(n),r)}]},w$=()=>{const e=Eo();return()=>e(-1)},sxe=()=>{const{search:e}=yn();return Dl(e)},x$=({isOpen:e,duplicatedServers:t,onDiscard:n,onSave:r})=>{const i=t.length>1;return g.jsxs(ua,{centered:!0,isOpen:e,children:[g.jsxs(da,{children:["Duplicated server",i&&"s"]}),g.jsxs(To,{children:[g.jsx("p",{children:i?"The next servers already exist:":"There is already a server with:"}),g.jsx("ul",{children:t.map(({url:o,apiKey:a},s)=>i?g.jsxs("li",{children:[g.jsx("b",{children:o})," - ",g.jsx("b",{children:a})]},s):g.jsxs($.Fragment,{children:[g.jsxs("li",{children:["URL: ",g.jsx("b",{children:o})]}),g.jsxs("li",{children:["API key: ",g.jsx("b",{children:a})]})]},s))}),g.jsxs("span",{children:[i?"Do you want to ignore duplicated servers":"Do you want to save this server anyway","?"]})]}),g.jsxs(Nl,{children:[g.jsx(yt,{color:"link",onClick:n,children:i?"Ignore duplicates":"Discard"}),g.jsx(yt,{color:"primary",onClick:r,children:"Save anyway"})]})]})},lxe=e=>Qy(t=>t.preventDefault(),e),S$=({onSubmit:e,initialValues:t,children:n,title:r})=>{const[i,o]=$.useState(""),[a,s]=$.useState(""),[l,c]=$.useState(""),d=lxe(()=>e({name:i,url:a,apiKey:l}));return $.useEffect(()=>{t&&o(t.name),t&&s(t.url),t&&c(t.apiKey)},[t]),g.jsxs("form",{className:"server-form",name:"serverForm",onSubmit:d,children:[g.jsxs(gn,{className:"mb-3",title:r,children:[g.jsx(og,{value:i,onChange:o,children:"Name"}),g.jsx(og,{type:"url",value:a,onChange:s,children:"URL"}),g.jsx(og,{value:l,onChange:c,children:"API key"})]}),g.jsx("div",{className:"text-end",children:n})]})},$A=4e3,UA=({type:e})=>g.jsx("div",{className:"mt-3",children:g.jsxs(Yr,{type:e,children:[e==="success"&&"Servers properly imported. You can now select one from the list :)",e==="error"&&"The servers could not be imported. Make sure the format is correct."]})}),cxe=(e,t)=>({servers:n,createServers:r})=>{const i=Eo(),o=w$(),a=!!Object.keys(n).length,[s,l]=t(!1,$A),[c,d]=t(!1,$A),[f,p]=Tn(),[m,v]=$.useState(),y=$.useCallback(x=>{const _=b$();r([{...x,id:_}]),i(`/server/${_}`)},[r,i]);return $.useEffect(()=>{if(!m)return;Object.values(n).some(({url:_,apiKey:w})=>(m==null?void 0:m.url)===_&&(m==null?void 0:m.apiKey)===w)?p():y(m)},[y,m,n,p]),g.jsxs(qu,{children:[g.jsxs(S$,{title:g.jsx("h5",{className:"mb-0",children:"Add new server"}),onSubmit:v,children:[!a&&g.jsx(e,{tooltipPlacement:"top",onImport:l,onImportError:d}),a&&g.jsx(yt,{outline:!0,onClick:o,children:"Cancel"}),g.jsx(yt,{outline:!0,color:"primary",className:"ms-2",children:"Create server"})]}),s&&g.jsx(UA,{type:"success"}),c&&g.jsx(UA,{type:"error"}),g.jsx(x$,{isOpen:f,duplicatedServers:m?[m]:[],onDiscard:o,onSave:()=>m&&y(m)})]})},uxe=e=>({server:t,className:n,children:r,textClassName:i})=>{const[o,,a,s]=Tn();return g.jsxs(g.Fragment,{children:[g.jsxs("button",{type:"button",className:Ve(n,"p-0 bg-transparent border-0"),onClick:a,children:[!r&&g.jsx(Ae,{fixedWidth:!0,icon:WS}),g.jsx("span",{className:i,children:r??"Remove this server"})]}),g.jsx(e,{server:t,isOpen:o,toggle:s})]})},dxe=({server:e,toggle:t,isOpen:n,deleteServer:r,redirectHome:i=!0})=>{const o=Eo(),a=$.useRef(!1),s=()=>{a.current=!0,t()},l=()=>{a.current&&(r(e),i&&o("/"))};return g.jsxs(ua,{isOpen:n,toggle:t,centered:!0,onClosed:l,children:[g.jsx(da,{toggle:t,className:"text-danger",children:"Remove server"}),g.jsxs(To,{children:[g.jsxs("p",{children:["Are you sure you want to remove ",g.jsx("b",{children:e?e.name:""}),"?"]}),g.jsx("p",{children:g.jsx("i",{children:"No data will be deleted, only the access to this server will be removed from this device. You can create it again at any moment."})})]}),g.jsxs(Nl,{children:[g.jsx(yt,{color:"link",onClick:t,children:"Cancel"}),g.jsx(yt,{color:"danger",onClick:s,children:"Delete"})]})]})},fxe=e=>_$(({editServer:t,selectedServer:n,selectServer:r})=>{const i=w$(),{reconnect:o}=sxe();if(!nf(n))return null;const a=s=>{t(n.id,s),o==="true"&&r(n.id),i()};return g.jsx(qu,{children:g.jsxs(S$,{title:g.jsxs("h5",{className:"mb-0",children:['Edit "',n.name,'"']}),initialValues:n,onSubmit:a,children:[g.jsx(yt,{outline:!0,className:"me-2",onClick:i,children:"Cancel"}),g.jsx(yt,{outline:!0,color:"primary",children:"Save"})]})})},e),BA=e=>({url:t,apiKey:n})=>e.some(r=>r.url===t&&r.apiKey===n),hxe=e=>({createServers:t,servers:n,children:r,onImport:i=()=>{},onImportError:o=()=>{},tooltipPlacement:a="bottom",className:s=""})=>{const l=_s(),[c,d]=$.useState([]),[f,,p,m]=Tn(),v=$.useRef([]),y=$.useCallback(S=>{t(S),i()},[t,i]),x=$.useCallback(async({target:S})=>{var E;return e.importServersFromFile((E=S.files)==null?void 0:E[0]).then(C=>{v.current=C;const k=Object.values(n),j=C.filter(BA(k)),A=!!j.length;A?d(j):y(C),A&&p()}).then(()=>{S.value=null}).catch(o)},[y,o,n,p]),_=$.useCallback(()=>{y(v.current),m()},[y,m,v]),w=()=>{y(v.current.filter(NH(BA(c)))),m()};return g.jsxs(g.Fragment,{children:[g.jsxs(yt,{outline:!0,id:"importBtn",className:s,onClick:()=>{var S;return(S=l.current)==null?void 0:S.click()},children:[g.jsx(Ae,{icon:HW,fixedWidth:!0})," ",r??"Import from file"]}),g.jsxs(Dr,{placement:a,target:"importBtn",children:["You can create servers by importing a CSV file with ",g.jsx("b",{children:"name"}),", ",g.jsx("b",{children:"apiKey"})," and ",g.jsx("b",{children:"url"})," columns."]}),g.jsx("input",{type:"file",accept:"text/csv",className:"d-none",ref:l,onChange:x}),g.jsx(x$,{isOpen:f,duplicatedServers:c,onDiscard:w,onSave:_})]})};const pxe=e=>({servers:t,selectedServer:n})=>g.jsx(qu,{children:g.jsxs("div",{className:"server-error__container flex-column",children:[g.jsxs(Wo,{className:"w-100 mb-3 mb-md-5",type:"error",fullWidth:!0,children:[!nf(n)&&"Could not find this Shlink server.",nf(n)&&g.jsxs(g.Fragment,{children:[g.jsx("p",{children:"Oops! Could not connect to this Shlink server."}),"Make sure you have internet connection, and the server is properly configured and on-line."]})]}),g.jsxs(h$,{servers:Object.values(t),children:["These are the Shlink servers currently configured. Choose one of them or ",g.jsx(Ft,{to:"/server/create",children:"add a new one"}),"."]}),nf(n)&&g.jsx("div",{className:"container mt-3 mt-md-5",children:g.jsxs("h5",{children:["Alternatively, if you think you may have miss-configured this server, you can ",g.jsx(e,{server:n,className:"server-error__delete-btn",children:"remove it"})," or ",g.jsx(Ft,{to:`/server/${n.id}/edit?reconnect=true`,children:"edit it"}),"."]})})]})}),mxe=4e3,gxe=(e,t,n,r)=>({servers:i})=>{const o=Object.values(i),[a,s]=$.useState(o),l=p=>s(o.filter(({name:m,url:v})=>`${m} ${v}`.toLowerCase().match(p.toLowerCase()))),c=a.some(({autoConnect:p})=>!!p),[d,f]=n(!1,mxe);return $.useEffect(()=>{s(Object.values(i))},[i]),g.jsxs(qu,{children:[g.jsx(Vh,{className:"mb-3",onChange:l}),g.jsxs(yr,{className:"mb-3",children:[g.jsxs("div",{className:"col-md-6 d-flex d-md-block mb-2 mb-md-0",children:[g.jsx(t,{className:"flex-fill",onImportError:f,children:"Import servers"}),o.length>0&&g.jsxs(yt,{outline:!0,className:"ms-2 flex-fill",onClick:async()=>e.exportServers(),children:[g.jsx(Ae,{icon:h4,fixedWidth:!0})," Export servers"]})]}),g.jsx("div",{className:"col-md-6 text-md-end d-flex d-md-block",children:g.jsxs(yt,{outline:!0,color:"primary",className:"flex-fill",tag:Ft,to:"/server/create",children:[g.jsx(Ae,{icon:KS,fixedWidth:!0})," Add a server"]})})]}),g.jsx(gn,{children:g.jsxs("table",{className:"table table-hover responsive-table mb-0",children:[g.jsx("thead",{className:"responsive-table__header",children:g.jsxs("tr",{children:[c&&g.jsx("th",{"aria-label":"Auto-connect",style:{width:"50px"}}),g.jsx("th",{children:"Name"}),g.jsx("th",{children:"Base URL"}),g.jsx("th",{"aria-label":"Options"})]})}),g.jsxs("tbody",{children:[!a.length&&g.jsx("tr",{className:"text-center",children:g.jsx("td",{colSpan:4,children:"No servers found."})}),a.map(p=>g.jsx(r,{server:p,hasAutoConnect:c},p.id))]})]})}),d&&g.jsx("div",{className:"mt-3",children:g.jsx(Yr,{type:"error",children:"The servers could not be imported. Make sure the format is correct."})})]})},vxe=e=>({server:t,hasAutoConnect:n})=>g.jsxs("tr",{className:"responsive-table__row",children:[n&&g.jsx("td",{className:"responsive-table__cell","data-th":"Auto-connect",children:t.autoConnect&&g.jsxs(g.Fragment,{children:[g.jsx(Ae,{icon:Yf,className:"text-primary",id:"autoConnectIcon"}),g.jsx(Dr,{target:"autoConnectIcon",placement:"right",children:"Auto-connect to this server"})]})}),g.jsx("th",{className:"responsive-table__cell","data-th":"Name",children:g.jsx(Ft,{to:`/server/${t.id}`,children:t.name})}),g.jsx("td",{className:"responsive-table__cell","data-th":"Base URL",children:t.url}),g.jsx("td",{className:"responsive-table__cell text-end",children:g.jsx(e,{server:t})})]}),yxe=e=>({server:t,setAutoConnect:n})=>{const[r,,i,o]=Tn(),a=`/server/${t.id}`,{autoConnect:s}=t,l=s?zW:mie;return g.jsxs(s0,{minWidth:170,children:[g.jsxs(Ue,{tag:Ft,to:a,children:[g.jsx(Ae,{icon:UW,fixedWidth:!0})," Connect"]}),g.jsxs(Ue,{tag:Ft,to:`${a}/edit`,children:[g.jsx(Ae,{icon:YS,fixedWidth:!0})," Edit server"]}),g.jsxs(Ue,{onClick:()=>n(t,!s),children:[g.jsx(Ae,{icon:l,fixedWidth:!0})," ",s?"Do not a":"A","uto-connect"]}),g.jsx(Ue,{divider:!0}),g.jsxs(Ue,{className:"dropdown-item--danger",onClick:i,children:[g.jsx(Ae,{icon:WS,fixedWidth:!0})," Remove server"]}),g.jsx(e,{redirectHome:!1,server:t,isOpen:r,toggle:o})]})},E$=(e,t)=>b6(e,t,{serializeError:n4}),_xe={},bxe=e=>e.id?e:ev("id",b$(),e),wxe=e4((e,t)=>ev(t.id,t,e),{}),{actions:xxe,reducer:Sxe}=ur({name:"shlink/servers",initialState:_xe,reducers:{editServer:{prepare:(e,t)=>({payload:{serverId:e,serverData:t}}),reducer:(e,{payload:t})=>{const{serverId:n,serverData:r}=t;return e[n]?ev(n,{...e[n],...r},e):e}},deleteServer:(e,{payload:t})=>qH(t.id,e),setAutoConnect:{prepare:({id:e},t)=>({payload:{serverId:e,autoConnect:t}}),reducer:(e,{payload:t})=>{const{serverId:n,autoConnect:r}=t;return e[n]?r?XH(fW(e).map(([i,o])=>[i,{...o,autoConnect:i===n}])):ev(n,{...e[n],autoConnect:r},e):e}},createServers:{prepare:Qy(zS(bxe),wxe,e=>({payload:e})),reducer:(e,{payload:t})=>({...e,...t})}}}),{editServer:Exe,deleteServer:Txe,setAutoConnect:Oxe,createServers:T$}=xxe,Cxe=Sxe,kxe=e=>Array.isArray(e)?e.filter(s4):[],Pxe=e=>E$("shlink/remoteServers/fetchServers",async(t,{dispatch:n})=>{const r=await e.jsonRequest(`${Qg.homepage}/servers.json`),i=kxe(r);n(T$(i))}),dO="shlink/selectedServer",Lxe="1.0.0",jxe="999.999.999",Mxe="latest",Axe=Qy(e=>e===Mxe?jxe:e,y$(Lxe)),Rxe=i4(e=>`${e.id}_${e.url}_${e.apiKey}`,async(e,t)=>t().then(({version:n})=>({version:Axe(n),printableVersion:v$(n)}))),zA=null,fO=Nn(`${dO}/resetSelectedServer`),Nxe=e=>E$(`${dO}/selectServer`,async(t,{dispatch:n,getState:r})=>{n(fO());const{servers:i}=r(),o=i[t];if(!o)return{serverNotFound:!0};try{const a=e(o),{version:s,printableVersion:l}=await Rxe(o,()=>a.health());return{...o,version:s,printableVersion:l}}catch{return{...o,serverNotReachable:!0}}}),Dxe=e=>ur({name:dO,initialState:zA,reducers:{},extraReducers:t=>{t.addCase(fO,()=>zA),t.addCase(e.fulfilled,(n,{payload:r})=>r)}}),Ixe=({servers:e,selectedServer:t})=>{const n=VS(e),r=()=>r4(n)?g.jsxs(Ue,{tag:Ft,to:"/server/create",children:[g.jsx(Ae,{icon:KS})," ",g.jsx("span",{className:"ms-1",children:"Add a server"})]}):g.jsxs(g.Fragment,{children:[n.map(({name:i,id:o})=>g.jsx(Ue,{tag:Ft,to:`/server/${o}`,active:EW(t)===o,children:i},o)),g.jsx(Ue,{divider:!0}),g.jsxs(Ue,{tag:Ft,to:"/manage-servers",children:[g.jsx(Ae,{icon:eP})," ",g.jsx("span",{className:"ms-1",children:"Manage servers"})]})]});return g.jsxs(zh,{nav:!0,inNavbar:!0,children:[g.jsxs(Uu,{nav:!0,caret:!0,children:[g.jsx(Ae,{icon:eP})," ",g.jsx("span",{className:"ms-1",children:"Servers"})]}),g.jsx($u,{end:!0,style:{right:0},children:r()})]})},Fxe=({document:e},t,n)=>{const r=e.createElement("a");r.setAttribute("href",t),r.setAttribute("download",n),r.style.visibility="hidden",e.body.appendChild(r),r.click(),e.body.removeChild(r)},$xe=(e,t,n)=>{const r=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(r);Fxe(e,i,n)},Uxe="shlink-servers.csv";class Bxe{constructor(t,n,r){Mp(this,"exportServers",async()=>{const t=VS(this.storage.get("servers")??{}).map(TW);try{const n=this.jsonToCsv(t);$xe(this.window,n,Uxe)}catch(n){console.error(n)}});this.storage=t,this.window=n,this.jsonToCsv=r}}const zxe=e=>typeof e.url=="string"&&typeof e.apiKey=="string"&&typeof e.name=="string",Vxe=e=>Array.isArray(e)&&e.every(zxe);class Hxe{constructor(t){this.csvToJson=t}async importServersFromFile(t){if(!t)throw new Error("No file provided");const n=await t.text(),r=await this.csvToJson(n);if(!Vxe(r))throw new Error("Provided file does not have the right format.");return r}}const Wxe=(e,t)=>{e.serviceFactory("ManageServers",gxe,"ServersExporter","ImportServersBtn","useTimeoutToggle","ManageServersRow"),e.decorator("ManageServers",ly),e.decorator("ManageServers",t(["selectedServer","servers"],["resetSelectedServer"])),e.serviceFactory("ManageServersRow",vxe,"ManageServersRowDropdown"),e.serviceFactory("ManageServersRowDropdown",yxe,"DeleteServerModal"),e.decorator("ManageServersRowDropdown",t(null,["setAutoConnect"])),e.serviceFactory("CreateServer",cxe,"ImportServersBtn","useTimeoutToggle"),e.decorator("CreateServer",ly),e.decorator("CreateServer",t(["selectedServer","servers"],["createServers","resetSelectedServer"])),e.serviceFactory("EditServer",fxe,"ServerError"),e.decorator("EditServer",t(["selectedServer"],["editServer","selectServer","resetSelectedServer"])),e.serviceFactory("ServersDropdown",()=>Ixe),e.decorator("ServersDropdown",t(["servers","selectedServer"])),e.serviceFactory("DeleteServerModal",()=>dxe),e.decorator("DeleteServerModal",t(null,["deleteServer"])),e.serviceFactory("DeleteServerButton",uxe,"DeleteServerModal"),e.serviceFactory("ImportServersBtn",hxe,"ServersImporter"),e.decorator("ImportServersBtn",t(["servers"],["createServers"])),e.serviceFactory("ServerError",pxe,"DeleteServerButton"),e.decorator("ServerError",t(["servers","selectedServer"])),e.service("ServersImporter",Hxe,"csvToJson"),e.service("ServersExporter",Bxe,"Storage","window","jsonToCsv"),e.serviceFactory("selectServer",Nxe,"buildShlinkApiClient","loadMercureInfo"),e.serviceFactory("createServers",()=>T$),e.serviceFactory("deleteServer",()=>Txe),e.serviceFactory("editServer",()=>Exe),e.serviceFactory("setAutoConnect",()=>Oxe),e.serviceFactory("fetchServers",Pxe,"HttpClient"),e.serviceFactory("resetSelectedServer",()=>fO),e.serviceFactory("selectedServerReducerCreator",Dxe,"selectServer"),e.serviceFactory("selectedServerReducer",wH("reducer"),"selectedServerReducerCreator")},Qc=({children:e})=>g.jsx("small",{className:"form-text text-muted d-block",children:e}),Yxe=e=>e?`${e}`:"",Gxe=({settings:e,toggleRealTimeUpdates:t,setRealTimeUpdatesInterval:n})=>{const{realTimeUpdates:r={enabled:!0}}=e,i=a0();return g.jsxs(gn,{title:"Real-time updates",className:"h-100",children:[g.jsx(zr,{children:g.jsxs(gu,{checked:r.enabled,onChange:t,children:["Enable or disable real-time updates.",g.jsxs(Qc,{children:["Real-time updates are currently being ",g.jsx("b",{children:r.enabled?"processed":"ignored"}),"."]})]})}),g.jsxs(zu,{noMargin:!0,label:"Real-time updates frequency (in minutes):",labelClassName:Ve("form-label",{"text-muted":!r.enabled}),id:i,children:[g.jsx(bl,{type:"number",min:0,placeholder:"Immediate",disabled:!r.enabled,value:Yxe(r.interval),id:i,onChange:({target:o})=>n(Number(o.value))}),r.enabled&&g.jsxs(Qc,{children:[r.interval!==void 0&&r.interval>0&&g.jsxs("span",{children:["Updates will be reflected in the UI every ",g.jsx("b",{children:r.interval})," minute",r.interval>1&&"s","."]}),!r.interval&&"Updates will be reflected in the UI as soon as they happen."]})]})]})},O$={field:"dateCreated",dir:"DESC"},qxe={realTimeUpdates:{enabled:!0},shortUrlCreation:{validateUrls:!1},ui:{theme:"light"},visits:{defaultInterval:"last30Days"},shortUrlsList:{defaultOrdering:O$}},Kxe=(e,{payload:t})=>aW(e,t),Ds=e=>({reducer:Kxe,prepare:e}),Is=e=>({payload:e}),{reducer:Zxe,actions:Qxe}=ur({name:"shlink/settings",initialState:qxe,reducers:{toggleRealTimeUpdates:Ds(e=>Is({realTimeUpdates:{enabled:e}})),setRealTimeUpdatesInterval:Ds(e=>Is({realTimeUpdates:{interval:e}})),setShortUrlCreationSettings:Ds(e=>Is({shortUrlCreation:e})),setShortUrlsListSettings:Ds(e=>Is({shortUrlsList:e})),setUiSettings:Ds(e=>Is({ui:e})),setVisitsSettings:Ds(e=>Is({visits:e})),setTagsSettings:Ds(e=>Is({tags:e}))}}),{toggleRealTimeUpdates:Xxe,setRealTimeUpdatesInterval:Jxe,setShortUrlCreationSettings:e2e,setShortUrlsListSettings:t2e,setUiSettings:n2e,setVisitsSettings:r2e,setTagsSettings:i2e}=Qxe,o2e=Zxe,W1=({items:e})=>g.jsx(g.Fragment,{children:e.map((t,n)=>g.jsx("div",{className:"mb-3",children:t},n))}),a2e=(e,t,n,r,i,o)=>()=>g.jsxs(qu,{children:[g.jsxs(VI,{className:"mb-3",children:[g.jsx(cf,{to:"general",children:"General"}),g.jsx(cf,{to:"short-urls",children:"Short URLs"}),g.jsx(cf,{to:"other-items",children:"Other items"})]}),g.jsxs(Gy,{children:[g.jsx(vt,{path:"general",element:g.jsx(W1,{items:[g.jsx(r,{}),g.jsx(e,{})]})}),g.jsx(vt,{path:"short-urls",element:g.jsx(W1,{items:[g.jsx(t,{}),g.jsx(n,{})]})}),g.jsx(vt,{path:"other-items",element:g.jsx(W1,{items:[g.jsx(o,{}),g.jsx(i,{})]})}),g.jsx(vt,{path:"*",element:g.jsx(DS,{replace:!0,to:"general"})})]})]}),Y1=e=>e==="includes"?"Suggest tags including input":"Suggest tags starting with input",s2e=e=>e==="includes"?g.jsxs(g.Fragment,{children:["The list of suggested tags will contain those ",g.jsx("b",{children:"including"})," provided input."]}):g.jsxs(g.Fragment,{children:["The list of suggested tags will contain those ",g.jsx("b",{children:"starting with"})," provided input."]}),l2e=({settings:e,setShortUrlCreationSettings:t})=>{const n=e.shortUrlCreation??{validateUrls:!1},r=i=>()=>t({...n??{validateUrls:!1},tagFilteringMode:i});return g.jsxs(gn,{title:"Short URLs form",className:"h-100",children:[g.jsx(zr,{children:g.jsxs(gu,{checked:n.validateUrls??!1,onChange:i=>t({...n,validateUrls:i}),children:["Request validation on long URLs when creating new short URLs.",g.jsxs(Qc,{children:["The initial state of the ",g.jsx("b",{children:"Validate URL"})," checkbox will be ",g.jsx("b",{children:n.validateUrls?"checked":"unchecked"}),"."]})]})}),g.jsx(zr,{children:g.jsxs(gu,{checked:n.forwardQuery??!0,onChange:i=>t({...n,forwardQuery:i}),children:["Make all new short URLs forward their query params to the long URL.",g.jsxs(Qc,{children:["The initial state of the ",g.jsx("b",{children:"Forward query params on redirect"})," checkbox will be ",g.jsx("b",{children:n.forwardQuery??!0?"checked":"unchecked"}),"."]})]})}),g.jsxs(zu,{noMargin:!0,label:"Tag suggestions search mode:",children:[g.jsxs(fa,{text:Y1(n.tagFilteringMode),children:[g.jsx(Ue,{active:!n.tagFilteringMode||n.tagFilteringMode==="startsWith",onClick:r("startsWith"),children:Y1("startsWith")}),g.jsx(Ue,{active:n.tagFilteringMode==="includes",onClick:r("includes"),children:Y1("includes")})]}),g.jsx(Qc,{children:s2e(n.tagFilteringMode)})]})]})},c2e={dateCreated:"Created at",shortCode:"Short URL",longUrl:"Long URL",title:"Title",visits:"Visits"},u2e=({settings:{shortUrlsList:e},setShortUrlsListSettings:t})=>g.jsx(gn,{title:"Short URLs list",className:"h-100",children:g.jsx(zu,{noMargin:!0,label:"Default ordering for short URLs list:",children:g.jsx(Hh,{items:c2e,order:(e==null?void 0:e.defaultOrdering)??O$,onChange:(n,r)=>t({defaultOrdering:{field:n,dir:r}})})})}),d2e={tag:"Tag",shortUrls:"Short URLs",visits:"Visits"},f2e=({settings:{tags:e},setTagsSettings:t})=>g.jsx(gn,{title:"Tags",className:"h-100",children:g.jsx(zu,{noMargin:!0,label:"Default ordering for tags list:",children:g.jsx(Hh,{items:d2e,order:(e==null?void 0:e.defaultOrdering)??{},onChange:(n,r)=>t({...e,defaultOrdering:{field:n,dir:r}})})})});const h2e=({settings:{ui:e},setUiSettings:t})=>g.jsxs(gn,{title:"User interface",className:"h-100",children:[g.jsx(Ae,{icon:(e==null?void 0:e.theme)==="dark"?SY:dY,className:"user-interface__theme-icon"}),g.jsx(gu,{checked:(e==null?void 0:e.theme)==="dark",onChange:n=>{t({...e,theme:n?"dark":"light"})},children:"Use dark theme."})]}),C$={today:"Today",yesterday:"Yesterday",last7Days:"Last 7 days",last30Days:"Last 30 days",last90Days:"Last 90 days",last180Days:"Last 180 days",last365Days:"Last 365 days"},p2e=(e,t)=>!e||e==="all"?t:C$[e],m2e=({onChange:e,active:t,allText:n})=>g.jsxs(fa,{text:p2e(t,n),children:[g.jsx(Ue,{active:t==="all",onClick:()=>e("all"),children:n}),g.jsx(Ue,{divider:!0}),Object.entries(C$).map(([r,i])=>g.jsx(Ue,{active:t===r,onClick:()=>e(r),children:i},r))]}),VA=e=>{var t;return((t=e.visits)==null?void 0:t.defaultInterval)??"last30Days"},g2e=({settings:e,setVisitsSettings:t})=>{var n,r;return g.jsxs(gn,{title:"Visits",className:"h-100",children:[g.jsx(zr,{children:g.jsxs(gu,{checked:!!((n=e.visits)!=null&&n.excludeBots),onChange:i=>t({defaultInterval:VA(e),excludeBots:i}),children:["Exclude bots wherever possible (this option‘s effect might depend on Shlink server‘s version).",g.jsxs(Qc,{children:["The visits coming from potential bots will be ",g.jsx("b",{children:(r=e.visits)!=null&&r.excludeBots?"excluded":"included"}),"."]})]})}),g.jsx(zu,{noMargin:!0,label:"Default interval to load on visits sections:",children:g.jsx(m2e,{allText:"All visits",active:VA(e),onChange:i=>t({defaultInterval:i})})})]})},v2e=(e,t)=>{e.serviceFactory("Settings",a2e,"RealTimeUpdatesSettings","ShortUrlCreationSettings","ShortUrlsListSettings","UserInterfaceSettings","VisitsSettings","TagsSettings"),e.decorator("Settings",ly),e.decorator("Settings",t(null,["resetSelectedServer"])),e.serviceFactory("RealTimeUpdatesSettings",()=>Gxe),e.decorator("RealTimeUpdatesSettings",t(["settings"],["toggleRealTimeUpdates","setRealTimeUpdatesInterval"])),e.serviceFactory("ShortUrlCreationSettings",()=>l2e),e.decorator("ShortUrlCreationSettings",t(["settings"],["setShortUrlCreationSettings"])),e.serviceFactory("UserInterfaceSettings",()=>h2e),e.decorator("UserInterfaceSettings",t(["settings"],["setUiSettings"])),e.serviceFactory("VisitsSettings",()=>g2e),e.decorator("VisitsSettings",t(["settings"],["setVisitsSettings"])),e.serviceFactory("TagsSettings",()=>f2e),e.decorator("TagsSettings",t(["settings"],["setTagsSettings"])),e.serviceFactory("ShortUrlsListSettings",()=>u2e),e.decorator("ShortUrlsListSettings",t(["settings"],["setShortUrlsListSettings"])),e.serviceFactory("toggleRealTimeUpdates",()=>Xxe),e.serviceFactory("setRealTimeUpdatesInterval",()=>Jxe),e.serviceFactory("setShortUrlCreationSettings",()=>e2e),e.serviceFactory("setShortUrlsListSettings",()=>t2e),e.serviceFactory("setUiSettings",()=>n2e),e.serviceFactory("setVisitsSettings",()=>r2e),e.serviceFactory("setTagsSettings",()=>i2e)};var y2e="Expected a function",k$="__lodash_hash_undefined__",P$=1/0,_2e="[object Function]",b2e="[object GeneratorFunction]",w2e="[object Symbol]",x2e=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,S2e=/^\w*$/,E2e=/^\./,T2e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O2e=/[\\^$.*+?()[\]{}|]/g,C2e=/\\(\\)?/g,k2e=/^\[object .+?Constructor\]$/,P2e=typeof Ap=="object"&&Ap&&Ap.Object===Object&&Ap,L2e=typeof self=="object"&&self&&self.Object===Object&&self,hO=P2e||L2e||Function("return this")();function j2e(e,t){return e==null?void 0:e[t]}function M2e(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var A2e=Array.prototype,R2e=Function.prototype,L$=Object.prototype,G1=hO["__core-js_shared__"],HA=function(){var e=/[^.]+$/.exec(G1&&G1.keys&&G1.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),j$=R2e.toString,pO=L$.hasOwnProperty,M$=L$.toString,N2e=RegExp("^"+j$.call(pO).replace(O2e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),WA=hO.Symbol,D2e=A2e.splice,I2e=A$(hO,"Map"),Oh=A$(Object,"create"),YA=WA?WA.prototype:void 0,GA=YA?YA.toString:void 0;function kl(e){var t=-1,n=e?e.length:0;for(this.clear();++t-1}function G2e(e,t){var n=this.__data__,r=j0(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}Ku.prototype.clear=V2e;Ku.prototype.delete=H2e;Ku.prototype.get=W2e;Ku.prototype.has=Y2e;Ku.prototype.set=G2e;function Hl(e){var t=-1,n=e?e.length:0;for(this.clear();++tr.toFixed(n).replace(".",t):r=>`${r}`.replace(".",t):n?r=>r.toFixed(n):r=>`${r}`}function vO(e={}){const t=typeof e.quote=="string"?e.quote:'"',n=typeof e.escapedQuote=="string"?e.escapedQuote:`${t}${t}`;return!t||t===n?r=>r:r=>(r.includes(t)&&(r=r.replace(new RegExp(t,"g"),n)),`${t}${r}${t}`)}function gSe(e={stringFormatter:vO()}){return t=>e.stringFormatter(t.toString().slice(7,-1))}function vSe(e={stringFormatter:vO()}){return t=>{if(t===null)return"";let n=JSON.stringify(t);return n===void 0?"":(n[0]==='"'&&(n=n.replace(/^"(.+)"$/,"$1")),e.stringFormatter(n))}}function KA(e,t,n){const r=e[t];return r===void 0?n:r}function D$(e,t){try{return Array.isArray(t)?e.push(...t):e.push(t),e}catch{return e.concat(t)}}function T2(e,t){let n=!0;return e.reduce((r,i)=>(i==null&&(i=""),n?(n=!1,`${i}`):`${r}${t}${i}`),"")}var ZA;(function(e){e.header="header",e.undefined="undefined",e.boolean="boolean",e.number="number",e.bigint="bigint",e.string="string",e.symbol="symbol",e.function="function",e.object="object"})(ZA||(ZA={}));class ySe{constructor(t){this.opts=this.preprocessOpts(t)}preprocessOpts(t){const n=Object.assign({},t);n.fields&&(n.fields=this.preprocessFieldsInfo(n.fields,n.defaultValue)),n.transforms=n.transforms||[];const r=n.formatters&&n.formatters.string||vO(),i=vSe({stringFormatter:r}),o={header:r,undefined:q1,boolean:q1,number:mSe(),bigint:q1,string:r,symbol:gSe({stringFormatter:r}),function:i,object:i};return n.formatters=Object.assign(Object.assign({},o),n.formatters),n.delimiter=n.delimiter||",",n.eol=n.eol||` + */(function(e,t){(function(n,r){r(t)})(Dc,function(n){var r="1.9.4";function i(u){var h,b,T,P;for(b=1,T=arguments.length;b"u"||!L||!L.Mixin)){u=S(u)?u:[u];for(var h=0;h0?Math.floor(u):Math.ceil(u)};q.prototype={clone:function(){return new q(this.x,this.y)},add:function(u){return this.clone()._add(D(u))},_add:function(u){return this.x+=u.x,this.y+=u.y,this},subtract:function(u){return this.clone()._subtract(D(u))},_subtract:function(u){return this.x-=u.x,this.y-=u.y,this},divideBy:function(u){return this.clone()._divideBy(u)},_divideBy:function(u){return this.x/=u,this.y/=u,this},multiplyBy:function(u){return this.clone()._multiplyBy(u)},_multiplyBy:function(u){return this.x*=u,this.y*=u,this},scaleBy:function(u){return new q(this.x*u.x,this.y*u.y)},unscaleBy:function(u){return new q(this.x/u.x,this.y/u.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=I(this.x),this.y=I(this.y),this},distanceTo:function(u){u=D(u);var h=u.x-this.x,b=u.y-this.y;return Math.sqrt(h*h+b*b)},equals:function(u){return u=D(u),u.x===this.x&&u.y===this.y},contains:function(u){return u=D(u),Math.abs(u.x)<=Math.abs(this.x)&&Math.abs(u.y)<=Math.abs(this.y)},toString:function(){return"Point("+p(this.x)+", "+p(this.y)+")"}};function D(u,h,b){return u instanceof q?u:S(u)?new q(u[0],u[1]):u==null?u:typeof u=="object"&&"x"in u&&"y"in u?new q(u.x,u.y):new q(u,h,b)}function H(u,h){if(u)for(var b=h?[u,h]:u,T=0,P=b.length;T=this.min.x&&b.x<=this.max.x&&h.y>=this.min.y&&b.y<=this.max.y},intersects:function(u){u=ie(u);var h=this.min,b=this.max,T=u.min,P=u.max,B=P.x>=h.x&&T.x<=b.x,oe=P.y>=h.y&&T.y<=b.y;return B&&oe},overlaps:function(u){u=ie(u);var h=this.min,b=this.max,T=u.min,P=u.max,B=P.x>h.x&&T.xh.y&&T.y=h.lat&&P.lat<=b.lat&&T.lng>=h.lng&&P.lng<=b.lng},intersects:function(u){u=K(u);var h=this._southWest,b=this._northEast,T=u.getSouthWest(),P=u.getNorthEast(),B=P.lat>=h.lat&&T.lat<=b.lat,oe=P.lng>=h.lng&&T.lng<=b.lng;return B&&oe},overlaps:function(u){u=K(u);var h=this._southWest,b=this._northEast,T=u.getSouthWest(),P=u.getNorthEast(),B=P.lat>h.lat&&T.lath.lng&&T.lng1,nn=function(){var u=!1;try{var h=Object.defineProperty({},"passive",{get:function(){u=!0}});window.addEventListener("testPassiveEventSupport",f,h),window.removeEventListener("testPassiveEventSupport",f,h)}catch{}return u}(),fr=function(){return!!document.createElement("canvas").getContext}(),Vn=!!(document.createElementNS&&Me("svg").createSVGRect),Hn=!!Vn&&function(){var u=document.createElement("div");return u.innerHTML="",(u.firstChild&&u.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),_n=!Vn&&function(){try{var u=document.createElement("div");u.innerHTML='';var h=u.firstChild;return h.style.behavior="url(#default#VML)",h&&typeof h.adj=="object"}catch{return!1}}(),Pi=navigator.platform.indexOf("Mac")===0,Li=navigator.platform.indexOf("Linux")===0;function Wn(u){return navigator.userAgent.toLowerCase().indexOf(u)>=0}var ze={ie:_e,ielt9:Se,edge:ke,webkit:Ce,android:je,android23:ce,androidStock:ye,opera:ve,chrome:xe,gecko:Pe,safari:Ne,phantom:Qe,opera12:et,win:Ge,ie3d:Kt,webkit3d:Vt,gecko3d:On,any3d:dr,mobile:qi,mobileWebkit:zn,mobileWebkit3d:Zu,msPointer:Ki,pointer:dp,touch:hp,touchNative:fp,mobileOpera:Qu,mobileGecko:Es,retina:hn,passiveEvents:nn,canvas:fr,svg:Vn,vml:_n,inlineSvg:Hn,mac:Pi,linux:Li},bO=ze.msPointer?"MSPointerDown":"pointerdown",wO=ze.msPointer?"MSPointerMove":"pointermove",xO=ze.msPointer?"MSPointerUp":"pointerup",SO=ze.msPointer?"MSPointerCancel":"pointercancel",R0={touchstart:bO,touchmove:wO,touchend:xO,touchcancel:SO},EO={touchstart:W$,touchmove:pp,touchend:pp,touchcancel:pp},Yl={},TO=!1;function U$(u,h,b){return h==="touchstart"&&H$(),EO[h]?(b=EO[h].bind(this,b),u.addEventListener(R0[h],b,!1),b):(console.warn("wrong event specified:",h),f)}function B$(u,h,b){if(!R0[h]){console.warn("wrong event specified:",h);return}u.removeEventListener(R0[h],b,!1)}function z$(u){Yl[u.pointerId]=u}function V$(u){Yl[u.pointerId]&&(Yl[u.pointerId]=u)}function OO(u){delete Yl[u.pointerId]}function H$(){TO||(document.addEventListener(bO,z$,!0),document.addEventListener(wO,V$,!0),document.addEventListener(xO,OO,!0),document.addEventListener(SO,OO,!0),TO=!0)}function pp(u,h){if(h.pointerType!==(h.MSPOINTER_TYPE_MOUSE||"mouse")){h.touches=[];for(var b in Yl)h.touches.push(Yl[b]);h.changedTouches=[h],u(h)}}function W$(u,h){h.MSPOINTER_TYPE_TOUCH&&h.pointerType===h.MSPOINTER_TYPE_TOUCH&&Yn(h),pp(u,h)}function Y$(u){var h={},b,T;for(T in u)b=u[T],h[T]=b&&b.bind?b.bind(u):b;return u=h,h.type="dblclick",h.detail=2,h.isTrusted=!1,h._simulated=!0,h}var G$=200;function q$(u,h){u.addEventListener("dblclick",h);var b=0,T;function P(B){if(B.detail!==1){T=B.detail;return}if(!(B.pointerType==="mouse"||B.sourceCapabilities&&!B.sourceCapabilities.firesTouchEvents)){var oe=jO(B);if(!(oe.some(function(pe){return pe instanceof HTMLLabelElement&&pe.attributes.for})&&!oe.some(function(pe){return pe instanceof HTMLInputElement||pe instanceof HTMLSelectElement}))){var de=Date.now();de-b<=G$?(T++,T===2&&h(Y$(B))):T=1,b=de}}}return u.addEventListener("click",P),{dblclick:h,simDblclick:P}}function K$(u,h){u.removeEventListener("dblclick",h.dblclick),u.removeEventListener("click",h.simDblclick)}var N0=vp(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Xu=vp(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),CO=Xu==="webkitTransition"||Xu==="OTransition"?Xu+"End":"transitionend";function kO(u){return typeof u=="string"?document.getElementById(u):u}function Ju(u,h){var b=u.style[h]||u.currentStyle&&u.currentStyle[h];if((!b||b==="auto")&&document.defaultView){var T=document.defaultView.getComputedStyle(u,null);b=T?T[h]:null}return b==="auto"?null:b}function pt(u,h,b){var T=document.createElement(u);return T.className=h||"",b&&b.appendChild(T),T}function Ht(u){var h=u.parentNode;h&&h.removeChild(u)}function mp(u){for(;u.firstChild;)u.removeChild(u.firstChild)}function Gl(u){var h=u.parentNode;h&&h.lastChild!==u&&h.appendChild(u)}function ql(u){var h=u.parentNode;h&&h.firstChild!==u&&h.insertBefore(u,h.firstChild)}function D0(u,h){if(u.classList!==void 0)return u.classList.contains(h);var b=gp(u);return b.length>0&&new RegExp("(^|\\s)"+h+"(\\s|$)").test(b)}function Ze(u,h){if(u.classList!==void 0)for(var b=v(h),T=0,P=b.length;T0?2*window.devicePixelRatio:1;function AO(u){return ze.edge?u.wheelDeltaY/2:u.deltaY&&u.deltaMode===0?-u.deltaY/X$:u.deltaY&&u.deltaMode===1?-u.deltaY*20:u.deltaY&&u.deltaMode===2?-u.deltaY*60:u.deltaX||u.deltaZ?0:u.wheelDelta?(u.wheelDeltaY||u.wheelDelta)/2:u.detail&&Math.abs(u.detail)<32765?-u.detail*20:u.detail?u.detail/-32765*60:0}function q0(u,h){var b=h.relatedTarget;if(!b)return!0;try{for(;b&&b!==u;)b=b.parentNode}catch{return!1}return b!==u}var J$={__proto__:null,on:qe,off:Ct,stopPropagation:Cs,disableScrollPropagation:G0,disableClickPropagation:rd,preventDefault:Yn,stop:ks,getPropagationPath:jO,getMousePosition:MO,getWheelDelta:AO,isExternalTarget:q0,addListener:qe,removeListener:Ct},RO=le.extend({run:function(u,h,b,T){this.stop(),this._el=u,this._inProgress=!0,this._duration=b||.25,this._easeOutPower=1/Math.max(T||.5,.2),this._startPos=Os(u),this._offset=h.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=z(this._animate,this),this._step()},_step:function(u){var h=+new Date-this._startTime,b=this._duration*1e3;hthis.options.maxZoom)?this.setZoom(u):this},panInsideBounds:function(u,h){this._enforcingBounds=!0;var b=this.getCenter(),T=this._limitCenter(b,this._zoom,K(u));return b.equals(T)||this.panTo(T,h),this._enforcingBounds=!1,this},panInside:function(u,h){h=h||{};var b=D(h.paddingTopLeft||h.padding||[0,0]),T=D(h.paddingBottomRight||h.padding||[0,0]),P=this.project(this.getCenter()),B=this.project(u),oe=this.getPixelBounds(),de=ie([oe.min.add(b),oe.max.subtract(T)]),pe=de.getSize();if(!de.contains(B)){this._enforcingBounds=!0;var we=B.subtract(de.getCenter()),De=de.extend(B).getSize().subtract(pe);P.x+=we.x<0?-De.x:De.x,P.y+=we.y<0?-De.y:De.y,this.panTo(this.unproject(P),h),this._enforcingBounds=!1}return this},invalidateSize:function(u){if(!this._loaded)return this;u=i({animate:!1,pan:!0},u===!0?{animate:!0}:u);var h=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var b=this.getSize(),T=h.divideBy(2).round(),P=b.divideBy(2).round(),B=T.subtract(P);return!B.x&&!B.y?this:(u.animate&&u.pan?this.panBy(B):(u.pan&&this._rawPanBy(B),this.fire("move"),u.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:h,newSize:b}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(u){if(u=this._locateOptions=i({timeout:1e4,watch:!1},u),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var h=a(this._handleGeolocationResponse,this),b=a(this._handleGeolocationError,this);return u.watch?this._locationWatchId=navigator.geolocation.watchPosition(h,b,u):navigator.geolocation.getCurrentPosition(h,b,u),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(u){if(this._container._leaflet_id){var h=u.code,b=u.message||(h===1?"permission denied":h===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:h,message:"Geolocation error: "+b+"."})}},_handleGeolocationResponse:function(u){if(this._container._leaflet_id){var h=u.coords.latitude,b=u.coords.longitude,T=new re(h,b),P=T.toBounds(u.coords.accuracy*2),B=this._locateOptions;if(B.setView){var oe=this.getBoundsZoom(P);this.setView(T,B.maxZoom?Math.min(oe,B.maxZoom):oe)}var de={latlng:T,bounds:P,timestamp:u.timestamp};for(var pe in u.coords)typeof u.coords[pe]=="number"&&(de[pe]=u.coords[pe]);this.fire("locationfound",de)}},addHandler:function(u,h){if(!h)return this;var b=this[u]=new h(this);return this._handlers.push(b),this.options[u]&&b.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Ht(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(W(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var u;for(u in this._layers)this._layers[u].remove();for(u in this._panes)Ht(this._panes[u]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(u,h){var b="leaflet-pane"+(u?" leaflet-"+u.replace("Pane","")+"-pane":""),T=pt("div",b,h||this._mapPane);return u&&(this._panes[u]=T),T},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var u=this.getPixelBounds(),h=this.unproject(u.getBottomLeft()),b=this.unproject(u.getTopRight());return new V(h,b)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(u,h,b){u=K(u),b=D(b||[0,0]);var T=this.getZoom()||0,P=this.getMinZoom(),B=this.getMaxZoom(),oe=u.getNorthWest(),de=u.getSouthEast(),pe=this.getSize().subtract(b),we=ie(this.project(de,T),this.project(oe,T)).getSize(),De=ze.any3d?this.options.zoomSnap:1,We=pe.x/we.x,Xe=pe.y/we.y,hr=h?Math.max(We,Xe):Math.min(We,Xe);return T=this.getScaleZoom(hr,T),De&&(T=Math.round(T/(De/100))*(De/100),T=h?Math.ceil(T/De)*De:Math.floor(T/De)*De),Math.max(P,Math.min(B,T))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new q(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(u,h){var b=this._getTopLeftPoint(u,h);return new H(b,b.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(u){return this.options.crs.getProjectedBounds(u===void 0?this.getZoom():u)},getPane:function(u){return typeof u=="string"?this._panes[u]:u},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(u,h){var b=this.options.crs;return h=h===void 0?this._zoom:h,b.scale(u)/b.scale(h)},getScaleZoom:function(u,h){var b=this.options.crs;h=h===void 0?this._zoom:h;var T=b.zoom(u*b.scale(h));return isNaN(T)?1/0:T},project:function(u,h){return h=h===void 0?this._zoom:h,this.options.crs.latLngToPoint(ae(u),h)},unproject:function(u,h){return h=h===void 0?this._zoom:h,this.options.crs.pointToLatLng(D(u),h)},layerPointToLatLng:function(u){var h=D(u).add(this.getPixelOrigin());return this.unproject(h)},latLngToLayerPoint:function(u){var h=this.project(ae(u))._round();return h._subtract(this.getPixelOrigin())},wrapLatLng:function(u){return this.options.crs.wrapLatLng(ae(u))},wrapLatLngBounds:function(u){return this.options.crs.wrapLatLngBounds(K(u))},distance:function(u,h){return this.options.crs.distance(ae(u),ae(h))},containerPointToLayerPoint:function(u){return D(u).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(u){return D(u).add(this._getMapPanePos())},containerPointToLatLng:function(u){var h=this.containerPointToLayerPoint(D(u));return this.layerPointToLatLng(h)},latLngToContainerPoint:function(u){return this.layerPointToContainerPoint(this.latLngToLayerPoint(ae(u)))},mouseEventToContainerPoint:function(u){return MO(u,this._container)},mouseEventToLayerPoint:function(u){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(u))},mouseEventToLatLng:function(u){return this.layerPointToLatLng(this.mouseEventToLayerPoint(u))},_initContainer:function(u){var h=this._container=kO(u);if(h){if(h._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");qe(h,"scroll",this._onScroll,this),this._containerId=l(h)},_initLayout:function(){var u=this._container;this._fadeAnimated=this.options.fadeAnimation&&ze.any3d,Ze(u,"leaflet-container"+(ze.touch?" leaflet-touch":"")+(ze.retina?" leaflet-retina":"")+(ze.ielt9?" leaflet-oldie":"")+(ze.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var h=Ju(u,"position");h!=="absolute"&&h!=="relative"&&h!=="fixed"&&h!=="sticky"&&(u.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var u=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),pn(this._mapPane,new q(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Ze(u.markerPane,"leaflet-zoom-hide"),Ze(u.shadowPane,"leaflet-zoom-hide"))},_resetView:function(u,h,b){pn(this._mapPane,new q(0,0));var T=!this._loaded;this._loaded=!0,h=this._limitZoom(h),this.fire("viewprereset");var P=this._zoom!==h;this._moveStart(P,b)._move(u,h)._moveEnd(P),this.fire("viewreset"),T&&this.fire("load")},_moveStart:function(u,h){return u&&this.fire("zoomstart"),h||this.fire("movestart"),this},_move:function(u,h,b,T){h===void 0&&(h=this._zoom);var P=this._zoom!==h;return this._zoom=h,this._lastCenter=u,this._pixelOrigin=this._getNewPixelOrigin(u),T?b&&b.pinch&&this.fire("zoom",b):((P||b&&b.pinch)&&this.fire("zoom",b),this.fire("move",b)),this},_moveEnd:function(u){return u&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return W(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(u){pn(this._mapPane,this._getMapPanePos().subtract(u))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(u){this._targets={},this._targets[l(this._container)]=this;var h=u?Ct:qe;h(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&h(window,"resize",this._onResize,this),ze.any3d&&this.options.transform3DLimit&&(u?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){W(this._resizeRequest),this._resizeRequest=z(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var u=this._getMapPanePos();Math.max(Math.abs(u.x),Math.abs(u.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(u,h){for(var b=[],T,P=h==="mouseout"||h==="mouseover",B=u.target||u.srcElement,oe=!1;B;){if(T=this._targets[l(B)],T&&(h==="click"||h==="preclick")&&this._draggableMoved(T)){oe=!0;break}if(T&&T.listens(h,!0)&&(P&&!q0(B,u)||(b.push(T),P))||B===this._container)break;B=B.parentNode}return!b.length&&!oe&&!P&&this.listens(h,!0)&&(b=[this]),b},_isClickDisabled:function(u){for(;u&&u!==this._container;){if(u._leaflet_disable_click)return!0;u=u.parentNode}},_handleDOMEvent:function(u){var h=u.target||u.srcElement;if(!(!this._loaded||h._leaflet_disable_events||u.type==="click"&&this._isClickDisabled(h))){var b=u.type;b==="mousedown"&&z0(h),this._fireDOMEvent(u,b)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(u,h,b){if(u.type==="click"){var T=i({},u);T.type="preclick",this._fireDOMEvent(T,T.type,b)}var P=this._findEventTargets(u,h);if(b){for(var B=[],oe=0;oe0?Math.round(u-h)/2:Math.max(0,Math.ceil(u))-Math.max(0,Math.floor(h))},_limitZoom:function(u){var h=this.getMinZoom(),b=this.getMaxZoom(),T=ze.any3d?this.options.zoomSnap:1;return T&&(u=Math.round(u/T)*T),Math.max(h,Math.min(b,u))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){rn(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(u,h){var b=this._getCenterOffset(u)._trunc();return(h&&h.animate)!==!0&&!this.getSize().contains(b)?!1:(this.panBy(b,h),!0)},_createAnimProxy:function(){var u=this._proxy=pt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(u),this.on("zoomanim",function(h){var b=N0,T=this._proxy.style[b];Ts(this._proxy,this.project(h.center,h.zoom),this.getZoomScale(h.zoom,1)),T===this._proxy.style[b]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Ht(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var u=this.getCenter(),h=this.getZoom();Ts(this._proxy,this.project(u,h),this.getZoomScale(h,1))},_catchTransitionEnd:function(u){this._animatingZoom&&u.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(u,h,b){if(this._animatingZoom)return!0;if(b=b||{},!this._zoomAnimated||b.animate===!1||this._nothingToAnimate()||Math.abs(h-this._zoom)>this.options.zoomAnimationThreshold)return!1;var T=this.getZoomScale(h),P=this._getCenterOffset(u)._divideBy(1-1/T);return b.animate!==!0&&!this.getSize().contains(P)?!1:(z(function(){this._moveStart(!0,b.noMoveStart||!1)._animateZoom(u,h,!0)},this),!0)},_animateZoom:function(u,h,b,T){this._mapPane&&(b&&(this._animatingZoom=!0,this._animateToCenter=u,this._animateToZoom=h,Ze(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:u,zoom:h,noUpdate:T}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&rn(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function eU(u,h){return new ct(u,h)}var ji=G.extend({options:{position:"topright"},initialize:function(u){y(this,u)},getPosition:function(){return this.options.position},setPosition:function(u){var h=this._map;return h&&h.removeControl(this),this.options.position=u,h&&h.addControl(this),this},getContainer:function(){return this._container},addTo:function(u){this.remove(),this._map=u;var h=this._container=this.onAdd(u),b=this.getPosition(),T=u._controlCorners[b];return Ze(h,"leaflet-control"),b.indexOf("bottom")!==-1?T.insertBefore(h,T.firstChild):T.appendChild(h),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Ht(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(u){this._map&&u&&u.screenX>0&&u.screenY>0&&this._map.getContainer().focus()}}),id=function(u){return new ji(u)};ct.include({addControl:function(u){return u.addTo(this),this},removeControl:function(u){return u.remove(),this},_initControlPos:function(){var u=this._controlCorners={},h="leaflet-",b=this._controlContainer=pt("div",h+"control-container",this._container);function T(P,B){var oe=h+P+" "+h+B;u[P+B]=pt("div",oe,b)}T("top","left"),T("top","right"),T("bottom","left"),T("bottom","right")},_clearControlPos:function(){for(var u in this._controlCorners)Ht(this._controlCorners[u]);Ht(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var NO=ji.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(u,h,b,T){return b1,this._baseLayersList.style.display=u?"":"none"),this._separator.style.display=h&&u?"":"none",this},_onLayerChange:function(u){this._handlingClick||this._update();var h=this._getLayer(l(u.target)),b=h.overlay?u.type==="add"?"overlayadd":"overlayremove":u.type==="add"?"baselayerchange":null;b&&this._map.fire(b,h)},_createRadioElement:function(u,h){var b='",T=document.createElement("div");return T.innerHTML=b,T.firstChild},_addItem:function(u){var h=document.createElement("label"),b=this._map.hasLayer(u.layer),T;u.overlay?(T=document.createElement("input"),T.type="checkbox",T.className="leaflet-control-layers-selector",T.defaultChecked=b):T=this._createRadioElement("leaflet-base-layers_"+l(this),b),this._layerControlInputs.push(T),T.layerId=l(u.layer),qe(T,"click",this._onInputClick,this);var P=document.createElement("span");P.innerHTML=" "+u.name;var B=document.createElement("span");h.appendChild(B),B.appendChild(T),B.appendChild(P);var oe=u.overlay?this._overlaysList:this._baseLayersList;return oe.appendChild(h),this._checkDisabledLayers(),h},_onInputClick:function(){if(!this._preventClick){var u=this._layerControlInputs,h,b,T=[],P=[];this._handlingClick=!0;for(var B=u.length-1;B>=0;B--)h=u[B],b=this._getLayer(h.layerId).layer,h.checked?T.push(b):h.checked||P.push(b);for(B=0;B=0;P--)h=u[P],b=this._getLayer(h.layerId).layer,h.disabled=b.options.minZoom!==void 0&&Tb.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var u=this._section;this._preventClick=!0,qe(u,"click",Yn),this.expand();var h=this;setTimeout(function(){Ct(u,"click",Yn),h._preventClick=!1})}}),tU=function(u,h,b){return new NO(u,h,b)},K0=ji.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(u){var h="leaflet-control-zoom",b=pt("div",h+" leaflet-bar"),T=this.options;return this._zoomInButton=this._createButton(T.zoomInText,T.zoomInTitle,h+"-in",b,this._zoomIn),this._zoomOutButton=this._createButton(T.zoomOutText,T.zoomOutTitle,h+"-out",b,this._zoomOut),this._updateDisabled(),u.on("zoomend zoomlevelschange",this._updateDisabled,this),b},onRemove:function(u){u.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(u){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(u.shiftKey?3:1))},_createButton:function(u,h,b,T,P){var B=pt("a",b,T);return B.innerHTML=u,B.href="#",B.title=h,B.setAttribute("role","button"),B.setAttribute("aria-label",h),rd(B),qe(B,"click",ks),qe(B,"click",P,this),qe(B,"click",this._refocusOnMap,this),B},_updateDisabled:function(){var u=this._map,h="leaflet-disabled";rn(this._zoomInButton,h),rn(this._zoomOutButton,h),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||u._zoom===u.getMinZoom())&&(Ze(this._zoomOutButton,h),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||u._zoom===u.getMaxZoom())&&(Ze(this._zoomInButton,h),this._zoomInButton.setAttribute("aria-disabled","true"))}});ct.mergeOptions({zoomControl:!0}),ct.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new K0,this.addControl(this.zoomControl))});var nU=function(u){return new K0(u)},DO=ji.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(u){var h="leaflet-control-scale",b=pt("div",h),T=this.options;return this._addScales(T,h+"-line",b),u.on(T.updateWhenIdle?"moveend":"move",this._update,this),u.whenReady(this._update,this),b},onRemove:function(u){u.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(u,h,b){u.metric&&(this._mScale=pt("div",h,b)),u.imperial&&(this._iScale=pt("div",h,b))},_update:function(){var u=this._map,h=u.getSize().y/2,b=u.distance(u.containerPointToLatLng([0,h]),u.containerPointToLatLng([this.options.maxWidth,h]));this._updateScales(b)},_updateScales:function(u){this.options.metric&&u&&this._updateMetric(u),this.options.imperial&&u&&this._updateImperial(u)},_updateMetric:function(u){var h=this._getRoundNum(u),b=h<1e3?h+" m":h/1e3+" km";this._updateScale(this._mScale,b,h/u)},_updateImperial:function(u){var h=u*3.2808399,b,T,P;h>5280?(b=h/5280,T=this._getRoundNum(b),this._updateScale(this._iScale,T+" mi",T/b)):(P=this._getRoundNum(h),this._updateScale(this._iScale,P+" ft",P/h))},_updateScale:function(u,h,b){u.style.width=Math.round(this.options.maxWidth*b)+"px",u.innerHTML=h},_getRoundNum:function(u){var h=Math.pow(10,(Math.floor(u)+"").length-1),b=u/h;return b=b>=10?10:b>=5?5:b>=3?3:b>=2?2:1,h*b}}),rU=function(u){return new DO(u)},iU='',Z0=ji.extend({options:{position:"bottomright",prefix:''+(ze.inlineSvg?iU+" ":"")+"Leaflet"},initialize:function(u){y(this,u),this._attributions={}},onAdd:function(u){u.attributionControl=this,this._container=pt("div","leaflet-control-attribution"),rd(this._container);for(var h in u._layers)u._layers[h].getAttribution&&this.addAttribution(u._layers[h].getAttribution());return this._update(),u.on("layeradd",this._addAttribution,this),this._container},onRemove:function(u){u.off("layeradd",this._addAttribution,this)},_addAttribution:function(u){u.layer.getAttribution&&(this.addAttribution(u.layer.getAttribution()),u.layer.once("remove",function(){this.removeAttribution(u.layer.getAttribution())},this))},setPrefix:function(u){return this.options.prefix=u,this._update(),this},addAttribution:function(u){return u?(this._attributions[u]||(this._attributions[u]=0),this._attributions[u]++,this._update(),this):this},removeAttribution:function(u){return u?(this._attributions[u]&&(this._attributions[u]--,this._update()),this):this},_update:function(){if(this._map){var u=[];for(var h in this._attributions)this._attributions[h]&&u.push(h);var b=[];this.options.prefix&&b.push(this.options.prefix),u.length&&b.push(u.join(", ")),this._container.innerHTML=b.join(' ')}}});ct.mergeOptions({attributionControl:!0}),ct.addInitHook(function(){this.options.attributionControl&&new Z0().addTo(this)});var oU=function(u){return new Z0(u)};ji.Layers=NO,ji.Zoom=K0,ji.Scale=DO,ji.Attribution=Z0,id.layers=tU,id.zoom=nU,id.scale=rU,id.attribution=oU;var Qi=G.extend({initialize:function(u){this._map=u},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});Qi.addTo=function(u,h){return u.addHandler(h,this),this};var aU={Events:te},IO=ze.touch?"touchstart mousedown":"mousedown",ga=le.extend({options:{clickTolerance:3},initialize:function(u,h,b,T){y(this,T),this._element=u,this._dragStartTarget=h||u,this._preventOutline=b},enable:function(){this._enabled||(qe(this._dragStartTarget,IO,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ga._dragging===this&&this.finishDrag(!0),Ct(this._dragStartTarget,IO,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(u){if(this._enabled&&(this._moved=!1,!D0(this._element,"leaflet-zoom-anim"))){if(u.touches&&u.touches.length!==1){ga._dragging===this&&this.finishDrag();return}if(!(ga._dragging||u.shiftKey||u.which!==1&&u.button!==1&&!u.touches)&&(ga._dragging=this,this._preventOutline&&z0(this._element),$0(),ed(),!this._moving)){this.fire("down");var h=u.touches?u.touches[0]:u,b=PO(this._element);this._startPoint=new q(h.clientX,h.clientY),this._startPos=Os(this._element),this._parentScale=V0(b);var T=u.type==="mousedown";qe(document,T?"mousemove":"touchmove",this._onMove,this),qe(document,T?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(u){if(this._enabled){if(u.touches&&u.touches.length>1){this._moved=!0;return}var h=u.touches&&u.touches.length===1?u.touches[0]:u,b=new q(h.clientX,h.clientY)._subtract(this._startPoint);!b.x&&!b.y||Math.abs(b.x)+Math.abs(b.y)B&&(oe=de,B=pe);B>b&&(h[oe]=1,X0(u,h,b,T,oe),X0(u,h,b,oe,P))}function uU(u,h){for(var b=[u[0]],T=1,P=0,B=u.length;Th&&(b.push(u[T]),P=T);return Ph.max.x&&(b|=2),u.yh.max.y&&(b|=8),b}function dU(u,h){var b=h.x-u.x,T=h.y-u.y;return b*b+T*T}function od(u,h,b,T){var P=h.x,B=h.y,oe=b.x-P,de=b.y-B,pe=oe*oe+de*de,we;return pe>0&&(we=((u.x-P)*oe+(u.y-B)*de)/pe,we>1?(P=b.x,B=b.y):we>0&&(P+=oe*we,B+=de*we)),oe=u.x-P,de=u.y-B,T?oe*oe+de*de:new q(P,B)}function oi(u){return!S(u[0])||typeof u[0][0]!="object"&&typeof u[0][0]<"u"}function HO(u){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),oi(u)}function WO(u,h){var b,T,P,B,oe,de,pe,we;if(!u||u.length===0)throw new Error("latlngs not passed");oi(u)||(console.warn("latlngs are not flat! Only the first ring will be used"),u=u[0]);var De=ae([0,0]),We=K(u),Xe=We.getNorthWest().distanceTo(We.getSouthWest())*We.getNorthEast().distanceTo(We.getNorthWest());Xe<1700&&(De=Q0(u));var hr=u.length,Cn=[];for(b=0;bT){pe=(B-T)/P,we=[de.x-pe*(de.x-oe.x),de.y-pe*(de.y-oe.y)];break}var Sr=h.unproject(D(we));return ae([Sr.lat+De.lat,Sr.lng+De.lng])}var fU={__proto__:null,simplify:UO,pointToSegmentDistance:BO,closestPointOnSegment:lU,clipSegment:VO,_getEdgeIntersection:bp,_getBitCode:Ps,_sqClosestPointOnSegment:od,isFlat:oi,_flat:HO,polylineCenter:WO},J0={project:function(u){return new q(u.lng,u.lat)},unproject:function(u){return new re(u.y,u.x)},bounds:new H([-180,-90],[180,90])},e_={R:6378137,R_MINOR:6356752314245179e-9,bounds:new H([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(u){var h=Math.PI/180,b=this.R,T=u.lat*h,P=this.R_MINOR/b,B=Math.sqrt(1-P*P),oe=B*Math.sin(T),de=Math.tan(Math.PI/4-T/2)/Math.pow((1-oe)/(1+oe),B/2);return T=-b*Math.log(Math.max(de,1e-10)),new q(u.lng*h*b,T)},unproject:function(u){for(var h=180/Math.PI,b=this.R,T=this.R_MINOR/b,P=Math.sqrt(1-T*T),B=Math.exp(-u.y/b),oe=Math.PI/2-2*Math.atan(B),de=0,pe=.1,we;de<15&&Math.abs(pe)>1e-7;de++)we=P*Math.sin(oe),we=Math.pow((1-we)/(1+we),P/2),pe=Math.PI/2-2*Math.atan(B*we)-oe,oe+=pe;return new re(oe*h,u.x*h/b)}},hU={__proto__:null,LonLat:J0,Mercator:e_,SphericalMercator:F},pU=i({},O,{code:"EPSG:3395",projection:e_,transformation:function(){var u=.5/(Math.PI*e_.R);return J(u,.5,-u,.5)}()}),YO=i({},O,{code:"EPSG:4326",projection:J0,transformation:J(1/180,1,-1/180,.5)}),mU=i({},he,{projection:J0,transformation:J(1,0,-1,0),scale:function(u){return Math.pow(2,u)},zoom:function(u){return Math.log(u)/Math.LN2},distance:function(u,h){var b=h.lng-u.lng,T=h.lat-u.lat;return Math.sqrt(b*b+T*T)},infinite:!0});he.Earth=O,he.EPSG3395=pU,he.EPSG3857=se,he.EPSG900913=ge,he.EPSG4326=YO,he.Simple=mU;var Mi=le.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(u){return u.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(u){return u&&u.removeLayer(this),this},getPane:function(u){return this._map.getPane(u?this.options[u]||u:this.options.pane)},addInteractiveTarget:function(u){return this._map._targets[l(u)]=this,this},removeInteractiveTarget:function(u){return delete this._map._targets[l(u)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(u){var h=u.target;if(h.hasLayer(this)){if(this._map=h,this._zoomAnimated=h._zoomAnimated,this.getEvents){var b=this.getEvents();h.on(b,this),this.once("remove",function(){h.off(b,this)},this)}this.onAdd(h),this.fire("add"),h.fire("layeradd",{layer:this})}}});ct.include({addLayer:function(u){if(!u._layerAdd)throw new Error("The provided object is not a Layer.");var h=l(u);return this._layers[h]?this:(this._layers[h]=u,u._mapToAdd=this,u.beforeAdd&&u.beforeAdd(this),this.whenReady(u._layerAdd,u),this)},removeLayer:function(u){var h=l(u);return this._layers[h]?(this._loaded&&u.onRemove(this),delete this._layers[h],this._loaded&&(this.fire("layerremove",{layer:u}),u.fire("remove")),u._map=u._mapToAdd=null,this):this},hasLayer:function(u){return l(u)in this._layers},eachLayer:function(u,h){for(var b in this._layers)u.call(h,this._layers[b]);return this},_addLayers:function(u){u=u?S(u)?u:[u]:[];for(var h=0,b=u.length;hthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&h[0]instanceof re&&h[0].equals(h[b-1])&&h.pop(),h},_setLatLngs:function(u){ko.prototype._setLatLngs.call(this,u),oi(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return oi(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var u=this._renderer._bounds,h=this.options.weight,b=new q(h,h);if(u=new H(u.min.subtract(b),u.max.add(b)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(u))){if(this.options.noClip){this._parts=this._rings;return}for(var T=0,P=this._rings.length,B;Tu.y!=P.y>u.y&&u.x<(P.x-T.x)*(u.y-T.y)/(P.y-T.y)+T.x&&(h=!h);return h||ko.prototype._containsPoint.call(this,u,!0)}});function SU(u,h){return new Ql(u,h)}var Po=Co.extend({initialize:function(u,h){y(this,h),this._layers={},u&&this.addData(u)},addData:function(u){var h=S(u)?u:u.features,b,T,P;if(h){for(b=0,T=h.length;b0&&P.push(P[0].slice()),P}function Xl(u,h){return u.feature?i({},u.feature,{geometry:h}):Op(h)}function Op(u){return u.type==="Feature"||u.type==="FeatureCollection"?u:{type:"Feature",properties:{},geometry:u}}var i_={toGeoJSON:function(u){return Xl(this,{type:"Point",coordinates:r_(this.getLatLng(),u)})}};wp.include(i_),t_.include(i_),xp.include(i_),ko.include({toGeoJSON:function(u){var h=!oi(this._latlngs),b=Tp(this._latlngs,h?1:0,!1,u);return Xl(this,{type:(h?"Multi":"")+"LineString",coordinates:b})}}),Ql.include({toGeoJSON:function(u){var h=!oi(this._latlngs),b=h&&!oi(this._latlngs[0]),T=Tp(this._latlngs,b?2:h?1:0,!0,u);return h||(T=[T]),Xl(this,{type:(b?"Multi":"")+"Polygon",coordinates:T})}}),Kl.include({toMultiPoint:function(u){var h=[];return this.eachLayer(function(b){h.push(b.toGeoJSON(u).geometry.coordinates)}),Xl(this,{type:"MultiPoint",coordinates:h})},toGeoJSON:function(u){var h=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(h==="MultiPoint")return this.toMultiPoint(u);var b=h==="GeometryCollection",T=[];return this.eachLayer(function(P){if(P.toGeoJSON){var B=P.toGeoJSON(u);if(b)T.push(B.geometry);else{var oe=Op(B);oe.type==="FeatureCollection"?T.push.apply(T,oe.features):T.push(oe)}}}),b?Xl(this,{geometries:T,type:"GeometryCollection"}):{type:"FeatureCollection",features:T}}});function KO(u,h){return new Po(u,h)}var EU=KO,Cp=Mi.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(u,h,b){this._url=u,this._bounds=K(h),y(this,b)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Ze(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Ht(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(u){return this.options.opacity=u,this._image&&this._updateOpacity(),this},setStyle:function(u){return u.opacity&&this.setOpacity(u.opacity),this},bringToFront:function(){return this._map&&Gl(this._image),this},bringToBack:function(){return this._map&&ql(this._image),this},setUrl:function(u){return this._url=u,this._image&&(this._image.src=u),this},setBounds:function(u){return this._bounds=K(u),this._map&&this._reset(),this},getEvents:function(){var u={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(u.zoomanim=this._animateZoom),u},setZIndex:function(u){return this.options.zIndex=u,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var u=this._url.tagName==="IMG",h=this._image=u?this._url:pt("img");if(Ze(h,"leaflet-image-layer"),this._zoomAnimated&&Ze(h,"leaflet-zoom-animated"),this.options.className&&Ze(h,this.options.className),h.onselectstart=f,h.onmousemove=f,h.onload=a(this.fire,this,"load"),h.onerror=a(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(h.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),u){this._url=h.src;return}h.src=this._url,h.alt=this.options.alt},_animateZoom:function(u){var h=this._map.getZoomScale(u.zoom),b=this._map._latLngBoundsToNewLayerBounds(this._bounds,u.zoom,u.center).min;Ts(this._image,b,h)},_reset:function(){var u=this._image,h=new H(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),b=h.getSize();pn(u,h.min),u.style.width=b.x+"px",u.style.height=b.y+"px"},_updateOpacity:function(){ii(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var u=this.options.errorOverlayUrl;u&&this._url!==u&&(this._url=u,this._image.src=u)},getCenter:function(){return this._bounds.getCenter()}}),TU=function(u,h,b){return new Cp(u,h,b)},ZO=Cp.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var u=this._url.tagName==="VIDEO",h=this._image=u?this._url:pt("video");if(Ze(h,"leaflet-image-layer"),this._zoomAnimated&&Ze(h,"leaflet-zoom-animated"),this.options.className&&Ze(h,this.options.className),h.onselectstart=f,h.onmousemove=f,h.onloadeddata=a(this.fire,this,"load"),u){for(var b=h.getElementsByTagName("source"),T=[],P=0;P0?T:[h.src];return}S(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(h.style,"objectFit")&&(h.style.objectFit="fill"),h.autoplay=!!this.options.autoplay,h.loop=!!this.options.loop,h.muted=!!this.options.muted,h.playsInline=!!this.options.playsInline;for(var B=0;BP?(h.height=P+"px",Ze(u,B)):rn(u,B),this._containerWidth=this._container.offsetWidth},_animateZoom:function(u){var h=this._map._latLngToNewLayerPoint(this._latlng,u.zoom,u.center),b=this._getAnchor();pn(this._container,h.add(b))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var u=this._map,h=parseInt(Ju(this._container,"marginBottom"),10)||0,b=this._container.offsetHeight+h,T=this._containerWidth,P=new q(this._containerLeft,-b-this._containerBottom);P._add(Os(this._container));var B=u.layerPointToContainerPoint(P),oe=D(this.options.autoPanPadding),de=D(this.options.autoPanPaddingTopLeft||oe),pe=D(this.options.autoPanPaddingBottomRight||oe),we=u.getSize(),De=0,We=0;B.x+T+pe.x>we.x&&(De=B.x+T-we.x+pe.x),B.x-De-de.x<0&&(De=B.x-de.x),B.y+b+pe.y>we.y&&(We=B.y+b-we.y+pe.y),B.y-We-de.y<0&&(We=B.y-de.y),(De||We)&&(this.options.keepInView&&(this._autopanning=!0),u.fire("autopanstart").panBy([De,We]))}},_getAnchor:function(){return D(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),kU=function(u,h){return new kp(u,h)};ct.mergeOptions({closePopupOnClick:!0}),ct.include({openPopup:function(u,h,b){return this._initOverlay(kp,u,h,b).openOn(this),this},closePopup:function(u){return u=arguments.length?u:this._popup,u&&u.close(),this}}),Mi.include({bindPopup:function(u,h){return this._popup=this._initOverlay(kp,this._popup,u,h),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(u){return this._popup&&(this instanceof Co||(this._popup._source=this),this._popup._prepareOpen(u||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(u){return this._popup&&this._popup.setContent(u),this},getPopup:function(){return this._popup},_openPopup:function(u){if(!(!this._popup||!this._map)){ks(u);var h=u.layer||u.target;if(this._popup._source===h&&!(h instanceof va)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(u.latlng);return}this._popup._source=h,this.openPopup(u.latlng)}},_movePopup:function(u){this._popup.setLatLng(u.latlng)},_onKeyPress:function(u){u.originalEvent.keyCode===13&&this._openPopup(u)}});var Pp=Xi.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(u){Xi.prototype.onAdd.call(this,u),this.setOpacity(this.options.opacity),u.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(u){Xi.prototype.onRemove.call(this,u),u.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var u=Xi.prototype.getEvents.call(this);return this.options.permanent||(u.preclick=this.close),u},_initLayout:function(){var u="leaflet-tooltip",h=u+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=pt("div",h),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+l(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(u){var h,b,T=this._map,P=this._container,B=T.latLngToContainerPoint(T.getCenter()),oe=T.layerPointToContainerPoint(u),de=this.options.direction,pe=P.offsetWidth,we=P.offsetHeight,De=D(this.options.offset),We=this._getAnchor();de==="top"?(h=pe/2,b=we):de==="bottom"?(h=pe/2,b=0):de==="center"?(h=pe/2,b=we/2):de==="right"?(h=0,b=we/2):de==="left"?(h=pe,b=we/2):oe.xthis.options.maxZoom||bT?this._retainParent(P,B,oe,T):!1)},_retainChildren:function(u,h,b,T){for(var P=2*u;P<2*u+2;P++)for(var B=2*h;B<2*h+2;B++){var oe=new q(P,B);oe.z=b+1;var de=this._tileCoordsToKey(oe),pe=this._tiles[de];if(pe&&pe.active){pe.retain=!0;continue}else pe&&pe.loaded&&(pe.retain=!0);b+1this.options.maxZoom||this.options.minZoom!==void 0&&P1){this._setView(u,b);return}for(var We=P.min.y;We<=P.max.y;We++)for(var Xe=P.min.x;Xe<=P.max.x;Xe++){var hr=new q(Xe,We);if(hr.z=this._tileZoom,!!this._isValidTile(hr)){var Cn=this._tiles[this._tileCoordsToKey(hr)];Cn?Cn.current=!0:oe.push(hr)}}if(oe.sort(function(Sr,ec){return Sr.distanceTo(B)-ec.distanceTo(B)}),oe.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var ai=document.createDocumentFragment();for(Xe=0;Xeb.max.x)||!h.wrapLat&&(u.yb.max.y))return!1}if(!this.options.bounds)return!0;var T=this._tileCoordsToBounds(u);return K(this.options.bounds).overlaps(T)},_keyToBounds:function(u){return this._tileCoordsToBounds(this._keyToTileCoords(u))},_tileCoordsToNwSe:function(u){var h=this._map,b=this.getTileSize(),T=u.scaleBy(b),P=T.add(b),B=h.unproject(T,u.z),oe=h.unproject(P,u.z);return[B,oe]},_tileCoordsToBounds:function(u){var h=this._tileCoordsToNwSe(u),b=new V(h[0],h[1]);return this.options.noWrap||(b=this._map.wrapLatLngBounds(b)),b},_tileCoordsToKey:function(u){return u.x+":"+u.y+":"+u.z},_keyToTileCoords:function(u){var h=u.split(":"),b=new q(+h[0],+h[1]);return b.z=+h[2],b},_removeTile:function(u){var h=this._tiles[u];h&&(Ht(h.el),delete this._tiles[u],this.fire("tileunload",{tile:h.el,coords:this._keyToTileCoords(u)}))},_initTile:function(u){Ze(u,"leaflet-tile");var h=this.getTileSize();u.style.width=h.x+"px",u.style.height=h.y+"px",u.onselectstart=f,u.onmousemove=f,ze.ielt9&&this.options.opacity<1&&ii(u,this.options.opacity)},_addTile:function(u,h){var b=this._getTilePos(u),T=this._tileCoordsToKey(u),P=this.createTile(this._wrapCoords(u),a(this._tileReady,this,u));this._initTile(P),this.createTile.length<2&&z(a(this._tileReady,this,u,null,P)),pn(P,b),this._tiles[T]={el:P,coords:u,current:!0},h.appendChild(P),this.fire("tileloadstart",{tile:P,coords:u})},_tileReady:function(u,h,b){h&&this.fire("tileerror",{error:h,tile:b,coords:u});var T=this._tileCoordsToKey(u);b=this._tiles[T],b&&(b.loaded=+new Date,this._map._fadeAnimated?(ii(b.el,0),W(this._fadeFrame),this._fadeFrame=z(this._updateOpacity,this)):(b.active=!0,this._pruneTiles()),h||(Ze(b.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:b.el,coords:u})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),ze.ielt9||!this._map._fadeAnimated?z(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(u){return u.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(u){var h=new q(this._wrapX?d(u.x,this._wrapX):u.x,this._wrapY?d(u.y,this._wrapY):u.y);return h.z=u.z,h},_pxBoundsToTileRange:function(u){var h=this.getTileSize();return new H(u.min.unscaleBy(h).floor(),u.max.unscaleBy(h).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var u in this._tiles)if(!this._tiles[u].loaded)return!1;return!0}});function jU(u){return new sd(u)}var Jl=sd.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(u,h){this._url=u,h=y(this,h),h.detectRetina&&ze.retina&&h.maxZoom>0?(h.tileSize=Math.floor(h.tileSize/2),h.zoomReverse?(h.zoomOffset--,h.minZoom=Math.min(h.maxZoom,h.minZoom+1)):(h.zoomOffset++,h.maxZoom=Math.max(h.minZoom,h.maxZoom-1)),h.minZoom=Math.max(0,h.minZoom)):h.zoomReverse?h.minZoom=Math.min(h.maxZoom,h.minZoom):h.maxZoom=Math.max(h.minZoom,h.maxZoom),typeof h.subdomains=="string"&&(h.subdomains=h.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(u,h){return this._url===u&&h===void 0&&(h=!0),this._url=u,h||this.redraw(),this},createTile:function(u,h){var b=document.createElement("img");return qe(b,"load",a(this._tileOnLoad,this,h,b)),qe(b,"error",a(this._tileOnError,this,h,b)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(b.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(b.referrerPolicy=this.options.referrerPolicy),b.alt="",b.src=this.getTileUrl(u),b},getTileUrl:function(u){var h={r:ze.retina?"@2x":"",s:this._getSubdomain(u),x:u.x,y:u.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var b=this._globalTileRange.max.y-u.y;this.options.tms&&(h.y=b),h["-y"]=b}return w(this._url,i(h,this.options))},_tileOnLoad:function(u,h){ze.ielt9?setTimeout(a(u,this,null,h),0):u(null,h)},_tileOnError:function(u,h,b){var T=this.options.errorTileUrl;T&&h.getAttribute("src")!==T&&(h.src=T),u(b,h)},_onTileRemove:function(u){u.tile.onload=null},_getZoomForUrl:function(){var u=this._tileZoom,h=this.options.maxZoom,b=this.options.zoomReverse,T=this.options.zoomOffset;return b&&(u=h-u),u+T},_getSubdomain:function(u){var h=Math.abs(u.x+u.y)%this.options.subdomains.length;return this.options.subdomains[h]},_abortLoading:function(){var u,h;for(u in this._tiles)if(this._tiles[u].coords.z!==this._tileZoom&&(h=this._tiles[u].el,h.onload=f,h.onerror=f,!h.complete)){h.src=C;var b=this._tiles[u].coords;Ht(h),delete this._tiles[u],this.fire("tileabort",{tile:h,coords:b})}},_removeTile:function(u){var h=this._tiles[u];if(h)return h.el.setAttribute("src",C),sd.prototype._removeTile.call(this,u)},_tileReady:function(u,h,b){if(!(!this._map||b&&b.getAttribute("src")===C))return sd.prototype._tileReady.call(this,u,h,b)}});function JO(u,h){return new Jl(u,h)}var eC=Jl.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(u,h){this._url=u;var b=i({},this.defaultWmsParams);for(var T in h)T in this.options||(b[T]=h[T]);h=y(this,h);var P=h.detectRetina&&ze.retina?2:1,B=this.getTileSize();b.width=B.x*P,b.height=B.y*P,this.wmsParams=b},onAdd:function(u){this._crs=this.options.crs||u.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var h=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[h]=this._crs.code,Jl.prototype.onAdd.call(this,u)},getTileUrl:function(u){var h=this._tileCoordsToNwSe(u),b=this._crs,T=ie(b.project(h[0]),b.project(h[1])),P=T.min,B=T.max,oe=(this._wmsVersion>=1.3&&this._crs===YO?[P.y,P.x,B.y,B.x]:[P.x,P.y,B.x,B.y]).join(","),de=Jl.prototype.getTileUrl.call(this,u);return de+x(this.wmsParams,de,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+oe},setParams:function(u,h){return i(this.wmsParams,u),h||this.redraw(),this}});function MU(u,h){return new eC(u,h)}Jl.WMS=eC,JO.wms=MU;var Lo=Mi.extend({options:{padding:.1},initialize:function(u){y(this,u),l(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Ze(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var u={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(u.zoomanim=this._onAnimZoom),u},_onAnimZoom:function(u){this._updateTransform(u.center,u.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(u,h){var b=this._map.getZoomScale(h,this._zoom),T=this._map.getSize().multiplyBy(.5+this.options.padding),P=this._map.project(this._center,h),B=T.multiplyBy(-b).add(P).subtract(this._map._getNewPixelOrigin(u,h));ze.any3d?Ts(this._container,B,b):pn(this._container,B)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var u in this._layers)this._layers[u]._reset()},_onZoomEnd:function(){for(var u in this._layers)this._layers[u]._project()},_updatePaths:function(){for(var u in this._layers)this._layers[u]._update()},_update:function(){var u=this.options.padding,h=this._map.getSize(),b=this._map.containerPointToLayerPoint(h.multiplyBy(-u)).round();this._bounds=new H(b,b.add(h.multiplyBy(1+u*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),tC=Lo.extend({options:{tolerance:0},getEvents:function(){var u=Lo.prototype.getEvents.call(this);return u.viewprereset=this._onViewPreReset,u},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Lo.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var u=this._container=document.createElement("canvas");qe(u,"mousemove",this._onMouseMove,this),qe(u,"click dblclick mousedown mouseup contextmenu",this._onClick,this),qe(u,"mouseout",this._handleMouseOut,this),u._leaflet_disable_events=!0,this._ctx=u.getContext("2d")},_destroyContainer:function(){W(this._redrawRequest),delete this._ctx,Ht(this._container),Ct(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var u;this._redrawBounds=null;for(var h in this._layers)u=this._layers[h],u._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Lo.prototype._update.call(this);var u=this._bounds,h=this._container,b=u.getSize(),T=ze.retina?2:1;pn(h,u.min),h.width=T*b.x,h.height=T*b.y,h.style.width=b.x+"px",h.style.height=b.y+"px",ze.retina&&this._ctx.scale(2,2),this._ctx.translate(-u.min.x,-u.min.y),this.fire("update")}},_reset:function(){Lo.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(u){this._updateDashArray(u),this._layers[l(u)]=u;var h=u._order={layer:u,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=h),this._drawLast=h,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(u){this._requestRedraw(u)},_removePath:function(u){var h=u._order,b=h.next,T=h.prev;b?b.prev=T:this._drawLast=T,T?T.next=b:this._drawFirst=b,delete u._order,delete this._layers[l(u)],this._requestRedraw(u)},_updatePath:function(u){this._extendRedrawBounds(u),u._project(),u._update(),this._requestRedraw(u)},_updateStyle:function(u){this._updateDashArray(u),this._requestRedraw(u)},_updateDashArray:function(u){if(typeof u.options.dashArray=="string"){var h=u.options.dashArray.split(/[, ]+/),b=[],T,P;for(P=0;P')}}catch{}return function(u){return document.createElement("<"+u+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),AU={_initContainer:function(){this._container=pt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Lo.prototype._update.call(this),this.fire("update"))},_initPath:function(u){var h=u._container=ld("shape");Ze(h,"leaflet-vml-shape "+(this.options.className||"")),h.coordsize="1 1",u._path=ld("path"),h.appendChild(u._path),this._updateStyle(u),this._layers[l(u)]=u},_addPath:function(u){var h=u._container;this._container.appendChild(h),u.options.interactive&&u.addInteractiveTarget(h)},_removePath:function(u){var h=u._container;Ht(h),u.removeInteractiveTarget(h),delete this._layers[l(u)]},_updateStyle:function(u){var h=u._stroke,b=u._fill,T=u.options,P=u._container;P.stroked=!!T.stroke,P.filled=!!T.fill,T.stroke?(h||(h=u._stroke=ld("stroke")),P.appendChild(h),h.weight=T.weight+"px",h.color=T.color,h.opacity=T.opacity,T.dashArray?h.dashStyle=S(T.dashArray)?T.dashArray.join(" "):T.dashArray.replace(/( *, *)/g," "):h.dashStyle="",h.endcap=T.lineCap.replace("butt","flat"),h.joinstyle=T.lineJoin):h&&(P.removeChild(h),u._stroke=null),T.fill?(b||(b=u._fill=ld("fill")),P.appendChild(b),b.color=T.fillColor||T.color,b.opacity=T.fillOpacity):b&&(P.removeChild(b),u._fill=null)},_updateCircle:function(u){var h=u._point.round(),b=Math.round(u._radius),T=Math.round(u._radiusY||b);this._setPath(u,u._empty()?"M0 0":"AL "+h.x+","+h.y+" "+b+","+T+" 0,"+65535*360)},_setPath:function(u,h){u._path.v=h},_bringToFront:function(u){Gl(u._container)},_bringToBack:function(u){ql(u._container)}},Lp=ze.vml?ld:Me,cd=Lo.extend({_initContainer:function(){this._container=Lp("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Lp("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Ht(this._container),Ct(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Lo.prototype._update.call(this);var u=this._bounds,h=u.getSize(),b=this._container;(!this._svgSize||!this._svgSize.equals(h))&&(this._svgSize=h,b.setAttribute("width",h.x),b.setAttribute("height",h.y)),pn(b,u.min),b.setAttribute("viewBox",[u.min.x,u.min.y,h.x,h.y].join(" ")),this.fire("update")}},_initPath:function(u){var h=u._path=Lp("path");u.options.className&&Ze(h,u.options.className),u.options.interactive&&Ze(h,"leaflet-interactive"),this._updateStyle(u),this._layers[l(u)]=u},_addPath:function(u){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(u._path),u.addInteractiveTarget(u._path)},_removePath:function(u){Ht(u._path),u.removeInteractiveTarget(u._path),delete this._layers[l(u)]},_updatePath:function(u){u._project(),u._update()},_updateStyle:function(u){var h=u._path,b=u.options;h&&(b.stroke?(h.setAttribute("stroke",b.color),h.setAttribute("stroke-opacity",b.opacity),h.setAttribute("stroke-width",b.weight),h.setAttribute("stroke-linecap",b.lineCap),h.setAttribute("stroke-linejoin",b.lineJoin),b.dashArray?h.setAttribute("stroke-dasharray",b.dashArray):h.removeAttribute("stroke-dasharray"),b.dashOffset?h.setAttribute("stroke-dashoffset",b.dashOffset):h.removeAttribute("stroke-dashoffset")):h.setAttribute("stroke","none"),b.fill?(h.setAttribute("fill",b.fillColor||b.color),h.setAttribute("fill-opacity",b.fillOpacity),h.setAttribute("fill-rule",b.fillRule||"evenodd")):h.setAttribute("fill","none"))},_updatePoly:function(u,h){this._setPath(u,ue(u._parts,h))},_updateCircle:function(u){var h=u._point,b=Math.max(Math.round(u._radius),1),T=Math.max(Math.round(u._radiusY),1)||b,P="a"+b+","+T+" 0 1,0 ",B=u._empty()?"M0 0":"M"+(h.x-b)+","+h.y+P+b*2+",0 "+P+-b*2+",0 ";this._setPath(u,B)},_setPath:function(u,h){u._path.setAttribute("d",h)},_bringToFront:function(u){Gl(u._path)},_bringToBack:function(u){ql(u._path)}});ze.vml&&cd.include(AU);function rC(u){return ze.svg||ze.vml?new cd(u):null}ct.include({getRenderer:function(u){var h=u.options.renderer||this._getPaneRenderer(u.options.pane)||this.options.renderer||this._renderer;return h||(h=this._renderer=this._createRenderer()),this.hasLayer(h)||this.addLayer(h),h},_getPaneRenderer:function(u){if(u==="overlayPane"||u===void 0)return!1;var h=this._paneRenderers[u];return h===void 0&&(h=this._createRenderer({pane:u}),this._paneRenderers[u]=h),h},_createRenderer:function(u){return this.options.preferCanvas&&nC(u)||rC(u)}});var iC=Ql.extend({initialize:function(u,h){Ql.prototype.initialize.call(this,this._boundsToLatLngs(u),h)},setBounds:function(u){return this.setLatLngs(this._boundsToLatLngs(u))},_boundsToLatLngs:function(u){return u=K(u),[u.getSouthWest(),u.getNorthWest(),u.getNorthEast(),u.getSouthEast()]}});function RU(u,h){return new iC(u,h)}cd.create=Lp,cd.pointsToPath=ue,Po.geometryToLayer=Sp,Po.coordsToLatLng=n_,Po.coordsToLatLngs=Ep,Po.latLngToCoords=r_,Po.latLngsToCoords=Tp,Po.getFeature=Xl,Po.asFeature=Op,ct.mergeOptions({boxZoom:!0});var oC=Qi.extend({initialize:function(u){this._map=u,this._container=u._container,this._pane=u._panes.overlayPane,this._resetStateTimeout=0,u.on("unload",this._destroy,this)},addHooks:function(){qe(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Ct(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Ht(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(u){if(!u.shiftKey||u.which!==1&&u.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),ed(),$0(),this._startPoint=this._map.mouseEventToContainerPoint(u),qe(document,{contextmenu:ks,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(u){this._moved||(this._moved=!0,this._box=pt("div","leaflet-zoom-box",this._container),Ze(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(u);var h=new H(this._point,this._startPoint),b=h.getSize();pn(this._box,h.min),this._box.style.width=b.x+"px",this._box.style.height=b.y+"px"},_finish:function(){this._moved&&(Ht(this._box),rn(this._container,"leaflet-crosshair")),td(),U0(),Ct(document,{contextmenu:ks,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(u){if(!(u.which!==1&&u.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0);var h=new V(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(h).fire("boxzoomend",{boxZoomBounds:h})}},_onKeyDown:function(u){u.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});ct.addInitHook("addHandler","boxZoom",oC),ct.mergeOptions({doubleClickZoom:!0});var aC=Qi.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(u){var h=this._map,b=h.getZoom(),T=h.options.zoomDelta,P=u.originalEvent.shiftKey?b-T:b+T;h.options.doubleClickZoom==="center"?h.setZoom(P):h.setZoomAround(u.containerPoint,P)}});ct.addInitHook("addHandler","doubleClickZoom",aC),ct.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var sC=Qi.extend({addHooks:function(){if(!this._draggable){var u=this._map;this._draggable=new ga(u._mapPane,u._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),u.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),u.on("zoomend",this._onZoomEnd,this),u.whenReady(this._onZoomEnd,this))}Ze(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){rn(this._map._container,"leaflet-grab"),rn(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var u=this._map;if(u._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var h=K(this._map.options.maxBounds);this._offsetLimit=ie(this._map.latLngToContainerPoint(h.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(h.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;u.fire("movestart").fire("dragstart"),u.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(u){if(this._map.options.inertia){var h=this._lastTime=+new Date,b=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(b),this._times.push(h),this._prunePositions(h)}this._map.fire("move",u).fire("drag",u)},_prunePositions:function(u){for(;this._positions.length>1&&u-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var u=this._map.getSize().divideBy(2),h=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=h.subtract(u).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(u,h){return u-(u-h)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var u=this._draggable._newPos.subtract(this._draggable._startPos),h=this._offsetLimit;u.xh.max.x&&(u.x=this._viscousLimit(u.x,h.max.x)),u.y>h.max.y&&(u.y=this._viscousLimit(u.y,h.max.y)),this._draggable._newPos=this._draggable._startPos.add(u)}},_onPreDragWrap:function(){var u=this._worldWidth,h=Math.round(u/2),b=this._initialWorldOffset,T=this._draggable._newPos.x,P=(T-h+b)%u+h-b,B=(T+h+b)%u-h-b,oe=Math.abs(P+b)0?B:-B))-h;this._delta=0,this._startTime=null,oe&&(u.options.scrollWheelZoom==="center"?u.setZoom(h+oe):u.setZoomAround(this._lastMousePos,h+oe))}});ct.addInitHook("addHandler","scrollWheelZoom",cC);var NU=600;ct.mergeOptions({tapHold:ze.touchNative&&ze.safari&&ze.mobile,tapTolerance:15});var uC=Qi.extend({addHooks:function(){qe(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Ct(this._map._container,"touchstart",this._onDown,this)},_onDown:function(u){if(clearTimeout(this._holdTimeout),u.touches.length===1){var h=u.touches[0];this._startPos=this._newPos=new q(h.clientX,h.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(qe(document,"touchend",Yn),qe(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",h))},this),NU),qe(document,"touchend touchcancel contextmenu",this._cancel,this),qe(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function u(){Ct(document,"touchend",Yn),Ct(document,"touchend touchcancel",u)},_cancel:function(){clearTimeout(this._holdTimeout),Ct(document,"touchend touchcancel contextmenu",this._cancel,this),Ct(document,"touchmove",this._onMove,this)},_onMove:function(u){var h=u.touches[0];this._newPos=new q(h.clientX,h.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(u,h){var b=new MouseEvent(u,{bubbles:!0,cancelable:!0,view:window,screenX:h.screenX,screenY:h.screenY,clientX:h.clientX,clientY:h.clientY});b._simulated=!0,h.target.dispatchEvent(b)}});ct.addInitHook("addHandler","tapHold",uC),ct.mergeOptions({touchZoom:ze.touch,bounceAtZoomLimits:!0});var dC=Qi.extend({addHooks:function(){Ze(this._map._container,"leaflet-touch-zoom"),qe(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){rn(this._map._container,"leaflet-touch-zoom"),Ct(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(u){var h=this._map;if(!(!u.touches||u.touches.length!==2||h._animatingZoom||this._zooming)){var b=h.mouseEventToContainerPoint(u.touches[0]),T=h.mouseEventToContainerPoint(u.touches[1]);this._centerPoint=h.getSize()._divideBy(2),this._startLatLng=h.containerPointToLatLng(this._centerPoint),h.options.touchZoom!=="center"&&(this._pinchStartLatLng=h.containerPointToLatLng(b.add(T)._divideBy(2))),this._startDist=b.distanceTo(T),this._startZoom=h.getZoom(),this._moved=!1,this._zooming=!0,h._stop(),qe(document,"touchmove",this._onTouchMove,this),qe(document,"touchend touchcancel",this._onTouchEnd,this),Yn(u)}},_onTouchMove:function(u){if(!(!u.touches||u.touches.length!==2||!this._zooming)){var h=this._map,b=h.mouseEventToContainerPoint(u.touches[0]),T=h.mouseEventToContainerPoint(u.touches[1]),P=b.distanceTo(T)/this._startDist;if(this._zoom=h.getScaleZoom(P,this._startZoom),!h.options.bounceAtZoomLimits&&(this._zoomh.getMaxZoom()&&P>1)&&(this._zoom=h._limitZoom(this._zoom)),h.options.touchZoom==="center"){if(this._center=this._startLatLng,P===1)return}else{var B=b._add(T)._divideBy(2)._subtract(this._centerPoint);if(P===1&&B.x===0&&B.y===0)return;this._center=h.unproject(h.project(this._pinchStartLatLng,this._zoom).subtract(B),this._zoom)}this._moved||(h._moveStart(!0,!1),this._moved=!0),W(this._animRequest);var oe=a(h._move,h,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=z(oe,this,!0),Yn(u)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,W(this._animRequest),Ct(document,"touchmove",this._onTouchMove,this),Ct(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});ct.addInitHook("addHandler","touchZoom",dC),ct.BoxZoom=oC,ct.DoubleClickZoom=aC,ct.Drag=sC,ct.Keyboard=lC,ct.ScrollWheelZoom=cC,ct.TapHold=uC,ct.TouchZoom=dC,n.Bounds=H,n.Browser=ze,n.CRS=he,n.Canvas=tC,n.Circle=t_,n.CircleMarker=xp,n.Class=G,n.Control=ji,n.DivIcon=XO,n.DivOverlay=Xi,n.DomEvent=J$,n.DomUtil=Q$,n.Draggable=ga,n.Evented=le,n.FeatureGroup=Co,n.GeoJSON=Po,n.GridLayer=sd,n.Handler=Qi,n.Icon=Zl,n.ImageOverlay=Cp,n.LatLng=re,n.LatLngBounds=V,n.Layer=Mi,n.LayerGroup=Kl,n.LineUtil=fU,n.Map=ct,n.Marker=wp,n.Mixin=aU,n.Path=va,n.Point=q,n.PolyUtil=sU,n.Polygon=Ql,n.Polyline=ko,n.Popup=kp,n.PosAnimation=RO,n.Projection=hU,n.Rectangle=iC,n.Renderer=Lo,n.SVG=cd,n.SVGOverlay=QO,n.TileLayer=Jl,n.Tooltip=Pp,n.Transformation=ee,n.Util=X,n.VideoOverlay=ZO,n.bind=a,n.bounds=ie,n.canvas=nC,n.circle=wU,n.circleMarker=bU,n.control=id,n.divIcon=LU,n.extend=i,n.featureGroup=vU,n.geoJSON=KO,n.geoJson=EU,n.gridLayer=jU,n.icon=yU,n.imageOverlay=TU,n.latLng=ae,n.latLngBounds=K,n.layerGroup=gU,n.map=eU,n.marker=_U,n.point=D,n.polygon=SU,n.polyline=xU,n.popup=kU,n.rectangle=RU,n.setOptions=y,n.stamp=l,n.svg=rC,n.svgOverlay=CU,n.tileLayer=JO,n.tooltip=PU,n.transformation=J,n.version=r,n.videoOverlay=OU;var DU=window.L;n.noConflict=function(){return window.L=DU,this},window.L=n})})(S2,S2.exports);var lp=S2.exports;const kA=Wu(lp);function cO(e,t,n){return Object.freeze({instance:e,context:t,container:n})}function uO(e,t){return t==null?function(n,r){const i=$.useRef();return i.current||(i.current=e(n,r)),i}:function(n,r){const i=$.useRef();i.current||(i.current=e(n,r));const o=$.useRef(n),{instance:a}=i.current;return $.useEffect(function(){o.current!==n&&(t(a,n,o.current),o.current=n)},[a,n,r]),i}}function Cbe(e,t){$.useEffect(function(){return(t.layerContainer??t.map).addLayer(e.instance),function(){var n;(n=t.layerContainer)==null||n.removeLayer(e.instance),t.map.removeLayer(e.instance)}},[t,e])}function t$(e){return function(t){const n=JF(),r=e(lO(t,n),n);return ZF(n.map,t.attribution),e$(r.current,t.eventHandlers),Cbe(r.current,n),r}}function kbe(e,t){const n=uO(e,t),r=t$(n);return Sbe(r)}function Pbe(e,t){const n=uO(e),r=Obe(n,t);return Ebe(r)}function Lbe(e,t){const n=uO(e,t),r=t$(n);return Tbe(r)}function jbe(e,t,n){const{opacity:r,zIndex:i}=t;r!=null&&r!==n.opacity&&e.setOpacity(r),i!=null&&i!==n.zIndex&&e.setZIndex(i)}function E2(){return E2=Object.assign||function(e){for(var t=1;t(m==null?void 0:m.map)??null,[m]);const y=$.useCallback(_=>{if(_!==null&&m===null){const w=new lp.Map(_,d);n!=null&&c!=null?w.setView(n,c):e!=null&&w.fitBounds(e,t),l!=null&&w.whenReady(l),v(wbe(w))}},[]);$.useEffect(()=>()=>{m==null||m.map.remove()},[m]);const x=m?Y.createElement(XF,{value:m},r):a??null;return Y.createElement("div",E2({},p,{ref:y}),x)}const Abe=$.forwardRef(Mbe),Rbe=kbe(function({position:e,...t},n){const r=new lp.Marker(e,t);return cO(r,xbe(n,{overlayContainer:r}))},function(e,t,n){t.position!==n.position&&e.setLatLng(t.position),t.icon!=null&&t.icon!==n.icon&&e.setIcon(t.icon),t.zIndexOffset!=null&&t.zIndexOffset!==n.zIndexOffset&&e.setZIndexOffset(t.zIndexOffset),t.opacity!=null&&t.opacity!==n.opacity&&e.setOpacity(t.opacity),e.dragging!=null&&t.draggable!==n.draggable&&(t.draggable===!0?e.dragging.enable():e.dragging.disable())}),Nbe=Pbe(function(e,t){const n=new lp.Popup(e,t.overlayContainer);return cO(n,t)},function(e,t,{position:n},r){$.useEffect(function(){const{instance:i}=e;function o(s){s.popup===i&&(i.update(),r(!0))}function a(s){s.popup===i&&r(!1)}return t.map.on({popupopen:o,popupclose:a}),t.overlayContainer==null?(n!=null&&i.setLatLng(n),i.openOn(t.map)):t.overlayContainer.bindPopup(i),function(){var s;t.map.off({popupopen:o,popupclose:a}),(s=t.overlayContainer)==null||s.unbindPopup(),t.map.removeLayer(i)}},[e,t,r,n])}),Dbe=Lbe(function({url:e,...t},n){const r=new lp.TileLayer(e,lO(t,n));return cO(r,n)},function(e,t,n){jbe(e,t,n);const{url:r}=t;r!=null&&r!==n.url&&e.setUrl(r)}),Ibe=()=>g.jsx(Dbe,{attribution:'© OpenStreetMap contributors',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),Fbe=e=>{if(e.length===0)return{};if(e.length>1)return{bounds:e.map(mt("latLong"))};const[{latLong:t}]=e;return{zoom:10,center:t}},n$=({toggle:e,isOpen:t,title:n,locations:r=[]})=>g.jsx(ua,{toggle:e,isOpen:t,className:"map-modal__modal",contentClassName:"map-modal__modal-content",children:g.jsxs(To,{className:"map-modal__modal-body",children:[g.jsxs("h3",{className:"map-modal__modal-title",children:[n,g.jsx("button",{type:"button",className:"btn-close float-end","aria-label":"Close",onClick:e})]}),g.jsxs(Abe,{...Fbe(r),children:[g.jsx(Ibe,{}),r.map(({cityName:i,latLong:o,count:a},s)=>g.jsx(Rbe,{position:o,children:g.jsxs(Nbe,{children:[g.jsx("b",{children:a})," visit",a>1?"s":""," from ",g.jsx("b",{children:i})]})},s))]})]})}),$be=({modalTitle:e,activeCities:t,locations:n=[]})=>{const[r,,i,o]=Tn(),[a,s]=Tn(),[l,c]=$.useState([]),d=a0(),f=$.useCallback(p=>{c(p?n.filter(p):n),i()},[n]);return g.jsxs(g.Fragment,{children:[!t&&g.jsx(yt,{color:"link",className:"open-map-modal-btn__btn",id:d,onClick:()=>f(),children:g.jsx(Ae,{icon:Yb})}),t&&g.jsxs($h,{isOpen:a,toggle:s,children:[g.jsx(Uu,{color:"link",className:"open-map-modal-btn__btn",id:d,children:g.jsx(Ae,{icon:Yb})}),g.jsxs($u,{end:!0,children:[g.jsx(Ue,{onClick:()=>f(),children:"Show all locations"}),g.jsx(Ue,{onClick:()=>f(({cityName:p})=>t.includes(p)),children:"Show locations in current page"})]})]}),g.jsx(Dr,{placement:"left",target:d,children:"Show in map"}),g.jsx(n$,{toggle:o,isOpen:r,title:e,locations:l})]})},Ube=({onChange:e,selected:t={},className:n,isOrphanVisits:r})=>{const{orphanVisitsType:i,excludeBots:o=!1}=t,a=s=>({active:i===s,onClick:()=>e({...t,orphanVisitsType:s===(t==null?void 0:t.orphanVisitsType)?void 0:s})});return g.jsxs(fa,{text:"Filters",dropdownClassName:n,inline:!0,end:!0,minWidth:250,children:[g.jsx(Ue,{header:!0,children:"Bots:"}),g.jsx(Ue,{active:o,onClick:()=>e({...t,excludeBots:!(t!=null&&t.excludeBots)}),children:"Exclude potential bots"}),r&&g.jsxs(g.Fragment,{children:[g.jsx(Ue,{divider:!0}),g.jsx(Ue,{header:!0,children:"Orphan visits type:"}),g.jsx(Ue,{...a("base_url"),children:"Base URL"}),g.jsx(Ue,{...a("invalid_short_url"),children:"Invalid short URL"}),g.jsx(Ue,{...a("regular_404"),children:"Regular 404"})]}),g.jsx(Ue,{divider:!0}),g.jsx(Ue,{disabled:!co(t),onClick:()=>e({excludeBots:!1,orphanVisitsType:void 0}),children:g.jsx("i",{children:"Clear filters"})})]})},r$=(e,t)=>!$l(e)&&co(e[t]),PA=e=>typeof e=="number"?e:e?parseFloat(e):0,Bbe=(e,{os:t})=>{e[t]=(e[t]||0)+1},zbe=(e,{browser:t})=>{e[t]=(e[t]||0)+1},Vbe=(e,{referer:t})=>{e[t]=(e[t]||0)+1},i$=e=>(t,n)=>{const r=r$(n,e)?n[e]:"Unknown";t[r]=(t[r]||0)+1},Hbe=i$("country"),Wbe=i$("city"),Ybe=(e,t)=>{if(!r$(t,"city")||t.city==="Unknown")return;const{city:n,latitude:r,longitude:i}=t,o=e[n]||{cityName:n,count:0,latLong:[PA(r),PA(i)]};o.count+=1,e[n]=o},Gbe=(e,t)=>{if(!A1e(t))return;const{visitedUrl:n}=t;e[n]=(e[n]||0)+1},o$=e=>e.reduce((t,n)=>(Bbe(t.os,n),zbe(t.browsers,n),Vbe(t.referrers,n),Hbe(t.countries,n),Wbe(t.cities,n),Ybe(t.citiesForMap,n),Gbe(t.visitedUrls,n),t),{os:{},browsers:{},referrers:{},countries:{},cities:{},citiesForMap:{},visitedUrls:{}}),a$=N5(e=>{const{userAgent:t,date:n,referer:r,visitLocation:i,potentialBot:o}=e,a={date:n,potentialBot:o,...ebe(t),referer:tbe(r),country:(i==null?void 0:i.countryName)||"Unknown",city:(i==null?void 0:i.cityName)||"Unknown",latitude:i==null?void 0:i.latitude,longitude:i==null?void 0:i.longitude};return iO(e)?{...a,type:e.type,visitedUrl:e.visitedUrl}:a}),qbe=Object.freeze(Object.defineProperty({__proto__:null,normalizeVisits:a$,processStatsFromVisits:o$},Symbol.toStringTag,{value:"Module"})),Yd=20,Kbe=({browser:e,os:t,referer:n,country:r,city:i,...o},a)=>`${e} ${t} ${n} ${r} ${i} ${o.visitedUrl}`.toLowerCase().includes(a.toLowerCase()),Zbe=(e,t)=>t.filter(n=>Kbe(n,e)),Qbe=(e,t)=>HI(t,e),Xbe=(e,t,n)=>{const r=t?Zbe(t,e):[...e],i=Qbe(n,r),o=i.length;return{visitsGroups:gh(Yd,i),total:o}},Jbe=({visits:e,selectedVisits:t=[],setSelectedVisits:n,matchMedia:r=window.matchMedia,isOrphanVisits:i=!1})=>{var o,a;const s="visits-table__header-cell visits-table__sticky",l=()=>r("(max-width: 767px)").matches,[c,d]=$.useState(l()),[f,p]=$.useState(void 0),[m,v]=$.useState({}),y=$.useMemo(()=>Xbe(e,f,m),[f,m]),x=$.useRef(!0),[_,w]=$.useState(1),S=_*Yd,E=S-Yd,C=8+Number(i),k=A=>()=>v({field:A,dir:l0(A,m.field,m.dir)}),j=A=>g.jsx(Cf,{currentOrder:m,field:A,className:"visits-table__header-icon"});return $.useEffect(()=>{const A=()=>d(l());return window.addEventListener("resize",A),()=>window.removeEventListener("resize",A)},[]),$.useEffect(()=>{w(1),!x.current&&n([]),x.current=!1},[f]),g.jsx("div",{className:"table-responsive-md",children:g.jsxs("table",{className:"table table-bordered table-hover table-sm visits-table",children:[g.jsxs("thead",{className:"visits-table__header",children:[g.jsxs("tr",{children:[g.jsx("th",{className:`${s} text-center`,onClick:()=>n(t.length0})})}),g.jsxs("th",{className:`${s} text-center`,onClick:k("potentialBot"),children:[g.jsx(Ae,{icon:nP}),j("potentialBot")]}),g.jsxs("th",{className:s,onClick:k("date"),children:["Date",j("date")]}),g.jsxs("th",{className:s,onClick:k("country"),children:["Country",j("country")]}),g.jsxs("th",{className:s,onClick:k("city"),children:["City",j("city")]}),g.jsxs("th",{className:s,onClick:k("browser"),children:["Browser",j("browser")]}),g.jsxs("th",{className:s,onClick:k("os"),children:["OS",j("os")]}),g.jsxs("th",{className:s,onClick:k("referer"),children:["Referrer",j("referer")]}),i&&g.jsxs("th",{className:s,onClick:k("visitedUrl"),children:["Visited URL",j("visitedUrl")]})]}),g.jsx("tr",{children:g.jsx("td",{colSpan:C,className:"p-0",children:g.jsx(Vh,{noBorder:!0,large:!1,onChange:p})})})]}),g.jsxs("tbody",{children:[!((o=y.visitsGroups[_-1])!=null&&o.length)&&g.jsx("tr",{children:g.jsx("td",{colSpan:C,className:"text-center",children:"No visits found with current filtering"})}),(a=y.visitsGroups[_-1])==null?void 0:a.map((A,U)=>{const N=t.includes(A);return g.jsxs("tr",{style:{cursor:"pointer"},className:rt({"table-active":N}),onClick:()=>n(N?t.filter(z=>z!==A):[...t,A]),children:[g.jsx("td",{className:"text-center",children:N&&g.jsx(Ae,{icon:Yf,className:"text-primary"})}),g.jsx("td",{className:"text-center",children:A.potentialBot&&g.jsxs(g.Fragment,{children:[g.jsx(Ae,{icon:nP,id:`botIcon${U}`}),g.jsx(Dr,{placement:"right",target:`botIcon${U}`,children:"Potentially a visit from a bot or crawler"})]})}),g.jsx("td",{children:g.jsx(ry,{date:A.date})}),g.jsx("td",{children:A.country}),g.jsx("td",{children:A.city}),g.jsx("td",{children:A.browser}),g.jsx("td",{children:A.os}),g.jsx("td",{children:A.referer}),i&&g.jsx("td",{children:A.visitedUrl})]},U)})]}),y.total>Yd&&g.jsx("tfoot",{children:g.jsx("tr",{children:g.jsx("td",{colSpan:C,className:"visits-table__footer-cell visits-table__sticky",children:g.jsxs("div",{className:"row",children:[g.jsx("div",{className:"col-md-6",children:g.jsx(XT,{pagesCount:Math.ceil(y.total/Yd),currentPage:_,setCurrentPage:w,centered:c})}),g.jsx("div",{className:rt("col-md-6",{"d-flex align-items-center flex-row-reverse":!c,"text-center mt-3":c}),children:g.jsxs("div",{children:["Visits ",g.jsx("b",{children:Sn(E+1)})," to"," ",g.jsx("b",{children:Sn(H5(S,y.total))})," of"," ",g.jsx("b",{children:Sn(y.total)})]})})]})})})})]})})},pc={byTime:{title:"By time",subPath:"by-time",icon:jW},byContext:{title:"By context",subPath:"by-context",icon:GS},byLocation:{title:"By location",subPath:"by-location",icon:Yb},list:{title:"List",subPath:"list",icon:u4}};let $m;const cp=({children:e,visitsInfo:t,getVisits:n,cancelGetVisits:r,exportCsv:i,isOrphanVisits:o=!1})=>{const{visits:a,loading:s,loadingLarge:l,error:c,errorData:d,progress:f,fallbackInterval:p}=t,[{dateRange:m,visitsFilter:v},y]=_be(),x=zl("visits"),_=Qn(({startDate:V,endDate:K})=>({dateRange:{startDate:V??void 0,endDate:K??void 0}}),y),w=$.useRef(m??p??(x==null?void 0:x.defaultInterval)??"last30Days"),[S,E]=$.useState([]),[C,k]=$.useState(),j=$.useRef(!0),{search:A}=yn(),U=V=>V?`${V}${A}`:A,N=$.useMemo(()=>a$(a),[a]),{os:z,browsers:W,referrers:X,countries:G,cities:Z,citiesForMap:te,visitedUrls:le}=$.useMemo(()=>o$(N),[N]),q=$.useMemo(()=>({...v,excludeBots:v.excludeBots??(x==null?void 0:x.excludeBots)}),[v]),I=fT(te),D=V=>{$m=void 0,E(V)},H=V=>K=>{const re=`${V}_${K}`;$m===re?(E([]),k(void 0),$m=void 0):(E(N.filter(Sde(V,K))),k(K),$m=re)};$.useEffect(()=>r,[]),$.useEffect(()=>{const V=j.current?m??Gpe(w.current):m;n({dateRange:V,filter:q},j.current),j.current=!1},[m,v]),$.useEffect(()=>{p&&w.current===((x==null?void 0:x.defaultInterval)??"last30Days")&&(w.current=p)},[p]);const ie=()=>l?g.jsxs(Wo,{loading:!0,children:["This is going to take a while... :S",g.jsx(LI,{value:f,striped:f===100,className:"mt-3"})]}):s?g.jsx(Wo,{loading:!0}):c?g.jsx(Yr,{type:"error",children:g.jsx(na,{errorData:d,fallbackMessage:"An error occurred while loading visits :("})}):ki(a)?g.jsx(Wo,{children:"There are no visits matching current filter"}):g.jsxs(g.Fragment,{children:[g.jsx(VI,{fill:!0,children:Object.values(pc).map(({title:V,icon:K,subPath:re},ae)=>g.jsxs(cf,{to:U(re),replace:!0,children:[g.jsx(Ae,{icon:K}),g.jsx("span",{className:"ms-2 d-none d-sm-inline",children:V})]},ae))}),g.jsx(yr,{children:g.jsxs(Gy,{children:[g.jsx(vt,{path:pc.byTime.subPath,element:g.jsx("div",{className:"col-12 mt-3",children:g.jsx(cbe,{title:"Visits during time",visits:N,highlightedVisits:S,highlightedLabel:C,setSelectedVisits:D})})}),g.jsx(vt,{path:pc.byContext.subPath,element:g.jsxs(g.Fragment,{children:[g.jsx("div",{className:rt("mt-3 col-lg-6",{"col-xl-4":!o}),children:g.jsx(wA,{title:"Operating systems",stats:z})}),g.jsx("div",{className:rt("mt-3 col-lg-6",{"col-xl-4":!o}),children:g.jsx(wA,{title:"Browsers",stats:W})}),g.jsx("div",{className:rt("mt-3",{"col-xl-4":!o,"col-lg-6":o}),children:g.jsx(Fm,{title:"Referrers",stats:X,withPagination:!1,highlightedStats:Dm(S,"referer"),highlightedLabel:C,sortingItems:{name:"Referrer name",amount:"Visits amount"},onClick:H("referer")})}),o&&g.jsx("div",{className:"mt-3 col-lg-6",children:g.jsx(Fm,{title:"Visited URLs",stats:le,highlightedLabel:C,highlightedStats:Dm(S,"visitedUrl"),sortingItems:{visitedUrl:"Visited URL",amount:"Visits amount"},onClick:H("visitedUrl")})})]})}),g.jsx(vt,{path:pc.byLocation.subPath,element:g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"col-lg-6 mt-3",children:g.jsx(Fm,{title:"Countries",stats:G,highlightedStats:Dm(S,"country"),highlightedLabel:C,sortingItems:{name:"Country name",amount:"Visits amount"},onClick:H("country")})}),g.jsx("div",{className:"col-lg-6 mt-3",children:g.jsx(Fm,{title:"Cities",stats:Z,highlightedStats:Dm(S,"city"),highlightedLabel:C,extraHeaderContent:V=>I.length>0&&g.jsx($be,{modalTitle:"Cities",locations:I,activeCities:V}),sortingItems:{name:"City name",amount:"Visits amount"},onClick:H("city")})})]})}),g.jsx(vt,{path:pc.list.subPath,element:g.jsx("div",{className:"col-12",children:g.jsx(Jbe,{visits:N,selectedVisits:S,setSelectedVisits:D,isOrphanVisits:o})})}),g.jsx(vt,{path:"*",element:g.jsx(DS,{replace:!0,to:U(pc.byTime.subPath)})})]})})]});return g.jsxs(g.Fragment,{children:[e,g.jsx("section",{className:"mt-3",children:g.jsxs("div",{className:"row flex-md-row-reverse",children:[g.jsx("div",{className:"col-lg-7 col-xl-6",children:g.jsxs("div",{className:"d-md-flex",children:[g.jsx("div",{className:"flex-fill",children:g.jsx(gF,{updatable:!0,disabled:s,initialDateRange:w.current,defaultText:"All visits",onDatesChange:_})}),g.jsx(Ube,{className:"ms-0 ms-md-2 mt-3 mt-md-0",isOrphanVisits:o,selected:q,onChange:V=>y({visitsFilter:V})})]})}),a.length>0&&g.jsx("div",{className:"col-lg-5 col-xl-6 mt-3 mt-lg-0",children:g.jsxs("div",{className:"d-flex",children:[g.jsx($8,{className:"btn-md-block",amount:N.length,onClick:()=>i(N)}),g.jsxs(yt,{outline:!0,disabled:S.length===0,className:"btn-md-block ms-2",onClick:()=>D([]),children:["Clear selection ",S.length>0&&g.jsxs(g.Fragment,{children:["(",Sn(S.length),")"]})]})]})})]})}),g.jsx("section",{className:"mt-3",children:ie()})]})},ewe=({exportVisits:e})=>xs(({getDomainVisits:t,domainVisits:n,cancelGetDomainVisits:r})=>{const i=Yu(),{domain:o=""}=Rl(),[a,s=a]=o.split("_");return g.jsx(cp,{getVisits:(l,c)=>t({domain:s,query:ap(l),doIntervalFallback:c}),cancelGetVisits:r,visitsInfo:n,exportCsv:l=>e(`domain_${a}_visits.csv`,l),children:g.jsx(sp,{goBack:i,visits:n.visits,title:`"${a}" visits`})})},()=>[yi.visits]),twe=({exportVisits:e})=>xs(({getNonOrphanVisits:t,nonOrphanVisits:n,cancelGetNonOrphanVisits:r})=>{const i=Yu();return g.jsx(cp,{getVisits:(o,a)=>t({query:ap(o),doIntervalFallback:a}),cancelGetVisits:r,visitsInfo:n,exportCsv:o=>e("non_orphan_visits.csv",o),children:g.jsx(sp,{title:"Non-orphan visits",goBack:i,visits:n.visits})})},()=>[yi.visits]),nwe=({exportVisits:e})=>xs(({getOrphanVisits:t,orphanVisits:n,cancelGetOrphanVisits:r})=>{const i=Yu();return g.jsx(cp,{getVisits:(o,a)=>{var s;return t({query:ap(o),orphanVisitsType:(s=o.filter)==null?void 0:s.orphanVisitsType,doIntervalFallback:a})},cancelGetVisits:r,visitsInfo:n,exportCsv:o=>e("orphan_visits.csv",o),isOrphanVisits:!0,children:g.jsx(sp,{title:"Orphan visits",goBack:i,visits:n.visits})})},()=>[yi.orphanVisits]),s$="shlink/orphanVisits",rwe={visits:[],loading:!1,loadingLarge:!1,error:!1,cancelLoad:!1,progress:0},iwe=e=>tp({typePrefix:`${s$}/getNonOrphanVisits`,createLoaders:({query:t={},doIntervalFallback:n=!1})=>{const r=e(),i=async(a,s)=>r.getNonOrphanVisits({...t,page:a,itemsPerPage:s}),o=np(n,a=>r.getNonOrphanVisits(a));return[i,o]},getExtraFulfilledPayload:({query:t={}})=>({query:t}),shouldCancel:t=>t().orphanVisits.cancelLoad}),owe=e=>rp({name:s$,initialState:rwe,asyncThunkCreator:e,filterCreatedVisits:({query:t={}},n)=>{const{startDate:r,endDate:i}=t;return n.filter(({visit:o})=>Xh(o.date,r,i))}}),l$="shlink/orphanVisits",awe={visits:[],loading:!1,loadingLarge:!1,error:!1,cancelLoad:!1,progress:0},swe=(e,t)=>!t||t===e.type,lwe=e=>tp({typePrefix:`${l$}/getOrphanVisits`,createLoaders:({orphanVisitsType:t,query:n={},doIntervalFallback:r=!1})=>{const i=e(),o=async(s,l)=>i.getOrphanVisits({...n,page:s,itemsPerPage:l}).then(c=>{const d=c.data.filter(f=>iO(f)&&swe(f,t));return{...c,data:d}}),a=np(r,s=>i.getOrphanVisits(s));return[o,a]},getExtraFulfilledPayload:({query:t={}})=>({query:t}),shouldCancel:t=>t().orphanVisits.cancelLoad}),cwe=e=>rp({name:l$,initialState:awe,asyncThunkCreator:e,filterCreatedVisits:({query:t={}},n)=>{const{startDate:r,endDate:i}=t;return n.filter(({visit:o,shortUrl:a})=>!a&&Xh(o.date,r,i))}}),c$="shlink/shortUrlVisits",uwe={visits:[],shortCode:"",domain:void 0,loading:!1,loadingLarge:!1,error:!1,cancelLoad:!1,progress:0},dwe=e=>tp({typePrefix:`${c$}/getShortUrlVisits`,createLoaders:({shortCode:t,query:n={},doIntervalFallback:r=!1})=>{const i=e(),o=async(s,l)=>i.getShortUrlVisits(t,{...n,page:s,itemsPerPage:l}),a=np(r,async s=>i.getShortUrlVisits(t,{...s,domain:n.domain}));return[o,a]},getExtraFulfilledPayload:({shortCode:t,query:n={}})=>({shortCode:t,query:n,domain:n.domain}),shouldCancel:t=>t().shortUrlVisits.cancelLoad}),fwe=e=>rp({name:c$,initialState:uwe,asyncThunkCreator:e,filterCreatedVisits:({shortCode:t,domain:n,query:r={}},i)=>{const{startDate:o,endDate:a}=r;return i.filter(({shortUrl:s,visit:l})=>s&&wf(s,t,n)&&Xh(l.date,o,a))}}),u$="shlink/tagVisits",hwe={visits:[],tag:"",loading:!1,loadingLarge:!1,error:!1,cancelLoad:!1,progress:0},pwe=e=>tp({typePrefix:`${u$}/getTagVisits`,createLoaders:({tag:t,query:n={},doIntervalFallback:r=!1})=>{const i=e(),o=async(s,l)=>i.getTagVisits(t,{...n,page:s,itemsPerPage:l}),a=np(r,async s=>i.getTagVisits(t,s));return[o,a]},getExtraFulfilledPayload:({tag:t,query:n={}})=>({tag:t,query:n}),shouldCancel:t=>t().tagVisits.cancelLoad}),mwe=e=>rp({name:u$,initialState:hwe,asyncThunkCreator:e,filterCreatedVisits:({tag:t,query:n={}},r)=>{const{startDate:i,endDate:o}=n;return r.filter(({shortUrl:a,visit:s})=>(a==null?void 0:a.tags.includes(t))&&Xh(s.date,i,o))}}),d$="shlink/visitsOverview",Um={nonOrphanVisits:{total:0},orphanVisits:{total:0},loading:!1,error:!1},LA=e=>e.filter(({visit:t})=>t.potentialBot).length,gwe=e=>Nr(`${d$}/loadVisitsOverview`,()=>e().getVisitsOverview().then(({nonOrphanVisits:t,visitsCount:n,orphanVisits:r,orphanVisitsCount:i})=>({nonOrphanVisits:{total:(t==null?void 0:t.total)??n,nonBots:t==null?void 0:t.nonBots,bots:t==null?void 0:t.bots},orphanVisits:{total:(r==null?void 0:r.total)??i,nonBots:r==null?void 0:r.nonBots,bots:r==null?void 0:r.bots}}))),vwe=e=>ur({name:d$,initialState:Um,reducers:{},extraReducers:t=>{t.addCase(e.pending,()=>({...Um,loading:!0})),t.addCase(e.rejected,()=>({...Um,error:!0})),t.addCase(e.fulfilled,(n,{payload:r})=>({...Um,...r})),t.addCase(ep,({nonOrphanVisits:n,orphanVisits:r,...i},{payload:o})=>{const{nonOrphanVisits:a,orphanVisits:s}=R1e(o.createdVisits),l=a.length,c=LA(a),d=l-c,f=s.length,p=LA(s),m=f-p;return{...i,nonOrphanVisits:{total:n.total+l,bots:n.bots&&n.bots+c,nonBots:n.nonBots&&n.nonBots+d},orphanVisits:{total:r.total+f,bots:r.bots&&r.bots+p,nonBots:r.nonBots&&r.nonBots+m}}})}}),ywe=({shortUrlDetail:e,shortUrlVisits:t,goBack:n})=>{const{shortUrl:r,loading:i}=e,{visits:o}=t,a=(r==null?void 0:r.shortUrl)??"",s=(r==null?void 0:r.longUrl)??"",l=r==null?void 0:r.title;return g.jsxs(sp,{title:g.jsxs(g.Fragment,{children:["Visits for ",g.jsx(Yo,{href:a})]}),goBack:n,visits:o,shortUrl:r,children:[g.jsx("hr",{}),g.jsxs("div",{children:["Created: ",(()=>r?g.jsxs("span",{children:[g.jsx("b",{id:"created",className:"short-url-visits-header__created-at",children:g.jsx(ry,{date:r.dateCreated,relative:!0})}),g.jsx(Dr,{placement:"bottom",target:"created",children:g.jsx(ry,{date:r.dateCreated})})]}):g.jsx("small",{children:"Loading..."}))()]}),g.jsxs("div",{className:"long-url-container",children:[`${l?"Title":"Long URL"}: `,i&&g.jsx("small",{children:"Loading..."}),!i&&g.jsx(Yo,{href:s,children:l??s})]})]})},_we=({exportVisits:e})=>xs(({shortUrlVisits:t,shortUrlDetail:n,getShortUrlVisits:r,getShortUrlDetail:i,cancelGetShortUrlVisits:o})=>{const{shortCode:a=""}=Rl(),{search:s}=yn(),l=Yu(),{domain:c}=Dl(s),d=(p,m)=>r({shortCode:gg(a),query:{...ap(p),domain:c},doIntervalFallback:m}),f=p=>{var m;return e(`short-url_${(m=n.shortUrl)==null?void 0:m.shortUrl.replace(/https?:\/\//g,"")}_visits.csv`,p)};return $.useEffect(()=>{i({shortCode:gg(a),domain:c})},[]),g.jsx(cp,{getVisits:d,cancelGetVisits:o,visitsInfo:t,exportCsv:f,children:g.jsx(ywe,{shortUrlDetail:n,shortUrlVisits:t,goBack:l})})},(t,n)=>n.shortCode?[yi.shortUrlVisits(gg(n.shortCode))]:[]),bwe=({tagVisits:e,goBack:t,colorGenerator:n})=>{const{visits:r,tag:i}=e;return g.jsx(sp,{title:g.jsxs("span",{className:"d-flex align-items-center justify-content-center",children:[g.jsx("span",{className:"me-2",children:"Visits for"}),g.jsx(FT,{text:i,colorGenerator:n})]}),goBack:t,visits:r})},wwe=(e,{exportVisits:t})=>xs(({getTagVisits:n,tagVisits:r,cancelGetTagVisits:i})=>{const o=Yu(),{tag:a=""}=Rl();return g.jsx(cp,{getVisits:(s,l)=>n({tag:a,query:ap(s),doIntervalFallback:l}),cancelGetVisits:i,visitsInfo:r,exportCsv:s=>t(`tag_${a}_visits.csv`,s),children:g.jsx(bwe,{tagVisits:r,goBack:o,colorGenerator:e})})},()=>[yi.visits]),xwe=(e,t)=>{e.serviceFactory("MapModal",()=>n$),e.serviceFactory("ShortUrlVisits",_we,"ReportExporter"),e.decorator("ShortUrlVisits",t(["shortUrlVisits","shortUrlDetail","mercureInfo"],["getShortUrlVisits","getShortUrlDetail","cancelGetShortUrlVisits","createNewVisits","loadMercureInfo"])),e.serviceFactory("TagVisits",wwe,"ColorGenerator","ReportExporter"),e.decorator("TagVisits",t(["tagVisits","mercureInfo"],["getTagVisits","cancelGetTagVisits","createNewVisits","loadMercureInfo"])),e.serviceFactory("DomainVisits",ewe,"ReportExporter"),e.decorator("DomainVisits",t(["domainVisits","mercureInfo"],["getDomainVisits","cancelGetDomainVisits","createNewVisits","loadMercureInfo"])),e.serviceFactory("OrphanVisits",nwe,"ReportExporter"),e.decorator("OrphanVisits",t(["orphanVisits","mercureInfo"],["getOrphanVisits","cancelGetOrphanVisits","createNewVisits","loadMercureInfo"])),e.serviceFactory("NonOrphanVisits",twe,"ReportExporter"),e.decorator("NonOrphanVisits",t(["nonOrphanVisits","mercureInfo"],["getNonOrphanVisits","cancelGetNonOrphanVisits","createNewVisits","loadMercureInfo"])),e.serviceFactory("VisitsParser",()=>qbe),e.serviceFactory("getShortUrlVisits",dwe,"apiClientFactory"),e.serviceFactory("cancelGetShortUrlVisits",mt("cancelGetVisits"),"shortUrlVisitsReducerCreator"),e.serviceFactory("getTagVisits",pwe,"apiClientFactory"),e.serviceFactory("cancelGetTagVisits",mt("cancelGetVisits"),"tagVisitsReducerCreator"),e.serviceFactory("getDomainVisits",Qpe,"apiClientFactory"),e.serviceFactory("cancelGetDomainVisits",mt("cancelGetVisits"),"domainVisitsReducerCreator"),e.serviceFactory("getOrphanVisits",lwe,"apiClientFactory"),e.serviceFactory("cancelGetOrphanVisits",mt("cancelGetVisits"),"orphanVisitsReducerCreator"),e.serviceFactory("getNonOrphanVisits",iwe,"apiClientFactory"),e.serviceFactory("cancelGetNonOrphanVisits",mt("cancelGetVisits"),"nonOrphanVisitsReducerCreator"),e.serviceFactory("createNewVisits",()=>ep),e.serviceFactory("loadVisitsOverview",gwe,"apiClientFactory"),e.serviceFactory("visitsOverviewReducerCreator",vwe,"loadVisitsOverview"),e.serviceFactory("visitsOverviewReducer",mt("reducer"),"visitsOverviewReducerCreator"),e.serviceFactory("domainVisitsReducerCreator",Xpe,"getDomainVisits"),e.serviceFactory("domainVisitsReducer",mt("reducer"),"domainVisitsReducerCreator"),e.serviceFactory("nonOrphanVisitsReducerCreator",owe,"getNonOrphanVisits"),e.serviceFactory("nonOrphanVisitsReducer",mt("reducer"),"nonOrphanVisitsReducerCreator"),e.serviceFactory("orphanVisitsReducerCreator",cwe,"getOrphanVisits"),e.serviceFactory("orphanVisitsReducer",mt("reducer"),"orphanVisitsReducerCreator"),e.serviceFactory("shortUrlVisitsReducerCreator",fwe,"getShortUrlVisits"),e.serviceFactory("shortUrlVisitsReducer",mt("reducer"),"shortUrlVisitsReducerCreator"),e.serviceFactory("tagVisitsReducerCreator",mwe,"getTagVisits"),e.serviceFactory("tagVisitsReducer",mt("reducer"),"tagVisitsReducerCreator")},jd=({children:e,to:t,className:n,...r})=>g.jsx(BD,{className:({isActive:i})=>rt("aside-menu__item",n,{"aside-menu__item--selected":i}),to:t,...r,children:e}),Swe=({routePrefix:e,showOnMobile:t=!1})=>{const{pathname:n}=yn(),r=rt("aside-menu",{"aside-menu--hidden":!t}),i=o=>`${e}${o}`;return g.jsx("aside",{className:r,children:g.jsxs("nav",{className:"nav flex-column aside-menu__nav",children:[g.jsxs(jd,{to:i("/overview"),children:[g.jsx(Ae,{fixedWidth:!0,icon:sY}),g.jsx("span",{className:"aside-menu__item-text",children:"Overview"})]}),g.jsxs(jd,{to:i("/list-short-urls/1"),className:rt({"aside-menu__item--selected":n.match("/list-short-urls")!==null}),children:[g.jsx(Ae,{fixedWidth:!0,icon:u4}),g.jsx("span",{className:"aside-menu__item-text",children:"List short URLs"})]}),g.jsxs(jd,{to:i("/create-short-url"),children:[g.jsx(Ae,{fixedWidth:!0,icon:fY,flip:"horizontal"}),g.jsx("span",{className:"aside-menu__item-text",children:"Create short URL"})]}),g.jsxs(jd,{to:i("/manage-tags"),children:[g.jsx(Ae,{fixedWidth:!0,icon:d4}),g.jsx("span",{className:"aside-menu__item-text",children:"Manage tags"})]}),g.jsxs(jd,{to:i("/manage-domains"),children:[g.jsx(Ae,{fixedWidth:!0,icon:BW}),g.jsx("span",{className:"aside-menu__item-text",children:"Manage domains"})]})]})})},Ewe=(e,t,n,r,i,o,a,s,l,c,d)=>({createNotFound:f})=>{const p=yn(),m=Ul(),[v,y,x,_]=Tn();$.useEffect(()=>_(),[p]);const w=Qh("domainVisits"),S=rt("shlink-layout__burger-icon",{"shlink-layout__burger-icon--active":v}),E=zme(x,_);return g.jsxs(g.Fragment,{children:[g.jsx(Ae,{icon:DW,className:S,onClick:y}),g.jsx("div",{...E,className:"shlink-layout__swipeable",children:g.jsxs("div",{className:"shlink-layout__swipeable-inner",children:[g.jsx(Swe,{routePrefix:m,showOnMobile:v}),g.jsx("div",{className:"shlink-layout__container",onClick:()=>_(),children:g.jsx("div",{className:"container-xl",children:g.jsxs(Gy,{children:[g.jsx(vt,{index:!0,element:g.jsx(DS,{replace:!0,to:"overview"})}),g.jsx(vt,{path:"/overview",element:g.jsx(l,{})}),g.jsx(vt,{path:"/list-short-urls/:page",element:g.jsx(t,{})}),g.jsx(vt,{path:"/create-short-url",element:g.jsx(n,{})}),g.jsx(vt,{path:"/short-code/:shortCode/visits/*",element:g.jsx(r,{})}),g.jsx(vt,{path:"/short-code/:shortCode/edit",element:g.jsx(c,{})}),g.jsx(vt,{path:"/tag/:tag/visits/*",element:g.jsx(i,{})}),w&&g.jsx(vt,{path:"/domain/:domain/visits/*",element:g.jsx(o,{})}),g.jsx(vt,{path:"/orphan-visits/*",element:g.jsx(a,{})}),g.jsx(vt,{path:"/non-orphan-visits/*",element:g.jsx(s,{})}),g.jsx(vt,{path:"/manage-tags",element:g.jsx(e,{})}),g.jsx(vt,{path:"/manage-domains",element:g.jsx(d,{})}),f&&g.jsx(vt,{path:"*",element:f("/list-short-urls/1")})]})})})]})})]})},Twe=!0,Owe=e=>y6({devTools:!Twe,reducer:BE({mercureInfo:e.mercureInfoReducer,shortUrlsList:e.shortUrlsListReducer,shortUrlCreation:e.shortUrlCreationReducer,shortUrlDeletion:e.shortUrlDeletionReducer,shortUrlEdition:e.shortUrlEditionReducer,shortUrlDetail:e.shortUrlDetailReducer,shortUrlVisits:e.shortUrlVisitsReducer,tagVisits:e.tagVisitsReducer,domainVisits:e.domainVisitsReducer,orphanVisits:e.orphanVisitsReducer,nonOrphanVisits:e.nonOrphanVisitsReducer,tagsList:e.tagsListReducer,tagDelete:e.tagDeleteReducer,tagEdit:e.tagEditReducer,domainsList:e.domainsListReducer,visitsOverview:e.visitsOverviewReducer}),middleware:t=>t({immutableCheck:!1,serializableCheck:!1})}),Cwe=e=>{e.serviceFactory("Main",Ewe,"TagsList","ShortUrlsList","CreateShortUrl","ShortUrlVisits","TagVisits","DomainVisits","OrphanVisits","NonOrphanVisits","Overview","EditShortUrl","ManageDomains"),e.factory("store",Owe)},Oo=new Hce,{container:kwe}=Oo,Pwe=(e,t)=>(...n)=>e[t](...n),Lwe=(e,t)=>({...e,[t]:Pwe(kwe,t)}),up=(e,t=[])=>PD(e?W5(e):null,t.reduce(Lwe,{}));Cwe(Oo);Zye(Oo,up);p_e(Oo,up);xwe(Oo,up);dme(Oo);lme(Oo,up);Ome(Oo,up);M1e(Oo);let jA;const jwe=e=>({serverVersion:t,apiClient:n,settings:r,routesPrefix:i="",createNotFound:o,tagColorsStorage:a})=>{const s=zde(t),l=$.useRef(),[c,d]=$.useState(),f=Al(),[p,m]=$.useMemo(()=>f?[$.Fragment,{}]:[UD,{basename:i}],[f,i]);return $.useEffect(()=>{jA=n,e.value("apiClientFactory",()=>jA),a&&e.value("TagColorsStorage",a);const{container:v}=e,{Main:y,store:x,loadMercureInfo:_,listTags:w}=v;l.current=g.jsx(y,{createNotFound:o}),d(x),x.dispatch(_(r)),x.dispatch(w())},[n,a]),c?g.jsx(LD,{store:c,children:g.jsx(Sme,{value:r,children:g.jsx(Vde,{value:s,children:g.jsx(Hde,{value:i,children:g.jsx(p,{...m,children:l.current})})})})}):g.jsx(g.Fragment,{})},Mwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",Awe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABSCAMAAAAhFXfZAAAC91BMVEVMaXEzeak2f7I4g7g3g7cua5gzeKg8hJo3grY4g7c3grU0gLI2frE0daAubJc2gbQwd6QzeKk2gLMtd5sxdKIua5g1frA2f7IydaM0e6w2fq41fK01eqo3grgubJgta5cxdKI1f7AydaQydaMxc6EubJgvbJkwcZ4ubZkwcJwubZgubJcydqUydKIxapgubJctbJcubZcubJcvbJYubJcvbZkubJctbJctbZcubJg2f7AubJcrbZcubJcubJcua5g3grY0fq8ubJcubJdEkdEwhsw6i88vhswuhcsuhMtBjMgthMsrg8srgss6is8qgcs8i9A9iMYtg8spgcoogMo7hcMngMonf8olfso4gr8kfck5iM8jfMk4iM8he8k1fro7itAgesk2hs8eecgzfLcofssdeMg0hc4cd8g2hcsxeLQbdsgZdcgxeLImfcszhM0vda4xgckzhM4xg84wf8Yxgs4udKsvfcQucqhUndROmdM1fK0wcZ8vb5w0eqpQm9MzeKhXoNVcpdYydKNWn9VZotVKltJFjsIwcJ1Rms9OlslLmtH///8+kc9epdYzd6dbo9VHkMM2f7FHmNBClM8ydqVcpNY9hro3gLM9hLczealQmcw3fa46f7A8gLMxc6I3eagyc6FIldJMl9JSnNRSntNNl9JPnNJFi75UnM9ZodVKksg8kM45jc09e6ZHltFBk883gbRBh7pDk9EwcaBzn784g7dKkcY2i81Om9M7j85Llc81is09g7Q4grY/j9A0eqxKmdFFltBEjcXf6fFImdBCiLxJl9FGlNFBi78yiMxVndEvbpo6js74+vx+psPP3+o/ks5HkcpGmNCjwdZCkNDM3ehYoNJEls+lxNkxh8xHks0+jdC1zd5Lg6r+/v/H2ufz9/o3jM3t8/edvdM/k89Th61OiLBSjbZklbaTt9BfptdjmL1AicBHj8hGk9FAgK1dkLNTjLRekrdClc/k7fM0icy0y9tgp9c4jc2NtM9Dlc8zicxeXZn3AAAAQ3RSTlMAHDdTb4yPA+LtnEQmC4L2EmHqB7XA0d0sr478x4/Yd5i1zOfyPkf1sLVq4Nh3FvjxopQ2/STNuFzUwFIwxKaejILpIBEV9wAABhVJREFUeF6s1NdyFEcYBeBeoQIhRAkLlRDGrhIgY3BJL8CVeKzuyXFzzjkn5ZxzzuScg3PO8cKzu70JkO0LfxdTU//pM9vTu7Xgf6KqOVTb9X7toRrVEfBf1HTVjZccrT/2by1VV928Yty9ZbVuucdz90frG8DBjl9pVApbOstvmMuvVgaNXSfAAd6pGxpy6yxf5ph43pS/4f3uoaGm2rdu72S9xzOvMymkZFq/ptDrk90mhW7e4zl7HLzhxGWPR20xmSxJ/VqldG5m9XhaVOA1DadsNh3Pu5L2N6QtPO/32JpqQBVVk20oy/Pi2s23WEvyfHbe1thadVQttvm7Llf65gGmXK67XtupyoM7HQhmXdLS8oGWJNeOJ3C5fG5XCEJnkez3/oFdsvgJ4l2ANZwhrJKk/7OSXa+3Vw2WJMlKnGkobouYk6T0TyX30klOUnTD9HJ5qpckL3EW/w4XF3Xd0FGywXUrstrclVsqz5Pd/sXFYyDnPdrLcQODmGOK47IZb4CmibmMn+MYRzFZ5jg33ZL/EJrWcszHmANy3ARBK/IXtciJy8VsitPSdE3uuHxzougojcUdr8/32atnz/ev3f/K5wtpxUTpcaI45zusVDpYtZi+jg0oU9b3x74h7+n9ABvYEZeKaVq0sh0AtLKsFtqNBdeT0MrSzwwlq9+x6xAO4tgOtSzbCjrNQQiNvQUbUEubvzBUeGw26yDCsRHCoLkTHDa7IdOLIThs/gHvChszh2CimE8peRs47cxANI0lYNB5y1DljpOF0IhzBDPOZnDOqYYbeGKECbPzWnXludPphw5c2YBq5zlwXphIbO4VDCZ0gnPfUO1TwZoYwAs2ExPCedAu9DAjfQUjzITQb3jNj0KG2Sgt6BHaQUdYzWz+XmBktOHwanXjaSTcwwziBcuMOtwBmqPrTOxFQR/DRKKPqyur0aiW6cULYsx6tBm0jXpR/AUWR6HRq9WVW6MRhIq5jLyjbaCTDCijyYJNpCajdyobP/eTw0iexBAKkJ3gA5KcQb2zBXsIBckn+xVv8jkZSaEFHE+jFEleAEfayRU0MouNoBmB/L50Ai/HSLIHxcrpCvnhSQAuakKp2C/YbCylJjXRVy/z3+Kv/RrNcCo+WUzlVEhzKffnTQnxeN9fWF88fiNCUdSTsaufaChKWInHeysygfpIqagoakW+vV20J8uyl6TyNKEZWV4oRSPyCkWpgOLSbkCObT8o2r6tlG58HQquf6O0v50tB7JM7F4EORd2dx/K0w/KHsVkLPaoYrwgP/y7krr3SSMA4zj+OBgmjYkxcdIJQyQRKgg2viX9Hddi9UBb29LrKR7CVVEEEXWojUkXNyfTNDE14W9gbHJNuhjDettN3ZvbOvdOqCD3Jp/9l+/wJE+9PkYGjx/fqkys3S2rMozM/o2106rfMUINo6hVqz+eu/hd1c4xTg0TAfy5kV+4UG6+IthHTU9woWmxuKNbTfuCSfovBCxq7EtHqvYL4Sm6F8GVxsSXHMQ07TOi1DKtZxjWaaIyi4CXWjxPccUw8WVbMYY5wxC1mzEyXMJWkllpRloi+Kkoq69sxBTlElF6aAxYUbjXNlhlDZilDnM4U5SlN5biRsRHnbx3mbeWjEh4mEyiuJDl5XcWVmX5GvNkFgLWZM5qwsop4/AWfLhU1cR7k1VVvcYCWRkOI6Xy5gmnphCYIkvzuNYzHzosq2oNk2RtSs8khfUOfHIDgR6ysYBaMpl4uEgk2U/oJTs9AaTSwma7dT69geAE2ZpEjUsn2ieJNHeKfrI3EcAGJ2ZaNgVuC8EBctCLc57P5u5led6IOBkIYkuQMrmmjChs4VkfOerHqSBkPzZlhe06RslZ3zMjk2sscqKwY0RcjKK+LWbzd7KiHhkncs/siFJ+V5eXxD34B8nVuJEpGJNmxN2gH3vSvp7J70tF+D1Ej8qUJD1TkErAND2GZwTFg/LubvmgiBG3SOvdlsqFQrkEzJCL1rstlnVFROixZoDDSuXQFHESwVGlcuQcMb/b42NgjLowh5MTDFE3vNB5qStRIErdCQEh6pLPR92anSUb/wAIhldAaDMpGgAAAABJRU5ErkJggg==",Rwe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC",Nwe=()=>{delete kA.Icon.Default.prototype._getIconUrl,kA.Icon.Default.mergeOptions({iconRetinaUrl:Awe,iconUrl:Mwe,shadowUrl:Rwe})};Nwe();const Dwe=jwe(Oo);function ly(e){return t=>{const{resetSelectedServer:n}=t;return $.useEffect(()=>{n()},[n]),g.jsx(e,{...t})}}const Iwe=({location:e},{error:t})=>class extends $.Component{constructor(n){super(n),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n){t(n)}render(){const{hasError:n}=this.state;if(n)return g.jsx("div",{className:"home",children:g.jsxs(gn,{className:"p-4",children:[g.jsx("h1",{children:"Oops! This is awkward :S"}),g.jsx("p",{children:"It seems that something went wrong. Try refreshing the page or just click this button."}),g.jsx("br",{}),g.jsx(yt,{outline:!0,color:"primary",onClick:()=>e.reload(),children:"Take me back"})]})});const{children:r}=this.props;return r}},f$=({href:e,children:t,rel:n,...r})=>g.jsx("a",{target:"_blank",rel:`noopener noreferrer${n?` ${n}`:""}`,href:e,...r,children:t??e});const Fwe=({id:e,name:t})=>g.jsxs(DI,{tag:Ft,to:`/server/${e}`,className:"servers-list__server-item",children:[t,g.jsx(Ae,{icon:vY,className:"servers-list__server-item-icon"})]}),h$=({servers:e,children:t,embedded:n=!1})=>g.jsxs(g.Fragment,{children:[t&&g.jsx("h5",{className:"mb-md-3",children:t}),e.length>0&&g.jsx(AI,{className:Ve("servers-list__list-group",{"servers-list__list-group--embedded":n}),children:e.map(({id:r,name:i})=>g.jsx(Fwe,{id:r,name:i},r))})]}),p$=({color:e=OE,className:t})=>g.jsx("svg",{className:t,viewBox:"0 0 512 512",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:g.jsxs("g",{fill:e,children:[g.jsx("path",{d:" M 23.71 85.08 C 17.22 49.81 49.44 14.86 85.08 18.12 C 118.83 19.21 145.72 53.33 139.45 86.37 C 155.64 102.30 171.32 118.83 187.87 134.36 C 198.32 111.73 208.84 89.12 219.57 66.62 C 226.05 53.84 243.47 48.74 255.73 56.27 C 263.76 62.10 270.34 69.69 277.25 76.75 C 286.28 86.61 285.72 102.89 276.31 112.31 C 223.38 165.37 170.38 218.37 117.35 271.34 C 107.72 280.99 91.01 281.25 81.11 271.86 C 74.39 264.94 66.82 258.69 61.24 250.77 C 53.72 238.52 58.85 221.07 71.64 214.62 C 94.11 203.87 116.72 193.38 139.33 182.91 C 123.81 166.36 107.30 150.68 91.37 134.49 C 60.20 140.28 27.37 116.78 23.71 85.08 Z"}),g.jsx("path",{d:" M 205.21 201.23 C 225.32 181.36 260.88 181.11 281.14 200.86 C 299.25 218.75 317.37 236.65 335.10 254.93 C 356.73 278.01 352.01 318.70 326.03 336.56 C 320.07 330.47 313.73 324.65 308.12 318.28 C 323.86 309.39 328.76 286.18 316.63 272.39 C 301.73 256.95 286.30 242.03 271.24 226.75 C 264.49 219.65 256.80 212.00 246.37 211.52 C 224.65 208.64 205.52 233.36 214.49 253.58 C 221.09 266.81 234.22 275.12 243.62 286.24 C 240.43 295.96 238.09 306.13 238.29 316.46 C 225.55 304.29 213.16 291.73 200.89 279.09 C 180.97 257.57 183.10 220.45 205.21 201.23 Z"}),g.jsx("path",{d:" M 273.90 352.07 C 252.28 328.99 256.98 288.31 282.96 270.46 C 288.93 276.54 295.26 282.36 300.88 288.72 C 285.14 297.62 280.23 320.82 292.38 334.61 C 307.27 350.05 322.70 364.96 337.75 380.25 C 344.51 387.35 352.20 395.00 362.64 395.48 C 384.35 398.37 403.49 373.64 394.51 353.42 C 387.92 340.18 374.78 331.88 365.38 320.76 C 368.56 311.04 370.91 300.86 370.71 290.54 C 383.45 302.70 395.84 315.27 408.11 327.91 C 428.03 349.43 425.90 386.55 403.78 405.77 C 383.68 425.64 348.13 425.89 327.86 406.14 C 309.75 388.25 291.60 370.37 273.90 352.07 Z"}),g.jsx("path",{d:" M 422.11 403.83 C 431.96 394.07 441.60 384.06 451.66 374.51 C 460.90 383.74 471.89 392.70 474.89 406.11 C 480.16 429.97 484.08 454.13 488.76 478.12 C 490.00 483.41 484.47 488.29 479.35 486.63 C 454.66 481.52 429.55 478.12 405.14 471.84 C 393.17 467.97 385.20 457.75 376.55 449.27 C 386.39 439.49 396.13 429.60 406.06 419.91 C 416.37 433.45 435.74 414.00 422.11 403.83 Z"})]})});const $we=({servers:e})=>{const t=Eo(),n=VS(e),r=!r4(n);return $.useEffect(()=>{const i=n.find(({autoConnect:o})=>o);i&&t(`/server/${i.id}`)},[n,t]),g.jsx("div",{className:"home",children:g.jsx(Zr,{className:"home__main-card",children:g.jsxs(yr,{className:"g-0",children:[g.jsx("div",{className:"col-md-5 d-none d-md-block",children:g.jsx("div",{className:"home__logo-wrapper",children:g.jsx("div",{className:"home__logo",children:g.jsx(p$,{})})})}),g.jsxs("div",{className:"col-md-7 home__servers-container",children:[g.jsx("div",{className:"home__title-wrapper",children:g.jsx("h1",{className:"home__title",children:"Welcome!"})}),g.jsx(h$,{embedded:!0,servers:n,children:!r&&g.jsxs("div",{className:"p-4 text-center",children:[g.jsx("p",{className:"mb-5",children:"This application will help you manage your Shlink servers."}),g.jsx("p",{children:g.jsxs(Ft,{to:"/server/create",className:"btn btn-outline-primary btn-lg me-2",children:[g.jsx(Ae,{icon:KS})," ",g.jsx("span",{className:"ms-1",children:"Add a server"})]})}),g.jsx("p",{className:"mb-0 mt-5",children:g.jsx(f$,{href:"https://shlink.io/documentation",children:g.jsxs("small",{children:[g.jsx("span",{className:"me-1",children:"Learn more about Shlink"})," ",g.jsx(Ae,{icon:XW})]})})})]})})]})]})})})};const Uwe=e=>()=>{const[t,n,,r]=Tn(),i=yn(),{pathname:o}=i;$.useEffect(r,[i,r]);const a="/settings",s=Ve("main-header__toggle-icon",{"main-header__toggle-icon--opened":t});return g.jsxs(X4,{color:"primary",dark:!0,fixed:"top",className:"main-header",expand:"md",children:[g.jsxs(J4,{tag:Ft,to:"/",children:[g.jsx(p$,{className:"main-header__brand-logo",color:"white"})," Shlink"]}),g.jsx(eI,{onClick:n,children:g.jsx(Ae,{icon:mY,className:s})}),g.jsx(pX,{navbar:!0,isOpen:t,children:g.jsxs(dE,{navbar:!0,className:"ms-auto",children:[g.jsx(tI,{children:g.jsxs(iI,{tag:Ft,to:a,active:o.startsWith(a),children:[g.jsx(Ae,{icon:wY}),"  Settings"]})}),g.jsx(e,{})]})})]})},Bwe=({children:e})=>{const t=yn();return $.useEffect(()=>{scrollTo(0,0)},[t]),g.jsx(g.Fragment,{children:e})},zwe=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,MA=e=>{if(typeof e!="string")throw new TypeError("Invalid argument expected string");const t=e.match(zwe);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},AA=e=>e==="*"||e==="x"||e==="X",RA=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},Vwe=(e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t],Hwe=(e,t)=>{if(AA(e)||AA(t))return 0;const[n,r]=Vwe(RA(e),RA(t));return n>r?1:n{for(let n=0;n{const n=MA(e),r=MA(t),i=n.pop(),o=r.pop(),a=NA(n,r);return a!==0?a:i&&o?NA(i.split("."),o.split(".")):i||o?i?-1:1:0},Ywe=(e,t,n)=>{Gwe(n);const r=Wwe(e,t);return m$[n].includes(r)},m$={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},DA=Object.keys(m$),Gwe=e=>{if(typeof e!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof e}`);if(DA.indexOf(e)===-1)throw new Error(`Invalid operator, expected one of ${DA.join("|")}`)},g$=i4(n4,e=>{try{return Ywe(e,e,"=")}catch{return!1}}),v$=e=>g$(e)?`v${e}`:e,y$=(e="latest")=>t=>g$(t)?t:e,qwe="%_VERSION_%",Kwe=Qy(y$(),v$),IA=({project:e,version:t})=>g.jsx(f$,{href:`https://github.com/shlinkio/${e}/releases/${t}`,className:"text-muted",children:g.jsx("b",{children:t})}),Zwe=({selectedServer:e,clientVersion:t=qwe})=>{const n=Kwe(t);return g.jsxs("small",{className:"text-muted",children:[l4(e)&&g.jsxs(g.Fragment,{children:["Server: ",g.jsx(IA,{project:"shlink",version:e.printableVersion})," - "]}),"Client: ",g.jsx(IA,{project:"shlink-web-client",version:n})]})};const Qwe=/^\/server\/[a-zA-Z0-9-]*\/(?!edit)/,Xwe=({selectedServer:e})=>{const{pathname:t}=yn(),n=$.useMemo(()=>Qwe.test(t),[t]),r=Ve("text-center",{"shlink-versions-container--with-sidebar":n});return g.jsx("div",{className:r,children:g.jsx(Zwe,{selectedServer:e})})};const qu=({children:e})=>g.jsx("div",{className:"no-menu-wrapper container-xl",children:e});function _$(e,t){return n=>{const r=Rl(),{selectServer:i,selectedServer:o}=n;return $.useEffect(()=>{r.serverId&&i(r.serverId)},[r.serverId,i]),o?SW(o)?g.jsx(t,{}):g.jsx(e,{...n}):g.jsx(qu,{children:g.jsx(Wo,{loading:!0})})}}const Jwe=(e,t,n,r)=>_$(({selectedServer:i,settings:o})=>{const a=l4(i),s=a?`/server/${i.id}`:"";return a?g.jsx(n,{serverVersion:i.version,apiClient:e(i),settings:o,routesPrefix:s,tagColorsStorage:t,createNotFound:l=>g.jsx(l6,{to:`${s}${l}`,children:"List short URLs"})}):g.jsx(r,{})},r),exe=(e,t)=>{e.constant("window",window),e.constant("console",console),e.constant("fetch",window.fetch.bind(window)),e.service("HttpClient",uie,"fetch"),e.serviceFactory("ScrollToTop",()=>Bwe),e.serviceFactory("MainHeader",Uwe,"ServersDropdown"),e.serviceFactory("Home",()=>$we),e.decorator("Home",ly),e.decorator("Home",t(["servers"],["resetSelectedServer"])),e.serviceFactory("ShlinkWebComponent",()=>Dwe),e.serviceFactory("ShlinkWebComponentContainer",Jwe,"buildShlinkApiClient","TagColorsStorage","ShlinkWebComponent","ServerError"),e.decorator("ShlinkWebComponentContainer",t(["selectedServer","settings"],["selectServer"])),e.serviceFactory("ShlinkVersionsContainer",()=>Xwe),e.decorator("ShlinkVersionsContainer",t(["selectedServer"])),e.serviceFactory("ErrorHandler",Iwe,"window","console")};let Bm;const txe=new Uint8Array(16);function nxe(){if(!Bm&&(Bm=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Bm))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bm(txe)}const qn=[];for(let e=0;e<256;++e)qn.push((e+256).toString(16).slice(1));function rxe(e,t=0){return(qn[e[t+0]]+qn[e[t+1]]+qn[e[t+2]]+qn[e[t+3]]+"-"+qn[e[t+4]]+qn[e[t+5]]+"-"+qn[e[t+6]]+qn[e[t+7]]+"-"+qn[e[t+8]]+qn[e[t+9]]+"-"+qn[e[t+10]]+qn[e[t+11]]+qn[e[t+12]]+qn[e[t+13]]+qn[e[t+14]]+qn[e[t+15]]).toLowerCase()}const ixe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),FA={randomUUID:ixe};function b$(e,t,n){if(FA.randomUUID&&!t&&!e)return FA.randomUUID();e=e||{};const r=e.random||(e.rng||nxe)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return rxe(r)}const oxe=2e3,axe=(e,t)=>(n=!1,r=oxe)=>{const[i,o]=$.useState(n),a=$.useRef(void 0);return[i,()=>{o(!n),a.current&&t(a.current),a.current=e(()=>o(n),r)}]},w$=()=>{const e=Eo();return()=>e(-1)},sxe=()=>{const{search:e}=yn();return Dl(e)},x$=({isOpen:e,duplicatedServers:t,onDiscard:n,onSave:r})=>{const i=t.length>1;return g.jsxs(ua,{centered:!0,isOpen:e,children:[g.jsxs(da,{children:["Duplicated server",i&&"s"]}),g.jsxs(To,{children:[g.jsx("p",{children:i?"The next servers already exist:":"There is already a server with:"}),g.jsx("ul",{children:t.map(({url:o,apiKey:a},s)=>i?g.jsxs("li",{children:[g.jsx("b",{children:o})," - ",g.jsx("b",{children:a})]},s):g.jsxs($.Fragment,{children:[g.jsxs("li",{children:["URL: ",g.jsx("b",{children:o})]}),g.jsxs("li",{children:["API key: ",g.jsx("b",{children:a})]})]},s))}),g.jsxs("span",{children:[i?"Do you want to ignore duplicated servers":"Do you want to save this server anyway","?"]})]}),g.jsxs(Nl,{children:[g.jsx(yt,{color:"link",onClick:n,children:i?"Ignore duplicates":"Discard"}),g.jsx(yt,{color:"primary",onClick:r,children:"Save anyway"})]})]})},lxe=e=>Qy(t=>t.preventDefault(),e),S$=({onSubmit:e,initialValues:t,children:n,title:r})=>{const[i,o]=$.useState(""),[a,s]=$.useState(""),[l,c]=$.useState(""),d=lxe(()=>e({name:i,url:a,apiKey:l}));return $.useEffect(()=>{t&&o(t.name),t&&s(t.url),t&&c(t.apiKey)},[t]),g.jsxs("form",{className:"server-form",name:"serverForm",onSubmit:d,children:[g.jsxs(gn,{className:"mb-3",title:r,children:[g.jsx(og,{value:i,onChange:o,children:"Name"}),g.jsx(og,{type:"url",value:a,onChange:s,children:"URL"}),g.jsx(og,{value:l,onChange:c,children:"API key"})]}),g.jsx("div",{className:"text-end",children:n})]})},$A=4e3,UA=({type:e})=>g.jsx("div",{className:"mt-3",children:g.jsxs(Yr,{type:e,children:[e==="success"&&"Servers properly imported. You can now select one from the list :)",e==="error"&&"The servers could not be imported. Make sure the format is correct."]})}),cxe=(e,t)=>({servers:n,createServers:r})=>{const i=Eo(),o=w$(),a=!!Object.keys(n).length,[s,l]=t(!1,$A),[c,d]=t(!1,$A),[f,p]=Tn(),[m,v]=$.useState(),y=$.useCallback(x=>{const _=b$();r([{...x,id:_}]),i(`/server/${_}`)},[r,i]);return $.useEffect(()=>{if(!m)return;Object.values(n).some(({url:_,apiKey:w})=>(m==null?void 0:m.url)===_&&(m==null?void 0:m.apiKey)===w)?p():y(m)},[y,m,n,p]),g.jsxs(qu,{children:[g.jsxs(S$,{title:g.jsx("h5",{className:"mb-0",children:"Add new server"}),onSubmit:v,children:[!a&&g.jsx(e,{tooltipPlacement:"top",onImport:l,onImportError:d}),a&&g.jsx(yt,{outline:!0,onClick:o,children:"Cancel"}),g.jsx(yt,{outline:!0,color:"primary",className:"ms-2",children:"Create server"})]}),s&&g.jsx(UA,{type:"success"}),c&&g.jsx(UA,{type:"error"}),g.jsx(x$,{isOpen:f,duplicatedServers:m?[m]:[],onDiscard:o,onSave:()=>m&&y(m)})]})},uxe=e=>({server:t,className:n,children:r,textClassName:i})=>{const[o,,a,s]=Tn();return g.jsxs(g.Fragment,{children:[g.jsxs("button",{type:"button",className:Ve(n,"p-0 bg-transparent border-0"),onClick:a,children:[!r&&g.jsx(Ae,{fixedWidth:!0,icon:WS}),g.jsx("span",{className:i,children:r??"Remove this server"})]}),g.jsx(e,{server:t,isOpen:o,toggle:s})]})},dxe=({server:e,toggle:t,isOpen:n,deleteServer:r,redirectHome:i=!0})=>{const o=Eo(),a=$.useRef(!1),s=()=>{a.current=!0,t()},l=()=>{a.current&&(r(e),i&&o("/"))};return g.jsxs(ua,{isOpen:n,toggle:t,centered:!0,onClosed:l,children:[g.jsx(da,{toggle:t,className:"text-danger",children:"Remove server"}),g.jsxs(To,{children:[g.jsxs("p",{children:["Are you sure you want to remove ",g.jsx("b",{children:e?e.name:""}),"?"]}),g.jsx("p",{children:g.jsx("i",{children:"No data will be deleted, only the access to this server will be removed from this device. You can create it again at any moment."})})]}),g.jsxs(Nl,{children:[g.jsx(yt,{color:"link",onClick:t,children:"Cancel"}),g.jsx(yt,{color:"danger",onClick:s,children:"Delete"})]})]})},fxe=e=>_$(({editServer:t,selectedServer:n,selectServer:r})=>{const i=w$(),{reconnect:o}=sxe();if(!nf(n))return null;const a=s=>{t(n.id,s),o==="true"&&r(n.id),i()};return g.jsx(qu,{children:g.jsxs(S$,{title:g.jsxs("h5",{className:"mb-0",children:['Edit "',n.name,'"']}),initialValues:n,onSubmit:a,children:[g.jsx(yt,{outline:!0,className:"me-2",onClick:i,children:"Cancel"}),g.jsx(yt,{outline:!0,color:"primary",children:"Save"})]})})},e),BA=e=>({url:t,apiKey:n})=>e.some(r=>r.url===t&&r.apiKey===n),hxe=e=>({createServers:t,servers:n,children:r,onImport:i=()=>{},onImportError:o=()=>{},tooltipPlacement:a="bottom",className:s=""})=>{const l=_s(),[c,d]=$.useState([]),[f,,p,m]=Tn(),v=$.useRef([]),y=$.useCallback(S=>{t(S),i()},[t,i]),x=$.useCallback(async({target:S})=>{var E;return e.importServersFromFile((E=S.files)==null?void 0:E[0]).then(C=>{v.current=C;const k=Object.values(n),j=C.filter(BA(k)),A=!!j.length;A?d(j):y(C),A&&p()}).then(()=>{S.value=null}).catch(o)},[y,o,n,p]),_=$.useCallback(()=>{y(v.current),m()},[y,m,v]),w=$.useCallback(()=>{y(v.current.filter(NH(BA(c)))),m()},[y,c,m]);return g.jsxs(g.Fragment,{children:[g.jsxs(yt,{outline:!0,id:"importBtn",className:s,onClick:()=>{var S;return(S=l.current)==null?void 0:S.click()},children:[g.jsx(Ae,{icon:HW,fixedWidth:!0})," ",r??"Import from file"]}),g.jsxs(Dr,{placement:a,target:"importBtn",children:["You can create servers by importing a CSV file with ",g.jsx("b",{children:"name"}),", ",g.jsx("b",{children:"apiKey"})," and ",g.jsx("b",{children:"url"})," columns."]}),g.jsx("input",{type:"file",accept:"text/csv",className:"d-none",ref:l,onChange:x}),g.jsx(x$,{isOpen:f,duplicatedServers:c,onDiscard:w,onSave:_})]})};const pxe=e=>({servers:t,selectedServer:n})=>g.jsx(qu,{children:g.jsxs("div",{className:"server-error__container flex-column",children:[g.jsxs(Wo,{className:"w-100 mb-3 mb-md-5",type:"error",fullWidth:!0,children:[!nf(n)&&"Could not find this Shlink server.",nf(n)&&g.jsxs(g.Fragment,{children:[g.jsx("p",{children:"Oops! Could not connect to this Shlink server."}),"Make sure you have internet connection, and the server is properly configured and on-line."]})]}),g.jsxs(h$,{servers:Object.values(t),children:["These are the Shlink servers currently configured. Choose one of them or ",g.jsx(Ft,{to:"/server/create",children:"add a new one"}),"."]}),nf(n)&&g.jsx("div",{className:"container mt-3 mt-md-5",children:g.jsxs("h5",{children:["Alternatively, if you think you may have miss-configured this server, you can ",g.jsx(e,{server:n,className:"server-error__delete-btn",children:"remove it"})," or ",g.jsx(Ft,{to:`/server/${n.id}/edit?reconnect=true`,children:"edit it"}),"."]})})]})}),mxe=4e3,gxe=(e,t,n,r)=>({servers:i})=>{const o=Object.values(i),[a,s]=$.useState(o),l=p=>s(o.filter(({name:m,url:v})=>`${m} ${v}`.toLowerCase().match(p.toLowerCase()))),c=a.some(({autoConnect:p})=>!!p),[d,f]=n(!1,mxe);return $.useEffect(()=>{s(Object.values(i))},[i]),g.jsxs(qu,{children:[g.jsx(Vh,{className:"mb-3",onChange:l}),g.jsxs(yr,{className:"mb-3",children:[g.jsxs("div",{className:"col-md-6 d-flex d-md-block mb-2 mb-md-0",children:[g.jsx(t,{className:"flex-fill",onImportError:f,children:"Import servers"}),o.length>0&&g.jsxs(yt,{outline:!0,className:"ms-2 flex-fill",onClick:async()=>e.exportServers(),children:[g.jsx(Ae,{icon:h4,fixedWidth:!0})," Export servers"]})]}),g.jsx("div",{className:"col-md-6 text-md-end d-flex d-md-block",children:g.jsxs(yt,{outline:!0,color:"primary",className:"flex-fill",tag:Ft,to:"/server/create",children:[g.jsx(Ae,{icon:KS,fixedWidth:!0})," Add a server"]})})]}),g.jsx(gn,{children:g.jsxs("table",{className:"table table-hover responsive-table mb-0",children:[g.jsx("thead",{className:"responsive-table__header",children:g.jsxs("tr",{children:[c&&g.jsx("th",{"aria-label":"Auto-connect",style:{width:"50px"}}),g.jsx("th",{children:"Name"}),g.jsx("th",{children:"Base URL"}),g.jsx("th",{"aria-label":"Options"})]})}),g.jsxs("tbody",{children:[!a.length&&g.jsx("tr",{className:"text-center",children:g.jsx("td",{colSpan:4,children:"No servers found."})}),a.map(p=>g.jsx(r,{server:p,hasAutoConnect:c},p.id))]})]})}),d&&g.jsx("div",{className:"mt-3",children:g.jsx(Yr,{type:"error",children:"The servers could not be imported. Make sure the format is correct."})})]})},vxe=e=>({server:t,hasAutoConnect:n})=>g.jsxs("tr",{className:"responsive-table__row",children:[n&&g.jsx("td",{className:"responsive-table__cell","data-th":"Auto-connect",children:t.autoConnect&&g.jsxs(g.Fragment,{children:[g.jsx(Ae,{icon:Yf,className:"text-primary",id:"autoConnectIcon"}),g.jsx(Dr,{target:"autoConnectIcon",placement:"right",children:"Auto-connect to this server"})]})}),g.jsx("th",{className:"responsive-table__cell","data-th":"Name",children:g.jsx(Ft,{to:`/server/${t.id}`,children:t.name})}),g.jsx("td",{className:"responsive-table__cell","data-th":"Base URL",children:t.url}),g.jsx("td",{className:"responsive-table__cell text-end",children:g.jsx(e,{server:t})})]}),yxe=e=>({server:t,setAutoConnect:n})=>{const[r,,i,o]=Tn(),a=`/server/${t.id}`,{autoConnect:s}=t,l=s?zW:mie;return g.jsxs(s0,{minWidth:170,children:[g.jsxs(Ue,{tag:Ft,to:a,children:[g.jsx(Ae,{icon:UW,fixedWidth:!0})," Connect"]}),g.jsxs(Ue,{tag:Ft,to:`${a}/edit`,children:[g.jsx(Ae,{icon:YS,fixedWidth:!0})," Edit server"]}),g.jsxs(Ue,{onClick:()=>n(t,!s),children:[g.jsx(Ae,{icon:l,fixedWidth:!0})," ",s?"Do not a":"A","uto-connect"]}),g.jsx(Ue,{divider:!0}),g.jsxs(Ue,{className:"dropdown-item--danger",onClick:i,children:[g.jsx(Ae,{icon:WS,fixedWidth:!0})," Remove server"]}),g.jsx(e,{redirectHome:!1,server:t,isOpen:r,toggle:o})]})},E$=(e,t)=>b6(e,t,{serializeError:n4}),_xe={},bxe=e=>e.id?e:ev("id",b$(),e),wxe=e4((e,t)=>ev(t.id,t,e),{}),{actions:xxe,reducer:Sxe}=ur({name:"shlink/servers",initialState:_xe,reducers:{editServer:{prepare:(e,t)=>({payload:{serverId:e,serverData:t}}),reducer:(e,{payload:t})=>{const{serverId:n,serverData:r}=t;return e[n]?ev(n,{...e[n],...r},e):e}},deleteServer:(e,{payload:t})=>qH(t.id,e),setAutoConnect:{prepare:({id:e},t)=>({payload:{serverId:e,autoConnect:t}}),reducer:(e,{payload:t})=>{const{serverId:n,autoConnect:r}=t;return e[n]?r?XH(fW(e).map(([i,o])=>[i,{...o,autoConnect:i===n}])):ev(n,{...e[n],autoConnect:r},e):e}},createServers:{prepare:Qy(zS(bxe),wxe,e=>({payload:e})),reducer:(e,{payload:t})=>({...e,...t})}}}),{editServer:Exe,deleteServer:Txe,setAutoConnect:Oxe,createServers:T$}=xxe,Cxe=Sxe,kxe=e=>Array.isArray(e)?e.filter(s4):[],Pxe=e=>E$("shlink/remoteServers/fetchServers",async(t,{dispatch:n})=>{const r=await e.jsonRequest(`${Qg.homepage}/servers.json`),i=kxe(r);n(T$(i))}),dO="shlink/selectedServer",Lxe="1.0.0",jxe="999.999.999",Mxe="latest",Axe=Qy(e=>e===Mxe?jxe:e,y$(Lxe)),Rxe=i4(e=>`${e.id}_${e.url}_${e.apiKey}`,async(e,t)=>t().then(({version:n})=>({version:Axe(n),printableVersion:v$(n)}))),zA=null,fO=Nn(`${dO}/resetSelectedServer`),Nxe=e=>E$(`${dO}/selectServer`,async(t,{dispatch:n,getState:r})=>{n(fO());const{servers:i}=r(),o=i[t];if(!o)return{serverNotFound:!0};try{const a=e(o),{version:s,printableVersion:l}=await Rxe(o,()=>a.health());return{...o,version:s,printableVersion:l}}catch{return{...o,serverNotReachable:!0}}}),Dxe=e=>ur({name:dO,initialState:zA,reducers:{},extraReducers:t=>{t.addCase(fO,()=>zA),t.addCase(e.fulfilled,(n,{payload:r})=>r)}}),Ixe=({servers:e,selectedServer:t})=>{const n=VS(e),r=()=>r4(n)?g.jsxs(Ue,{tag:Ft,to:"/server/create",children:[g.jsx(Ae,{icon:KS})," ",g.jsx("span",{className:"ms-1",children:"Add a server"})]}):g.jsxs(g.Fragment,{children:[n.map(({name:i,id:o})=>g.jsx(Ue,{tag:Ft,to:`/server/${o}`,active:EW(t)===o,children:i},o)),g.jsx(Ue,{divider:!0}),g.jsxs(Ue,{tag:Ft,to:"/manage-servers",children:[g.jsx(Ae,{icon:eP})," ",g.jsx("span",{className:"ms-1",children:"Manage servers"})]})]});return g.jsxs(zh,{nav:!0,inNavbar:!0,children:[g.jsxs(Uu,{nav:!0,caret:!0,children:[g.jsx(Ae,{icon:eP})," ",g.jsx("span",{className:"ms-1",children:"Servers"})]}),g.jsx($u,{end:!0,style:{right:0},children:r()})]})},Fxe=({document:e},t,n)=>{const r=e.createElement("a");r.setAttribute("href",t),r.setAttribute("download",n),r.style.visibility="hidden",e.body.appendChild(r),r.click(),e.body.removeChild(r)},$xe=(e,t,n)=>{const r=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(r);Fxe(e,i,n)},Uxe="shlink-servers.csv";class Bxe{constructor(t,n,r){Mp(this,"exportServers",async()=>{const t=VS(this.storage.get("servers")??{}).map(TW);try{const n=this.jsonToCsv(t);$xe(this.window,n,Uxe)}catch(n){console.error(n)}});this.storage=t,this.window=n,this.jsonToCsv=r}}const zxe=e=>typeof e.url=="string"&&typeof e.apiKey=="string"&&typeof e.name=="string",Vxe=e=>Array.isArray(e)&&e.every(zxe);class Hxe{constructor(t){this.csvToJson=t}async importServersFromFile(t){if(!t)throw new Error("No file provided");const n=await t.text(),r=await this.csvToJson(n);if(!Vxe(r))throw new Error("Provided file does not have the right format.");return r}}const Wxe=(e,t)=>{e.serviceFactory("ManageServers",gxe,"ServersExporter","ImportServersBtn","useTimeoutToggle","ManageServersRow"),e.decorator("ManageServers",ly),e.decorator("ManageServers",t(["selectedServer","servers"],["resetSelectedServer"])),e.serviceFactory("ManageServersRow",vxe,"ManageServersRowDropdown"),e.serviceFactory("ManageServersRowDropdown",yxe,"DeleteServerModal"),e.decorator("ManageServersRowDropdown",t(null,["setAutoConnect"])),e.serviceFactory("CreateServer",cxe,"ImportServersBtn","useTimeoutToggle"),e.decorator("CreateServer",ly),e.decorator("CreateServer",t(["selectedServer","servers"],["createServers","resetSelectedServer"])),e.serviceFactory("EditServer",fxe,"ServerError"),e.decorator("EditServer",t(["selectedServer"],["editServer","selectServer","resetSelectedServer"])),e.serviceFactory("ServersDropdown",()=>Ixe),e.decorator("ServersDropdown",t(["servers","selectedServer"])),e.serviceFactory("DeleteServerModal",()=>dxe),e.decorator("DeleteServerModal",t(null,["deleteServer"])),e.serviceFactory("DeleteServerButton",uxe,"DeleteServerModal"),e.serviceFactory("ImportServersBtn",hxe,"ServersImporter"),e.decorator("ImportServersBtn",t(["servers"],["createServers"])),e.serviceFactory("ServerError",pxe,"DeleteServerButton"),e.decorator("ServerError",t(["servers","selectedServer"])),e.service("ServersImporter",Hxe,"csvToJson"),e.service("ServersExporter",Bxe,"Storage","window","jsonToCsv"),e.serviceFactory("selectServer",Nxe,"buildShlinkApiClient","loadMercureInfo"),e.serviceFactory("createServers",()=>T$),e.serviceFactory("deleteServer",()=>Txe),e.serviceFactory("editServer",()=>Exe),e.serviceFactory("setAutoConnect",()=>Oxe),e.serviceFactory("fetchServers",Pxe,"HttpClient"),e.serviceFactory("resetSelectedServer",()=>fO),e.serviceFactory("selectedServerReducerCreator",Dxe,"selectServer"),e.serviceFactory("selectedServerReducer",wH("reducer"),"selectedServerReducerCreator")},Qc=({children:e})=>g.jsx("small",{className:"form-text text-muted d-block",children:e}),Yxe=e=>e?`${e}`:"",Gxe=({settings:e,toggleRealTimeUpdates:t,setRealTimeUpdatesInterval:n})=>{const{realTimeUpdates:r={enabled:!0}}=e,i=a0();return g.jsxs(gn,{title:"Real-time updates",className:"h-100",children:[g.jsx(zr,{children:g.jsxs(gu,{checked:r.enabled,onChange:t,children:["Enable or disable real-time updates.",g.jsxs(Qc,{children:["Real-time updates are currently being ",g.jsx("b",{children:r.enabled?"processed":"ignored"}),"."]})]})}),g.jsxs(zu,{noMargin:!0,label:"Real-time updates frequency (in minutes):",labelClassName:Ve("form-label",{"text-muted":!r.enabled}),id:i,children:[g.jsx(bl,{type:"number",min:0,placeholder:"Immediate",disabled:!r.enabled,value:Yxe(r.interval),id:i,onChange:({target:o})=>n(Number(o.value))}),r.enabled&&g.jsxs(Qc,{children:[r.interval!==void 0&&r.interval>0&&g.jsxs("span",{children:["Updates will be reflected in the UI every ",g.jsx("b",{children:r.interval})," minute",r.interval>1&&"s","."]}),!r.interval&&"Updates will be reflected in the UI as soon as they happen."]})]})]})},O$={field:"dateCreated",dir:"DESC"},qxe={realTimeUpdates:{enabled:!0},shortUrlCreation:{validateUrls:!1},ui:{theme:"light"},visits:{defaultInterval:"last30Days"},shortUrlsList:{defaultOrdering:O$}},Kxe=(e,{payload:t})=>aW(e,t),Ds=e=>({reducer:Kxe,prepare:e}),Is=e=>({payload:e}),{reducer:Zxe,actions:Qxe}=ur({name:"shlink/settings",initialState:qxe,reducers:{toggleRealTimeUpdates:Ds(e=>Is({realTimeUpdates:{enabled:e}})),setRealTimeUpdatesInterval:Ds(e=>Is({realTimeUpdates:{interval:e}})),setShortUrlCreationSettings:Ds(e=>Is({shortUrlCreation:e})),setShortUrlsListSettings:Ds(e=>Is({shortUrlsList:e})),setUiSettings:Ds(e=>Is({ui:e})),setVisitsSettings:Ds(e=>Is({visits:e})),setTagsSettings:Ds(e=>Is({tags:e}))}}),{toggleRealTimeUpdates:Xxe,setRealTimeUpdatesInterval:Jxe,setShortUrlCreationSettings:e2e,setShortUrlsListSettings:t2e,setUiSettings:n2e,setVisitsSettings:r2e,setTagsSettings:i2e}=Qxe,o2e=Zxe,W1=({items:e})=>g.jsx(g.Fragment,{children:e.map((t,n)=>g.jsx("div",{className:"mb-3",children:t},n))}),a2e=(e,t,n,r,i,o)=>()=>g.jsxs(qu,{children:[g.jsxs(VI,{className:"mb-3",children:[g.jsx(cf,{to:"general",children:"General"}),g.jsx(cf,{to:"short-urls",children:"Short URLs"}),g.jsx(cf,{to:"other-items",children:"Other items"})]}),g.jsxs(Gy,{children:[g.jsx(vt,{path:"general",element:g.jsx(W1,{items:[g.jsx(r,{}),g.jsx(e,{})]})}),g.jsx(vt,{path:"short-urls",element:g.jsx(W1,{items:[g.jsx(t,{}),g.jsx(n,{})]})}),g.jsx(vt,{path:"other-items",element:g.jsx(W1,{items:[g.jsx(o,{}),g.jsx(i,{})]})}),g.jsx(vt,{path:"*",element:g.jsx(DS,{replace:!0,to:"general"})})]})]}),Y1=e=>e==="includes"?"Suggest tags including input":"Suggest tags starting with input",s2e=e=>e==="includes"?g.jsxs(g.Fragment,{children:["The list of suggested tags will contain those ",g.jsx("b",{children:"including"})," provided input."]}):g.jsxs(g.Fragment,{children:["The list of suggested tags will contain those ",g.jsx("b",{children:"starting with"})," provided input."]}),l2e=({settings:e,setShortUrlCreationSettings:t})=>{const n=e.shortUrlCreation??{validateUrls:!1},r=i=>()=>t({...n??{validateUrls:!1},tagFilteringMode:i});return g.jsxs(gn,{title:"Short URLs form",className:"h-100",children:[g.jsx(zr,{children:g.jsxs(gu,{checked:n.validateUrls??!1,onChange:i=>t({...n,validateUrls:i}),children:["Request validation on long URLs when creating new short URLs.",g.jsxs(Qc,{children:["The initial state of the ",g.jsx("b",{children:"Validate URL"})," checkbox will be ",g.jsx("b",{children:n.validateUrls?"checked":"unchecked"}),"."]})]})}),g.jsx(zr,{children:g.jsxs(gu,{checked:n.forwardQuery??!0,onChange:i=>t({...n,forwardQuery:i}),children:["Make all new short URLs forward their query params to the long URL.",g.jsxs(Qc,{children:["The initial state of the ",g.jsx("b",{children:"Forward query params on redirect"})," checkbox will be ",g.jsx("b",{children:n.forwardQuery??!0?"checked":"unchecked"}),"."]})]})}),g.jsxs(zu,{noMargin:!0,label:"Tag suggestions search mode:",children:[g.jsxs(fa,{text:Y1(n.tagFilteringMode),children:[g.jsx(Ue,{active:!n.tagFilteringMode||n.tagFilteringMode==="startsWith",onClick:r("startsWith"),children:Y1("startsWith")}),g.jsx(Ue,{active:n.tagFilteringMode==="includes",onClick:r("includes"),children:Y1("includes")})]}),g.jsx(Qc,{children:s2e(n.tagFilteringMode)})]})]})},c2e={dateCreated:"Created at",shortCode:"Short URL",longUrl:"Long URL",title:"Title",visits:"Visits"},u2e=({settings:{shortUrlsList:e},setShortUrlsListSettings:t})=>g.jsx(gn,{title:"Short URLs list",className:"h-100",children:g.jsx(zu,{noMargin:!0,label:"Default ordering for short URLs list:",children:g.jsx(Hh,{items:c2e,order:(e==null?void 0:e.defaultOrdering)??O$,onChange:(n,r)=>t({defaultOrdering:{field:n,dir:r}})})})}),d2e={tag:"Tag",shortUrls:"Short URLs",visits:"Visits"},f2e=({settings:{tags:e},setTagsSettings:t})=>g.jsx(gn,{title:"Tags",className:"h-100",children:g.jsx(zu,{noMargin:!0,label:"Default ordering for tags list:",children:g.jsx(Hh,{items:d2e,order:(e==null?void 0:e.defaultOrdering)??{},onChange:(n,r)=>t({...e,defaultOrdering:{field:n,dir:r}})})})});const h2e=({settings:{ui:e},setUiSettings:t})=>g.jsxs(gn,{title:"User interface",className:"h-100",children:[g.jsx(Ae,{icon:(e==null?void 0:e.theme)==="dark"?SY:dY,className:"user-interface__theme-icon"}),g.jsx(gu,{checked:(e==null?void 0:e.theme)==="dark",onChange:n=>{t({...e,theme:n?"dark":"light"})},children:"Use dark theme."})]}),C$={today:"Today",yesterday:"Yesterday",last7Days:"Last 7 days",last30Days:"Last 30 days",last90Days:"Last 90 days",last180Days:"Last 180 days",last365Days:"Last 365 days"},p2e=(e,t)=>!e||e==="all"?t:C$[e],m2e=({onChange:e,active:t,allText:n})=>g.jsxs(fa,{text:p2e(t,n),children:[g.jsx(Ue,{active:t==="all",onClick:()=>e("all"),children:n}),g.jsx(Ue,{divider:!0}),Object.entries(C$).map(([r,i])=>g.jsx(Ue,{active:t===r,onClick:()=>e(r),children:i},r))]}),VA=e=>{var t;return((t=e.visits)==null?void 0:t.defaultInterval)??"last30Days"},g2e=({settings:e,setVisitsSettings:t})=>{var n,r;return g.jsxs(gn,{title:"Visits",className:"h-100",children:[g.jsx(zr,{children:g.jsxs(gu,{checked:!!((n=e.visits)!=null&&n.excludeBots),onChange:i=>t({defaultInterval:VA(e),excludeBots:i}),children:["Exclude bots wherever possible (this option‘s effect might depend on Shlink server‘s version).",g.jsxs(Qc,{children:["The visits coming from potential bots will be ",g.jsx("b",{children:(r=e.visits)!=null&&r.excludeBots?"excluded":"included"}),"."]})]})}),g.jsx(zu,{noMargin:!0,label:"Default interval to load on visits sections:",children:g.jsx(m2e,{allText:"All visits",active:VA(e),onChange:i=>t({defaultInterval:i})})})]})},v2e=(e,t)=>{e.serviceFactory("Settings",a2e,"RealTimeUpdatesSettings","ShortUrlCreationSettings","ShortUrlsListSettings","UserInterfaceSettings","VisitsSettings","TagsSettings"),e.decorator("Settings",ly),e.decorator("Settings",t(null,["resetSelectedServer"])),e.serviceFactory("RealTimeUpdatesSettings",()=>Gxe),e.decorator("RealTimeUpdatesSettings",t(["settings"],["toggleRealTimeUpdates","setRealTimeUpdatesInterval"])),e.serviceFactory("ShortUrlCreationSettings",()=>l2e),e.decorator("ShortUrlCreationSettings",t(["settings"],["setShortUrlCreationSettings"])),e.serviceFactory("UserInterfaceSettings",()=>h2e),e.decorator("UserInterfaceSettings",t(["settings"],["setUiSettings"])),e.serviceFactory("VisitsSettings",()=>g2e),e.decorator("VisitsSettings",t(["settings"],["setVisitsSettings"])),e.serviceFactory("TagsSettings",()=>f2e),e.decorator("TagsSettings",t(["settings"],["setTagsSettings"])),e.serviceFactory("ShortUrlsListSettings",()=>u2e),e.decorator("ShortUrlsListSettings",t(["settings"],["setShortUrlsListSettings"])),e.serviceFactory("toggleRealTimeUpdates",()=>Xxe),e.serviceFactory("setRealTimeUpdatesInterval",()=>Jxe),e.serviceFactory("setShortUrlCreationSettings",()=>e2e),e.serviceFactory("setShortUrlsListSettings",()=>t2e),e.serviceFactory("setUiSettings",()=>n2e),e.serviceFactory("setVisitsSettings",()=>r2e),e.serviceFactory("setTagsSettings",()=>i2e)};var y2e="Expected a function",k$="__lodash_hash_undefined__",P$=1/0,_2e="[object Function]",b2e="[object GeneratorFunction]",w2e="[object Symbol]",x2e=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,S2e=/^\w*$/,E2e=/^\./,T2e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O2e=/[\\^$.*+?()[\]{}|]/g,C2e=/\\(\\)?/g,k2e=/^\[object .+?Constructor\]$/,P2e=typeof Ap=="object"&&Ap&&Ap.Object===Object&&Ap,L2e=typeof self=="object"&&self&&self.Object===Object&&self,hO=P2e||L2e||Function("return this")();function j2e(e,t){return e==null?void 0:e[t]}function M2e(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}var A2e=Array.prototype,R2e=Function.prototype,L$=Object.prototype,G1=hO["__core-js_shared__"],HA=function(){var e=/[^.]+$/.exec(G1&&G1.keys&&G1.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),j$=R2e.toString,pO=L$.hasOwnProperty,M$=L$.toString,N2e=RegExp("^"+j$.call(pO).replace(O2e,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),WA=hO.Symbol,D2e=A2e.splice,I2e=A$(hO,"Map"),Oh=A$(Object,"create"),YA=WA?WA.prototype:void 0,GA=YA?YA.toString:void 0;function kl(e){var t=-1,n=e?e.length:0;for(this.clear();++t-1}function G2e(e,t){var n=this.__data__,r=j0(n,e);return r<0?n.push([e,t]):n[r][1]=t,this}Ku.prototype.clear=V2e;Ku.prototype.delete=H2e;Ku.prototype.get=W2e;Ku.prototype.has=Y2e;Ku.prototype.set=G2e;function Hl(e){var t=-1,n=e?e.length:0;for(this.clear();++tr.toFixed(n).replace(".",t):r=>`${r}`.replace(".",t):n?r=>r.toFixed(n):r=>`${r}`}function vO(e={}){const t=typeof e.quote=="string"?e.quote:'"',n=typeof e.escapedQuote=="string"?e.escapedQuote:`${t}${t}`;return!t||t===n?r=>r:r=>(r.includes(t)&&(r=r.replace(new RegExp(t,"g"),n)),`${t}${r}${t}`)}function gSe(e={stringFormatter:vO()}){return t=>e.stringFormatter(t.toString().slice(7,-1))}function vSe(e={stringFormatter:vO()}){return t=>{if(t===null)return"";let n=JSON.stringify(t);return n===void 0?"":(n[0]==='"'&&(n=n.replace(/^"(.+)"$/,"$1")),e.stringFormatter(n))}}function KA(e,t,n){const r=e[t];return r===void 0?n:r}function D$(e,t){try{return Array.isArray(t)?e.push(...t):e.push(t),e}catch{return e.concat(t)}}function T2(e,t){let n=!0;return e.reduce((r,i)=>(i==null&&(i=""),n?(n=!1,`${i}`):`${r}${t}${i}`),"")}var ZA;(function(e){e.header="header",e.undefined="undefined",e.boolean="boolean",e.number="number",e.bigint="bigint",e.string="string",e.symbol="symbol",e.function="function",e.object="object"})(ZA||(ZA={}));class ySe{constructor(t){this.opts=this.preprocessOpts(t)}preprocessOpts(t){const n=Object.assign({},t);n.fields&&(n.fields=this.preprocessFieldsInfo(n.fields,n.defaultValue)),n.transforms=n.transforms||[];const r=n.formatters&&n.formatters.string||vO(),i=vSe({stringFormatter:r}),o={header:r,undefined:q1,boolean:q1,number:mSe(),bigint:q1,string:r,symbol:gSe({stringFormatter:r}),function:i,object:i};return n.formatters=Object.assign(Object.assign({},o),n.formatters),n.delimiter=n.delimiter||",",n.eol=n.eol||` `,n.header=n.header!==!1,n.includeEmptyRows=n.includeEmptyRows||!1,n.withBOM=n.withBOM||!1,n}preprocessFieldsInfo(t,n){return t.map(r=>{if(typeof r=="string")return{label:r,value:r.includes(".")||r.includes("[")?i=>qA(i,r,n):i=>KA(i,r,n)};if(typeof r=="object"){const i="default"in r?r.default:n;if(typeof r.value=="string"){const o=r.value;return{label:r.label||r.value,value:r.value.includes(".")||r.value.includes("[")?a=>qA(a,o,i):a=>KA(a,o,i)}}if(typeof r.value=="function"){const o=r.label||r.value.name||"",a={label:o,default:i},s=r.value;return{label:o,value(l){const c=s(l,a);return c===void 0?i:c}}}}throw new Error("Invalid field info option. "+JSON.stringify(r))})}getHeader(){return T2(this.opts.fields.map(t=>this.opts.formatters.header(t.label)),this.opts.delimiter)}preprocessRow(t){return this.opts.transforms.reduce((n,r)=>n.map(i=>r(i)).reduce(D$,[]),[t])}processRow(t){if(!t)return;const n=this.opts.fields.map(r=>this.processCell(t,r));if(!(!this.opts.includeEmptyRows&&n.every(r=>r==="")))return T2(n,this.opts.delimiter)}processCell(t,n){return this.processValue(n.value(t))}processValue(t){const n=this.opts.formatters[typeof t];return n(t)}}class _Se extends ySe{constructor(t){super(t)}parse(t){const n=this.preprocessData(t);this.opts.fields=this.opts.fields||this.preprocessFieldsInfo(n.reduce((a,s)=>(Object.keys(s).forEach(l=>{a.includes(l)||a.push(l)}),a),[]),this.opts.defaultValue);const r=this.opts.header?this.getHeader():"",i=this.processData(n);return(this.opts.withBOM?"\uFEFF":"")+r+(r&&i?this.opts.eol:"")+i}preprocessData(t){const n=Array.isArray(t)?t:[t];if(!this.opts.fields){if(t==null||n.length===0)throw new Error('Data should not be empty or the "fields" option should be included');if(typeof n[0]!="object")throw new Error('Data items should be objects or the "fields" option should be included')}return this.opts.transforms.length===0?n:n.map(r=>this.preprocessRow(r)).reduce(D$,[])}processData(t){return T2(t.map(n=>this.processRow(n)).filter(n=>n),this.opts.eol)}}var Pn;(function(e){e[e.BACKSPACE=8]="BACKSPACE",e[e.FORM_FEED=12]="FORM_FEED",e[e.NEWLINE=10]="NEWLINE",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.TAB=9]="TAB",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.NUMBER_SIGN=35]="NUMBER_SIGN",e[e.DOLLAR_SIGN=36]="DOLLAR_SIGN",e[e.PERCENT_SIGN=37]="PERCENT_SIGN",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.LEFT_PARENTHESIS=40]="LEFT_PARENTHESIS",e[e.RIGHT_PARENTHESIS=41]="RIGHT_PARENTHESIS",e[e.ASTERISK=42]="ASTERISK",e[e.PLUS_SIGN=43]="PLUS_SIGN",e[e.COMMA=44]="COMMA",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.FULL_STOP=46]="FULL_STOP",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_ZERO=48]="DIGIT_ZERO",e[e.DIGIT_ONE=49]="DIGIT_ONE",e[e.DIGIT_TWO=50]="DIGIT_TWO",e[e.DIGIT_THREE=51]="DIGIT_THREE",e[e.DIGIT_FOUR=52]="DIGIT_FOUR",e[e.DIGIT_FIVE=53]="DIGIT_FIVE",e[e.DIGIT_SIX=54]="DIGIT_SIX",e[e.DIGIT_SEVEN=55]="DIGIT_SEVEN",e[e.DIGIT_EIGHT=56]="DIGIT_EIGHT",e[e.DIGIT_NINE=57]="DIGIT_NINE",e[e.COLON=58]="COLON",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.COMMERCIAL_AT=64]="COMMERCIAL_AT",e[e.LATIN_CAPITAL_LETTER_A=65]="LATIN_CAPITAL_LETTER_A",e[e.LATIN_CAPITAL_LETTER_B=66]="LATIN_CAPITAL_LETTER_B",e[e.LATIN_CAPITAL_LETTER_C=67]="LATIN_CAPITAL_LETTER_C",e[e.LATIN_CAPITAL_LETTER_D=68]="LATIN_CAPITAL_LETTER_D",e[e.LATIN_CAPITAL_LETTER_E=69]="LATIN_CAPITAL_LETTER_E",e[e.LATIN_CAPITAL_LETTER_F=70]="LATIN_CAPITAL_LETTER_F",e[e.LATIN_CAPITAL_LETTER_G=71]="LATIN_CAPITAL_LETTER_G",e[e.LATIN_CAPITAL_LETTER_H=72]="LATIN_CAPITAL_LETTER_H",e[e.LATIN_CAPITAL_LETTER_I=73]="LATIN_CAPITAL_LETTER_I",e[e.LATIN_CAPITAL_LETTER_J=74]="LATIN_CAPITAL_LETTER_J",e[e.LATIN_CAPITAL_LETTER_K=75]="LATIN_CAPITAL_LETTER_K",e[e.LATIN_CAPITAL_LETTER_L=76]="LATIN_CAPITAL_LETTER_L",e[e.LATIN_CAPITAL_LETTER_M=77]="LATIN_CAPITAL_LETTER_M",e[e.LATIN_CAPITAL_LETTER_N=78]="LATIN_CAPITAL_LETTER_N",e[e.LATIN_CAPITAL_LETTER_O=79]="LATIN_CAPITAL_LETTER_O",e[e.LATIN_CAPITAL_LETTER_P=80]="LATIN_CAPITAL_LETTER_P",e[e.LATIN_CAPITAL_LETTER_Q=81]="LATIN_CAPITAL_LETTER_Q",e[e.LATIN_CAPITAL_LETTER_R=82]="LATIN_CAPITAL_LETTER_R",e[e.LATIN_CAPITAL_LETTER_S=83]="LATIN_CAPITAL_LETTER_S",e[e.LATIN_CAPITAL_LETTER_T=84]="LATIN_CAPITAL_LETTER_T",e[e.LATIN_CAPITAL_LETTER_U=85]="LATIN_CAPITAL_LETTER_U",e[e.LATIN_CAPITAL_LETTER_V=86]="LATIN_CAPITAL_LETTER_V",e[e.LATIN_CAPITAL_LETTER_W=87]="LATIN_CAPITAL_LETTER_W",e[e.LATIN_CAPITAL_LETTER_X=88]="LATIN_CAPITAL_LETTER_X",e[e.LATIN_CAPITAL_LETTER_Y=89]="LATIN_CAPITAL_LETTER_Y",e[e.LATIN_CAPITAL_LETTER_Z=90]="LATIN_CAPITAL_LETTER_Z",e[e.LEFT_SQUARE_BRACKET=91]="LEFT_SQUARE_BRACKET",e[e.REVERSE_SOLIDUS=92]="REVERSE_SOLIDUS",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.CIRCUMFLEX_ACCENT=94]="CIRCUMFLEX_ACCENT",e[e.LOW_LINE=95]="LOW_LINE",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_LETTER_A=97]="LATIN_SMALL_LETTER_A",e[e.LATIN_SMALL_LETTER_B=98]="LATIN_SMALL_LETTER_B",e[e.LATIN_SMALL_LETTER_C=99]="LATIN_SMALL_LETTER_C",e[e.LATIN_SMALL_LETTER_D=100]="LATIN_SMALL_LETTER_D",e[e.LATIN_SMALL_LETTER_E=101]="LATIN_SMALL_LETTER_E",e[e.LATIN_SMALL_LETTER_F=102]="LATIN_SMALL_LETTER_F",e[e.LATIN_SMALL_LETTER_G=103]="LATIN_SMALL_LETTER_G",e[e.LATIN_SMALL_LETTER_H=104]="LATIN_SMALL_LETTER_H",e[e.LATIN_SMALL_LETTER_I=105]="LATIN_SMALL_LETTER_I",e[e.LATIN_SMALL_LETTER_J=106]="LATIN_SMALL_LETTER_J",e[e.LATIN_SMALL_LETTER_K=107]="LATIN_SMALL_LETTER_K",e[e.LATIN_SMALL_LETTER_L=108]="LATIN_SMALL_LETTER_L",e[e.LATIN_SMALL_LETTER_M=109]="LATIN_SMALL_LETTER_M",e[e.LATIN_SMALL_LETTER_N=110]="LATIN_SMALL_LETTER_N",e[e.LATIN_SMALL_LETTER_O=111]="LATIN_SMALL_LETTER_O",e[e.LATIN_SMALL_LETTER_P=112]="LATIN_SMALL_LETTER_P",e[e.LATIN_SMALL_LETTER_Q=113]="LATIN_SMALL_LETTER_Q",e[e.LATIN_SMALL_LETTER_R=114]="LATIN_SMALL_LETTER_R",e[e.LATIN_SMALL_LETTER_S=115]="LATIN_SMALL_LETTER_S",e[e.LATIN_SMALL_LETTER_T=116]="LATIN_SMALL_LETTER_T",e[e.LATIN_SMALL_LETTER_U=117]="LATIN_SMALL_LETTER_U",e[e.LATIN_SMALL_LETTER_V=118]="LATIN_SMALL_LETTER_V",e[e.LATIN_SMALL_LETTER_W=119]="LATIN_SMALL_LETTER_W",e[e.LATIN_SMALL_LETTER_X=120]="LATIN_SMALL_LETTER_X",e[e.LATIN_SMALL_LETTER_Y=121]="LATIN_SMALL_LETTER_Y",e[e.LATIN_SMALL_LETTER_Z=122]="LATIN_SMALL_LETTER_Z",e[e.LEFT_CURLY_BRACKET=123]="LEFT_CURLY_BRACKET",e[e.VERTICAL_LINE=124]="VERTICAL_LINE",e[e.RIGHT_CURLY_BRACKET=125]="RIGHT_CURLY_BRACKET",e[e.TILDE=126]="TILDE"})(Pn||(Pn={}));Pn.QUOTATION_MARK+"",Pn.QUOTATION_MARK,Pn.REVERSE_SOLIDUS+"",Pn.REVERSE_SOLIDUS,Pn.SOLIDUS+"",Pn.SOLIDUS,Pn.LATIN_SMALL_LETTER_B+"",Pn.BACKSPACE,Pn.LATIN_SMALL_LETTER_F+"",Pn.FORM_FEED,Pn.LATIN_SMALL_LETTER_N+"",Pn.NEWLINE,Pn.LATIN_SMALL_LETTER_R+"",Pn.CARRIAGE_RETURN,Pn.LATIN_SMALL_LETTER_T+"",Pn.TAB;var QA;(function(e){e[e.LEFT_BRACE=0]="LEFT_BRACE",e[e.RIGHT_BRACE=1]="RIGHT_BRACE",e[e.LEFT_BRACKET=2]="LEFT_BRACKET",e[e.RIGHT_BRACKET=3]="RIGHT_BRACKET",e[e.COLON=4]="COLON",e[e.COMMA=5]="COMMA",e[e.TRUE=6]="TRUE",e[e.FALSE=7]="FALSE",e[e.NULL=8]="NULL",e[e.STRING=9]="STRING",e[e.NUMBER=10]="NUMBER",e[e.SEPARATOR=11]="SEPARATOR"})(QA||(QA={}));var XA;(function(e){e[e.START=0]="START",e[e.ENDED=1]="ENDED",e[e.ERROR=2]="ERROR",e[e.TRUE1=3]="TRUE1",e[e.TRUE2=4]="TRUE2",e[e.TRUE3=5]="TRUE3",e[e.FALSE1=6]="FALSE1",e[e.FALSE2=7]="FALSE2",e[e.FALSE3=8]="FALSE3",e[e.FALSE4=9]="FALSE4",e[e.NULL1=10]="NULL1",e[e.NULL2=11]="NULL2",e[e.NULL3=12]="NULL3",e[e.STRING_DEFAULT=13]="STRING_DEFAULT",e[e.STRING_AFTER_BACKSLASH=14]="STRING_AFTER_BACKSLASH",e[e.STRING_UNICODE_DIGIT_1=15]="STRING_UNICODE_DIGIT_1",e[e.STRING_UNICODE_DIGIT_2=16]="STRING_UNICODE_DIGIT_2",e[e.STRING_UNICODE_DIGIT_3=17]="STRING_UNICODE_DIGIT_3",e[e.STRING_UNICODE_DIGIT_4=18]="STRING_UNICODE_DIGIT_4",e[e.STRING_INCOMPLETE_CHAR=19]="STRING_INCOMPLETE_CHAR",e[e.NUMBER_AFTER_INITIAL_MINUS=20]="NUMBER_AFTER_INITIAL_MINUS",e[e.NUMBER_AFTER_INITIAL_ZERO=21]="NUMBER_AFTER_INITIAL_ZERO",e[e.NUMBER_AFTER_INITIAL_NON_ZERO=22]="NUMBER_AFTER_INITIAL_NON_ZERO",e[e.NUMBER_AFTER_FULL_STOP=23]="NUMBER_AFTER_FULL_STOP",e[e.NUMBER_AFTER_DECIMAL=24]="NUMBER_AFTER_DECIMAL",e[e.NUMBER_AFTER_E=25]="NUMBER_AFTER_E",e[e.NUMBER_AFTER_E_AND_SIGN=26]="NUMBER_AFTER_E_AND_SIGN",e[e.NUMBER_AFTER_E_AND_DIGIT=27]="NUMBER_AFTER_E_AND_DIGIT",e[e.SEPARATOR=28]="SEPARATOR"})(XA||(XA={}));var JA;(function(e){e[e.OBJECT=0]="OBJECT",e[e.ARRAY=1]="ARRAY"})(JA||(JA={}));var eR;(function(e){e[e.VALUE=0]="VALUE",e[e.KEY=1]="KEY",e[e.COLON=2]="COLON",e[e.COMMA=3]="COMMA",e[e.ENDED=4]="ENDED",e[e.ERROR=5]="ERROR",e[e.SEPARATOR=6]="SEPARATOR"})(eR||(eR={}));var bSe=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(r,i,o){n.o(r,i)||Object.defineProperty(r,i,{enumerable:!0,get:o})},n.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},n.t=function(r,i){if(1&i&&(r=n(r)),8&i||4&i&&typeof r=="object"&&r&&r.__esModule)return r;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:r}),2&i&&typeof r!="string")for(var a in r)n.d(o,a,(function(s){return r[s]}).bind(null,a));return o},n.n=function(r){var i=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(i,"a",i),i},n.o=function(r,i){return Object.prototype.hasOwnProperty.call(r,i)},n.p="",n(n.s=32)}([function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch{typeof window=="object"&&(n=window)}e.exports=n},function(e,t,n){var r=n(6),i=Object.keys||function(v){var y=[];for(var x in v)y.push(x);return y};e.exports=f;var o=n(5);o.inherits=n(2);var a=n(23),s=n(14);o.inherits(f,a);for(var l=i(s.prototype),c=0;c Shlink — The URL shortener - + diff --git a/feature/improve-hooks/service-worker.js b/feature/improve-hooks/service-worker.js index 5f8ac5ce..65b6f67e 100644 --- a/feature/improve-hooks/service-worker.js +++ b/feature/improve-hooks/service-worker.js @@ -1796,7 +1796,7 @@ const Se = "shlink-web-client", We = "A React-based progressive web application browserslist: Ge }; re(); -Ae([{"revision":null,"url":"assets/index-023f3028.css"},{"revision":null,"url":"assets/index-cd14f0bc.js"},{"revision":"a3e7693e243b4fc838012666ee5ac23d","url":"index.html"},{"revision":"3e8169a112865ef0d76bba4e2dfd3a89","url":"./icons/icon-16x16.png"},{"revision":"20f0b51945ae3c973420e31d6b4d43c1","url":"./icons/icon-24x24.png"},{"revision":"4c9695cfb4cea403c1b66bbb7b4f7420","url":"./icons/icon-32x32.png"},{"revision":"f74edb9cc54ac938c1589876f8da9f21","url":"./icons/icon-40x40.png"},{"revision":"52933970fac8498311687de13549b014","url":"./icons/icon-48x48.png"},{"revision":"40209a194f29b21882571c77bd2bd906","url":"./icons/icon-60x60.png"},{"revision":"c8ba5a8c1da76d74c7bb21827fcf975c","url":"./icons/icon-64x64.png"},{"revision":"ae3435baceb494f9c966e2c2c736ea35","url":"./icons/icon-72x72.png"},{"revision":"850aa5b026fd1452af6c1ddd9d71850f","url":"./icons/icon-76x76.png"},{"revision":"8c62535e6b7a498ece1f6c6ae62ede59","url":"./icons/icon-96x96.png"},{"revision":"2dff586aaefa4c8d17f4c0bcbdef8b53","url":"./icons/icon-114x114.png"},{"revision":"8e28257a68ef1c55bc68bfff80e1a310","url":"./icons/icon-120x120.png"},{"revision":"0059b6f0c97fa871a5c29643b2857585","url":"./icons/icon-128x128.png"},{"revision":"41478c2456281f61e54d714718743ecc","url":"./icons/icon-144x144.png"},{"revision":"625251910295f33a578ae6d8117711c9","url":"./icons/icon-150x150.png"},{"revision":"19b71508b1d05defe32cf16a7d453001","url":"./icons/icon-152x152.png"},{"revision":"9d029a32a54ba3084c67acd5d74f8ac4","url":"./icons/icon-160x160.png"},{"revision":"6ec104aeaf745f003ecdaef2edddce97","url":"./icons/icon-167x167.png"},{"revision":"871d67907434ed0ddf5d2a6c220e09af","url":"./icons/icon-180x180.png"},{"revision":"cee2529402074d73b2135e2ddee25f6b","url":"./icons/icon-192x192.png"},{"revision":"85055b452284c0193142936dee7d2cd1","url":"./icons/icon-196x196.png"},{"revision":"f471155dd70b99924422dd9dd87ea94d","url":"./icons/icon-228x228.png"},{"revision":"4d896c5c7025582605de31fb74f0316b","url":"./icons/icon-256x256.png"},{"revision":"d99b49e5bcad41968313c3e132e7c661","url":"./icons/icon-310x310.png"},{"revision":"f9597636bef677327c3abc0fd1a743c4","url":"./icons/icon-384x384.png"},{"revision":"de22c0eb9e08d3576df5cedb568ca56b","url":"./icons/icon-512x512.png"},{"revision":"583b223ad8e20f05aaa64923d7db2e46","url":"./icons/icon-1024x1024.png"},{"revision":"0fd2baea353e71dc0d6af1c8a1bc6fd1","url":"manifest.json"}]); +Ae([{"revision":null,"url":"assets/index-023f3028.css"},{"revision":null,"url":"assets/index-59c5da4b.js"},{"revision":"de41cc971f08b4daeae5d35615f20c2f","url":"index.html"},{"revision":"3e8169a112865ef0d76bba4e2dfd3a89","url":"./icons/icon-16x16.png"},{"revision":"20f0b51945ae3c973420e31d6b4d43c1","url":"./icons/icon-24x24.png"},{"revision":"4c9695cfb4cea403c1b66bbb7b4f7420","url":"./icons/icon-32x32.png"},{"revision":"f74edb9cc54ac938c1589876f8da9f21","url":"./icons/icon-40x40.png"},{"revision":"52933970fac8498311687de13549b014","url":"./icons/icon-48x48.png"},{"revision":"40209a194f29b21882571c77bd2bd906","url":"./icons/icon-60x60.png"},{"revision":"c8ba5a8c1da76d74c7bb21827fcf975c","url":"./icons/icon-64x64.png"},{"revision":"ae3435baceb494f9c966e2c2c736ea35","url":"./icons/icon-72x72.png"},{"revision":"850aa5b026fd1452af6c1ddd9d71850f","url":"./icons/icon-76x76.png"},{"revision":"8c62535e6b7a498ece1f6c6ae62ede59","url":"./icons/icon-96x96.png"},{"revision":"2dff586aaefa4c8d17f4c0bcbdef8b53","url":"./icons/icon-114x114.png"},{"revision":"8e28257a68ef1c55bc68bfff80e1a310","url":"./icons/icon-120x120.png"},{"revision":"0059b6f0c97fa871a5c29643b2857585","url":"./icons/icon-128x128.png"},{"revision":"41478c2456281f61e54d714718743ecc","url":"./icons/icon-144x144.png"},{"revision":"625251910295f33a578ae6d8117711c9","url":"./icons/icon-150x150.png"},{"revision":"19b71508b1d05defe32cf16a7d453001","url":"./icons/icon-152x152.png"},{"revision":"9d029a32a54ba3084c67acd5d74f8ac4","url":"./icons/icon-160x160.png"},{"revision":"6ec104aeaf745f003ecdaef2edddce97","url":"./icons/icon-167x167.png"},{"revision":"871d67907434ed0ddf5d2a6c220e09af","url":"./icons/icon-180x180.png"},{"revision":"cee2529402074d73b2135e2ddee25f6b","url":"./icons/icon-192x192.png"},{"revision":"85055b452284c0193142936dee7d2cd1","url":"./icons/icon-196x196.png"},{"revision":"f471155dd70b99924422dd9dd87ea94d","url":"./icons/icon-228x228.png"},{"revision":"4d896c5c7025582605de31fb74f0316b","url":"./icons/icon-256x256.png"},{"revision":"d99b49e5bcad41968313c3e132e7c661","url":"./icons/icon-310x310.png"},{"revision":"f9597636bef677327c3abc0fd1a743c4","url":"./icons/icon-384x384.png"},{"revision":"de22c0eb9e08d3576df5cedb568ca56b","url":"./icons/icon-512x512.png"},{"revision":"583b223ad8e20f05aaa64923d7db2e46","url":"./icons/icon-1024x1024.png"},{"revision":"0fd2baea353e71dc0d6af1c8a1bc6fd1","url":"manifest.json"}]); const ze = new RegExp("/[^/?]+\\.[^/]+$"); M( // Return false to exempt requests from being fulfilled by index.html.