agvmap-react
Version:
A tool designed to visualize geospatial data on a map, integrating custom layers fetched from a REST API, and displaying relevant time-series data. This project is built using React, with `react-map-gl` for map integration.
81 lines (79 loc) • 2.26 MB
JavaScript
(function(va,H){typeof exports=="object"&&typeof module<"u"?H(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],H):(va=typeof globalThis<"u"?globalThis:va||self,H(va["agvmap-react"]={},va.React,va.ReactDOM))})(this,function(va,H,La){"use strict";var BPe=Object.defineProperty;var jPe=(va,H,La)=>H in va?BPe(va,H,{enumerable:!0,configurable:!0,writable:!0,value:La}):va[H]=La;var ZF=(va,H,La)=>jPe(va,typeof H!="symbol"?H+"":H,La);var cj,uj,hj;function PM(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}function qF(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const Ae=PM(H),OM=PM(La);var _c=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qb={exports:{}},af={};/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var kM;function JF(){if(kM)return af;kM=1;var e=H,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function c(a,d,p){var y,g={},v=null,w=null;p!==void 0&&(v=""+p),d.key!==void 0&&(v=""+d.key),d.ref!==void 0&&(w=d.ref);for(y in d)n.call(d,y)&&!s.hasOwnProperty(y)&&(g[y]=d[y]);if(a&&a.defaultProps)for(y in d=a.defaultProps,d)g[y]===void 0&&(g[y]=d[y]);return{$$typeof:t,type:a,key:v,ref:w,props:g,_owner:i.current}}return af.Fragment=r,af.jsx=c,af.jsxs=c,af}var sf={};/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var DM;function KF(){return DM||(DM=1,process.env.NODE_ENV!=="production"&&function(){var e=H,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),a=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),w=Symbol.for("react.offscreen"),S=Symbol.iterator,C="@@iterator";function M(Xe){if(Xe===null||typeof Xe!="object")return null;var Mt=S&&Xe[S]||Xe[C];return typeof Mt=="function"?Mt:null}var I=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function A(Xe){{for(var Mt=arguments.length,Ot=new Array(Mt>1?Mt-1:0),Vt=1;Vt<Mt;Vt++)Ot[Vt-1]=arguments[Vt];O("error",Xe,Ot)}}function O(Xe,Mt,Ot){{var Vt=I.ReactDebugCurrentFrame,Qt=Vt.getStackAddendum();Qt!==""&&(Mt+="%s",Ot=Ot.concat([Qt]));var br=Ot.map(function(pr){return String(pr)});br.unshift("Warning: "+Mt),Function.prototype.apply.call(console[Xe],console,br)}}var N=!1,D=!1,L=!1,R=!1,Y=!1,ie;ie=Symbol.for("react.module.reference");function re(Xe){return!!(typeof Xe=="string"||typeof Xe=="function"||Xe===n||Xe===s||Y||Xe===i||Xe===p||Xe===y||R||Xe===w||N||D||L||typeof Xe=="object"&&Xe!==null&&(Xe.$$typeof===v||Xe.$$typeof===g||Xe.$$typeof===c||Xe.$$typeof===a||Xe.$$typeof===d||Xe.$$typeof===ie||Xe.getModuleId!==void 0))}function W(Xe,Mt,Ot){var Vt=Xe.displayName;if(Vt)return Vt;var Qt=Mt.displayName||Mt.name||"";return Qt!==""?Ot+"("+Qt+")":Ot}function Z(Xe){return Xe.displayName||"Context"}function U(Xe){if(Xe==null)return null;if(typeof Xe.tag=="number"&&A("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof Xe=="function")return Xe.displayName||Xe.name||null;if(typeof Xe=="string")return Xe;switch(Xe){case n:return"Fragment";case r:return"Portal";case s:return"Profiler";case i:return"StrictMode";case p:return"Suspense";case y:return"SuspenseList"}if(typeof Xe=="object")switch(Xe.$$typeof){case a:var Mt=Xe;return Z(Mt)+".Consumer";case c:var Ot=Xe;return Z(Ot._context)+".Provider";case d:return W(Xe,Xe.render,"ForwardRef");case g:var Vt=Xe.displayName||null;return Vt!==null?Vt:U(Xe.type)||"Memo";case v:{var Qt=Xe,br=Qt._payload,pr=Qt._init;try{return U(pr(br))}catch{return null}}}return null}var B=Object.assign,F=0,q,K,Q,ae,J,pe,xe;function se(){}se.__reactDisabledLog=!0;function ge(){{if(F===0){q=console.log,K=console.info,Q=console.warn,ae=console.error,J=console.group,pe=console.groupCollapsed,xe=console.groupEnd;var Xe={configurable:!0,enumerable:!0,value:se,writable:!0};Object.defineProperties(console,{info:Xe,log:Xe,warn:Xe,error:Xe,group:Xe,groupCollapsed:Xe,groupEnd:Xe})}F++}}function Se(){{if(F--,F===0){var Xe={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:B({},Xe,{value:q}),info:B({},Xe,{value:K}),warn:B({},Xe,{value:Q}),error:B({},Xe,{value:ae}),group:B({},Xe,{value:J}),groupCollapsed:B({},Xe,{value:pe}),groupEnd:B({},Xe,{value:xe})})}F<0&&A("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ee=I.ReactCurrentDispatcher,$e;function le(Xe,Mt,Ot){{if($e===void 0)try{throw Error()}catch(Qt){var Vt=Qt.stack.trim().match(/\n( *(at )?)/);$e=Vt&&Vt[1]||""}return`
`+$e+Xe}}var ne=!1,fe;{var Me=typeof WeakMap=="function"?WeakMap:Map;fe=new Me}function X(Xe,Mt){if(!Xe||ne)return"";{var Ot=fe.get(Xe);if(Ot!==void 0)return Ot}var Vt;ne=!0;var Qt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var br;br=Ee.current,Ee.current=null,ge();try{if(Mt){var pr=function(){throw Error()};if(Object.defineProperty(pr.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pr,[])}catch(Pr){Vt=Pr}Reflect.construct(Xe,[],pr)}else{try{pr.call()}catch(Pr){Vt=Pr}Xe.call(pr.prototype)}}else{try{throw Error()}catch(Pr){Vt=Pr}Xe()}}catch(Pr){if(Pr&&Vt&&typeof Pr.stack=="string"){for(var Wt=Pr.stack.split(`
`),wr=Vt.stack.split(`
`),Cr=Wt.length-1,Or=wr.length-1;Cr>=1&&Or>=0&&Wt[Cr]!==wr[Or];)Or--;for(;Cr>=1&&Or>=0;Cr--,Or--)if(Wt[Cr]!==wr[Or]){if(Cr!==1||Or!==1)do if(Cr--,Or--,Or<0||Wt[Cr]!==wr[Or]){var nn=`
`+Wt[Cr].replace(" at new "," at ");return Xe.displayName&&nn.includes("<anonymous>")&&(nn=nn.replace("<anonymous>",Xe.displayName)),typeof Xe=="function"&&fe.set(Xe,nn),nn}while(Cr>=1&&Or>=0);break}}}finally{ne=!1,Ee.current=br,Se(),Error.prepareStackTrace=Qt}var Wn=Xe?Xe.displayName||Xe.name:"",Ui=Wn?le(Wn):"";return typeof Xe=="function"&&fe.set(Xe,Ui),Ui}function de(Xe,Mt,Ot){return X(Xe,!1)}function oe(Xe){var Mt=Xe.prototype;return!!(Mt&&Mt.isReactComponent)}function _e(Xe,Mt,Ot){if(Xe==null)return"";if(typeof Xe=="function")return X(Xe,oe(Xe));if(typeof Xe=="string")return le(Xe);switch(Xe){case p:return le("Suspense");case y:return le("SuspenseList")}if(typeof Xe=="object")switch(Xe.$$typeof){case d:return de(Xe.render);case g:return _e(Xe.type,Mt,Ot);case v:{var Vt=Xe,Qt=Vt._payload,br=Vt._init;try{return _e(br(Qt),Mt,Ot)}catch{}}}return""}var ce=Object.prototype.hasOwnProperty,ke={},je=I.ReactDebugCurrentFrame;function Re(Xe){if(Xe){var Mt=Xe._owner,Ot=_e(Xe.type,Xe._source,Mt?Mt.type:null);je.setExtraStackFrame(Ot)}else je.setExtraStackFrame(null)}function Ue(Xe,Mt,Ot,Vt,Qt){{var br=Function.call.bind(ce);for(var pr in Xe)if(br(Xe,pr)){var Wt=void 0;try{if(typeof Xe[pr]!="function"){var wr=Error((Vt||"React class")+": "+Ot+" type `"+pr+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof Xe[pr]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw wr.name="Invariant Violation",wr}Wt=Xe[pr](Mt,pr,Vt,Ot,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Cr){Wt=Cr}Wt&&!(Wt instanceof Error)&&(Re(Qt),A("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Vt||"React class",Ot,pr,typeof Wt),Re(null)),Wt instanceof Error&&!(Wt.message in ke)&&(ke[Wt.message]=!0,Re(Qt),A("Failed %s type: %s",Ot,Wt.message),Re(null))}}}var ct=Array.isArray;function at(Xe){return ct(Xe)}function De(Xe){{var Mt=typeof Symbol=="function"&&Symbol.toStringTag,Ot=Mt&&Xe[Symbol.toStringTag]||Xe.constructor.name||"Object";return Ot}}function Ie(Xe){try{return Ne(Xe),!1}catch{return!0}}function Ne(Xe){return""+Xe}function ze(Xe){if(Ie(Xe))return A("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",De(Xe)),Ne(Xe)}var Qe=I.ReactCurrentOwner,Ge={key:!0,ref:!0,__self:!0,__source:!0},it,ot;function ft(Xe){if(ce.call(Xe,"ref")){var Mt=Object.getOwnPropertyDescriptor(Xe,"ref").get;if(Mt&&Mt.isReactWarning)return!1}return Xe.ref!==void 0}function pt(Xe){if(ce.call(Xe,"key")){var Mt=Object.getOwnPropertyDescriptor(Xe,"key").get;if(Mt&&Mt.isReactWarning)return!1}return Xe.key!==void 0}function Ke(Xe,Mt){typeof Xe.ref=="string"&&Qe.current}function mt(Xe,Mt){{var Ot=function(){it||(it=!0,A("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Mt))};Ot.isReactWarning=!0,Object.defineProperty(Xe,"key",{get:Ot,configurable:!0})}}function wt(Xe,Mt){{var Ot=function(){ot||(ot=!0,A("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Mt))};Ot.isReactWarning=!0,Object.defineProperty(Xe,"ref",{get:Ot,configurable:!0})}}var Pt=function(Xe,Mt,Ot,Vt,Qt,br,pr){var Wt={$$typeof:t,type:Xe,key:Mt,ref:Ot,props:pr,_owner:br};return Wt._store={},Object.defineProperty(Wt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Wt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Vt}),Object.defineProperty(Wt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Qt}),Object.freeze&&(Object.freeze(Wt.props),Object.freeze(Wt)),Wt};function kt(Xe,Mt,Ot,Vt,Qt){{var br,pr={},Wt=null,wr=null;Ot!==void 0&&(ze(Ot),Wt=""+Ot),pt(Mt)&&(ze(Mt.key),Wt=""+Mt.key),ft(Mt)&&(wr=Mt.ref,Ke(Mt,Qt));for(br in Mt)ce.call(Mt,br)&&!Ge.hasOwnProperty(br)&&(pr[br]=Mt[br]);if(Xe&&Xe.defaultProps){var Cr=Xe.defaultProps;for(br in Cr)pr[br]===void 0&&(pr[br]=Cr[br])}if(Wt||wr){var Or=typeof Xe=="function"?Xe.displayName||Xe.name||"Unknown":Xe;Wt&&mt(pr,Or),wr&&wt(pr,Or)}return Pt(Xe,Wt,wr,Qt,Vt,Qe.current,pr)}}var bt=I.ReactCurrentOwner,Yt=I.ReactDebugCurrentFrame;function Dt(Xe){if(Xe){var Mt=Xe._owner,Ot=_e(Xe.type,Xe._source,Mt?Mt.type:null);Yt.setExtraStackFrame(Ot)}else Yt.setExtraStackFrame(null)}var fr;fr=!1;function Er(Xe){return typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===t}function He(){{if(bt.current){var Xe=U(bt.current.type);if(Xe)return`
Check the render method of \``+Xe+"`."}return""}}function Ce(Xe){return""}var be={};function Oe(Xe){{var Mt=He();if(!Mt){var Ot=typeof Xe=="string"?Xe:Xe.displayName||Xe.name;Ot&&(Mt=`
Check the top-level render call using <`+Ot+">.")}return Mt}}function Ve(Xe,Mt){{if(!Xe._store||Xe._store.validated||Xe.key!=null)return;Xe._store.validated=!0;var Ot=Oe(Mt);if(be[Ot])return;be[Ot]=!0;var Vt="";Xe&&Xe._owner&&Xe._owner!==bt.current&&(Vt=" It was passed a child from "+U(Xe._owner.type)+"."),Dt(Xe),A('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Ot,Vt),Dt(null)}}function rt(Xe,Mt){{if(typeof Xe!="object")return;if(at(Xe))for(var Ot=0;Ot<Xe.length;Ot++){var Vt=Xe[Ot];Er(Vt)&&Ve(Vt,Mt)}else if(Er(Xe))Xe._store&&(Xe._store.validated=!0);else if(Xe){var Qt=M(Xe);if(typeof Qt=="function"&&Qt!==Xe.entries)for(var br=Qt.call(Xe),pr;!(pr=br.next()).done;)Er(pr.value)&&Ve(pr.value,Mt)}}}function lt(Xe){{var Mt=Xe.type;if(Mt==null||typeof Mt=="string")return;var Ot;if(typeof Mt=="function")Ot=Mt.propTypes;else if(typeof Mt=="object"&&(Mt.$$typeof===d||Mt.$$typeof===g))Ot=Mt.propTypes;else return;if(Ot){var Vt=U(Mt);Ue(Ot,Xe.props,"prop",Vt,Xe)}else if(Mt.PropTypes!==void 0&&!fr){fr=!0;var Qt=U(Mt);A("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Qt||"Unknown")}typeof Mt.getDefaultProps=="function"&&!Mt.getDefaultProps.isReactClassApproved&&A("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ht(Xe){{for(var Mt=Object.keys(Xe.props),Ot=0;Ot<Mt.length;Ot++){var Vt=Mt[Ot];if(Vt!=="children"&&Vt!=="key"){Dt(Xe),A("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Vt),Dt(null);break}}Xe.ref!==null&&(Dt(Xe),A("Invalid attribute `ref` supplied to `React.Fragment`."),Dt(null))}}var Je={};function _t(Xe,Mt,Ot,Vt,Qt,br){{var pr=re(Xe);if(!pr){var Wt="";(Xe===void 0||typeof Xe=="object"&&Xe!==null&&Object.keys(Xe).length===0)&&(Wt+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var wr=Ce();wr?Wt+=wr:Wt+=He();var Cr;Xe===null?Cr="null":at(Xe)?Cr="array":Xe!==void 0&&Xe.$$typeof===t?(Cr="<"+(U(Xe.type)||"Unknown")+" />",Wt=" Did you accidentally export a JSX literal instead of a component?"):Cr=typeof Xe,A("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Cr,Wt)}var Or=kt(Xe,Mt,Ot,Qt,br);if(Or==null)return Or;if(pr){var nn=Mt.children;if(nn!==void 0)if(Vt)if(at(nn)){for(var Wn=0;Wn<nn.length;Wn++)rt(nn[Wn],Xe);Object.freeze&&Object.freeze(nn)}else A("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else rt(nn,Xe)}if(ce.call(Mt,"key")){var Ui=U(Xe),Pr=Object.keys(Mt).filter(function(Oi){return Oi!=="key"}),nl=Pr.length>0?"{key: someKey, "+Pr.join(": ..., ")+": ...}":"{key: someKey}";if(!Je[Ui+nl]){var cu=Pr.length>0?"{"+Pr.join(": ..., ")+": ...}":"{}";A(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`,nl,Ui,cu,Ui),Je[Ui+nl]=!0}}return Xe===n?ht(Or):lt(Or),Or}}function Et(Xe,Mt,Ot){return _t(Xe,Mt,Ot,!0)}function St(Xe,Mt,Ot){return _t(Xe,Mt,Ot,!1)}var Bt=St,ir=Et;sf.Fragment=n,sf.jsx=Bt,sf.jsxs=ir}()),sf}process.env.NODE_ENV==="production"?Qb.exports=JF():Qb.exports=KF();var G=Qb.exports;const LM=e=>{let t;const r=new Set,n=(y,g)=>{const v=typeof y=="function"?y(t):y;if(!Object.is(v,t)){const w=t;t=g??(typeof v!="object"||v===null)?v:Object.assign({},t,v),r.forEach(S=>S(t,w))}},i=()=>t,d={setState:n,getState:i,getInitialState:()=>p,subscribe:y=>(r.add(y),()=>r.delete(y)),destroy:()=>{r.clear()}},p=t=e(n,i,d);return d},QF=e=>e?LM(e):LM;var ex={exports:{}},tx={},pg={exports:{}},rx={};/**
* @license React
* use-sync-external-store-shim.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var NM;function e6(){if(NM)return rx;NM=1;var e=H;function t(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,s=e.useLayoutEffect,c=e.useDebugValue;function a(g,v){var w=v(),S=n({inst:{value:w,getSnapshot:v}}),C=S[0].inst,M=S[1];return s(function(){C.value=w,C.getSnapshot=v,d(C)&&M({inst:C})},[g,w,v]),i(function(){return d(C)&&M({inst:C}),g(function(){d(C)&&M({inst:C})})},[g]),c(w),w}function d(g){var v=g.getSnapshot;g=g.value;try{var w=v();return!r(g,w)}catch{return!0}}function p(g,v){return v()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:a;return rx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,rx}var nx={};/**
* @license React
* use-sync-external-store-shim.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var RM;function t6(){return RM||(RM=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=H,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function r(O){{for(var N=arguments.length,D=new Array(N>1?N-1:0),L=1;L<N;L++)D[L-1]=arguments[L];n("error",O,D)}}function n(O,N,D){{var L=t.ReactDebugCurrentFrame,R=L.getStackAddendum();R!==""&&(N+="%s",D=D.concat([R]));var Y=D.map(function(ie){return String(ie)});Y.unshift("Warning: "+N),Function.prototype.apply.call(console[O],console,Y)}}function i(O,N){return O===N&&(O!==0||1/O===1/N)||O!==O&&N!==N}var s=typeof Object.is=="function"?Object.is:i,c=e.useState,a=e.useEffect,d=e.useLayoutEffect,p=e.useDebugValue,y=!1,g=!1;function v(O,N,D){y||e.startTransition!==void 0&&(y=!0,r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var L=N();if(!g){var R=N();s(L,R)||(r("The result of getSnapshot should be cached to avoid an infinite loop"),g=!0)}var Y=c({inst:{value:L,getSnapshot:N}}),ie=Y[0].inst,re=Y[1];return d(function(){ie.value=L,ie.getSnapshot=N,w(ie)&&re({inst:ie})},[O,L,N]),a(function(){w(ie)&&re({inst:ie});var W=function(){w(ie)&&re({inst:ie})};return O(W)},[O]),p(L),L}function w(O){var N=O.getSnapshot,D=O.value;try{var L=N();return!s(D,L)}catch{return!0}}function S(O,N,D){return N()}var C=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",M=!C,I=M?S:v,A=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:I;nx.useSyncExternalStore=A,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),nx}var BM;function jM(){return BM||(BM=1,process.env.NODE_ENV==="production"?pg.exports=e6():pg.exports=t6()),pg.exports}/**
* @license React
* use-sync-external-store-shim/with-selector.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var FM;function r6(){if(FM)return tx;FM=1;var e=H,t=jM();function r(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var n=typeof Object.is=="function"?Object.is:r,i=t.useSyncExternalStore,s=e.useRef,c=e.useEffect,a=e.useMemo,d=e.useDebugValue;return tx.useSyncExternalStoreWithSelector=function(p,y,g,v,w){var S=s(null);if(S.current===null){var C={hasValue:!1,value:null};S.current=C}else C=S.current;S=a(function(){function I(L){if(!A){if(A=!0,O=L,L=v(L),w!==void 0&&C.hasValue){var R=C.value;if(w(R,L))return N=R}return N=L}if(R=N,n(O,L))return R;var Y=v(L);return w!==void 0&&w(R,Y)?R:(O=L,N=Y)}var A=!1,O,N,D=g===void 0?null:g;return[function(){return I(y())},D===null?void 0:function(){return I(D())}]},[y,g,v,w]);var M=i(p,S[0],S[1]);return c(function(){C.hasValue=!0,C.value=M},[M]),d(M),M},tx}var ix={};/**
* @license React
* use-sync-external-store-shim/with-selector.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var zM;function n6(){return zM||(zM=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=H,t=jM();function r(y,g){return y===g&&(y!==0||1/y===1/g)||y!==y&&g!==g}var n=typeof Object.is=="function"?Object.is:r,i=t.useSyncExternalStore,s=e.useRef,c=e.useEffect,a=e.useMemo,d=e.useDebugValue;function p(y,g,v,w,S){var C=s(null),M;C.current===null?(M={hasValue:!1,value:null},C.current=M):M=C.current;var I=a(function(){var D=!1,L,R,Y=function(Z){if(!D){D=!0,L=Z;var U=w(Z);if(S!==void 0&&M.hasValue){var B=M.value;if(S(B,U))return R=B,B}return R=U,U}var F=L,q=R;if(n(F,Z))return q;var K=w(Z);return S!==void 0&&S(q,K)?q:(L=Z,R=K,K)},ie=v===void 0?null:v,re=function(){return Y(g())},W=ie===null?void 0:function(){return Y(ie())};return[re,W]},[g,v,w,S]),A=I[0],O=I[1],N=i(y,A,O);return c(function(){M.hasValue=!0,M.value=N},[N]),d(N),N}ix.useSyncExternalStoreWithSelector=p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),ix}process.env.NODE_ENV==="production"?ex.exports=r6():ex.exports=n6();var i6=ex.exports;const a6=Qr(i6),{useDebugValue:s6}=H,{useSyncExternalStoreWithSelector:o6}=a6,l6=e=>e;function c6(e,t=l6,r){const n=o6(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return s6(n),n}const u6=e=>{const t=typeof e=="function"?QF(e):e,r=(n,i)=>c6(t,n,i);return Object.assign(r,t),r},h6=e=>u6(e),Ur={PICKER:"PICKER",NORMAL:"NORMAL",DRAW:"DRAW",EDIT_PLOT:"EDIT_PLOT",ADD_PLOT:"ADD_PLOT",ADD_MARKER:"ADD_MARKER",EDIT_MARKER:"EDIT_MARKER",ADD_NEW_FARM:"ADD_NEW_FARM"},Na={NORMAL:"NORMAL",COMPARISION_VIEW:"COMPARISION_VIEW"},$M={DEFAULT:"",POINTER:"pointer",CROSSHAIR:"crosshair",MOVE:"move",GRAB:"grab",GRABBING:"grabbing",TEXT:"text",WAIT:"wait",HELP:"help"},$t=h6(e=>({configs:{},setConfigs:t=>e({configs:t}),requestHeaders:void 0,setRequestHeaders:t=>e({requestHeaders:t}),setAccessToken:t=>e({accessToken:t}),sidebarExpanded:!0,setSidebarExpanded:t=>e({sidebarExpanded:t}),hoveredValue:null,setHoveredValue:t=>e({hoveredValue:t}),cursor:$M.DEFAULT,previousCursor:$M.DEFAULT,setCursor:t=>e(r=>({previousCursor:"grab",cursor:t})),resetCursor:()=>e(t=>({cursor:t.previousCursor})),viewMode:Ur.NORMAL,pickerData:null,setPickerData:t=>e({pickerData:t}),loadingNDVIImages:[],addLoadingNDVIImage:t=>e(r=>({loadingNDVIImages:[...r.loadingNDVIImages,t]})),removeLoadingNDVIImage:t=>e(r=>({loadingNDVIImages:r.loadingNDVIImages.filter(n=>n!==t)})),isNDVIImageLoading:t=>$t.getState().loadingNDVIImages.includes(t),setViewMode:t=>e({viewMode:t}),toPickerMode:()=>e({viewMode:Ur.PICKER}),toNormalMode:()=>e({viewMode:Ur.NORMAL}),toDrawMode:()=>e({viewMode:Ur.DRAW}),toggleNormalPickerMode:()=>e(t=>({viewMode:t.viewMode===Ur.NORMAL?Ur.PICKER:Ur.NORMAL})),cursorCords:[0,0],setCursorCords:t=>e({cursorCords:t}),rasterLayer:{value:"3_NDVI",label:"NDVI"},setRasterLayer:t=>e({rasterLayer:t}),rasterOpacity:100,setRasterOpacity:t=>e({rasterOpacity:t}),clickedMarker:null,setClickedMarker:t=>e({clickedMarker:t}),setShowCroppedImages:t=>e({showCroppedImages:t}),showCroppedImages:!1,datesLoading:!1,setDatesLoading:t=>e({datesLoading:t}),mapMode:Na.NORMAL,setMapMode:t=>e({mapMode:t}),dateRange:{start:new Date(Date.now()-30*24*60*60*1e3),end:new Date},dateRange2:{start:new Date(Date.now()-30*24*60*60*1e3),end:new Date},setDateRange:t=>e({dateRange:t}),setDateRange2:t=>e({dateRange2:t}),passDates:[],setPassDates:t=>e({passDates:t})}));console.log("configs are ",$t.getState().configs);const GM=[{id:"satellite",name:"Satellite",url:"https://api.maptiler.com/maps/satellite/style.json"},{id:"basic",name:"Basic",url:"https://api.maptiler.com/maps/basic-v2/style.json"}],as="https://agviewer.com/api/dashboard/",ax="https://agviewer.com/api",mg="https://d27s6pvwcjpmsu.cloudfront.net/geoserver/",gg=[{value:"3_NDVI",label:"NDVI"},{value:"2_FALSE_COLOR",label:"False color (vegetation) "},{value:"5-MOISTURE-INDEX1",label:"Moisture Index"},{value:"ET",label:"Evapotranspiration",url:`${mg}ne/wms?service=WMS&version=1.1.0&request=GetMap&layers=ne%3Aet_data&bbox={bbox-epsg-3857}&width=512&height=512&srs=EPSG%3A3857&styles=&format=image%2Fpng&transparent=TRUE`,getValueUrl:`${mg}ne/wfs?service=WFS&version=1.1.0&request=GetFeature&typeName=ne%3Aet_data&propertyName=*&srsName=EPSG:4326&filter=<Filter><Point><coordinates>{lon},{lat}</coordinates></Point></Filter>&outputFormat=application/json`,passDates:["2024-06-01","2024-11-14","2024-11-23","2024-12-07","2024-12-19"],getAvailableDates:async function(t){const r="https://d27s6pvwcjpmsu.cloudfront.net/geoserver/ne/wfs",[n,i,s,c]=t;console.log("wfs bbox",t),console.log("getting wfs dates");const a=`${r}?service=WFS&version=2.0.0&request=GetFeature&typeNames=ne:et_data_vector&bbox=${n},${i},${s},${c},EPSG:4326&PropertyName=ingestion&outputFormat=application/json`;try{const d=await fetch(a);if(!d.ok)throw new Error(`WFS request failed with status ${d.status}`);const p=await d.json();console.log("wfs data",p);const y=new Set;return p.features.forEach(v=>{v.properties&&v.properties.ingestion&&y.add(v.properties.ingestion)}),Array.from(y).sort().map(v=>new Date(v))}catch(d){return console.error("Error fetching available dates:",d),[]}}}];var sx={exports:{}},yg={exports:{}},hn={};/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var VM;function d6(){if(VM)return hn;VM=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,d=e?Symbol.for("react.async_mode"):60111,p=e?Symbol.for("react.concurrent_mode"):60111,y=e?Symbol.for("react.forward_ref"):60112,g=e?Symbol.for("react.suspense"):60113,v=e?Symbol.for("react.suspense_list"):60120,w=e?Symbol.for("react.memo"):60115,S=e?Symbol.for("react.lazy"):60116,C=e?Symbol.for("react.block"):60121,M=e?Symbol.for("react.fundamental"):60117,I=e?Symbol.for("react.responder"):60118,A=e?Symbol.for("react.scope"):60119;function O(D){if(typeof D=="object"&&D!==null){var L=D.$$typeof;switch(L){case t:switch(D=D.type,D){case d:case p:case n:case s:case i:case g:return D;default:switch(D=D&&D.$$typeof,D){case a:case y:case S:case w:case c:return D;default:return L}}case r:return L}}}function N(D){return O(D)===p}return hn.AsyncMode=d,hn.ConcurrentMode=p,hn.ContextConsumer=a,hn.ContextProvider=c,hn.Element=t,hn.ForwardRef=y,hn.Fragment=n,hn.Lazy=S,hn.Memo=w,hn.Portal=r,hn.Profiler=s,hn.StrictMode=i,hn.Suspense=g,hn.isAsyncMode=function(D){return N(D)||O(D)===d},hn.isConcurrentMode=N,hn.isContextConsumer=function(D){return O(D)===a},hn.isContextProvider=function(D){return O(D)===c},hn.isElement=function(D){return typeof D=="object"&&D!==null&&D.$$typeof===t},hn.isForwardRef=function(D){return O(D)===y},hn.isFragment=function(D){return O(D)===n},hn.isLazy=function(D){return O(D)===S},hn.isMemo=function(D){return O(D)===w},hn.isPortal=function(D){return O(D)===r},hn.isProfiler=function(D){return O(D)===s},hn.isStrictMode=function(D){return O(D)===i},hn.isSuspense=function(D){return O(D)===g},hn.isValidElementType=function(D){return typeof D=="string"||typeof D=="function"||D===n||D===p||D===s||D===i||D===g||D===v||typeof D=="object"&&D!==null&&(D.$$typeof===S||D.$$typeof===w||D.$$typeof===c||D.$$typeof===a||D.$$typeof===y||D.$$typeof===M||D.$$typeof===I||D.$$typeof===A||D.$$typeof===C)},hn.typeOf=O,hn}var dn={};/** @license React v16.13.1
* react-is.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var WM;function f6(){return WM||(WM=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,r=e?Symbol.for("react.portal"):60106,n=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,s=e?Symbol.for("react.profiler"):60114,c=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,d=e?Symbol.for("react.async_mode"):60111,p=e?Symbol.for("react.concurrent_mode"):60111,y=e?Symbol.for("react.forward_ref"):60112,g=e?Symbol.for("react.suspense"):60113,v=e?Symbol.for("react.suspense_list"):60120,w=e?Symbol.for("react.memo"):60115,S=e?Symbol.for("react.lazy"):60116,C=e?Symbol.for("react.block"):60121,M=e?Symbol.for("react.fundamental"):60117,I=e?Symbol.for("react.responder"):60118,A=e?Symbol.for("react.scope"):60119;function O(X){return typeof X=="string"||typeof X=="function"||X===n||X===p||X===s||X===i||X===g||X===v||typeof X=="object"&&X!==null&&(X.$$typeof===S||X.$$typeof===w||X.$$typeof===c||X.$$typeof===a||X.$$typeof===y||X.$$typeof===M||X.$$typeof===I||X.$$typeof===A||X.$$typeof===C)}function N(X){if(typeof X=="object"&&X!==null){var de=X.$$typeof;switch(de){case t:var oe=X.type;switch(oe){case d:case p:case n:case s:case i:case g:return oe;default:var _e=oe&&oe.$$typeof;switch(_e){case a:case y:case S:case w:case c:return _e;default:return de}}case r:return de}}}var D=d,L=p,R=a,Y=c,ie=t,re=y,W=n,Z=S,U=w,B=r,F=s,q=i,K=g,Q=!1;function ae(X){return Q||(Q=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),J(X)||N(X)===d}function J(X){return N(X)===p}function pe(X){return N(X)===a}function xe(X){return N(X)===c}function se(X){return typeof X=="object"&&X!==null&&X.$$typeof===t}function ge(X){return N(X)===y}function Se(X){return N(X)===n}function Ee(X){return N(X)===S}function $e(X){return N(X)===w}function le(X){return N(X)===r}function ne(X){return N(X)===s}function fe(X){return N(X)===i}function Me(X){return N(X)===g}dn.AsyncMode=D,dn.ConcurrentMode=L,dn.ContextConsumer=R,dn.ContextProvider=Y,dn.Element=ie,dn.ForwardRef=re,dn.Fragment=W,dn.Lazy=Z,dn.Memo=U,dn.Portal=B,dn.Profiler=F,dn.StrictMode=q,dn.Suspense=K,dn.isAsyncMode=ae,dn.isConcurrentMode=J,dn.isContextConsumer=pe,dn.isContextProvider=xe,dn.isElement=se,dn.isForwardRef=ge,dn.isFragment=Se,dn.isLazy=Ee,dn.isMemo=$e,dn.isPortal=le,dn.isProfiler=ne,dn.isStrictMode=fe,dn.isSuspense=Me,dn.isValidElementType=O,dn.typeOf=N}()),dn}var HM;function ox(){return HM||(HM=1,process.env.NODE_ENV==="production"?yg.exports=d6():yg.exports=f6()),yg.exports}/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var lx,UM;function p6(){if(UM)return lx;UM=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function n(s){if(s==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(s)}function i(){try{if(!Object.assign)return!1;var s=new String("abc");if(s[5]="de",Object.getOwnPropertyNames(s)[0]==="5")return!1;for(var c={},a=0;a<10;a++)c["_"+String.fromCharCode(a)]=a;var d=Object.getOwnPropertyNames(c).map(function(y){return c[y]});if(d.join("")!=="0123456789")return!1;var p={};return"abcdefghijklmnopqrst".split("").forEach(function(y){p[y]=y}),Object.keys(Object.assign({},p)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return lx=i()?Object.assign:function(s,c){for(var a,d=n(s),p,y=1;y<arguments.length;y++){a=Object(arguments[y]);for(var g in a)t.call(a,g)&&(d[g]=a[g]);if(e){p=e(a);for(var v=0;v<p.length;v++)r.call(a,p[v])&&(d[p[v]]=a[p[v]])}}return d},lx}var cx,XM;function ux(){if(XM)return cx;XM=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return cx=e,cx}var hx,ZM;function YM(){return ZM||(ZM=1,hx=Function.call.bind(Object.prototype.hasOwnProperty)),hx}var dx,qM;function m6(){if(qM)return dx;qM=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=ux(),r={},n=YM();e=function(s){var c="Warning: "+s;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}}}function i(s,c,a,d,p){if(process.env.NODE_ENV!=="production"){for(var y in s)if(n(s,y)){var g;try{if(typeof s[y]!="function"){var v=Error((d||"React class")+": "+a+" type `"+y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw v.name="Invariant Violation",v}g=s[y](c,y,d,a,null,t)}catch(S){g=S}if(g&&!(g instanceof Error)&&e((d||"React class")+": type specification of "+a+" `"+y+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof g+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),g instanceof Error&&!(g.message in r)){r[g.message]=!0;var w=p?p():"";e("Failed "+a+" type: "+g.message+(w??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(r={})},dx=i,dx}var fx,JM;function g6(){if(JM)return fx;JM=1;var e=ox(),t=p6(),r=ux(),n=YM(),i=m6(),s=function(){};process.env.NODE_ENV!=="production"&&(s=function(a){var d="Warning: "+a;typeof console<"u"&&console.error(d);try{throw new Error(d)}catch{}});function c(){return null}return fx=function(a,d){var p=typeof Symbol=="function"&&Symbol.iterator,y="@@iterator";function g(J){var pe=J&&(p&&J[p]||J[y]);if(typeof pe=="function")return pe}var v="<<anonymous>>",w={array:I("array"),bigint:I("bigint"),bool:I("boolean"),func:I("function"),number:I("number"),object:I("object"),string:I("string"),symbol:I("symbol"),any:A(),arrayOf:O,element:N(),elementType:D(),instanceOf:L,node:re(),objectOf:Y,oneOf:R,oneOfType:ie,shape:Z,exact:U};function S(J,pe){return J===pe?J!==0||1/J===1/pe:J!==J&&pe!==pe}function C(J,pe){this.message=J,this.data=pe&&typeof pe=="object"?pe:{},this.stack=""}C.prototype=Error.prototype;function M(J){if(process.env.NODE_ENV!=="production")var pe={},xe=0;function se(Se,Ee,$e,le,ne,fe,Me){if(le=le||v,fe=fe||$e,Me!==r){if(d){var X=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw X.name="Invariant Violation",X}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var de=le+":"+$e;!pe[de]&&xe<3&&(s("You are manually calling a React.PropTypes validation function for the `"+fe+"` prop on `"+le+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),pe[de]=!0,xe++)}}return Ee[$e]==null?Se?Ee[$e]===null?new C("The "+ne+" `"+fe+"` is marked as required "+("in `"+le+"`, but its value is `null`.")):new C("The "+ne+" `"+fe+"` is marked as required in "+("`"+le+"`, but its value is `undefined`.")):null:J(Ee,$e,le,ne,fe)}var ge=se.bind(null,!1);return ge.isRequired=se.bind(null,!0),ge}function I(J){function pe(xe,se,ge,Se,Ee,$e){var le=xe[se],ne=q(le);if(ne!==J){var fe=K(le);return new C("Invalid "+Se+" `"+Ee+"` of type "+("`"+fe+"` supplied to `"+ge+"`, expected ")+("`"+J+"`."),{expectedType:J})}return null}return M(pe)}function A(){return M(c)}function O(J){function pe(xe,se,ge,Se,Ee){if(typeof J!="function")return new C("Property `"+Ee+"` of component `"+ge+"` has invalid PropType notation inside arrayOf.");var $e=xe[se];if(!Array.isArray($e)){var le=q($e);return new C("Invalid "+Se+" `"+Ee+"` of type "+("`"+le+"` supplied to `"+ge+"`, expected an array."))}for(var ne=0;ne<$e.length;ne++){var fe=J($e,ne,ge,Se,Ee+"["+ne+"]",r);if(fe instanceof Error)return fe}return null}return M(pe)}function N(){function J(pe,xe,se,ge,Se){var Ee=pe[xe];if(!a(Ee)){var $e=q(Ee);return new C("Invalid "+ge+" `"+Se+"` of type "+("`"+$e+"` supplied to `"+se+"`, expected a single ReactElement."))}return null}return M(J)}function D(){function J(pe,xe,se,ge,Se){var Ee=pe[xe];if(!e.isValidElementType(Ee)){var $e=q(Ee);return new C("Invalid "+ge+" `"+Se+"` of type "+("`"+$e+"` supplied to `"+se+"`, expected a single ReactElement type."))}return null}return M(J)}function L(J){function pe(xe,se,ge,Se,Ee){if(!(xe[se]instanceof J)){var $e=J.name||v,le=ae(xe[se]);return new C("Invalid "+Se+" `"+Ee+"` of type "+("`"+le+"` supplied to `"+ge+"`, expected ")+("instance of `"+$e+"`."))}return null}return M(pe)}function R(J){if(!Array.isArray(J))return process.env.NODE_ENV!=="production"&&(arguments.length>1?s("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):s("Invalid argument supplied to oneOf, expected an array.")),c;function pe(xe,se,ge,Se,Ee){for(var $e=xe[se],le=0;le<J.length;le++)if(S($e,J[le]))return null;var ne=JSON.stringify(J,function(Me,X){var de=K(X);return de==="symbol"?String(X):X});return new C("Invalid "+Se+" `"+Ee+"` of value `"+String($e)+"` "+("supplied to `"+ge+"`, expected one of "+ne+"."))}return M(pe)}function Y(J){function pe(xe,se,ge,Se,Ee){if(typeof J!="function")return new C("Property `"+Ee+"` of component `"+ge+"` has invalid PropType notation inside objectOf.");var $e=xe[se],le=q($e);if(le!=="object")return new C("Invalid "+Se+" `"+Ee+"` of type "+("`"+le+"` supplied to `"+ge+"`, expected an object."));for(var ne in $e)if(n($e,ne)){var fe=J($e,ne,ge,Se,Ee+"."+ne,r);if(fe instanceof Error)return fe}return null}return M(pe)}function ie(J){if(!Array.isArray(J))return process.env.NODE_ENV!=="production"&&s("Invalid argument supplied to oneOfType, expected an instance of array."),c;for(var pe=0;pe<J.length;pe++){var xe=J[pe];if(typeof xe!="function")return s("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Q(xe)+" at index "+pe+"."),c}function se(ge,Se,Ee,$e,le){for(var ne=[],fe=0;fe<J.length;fe++){var Me=J[fe],X=Me(ge,Se,Ee,$e,le,r);if(X==null)return null;X.data&&n(X.data,"expectedType")&&ne.push(X.data.expectedType)}var de=ne.length>0?", expected one of type ["+ne.join(", ")+"]":"";return new C("Invalid "+$e+" `"+le+"` supplied to "+("`"+Ee+"`"+de+"."))}return M(se)}function re(){function J(pe,xe,se,ge,Se){return B(pe[xe])?null:new C("Invalid "+ge+" `"+Se+"` supplied to "+("`"+se+"`, expected a ReactNode."))}return M(J)}function W(J,pe,xe,se,ge){return new C((J||"React class")+": "+pe+" type `"+xe+"."+se+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ge+"`.")}function Z(J){function pe(xe,se,ge,Se,Ee){var $e=xe[se],le=q($e);if(le!=="object")return new C("Invalid "+Se+" `"+Ee+"` of type `"+le+"` "+("supplied to `"+ge+"`, expected `object`."));for(var ne in J){var fe=J[ne];if(typeof fe!="function")return W(ge,Se,Ee,ne,K(fe));var Me=fe($e,ne,ge,Se,Ee+"."+ne,r);if(Me)return Me}return null}return M(pe)}function U(J){function pe(xe,se,ge,Se,Ee){var $e=xe[se],le=q($e);if(le!=="object")return new C("Invalid "+Se+" `"+Ee+"` of type `"+le+"` "+("supplied to `"+ge+"`, expected `object`."));var ne=t({},xe[se],J);for(var fe in ne){var Me=J[fe];if(n(J,fe)&&typeof Me!="function")return W(ge,Se,Ee,fe,K(Me));if(!Me)return new C("Invalid "+Se+" `"+Ee+"` key `"+fe+"` supplied to `"+ge+"`.\nBad object: "+JSON.stringify(xe[se],null," ")+`
Valid keys: `+JSON.stringify(Object.keys(J),null," "));var X=Me($e,fe,ge,Se,Ee+"."+fe,r);if(X)return X}return null}return M(pe)}function B(J){switch(typeof J){case"number":case"string":case"undefined":return!0;case"boolean":return!J;case"object":if(Array.isArray(J))return J.every(B);if(J===null||a(J))return!0;var pe=g(J);if(pe){var xe=pe.call(J),se;if(pe!==J.entries){for(;!(se=xe.next()).done;)if(!B(se.value))return!1}else for(;!(se=xe.next()).done;){var ge=se.value;if(ge&&!B(ge[1]))return!1}}else return!1;return!0;default:return!1}}function F(J,pe){return J==="symbol"?!0:pe?pe["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&pe instanceof Symbol:!1}function q(J){var pe=typeof J;return Array.isArray(J)?"array":J instanceof RegExp?"object":F(pe,J)?"symbol":pe}function K(J){if(typeof J>"u"||J===null)return""+J;var pe=q(J);if(pe==="object"){if(J instanceof Date)return"date";if(J instanceof RegExp)return"regexp"}return pe}function Q(J){var pe=K(J);switch(pe){case"array":case"object":return"an "+pe;case"boolean":case"date":case"regexp":return"a "+pe;default:return pe}}function ae(J){return!J.constructor||!J.constructor.name?v:J.constructor.name}return w.checkPropTypes=i,w.resetWarningCache=i.resetWarningCache,w.PropTypes=w,w},fx}var px,KM;function y6(){if(KM)return px;KM=1;var e=ux();function t(){}function r(){}return r.resetWarningCache=t,px=function(){function n(c,a,d,p,y,g){if(g!==e){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}n.isRequired=n;function i(){return n}var s={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:r,resetWarningCache:t};return s.PropTypes=s,s},px}if(process.env.NODE_ENV!=="production"){var v6=ox(),b6=!0;sx.exports=g6()(v6.isElement,b6)}else sx.exports=y6()();var x6=sx.exports;const rr=Qr(x6),_6=()=>{const[e,t]=H.useState(!1);return H.useEffect(()=>{const r=window.matchMedia("(prefers-color-scheme: dark)");t(r.matches);const n=i=>t(i.matches);return r.addEventListener("change",n),()=>r.removeEventListener("change",n)},[]),!1},Fi=(e,t={})=>{let r=$t.getState().requestHeaders||{};if(console.log("requestHeaders",r),!(r!=null&&r.Authorization)){const i="demo",s="demo";console.log("username and password",i,s);{const c=btoa(`${i}:${s}`);r.Authorization=`Basic ${c}`,console.log("using environment variable for username and password")}}const n={...r,...t==null?void 0:t.headers};return console.log("headers",n),fetch(e,{...t,headers:n}).then(i=>{if(!i.ok)throw new Error(i.statusText);return i})},w6=async()=>(console.log("fetching map settings"),(await Fi(`${as}map/primary/`)).json()),of=H.createContext(),QM=H.createContext(),eE=H.createContext(),S6=()=>H.useContext(QM),C6=()=>H.useContext(eE),M6=({children:e})=>{const[t,r]=H.useState({basemap:{id:"satellite",zoom:6,longitude:-40.153113,latitude:-35.9503019}}),[n,i]=H.useState(null),s=_6();return H.useEffect(()=>{w6().then(c=>{if(!c)throw new Error("Could not loading map intial View settings from the backend. please try again later, or contact your admin");console.log("data from iii",c),i({latitude:c.options.center.lat,longitude:c.options.center.lng,zoom:c.options.zoom}),r(a=>({...a,mapId:c.id}))})},[]),G.jsx(of.Provider,{value:{settings:t,setSettings:r},children:G.jsx(QM.Provider,{value:s,children:G.jsx(eE.Provider,{value:n,children:e})})})},zi=H.createContext(),E6={VIEW:"view",ADD_MARKER:"add_marker",ADD_PLOT:"add_plot"},tE=({children:e})=>{const[t,r]=H.useState(E6.VIEW),[n,i]=H.useState("idle"),[s,c]=H.useState(!1),[a,d]=H.useState(!1),[p,y]=H.useState({}),g=H.useRef(null),v=H.useRef(null),w=H.useMemo(()=>({mapRef:g,drawRef:v,sources:p,setSources:y,mode:t,setMode:r,status:n,setStatus:i,showDrawActionPopup:s,setShowDrawActionPopup:c,isDetailActive:a,setIsDetailActive:d}),[p,t,n,s,a]);return G.jsx(zi.Provider,{value:w,children:e})};tE.propTypes={children:rr.node.isRequired};const rE=Ae.createContext(null);function A6(){var e;const t=(e=H.useContext(rE))===null||e===void 0?void 0:e.maps,r=H.useContext(wc);return H.useMemo(()=>({...t,current:r==null?void 0:r.map}),[t,r])}function T6(e,t){const r=Array.isArray(e)?e[0]:e?e.x:0,n=Array.isArray(e)?e[1]:e?e.y:0,i=Array.isArray(t)?t[0]:t?t.x:0,s=Array.isArray(t)?t[1]:t?t.y:0;return r===i&&n===s}function Ra(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!Ra(e[r],t[r]))return!1;return!0}else if(Array.isArray(t))return!1;if(typeof e=="object"&&typeof t=="object"){const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const i of r)if(!t.hasOwnProperty(i)||!Ra(e[i],t[i]))return!1;return!0}return!1}function I6(e){const t=e.clone();return t.pixelsToGLUnits=e.pixelsToGLUnits,t}function nE(e,t){if(!e.getProjection)return;const r=e.getProjection(),n=t.getProjection();Ra(r,n)||t.setProjection(r)}function iE(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding}}function aE(e,t){const r=t.viewState||t;let n=!1;if("zoom"in r){const i=e.zoom;e.zoom=r.zoom,n=n||i!==e.zoom}if("bearing"in r){const i=e.bearing;e.bearing=r.bearing,n=n||i!==e.bearing}if("pitch"in r){const i=e.pitch;e.pitch=r.pitch,n=n||i!==e.pitch}if(r.padding&&!e.isPaddingEqual(r.padding)&&(n=!0,e.padding=r.padding),"longitude"in r&&"latitude"in r){const i=e.center;e.center=new i.constructor(r.longitude,r.latitude),n=n||i!==e.center}return n}const P6=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function sE(e){if(!e)return null;if(typeof e=="string"||("toJS"in e&&(e=e.toJS()),!e.layers))return e;const t={};for(const n of e.layers)t[n.id]=n;const r=e.layers.map(n=>{let i=null;"interactive"in n&&(i=Object.assign({},n),delete i.interactive);const s=t[n.ref];if(s){i=i||Object.assign({},n),delete i.ref;for(const c of P6)c in s&&(i[c]=s[c])}return i||n});return{...e,layers:r}}const oE={version:8,sources:{},layers:[]},lE={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},mx={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},cE={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},O6=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],k6=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class Vu{constructor(t,r,n){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=i=>{const s=this.props[cE[i.type]];s?s(i):i.type==="error"&&console.error(i.error)},this._onPointerEvent=i=>{(i.type==="mousemove"||i.type==="mouseout")&&this._updateHover(i);const s=this.props[lE[i.type]];s&&(this.props.interactiveLayerIds&&i.type!=="mouseover"&&i.type!=="mouseout"&&(i.features=this._hoveredFeatures||this._queryRenderedFeatures(i.point)),s(i),delete i.features)},this._onCameraEvent=i=>{if(!this._internalUpdate){const s=this.props[mx[i.type]];s&&s(i)}i.type in this._deferredEvents&&(this._deferredEvents[i.type]=!1)},this._MapClass=t,this.props=r,this._initialize(n)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const r=this.props;this.props=t;const n=this._updateSettings(t,r);n&&this._createShadowTransform(this._map);const i=this._updateSize(t),s=this._updateViewState(t,!0);this._updateStyle(t,r),this._updateStyleComponents(t,r),this._updateHandlers(t,r),(n||i||s&&!this._map.isMoving())&&this.redraw()}static reuse(t,r){const n=Vu.savedMaps.pop();if(!n)return null;const i=n.map,s=i.getContainer();for(r.className=s.className;s.childNodes.length>0;)r.appendChild(s.childNodes[0]);i._container=r;const c=i._resizeObserver;c&&(c.disconnect(),c.observe(r)),n.setProps({...t,styleDiffing:!1}),i.resize();const{initialViewState:a}=t;return a&&(a.bounds?i.fitBounds(a.bounds,{...a.fitBoundsOptions,duration:0}):n._updateViewState(a,!1)),i.isStyleLoaded()?i.fire("load"):i.once("styledata",()=>i.fire("load")),i._update(),n}_initialize(t){const{props:r}=this,{mapStyle:n=oE}=r,i={...r,...r.initialViewState,accessToken:r.mapboxAccessToken||D6()||null,container:t,style:sE(n)},s=i.initialViewState||i.viewState||i;if(Object.assign(i,{center:[s.longitude||0,s.latitude||0],zoom:s.zoom||0,pitch:s.pitch||0,bearing:s.bearing||0}),r.gl){const y=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=y,r.gl)}const c=new this._MapClass(i);s.padding&&c.setPadding(s.padding),r.cursor&&(c.getCanvas().style.cursor=r.cursor),this._createShadowTransform(c);const a=c._render;c._render=y=>{this._inRender=!0,a.call(c,y),this._inRender=!1};const