agvmap-react 0.1.9 → 0.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31715,9 +31715,14 @@ const eL = ({ marker: e, markerId: t, buttonClassName: n = "" }) => {
31715
31715
  }, eH = async (e) => await ia(`${xs}plot/${e}/`, {
31716
31716
  method: "DELETE"
31717
31717
  });
31718
- async function tH(e) {
31719
- const t = `https://agviewer.com/api/dashboard/et-task/?device=${e}&status=RUNNING`, n = await ia(t);
31720
- return n.ok ? (await n.json()).count : !1;
31718
+ async function tH({ stationId: e, plotId: t }) {
31719
+ !e && !t && console.error(
31720
+ "neither plotId nor stationId is provided to getRunningTasksCount function"
31721
+ );
31722
+ let n;
31723
+ t ? n = `https://agviewer.com/api/dashboard/et-task/?plot=${t}&status=RUNNING` : n = `https://agviewer.com/api/dashboard/et-task/?device=${e}&status=RUNNING`;
31724
+ const r = await ia(n);
31725
+ return r.ok ? (await r.json()).count : !1;
31721
31726
  }
31722
31727
  var ha = 63710088e-1, nH = {
31723
31728
  centimeters: ha * 100,
@@ -60522,7 +60527,10 @@ function iMe({ popupInfo: e, onClose: t }) {
60522
60527
  }));
60523
60528
  }, [w, c]);
