all these changes

This commit is contained in:
Jake Kasper
2026-04-09 13:19:47 -05:00
parent e83a51a051
commit 65315f36d1
39102 changed files with 7932979 additions and 567 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+5
View File
@@ -0,0 +1,5 @@
import{r as n,j as s,L as z,M as B,T as _,a1 as $,l as q,n as O,P as R,a4 as p}from"./index-9FS9bw8D.js";const K=()=>{const[C,v]=n.useState(!0),[M,E]=n.useState([]),[g,T]=n.useState(""),[i,k]=n.useState(null),[d,h]=n.useState(null),[b,N]=n.useState(""),[f,w]=n.useState(""),[r,u]=n.useState(null),[S,o]=n.useState([]),P=async()=>{var e,a;try{v(!0);const t=await p.getProperties({search:g});E(((a=(e=t.data)==null?void 0:e.data)==null?void 0:a.properties)||[])}finally{v(!1)}};n.useEffect(()=>{P()},[g]);const y=async e=>{var t,l;const a=await p.getProperty(e);k(((l=(t=a.data)==null?void 0:t.data)==null?void 0:l.property)||null)},G=e=>{h(e),N(e.name),w(e.grassType||(e.grassTypes||[]).join(", "))},L=e=>{var a,t;u(e.id),o(((t=(a=e.polygonData)==null?void 0:a.coordinates)==null?void 0:t[0])||[])},A=async()=>{const e=f.split(",").map(t=>t.trim()).filter(Boolean),a={name:b,area:d.area,polygonData:d.polygonData,grassType:e.join(", "),grassTypes:e};await p.updateSectionAdmin(i.id,d.id,a),await y(i.id),h(null)},D=async()=>{const e=(i.sections||[]).find(t=>t.id===r),a={...e.polygonData||{},coordinates:[S]};await p.updateSectionAdmin(i.id,r,{name:e.name,area:e.area,polygonData:a,grassType:e.grassType,grassTypes:e.grassTypes}),await y(i.id),u(null),o([])},I=()=>{u(null),o([])};return C?s.jsx("div",{className:"p-6",children:s.jsx(z,{})}):s.jsxs("div",{className:"p-6",children:[s.jsxs("div",{className:"flex justify-between items-center mb-4",children:[s.jsx("h1",{className:"text-2xl font-bold",children:"Admin: Properties"}),s.jsx("input",{className:"input w-64",placeholder:"Search by name/address/email",value:g,onChange:e=>T(e.target.value)})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"card",children:[s.jsx("h3",{className:"font-semibold mb-2",children:"All Properties"}),s.jsx("div",{className:"max-h-[60vh] overflow-auto divide-y",children:M.map(e=>s.jsxs("div",{className:`p-3 hover:bg-gray-50 cursor-pointer ${(i==null?void 0:i.id)===e.id?"bg-blue-50":""}`,onClick:()=>y(e.id),children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:e.name}),s.jsx("div",{className:"text-xs text-gray-600",children:e.userEmail})]}),s.jsxs("div",{className:"text-sm text-gray-700",children:[e.sectionCount," sections • ",(e.calculatedArea||0).toLocaleString()," sq ft"]})]}),s.jsx("div",{className:"text-xs text-gray-500",children:e.address})]},e.id))})]}),s.jsx("div",{className:"card",children:i?s.jsxs("div",{children:[s.jsx("div",{className:"flex justify-between items-center mb-2",children:s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold",children:i.name}),s.jsx("div",{className:"text-xs text-gray-600",children:i.userEmail})]})}),s.jsx("div",{className:"h-64 rounded overflow-hidden mb-3",children:s.jsxs(B,{center:[i.latitude||39.8,i.longitude||-98.6],zoom:16,style:{height:"100%",width:"100%"},children:[s.jsx(_,{attribution:"© Esri",url:"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"}),(i.sections||[]).map(e=>{var a,t;return s.jsx($,{positions:((t=(a=e.polygonData)==null?void 0:a.coordinates)==null?void 0:t[0])||[],pathOptions:{color:e.id===r?"#f59e0b":"#10b981",weight:2,fillOpacity:.2}},e.id)}),r&&S.map((e,a)=>s.jsx(q,{position:e,draggable:!0,eventHandlers:{dragend:t=>{const{lat:l,lng:m}=t.target.getLatLng();o(x=>x.map((c,j)=>j===a?[l,m]:c))}},icon:new O.Icon({iconUrl:"data:image/svg+xml;base64,"+btoa(`
<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
<circle cx="6" cy="6" r="5" fill="#f59e0b" stroke="white" stroke-width="2"/>
</svg>
`),iconSize:[12,12],iconAnchor:[6,6]}),children:s.jsx(R,{children:s.jsxs("div",{className:"text-xs",children:["Point ",a+1]})})},`ed-${a}`))]})}),r&&s.jsxs("div",{className:"mb-3 flex gap-2",children:[s.jsx("button",{className:"btn-primary",onClick:D,children:"Save Geometry"}),s.jsx("button",{className:"btn-secondary",onClick:I,children:"Cancel"})]}),s.jsx("h4",{className:"font-medium mb-2",children:"Sections"}),s.jsx("div",{className:"space-y-2 max-h-[40vh] overflow-auto",children:(i.sections||[]).map(e=>{var a,t,l,m,x;return s.jsxs("div",{className:"p-2 border rounded flex justify-between items-center",children:[s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-sm",children:e.name}),s.jsxs("div",{className:"text-xs text-gray-600",children:[(e.area||0).toLocaleString()," sq ft"]}),s.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[e.captureMethod&&s.jsx("span",{className:`px-1.5 py-0.5 text-[10px] rounded ${e.captureMethod==="gps_points"?"bg-blue-100 text-blue-800":e.captureMethod==="gps_trace"?"bg-yellow-100 text-yellow-800":"bg-gray-100 text-gray-700"}`,children:e.captureMethod}),((a=e.captureMeta)==null?void 0:a.pointsCount)&&s.jsxs("span",{className:"text-[10px] text-gray-600",children:[e.captureMeta.pointsCount," pts"]}),((t=e.captureMeta)==null?void 0:t.accuracyLast)&&s.jsxs("span",{className:"text-[10px] text-gray-600",children:["±",Math.round(e.captureMeta.accuracyLast)," m"]}),((l=e.captureMeta)==null?void 0:l.totalDistanceMeters)&&s.jsxs("span",{className:"text-[10px] text-gray-600",children:[Math.round(e.captureMeta.totalDistanceMeters*3.28084)," ft walked"]})]}),(((m=e.grassTypes)==null?void 0:m.length)>0||e.grassType)&&s.jsx("div",{className:"mt-1 flex flex-wrap gap-1",children:((x=e.grassTypes)!=null&&x.length?e.grassTypes:(e.grassType||"").split(",").map(c=>c.trim()).filter(Boolean)).map((c,j)=>s.jsx("span",{className:"px-1.5 py-0.5 text-[10px] rounded bg-green-100 text-green-800",children:c},j))})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{className:"btn-secondary",onClick:()=>G(e),children:"Edit"}),s.jsx("button",{className:"btn-secondary",onClick:()=>L(e),children:"Edit Geometry"})]})]},e.id)})})]}):s.jsx("div",{className:"text-gray-500",children:"Select a property to view details"})})]}),d&&s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-white rounded-lg p-6 w-full max-w-lg",children:[s.jsx("h3",{className:"font-semibold mb-3",children:"Edit Section"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"label",children:"Name"}),s.jsx("input",{className:"input",value:b,onChange:e=>N(e.target.value)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"label",children:"Grass Types (comma separated)"}),s.jsx("input",{className:"input",value:f,onChange:e=>w(e.target.value),placeholder:"e.g., Kentucky Bluegrass, Perennial Ryegrass"})]})]}),s.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[s.jsx("button",{className:"btn-secondary",onClick:()=>h(null),children:"Cancel"}),s.jsx("button",{className:"btn-primary",onClick:A,children:"Save"})]})]})})]})};export{K as default};
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
import{j as t,N as a}from"./index-9FS9bw8D.js";const e=()=>t.jsx(a,{to:"/applications?action=log",replace:!0});export{e as default};
+1
View File
@@ -0,0 +1 @@
import{j as a,N as t}from"./index-9FS9bw8D.js";const p=()=>a.jsx(t,{to:"/applications?new=plan",replace:!0});export{p as default};
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
import{r as e}from"./index-9FS9bw8D.js";function a({title:r,titleId:o,...t},n){return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":o},t),r?e.createElement("title",{id:o},r):null,e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 10.5 12 3m0 0 7.5 7.5M12 3v18"}))}const i=e.forwardRef(a);export{i as F};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
import{r as e}from"./index-9FS9bw8D.js";function a({title:r,titleId:t,...o},n){return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},o),r?e.createElement("title",{id:t},r):null,e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}))}const i=e.forwardRef(a);export{i as F};
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
import{r as e}from"./index-9FS9bw8D.js";function a({title:r,titleId:t,...n},o){return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":t},n),r?e.createElement("title",{id:t},r):null,e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}const i=e.forwardRef(a);export{i as F};
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
import{r as e}from"./index-9FS9bw8D.js";function a({title:r,titleId:t,...o},n){return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},o),r?e.createElement("title",{id:t},r):null,e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"}))}const i=e.forwardRef(a);function c({title:r,titleId:t,...o},n){return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},o),r?e.createElement("title",{id:t},r):null,e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z"}))}const s=e.forwardRef(c);export{s as F,i as a};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
import{r as e}from"./index-9FS9bw8D.js";function a({title:r,titleId:t,...o},n){return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},o),r?e.createElement("title",{id:t},r):null,e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12a7.5 7.5 0 0 0 15 0m-15 0a7.5 7.5 0 1 1 15 0m-15 0H3m16.5 0H21m-1.5 0H12m-8.457 3.077 1.41-.513m14.095-5.13 1.41-.513M5.106 17.785l1.15-.964m11.49-9.642 1.149-.964M7.501 19.795l.75-1.3m7.5-12.99.75-1.3m-6.063 16.658.26-1.477m2.605-14.772.26-1.477m0 17.726-.26-1.477M10.698 4.614l-.26-1.477M16.5 19.794l-.75-1.299M7.5 4.205 12 12m6.894 5.785-1.149-.964M6.256 7.178l-1.15-.964m15.352 8.864-1.41-.513M4.954 9.435l-1.41-.514M12.002 12l-3.75 6.495"}))}const i=e.forwardRef(a);function l({title:r,titleId:t,...o},n){return e.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":t},o),r?e.createElement("title",{id:t},r):null,e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19.128a9.38 9.38 0 0 0 2.625.372 9.337 9.337 0 0 0 4.121-.952 4.125 4.125 0 0 0-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 0 1 8.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0 1 11.964-3.07M12 6.375a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0Zm8.25 2.25a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"}))}const m=e.forwardRef(l);export{m as F,i as a};
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
import{r as h,j as e,O as f,p as S,w}from"./index-9FS9bw8D.js";const L=()=>{const[j,v]=h.useState([]),[s,p]=h.useState({}),[N,x]=h.useState(!0),[u,g]=h.useState(null);return h.useEffect(()=>{(async()=>{var d,l;try{x(!0);const r=((l=(d=(await S.getAll()).data)==null?void 0:d.data)==null?void 0:l.properties)||[];v(r);const i=r.filter(a=>a.latitude&&a.longitude).map(a=>a.id),y=await Promise.allSettled(i.map(a=>w.getCurrent(a))),o={};y.forEach((a,m)=>{const n=i[m];a.status==="fulfilled"&&(o[n]={weather:a.value.data.data.weather})}),(await Promise.allSettled(i.map(a=>w.getForecast(a)))).forEach((a,m)=>{const n=i[m];a.status==="fulfilled"&&(o[n]=o[n]||{},o[n].forecast=a.value.data.data.forecast)}),p(o),g(null)}catch(c){console.error("Failed to load weather:",c),g("Failed to load weather")}finally{x(!1)}})()},[]),e.jsxs("div",{className:"p-6",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-6",children:"Weather"}),N?e.jsx("div",{className:"card",children:"Loading…"}):u?e.jsx("div",{className:"card text-red-700",children:u}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:j.map(t=>{var d,l,c;return e.jsxs("div",{className:"bg-white rounded-lg shadow p-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsx("div",{className:"font-semibold",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500",children:t.address})]}),!t.latitude||!t.longitude?e.jsx("div",{className:"text-sm text-gray-600",children:"No coordinates set"}):(d=s[t.id])!=null&&d.weather?e.jsxs("div",{className:"flex items-center",children:[e.jsx("img",{alt:"",width:"50",height:"50",src:`${f.apiBaseUrl}/weather/icon/${s[t.id].weather.current.icon}?size=2x`}),e.jsxs("div",{className:"ml-3",children:[e.jsxs("div",{className:"text-xl font-bold",children:[s[t.id].weather.current.temperature,"°F"]}),e.jsx("div",{className:"text-sm text-gray-700",children:s[t.id].weather.current.conditions}),e.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:["Humidity ",s[t.id].weather.current.humidity,"% • Wind ",Math.round(s[t.id].weather.current.windSpeed)," mph"]})]})]}):e.jsx("div",{className:"text-sm text-gray-600",children:"Loading weather…"}),((c=(l=s[t.id])==null?void 0:l.forecast)==null?void 0:c.daily)&&e.jsx("div",{className:"mt-3 grid grid-cols-5 gap-2 text-center",children:s[t.id].forecast.daily.map((r,i)=>e.jsxs("div",{className:"text-xs text-gray-700",children:[e.jsx("div",{className:"font-medium",children:new Date(r.date).toLocaleDateString(void 0,{weekday:"short"})}),e.jsx("img",{alt:"",className:"mx-auto",width:"40",height:"40",src:`${f.apiBaseUrl}/weather/icon/${r.icon}?size=2x`}),e.jsxs("div",{children:[r.temperatureHigh,"° / ",r.temperatureLow,"°"]})]},i))})]},t.id)})})]})};export{L as default};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long