PageSourceSearch

https://ogor.ro/js/app.c3ee4c9b.js

js ogor.ro collected 2026-10-02 12:39:42 UTC 325,820 bytes, 2 lines download raw bytes

1(()=>{"use strict";var e={373:(e,t,r)=>{r.d(t,{A:()=>m});r(3725),r(5019),r(9838),r(1339);var a=r(2024),s=r(9442),n=r(4510),i=r(8119),o=r(5471),l=r(6599),c=r(8517),d=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},u=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};let p=class extends o.Ay{constructor(){super(...arguments),Object.defineProperty(this,"rasterKind",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"__tippyInstances",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reports",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"prompts",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"selectedTarget",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"showAllReports",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"showAllPrompts",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get cropIntervals(){return[]}get selectedInterval(){return this.cropIntervals.length?(0,s.a)(this.cropIntervals,this.$store.getters.selectedDate,this.$store.getters.currentSeason):null}get selectedDateInInterval(){return null!==this.selectedInterval}get allReportsLength(){var e;return(null===(e=this.reports)||void 0===e?void 0:e.length)||0}get filteredReports(){if(!this.reports||!this.cropIntervals.length)return this.reports||[];if(!this.selectedInterval)return this.reportsOutsideIntervals;const e=this.selectedInterval.id,t=this.$store.getters.currentSeason;return this.reports.filter((r=>{var a;return(null===(a=(0,s.a)(this.cropIntervals,r.report_datetime,t))||void 0===a?void 0:a.id)===e}))}get allIntervalReportsGrouped(){var e;if(!this.reports||!this.cropIntervals.length)return{};const t=null===(e=this.selectedInterval)||void 0===e?void 0:e.id,r=this.$store.getters.currentSeason,a={};return this.reports.forEach((e=>{const n=(0,s.a)(this.cropIntervals,e.report_datetime,r);n&&n.id!==t&&(a[n.id]||(a[n.id]={title:this.getCropIntervalStr(n),reports:[]}),a[n.id].reports.push(e))})),a}get reportsOutsideIntervals(){if(!this.reports||!this.cropIntervals.length)return[];const e=this.$store.getters.currentSeason;return this.reports.filter((t=>!(0,s.a)(this.cropIntervals,t.report_datetime,e)))}get allPromptsLength(){var e;return(null===(e=this.prompts)||void 0===e?void 0:e.length)||0}get filteredPrompts(){if(!this.prompts||!this.cropIntervals.length)return this.prompts||[];if(!this.selectedInterval)return this.promptsOutsideIntervals;const e=this.selectedInterval.id,t=this.$store.getters.currentSeason;return this.prompts.filter((r=>{var a;return(null===(a=(0,s.a)(this.cropIntervals,r.created,t))||void 0===a?void 0:a.id)===e}))}get allIntervalPromptsGrouped(){var e;if(!this.prompts||!this.cropIntervals.length)return{};const t=null===(e=this.selectedInterval)||void 0===e?void 0:e.id,r=this.$store.getters.currentSeason,a={};
1return this.prompts.forEach((e=>{const n=(0,s.a)(this.cropIntervals,e.created,r);n&&n.id!==t&&(a[n.id]||(a[n.id]={title:this.getCropIntervalStr(n),prompts:[]}),a[n.id].prompts.push(e))})),a}get promptsOutsideIntervals(){if(!this.prompts||!this.cropIntervals.length)return[];const e=this.$store.getters.currentSeason;return this.prompts.filter((t=>!(0,s.a)(this.cropIntervals,t.created,e)))}get currencyNumberFormat(){try{return new Intl.NumberFormat(this.$language.current,{style:"currency",currency:"RON",currencyDisplay:"symbol",maximumFractionDigits:2})}catch(e){return{format:function(e){return`${parseInt(e)} lei`}}}}get ogorURL(){return"/"+window.currentLanguage}get yieldURL(){return this.ogorURL+"/yield"}get routeBack(){const e=this.$route.query.backTo;return e&&e.startsWith("/")?e:"#"}get selectedCropName(){return this.$store.getters.selectedCropId&&this.getCropName(this.$store.getters.selectedCropId)}get selectedParcelCropId(){const e=this.$store.getters.selectedParcel;return this.getParcelCropId(e)}get selectedParcelCropName(){if(this.$store.getters.selectedParcel)return this.getParcelCropName(this.$store.getters.selectedParcel)}get isMobile(){return this.$store.getters.isMobile}zoomOutMobile(){(0,s.Fr)()&&this.$nextTick((()=>{const e=document.querySelector('meta[name="viewport"]');if(e){const t=e.content;e.content="",e.content=t}}))}parcelCountText(e){return e<=0?this.$gettext("No parcels"):this.$gettextInterpolate(this.$ngettext("%{ n } parcel","%{ n } parcels",e),{n:e})}initTooltips(){this.$nextTick((()=>{this.$el&&this.$el.querySelectorAll&&(this.__tippyInstances&&this.__tippyInstances.forEach((e=>e.destroy())),this.__tippyInstances=(0,a.Ay)(this.$el.querySelectorAll("[data-tippy-content]"),{allowHTML:!0,interactive:!1}))}))}getCrop(e){return this.$store.getters.allCrops[e]}getCropName(e,t){const r=this.getCrop(e);return r&&(r.name[t||this.$language.current]||this.$gettext("Unspecified crop"))}getParcelCrop(e,t){var r;if(!e)return null;const a=this.getCropIntervalCrop(e.crop_intervals,t);if(!a)return{id:"no-crop",name:this.$gettext("Unspecified crop")};const s=this.$store.getters.allCrops;return{id:a,name:null===(r=s[a])||void 0===r?void 0:r.name[this.$language.current]}}getParcelCropId(e,t){return this.getCropIntervalCrop(null===e||void 0===e?void 0:e.crop_intervals,t)}getParcelCropName(e,t){const r=this.getParcelCrop(e,t);return r&&r.name}getParcelName(e){return[e.locality,[e.physical_block,e.parcel_no].join("-")].map((e=>e.trim())).filter((e=>!!e)).join(" ")}getParcelLink(e){var t;if(!e)return"";const r=null===(t=e.rasters)||void 0===t?void 0:t[0],a=e.sensing_date||r&&r.sensing_date||(0,s.Yq)(this.$store.getters.selectedDate);return{name:"map-observation-details",params:{farmId:e.farm||this.$store.getters.currentFarmId,seasonId:e.season||this.$store.getters.currentSeasonId,parcelId:e.id,date:a},query:{rasterKind:r&&r.kind||this.rasterKind}}}getGrowthStagesForCrop(e){if(e)return this.$store.dispatch("getCropGrowthStages",e)}getGrowthStageName(e){return e?e.stage[this.$language.current]||e.stage.en:""}showPaywall(){n.A.$emit(n.A.events.showPaywall)}openSearchSidebar(){this.$store.commit("setShowSearchSidebar",!0)}closeSearchSidebar(){this.$store.commit("setShowSearchSidebar",!1),this.$store.commit("setRastersSelectable",!1),this.$store.commit("clearAllSelectedParcels")}changeCurrentParcelCrop(){n.A.$emit(n.A.events.showChangeParcelCrop)}getCropInterval(e,t,r){return t||(t=this.$store.getters.selectedDate),r||(r=this.$store.getters.currentSeason),(0,s.MV)(e,t,r)}getCropIntervalCrop(e,t,r){return t||(t=this.$store.getters.selectedDate),r||(r=this.$store.getters.currentSeason),(0,s.Ay)(e,t,r)}getCropIntervalStr(e,t,r){return t||(t=this.$store.getters.currentSeason),r||(r=this.$language.current),(0,s.Lm)(e,t,r)}getOGORPhoneNumber(){return i.Sv}getOGORPhoneNumberLink(){return"tel:"+i.Sv.replace(/[^\d+]/g,"x")}formatFloat(e,t){return(0,s.kr)(e,t)}apiMediaURL(e){return(0,c.av)(e)}relativeTimeStr(e,t=3e5,r=6e4,a){const n=new Date(e),i=Date.now()-n.getTime();if(i>t)return a=a||{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"},n.toLocaleDateString(this.$language.current,a);if(i>=r){const e=(0,s.Pu)(n,new Date);let t,r;return e.years?(t=this.$ngettext("%{ n } year ago","%{ n } years ago",e.years),r=e.years):e.months?(t=this.$ngettext("%{ n } month ago","%{ n } months ago",e.months),r=e.months):e.days?(t=this.$ngettext("%{ n } day ago","%{ n } days ago",e.days),r=e.days):e.minutes?(t=this.$ngettext("%{ n } minute ago","%{ n } minutes ago",e.minutes),r=e.minutes):(t=this.$ngettext("%{ n } second ago","%{ n } seconds ago",e.seconds),r=e.seconds),this.$gettextInterpolate(t,{n:r})}return this.$gettext("just now")}getFarmName(e){return(null===e||void 0===e?void 0:e.id)==this.$store.getters.demo
1FarmId?this.$gettext("DEMO farm"):null===e||void 0===e?void 0:e.name}isFeatureFlagActive(e){var t;return null===(t=this.$store.getters.featureFlags[e])||void 0===t?void 0:t.active}parseDate(e){return(0,s._U)(e)}getParcelsInterval(e,t=this.$store.getters.selectedDate,r=this.$store.getters.currentSeason){let a,n;return e.forEach((e=>{const i=this.getCropInterval(null===e||void 0===e?void 0:e.crop_intervals,t,r);if(!i)return;const o=(0,s._U)(i.computed_start_date),l=(0,s._U)(i.computed_end_date);(!a||o<a)&&(a=o),(!n||l>n)&&(n=l)})),{startDate:a||r.start_date,endDate:n||r.end_date}}extractReportProps(e,t=[]){const{assets:r,comment:a,journal_user:s,report_datetime:n,evaluation:i,prompt:o,estimated_yield:l}=e,c=o?{key:o,text:this.$gettext("See prompt"),selectTarget:this.selectTarget}:null,d={DANGER:this.$gettext("DANGER"),LAGGING:this.$gettext("LAGGING"),STEADY:this.$gettext("STEADY")},u=(null===s||void 0===s?void 0:s.first_name)||"Unknown",p=(null===s||void 0===s?void 0:s.last_name)?s.last_name.slice(0,1)+".":"";return{images:r.map((e=>e.url)),description:a,author:`${u} ${p}`,date:n,title:d[i]||i,additionalInformation:null==l||isNaN(Number(l))?null:`${Number(l).toFixed(2)} t/ha estimated yield`,target:c,parcels:t}}extractPromptProps(e){const{comment:t,journal_user:r,created:a,assets:s,is_active:n}=e,i=(null===r||void 0===r?void 0:r.first_name)||"Unknown",o=(null===r||void 0===r?void 0:r.last_name)?r.last_name.slice(0,1)+".":"",l=(null===s||void 0===s?void 0:s.map((e=>e.url)))||[];return{images:l,description:t,author:`${i} ${o}`,date:a,isActive:n}}loadReports(e,t){return u(this,void 0,void 0,(function*(){const r=`/farm/${e}/season/${t}/crop_evaluations/`,a=yield(0,c.H2)("GET",r);return this.reports=a,a}))}loadCropReports(e,t,r){return u(this,void 0,void 0,(function*(){const a=`/farm/${e}/season/${t}/crop_evaluations/?crop_pk=${r}`,s=yield(0,c.H2)("GET",a);return this.reports=s,s}))}loadParcelReports(e,t,r){return u(this,void 0,void 0,(function*(){const a=`/farm/${e}/season/${t}/parcel/${r}/crop_evaluations/`,s=yield(0,c.H2)("GET",a);return this.reports=s,s}))}loadPrompts(e,t){return u(this,void 0,void 0,(function*(){const r=`/farm/${e}/season/${t}/prompts/`,a=yield(0,c.H2)("GET",r);return this.prompts=a,a}))}selectTarget(e){this.selectedTarget=e,this.$nextTick((()=>{const e=document.querySelector(".selected");e&&e.scrollIntoView({behavior:"smooth",block:"center"})})),setTimeout((()=>{this.selectedTarget=""}),2e3)}};p=d([(0,l.Ay)({watch:{"$language.current":function(){this.$emit("updateHead")}}})],p);const m=p},392:(e,t,r)=>{var a;r.d(t,{J:()=>a,T:()=>s}),function(e){e["RO"]="RO",e["FR"]="FR"}(a||(a={}));const s={[a.RO]:{en:"Romania",ro:"România",fr:"Roumanie"},[a.FR]:{en:"France",ro:"Franța",fr:"France"}}},497:(e,t,r)=>{r.d(t,{A:()=>h});var a=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{class:["auto-size",{"allow-overflow":e.allowOverflow}]},[t("transition",{attrs:{name:e.transitionName,duration:e.transitionDuration},on:{beforeEnter:e.beforeEnter,enter:e.enter,afterEnter:e.afterEnter,leave:e.leave}},[e._t("default")],2)],1)},s=[],n=r(9442),i=r(5289),o=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const l=(0,n.g_)({transitionName:{type:String,default:"fade-carousel"},transitionDuration:{type:Number,default:300},resetScroll:{type:Boolean,default:!1},allowOverflow:{type:Boolean,default:!1}});let c=class extends((0,i.vE)(i.Y5,l)){constructor(){super(...arguments),Object.defineProperty(this,"$emit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"$el",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"observer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"lastIndex",{enumerable:!0,configurable:!0,writable:!0,value:0})}mounted(){this.computeSize(),window.addEventListener("resize",this.handleResize),this.observer=new MutationObserver(this.computeSize),this.observer.observe(this.$el,{childList:!0,subtree:!0})}beforeDestroy(){window.removeEventListener("resize",this.handleResize),this.observer&&this.observer.disconnect()}computeSize(){let e=0,t=0,r=this.$el.lastElementChild;r&&(e=r.clientHeight,t=r.clientWidth),this.$el.style.height=e+"px",this.$el.style.width=t+"px",this.$emit("resize",{height:e,width:t}),r||setTimeout((()=>{this.$el.style.height=null,this.$el.style.width=null}),this.transitionDuration)}handleResize(){this.$el.style.transition="none",this.$el.style.height=null,this.$el.style.width=null,this.computeSize(),this.$el.style.transition=null}beforeEnter(e){var t;let r=parseInt(null===(t=e.dataset)||void 0===t?void 0:t.index);if(r<this.lastIndex){e.classList.add("inverse");let t=this.$el.firstElementChild;t.classList.add("inverse")}}enter(e){e.style.position="absolute",this.resetScroll&&(this.$el.scrollTop=0,this.$el.scrollLeft=0)}afterEnter(e){e.style.position=null,this.lastIndex=parseInt(e.dataset.index),e.classList.remove("inverse")}leave(e){e.style.position="absolute"}};c=o([(0,i.uA)({name:"ContentTransition"})],c);const d=c,u=d;var p=r(1656),m=(0,p.A)(u,a,s,!1,null,null,null);const h=m.exports},864:(e,t,r)=>{e.exports=r.p+"img/crop-rotation.c3d6d0d2.svg"},877:(e,t,r)=>{e.exports=r.p+"img/haystack.b863b347.svg"},1617:(e,t,r)=>{r.d(t,{A:()=>h});var a=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"loading-container"},[t("div",{staticClass:"lds-ring",style:e.outerRingStyle},[t("div",{style:e.ringStyle}),t("div",{style:e.ringStyle}),t("div",{style:e.ringStyle}),t("div",{style:e.ringStyle})]),e.showLoadingMessage?t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"heading text-bold loading-message"}
1,[e._v("Loading...")]):e._e(),null!==e.progress?t("div",{staticClass:"action-text large progress-indicator"},[e._v(e._s(e.formatFloat(100*e.progress,0))+"%")]):e._e(),e.showCancelMessage?t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"small action-text",on:{click:function(t){return e.$emit("cancel")}}},[e._v("Cancel")]):e._e()])},s=[],n=r(9442),i=r(5289),o=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const l=(0,n.g_)({progress:{type:Number,required:!1,default:null},showLoadingMessage:{type:Boolean,required:!1,default:!1},showCancelMessage:{type:Boolean,required:!1,default:!1},size:{type:Number,required:!1,default:80},color:{type:String,required:!1,default:"#3869ff"}});let c=class extends((0,i.vE)(i.Y5,l)){get stringSize(){return this.size+"px"}get outerRingStyle(){return{width:this.stringSize,height:this.stringSize}}get ringStyle(){return{border:this.size/8+"px solid",borderColor:this.color+" transparent transparent transparent"}}};c=o([(0,i.uA)({name:"Loading"})],c);const d=c,u=d;var p=r(1656),m=(0,p.A)(u,a,s,!1,null,"51cb21da",null);const h=m.exports},1783:(e,t,r)=>{r.d(t,{D:()=>bt,A:()=>yt});r(3725),r(9838),r(5019);var a=r(5471),s=r(5353),n=r(6823),i=r(8517),o=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};function l(){return{currentUser:{id:null,email:null,phone:null,name:null,last_name:null,first_name:null,is_staff:null,is_active:null,is_data_source:null,is_hijacked:null,verified_email:!0,preferred_language:null,privacy:!1,generaltos:!1,marketing:!1,license:null},linkEmail:"",attemptedLogin:{email:null,newUser:null}}}const c=bt({clearUser(e){const t=l();Object.keys(t).forEach((r=>{e[r]=t[r]}))},setLinkEmail(e,t){e.linkEmail=t||""},setAttemptedLogin(e,t){e.attemptedLogin=t},setCurrentUser(e,t){Object.assign(e.currentUser,t),e.currentUser.name=[e.currentUser.first_name,e.currentUser.last_name].filter(Boolean).join(" ")}}),d={user(e){return e.currentUser},userFirstName(e){return e.currentUser.first_name},userLastName(e){return e.currentUser.last_name},userEmail(e){return e.currentUser.email},linkEmail(e){return e.linkEmail},attemptedLogin(e){return e.attemptedLogin},userIsAuthenticated(e){return!!e.currentUser.email},userIsConfirmed(e){return e.currentUser.verified_email},userIsHijacked(e){return e.currentUser.is_hijacked},userIsStaff(e){return e.currentUser.is_staff},userLicense(e){var t;return null===(t=e.currentUser)||void 0===t?void 0:t.license},userLicenseIsTrial(e,t){var r;return null===(r=t.userLicense)||void 0===r?void 0:r.is_trial},userLicenceIsPreTrial(e,t){var r;return null===(r=t.userLicense)||void 0===r?void 0:r.is_pre_trial},userLicenseIsActive(e,t){return!t.userLicense||t.userLicense.is_active},userLatestLegalConsent(e){return e.currentUser.privacy&&e.currentUser.generaltos}},u={getCurrentUser(e){return o(this,void 0,void 0,(function*(){const t=yield(0,i.H2)("GET","/auth/user/");e.commit("setCurrentUser",t)}))}},p={state:l(),mutations:c,actions:u,getters:d};r(9471),r(1339);var m=r(9442);const h={Amber:{50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00"},"Blue Grey":{50:"#ECEFF1",100:"#CFD8DC",200:"#B0BEC5",300:"#90A4AE",400:"#78909C",500:"#607D8B",600:"#546E7A",700:"#455A64",800:"#37474F",900:"#263238"},Blue:{50:"#E3F2FD",100:"#BBDEFB",200:"#90CAF9",300:"#64B5F6",400:"#42A5F5",500:"#2196F3",600:"#1E88E5",700:"#1976D2",800:"#1565C0",900:"#0D47A1"},Brown:{50:"#EFEBE9",100:"#D7CCC8",200:"#BCAAA4",300:"#A1887F",400:"#8D6E63",500:"#795548",600:"#6D4C41",700:"#5D4037",800:"#4E342E",900:"#3E2723"},Cyan:{50:"#E0F7FA",100:"#B2EBF2",200:"#80DEEA",300:"#4DD0E1",400:"#26C6DA",500:"#00BCD4",600:"#00ACC1",700:"#0097A7",800:"#00838F",900:"#006064"},"Deep Orange":{50:"#FBE9E7",100:"#FFCCBC",200:"#FFAB91",300:"#FF8A65",400:"#FF7043",500:"#FF5722",600:"#F4511E",700:"#E64A19",800:"#D84315",900:"#BF360C"},"Deep Purple":{50:"#EDE7F6",100:"#D1C4E9",200:"#B39DDB",300:"#9575CD",400:"#7E57C2",500:"#673AB7",600:"#5E35B1",700:"#512DA8",800:"#4527A0",900:"#311B92"},Green:{50:"#E8F5E9",100:"#C8E6C9",200:"#A5D6A7",300:"#81C784",400:"#66BB6A",500:"#4CAF50",600:"#43A047",700:"#388E3C",800:"#2E7D32",900:"#1B5E20"},Grey:{50:"#FAFAFA",100:"#F5F5F5",200:"#EEEEEE",300:"#E0E0E0",400:"#BDBDBD",500:"#9E9E9E",600:"#757575",700:"#616161",800:"#424242",900:"#212121"},Indigo:{50:"#E8EAF6",100:"#C5CAE9",200:"#9FA8DA",300:"#7986CB",400:"#5C6BC0",500:"#3F51B5",600:"#3949AB",700:"#303F9F",800:"#283593",900:"#1A237E"},"Light Blue":{50:"#E1F5FE",100:"#B3E5FC",200:"#81D4FA",300:"#4FC3F7",400:"#29B6F6",500:"#03A9F4",600:"#039BE5",700:"#0288D1",800:"#0277BD",900:"#01579B"},"Light Green":{50:"#F1F8E9",100:"#DCEDC8",200:"#C5E1A5",300:"#AED581",400:"#9CCC65",500:"#8BC34A",600:"#7CB342",700:"#689F38",800:"#558B2F",900:"#33691E"},Lime:{50:"#F9FBE7",100:"#F0F4C3",200:"#E6EE9C",300:"#DCE775",400:"#D4E157",500:"#CDDC39",600:"#C0CA33",700:"#AFB42B",800:"#9E9D24",900:"#827717"},Orange:{50:"#FFF3E0",100:"#FFE0B2",200:"#FFCC80",300:"#FFB74D",400:"#FFA726",500:"#FF9800",600:"#FB8C00",700:"#F57C00",800:"#EF6C00",900:"#E65100"},Pink:{50:"#FCE4EC",100:"#F8BBD0",200:"#F48FB1",300:"#F06292",400:"#EC407A",500:"#E91E63",600:"#D81B60",700:"#C2185B",800:"#AD1457",900:"#880E4F"},Purple:{50:"#F3E5F5",100:"#E1BEE7",200:"#CE93D8",300:"#BA68C8",400:"#AB47BC",500:"#9C27B0",600:"#8E24AA",700:"#7B1FA2",800:"#6A1B9A",900:"#4A148C"},Red:{50:"#FFEBEE",100:"#FFCDD2",200:"#EF9A9A",300:"#E57373",400:"#EF5350",500:"#F44336",600:"#E53935",700:"#D32F2F",800:"#C62828",900:"#B71C1C"},Teal:{50:"#E0F2F1",100:"#B2DFDB",200:"#80CBC4",300:"#4DB6AC",400:"#26A69A",500:"#009688",600:"#00897B",700:"#00796B",800:"#00695C",900:"#004D40"},Yellow:{50:"#FFFDE7",100:"#FFF9C4",200:"#FFF59D",300:"#FFF176",400:"#FFEE58",500:"#FFEB3B",600:"#FDD835",700:"#FBC02D",800:"#F9A825",900:"#F57F17"}};var f=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};function v(e){const t=3,r=e.name.en,a=r.split("").reduce(((e,t)=>e+t.charCodeAt(0)),0)+t,s=Object.keys(h),n=s[a%s.length],i=Object.keys(h[n]),o=i[a%i.length];return h[n][o]}function g(){return{allCrops:{},allCropsIndex:{},cropsPerSeason:{},cropsPerSeasonIndex:{},noCropObject:{id:"null",cropIds:new Set(["null"]),system_links:[],name:{en:"Unspecified crop",ro:"Cultură nespecificată",fr:"Culture non spécifiée"},color:"#CAD1D2"},growthStagesByCropId:{},growthStageIndex:{},selectedCrop:null,cropYieldsByCropIdAndSeason:{}}}const y=bt({clearCrops(e){const t=g();Object.keys(t).forEach((r=>{e[r]=t[r]}))},setCrops(e,{crops:t,seasonId:r}){const s={},n={};t.forEach((t=>{if(Object.keys(t.name).forEach((e=>t.name[e]=(0,m.nx)(t.name[e]))),e.allCrops[t.name.en])n[t.name.en]=e.allCrops[t.name.en],n[t.name.en].cropIds.add(t.id),s[t.id]=n[t.name.en];else if(n[t.name.en])n[t.name.en].cropIds.add(t.id),s[t.id]=n[t.name.en];else{const e=Object.assign(Object.assign({},t),{cropIds:new Set([t.id]),color:t.color||v(t)});n[t.name.en]=e,s[t.id]=e}})),s["null"]=e.noCropObject,n[""]=e.noCropObject,a.Ay.set(e.cropsPerSeason,r,n),a.Ay.set(e.cropsPerSeasonIndex,r,s),Object.assign(e.allCrops,n),Object.assign(e.allCropsIndex,s)},setCropSelected(e,t){e.selectedCrop=t?e.allCropsIndex[t]:null},removeSeasonCrops(e,t){a.Ay.set(e.cropsPerSeason,t,void 0),a.Ay.set(e.cropsPerSeasonIndex,t,void 0)},setGrowthStagesByCropId(e,{cropId:t,growthStages:r}){e.growthStagesByCropId=Object.assign(Object.assign({},e.growthStagesByCropId),{[t]:r})},setGrowthStageIndex(e,t){e.growthStageIndex=Object.assign({},t)},setCropYieldsByCropIdAndSeason(e,{cropId:t,seasonId:r,cropYields:s}){e.cropYieldsByCropIdAndSeason[t]||a.Ay.set(e.cropYieldsByCropIdAndSeason,t,{}),a.Ay.set(e.cropYieldsByCropIdAndSeason[t],r,s)}}),b={crops(e,t,r,a){return a.currentSeasonId&&e.cropsPerSeasonIndex[a.currentSeasonId]||{}},cropsForCurrentSeason(e,t,r,a){return a.currentSeasonId?Object.values(e.cropsPerSeason[a.currentSeasonId]||{}):[]},sortedCropIds(e,t){return t.cropsForCurrentSeason.map((e=>Array.from(e.cropIds))).flat()},allCrops(e){return e.allCropsIndex},allCropGroups(e){return e.allCrops},cropsPerSeason(e){return e.cropsPerSeason},totalCrops(e,t){return t.crops?Object.keys(t.crops).length:-1},selectedCrop(e){return e.selectedCrop},selectedCropId(e){var t;return null===(t=e.selectedCrop)||void 0===t?void 0:t.id},growthStagesByCropId(e){return e.growthStagesByCropId},growthStageIndex(e){return e.growthStageIndex},cropYieldsByCropIdAndSeason(e){return e.cropYieldsByCropIdAndSeason}},w={getCrops(e){return f(this,arguments,void 0,(function*(e,t=null){if(t=t||e.rootGetters.currentSeasonId,!e.rootGetters.currentFarmId||!t||e.rootGetters.cropsPerSeason[t])return;const r=yield(0,i.H2)("GET",`/farm/${e.rootGetters.currentFarmId}/season/${t}/crops/`);e.commit("setCrops",{crops:r,seasonId:t}),yield e.dispatch("fetchCropYields",t)}))},getAllCrops(e){return f(this,void 0,void 0,(function*(){const t=yield(0,i.H2)("GET","/crops/",{limit:1e4});e.commit("setCrops",{crops:t.results,seasonId:""})}))},refreshSeasonCrops(e){return f(this,arguments,void 0,(function*(e,t=null){t=t||e.rootGetters.currentSeasonId,e.commit("removeSeasonCrops",t),yield e.dispatch("getCrops",t)}))},getCropGrowthStages(e,t){return f(this,void 0,void 0,(function*(){if(!e.state.growthStagesByCropId[t]){const r=yield(0,i.H2)("GET","/crops/"+t),a=r.growthstages;e.commit("setGrowthStagesByCropId",{cropId:t,growthStages:a});const s=Object.assign({},e.state.growthStageIndex);a.forEach((e=>{s[e.id]=e})),e.commit("setGrowthStageIndex",s)}}))},fetchCropYields(e,t){return f(this,void 0,void 0,(function*(){const r=yield(0,i.H2)("GET",`/farm/${e.rootGetters.currentFarmId}/season/${t}/cropyield/`,{limit:1e4});
1r.results.forEach((r=>{e.commit("setCropYieldsByCropIdAndSeason",{cropId:r.crop,seasonId:t,cropYields:r})}))}))}},_={state:g(),mutations:y,actions:w,getters:b},C=_;var P=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};function S(){return{selectedDate:null,availableDates:[],totalDates:-1}}const I=bt({clearDates(e){const t=S();Object.keys(t).forEach((r=>{e[r]=t[r]}))},setAvailableDates(e,t){e.availableDates=t,e.totalDates=t.length},setSelectedDate(e,t){e.selectedDate=t}}),x={availableDates(e){return e.availableDates},totalDates(e){return e.totalDates},selectedDate(e){return e.selectedDate},selectedDateString(e){return(0,m.Yq)(e.selectedDate)},selectedYear(e){return e.selectedDate&&e.selectedDate.getFullYear()},latestDate(e){return e.availableDates?e.availableDates[0]:null},latestSeason(e,t,r,a){return(0,m.TQ)(a.seasons,t.latestDate)},isLatestDate(e){return!!e.availableDates&&(0,m.vw)(e.availableDates[0],e.selectedDate)}},O={getAvailableDates(e){return P(this,void 0,void 0,(function*(){if(!e.rootGetters.currentFarmId)return;const t=yield(0,i.H2)("GET",`/farm/${e.rootGetters.currentFarmId}/sensing_dates/`);e.commit("setAvailableDates",t.sensing_dates.map((e=>(0,m._U)(e))))}))}},k={strict:!0,state:S(),mutations:I,getters:x,actions:O};r(2598);var A=r(8119),$=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};function F(){return{demoFarmId:null,userFarms:{},sharedFarms:{},allFarms:{},currentFarmId:null,totalFarms:-1}}function D(e,t,r){const a={};t.forEach((e=>{a[e.id]=e})),e[r]=a,e.allFarms=Object.assign(Object.assign({},e.allFarms),a)}function j(e){let t=e;return t.hectares=parseFloat(e.hectares)||0,t.parcel_count=e.parcel_count||0,t.hasNewParcels=!1,t.licenseExpired=!1===e.owner_license_is_active,t}function E(e){let t=j(e);return t.ownedFarm=!1,t.hasAccess=!0,t.hasFullAcess=!1,t.parcelAccessOnly=!1,t.hasSeasons=!0,t.shared_farm="view_only",t.sharedParcels=null,t}function N(e){var t;let r=j(e);return e.shared_farm||(r.shared_farm="view_only"),r.ownedFarm=!1,r.hasAccess="view_only"===r.shared_farm,r.hasFullAcess="full_access"===r.shared_farm,r.parcelAccessOnly="no_access"===r.shared_farm,r.hasSeasons=(null===(t=e.seasons)||void 0===t?void 0:t.length)>0,r.sharedParcels=[],r}function T(e){var t;let r=j(e);return r.ownedFarm=!0,r.hasAccess=!0,r.hasFullAcess=!0,r.parcelAccessOnly=!1,r.hasSeasons=(null===(t=r.seasons)||void 0===t?void 0:t.length)>0,r.shared_farm="full_access",r.sharedParcels=null,r}const L=bt({clearFarms(e){const t=F();Object.keys(t).forEach((r=>{e[r]=t[r]}))},setHasNewParcels(e,{farmId:t,hasNewParcels:r}){const a=e.allFarms[t];a&&(a.hasNewParcels=r)},setUserFarms(e,t){D(e,t,"userFarms"),e.totalFarms=t.length},setSharedFarms(e,t){D(e,t,"sharedFarms")},setSharedParcels(e,{farmId:t,sharedParcels:r}){e.allFarms[t]&&(e.allFarms[t].sharedParcels=r)},addFarmDetails(e,t){t.parcel_count=parseInt(t.parcel_count)||0,t.hectares=parseFloat(t.hectares)||0,t.hasNewParcels=!1,e.allFarms[t.id]=t},setCurrentFarmId(e,t){e.currentFarmId=t;try{const r=e.demoFarmId==t,a=e.allFarms[t];a.parcel_count>0&&!r&&(0,m.qe)("userPreferences","defaultUserFarmId",t)}catch(r){}},setDemoFarmId(e,t){e.demoFarmId=t},setFarmLicenseExpired(e,t){const r=e.allFarms[t];r&&a.Ay.set(r,"licenseExpired",!0)}}),M={allFarms(e){return e.allFarms},farms(e){return e.userFarms},farmsWithSeasons(e){return Object.values(e.userFarms).filter((e=>e.seasons.length>0))},farmsWithParcels(e){return Object.values(e.userFarms).concat(Object.values(e.sharedFarms)).filter((e=>e.parcel_count>0))},userFarms(e){return Object.values(e.userFarms)},sharedFarms(e){return Object.values(e.sharedFarms)},managedFarms(e,t){return[...t.userFarms,...t.sharedFarms.filter((e=>e.hasFullAcess))]},farmIds(e){return Object.keys(e.userFarms)},totalFarms(e){return e.totalFarms},currentFarmId(e){return e.currentFarmId},currentFarm(e){if(e.currentFarmId)return e.userFarms[e.currentFarmId]||e.sharedFarms[e.currentFarmId]||e.allFarms[e.currentFarmId]},currentFarmCountry(e,t){var r;return null===(r=t.currentFarm)||void 0===r?void 0:r.country},currentFarmFlags(e,t){const r=Object.assign({},A.of);return t.currentFarm&&t.currentFarm.feature_flags&&t.currentFarm.feature_flags.forEac
1h((e=>r[e]=!0)),r},userOwnsFarm(e){return!!e.userFarms[e.currentFarmId]},userHasAccessToFarm(e,t){return t.currentFarm&&(t.currentFarm.hasAccess||t.currentFarm.hasFullAcess)},userHasFullAccessToFarm(e,t){return t.currentFarm&&t.currentFarm.hasFullAcess},demoFarm(e){return e.allFarms[e.demoFarmId]},demoFarmId(e){return e.demoFarmId},isDemoFarm(e){return e.currentFarmId&&e.currentFarmId===e.demoFarmId},defaultUserFarm(e,t){const r=(0,m.fU)("userPreferences")["defaultUserFarmId"],a=t.allFarms[r];return a&&!a.licenseExpired?a:t.farmsWithParcels.find((e=>!e.licenseExpired))||t.demoFarm},hasOwnSeasons(e,t){return t.farmsWithSeasons.length>0}},R={getFarms(e){return $(this,void 0,void 0,(function*(){const[t,r,a]=yield Promise.all([(0,i.H2)("GET","/demo-farm/"),(0,i.H2)("GET","/farm/",{limit:A.h_}),(0,i.DJ)((0,i.H2)("GET","/shared-farms/",{limit:A.h_}),{count:0,results:[]},[403])]);t.results.length>0&&(e.commit("setDemoFarmId",t.results[0].id),E(t.results[0])),r.results.forEach(T),a.results.forEach(N),e.commit("setUserFarms",r.results),e.commit("setSharedFarms",[...t.results,...a.results]),yield e.dispatch("getAllSharedParcels")}))},getSingleSharedFarm(e,t){return $(this,void 0,void 0,(function*(){const r=yield(0,i.H2)("GET",`/farm/${t}/`);e.commit("setSharedFarms",[e.getters.demoFarm,r])}))},getDemoFarmOnly(e){return $(this,void 0,void 0,(function*(){if(e.getters.demoFarmId)return;const t=yield(0,i.H2)("GET","/demo-farm/");t.results.length>0&&(e.commit("setDemoFarmId",t.results[0].id),E(t.results[0]),e.commit("setSharedFarms",t.results))}))},setCurrentFarm(e,t){return $(this,void 0,void 0,(function*(){if(e.state.currentFarmId!==t&&e.state.allFarms[t]){e.commit("setCurrentFarmId",t);try{yield Promise.all([e.dispatch("setCurrentParcel",null),e.dispatch("setSelectedDateAndSeason",{date:null}),e.dispatch("getAvailableDates"),e.dispatch("getSeasons")])}catch(r){throw 403===r.statusCode&&e.commit("setFarmLicenseExpired",t),r}}}))},removeFarm(e,t){return $(this,void 0,void 0,(function*(){delete e.state.userFarms[t],delete e.state.allFarms[t];const r=Object.keys(e.state.allFarms)[0];e.dispatch("setCurrentFarm",r)}))}},q={state:F(),mutations:L,getters:M,actions:R},U=q;var B=r(2481);function H(){return{showAppSidebar:!1,showSearchSidebar:!1,parcelSearchText:""}}const G=bt({clearSidebar(e){const t=H();Object.keys(t).forEach((r=>{e[r]=t[r]}))},setShowAppSidebar(e,t){e.showAppSidebar=t},setShowSearchSidebar(e,t){e.showSearchSidebar=t},setParcelSearchText(e,t){e.parcelSearchText=t}}),Y={showAppSidebar(e){return e.showAppSidebar},showSearchSidebar(e){return e.showSearchSidebar},parcelSearchText(e){return e.parcelSearchText},unaccentSearchText(e){return(0,m.sl)(e.parcelSearchText)},sidebarParcels(e,t,r,a){return a.parcelsForCurrentSeason},areParcelsFiltered(e,t,r,a){return!!t.parcelSearchText||!!a.selectedCropId||a.selectedLocalityIds.length>0},filteredParcels(e,t,r,a){return t.sidebarParcels.filter((e=>(0,B.Q)(a,e))).sort(((e,t)=>t.hectares-e.hectares))},filteredParcelSize(e,t,r,a){return t.filteredParcels.reduce(((e,t)=>e+t.hectares),0)}},V={},W={strict:!0,state:H(),getters:Y,mutations:G,actions:V};var z=r(7871),K=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};function J(){return{crop:void 0,dailyPrecipitation:[],maizeWaterCapacity:[],wheatWaterCapacity:[]}}const X=bt({clearMeteoHistory:e=>{Object.assign(e,J())},setCrop:(e,t)=>{e.crop=t},setDailyPrecipitation:(e,t)=>{e.dailyPrecipitation=t.data.map((e=>(0,m.Iq)(e)))},setWaterCapacity:(e,t)=>{const r=t.crop+"WaterCapacity";e[r]=t.data.map((e=>(0,m.Iq)(e)))}}),Z={dailyPrecipitation(e,t){return e.dailyPrecipitation},waterCapacity:e=>"maize"===e.crop?e.maizeWaterCapacity:"wheat"===e.crop?e.wheatWaterCapacity:[]},Q={fetchMeteoHistory(e,t){return K(this,void 0,void 0,(function*(){t&&t.id||e.commit("clearMeteoHistory");const r=e.rootGetters.currentSeason,a=e.rootGetters.cropIntervalByDate;if(null===a)return void e.commit("clearMeteoHistory");const s=e.rootGetters.allCrops[a.crop_id];try{const n=t.meteo_grid_point?`/meteo-grid/${t.meteo_grid_point}/date_interval/`:`/farm/${t.farm}/season/${t.season}/parcel/${t.id}/meteo_history/`,o=a.computed_start_date||(0,m.Yq)(r.start_date),l=a.computed_end_date||(0,m.Yq)(r.end_date),c=yield(0,i.H2)("GET",n,{start_date:o,end_date:l}),d=s.name.en.toLowerCase(),u=d.includes("maize")||d.includes("corn")?"maize":d.includes("wheat")?"wheat":void 0;e.commit("setCrop",u),e.commit("setDailyPrecipitation",{data:c.daily_precipitation}),e.commit("setWaterCapacity",{crop:"maize",data:c.maize_water_capacity}),e.commit("setWaterCapacity",{crop:"wheat",data:c.wheat_water_capacity})}catch(n){e.commit("clearMeteoHistory"),404!==n.statusCode&&(0,m.vV)(n)}}))}},ee={strict:!0,state:J(),mutations:X,actions:Q,getters:Z};var te=r(9332),re=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};function ae(){return{parcelRasterCache:new te.q(5),rastersSelectable:!1,selectedRasters:{},selectedRastersCount:0,rasterKind:A.JY,rasterIndex:{}}}const se=bt({clearRasters(e){const t=ae();Object.keys(t).forEach((r=>{e[r]=t[r]}))}
1,addToParcelRasterCache(e,{id:t,rasters:r}){e.parcelRasterCache.addItem(t,r)},clearSelected(e){e.rastersSelectable=!1,e.selectedRasters={},e.selectedRastersCount=0},addSelectedRaster(e,t){a.Ay.set(e.selectedRasters,t.uniqueKey,t),e.selectedRastersCount=Object.keys(e.selectedRasters).length},removeSelectedRaster(e,t){a.Ay.delete(e.selectedRasters,t.uniqueKey),e.selectedRastersCount=Object.keys(e.selectedRasters).length},setSelectedRasters(e,t){const r={};t.forEach((e=>{r[e.id]=e})),e.selectedRasters=r,e.selectedRastersCount=t.length},setRastersSelectable(e,t){e.rastersSelectable=t},setRasterKind(e,t){e.rasterKind=t},setRasterIndex(e,t){e.rasterIndex=t}}),ne={rastersSelectable(e){return e.rastersSelectable},selectedRasters(e){return e.selectedRasters},parcelRasterCache(e){return e.parcelRasterCache},selectedRastersCount(e){return e.selectedRastersCount},selectedRastersArea(e,t,r,a){return Object.values(e.selectedRasters).reduce(((e,t)=>e+t.hectares),0)},rasterKind(e){return e.rasterKind},humanRasterKind(e){return A.YN[e.rasterKind]},rasterIndex(e){return e.rasterIndex}},ie={getRastersForCurrentParcel(e){return re(this,arguments,void 0,(function*(e,{kind:t,includeSkipped:r,noCache:a}={}){return e.rootGetters.currentFarmId&&e.rootGetters.currentSeasonId&&e.rootGetters.selectedParcelId?yield e.dispatch("getRastersForParcel",{kind:t,includeSkipped:r,noCache:a,farmId:e.rootGetters.currentFarmId,seasonId:e.rootGetters.currentSeasonId,parcelId:e.rootGetters.selectedParcelId}):[]}))},getRastersForParcel(e,t){return re(this,arguments,void 0,(function*(e,{farmId:t,seasonId:r,parcelId:a,includeSkipped:s,kind:n,noCache:o}){n=n||e.getters.rasterKind,s=s||!1;const l={limit:366,raster_kind:n,include_skipped:s},c=a+n+s;let d=!o&&e.getters.parcelRasterCache.getItem(c);return d||(d=(yield(0,i.H2)("GET",`/farm/${t}/season/${r}/parcel/${a}/raster/`,l)).results,e.commit("addToParcelRasterCache",{id:c,rasters:d})),[...d]}))}},oe={strict:!0,state:ae(),getters:ne,mutations:se,actions:ie};var le=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};function ce(){return{seasons:{}
1,currentSeasonId:null,selectedStartMonth:null}}const de=bt({clearSeasons(e){const t=ce();Object.keys(t).forEach((r=>{e[r]=t[r]}))},setSeasons(e,t){const r={};t.forEach((e=>{r[e.id]=e})),e.seasons=r},setCurrentSeasonId(e,t){e.currentSeasonId=t},setSelectedStartMonth(e,t){e.selectedStartMonth=t}}),ue={seasons(e){return e.seasons},sortedSeasons(e){return Object.values(e.seasons).sort(((e,t)=>t.start_date.getTime()-e.start_date.getTime()))},seasonsByEndYear(e){const t={};return Object.values(e.seasons).forEach((e=>{t[e.end_date.getFullYear()]=e})),t},totalSeasons(e,t){return Object.keys(t.seasons).length},currentSeasonId(e){return e.currentSeasonId},currentSeason(e){if(e.currentSeasonId)return e.seasons[e.currentSeasonId]},journalActiveSeason(e){const t=Object.values(e.seasons).find((e=>e.is_active_in_journal));return t},previousSeason(e,t){if(!t.currentSeason)return;const r=t.currentSeason.end_date.getFullYear()-1;return t.seasonsByEndYear[r]},previousSeasonId(e,t){return t.previousSeason&&t.previousSeason.id},selectedStartMonth(e){return e.selectedStartMonth},defaultDemoSeason(e){return(0,m.TQ)(e.seasons,A.C4)},defaultDemoSeasonId(e,t){return t.defaultDemoSeason&&t.defaultDemoSeason.id}},pe={getSeasons(e){return le(this,void 0,void 0,(function*(){if(!e.rootGetters.currentFarmId)return;const t=yield(0,i.H2)("GET",`/farm/${e.rootGetters.currentFarmId}/season/`,{limit:A.h_}),r=t.results.map(me);e.commit("setSeasons",r)}))},getSeasonDetails(e,t){return le(this,void 0,void 0,(function*(){if(!e.rootGetters.currentFarmId)return;const r=yield(0,i.H2)("GET",`/farm/${e.rootGetters.currentFarmId}/season/${t}/`),a=me(r);e.commit("setSeasons",[a])}))},getOrCreateSeason(e,t){return le(this,arguments,void 0,(function*(e,{endYear:t,startMonth:r}){const a="string"===typeof t?parseInt(t,10):t;if(e.getters.seasonsByEndYear[a])return e.getters.seasonsByEndYear[a];const s={end_year:a};void 0!==r&&(s.start_month=r);const n=yield(0,i.H2)("POST",`/farm/${e.rootGetters.currentFarmId}/season/`,{},s),o=me(n);return e.commit("setSeasons",[...Object.values(e.getters.seasons),o]),e.getters.seasonsByEndYear[a]}))},removeSeason(e,t){return le(this,void 0,void 0,(function*(){const r=e.getters.seasons;delete r[t],e.commit("setSeasons",[...Object.values(r)])}))}};function me(e){const t=e;return t.start_date&&(t.start_date=(0,m._U)(e.start_date)),t.end_date&&(t.end_date=(0,m._U)(e.end_date)),t.same_year=!(!t.end_date||!t.start_date||t.end_date.getFullYear()!==t.start_date.getFullYear()),t.same_year||!t.end_date?t.interval=""+t.start_date.getFullYear():t.interval=t.start_date.getFullYear()+"–"+t.end_date.getFullYear(),t}const he={strict:!0,state:ce(),getters:ue,mutations:de,actions:pe};var fe=r(7334),ve=r.n(fe),ge=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};const ye=1e4,be=ve()((e=>{e.$store.getters.progressLoading||(e.$store.commit("setProgressLoading",!0),e.$Progress.start())}),400),we=ve()((e=>{be.clear(),0===e.$store.getters.busyCount&&(e.$Progress.finish(),e.$store.commit("setProgressLoading",!1))}),200);function _e(){return{_busy:[],_progressLoading:!1,isMobile:!1}}const Ce=bt({clearInternal(e){const t=_e();Object.keys(t).forEach((r=>{e[r]=t[r]}))},addBusy(e){e._busy.push(Date.now())},removeBusy(e){e._busy=e._busy.filter((e=>Date.now()-e<=ye)),e._busy.shift()},setProgressLoading(e,t){e._progressLoading=t},setIsMobile(e,t){e.isMobile=t}}),Pe={busyCount(e){const t=Date.now();return e._busy.reduce(((e,r)=>t-r<=ye?e+1:e),0)},progressLoading(e){return e._progressLoading},isMobile(e){return e.isMobile}},Se={startProgress(e,t){return ge(this,void 0,void 0,(function*(){0===e.getters.busyCount&&be(t),e.commit("addBusy")}))},finishProgress(e,t){return ge(this,void 0,void 0,(function*(){0!==e.getters.busyCount&&(e.commit("removeBusy"),we(t))}))}},Ie={strict:!0,state:_e(),getters:Pe,mutations:Ce,actions:Se};var xe=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};function Oe(){return{allLocalities:{},localitiesPerSeason:{}}}const ke=bt({clearLocalities(e){const t=Oe();Object.keys(t).forEach((r=>{e[r]=t[r]}))},setLocalities(e,{localities:t,seasonId:r}){const a={},s=Object.keys(e.allLocalities),n={};t.forEach((t=>{s.includes(t.id)?a[t.id]=e.allLocalities[t.id]:(t.selected=!1,n[t.id]=t,a[t.id]=t)})),e.allLocalities=Object.assign(Object.assign({},e.allLocalities),n),e.localitiesPerSeason=Object.assign(Object.assign({},e.localitiesPerSeason),{[r]:a})}
1,setLocalitySelected(e,{localityId:t,status:r}){e.allLocalities[t].selected=r},setLocalityListSelected(e,t){Object.values(e.allLocalities).forEach((e=>e.selected=!1)),t.forEach((t=>{e.allLocalities[t]&&(e.allLocalities[t].selected=!0)}))}}),Ae={localitiesForCurrentSeason(e,t,r,a){return a.currentSeasonId&&e.localitiesPerSeason[a.currentSeasonId]||{}},allLocalities(e){return e.allLocalities},localitiesPerSeason(e){return e.localitiesPerSeason},selectedLocalities(e,t,r,a){return a.currentSeason?Object.values(t.localitiesForCurrentSeason).filter((e=>e.selected)):[]},selectedLocalityIds(e,t){return t.selectedLocalities.map((e=>e.id))},selectedLocalityIdsSet(e,t){return new Set(t.selectedLocalityIds)}},$e={getLocalities(e){return xe(this,arguments,void 0,(function*(e,t=null){if(t=t||e.rootGetters.currentSeasonId,!e.rootGetters.currentFarmId||!t||e.getters.localitiesPerSeason[t])return;const r=yield(0,i.H2)("GET",`/farm/${e.rootGetters.currentFarmId}/season/${t}/localities/`);e.commit("setLocalities",{localities:r,seasonId:t})}))}},Fe={strict:!0,state:Oe(),getters:Ae,mutations:ke,actions:$e};var De=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};const je=[{name:"dummy_notifications",description:"Will show buttons acting as notification triggers."},{name:"show_any_potential_map",description:"Will show a random potential map for every parcel"}];function Ee(){const e={};return je.forEach((t=>{e[t.name]={description:t.description,active:!1}})),e}function Ne(){return{featureFlags:Ee()}}const Te=bt({setFeatureFlag(e,{flag:t,active:r}){if(!e.featureFlags[t])return;e.featureFlags[t].active=r;const a={},s=Object.keys(e.featureFlags);s.forEach((t=>{a[t]=e.featureFlags[t].active})),window.localStorage.setItem("featureFlags",JSON.stringify(a))}}),Le={featureFlags(e){return e.featureFlags}},Me={restoreFeatureFlags(e){return De(this,void 0,void 0,(function*(){if(!A.KJ.VUE_APP_FEATURE_FLAGS)return;let t=(0,m.o$)(window.localStorage.getItem("featureFlags"));t&&Object.keys(t).forEach((r=>{const a=t[r];e.commit("setFeatureFlag",{flag:r,active:a})}))}))}},Re={strict:!0,state:Ne(),getters:Le,mutations:Te,actions:Me};var qe=r(9724),Ue=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};function Be(){return{currentPosition:null,locationPermissionStatus:null,_locationWatcherId:null,_locationSubscriptions:[],_locationSubscriptionAI:1,_positionPromise:null}}const He={enableHighAccuracy:!0};function Ge(){return new Promise(((e,t)=>navigator.geolocation.getCurrentPosition(e,t,He)))}const Ye=bt({clearLocation(e){const t=Be();Object.keys(t).forEach((r=>{e[r]=t[r]}))},setCurrentPosition(e,t){e.currentPosition=t},setLocationPermissionStatus(e,t){e.locationPermissionStatus=t},set_locationWatcherId(e,t){e._locationWatcherId=t},set_locationSubscriptions(e,t){e._locationSubscriptions=t},set_locationSubscriptionAI(e,t){e._locationSubscriptionAI=t},set_positionPromise(e,t){e._positionPromise=t}}),Ve={currentPosition(e){return e.currentPosition},locationPermissionStatus(e){return e.locationPermissionStatus}},We={checkLocationPermission(e){return Ue(this,void 0,void 0,(function*(){let t;try{t=(yield navigator.permissions.query({name:"geolocation"})).state}catch(r){t="unknown"}return e.commit("setLocationPermissionStatus",t),t}))},_watchForPositionChange(e){return Ue(this,void 0,void 0,(function*(){e.state._locationWatcherId&&navigator.geolocation.clearWatch(e.state._locationWatcherId);
1const t=Ge();e.commit("set_positionPromise",t);const r=yield t;e.commit("set_positionPromise",null),e.commit("setCurrentPosition",r),e.commit("setLocationPermissionStatus","granted");const a=navigator.geolocation.watchPosition((t=>{e.commit("setCurrentPosition",t),e.commit("setLocationPermissionStatus","granted")}),(t=>{(0,m.vV)(t),e.commit("setCurrentPosition",null),e.commit("setLocationPermissionStatus","denied")}),He);e.commit("set_locationWatcherId",a)}))},subscribeLocationWatch(e,t){return Ue(this,void 0,void 0,(function*(){const r=null===t||void 0===t?void 0:t.forced,a=e.state._locationSubscriptionAI;if(e.commit("set_locationSubscriptionAI",a+1),!e.state._locationWatcherId){const t=e.state.locationPermissionStatus||(yield e.dispatch("checkLocationPermission"));if(!("granted"==t||["unknown","prompt"].includes(t)&&r))return null;try{const t=e.state._positionPromise;t?yield t:yield e.dispatch("_watchForPositionChange")}catch(n){return null}}const s=[...e.state._locationSubscriptions];return s.push(a),e.commit("set_locationSubscriptions",s),a}))},unsubscribeLocationWatch(e,t){return Ue(this,void 0,void 0,(function*(){if(null==t)return;const r=[...e.state._locationSubscriptions],a=r.findIndex((e=>e==t));a>=0&&r.splice(a,1),e.commit("set_locationSubscriptions",r),0==r.length&&null!=e.state._locationWatcherId&&(navigator.geolocation.clearWatch(e.state._locationWatcherId),e.commit("set_locationWatcherId",null),e.commit("setCurrentPosition",null))}))}},ze={state:Be(),mutations:Ye,getters:Ve,actions:We};var Ke=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};function Je(){return{yieldDataType:"yield",selectedCrop:"maize",counties:{},selectedCountyCode:null,selectedUatIndex:null}}const Xe=bt({clearYield(e){const t=Je();Object.keys(t).forEach((r=>{e[r]=t[r]}))},setYieldCounty(e,{countyCode:t,data:r}){e.counties=Object.assign(Object.assign({},e.counties),{[t]:r})},setYieldSelectedCounty(e,t){e.selectedCountyCode=t},setYieldSelectedUat(e,t){e.selectedUatIndex=t},setYieldDataType(e,t){e.yieldDataType=t},setYieldSelectedCrop(e,t){e.selectedCrop=t}}),Ze={selectedYieldCountyCode(e){return e.selectedCountyCode},selectedYieldCounty(e){return null!==e.selectedCountyCode&&e.counties[e.selectedCountyCode]},selectedYieldUatIndex(e){return e.selectedUatIndex},selectedYieldUat(e,t){var r;return null!==e.selectedUatIndex&&(null===(r=t.selectedYieldCounty)||void 0===r?void 0:r.uats[e.selectedUatIndex])},yieldDataType(e){return e.yieldDataType},yieldSelectedCrop(e){return e.selectedCrop},yieldPredictionForYear(e,t){var r;return null===(r=t.selectedYieldCounty)||void 0===r?void 0:r.predictionForYear},yieldLastUpdated(e,t){var r;return new Date(null===(r=t.selectedYieldCounty)||void 0===r?void 0:r.lastUpdated)}},Qe={getAndSetCounty(e,t){return Ke(this,arguments,void 0,(function*(e,t,r=!1){if(r||!e.state.counties[t])try{const r=yield fetch(`/yield/counties/${t}.json`),a=yield r.json();a.uats.sort(((e,t)=>e.name.localeCompare(t.name))),e.commit("setYieldCounty",{countyCode:t,data:a})}catch(a){return!1}return e.commit("setYieldSelectedCounty",t),!0}))}},et={strict:!0,state:Je(),getters:Ze,mutations:Xe,actions:Qe};var tt=r(392);function rt(){return{selectedLocality:null,parcelIndex:{},isSelecting:!1,overlappedParcels:{},selectedCrop:null,mapDrawStep:"parcel",selectedCountry:tt.J.RO,editingLocked:!1}}const at=bt({clearMapDraw(e){const t=rt();Object.keys(t).forEach((r=>{e[r]=t[r]}))},setMapDrawSelectedLocality(e,t){e.selectedLocality=t},setMapDrawParcelIndex(e,t){e.parcelIndex=t},updateMapDrawParcel(e,t){e.parcelIndex[t.id]=t}
1,removeMapDrawParcel(e,t){const r=Object.assign({},e.parcelIndex);delete r[t],e.parcelIndex=r},setMapDrawIsSelecting(e,t){e.isSelecting=t,t||(e.parcelIndex=Object.fromEntries(Object.entries(e.parcelIndex).map((([e,t])=>[e,Object.assign(Object.assign({},t),{selected:!1})]))))},setMapDrawOverlappedParcels(e,t){e.overlappedParcels=t},setMapDrawSelectedCrop(e,t){e.selectedCrop=t},setMapDrawStep(e,t){e.mapDrawStep=t},setMapDrawSelectedCountry(e,t){e.selectedCountry=t},setMapDrawEditingLocked(e,t){e.editingLocked=t}}),st={mapDrawSelectedLocality(e){return e.selectedLocality},mapDrawParcelIndex(e){return e.parcelIndex},mapDrawParcels(e){return Object.values(e.parcelIndex)},mapDrawIsSelecting(e){return e.isSelecting},mapDrawSelectedParcels(e,t){return t.mapDrawParcels.filter((e=>e.selected))},mapDrawOverlappedParcels(e){return e.overlappedParcels},mapDrawSelectedCrop(e){return e.selectedCrop},mapDrawStep(e){return e.mapDrawStep},mapDrawSelectedCountry(e){return e.selectedCountry},mapDrawEditingLocked(e){return e.editingLocked}},nt={strict:!0,state:rt(),mutations:at,getters:st};var it=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};const ot={agriculturalWorks:[]},lt=bt({setAgriculturalWorks(e,t){e.agriculturalWorks=t},clearAgriculturalWorks(e){e.agriculturalWorks=[]}}),ct={getAgriculturalWorks(e){return it(this,void 0,void 0,(function*(){const t=yield(0,i.H2)("GET","/agricultural-works");e.commit("setAgriculturalWorks",t.results)}))}},dt={agriculturalWorks(e){return e.agriculturalWorks}},ut={state:ot,mutations:lt,actions:ct,getters:dt};var pt=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};function mt(){return{}}a.Ay.use(s.Ay);const ht=bt({clearBase(e){const t=mt();Object.keys(t).forEach((r=>{e[r]=t[r]}))}}),ft={},vt={clearState(e){return pt(this,void 0,void 0,(function*(){e.commit("clearMap"),e.commit("clearBase"),e.commit("clearUser"),e.commit("clearCrops"),e.commit("clearDates"),e.commit("clearFarms"),e.commit("clearParcels"),e.commit("clearRasters"),e.commit("clearSeasons"),e.commit("clearLocalities"),e.commit("clearNotes"),e.commit("clearAgriculturalWorks")}))},setDateFromSeason(e,t){return pt(this,void 0,void 0,(function*(){yield e.dispatch("setSelectedDateAndSeason",{date:(0,m.__)(t,e.rootGetters.availableDates)})}))},setSelectedDateAndSeason(e,t){return pt(this,arguments,void 0,(function*(e,{date:t,seasonId:r}){const a=e.rootGetters.seasons[r]||(0,m.aG)(e.rootGetters.seasons,t).filter((e=>e.parcels_count>0))[0],s=a?a.id:null;(0,m.vw)(e.rootGetters.selectedDate,t)||e.commit("setSelectedDate",t),e.rootGetters.currentSeasonId!==s&&(e.commit("setCurrentSeasonId",s),s&&(yield Promise.all([e.dispatch("getCrops"),e.dispatch("getLocalities"),e.dispatch("getParcelsForCurrentSeason"),e.dispatch("getAgriculturalWorks")])))}))},getInitialData(e){return pt(this,void 0,void 0,(function*(){try{yield e.dispatch("getCurrentUser")}catch(t){if(401!==t.statusCode)throw t}e.rootGetters.user.email?yield Promise.all([e.dispatch("getFarms"),e.dispatch("getAllCrops")]):(yield e.dispatch("getDemoFarmOnly"),window.localStorage.removeItem("userPreferences"),window.localStorage.removeItem("_userPreferences")),e.dispatch("restoreFeatureFlags"),e.dispatch("getNotesPreferences")}))}},gt=new s.Ay.Store({strict:!0,state:mt(),mutations:ht,actions:vt,getters:ft,modules:{map:n.A,mapDraw:nt,user:p,crops:C,dates:k,farms:U,parcels:z.Ay,rasters:oe,meteo:ee,seasons:he,internal:Ie,localities:Fe,sidebar:W,featureFlags:Re,notes:qe.A,yieldOgor:et,location:ze,agriculturalWorks:ut}});gt.watch((e=>e.parcels.selectedParcel),(e=>{gt.dispatch("fetchMeteoHistory",e)}));const yt=gt;function bt(e){return e}},1855:(e,t,r)=>{e.exports=r.p+"img/journal-logo.7243770a.png"},1856:(e,t,r)=>{r.d(t,{A:()=>w});var a=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("modal",{ref:"modal",attrs:{header:e.$gettext("Set crop")},on:{close:function(t){return e.$emit("close")}},scopedSlots:e._u([{key:"body",fn:function(){return[t("div",{staticClass:"input-field"},[t("div",{staticClass:"input-title"},[t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Crop")])]),t("multi-select",{attrs:{options:e.crops,theme:"field",label:e.getCropLabelWithApia,searchable:"","group-label":"group","show-group-names":""},on:{input:e.onCropChange},model:{value:e.selectedCrop,callback:function(t){e.selectedCrop=t},expression:"selectedCrop"}})],1),e.showDates?t("div",{key:"sow-date",staticClass:"input-field"},[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"input-title"},[e._v("Sow date")]),t("custom-date-input",{attrs:{min:e.minSowDate,max:e.maxSowDate,"default-date":e.estimatedSowDate},scopedSlots:e._u([{key:"placeholder",fn:function(){return[t("div",[e._v(e._s(e.getDatePlaceholder(e.sowDate,e.estimatedSowDate)))])]},proxy:!0}],null,!1,117414401),model:{value:e.sowDate,callback:function(t){e.sowDate=t},expression:"sowDate"}}),!e.sowDate&&e.estimatedSowDate?t("div",{staticClass:"input-help muted"},[t("i",{directives:[{name:"translate",rawName:"v-translate"}]}
1,[e._v("*Estimated date.")])]):e._e()],1):e._e(),e.showDates?t("div",{key:"harvest-date",staticClass:"input-field"},[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"input-title"},[e._v("Harvest date")]),t("custom-date-input",{attrs:{min:e.minHarvestDate,max:e.maxHarvestDate,"default-date":e.estimatedHarvestDate},scopedSlots:e._u([{key:"placeholder",fn:function(){return[t("div",[e._v(" "+e._s(e.getDatePlaceholder(e.harvestDate,e.estimatedHarvestDate))+" ")])]},proxy:!0}],null,!1,1378026497),model:{value:e.harvestDate,callback:function(t){e.harvestDate=t},expression:"harvestDate"}}),!e.harvestDate&&e.estimatedHarvestDate?t("div",{staticClass:"input-help muted"},[t("i",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("*Estimated date.")])]):e._e()],1):e._e()]},proxy:!0},{key:"footer",fn:function(){return[t("button",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"action-button fill",attrs:{disabled:!e.formValid},on:{click:function(t){return e.setCrops()}}},[e._v("Set")])]},proxy:!0}])})},s=[],n=(r(1339),r(3725),r(2598),r(9838),r(5019),r(4099)),i=r(5208),o=r(8517),l=r(9442),c=r(4585),d=r(5289),u=r(4820),p=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},m=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};const h=(0,l.cn)(["allCropGroups","currentFarmId","currentSeasonId","currentSeason","parcelIndex"]);let f=class extends((0,d.vE)(d.Y5,h)){constructor(){super(...arguments),Object.defineProperty(this,"$emit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"modal",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"$props",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"parcelIds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"selectedCrop",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"sowDate",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"harvestDate",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"estimatedSowDate",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"estimatedHarvestDate",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"getCropLabelWithApia",{enumerable:!0,configurable:!0,writable:!0,value:l.O3})}get crops(){const e=Object.values(this.allCropGroups).map((e=>{var t;const r=null===(t=e.system_links)||void 0===t?void 0:t.find((e=>"APIA"===e.name)),a=(null===r||void 0===r?void 0:r.crop_code)||null;return{id:[...e.cropIds][0],name:e.name[this.$language.current],group:"null"==e.id?this.$gettext("Unspecified crop"):"",system_links:e.system_links||[],apia_code:a,title:(0,l.ni)(a)}}));e.slice(0,5).forEach((e=>{e.group=this.$gettext("Frequently used")}));let t=e.pop();return e.splice(0,0,t),e}get minSowDate(){return(0,l.Yq)(this.currentSeason.start_date)}get maxSowDate(){const e=(0,l.Yq)(this.currentSeason.end_date);return this.getDateMinMax(e,this.harvestDate,!1)}get minHarvestDate(){const e=(0,l.Yq)(this.currentSeason.start_date);return this.getDateMinMax(e,this.sowDate,!1)}get maxHarvestDate(){const e=(0,l.Yq)(this.currentSeason.end_date);return this.getDateMinMax(e,this.sowDate,!1)}get showDates(){return this.selectedCrop&&"null"!==this.selectedCrop.id}get formValid(){return!!this.selectedCrop}onCropChange(e){return m(this,void 0,void 0,(function*(){var t,r,a;const s=this.parcelIds[0];if("null"==e.id)return this.estimatedSowDate=null,this.estimatedHarvestDate=null,this.sowDate=null,void(this.harvestDate=null);const n=null===(a=null===(r=null===(t=e.system_links)||void 0===t?void 0:t.find((e=>"APIA"===(null===e||void 0===e?void 0:e.name))))||void 0===r?void 0:r.name)||void 0===a?void 0:a.toLowerCase();if(!n)return;const i=yield(0,o.H2)("GET",`/farm/${this.currentFarmId}/season/${this.currentSeasonId}/parcel/${s}/crop_dates_estimate/${n}/${e.id}/`);this.estimatedSowDate=i.start_date,this.estimatedHarvestDate=i.end_date,this.sowDate=null,this.harvestDate=null}))}getDatePlaceholder(e,t){const r=e||t;if(!r)return this.$gettext("Select a date...");let a=new Date(r).toLocaleDateString(this.$language.current,{day:"numeric",month:"long",year:"numeric"});return e||(a+="*"),a}setCrops(){return m(this,void 0,void 0,(function*(){let e=this.parcelIds.map((e=>this.parcelIndex[e]));const t=e.filter((e=>1==e.crop_intervals.length));t.length>0&&(confirm(this.$gettextInterpolate(this.$gettext("%{ nr } out of %{ total } parcels already have the crop set. Do you want to replace it?"),{nr:t.length,total:e.length}))||(e=e.filter((e=>1!=e.crop_intervals.length)))),e=e.filter((e=>e.crop_intervals.length<2));const r=e.map((e=>e.id));try{yield(0,o.H2)("POST",`/farm/${this.currentFarmId}/season/${this.currentSeasonId}/replace_parcels_interval/`,{},{parcels:r,crop:"null"==this.selectedCrop.id?null:this.selectedCrop.id,interval:{lower:this.sowDate||this.estimatedSowDate,upper:this.harvestDate||this.estimatedHarvestDate}}),this.notify({type:"success",icon:"spa",text:this.$gettextInterpolate(this.$ngettext("Crop set for %{ n } parcel","Crop set for %{ n } parcels",r.length),{n:r.length})}),this.$emit("change",e.map((e=>Object.assign(Object.assign({},e),{crop_intervals:[{crop_id:this.selectedCrop.id,crop:this.selectedCrop,interval:{lower:this.sowDate||this.estimatedSowDate,upper:this.harvestDate||this.estimatedHarvestDate,bounds:"[)"}}]})))),this.$store.commit("clearParcelOverlapCache"),this.modal.closeModal()}catch(a){(0,l.vV)(a),this.notify({type:"error",text:this.$gettext("Unable to set parcel crops")})}}))}getDateMinMax(e,t,r=!0){if(!e||!t)return e||t;const a=[e,t].sort();return r?a[0]:a[1]}};p([(0,u.oS)()],f.prototype,"modal",void 0),p([(0,u.kv)({type:Array,required:!0})],f.prototype,"parcelIds",void 0),f=p([(0,d.uA)({name:"SetCropsModal",components:{MultiSelect:i.A,Modal:n.A,CustomDateInput:c.A}})],f);const v=f,g=v;var y=r(1656),b=(0,y.A)(g,a,s,!1,null,"09edcd9c",null);const w=b.exports},1894:(e,t,r)=>{e.exports=r.p+"img/yield.f5a97ed9.svg"},2448:(e,t,r)=>{r.d(t,{A:()=>v});var a=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"virtual-scroll",style:{height:e.height?`${e.height}px`:null,overflow:"container"==e.mode?"auto":""}}
1,[e.itemCount>0?t("div",{staticClass:"viewport",style:{height:e.totalHeight+"px"}},[t("div",{style:{willChange:"transform",transform:`translateY(${e.offsetY}px)`}},[e._l(e.visibleChildren,(function(t){return[e._t("item",null,{item:t})]}))],2)]):e._e()])},s=[],n=r(5289),i=r(7334),o=r(4820),l=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};let c=class extends((0,n.vE)(n.Y5)){constructor(){super(...arguments),Object.defineProperty(this,"$scopedSlots",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"$props",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"items",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"getItemKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"getItemHeight",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"itemCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"renderAhead",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mode",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"$el",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"scrollTop",{enumerable:!0,configurable:!0,writable:!0,value:0}
1),Object.defineProperty(this,"scrollContainer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"computedHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"animationFrame",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}mounted(){if("container"==this.mode)this.scrollContainer=this.$el,this.computedHeight=this.height;else if("parent"==this.mode){let e=this.$el.parentElement;while(e.classList.contains("skip-virtual-scroll-parent"))e=e.parentElement;this.scrollContainer=e,this.computedHeight=this.scrollContainer.clientHeight}this.addScrollListener()}beforeDestroy(){window.removeEventListener("scroll",this.onScroll)}get childPositions(){let e=[0];for(let t=1;t<this.itemCount;t++)e.push(e[t-1]+this.getItemHeight(this.items[t-1]));return e}get totalHeight(){return this.childPositions[this.itemCount-1]+this.getItemHeight(this.items[this.itemCount-1])}get firstVisibleNode(){return u(this.scrollTop,this.childPositions,this.itemCount)}get startNode(){return Math.max(0,this.firstVisibleNode-this.renderAhead)}get lastVisibleNode(){return p(this.childPositions,this.firstVisibleNode,this.itemCount,this.computedHeight)}get endNode(){return Math.min(this.itemCount-1,this.lastVisibleNode+this.renderAhead)}get offsetY(){return this.childPositions[this.startNode]}get visibleChildren(){return this.items.slice(this.startNode,this.endNode+1)}addScrollListener(){this.computeScrollTop(),this.scrollContainer.addEventListener("scroll",(0,i.debounce)(this.onScroll,100))}computeScrollTop(){let e=this.scrollContainer.scrollTop;"parent"==this.mode&&(e-=this.$el.offsetTop),this.scrollTop=e>0?e:0}onScroll(){this.animationFrame&&cancelAnimationFrame(this.animationFrame),this.animationFrame=requestAnimationFrame((()=>{this.computeScrollTop()}))}};l([(0,o.kv)(Array)],c.prototype,"items",void 0),l([(0,o.kv)(Function)],c.prototype,"getItemKey",void 0),l([(0,o.kv)(Function)],c.prototype,"getItemHeight",void 0),l([(0,o.kv)(Number)],c.prototype,"itemCount",void 0),l([(0,o.kv)({type:Number,required:!1,default:null})],c.prototype,"height",void 0),l([(0,o.kv)({type:Number,required:!1,default:20})],c.prototype,"renderAhead",void 0),l([(0,o.kv)({type:String,required:!1,default:"container"})],c.prototype,"mode",void 0),c=l([(0,n.uA)({name:"VirtualScroll"})],c);const d=c;function u(e,t,r){let a=0,s=r-1;if(0!=r){while(s!==a){const r=Math.floor((s-a)/2+a);if(t[r]<=e&&t[r+1]>e)return r;if(r===a)return s;t[r]<=e?a=r:s=r}return r}}function p(e,t,r,a){let s;for(s=t;s<r;s++)if(e[s]>e[t]+a)return s;return s}const m=d;var h=r(1656),f=(0,h.A)(m,a,s,!1,null,"0b058bae",null);const v=f.exports},2481:(e,t,r)=>{r.d(t,{Q:()=>o});var a=r(9442);function s(e,t){if(!e.selectedCropId)return!0;const r=(0,a.Ay)(t.crop_intervals,e.selectedDate,e.currentSeason);return r?e.allCrops[e.selectedCropId].cropIds.has(r):"null"===e.selectedCropId}function n(e,t){return 0===e.selectedLocalityIdsSet.size||e.selectedLocalityIdsSet.has(t.localityId)}function i(e,t){return!e.parcelSearchText||(0,a.WW)((0,a.sl)(t.locality||"")+" "+(0,a.sl)(t.reference||""),e.unaccentSearchText)}function o(e,t){return s(e,t)&&n(e,t)&&i(e,t)}},2727:(e,t,r)=>{r.d(t,{A:()=>l});r(3725),r(9838);var a=r(9442),s=r(5471),n=r(6599),i=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};let o=class extends s.Ay{constructor(){super(...arguments),Object.defineProperty(this,"errors",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}clearErrors(){Object.keys(this.errors).forEach((e=>{this.errors[e]=""}))}setErrors(e){const t=e;t.details?"string"===typeof t.details?this.errors.error=t.details:Object.entries(t.details).forEach((e=>{this.errors[e[0]]=e[1].join(" ")})):t.detail||t.error?this.errors.error=t.detail||t.error:(this.errors.error=this.$gettext("Unknown error."),(0,a.vV)(t))}};o=i([n.Ay],o);const l=o},2997:(e,t,r)=>{e.exports=r.p+"img/soil-analysis.3847689e.svg"},3591:(e,t,r)=>{e.exports=r.p+"img/grid.c3bbb90a.svg"},3659:(e,t,r)=>
1{var a=r(5471),s=r(2024),n=r(500),i=r(8630),o=r.n(i),l=r(9463),c=r.n(l),d=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{attrs:{id:"app"}},[t("ogor-notifications"),e.dataLoaded?[e.showPwaPrompt?t("pwa-install-prompt",{attrs:{"deffered-install-prompt":e.defferedInstallPrompt},on:{dismiss:e.onPwaPromptDismissed}}):e.showYieldNoticePrompt?t("last-season-yield-notice-prompt",{on:{dismiss:e.onYieldNoticeDismissed}}):e._e(),e.user.is_staff?t("div",{staticClass:"top-banner staff-notification small"},[t("span",{staticClass:"material-icons"},[e._v("settings")]),t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Logged in as staff user")])]):e._e(),e.user.is_hijacked?t("hijack-notification",{staticClass:"hide-md"}):e._e(),t("vue-progress-bar"),t("cookie-consent"),t("downtime-notice"),t("div",{staticClass:"router-view"},[e.errorCode?e._e():t("router-view"),e.errorCode?t("error-page",{attrs:{"error-code":e.errorCode}}):e._e()],1),e.showDemoFarmPopup?t("demo-farm-modal"):e._e(),e.isLicenseSuspended?e._e():t("policy-update-popup"),e.showPaywallModal?t("pay-wall"):e._e(),t("app-sidebar-transition"),t("transition",{attrs:{name:"slide-left"}},[e.currentFarmId&&e.currentSeasonId&&e.showSearchSidebar?t("search-sidebar"):e._e()],1),e.showChangeParcelCrop?t("change-parcel-crop",{on:{close:function(t){e.showChangeParcelCrop=!1}}}):e._e(),e.showSetCropsModal?t("set-crops-modal",{attrs:{"parcel-ids":e.selectedParcelIds},on:{change:e.onCropsChanged,close:function(t){e.showSetCropsModal=!1}}}):e._e(),e.showJournalDialog?t("journal-dialog",{on:{close:function(t){e.showJournalDialog=!1}}}):e._e(),t("DialogManager")]:e._e()],2)},u=[],p=(r(3725),r(9471),r(2598),r(9838),r(1339),r(6818),r(4510)),m=r(8045),h=r(9442),f=r(8119),v=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"page-expand"},[t("img",{attrs:{src:r(4546)}}),t("p",{staticClass:"display-2"},[e._v(" "+e._s(e.errorMessage)+" ")]),t("p",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"muted click-me min-target-size",on:{click:e.goHome}},[e._v("Back to ogor.ro")])])},g=[],y=r(5289);const b=(0,h.g_)({errorCode:{type:Number,required:!0}});class w extends((0,y.vE)(y.Y5,b)){constructor(){super(...arguments),Object.defineProperty(this,"errorMessage",{enumerable:!0,configurable:!0,writable:!0,value:""})}created(){switch(this.errorCode){case 403:this.errorMessage=this.$gettext("You don't have access to this link");break;default:(0,h.OG)(`Unknown error: ${this.errorCode}`),this.errorMessage=this.$gettext("That's embarrassing, something went wrong. We're looking into it.")}}goHome(){window.location.href=window.location.origin}}const _=w;var C=r(1656),P=(0,C.A)(_,v,g,!1,null,"e814e3be",null);const S=P.exports;var I=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.user.is_hijacked?t("div",[e.showBanner?t("div",{key:"top-banner",staticClass:"top-banner hijack-notification small"},[t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Impersonating")]),e.user.name?t("span",[e._v(e._s(e.user.name))]):e._e(),t("span",[e._v("·")]),t("span",{staticClass:"material-icons"},[e._v("mail_outline")]),t("a",{attrs:{href:"mailto:"+e.user.email,target:"_blank"}},[e._v(" "+e._s(e.user.email)+" ")]),e.user.phone?t("span",{staticClass:"material-icons"},[e._v("phone")]):e._e(),e.user.phone?t("a",{attrs:{href:"tel:"+e.user.phone,target:"_blank"}},[e._v(" "+e._s(e.user.phone)+" ")]):e._e(),t("span",[e._v("·")]),t("span",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"click-me",on:{click:function(t){return e.release()}}},[e._v(" Stop impersonating ")]),t("span",{staticClass:"material-icons click-me",on:{click:function(t){return e.release()}}},[e._v(" close ")]),t("div",{staticClass:"hide-banner",on:{click:e.toggleBanner}},[t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Hide")]),t("span",{staticClass:"material-icons"},[e._v("expand_less")])])]):t("div",{key:"banner-toggle-on",staticClass:"show-banner small"},[t("span",{staticClass:"admin-menu-item material-icons",attrs:{"data-tippy-content":e.user.name}},[e._v(" person ")]),t("a",{staticClass:"admin-menu-item material-icons",attrs:{href:"mailto:"+e.user.email,target:"_blank","data-tippy-content":e.user.email}},[e._v(" mail_outline ")]),e.user.phone?t("a",{staticClass:"admin-menu-item material-icons",attrs:{href:"tel:"+e.user.phone,target:"_blank","data-tippy-content":e.user.phone}}
1,[e._v(" phone ")]):e._e(),t("span",{staticClass:"admin-menu-item material-icons",attrs:{"data-tippy-content":e.$gettext("Stop impersonating")},on:{click:e.release}},[e._v(" close ")]),t("span",{staticClass:"admin-menu-item material-icons",attrs:{"data-tippy-content":e.$gettext("Show")},on:{click:e.toggleBanner}},[e._v(" expand_more ")])])]):e._e()},x=[],O=r(6599),k=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},A=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};const $=(0,h.cn)(["user"]);let F=class extends((0,O.vE)(y.Y5,$)){constructor(){super(...arguments),Object.defineProperty(this,"showBanner",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"clickTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clickCount",{enumerable:!0,configurable:!0,writable:!0,value:0})}created(){this.showBanner=(0,h.oV)(window.localStorage.getItem("showBanner"),!0),this.initTooltips(),document.addEventListener("click",this.countClick)}destroyed(){document.removeEventListener("click",this.countClick,!0)}release(){return A(this,void 0,void 0,(function*(){(0,h.QC)()}))}toggleBanner(){this.showBanner=!this.showBanner,window.localStorage.setItem("showBanner",this.showBanner.toString()),this.initTooltips()}countClick(){if(clearTimeout(this.clickTimeout),this.clickCount++,5===this.clickCount)return this.clickCount=0,void((0,h.Fr)()&&confirm("Stop impersonating?")&&this.release());this.clickTimeout=window.setTimeout((()=>{this.clickCount=0}),300)}};F=k([(0,y.uA)({name:"HijackNotification"})],F);const D=F,j=D;var E=(0,C.A)(j,I,x,!1,null,"53f93dff",null);const N=E.exports;var T=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.showModal?t("modal",{attrs:{"show-header":!1,"show-footer":!1,"store-key":"demoPopup",store:"localStorage","close-on-click-outside":!1},on:{close:function(t){e.showModal=!1}},scopedSlots:e._u([{key:"body",fn:function({closeModal:a}){return[t("div",{staticClass:"demo-popup"},[t("img",{staticClass:"demo-farm-icon",attrs:{src:r(877),alt:"haystack"}}),t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"large-bold welcome"},[e._v("Welcome to the DEMO farm")]),t("p",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Here you can explore the basic functionalities of the OGOR platform.")]),e.showSecondParagraph?t("p",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"muted"},[e._v("When you have finished exploring the app")]):e._e(),t("add-farm-button",{staticClass:"add-farm",attrs:{via:"demo_farm"}}),t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"action-text explore",on:{click:a}},[e._v("Explore DEMO")])],1)]}}],null,!1,2475984701)}):e._e()},L=[],M=r(4099),R=r(5149),q=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const U=(0,h.cn)(["hasOwnSeasons","farmIds","userEmail"]);let B=class extends((0,y.vE)(y.Y5,U)){constructor(){super(...arguments),Object.defineProperty(this,"showModal",{enumerable:!0,configurable:!0,writable:!0,value:!0})}get showSecondParagraph(){return!this.userEmail||0==this.farmIds.length||!this.hasOwnSeasons}};B=q([(0,y.uA)({name:"DemoFarmModal",components:{AddFarmButton:R.A,Modal:M.A}})],B);const H=B,G=H;var Y=(0,C.A)(G,T,L,!1,null,"6e7874ae",null);
1const V=Y.exports;var W=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.showPopup&&!e.loadingLegalData?t("div",[t("div",{staticClass:"overlay blur"}),t("popup",{attrs:{"show-overlay":!0}},[t("div",{staticClass:"privacy-popup"},[t("div",{staticClass:"heading2 bold",domProps:{innerHTML:e._s(e.headingText)}}),e.latestPrivacy?e._e():t("p",{staticClass:"paragraph"},[t("span",{domProps:{innerHTML:e._s(e.startingWithText(e.privacyPolicy.start_date))}})]),e.latestPrivacy?e._e():t("a",{staticClass:"see-terms link-button min-target-size",attrs:{href:e.apiMediaURL(e.privacyPolicy.file_url),target:"_blank"}},[t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Privacy policy")]),t("span",{staticClass:"muted light"},[e._v("(PDF)")])]),!e.latestPrivacy&&e.privacyPolicy.summary?t("div",{staticClass:"terms-change-summary"},[e._v(" "+e._s(e.privacyPolicy.summary)+" ")]):e._e(),e.latestTOS||e.privacyPolicy.start_date==e.generaltos.start_date?e._e():t("p",{staticClass:"paragraph"},[t("span",{domProps:{innerHTML:e._s(e.startingWithText(e.generaltos.start_date))}})]),e.latestTOS?e._e():t("a",{staticClass:"see-terms link-button min-target-size",attrs:{href:e.apiMediaURL(e.generaltos.file_url),target:"_blank"}},[t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Terms and Conditions of Use")]),t("span",{staticClass:"muted light"},[e._v("(PDF)")])]),!e.latestTOS&&e.generaltos.summary?t("div",{staticClass:"terms-change-summary"},[e._v(" "+e._s(e.generaltos.summary)+" ")]):e._e(),e.user.marketing?e._e():t("div",{staticClass:"separator-dotted"}),e.user.marketing?e._e():t("label",{staticClass:"input-group"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.marketingTick,expression:"marketingTick"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.marketingTick)?e._i(e.marketingTick,null)>-1:e.marketingTick},on:{change:function(t){var r=e.marketingTick,a=t.target,s=!!a.checked;if(Array.isArray(r)){var n=null,i=e._i(r,n);a.checked?i<0&&(e.marketingTick=r.concat([n])):i>-1&&(e.marketingTick=r.slice(0,i).concat(r.slice(i+1)))}else e.marketingTick=s}}}),t("span",{staticClass:"material-icons checkmark"},[e._v("check")]),t("span",[t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("I want to be contacted by OGOR with offers that are useful for me and my crops.")]),t("span",[e._v(" ")]),t("a",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"no-wrap",attrs:{target:"_blank",href:e.apiMediaURL(e.user.latest_marketing_url)}},[e._v("What does this mean?")])])]),t("div",{staticClass:"buttons-area"},[t("button",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"brand-green-button",on:{click:function(t){return e.agreeTerms()}}},[e._v("I agree")]),t("button",{staticClass:"link-button",on:{click:function(t){return e.signOut()}}},[t("span",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"muted"},[e._v("I don't agree")]),t("span",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"muted light"},[e._v("(log out)")])])])])])],1):e._e()},z=[],K=r(8517),J=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.showPopup?t("div",{staticClass:"popup"},[e.showOverlay?t("div",{staticClass:"modal-mask"}):e._e(),t("div",{staticClass:"popup-content",class:e.position},[e.showCloseIcon?t("span",{staticClass:"material-icons close-icon",on:{click:e.dismissPopup}},[e._v(" close ")]):e._e(),e._t("default",null,{dismissPopup:e.dismissPopup})],2)]):e._e()},X=[],Z=r(4820),Q=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};let ee=class extends y.Y5{constructor(){super(...arguments),Object.defineProperty(this,"$props",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showOverlay",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showCloseIcon",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"position",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showPopup",{enumerable:!0,configurable:!0,writable:!0,value:!1})}mounted(){this.showPopup=!0}dismissPopup(){this.showPopup=!1}};Q([(0,Z.kv)({type:Boolean,default:!1})],ee.prototype,"showOverlay",void 0),Q([(0,Z.kv)({type:Boolean,default:!1})],ee.prototype,"showCloseIcon",void 0),Q([(0,Z.kv)({type:String,default:"middle"})],ee.prototype,"position",void 0),ee=Q([(0,y.uA)({name:"Popup"})],ee);const te=ee,re=te;var ae=(0,C.A)(re,J,X,!1,null,"ca89371c",null);const se=ae.exports;var ne=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},ie=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};let oe=class extends((0,y.vE)(y.Y5,(0,h.cn)(["user"]))){constructor(){super(...arguments),Object.defineProperty(this,"privacyPolicy",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"generaltos",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"loadingLegalData",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"marketingTick",{enumerable:!0,configurable:!0,writable:!0,value:!1})}created(){this.loadLegalData()}get latestPrivacy(){return this.user.privacy}get latestTOS(){return this.user.generaltos}get showPopup(){return this.user&&this.user.id&&(!this.latestPrivacy||!this.latestTOS)&&"oauth"!=this.$route.name}get headingText(){return this.$gettext("<strong>
1We need your consent</strong> to continue using OGOR")}showPopupChanged(){this.loadLegalData()}loadLegalData(){return ie(this,void 0,void 0,(function*(){this.showPopup&&(this.loadingLegalData=!0,this.latestPrivacy||(this.privacyPolicy=yield(0,K.H2)("GET",`${f.Sw}/legal/privacy/`)),this.latestTOS||(this.generaltos=yield(0,K.H2)("GET",`${f.Sw}/legal/generaltos/`)),this.loadingLegalData=!1)}))}startingWithText(e){return this.$gettextInterpolate(this.$gettext("Starting with <strong>%{ date }</strong>, the following come into force:"),{date:this.dateFormated(e)})}dateFormated(e){return new Date(e).toLocaleDateString(this.$language.current,{month:"long",day:"numeric",year:"numeric"})}agreeTerms(){let e=this.marketingTick?{marketing:!0}:{};(0,K.H2)("PATCH",`${f.Sw}/auth/user/`,{},Object.assign({privacy:!0,generaltos:!0},e)).then((e=>{this.$store.commit("setCurrentUser",e),this.notify({type:"success",text:this.$gettext("Terms accepted.")}),window.location.reload()})).catch((()=>{this.notify({type:"warning",text:this.$gettext("Something went wrong.")})}))}signOut(){return ie(this,void 0,void 0,(function*(){yield(0,K.je)(),this.$store.commit("clearUser"),yield this.$store.dispatch("clearState")}))}};ne([(0,Z.ox)("showPopup")],oe.prototype,"showPopupChanged",null),oe=ne([(0,y.uA)({name:"PrivacyPolicyPopup",components:{Popup:se}})],oe);const le=oe,ce=le;var de=(0,C.A)(ce,W,z,!1,null,"2f3ed10f",null);const ue=de.exports;var pe=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.dialogDismissed||!e.trackersEnabled||e.userEmail?e._e():t("div",{staticClass:"cookie-consent"},[t("popup",{attrs:{position:"bottom"}},[t("div",{staticClass:"cookie-consent-bar"},[t("safe-area",[t("p",{staticClass:"main-paragraph"},[t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("We use cookies for functional and marketing purposes. ")]),t("br",{staticClass:"hide-sm"}),t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("More about")]),t("span",[e._v(" ")]),t("router-link",{attrs:{to:"/legal/cookie"}},[t("span",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"min-target-size link"},[e._v("the Cookie Policy")])])],1),t("div",{staticClass:"button-area"},[t("button",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"inverted-button",on:{click:e.acceptCookies}},[e._v("Accept cookies")]),t("button",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"inverted-button",on:{click:e.declineCookies}},[e._v("Decline")])])])],1)])],1)},me=[],he=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};let fe=class extends((0,y.vE)(y.Y5,(0,h.cn)(["userEmail"]))){constructor(){super(...arguments),Object.defineProperty(this,"dialogDismissed",{enumerable:!0,configurable:!0,writable:!0,value:document.cookie.includes("cookie_consent=")})}get trackersEnabled(){return"true"===f.KJ.VUE_APP_ENABLE_TRACKERS}get todayDate(){return(new Date).toDateString()}get cookieMaxAge(){return 47304e4}acceptCookies(){document.cookie=`cookie_consent=YES+${this.todayDate}; max-age=${this.cookieMaxAge}`,window.location.reload()}declineCookies(){document.cookie=`cookie_consent=NO+${this.todayDate}; max-age=${this.cookieMaxAge}`,this.dialogDismissed=!0}};fe=he([(0,y.uA)({name:"CookieConsent",components:{Popup:se}})],fe);const ve=fe,ge=ve;var ye=(0,C.A)(ge,pe,me,!1,null,"23c944b2",null);const be=ye.exports;var we=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.dismiss?e._e():t("modal",{ref:"modal",attrs:{"show-header":!1,"show-footer":!e.isSuspended&&!e.selectedPlan&&!e.confirmedPlan,"modal-size":e.modalSize,"modal-type":"separated-footer","mobile-mode":"drawer","blur-background":e.isSuspended,"close-on-click-outside":!1},on:{close:function(t){e.dismiss=!0}},scopedSlots:e._u([{key:"body",fn:function(){return[e.loading?t("div",{staticClass:"loading-layer"}
1,[t("loading")],1):e._e(),e.isSuspended?t("suspended-step"):t("content-transition",[e.confirmedPlan||e.selectedPlan?e.confirmedPlan?e.payByCard?t("card-payment",{attrs:{license:e.confirmedPlan,"data-index":"3"},on:{"po-payment":e.switchToPo}}):t("third-step",{attrs:{"data-index":"2"}}):t("second-step",{attrs:{"latest-marketing-terms":e.latestMarketingTerms,"data-index":"1"},on:{confirm:e.confirmPlanToAPI},model:{value:e.selectedPlan,callback:function(t){e.selectedPlan=t},expression:"selectedPlan"}}):t("first-step",{attrs:{offer:e.offer,"data-index":"0"},on:{close:e.decideLater},model:{value:e.selectedPlan,callback:function(t){e.selectedPlan=t},expression:"selectedPlan"}})],1)]},proxy:!0},{key:"footer",fn:function(){return[e.userLicenseIsActive?t("safe-area",[t("div",{staticClass:"action-text text-center decide-later-footer whitespace-insert",on:{click:e.decideLater}},[t("span",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"text-bold"},[e._v(" Decide later ")]),t("span",{directives:[{name:"translate",rawName:"v-translate",value:{n:e.daysLeft},expression:"{ n: daysLeft }"}],attrs:{"translate-plural":"(%{ n } days free)","translate-n":e.daysLeft}},[e._v(" (%{ n } day free) ")])])]):t("div",{staticClass:"need-help-footer text-bold"},[t("span",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"muted hide-md"},[e._v(" Need help? ")]),t("a",{attrs:{href:e.getOGORPhoneNumberLink(),target:"_blank",rel:"noopener noreferrer"}},[e._v(" "+e._s(e.getOGORPhoneNumber())+" ")]),t("a",{attrs:{href:"mailto:[email protected]",target:"_blank",rel:"noopener noreferrer"}},[e._v(" [email protected] ")])])]},proxy:!0}],null,!1,1961203326)})},_e=[],Ce=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"paywall-container"},[e.offer?e._e():t("div",{staticClass:"loading-layer full-opacity"},[t("loading")],1),t("div",{staticClass:"heading2 bold text-center"},[t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v(" Available plans for ")]),t("span",{staticClass:"brand-green-text"},[e._v(" "+e._s(e.formatFloat(e.offerArea||0,0))+" ha ")])]),e.userLicenseIsActive?t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"small upload-more click-me hide-md action-text",on:{click:e.uploadMore}},[e._v("Upload more parcels")]):e._e(),t("br"),t("div",{staticClass:"available-plan-choices"},e._l(e.availablePlans,(function(r){return t("div",{key:r.key,staticClass:"plan-choice text-bold",class:{disabled:r.disabled},on:{click:function(t){return e.selectPlan(r)}}},[r.disabled?e._e():t("div",{key:"available-title",class:r.colorClass},[t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Pick")]),t("span",[e._v(" "+e._s(r.name))])]),r.disabled?t("div",{key:"disabled-title",class:r.colorClass},[t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Old plan")])]):e._e(),t("div",{staticClass:"choice-price"},[t("span",{staticClass:"larger"},[e._v(" "+e._s(e.currencyNumberFormat.format(r.price))+" ")]),t("span",[e._v(" / "+e._s(r.period))])]),t("div",{directives:[{name:"translate",rawName:"v-translate",value:{n:e.currencyNumberFormat.format(r.savings)},expression:"{ n: currencyNumberFormat.format(plan.savings) }"},{name:"visible",rawName:"v-visible",value:r.savings>0,expression:"plan.savings > 0"}],class:r.colorClass},[e._v("Save %{ n }")])])})),0),t("license-description",{attrs:{"user-nr":e.userNr,"upper-bound":e.upperBound}}),t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"small italic muted"},[e._v("Shown prices do not include VAT.")]),e.userLicense.is_active?e._e():t("button",{staticClass:"alcedo-soil-analysis",on:{click:e.maybeStartTrial}},[t("svg-icon",{attrs:{src:r(2997)}}),e.farmWithCurrentSeason?t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Access the MyAlcedoSoil analysis module directly")]):t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Click here to update the farm maps for the current season")])],1)],1)},Pe=[],Se=(r(5019),r(1617)),Ie=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[t("span",{directives:[{name:"translate",rawName:"v-translate",value:{n:e.userNr},expression:"{ n: userNr }"}],staticClass:"text-bold emphasis",attrs:{"translate-n":e.userNr,"translate-plural":"%{ n } Users"}},[e._v(" %{ n } User ")]),t("span",[e._v(" ")]),t("span",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"muted"}
1,[e._v("up to")]),t("span",[e._v(" ")]),!e.upperBound||e.upperBound>=e.unlimitedLicenseArea?t("span",{key:"unlimited",staticClass:"text-bold emphasis"},[e._v("∞ ha.")]):t("span",{key:"bounded",staticClass:"text-bold emphasis"},[e._v(e._s(e.formatFloat(e.upperBound,0))+" ha.")])])},xe=[],Oe=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};let ke=class extends y.Y5{constructor(){super(...arguments),Object.defineProperty(this,"userNr",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"upperBound",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"unlimitedLicenseArea",{enumerable:!0,configurable:!0,writable:!0,value:f.WV})}};Oe([(0,Z.kv)({type:Number,required:!1,default:0})],ke.prototype,"userNr",void 0),Oe([(0,Z.kv)({type:Number,required:!1,default:0})],ke.prototype,"upperBound",void 0),ke=Oe([(0,y.uA)({name:"LicenseDescription"})],ke);const Ae=ke,$e=Ae;var Fe=(0,C.A)($e,Ie,xe,!1,null,"e7576c2c",null);const De=Fe.exports;var je=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},Ee=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};const Ne=(0,h.cn)(["userLicense","userLicenseIsTrial","userLicenseIsActive","currentFarmId","currentFarm","userFarms","sharedFarms","demoFarmId","userLicense"]);let Te=class extends((0,y.vE)(y.Y5,Ne)){constructor(){super(...arguments),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"offer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"basePriceKey",{enumerable:!0,configurable:!0,writable:!0,value:"price1y"})}get farmWithCurrentSeason(){const e=[...this.userFarms.filter((e=>e.current_season)),...this.sharedFarms.filter((e=>"full_access"===e.shared_farm&&e.id!==this.demoFarmId))];return!!e.length}get firstUserFarm(){var e;return(null===(e=[...this.userFarms,...this.sharedFarms])||void 0===e?void 0:e[0])||null}get offerArea(){var e,t;return null===(t=null===(e=this.offer)||void 0===e?void 0:e.license)||void 0===t?void 0:t.hectares}get tosUrl(){return this.offer&&(0,K.av)(this.offer.license.latest_tos_url)}get startDate(){var e;return(0,h._U)(null===(e=this.offer)||void 0===e?void 0:e.license.start_date)}get upperBound(){var e;return null===(e=this.offer)||void 0===e?void 0:e.offer.upper_bound_ha}get sharedUserNr(){var e;return null===(e=this.offer)||void 0===e?void 0:e.offer.shared_users_no}get userNr(){return this.sharedUserNr+1}get pricingPlans(){return[{name:this.$gettext("standard plan"),priceKey:"price1y",choice:"1year",years:1},{name:this.$gettext("special plan"),priceKey:"price2y",choice:"2year",years:2}]}get basePlanYears(){const e=this.pricingPlans.find((e=>e.priceKey===this.basePriceKey));return null===e||void 0===e?void 0:e.years}get basePlanPrice(){return this.offer&&parseFloat(this.offer.offer[this.basePriceKey])}get availablePlans(){return this.offer?this.pricingPlans.map((e=>{const t=this.$gettextInterpolate(this.$ngettext("%{ n } year","%{ n } years",e.years),{n:e.years}),r=parseFloat(this.offer.offer[e.priceKey]),a=parseFloat(this.offer.offer[`${e.priceKey}_with_vat`]),s=e.years/this.basePlanYears*this.basePlanPrice-r,n=new Date,i=new Date(n);return i.setFullYear(i.getFullYear()+e.years),Object.assign(Object.assign({},e),{key:`${this.userLicense.id}-${e.priceKey}`,price:r,priceWithVat:a,period:t,savings:s,startDate:n,endDate:i,offer:this.offer.offer,campaign:this.offer.campaign,colorClass:s>0?"brand-green-text":"muted",upperBound:this.upperBound,tosUrl:this.tosUrl,userNr:this.userNr})})):[]}uploadMore(){return Ee(this,void 0,void 0,(function*(){this.$emit("close"),yield this.$router.push({name:"manage-farm",params:{farmId:this.currentFarmId}})}))}maybeStartTrial(){return Ee(this,void 0,void 0,(function*(){var e,t;const r=this.userLicense.id,a=this.firstUserFarm.id;if(!(null===(e=this.userLicense)||void 0===e?void 0:e.id)||!(null===(t=this.firstUserFarm)||void 0===t?void 0:t.id))throw new Error("User license ID and farm ID are required");this.farmWithCurrentSeason?yield this.$router.push({name:"alcedo-order",params:{farmId:this.firstUserFarm.id}}):(yield this.activateTrial(r),this.$emit("close"),yield this.$router.push({name:"manage-farm",params:{farmId:a}}))}))}activateTrial(e){return Ee(this,void 0,void 0,(function*(){try{yield(0,K.H2)("POST",`/license/${e}/start_alcedo_trial/`),yield(0,K.H2)("POST",`/license/${e}/later/`),yield this.$store.dispatch("getCurrentUser")}catch(t){throw console.error("Trial activation failed:",t),this.notify({type:"error",text:this.$gettext("Trial activation failed.")+" "+t.message}),t}}))}selectPlan(e){e.disabled||this.$emit("input",e)}};je([(0,Z.kv)({type:Object,required:!1,default:null})],Te.prototype,"value",void 0),je([(0,Z.kv)({type:Object,required:!1,default:null})],Te.prototype,"offer",void 0),Te=je([(0,y.uA)({name:"FirstStep",components:{LicenseDescription:De,Loading:Se.A}})],Te);const Le=Te,Me=Le;var Re=(0,C.A)(Me,Ce,Pe,!1,null,"3cb2f5f2",null);const qe=Re.exports;var Ue=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"paywall-container"},[t("div",{staticClass:"back-button link-button",on:{click:e.resetSelection}},[t("span",{staticClass:"material-icons"},[e._v("arrow_back")]),t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Back")])]),t("div",{staticClass:"summary-box"},[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"desktop-heading-2"},[e._v("Order summary")]),t("div",{staticClass:"item-row"},[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"item-name"},[e._v("OGOR subscription for 1 year")]),t("div",{staticClass:"item-value"},[e._v(e._s(e.currencyNumberFormat.format(e.value.price)))])]),t("div",{staticClass:"item-row total-row"},[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"item-name"},[e._v("Total")]),t("div",{staticClass:"item-value"},[t("div",[e._v(e._s(e.currencyNumberFormat.format(e.value.price)))])])]),t("div",{staticClass:"item-row total-row"},[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"item-name"},[e._v("Total with VAT")]),t("div",{staticClass:"item-value"},[t("div",[e._v(e._s(e.currencyNumberFormat.format(e.value.priceWithVat)))])])]),t("div",{staticClass:"horizontal-separator"}),t("div",{staticClass:"subscription-period"},[t("div",[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"muted"},[e._v("Subscription starts on")]),t("div",[e._v(e._s(e.formatDate(e.value.startDate)))])]),t("div",[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"muted"},[e._v("and ends on")]),t("div",{staticClass:"emphasis"},[e._v(e._s(e.formatDate(e.value.endDate)))])])])]),t("label",{staticClass:"input-group tos-agreement"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.tosAgreement,expression:"tosAgreement"}],attrs:{id:"agree-tos",type:"checkbox"},domProps:{checked:Array.isArray(e.tosAgreement)?e._i(e.tosAgreement,null)>-1:e.tosAgreement},on:{change:function(t){var r=e.tosAgreement,a=t.target,s=!!a.checked;if(Array.isArray(r)){var n=null,i=e._i(r,n);a.checked?i<0&&(e.tosAgreement=r.concat([n])):i>-1&&(e.tosAgreement=r.slice(0,i).concat(r.slice(i+1)))}else e.tosAgreement=s}}}),t("span",{staticClass:"material-icons checkmark"},[e._v("check")]),t("span",{staticClass:"whitespace-insert"},[t("span",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"muted"},[e._v("I have read and agree to")]),t("wbr"),t("a",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"action-text no-wrap",attrs:{href:e.value.tosUrl,target:"_blank"}},[e._v("the Terms and Conditions ")])])]),e.user.marketing?e._e():t("label",{staticClass:"input-group tos-agreement"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.marketingAgreement,expression:"marketingAgreement"}],attrs:{id:"agree-marketing",type:"checkbox"},domProps:{checked:Array.isArray(e.marketingAgreement)?e._i(e.marketingAgreement,null)>-1:e.marketingAgreement},on:{change:function(t){var r=e.marketingAgreement,a=t.target,s=!!a.checked;if(Array.isArray(r)){var n=null,i=e._i(r,n);a.checked?i<0&&(e.marketingAgreement=r.concat([n])):i>-1&&(e.marketingAgreement=r.slice(0,i).concat(r.slice(i+1)))}else e.marketingAgreement=s}}}),t("span",{staticClass:"material-icons checkmark"},[e._v("check")]),t("span",{staticClass:"whitespace-insert"},[t("span",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"muted"},[e._v(" I want to be contacted by OGOR with useful new offers. ")]),t("wbr"),t("a",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"action-text no-wrap",attrs:{href:e.marketingUrl,target:"_blank"}},[e._v(" What does this mean? ")])])]),t("div",{staticClass:"payment-options"},[t("div",{staticClass:"payment-options-title"},[t("div",{staticClass:"line"}),t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"text"},[e._v("Choose payment option")]),t("div",{staticClass:"line"})]),t("div",{staticClass:"option-buttons"},[t("button",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"light-button",attrs:{disabled:!e.tosAgreement},on:{click:function(t){return e.confirmChoice("po")}}},[e._v("Pay by PO")]),t("button",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"brand-green-button",attrs:{disabled:!e.tosAgreement},on:{click:function(t){return e.confirmChoice("card")}}},[e._v("Pay online")])])])])},Be=[],He=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};let Ge=class extends((0,y.vE)(y.Y5,(0,h.cn)(["user"]))){constructor(){super(...arguments),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"latestMarketingTerms",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tosAgreement",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"marketingAgreement",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get marketingUrl(){return this.latestMarketingTerms&&(0,K.av)(this.latestMarketingTerms.file_url)}resetSelection(){this.$emit("input",null)}formatDate(e){return e.toLocaleDateString(this.$language.current,{day:"numeric",month:"long",year:"numeric"})}confirmChoice(e){const t={choice:this.value.choice,offer:this.value.offer,license:{tos:this.tosAgreement,method:e},marketing:this.marketingAgreement};this.$emit("confirm",t)}};He([(0,Z.kv)({type:Object,required:!1,default:null})],Ge.prototype,"value",void 0),He([(0,Z.kv)({type:Object,required:!1,default:null})],Ge.prototype,"latestMarketingTerms",void 0),Ge=He([(0,y.uA)({name:"SecondStep",components:{LicenseDescription:De}})],Ge);const Ye=Ge,Ve=Ye;var We=(0,C.A)(Ve,Ue,Be,!1,null,"7c2136e2",null);const ze=We.exports;var Ke=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"paywall-success"},[t("span",{staticClass:"material-icons success2-text big-checkmark"},[e._v(" check_circle ")]),t("div",{staticClass:"large-bold text-center"},[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"success2-text"},[e._v("Congratulations!")]),t("div",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Your subscription is active")])]),t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"muted paragraph invoice-notice"},[e._v("We will contact you within 24 hours to issue the invoice.")]),t("button",{staticClass:"brand-green-button full-width close-button",on:{click:e.refreshLicense}},[t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Continue to OGOR ")]),t("span",{staticClass:"material-icons"},[e._v(" arrow_forward ")])])])},Je=[],Xe=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},Ze=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};let Qe=class extends y.Y5{refreshLicense(){return Ze(this,void 0,void 0,(function*(){history.pushState({},null,window.location.origin),window.location.reload()}))}};Qe=Xe([(0,y.uA)({name:"ThirdStep"})],Qe);const et=Qe,tt=et;var rt=(0,C.A)(tt,Ke,Je,!1,null,"b210b2b0",null);const at=rt.exports;var st=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"paywall-suspended"},[t("div",{staticClass:"status-icon material-icons"},[e._v("close")]),t("div",{staticClass:"large-bold text-center"},[t("div",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Your license has been suspended")])]),t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"muted paragraph suspended-notice"},[e._v("To reactivate your account, please contact us.")]),t("div",{staticClass:"contact-info text-bold"},[t("a",{attrs:{href:e.getOGORPhoneNumberLink(),target:"_blank",rel:"noopener noreferrer"}},[e._v(" "+e._s(e.getOGORPhoneNumber())+" ")]),t("a",{attrs:{href:"mailto:[email protected]",target:"_blank",rel:"noopener noreferrer"}},[e._v(" [email protected] ")])])])},nt=[],it=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};let ot=class extends y.Y5{};ot=it([(0,y.uA)({name:"SuspendedStep"})],ot);const lt=ot,ct=lt;var dt=(0,C.A)(ct,st,nt,!1,null,"34d35457",null);const ut=dt.exports;var pt=r(497),mt=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"card-payment"},[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"desktop-heading-2"},[e._v("Pay online")]),t("div",{staticClass:"payment-form",style:{width:e.isMobile?void 0:"70rem"}},[e.clientSecret?t("stripe-element-payment",{ref:"paymentRef",attrs:{pk:e.stripeKey,"elements-options":e.elementsOptions,"confirm-params":e.confirmParams,locale:e.locale},on:{loading:e.handleLoading,error:e.computeSize,"element-focus":e.computeSize,"element-blur":e.computeSize,"element-ready":function(t){e.isLoading=!1}}}
1):e._e()],1),t("div",{staticClass:"pay-button-wrapper",style:{visibility:e.isLoading?"hidden":"initial"}},[t("button",{staticClass:"brand-green-button full-width",attrs:{disabled:e.isLoadingSubmit},on:{click:e.submit}},[e.showLoadingIndicator?t("loading",{staticClass:"loading-submit",attrs:{size:16,color:"#fff"}}):e._e(),t("span",[t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Pay")]),t("span",[e._v(" ")]),t("span",[e._v(e._s(e.currencyNumberFormat.format(parseFloat(e.license.price_with_vat))))])])],1),t("div",{staticClass:"small muted text-center"},[t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Trouble paying online?")]),t("span",[e._v(" ")]),t("span",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"action-text text-bold",on:{click:e.poPayment}},[e._v("Pay by PO instead")])])]),e.isLoading?t("loading",{staticClass:"loading-shade"}):e._e()],1)},ht=[],ft=r(2349),vt=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const gt=(0,h.g_)({license:{type:Object}});let yt=class extends((0,y.vE)(y.Y5,gt)){constructor(){super(...arguments),Object.defineProperty(this,"$refs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isLoading",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"isLoadingSubmit",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"showLoadingIndicator",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timeoutId",{enumerable:!0,configurable:!0,writable:!0,value:null})}get clientSecret(){var e,t;return null===(t=null===(e=this.license)||void 0===e?void 0:e.card_payment)||void 0===t?void 0:t.client_secret}get stripeKey(){return"pk_live_51NM7eRByTZ97YMrpOeIcRprqEOnFsg69PToaaJSVZKwnIbJ9rf9HgdfzsoAXTn0KQz3G1lnO3rfZrfzO9ePJa0PX00qRmalaZq"}get elementsOptions(){return{appearance:{theme:"stripe",variables:{fontFamily:'"InstrumentSans", sans-serif'}},clientSecret:this.clientSecret}}get confirmParams(){return{return_url:`${window.location.origin}/redirect`}}get locale(){return this.$language.current}submit(){this.$refs.paymentRef.submit(),this.computeSize()}computeSize(){setTimeout((()=>{var e,t;null===(t=(e=this.$parent).computeSize)||void 0===t||t.call(e)}),300)}handleLoading(e){this.isLoadingSubmit=e,e?this.timeoutId=setTimeout((()=>{this.showLoadingIndicator=!0}),300):(this.showLoadingIndicator=!1,clearTimeout(this.timeoutId))}poPayment(){this.$emit("po-payment")}};yt=vt([(0,y.uA)({name:"CardPayment",components:{StripeElementPayment:ft.qT,Loading:Se.A}})],yt);const bt=yt,wt=bt;var _t=(0,C.A)(wt,mt,ht,!1,null,"1373583b",null);const Ct=_t.exports;var Pt=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},St=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};const It=(0,h.cn)(["userLicense","userLicenseIsActive","userLicenseIsTrial","userLicenceIsPreTrial"]);let xt=class extends((0,y.vE)(y.Y5,It)){constructor(){super(...arguments),Object.defineProperty(this,"modal",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"loading",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"dismiss",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"selectedPlan",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"confirmedPlan",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"offer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"latestMarketingTerms",{enumerable:!0,configurable:!0,writable:!0,value:null})}get isSuspended(){return this.userLicense&&"stop"===this.userLicense.status}get payByCard(){return this.confirmedPlan&&this.confirmedPlan.card_payment&&"succeeded"!=this.confirmedPlan.card_payment.payment_status}get modalSize(){return this.isSuspended||this.selectedPlan&&this.confirmedPlan?"auto":"medium"}get startDate(){return this.userLicense&&(0,h._U)(this.userLicense.start_date)}get endDate(){return this.userLicense&&(0,h._U)(this.userLicense.end_date)}get daysLeft(){return this.endDate?(0,h.du)(this.endDate):0}created(){const e=this.$route.query;e["payment_intent"]&&"succeeded"===e["redirect_status"]&&(this.dismiss=!0),p.A.$on(p.A.events.showPaywall,(()=>St(this,void 0,void 0,(function*(){try{this.userLicenceIsPreTrial&&(yield this.$store.dispatch("getCurrentUser"))}catch(e){this.notify({type:"error",text:this.$gettext("Something went wrong.")})}this.dismiss=!1,this.reset()}))))}mounted(){this.reset(),this.userLicense&&this.userLicense.card_payment&&"succeeded"!=this.userLicense.card_payment.payment_status&&(this.selectedPlan=this.userLicense,this.confirmedPlan=this.userLicense)}reset(){return St(this,void 0,void 0,(function*(){this.selectedPlan=null,this.confirmedPlan=null,this.offer=null,this.loadInitialData()}))}loadInitialData(){return St(this,void 0,void 0,(function*(){if(this.userLicense&&!this.isSuspended)try{this.offer=yield(0,K.H2)("GET",`/license/${this.userLicense.id}/offer/`),this.latestMarketingTerms=yield(0,K.H2)("GET","/legal/marketing/")}finally{}}))}decideLater(){return St(this,void 0,void 0,(function*(){try{this.loading=!0,yield(0,K.H2)("POST",`/license/${this.userLicense.id}/later/`),this.modal.closeModal()}finally{this.loading=!1}}))}confirmPlanToAPI(e){return St(this,void 0,void 0,(function*(){try{this.loading=!0,this.confirmedPlan=yield(0,K.H2)("POST",`/license/${this.userLicense.id}/offer/`,{},e),e.marketing&&(yield(0,K.H2)("PATCH","/auth/user/",{},{marketing:!0}))}finally{this.loading=!1}}))}switchToPo(){return St(this,void 0,void 0,(function*(){yield(0,K.H2)("PUT",`/payment/${this.confirmedPlan.id}/switch_to_po/`),this.confirmedPlan.card_payment=null}))}};Pt([(0,Z.oS)()],xt.prototype,"modal",void 0),xt=Pt([(0,y.uA)({name:"PayWall",components:{Loading:Se.A,ThirdStep:at,SuspendedStep:ut,SecondStep:ze,FirstStep:qe,CardPayment:Ct,Modal:M.A,ContentTransition:pt.A}})],xt);const Ot=xt,kt=Ot;var At=(0,C.A)(kt,we,_e,!1,null,"c8657248",null);const $t=At.exports;var Ft=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("aside",{staticClass:"search-sidebar"},[t("div",{staticClass:"search-sidebar-header"},[t("div",{staticClass:"search-header-row search-header-input"},[t("button",{staticClass:"gray-button icon-button",on:{click:e.closeSearchSidebar}},[t("span",{staticClass:"material-icons"},[e._v("arrow_back")])]),t("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.internalSearchText,expression:"internalSearchText",modifiers:{trim:!0}},{name:"focus",rawName:"v-focus"}],attrs:{id:"search-by-name",type:"text",tabindex:"0",placeholder:e.$gettext("Search f
1ield")},domProps:{value:e.internalSearchText},on:{input:function(t){t.target.composing||(e.internalSearchText=t.target.value.trim())},blur:function(t){return e.$forceUpdate()}}})])]),e.userHasAccessToFarm?t("div",{staticClass:"search-filter-mobile"},[e.selectedCropId?t("div",{key:"filters-selected",staticClass:"search-header-row search-header-row-title emphasis small text-bold"},[t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("1 filter selected")]),t("span",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"action-text",on:{click:e.deselectCrop}},[e._v(" Deselect ")])]):t("div",{directives:[{name:"translate",rawName:"v-translate"}],key:"no-filters-selected",staticClass:"search-header-row search-header-row-title muted small text-bold"},[e._v("Filter parcels")]),t("div",{staticClass:"hidden-scroll search-header-row"},[t("crop-filter",{attrs:{small:""}})],1)]):e._e(),t("div",{staticClass:"search-results skip-virtual-scroll-parent"},[e.userHasAccessToFarm?t("div",{key:"select-header",staticClass:"paragraph-bold small",class:e.showCompareTools?"selected-header":"filtered-header"},[t("div",{staticClass:"select-all-container"},[t("span",{staticClass:"select-all-checkbox material-icons hide-md",class:{active:e.selectedParcels.length>0},on:{click:e.clickSelectAll}},[e._v(" "+e._s(e.selectedParcels.length===e.filteredParcels.length?"check":"remove")+" ")]),e.showCompareTools?t("span",{directives:[{name:"translate",rawName:"v-translate",value:{n:e.selectedParcels.length},expression:"{ n: selectedParcels.length }"}],key:"selected-parcel-count",attrs:{"translate-n":e.selectedParcels.length,"translate-plural":"%{ n } parcels selected"}},[e._v(" %{ n } parcel selected ")]):t("span",{directives:[{name:"translate",rawName:"v-translate",value:{n:e.filteredParcels.length},expression:"{ n: filteredParcels.length }"}],key:"filtered-parcel-count",attrs:{"translate-n":e.filteredParcels.length,"translate-plural":"%{ n } parcels"}},[e._v(" %{ n } parcel ")])]),t("span",{staticClass:"mid-dot show-md"},[e._v(" · ")]),t("span",[e._v(" "+e._s(e.formatFloat(e.showCompareTools?e.selectedParcelSize:e.filteredParcelSize,1))+"ha ")])]):e._e(),t("virtual-scroll",{attrs:{items:e.selectedParcels,"get-item-height":()=>73,"get-item-key":e=>e.id,mode:"parent","item-count":e.selectedParcels.length},scopedSlots:e._u([{key:"item",fn:function({item:e}){return[t("search-result",{key:e.id,staticClass:"selected-parcel",attrs:{parcel:e}})]}}])}),e.showCompareTools?t("div",{key:"select-actions",staticClass:"selected-actions"},[e.selectedParcels.length>10?t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"small error-text"},[e._v("Cannot compare more than 10 parcels")]):e._e(),t("div",{staticClass:"action-list"},[t("router-link",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"action-button",class:{disabled:e.selectedParcels.length<2||e.selectedParcels.length>10},attrs:{to:e.routeToCompare}},[e._v(" Compare fields ")]),t("div",{staticClass:"action-buttons"},[t("button",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"light-button fill",attrs:{disabled:e.selectedParcelIds.length<=0},on:{click:function(t){return e.setShowModal(!0,e.selectedParcelIds)}}},[e._v(" Set crop ")]),t("button",{staticClass:"light-button",attrs:{disabled:e.selectedParcelIds.length<=0,title:e.$gettext("Download selected parcels")},on:{click:e.downloadSelectedParcels}},[t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Download")]),t("span",{staticClass:"material-icons"},[e._v("download")])])])],1)]):e._e(),t("virtual-scroll",{staticClass:"search-result-list",attrs:{items:e.searchResultsGrouped,"get-item-height":e=>e?"header"==e.type?27:73:0,"get-item-key":e=>e.key,mode:"parent","item-count":e.searchResultsGrouped.length},scopedSlots:e._u([{key:"item",fn:function({item:r}){return["header"==r.type?[t("div",{key:r.key,staticClass:"header-item large"},[e._v(" "+e._s(e.getCropName(r.cropId))+" ")])]:e._e(),"item"==r.type?[t("search-result",{key:r.key,staticClass:"parcel-item",class:{"selected-parcel":e.currentFarm.parcelAcce
1ssOnly&&r.parcel.id===e.selectedParcelId},attrs:{parcel:r.parcel}})]:e._e()]}}])})],1),e.isMobile&&e.internalSearchText?t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"see-map-quick-search",on:{click:e.closeSearchSidebar}},[e._v("See map")]):e._e()])},Dt=[],jt=(r(5337),r(3919)),Et=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"search-result",attrs:{title:e.parcelName},on:{mouseover:function(t){e.showCheckBox=!0},mouseout:function(t){e.showCheckBox=!1}}},[t("label",{directives:[{name:"visible",rawName:"v-visible",value:(e.parcel.selected||e.showCheckBox)&&e.userHasAccessToFarm,expression:"(parcel.selected || showCheckBox) && userHasAccessToFarm"}],staticClass:"input-group parcel-checkbox hide-md"},[t("input",{attrs:{type:"checkbox",tabindex:"0"},domProps:{checked:e.parcel.selected},on:{input:e.onInput}}),t("span",{staticClass:"material-icons checkmark"},[e._v("check")])]),t("div",{on:{click:e.parcelClick}},[t("parcel-placeholder",{staticClass:"parcel-placeholder",attrs:{"placeholder-url":e.apiMediaURL(e.parcel.svg_url)}})],1),t("div",{staticClass:"parcel-details",on:{click:e.parcelClick}},[t("div",{staticClass:"parcel-name-and-crop"},[t("div",{staticClass:"parcel-name paragraph"},[e._v(" "+e._s(e.parcelName)+" ")]),t("div",{staticClass:"parcel-crop small hide-md"},[e._v(" "+e._s(e.parcelCrop)+" ")])]),t("div",{staticClass:"parcel-size small"},[e._v(e._s(e.formatFloat(e.parcel.hectares,2))+"ha")])])])},Nt=[],Tt=r(6045),Lt=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const Mt=(0,h.g_)({parcel:{type:Object,required:!0}}),Rt=(0,h.cn)(["crops","rastersSelectable","currentFarmId","currentSeasonId","selectedDate","userHasAccessToFarm"]);let qt=class extends((0,y.vE)(y.Y5,Mt,Rt)){constructor(){super(...arguments),Object.defineProperty(this,"showCheckBox",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get parcelName(){return this.parcel.name}get clickRoute(){let e="map-parcel-selected";const t=Object.assign(Object.assign({},this.$route.params),{seasonId:this.currentSeasonId,farmId:this.currentFarmId,parcelId:this.parcel.id});return this.$route.params.date&&(e="map-observation-details",t["date"]=(0,h.Yq)(this.selectedDate)),{name:e,params:t,query:Object.assign({},this.$route.query)}}get parcelCrop(){return this.getParcelCropName(this.parcel)}parcelClick(){this.rastersSelectable?this.$store.commit("setParcelSelected",{parcelId:this.parcel.id,selected:!0}):this.$router.push(this.clickRoute)}onInput(){this.rastersSelectable||this.$store.commit("setRastersSelectable",!0),this.$store.commit("toggleParcelSelected",this.parcel.id)}};qt=Lt([(0,y.uA)({name:"SearchResult",components:{ParcelPlaceholder:Tt.A}})],qt);const Ut=qt,Bt=Ut;var Ht=(0,C.A)(Bt,Et,Nt,!1,null,"5e8e31c8",null);const Gt=Ht.exports;var Yt=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.$store.getters.userHasFullAccessToFarm?t("div",[t("button",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"light-button fill",attrs:{disabled:e.parcelIds.length<=0},on:{click:function(t){e.showModal=!0}}},[e._v("Set crop")]),e.showModal?t("set-crops-modal",{attrs:{"parcel-ids":e.parcelIds},on:{change:function(t){return e.$emit("change")},close:function(t){e.showModal=!1}}}):e._e()],1):e._e()},Vt=[],Wt=r(1856),zt=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const Kt=(0,h.g_)({parcelIds:{type:Array,required:!0}});let Jt=class extends((0,y.vE)(y.Y5,Kt)){constructor(){super(...arguments),Object.defineProperty(this,"showModal",{enumerable:!0,configurable:!0,writable:!0,value:!1})}};Jt=zt([(0,y.uA)({name:"SetCropsButton",components:{SetCropsModal:Wt.A}})],Jt);const Xt=Jt,Zt=Xt;var Qt=(0,C.A)(Zt,Yt,Vt,!1,null,"16b3e595",null);const er=Qt.exports;var tr=r(7334),rr=r.n(tr),ar=r(2448),sr=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},nr=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};const ir=(0,h.cn)(["rasterKind","selectedCropId","rastersSelectable","currentFarm","currentFarmId","currentSeasonId","selectedDate","parcelsForCurrentSeason","userHasAccessToFarm","userHasFullAccessToFarm","parcelSearchText","filteredParcels","filteredParcelSize","sidebarParcels","selectedParcels","parcelSearchText","selectedParcelId"]);let or=class extends((0,y.vE)(y.Y5,ir)){constructor(){super(...arguments),Object.defineProperty(this,"maxPage",{enumerable:!0,configurable:!0,writable:!0,value:1e5}),Object.defineProperty(this,"internalSearchText",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"showModal",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"searchTextDebounced",{enumerable:!0,configurable:!0,writable:!0,value:rr()((e=>{this.$store.commit("setParcelSearchText",e)}),200)})}get searchPlaceholder(){return this.sidebarParcels.length<=0?this.$gettext("No parcels"):this.$gettextInterpolate(this.$ngettext("%{ n } parcel. Search by name","%{ n } parcels. Search by name",this.sidebarParcels.length),{n:this.sidebarParcels.length})}get searchResultsParcels(){return this.filteredParcels.filter((e=>!e.selected))}get searchResultsGrouped(){const e=(0,h.sX)(this.searchResultsParcels,(e=>this.getCropIntervalCrop(e.crop_intervals)));return Object.keys(e).flatMap((t=>{const r=e[t];return[{type:"header",cropId:t,key:"h"+t},...r.map((e=>({type:"item",parcel:e,key:"p"+e.id}
1)))]}))}get selectedParcelIds(){return this.selectedParcels.map((e=>e.id))}get selectedParcelSize(){return this.selectedParcels.reduce(((e,t)=>e+t.hectares),0)}get routeToMap(){return{name:"map-season-selected",params:{farmId:this.currentFarmId,seasonId:this.currentSeasonId}}}get routeToCompare(){return{name:"compare-parcels",params:{farmId:this.currentFarmId,seasonId:this.currentSeasonId},query:{backToMap:"true",date:(0,h.Yq)(this.selectedDate),parcel:this.selectedParcelIds,rasterKind:this.rasterKind}}}get showCompareTools(){return this.rastersSelectable}internalSearchTextChanged(){this.searchTextDebounced(this.internalSearchText)}currentFarmIdChanged(){this.$store.commit("setParcelSearchText",""),this.$store.commit("setCropSelected",null),this.internalSearchText=""}beforeDestroy(){var e;null===(e=this.searchTextDebounced)||void 0===e||e.clear()}deselectCrop(){this.$store.commit("setCropSelected",null)}setShowModal(e,t){p.A.$emit("set-crops-modal",e,t)}downloadSelectedParcels(){return nr(this,void 0,void 0,(function*(){if(this.selectedParcelIds.length)try{yield(0,K.Rn)("POST",`/farm/${this.currentFarmId}/season/${this.currentSeasonId}/download_season_shapes/`,{},{parcels:this.selectedParcelIds},"application/json","*/*")}catch(e){(0,h.vV)(e),this.notify({type:"error",text:this.$gettext("Unable to download selected parcels")})}}))}clickSelectAll(){this.selectedParcels.length>0?this.$store.commit("clearAllSelectedParcels"):(this.$store.commit("setRastersSelectable",!0),this.filteredParcels.forEach((e=>{this.$store.commit("setParcelSelected",{parcelId:e.id,selected:!0})})))}onCropsChanged(){return nr(this,void 0,void 0,(function*(){yield this.$store.dispatch("refreshSeasonCrops",this.currentSeasonId),yield this.$store.dispatch("getParcelsForCurrentSeason")}))}scrollToSearchResults(){this.$nextTick((()=>{const e=this.$el,t=this.$el.querySelector(".search-result-list");e&&t&&e.scrollTo(0,t.offsetTop-110)}))}};sr([(0,Z.ox)("internalSearchText")],or.prototype,"internalSearchTextChanged",null),sr([(0,Z.ox)("currentFarmId")],or.prototype,"currentFarmIdChanged",null),or=sr([(0,y.uA)({name:"SearchSidebar",components:{SetCropsButton:er,SearchResult:Gt,CropFilter:jt.A,VirtualScroll:ar.A,SetCropsModal:Wt.A}})],or);const lr=or,cr=lr;var dr=(0,C.A)(cr,Ft,Dt,!1,null,"9ce3296e",null);const ur=dr.exports;var pr=r(4255),mr=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[t("modal",{ref:"modal",attrs:{header:e.$gettext("Pair with OGOR Journal"),"modal-size":"small","mobile-mode":"fullscreen","close-on-click-outside":!0},on:{close:function(t){return e.$emit("close")}},scopedSlots:e._u([{key:"body",fn:function(){return[t("div",[t("ol",{staticClass:"instructions"},[t("li",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("1. Open the OGOR Journal app on your mobile phone.")]),t("li",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v('2. Select "Bring a farm from OGOR", from the choose farm menu.')])]),t("span",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"season-label"},[e._v("Please select a season.")]),t("multi-select",{staticClass:"multi-select",attrs:{options:e.optionsSeasons,label:e.getSeasonLabel,placeholder:e.$gettext("Select season...")},on:{input:e.selectSeason},model:{value:e.selectedSeason,callback:function(t){e.selectedSeason=t},expression:"selectedSeason"}})],1),e.otpToken?t("div",{staticClass:"otp-details"},[t("div",[t("span",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"label"},[e._v("Passkey:")]),t("span",{staticClass:"value"},[e._v(e._s(e.otpToken.code))])]),t("div",[t("span",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"label"},[e._v("Word:")]),t("span",{staticClass:"value"},[e._v(e._s(e.otpToken.word))])]),t("div",[t("span",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"label"},[e._v("Remaining time:")]),t("span",{staticClass:"value"},[e._v(e._s(e.remainingTime>0?e.remainingTime+"s":e.$gettext("Expired.")))])])]):e._e(),e.error?t("span",{staticClass:"otp-error-text"},[e._v(e._s(e.error))]):e._e()]},proxy:!0},{key:"footer",fn:function(){return[t("button",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"brand-green-button fill",attrs:{disabled:e.remainingTime>0||!e.selectedSeason},on:{click:e.getToken}},[e._v("Get passkey")])]},proxy:!0}])})],1)},hr=[],fr=r(5353),vr=r(5208),gr=r(373),yr=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};const br=y.lD.extend({name:"JournalDialog",components:{Modal:M.A,MultiSelect:vr.A},mixins:[gr.A],data(){return{otpToken:null,timer:null,remainingTime:0,selectedSeason:null,error:null}},computed:Object.assign(Object.assign({},(0,fr.L8)(["currentFarmId","seasons","currentSeason"])),{optionsSeasons(){const e=Object.values(this.seasons).sort(((e,t)=>new Date(t.end_date).getTime()-new Date(e.end_date).getTime())),t=(new Date).getFullYear(),r=e.filter((e=>new Date(e.end_date).getFullYear()>=t));return 0===r.length?(this.$nextTick((()=>{this.error=this.$gettext("No seasons available for this year. Please add a season for this year in crop rotation.")})),[]):r}}),watch:{otpToken:{immediate:!0,handler(){this.otpToken?(this.updateRemainingTime(),this.timer&&clearInterval(this.timer),this.timer=setInterval(this.updateRemainingTime,1e3)):this.timer&&(clearInterval(this.timer),this.timer=null)}}},beforeDestroy(){this.timer&&clearInterval(this.timer)},methods:{getToken(){return yr(this,void 0,void 0,(function*(){try{const e=yield(0,K.H2)("GET",`/farm/${this.currentFarmId}/season/${this.selectedSeason.id}/totp/`);this.otpToken=e,this.error=null}catch(e){this.error=this.$gettext("An unknown error occurred."),console.error(e)}}))},getSeasonLabel(e){return e.interval},selectSeason(e){this.selectedSeason=e},updateRemainingTime(){if(!this.otpToken)return void(this.remainingTime=0);const e=(new Date).getTime(),t=new Date(this.otpToken.valid_until).getTime(),r=t-e;if(r<=0)this.remainingTime=0,this.timer&&(clearInterval(this.timer),this.timer=null);else{const e=Math.ceil(r/1e3);this.remainingTime=e}}}}),wr=br;var _r=(0,C.A)(wr,mr,hr,!1,null,null,null);const Cr=_r.exports;var Pr=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("transition",{attrs:{name:"slide-left"}
1,on:{"after-enter":function(t){e.drawerDisplayed=!0},"after-leave":function(t){e.drawerDisplayed=!1}}},[e.showAppSidebar?t("app-sidebar",{directives:[{name:"focus",rawName:"v-focus",value:e.showAppSidebar,expression:"showAppSidebar"}],ref:"appSidebar",on:{hide:e.maybeHideSidebar,farmPicker:function(t){e.farmPickerDisplayed=t}},nativeOn:{focusout:function(t){return e.maybeHideSidebar.apply(null,arguments)}}},[t("transition",{attrs:{name:"slide-up"}},[e.drawerDisplayed&&!e.user.email?t("div",{staticClass:"sidebar-drawer"},[t("safe-area",{staticClass:"anon-user"},[t("router-link",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"brand-green-button full-width",attrs:{to:e.newAccountRoute}},[e._v(" Create OGOR account ")]),t("router-link",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"light-button full-width",attrs:{to:{name:"login"}}},[e._v(" Log in ")])],1)],1):e._e()]),t("transition",{attrs:{name:"slide-up"}},[!e.farmPickerDisplayed&&e.drawerDisplayed&&e.user.email&&0===e.farmsWithSeasons.length?t("div",{staticClass:"sidebar-drawer"},[t("safe-area",{staticClass:"no-farms-user"},[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"large-bold"},[e._v("Your entire farm in one screen")]),t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"paragraph byline-hook"},[e._v("Add your parcels and get access to the latest satellite images at any time.")]),t("add-farm-button",{attrs:{via:"sidebar"}})],1)],1):e._e()])],1):e._e()],1)},Sr=[],Ir=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("aside",{staticClass:"app-sidebar sidebar"},[t("div",{staticClass:"sidebar-header"},[t("sidebar-menu"),e.showCloseButton?t("div",{staticClass:"quick-actions"},[t("i",{staticClass:"material-icons",on:{click:function(t){return e.$emit("hide")}}},[e._v("close")])]):e._e()],1),e.currentFarm?[t("div",{staticClass:"farm-item bordered farm-picker-opener",on:{click:function(t){return e.toggleFarmPicker(!0)}}},[t("farm-info",{attrs:{farm:e.currentFarm,"show-expand":""}})],1),t("farm-menu-item",{attrs:{farm:e.currentFarm},on:{closeSidebar:e.closeSidebar}}),t("recent-parcels")]:e._e(),!e.currentFarm&&e.selectedParcel?[t("div",{staticClass:"farm-item bordered",class:{disabled:!e.userEmail,"farm-picker-opener":e.userEmail},on:{click:function(t){e.userEmail&&e.toggleFarmPicker(!0)}}},[t("parcel-item",{attrs:{parcel:e.selectedParcel,"top-prop":"name","bottom-prop":"crop","right-prop":"area"}})],1),t("parcel-menu-item",{attrs:{parcel:e.selectedParcel}})]:e._e(),t("div",{staticClass:"sidebar-overlay farm-picker-container"},[t("transition",{attrs:{name:"slide-right"}},[e.showFarmPicker?t("farm-picker-menu",{on:{close:function(t){return e.toggleFarmPicker(!1)}}}):e._e()],1)],1),e._t("default")],2)},xr=[],Or=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"farm-menu-item",attrs:{title:e.getFarmName(e.farm)}},[e.farm.parcelAccessOnly?t("div",{staticClass:"request-full-access"},[t("div",{staticClass:"material-icons brand-blue-text"},[e._v("info")]),t("div",[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"paragraph emphasis"},[e._v(" The map is only available when you have access to the entire farm. At the moment you only have access to some of the parcels. ")]),t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"muted click-me request-action",on:{click:e.requestFarmAccess}},[e._v("Request access for the entire farm")])])]):e._e(),e.isJournalUser?t("button",{staticClass:"sidebar-menu-item sidebar-menu-item-journal",class:{disabled:!e.farm.hasSeasons||e.farm.parcelAccessOnly},attrs:{title:e.$gettext("Pair with OGOR Journal")},on:{click:e.showJournalDialog}},[t("img",{staticClass:"jurnal-icon",attrs:{src:r(1855),alt:"OgorJournal"}}),t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("OGOR Journal")])]):e._e(),t("router-link",{staticClass:"sidebar-menu-item hide-md",class:{disabled:!e.farm.hasSeasons||e.farm.parcelAccessOnly,active:"CropOverview"==e.matchedComponent},attrs:{to:{name:"crop-overview-date-selected",params:{...e.defaultRouteParam
1s}},title:e.getFarmName(e.farm),"active-class":"selected"},nativeOn:{click:function(t){return e.$emit("closeSidebar")}}},[t("span",{staticClass:"material-icons"},[e._v("assignment")]),t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Crops report")])]),t("router-link",{staticClass:"sidebar-menu-item",class:{disabled:!e.farm.hasSeasons||e.farm.parcelAccessOnly||0==e.parcelCount,active:"MapView"==e.matchedComponent},attrs:{to:{name:"map-date-selected",params:{...e.defaultRouteParams},query:{rasterKind:e.rasterKind}},title:e.getFarmName(e.farm),"active-class":"selected"},nativeOn:{click:function(t){return e.$emit("closeSidebar")}}},[t("svg-icon",{attrs:{src:r(9543)}}),t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Map")])],1),t("router-link",{staticClass:"sidebar-menu-item hide-md",class:{disabled:!e.farm.hasSeasons||e.farm.parcelAccessOnly,active:"GridView"==e.matchedComponent},attrs:{to:{name:"grid-date-selected",params:{...e.defaultRouteParams},query:{rasterKind:e.rasterKind}},title:e.getFarmName(e.farm),"active-class":"selected"},nativeOn:{click:function(t){return e.$emit("closeSidebar")}}},[t("svg-icon",{attrs:{src:r(3591)}}),t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Grid")])],1),t("div",{staticClass:"sidebar-menu-item",class:{disabled:0==e.parcelCount},attrs:{title:e.getFarmName(e.farm)},on:{click:e.openSearchSidebar}},[t("span",{staticClass:"material-icons"},[e._v("search")]),t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Search Parcels")]),e._v("   "),e.parcelCount>0?t("span",[e._v("("+e._s(e.parcelCount)+")")]):e._e()]),e.farm.hasFullAcess?t("router-link",{staticClass:"sidebar-menu-item",attrs:{to:{name:"manage-farm",params:{farmId:e.farm.id}},title:e.getFarmName(e.farm),"active-class":"selected"},nativeOn:{click:function(t){return e.$emit("closeSidebar")}}},[t("svg-icon",{attrs:{src:r(864)}}),t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Crop rotation")])],1):e._e(),t("div",{staticClass:"soil-analysis-wrapper"},[e.farm.hasSeasons?t("router-link",{staticClass:"sidebar-menu-item",attrs:{to:{name:"alcedo-order",params:{farmId:e.farm.id}}},nativeOn:{click:function(t){return e.$emit("closeSidebar")}}},[t("svg-icon",{attrs:{src:r(2997)}}),t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Soil analysis")])],1):e._e()],1),e.isMobile?e._e():t("router-link",{staticClass:"sidebar-menu-item",class:{disabled:!e.farm.hasSeasons||e.farm.parcelAccessOnly||0==e.parcelCount,active:"SoilMapView"==e.matchedComponent},attrs:{to:{name:"soil-map",params:{...e.defaultRouteParams},query:{rasterKind:e.rasterKind}},"active-class":"selected"},nativeOn:{click:function(t){return e.$emit("closeSidebar")}}},[t("span",{staticClass:"material-icons"},[e._v("terrain")]),t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Soil map")])]),t("a",{staticClass:"sidebar-menu-item",attrs:{href:e.yieldURL}},[t("svg-icon",{attrs:{src:r(1894)}}),t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Yield forecast")])],1)],1)},kr=[],Ar=(r(9229),function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i}),$r=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};const Fr=(0,h.g_)({farm:{type:Object,required:!0}}),Dr=(0,h.cn)(["rasterKind","farms","currentFarmId","selectedParcelId","demoFarmId","userEmail","selectedDate","currentSeasonId","userLicenseIsTrial","parcelsForSeason","isDemoFarm"]);let jr=class extends((0,O.vE)(y.Y5,Fr,Dr)){get parcelCount(){return this.farm.parcelAcce
1ssOnly?this.farm.sharedParcels.length:this.farm.parcel_count}get matchedComponent(){var e,t;return this.$route&&0!=this.$route.matched.length?null===(t=null===(e=this.$route.matched[0].components)||void 0===e?void 0:e.default)||void 0===t?void 0:t.name:null}get defaultRouteParams(){return{farmId:this.currentFarmId,seasonId:this.currentSeasonId||null,date:this.selectedDate?(0,h.Yq)(this.selectedDate):null}}get isJournalUser(){return this.$store.getters.user.groups.some((e=>"Journal users"===e.name))}requestFarmAccess(){return $r(this,void 0,void 0,(function*(){try{yield(0,K.H2)("POST",`/shared-farms/${this.farm.id}/request_access/`),this.notify({type:"success",icon:"person",text:this.$gettext("A request for access has been sent to the farm owner.")})}catch(e){this.notify({type:"error",text:this.$gettext("Unable to requests access to farm.")})}}))}showJournalDialog(){p.A.$emit("showJournalDialog",!0)}};jr=Ar([(0,y.uA)({name:"FarmMenuItem"})],jr);const Er=jr,Nr=Er;var Tr=(0,C.A)(Nr,Or,kr,!1,null,"62c52bc6",null);const Lr=Tr.exports;var Mr=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"farm-info"},[t("div",[t("div",{staticClass:"emphasis text-bold farm-name"},[e._v(" "+e._s(e.getFarmName(e.farm))+" ")]),t("div",{staticClass:"small muted"},[e.farm.parcelAccessOnly?t("span",{directives:[{name:"translate",rawName:"v-translate",value:{n:e.farm.sharedParcels.length},expression:"{ n: farm.sharedParcels.length }"}],attrs:{"translate-n":e.farm.sharedParcels.length,"translate-plural":"[%{ n }] parcels"}},[e._v(" [%{ n }] parcel ")]):t("span",{directives:[{name:"translate",rawName:"v-translate",value:{n:e.displayParcelCount},expression:"{ n: displayParcelCount }"}],attrs:{"translate-n":e.displayParcelCount,"translate-plural":"%{ n } parcels"}},[e._v(" %{ n } parcel ")]),e._v("  ·  "+e._s(e.formatFloat(e.displayHectares,1))+" ha ")])]),e.showExpand?t("span",{staticClass:"material-icons"},[e._v(" unfold_more ")]):e._e()])},Rr=[],qr=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const Ur=(0,h.g_)({farm:{type:Object,required:!0},showExpand:{type:Boolean,required:!1,default:!1}}),Br=(0,h.cn)(["currentFarmId","currentSeason"]);let Hr=class extends((0,y.vE)(y.Y5,Ur,Br)){get displayParcelCount(){return this.farm.id===this.currentFarmId&&this.currentSeason?this.currentSeason.parcels_count:this.farm.parcel_count}get displayHectares(){return this.farm.id===this.currentFarmId&&this.currentSeason?this.currentSeason.hectares:this.farm.hectares}};Hr=qr([(0,y.uA)({name:"FarmInfo"})],Hr);const Gr=Hr,Yr=Gr;var Vr=(0,C.A)(Yr,Mr,Rr,!1,null,"d9793130",null);const Wr=Vr.exports;var zr=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.parcelsToList.length>0?t("div",{staticClass:"recent-parcels"},[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"small muted uppercase text-bolder"},[e._v("Recently viewed")]),t("div",{staticClass:"recent-parcels-list"},e._l(e.parcelsToList,(function(r){return t("router-link",{key:r.id,staticClass:"recent-parcel",attrs:{to:e.getParcelLink(r)}},[t("parcel-thumbnail",{staticClass:"small-thumbnail",attrs:{parcel:r,"data-tippy-content":r.name}})],1)})),1)]):e._e()},Kr=[],Jr=r(6261),Xr=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const Zr=(0,h.cn)(["recentParcels","selectedDate","rasterKind","selectedParcelId"]);let Qr=class extends((0,y.vE)(y.Y5,Zr)){get parcelsToList(){return this.recentParcels.filter((e=>e.id!==this.selectedParcelId)).slice(-3)}parcelsToListChanged(){this.initTooltips()}mounted(){this.initTooltips()}};Xr([(0,Z.ox)("parcelsToList")],Qr.prototype,"parcelsToListChanged",null),Qr=Xr([(0,y.uA)({name:"RecentParcels",components:{ParcelThumbn
1ail:Jr.A}})],Qr);const ea=Qr,ta=ea;var ra=(0,C.A)(ta,zr,Kr,!1,null,"f2b65d86",null);const aa=ra.exports;var sa=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("ogor-menu",{attrs:{"menu-style":{minWidth:"35rem"}},scopedSlots:e._u([{key:"activator",fn:function(){return[t("div",{staticClass:"current-user emphasis"},[t("span",{staticClass:"material-icons"},[e._v(" account_circle ")]),e.user.email?t("span",{staticClass:"user-name"},[e._v(" "+e._s(e.user.name||e.user.email)+" ")]):t("span",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"user-name"},[e._v(" Your account ")]),t("span",{staticClass:"material-icons"},[e._v(" expand_more ")])])]},proxy:!0}])},[e.user.email?[t("ogor-menu-item",{on:{click:function(t){return e.goTo({name:"user-settings"})}}},[t("span",{staticClass:"material-icons"},[e._v("settings")]),t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Account settings")])]),t("div",{staticClass:"menu-group-separator"})]:e._e(),e.user.is_staff||e.user.is_hijacked?[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"menu-group-header"},[e._v("Staff only")]),t("ogor-menu-item",{on:{click:e.maybeReleaseUser}},[t("span",{staticClass:"material-icons"},[e._v("person")]),t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Users")])]),t("div",{staticClass:"menu-group-separator"})]:e._e(),e.user.email?e._e():[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"menu-group-header"},[e._v("Change language")]),e._l(e.availableLanguages,(function(r){return t("ogor-menu-item",{key:r.code,attrs:{toggleable:"",value:r.code===e.$language.current},on:{input:function(t){return e.changeLanguage(r)}}},[e._v(" "+e._s(r.label)+" ")])})),t("div",{staticClass:"menu-group-separator"})],[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"menu-group-header"},[e._v("Help")]),t("ogor-menu-item",{on:{click:function(t){e.goTo(e.getOGORPhoneNumberLink(),!0)}}},[t("span",{staticClass:"material-icons"},[e._v("phone")]),t("span",[e._v(e._s(e.getOGORPhoneNumber()))])]),t("ogor-menu-item",{on:{click:function(t){return e.goTo("mailto:[email protected]",!0)}}},[t("span",{staticClass:"material-icons"},[e._v("mail_outline")]),t("span",[e._v("[email protected]")])]),t("div",{staticClass:"menu-group-separator"})],[t("ogor-menu-item",{attrs:{href:e.ogorURL}},[t("span",{staticClass:"material-icons"},[e._v("link")]),t("span",[e._v("ogor.ro")])]),e.user.email?t("ogor-menu-item",{on:{click:e.logOut}},[t("span",{staticClass:"material-icons"},[e._v("exit_to_app")]),t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Logout")])]):e._e()]],2)},na=[],ia=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},oa=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};let la=class extends((0,y.vE)(y.Y5,(0,h.cn)(["user"]))){get availableLanguages(){return Object.entries(this.$language.available).map((([e,t])=>({code:e,label:t})))}mounted(){document.querySelectorAll(".sidebar-menu-item").forEach((e=>{e.addEventListener("click",this.closeSidebar)}))}beforeDestroy(){document.querySelectorAll(".sidebar-menu-item").forEach((e=>{e.removeEventListener("click",this.closeSidebar)}))}closeSidebar(){this.$store.commit("setShowAppSidebar",!1)}goTo(e,t=!1){t?window.open(e,"_blank"):this.$router.push(e).catch((()=>{}))}maybeReleaseUser(){return oa(this,void 0,void 0,(function*(){this.user.is_hijacked?(0,h.QC)():this.$router.push({name:"staff-users"}).catch((()=>{}))}))}changeLanguage(e){(0,m.xC)(e.code.toLowerCase(),this)}logOut(){return oa(this,void 0,void 0,(function*(){try{yield(0,K.je)(),this.notify({type:"info",icon:"logout",text:this.$gettext("You have successfully logged out")}),this.$emit("hide"),this.$store.commit("clearUser"),yield this.$store.dispatch("clearState")}catch(e){p.A.$emit(p.A.events.apiUnknownError)}}))}};la=ia([(0,y.uA)({name:"SidebarMenu"})],la);const ca=la,da=ca;var ua=(0,C.A)(da,sa,na,!1,null,"39baf58a",null);const pa=ua.exports;var ma=r(4699),ha=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"parcel-menu-item hide-md"},[t("router-link",{staticClass:"sidebar-menu-item map-menu-item",attrs:{to:e.routeToMap,"active-class":"selected"}},[t("svg-icon",{attrs:{src:r(9543)}}),t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Map")])],1),t("router-link",{staticClass:"sidebar-menu-item grid-menu-item",attrs:{to:e.evolutionRoute,"active-class":"selected"}},[t("svg-icon",{attrs:{src:r(3591)}}),t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("History")])],1)],1)},fa=[],va=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const ga=(0,h.g_)({parcel:{type:Object,required:!0}}),ya=(0,h.cn)(["currentFarmId","currentSeasonId","selectedParcel","selectedParcelId","selectedDate","latestDate"]);let ba=class extends((0,y.vE)(y.Y5,ga,ya)){get evolutionRoute(){return{name:"parcel-history",params:{parcelId:this.selectedParcelId,seasonId:this.currentSeasonId,farmId:this.currentFarmId},query:{rasterKind:this.rasterKind,backTo:this.$route.fullPath}}}get routeToMap(){const e=this.latestDate||this.selectedDate||new Date;return this.currentFarmId&&e&&this.selectedParcelId&&this.currentSeasonId?{name:"map-observation-detail
1s",params:{farmId:this.currentFarmId,date:(0,h.Yq)(e),parcelId:this.selectedParcelId,seasonId:this.currentSeasonId},query:{rasterKind:this.rasterKind}}:""}};ba=va([(0,y.uA)({name:"ParcelMenuItem"})],ba);const wa=ba,_a=wa;var Ca=(0,C.A)(_a,ha,fa,!1,null,"1c33eaff",null);const Pa=Ca.exports;var Sa=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"sidebar-overlay farm-picker"},[t("div",{staticClass:"sidebar-overlay-header"},[t("span",{staticClass:"material-icons click-me",on:{click:function(t){return e.$emit("close")}}},[e._v(" arrow_back ")]),t("span",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"header-title"},[e._v(" Select a farm ")]),e.user.email?t("span",{staticClass:"material-icons click-me",on:{click:function(t){return e.openAddFarmModal()}}},[e._v(" add ")]):e._e()]),t("div",{staticClass:"available-farms"},[t("div",{staticClass:"farm-group"},[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"brand-green-text small uppercase farm-group-title"},[e._v("Your farms")]),0===e.farmsWithSeasons.length?t("add-farm-button",{attrs:{via:"sidebar"}}):e._l(e.userFarms,(function(r){return t("router-link",{key:r.id,staticClass:"farm-item",class:{selected:r.id===e.currentFarmId},attrs:{to:e.routeToHome(r),title:e.getFarmName(r)}},[t("farm-info",{attrs:{farm:r}})],1)}))],2),t("div",{staticClass:"farm-group"},[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"brand-green-text small uppercase farm-group-title"},[e._v("Shared with you")]),e._l(e.activeSharedFarms,(function(r){return[t("router-link",{key:r.id,staticClass:"farm-item",class:{selected:r.id===e.currentFarmId},attrs:{to:e.routeToHome(r)}},[t("farm-info",{attrs:{farm:r}})],1)]})),e._l(e.expiredSharedFarms,(function(r){return[t("div",{key:r.id,staticClass:"farm-item farm-item--expired",attrs:{title:e.$gettext("This farm belongs to a user whose license has expired.")}},[t("farm-info",{attrs:{farm:r}}),t("span",{staticClass:"material-icons expired-icon"},[e._v("info_outline")])],1)]}))],2)]),e.showAddFarmModal?t("update-farm-modal",{on:{close:function(t){e.showAddFarmModal=!1}}}):e._e()],1)},Ia=[],xa=r(8215),Oa=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const ka=(0,h.cn)(["sharedFarms","userFarms","farmsWithSeasons","currentFarmId","user"]);let Aa=class extends((0,y.vE)(y.Y5,ka)){constructor(){super(...arguments),Object.defineProperty(this,"showAddFarmModal",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get activeSharedFarms(){return this.sharedFarms.filter((e=>!e.licenseExpired))}get expiredSharedFarms(){return this.sharedFarms.filter((e=>e.licenseExpired))}openAddFarmModal(){this.showAddFarmModal=!0}routeToHome(e){if(!e.hasSeasons&&!e.hasFullAcess)return"";if((!e.hasSeasons||0==e.parcel_count)&&e.hasFullAcess)return{name:"manage-farm",params:{farmId:e.id}};if(e.parcelAccessOnly&&e.sharedParcels.length>0){const t=e.sharedParcels[0];return{name:"map-shared-parcel",params:{farmId:e.id,seasonId:t.season,parcelId:t.id},query:{rasterKind:this.rasterKind}}}return e.hasAccess||e.hasFullAcess?{name:"map",params:{farmId:e.id,date:null},query:{rasterKind:this.rasterKind}}:""}};Aa=Oa([(0,y.uA)({name:"FarmPickerMenu",components:{UpdateFarmModal:xa.A,AddFarmButton:R.A,FarmInfo:Wr}})],Aa);const $a=Aa,Fa=$a;var Da=(0,C.A)(Fa,Sa,Ia,!1,null,"6e17680e",null);const ja=Da.exports;var Ea=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const Na=(0,h.cn)(["user","userEmail","userFarms","sharedFarms","currentFarm","currentFarmId","selectedParcel","rasterKind","farmsWithSeasons"]);let Ta=class extends((0,O.vE)(y.Y5,Na)){constructor(){super(...arguments),Object.defineProperty(this,"showFarmPicker",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get showCloseButton(){var e;return!(0,h.Fr)()||(null===(e=this.currentFarm)||void 0===e?void 0:e.parcel_count)>0}
1$routeChanged(){this.showFarmPicker=!1}toggleFarmPicker(e){this.showFarmPicker=e,this.$emit("farmPicker",e)}closeSidebar(){this.$store.commit("setShowAppSidebar",!1)}};Ea([(0,Z.ox)("$route")],Ta.prototype,"$routeChanged",null),Ta=Ea([(0,O.Ay)({name:"AppSidebar",components:{FarmPickerMenu:ja,ParcelMenuItem:Pa,ParcelItem:ma.A,SidebarMenu:pa,RecentParcels:aa,FarmInfo:Wr,FarmMenuItem:Lr}})],Ta);const La=Ta,Ma=La;var Ra=(0,C.A)(Ma,Ir,xr,!1,null,"12e06363",null);const qa=Ra.exports;var Ua=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const Ba=(0,h.cn)(["user","showAppSidebar","farmsWithSeasons","currentFarm","isDemoFarm","parcelsForCurrentSeason","showSearchSidebar","allFarms"]);let Ha=class extends((0,y.vE)(y.Y5,Ba)){constructor(){super(...arguments),Object.defineProperty(this,"$refs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"drawerDisplayed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"farmPickerDisplayed",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get newAccountRoute(){const e=this.currentFarm?this.isDemoFarm?"demo_farm":"shared_farm":"shared_parcel";return{name:"new-account",query:{ref:e}}}$routeChanged(e){var t;if("map"==e.name&&(0,h.Fr)()){let r=e.params.farmId;if(0==(null===(t=this.allFarms[r])||void 0===t?void 0:t.parcel_count))return}this.$nextTick((()=>{this.$store.commit("setShowAppSidebar",!1)}))}showAppSidebarChanged(e){e?document.addEventListener("keyup",this.handleKeyUp):document.removeEventListener("keyup",this.handleKeyUp)}maybeHideSidebar(e){this.isMobile&&this.currentFarm&&0===this.currentFarm.parcel_count||this.showSearchSidebar||this.$refs.appSidebar&&e&&e.relatedTarget&&this.$refs.appSidebar.$el.contains(e.relatedTarget)||this.$store.commit("setShowAppSidebar",!1)}handleKeyUp(e){"Escape"==e.key&&this.maybeHideSidebar()}};Ua([(0,Z.ox)("$route")],Ha.prototype,"$routeChanged",null),Ua([(0,Z.ox)("$showAppSidebar")],Ha.prototype,"showAppSidebarChanged",null),Ha=Ua([(0,y.uA)({name:"AppSidebarTransition",components:{AddFarmButton:R.A,AppSidebar:qa}})],Ha);const Ga=Ha,Ya=Ga;var Va=(0,C.A)(Ya,Pr,Sr,!1,null,"2f4704c1",null);const Wa=Va.exports;var za=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"ogor-notification-group"},[t("transition-group",{attrs:{name:"notifications"}},e._l(e.activeNotifications,(function(r,a){return t("div",{key:a+r.text,staticClass:"notification-wrapper",class:r.type},[t("div",{staticClass:"notification-outer",attrs:{id:"notification-"+a}},[t("div",{staticClass:"main-notification",on:{mouseover:function(t){return e.stopNotificationTimer(a)},mouseout:function(t){return e.startNotificationTimer(a)},touchstart:function(t){return e.touchStart(t,a)},touchend:function(t){return e.touchEnd(t,a)},touchmove:function(t){return e.touchMove(t,a)},contextmenu:function(e){return e.preventDefault()}}},[r.icon?t("div",{staticClass:"notification-icon"},[e.isIconSvg(r.icon)?e._e():[t("span",{staticClass:"material-icons muted-inverted"},[e._v(" "+e._s(e.getMaterialIcon(r.icon))+" ")])],e.isIconSvg(r.icon)?[t("img",{attrs:{src:r.icon.svg,width:"24",height:"24"}})]:e._e()],2):e._e(),t("div",{staticClass:"notification-text"},[r.text?t("span",{domProps:{innerHTML:e._s(r.text)}}):e._e(),r.action?t("button",{staticClass:"notification-action",on:{click:function(t){return e.actionClick(a,t)}}},[e._v(" "+e._s(r.action)+" ")]):e._e()]),r.dismissable?t("button",{staticClass:"notification-close",on:{click:function(t){return e.dismissNotification(a,t)}}},[t("i",{staticClass:"material-icons"},[e._v(" close ")])]):e._e()])])])})),0)],1)},Ka=[];function Ja(e){return"string"!=typeof e&&("object"==typeof e?"svg"in e:void 0)}var Xa=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const Za=(0,h.g_)({duration:{type:Number,default:4e3}});let Qa=class extends((0,y.vE)(y.Y5,Za)){constructor(){super(...arguments),Object.defineProperty(this,"activeNotifications",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"autoIncrementId",{enumerable:!0,configurable:!0,writable:!0,value:999}
1),Object.defineProperty(this,"isIconSvg",{enumerable:!0,configurable:!0,writable:!0,value:Ja})}mounted(){p.A.$on("emitNotification",this.addNotification)}addNotification(e){if(e.unique){const t=Object.keys(this.activeNotifications);if(t.find((t=>this.activeNotifications[t].text==e.text)))return}null==e.duration&&(e.duration=this.duration);let t=this.autoIncrementId;this.activeNotifications=Object.assign(Object.assign({},this.activeNotifications),{[t]:e}),this.startNotificationTimer(t),this.autoIncrementId--}removeNotification(e){this.$delete(this.activeNotifications,e)}actionClick(e,t){const r=this.activeNotifications[e];r&&(r.onAction&&r.onAction(t),this.removeNotification(e))}dismissNotification(e,t){const r=this.activeNotifications[e];r&&(r.onDismiss&&r.onDismiss(t),this.removeNotification(e))}getMaterialIcon(e){return"string"==typeof e?e:"object"==typeof e?"material"in e&&e.material||null:void 0}startNotificationTimer(e){const t=this.activeNotifications[e];t&&(t.duration<=0||(t.timerStart=Date.now(),t.timerPaused=!1,t.timerId=window.setTimeout((()=>{this.removeNotification(e)}),t.duration),this.activeNotifications=Object.assign(Object.assign({},this.activeNotifications),{[e]:t})))}stopNotificationTimer(e){const t=this.activeNotifications[e];if(!t)return;if(t.duration<=0)return;window.clearTimeout(t.timerId);const r=Date.now();t.timerPaused=!0;const a=r-t.timerStart;t.duration-=a,this.activeNotifications=Object.assign(Object.assign({},this.activeNotifications),{[e]:t})}touchStart(e,t){this.stopNotificationTimer(t);const r=this.activeNotifications[t];r.initialY=e.touches[0].clientY,r.ref=document.getElementById(`notification-${t}`),r.ref.style.transition="none",r.threshold=-r.ref.offsetHeight/2}touchMove(e,t){e.preventDefault();const r=this.activeNotifications[t],a=e.touches[0].clientY-r.initialY;a>=0||(r.ref.style.opacity=""+(1-a/r.threshold),r.ref.style.transform=`translateY(${a}px)`)}touchEnd(e,t){const r=this.activeNotifications[t],a=e.changedTouches[0].clientY-r.initialY;a<r.threshold?this.dismissNotification(t,e):(r.ref.style.transition=null,r.ref.style.opacity="1",r.ref.style.transform="translateY(0px)",this.startNotificationTimer(t))}};Qa=Xa([O.Ay],Qa);const es=Qa,ts=es;var rs=(0,C.A)(ts,za,Ka,!1,null,"b6228238",null);const as=rs.exports;var ss=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.showInstallPrompt?t("modal",{ref:"modal",attrs:{"modal-size":"small","show-header":!1,"mobile-mode":"drawer"},on:{close:e.dismiss},scopedSlots:e._u([{key:"body",fn:function({closeModal:a}){return[t("button",{staticClass:"gray-button icon-button",on:{click:a}},[t("span",{staticClass:"material-icons muted"},[e._v("close")])]),t("div",{staticClass:"text-center"},[t("img",{attrs:{src:r(8705),width:"170"}})]),t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"display-2"},[e._v("Open OGOR directly from the home screen.")]),t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"emphasis text-center"},[e._v("Always have the vegetation maps at hand, all over the screen.")])]}},{key:"footer",fn:function(){return[t("button",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"brand-green-button full-width",on:{click:e.handleInstallPrompt}},[e._v("Add to home screen")])]},proxy:!0}],null,!1,890757402)}):e._e()},ns=[],is=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},os=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};let ls=class extends y.Y5{constructor(){super(...arguments),Object.defineProperty(this,"defferedInstallPrompt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"modal",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dismissedOnce",{enumerable:!0,configurable:!0,writable:!0,value:!0})}mounted(){const e=(0,h._U)((0,h.fU)("pwaInstall").lastShownDate),t=12096e5;!e||Date.now()>=e.getTime()+t?this.dismissedOnce=!1:this.dismissedOnce=!0}get showInstallPrompt(){return this.defferedInstallPrompt&&this.$store.getters.userEmail&&!this.dismissedOnce}dismiss(){return os(this,void 0,void 0,(function*(){this.dismissedOnce=!0,(0,h.qe)("pwaInstall","lastShownDate",(0,h.Yq)(new Date)),this.$emit("dismiss")}))}handleInstallPrompt(){return os(this,void 0,void 0,(function*(){this.defferedInstallPrompt.prompt();const{outcome:e}=yield this.defferedInstallPrompt.userChoice;"accepted"==e?(this.dismissedOnce=!0,this.$emit("dismiss")):"dismissed"==e&&this.$emit("dismiss")}))}};is([(0,Z.kv)({type:Event,default:null})],ls.prototype,"defferedInstallPrompt",void 0),is([(0,Z.oS)()],ls.prototype,"modal",void 0),ls=is([(0,y.uA)({name:"PwaInstallPrompt",components:{Modal:M.A}})],ls);const cs=ls,ds=cs;var us=(0,C.A)(ds,ss,ns,!1,null,"22febeaf",null);const ps=us.exports;var ms=function(){var e=this,t=e._self._c;e._self._setupProxy;
1return e.showNotice?t("modal",{ref:"modal",attrs:{"modal-size":"medium","show-header":!1,"mobile-mode":"drawer"},on:{close:e.dismiss},scopedSlots:e._u([{key:"body",fn:function({closeModal:a}){return[t("button",{staticClass:"gray-button icon-button",on:{click:a}},[t("span",{staticClass:"material-icons muted"},[e._v("close")])]),t("div",{staticClass:"text-center hero-icon"},[t("span",{staticClass:"material-icons"},[e._v("trending_up")])]),t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"display-2"},[e._v("Help OGOR get smarter!")]),t("div",{staticClass:"gif-wrapper"},[t("img",{staticClass:"animation-gif",attrs:{src:r(3677),alt:"Yield data collection animation"}})]),t("div",{directives:[{name:"translate",rawName:"v-translate",value:{lastSeasonYear:e.lastSeasonYear},expression:"{ lastSeasonYear: lastSeasonYear }"}],staticClass:"emphasis text-center content-text"},[e._v(" Complete the obtained yield for the %{ lastSeasonYear } season at parcel level for the following crops: wheat, rapeseed, barley, sunflower, maize, and help us provide you with more accurate estimates. ")])]}},{key:"footer",fn:function(){return[t("button",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"brand-green-button full-width",on:{click:e.dismiss}},[e._v("Got it")])]},proxy:!0}],null,!1,3393085224)}):e._e()},hs=[],fs=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};const vs=a.Ay.extend({name:"LastSeasonYieldNoticePrompt",components:{Modal:M.A},data(){return{dismissedOnce:!0}},computed:{showNotice(){return!this.dismissedOnce&&this.inNoticePeriod},inNoticePeriod(){const e=(0,h.Gq)();return e>=f.CK.start&&e<=f.CK.end},lastSeasonYear(){return(new Date).getFullYear().toString()}},mounted(){const e=(0,h._U)((0,h.fU)("lastSeasonYieldNotice").lastShownDate),t=6048e5;(!e||Date.now()>=e.getTime()+t)&&(this.dismissedOnce=!this.inNoticePeriod)},methods:{dismiss(){return fs(this,void 0,void 0,(function*(){this.dismissedOnce=!0,(0,h.qe)("lastSeasonYieldNotice","lastShownDate",(0,h.Yq)(new Date)),this.$emit("dismiss")}))}}}),gs=vs;var ys=(0,C.A)(gs,ms,hs,!1,null,"40a9502a",null);const bs=ys.exports;var ws=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.showNotice?t("marquee",[t("div",{staticClass:"downtime-notice"},[t("span",{staticClass:"material-icons"},[e._v("info")]),t("span",[e._v(e._s(e.text))])])]):e._e()},_s=[],Cs=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};let Ps=class extends y.Y5{constructor(){super(...arguments),Object.defineProperty(this,"upcomingDowntime",{enumerable:!0,configurable:!0,writable:!0,value:[new Date("2021-11-25"),new Date("2021-12-02")]})}get showNotice(){if(!this.upcomingDowntime)return!1;const e=this.upcomingDowntime[1],t=(0,h.Gq)();return t<=e}get datePeriod(){if(!this.upcomingDowntime)return null;const[e,t]=this.upcomingDowntime,r=e.getFullYear()==t.getFullYear(),a=e.getMonth()==t.getMonth()&&r,s=e.getDate()==t.getDate()&&a,n=e.toLocaleDateString(this.$language.current,{year:r?void 0:"numeric",month:a?void 0:"long",day:"numeric"}),i=t.toLocaleDateString(this.$language.current,{year:"numeric",month:"long",day:"numeric"});return s?i:`${n} – ${i}`}get text(){return this.$gettext("New satellite images are not available for the next 48 hours, as we are working on an improved version of our service. We apologize and thank you for your understanding. For more information, please write to us at [email protected].")}};Ps=Cs([(0,y.uA)({name:"DowntimeNotice"})],Ps);const Ss=Ps,Is=Ss;var xs=(0,C.A)(Is,ws,_s,!1,null,"b27dcdca",null);const Os=xs.exports;var ks=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("dialog",{ref:"container",staticClass:"dialog",attrs:{id:"dialog-container"}},[t("div",e._b({tag:"component",staticClass:"dialog__header"},"component",e.header,!1),[t("h1",[e._v(e._s(e.header&&e.header.title))]),t("button",{staticClass:"btn round ml-auto",attrs:{type:"button"},on:{click:function(t){return e.$dialog.close()}}},[t("span",{staticClass:"material-icons"},[e._v("close")])])]),t("div",{staticClass:"dialog__body"},[t(e.component,e._g(e._b({tag:"component"},"component",e.props,!1),e.handlers))],1)],1)},As=[],$s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"__header"},[e._t("leading"),e._t("default"),e._t("trailing")],2)},Fs=[];const Ds={name:"DialogHeader",props:{title:{type:String}}},js=Ds;var Es=(0,C.A)(js,$s,Fs,!1,null,null,null);const Ns=Es.exports,Ts={current:a.Ay.observable({component:null,props:null,handlers:null}),showModal(e,t,r){this.current.component=e,this.current.props=t,this.current.handlers=r},close(){const e=document.querySelector("#dialog-container");e.classList.add("out"),setTimeout((()=>{e.classList.add("out"),this.current.component=null,this.current.props=null,this.current.handlers=null}),200)}},Ls=y.lD.extend({inject:["currentDialog"],data(){return{component:null,props:null,handlers:null,header:{title:"Default header title"},headerComponent:Ns}},watch:{"currentDialog.component"(e,t){const r=this.$refs.container;e?e!==t&&r.showModal():r.close(),this.component=e},"currentDialog.props"(e){this.props=e;const t=null===e||void 0===e?void 0:e.meta;if(t){const e="function"===typeof t.title?t.title(this):t.title||"Default header title";this.header=Object.assign(Object.assign({},t),{title:e})}else this.header={title:""}},"currentDialog.handlers"(e){this.handlers=e}},mounted(){const e=this.$refs.container;e.addEventListener("close",(e=>{e.preventDefault(),Ts.close()}))},methods:{setHeaderProps(e){this.header=Object.assign({},e)}}}),Ms=Ls;var Rs=(0,C.A)(Ms,ks,As,!1,null,null,null);const qs=Rs.exports;var Us=r(173);const Bs=()=>r.e(933).then(r.bind(r,9948)),Hs=()=>r.e(933).then(r.bind(r,2952)),Gs=()=>r.e(933).then(r.bind(r,682)),Ys=()=>r.e(933).then(r.bind(r,513)),Vs=()=>r.e(933).then(r.bind(r,3613)),Ws=()=>r.e(933).then(r.bind(r,1762)),zs=()=>r.e(933).then(r.bind(r,8494)),Ks=()=>r.e(933).then(r.bind(r,5921)),Js=()=>r.e(933).then(r.bind(r,5779)),Xs=()=>Promise.all([r.e(304),r.e(58),r.e(543),r.e(694),r.e(364),r.e(361),r.e(37),r.e(374),r.e(98),r.e(206)]).then(r.bind(r,2794)),Zs=()=>Promise.all([r.e(304),r.e(58),r.e(543),r.e(694),r.e(364),r.e(361),r.e(37),r.e(374),r.e(98),r.e(206)]).then(r.bind(r,9071)),Qs=()=>Promise.all([r.e(304),r.e(58),r.e(543),r.e(694),r.e(364),r.e(361),r.e(37),r.e(374),r.e(98),r.e(206)]).then(r.bind(r,398)),en=()=>r.e(185).then(r.bind(r,8031)),tn=()=>Promise.all([r.e(304),r.e(364),r.e(361),r.e(353)]).then(r.bind(r,3811)),rn=()=>r.e(626).then(r.bind(r,6026)),an=()=>Promise.all([r.e(364),r.e(587)]).then(r.bind(r,800)),sn=()=>Promise.all([r.e(364),r.e(587)]).then(r.bind(r,1018)),nn=()=>Promise.all([r.e(304),r.e(58),r.e(378),r.e(374),r.e(959)]).then(r.bind(r,7711)),on=()=>Promise.all([r.e(304),r.e(58),r.e(378),r.e(374),r.e(959)]).then(r.bind(r,8289)),ln=()=>Promise.all([r.e(304),r.e(58),r.e(378),r.e(374),r.e(959)]).then(r.bind(r,1660)),cn=()=>Promise.all([r.e(304),r.e(58),r.e(378),r.e(374),r.e(959)]).then(r.bind(r,7349)),dn=()=>r.e(515).then(r.bind(r,3534)),un=()=>Promise.all([r.e(304),r.e(58),r.e(320)]).then(r.bind(r,3583)),pn=()=>Promise.all([r.e(304),r.e(58),r.e(378),r.e(98),r.e(859)]).then(r.bind(r,7608)),mn=()=>Promise.all([r.e(304),r.e(58),r.e(71)]).then(r.bind(r,4430)),hn=()=>r.e(107).then(r.bind(r,3332)),fn=()=>Promise.all([r.e(694),r.e(943),r.e(153)]).then(r.bind(r,4556)),vn=()=>Promise.all([r.e(304),r.e(694),r.e(37),r.e(943),r.e(686)]).then(r.bind(r,6110));a.Ay.use(Us.A);const gn=[{path:"/demo-farm",name:"demo-farm",component:Qs,meta:{requireAuth:!1,mobileSupport:!0}},{path:"/auth",component:Bs,meta:{requireAuth:!1,public:!0},children:[{path:"login",component:Hs,name:"login",meta:{requireAuth:!1,public:!0}},{path:"new-account",component:Js,name:"new-account",meta:{requireAuth:!1,public:!0}},{path:"forgot-password",component:Gs,name:"forgot-password",meta:{requireAuth:!1,public:!0}},{path:"reset-password",component:Ys,name:"reset-password",meta:{requireAuth:!1,public:!0,noRedirect:!0}},{path:"facebook",component:Ws,name:"oauth",meta:{requireAuth:!1,public:!0}},{path:"account-confirm",component:Vs,name:"account-confirm",meta:{requireAuth:!1,public:!0,noRedirect:!0}},{path:"email-confirmation",component:zs,name:"email-confirmation",meta:{requireAuth:!1,public:!0,noRedirect:!0}}]},{path:"/redirect",component:Ks,name:"redirect",meta:{requireAuth:!1,public:!0}}
1,{path:"/manage/farm/:farmId/season/:seasonId?/choose-import-type",component:nn,name:"choose-import-type",meta:{mobileSupport:!0}},{path:"/manage/farm/:farmId",name:"manage-farm",component:nn,meta:{requireAuth:!0,requireFullAccess:!0,showSignupPopup:!1,mobileSupport:!0,displayName:e=>e.$gettext("Manage farm")},children:[{path:"season/:seasonId?/apia-tutorial",component:on,name:"apia-tutorial",meta:{mobileSupport:!0}}]},{path:"/farm/:farmId?",name:"crop-overview",component:Xs,meta:{requireAuth:!1,displayName:e=>e.$gettext("Crops")}},{path:"/farm/:farmId/season/:seasonId/date/:date/",name:"crop-overview-date-selected",component:Xs,meta:{requireAuth:!1,displayName:e=>e.$gettext("Crops")}},{path:"/grid/:farmId?",name:"grid",component:Zs,meta:{requireAuth:!1}},{path:"/grid/:farmId/season/:seasonId/date/:date/offset/:offset?",name:"grid-date-selected",component:Zs,meta:{requireAuth:!1}},{path:"/map/:farmId/draw/:seasonId",name:"map-draw",component:cn,props:!0,meta:{requireAuth:!0,mobileSupport:!0}},{path:"/map/:farmId/soil/:seasonId",name:"soil-map",component:mn,props:!0,meta:{requireAuth:!0,mobileSupport:!0}},{path:"/map/:farmId/soil/:seasonId/parcel/:parcelId",name:"soil-map-parcel-selected",component:mn,props:!0,meta:{requireAuth:!0,mobileSupport:!0}},{path:"/map/:farmId/file/:batchFileId",name:"map-preview",component:ln,props:!0,meta:{requireAuth:!1,mobileSupport:!0}},{path:"/map/:farmId?",name:"map",component:Qs,meta:{requireAuth:!1,mobileSupport:!0}},{path:"/map/:farmId/season/:seasonId/",name:"map-season-selected",component:Qs,meta:{requireAuth:!1,mobileSupport:!0}},{path:"/map/:farmId/season/:seasonId/date/:date",name:"map-date-selected",component:Qs,meta:{requireAuth:!1,mobileSupport:!0}},{path:"/map/:farmId/season/:seasonId/parcel/:parcelId/details/:selectedTab?",name:"map-parcel-selected",component:Qs,meta:{requireAuth:!1,mobileSupport:!0},alias:["/map/:farmId/season/:seasonId/parcel/:parcelId"]},{path:"/map/:farmId/season/:seasonId/date/:date/parcel/:parcelId/details/:selectedTab?",name:"map-observation-details",component:Qs,meta:{requireAuth:!1,mobileSupport:!0},alias:["/map/:farmId/season/:seasonId/date/:date/parcel/:parcelId"]},{path:"/map/:farmId/season/:seasonId/parcel/:parcelId/details/:selectedTab?",name:"map-shared-parcel",component:Qs,meta:{requireAuth:!1,mobileSupport:!0},alias:["/map/:farmId/season/:seasonId/parcel/:parcelId/"]},{path:"/snapshot/:farmId/season/:seasonId/date/:date/parcel/:parcelId",name:"snapshot",component:rn,meta:{requireAuth:!1,showSignupPopup:!0}},{path:"/farm/:farmId/season/:seasonId/parcel/:parcelId/history",name:"parcel-history",component:tn,meta:{requireAuth:!1,showSignupPopup:!0}},{path:"/farm/:farmId/season/:seasonId/parcel/:parcelId/interval/:intervalId/history",name:"parcel-history-crop-interval",component:tn,meta:{requireAuth:!1,showSignupPopup:!0}},{path:"/user-settings",name:"user-settings",component:en,meta:{requireAuth:!0,displayName:e=>e.$gettext("Your account"),mobileSupport:!0}},{path:"/farm/:farmId/season/:seasonId/compare",name:"compare-parcels",component:an,meta:{requireAuth:!1,showSignupPopup:!0}},{path:"/farm/:farmId/season/:seasonId/parcel/:parcelId/compare",name:"compare-observations",component:sn,meta:{requireAuth:!1,showSignupPopup:!0}},{path:"/myalcedosoil",name:"alcedo-landing",component:dn,props:!0,meta:{requireAuth:!1,public:!0,noRedirect:!0,mobileSupport:!0}},{path:"/myalcedosoil/:farmId",name:"alcedo-order",component:un,props:!0,meta:{public:!0,noRedirect:!0,noPaywall:!0,mobileSupport:!0}},{path:"/myalcedosoil/:farmId/order/:orderId",name:"alcedo-results",component:pn,props:!0,meta:{mobileSupport:!0,noPaywall:!0,noRedirect:!0}},{path:"/staff/users",name:"staff-users",component:hn,meta:{requireAuth:!0,requireStaff:!0,mobileSupport:!0,displayName:e=>e.$gettext("Users")}},{path:"/farm/:farmId/season/:seasonId/parcel/:parcelId/parcel_details/:date?",name:"parcel-details",component:fn,meta:{requireAuth:!0,mobileSupport:!0}},{path:"./crop-plan-update-target",name:"CropPlanUpdateTarget",meta:{title:e=>e.$gettext("Target yield")},component:()=>Promise.all([r.e(543),r.e(532)]).then(r.bind(r,532)),props:!0},{path:"./crop-plan-close",name:"CropPlanClose",meta:{title:e=>e.$gettext("Close worksheet")},component:()=>r.e(168).then(r.bind(r,8168)),props:!0},{path:"./activity-close",name:"ActivityClose",meta:{title:e=>e.$gettext("Close activity")},component:()=>r.e(143).then(r.bind(r,1143)),props:!0},{path:"./activity-update-cost",name:"ActivityUpdateCost",meta:{title:e=>e.$gettext("Activity cost")},component:()=>Promise.all([r.e(543),r.e(873)]).then(r.bind(r,1254)),props:!0},{path:"./activity-update-interval",name:"ActivityUpdateInterval",meta:{title:e=>e.$gettext("Execution period")},component:()=>r.e(254).then(r.bind(r,254)),props:!0},{path:"/farm/:farmId/season/:seasonId/crop/:cropId/crop_details/:date?",name:"crop-details",component:vn,meta:{requireAuth:!0,mobileSupport:!0}}],yn=Us.A.prototype.push;Us.A.prototype.replace;Us.A.prototype.push=function(e){if("object"!==typeof e||!e.as||"modal"!==e.as)return yn.apply(this,arguments);{const t=this.match(e),r=t.matched[0].components.default,a=Object.assign(Object.assign({},e.params),{meta:t.meta});Ts.showModal(r,a)}};
1const bn=new Us.A({mode:"history",base:"/",routes:gn});function wn(e){return e.matched.reduce(((e,t)=>(Object.assign(e,t.meta||{}),e)),{})}bn.beforeEach(((e,t,r)=>{(0,h.Qu)()&&e.meta.noStandalone?r({name:"redirect"}):!(0,h.Fr)()||e.meta.public||e.meta.mobileSupport?r():r({name:"redirect"})}));const _n=bn;var Cn=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},Pn=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};const Sn=(0,h.cn)(["user","userEmail","userLastName","userFirstName","userLicense","userLicenseIsTrial","userLicenseIsActive","userLatestLegalConsent","userIsAuthenticated","farms","farmIds","allFarms","userOwnsFarm","userHasAccessToFarm","userHasFullAccessToFarm","totalFarms","currentFarm","currentFarmId","currentSeason","currentSeasonId","totalSeasons","seasons","availableDates","selectedDate","defaultUserFarm","farmsWithParcels","isDemoFarm","demoFarmId","defaultDemoSeasonId","showSearchSidebar","selectedParcelId"]);let In=class extends((0,y.vE)(y.Y5,Sn)){constructor(){super(...arguments),Object.defineProperty(this,"online",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"emailWarned",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"errorCode",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"dataLoaded",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"showChangeParcelCrop",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"showJournalDialog",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"showSetCropsModal",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"defferedInstallPrompt",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"selectedParcelIds",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"pwaPromptDismissed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"yieldNoticeDismissed",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get isLicenseSuspended(){return this.userLicense&&"stop"===this.userLicense.status}get showDemoFarmPopup(){return!this.isLicenseSuspended&&!this.user.is_staff&&this.isDemoFarm&&((0,h.i5)(this.$route.params,"farmId")||"demo-farm"===this.$route.name)}get showPaywallModal(){return this.userEmail&&this.userLicense&&this.userLatestLegalConsent&&(!this.userLicenseIsActive||this.userLicenseIsTrial||this.userLicense.card_payment&&"succeeded"!==this.userLicense.card_payment.payment_status)&&!this.$route.meta.noPaywall}get showPwaPrompt(){return this.defferedInstallPrompt&&this.userEmail&&!this.pwaPromptDismissed}get showYieldNoticePrompt(){const e=!this.defferedInstallPrompt||!this.userEmail;return(this.pwaPromptDismissed||e)&&!this.yieldNoticeDismissed}languageChanged(){document.querySelector("html").setAttribute("lang",this.$language.current),this.setSentryData()}userEmailChanged(e){this.setSentryData(),e||this.$router.push({name:"redirect"})}userLatestLegalConsentChanged(){if("true"===f.KJ.VUE_APP_ENABLE_TRACKERS&&this.userLatestLegalConsent){let e=(new Date).toDateString(),t=47304e4;document.cookie=`cookie_consent=YES+${e}; max-age=${t}; path=/`}}routeChanged(e,t){return Pn(this,void 0,void 0,(function*(){t.name||this.initPreferredLanguage(),this.dataLoaded&&(yield this.safeSetStateFromRoute())}))}created(){this.initSentry(),this.initEventHandlers(),this.initData().finally((()=>{this.dataLoaded=!0}))}mounted(){this.initInstallListerer(),this.addResizeListener(),this.checkPwaPromptDismissal()}addResizeListener(){this.$store.commit("setIsMobile",(0,h.Fr)()),window.addEventListener("resize",(()=>{this.$store.commit("setIsMobile",(0,h.Fr)())}))}onOnline(){return Pn(this,void 0,void 0,(function*(){!1===this.online&&(yield this.initData()),this.online=!0}))}onConnectError(){this.online=navigator.onLine}getNewestSeason(){if(this.seasons&&!(this.totalSeasons<=0))return Object.values(this.seasons).reduce(((e,t)=>t.start_date>e.start_date?t:e))}initPreferredLanguage(){let e;try{e=window.localStorage.getItem("language")}catch(a){}let t=window.navigator.language.slice(0,2);"en"===t&&(t="ro");let r=this.user.preferred_language||e||this.$route.meta.lang||this.$route.params.lang||this.$route.query.lang||f.KJ.VUE_APP_DEFAULT_LANGUAGE||t||"ro";r=r.toLowerCase().slice(0,2),this.$language.available&&this.$language.available[r]||(r="ro"),(0,m.xC)(r,this,!1)}initData(){return Pn(this,void 0,void 0,(function*(){return yield this.$store.dispatch("getInitialData"),yield this.safeSetStateFromRoute()}))}safeSetStateFromRoute(){return Pn(this,void 0,void 0,(function*(){try{return yield this.setStateFromRoute()}catch(e){switch(e.statusCode){case 404:this.notify({type:"warning",text:this.$gettext("Unable to find the requested data.")});break;case 403:case 401:return this.userEmail?this.errorCode=403:yield this.$store.dispatch("clearState"),!1;default:throw e}}return!0}))}setStateFromRoute(){return Pn(this,void 0,void 0,(function*(){if(this.$route.name&&this.$route.name.includes("map")||this.closeSearchSidebar(),this.$route.query.u&&this.$store.commit("setLinkEmail",this.$route.query.u),this.$route.meta.requireStaff&&!this.user.is_staff)return this.errorCode=403,!0;
1if(yield this.maybeRedirect())return!0;const e=wn(this.$route);return!(!e.public&&this.$route.name)||(yield this.loadFarmData(),yield this.loadSeasonAndDates(),yield this.loadParcelData(),yield this.loadRasterData(),this.userIsAuthenticated&&(yield this.$store.dispatch("getNotesForCurrentFarm")),!(e.requireFullAccess&&!this.userHasFullAccessToFarm)||(this.errorCode=403,!0))}))}loadRasterData(){return Pn(this,void 0,void 0,(function*(){const e=this.$route.query.rasterKind;e&&f._N.has(e)?this.$store.commit("setRasterKind",e):this.$store.commit("setRasterKind",f.JY)}))}loadFarmData(){return Pn(this,void 0,void 0,(function*(){const e=this.$route.params.farmId||"demo-farm"===this.$route.name&&this.demoFarmId||this.currentFarmId||this.defaultUserFarm&&this.defaultUserFarm.id;try{this.allFarms[e]||(yield this.$store.dispatch("getSingleSharedFarm",e)),yield this.$store.dispatch("setCurrentFarm",e)}catch(t){if(403!==t.statusCode)throw t;if(this.$route.params.parcelId)return void this.$store.commit("setCurrentFarmId",e);const r=this.farmsWithParcels.find((t=>t.id!==e&&!t.licenseExpired));if(r)return this.notify({type:"warning",text:this.$gettext("The selected farm is no longer accessible. Switching to another farm.")}),void(yield this.$router.replace({name:"map",params:{farmId:r.id}}));throw t}}))}loadSeasonAndDates(){return Pn(this,void 0,void 0,(function*(){const e=this.$route.params.seasonId,t=(0,h._U)(this.$route.params.date),r=this.seasons[e],a=this.getNewestSeason();let s;this.userHasAccessToFarm?(s=t||r&&this.isDemoFarm&&r.id===this.defaultDemoSeasonId&&f.C4||!r&&this.isDemoFarm&&f.C4||(0,h.__)(r,this.availableDates)||r&&r.end_date||(0,h.__)(this.getNewestSeason(),this.availableDates)||this.availableDates[0]||(0,h.Gq)(),yield this.$store.dispatch("setSelectedDateAndSeason",{date:s,seasonId:e})):(yield this.$store.dispatch("getSeasonDetails",e||a.id),this.$store.commit("setCurrentSeasonId",e||a.id),t?this.$store.commit("setSelectedDate",t):this.currentSeason&&this.currentSeason.end_date&&this.$store.commit("setSelectedDate",this.currentSeason.end_date))}))}loadParcelData(){return Pn(this,void 0,void 0,(function*(){const e=this.$route.params.parcelId,t=this.$route.params.intervalId;e?(yield this.$store.dispatch("setCurrentParcel",e),this.$store.commit("setSelectedParcelCropIntervalId",t)):(yield this.$store.dispatch("setCurrentParcel",null),this.$store.commit("setSelectedParcelCropIntervalId",null))}))}maybeRedirect(){return Pn(this,void 0,void 0,(function*(){const e=wn(this.$route);return"redirect"!==this.$route.name&&!e.noRedirect&&(this.userLicense&&!this.userLicenseIsActive&&e.requireAuth?(yield this.$router.push({name:"redirect"}),!0):void 0)}))}initEventHandlers(){p.A.$on(p.A.events.requestStarted,(()=>{this.$store.dispatch("startProgress",this)})),p.A.$on(p.A.events.requestFinished,(()=>{this.$store.dispatch("finishProgress",this)})),p.A.$on(p.A.events.apiUnknownError,(()=>{this.notify({type:"error",text:this.$gettext("Server returned an unknown error. Please try again later.")})})),p.A.$on(p.A.events.apiReadError,(()=>{this.notify({type:"error",text:this.$gettext("Unable to read data from to server. Please try again later.")})})),p.A.$on(p.A.events.apiConnectError,(()=>{this.notify({type:"error",text:this.$gettext("Unable to connect to server. Please try again later.")})})),p.A.$on(p.A.events.apiConnectError,this.onConnectError),p.A.$on(p.A.events.showChangeParcelCrop,(()=>{this.showChangeParcelCrop=!0})),p.A.$on(p.A.events.showJournalDialog,(()=>{this.showJournalDialog=!0})),p.A.$on("set-crops-modal",((e,t)=>{this.showSetCropsModal=e,this.selectedParcelIds=t}))}initSentry(){return Pn(this,void 0,void 0,(function*(){if(!f.nI)return;const e={dsn:f.KJ.VUE_APP_SENTRY_DSN,blacklistUrls:[/extensions\//i,/^chrome:\/\//i]};f.KJ.VUE_APP_SENTRY_ENV&&(e.environment=f.KJ.VUE_APP_SENTRY_ENV),f.KJ.VUE_APP_SENTRY_RELEASE?e.release=f.KJ.VUE_APP_SENTRY_RELEASE:f.KJ.VUE_APP_VERSION&&(e.release=f.KJ.VUE_APP_VERSION),(yield(0,h._A)()).init(e),yield this.setSentryData()}))}setSentryData(){return Pn(this,void 0,void 0,(function*(){if(!f.nI)return;const e=yield(0,h._A)();this.$nextTick((()=>{e.configureScope((e=>{e.setUser({email:this.userEmail?this.userEmail:void 0})})),e.setTag("page_locale",this.$language.current)}))}
1))}initInstallListerer(){window.addEventListener("beforeinstallprompt",(e=>{e.preventDefault(),this.defferedInstallPrompt=e}))}onPwaPromptDismissed(){this.pwaPromptDismissed=!0}onYieldNoticeDismissed(){this.yieldNoticeDismissed=!0}checkPwaPromptDismissal(){const e=(0,h._U)((0,h.fU)("pwaInstall").lastShownDate),t=12096e5;!e||Date.now()>=e.getTime()+t?this.pwaPromptDismissed=!1:this.pwaPromptDismissed=!0}onCropsChanged(e){try{e.forEach((e=>{const t=this.$store.getters.parcelIndex[e.id];t&&(t.crop_intervals=e.crop_intervals);const r=this.$store.getters.parcelsForCurrentSeason,a=r.findIndex((t=>t.id===e.id));-1!==a&&(r[a].crop_intervals=e.crop_intervals)})),this.$emit("change")}catch(t){console.error(t),this.notify({type:"error",text:this.$gettext("Unable to locally update parcels after crop change.")})}}};Cn([(0,Z.ox)("$language.current")],In.prototype,"languageChanged",null),Cn([(0,Z.ox)("userEmail")],In.prototype,"userEmailChanged",null),Cn([(0,Z.ox)("userLatestLegalConsent")],In.prototype,"userLatestLegalConsentChanged",null),Cn([(0,Z.ox)("$route")],In.prototype,"routeChanged",null),In=Cn([(0,y.uA)({name:"App",components:{AppSidebarTransition:Wa,SearchSidebar:ur,PayWall:$t,DemoFarmModal:V,HijackNotification:N,ErrorPage:S,PolicyUpdatePopup:ue,CookieConsent:be,ChangeParcelCrop:pr.A,OgorNotifications:as,PwaInstallPrompt:ps,LastSeasonYieldNoticePrompt:bs,DowntimeNotice:Os,DialogManager:qs,JournalDialog:Cr,SetCropsModal:Wt.A},head:{link(){return Object.keys(this.$language.available).map((e=>({rel:"alternate",hreflang:e,href:`${f.KJ.VUE_APP_HOST}/${e}`,id:`hreflang-alternate-${e}`}))).concat([{rel:"alternate",hreflang:"x-default",href:f.KJ.VUE_APP_HOST,id:"hreflang-alternate-default"}])},meta(){var e;let t={};(null===(e=this.$route.meta)||void 0===e?void 0:e.seo)&&(t="function"==typeof this.$route.meta.seo?this.$route.meta.seo(this):this.$route.meta.seo);const r=t.title||this.$gettext("OGOR. Monitoring farm fields with satellites."),a=t.description||this.$gettext("Up to date history on every field in your farm, auto-generated using satellite images. See the crop evolution, fertility areas and productivity on different parcels."),s=e=>e?f.KJ.VUE_APP_HOST+e:null,n=s(t.image)||s("/ogor_social.jpg"),i=[{name:"application-name",content:r,id:"app-name"},{name:"description",content:a,id:"app-desc"},{property:"og:title",content:r,id:"og-app-title"},{property:"og:description",content:a,id:"og-app-desc"},{property:"og:image",content:n,id:"og-app-image"},{name:"twitter:title",content:r,id:"og-twitter-title"},{name:"twitter:description",content:a,id:"og-twitter-desc"},{property:"twitter:image",content:n,id:"twitter-app-image"},{property:"twitter:card",content:"summary_large_image",id:"twitter-app-card"},{itemprop:"name",content:r,id:"g-app-title"},{itemprop:"description",content:a,id:"g-app-desc"}];if(Object.keys(t).length>0){const e=f.KJ.VUE_APP_HOST+this.$route.path;i.push({property:"og:url",content:e,id:"og-url"})}return i}}})],In);const xn=In,On=xn;var kn=(0,C.A)(On,d,u,!1,null,null,null);const An=kn.exports;var $n=r(1783),Fn=r(6604),Dn=r(2727),jn=r(5194),En=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"ogor-menu-container"},[t("div",{ref:"activator",staticClass:"ogor-menu-activator",on:{click:e.maybeOpenMenu}},[e._t("activator")],2),e.isNestedMenu?[t("transition",{attrs:{name:"fade-scale"}},[t("div",{directives:[{name:"show",rawName:"v-show",value:e.showMenu,expression:"showMenu"}],ref:"menu",staticClass:"ogor-menu",class:{visible:e.showMenu},style:e.menuStyle},[e._t("default",null,{closeMenu:e.closeMenu})],2)])]:e._e(),t("transition",{attrs:{name:"fade"}},[e.isNestedMenu?e._e():t("div",{directives:[{name:"show",rawName:"v-show",value:e.showMenu,expression:"showMenu"}],staticClass:"ogor-menu-body overlay"},[t("div",{staticClass:"overlay",on:{click:function(t){e.closeOnClickOutside&&e.closeMenu()}}}),t("div",{ref:"menu",staticClass:"ogor-menu",class:{visible:e.showMenu},style:e.menuStyle},[e._t("default",null,{closeMenu:e.closeMenu})],2)])])],2)},Nn=[],Tn=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};let Ln=class extends y.Y5{constructor(){super(...arguments),Object.defineProperty(this,"$props",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"$scopedSlots",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"$emit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"menuStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"placement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"anchors",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"closeOnClickOutside",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"activatorPadding",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"beforeClose",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"activatorActiveClass",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"disabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"activator",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showMenu",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isNestedMenu",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"itemList",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"selectedItemIndex",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"selectedNestedMenuItem",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"lastOpenendNestedMenu",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"lastFocusedIndex",{enumerable:!0,configurable:!0,writable:!0,value:null})}selectedNestedMenuItemChange(e){this.isNestedMenu&&(this.$parent.$parent.selectedNestedMenuItem=e)}lastOpenendNestedMenuChange(e){this.isNestedMenu&&(this.$parent.$parent.lastOpenendNestedMenu=e)}showMenuChange(e){if(e&&this.$nextTick((()=>{this.$refs.menu.scrollTop=0})),this.isNestedMenu)return;const t=this.activator.firstElementChild;e?(null===t||void 0===t||t.classList.add(this.activatorActiveClass),window.addEventListener("scroll",this.handleScroll,!0),window.addEventListener("keydown",this.handleKeyDown)):(null===t||void 0===t||t.classList.remove(this.activatorActiveClass),window.removeEventListener("scroll",this.handleScroll,!0),window.removeEventListener("keydown",this.handleKeyDown))}created(){this.isNestedMenu=this.$parent.nested}beforeDestroy(){window.removeEventListener("scroll",this.handleScroll,!0),window.removeEventListener("keydown",this.handleKeyDown)}mounted(){this.isNestedMenu&&(this.activator.addEventListener("mouseenter",this.handleMouseEnter),this.activator.addEventListener("focusin",(()=>{this.$parent.$parent.selectedNestedMenuItem=this})),this.activator.addEventListener("focusout",(()=>{this.$parent.$parent.selectedNestedMenuItem==this&&(this.$parent.$parent.selectedNestedMenuItem=null)})),this.$el.addEventListener("mouseleave",this.handleMouseLeave)),this.itemList=[...this.$el.querySelector(".ogor-menu").children].map((e=>e.querySelector("div > .ogor-menu-container > .ogor-menu-activator > button, div > button"))).filter((e=>!!e))}alignMenu(e,t,r){const a=window.innerWidth,s=window.innerHeight,n=this.$refs.menu,i=n.offsetWidth,o=n.offsetHeight,l=(r||this.activator).getBoundingClientRect(),c={x:"left",y:"top"},d=e.split("-");c.x=d[1],c.y=d[0];const u=(e,t,r,n=0)=>{const c="x"==e?a:s,d="x"==e?i:o,p="x"==e?["left","right"]:["top","bottom"];let m=0;if("start"==t?m=r?l[p[0]]:l[p[1]]:"end"==t&&(m=r?c-l[p[0]]:c-l[p[1]]),!(d<=m)){if(0==n){let a="start"==t?"end":"start",s=u(e,a,!r,1);if(s)return s;if("start"==t)return{[p[0]]:16};if("end"==t)return{[p[1]]:16}}return null}if("y"==e){if(l[p[1]]>c-8)return{[p[1]]:8};if(l[p[0]]<8)return{[p[0]]:8}}return"start"==t?r?{[p[0]]:l[p[0]]-d}:{[p[0]]:l[p[1]]-d}:"end"==t?r?{[p[0]]:l[p[0]]}:{[p[0]]:l[p[1]]}:void 0};let p={top:null,left:null,bottom:null,right:null};const m=t.split("-").map((e=>"start"==e));p="left"==c.x?Object.assign(Object.assign({},p),u("x","start",m[1])):Object.assign(Object.assign({},p),u("x","end",m[1])),p="top"==c.y?Object.assign(Object.assign({},p),u("y","start",m[0])):Object.assign(Object.assign({},p),u("y","end",m[0]));const h=Object.keys(p);h.forEach((e=>{const t=p[e];n.style[e]=null!=t?t+"px":null}))}openMenu(e){if(this.disabled)return;this.showMenu=!0,this.$emit("open",!0);let t=null;e&&(t=document.createElement("div"),t.style.position="fixed",t.style.visibility="hidden",t.style.left=e.clientX+"px",t.style.top=e.clientY+"px",t.style.padding=this.activatorPadding,t.style.transform="translate(-50%, -50%)",document.body.append(t)),this.$nextTick((()=>{this.alignMenu(this.placement,this.anchors,t),null===t||void 0===t||t.remove()}))}
1closeMenu(){if(!this.beforeClose())return!1;if(this.isNestedMenu)this.$parent.closeMenu(),window.setTimeout((()=>{this.showMenu=!1}),300);else if(this.showMenu=!1,this.lastOpenendNestedMenu){const e=this.lastOpenendNestedMenu;this.lastOpenendNestedMenu=null,e.closeMenu()}return this.$emit("close"),!0}maybeOpenMenu(){this.isNestedMenu||this.openMenu()}handleMouseEnter(){this.lastOpenendNestedMenu=this,this.selectedItemIndex=null,this.openMenu()}handleMouseLeave(){this.showMenu=!1;const e=this.lastOpenendNestedMenu.$parent.$parent;this.lastOpenendNestedMenu=e.isNestedMenu?e:null}focusItem(e){var t;const r=(null===(t=this.lastOpenendNestedMenu)||void 0===t?void 0:t.itemList)||this.itemList,a=r.length;e<0&&(e+=a),e%=a,r[e].focus(),this.selectedItemIndex=e}handleKeyDown(e){var t,r;if(["INPUT","TEXTAREA"].includes(document.activeElement.tagName)&&"Escape"!=e.key)return;if(e.preventDefault(),!this.showMenu)return;let a,s;switch(e.key){case"ArrowDown":null==this.selectedItemIndex?this.focusItem(0):this.focusItem(this.selectedItemIndex+1);break;case"ArrowUp":this.focusItem(this.selectedItemIndex-1);break;case" ":case"Enter":if(a=(null===(t=this.lastOpenendNestedMenu)||void 0===t?void 0:t.itemList)||this.itemList,s=a[this.selectedItemIndex],!s.dataset.menu){s.click();break}case"ArrowRight":if(null==this.selectedItemIndex)return;if(a=(null===(r=this.lastOpenendNestedMenu)||void 0===r?void 0:r.itemList)||this.itemList,s=a[this.selectedItemIndex],!s.dataset.menu)return;this.selectedNestedMenuItem.openMenu(),this.lastOpenendNestedMenu=this.selectedNestedMenuItem,this.selectedNestedMenuItem.lastFocusedIndex=this.selectedItemIndex,this.$nextTick((()=>{this.focusItem(0)}));break;case"ArrowLeft":if(this.lastOpenendNestedMenu){this.lastOpenendNestedMenu.showMenu=!1;const e=this.lastOpenendNestedMenu.lastFocusedIndex||0,t=this.lastOpenendNestedMenu.$parent.$parent;this.lastOpenendNestedMenu=t.isNestedMenu?t:null,this.focusItem(e)}break;case"Escape":this.closeMenu();break}}handleScroll(e){this.$el.contains(e.target)||this.closeMenu()}};Tn([(0,Z.kv)({type:Object,required:!1,default:()=>{}})],Ln.prototype,"menuStyle",void 0),Tn([(0,Z.kv)({type:String,required:!1,default:"bottom-right"})],Ln.prototype,"placement",void 0),Tn([(0,Z.kv)({type:String,required:!1,default:"end-start"})],Ln.prototype,"anchors",void 0),Tn([(0,Z.kv)({type:Boolean,required:!1,default:!0})],Ln.prototype,"closeOnClickOutside",void 0),Tn([(0,Z.kv)({type:String,required:!1})],Ln.prototype,"activatorPadding",void 0),Tn([(0,Z.kv)({type:Function,required:!1,default:()=>()=>!0})],Ln.prototype,"beforeClose",void 0),Tn([(0,Z.kv)({type:String,required:!1,default:"active"})],Ln.prototype,"activatorActiveClass",void 0),Tn([(0,Z.kv)({type:Boolean,required:!1,default:!1})],Ln.prototype,"disabled",void 0),Tn([(0,Z.oS)()],Ln.prototype,"activator",void 0),Tn([(0,Z.ox)("selectedNestedMenuItem")],Ln.prototype,"selectedNestedMenuItemChange",null),Tn([(0,Z.ox)("lastOpenendNestedMenu")],Ln.prototype,"lastOpenendNestedMenuChange",null),Tn([(0,Z.ox)("showMenu")],Ln.prototype,"showMenuChange",null),Ln=Tn([(0,y.uA)({name:"Menu"})],Ln);const Mn=Ln,Rn=Mn;var qn=(0,C.A)(Rn,En,Nn,!1,null,"55e65f6a",null);const Un=qn.exports;var Bn=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[e.$attrs.href?t("a",{staticClass:"ogor-menu-item",attrs:{href:e.$attrs.href,tabindex:"-1"}},[t("div",{staticClass:"ogor-menu-item-inner"},[e._t("default")],2)]):e.nested?t("ogor-menu",{attrs:{"menu-style":e.menuStyle,placement:e.placement,anchors:e.anchors},scopedSlots:e._u([{key:"activator",fn:function(){return[t("button",{staticClass:"ogor-menu-item",attrs:{tabindex:"-1","data-menu":"1"}},[t("div",{staticClass:"ogor-menu-item-inner"},[e._t("default")],2),t("div",{staticClass:"nest-icon material-icons"},[e._v("chevron_right")])])]},proxy:!0}],null,!0)},[e._t("items")],2):t("button",{staticClass:"ogor-menu-item",class:{clickable:e.clickable,toggleable:e.toggleable,disabled:e.disabled},attrs:{tabindex:"-1"}},[e.toggleable?t("span",{directives:[{name:"visible",rawName:"v-visible",value:e.value,expression:"value"}],staticClass:"material-icons toggle"}
1,[e._v(" done ")]):e._e(),t("div",{staticClass:"ogor-menu-item-inner"},[e._t("default")],2)])],1)},Hn=[],Gn=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};let Yn=class extends y.Y5{constructor(){super(...arguments),Object.defineProperty(this,"$props",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"$emit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clickable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nested",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"toggleable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"disabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"menuStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"placement",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"anchors",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}mounted(){(this.clickable||this.toggleable)&&this.$el.addEventListener("click",this.handleClick)}beforeDestroy(){this.$el.removeEventListener("click",this.handleClick)}closeMenu(){var e;(null===(e=this.$parent)||void 0===e?void 0:e.closeMenu)&&this.$parent.closeMenu()}handleClick(){this.nested||this.disabled||(this.toggleable&&this.$emit("input",!this.value),this.closeMenuAndEmit())}closeMenuAndEmit(){this.closeMenu(),this.$emit("click")}};Gn([(0,Z.kv)({type:Boolean,default:!0})],Yn.prototype,"clickable",void 0),Gn([(0,Z.kv)({type:Boolean,default:!1})],Yn.prototype,"nested",void 0),Gn([(0,Z.kv)({type:Boolean,default:!1})],Yn.prototype,"toggleable",void 0),Gn([(0,Z.kv)({type:Boolean,default:!1})],Yn.prototype,"value",void 0),Gn([(0,Z.kv)({type:Boolean,default:!1})],Yn.prototype,"disabled",void 0),Gn([(0,Z.kv)({type:Object,required:!1,default:()=>{}})],Yn.prototype,"menuStyle",void 0),Gn([(0,Z.kv)({type:String,required:!1,default:"bottom-right"})],Yn.prototype,"placement",void 0),Gn([(0,Z.kv)({type:String,required:!1,default:"start-end"})],Yn.prototype,"anchors",void 0),Yn=Gn([(0,y.uA)({name:"MenuItem",components:{OgorMenu:Un}})],Yn);const Vn=Yn,Wn=Vn;var zn=(0,C.A)(Wn,Bn,Hn,!1,null,"07c5a6fc",null);const Kn=zn.exports;var Jn=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{ref:"safeArea",staticClass:"safe-area",class:{emulateSwipeBar:e.emulateSwipeBar},style:{background:e.background}},[e._t("default")],2)},Xn=[],Zn=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const Qn=(0,h.g_)({childBackground:{type:Boolean,required:!1,default:!1}});let ei=class extends((0,y.vE)(y.Y5,Qn)){constructor(){super(...arguments),Object.defineProperty(this,"$refs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"background",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"emulateSwipeBar",{enumerable:!0,configurable:!0,writable:!0,value:"true"===f.KJ.VUE_APP_EMULATE_SWIPE_BAR})}mounted(){if(this.childBackground){const e=this.$refs.safeArea.firstElementChild;e&&(this.background=getComputedStyle(e).background)}}getInset(){const e=getComputedStyle(this.$refs.safeArea);return{top:parseInt(e.paddingTop),right:parseInt(e.paddingRight),bottom:parseInt(e.paddingBottom),left:parseInt(e.paddingLeft)}}};ei=Zn([(0,y.uA)({name:"SafeArea"})],ei);const ti=ei,ri=ti;var ai=(0,C.A)(ri,Jn,Xn,!1,null,"36c1a905",null);const si=ai.exports;var ni=r(5852),ii=r(6987);function oi(e,t){t.value&&(0,s.Ay)(e,{content:t.value,sticky:t.modifiers.sticky,hideOnClick:!t.modifiers.notDismissable,allowHTML:t.modifiers.allowHTML,placement:t.arg||"top",plugins:[s.qf]})}(0,m.LE)(),a.Ay.config.productionTip=!1,a.Ay.use(n.A),a.Ay.use(c()),a.Ay.prototype.$dialog=Ts,a.Ay.directive("visible",(function(e,t){e.style.visibility=t.value?"visible":"hidden"})),a.Ay.directive("updated",{componentUpdated(e,t){t.value()}}),a.Ay.directive("focus",{bind(e){e.getAttribute("tabindex")||e.setAttribute("tabindex","-1")},inserted(e,t){t&&!t.value||e.focus({preventScroll:!0})},update:function(e,t){t&&t.value&&!t.oldValue&&e.focus({preventScroll:!0})}}),a.Ay.directive("onboardingTooltip",{bind(e,t){const r=t.arg,a=()=>{const a=(0,h.fU)("onboardingTooltips");if(a[r])return;const n=t.value;(0,s.Ay)(e,{content:n,delay:0,trigger:"manual",hideOnClick:!0,sticky:t.modifiers.sticky,plugins:[s.qf],onHidden(){const t=parseInt(e.dataset.tooltipTimeout);t&&window.clearTimeout(t),(0,h.qe)("onboardingTooltips",r,!0)}}),e._tippy.show()},n=e.dataset;n.tooltipTimeout=""+window.setTimeout(a,300)},unbind(e){var t;const r=e.dataset,a=parseInt(r.tooltipTimeout);a&&window.clearTimeout(a),null===(t=e._tippy)||void 0===t||t.hide()}}),a.Ay.directive("tooltip",{bind(e,t){oi(e,t)},update(e,t){var r;null===(r=e._tippy)||void 0===r||r.destroy(),oi(e,t)},unbind(e){var t;null===(t=e._tippy)||void 0===t||t.destroy()}});const li={color:"#3869FF",failedColor:"#DA4032",thickness:"0.5rem",transition:{speed:"0.2s",opacity:"0.6s",termination:1e3},autoRevert:!0,location:"top",inverse:!1};a.Ay.use(o(),li),a.Ay.mixin(gr.A),a.Ay.mixin(Dn.A),a.Ay.mixin(jn.A),a.Ay.mixin(Fn.A),a.Ay.component("OgorMenu",Un),a.Ay.component("OgorMenuItem",Kn),a.Ay.component("SafeArea",si),a.Ay.component("FeatureFlag",ni.A),a.Ay.component("SvgIcon",ii.A),s.Ay.setDefaultProps({zIndex:9800,delay:[300,0],duration:200}),new a.Ay({router:_n,store:$n.A,provide:{currentDialog:Ts.current},mounted:()=>document.dispatchEvent(new Event("x-app-rendered")),render:e=>e(An)}).$mount("#app")},3677:(e,t,r)=>{e.exports=r.p+"img/lastSeasonYieldGuide.a691eef4.gif"},3919:(e,t,r)=>{r.d(t,{A:()=>g});var a=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.compact?t("div",{staticClass:"small"},[t("multi-select",{attrs:{options:e.cropsForCurrentSeason,label:e.getCropLabel,placeholder:e.$gettext("Select crop"),"is-selected":e.isSelected,searchable:!0,theme:"action"},on:{input:e.setCropSelected}})],1):t("div",{staticClass:"crop-filter",class:{small:e.small}}
1,[e._l(e.displayedCrops,(function(r){return t("div",{key:r.id,staticClass:"crop-select",class:{selected:r.id===e.selectedCropId},on:{click:function(t){return e.setCropSelected(r)}}},[t("span",{staticClass:"crop-label"},[e._v(" "+e._s(r.name[e.$language.current]||e.$gettext("Unspecified crop"))+" ")]),e.small||r.id!==e.selectedCropId?e._e():t("span",{staticClass:"material-icons selected-close"},[e._v(" close ")])])})),e.showAllCrops&&e.cropsForCurrentSeason.length>e.maxCropsShown?t("div",{key:"hide-crops",staticClass:"crop-select hide-me more-less",on:{click:function(t){e.showAllCrops=!1},keyup:function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.showAllCrops=!1}}},[e._m(0)]):e._e(),e.showAllCrops?e._e():t("div",{key:"expand-crops",staticClass:"crop-select more-less",on:{click:function(t){e.showAllCrops=!0},keyup:function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.showAllCrops=!0}}},[e._m(1)]),t("div",{staticClass:"crop-margin"})],2)},s=[function(){var e=this,t=e._self._c;e._self._setupProxy;return t("span",{staticClass:"crop-label"},[t("i",{staticClass:"material-icons"},[e._v("subdirectory_arrow_left")])])},function(){var e=this,t=e._self._c;e._self._setupProxy;return t("span",{staticClass:"crop-label"},[t("i",{staticClass:"material-icons"},[e._v("more_horiz")])])}],n=(r(3725),r(2598),r(5019),r(9442)),i=r(5289),o=r(4820),l=r(5208),c=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const d=(0,n.g_)({compact:{type:Boolean,default:!1,required:!1},small:{type:Boolean,default:!1,required:!1}}),u=(0,n.cn)(["cropsForCurrentSeason","totalCrops","selectedCropId","currentSeasonId","parcelsForCurrentSeason"]);let p=class extends((0,i.vE)(i.Y5,d,u)){constructor(){super(...arguments),Object.defineProperty(this,"showAllCrops",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"maxCropsShown",{enumerable:!0,configurable:!0,writable:!0,value:5})}get displayedCrops(){let e,t=this.parcelsForCurrentSeason.find((e=>!this.getCropIntervalCrop(e.crop_intervals)));return e=t?[...this.cropsForCurrentSeason]:this.cropsForCurrentSeason.filter((e=>"null"!=e.id)),this.showAllCrops?e:e.slice(0,this.maxCropsShown)}currentSeasonIdChanged(){this.$store.commit("setCropSelected",null)}mounted(){this.setSelectedCropsFromRoute(),this.cropsForCurrentSeason.length<=this.maxCropsShown&&(this.showAllCrops=!0)}getCropLabel(e){var t,r;const a=e.name[this.$language.current],s=e.apia_code||(null===(r=null===(t=e.system_links)||void 0===t?void 0:t.find((e=>"APIA"===e.name)))||void 0===r?void 0:r.crop_code);return s?`${a} (${s})`:a}isSelected(e){return e.id===this.selectedCropId}setSelectedCropsFromRoute(){this.$route.query.crop&&(this.$store.commit("setCropSelected",this.$route.query.crop),this.showAllCrops=!0)}syncRoute(){this.$router.replace({name:this.$route.name,params:Object.assign({},this.$route.params),query:Object.assign(Object.assign({},this.$route.query),{crop:this.selectedCropId})})}setCropSelected(e){e.id===this.selectedCropId?this.$store.commit("setCropSelected",null):this.$store.commit("setCropSelected",e.id),this.syncRoute()}};c([(0,o.ox)("currentSeasonId")],p.prototype,"currentSeasonIdChanged",null),c([(0,o.ox)("selectedCropId")],p.prototype,"syncRoute",null),p=c([(0,i.uA)({name:"CropFilter",components:{MultiSelect:l.A}})],p);const m=p,h=m;var f=r(1656),v=(0,f.A)(h,a,s,!1,null,"0748701a",null);const g=v.exports},4099:(e,t,r)=>{r.d(t,{A:()=>f});var a=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.showModal?t("div",[t("transition",{attrs:{name:"fade-modal-backdrop",appear:""}},[e.leaveTransitionStarted?e._e():t("div",{staticClass:"modal-mask-background",class:{blurred:e.blurBackground},style:{position:e.position}})]),t("div",{class:e.modalClass,style:{position:e.position},on:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"])?null:e.closeModal.apply(null,arguments)},click:function(t){e.closeOnClickOutside&&e.closeModal()}}},[t("div",{staticClass:"modal-scrollable discrete-scroll",style:{position:e.position}},[t("div",{staticClass:"modal-group",class:e.modalType,on:{click:function(e){e.stopPropagation()}}},[t("transition",{attrs:{name:e.transitionName,appear:""}
1,on:{"after-enter":function(t){e.transitionEnded=!0},"after-leave":function(t){return e.$emit("close")}}},[e.leaveTransitionStarted?e._e():t("div",{staticClass:"modal-container",class:{dragging:e.dragging},on:{click:function(t){return t.stopPropagation(),e.setDismissFlag.apply(null,arguments)},dragend:function(e){e.preventDefault(),e.stopPropagation()},dragexit:function(e){e.preventDefault(),e.stopPropagation()},dragleave:function(t){return t.preventDefault(),t.stopPropagation(),e.maybeHideDragging.apply(null,arguments)},dragenter:function(t){t.preventDefault(),t.stopPropagation(),e.dragging=e.canDragInto},dragover:function(e){e.preventDefault(),e.stopPropagation()},drop:function(t){return t.preventDefault(),t.stopPropagation(),e.handleDrop.apply(null,arguments)}}},[e._t("modal-container",(function(){return[t("div",{staticClass:"modal-drag-layer"}),e.showHeader?t("div",{staticClass:"modal-header large-bold"},[e.showBackTo&&e.routeBack?t("router-link",{staticClass:"modal-icon material-icons",attrs:{to:e.routeBack}},[e._v(" arrow_back ")]):e._e(),e.showCloseModal&&e.isMobileFullscreen?t("span",{staticClass:"modal-icon material-icons",on:{click:e.closeModal}},[e._v(" arrow_back ")]):e._e(),t("div",{staticClass:"modal-header-title"},[e._t("header",(function(){return[e._v(" "+e._s(e.header)+" ")]}),{transitionEnded:e.transitionEnded,closeModal:e.closeModal})],2),e.showCloseModal&&!e.isMobileFullscreen?t("span",{staticClass:"modal-icon material-icons modal-close-icon",on:{click:e.closeModal}},[e._v(" close ")]):e._e()],1):e._e(),t("div",{staticClass:"modal-body paragraph"},[e._t("body",(function(){return[t("div",{staticClass:"modal-default-body"},[e._v(" "+e._s(e.body)+" ")])]}),{transitionEnded:e.transitionEnded,closeModal:e.closeModal})],2),e.showFooter?t("div",{staticClass:"modal-footer"},[e._t("footer",(function(){return[t("button",{staticClass:"text-button modal-default-button",on:{click:e.closeModal}},[e._v("OK")])]}),{transitionEnded:e.transitionEnded,closeModal:e.closeModal})],2):e._e()]}))],2)]),t("transition",{attrs:{name:e.transitionName,appear:""}},[e.leaveTransitionStarted?e._e():t("div",{on:{click:function(e){e.stopPropagation()}}},[e._t("after-modal")],2)])],1)])])],1):e._e()},s=[],n=r(9442),i=r(5289),o=r(4820),l=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const c=(0,n.g_)({header:{type:String,default:"",required:!1},body:{type:String,default:"",required:!1},showHeader:{type:Boolean,default:!0,required:!1},showFooter:{type:Boolean,default:!0,required:!1},closeOnClickOutside:{type:Boolean,default:!0,required:!1},modalType:{type:String,default:"default",required:!1},modalSize:{type:String,default:"small",required:!1},showBackTo:{type:Boolean,default:!1,required:!1},showCloseModal:{type:Boolean,default:!0,required:!1},canDragInto:{type:Boolean,default:!1,required:!1},mobileMode:{type:String,default:"window",required:!1},storeKey:{type:String,default:null,required:!1},store:{type:String,default:"sessionStorage",required:!1},beforeClose:{type:Function,default:()=>!0,required:!1},position:{type:String,default:"fixed",required:!1},blurBackground:{type:Boolean,default:!1,required:!1}});let d=class extends((0,i.vE)(i.Y5,c)){constructor(){super(...arguments),Object.defineProperty(this,"$emit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"$scopedSlots",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showModal",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"dragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"transitionEnded",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"leaveTransitionStarted",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"lockedScroll",{enumerable:!0,configurable:!0,writable:!0,value:[null,null]})}get modalClass(){return["modal-mask",this.modalSize,`mobile-${this.mobileMode}`].join(" ")}get transitionName(){if(!this.isMobile)return"fade";switch(this.mobileMode){case"drawer":return"slide-up";case"fullscreen":return"slide-right";case"window":default:return"fade"}}get storage(){return window[this.store]}get isMobileFullscreen(){return(0,n.Fr)()&&"fullscreen"==this.mobileMode}onShowModalChange(){this.showModal?window.addEventListener("scroll",this.handleScroll,!0):window.removeEventListener("scroll",this.handleScroll,!0)}mounted(){if(this.storage&&this.storeKey)try{this.showModal=(0,n.oV)(this.storage.getItem(this.storeKey),!0)}catch(e){this.showModal=!0}else this.showModal=!0;this.showModal&&window.addEventListener("scroll",this.handleScroll,!0)}beforeDestroy(){window.removeEventListener("scroll",this.handleScroll,!0)}closeModal(){return new Promise((e=>{this.beforeClose()?(this.leaveTransitionStarted=!0,this.$on("close",(()=>{e(!0),this.$off("close")}))):e(!1)}))}handleDrop(e){this.canDragInto&&(this.$emit("drop",e),this.dragging=!1)}maybeHideDragging(e){if(!this.canDragInto)return;const t=this.$el.querySelector(".modal-container");t&&e&&e.relatedTarget&&t.contains(e.relatedTarget)||(this.dragging=!1)}setDismissFlag(){if(this.storage&&this.storeKey)try{this.storage.setItem(this.storeKey,"false")}catch(e){}}handleScroll(e){if(!this.$el.contains(e.target)){let t=e.target;this.lockedScroll[0]==t?t.scrollTop=this.lockedScroll[1]:(this.lockedScroll[0]=t,this.lockedScroll[1]=t.scrollTop)}}};l([(0,o.ox)("showModal")],d.prototype,"onShowModalChange",null),d=l([(0,i.uA)({name:"Modal"})],d);const u=d,p=u;var m=r(1656),h=(0,m.A)(p,a,s,!1,null,"7bd33302",null);const f=h.exports},4255:(e,t,r)=>{r.d(t,{A:()=>_});var a=function(){var e=this,t=e._self._c;e._self._setupProxy;
1return t("modal",{ref:"modal",attrs:{"modal-size":"small","mobile-mode":"fullscreen","show-footer":!0,"close-on-click-outside":!1,header:e.headerTitle,"before-close":e.closeCheck},on:{close:function(t){return e.$emit("close")}},scopedSlots:e._u([{key:"body",fn:function(){return[t("div",[e.parcel?t("div",{staticClass:"parcel-card"},[t("parcel-placeholder",{staticClass:"parcel-placeholder",attrs:{"placeholder-url":e.apiMediaURL(e.parcel.svg_url)}}),t("span",{staticClass:"parcel-name",attrs:{title:e.parcel.name}},[e._v(" "+e._s(e.parcel.name)+" ")]),t("span",{staticClass:"muted"},[e._v(" "+e._s(e.parcel.hectares)+" ha ")])],1):e._e(),1===e.step?t("div",{key:"crop-step-1"},[t("div",{staticClass:"input-field"},[t("div",{staticClass:"input-title"},[t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Crop for season")]),t("span",[e._v(" ")]),t("span",[e._v(e._s(e.parcelSeasonInterval))])]),t("multi-select",{attrs:{options:e.crops,label:e.getCropLabelWithApia,theme:"field",value:e.selectedCrop,unique:"id",searchable:"","group-label":"group","show-group-names":""},on:{input:e.onCropSelect}})],1),null==e.selectedCrop||"null"==e.selectedCrop?t("div",{key:"callout",staticClass:"tip-box"},[t("span",{staticClass:"icon"},[e._v("👍")]),t("div",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("The set culture improves the analysis of vegetation maps and soil and climate data.")])]):e._e(),e.hasForecastAndDeleting?t("div",{staticClass:"tip-box warning"},[t("span",{staticClass:"material-icons"},[e._v("warning")]),t("div",[t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("This crop interval has a yield forecast. Deleting the crop will also delete the forecast. ")])])]):e._e(),null!=e.selectedCrop&&"null"!=e.selectedCrop?[t("div",{staticClass:"input-field"},[t("div",{staticClass:"input-title"},[t("label",{directives:[{name:"translate",rawName:"v-translate"}],attrs:{for:"hybrid"}},[e._v("Hybrid")])]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.cropInterval.crop_hybrid,expression:"cropInterval.crop_hybrid"}],attrs:{id:"hybrid",type:"text",maxlength:"100"},domProps:{value:e.cropInterval.crop_hybrid},on:{input:function(t){t.target.composing||e.$set(e.cropInterval,"crop_hybrid",t.target.value)}}})]),t("div",{staticClass:"form-row"},[t("div",{staticClass:"input-field"},[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"input-title"},[e._v("Sow date")]),t("custom-date-input",{attrs:{min:e.minSowDate,max:e.maxSowDate,"default-date":e.cropInterval.interval.lower},scopedSlots:e._u([{key:"placeholder",fn:function(){return[t("div",[e._v(e._s(e.getDatePlaceholder(e.sowDate,e.estimatedSowDate)))])]},proxy:!0}],null,!1,117414401),model:{value:e.cropInterval.interval.lower,callback:function(t){e.$set(e.cropInterval.interval,"lower",t)},expression:"cropInterval.interval.lower"}})],1),t("div",{staticClass:"form-field"},[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"input-title input-hectare-title"},[e._v("Your estimate")]),t("div",{staticClass:"form-input"},[t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.cropInterval.yield_estimated,expression:"cropInterval.yield_estimated",modifiers:{number:!0}}],attrs:{id:"est",type:"number",min:"0",step:"0.01"},domProps:{value:e.cropInterval.yield_estimated},on:{input:function(t){t.target.composing||e.$set(e.cropInterval,"yield_estimated",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}}),t("label",{staticClass:"suffix",attrs:{for:"est"}},[e._v("t/ha")])])])]),!e.sowDate&&e.estimatedSowDate?t("div",{staticClass:"input-help muted"},[t("i",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("*Estimated date.")])]):e._e(),t("div",{staticClass:"form-row"},[t("div",{staticClass:"input-field"},[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"input-title"},[e._v("Harvest date")]),t("custom-date-input",{attrs:{min:e.minHarvestDate,max:e.maxHarvestDate,"default-date":e.cropInterval.end_date},scopedSlots:e._u([{key:"placeholder",fn:function(){return[t("div",[e._v(" "+e._s(e.getDatePlaceholder(e.harvestDate,e.estimatedHarvestDate))+" ")])]},proxy:!0}],null,!1,1378026497),model:{value:e.cropInterval.interval.upper,callback:function(t){e.$set(e.cropInterval.interval,"upper",t)},expression:"cropInterval.interval.upper"}})],1),t("div",{staticClass:"form-field"},[t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"input-title input-hectare-title"},[e._v("Measured yield")]),t("div",{staticClass:"form-input",class:{"highlight-measured":e.focu
1sMeasuredYield}},[t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.cropInterval.yield_measured,expression:"cropInterval.yield_measured",modifiers:{number:!0}}],ref:"measuredInput",attrs:{id:"measured-yield",type:"number",min:"0",step:"0.01"},domProps:{value:e.cropInterval.yield_measured},on:{input:function(t){t.target.composing||e.$set(e.cropInterval,"yield_measured",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}}),t("label",{staticClass:"suffix",attrs:{for:"measured-yield"}},[e._v("t/ha")])])])]),!e.harvestDate&&e.estimatedHarvestDate?t("div",{staticClass:"input-help muted"},[t("i",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("*Estimated date.")])]):e._e(),e.detailChips.length?t("div",{staticClass:"detail-chips"},e._l(e.detailChips,(function(r){return t("span",{key:r,staticClass:"detail-chip"},[e._v(e._s(r))])})),0):e._e()]:e._e()],2):e._e(),2===e.step?t("div",{key:"crop-step-2"},[t("div",{staticClass:"input-field"},[t("div",{staticClass:"input-title"},[t("label",{directives:[{name:"translate",rawName:"v-translate"}],attrs:{for:"observations"}},[e._v("Observations")])]),t("textarea",{directives:[{name:"model",rawName:"v-model",value:e.cropInterval.observations,expression:"cropInterval.observations"}],staticClass:"observations-input",attrs:{id:"observations",maxlength:"500",rows:"3"},domProps:{value:e.cropInterval.observations},on:{input:function(t){t.target.composing||e.$set(e.cropInterval,"observations",t.target.value)}}})]),t("div",{staticClass:"input-field"},[t("div",{staticClass:"input-title"},[t("label",{directives:[{name:"translate",rawName:"v-translate"}],attrs:{for:"density"}},[e._v("Density")])]),t("div",{staticClass:"density-row"},[t("input",{directives:[{name:"model",rawName:"v-model.number",value:e.cropInterval.density,expression:"cropInterval.density",modifiers:{number:!0}}],attrs:{id:"density",type:"number",min:"0",step:"0.01"},domProps:{value:e.cropInterval.density},on:{input:function(t){t.target.composing||e.$set(e.cropInterval,"density",e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}}),t("multi-select",{staticClass:"density-unit",attrs:{"drop-down-direction":"left",options:e.densityUnitOptions,label:"label",unique:"value",theme:"field",placeholder:e.$gettext("Unit"),value:e.cropInterval.density_unit},on:{input:e.onDensityUnitSelect}})],1),e.densityNeedsUnit?t("div",{staticClass:"input-help error-text"},[t("i",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Select a unit for the density.")])]):e._e()]),t("div",{staticClass:"input-field"},[t("div",{staticClass:"input-title"},[t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v("Work type")])]),t("multi-select",{attrs:{"drop-down-direction":"left",options:e.agriculturalWorks,label:"name",theme:"field",placeholder:e.$gettext("Unspecified"),value:e.selectedAgriculturalWork},on:{input:e.onWorkTypeSelect}})],1)]):e._e()])]},proxy:!0},{key:"footer",fn:function(){return[t("div",{staticClass:"footer-actions"},[null!=e.selectedCrop&&"null"!=e.selectedCrop?t("button",{staticClass:"light-button details-nav",attrs:{type:"button"},on:{click:function(t){e.step=1===e.step?2:1}}},[t("span",[e._v(e._s(e.detailsNavLabel))])]):e._e(),t("button",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"brand-green-button",attrs:{disabled:!e.formValid||e.loadingRequest},on:{click:e.saveChanges}},[e._v("Set crop")])])]},proxy:!0}])})},s=[],n=(r(1339),r(3725),r(2598),r(9838),r(4099)),i=r(5208),o=r(4585),l=r(8517),c=r(9442),d=r(6045),u=r(5289),p=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},m=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};const h=(0,c.cn)(["selectedParcelId","selectedParcel","allCropGroups","seasons","currentFarmId","currentSeasonId","parcelIndex"]),f=(0,c.g_)({parcelProp:{type:Object,required:!1,default:null},cropIntervalProp:{type:Object,required:!1,default:null},focusMeasuredYield:{type:Boolean,required:!1,default:!1}});let v=class extends((0,u.vE)(u.Y5,f,h)){constructor(){super(...arguments),Object.defineProperty(this,"$refs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cropInterval",{enumerable:!0,configurable:!0,writable:!0,value:{id:null,crop_id:null,interval:{lower:null,upper:null,bounds:"[)"},yield_forecast:null,yield_forecasts:null,yield_estimated:null,yield_measured:null,crop_hybrid:null,observations:null,density:null,density_unit:"kg_per_ha",agricultural_work:null}}),Object.defineProperty(this,"initialCropInterval",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"loadingRequest",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"parcel",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"step",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(this,"getCropLabelWithApia",{enumerable:!0,configurable:!0,writable:!0,value:c.O3})}created(){this.parcel=this.parcelProp||this.selectedParcel,this.initialCropInterval=this.cropIntervalProp||this.getCropInterval(this.parcel.crop_intervals),this.initialCropInterval&&(this.cropInterval=Object.assign(Object.assign({},this.cropInterval),(0,c.JH)(this.initialCropInterval))),this.cropInterval.density_unit||(this.cropInterval.density_unit="kg_per_ha"),this.$nextTick((()=>{var e,t;this.focusMeasuredYield&&this.$refs.measuredInput&&(this.$refs.measuredInput.focus(),null===(t=(e=this.$refs.measuredInput).select)||void 0===t||t.call(e))}))}get crops(){const e=Object.values(this.allCropGroups).map((e=>{var t;const r=null===(t=e.system_links)||void 0===t?void 0:t.find((e=>"APIA"===e.name)),a=(null===r||void 0===r?void 0:r.crop_code)||null;return{id:[...e.cropIds][0],name:e.name[this.$language.current],group:"null"==e.id?this.$gettext("Unspecified crop"):"",system_links:e.system_links,apia_code:a,title:(0,c.ni)(a)}}));
1e.slice(0,5).forEach((e=>{e.group=this.$gettext("Frequently used")}));let t=e.pop();return e.splice(0,0,t),e}get agriculturalWorks(){const e=[{id:null,name:this.$gettext("Unspecified")},...this.$store.getters.agriculturalWorks];return e}get selectedAgriculturalWork(){return this.cropInterval.agricultural_work}get headerTitle(){return 1===this.step?this.$gettext("Set crop"):this.$gettext("More details")}get detailsNavLabel(){return 1===this.step?this.$gettext("More details"):this.$gettext("Back")}get densityUnitOptions(){return[{value:"seeds_per_m2",label:this.$gettext("seeds/m²")},{value:"kg_per_ha",label:this.$gettext("kg/ha")},{value:"plants_per_ha",label:this.$gettext("plants/ha")}]}get densityNeedsUnit(){const e=this.cropInterval.density;return null!=e&&""!==e&&!this.cropInterval.density_unit}get detailChips(){var e;const t=this.cropInterval,r=[];if(null!=t.density&&""!==t.density){const a=(null===(e=this.densityUnitOptions.find((e=>e.value===t.density_unit)))||void 0===e?void 0:e.label)||"";r.push(`${this.$gettext("Density")}: ${t.density} ${a}`.trim())}if(t.agricultural_work&&r.push(`${this.$gettext("Work type")}: ${t.agricultural_work}`),t.observations){const e=t.observations.length>30?`${t.observations.slice(0,30)}…`:t.observations;r.push(`${this.$gettext("Observations")}: ${e}`)}return r}get parcelSeason(){return this.seasons[this.parcel.season]}get parcelSeasonInterval(){var e;return null===(e=this.parcelSeason)||void 0===e?void 0:e.interval}get selectedCrop(){var e;return null===(e=this.cropInterval)||void 0===e?void 0:e.crop_id}get sowDate(){var e;return null===(e=this.cropInterval)||void 0===e?void 0:e.interval.lower}get harvestDate(){var e;return null===(e=this.cropInterval)||void 0===e?void 0:e.interval.upper}get hasForecastAndDeleting(){var e;if(null!=this.cropInterval.crop_id&&"null"!==this.cropInterval.crop_id)return!1;if(!(null===(e=this.initialCropInterval)||void 0===e?void 0:e.id)||"null"===this.initialCropInterval.id)return!1;const t=this.initialCropInterval.yield_forecasts;return Array.isArray(t)&&t.length>0}get formValid(){return this.selectedCrop&&!this.densityNeedsUnit}get formChanged(){var e,t,r;return(null===(e=this.initialCropInterval)||void 0===e?void 0:e.crop_id)!=this.cropInterval.crop_id||(null===(t=this.initialCropInterval)||void 0===t?void 0:t.interval.lower)!=this.cropInterval.interval.lower||(null===(r=this.initialCropInterval)||void 0===r?void 0:r.interval.upper)!=this.cropInterval.interval.upper}get minSowDate(){return(0,c.Yq)(this.parcelSeason.start_date)}get maxSowDate(){const e=(0,c.Yq)(this.parcelSeason.end_date);return this.getDateMinMax(e,this.harvestDate,!1)}get minHarvestDate(){const e=(0,c.Yq)(this.parcelSeason.start_date);return this.getDateMinMax(e,this.sowDate,!1)}get maxHarvestDate(){const e=(0,c.Yq)(this.parcelSeason.end_date);return this.getDateMinMax(e,this.sowDate,!1)}onWorkTypeSelect(e){return m(this,void 0,void 0,(function*(){this.cropInterval.agricultural_work=null!==e.id?e.name:null}))}onDensityUnitSelect(e){var t;this.cropInterval.density_unit=null!==(t=null===e||void 0===e?void 0:e.value)&&void 0!==t?t:null}onCropSelect(e){return m(this,void 0,void 0,(function*(){var t,r,a;if(this.cropInterval.crop_id=e.id,"null"==e.id)return this.cropInterval.interval.lower=null,void(this.cropInterval.interval.upper=null);const s=null===(a=null===(r=null===(t=e.system_links)||void 0===t?void 0:t.find((e=>"APIA"===(null===e||void 0===e?void 0:e.name))))||void 0===r?void 0:r.name)||void 0===a?void 0:a.toLowerCase();if(!s)return;const n=yield(0,l.H2)("GET",`/farm/${this.currentFarmId}/season/${this.parcel.season}/parcel/${this.parcel.id}/crop_dates_estimate/${s}/${e.id}/`);this.cropInterval.interval.lower=n.start_date,this.cropInterval.interval.upper=n.end_date}))}saveChanges(){return m(this,void 0,void 0,(function*(){var e;this.loadingRequest=!0;try{const t=Object.assign(Object.assign({},this.cropInterval),{crop:this.cropInterval.crop_id,yield_estimated:this.cropInterval.yield_estimated||null,yield_measured:this.cropInterval.yield_measured||null,interval:{lower:this.cropInterval.interval.lower,upper:this.cropInterval.interval.upper,bounds:"[)"},crop_hybrid:this.cropInterval.crop_hybrid||"",observations:this.cropInterval.observations||"",density:this.cropInterval.density||null,density_unit:this.cropInterval.density_unit||null,agricultural_work:this.cropInterval.agricultural_work});if(null!=this.cropInterval.id&&"null"!==this.cropInterval.id){const e=`/farm/${this.currentFarmId}/season/${this.parcel.season}/parcel/${this.parcel.id}/cropinterval/${this.cropInterval.id}/`;"null"===this.cropInterval.crop_id?yield(0,l.H2)("DELETE",e):yield(0,l.H2)("PUT",e,{},t)}else"null"!==this.cropInterval.crop_id&&(yield(0,l.H2)("POST",`/farm/${this.currentFarmId}/season/${this.parcel.season}/parcel/${this.parcel.id}/cropinterval/`,{},t));this.initialCropInterval=(0,c.JH)(this.cropInterval),this.$store.commit("clearParcelOverlapCache"),yield this.$store.dispatch("refreshSeasonCrops",this.currentSeasonId);const r=yield this.$store.dispatch("getParcelsForCurrentSeason");if(this.parcel.id==this.selectedParcel.id&&this.parcel.season==this.currentSeasonId){const e=r.find((e=>e.id==this.parcel.id));yield this.$store.dispatch("getSelectedParcelHistory",this.parcelIndex[this.parcel.id]),this.$store.commit("setSelectedParcel",e)}
1this.$nextTick((()=>this.$emit("change"))),(null===(e=this.cropInterval)||void 0===e?void 0:e.yield_measured)&&this.$nextTick((()=>this.$emit("measured-yield-saved"))),this.notify({type:"success",icon:"spa",text:this.$gettext("Crop set.")}),this.$refs.modal.closeModal()}catch(t){(0,c.vV)(t),this.notify({type:"error",text:this.$gettext("Something went wrong.")}),this.loadingRequest=!1}}))}closeCheck(){return!this.formChanged||confirm(this.$gettext("There are unsaved changes. Do you want to continue?"))}getDateMinMax(e,t,r=!0){if(!e||!t)return e||t;const a=[e,t].sort();return r?a[0]:a[1]}getDatePlaceholder(e,t){const r=e||t;if(!r)return this.$gettext("Select a date...");let a=new Date(r).toLocaleDateString(this.$language.current,{day:"numeric",month:"long",year:"numeric"});return e||(a+="*"),a}};v=p([(0,u.uA)({name:"ChangeParcelCrop",components:{Modal:n.A,MultiSelect:i.A,ParcelPlaceholder:d.A,CustomDateInput:o.A}})],v);const g=v,y=g;var b=r(1656),w=(0,b.A)(y,a,s,!1,null,"61d6b321",null);const _=w.exports},4510:(e,t,r)=>{r.d(t,{A:()=>n});var a=r(5471);const s=new a.Ay;s.events={requestStarted:"requestStarted",requestFinished:"requestFinished",apiUnknownError:"apiUnknownError",apiReadError:"apiReadError",apiConnectError:"apiConnectError",showPaywall:"showPaywall",showChangeParcelCrop:"showChangeParcelCrop",showJournalDialog:"showJournalDialog"};const n=s},4546:(e,t,r)=>{e.exports=r.p+"img/restricted_access.2ff9af40.svg"},4585:(e,t,r)=>{r.d(t,{A:()=>f});var a=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"custom-date-input"},[t("div",{staticClass:"date-input-placeholder",class:{disabled:e.disabled}},[t("div",{staticClass:"placeholder-icon material-icons muted"},[e._v("date_range")]),t("div",{staticClass:"placeholder-text"},[e._t("placeholder",(function(){return[e._v(" "+e._s(e.defaultPlaceholder)+" ")]}),{value:e.value})],2)]),t("input",{ref:"input",attrs:{type:"date",min:e.min,max:e.max,disabled:e.disabled},domProps:{value:e.value},on:{change:e.onChange,click:e.onClick}})])},s=[],n=r(9442),i=r(5289),o=r(4820),l=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const c=(0,n.g_)({value:{type:String,required:!1,default:null},min:{type:String,required:!1,default:null},max:{type:String,required:!1,default:null},defaultDate:{type:String,required:!1,default:null},disabled:{type:Boolean,required:!1,default:!1}});let d=class extends((0,i.vE)(i.Y5,c)){constructor(){super(...arguments),Object.defineProperty(this,"$refs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"$scopedSlots",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}get defaultPlaceholder(){if(!this.value)return this.$gettext("Select a date...");const e=new Date(this.value);return e.toLocaleDateString(this.$language.current,{day:"numeric",month:"long",year:"numeric"})}disabledChanged(e){e&&(this.$refs.input.value=null,this.$emit("input",null))}onChange(e){this.$emit("input",e.target.value||null)}openInput(){this.$refs.input.click()}onClick(){this.$refs.input.showPicker(),this.defaultDate&&!this.value&&(this.$refs.input.value=this.defaultDate)}};l([(0,o.ox)("disabled")],d.prototype,"disabledChanged",null),d=l([(0,i.uA)({name:"CustomDateInput"})],d);const u=d,p=u;var m=r(1656),h=(0,m.A)(p,a,s,!1,null,"88793e8e",null);const f=h.exports},4699:(e,t,r)=>{r.d(t,{A:()=>f});var a=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"parcel-item",class:{inverted:e.inverted}},[t("parcel-placeholder",{staticClass:"parcel-placeholder",class:{inverted:e.inverted},attrs:{"placeholder-url":e.apiMediaURL(e.parcel.svg_url)}}),t("div",{staticClass:"small parcel-item-info"},[t("div",{staticClass:"top-info"},[e._v(" "+e._s(e.availableProps[e.topProp])+" ")]),t("div",{staticClass:"bottom-info"},[e._v(" "+e._s(e.availableProps[e.bottomProp])+" ")])]),e.navigable?t("div",{key:"navigable-right",staticClass:"small right-info"},[t("span",{staticClass:"material-icons action-text"},[e._v(" arrow_forward ")])]):t("div",{key:"default-right",staticClass:"small right-info"},[e._v(" "+e._s(e.availableProps[e.rightProp])+" ")])],1)},s=[],n=r(6045),i=r(9442),o=r(5289),l=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const c=(0,i.g_)({parcel:{type:Object,required:!0},date:{type:String,required:!1},inverted:{type:Boolean,required:!1,default:!1},topProp:{type:String,required:!1,default:"crop"},bottomProp:{type:String,required:!1,default:"interval"},rightProp:{type:String,required:!1,default:"area"},navigable:{type:Boolean,required:!1,default:!1}});let d=class extends((0,o.vE)(o.Y5,c)){get availableProps(){const e=this.$store.getters.seasons[this.parcel.season],t=this.getCropInterval(this.parcel.crop_intervals,this.date,e);return{empty:"",interval:(0,i.Lm)(t,e,this.$language.current),crop:this.getParcelCropName(this.parcel,this.date),name:this.parcel.name,locality:this.parcel.locality,reference:this.parcel.reference,area:(0,i.kr)(this.parcel.hectares,1)+" ha"}}};d=l([(0,o.uA)({name:"ParcelItem",components:{ParcelPlaceholder:n.A}})],d);const u=d,p=u;var m=r(1656),h=(0,m.A)(p,a,s,!1,null,"32ef0b39",null);const f=h.exports},5149:(e,t,r)=>{r.d(t,{A:()=>v});var a=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"add-farm"},[e.user.email?0===e.farmIds.length?t("button",{directives:[{name:"translate",rawName:"v-translate"}],key:"add-farm",staticClass:"brand-green-button full-width wide",on:{click:function(t){e.showModal=!0}}},[e._v(" Add your farm ")]):0==e.farmsWithSeasonsAndParcels.length?t("router-link",{directives:[{name:"translate",rawName:"v-translate"}],key:"add-farm-parcels",staticClass:"brand-green-button full-width wide",attrs:{to:e.importRoute}},[e._v(" Add your parcels ")]):t("router-link",{directives:[{name:"translate",rawName:"v-translate"}],key:"go-to-your-farm",staticClass:"brand-green-button full-width wide",attrs:{to:e.farmRoute}},[e._v(" Go to your farm ")]):t("router-link",{directives:[{name:"translate",rawName:"v-translate"}],key:"new-account",staticClass:"brand-green-button full-width wide",attrs:{to:e.newAccountRoute}},[e._v(" New account ")]),e.showModal?t("update-farm-modal",{on:{close:function(t){e.showModal=!1}}}
1):e._e()],1)},s=[],n=(r(3725),r(5019),r(2598),r(8215)),i=r(5289),o=r(9442),l=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const c=(0,o.g_)({via:{type:String,default:"Unknown"}}),d=(0,o.cn)(["farmIds","user","currentFarm","isDemoFarm","farmsWithSeasons"]);let u=class extends((0,i.vE)(i.Y5,c,d)){constructor(){super(...arguments),Object.defineProperty(this,"showModal",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get newAccountRoute(){const e=this.currentFarm?this.isDemoFarm?"demo_farm":"shared_farm":"shared_parcel";return{name:"new-account",query:{ref:e}}}get farmsWithSeasonsAndParcels(){return this.farmsWithSeasons.filter((e=>e.parcel_count>0))}get importRoute(){return this.farmIds&&0!==this.farmIds.length?{name:"manage-farm",params:{farmId:this.farmIds[0]}}:""}get farmRoute(){const e=this.farmsWithSeasonsAndParcels.find((e=>e.ownedFarm));return{name:"map",params:{farmId:e.id}}}};u=l([(0,i.uA)({name:"AddFarmButton",components:{UpdateFarmModal:n.A}})],u);const p=u,m=p;var h=r(1656),f=(0,h.A)(m,a,s,!1,null,"3364ef5c",null);const v=f.exports},5194:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(6599),s=r(6604),n=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},i=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};let o=class extends s.A{copyStringToClipboard(e){return i(this,void 0,void 0,(function*(){yield this.clipboardAction((()=>i(this,void 0,void 0,(function*(){yield navigator.clipboard.writeText(e),this.notify({type:"info",icon:"content_copy",text:this.$gettext("Link copied to clipboard")})}
1))))}))}writeBlobToClipboard(e){return i(this,void 0,void 0,(function*(){yield this.clipboardAction((()=>i(this,void 0,void 0,(function*(){yield navigator.clipboard.write([new ClipboardItem({[e.type]:e})]),this.notify({type:"info",icon:"content_copy",text:this.$gettext("Image copied to clipboard")})}))))}))}clipboardAction(e){return i(this,arguments,void 0,(function*(e,t="clipboard-write"){let r=!1;try{const e=yield navigator.permissions.query({name:t});"granted"!==e.state&&"prompt"!==e.state&&(r=!0)}catch(a){}if(!r)try{yield e()}catch(a){r=!0}r&&this.notify({type:"warning",text:this.$gettext("Could not copy to clipboard")})}))}shareAPI(e){return i(this,arguments,void 0,(function*({title:e,text:t,url:r,files:a}){if(a&&(!navigator.canShare||!navigator.canShare({files:a}))){try{yield this.writeBlobToClipboard(a[0])}catch(s){this.notify({type:"warning",text:this.$gettext("Could not share.")})}return Promise.resolve()}if(navigator.canShare){if(a)return navigator.share({files:a});{let a={title:e,text:t};return r&&(a=Object.assign(Object.assign({},a),{url:r})),navigator.share(a)}}return this.copyStringToClipboard(r)}))}};o=n([a.Ay],o);const l=o},5208:(e,t,r)=>{r.d(t,{A:()=>h});r(1339);var a=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"ogor-select",class:{selected:e.selectedItemsCount>0,disabled:e.disabled,left:"left"===e.dropDownDirection,right:"right"===e.dropDownDirection,action:"action"===e.theme,field:"field"===e.theme,minimal:"minimal"===e.theme,hidden:"hidden"===e.theme},attrs:{tabindex:"-1"},on:{focusout:e.maybeHideDropDown}},[e.multiple||e.searchable||e.fullscreen?e._e():t("select",{directives:[{name:"model",rawName:"v-model",value:e.nativeSelectModel,expression:"nativeSelectModel"}],ref:"nativeSelect",staticClass:"native-select show-md",on:{click:e.maybeShowDropDown,change:[function(t){var r=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.nativeSelectModel=t.target.multiple?r:r[0]},e.handleNativeSelect]}},[e.clearable?t("option",{attrs:{value:""}},[e._v(" "+e._s(e.computedPlaceholder)+" ")]):e._e(),e._l(e.groupedFilteredItems,(function(r,a){return[e.showGroupNames&&a?t("optgroup",{key:`native-group-${a}`,attrs:{label:a}},e._l(r,(function(r){return t("option",{key:`native-${r.key}`,attrs:{label:r.label},domProps:{value:r.key}},[e._v(" "+e._s(r.label)+" ")])})),0):e._l(r,(function(r){return t("option",{key:`native-${r.key}-${a}`,attrs:{label:r.label},domProps:{value:r.key}},[e._v(" "+e._s(r.label)+" ")])}))]}))],2),t("div",{staticClass:"ogor-select-placeholder",on:{click:e.maybeShowDropDown}},[0===e.selectedItemsCount?t("div",{key:"placeholder-text",staticClass:"placeholder-text"},[e._v(" "+e._s(e.computedPlaceholder)+" ")]):t("div",{key:"items-selected",staticClass:"items-selected",class:{small:e.selectedGroupVisible}},[e.selectedGroupVisible?t("div",{attrs:{id:"selected-group"}},[e._v(" "+e._s(e.selectedGroup)+" ")]):e._e(),t("div",{class:{"text-bold":e.selectedGroupVisible},attrs:{id:"selected-label"}},[e._v(" "+e._s(e.selectedLabel)+" ")])]),t("span",{staticClass:"material-icons",class:{"rotated-arrow":e.shouldFlip}},[e._v(" keyboard_arrow_down ")])]),t("transition",{attrs:{name:"fade-scale"}},[e.showDropDown?t("div",{ref:"dropDownRef",staticClass:"drop-down discrete-scroll",class:{"hide-md":!e.multiple&&!e.searchable&&!e.fullscreen,fullscreen:e.fullscreen,"flip-up":e.shouldFlip},attrs:{tabindex:"-1"},on:{focusout:e.maybeHideDropDown}},[e.fullscreen||e.searchable?t("div",{staticClass:"top-nav"},[e.fullscreen?t("span",{staticClass:"material-icons back-icon",on:{click:e.maybeHideDropDown}},[e._v("arrow_back")]):e._e(),e.searchable?t("div",{key:"searchable",staticClass:"quick-search-input"},[t("label",[t("span",{staticClass:"material-icons"},[e._v("search")]),t("input",{directives:[{name:"model",rawName:"v-model",value:e.searchString,expression:"searchString"}],key:"search-input",attrs:{type:"text",title:e.$gettext("Search..."),placeholder:e.$gettext("Search...")},domProps:{value:e.searchString},on:{focusin:e.maybeShowDropDown,focusout:e.maybeHideDropDown,input:function(t){t.target.composing||(e.searchString=t.target.value)}}})])]):t("div",{key:"notSearchable"},[t("div",{staticClass:"top-nav-title"},[e.multiple?t("span",{directives:[{name:"translate",rawName:"v-translate"}],key:"multiple"},[e._v("Choose options")]):t("span",{directives:[{name:"translate",rawName:"v-translate"}],key:"notMultiple"}
1,[e._v("Choose one")])])])]):e._e(),e._t("before-items"),e._l(e.groupedFilteredItems,(function(r,a){return t("div",{key:`dropdown-group-${a}`,staticClass:"drop-down-group"},[a&&e.showGroupNames?t("div",{staticClass:"drop-down-item"},[e.hideCheckbox?e._e():t("span",{directives:[{name:"visible",rawName:"v-visible",value:!1,expression:"false"}],staticClass:"material-icons check-me"},[e._v(" check ")]),t("span",[e._v(e._s(a))])]):e._e(),e._l(r,(function(r){return t("div",{key:r.key,staticClass:"drop-down-item active no-padding",class:{selected:r.selected},on:{click:function(t){return e.itemClick(r)}}},[e.hideCheckbox?e._e():t("span",{directives:[{name:"visible",rawName:"v-visible",value:e.isItemSelected(r),expression:"isItemSelected(item)"}],staticClass:"material-icons check-me"},[e._v(" check ")]),e._t("item",(function(){return[t("div",{staticClass:"padded",attrs:{title:r.option&&r.option.title}},[t("div",[e._v(e._s(r.label))]),r.description?t("div",[e._v(e._s(r.description))]):e._e()])]}),{item:r})],2)})),0===e.filteredItems.length?t("div",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"drop-down-item disabled"},[e._v("No results")]):e._e()],2)})),e.clearable&&e.multiple&&e.selectedItemsCount>0?t("div",{staticClass:"drop-down-group deselect-all"},[t("div",{staticClass:"drop-down-item active action",on:{click:e.deselectAll}},[t("span",{directives:[{name:"visible",rawName:"v-visible",value:!1,expression:"false"}],staticClass:"material-icons check-me"},[e._v(" check ")]),t("span",{directives:[{name:"translate",rawName:"v-translate"}]},[e._v(" Deselect all ")])])]):e._e()],2):e._e()])],1)},s=[],n=(r(3725),r(5019),r(9838),r(2598),r(9442)),i=r(5289),o=r(4820),l=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};let c=class extends i.Y5{constructor(){super(...arguments),Object.defineProperty(this,"$props",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"placeholder",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideCheckbox",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"multiple",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"disabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"searchable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clearable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"groupLabel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"defaultGroupName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"label",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"labelDescription",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortLabel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"unique",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"multipleSelectedLabel",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isSelected",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dropDownDirection",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"theme",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showGroupNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showSelectedGroup",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"mobileMode",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"items",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"selectedGroup",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"selectedLabel",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"searchString",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"showDropDown",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"shouldFlip",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"areItemsReversed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"nativeSelectModel",{enumerable:!0,configurable:!0,writable:!0,value:""})}get fullscreen(){return(0,n.Fr)()&&"fullscreen"==this.mobileMode}get computedPlaceholder(){return this.placeholder||this.$gettext("Select item")}get filteredItems(){const e=(0,n.sl)(this.searchString);return this.items.filter((t=>(0,n.WW)((0,n.sl)(t.label.toString()),e)))}get selectedItems(){return this.items.filter((e=>this.isItemSelected(e)))}get selectedItemsCount(){return this.selectedItems.length}get selectedOptions(){return this.selectedItems.map((e=>e.option))}get groupedFilteredItems(){return(0,n.sX)(this.filteredItems,(e=>e.groupLabel))}get selectedGroupVisible(){return this.selectedGroup&&this.showSelectedGroup}
1onValueChange(e){this.multiple||(this.items.forEach((t=>{t.selected=this.itemValueEqual(t,e),t.selected&&(this.nativeSelectModel=t.key)})),this.computeSelectedLabel())}shouldFlipDropdown(){const e=this.$refs.dropDownRef.getBoundingClientRect(),t=window.innerHeight||document.documentElement.clientHeight,r=15;return this.shouldFlip=e.bottom+r>t,this.shouldFlip!==this.areItemsReversed&&(this.items.reverse(),this.areItemsReversed=this.shouldFlip),this.items}onLanguageChange(){this.computeSelectedLabel()}onSelectedItemsCountChange(){this.computeSelectedLabel()}onOptionsChange(){this.initOptions()}mounted(){this.initOptions()}deselectAll(){this.clearable&&this.multiple&&(this.items.filter((e=>e.selected)).forEach((e=>{e.selected=!1,this.$emit("change",e.option,e.selected)})),this.$emit("input",this.selectedOptions),this.showDropDown=!1)}maybeShowDropDown(){this.showDropDown||(this.showDropDown=!0,this.$emit("show"),this.$nextTick((()=>{this.$el.scrollIntoView({behavior:"smooth",block:"nearest"}),this.shouldFlipDropdown()})))}maybeHideDropDown(e){const t=this.$el.querySelector(".drop-down");t&&e&&e.relatedTarget&&t.contains(e.relatedTarget)||(this.searchString="",this.showDropDown=!1,this.shouldFlip=!1)}itemValueEqual(e,t){return e.unique===t||e.shortLabel===t||e.label===t||e.option===t}initOptions(){this.items=this.options.map(((e,t)=>{const r=this.getOptionProperty(e,this.label)||e,a=this.getOptionProperty(e,this.unique)||r,s={label:r,unique:a,groupLabel:this.getOptionProperty(e,this.groupLabel)||this.defaultGroupName,shortLabel:this.getOptionProperty(e,this.shortLabel)||r,description:this.getOptionProperty(e,this.labelDescription),option:e,key:`dropdown-${a}-${t}`,selected:!1};return s.selected=this.isItemSelected(s),s.selected&&(this.nativeSelectModel=s.key),s})),this.computeSelectedLabel()}getOptionProperty(e,t){if(t)return"function"===typeof t?t(e):e[t]}handleNativeSelect(){if(this.multiple)return;const e=this.$refs.nativeSelect.selectedOptions[0],t=e&&e.value;t?this.itemClick(this.items.find((e=>e.key===t))):this.itemClick(this.selectedItems[0])}itemClick(e){this.multiple?(e.selected=!e.selected,this.$emit("input",this.selectedOptions),this.$emit("change",e.option,e.selected)):e.selected&&this.clearable?(e.selected=!1,this.$emit("input",e.option),this.showDropDown=!1):(this.items.filter((e=>e.selected)).forEach((e=>e.selected=!1)),e.selected=!0,this.$emit("input",e.option),this.showDropDown=!1),this.computeSelectedLabel()}isItemSelected(e){return this.value===e.unique||this.value===e.label||this.value===e.shortLabel||this.value===e.option||this.isSelected&&this.isSelected(e.option)||e.selected}computeSelectedLabel(){0===this.selectedItemsCount?this.selectedLabel="":1===this.selectedItemsCount?(this.selectedGroup=this.selectedItems[0].groupLabel,this.selectedLabel=this.selectedItems[0].shortL
1abel):"function"===typeof this.multipleSelectedLabel?this.selectedLabel=this.multipleSelectedLabel(this.selectedOptions):this.multipleSelectedLabel?this.selectedLabel=this.multipleSelectedLabel:this.multiple?this.selectedLabel=this.$gettextInterpolate(this.$ngettext("%{ n } selected","%{ n } selected",this.selectedItemsCount),{n:this.selectedItemsCount}):this.selectedLabel=this.selectedItems[0].shortLabel}};l([(0,o.kv)({type:Array,required:!0})],c.prototype,"options",void 0),l([(0,o.kv)({type:String,required:!1,default:null})],c.prototype,"placeholder",void 0),l([(0,o.kv)({type:Boolean,required:!1,default:!1})],c.prototype,"hideCheckbox",void 0),l([(0,o.kv)({type:Boolean,required:!1,default:!1})],c.prototype,"multiple",void 0),l([(0,o.kv)({type:Boolean,required:!1,default:!1})],c.prototype,"disabled",void 0),l([(0,o.kv)({type:Boolean,required:!1,default:!1})],c.prototype,"searchable",void 0),l([(0,o.kv)({type:Boolean,required:!1,default:!0})],c.prototype,"clearable",void 0),l([(0,o.kv)({type:String,required:!1,default:null})],c.prototype,"groupLabel",void 0),l([(0,o.kv)({type:String,required:!1,default:""})],c.prototype,"defaultGroupName",void 0),l([(0,o.kv)({type:[String,Function],required:!1,default:null})],c.prototype,"label",void 0),l([(0,o.kv)({type:[String,Function],required:!1,default:null})],c.prototype,"labelDescription",void 0),l([(0,o.kv)({type:[String,Function],required:!1,default:null})],c.prototype,"shortLabel",void 0),l([(0,o.kv)({type:[String,Function],required:!1,default:null})],c.prototype,"unique",void 0),l([(0,o.kv)({type:[String,Number,Object],required:!1,default:null})],c.prototype,"value",void 0),l([(0,o.kv)({type:[String,Function],required:!1,default:null})],c.prototype,"multipleSelectedLabel",void 0),l([(0,o.kv)({type:Function,required:!1,default:null})],c.prototype,"isSelected",void 0),l([(0,o.kv)({type:String,required:!1,default:"left"})],c.prototype,"dropDownDirection",void 0),l([(0,o.kv)({type:String,required:!1,default:""})],c.prototype,"theme",void 0),l([(0,o.kv)({type:Boolean,required:!1,default:!0})],c.prototype,"showGroupNames",void 0),l([(0,o.kv)({type:Boolean,required:!1,default:!1})],c.prototype,"showSelectedGroup",void 0),l([(0,o.kv)({type:String,required:!1,default:"fullscreen"})],c.prototype,"mobileMode",void 0),l([(0,o.ox)("value")],c.prototype,"onValueChange",null),l([(0,o.ox)("$language.current")],c.prototype,"onLanguageChange",null),l([(0,o.ox)("selectedItemsCount")],c.prototype,"onSelectedItemsCountChange",null),l([(0,o.ox)("options")],c.prototype,"onOptionsChange",null),c=l([(0,i.uA)({name:"MultiSelect"})],c);const d=c,u=d;var p=r(1656),m=(0,p.A)(u,a,s,!1,null,"14e980ab",null);const h=m.exports},5289:(e,t,r)=>{r.d(t,{Y5:()=>m,lD:()=>p,uA:()=>d,vE:()=>u});var a=r(5471),s=r(6599),n=r(5194),i=r(2727),o=r(6604),l=r(373),c=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const d=s.Ay,u=s.vE;let p=class extends a.Ay{};p=c([d],p);let m=class extends(u(l.A,i.A,n.A,o.A)){};m=c([d],m)},5852:(e,t,r)=>{r.d(t,{A:()=>f});var a=function(){var e=this,t=e._self._c;e._self._setupProxy;return e.flagActive?t("div",[e._t("default")],2):e._e()},s=[],n=r(9442),i=r(5289),o=r(6599),l=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const c=(0,n.g_)({name:{type:String,required:!0}});let d=class extends((0,o.vE)(i.Y5,c)){get flagActive(){var e;return null===(e=this.$store.getters.featureFlags[this.name])||void 0===e?void 0:e.active}};d=l([(0,i.uA)({name:"FeatureFlag"})],d);const u=d,p=u;var m=r(1656),h=(0,m.A)(p,a,s,!1,null,null,null);const f=h.exports},6045:(e,t,r)=>{r.d(t,{A:()=>v});var a=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("svg",{attrs:{preserveAspectRatio:"none"}})},s=[],n=(r(3725),r(9838),r(9442)),i=r(5289),o=r(4820),l=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},c=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};const d=(0,n.g_)({placeholderUrl:{type:String,required:!1,default:""}});let u=class extends((0,i.vE)(i.Y5,d)){constructor(){super(...arguments),Object.defineProperty(this,"$emit",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}mounted(){this.getImage()}getImage(){return c(this,void 0,void 0,(function*(){if(!this.placeholderUrl)return void(this.$el.textContent="");const e=yield this.$store.dispatch("getParcelPlaceholder",this.placeholderUrl);if(!e)return;const t=(new DOMParser).parseFromString(e,"image/svg+xml").firstChild;
1this.$el.textContent="",[...t.attributes].forEach((({name:e,value:t})=>this.$el.setAttribute(e,t))),this.$el.setAttribute("preserveAspectRatio","xMidYMid meet"),this.$el.appendChild(t.firstChild),this.$emit("load")}))}};l([(0,o.ox)("placeholderUrl")],u.prototype,"getImage",null),u=l([(0,i.uA)({name:"ParcelPlaceholder"})],u);const p=u,m=p;var h=r(1656),f=(0,h.A)(m,a,s,!1,null,"23874011",null);const v=f.exports},6261:(e,t,r)=>{r.d(t,{A:()=>v});var a=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",{staticClass:"observation-thumbnail"},[e.rasterSrc&&e.loadImage?t("img",{key:"raster-image",staticClass:"raster-image",style:e.imageStyle,attrs:{src:e.rasterSrc,alt:"",loading:"lazy"}}):e._e(),t("parcel-placeholder",{staticClass:"parcel-placeholder",class:e.placeholderClass,attrs:{"placeholder-url":e.placeholderSrc},on:{load:e.updatePlaceholderStyle}}),e.showMissingNotice&&!e.rasterSrc?t("div",{directives:[{name:"translate",rawName:"v-translate"}],key:"missing-raster",staticClass:"missing-raster small"},[e._v("Missing image")]):e._e()],1)},s=[],n=(r(3725),r(2598),r(8517)),i=r(6045),o=r(5289),l=r(9442),c=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};const d=(0,l.g_)({placeholderClass:{type:String,default:""},parcel:{type:Object,required:!0},zoomLevel:{type:[Number,String],required:!1,default:15},showMissingNotice:{type:Boolean,required:!1,default:!1},kind:{type:String,required:!1,default:null},loadImage:{type:Boolean,default:!0,required:!1}});let u=class extends((0,o.vE)(o.Y5,d)){constructor(){super(...arguments),Object.defineProperty(this,"imageStyle",{enumerable:!0,configurable:!0,writable:!0,value:{"min-width":"auto","max-width":"auto","min-height":"auto","max-height":"auto"}})}get rasterSrc(){return(0,n.Jr)(this.displayRaster,this.zoomLevel)}get kindToDisplay(){return this.kind||this.$store.getters.rasterKind}get displayRaster(){var e;return this.parcel.rasters?null===(e=this.parcel.rasters)||void 0===e?void 0:e.find((e=>(null===e||void 0===e?void 0:e.kind)===this.kindToDisplay)):null}get placeholderSrc(){return(0,n.av)(this.parcel.svg_url)}updatePlaceholderStyle(){const e=this.$el.querySelector(".parcel-placeholder");if(!e)return;const t=e.getBoundingClientRect(),r=t.width+"px",a=t.height+"px";this.imageStyle["min-width"]=r,this.imageStyle["max-width"]=r,this.imageStyle["min-height"]=a,this.imageStyle["max-height"]=a,this.$emit("load")}};u=c([(0,o.uA)({name:"ParcelThumbnail",components:{ParcelPlaceholder:i.A}})],u);const p=u,m=p;var h=r(1656),f=(0,h.A)(m,a,s,!1,null,"df6db356",null);const v=f.exports},6604:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(5471),s=r(6599),n=r(4510),i=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i};let o=class extends a.Ay{notify(e){let t;switch(e.type){case"error":t="error";break;case"warning":t="warning";break;case"info":t="info";break;case"success":t="done";break;default:t=null}n.A.$emit("emitNotification",Object.assign({dismissable:!0,icon:t},e))}};o=i([s.Ay],o);const l=o},6823:(e,t,r)=>{r.d(t,{A:()=>l,W:()=>a});r(3725),r(9838);var a,s=r(1783);(function(e){e["None"]="none",e["Rasters"]="rasters",e["Crops"]="_CR"})(a||(a={}));const n=()=>({overlappedParcel:null,highlightedRaster:null,overlayMode:a.Rasters,showPointsOfInterest:!0}),i=(0,s.D)({clearMap(e){const t=n();Object.keys(t).forEach((r=>{e[r]=t[r]}))},setOverlappedParcel(e,t){e.overlappedParcel=t},setOverlayMode(e,t){e.overlayMode=t},setHighlightedRaster(e,t){e.highlightedRaster=t}}),o={overlappedParcel(e){return e.overlappedParcel},highlightedRaster(e){return e.highlightedRaster},overlayMode(e){return e.overlayMode}},l={strict:!0,state:n(),mutations:i,getters:o}},6987:(e,t,r)=>{r.d(t,{A:()=>v});var a=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("svg",{staticClass:"icon"})},s=[],n=(r(3725),r(9838),r(9442)),i=r(5289),o=r(4820),l=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},c=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};const d=(0,n.g_)({src:{type:String,required:!0}});let u=class extends((0,i.vE)(i.Y5,d)){constructor(){super(...arguments),Object.defineProperty(this,"$emit",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}mounted(){this.getImage()}getImage(){return c(this,void 0,void 0,(function*(){if(!this.src)return void(this.$el.textContent="");const e=yield(yield fetch(this.src)).text(),t=(new DOMParser).parseFromString(e,"image/svg+xml").firstChild;
1this.$el.textContent="",[...t.attributes].forEach((({name:e,value:t})=>this.$el.setAttribute(e,t))),this.$el.append(...t.childNodes),this.$emit("load")}))}};l([(0,o.ox)("src")],u.prototype,"getImage",null),u=l([(0,i.uA)({name:"SvgIcon"})],u);const p=u,m=p;var h=r(1656),f=(0,h.A)(m,a,s,!1,null,"3caae3e9",null);const v=f.exports},7871:(e,t,r)=>{r.d(t,{Ay:()=>v,hd:()=>c});r(1339),r(3725),r(9838),r(2598),r(5019),r(9471);var a=r(8517),s=r(9332),n=r(9442),i=r(1783),o=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};function l(){return{selectedParcel:null,selectedParcelId:null,selectedParcelCropIntervalId:null,selectedParcelOverlap:[],selectedParcelHistory:{},parcelOverlapCache:new s.q(50),parcelHistoryCache:new s.q(50),parcelCache:new s.q(50),recentParcels:new s.q(5),parcelPlaceholderCache:new s.q(50),parcelsForCurrentSeason:[],parcelsForSeason:{},parcelIndex:{},parcelSoils:{},soilMode:"soil_type"}}function c(e,t){var r,a;let s=t;return s.localityId=(null===(r=t.locality)||void 0===r?void 0:r.id)||t.localityId,s.locality=(null===(a=t.locality)||void 0===a?void 0:a.name)||t.locality,s.reference=[s.siruta,s.physical_block,s.parcel_no,s.crop_no].join("-"),s.name=`${t.locality||""} ${t.physical_block||""}-${t.parcel_no||""}`,s.name=s.name.trim(),s.nickname=t.display_name,s.uniqueKey=t.id,s.bbox=(0,n.o$)(t.bbox),s.crop_intervals=t.crop_intervals,s.shape=(0,n.o$)(t.shape),s.representative_point=(0,n.o$)(t.representative_point),s.selected=!1,s.season=t.season||(null===e||void 0===e?void 0:e.rootGetters.currentSeasonId),s.farm=t.farm||(null===e||void 0===e?void 0:e.rootGetters.currentFarmId),s}function d(e,t){var r,a;const s=t;return s.localityId=(null===(r=t.locality)||void 0===r?void 0:r.id)||t.localityId,s.locality=(null===(a=t.locality)||void 0===a?void 0:a.name)||t.locality,s.reference=[s.siruta,s.physical_block,s.parcel_no,s.crop_no].join("-"),s.name=`${t.locality||""} ${t.physical_block||""}-${t.parcel_no||""}`,s.name=s.name.trim(),s.nickname=t.display_name,s.uniqueKey=t.id,s.bbox=(0,n.o$)(t.bbox),s.shape=(0,n.o$)(t.shape),s.representative_point=(0,n.o$)(t.representative_point),s.selected=!1,s}function u(e,t){return t.map((t=>c(e,t)))}function p(e,t){return null===t||void 0===t?void 0:t.map((t=>d(e,t)))}const m=(0,i.D)({clearParcels(e){const t=l();Object.keys(t).forEach((r=>{e[r]=t[r]}))},addToRecentParcels(e,t){e.recentParcels.addItem(t.id,Object.assign({},t))},addParcelToCache(e,t){e.parcelCache.addItem(t.id,t)},addToParcelHistoryCache(e,t){Object.values(t).forEach((r=>{e.parcelHistoryCache.addItem(r.id,t),e.parcelCache.addItem(r.id,r)}))},addToParcelOverlapCache(e,{parcelId:t,parcelOverlap:r}){e.parcelOverlapCache.addItem(t,r)},clearParcelOverlapCache(e){e.parcelOverlapCache=new s.q},addToParcelPlaceholderCache(e,{placeholderUrl:t,promise:r}){e.parcelPlaceholderCache.addItem(t,r)},setSelectedParcel(e,t){e.selectedParcel=t,e.selectedParcelId=t?t.id:null},setSelectedParcelHistory(e,t){e.selectedParcelHistory=t},setSelectedParcelOverlap(e,t){e.selectedParcelOverlap=t},setParcelsForCurrentSeason(e,t){e.parcelsForCurrentSeason=t},setParcelsForSeason(e,{seasonId:t,parcels:r}){e.parcelsForSeason[t]=r},addParcelsToParcelIndex(e,t){const r=Object.assign({},e.parcelIndex),a=Object.keys(r).length;t.forEach(((e,t)=>{r[e.id]=e,r[e.id].index=a+t})),e.parcelIndex=Object.assign({},r)},setParcelSelected(e,{parcelId:t,selected:r}){e.parcelIndex[t]&&(e.parcelIndex[t].selected=r)},toggleParcelSelected(e,t){e.parcelIndex[t]&&(e.parcelIndex[t].selected=!e.parcelIndex[t].selected)},clearAllSelectedParcels(e){e.parcelsForCurrentSeason.forEach((e=>e.selected=!1))},setSelectedParcelCropIntervalId(e,t){e.selectedParcelCropIntervalId=t},setParcelSoils(e,t){e.parcelSoils=t},setSoilMode(e,t){e.soilMode=t}}),h={selectedParcel(e){return e.selectedParcel},selectedParcelId(e){return e.selectedParcelId},parcelCache(e){return e.parcelCache},parcelHistoryCache(e){return e.parcelHistoryCache},parcelOverlapCache(e){return e.parcelOverlapCache},parcelPlaceholderCache(e){return e.parcelPlaceholderCache},parcelById(e,t){return e=>t.parcelsForCurrentSeason.find((t=>t.id==e))},selectedParcelHistory(e){return e.selectedParcelHistory},selectedParcelOverlap(e){return(0,n.sX)(e.selectedParcelOverlap,"season")},recentParcels(e){return e.recentParcels.values()},parcelsForCurrentSeason(e,t,r,a){return a.currentFarm&&a.currentFarm.parcelAcce
1ssOnly?a.currentFarm.sharedParcels:e.parcelsForCurrentSeason},parcelsForSeason(e,t,r,a){return e=>t.parcelsForCurrentSeason.filter((t=>t.season==e))},parcelIndex(e){return e.parcelIndex},selectedParcels(e,t){return t.parcelsForCurrentSeason.filter((e=>e.selected))},selectedParcelsArea(e,t){return t.selectedParcels.reduce(((e,t)=>e+t.hectares),0)},selectedParcelsIds(e,t){return t.selectedParcels.map((e=>e.id))},selectedParcelsIdsSet(e,t){return new Set(t.selectedParcelsIds)},selectedParcelCropInterval(e){var t;return null===(t=e.selectedParcel)||void 0===t?void 0:t.crop_intervals.find((t=>t.id==e.selectedParcelCropIntervalId))},cropIntervalByDate(e,t,r,a){var s;return(0,n.MV)(null===(s=e.selectedParcel)||void 0===s?void 0:s.crop_intervals,a.selectedDate,a.currentSeason)},parcelSoils(e){return e.parcelSoils},soilMode(e){return e.soilMode}},f={getSelectedParcelHistory(e,t){return o(this,void 0,void 0,(function*(){if(e.rootGetters.currentFarmId&&e.rootGetters.currentSeasonId&&e.rootGetters.userHasAccessToFarm){if(!t)return e.commit("setSelectedParcelOverlap",[]),void e.commit("setSelectedParcelHistory",{});e.commit("setSelectedParcelOverlap",yield e.dispatch("getParcelOverlap",t)),e.commit("setSelectedParcelHistory",yield e.dispatch("getParcelHistory",t))}}))},getParcelOverlap(e,t){return o(this,void 0,void 0,(function*(){if(!e.rootGetters.currentFarmId||!e.rootGetters.currentSeasonId)return;let r=e.getters.parcelOverlapCache.getItem(t.id);return r||(r=yield(0,a.H2)("GET",`/farm/${e.rootGetters.currentFarmId}/season/${e.rootGetters.currentSeasonId}/parcel/${t.id}/parcel_overlap/`),r=u(e,r),r.push(Object.assign(Object.assign({},t),{season:e.rootGetters.currentSeasonId})),r.forEach((e=>{0==e.crop_intervals.length&&(e.crop_intervals=[{id:"null",crop_id:"null",interval:{lower:null,upper:null,bounds:"[)"}}])})),e.commit("addToParcelOverlapCache",{parcelId:t.id,parcelOverlap:r}),r)}))},getParcelHistory(e,t){return o(this,void 0,void 0,(function*(){let r=e.getters.parcelHistoryCache.getItem(t.id);if(r)return r;const a=yield e.dispatch("getParcelOverlap",t);return a?(r={},a.forEach((e=>{r[e.season]=Object.assign(Object.assign({},e),{uniqueKey:e.id})})),a.forEach((e=>{e.siruta&&t.siruta&&e.locality&&t.locality&&(e.siruta!==t.siruta&&e.locality!==t.locality||(r[e.season]=Object.assign(Object.assign({},e),{uniqueKey:e.id})))})),a.forEach((e=>{e.reference!==t.reference&&e.locality!==t.locality||(r[e.season]=Object.assign(Object.assign({},e),{uniqueKey:e.id}))})),r[t.season]=Object.assign(Object.assign({},t),{uniqueKey:t.id}),e.commit("addToParcelHistoryCache",r),r):void 0}))},setCurrentParcel(e,t){return o(this,void 0,void 0,(function*(){if(e.getters.selectedParcelId===t||!e.rootGetters.currentFarmId||!e.rootGetters.currentSeasonId)return;const r=yield e.dispatch("getParcelDetails",t);e.commit("setSelectedParcel",r),yield e.dispatch("getSelectedParcelHistory",r)}))},getParcelDetails(e,t){return o(this,void 0,void 0,(function*(){var r;if(!e.rootGetters.currentFarmId||!e.rootGetters.currentSeasonId||!t)return;let s=e.getters.parcelCache.getItem(t);return s||(s=yield(0,a.H2)("GET",`/farm/${e.rootGetters.currentFarmId}/season/${e.rootGetters.currentSeasonId}/parcel/${t}/`),s.localityId=null===(r=Object.values(e.rootGetters.localitiesForCurrentSeason).find((e=>e.name==s.locality)))||void 0===r?void 0:r.id,e.commit("addParcelToCache",s)),s.uniqueKey=s.id,c(e,s)}))},getParcelPlaceholder(e,t){return o(this,void 0,void 0,(function*(){const r=e.getters.parcelPlaceholderCache;let a=r.getItem(t);a||(a=fetch(t,{method:"GET",redirect:"follow"}),e.commit("addToParcelPlaceholderCache",{placeholderUrl:t,promise:a}));const s=yield a;if(s.ok)return yield s.clone().text()}))},getParcelsForCurrentSeason(e){return o(this,void 0,void 0,(function*(){if(!e.rootGetters.currentFarmId||!e.rootGetters.currentSeasonId)return;const t=yield(0,a.H2)("GET",`/farm/${e.rootGetters.currentFarmId}/season/${e.rootGetters.currentSeasonId}/list_parcels/`),r=u(e,t);return e.commit("setParcelsForCurrentSeason",r),e.commit("addParcelsToParcelIndex",r),r}))},getParcelsForSeason(e,t){return o(this,void 0,void 0,(function*(){if(!e.rootGetters.currentFarmId||!t)return;const r=yield(0,a.H2)("GET",`/farm/${e.rootGetters.currentFarmId}/season/${t}/list_parcels/`),s=u(e,r);e.commit("addParcelsToParcelIndex",s)}))},getFarmCurrentSeasonParcels(e,t){return o(this,arguments,void 0,(function*(e,{farmId:t}){if(!t)return;const r=yield(0,a.H2)("GET",`/farm/${t}/current_season_parcels/`),s=p(e,r);e.commit("setParcelsForCurrentSeason",s)}))},getAllSharedParcels(e){return o(this,void 0,void 0,(function*(){yield Promise.all(e.rootGetters.sharedFarms.filter((e=>
1e.parcelAccessOnly)).map((t=>e.dispatch("getSharedParcels",t.id))))}))},getSharedParcels(e,t){return o(this,void 0,void 0,(function*(){const r=yield(0,a.H2)("GET","/shared-parcels/",{limit:5e3,farm_id:t}),s=u(e,r.results);e.commit("setSharedParcels",{farmId:t,sharedParcels:s})}))}},v={strict:!0,state:l(),mutations:m,actions:f,getters:h}},8045:(e,t,r)=>{r.d(t,{LE:()=>u,xC:()=>f});var a=r(5471),s=r(160),n=r.n(s),i=r(4510),o=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};const l="en",c={en:{},ro:{},fr:{}},d={en:()=>r.e(821).then(r.t.bind(r,6821,19)),ro:()=>r.e(169).then(r.t.bind(r,5169,19)),fr:()=>r.e(558).then(r.t.bind(r,7558,19))};function u(){a.Ay.use(n(),{availableLanguages:{ro:"Română",fr:"Français",en:"English"},defaultLanguage:l,translations:c,silent:!0})}const p={year:{year:"numeric"},month:{month:"short",year:"numeric"},dateShort:{day:"numeric",month:"short"},date:{day:"numeric",month:"short",year:"numeric"},dateLong:{dateStyle:"long"},day:{day:"numeric"},time:{hour:"numeric",minute:"numeric"}},m={ha:{style:"unit",unit:"hectare",unitDisplay:"short",minimumFractionDigits:2,maximumFractionDigits:2},"%":{style:"percent",notation:"compact",maximumFractionDigits:1},lei:{style:"currency",currency:"RON",currencyDisplay:"narrowSymbol"},C:{style:"unit",unit:"celsius",unitDisplay:"short",maximumFractionDigits:1,trailingZeroDisplay:"stripIfInteger"}};function h(e,t){const r=window.currentLanguage||l;if(e instanceof Date)return e.toLocaleDateString(r,p[t]);if("number"===typeof e){if("string"===typeof t)return e.toLocaleString(r,m[t]).replace(" "," ");let a="number"===typeof t?{minimumFractionDigits:t,maximumFractionDigits:t}:t;return e.toLocaleString(r,a)}throw Error("No format available for "+typeof e+" and "+t)}function f(e,t){return o(this,arguments,void 0,(function*(e,t,r=!0){if(!c[e]||!Object.keys(c[e]).length){i.A.$emit(i.A.events.requestStarted);try{const t=yield d[e]();c[e]=t[e]}catch(a){i.A.$emit(i.A.events.apiUnknownError)}finally{i.A.$emit(i.A.events.requestFinished)}}if(r)try{window.localStorage.setItem("language",e)}catch(a){}window.currentLanguage=e,t.$language.current=e}))}a.Ay.prototype.format=h},8119:(e,t,r)=>{r.d(t,{C4:()=>F,CK:()=>B,FI:()=>M,GU:()=>u,H_:()=>y,IM:()=>q,JU:()=>$,JY:()=>o,KJ:()=>s,MV:()=>O,NT:()=>E,O$:()=>j,OJ:()=>h,Qs:()=>x,SE:()=>D,Sv:()=>T,Sw:()=>S,WV:()=>p,YN:()=>i,_N:()=>n,av:()=>C,gc:()=>c,gj:()=>N,h_:()=>L,i7:()=>d,jv:()=>U,nI:()=>v,oI:()=>A,of:()=>g,pp:()=>k,r$:()=>f,rF:()=>b,rK:()=>R,ws:()=>l,zX:()=>m});var a=r(9442);const s=Object.assign({},{VUE_APP_GOOGLE_MAPS_KEY:"AIzaSyDq8pymjmh381sHtUOu19ymuWhezvgA47I",VUE_APP_SENTRY_DSN:"https://39f5455a31f640bc8f68173345a5bfb8@o4505170284773376.ingest.sentry.io/4505504233684992",VUE_APP_SCRAPE_TIMEOUT:"",VUE_APP_GA4_ID:"G-XD56BEQEC1",VUE_APP_HOST:"https://ogor.ro",VUE_APP_STRIPE_PUBLISHABLE_KEY:"pk_live_51NM7eRByTZ97YMrpOeIcRprqEOnFsg69PToaaJSVZKwnIbJ9rf9HgdfzsoAXTn0KQz3G1lnO3rfZrfzO9ePJa0PX00qRmalaZq",VUE_APP_NAME:"OGOR",NODE_ENV:"production",VUE_APP_SENTRY_ENV:"production",VUE_APP_VRA_UPLOAD_URL:"https://ogor.farm/vra/workspace/upload-alcedo-xml?extern=true",VUE_APP_FACEBOOK_PIXEL_ID:"595279198180531",VUE_APP_DEMO_FARM_DEFAULT_DATE:"2025-11-03",VUE_APP_API_HOST:"api.ogor.ro",VUE_APP_SENTRY_RELEASE:"",VUE_APP_GOOGLE_MAPS_MAP_ID:"2b40bf921d3d77ee",VUE_APP_VERSION:"4.18.12",BASE_URL:"/"}),n=new Set(["NDVI","NDVI_NEW","NDWI","MZ"]),i={NDVI:"NDVI",NDWI:"NDWI",MZ:"NDVI",NDVI_NEW:"NDVI",TCI:"TCI"},o="NDVI_NEW",l={MZ:{"-1.00, 0.05":"#422112","0.05, 0.15":"#9f512a","0.15, 0.25":"#cea815","0.25, 0.30":"#fdfe00","0.30, 0.35":"#e6ed01","0.35, 0.40":"#d0df00","0.40, 0.45":"#b9cf00","0.45, 0.50":"#a2c000","0.50, 0.55":"#8bb000","0.55, 0.60":"#72a000","0.60, 0.65":"#5b8e03","0.65, 0.70":"#458000","0.70, 0.75":"#2f6f00","0.75, 0.80":"#176100","0.80, 1.00":"#005200"},NDVI_NEW:{"-1.00, 0.05":"#422112","0.05, 0.15":"#9f512a","0.15, 0.25":"#cea815","0.25, 0.30":"#fdfe00","0.30, 0.35":"#ebf200","0.35, 0.40":"#d9e600","0.40, 0.45":"#c7d900","0.45, 0.50":"#b5cd00","0.50, 0.55":"#a3c100","0.55, 0.60":"#91b400","0.60, 0.65":"#7fa800","0.65, 0.70":"#6d9b00","0.70, 0.75":"#5b8f00","0.75, 0.80":"#498300","0.80, 0.85":"#377600","0.85, 0.90":"#256a00","0.90, 0.95":"#125e00","0.95, 1.00":"#005200"},NDVI:{"-1.00, -0.20":"rgba(0, 0, 0, 255)","-0.20, 0.00":"rgba(165 , 0, 38, 255)","0.00, 0.10":"rgba(215 , 48 , 39, 255)","0.10, 0.20":"rgba(244 , 109 , 67, 255)","0.20, 0.30":"rgba(253 , 174 , 97, 255)","0.30, 0.40":"rgba(254 , 224 , 139, 255)","0.40, 0.50":"rgba(255 , 255 , 191, 255)","0.50, 0.60":"rgba(217 , 239 , 139, 255)","0.60, 0.70":"rgba(166 , 217 , 106, 255)","0.70, 0.80":"rgba(102 , 189 , 99, 255)","0.80, 0.90":"rgba(26 , 152 , 80, 255)","0.90, 1.00":"rgba(0, 104 , 55, 255)"},NDWI:{"-1.00, 0.10":"rgba(251, 255, 147, 255)","0.10, 0.20":"rgba(204, 231, 154, 255)","0.20, 0.30":"rgba(163, 211, 160, 255)","0.30, 0.40":"rgba(119, 189, 167, 255)","0.40, 0.50":"rgba(84, 167, 177, 255)","0.50, 0.60":"rgba(60, 143, 194, 255)","0.60, 0.70":"rgba(37, 120, 211, 255)","0.70, 0.80":"rgba(25,  83, 197, 255)","0.80, 0.90":"rgba(15,  44, 178, 255)","0.90, 1.00":"rgba(4,   1, 157, 255)"}},c={MZ:[{interval:[.8,1],display:"0.80-1.00"},{interval:[.75,.8],display:"0.75-0.80"},{interval:[.7,.75],display:"0.70-0.75"},{interval:[.65,.7],display:"0.65-0.70"},{interval:[.6,.65],display:"0.60-0.65"},{interval:[.55,.6],display:"0.55-0.60"},{interval:[.5,.55],display:"0.50-0.55"},{interval:[.45,.5],display:"0.45-0.50"},{interval:[.4,.45],display:"0.40-0.45"},{interval:[.35,.4],display:"0.35-0.40"},{interval:[.3,.35],display:"0.30-0.35"},{interval:[.25,.3],display:"0.25-0.30"},{interval:[.15,.25],display:"0.15-0.25"},{interval:[.05,.15],display:"0.05-0.15"},{interval:[-1,.05],display:"< 0.05"}],NDVI_NEW:[{interval:[.95,1],display:"0.95-1.00"},{interval:[.9,.95],display:"0.90-0.95"},{interval:[.85,.9],display:"0.85-0.90"},{interval:[.8,.85],display:"0.80-0.85"},{interval:[.75,.8],display:"0.75-0.80"},{interval:[.7,.75],display:"0.70-0.75"},{interval:[.65,.7],display:"0.65-0.70"},{interval:[.6,.65],display:"0.60-0.65"},{interval:[.55,.6],display:"0.55-0.60"},{interval:[.5,.55],display:"0.50-0.55"},{interval:[.45,.5],display:"0.45-0.50"},{interval:[.4,.45],display:"0.40-0.45"},{interval:[.35,.4],display:"0.35-0.40"},{interval:[.3,.35],display:"0.30-0.35"},{interval:[.25,.3],display:"0.25-0.30"},{interval:[.15,.25],display:"0.15-0.25"},{interval:[.05,.15],display:"0.05-0.15"},{interval:[-1,.05],display:"< 0.05"}],NDVI:[{interval:[.9,1],display:"0.9-1.0"},{interval:[.8,.9],display:"0.8-0.9"},{interval:[.7,.8],display:"0.7-0.8"},{interval:[.6,.7],display:"0.6-0.7"},{interval:[.5,.6],display:"0.5-0.6"},{interval:[.4,.5],display:"0.4-0.5"},{interval:[.3,.4],display:"0.3-0.4"},{interval:[.2,.3],display:"0.2-0.3"},{interval:[.1,.2],display:"0.1-0.2"}
1,{interval:[0,.1],display:"0.0-0.1"},{interval:[-.2,0],display:"-0.2-0.0"},{interval:[-1,-.2],display:"< -0.2"}],NDWI:[{interval:[.9,1],display:"0.9-1.0"},{interval:[.8,.9],display:"0.8-0.9"},{interval:[.7,.8],display:"0.7-0.8"},{interval:[.6,.7],display:"0.6-0.7"},{interval:[.5,.6],display:"0.5-0.6"},{interval:[.4,.5],display:"0.4-0.5"},{interval:[.3,.4],display:"0.3-0.4"},{interval:[.2,.3],display:"0.2-0.3"},{interval:[.1,.2],display:"0.1-0.2"},{interval:[-1,.1],display:"< 0.1"}]},d=s.VUE_APP_MIN_ZOOM_LEVEL?parseInt(s.VUE_APP_MIN_ZOOM_LEVEL):14,u=s.VUE_APP_MAX_ZOOM_LEVEL?parseInt(s.VUE_APP_MAX_ZOOM_LEVEL):17,p=3e6,m=6371,h=14,f=17,v=(Math.pow(2,f-h),"production"===s.NODE_ENV&&!!s.VUE_APP_SENTRY_DSN),g={MZ:!1},y=s.VUE_APP_SCRAPE_DRY_RUN?!!JSON.parse(s.VUE_APP_SCRAPE_DRY_RUN.toLowerCase()):"production"!==s.NODE_ENV,b=1e3*parseInt(s.VUE_APP_SCRAPE_TIMEOUT||"60"),w="http:"!==window.location.protocol.toLowerCase(),_="development"===s.NODE_ENV?`${window.location.protocol}//localhost:8000`:`${window.location.protocol}//${window.location.host}`,C=s.VUE_APP_API_HOST?`${window.location.protocol}//${s.VUE_APP_API_HOST}`:_,P="v1",S=`${C}/api/${P}`,I=new URL(S).host,x=`${w?"wss":"ws"}://${I}/ws`,O=s.VUE_APP_GOOGLE_MAPS_KEY,k="weekly",A="#FDC776",$="#FF3333",F=(0,a._U)(s.VUE_APP_DEMO_FARM_DEFAULT_DATE),D={OVER_MAX_COVER:"OVER_MAX_COVER"},j=.01,E=12096e5,N=[{label:"OSM",name:"OpenStreetMap",group:"OpenStreetMap",choices:["a","b","c"],url:({r:e,z:t,x:r,y:a})=>`https://${e}.tile.openstreetmap.org/${t}/${r}/${a}.png`,tileSize:[256,256],maxZoom:19},{label:"OSM no-labels",name:"OSM no-labels",group:"OpenStreetMap",choices:[],url:({z:e,x:t,y:r})=>`https://tiles.wmflabs.org/osm-no-labels/${e}/${t}/${r}.png`,tileSize:[256,256],maxZoom:19},{label:"Humanitarian",name:"Humanitarian",group:"OpenStreetMap",choices:["a","b"],url:({r:e,z:t,x:r,y:a})=>`http://${e}.tile.openstreetmap.fr/hot/${t}/${r}/${a}.png`,tileSize:[256,256],maxZoom:20},{label:"OpenTopoMap",name:"OpenTopoMap",group:"OpenStreetMap",choices:["a","b","c"],url:({r:e,z:t,x:r,y:a})=>`https://${e}.tile.opentopomap.org/${t}/${r}/${a}.png`,tileSize:[256,256],maxZoom:19},{label:"Mapnik b/w",name:"Mapnik b/w",group:"OpenStreetMap",choices:[],url:({z:e,x:t,y:r})=>`https://tiles.wmflabs.org/bw-mapnik/${e}/${t}/${r}.png`,tileSize:[256,256],maxZoom:19}],T="+40 (746) 347 347",L=1e4,M=["#92330B","#E9BB64","#FFFECE","#82DCC6","#44AEDC","#2168BD","#0F2F82"],R={wheat:{"0-20 cm":[100,150,250,350,450,650,1/0],"0-50 cm":[250,350,450,650,950,1500,1/0],"0-100 cm":[350,650,950,1350,1750,2250,1/0]},maize:{"0-20 cm":[100,150,250,350,450,650,1/0],"0-50 cm":[250,350,450,650,950,1500,1/0],"0-100 cm":[350,650,950,1450,1850,2250,1/0]}},q={wheat:[{depth:"0-100 cm",date:{month:9,day:9}},{depth:"0-20 cm",date:{month:11,day:9}},{depth:"0-50 cm",date:{month:12,day:9}},{depth:"0-100 cm",date:{month:12,day:31}}],maize:[{depth:"0-20 cm",date:{month:5,day:9}},{depth:"0-50 cm",date:{month:6,day:9}},{depth:"0-100 cm",date:{month:12,day:31}}]},U=[101,105,108,201,202],B={start:new Date((new Date).getFullYear(),9,1),end:new Date((new Date).getFullYear(),11,31)}},8215:(e,t,r)=>{r.d(t,{A:()=>v});var a=function(){var e=this,t=e._self._c;e._self._setupProxy;return t("modal",{ref:"modal",attrs:{header:e.headerText,"modal-size":"small","mobile-mode":"fullscreen","close-on-click-outside":!1},on:{close:function(t){return e.$emit("close")}},scopedSlots:e._u([{key:"body",fn:function({transitionEnded:r}){return[t("form",{staticClass:"farm-modal-body",attrs:{id:"update-farm-form"},on:{submit:function(t){return t.preventDefault(),e.createOrUpdateFarm.apply(null,arguments)}}},[t("section",[t("label",{directives:[{name:"translate",rawName:"v-translate"}],staticClass:"large-bold",attrs:{for:"farm-name-modal"}},[e._v(" What's the name of your farm? ")]),t("div",{staticClass:"input-group"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.name,expression:"name"},{name:"focus",rawName:"v-focus",value:r,expression:"transitionEnded"}],attrs:{id:"farm-name-modal",tabindex:"0",type:"text",placeholder:e.$gettext("Farm name")},domProps:{value:e.name},on:{input:function(t){t.target.composing||(e.name=t.target.value)}}})]),e.errors.name?t("div",{staticClass:"error-display"},[t("i",{staticClass:"material-icons"}
1,[e._v("error")]),e._v(" "+e._s(e.errors.name)+" ")]):e._e()]),e.errors.error?t("section",{staticClass:"error-text error-display"},[t("i",{staticClass:"material-icons"},[e._v("warning")]),e._v(" "+e._s(e.errors.error)+" ")]):e._e()])]}},{key:"footer",fn:function(){return[t("button",{staticClass:"action-button fill",attrs:{disabled:!e.name,form:"update-farm-form",type:"submit"}},[e._v(" "+e._s(e.buttonText)+" ")])]},proxy:!0}])})},s=[],n=r(4099),i=r(8517),o=r(5289),l=r(4820),c=function(e,t,r,a){var s,n=arguments.length,i=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,r,a);else for(var o=e.length-1;o>=0;o--)(s=e[o])&&(i=(n<3?s(i):n>3?s(t,r,i):s(t,r))||i);return n>3&&i&&Object.defineProperty(t,r,i),i},d=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};let u=class extends o.Y5{constructor(){super(...arguments),Object.defineProperty(this,"farm",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"modal",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"errors",{enumerable:!0,configurable:!0,writable:!0,value:{error:"",name:""}})}get headerText(){return this.farm?this.$gettext("Edit your farm"):this.$gettext("Add your farm")}get buttonText(){return this.farm?this.$gettext("Save changes"):this.$gettext("Add farm")}mounted(){this.farm&&(this.name=this.getFarmName(this.farm))}createOrUpdateFarm(){return d(this,void 0,void 0,(function*(){const e={name:this.name};let t,r,a;this.farm?(t="PATCH",r=`/farm/${this.farm.id}/`,a="FARM_EDITED"):(t="POST",r="/farm/",a="FARM_CREATED");try{const a=yield(0,i.H2)(t,r,{},e);this.modal.closeModal(),yield this.$store.dispatch("getFarms"),"POST"===t&&this.isMobile?yield this.$router.push({name:"choose-import-type",params:{farmId:a.id}}):"POST"===t&&(yield this.$router.push({name:"manage-farm",params:{farmId:a.id}}))}catch(s){this.setErrors(s)}}))}};c([(0,l.kv)({type:Object,required:!1,default:null})],u.prototype,"farm",void 0),c([(0,l.oS)()],u.prototype,"modal",void 0),u=c([(0,o.uA)({name:"UpdateFarmModal",components:{Modal:n.A}})],u);const p=u,m=p;var h=r(1656),f=(0,h.A)(m,a,s,!1,null,"614beb44",null);const v=f.exports},8517:(e,t,r)=>{r.d(t,{Yy:()=>C,BV:()=>O,H2:()=>m,av:()=>w,lw:()=>d,W4:()=>D,aF:()=>N,Rn:()=>u,BZ:()=>x,U6:()=>E,Uk:()=>S,FB:()=>v,Jr:()=>_,DJ:()=>p,je:()=>b,iD:()=>y,_x:()=>j,MS:()=>k,Yt:()=>I,Yh:()=>A,F6:()=>$});r(3725),r(9838),r(5019),r(2598),r(1339);var a=r(4510),s=r(9442),n=r(8119);const i={"audio/aac":".aac","application/x-abiword":".abw","application/x-freearc":".arc","video/x-msvideo":".avi","application/vnd.amazon.ebook":".azw","application/octet-stream":".bin","image/bmp":".bmp","application/x-bzip":".bz","application/x-bzip2":".bz2","application/x-csh":".csh","text/css":".css","text/csv":".csv","application/msword":".doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","application/vnd.ms-fontobject":".eot","application/epub+zip":".epub","application/gzip":".gz","image/gif":".gif","text/html":".htm","image/vnd.microsoft.icon":".ico","text/calendar":".ics","application/java-archive":".jar","image/jpeg":".jpeg","text/javascript":".mjs","application/json":".json","application/ld+json":".jsonld","audio/x-midi":".mid","audio/mpeg":".mp3","video/mpeg":".mpeg","application/vnd.apple.installer+xml":".mpkg","application/vnd.oasis.opendocument.presentation":".odp","application/vnd.oasis.opendocument.spreadsheet":".ods","application/vnd.oasis.opendocument.text":".odt","audio/ogg":".oga","video/ogg":".ogv","application/ogg":".ogx","audio/opus":".opus","font/otf":".otf","image/png":".png","application/pdf":".pdf","application/x-httpd-php":".php","application/vnd.ms-powerpoint":".ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":".pptx","application/vnd.rar":".rar","application/rtf":".rtf","application/x-sh":".sh","image/svg+xml":".svg","application/x-shockwave-flash":".swf","application/x-tar":".tar","image/tiff":".tif","video/mp2t":".ts","font/ttf":".ttf","text/plain":".txt","application/vnd.visio":".vsd","audio/wav":".wav","audio/webm":".weba","video/webm":".webm","image/webp":".webp","font/woff":".woff","font/woff2":".woff2","application/xhtml+xml":".xhtml","application/vnd.ms-excel":".xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":".xlsx","text/xml":".xml","application/vnd.mozilla.xul+xml":".xul","application/zip":".zip","audio/3gpp":".3gp","audio/3gpp2":".3g2","application/x-7z-compressed":".7z"};var o=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};
1class l extends Error{constructor(e,t){e=`${e}: ${t.detail}`,super(e),Object.assign(this,t),this.name="APIError"}}function c(e){const t=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(e);return null!=t&&t[1]?t[1].replace(/['"]/g,""):null}function d(){return o(this,arguments,void 0,(function*(e="GET",t="/",r={},a=void 0,s="application/json"){return m(e,t,r,a,s,"default")}))}function u(){return o(this,arguments,void 0,(function*(e="GET",t="/",r={},a=void 0,s="application/json",n="application/json"){return m(e,t,r,a,s,"no-cache",!0,n)}))}function p(e){return o(this,arguments,void 0,(function*(e,t=null,r){try{return yield e}catch(a){if(!r||-1!==r.indexOf(a.statusCode))return t;throw a}}))}function m(){return o(this,arguments,void 0,(function*(e="GET",t="/",r={},i=void 0,o="application/json",l="no-cache",c=!1,d="application/json"){let u,p;if(!t)return;u=t.startsWith(n.Sw)?new URL(t):new URL(n.Sw+t),Array.isArray(r)||(r=Object.entries(r)),r.forEach((e=>{u.searchParams.append(e[0],e[1])}));try{p=window.localStorage.getItem("language")}catch(v){}p||(p=window.currentLanguage);const m=(0,s.Ri)("csrftoken"),f={method:e,mode:"cors",cache:l,credentials:"include",headers:{Accept:d},redirect:"follow",body:void 0};if(i instanceof FormData&&(o="multipart/form-data"),i)switch(o){case"multipart/form-data":if(i instanceof FormData){f.body=i;break}const e=new FormData;Object.entries(i).forEach((t=>{e.append(...t)})),f.body=e;break;case"application/json":f.headers["Content-Type"]=o,f.body=JSON.stringify(i);break;default:f.headers["Content-Type"]=o,f.body=i}m&&(f.headers["X-CSRFToken"]=m),p&&(f.headers["Accept-Language"]=p);try{return a.A.$emit(a.A.events.requestStarted),yield h(u,f,c)}finally{a.A.$emit(a.A.events.requestFinished)}}))}function h(e,t){return o(this,arguments,void 0,(function*(e,t,r=!1){let s;try{s=yield fetch(e.toString(),t)}catch(n){throw a.A.$emit(a.A.events.apiConnectError),n}return r?yield g(s):yield f(s)}))}function f(e){return o(this,void 0,void 0,(function*(){if(204===e.status)return{};if("application/json"!==e.headers.get("Content-Type"))return;let t;try{t=yield e.json()}catch(r){throw a.A.$emit(a.A.events.apiReadError),r}if(t.requestURL=new URL(e.url),t.statusCode=e.status,!e.ok)throw new l("API Error",t);return t}))}function v(e){if(e.details){if("string"===typeof e.details)return e.details;{let t=e.details,r=Object.keys(t)[0];while("object"===typeof t[r][0])t=t[r][0],r=Object.keys(t)[0];return t[r][0]}}return e.detail||e.error?e.detail||e.error:((0,s.vV)(e),null)}function g(e){return o(this,void 0,void 0,(function*(){let t;const r=e.headers.get("Content-Disposition");if(r&&(t=c(r)),!t){const r=i[e.headers.get("Content-Type")]||"";t=e.url.split("/").filter((e=>!!e)).slice(-1)[0]+r}return(0,s.PE)(yield e.blob(),t)}))}function y(e,t){return o(this,void 0,void 0,(function*(){const r=m("POST","/auth/login/",{},{email:e,password:t});return r}))}function b(){return o(this,void 0,void 0,(function*(){yield m("POST","/auth/logout/"),window.localStorage.removeItem("_userPreferences"),window.localStorage.removeItem("userPreferences")}))}function w(e){let t;if(e)return e.startsWith(n.av)?t=new URL(e):(e.startsWith("/")||(e="/"+e),t=new URL(n.av+e)),t.toString()}function _(e,t){if(!e||!e.images||!t)return;if("none"===t)return w("/"+e.images[0].url);const r=e.images.find((e=>e.zoom===`z${t}`));return r?w("/"+r.url):void 0}class C{constructor(e,t=200){Object.defineProperty(this,"ws",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"messages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxBacklog",{enumerable:!0,configurable:!0,writable:!0,value:200}),this.ws=null,this.messages=[],this.maxBacklog=t,e.startsWith(n.Qs)?this.url=new URL(e):this.url=new URL(n.Qs+e)}open(){return this.ws=new WebSocket(this.url.toString()),this.ws.addEventListener("message",(e=>{this.messages.push(JSON.parse(e.data)),this.messages.length>this.maxBacklog&&this.messages.shift()})),new Promise(((e,t)=>{this.ws.onopen=()=>e(this),this.ws.onerror=e=>t(e)}))}waitUntilMessage(e,t=6e4){return new Promise(((r,a)=>{this.ws.addEventListener("close",a);let s=!1;const n=this.messages.find((t=>e(t)));if(n)return s=!0,r(n);const i=t=>{if(s)return;const a=JSON.parse(t.data);e(a)&&(s=!0,this.ws.removeEventListener("message",i),r(a))};this.ws.addEventListener("message",i),window.setTimeout((()=>{!s&&this.ws&&(s=!0,this.ws.removeEventListener("message",i),a("timeout"))}),t)}))}close(){try{this.ws.close()}catch(e){}finally{this.messages=[],this.ws=null}}}function P(e){const t=["target_yield","sale_price","total_area"];for(let r of t)e[r]=e[r]||0;return e}
1function S(e,t,r){const a=`/plan/farm/${e}/season/${t}/crop/${r}/crop_plan/`;return m("GET",a).then((e=>o(this,void 0,void 0,(function*(){const t=P(e);return t.activities=yield F(t),t}))))}function I(e,t,r,a){const s=`/plan/farm/${e}/season/${t}/crop-plan/${r}/`;return m("PATCH",s,void 0,a).then(P)}function x(){const e="/plan/activity/";return m("GET",e).then((e=>e.results))}function O(e,t){const{farm:r,season:a,id:s}=e,n=`/plan/farm/${r}/season/${a}/crop-plan/${s}/activity/`;return m("POST",n,void 0,{activity:t,total_budget:0}).then((t=>(t.total_area=e.total_area,t.work_evaluations=[],t)))}function k(e,t,r){const a=`/plan/farm/${e.farm}/season/${e.season}/crop-plan/${e.id}/activity/${t}/`;return m("PATCH",a,void 0,r)}function A(e,t,r,a){const s=`/plan/farm/${e}/season/${t}/crop-plan/${r}/activity/${a}/`;return m("DELETE",s)}function $(e,t){console.log(t);const{id:r,farm:a,season:s}=e,n=`/plan/farm/${a}/season/${s}/crop-plan/${r}/activity/set_order/`;return m("POST",n,void 0,{crop_plan_activities:t}).then((e=>(console.log("response",e),e)))}function F(e){const{farm:t,season:r,id:a}=e,s=`/plan/farm/${t}/season/${r}/crop-plan/${a}/activities/?include_work_evaluations=true`;return m("GET",s).then((e=>e.sort(((e,t)=>e.order-t.order))))}function D(e,t,r){const{farm:a,season:s}=e,n=`/plan/farm/${a}/season/${s}/crop-plan/${e.id}/activity/${t.id}/close/`;return m("PUT",n,void 0,r)}function j(e,t){const{farm:r,season:a}=e,s=`/plan/farm/${r}/season/${a}/crop-plan/${e.id}/activity/${t.id}/open/`;return m("PUT",s)}function E(e,t,r,a){const s=`/plan/farm/${e}/season/${t}/crop-plan/${r}/activity/${a}/parcels/`;return m("GET",s).then((e=>e.map((e=>{var t,r;return e.localityId=(null===(t=e.locality)||void 0===t?void 0:t.id)||e.localityId,e.locality=(null===(r=e.locality)||void 0===r?void 0:r.name)||e.locality,e.reference=[e.siruta,e.physical_block,e.parcel_no,e.crop_no].join("-"),e.name=`${e.locality||""} ${e.physical_block||""}-${e.parcel_no||""}`,e.name=e.name.trim(),e.nickname=e.display_name,e.uniqueKey=e.id,e}))))}function N(e,t,r,a){const s=`/plan/farm/${e}/season/${t}/crop-plan/${r}/close/`;return m("PUT",s)}},8705:(e,t,r)=>{e.exports=r.p+"img/add_to_homescreen.1a461974.svg"},9332:(e,t,r)=>{r.d(t,{q:()=>a});r(1339);class a{constructor(e=20){Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"keys",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"getItem",{enumerable:!0,configurable:!0,writable:!0,value:e=>this.cache[e]}),Object.defineProperty(this,"addItem",{enumerable:!0,configurable:!0,writable:!0,value:(e,t)=>{if(this.cache[e])return this.cache[e]=t,this.keys.splice(this.keys.indexOf(e),1),void this.keys.push(e);this.keys.length===this.maxSize&&delete this.cache[this.keys.shift()],this.keys.push(e),this.cache[e]=t}}),Object.defineProperty(this,"values",{enumerable:!0,configurable:!0,writable:!0,value:()=>this.keys.map((e=>this.cache[e]))}),this.maxSize=e}}},9442:(e,t,r)=>{r.d(t,{$o:()=>Oe,AC:()=>T,Ay:()=>Ee,C2:()=>C,Do:()=>Pe,Ex:()=>Y,FK:()=>re,Fr:()=>l,Gq:()=>x,Hy:()=>Ae,Iq:()=>D,Iu:()=>V,JD:()=>z,JH:()=>d,Jy:()=>ae,Lf:()=>K,Lm:()=>Ne,MV:()=>De,NK:()=>X,O1:()=>te,O3:()=>w,OG:()=>ce,PE:()=>f,Pu:()=>Ce,QC:()=>He,Qu:()=>c,R:()=>$e,R3:()=>H,Ri:()=>h,Rn:()=>fe,Sl:()=>ee,TQ:()=>u,W$:()=>Se,W9:()=>W,WW:()=>I,X6:()=>S,XO:()=>E,Xj:()=>Re,Xx:()=>Be,Yq:()=>$,_A:()=>le,_U:()=>F,__:()=>m,a:()=>je,aG:()=>p,ae:()=>ne,ao:()=>J,ay:()=>A,cn:()=>Te,cv:()=>B,du:()=>k,f2:()=>Me,f3:()=>Fe,fU:()=>pe,gO:()=>Ie,g_:()=>Le,gh:()=>We,hT:()=>qe,i5:()=>G,kc:()=>Ue,kr:()=>g,lx:()=>ke,ng:()=>Z,ni:()=>_,nx:()=>v,o$:()=>ie,oV:()=>j,qE:()=>y,qe:()=>me,sX:()=>U,sl:()=>b,vV:()=>ue,vf:()=>q,vw:()=>N,wJ:()=>ze,wm:()=>R,xE:()=>O,xL:()=>P,yU:()=>se,yh:()=>he,yn:()=>Ge});r(3725),r(2598),r(5019),r(9838),r(9471),r(1339),r(9229);var a=r(5289),s=r(5353),n=r(8119),i=r(8517),o=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};function l(){return window.innerWidth<=768}function c(){return window.matchMedia("(display-mode: standalone)").matches||!!window.navigator.standalone||document.referrer.includes("android-app://")}function d(e){return JSON.parse(JSON.stringify(e))}function u(e,t){if(e&&t)return Array.isArray(e)||(e=Object.values(e)),e.find((e=>E(t,e.start_date,e.end_date)))}function p(e,t){return e&&t?(Array.isArray(e)||(e=Object.values(e)),e.filter((e=>E(t,e.start_date,e.end_date))).sort(((e,t)=>t.end_date.getTime()-e.end_date.getTime()))):[]}function m(e,t){return e&&t?t.find((t=>E(t,e.start_date,e.end_date))):null}function h(e){const t={};return document.cookie.split(";").forEach((e=>{const[r,a]=e.split("=");t[r.trim()]=a})),t[e]}function f(e,t){if("undefined"!==typeof window.navigator.msSaveBlob)window.navigator.msSaveBlob(e,t);else{const r=null!=window.webkitURL?window.webkitURL:window.URL,a=r.createObjectURL(e),s=document.createElement("a");s.style.display="none",s.href=a,s.setAttribute("download",t),"undefined"===typeof s.download&&s.setAttribute("target","_blank"),document.body.appendChild(s),s.click(),document.body.removeChild(s),r.revokeObjectURL(a)}}function v(e){return e.length<=0?e:e[0].toUpperCase()+e.slice(1).toLowerCase()}function g(e,t){let r=parseFloat(""+e),a=(r>0&&r<.1?.1:r).toFixed(t);return 0===parseFloat(a)&&(a=(0).toFixed(t)),a}function y(e,t,r){return Math.min(Math.max(e,t),r)}function b(e){return e?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function w(e){if(!e)return"";const t=e.name;return e.apia_code?`${t} (${e.apia_code})`:t}function _(e){return e?`APIA Code: ${e}`:""}function C(e,t=11,r=8,a="..."){const s=e.length;return s<=t+a.length+r?e:e.substring(0,t)+a+e.substring(s-r)}function P(e,t){return e=(e||"").toUpperCase(),t=(t||"").toUpperCase(),e.localeCompare(t)}function S(e,t){return e-t}function I(e,t){return!!e&&e.toLowerCase().includes(t.toLowerCase())}function x(){const e=new Date;return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function O(e,t){const r=Math.abs(t.getTime()-e.getTime());return Math.ceil(r/864e5)}function k(e){return O(x(),e)}function A(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function $(e){if(!e)return"";let t=e.getDate().toString(),r=(e.getMonth()+1).toString();return 1===t.length&&(t="0"+t),1===r.length&&(r="0"+r),`${e.getFullYear()}-${r}-${t}`}function F(e){if(!e)return;const t=e.split(" ")[0].split("-");return new Date(parseInt(t[0]),parseInt(t[1])-1,parseInt(t[2]))}function D(e){return{date:F(e.date),value:e.value||0}}function j(e,t){return void 0===e||null===e?t:"true"===e.toString().toLowerCase()}function E(e,t,r){return!!e&&((!r||e<=r)&&(!t||e>=t))}function N(e,t){return!!e&&!!t&&e.getTime()===t.getTime()}function T(e,t){return e.getTime()-t.getTime()}const L=60,M=60*L;function R(e){let t=""+Math.floor(e/M),r=""+Math.floor(e%M/L),a=""+e%M%L;1==t.length&&(t="0"+t),1==r.length&&(r="0"+r),1==a.length&&(a="0"+a);let s="00"!=t?`${t}:`:"";return s+=`${r}:${a}`,s}function q(e,t=null,r="en",a=null){const s={};e.forEach((e=>{const r=t?new Date(e[t]):new Date(e),n=new Date(r.getFullYear(),r.getMonth(),1),i=$(n);s[i]||(s[i]={firstOfMonth:n,objects:[],month:""}),s[i].objects.push(a?a(e):e)}));const n=Object.values(s).sort(((e,t)=>t.firstOfMonth.getTime()-e.firstOfMonth.getTime()));let i=null;
1return n.forEach((e=>{const a=e.firstOfMonth.getFullYear();e.month=e.firstOfMonth.toLocaleDateString(r,{month:"long",year:i!==a?"numeric":void 0}),e.objects.sort(((e,r)=>new Date(r[t]).getTime()-new Date(e[t]).getTime())),i=a})),n}function U(e,t){const r="function"===typeof t?t:e=>e[t];return e.reduce(((e,t)=>{const a=r(t);return e[a]=e[a]||[],e[a].push(t),e}),{})}function B(e,t){return e.reduce(((e,r)=>Object.assign(Object.assign({},e),{[t(r)]:r})),{})}function H(e,t=e=>e){const r=B(e,t);return Object.values(r)}function G(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Y(e){if(2===e.length)return e.map((e=>parseFloat(e))).sort(((e,t)=>e-t)).map((e=>e.toFixed(2))).join(", ")}function V(e){return e?e.skipped===n.SE.OVER_MAX_COVER?"#CAD1D2":W(e.index_mean,e.kind):n.oI}function W(e,t){const r=n.gc[t].find((({interval:t})=>{if(t[0]<e&&e<=t[1])return!0}));return r?n.ws[t][Y(r.interval)]:n.oI}function z(e,t){const r=t.coordinates[0];return new e.LatLngBounds({lng:r[0][0],lat:r[0][1]},{lng:r[2][0],lat:r[2][1]})}function K(e,t){const r=t.bbox;return z(e,r)}function J(e,t){if(!t||!t.map_bbox||!t.map_bbox.coordinates)return;const r=t.map_bbox;return z(e,r)}
1function X(e){const t=e.getNorthEast(),r=e.getSouthWest();return{type:"Polygon",coordinates:[[[r.lng(),r.lat()],[r.lng(),t.lat()],[t.lng(),t.lat()],[t.lng(),r.lat()],[r.lng(),r.lat()]]]}}function Z(e,t,r){const a=t.getNorthEast(),s=t.getSouthWest(),n=e.geometry.spherical.computeDistanceBetween(s,a),i=e.geometry.spherical.computeHeading(s,a),o=e.geometry.spherical.computeHeading(a,s),l=e.geometry.spherical.computeOffset(s,n*r,i),c=e.geometry.spherical.computeOffset(a,n*r,o);return new e.LatLngBounds(c,l)}function Q(e){return e*(Math.PI/180)}function ee(e,t,r,a){e=Q(e),t=Q(t),r=Q(r),a=Q(a);const s=a-t,i=r-e,o=Math.sin(i/2)*Math.sin(i/2)+Math.cos(e)*Math.cos(r)*Math.sin(s/2)*Math.sin(s/2),l=2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o));return n.zX*l}function te(e){if(!e||!e.bbox||!e.bbox.coordinates||e.bbox.coordinates.length<=0)return 0;const t=e.bbox.coordinates[0];return ee(t[0][1],t[0][0],t[2][1],t[2][0])}function re(e,t=n.OJ){const r=te(e);return r?r<.25?t+3:r<.65?t+2:r<1.1?t+1:r<1.8?t:r<2.7?t-1:r<12.5?t-2:r<25?t-3:r<50?t-4:r<100?t-5:t-2:t}function ae(e){const t=Math.floor(Math.random()*e.length);return e[t]}function se(e,t){return e.map(((e,r)=>[e,t[r]]))}function ne(e){let t=-90,r=90,a=-180,s=180;return e.forEach((e=>{const[n,i]=e;n>t&&(t=n),n<r&&(r=n),i>a&&(a=i),i<s&&(s=i)})),{type:"Polygon",coordinates:[[[r,s],[t,s],[t,a],[r,a],[r,s]]]}}function ie(e){return"string"===typeof e?JSON.parse(e):e}let oe;function le(){return o(this,void 0,void 0,(function*(){return oe||(oe=yield r.e(326).then(r.bind(r,3484))),oe}))}function ce(e){return o(this,void 0,void 0,(function*(){n.nI?(yield le()).captureMessage(e,"error"):console.error(e)}))}function de(e){return o(this,void 0,void 0,(function*(){n.nI?(yield le()).captureException(e):console.error(e,Object.assign({},e))}))}function ue(e){de(e).catch((()=>console.log(e)))}function pe(e){let t;try{t=ie(window.localStorage.getItem(e))||{}}catch(r){t={}}return t}function me(e,t,r){let a=pe(e);try{let s=JSON.stringify(Object.assign(Object.assign({},a),{[t]:r}));window.localStorage.setItem(e,s)}catch(s){}}function he(e){return o(this,arguments,void 0,(function*(e,t=1080,r=.7){window.URL=window.URL||window.webkitURL;const a=window.URL.createObjectURL(e),s=new Image;s.src=a,yield new Promise((e=>{s.onload=e}));const n=document.createElement("canvas");let i=s.width,o=s.height;const l=Math.min(i,o);if(l>t){const e=i/o;l==i?(i=t,o=i/e):(o=t,i=o*e)}n.width=i,n.height=o;const c=n.getContext("2d");return c.drawImage(s,0,0,i,o),n.toDataURL("image/jpeg",r)}))}function fe(e){const t=(null===e||void 0===e?void 0:e.rain)||(null===e||void 0===e?void 0:e.snow);return t?t["1h"]||t["3h"]||t:0}const ve=1e3,ge=60*ve,ye=60*ge,be=24*ye,we=30*be,_e=365*we;function Ce(e,t){const r=Math.abs(e.getTime()-t.getTime());let a=r;const s=Math.floor(a/_e);a-=s*_e;const n=Math.floor(a/we);a-=n*we;const i=Math.floor(a/be);a-=i*be;const o=Math.floor(a/ye);a-=o*ye;const l=Math.floor(a/ge);a-=l*ge;const c=Math.ceil(a/ve);return{years:s,months:n,days:i,hours:o,minutes:l,seconds:c}}function Pe(e){return(e+180)*(256/360)}function Se(e){return 128-256*Math.log(Math.tan(Math.PI/4+e*Math.PI/180/2))/(2*Math.PI)}function Ie(e){return e instanceof google.maps.LatLng||(e=new google.maps.LatLng(e)),{x:Pe(e.lng()),y:Se(e.lat())}}function xe([e,t]){return new jsts.geom.Coordinate(e,t)}function Oe(e,t,r){const a=new e.geom.GeometryFactory,s=t.map((e=>xe(e))),n=a.createLinearRing(s),i=(null===r||void 0===r?void 0:r.map((e=>{const t=e.map((e=>xe(e)));return a.createLinearRing(t)})))||null,o=a.createPolygon(n,i);return o}function ke(e,t,r=e=>({parcelId:e.id})){const a=Oe(e,t.shape.coordinates[0],t.shape.coordinates.slice(1));return a.setUserData(r(t)),a}function Ae(e,{lat:t,lng:r}){const a=new e.geom.GeometryFactory,s=new e.geom.Coordinate(r,t),n=a.createPoint(s);return n}function $e(e,t){const r=new e.geom.GeometryFactory,a=t.map((t=>new e.geom.Coordinate(t.lng,t.lat))),s=r.createLineString(a);return s}function Fe(e,t,r=1e-5){return Math.abs(e-t)<=r}function De(e,t,r){if(!e||0==e.length)return null;if(!t)return e[0];const a=new Date(t),s=e.find((e=>{const t=e.interval.lower||r.start_date,s=e.interval.upper||r.end_date,n=new Date(s);return n.setHours(23,59,59,999),new Date(t).getTime()<=a.getTime()&&a.getTime()<=n.getTime()}))||e[0];return s.computed_start_date=s.interval.lower||$(r.start_date),s.c
1omputed_end_date=s.interval.upper||$(r.end_date),s}function je(e,t,r){if(!e||0===e.length||!t)return null;const a=new Date(t);return e.find((e=>{const t=e.interval.lower||r.start_date,s=e.interval.upper||r.end_date,n=new Date(s);return n.setHours(23,59,59,999),new Date(t).getTime()<=a.getTime()&&a.getTime()<=n.getTime()}))||null}function Ee(e,t,r){var a;const s=De(e,t,r);return(null===(a=null===s||void 0===s?void 0:s.crop)||void 0===a?void 0:a.id)||(null===s||void 0===s?void 0:s.crop_id)||null}function Ne(e,t,r){if(!e)return"";const a=new Date(e.interval.lower||t.start_date),s=new Date(e.interval.upper||t.end_date),n=a.toLocaleDateString(r,{day:"numeric",month:"short",year:"2-digit"})+(e.interval.lower?"":"*"),i=s.toLocaleDateString(r,{day:"numeric",month:"short",year:"numeric"})+(e.interval.upper?"":"*");return`${n} – ${i}`}function Te(e){return a.lD.extend({computed:Object.assign({},(0,s.L8)(e))})}function Le(e){return a.lD.extend({props:e})}function Me(e,t){return new e.Marker(t)}function Re(e,t,r="0"){return(""+e).padStart(t,r)}function qe(e,t){return Object.keys(e).reduce(((r,a)=>t(e[a])?Object.assign(Object.assign({},r),{[a]:e[a]}):r),{})}function Ue(e){return{crop_id:e,interval:{lower:null,upper:null,bounds:"[)"}}}function Be(e,t,r=!0){const a=r?Math.abs(e):e,s=t.find((({interval:e})=>e[0]<=a&&a<e[1]))||t[0];return s.transform(e)+" "+s.unit}function He(){return o(this,void 0,void 0,(function*(){const e={next:"/api/v1/auth/user/"};yield(0,i.H2)("POST","/hijack/release/",{},e,"multipart/form-data");let t=window.localStorage.getItem("_userPreferences");window.localStorage.setItem("userPreferences",t),window.location.href=window.location.origin+"/staff/users"}))}function Ge(e,t){var r;if(!e||void 0===t)return"#422112";const a=Ye(e);return(null===(r=a.find((({interval:e})=>t>=e[0]&&t<=e[1])))||void 0===r?void 0:r.color)||"white"}function Ye(e){const t=Ve(e);return n.gc[e].map((e=>t[Y(e.interval)]))}function Ve(e){const t={};return n.gc[e].forEach((r=>{const a=Y(r.interval);t[a]=Object.assign(Object.assign({},r),{key:a,color:n.ws[e][a]})})),t}function We(e,t){return t.filter((t=>t.crop_intervals.some((t=>t.crop_id===e))))}function ze(e,t,r){if(!t)return null;const a=t.name.en.toLowerCase(),s={type:r||null,depth:null,scale:null};return s.type||(a.includes("maize")&&(s.type="maize"),a.includes(" wheat")&&(s.type="wheat"),s.type)?(s.depth=n.IM[s.type].find((t=>e.getMonth()+1<t.date.month||e.getMonth()+1===t.date.month&&e.getDate()<=t.date.day)),s.depth?(s.scale=n.rK[s.type][s.depth.depth],s):null):null}},9543:(e,t,r)=>{e.exports=r.p+"img/map.4dcf4b2c.svg"},9724:(e,t,r)=>{r.d(t,{A:()=>h,M:()=>a});r(3725),r(9838),r(5019),r(1339);var a,s=r(1783),n=r(8517),i=r(9442),o=function(e,t,r,a){function s(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function i(e){try{l(a.next(e))}catch(t){n(t)}}function o(e){try{l(a["throw"](e))}catch(t){n(t)}}function l(e){e.done?r(e.value):s(e.value).then(i,o)}l((a=a.apply(e,t||[])).next())}))};function l(e,t){const r=Object.assign({},e),a=t.rootGetters.parcelIndex[e.parcel],s=(0,i.MV)(null===a||void 0===a?void 0:a.crop_intervals,t.rootGetters.selectedDate,t.rootGetters.currentSeason);return r.crop_interval=null===s||void 0===s?void 0:s.id,r}function c(e,t,r=!0){const{farm:a,season:s,parcel:n,id:i}=e;let o=`/mapnotes/farm/${a}`;return r&&n&&(o+=`/season/${s}/parcel/${n}`),o+="/mapnote/",i&&(o+=`${i}/`),o}function d(){return{notes:[],notesForFarmId:null,showNotes:!0,showParcelLabels:!1,noteFilters:{read:!0,unread:!0,solved:!0,time:a.FOREVER},showAddPhotos:!1}}(function(e){e[e["FOREVER"]=0]="FOREVER",e[e["LAST_TWO_WEEKS"]=1]="LAST_TWO_WEEKS",e[e["THIS_SEASON"]=2]="THIS_SEASON"})(a||(a={}));const u=(0,s.D)({clearNotes(e){const t=d();Object.keys(t).forEach((r=>{e[r]=t[r]}))},setNotes(e,t){e.notes=t},setNotesForFarmId(e,t){e.notesForFarmId=t},setShowNotes(e,t){e.showNotes=t,(0,i.qe)("visibilitySettings","showNotes",t)},setShowParcelLabels(e,t){e.showParcelLabels=t,(0,i.qe)("visibilitySettings","showParcelLabels",t)},setNoteFilters(e,t){e.noteFilters=Object.assign(Object.assign({},e.noteFilters),t),(0,i.qe)("visibilitySettings","noteFilters",e.noteFilters)},setShowAddPhotos(e,t){e.showAddPhotos=t}}),p={notes(e){return e.notes},showNotes(e){return e.showNotes},showParcelLabels(e){return e.showParcelLabels},showSolvedNotes(e){return e.noteFilters.solved},noteFilters(e){return e.noteFilters},filteredNotes(e,t,r,a){const s=e.noteFilters,n=f(s.time,a.currentSeason),i=v(s);return e.notes.filter((e=>i(e)&&n(e)))},showAddPhotos(e){return e.showAddPhotos}},m={getNotesPreferences(e){return o(this,void 0,void 0,(function*(){var t,r,s;const n=(0,i.fU)("visibilitySettings");e.commit("setShowNotes",null===(t=n.showNotes)||void 0===t||t),e.commit("setShowParcelLabels",null!==(r=n.showParcelLabels)&&void 0!==r&&r),e.commit("setNoteFilters",null!==(s=n.noteFilters)&&void 0!==s?s:{read:!0,unread:!0,solved:!0,time:a.FOREVER})}))},getNotesForCurrentFarm(e){return o(this,arguments,void 0,(function*(e,t=!1){if(!e.rootGetters.currentFarm)return;const r=e.rootGetters.currentFarm,a=e.state.notesForFarmId;if(r.id!=a||t){const t=(yield(0,n.H2)("GET",`/mapnotes/farm/${r.id}/mapnote/`,{limit:1e4})).results;e.commit("setNotes",t),e.commit("setNotesForFarmId",r.id)}}))},addNote(e,t){return o(this,void 0,void 0,(function*(){const r=l(t,e),a=c(t,e),s=yield(0,n.H2)("POST",a,{},r);return yield e.dispatch("getNotesForCurrentFarm",!0),s}))},patchNote(e,t){return o(this,arguments,void 0,(function*(e,{note:t,initialNote:r}){const a=l(t,e),s=c(r||t,e,!1),o=(0,i.JH)(a);o.photos=o.photos.map((e=>e.id?{id:e.id}:e));const d=yield(0,n.H2)("PATCH",s,{},o);return yield e.dispatch("getNotesForCurrentFarm",!0),d}))},deleteNote(e,t){return o(this,void 0,void 0,(function*(){const r=c(t,e);yield(0,n.H2)("DELETE",r),yield e.dispatch("getNotesForCurrentFarm",!0)}))}},h={strict:!0,state:d(),getters:p,mutations:u,actions:m};function f(e,t){const r=e=>(0,i._U)(e.user_created_date);switch(e){case a.FOREVER:return()=>!0;case a.LAST_TWO_WEEKS:return e=>r(e).getTime()>=(0,i.Gq)().getTime()-12096e5;case a.THIS_SEASON:return e=>(0,i.XO)(r(e),t.start_date,t.end_date);default:throw"wrong condition"}}function v(e){return e.solved?()=>!0:e=>"solved"!=e.status}}},t={};function r(a){var s=t[a];if(void 0!==s)return s.exports;var n=t[a]={id:a,loaded:!1,exports:{}};return e[a].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.m=e,(()=>{var e=[];r.O=(t,a,s,n)=>{if(!a){var i=1/0;for(d=0;d<e.length;d++){for(var[a,s,n]=e[d],o=!0,l=0;l<a.length;l++)(!1&n||i>=n)&&Object.keys(r.O).every((e=>r.O[e](a[l])))?a.splice(l--,1):(o=!1,n<i&&(i=n));if(o){e.splice(d--,1);var c=s();void 0!==c&&(t=c)}}return t}n=n||0;for(var d=e.length;d>0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[a,s,n]}})(),(()=>{r.n=e=>
1{var t=e&&e.__esModule?()=>e["default"]:()=>e;return r.d(t,{a:t}),t}})(),(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;r.t=function(a,s){if(1&s&&(a=this(a)),8&s)return a;if("object"===typeof a&&a){if(4&s&&a.__esModule)return a;if(16&s&&"function"===typeof a.then)return a}var n=Object.create(null);r.r(n);var i={};e=e||[null,t({}),t([]),t(t)];for(var o=2&s&&a;"object"==typeof o&&!~e.indexOf(o);o=t(o))Object.getOwnPropertyNames(o).forEach((e=>i[e]=()=>a[e]));return i["default"]=()=>a,r.d(n,i),n}})(),(()=>{r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})}})(),(()=>{r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,a)=>(r.f[a](e,t),t)),[]))})(),(()=>{r.u=e=>"js/"+({71:"ogorSoilMap",107:"ogorAdmin",153:"ogorParcelDetails",185:"ogorAppUserSettings",206:"ogorAppHome",320:"ogorMapAlceloOrder",326:"sentry",353:"ogorAppHistory",515:"ogorAlcedoLanding",587:"ogorCompare",626:"ogorSnapshot",686:"ogorCropDetails",859:"MapAlcedoResults",933:"auth",959:"ogorManageFarm"}[e]||e)+"."+{37:"bc784032",58:"2c83e306",71:"34005527",98:"7c463283",107:"57cfcb34",143:"d7e83e28",153:"219bde23",168:"a96a6859",169:"aafccaa7",185:"5479d4eb",206:"dbe84fd6",254:"2eef76f9",304:"5893803c",320:"30786246",326:"2ef21dd1",353:"02503302",361:"7b511456",364:"bede6acc",374:"db7e29f9",378:"ee36aadd",515:"0b7d62f4",532:"f8df59b5",543:"ff26d423",558:"3698db46",587:"694a6765",626:"7482df97",686:"2ff16e56",694:"10e3cfb3",821:"ee894af1",859:"5b5b0dee",873:"66ccc791",879:"099d83e2",933:"bcaed534",943:"89659230",959:"07cc6df1"}[e]+".js"})(),(()=>{r.miniCssF=e=>"css/"+({71:"ogorSoilMap",107:"ogorAdmin",153:"ogorParcelDetails",185:"ogorAppUserSettings",206:"ogorAppHome",320:"ogorMapAl
1celoOrder",353:"ogorAppHistory",515:"ogorAlcedoLanding",587:"ogorCompare",626:"ogorSnapshot",686:"ogorCropDetails",859:"MapAlcedoResults",933:"auth",959:"ogorManageFarm"}[e]||e)+"."+{37:"1a331e33",71:"9b11dc00",107:"0fd5d917",153:"7319aad5",185:"e301fb02",206:"20383115",254:"1479f723",320:"6ce00f47",353:"e20eb234",361:"877a4a8f",515:"f5c96c19",587:"cb03c801",626:"33f17cdf",686:"018dcb06",859:"53d8e7af",933:"b26431f4",959:"1e7745e4"}[e]+".css"})(),(()=>{r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()})(),(()=>{r.hmd=e=>(e=Object.create(e),e.children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e)})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{var e={},t="ogor:";r.l=(a,s,n,i)=>{if(e[a])e[a].push(s);else{var o,l;if(void 0!==n)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var u=c[d];if(u.getAttribute("src")==a||u.getAttribute("data-webpack")==t+n){o=u;break}}o||(l=!0,o=document.createElement("script"),o.charset="utf-8",o.timeout=120,r.nc&&o.setAttribute("nonce",r.nc),o.setAttribute("data-webpack",t+n),o.src=a),e[a]=[s];var p=(t,r)=>{o.onerror=o.onload=null,clearTimeout(m);var s=e[a];if(delete e[a],o.parentNode&&o.parentNode.removeChild(o),s&&s.forEach((e=>e(r))),t)return t(r)},m=setTimeout(p.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=p.bind(null,o.onerror),o.onload=p.bind(null,o.onload),l&&document.head.appendChild(o)}}})(),(()=>{r.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})(),(()=>{r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e)})(),(()=>{r.p="/"})(),(()=>{var e=(e,t,r,a)=>{var s=document.createElement("link");s.rel="stylesheet",s.type="text/css";var n=n=>{if(s.onerror=s.onload=null,"load"===n.type)r();else{var i=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.href||t,l=new Error("Loading CSS chunk "+e+" failed.\n("+o+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=i,l.request=o,s.parentNode.removeChild(s),a(l)}};return s.onerror=s.onload=n,s.href=t,document.head.appendChild(s),s},t=(e,t)=>{for(var r=document.getElementsByTagName("link"),a=0;a<r.length;a++){var s=r[a],n=s.getAttribute("data-href")||s.getAttribute("href");if("stylesheet"===s.rel&&(n===e||n===t))return s}var i=document.getElementsByTagName("style");for(a=0;a<i.length;a++){s=i[a],n=s.getAttribute("data-href");if(n===e||n===t)return s}},a=a=>new Promise(((s,n)=>{var i=r.miniCssF(a),o=r.p+i;if(t(i,o))return s();e(a,o,s,n)})),s={524:0};r.f.miniCss=(e,t)=>{var r={37:1,71:1,107:1,153:1,185:1,206:1,254:1,320:1,353:1,361:1,515:1,587:1,626:1,686:1,859:1,933:1,959:1};s[e]?t.push(s[e]):0!==s[e]&&r[e]&&t.push(s[e]=a(e).then((()=>{s[e]=0}),(t=>{throw delete s[e],t})))}})(),(()=>{var e={524:0};r.f.j=(t,a)=>{var s=r.o(e,t)?e[t]:void 0;if(0!==s)if(s)a.push(s[2]);else{var n=new Promise(((r,a)=>s=e[t]=[r,a]));a.push(s[2]=n);var i=r.p+r.u(t),o=new Error,l=a=>{if(r.o(e,t)&&(s=e[t],0!==s&&(e[t]=void 0),s)){var n=a&&("load"===a.type?"missing":a.type),i=a&&a.target&&a.target.src;o.message="Loading chunk "+t+" failed.\n("+n+": "+i+")",o.name="ChunkLoadError",o.type=n,o.request=i,s[1](o)}};r.l(i,l,"chunk-"+t,t)}},r.O.j=t=>0===e[t];var t=(t,a)=>{var s,n,[i,o,l]=a,c=0;if(i.some((t=>0!==e[t]))){for(s in o)r.o(o,s)&&(r.m[s]=o[s]);if(l)var d=l(r)}for(t&&t(a);c<i.length;c++)n=i[c],r.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return r.O(d)},a=globalThis["webpackChunkogor"]=globalThis["webpackChunkogor"]||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))})();var a=r.O(void 0,[504],(()=>r(3659)));a=r.O(a)})();
2//# sourceMappingURL=app.c3ee4c9b.js.map

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.