60524
60529
  return sn(() => {
60525
- S(!0), w && (w != null && w.device) ? tH(w == null ? void 0 : w.device).then((O) => {
60530
+ S(!0), w ? tH({
60531
+ stationId: w == null ? void 0 : w.device,
60532
+ plotId: w == null ? void 0 : w.id
60533
+ }).then((O) => {
60526
60534
  console.log("et-tasks", O), g(O);
60527
60535
  }).finally(() => {
60528
60536
  S(!1);
@@ -811,7 +811,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
811
811
 
812
812
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
813
813
 
814
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return Ne.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},E7="DialogDescriptionWarning",T7=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${tI(E7).contentName}}.`;return Ne.useEffect(()=>{var s;const i=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},d1=$T,I7=VT,f1=UT,Ug=HT,Hg=XT,Xg=YT,Zg=JT,p1=QT;const nI=Ne.forwardRef(({className:e,...t},n)=>K.jsx("div",{ref:n,className:Nn("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));nI.displayName="Card";const P7=Ne.forwardRef(({className:e,...t},n)=>K.jsx("div",{ref:n,className:Nn("flex flex-col space-y-1.5 p-6",e),...t}));P7.displayName="CardHeader";const O7=Ne.forwardRef(({className:e,...t},n)=>K.jsx("div",{ref:n,className:Nn("text-2xl font-semibold leading-none tracking-tight",e),...t}));O7.displayName="CardTitle";const k7=Ne.forwardRef(({className:e,...t},n)=>K.jsx("div",{ref:n,className:Nn("text-sm text-muted-foreground",e),...t}));k7.displayName="CardDescription";const D7=Ne.forwardRef(({className:e,...t},n)=>K.jsx("div",{ref:n,className:Nn("p-6 pt-0",e),...t}));D7.displayName="CardContent";const L7=Ne.forwardRef(({className:e,...t},n)=>K.jsx("div",{ref:n,className:Nn("flex items-center p-6 pt-0",e),...t}));L7.displayName="CardFooter";function To({trigger:e,title:t,description:n,children:r,open:i,setOpen:s,headerClassName:c,onClose:a,onChange:d}){const[p,y]=U.useState(document.body),g=()=>{const S=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;y(S||document.body)};U.useEffect(()=>(g(),document.addEventListener("fullscreenchange",g),document.addEventListener("webkitfullscreenchange",g),document.addEventListener("mozfullscreenchange",g),document.addEventListener("MSFullscreenChange",g),()=>{document.removeEventListener("fullscreenchange",g),document.removeEventListener("webkitfullscreenchange",g),document.removeEventListener("mozfullscreenchange",g),document.removeEventListener("MSFullscreenChange",g)}),[]);const b=()=>{console.log("clicked on handleOpenChange"),s(!i),d&&d()};return K.jsxs(d1,{open:i,onOpenChange:b,children:[e&&K.jsx(I7,{asChild:!0,children:e}),K.jsxs(f1,{container:p,children:[K.jsx(Ug,{className:"DialogOverlay"}),K.jsx(Hg,{className:"DialogContent overflow-y-auto m-0 p-0",disablefocuslock:"true",asChild:!0,children:K.jsxs(nI,{children:[K.jsxs("div",{className:c,children:[t&&K.jsx(Xg,{className:"text-lg font-semibold DialogTitle dark:text-gray-100 ",children:t}),n&&K.jsx(Zg,{className:"DialogDescription dark:text-gray-200",children:n})]}),K.jsx("div",{children:r}),K.jsx(p1,{asChild:!0,children:K.jsx(Gn,{variant:"ghost",style:{position:"absolute",top:10,right:10},"aria-label":"Close",onClick:a,children:K.jsx(ml,{})})})]})})]})]})}To.propTypes={trigger:nn.node,title:nn.string,description:nn.string,children:nn.node.isRequired,open:nn.bool,setOpen:nn.func,headerClassName:nn.string};const rI=({marker:e,markerId:t,buttonClassName:n=""})=>{const[r,i]=U.useState(!1),{handleMarkerUpdate:s}=U.useContext(Ns),c=U.useCallback(()=>{i(d=>!d)},[]),a=d=>(console.log("data after editing",d),console.log("data before editing",e),s(d));return K.jsx(To,{trigger:K.jsx(Gn,{variant:"outline",size:"icon",children:K.jsx(gs,{text:"edit the marker",children:K.jsx(dT,{className:"w-5 h-5 action-icon"})})}),title:"Edit Marker",open:r,setOpen:i,headerClassName:"m-4",onClose:c,children:K.jsx(xo,{children:K.jsx(vT,{marker:e,onSubmit:a,onCancel:c,submitButtonText:"Save Changes"})})})},iI=U.createContext(),N7=({children:e})=>{const[t,n]=U.useState({prompt:"",isOpen:!1,proceed:null,cancel:null});return K.jsx(iI.Provider,{value:[t,n],children:e})},af=()=>{const[e,t]=U.useContext(iI),[n,r]=U.useState(!1),i=s=>(r(!0),new Promise((a,d)=>{t({prompt:s,isOpen:!0,proceed:a,cancel:d})}).then(()=>(t({...e,isOpen:!1}),!0),()=>(t({...e,isOpen:!1}),!1)));return U.useEffect(()=>()=>{e.cancel&&n&&e.cancel()},[e,n]),{...e,isConfirmed:i}},aI=e=>K.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 20 20",fill:"none",...e,children:[K.jsx("path",{stroke:"#373737",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m5.833 14.167 8.334-8.334"}),K.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.833 5.833h8.334v8.334"})]}),R7=({width:e=24,height:t=24,fill:n="#000"})=>K.jsxs("svg",{width:e,height:t,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:n,children:[K.jsx("path",{d:"M17,28V17h1a2.0023,2.0023,0,0,0,2-2V11a2.0023,2.0023,0,0,0-2-2H14a2.0023,2.0023,0,0,0-2,2v4a2.0023,2.0023,0,0,0,2,2h1V28H2v2H30V28ZM14,11h4l.0015,4H14Z"}),K.jsx("path",{d:"M9.3325,18.2168a7.0007,7.0007,0,0,1,0-10.4341l1.334,1.49a5,5,0,0,0,0,7.4537Z"}),K.jsx("path",{d:"M22.667,18.2168l-1.334-1.49a4.9995,4.9995,0,0,0,0-7.4537l1.334-1.49a7,7,0,0,1,0,10.4341Z"}),K.jsx("path",{d:"M6.3994,21.8008a11.0019,11.0019,0,0,1,0-17.6006L7.6,5.8a9.0009,9.0009,0,0,0,0,14.4014Z"}),K.jsx("path",{d:"M25.6006,21.8008l-1.2012-1.6a9.001,9.001,0,0,0,0-14.4019l1.2012-1.6a11.002,11.002,0,0,1,0,17.6011Z"})]}),j7=async()=>await(await Ni(`${Za}plot/`)).json(),sI=async e=>{const t=await Ni(`${Za}plot/`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}});if(t.ok)return t.json()},B7=async e=>{const t=await Ni(`${Za}plot/${e.id}`,{method:"PUT",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}});if(t.ok)return t.json()},F7=async e=>await Ni(`${Za}plot/${e}/`,{method:"DELETE"});async function z7(e){const t=`https://agviewer.com/api/dashboard/et-task/?device=${e}&status=RUNNING`,n=await Ni(t);return n.ok?(await n.json()).count:!1}var Ji=63710088e-1,$7={centimeters:Ji*100,centimetres:Ji*100,degrees:360/(2*Math.PI),feet:Ji*3.28084,inches:Ji*39.37,kilometers:Ji/1e3,kilometres:Ji/1e3,meters:Ji,metres:Ji,miles:Ji/1609.344,millimeters:Ji*1e3,millimetres:Ji*1e3,nauticalmiles:Ji/1852,radians:1,yards:Ji*1.0936};function G7(e,t="kilometers"){const n=$7[t];if(!n)throw new Error(t+" units is invalid");return e*n}function Yg(e){return e%360*Math.PI/180}function oI(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if(e.type==="Feature"&&e.geometry!==null&&e.geometry.type==="Point")return[...e.geometry.coordinates];if(e.type==="Point")return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function lI(e,t,n={}){var r=oI(e),i=oI(t),s=Yg(i[1]-r[1]),c=Yg(i[0]-r[0]),a=Yg(r[1]),d=Yg(i[1]),p=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(c/2),2)*Math.cos(a)*Math.cos(d);return G7(2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p)),n.units)}function cI(e,t,n){if(e!==null)for(var r,i,s,c,a,d,p,y=0,g=0,b,S=e.type,w=S==="FeatureCollection",C=S==="Feature",M=w?e.features.length:1,O=0;O<M;O++){p=w?e.features[O].geometry:C?e.geometry:e,b=p?p.type==="GeometryCollection":!1,a=b?p.geometries.length:1;for(var T=0;T<a;T++){var D=0,N=0;if(c=b?p.geometries[T]:p,c!==null){d=c.coordinates;var k=c.type;switch(y=0,k){case null:break;case"Point":if(t(d,g,O,D,N)===!1)return!1;g++,D++;break;case"LineString":case"MultiPoint":for(r=0;r<d.length;r++){if(t(d[r],g,O,D,N)===!1)return!1;g++,k==="MultiPoint"&&D++}k==="LineString"&&D++;break;case"Polygon":case"MultiLineString":for(r=0;r<d.length;r++){for(i=0;i<d[r].length-y;i++){if(t(d[r][i],g,O,D,N)===!1)return!1;g++}k==="MultiLineString"&&D++,k==="Polygon"&&N++}k==="Polygon"&&D++;break;case"MultiPolygon":for(r=0;r<d.length;r++){for(N=0,i=0;i<d[r].length;i++){for(s=0;s<d[r][i].length-y;s++){if(t(d[r][i][s],g,O,D,N)===!1)return!1;g++}N++}D++}break;case"GeometryCollection":for(r=0;r<c.geometries.length;r++)if(cI(c.geometries[r],t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function V7(e,t){var n,r,i,s,c,a,d,p,y,g,b=0,S=e.type==="FeatureCollection",w=e.type==="Feature",C=S?e.features.length:1;for(n=0;n<C;n++){for(a=S?e.features[n].geometry:w?e.geometry:e,p=S?e.features[n].properties:w?e.properties:{},y=S?e.features[n].bbox:w?e.bbox:void 0,g=S?e.features[n].id:w?e.id:void 0,d=a?a.type==="GeometryCollection":!1,c=d?a.geometries.length:1,i=0;i<c;i++){if(s=d?a.geometries[i]:a,s===null){if(t(null,b,p,y,g)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(s,b,p,y,g)===!1)return!1;break}case"GeometryCollection":{for(r=0;r<s.geometries.length;r++)if(t(s.geometries[r],b,p,y,g)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}b++}}function W7(e,t,n){var r=n;return V7(e,function(i,s,c,a,d){r=t(r,i,s,c,a,d)}),r}function U7(e){return W7(e,(t,n)=>t+H7(n),0)}function H7(e){let t=0,n;switch(e.type){case"Polygon":return uI(e.coordinates);case"MultiPolygon":for(n=0;n<e.coordinates.length;n++)t+=uI(e.coordinates[n]);return t;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function uI(e){let t=0;if(e&&e.length>0){t+=Math.abs(hI(e[0]));for(let n=1;n<e.length;n++)t-=Math.abs(hI(e[n]))}return t}var X7=Ji*Ji/2,m1=Math.PI/180;function hI(e){const t=e.length-1;if(t<=2)return 0;let n=0,r=0;for(;r<t;){const i=e[r],s=e[r+1===t?0:r+1],c=e[r+2>=t?(r+2)%t:r+2],a=i[0]*m1,d=s[1]*m1,p=c[0]*m1;n+=(p-a)*Math.sin(d),r++}return n*X7}function sf(e,t={}){if(e.bbox!=null&&t.recompute!==!0)return e.bbox;const n=[1/0,1/0,-1/0,-1/0];return cI(e,r=>{n[0]>r[0]&&(n[0]=r[0]),n[1]>r[1]&&(n[1]=r[1]),n[2]<r[0]&&(n[2]=r[0]),n[3]<r[1]&&(n[3]=r[1])}),n}var Z7=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var c=s[i];if(!e(t[c],n[c]))return!1}return!0}return t!==t&&n!==n};const dI=Jn(Z7);function Y7(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var t=1;t<=60;++t)e("EPSG:"+(32600+t),"+proj=utm +zone="+t+" +datum=WGS84 +units=m"),e("EPSG:"+(32700+t),"+proj=utm +zone="+t+" +south +datum=WGS84 +units=m");e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]}var _c=1,wc=2,Xu=3,q7=4,g1=5,fI=6378137,J7=6356752314e-3,pI=.0066943799901413165,of=484813681109536e-20,Rt=Math.PI/2,K7=.16666666666666666,Q7=.04722222222222222,eW=.022156084656084655,Qt=1e-10,Si=.017453292519943295,Us=57.29577951308232,ur=Math.PI/4,lf=Math.PI*2,Ci=3.14159265359,da={};da.greenwich=0,da.lisbon=-9.131906111111,da.paris=2.337229166667,da.bogota=-74.080916666667,da.madrid=-3.687938888889,da.rome=12.452333333333,da.bern=7.439583333333,da.jakarta=106.807719444444,da.ferro=-17.666666666667,da.brussels=4.367975,da.stockholm=18.058277777778,da.athens=23.7163375,da.oslo=10.722916666667;const tW={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.01},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var mI=/[\s_\-\/\(\)]/g;function wl(e,t){if(e[t])return e[t];for(var n=Object.keys(e),r=t.toLowerCase().replace(mI,""),i=-1,s,c;++i<n.length;)if(s=n[i],c=s.toLowerCase().replace(mI,""),c===r)return e[s]}function y1(e){var t={},n=e.split("+").map(function(a){return a.trim()}).filter(function(a){return a}).reduce(function(a,d){var p=d.split("=");return p.push(!0),a[p[0].toLowerCase()]=p[1],a},{}),r,i,s,c={proj:"projName",datum:"datumCode",rf:function(a){t.rf=parseFloat(a)},lat_0:function(a){t.lat0=a*Si},lat_1:function(a){t.lat1=a*Si},lat_2:function(a){t.lat2=a*Si},lat_ts:function(a){t.lat_ts=a*Si},lon_0:function(a){t.long0=a*Si},lon_1:function(a){t.long1=a*Si},lon_2:function(a){t.long2=a*Si},alpha:function(a){t.alpha=parseFloat(a)*Si},gamma:function(a){t.rectified_grid_angle=parseFloat(a)},lonc:function(a){t.longc=a*Si},x_0:function(a){t.x0=parseFloat(a)},y_0:function(a){t.y0=parseFloat(a)},k_0:function(a){t.k0=parseFloat(a)},k:function(a){t.k0=parseFloat(a)},a:function(a){t.a=parseFloat(a)},b:function(a){t.b=parseFloat(a)},r:function(a){t.a=t.b=parseFloat(a)},r_a:function(){t.R_A=!0},zone:function(a){t.zone=parseInt(a,10)},south:function(){t.utmSouth=!0},towgs84:function(a){t.datum_params=a.split(",").map(function(d){return parseFloat(d)})},to_meter:function(a){t.to_meter=parseFloat(a)},units:function(a){t.units=a;var d=wl(tW,a);d&&(t.to_meter=d.to_meter)},from_greenwich:function(a){t.from_greenwich=a*Si},pm:function(a){var d=wl(da,a);t.from_greenwich=(d||parseFloat(a))*Si},nadgrids:function(a){a==="@null"?t.datumCode="none":t.nadgrids=a},axis:function(a){var d="ewnsud";a.length===3&&d.indexOf(a.substr(0,1))!==-1&&d.indexOf(a.substr(1,1))!==-1&&d.indexOf(a.substr(2,1))!==-1&&(t.axis=a)},approx:function(){t.approx=!0}};for(r in n)i=n[r],r in c?(s=c[r],typeof s=="function"?s(i):t[s]=i):t[r]=i;return typeof t.datumCode=="string"&&t.datumCode!=="WGS84"&&(t.datumCode=t.datumCode.toLowerCase()),t}var cf=1,gI=2,yI=3,qg=4,vI=5,v1=-1,nW=/\s/,rW=/[A-Za-z]/,iW=/[A-Za-z84_]/,Jg=/[,\]]/,bI=/[\d\.E\-\+]/;function Io(e){if(typeof e!="string")throw new Error("not a string");this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=cf}Io.prototype.readCharicter=function(){var e=this.text[this.place++];if(this.state!==qg)for(;nW.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case cf:return this.neutral(e);case gI:return this.keyword(e);case qg:return this.quoted(e);case vI:return this.afterquote(e);case yI:return this.number(e);case v1:return}},Io.prototype.afterquote=function(e){if(e==='"'){this.word+='"',this.state=qg;return}if(Jg.test(e)){this.word=this.word.trim(),this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in afterquote yet, index '+this.place)},Io.prototype.afterItem=function(e){if(e===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=cf;return}if(e==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=cf,this.currentObject=this.stack.pop(),this.currentObject||(this.state=v1);return}},Io.prototype.number=function(e){if(bI.test(e)){this.word+=e;return}if(Jg.test(e)){this.word=parseFloat(this.word),this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in number yet, index '+this.place)},Io.prototype.quoted=function(e){if(e==='"'){this.state=vI;return}this.word+=e},Io.prototype.keyword=function(e){if(iW.test(e)){this.word+=e;return}if(e==="["){var t=[];t.push(this.word),this.level++,this.root===null?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,this.state=cf;return}if(Jg.test(e)){this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in keyword yet, index '+this.place)},Io.prototype.neutral=function(e){if(rW.test(e)){this.word=e,this.state=gI;return}if(e==='"'){this.word="",this.state=qg;return}if(bI.test(e)){this.word=e,this.state=yI;return}if(Jg.test(e)){this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in neutral yet, index '+this.place)},Io.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===v1)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function aW(e){var t=new Io(e);return t.output()}function b1(e,t,n){Array.isArray(t)&&(n.unshift(t),t=null);var r=t?{}:e,i=n.reduce(function(s,c){return Zu(c,s),s},r);t&&(e[t]=i)}function Zu(e,t){if(!Array.isArray(e)){t[e]=!0;return}var n=e.shift();if(n==="PARAMETER"&&(n=e.shift()),e.length===1){if(Array.isArray(e[0])){t[n]={},Zu(e[0],t[n]);return}t[n]=e[0];return}if(!e.length){t[n]=!0;return}if(n==="TOWGS84"){t[n]=e;return}if(n==="AXIS"){n in t||(t[n]=[]),t[n].push(e);return}Array.isArray(n)||(t[n]={});var r;switch(n){case"UNIT":case"PRIMEM":case"VERT_DATUM":t[n]={name:e[0].toLowerCase(),convert:e[1]},e.length===3&&Zu(e[2],t[n]);return;case"SPHEROID":case"ELLIPSOID":t[n]={name:e[0],a:e[1],rf:e[2]},e.length===4&&Zu(e[3],t[n]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":e[0]=["name",e[0]],b1(t,n,e);return;case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":e[0]=["name",e[0]],b1(t,n,e),t[n].type=n;return;default:for(r=-1;++r<e.length;)if(!Array.isArray(e[r]))return Zu(e,t[n]);return b1(t,n,e)}}var sW=.017453292519943295,oW=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function lW(e,t){var n=t[0],r=t[1];!(n in e)&&r in e&&(e[n]=e[r],t.length===3&&(e[n]=t[2](e[n])))}function Hs(e){return e*sW}function xI(e){for(var t=Object.keys(e),n=0,r=t.length;n<r;++n){var i=t[n];oW.indexOf(i)!==-1&&cW(e[i]),typeof e[i]=="object"&&xI(e[i])}}function cW(e){if(e.AUTHORITY){var t=Object.keys(e.AUTHORITY)[0];t&&t in e.AUTHORITY&&(e.title=t+":"+e.AUTHORITY[t])}if(e.type==="GEOGCS"?e.projName="longlat":e.type==="LOCAL_CS"?(e.projName="identity",e.local=!0):typeof e.PROJECTION=="object"?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var n="",r=0,i=e.AXIS.length;r<i;++r){var s=[e.AXIS[r][0].toLowerCase(),e.AXIS[r][1].toLowerCase()];s[0].indexOf("north")!==-1||(s[0]==="y"||s[0]==="lat")&&s[1]==="north"?n+="n":s[0].indexOf("south")!==-1||(s[0]==="y"||s[0]==="lat")&&s[1]==="south"?n+="s":s[0].indexOf("east")!==-1||(s[0]==="x"||s[0]==="lon")&&s[1]==="east"?n+="e":(s[0].indexOf("west")!==-1||(s[0]==="x"||s[0]==="lon")&&s[1]==="west")&&(n+="w")}n.length===2&&(n+="u"),n.length===3&&(e.axis=n)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.UNIT.convert&&(e.type==="GEOGCS"?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var c=e.GEOGCS;e.type==="GEOGCS"&&(c=e),c&&(c.DATUM?e.datumCode=c.DATUM.name.toLowerCase():e.datumCode=c.name.toLowerCase(),e.datumCode.slice(0,2)==="d_"&&(e.datumCode=e.datumCode.slice(2)),e.datumCode==="new_zealand_1949"&&(e.datumCode="nzgd49"),(e.datumCode==="wgs_1984"||e.datumCode==="world_geodetic_system_1984")&&(e.PROJECTION==="Mercator_Auxiliary_Sphere"&&(e.sphere=!0),e.datumCode="wgs84"),e.datumCode==="belge_1972"&&(e.datumCode="rnb72"),c.DATUM&&c.DATUM.SPHEROID&&(e.ellps=c.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),e.ellps.toLowerCase().slice(0,13)==="international"&&(e.ellps="intl"),e.a=c.DATUM.SPHEROID.a,e.rf=parseFloat(c.DATUM.SPHEROID.rf,10)),c.DATUM&&c.DATUM.TOWGS84&&(e.datum_params=c.DATUM.TOWGS84),~e.datumCode.indexOf("osgb_1936")&&(e.datumCode="osgb36"),~e.datumCode.indexOf("osni_1952")&&(e.datumCode="osni52"),(~e.datumCode.indexOf("tm65")||~e.datumCode.indexOf("geodetic_datum_of_1965"))&&(e.datumCode="ire65"),e.datumCode==="ch1903+"&&(e.datumCode="ch1903"),~e.datumCode.indexOf("israel")&&(e.datumCode="isr93")),e.b&&!isFinite(e.b)&&(e.b=e.a);function a(y){var g=e.to_meter||1;return y*g}var d=function(y){return lW(e,y)},p=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",Hs],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",Hs],["x0","false_easting",a],["y0","false_northing",a],["long0","central_meridian",Hs],["lat0","latitude_of_origin",Hs],["lat0","standard_parallel_1",Hs],["lat1","standard_parallel_1",Hs],["lat2","standard_parallel_2",Hs],["azimuth","Azimuth"],["alpha","azimuth",Hs],["srsCode","name"]];p.forEach(d),!e.long0&&e.longc&&(e.projName==="Albers_Conic_Equal_Area"||e.projName==="Lambert_Azimuthal_Equal_Area")&&(e.long0=e.longc),!e.lat_ts&&e.lat1&&(e.projName==="Stereographic_South_Pole"||e.projName==="Polar Stereographic (variant B)")?(e.lat0=Hs(e.lat1>0?90:-90),e.lat_ts=e.lat1):!e.lat_ts&&e.lat0&&e.projName==="Polar_Stereographic"&&(e.lat_ts=e.lat0,e.lat0=Hs(e.lat0>0?90:-90))}function _I(e){var t=aW(e),n=t[0],r={};return Zu(t,r),xI(r),r[n]}function Ki(e){var t=this;if(arguments.length===2){var n=arguments[1];typeof n=="string"?n.charAt(0)==="+"?Ki[e]=y1(arguments[1]):Ki[e]=_I(arguments[1]):Ki[e]=n}else if(arguments.length===1){if(Array.isArray(e))return e.map(function(r){Array.isArray(r)?Ki.apply(t,r):Ki(r)});if(typeof e=="string"){if(e in Ki)return Ki[e]}else"EPSG"in e?Ki["EPSG:"+e.EPSG]=e:"ESRI"in e?Ki["ESRI:"+e.ESRI]=e:"IAU2000"in e?Ki["IAU2000:"+e.IAU2000]=e:console.log(e);return}}Y7(Ki);function uW(e){return typeof e=="string"}function hW(e){return e in Ki}var dW=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function fW(e){return dW.some(function(t){return e.indexOf(t)>-1})}var pW=["3857","900913","3785","102113"];function mW(e){var t=wl(e,"authority");if(t){var n=wl(t,"epsg");return n&&pW.indexOf(n)>-1}}function gW(e){var t=wl(e,"extension");if(t)return wl(t,"proj4")}function yW(e){return e[0]==="+"}function vW(e){if(uW(e)){if(hW(e))return Ki[e];if(fW(e)){var t=_I(e);if(mW(t))return Ki["EPSG:3857"];var n=gW(t);return n?y1(n):t}if(yW(e))return y1(e)}else return e}function wI(e,t){e=e||{};var n,r;if(!t)return e;for(r in t)n=t[r],n!==void 0&&(e[r]=n);return e}function Xs(e,t,n){var r=e*t;return n/Math.sqrt(1-r*r)}function uf(e){return e<0?-1:1}function rn(e){return Math.abs(e)<=Ci?e:e-uf(e)*lf}function vs(e,t,n){var r=e*n,i=.5*e;return r=Math.pow((1-r)/(1+r),i),Math.tan(.5*(Rt-t))/r}function hf(e,t){for(var n=.5*e,r,i,s=Rt-2*Math.atan(t),c=0;c<=15;c++)if(r=e*Math.sin(s),i=Rt-2*Math.atan(t*Math.pow((1-r)/(1+r),n))-s,s+=i,Math.abs(i)<=1e-10)return s;return-9999}function bW(){var e=this.b/this.a;this.es=1-e*e,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Xs(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function xW(e){var t=e.x,n=e.y;if(n*Us>90&&n*Us<-90&&t*Us>180&&t*Us<-180)return null;var r,i;if(Math.abs(Math.abs(n)-Rt)<=Qt)return null;if(this.sphere)r=this.x0+this.a*this.k0*rn(t-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(ur+.5*n));else{var s=Math.sin(n),c=vs(this.e,n,s);r=this.x0+this.a*this.k0*rn(t-this.long0),i=this.y0-this.a*this.k0*Math.log(c)}return e.x=r,e.y=i,e}function _W(e){var t=e.x-this.x0,n=e.y-this.y0,r,i;if(this.sphere)i=Rt-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var s=Math.exp(-n/(this.a*this.k0));if(i=hf(this.e,s),i===-9999)return null}return r=rn(this.long0+t/(this.a*this.k0)),e.x=r,e.y=i,e}var wW=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const SW={init:bW,forward:xW,inverse:_W,names:wW};function CW(){}function SI(e){return e}var MW=["longlat","identity"],AW=[SW,{init:CW,forward:SI,inverse:SI,names:MW}],Kg={},Qg=[];function CI(e,t){var n=Qg.length;return e.names?(Qg[n]=e,e.names.forEach(function(r){Kg[r.toLowerCase()]=n}),this):(console.log(t),!0)}function EW(e){if(!e)return!1;var t=e.toLowerCase();if(typeof Kg[t]<"u"&&Qg[Kg[t]])return Qg[Kg[t]]}function TW(){AW.forEach(CI)}const IW={start:TW,add:CI,get:EW};var Dn={};Dn.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},Dn.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},Dn.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},Dn.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},Dn.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},Dn.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},Dn.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},Dn.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},Dn.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},Dn.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},Dn.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},Dn.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},Dn.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},Dn.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},Dn.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},Dn.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},Dn.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},Dn.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},Dn.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},Dn.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},Dn.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},Dn.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},Dn.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},Dn.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},Dn.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},Dn.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},Dn.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},Dn.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},Dn.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},Dn.hough={a:6378270,rf:297,ellipseName:"Hough"},Dn.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},Dn.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},Dn.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},Dn.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},Dn.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},Dn.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},Dn.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},Dn.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},Dn.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},Dn.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},Dn.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},Dn.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var PW=Dn.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Dn.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function OW(e,t,n,r){var i=e*e,s=t*t,c=(i-s)/i,a=0;r?(e*=1-c*(K7+c*(Q7+c*eW)),i=e*e,c=0):a=Math.sqrt(c);var d=(i-s)/s;return{es:c,e:a,ep2:d}}function kW(e,t,n,r,i){if(!e){var s=wl(Dn,r);s||(s=PW),e=s.a,t=s.b,n=s.rf}return n&&!t&&(t=(1-1/n)*e),(n===0||Math.abs(e-t)<Qt)&&(i=!0,t=e),{a:e,b:t,rf:n,sphere:i}}var ey={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}};for(var DW in ey){var MI=ey[DW];ey[MI.datumName]=MI}function LW(e,t,n,r,i,s,c){var a={};return e===void 0||e==="none"?a.datum_type=g1:a.datum_type=q7,t&&(a.datum_params=t.map(parseFloat),(a.datum_params[0]!==0||a.datum_params[1]!==0||a.datum_params[2]!==0)&&(a.datum_type=_c),a.datum_params.length>3&&(a.datum_params[3]!==0||a.datum_params[4]!==0||a.datum_params[5]!==0||a.datum_params[6]!==0)&&(a.datum_type=wc,a.datum_params[3]*=of,a.datum_params[4]*=of,a.datum_params[5]*=of,a.datum_params[6]=a.datum_params[6]/1e6+1)),c&&(a.datum_type=Xu,a.grids=c),a.a=n,a.b=r,a.es=i,a.ep2=s,a}var AI={};function NW(e,t){var n=new DataView(t),r=BW(n),i=FW(n,r),s=zW(n,i,r),c={header:i,subgrids:s};return AI[e]=c,c}function RW(e){if(e===void 0)return null;var t=e.split(",");return t.map(jW)}function jW(e){if(e.length===0)return null;var t=e[0]==="@";return t&&(e=e.slice(1)),e==="null"?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:AI[e]||null,isNull:!1}}function Yu(e){return e/3600*Math.PI/180}function BW(e){var t=e.getInt32(8,!1);return t===11?!1:(t=e.getInt32(8,!0),t!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function FW(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:x1(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}function x1(e,t,n){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,n)))}function zW(e,t,n){for(var r=176,i=[],s=0;s<t.nSubgrids;s++){var c=GW(e,r,n),a=VW(e,r,c,n),d=Math.round(1+(c.upperLongitude-c.lowerLongitude)/c.longitudeInterval),p=Math.round(1+(c.upperLatitude-c.lowerLatitude)/c.latitudeInterval);i.push({ll:[Yu(c.lowerLongitude),Yu(c.lowerLatitude)],del:[Yu(c.longitudeInterval),Yu(c.latitudeInterval)],lim:[d,p],count:c.gridNodeCount,cvs:$W(a)}),r+=176+c.gridNodeCount*16}return i}function $W(e){return e.map(function(t){return[Yu(t.longitudeShift),Yu(t.latitudeShift)]})}function GW(e,t,n){return{name:x1(e,t+8,t+16).trim(),parent:x1(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,n),upperLatitude:e.getFloat64(t+88,n),lowerLongitude:e.getFloat64(t+104,n),upperLongitude:e.getFloat64(t+120,n),latitudeInterval:e.getFloat64(t+136,n),longitudeInterval:e.getFloat64(t+152,n),gridNodeCount:e.getInt32(t+168,n)}}function VW(e,t,n,r){for(var i=t+176,s=16,c=[],a=0;a<n.gridNodeCount;a++){var d={latitudeShift:e.getFloat32(i+a*s,r),longitudeShift:e.getFloat32(i+a*s+4,r),latitudeAccuracy:e.getFloat32(i+a*s+8,r),longitudeAccuracy:e.getFloat32(i+a*s+12,r)};c.push(d)}return c}function Zs(e,t){if(!(this instanceof Zs))return new Zs(e);t=t||function(p){if(p)throw p};var n=vW(e);if(typeof n!="object"){t("Could not parse to valid json: "+e);return}var r=Zs.projections.get(n.projName);if(!r){t("Could not get projection name from: "+e);return}if(n.datumCode&&n.datumCode!=="none"){var i=wl(ey,n.datumCode);i&&(n.datum_params=n.datum_params||(i.towgs84?i.towgs84.split(","):null),n.ellps=i.ellipse,n.datumName=i.datumName?i.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||"enu",n.ellps=n.ellps||"wgs84",n.lat1=n.lat1||n.lat0;var s=kW(n.a,n.b,n.rf,n.ellps,n.sphere),c=OW(s.a,s.b,s.rf,n.R_A),a=RW(n.nadgrids),d=n.datum||LW(n.datumCode,n.datum_params,s.a,s.b,c.es,c.ep2,a);wI(this,n),wI(this,r),this.a=s.a,this.b=s.b,this.rf=s.rf,this.sphere=s.sphere,this.es=c.es,this.e=c.e,this.ep2=c.ep2,this.datum=d,this.init(),t(null,this)}Zs.projections=IW,Zs.projections.start();function WW(e,t){return e.datum_type!==t.datum_type||e.a!==t.a||Math.abs(e.es-t.es)>5e-11?!1:e.datum_type===_c?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type===wc?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6]:!0}function EI(e,t,n){var r=e.x,i=e.y,s=e.z?e.z:0,c,a,d,p;if(i<-Rt&&i>-1.001*Rt)i=-Rt;else if(i>Rt&&i<1.001*Rt)i=Rt;else{if(i<-Rt)return{x:-1/0,y:-1/0,z:e.z};if(i>Rt)return{x:1/0,y:1/0,z:e.z}}return r>Math.PI&&(r-=2*Math.PI),a=Math.sin(i),p=Math.cos(i),d=a*a,c=n/Math.sqrt(1-t*d),{x:(c+s)*p*Math.cos(r),y:(c+s)*p*Math.sin(r),z:(c*(1-t)+s)*a}}function TI(e,t,n,r){var i=1e-12,s=i*i,c=30,a,d,p,y,g,b,S,w,C,M,O,T,D,N=e.x,k=e.y,L=e.z?e.z:0,j,q,re;if(a=Math.sqrt(N*N+k*k),d=Math.sqrt(N*N+k*k+L*L),a/n<i){if(j=0,d/n<i)return q=Rt,re=-r,{x:e.x,y:e.y,z:e.z}}else j=Math.atan2(k,N);p=L/d,y=a/d,g=1/Math.sqrt(1-t*(2-t)*y*y),w=y*(1-t)*g,C=p*g,D=0;do D++,S=n/Math.sqrt(1-t*C*C),re=a*w+L*C-S*(1-t*C*C),b=t*S/(S+re),g=1/Math.sqrt(1-b*(2-b)*y*y),M=y*(1-b)*g,O=p*g,T=O*w-M*C,w=M,C=O;while(T*T>s&&D<c);return q=Math.atan(O/Math.abs(M)),{x:j,y:q,z:re}}function UW(e,t,n){if(t===_c)return{x:e.x+n[0],y:e.y+n[1],z:e.z+n[2]};if(t===wc){var r=n[0],i=n[1],s=n[2],c=n[3],a=n[4],d=n[5],p=n[6];return{x:p*(e.x-d*e.y+a*e.z)+r,y:p*(d*e.x+e.y-c*e.z)+i,z:p*(-a*e.x+c*e.y+e.z)+s}}}function HW(e,t,n){if(t===_c)return{x:e.x-n[0],y:e.y-n[1],z:e.z-n[2]};if(t===wc){var r=n[0],i=n[1],s=n[2],c=n[3],a=n[4],d=n[5],p=n[6],y=(e.x-r)/p,g=(e.y-i)/p,b=(e.z-s)/p;return{x:y+d*g-a*b,y:-d*y+g+c*b,z:a*y-c*g+b}}}function ty(e){return e===_c||e===wc}function XW(e,t,n){if(WW(e,t)||e.datum_type===g1||t.datum_type===g1)return n;var r=e.a,i=e.es;if(e.datum_type===Xu){var s=II(e,!1,n);if(s!==0)return;r=fI,i=pI}var c=t.a,a=t.b,d=t.es;if(t.datum_type===Xu&&(c=fI,a=J7,d=pI),i===d&&r===c&&!ty(e.datum_type)&&!ty(t.datum_type))return n;if(n=EI(n,i,r),ty(e.datum_type)&&(n=UW(n,e.datum_type,e.datum_params)),ty(t.datum_type)&&(n=HW(n,t.datum_type,t.datum_params)),n=TI(n,d,c,a),t.datum_type===Xu){var p=II(t,!0,n);if(p!==0)return}return n}function II(e,t,n){if(e.grids===null||e.grids.length===0)return console.log("Grid shift grids not found"),-1;var r={x:-n.x,y:n.y},i={x:Number.NaN,y:Number.NaN},s=[];e:for(var c=0;c<e.grids.length;c++){var a=e.grids[c];if(s.push(a.name),a.isNull){i=r;break}if(a.mandatory,a.grid===null){if(a.mandatory)return console.log("Unable to find mandatory grid '"+a.name+"'"),-1;continue}for(var d=a.grid.subgrids,p=0,y=d.length;p<y;p++){var g=d[p],b=(Math.abs(g.del[1])+Math.abs(g.del[0]))/1e4,S=g.ll[0]-b,w=g.ll[1]-b,C=g.ll[0]+(g.lim[0]-1)*g.del[0]+b,M=g.ll[1]+(g.lim[1]-1)*g.del[1]+b;if(!(w>r.y||S>r.x||M<r.y||C<r.x)&&(i=ZW(r,t,g),!isNaN(i.x)))break e}}return isNaN(i.x)?(console.log("Failed to find a grid shift table for location '"+-r.x*Us+" "+r.y*Us+" tried: '"+s+"'"),-1):(n.x=-i.x,n.y=i.y,0)}function ZW(e,t,n){var r={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return r;var i={x:e.x,y:e.y};i.x-=n.ll[0],i.y-=n.ll[1],i.x=rn(i.x-Math.PI)+Math.PI;var s=PI(i,n);if(t){if(isNaN(s.x))return r;s.x=i.x-s.x,s.y=i.y-s.y;var c=9,a=1e-12,d,p;do{if(p=PI(s,n),isNaN(p.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}d={x:i.x-(p.x+s.x),y:i.y-(p.y+s.y)},s.x+=d.x,s.y+=d.y}while(c--&&Math.abs(d.x)>a&&Math.abs(d.y)>a);if(c<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=rn(s.x+n.ll[0]),r.y=s.y+n.ll[1]}else isNaN(s.x)||(r.x=e.x+s.x,r.y=e.y+s.y);return r}function PI(e,t){var n={x:e.x/t.del[0],y:e.y/t.del[1]},r={x:Math.floor(n.x),y:Math.floor(n.y)},i={x:n.x-1*r.x,y:n.y-1*r.y},s={x:Number.NaN,y:Number.NaN},c;if(r.x<0||r.x>=t.lim[0]||r.y<0||r.y>=t.lim[1])return s;c=r.y*t.lim[0]+r.x;var a={x:t.cvs[c][0],y:t.cvs[c][1]};c++;var d={x:t.cvs[c][0],y:t.cvs[c][1]};c+=t.lim[0];var p={x:t.cvs[c][0],y:t.cvs[c][1]};c--;var y={x:t.cvs[c][0],y:t.cvs[c][1]},g=i.x*i.y,b=i.x*(1-i.y),S=(1-i.x)*(1-i.y),w=(1-i.x)*i.y;return s.x=S*a.x+b*d.x+w*y.x+g*p.x,s.y=S*a.y+b*d.y+w*y.y+g*p.y,s}function OI(e,t,n){var r=n.x,i=n.y,s=n.z||0,c,a,d,p={};for(d=0;d<3;d++)if(!(t&&d===2&&n.z===void 0))switch(d===0?(c=r,"ew".indexOf(e.axis[d])!==-1?a="x":a="y"):d===1?(c=i,"ns".indexOf(e.axis[d])!==-1?a="y":a="x"):(c=s,a="z"),e.axis[d]){case"e":p[a]=c;break;case"w":p[a]=-c;break;case"n":p[a]=c;break;case"s":p[a]=-c;break;case"u":n[a]!==void 0&&(p.z=c);break;case"d":n[a]!==void 0&&(p.z=-c);break;default:return null}return p}function kI(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t}function YW(e){DI(e.x),DI(e.y)}function DI(e){if(typeof Number.isFinite=="function"){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if(typeof e!="number"||e!==e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function qW(e,t){return(e.datum.datum_type===_c||e.datum.datum_type===wc||e.datum.datum_type===Xu)&&t.datumCode!=="WGS84"||(t.datum.datum_type===_c||t.datum.datum_type===wc||t.datum.datum_type===Xu)&&e.datumCode!=="WGS84"}function ny(e,t,n,r){var i;Array.isArray(n)?n=kI(n):n={x:n.x,y:n.y,z:n.z,m:n.m};var s=n.z!==void 0;if(YW(n),e.datum&&t.datum&&qW(e,t)&&(i=new Zs("WGS84"),n=ny(e,i,n,r),e=i),r&&e.axis!=="enu"&&(n=OI(e,!1,n)),e.projName==="longlat")n={x:n.x*Si,y:n.y*Si,z:n.z||0};else if(e.to_meter&&(n={x:n.x*e.to_meter,y:n.y*e.to_meter,z:n.z||0}),n=e.inverse(n),!n)return;if(e.from_greenwich&&(n.x+=e.from_greenwich),n=XW(e.datum,t.datum,n),!!n)return t.from_greenwich&&(n={x:n.x-t.from_greenwich,y:n.y,z:n.z||0}),t.projName==="longlat"?n={x:n.x*Us,y:n.y*Us,z:n.z||0}:(n=t.forward(n),t.to_meter&&(n={x:n.x/t.to_meter,y:n.y/t.to_meter,z:n.z||0})),r&&t.axis!=="enu"?OI(t,!0,n):(n&&!s&&delete n.z,n)}var LI=Zs("WGS84");function _1(e,t,n,r){var i,s,c;return Array.isArray(n)?(i=ny(e,t,n,r)||{x:NaN,y:NaN},n.length>2?typeof e.name<"u"&&e.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"?typeof i.z=="number"?[i.x,i.y,i.z].concat(n.slice(3)):[i.x,i.y,n[2]].concat(n.slice(3)):[i.x,i.y].concat(n.slice(2)):[i.x,i.y]):(s=ny(e,t,n,r),c=Object.keys(n),c.length===2||c.forEach(function(a){if(typeof e.name<"u"&&e.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"){if(a==="x"||a==="y"||a==="z")return}else if(a==="x"||a==="y")return;s[a]=n[a]}),s)}function NI(e){return e instanceof Zs?e:e.oProj?e.oProj:Zs(e)}function fa(e,t,n){e=NI(e);var r=!1,i;return typeof t>"u"?(t=e,e=LI,r=!0):(typeof t.x<"u"||Array.isArray(t))&&(n=t,t=e,e=LI,r=!0),t=NI(t),n?_1(e,t,n):(i={forward:function(s,c){return _1(e,t,s,c)},inverse:function(s,c){return _1(t,e,s,c)}},r&&(i.oProj=t),i)}var RI=6,jI="AJSAJS",BI="AFAFAF",qu=65,pa=73,Ja=79,df=86,ff=90;const JW={forward:FI,inverse:KW,toPoint:zI};function FI(e,t){return t=t||5,tU(QW({lat:e[1],lon:e[0]}),t)}function KW(e){var t=S1(VI(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function zI(e){var t=S1(VI(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function w1(e){return e*(Math.PI/180)}function $I(e){return 180*(e/Math.PI)}function QW(e){var t=e.lat,n=e.lon,r=6378137,i=.00669438,s=.9996,c,a,d,p,y,g,b,S=w1(t),w=w1(n),C,M;M=Math.floor((n+180)/6)+1,n===180&&(M=60),t>=56&&t<64&&n>=3&&n<12&&(M=32),t>=72&&t<84&&(n>=0&&n<9?M=31:n>=9&&n<21?M=33:n>=21&&n<33?M=35:n>=33&&n<42&&(M=37)),c=(M-1)*6-180+3,C=w1(c),a=i/(1-i),d=r/Math.sqrt(1-i*Math.sin(S)*Math.sin(S)),p=Math.tan(S)*Math.tan(S),y=a*Math.cos(S)*Math.cos(S),g=Math.cos(S)*(w-C),b=r*((1-i/4-3*i*i/64-5*i*i*i/256)*S-(3*i/8+3*i*i/32+45*i*i*i/1024)*Math.sin(2*S)+(15*i*i/256+45*i*i*i/1024)*Math.sin(4*S)-35*i*i*i/3072*Math.sin(6*S));var O=s*d*(g+(1-p+y)*g*g*g/6+(5-18*p+p*p+72*y-58*a)*g*g*g*g*g/120)+5e5,T=s*(b+d*Math.tan(S)*(g*g/2+(5-p+9*y+4*y*y)*g*g*g*g/24+(61-58*p+p*p+600*y-330*a)*g*g*g*g*g*g/720));return t<0&&(T+=1e7),{northing:Math.round(T),easting:Math.round(O),zoneNumber:M,zoneLetter:eU(t)}}function S1(e){var t=e.northing,n=e.easting,r=e.zoneLetter,i=e.zoneNumber;if(i<0||i>60)return null;var s=.9996,c=6378137,a=.00669438,d,p=(1-Math.sqrt(1-a))/(1+Math.sqrt(1-a)),y,g,b,S,w,C,M,O,T,D=n-5e5,N=t;r<"N"&&(N-=1e7),M=(i-1)*6-180+3,d=a/(1-a),C=N/s,O=C/(c*(1-a/4-3*a*a/64-5*a*a*a/256)),T=O+(3*p/2-27*p*p*p/32)*Math.sin(2*O)+(21*p*p/16-55*p*p*p*p/32)*Math.sin(4*O)+151*p*p*p/96*Math.sin(6*O),y=c/Math.sqrt(1-a*Math.sin(T)*Math.sin(T)),g=Math.tan(T)*Math.tan(T),b=d*Math.cos(T)*Math.cos(T),S=c*(1-a)/Math.pow(1-a*Math.sin(T)*Math.sin(T),1.5),w=D/(y*s);var k=T-y*Math.tan(T)/S*(w*w/2-(5+3*g+10*b-4*b*b-9*d)*w*w*w*w/24+(61+90*g+298*b+45*g*g-252*d-3*b*b)*w*w*w*w*w*w/720);k=$I(k);var L=(w-(1+2*g+b)*w*w*w/6+(5-2*b+28*g-3*b*b+8*d+24*g*g)*w*w*w*w*w/120)/Math.cos(T);L=M+$I(L);var j;if(e.accuracy){var q=S1({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});j={top:q.lat,right:q.lon,bottom:k,left:L}}else j={lat:k,lon:L};return j}function eU(e){var t="Z";return 84>=e&&e>=72?t="X":72>e&&e>=64?t="W":64>e&&e>=56?t="V":56>e&&e>=48?t="U":48>e&&e>=40?t="T":40>e&&e>=32?t="S":32>e&&e>=24?t="R":24>e&&e>=16?t="Q":16>e&&e>=8?t="P":8>e&&e>=0?t="N":0>e&&e>=-8?t="M":-8>e&&e>=-16?t="L":-16>e&&e>=-24?t="K":-24>e&&e>=-32?t="J":-32>e&&e>=-40?t="H":-40>e&&e>=-48?t="G":-48>e&&e>=-56?t="F":-56>e&&e>=-64?t="E":-64>e&&e>=-72?t="D":-72>e&&e>=-80&&(t="C"),t}function tU(e,t){var n="00000"+e.easting,r="00000"+e.northing;return e.zoneNumber+e.zoneLetter+nU(e.easting,e.northing,e.zoneNumber)+n.substr(n.length-5,t)+r.substr(r.length-5,t)}function nU(e,t,n){var r=GI(n),i=Math.floor(e/1e5),s=Math.floor(t/1e5)%20;return rU(i,s,r)}function GI(e){var t=e%RI;return t===0&&(t=RI),t}function rU(e,t,n){var r=n-1,i=jI.charCodeAt(r),s=BI.charCodeAt(r),c=i+e-1,a=s+t,d=!1;c>ff&&(c=c-ff+qu-1,d=!0),(c===pa||i<pa&&c>pa||(c>pa||i<pa)&&d)&&c++,(c===Ja||i<Ja&&c>Ja||(c>Ja||i<Ja)&&d)&&(c++,c===pa&&c++),c>ff&&(c=c-ff+qu-1),a>df?(a=a-df+qu-1,d=!0):d=!1,(a===pa||s<pa&&a>pa||(a>pa||s<pa)&&d)&&a++,(a===Ja||s<Ja&&a>Ja||(a>Ja||s<Ja)&&d)&&(a++,a===pa&&a++),a>df&&(a=a-df+qu-1);var p=String.fromCharCode(c)+String.fromCharCode(a);return p}function VI(e){if(e&&e.length===0)throw"MGRSPoint coverting from nothing";for(var t=e.length,n=null,r="",i,s=0;!/[A-Z]/.test(i=e.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+e;r+=i,s++}var c=parseInt(r,10);if(s===0||s+3>t)throw"MGRSPoint bad conversion from: "+e;var a=e.charAt(s++);if(a<="A"||a==="B"||a==="Y"||a>="Z"||a==="I"||a==="O")throw"MGRSPoint zone letter "+a+" not handled: "+e;n=e.substring(s,s+=2);for(var d=GI(c),p=iU(n.charAt(0),d),y=aU(n.charAt(1),d);y<sU(a);)y+=2e6;var g=t-s;if(g%2!==0)throw`MGRSPoint has to have an even number
814
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return Ne.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},E7="DialogDescriptionWarning",T7=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${tI(E7).contentName}}.`;return Ne.useEffect(()=>{var s;const i=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},d1=$T,I7=VT,f1=UT,Ug=HT,Hg=XT,Xg=YT,Zg=JT,p1=QT;const nI=Ne.forwardRef(({className:e,...t},n)=>K.jsx("div",{ref:n,className:Nn("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));nI.displayName="Card";const P7=Ne.forwardRef(({className:e,...t},n)=>K.jsx("div",{ref:n,className:Nn("flex flex-col space-y-1.5 p-6",e),...t}));P7.displayName="CardHeader";const O7=Ne.forwardRef(({className:e,...t},n)=>K.jsx("div",{ref:n,className:Nn("text-2xl font-semibold leading-none tracking-tight",e),...t}));O7.displayName="CardTitle";const k7=Ne.forwardRef(({className:e,...t},n)=>K.jsx("div",{ref:n,className:Nn("text-sm text-muted-foreground",e),...t}));k7.displayName="CardDescription";const D7=Ne.forwardRef(({className:e,...t},n)=>K.jsx("div",{ref:n,className:Nn("p-6 pt-0",e),...t}));D7.displayName="CardContent";const L7=Ne.forwardRef(({className:e,...t},n)=>K.jsx("div",{ref:n,className:Nn("flex items-center p-6 pt-0",e),...t}));L7.displayName="CardFooter";function To({trigger:e,title:t,description:n,children:r,open:i,setOpen:s,headerClassName:c,onClose:a,onChange:d}){const[p,y]=U.useState(document.body),g=()=>{const S=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement;y(S||document.body)};U.useEffect(()=>(g(),document.addEventListener("fullscreenchange",g),document.addEventListener("webkitfullscreenchange",g),document.addEventListener("mozfullscreenchange",g),document.addEventListener("MSFullscreenChange",g),()=>{document.removeEventListener("fullscreenchange",g),document.removeEventListener("webkitfullscreenchange",g),document.removeEventListener("mozfullscreenchange",g),document.removeEventListener("MSFullscreenChange",g)}),[]);const b=()=>{console.log("clicked on handleOpenChange"),s(!i),d&&d()};return K.jsxs(d1,{open:i,onOpenChange:b,children:[e&&K.jsx(I7,{asChild:!0,children:e}),K.jsxs(f1,{container:p,children:[K.jsx(Ug,{className:"DialogOverlay"}),K.jsx(Hg,{className:"DialogContent overflow-y-auto m-0 p-0",disablefocuslock:"true",asChild:!0,children:K.jsxs(nI,{children:[K.jsxs("div",{className:c,children:[t&&K.jsx(Xg,{className:"text-lg font-semibold DialogTitle dark:text-gray-100 ",children:t}),n&&K.jsx(Zg,{className:"DialogDescription dark:text-gray-200",children:n})]}),K.jsx("div",{children:r}),K.jsx(p1,{asChild:!0,children:K.jsx(Gn,{variant:"ghost",style:{position:"absolute",top:10,right:10},"aria-label":"Close",onClick:a,children:K.jsx(ml,{})})})]})})]})]})}To.propTypes={trigger:nn.node,title:nn.string,description:nn.string,children:nn.node.isRequired,open:nn.bool,setOpen:nn.func,headerClassName:nn.string};const rI=({marker:e,markerId:t,buttonClassName:n=""})=>{const[r,i]=U.useState(!1),{handleMarkerUpdate:s}=U.useContext(Ns),c=U.useCallback(()=>{i(d=>!d)},[]),a=d=>(console.log("data after editing",d),console.log("data before editing",e),s(d));return K.jsx(To,{trigger:K.jsx(Gn,{variant:"outline",size:"icon",children:K.jsx(gs,{text:"edit the marker",children:K.jsx(dT,{className:"w-5 h-5 action-icon"})})}),title:"Edit Marker",open:r,setOpen:i,headerClassName:"m-4",onClose:c,children:K.jsx(xo,{children:K.jsx(vT,{marker:e,onSubmit:a,onCancel:c,submitButtonText:"Save Changes"})})})},iI=U.createContext(),N7=({children:e})=>{const[t,n]=U.useState({prompt:"",isOpen:!1,proceed:null,cancel:null});return K.jsx(iI.Provider,{value:[t,n],children:e})},af=()=>{const[e,t]=U.useContext(iI),[n,r]=U.useState(!1),i=s=>(r(!0),new Promise((a,d)=>{t({prompt:s,isOpen:!0,proceed:a,cancel:d})}).then(()=>(t({...e,isOpen:!1}),!0),()=>(t({...e,isOpen:!1}),!1)));return U.useEffect(()=>()=>{e.cancel&&n&&e.cancel()},[e,n]),{...e,isConfirmed:i}},aI=e=>K.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 20 20",fill:"none",...e,children:[K.jsx("path",{stroke:"#373737",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m5.833 14.167 8.334-8.334"}),K.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.833 5.833h8.334v8.334"})]}),R7=({width:e=24,height:t=24,fill:n="#000"})=>K.jsxs("svg",{width:e,height:t,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",fill:n,children:[K.jsx("path",{d:"M17,28V17h1a2.0023,2.0023,0,0,0,2-2V11a2.0023,2.0023,0,0,0-2-2H14a2.0023,2.0023,0,0,0-2,2v4a2.0023,2.0023,0,0,0,2,2h1V28H2v2H30V28ZM14,11h4l.0015,4H14Z"}),K.jsx("path",{d:"M9.3325,18.2168a7.0007,7.0007,0,0,1,0-10.4341l1.334,1.49a5,5,0,0,0,0,7.4537Z"}),K.jsx("path",{d:"M22.667,18.2168l-1.334-1.49a4.9995,4.9995,0,0,0,0-7.4537l1.334-1.49a7,7,0,0,1,0,10.4341Z"}),K.jsx("path",{d:"M6.3994,21.8008a11.0019,11.0019,0,0,1,0-17.6006L7.6,5.8a9.0009,9.0009,0,0,0,0,14.4014Z"}),K.jsx("path",{d:"M25.6006,21.8008l-1.2012-1.6a9.001,9.001,0,0,0,0-14.4019l1.2012-1.6a11.002,11.002,0,0,1,0,17.6011Z"})]}),j7=async()=>await(await Ni(`${Za}plot/`)).json(),sI=async e=>{const t=await Ni(`${Za}plot/`,{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}});if(t.ok)return t.json()},B7=async e=>{const t=await Ni(`${Za}plot/${e.id}`,{method:"PUT",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}});if(t.ok)return t.json()},F7=async e=>await Ni(`${Za}plot/${e}/`,{method:"DELETE"});async function z7({stationId:e,plotId:t}){!e&&!t&&console.error("neither plotId nor stationId is provided to getRunningTasksCount function");let n;t?n=`https://agviewer.com/api/dashboard/et-task/?plot=${t}&status=RUNNING`:n=`https://agviewer.com/api/dashboard/et-task/?device=${e}&status=RUNNING`;const r=await Ni(n);return r.ok?(await r.json()).count:!1}var Ji=63710088e-1,$7={centimeters:Ji*100,centimetres:Ji*100,degrees:360/(2*Math.PI),feet:Ji*3.28084,inches:Ji*39.37,kilometers:Ji/1e3,kilometres:Ji/1e3,meters:Ji,metres:Ji,miles:Ji/1609.344,millimeters:Ji*1e3,millimetres:Ji*1e3,nauticalmiles:Ji/1852,radians:1,yards:Ji*1.0936};function G7(e,t="kilometers"){const n=$7[t];if(!n)throw new Error(t+" units is invalid");return e*n}function Yg(e){return e%360*Math.PI/180}function oI(e){if(!e)throw new Error("coord is required");if(!Array.isArray(e)){if(e.type==="Feature"&&e.geometry!==null&&e.geometry.type==="Point")return[...e.geometry.coordinates];if(e.type==="Point")return[...e.coordinates]}if(Array.isArray(e)&&e.length>=2&&!Array.isArray(e[0])&&!Array.isArray(e[1]))return[...e];throw new Error("coord must be GeoJSON Point or an Array of numbers")}function lI(e,t,n={}){var r=oI(e),i=oI(t),s=Yg(i[1]-r[1]),c=Yg(i[0]-r[0]),a=Yg(r[1]),d=Yg(i[1]),p=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(c/2),2)*Math.cos(a)*Math.cos(d);return G7(2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p)),n.units)}function cI(e,t,n){if(e!==null)for(var r,i,s,c,a,d,p,y=0,g=0,b,S=e.type,w=S==="FeatureCollection",C=S==="Feature",M=w?e.features.length:1,O=0;O<M;O++){p=w?e.features[O].geometry:C?e.geometry:e,b=p?p.type==="GeometryCollection":!1,a=b?p.geometries.length:1;for(var T=0;T<a;T++){var D=0,N=0;if(c=b?p.geometries[T]:p,c!==null){d=c.coordinates;var k=c.type;switch(y=0,k){case null:break;case"Point":if(t(d,g,O,D,N)===!1)return!1;g++,D++;break;case"LineString":case"MultiPoint":for(r=0;r<d.length;r++){if(t(d[r],g,O,D,N)===!1)return!1;g++,k==="MultiPoint"&&D++}k==="LineString"&&D++;break;case"Polygon":case"MultiLineString":for(r=0;r<d.length;r++){for(i=0;i<d[r].length-y;i++){if(t(d[r][i],g,O,D,N)===!1)return!1;g++}k==="MultiLineString"&&D++,k==="Polygon"&&N++}k==="Polygon"&&D++;break;case"MultiPolygon":for(r=0;r<d.length;r++){for(N=0,i=0;i<d[r].length;i++){for(s=0;s<d[r][i].length-y;s++){if(t(d[r][i][s],g,O,D,N)===!1)return!1;g++}N++}D++}break;case"GeometryCollection":for(r=0;r<c.geometries.length;r++)if(cI(c.geometries[r],t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function V7(e,t){var n,r,i,s,c,a,d,p,y,g,b=0,S=e.type==="FeatureCollection",w=e.type==="Feature",C=S?e.features.length:1;for(n=0;n<C;n++){for(a=S?e.features[n].geometry:w?e.geometry:e,p=S?e.features[n].properties:w?e.properties:{},y=S?e.features[n].bbox:w?e.bbox:void 0,g=S?e.features[n].id:w?e.id:void 0,d=a?a.type==="GeometryCollection":!1,c=d?a.geometries.length:1,i=0;i<c;i++){if(s=d?a.geometries[i]:a,s===null){if(t(null,b,p,y,g)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(t(s,b,p,y,g)===!1)return!1;break}case"GeometryCollection":{for(r=0;r<s.geometries.length;r++)if(t(s.geometries[r],b,p,y,g)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}b++}}function W7(e,t,n){var r=n;return V7(e,function(i,s,c,a,d){r=t(r,i,s,c,a,d)}),r}function U7(e){return W7(e,(t,n)=>t+H7(n),0)}function H7(e){let t=0,n;switch(e.type){case"Polygon":return uI(e.coordinates);case"MultiPolygon":for(n=0;n<e.coordinates.length;n++)t+=uI(e.coordinates[n]);return t;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function uI(e){let t=0;if(e&&e.length>0){t+=Math.abs(hI(e[0]));for(let n=1;n<e.length;n++)t-=Math.abs(hI(e[n]))}return t}var X7=Ji*Ji/2,m1=Math.PI/180;function hI(e){const t=e.length-1;if(t<=2)return 0;let n=0,r=0;for(;r<t;){const i=e[r],s=e[r+1===t?0:r+1],c=e[r+2>=t?(r+2)%t:r+2],a=i[0]*m1,d=s[1]*m1,p=c[0]*m1;n+=(p-a)*Math.sin(d),r++}return n*X7}function sf(e,t={}){if(e.bbox!=null&&t.recompute!==!0)return e.bbox;const n=[1/0,1/0,-1/0,-1/0];return cI(e,r=>{n[0]>r[0]&&(n[0]=r[0]),n[1]>r[1]&&(n[1]=r[1]),n[2]<r[0]&&(n[2]=r[0]),n[3]<r[1]&&(n[3]=r[1])}),n}var Z7=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var c=s[i];if(!e(t[c],n[c]))return!1}return!0}return t!==t&&n!==n};const dI=Jn(Z7);function Y7(e){e("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),e("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),e("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var t=1;t<=60;++t)e("EPSG:"+(32600+t),"+proj=utm +zone="+t+" +datum=WGS84 +units=m"),e("EPSG:"+(32700+t),"+proj=utm +zone="+t+" +south +datum=WGS84 +units=m");e.WGS84=e["EPSG:4326"],e["EPSG:3785"]=e["EPSG:3857"],e.GOOGLE=e["EPSG:3857"],e["EPSG:900913"]=e["EPSG:3857"],e["EPSG:102113"]=e["EPSG:3857"]}var _c=1,wc=2,Xu=3,q7=4,g1=5,fI=6378137,J7=6356752314e-3,pI=.0066943799901413165,of=484813681109536e-20,Rt=Math.PI/2,K7=.16666666666666666,Q7=.04722222222222222,eW=.022156084656084655,Qt=1e-10,Si=.017453292519943295,Us=57.29577951308232,ur=Math.PI/4,lf=Math.PI*2,Ci=3.14159265359,da={};da.greenwich=0,da.lisbon=-9.131906111111,da.paris=2.337229166667,da.bogota=-74.080916666667,da.madrid=-3.687938888889,da.rome=12.452333333333,da.bern=7.439583333333,da.jakarta=106.807719444444,da.ferro=-17.666666666667,da.brussels=4.367975,da.stockholm=18.058277777778,da.athens=23.7163375,da.oslo=10.722916666667;const tW={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.01},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var mI=/[\s_\-\/\(\)]/g;function wl(e,t){if(e[t])return e[t];for(var n=Object.keys(e),r=t.toLowerCase().replace(mI,""),i=-1,s,c;++i<n.length;)if(s=n[i],c=s.toLowerCase().replace(mI,""),c===r)return e[s]}function y1(e){var t={},n=e.split("+").map(function(a){return a.trim()}).filter(function(a){return a}).reduce(function(a,d){var p=d.split("=");return p.push(!0),a[p[0].toLowerCase()]=p[1],a},{}),r,i,s,c={proj:"projName",datum:"datumCode",rf:function(a){t.rf=parseFloat(a)},lat_0:function(a){t.lat0=a*Si},lat_1:function(a){t.lat1=a*Si},lat_2:function(a){t.lat2=a*Si},lat_ts:function(a){t.lat_ts=a*Si},lon_0:function(a){t.long0=a*Si},lon_1:function(a){t.long1=a*Si},lon_2:function(a){t.long2=a*Si},alpha:function(a){t.alpha=parseFloat(a)*Si},gamma:function(a){t.rectified_grid_angle=parseFloat(a)},lonc:function(a){t.longc=a*Si},x_0:function(a){t.x0=parseFloat(a)},y_0:function(a){t.y0=parseFloat(a)},k_0:function(a){t.k0=parseFloat(a)},k:function(a){t.k0=parseFloat(a)},a:function(a){t.a=parseFloat(a)},b:function(a){t.b=parseFloat(a)},r:function(a){t.a=t.b=parseFloat(a)},r_a:function(){t.R_A=!0},zone:function(a){t.zone=parseInt(a,10)},south:function(){t.utmSouth=!0},towgs84:function(a){t.datum_params=a.split(",").map(function(d){return parseFloat(d)})},to_meter:function(a){t.to_meter=parseFloat(a)},units:function(a){t.units=a;var d=wl(tW,a);d&&(t.to_meter=d.to_meter)},from_greenwich:function(a){t.from_greenwich=a*Si},pm:function(a){var d=wl(da,a);t.from_greenwich=(d||parseFloat(a))*Si},nadgrids:function(a){a==="@null"?t.datumCode="none":t.nadgrids=a},axis:function(a){var d="ewnsud";a.length===3&&d.indexOf(a.substr(0,1))!==-1&&d.indexOf(a.substr(1,1))!==-1&&d.indexOf(a.substr(2,1))!==-1&&(t.axis=a)},approx:function(){t.approx=!0}};for(r in n)i=n[r],r in c?(s=c[r],typeof s=="function"?s(i):t[s]=i):t[r]=i;return typeof t.datumCode=="string"&&t.datumCode!=="WGS84"&&(t.datumCode=t.datumCode.toLowerCase()),t}var cf=1,gI=2,yI=3,qg=4,vI=5,v1=-1,nW=/\s/,rW=/[A-Za-z]/,iW=/[A-Za-z84_]/,Jg=/[,\]]/,bI=/[\d\.E\-\+]/;function Io(e){if(typeof e!="string")throw new Error("not a string");this.text=e.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=cf}Io.prototype.readCharicter=function(){var e=this.text[this.place++];if(this.state!==qg)for(;nW.test(e);){if(this.place>=this.text.length)return;e=this.text[this.place++]}switch(this.state){case cf:return this.neutral(e);case gI:return this.keyword(e);case qg:return this.quoted(e);case vI:return this.afterquote(e);case yI:return this.number(e);case v1:return}},Io.prototype.afterquote=function(e){if(e==='"'){this.word+='"',this.state=qg;return}if(Jg.test(e)){this.word=this.word.trim(),this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in afterquote yet, index '+this.place)},Io.prototype.afterItem=function(e){if(e===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=cf;return}if(e==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=cf,this.currentObject=this.stack.pop(),this.currentObject||(this.state=v1);return}},Io.prototype.number=function(e){if(bI.test(e)){this.word+=e;return}if(Jg.test(e)){this.word=parseFloat(this.word),this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in number yet, index '+this.place)},Io.prototype.quoted=function(e){if(e==='"'){this.state=vI;return}this.word+=e},Io.prototype.keyword=function(e){if(iW.test(e)){this.word+=e;return}if(e==="["){var t=[];t.push(this.word),this.level++,this.root===null?this.root=t:this.currentObject.push(t),this.stack.push(this.currentObject),this.currentObject=t,this.state=cf;return}if(Jg.test(e)){this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in keyword yet, index '+this.place)},Io.prototype.neutral=function(e){if(rW.test(e)){this.word=e,this.state=gI;return}if(e==='"'){this.word="",this.state=qg;return}if(bI.test(e)){this.word=e,this.state=yI;return}if(Jg.test(e)){this.afterItem(e);return}throw new Error(`havn't handled "`+e+'" in neutral yet, index '+this.place)},Io.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===v1)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function aW(e){var t=new Io(e);return t.output()}function b1(e,t,n){Array.isArray(t)&&(n.unshift(t),t=null);var r=t?{}:e,i=n.reduce(function(s,c){return Zu(c,s),s},r);t&&(e[t]=i)}function Zu(e,t){if(!Array.isArray(e)){t[e]=!0;return}var n=e.shift();if(n==="PARAMETER"&&(n=e.shift()),e.length===1){if(Array.isArray(e[0])){t[n]={},Zu(e[0],t[n]);return}t[n]=e[0];return}if(!e.length){t[n]=!0;return}if(n==="TOWGS84"){t[n]=e;return}if(n==="AXIS"){n in t||(t[n]=[]),t[n].push(e);return}Array.isArray(n)||(t[n]={});var r;switch(n){case"UNIT":case"PRIMEM":case"VERT_DATUM":t[n]={name:e[0].toLowerCase(),convert:e[1]},e.length===3&&Zu(e[2],t[n]);return;case"SPHEROID":case"ELLIPSOID":t[n]={name:e[0],a:e[1],rf:e[2]},e.length===4&&Zu(e[3],t[n]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":e[0]=["name",e[0]],b1(t,n,e);return;case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":e[0]=["name",e[0]],b1(t,n,e),t[n].type=n;return;default:for(r=-1;++r<e.length;)if(!Array.isArray(e[r]))return Zu(e,t[n]);return b1(t,n,e)}}var sW=.017453292519943295,oW=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function lW(e,t){var n=t[0],r=t[1];!(n in e)&&r in e&&(e[n]=e[r],t.length===3&&(e[n]=t[2](e[n])))}function Hs(e){return e*sW}function xI(e){for(var t=Object.keys(e),n=0,r=t.length;n<r;++n){var i=t[n];oW.indexOf(i)!==-1&&cW(e[i]),typeof e[i]=="object"&&xI(e[i])}}function cW(e){if(e.AUTHORITY){var t=Object.keys(e.AUTHORITY)[0];t&&t in e.AUTHORITY&&(e.title=t+":"+e.AUTHORITY[t])}if(e.type==="GEOGCS"?e.projName="longlat":e.type==="LOCAL_CS"?(e.projName="identity",e.local=!0):typeof e.PROJECTION=="object"?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var n="",r=0,i=e.AXIS.length;r<i;++r){var s=[e.AXIS[r][0].toLowerCase(),e.AXIS[r][1].toLowerCase()];s[0].indexOf("north")!==-1||(s[0]==="y"||s[0]==="lat")&&s[1]==="north"?n+="n":s[0].indexOf("south")!==-1||(s[0]==="y"||s[0]==="lat")&&s[1]==="south"?n+="s":s[0].indexOf("east")!==-1||(s[0]==="x"||s[0]==="lon")&&s[1]==="east"?n+="e":(s[0].indexOf("west")!==-1||(s[0]==="x"||s[0]==="lon")&&s[1]==="west")&&(n+="w")}n.length===2&&(n+="u"),n.length===3&&(e.axis=n)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.UNIT.convert&&(e.type==="GEOGCS"?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var c=e.GEOGCS;e.type==="GEOGCS"&&(c=e),c&&(c.DATUM?e.datumCode=c.DATUM.name.toLowerCase():e.datumCode=c.name.toLowerCase(),e.datumCode.slice(0,2)==="d_"&&(e.datumCode=e.datumCode.slice(2)),e.datumCode==="new_zealand_1949"&&(e.datumCode="nzgd49"),(e.datumCode==="wgs_1984"||e.datumCode==="world_geodetic_system_1984")&&(e.PROJECTION==="Mercator_Auxiliary_Sphere"&&(e.sphere=!0),e.datumCode="wgs84"),e.datumCode==="belge_1972"&&(e.datumCode="rnb72"),c.DATUM&&c.DATUM.SPHEROID&&(e.ellps=c.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),e.ellps.toLowerCase().slice(0,13)==="international"&&(e.ellps="intl"),e.a=c.DATUM.SPHEROID.a,e.rf=parseFloat(c.DATUM.SPHEROID.rf,10)),c.DATUM&&c.DATUM.TOWGS84&&(e.datum_params=c.DATUM.TOWGS84),~e.datumCode.indexOf("osgb_1936")&&(e.datumCode="osgb36"),~e.datumCode.indexOf("osni_1952")&&(e.datumCode="osni52"),(~e.datumCode.indexOf("tm65")||~e.datumCode.indexOf("geodetic_datum_of_1965"))&&(e.datumCode="ire65"),e.datumCode==="ch1903+"&&(e.datumCode="ch1903"),~e.datumCode.indexOf("israel")&&(e.datumCode="isr93")),e.b&&!isFinite(e.b)&&(e.b=e.a);function a(y){var g=e.to_meter||1;return y*g}var d=function(y){return lW(e,y)},p=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",Hs],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",Hs],["x0","false_easting",a],["y0","false_northing",a],["long0","central_meridian",Hs],["lat0","latitude_of_origin",Hs],["lat0","standard_parallel_1",Hs],["lat1","standard_parallel_1",Hs],["lat2","standard_parallel_2",Hs],["azimuth","Azimuth"],["alpha","azimuth",Hs],["srsCode","name"]];p.forEach(d),!e.long0&&e.longc&&(e.projName==="Albers_Conic_Equal_Area"||e.projName==="Lambert_Azimuthal_Equal_Area")&&(e.long0=e.longc),!e.lat_ts&&e.lat1&&(e.projName==="Stereographic_South_Pole"||e.projName==="Polar Stereographic (variant B)")?(e.lat0=Hs(e.lat1>0?90:-90),e.lat_ts=e.lat1):!e.lat_ts&&e.lat0&&e.projName==="Polar_Stereographic"&&(e.lat_ts=e.lat0,e.lat0=Hs(e.lat0>0?90:-90))}function _I(e){var t=aW(e),n=t[0],r={};return Zu(t,r),xI(r),r[n]}function Ki(e){var t=this;if(arguments.length===2){var n=arguments[1];typeof n=="string"?n.charAt(0)==="+"?Ki[e]=y1(arguments[1]):Ki[e]=_I(arguments[1]):Ki[e]=n}else if(arguments.length===1){if(Array.isArray(e))return e.map(function(r){Array.isArray(r)?Ki.apply(t,r):Ki(r)});if(typeof e=="string"){if(e in Ki)return Ki[e]}else"EPSG"in e?Ki["EPSG:"+e.EPSG]=e:"ESRI"in e?Ki["ESRI:"+e.ESRI]=e:"IAU2000"in e?Ki["IAU2000:"+e.IAU2000]=e:console.log(e);return}}Y7(Ki);function uW(e){return typeof e=="string"}function hW(e){return e in Ki}var dW=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function fW(e){return dW.some(function(t){return e.indexOf(t)>-1})}var pW=["3857","900913","3785","102113"];function mW(e){var t=wl(e,"authority");if(t){var n=wl(t,"epsg");return n&&pW.indexOf(n)>-1}}function gW(e){var t=wl(e,"extension");if(t)return wl(t,"proj4")}function yW(e){return e[0]==="+"}function vW(e){if(uW(e)){if(hW(e))return Ki[e];if(fW(e)){var t=_I(e);if(mW(t))return Ki["EPSG:3857"];var n=gW(t);return n?y1(n):t}if(yW(e))return y1(e)}else return e}function wI(e,t){e=e||{};var n,r;if(!t)return e;for(r in t)n=t[r],n!==void 0&&(e[r]=n);return e}function Xs(e,t,n){var r=e*t;return n/Math.sqrt(1-r*r)}function uf(e){return e<0?-1:1}function rn(e){return Math.abs(e)<=Ci?e:e-uf(e)*lf}function vs(e,t,n){var r=e*n,i=.5*e;return r=Math.pow((1-r)/(1+r),i),Math.tan(.5*(Rt-t))/r}function hf(e,t){for(var n=.5*e,r,i,s=Rt-2*Math.atan(t),c=0;c<=15;c++)if(r=e*Math.sin(s),i=Rt-2*Math.atan(t*Math.pow((1-r)/(1+r),n))-s,s+=i,Math.abs(i)<=1e-10)return s;return-9999}function bW(){var e=this.b/this.a;this.es=1-e*e,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=Xs(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function xW(e){var t=e.x,n=e.y;if(n*Us>90&&n*Us<-90&&t*Us>180&&t*Us<-180)return null;var r,i;if(Math.abs(Math.abs(n)-Rt)<=Qt)return null;if(this.sphere)r=this.x0+this.a*this.k0*rn(t-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(ur+.5*n));else{var s=Math.sin(n),c=vs(this.e,n,s);r=this.x0+this.a*this.k0*rn(t-this.long0),i=this.y0-this.a*this.k0*Math.log(c)}return e.x=r,e.y=i,e}function _W(e){var t=e.x-this.x0,n=e.y-this.y0,r,i;if(this.sphere)i=Rt-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var s=Math.exp(-n/(this.a*this.k0));if(i=hf(this.e,s),i===-9999)return null}return r=rn(this.long0+t/(this.a*this.k0)),e.x=r,e.y=i,e}var wW=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"];const SW={init:bW,forward:xW,inverse:_W,names:wW};function CW(){}function SI(e){return e}var MW=["longlat","identity"],AW=[SW,{init:CW,forward:SI,inverse:SI,names:MW}],Kg={},Qg=[];function CI(e,t){var n=Qg.length;return e.names?(Qg[n]=e,e.names.forEach(function(r){Kg[r.toLowerCase()]=n}),this):(console.log(t),!0)}function EW(e){if(!e)return!1;var t=e.toLowerCase();if(typeof Kg[t]<"u"&&Qg[Kg[t]])return Qg[Kg[t]]}function TW(){AW.forEach(CI)}const IW={start:TW,add:CI,get:EW};var Dn={};Dn.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},Dn.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},Dn.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},Dn.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},Dn.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"},Dn.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},Dn.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},Dn.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},Dn.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},Dn.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},Dn.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},Dn.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},Dn.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},Dn.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},Dn.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},Dn.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},Dn.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},Dn.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},Dn.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},Dn.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},Dn.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},Dn.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},Dn.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},Dn.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},Dn.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},Dn.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},Dn.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},Dn.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},Dn.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},Dn.hough={a:6378270,rf:297,ellipseName:"Hough"},Dn.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},Dn.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},Dn.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},Dn.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},Dn.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"},Dn.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},Dn.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},Dn.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"},Dn.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},Dn.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},Dn.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},Dn.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var PW=Dn.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Dn.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function OW(e,t,n,r){var i=e*e,s=t*t,c=(i-s)/i,a=0;r?(e*=1-c*(K7+c*(Q7+c*eW)),i=e*e,c=0):a=Math.sqrt(c);var d=(i-s)/s;return{es:c,e:a,ep2:d}}function kW(e,t,n,r,i){if(!e){var s=wl(Dn,r);s||(s=PW),e=s.a,t=s.b,n=s.rf}return n&&!t&&(t=(1-1/n)*e),(n===0||Math.abs(e-t)<Qt)&&(i=!0,t=e),{a:e,b:t,rf:n,sphere:i}}var ey={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}};for(var DW in ey){var MI=ey[DW];ey[MI.datumName]=MI}function LW(e,t,n,r,i,s,c){var a={};return e===void 0||e==="none"?a.datum_type=g1:a.datum_type=q7,t&&(a.datum_params=t.map(parseFloat),(a.datum_params[0]!==0||a.datum_params[1]!==0||a.datum_params[2]!==0)&&(a.datum_type=_c),a.datum_params.length>3&&(a.datum_params[3]!==0||a.datum_params[4]!==0||a.datum_params[5]!==0||a.datum_params[6]!==0)&&(a.datum_type=wc,a.datum_params[3]*=of,a.datum_params[4]*=of,a.datum_params[5]*=of,a.datum_params[6]=a.datum_params[6]/1e6+1)),c&&(a.datum_type=Xu,a.grids=c),a.a=n,a.b=r,a.es=i,a.ep2=s,a}var AI={};function NW(e,t){var n=new DataView(t),r=BW(n),i=FW(n,r),s=zW(n,i,r),c={header:i,subgrids:s};return AI[e]=c,c}function RW(e){if(e===void 0)return null;var t=e.split(",");return t.map(jW)}function jW(e){if(e.length===0)return null;var t=e[0]==="@";return t&&(e=e.slice(1)),e==="null"?{name:"null",mandatory:!t,grid:null,isNull:!0}:{name:e,mandatory:!t,grid:AI[e]||null,isNull:!1}}function Yu(e){return e/3600*Math.PI/180}function BW(e){var t=e.getInt32(8,!1);return t===11?!1:(t=e.getInt32(8,!0),t!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function FW(e,t){return{nFields:e.getInt32(8,t),nSubgridFields:e.getInt32(24,t),nSubgrids:e.getInt32(40,t),shiftType:x1(e,56,64).trim(),fromSemiMajorAxis:e.getFloat64(120,t),fromSemiMinorAxis:e.getFloat64(136,t),toSemiMajorAxis:e.getFloat64(152,t),toSemiMinorAxis:e.getFloat64(168,t)}}function x1(e,t,n){return String.fromCharCode.apply(null,new Uint8Array(e.buffer.slice(t,n)))}function zW(e,t,n){for(var r=176,i=[],s=0;s<t.nSubgrids;s++){var c=GW(e,r,n),a=VW(e,r,c,n),d=Math.round(1+(c.upperLongitude-c.lowerLongitude)/c.longitudeInterval),p=Math.round(1+(c.upperLatitude-c.lowerLatitude)/c.latitudeInterval);i.push({ll:[Yu(c.lowerLongitude),Yu(c.lowerLatitude)],del:[Yu(c.longitudeInterval),Yu(c.latitudeInterval)],lim:[d,p],count:c.gridNodeCount,cvs:$W(a)}),r+=176+c.gridNodeCount*16}return i}function $W(e){return e.map(function(t){return[Yu(t.longitudeShift),Yu(t.latitudeShift)]})}function GW(e,t,n){return{name:x1(e,t+8,t+16).trim(),parent:x1(e,t+24,t+24+8).trim(),lowerLatitude:e.getFloat64(t+72,n),upperLatitude:e.getFloat64(t+88,n),lowerLongitude:e.getFloat64(t+104,n),upperLongitude:e.getFloat64(t+120,n),latitudeInterval:e.getFloat64(t+136,n),longitudeInterval:e.getFloat64(t+152,n),gridNodeCount:e.getInt32(t+168,n)}}function VW(e,t,n,r){for(var i=t+176,s=16,c=[],a=0;a<n.gridNodeCount;a++){var d={latitudeShift:e.getFloat32(i+a*s,r),longitudeShift:e.getFloat32(i+a*s+4,r),latitudeAccuracy:e.getFloat32(i+a*s+8,r),longitudeAccuracy:e.getFloat32(i+a*s+12,r)};c.push(d)}return c}function Zs(e,t){if(!(this instanceof Zs))return new Zs(e);t=t||function(p){if(p)throw p};var n=vW(e);if(typeof n!="object"){t("Could not parse to valid json: "+e);return}var r=Zs.projections.get(n.projName);if(!r){t("Could not get projection name from: "+e);return}if(n.datumCode&&n.datumCode!=="none"){var i=wl(ey,n.datumCode);i&&(n.datum_params=n.datum_params||(i.towgs84?i.towgs84.split(","):null),n.ellps=i.ellipse,n.datumName=i.datumName?i.datumName:n.datumCode)}n.k0=n.k0||1,n.axis=n.axis||"enu",n.ellps=n.ellps||"wgs84",n.lat1=n.lat1||n.lat0;var s=kW(n.a,n.b,n.rf,n.ellps,n.sphere),c=OW(s.a,s.b,s.rf,n.R_A),a=RW(n.nadgrids),d=n.datum||LW(n.datumCode,n.datum_params,s.a,s.b,c.es,c.ep2,a);wI(this,n),wI(this,r),this.a=s.a,this.b=s.b,this.rf=s.rf,this.sphere=s.sphere,this.es=c.es,this.e=c.e,this.ep2=c.ep2,this.datum=d,this.init(),t(null,this)}Zs.projections=IW,Zs.projections.start();function WW(e,t){return e.datum_type!==t.datum_type||e.a!==t.a||Math.abs(e.es-t.es)>5e-11?!1:e.datum_type===_c?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]:e.datum_type===wc?e.datum_params[0]===t.datum_params[0]&&e.datum_params[1]===t.datum_params[1]&&e.datum_params[2]===t.datum_params[2]&&e.datum_params[3]===t.datum_params[3]&&e.datum_params[4]===t.datum_params[4]&&e.datum_params[5]===t.datum_params[5]&&e.datum_params[6]===t.datum_params[6]:!0}function EI(e,t,n){var r=e.x,i=e.y,s=e.z?e.z:0,c,a,d,p;if(i<-Rt&&i>-1.001*Rt)i=-Rt;else if(i>Rt&&i<1.001*Rt)i=Rt;else{if(i<-Rt)return{x:-1/0,y:-1/0,z:e.z};if(i>Rt)return{x:1/0,y:1/0,z:e.z}}return r>Math.PI&&(r-=2*Math.PI),a=Math.sin(i),p=Math.cos(i),d=a*a,c=n/Math.sqrt(1-t*d),{x:(c+s)*p*Math.cos(r),y:(c+s)*p*Math.sin(r),z:(c*(1-t)+s)*a}}function TI(e,t,n,r){var i=1e-12,s=i*i,c=30,a,d,p,y,g,b,S,w,C,M,O,T,D,N=e.x,k=e.y,L=e.z?e.z:0,j,q,re;if(a=Math.sqrt(N*N+k*k),d=Math.sqrt(N*N+k*k+L*L),a/n<i){if(j=0,d/n<i)return q=Rt,re=-r,{x:e.x,y:e.y,z:e.z}}else j=Math.atan2(k,N);p=L/d,y=a/d,g=1/Math.sqrt(1-t*(2-t)*y*y),w=y*(1-t)*g,C=p*g,D=0;do D++,S=n/Math.sqrt(1-t*C*C),re=a*w+L*C-S*(1-t*C*C),b=t*S/(S+re),g=1/Math.sqrt(1-b*(2-b)*y*y),M=y*(1-b)*g,O=p*g,T=O*w-M*C,w=M,C=O;while(T*T>s&&D<c);return q=Math.atan(O/Math.abs(M)),{x:j,y:q,z:re}}function UW(e,t,n){if(t===_c)return{x:e.x+n[0],y:e.y+n[1],z:e.z+n[2]};if(t===wc){var r=n[0],i=n[1],s=n[2],c=n[3],a=n[4],d=n[5],p=n[6];return{x:p*(e.x-d*e.y+a*e.z)+r,y:p*(d*e.x+e.y-c*e.z)+i,z:p*(-a*e.x+c*e.y+e.z)+s}}}function HW(e,t,n){if(t===_c)return{x:e.x-n[0],y:e.y-n[1],z:e.z-n[2]};if(t===wc){var r=n[0],i=n[1],s=n[2],c=n[3],a=n[4],d=n[5],p=n[6],y=(e.x-r)/p,g=(e.y-i)/p,b=(e.z-s)/p;return{x:y+d*g-a*b,y:-d*y+g+c*b,z:a*y-c*g+b}}}function ty(e){return e===_c||e===wc}function XW(e,t,n){if(WW(e,t)||e.datum_type===g1||t.datum_type===g1)return n;var r=e.a,i=e.es;if(e.datum_type===Xu){var s=II(e,!1,n);if(s!==0)return;r=fI,i=pI}var c=t.a,a=t.b,d=t.es;if(t.datum_type===Xu&&(c=fI,a=J7,d=pI),i===d&&r===c&&!ty(e.datum_type)&&!ty(t.datum_type))return n;if(n=EI(n,i,r),ty(e.datum_type)&&(n=UW(n,e.datum_type,e.datum_params)),ty(t.datum_type)&&(n=HW(n,t.datum_type,t.datum_params)),n=TI(n,d,c,a),t.datum_type===Xu){var p=II(t,!0,n);if(p!==0)return}return n}function II(e,t,n){if(e.grids===null||e.grids.length===0)return console.log("Grid shift grids not found"),-1;var r={x:-n.x,y:n.y},i={x:Number.NaN,y:Number.NaN},s=[];e:for(var c=0;c<e.grids.length;c++){var a=e.grids[c];if(s.push(a.name),a.isNull){i=r;break}if(a.mandatory,a.grid===null){if(a.mandatory)return console.log("Unable to find mandatory grid '"+a.name+"'"),-1;continue}for(var d=a.grid.subgrids,p=0,y=d.length;p<y;p++){var g=d[p],b=(Math.abs(g.del[1])+Math.abs(g.del[0]))/1e4,S=g.ll[0]-b,w=g.ll[1]-b,C=g.ll[0]+(g.lim[0]-1)*g.del[0]+b,M=g.ll[1]+(g.lim[1]-1)*g.del[1]+b;if(!(w>r.y||S>r.x||M<r.y||C<r.x)&&(i=ZW(r,t,g),!isNaN(i.x)))break e}}return isNaN(i.x)?(console.log("Failed to find a grid shift table for location '"+-r.x*Us+" "+r.y*Us+" tried: '"+s+"'"),-1):(n.x=-i.x,n.y=i.y,0)}function ZW(e,t,n){var r={x:Number.NaN,y:Number.NaN};if(isNaN(e.x))return r;var i={x:e.x,y:e.y};i.x-=n.ll[0],i.y-=n.ll[1],i.x=rn(i.x-Math.PI)+Math.PI;var s=PI(i,n);if(t){if(isNaN(s.x))return r;s.x=i.x-s.x,s.y=i.y-s.y;var c=9,a=1e-12,d,p;do{if(p=PI(s,n),isNaN(p.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}d={x:i.x-(p.x+s.x),y:i.y-(p.y+s.y)},s.x+=d.x,s.y+=d.y}while(c--&&Math.abs(d.x)>a&&Math.abs(d.y)>a);if(c<0)return console.log("Inverse grid shift iterator failed to converge."),r;r.x=rn(s.x+n.ll[0]),r.y=s.y+n.ll[1]}else isNaN(s.x)||(r.x=e.x+s.x,r.y=e.y+s.y);return r}function PI(e,t){var n={x:e.x/t.del[0],y:e.y/t.del[1]},r={x:Math.floor(n.x),y:Math.floor(n.y)},i={x:n.x-1*r.x,y:n.y-1*r.y},s={x:Number.NaN,y:Number.NaN},c;if(r.x<0||r.x>=t.lim[0]||r.y<0||r.y>=t.lim[1])return s;c=r.y*t.lim[0]+r.x;var a={x:t.cvs[c][0],y:t.cvs[c][1]};c++;var d={x:t.cvs[c][0],y:t.cvs[c][1]};c+=t.lim[0];var p={x:t.cvs[c][0],y:t.cvs[c][1]};c--;var y={x:t.cvs[c][0],y:t.cvs[c][1]},g=i.x*i.y,b=i.x*(1-i.y),S=(1-i.x)*(1-i.y),w=(1-i.x)*i.y;return s.x=S*a.x+b*d.x+w*y.x+g*p.x,s.y=S*a.y+b*d.y+w*y.y+g*p.y,s}function OI(e,t,n){var r=n.x,i=n.y,s=n.z||0,c,a,d,p={};for(d=0;d<3;d++)if(!(t&&d===2&&n.z===void 0))switch(d===0?(c=r,"ew".indexOf(e.axis[d])!==-1?a="x":a="y"):d===1?(c=i,"ns".indexOf(e.axis[d])!==-1?a="y":a="x"):(c=s,a="z"),e.axis[d]){case"e":p[a]=c;break;case"w":p[a]=-c;break;case"n":p[a]=c;break;case"s":p[a]=-c;break;case"u":n[a]!==void 0&&(p.z=c);break;case"d":n[a]!==void 0&&(p.z=-c);break;default:return null}return p}function kI(e){var t={x:e[0],y:e[1]};return e.length>2&&(t.z=e[2]),e.length>3&&(t.m=e[3]),t}function YW(e){DI(e.x),DI(e.y)}function DI(e){if(typeof Number.isFinite=="function"){if(Number.isFinite(e))return;throw new TypeError("coordinates must be finite numbers")}if(typeof e!="number"||e!==e||!isFinite(e))throw new TypeError("coordinates must be finite numbers")}function qW(e,t){return(e.datum.datum_type===_c||e.datum.datum_type===wc||e.datum.datum_type===Xu)&&t.datumCode!=="WGS84"||(t.datum.datum_type===_c||t.datum.datum_type===wc||t.datum.datum_type===Xu)&&e.datumCode!=="WGS84"}function ny(e,t,n,r){var i;Array.isArray(n)?n=kI(n):n={x:n.x,y:n.y,z:n.z,m:n.m};var s=n.z!==void 0;if(YW(n),e.datum&&t.datum&&qW(e,t)&&(i=new Zs("WGS84"),n=ny(e,i,n,r),e=i),r&&e.axis!=="enu"&&(n=OI(e,!1,n)),e.projName==="longlat")n={x:n.x*Si,y:n.y*Si,z:n.z||0};else if(e.to_meter&&(n={x:n.x*e.to_meter,y:n.y*e.to_meter,z:n.z||0}),n=e.inverse(n),!n)return;if(e.from_greenwich&&(n.x+=e.from_greenwich),n=XW(e.datum,t.datum,n),!!n)return t.from_greenwich&&(n={x:n.x-t.from_greenwich,y:n.y,z:n.z||0}),t.projName==="longlat"?n={x:n.x*Us,y:n.y*Us,z:n.z||0}:(n=t.forward(n),t.to_meter&&(n={x:n.x/t.to_meter,y:n.y/t.to_meter,z:n.z||0})),r&&t.axis!=="enu"?OI(t,!0,n):(n&&!s&&delete n.z,n)}var LI=Zs("WGS84");function _1(e,t,n,r){var i,s,c;return Array.isArray(n)?(i=ny(e,t,n,r)||{x:NaN,y:NaN},n.length>2?typeof e.name<"u"&&e.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"?typeof i.z=="number"?[i.x,i.y,i.z].concat(n.slice(3)):[i.x,i.y,n[2]].concat(n.slice(3)):[i.x,i.y].concat(n.slice(2)):[i.x,i.y]):(s=ny(e,t,n,r),c=Object.keys(n),c.length===2||c.forEach(function(a){if(typeof e.name<"u"&&e.name==="geocent"||typeof t.name<"u"&&t.name==="geocent"){if(a==="x"||a==="y"||a==="z")return}else if(a==="x"||a==="y")return;s[a]=n[a]}),s)}function NI(e){return e instanceof Zs?e:e.oProj?e.oProj:Zs(e)}function fa(e,t,n){e=NI(e);var r=!1,i;return typeof t>"u"?(t=e,e=LI,r=!0):(typeof t.x<"u"||Array.isArray(t))&&(n=t,t=e,e=LI,r=!0),t=NI(t),n?_1(e,t,n):(i={forward:function(s,c){return _1(e,t,s,c)},inverse:function(s,c){return _1(t,e,s,c)}},r&&(i.oProj=t),i)}var RI=6,jI="AJSAJS",BI="AFAFAF",qu=65,pa=73,Ja=79,df=86,ff=90;const JW={forward:FI,inverse:KW,toPoint:zI};function FI(e,t){return t=t||5,tU(QW({lat:e[1],lon:e[0]}),t)}function KW(e){var t=S1(VI(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat,t.lon,t.lat]:[t.left,t.bottom,t.right,t.top]}function zI(e){var t=S1(VI(e.toUpperCase()));return t.lat&&t.lon?[t.lon,t.lat]:[(t.left+t.right)/2,(t.top+t.bottom)/2]}function w1(e){return e*(Math.PI/180)}function $I(e){return 180*(e/Math.PI)}function QW(e){var t=e.lat,n=e.lon,r=6378137,i=.00669438,s=.9996,c,a,d,p,y,g,b,S=w1(t),w=w1(n),C,M;M=Math.floor((n+180)/6)+1,n===180&&(M=60),t>=56&&t<64&&n>=3&&n<12&&(M=32),t>=72&&t<84&&(n>=0&&n<9?M=31:n>=9&&n<21?M=33:n>=21&&n<33?M=35:n>=33&&n<42&&(M=37)),c=(M-1)*6-180+3,C=w1(c),a=i/(1-i),d=r/Math.sqrt(1-i*Math.sin(S)*Math.sin(S)),p=Math.tan(S)*Math.tan(S),y=a*Math.cos(S)*Math.cos(S),g=Math.cos(S)*(w-C),b=r*((1-i/4-3*i*i/64-5*i*i*i/256)*S-(3*i/8+3*i*i/32+45*i*i*i/1024)*Math.sin(2*S)+(15*i*i/256+45*i*i*i/1024)*Math.sin(4*S)-35*i*i*i/3072*Math.sin(6*S));var O=s*d*(g+(1-p+y)*g*g*g/6+(5-18*p+p*p+72*y-58*a)*g*g*g*g*g/120)+5e5,T=s*(b+d*Math.tan(S)*(g*g/2+(5-p+9*y+4*y*y)*g*g*g*g/24+(61-58*p+p*p+600*y-330*a)*g*g*g*g*g*g/720));return t<0&&(T+=1e7),{northing:Math.round(T),easting:Math.round(O),zoneNumber:M,zoneLetter:eU(t)}}function S1(e){var t=e.northing,n=e.easting,r=e.zoneLetter,i=e.zoneNumber;if(i<0||i>60)return null;var s=.9996,c=6378137,a=.00669438,d,p=(1-Math.sqrt(1-a))/(1+Math.sqrt(1-a)),y,g,b,S,w,C,M,O,T,D=n-5e5,N=t;r<"N"&&(N-=1e7),M=(i-1)*6-180+3,d=a/(1-a),C=N/s,O=C/(c*(1-a/4-3*a*a/64-5*a*a*a/256)),T=O+(3*p/2-27*p*p*p/32)*Math.sin(2*O)+(21*p*p/16-55*p*p*p*p/32)*Math.sin(4*O)+151*p*p*p/96*Math.sin(6*O),y=c/Math.sqrt(1-a*Math.sin(T)*Math.sin(T)),g=Math.tan(T)*Math.tan(T),b=d*Math.cos(T)*Math.cos(T),S=c*(1-a)/Math.pow(1-a*Math.sin(T)*Math.sin(T),1.5),w=D/(y*s);var k=T-y*Math.tan(T)/S*(w*w/2-(5+3*g+10*b-4*b*b-9*d)*w*w*w*w/24+(61+90*g+298*b+45*g*g-252*d-3*b*b)*w*w*w*w*w*w/720);k=$I(k);var L=(w-(1+2*g+b)*w*w*w/6+(5-2*b+28*g-3*b*b+8*d+24*g*g)*w*w*w*w*w/120)/Math.cos(T);L=M+$I(L);var j;if(e.accuracy){var q=S1({northing:e.northing+e.accuracy,easting:e.easting+e.accuracy,zoneLetter:e.zoneLetter,zoneNumber:e.zoneNumber});j={top:q.lat,right:q.lon,bottom:k,left:L}}else j={lat:k,lon:L};return j}function eU(e){var t="Z";return 84>=e&&e>=72?t="X":72>e&&e>=64?t="W":64>e&&e>=56?t="V":56>e&&e>=48?t="U":48>e&&e>=40?t="T":40>e&&e>=32?t="S":32>e&&e>=24?t="R":24>e&&e>=16?t="Q":16>e&&e>=8?t="P":8>e&&e>=0?t="N":0>e&&e>=-8?t="M":-8>e&&e>=-16?t="L":-16>e&&e>=-24?t="K":-24>e&&e>=-32?t="J":-32>e&&e>=-40?t="H":-40>e&&e>=-48?t="G":-48>e&&e>=-56?t="F":-56>e&&e>=-64?t="E":-64>e&&e>=-72?t="D":-72>e&&e>=-80&&(t="C"),t}function tU(e,t){var n="00000"+e.easting,r="00000"+e.northing;return e.zoneNumber+e.zoneLetter+nU(e.easting,e.northing,e.zoneNumber)+n.substr(n.length-5,t)+r.substr(r.length-5,t)}function nU(e,t,n){var r=GI(n),i=Math.floor(e/1e5),s=Math.floor(t/1e5)%20;return rU(i,s,r)}function GI(e){var t=e%RI;return t===0&&(t=RI),t}function rU(e,t,n){var r=n-1,i=jI.charCodeAt(r),s=BI.charCodeAt(r),c=i+e-1,a=s+t,d=!1;c>ff&&(c=c-ff+qu-1,d=!0),(c===pa||i<pa&&c>pa||(c>pa||i<pa)&&d)&&c++,(c===Ja||i<Ja&&c>Ja||(c>Ja||i<Ja)&&d)&&(c++,c===pa&&c++),c>ff&&(c=c-ff+qu-1),a>df?(a=a-df+qu-1,d=!0):d=!1,(a===pa||s<pa&&a>pa||(a>pa||s<pa)&&d)&&a++,(a===Ja||s<Ja&&a>Ja||(a>Ja||s<Ja)&&d)&&(a++,a===pa&&a++),a>df&&(a=a-df+qu-1);var p=String.fromCharCode(c)+String.fromCharCode(a);return p}function VI(e){if(e&&e.length===0)throw"MGRSPoint coverting from nothing";for(var t=e.length,n=null,r="",i,s=0;!/[A-Z]/.test(i=e.charAt(s));){if(s>=2)throw"MGRSPoint bad conversion from: "+e;r+=i,s++}var c=parseInt(r,10);if(s===0||s+3>t)throw"MGRSPoint bad conversion from: "+e;var a=e.charAt(s++);if(a<="A"||a==="B"||a==="Y"||a>="Z"||a==="I"||a==="O")throw"MGRSPoint zone letter "+a+" not handled: "+e;n=e.substring(s,s+=2);for(var d=GI(c),p=iU(n.charAt(0),d),y=aU(n.charAt(1),d);y<sU(a);)y+=2e6;var g=t-s;if(g%2!==0)throw`MGRSPoint has to have an even number
815
815
  of digits after the zone letter and two 100km letters - front
816
816
  half for easting meters, second half for
817
817
  northing meters`+e;var b=g/2,S=0,w=0,C,M,O,T,D;return b>0&&(C=1e5/Math.pow(10,b),M=e.substring(s,s+b),S=parseFloat(M)*C,O=e.substring(s+b),w=parseFloat(O)*C),T=S+p,D=w+y,{easting:T,northing:D,zoneLetter:a,zoneNumber:c,accuracy:C}}function iU(e,t){for(var n=jI.charCodeAt(t-1),r=1e5,i=!1;n!==e.charCodeAt(0);){if(n++,n===pa&&n++,n===Ja&&n++,n>ff){if(i)throw"Bad character: "+e;n=qu,i=!0}r+=1e5}return r}function aU(e,t){if(e>"V")throw"MGRSPoint given invalid Northing "+e;for(var n=BI.charCodeAt(t-1),r=0,i=!1;n!==e.charCodeAt(0);){if(n++,n===pa&&n++,n===Ja&&n++,n>df){if(i)throw"Bad character: "+e;n=qu,i=!0}r+=1e5}return r}function sU(e){var t;switch(e){case"C":t=11e5;break;case"D":t=2e6;break;case"E":t=28e5;break;case"F":t=37e5;break;case"G":t=46e5;break;case"H":t=55e5;break;case"J":t=64e5;break;case"K":t=73e5;break;case"L":t=82e5;break;case"M":t=91e5;break;case"N":t=0;break;case"P":t=8e5;break;case"Q":t=17e5;break;case"R":t=26e5;break;case"S":t=35e5;break;case"T":t=44e5;break;case"U":t=53e5;break;case"V":t=62e5;break;case"W":t=7e6;break;case"X":t=79e5;break;default:t=-1}if(t>=0)return t;throw"Invalid zone letter: "+e}function Ju(e,t,n){if(!(this instanceof Ju))return new Ju(e,t,n);if(Array.isArray(e))this.x=e[0],this.y=e[1],this.z=e[2]||0;else if(typeof e=="object")this.x=e.x,this.y=e.y,this.z=e.z||0;else if(typeof e=="string"&&typeof t>"u"){var r=e.split(",");this.x=parseFloat(r[0],10),this.y=parseFloat(r[1],10),this.z=parseFloat(r[2],10)||0}else this.x=e,this.y=t,this.z=n||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Ju.fromMGRS=function(e){return new Ju(zI(e))},Ju.prototype.toMGRS=function(e){return FI([this.x,this.y],e)};var oU=1,lU=.25,WI=.046875,UI=.01953125,HI=.01068115234375,cU=.75,uU=.46875,hU=.013020833333333334,dU=.007120768229166667,fU=.3645833333333333,pU=.005696614583333333,mU=.3076171875;function C1(e){var t=[];t[0]=oU-e*(lU+e*(WI+e*(UI+e*HI))),t[1]=e*(cU-e*(WI+e*(UI+e*HI)));var n=e*e;return t[2]=n*(uU-e*(hU+e*dU)),n*=e,t[3]=n*(fU-e*pU),t[4]=n*e*mU,t}function Ku(e,t,n,r){return n*=t,t*=t,r[0]*e-n*(r[1]+t*(r[2]+t*(r[3]+t*r[4])))}var gU=20;function M1(e,t,n){for(var r=1/(1-t),i=e,s=gU;s;--s){var c=Math.sin(i),a=1-t*c*c;if(a=(Ku(i,c,Math.cos(i),n)-e)*(a*Math.sqrt(a))*r,i-=a,Math.abs(a)<Qt)return i}return i}function yU(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=C1(this.es),this.ml0=Ku(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function vU(e){var t=e.x,n=e.y,r=rn(t-this.long0),i,s,c,a=Math.sin(n),d=Math.cos(n);if(this.es){var y=d*r,g=Math.pow(y,2),b=this.ep2*Math.pow(d,2),S=Math.pow(b,2),w=Math.abs(d)>Qt?Math.tan(n):0,C=Math.pow(w,2),M=Math.pow(C,2);i=1-this.es*Math.pow(a,2),y=y/Math.sqrt(i);var O=Ku(n,a,d,this.en);s=this.a*(this.k0*y*(1+g/6*(1-C+b+g/20*(5-18*C+M+14*b-58*C*b+g/42*(61+179*M-M*C-479*C)))))+this.x0,c=this.a*(this.k0*(O-this.ml0+a*r*y/2*(1+g/12*(5-C+9*b+4*S+g/30*(61+M-58*C+270*b-330*C*b+g/56*(1385+543*M-M*C-3111*C))))))+this.y0}else{var p=d*Math.sin(r);if(Math.abs(Math.abs(p)-1)<Qt)return 93;if(s=.5*this.a*this.k0*Math.log((1+p)/(1-p))+this.x0,c=d*Math.cos(r)/Math.sqrt(1-Math.pow(p,2)),p=Math.abs(c),p>=1){if(p-1>Qt)return 93;c=0}else c=Math.acos(c);n<0&&(c=-c),c=this.a*this.k0*(c-this.lat0)+this.y0}return e.x=s,e.y=c,e}function bU(e){var t,n,r,i,s=(e.x-this.x0)*(1/this.a),c=(e.y-this.y0)*(1/this.a);if(this.es)if(t=this.ml0+c/this.k0,n=M1(t,this.es,this.en),Math.abs(n)<Rt){var g=Math.sin(n),b=Math.cos(n),S=Math.abs(b)>Qt?Math.tan(n):0,w=this.ep2*Math.pow(b,2),C=Math.pow(w,2),M=Math.pow(S,2),O=Math.pow(M,2);t=1-this.es*Math.pow(g,2);var T=s*Math.sqrt(t)/this.k0,D=Math.pow(T,2);t=t*S,r=n-t*D/(1-this.es)*.5*(1-D/12*(5+3*M-9*w*M+w-4*C-D/30*(61+90*M-252*w*M+45*O+46*w-D/56*(1385+3633*M+4095*O+1574*O*M)))),i=rn(this.long0+T*(1-D/6*(1+2*M+w-D/20*(5+28*M+24*O+8*w*M+6*w-D/42*(61+662*M+1320*O+720*O*M))))/b)}else r=Rt*uf(c),i=0;else{var a=Math.exp(s/this.k0),d=.5*(a-1/a),p=this.lat0+c/this.k0,y=Math.cos(p);t=Math.sqrt((1-Math.pow(y,2))/(1+Math.pow(d,2))),r=Math.asin(t),c<0&&(r=-r),d===0&&y===0?i=0:i=rn(Math.atan2(d,y)+this.long0)}return e.x=i,e.y=r,e}var xU=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const ry={init:yU,forward:vU,inverse:bU,names:xU};function XI(e){var t=Math.exp(e);return t=(t-1/t)/2,t}function ma(e,t){e=Math.abs(e),t=Math.abs(t);var n=Math.max(e,t),r=Math.min(e,t)/(n||1);return n*Math.sqrt(1+Math.pow(r,2))}function _U(e){var t=1+e,n=t-1;return n===0?e:e*Math.log(t)/n}function wU(e){var t=Math.abs(e);return t=_U(t*(1+t/(ma(1,t)+1))),e<0?-t:t}function A1(e,t){for(var n=2*Math.cos(2*t),r=e.length-1,i=e[r],s=0,c;--r>=0;)c=-s+n*i+e[r],s=i,i=c;return t+c*Math.sin(2*t)}function SU(e,t){for(var n=2*Math.cos(t),r=e.length-1,i=e[r],s=0,c;--r>=0;)c=-s+n*i+e[r],s=i,i=c;return Math.sin(t)*c}function CU(e){var t=Math.exp(e);return t=(t+1/t)/2,t}function ZI(e,t,n){for(var r=Math.sin(t),i=Math.cos(t),s=XI(n),c=CU(n),a=2*i*c,d=-2*r*s,p=e.length-1,y=e[p],g=0,b=0,S=0,w,C;--p>=0;)w=b,C=g,b=y,g=S,y=-w+a*b-d*g+e[p],S=-C+d*b+a*g;return a=r*c,d=i*s,[a*y-d*S,a*S+d*y]}function MU(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(ry.init.apply(this),this.forward=ry.forward,this.inverse=ry.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var e=this.es/(1+Math.sqrt(1-this.es)),t=e/(2-e),n=t;this.cgb[0]=t*(2+t*(-2/3+t*(-2+t*(116/45+t*(26/45+t*(-2854/675)))))),this.cbg[0]=t*(-2+t*(2/3+t*(4/3+t*(-82/45+t*(32/45+t*(4642/4725)))))),n=n*t,this.cgb[1]=n*(7/3+t*(-8/5+t*(-227/45+t*(2704/315+t*(2323/945))))),this.cbg[1]=n*(5/3+t*(-16/15+t*(-13/9+t*(904/315+t*(-1522/945))))),n=n*t,this.cgb[2]=n*(56/15+t*(-136/35+t*(-1262/105+t*(73814/2835)))),this.cbg[2]=n*(-26/15+t*(34/21+t*(8/5+t*(-12686/2835)))),n=n*t,this.cgb[3]=n*(4279/630+t*(-332/35+t*(-399572/14175))),this.cbg[3]=n*(1237/630+t*(-12/5+t*(-24832/14175))),n=n*t,this.cgb[4]=n*(4174/315+t*(-144838/6237)),this.cbg[4]=n*(-734/315+t*(109598/31185)),n=n*t,this.cgb[5]=n*(601676/22275),this.cbg[5]=n*(444337/155925),n=Math.pow(t,2),this.Qn=this.k0/(1+t)*(1+n*(1/4+n*(1/64+n/256))),this.utg[0]=t*(-.5+t*(2/3+t*(-37/96+t*(1/360+t*(81/512+t*(-96199/604800)))))),this.gtu[0]=t*(.5+t*(-2/3+t*(5/16+t*(41/180+t*(-127/288+t*(7891/37800)))))),this.utg[1]=n*(-1/48+t*(-1/15+t*(437/1440+t*(-46/105+t*(1118711/3870720))))),this.gtu[1]=n*(13/48+t*(-3/5+t*(557/1440+t*(281/630+t*(-1983433/1935360))))),n=n*t,this.utg[2]=n*(-17/480+t*(37/840+t*(209/4480+t*(-5569/90720)))),this.gtu[2]=n*(61/240+t*(-103/140+t*(15061/26880+t*(167603/181440)))),n=n*t,this.utg[3]=n*(-4397/161280+t*(11/504+t*(830251/7257600))),this.gtu[3]=n*(49561/161280+t*(-179/168+t*(6601661/7257600))),n=n*t,this.utg[4]=n*(-4583/161280+t*(108847/3991680)),this.gtu[4]=n*(34729/80640+t*(-3418889/1995840)),n=n*t,this.utg[5]=n*(-20648693/638668800),this.gtu[5]=n*(212378941/319334400);var r=A1(this.cbg,this.lat0);this.Zb=-this.Qn*(r+SU(this.gtu,2*r))}function AU(e){var t=rn(e.x-this.long0),n=e.y;n=A1(this.cbg,n);var r=Math.sin(n),i=Math.cos(n),s=Math.sin(t),c=Math.cos(t);n=Math.atan2(r,c*i),t=Math.atan2(s*i,ma(r,i*c)),t=wU(Math.tan(t));var a=ZI(this.gtu,2*n,2*t);n=n+a[0],t=t+a[1];var d,p;return Math.abs(t)<=2.623395162778?(d=this.a*(this.Qn*t)+this.x0,p=this.a*(this.Qn*n+this.Zb)+this.y0):(d=1/0,p=1/0),e.x=d,e.y=p,e}function EU(e){var t=(e.x-this.x0)*(1/this.a),n=(e.y-this.y0)*(1/this.a);n=(n-this.Zb)/this.Qn,t=t/this.Qn;var r,i;if(Math.abs(t)<=2.623395162778){var s=ZI(this.utg,2*n,2*t);n=n+s[0],t=t+s[1],t=Math.atan(XI(t));var c=Math.sin(n),a=Math.cos(n),d=Math.sin(t),p=Math.cos(t);n=Math.atan2(c*p,ma(d,p*a)),t=Math.atan2(d,p*a),r=rn(t+this.long0),i=A1(this.cgb,n)}else r=1/0,i=1/0;return e.x=r,e.y=i,e}var TU=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const iy={init:MU,forward:AU,inverse:EU,names:TU};function IU(e,t){if(e===void 0){if(e=Math.floor((rn(t)+Math.PI)*30/Math.PI)+1,e<0)return 0;if(e>60)return 60}return e}var PU="etmerc";function OU(){var e=IU(this.zone,this.long0);if(e===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(e)-183)*Si,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,iy.init.apply(this),this.forward=iy.forward,this.inverse=iy.inverse}var kU=["Universal Transverse Mercator System","utm"];const DU={init:OU,names:kU,dependsOn:PU};function E1(e,t){return Math.pow((1-e)/(1+e),t)}var LU=20;function NU(){var e=Math.sin(this.lat0),t=Math.cos(this.lat0);t*=t,this.rc=Math.sqrt(1-this.es)/(1-this.es*e*e),this.C=Math.sqrt(1+this.es*t*t/(1-this.es)),this.phic0=Math.asin(e/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+ur)/(Math.pow(Math.tan(.5*this.lat0+ur),this.C)*E1(this.e*e,this.ratexp))}function RU(e){var t=e.x,n=e.y;return e.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*n+ur),this.C)*E1(this.e*Math.sin(n),this.ratexp))-Rt,e.x=this.C*t,e}function jU(e){for(var t=1e-14,n=e.x/this.C,r=e.y,i=Math.pow(Math.tan(.5*r+ur)/this.K,1/this.C),s=LU;s>0&&(r=2*Math.atan(i*E1(this.e*Math.sin(e.y),-.5*this.e))-Rt,!(Math.abs(r-e.y)<t));--s)e.y=r;return s?(e.x=n,e.y=r,e):null}var BU=["gauss"];const T1={init:NU,forward:RU,inverse:jU,names:BU};function FU(){T1.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function zU(e){var t,n,r,i;return e.x=rn(e.x-this.long0),T1.forward.apply(this,[e]),t=Math.sin(e.y),n=Math.cos(e.y),r=Math.cos(e.x),i=this.k0*this.R2/(1+this.sinc0*t+this.cosc0*n*r),e.x=i*n*Math.sin(e.x),e.y=i*(this.cosc0*t-this.sinc0*n*r),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function $U(e){var t,n,r,i,s;if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,s=ma(e.x,e.y)){var c=2*Math.atan2(s,this.R2);t=Math.sin(c),n=Math.cos(c),i=Math.asin(n*this.sinc0+e.y*t*this.cosc0/s),r=Math.atan2(e.x*t,s*this.cosc0*n-e.y*this.sinc0*t)}else i=this.phic0,r=0;return e.x=r,e.y=i,T1.inverse.apply(this,[e]),e.x=rn(e.x+this.long0),e}var GU=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const VU={init:FU,forward:zU,inverse:$U,names:GU};function WU(e,t,n){return t*=n,Math.tan(.5*(Rt+e))*Math.pow((1-t)/(1+t),.5*n)}function UU(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Qt&&(this.k0=.5*(1+uf(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=Qt&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=Qt&&Math.abs(Math.cos(this.lat_ts))>Qt&&(this.k0=.5*this.cons*Xs(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/vs(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=Xs(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Rt,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function HU(e){var t=e.x,n=e.y,r=Math.sin(n),i=Math.cos(n),s,c,a,d,p,y,g=rn(t-this.long0);return Math.abs(Math.abs(t-this.long0)-Math.PI)<=Qt&&Math.abs(n+this.lat0)<=Qt?(e.x=NaN,e.y=NaN,e):this.sphere?(s=2*this.k0/(1+this.sinlat0*r+this.coslat0*i*Math.cos(g)),e.x=this.a*s*i*Math.sin(g)+this.x0,e.y=this.a*s*(this.coslat0*r-this.sinlat0*i*Math.cos(g))+this.y0,e):(c=2*Math.atan(this.ssfn_(n,r,this.e))-Rt,d=Math.cos(c),a=Math.sin(c),Math.abs(this.coslat0)<=Qt?(p=vs(this.e,n*this.con,this.con*r),y=2*this.a*this.k0*p/this.cons,e.x=this.x0+y*Math.sin(t-this.long0),e.y=this.y0-this.con*y*Math.cos(t-this.long0),e):(Math.abs(this.sinlat0)<Qt?(s=2*this.a*this.k0/(1+d*Math.cos(g)),e.y=s*a):(s=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*a+this.cosX0*d*Math.cos(g))),e.y=s*(this.cosX0*a-this.sinX0*d*Math.cos(g))+this.y0),e.x=s*d*Math.sin(g)+this.x0,e))}function XU(e){e.x-=this.x0,e.y-=this.y0;var t,n,r,i,s,c=Math.sqrt(e.x*e.x+e.y*e.y);if(this.sphere){var a=2*Math.atan(c/(2*this.a*this.k0));return t=this.long0,n=this.lat0,c<=Qt?(e.x=t,e.y=n,e):(n=Math.asin(Math.cos(a)*this.sinlat0+e.y*Math.sin(a)*this.coslat0/c),Math.abs(this.coslat0)<Qt?this.lat0>0?t=rn(this.long0+Math.atan2(e.x,-1*e.y)):t=rn(this.long0+Math.atan2(e.x,e.y)):t=rn(this.long0+Math.atan2(e.x*Math.sin(a),c*this.coslat0*Math.cos(a)-e.y*this.sinlat0*Math.sin(a))),e.x=t,e.y=n,e)}else if(Math.abs(this.coslat0)<=Qt){if(c<=Qt)return n=this.lat0,t=this.long0,e.x=t,e.y=n,e;e.x*=this.con,e.y*=this.con,r=c*this.cons/(2*this.a*this.k0),n=this.con*hf(this.e,r),t=this.con*rn(this.con*this.long0+Math.atan2(e.x,-1*e.y))}else i=2*Math.atan(c*this.cosX0/(2*this.a*this.k0*this.ms1)),t=this.long0,c<=Qt?s=this.X0:(s=Math.asin(Math.cos(i)*this.sinX0+e.y*Math.sin(i)*this.cosX0/c),t=rn(this.long0+Math.atan2(e.x*Math.sin(i),c*this.cosX0*Math.cos(i)-e.y*this.sinX0*Math.sin(i)))),n=-1*hf(this.e,Math.tan(.5*(Rt+s)));return e.x=t,e.y=n,e}var ZU=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"];const YU={init:UU,forward:HU,inverse:XU,names:ZU,ssfn_:WU};function qU(){var e=this.lat0;this.lambda0=this.long0;var t=Math.sin(e),n=this.a,r=this.rf,i=1/r,s=2*i-Math.pow(i,2),c=this.e=Math.sqrt(s);this.R=this.k0*n*Math.sqrt(1-s)/(1-s*Math.pow(t,2)),this.alpha=Math.sqrt(1+s/(1-s)*Math.pow(Math.cos(e),4)),this.b0=Math.asin(t/this.alpha);var a=Math.log(Math.tan(Math.PI/4+this.b0/2)),d=Math.log(Math.tan(Math.PI/4+e/2)),p=Math.log((1+c*t)/(1-c*t));this.K=a-this.alpha*d+this.alpha*c/2*p}function JU(e){var t=Math.log(Math.tan(Math.PI/4-e.y/2)),n=this.e/2*Math.log((1+this.e*Math.sin(e.y))/(1-this.e*Math.sin(e.y))),r=-this.alpha*(t+n)+this.K,i=2*(Math.atan(Math.exp(r))-Math.PI/4),s=this.alpha*(e.x-this.lambda0),c=Math.atan(Math.sin(s)/(Math.sin(this.b0)*Math.tan(i)+Math.cos(this.b0)*Math.cos(s))),a=Math.asin(Math.cos(this.b0)*Math.sin(i)-Math.sin(this.b0)*Math.cos(i)*Math.cos(s));return e.y=this.R/2*Math.log((1+Math.sin(a))/(1-Math.sin(a)))+this.y0,e.x=this.R*c+this.x0,e}function KU(e){for(var t=e.x-this.x0,n=e.y-this.y0,r=t/this.R,i=2*(Math.atan(Math.exp(n/this.R))-Math.PI/4),s=Math.asin(Math.cos(this.b0)*Math.sin(i)+Math.sin(this.b0)*Math.cos(i)*Math.cos(r)),c=Math.atan(Math.sin(r)/(Math.cos(this.b0)*Math.cos(r)-Math.sin(this.b0)*Math.tan(i))),a=this.lambda0+c/this.alpha,d=0,p=s,y=-1e3,g=0;Math.abs(p-y)>1e-7;){if(++g>20)return;d=1/this.alpha*(Math.log(Math.tan(Math.PI/4+s/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(p))/2)),y=p,p=2*Math.atan(Math.exp(d))-Math.PI/2}return e.x=a,e.y=p,e}var QU=["somerc"];const eH={init:qU,forward:JU,inverse:KU,names:QU};var Qu=1e-7;function tH(e){var t=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],n=typeof e.PROJECTION=="object"?Object.keys(e.PROJECTION)[0]:e.PROJECTION;return"no_uoff"in e||"no_off"in e||t.indexOf(n)!==-1}function nH(){var e,t,n,r,i,s,c,a,d,p,y=0,g,b=0,S=0,w=0,C=0,M=0,O=0;this.no_off=tH(this),this.no_rot="no_rot"in this;var T=!1;"alpha"in this&&(T=!0);var D=!1;if("rectified_grid_angle"in this&&(D=!0),T&&(O=this.alpha),D&&(y=this.rectified_grid_angle*Si),T||D)b=this.longc;else if(S=this.long1,C=this.lat1,w=this.long2,M=this.lat2,Math.abs(C-M)<=Qu||(e=Math.abs(C))<=Qu||Math.abs(e-Rt)<=Qu||Math.abs(Math.abs(this.lat0)-Rt)<=Qu||Math.abs(Math.abs(M)-Rt)<=Qu)throw new Error;var N=1-this.es;t=Math.sqrt(N),Math.abs(this.lat0)>Qt?(a=Math.sin(this.lat0),n=Math.cos(this.lat0),e=1-this.es*a*a,this.B=n*n,this.B=Math.sqrt(1+this.es*this.B*this.B/N),this.A=this.B*this.k0*t/e,r=this.B*t/(n*Math.sqrt(e)),i=r*r-1,i<=0?i=0:(i=Math.sqrt(i),this.lat0<0&&(i=-i)),this.E=i+=r,this.E*=Math.pow(vs(this.e,this.lat0,a),this.B)):(this.B=1/t,this.A=this.k0,this.E=r=i=1),T||D?(T?(g=Math.asin(Math.sin(O)/r),D||(y=O)):(g=y,O=Math.asin(r*Math.sin(g))),this.lam0=b-Math.asin(.5*(i-1/i)*Math.tan(g))/this.B):(s=Math.pow(vs(this.e,C,Math.sin(C)),this.B),c=Math.pow(vs(this.e,M,Math.sin(M)),this.B),i=this.E/s,d=(c-s)/(c+s),p=this.E*this.E,p=(p-c*s)/(p+c*s),e=S-w,e<-Math.pi?w-=lf:e>Math.pi&&(w+=lf),this.lam0=rn(.5*(S+w)-Math.atan(p*Math.tan(.5*this.B*(S-w))/d)/this.B),g=Math.atan(2*Math.sin(this.B*rn(S-this.lam0))/(i-1/i)),y=O=Math.asin(r*Math.sin(g))),this.singam=Math.sin(g),this.cosgam=Math.cos(g),this.sinrot=Math.sin(y),this.cosrot=Math.cos(y),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.A*this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(r*r-1)/Math.cos(O))),this.lat0<0&&(this.u_0=-this.u_0)),i=.5*g,this.v_pole_n=this.ArB*Math.log(Math.tan(ur-i)),this.v_pole_s=this.ArB*Math.log(Math.tan(ur+i))}function rH(e){var t={},n,r,i,s,c,a,d,p;if(e.x=e.x-this.lam0,Math.abs(Math.abs(e.y)-Rt)>Qt){if(c=this.E/Math.pow(vs(this.e,e.y,Math.sin(e.y)),this.B),a=1/c,n=.5*(c-a),r=.5*(c+a),s=Math.sin(this.B*e.x),i=(n*this.singam-s*this.cosgam)/r,Math.abs(Math.abs(i)-1)<Qt)throw new Error;p=.5*this.ArB*Math.log((1-i)/(1+i)),a=Math.cos(this.B*e.x),Math.abs(a)<Qu?d=this.A*e.x:d=this.ArB*Math.atan2(n*this.cosgam+s*this.singam,a)}else p=e.y>0?this.v_pole_n:this.v_pole_s,d=this.ArB*e.y;return this.no_rot?(t.x=d,t.y=p):(d-=this.u_0,t.x=p*this.cosrot+d*this.sinrot,t.y=d*this.cosrot-p*this.sinrot),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function iH(e){var t,n,r,i,s,c,a,d={};if(e.x=(e.x-this.x0)*(1/this.a),e.y=(e.y-this.y0)*(1/this.a),this.no_rot?(n=e.y,t=e.x):(n=e.x*this.cosrot-e.y*this.sinrot,t=e.y*this.cosrot+e.x*this.sinrot+this.u_0),r=Math.exp(-this.BrA*n),i=.5*(r-1/r),s=.5*(r+1/r),c=Math.sin(this.BrA*t),a=(c*this.cosgam+i*this.singam)/s,Math.abs(Math.abs(a)-1)<Qt)d.x=0,d.y=a<0?-Rt:Rt;else{if(d.y=this.E/Math.sqrt((1+a)/(1-a)),d.y=hf(this.e,Math.pow(d.y,1/this.B)),d.y===1/0)throw new Error;d.x=-this.rB*Math.atan2(i*this.cosgam-c*this.singam,Math.cos(this.BrA*t))}return d.x+=this.lam0,d}var aH=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const sH={init:nH,forward:rH,inverse:iH,names:aH};function oH(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<Qt)){var e=this.b/this.a;this.e=Math.sqrt(1-e*e);var t=Math.sin(this.lat1),n=Math.cos(this.lat1),r=Xs(this.e,t,n),i=vs(this.e,this.lat1,t),s=Math.sin(this.lat2),c=Math.cos(this.lat2),a=Xs(this.e,s,c),d=vs(this.e,this.lat2,s),p=vs(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>Qt?this.ns=Math.log(r/a)/Math.log(i/d):this.ns=t,isNaN(this.ns)&&(this.ns=t),this.f0=r/(this.ns*Math.pow(i,this.ns)),this.rh=this.a*this.f0*Math.pow(p,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function lH(e){var t=e.x,n=e.y;Math.abs(2*Math.abs(n)-Math.PI)<=Qt&&(n=uf(n)*(Rt-2*Qt));var r=Math.abs(Math.abs(n)-Rt),i,s;if(r>Qt)i=vs(this.e,n,Math.sin(n)),s=this.a*this.f0*Math.pow(i,this.ns);else{if(r=n*this.ns,r<=0)return null;s=0}var c=this.ns*rn(t-this.long0);return e.x=this.k0*(s*Math.sin(c))+this.x0,e.y=this.k0*(this.rh-s*Math.cos(c))+this.y0,e}function cH(e){var t,n,r,i,s,c=(e.x-this.x0)/this.k0,a=this.rh-(e.y-this.y0)/this.k0;this.ns>0?(t=Math.sqrt(c*c+a*a),n=1):(t=-Math.sqrt(c*c+a*a),n=-1);var d=0;if(t!==0&&(d=Math.atan2(n*c,n*a)),t!==0||this.ns>0){if(n=1/this.ns,r=Math.pow(t/(this.a*this.f0),n),i=hf(this.e,r),i===-9999)return null}else i=-Rt;return s=rn(d/this.ns+this.long0),e.x=s,e.y=i,e}var uH=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const hH={init:oH,forward:lH,inverse:cH,names:uH};function dH(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function fH(e){var t,n,r,i,s,c,a,d=e.x,p=e.y,y=rn(d-this.long0);return t=Math.pow((1+this.e*Math.sin(p))/(1-this.e*Math.sin(p)),this.alfa*this.e/2),n=2*(Math.atan(this.k*Math.pow(Math.tan(p/2+this.s45),this.alfa)/t)-this.s45),r=-y*this.alfa,i=Math.asin(Math.cos(this.ad)*Math.sin(n)+Math.sin(this.ad)*Math.cos(n)*Math.cos(r)),s=Math.asin(Math.cos(n)*Math.sin(r)/Math.cos(i)),c=this.n*s,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(i/2+this.s45),this.n),e.y=a*Math.cos(c)/1,e.x=a*Math.sin(c)/1,this.czech||(e.y*=-1,e.x*=-1),e}function pH(e){var t,n,r,i,s,c,a,d,p=e.x;e.x=e.y,e.y=p,this.czech||(e.y*=-1,e.x*=-1),c=Math.sqrt(e.x*e.x+e.y*e.y),s=Math.atan2(e.y,e.x),i=s/Math.sin(this.s0),r=2*(Math.atan(Math.pow(this.ro0/c,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),t=Math.asin(Math.cos(this.ad)*Math.sin(r)-Math.sin(this.ad)*Math.cos(r)*Math.cos(i)),n=Math.asin(Math.cos(r)*Math.sin(i)/Math.cos(t)),e.x=this.long0-n/this.alfa,a=t,d=0;var y=0;do e.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(t/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(a))/(1-this.e*Math.sin(a)),this.e/2))-this.s45),Math.abs(a-e.y)<1e-10&&(d=1),a=e.y,y+=1;while(d===0&&y<15);return y>=15?null:e}var mH=["Krovak","krovak"];const gH={init:dH,forward:fH,inverse:pH,names:mH};function Qi(e,t,n,r,i){return e*i-t*Math.sin(2*i)+n*Math.sin(4*i)-r*Math.sin(6*i)}function pf(e){return 1-.25*e*(1+e/16*(3+1.25*e))}function mf(e){return .375*e*(1+.25*e*(1+.46875*e))}function gf(e){return .05859375*e*e*(1+.75*e)}function yf(e){return e*e*e*(35/3072)}function eh(e,t,n){var r=t*n;return e/Math.sqrt(1-r*r)}function Sl(e){return Math.abs(e)<Rt?e:e-uf(e)*Math.PI}function ay(e,t,n,r,i){var s,c;s=e/t;for(var a=0;a<15;a++)if(c=(e-(t*s-n*Math.sin(2*s)+r*Math.sin(4*s)-i*Math.sin(6*s)))/(t-2*n*Math.cos(2*s)+4*r*Math.cos(4*s)-6*i*Math.cos(6*s)),s+=c,Math.abs(c)<=1e-10)return s;return NaN}function yH(){this.sphere||(this.e0=pf(this.es),this.e1=mf(this.es),this.e2=gf(this.es),this.e3=yf(this.es),this.ml0=this.a*Qi(this.e0,this.e1,this.e2,this.e3,this.lat0))}function vH(e){var t,n,r=e.x,i=e.y;if(r=rn(r-this.long0),this.sphere)t=this.a*Math.asin(Math.cos(i)*Math.sin(r)),n=this.a*(Math.atan2(Math.tan(i),Math.cos(r))-this.lat0);else{var s=Math.sin(i),c=Math.cos(i),a=eh(this.a,this.e,s),d=Math.tan(i)*Math.tan(i),p=r*Math.cos(i),y=p*p,g=this.es*c*c/(1-this.es),b=this.a*Qi(this.e0,this.e1,this.e2,this.e3,i);t=a*p*(1-y*d*(1/6-(8-d+8*g)*y/120)),n=b-this.ml0+a*s/c*y*(.5+(5-d+6*g)*y/24)}return e.x=t+this.x0,e.y=n+this.y0,e}function bH(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,n=e.y/this.a,r,i;if(this.sphere){var s=n+this.lat0;r=Math.asin(Math.sin(s)*Math.cos(t)),i=Math.atan2(Math.tan(t),Math.cos(s))}else{var c=this.ml0/this.a+n,a=ay(c,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(a)-Rt)<=Qt)return e.x=this.long0,e.y=Rt,n<0&&(e.y*=-1),e;var d=eh(this.a,this.e,Math.sin(a)),p=d*d*d/this.a/this.a*(1-this.es),y=Math.pow(Math.tan(a),2),g=t*this.a/d,b=g*g;r=a-d*Math.tan(a)/p*g*g*(.5-(1+3*y)*g*g/24),i=g*(1-b*(y/3+(1+3*y)*y*b/15))/Math.cos(a)}return e.x=rn(i+this.long0),e.y=Sl(r),e}var xH=["Cassini","Cassini_Soldner","cass"];const _H={init:yH,forward:vH,inverse:bH,names:xH};function Cl(e,t){var n;return e>1e-7?(n=e*t,(1-e*e)*(t/(1-n*n)-.5/e*Math.log((1-n)/(1+n)))):2*t}var wH=1,SH=2,CH=3,MH=4;function AH(){var e=Math.abs(this.lat0);if(Math.abs(e-Rt)<Qt?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(e)<Qt?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var t;switch(this.qp=Cl(this.e,1),this.mmf=.5/(1-this.es),this.apa=NH(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Cl(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function EH(e){var t,n,r,i,s,c,a,d,p,y,g=e.x,b=e.y;if(g=rn(g-this.long0),this.sphere){if(s=Math.sin(b),y=Math.cos(b),r=Math.cos(g),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(n=this.mode===this.EQUIT?1+y*r:1+this.sinph0*s+this.cosph0*y*r,n<=Qt)return null;n=Math.sqrt(2/n),t=n*y*Math.sin(g),n*=this.mode===this.EQUIT?s:this.cosph0*s-this.sinph0*y*r}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(r=-r),Math.abs(b+this.lat0)<Qt)return null;n=ur-b*.5,n=2*(this.mode===this.S_POLE?Math.cos(n):Math.sin(n)),t=n*Math.sin(g),n*=r}}else{switch(a=0,d=0,p=0,r=Math.cos(g),i=Math.sin(g),s=Math.sin(b),c=Cl(this.e,s),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(a=c/this.qp,d=Math.sqrt(1-a*a)),this.mode){case this.OBLIQ:p=1+this.sinb1*a+this.cosb1*d*r;break;case this.EQUIT:p=1+d*r;break;case this.N_POLE:p=Rt+b,c=this.qp-c;break;case this.S_POLE:p=b-Rt,c=this.qp+c;break}if(Math.abs(p)<Qt)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:p=Math.sqrt(2/p),this.mode===this.OBLIQ?n=this.ymf*p*(this.cosb1*a-this.sinb1*d*r):n=(p=Math.sqrt(2/(1+d*r)))*a*this.ymf,t=this.xmf*p*d*i;break;case this.N_POLE:case this.S_POLE:c>=0?(t=(p=Math.sqrt(c))*i,n=r*(this.mode===this.S_POLE?p:-p)):t=n=0;break}}return e.x=this.a*t+this.x0,e.y=this.a*n+this.y0,e}function TH(e){e.x-=this.x0,e.y-=this.y0;var t=e.x/this.a,n=e.y/this.a,r,i,s,c,a,d,p;if(this.sphere){var y=0,g,b=0;if(g=Math.sqrt(t*t+n*n),i=g*.5,i>1)return null;switch(i=2*Math.asin(i),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(b=Math.sin(i),y=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(g)<=Qt?0:Math.asin(n*b/g),t*=b,n=y*g;break;case this.OBLIQ:i=Math.abs(g)<=Qt?this.lat0:Math.asin(y*this.sinph0+n*b*this.cosph0/g),t*=b*this.cosph0,n=(y-Math.sin(i)*this.sinph0)*g;break;case this.N_POLE:n=-n,i=Rt-i;break;case this.S_POLE:i-=Rt;break}r=n===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(t,n)}else{if(p=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(t/=this.dd,n*=this.dd,d=Math.sqrt(t*t+n*n),d<Qt)return e.x=this.long0,e.y=this.lat0,e;c=2*Math.asin(.5*d/this.rq),s=Math.cos(c),t*=c=Math.sin(c),this.mode===this.OBLIQ?(p=s*this.sinb1+n*c*this.cosb1/d,a=this.qp*p,n=d*this.cosb1*s-n*this.sinb1*c):(p=n*c/d,a=this.qp*p,n=d*s)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(n=-n),a=t*t+n*n,!a)return e.x=this.long0,e.y=this.lat0,e;p=1-a/this.qp,this.mode===this.S_POLE&&(p=-p)}r=Math.atan2(t,n),i=RH(Math.asin(p),this.apa)}return e.x=rn(this.long0+r),e.y=i,e}var IH=.3333333333333333,PH=.17222222222222222,OH=.10257936507936508,kH=.06388888888888888,DH=.0664021164021164,LH=.016415012942191543;function NH(e){var t,n=[];return n[0]=e*IH,t=e*e,n[0]+=t*PH,n[1]=t*kH,t*=e,n[0]+=t*OH,n[1]+=t*DH,n[2]=t*LH,n}function RH(e,t){var n=e+e;return e+t[0]*Math.sin(n)+t[1]*Math.sin(n+n)+t[2]*Math.sin(n+n+n)}var jH=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const BH={init:AH,forward:EH,inverse:TH,names:jH,S_POLE:wH,N_POLE:SH,EQUIT:CH,OBLIQ:MH};function Ml(e){return Math.abs(e)>1&&(e=e>1?1:-1),Math.asin(e)}function FH(){Math.abs(this.lat1+this.lat2)<Qt||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=Xs(this.e3,this.sin_po,this.cos_po),this.qs1=Cl(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=Xs(this.e3,this.sin_po,this.cos_po),this.qs2=Cl(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Cl(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>Qt?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function zH(e){var t=e.x,n=e.y;this.sin_phi=Math.sin(n),this.cos_phi=Math.cos(n);var r=Cl(this.e3,this.sin_phi),i=this.a*Math.sqrt(this.c-this.ns0*r)/this.ns0,s=this.ns0*rn(t-this.long0),c=i*Math.sin(s)+this.x0,a=this.rh-i*Math.cos(s)+this.y0;return e.x=c,e.y=a,e}function $H(e){var t,n,r,i,s,c;return e.x-=this.x0,e.y=this.rh-e.y+this.y0,this.ns0>=0?(t=Math.sqrt(e.x*e.x+e.y*e.y),r=1):(t=-Math.sqrt(e.x*e.x+e.y*e.y),r=-1),i=0,t!==0&&(i=Math.atan2(r*e.x,r*e.y)),r=t*this.ns0/this.a,this.sphere?c=Math.asin((this.c-r*r)/(2*this.ns0)):(n=(this.c-r*r)/this.ns0,c=this.phi1z(this.e3,n)),s=rn(i/this.ns0+this.long0),e.x=s,e.y=c,e}function GH(e,t){var n,r,i,s,c,a=Ml(.5*t);if(e<Qt)return a;for(var d=e*e,p=1;p<=25;p++)if(n=Math.sin(a),r=Math.cos(a),i=e*n,s=1-i*i,c=.5*s*s/r*(t/(1-d)-n/s+.5/e*Math.log((1-i)/(1+i))),a=a+c,Math.abs(c)<=1e-7)return a;return null}var VH=["Albers_Conic_Equal_Area","Albers","aea"];const WH={init:FH,forward:zH,inverse:$H,names:VH,phi1z:GH};function UH(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function HH(e){var t,n,r,i,s,c,a,d,p=e.x,y=e.y;return r=rn(p-this.long0),t=Math.sin(y),n=Math.cos(y),i=Math.cos(r),c=this.sin_p14*t+this.cos_p14*n*i,s=1,c>0||Math.abs(c)<=Qt?(a=this.x0+this.a*s*n*Math.sin(r)/c,d=this.y0+this.a*s*(this.cos_p14*t-this.sin_p14*n*i)/c):(a=this.x0+this.infinity_dist*n*Math.sin(r),d=this.y0+this.infinity_dist*(this.cos_p14*t-this.sin_p14*n*i)),e.x=a,e.y=d,e}function XH(e){var t,n,r,i,s,c;return e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,e.x/=this.k0,e.y/=this.k0,(t=Math.sqrt(e.x*e.x+e.y*e.y))?(i=Math.atan2(t,this.rc),n=Math.sin(i),r=Math.cos(i),c=Ml(r*this.sin_p14+e.y*n*this.cos_p14/t),s=Math.atan2(e.x*n,t*this.cos_p14*r-e.y*this.sin_p14*n),s=rn(this.long0+s)):(c=this.phic0,s=0),e.x=s,e.y=c,e}var ZH=["gnom"];const YH={init:UH,forward:HH,inverse:XH,names:ZH};function qH(e,t){var n=1-(1-e*e)/(2*e)*Math.log((1-e)/(1+e));if(Math.abs(Math.abs(t)-n)<1e-6)return t<0?-1*Rt:Rt;for(var r=Math.asin(.5*t),i,s,c,a,d=0;d<30;d++)if(s=Math.sin(r),c=Math.cos(r),a=e*s,i=Math.pow(1-a*a,2)/(2*c)*(t/(1-e*e)-s/(1-a*a)+.5/e*Math.log((1-a)/(1+a))),r+=i,Math.abs(i)<=1e-10)return r;return NaN}function JH(){this.sphere||(this.k0=Xs(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function KH(e){var t=e.x,n=e.y,r,i,s=rn(t-this.long0);if(this.sphere)r=this.x0+this.a*s*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(n)/Math.cos(this.lat_ts);else{var c=Cl(this.e,Math.sin(n));r=this.x0+this.a*this.k0*s,i=this.y0+this.a*c*.5/this.k0}return e.x=r,e.y=i,e}function QH(e){e.x-=this.x0,e.y-=this.y0;var t,n;return this.sphere?(t=rn(this.long0+e.x/this.a/Math.cos(this.lat_ts)),n=Math.asin(e.y/this.a*Math.cos(this.lat_ts))):(n=qH(this.e,2*e.y*this.k0/this.a),t=rn(this.long0+e.x/(this.a*this.k0))),e.x=t,e.y=n,e}var eX=["cea"];const tX={init:JH,forward:KH,inverse:QH,names:eX};function nX(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function rX(e){var t=e.x,n=e.y,r=rn(t-this.long0),i=Sl(n-this.lat0);return e.x=this.x0+this.a*r*this.rc,e.y=this.y0+this.a*i,e}function iX(e){var t=e.x,n=e.y;return e.x=rn(this.long0+(t-this.x0)/(this.a*this.rc)),e.y=Sl(this.lat0+(n-this.y0)/this.a),e}var aX=["Equirectangular","Equidistant_Cylindrical","eqc"];const sX={init:nX,forward:rX,inverse:iX,names:aX};var YI=20;function oX(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=pf(this.es),this.e1=mf(this.es),this.e2=gf(this.es),this.e3=yf(this.es),this.ml0=this.a*Qi(this.e0,this.e1,this.e2,this.e3,this.lat0)}function lX(e){var t=e.x,n=e.y,r,i,s,c=rn(t-this.long0);if(s=c*Math.sin(n),this.sphere)Math.abs(n)<=Qt?(r=this.a*c,i=-1*this.a*this.lat0):(r=this.a*Math.sin(s)/Math.tan(n),i=this.a*(Sl(n-this.lat0)+(1-Math.cos(s))/Math.tan(n)));else if(Math.abs(n)<=Qt)r=this.a*c,i=-1*this.ml0;else{var a=eh(this.a,this.e,Math.sin(n))/Math.tan(n);r=a*Math.sin(s),i=this.a*Qi(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+a*(1-Math.cos(s))}return e.x=r+this.x0,e.y=i+this.y0,e}function cX(e){var t,n,r,i,s,c,a,d,p;if(r=e.x-this.x0,i=e.y-this.y0,this.sphere)if(Math.abs(i+this.a*this.lat0)<=Qt)t=rn(r/this.a+this.long0),n=0;else{c=this.lat0+i/this.a,a=r*r/this.a/this.a+c*c,d=c;var y;for(s=YI;s;--s)if(y=Math.tan(d),p=-1*(c*(d*y+1)-d-.5*(d*d+a)*y)/((d-c)/y-1),d+=p,Math.abs(p)<=Qt){n=d;break}t=rn(this.long0+Math.asin(r*Math.tan(d)/this.a)/Math.sin(n))}else if(Math.abs(i+this.ml0)<=Qt)n=0,t=rn(this.long0+r/this.a);else{c=(this.ml0+i)/this.a,a=r*r/this.a/this.a+c*c,d=c;var g,b,S,w,C;for(s=YI;s;--s)if(C=this.e*Math.sin(d),g=Math.sqrt(1-C*C)*Math.tan(d),b=this.a*Qi(this.e0,this.e1,this.e2,this.e3,d),S=this.e0-2*this.e1*Math.cos(2*d)+4*this.e2*Math.cos(4*d)-6*this.e3*Math.cos(6*d),w=b/this.a,p=(c*(g*w+1)-w-.5*g*(w*w+a))/(this.es*Math.sin(2*d)*(w*w+a-2*c*w)/(4*g)+(c-w)*(g*S-2/Math.sin(2*d))-S),d-=p,Math.abs(p)<=Qt){n=d;break}g=Math.sqrt(1-this.es*Math.pow(Math.sin(n),2))*Math.tan(n),t=rn(this.long0+Math.asin(r*g/this.a)/Math.sin(n))}return e.x=t,e.y=n,e}var uX=["Polyconic","poly"];const hX={init:oX,forward:lX,inverse:cX,names:uX};function dX(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function fX(e){var t,n=e.x,r=e.y,i=r-this.lat0,s=n-this.long0,c=i/of*1e-5,a=s,d=1,p=0;for(t=1;t<=10;t++)d=d*c,p=p+this.A[t]*d;var y=p,g=a,b=1,S=0,w,C,M=0,O=0;for(t=1;t<=6;t++)w=b*y-S*g,C=S*y+b*g,b=w,S=C,M=M+this.B_re[t]*b-this.B_im[t]*S,O=O+this.B_im[t]*b+this.B_re[t]*S;return e.x=O*this.a+this.x0,e.y=M*this.a+this.y0,e}function pX(e){var t,n=e.x,r=e.y,i=n-this.x0,s=r-this.y0,c=s/this.a,a=i/this.a,d=1,p=0,y,g,b=0,S=0;for(t=1;t<=6;t++)y=d*c-p*a,g=p*c+d*a,d=y,p=g,b=b+this.C_re[t]*d-this.C_im[t]*p,S=S+this.C_im[t]*d+this.C_re[t]*p;for(var w=0;w<this.iterations;w++){var C=b,M=S,O,T,D=c,N=a;for(t=2;t<=6;t++)O=C*b-M*S,T=M*b+C*S,C=O,M=T,D=D+(t-1)*(this.B_re[t]*C-this.B_im[t]*M),N=N+(t-1)*(this.B_im[t]*C+this.B_re[t]*M);C=1,M=0;var k=this.B_re[1],L=this.B_im[1];for(t=2;t<=6;t++)O=C*b-M*S,T=M*b+C*S,C=O,M=T,k=k+t*(this.B_re[t]*C-this.B_im[t]*M),L=L+t*(this.B_im[t]*C+this.B_re[t]*M);var j=k*k+L*L;b=(D*k+N*L)/j,S=(N*k-D*L)/j}var q=b,re=S,ie=1,$=0;for(t=1;t<=9;t++)ie=ie*q,$=$+this.D[t]*ie;var Y=this.lat0+$*of*1e5,X=this.long0+re;return e.x=X,e.y=Y,e}var mX=["New_Zealand_Map_Grid","nzmg"];const gX={init:dX,forward:fX,inverse:pX,names:mX};function yX(){}function vX(e){var t=e.x,n=e.y,r=rn(t-this.long0),i=this.x0+this.a*r,s=this.y0+this.a*Math.log(Math.tan(Math.PI/4+n/2.5))*1.25;return e.x=i,e.y=s,e}function bX(e){e.x-=this.x0,e.y-=this.y0;var t=rn(this.long0+e.x/this.a),n=2.5*(Math.atan(Math.exp(.8*e.y/this.a))-Math.PI/4);return e.x=t,e.y=n,e}var xX=["Miller_Cylindrical","mill"];const _X={init:yX,forward:vX,inverse:bX,names:xX};var wX=20;function SX(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=C1(this.es)}function CX(e){var t,n,r=e.x,i=e.y;if(r=rn(r-this.long0),this.sphere){if(!this.m)i=this.n!==1?Math.asin(this.n*Math.sin(i)):i;else for(var s=this.n*Math.sin(i),c=wX;c;--c){var a=(this.m*i+Math.sin(i)-s)/(this.m+Math.cos(i));if(i-=a,Math.abs(a)<Qt)break}t=this.a*this.C_x*r*(this.m+Math.cos(i)),n=this.a*this.C_y*i}else{var d=Math.sin(i),p=Math.cos(i);n=this.a*Ku(i,d,p,this.en),t=this.a*r*p/Math.sqrt(1-this.es*d*d)}return e.x=t,e.y=n,e}function MX(e){var t,n,r,i;return e.x-=this.x0,r=e.x/this.a,e.y-=this.y0,t=e.y/this.a,this.sphere?(t/=this.C_y,r=r/(this.C_x*(this.m+Math.cos(t))),this.m?t=Ml((this.m*t+Math.sin(t))/this.n):this.n!==1&&(t=Ml(Math.sin(t)/this.n)),r=rn(r+this.long0),t=Sl(t)):(t=M1(e.y/this.a,this.es,this.en),i=Math.abs(t),i<Rt?(i=Math.sin(t),n=this.long0+e.x*Math.sqrt(1-this.es*i*i)/(this.a*Math.cos(t)),r=rn(n)):i-Qt<Rt&&(r=this.long0)),e.x=r,e.y=t,e}var AX=["Sinusoidal","sinu"];const EX={init:SX,forward:CX,inverse:MX,names:AX};function TX(){}function IX(e){for(var t=e.x,n=e.y,r=rn(t-this.long0),i=n,s=Math.PI*Math.sin(n);;){var c=-(i+Math.sin(i)-s)/(1+Math.cos(i));if(i+=c,Math.abs(c)<Qt)break}i/=2,Math.PI/2-Math.abs(n)<Qt&&(r=0);var a=.900316316158*this.a*r*Math.cos(i)+this.x0,d=1.4142135623731*this.a*Math.sin(i)+this.y0;return e.x=a,e.y=d,e}function PX(e){var t,n;e.x-=this.x0,e.y-=this.y0,n=e.y/(1.4142135623731*this.a),Math.abs(n)>.999999999999&&(n=.999999999999),t=Math.asin(n);var r=rn(this.long0+e.x/(.900316316158*this.a*Math.cos(t)));r<-Math.PI&&(r=-Math.PI),r>Math.PI&&(r=Math.PI),n=(2*t+Math.sin(2*t))/Math.PI,Math.abs(n)>1&&(n=1);var i=Math.asin(n);return e.x=r,e.y=i,e}var OX=["Mollweide","moll"];const kX={init:TX,forward:IX,inverse:PX,names:OX};function DX(){Math.abs(this.lat1+this.lat2)<Qt||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=pf(this.es),this.e1=mf(this.es),this.e2=gf(this.es),this.e3=yf(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=Xs(this.e,this.sinphi,this.cosphi),this.ml1=Qi(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<Qt?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=Xs(this.e,this.sinphi,this.cosphi),this.ml2=Qi(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Qi(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function LX(e){var t=e.x,n=e.y,r;if(this.sphere)r=this.a*(this.g-n);else{var i=Qi(this.e0,this.e1,this.e2,this.e3,n);r=this.a*(this.g-i)}var s=this.ns*rn(t-this.long0),c=this.x0+r*Math.sin(s),a=this.y0+this.rh-r*Math.cos(s);return e.x=c,e.y=a,e}function NX(e){e.x-=this.x0,e.y=this.rh-e.y+this.y0;var t,n,r,i;this.ns>=0?(n=Math.sqrt(e.x*e.x+e.y*e.y),t=1):(n=-Math.sqrt(e.x*e.x+e.y*e.y),t=-1);var s=0;if(n!==0&&(s=Math.atan2(t*e.x,t*e.y)),this.sphere)return i=rn(this.long0+s/this.ns),r=Sl(this.g-n/this.a),e.x=i,e.y=r,e;var c=this.g-n/this.a;return r=ay(c,this.e0,this.e1,this.e2,this.e3),i=rn(this.long0+s/this.ns),e.x=i,e.y=r,e}var RX=["Equidistant_Conic","eqdc"];const jX={init:DX,forward:LX,inverse:NX,names:RX};function BX(){this.R=this.a}function FX(e){var t=e.x,n=e.y,r=rn(t-this.long0),i,s;Math.abs(n)<=Qt&&(i=this.x0+this.R*r,s=this.y0);var c=Ml(2*Math.abs(n/Math.PI));(Math.abs(r)<=Qt||Math.abs(Math.abs(n)-Rt)<=Qt)&&(i=this.x0,n>=0?s=this.y0+Math.PI*this.R*Math.tan(.5*c):s=this.y0+Math.PI*this.R*-Math.tan(.5*c));var a=.5*Math.abs(Math.PI/r-r/Math.PI),d=a*a,p=Math.sin(c),y=Math.cos(c),g=y/(p+y-1),b=g*g,S=g*(2/p-1),w=S*S,C=Math.PI*this.R*(a*(g-w)+Math.sqrt(d*(g-w)*(g-w)-(w+d)*(b-w)))/(w+d);r<0&&(C=-C),i=this.x0+C;var M=d+g;return C=Math.PI*this.R*(S*M-a*Math.sqrt((w+d)*(d+1)-M*M))/(w+d),n>=0?s=this.y0+C:s=this.y0-C,e.x=i,e.y=s,e}function zX(e){var t,n,r,i,s,c,a,d,p,y,g,b,S;return e.x-=this.x0,e.y-=this.y0,g=Math.PI*this.R,r=e.x/g,i=e.y/g,s=r*r+i*i,c=-Math.abs(i)*(1+s),a=c-2*i*i+r*r,d=-2*c+1+2*i*i+s*s,S=i*i/d+(2*a*a*a/d/d/d-9*c*a/d/d)/27,p=(c-a*a/3/d)/d,y=2*Math.sqrt(-p/3),g=3*S/p/y,Math.abs(g)>1&&(g>=0?g=1:g=-1),b=Math.acos(g)/3,e.y>=0?n=(-y*Math.cos(b+Math.PI/3)-a/3/d)*Math.PI:n=-(-y*Math.cos(b+Math.PI/3)-a/3/d)*Math.PI,Math.abs(r)<Qt?t=this.long0:t=rn(this.long0+Math.PI*(s-1+Math.sqrt(1+2*(r*r-i*i)+s*s))/2/r),e.x=t,e.y=n,e}var $X=["Van_der_Grinten_I","VanDerGrinten","vandg"];const GX={init:BX,forward:FX,inverse:zX,names:$X};function VX(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function WX(e){var t=e.x,n=e.y,r=Math.sin(e.y),i=Math.cos(e.y),s=rn(t-this.long0),c,a,d,p,y,g,b,S,w,C,M,O,T,D,N,k,L,j,q,re,ie,$,Y;return this.sphere?Math.abs(this.sin_p12-1)<=Qt?(e.x=this.x0+this.a*(Rt-n)*Math.sin(s),e.y=this.y0-this.a*(Rt-n)*Math.cos(s),e):Math.abs(this.sin_p12+1)<=Qt?(e.x=this.x0+this.a*(Rt+n)*Math.sin(s),e.y=this.y0+this.a*(Rt+n)*Math.cos(s),e):(j=this.sin_p12*r+this.cos_p12*i*Math.cos(s),k=Math.acos(j),L=k?k/Math.sin(k):1,e.x=this.x0+this.a*L*i*Math.sin(s),e.y=this.y0+this.a*L*(this.cos_p12*r-this.sin_p12*i*Math.cos(s)),e):(c=pf(this.es),a=mf(this.es),d=gf(this.es),p=yf(this.es),Math.abs(this.sin_p12-1)<=Qt?(y=this.a*Qi(c,a,d,p,Rt),g=this.a*Qi(c,a,d,p,n),e.x=this.x0+(y-g)*Math.sin(s),e.y=this.y0-(y-g)*Math.cos(s),e):Math.abs(this.sin_p12+1)<=Qt?(y=this.a*Qi(c,a,d,p,Rt),g=this.a*Qi(c,a,d,p,n),e.x=this.x0+(y+g)*Math.sin(s),e.y=this.y0+(y+g)*Math.cos(s),e):(b=r/i,S=eh(this.a,this.e,this.sin_p12),w=eh(this.a,this.e,r),C=Math.atan((1-this.es)*b+this.es*S*this.sin_p12/(w*i)),M=Math.atan2(Math.sin(s),this.cos_p12*Math.tan(C)-this.sin_p12*Math.cos(s)),M===0?q=Math.asin(this.cos_p12*Math.sin(C)-this.sin_p12*Math.cos(C)):Math.abs(Math.abs(M)-Math.PI)<=Qt?q=-Math.asin(this.cos_p12*Math.sin(C)-this.sin_p12*Math.cos(C)):q=Math.asin(Math.sin(s)*Math.cos(C)/Math.sin(M)),O=this.e*this.sin_p12/Math.sqrt(1-this.es),T=this.e*this.cos_p12*Math.cos(M)/Math.sqrt(1-this.es),D=O*T,N=T*T,re=q*q,ie=re*q,$=ie*q,Y=$*q,k=S*q*(1-re*N*(1-N)/6+ie/8*D*(1-2*N)+$/120*(N*(4-7*N)-3*O*O*(1-7*N))-Y/48*D),e.x=this.x0+k*Math.sin(M),e.y=this.y0+k*Math.cos(M),e))}function UX(e){e.x-=this.x0,e.y-=this.y0;var t,n,r,i,s,c,a,d,p,y,g,b,S,w,C,M,O,T,D,N,k,L,j,q;return this.sphere?(t=Math.sqrt(e.x*e.x+e.y*e.y),t>2*Rt*this.a?void 0:(n=t/this.a,r=Math.sin(n),i=Math.cos(n),s=this.long0,Math.abs(t)<=Qt?c=this.lat0:(c=Ml(i*this.sin_p12+e.y*r*this.cos_p12/t),a=Math.abs(this.lat0)-Rt,Math.abs(a)<=Qt?this.lat0>=0?s=rn(this.long0+Math.atan2(e.x,-e.y)):s=rn(this.long0-Math.atan2(-e.x,e.y)):s=rn(this.long0+Math.atan2(e.x*r,t*this.cos_p12*i-e.y*this.sin_p12*r))),e.x=s,e.y=c,e)):(d=pf(this.es),p=mf(this.es),y=gf(this.es),g=yf(this.es),Math.abs(this.sin_p12-1)<=Qt?(b=this.a*Qi(d,p,y,g,Rt),t=Math.sqrt(e.x*e.x+e.y*e.y),S=b-t,c=ay(S/this.a,d,p,y,g),s=rn(this.long0+Math.atan2(e.x,-1*e.y)),e.x=s,e.y=c,e):Math.abs(this.sin_p12+1)<=Qt?(b=this.a*Qi(d,p,y,g,Rt),t=Math.sqrt(e.x*e.x+e.y*e.y),S=t-b,c=ay(S/this.a,d,p,y,g),s=rn(this.long0+Math.atan2(e.x,e.y)),e.x=s,e.y=c,e):(t=Math.sqrt(e.x*e.x+e.y*e.y),M=Math.atan2(e.x,e.y),w=eh(this.a,this.e,this.sin_p12),O=Math.cos(M),T=this.e*this.cos_p12*O,D=-T*T/(1-this.es),N=3*this.es*(1-D)*this.sin_p12*this.cos_p12*O/(1-this.es),k=t/w,L=k-D*(1+D)*Math.pow(k,3)/6-N*(1+3*D)*Math.pow(k,4)/24,j=1-D*L*L/2-k*L*L*L/6,C=Math.asin(this.sin_p12*Math.cos(L)+this.cos_p12*Math.sin(L)*O),s=rn(this.long0+Math.asin(Math.sin(M)*Math.sin(L)/Math.cos(C))),q=Math.sin(C),c=Math.atan2((q-this.es*j*this.sin_p12)*Math.tan(C),q*(1-this.es)),e.x=s,e.y=c,e))}var HX=["Azimuthal_Equidistant","aeqd"];const XX={init:VX,forward:WX,inverse:UX,names:HX};function ZX(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function YX(e){var t,n,r,i,s,c,a,d,p=e.x,y=e.y;return r=rn(p-this.long0),t=Math.sin(y),n=Math.cos(y),i=Math.cos(r),c=this.sin_p14*t+this.cos_p14*n*i,s=1,(c>0||Math.abs(c)<=Qt)&&(a=this.a*s*n*Math.sin(r),d=this.y0+this.a*s*(this.cos_p14*t-this.sin_p14*n*i)),e.x=a,e.y=d,e}function qX(e){var t,n,r,i,s,c,a;return e.x-=this.x0,e.y-=this.y0,t=Math.sqrt(e.x*e.x+e.y*e.y),n=Ml(t/this.a),r=Math.sin(n),i=Math.cos(n),c=this.long0,Math.abs(t)<=Qt?(a=this.lat0,e.x=c,e.y=a,e):(a=Ml(i*this.sin_p14+e.y*r*this.cos_p14/t),s=Math.abs(this.lat0)-Rt,Math.abs(s)<=Qt?(this.lat0>=0?c=rn(this.long0+Math.atan2(e.x,-e.y)):c=rn(this.long0-Math.atan2(-e.x,e.y)),e.x=c,e.y=a,e):(c=rn(this.long0+Math.atan2(e.x*r,t*this.cos_p14*i-e.y*this.sin_p14*r)),e.x=c,e.y=a,e))}var JX=["ortho"];const KX={init:ZX,forward:YX,inverse:qX,names:JX};var Wr={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},hr={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function QX(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=Rt-ur/2?this.face=Wr.TOP:this.lat0<=-(Rt-ur/2)?this.face=Wr.BOTTOM:Math.abs(this.long0)<=ur?this.face=Wr.FRONT:Math.abs(this.long0)<=Rt+ur?this.face=this.long0>0?Wr.RIGHT:Wr.LEFT:this.face=Wr.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function eZ(e){var t={x:0,y:0},n,r,i,s,c,a,d={value:0};if(e.x-=this.long0,this.es!==0?n=Math.atan(this.one_minus_f_squared*Math.tan(e.y)):n=e.y,r=e.x,this.face===Wr.TOP)s=Rt-n,r>=ur&&r<=Rt+ur?(d.value=hr.AREA_0,i=r-Rt):r>Rt+ur||r<=-(Rt+ur)?(d.value=hr.AREA_1,i=r>0?r-Ci:r+Ci):r>-(Rt+ur)&&r<=-ur?(d.value=hr.AREA_2,i=r+Rt):(d.value=hr.AREA_3,i=r);else if(this.face===Wr.BOTTOM)s=Rt+n,r>=ur&&r<=Rt+ur?(d.value=hr.AREA_0,i=-r+Rt):r<ur&&r>=-ur?(d.value=hr.AREA_1,i=-r):r<-ur&&r>=-(Rt+ur)?(d.value=hr.AREA_2,i=-r-Rt):(d.value=hr.AREA_3,i=r>0?-r+Ci:-r-Ci);else{var p,y,g,b,S,w,C;this.face===Wr.RIGHT?r=th(r,+Rt):this.face===Wr.BACK?r=th(r,3.14159265359):this.face===Wr.LEFT&&(r=th(r,-Rt)),b=Math.sin(n),S=Math.cos(n),w=Math.sin(r),C=Math.cos(r),p=S*C,y=S*w,g=b,this.face===Wr.FRONT?(s=Math.acos(p),i=sy(s,g,y,d)):this.face===Wr.RIGHT?(s=Math.acos(y),i=sy(s,g,-p,d)):this.face===Wr.BACK?(s=Math.acos(-p),i=sy(s,g,-y,d)):this.face===Wr.LEFT?(s=Math.acos(-y),i=sy(s,g,p,d)):(s=i=0,d.value=hr.AREA_0)}return a=Math.atan(12/Ci*(i+Math.acos(Math.sin(i)*Math.cos(ur))-Rt)),c=Math.sqrt((1-Math.cos(s))/(Math.cos(a)*Math.cos(a))/(1-Math.cos(Math.atan(1/Math.cos(i))))),d.value===hr.AREA_1?a+=Rt:d.value===hr.AREA_2?a+=Ci:d.value===hr.AREA_3&&(a+=1.5*Ci),t.x=c*Math.cos(a),t.y=c*Math.sin(a),t.x=t.x*this.a+this.x0,t.y=t.y*this.a+this.y0,e.x=t.x,e.y=t.y,e}function tZ(e){var t={lam:0,phi:0},n,r,i,s,c,a,d,p,y,g={value:0};if(e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a,r=Math.atan(Math.sqrt(e.x*e.x+e.y*e.y)),n=Math.atan2(e.y,e.x),e.x>=0&&e.x>=Math.abs(e.y)?g.value=hr.AREA_0:e.y>=0&&e.y>=Math.abs(e.x)?(g.value=hr.AREA_1,n-=Rt):e.x<0&&-e.x>=Math.abs(e.y)?(g.value=hr.AREA_2,n=n<0?n+Ci:n-Ci):(g.value=hr.AREA_3,n+=Rt),y=Ci/12*Math.tan(n),c=Math.sin(y)/(Math.cos(y)-1/Math.sqrt(2)),a=Math.atan(c),i=Math.cos(n),s=Math.tan(r),d=1-i*i*s*s*(1-Math.cos(Math.atan(1/Math.cos(a)))),d<-1?d=-1:d>1&&(d=1),this.face===Wr.TOP)p=Math.acos(d),t.phi=Rt-p,g.value===hr.AREA_0?t.lam=a+Rt:g.value===hr.AREA_1?t.lam=a<0?a+Ci:a-Ci:g.value===hr.AREA_2?t.lam=a-Rt:t.lam=a;else if(this.face===Wr.BOTTOM)p=Math.acos(d),t.phi=p-Rt,g.value===hr.AREA_0?t.lam=-a+Rt:g.value===hr.AREA_1?t.lam=-a:g.value===hr.AREA_2?t.lam=-a-Rt:t.lam=a<0?-a-Ci:-a+Ci;else{var b,S,w;b=d,y=b*b,y>=1?w=0:w=Math.sqrt(1-y)*Math.sin(a),y+=w*w,y>=1?S=0:S=Math.sqrt(1-y),g.value===hr.AREA_1?(y=S,S=-w,w=y):g.value===hr.AREA_2?(S=-S,w=-w):g.value===hr.AREA_3&&(y=S,S=w,w=-y),this.face===Wr.RIGHT?(y=b,b=-S,S=y):this.face===Wr.BACK?(b=-b,S=-S):this.face===Wr.LEFT&&(y=b,b=S,S=-y),t.phi=Math.acos(-w)-Rt,t.lam=Math.atan2(S,b),this.face===Wr.RIGHT?t.lam=th(t.lam,-Rt):this.face===Wr.BACK?t.lam=th(t.lam,-3.14159265359):this.face===Wr.LEFT&&(t.lam=th(t.lam,+Rt))}if(this.es!==0){var C,M,O;C=t.phi<0?1:0,M=Math.tan(t.phi),O=this.b/Math.sqrt(M*M+this.one_minus_f_squared),t.phi=Math.atan(Math.sqrt(this.a*this.a-O*O)/(this.one_minus_f*O)),C&&(t.phi=-t.phi)}return t.lam+=this.long0,e.x=t.lam,e.y=t.phi,e}function sy(e,t,n,r){var i;return e<Qt?(r.value=hr.AREA_0,i=0):(i=Math.atan2(t,n),Math.abs(i)<=ur?r.value=hr.AREA_0:i>ur&&i<=Rt+ur?(r.value=hr.AREA_1,i-=Rt):i>Rt+ur||i<=-(Rt+ur)?(r.value=hr.AREA_2,i=i>=0?i-Ci:i+Ci):(r.value=hr.AREA_3,i+=Rt)),i}function th(e,t){var n=e+t;return n<-3.14159265359?n+=lf:n>3.14159265359&&(n-=lf),n}var nZ=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const rZ={init:QX,forward:eZ,inverse:tZ,names:nZ};var I1=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],vf=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],qI=.8487,JI=1.3523,KI=Us/5,iZ=1/KI,nh=18,oy=function(e,t){return e[0]+t*(e[1]+t*(e[2]+t*e[3]))},aZ=function(e,t){return e[1]+t*(2*e[2]+t*3*e[3])};function sZ(e,t,n,r){for(var i=t;r;--r){var s=e(i);if(i-=s,Math.abs(s)<n)break}return i}function oZ(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function lZ(e){var t=rn(e.x-this.long0),n=Math.abs(e.y),r=Math.floor(n*KI);r<0?r=0:r>=nh&&(r=nh-1),n=Us*(n-iZ*r);var i={x:oy(I1[r],n)*t,y:oy(vf[r],n)};return e.y<0&&(i.y=-i.y),i.x=i.x*this.a*qI+this.x0,i.y=i.y*this.a*JI+this.y0,i}function cZ(e){var t={x:(e.x-this.x0)/(this.a*qI),y:Math.abs(e.y-this.y0)/(this.a*JI)};if(t.y>=1)t.x/=I1[nh][0],t.y=e.y<0?-Rt:Rt;else{var n=Math.floor(t.y*nh);for(n<0?n=0:n>=nh&&(n=nh-1);;)if(vf[n][0]>t.y)--n;else if(vf[n+1][0]<=t.y)++n;else break;var r=vf[n],i=5*(t.y-r[0])/(vf[n+1][0]-r[0]);i=sZ(function(s){return(oy(r,s)-t.y)/aZ(r,s)},i,Qt,100),t.x/=oy(I1[n],i),t.y=(5*n+i)*Si,e.y<0&&(t.y=-t.y)}return t.x=rn(t.x+this.long0),t}var uZ=["Robinson","robin"];const hZ={init:oZ,forward:lZ,inverse:cZ,names:uZ};function dZ(){this.name="geocent"}function fZ(e){var t=EI(e,this.es,this.a);return t}function pZ(e){var t=TI(e,this.es,this.a,this.b);return t}var mZ=["Geocentric","geocentric","geocent","Geocent"];const gZ={init:dZ,forward:fZ,inverse:pZ,names:mZ};var Bi={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},bf={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function yZ(){if(Object.keys(bf).forEach((function(n){if(typeof this[n]>"u")this[n]=bf[n].def;else{if(bf[n].num&&isNaN(this[n]))throw new Error("Invalid parameter value, must be numeric "+n+" = "+this[n]);bf[n].num&&(this[n]=parseFloat(this[n]))}bf[n].degrees&&(this[n]=this[n]*Si)}).bind(this)),Math.abs(Math.abs(this.lat0)-Rt)<Qt?this.mode=this.lat0<0?Bi.S_POLE:Bi.N_POLE:Math.abs(this.lat0)<Qt?this.mode=Bi.EQUIT:(this.mode=Bi.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var e=this.tilt,t=this.azi;this.cg=Math.cos(t),this.sg=Math.sin(t),this.cw=Math.cos(e),this.sw=Math.sin(e)}function vZ(e){e.x-=this.long0;var t=Math.sin(e.y),n=Math.cos(e.y),r=Math.cos(e.x),i,s;switch(this.mode){case Bi.OBLIQ:s=this.sinph0*t+this.cosph0*n*r;break;case Bi.EQUIT:s=n*r;break;case Bi.S_POLE:s=-t;break;case Bi.N_POLE:s=t;break}switch(s=this.pn1/(this.p-s),i=s*n*Math.sin(e.x),this.mode){case Bi.OBLIQ:s*=this.cosph0*t-this.sinph0*n*r;break;case Bi.EQUIT:s*=t;break;case Bi.N_POLE:s*=-(n*r);break;case Bi.S_POLE:s*=n*r;break}var c,a;return c=s*this.cg+i*this.sg,a=1/(c*this.sw*this.h1+this.cw),i=(i*this.cg-s*this.sg)*this.cw*a,s=c*a,e.x=i*this.a,e.y=s*this.a,e}function bZ(e){e.x/=this.a,e.y/=this.a;var t={x:e.x,y:e.y},n,r,i;i=1/(this.pn1-e.y*this.sw),n=this.pn1*e.x*i,r=this.pn1*e.y*this.cw*i,e.x=n*this.cg+r*this.sg,e.y=r*this.cg-n*this.sg;var s=ma(e.x,e.y);if(Math.abs(s)<Qt)t.x=0,t.y=e.y;else{var c,a;switch(a=1-s*s*this.pfact,a=(this.p-Math.sqrt(a))/(this.pn1/s+s/this.pn1),c=Math.sqrt(1-a*a),this.mode){case Bi.OBLIQ:t.y=Math.asin(c*this.sinph0+e.y*a*this.cosph0/s),e.y=(c-this.sinph0*Math.sin(t.y))*s,e.x*=a*this.cosph0;break;case Bi.EQUIT:t.y=Math.asin(e.y*a/s),e.y=c*s,e.x*=a;break;case Bi.N_POLE:t.y=Math.asin(c),e.y=-e.y;break;case Bi.S_POLE:t.y=-Math.asin(c);break}t.x=Math.atan2(e.x,e.y)}return e.x=t.x+this.long0,e.y=t.y,e}var xZ=["Tilted_Perspective","tpers"];const _Z={init:yZ,forward:vZ,inverse:bZ,names:xZ};function wZ(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var e=1-this.es,t=1/e;this.radius_p=Math.sqrt(e),this.radius_p2=e,this.radius_p_inv2=t,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function SZ(e){var t=e.x,n=e.y,r,i,s,c;if(t=t-this.long0,this.shape==="ellipse"){n=Math.atan(this.radius_p2*Math.tan(n));var a=this.radius_p/ma(this.radius_p*Math.cos(n),Math.sin(n));if(i=a*Math.cos(t)*Math.cos(n),s=a*Math.sin(t)*Math.cos(n),c=a*Math.sin(n),(this.radius_g-i)*i-s*s-c*c*this.radius_p_inv2<0)return e.x=Number.NaN,e.y=Number.NaN,e;r=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(s/ma(c,r)),e.y=this.radius_g_1*Math.atan(c/r)):(e.x=this.radius_g_1*Math.atan(s/r),e.y=this.radius_g_1*Math.atan(c/ma(s,r)))}else this.shape==="sphere"&&(r=Math.cos(n),i=Math.cos(t)*r,s=Math.sin(t)*r,c=Math.sin(n),r=this.radius_g-i,this.flip_axis?(e.x=this.radius_g_1*Math.atan(s/ma(c,r)),e.y=this.radius_g_1*Math.atan(c/r)):(e.x=this.radius_g_1*Math.atan(s/r),e.y=this.radius_g_1*Math.atan(c/ma(s,r))));return e.x=e.x*this.a,e.y=e.y*this.a,e}function CZ(e){var t=-1,n=0,r=0,i,s,c,a;if(e.x=e.x/this.a,e.y=e.y/this.a,this.shape==="ellipse"){this.flip_axis?(r=Math.tan(e.y/this.radius_g_1),n=Math.tan(e.x/this.radius_g_1)*ma(1,r)):(n=Math.tan(e.x/this.radius_g_1),r=Math.tan(e.y/this.radius_g_1)*ma(1,n));var d=r/this.radius_p;if(i=n*n+d*d+t*t,s=2*this.radius_g*t,c=s*s-4*i*this.C,c<0)return e.x=Number.NaN,e.y=Number.NaN,e;a=(-s-Math.sqrt(c))/(2*i),t=this.radius_g+a*t,n*=a,r*=a,e.x=Math.atan2(n,t),e.y=Math.atan(r*Math.cos(e.x)/t),e.y=Math.atan(this.radius_p_inv2*Math.tan(e.y))}else if(this.shape==="sphere"){if(this.flip_axis?(r=Math.tan(e.y/this.radius_g_1),n=Math.tan(e.x/this.radius_g_1)*Math.sqrt(1+r*r)):(n=Math.tan(e.x/this.radius_g_1),r=Math.tan(e.y/this.radius_g_1)*Math.sqrt(1+n*n)),i=n*n+r*r+t*t,s=2*this.radius_g*t,c=s*s-4*i*this.C,c<0)return e.x=Number.NaN,e.y=Number.NaN,e;a=(-s-Math.sqrt(c))/(2*i),t=this.radius_g+a*t,n*=a,r*=a,e.x=Math.atan2(n,t),e.y=Math.atan(r*Math.cos(e.x)/t)}return e.x=e.x+this.long0,e}var MZ=["Geostationary Satellite View","Geostationary_Satellite","geos"];const AZ={init:wZ,forward:SZ,inverse:CZ,names:MZ};var xf=1.340264,_f=-.081106,wf=893e-6,Sf=.003796,ly=Math.sqrt(3)/2;function EZ(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function TZ(e){var t=rn(e.x-this.long0),n=e.y,r=Math.asin(ly*Math.sin(n)),i=r*r,s=i*i*i;return e.x=t*Math.cos(r)/(ly*(xf+3*_f*i+s*(7*wf+9*Sf*i))),e.y=r*(xf+_f*i+s*(wf+Sf*i)),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function IZ(e){e.x=(e.x-this.x0)/this.a,e.y=(e.y-this.y0)/this.a;var t=1e-9,n=12,r=e.y,i,s,c,a,d,p;for(p=0;p<n&&(i=r*r,s=i*i*i,c=r*(xf+_f*i+s*(wf+Sf*i))-e.y,a=xf+3*_f*i+s*(7*wf+9*Sf*i),r-=d=c/a,!(Math.abs(d)<t));++p);return i=r*r,s=i*i*i,e.x=ly*e.x*(xf+3*_f*i+s*(7*wf+9*Sf*i))/Math.cos(r),e.y=Math.asin(Math.sin(r)/ly),e.x=rn(e.x+this.long0),e}var PZ=["eqearth","Equal Earth","Equal_Earth"];const OZ={init:EZ,forward:TZ,inverse:IZ,names:PZ};var Cf=1e-10;function kZ(){var e;if(this.phi1=this.lat1,Math.abs(this.phi1)<Cf)throw new Error;this.es?(this.en=C1(this.es),this.m1=Ku(this.phi1,this.am1=Math.sin(this.phi1),e=Math.cos(this.phi1),this.en),this.am1=e/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=LZ,this.forward=DZ):(Math.abs(this.phi1)+Cf>=Rt?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=RZ,this.forward=NZ)}function DZ(e){var t=rn(e.x-(this.long0||0)),n=e.y,r,i,s;return r=this.am1+this.m1-Ku(n,i=Math.sin(n),s=Math.cos(n),this.en),i=s*t/(r*Math.sqrt(1-this.es*i*i)),e.x=r*Math.sin(i),e.y=this.am1-r*Math.cos(i),e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function LZ(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var t,n,r,i;if(n=ma(e.x,e.y=this.am1-e.y),i=M1(this.am1+this.m1-n,this.es,this.en),(t=Math.abs(i))<Rt)t=Math.sin(i),r=n*Math.atan2(e.x,e.y)*Math.sqrt(1-this.es*t*t)/Math.cos(i);else if(Math.abs(t-Rt)<=Cf)r=0;else throw new Error;return e.x=rn(r+(this.long0||0)),e.y=Sl(i),e}function NZ(e){var t=rn(e.x-(this.long0||0)),n=e.y,r,i;return i=this.cphi1+this.phi1-n,Math.abs(i)>Cf?(e.x=i*Math.sin(r=t*Math.cos(n)/i),e.y=this.cphi1-i*Math.cos(r)):e.x=e.y=0,e.x=this.a*e.x+(this.x0||0),e.y=this.a*e.y+(this.y0||0),e}function RZ(e){e.x=(e.x-(this.x0||0))/this.a,e.y=(e.y-(this.y0||0))/this.a;var t,n,r=ma(e.x,e.y=this.cphi1-e.y);if(n=this.cphi1+this.phi1-r,Math.abs(n)>Rt)throw new Error;return Math.abs(Math.abs(n)-Rt)<=Cf?t=0:t=r*Math.atan2(e.x,e.y)/Math.cos(n),e.x=rn(t+(this.long0||0)),e.y=Sl(n),e}var jZ=["bonne","Bonne (Werner lat_1=90)"];const BZ={init:kZ,names:jZ};function FZ(e){e.Proj.projections.add(ry),e.Proj.projections.add(iy),e.Proj.projections.add(DU),e.Proj.projections.add(VU),e.Proj.projections.add(YU),e.Proj.projections.add(eH),e.Proj.projections.add(sH),e.Proj.projections.add(hH),e.Proj.projections.add(gH),e.Proj.projections.add(_H),e.Proj.projections.add(BH),e.Proj.projections.add(WH),e.Proj.projections.add(YH),e.Proj.projections.add(tX),e.Proj.projections.add(sX),e.Proj.projections.add(hX),e.Proj.projections.add(gX),e.Proj.projections.add(_X),e.Proj.projections.add(EX),e.Proj.projections.add(kX),e.Proj.projections.add(jX),e.Proj.projections.add(GX),e.Proj.projections.add(XX),e.Proj.projections.add(KX),e.Proj.projections.add(rZ),e.Proj.projections.add(hZ),e.Proj.projections.add(gZ),e.Proj.projections.add(_Z),e.Proj.projections.add(AZ),e.Proj.projections.add(OZ),e.Proj.projections.add(BZ)}fa.defaultDatum="WGS84",fa.Proj=Zs,fa.WGS84=new fa.Proj("WGS84"),fa.Point=Ju,fa.toPoint=kI,fa.defs=Ki,fa.nadgrid=NW,fa.transform=ny,fa.mgrs=JW,fa.version="__VERSION__",FZ(fa);const zZ=e=>{const t="EPSG:4326",n="EPSG:3857",[r,i]=fa(t,n,[e[0],e[1]]),[s,c]=fa(t,n,[e[2],e[3]]);return[r,i,s,c]};function QI(e){if(!e)throw new Error("parameter is not an object",e);return Object.keys(e).length===0&&e.constructor===Object}var $Z=e=>{switch(e){case"success":return WZ;case"info":return HZ;case"warning":return UZ;case"error":return XZ;default:return null}},GZ=Array(12).fill(0),VZ=({visible:e,className:t})=>U.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},U.createElement("div",{className:"sonner-spinner"},GZ.map((n,r)=>U.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),WZ=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),UZ=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),HZ=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),XZ=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),ZZ=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},U.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),U.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),YZ=()=>{let[e,t]=U.useState(document.hidden);return U.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},P1=1,qZ=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,i=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:P1++,s=this.toasts.find(a=>a.id===i),c=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),s?this.toasts=this.toasts.map(a=>a.id===i?(this.publish({...a,...e,id:i,title:n}),{...a,...e,id:i,dismissible:c,title:n}):a):this.addToast({title:n,...r,dismissible:c,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),i=n!==void 0,s,c=r.then(async d=>{if(s=["resolve",d],U.isValidElement(d))i=!1,this.create({id:n,type:"default",message:d});else if(KZ(d)&&!d.ok){i=!1;let p=typeof t.error=="function"?await t.error(`HTTP error! status: ${d.status}`):t.error,y=typeof t.description=="function"?await t.description(`HTTP error! status: ${d.status}`):t.description;this.create({id:n,type:"error",message:p,description:y})}else if(t.success!==void 0){i=!1;let p=typeof t.success=="function"?await t.success(d):t.success,y=typeof t.description=="function"?await t.description(d):t.description;this.create({id:n,type:"success",message:p,description:y})}}).catch(async d=>{if(s=["reject",d],t.error!==void 0){i=!1;let p=typeof t.error=="function"?await t.error(d):t.error,y=typeof t.description=="function"?await t.description(d):t.description;this.create({id:n,type:"error",message:p,description:y})}}).finally(()=>{var d;i&&(this.dismiss(n),n=void 0),(d=t.finally)==null||d.call(t)}),a=()=>new Promise((d,p)=>c.then(()=>s[0]==="reject"?p(s[1]):d(s[1])).catch(p));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||P1++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ga=new qZ,JZ=(e,t)=>{let n=(t==null?void 0:t.id)||P1++;return ga.addToast({title:e,...t,id:n}),n},KZ=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",QZ=JZ,eY=()=>ga.toasts,tY=()=>ga.getActiveToasts(),Sc=Object.assign(QZ,{success:ga.success,info:ga.info,warning:ga.warning,error:ga.error,custom:ga.custom,message:ga.message,promise:ga.promise,dismiss:ga.dismiss,loading:ga.loading},{getHistory:eY,getToasts:tY});function nY(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}nY(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
@@ -934,7 +934,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
934
934
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vwe(e,t){if(e){if(typeof e=="string")return z4(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return z4(e,t)}}function z4(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function bwe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,c,a=[],d=!0,p=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(d=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);d=!0);}catch(y){p=!0,i=y}finally{try{if(!d&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(p)throw i}}return a}}function xwe(e){if(Array.isArray(e))return e}function P2(){return P2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P2.apply(this,arguments)}var _we=function(t,n){var r;return U.isValidElement(t)?r=U.cloneElement(t,n):$n(t)?r=t(n):r=U.createElement("line",P2({},n,{className:"recharts-reference-line-line"})),r},wwe=function(t,n,r,i,s,c,a,d,p){var y=s.x,g=s.y,b=s.width,S=s.height;if(r){var w=p.y,C=t.y.apply(w,{position:c});if(ro(p,"discard")&&!t.y.isInRange(C))return null;var M=[{x:y+b,y:C},{x:y,y:C}];return d==="left"?M.reverse():M}if(n){var O=p.x,T=t.x.apply(O,{position:c});if(ro(p,"discard")&&!t.x.isInRange(T))return null;var D=[{x:T,y:g+S},{x:T,y:g}];return a==="top"?D.reverse():D}if(i){var N=p.segment,k=N.map(function(L){return t.apply(L,{position:c})});return ro(p,"discard")&&T_e(k,function(L){return!t.isInRange(L)})?null:k}return null};function Swe(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,s=e.yAxisId,c=e.shape,a=e.className,d=e.alwaysShow,p=iwe(),y=awe(i),g=swe(s),b=owe();if(!p||!b)return null;dh(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var S=E2({x:y.scale,y:g.scale}),w=ai(t),C=ai(n),M=r&&r.length===2,O=wwe(S,w,C,M,b,e.position,y.orientation,g.orientation,e);if(!O)return null;var T=gwe(O,2),D=T[0],N=D.x,k=D.y,L=T[1],j=L.x,q=L.y,re=ro(e,"hidden")?"url(#".concat(p,")"):void 0,ie=B4(B4({clipPath:re},Fn(e,!0)),{},{x1:N,y1:k,x2:j,y2:q});return U.createElement(Zr,{className:Yn("recharts-reference-line",a)},_we(c,ie),Mi.renderCallByParent(e,Q_e({x1:N,y1:k,x2:j,y2:q})))}var O2=function(e){function t(){return lwe(this,t),hwe(this,t,arguments)}return pwe(t,e),uwe(t,[{key:"render",value:function(){return U.createElement(Swe,this.props)}}])}(U.Component);I2(O2,"displayName","ReferenceLine"),I2(O2,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function k2(){return k2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},k2.apply(this,arguments)}function Wh(e){"@babel/helpers - typeof";return Wh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wh(e)}function $4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function G4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$4(Object(n),!0).forEach(function(r){qv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Mwe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,W4(r.key),r)}}function Awe(e,t,n){return Mwe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ewe(e,t,n){return t=Yv(t),Twe(e,V4()?Reflect.construct(t,n||[],Yv(e).constructor):t.apply(e,n))}function Twe(e,t){if(t&&(Wh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Iwe(e)}function Iwe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function V4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(V4=function(){return!!e})()}function Yv(e){return Yv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Yv(e)}function Pwe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&D2(e,t)}function D2(e,t){return D2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},D2(e,t)}function qv(e,t,n){return t=W4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W4(e){var t=Owe(e,"string");return Wh(t)=="symbol"?t:t+""}function Owe(e,t){if(Wh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Wh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var kwe=function(t){var n=t.x,r=t.y,i=t.xAxis,s=t.yAxis,c=E2({x:i.scale,y:s.scale}),a=c.apply({x:n,y:r},{bandAware:!0});return ro(t,"discard")&&!c.isInRange(a)?null:a},Jv=function(e){function t(){return Cwe(this,t),Ewe(this,t,arguments)}return Pwe(t,e),Awe(t,[{key:"render",value:function(){var r=this.props,i=r.x,s=r.y,c=r.r,a=r.alwaysShow,d=r.clipPathId,p=ai(i),y=ai(s);if(dh(a===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!p||!y)return null;var g=kwe(this.props);if(!g)return null;var b=g.x,S=g.y,w=this.props,C=w.shape,M=w.className,O=ro(this.props,"hidden")?"url(#".concat(d,")"):void 0,T=G4(G4({clipPath:O},Fn(this.props,!0)),{},{cx:b,cy:S});return U.createElement(Zr,{className:Yn("recharts-reference-dot",M)},t.renderDot(C,T),Mi.renderCallByParent(this.props,{x:b-c,y:S-c,width:2*c,height:2*c}))}}])}(U.Component);qv(Jv,"displayName","ReferenceDot"),qv(Jv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1}),qv(Jv,"renderDot",function(e,t){var n;return U.isValidElement(e)?n=U.cloneElement(e,t):$n(e)?n=e(t):n=U.createElement(v2,k2({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function L2(){return L2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},L2.apply(this,arguments)}function Uh(e){"@babel/helpers - typeof";return Uh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uh(e)}function U4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function H4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?U4(Object(n),!0).forEach(function(r){Qv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):U4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Lwe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Z4(r.key),r)}}function Nwe(e,t,n){return Lwe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Rwe(e,t,n){return t=Kv(t),jwe(e,X4()?Reflect.construct(t,n||[],Kv(e).constructor):t.apply(e,n))}function jwe(e,t){if(t&&(Uh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Bwe(e)}function Bwe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function X4(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(X4=function(){return!!e})()}function Kv(e){return Kv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Kv(e)}function Fwe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&N2(e,t)}function N2(e,t){return N2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},N2(e,t)}function Qv(e,t,n){return t=Z4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Z4(e){var t=zwe(e,"string");return Uh(t)=="symbol"?t:t+""}function zwe(e,t){if(Uh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Uh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var $we=function(t,n,r,i,s){var c=s.x1,a=s.x2,d=s.y1,p=s.y2,y=s.xAxis,g=s.yAxis;if(!y||!g)return null;var b=E2({x:y.scale,y:g.scale}),S={x:t?b.x.apply(c,{position:"start"}):b.x.rangeMin,y:r?b.y.apply(d,{position:"start"}):b.y.rangeMin},w={x:n?b.x.apply(a,{position:"end"}):b.x.rangeMax,y:i?b.y.apply(p,{position:"end"}):b.y.rangeMax};return ro(s,"discard")&&(!b.isInRange(S)||!b.isInRange(w))?null:T4(S,w)},e0=function(e){function t(){return Dwe(this,t),Rwe(this,t,arguments)}return Fwe(t,e),Nwe(t,[{key:"render",value:function(){var r=this.props,i=r.x1,s=r.x2,c=r.y1,a=r.y2,d=r.className,p=r.alwaysShow,y=r.clipPathId;dh(p===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var g=ai(i),b=ai(s),S=ai(c),w=ai(a),C=this.props.shape;if(!g&&!b&&!S&&!w&&!C)return null;var M=$we(g,b,S,w,this.props);if(!M&&!C)return null;var O=ro(this.props,"hidden")?"url(#".concat(y,")"):void 0;return U.createElement(Zr,{className:Yn("recharts-reference-area",d)},t.renderRect(C,H4(H4({clipPath:O},Fn(this.props,!0)),M)),Mi.renderCallByParent(this.props,M))}}])}(U.Component);Qv(e0,"displayName","ReferenceArea"),Qv(e0,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1}),Qv(e0,"renderRect",function(e,t){var n;return U.isValidElement(e)?n=U.cloneElement(e,t):$n(e)?n=e(t):n=U.createElement(m2,L2({},t,{className:"recharts-reference-area-rect"})),n});function Y4(e){return Uwe(e)||Wwe(e)||Vwe(e)||Gwe()}function Gwe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
935
935
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vwe(e,t){if(e){if(typeof e=="string")return R2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return R2(e,t)}}function Wwe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Uwe(e){if(Array.isArray(e))return R2(e)}function R2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var j2=function(t,n,r,i,s){var c=Ks(t,O2),a=Ks(t,Jv),d=[].concat(Y4(c),Y4(a)),p=Ks(t,e0),y="".concat(i,"Id"),g=i[0],b=n;if(d.length&&(b=d.reduce(function(C,M){if(M.props[y]===r&&ro(M.props,"extendDomain")&&ln(M.props[g])){var O=M.props[g];return[Math.min(C[0],O),Math.max(C[1],O)]}return C},b)),p.length){var S="".concat(g,"1"),w="".concat(g,"2");b=p.reduce(function(C,M){if(M.props[y]===r&&ro(M.props,"extendDomain")&&ln(M.props[S])&&ln(M.props[w])){var O=M.props[S],T=M.props[w];return[Math.min(C[0],O,T),Math.max(C[1],O,T)]}return C},b)}return s&&s.length&&(b=s.reduce(function(C,M){return ln(M)?[Math.min(C[0],M),Math.max(C[1],M)]:C},b)),b},q4={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(d,p,y){this.fn=d,this.context=p,this.once=y||!1}function s(d,p,y,g,b){if(typeof y!="function")throw new TypeError("The listener must be a function");var S=new i(y,g||d,b),w=n?n+p:p;return d._events[w]?d._events[w].fn?d._events[w]=[d._events[w],S]:d._events[w].push(S):(d._events[w]=S,d._eventsCount++),d}function c(d,p){--d._eventsCount===0?d._events=new r:delete d._events[p]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var p=[],y,g;if(this._eventsCount===0)return p;for(g in y=this._events)t.call(y,g)&&p.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(y)):p},a.prototype.listeners=function(p){var y=n?n+p:p,g=this._events[y];if(!g)return[];if(g.fn)return[g.fn];for(var b=0,S=g.length,w=new Array(S);b<S;b++)w[b]=g[b].fn;return w},a.prototype.listenerCount=function(p){var y=n?n+p:p,g=this._events[y];return g?g.fn?1:g.length:0},a.prototype.emit=function(p,y,g,b,S,w){var C=n?n+p:p;if(!this._events[C])return!1;var M=this._events[C],O=arguments.length,T,D;if(M.fn){switch(M.once&&this.removeListener(p,M.fn,void 0,!0),O){case 1:return M.fn.call(M.context),!0;case 2:return M.fn.call(M.context,y),!0;case 3:return M.fn.call(M.context,y,g),!0;case 4:return M.fn.call(M.context,y,g,b),!0;case 5:return M.fn.call(M.context,y,g,b,S),!0;case 6:return M.fn.call(M.context,y,g,b,S,w),!0}for(D=1,T=new Array(O-1);D<O;D++)T[D-1]=arguments[D];M.fn.apply(M.context,T)}else{var N=M.length,k;for(D=0;D<N;D++)switch(M[D].once&&this.removeListener(p,M[D].fn,void 0,!0),O){case 1:M[D].fn.call(M[D].context);break;case 2:M[D].fn.call(M[D].context,y);break;case 3:M[D].fn.call(M[D].context,y,g);break;case 4:M[D].fn.call(M[D].context,y,g,b);break;default:if(!T)for(k=1,T=new Array(O-1);k<O;k++)T[k-1]=arguments[k];M[D].fn.apply(M[D].context,T)}}return!0},a.prototype.on=function(p,y,g){return s(this,p,y,g,!1)},a.prototype.once=function(p,y,g){return s(this,p,y,g,!0)},a.prototype.removeListener=function(p,y,g,b){var S=n?n+p:p;if(!this._events[S])return this;if(!y)return c(this,S),this;var w=this._events[S];if(w.fn)w.fn===y&&(!b||w.once)&&(!g||w.context===g)&&c(this,S);else{for(var C=0,M=[],O=w.length;C<O;C++)(w[C].fn!==y||b&&!w[C].once||g&&w[C].context!==g)&&M.push(w[C]);M.length?this._events[S]=M.length===1?M[0]:M:c(this,S)}return this},a.prototype.removeAllListeners=function(p){var y;return p?(y=n?n+p:p,this._events[y]&&c(this,y)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a})(q4);var Hwe=q4.exports;const Xwe=Jn(Hwe);var B2=new Xwe,F2="recharts.syncMouseEvents";function Bp(e){"@babel/helpers - typeof";return Bp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bp(e)}function Zwe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ywe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,J4(r.key),r)}}function qwe(e,t,n){return Ywe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function z2(e,t,n){return t=J4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function J4(e){var t=Jwe(e,"string");return Bp(t)=="symbol"?t:t+""}function Jwe(e,t){if(Bp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Kwe=function(){function e(){Zwe(this,e),z2(this,"activeIndex",0),z2(this,"coordinateList",[]),z2(this,"layout","horizontal")}return qwe(e,[{key:"setDetails",value:function(n){var r,i=n.coordinateList,s=i===void 0?null:i,c=n.container,a=c===void 0?null:c,d=n.layout,p=d===void 0?null:d,y=n.offset,g=y===void 0?null:y,b=n.mouseHandlerCallback,S=b===void 0?null:b;this.coordinateList=(r=s??this.coordinateList)!==null&&r!==void 0?r:[],this.container=a??this.container,this.layout=p??this.layout,this.offset=g??this.offset,this.mouseHandlerCallback=S??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),s=i.x,c=i.y,a=i.height,d=this.coordinateList[this.activeIndex].coordinate,p=((n=window)===null||n===void 0?void 0:n.scrollX)||0,y=((r=window)===null||r===void 0?void 0:r.scrollY)||0,g=s+d+p,b=c+this.offset.top+a/2+y;this.mouseHandlerCallback({pageX:g,pageY:b})}}}])}();function Qwe(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],i=e==null?void 0:e[1];if(r&&i&&ln(r)&&ln(i))return!0}return!1}function e2e(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function K4(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,s=e.endAngle,c=Pr(t,n,r,i),a=Pr(t,n,r,s);return{points:[c,a],cx:t,cy:n,radius:r,startAngle:i,endAngle:s}}function t2e(e,t,n){var r,i,s,c;if(e==="horizontal")r=t.x,s=r,i=n.top,c=n.top+n.height;else if(e==="vertical")i=t.y,c=i,r=n.left,s=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var a=t.cx,d=t.cy,p=t.innerRadius,y=t.outerRadius,g=t.angle,b=Pr(a,d,p,g),S=Pr(a,d,y,g);r=b.x,i=b.y,s=S.x,c=S.y}else return K4(t);return[{x:r,y:i},{x:s,y:c}]}function Fp(e){"@babel/helpers - typeof";return Fp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fp(e)}function Q4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function t0(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Q4(Object(n),!0).forEach(function(r){n2e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function n2e(e,t,n){return t=r2e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r2e(e){var t=i2e(e,"string");return Fp(t)=="symbol"?t:t+""}function i2e(e,t){if(Fp(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Fp(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function a2e(e){var t,n,r=e.element,i=e.tooltipEventType,s=e.isActive,c=e.activeCoordinate,a=e.activePayload,d=e.offset,p=e.activeTooltipIndex,y=e.tooltipAxisBandSize,g=e.layout,b=e.chartName,S=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!S||!s||!c||b!=="ScatterChart"&&i!=="axis")return null;var w,C=i2;if(b==="ScatterChart")w=c,C=dxe;else if(b==="BarChart")w=e2e(g,c,d,y),C=m2;else if(g==="radial"){var M=K4(c),O=M.cx,T=M.cy,D=M.radius,N=M.startAngle,k=M.endAngle;w={cx:O,cy:T,startAngle:N,endAngle:k,innerRadius:D,outerRadius:D},C=p5}else w={points:t2e(g,c,d)},C=i2;var L=t0(t0(t0(t0({stroke:"#ccc",pointerEvents:"none"},d),w),Fn(S,!1)),{},{payload:a,payloadIndex:p,className:Yn("recharts-tooltip-cursor",S.className)});return U.isValidElement(S)?U.cloneElement(S,L):U.createElement(C,L)}var s2e=["item"],o2e=["children","className","width","height","style","compact","title","desc"];function Hh(e){"@babel/helpers - typeof";return Hh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hh(e)}function Xh(){return Xh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xh.apply(this,arguments)}function eN(e,t){return u2e(e)||c2e(e,t)||rN(e,t)||l2e()}function l2e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
936
936
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c2e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,c,a=[],d=!0,p=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(d=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);d=!0);}catch(y){p=!0,i=y}finally{try{if(!d&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(p)throw i}}return a}}function u2e(e){if(Array.isArray(e))return e}function tN(e,t){if(e==null)return{};var n=h2e(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function h2e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function d2e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f2e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,aN(r.key),r)}}function p2e(e,t,n){return f2e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function m2e(e,t,n){return t=n0(t),g2e(e,nN()?Reflect.construct(t,n,n0(e).constructor):t.apply(e,n))}function g2e(e,t){if(t&&(Hh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y2e(e)}function y2e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nN(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nN=function(){return!!e})()}function n0(e){return n0=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},n0(e)}function v2e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$2(e,t)}function $2(e,t){return $2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},$2(e,t)}function Zh(e){return _2e(e)||x2e(e)||rN(e)||b2e()}function b2e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
937
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rN(e,t){if(e){if(typeof e=="string")return G2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return G2(e,t)}}function x2e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _2e(e){if(Array.isArray(e))return G2(e)}function G2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function iN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Tt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iN(Object(n),!0).forEach(function(r){In(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function In(e,t,n){return t=aN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aN(e){var t=w2e(e,"string");return Hh(t)=="symbol"?t:t+""}function w2e(e,t){if(Hh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Hh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var S2e={xAxis:["bottom","top"],yAxis:["left","right"]},C2e={width:"100%",height:"100%"},sN={x:0,y:0};function r0(e){return e}var M2e=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},A2e=function(t,n,r,i){var s=n.find(function(y){return y&&y.index===r});if(s){if(t==="horizontal")return{x:s.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:s.coordinate};if(t==="centric"){var c=s.coordinate,a=i.radius;return Tt(Tt(Tt({},i),Pr(i.cx,i.cy,a,c)),{},{angle:c,radius:a})}var d=s.coordinate,p=i.angle;return Tt(Tt(Tt({},i),Pr(i.cx,i.cy,d,p)),{},{angle:p,radius:d})}return sN},i0=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,s=n.dataEndIndex,c=(r??[]).reduce(function(a,d){var p=d.props.data;return p&&p.length?[].concat(Zh(a),Zh(p)):a},[]);return c.length>0?c:t&&t.length&&ln(i)&&ln(s)?t.slice(i,s+1):[]};function oN(e){return e==="number"?[0,"auto"]:void 0}var V2=function(t,n,r,i){var s=t.graphicalItems,c=t.tooltipAxis,a=i0(n,t);return r<0||!s||!s.length||r>=a.length?null:s.reduce(function(d,p){var y,g=(y=p.props.data)!==null&&y!==void 0?y:n;g&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(g=g.slice(t.dataStartIndex,t.dataEndIndex+1));var b;if(c.dataKey&&!c.allowDuplicatedCategory){var S=g===void 0?a:g;b=Q1(S,c.dataKey,i)}else b=g&&g[r]||a[r];return b?[].concat(Zh(d),[tve(p,b)]):d},[])},lN=function(t,n,r,i){var s=i||{x:t.chartX,y:t.chartY},c=M2e(s,r),a=t.orderedTooltipTicks,d=t.tooltipAxis,p=t.tooltipTicks,y=Fye(c,a,p,d);if(y>=0&&p){var g=p[y]&&p[y].value,b=V2(t,n,y,g),S=A2e(r,a,y,s);return{activeTooltipIndex:y,activeLabel:g,activePayload:b,activeCoordinate:S}}return null},E2e=function(t,n){var r=n.axes,i=n.graphicalItems,s=n.axisType,c=n.axisIdKey,a=n.stackGroups,d=n.dataStartIndex,p=n.dataEndIndex,y=t.layout,g=t.children,b=t.stackOffset,S=ZL(y,s);return r.reduce(function(w,C){var M,O=C.type.defaultProps!==void 0?Tt(Tt({},C.type.defaultProps),C.props):C.props,T=O.type,D=O.dataKey,N=O.allowDataOverflow,k=O.allowDuplicatedCategory,L=O.scale,j=O.ticks,q=O.includeHidden,re=O[c];if(w[re])return w;var ie=i0(t.data,{graphicalItems:i.filter(function(xe){var se,ge=c in xe.props?xe.props[c]:(se=xe.type.defaultProps)===null||se===void 0?void 0:se[c];return ge===re}),dataStartIndex:d,dataEndIndex:p}),$=ie.length,Y,X,F;Qwe(O.domain,N,T)&&(Y=Kw(O.domain,null,N),S&&(T==="number"||L!=="auto")&&(F=pp(ie,D,"category")));var R=oN(T);if(!Y||Y.length===0){var Z,W=(Z=O.domain)!==null&&Z!==void 0?Z:R;if(D){if(Y=pp(ie,D,T),T==="category"&&S){var ae=Rne(Y);k&&ae?(X=Y,Y=Vv(0,$)):k||(Y=QL(W,Y,C).reduce(function(xe,se){return xe.indexOf(se)>=0?xe:[].concat(Zh(xe),[se])},[]))}else if(T==="category")k?Y=Y.filter(function(xe){return xe!==""&&!Xn(xe)}):Y=QL(W,Y,C).reduce(function(xe,se){return xe.indexOf(se)>=0||se===""||Xn(se)?xe:[].concat(Zh(xe),[se])},[]);else if(T==="number"){var ne=Wye(ie,i.filter(function(xe){var se,ge,Se=c in xe.props?xe.props[c]:(se=xe.type.defaultProps)===null||se===void 0?void 0:se[c],Me="hide"in xe.props?xe.props.hide:(ge=xe.type.defaultProps)===null||ge===void 0?void 0:ge.hide;return Se===re&&(q||!Me)}),D,s,y);ne&&(Y=ne)}S&&(T==="number"||L!=="auto")&&(F=pp(ie,D,"category"))}else S?Y=Vv(0,$):a&&a[re]&&a[re].hasStack&&T==="number"?Y=b==="expand"?[0,1]:qL(a[re].stackGroups,d,p):Y=XL(ie,i.filter(function(xe){var se=c in xe.props?xe.props[c]:xe.type.defaultProps[c],ge="hide"in xe.props?xe.props.hide:xe.type.defaultProps.hide;return se===re&&(q||!ge)}),T,y,!0);if(T==="number")Y=j2(g,Y,re,s,j),W&&(Y=Kw(W,Y,N));else if(T==="category"&&W){var J=W,ue=Y.every(function(xe){return J.indexOf(xe)>=0});ue&&(Y=J)}}return Tt(Tt({},w),{},In({},re,Tt(Tt({},O),{},{axisType:s,domain:Y,categoricalDomain:F,duplicateDomain:X,originalDomain:(M=O.domain)!==null&&M!==void 0?M:R,isCategorical:S,layout:y})))},{})},T2e=function(t,n){var r=n.graphicalItems,i=n.Axis,s=n.axisType,c=n.axisIdKey,a=n.stackGroups,d=n.dataStartIndex,p=n.dataEndIndex,y=t.layout,g=t.children,b=i0(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:p}),S=b.length,w=ZL(y,s),C=-1;return r.reduce(function(M,O){var T=O.type.defaultProps!==void 0?Tt(Tt({},O.type.defaultProps),O.props):O.props,D=T[c],N=oN("number");if(!M[D]){C++;var k;return w?k=Vv(0,S):a&&a[D]&&a[D].hasStack?(k=qL(a[D].stackGroups,d,p),k=j2(g,k,D,s)):(k=Kw(N,XL(b,r.filter(function(L){var j,q,re=c in L.props?L.props[c]:(j=L.type.defaultProps)===null||j===void 0?void 0:j[c],ie="hide"in L.props?L.props.hide:(q=L.type.defaultProps)===null||q===void 0?void 0:q.hide;return re===D&&!ie}),"number",y),i.defaultProps.allowDataOverflow),k=j2(g,k,D,s)),Tt(Tt({},M),{},In({},D,Tt(Tt({axisType:s},i.defaultProps),{},{hide:!0,orientation:_s(S2e,"".concat(s,".").concat(C%2),null),domain:k,originalDomain:N,isCategorical:w,layout:y})))}return M},{})},I2e=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,s=n.AxisComp,c=n.graphicalItems,a=n.stackGroups,d=n.dataStartIndex,p=n.dataEndIndex,y=t.children,g="".concat(i,"Id"),b=Ks(y,s),S={};return b.length?S=E2e(t,{axes:b,graphicalItems:c,axisType:i,axisIdKey:g,stackGroups:a,dataStartIndex:d,dataEndIndex:p}):c&&c.length&&(S=T2e(t,{Axis:s,graphicalItems:c,axisType:i,axisIdKey:g,stackGroups:a,dataStartIndex:d,dataEndIndex:p})),S},P2e=function(t){var n=hh(t),r=mp(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:V_(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Qw(n,r)}},cN=function(t){var n=t.children,r=t.defaultShowTooltip,i=Qa(n,Gh),s=0,c=0;return t.data&&t.data.length!==0&&(c=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(s=i.props.startIndex),i.props.endIndex>=0&&(c=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:s,dataEndIndex:c,activeTooltipIndex:-1,isTooltipActive:!!r}},O2e=function(t){return!t||!t.length?!1:t.some(function(n){var r=Ol(n&&n.type);return r&&r.indexOf("Bar")>=0})},uN=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},k2e=function(t,n){var r=t.props,i=t.graphicalItems,s=t.xAxisMap,c=s===void 0?{}:s,a=t.yAxisMap,d=a===void 0?{}:a,p=r.width,y=r.height,g=r.children,b=r.margin||{},S=Qa(g,Gh),w=Qa(g,bh),C=Object.keys(d).reduce(function(k,L){var j=d[L],q=j.orientation;return!j.mirror&&!j.hide?Tt(Tt({},k),{},In({},q,k[q]+j.width)):k},{left:b.left||0,right:b.right||0}),M=Object.keys(c).reduce(function(k,L){var j=c[L],q=j.orientation;return!j.mirror&&!j.hide?Tt(Tt({},k),{},In({},q,_s(k,"".concat(q))+j.height)):k},{top:b.top||0,bottom:b.bottom||0}),O=Tt(Tt({},M),C),T=O.bottom;S&&(O.bottom+=S.props.height||Gh.defaultProps.height),w&&n&&(O=Gye(O,i,r,n));var D=p-O.left-O.right,N=y-O.top-O.bottom;return Tt(Tt({brushBottom:T},O),{},{width:Math.max(D,0),height:Math.max(N,0)})},D2e=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},L2e=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,s=i===void 0?"axis":i,c=t.validateTooltipEventTypes,a=c===void 0?["axis"]:c,d=t.axisComponents,p=t.legendContent,y=t.formatAxisMap,g=t.defaultProps,b=function(O,T){var D=T.graphicalItems,N=T.stackGroups,k=T.offset,L=T.updateId,j=T.dataStartIndex,q=T.dataEndIndex,re=O.barSize,ie=O.layout,$=O.barGap,Y=O.barCategoryGap,X=O.maxBarSize,F=uN(ie),R=F.numericAxisName,Z=F.cateAxisName,W=O2e(D),ae=[];return D.forEach(function(ne,J){var ue=i0(O.data,{graphicalItems:[ne],dataStartIndex:j,dataEndIndex:q}),xe=ne.type.defaultProps!==void 0?Tt(Tt({},ne.type.defaultProps),ne.props):ne.props,se=xe.dataKey,ge=xe.maxBarSize,Se=xe["".concat(R,"Id")],Me=xe["".concat(Z,"Id")],$e={},le=d.reduce(function(ct,at){var ke,Te,Le=T["".concat(at.axisType,"Map")],ze=xe["".concat(at.axisType,"Id")];Le&&Le[ze]||at.axisType==="zAxis"||(process.env.NODE_ENV!=="production"?as(!1,"Specifying a(n) ".concat(at.axisType,"Id requires a corresponding ").concat(at.axisType,"Id on the targeted graphical component ").concat((ke=ne==null||(Te=ne.type)===null||Te===void 0?void 0:Te.displayName)!==null&&ke!==void 0?ke:"")):as());var Qe=Le[ze];return Tt(Tt({},ct),{},In(In({},at.axisType,Qe),"".concat(at.axisType,"Ticks"),mp(Qe)))},$e),te=le[Z],pe=le["".concat(Z,"Ticks")],Ae=N&&N[Se]&&N[Se].hasStack&&Qye(ne,N[Se].stackGroups),H=Ol(ne.type).indexOf("Bar")>=0,fe=Qw(te,pe),oe=[],_e=W&&zye({barSize:re,stackGroups:N,totalSize:D2e(le,Z)});if(H){var ce,Oe,Be=Xn(ge)?X:ge,Re=(ce=(Oe=Qw(te,pe,!0))!==null&&Oe!==void 0?Oe:Be)!==null&&ce!==void 0?ce:0;oe=$ye({barGap:$,barCategoryGap:Y,bandSize:Re!==fe?Re:fe,sizeList:_e[Me],maxBarSize:Be}),Re!==fe&&(oe=oe.map(function(ct){return Tt(Tt({},ct),{},{position:Tt(Tt({},ct.position),{},{offset:ct.position.offset-Re/2})})}))}var He=ne&&ne.type&&ne.type.getComposedData;He&&ae.push({props:Tt(Tt({},He(Tt(Tt({},le),{},{displayedData:ue,props:O,dataKey:se,item:ne,bandSize:fe,barPosition:oe,offset:k,stackedData:Ae,layout:ie,dataStartIndex:j,dataEndIndex:q}))),{},In(In(In({key:ne.key||"item-".concat(J)},R,le[R]),Z,le[Z]),"animationId",L)),childIndex:Xne(ne,O.children),item:ne})}),ae},S=function(O,T){var D=O.props,N=O.dataStartIndex,k=O.dataEndIndex,L=O.updateId;if(!VO({props:D}))return null;var j=D.children,q=D.layout,re=D.stackOffset,ie=D.data,$=D.reverseStackOrder,Y=uN(q),X=Y.numericAxisName,F=Y.cateAxisName,R=Ks(j,r),Z=Jye(ie,R,"".concat(X,"Id"),"".concat(F,"Id"),re,$),W=d.reduce(function(xe,se){var ge="".concat(se.axisType,"Map");return Tt(Tt({},xe),{},In({},ge,I2e(D,Tt(Tt({},se),{},{graphicalItems:R,stackGroups:se.axisType===X&&Z,dataStartIndex:N,dataEndIndex:k}))))},{}),ae=k2e(Tt(Tt({},W),{},{props:D,graphicalItems:R}),T==null?void 0:T.legendBBox);Object.keys(W).forEach(function(xe){W[xe]=y(D,W[xe],ae,xe.replace("Map",""),n)});var ne=W["".concat(F,"Map")],J=P2e(ne),ue=b(D,Tt(Tt({},W),{},{dataStartIndex:N,dataEndIndex:k,updateId:L,graphicalItems:R,stackGroups:Z,offset:ae}));return Tt(Tt({formattedGraphicalItems:ue,graphicalItems:R,offset:ae,stackGroups:Z},J),W)},w=function(M){function O(T){var D,N,k;return d2e(this,O),k=m2e(this,O,[T]),In(k,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),In(k,"accessibilityManager",new Kwe),In(k,"handleLegendBBoxUpdate",function(L){if(L){var j=k.state,q=j.dataStartIndex,re=j.dataEndIndex,ie=j.updateId;k.setState(Tt({legendBBox:L},S({props:k.props,dataStartIndex:q,dataEndIndex:re,updateId:ie},Tt(Tt({},k.state),{},{legendBBox:L}))))}}),In(k,"handleReceiveSyncEvent",function(L,j,q){if(k.props.syncId===L){if(q===k.eventEmitterSymbol&&typeof k.props.syncMethod!="function")return;k.applySyncEvent(j)}}),In(k,"handleBrushChange",function(L){var j=L.startIndex,q=L.endIndex;if(j!==k.state.dataStartIndex||q!==k.state.dataEndIndex){var re=k.state.updateId;k.setState(function(){return Tt({dataStartIndex:j,dataEndIndex:q},S({props:k.props,dataStartIndex:j,dataEndIndex:q,updateId:re},k.state))}),k.triggerSyncEvent({dataStartIndex:j,dataEndIndex:q})}}),In(k,"handleMouseEnter",function(L){var j=k.getMouseInfo(L);if(j){var q=Tt(Tt({},j),{},{isTooltipActive:!0});k.setState(q),k.triggerSyncEvent(q);var re=k.props.onMouseEnter;$n(re)&&re(q,L)}}),In(k,"triggeredAfterMouseMove",function(L){var j=k.getMouseInfo(L),q=j?Tt(Tt({},j),{},{isTooltipActive:!0}):{isTooltipActive:!1};k.setState(q),k.triggerSyncEvent(q);var re=k.props.onMouseMove;$n(re)&&re(q,L)}),In(k,"handleItemMouseEnter",function(L){k.setState(function(){return{isTooltipActive:!0,activeItem:L,activePayload:L.tooltipPayload,activeCoordinate:L.tooltipPosition||{x:L.cx,y:L.cy}}})}),In(k,"handleItemMouseLeave",function(){k.setState(function(){return{isTooltipActive:!1}})}),In(k,"handleMouseMove",function(L){L.persist(),k.throttleTriggeredAfterMouseMove(L)}),In(k,"handleMouseLeave",function(L){k.throttleTriggeredAfterMouseMove.cancel();var j={isTooltipActive:!1};k.setState(j),k.triggerSyncEvent(j);var q=k.props.onMouseLeave;$n(q)&&q(j,L)}),In(k,"handleOuterEvent",function(L){var j=Hne(L),q=_s(k.props,"".concat(j));if(j&&$n(q)){var re,ie;/.*touch.*/i.test(j)?ie=k.getMouseInfo(L.changedTouches[0]):ie=k.getMouseInfo(L),q((re=ie)!==null&&re!==void 0?re:{},L)}}),In(k,"handleClick",function(L){var j=k.getMouseInfo(L);if(j){var q=Tt(Tt({},j),{},{isTooltipActive:!0});k.setState(q),k.triggerSyncEvent(q);var re=k.props.onClick;$n(re)&&re(q,L)}}),In(k,"handleMouseDown",function(L){var j=k.props.onMouseDown;if($n(j)){var q=k.getMouseInfo(L);j(q,L)}}),In(k,"handleMouseUp",function(L){var j=k.props.onMouseUp;if($n(j)){var q=k.getMouseInfo(L);j(q,L)}}),In(k,"handleTouchMove",function(L){L.changedTouches!=null&&L.changedTouches.length>0&&k.throttleTriggeredAfterMouseMove(L.changedTouches[0])}),In(k,"handleTouchStart",function(L){L.changedTouches!=null&&L.changedTouches.length>0&&k.handleMouseDown(L.changedTouches[0])}),In(k,"handleTouchEnd",function(L){L.changedTouches!=null&&L.changedTouches.length>0&&k.handleMouseUp(L.changedTouches[0])}),In(k,"handleDoubleClick",function(L){var j=k.props.onDoubleClick;if($n(j)){var q=k.getMouseInfo(L);j(q,L)}}),In(k,"handleContextMenu",function(L){var j=k.props.onContextMenu;if($n(j)){var q=k.getMouseInfo(L);j(q,L)}}),In(k,"triggerSyncEvent",function(L){k.props.syncId!==void 0&&B2.emit(F2,k.props.syncId,L,k.eventEmitterSymbol)}),In(k,"applySyncEvent",function(L){var j=k.props,q=j.layout,re=j.syncMethod,ie=k.state.updateId,$=L.dataStartIndex,Y=L.dataEndIndex;if(L.dataStartIndex!==void 0||L.dataEndIndex!==void 0)k.setState(Tt({dataStartIndex:$,dataEndIndex:Y},S({props:k.props,dataStartIndex:$,dataEndIndex:Y,updateId:ie},k.state)));else if(L.activeTooltipIndex!==void 0){var X=L.chartX,F=L.chartY,R=L.activeTooltipIndex,Z=k.state,W=Z.offset,ae=Z.tooltipTicks;if(!W)return;if(typeof re=="function")R=re(ae,L);else if(re==="value"){R=-1;for(var ne=0;ne<ae.length;ne++)if(ae[ne].value===L.activeLabel){R=ne;break}}var J=Tt(Tt({},W),{},{x:W.left,y:W.top}),ue=Math.min(X,J.x+J.width),xe=Math.min(F,J.y+J.height),se=ae[R]&&ae[R].value,ge=V2(k.state,k.props.data,R),Se=ae[R]?{x:q==="horizontal"?ae[R].coordinate:ue,y:q==="horizontal"?xe:ae[R].coordinate}:sN;k.setState(Tt(Tt({},L),{},{activeLabel:se,activeCoordinate:Se,activePayload:ge,activeTooltipIndex:R}))}else k.setState(L)}),In(k,"renderCursor",function(L){var j,q=k.state,re=q.isTooltipActive,ie=q.activeCoordinate,$=q.activePayload,Y=q.offset,X=q.activeTooltipIndex,F=q.tooltipAxisBandSize,R=k.getTooltipEventType(),Z=(j=L.props.active)!==null&&j!==void 0?j:re,W=k.props.layout,ae=L.key||"_recharts-cursor";return U.createElement(a2e,{key:ae,activeCoordinate:ie,activePayload:$,activeTooltipIndex:X,chartName:n,element:L,isActive:Z,layout:W,offset:Y,tooltipAxisBandSize:F,tooltipEventType:R})}),In(k,"renderPolarAxis",function(L,j,q){var re=_s(L,"type.axisType"),ie=_s(k.state,"".concat(re,"Map")),$=L.type.defaultProps,Y=$!==void 0?Tt(Tt({},$),L.props):L.props,X=ie&&ie[Y["".concat(re,"Id")]];return U.cloneElement(L,Tt(Tt({},X),{},{className:Yn(re,X.className),key:L.key||"".concat(j,"-").concat(q),ticks:mp(X,!0)}))}),In(k,"renderPolarGrid",function(L){var j=L.props,q=j.radialLines,re=j.polarAngles,ie=j.polarRadius,$=k.state,Y=$.radiusAxisMap,X=$.angleAxisMap,F=hh(Y),R=hh(X),Z=R.cx,W=R.cy,ae=R.innerRadius,ne=R.outerRadius;return U.cloneElement(L,{polarAngles:Array.isArray(re)?re:mp(R,!0).map(function(J){return J.coordinate}),polarRadius:Array.isArray(ie)?ie:mp(F,!0).map(function(J){return J.coordinate}),cx:Z,cy:W,innerRadius:ae,outerRadius:ne,key:L.key||"polar-grid",radialLines:q})}),In(k,"renderLegend",function(){var L=k.state.formattedGraphicalItems,j=k.props,q=j.children,re=j.width,ie=j.height,$=k.props.margin||{},Y=re-($.left||0)-($.right||0),X=VL({children:q,formattedGraphicalItems:L,legendWidth:Y,legendContent:p});if(!X)return null;var F=X.item,R=tN(X,s2e);return U.cloneElement(F,Tt(Tt({},R),{},{chartWidth:re,chartHeight:ie,margin:$,onBBoxUpdate:k.handleLegendBBoxUpdate}))}),In(k,"renderTooltip",function(){var L,j=k.props,q=j.children,re=j.accessibilityLayer,ie=Qa(q,Qs);if(!ie)return null;var $=k.state,Y=$.isTooltipActive,X=$.activeCoordinate,F=$.activePayload,R=$.activeLabel,Z=$.offset,W=(L=ie.props.active)!==null&&L!==void 0?L:Y;return U.cloneElement(ie,{viewBox:Tt(Tt({},Z),{},{x:Z.left,y:Z.top}),active:W,label:R,payload:W?F:[],coordinate:X,accessibilityLayer:re})}),In(k,"renderBrush",function(L){var j=k.props,q=j.margin,re=j.data,ie=k.state,$=ie.offset,Y=ie.dataStartIndex,X=ie.dataEndIndex,F=ie.updateId;return U.cloneElement(L,{key:L.key||"_recharts-brush",onChange:xv(k.handleBrushChange,L.props.onChange),data:re,x:ln(L.props.x)?L.props.x:$.left,y:ln(L.props.y)?L.props.y:$.top+$.height+$.brushBottom-(q.bottom||0),width:ln(L.props.width)?L.props.width:$.width,startIndex:Y,endIndex:X,updateId:"brush-".concat(F)})}),In(k,"renderReferenceElement",function(L,j,q){if(!L)return null;var re=k,ie=re.clipPathId,$=k.state,Y=$.xAxisMap,X=$.yAxisMap,F=$.offset,R=L.type.defaultProps||{},Z=L.props,W=Z.xAxisId,ae=W===void 0?R.xAxisId:W,ne=Z.yAxisId,J=ne===void 0?R.yAxisId:ne;return U.cloneElement(L,{key:L.key||"".concat(j,"-").concat(q),xAxis:Y[ae],yAxis:X[J],viewBox:{x:F.left,y:F.top,width:F.width,height:F.height},clipPathId:ie})}),In(k,"renderActivePoints",function(L){var j=L.item,q=L.activePoint,re=L.basePoint,ie=L.childIndex,$=L.isRange,Y=[],X=j.props.key,F=j.item.type.defaultProps!==void 0?Tt(Tt({},j.item.type.defaultProps),j.item.props):j.item.props,R=F.activeDot,Z=F.dataKey,W=Tt(Tt({index:ie,dataKey:Z,cx:q.x,cy:q.y,r:4,fill:qw(j.item),strokeWidth:2,stroke:"#fff",payload:q.payload,value:q.value},Fn(R,!1)),_y(R));return Y.push(O.renderActiveDot(R,W,"".concat(X,"-activePoint-").concat(ie))),re?Y.push(O.renderActiveDot(R,Tt(Tt({},W),{},{cx:re.x,cy:re.y}),"".concat(X,"-basePoint-").concat(ie))):$&&Y.push(null),Y}),In(k,"renderGraphicChild",function(L,j,q){var re=k.filterFormatItem(L,j,q);if(!re)return null;var ie=k.getTooltipEventType(),$=k.state,Y=$.isTooltipActive,X=$.tooltipAxis,F=$.activeTooltipIndex,R=$.activeLabel,Z=k.props.children,W=Qa(Z,Qs),ae=re.props,ne=ae.points,J=ae.isRange,ue=ae.baseLine,xe=re.item.type.defaultProps!==void 0?Tt(Tt({},re.item.type.defaultProps),re.item.props):re.item.props,se=xe.activeDot,ge=xe.hide,Se=xe.activeBar,Me=xe.activeShape,$e=!!(!ge&&Y&&W&&(se||Se||Me)),le={};ie!=="axis"&&W&&W.props.trigger==="click"?le={onClick:xv(k.handleItemMouseEnter,L.props.onClick)}:ie!=="axis"&&(le={onMouseLeave:xv(k.handleItemMouseLeave,L.props.onMouseLeave),onMouseEnter:xv(k.handleItemMouseEnter,L.props.onMouseEnter)});var te=U.cloneElement(L,Tt(Tt({},re.props),le));function pe(at){return typeof X.dataKey=="function"?X.dataKey(at.payload):null}if($e)if(F>=0){var Ae,H;if(X.dataKey&&!X.allowDuplicatedCategory){var fe=typeof X.dataKey=="function"?pe:"payload.".concat(X.dataKey.toString());Ae=Q1(ne,fe,R),H=J&&ue&&Q1(ue,fe,R)}else Ae=ne==null?void 0:ne[F],H=J&&ue&&ue[F];if(Me||Se){var oe=L.props.activeIndex!==void 0?L.props.activeIndex:F;return[U.cloneElement(L,Tt(Tt(Tt({},re.props),le),{},{activeIndex:oe})),null,null]}if(!Xn(Ae))return[te].concat(Zh(k.renderActivePoints({item:re,activePoint:Ae,basePoint:H,childIndex:F,isRange:J})))}else{var _e,ce=(_e=k.getItemByXY(k.state.activeCoordinate))!==null&&_e!==void 0?_e:{graphicalItem:te},Oe=ce.graphicalItem,Be=Oe.item,Re=Be===void 0?L:Be,He=Oe.childIndex,ct=Tt(Tt(Tt({},re.props),le),{},{activeIndex:He});return[U.cloneElement(Re,ct),null,null]}return J?[te,null,null]:[te,null]}),In(k,"renderCustomized",function(L,j,q){return U.cloneElement(L,Tt(Tt({key:"recharts-customized-".concat(q)},k.props),k.state))}),In(k,"renderMap",{CartesianGrid:{handler:r0,once:!0},ReferenceArea:{handler:k.renderReferenceElement},ReferenceLine:{handler:r0},ReferenceDot:{handler:k.renderReferenceElement},XAxis:{handler:r0},YAxis:{handler:r0},Brush:{handler:k.renderBrush,once:!0},Bar:{handler:k.renderGraphicChild},Line:{handler:k.renderGraphicChild},Area:{handler:k.renderGraphicChild},Radar:{handler:k.renderGraphicChild},RadialBar:{handler:k.renderGraphicChild},Scatter:{handler:k.renderGraphicChild},Pie:{handler:k.renderGraphicChild},Funnel:{handler:k.renderGraphicChild},Tooltip:{handler:k.renderCursor,once:!0},PolarGrid:{handler:k.renderPolarGrid,once:!0},PolarAngleAxis:{handler:k.renderPolarAxis},PolarRadiusAxis:{handler:k.renderPolarAxis},Customized:{handler:k.renderCustomized}}),k.clipPathId="".concat((D=T.id)!==null&&D!==void 0?D:xy("recharts"),"-clip"),k.throttleTriggeredAfterMouseMove=ofe(k.triggeredAfterMouseMove,(N=T.throttleDelay)!==null&&N!==void 0?N:1e3/60),k.state={},k}return v2e(O,M),p2e(O,[{key:"componentDidMount",value:function(){var D,N;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(D=this.props.margin.left)!==null&&D!==void 0?D:0,top:(N=this.props.margin.top)!==null&&N!==void 0?N:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var D=this.props,N=D.children,k=D.data,L=D.height,j=D.layout,q=Qa(N,Qs);if(q){var re=q.props.defaultIndex;if(!(typeof re!="number"||re<0||re>this.state.tooltipTicks.length-1)){var ie=this.state.tooltipTicks[re]&&this.state.tooltipTicks[re].value,$=V2(this.state,k,re,ie),Y=this.state.tooltipTicks[re].coordinate,X=(this.state.offset.top+L)/2,F=j==="horizontal",R=F?{x:Y,y:X}:{y:Y,x:X},Z=this.state.formattedGraphicalItems.find(function(ae){var ne=ae.item;return ne.type.name==="Scatter"});Z&&(R=Tt(Tt({},R),Z.props.points[re].tooltipPosition),$=Z.props.points[re].tooltipPayload);var W={activeTooltipIndex:re,isTooltipActive:!0,activeLabel:ie,activePayload:$,activeCoordinate:R};this.setState(W),this.renderCursor(q),this.accessibilityManager.setIndex(re)}}}},{key:"getSnapshotBeforeUpdate",value:function(D,N){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==N.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==D.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==D.margin){var k,L;this.accessibilityManager.setDetails({offset:{left:(k=this.props.margin.left)!==null&&k!==void 0?k:0,top:(L=this.props.margin.top)!==null&&L!==void 0?L:0}})}return null}},{key:"componentDidUpdate",value:function(D){s_([Qa(D.children,Qs)],[Qa(this.props.children,Qs)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var D=Qa(this.props.children,Qs);if(D&&typeof D.props.shared=="boolean"){var N=D.props.shared?"axis":"item";return a.indexOf(N)>=0?N:s}return s}},{key:"getMouseInfo",value:function(D){if(!this.container)return null;var N=this.container,k=N.getBoundingClientRect(),L=pfe(k),j={chartX:Math.round(D.pageX-L.left),chartY:Math.round(D.pageY-L.top)},q=k.width/N.offsetWidth||1,re=this.inRange(j.chartX,j.chartY,q);if(!re)return null;var ie=this.state,$=ie.xAxisMap,Y=ie.yAxisMap,X=this.getTooltipEventType();if(X!=="axis"&&$&&Y){var F=hh($).scale,R=hh(Y).scale,Z=F&&F.invert?F.invert(j.chartX):null,W=R&&R.invert?R.invert(j.chartY):null;return Tt(Tt({},j),{},{xValue:Z,yValue:W})}var ae=lN(this.state,this.props.data,this.props.layout,re);return ae?Tt(Tt({},j),ae):null}},{key:"inRange",value:function(D,N){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,L=this.props.layout,j=D/k,q=N/k;if(L==="horizontal"||L==="vertical"){var re=this.state.offset,ie=j>=re.left&&j<=re.left+re.width&&q>=re.top&&q<=re.top+re.height;return ie?{x:j,y:q}:null}var $=this.state,Y=$.angleAxisMap,X=$.radiusAxisMap;if(Y&&X){var F=hh(Y);return i5({x:j,y:q},F)}return null}},{key:"parseEventsOfWrapper",value:function(){var D=this.props.children,N=this.getTooltipEventType(),k=Qa(D,Qs),L={};k&&N==="axis"&&(k.props.trigger==="click"?L={onClick:this.handleClick}:L={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var j=_y(this.props,this.handleOuterEvent);return Tt(Tt({},j),L)}},{key:"addListener",value:function(){B2.on(F2,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){B2.removeListener(F2,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(D,N,k){for(var L=this.state.formattedGraphicalItems,j=0,q=L.length;j<q;j++){var re=L[j];if(re.item===D||re.props.key===D.key||N===Ol(re.item.type)&&k===re.childIndex)return re}return null}},{key:"renderClipPath",value:function(){var D=this.clipPathId,N=this.state.offset,k=N.left,L=N.top,j=N.height,q=N.width;return U.createElement("defs",null,U.createElement("clipPath",{id:D},U.createElement("rect",{x:k,y:L,height:j,width:q})))}},{key:"getXScales",value:function(){var D=this.state.xAxisMap;return D?Object.entries(D).reduce(function(N,k){var L=eN(k,2),j=L[0],q=L[1];return Tt(Tt({},N),{},In({},j,q.scale))},{}):null}},{key:"getYScales",value:function(){var D=this.state.yAxisMap;return D?Object.entries(D).reduce(function(N,k){var L=eN(k,2),j=L[0],q=L[1];return Tt(Tt({},N),{},In({},j,q.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(D){var N;return(N=this.state.xAxisMap)===null||N===void 0||(N=N[D])===null||N===void 0?void 0:N.scale}},{key:"getYScaleByAxisId",value:function(D){var N;return(N=this.state.yAxisMap)===null||N===void 0||(N=N[D])===null||N===void 0?void 0:N.scale}},{key:"getItemByXY",value:function(D){var N=this.state,k=N.formattedGraphicalItems,L=N.activeItem;if(k&&k.length)for(var j=0,q=k.length;j<q;j++){var re=k[j],ie=re.props,$=re.item,Y=$.type.defaultProps!==void 0?Tt(Tt({},$.type.defaultProps),$.props):$.props,X=Ol($.type);if(X==="Bar"){var F=(ie.data||[]).find(function(ae){return Hbe(D,ae)});if(F)return{graphicalItem:re,payload:F}}else if(X==="RadialBar"){var R=(ie.data||[]).find(function(ae){return i5(D,ae)});if(R)return{graphicalItem:re,payload:R}}else if(Fv(re,L)||zv(re,L)||Np(re,L)){var Z=R1e({graphicalItem:re,activeTooltipItem:L,itemData:Y.data}),W=Y.activeIndex===void 0?Z:Y.activeIndex;return{graphicalItem:Tt(Tt({},re),{},{childIndex:W}),payload:Np(re,L)?Y.data[Z]:re.props.data[Z]}}}return null}},{key:"render",value:function(){var D=this;if(!VO(this))return null;var N=this.props,k=N.children,L=N.className,j=N.width,q=N.height,re=N.style,ie=N.compact,$=N.title,Y=N.desc,X=tN(N,o2e),F=Fn(X,!1);if(ie)return U.createElement(L4,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},U.createElement(l_,Xh({},F,{width:j,height:q,title:$,desc:Y}),this.renderClipPath(),UO(k,this.renderMap)));if(this.props.accessibilityLayer){var R,Z;F.tabIndex=(R=this.props.tabIndex)!==null&&R!==void 0?R:0,F.role=(Z=this.props.role)!==null&&Z!==void 0?Z:"application",F.onKeyDown=function(ae){D.accessibilityManager.keyboardEvent(ae)},F.onFocus=function(){D.accessibilityManager.focus()}}var W=this.parseEventsOfWrapper();return U.createElement(L4,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},U.createElement("div",Xh({className:Yn("recharts-wrapper",L),style:Tt({position:"relative",cursor:"default",width:j,height:q},re)},W,{ref:function(ne){D.container=ne}}),U.createElement(l_,Xh({},F,{width:j,height:q,title:$,desc:Y,style:C2e}),this.renderClipPath(),UO(k,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(U.Component);In(w,"displayName",n),In(w,"defaultProps",Tt({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},g)),In(w,"getDerivedStateFromProps",function(M,O){var T=M.dataKey,D=M.data,N=M.children,k=M.width,L=M.height,j=M.layout,q=M.stackOffset,re=M.margin,ie=O.dataStartIndex,$=O.dataEndIndex;if(O.updateId===void 0){var Y=cN(M);return Tt(Tt(Tt({},Y),{},{updateId:0},S(Tt(Tt({props:M},Y),{},{updateId:0}),O)),{},{prevDataKey:T,prevData:D,prevWidth:k,prevHeight:L,prevLayout:j,prevStackOffset:q,prevMargin:re,prevChildren:N})}if(T!==O.prevDataKey||D!==O.prevData||k!==O.prevWidth||L!==O.prevHeight||j!==O.prevLayout||q!==O.prevStackOffset||!e_(re,O.prevMargin)){var X=cN(M),F={chartX:O.chartX,chartY:O.chartY,isTooltipActive:O.isTooltipActive},R=Tt(Tt({},lN(O,D,j)),{},{updateId:O.updateId+1}),Z=Tt(Tt(Tt({},X),F),R);return Tt(Tt(Tt({},Z),S(Tt({props:M},Z),O)),{},{prevDataKey:T,prevData:D,prevWidth:k,prevHeight:L,prevLayout:j,prevStackOffset:q,prevMargin:re,prevChildren:N})}if(!s_(N,O.prevChildren)){var W,ae,ne,J,ue=Qa(N,Gh),xe=ue&&(W=(ae=ue.props)===null||ae===void 0?void 0:ae.startIndex)!==null&&W!==void 0?W:ie,se=ue&&(ne=(J=ue.props)===null||J===void 0?void 0:J.endIndex)!==null&&ne!==void 0?ne:$,ge=xe!==ie||se!==$,Se=!Xn(D),Me=Se&&!ge?O.updateId:O.updateId+1;return Tt(Tt({updateId:Me},S(Tt(Tt({props:M},O),{},{updateId:Me,dataStartIndex:xe,dataEndIndex:se}),O)),{},{prevChildren:N,dataStartIndex:xe,dataEndIndex:se})}return null}),In(w,"renderActiveDot",function(M,O,T){var D;return U.isValidElement(M)?D=U.cloneElement(M,O):$n(M)?D=M(O):D=U.createElement(v2,O),U.createElement(Zr,{className:"recharts-active-dot",key:T},D)});var C=U.forwardRef(function(O,T){return U.createElement(w,Xh({},O,{ref:T}))});return C.displayName=w.displayName,C},N2e=L2e({chartName:"PieChart",GraphicalChild:Uo,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Rv},{axisType:"radiusAxis",AxisComp:Dv}],formatAxisMap:uve,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const W2={OPTIMAL:"Optimal",STRESS_START:"Stress Start",SEVERE_STRESS:"Severe Stress",EXCESS_WATER:"Excess Water"};function R2e(){const{markersData:e,showMarkers:t}=U.useContext(Ns),n=tn(p=>p.viewMode),r=e.reduce((p,y)=>{const g=y.paw_status;return g&&(p[g]=(p[g]||0)+1),p},{});delete r.WEATHER_STATION;const i=Object.keys(r).map(p=>({name:W2==null?void 0:W2[p],value:r[p],color:gO(p)})),s=Math.PI/180,c=({cx:p,cy:y,midAngle:g,innerRadius:b,outerRadius:S,percent:w,index:C})=>{const M=b+(S-b)*.5,O=p+M*Math.cos(-g*s),T=y+M*Math.sin(-g*s);return K.jsx("text",{x:O,y:T,fill:"white",textAnchor:O>p?"start":"end",dominantBaseline:"central",children:`${(w*100).toFixed(0)}%`})},a=U.useMemo(()=>i==null?void 0:i.reduce((p,y)=>p+(y==null?void 0:y.value),0),[i]);console.log("sum",a);const d=({active:p,payload:y,label:g})=>{var b,S,w,C;return p&&y&&y.length?K.jsx("div",{className:"custom-tooltip",style:{boxShadow:`0 0 0 1px ${(S=(b=y[0])==null?void 0:b.payload)==null?void 0:S.color}`,backgroundColor:"rgba(0,0,0,0.59)",padding:"4px",borderRadius:"6px"},children:K.jsx("p",{className:"label text-white",children:`${(w=y[0])==null?void 0:w.name} : ${(C=y[0])==null?void 0:C.value}`})}):null};return n==="PICKER"||!t||!i.length>0?null:K.jsx("div",{className:"paw-pie-chart ",children:K.jsxs(N2e,{width:115,height:115,children:[K.jsx(Uo,{labelLine:!1,label:c,data:i,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:50,fill:"#8884d8",children:i.map((p,y)=>K.jsx(J_,{fill:p.color},`cell-${y}`))}),K.jsx(Qs,{content:K.jsx(d,{})})]})})}function j2e(e){if(e&&!(!e.length>0))return e.map(t=>({x:new Date(t.interval.from).getTime(),y:t.outputs.data.bands.B0.stats.mean}))}const U2=({plot:e,point:t})=>{const[n,r]=U.useState([]),[i,s]=U.useState(!0),c=U.useContext(dy),a={chart:{type:"line",margin:[0,0,0,0],height:120},title:{text:""},xAxis:{type:"datetime",title:{text:null}},yAxis:{min:-1,max:1,title:{text:null},gridLineWidth:0,lineWidth:0,plotBands:[{from:-1,to:0,color:"rgba(0, 0, 255, 0.3)"},{from:0,to:.1,color:"rgba(165, 42, 42, 0.3)"},{from:.2,to:.5,color:"rgba(144, 238, 144, 0.3)"},{from:.6,to:.9,color:"rgba(0, 128, 0, 0.3)"},{from:.9,to:1,color:"rgba(34, 139, 34, 0.3)"}],labels:{enabled:!1}},series:[{name:"NDVI",data:j2e(n),tooltip:{valueDecimals:2,pointFormatter:function(){return`<b>${this.series.name}</b>: ${this.y.toFixed(2)}<br/>`}},color:"#333",lineWidth:1,marker:{enabled:!1}}],credits:{enabled:!1},legend:{enabled:!1}};return U.useEffect(()=>{(async()=>{try{let p;e&&(p=await wY(e,{accessToken:c})),t&&(console.log("sending request for point",t),p=await SY(t,{accessToken:c})),p&&r(p)}catch(p){console.log("Error fetching NDVI data",p)}finally{s(!1)}})()},[]),i?K.jsx(Ya,{}):K.jsx(mO,{highcharts:fO,options:a})};function B2e({popupInfo:e,onClose:t}){var M;const{showPlots:n,plots:r,clickedPlot:i,handleDeletePlot:s}=U.useContext(Po),{isConfirmed:c}=af(),{plot:a}=e;console.log("clickedPlot",i),console.log("clickedPlot popupInfo",e);const[d,p]=U.useState(!1),[y,g]=U.useState(0),[b,S]=U.useState(!1),w=U.useMemo(()=>r==null?void 0:r.find(O=>{var T,D;return((T=O==null?void 0:O.options)==null?void 0:T.id)===((D=a==null?void 0:a.properties)==null?void 0:D.id)}),[(M=a==null?void 0:a.properties)==null?void 0:M.id,r]),C=U.useCallback(async()=>{await c("Do you want to delete this plot?")&&(p(!0),s(w).finally(()=>{p(!1)}))},[w,c]);return U.useEffect(()=>{S(!0),w&&(w!=null&&w.device)?z7(w==null?void 0:w.device).then(O=>{console.log("et-tasks",O),g(O)}).finally(()=>{S(!1)}):S(!1)},[w]),!n||!i?null:K.jsx(pM,{longitude:e.lngLat.lng,latitude:e.lngLat.lat,closeButton:!1,closeOnClick:!0,onClose:t,anchor:"top",style:{width:240},className:"plot-popup overflow-y-hidden",children:K.jsxs("div",{className:"flex flex-col gap-1 items-center dark:text-gray-100 font-black text-[14px]",children:[K.jsxs("div",{className:"w-full flex justify-between items-center dark:text-gray-100 font-black text-[14px]",children:[K.jsx("h3",{className:"text-wrap",children:w.name}),K.jsxs("span",{className:"flex items-center gap-1",children:[K.jsx(Gn,{variant:"outline",size:"icon",onClick:C,"data-marker-id":w==null?void 0:w.id,children:d?K.jsx(Ya,{size:"small"}):K.jsx(Ng,{className:"w-5 h-5 action-icon text-red-500"})}),K.jsx(oP,{plot:w}),K.jsx(gs,{text:"close popup",children:K.jsx(Gn,{variant:"outline",size:"icon",onClick:t,children:K.jsx(ml,{className:"w-5 h-5 action-icon "})})})]})]}),K.jsx("hr",{}),K.jsx("div",{className:"w-[calc(100%+4px)]",children:K.jsx(U2,{plot:a})}),K.jsxs("div",{className:"w-full flex flex-col items-center gap-1",children:[K.jsxs("div",{className:"flex items-center justify-between w-full gap-2 rounded-md bg-zinc-100 dark:bg-zinc-800 p-2",children:[K.jsx("h4",{className:"scroll-m-20 text-xs font-medium tracking-tight",children:"Area (sqm)"}),K.jsx("div",{className:"flex items-center space-x-2",children:K.jsx("span",{className:"text-xs text-gray-700 dark:text-gray-200",children:U7(a).toFixed(2)})})]}),K.jsxs("div",{className:"flex items-center justify-between w-full gap-2 rounded-md bg-zinc-100 dark:bg-zinc-800 p-2",children:[K.jsx("h4",{className:"scroll-m-20 text-xs font-medium tracking-tight",children:"SAT-ET"}),K.jsx("div",{className:"flex items-center space-x-2",children:K.jsx("span",{className:"text-xs text-gray-700 dark:text-gray-200",children:w!=null&&w.enable_satellite_et?"enabled":"disabled"})})]}),(w==null?void 0:w.device)&&K.jsxs("div",{className:"flex items-center justify-between w-full gap-2 rounded-md bg-zinc-100 dark:bg-zinc-800 p-2",children:[K.jsx("h4",{className:"scroll-m-20 text-xs font-medium tracking-tight",children:"running tasks count"}),K.jsx("div",{className:"flex items-center space-x-2",children:K.jsxs("span",{className:"text-xs text-gray-700 dark:text-gray-200",children:[b&&K.jsx(Ya,{size:"small"}),!b&&y]})})]})]})]})})}const F2e=`
937
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rN(e,t){if(e){if(typeof e=="string")return G2(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return G2(e,t)}}function x2e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _2e(e){if(Array.isArray(e))return G2(e)}function G2(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function iN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Tt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iN(Object(n),!0).forEach(function(r){In(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iN(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function In(e,t,n){return t=aN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aN(e){var t=w2e(e,"string");return Hh(t)=="symbol"?t:t+""}function w2e(e,t){if(Hh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Hh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var S2e={xAxis:["bottom","top"],yAxis:["left","right"]},C2e={width:"100%",height:"100%"},sN={x:0,y:0};function r0(e){return e}var M2e=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},A2e=function(t,n,r,i){var s=n.find(function(y){return y&&y.index===r});if(s){if(t==="horizontal")return{x:s.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:s.coordinate};if(t==="centric"){var c=s.coordinate,a=i.radius;return Tt(Tt(Tt({},i),Pr(i.cx,i.cy,a,c)),{},{angle:c,radius:a})}var d=s.coordinate,p=i.angle;return Tt(Tt(Tt({},i),Pr(i.cx,i.cy,d,p)),{},{angle:p,radius:d})}return sN},i0=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,s=n.dataEndIndex,c=(r??[]).reduce(function(a,d){var p=d.props.data;return p&&p.length?[].concat(Zh(a),Zh(p)):a},[]);return c.length>0?c:t&&t.length&&ln(i)&&ln(s)?t.slice(i,s+1):[]};function oN(e){return e==="number"?[0,"auto"]:void 0}var V2=function(t,n,r,i){var s=t.graphicalItems,c=t.tooltipAxis,a=i0(n,t);return r<0||!s||!s.length||r>=a.length?null:s.reduce(function(d,p){var y,g=(y=p.props.data)!==null&&y!==void 0?y:n;g&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(g=g.slice(t.dataStartIndex,t.dataEndIndex+1));var b;if(c.dataKey&&!c.allowDuplicatedCategory){var S=g===void 0?a:g;b=Q1(S,c.dataKey,i)}else b=g&&g[r]||a[r];return b?[].concat(Zh(d),[tve(p,b)]):d},[])},lN=function(t,n,r,i){var s=i||{x:t.chartX,y:t.chartY},c=M2e(s,r),a=t.orderedTooltipTicks,d=t.tooltipAxis,p=t.tooltipTicks,y=Fye(c,a,p,d);if(y>=0&&p){var g=p[y]&&p[y].value,b=V2(t,n,y,g),S=A2e(r,a,y,s);return{activeTooltipIndex:y,activeLabel:g,activePayload:b,activeCoordinate:S}}return null},E2e=function(t,n){var r=n.axes,i=n.graphicalItems,s=n.axisType,c=n.axisIdKey,a=n.stackGroups,d=n.dataStartIndex,p=n.dataEndIndex,y=t.layout,g=t.children,b=t.stackOffset,S=ZL(y,s);return r.reduce(function(w,C){var M,O=C.type.defaultProps!==void 0?Tt(Tt({},C.type.defaultProps),C.props):C.props,T=O.type,D=O.dataKey,N=O.allowDataOverflow,k=O.allowDuplicatedCategory,L=O.scale,j=O.ticks,q=O.includeHidden,re=O[c];if(w[re])return w;var ie=i0(t.data,{graphicalItems:i.filter(function(xe){var se,ge=c in xe.props?xe.props[c]:(se=xe.type.defaultProps)===null||se===void 0?void 0:se[c];return ge===re}),dataStartIndex:d,dataEndIndex:p}),$=ie.length,Y,X,F;Qwe(O.domain,N,T)&&(Y=Kw(O.domain,null,N),S&&(T==="number"||L!=="auto")&&(F=pp(ie,D,"category")));var R=oN(T);if(!Y||Y.length===0){var Z,W=(Z=O.domain)!==null&&Z!==void 0?Z:R;if(D){if(Y=pp(ie,D,T),T==="category"&&S){var ae=Rne(Y);k&&ae?(X=Y,Y=Vv(0,$)):k||(Y=QL(W,Y,C).reduce(function(xe,se){return xe.indexOf(se)>=0?xe:[].concat(Zh(xe),[se])},[]))}else if(T==="category")k?Y=Y.filter(function(xe){return xe!==""&&!Xn(xe)}):Y=QL(W,Y,C).reduce(function(xe,se){return xe.indexOf(se)>=0||se===""||Xn(se)?xe:[].concat(Zh(xe),[se])},[]);else if(T==="number"){var ne=Wye(ie,i.filter(function(xe){var se,ge,Se=c in xe.props?xe.props[c]:(se=xe.type.defaultProps)===null||se===void 0?void 0:se[c],Me="hide"in xe.props?xe.props.hide:(ge=xe.type.defaultProps)===null||ge===void 0?void 0:ge.hide;return Se===re&&(q||!Me)}),D,s,y);ne&&(Y=ne)}S&&(T==="number"||L!=="auto")&&(F=pp(ie,D,"category"))}else S?Y=Vv(0,$):a&&a[re]&&a[re].hasStack&&T==="number"?Y=b==="expand"?[0,1]:qL(a[re].stackGroups,d,p):Y=XL(ie,i.filter(function(xe){var se=c in xe.props?xe.props[c]:xe.type.defaultProps[c],ge="hide"in xe.props?xe.props.hide:xe.type.defaultProps.hide;return se===re&&(q||!ge)}),T,y,!0);if(T==="number")Y=j2(g,Y,re,s,j),W&&(Y=Kw(W,Y,N));else if(T==="category"&&W){var J=W,ue=Y.every(function(xe){return J.indexOf(xe)>=0});ue&&(Y=J)}}return Tt(Tt({},w),{},In({},re,Tt(Tt({},O),{},{axisType:s,domain:Y,categoricalDomain:F,duplicateDomain:X,originalDomain:(M=O.domain)!==null&&M!==void 0?M:R,isCategorical:S,layout:y})))},{})},T2e=function(t,n){var r=n.graphicalItems,i=n.Axis,s=n.axisType,c=n.axisIdKey,a=n.stackGroups,d=n.dataStartIndex,p=n.dataEndIndex,y=t.layout,g=t.children,b=i0(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:p}),S=b.length,w=ZL(y,s),C=-1;return r.reduce(function(M,O){var T=O.type.defaultProps!==void 0?Tt(Tt({},O.type.defaultProps),O.props):O.props,D=T[c],N=oN("number");if(!M[D]){C++;var k;return w?k=Vv(0,S):a&&a[D]&&a[D].hasStack?(k=qL(a[D].stackGroups,d,p),k=j2(g,k,D,s)):(k=Kw(N,XL(b,r.filter(function(L){var j,q,re=c in L.props?L.props[c]:(j=L.type.defaultProps)===null||j===void 0?void 0:j[c],ie="hide"in L.props?L.props.hide:(q=L.type.defaultProps)===null||q===void 0?void 0:q.hide;return re===D&&!ie}),"number",y),i.defaultProps.allowDataOverflow),k=j2(g,k,D,s)),Tt(Tt({},M),{},In({},D,Tt(Tt({axisType:s},i.defaultProps),{},{hide:!0,orientation:_s(S2e,"".concat(s,".").concat(C%2),null),domain:k,originalDomain:N,isCategorical:w,layout:y})))}return M},{})},I2e=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,s=n.AxisComp,c=n.graphicalItems,a=n.stackGroups,d=n.dataStartIndex,p=n.dataEndIndex,y=t.children,g="".concat(i,"Id"),b=Ks(y,s),S={};return b.length?S=E2e(t,{axes:b,graphicalItems:c,axisType:i,axisIdKey:g,stackGroups:a,dataStartIndex:d,dataEndIndex:p}):c&&c.length&&(S=T2e(t,{Axis:s,graphicalItems:c,axisType:i,axisIdKey:g,stackGroups:a,dataStartIndex:d,dataEndIndex:p})),S},P2e=function(t){var n=hh(t),r=mp(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:V_(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Qw(n,r)}},cN=function(t){var n=t.children,r=t.defaultShowTooltip,i=Qa(n,Gh),s=0,c=0;return t.data&&t.data.length!==0&&(c=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(s=i.props.startIndex),i.props.endIndex>=0&&(c=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:s,dataEndIndex:c,activeTooltipIndex:-1,isTooltipActive:!!r}},O2e=function(t){return!t||!t.length?!1:t.some(function(n){var r=Ol(n&&n.type);return r&&r.indexOf("Bar")>=0})},uN=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},k2e=function(t,n){var r=t.props,i=t.graphicalItems,s=t.xAxisMap,c=s===void 0?{}:s,a=t.yAxisMap,d=a===void 0?{}:a,p=r.width,y=r.height,g=r.children,b=r.margin||{},S=Qa(g,Gh),w=Qa(g,bh),C=Object.keys(d).reduce(function(k,L){var j=d[L],q=j.orientation;return!j.mirror&&!j.hide?Tt(Tt({},k),{},In({},q,k[q]+j.width)):k},{left:b.left||0,right:b.right||0}),M=Object.keys(c).reduce(function(k,L){var j=c[L],q=j.orientation;return!j.mirror&&!j.hide?Tt(Tt({},k),{},In({},q,_s(k,"".concat(q))+j.height)):k},{top:b.top||0,bottom:b.bottom||0}),O=Tt(Tt({},M),C),T=O.bottom;S&&(O.bottom+=S.props.height||Gh.defaultProps.height),w&&n&&(O=Gye(O,i,r,n));var D=p-O.left-O.right,N=y-O.top-O.bottom;return Tt(Tt({brushBottom:T},O),{},{width:Math.max(D,0),height:Math.max(N,0)})},D2e=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},L2e=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,s=i===void 0?"axis":i,c=t.validateTooltipEventTypes,a=c===void 0?["axis"]:c,d=t.axisComponents,p=t.legendContent,y=t.formatAxisMap,g=t.defaultProps,b=function(O,T){var D=T.graphicalItems,N=T.stackGroups,k=T.offset,L=T.updateId,j=T.dataStartIndex,q=T.dataEndIndex,re=O.barSize,ie=O.layout,$=O.barGap,Y=O.barCategoryGap,X=O.maxBarSize,F=uN(ie),R=F.numericAxisName,Z=F.cateAxisName,W=O2e(D),ae=[];return D.forEach(function(ne,J){var ue=i0(O.data,{graphicalItems:[ne],dataStartIndex:j,dataEndIndex:q}),xe=ne.type.defaultProps!==void 0?Tt(Tt({},ne.type.defaultProps),ne.props):ne.props,se=xe.dataKey,ge=xe.maxBarSize,Se=xe["".concat(R,"Id")],Me=xe["".concat(Z,"Id")],$e={},le=d.reduce(function(ct,at){var ke,Te,Le=T["".concat(at.axisType,"Map")],ze=xe["".concat(at.axisType,"Id")];Le&&Le[ze]||at.axisType==="zAxis"||(process.env.NODE_ENV!=="production"?as(!1,"Specifying a(n) ".concat(at.axisType,"Id requires a corresponding ").concat(at.axisType,"Id on the targeted graphical component ").concat((ke=ne==null||(Te=ne.type)===null||Te===void 0?void 0:Te.displayName)!==null&&ke!==void 0?ke:"")):as());var Qe=Le[ze];return Tt(Tt({},ct),{},In(In({},at.axisType,Qe),"".concat(at.axisType,"Ticks"),mp(Qe)))},$e),te=le[Z],pe=le["".concat(Z,"Ticks")],Ae=N&&N[Se]&&N[Se].hasStack&&Qye(ne,N[Se].stackGroups),H=Ol(ne.type).indexOf("Bar")>=0,fe=Qw(te,pe),oe=[],_e=W&&zye({barSize:re,stackGroups:N,totalSize:D2e(le,Z)});if(H){var ce,Oe,Be=Xn(ge)?X:ge,Re=(ce=(Oe=Qw(te,pe,!0))!==null&&Oe!==void 0?Oe:Be)!==null&&ce!==void 0?ce:0;oe=$ye({barGap:$,barCategoryGap:Y,bandSize:Re!==fe?Re:fe,sizeList:_e[Me],maxBarSize:Be}),Re!==fe&&(oe=oe.map(function(ct){return Tt(Tt({},ct),{},{position:Tt(Tt({},ct.position),{},{offset:ct.position.offset-Re/2})})}))}var He=ne&&ne.type&&ne.type.getComposedData;He&&ae.push({props:Tt(Tt({},He(Tt(Tt({},le),{},{displayedData:ue,props:O,dataKey:se,item:ne,bandSize:fe,barPosition:oe,offset:k,stackedData:Ae,layout:ie,dataStartIndex:j,dataEndIndex:q}))),{},In(In(In({key:ne.key||"item-".concat(J)},R,le[R]),Z,le[Z]),"animationId",L)),childIndex:Xne(ne,O.children),item:ne})}),ae},S=function(O,T){var D=O.props,N=O.dataStartIndex,k=O.dataEndIndex,L=O.updateId;if(!VO({props:D}))return null;var j=D.children,q=D.layout,re=D.stackOffset,ie=D.data,$=D.reverseStackOrder,Y=uN(q),X=Y.numericAxisName,F=Y.cateAxisName,R=Ks(j,r),Z=Jye(ie,R,"".concat(X,"Id"),"".concat(F,"Id"),re,$),W=d.reduce(function(xe,se){var ge="".concat(se.axisType,"Map");return Tt(Tt({},xe),{},In({},ge,I2e(D,Tt(Tt({},se),{},{graphicalItems:R,stackGroups:se.axisType===X&&Z,dataStartIndex:N,dataEndIndex:k}))))},{}),ae=k2e(Tt(Tt({},W),{},{props:D,graphicalItems:R}),T==null?void 0:T.legendBBox);Object.keys(W).forEach(function(xe){W[xe]=y(D,W[xe],ae,xe.replace("Map",""),n)});var ne=W["".concat(F,"Map")],J=P2e(ne),ue=b(D,Tt(Tt({},W),{},{dataStartIndex:N,dataEndIndex:k,updateId:L,graphicalItems:R,stackGroups:Z,offset:ae}));return Tt(Tt({formattedGraphicalItems:ue,graphicalItems:R,offset:ae,stackGroups:Z},J),W)},w=function(M){function O(T){var D,N,k;return d2e(this,O),k=m2e(this,O,[T]),In(k,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),In(k,"accessibilityManager",new Kwe),In(k,"handleLegendBBoxUpdate",function(L){if(L){var j=k.state,q=j.dataStartIndex,re=j.dataEndIndex,ie=j.updateId;k.setState(Tt({legendBBox:L},S({props:k.props,dataStartIndex:q,dataEndIndex:re,updateId:ie},Tt(Tt({},k.state),{},{legendBBox:L}))))}}),In(k,"handleReceiveSyncEvent",function(L,j,q){if(k.props.syncId===L){if(q===k.eventEmitterSymbol&&typeof k.props.syncMethod!="function")return;k.applySyncEvent(j)}}),In(k,"handleBrushChange",function(L){var j=L.startIndex,q=L.endIndex;if(j!==k.state.dataStartIndex||q!==k.state.dataEndIndex){var re=k.state.updateId;k.setState(function(){return Tt({dataStartIndex:j,dataEndIndex:q},S({props:k.props,dataStartIndex:j,dataEndIndex:q,updateId:re},k.state))}),k.triggerSyncEvent({dataStartIndex:j,dataEndIndex:q})}}),In(k,"handleMouseEnter",function(L){var j=k.getMouseInfo(L);if(j){var q=Tt(Tt({},j),{},{isTooltipActive:!0});k.setState(q),k.triggerSyncEvent(q);var re=k.props.onMouseEnter;$n(re)&&re(q,L)}}),In(k,"triggeredAfterMouseMove",function(L){var j=k.getMouseInfo(L),q=j?Tt(Tt({},j),{},{isTooltipActive:!0}):{isTooltipActive:!1};k.setState(q),k.triggerSyncEvent(q);var re=k.props.onMouseMove;$n(re)&&re(q,L)}),In(k,"handleItemMouseEnter",function(L){k.setState(function(){return{isTooltipActive:!0,activeItem:L,activePayload:L.tooltipPayload,activeCoordinate:L.tooltipPosition||{x:L.cx,y:L.cy}}})}),In(k,"handleItemMouseLeave",function(){k.setState(function(){return{isTooltipActive:!1}})}),In(k,"handleMouseMove",function(L){L.persist(),k.throttleTriggeredAfterMouseMove(L)}),In(k,"handleMouseLeave",function(L){k.throttleTriggeredAfterMouseMove.cancel();var j={isTooltipActive:!1};k.setState(j),k.triggerSyncEvent(j);var q=k.props.onMouseLeave;$n(q)&&q(j,L)}),In(k,"handleOuterEvent",function(L){var j=Hne(L),q=_s(k.props,"".concat(j));if(j&&$n(q)){var re,ie;/.*touch.*/i.test(j)?ie=k.getMouseInfo(L.changedTouches[0]):ie=k.getMouseInfo(L),q((re=ie)!==null&&re!==void 0?re:{},L)}}),In(k,"handleClick",function(L){var j=k.getMouseInfo(L);if(j){var q=Tt(Tt({},j),{},{isTooltipActive:!0});k.setState(q),k.triggerSyncEvent(q);var re=k.props.onClick;$n(re)&&re(q,L)}}),In(k,"handleMouseDown",function(L){var j=k.props.onMouseDown;if($n(j)){var q=k.getMouseInfo(L);j(q,L)}}),In(k,"handleMouseUp",function(L){var j=k.props.onMouseUp;if($n(j)){var q=k.getMouseInfo(L);j(q,L)}}),In(k,"handleTouchMove",function(L){L.changedTouches!=null&&L.changedTouches.length>0&&k.throttleTriggeredAfterMouseMove(L.changedTouches[0])}),In(k,"handleTouchStart",function(L){L.changedTouches!=null&&L.changedTouches.length>0&&k.handleMouseDown(L.changedTouches[0])}),In(k,"handleTouchEnd",function(L){L.changedTouches!=null&&L.changedTouches.length>0&&k.handleMouseUp(L.changedTouches[0])}),In(k,"handleDoubleClick",function(L){var j=k.props.onDoubleClick;if($n(j)){var q=k.getMouseInfo(L);j(q,L)}}),In(k,"handleContextMenu",function(L){var j=k.props.onContextMenu;if($n(j)){var q=k.getMouseInfo(L);j(q,L)}}),In(k,"triggerSyncEvent",function(L){k.props.syncId!==void 0&&B2.emit(F2,k.props.syncId,L,k.eventEmitterSymbol)}),In(k,"applySyncEvent",function(L){var j=k.props,q=j.layout,re=j.syncMethod,ie=k.state.updateId,$=L.dataStartIndex,Y=L.dataEndIndex;if(L.dataStartIndex!==void 0||L.dataEndIndex!==void 0)k.setState(Tt({dataStartIndex:$,dataEndIndex:Y},S({props:k.props,dataStartIndex:$,dataEndIndex:Y,updateId:ie},k.state)));else if(L.activeTooltipIndex!==void 0){var X=L.chartX,F=L.chartY,R=L.activeTooltipIndex,Z=k.state,W=Z.offset,ae=Z.tooltipTicks;if(!W)return;if(typeof re=="function")R=re(ae,L);else if(re==="value"){R=-1;for(var ne=0;ne<ae.length;ne++)if(ae[ne].value===L.activeLabel){R=ne;break}}var J=Tt(Tt({},W),{},{x:W.left,y:W.top}),ue=Math.min(X,J.x+J.width),xe=Math.min(F,J.y+J.height),se=ae[R]&&ae[R].value,ge=V2(k.state,k.props.data,R),Se=ae[R]?{x:q==="horizontal"?ae[R].coordinate:ue,y:q==="horizontal"?xe:ae[R].coordinate}:sN;k.setState(Tt(Tt({},L),{},{activeLabel:se,activeCoordinate:Se,activePayload:ge,activeTooltipIndex:R}))}else k.setState(L)}),In(k,"renderCursor",function(L){var j,q=k.state,re=q.isTooltipActive,ie=q.activeCoordinate,$=q.activePayload,Y=q.offset,X=q.activeTooltipIndex,F=q.tooltipAxisBandSize,R=k.getTooltipEventType(),Z=(j=L.props.active)!==null&&j!==void 0?j:re,W=k.props.layout,ae=L.key||"_recharts-cursor";return U.createElement(a2e,{key:ae,activeCoordinate:ie,activePayload:$,activeTooltipIndex:X,chartName:n,element:L,isActive:Z,layout:W,offset:Y,tooltipAxisBandSize:F,tooltipEventType:R})}),In(k,"renderPolarAxis",function(L,j,q){var re=_s(L,"type.axisType"),ie=_s(k.state,"".concat(re,"Map")),$=L.type.defaultProps,Y=$!==void 0?Tt(Tt({},$),L.props):L.props,X=ie&&ie[Y["".concat(re,"Id")]];return U.cloneElement(L,Tt(Tt({},X),{},{className:Yn(re,X.className),key:L.key||"".concat(j,"-").concat(q),ticks:mp(X,!0)}))}),In(k,"renderPolarGrid",function(L){var j=L.props,q=j.radialLines,re=j.polarAngles,ie=j.polarRadius,$=k.state,Y=$.radiusAxisMap,X=$.angleAxisMap,F=hh(Y),R=hh(X),Z=R.cx,W=R.cy,ae=R.innerRadius,ne=R.outerRadius;return U.cloneElement(L,{polarAngles:Array.isArray(re)?re:mp(R,!0).map(function(J){return J.coordinate}),polarRadius:Array.isArray(ie)?ie:mp(F,!0).map(function(J){return J.coordinate}),cx:Z,cy:W,innerRadius:ae,outerRadius:ne,key:L.key||"polar-grid",radialLines:q})}),In(k,"renderLegend",function(){var L=k.state.formattedGraphicalItems,j=k.props,q=j.children,re=j.width,ie=j.height,$=k.props.margin||{},Y=re-($.left||0)-($.right||0),X=VL({children:q,formattedGraphicalItems:L,legendWidth:Y,legendContent:p});if(!X)return null;var F=X.item,R=tN(X,s2e);return U.cloneElement(F,Tt(Tt({},R),{},{chartWidth:re,chartHeight:ie,margin:$,onBBoxUpdate:k.handleLegendBBoxUpdate}))}),In(k,"renderTooltip",function(){var L,j=k.props,q=j.children,re=j.accessibilityLayer,ie=Qa(q,Qs);if(!ie)return null;var $=k.state,Y=$.isTooltipActive,X=$.activeCoordinate,F=$.activePayload,R=$.activeLabel,Z=$.offset,W=(L=ie.props.active)!==null&&L!==void 0?L:Y;return U.cloneElement(ie,{viewBox:Tt(Tt({},Z),{},{x:Z.left,y:Z.top}),active:W,label:R,payload:W?F:[],coordinate:X,accessibilityLayer:re})}),In(k,"renderBrush",function(L){var j=k.props,q=j.margin,re=j.data,ie=k.state,$=ie.offset,Y=ie.dataStartIndex,X=ie.dataEndIndex,F=ie.updateId;return U.cloneElement(L,{key:L.key||"_recharts-brush",onChange:xv(k.handleBrushChange,L.props.onChange),data:re,x:ln(L.props.x)?L.props.x:$.left,y:ln(L.props.y)?L.props.y:$.top+$.height+$.brushBottom-(q.bottom||0),width:ln(L.props.width)?L.props.width:$.width,startIndex:Y,endIndex:X,updateId:"brush-".concat(F)})}),In(k,"renderReferenceElement",function(L,j,q){if(!L)return null;var re=k,ie=re.clipPathId,$=k.state,Y=$.xAxisMap,X=$.yAxisMap,F=$.offset,R=L.type.defaultProps||{},Z=L.props,W=Z.xAxisId,ae=W===void 0?R.xAxisId:W,ne=Z.yAxisId,J=ne===void 0?R.yAxisId:ne;return U.cloneElement(L,{key:L.key||"".concat(j,"-").concat(q),xAxis:Y[ae],yAxis:X[J],viewBox:{x:F.left,y:F.top,width:F.width,height:F.height},clipPathId:ie})}),In(k,"renderActivePoints",function(L){var j=L.item,q=L.activePoint,re=L.basePoint,ie=L.childIndex,$=L.isRange,Y=[],X=j.props.key,F=j.item.type.defaultProps!==void 0?Tt(Tt({},j.item.type.defaultProps),j.item.props):j.item.props,R=F.activeDot,Z=F.dataKey,W=Tt(Tt({index:ie,dataKey:Z,cx:q.x,cy:q.y,r:4,fill:qw(j.item),strokeWidth:2,stroke:"#fff",payload:q.payload,value:q.value},Fn(R,!1)),_y(R));return Y.push(O.renderActiveDot(R,W,"".concat(X,"-activePoint-").concat(ie))),re?Y.push(O.renderActiveDot(R,Tt(Tt({},W),{},{cx:re.x,cy:re.y}),"".concat(X,"-basePoint-").concat(ie))):$&&Y.push(null),Y}),In(k,"renderGraphicChild",function(L,j,q){var re=k.filterFormatItem(L,j,q);if(!re)return null;var ie=k.getTooltipEventType(),$=k.state,Y=$.isTooltipActive,X=$.tooltipAxis,F=$.activeTooltipIndex,R=$.activeLabel,Z=k.props.children,W=Qa(Z,Qs),ae=re.props,ne=ae.points,J=ae.isRange,ue=ae.baseLine,xe=re.item.type.defaultProps!==void 0?Tt(Tt({},re.item.type.defaultProps),re.item.props):re.item.props,se=xe.activeDot,ge=xe.hide,Se=xe.activeBar,Me=xe.activeShape,$e=!!(!ge&&Y&&W&&(se||Se||Me)),le={};ie!=="axis"&&W&&W.props.trigger==="click"?le={onClick:xv(k.handleItemMouseEnter,L.props.onClick)}:ie!=="axis"&&(le={onMouseLeave:xv(k.handleItemMouseLeave,L.props.onMouseLeave),onMouseEnter:xv(k.handleItemMouseEnter,L.props.onMouseEnter)});var te=U.cloneElement(L,Tt(Tt({},re.props),le));function pe(at){return typeof X.dataKey=="function"?X.dataKey(at.payload):null}if($e)if(F>=0){var Ae,H;if(X.dataKey&&!X.allowDuplicatedCategory){var fe=typeof X.dataKey=="function"?pe:"payload.".concat(X.dataKey.toString());Ae=Q1(ne,fe,R),H=J&&ue&&Q1(ue,fe,R)}else Ae=ne==null?void 0:ne[F],H=J&&ue&&ue[F];if(Me||Se){var oe=L.props.activeIndex!==void 0?L.props.activeIndex:F;return[U.cloneElement(L,Tt(Tt(Tt({},re.props),le),{},{activeIndex:oe})),null,null]}if(!Xn(Ae))return[te].concat(Zh(k.renderActivePoints({item:re,activePoint:Ae,basePoint:H,childIndex:F,isRange:J})))}else{var _e,ce=(_e=k.getItemByXY(k.state.activeCoordinate))!==null&&_e!==void 0?_e:{graphicalItem:te},Oe=ce.graphicalItem,Be=Oe.item,Re=Be===void 0?L:Be,He=Oe.childIndex,ct=Tt(Tt(Tt({},re.props),le),{},{activeIndex:He});return[U.cloneElement(Re,ct),null,null]}return J?[te,null,null]:[te,null]}),In(k,"renderCustomized",function(L,j,q){return U.cloneElement(L,Tt(Tt({key:"recharts-customized-".concat(q)},k.props),k.state))}),In(k,"renderMap",{CartesianGrid:{handler:r0,once:!0},ReferenceArea:{handler:k.renderReferenceElement},ReferenceLine:{handler:r0},ReferenceDot:{handler:k.renderReferenceElement},XAxis:{handler:r0},YAxis:{handler:r0},Brush:{handler:k.renderBrush,once:!0},Bar:{handler:k.renderGraphicChild},Line:{handler:k.renderGraphicChild},Area:{handler:k.renderGraphicChild},Radar:{handler:k.renderGraphicChild},RadialBar:{handler:k.renderGraphicChild},Scatter:{handler:k.renderGraphicChild},Pie:{handler:k.renderGraphicChild},Funnel:{handler:k.renderGraphicChild},Tooltip:{handler:k.renderCursor,once:!0},PolarGrid:{handler:k.renderPolarGrid,once:!0},PolarAngleAxis:{handler:k.renderPolarAxis},PolarRadiusAxis:{handler:k.renderPolarAxis},Customized:{handler:k.renderCustomized}}),k.clipPathId="".concat((D=T.id)!==null&&D!==void 0?D:xy("recharts"),"-clip"),k.throttleTriggeredAfterMouseMove=ofe(k.triggeredAfterMouseMove,(N=T.throttleDelay)!==null&&N!==void 0?N:1e3/60),k.state={},k}return v2e(O,M),p2e(O,[{key:"componentDidMount",value:function(){var D,N;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(D=this.props.margin.left)!==null&&D!==void 0?D:0,top:(N=this.props.margin.top)!==null&&N!==void 0?N:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var D=this.props,N=D.children,k=D.data,L=D.height,j=D.layout,q=Qa(N,Qs);if(q){var re=q.props.defaultIndex;if(!(typeof re!="number"||re<0||re>this.state.tooltipTicks.length-1)){var ie=this.state.tooltipTicks[re]&&this.state.tooltipTicks[re].value,$=V2(this.state,k,re,ie),Y=this.state.tooltipTicks[re].coordinate,X=(this.state.offset.top+L)/2,F=j==="horizontal",R=F?{x:Y,y:X}:{y:Y,x:X},Z=this.state.formattedGraphicalItems.find(function(ae){var ne=ae.item;return ne.type.name==="Scatter"});Z&&(R=Tt(Tt({},R),Z.props.points[re].tooltipPosition),$=Z.props.points[re].tooltipPayload);var W={activeTooltipIndex:re,isTooltipActive:!0,activeLabel:ie,activePayload:$,activeCoordinate:R};this.setState(W),this.renderCursor(q),this.accessibilityManager.setIndex(re)}}}},{key:"getSnapshotBeforeUpdate",value:function(D,N){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==N.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==D.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==D.margin){var k,L;this.accessibilityManager.setDetails({offset:{left:(k=this.props.margin.left)!==null&&k!==void 0?k:0,top:(L=this.props.margin.top)!==null&&L!==void 0?L:0}})}return null}},{key:"componentDidUpdate",value:function(D){s_([Qa(D.children,Qs)],[Qa(this.props.children,Qs)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var D=Qa(this.props.children,Qs);if(D&&typeof D.props.shared=="boolean"){var N=D.props.shared?"axis":"item";return a.indexOf(N)>=0?N:s}return s}},{key:"getMouseInfo",value:function(D){if(!this.container)return null;var N=this.container,k=N.getBoundingClientRect(),L=pfe(k),j={chartX:Math.round(D.pageX-L.left),chartY:Math.round(D.pageY-L.top)},q=k.width/N.offsetWidth||1,re=this.inRange(j.chartX,j.chartY,q);if(!re)return null;var ie=this.state,$=ie.xAxisMap,Y=ie.yAxisMap,X=this.getTooltipEventType();if(X!=="axis"&&$&&Y){var F=hh($).scale,R=hh(Y).scale,Z=F&&F.invert?F.invert(j.chartX):null,W=R&&R.invert?R.invert(j.chartY):null;return Tt(Tt({},j),{},{xValue:Z,yValue:W})}var ae=lN(this.state,this.props.data,this.props.layout,re);return ae?Tt(Tt({},j),ae):null}},{key:"inRange",value:function(D,N){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,L=this.props.layout,j=D/k,q=N/k;if(L==="horizontal"||L==="vertical"){var re=this.state.offset,ie=j>=re.left&&j<=re.left+re.width&&q>=re.top&&q<=re.top+re.height;return ie?{x:j,y:q}:null}var $=this.state,Y=$.angleAxisMap,X=$.radiusAxisMap;if(Y&&X){var F=hh(Y);return i5({x:j,y:q},F)}return null}},{key:"parseEventsOfWrapper",value:function(){var D=this.props.children,N=this.getTooltipEventType(),k=Qa(D,Qs),L={};k&&N==="axis"&&(k.props.trigger==="click"?L={onClick:this.handleClick}:L={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var j=_y(this.props,this.handleOuterEvent);return Tt(Tt({},j),L)}},{key:"addListener",value:function(){B2.on(F2,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){B2.removeListener(F2,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(D,N,k){for(var L=this.state.formattedGraphicalItems,j=0,q=L.length;j<q;j++){var re=L[j];if(re.item===D||re.props.key===D.key||N===Ol(re.item.type)&&k===re.childIndex)return re}return null}},{key:"renderClipPath",value:function(){var D=this.clipPathId,N=this.state.offset,k=N.left,L=N.top,j=N.height,q=N.width;return U.createElement("defs",null,U.createElement("clipPath",{id:D},U.createElement("rect",{x:k,y:L,height:j,width:q})))}},{key:"getXScales",value:function(){var D=this.state.xAxisMap;return D?Object.entries(D).reduce(function(N,k){var L=eN(k,2),j=L[0],q=L[1];return Tt(Tt({},N),{},In({},j,q.scale))},{}):null}},{key:"getYScales",value:function(){var D=this.state.yAxisMap;return D?Object.entries(D).reduce(function(N,k){var L=eN(k,2),j=L[0],q=L[1];return Tt(Tt({},N),{},In({},j,q.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(D){var N;return(N=this.state.xAxisMap)===null||N===void 0||(N=N[D])===null||N===void 0?void 0:N.scale}},{key:"getYScaleByAxisId",value:function(D){var N;return(N=this.state.yAxisMap)===null||N===void 0||(N=N[D])===null||N===void 0?void 0:N.scale}},{key:"getItemByXY",value:function(D){var N=this.state,k=N.formattedGraphicalItems,L=N.activeItem;if(k&&k.length)for(var j=0,q=k.length;j<q;j++){var re=k[j],ie=re.props,$=re.item,Y=$.type.defaultProps!==void 0?Tt(Tt({},$.type.defaultProps),$.props):$.props,X=Ol($.type);if(X==="Bar"){var F=(ie.data||[]).find(function(ae){return Hbe(D,ae)});if(F)return{graphicalItem:re,payload:F}}else if(X==="RadialBar"){var R=(ie.data||[]).find(function(ae){return i5(D,ae)});if(R)return{graphicalItem:re,payload:R}}else if(Fv(re,L)||zv(re,L)||Np(re,L)){var Z=R1e({graphicalItem:re,activeTooltipItem:L,itemData:Y.data}),W=Y.activeIndex===void 0?Z:Y.activeIndex;return{graphicalItem:Tt(Tt({},re),{},{childIndex:W}),payload:Np(re,L)?Y.data[Z]:re.props.data[Z]}}}return null}},{key:"render",value:function(){var D=this;if(!VO(this))return null;var N=this.props,k=N.children,L=N.className,j=N.width,q=N.height,re=N.style,ie=N.compact,$=N.title,Y=N.desc,X=tN(N,o2e),F=Fn(X,!1);if(ie)return U.createElement(L4,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},U.createElement(l_,Xh({},F,{width:j,height:q,title:$,desc:Y}),this.renderClipPath(),UO(k,this.renderMap)));if(this.props.accessibilityLayer){var R,Z;F.tabIndex=(R=this.props.tabIndex)!==null&&R!==void 0?R:0,F.role=(Z=this.props.role)!==null&&Z!==void 0?Z:"application",F.onKeyDown=function(ae){D.accessibilityManager.keyboardEvent(ae)},F.onFocus=function(){D.accessibilityManager.focus()}}var W=this.parseEventsOfWrapper();return U.createElement(L4,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},U.createElement("div",Xh({className:Yn("recharts-wrapper",L),style:Tt({position:"relative",cursor:"default",width:j,height:q},re)},W,{ref:function(ne){D.container=ne}}),U.createElement(l_,Xh({},F,{width:j,height:q,title:$,desc:Y,style:C2e}),this.renderClipPath(),UO(k,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(U.Component);In(w,"displayName",n),In(w,"defaultProps",Tt({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},g)),In(w,"getDerivedStateFromProps",function(M,O){var T=M.dataKey,D=M.data,N=M.children,k=M.width,L=M.height,j=M.layout,q=M.stackOffset,re=M.margin,ie=O.dataStartIndex,$=O.dataEndIndex;if(O.updateId===void 0){var Y=cN(M);return Tt(Tt(Tt({},Y),{},{updateId:0},S(Tt(Tt({props:M},Y),{},{updateId:0}),O)),{},{prevDataKey:T,prevData:D,prevWidth:k,prevHeight:L,prevLayout:j,prevStackOffset:q,prevMargin:re,prevChildren:N})}if(T!==O.prevDataKey||D!==O.prevData||k!==O.prevWidth||L!==O.prevHeight||j!==O.prevLayout||q!==O.prevStackOffset||!e_(re,O.prevMargin)){var X=cN(M),F={chartX:O.chartX,chartY:O.chartY,isTooltipActive:O.isTooltipActive},R=Tt(Tt({},lN(O,D,j)),{},{updateId:O.updateId+1}),Z=Tt(Tt(Tt({},X),F),R);return Tt(Tt(Tt({},Z),S(Tt({props:M},Z),O)),{},{prevDataKey:T,prevData:D,prevWidth:k,prevHeight:L,prevLayout:j,prevStackOffset:q,prevMargin:re,prevChildren:N})}if(!s_(N,O.prevChildren)){var W,ae,ne,J,ue=Qa(N,Gh),xe=ue&&(W=(ae=ue.props)===null||ae===void 0?void 0:ae.startIndex)!==null&&W!==void 0?W:ie,se=ue&&(ne=(J=ue.props)===null||J===void 0?void 0:J.endIndex)!==null&&ne!==void 0?ne:$,ge=xe!==ie||se!==$,Se=!Xn(D),Me=Se&&!ge?O.updateId:O.updateId+1;return Tt(Tt({updateId:Me},S(Tt(Tt({props:M},O),{},{updateId:Me,dataStartIndex:xe,dataEndIndex:se}),O)),{},{prevChildren:N,dataStartIndex:xe,dataEndIndex:se})}return null}),In(w,"renderActiveDot",function(M,O,T){var D;return U.isValidElement(M)?D=U.cloneElement(M,O):$n(M)?D=M(O):D=U.createElement(v2,O),U.createElement(Zr,{className:"recharts-active-dot",key:T},D)});var C=U.forwardRef(function(O,T){return U.createElement(w,Xh({},O,{ref:T}))});return C.displayName=w.displayName,C},N2e=L2e({chartName:"PieChart",GraphicalChild:Uo,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Rv},{axisType:"radiusAxis",AxisComp:Dv}],formatAxisMap:uve,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const W2={OPTIMAL:"Optimal",STRESS_START:"Stress Start",SEVERE_STRESS:"Severe Stress",EXCESS_WATER:"Excess Water"};function R2e(){const{markersData:e,showMarkers:t}=U.useContext(Ns),n=tn(p=>p.viewMode),r=e.reduce((p,y)=>{const g=y.paw_status;return g&&(p[g]=(p[g]||0)+1),p},{});delete r.WEATHER_STATION;const i=Object.keys(r).map(p=>({name:W2==null?void 0:W2[p],value:r[p],color:gO(p)})),s=Math.PI/180,c=({cx:p,cy:y,midAngle:g,innerRadius:b,outerRadius:S,percent:w,index:C})=>{const M=b+(S-b)*.5,O=p+M*Math.cos(-g*s),T=y+M*Math.sin(-g*s);return K.jsx("text",{x:O,y:T,fill:"white",textAnchor:O>p?"start":"end",dominantBaseline:"central",children:`${(w*100).toFixed(0)}%`})},a=U.useMemo(()=>i==null?void 0:i.reduce((p,y)=>p+(y==null?void 0:y.value),0),[i]);console.log("sum",a);const d=({active:p,payload:y,label:g})=>{var b,S,w,C;return p&&y&&y.length?K.jsx("div",{className:"custom-tooltip",style:{boxShadow:`0 0 0 1px ${(S=(b=y[0])==null?void 0:b.payload)==null?void 0:S.color}`,backgroundColor:"rgba(0,0,0,0.59)",padding:"4px",borderRadius:"6px"},children:K.jsx("p",{className:"label text-white",children:`${(w=y[0])==null?void 0:w.name} : ${(C=y[0])==null?void 0:C.value}`})}):null};return n==="PICKER"||!t||!i.length>0?null:K.jsx("div",{className:"paw-pie-chart ",children:K.jsxs(N2e,{width:115,height:115,children:[K.jsx(Uo,{labelLine:!1,label:c,data:i,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:50,fill:"#8884d8",children:i.map((p,y)=>K.jsx(J_,{fill:p.color},`cell-${y}`))}),K.jsx(Qs,{content:K.jsx(d,{})})]})})}function j2e(e){if(e&&!(!e.length>0))return e.map(t=>({x:new Date(t.interval.from).getTime(),y:t.outputs.data.bands.B0.stats.mean}))}const U2=({plot:e,point:t})=>{const[n,r]=U.useState([]),[i,s]=U.useState(!0),c=U.useContext(dy),a={chart:{type:"line",margin:[0,0,0,0],height:120},title:{text:""},xAxis:{type:"datetime",title:{text:null}},yAxis:{min:-1,max:1,title:{text:null},gridLineWidth:0,lineWidth:0,plotBands:[{from:-1,to:0,color:"rgba(0, 0, 255, 0.3)"},{from:0,to:.1,color:"rgba(165, 42, 42, 0.3)"},{from:.2,to:.5,color:"rgba(144, 238, 144, 0.3)"},{from:.6,to:.9,color:"rgba(0, 128, 0, 0.3)"},{from:.9,to:1,color:"rgba(34, 139, 34, 0.3)"}],labels:{enabled:!1}},series:[{name:"NDVI",data:j2e(n),tooltip:{valueDecimals:2,pointFormatter:function(){return`<b>${this.series.name}</b>: ${this.y.toFixed(2)}<br/>`}},color:"#333",lineWidth:1,marker:{enabled:!1}}],credits:{enabled:!1},legend:{enabled:!1}};return U.useEffect(()=>{(async()=>{try{let p;e&&(p=await wY(e,{accessToken:c})),t&&(console.log("sending request for point",t),p=await SY(t,{accessToken:c})),p&&r(p)}catch(p){console.log("Error fetching NDVI data",p)}finally{s(!1)}})()},[]),i?K.jsx(Ya,{}):K.jsx(mO,{highcharts:fO,options:a})};function B2e({popupInfo:e,onClose:t}){var M;const{showPlots:n,plots:r,clickedPlot:i,handleDeletePlot:s}=U.useContext(Po),{isConfirmed:c}=af(),{plot:a}=e;console.log("clickedPlot",i),console.log("clickedPlot popupInfo",e);const[d,p]=U.useState(!1),[y,g]=U.useState(0),[b,S]=U.useState(!1),w=U.useMemo(()=>r==null?void 0:r.find(O=>{var T,D;return((T=O==null?void 0:O.options)==null?void 0:T.id)===((D=a==null?void 0:a.properties)==null?void 0:D.id)}),[(M=a==null?void 0:a.properties)==null?void 0:M.id,r]),C=U.useCallback(async()=>{await c("Do you want to delete this plot?")&&(p(!0),s(w).finally(()=>{p(!1)}))},[w,c]);return U.useEffect(()=>{S(!0),w?z7({stationId:w==null?void 0:w.device,plotId:w==null?void 0:w.id}).then(O=>{console.log("et-tasks",O),g(O)}).finally(()=>{S(!1)}):S(!1)},[w]),!n||!i?null:K.jsx(pM,{longitude:e.lngLat.lng,latitude:e.lngLat.lat,closeButton:!1,closeOnClick:!0,onClose:t,anchor:"top",style:{width:240},className:"plot-popup overflow-y-hidden",children:K.jsxs("div",{className:"flex flex-col gap-1 items-center dark:text-gray-100 font-black text-[14px]",children:[K.jsxs("div",{className:"w-full flex justify-between items-center dark:text-gray-100 font-black text-[14px]",children:[K.jsx("h3",{className:"text-wrap",children:w.name}),K.jsxs("span",{className:"flex items-center gap-1",children:[K.jsx(Gn,{variant:"outline",size:"icon",onClick:C,"data-marker-id":w==null?void 0:w.id,children:d?K.jsx(Ya,{size:"small"}):K.jsx(Ng,{className:"w-5 h-5 action-icon text-red-500"})}),K.jsx(oP,{plot:w}),K.jsx(gs,{text:"close popup",children:K.jsx(Gn,{variant:"outline",size:"icon",onClick:t,children:K.jsx(ml,{className:"w-5 h-5 action-icon "})})})]})]}),K.jsx("hr",{}),K.jsx("div",{className:"w-[calc(100%+4px)]",children:K.jsx(U2,{plot:a})}),K.jsxs("div",{className:"w-full flex flex-col items-center gap-1",children:[K.jsxs("div",{className:"flex items-center justify-between w-full gap-2 rounded-md bg-zinc-100 dark:bg-zinc-800 p-2",children:[K.jsx("h4",{className:"scroll-m-20 text-xs font-medium tracking-tight",children:"Area (sqm)"}),K.jsx("div",{className:"flex items-center space-x-2",children:K.jsx("span",{className:"text-xs text-gray-700 dark:text-gray-200",children:U7(a).toFixed(2)})})]}),K.jsxs("div",{className:"flex items-center justify-between w-full gap-2 rounded-md bg-zinc-100 dark:bg-zinc-800 p-2",children:[K.jsx("h4",{className:"scroll-m-20 text-xs font-medium tracking-tight",children:"SAT-ET"}),K.jsx("div",{className:"flex items-center space-x-2",children:K.jsx("span",{className:"text-xs text-gray-700 dark:text-gray-200",children:w!=null&&w.enable_satellite_et?"enabled":"disabled"})})]}),(w==null?void 0:w.device)&&K.jsxs("div",{className:"flex items-center justify-between w-full gap-2 rounded-md bg-zinc-100 dark:bg-zinc-800 p-2",children:[K.jsx("h4",{className:"scroll-m-20 text-xs font-medium tracking-tight",children:"running tasks count"}),K.jsx("div",{className:"flex items-center space-x-2",children:K.jsxs("span",{className:"text-xs text-gray-700 dark:text-gray-200",children:[b&&K.jsx(Ya,{size:"small"}),!b&&y]})})]})]})]})})}const F2e=`
938
938
  //VERSION=3
939
939
  function setup() {
940
940
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agvmap-react",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "type": "module",
5
5
  "main": "dist/agvmap-react.umd.cjs",
6
6
  "module": "dist/agvmap-react.js",