PageSourceSearch

https://farmersnavigator.com/_next/static/chunks/8620-48eb68ee47bc6bce.js

js farmersnavigator.com collected 2026-10-06 02:05:03 UTC 75,841 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8620],{78237:function(e,t,n){n.d(t,{qo:function(){return p}});var a=n(88245);function r(e,t){if(!e)return!1;let n=Date.parse(String(e).slice(0,10)+"T00:00:00Z");return!!Number.isNaN(n)||Date.now()-n<=864e5*t}let o={};a.kC.forEach((e,t)=>{o[e]=t});let l={"Feeder Cattle":"feeder_cattle","Live Cattle":"live_cattle",Corn:"corn",Soybeans:"soybeans",Wheat:"wheat","Class III Milk":"class3_milk","Class IV Milk":"class4_milk",Cotton:"cotton",Rice:"rice","Lean Hogs":"lean_hogs"};function i(e,t){if(.005>=Math.abs(e.c)||t.length<3)return 0;let n=l[e.n];if(!n)return 0;let a=t.slice(-6).map(e=>e[n]).filter(e=>"number"==typeof e);if(a.length<3)return 0;let r=e.c<0,o=1;for(let e=a.length-1;e>0&&(r&&a[e]<a[e-1]||!r&&a[e]>a[e-1]);e--)o++;return o}let c=["","","","three","four","five"],s=new Set(["Feeder Cattle","Live Cattle"]);function u(e,t,n){var a,r;let o=String(n).padStart(2,"0");return(null===(r=e.monthlyAverages)||void 0===r?void 0:null===(a=r[t])||void 0===a?void 0:a[o])?e.monthlyAverages[t][o]:e.seasonalAvg[t]?e.seasonalAvg[t]:null}function d(e,t,n,r){let o=Math.abs(e-t);if(o<.5)return null;let l=e>t?"above":"below",i="$".concat(t.toFixed(2));return r?"well ".concat(l," 5-year average (").concat(i,")"):"".concat(Math.round(o/t*100),"% ").concat(l," the 5-year ").concat(a.Yi[n]," average (").concat(i,")")}function p(e){var t,n,p,f,h,g,m,y,v;let b=[],w=e.prices[0]||null,S=new Date().getMonth()+1,k=!!e.isMobile,D="cattle"===e.op||"mixed"===e.op||"all"===e.op,x="grain"===e.op||"mixed"===e.op||"all"===e.op,_="dairy"===e.op||"mixed"===e.op||"all"===e.op,M="swine"===e.op||"all"===e.op;if(w){let t=Math.abs(w.c),n=l[w.n]||"",a=n?e.volatility[n]:void 0,r=w.n,o=w.c>0?"up":"down";if(((null==a?void 0:a.isBigMove)||(null==a?void 0:a.isNotable))&&t>.005){let a=function(e,t){if(.005>=Math.abs(e.c)||t.length<3)return"";let n=l[e.n];if(!n)return"";let a=t.slice(-6).map(e=>e[n]).filter(e=>"number"==typeof e);if(a.length<3)return"";let r=e.c<0,o=1;for(let e=a.length-1;e>0&&(r&&a[e]<a[e-1]||!r&&a[e]>a[e-1]);e--)o++;let i=a.slice(-5),c=0;for(let e=1;e<i.length;e++)(r&&i[e]<i[e-1]||!r&&i[e]>i[e-1])&&c++;let s=r?"down":"up";return o>=3&&o<=5?", ".concat(["","","second","third","fourth","fifth"][o]," straight day ").concat(s):c>=4&&i.length>=5?", ".concat(s," ").concat(c," of last 5 sessions"):""}(w,e.history),i="heavy"===e.volumeContext[n]?" on heavy volume":"",c=u(e,n,S),s=c?d(w.v,c,S,k):null,p=s?"".concat(r," ").concat(o," $").concat(t.toFixed(2)," to $").concat(w.v.toFixed(2)).concat(a).concat(i,", ").concat(s,"."):"".concat(r," ").concat(o," $").concat(t.toFixed(2)," to $").concat(w.v.toFixed(2)).concat(a).concat(i,".");b.push({text:p,tier:1,score:90,topic:"price-move",fresh:!0})}}if(w){let t=l[w.n]||"",n=t?e.volatility[t]:void 0,r=w.n,o=.005>=Math.abs(w.c),d=w.c>0?"up":"down",p="$".concat(w.v.toFixed(2)),f="";if(o){let n=u(e,t,S);if(n&&Math.abs((w.v-n)/n)>.05){let e=Math.abs(w.v-n),t=w.v>n?"above":"below",o="$".concat(n.toFixed(2));f=k?"".concat(r," flat at ").concat(p,", well ").concat(t," 5-year average (").concat(o,")."):"".concat(r," flat at ").concat(p,", ").concat(Math.round(e/n*100),"% ").concat(t," the 5-year ").concat(a.Yi[S]," average (").concat(o,").")}else f="".concat(w.n," ").concat(p,", unchanged.")}else{let o=b.some(e=>"price-move"===e.topic),l=i(w,e.history);if(l>=3&&!o){let e=c[l]||"".concat(l);f="".concat(r," ").concat(d," ").concat(e," straight days to ").concat(p,".")}if(!f&&o){let t=s.has(w.n);for(let n of e.prices.slice(1)){if(t&&s.has(n.n)||n.n===w.n)continue;let a=i(n,e.history);if(a>=3){let e=n.n,t=n.c>0?"up":"down",r=c[a]||"".concat(a),o="$".concat(n.v.toFixed(2));f="".concat(e," ").concat(t," ").concat(r," straight days to ").concat(o,".");break}}}if(!f&&!o){let n=u(e,t,S);if(n){let e=100*Math.abs((w.v-n)/n);if(e>5){let t=w.v>n?"above":"below",o="$".concat(n.toFixed(2));f=k?"".concat(r," at ").concat(p,", well ").concat(t," 5-year ").concat(a.Yi[S]," average (").concat(o,")."):"".concat(r," at ").concat(p,", ").concat(Math.round(e),"% ").concat(t," the 5-year ").concat(a.Yi[S]," average (").concat(o,").")}}}if(!f&&n&&!o&&(!(n.zScore<.5)||n.isNotable||n.isBigMove?(n.isBigMove||n.isNotable)&&(f=k?"".concat(r," volatile, ").concat(p,", ").concat(d,"."):"".concat(r," volatile, ").concat(p," with big daily swings this week.")):f=k?"".concat(r," quiet at ").concat(p,", ").concat(d,"."):"".concat(r," quiet at ").concat(p,", tightest range in weeks.")),!f){let n="$".concat(Math.abs(w.c).toFixed(2)),o=t?e.volumeContext[t]:void 0;if("light"===o||"heavy"===o)f="".concat(r," at ").concat(p,", ").concat(d," ").concat(n," on ").concat(o," volume.");else if(w.derived)f="".concat(r," at ").concat(p,", ").concat(d," ").concat(n," month-over-month.");else{let e=a.W4[new Date().getDay()];f="".concat(r," at ").concat(p,", ").concat(d," ").concat(n," ").concat(e,".")}}}let h=u(e,l[w.n]||"",S),g=h?Math.floor((w.v-h)/10):0,m=!e.prevBriefState||e.prevBriefState.priceBucket!==g,y=b.some(e=>"price-move"===e.topic);f&&!y&&b.push({text:f,tier:2,score:90,topic:"price-primary",fresh:m})}if(w&&e.prices.length>1)for(let t=1;t<e.prices.length;t++){let n=e.prices[t],a=l[n.n]||"",r=a?e.volatility[a]:void 0;if((null==r?void 0:r.isBigMove)&&Math.abs(n.c)>.005){let t=n.n,r=n.c>0?"up":"down",o=u(e,a,S),l=o?d(n.v,o,S,k):null;{let e=l?"".concat(t," ").concat(r," $").concat(Math.abs(n.c).toFixed(2)," to $").concat(n.v.toFixed(2),", ").concat(l,"."):"".concat(t," ").concat(r," $").concat(Math.abs(n.c).toFixed(2)," to $").concat(n.v.toFixed(2),".");b.push({text:e,tier:1,score:80,topic:"price-".concat(a),fresh:!0})}break}}if(e.hasFrost&&null!==e.frostLow&&e.frostLow<=a.R6){let t=e.frostDayNames&&e.frostDayNames.length>0?function(e){if(0===e.length)return"";if(1===e.length)return"tonight"===e[0]?"tonight":a.W4[o[e[0]]]||e[0];let t=new Date().getDay(),n=e.map(e=>{if("tonight"===e)return{abbr:a.W4[t],idx:t};let n=o[e];return{abbr:null!=n?a.W4[n]:e,idx:null!=n?n:-1}}),r=[],l=n[0],i=n[0];for(let e=1;e<n.length;e++){let t=n[e];(i.idx+1)%7===t.idx||(r.push({start:l.abbr,end:i.abbr}),l=t),i=t}return r.push({start:l.abbr,end:i.abbr}),r.map(e=>e.start===e.end?e.start:"".concat(e.start,"–").concat(e.end)).join(", ")}(e.frostDayNames):"tonight";e.frostDayNames&&e.frostDayNames.length>=2?b.push({text:"Frost ".concat(t,", lows ").concat(e.frostLow,"\xb0F."),tier:1,score:100,topic:"frost",fresh:!0}):null!=e.frostDaysFromAvg&&e.frostDaysFromAvg>0?b.push({text:"Frost ".concat(t,", ").concat(e.frostDaysFromAvg," days past average last frost date."),tier:1,score:100,topic:"frost",fresh:!0}):b.push({text:"Frost ".concat(t,", low ").concat(e.frostLow,"\xb0F."),tier:1,score:90,topic:"frost",fresh:!0})}let F=e.rainDayNames&&e.rainDayNames.length>0;if(e.weatherLine&&!F&&b.push({text:e.weatherLine,tier:2,score:58,topic:"weather",fresh:!0}),e.frostDateLabel&&null!=e.frostDaysAway&&e.frostDaysAway>0&&e.frostDaysAway<=30&&b.push({text:"Average last frost ".concat(e.frostDateLabel,", ").concat(e.frostDaysAway," days away."),tier:2,score:55,topic:"frost-date",fresh:!1}),e.cattleOnFeed&&null!==e.cattleOnFeed.onFeedPct&&D){let t=e.cattleOnFeed.onFeedPct,n=e.cattleOnFeed.placementsPct;if(k){let e=1>Math.abs(t-100)?"steady":t>100?"up ".concat((t-100).toFixed(1),"%"):"down ".concat((100-t).toFixed(1),"%"),a="";null!==n&&(a=2>Math.abs(n-100)?"steady":n>100?"up slightly":"down slightly",Math.abs(n-100)>=5&&(a=n>100?"up notably":"down notably"));let r=a?"Cattle on Feed ".concat(e,", placements ").concat(a,"."):"Cattle on Feed ".concat(e,".");b.push({text:r,tier:2,score:48,topic:"cof",fresh:!0})}else{let e="".concat(t.toFixed(1),"% of last year"),a=null!==n?", placements ".concat(n.toFixed(1),"%"):"";b.push({text:"Cattle on Feed: ".concat(e).concat(a,"."),tier:2,score:48,topic:"cof",fresh:!0})}}if(D&&(null===(t=e.cattleOnFeed)||void 0===t?void 0:t.onFeedPct)!=null&&w&&!b.some(e=>"price-report"===e.topic)){let t=i(w,e.history),n=Math.abs(w.c/w.v)>.02;if(t>=3||n){let n;let a=w.n,r=e.cattleOnFeed.onFeedPct,o=e.cattleOnFeed.placementsPct,l=w.c>0?"up":"down";if(t>=3){let e=c[t]||"".concat(t);n="".concat(a," ").concat(l," ").concat(e," straight days")}else n="".concat(a," ").concat(l," $").concat(Math.abs(w.c).toFixed(2)," to $").concat(w.v.toFixed(2));let i="Cattle on Feed at ".concat(r.toFixed(0),"%");null!=o&&(i+=" with placements ".concat(o>100?"up":"down"," ").concat(Math.abs(o-100).toFixed(0),"%")),b.push({text:"".concat(n,", ").concat(i,"."),tier:2,score:65,topic:"price-cof-link",fresh:!0})}}if(null!==e.streamChangePct&&Math.abs(e.streamChangePct)>=20){let t=e.streamChangePct>0?"up":"down";b.push({text:"Creek ".concat(t," ").concat(Math.abs(Math.round(e.streamChangePct)),"% this week."),tier:2,score:50,topic:"creek",fresh:!0})}let C=e.previousWeekLevel!==e.droughtLevel||!e.prevBriefState||e.prevBriefState.lfpWeeks!==e.lfpWeeks;if(e.droughtLevel>=3){let t=e.droughtLevel>=4?5:e.lfpWeeks>=4?4:3;if(e.previousWeekLevel<e.droughtLevel&&e.previousWeekLevel>=0){let n=e.previousWeekLevel>=1?"D".concat(e.previousWeekLevel):"D0",a=e.droughtLevel-e.previousWeekLevel>=2?"jumped":"worsened";b.push({text:"Drought ".concat(a," to ").concat(e.droughtLabel," from ").concat(n," — LFP ").concat(t,"-month payments may apply during grazing season, contact FSA."),tier:1,score:95,topic:"drought",fresh:!0})}else b.push({text:"Drought ".concat(e.droughtLabel," — LFP ").concat(t,"-month payments may apply during grazing season, contact FSA."),tier:1,score:95,topic:"drought",fresh:C||!0})}else if(e.droughtLevel>=2){if(e.lfpWeeks>=4)b.push({text:"Drought ".concat(e.droughtLabel,", LFP week ").concat(e.lfpWeeks," — monthly payments may be available, contact FSA."),tier:2,score:75,topic:"drought",fresh:C});else if(1===e.lfpWeeks&&e.previousWeekLevel<e.droughtLevel&&e.previousWeekLevel>=0){let t=e.previousWeekLevel>=1?"D".concat(e.previousWeekLevel):"D0";b.push({text:"Drought worsened to ".concat(e.droughtLabel," from ").concat(t,", LFP triggered. Week 1 of 4."),tier:1,score:95,topic:"drought",fresh:!0})}else if(1===e.lfpWeeks)b.push({text:"Drought ".concat(e.droughtLabel,", LFP triggered. Week 1 of 4 — no premium, county-rate payments if eligible."),tier:1,score:95,topic:"drought",fresh:!0});else if(e.lfpWeeks>1&&e.lfpWeeks<4)b.push({text:"Drought ".concat(e.droughtLabel,", LFP week ").concat(e.lfpWeeks," of 4."),tier:2,score:72,topic:"drought",fresh:C});else if(e.previousWeekLevel<e.droughtLevel&&e.previousWeekLevel>=0){let t=e.previousWeekLevel>=1?"D".concat(e.previousWeekLevel):"D0",n=e.droughtLevel-e.previousWeekLevel>=2?"jumped":"worsened";b.push({text:"Drought ".concat(n," to ").concat(e.droughtLabel,", was ").concat(t," last week."),tier:2,score:70,topic:"drought",fresh:!0})}else"worsening"===e.droughtTrend?b.push({text:"".concat(e.droughtLabel," drought, worsening over past 4 weeks."),tier:2,score:65,topic:"drought",fresh:C}):b.push({text:"Drought: ".concat(e.droughtLabel,"."),tier:3,score:35,topic:"drought",fresh:C})}else 1===e.droughtLevel&&(e.previousWeekLevel>1?b.push({text:"Drought eased to D1, was D".concat(e.previousWeekLevel," last week."),tier:2,score:65,topic:"drought",fresh:!0}):b.push({text:"Drought: ".concat(e.droughtLabel,"."),tier:3,score:30,topic:"drought",fresh:C}));if(e.droughtLevel>
1=2&&e.lfpOutOfSeason&&e.grazingStartLabel&&b.push({text:"Drought ".concat(e.droughtLabel," — LFP drought weeks start counting ").concat(e.grazingStartLabel," when the grazing period opens. Take dated photos of forage now; confirm your county's period with FSA."),tier:2,score:68,topic:"drought",fresh:C}),D&&w&&e.droughtLevel>=1&&!b.some(e=>"price-move"===e.topic)){let t=u(e,l[w.n]||"",S);if(t&&w.v<t&&(t-w.v)/t>.05){let n=Math.abs(w.v-t),r=w.n,o=n>=1?"$".concat(Math.round(n)):"$".concat(n.toFixed(2)),l="".concat(e.droughtLabel," drought");e.lfpWeeks>0&&(l+=" in week ".concat(e.lfpWeeks)),b.push({text:"".concat(r," ").concat(o," below the 5-year ").concat(a.Yi[S]," average, ").concat(l,"."),tier:2,score:68,topic:"price-drought-link",fresh:!0})}}if(e.nextDeadline&&e.nextDeadline.daysUntil>0&&e.nextDeadline.daysUntil<=90&&!e.suppressDeadlineInBrief){let t=e.nextDeadline,n=t.daysUntil<=14,a=n?65:t.daysUntil<=30?35:25,r=n||[30,14,7,3,1].includes(t.daysUntil),o=t.shortContext?" — ".concat(t.shortContext.replace(/\.+$/,"")):"";b.push({text:"".concat(t.name," in ").concat(t.daysUntil," days").concat(o,"."),tier:n?2:3,score:a,topic:"deadline",fresh:r})}if(e.cattleCash&&e.cattleCash.priorWeekLiveAvg&&D&&r(e.cattleCash.reportDate,2)&&!b.some(e=>"price-live_cattle"===e.topic||"price-move"===e.topic&&(null==w?void 0:w.n)==="Live Cattle"||"price-primary"===e.topic&&(null==w?void 0:w.n)==="Live Cattle")){let t=e.cattleCash.liveAvg-e.cattleCash.priorWeekLiveAvg;Math.abs(t)>=2&&b.push({text:"Cash steers ".concat(t>0?"up":"down"," $").concat(Math.abs(t).toFixed(2)," to $").concat(e.cattleCash.liveAvg.toFixed(2)," this week."),tier:2,score:68,topic:"cash-cattle",fresh:!0})}if(e.cattleCash&&D&&r(e.cattleCash.reportDate,2)){let t=e.prices.find(e=>"Live Cattle"===e.n);if(t&&t.v>0){let n=e.cattleCash.liveAvg-t.v;Math.abs(n)>=2&&b.push({text:"Basis ".concat(n>0?"+":"-","$").concat(Math.abs(n).toFixed(2),", ").concat(n>0?"cash over futures":"cash under futures","."),tier:2,score:50,topic:"basis-cattle",fresh:!0})}}let A=!1;{let t=[];e.hayItems&&e.hayItems.length>0&&e.hayItems[0].chg>5&&t.push("hay up $".concat(Math.abs(e.hayItems[0].chg).toFixed(0),"/ton")),e.diesel&&e.diesel.price>0&&e.diesel.change>.05&&t.push("diesel above average"),e.droughtLevel>=2&&t.push("".concat(e.droughtLabel," drought")),(null===(g=e.feedCost)||void 0===g?void 0:g.elevated)===!0&&t.push("feed cost elevated"),t.length>=2&&(A=!0,b.push({text:"Feed costs pressured: ".concat(t.join(", "),"."),tier:2,score:62,topic:"cost-pressure",fresh:!0}))}if(!A&&e.hayItems&&e.hayItems.length>0){let t=e.hayItems[0];if(Math.abs(t.chg)>=5){let e=t.chg>0?"up":"down";b.push({text:"".concat(t.type," ").concat(e," $").concat(Math.abs(t.chg).toFixed(0)," to $").concat(t.price.toFixed(0),"/ton."),tier:2,score:55,topic:"hay",fresh:!0})}}if(e.boxedBeef&&null!==e.boxedBeef.spread&&D&&r(e.boxedBeef.reportDate,2)&&e.boxedBeef.spread>=25&&null!==e.boxedBeef.spreadChange&&Math.abs(e.boxedBeef.spreadChange)>=2){let t=e.boxedBeef.spreadChange>0?"widened":"narrowed";b.push({text:"Boxed beef spread ".concat(t," to $").concat(e.boxedBeef.spread.toFixed(0),"."),tier:2,score:52,topic:"boxed-beef",fresh:!0})}if(e.cashHog&&e.cashHog.priorWeekAvg&&M&&r(e.cashHog.reportDate,2)){let t=e.cashHog.nationalAvg-e.cashHog.priorWeekAvg;Math.abs(t)>=2&&b.push({text:"Cash hogs ".concat(t>0?"up":"down"," $").concat(Math.abs(t).toFixed(2)," to $").concat(e.cashHog.nationalAvg.toFixed(2)," this week."),tier:2,score:68,topic:"cash-hog",fresh:!0})}if(e.porkCutout&&null!==e.porkCutout.compositeChange&&M&&r(e.porkCutout.reportDate,2)&&Math.abs(e.porkCutout.compositeChange)>=3){let t=e.porkCutout.compositeChange>0?"up":"down";b.push({text:"Pork cutout ".concat(t," $").concat(Math.abs(e.porkCutout.compositeChange).toFixed(2)," to $").concat(e.porkCutout.composite.toFixed(2),"."),tier:2,score:55,topic:"pork-cutout",fresh:!0})}if((null===(n=e.wasde)||void 0===n?void 0:n.isReportTomorrow)?b.push({text:"WASDE report releases tomorrow at noon ET.",tier:2,score:60,topic:"wasde",fresh:!0}):(null===(p=e.wasde)||void 0===p?void 0:p.isReportToday)&&b.push({text:"WASDE report at noon ET today.",tier:2,score:80,topic:"wasde",fresh:!0}),!A&&e.diesel&&Math.abs(e.diesel.change)>=.1){let t=e.diesel.change>0?"up":"down";b.push({text:"Diesel ".concat(t," $").concat(Math.abs(e.diesel.change).toFixed(2)," to $").concat(e.diesel.price.toFixed(2),"."),tier:3,score:30,topic:"diesel",fresh:!0})}if(null!=e.foragePctGoodExcellent&&null!=e.foragePriorWeek){let t=e.foragePriorWeek-e.foragePctGoodExcellent;t>=5&&b.push({text:"Pasture ratings dropped ".concat(t," points statewide."),tier:2,score:45,topic:"pasture",fresh:!0})}let L=new Date().getDate();if(null!=e.precipPctOfNormal&&L>7&&(e.precipPctOfNormal>=140?b.push({text:"Rainfall at ".concat(e.precipPctOfNormal,"% of normal for ").concat(a.Yi[S],"."),tier:3,score:30,topic:"precip",fresh:!0}):e.precipPctOfNormal<=50&&b.push({text:"Rainfall at ".concat(e.precipPctOfNormal,"% of normal for ").concat(a.Yi[S],"."),tier:3,score:38,topic:"precip",fresh:!0})),null!=e.dryDaysInForecast&&e.dryDaysInForecast>=5&&b.push({text:"".concat(e.dryDaysInForecast," dry days in the forecast."),tier:3,score:32,topic:"precip-forecast",fresh:!0}),e.rainDayNames&&e.rainDayNames.length>0){let t;let n=e.rainDayNames,r=null!==(m=e.rainInches)&&void 0!==m?m:0,l=r>0&&r<.5?"Light rain":"Rain",i=r>=.1?", ".concat(r.toFixed(1)," inches expected"):"";if(1===n.length){let e;t="".concat(l," likely ").concat((e=n[0],a.W4[o[e]]||e)).concat(i,".")}else{let e=n.map(e=>o[e]).filter(e=>null!=e),r=[];for(let t of e){let e=r[r.length-1];e&&t===(e[e.length-1]+1)%7?e.push(t):r.push([t])}let c=r.map(e=>e.length>=3?"".concat(a.W4[e[0]],"–").concat(a.W4[e[e.length-1]]):e.map(e=>a.W4[e]).join(", "));t="".concat(l," ").concat(c.join(", ")).concat(i,".")}b.push({text:t,tier:2,score:55,topic:"rain-forecast",fresh:!0})}if(null!=e.precipPctOfNormal&&e.precipPctOfNormal<=50&&e.droughtLevel>=1&&L>7&&b.push({text:"Rainfall ".concat(e.precipPctOfNormal,"% of normal and drought at ").concat(e.droughtLabel,"."),tier:2,score:50,topic:"precip-drought",fresh:!0}),e.frostFallLabel&&null!=e.frostFallDaysOut&&(e.frostFallDaysOut>0&&e.frostFallDaysOut<=45?b.push({text:"First frost typically ".concat(e.frostFallLabel,", ").concat(e.frostFallDaysOut," days out."),tier:3,score:30,topic:"frost-fall",fresh:!1}):e.frostFallDaysOut<=0&&e.frostFallDaysOut>=-14&&b.push({text:"First frost date (".concat(e.frostFallLabel,") has passed, hard freeze season."),tier:2,score:45,topic:"frost-fall",fresh:!0})),e.gdd&&e.gdd.accumulated>0&&S>=5&&x){let t=e.gdd.nextMilestoneLabel?", corn typically ".concat(e.gdd.nextMilestoneLabel.toLowerCase()," around ").concat(null===(y=e.gdd.nextMilestoneGDD)||void 0===y?void 0:y.toLocaleStr
1ing()):"";b.push({text:"".concat(e.gdd.accumulated.toLocaleString()," GDD accumulated since April 15").concat(t,"."),tier:3,score:28,topic:"gdd",fresh:!1})}if((null===(f=e.wasde)||void 0===f?void 0:f.isNewReport)&&e.wasde.data){let t=e.wasde.data;if(D&&t.cattle){let e=t.cattle.beefProductionDirection,n=Math.abs(t.cattle.beefProduction),a="unchanged"===e?"WASDE unchanged on beef production forecast.":"USDA ".concat(e," beef production forecast ").concat(n,"M lbs in today’s WASDE.");b.push({text:a,tier:2,score:75,topic:"wasde-data",fresh:!0})}if(x&&t.grain){let e=[];null!==t.grain.cornEndingStocks&&e.push("corn ".concat(t.grain.cornEndingStocks.toLocaleString(),"M bu (").concat(t.grain.cornEndingStocksDirection||"unchanged",")")),null!==t.grain.soyEndingStocks&&e.push("soybeans ".concat(t.grain.soyEndingStocks.toLocaleString(),"M bu (").concat(t.grain.soyEndingStocksDirection||"unchanged",")")),e.length>0&&b.push({text:"WASDE ending stocks: ".concat(e.join(", "),"."),tier:2,score:72,topic:"wasde-data",fresh:!0})}if(_&&t.dairy){let e=t.dairy.milkProductionDirection,n="unchanged"===e?"WASDE unchanged on milk production forecast.":"USDA ".concat(e," milk production forecast").concat(null!=t.dairy.milkProduction?" to ".concat(t.dairy.milkProduction.toFixed(1),"B lbs"):""," in today’s WASDE.");b.push({text:n,tier:2,score:72,topic:"wasde-data",fresh:!0})}}else if((null===(h=e.wasde)||void 0===h?void 0:h.isYesterday)&&e.wasde.data){let t=e.wasde.data;if(D&&t.cattle){let e=t.cattle.beefProductionDirection,n=Math.abs(t.cattle.beefProduction);b.push({text:"WASDE yesterday: beef production ".concat("unchanged"===e?"unchanged":"".concat(e," ").concat(n,"M lbs"),"."),tier:2,score:55,topic:"wasde-data",fresh:!0})}if(x&&t.grain&&null!==t.grain.cornEndingStocks&&b.push({text:"WASDE yesterday: corn ending stocks at ".concat(t.grain.cornEndingStocks.toLocaleString(),"M bu."),tier:2,score:55,topic:"wasde-grain",fresh:!0}),_&&t.dairy){let e=null!=t.dairy.milkProduction?" at ".concat(t.dairy.milkProduction.toFixed(1),"B lbs"):"";b.push({text:"WASDE yesterday: milk production ".concat(t.dairy.milkProductionDirection||"unchanged").concat(e,"."),tier:2,score:55,topic:"wasde-dairy",fresh:!0})}}if(e.reportCalendar)for(let t of e.reportCalendar.today)"WASDE"!==t.name&&b.push({text:"".concat(t.name," report at ").concat(t.time," today."),tier:2,score:60,topic:"report-".concat(t.name),fresh:!0});if(e.reportCalendar&&e.reportCalendar.yesterday.length>0){if(w&&!w.derived&&Math.abs(w.c/w.v)>.015&&w){let t;let n=w.n,a=w.c>0?"up":"down",r="$".concat(Math.abs(w.c).toFixed(2)),o=e.reportCalendar.yesterday[0];t="Cattle on Feed"===o.name&&(null===(v=e.cattleOnFeed)||void 0===v?void 0:v.placementsPct)!=null?"".concat(n," ").concat(a," ").concat(r,", ").concat(o.name," released yesterday with placements at ").concat(e.cattleOnFeed.placementsPct.toFixed(0),"%."):"".concat(n," ").concat(a," ").concat(r,", ").concat(o.name," released yesterday."),b.push({text:t,tier:2,score:72,topic:"price-report",fresh:!0})}else for(let t of e.reportCalendar.yesterday)b.push({text:"".concat(t.name," released yesterday."),tier:3,score:35,topic:"report-yesterday-".concat(t.name),fresh:!0})}if(e.boxedBeefCutout&&D&&r(e.boxedBeefCutout.reportDate,2)){let{choice:t,choiceChange:n}=e.boxedBeefCutout;b.push({text:"Choice cutout $".concat(Math.round(t),", ").concat(n>0?"up":"down"," $").concat(Math.abs(Math.round(n))," this week."),tier:2,score:52,topic:"boxed-beef-cutout",fresh:!0})}if(!A&&e.feedCost&&D){let{dailyPerCow:t,hayChg:n,elevated:a,low:r}=e.feedCost;0!==n?b.push({text:"Hay ".concat(n>0?"up":"down"," $").concat(Math.abs(n),"/ton, feed cost now ~$").concat(t.toFixed(2),"/cow/day."),tier:2,score:55,topic:"feed-cost",fresh:!0}):a?b.push({text:"Feed cost elevated at ~$".concat(t.toFixed(2),"/cow/day."),tier:2,score:45,topic:"feed-cost",fresh:!1}):r&&b.push({text:"Feed cost low at ~$".concat(t.toFixed(2),"/cow/day."),tier:3,score:25,topic:"feed-cost",fresh:!1})}if(e.dmcMargin&&_){let t=e.dmcMargin.margin-e.dmcMargin.trigger;t<=0?b.push({text:"DMC triggered, milk-feed margin at $".concat(e.dmcMargin.margin.toFixed(2),"/cwt — DMC payment may apply, contact FSA."),tier:1,score:95,topic:"dmc",fresh:!0}
1):t<=2&&b.push({text:"Milk-feed margin $".concat(t.toFixed(2)," above DMC trigger at $").concat(e.dmcMargin.margin.toFixed(2),"/cwt."),tier:2,score:60,topic:"dmc",fresh:!0})}if(e.dairyNowcast&&_){let t=e.dairyNowcast,n=null!=t.class3&&null!=t.class3Monthly&&t.class3Monthly>0?t.class3-t.class3Monthly:null;null!=n&&Math.abs(n)>=.5&&b.push({text:"Class III nowcast $".concat(t.class3.toFixed(2)," — $").concat(Math.abs(n).toFixed(2)," ").concat(n>0?"above":"below"," the monthly final, next print likely ").concat(n>0?"firmer":"softer","."),tier:2,score:58,topic:"dairy-nowcast",fresh:!0})}if(null!=e.foragePctGoodExcellent&&D){let t=e.forageStateAbbr||"State";e.foragePctGoodExcellent<30?b.push({text:"".concat(t," pasture condition at ").concat(e.foragePctGoodExcellent,"% good/excellent."),tier:2,score:48,topic:"pasture",fresh:!0}):e.foragePctGoodExcellent<40&&!(null!=e.foragePriorWeek&&e.foragePriorWeek-e.foragePctGoodExcellent>=5)&&b.push({text:"".concat(t," pasture condition at ").concat(e.foragePctGoodExcellent,"% good/excellent."),tier:3,score:30,topic:"pasture",fresh:!1})}if(e.auctionResult&&D){let{name:t,receipts:n,fiveWtSteerAvg:a}=e.auctionResult;b.push({text:"".concat(t,": ").concat(n>0?n.toLocaleString():"?"," hd, 5-wt steers $").concat(a.toFixed(2),"."),tier:3,score:35,topic:"auction",fresh:!0})}if(e.nassHay){let t=e.nassHay.pctChange>0?"up":"down";b.push({text:"NASS ".concat(e.nassHay.month," prices released, ").concat(e.nassHay.state," alfalfa ").concat(t," ").concat(Math.abs(e.nassHay.pctChange),"% YoY."),tier:3,score:28,topic:"nass",fresh:!0})}if(e.cashGrainBasis&&x){let{cornPnw:t,basis:n}=e.cashGrainBasis;b.push({text:"Cash corn (PNW) $".concat(t.toFixed(2),", basis ").concat(n>0?"+":"","$").concat(n.toFixed(2)," to futures."),tier:3,score:28,topic:"cash-grain",fresh:!0})}if(e.hayComparison&&D){let{userPrice:t,userRegion:n,otherPrice:a,otherRegion:r}=e.hayComparison,o=Math.abs(t-a),l=t>a?"".concat(r," $").concat(a," (").concat(o," cheaper)"):"".concat(r," $").concat(a," (").concat(o," more)");b.push({text:"".concat(n," alfalfa $").concat(t,"/ton, ").concat(l,"."),tier:3,score:25,topic:"hay-compare",fresh:!1})}if(e.screenerProfile){let t=e.screenerProfile;if(t.improvements&&t.improvements.length>0&&e.nextDeadline){let n=e.nextDeadline;if(n.name.toLowerCase().includes("eqip")&&n.daysUntil<=45&&n.daysUntil>0){let e=t.improvements.slice(0,2).join(" and ").replace(/-/g," ");b.push({text:"EQIP batching closes in ".concat(n.daysUntil," days — you told us you need ").concat(e,"."),tier:2,score:72,topic:"screener-eqip",fresh:!0})}}"yes-recent"===t.disasterLosses&&e.droughtLevel>=2&&b.push({text:"With recent disaster losses and D"+e.droughtLevel+" drought, check LFP and ELAP eligibility at FSA.",tier:2,score:65,topic:"screener-disaster",fresh:!0}),"0-3"===t.yearsFarming&&1===new Date().getDay()&&b.push({text:"Beginning farmer advantage: priority ranking on EQIP and up to 90% cost-share rates.",tier:3,score:22,topic:"screener-beginner",fresh:!1})}let P=w&&l[w.n]||"",N=w?u(e,P,S):null,E={lfpWeeks:e.lfpWeeks,priceBucket:N&&w?Math.floor((w.v-N)/10):0};function T(e){return e.fresh&&1===e.tier?1:e.fresh&&2===e.tier?2:e.fresh||1!==e.tier?e.fresh&&3===e.tier?4:e.fresh||2!==e.tier?6:5:3}b.sort((e,t)=>{let n=T(e),a=T(t);return n!==a?n-a:t.score-e.score});let W=b.some(e=>"price-cof-link"===e.topic),j=new Set,O=[];for(let e of b)!j.has(e.topic)&&(W&&"price-primary"===e.topic||(j.add(e.topic),O.push(e)));let I=[...O];if(I.length>7){let e=e=>1===e.tier||2===e.tier&&e.fresh||"price-primary"===e.topic;for(let t of[e=>!e.fresh&&3===e.tier,e=>e.fresh&&3===e.tier,e=>!e.fresh&&2===e.tier&&"price-primary"!==e.topic])for(;I.length>7;){let n=-1;for(let a=I.length-1;a>=0;a--)if(t(I[a])&&!e(I[a])){n=a;break}if(n<0)break;I.splice(n,1)}}return{headline:I.length>0?I[0].text:"",lines:I.slice(1).map(e=>e.text),state:E}}},88245:function(e,t,n){n.d(t,{A:function(){return c},DX:function(){return p},Ln:function(){return i},Mb:function(){return a},PN:function(){return b},Pd:function(){return S},Qk:function(){return k},R6:function(){return l},Tu:function(){return D},UA:function(){return u},V$:function(){return o},W4:function(){return h},Yi:function(){return s},Zo:function(){return v},c3:function(){return d},f$:function(){return y},iS:function(){return g},kC:function(){return f},mb:function(){return r},tW:function(){return w},vz:function(){return m}});let a=864e5,r='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',o=6e3,l=36,i=32,c={Accept:"application/geo+json","User-Agent":"FN/1.0"},s=["","January","February","March","April","May","June","July","August","September","October","November","December"],u=["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],d=["January","February","March","April","May","June","July","August","September","October","November","December"],p=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
1ay","Saturday"],h=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];function g(e){if(!e)return"";try{let t=new Date(e+"T00:00:00");return"".concat(u[t.getMonth()+1]," ").concat(t.getDate())}catch(t){return e}}function m(e){let t=new Date(e+"T00:00:00"),n=new Date(t.getFullYear(),0,0);return Math.floor((t.getTime()-n.getTime())/a)}let y=5,v=48,b={fontSize:13,fontWeight:500,fontFamily:"'DM Sans', sans-serif",letterSpacing:"0.08em",textTransform:"uppercase",color:"#8a7e6b"},w="NOAA \xb7 NWS \xb7 CPC \xb7 USDM \xb7 USGS \xb7 USDA NASS \xb7 USDA AMS \xb7 USDA MPR \xb7 EIA \xb7 CME \xb7 CFTC \xb7 FRED \xb7 FAS \xb7 RMA \xb7 FSA",S={county:"fn_county",prefs:"fn_b",barnId:"fn_barn_id",barnCustom:"fn_barn_custom",version:"fn_v",briefState:"fn_brief_state",deadlinesDone:"fn_deadlines_done",calendarDone:"fn_calendar_done",onboardDone:"fn_onboard_done",contactAgent:"fn_contact_agent",contactExtension:"fn_contact_extension",welcomeDone:"fn_welcome_done",pulseOnboarded:"fn_pulse_onboarded"};function k(e,t){return"fn_dismiss_".concat(e.replace(/\s+/g,"_"),"_").concat(t)}let D={creek:"USGS gauge offline, check back later",creek_none:"No stream gauge nearby",hay_change:"Weekly, updates Tuesday",auction_no_data:"Sale reports update after each auction",auction_none:"No recent auction results within 300 miles",pasture:"Updates weekly during growing season",pasture_paused:"Reporting paused until April",weather_error:"Weather temporarily unavailable",hay_none:"No hay market data for your area",loading:"Loading…",diesel_change:"Weekly, updates Monday",boxed_beef:"Report updates daily by 3 PM ET",cash_cattle:"Cash trade report updates weekly"}},88935:function(e,t,n){n.d(t,{WV:function(){return c},cs:function(){return i}});var a=n(88245),r=JSON.parse('{"Jf":["01-12","02-10","03-10","04-09","05-12","06-11","07-10","08-12","09-11","10-09","11-10","12-09"],"fr":["01-16","02-20","03-20","04-17","05-15","06-19","07-17","08-21","09-18","10-16","11-20","12-18"],"KK":["01-12","02-10","03-10","04-09","05-12","06-11","07-10","08-12","09-11","10-09","11-10","12-09"],"z1":["01-30","07-24"],"pr":["01-22","02-19","03-19","04-23","05-21","06-18","07-23","08-20","09-17","10-22","11-19","12-17"],"vS":[],"V1":[],"sh":["03-27","06-26","09-25","12-23"],"_l":["03-31","06-30","09-30","12-23"],"X_":["03-31"],"lF":["06-30"],"mJ":[],"Co":[]}');let o=r.Jf,l=[{name:"Cattle on Feed",agency:"NASS",dates2026:r.fr,pattern:"3rd Friday",time:"2pm CT",archetypes:["cattle","mixed"],description:"Placements and marketings. Moves feeder cattle futures",major:!0},{name:"WASDE",agency:"ERS",dates2026:o,pattern:"~10th of month",time:"11am CT",archetypes:["cattle","grain","dairy","mixed","swine"],description:"Supply and demand estimates for all major commodities",major:!0},{name:"Crop Production",agency:"NASS",dates2026:r.KK,pattern:"~10th of month",time:"11am CT",archetypes:["grain","mixed"],description:"Yield and production forecasts. Moves corn and soybean futures",major:!0},{name:"Cattle Inventory",agency:"NASS",dates2026:r.z1,pattern:"Late January and late July",time:"2pm CT",archetypes:["cattle","mixed"],description:"Semi-annual herd size. Sets long-term price direction",major:!0},{name:"Milk Production",agency:"NASS",dates2026:r.pr,pattern:"~20th of month",time:"2pm CT",archetypes:["dairy","mixed"],description:"Monthly production by state. Moves Class III milk",major:!0},{name:"Cold Storage",agency:"NASS",dates2026:r.vS,pattern:"~22nd of month",time:"2pm CT",archetypes:["cattle","dairy","mixed","swine"],description:"Beef, pork, and dairy stocks in cold storage",major:!1},{name:"Livestock Slaughter",agency:"NASS",dates2026:r.V1,pattern:"~22nd of month",time:"2pm CT",archetypes:["cattle","mixed","swine"],description:"Head count and weights. Tracks processing pace",major:!1},{name:"Hogs and Pigs",agency:"NASS",dates2026:r.sh,pattern:"Late March, June, September, December",time:"2pm CT",archetypes:["swine"],description:"Quarterly inventory. Breeding herd, market hogs, farrowing intentions",major:!0},{name:"Grain Stocks",agency:"NASS",dates2026:r._l,pattern:"Late March, June, September, December",time:"11am CT",archetypes:["grain","mixed"],description:"Quarterly stocks. Major price mover when stocks surprise",major:!0},{name:"Prospective Plantings",agency:"NASS",dates2026:r.X_,pattern:"Late March",time:"11am CT",archetypes:["grain","mixed"],description:"Intended acreage. Sets planting season price direction",major:!0},{name:"Acreage",agency:"NASS",dates2026:r.lF,pattern:"Late June",time:"11am CT",archetypes:["grain","mixed"],description:"Actual planted acreage. Confirms or surprises planting intentions",major:!0},{name:"Crop Progress",agency:"NASS",dates2026:r.mJ,pattern:"Monday afternoons, Apr–Nov",time:"3pm CT",archetypes:["grain","mixed"],description:"Weekly planting/harvest progress and crop conditions",major:!1},{name:"Dairy Products",agency:"NASS",dates2026:r.Co,pattern:"~5th of month",time:"2pm CT",archetypes:["dairy"],description:"Monthly cheese, butter, and dairy product output",major:!1}];function i(e,t){let n=t||new Date,r=n.getFullYear(),o="".concat(r,"-").concat(String(n.getMonth()+1).padStart(2,"0"),"-").concat(String(n.getDate()).padStart(2,"0")),i=[];for(let t of l){if(!t.archetypes.includes(e))continue;let l=null;for(let e of t.dates2026){let t="".concat(r,"-").concat(e);
1if(t>=o){l=new Date("".concat(t,"T12:00:00"));break}}if(!l&&t.dates2026.length>0){let e=t.dates2026[0];l=new Date("".concat(r+1,"-").concat(e,"T12:00:00"))}if(!l)continue;let c=Math.ceil((l.getTime()-n.getTime())/a.Mb);c>90||i.push({...t,nextDate:l,daysUntil:c})}return i.sort((e,t)=>e.daysUntil-t.daysUntil),i}function c(e,t){let n=t||new Date,a=[],r=[];n.getFullYear();let o="".concat(String(n.getMonth()+1).padStart(2,"0"),"-").concat(String(n.getDate()).padStart(2,"0")),i=new Date(n);i.setDate(i.getDate()-1);let c="".concat(String(i.getMonth()+1).padStart(2,"0"),"-").concat(String(i.getDate()).padStart(2,"0"));for(let t of l)if(t.archetypes.includes(e)&&t.major)for(let e of t.dates2026)e===o&&a.push(t),e===c&&r.push(t);return{today:a,yesterday:r}}},76043:function(e,t,n){n.d(t,{DM:function(){return a},E6:function(){return l},HY:function(){return i},N_:function(){return r},OU:function(){return o},f8:function(){return c},gh:function(){return s}});let a={text:{primary:"#2c2416",dark:"#1c1917",body:"#5a5046",secondary:"#6c6253",tertiary:"#6b5e50",caption:"#78716c",muted:"#a09484",disabled:"#888780",light:"#b4b2a9"},bg:{page:"#faf8f5",pageMobile:"#FDFBF7",card:"#ffffff",subtle:"#f5f0e8"},border:{default:"#e8e0d4",light:"#e7e0d4",input:"#d4c9b8"},brand:{green:"#2d6a4f",greenDark:"#1b4332",greenDeep:"#1b4332",accent:"#a85c04"},status:{up:"#157a5c",down:"#a32d2d",warn:"#b45309",danger:"#dc2626",dangerDark:"#991b1b",dangerText:"#9b2c2c",good:"#2d6a4f",goodBg:"#f0fdf4"},alert:{urgent:{bg:"#fef2f2",border:"#ef4444",color:"#991b1b"},important:{bg:"#fffbeb",border:"#f59e0b",color:"#92400e"},info:{bg:"#f0fdf4",border:"#22c55e",color:"#166534"}},domain:{nrcs:{bg:"#f2f7ee",accent:"#4a7c2e"},fsa:{bg:"#faf6eb",accent:"#b45309"},rma:{bg:"#f0f5fb",accent:"#2b5e94"},disaster:{bg:"#faf2eb",accent:"#b44a2d"}},severity:["#2d6a4f","#ca8a04","#ea580c","#dc2626","#7f1d1d"]},r={xs:4,sm:8,md:12,lg:16,xl:20,xxl:24,xxxl:32},o={sm:4,md:6,lg:8,xl:10,pill:100},l={card:"0 1px 3px rgba(0,0,0,0.06)",cardHover:"0 2px 8px rgba(0,0,0,0.08)",elevated:"0 2px 6px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05)"},i={fast:"0.15s ease",normal:"0.25s ease"},c={text:{primary:"#e8e4df",dark:"#f0ece8",body:"#b0a898",secondary:"#9a9488",tertiary:"#b0a898",caption:"#8a8478",muted:"#706a5e",disabled:"#5a5550",light:"#4a4540"},bg:{page:"#141210",pageMobile:"#141210",card:"#1e1c18",subtle:"#232018"},border:{default:"#2e2a24",light:"#28251f",input:"#3a352e"},brand:{green:"#3d8a6a",greenDark:"#162e22",greenDeep:"#0e1f16",accent:"#e6930a"},status:{up:"#22b885",down:"#d45555",warn:"#d49a1a",danger:"#e04040",dangerDark:"#c03030",dangerText:"#e06060",good:"#3d8a6a",goodBg:"#0f2418"},alert:{urgent:{bg:"#2a1414",border:"#c04040",color:"#e8a0a0"},important:{bg:"#2a2214",border:"#c09020",color:"#e0c070"},info:{bg:"#142a18",border:"#30a050",color:"#90d0a0"}},severity:["#3d8a6a","#d4a41a","#e07030","#e04040","#c03030"],domain:{nrcs:{bg:"#161e12",accent:"#5a9c3e"},fsa:{bg:"#1e1a10",accent:"#d4750a"},rma:{bg:"#121820",accent:"#4a7eb8"},disaster:{bg:"#1e1410",accent:"#d45a3a"}}};function s(e){return e?c:a}},2058:function(e,t,n){n.d(t,{J:function(){return a}});async function a(e,t,n){let a=null;for(let n of[e,t])try{let e=await fetch(n);if(e.ok){a=await e.json();break}}catch(e){}if(!a||!n(a))throw Error("No data");return a}},19485:function(e,t,n){n.d(t,{Z:function(){return o},b:function(){return l}});var a=n(2265),r=n(88245);function o(e,t){let[n,o]=(0,a.useState)([]),[l,i]=(0,a.useState)(!0),c=(0,a.useRef)(null);return(0,a.useEffect)(()=>{if(null===e||null===t){i(!1);return}let n=!1;async function a(){try{let a=new AbortController,l=setTimeout(()=>a.abort(),r.V$),c=await fetch("https://api.weather.gov/alerts/active?point=".concat(e,",").concat(t),{headers:r.A,signal:a.signal});if(clearTimeout(l),!c.ok)throw Error("Alerts API failed");let s=await c.json();if(n)return;let u=s.features||[],d=[];for(let e of u){let t=e.properties,n=String(t.severity||""),a=String(t.urgency||""),r=String(t.certainty||""),o=String(t.event||""),l=String(t.messageType||"");if("Cancel"===l)continue;let i="Severe"===n||"Extreme"===n,c="Immediate"===a||"Expected"===a,s="Future"===a;if(!i&&!c&&!s)continue;let u="Immediate"===a||i&&("Observed"===r||"Likely"===r),p=!u;d.push({event:o,severity:n,headline:String(t.headline||o),expires:String(t.expires||""),instruction:t.instruction?String(t.instruction):null,url:t.web?String(t.web):null,isWarning:u,isWatch:p})}d.sort((e,t)=>
1e.isWarning&&!t.isWarning?-1:!e.isWarning&&t.isWarning?1:0),n||(o(d),i(!1))}catch(e){n||(o([]),i(!1))}}return a(),c.current=setInterval(a,6e5),()=>{n=!0,c.current&&clearInterval(c.current)}},[e,t]),{alerts:n,loading:l}}function l(e){if(!e)return"";let t=new Date(e);if(isNaN(t.getTime()))return"";let n=new Date,a=t.getHours()%12||12,o=t.getHours()>=12?"pm":"am";return t.toDateString()===n.toDateString()?"".concat(a).concat(o):"".concat(a).concat(o," ").concat(r.W4[t.getDay()])}},33847:function(e,t,n){n.d(t,{Pd:function(){return o},Ug:function(){return l},xE:function(){return i}});var a=n(2265),r=n(2058);function o(e,t,n,a){let r=Math.sin((n-e)*Math.PI/180/2)**2+Math.cos(e*Math.PI/180)*Math.cos(n*Math.PI/180)*Math.sin((a-t)*Math.PI/180/2)**2;return 7918*Math.atan2(Math.sqrt(r),Math.sqrt(1-r))}function l(e){let t=e.split("_");return 2!==t.length?e:"".concat(t[0],"00-").concat(t[1],"00")}function i(e,t,n){let[l,i]=(0,a.useState)({markets:[],loading:!0,error:null});return(0,a.useEffect)(()=>{if(null==e||null==t){i({markets:[],loading:!1,error:null});return}let a=!1;return async function(){try{let l=await (0,r.J)("https://raw.githubusercontent.com/jm97275/fn-data/main/auctions.json","/data/auctions.json",e=>Array.isArray(null==e?void 0:e.markets));if(a)return;let c=l.markets.map(a=>{var r;let l=a.lat,i=a.lon;if(null==l||null==i)return null;let c=o(e,t,l,i);return c>300&&a.slug!==n?null:{slug:a.slug,name:a.name,city:a.city,state:a.state,distance:Math.round(c),saleDate:a.sale_date,receipts:a.receipts||0,feederSteers:a.feeder_steers||{},feederHeifers:a.feeder_heifers||{},slaughterCows:a.slaughter_cows?{avg:a.slaughter_cows.avg,head:a.slaughter_cows.head}:null,fiveWtSteerAvg:null!==(r=a.five_wt_steer_avg)&&void 0!==r?r:null}}).filter(e=>null!==e).sort((e,t)=>e.distance-t.distance).filter((e,t)=>t<3||e.slug===n);i({markets:c,loading:!1,error:null})}catch(e){a||i({markets:[],loading:!1,error:"Auction data unavailable"})}}(),()=>{a=!0}},[e,t,n]),l}},74929:function(e,t,n){n.d(t,{a:function(){return l}});var a=n(2265),r=n(2058),o=n(88245);function l(){let[e,t]=(0,a.useState)({choice:null,select:null,spread:null,choiceChange:null,spreadChange:null,reportDate:null,reportDateISO:null,reportDateLabel:"",primals:null,loading:!0,error:null});return(0,a.useEffect)(()=>{let e=!1;return async function(){try{var n,a,l,i,c,s,u,d,p,f;let h=await (0,r.J)("https://raw.githubusercontent.com/jm97275/fn-data/main/boxed_beef.json","/data/boxed_beef.json",e=>(null==e?void 0:e.choice)!=null);if(e)return;let g=h.report_date||"",m="";if(g){let e=new Date(g+"T00:00:00"),t=new Date;m=e.toDateString()===t.toDateString()?"(today)":"(".concat(o.W4[e.getDay()],")")}t({choice:null!==(n=h.choice)&&void 0!==n?n:null,select:null!==(a=h.select)&&void 0!==a?a:null,spread:null!==(l=h.spread)&&void 0!==l?l:null,choiceChange:null!==(i=h.choice_change)&&void 0!==i?i:null,spreadChange:null!==(c=h.spread_change)&&void 0!==c?c:null,reportDate:g?function(e){if(!e)return"";let t=e.split("-");return 3!==t.length?e:"".concat(parseInt(t[1]),"/").concat(parseInt(t[2]),"/").concat(t[0])}(g):null,reportDateISO:g||null,reportDateLabel:m,primals:h.primals?{chuck:null!==(s=h.primals.chuck)&&void 0!==s?s:null,rib:null!==(u=h.primals.rib)&&void 0!==u?u:null,loin:null!==(d=h.primals.loin)&&void 0!==d?d:null,round:null!==(p=h.primals.round)&&void 0!==p?p:null,brisket:null!==(f=h.primals.brisket)&&void 0!==f?f:null}:null,loading:!1,error:null})}catch(n){e||t(e=>({...e,loading:!1,error:"Boxed beef data unavailable"}))}}(),()=>{e=!0}},[]),e}},16097:function(e,t,n){n.d(t,{M:function(){return o}});var a=n(2265),r=n(2058);function o(){let[e,t]=(0,a.useState)({reportDate:"",nationalAvg:0,nationalRange:null,headCount:null,priorWeekAvg:null,stale:!1,loading:!0,error:null});return(0,a.useEffect)(()=>{let e=!1;return async function(){try{let n=await (0,r.J)("https://raw.githubusercontent.com/jm97275/fn-data/main/cash_hog.json","/data/cash_hog.json",e=>!!(null==e?void 0:e.national));if(e)return;let a=n.national,o=n.report_date||"",l=!1;if(o){let e=new Date(o).getTime();l=Date.now()-e>864e6}t({reportDate:o,nationalAvg:a.weighted_avg||0,nationalRange:a.range||null,headCount:a.head_count||null,priorWeekAvg:n.prior_week_avg||null,stale:l,loading:!1,error:null})}catch(n){e||t(e=>({...e,loading:!1,error:"Cash hog data unavailable"}))}}(),()=>{e=!0}},[]),e}},74767:function(e,t,n){n.d(t,{v:function(){return o}});
1var a=n(2265),r=n(2058);function o(){let[e,t]=(0,a.useState)({reportDate:"",liveAvg:0,liveRange:null,dressedAvg:null,dressedRange:null,headCount:null,priorWeekLiveAvg:null,stale:!1,loading:!0,error:null});return(0,a.useEffect)(()=>{let e=!1;return async function(){try{let n=await (0,r.J)("https://raw.githubusercontent.com/jm97275/fn-data/main/cattle_cash.json","/data/cattle_cash.json",e=>!!(null==e?void 0:e.five_area));if(e)return;let a=n.five_area,o=n.report_date||"",l=!1;if(o){let e=new Date(o).getTime();l=Date.now()-e>864e6}t({reportDate:o,liveAvg:a.live_weighted_avg||0,liveRange:a.live_range||null,dressedAvg:a.dressed_weighted_avg||null,dressedRange:a.dressed_range||null,headCount:a.head_count||null,priorWeekLiveAvg:n.prior_week_live_avg||null,stale:l,loading:!1,error:null})}catch(n){e||t(e=>({...e,loading:!1,error:"Cash cattle data unavailable"}))}}(),()=>{e=!0}},[]),e}},46165:function(e,t,n){n.d(t,{R:function(){return l}});var a=n(2265),r=n(2058),o=n(88245);function l(){let[e,t]=(0,a.useState)({reportDate:"",referenceDate:"",onFeed:{head1000:0,yearAgo1000:null,pctYearAgo:null},placements:{month:"",head1000:null,yearAgo1000:null,pctYearAgo:null},marketings:{month:"",head1000:null,yearAgo1000:null,pctYearAgo:null},nextReport:"",daysUntilNext:null,daysSinceReport:0,stale:!1,loading:!0,error:null});return(0,a.useEffect)(()=>{let e=!1;return async function(){try{var n,a,l,i,c,s,u,d,p,f,h,g,m,y,v,b;let w=await (0,r.J)("https://raw.githubusercontent.com/jm97275/fn-data/main/cattle_on_feed.json","/data/cattle_on_feed.json",e=>!!(null==e?void 0:e.on_feed));if(e)return;let S=Date.now(),k=w.report_date?new Date(w.report_date+"T00:00:00").getTime():0,D=w.next_report?new Date(w.next_report+"T00:00:00").getTime():0,x=k?Math.floor((S-k)/o.Mb):999,_=D?Math.ceil((D-S)/o.Mb):null;t({reportDate:w.report_date||"",referenceDate:w.reference_date||"",onFeed:{head1000:w.on_feed.head_1000||0,yearAgo1000:null!==(p=w.on_feed.year_ago_1000)&&void 0!==p?p:null,pctYearAgo:null!==(f=w.on_feed.pct_of_year_ago)&&void 0!==f?f:null},placements:{month:(null===(n=w.placements)||void 0===n?void 0:n.month)||"",head1000:null!==(h=null===(a=w.placements)||void 0===a?void 0:a.head_1000)&&void 0!==h?h:null,yearAgo1000:null!==(g=null===(l=w.placements)||void 0===l?void 0:l.year_ago_1000)&&void 0!==g?g:null,pctYearAgo:null!==(m=null===(i=w.placements)||void 0===i?void 0:i.pct_of_year_ago)&&void 0!==m?m:null},marketings:{month:(null===(c=w.marketings)||void 0===c?void 0:c.month)||"",head1000:null!==(y=null===(s=w.marketings)||void 0===s?void 0:s.head_1000)&&void 0!==y?y:null,yearAgo1000:null!==(v=null===(u=w.marketings)||void 0===u?void 0:u.year_ago_1000)&&void 0!==v?v:null,pctYearAgo:null!==(b=null===(d=w.marketings)||void 0===d?void 0:d.pct_of_year_ago)&&void 0!==b?b:null},nextReport:w.next_report||"",daysUntilNext:_,daysSinceReport:x,stale:x>35,loading:!1,error:null})}catch(n){e||t(e=>({...e,loading:!1,error:"Cattle on Feed data unavailable"}))}}(),()=>{e=!0}},[]),e}},42893:function(e,t,n){n.d(t,{p:function(){return i}});var a=n(2265),r=n(88245);function o(e){try{localStorage.setItem(r.Pd.deadlinesDone,JSON.stringify(e))}catch(e){}}function l(e){let t=new Date;return t.setHours(0,0,0,0),Math.ceil((new Date(e+"T00:00:00").getTime()-t.getTime())/r.Mb)}function i(e){let[t,n]=(0,a.useState)([]),[i,c]=(0,a.useState)([]),[s,u]=(0,a.useState)(!0);(0,a.useEffect)(()=>{c(function(){try{let e=localStorage.getItem(r.Pd.deadlinesDone);return e?JSON.parse(e):[]}catch(e){return[]}}()),fetch("/data/deadlines.json").then(e=>e.json()).then(e=>{n(e),u(!1)}).catch(()=>u(!1))},[]);let d=(0,a.useRef)(!1);(0,a.useEffect)(()=>{if(s||0===t.length||d.current)return;d.current=!0;let e=!1,n=[...i];t.forEach(t=>{"fixed"===t.type&&t.date&&t.checkable&&-14>l(t.date)&&!n.includes(t.id)&&(n.push(t.id),e=!0)}),e&&(o(n),c(n))},[s,t,i]);let p=(0,a.useCallback)(e=>{c(t=>{let n=t.includes(e)?t.filter(t=>t!==e):[...t,e];return o(n),n})},[]),f=(0,a.useMemo)(()=>t.filter(t=>t.archetypes.includes(e)&&!0!==t.expired),[t,e]),h=(0,a.useMemo)(()=>new Set(i),[i]),g=(0,a.useMemo)(()=>f.map(e=>{let t="fixed"===e.type?e.date:"window"===e.type&&e.approxDate||null,n=t?l(t):null;return{...e,dateStr:t,daysUntil:n,past:null!==n&&n<0,done:h.has(e.id)}}),[f,h]),m=(0,a.useMemo)(()=>g.filter(e=>("fixed"===e.type||"window"===e.type)&&!(e.past&&e.daysUntil<-14)).map(e=>({id:e.id,name:e.name,type:e.type,date:e.dateStr,approxLabel:e.approxLabel,daysUntil:e.daysUntil,priority:e.priority,shortContext:e.shortContext,detailLink:e.detailLink,detailLabel:e.detailLabel,checkable:e.checkable,past:e.past,done:e.done})).sort((e,t)=>
1null===e.daysUntil&&null===t.daysUntil?0:null===e.daysUntil?1:null===t.daysUntil?-1:e.daysUntil-t.daysUntil),[g]),y=(0,a.useMemo)(()=>g.filter(e=>"rolling"===e.type).map(e=>({id:e.id,name:e.name,trigger:e.trigger||"",priority:e.priority})),[g]),v=(0,a.useMemo)(()=>g.filter(e=>e.checkable).map(e=>({id:e.id,name:e.name,date:e.dateStr,approxLabel:"window"===e.type?e.approxLabel:void 0,daysUntil:e.daysUntil,done:e.done,past:e.past})).sort((e,t)=>e.done&&!t.done?1:!e.done&&t.done?-1:null===e.daysUntil&&null===t.daysUntil?0:null===e.daysUntil?1:null===t.daysUntil?-1:e.daysUntil-t.daysUntil).slice(0,8),[g]),b=(0,a.useMemo)(()=>{let e=m.find(e=>"fixed"===e.type&&!e.past&&null!==e.daysUntil&&e.daysUntil>=0&&("high"===e.priority||"medium"===e.priority));return!e||e.daysUntil>365?null:{id:e.id,name:e.name,daysUntil:e.daysUntil,dateLabel:(0,r.iS)(e.date),shortContext:e.shortContext,detailLink:e.detailLink,detailLabel:e.detailLabel}},[m]),w=(0,a.useMemo)(()=>{if(b)return null;let e=m.find(e=>"fixed"===e.type&&!e.past&&null!==e.daysUntil&&e.daysUntil>0);return e?{name:e.name,daysUntil:e.daysUntil}:null},[b,m]);return{nextUp:b,nextFarOut:w,timelineItems:m,rollingItems:y,checkableItems:v,toggleDone:p,loading:s}}},89118:function(e,t,n){n.d(t,{O:function(){return o}});var a=n(2265),r=n(2058);function o(){let[e,t]=(0,a.useState)({price:0,date:"",change:0,stale:!1,loading:!0,error:null,history:[],avg5yr:null,yearAgoPrice:null,pctVsAvg:null,pctVsYearAgo:null,wholesale:null});return(0,a.useEffect)(()=>{let e=!1;return async function(){try{let n=await (0,r.J)("https://raw.githubusercontent.com/jm97275/fn-data/main/diesel.json","/data/diesel.json",e=>!!(null==e?void 0:e.current));if(e)return;let a=n.current,o=!1;a.date&&(o=Date.now()-new Date(a.date+"T00:00:00").getTime()>12096e5);let l=Array.isArray(n.history)?n.history:[],i="number"==typeof n.avg5yr?n.avg5yr:null,c="number"==typeof n.yearAgoPrice?n.yearAgoPrice:null,s=a.price||0,u=null,d=n.wholesale_ulsd_nyh;if(d&&"number"==typeof d.price&&d.price>0){let e=d.price,t="number"==typeof d.year_ago_price?d.year_ago_price:null;u={price:e,date:d.date||"",change:"number"==typeof d.change?d.change:0,yearAgoPrice:t,region:d.region||"NY Harbor ULSD",history:Array.isArray(d.history)?d.history:[],pctVsYearAgo:t&&e>0?Math.round((e-t)/t*100):null}}t({price:s,date:a.date||"",change:a.change||0,stale:o,loading:!1,error:null,history:l,avg5yr:i,yearAgoPrice:c,pctVsAvg:i&&s>0?Math.round((s-i)/i*100):null,pctVsYearAgo:c&&s>0?Math.round((s-c)/c*100):null,wholesale:u})}catch(n){e||t(e=>({...e,loading:!1,error:"Diesel data unavailable"}))}}(),()=>{e=!0}},[]),e}},64629:function(e,t,n){n.d(t,{j:function(){return i}});var a=n(2265),r=n(2058);let o={i:"improving",w:"worsening",s:"stable"},l=null;function i(e){let[t,n]=(0,a.useState)({droughtLevel:0,droughtLabel:"None",lfpWeeks:0,weeksInDrought52:0,currentStreak:0,trend:"stable",previousWeekLevel:0,lfpOutOfSeason:!1,grazingStartLabel:null,loading:!0,error:null});return(0,a.useEffect)(()=>{if(!e)return;let t=!1;return async function(){try{var a,i,c,s,u,d,p,f;let h=l&&Date.now()-l.ts<864e5?l.data:null;if(h||(l={data:h=await (0,r.J)("https://raw.githubusercontent.com/jm97275/fn-data/main/drought.json","/data/drought.json",e=>!!(null==e?void 0:e.counties)),ts:Date.now()}),t)return;let g=h.counties[e];if(!g){n(e=>({...e,loading:!1}));return}n({droughtLevel:null!==(a=g.l)&&void 0!==a?a:0,droughtLabel:null!==(i=g.lb)&&void 0!==i?i:"None",lfpWeeks:null!==(c=g.lfp)&&void 0!==c?c:0,weeksInDrought52:null!==(s=g.w52)&&void 0!==s?s:0,currentStreak:null!==(u=g.s)&&void 0!==u?u:0,trend:null!==(d=o[g.t])&&void 0!==d?d:"stable",previousWeekLevel:null!==(p=g.pl)&&void 0!==p?p:0,lfpOutOfSeason:1===g.lfpPre,grazingStartLabel:null!==(f=g.gz)&&void 0!==f?f:null,loading:!1,error:null})}catch(e){t||n(e=>({...e,loading:!1,error:"Drought data unavailable"}))}}(),()=>{t=!0}},[e]),t}},82245:function(e,t,n){n.d(t,{D:function(){return o}});var a=n(2265),r=n(88245);function o(e){let[t,n]=(0,a.useState)({pctGoodExcellent:null,pctGood:null,pctExcellent:null,pctFair:null,pctPoor:null,pctVeryPoor:null,priorYearPct:null,weekEnding:null,seasonalPause:!1,stateAbbr:e,loading:!0,error:null});return(0,a.useEffect)(()=>
1{if(!e){n(e=>({...e,loading:!1}));return}let t=!1;return async function(){try{var a,o,l,i,c,s,u,d,p,f,h;let g=await fetch("https://raw.githubusercontent.com/jm97275/fn-data/main/crop_progress.json");if(!g.ok)throw Error("Failed to fetch forage data");let m=await g.json();if(t)return;let y=null===(a=m.pasture)||void 0===a?void 0:a[e];if(!y){n({pctGoodExcellent:null,pctGood:null,pctExcellent:null,pctFair:null,pctPoor:null,pctVeryPoor:null,priorYearPct:null,weekEnding:null,seasonalPause:!1,stateAbbr:e,loading:!1,error:null});return}let v=null!==(c=null!==(i=y.prior_year_pct_good_excellent)&&void 0!==i?i:null===(l=m.pasture_prior_year)||void 0===l?void 0:null===(o=l[e])||void 0===o?void 0:o.pct_good_excellent)&&void 0!==c?c:null,b=y.week_ending||null,w=!1;b&&(w=(Date.now()-new Date(b+"T00:00:00").getTime())/r.Mb>56),n({pctGoodExcellent:null!==(s=y.pct_good_excellent)&&void 0!==s?s:null,pctGood:null!==(u=y.pct_good)&&void 0!==u?u:null,pctExcellent:null!==(d=y.pct_excellent)&&void 0!==d?d:null,pctFair:null!==(p=y.pct_fair)&&void 0!==p?p:null,pctPoor:null!==(f=y.pct_poor)&&void 0!==f?f:null,pctVeryPoor:null!==(h=y.pct_very_poor)&&void 0!==h?h:null,priorYearPct:v,weekEnding:b,seasonalPause:w,stateAbbr:e,loading:!1,error:null})}catch(a){t||n({pctGoodExcellent:null,pctGood:null,pctExcellent:null,pctFair:null,pctPoor:null,pctVeryPoor:null,priorYearPct:null,weekEnding:null,seasonalPause:!1,stateAbbr:e,loading:!1,error:a instanceof Error?a.message:"Failed"})}}(),()=>{t=!0}},[e]),t}},83636:function(e,t,n){n.d(t,{L6:function(){return d},Wp:function(){return i},f9:function(){return p}});var a=n(2265),r=n(88245);let o="https://data.rcc-acis.org/StnData",l={corn:50,soybeans:50,wheat:40},i=[{gdd:200,label:"Emergence"},{gdd:800,label:"V6 (knee-high)"},{gdd:1400,label:"Tassel"},{gdd:2200,label:"Dent"},{gdd:2700,label:"Maturity"}],c={},s={};function u(e){return 4===e.length&&"K"===e.charAt(0)?"".concat(e," 5"):e}function d(e,t){let[n,r]=(0,a.useState)(null);return(0,a.useEffect)(()=>{if(!e||"grain"!==t&&"mixed"!==t)return;let n="gdd-".concat(e),a=c[n];if(a&&Date.now()-a.ts<864e5){r(a.data);return}let i=!1;return async function(){try{let a=new Date,s=a.getFullYear(),d="".concat(s,"-").concat("04-15"),p=a.toISOString().slice(0,10);if(p<d)return;let f=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sid:u(e),sdate:d,edate:p,elems:[{name:"maxt"},{name:"mint"}]})});if(!f.ok||i)return;let h=await f.json(),g=(null==h?void 0:h.data)||[];if(0===g.length)return;let m=l["mixed"===t?"corn":t]||50,y=0,v=0;for(let[,e,t]of g){let n=parseFloat(e),a=parseFloat(t);if(isNaN(n)||isNaN(a))continue;let r=Math.max(0,(n+a)/2-m);y+=r,v=r}let b={accumulatedGDD:Math.round(y),todayGDD:Math.round(v),daysSincePlanting:g.length,tBase:m,loading:!1};i||(c[n]={data:b,ts:Date.now()},r(b))}catch(e){}}(),()=>{i=!0}},[e,t]),n}function p(e){let[t,n]=(0,a.useState)(null);return(0,a.useEffect)(()=>{if(!e)return;let t="frost-".concat(e),a=s[t];if(a&&Date.now()-a.ts<864e5){n(a.data);return}let l=!1;return async function(){try{let a=new Date().getFullYear(),i=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sid:u(e),sdate:"".concat(a-10,"-01-01"),edate:"".concat(a,"-12-31"),elems:[{name:"mint"}]})});if(!i.ok||l)return;let c=await i.json(),d=(null==c?void 0:c.data)||[];if(0===d.length)return;let p={};for(let[e,t]of d){let n=parseFloat(t);if(isNaN(n))continue;let a=parseInt(e.substring(0,4));p[a]||(p[a]=[]),p[a].push([e,n])}let f=[],h=[];for(let[e,t]of Object.entries(p)){let n=parseInt(e),a=-1,o=-1;for(let[e,l]of t){let t=new Date(e+"T12:00:00"),i=Math.floor((t.getTime()-new Date(n,0,1).getTime())/r.Mb)+1;l<=32&&(i<182&&(a=i),i>=182&&-1===o&&(o=i))}a>0&&f.push(a),o>0&&h.push(o)}if(0===f.length&&0===h.length)return;let g=f.length>0?Math.round(f.reduce((e,t)=>e+t,0)/f.length):null,m=h.length>0?Math.round(h.reduce((e,t)=>e+t,0)/h.length):null,y=new Date,v=y.getFullYear(),b=Math.floor((y.getTime()-new Date(v,0,1).getTime())/r.Mb)+1,w=e=>{let t=new Date(v,0,e);return"".concat(r.c3[t.getMonth()]," ").concat(t.getDate())},S={avgLastSpringFrost:g?w(g):"",avgFirstFallFrost:m?w(m):"",daysFromLastFrost:g?b-g:0,daysToFirstFrost:m?m-b:0,loading:!1};l||(s[t]={data:S,ts:Date.now()},n(S))}catch(e){}}(),()=>{l=!0}},[e]),t}},81559:function(e,t,n){n.d(t,{Hu:function(){return d},Ki:function(){return s},Mu:function(){return c}});
1var a=n(2265),r=n(2058);let o=null,l=0,i=null;function c(){return i||(i=(0,r.J)("https://raw.githubusercontent.com/jm97275/fn-data/main/input_prices.json","/data/input_prices.json",e=>!!(null==e?void 0:e.input_prices)&&"object"==typeof e.input_prices).catch(e=>{throw i=null,e}))}function s(){let[e,t]=(0,a.useState)(o),[n,r]=(0,a.useState)(!o);return(0,a.useEffect)(()=>{if(o&&Date.now()-l<864e5){t(o),r(!1);return}let e=!1;return async function(){try{let n=await c();if(e)return;let a={updated:n.last_fetched||"",items:n.input_prices};o=a,l=Date.now(),t(a),r(!1)}catch(t){e||r(!1)}}(),()=>{e=!0}},[]),{data:e,loading:n}}let u=new Set(["hay_alfalfa","hay_other"]);function d(e,t){let n=Object.entries(e).filter(e=>{let[t]=e;return!u.has(t)});return t?n.filter(e=>{let[,n]=e;return n.archetypes.includes(t)}):n}},40066:function(e,t,n){n.d(t,{I:function(){return l}});var a=n(2265),r=n(2058),o=n(88245);function l(){let[e,t]=(0,a.useState)({composite:null,compositeChange:null,reportDate:null,reportDateLabel:"",primals:null,loading:!0,error:null});return(0,a.useEffect)(()=>{let e=!1;return async function(){try{var n,a,l,i,c,s,u,d;let p=await (0,r.J)("https://raw.githubusercontent.com/jm97275/fn-data/main/pork_cutout.json","/data/pork_cutout.json",e=>(null==e?void 0:e.composite)!=null);if(e)return;let f=p.report_date||"",h="";if(f){let e=new Date(f+"T00:00:00"),t=new Date;h=e.toDateString()===t.toDateString()?"(today)":"(".concat(o.W4[e.getDay()],")")}t({composite:null!==(n=p.composite)&&void 0!==n?n:null,compositeChange:null!==(a=p.composite_change)&&void 0!==a?a:null,reportDate:f||null,reportDateLabel:h,primals:p.primals?{loin:null!==(l=p.primals.loin)&&void 0!==l?l:null,butt:null!==(i=p.primals.butt)&&void 0!==i?i:null,picnic:null!==(c=p.primals.picnic)&&void 0!==c?c:null,rib:null!==(s=p.primals.rib)&&void 0!==s?s:null,ham:null!==(u=p.primals.ham)&&void 0!==u?u:null,belly:null!==(d=p.primals.belly)&&void 0!==d?d:null}:null,loading:!1,error:null})}catch(n){e||t(e=>({...e,loading:!1,error:"Pork cutout data unavailable"}))}}(),()=>{e=!0}},[]),e}},54784:function(e,t,n){n.d(t,{e:function(){return i}});var a=n(2265),r=n(88245);let o="https://data.rcc-acis.org/GridData",l=["January","February","March","April","May","June","July","August","September","October","November","December"];function i(e,t){let[n,i]=(0,a.useState)({monthToDate:0,monthNormal:0,proRatedNormal:0,percentOfNormal:0,status:"normal",monthName:l[new Date().getMonth()],seasonalTotal:null,seasonalNormal:null,seasonalDeparture:null,loading:!0,error:null}),c=(0,a.useRef)(!0);return(0,a.useEffect)(()=>{if(null===e||null===t)return;let n=!1,a=setTimeout(()=>{!n&&c.current&&(i(e=>({...e,loading:!1,error:"Precip data unavailable"})),c.current=!1)},r.V$);return async function(){try{let a=new Date,r=a.getFullYear(),s=a.getMonth()+1,u=a.getDate(),d=String(s).padStart(2,"0"),p=String(u).padStart(2,"0"),f="".concat(t,",").concat(e),h=s>=10?r:r-1,g="".concat(r,"-").concat(d,"-").concat(p),m=[fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({loc:f,grid:"1",sdate:"".concat(r,"-").concat(d,"-01"),edate:"".concat(r,"-").concat(d,"-").concat(p),elems:[{name:"pcpn",interval:"dly",duration:"dly"}]})}),fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({loc:f,grid:"1",sdate:"".concat(r,"-").concat(d),edate:"".concat(r,"-").concat(d),elems:[{name:"pcpn",interval:"mly",duration:"mly",normal:"1"}]})}),fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({loc:f,grid:"1",sdate:"".concat(h,"-10-01"),edate:g,elems:[{name:"pcpn",interval:"dly",duration:"dly"}]})}),fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({loc:f,grid:"1",sdate:"".concat(h,"-10"),edate:"".concat(r,"-").concat(d),elems:[{name:"pcpn",interval:"mly",duration:"mly",normal:"1"}]})})],[y,v,b,w]=await Promise.all(m);if(!y.ok||!v.ok)throw Error("ACIS request failed");if(n)return;let S=await y.json(),k=await v.json(),D=e=>{let t=0,n=null==e?void 0:e.data;if(Array.isArray(n))for(let e of n){let n=e[1];if("M"===n||void 0===n)continue;if("T"===n){t+=.001;continue}let a=parseFloat(n);!isNaN(a)&&a>=0&&(t+=a)}return t},x=D(S),_=0,M=null==k?void 0:k.data;if(Array.isArray(M)&&M.length>0){let e=M[0][1];if("M"!==e&&void 0!==e){let t=parseFloat(e);isNaN(t)||(_=t)}}let F=new Date(r,s,0).getDate(),C=u/F*_,A=C>=.1,L=A?Math.min(Math.round(x/C*100),400):0,P=null,N=null,E=null;try{if(b.ok&&w.ok){let e=await b.json(),t=await w.json();
1P=Math.round(100*D(e))/100;let n=0,a=null==t?void 0:t.data;if(Array.isArray(a))for(let e=0;e<a.length;e++){let t=a[e][1];if("M"===t||void 0===t)continue;let r=parseFloat(t);isNaN(r)||(e===a.length-1?n+=u/F*r:n+=r)}N=Math.round(100*n)/100,E=Math.round((P-N)*100)/100}}catch(e){}n||(c.current=!1,i({monthToDate:Math.round(100*x)/100,monthNormal:A?Math.round(100*_)/100:0,proRatedNormal:Math.round(100*C)/100,percentOfNormal:L,status:L>=120?"wet":L>=80?"normal":L>=50?"dry":"very-dry",monthName:l[s-1],seasonalTotal:P,seasonalNormal:N,seasonalDeparture:E,loading:!1,error:null}))}catch(e){n||(c.current=!1,i(e=>({...e,loading:!1,error:"Precip data unavailable"})))}}(),()=>{n=!0,clearTimeout(a)}},[e,t]),n}},86574:function(e,t,n){n.d(t,{h:function(){return l}});var a=n(2265),r=n(81559);let o={feeder_cattle:!0,live_cattle:!0,corn:!0,soybeans:!0,wheat:!0,class3_milk:!0,cotton:!0,rice:!0,lean_hogs:!0,class4_milk:!0};function l(){var e;let[t,n]=(0,a.useState)(null),[l,i]=(0,a.useState)(null),[c,s]=(0,a.useState)(!0),[u,d]=(0,a.useState)(null);(0,a.useEffect)(()=>{let e=!1;return async function(){try{let[t,a,o]=await Promise.all([fetch("https://raw.githubusercontent.com/jm97275/fn-data/main/prices.json"),fetch("/data/seasonal-averages.json").catch(()=>null),(0,r.Mu)().catch(()=>null)]);if(!t.ok)throw Error("Fetch failed");let l=await t.json();if(!l.live||!l.archetypes)throw Error("Invalid data");let c=null;if(null==a?void 0:a.ok)try{c=await a.json()}catch(e){}(null==o?void 0:o.input_prices)&&(l.input_prices=o.input_prices),e||(n(l),i(c),s(!1))}catch(t){e||(d(t instanceof Error?t.message:"Unknown error"),s(!1))}}(),()=>{e=!0}},[]);let p=String(new Date().getMonth()+1).padStart(2,"0"),f={},h={};if(null==t?void 0:t.monthly_averages)for(let[e,n]of Object.entries(t.monthly_averages)){let t=n[p];"number"==typeof t&&(f[e]=t)}if(l){for(let[e,t]of Object.entries(l)){if(e.startsWith("_")||"prior_year"===e)continue;let n=t[p];"number"==typeof n&&(f[e]=n)}let e=l.prior_year;if(e&&"object"==typeof e)for(let[t,n]of Object.entries(e))t.startsWith("_")||"number"!=typeof n||(h[t]=n)}let g={};if((null==t?void 0:t.history)&&t.history.length>=2){let e=t.history[t.history.length-1];for(let n of Object.keys(o)){let a=n+"_vol",r=e[a];if("number"!=typeof r||r<=0)continue;let o=t.history.slice(0,-1).map(e=>e[a]).filter(e=>"number"==typeof e&&e>0);if(0===o.length)continue;let l=o.reduce((e,t)=>e+t,0)/o.length;r>1.5*l?g[n]="heavy":r<.5*l?g[n]="light":g[n]="normal"}}return{prices:t,loading:c,error:u,lastUpdated:null!==(e=null==t?void 0:t.updated)&&void 0!==e?e:null,seasonalAvg:f,priorYear:h,volumeContext:g}}},68142:function(e,t,n){n.d(t,{Q:function(){return r}});var a=n(2265);function r(e,t,n,r){let[o,l]=(0,a.useState)({gaugeName:null,gaugeId:null,currentCfs:null,weekAgoCfs:null,changePct:null,sparkData:[],loading:!0,error:null});return(0,a.useEffect)(()=>{if(null===e||null===t)return;let a=!1;return async function(){try{let i=n||null,c=r||null;if(!i){let n="".concat(t-.5,",").concat(e-.5,",").concat(t+.5,",").concat(e+.5),a=await fetch("https://waterservices.usgs.gov/nwis/iv/?format=json&parameterCd=00060&bBox=".concat(n,"&siteType=ST&siteStatus=active"));if(a.ok){var o;let n=await a.json(),r=null===(o=n.value)||void 0===o?void 0:o.timeSeries;if((null==r?void 0:r.length)>0){let n=null,a=999;r.forEach(r=>{var o;let l=r.sourceInfo,i=null===(o=l.geoLocation)||void 0===o?void 0:o.geogLocation;if(i){let r=Math.sqrt(Math.pow(i.latitude-e,2)+Math.pow(i.longitude-t,2));r<a&&(a=r,n={id:l.siteCode[0].value,name:l.siteName})}}),n&&(i=n.id,c=n.name)}}}if(!i){a||l(e=>({...e,loading:!1,error:"no-gauge"}));return}let s=await fetch("https://waterservices.usgs.gov/nwis/iv/?sites=".concat(i,"&parameterCd=00060&format=json&period=P7D"));if(!s.ok)throw Error("USGS fetch failed");let u=(await s.json()).value.timeSeries[0].values[0].value,d=parseFloat(u[u.length-1].value);if(d<=-999990||isNaN(d))throw Error("Invalid data");let p=u[0]?parseFloat(u[0].value):null,f=null!==p&&p>-999990?p:null,h=Math.max(1,Math.floor(u.length/28)),g=[];for(let e=0;e<u.length;e+=h){let t=parseFloat(u[e].value);t>-999990&&g.push(t)}g.length>0&&g[g.length-1]!==d&&g.push(d),a||l({gaugeName:function(e){if(!e)return"Stream Level";
1let t={Pr:"Prairie",Twn:"Town",Fk:"Fork",Rv:"River",Nr:"near",nr:"near",Cr:"Creek",Br:"Branch",Ck:"Creek",Lk:"Lake",Mt:"Mount",Mtn:"Mountain",Spg:"Spring",Spgs:"Springs",Trib:"Tributary",Blw:"Below",Abv:"Above",St:"Saint",Ft:"Fort",NF:"North Fork",SF:"South Fork",EF:"East Fork",WF:"West Fork",MF:"Middle Fork",Ltt:"Little",Bg:"Big",R:"River",Bl:"Below",Ab:"Above",W:"West",E:"East",N:"North",S:"South"},n=e.split(" ").map(e=>t[e]||e).join(" ");return(n=(n=(n=n.toLowerCase().replace(/\b\w/g,e=>e.toUpperCase())).replace(/,?\s+[A-Z]{2}\s+[A-Z0-9]+$/,"")).replace(/,?\s+[A-Z]{2}$/,"")).length>40&&(n=n.substring(0,38)+"…"),n}(c||""),gaugeId:i,currentCfs:d,weekAgoCfs:f,changePct:f?(d-f)/f*100:null,sparkData:g,loading:!1,error:null})}catch(e){a||l(e=>({...e,loading:!1,error:"Stream data unavailable"}))}}(),()=>{a=!0}},[e,t,n,r]),o}},68647:function(e,t,n){n.d(t,{j:function(){return l}});var a=n(2265);let r={feeder_cattle:"feeder_cattle",live_cattle:"live_cattle",corn:"corn",soybeans:"soybeans",wheat:"wheat",class3_milk:"class_iii_milk"},o=new Set(["class3_milk"]);function l(e){let[t,n]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let e=!1;return fetch("https://raw.githubusercontent.com/jm97275/fn-data/main/price_history.json").then(e=>e.json()).then(t=>{e||n(t)}).catch(()=>{}),()=>{e=!0}},[]),(0,a.useMemo)(()=>{let n={};if(!t||!e)return n;for(let[l,i]of Object.entries(r)){var a;let r=t.commodities[i];if(!r||r.data.length<62)continue;let c=e[l];if(!c)continue;let s=r.data.map(e=>e.close),u=function(e,t){if(e.length<61)return 0;let n=e.slice(-61),a=[];for(let e=1;e<n.length;e++)0!==n[e-1]&&a.push((n[e]-n[e-1])/n[e-1]);if(a.length<10)return 0;let r=a.reduce((e,t)=>e+t,0)/a.length;return Math.sqrt(a.reduce((e,t)=>e+(t-r)**2,0)/(a.length-1))}(s,0);if(0===u)continue;let d=s[s.length-1];if(0===d)continue;let p=Math.abs(c.change/d)/u,f=r.data[r.data.length-1],h=null!==(a=null==f?void 0:f.volume)&&void 0!==a?a:null,g=o.has(l)&&null!==h&&h<50;n[l]={sigma:u,zScore:p,isNotable:p>1.5&&!g,isBigMove:p>2&&!g,volume:h,isThinMarket:g}}return n},[t,e])}},87345:function(e,t,n){n.d(t,{F:function(){return l}});var a=n(2265),r=n(88245);let o=["2026-01-12","2026-02-10","2026-03-10","2026-04-09","2026-05-12","2026-06-11","2026-07-10","2026-08-12","2026-09-11","2026-10-09","2026-11-10","2026-12-09"];function l(e){return(0,a.useMemo)(()=>{var t,n,a,l,i,c,s,u,d;let p=function(){let e=new Date;return"".concat(e.getFullYear(),"-").concat(String(e.getMonth()+1).padStart(2,"0"),"-").concat(String(e.getDate()).padStart(2,"0"))}(),f=function(){let e=new Date;return e.setDate(e.getDate()+1),"".concat(e.getFullYear(),"-").concat(String(e.getMonth()+1).padStart(2,"0"),"-").concat(String(e.getDate()).padStart(2,"0"))}(),h=function(e){for(let t of o)if(t>=e)return t;return null}(p),g=o.includes(p),m=h===f,y={data:null,isNewReport:!1,isYesterday:!1,nextReportDate:h,isReportTomorrow:m,isReportToday:g,loading:!e};if(!e||!e.wasde)return y;let v=e.wasde,b=v.report_date;if(!b)return{...y,loading:!1};let w=new Date(b+"T12:00:00").getTime(),S=(Date.now()-w)/36e5,k=S>=0&&S<r.Zo,D=k&&b!==p&&S>=24;return{data:{reportDate:b,cattle:v.cattle?{beefProduction:v.cattle.beef_production,beefProductionNote:null!==(t=v.cattle.beef_production_note)&&void 0!==t?t:null,beefProductionDirection:v.cattle.beef_production_direction,steerPrices:null!=v.cattle.steer_prices_q1||null!=v.cattle.steer_prices_q2?{q1:v.cattle.steer_prices_q1,q2:v.cattle.steer_prices_q2,q3:v.cattle.steer_prices_q3,q4:v.cattle.steer_prices_q4}:null,beefImportsChange:null!==(n=v.cattle.beef_imports_change)&&void 0!==n?n:null,beefImportsDirection:null!==(a=v.cattle.beef_imports_direction)&&void 0!==a?a:null,beefExportsChange:null!==(l=v.cattle.beef_exports_change)&&void 0!==l?l:null,beefExportsDirection:null!==(i=v.cattle.beef_exports_direction)&&void 0!==i?i:null}:null,grain:v.grain?{cornEndingStocks:v.grain.corn_ending_stocks,cornEndingStocksChange:v.grain.corn_ending_stocks_change,cornEndingStocksDirection:v.grain.corn_ending_stocks_direction,soyEndingStocks:v.grain.soy_ending_stocks,soyEndingStocksChange:v.grain.soy_ending_stocks_change,soyEndingStocksDirection:v.grain.soy_ending_stocks_direction,wheatEndingStocks:v.grain.wheat_ending_stocks,wheatEndingStocksChange:v.grain.wheat_ending_stocks_change,wheatEndingStocksDirection:v.grain.wheat_ending_stocks_direction,cornSeasonAvgPrice:null!==(c=v.grain.corn_season_avg_price)&&void 0!==c?c:null,soyImportsChange:null!==(s=v.grain.soy_
1imports_change)&&void 0!==s?s:null,soyCrushChange:null!==(u=v.grain.soy_crush_change)&&void 0!==u?u:null}:null,dairy:v.dairy?{milkProduction:null!==(d=v.dairy.milk_production)&&void 0!==d?d:null,milkProductionChange:v.dairy.milk_production_change,milkProductionDirection:v.dairy.milk_production_direction}:null},isNewReport:k,isYesterday:D,nextReportDate:h,isReportTomorrow:m,isReportToday:g,loading:!1}},[e])}},38561:function(e,t,n){n.d(t,{GE:function(){return i}});var a=n(2265),r=n(88245),o=n(56794);async function l(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2e3,r=await fetch(e,t);return!r.ok&&n>0?(await new Promise(e=>setTimeout(e,a)),fetch(e,t)):r}function i(e,t,n){let[i,c]=(0,a.useState)(null),[s,u]=(0,a.useState)(null),[d,p]=(0,a.useState)(!0),[f,h]=(0,a.useState)(null),[g,m]=(0,a.useState)(null!=n?n:null),[y,v]=(0,a.useState)(null),b=(0,a.useRef)(!0);return(0,a.useEffect)(()=>{if(null===e||null===t)return;let a=!1,i=setTimeout(()=>{!a&&b.current&&(h("Weather unavailable. Check back shortly."),p(!1),b.current=!1)},r.V$);return async function(){try{var s,d,f,g;let h=await l("https://api.weather.gov/points/".concat(e,",").concat(t),{headers:r.A});if(!h.ok)throw Error("Points API failed");let y=await h.json(),[w,S]=await Promise.all([fetch(y.properties.forecast,{headers:r.A}),fetch(y.properties.forecastHourly,{headers:r.A})]);if(!w.ok)throw Error("Forecast API failed");let k=(await w.json()).properties.periods,D=[],x=[];if(S.ok&&(D=(x=(await S.json()).properties.periods.slice(0,48)).map(e=>e.temperature)),a)return;let _={periods:k,hourlyTemps:D,hourlyPeriods:x,dailyRain:[]};u(_);try{let e=y.properties.forecastGridData;e&&fetch(e,{headers:r.A}).then(async e=>{var t,n;if(!e.ok||a)return;let l=await e.json(),i=null===(n=l.properties)||void 0===n?void 0:null===(t=n.quantitativePrecipitation)||void 0===t?void 0:t.values;if(Array.isArray(i)&&i.length>0){let e={};for(let t of i)if(t.value&&t.value>0&&t.validTime){let n=r.kC[(0,o.cl)(t.validTime.split("/")[0])];e[n]=(e[n]||0)+t.value/25.4}let t=Object.entries(e).filter(e=>{let[,t]=e;return t>.05}).map(e=>{let[t,n]=e;return{day:t,inches:Math.round(10*n)/10}});a||u(e=>e?{...e,dailyRain:t}:e)}}).catch(()=>{})}catch(e){}let M=D.length>0?D[0]:null;c({temp:M,lastRain:null,obsStation:n||null,windSpeed:null,windDir:null}),p(!1),b.current=!1,clearTimeout(i);let F=n||null,C=null;if(!F)try{let e=y.properties.observationStations;if(e){let t=await fetch(e,{headers:r.A});if(t.ok){let e=await t.json();if((null===(s=e.features)||void 0===s?void 0:s.length)>0){F=e.features[0].properties.stationIdentifier,C=e.features[0].properties.name||null;for(let t=0;t<Math.min(e.features.length,10);t++){let n=e.features[t].properties.stationIdentifier;if((null==n?void 0:n.length)===4&&"K"===n.charAt(0)){F=n,C=e.features[t].properties.name||null;break}}}}}}catch(e){}if(a)return;if(F&&m(F),C&&v(C),F)try{let e=await fetch("https://api.weather.gov/stations/".concat(F,"/observations?limit=168"),{headers:r.A});if(e.ok){let t=(await e.json()).features||[],n=null,o=null;t.length>0&&(null===(d=t[0].properties.temperature)||void 0===d?void 0:d.value)!==null&&(n=Math.round(9*t[0].properties.temperature.value/5+32));let l=Date.now();for(let e=0;e<t.length;e++){let n=t[e].properties.precipitationLastHour;if((null==n?void 0:n.value)&&n.value>0){let a=new Date(t[e].properties.timestamp),i=Math.round((l-a.getTime())/r.Mb),c=(n.value/25.4).toFixed(2);o="Last rain: ".concat(i," day").concat(i>1?"s":""," ago (").concat(c,'")');break}}!o&&t.length>0&&(o="No measurable rain in past 7 days");let i=null,s=null;if(t.length>0){let e=null===(f=t[0].properties.windSpeed)||void 0===f?void 0:f.value;null!=e&&(i=Math.round(e/1.609));let n=null===(g=t[0].properties.windDirection)||void 0===g?void 0:g.value;null!=n&&(s=["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.round(n/22.5)%16])}a||c({temp:null!=n?n:M,lastRain:o,obsStation:F,windSpeed:i,windDir:s})}}catch(e){}}catch(e){!a&&b.current&&(h(e instanceof Error?e.message:"Weather unavailable"),p(!1),b.current=!1)}}(),()=>{a=!0,clearTimeout(i)}},[e,t,n]),{current:i,forecast:s,loading:d,error:f,discoveredStation:g,discoveredStationName:y}}},56794:function(e,t,n){function a(e){let t=e.match(/(\d{4})-(\d{2})-(\d{2})/);return t?new Date(+t[1],+t[2]-1,+t[3]).getDay():0}function r(e){let t=function(e){let t=e.match(/([+-])(\d{2}):(\d{2})$/);return t?("+"===t[1]?1:-1)*(60*parseInt(t[2],10)+parseInt(t[3],10)):-new Date().getTimezoneOffset()}(e),n=new Date;return new Date(n.getTime()+6e4*n.getTimezoneOffset()+6e4*t).getHours()}n.d(t,{O2:function(){return r},cl:function(){return a}})},15984:function(e,t,n){n.d(t,{YH:function(){return r},_e:function(){return o},nL:function(){return a},yQ:function(){return l}}),n(88245);let a=4,r=2.5;function o(e){let t=.013*e,n=t+.8;return{dailyPerCow:n,monthly:30*n,components:{hayDaily:t,supplementDaily:.8,hayLbs:26,supplementLbs:2,hayPricePerTon:e}}}let l=9.5},43802:function(e,t,n){n.d(t,{o:function(){return s}});var a=n(88245);let r={Sunday:"Sun",Monday:"Mon",Tuesday:"Tue",Wednesday:"Wed",Thursday:"Thu",Friday:"Fri",Saturday:"Sat",Today:"Today",Tonight:"Tonight"};function o(e){return r[e]||e.slice(0,3)}function l(e){if(!e)return"";let t=e.toLowerCase();return t.includes("snow")?"Snow":t.includes("thunder")?"Strm":t.includes("rain")||t.includes("shower")?"Rain":t.includes("fog")?"Fog":t.includes("sun")||t.includes("clear")?"Clr":t.includes("partly")?"PtCl":t.includes("mostly cloud")?"MsCl":t.includes("cloud")||t.includes("overcast")?"Cldy":""}function i(e){let t=(e||"").toLowerCase();return t.includes("rain")||t.includes("shower")||t.includes("storm")}function c(e){var t,n;
1return null!==(n=null==e?void 0:null===(t=e.probabilityOfPrecipitation)||void 0===t?void 0:t.value)&&void 0!==n?n:0}function s(e){let t=e.periods,n=[],r=0;for(;r<t.length&&n.length<7;){let e=t[r];if(e.isDaytime){var s,u;let d=t[r+1]&&!t[r+1].isDaytime?t[r+1]:null,p=Math.max(c(e),c(d)),f=null!==(u=null==d?void 0:d.temperature)&&void 0!==u?u:null,h=0===n.length?"Today":(null===(s=e.name)||void 0===s?void 0:s.split(" ")[0])||"",g=e.shortForecast||"";n.push({dayName:h,shortName:o(h),hi:e.temperature,lo:f,condition:g,conditionShort:l(g),precipChance:p,precipInches:0,isFrost:null!==f&&f<=a.R6,isRain:p>30||i(g)||!!d&&i(d.shortForecast||""),dayPeriod:e,nightPeriod:d}),r+=d?2:1}else{let t=e.temperature,s=0===n.length?"Tonight":(e.name||"").replace(/ Night$/i,"")||"",u=e.shortForecast||"";n.push({dayName:s,shortName:o(s),hi:null,lo:t,condition:u,conditionShort:l(u),precipChance:c(e),precipInches:0,isFrost:null!==t&&t<=a.R6,isRain:c(e)>30||i(u),dayPeriod:null,nightPeriod:e}),r++}}if(e.dailyRain&&e.dailyRain.length>0)for(let t of e.dailyRain){let e=n.find(e=>{var n,a,r,o;let l=(null===(a=e.dayPeriod)||void 0===a?void 0:null===(n=a.name)||void 0===n?void 0:n.split(" ")[0])||(null===(o=e.nightPeriod)||void 0===o?void 0:null===(r=o.name)||void 0===r?void 0:r.replace(/ Night$/i,""))||"";return t.day===e.dayName||t.day===l});e&&(e.precipInches=t.inches)}let d=[],p=[],f=[],h=[],g=null,m=0;for(let e of n){if(e.isFrost){let t="Tonight"===e.dayName?"tonight":e.dayName;d.push(t),p.push(e.shortName),null!==e.lo&&(null===g||e.lo<g)&&(g=e.lo)}e.isRain&&(f.push(e.dayName),h.push(e.shortName)),m+=e.precipInches}let y=t.slice(0,4).some(e=>c(e)>30||i(e.shortForecast||"")),v=null;1===f.length?v="Rain likely ".concat(h[0],", otherwise dry through the week."):2===f.length?v="Rain likely ".concat(h[0]," and ").concat(h[1],"."):f.length>=5?v="Wet week ahead.":f.length>=3&&(v="Wet week ahead. Rain ".concat(h.slice(0,3).join(", "),"."));let b=n.filter(e=>e.isRain).length,w=n.length-b;return{days:n,frostDays:d,frostDaysShort:p,rainDays:f,rainDaysShort:h,rainLine:v,totalPrecipInches:Math.round(10*m)/10,dryDayCount:w,rainDayCount:b,hasFrost:d.length>0,hasRain:y,frostLow:g}}}}]);

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.