PageSourceSearch

https://deliverimates-production.up.railway.app/assets/Signins-d7b5yB8A.js

js deliverimates-production.up.railway.app collected 2026-10-03 12:12:07 UTC 80,056 bytes, 1 lines download raw bytes

1import{c as $n,ao as ne,ap as fe,aq as ot,ar as Rn,as as we,at as Et,au as Hn,av as y,r as C,j as r,a as Le,aw as mt,aa as _t,ax as zn,q as Pe,ay as Gn,a8 as Un,l as It,ad as qn,ae as Ln,af as Vn,ag as Zn,ah as Ve,E as Kn,o as Qn,s as Jn,t as Xn,z as Bt,y as es,a0 as ts,I as ns,L as Ae,D as ss,v as os,a9 as as,B as ee,az as rs,R as Ze,aA as is,aB as ls,aC as Ke,aD as cs,U as ds,T as ht}from"./index-Db4qfLtJ.js";import{e as us}from"./export-csv-C1JN8RIJ.js";import{f as L,d as Ft,g as Yt,a as At,i as fs,s as ms,b as hs,c as ys,e as ps}from"./format-DyStx0k9.js";import{a as Pt}from"./addDays-DVRwNnth.js";import{i as gs}from"./isBefore-DJne7ejd.js";import{i as vs}from"./isSameDay-CrZ4fZLw.js";import{C as xs}from"./chevron-left-J4GbtB-v.js";import{C as bs}from"./chevron-right-D4zIy9sL.js";import{T as ks,a as Ms,b as Qe,c as le,d as Ds,e as ae}from"./table-CDUJ619m.js";import{B as de}from"./badge-B13RZfEt.js";import{S as Ss}from"./skeleton-8NjDJt9K.js";import{M as De}from"./MetricCard-DTTtRifH.js";import{u as Ns,a as $t}from"./use-today-context-CNVBzftF.js";import{u as ws}from"./use-extension-bridge-C6-MGhoM.js";import{B as Rt}from"./BulkSmsDrawer-8gogrweV.js";import{D as yt}from"./DriverAvatar-CaXymbzb.js";import{u as Ht}from"./use-drivers-viEKgcBv.js";import{a as Os}from"./use-company-stations-BCs9zpu9.js";import{u as Cs,H as js,a as Ts}from"./HelpPanel-CFzkYqKF.js";import{s as zt,Q as Ws}from"./QueryErrorPanel-B1gDa5_u.js";import{E as We}from"./EmptyState-Di3qek70.js";import{G as pt}from"./GlossaryTerm-DHragS6J.js";import{M as Ee}from"./MonoValue-K8CjOq_0.js";import{A as _e}from"./Avatar-DSdqkf47.js";import{f as Es}from"./helpers-B1vYrIXi.js";import{R as Ie,a as Be}from"./RuleCard-Cb3E5TYZ.js";import{c as _s,E as Oe,S as gt,b as Fe,A as Ye}from"./overlays-DOpP7ZKe.js";import{P as Is,S as Bs}from"./layout-D6zeVp_v.js";import{C as vt}from"./circle-check-big-BYdW0JZP.js";import{P as Fs}from"./plug-fhnykTcq.js";import{D as Ys}from"./download-CboRdteu.js";import{C as As}from"./coffee-DDd__w9T.js";import{C as xt}from"./cake-ByL6E93e.js";import{S as bt}from"./search-x-B67sk5HL.js";import"./SmsSuccessOverlay-DXCimrmt.js";import"./sms-segments-BY9ukeHt.js";import"./sms-time-format-JI3MblTm.js";import"./sms-variables-CmcTt9MZ.js";import"./use-scheduled-sms-D79ayTKp.js";import"./clipboard-list-BV57WbME.js";import"./send-BKG_37I8.js";import"./external-link-BdKUXdmw.js";import"./use-station-scoped-query-DTYNhmkw.js";import"./circle-question-mark-CvQXntU2.js";import"./zap-BZn7f7MY.js";const Ps=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],$s=$n("timer",Ps);function Gt(e,t,s){const n=ne(e,s?.in);if(isNaN(t))return fe(e,NaN);if(!t)return n;const o=n.getDate(),l=fe(e,n.getTime());l.setMonth(n.getMonth()+t+1,0);const i=l.getDate();return o>=i?l:(n.setFullYear(l.getFullYear(),l.getMonth(),o),n)}function Rs(e,t,s){return Pt(e,t*7,s)}function Hs(e,t,s){return Gt(e,t*12,s)}function zs(e,t){let s,n=t?.in;return e.forEach(o=>{!n&&typeof o=="object"&&(n=fe.bind(null,o));const l=ne(o,n);(!s||s<l||isNaN(+l))&&(s=l)}),fe(n,s||NaN)}function Gs(e,t){let s,n=t?.in;return e.forEach(o=>{!n&&typeof o=="object"&&(n=fe.bind(null,o));const l=ne(o,n);(!s||s>l||isNaN(+l))&&(s=l)}),fe(n,s||NaN)}function Ut(e,t){const[s,n]=ot(e,t.start,t.end);return{start:s,end:n}}function Us(e,t){const{start:s,end:n}=Ut(t?.in,e);let o=+s>+n;const l=o?+s:+n,i=o?n:s;i.setHours(0,0,0,0),i.setDate(1);let a=1;const c=[];for(;+i<=l;)c.push(fe(s,i)),i.setMonth(i.getMonth()+a);return o?c.reverse():c}function qs(e,t){const s=ne(e,t?.in);return s.setDate(1),s.setHours(0,0,0,0),s}function Ls(e,t){const s=ne(e,t?.in),n=s.getFullYear();return s.setFullYear(n+1,0,0),s.setHours(23,59,59,999),s}function Vs(e,t){const{start:s,end:n}=Ut(t?.in,e);let o=+s>+n;const l=o?+s:+n,i=o?n:s;i.setHours(0,0,0,0),i.setMonth(0,1);let a=1;const c=[];for(;+i<=l;)c.push(fe(s,i)),i.setFullYear(i.getFullYear()+a);return o?c.reverse():c}function qt(e,t){const s=Rn(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,o=ne(e,t?.in),l=o.getDay(),i=(l<n?-7:0)+6-(l-n);return o.setDate(o.getDate()+i),o.setHours(23,59,59,999),o}function Zs(e,t){return qt(e,{...t,weekStartsOn:1}
1)}function Ks(e,t){const s=ne(e,t?.in),n=s.getFullYear(),o=s.getMonth(),l=fe(s,0);return l.setFullYear(n,o+1,0),l.setHours(0,0,0,0),l.getDate()}function Qs(e,t){return ne(e,t?.in).getMonth()}function Js(e,t){return ne(e,t?.in).getFullYear()}function Xs(e,t){return+ne(e)>+ne(t)}function eo(e,t,s){const[n,o]=ot(s?.in,e,t);return n.getFullYear()===o.getFullYear()&&n.getMonth()===o.getMonth()}function to(e,t,s){const[n,o]=ot(s?.in,e,t);return n.getFullYear()===o.getFullYear()}function no(e,t,s){const n=ne(e,s?.in),o=n.getFullYear(),l=n.getDate(),i=fe(e,0);i.setFullYear(o,t,15),i.setHours(0,0,0,0);const a=Ks(i);return n.setMonth(t,Math.min(l,a)),n}function so(e,t,s){const n=ne(e,s?.in);return isNaN(+n)?fe(e,NaN):(n.setFullYear(t),n)}function oo(e,t,s="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:s}).format(t).split(/\s/g).slice(2).join(" ")}const ao={},Ce={};function ge(e,t){try{const n=(ao[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return n in Ce?Ce[n]:kt(n,n.split(":"))}catch{if(e in Ce)return Ce[e];const s=e?.match(ro);return s?kt(e,s.slice(1)):NaN}}const ro=/([+-]\d\d):?(\d\d)?/;function kt(e,t){const s=+(t[0]||0),n=+(t[1]||0),o=+(t[2]||0)/60;return Ce[e]=s*60+n>0?s*60+n+o:s*60-n-o}class ye extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(ge(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),Lt(this,t)):this.setTime(Date.now())}static tz(t,...s){return s.length?new ye(...s,t):new ye(Date.now(),t)}withTimeZone(t){return new ye(+this,t)}getTimezoneOffset(){const t=-ge(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),$e(this),+this}[Symbol.for("constructDateFrom")](t){return new ye(+new Date(t),this.timeZone)}}const Mt=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Mt.test(e))return;const t=e.replace(Mt,"$1UTC");ye.prototype[t]&&(e.startsWith("get")?ye.prototype[e]=function(){return this.internal[t]()}:(ye.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),io(this),+this},ye.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),$e(this),+this}))});function $e(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-ge(e.timeZone,e)*60))}function io(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Lt(e)}function Lt(e,t){const s=Array.isArray(t)?lo(t):+e.internal,n=ge(e.timeZone,e),o=n>0?Math.floor(n):Math.ceil(n),l=new Date(+e);l.setUTCHours(l.getUTCHours()-1);const i=-new Date(+e).getTimezoneOffset(),a=-new Date(+l).getTimezoneOffset(),c=i-a;let u=i;if(c&&i!==o){const N=Date.prototype.getHours.apply(e),_=Array.isArray(t)?t[3]||0:e.internal.getUTCHours();if(N!==_){const R=new Date(+e),V=i-o;V&&R.setUTCMinutes(R.getUTCMinutes()+V);const Z=ge(e.timeZone,R);(Z>0?Math.floor(Z):Math.ceil(Z))===o&&(u=a)}}const m=u-o;m&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+m);const f=new Date(+e);f.setUTCSeconds(0);const p=i>0?f.getSeconds():(f.getSeconds()-60)%60,g=Math.round(-(ge(e.timeZone,e)*60))%60;(g||p)&&Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+g+p);const D=ge(e.timeZone,e),T=D>0?Math.floor(D):Math.ceil(D),E=-new Date(+e).getTimezoneOffset()-T,O=T!==o,x=E-m,S=T-o,v=s-T*60*1e3,h=S>0&&Dt(e)-s===S*60*1e3&&Dt(e,v)!==s;if(O&&x&&!h){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+x);const N=ge(e.timeZone,e),_=N>0?Math.floor(N):Math.ceil(N),R=T-_;R&&x<0&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+R)}$e(e);const I=(t?s:s+g*1e3)-+e.internal;I&&Math.abs(I)<1800*1e3&&(Date.prototype.setTime.call(e,+e+I),$e(e))}function lo(e){return Date.UTC(e[0],e.length>1?e[1]:0,e.length>2?e[2]:1,...e.slice(3))}function Dt(e,t){const s=new Date(t??+e);return s.setUTCSeconds(s.getUTCSeconds()-Math.round(-ge(e.timeZone,s)*60)),+s}class Q extends ye{static tz(t,...s){return s.length?new Q(...s,t):new Q(Date.now(),t)}toISOString(){const[t,s,n]=this.tzComponents(),o=`${t}${s}:${n}`;return this.internal.toISOString().slice(0,-1)+o}toString(){return`${this.toDateString()}
1 ${this.toTimeString()}`}toDateString(){const[t,s,n,o]=this.internal.toUTCString().split(" ");return`${t?.slice(0,-1)} ${n} ${s} ${o}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[s,n,o]=this.tzComponents();return`${t} GMT${s}${n}${o} (${oo(this.timeZone,this)})`}toLocaleString(t,s){return Date.prototype.toLocaleString.call(this,t,{...s,timeZone:s?.timeZone||this.timeZone})}toLocaleDateString(t,s){return Date.prototype.toLocaleDateString.call(this,t,{...s,timeZone:s?.timeZone||this.timeZone})}toLocaleTimeString(t,s){return Date.prototype.toLocaleTimeString.call(this,t,{...s,timeZone:s?.timeZone||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),s=t>0?"-":"+",n=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),o=String(Math.abs(t)%60).padStart(2,"0");return[s,n,o]}withTimeZone(t){return new Q(+this,t)}[Symbol.for("constructDateFrom")](t){return new Q(+new Date(t),this.timeZone)}}const St=5,co=4;function uo(e,t){const s=t.startOfMonth(e),n=s.getDay()>0?s.getDay():7,o=t.addDays(e,-n+1),l=t.addDays(o,St*7-1);return t.getMonth(e)===t.getMonth(l)?St:co}function Vt(e,t){const s=t.startOfMonth(e),n=s.getDay();return n===1?s:n===0?t.addDays(s,-6):t.addDays(s,-1*(n-1))}function fo(e,t){const s=Vt(e,t),n=uo(e,t);return t.addDays(s,n*7-1)}const Zt={...we,labels:{labelDayButton:(e,t,s,n)=>{let o;n&&typeof n.format=="function"?o=n.format.bind(n):o=(i,a)=>L(i,a,{locale:we,...s});let l=o(e,"PPPP");return t.today&&(l=`Today, ${l}`),t.selected&&(l=`${l}, selected`),l},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,s)=>{let n;return s&&typeof s.format=="function"?n=s.format.bind(s):n=(o,l)=>L(o,l,{locale:we,...t}),n(e,"LLLL yyyy")},labelGridcell:(e,t,s,n)=>{let o;n&&typeof n.format=="function"?o=n.format.bind(n):o=(i,a)=>L(i,a,{locale:we,...s});let l=o(e,"PPPP");return t?.today&&(l=`Today, ${l}`),l},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,s)=>{let n;return s&&typeof s.format=="function"?n=s.format.bind(s):n=(o,l)=>L(o,l,{locale:we,...t}),n(e,"cccc")}}};class se{constructor(t,s){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?Q.tz(this.options.timeZone):new this.Date,this.newDate=(n,o,l)=>this.overrides?.newDate?this.overrides.newDate(n,o,l):this.options.timeZone?new Q(n,o,l,this.options.timeZone):new Date(n,o,l),this.addDays=(n,o)=>this.overrides?.addDays?this.overrides.addDays(n,o):Pt(n,o),this.addMonths=(n,o)=>this.overrides?.addMonths?this.overrides.addMonths(n,o):Gt(n,o),this.addWeeks=(n,o)=>this.overrides?.addWeeks?this.overrides.addWeeks(n,o):Rs(n,o),this.addYears=(n,o)=>this.overrides?.addYears?this.overrides.addYears(n,o):Hs(n,o),this.differenceInCalendarDays=(n,o)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(n,o):Ft(n,o),this.differenceInCalendarMonths=(n,o)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(n,o):Et(n,o),this.eachMonthOfInterval=n=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(n):Us(n),this.eachYearOfInterval=n=>{const o=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(n):Vs(n),l=new Set(o.map(a=>this.getYear(a)));if(l.size===o.length)return o;const i=[];return l.forEach(a=>{i.push(new Date(a,0,1))}),i},this.endOfBroadcastWeek=n=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(n):fo(n,this),this.endOfISOWeek=n=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(n):Zs(n),this.endOfMonth=n=>this.overrides?.endOfMonth?this.overrides.endOfMonth(n):Hn(n),this.endOfWeek=(n,o)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(n,o):qt(n,this.options),this.endOfYear=n=>this.overrides?.endOfYear?this.overrides.endOfYear(n):Ls(n),this.format=(n,o,l)=>{const i=this.overrides?.format?this.overrides.format(n,o,this.options):L(n,o,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(i):i},this.getISOWeek=n=>this.overrides?.getISOWeek?this.overrides.getISOWeek(n):Yt(n),this.getMonth=(n,o)=>this.overrides?.getMonth?this.overrides.getMonth(n,this.options):Qs(n,this.options),this.getYear=(n,o)=>this.overrides?.getYear?this.overrides.getYear(n,this.options):Js(n,this.options),this.getWeek=(n,o)=>this.overrides?.getWeek?this.overrides.getWeek(n,this.options):At(n,this.options),this.isAfter=(n,o)=>this.overrides?.isAfter?this.overrides.isAfter(n,o):Xs(n,o),this.isBefore=(n,o)=>this.overrides?.isBefore?this.overrides.isBefore(n,o):gs(n,o),this.isDate=n=>this.overrides?.isDate?this.overrides.isDate(n):fs(n),this.isSameDay=(n,o)=>this.overrides?.isSameDay?this.overrides.isSameDay(n,o):vs(n,o),this.isSameMonth=(n,o)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(n,o):eo(n,o),this.isSameYear=(n,o)=>this.overrides?.isSameYear?this.overrides.isSameYear(n,o):to(n,o),this.max=n=>this.overrides?.max?this.overrides.max(n):zs(n),this.min=n=>this.overrides?.min?this.overrides.min(n):Gs(n),this.setMonth=(n,o)=>this.overrides?.setMonth?this.overrides.setMonth(n,o):no(n,o),this.setYear=(n,o)=>this.overrides?.setYear?this.overrides.setYear(n,o):so(n,o),this.startOfBroadcastWeek=(n,o)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(n,this):Vt(n,this),this.startOfDay=n=>this.overrides?.startOfDay?this.overrides.startOfDay(n):ms(n),this.startOfISOWeek=n=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(n):hs(n),this.startOfMonth=n=>this.overrides?.startOfMonth?this.overrides.startOfMonth(n):qs(n),this.startOfWeek=(n,o)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(n,this.options):ys(n,this.options),this.startOfYear=n=>this.overrides?.startOfYear?this.overrides.startOfYear(n):ps(n),this.options={locale:Zt,...t},this.overrides=s}getDigitMap(){const{numerals:t="latn"}=this.options,s=new Intl.NumberFormat("en-US",{numberingSystem:t}),n={};for(let o=0;o<10;
vendor: 7,403 bytes, line 1
1o++)n[o.toString()]=s.format(o);return n}replaceDigits(t){const s=this.getDigitMap();return t.replace(/\d/g,n=>s[n]||n)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){const t=this.options.locale?.code;return t&&se.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:s,timeZone:n,numerals:o}=this.options,l=s?.code;if(l&&se.yearFirstLocales.has(l))try{return new Intl.DateTimeFormat(l,{month:"long",year:"numeric",timeZone:n,numberingSystem:o}).format(t)}catch{}const i=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,i)}}se.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const pe=new se;class Kt{constructor(t,s,n=pe){this.date=t,this.displayMonth=s,this.outside=!!(s&&!n.isSameMonth(t,s)),this.dateLib=n,this.isoDate=n.format(t,"yyyy-MM-dd"),this.displayMonthId=n.format(s,"yyyy-MM"),this.dateMonthId=n.format(t,"yyyy-MM")}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class mo{constructor(t,s){this.date=t,this.weeks=s}}class ho{constructor(t,s){this.days=s,this.weekNumber=t}}function yo(e){return y.createElement("button",{...e})}function po(e){return y.createElement("span",{...e})}function go(e){const{size:t=24,orientation:s="left",className:n}=e;return y.createElement("svg",{className:n,width:t,height:t,viewBox:"0 0 24 24"},s==="up"&&y.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),s==="down"&&y.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),s==="left"&&y.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),s==="right"&&y.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function vo(e){const{day:t,modifiers:s,...n}=e;return y.createElement("td",{...n})}function xo(e){const{day:t,modifiers:s,...n}=e,o=y.useRef(null);return y.useEffect(()=>{s.focused&&o.current?.focus()},[s.focused]),y.createElement("button",{ref:o,...n})}var b;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(b||(b={}));var P;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(P||(P={}));var ue;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(ue||(ue={}));var te;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(te||(te={}));function bo(e){const{options:t,className:s,components:n,classNames:o,...l}=e,i=[o[b.Dropdown],s].join(" "),a=t?.find(({value:c})=>c===l.value);return y.createElement("span",{"data-disabled":l.disabled,className:o[b.DropdownRoot]},y.createElement(n.Select,{className:i,...l},t?.map(({value:c,label:u,disabled:m})=>y.createElement(n.Option,{key:c,value:c,disabled:m},u))),y.createElement("span",{className:o[b.CaptionLabel],"aria-hidden":!0},a?.label,y.createElement(n.Chevron,{orientation:"down",size:18,className:o[b.Chevron]})))}function ko(e){return y.createElement("div",{...e})}function Mo(e){return y.createElement("div",{...e})}function Do(e){const{calendarMonth:t,displayIndex:s,...n}=e;return y.createElement("div",{...n},e.children)}function So(e){const{calendarMonth:t,displayIndex:s,...n}=e;return y.createElement("div",{...n})}function No(e){return y.createElement("table",{...e})}function wo(e){return y.createElement("div",{...e})}const Qt=C.createContext(void 0);function je(){const e=C.useContext(Qt);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function Oo(e){const{components:t}=je();return y.createElement(t.Dropdown,{...e})}function Co(e){const{onPreviousClick:t,onNextClick:s,previousMonth:n,nextMonth:o,...l}=e,{components:i,classNames:a,labels:{labelPrevious:c,labelNext:u}}=je(),m=C.useCallback(p=>{o&&s?.(p)},[o,s]),f=C.useCallback(p=>{n&&t?.(p)},[n,t]);return y.createElement("nav",{...l},y.createElement(i.PreviousMonthButton,{type:"button",className:a[b.PreviousMonthButton],tabIndex:n?void 0:-1,"aria-disabled":n?void 0:!0,"aria-label":c(n),onClick:f},y.createElement(i.Chevron,{disabled:n?void 0:!0,className:a[b.Chevron],orientation:"left"})),y.createElement(i.NextMonthButton,{type:"button",className:a[b.NextMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":u(o),onClick:m},y.createElement(i.Chevron,{disabled:o?void 0:!0,orientation:"right",className:a[b.Chevron]})))}function jo(e){const{components:t}=je();return y.createElement(t.Button,{...e})}function To(e){return y.createElement("option",{...e})}function Wo(e){const{components:t}=je();return y.createElement(t.Button,{...e})}function Eo(e){const{rootRef:t,...s}=e;return y.createElement("div",{...s,ref:t})}function _o(e){return y.createElement("select",{...e})}function Io(e){const{week:t,...s}=e;return y.createElement("tr",{...s})}function Bo(e){return y.createElement("th",{...e})}function Fo(e){return y.createElement("thead",{"aria-hidden":!0},y.createElement("tr",{...e}))}function Yo(e){const{week:t,...s}=e;return y.createElement("th",{...s})}function Ao(e){return y.createElement("th",{...e})}function Po(e){return y.createElement("tbody",{...e})}function $o(e){const{components:t}=je();return y.createElement(t.Dropdown,{...e})}const Ro=Object.freeze(Object.defineProperty({__proto__:null,Button:yo,CaptionLabel:po,Chevron:go,Day:vo,DayButton:xo,Dropdown:bo,DropdownNav:ko,Footer:Mo,Month:Do,MonthCaption:So,MonthGrid:No,Months:wo,MonthsDropdown:Oo,Nav:Co,NextMonthButton:jo,Option:To,PreviousMonthButton:Wo,Root:Eo,Select:_o,Week:Io,WeekNumber:Yo,WeekNumberHeader:Ao,Weekday:Bo,Weekdays:Fo,Weeks:Po,YearsDropdown:$o},Symbol.toStringTag,{value:"Module"}));function ve(e,t,s=!1,n=pe){let{from:o,to:l}=e;const{differenceInCalendarDays:i,isSameDay:a}=n;return o&&l?(i(l,o)<0&&([o,l]=[l,o]),i(t,o)>=(s?1:0)&&i(l,t)>=(s?1:0)):!s&&l?a(l,t):!s&&o?a(o,t):!1}function at(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Re(e){return!!(e&&typeof e=="object"&&"from"in e)}function rt(e){return!!(e&&typeof e=="object"&&"after"in e)}function it(e){return!!(e&&typeof e=="object"&&"before"in e)}function Jt(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Xt(e,t){return Array.isArray(e)&&e.every(t.isDate)}function xe(e,t,s=pe){const n=Array.isArray(t)?t:[t],{isSameDay:o,differenceInCalendarDays:l,isAfter:i}=s;return n.some(a=>{if(typeof a=="boolean")return a;
vendor: 13,959 bytes, line 1
1if(s.isDate(a))return o(e,a);if(Xt(a,s))return a.some(c=>o(e,c));if(Re(a))return ve(a,e,!1,s);if(Jt(a))return Array.isArray(a.dayOfWeek)?a.dayOfWeek.includes(e.getDay()):a.dayOfWeek===e.getDay();if(at(a)){const c=l(a.before,e),u=l(a.after,e),m=c>0,f=u<0;return i(a.before,a.after)?f&&m:m||f}return rt(a)?l(e,a.after)>0:it(a)?l(a.before,e)>0:typeof a=="function"?a(e):!1})}function Ho(e,t,s,n,o){const{disabled:l,hidden:i,modifiers:a,showOutsideDays:c,broadcastCalendar:u,today:m=o.today()}=t,{isSameDay:f,isSameMonth:p,startOfMonth:g,isBefore:D,endOfMonth:T,isAfter:M}=o,E=s&&g(s),O=n&&T(n),x={[P.focused]:[],[P.outside]:[],[P.disabled]:[],[P.hidden]:[],[P.today]:[]},S={};for(const v of e){const{date:h,displayMonth:j}=v,I=!!(j&&!p(h,j)),N=!!(E&&D(h,E)),_=!!(O&&M(h,O)),R=!!(l&&xe(h,l,o)),V=!!(i&&xe(h,i,o))||N||_||!u&&!c&&I||u&&c===!1&&I,Z=f(h,m);I&&x.outside.push(v),R&&x.disabled.push(v),V&&x.hidden.push(v),Z&&x.today.push(v),a&&Object.keys(a).forEach(G=>{const J=a?.[G];J&&xe(h,J,o)&&(S[G]?S[G].push(v):S[G]=[v])})}return v=>{const h={[P.focused]:!1,[P.disabled]:!1,[P.hidden]:!1,[P.outside]:!1,[P.today]:!1},j={};for(const I in x){const N=x[I];h[I]=N.some(_=>_===v)}for(const I in S)j[I]=S[I].some(N=>N===v);return{...h,...j}}}function zo(e,t,s={}){return Object.entries(e).filter(([,o])=>o===!0).reduce((o,[l])=>(s[l]?o.push(s[l]):t[P[l]]?o.push(t[P[l]]):t[ue[l]]&&o.push(t[ue[l]]),o),[t[b.Day]])}function Go(e){return{...Ro,...e}}function Uo(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([s,n])=>{s.startsWith("data-")&&(t[s]=n)}),t}function qo(){const e={};for(const t in b)e[b[t]]=`rdp-${b[t]}`;for(const t in P)e[P[t]]=`rdp-${P[t]}`;for(const t in ue)e[ue[t]]=`rdp-${ue[t]}`;for(const t in te)e[te[t]]=`rdp-${te[t]}`;return e}function en(e,t,s){return(s??new se(t)).formatMonthYear(e)}const Lo=en;function Vo(e,t,s){return(s??new se(t)).format(e,"d")}function Zo(e,t=pe){return t.format(e,"LLLL")}function Ko(e,t,s){return(s??new se(t)).format(e,"cccccc")}function Qo(e,t=pe){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function Jo(){return""}function tn(e,t=pe){return t.format(e,"yyyy")}const Xo=tn,ea=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:en,formatDay:Vo,formatMonthCaption:Lo,formatMonthDropdown:Zo,formatWeekNumber:Qo,formatWeekNumberHeader:Jo,formatWeekdayName:Ko,formatYearCaption:Xo,formatYearDropdown:tn},Symbol.toStringTag,{value:"Module"}));function ta(e){return e?.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e?.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...ea,...e}}function lt(e,t,s,n){let o=(n??new se(s)).format(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o}const na=lt;function ct(e,t,s){return(s??new se(t)).formatMonthYear(e)}const sa=ct;function nn(e,t,s,n){let o=(n??new se(s)).format(e,"PPPP");return t?.today&&(o=`Today, ${o}`),o}function sn(e){return"Choose the Month"}function on(){return""}const oa="Go to the Next Month";function an(e,t){return oa}function rn(e){return"Go to the Previous Month"}function ln(e,t,s){return(s??new se(t)).format(e,"cccc")}function cn(e,t){return`Week ${e}`}function dn(e){return"Week Number"}function un(e){return"Choose the Year"}const aa=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:sa,labelDay:na,labelDayButton:lt,labelGrid:ct,labelGridcell:nn,labelMonthDropdown:sn,labelNav:on,labelNext:an,labelPrevious:rn,labelWeekNumber:cn,labelWeekNumberHeader:dn,labelWeekday:ln,labelYearDropdown:un},Symbol.toStringTag,{value:"Module"})),ce=(e,t,s)=>t||(s?typeof s=="function"?s:(...n)=>s:e);function ra(e,t){const s=t.locale?.labels??{};return{...aa,...e??{},labelDayButton:ce(lt,e?.labelDayButton,s.labelDayButton),labelMonthDropdown:ce(sn,e?.labelMonthDropdown,s.labelMonthDropdown),labelNext:ce(an,e?.labelNext,s.labelNext),labelPrevious:ce(rn,e?.labelPrevious,s.labelPrevious),labelWeekNumber:ce(cn,e?.labelWeekNumber,s.labelWeekNumber),labelYearDropdown:ce(un,e?.labelYearDropdown,s.labelYearDropdown),labelGrid:ce(ct,e?.labelGrid,s.labelGrid),labelGridcell:ce(nn,e?.labelGridcell,s.labelGridcell),labelNav:ce(on,e?.labelNav,s.labelNav),labelWeekNumberHeader:ce(dn,e?.labelWeekNumberHeader,s.labelWeekNumberHeader),labelWeekday:ce(ln,e?.labelWeekday,s.labelWeekday)}}function ia(e,t,s,n,o){const{startOfMonth:l,startOfYear:i,endOfYear:a,eachMonthOfInterval:c,getMonth:u}=o;return c({start:i(e),end:a(e)}).map(p=>{const g=n.formatMonthDropdown(p,o),D=u(p),T=t&&p<l(t)||s&&p>l(s)||!1;return{value:D,label:g,disabled:T}})}function la(e,t={},s={}){let n={...t?.[b.Day]};return Object.entries(e).filter(([,o])=>o===!0).forEach(([o])=>{n={...n,...s?.[o]}}),n}function ca(e,t,s,n){const o=n??e.today(),l=s?e.startOfBroadcastWeek(o,e):t?e.startOfISOWeek(o):e.startOfWeek(o),i=[];for(let a=0;a<7;a++){const c=e.addDays(l,a);i.push(c)}return i}function da(e,t,s,n,o=!1){if(!e||!t)return;const{startOfYear:l,endOfYear:i,eachYearOfInterval:a,getYear:c}=n,u=l(e),m=i(t),f=a({start:u,end:m});return o&&f.reverse(),f.map(p=>{const g=s.formatYearDropdown(p,n);return{value:c(p),label:g,disabled:!1}})}function ua(e,t={}){const{weekStartsOn:s,locale:n}=t,o=s??n?.options?.weekStartsOn??0,l=a=>{const c=typeof a=="number"||typeof a=="string"?new Date(a):a;return new Q(c.getFullYear(),c.getMonth(),c.getDate(),12,0,0,e)},i=a=>{const c=l(a);return new Date(c.getFullYear(),c.getMonth(),c.getDate(),0,0,0,0)};return{today:()=>l(Q.tz(e)),newDate:(a,c,u)=>new Q(a,c,u,12,0,0,e),startOfDay:a=>l(a),startOfWeek:(a,c)=>{const u=l(a),m=c?.weekStartsOn??o,f=(u.getDay()-m+7)%7;return u.setDate(u.getDate()-f),u},startOfISOWeek:a=>{const c=l(a),u=(c.getDay()-1+7)%7;return c.setDate(c.getDate()-u),c},startOfMonth:a=>{const c=l(a);return c.setDate(1),c},startOfYear:a=>{const c=l(a);return c.setMonth(0,1),c},endOfWeek:(a,c)=>{const u=l(a),p=(((c?.weekStartsOn??o)+6)%7-u.getDay()+7)%7;return u.setDate(u.getDate()+p),u},endOfISOWeek:a=>{const c=l(a),u=(7-c.getDay())%7;return c.setDate(c.getDate()+u),c},endOfMonth:a=>{const c=l(a);return c.setMonth(c.getMonth()+1,0),c},endOfYear:a=>{const c=l(a);return c.setMonth(11,31),c},eachMonthOfInterval:a=>{const c=l(a.start),u=l(a.end),m=[],f=new Q(c.getFullYear(),c.getMonth(),1,12,0,0,e),p=u.getFullYear()*12+u.getMonth();for(;f.getFullYear()*12+f.getMonth()<=p;)m.push(new Q(f,e)),f.setMonth(f.getMonth()+1,1);return m},addDays:(a,c)=>{const u=l(a);return u.setDate(u.getDate()+c),u},addWeeks:(a,c)=>{const u=l(a);return u.setDate(u.getDate()+c*7),u},addMonths:(a,c)=>{const u=l(a);return u.setMonth(u.getMonth()+c),u},addYears:(a,c)=>{const u=l(a);return u.setFullYear(u.getFullYear()+c),u},eachYearOfInterval:a=>{const c=l(a.start),u=l(a.end),m=[],f=new Q(c.getFullYear(),0,1,12,0,0,e);for(;f.getFullYear()<=u.getFullYear();)m.push(new Q(f,e)),f.setFullYear(f.getFullYear()+1,0,1);return m},getWeek:(a,c)=>{const u=i(a);return At(u,{weekStartsOn:c?.weekStartsOn??o,firstWeekContainsDate:c?.firstWeekContainsDate??n?.options?.firstWeekContainsDate??1})},getISOWeek:a=>{const c=i(a);return Yt(c)},differenceInCalendarDays:(a,c)=>{const u=i(a),m=i(c);return Ft(u,m)},differenceInCalendarMonths:(a,c)=>{const u=i(a),m=i(c);return Et(u,m)}}}const Te=e=>e instanceof HTMLElement?e:null,Je=e=>[...e.querySelectorAll("[data-animated-month]")??[]],fa=e=>Te(e.querySelector("[data-animated-month]")),Xe=e=>Te(e.querySelector("[data-animated-caption]")),et=e=>Te(e.querySelector("[data-animated-weeks]")),ma=e=>Te(e.querySelector("[data-animated-nav]")),ha=e=>Te(e.querySelector("[data-animated-weekdays]"));function ya(e,t,{classNames:s,months:n,focused:o,dateLib:l}){const i=C.useRef(null),a=C.useRef(n),c=C.useRef(!1);C.useLayoutEffect(()=>{const u=a.current;if(a.current=n,!t||!e.current||!(e.current instanceof HTMLElement)||n.length===0||u.length===0||n.length!==u.length)return;const m=l.isSameMonth(n[0].date,u[0].date),f=l.isAfter(n[0].date,u[0].date),p=f?s[te.caption_after_enter]:s[te.caption_before_enter],g=f?s[te.weeks_after_enter]:s[te.weeks_before_enter],D=i.current,T=e.current.cloneNode(!0);if(T instanceof HTMLElement?(Je(T).forEach(x=>{if(!(x instanceof HTMLElement))return;const S=fa(x);S&&x.contains(S)&&x.removeChild(S);const v=Xe(x);v&&v.classList.remove(p);const h=et(x);h&&h.classList.remove(g)}),i.current=T):i.current=null,c.current||m||o)return;const M=D instanceof HTMLElement?Je(D):[],E=Je(e.current);if(E?.every(O=>O instanceof HTMLElement)&&M&&M.every(O=>O instanceof HTMLElement)){c.current=!0,e.current.style.isolation="isolate";const O=ma(e.current);O&&(O.style.zIndex="1"),E.forEach((x,S)=>{const v=M[S];if(!v)return;x.style.position="relative",x.style.overflow="hidden";const h=Xe(x);h&&h.classList.add(p);const j=et(x);j&&j.classList.add(g);const I=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),O&&(O.style.zIndex=""),h&&h.classList.remove(p),j&&j.classList.remove(g),x.style.position="",x.style.overflow="",x.contains(v)&&x.removeChild(v)};v.style.pointerEvents="none",v.style.position="absolute",v.style.overflow="hidden",v.setAttribute("aria-hidden","true");const N=ha(v);N&&(N.style.opacity="0");const _=Xe(v);_&&(_.classList.add(f?s[te.caption_before_exit]:s[te.caption_after_exit]),_.addEventListener("animationend",I));const R=et(v);R&&R.classList.add(f?s[te.weeks_before_exit]:s[te.weeks_after_exit]),x.insertBefore(v,x.firstChild)})}})}function pa(e,t,s,n){const o=e[0],l=e[e.length-1],{ISOWeek:i,fixedWeeks:a,broadcastCalendar:c}=s??{},{addDays:u,differenceInCalendarDays:m,differenceInCalendarMonths:f,endOfBroadcastWeek:p,endOfISOWeek:g,endOfMonth:D,endOfWeek:T,isAfter:M,startOfBroadcastWeek:E,startOfISOWeek:O,startOfWeek:x}=n,S=c?E(o,n):i?O(o):x(o),v=c?p(l):i?g(D(l)):T(D(l)),h=t&&(c?p(t):i?g(t):T(t)),j=h&&M(v,h)?h:v,I=m(j,S),N=f(l,o)+1,_=[];for(let Z=0;Z<=I;Z++){const G=u(S,Z);_.push(G)}const V=(c?35:42)*N;if(a&&_.length<V){const Z=V-_.length;for(let G=0;G<Z;G++){const J=u(_[_.length-1],1);_.push(J)}}return _}function ga(e){const t=[];return e.reduce((s,n)=>{const o=n.weeks.reduce((l,i)=>l.concat(i.days.slice()),t.slice());return s.concat(o.slice())},t.slice())}function va(e,t,s,n){const{numberOfMonths:o=1}=s,l=[];for(let i=0;i<o;i++){const a=n.addMonths(e,i);if(t&&a>t)break;l.push(a)}return l}function Nt(e,t,s,n){const{month:o,defaultMonth:l,today:i=n.today(),numberOfMonths:a=1}=e;let c=o||l||i;const{differenceInCalendarMonths:u,addMonths:m,startOfMonth:f}=n;if(s&&u(s,c)<a-1){const p=-1*(a-1);c=m(s,p)}return t&&u(c,t)<0&&(c=t),f(c)}function xa(e,t,s,n){const{addDays:o,endOfBroadcastWeek:l,endOfISOWeek:i,endOfMonth:a,endOfWeek:c,getISOWeek:u,getWeek:m,startOfBroadcastWeek:f,startOfISOWeek:p,startOfWeek:g}=n,D=e.reduce((T,M)=>{const E=s.broadcastCalendar?f(M,n):s.ISOWeek?p(M):g(M),O=s.broadcastCalendar?l(M):s.ISOWeek?i(a(M)):c(a(M)),x=t.filter(j=>j>=E&&j<=O),S=s.broadcastCalendar?35:42;if(s.fixedWeeks&&x.length<S){const j=t.filter(I=>{const N=S-x.length;return I>O&&I<=o(O,N)});x.push(...j)}const v=x.reduce((j,I)=>{const N=s.ISOWeek?u(I):m(I),_=j.find(V=>V.weekNumber===N),R=new Kt(I,M,n);return _?_.days.push(R):j.push(new ho(N,[R])),j},[]),h=new mo(M,v);return T.push(h),T},[]);return s.reverseMonths?D.reverse():D}function ba(e,t){let{startMonth:s,endMonth:n}=e;const{startOfYear:o,startOfDay:l,startOfMonth:i,endOfMonth:a,addYears:c,endOfYear:u,newDate:m,today:f}=t,{fromYear:p,toYear:g,fromMonth:D,toMonth:T}=e;!s&&D&&(s=D),!s&&p&&(s=t.newDate(p,0,1)),!n&&T&&(n=T),!n&&g&&(n=m(g,11,31));const M=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return s?s=i(s):p?s=m(p,0,1):!s&&M&&(s=o(c(e.today??f(),-100))),n?n=a(n):g?n=m(g,11,31):!n&&M&&(n=u(e.today??f())),[s&&l(s),n&&l(n)]}function ka(e,t,s,n){if(s.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:l=1}=s,{startOfMonth:i,addMonths:a,differenceInCalendarMonths:c}=n,u=o?l:1,m=i(e);if(!t)return a(m,u);if(!(c(t,e)<l))return a(m,u)}function Ma(e,t,s,n){if(s.disableNavigation)return;const{pagedNavigation:o,numberOfMonths:l}=s,{startOfMonth:i,addMonths:a,differenceInCalendarMonths:c}=n,u=o?l??1:1,m=i(e);if(!t)return a(m,-u);if(!(c(m,t)<=0))return a(m,-u)}function Da(e){const t=[];return e.reduce((s,n)=>s.concat(n.weeks.slice()),t.slice())}function He(e,t){const[s,n]=C.useState(e);return[t===void 0?s:t,n]}function Sa(e,t){const[s,n]=ba(e,t),{startOfMonth:o,endOfMonth:l}=t,i=Nt(e,s,n,t),[a,c]=He(i,e.month?i:void 0);C.useEffect(()=>{const S=Nt(e,s,n,t);c(S)},[e.timeZone]);const{months:u,weeks:m,days:f,previousMonth:p,nextMonth:g}=C.useMemo(()=>{const S=va(a,n,{numberOfMonths:e.numberOfMonths},t),v=pa(S,e.endMonth?l(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),h=xa(S,v,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),j=Da(h),I=ga(h),N=Ma(a,s,e,t),_=ka(a,n,e,t);return{months:h,weeks:j,days:I,previousMonth:N,nextMonth:_}},[t,a.getTime(),n?.getTime(),s?.getTime(),e.disableNavigation,e.broadcastCalendar,e.endMonth?.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:D,onMonthChange:T}=e,M=S=>m.some(v=>v.days.some(h=>h.isEqualTo(S))),E=S=>{if(D)return;let v=o(S);s&&v<o(s)&&(v=o(s)),n&&v>o(n)&&(v=o(n)),c(v),T?.(v)};return{months:u,weeks:m,days:f,navStart:s,navEnd:n,previousMonth:p,nextMonth:g,goToMonth:E,goToDay:S=>{M(S)||E(S.date)}}}var he;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(he||(he={}));function wt(e){return!e[P.disabled]&&!e[P.hidden]&&!e[P.outside]}function Na(e,t,s,n){let o,l=-1;for(const i of e){const a=t(i);
1wt(a)&&(a[P.focused]&&l<he.FocusedModifier?(o=i,l=he.FocusedModifier):n?.isEqualTo(i)&&l<he.LastFocused?(o=i,l=he.LastFocused):s(i.date)&&l<he.Selected?(o=i,l=he.Selected):a[P.today]&&l<he.Today&&(o=i,l=he.Today))}return o||(o=e.find(i=>wt(t(i)))),o}function wa(e,t,s,n,o,l,i){const{ISOWeek:a,broadcastCalendar:c}=l,{addDays:u,addMonths:m,addWeeks:f,addYears:p,endOfBroadcastWeek:g,endOfISOWeek:D,endOfWeek:T,max:M,min:E,startOfBroadcastWeek:O,startOfISOWeek:x,startOfWeek:S}=i;let h={day:u,week:f,month:m,year:p,startOfWeek:j=>c?O(j,i):a?x(j):S(j),endOfWeek:j=>c?g(j):a?D(j):T(j)}[e](s,t==="after"?1:-1);return t==="before"&&n?h=M([n,h]):t==="after"&&o&&(h=E([o,h])),h}function fn(e,t,s,n,o,l,i,a=0){if(a>365)return;const c=wa(e,t,s.date,n,o,l,i),u=!!(l.disabled&&xe(c,l.disabled,i)),m=!!(l.hidden&&xe(c,l.hidden,i)),f=c,p=new Kt(c,f,i);return!u&&!m?p:fn(e,t,p,n,o,l,i,a+1)}function Oa(e,t,s,n,o){const{autoFocus:l}=e,[i,a]=C.useState(),c=Na(t.days,s,n||(()=>!1),i),[u,m]=C.useState(l?c:void 0);return{isFocusTarget:T=>!!c?.isEqualTo(T),setFocused:m,focused:u,blur:()=>{a(u),m(void 0)},moveFocus:(T,M)=>{if(!u)return;const E=fn(T,M,u,t.navStart,t.navEnd,e,o);E&&(e.disableNavigation&&!t.days.some(x=>x.isEqualTo(E))||(t.goToDay(E),m(E)))}}}function Ca(e,t){const{selected:s,required:n,onSelect:o}=e,[l,i]=He(s,o?s:void 0),a=o?s:l,{isSameDay:c}=t,u=g=>a?.some(D=>c(D,g))??!1,{min:m,max:f}=e;return{selected:a,select:(g,D,T)=>{let M=[...a??[]];if(u(g)){if(a?.length===m||n&&a?.length===1)return;M=a?.filter(E=>!c(E,g))}else a?.length===f?M=[g]:M=[...M,g];return o||i(M),o?.(M,g,D,T),M},isSelected:u}}function ja(e,t,s=0,n=0,o=!1,l=pe){const{from:i,to:a}=t||{},{isSameDay:c,isAfter:u,isBefore:m}=l;let f;if(!i&&!a)f={from:e,to:s>0?void 0:e};else if(i&&!a)c(i,e)?s===0?f={from:i,to:e}:o?f={from:i,to:void 0}:f=void 0:m(e,i)?f={from:e,to:i}:f={from:i,to:e};else if(i&&a)if(c(i,e)&&c(a,e))o?f={from:i,to:a}:f=void 0;else if(c(i,e))f={from:i,to:s>0?void 0:e};else if(c(a,e))f={from:e,to:s>0?void 0:e};else if(m(e,i))f={from:e,to:a};else if(u(e,i))f={from:i,to:e};else if(u(e,a))f={from:i,to:e};else throw new Error("Invalid range");if(f?.from&&f?.to){const p=l.differenceInCalendarDays(f.to,f.from);n>0&&p>n?f={from:e,to:void 0}:s>1&&p<s&&(f={from:e,to:void 0})}return f}function Ta(e,t,s=pe){const n=Array.isArray(t)?t:[t];let o=e.from;const l=s.differenceInCalendarDays(e.to,e.from),i=Math.min(l,6);for(let a=0;a<=i;a++){if(n.includes(o.getDay()))return!0;o=s.addDays(o,1)}return!1}function Ot(e,t,s=pe){return ve(e,t.from,!1,s)||ve(e,t.to,!1,s)||ve(t,e.from,!1,s)||ve(t,e.to,!1,s)}function Wa(e,t,s=pe){const n=Array.isArray(t)?t:[t];if(n.filter(a=>typeof a!="function").some(a=>typeof a=="boolean"?a:s.isDate(a)?ve(e,a,!1,s):Xt(a,s)?a.some(c=>ve(e,c,!1,s)):Re(a)?a.from&&a.to?Ot(e,{from:a.from,to:a.to},s):!1:Jt(a)?Ta(e,a.dayOfWeek,s):at(a)?s.isAfter(a.before,a.after)?Ot(e,{from:s.addDays(a.after,1),to:s.addDays(a.before,-1)},s):xe(e.from,a,s)||xe(e.to,a,s):rt(a)||it(a)?xe(e.from,a,s)||xe(e.to,a,s):!1))return!0;const i=n.filter(a=>typeof a=="function");if(i.length){let a=e.from;const c=s.differenceInCalendarDays(e.to,e.from);for(let u=0;u<=c;u++){if(i.some(m=>m(a)))return!0;a=s.addDays(a,1)}}return!1}function Ea(e,t){const{disabled:s,excludeDisabled:n,resetOnSelect:o,selected:l,required:i,onSelect:a}=e,[c,u]=He(l,a?l:void 0),m=a?l:c;return{selected:m,select:(g,D,T)=>{const{min:M,max:E}=e;let O;if(g){const x=m?.from,S=m?.to,v=!!x&&!!S,h=!!x&&!!S&&t.isSameDay(x,S)&&t.isSameDay(g,x);o&&(v||!m?.from)?!i&&h?O=void 0:O={from:g,to:void 0}:O=ja(g,m,M,E,i,t)}return n&&s&&O?.from&&O.to&&Wa({from:O.from,to:O.to},s,t)&&(O.from=g,O.to=void 0),a||u(O),a?.(O,g,D,T),O},isSelected:g=>m&&ve(m,g,!1,t)}}function _a(e,t){const{selected:s,required:n,onSelect:o}=e,[l,i]=He(s,o?s:void 0),a=o?s:l,{isSameDay:c}=t;return{selected:a,select:(f,p,g)=>{let D=f;return!n&&a&&a&&c(f,a)&&(D=void 0),o||i(D),o?.(D,f,p,g),D},isSelected:f=>a?c(a,f):!1}}function Ia(e,t){const s=_a(e,t),n=Ca(e,t),o=Ea(e,t);switch(e.mode){case"single":return s;case"multiple":return n;case"range":return o;default:return}}function re(e,t){return e instanceof Q&&e.timeZone===t?e:new Q(e,t)}function Se(e,t,s){return re(e,t)}function Ct(e,t,s){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?Se(e,t):Array.isArray(e)?e.map(n=>n instanceof Date?Se(n,t):n):Re(e)?{...e,from:e.from?re(e.from,t):e.from,to:e.to?re(e.to,t):e.to}:at(e)?{before:Se(e.before,t),after:Se(e.after,t)}:rt(e)?{after:Se(e.after,t)}:it(e)?{before:Se(e.before,t)}:e}function tt(e,t,s){return e&&(Array.isArray(e)?e.map(n=>Ct(n,t)):Ct(e,t))}function Ba(e){let t=e;const s=t.timeZone;if(s&&(t={...e,timeZone:s},t.today&&(t.today=re(t.today,s)),t.month&&(t.month=re(t.month,s)),t.defaultMonth&&(t.defaultMonth=re(t.defaultMonth,s)),t.startMonth&&(t.startMonth=re(t.startMonth,s)),t.endMonth&&(t.endMonth=re(t.endMonth,s)),t.mode==="single"&&t.selected?t.selected=re(t.selected,s):t.mode==="multiple"&&t.selected?t.selected=t.selected?.map(W=>re(W,s)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?re(t.selected.from,s):t.selected.from,to:t.selected.to?re(t.selected.to,s):t.selected.to}),t.disabled!==void 0&&(t.disabled=tt(t.disabled,s)),t.hidden!==void 0&&(t.hidden=tt(t.hidden,s)),t.modifiers)){const W={};
1Object.keys(t.modifiers).forEach(Y=>{W[Y]=tt(t.modifiers?.[Y],s)}),t.modifiers=W}const{components:n,formatters:o,labels:l,dateLib:i,locale:a,classNames:c}=C.useMemo(()=>{const W={...Zt,...t.locale},Y=t.broadcastCalendar?1:t.weekStartsOn,w=t.noonSafe&&t.timeZone?ua(t.timeZone,{weekStartsOn:Y,locale:W}):void 0,F=t.dateLib&&w?{...w,...t.dateLib}:t.dateLib??w,X=new se({locale:W,weekStartsOn:Y,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},F);return{dateLib:X,components:Go(t.components),formatters:ta(t.formatters),labels:ra(t.labels,X.options),locale:W,classNames:{...qo(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:i.today()});const{captionLayout:u,mode:m,navLayout:f,numberOfMonths:p=1,onDayBlur:g,onDayClick:D,onDayFocus:T,onDayKeyDown:M,onDayMouseEnter:E,onDayMouseLeave:O,onNextClick:x,onPrevClick:S,showWeekNumber:v,styles:h}=t,{formatCaption:j,formatDay:I,formatMonthDropdown:N,formatWeekNumber:_,formatWeekNumberHeader:R,formatWeekdayName:V,formatYearDropdown:Z}=o,G=Sa(t,i),{days:J,months:be,navStart:k,navEnd:K,previousMonth:U,nextMonth:A,goToMonth:ie}=G,Ne=Ho(J,t,k,K,i),{isSelected:d,select:q,selected:z}=Ia(t,i)??{},{blur:oe,focused:H,isFocusTarget:me,moveFocus:$,setFocused:ke}=Oa(t,G,Ne,d??(()=>!1),i),{labelDayButton:hn,labelGridcell:yn,labelGrid:pn,labelMonthDropdown:gn,labelNav:dt,labelPrevious:vn,labelNext:xn,labelWeekday:bn,labelWeekNumber:kn,labelWeekNumberHeader:Mn,labelYearDropdown:Dn}=l,Sn=C.useMemo(()=>ca(i,t.ISOWeek,t.broadcastCalendar,t.today),[i,t.ISOWeek,t.broadcastCalendar,t.today]),ut=m!==void 0||D!==void 0,ze=C.useCallback(()=>{U&&(ie(U),S?.(U))},[U,ie,S]),Ge=C.useCallback(()=>{A&&(ie(A),x?.(A))},[ie,A,x]),Nn=C.useCallback((W,Y)=>w=>{w.preventDefault(),w.stopPropagation(),ke(W),!Y.disabled&&(q?.(W.date,Y,w),D?.(W.date,Y,w))},[q,D,ke]),wn=C.useCallback((W,Y)=>w=>{ke(W),T?.(W.date,Y,w)},[T,ke]),On=C.useCallback((W,Y)=>w=>{oe(),g?.(W.date,Y,w)},[oe,g]),Cn=C.useCallback((W,Y)=>w=>{const F={ArrowLeft:[w.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[w.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[w.shiftKey?"year":"week","after"],ArrowUp:[w.shiftKey?"year":"week","before"],PageUp:[w.shiftKey?"year":"month","before"],PageDown:[w.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(F[w.key]){w.preventDefault(),w.stopPropagation();const[X,B]=F[w.key];$(X,B)}M?.(W.date,Y,w)},[$,M,t.dir]),jn=C.useCallback((W,Y)=>w=>{E?.(W.date,Y,w)},[E]),Tn=C.useCallback((W,Y)=>w=>{O?.(W.date,Y,w)},[O]),Wn=C.useCallback(W=>Y=>{const w=Number(Y.target.value),F=i.setMonth(i.startOfMonth(W),w);ie(F)},[i,ie]),En=C.useCallback(W=>Y=>{const w=Number(Y.target.value),F=i.setYear(i.startOfMonth(W),w);ie(F)},[i,ie]),{className:_n,style:In}=C.useMemo(()=>({className:[c[b.Root],t.className].filter(Boolean).join(" "),style:{...h?.[b.Root],...t.style}}),[c,t.className,t.style,h]),Bn=Uo(t),ft=C.useRef(null);ya(ft,!!t.animate,{classNames:c,months:be,focused:H,dateLib:i});const Fn={dayPickerProps:t,selected:z,select:q,isSelected:d,months:be,nextMonth:A,previousMonth:U,goToMonth:ie,getModifiers:Ne,components:n,classNames:c,styles:h,labels:l,formatters:o};return y.createElement(Qt.Provider,{value:Fn},y.createElement(n.Root,{rootRef:t.animate?ft:void 0,className:_n,style:In,dir:t.dir,id:t.id,lang:t.lang??a.code,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...Bn},y.createElement(n.Months,{className:c[b.Months],style:h?.[b.Months]},!t.hideNavigation&&!f&&y.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:c[b.Nav],style:h?.[b.Nav],"aria-label":dt(),onPreviousClick:ze,onNextClick:Ge,previousMonth:U,nextMonth:A}),be.map((W,Y)=>y.createElement(n.Month,{"data-animated-month":t.animate?"true":void 0,className:c[b.Month],style:h?.[b.Month],key:Y,displayIndex:Y,calendarMonth:W},f==="around"&&!t.hideNavigation&&Y===0&&y.createElement(n.PreviousMonthButton,{type:"button",className:c[b.PreviousMonthButton],tabIndex:U?void 0:-1,"aria-disabled":U?void 0:!0,"aria-label":vn(U),onClick:ze,"data-animated-button":t.animate?"true":void 0},y.createElement(n.Chevron,{disabled:U?void 0:!0,className:c[b.Chevron],orientation:t.dir==="rtl"?"right":"left"})),y.createElement(n.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:c[b.MonthCaption],style:h?.[b.MonthCaption],calendarMonth:W,displayIndex:Y},u?.startsWith("dropdown")?y.createElement(n.DropdownNav,{className:c[b.Dropdowns],style:h?.[b.Dropdowns]},(()=>{const w=u==="dropdown"||u==="dropdown-months"?y.createElement(n.MonthsDropdown,{key:"month",className:c[b.MonthsDropdown],"aria-label":gn(),classNames:c,components:n,disabled:!!t.disableNavigation,onChange:Wn(W.date),options:ia(W.date,k,K,o,i),style:h?.[b.Dropdown],value:i.getMonth(W.date)}):y.createElement("span",{key:"month"},N(W.date,i)),F=u==="dropdown"||u==="dropdown-years"?y.createElement(n.Years
vendor: 5,457 bytes, line 1
1Dropdown,{key:"year",className:c[b.YearsDropdown],"aria-label":Dn(i.options),classNames:c,components:n,disabled:!!t.disableNavigation,onChange:En(W.date),options:da(k,K,o,i,!!t.reverseYears),style:h?.[b.Dropdown],value:i.getYear(W.date)}):y.createElement("span",{key:"year"},Z(W.date,i));return i.getMonthYearOrder()==="year-first"?[F,w]:[w,F]})(),y.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},j(W.date,i.options,i))):y.createElement(n.CaptionLabel,{className:c[b.CaptionLabel],role:"status","aria-live":"polite"},j(W.date,i.options,i))),f==="around"&&!t.hideNavigation&&Y===p-1&&y.createElement(n.NextMonthButton,{type:"button",className:c[b.NextMonthButton],tabIndex:A?void 0:-1,"aria-disabled":A?void 0:!0,"aria-label":xn(A),onClick:Ge,"data-animated-button":t.animate?"true":void 0},y.createElement(n.Chevron,{disabled:A?void 0:!0,className:c[b.Chevron],orientation:t.dir==="rtl"?"left":"right"})),Y===p-1&&f==="after"&&!t.hideNavigation&&y.createElement(n.Nav,{"data-animated-nav":t.animate?"true":void 0,className:c[b.Nav],style:h?.[b.Nav],"aria-label":dt(),onPreviousClick:ze,onNextClick:Ge,previousMonth:U,nextMonth:A}),y.createElement(n.MonthGrid,{role:"grid","aria-multiselectable":m==="multiple"||m==="range","aria-label":pn(W.date,i.options,i)||void 0,className:c[b.MonthGrid],style:h?.[b.MonthGrid]},!t.hideWeekdays&&y.createElement(n.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:c[b.Weekdays],style:h?.[b.Weekdays]},v&&y.createElement(n.WeekNumberHeader,{"aria-label":Mn(i.options),className:c[b.WeekNumberHeader],style:h?.[b.WeekNumberHeader],scope:"col"},R()),Sn.map(w=>y.createElement(n.Weekday,{"aria-label":bn(w,i.options,i),className:c[b.Weekday],key:String(w),style:h?.[b.Weekday],scope:"col"},V(w,i.options,i)))),y.createElement(n.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:c[b.Weeks],style:h?.[b.Weeks]},W.weeks.map(w=>y.createElement(n.Week,{className:c[b.Week],key:w.weekNumber,style:h?.[b.Week],week:w},v&&y.createElement(n.WeekNumber,{week:w,style:h?.[b.WeekNumber],"aria-label":kn(w.weekNumber,{locale:a}),className:c[b.WeekNumber],scope:"row",role:"rowheader"},_(w.weekNumber,i)),w.days.map(F=>{const{date:X}=F,B=Ne(F);if(B[P.focused]=!B.hidden&&!!H?.isEqualTo(F),B[ue.selected]=d?.(X)||B.selected,Re(z)){const{from:Ue,to:qe}=z;B[ue.range_start]=!!(Ue&&qe&&i.isSameDay(X,Ue)),B[ue.range_end]=!!(Ue&&qe&&i.isSameDay(X,qe)),B[ue.range_middle]=ve(z,X,!0,i)}const Yn=la(B,h,t.modifiersStyles),An=zo(B,c,t.modifiersClassNames),Pn=!ut&&!B.hidden?yn(X,B,i.options,i):void 0;return y.createElement(n.Day,{key:`${F.isoDate}_${F.displayMonthId}`,day:F,modifiers:B,className:An.join(" "),style:Yn,role:"gridcell","aria-selected":B.selected||void 0,"aria-label":Pn,"data-day":F.isoDate,"data-month":F.outside?F.dateMonthId:void 0,"data-selected":B.selected||void 0,"data-disabled":B.disabled||void 0,"data-hidden":B.hidden||void 0,"data-outside":F.outside||void 0,"data-focused":B.focused||void 0,"data-today":B.today||void 0},!B.hidden&&ut?y.createElement(n.DayButton,{className:c[b.DayButton],style:h?.[b.DayButton],type:"button",day:F,modifiers:B,disabled:!B.focused&&B.disabled||void 0,"aria-disabled":B.focused&&B.disabled||void 0,tabIndex:me(F)?0:-1,"aria-label":hn(X,B,i.options,i),onClick:Nn(F,B),onBlur:On(F,B),onFocus:wn(F,B),onKeyDown:Cn(F,B),onMouseEnter:jn(F,B),onMouseLeave:Tn(F,B)},I(X,i.options,i)):!B.hidden&&I(F.date,i.options,i))})))))))),t.footer&&y.createElement(n.Footer,{className:c[b.Footer],style:h?.[b.Footer],role:"status","aria-live":"polite"},t.footer)))}function mn({className:e,classNames:t,showOutsideDays:s=!0,...n}){return r.jsx(Ba,{showOutsideDays:s,className:Le("p-3 pointer-events-auto",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:Le(mt({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:Le(mt({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{Chevron:({orientation:o})=>o==="left"?r.jsx(xs,{className:"h-4 w-4"}):r.jsx(bs,{className:"h-4 w-4"})},...n})}
1mn.displayName="Calendar";function Fa(){const e=_t();return zn({mutationFn:async({signinId:t,lateType:s,lateReason:n})=>{const o=await Gn(),l=await fetch(`${Un}/api/signins/${t}/late-tag`,{method:"PATCH",headers:o,body:JSON.stringify({late_type:s,late_reason:n??null})});if(!l.ok){const i=await l.json().catch(()=>({}));throw new Error(i.error||"Failed to update late tag")}return l.json()},onSuccess:()=>{e.invalidateQueries({queryKey:Pe.signins.byDate("").slice(0,1)})}})}function jt({signinId:e,lateMinutes:t,initialType:s}){const[n,o]=C.useState(s??null),l=Fa(),{toast:i}=It();if(t==null||t<=15)return r.jsx("span",{children:"—"});async function a(c){const u=c==="__clear__"?null:c,m=n;o(u);try{await l.mutateAsync({signinId:e,lateType:u}),i({title:u?`Tagged ${u}`:"Tag cleared"})}catch(f){o(m);const p=f instanceof Error?f.message:"Tag failed";i({title:"Error",description:p,variant:"destructive"})}}return r.jsxs("div",{className:"flex flex-col gap-1",children:[r.jsxs(de,{variant:"secondary",className:"bg-yellow-100 text-yellow-800 w-fit",children:[t,"m late"]}),r.jsxs(qn,{value:n??"__clear__",onValueChange:a,children:[r.jsx(Ln,{className:"h-7 text-xs w-[110px]",children:r.jsx(Vn,{placeholder:"Untagged"})}),r.jsxs(Zn,{children:[r.jsx(Ve,{value:"__clear__",children:"Untagged"}),r.jsx(Ve,{value:"excused",children:"Excused"}),r.jsx(Ve,{value:"unexcused",children:"Unexcused"})]})]})]})}function Ya(){const e=Kn(),t=e.data?.companyId??null,s=Qn({queryKey:Pe.company.timezone(t),enabled:!!t,queryFn:async()=>{const{data:n,error:o}=await Jn.from("companies").select("timezone").eq("id",t).maybeSingle();if(o)throw o;return n?.timezone??null},staleTime:300*1e3});return{...s,isLoading:e.isLoading||s.isLoading,isError:e.isError||s.isError,error:e.error??s.error,refetch:async()=>(e.isError&&await e.refetch(),s.refetch())}}const Aa=15,Pa=5,nt=300,$a=30;function Tt(e){return e?L(new Date(e),"h:mm a"):"—"}function Ra(e,t=!1){return e.filter(s=>s.lateDepartureMinutes!=null&&(t?s.lateDepartureMinutes>=Pa:s.lateDepartureMinutes>Aa)).sort((s,n)=>(n.lateDepartureMinutes??0)-(s.lateDepartureMinutes??0))}function Ha(e){return e.filter(t=>t.mealBreakOverdue).sort((t,s)=>(s.minutesSinceSignin??0)-(t.minutesSinceSignin??0))}function za(e){const t=nt-$a;return e.flatMap(s=>{const n=s.minutesSinceSignin,o=s.executionStatus==="COMPLETE"||s.executionStatus==="COMPLETED";if(n==null||!Number.isFinite(n)||n<t||n>nt||s.mealBreakOverdue||s.mealBreakStart||s.sessionEndTime||o||!s.appSigninAt)return[];const l=new Date(s.appSigninAt);return Number.isNaN(l.getTime())?[]:[{record:s,breakBy:new Date(l.getTime()+nt*6e4)}]}).sort((s,n)=>s.breakBy.getTime()-n.breakBy.getTime())}function Ga(e,t){const s=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(e),n=o=>s.find(l=>l.type===o)?.value??"";return`${n("year")}-${n("month")}-${n("day")}`}function Wt(e,t){const s=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",hour:"numeric",minute:"2-digit",hour12:!0,timeZoneName:"short"}).format(e),n=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",month:"short",day:"numeric"}).format(e);return{clock:s,context:`${n} · ${t}`,full:`${n} at ${s} (${t})`}}function Ua(e,t,s){if(!s)return Wt(e,"company timezone unavailable");try{const n=new Intl.DateTimeFormat("en-US",{timeZone:s,hour:"numeric",minute:"2-digit",hour12:!0,timeZoneName:"short"}).format(e);if(Ga(e,s)===t)return{clock:n,context:null,full:n};const o=new Intl.DateTimeFormat("en-US",{timeZone:s,month:"short",day:"numeric"}).format(e);return{clock:n,context:`break date ${o}`,full:`${o} at ${n}`}}catch(n){return console.error("Failed to format meal-break deadline in company timezone",{timeZone:s,error:n}),Wt(e,"invalid company timezone")}}function qa(e){return e.filter(t=>t.shiftFlags.some(s=>s.type==="INSUFFICIENT_REST")||t.overtimeDurationSecs!=null&&t.overtimeDurationSecs>0)}function La(){const{selectedStationCode:e}=Xn(),[t]=Bt(),s=t.get("date"),n=/^\d{4}-\d{2}-\d{2}$/.test(s??"")?s:null,o=t.get("scope")==="all"?null:e,l=Ns(e),i=n??l.data?.business_date??null,a=!!(n&&n!==l.data?.business_date),{records:c,isLoading:u,isError:m,refetch:f,selectedDate:p}=$t({businessDate:i,stationCode:o,enabled:!!i}),{allDrivers:g}=Ht(),D=Ya(),{data:T}=es(),M=ts(),[E,O]=C.useState(null),x=zt(m,c),S=C.useMemo(()=>Ra(c,a),[a,c]),v=C.useMemo(()=>Ha(c),[c]),h=C.useMemo(()=>za(c),[c]),j=C.useMemo(()=>qa(c),[c]),I=c.length,N=T?.channels?.SIGNIN,_=N?.last_success?.completed_at??null,R=Es(_),V=!!N?.last_sync&&N.last_sync.status==="failed",Z=!!N?.last_sync_unknown,G=(k,K)=>{O([{daId:k.driverId,fullName:k.fullName,phone:null,violationReason:K}])},J=k=>g.find(K=>K.id===k.driverId)?.photoThumbUrl??null,be=S.length===0&&h.length===0&&v.length===0&&j.length===0;return r.jsxs("div",{className:"mx-auto max-w-[1000px] px-6 py-6",children:[r.jsx(Is,{title:"Sign-ins",scope:r.jsxs("span",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[r.jsx("span",{children:i?L(
1p,"EEE MMM d"):l.isError?"Company date unavailable":"Resolving company date…"}),r.jsx("span",{"aria-hidden":!0,children:"·"}),i?u?r.jsx("span",{className:"text-faint",children:"counting…"}):x?r.jsx("span",{children:"Sign-in count unavailable"}):r.jsx(Bs,{shown:I,total:I,noun:"signed in"}):r.jsx("span",{className:"text-faint",children:l.isError?"Sign-in count unavailable":"waiting for company date…"}),r.jsx("span",{"aria-hidden":!0,children:"·"}),r.jsx(_s,{freshness:R,asOf:_?Tt(_):void 0})]})}),l.isError&&r.jsx(Oe,{reason:"Couldn't load the company date for sign-ins.",onRetry:()=>{l.refetch()},className:"mb-4"}),!a&&(V||Z)&&!x&&r.jsx(Oe,{reason:M.isPending?"A fresh sign-in sync is being queued. Today may be incomplete until it lands.":V?"The last sign-in sync from Amazon failed, so today may be incomplete.":"Couldn't check whether the last sign-in sync succeeded, so today may be incomplete.",onRetry:M.isPending?void 0:()=>M.mutate({syncType:"SIGNIN"}),retryLabel:"Sync now",className:"mb-4"}),!a&&M.isError&&r.jsx(Oe,{reason:`Couldn't queue the sign-in sync: ${ns(M.error)}`,onRetry:()=>M.mutate({syncType:"SIGNIN"}),retryLabel:"Try sync again",className:"mb-4"}),!a&&M.isSuccess&&r.jsx("div",{role:"status",className:"mb-4 rounded-lg bg-success-tint px-4 py-3 text-s3 text-success-deep",children:"Sign-in sync queued. Amazon data can take a minute to land."}),x&&r.jsx(Oe,{reason:a?"Couldn't load sign-ins for this date.":"Couldn't load today's sign-ins.",onRetry:()=>f(),className:"mb-4"}),m&&c.length>0&&r.jsx(Oe,{reason:"Sign-ins may be out of date. The last loaded records remain visible.",onRetry:()=>f(),className:"mb-4"}),!i&&!l.isError?r.jsx("div",{className:"overflow-hidden rounded-xl border border-hairline bg-surface",children:r.jsx(gt,{rows:6})}):l.isError?null:u&&!c.length?r.jsx("div",{className:"overflow-hidden rounded-xl border border-hairline bg-surface",children:r.jsx(gt,{rows:6})}):x?null:c.length===0?r.jsx(Fe,{kind:_?"filtered":"never-connected",title:"No sign-ins recorded for this day",detail:"There are no records to check for late departures or meal breaks.",action:r.jsx(Ye,{onClick:()=>f(),children:"Reload sign-ins"})}):r.jsxs("div",{className:"space-y-4",children:[r.jsx(Ie,{name:a?"Late departures":"Late right now",count:S.length,tone:"blocking",metricLabel:"Late by",children:S.length===0?r.jsx(Fe,{kind:"clear",title:`Checked ${I} sign-ins — nobody is late`}):S.map(k=>r.jsx(Be,{evidence:k.lateReason??(k.lateType==="excused"?"excused":void 0),metric:r.jsx(Ee,{tone:"blocking",children:`+${k.lateDepartureMinutes} min`}),action:a?void 0:r.jsx(Ye,{size:"sm","aria-label":`Text ${k.fullName}`,onClick:()=>G(k,`Departed ${k.lateDepartureMinutes} min late`),children:"Text"}),children:r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(_e,{name:k.fullName,photoUrl:J(k),size:"sm"}),k.fullName]})},k.id))}),r.jsx(Ie,{name:a?"Meal break was due within 30 min":"Meal break due within 30 min",count:h.length,tone:"drifting",consequence:"meal-break law watch",metricLabel:"Break by",children:h.length===0?r.jsx(Fe,{kind:"clear",title:"No meal breaks due within 30 min"}):h.map(({record:k,breakBy:K})=>{const U=Ua(K,k.signinDate,D.data??null);return r.jsx(Be,{evidence:[`${k.minutesSinceSignin} min since sign-in`,U.context].filter(Boolean).join(" · "),metric:r.jsx(Ee,{tone:"drifting",children:U.clock}),action:a?void 0:r.jsx(Ye,{size:"sm","aria-label":`Send meal-break reminder to ${k.fullName}`,onClick:()=>G(k,`Meal break due by ${U.full}`),children:"Send reminder"}),children:r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(_e,{name:k.fullName,photoUrl:J(k),size:"sm"}),k.fullName]})},k.id)})}),r.jsx(Ie,{name:a?"Meal break was overdue":"Meal break overdue",count:v.length,tone:"drifting",metricLabel:"On road",children:v.length===0?r.jsx(Fe,{kind:"clear",title:"No meal breaks overdue"}):v.map(k=>r.jsx(Be,{evidence:k.appSigninAt?`signed in ${Tt(k.appSigninAt)}`:void 0,metric:r.jsx(Ee,{tone:"drifting",unit:"min",children:k.minutesSinceSignin??"—"}),action:a?void 0:r.jsx(Ye,{size:"sm",onClick:()=>G(k,"Meal break overdue"),children:"Send reminder"}),children:r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(_e,{name:k.fullName,photoUrl:J(k),size:"sm"}),k.fullName]})},k.id))}),j.length>0&&r.jsx(Ie,{name:"Rest and overtime flags",count:j.length,tone:"drifting",metricLabel:"Flag",children:j.map(k=>r.jsx(Be,{evidence:k.restHoursBefore!=null?`${k.restHoursBefore.toFixed(1)}h rest before shift`:void 0,metric:r.jsx(Ee,{tone:"drifting",children:k.shiftFlags.some(K=>K.type==="INSUFFICIENT_REST")?"Short rest":"Overtime"}),children:r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(_e,{name:k.fullName,photoUrl:J(k),size:"sm"}),k.fullName]})},k.id))}),be&&!x&&r.jsxs("div",{className:"flex items-center gap-2 px-1 py-3 text-s3 text-subtle",children:[r.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-success-solid","aria-hidden":!0}),a?"No recorded late departures, meal-break exceptions, or rest flags for this date.":"No late departures, upcoming or overdue meal breaks, or rest flags so far today."]}),r.jsx("div",{className:"px-1 pt-2 text-s5 text-subtle",children:r.jsx(Ae,{className:"underline hover:text-ink",to:"/dashboard/signins?view=roster",children:a?"Open the current full roster":"Open the full roster"})})]}),E&&!a&&r.jsx(Rt,{open:!0,onClose:()=>O(null),recipients:E,sourcePage:"signins",mode:"single"})]})}function Me(e){return e?L(new Date(e),"h:mm a"):"—"}const st={all:"All",completed:"Meal Completed",on_break:"On Break",overdue:"Overdue",pending:"Pending",late_departure:"Late Departure",rest_violation:"Rest Violation",overtime:"Overtime",delivery_gap:"Delivery Gap > 1hr"};function $r(){const{screens:e}=ss(),[t]=Bt(),s=t.get("view")==="roster";return e&&!s?r.jsx(La,{}):r.jsx(Va,{})}function Va(){const e=Cs("signins-tracking"),{records:t,summary:s,isLoading:n,isError:o,refetch:l,selectedDate:i,setSelectedDate:a,dateStr:c}=$t(),u=zt(o,t),{drivers:m}=Ht(),f=C.useMemo(()=>{const d=new Map,q=new Map;for(const z of m){const oe={photoUrl:z.photoUrl,photoThumbUrl:z.photoThumbUrl,dob:z.dob,workPhone:z.workPhone};d.set(z.id,oe),q.set(z.fullName,oe)}return{byId:d,byName:q}},[m]),p=L(i,"MM-dd"),{isConnected:g,isSyncing:D,signinSyncElapsed:T,syncProgressDetail:M,lastSyncResult:E,triggerSigninSync:O,serviceAreaId:x}=ws(),{data:S=[]}=Os(),v=_t(),{toast:h}=It(),{data:j}=os(),I=C.useRef(E),[N,_]=C.useState("all"),[R,V]=C.useState(!1),[Z,G]=C.useState(!1),J=S.length>0?S.every(d=>!!d.service_area_id):!!x,be=as(j,"standard"),k=C.useMemo(()=>N==="all"?t:t.filter(d=>{switch(N){case"completed":return d.mealBreakStart&&d.mealBreakEnd;case"on_break":return d.mealBreakStart&&!d.mealBreakEnd;case"overdue":return d.mealBreakOverdue;
1case"pending":return!d.mealBreakStart&&!d.mealBreakOverdue;case"late_departure":return d.lateDepartureMinutes!=null&&d.lateDepartureMinutes>15;case"rest_violation":return d.shiftFlags.some(q=>q.type==="INSUFFICIENT_REST");case"overtime":return d.overtimeDurationSecs!=null&&d.overtimeDurationSecs>0;case"delivery_gap":return d.deliveryGapMin!=null&&d.deliveryGapMin>60;default:return!0}}),[t,N]),K=d=>{_(q=>q===d?"all":d)};C.useEffect(()=>{if(E&&E!==I.current)if(I.current=E,E.ok){const d=E.stats,q=d?.total_synced||0,z=d?.contacts_updated||0,oe=d?.late_departures||0,H=d?.rest_violations||0;if(q===0)h({title:"No sign-ins yet",description:z>0?`No drivers have signed in yet, but ${z} contacts were updated.`:"No drivers have signed in for this date."});else{const me=[`${q} drivers synced.`,`${d?.overdue_meal_breaks||0} overdue.`];oe>0&&me.push(`${oe} late departures.`),H>0&&me.push(`${H} rest violations.`),z>0&&me.push(`${z} contacts updated.`),h({title:"Sync complete",description:me.join(" ")})}v.invalidateQueries({queryKey:Pe.signins.byDate(c)}),v.invalidateQueries({queryKey:Pe.drivers.list()})}else h({title:"Sync failed",description:E.error||"Unknown error",variant:"destructive"})},[E,h,v,c]);const U=()=>{O(c)},A=C.useMemo(()=>t.filter(d=>d.mealBreakOverdue),[t]),ie=C.useMemo(()=>A.map(d=>({daId:d.id,fullName:d.fullName,phone:null,alertLevel:"overdue",violationReason:d.minutesSinceSignin?`${d.minutesSinceSignin}m without break`:void 0})),[A]),Ne=C.useMemo(()=>{const d=A[0];if(d)return{signinTime:d.appSigninAt?L(new Date(d.appSigninAt),"h:mm a"):void 0,minutesWithoutBreak:d.minutesSinceSignin??void 0,timeOnShift:d.appSigninAt&&d.sessionEndTime?`${Math.round((new Date(d.sessionEndTime).getTime()-new Date(d.appSigninAt).getTime())/6e4)}m`:d.minutesSinceSignin?`${Math.floor(d.minutesSinceSignin/60)}h ${d.minutesSinceSignin%60}m`:void 0}},[A]);return r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-2xl font-bold",children:"Sign-in Tracking"}),r.jsxs("p",{className:"text-muted-foreground mt-1",children:["Daily driver sign-in, meal break, and shift compliance ·"," ",r.jsx(Ae,{to:"/dashboard/sync",className:"text-blue-600 hover:underline",children:"Sync Center"})]})]}),r.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[A.length>0&&(Z?r.jsxs(ee,{size:"sm",className:"gap-2 bg-emerald-500 hover:bg-emerald-500 cursor-default pointer-events-none",children:[r.jsx(vt,{className:"h-4 w-4"}),"✓ Notified"]}):r.jsxs(ee,{onClick:()=>V(!0),variant:"destructive",size:"sm",className:"gap-2",title:`Send meal break reminder to ${A.length} overdue drivers`,children:[r.jsx(rs,{className:"h-4 w-4"}),"Notify ",A.length," Overdue"]})),g?r.jsxs(ee,{onClick:()=>U(),disabled:D,className:"gap-2",children:[r.jsx(Ze,{className:`h-4 w-4 ${D?"animate-spin":""}`}),D?`Syncing... ${T}s`:"Sync from Amazon"]}):r.jsxs(ee,{disabled:!0,variant:"outline",className:"gap-2",children:[r.jsx(Fs,{className:"h-4 w-4"}),"Extension not connected"]}),D&&M&&r.jsx("span",{className:"text-xs text-blue-600 animate-pulse",children:M}),be&&r.jsxs(ee,{variant:"outline",size:"sm",className:"gap-1",onClick:()=>us(k.map(d=>({Name:d.fullName,"Sign-in":d.appSigninAt?L(new Date(d.appSigninAt),"h:mm a"):"","Shift End":d.sessionEndTime?L(new Date(d.sessionEndTime),"h:mm a"):"","Meal Start":d.mealBreakStart?L(new Date(d.mealBreakStart),"h:mm a"):"","Meal End":d.mealBreakEnd?L(new Date(d.mealBreakEnd),"h:mm a"):"","Delivery Gap (min)":d.deliveryGapMin??"","Rest Before (h)":d.restHoursBefore??"",Status:d.mealBreakOverdue?"Overdue":d.mealBreakStart&&d.mealBreakEnd?"Completed":d.mealBreakStart?"On Break":"Pending",Flags:d.shiftFlags.map(q=>q.type).join(", ")})),`signins-${L(i,"yyyy-MM-dd")}.csv`),disabled:k.length===0,children:[r.jsx(Ys,{className:"h-3.5 w-3.5"}),"CSV"]}),r.jsxs(is,{children:[r.jsx(ls,{asChild:!0,children:r.jsxs(ee,{variant:"outline",className:"gap-2",children:[r.jsx(Ke,{className:"h-4 w-4"}),L(i,"PPP")]})}),r.jsx(cs,{className:"w-auto p-0",align:"end",children:r.jsx(mn,{mode:"single",selected:i,onSelect:d=>d&&a(d)})})]}),e.content&&r.jsx(js,{onClick:e.openHelp,floating:!1})]})]}),r.jsx(Ts,{isOpen:e.isOpen,onClose:e.closeHelp,content:e.content}),!g&&r.jsxs("div",{className:"border border-yellow-200 bg-yellow-50 rounded-md px-4 py-3 text-sm text-yellow-800",children:[r.jsx("p",{className:"font-medium",children:"Chrome Extension not detected"}),r.jsx("p",{className:"text-yellow-600 mt-1",children:"Install the Sortd Chrome Extension and make sure you're logged into logistics.amazon.com to sync sign-in data directly from this page."})]}),g&&!J&&r.jsxs("div",{className:"border border-amber-200 bg-amber-50 rounded-md px-4 py-3 text-sm text-amber-800",children:[r.jsx("p",{className:"font-medium",children:"Service Area ID not configured"}),r.jsx("p",{className:"text-amber-600 mt-1",children:"Go to Settings > Extension to enter your station's Service Area ID, or visit the Amazon Relay Execution page to auto-detect it."})]}),!u&&r.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4",children:[r.jsx(De,{title:"Total Signed In",value:s.totalSignedIn,icon:ds,iconColor:"text-info-solid",tooltip:"Drivers who have signed in via the app for the selected date. Click to clear filters.",onClick:()=>_("all"),active:N==="all"}),r.jsx(De,{title:"Meal Completed",value:s.mealCompleted,icon:vt,iconColor:"text-emerald-500",tooltip:"Drivers who have completed their meal break. Click to filter.",onClick:()=>K("completed"),active:N==="completed"}),r.jsx(De,{title:"On Break",value:s.onBreak,icon:As,iconColor:"text-warning-solid",tooltip:"Drivers currently on a meal break. Click to filter.",onClick:()=>K("on_break"),active:N==="on_break"}),r.jsx(De,{title:"Overdue Meal Breaks",value:s.overdueMealBreaks,icon:ht,iconColor:s.overdueMealBreaks>0?"text-rose-500":"text-muted-foreground",tooltip:"Drivers who haven't taken a required meal break. Click to filter.",onClick:()=>K("overdue"),active:N==="overdue"}),r.jsx(De,{title:"Lunch Gaps > 1hr",value:s.deliveryLunchGaps,icon:ht,iconColor:s.deliveryLunchGaps>0?"text-rose-500":"text-muted-foreground",tooltip:"Drivers where delivery gap around lunch exceeds 60 minutes — potential wage theft. Click to filter.",onClick:()=>K("delivery_gap"),active:N==="delivery_gap"}),r.jsx(De,{title:"Rest Violations",value:s.restViolations,icon:$s,iconColor:s.restViolations>0?"text-rose-500":"text-muted-foreground",tooltip:"Drivers with less than 10 hours rest since previous shift. Click to filter.",onClick:()=>K("rest_violation"),active:N==="rest_violation"})]}),N!=="all"&&r.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.jsxs("span",{className:"text-muted-foreground",children:["Showing ",k.length," of ",t.length," — filtered by ",r.jsx("span",{className:"font-medium",children:st[N]})]}),r.jsx(ee,{variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>_("all"),children:"Clear filter"})]}),n?r.jsx(Ss,{className:"h-96"}):u?r.jsx(Ws,{title:"Couldn't load today's sign-ins",onRetry:l}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"md:hidden space-y-2","data-testid":"signins-mobile-cards",children:[k.map(d=>{const q=d.shiftFlags.some($=>$.type==="INSUFFICIENT_REST"),z=d.deliveryGapMin!=null&&d.deliveryGapMin>60,oe=q||d.mealBreakOverdue||z?"bg-rose-50":"",H=(d.driverId?f.byId.get(d.driverId):void 0)??f.byName.get(d.fullName),me=!!H?.dob&&H.dob.slice(5)===p;return r.jsxs("div",{className:`border rounded-md bg-white p-3 ${oe}`,children:[r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[r.jsx(yt,{name:d.fullName,photoUrl:H?.photoThumbUrl??H?.photoUrl??null,size:"sm"}),r.jsx("span",{className:"truncate font-medium text-slate-900",children:d.fullName}),me&&r.jsx("span",{title:"Birthday today",children:r.jsx(xt,{className:"h-3.5 w-3.5 shrink-0","aria-label":"Birthday today"})})]}),d.mealBreakOverdue?r.jsx(de,{variant:"destructive",children:"Overdue"}):d.mealBreakStart&&d.mealBreakEnd?r.jsx(de,{className:"bg-emerald-100 text-emerald-800",children:"Completed"}):d.mealBreakStart?r.jsx(de,{className:"bg-yellow-100 text-yellow-800",children:"On Break"}):r.jsx(de,{variant:"outline",className:"text-muted-foreground",children:"Pending"})]}),r.jsx("div",{className:"mt-1 text-sm tabular-nums","data-testid":"signin-card-work-phone",children:H?.workPhone?r.jsx("a",{href:`tel:${H.workPhone}`,className:"text-slate-700 hover:text-slate-900 hover:underline",children:H.workPhone}):r.jsx("span",{className:"text-muted-foreground",children:"—"})}),r.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-x-3 gap-y-1 text-sm",children:[r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"Flex Sign-in:"})," ",Me(d.appSigninAt)]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"Shift End:"})," ",Me(d.sessionEndTime)]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"Meal Start:"})," ",Me(d.mealBreakStart)]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"Meal End:"})," ",Me(d.mealBreakEnd)]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"Delivery Gap:"})," ",d.deliveryGapMin!=null?d.deliveryGapMin>60?r.jsxs("span",{className:"font-medium text-rose-600",children:[d.deliveryGapMin,"m"]}):r.jsxs("span",{children:[d.deliveryGapMin,"m"]}):"—"]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-muted-foreground",children:"Rest:"})," ",d.restHoursBefore!=null?d.restHoursBefore<10?r.jsxs("span",{className:"font-medium text-rose-600",children:[d.restHoursBefore,"h"]}):r.jsxs("span",{children:[d.restHoursBefore,"h"]}):"—"]})]}),r.jsx("div",{className:"mt-2 border-t pt-2",children:r.jsx(jt,{signinId:d.id,lateMinutes:d.lateDepartureMinutes,initialType:d.lateType})}),d.shiftFlags.length>0&&r.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:d.shiftFlags.map(($,ke)=>r.jsx(de,{variant:$.level==="CRITICAL"?"destructive":"outline",className:$.level==="WARNING"?"bg-amber-100 text-amber-800 border-amber-200":"",title:$.message,children:$.type==="LATE_DEPARTURE"?"Late":$.type==="INSUFFICIENT_REST"?"Rest":$.type==="AMAZON_OVERTIME_FLAG"?"OT":$.type},ke))})]},d.id)}),k.length===0&&(N!=="all"&&t.length>0?r.jsx(We,{icon:bt,title:`No drivers match the "${st[N]}" filter`,why:`${t.length} sign-in record${t.length===1?" is":"s are"} hidden by the active filter.`,action:r.jsx(ee,{variant:"outline",size:"sm",onClick:()=>_("all"),children:"Clear filter"})}):r.jsx(We,{icon:Ke,title:"No sign-in records for this date",why:`Sign-in data comes from the daily sign-in sync — nothing has synced for ${L(i,"PPP")} yet.`,action:g?r.jsxs(ee,{variant:"outline",size:"sm",onClick:U,disabled:D,children:[r.jsx(Ze,{className:"h-4 w-4 mr-2"}),"Sync from Amazon"]}):r.jsx(ee,{variant:"outline",size:"sm",asChild:!0,children:r.jsx(Ae,{to:"/dashboard/sync",children:"Open Sync Center"})})}))]}),r.jsx("div",{className:"hidden md:block border rounded-md bg-white overflow-auto","data-testid":"signins-desktop-table",children:r.jsxs(ks,{children:[r.jsx(Ms,{children:r.jsxs(Qe,{children:[r.jsx(le,{children:"Driver Name"}),r.jsx(le,{className:"w-[140px]",children:"Work phone"}),r.jsx(le,{className:"w-[100px]",children:"Flex Sign-in"}),r.jsx(le,{className:"w-[100px]",children:"Shift End"}),r.jsx(le,{className:"w-[100px]",children:"Meal Start"}),r.jsx(le,{className:"w-[100px]",children:"Meal End"}),r.jsx(le,{className:"w-[100px] text-center",children:"Delivery Gap"}),r.jsx(le,{className:"w-[80px] text-center",children:r.jsx(pt,{entry:{meaning:"Hours of rest since the driver's last shift ended."},children:"Rest (h)"})}),r.jsx(le,{className:"w-[130px]",children:r.jsx(pt,{term:"Late tag",children:"Late tag"})}),r.jsx(le,{className:"w-[90px]",children:"Status"}),r.jsx(le,{className:"w-[120px]",children:"Flags"})]})}),r.jsxs(Ds,{children:[k.map(d=>{const q=d.shiftFlags.some($=>$.type==="INSUFFICIENT_REST"),z=d.deliveryGapMin!=null&&d.deliveryGapMin>60,oe=q||d.mealBreakOverdue||z?"bg-rose-50":"",H=(d.driverId?f.byId.get(d.driverId):void 0)??f.byName.get(d.fullName),me=!!H?.dob&&H.dob.slice(5)===p;return r.jsxs(Qe,{className:oe,children:[r.jsx(ae,{className:"font-medium",children:r.jsxs("span",{className:"inline-flex items-center gap-2",children:[r.jsx(yt,{name:d.fullName,photoUrl:H?.photoThumbUrl??H?.photoUrl??null,size:"sm"}),r.jsx("span",{children:d.fullName}),me&&r.jsx("span",{title:"Birthday today",children:r.jsx(xt,{className:"h-3.5 w-3.5 inline","aria-label":"Birthday today"})})]})}),r.jsx(ae,{className:"text-sm tabular-nums",children:H?.workPhone?r.jsx("a",{href:`tel:${H.workPhone}`,className:"text-slate-700 hover:text-slate-900 hover:underline",children:H.workPhone}):r.jsx("span",{className:"text-muted-foreground",children:"—"})}),r.jsx(ae,{className:"text-sm",children:Me(d.appSigninAt)}),r.jsx(ae,{className:"text-sm",children:Me(d.sessionEndTime)}),r.jsx(ae,{className:"text-sm",children:Me(d.mealBreakStart)}),r.jsx(ae,{className:"text-sm",children:Me(d.mealBreakEnd)}),r.jsx(ae,{className:"text-center text-sm",children:d.deliveryGapMin!=null?d.deliveryGapMin>60?r.jsxs("span",{className:"text-rose-600 font-medium",children:[d.deliveryGapMin,"m"]}):r.jsxs("span",{children:[d.deliveryGapMin,"m"]}):"—"}),r.jsx(ae,{className:"text-center text-sm",children:d.restHoursBefore!=null?d.restHoursBefore<10?r.jsxs("span",{className:"text-rose-600 font-medium",children:[d.restHoursBefore,"h"]}):r.jsxs("span",{children:[d.restHoursBefore,"h"]}):"—"}),r.jsx(ae,{children:r.jsx(jt,{signinId:d.id,lateMinutes:d.lateDepartureMinutes,initialType:d.lateType})}),r.jsx(ae,{children:d.mealBreakOverdue?r.jsx(de,{variant:"destructive",children:"Overdue"}):d.mealBreakStart&&d.mealBreakEnd?r.jsx(de,{className:"bg-emerald-100 text-emerald-800",children:"Completed"}):d.mealBreakStart?r.jsx(de,{className:"bg-yellow-100 text-yellow-800",children:"On Break"}):r.jsx(de,{variant:"outline",className:"text-muted-foreground",children:"Pending"})}),r.jsx(ae,{children:d.shiftFlags.length>0?r.jsx("div",{className:"flex flex-wrap gap-1",children:d.shiftFlags.map(($,ke)=>r.jsx(de,{variant:$.level==="CRITICAL"?"destructive":"outline",className:$.level==="WARNING"?"bg-amber-100 text-amber-800 border-amber-200":"",title:$.message,children:$.type==="LATE_DEPARTURE"?"Late":$.type==="INSUFFICIENT_REST"?"Rest":$.type==="AMAZON_OVERTIME_FLAG"?"OT":$.type},ke))}):"—"})]},d.id)}),k.length===0&&r.jsx(Qe,{className:"hover:bg-transparent",children:r.jsx(ae,{colSpan:11,className:"p-0",children:N!=="all"&&t.length>0?r.jsx(We,{icon:bt,title:`No drivers match the "${st[N]}" filter`,why:`${t.length} sign-in record${t.length===1?" is":"s are"} hidden by the active filter.`,action:r.jsx(ee,{variant:"outline",size:"sm",onClick:()=>_("all"),children:"Clear filter"})}):r.jsx(We,{icon:Ke,title:"No sign-in records for this date",why:`Sign-in data comes from the daily sign-in sync — nothing has synced for ${L(i,"PPP")} yet.`,action:g?r.jsxs(ee,{variant:"outline",size:"sm",onClick:U,disabled:D,children:[r.jsx(Ze,{className:"h-4 w-4 mr-2"}),"Sync from Amazon"]}):r.jsx(ee,{variant:"outline",size:"sm",asChild:!0,children:r.jsx(Ae,{to:"/dashboard/sync",children:"Open Sync Center"})})})})})]})]})})]}),r.jsx(Rt,{open:R,onClose:()=>V(!1),onSendComplete:()=>G(!0),recipients:ie,sourcePage:"signins",mode:A.length===1?"single":"bulk",defaultMessageType:"meal_overdue",shiftContext:Ne,drawerTitle:"Overdue Meal Break Alert",drawerSubtitle:A.length===1?`Send an SMS notification to ${A[0]?.fullName}`:`Send SMS to ${A.length} overdue drivers`})]})}
1export{$r as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.