PageSourceSearch

https://fieldagent-radar.netlify.app/_next/static/chunks/app/(public)/demo/page-b0825e2a87b59287.js

js fieldagent-radar.netlify.app collected 2026-10-03 10:44:23 UTC 23,124 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[462],{8374:function(e,t,s){Promise.resolve().then(s.bind(s,5578))},5578:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return f}});var n=s(7437),l=s(2265),a=s(3422),r=s(1837);function i(e){let{message:t}=e,s="user"===t.role;return(0,n.jsx)("div",{className:"flex ".concat(s?"justify-end":"justify-start"," mb-2.5"),children:(0,n.jsx)("div",{className:"max-w-[85%] px-4 py-2.5 text-[14px] leading-relaxed ".concat(s?"bg-[#3b82f6] text-white rounded-2xl rounded-br-sm":"bg-[#E5E2D8] text-[#2C2C28] rounded-2xl rounded-bl-sm"),children:t.content})})}let c="M6.62 10.79c1.44 2.83 3.76 5.15 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z";function d(){let e=(0,l.useRef)(null),[t,s]=(0,l.useState)("disconnected"),[r,i]=(0,l.useState)(!1),[d,x]=(0,l.useState)(null),[o,m]=(0,l.useState)(0),h=(0,l.useRef)([]),u=(0,l.useRef)(0),p="agent_9001knd7hgezfbma0erhwjzsy9qz";(0,l.useEffect)(()=>()=>{var t;null===(t=e.current)||void 0===t||t.endSession().catch(()=>{}),e.current=null},[]),(0,l.useEffect)(()=>{if("connected"!==t){m(0);return}let e=setInterval(()=>m(e=>e+1),1e3);return()=>clearInterval(e)},[t]),(0,l.useEffect)(()=>{if("connected"!==t||!e.current)return;let s=e.current,n=()=>{let e=Math.max(s.getInputVolume(),s.getOutputVolume());h.current.forEach((t,s)=>{if(!t)return;let n=.3*Math.sin(Date.now()/200+.8*s);t.style.height="".concat(Math.max(15,Math.min(90,100*e+40*n)),"%")}),u.current=requestAnimationFrame(n)};return u.current=requestAnimationFrame(n),()=>cancelAnimationFrame(u.current)},[t]);let f=async()=>{if(!p){x("Agent not configured");return}x(null);try{let t=await a.ri.startSession({agentId:p,connectionType:"websocket",onConnect:e=>{let{conversationId:t}=e;console.log("[FieldAgent] Voice connected:",t)},onDisconnect:t=>{if(console.log("[FieldAgent] Voice disconnected:",t),e.current=null,"error"===t.reason){var s;x(null!==(s=t.message)&&void 0!==s?s:"Connection lost")}},onError:(e,t)=>{console.error("[FieldAgent] Voice error:",e,t),x(e)},onStatusChange:e=>{let{status:t}=e;return s(t)},onModeChange:e=>{let{mode:t}=e;return i("speaking"===t)}});e.current=t}catch(t){console.error("[FieldAgent] startSession failed:",t),s("disconnected");let e=t instanceof Error?t.message:String(t);e.includes("Permission")||e.includes("NotAllowed")?x("Microphone access denied"):e.includes("401")?x("Agent auth error — set to public in ElevenLabs"):e.includes("404")?x("Agent not found — check agent ID"):x(e)}},g=async()=>{try{var t;await (null===(t=e.current)||void 0===t?void 0:t.endSession())}catch(e){}e.current=null};return"disconnected"===t?(0,n.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center px-6",children:[(0,n.jsx)("div",{className:"w-16 h-16 rounded-full bg-[#2D4A3E]/20 flex items-center justify-center mb-3",children:(0,n.jsx)("span",{className:"text-[18px] text-[#5B7C6B] font-bold",children:"CA"})}),(0,n.jsx)("p",{className:"text-white text-[16px] font-medium",children:"FieldAgent"}),(0,n.jsx)("p",{className:"text-white/35 text-[12px] mt-0.5",children:"AI Farming Agent"}),(0,n.jsx)("button",{onClick:f,className:"mt-8 w-14 h-14 rounded-full bg-[#22c55e] flex items-center justify-center shadow-lg shadow-green-500/25 hover:bg-[#16a34a] transition-colors",children:(0,n.jsx)("svg",{className:"w-6 h-6 text-white",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:c})})}),(0,n.jsx)("p",{className:"text-white/25 text-[11px] mt-3",children:"Tap to call"}),d&&(0,n.jsx)("p",{className:"text-red-400 text-[11px] mt-2 text-center max-w-[200px]",children:d})]}):"connecting"===t?(0,n.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center px-6",children:[(0,n.jsx)("div",{className:"w-16 h-16 rounded-full bg-[#2D4A3E]/20 flex items-center justify-center mb-3",children:(0,n.jsx)("span",{className:"text-[18px] text-[#5B7C6B] font-bold",children:"CA"})}),(0,n.jsx)("p",{className:"text-white text-[16px] font-medium",children:"FieldAgent"}),(0,n.jsx)("p",{className:"text-white/30 text-[11px] mt-0.5",children:"Connecting..."}
1),(0,n.jsx)("div",{className:"mt-8 w-14 h-14 rounded-full bg-[#22c55e]/50 flex items-center justify-center",children:(0,n.jsx)("div",{className:"w-5 h-5 border-2 border-white/60 border-t-transparent rounded-full animate-spin"})}),(0,n.jsx)("p",{className:"text-white/25 text-[11px] mt-3",children:"Requesting microphone..."})]}):"connected"===t?(0,n.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center px-6",children:[(0,n.jsx)("div",{className:"w-14 h-14 rounded-full bg-[#2D4A3E]/20 flex items-center justify-center mb-2",children:(0,n.jsx)("span",{className:"text-[16px] text-[#5B7C6B] font-bold",children:"CA"})}),(0,n.jsx)("p",{className:"text-white text-[15px] font-medium",children:"FieldAgent"}),(0,n.jsx)("p",{className:"text-white/30 text-[11px] mt-0.5",children:r?"Agent is speaking...":"Listening..."}),(0,n.jsx)("p",{className:"text-white/60 text-[28px] font-mono mt-5 tabular-nums",children:"".concat(String(Math.floor(o/60)).padStart(2,"0"),":").concat(String(o%60).padStart(2,"0"))}),(0,n.jsx)("div",{className:"flex items-end justify-center gap-[3px] h-10 mt-4",children:Array.from({length:8}).map((e,t)=>(0,n.jsx)("div",{ref:e=>{h.current[t]=e},className:"w-[3px] bg-[#5B7C6B] rounded-full transition-[height] duration-75",style:{height:"15%"}},t))}),(0,n.jsx)("button",{onClick:g,className:"mt-8 w-14 h-14 rounded-full bg-red-500 flex items-center justify-center shadow-lg shadow-red-500/25 hover:bg-red-600 transition-colors",children:(0,n.jsx)("svg",{className:"w-6 h-6 text-white rotate-[135deg]",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.jsx)("path",{d:c})})}),(0,n.jsx)("p",{className:"text-white/25 text-[11px] mt-3",children:"End call"})]}):(0,n.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center px-6",children:[(0,n.jsx)("div",{className:"w-14 h-14 rounded-full bg-[#2D4A3E]/20 flex items-center justify-center mb-2",children:(0,n.jsx)("span",{className:"text-[16px] text-[#5B7C6B] font-bold",children:"CA"})}),(0,n.jsx)("p",{className:"text-white text-[15px] font-medium",children:"FieldAgent"}),(0,n.jsx)("p",{className:"text-white/30 text-[11px] mt-0.5",children:"Ending call..."}),(0,n.jsx)("div",{className:"mt-8 w-14 h-14 rounded-full bg-red-500/50 flex items-center justify-center",children:(0,n.jsx)("div",{className:"w-5 h-5 border-2 border-white/60 border-t-transparent rounded-full animate-spin"})})]})}function x(e){let{onResponse:t,useMock:a=!1}=e,[c,x]=(0,l.useState)("text"),[o,m]=(0,l.useState)([{id:"seed-1",role:"user",content:"How's my cotton field looking?"}]),[h,u]=(0,l.useState)(""),[p,f]=(0,l.useState)(!1),[g,j]=(0,l.useState)(""),[b,N]=(0,l.useState)(!1),v=(0,l.useRef)(null);(0,l.useEffect)(()=>{let e=v.current;e&&(e.scrollTop=e.scrollHeight)},[o,g,p]);let w=(0,l.useCallback)(e=>new Promise(t=>{N(!0);let s=0,n=setInterval(()=>{s++,j(e.slice(0,s)),s>=e.length&&(clearInterval(n),N(!1),j(""),m(t=>[...t,{id:"agent-".concat(Date.now()),role:"agent",content:e}]),t())},30)}),[]),y=async()=>{let e=h.trim();if(e&&!p&&!b){if(u(""),m(t=>[...t,{id:"user-".concat(Date.now()),role:"user",content:e}]),f(!0),a){let{showcaseResponse:e}=await Promise.resolve().then(s.bind(s,39));await new Promise(e=>setTimeout(e,2e3)),f(!1),null==t||t(e),await w(e.response);return}try{let{session_id:s}=await r.h.startHealthCheck({message:e}),n=null;for(let e=0;e<30;e++){await new Promise(e=>setTimeout(e,2e3));let e=await r.h.getHealthCheckStatus(s);if("completed"===e.status&&e.result){n=e.result;break}if("failed"===e.status)throw Error(e.error)}if(f(!1),n){let e={session_id:s,response:n.response,recommendations:n.recommendation?[n.recommendation]:[],trace:[]};null==t||t(e),await w(n.response)}}catch(e){f(!1),m(e=>[...e,{id:"err-".concat(Date.now()),role:"agent",content:"Sorry, something went wrong."}])}}};return(0,n.jsx)("div",{className:"w-[320px] mx-auto",children:(0,n.jsxs)("div",{className:"bg-[#0a0a0a] rounded-[40px] border-[6px] border-[#1a1a1a] overflow-hidden shadow-2xl shadow-black/40",children:[(0,n.jsx)("div",{className:"flex justify-center pt-2",children:(0,n.jsx)("div",{className:"w-[90px] h-[24px] bg-[#1a1a1a] rounded-full"})}),(0,n.jsxs)("div",{className:"flex items-center justify-between px-7 pt-1 pb-2",children:[(0,n.jsx)("span",{className:"text-[12px] text-white/50 font-semibold",children:"9:41"}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("div",{className:"flex gap-[2px] items-end",children:[4,6,8,10].map((e,t)=>(0,n.jsx)("div",{className:"w-[3px] rounded-sm bg-white/".concat(t<3?"50":"20"),style:{height:"".concat(e,"px")}},t))}),(0,n.jsxs)("svg",{className:"w-4 h-4 text-white/50",viewBox:"0 0 16 16",fill:"currentColor",children:[(0,n.jsx)("rect",{x:"1",y:"5",width:"10",height:"6",rx:"1",opacity:"0.5"}),(0,n.jsx)("rect",{x:"11.5",y:"6.5",width:"2",height:"3",rx:"0.5",opacity:"0.5"})]})]})]}),(0,n.jsx)("div",{className:"flex mx-4 mb-1 bg-white/5 rounded-lg p-0.5",children:["text","call"].map(e=>(0,n.jsx)("button",{onClick:()=>x(e),className:"flex-1 py-1.5 text-[13px] font-medium rounded-md transition-all duration-200 ".concat(c===e?"bg-white/10 text-white":"text-white/35 hover:text-white/50"),children:"text"===e?"Text":"Call"},e))}),(0,n.jsx)("div",{className:"h-[380px] flex flex-col",children:"text"===c?(0,n.jsxs)("div",{className:"tab-fade-enter flex-1 flex flex-col",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2.5 px-4 py-2 border-b border-white/10",children:[(0,n.jsx)("div",{className:"w-8 h-8 rounded-full bg-[#2D4A3E]/30 flex items-center justify-center",children:(0,n.jsx)("span",{className:"text-[11px] text-[#5B7C6B] font-bold",children:"CA"})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-white text-[14px] font-medium leading-tight",children:"FieldAgent"}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-[#5B7C6B]"}),(0,n.jsx)("span",{className:"text-[10px] text-white/30",children:"Online"})]})]})]}),(0,n.jsxs)("div",{ref:v,className:"flex-1 overflow-y-auto px-3 py-3",children:[o.map(e=>(0,n.jsx)(i,{message:e},e.id)),b&&g&&(0,n.jsx)("div",{className:"flex justify-start mb-2.5",children:(0,n.jsxs)("div",{className:"max-w-[85%] px-4 py-2.5 text-[14px] leading-relaxed bg-[#E5E2D8] text-[#2C2C28] rounded-2xl rounded-bl-sm",children:[g,(0,n.jsx)("span",{className:"inline-block w-0.5 h-4 bg-[#2C2C28]/50 ml-0.5 animate-pulse"})]})}),p&&(0,n.jsx)("div",{className:"flex justify-start mb-2.5",children:(0,n.jsxs)("div",{className:"px-5 py-3 bg-[#E5E2D8] rounded-2xl rounded-bl-sm flex gap-1.5",children:[(0,n.jsx)("span",{className:"typing-dot w-2 h-2 bg-[#2C2C28]/40 rounded-full"}),(0,n.jsx)("span",{className:"typing-dot w-2 h-2 bg-[#2C2C28]/40 rounded-full"}),(0,n.jsx)("span",{className:"typing-dot w-2 h-2 bg-[#2C2C28]/40 rounded-full"})]})})]}),(0,n.jsx)("div",{className:"px-3 py-2.5 border-t border-white/10",children:(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("input",{type:"text",value:h,onChange:e=>u(e.target.value),onKeyDown:e=>"Enter"===e.key&&y(),placeholder:"Ask about your field...",disabled:p||b,className:"flex-1 bg-white/10 text-white text-[14px] px-4 py-2.5 rounded-full placeholder:text-white/25 focus:outline-none focus:ring-1 focus:ring-[#5B7C6B]/50 disabled:opacity-50"}),(0,n.jsx)("button",{onClick:y,disabled:p||b||!h.trim(),className:"w-9 h-9 rounded-full bg-[#3b82f6] flex items-center justify-center flex-shrink-0 disabled:opacity-30 transition-opacity",children:(0,n.jsx)("svg",{className:"w-4 h-4 text-white",viewBox:"0 0 16 16",fill:"currentColor",children:(0,n.jsx)("path",{d:"M8 1l-7 7h4v7h6V8h4z"})})})]})})]},"text"):(0,n.jsx)("div",{className:"tab-fade-enter flex-1 flex flex-col",children:(0,n.jsx)(d,{})},"call")})]})})}var o=s(6708),m=s(5659),h=s(6547),u=s(1435),p=s(39);function f(){let[e,t]=(0,l.useState)("phone"),[s,a]=(0,l.useState)(null),[i,c]=(0,l.useState)(!1),[d,f]=(0,l.useState)(null),g=async e=>{if(c(!1),a(e),0===e.trace.length&&e.session_id){let t=await r.h.getTraceSteps(e.session_id);t.length>0&&a(e=>e?{...e,trace:t}:e)}},j=s?s.trace.reduce((e,t)=>
1e+t.duration_ms,0):0,b=[{key:"phone",label:"SMS Agent",icon:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 1.5H8.25A2.25 2.25 0 006 3.75v16.5a2.25 2.25 0 002.25 2.25h7.5A2.25 2.25 0 0018 20.25V3.75a2.25 2.25 0 00-2.25-2.25H13.5m-3 0V3h3V1.5m-3 0h3m-3 18.75h3"})})},{key:"dashboard",label:"Dashboard",icon:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z"})})},{key:"sessions",label:"Sessions",icon:(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})})},{key:"fields",label:"Fields",icon:(0,n.jsxs)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 10.5a3 3 0 11-6 0 3 3 0 016 0z"}),(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1115 0z"})]})}];return(0,n.jsx)("div",{className:"min-h-[calc(100vh-64px)] px-4 sm:px-6 lg:px-8 py-8 lg:py-12",children:(0,n.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,n.jsxs)("div",{className:"text-center mb-8",children:[(0,n.jsx)("h1",{className:"font-display text-[32px] lg:text-[40px] text-primary font-semibold tracking-wide",children:"Interactive Demo"}),(0,n.jsx)("p",{className:"text-[15px] text-text/40 mt-2 max-w-lg mx-auto",children:"Explore FieldAgent like a real user — send messages, view traces, browse fields and sessions."})]}),(0,n.jsx)("div",{className:"flex items-center justify-center gap-2 mb-8",children:b.map(s=>(0,n.jsxs)("button",{onClick:()=>{t(s.key),f(null)},className:"flex items-center gap-2 px-5 py-2.5 rounded-full text-[13px] font-medium transition-all ".concat(e===s.key?"bg-primary text-white shadow-sm":"bg-paper border border-grid text-text/50 hover:text-text/70 hover:border-sand"),children:[s.icon,s.label]},s.key))}),"phone"===e&&(0,n.jsxs)("div",{className:"flex flex-col lg:flex-row gap-12 lg:gap-16 items-start max-w-6xl mx-auto",children:[(0,n.jsxs)("div",{className:"lg:w-[380px] flex-shrink-0 flex flex-col items-center",children:[(0,n.jsx)(x,{onResponse:g,useMock:!0}),(0,n.jsxs)("div",{className:"mt-6 text-center",children:[(0,n.jsx)("p",{className:"text-[12px] text-text/30",children:"Or call directly"}),(0,n.jsx)("p",{className:"text-[16px] font-bold text-accent mt-0.5",children:"(681) 291-1561"}),(0,n.jsx)("p",{className:"text-[11px] text-text/20 mt-1",children:"Powered by ElevenLabs"})]})]}),(0,n.jsx)("div",{className:"flex-1 max-w-2xl",children:s?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex items-baseline justify-between mb-5",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-[11px] font-mono text-accent tracking-wider",children:"— LIVE TRACE"}),(0,n.jsx)("h3",{className:"font-display text-[22px] font-semibold text-text tracking-wide mt-0.5",children:"What the agent did"})]}),(0,n.jsxs)("span",{className:"font-mono text-[12px] text-text/30 bg-grid/50 px-2.5 py-1 rounded",children:["TOTAL ",(j/1e3).toFixed(1),"s"]})]}),(0,n.jsx)(o.Z,{trace:s.trace,visible:!0,onComplete:()=>c(!0)}),s.recommendations[0]&&(0,n.jsx)("div",{className:"mt-4",children:(0,n.jsx)(m.Z,{recommendation:s.recommendations[0],visible:i})})]}):(0,n.jsx)("div",{className:"flex items-center justify-center h-64 lg:h-96",children:(0,n.jsx)("div",{className:"text-center",children:(0,n.jsxs)("div",{className:"inline-flex items-center gap-2.5 bg-grid/30 px-6 py-3.5 rounded-xl",children:[(0,n.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-sand animate-pulse"}),(0,n.jsx)("span",{className:"text-[15px] text-text/35",children:"Send a message to see the agent think..."})]})})})})]}),"dashboard"===e&&(0,n.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,n.jsx)("div",{className:"grid grid-cols-3 gap-4 mb-6",children:[{label:"FIELDS",value:"3",sub:"registered"},{label:"SESSIONS",value:"3",sub:"total interactions"},{label:"ALERTS",value:"2",sub:"need attention"}].map(e=>
1(0,n.jsxs)("div",{className:"bg-paper border border-grid rounded-xl p-5",children:[(0,n.jsx)("p",{className:"text-[11px] font-semibold tracking-[0.15em] uppercase text-text/30",children:e.label}),(0,n.jsx)("p",{className:"text-[28px] font-bold text-text mt-1",children:e.value}),(0,n.jsx)("p",{className:"text-[12px] text-text/30",children:e.sub})]},e.label))}),(0,n.jsx)("div",{className:"space-y-4",children:p.ku.map(e=>(0,n.jsxs)("div",{className:"bg-paper border border-grid rounded-xl p-6",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h3",{className:"text-[16px] font-semibold text-text",children:e.name}),(0,n.jsxs)("p",{className:"text-[12px] text-text/40 mt-0.5",children:[e.crop_type," \xb7 ",e.area_acres," acres \xb7 ",e.soil_type]})]}),void 0!==e.last_ndvi&&(0,n.jsxs)("span",{className:"text-[11px] font-bold uppercase px-2.5 py-1 rounded-full ".concat(e.last_ndvi>=.6?"bg-emerald-100 text-emerald-700":e.last_ndvi>=.4?"bg-amber-100 text-amber-700":"bg-red-100 text-red-700"),children:["NDVI ",e.last_ndvi]})]}),void 0!==e.last_ndvi&&(0,n.jsx)("div",{className:"mb-4",children:(0,n.jsx)(u.Z,{value:e.last_ndvi})}),e.last_recommendation&&(0,n.jsx)("p",{className:"text-[13px] text-text/50 leading-relaxed",children:e.last_recommendation}),(0,n.jsx)("div",{className:"mt-3 pt-3 border-t border-grid",children:(0,n.jsxs)("span",{className:"font-mono text-[10px] text-text/25",children:[e.lat.toFixed(4),"\xb0N, ",Math.abs(e.lng).toFixed(4),"\xb0W"]})})]},e.id))})]}),"sessions"===e&&!d&&(0,n.jsx)("div",{className:"max-w-4xl mx-auto space-y-3",children:p.PV.map(e=>(0,n.jsx)("button",{onClick:()=>f(e),className:"w-full text-left bg-paper border border-grid rounded-xl p-5 hover:border-sand transition-colors",children:(0,n.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 mb-1",children:[(0,n.jsx)("h3",{className:"text-[15px] font-semibold text-text",children:e.field_name}),e.recommendations[0]&&(0,n.jsx)("span",{className:"text-[10px] font-bold uppercase px-2 py-0.5 rounded-full ".concat("irrigate"===e.recommendations[0].action_type?"bg-blue-100 text-blue-700":"fertilize"===e.recommendations[0].action_type?"bg-emerald-100 text-emerald-700":"bg-gray-100 text-gray-600"),children:e.recommendations[0].action_type.replace("_"," ")}),(0,n.jsx)("span",{className:"text-[10px] font-semibold uppercase px-2 py-0.5 rounded-full ".concat("sms"===e.channel?"bg-blue-50 text-blue-600":"bg-emerald-50 text-emerald-600"),children:e.channel})]}),(0,n.jsxs)("p",{className:"text-[14px] text-text/50 truncate mb-1",children:["“",e.message,"”"]}),(0,n.jsx)("p",{className:"text-[13px] text-text/35 line-clamp-1",children:e.response})]}),(0,n.jsxs)("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[(0,n.jsx)("span",{className:"font-mono text-[12px] text-text/40",children:new Date(e.created_at).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})}),(0,n.jsx)("svg",{className:"w-4 h-4 text-text/20",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,n.jsx)("path",{d:"M6 4l4 4-4 4"})})]})]})},e.id))}),"sessions"===e&&d&&(0,n.jsxs)("div",{className:"max-w-6xl mx-auto",children:[(0,n.jsxs)("button",{onClick:()=>f(null),className:"text-[13px] text-text/40 hover:text-accent transition-colors mb-6 flex items-center gap-1",children:[(0,n.jsx)("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,n.jsx)("path",{d:"M8 2L4 6l4 4"})}),"Back to sessions"]}),(0,n.jsxs)("div",{className:"bg-paper border border-grid rounded-xl p-6 mb-6",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,n.jsx)("h2",{className:"font-display text-[24px] font-semibold text-primary",children:d.field_name}),(0,n.jsx)("span",{className:"text-[10px] font-bold uppercase px-2 py-0.5 rounded-full ".concat("sms"===d.channel?"bg-blue-50 text-blue-600 border border-blue-200":"bg-emerald-50 text-emerald-600 border border-emerald-200"),children:d.channel})]}),(0,n.jsxs)("p",{className:"text-[13px] text-text/40 mb-3",children:[new Date(d.created_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})," at ",new Date(d.created_at).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})]}),(0,n.jsx)("div",{className:"bg-bg rounded-lg rounded-tl-sm px-4 py-3",children:(0,n.jsx)("p",{className:"text-[14px] text-text",children:d.message})})]}),d.response&&(0,n.jsxs)("div",{className:"bg-paper border border-gr
1id rounded-xl p-5 mb-6",children:[(0,n.jsx)("h3",{className:"text-[13px] font-semibold tracking-[0.15em] uppercase text-primary mb-3",children:"Agent Response"}),(0,n.jsx)("p",{className:"text-[14px] text-text leading-[1.7]",children:d.response})]}),d.recommendations[0]&&(0,n.jsxs)("div",{className:"mb-6",children:[(0,n.jsx)("h3",{className:"text-[13px] font-semibold tracking-[0.15em] uppercase text-accent mb-3",children:"Recommendation"}),(0,n.jsx)(m.Z,{recommendation:d.recommendations[0],visible:!0})]}),d.trace.length>0&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("h3",{className:"text-[13px] font-semibold tracking-[0.15em] uppercase text-text/50 mb-4 flex items-center gap-2",children:[(0,n.jsx)("div",{className:"w-2 h-2 rounded-full bg-accent animate-pulse"}),"Agent Reasoning Trace"]}),(0,n.jsx)(o.Z,{trace:d.trace,visible:!0})]})]}),"fields"===e&&(0,n.jsx)("div",{className:"max-w-4xl mx-auto space-y-3",children:p.ku.map(e=>(0,n.jsx)(h.Z,{field:e},e.id))})]})})}}},function(e){e.O(0,[481,400,837,540,547,971,117,744],function(){return e(e.s=8374)}),_N_E=e.O()}]);

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.