PageSourceSearch

https://next.landdiary.co.za/assets/MonitoringSettings-CGhKePGD.js

js landdiary.co.za collected 2026-10-10 01:51:33 UTC 37,759 bytes, 1 lines download raw bytes

1import{c as pe,d as D,am as Ze,Q as he,an as We,u as $e,s as Fe,x as Ae,y as Ve,z as Le,F as ye,H as xe,I as be,J as Se,K as fe,a8 as Xe,a9 as et,a as Z,aa as tt,A as Ee,Z as W,C as Oe,ao as Te,ap as Ue,aq as at,g as le,ar as De,as as Ie,at as Re,au as Ge,av as ke,aw as _e,ax as ot,ay as st,az as me,aA as je,aB as rt,R as lt,T as nt,U as ee,V as se,W as it,X as K,a2 as Me,aC as ut,aD as dt,aE as ct,L as ft}from"./index-BbF7QgQI.js";import{_ as mt}from"./SettingsDeleteButton-Diut-iUJ.js";import{_ as gt}from"./AdminSearchBar-CFKerCOy.js";import{_ as pt}from"./SettingsStatusSwitch-C_WRrPKt.js";import{J as i,Z as x,a6 as a,a7 as h,P as B,a as $,aw as vt,O as o,N as e,L as r,a8 as m,F as O,ax as ht,w as ne,aS as we,K as L,_ as te,an as re,aq as J,ay as ge,ar as yt,r as E,as as F,z as xt}from"./vendor-vue-DURFy_Zo.js";import{a as bt,_ as Pe}from"./RadioGroupItem-D2u4MSTo.js";import{bl as St,F as It,a$ as _t}from"./vendor-ui-DftFJnGN.js";import"./vendor-pdf-C48WDLAr.js";import"./vendor-dexie-DDJAGg5f.js";import"./googleMapsLoader-C324Mfsp.js";const $t={key:0,class:"rounded-lg border bg-muted/30 p-4 space-y-3 text-sm"},Tt={class:"text-xs font-semibold uppercase tracking-wide text-muted-foreground"},wt={class:"grid gap-3 sm:grid-cols-2"},Ct={class:"font-medium"},Nt={class:"font-medium"},kt={key:0,class:"grid gap-3 sm:grid-cols-2 border-t pt-3"},Mt={class:"font-medium"},Pt={class:"font-medium"},Ft={class:"font-medium"},At={class:"font-medium"},Vt={class:"sm:col-span-2"},Lt={class:"font-medium"},Et={key:1},Ot={class:"font-medium"},Ut={key:2,class:"grid grid-cols-3 gap-2 text-xs border-t pt-3"},Dt={class:"rounded border bg-background px-2 py-1.5"},Rt={class:"font-medium"},Gt={class:"rounded border bg-background px-2 py-1.5"},jt={class:"font-medium"},Bt={class:"rounded border bg-background px-2 py-1.5"},Ht={class:"font-medium"},qt={__name:"CatalogTargetProfileSummary",props:{profile:{type:Object,default:null},title:{type:String,default:"Monitoring profile"},detailed:{type:Boolean,default:!1}},setup(p){const w=p,l=b=>b==null||b===""?"—":`${b}`,U=$(()=>{const b=w.profile;if(!b)return"—";const v=[b.observationType,b.observationUnit,b.pointDescription].filter(Boolean);return b.observationsQuantity!=null&&b.observationsQuantity!==""&&v.unshift(`Qty ${b.observationsQuantity}`),b.observationPoints!=null&&b.observationPoints!==""&&v.push(`${b.observationPoints} points`),v.join(" · ")||"—"});return(b,v)=>p.profile?(i(),x("div",$t,[a("p",Tt,h(p.title),1),a("div",wt,[a("div",null,[v[0]||(v[0]=a("p",{class:"text-xs text-muted-foreground"},"Monitor method",-1)),a("p",Ct,h(l(p.profile.monitorMethodType)),1)]),a("div",null,[v[1]||(v[1]=a("p",{class:"text-xs text-muted-foreground"},"Observation frequency",-1)),a("p",Nt,h(l(p.profile.observationFrequency)),1)])]),a("div",null,[v[2]||(v[2]=a("p",{class:"text-xs text-muted-foreground"},"Description",-1)),a("p",null,h(l(p.profile.instructionDescription)),1)]),a("div",null,[v[3]||(v[3]=a("p",{class:"text-xs text-muted-foreground"},"Monitoring procedure",-1)),a("p",null,h(l(p.profile.monitoringProcedure)),1)]),p.detailed?(i(),x("div",kt,[a("div",null,[v[4]||(v[4]=a("p",{class:"text-xs text-muted-foreground"},"Observation type",-1)),a("p",Mt,h(l(p.profile.observationType)),1)]),a("div",null,[v[5]||
1(v[5]=a("p",{class:"text-xs text-muted-foreground"},"Observations",-1)),a("p",Pt,h(l(p.profile.observationsQuantity)),1)]),a("div",null,[v[6]||(v[6]=a("p",{class:"text-xs text-muted-foreground"},"Unit",-1)),a("p",Ft,h(l(p.profile.observationUnit)),1)]),a("div",null,[v[7]||(v[7]=a("p",{class:"text-xs text-muted-foreground"},"Sample locations (points in block)",-1)),a("p",At,h(l(p.profile.observationPoints)),1)]),a("div",Vt,[v[8]||(v[8]=a("p",{class:"text-xs text-muted-foreground"},"Point description",-1)),a("p",Lt,h(l(p.profile.pointDescription)),1)])])):(i(),x("div",Et,[v[9]||(v[9]=a("p",{class:"text-xs text-muted-foreground"},"Observation",-1)),a("p",Ot,h(U.value),1)])),p.profile.hasThreshold||p.profile.thresholdLow!=null||p.profile.thresholdMedium!=null||p.profile.thresholdHigh!=null?(i(),x("div",Ut,[a("div",Dt,[v[10]||(v[10]=a("span",{class:"text-muted-foreground"},"Catalog low",-1)),a("p",Rt,h(l(p.profile.thresholdLow)),1)]),a("div",Gt,[v[11]||(v[11]=a("span",{class:"text-muted-foreground"},"Catalog medium",-1)),a("p",jt,h(l(p.profile.thresholdMedium)),1)]),a("div",Bt,[v[12]||(v[12]=a("span",{class:"text-muted-foreground"},"Catalog high",-1)),a("p",Ht,h(l(p.profile.thresholdHigh)),1)])])):B("",!0)])):B("",!0)}},zt={class:"rounded-lg border bg-card p-4 space-y-4"},Yt={class:"flex items-center gap-3 border-b pb-3"},Qt={class:"space-y-4 border-t pt-4"},Kt={class:"space-y-2"},Jt={key:0,class:"text-xs text-muted-foreground"},Zt={key:1,class:"grid grid-cols-3 gap-3 rounded-lg border bg-muted/30 p-4 text-sm"},Wt={class:"text-xs text-muted-foreground"},Xt={class:"font-semibold tabular-nums"},ea={class:"text-xs font-normal text-muted-foreground"},ta={class:"font-semibold tabular-nums"},aa={class:"text-xs font-normal text-muted-foreground"},oa={class:"text-xs text-muted-foreground"},sa={class:"font-semibold tabular-nums"},ra={class:"text-xs font-normal text-muted-foreground"},la={class:"flex items-start gap-2"},na={key:0,class:"flex items-center justify-between"},ia={class:"flex items-center space-x-2"},ua={key:1,class:"grid grid-cols-3 gap-3 rounded-lg border border-primary/20 bg-primary/5 p-4"},da={class:"space-y-2"},ca={class:"space-y-2"},fa={class:"space-y-2"},Be={__name:"MonitoringStageConfigCard",props:ht({stageName:{type:String,required:!0},profile:{type:Object,default:null},referenceImages:{type:Array,default:()=>[]},disabled:{type:Boolean,default:!1}},{modelValue:{type:Object,required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const w=p,l=vt(p,"modelValue"),U=$({get:()=>l.value?.selected===!0||l.value?.isSelected===!0,set:I=>{l.value={...l.value,selected:I,isSelected:I}}}),b=$(()=>We(w.profile)),v=$(()=>{const I=w.profile;return I?I.pointDescription?I.pointDescription:I.observationType==="Percentage"?"%":I.observationType==="Count"||I.observationType==="Number"?"count":"value":""}),y=$({get:()=>l.value?.useCustomThresholds===!0,set:I=>{const c={...l.value,useCustomThresholds:I};I&&b.value&&(!c.thresholdLow&&w.profile?.thresholdLow!=null&&(c.thresholdLow=`${w.profile.thresholdLow}`),!c.thresholdMedium&&w.profile?.thresholdMedium!=null&&(c.thresholdMedium=`${w.profile.thresholdMedium}`),!c.thresholdHigh&&w.profile?.thresholdHigh!=null&&(c.thresholdHigh=`${w.profile.thresholdHigh}`)),l.value=c}}),t=$({get:()=>l.value?.thresholdDirection||"normal",set:I=>{l.value={...l.value,thresholdDirection:I}}}),C=(I,c)=>{l.value={...l.value,[I]:c}},N=I=>I==null||I===""?"—":`${I}`;return(I,c)=>(i(),x("div",zt,[a("div",Yt,[o(e(pe),{id:`stage-active-${p.stageName}`,modelValue:U.value,"onUpdate:modelValue":c[0]||(c[0]=k=>U.value=k),disabled:p.disabled},null,8,["id","modelValue","disabled"]),o(e(D),{for:`stage-active-${p.stageName}`,class:"text-base font-semibold cursor-pointer"},{default:r(()=>[m(h(p.stageName),1)]),_:1},8,["for"])]),U.value?(i(),x(O,{key:0},[o(qt,{profile:p.profile,title:"Monitoring profile",detailed:""},null,8,["profile"]),o(Ze,{images:p.referenceImages},null,8,["images"]),a("div",Qt,[a("div",Kt,[o(e(D),{class:"text-sm font-medium"},{default:r(()=>[...c[6]||(c[6]=[m("Catalog thresholds (used when scouting)",-1)])]),_:1}),b.value?(i(),x("div",Zt,[a("div",null,[a("span",Wt,h(t.value==="inverse"?"High":"Low"),1),a("p",Xt,[m(h(N(t.value==="inverse"?p.profile.thresholdHigh:p.profile.thresholdLow))+" ",1),a("span",ea,h(v.value),1)])]),a("div",null,[c[7]||(c[7]=a("span",{class:"text-xs text-muted-foreground"},"Medium",-1)),a("p",ta,[m(h(N(p.profile.thresholdMedium))+" ",1),a("span",aa,h(v.value),1)])]),a("div",null,[a("span",oa,h(t.value==="inverse"?"Low":"High"),1),a("p",sa,[m(h(N(t.value==="inverse"?p.profile.thresholdLow:p.profile.thresholdHigh))+" ",1),a("span",ra,h(v.value),1)])])])):(i(),x("p",Jt," No catalog thresholds are defined for this target. An admin can set them under Admin → Targets, or enable custom farm thresholds below. "))]),a("div",la,[o(e(pe),{id:`thresh-${p.stageName}`,modelValue:y.value,"onUpdate:modelValue":c[1]||(c[1]=k=>y.value=k),disabled:p.disabled},null,8,["id","modelValue","disabled"]),o(e(D),{for:`thresh-${p.stageName}`,class:"font-normal leading-snug cursor-pointer"},{default:r(()=>[...c[8]||(c[8]=[m(" Override with custom farm thresholds ",-1),a("span",{class:"block text-xs text-muted-foreground font-normal mt-0.5"}," Leave unchecked to use the catalog values above when recording scouting data. ",-1)])]),_:1},8,["for"])]),y.value||b.value?(i(),x("div",na,[o(e(D),{class:"text-sm font-medium"},{default:r(()=>[...c[9]||(c[9]=[m("Threshold direction",-1)])]),_:1}),a("div",ia,[o(e(D),{for:`inverse-${p.stageName}`,class:"font-normal cursor-pointer text-sm"},{default:r(()=>[...c[10]||(c[10]=[m("Inverse",-1)])]),_:1},8,["for"]),o(e(pe),{id:`inverse-${p.stageName}`,"model-value":t.value==="inverse","onUpdate:modelValue":c[2]||(c[2]=k=>t.value=k?"inverse":"normal"),disabled:p.disabled},null,8,["id","model-value","disabled"])])])):B("",!0),y.value?(i(),x("div",ua,[a("div",da,[o(e(D),null,{default:r(()=>[m("Farm "+h(t.value==="inverse"?"high":"low"),1)]),_:1}),o(e(he),{"model-value":l.value.thresholdLow,type:"number",step:"any",disabled:p.disabled,"onUpdate:modelValue":c[3]||(c[3]=k=>C("thresholdLow",k))},null,8,["model-value","disabled"])]),a("div",ca,[o(e(D),null,{default:r(()=>[...c[11]||(c[11]=[m("Farm medium",-1)])]),_:1}),o(e(he),{"model-value":l.value.thresholdMedium,type:"number",step:"any",disabled:p.disabled,"onUpdate:modelValue":c[4]||(c[4]=k=>C("thresholdMedium",k))},null,8,["model-value","disabled"])]),a("div",fa,[o(e(D),null,{default:r(()=>[m("Farm "+h(t.value==="inverse"?"low":"high"),1)]),_:1}),o(e(he),{"model-value":l.value.thresholdHigh,type:"number",step:"any",disabled:p.disabled,"onUpdate:modelValue":c[5]||(c[5]=k=>C("thresholdHigh",k))},null,8,["model-value","disabled"])])])):B("",!0)])],64)):B("",!0)]))}},ma={class:"min-h-0 flex-1 flex flex-col overflow-hidden"},ga={class:"px-6 pt-3 shrink-0"},pa={class:"flex items-center gap-2"},va={class:"flex items-center gap-2"},ha={key:0,class:"h-px flex-1 bg-border"},ya={class:"flex-1 overflow-y-auto px-6 py-4"},xa={key:0,class:"rounded-md border border-dashed bg-muted/30 p-4 text-sm text-muted-foreground mb-4"},ba={class:"space-y-2"},Sa={class:"space-y-3"},Ia={class:"flex items-center space-x-2"},_a={class:"flex items-center space-x-2"},$a={class:"space-y-2"},Ta={key:0,class:"text-sm text-muted-foreground"},wa={class:"truncate"},Ca={class:"grid gap-1 max-h-60 overflow-y-auto"},Na=["onClick"],ka={class:"space-y-2"},Ma={key:0,class:"text-xs text-muted-foreground"},Pa={key:1,class:"grid grid-cols-2 gap-4 mt-4"},Fa={class:"space-y-2"},Aa={class:"space-y-2"},Va={class:"pt-1"},La={key:0,class:"text-sm text-muted-foreground p-4 bg-muted rounded-md text-center"},Ea={class:"text-xs text-muted-foreground"},Oa={class:"space-x-2"},Ua={key:0},Da={key:1},Ra={__name:"MonitorEditorDialog",props:{open:Boolean,isNew:{type:Boolean,default:!0},farmId:{type:String,default:""},farmName:{type:String,default:""}},emits:["update:open"],setup(p,{emit:w}){const l=p,U=w,b=Te,v=$e(),y=E(0),t=E({targetType:"",isCropSpecific:!0,cropIds:[],targetId:"",labelName:"",priority:"Primary",targetDetail
1:null,stages:[]}),C=E(!1),N=E(!1),I=E([]),c=E([]),k=E([]),M=E([]),X=E(!1),z=$(()=>T(l.farmId)),G=$(()=>z.value.length>0),q=$(()=>v.hasCapability(W.SETTINGS_MONITORING_MANAGE)),R=()=>{F.error("You do not have permission to manage monitoring targets.")},Y=$(()=>{const g=[{key:"type",title:"Type",index:0},{key:"crops",title:"Crops",index:1},{key:"target",title:"Target",index:2},{key:"stages",title:"Stage",index:3}];return t.value.isCropSpecific?g:g.filter(s=>s.key!=="crops")}),ie=$(()=>{const g=Y.value.findIndex(s=>s.index===y.value);return g>=0?g+1:1}),ae=$({get:()=>t.value.isCropSpecific?"yes":"no",set:g=>{t.value.isCropSpecific=g==="yes",t.value.isCropSpecific||(t.value.cropIds=[],y.value===1&&(y.value=2))}}),T=g=>g==null?"":`${g}`,Q=$(()=>I.value.find(s=>T(s.id)===T(t.value.targetType))?.name||"selected type"),j=$(()=>t.value.targetId&&k.value.find(g=>T(g.id)===T(t.value.targetId))||null),S=$(()=>{if(!t.value.cropIds||t.value.cropIds.length===0)return"selected crops";const g=c.value.filter(s=>t.value.cropIds.map(T).includes(T(s.id)));return g.length>0?g.map(s=>s.name).join(", "):"selected crops"}),u=g=>{t.value.cropIds.includes(g)?t.value.cropIds=t.value.cropIds.filter(s=>s!==g):t.value.cropIds=[...t.value.cropIds,g],X.value=!1},f=(g,s)=>{const P=(g.cropIds||[]).map(T);return P.length===0?!1:s.some(d=>P.includes(d))},n=$(()=>{if(N.value)return"Loading available targets...";if(!t.value.targetType)return"Select a target type to load available targets.";if(M.value.length>0)return"";if(t.value.isCropSpecific){if(!t.value.cropIds||t.value.cropIds.length===0)return"Select at least one crop to load available targets.";const g=t.value.cropIds.map(T),s=k.value.filter(V=>T(V.plantProtectionTargetTypeId)!==T(t.value.targetType)?!1:f(V,g));if(s.length===0)return`No ${Q.value.toLowerCase()} targets are mapped to ${S.value}. Assign crops on the catalog target in Admin.`;const P=s.map(V=>V.name).filter(Boolean).slice(0,5),d=P.length?` Already on this farm: ${P.join(", ")}${s.length>P.length?`, +${s.length-P.length} more`:""}.`:"";return`All ${Q.value.toLowerCase()} targets for ${S.value} are already activated for this farm.${d} Edit or remove them from the monitoring list to change configuration.`}return`All non-crop-specific ${Q.value.toLowerCase()} targets are already activated for this farm. Edit or remove them from the monitoring list to change configuration.`}),_=$(()=>t.value.stages.length>1),A=$(()=>j.value?st(j.value,Q.value,j.value.name):null),H=g=>{const s=Ie(j.value,g,t.value.cropIds);return Re(g,s||(_.value?g:j.value),Q.value,j.value?.name)},He=g=>De({farmStage:g,catalogTarget:j.value,cropIds:t.value.cropIds,isCropSpecific:t.value.isCropSpecific===!0}),de=async()=>{if(!t.value.targetType){M.value=[],t.value.targetId="";return}const g=T(t.value.targetType),s=t.value.cropIds.map(T);if(t.value.isCropSpecific&&s.length===0){M.value=[],t.value.targetId="";return}const P=k.value.filter(d=>T(d.plantProtectionTargetTypeId)===g).filter(d=>t.value.isCropSpecific?f(d,s):d.isCropSpecific!==!0).filter(d=>{const V=T(d.id);return!b.monitors.some(ue=>{if(T(ue.plantProtectionTargetTypeId)!==g||T(ue.plantProtectionTargetId)!==V)return!1;if(t.value.isCropSpecific){const Ne=(ue.cropIds||[]).map(T);return ue.isCropSpecific&&s.every(ve=>Ne.includes(ve))&&Ne.every(ve=>s.includes(ve))}return!ue.isCropSpecific})});M.value=P,M.value.some(d=>T(d.id)===T(t.value.targetId))||(t.value.targetId="")},ce=async()=>{if(!v.currentScopeId||!G.value){I.value=[],c.value=[],k.value=[],M.value=[];return}N.value=!0;try{await b.fetchMonitors(void 0,{farmId:z.value});const[g,s]=await Promise.all([Ue(v.currentScopeId,{forceRefresh:!0,farmId:v.currentFarmId||void 0}),at(v.currentScopeId,{forceRefresh:!0,farmId:v.currentFarmId||void 0})]),P=g?.data,d=s?.data;I.value=P?.monitoringTargetTypes||[],k.value=P?.monitoringTargets||[],c.value=d?.crops||[],await de()}catch(g){F.error(le(g,"Failed to load monitoring lookups"))}finally{N.value=!1}},qe=async()=>{G.value&&(await b.fetchMonitors(void 0,{farmId:z.value}),await ce())},Ce=g=>y.value===g,ze=g=>{const s=Y.value.findIndex(P=>P.index===g);return s!==-1&&s<ie.value-1},Ye=()=>{if(y.value===0&&!t.value.targetType)return F.error("Select a target type to continue."),!1;if(y.value===1&&t.value.isCropSpecific&&(!t.value.cropIds||t.value.cropIds.length===0))return F.error("Select at least one crop to continue."),!1;if(y.value===2){if(!t.value.targetId)return F.error("Select a monitoring target to continue."),!1;const g=M.value.find(s=>
1T(s.id)===T(t.value.targetId));if(!g)return F.error("Selected target is no longer available. Refresh and choose again."),!1;t.value.targetDetail=g,t.value.stages=ot(j.value||g,t.value.cropIds,Q.value)}return!0},Qe=async()=>{if(!q.value){R();return}Ye()&&(y.value===0&&t.value.isCropSpecific?(await ce(),y.value=1):y.value===0&&!t.value.isCropSpecific?(y.value=2,await de()):y.value===1?(y.value=2,await de()):y.value++)},Ke=()=>{y.value===2&&!t.value.isCropSpecific?y.value=0:y.value--},Je=async()=>{if(!q.value){R();return}if(!v.currentScopeId)return;if(!G.value){F.error("Select a farm before creating monitoring targets.");return}const g=t.value.stages.filter(s=>s.selected);if(!g.length){F.error("Enable at least one stage to monitor before saving.");return}for(const s of g){const P=Ge(s);if(P){F.error(`${s.name}: ${P}`);return}}C.value=!0;try{const s={farmId:z.value,plantProtectionTargetTypeId:t.value.targetType,plantProtectionTargetId:t.value.targetId,isCropSpecific:t.value.isCropSpecific,cropIds:t.value.isCropSpecific?t.value.cropIds:[],labelName:t.value.labelName,priority:t.value.priority,stages:t.value.stages},P=await b.createMonitor(s);if(P?.stages?.length){const d=new Map(t.value.stages.map(V=>[ke(V.name),V]));await Promise.all(P.stages.map(V=>{const oe=d.get(ke(V.stageName));return oe?b.updateStage(V.id,_e(oe,Ie(j.value,oe,t.value.cropIds)||A.value),{refresh:!1}):Promise.resolve()})),await b.fetchMonitors(void 0,{farmId:z.value})}F.success("Monitoring target created"),U("update:open",!1)}catch(s){F.error(le(s,"Failed to create monitoring target"))}finally{C.value=!1}};return ne(()=>l.open,g=>{g&&(y.value=0,t.value={targetType:"",isCropSpecific:!0,cropIds:[],targetId:"",labelName:"",priority:"Primary",targetDetail:null,stages:[]},ce())}),ne(()=>l.farmId,(g,s)=>{l.open&&T(g)!==T(s)&&(y.value=0,t.value={targetType:"",isCropSpecific:!0,cropIds:[],targetId:"",labelName:"",priority:"Primary",targetDetail:null,stages:[]},ce())}),ne(()=>[t.value.targetType,t.value.cropIds,t.value.isCropSpecific],()=>{de()}),(g,s)=>{const P=we("can");return i(),L(e(Oe),{open:p.open,"onUpdate:open":s[7]||(s[7]=d=>g.$emit("update:open",d))},{default:r(()=>[o(e(Fe),{class:"sm:max-w-[640px] max-h-[90vh] overflow-hidden p-0 gap-0 grid-rows-[auto_minmax(0,1fr)_auto]"},{default:r(()=>[o(e(Ae),{class:"border-b px-6 py-4"},{default:r(()=>[o(e(Ve),null,{default:r(()=>[m(h(p.isNew?"Activate monitoring target":t.value.targetDetail?.name||"Monitoring Details"),1)]),_:1}),o(e(Le),null,{default:r(()=>[y.value===3?(i(),x(O,{key:0},[_.value?(i(),x(O,{key:0},[m(" Review the catalog profile and set farm thresholds for each monitoring stage. ")],64)):(i(),x(O,{key:1},[m(" Review the catalog scouting procedure and set optional farm thresholds. ")],64))],64)):(i(),x(O,{key:1},[m(" Choose the target type, crops, and catalog entry for this farm. ")],64))]),_:1})]),_:1}),a("div",ma,[a("div",ga,[a("div",pa,[(i(!0),x(O,null,te(Y.value,(d,V)=>(i(),x("div",{key:d.key,class:"contents"},[a("div",va,[a("div",{class:re(["h-8 w-8 rounded-full border text-xs font-semibold flex items-center justify-center transition-colors",[Ce(d.index)?"border-primary bg-primary text-primary-foreground":ze(d.index)?"border-emerald-600 bg-emerald-600 text-white":"border-muted-foreground/40 text-muted-foreground"]])},h(V+1),3),a("span",{class:re(["text-xs font-medium",Ce(d.index)?"text-foreground":"text-muted-foreground"])},h(d.title),3)]),V<Y.value.length-1?(i(),x("div",ha)):B("",!0)]))),128))])]),a("div",ya,[G.value?B("",!0):(i(),x("div",xa," Select a farm in Monitoring Settings to configure monitoring targets. ")),J(a("div",{class:re(["space-y-6",!G.value||!q.value?"pointer-events-none opacity-60":""])},[a("div",ba,[o(e(D),null,{default:r(()=>[...s[8]||(s[8]=[m("Target Type",-1)])]),_:1}),o(e(ye),{modelValue:t.value.targetType,"onUpdate:modelValue":s[0]||(s[0]=d=>t.value.targetType=d)},{default:r(()=>[o(e(xe),null,{default:r(()=>[o(e(be),{placeholder:N.value?"Loading types...":"Select type..."},null,8,["placeholder"])]),_:1}),o(e(Se),null,{default:r(()=>[(i(!0),x(O,null,te(I.value,d=>(i(),L(e(fe),{key:d.id,value:d.id},{default:r(()=>[m(h(d.name),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"])]),a("div",Sa,[o(e(D),null,{default:r(()=>
1[...s[9]||(s[9]=[m("Is this target bound to a specific crop?",-1)])]),_:1}),o(e(bt),{modelValue:ae.value,"onUpdate:modelValue":s[1]||(s[1]=d=>ae.value=d)},{default:r(()=>[a("div",Ia,[o(e(Pe),{id:"crop-yes",value:"yes"}),o(e(D),{for:"crop-yes",class:"cursor-pointer font-normal"},{default:r(()=>[...s[10]||(s[10]=[m("Yes",-1)])]),_:1})]),a("div",_a,[o(e(Pe),{id:"crop-no",value:"no"}),o(e(D),{for:"crop-no",class:"cursor-pointer font-normal"},{default:r(()=>[...s[11]||(s[11]=[m("No",-1)])]),_:1})])]),_:1},8,["modelValue"])])],2),[[ge,y.value===0]]),J(a("div",{class:re(["space-y-4",!G.value||!q.value?"pointer-events-none opacity-60":""])},[a("div",$a,[o(e(D),null,{default:r(()=>[...s[12]||(s[12]=[m("Select Crops",-1)])]),_:1}),N.value?(i(),x("div",Ta,"Loading crops...")):(i(),L(e(Xe),{key:1,open:X.value,"onUpdate:open":s[2]||(s[2]=d=>X.value=d)},{default:r(()=>[o(e(et),{"as-child":""},{default:r(()=>[o(e(Z),{variant:"outline",role:"combobox",class:"w-full justify-between font-normal"},{default:r(()=>[a("span",wa,h(t.value.cropIds.length>0?S.value:"Select crops..."),1),o(e(St),{class:"ml-2 h-4 w-4 shrink-0 opacity-50"})]),_:1})]),_:1}),o(e(tt),{class:"w-[--reka-popover-trigger-width] p-2",align:"start"},{default:r(()=>[a("div",Ca,[(i(!0),x(O,null,te(c.value,d=>(i(),x("div",{key:d.id,class:"flex items-center space-x-3 rounded-md px-2 py-1.5 hover:bg-accent cursor-pointer",onClick:V=>u(d.id)},[o(e(pe),{id:"crop-"+d.id,modelValue:t.value.cropIds.includes(d.id),"onUpdate:modelValue":()=>u(d.id),class:"pointer-events-none"},null,8,["id","modelValue","onUpdate:modelValue"]),o(e(D),{for:"crop-"+d.id,class:"font-normal cursor-pointer flex-1"},{default:r(()=>[m(h(d.name),1)]),_:2},1032,["for"])],8,Na))),128))])]),_:1})]),_:1},8,["open"]))])],2),[[ge,y.value===1]]),J(a("div",{class:re(["space-y-4",!G.value||!q.value?"pointer-events-none opacity-60":""])},[a("div",ka,[o(e(D),null,{default:r(()=>[...s[13]||(s[13]=[m("Select Target",-1)])]),_:1}),o(e(ye),{modelValue:t.value.targetId,"onUpdate:modelValue":s[3]||(s[3]=d=>t.value.targetId=d)},{default:r(()=>[o(e(xe),null,{default:r(()=>[o(e(be),{placeholder:N.value?"Loading targets...":"Select target..."},null,8,["placeholder"])]),_:1}),o(e(Se),null,{default:r(()=>[(i(!0),x(O,null,te(M.value,d=>(i(),L(e(fe),{key:d.id,value:d.id},{default:r(()=>[m(h(d.name),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["modelValue"]),n.value?(i(),x("p",Ma,h(n.value),1)):B("",!0),t.value.targetId?(i(),x("div",Pa,[a("div",Fa,[o(e(D),null,{default:r(()=>[...s[14]||(s[14]=[m("Label Name (Optional)",-1)])]),_:1}),J(a("input",{class:"flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
1ing-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",placeholder:"Custom label...","onUpdate:modelValue":s[4]||(s[4]=d=>t.value.labelName=d)},null,512),[[yt,t.value.labelName]])]),a("div",Aa,[o(e(D),null,{default:r(()=>[...s[15]||(s[15]=[m("Priority",-1)])]),_:1}),o(e(ye),{modelValue:t.value.priority,"onUpdate:modelValue":s[5]||(s[5]=d=>t.value.priority=d)},{default:r(()=>[o(e(xe),null,{default:r(()=>[o(e(be),{placeholder:"Select priority..."})]),_:1}),o(e(Se),null,{default:r(()=>[o(e(fe),{value:"Primary"},{default:r(()=>[...s[16]||(s[16]=[m("Primary",-1)])]),_:1}),o(e(fe),{value:"Secondary"},{default:r(()=>[...s[17]||(s[17]=[m("Secondary",-1)])]),_:1})]),_:1})]),_:1},8,["modelValue"])])])):B("",!0),s[18]||(s[18]=a("p",{class:"text-xs text-muted-foreground pt-2"},"Targets already configured for this scope are hidden to prevent duplicates.",-1)),a("div",Va,[o(e(Z),{type:"button",variant:"ghost",size:"sm",class:"h-7 px-2 text-xs",disabled:N.value,onClick:qe},{default:r(()=>[m(h(N.value?"Refreshing...":"Refresh target list"),1)]),_:1},8,["disabled"])])])],2),[[ge,y.value===2]]),J(a("div",{class:re(["space-y-4",!G.value||!q.value?"pointer-events-none opacity-60":""])},[j.value?(i(),x(O,{key:1},[a("p",Ea,[_.value?(i(),x(O,{key:0},[m(" Stages come from the admin catalog for this target (not Eggs / Larvae / Adults). Choose which stages to scout and set optional farm thresholds. ")],64)):(i(),x(O,{key:1},[m(" Stage details come from the admin catalog profile for the selected "+h(Q.value.toLowerCase())+" (and crop mapping when applicable). Set optional farm thresholds below. ",1)],64))]),(i(!0),x(O,null,te(t.value.stages,(d,V)=>(i(),L(Be,{key:d.id||V,modelValue:t.value.stages[V],"onUpdate:modelValue":oe=>t.value.stages[V]=oe,"stage-name":d.name,profile:H(d),"reference-images":He(d),disabled:C.value},null,8,["modelValue","onUpdate:modelValue","stage-name","profile","reference-images","disabled"]))),128))],64)):(i(),x("p",La," Select a target in the previous step to choose stages. "))],2),[[ge,y.value===3]])])]),o(e(Ee),{class:"flex sm:justify-between items-center border-t px-6 py-4"},{default:r(()=>[o(e(Z),{variant:"outline",disabled:y.value===0,onClick:Ke},{default:r(()=>[...s[19]||(s[19]=[m("Back",-1)])]),_:1},8,["disabled"]),a("div",Oa,[o(e(Z),{variant:"ghost",onClick:s[6]||(s[6]=d=>g.$emit("update:open",!1))},{default:r(()=>[...s[20]||(s[20]=[m("Cancel",-1)])]),_:1}),y.value<3?J((i(),L(e(Z),{key:0,disabled:!G.value,onClick:Qe},{default:r(()=>[...s[21]||(s[21]=[m("Next",-1)])]),_:1},8,["disabled"])),[[P,e(W).SETTINGS_MONITORING_MANAGE]]):J((i(),L(e(Z),{key:1,disabled:!G.value||C.value||!t.value.stages.some(d=>d.selected),onClick:Je},{default:r(()=>[C.value?(i(),x("span",Ua,"Saving...")):(i(),x("span",Da,"Save configuration"))]),_:1},8,["disabled"])),[[P,e(W).SETTINGS_MONITORING_MANAGE]])])]),_:1})]),_:1})]),_:1},8,["open"])}}},Ga={key:0,class:"min-h-0 space-y-4 overflow-y-auto px-6 py-4"},ja={key:0,class:"rounded-md border border-dashed bg-muted/30 px-4 py-6 text-center text-sm text-muted-foreground"},Ba={__name:"StageEditorDialog",props:{open:Boolean,monitor:{type:Object,default:null},stage:{type:Object,default:null}},emits:["update:open"],setup(p,{emit:w}){const l=p,U=w,b=Te,v=$e(),y=E(!1),t=E(!1),C=E({}),N=E(null),I=$(()=>v.hasCapability(W.SETTINGS_MONITORING_MANAGE)),c=f=>`${f?.id||f?.Id||""}`,k=$(()=>M.value.length>1),M=$(()=>je(l.monitor)),X=$(()=>l.monitor?.stages||[]),z=$(()=>l.monitor?.labelName||l.monitor?.plantProtectionTargetName||"Monitoring target"),G=$(()=>(l.monitor?.plantProtectionTargetTypeName||"target").toLowerCase()),q=$(()=>N.value||l.monitor),R=f=>Ie(q.value,f,l.monitor?.cropIds||[])||(k.value?f:q.value),Y=f=>Re(f,R(f),l.monitor?.plantProtectionTargetTypeName,l.monitor?.plantProtectionTargetName||N.value?.name),ie=$(()=>{const f=l.monitor;return f?{images:f.referenceImages||f.ReferenceImages||f.images||[],referenceImages:f.referenceImages||f.ReferenceImages||[],cropProfiles:[{stages:(f.stages||[]).map(n=>({stageName:n.stageName||n.name,images:n.images||n.Images||[]}))}]}:null}),ae=f=>De({farmStage:f,catalogTarget:N.value||ie.value,cropIds:l.monitor?.cropIds||[]}),T=f=>rt(f,l.monitor,N.value),Q=f=>{const n=c(f);return n?(C.value[n]||(C.value={...C.value,[n]:me(f,R(f))}),C.value[n]):null},j=()=>{const f={};for(const n of M.value){const _=c(n);_&&(f[_]=me(n,R(n)))}C.value=f},S=async()=>
1{if(!l.monitor?.plantProtectionTargetId||!v.currentScopeId){N.value=null;return}try{const{data:f}=await Ue(v.currentScopeId,{farmId:v.currentFarmId||l.monitor?.farmId||void 0,forceRefresh:!0}),n=f?.monitoringTargets||f?.MonitoringTargets||[],_=`${l.monitor.plantProtectionTargetId}`,A=`${l.monitor.plantProtectionTargetName||l.monitor.labelName||""}`.trim().toLowerCase();N.value=n.find(H=>`${H.id||H.Id}`===_)||n.find(H=>`${H.name||H.Name||""}`.trim().toLowerCase()===A)||null}catch{N.value=null}};ne(()=>[l.open,l.monitor?.id],async([f])=>{if(!f||!l.monitor){f||(N.value=null,C.value={});return}j(),t.value=!0;try{await S(),j()}finally{t.value=!1}},{immediate:!0}),ne(M,f=>{if(!l.open||!f.length)return;const n={...C.value};let _=!1;for(const A of f){const H=c(A);!H||n[H]||(n[H]=me(A,R(A)),_=!0)}_&&(C.value=n)},{immediate:!0,deep:!0});const u=async()=>{if(!I.value){F.error("You do not have permission to manage monitoring targets.");return}for(const n of M.value)Q(n);if(!M.value.filter(n=>C.value[c(n)]?.isSelected).length){F.error("Enable at least one stage to monitor.");return}for(const n of M.value){const _=Ge(C.value[c(n)]);if(_){F.error(`${T(n)}: ${_}`);return}}y.value=!0;try{const n=new Set(M.value.map(_=>c(_)));for(const _ of M.value)await b.updateStage(c(_),_e(C.value[c(_)],R(_)),{refresh:!1});for(const _ of X.value.filter(A=>!n.has(c(A))))await b.updateStage(c(_),_e({...me(_,R(_)),isSelected:!1},R(_)),{refresh:!1});await b.fetchMonitors(void 0,{farmId:l.monitor.farmId}),F.success("Monitoring configuration saved."),U("update:open",!1)}catch(n){const _=le(n,"Failed to save configuration.");F.error(_)}finally{y.value=!1}};return(f,n)=>{const _=we("can");return i(),L(e(Oe),{open:p.open,"onUpdate:open":n[1]||(n[1]=A=>f.$emit("update:open",A))},{default:r(()=>[o(e(Fe),{class:"sm:max-w-[640px] max-h-[90vh] overflow-hidden p-0 gap-0 grid-rows-[auto_minmax(0,1fr)_auto]"},{default:r(()=>[o(e(Ae),{class:"border-b px-6 py-4"},{default:r(()=>[o(e(Ve),null,{default:r(()=>[...n[2]||(n[2]=[m("Stage",-1)])]),_:1}),o(e(Le),null,{default:r(()=>[k.value?(i(),x(O,{key:0},[m(h(z.value)+" — review the admin catalog stages and set farm thresholds for each one. ",1)],64)):(i(),x(O,{key:1},[m(h(z.value)+" — review the catalog "+h(G.value)+" profile, scouting procedure, and optional farm thresholds. ",1)],64))]),_:1})]),_:1}),p.monitor?(i(),x("div",Ga,[M.value.length?B("",!0):(i(),x("p",ja," No scouting stage is configured for this target yet. Re-activate it from Monitoring setup, or ask an admin to add catalog stages under Admin → Targets. ")),(i(!0),x(O,null,te(M.value,A=>(i(),x(O,{key:c(A)},[C.value[c(A)]?(i(),L(Be,{key:0,modelValue:C.value[c(A)],"onUpdate:modelValue":H=>C.value[c(A)]=H,"stage-name":T(A),profile:Y(A),"reference-images":ae(A),disabled:!I.value||y.value},null,8,["modelValue","onUpdate:modelValue","stage-name","profile","reference-images","disabled"])):B("",!0)],64))),128))])):B("",!0),o(e(Ee),{class:"border-t px-6 py-4"},{default:r(()=>[o(e(Z),{variant:"outline",onClick:n[0]||(n[0]=A=>f.$emit("update:open",!1))},{default:r(()=>[...n[3]||(n[3]=[m("Cancel",-1)])]),_:1}),J((i(),L(e(Z),{disabled:y.value||!p.monitor||!M.value.length,onClick:u},{default:r(()=>[...n[4]||(n[4]=[m(" Save configuration ",-1)])]),_:1},8,["disabled"])),[[_,e(W).SETTINGS_MONITORING_MANAGE]])]),_:1})]),_:1})]),_:1},8,["open"])}}},Ha={class:"space-y-6"},qa={class:"bg-card rounded-xl border p-4 lg:p-6 shadow-sm flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between"},za={class:"min-w-0"},Ya={class:"mt-1 text-sm text-muted-foreground"},Qa={key:0,class:"text-sm text-destructive"},Ka={class:"bg-card rounded-xl border p-4 lg:p-6 shadow-sm space-y-4"},Ja={class:"border rounded-xl overflow-x-auto"},Za={class:"flex items-center justify-end gap-1"},io={__name:"MonitoringSettings",setup(p){const w=Te,l=$e(),U=E(""),b=$(()=>w.selectedFarmId?`${w.selectedFarmId}`:""),v=$(()=>l.currentFarm?.name?l.currentFarm.name:w.farms.find(u=>`${u.id}`===b.value)?.name||l.currentTenant?.name||""),y=$(()=>l.hasCapability(W.SETTINGS_MONITORING_MANAGE)),t=$(()=>y.value&&!!l.currentScopeId&&!!b.value),C=E(!1),N=E(!1),I=E(null),c=E(null),k=E(""),M=S=>je(S)[0]||null,X=S=>ct(S),z=S=>{if(!S.isCropSpecific)return"All crops";const u=S.cropNames||S.cropName;return Array.isArray(u)&&u.length?u.join(", "):typeof u=="string"&&u?u:"Crop specific"},G=S=>{const u=M(S);return u&&[u.monitoringProcedure,u.observationType,u.observationFrequency].filter(
1Boolean).join(" · ")||"—"},q=$(()=>{const S=k.value.trim().toLowerCase(),u=w.monitors||[];return S?u.filter(f=>[f.plantProtectionTargetName,f.plantProtectionTargetTypeName,z(f),f.isCropSpecific?null:"Non-crop specific",G(f)].filter(Boolean).join(" ").toLowerCase().includes(S)):u}),R=async()=>{if(!l.currentScopeId){w.monitors=[],U.value="";return}U.value="";try{const S=await w.ensureFarmContext(l.currentScopeId,l.currentFarmId||null,{allowFallback:!1});if(!S){w.monitors=[];return}await w.fetchMonitors(l.currentScopeId,{farmId:S,allowFallback:!1})}catch(S){U.value=le(S,"Failed to load monitoring targets.")}};xt(()=>R()),ne(()=>[l.currentScopeId,l.currentFarmId],()=>{R()});const Y=()=>{F.error("You do not have permission to manage monitoring targets.")},ie=()=>{if(!y.value){Y();return}b.value&&(C.value=!0)},ae=S=>{if(!y.value){Y();return}const u=M(S);if(!u){F.error("No scouting stage is configured for this target.");return}I.value=S,c.value=u,N.value=!0},T=async S=>{N.value=S,S||(I.value=null,c.value=null,await R())},Q=async(S,u)=>{if(!y.value){Y();return}const f=ut(S,u);if(!f.length){F.error("No scouting stage is configured for this target.");return}try{for(const n of f)await w.updateStage(n.id,dt(n,S,{isSelected:u}),{refresh:!1});F.success(u?"Target activated for scouting":"Target deactivated"),await R()}catch(n){F.error(le(n,"Failed to update activation"))}},j=async S=>{if(!y.value){Y();return}if(await ft({title:"Remove monitoring target?",message:"Remove this target from the farm? You can activate it again later from the catalog.",confirmText:"Remove",isDestructive:!0})){U.value="";try{await w.deleteMonitor(S),F.success("Monitoring target removed from farm"),await R()}catch(u){U.value=le(u,"Failed to remove monitoring target.")}}};return(S,u)=>{const f=we("can");return i(),x("div",Ha,[a("div",qa,[a("div",za,[u[2]||(u[2]=a("h3",{class:"text-base font-semibold"},"Monitoring Targets",-1)),a("p",Ya," Activate platform-defined targets for "+h(v.value||"the selected farm")+". Procedure, reference images, and default thresholds are set by your administrator. ",1)]),J((i(),L(e(Z),{class:"gap-2 shrink-0",disabled:!t.value,onClick:ie},{default:r(()=>[o(e(It),{class:"h-4 w-4"}),u[3]||(u[3]=m(" Add target ",-1))]),_:1},8,["disabled"])),[[f,e(W).SETTINGS_MONITORING_MANAGE]])]),U.value?(i(),x("p",Qa,h(U.value),1)):B("",!0),a("div",Ka,[o(gt,{modelValue:k.value,"onUpdate:modelValue":u[0]||(u[0]=n=>k.value=n),placeholder:"Search targets…",disabled:!b.value||e(w).isLoading},null,8,["modelValue","disabled"]),a("div",Ja,[o(e(lt),null,{default:r(()=>[o(e(nt),null,{default:r(()=>[o(e(ee),null,{default:r(()=>[o(e(se),null,{default:r(()=>[...u[4]||(u[4]=[m("Target",-1)])]),_:1}),o(e(se),null,{default:r(()=>[...u[5]||(u[5]=[m("Type",-1)])]),_:1}),o(e(se),null,{default:r(()=>[...u[6]||(u[6]=[m("Crop scope",-1)])]),_:1}),o(e(se),null,{default:r(()=>[...u[7]||(u[7]=[m("Scouting profile",-1)])]),_:1}),o(e(se),null,{default:r(()=>[...u[8]||(u[8]=[m("Status",-1)])]),_:1}),o(e(se),{class:"text-right"},{default:r(()=>[...u[9]||(u[9]=[m("Actions",-1)])]),_:1})]),_:1})]),_:1}),o(e(it),null,{default:r(()=>[e(l).currentScopeId?e(w).isLoading?(i(),L(e(ee),{key:1},{default:r(()=>[o(e(K),{colspan:"6",class:"py-10 text-center text-sm text-muted-foreground"},{default:r(()=>[...u[11]||(u[11]=[m(" Loading monitoring targets... ",-1)])]),_:1})]),_:1})):b.value?e(w).monitors.length?q.value.length?B("",!0):(i(),L(e(ee),{key:4},{default:r(()=>[o(e(K),{colspan:"6",class:"py-10 text-center text-sm text-muted-foreground"},{default:r(()=>[m(' No matches found for "'+h(k.value)+'" ',1)]),_:1})]),_:1})):(i(),L(e(ee),{key:3},{default:r(()=>[o(e(K),{colspan:"6",class:"py-10 text-center text-sm text-muted-foreground"},{default:r(()=>[m(" No targets activated yet for "+h(v.value||"this farm")+". Use Activate target to add catalog targets for scouting. ",1)]),_:1})]),_:1})):(i(),L(e(ee),{key:2},{default:r(()=>[o(e(K),{colspan:"6",class:"py-10 text-center text-sm text-muted-foreground"},{default:r(()=>[...u[12]||(u[12]=[m(" No farms configured for this workspace yet. ",-1)])]),_:1})]),_:1})):(i(),L(e(ee),{key:0},{default:r(()=>[o(e(K),{colspan:"6",class:"py-10 text-center text-sm text-muted-foreground"},{default:r(()=>[...u[10]||(u[10]=[m(" Select a farm or workspace in the header. ",-1)])]),_:1})]),_:1})),(i(!0),x(O,null,te(q.value,n=>(i(),L(e(ee),{key:n.id},{default:r(()=>[o(e(K),{class:"font-medium"},{default:r(()=>[m(h(n.plantProtectionTargetName),1)]),_:2},1024),o(e(K),null,{default:r(()=>[m(h(n.plantProtectionTargetTypeName),1)]),_:2},1024),o(e(K),null,{default:r(()=>[n.isCropSpecific?(i(),L(e(Me),{key:0,variant:"outline"},{default:r(()=>[m(h(z(n)),1)]),_:2},1024)):(i(),L(e(Me),{key:1,variant:"secondary"},{default:r(()=>[...u[13]||(u[13]=[m("Non-crop specific",-1)])]),_:1}))]),_:2},1024),o(e(K),{class:"max-w-xs text-xs text-muted-foreground"},{default:r(()=>[m(h(G(n)),1)]),_:2},1024),o(e(K),null,{default:r(()=>[o(pt,{"model-value":X(n),disabled:!y.value,"aria-label":`${n.plantProtectionTargetName} active status`,"onUpdate:modelValue":_=>Q(n,_)},null,8,["model-value","disabled","aria-label","onUpdate:modelValue"])]),_:2},1024),o(e(K),{class:"text-right"},{default:r(()=>[a("div",Za,[J((i(),L(e(Z),{variant:"ghost",size:"icon",onClick:_=>ae(n)},{default:r(()=>[o(e(_t),{class:"h-4 w-4"})]),_:1},8,["onClick"])),[[f,e(W).SETTINGS_MONITORING_MANAGE]]),J(o(mt,{title:`Remove ${n.plantProtectionTargetName}`,onClick:_=>j(n.id)},null,8,["title","onClick"]),[[f,e(W).SETTINGS_MONITORING_MANAGE]])])]),_:2},1024)]),_:2},1024))),128))]),_:1})]),_:1})])]),o(Ra,{open:C.value,"farm-id":b.value,"farm-name":v.value,"onUpdate:open":u[1]||(u[1]=n=>C.value=n)},null,8,["open","farm-id","farm-name"]),o(Ba,{open:N.value,monitor:I.value,stage:c.value,"onUpdate:open":T},null,8,["open","monitor","stage"])])}}};export{io as default};

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.