var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var ee=Array.isArray;function S(){}var C={H:null,A:null,T:null,S:null},w=Object.prototype.hasOwnProperty;function te(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ne(e,t){return te(e.type,t,e.props)}function T(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function re(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ie=/\/+/g;function ae(e,t){return typeof e==`object`&&e&&e.key!=null?re(``+e.key):t.toString(36)}function E(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(S,S):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function oe(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,oe(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ae(e,0):a,ee(o)?(i=``,c!=null&&(i=c.replace(ie,`$&/`)+`/`),oe(o,r,i,``,function(e){return e})):o!=null&&(T(o)&&(o=ne(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ie,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(ee(e))for(var u=0;u{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,ee||(ee=!0,T());else{var t=n(l);t!==null&&ae(x,t.startTime-e)}}var ee=!1,S=-1,C=5,w=-1;function te(){return g?!0:!(e.unstable_now()-wt&&te());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ae(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?T():ee=!1}}}var T;if(typeof y==`function`)T=function(){y(ne)};else if(typeof MessageChannel<`u`){var re=new MessageChannel,ie=re.port2;re.port1.onmessage=ne,T=function(){ie.postMessage(null)}}else T=function(){_(ne,0)};function ae(t,n){S=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(S),S=-1):h=!0,ae(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,ee||(ee=!0,T()))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1N||(e.current=M[N],M[N]=null,N--)}function P(e,t){N++,M[N]=e.current,e.current=t}var le=se(null),ue=se(null),de=se(null),fe=se(null);function pe(e,t){switch(P(de,t),P(ue,e),P(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hd(t),e=Ud(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ce(le),P(le,e)}function me(){ce(le),ce(ue),ce(de)}function he(e){e.memoizedState!==null&&P(fe,e);var t=le.current,n=Ud(t,e.type);t!==n&&(P(ue,e),P(le,n))}function F(e){ue.current===e&&(ce(le),ce(ue)),fe.current===e&&(ce(fe),$f._currentValue=j)}var ge,_e;function ve(e){if(ge===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ge=t&&t[1]||``,_e=-1)`:-1i||c[r]!==l[i]){var u=` `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ye=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?ve(n):``}function xe(e,t){switch(e.tag){case 26:case 27:case 5:return ve(e.type);case 16:return ve(`Lazy`);case 13:return e.child!==t&&t!==null?ve(`Suspense Fallback`):ve(`Suspense`);case 19:return ve(`SuspenseList`);case 0:case 15:return be(e.type,!1);case 11:return be(e.type.render,!1);case 1:return be(e.type,!0);case 31:return ve(`Activity`);default:return``}}function Se(e){try{var t=``,n=null;do t+=xe(e,n),n=e,e=e.return;while(e);return t}catch(e){return` Error generating stack: `+e.message+` `+e.stack}}var Ce=Object.prototype.hasOwnProperty,we=t.unstable_scheduleCallback,Te=t.unstable_cancelCallback,Ee=t.unstable_shouldYield,De=t.unstable_requestPaint,I=t.unstable_now,Oe=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,Pe=t.log,Fe=t.unstable_setDisableYieldValue,Ie=null,Le=null;function Re(e){if(typeof Pe==`function`&&Fe(e),Le&&typeof Le.setStrictMode==`function`)try{Le.setStrictMode(Ie,e)}catch{}}var ze=Math.clz32?Math.clz32:He,Be=Math.log,Ve=Math.LN2;function He(e){return e>>>=0,e===0?32:31-(Be(e)/Ve|0)|0}var Ue=256,We=262144,Ge=4194304;function Ke(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ke(n))):i=Ke(o):i=Ke(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ke(n))):i=Ke(o)):i=Ke(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ye(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xe(){var e=Ge;return Ge<<=1,!(Ge&62914560)&&(Ge=4194304),e}function Ze(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function R(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Qe(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),an=!1;if(rn)try{var on={};Object.defineProperty(on,`passive`,{get:function(){an=!0}}),window.addEventListener(`test`,on,on),window.removeEventListener(`test`,on,on)}catch{an=!1}var sn=null,cn=null,ln=null;function un(){if(ln)return ln;var e,t=cn,n=t.length,r,i=`value`in sn?sn.value:sn.textContent,a=i.length;for(e=0;e=Vn),Wn=` `,Gn=!1;function Kn(e,t){switch(e){case`keyup`:return zn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Jn=!1;function Yn(e,t){switch(e){case`compositionend`:return qn(t);case`keypress`:return t.which===32?(Gn=!0,Wn):null;case`textInput`:return e=t.data,e===Wn&&Gn?null:e;default:return null}}function Xn(e,t){if(Jn)return e===`compositionend`||!Bn&&Kn(e,t)?(e=un(),ln=cn=sn=null,Jn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=vr(n)}}function br(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?br(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function xr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Nt(e.document)}return t}function Sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Cr=rn&&`documentMode`in document&&11>=document.documentMode,wr=null,Tr=null,Er=null,Dr=!1;function Or(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Dr||wr==null||wr!==Nt(r)||(r=wr,`selectionStart`in r&&Sr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Er&&_r(Er,r)||(Er=r,r=Ed(Tr,`onSelect`),0>=o,i-=o,bi=1<<32-ze(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),K&&Si(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),K&&Si(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return K&&Si(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),K&&Si(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&Sa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ka(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=si(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=oi(o.type,o.key,o.props,null,e.mode,c),ka(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=ui(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=Sa(o),b(e,r,o,c)}if(O(o))return h(e,r,o,c);if(E(o)){if(l=E(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Oa(o),c);if(o.$$typeof===S)return b(e,r,Xi(e,o),c);Aa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=ci(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Da=0;var i=b(e,t,n,r);return Ea=null,i}catch(t){if(t===ga||t===va)throw t;var a=ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ma=ja(!0),Na=ja(!1),Pa=!1;function Fa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ia(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function La(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ra(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,J&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=$r(e),Qr(e,null,n),t}return Yr(e,r,t,n),$r(e)}function za(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}function Ba(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Va=!1;function Ha(){if(Va){var e=sa;if(e!==null)throw e}}function Ua(e,t,n,r){Va=!1;var i=e.updateQueue;Pa=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(X&f)===f:(r&f)===f){f!==0&&f===oa&&(Va=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Pa=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Gl|=o,e.lanes=o,e.memoizedState=d}}function Wa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ga(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=k.T,s={};k.T=s,js(e,!1,t,n);try{var c=i(),l=k.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?As(e,t,ua(c,r),pu(e)):As(e,t,r,pu(e))}catch(n){As(e,t,{then:function(){},status:`rejected`,reason:n},pu())}finally{A.p=a,o!==null&&s.types!==null&&(o.types=s.types),k.T=o}}function bs(){}function xs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ss(e).queue;ys(e,a,t,j,n===null?bs:function(){return Cs(e),n(r)})}function Ss(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:j,baseState:j,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:j},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Cs(e){var t=Ss(e);t.next===null&&(t=e.alternate.memoizedState),As(e,t.next.queue,{},pu())}function ws(){return Yi($f)}function Ts(){return Do().memoizedState}function Es(){return Do().memoizedState}function Ds(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=pu();e=La(n);var r=Ra(t,e,n);r!==null&&(hu(r,t,n),za(r,t,n)),t={cache:na()},e.payload=t;return}t=t.return}}function Os(e,t,n){var r=pu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ms(e)?Ns(t,n):(n=Xr(e,t,n,r),n!==null&&(hu(n,e,r),Ps(n,t,r)))}function ks(e,t,n){As(e,t,n,pu())}function As(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ms(e))Ns(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,gr(s,o))return Yr(e,t,i,0),Rl===null&&Jr(),!1}catch{}if(n=Xr(e,t,i,r),n!==null)return hu(n,e,r),Ps(n,t,r),!0}return!1}function js(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ms(e)){if(t)throw Error(i(479))}else t=Xr(e,n,r,2),t!==null&&hu(t,e,2)}function Ms(e){var t=e.alternate;return e===q||t!==null&&t===q}function Ns(e,t){uo=lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ps(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,et(e,n)}}var Fs={readContext:Yi,use:Ao,useCallback:_o,useContext:_o,useEffect:_o,useImperativeHandle:_o,useLayoutEffect:_o,useInsertionEffect:_o,useMemo:_o,useReducer:_o,useRef:_o,useState:_o,useDebugValue:_o,useDeferredValue:_o,useTransition:_o,useSyncExternalStore:_o,useId:_o,useHostTransitionStatus:_o,useFormState:_o,useActionState:_o,useOptimistic:_o,useMemoCache:_o,useCacheRefresh:_o};Fs.useEffectEvent=_o;var Is={readContext:Yi,use:Ao,useCallback:function(e,t){return Eo().memoizedState=[e,t===void 0?null:t],e},useContext:Yi,useEffect:os,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),is(4194308,4,fs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return is(4194308,4,e,t)},useInsertionEffect:function(e,t){is(4,2,e,t)},useMemo:function(e,t){var n=Eo();t=t===void 0?null:t;var r=e();if(fo){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Eo();if(n!==void 0){var i=n(t);if(fo){Re(!0);try{n(t)}finally{Re(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Os.bind(null,q,e),[r.memoizedState,e]},useRef:function(e){var t=Eo();return e={current:e},t.memoizedState=e},useState:function(e){e=Ho(e);var t=e.queue,n=ks.bind(null,q,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ms,useDeferredValue:function(e,t){return _s(Eo(),e,t)},useTransition:function(){var e=Ho(!1);return e=ys.bind(null,q,e.queue,!0,!1),Eo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=q,a=Eo();if(K){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Rl===null)throw Error(i(349));X&127||Lo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,os(zo.bind(null,r,o,e),[e]),r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,o,n,t),null),n},useId:function(){var e=Eo(),t=Rl.identifierPrefix;if(K){var n=xi,r=bi;n=(r&~(1<<32-ze(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=po++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[st]=t,o[ct]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Fd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Ac(t)}}return Fc(t),jc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=de.current,Fi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Di,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[st]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Mi(t,!0)}else e=Vd(e).createTextNode(r),e[st]=t,t.stateNode=e}return Fc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Fi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[st]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),e=!1}else n=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ro(t),t):(ro(t),null);if(t.flags&128)throw Error(i(558))}return Fc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Fi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[st]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),a=!1}else a=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ro(t),t):(ro(t),null)}return ro(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Nc(t,t.updateQueue),Fc(t),null);case 4:return me(),e===null&&Sd(t.stateNode.containerInfo),Fc(t),null;case 10:return Ui(t.type),Fc(t),null;case 19:if(ce(io),r=t.memoizedState,r===null)return Fc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Pc(r,!1);else{if(Wl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ao(e),o!==null){for(t.flags|=128,Pc(r,!1),e=o.updateQueue,t.updateQueue=e,Nc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ai(n,e),n=n.sibling;return P(io,io.current&1|2),K&&Si(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&I()>tu&&(t.flags|=128,a=!0,Pc(r,!1),t.lanes=4194304)}else{if(!a)if(e=ao(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Nc(t,e),Pc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!K)return Fc(t),null}else 2*I()-r.renderingStartTime>tu&&n!==536870912&&(t.flags|=128,a=!0,Pc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Fc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=I(),e.sibling=null,n=io.current,P(io,a?n&1|2:n&1),K&&Si(t,r.treeForkCount),e);case 22:case 23:return ro(t),Xa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Fc(t),t.subtreeFlags&6&&(t.flags|=8192)):Fc(t),n=t.updateQueue,n!==null&&Nc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ce(fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ui(ta),Fc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Lc(e,t){switch(Ti(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ui(ta),me(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return F(t),null;case 31:if(t.memoizedState!==null){if(ro(t),t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ce(io),null;case 4:return me(),null;case 10:return Ui(t.type),null;case 22:case 23:return ro(t),Xa(),e!==null&&ce(fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ui(ta),null;case 25:return null;default:return null}}function Rc(e,t){switch(Ti(t),t.tag){case 3:Ui(ta),me();break;case 26:case 27:case 5:F(t);break;case 4:me();break;case 31:t.memoizedState!==null&&ro(t);break;case 13:ro(t);break;case 19:ce(io);break;case 10:Ui(t.type);break;case 22:case 23:ro(t),Xa(),e!==null&&ce(fa);break;case 24:Ui(ta)}}function zc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Q(t,t.return,e)}}function Bc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Q(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Q(t,t.return,e)}}function Vc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ga(t,n)}catch(t){Q(e,e.return,t)}}}function Hc(e,t,n){n.props=Us(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Q(e,t,n)}}function Uc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Q(e,t,n)}}function Wc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Q(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Q(e,t,n)}else n.current=null}function Gc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Q(e,e.return,t)}}function Kc(e,t,n){try{var r=e.stateNode;Id(r,e.type,n,t),r[ct]=t}catch(t){Q(e,e.return,t)}}function qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qd(e.type)||e.tag===4}function Jc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||qc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Qd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=W));else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Fd(t,r,n),t[st]=e,t[ct]=n}catch(t){Q(e,e.return,t)}}var Qc=!1,$c=!1,el=!1,tl=typeof WeakSet==`function`?WeakSet:Set,nl=null;function rl(e,t){if(e=e.containerInfo,zd=cp,e=xr(e),Sr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Bd={focusedElem:e,selectionRange:n},cp=!1,nl=t;nl!==null;)if(t=nl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,nl=e;else for(;nl!==null;){switch(t=nl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Fd(o,r,n),o[st]=e,bt(o),r=o;break a;case`link`:var s=Hf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=yr(s,h),v=yr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,k.T=null,n=lu,lu=null;var o=au,s=su;if(iu=0,ou=au=null,su=0,J&6)throw Error(i(331));var c=J;if(J|=4,Nl(o.current),Tl(o,o.current,s,n),J=c,id(0,!1),Le&&typeof Le.onPostCommitFiberRoot==`function`)try{Le.onPostCommitFiberRoot(Ie,o)}catch{}return!0}finally{A.p=a,k.T=r,Vu(e,t)}}function Wu(e,t,n){t=fi(n,t),t=Ys(e.stateNode,t,2),e=Ra(e,t,2),e!==null&&(R(e,2),rd(e))}function Q(e,t,n){if(e.tag===3)Wu(e,e,n);else for(;t!==null;){if(t.tag===3){Wu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ru===null||!ru.has(r))){e=fi(n,e),n=Xs(2),r=Ra(t,n,2),r!==null&&(Zs(n,r,t,e),R(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ll;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Hl=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Rl===e&&(X&n)===n&&(Wl===4||Wl===3&&(X&62914560)===X&&300>I()-$l?!(J&2)&&Su(e,0):ql|=n,Yl===X&&(Yl=0)),rd(e)}function qu(e,t){t===0&&(t=Xe()),e=Zr(e,t),e!==null&&(R(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return we(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-ze(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=X,a=qe(r,r===Rl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Je(r,a)||(n=!0,ld(r,a));r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Kd()&&(e=nd);for(var t=I(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}iu!==0&&iu!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Ld(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function Sf(e,t,n){var r=xf;if(r&&typeof t==`string`&&t){var i=Ft(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),gf.has(i)||(gf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Fd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function Cf(e){vf.D(e),Sf(`dns-prefetch`,e,null)}function wf(e,t){vf.C(e,t),Sf(`preconnect`,e,t)}function Tf(e,t,n){vf.L(e,t,n);var r=xf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ft(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ft(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ft(n.imageSizes)+`"]`)):i+=`[href="`+Ft(e)+`"]`;var a=i;switch(t){case`style`:a=jf(e);break;case`script`:a=Ff(e)}hf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),hf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Mf(a))||t===`script`&&r.querySelector(If(a))||(t=r.createElement(`link`),Fd(t,`link`,e),bt(t),r.head.appendChild(t)))}}function Ef(e,t){vf.m(e,t);var n=xf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ft(r)+`"][href="`+Ft(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Ff(e)}if(!hf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),hf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(If(a)))return}r=n.createElement(`link`),Fd(r,`link`,e),bt(r),n.head.appendChild(r)}}}function Df(e,t,n){vf.S(e,t,n);var r=xf;if(r&&e){var i=yt(r).hoistableStyles,a=jf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Mf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=hf.get(a))&&zf(e,n);var c=o=r.createElement(`link`);bt(c),Fd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Rf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Of(e,t){vf.X(e,t);var n=xf;if(n&&e){var r=yt(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=h({src:e,async:!0},t),(t=hf.get(i))&&Bf(e,t),a=n.createElement(`script`),bt(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t){vf.M(e,t);var n=xf;if(n&&e){var r=yt(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=hf.get(i))&&Bf(e,t),a=n.createElement(`script`),bt(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t,n,r){var a=(a=de.current)?_f(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=jf(n.href),n=yt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=jf(n.href);var o=yt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Mf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),hf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},hf.set(e,n),o||Pf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Ff(n),n=yt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function jf(e){return`href="`+Ft(e)+`"`}function Mf(e){return`link[rel="stylesheet"][`+e+`]`}function Nf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Pf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Fd(t,`link`,n),bt(t),e.head.appendChild(t))}function Ff(e){return`[src="`+Ft(e)+`"]`}function If(e){return`script[async]`+e}function Lf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ft(n.href)+`"]`);if(r)return t.instance=r,bt(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),bt(r),Fd(r,`style`,a),Rf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=jf(n.href);var o=e.querySelector(Mf(a));if(o)return t.state.loading|=4,t.instance=o,bt(o),o;r=Nf(n),(a=hf.get(a))&&zf(r,a),o=(e.ownerDocument||e).createElement(`link`),bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Fd(o,`link`,r),t.state.loading|=4,Rf(o,n.precedence,e),t.instance=o;case`script`:return o=Ff(n.src),(a=e.querySelector(If(o)))?(t.instance=a,bt(a),a):(r=n,(a=hf.get(o))&&(r=h({},n),Bf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),bt(a),Fd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Rf(r,n.precedence,e));return t.instance}function Rf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Wf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Gf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Kf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=jf(r.href),a=t.querySelector(Mf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Yf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,bt(a);return}a=t.ownerDocument||t,r=Nf(r),(i=hf.get(i))&&zf(r,i),a=a.createElement(`link`),bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Fd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Yf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var qf=0;function Jf(e,t){return e.stylesheets&&e.count===0&&Zf(e,e.stylesheets),0qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Yf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xf=null;function Zf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xf=new Map,t.forEach(Qf,e),Xf=null,Yf.call(e))}function Qf(e,t){if(!(t.state.loading&4)){var n=Xf.get(e);if(n)var r=n.get(null);else{n=new Map,Xf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()}))(),_=c(u(),1),v=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},y=(e=>e?v(e):v),b=e=>e;function x(e,t=b){let n=_.useSyncExternalStore(e.subscribe,_.useCallback(()=>t(e.getState()),[e,t]),_.useCallback(()=>t(e.getInitialState()),[e,t]));return _.useDebugValue(n),n}var ee=e=>{let t=y(e),n=e=>x(t,e);return Object.assign(n,t),n},S=(e=>e?ee(e):ee),C=null,w=S((e,t)=>({activeScreen:`dashboard`,previousScreen:`dashboard`,selectedFacilityId:null,navigating:!1,setNavigating(t){e({navigating:t})},goTo(n){e({activeScreen:n,previousScreen:t().activeScreen,navigating:!0}),C&&clearTimeout(C),C=setTimeout(()=>e({navigating:!1}),400)},openFacility(n){try{let e=`recently_viewed_facilities`,t=[n,...JSON.parse(localStorage.getItem(e)||`[]`).filter(e=>e!==n)].slice(0,10);localStorage.setItem(e,JSON.stringify(t))}catch{}e({selectedFacilityId:n,previousScreen:t().activeScreen,activeScreen:`detail`,navigating:!0}),C&&clearTimeout(C),C=setTimeout(()=>e({navigating:!1}),400)},goBack(){e({activeScreen:t().previousScreen,selectedFacilityId:null,navigating:!0}),C&&clearTimeout(C),C=setTimeout(()=>e({navigating:!1}),400)}})),te=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ne=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),T=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),re=e=>{let t=T(e);return t.charAt(0).toUpperCase()+t.slice(1)},ie={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ae=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},E=(0,_.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,_.createElement)(`svg`,{ref:c,...ie,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:te(`lucide`,i),...!a&&!ae(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(a)?a:[a]])),oe=(e,t)=>{let n=(0,_.forwardRef)(({className:n,...r},i)=>(0,_.createElement)(E,{ref:i,iconNode:t,className:te(`lucide-${ne(re(e))}`,`lucide-${e}`,n),...r}));return n.displayName=re(e),n},D=oe(`building-2`,[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]),O=oe(`chart-no-axes-column`,[[`path`,{d:`M5 21v-6`,key:`1hz6c0`}],[`path`,{d:`M12 21V3`,key:`1lcnhd`}],[`path`,{d:`M19 21V9`,key:`unv183`}]]),k=oe(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),A=oe(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),j=oe(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),M=oe(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),N=oe(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),se=oe(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]),ce=oe(`linkedin`,[[`path`,{d:`M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z`,key:`c2jq9f`}],[`rect`,{width:`4`,height:`12`,x:`2`,y:`9`,key:`mk3on5`}],[`circle`,{cx:`4`,cy:`4`,r:`2`,key:`bt5ra8`}]]),P=oe(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]),le=oe(`map`,[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]),ue=oe(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),de=oe(`phone-call`,[[`path`,{d:`M13 2a9 9 0 0 1 9 9`,key:`1itnx2`}],[`path`,{d:`M13 6a5 5 0 0 1 5 5`,key:`11nki7`}],[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]),fe=oe(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),pe=oe(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),me=oe(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),he=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),F=o(((e,t)=>{t.exports=he()}))(),ge=[{screen:`dashboard`,label:`Dashboard`,Icon:O},{screen:`facilities`,label:`Facilities`,Icon:D},{screen:`map`,label:`Map`,Icon:le}];function _e(){let{activeScreen:e,previousScreen:t,goTo:n}=w(),r=e===`detail`?t:e,i=r===`detail`?`facilities`:r;return(0,F.jsx)(`nav`,{className:`fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200 shadow-[0_-2px_10px_rgba(0,0,0,0.04)] flex z-50`,style:{height:56},children:ge.map(({screen:e,label:t,Icon:r})=>{let a=i===e,o=a?`#324A6D`:`#6B7280`,s=a?`#BB9468`:`#6B7280`;return(0,F.jsxs)(`button`,{"aria-label":t,"data-active":String(a),onClick:()=>{a||n(e)},className:`flex-1 flex flex-col items-center justify-center gap-0.5 text-xs transition-colors duration-200`,children:[(0,F.jsx)(r,{size:20,color:o}),(0,F.jsx)(`span`,{style:{color:s},children:t})]},e)})})}var ve=`https://strong-creativity-production-197c.up.railway.app/api`,ye=`waste_api_token`;function be(){return sessionStorage.getItem(ye)}function xe(e){sessionStorage.setItem(ye,e)}function Se(){sessionStorage.removeItem(ye)}function Ce(){let e=be(),t={"Content-Type":`application/json`};return e&&(t.Authorization=`Bearer ${e}`),t}async function we(e){let t=await fetch(`${ve}/auth/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({password:e})});if(!t.ok)throw Error(`Invalid password`);return t.json()}async function Te(e){let t=await fetch(`${ve}${e}`,{headers:Ce()});if(t.status===401)throw Se(),Error(`Unauthorized`);if(!t.ok)throw Error(`API error ${t.status}`);return t.json()}async function Ee(e,t){let n=await fetch(`${ve}${e}`,{method:`POST`,headers:Ce(),body:JSON.stringify(t)});if(n.status===401)throw Se(),Error(`Unauthorized`);if(!n.ok)throw Error(`API error ${n.status}`);return n.json()}async function De(e,t){let n=await fetch(`${ve}${e}`,{method:`PUT`,headers:Ce(),body:JSON.stringify(t)});if(!n.ok)throw Error(`API error ${n.status}`);return n.json()}var I=new class{readyPromise;constructor(){this.readyPromise=Promise.resolve()}waitUntilReady(){return this.readyPromise}listFacilities(){return Te(`/facilities`)}getFacilityDetail(e){return Te(`/facilities/${encodeURIComponent(e)}`)}getCrm(e){return Te(`/crm/${encodeURIComponent(e)}`)}getContacts(e){return Te(`/contacts/${encodeURIComponent(e)}`)}getNotes(e){return Te(`/notes/${encodeURIComponent(e)}`)}getDashboardStats(){return Te(`/dashboard/stats`)}getCityCounts(){return Te(`/dashboard/cities`)}getFollowUpsToday(){return Te(`/dashboard/followups`)}upsertCrm(e,t,n){return De(`/crm/${encodeURIComponent(e)}`,{status:t,followUpDate:n})}upsertContacts(e,t,n,r,i){return De(`/contacts/${encodeURIComponent(e)}`,{name:t,title:n,phone:r,email:i})}getSleepingGiants(){return Te(`/dashboard/sleeping-giants`)}getDailyContactedCount(){return Te(`/dashboard/daily-count`)}getTopProspects(){return Te(`/dashboard/top-prospects`)}setTargetLead(e,t){return De(`/facilities/${encodeURIComponent(e)}/target`,{value:t})}getScriptRequest(e){return Te(`/scripts/${encodeURIComponent(e)}/request`)}upsertScriptRequest(e){return Ee(`/scripts/${encodeURIComponent(e)}/request`,{})}getCallScript(e){return Te(`/scripts/${encodeURIComponent(e)}`)}insertNote(e,t){return Ee(`/notes/${encodeURIComponent(e)}`,{text:t})}};function Oe(){return Oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t=t?e.call(null):i.id=requestAnimationFrame(r)}var i={id:requestAnimationFrame(r)};return i}var ze=-1;function Be(e){if(e===void 0&&(e=!1),ze===-1||e){var t=document.createElement(`div`),n=t.style;n.width=`50px`,n.height=`50px`,n.overflow=`scroll`,document.body.appendChild(t),ze=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return ze}var Ve=null;function He(e){if(e===void 0&&(e=!1),Ve===null||e){var t=document.createElement(`div`),n=t.style;n.width=`50px`,n.height=`50px`,n.overflow=`scroll`,n.direction=`rtl`;var r=document.createElement(`div`),i=r.style;return i.width=`100px`,i.height=`100px`,t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?Ve=`positive-descending`:(t.scrollLeft=1,Ve=t.scrollLeft===0?`negative`:`positive-ascending`),document.body.removeChild(t),Ve}return Ve}var Ue=150,We=function(e,t){return e};function Ge(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,i=e.getItemSize,a=e.getOffsetForIndexAndAlignment,o=e.getStartIndexForOffset,s=e.getStopIndexForStartIndex,c=e.initInstanceProps,l=e.shouldResetStyleCacheOnItemSizeChange,u=e.validateProps;return t=function(e){je(t,e);function t(t){var r=e.call(this,t)||this;return r._instanceProps=c(r.props,ke(r)),r._outerRef=void 0,r._resetIsScrollingTimeoutId=null,r.state={instance:ke(r),isScrolling:!1,scrollDirection:`forward`,scrollOffset:typeof r.props.initialScrollOffset==`number`?r.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},r._callOnItemsRendered=void 0,r._callOnItemsRendered=Fe(function(e,t,n,i){return r.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:n,visibleStopIndex:i})}),r._callOnScroll=void 0,r._callOnScroll=Fe(function(e,t,n){return r.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:n})}),r._getItemStyle=void 0,r._getItemStyle=function(e){var t=r.props,a=t.direction,o=t.itemSize,s=t.layout,c=r._getItemStyleCache(l&&o,l&&s,l&&a),u;if(c.hasOwnProperty(e))u=c[e];else{var d=n(r.props,e,r._instanceProps),f=i(r.props,e,r._instanceProps),p=a===`horizontal`||s===`horizontal`,m=a===`rtl`,h=p?d:0;c[e]=u={position:`absolute`,left:m?void 0:h,right:m?h:void 0,top:p?0:d,height:p?`100%`:f,width:p?f:`100%`}}return u},r._getItemStyleCache=void 0,r._getItemStyleCache=Fe(function(e,t,n){return{}}),r._onScrollHorizontal=function(e){var t=e.currentTarget,n=t.clientWidth,i=t.scrollLeft,a=t.scrollWidth;r.setState(function(e){if(e.scrollOffset===i)return null;var t=r.props.direction,o=i;if(t===`rtl`)switch(He()){case`negative`:o=-i;break;case`positive-descending`:o=a-n-i;break}return o=Math.max(0,Math.min(o,a-n)),{isScrolling:!0,scrollDirection:e.scrollOffsetc.clientWidth?Be():0:c.scrollHeight>c.clientHeight?Be():0}this.scrollTo(a(this.props,e,t,o,this._instanceProps,s))},d.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if(typeof n==`number`&&this._outerRef!=null){var i=this._outerRef;t===`horizontal`||r===`horizontal`?i.scrollLeft=n:i.scrollTop=n}this._callPropsCallbacks()},d.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,i=r.scrollOffset;if(r.scrollUpdateWasRequested&&this._outerRef!=null){var a=this._outerRef;if(t===`horizontal`||n===`horizontal`)if(t===`rtl`)switch(He()){case`negative`:a.scrollLeft=-i;break;case`positive-ascending`:a.scrollLeft=i;break;default:var o=a.clientWidth;a.scrollLeft=a.scrollWidth-o-i;break}else a.scrollLeft=i;else a.scrollTop=i}this._callPropsCallbacks()},d.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Le(this._resetIsScrollingTimeoutId)},d.render=function(){var e=this.props,t=e.children,n=e.className,i=e.direction,a=e.height,o=e.innerRef,s=e.innerElementType,c=e.innerTagName,l=e.itemCount,u=e.itemData,d=e.itemKey,f=d===void 0?We:d,p=e.layout,m=e.outerElementType,h=e.outerTagName,g=e.style,v=e.useIsScrolling,y=e.width,b=this.state.isScrolling,x=i===`horizontal`||p===`horizontal`,ee=x?this._onScrollHorizontal:this._onScrollVertical,S=this._getRangeToRender(),C=S[0],w=S[1],te=[];if(l>0)for(var ne=C;ne<=w;ne++)te.push((0,_.createElement)(t,{data:u,key:f(ne,u),index:ne,isScrolling:v?b:void 0,style:this._getItemStyle(ne)}));var T=r(this.props,this._instanceProps);return(0,_.createElement)(m||h||`div`,{className:n,onScroll:ee,ref:this._outerRefSetter,style:Oe({position:`relative`,height:a,width:y,overflow:`auto`,WebkitOverflowScrolling:`touch`,willChange:`transform`,direction:i},g)},(0,_.createElement)(s||c||`div`,{children:te,ref:o,style:{height:x?`100%`:T,pointerEvents:b?`none`:void 0,width:x?T:`100%`}}))},d._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered==`function`&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if(typeof this.props.onScroll==`function`){var a=this.state,o=a.scrollDirection,s=a.scrollOffset,c=a.scrollUpdateWasRequested;this._callOnScroll(o,s,c)}},d._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,a=r.scrollDirection,c=r.scrollOffset;if(t===0)return[0,0,0,0];var l=o(this.props,c,this._instanceProps),u=s(this.props,l,c,this._instanceProps),d=!i||a===`backward`?Math.max(1,n):1,f=!i||a===`forward`?Math.max(1,n):1;return[Math.max(0,l-d),Math.max(0,Math.min(t-1,u+f)),l,u]},t}(_.PureComponent),t.defaultProps={direction:`ltr`,itemData:void 0,layout:`vertical`,overscanCount:2,useIsScrolling:!1},t}var Ke=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},qe=Ge({getItemOffset:function(e,t){return t*e.itemSize},getItemSize:function(e,t){return e.itemSize},getEstimatedTotalSize:function(e){var t=e.itemCount;return e.itemSize*t},getOffsetForIndexAndAlignment:function(e,t,n,r,i,a){var o=e.direction,s=e.height,c=e.itemCount,l=e.itemSize,u=e.layout,d=e.width,f=o===`horizontal`||u===`horizontal`?d:s,p=Math.max(0,c*l-f),m=Math.min(p,t*l),h=Math.max(0,t*l-f+l+a);switch(n===`smart`&&(n=r>=h-f&&r<=m+f?`auto`:`center`),n){case`start`:return m;case`end`:return h;case`center`:var g=Math.round(h+(m-h)/2);return gp+Math.floor(f/2)?p:g;default:return r>=h&&r<=m?r:r({allFacilities:[],loading:!1,search:``,filters:{...Je},load(){t().allFacilities.length>0||t().loading||(e({loading:!0}),I.listFacilities().then(t=>e({allFacilities:t,loading:!1})).catch(()=>e({loading:!1})))},setSearch(t){e({search:t})},setFilter(t,n){e(e=>({filters:{...e.filters,[t]:n}}))},toggleFilter(t){e(e=>({filters:{...e.filters,[t]:!e.filters[t]}}))},patchFacility(t,n){e(e=>({allFacilities:e.allFacilities.map(e=>e.facility_id===t?{...e,...n}:e)}))}}));function $e(e,t,n){let r=t.trim().toLowerCase();return e.filter(e=>{if(r&&![e.company_name,e.city,e.generator_number,e.address].filter(Boolean).join(` `).toLowerCase().includes(r)||n.targetOnly&&e.is_target_lead!==1||n.activeOnly&&e.rpra_status!==`Active`)return!1;if(n.followUpToday){let t=new Date,n=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`;if(e.follow_up_date!==n)return!1}return!(n.city&&e.city!==n.city||n.outreachStatus&&e.outreach_status!==n.outreachStatus||n.industryCategories.length>0&&!n.industryCategories.includes(e.industry_category||``)||n.minWasteStreams>0&&(e.waste_stream_count??0){let t=e.charAt(0).toUpperCase();return{prefix:t,...rt[t]??rt[`?`]}}):[]}function at(e){return e?new Date(e+`T00:00:00`).toLocaleDateString(`en-CA`,{month:`short`,day:`numeric`,year:`numeric`}):``}function ot(e){return e?e.split(` `).filter(Boolean).slice(0,2).map(e=>e[0].toUpperCase()).join(``):`?`}function st({facility:e,onClick:t}){let n=it(e.waste_classes),r=n.slice(0,3),i=n.length>3;return(0,F.jsxs)(`button`,{className:`w-full text-left bg-white border border-gray-100 border-l-2 border-l-transparent hover:border-l-[#BB9468] rounded-xl shadow-[0_1px_3px_rgba(50,74,109,0.08)] hover:shadow-[0_4px_12px_rgba(50,74,109,0.12)] transition-shadow duration-200 px-4 py-3 flex gap-3 items-start hover:bg-gray-50 active:bg-gray-100`,style:{minHeight:88},onClick:()=>t(e.facility_id),children:[(0,F.jsx)(`div`,{className:`w-10 h-10 rounded-full bg-navy-50 text-navy-dark flex items-center justify-center font-semibold text-sm flex-shrink-0`,children:ot(e.company_name)}),(0,F.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5 mb-0.5`,children:[e.is_target_lead===1&&(0,F.jsx)(pe,{size:12,className:`text-amber-400 fill-amber-400 flex-shrink-0`}),(0,F.jsx)(`span`,{className:`font-display font-semibold text-sm text-gray-900 truncate`,children:e.company_name??`Unknown`})]}),(0,F.jsxs)(`div`,{className:`text-xs text-gray-500 mb-1.5`,children:[[e.city,e.province].filter(Boolean).join(`, `),e.generator_number&&(0,F.jsxs)(`span`,{className:`ml-2 text-gray-400`,children:[`#`,e.generator_number]})]}),(0,F.jsxs)(`div`,{className:`flex flex-wrap gap-1 items-center`,children:[r.map((e,t)=>(0,F.jsx)(nt,{tag:e},`${e.prefix}-${t}`)),i&&(0,F.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[`+`,n.length-3,` more`]}),e.waste_stream_count!=null&&e.waste_stream_count>0&&(0,F.jsxs)(`span`,{className:`text-xs text-gray-400 ml-auto`,children:[e.waste_stream_count,` waste streams`]})]})]}),(0,F.jsxs)(`div`,{className:`flex flex-col items-end gap-1.5 flex-shrink-0`,children:[(0,F.jsx)(tt,{status:e.outreach_status}),e.follow_up_date&&(0,F.jsx)(`span`,{className:`text-xs text-gray-400`,children:at(e.follow_up_date)})]})]})}function ct({value:e,onChange:t,placeholder:n=`Search facilities…`}){let[r,i]=(0,_.useState)(e),[a,o]=(0,_.useState)(!1),s=(0,_.useRef)(t);(0,_.useEffect)(()=>{s.current=t},[t]),(0,_.useEffect)(()=>{i(e)},[e]),(0,_.useEffect)(()=>{let e=setTimeout(()=>s.current(r),300);return()=>clearTimeout(e)},[r]);function c(){i(``),t(``)}return(0,F.jsxs)(`div`,{className:`relative flex items-center`,children:[(0,F.jsx)(fe,{size:16,className:`absolute left-3 pointer-events-none ${a?`text-[#BB9468]`:`text-gray-400`}`,"aria-hidden":`true`}),(0,F.jsx)(`input`,{type:`search`,role:`searchbox`,className:`w-full pl-9 pr-9 py-2 text-sm border border-gray-300 rounded-lg bg-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-[#BB9468]/40 focus:border-[#BB9468]`,placeholder:n,value:r,onChange:e=>i(e.target.value),onFocus:()=>o(!0),onBlur:()=>o(!1),"aria-label":`Search facilities`}),r&&(0,F.jsx)(`button`,{type:`button`,"aria-label":`Clear search`,className:`absolute right-3 text-gray-400 hover:text-gray-600`,onClick:c,children:(0,F.jsx)(me,{size:16})})]})}var lt=100,ut=({index:e,style:t,data:n})=>{let r=n.facilities[e];return r?(0,F.jsx)(`div`,{style:t,children:(0,F.jsx)(st,{facility:r,onClick:e=>n.openFacility(e)})}):null};function dt(e,t){return[...e].sort((e,n)=>{switch(t){case`name`:return(e.company_name??``).localeCompare(n.company_name??``,void 0,{sensitivity:`base`});case`city`:return(e.city??``).localeCompare(n.city??``,void 0,{sensitivity:`base`});case`status`:return(e.outreach_status??``).localeCompare(n.outreach_status??``);case`follow_up_date`:return(e.follow_up_date??``).localeCompare(n.follow_up_date??``);case`waste_stream_count`:return(n.waste_stream_count??0)-(e.waste_stream_count??0);default:return 0}})}function ft(){let e=w(e=>e.openFacility),{allFacilities:t,loading:n,search:r,filters:i,load:a,setSearch:o,setFilter:s,toggleFilter:c}=Qe(),[l,u]=(0,_.useState)(``),[d,f]=(0,_.useState)(!1),[p,m]=(0,_.useState)(r),h=typeof window<`u`?window.innerHeight-180:500;(0,_.useEffect)(()=>{a()},[a]),(0,_.useEffect)(()=>{let e=setTimeout(()=>m(r),300);return()=>clearTimeout(e)},[r]);let g=(0,_.useMemo)(()=>dt($e(t,p,i),l),[t,p,i,l]),v=e=>`border rounded-full px-3 py-1 text-sm cursor-pointer transition-colors focus:outline-none ${e?`bg-gold/10 text-gold border-gold/30`:`bg-white text-gray-600 border-gray-300`}`;return(0,F.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,F.jsx)(`div`,{className:`px-4 pt-4 pb-2 shadow-[0_1px_3px_rgba(50,74,109,0.06)] sticky top-0 z-10 bg-white`,children:(0,F.jsx)(ct,{value:r,onChange:o})}),(0,F.jsxs)(`div`,{className:`px-4 pb-2 pt-2 flex gap-2 flex-wrap`,children:[(0,F.jsx)(`button`,{className:v(i.targetOnly),onClick:()=>c(`targetOnly`),children:`Target Leads`}),(0,F.jsx)(`button`,{className:v(i.followUpToday),onClick:()=>c(`followUpToday`),children:`Follow-up Today`})]}),(0,F.jsxs)(`div`,{className:`px-4 pb-2 flex gap-2 flex-wrap`,children:[(0,F.jsxs)(`select`,{className:`text-sm border border-gray-300 rounded px-2 py-1 outline-none focus:ring-1 focus:ring-navy`,value:i.city,onChange:e=>s(`city`,e.target.value),"aria-label":`Filter by city`,children:[(0,F.jsx)(`option`,{value:``,children:`All Cities`}),Ye.map(e=>(0,F.jsx)(`option`,{value:e,children:e},e))]}),(0,F.jsxs)(`select`,{className:`text-sm border border-gray-300 rounded px-2 py-1 outline-none focus:ring-1 focus:ring-navy`,value:i.outreachStatus,onChange:e=>s(`outreachStatus`,e.target.value),"aria-label":`Filter by status`,children:[(0,F.jsx)(`option`,{value:``,children:`All Statuses`}),Ze.map(e=>(0,F.jsx)(`option`,{value:e.value,children:e.label},e.value))]}),(0,F.jsx)(`select`,{className:`text-sm border border-gray-300 rounded px-2 py-1 outline-none focus:ring-1 focus:ring-navy`,value:i.minWasteStreams,onChange:e=>s(`minWasteStreams`,Number(e.target.value)),"aria-label":`Filter by waste stream count`,children:R.map(e=>(0,F.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,F.jsxs)(`div`,{className:`relative`,children:[(0,F.jsx)(`button`,{onClick:()=>f(e=>!e),className:`text-sm border rounded px-2 py-1 outline-none transition-colors ${i.industryCategories.length>0?`border-gold bg-gold/10 text-gold font-medium`:`border-gray-300 text-gray-600`}`,children:i.industryCategories.length===0?`All Industries`:`${i.industryCategories.length} Industr${i.industryCategories.length===1?`y`:`ies`}`}),d&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`fixed inset-0 z-30`,onClick:()=>f(!1)}),(0,F.jsxs)(`div`,{className:`fixed left-4 right-4 top-24 bg-white border border-gray-200 rounded-lg shadow-xl z-40 max-h-[60vh] overflow-y-auto sm:absolute sm:left-0 sm:right-auto sm:top-full sm:mt-1 sm:w-56 sm:max-h-64`,children:[(0,F.jsxs)(`div`,{className:`p-2 border-b border-gray-100 flex justify-between items-center sticky top-0 bg-white`,children:[(0,F.jsx)(`span`,{className:`text-xs font-medium text-gray-500`,children:`Select Industries`}),(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[i.industryCategories.length>0&&(0,F.jsx)(`button`,{onClick:()=>s(`industryCategories`,[]),className:`text-xs text-red-500 hover:text-red-700`,children:`Clear`}),(0,F.jsx)(`button`,{onClick:()=>f(!1),className:`text-xs text-gray-400 hover:text-gray-600 font-bold`,children:`✕`})]})]}),Xe.map(e=>(0,F.jsxs)(`label`,{className:`flex items-center gap-2 px-3 py-2 hover:bg-gray-50 cursor-pointer text-sm text-gray-700`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:i.industryCategories.includes(e),onChange:t=>{let n=i.industryCategories;t.target.checked?s(`industryCategories`,[...n,e]):s(`industryCategories`,n.filter(t=>t!==e))},className:`rounded border-gray-300 text-navy focus:ring-navy`}),e]},e))]})]})]}),(0,F.jsxs)(`select`,{className:`text-sm border border-gray-300 rounded px-2 py-1 outline-none focus:ring-1 focus:ring-navy`,value:l,onChange:e=>u(e.target.value),"aria-label":`Sort by`,children:[(0,F.jsx)(`option`,{value:``,children:`Sort by`}),(0,F.jsx)(`option`,{value:`name`,children:`Name`}),(0,F.jsx)(`option`,{value:`city`,children:`City`}),(0,F.jsx)(`option`,{value:`status`,children:`Status`}),(0,F.jsx)(`option`,{value:`follow_up_date`,children:`Follow-up Date`}),(0,F.jsx)(`option`,{value:`waste_stream_count`,children:`Waste Stream Count`})]})]}),(0,F.jsx)(`div`,{className:`flex-1`,children:n?(0,F.jsx)(`div`,{className:`flex items-center justify-center h-32`,children:(0,F.jsx)(`p`,{className:`text-gray-500`,children:`Loading...`})}):(0,F.jsx)(qe,{height:h,width:`100%`,itemCount:g.length,itemSize:lt,itemData:{facilities:g,openFacility:e},children:ut})})]})}var pt=[`Brampton`,`Etobicoke`,`London`,`Mississauga`,`Ottawa`,`Toronto`,`Windsor`];function mt(){let e=w(e=>e.openFacility),t=w(e=>e.goTo),n=Qe(e=>e.setFilter),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(!0);(0,_.useEffect)(()=>{let e=[];try{e=JSON.parse(localStorage.getItem(`recently_viewed_facilities`)||`[]`)}catch{}Promise.all([I.getDashboardStats(),I.getCityCounts(),I.getSleepingGiants(),...e.slice(0,5).map(e=>I.getFacilityDetail(e).catch(()=>null))]).then(([e,t,n,...r])=>{i({stats:e,cityCounts:t,sleepingGiants:n,recentlyViewed:r.filter(Boolean)}),o(!1)}).catch(()=>o(!1))},[]);function s(e){n(`city`,e),t(`map`)}if(a)return(0,F.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-gray-50`,children:(0,F.jsxs)(`div`,{className:`text-center`,children:[(0,F.jsx)(`div`,{className:`w-8 h-8 border-2 border-navy border-t-transparent rounded-full animate-spin mx-auto mb-2`}),(0,F.jsx)(`p`,{className:`text-sm text-gray-400`,children:`Loading dashboard...`})]})});if(!r)return(0,F.jsx)(`div`,{className:`p-4 text-red-600`,children:`Failed to load dashboard data.`});let{stats:c,cityCounts:l,sleepingGiants:u,recentlyViewed:d}=r,f=new Map;for(let e of l)f.set(e.city,e);let p=pt.map(e=>{let t=f.get(e);return{city:e,total:t?.total??0,new_count:t?.new_count??0,contacted_count:t?.contacted_count??0,opportunity_count:t?.opportunity_count??0}}),m=Math.max(...p.map(e=>e.total),1),h=[...p].sort((e,t)=>t.new_count-e.new_count).slice(0,3),g=[{label:`Total Facilities`,value:c.total.toLocaleString(),icon:D,color:`text-navy`},{label:`New`,value:c.new_count.toLocaleString(),icon:se,color:`text-navy`},{label:`Contacted`,value:c.contacted_count.toLocaleString(),icon:de,color:`text-gold`},{label:`Opportunities`,value:c.opportunity_count.toLocaleString(),icon:pe,color:`text-green-600`}];return(0,F.jsxs)(`div`,{className:`p-4 space-y-4 pb-20 max-w-4xl mx-auto`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,F.jsx)(`h1`,{className:`text-xl font-semibold text-gray-900 font-display`,children:`Dashboard`}),(0,F.jsx)(`span`,{className:`text-xs text-gray-400`,children:new Date().toLocaleDateString(`en-US`,{weekday:`long`,month:`short`,day:`numeric`})})]}),(0,F.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-3`,children:g.map(({label:e,value:t,icon:n,color:r})=>(0,F.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-3 shadow-[0_1px_3px_rgba(50,74,109,0.08)]`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,F.jsx)(n,{size:14,className:`${r} opacity-60`}),(0,F.jsx)(`span`,{className:`text-xs text-gray-400 font-medium`,children:e})]}),(0,F.jsx)(`p`,{className:`text-2xl font-bold font-display ${r}`,children:t})]},e))}),d.length>0&&(0,F.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4 shadow-[0_1px_3px_rgba(50,74,109,0.08)]`,children:[(0,F.jsx)(`h2`,{className:`text-xs font-semibold text-navy/50 uppercase tracking-wide mb-3`,children:`Recently Viewed`}),(0,F.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2`,children:d.map(t=>(0,F.jsxs)(`div`,{className:`flex items-center gap-3 cursor-pointer hover:bg-gray-50 rounded-lg px-2 py-2 -mx-2 transition-colors`,onClick:()=>e(t.facility_id),children:[(0,F.jsx)(`div`,{className:`w-8 h-8 rounded-full bg-gold/10 flex items-center justify-center shrink-0`,children:(0,F.jsx)(j,{size:14,className:`text-gold`})}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`p`,{className:`text-sm font-medium text-gray-900 truncate font-display`,children:t.company_name??`—`}),(0,F.jsx)(`p`,{className:`text-xs text-gray-400`,children:t.city??`—`})]}),(0,F.jsx)(tt,{status:t.outreach_status})]},t.facility_id))})]}),(0,F.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,F.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,F.jsx)(`h2`,{className:`text-xs font-semibold text-navy/50 uppercase tracking-wide mb-3`,children:`By City`}),(0,F.jsxs)(`div`,{className:`flex gap-3 mb-3`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-gray-400`,children:[(0,F.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm bg-navy`}),`New`]}),(0,F.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-gray-400`,children:[(0,F.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm bg-gold`}),`In Progress`]}),(0,F.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-gray-400`,children:[(0,F.jsx)(`span`,{className:`inline-block w-2 h-2 rounded-sm bg-green-500`}),`Opportunity`]})]}),(0,F.jsx)(`div`,{className:`space-y-1.5`,children:p.map(({city:e,total:t,new_count:n,contacted_count:r,opportunity_count:i})=>(0,F.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,F.jsx)(`span`,{className:`w-20 text-gray-600 shrink-0 truncate`,children:e}),(0,F.jsxs)(`div`,{className:`flex-1 bg-gray-100 rounded-full h-2 overflow-hidden flex`,children:[i>0&&(0,F.jsx)(`div`,{className:`h-2 bg-green-500`,style:{width:`${i/m*100}%`}}),r>0&&(0,F.jsx)(`div`,{className:`h-2 bg-gold`,style:{width:`${r/m*100}%`}}),n>0&&(0,F.jsx)(`div`,{className:`h-2 bg-navy`,style:{width:`${n/m*100}%`}})]}),(0,F.jsx)(`span`,{className:`w-6 text-right text-gray-500 shrink-0 tabular-nums`,children:t})]},e))})]}),(0,F.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,F.jsx)(`h2`,{className:`text-xs font-semibold text-navy/50 uppercase tracking-wide mb-1`,children:`Explore by Region`}),(0,F.jsx)(`p`,{className:`text-[10px] text-gray-400 mb-3`,children:`Cities with the most new facilities — tap to view on map`}),(0,F.jsx)(`div`,{className:`grid grid-cols-1 gap-2`,children:h.map(({city:e,new_count:t})=>(0,F.jsxs)(`button`,{onClick:()=>s(e),className:`flex items-center gap-3 bg-gray-50 border border-gray-100 border-l-2 border-l-gold rounded-lg p-3 text-left hover:border-navy/30 hover:border-l-gold hover:bg-navy-50 transition-colors`,children:[(0,F.jsx)(`div`,{className:`w-8 h-8 rounded-lg bg-navy-50 flex items-center justify-center shrink-0`,children:(0,F.jsx)(P,{size:14,className:`text-navy`})}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`p`,{className:`text-sm font-semibold text-gray-800`,children:e}),(0,F.jsxs)(`p`,{className:`text-xs text-gray-400`,children:[t,` new facilities`]})]})]},e))})]})]}),(0,F.jsxs)(`div`,{className:`bg-white rounded-xl border border-gray-200 p-4`,children:[(0,F.jsx)(`h2`,{className:`text-xs font-semibold text-navy/50 uppercase tracking-wide mb-0.5`,children:`Recently Active — Never Reviewed`}),(0,F.jsx)(`p`,{className:`text-[10px] text-gray-400 mb-3`,children:`Active facilities with recent waste filings that haven't been explored yet`}),u.length===0?(0,F.jsx)(`p`,{className:`text-sm text-gray-300 text-center py-4`,children:`None found`}):(0,F.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-2`,children:u.map(t=>(0,F.jsxs)(`div`,{className:`flex items-center gap-3 cursor-pointer hover:bg-gray-50 rounded-lg px-2 py-2 -mx-2`,onClick:()=>e(t.facility_id),children:[(0,F.jsx)(`div`,{className:`w-8 h-8 rounded-full bg-navy-50 flex items-center justify-center shrink-0`,children:(0,F.jsx)(D,{size:14,className:`text-navy`})}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1`,children:[t.is_target_lead===1&&(0,F.jsx)(pe,{size:10,className:`text-gold fill-gold shrink-0`}),(0,F.jsx)(`p`,{className:`text-sm font-medium text-gray-900 truncate`,children:t.company_name??`—`})]}),(0,F.jsxs)(`p`,{className:`text-xs text-gray-400`,children:[t.city,` · `,t.waste_stream_count,` streams`]})]})]},t.facility_id))})]})]})}function ht(e){return new Date(e).toLocaleString(`en-CA`,{year:`numeric`,month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`})}function gt({notes:e}){if(e.length===0)return(0,F.jsx)(`p`,{className:`text-gray-400 text-sm italic`,children:`No notes yet`});let t=[...e].sort((e,t)=>new Date(t.timestamp).getTime()-new Date(e.timestamp).getTime());return(0,F.jsx)(`div`,{className:`space-y-3`,children:t.map((e,n)=>(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`p`,{className:`text-sm text-gray-800 whitespace-pre-wrap`,children:e.text}),(0,F.jsx)(`p`,{className:`text-xs text-gray-400 mt-1`,children:ht(e.timestamp)}),nr(e.target.value)}),(0,F.jsx)(`button`,{type:`submit`,disabled:!n.trim()||i,className:`px-4 py-1.5 rounded bg-navy text-white text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed hover:bg-navy-dark transition-colors`,children:i?`Adding...`:`Add Note`})]})}function vt({initialValues:e,onSave:t,saving:n}){let[r,i]=(0,_.useState)(e),[a,o]=(0,_.useState)(!1);(0,_.useEffect)(()=>{i(e)},[e.name,e.title,e.phone,e.email]);let s=!!(e.name||e.email||e.phone||e.title);function c(e){return t=>i(n=>({...n,[e]:t.target.value}))}function l(e){e.preventDefault(),t(r),o(!1)}function u(){i(e),o(!1)}return a?(0,F.jsxs)(`form`,{onSubmit:l,className:`space-y-3`,children:[(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`label`,{className:`block text-xs text-gray-500 mb-1`,children:`Name`}),(0,F.jsx)(`input`,{type:`text`,className:`w-full rounded border border-gray-300 px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-gold`,value:r.name,onChange:c(`name`),autoFocus:!0})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`label`,{className:`block text-xs text-gray-500 mb-1`,children:`Title`}),(0,F.jsx)(`input`,{type:`text`,className:`w-full rounded border border-gray-300 px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-gold`,value:r.title,onChange:c(`title`)})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`label`,{className:`block text-xs text-gray-500 mb-1`,children:`Phone`}),(0,F.jsx)(`input`,{type:`text`,className:`w-full rounded border border-gray-300 px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-gold`,value:r.phone,onChange:c(`phone`)})]}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`label`,{className:`block text-xs text-gray-500 mb-1`,children:`Email`}),(0,F.jsx)(`input`,{type:`text`,className:`w-full rounded border border-gray-300 px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-gold`,value:r.email,onChange:c(`email`)})]}),(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[(0,F.jsx)(`button`,{type:`submit`,disabled:n,className:`px-4 py-1.5 rounded bg-navy text-white text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed hover:bg-navy-dark transition-colors`,children:n?`Saving...`:`Save`}),(0,F.jsxs)(`button`,{type:`button`,onClick:u,className:`px-4 py-1.5 rounded border border-gray-300 text-gray-600 text-sm font-medium hover:bg-gray-50 transition-colors inline-flex items-center gap-1`,children:[(0,F.jsx)(me,{size:14}),` Cancel`]})]})]}):(0,F.jsxs)(`div`,{children:[s?(0,F.jsxs)(`div`,{className:`space-y-1.5`,children:[e.name&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs text-gray-400`,children:`Name: `}),(0,F.jsx)(`span`,{className:`text-sm text-gray-800`,children:e.name})]}),e.title&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs text-gray-400`,children:`Title: `}),(0,F.jsx)(`span`,{className:`text-sm text-gray-800`,children:e.title})]}),e.phone&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs text-gray-400`,children:`Phone: `}),(0,F.jsx)(`a`,{href:`tel:${e.phone}`,className:`text-sm text-navy hover:underline`,children:e.phone})]}),e.email&&(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`span`,{className:`text-xs text-gray-400`,children:`Email: `}),(0,F.jsx)(`a`,{href:`mailto:${e.email}`,className:`text-sm text-navy hover:underline`,children:e.email})]})]}):(0,F.jsx)(`p`,{className:`text-sm text-gray-300`,children:`No contact info`}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>o(!0),className:`mt-3 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-gray-200 text-xs font-medium text-gray-500 hover:text-navy hover:border-navy/30 hover:bg-navy-50 transition-colors`,children:[(0,F.jsx)(ue,{size:12}),s?`Edit Contact`:`Add Contact`]})]})}var yt=[{value:`new`,label:`New`},{value:`contacted`,label:`Contacted`},{value:`opportunity`,label:`Opportunity`},{value:`closed`,label:`Closed`},{value:`not_interested`,label:`Not Interested`}];function bt(){let e=w(e=>e.selectedFacilityId),t=w(e=>e.goBack),n=Qe(e=>e.patchFacility),[r,i]=(0,_.useState)(`overview`),[a,o]=(0,_.useState)(!0),[s,c]=(0,_.useState)(null),[,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)([]),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(`new`),[y,b]=(0,_.useState)(``),[x,ee]=(0,_.useState)(!1),S=(0,_.useCallback)(async()=>{if(e){o(!0);try{let[t,n,r,i]=await Promise.all([I.getFacilityDetail(e),I.getCrm(e),I.getContacts(e),I.getNotes(e)]);c(t),l(n),d(r),p(i),h(t?.is_target_lead===1),v(n?.outreach_status??t?.outreach_status??`new`),b(n?.follow_up_date??``)}finally{o(!1)}}},[e]);(0,_.useEffect)(()=>{S()},[S]);async function C(t){if(e){v(t);try{await I.upsertCrm(e,t,y||null)}catch(e){console.error(`Failed to save status`,e)}}}async function te(t){if(e){b(t);try{await I.upsertCrm(e,g,t||null)}catch(e){console.error(`Failed to save follow-up date`,e)}}}async function ne(t){if(e){ee(!0);try{await I.upsertContacts(e,t.name||null,t.title||null,t.phone||null,t.email||null),d(await I.getContacts(e))}finally{ee(!1)}}}async function T(){if(!e)return;let t=!m;h(t),n(e,{is_target_lead:t?1:0}),await I.setTargetLead(e,t)}async function re(){if(e)try{p(await I.getNotes(e))}catch(e){console.error(`Failed to refresh notes`,e)}}if(a)return(0,F.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-gray-50`,children:(0,F.jsx)(`p`,{className:`text-gray-500`,children:`Loading...`})});if(!s)return(0,F.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-gray-50`,children:(0,F.jsx)(`p`,{className:`text-gray-500`,children:`Facility not found.`})});let ie=it(s.waste_classes),ae={name:u?.contact_name??s.primary_contact_name??``,title:u?.contact_title??s.primary_contact_title??``,phone:u?.contact_phone??s.primary_contact_phone??``,email:u?.contact_email??s.primary_contact_email??``},E=!!(s.alt_contact_name||s.alt_contact_email);return(0,F.jsxs)(`div`,{className:`min-h-screen bg-gray-50`,children:[(0,F.jsxs)(`div`,{className:`bg-white border-b border-gray-200 px-4 py-3 sticky top-0 z-10`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,F.jsx)(`button`,{onClick:t,"aria-label":`Back`,className:`p-1 -ml-1 rounded text-gray-500 hover:text-gray-700 hover:bg-gray-100`,children:(0,F.jsx)(k,{size:24})}),(0,F.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,F.jsx)(`h1`,{className:`text-lg font-bold text-gray-900 truncate font-display`,children:s.company_name??`Unknown Company`})}),(0,F.jsx)(`button`,{onClick:T,"aria-label":m?`Remove target lead`:`Mark as target lead`,title:m?`Remove target lead`:`Mark as target lead`,className:`p-1.5 rounded hover:bg-amber-50 transition-colors shrink-0`,children:(0,F.jsx)(pe,{size:18,className:m?`text-amber-400 fill-amber-400`:`text-gray-300`})}),(0,F.jsx)(`a`,{href:`https://www.linkedin.com/search/results/people/?keywords=${encodeURIComponent((s.company_name??``)+` environmental health safety Ontario`)}`,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`Search LinkedIn`,className:`p-1.5 rounded text-navy hover:bg-navy-50 transition-colors shrink-0`,title:`Find contact on LinkedIn`,children:(0,F.jsx)(ce,{size:18})}),(0,F.jsx)(tt,{status:g})]}),(0,F.jsxs)(`div`,{className:`flex gap-4 mt-3`,children:[(0,F.jsx)(`button`,{onClick:()=>i(`overview`),className:`pb-1 text-sm font-medium border-b-2 transition-colors ${r===`overview`?`border-gold text-navy`:`border-transparent text-gray-500 hover:text-gray-700`}`,children:`Overview`}),(0,F.jsx)(`button`,{onClick:()=>i(`outreach`),className:`pb-1 text-sm font-medium border-b-2 transition-colors ${r===`outreach`?`border-gold text-navy`:`border-transparent text-gray-500 hover:text-gray-700`}`,children:`Outreach`})]})]}),(0,F.jsxs)(`div`,{className:`p-4 space-y-4 pb-20`,children:[r===`overview`&&(0,F.jsx)(xt,{facility:s,wasteClasses:ie}),r===`outreach`&&(0,F.jsx)(St,{facility:s,contactInitial:ae,hasAltContact:E,outreachStatus:g,followUpDate:y,savingContact:x,notes:f,facilityId:e,onStatusChange:C,onFollowUpChange:te,onSaveContact:ne,onNoteAdded:re})]})]})}function xt({facility:e,wasteClasses:t}){return(0,F.jsxs)(`div`,{className:`space-y-4`,children:[(0,F.jsxs)(z,{title:`Company`,children:[(0,F.jsx)(B,{label:`Company Name`,value:e.company_name}),e.legal_business_name&&e.legal_business_name!==e.company_name&&(0,F.jsx)(B,{label:`Legal Name`,value:e.legal_business_name}),e.facility_name&&(0,F.jsx)(B,{label:`Facility Name`,value:e.facility_name}),e.latest_submission_date&&(0,F.jsx)(B,{label:`Last Submitted`,value:e.latest_submission_date})]}),(0,F.jsx)(z,{title:`Address`,children:(0,F.jsx)(`p`,{className:`text-sm text-gray-800`,children:[e.address,e.city,e.province,e.postal_code].filter(Boolean).join(`, `)})}),(0,F.jsxs)(z,{title:`Registration`,children:[(0,F.jsx)(B,{label:`Generator Number`,value:e.generator_number}),(0,F.jsx)(B,{label:`RPRA Status`,value:e.rpra_status}),(0,F.jsx)(B,{label:`Region`,value:e.region})]}),(0,F.jsxs)(z,{title:`Industry`,children:[(0,F.jsx)(B,{label:`Category`,value:e.industry_category}),(e.naics_code||e.naics_industry)&&(0,F.jsx)(B,{label:`NAICS`,value:[e.naics_code,e.naics_industry].filter(Boolean).join(` — `)})]}),(0,F.jsxs)(z,{title:`Waste`,children:[t.length>0&&(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5 mb-2`,children:t.map((e,t)=>(0,F.jsx)(nt,{tag:e},t))}),(0,F.jsx)(B,{label:`Stream Count`,value:e.waste_stream_count?.toString()}),(0,F.jsx)(B,{label:`Latest Submission`,value:e.latest_submission_date})]}),(e.primary_contact_name||e.primary_contact_email||e.primary_contact_phone)&&(0,F.jsxs)(z,{title:`Primary Contact`,children:[(0,F.jsx)(B,{label:`Name`,value:e.primary_contact_name}),(0,F.jsx)(B,{label:`Title`,value:e.primary_contact_title}),(0,F.jsx)(B,{label:`Phone`,value:e.primary_contact_phone}),(0,F.jsx)(B,{label:`Email`,value:e.primary_contact_email})]}),(e.alt_contact_name||e.alt_contact_email)&&(0,F.jsxs)(z,{title:`Alt Contact`,children:[(0,F.jsx)(B,{label:`Name`,value:e.alt_contact_name}),(0,F.jsx)(B,{label:`Email`,value:e.alt_contact_email})]}),(0,F.jsx)(`a`,{href:`https://hazardouswaste-registrations.rpra.ca/s/generator-details?facilityId=${encodeURIComponent(e.facility_id||``)}#waste-stream-section`,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 px-4 py-2 rounded bg-gold/10 text-gold text-sm font-medium border border-gold/30 hover:bg-gold/20 transition-colors`,children:`Open in RPRA ↗`}),(e.latitude!=null||e.longitude!=null)&&(0,F.jsxs)(`p`,{className:`text-xs text-gray-400`,children:[`Lat/Lng: `,e.latitude,`, `,e.longitude]})]})}function St({facility:e,contactInitial:t,hasAltContact:n,outreachStatus:r,followUpDate:i,savingContact:a,notes:o,facilityId:s,onStatusChange:c,onFollowUpChange:l,onSaveContact:u,onNoteAdded:d}){return(0,F.jsxs)(`div`,{className:`space-y-5`,children:[(0,F.jsxs)(z,{title:`Status`,children:[(0,F.jsx)(`div`,{className:`flex flex-wrap gap-2 mb-4`,children:yt.map(e=>(0,F.jsx)(`button`,{onClick:()=>c(e.value),className:`px-3 py-1 rounded-full text-xs font-medium border transition-colors ${r===e.value?`bg-navy text-white border-navy`:`bg-white text-gray-600 border-gray-300 hover:border-gray-400`}`,children:e.label},e.value))}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`label`,{className:`block text-xs text-gray-400 mb-1`,children:`Follow-up Date`}),(0,F.jsx)(`input`,{type:`date`,className:`rounded border border-gray-300 px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-gold`,value:i,onChange:e=>l(e.target.value)})]})]}),(0,F.jsxs)(z,{title:`Notes`,children:[(0,F.jsx)(_t,{facilityId:s,onAdded:d}),o.length>0&&(0,F.jsx)(`div`,{className:`mt-3`,children:(0,F.jsx)(gt,{notes:o})})]}),(0,F.jsx)(z,{title:`Contact`,children:(0,F.jsx)(vt,{initialValues:t,onSave:u,saving:a})}),n&&(0,F.jsxs)(z,{title:`Alt Contact`,children:[e.alt_contact_name&&(0,F.jsx)(B,{label:`Name`,value:e.alt_contact_name}),e.alt_contact_email&&(0,F.jsx)(B,{label:`Email`,value:e.alt_contact_email})]})]})}function z({title:e,children:t}){return(0,F.jsxs)(`div`,{className:`bg-white rounded-lg border border-gray-200 p-4 shadow-[0_1px_3px_rgba(50,74,109,0.08)]`,children:[(0,F.jsx)(`h2`,{className:`text-xs font-semibold text-navy/50 uppercase tracking-wide mb-3 font-display`,children:e}),t]})}function B({label:e,value:t}){return t?(0,F.jsxs)(`div`,{className:`mb-1.5`,children:[(0,F.jsxs)(`span`,{className:`text-xs text-gray-400`,children:[e,`: `]}),(0,F.jsx)(`span`,{className:`text-sm text-gray-800`,children:t})]}):null}function Ct(e,t){let n=(0,_.useRef)(t);(0,_.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])}function wt(e,t,n){t.center!==n.center&&e.setLatLng(t.center),t.radius!=null&&t.radius!==n.radius&&e.setRadius(t.radius)}function Tt(e){return Object.freeze({__version:1,map:e})}function Et(e,t){return Object.freeze({...e,...t})}var V=(0,_.createContext)(null);function H(){let e=(0,_.use)(V);if(e==null)throw Error(`No context provided: useLeafletContext() can only be used in a descendant of `);return e}var Dt=m();function Ot(e){function t(t,n){let{instance:r,context:i}=e(t).current;(0,_.useImperativeHandle)(n,()=>r);let{children:a}=t;return a==null?null:_.createElement(V,{value:i},a)}return(0,_.forwardRef)(t)}function kt(e){function t(t,n){let[r,i]=(0,_.useState)(!1),{instance:a}=e(t,i).current;(0,_.useImperativeHandle)(n,()=>a),(0,_.useEffect)(function(){r&&a.update()},[a,r,t.children]);let o=a._contentNode;return o?(0,Dt.createPortal)(t.children,o):null}return(0,_.forwardRef)(t)}function At(e){function t(t,n){let{instance:r}=e(t).current;return(0,_.useImperativeHandle)(n,()=>r),null}return(0,_.forwardRef)(t)}function jt(e,t){let n=(0,_.useRef)(void 0);(0,_.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 Mt(e,t){let n=e.pane??t.pane;return n?{...e,pane:n}:e}function Nt(e,t){return function(n,r){let i=H(),a=e(Mt(n,i),i);return Ct(i.map,n.attribution),jt(a.current,n.eventHandlers),t(a.current,i,n,r),a}}var Pt=o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n.leaflet={}))})(e,(function(e){var t=`1.9.4`;function n(e){var t,n,r,i;for(n=1,r=arguments.length;n`u`||!L||!L.Mixin)){e=_(e)?e:[e];for(var t=0;t0?Math.floor(e):Math.ceil(e)};E.prototype={clone:function(){return new E(this.x,this.y)},add:function(e){return this.clone()._add(D(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(D(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},scaleBy:function(e){return new E(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new E(this.x/e.x,this.y/e.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=oe(this.x),this.y=oe(this.y),this},distanceTo:function(e){e=D(e);var t=e.x-this.x,n=e.y-this.y;return Math.sqrt(t*t+n*n)},equals:function(e){return e=D(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=D(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return`Point(`+u(this.x)+`, `+u(this.y)+`)`}};function D(e,t,n){return e instanceof E?e:_(e)?new E(e[0],e[1]):e==null?e:typeof e==`object`&&`x`in e&&`y`in e?new E(e.x,e.y):new E(e,t,n)}function O(e,t){if(e)for(var n=t?[e,t]:e,r=0,i=n.length;r=this.min.x&&n.x<=this.max.x&&t.y>=this.min.y&&n.y<=this.max.y},intersects:function(e){e=k(e);var t=this.min,n=this.max,r=e.min,i=e.max,a=i.x>=t.x&&r.x<=n.x,o=i.y>=t.y&&r.y<=n.y;return a&&o},overlaps:function(e){e=k(e);var t=this.min,n=this.max,r=e.min,i=e.max,a=i.x>t.x&&r.xt.y&&r.y=t.lat&&i.lat<=n.lat&&r.lng>=t.lng&&i.lng<=n.lng},intersects:function(e){e=j(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),i=e.getNorthEast(),a=i.lat>=t.lat&&r.lat<=n.lat,o=i.lng>=t.lng&&r.lng<=n.lng;return a&&o},overlaps:function(e){e=j(e);var t=this._southWest,n=this._northEast,r=e.getSouthWest(),i=e.getNorthEast(),a=i.lat>t.lat&&r.latt.lng&&r.lng1,We=function(){var e=!1;try{var t=Object.defineProperty({},`passive`,{get:function(){e=!0}});window.addEventListener(`testPassiveEventSupport`,l,t),window.removeEventListener(`testPassiveEventSupport`,l,t)}catch{}return e}(),Ge=function(){return!!document.createElement(`canvas`).getContext}(),Ke=!!(document.createElementNS&&me(`svg`).createSVGRect),qe=!!Ke&&(function(){var e=document.createElement(`div`);return e.innerHTML=``,(e.firstChild&&e.firstChild.namespaceURI)===`http://www.w3.org/2000/svg`})(),Je=!Ke&&function(){try{var e=document.createElement(`div`);e.innerHTML=``;var t=e.firstChild;return t.style.behavior=`url(#default#VML)`,t&&typeof t.adj==`object`}catch{return!1}}(),Ye=navigator.platform.indexOf(`Mac`)===0,Xe=navigator.platform.indexOf(`Linux`)===0;function Ze(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var R={ie:ge,ielt9:_e,edge:ve,webkit:ye,android:be,android23:xe,androidStock:Ce,opera:we,chrome:Te,gecko:Ee,safari:De,phantom:I,opera12:Oe,win:ke,ie3d:Ae,webkit3d:je,gecko3d:Me,any3d:Ne,mobile:Pe,mobileWebkit:Fe,mobileWebkit3d:Ie,msPointer:Le,pointer:Re,touch:Be,touchNative:ze,mobileOpera:Ve,mobileGecko:He,retina:Ue,passiveEvents:We,canvas:Ge,svg:Ke,vml:Je,inlineSvg:qe,mac:Ye,linux:Xe},Qe=R.msPointer?`MSPointerDown`:`pointerdown`,$e=R.msPointer?`MSPointerMove`:`pointermove`,et=R.msPointer?`MSPointerUp`:`pointerup`,tt=R.msPointer?`MSPointerCancel`:`pointercancel`,nt={touchstart:Qe,touchmove:$e,touchend:et,touchcancel:tt},rt={touchstart:pt,touchmove:ft,touchend:ft,touchcancel:ft},it={},at=!1;function ot(e,t,n){return t===`touchstart`&&dt(),rt[t]?(n=rt[t].bind(this,n),e.addEventListener(nt[t],n,!1),n):(console.warn(`wrong event specified:`,t),l)}function st(e,t,n){if(!nt[t]){console.warn(`wrong event specified:`,t);return}e.removeEventListener(nt[t],n,!1)}function ct(e){it[e.pointerId]=e}function lt(e){it[e.pointerId]&&(it[e.pointerId]=e)}function ut(e){delete it[e.pointerId]}function dt(){at||=(document.addEventListener(Qe,ct,!0),document.addEventListener($e,lt,!0),document.addEventListener(et,ut,!0),document.addEventListener(tt,ut,!0),!0)}function ft(e,t){if(t.pointerType!==(t.MSPOINTER_TYPE_MOUSE||`mouse`)){for(var n in t.touches=[],it)t.touches.push(it[n]);t.changedTouches=[t],e(t)}}function pt(e,t){t.MSPOINTER_TYPE_TOUCH&&t.pointerType===t.MSPOINTER_TYPE_TOUCH&&nn(t),ft(e,t)}function mt(e){var t={},n,r;for(r in e)n=e[r],t[r]=n&&n.bind?n.bind(e):n;return e=t,t.type=`dblclick`,t.detail=2,t.isTrusted=!1,t._simulated=!0,t}var ht=200;function gt(e,t){e.addEventListener(`dblclick`,t);var n=0,r;function i(e){if(e.detail!==1){r=e.detail;return}if(!(e.pointerType===`mouse`||e.sourceCapabilities&&!e.sourceCapabilities.firesTouchEvents)){var i=an(e);if(!(i.some(function(e){return e instanceof HTMLLabelElement&&e.attributes.for})&&!i.some(function(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement}))){var a=Date.now();a-n<=ht?(r++,r===2&&t(mt(e))):r=1,n=a}}}return e.addEventListener(`click`,i),{dblclick:t,simDblclick:i}}function _t(e,t){e.removeEventListener(`dblclick`,t.dblclick),e.removeEventListener(`click`,t.simDblclick)}var vt=jt([`transform`,`webkitTransform`,`OTransform`,`MozTransform`,`msTransform`]),yt=jt([`webkitTransition`,`transition`,`OTransition`,`MozTransition`,`msTransition`]),bt=yt===`webkitTransition`||yt===`OTransition`?yt+`End`:`transitionend`;function xt(e){return typeof e==`string`?document.getElementById(e):e}function St(e,t){var n=e.style[t]||e.currentStyle&&e.currentStyle[t];if((!n||n===`auto`)&&document.defaultView){var r=document.defaultView.getComputedStyle(e,null);n=r?r[t]:null}return n===`auto`?null:n}function z(e,t,n){var r=document.createElement(e);return r.className=t||``,n&&n.appendChild(r),r}function B(e){var t=e.parentNode;t&&t.removeChild(e)}function Ct(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function wt(e){var t=e.parentNode;t&&t.lastChild!==e&&t.appendChild(e)}function Tt(e){var t=e.parentNode;t&&t.firstChild!==e&&t.insertBefore(e,t.firstChild)}function Et(e,t){if(e.classList!==void 0)return e.classList.contains(t);var n=Ot(e);return n.length>0&&RegExp(`(^|\\s)`+t+`(\\s|$)`).test(n)}function V(e,t){if(e.classList!==void 0)for(var n=f(t),r=0,i=n.length;r0?2*window.devicePixelRatio:1;function cn(e){return R.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/sn:e.deltaY&&e.deltaMode===1?-e.deltaY*20:e.deltaY&&e.deltaMode===2?-e.deltaY*60:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?-e.detail*20:e.detail?e.detail/-32765*60:0}function ln(e,t){var n=t.relatedTarget;if(!n)return!0;try{for(;n&&n!==e;)n=n.parentNode}catch{return!1}return n!==e}var un={__proto__:null,on:U,off:W,stopPropagation:$t,disableScrollPropagation:en,disableClickPropagation:tn,preventDefault:nn,stop:rn,getPropagationPath:an,getMousePosition:on,getWheelDelta:cn,isExternalTarget:ln,addListener:U,removeListener:W},dn=ae.extend({run:function(e,t,n,r){this.stop(),this._el=e,this._inProgress=!0,this._duration=n||.25,this._easeOutPower=1/Math.max(r||.5,.2),this._startPos=Pt(e),this._offset=t.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=w(this._animate,this),this._step()},_step:function(e){var t=+new Date-this._startTime,n=this._duration*1e3;tthis.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,t){this._enforcingBounds=!0;var n=this.getCenter(),r=this._limitCenter(n,this._zoom,j(e));return n.equals(r)||this.panTo(r,t),this._enforcingBounds=!1,this},panInside:function(e,t){t||={};var n=D(t.paddingTopLeft||t.padding||[0,0]),r=D(t.paddingBottomRight||t.padding||[0,0]),i=this.project(this.getCenter()),a=this.project(e),o=this.getPixelBounds(),s=k([o.min.add(n),o.max.subtract(r)]),c=s.getSize();if(!s.contains(a)){this._enforcingBounds=!0;var l=a.subtract(s.getCenter()),u=s.extend(a).getSize().subtract(c);i.x+=l.x<0?-u.x:u.x,i.y+=l.y<0?-u.y:u.y,this.panTo(this.unproject(i),t),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=n({animate:!1,pan:!0},e===!0?{animate:!0}:e);var t=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var r=this.getSize(),a=t.divideBy(2).round(),o=r.divideBy(2).round(),s=a.subtract(o);return!s.x&&!s.y?this:(e.animate&&e.pan?this.panBy(s):(e.pan&&this._rawPanBy(s),this.fire(`move`),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(i(this.fire,this,`moveend`),200)):this.fire(`moveend`)),this.fire(`resize`,{oldSize:t,newSize:r}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire(`viewreset`),this._stop()},locate:function(e){if(e=this._locateOptions=n({timeout:1e4,watch:!1},e),!(`geolocation`in navigator))return this._handleGeolocationError({code:0,message:`Geolocation not supported.`}),this;var t=i(this._handleGeolocationResponse,this),r=i(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(t,r,e):navigator.geolocation.getCurrentPosition(t,r,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var t=e.code,n=e.message||(t===1?`permission denied`:t===2?`position unavailable`:`timeout`);this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire(`locationerror`,{code:t,message:`Geolocation error: `+n+`.`})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var t=e.coords.latitude,n=e.coords.longitude,r=new M(t,n),i=r.toBounds(e.coords.accuracy*2),a=this._locateOptions;if(a.setView){var o=this.getBoundsZoom(i);this.setView(r,a.maxZoom?Math.min(o,a.maxZoom):o)}var s={latlng:r,bounds:i,timestamp:e.timestamp};for(var c in e.coords)typeof e.coords[c]==`number`&&(s[c]=e.coords[c]);this.fire(`locationfound`,s)}},addHandler:function(e,t){if(!t)return this;var n=this[e]=new t(this);return this._handlers.push(n),this.options[e]&&n.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off(`moveend`,this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw 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}for(var e in this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),B(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&=(te(this._resizeRequest),null),this._clearHandlers(),this._loaded&&this.fire(`unload`),this._layers)this._layers[e].remove();for(e in this._panes)B(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,t){var n=z(`div`,`leaflet-pane`+(e?` leaflet-`+e.replace(`Pane`,``)+`-pane`:``),t||this._mapPane);return e&&(this._panes[e]=n),n},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var e=this.getPixelBounds();return new A(this.unproject(e.getBottomLeft()),this.unproject(e.getTopRight()))},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(e,t,n){e=j(e),n=D(n||[0,0]);var r=this.getZoom()||0,i=this.getMinZoom(),a=this.getMaxZoom(),o=e.getNorthWest(),s=e.getSouthEast(),c=this.getSize().subtract(n),l=k(this.project(s,r),this.project(o,r)).getSize(),u=R.any3d?this.options.zoomSnap:1,d=c.x/l.x,f=c.y/l.y,p=t?Math.max(d,f):Math.min(d,f);return r=this.getScaleZoom(p,r),u&&(r=Math.round(r/(u/100))*(u/100),r=t?Math.ceil(r/u)*u:Math.floor(r/u)*u),Math.max(i,Math.min(a,r))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new E(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,t){var n=this._getTopLeftPoint(e,t);return new O(n,n.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(e===void 0?this.getZoom():e)},getPane:function(e){return typeof e==`string`?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,t){var n=this.options.crs;return t=t===void 0?this._zoom:t,n.scale(e)/n.scale(t)},getScaleZoom:function(e,t){var n=this.options.crs;t=t===void 0?this._zoom:t;var r=n.zoom(e*n.scale(t));return isNaN(r)?1/0:r},project:function(e,t){return t=t===void 0?this._zoom:t,this.options.crs.latLngToPoint(N(e),t)},unproject:function(e,t){return t=t===void 0?this._zoom:t,this.options.crs.pointToLatLng(D(e),t)},layerPointToLatLng:function(e){var t=D(e).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(e){return this.project(N(e))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(N(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(j(e))},distance:function(e,t){return this.options.crs.distance(N(e),N(t))},containerPointToLayerPoint:function(e){return D(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return D(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var t=this.containerPointToLayerPoint(D(e));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(N(e)))},mouseEventToContainerPoint:function(e){return on(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var t=this._container=xt(e);if(!t)throw Error(`Map container not found.`);if(t._leaflet_id)throw Error(`Map container is already initialized.`);U(t,`scroll`,this._onScroll,this),this._containerId=o(t)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&R.any3d,V(e,`leaflet-container`+(R.touch?` leaflet-touch`:``)+(R.retina?` leaflet-retina`:``)+(R.ielt9?` leaflet-oldie`:``)+(R.safari?` leaflet-safari`:``)+(this._fadeAnimated?` leaflet-fade-anim`:``));var t=St(e,`position`);t!==`absolute`&&t!==`relative`&&t!==`fixed`&&t!==`sticky`&&(e.style.position=`relative`),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane(`mapPane`,this._container),Nt(this._mapPane,new E(0,0)),this.createPane(`tilePane`),this.createPane(`overlayPane`),this.createPane(`shadowPane`),this.createPane(`markerPane`),this.createPane(`tooltipPane`),this.createPane(`popupPane`),this.options.markerZoomAnimation||(V(e.markerPane,`leaflet-zoom-hide`),V(e.shadowPane,`leaflet-zoom-hide`))},_resetView:function(e,t,n){Nt(this._mapPane,new E(0,0));var r=!this._loaded;this._loaded=!0,t=this._limitZoom(t),this.fire(`viewprereset`);var i=this._zoom!==t;this._moveStart(i,n)._move(e,t)._moveEnd(i),this.fire(`viewreset`),r&&this.fire(`load`)},_moveStart:function(e,t){return e&&this.fire(`zoomstart`),t||this.fire(`movestart`),this},_move:function(e,t,n,r){t===void 0&&(t=this._zoom);var i=this._zoom!==t;return this._zoom=t,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),r?n&&n.pinch&&this.fire(`zoom`,n):((i||n&&n.pinch)&&this.fire(`zoom`,n),this.fire(`move`,n)),this},_moveEnd:function(e){return e&&this.fire(`zoomend`),this.fire(`moveend`)},_stop:function(){return te(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){Nt(this._mapPane,this._getMapPanePos().subtract(e))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw Error(`Set map center and zoom first.`)},_initEvents:function(e){this._targets={},this._targets[o(this._container)]=this;var t=e?W:U;t(this._container,`click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup`,this._handleDOMEvent,this),this.options.trackResize&&t(window,`resize`,this._onResize,this),R.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,`moveend`,this._onMoveEnd)},_onResize:function(){te(this._resizeRequest),this._resizeRequest=w(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,t){for(var n=[],r,i=t===`mouseout`||t===`mouseover`,a=e.target||e.srcElement,s=!1;a;){if(r=this._targets[o(a)],r&&(t===`click`||t===`preclick`)&&this._draggableMoved(r)){s=!0;break}if(r&&r.listens(t,!0)&&(i&&!ln(a,e)||(n.push(r),i))||a===this._container)break;a=a.parentNode}return!n.length&&!s&&!i&&this.listens(t,!0)&&(n=[this]),n},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var t=e.target||e.srcElement;if(!(!this._loaded||t._leaflet_disable_events||e.type===`click`&&this._isClickDisabled(t))){var n=e.type;n===`mousedown`&&Ut(t),this._fireDOMEvent(e,n)}},_mouseEvents:[`click`,`dblclick`,`mouseover`,`mouseout`,`contextmenu`],_fireDOMEvent:function(e,t,r){if(e.type===`click`){var i=n({},e);i.type=`preclick`,this._fireDOMEvent(i,i.type,r)}var a=this._findEventTargets(e,t);if(r){for(var o=[],s=0;s0?Math.round(e-t)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(t))},_limitZoom:function(e){var t=this.getMinZoom(),n=this.getMaxZoom(),r=R.any3d?this.options.zoomSnap:1;return r&&(e=Math.round(e/r)*r),Math.max(t,Math.min(n,e))},_onPanTransitionStep:function(){this.fire(`move`)},_onPanTransitionEnd:function(){H(this._mapPane,`leaflet-pan-anim`),this.fire(`moveend`)},_tryAnimatedPan:function(e,t){var n=this._getCenterOffset(e)._trunc();return(t&&t.animate)!==!0&&!this.getSize().contains(n)?!1:(this.panBy(n,t),!0)},_createAnimProxy:function(){var e=this._proxy=z(`div`,`leaflet-proxy leaflet-zoom-animated`);this._panes.mapPane.appendChild(e),this.on(`zoomanim`,function(e){var t=vt,n=this._proxy.style[t];Mt(this._proxy,this.project(e.center,e.zoom),this.getZoomScale(e.zoom,1)),n===this._proxy.style[t]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on(`load moveend`,this._animMoveEnd,this),this._on(`unload`,this._destroyAnimProxy,this)},_destroyAnimProxy:function(){B(this._proxy),this.off(`load moveend`,this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),t=this.getZoom();Mt(this._proxy,this.project(e,t),this.getZoomScale(t,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf(`transform`)>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName(`leaflet-zoom-animated`).length},_tryAnimatedZoom:function(e,t,n){if(this._animatingZoom)return!0;if(n||={},!this._zoomAnimated||n.animate===!1||this._nothingToAnimate()||Math.abs(t-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(t),i=this._getCenterOffset(e)._divideBy(1-1/r);return n.animate!==!0&&!this.getSize().contains(i)?!1:(w(function(){this._moveStart(!0,n.noMoveStart||!1)._animateZoom(e,t,!0)},this),!0)},_animateZoom:function(e,t,n,r){this._mapPane&&(n&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=t,V(this._mapPane,`leaflet-zoom-anim`)),this.fire(`zoomanim`,{center:e,zoom:t,noUpdate:r}),this._tempFireZoomEvent||=this._zoom!==this._animateToZoom,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(i(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&H(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 fn(e,t){return new G(e,t)}var pn=T.extend({options:{position:`topright`},initialize:function(e){p(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var t=this._map;return t&&t.removeControl(this),this.options.position=e,t&&t.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var t=this._container=this.onAdd(e),n=this.getPosition(),r=e._controlCorners[n];return V(t,`leaflet-control`),n.indexOf(`bottom`)===-1?r.appendChild(t):r.insertBefore(t,r.firstChild),this._map.on(`unload`,this.remove,this),this},remove:function(){return this._map?(B(this._container),this.onRemove&&this.onRemove(this._map),this._map.off(`unload`,this.remove,this),this._map=null,this):this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),mn=function(e){return new pn(e)};G.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},t=`leaflet-`,n=this._controlContainer=z(`div`,t+`control-container`,this._container);function r(r,i){var a=t+r+` `+t+i;e[r+i]=z(`div`,a,n)}r(`top`,`left`),r(`top`,`right`),r(`bottom`,`left`),r(`bottom`,`right`)},_clearControlPos:function(){for(var e in this._controlCorners)B(this._controlCorners[e]);B(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var hn=pn.extend({options:{collapsed:!0,position:`topright`,autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,t,n,r){return n1,this._baseLayersList.style.display=e?``:`none`),this._separator.style.display=t&&e?``:`none`,this},_onLayerChange:function(e){this._handlingClick||this._update();var t=this._getLayer(o(e.target)),n=t.overlay?e.type===`add`?`overlayadd`:`overlayremove`:e.type===`add`?`baselayerchange`:null;n&&this._map.fire(n,t)},_createRadioElement:function(e,t){var n=``,r=document.createElement(`div`);return r.innerHTML=n,r.firstChild},_addItem:function(e){var t=document.createElement(`label`),n=this._map.hasLayer(e.layer),r;e.overlay?(r=document.createElement(`input`),r.type=`checkbox`,r.className=`leaflet-control-layers-selector`,r.defaultChecked=n):r=this._createRadioElement(`leaflet-base-layers_`+o(this),n),this._layerControlInputs.push(r),r.layerId=o(e.layer),U(r,`click`,this._onInputClick,this);var i=document.createElement(`span`);i.innerHTML=` `+e.name;var a=document.createElement(`span`);return t.appendChild(a),a.appendChild(r),a.appendChild(i),(e.overlay?this._overlaysList:this._baseLayersList).appendChild(t),this._checkDisabledLayers(),t},_onInputClick:function(){if(!this._preventClick){var e=this._layerControlInputs,t,n,r=[],i=[];this._handlingClick=!0;for(var a=e.length-1;a>=0;a--)t=e[a],n=this._getLayer(t.layerId).layer,t.checked?r.push(n):t.checked||i.push(n);for(a=0;a=0;i--)t=e[i],n=this._getLayer(t.layerId).layer,t.disabled=n.options.minZoom!==void 0&&rn.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,U(e,`click`,nn),this.expand();var t=this;setTimeout(function(){W(e,`click`,nn),t._preventClick=!1})}}),gn=function(e,t,n){return new hn(e,t,n)},_n=pn.extend({options:{position:`topleft`,zoomInText:``,zoomInTitle:`Zoom in`,zoomOutText:``,zoomOutTitle:`Zoom out`},onAdd:function(e){var t=`leaflet-control-zoom`,n=z(`div`,t+` leaflet-bar`),r=this.options;return this._zoomInButton=this._createButton(r.zoomInText,r.zoomInTitle,t+`-in`,n,this._zoomIn),this._zoomOutButton=this._createButton(r.zoomOutText,r.zoomOutTitle,t+`-out`,n,this._zoomOut),this._updateDisabled(),e.on(`zoomend zoomlevelschange`,this._updateDisabled,this),n},onRemove:function(e){e.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(e){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,t,n,r,i){var a=z(`a`,n,r);return a.innerHTML=e,a.href=`#`,a.title=t,a.setAttribute(`role`,`button`),a.setAttribute(`aria-label`,t),tn(a),U(a,`click`,rn),U(a,`click`,i,this),U(a,`click`,this._refocusOnMap,this),a},_updateDisabled:function(){var e=this._map,t=`leaflet-disabled`;H(this._zoomInButton,t),H(this._zoomOutButton,t),this._zoomInButton.setAttribute(`aria-disabled`,`false`),this._zoomOutButton.setAttribute(`aria-disabled`,`false`),(this._disabled||e._zoom===e.getMinZoom())&&(V(this._zoomOutButton,t),this._zoomOutButton.setAttribute(`aria-disabled`,`true`)),(this._disabled||e._zoom===e.getMaxZoom())&&(V(this._zoomInButton,t),this._zoomInButton.setAttribute(`aria-disabled`,`true`))}});G.mergeOptions({zoomControl:!0}),G.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new _n,this.addControl(this.zoomControl))});var vn=function(e){return new _n(e)},yn=pn.extend({options:{position:`bottomleft`,maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var t=`leaflet-control-scale`,n=z(`div`,t),r=this.options;return this._addScales(r,t+`-line`,n),e.on(r.updateWhenIdle?`moveend`:`move`,this._update,this),e.whenReady(this._update,this),n},onRemove:function(e){e.off(this.options.updateWhenIdle?`moveend`:`move`,this._update,this)},_addScales:function(e,t,n){e.metric&&(this._mScale=z(`div`,t,n)),e.imperial&&(this._iScale=z(`div`,t,n))},_update:function(){var e=this._map,t=e.getSize().y/2,n=e.distance(e.containerPointToLatLng([0,t]),e.containerPointToLatLng([this.options.maxWidth,t]));this._updateScales(n)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var t=this._getRoundNum(e),n=t<1e3?t+` m`:t/1e3+` km`;this._updateScale(this._mScale,n,t/e)},_updateImperial:function(e){var t=e*3.2808399,n,r,i;t>5280?(n=t/5280,r=this._getRoundNum(n),this._updateScale(this._iScale,r+` mi`,r/n)):(i=this._getRoundNum(t),this._updateScale(this._iScale,i+` ft`,i/t))},_updateScale:function(e,t,n){e.style.width=Math.round(this.options.maxWidth*n)+`px`,e.innerHTML=t},_getRoundNum:function(e){var t=10**((Math.floor(e)+``).length-1),n=e/t;return n=n>=10?10:n>=5?5:n>=3?3:n>=2?2:1,t*n}}),bn=function(e){return new yn(e)},xn=pn.extend({options:{position:`bottomright`,prefix:``+(R.inlineSvg?` `:``)+`Leaflet`},initialize:function(e){p(this,e),this._attributions={}},onAdd:function(e){for(var t in e.attributionControl=this,this._container=z(`div`,`leaflet-control-attribution`),tn(this._container),e._layers)e._layers[t].getAttribution&&this.addAttribution(e._layers[t].getAttribution());return this._update(),e.on(`layeradd`,this._addAttribution,this),this._container},onRemove:function(e){e.off(`layeradd`,this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once(`remove`,function(){this.removeAttribution(e.layer.getAttribution())},this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e&&this._attributions[e]&&(this._attributions[e]--,this._update()),this},_update:function(){if(this._map){var e=[];for(var t in this._attributions)this._attributions[t]&&e.push(t);var n=[];this.options.prefix&&n.push(this.options.prefix),e.length&&n.push(e.join(`, `)),this._container.innerHTML=n.join(` `)}}});G.mergeOptions({attributionControl:!0}),G.addInitHook(function(){this.options.attributionControl&&new xn().addTo(this)}),pn.Layers=hn,pn.Zoom=_n,pn.Scale=yn,pn.Attribution=xn,mn.layers=gn,mn.zoom=vn,mn.scale=bn,mn.attribution=function(e){return new xn(e)};var Sn=T.extend({initialize:function(e){this._map=e},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}});Sn.addTo=function(e,t){return e.addHandler(t,this),this};var Cn={Events:ie},wn=R.touch?`touchstart mousedown`:`mousedown`,Tn=ae.extend({options:{clickTolerance:3},initialize:function(e,t,n,r){p(this,r),this._element=e,this._dragStartTarget=t||e,this._preventOutline=n},enable:function(){this._enabled||=(U(this._dragStartTarget,wn,this._onDown,this),!0)},disable:function(){this._enabled&&(Tn._dragging===this&&this.finishDrag(!0),W(this._dragStartTarget,wn,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!Et(this._element,`leaflet-zoom-anim`))){if(e.touches&&e.touches.length!==1){Tn._dragging===this&&this.finishDrag();return}if(!(Tn._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(Tn._dragging=this,this._preventOutline&&Ut(this._element),zt(),Ft(),!this._moving)){this.fire(`down`);var t=e.touches?e.touches[0]:e,n=Gt(this._element);this._startPoint=new E(t.clientX,t.clientY),this._startPos=Pt(this._element),this._parentScale=Kt(n);var r=e.type===`mousedown`;U(document,r?`mousemove`:`touchmove`,this._onMove,this),U(document,r?`mouseup`:`touchend touchcancel`,this._onUp,this)}}},_onMove:function(e){if(this._enabled){if(e.touches&&e.touches.length>1){this._moved=!0;return}var t=e.touches&&e.touches.length===1?e.touches[0]:e,n=new E(t.clientX,t.clientY)._subtract(this._startPoint);!n.x&&!n.y||Math.abs(n.x)+Math.abs(n.y)a&&(o=s,a=c);a>n&&(t[o]=1,Pn(e,t,n,r,o),Pn(e,t,n,o,i))}function Fn(e,t){for(var n=[e[0]],r=1,i=0,a=e.length;rt&&(n.push(e[r]),i=r);return it.max.x&&(n|=2),e.yt.max.y&&(n|=8),n}function Bn(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r}function Vn(e,t,n,r){var i=t.x,a=t.y,o=n.x-i,s=n.y-a,c=o*o+s*s,l;return c>0&&(l=((e.x-i)*o+(e.y-a)*s)/c,l>1?(i=n.x,a=n.y):l>0&&(i+=o*l,a+=s*l)),o=e.x-i,s=e.y-a,r?o*o+s*s:new E(i,a)}function Hn(e){return!_(e[0])||typeof e[0][0]!=`object`&&e[0][0]!==void 0}function Un(e){return console.warn(`Deprecated use of _flat, please use L.LineUtil.isFlat instead.`),Hn(e)}function Wn(e,t){var n,r,i,a,o,s,c,l;if(!e||e.length===0)throw Error(`latlngs not passed`);Hn(e)||(console.warn(`latlngs are not flat! Only the first ring will be used`),e=e[0]);var u=N([0,0]),d=j(e);d.getNorthWest().distanceTo(d.getSouthWest())*d.getNorthEast().distanceTo(d.getNorthWest())<1700&&(u=On(e));var f=e.length,p=[];for(n=0;nr){c=(a-r)/i,l=[s.x-c*(s.x-o.x),s.y-c*(s.y-o.y)];break}var h=t.unproject(D(l));return N([h.lat+u.lat,h.lng+u.lng])}var Gn={__proto__:null,simplify:An,pointToSegmentDistance:jn,closestPointOnSegment:Mn,clipSegment:Ln,_getEdgeIntersection:Rn,_getBitCode:zn,_sqClosestPointOnSegment:Vn,isFlat:Hn,_flat:Un,polylineCenter:Wn},Kn={project:function(e){return new E(e.lng,e.lat)},unproject:function(e){return new M(e.y,e.x)},bounds:new O([-180,-90],[180,90])},qn={R:6378137,R_MINOR:6356752.314245179,bounds:new O([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(e){var t=Math.PI/180,n=this.R,r=e.lat*t,i=this.R_MINOR/n,a=Math.sqrt(1-i*i),o=a*Math.sin(r),s=Math.tan(Math.PI/4-r/2)/((1-o)/(1+o))**(a/2);return r=-n*Math.log(Math.max(s,1e-10)),new E(e.lng*t*n,r)},unproject:function(e){for(var t=180/Math.PI,n=this.R,r=this.R_MINOR/n,i=Math.sqrt(1-r*r),a=Math.exp(-e.y/n),o=Math.PI/2-2*Math.atan(a),s=0,c=.1,l;s<15&&Math.abs(c)>1e-7;s++)l=i*Math.sin(o),l=((1-l)/(1+l))**(i/2),c=Math.PI/2-2*Math.atan(a*l)-o,o+=c;return new M(o*t,e.x*t/n)}},Jn={__proto__:null,LonLat:Kn,Mercator:qn,SphericalMercator:le},Yn=n({},ce,{code:`EPSG:3395`,projection:qn,transformation:function(){var e=.5/(Math.PI*qn.R);return de(e,.5,-e,.5)}()}),Xn=n({},ce,{code:`EPSG:4326`,projection:Kn,transformation:de(1/180,1,-1/180,.5)}),Zn=n({},se,{projection:Kn,transformation:de(1,0,-1,0),scale:function(e){return 2**e},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,t){var n=t.lng-e.lng,r=t.lat-e.lat;return Math.sqrt(n*n+r*r)},infinite:!0});se.Earth=ce,se.EPSG3395=Yn,se.EPSG3857=fe,se.EPSG900913=pe,se.EPSG4326=Xn,se.Simple=Zn;var Qn=ae.extend({options:{pane:`overlayPane`,attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[o(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[o(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var t=e.target;if(t.hasLayer(this)){if(this._map=t,this._zoomAnimated=t._zoomAnimated,this.getEvents){var n=this.getEvents();t.on(n,this),this.once(`remove`,function(){t.off(n,this)},this)}this.onAdd(t),this.fire(`add`),t.fire(`layeradd`,{layer:this})}}});G.include({addLayer:function(e){if(!e._layerAdd)throw Error(`The provided object is not a Layer.`);var t=o(e);return this._layers[t]?this:(this._layers[t]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e),this)},removeLayer:function(e){var t=o(e);return this._layers[t]?(this._loaded&&e.onRemove(this),delete this._layers[t],this._loaded&&(this.fire(`layerremove`,{layer:e}),e.fire(`remove`)),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return o(e)in this._layers},eachLayer:function(e,t){for(var n in this._layers)e.call(t,this._layers[n]);return this},_addLayers:function(e){e=e?_(e)?e:[e]:[];for(var t=0,n=e.length;tthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&t[0]instanceof M&&t[0].equals(t[n-1])&&t.pop(),t},_setLatLngs:function(e){mr.prototype._setLatLngs.call(this,e),Hn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Hn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,t=this.options.weight,n=new E(t,t);if(e=new O(e.min.subtract(n),e.max.add(n)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}for(var r=0,i=this._rings.length,a;re.y!=i.y>e.y&&e.x<(i.x-r.x)*(e.y-r.y)/(i.y-r.y)+r.x&&(t=!t);return t||mr.prototype._containsPoint.call(this,e,!0)}});function _r(e,t){return new gr(e,t)}var vr=tr.extend({initialize:function(e,t){p(this,t),this._layers={},e&&this.addData(e)},addData:function(e){var t=_(e)?e:e.features,n,r,i;if(t){for(n=0,r=t.length;n0&&i.push(i[0].slice()),i}function Tr(e,t){return e.feature?n({},e.feature,{geometry:t}):Er(t)}function Er(e){return e.type===`Feature`||e.type===`FeatureCollection`?e:{type:`Feature`,properties:{},geometry:e}}var Dr={toGeoJSON:function(e){return Tr(this,{type:`Point`,coordinates:Cr(this.getLatLng(),e)})}};sr.include(Dr),fr.include(Dr),ur.include(Dr),mr.include({toGeoJSON:function(e){var t=!Hn(this._latlngs),n=wr(this._latlngs,t?1:0,!1,e);return Tr(this,{type:(t?`Multi`:``)+`LineString`,coordinates:n})}}),gr.include({toGeoJSON:function(e){var t=!Hn(this._latlngs),n=t&&!Hn(this._latlngs[0]),r=wr(this._latlngs,n?2:t?1:0,!0,e);return t||(r=[r]),Tr(this,{type:(n?`Multi`:``)+`Polygon`,coordinates:r})}}),$n.include({toMultiPoint:function(e){var t=[];return this.eachLayer(function(n){t.push(n.toGeoJSON(e).geometry.coordinates)}),Tr(this,{type:`MultiPoint`,coordinates:t})},toGeoJSON:function(e){var t=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(t===`MultiPoint`)return this.toMultiPoint(e);var n=t===`GeometryCollection`,r=[];return this.eachLayer(function(t){if(t.toGeoJSON){var i=t.toGeoJSON(e);if(n)r.push(i.geometry);else{var a=Er(i);a.type===`FeatureCollection`?r.push.apply(r,a.features):r.push(a)}}}),n?Tr(this,{geometries:r,type:`GeometryCollection`}):{type:`FeatureCollection`,features:r}}});function Or(e,t){return new vr(e,t)}var kr=Or,Ar=Qn.extend({options:{opacity:1,alt:``,interactive:!1,crossOrigin:!1,errorOverlayUrl:``,zIndex:1,className:``},initialize:function(e,t,n){this._url=e,this._bounds=j(t),p(this,n)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(V(this._image,`leaflet-interactive`),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){B(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(e){return this.options.opacity=e,this._image&&this._updateOpacity(),this},setStyle:function(e){return e.opacity&&this.setOpacity(e.opacity),this},bringToFront:function(){return this._map&&wt(this._image),this},bringToBack:function(){return this._map&&Tt(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=j(e),this._map&&this._reset(),this},getEvents:function(){var e={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var e=this._url.tagName===`IMG`,t=this._image=e?this._url:z(`img`);if(V(t,`leaflet-image-layer`),this._zoomAnimated&&V(t,`leaflet-zoom-animated`),this.options.className&&V(t,this.options.className),t.onselectstart=l,t.onmousemove=l,t.onload=i(this.fire,this,`load`),t.onerror=i(this._overlayOnError,this,`error`),(this.options.crossOrigin||this.options.crossOrigin===``)&&(t.crossOrigin=this.options.crossOrigin===!0?``:this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),e){this._url=t.src;return}t.src=this._url,t.alt=this.options.alt},_animateZoom:function(e){var t=this._map.getZoomScale(e.zoom),n=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;Mt(this._image,n,t)},_reset:function(){var e=this._image,t=new O(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),n=t.getSize();Nt(e,t.min),e.style.width=n.x+`px`,e.style.height=n.y+`px`},_updateOpacity:function(){kt(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 e=this.options.errorOverlayUrl;e&&this._url!==e&&(this._url=e,this._image.src=e)},getCenter:function(){return this._bounds.getCenter()}}),jr=function(e,t,n){return new Ar(e,t,n)},Mr=Ar.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var e=this._url.tagName===`VIDEO`,t=this._image=e?this._url:z(`video`);if(V(t,`leaflet-image-layer`),this._zoomAnimated&&V(t,`leaflet-zoom-animated`),this.options.className&&V(t,this.options.className),t.onselectstart=l,t.onmousemove=l,t.onloadeddata=i(this.fire,this,`load`),e){for(var n=t.getElementsByTagName(`source`),r=[],a=0;a0?r:[t.src];return}_(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(t.style,`objectFit`)&&(t.style.objectFit=`fill`),t.autoplay=!!this.options.autoplay,t.loop=!!this.options.loop,t.muted=!!this.options.muted,t.playsInline=!!this.options.playsInline;for(var o=0;o