PageSourceSearch

https://farmer.tarla.io/_next/static/chunks/9007.11c5db1665a8287c.js

js tarla.io collected 2026-10-04 08:38:31 UTC 29,662 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9007],{56890:function(e,t,l){"use strict";var n,r=l(91569);function o(){return(o=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)({}).hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e}).apply(null,arguments)}t.Z=function(e){return r.createElement("svg",o({xmlns:"http://www.w3.org/2000/svg",width:19,height:13},e),n||(n=r.createElement("path",{d:"M4.59 12.62c-1.1 0-2.03-.38-2.8-1.14S.64 9.79.64 8.69C.64 7.68.98 6.78 1.67 6s1.54-1.2 2.57-1.26c.19-1.27.78-2.33 1.76-3.16S8.12.33 9.43.33c1.46 0 2.71.51 3.73 1.54C14.19 2.9 14.7 4.14 14.7 5.6v.88h.55c.83.03 1.54.34 2.11.93s.86 1.31.86 2.14-.3 1.59-.89 2.19c-.59.59-1.32.89-2.19.89H4.6z"})))}},75190:function(e,t,l){e.exports=l(15205)},15205:function(e,t,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var l in t)Object.defineProperty(e,l,{enumerable:!0,get:t[l]})}(t,{default:function(){return i},noSSR:function(){return a}});let n=l(45503);l(90626),l(91569);let r=n._(l(87905));function o(e){return{default:(null==e?void 0:e.default)||e}}function a(e,t){return delete t.webpack,delete t.modules,e(t)}function i(e,t){let l=r.default,n={loading:e=>{let{error:t,isLoading:l,pastDelay:n}=e;return null}};e instanceof Promise?n.loader=()=>e:"function"==typeof e?n.loader=e:"object"==typeof e&&(n={...n,...e});let i=(n={...n,...t}).loader;return(n.loadableGenerated&&(n={...n,...n.loadableGenerated},delete n.loadableGenerated),"boolean"!=typeof n.ssr||n.ssr)?l({...n,loader:()=>null!=i?i().then(o):Promise.resolve(o(()=>null))}):(delete n.webpack,delete n.modules,a(l,n))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4295:function(e,t,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return n}});let n=l(45503)._(l(91569)).default.createContext(null)},87905:function(e,t,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return f}});let n=l(45503)._(l(91569)),r=l(4295),o=[],a=[],i=!1;function d(e){let t=e(),l={loading:!0,loaded:null,error:null};return l.promise=t.then(e=>(l.loading=!1,l.loaded=e,e)).catch(e=>{throw l.loading=!1,l.error=e,e}),l}class u{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}}function s(e){return function(e,t){let l=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),o=null;function d(){if(!o){let t=new u(e,l);o={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return o.promise()}if(!i){let e=l.webpack?l.webpack():l.modules;e&&a.push(t=>{for(let l of e)if(t.includes(l))return d()})}function s(e,t){!function(){d();let e=n.default.useContext(r.LoadableContext);e&&Array.isArray(l.modules)&&l.modules.forEach(t=>{e(t)})}();let a=n.default.useSyncExternalStore(o.subscribe,o.getCurrentValue,o.getCurrentValue);return n.default.useImperativeHandle(t,()=>({retry:o.retry}),[]),n.default.useMemo(()=>{var t;return a.loading||a.error?n.default.createElement(l.loading,{isLoading:a.loading,pastDelay:a.pastDelay,timedOut:a.timedOut,error:a.error,retry:o.retry}):a.loaded?n.default.createElement((t=a.loaded)&&t.default?t.default:t,e):null},[e,a])}return s.preload=()=>d(),s.displayName="LoadableComponent",n.default.forwardRef(s)}(d,e)}function c(e,t){let l=[];for(;e.length;){let n=e.pop();l.push(n(t))}return Promise.all(l).then(()=>
1{if(e.length)return c(e,t)})}s.preloadAll=()=>new Promise((e,t)=>{c(o).then(e,t)}),s.preloadReady=e=>(void 0===e&&(e=[]),new Promise(t=>{let l=()=>(i=!0,t());c(a,e).then(l,l)})),window.__NEXT_PRELOADREADY=s.preloadReady;let f=s},9007:function(e,t,l){"use strict";l.r(t),l.d(t,{default:function(){return L}});var n,r=l(90626),o=l(91569),a=l(29218),i=l(29926),d=l(53084),u=l(89559),s=l(75190),c=l.n(s),f=l(81159),v=l.n(f);function p(){return(p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)({}).hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e}).apply(null,arguments)}l(68852),l(56890);var y=function(e){return o.createElement("svg",p({xmlns:"http://www.w3.org/2000/svg",width:800,height:800,fill:"none",stroke:"#fff",strokeWidth:3,viewBox:"0 0 64 64"},e),n||(n=o.createElement("path",{d:"M7.49 26V7.5h18.5M56.51 26V7.5h-18.5M7.53 38v18.5h18.49M56.51 38v18.5h-18.5"})))},g=l(94563),h=l(85021),m=l(2754);let b=e=>e<5?18:e<10?17:e<20?16.35:e<25?15.65:e<100?15.2:e<200?14.5:e<300?14.9:14.2,x=e=>{let t=0,l=0,n=0;for(let r=0;r<e[0].length;r++)t+=e[0][r][0],l+=e[0][r][1],n++;return[t/n,l/n]},w=(e,t)=>{let l=x(e);return e.map(e=>e.map(e=>[l[0]+(e[0]-l[0])*t,l[1]+(e[1]-l[1])*t]))};var S=l(64237),k=l(97743);c()(()=>Promise.resolve().then(l.bind(l,79819)),{loadableGenerated:{webpack:()=>[79819]},ssr:!1});let _=c()(()=>l.e(7643).then(l.bind(l,7643)),{loadableGenerated:{webpack:()=>[7643]},ssr:!1}),E=c()(()=>l.e(3245).then(l.bind(l,3245)),{loadableGenerated:{webpack:()=>[3245]},ssr:!1}),I=c()(()=>l.e(5941).then(l.bind(l,45941)),{loadableGenerated:{webpack:()=>[45941]},ssr:!1}),M=c()(()=>l.e(9583).then(l.bind(l,79583)),{loadableGenerated:{webpack:()=>[79583]},ssr:!1}),C=c()(()=>l.e(8123).then(l.bind(l,88123)),{loadableGenerated:{webpack:()=>[88123]},ssr:!1});var L=e=>{var t,n,s,c,f,p,x,L,A;let{setSeasonSelectOptions:N,seasonSelectOptions:D,selectedSeason:V,setSelectedSeason:j}=e,F=(0,o.useRef)(!1),[P,T]=(0,o.useState)(!1),[R,O]=(0,o.useState)(!1),[z,G]=(0,o.useState)(!1),[W,B]=(0,o.useState)(null),[H,X]=(0,o.useState)(null);(0,o.useEffect)(()=>{F.current=!0;let e="pk.eyJ1IjoidGFybGEiLCJhIjoiY21qYnZkM2RlMDR0ejNlcjAxMmQ4cmo4dCJ9.zL9ecNKllr8xm2eS_optfQ";if(!e){console.error("NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN is not set. Please add it to your environment variables.");return}return Promise.resolve().then(l.t.bind(l,45471,23)).then(t=>{B(t.default),t.default.accessToken=e,T(!0)}),Promise.all([l.e(3715),l.e(3086),l.e(6826)]).then(l.bind(l,96826)).then(e=>{F.current&&(X(e),O(!0))}),()=>{F.current=!1}},[]);let{t:$,lang:q}=(0,u.Z)("admin/common"),K=(0,o.useRef)(null),U=(0,o.useRef)(null),J=(0,o.useRef)(null),Y=(0,o.useRef)(!1),[Z,Q]=(0,o.useState)(!1),[ee,et]=(0,o.useState)([]),[el,en]=(0,o.useState)(null),[er,eo]=(0,o.useState)(null),[ea,ei]=(0,o.useState)({}),[ed,eu]=(0,o.useState)([]),[es,ec]=(0,o.useState)("ndvi"),[ef,ev]=(0,o.useState)(null),[ep,ey]=(0,o.useState)([]),[eg,eh]=(0,o.useState)(null),[em,eb]=(0,o.useState)([]),[ex,ew]=(0,o.useState)(0),[eS,ek]=(0,o.useState)(!1),[e_,eE]=(0,o.useState)([]),{id:eI}=(0,d.useRouter)().query,{data:eM,error:eC,refetch:eL}=(0,S.aF)(),eA=null==eM?void 0:null===(t=eM.package)||void 0===t?void 0:t.features,{data:eN,loading:eD,error:eV,refetch:ej}=(0,a.aM)(g.QE,{variables:{limit:100,skip:0}}),{loading:eF,error:eP,data:eT}=(0,a.aM)(g.a2,{variables:{fieldId:eI}}),{loading:eR,error:eO,data:ez,refetch:eG}=(0,a.aM)(g.Li,{variables:{fieldId:eI,type:es,seasonId:(null==V?void 0:V.id)||(null==D?void 0:null===(n=D[0])||void 0===n?void 0:n.value)}}),{loading:eW,error:eB,data:eH}=(0,a.aM)(g.c3),[eX]=(0,i.t)(h.p,{fetchPolicy:"network-only",onError:e=>{console.error("Error loading annotations:",e)}}),e$=(0,o.useCallback)(e=>{var t,l,n,r,o,a,i,d;if(!R||!H||!U.current||!z||!(null===(t=(l=U.current).isStyleLoaded)||void 0===t?void 0:t.call(l))){console.log("Map or Turf is not loaded yet");return}let u={type:"Feature",geometry:{type:"Polygon",coordinates:[null==eT?void 0:null===(a=eT.field)||void 0===a?void 0:null===(o=a.location)||void 0===o?void 0:null===(r=o.polygon)||void 0===r?void 0:null===(n=r.coordinates)||void 0===n?void 0:n[0]]}},s="satellite-image-source",c="satellite-image-layer";try{(null===(i=U.current)||void 0===i?void 0:i.getLayer)&&U.current.getLayer(c)&&U.current.removeLayer(c),(null===(d=U.current)||void 0===d?void 0:d.getSource)&&U.current.getSource(s)&&U.current.removeSource(s)}catch(e){}let f=H.bbox(u),v=new W.LngLatBounds([f[0],f[1],f[2],f[3]]);try{U.current.addSource(s,{type:"image",url:e,coordinates:[v.getNorthWest().toArray(),v.getNorthEast().toArray(),v.getSouthEast().toArray(),v.getSouthWest
1().toArray()]}),U.current.addLayer({id:c,type:"raster",source:s,paint:{"raster-opacity":.85}})}catch(e){console.error("Error adding satellite image:",e)}},[R,H,z,null==eT?void 0:null===(f=eT.field)||void 0===f?void 0:null===(c=f.location)||void 0===c?void 0:null===(s=c.polygon)||void 0===s?void 0:s.coordinates,W]);(0,o.useEffect)(()=>{var e;(null==eT?void 0:null===(e=eT.field)||void 0===e?void 0:e.seasons)&&N(eT.field.seasons.map(e=>{let t=e.name.split("-"),l=$(t.length>3?t[3].trim():"");return{label:"".concat(t.slice(0,3).join("-")," - ").concat(l),value:e.id,data:e}}))},[null==eT?void 0:null===(p=eT.field)||void 0===p?void 0:p.seasons,$,N]),(0,o.useEffect)(()=>{!eD&&(null==eN?void 0:eN.fields)&&eb(eN.fields.filter(e=>(null==e?void 0:e.id)!==eI).map(e=>{var t,l,n,r,o,a,i;return{label:null==e?void 0:e.name,value:null==e?void 0:e.id,poligon:null==e?void 0:null===(l=e.location)||void 0===l?void 0:null===(t=l.polygon)||void 0===t?void 0:t.coordinates,size:null==e?void 0:null===(n=e.location)||void 0===n?void 0:n.size,address:"".concat(null==e?void 0:null===(o=e.location)||void 0===o?void 0:null===(r=o.address)||void 0===r?void 0:r.city," ").concat(null==e?void 0:null===(a=e.location)||void 0===a?void 0:a.address.state),plant:null==e?void 0:null===(i=e.plant)||void 0===i?void 0:i.name}}))},[eD,null==eN?void 0:eN.fields,eI]),(0,o.useEffect)(()=>{if(eH&&eH.satelliteTypes){let{satelliteTypes:e}=eH,t=e.filter(e=>m.pb.includes(e)).map(e=>({label:"".concat(e.toUpperCase()," - (").concat($(m.bT[e]),")"),value:e,tooltipText:(0,m.rX)(e,$)})),l=m.pb.filter(e=>!(null==eA?void 0:eA.satellite.includes(e)));eu(t),ey(l)}},[eH,null==eA?void 0:eA.satellite,$,q]),(0,o.useEffect)(()=>{eX({variables:{input:{status:1}}}).then(e=>{var t;(null==e?void 0:null===(t=e.data)||void 0===t?void 0:t.getMapAnnotations)&&eE(e.data.getMapAnnotations)}).catch(e=>{console.error("Annotation query error:",e)})},[eX]),(0,o.useEffect)(()=>{if(el&&ez){var e,t,l;let n=null==ez?void 0:null===(e=ez.satelliteForField)||void 0===e?void 0:e.satellite.find(e=>e.date===el);ev(null==n?void 0:null===(l=n.dataset)||void 0===l?void 0:null===(t=l[es])||void 0===t?void 0:t.stats)}},[ez,el,es]);let eq=(0,o.useRef)(null),eK=(0,o.useCallback)(async()=>{var e,t,l,n,r,o,a,i;if((null==ez?void 0:null===(l=ez.satelliteForField)||void 0===l?void 0:null===(t=l.satellite)||void 0===t?void 0:null===(e=t.find(e=>e.date===el))||void 0===e?void 0:e.dataset)===null){ei(e=>({...e,[el]:!0}));try{let{data:e}=await eG({fieldId:eI,type:es,date:el,seasonId:(null==V?void 0:V.id)||(null==D?void 0:null===(n=D[0])||void 0===n?void 0:n.value)}),t=null==e?void 0:null===(i=e.satelliteForField)||void 0===i?void 0:null===(a=i.satellite)||void 0===a?void 0:null===(o=a.find(e=>e.date===el))||void 0===o?void 0:null===(r=o.dataset)||void 0===r?void 0:r[es];t&&(eo(t.url),e$(t.url))}catch(e){console.error("Error fetching satellite data:",e)}finally{ei(e=>({...e,[el]:!1}))}}},[ez,el,eI,es,null==V?void 0:V.id,D,eG,e$]);(0,o.useEffect)(()=>{el&&eK()},[eK,el]),(0,o.useEffect)(()=>{if(eO){let e=setTimeout(async()=>{try{var e;await eG({fieldId:eI,type:es,date:el,seasonId:(null==V?void 0:V.id)||(null==D?void 0:null===(e=D[0])||void 0===e?void 0:e.value)})}catch(e){console.error("Error refetching satellite data:",e)}},1e4);return()=>clearTimeout(e)}},[eO,eG,eI,es,el,V,D]),(0,o.useEffect)(()=>{var e;if(null==ez?void 0:null===(e=ez.satelliteForField)||void 0===e?void 0:e.satellite){let e=ez.satelliteForField.satellite.slice().reverse().map(e=>{var t,l;return{date:e.date,cloudCoverage:e.cloud_coverage,imageUrl:null==e?void 0:null===(l=e.dataset)||void 0===l?void 0:null===(t=l[es])||void 0===t?void 0:t.url}}).filter((e,t,l)=>t===l.findIndex(t=>t.date===e.date));et(e);let t=null==V?void 0:V.id;if(eq.current!==t||!el){let t=e.filter(e=>e.cloudCoverage<=30),l=t[t.length-1];l?(en(l.date),eo(l.imageUrl)):(en(null),eo(null))}eq.current=t}},[ez,es,el,V,en,et,eo]),(0,o.useEffect)(()=>{if(P&&eT&&W){var e,t,l,n,r,o;Q(!1),G(!1),U.current=new W.Map({container:K.current,style:(0,k.J)(),center:[null==eT?void 0:null===(t=eT.field)||void 0===t?void 0:null===(e=t.location)||void 0===e?void 0:e.long,null==eT?void 0:null===(n=eT.field)||void 0===n?void 0:null===(l=n.location)||void 0===l?void 0:l.lat],zoom:b(null==eT?void 0:null===(o=eT.field)||void 0===o?void 0:null===(r=o.location)||void 0===r?void 0:r.size)}),U.current.on("style.load",()=>{G(!0)}),U.current.on("load",()=>{Q(!0)}),U.current.addControl(new W.FullscreenControl,"top-right"),U.current.addControl(new W.NavigationControl,"top-right");let a=new(v())({accessToken:W.accessToken,mapboxgl:W,types:"place,neighborhood,postcode,locality,address",placeholder:$("Search for location or enter coordinates")});return U.current.addControl(a),()=>{U.current&&U.current.remove()}}},[P,eT,W,$]),(0,o.useEffect)(()=>{(async()=>{ei(!0);try{if(eI&&(null==V?void 0:V.id)){var e,t,l,n,r,o;await eG({fieldId:eI,type:es,date:el,seasonId:(null==V?void 0:V.id)||(null==D?void 0:null===(e=D[0])||void 0===e?void 0:e.value)});let a=null==ez?void 0:null===(o=ez.satelliteForField)||void 0===o?void 0:null===(r=o.satellite)||void 0===r?void 0:null===(n=r.find(e=>e.date===el))||void 0===n?void 0:null===(l=n.dataset)||void 0===l?void 0:null===(t=l[es])||void 0===t?void 0:t.url;el&&a&&e$(a)}}catch(e){console.error("Error fetching satellite data:",e)}finally{ei(!1)}})()},[eI,null==V?void 0:V.id,el,eG,e$,D,es,ez]),(0,o.useEffect)(()=>
1{if(Z&&z&&er&&R){var e,t,l,n,r,o,a,i,d,u;let s={type:"Feature",geometry:{type:"Polygon",coordinates:[null==eT?void 0:null===(n=eT.field)||void 0===n?void 0:null===(l=n.location)||void 0===l?void 0:null===(t=l.polygon)||void 0===t?void 0:null===(e=t.coordinates)||void 0===e?void 0:e[0]]}},c="polygon-layer",f="polygon-layer";(null==U?void 0:null===(r=U.current)||void 0===r?void 0:r.getSource(c))&&(U.current.removeLayer(f),U.current.removeSource(c)),(null===(o=U.current)||void 0===o?void 0:o.style)&&z&&(null===(a=(i=U.current).isStyleLoaded)||void 0===a?void 0:a.call(i))&&(null==U||null===(d=U.current)||void 0===d||d.addSource(c,{type:"geojson",data:s}),null==U||null===(u=U.current)||void 0===u||u.addLayer({id:f,type:"line",layout:{},source:c,paint:{"line-width":4,"line-color":"#ffda09"}}),e$(er))}},[er,Z,z,R,null==eT?void 0:null===(A=eT.field)||void 0===A?void 0:null===(L=A.location)||void 0===L?void 0:null===(x=L.polygon)||void 0===x?void 0:x.coordinates,e$]),(0,o.useEffect)(()=>{if(!U.current||!z)return;let e=U.current,t="mikro-annotations-source",l="mikro-annotations-layer",n="mikro-annotations-line-layer",r="mikro-annotations-point-layer",o=e_.map(e=>({type:"Feature",id:e._id,properties:{id:e._id,label:e.label,color:e.color,type:e.type},geometry:e.geometry})),a=()=>{e.isStyleLoaded()&&(e.getSource(t)?e.getSource(t).setData({type:"FeatureCollection",features:o}):e.addSource(t,{type:"geojson",data:{type:"FeatureCollection",features:o}}),e.getLayer(l)||e.addLayer({id:l,type:"fill",source:t,filter:["==","$type","Polygon"],paint:{"fill-color":["get","color"],"fill-opacity":.3}}),e.getLayer(n)||e.addLayer({id:n,type:"line",source:t,filter:["==","$type","LineString"],paint:{"line-color":["get","color"],"line-width":3}}),e.getLayer("mikro-annotations-arrow-layer")||e.addLayer({id:"mikro-annotations-arrow-layer",type:"symbol",source:t,filter:["all",["==","$type","LineString"],["==","type","arrow"]],layout:{"symbol-placement":"line","symbol-spacing":1,"text-field":"▶","text-size":16,"text-keep-upright":!1,"text-rotation-alignment":"map","text-pitch-alignment":"viewport"},paint:{"text-color":["get","color"],"text-halo-color":"#ffffff","text-halo-width":1}}),e.getLayer(r)||e.addLayer({id:r,type:"circle",source:t,filter:["==","$type","Point"],paint:{"circle-color":["get","color"],"circle-radius":8,"circle-stroke-color":"#ffffff","circle-stroke-width":2}}),e.getLayer("mikro-annotations-polygon-label")||e.addLayer({id:"mikro-annotations-polygon-label",type:"symbol",source:t,filter:["==","$type","Polygon"],layout:{"text-field":["get","label"],"text-size":12,"text-offset":[0,0],"text-anchor":"center"},paint:{"text-color":"#000000","text-halo-color":"#ffffff","text-halo-width":2}}),e.getLayer("mikro-annotations-line-label")||e.addLayer({id:"mikro-annotations-line-label",type:"symbol",source:t,filter:["==","$type","LineString"],layout:{"text-field":["get","label"],"text-size":12,"symbol-placement":"line-center","text-anchor":"center"},paint:{"text-color":"#000000","text-halo-color":"#ffffff","text-halo-width":2}}),e.getLayer("mikro-annotations-point-label")||e.addLayer({id:"mikro-annotations-point-label",type:"symbol",source:t,filter:["==","$type","Point"],layout:{"text-field":["get","label"],"text-size":12,"text-offset":[0,1.5],"text-anchor":"top"},paint:{"text-color":"#000000","text-halo-color":"#ffffff","text-halo-width":2}}),e.triggerRepaint())};e.isStyleLoaded()?(console.log("Map is ready, adding layers"),setTimeout(()=>{a()},100)):(console.log("Waiting for map to be ready..."),e.once("idle",()=>{e.isStyleLoaded()&&(console.log("Map is now ready, adding layers"),setTimeout(()=>{a()},100))}))},[e_]),(0,o.useEffect)(()=>{U.current&&Z&&z&&(U.current.on("zoom",()=>{ew(U.current.getZoom())}),null==em||em.forEach((e,t)=>{var l;let n={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Polygon",coordinates:w([null==e?void 0:null===(l=e.poligon)||void 0===l?void 0:l[0]],0===ex?1:ex<6?30:ex>=6&&ex<10?15:ex>=10&&ex<12?3:1)}}]},r="polygon-".concat(t),o="polygon-".concat(t),a="outline-".concat(t);U.current.getSource(r)?U.current.getSource(r).setData(n):(U.current.addSource(r,{type:"geojson",data:n}
1),U.current.addLayer({id:o,type:"fill",source:r,layout:{},paint:{"fill-color":"rgba(0, 128, 0, 0.8)"}}),U.current.addLayer({id:a,type:"line",source:r,layout:{},paint:{"line-color":"#000","line-width":2}})),U.current.on("click",o,t=>{let l=U.current.queryRenderedFeatures(t.point,{layers:[o]});l.length>0&&eh({id:null==e?void 0:e.value,name:null==e?void 0:e.label,size:null==e?void 0:e.size,address:null==e?void 0:e.address,plant:null==e?void 0:e.plant,coordinates:l[0].geometry.coordinates,x:t.point.x,y:t.point.y})})}))},[Z,z,em,ex]);let eU=async(e,t)=>{if(en(e),ei(t=>({...t,[e]:!0})),t)eo(t);else{var l,n,r,o,a;let{data:t}=await eG({fieldId:eI,type:es,date:e,seasonId:(null==V?void 0:V.id)||(null==D?void 0:null===(l=D[0])||void 0===l?void 0:l.value)}),i=null==t?void 0:null===(a=t.satelliteForField)||void 0===a?void 0:null===(o=a.satellite)||void 0===o?void 0:null===(r=o.find(t=>t.date===e))||void 0===r?void 0:null===(n=r.dataset)||void 0===n?void 0:n[es];i&&(eo(i.url),e$(i.url))}ei(t=>({...t,[e]:!1}))};return(0,o.useLayoutEffect)(()=>{if((null==ee?void 0:ee.length)>0&&J.current&&!Y.current){let e=setTimeout(()=>{J.current.scrollLeft=J.current.scrollWidth,Y.current=!0},3e3);return()=>clearTimeout(e)}},[ee]),(0,o.useEffect)(()=>{let e=()=>{ek(!!document.fullscreenElement),U.current&&setTimeout(()=>{U.current.resize()},100)};return document.addEventListener("fullscreenchange",e),()=>{document.removeEventListener("fullscreenchange",e)}},[]),(0,r.jsxs)("div",{ref:K,className:"map-container rounded-xl  relative mikro-map",children:[(0,r.jsxs)("div",{className:"absolute top-0 left-0 right-0 w-full p-6 flex justify-between z-10",children:[(0,r.jsxs)("div",{className:"flex gap-6",children:[(0,r.jsx)(M,{satelliteTypes:ed,setSelectedSatelliteTypes:ec,userPackage:eA}),(0,r.jsx)(E,{selectedSetelliteLegend:ef,selectedSatelliteTypes:es})]}),(0,r.jsx)(C,{seasonSelectOptions:D,fieldDetailData:eT,setSelectedSeason:j,selectedSeason:V,refetchFieldSatellite:eG})]}),(0,r.jsx)("button",{type:"button",onClick:()=>{K.current&&(document.fullscreenElement?document.exitFullscreen().then(()=>{ek(!1),U.current&&U.current.resize()}).catch(e=>{console.error("Error attempting to exit fullscreen:",e)}):K.current.requestFullscreen().then(()=>{ek(!0),U.current&&U.current.resize()}).catch(e=>{console.error("Error attempting to enable fullscreen:",e)}))},className:"bg-primary/60 rounded px-3 py-2 shadow transition-all hover:bg-primary/80 backdrop-blur-sm flex items-center justify-center border border-primary z-10  min-w-[40px] min-h-[40px] absolute right-[3%] ".concat(eS?"bottom-[10%] bg-primary":"bottom-[17%]"),title:eS?$("Exit Fullscreen"):$("Fullscreen"),children:(0,r.jsx)(y,{className:"w-5 h-5 text-gray-700"})}),(0,r.jsx)(I,{satelliteDates:ee,selectedDate:el,handleDateClick:eU,dateContainerRef:J,scrollRight:()=>{J.current&&J.current.scrollBy({left:-500,behavior:"smooth"})},scrollLeft:()=>{J.current&&J.current.scrollBy({left:500,behavior:"smooth"})},loadingDates:ea,lang:q}),eg&&(0,r.jsx)(_,{onClose:()=>{eh(null)},data:eg})]})}},85021:function(e,t,l){"use strict";l.d(t,{p:function(){return i}});var n=l(90947),r=l(80163);function o(){let e=(0,n._)(["\n  query GetMapAnnotations($input: GetMapAnnotationsInput!) {\n    getMapAnnotations(input: $input) {\n      _id\n      fieldId\n      userId\n      type\n      label\n      color\n      geometry {\n        type\n        coordinates\n      }\n      status\n      createdAt\n      updatedAt\n    }\n  }\n"]);return o=function(){return e},e}function a(){let e=(0,n._)(["\n  query GetMapAnnotation($id: ID!) {\n    getMapAnnotation(id: $id) {\n      _id\n      fieldId\n      userId\n      type\n      label\n      color\n      geometry {\n        type\n        coordinates\n      }\n      status\n      createdAt\n      updatedAt\n    }\n  }\n"]);return a=function(){return e},e}let i=(0,r.Ps)(o());(0,r.Ps)(a())},2754:function(e,t,l){"use strict";l.d(t,{De:function(){return f},GC:function(){return h},We:function(){return m},X4:function(){return S},aS:function(){return L},bT:function(){return r},g8:function(){return u},hd:function(){return I},iC:function(){return x},pb:function(){return a},rX:function(){return o},rx:function(){return g},ug:function(){return M},wn:function(){return y},xl:function(){return k}});var n=l(30178);let r={ndvi:"Vegetation Health",savi:"Vegetation Health - Early Stage",ndre:"Vegetation Health - Late Stage",reci:"Chlorophyll Index",ndmi:"Moisture Index",dem:"Elevation Map",ndti:"Tillage Detection Index",ndwi:"Water Index (Water Presence)",mndwi:"Modified Water Index",crc:"Crop Residue Index",nbr:"Burned Area Index"},o=(e,t)=>({ndvi:t("NDVI - Vegetation Health - Mid Stage / Growth Stage"),savi:t("SAVI - Vegetation Health - Early Stage / From Sowing to Growth"),ndre:t
1("NDRE - Vegetation Health - Late Stage / From Growth to Maturation-Harvest"),reci:t("ReCL / Red-edge Chlorophyll Index / Chlorophyll Index (Nitrogen Deficiency Detection)"),ndmi:t("NDMI / Moisture Index - Highlights differences in the water content of leaves"),dem:t("Elevation map / Elevation map - A digital model that visualizes the elevation differences in your field"),ndti:t("Soil Tillage Index / Normalized Difference Tillage Index - NDTI (An index used to determine tillage activities)"),ndwi:t("NDWI / Water Index (Water Presence) - Highlights differences in water bodies"),mndwi:t("MNDWI / Modified Normalized Difference Water Index - Enhances open water features and suppresses built-up noise"),crc:t("Crop Residue Cover Index / CRC (An index that evaluates the proportion of crop residues covering the soil surface after harvest)"),nbr:t("NBR - Burned Area / Post-harvest burn index")})[e]||"",a=["ndvi","savi","ndre","reci","ndmi","dem","ndti","ndwi","mndwi","crc","nbr"],i=["ndvi","ndmi","ndwi","savi","ndre","reci","crc","ndti","nbr"],d=["ndvi","ndmi"],u=2,s={ndvi:{type:"ndvi",label:"NDVI",colorVar:"var(--satellite-ndvi)",rgbVar:"--satellite-ndvi-rgb",stackId:"ndvi",bandStyle:"stacked"},ndmi:{type:"ndmi",label:"NDMI",colorVar:"var(--satellite-ndmi)",rgbVar:"--satellite-ndmi-rgb",stackId:"ndmi",bandStyle:"overlay"},ndwi:{type:"ndwi",label:"NDWI",colorVar:"var(--satellite-ndwi)",rgbVar:"--satellite-ndwi-rgb",stackId:"ndwi",bandStyle:"stacked"},savi:{type:"savi",label:"SAVI",colorVar:"var(--satellite-savi)",rgbVar:"--satellite-savi-rgb",stackId:"savi",bandStyle:"stacked"},ndre:{type:"ndre",label:"NDRE",colorVar:"var(--satellite-ndre)",rgbVar:"--satellite-ndre-rgb",stackId:"ndre",bandStyle:"stacked"},reci:{type:"reci",label:"RECI",colorVar:"var(--satellite-reci)",rgbVar:"--satellite-reci-rgb",stackId:"reci",bandStyle:"stacked"},crc:{type:"crc",label:"CRC",colorVar:"var(--satellite-crc)",rgbVar:"--satellite-crc-rgb",stackId:"crc",bandStyle:"stacked"},ndti:{type:"ndti",label:"NDTI",colorVar:"var(--satellite-ndti)",rgbVar:"--satellite-ndti-rgb",stackId:"ndti",bandStyle:"stacked"},nbr:{type:"nbr",label:"NBR",colorVar:"var(--satellite-nbr)",rgbVar:"--satellite-nbr-rgb",stackId:"nbr",bandStyle:"stacked"}},c=e=>"string"==typeof e?e.trim().toLowerCase():"",f=e=>{var t,l;let n=c(e);return null!==(l=null===(t=s[n])||void 0===t?void 0:t.label)&&void 0!==l?l:n.toUpperCase()},v=e=>i.includes(c(e)),p=e=>{let t=Array.isArray(null==e?void 0:e.satellite)?e.satellite.map(c):[];return i.filter(e=>t.includes(e))},y=e=>{let t=p(e),l=(Array.isArray(null==e?void 0:e.satellite_graph_datas)?e.satellite_graph_datas.map(c):[...d]).filter(e=>t.includes(e)&&v(e));if(l.length>0)return l.slice(0,1);let n=d.filter(e=>t.includes(e));return n.length>0?n.slice(0,1):t.slice(0,1)},g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=new Set;return e.forEach(l=>{let n=String(l).toUpperCase();t.add(n),1===e.length&&(t.add("".concat(n," MIN")),t.add("".concat(n," MAX")))}),t},h=e=>{let t=new Set(p(e));return i.map(e=>({...s[e],entitled:t.has(e),tooltipKey:e}))},m=(e,t)=>{let l=new Set([...null!=e?e:[],...null!=t?t:[]].map(c).filter(v));return i.filter(e=>l.has(e))},b=e=>Number.isFinite(Number(e))?e:void 0,x=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(c).filter(v).slice(0,u)},w=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"tr";return new Date(e).toLocaleDateString((0,n.eY)(t),{day:"numeric",month:"long",year:"numeric"})},S=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"tr",l=new Map;return Object.entries(e).forEach(e=>{let[n,r]=e,o=c(n);if(!v(o)||!Array.isArray(r))return;let a=f(o);r.forEach(e=>{var n;let{date:r,value:o,min:i,max:d}=e;if(!r)return;let u=null!==(n=l.get(r))&&void 0!==n?n:{date:w(r,t),timestamp:new Date(r).getTime()};u[a]=b(o),u["".concat(a," MIN")]=b(i),u["".concat(a," MAX")]=b(d),l.set(r,u)})}),Array.from(l.values()).sort((e,t)=>e.timestamp-t.timestamp)},k=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=new Map(i.map(e=>{let t=s[e];return[t.label,t]}));return e.map(e=>
1t.get(String(e).toUpperCase())).filter(Boolean).slice(0,u)},_=e=>{if(null==e||""===e)return null;let t=Number(e);return Number.isFinite(t)?t:null},E=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.map(_).filter(e=>null!==e);if(0===t.length)return[0,1];let l=Math.min(...t),n=Math.max(...t),r=n-l,o=r>0?.05*r:Math.max(.05*Math.abs(l),.01);return[l-o,n+o]},I=function(){let{data:e=[],activeChoices:t=[],startIndex:l=0,endIndex:n=e.length-1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=k(t),o=Math.max(0,Math.min(null!=l?l:0,e.length-1)),a=Math.max(o,Math.min(null!=n?n:e.length-1,e.length-1)),i=e.length>0?e.slice(o,a+1):[],d=e=>E(i.flatMap(t=>e.map(e=>null==t?void 0:t[e])));if(1===r.length){let[{label:e}]=r;return{left:d([e,"".concat(e," MIN"),"".concat(e," MAX")]),right:null}}return{left:r[0]?d([r[0].label]):[0,1],right:r[1]?d([r[1].label]):null}},M=()=>{let e={};return Object.values(s).forEach(t=>{let{label:l,colorVar:n}=t;e[l]=n,e["".concat(l," MIN")]=n,e["".concat(l," MAX")]=n}),e},C=function(e){let{showRange:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l="".concat(e.label," MIN"),n="".concat(e.label," MAX");return t?[{kind:"line",key:"".concat(e.type,"-min"),dataKey:l,stroke:e.colorVar,strokeDasharray:"4 4"},{kind:"line",key:"".concat(e.type,"-max"),dataKey:n,stroke:e.colorVar,strokeDasharray:"4 4"},{kind:"line",key:"".concat(e.type,"-value"),dataKey:e.label,stroke:e.colorVar}]:[{kind:"line",key:"".concat(e.type,"-value"),dataKey:e.label,stroke:e.colorVar}]},L=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=k(e),l=1===t.length;return t.flatMap((e,t)=>C(e,{showRange:l}).map(e=>({...e,yAxisId:0===t?"left":"right"})))}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.