@remit/web-client-dist 0.0.524 → 0.0.526
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{BriefPane-BFt6V6kp.js → BriefPane-ChrsOiI5.js} +1 -1
- package/assets/{CalendarComposePane-DAcupn2s.js → CalendarComposePane-BeSqVd3E.js} +1 -1
- package/assets/{CalendarComposeSeed-C1QkHXLM.js → CalendarComposeSeed-DqmTyao9.js} +1 -1
- package/assets/{CalendarShell-oqKF2eTp.js → CalendarShell-DoOVsgTA.js} +1 -1
- package/assets/{EmptyState-B5l4DUW4.js → EmptyState-si-DpWBi.js} +1 -1
- package/assets/{ErrorState--2p5I6wj.js → ErrorState-DksyoH5X.js} +1 -1
- package/assets/{FlaggedPane-DB-AxQh4.js → FlaggedPane-BMj3QRRB.js} +1 -1
- package/assets/{FullCompose-B4d9WZ6T.js → FullCompose-vuKBlugc.js} +1 -1
- package/assets/{MailListHeader-kD_OYiqE.js → MailListHeader-k_H6Nj4H.js} +1 -1
- package/assets/{MailNav-CjAVXeIh.js → MailNav-DN_Kc3Bn.js} +1 -1
- package/assets/{MailShell-C6gzPUuw.js → MailShell-DliaPrFT.js} +1 -1
- package/assets/{MailViewChrome-B6yFR2VU.js → MailViewChrome-DFEXKgDU.js} +1 -1
- package/assets/MailboxPane-DPGGYCIj.js +1 -0
- package/assets/{NavMenuButton-xOndgihg.js → NavMenuButton-BpJdTOUd.js} +1 -1
- package/assets/{OnboardingWizard--zWbuuZO.js → OnboardingWizard-D7paFnVr.js} +1 -1
- package/assets/{OpenCalendarEvent-hZfI9rcX.js → OpenCalendarEvent-LsXgRmZT.js} +1 -1
- package/assets/{OutboxPane-CmsB8bhV.js → OutboxPane-BFi1SiwR.js} +1 -1
- package/assets/_calendarObjectId-C8bi_6xj.js +1 -0
- package/assets/_mailboxId-DcquwoLW.js +1 -0
- package/assets/_messageId-BSPud1pw.js +1 -0
- package/assets/_messageId-Clm1QwiK.js +1 -0
- package/assets/_messageId-PlyimwIj.js +1 -0
- package/assets/_outboxMessageId-CirCf91-.js +1 -0
- package/assets/_recurrenceId-DcLNEidj.js +1 -0
- package/assets/_threadId-B5zTua86.js +1 -0
- package/assets/_threadId-CBuHxmpZ.js +1 -0
- package/assets/_threadId-DBcDTZRs.js +1 -0
- package/assets/{_view._date-Dxjb8BoQ.js → _view._date-UGVUqfVs.js} +1 -1
- package/assets/{accounts-DM22VN8r.js → accounts-CB0Wq5Wv.js} +1 -1
- package/assets/{advanced-j3PIafmB.js → advanced-Btvv2L8D.js} +1 -1
- package/assets/{appearance-D4ZyQxSJ.js → appearance-Ws6uLE80.js} +1 -1
- package/assets/{attachment-file-BKW1LvYE.js → attachment-file-C21uro77.js} +1 -1
- package/assets/{attendee-row-CaFcq0Dc.js → attendee-row-CSEOC_rC.js} +1 -1
- package/assets/{avatar-CMlohog8.js → avatar-DyyOeiDP.js} +1 -1
- package/assets/{bottom-sheet-FUNFJG28.js → bottom-sheet-BH7YA8BV.js} +1 -1
- package/assets/brief-D4o1cvk0.js +1 -0
- package/assets/{brief-oohldKpq.js → brief-DMFRGq3F.js} +1 -1
- package/assets/{browser-ponyfill-RH8G0PY5.js → browser-ponyfill-CGd4CVCY.js} +1 -1
- package/assets/{bug-BOAkHOob.js → bug-dN__8N63.js} +1 -1
- package/assets/{calendar-BCz_kEKP.js → calendar-DohMaine.js} +1 -1
- package/assets/{calendar-color-BjjneYsQ.js → calendar-color-BqkJ6lSl.js} +1 -1
- package/assets/{calendar-event-chip-MdQdmgJv.js → calendar-event-chip-CEV8NQqe.js} +1 -1
- package/assets/{calendars-k1Woz5Nm.js → calendars-BDzX8RkF.js} +1 -1
- package/assets/{card-IQFeqGVt.js → card-CU7p0QLH.js} +1 -1
- package/assets/chevron-left-B48FZfHn.js +1 -0
- package/assets/{circle-check-B73TBv-p.js → circle-check-DVyiwjVR.js} +1 -1
- package/assets/{circle-check-big-PApHOS4Q.js → circle-check-big-DdkGJGpC.js} +1 -1
- package/assets/{circle-help-W-bok798.js → circle-help-E11sse6u.js} +1 -1
- package/assets/{clock-C5E9t_wY.js → clock-DOYtgwmf.js} +1 -1
- package/assets/compose._-_outboxMessageId_-Cpj8vVxV.js +1 -0
- package/assets/compose._-_outboxMessageId_-Cuo6gGxJ.js +1 -0
- package/assets/compose._-_outboxMessageId_-DruwEntQ.js +1 -0
- package/assets/compose._-_outboxMessageId_-fv1A_7QR.js +1 -0
- package/assets/{config-import-j6Ex6rUg.js → config-import-DH0Mxjkj.js} +1 -1
- package/assets/{confirm-dialog-BTkV4N2t.js → confirm-dialog-CQKNczRE.js} +1 -1
- package/assets/{copy-htJcDYRm.js → copy-B2nKdyli.js} +1 -1
- package/assets/{credential-steps-SdAyOxLX.js → credential-steps-oIENxJFq.js} +1 -1
- package/assets/{download-iYbfvVSU.js → download-DCVWa6kB.js} +1 -1
- package/assets/{file-json-C19C1p7d.js → file-json-BL8FH43L.js} +1 -1
- package/assets/{filters-DGbq9Iiw.js → filters-BeCKmrpN.js} +1 -1
- package/assets/flagged-Ca1YCtQu.js +1 -0
- package/assets/{flagged-1F2_cRcu.js → flagged-D5JsLld2.js} +1 -1
- package/assets/{folders-BnesYLu2.js → folders-DOHqWxvg.js} +1 -1
- package/assets/{format-Cc3aS3ot.js → format-C9mypfPa.js} +1 -1
- package/assets/{help-copy-qqkMLJGu.js → help-copy-B85h1hLf.js} +1 -1
- package/assets/{import-Az3vjKU0.js → import-YSl5V1oz.js} +1 -1
- package/assets/index-BZK-F8Tc.js +1 -0
- package/assets/{index-86n4-j8G.js → index-C1CX0WpK.js} +4 -4
- package/assets/index-C7j5GQ1T.js +1 -0
- package/assets/index-CPXvRjvN.js +1 -0
- package/assets/index-Clm1QwiK.js +1 -0
- package/assets/index-Cq3Hu9_3.js +1 -0
- package/assets/index-D2HN1YCc.js +1 -0
- package/assets/{index-CCWDwdgT.js → index-DKQKVA9q.js} +1 -1
- package/assets/index-Ddj_5mDi.js +1 -0
- package/assets/{index-D855R0Fw.js → index-Dx85_wSY.js} +4 -4
- package/assets/index-DzohWosO.js +1 -0
- package/assets/index-PlyimwIj.js +1 -0
- package/assets/{kbd-Cfms0Oys.js → kbd-C52Xn_j4.js} +1 -1
- package/assets/{labels-CN0UpXfN.js → labels-BAdbLOt7.js} +1 -1
- package/assets/{mail-D8ExCCOr.js → mail-DGVfjm9r.js} +1 -1
- package/assets/{mail-CvvXmucI.js → mail-DuUKZxET.js} +1 -1
- package/assets/{map-pin-BqQOdN8M.js → map-pin-CGDPnrFh.js} +1 -1
- package/assets/{menu-BHyCi7rW.js → menu-mBksCdgx.js} +1 -1
- package/assets/{new-vVhGLr7X.js → new-CmTZgDYD.js} +1 -1
- package/assets/onboarding-BGRUkyi8.js +1 -0
- package/assets/{onboarding-completion-CZcSJIaU.js → onboarding-completion-CzkuNREJ.js} +1 -1
- package/assets/outbox-C17bRnc0.js +1 -0
- package/assets/{pencil-BcFzbpXu.js → pencil-D4xiQ_Vc.js} +1 -1
- package/assets/{refresh-cw-BzxgnCmO.js → refresh-cw-COcsl_Af.js} +1 -1
- package/assets/{rich-text-BwW7zU6h.js → rich-text-WCyToD6v.js} +1 -1
- package/assets/{rich-text-spellcheck-worker-provider-BQcgIDy1.js → rich-text-spellcheck-worker-provider-CbWUh336.js} +1 -1
- package/assets/{rotate-ccw-CShnXVol.js → rotate-ccw-C7qpdlSG.js} +1 -1
- package/assets/{row-actions-9TTs03mH.js → row-actions-B2DOiD0i.js} +1 -1
- package/assets/{search-mirror-CFC1hqWp.js → search-mirror-C0Pt1h-G.js} +1 -1
- package/assets/{search-token-index-CXxBVdX5.js → search-token-index-BmcMDs9b.js} +1 -1
- package/assets/{sections-BKWo2Deh.js → sections-DvdIZ0pl.js} +1 -1
- package/assets/{senders-CyD_tWBm.js → senders-CE-k6MQW.js} +1 -1
- package/assets/settings-BxcgB4m7.js +1 -0
- package/assets/{settings-screen-BgUjgGfb.js → settings-screen-BRiGvg7z.js} +1 -1
- package/assets/{shield-check-D_NOwpHN.js → shield-check-BOYjSFE9.js} +1 -1
- package/assets/{suggested-vips-BRv9v-4q.js → suggested-vips-m-in5SKs.js} +1 -1
- package/assets/{useCalendarData-CfZbbmWc.js → useCalendarData-D3St5evd.js} +1 -1
- package/assets/{useCalendars-CgIo_kEf.js → useCalendars-76VW276g.js} +1 -1
- package/assets/{useDebouncedValue-tudCfT8G.js → useDebouncedValue-DQNqGEPg.js} +1 -1
- package/assets/{useFilters-D55evI_2.js → useFilters-B-7bJBEK.js} +1 -1
- package/assets/{useLabels-BS3G7NVR.js → useLabels-DzwmxI3k.js} +1 -1
- package/assets/{useLayoutTier-BHxPbufX.js → useLayoutTier-BEYBSkpq.js} +1 -1
- package/assets/{useMessageBodyContent-I6J6WaYN.js → useMessageBodyContent-CeF9pGv7.js} +1 -1
- package/assets/{useQueries-3Ta-bqMs.js → useQueries-CmJQ3O9W.js} +1 -1
- package/assets/{useRefreshControl-9O_O25oC.js → useRefreshControl-C9hbfjgD.js} +1 -1
- package/assets/{useResultFolderIndex-CURSMky8.js → useResultFolderIndex-Cv7Yvb7w.js} +1 -1
- package/assets/{useSearchTokenContext-D1NKXhM6.js → useSearchTokenContext-DshmuDOq.js} +1 -1
- package/assets/{useSemanticSearch-F_a8SnAV.js → useSemanticSearch-DZwukc7P.js} +1 -1
- package/assets/{useSignature-g4RGAb59.js → useSignature-jcBnHxI3.js} +1 -1
- package/assets/{window-BqaZu6ux.js → window-WjXllrlA.js} +1 -1
- package/index.html +1 -1
- package/package.json +1 -1
- package/assets/MailboxPane-DQb-w_Zk.js +0 -1
- package/assets/_calendarObjectId-CW7GoKo_.js +0 -1
- package/assets/_mailboxId-Bh6x_4Ta.js +0 -1
- package/assets/_messageId-BjdqRzNA.js +0 -1
- package/assets/_messageId-DYsODVAs.js +0 -1
- package/assets/_messageId-nZeew1Yi.js +0 -1
- package/assets/_outboxMessageId-BN-zHE9o.js +0 -1
- package/assets/_recurrenceId-Mxrcukbt.js +0 -1
- package/assets/_threadId-D4A-Ul62.js +0 -1
- package/assets/_threadId-DoPvTr-5.js +0 -1
- package/assets/_threadId-DrlECOd9.js +0 -1
- package/assets/brief-iiiTsECw.js +0 -1
- package/assets/chevron-left-BuHbO0ZQ.js +0 -1
- package/assets/compose._-_outboxMessageId_-BCv8oXYc.js +0 -1
- package/assets/compose._-_outboxMessageId_-BWWPKba4.js +0 -1
- package/assets/compose._-_outboxMessageId_-D8GfOivD.js +0 -1
- package/assets/compose._-_outboxMessageId_-rF2ebCVH.js +0 -1
- package/assets/flagged-CMInazao.js +0 -1
- package/assets/index-BbRtyPkp.js +0 -1
- package/assets/index-BiVNUJYH.js +0 -1
- package/assets/index-CLF7GeDo.js +0 -1
- package/assets/index-DXNSFZn6.js +0 -1
- package/assets/index-DYsODVAs.js +0 -1
- package/assets/index-X31FqCoN.js +0 -1
- package/assets/index-hhDrR9zg.js +0 -1
- package/assets/index-lIM5lIlU.js +0 -1
- package/assets/index-nZeew1Yi.js +0 -1
- package/assets/onboarding-BZef3Ejq.js +0 -1
- package/assets/outbox-BJKNqc37.js +0 -1
- package/assets/settings-2lNX20rB.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r,a1 as Is,bU as ks,bV as Ts,cK as js,B as ct,f as te,U as ws,t as Ae,g as Pt,r as c,Y as Ms,Z as Rs,bo as Es,h as Tt,c as ut,ac as Os,i as jt,cL as Ns,cB as As,I as zs,a6 as Fs,a2 as $t,bO as Ds,bi as _s,cM as Ls,cN as Ps,as as Bt,aX as $s,aY as Bs,q as wt,m as Ws,M as Wt,bl as Ks,G as Vs,bm as qs,bn as Hs,cO as Us,o as Qs,cP as Js,cz as Gs,s as Ys,cQ as Xs,cR as Zs,ch as Kt,cS as Vt,C as qt,ah as en,cT as tn,cU as sn,aj as nn,bx as on}from"./index-Dx85_wSY.js";import{u as rn,p as an,R as ln}from"./useSearchTokenContext-DshmuDOq.js";import{u as cn,a as un,R as dn}from"./useRefreshControl-C9hbfjgD.js";import{C as Ht,a as Ut,c as Qt,j as hn,M as fn,t as Jt,u as mn,b as gn,d as Gt,e as Yt,f as pn,g as xn,h as bn,r as vn,n as Sn,i as yn,k as Cn,l as In,m as kn,o as Tn,S as jn,p as wn,D as Mn,q as Rn,s as En,v as Xt,w as On,x as Nn,y as An,z as zn,A as Fn,B as Zt,E as Dn,F as _n,G as Ln,H as Pn,I as zt,J as Ft,K as $n,L as Bn,N as Wn,O as Kn,P as Vn,Q as qn,R as Hn,T as Un,U as Qn,V as Jn,W as Gn,X as Yn,Y as es,Z as ts,_ as ss,$ as Xn,a0 as Zn,a1 as eo,a2 as to,a3 as so,a4 as no,a5 as oo}from"./MailListHeader-k_H6Nj4H.js";import{S as io,M as ro,a as ao,i as lo,h as co,t as uo,u as ho,b as fo,c as mo,f as go,d as po,s as xo}from"./MailViewChrome-DFEXKgDU.js";import{A as Mt}from"./avatar-DyyOeiDP.js";import{c as Qe,d as bo,e as ns}from"./format-C9mypfPa.js";import{c as vo,f as So,a as yo,u as Co}from"./useMessageBodyContent-CeF9pGv7.js";import{g as Je,i as Io,t as ko,h as To,j as jo,k as wo,l as Mo}from"./search-token-index-BmcMDs9b.js";import{N as Ro}from"./NavMenuButton-BpJdTOUd.js";import{C as Eo}from"./confirm-dialog-CQKNczRE.js";import{f as Oo}from"./ErrorState-DksyoH5X.js";import{a as No}from"./useLabels-DzwmxI3k.js";import{L as Ao,r as zo,u as Fo}from"./useSemanticSearch-DZwukc7P.js";import{S as dt}from"./shield-check-BOYjSFE9.js";import{B as Do}from"./bottom-sheet-BH7YA8BV.js";import{C as _o}from"./circle-help-E11sse6u.js";import{C as Lo}from"./circle-check-DVyiwjVR.js";import{u as Po}from"./useLayoutTier-BEYBSkpq.js";import{n as $o}from"./search-query-Cr_ZXBCp.js";import{u as Bo}from"./sections-DvdIZ0pl.js";const Wo=e=>e.toLocaleString(),Ko=(e,o)=>{if(e.kind==="unknown")return`Results for “${o}”`;const t=e.value===1?"result":"results";return`${Wo(e.value)} ${t} for “${o}”`};function Vo({query:e,count:o}){return r.jsxs("div",{className:"flex items-center gap-2 border-b border-line bg-surface-sunken/30 px-3 py-2",children:[r.jsx(Is,{className:"size-4 text-fg-muted","aria-hidden":"true"}),r.jsx("span",{className:"text-sm text-fg-muted",children:Ko(o,e)})]})}const qo=({children:e,onRefresh:o,isRefreshing:t})=>ks(Ts)?e:r.jsx(js,{onRefresh:o,isPullable:!t,children:e}),Ho=e=>e===1?"message":"messages";function Uo({count:e,onReview:o,onDismiss:t,actionLabel:s="Review & rescue"}){return r.jsx(ct,{tone:"info",variant:"soft",onDismiss:t,children:r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsxs("p",{className:"flex items-start gap-2 text-sm text-fg",children:[r.jsx(dt,{className:"mt-0.5 size-4 shrink-0 text-positive","aria-hidden":!0}),r.jsxs("span",{children:[r.jsx("span",{className:"font-semibold text-fg",children:`${e} ${Ho(e)} here`})," ","may not be spam — they're from senders we can verify."]})]}),r.jsx(te,{variant:"primary",size:"sm",onClick:o,className:"self-start",children:s})]})})}const Qo=(e,o)=>e==="vip"?"vip":e==="unknown"&&o==="md"?"unknown-pill":"hidden",os=({senderTrust:e,size:o="sm",className:t})=>{const s=Qo(e,o);return s==="vip"?r.jsx(ws,{className:Ae("text-warning shrink-0",o==="sm"&&"size-3.5",o==="md"&&"size-4",t),"aria-label":"VIP sender","data-testid":"sender-trust-vip"}):s==="unknown-pill"?r.jsx("span",{className:Ae("inline-flex items-center rounded border border-dashed border-fg-subtle/40 font-medium uppercase tracking-wide text-fg-muted/80 shrink-0","px-2 py-0.5 text-xs",t),title:"First message from this sender","aria-label":"First message from this sender","data-testid":"sender-trust-unknown",children:"new"}):null};function Jo({candidate:e,selected:o,onToggle:t,hideSender:s=!1}){const{senderName:n,senderAddress:i,subject:l,snippet:a,trustReason:u,trustSubReason:d,senderTrust:h}=e;return r.jsxs("label",{className:Ae("flex w-full cursor-pointer items-start gap-3 px-3 py-2.5 text-left transition-colors",s&&"pl-11",o?"bg-positive/10":"bg-surface hover:bg-surface-sunken"),children:[r.jsx(Ht,{className:"mt-0.5",checked:o,onChange:t,"aria-label":`${o?"Deselect":"Select"} ${s?l:`message from ${n}`}`}),!s&&r.jsx(Mt,{name:n,email:i,size:"sm"}),r.jsxs("span",{className:"min-w-0 flex-1",children:[!s&&r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"truncate text-sm font-medium text-fg",children:n}),h&&r.jsx(os,{senderTrust:h,size:"sm"}),r.jsx("span",{className:"truncate text-2xs text-fg-subtle",children:i})]}),r.jsx("span",{className:"block truncate text-sm text-fg-muted",children:l}),r.jsx("span",{className:"block line-clamp-1 text-xs text-fg-subtle",children:a}),!s&&r.jsxs("span",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[r.jsxs(Pt,{tone:"positive",children:[r.jsx(dt,{className:"size-3","aria-hidden":!0}),u]}),r.jsx("span",{className:"text-2xs text-fg-subtle",children:d})]})]})]})}const Go=e=>{const o=new Map,t=[];for(const s of e){const n=(s.senderAddress||s.senderName).toLowerCase(),i=o.get(n);if(i){i.messages.push(s);continue}o.set(n,{key:n,senderName:s.senderName,senderAddress:s.senderAddress,trustReason:s.trustReason,trustSubReason:s.trustSubReason,senderTrust:s.senderTrust,messages:[s]}),t.push(n)}return t.map(s=>o.get(s)).sort((s,n)=>n.messages.length-s.messages.length)},Yo=(e,o)=>{const t=e.messages.filter(s=>o.has(s.id)).length;return t===0?"none":t===e.messages.length?"all":"some"},Dt=e=>e===1?"message":"messages";function Xo({group:e,selected:o,onToggleGroup:t,onToggleMessage:s}){const[n,i]=c.useState(!1),l=Yo(e,o),a=e.messages.length,u=n?Ms:Rs;return r.jsxs("div",{className:Ae(l!=="none"?"bg-positive/10":"bg-surface"),children:[r.jsxs("div",{className:"flex w-full items-start gap-3 px-3 py-2.5",children:[r.jsx(Ht,{className:"mt-0.5",checked:l==="all",indeterminate:l==="some",onChange:()=>t(e,l!=="all"),"aria-label":`${l==="all"?"Deselect":"Select"} all ${a} ${Dt(a)} from ${e.senderName}`}),r.jsx(Mt,{name:e.senderName,email:e.senderAddress,size:"sm"}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-1.5",children:[r.jsx("span",{className:"truncate text-sm font-medium text-fg",children:e.senderName}),e.senderTrust&&r.jsx(os,{senderTrust:e.senderTrust,size:"sm"}),r.jsx("span",{className:"truncate text-2xs text-fg-subtle",children:e.senderAddress})]}),r.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[r.jsxs(Pt,{tone:"positive",children:[r.jsx(dt,{className:"size-3","aria-hidden":!0}),e.trustReason]}),r.jsx("span",{className:"text-2xs text-fg-subtle",children:e.trustSubReason})]})]}),r.jsxs("button",{type:"button",onClick:()=>i(d=>!d),"aria-expanded":n,className:"flex shrink-0 items-center gap-1 rounded-md px-1.5 py-1 text-2xs text-fg-muted transition-colors hover:bg-surface-sunken hover:text-fg",children:[`${a} ${Dt(a)}`,r.jsx(u,{className:"size-3.5","aria-hidden":!0})]})]}),n&&r.jsx("div",{className:"divide-y divide-line border-t border-line",children:e.messages.map(d=>r.jsx(Jo,{candidate:d,selected:o.has(d.id),onToggle:()=>s(d.id),hideSender:!0},d.id))})]})}const Rt=e=>e===1?"message":"messages",Zo=(e,o)=>`Moves ${e===1?"this message":`these ${e} ${Rt(e)}`} out of Spam to ${o} now. Nothing later.`,kt=(e,o)=>e.find(t=>t.id===o)?.label??"Inbox";function ei(){return r.jsx(ct,{tone:"info",variant:"soft",children:r.jsx("p",{className:"text-2xs text-fg-muted",children:"We list a message here only when we can confirm the sender is who they say — usually someone you've emailed before, write to often, or a service that consistently checks out. We never guess from words in the subject. Anything we can't confirm stays in Spam."})})}function ti({candidates:e,selected:o,onToggle:t,onToggleGroup:s,onSelectAll:n,onSelectNone:i,onContinue:l,onCancel:a}){const[u,d]=c.useState(!1),h=o.size,g=c.useMemo(()=>Go(e),[e]);return r.jsxs("div",{className:"flex min-h-0 flex-col",children:[r.jsxs("div",{className:"px-row-inset pb-2 pt-1",children:[r.jsxs("div",{className:"flex items-start justify-between gap-2",children:[r.jsxs("h2",{className:"flex items-center gap-2 text-sm font-semibold text-fg",children:[r.jsx(dt,{className:"size-4 text-positive","aria-hidden":!0}),"Rescue from Spam"]}),r.jsx(te,{variant:"ghost",size:"sm",icon:r.jsx(_o,{className:"size-3.5"}),onClick:()=>d(m=>!m),className:"-mr-1.5 -mt-0.5",children:"Why these?"})]}),r.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:"These look safe — from senders we can verify. Uncheck any sender that belongs in Spam, or open a sender to pick individual messages."}),u&&r.jsx("div",{className:"mt-2",children:r.jsx(ei,{})})]}),r.jsxs("div",{className:"flex items-center justify-between px-row-inset pb-1.5",children:[r.jsx("span",{className:"text-2xs font-medium text-fg-muted",children:`${h} of ${e.length} selected · ${g.length} ${g.length===1?"sender":"senders"}`}),r.jsxs("span",{className:"flex gap-1",children:[r.jsx(te,{variant:"ghost",size:"sm",onClick:n,children:"Select all"}),r.jsx(te,{variant:"ghost",size:"sm",onClick:i,children:"Select none"})]})]}),r.jsx("div",{className:"min-h-0 flex-1 divide-y divide-line overflow-y-auto border-y border-line",children:g.map(m=>r.jsx(Xo,{group:m,selected:o,onToggleGroup:s,onToggleMessage:t},m.key))}),r.jsxs("div",{className:"space-y-2 border-t border-line bg-surface px-row-inset py-3",children:[r.jsx(te,{variant:"primary",onClick:l,className:"h-11 w-full font-semibold",children:`Continue with ${h} ${Rt(h)}`}),r.jsx(te,{variant:"ghost",onClick:a,className:"h-11 w-full",children:"Cancel"})]})]})}function si({count:e,folders:o,delimiter:t,destination:s,onPick:n,onMove:i,onBack:l}){const[a,u]=c.useState(!1);return r.jsxs("div",{className:"flex min-h-0 flex-col",children:[r.jsxs("div",{className:"px-row-inset pb-2 pt-1",children:[r.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Where should they go?"}),r.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:"Pick a folder, then we move them out of Spam."})]}),r.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto px-row-inset py-2",children:a?r.jsx("div",{className:"flex min-h-0 flex-1 overflow-hidden rounded-xl border border-line bg-surface",children:r.jsx(Es,{folders:o,selectedId:s,delimiter:t,onSelect:n,onCancel:()=>u(!1)})}):r.jsxs("div",{className:"rounded-xl border border-line bg-surface-sunken p-3",children:[r.jsx("p",{className:"text-2xs text-fg-subtle",children:"Destination"}),r.jsx("p",{className:"mt-0.5 text-sm font-medium text-fg",children:kt(o,s)}),r.jsx(te,{variant:"ghost",size:"sm",onClick:()=>u(!0),className:"mt-2 px-0",children:"Move to a different folder"})]})}),r.jsxs("div",{className:"space-y-2 border-t border-line bg-surface px-row-inset py-3",children:[r.jsx("p",{className:"text-2xs text-fg-subtle",children:Zo(e,kt(o,s))}),r.jsx(te,{variant:"primary",onClick:i,className:"h-11 w-full font-semibold",children:`Move ${e} out of Spam`}),r.jsx(te,{variant:"ghost",onClick:l,className:"h-11 w-full",children:"Back"})]})]})}function ni({count:e,destinationLabel:o,onClose:t}){return r.jsxs("div",{className:"flex min-h-0 flex-col",children:[r.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 px-row-inset py-10 text-center",children:[r.jsx(Lo,{className:"size-10 text-positive","aria-hidden":!0}),r.jsx("p",{className:"text-base font-semibold text-fg",children:`Moved ${e} ${Rt(e)} out of Spam.`}),r.jsx("p",{className:"text-2xs text-fg-subtle",children:`You'll find them in ${o}.`})]}),r.jsx("div",{className:"border-t border-line bg-surface px-row-inset py-3",children:r.jsx(te,{variant:"primary",onClick:t,className:"h-11 w-full font-semibold",children:"Done"})})]})}function oi({open:e,candidates:o,defaultDestinationId:t,availableFolders:s,delimiter:n,onConfirmMove:i,onCancel:l}){const[a,u]=c.useState("review"),[d,h]=c.useState(()=>e?new Set(o.map(k=>k.id)):new Set),[g,m]=c.useState(t),[p,y]=c.useState(0),S=c.useRef(!1);c.useEffect(()=>{e&&!S.current&&(u("review"),h(new Set(o.map(k=>k.id))),m(t),y(0)),S.current=e},[e,o,t]);const I=d.size,b=k=>{h(T=>{const R=new Set(T);return R.has(k)?R.delete(k):R.add(k),R})},x=(k,T)=>{h(R=>{const F=new Set(R);for(const _ of k.messages)T?F.add(_.id):F.delete(_.id);return F})},w=()=>{const k=Array.from(d);y(k.length),i(k,g),u("done")};return r.jsxs(Do,{open:e,onClose:l,dismissLabel:"Close rescue",children:[a==="review"&&r.jsx(ti,{candidates:o,selected:d,onToggle:b,onToggleGroup:x,onSelectAll:()=>h(new Set(o.map(k=>k.id))),onSelectNone:()=>h(new Set),onContinue:()=>u("destination"),onCancel:l}),a==="destination"&&r.jsx(si,{count:I,folders:s,delimiter:n,destination:g,onPick:m,onMove:w,onBack:()=>u("review")}),a==="done"&&r.jsx(ni,{count:p,destinationLabel:kt(s,g),onClose:l})]})}function ii(e){const o=e.toAddresses.join(", ");return{id:e.outboxMessageId,accountId:e.accountId,fromName:e.fromName??e.fromAddress??"Me",fromEmail:e.fromAddress??"",subject:e.subject??"(No subject)",snippet:o?`To: ${o}`:"(No recipients)",timeLabel:Qe(e.updatedAt),isRead:!0}}function ri(e){return{id:e.messageId,accountId:e.accountId,fromName:e.fromName??e.fromEmail??"Unknown",fromEmail:e.fromEmail??"",subject:e.subject??"(No subject)",snippet:e.snippet??"",timeLabel:Qe(e.sentDate),isRead:e.isRead,hasAttachment:e.hasAttachment,starred:e.hasStars===!0}}function ai({outboxMessages:e,accountId:o,imapThreads:t}){const s=e.filter(l=>l.status==="draft"&&l.accountId===o).map(ii),n=t.map(ri),i=[];return s.length>0&&i.push({id:"remit-drafts",label:"Not yet sent (Remit)",threads:s}),n.length>0&&i.push({id:"imap-drafts",label:"On the server",threads:n}),i}const li=({label:e,count:o})=>r.jsxs("div",{className:"sticky top-0 z-10 flex items-baseline justify-between border-b border-line bg-surface-sunken px-row-inset py-1",children:[r.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:e}),r.jsx("span",{className:"text-2xs text-fg-subtle tabular-nums",children:o})]}),ci=({row:e,isSelected:o,onOpen:t,onDelete:s,isDeleting:n})=>r.jsxs("button",{type:"button",onClick:()=>t(e.id),className:Ae("group",Qt({active:o})),children:[r.jsx(Fs,{className:"size-7 shrink-0 text-fg-muted mt-0.5"}),r.jsx(Ut,{thread:e}),r.jsx("div",{className:"flex items-center gap-1 shrink-0",children:r.jsx("button",{type:"button",onClick:i=>{i.stopPropagation(),s(e.id)},disabled:n,className:"p-1.5 rounded-md text-fg-muted hover:text-danger hover:bg-surface-raised transition-colors opacity-0 group-hover:opacity-100 focus:opacity-100",title:"Delete draft",children:r.jsx($t,{className:"size-3.5"})})})]}),ui=({row:e,isSelected:o,onOpen:t})=>{const s=!e.isRead;return r.jsxs("button",{type:"button",onClick:()=>t(e.id),className:Ae("group",Qt({active:o})),children:[s&&r.jsx("span",{className:"absolute left-1.5 top-1/2 size-1.5 -translate-y-1/2 rounded-full bg-accent"}),r.jsx(Mt,{name:e.fromName,email:e.fromEmail,size:"sm"}),r.jsx(Ut,{thread:e})]})};function di({accountId:e,selectedMessageId:o,imapThreads:t,title:s,unreadCount:n}){const i=vo(),l=So(),a=Je(),u=Tt(),{data:d}=ut(Os()),h=c.useMemo(()=>ai({outboxMessages:d?.items??[],accountId:e,imapThreads:t}),[d?.items,e,t]),g=jt({...As(),onSuccess:()=>{u.invalidateQueries({queryKey:Ns()})}}),m=S=>{g.mutate({path:{outboxMessageId:S}})},p=S=>{const I=t.find(b=>b.messageId===S)?.threadId;I&&a({threadId:I,messageId:S})},y=h.length===0;return r.jsxs("section",{className:"flex h-full w-full flex-col bg-surface",children:[r.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[r.jsx(Ro,{}),r.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:s}),(n??0)>0&&r.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle tabular-nums",children:[n," unread"]})]}),r.jsx("div",{className:"flex-1 overflow-y-auto",children:y?r.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-2 text-center px-4",children:[r.jsx(zs,{className:"size-8 text-fg-subtle"}),r.jsx("p",{className:"text-sm font-medium text-fg",children:"No drafts"}),r.jsx("p",{className:"text-xs text-fg-subtle",children:"Messages you start composing will appear here."})]}):h.map(S=>r.jsxs("div",{children:[S.label&&r.jsx(li,{label:S.label,count:S.threads.length}),r.jsx("div",{className:"divide-y divide-line",children:S.threads.map(I=>S.id==="remit-drafts"?r.jsx(ci,{row:I,isSelected:I.id===i,onOpen:l,onDelete:m,isDeleting:g.isPending},I.id):r.jsx(ui,{row:I,isSelected:I.id===o,onOpen:p},I.id))})]},S.id))})]})}const is=e=>e===1?"1 message":`${ns(e)} messages`,hi=e=>({title:"Empty Trash?",description:`${is(e)} ${e===1?"is":"are"} erased from the mail server and cannot be restored.`,confirmLabel:"Empty Trash"}),fi=(e,o={})=>{const{trashFolderLabel:t,staleFolderLabel:s}=o;if(e==="unconfirmed"){const n=bo(0,"unconfirmed",{trashFolderLabel:t});return{headline:n.title,body:n.description,actionLabel:n.confirmLabel}}return e==="stale"?{headline:"Nothing was emptied.",body:s?`The folder you chose for Trash — ${s} — is gone from the mail server.`:"The folder you chose for Trash is gone from the mail server.",actionLabel:"Pick another folder"}:{headline:"Nothing was emptied.",body:"No folder on this account is set as Trash.",actionLabel:"Pick a folder"}};function mi({messageCount:e,isEmptying:o,deletedCount:t,refusalReason:s,trashFolderLabel:n,staleFolderLabel:i,onEmpty:l,onRepair:a,children:u}){const[d,h]=c.useState(!1);if(e<1&&s===void 0&&t===void 0)return r.jsx(r.Fragment,{children:u});const g=s?fi(s,{trashFolderLabel:n,staleFolderLabel:i}):void 0,m=hi(e);return r.jsxs("div",{className:"relative flex h-full min-h-0 flex-col",children:[r.jsx("div",{className:"shrink-0 px-row-inset pt-2",children:r.jsxs("div",{className:"flex flex-col gap-2 rounded-md border border-line px-3 py-2",children:[r.jsxs("div",{className:"flex items-center justify-end gap-2",children:[t!==void 0&&r.jsx("p",{className:"mr-auto text-2xs text-fg-subtle",role:"status",children:`${is(t)} erased from the mail server.`}),r.jsx(te,{variant:"ghost",size:"sm",icon:r.jsx($t,{className:"size-3.5","aria-hidden":!0}),disabled:o||e<1,"aria-busy":o,onClick:()=>h(!0),children:o?"Emptying…":"Empty Trash"})]}),g&&r.jsx(ct,{tone:"warning",variant:"soft",children:r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsx("p",{className:"font-semibold text-fg",children:g.headline}),r.jsx("p",{className:"text-sm",children:g.body}),r.jsx(te,{variant:"primary",size:"sm",className:"self-start",onClick:a,children:g.actionLabel})]})})]})}),r.jsx("div",{className:"min-h-0 flex-1",children:u}),r.jsx(Eo,{isOpen:d,title:m.title,description:m.description,confirmLabel:m.confirmLabel,destructive:!0,onConfirm:()=>{h(!1),l()},onCancel:()=>h(!1)})]})}function gi(e,o,t){const s=new Array(e);return new Proxy(s,{get(n,i,l){if(typeof i=="string"){const a=i.charCodeAt(0);if(a>=48&&a<=57){const u=+i;if(Number.isInteger(u)&&u>=0&&u<e){let d=n[u];if(!d){const h=o[u*2];d=n[u]={index:u,key:t(u),start:h,size:o[u*2+1],end:h+o[u*2+1],lane:0}}return d}}if(i==="length")return e}return Reflect.get(n,i,l)}})}function Pe(e,o,t){let s=t.initialDeps??[],n,i=!0;function l(){const a=e();return(a.length!==s.length||a.some((d,h)=>s[h]!==d))&&(s=a,n=o(...a),t?.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(n),i=!1),n}return l.updateDeps=a=>{s=a},l}function _t(e,o){if(e===void 0)throw new Error("Unexpected undefined");return e}const pi=(e,o)=>Math.abs(e-o)<1.01,xi=(e,o,t)=>{let s;return function(...n){e.clearTimeout(s),s=e.setTimeout(()=>o.apply(this,n),t)}};let Ue;const Ct=()=>{if(Ue!==void 0)return Ue;if(typeof navigator>"u")return Ue=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Ue=!0;const e=navigator.maxTouchPoints;return Ue=navigator.platform==="MacIntel"&&e!==void 0&&e>0},Lt=e=>{const{offsetWidth:o,offsetHeight:t}=e;return{width:o,height:t}},bi=e=>e,vi=e=>{const o=Math.max(e.startIndex-e.overscan,0),s=Math.min(e.endIndex+e.overscan,e.count-1)-o+1,n=new Array(s);for(let i=0;i<s;i++)n[i]=o+i;return n},Si=(e,o)=>{const t=e.scrollElement;if(!t)return;const s=e.targetWindow;if(!s)return;const n=l=>{const{width:a,height:u}=l;o({width:Math.round(a),height:Math.round(u)})};if(n(Lt(t)),!s.ResizeObserver)return()=>{};const i=new s.ResizeObserver(l=>{const a=()=>{const u=l[0];if(u?.borderBoxSize){const d=u.borderBoxSize[0];if(d){n({width:d.inlineSize,height:d.blockSize});return}}n(Lt(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},lt={passive:!0},yi=typeof window>"u"?!0:"onscrollend"in window,Ci=(e,o,t)=>{const s=e.scrollElement;if(!s)return;const n=e.targetWindow;if(!n)return;const i=e.options.useScrollendEvent&&yi;let l=0;const a=i?null:xi(n,()=>o(l,!1),e.options.isScrollingResetDelay),u=g=>()=>{l=t(s),a?.(),o(l,g)},d=u(!0),h=u(!1);return s.addEventListener("scroll",d,lt),i&&s.addEventListener("scrollend",h,lt),()=>{s.removeEventListener("scroll",d),i&&s.removeEventListener("scrollend",h)}},Ii=(e,o)=>Ci(e,o,t=>{const{horizontal:s,isRtl:n}=e.options;return s?t.scrollLeft*(n&&-1||1):t.scrollTop}),ki=(e,o,t)=>{if(t.options.useCachedMeasurements){const s=t.indexFromElement(e),n=t.options.getItemKey(s);return t.itemSizeCache.get(n)??t.options.estimateSize(s)}if(o?.borderBoxSize){const s=o.borderBoxSize[0];if(s)return Math.round(s[t.options.horizontal?"inlineSize":"blockSize"])}if(!o){const s=t.indexFromElement(e),n=t.options.getItemKey(s),i=t.itemSizeCache.get(n);if(i!==void 0)return i}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},Ti=(e,{adjustments:o=0,behavior:t},s)=>{var n,i;(i=(n=s.scrollElement)==null?void 0:n.scrollTo)==null||i.call(n,{[s.options.horizontal?"left":"top"]:e+o,behavior:t})},ji=Ti;class wi{constructor(o){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var t,s,n;return((n=(s=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:s.now)==null?void 0:n.call(s))??Date.now()},this.observer=(()=>{let t=null;const s=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(n=>{n.forEach(i=>{const l=()=>{const a=i.target,u=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);for(const[d,h]of this.elementsCache)if(h===a){this.elementsCache.delete(d);break}return}this.shouldMeasureDuringScroll(u)&&this.resizeItem(u,this.options.measureElement(a,i,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(l):l()})}));return{disconnect:()=>{var n;(n=s())==null||n.disconnect(),t=null},observe:n=>{var i;return(i=s())==null?void 0:i.observe(n,{box:"border-box"})},unobserve:n=>{var i;return(i=s())==null?void 0:i.unobserve(n)}}})(),this.range=null,this.setOptions=t=>{var s,n;const i={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:bi,rangeExtractor:vi,onChange:()=>{},measureElement:ki,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const m in t){const p=t[m];p!==void 0&&(i[m]=p)}const l=this.options;let a=null,u=null,d=!1;if(l!==void 0&&l.enabled&&i.enabled&&i.anchorTo==="end"&&this.scrollElement!==null){const m=l.count,p=i.count,y=this.getMeasurements(),S=m>0?((s=y[0])==null?void 0:s.key)??l.getItemKey(0):null,I=m>0?((n=y[m-1])==null?void 0:n.key)??l.getItemKey(m-1):null;if(p!==m||m>0&&p>0&&(i.getItemKey(0)!==S||i.getItemKey(p-1)!==I)){d=!0;const w=m>0?this.getVirtualItemForOffset(this.getScrollOffset())??y[0]:null;w&&(a=[w.key,this.getScrollOffset()-w.start]);const k=i.followOnAppend===!0?"auto":i.followOnAppend||null;k&&p>m&&this.isAtEnd(l.scrollEndThreshold)&&(m===0||i.getItemKey(p-1)!==I)&&(u=k)}}this.options=i,d&&(this.pendingMin=0,this.itemSizeCacheVersion++);let h=!1,g=0;if(a&&this.scrollOffset!==null){const[m,p]=a,y=this.getMeasurements(),{count:S,getItemKey:I}=this.options;let b=0;for(;b<S&&I(b)!==m;)b++;if(b<S){const x=y[b];if(x){const w=x.start+p;w!==this.scrollOffset&&(g=w-this.scrollOffset,this.scrollOffset=w,h=!0)}}}(h||u)&&(this.pendingScrollAnchor=[h?a[0]:null,h?a[1]:0,u,g])},this.notify=t=>{var s,n;(n=(s=this.options).onChange)==null||n.call(s,this,t)},this.maybeNotify=Pe(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}if(this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,l)=>{if(l&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0;const a=this.getScrollOffset();this.scrollDirection=l?a===i?this.scrollDirection:a<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=l,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){const i=this.scrollElement,l=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},a=()=>{this._iosTouching=!1,!(!Ct()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",l,lt),i.addEventListener("touchend",a,lt),this.unsubs.push(()=>{i.removeEventListener("touchstart",l),i.removeEventListener("touchend",a),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const n=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,n&&this.scrollElement&&this.options.enabled){const[i,l,a,u]=n;i!==null&&!a&&(Ct()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?u!==0&&(this._iosDeferredAdjustment+=u):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),a&&this.scrollToEnd({behavior:a})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),s=this.getMaxScrollOffset();if(t<0||t>s)return;const n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Pe(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,s,n,i,l,a,u,d)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:t,paddingStart:s,scrollMargin:n,getItemKey:i,enabled:l,lanes:a,laneAssignmentMode:u,gap:d}),{key:!1}),this.getMeasurements=Pe(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:s,scrollMargin:n,getItemKey:i,enabled:l,lanes:a,laneAssignmentMode:u,gap:d},h)=>{const g=this.itemSizeCache;if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const b of this.laneAssignments.keys())b>=t&&this.laneAssignments.delete(b);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(b=>{this.itemSizeCache.set(b.key,b.size)}));const m=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),a===1){const b=t*2;let x=this._flatMeasurements;if(!x||x.length<b){const T=new Float64Array(b);x&&m>0&&T.set(x.subarray(0,m*2)),x=T,this._flatMeasurements=x}let w;if(m===0)w=s+n;else{const T=m-1;w=x[T*2]+x[T*2+1]+d}for(let T=m;T<t;T++){const R=i(T),F=g.get(R),_=typeof F=="number"?F:this.options.estimateSize(T);x[T*2]=w,x[T*2+1]=_,w+=_+d}const k=gi(t,x,i);return this.measurementsCache=k,k}const p=this.measurementsCache.slice(0,m),y=new Array(a).fill(void 0),S=new Float64Array(a);let I=0;for(let b=0;b<m;b++){const x=p[b];x&&(y[x.lane]===void 0&&I++,y[x.lane]=b,S[x.lane]=x.end)}for(let b=m;b<t;b++){const x=i(b),w=this.laneAssignments.get(b);let k,T;const R=u==="estimate"||g.has(x);if(w!==void 0&&this.options.lanes>1){k=w;const O=y[k],N=O!==void 0?p[O]:void 0;T=N?N.end+d:s+n}else if(I===a){let O=0,N=S[0],me=y[0];for(let z=1;z<a;z++){const oe=S[z];(oe<N||oe===N&&y[z]<me)&&(O=z,N=oe,me=y[z])}k=O,T=N+d,R&&this.laneAssignments.set(b,k)}else k=b%this.options.lanes,T=s+n,R&&this.laneAssignments.set(b,k);const F=g.get(x),_=typeof F=="number"?F:this.options.estimateSize(b),G=T+_;p[b]={index:b,start:T,size:_,end:G,key:x,lane:k},y[k]===void 0&&I++,y[k]=b,S[k]=G}return this.measurementsCache=p,p},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Pe(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,s,n,i)=>t.length===0||s===0?(this.range=null,null):(this.range=Ri(t,s,n,i,i===1&&this._flatMeasurements!=null?this._flatMeasurements:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Pe(()=>{let t=null,s=null;const n=this.calculateRange();return n&&(t=n.startIndex,s=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,s]},(t,s,n,i,l)=>i===null||l===null?[]:t({startIndex:i,endIndex:l,overscan:s,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const s=this.options.indexAttribute,n=t.getAttribute(s);return n?parseInt(n,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var s;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const n=this.scrollState.index??((s=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:s.index);if(n!==void 0&&this.range){const i=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),l=Math.max(0,n-i),a=Math.min(this.options.count-1,n+i);return t>=l&&t<=a}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((l,a)=>{l.isConnected||(this.observer.unobserve(l),this.elementsCache.delete(a))});return}const s=this.indexFromElement(t),n=this.options.getItemKey(s),i=this.elementsCache.get(n);i!==t&&(i&&this.observer.unobserve(i),this.observer.observe(t),this.elementsCache.set(n,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(s)&&this.resizeItem(s,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,s)=>{var n,i;if(t<0||t>=this.options.count)return;let l,a,u;const d=this._flatMeasurements;if(this.options.lanes===1&&d!==null)u=this.options.getItemKey(t),a=d[t*2],l=d[t*2+1];else{const m=this.measurementsCache[t];if(!m)return;u=m.key,a=m.start,l=m.size}const h=this.itemSizeCache.get(u)??l,g=s-h;if(g!==0){const m=this.options.anchorTo==="end"&&((n=this.scrollState)==null?void 0:n.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,p=m?this.getTotalSize():0,y=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t]??{index:t,key:u,start:a,size:l,end:a+l,lane:0},g,this):a<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(u)||this.scrollDirection!=="backward"));(this.pendingMin===null||t<this.pendingMin)&&(this.pendingMin=t),this.itemSizeCache.set(u,s),this.itemSizeCacheVersion++,m?this.applyScrollAdjustment(this.getTotalSize()-p):y&&this.applyScrollAdjustment(g),this.notify(!1)}},this.getVirtualItems=Pe(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,s)=>{const n=[];for(let i=0,l=t.length;i<l;i++){const a=t[i],u=s[a];n.push(u)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const s=this.getMeasurements();if(s.length===0)return;const n=this._flatMeasurements,i=this.options.lanes===1&&n!=null,l=rs(0,s.length-1,i?a=>n[a*2]:a=>_t(s[a]).start,t);return _t(s[l])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,s,n=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),l=this.getScrollOffset();s==="auto"&&(s=t>=l+i?"end":"start"),s==="center"?t+=(n-i)/2:s==="end"&&(t-=i);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,s="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const n=this.getSize(),i=this.getScrollOffset(),l=this.measurementsCache[t];if(!l)return;if(s==="auto")if(l.end>=i+n-this.options.scrollPaddingEnd)s="end";else if(l.start<=i+this.options.scrollPaddingStart)s="start";else return[i,s];if(s==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),s];const a=s==="end"?l.end+this.options.scrollPaddingEnd:l.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,s,l.size),s]},this.scrollToOffset=(t,{align:s="start",behavior:n="auto"}={})=>{const i=this.getOffsetForAlignment(t,s),l=this.now();this.scrollState={index:null,align:s,behavior:n,startedAt:l,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:s="auto",behavior:n="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getOffsetForIndex(t,s);if(!i)return;const[l,a]=i,u=this.now();this.scrollState={index:t,align:a,behavior:n,startedAt:u,lastTargetOffset:l,stableFrames:0},this._scrollToOffset(l,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:s="auto"}={})=>{const n=this.getScrollOffset()+t,i=this.now();this.scrollState={index:null,align:"start",behavior:s,startedAt:i,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:s}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const s=this.getMeasurements();let n;if(s.length===0)n=this.options.paddingStart;else if(this.options.lanes===1){const i=s.length-1,l=this._flatMeasurements;l!=null?n=l[i*2]+l[i*2+1]:n=((t=s[i])==null?void 0:t.end)??0}else{const i=Array(this.options.lanes).fill(null);let l=s.length-1;for(;l>=0&&i.some(a=>a===null);){const a=s[l];i[a.lane]===null&&(i[a.lane]=a.end),l--}n=Math.max(...i.filter(a=>a!==null))}return Math.max(n-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const s=this.getMeasurements();for(const n of s)n&&this.itemSizeCache.has(n.key)&&t.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return t},this._scrollToOffset=(t,{adjustments:s,behavior:n})=>{this._intendedScrollOffset=t+(s??0),this.options.scrollToFn(t,{behavior:n,adjustments:s},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(o)}applyScrollAdjustment(o,t){o!==0&&(Ct()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=o:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const s=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,n=s?s[0]:this.scrollState.lastTargetOffset,i=1,l=n!==this.scrollState.lastTargetOffset;if(!l&&pi(n,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=i){this.getScrollOffset()!==n&&this._scrollToOffset(n,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,l){const a=this.getSize()||600,u=Math.abs(n-this.getScrollOffset()),d=this.scrollState.behavior==="smooth"&&u>a;this.scrollState.lastTargetOffset=n,d||(this.scrollState.behavior="auto"),this._scrollToOffset(n,{adjustments:void 0,behavior:d?"smooth":"auto"})}this.scheduleScrollReconcile()}}const rs=(e,o,t,s)=>{for(;e<=o;){const n=(e+o)/2|0,i=t(n);if(i<s)e=n+1;else if(i>s)o=n-1;else return n}return e>0?e-1:0};function Mi(e,o,t){let s=0;for(;s<=o;){const n=(s+o)/2|0,i=e[n*2];if(i<t)s=n+1;else if(i>t)o=n-1;else return n}return s>0?s-1:0}function Ri(e,o,t,s,n){const i=e.length-1;if(e.length<=s)return{startIndex:0,endIndex:i};if(s===1&&n!==null){const d=Mi(n,i,t);let h=d;const g=t+o;for(;h<i&&n[h*2]+n[h*2+1]<g;)h++;return{startIndex:d,endIndex:h}}let a=rs(0,i,d=>e[d].start,t),u=a;if(s===1)for(;u<i&&e[u].end<t+o;)u++;else if(s>1){const d=Array(s).fill(0);for(;u<i&&d.some(g=>g<t+o);){const g=e[u];d[g.lane]=g.end,u++}const h=Array(s).fill(t+o);for(;a>=0&&h.some(g=>g>=t);){const g=e[a];h[g.lane]=g.start,a--}a=Math.max(0,a-a%s),u=Math.min(i,u+(s-1-u%s))}return{startIndex:a,endIndex:u}}const It=typeof document<"u"?c.useLayoutEffect:c.useEffect;function Ei({useFlushSync:e=!0,directDomUpdates:o=!1,directDomUpdatesMode:t="transform",...s}){const n=c.useReducer(d=>d+1,0)[1],i=c.useRef({enabled:o,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=o,i.current.mode=t;const l=d=>{const h=i.current;if(!h.enabled||!h.container)return;const g=d.getTotalSize();if(g!==h.lastSize){h.lastSize=g;const b=d.options.horizontal?"width":"height";h.container.style[b]=`${g}px`}const m=!!d.options.horizontal,p=h.mode==="transform",y=m?"left":"top",S=d.options.scrollMargin,I=d.getVirtualItems();for(const b of I){const x=b.start-S,w=d.elementsCache.get(b.key);w&&h.lastPositions.get(w)!==x&&(h.lastPositions.set(w,x),p?w.style.transform=m?`translate3d(${x}px, 0, 0)`:`translate3d(0, ${x}px, 0)`:w.style[y]=`${x}px`)}},a={...s,onChange:(d,h)=>{var g;const m=i.current;let p=!0;if(m.enabled){l(d);const y=d.range,S=m.prevRange;p=!S||S.isScrolling!==d.isScrolling||S.startIndex!==y?.startIndex||S.endIndex!==y?.endIndex,p&&(m.prevRange=y?{startIndex:y.startIndex,endIndex:y.endIndex,isScrolling:d.isScrolling}:null)}p&&(e&&h?Ds.flushSync(n):n()),(g=s.onChange)==null||g.call(s,d,h)}},[u]=c.useState(()=>{const d=new wi(a);return Object.assign(d,{containerRef:h=>{const g=i.current;if(g.container=h,g.lastSize=null,h&&g.enabled){const m=d.getTotalSize();g.lastSize=m;const p=d.options.horizontal?"width":"height";h.style[p]=`${m}px`}}})});return u.setOptions(a),It(()=>u._didMount(),[]),It(()=>u._willUpdate()),It(()=>{l(u)}),u}function Oi(e){return Ei({observeElementRect:Si,observeElementOffset:Ii,scrollToFn:ji,...e})}const Et=e=>e.query?`matching "${e.query}"`:e.from?`from "${e.from}"`:"matching your search",Ni=e=>`Select all ${Et(e)}`,Ai=(e,o)=>`All ${ns(o)} ${Et(e)} selected`,zi=({verb:e,confirmingDelete:o,hasSelection:t,junkMailboxId:s,currentMailboxId:n,deletableMessageId:i})=>{if(o)return{kind:"withheld"};if(e==="junk"){const l=hn(s,n);if(l!==void 0)return{kind:"unavailable",reason:l}}return t?{kind:"openWizard"}:e!=="delete"||i===void 0?{kind:"declined"}:{kind:"confirmDelete",messageId:i}},Fi=(e,o,t)=>e==="BACK"&&o&&t===void 0,Di=(e,o)=>({id:e.messageId,accountId:e.accountId,mailboxId:e.mailboxId,threadId:e.threadId,fromName:e.fromName??e.fromEmail??"Unknown",fromEmail:e.fromEmail??"",subject:e.subject??"(No subject)",snippet:e.snippet??"",timeLabel:Qe(e.sentDate),isRead:e.isRead,hasAttachment:e.hasAttachment,starred:e.hasStars===!0,trust:e.senderTrust,category:Jt(e.category),messageCount:o,suspicious:e.authenticity?.dkimMismatch===!0,labels:e.labels}),_i=({thread:e,mailboxId:o,isSelected:t,isFocused:s,isTabStop:n,onFocusRow:i,isChecked:l,onToggleCheck:a,onRowSelect:u,messageCount:d,isMultiSelectMode:h,onLongPress:g,isDesktop:m,density:p})=>r.jsx(fn,{thread:Di(e,d),link:{mailboxId:o,threadId:e.threadId},inListbox:!0,active:t,focused:s,isTabStop:n,density:p,isDesktop:m,onFocusRow:i,selection:{isChecked:l,onToggleCheck:a,onRowSelect:u,isMultiSelectMode:h,onLongPress:g}}),Li=c.memo(_i),Pi=e=>{const o=e.authenticity?.dkimMismatch===!0;return{id:e.messageId,accountId:e.accountId,fromName:e.fromName??e.fromEmail??"Unknown",fromEmail:e.fromEmail??"",subject:e.subject??"(No subject)",snippet:e.snippet??"",timeLabel:Qe(e.sentDate),isRead:e.isRead,hasAttachment:e.hasAttachment,starred:e.hasStars===!0,trust:e.senderTrust,category:Jt(e.category),suspicious:o}},$i=({thread:e,mailboxId:o,isSelected:t,isFocused:s,isTabStop:n,onFocusRow:i,isChecked:l,onToggleCheck:a,onRowSelect:u,isMultiSelectMode:d,onLongPress:h,isDesktop:g,onDelete:m,onToggleRead:p,density:y})=>{const[S,I]=c.useState("none"),b=Je(),x=c.useCallback(F=>{navigator.vibrate?.(10),F==="trailing"?m(e.messageId):p(e.messageId,e.isRead),I("none")},[m,p,e.messageId,e.isRead]),w=c.useCallback(()=>{h(e.messageId)},[h,e.messageId]),k=c.useCallback(()=>{a(e.messageId)},[a,e.messageId]),T=c.useCallback(()=>{b({threadId:e.threadId,messageId:e.messageId})},[b,e.threadId,e.messageId]),R=mn(e.messageId,u);return g||d?r.jsx(Li,{thread:e,mailboxId:o,isSelected:t,isFocused:s,isTabStop:n,onFocusRow:i,isChecked:l,onToggleCheck:a,onRowSelect:u,isMultiSelectMode:d,onLongPress:h,isDesktop:g,density:y}):r.jsx("div",{role:"presentation",onPointerDownCapture:R.onMouseDown,onClickCapture:R.claimClick,onContextMenu:R.onContextMenu,children:r.jsx(io,{thread:Pi(e),selectionMode:!1,checked:!1,active:t,peek:S,onPeek:I,onToggleCheck:k,onLongPress:w,onOpen:T,onAct:x})})},Bi=72,Wi=32,Ki=5,as="remit:list-density",Vi=()=>{try{const e=localStorage.getItem(as);if(e==="compact"||e==="comfortable")return e}catch{}return"comfortable"},qi=(e,o,t)=>zo(e.filter(s=>o.has(s.messageId)).map(s=>s.accountId??t)).moveDisabledHint,Hi=({mailboxId:e,threads:o,selectedMessageId:t,isLoading:s,isError:n=!1,error:i,onRetry:l,searchQuery:a,searchPredicate:u,resultCount:d={kind:"unknown"},onDeleteMessages:h,isDeleting:g=!1,isMoving:m=!1,onLoadMore:p,hasMore:y=!1,isLoadingMore:S=!1,accountId:I,listTitle:b,listMeta:x,listFilter:w,listScopeLabel:k,onTriageContextChange:T,commandsRef:R,hideHeader:F=!1})=>{const _=c.useRef(null),G=Je(),O=_s(),N=Ls(),{verb:me,start:z,startFromSearch:oe}=N,Ce=Ps(),ge=!!a?.trim(),L=gn(),{labels:$e}=No(I),{pushError:re}=Bt(),[M,Ie]=c.useState(t),[ze,P]=c.useState(),K=c.useCallback(f=>{P(v=>v===f?v:void 0),Ie(f)},[]),[se,Y]=c.useState(Vi),pe=c.useCallback(()=>{Y(f=>{const v=f==="comfortable"?"compact":"comfortable";try{localStorage.setItem(as,v)}catch{}return v})},[]),{toggleReadFor:ke}=Gt({mailboxId:e}),{junkMailboxId:ae}=Yt(I),Te=Xt(ae,e),Fe=c.useMemo(()=>[{accountId:I,mailboxId:e}],[I,e]),{outcome:le,staleFolderLabel:Be,guessedMailboxId:$}=pn(Fe),{selectedIds:A,selectedCount:ce,hasSelection:B,isSelected:De,toggle:X,select:je,clearSelection:we,selectRange:ie,setAnchor:V,selectAll:Q,toggleAll:We,intersectWith:Ge}=xn(),Me=En(ce,O),[E,_e]=c.useState(null),Re=ge&&!!u,Ye=`${e}|${JSON.stringify(u??{})}`,j=bn({mailboxId:e,accountId:I,enabled:Re,predicateKey:Ye,searchQuery:u??{}}),ft=c.useCallback((f,v,fe)=>{const U=vn(f,v,fe,le);U&&re(U)},[re,le]),Ke=j.phase.kind,Ee=j.clear,q=c.useCallback(()=>{Ke==="escalated"&&Ee(),we()},[we,Ee,Ke]),[ue,Xe]=c.useState(null),xe=c.useRef(null),de=c.useRef(!1),Oe=c.useRef(null),be=!s&&o.length>0,ve=Oi({count:o.length,getScrollElement:()=>_.current,estimateSize:()=>se==="compact"?Wi:Bi,overscan:Ki}),Se=t?o.findIndex(f=>f.messageId===t):-1,Z=M?o.findIndex(f=>f.messageId===M):-1,ee=c.useCallback(f=>{if(f<0||f>=o.length)return;const v=o[f];if(Me){X(v.messageId);return}xe.current=v.messageId,de.current=!1,P(v.messageId),Ie(v.messageId)},[o,Me,X]),Ze=c.useCallback(()=>{if(o.length===0)return;const f=Z<0?0:Math.min(Z+1,o.length-1);ee(f)},[o.length,Z,ee]),Ve=c.useCallback(()=>{if(o.length===0)return;const f=Z<=0?0:Z-1;ee(f)},[o.length,Z,ee]),qe=c.useCallback(()=>ee(0),[ee]),ye=c.useCallback(()=>ee(o.length-1),[ee,o.length]),Ne=c.useCallback(()=>{M&&X(M)},[M,X]),D=c.useMemo(()=>o.map(f=>f.messageId),[o]),mt=c.useMemo(()=>{const f=[];for(const v of o)A.has(v.messageId)&&f.push({id:v.messageId,sender:v.fromName??v.fromEmail??"Unknown",email:v.fromEmail??"",subject:v.subject??"(No subject)",date:Qe(v.sentDate),accountId:I});return f},[o,A,I]),gt=c.useCallback((f,v)=>v.shiftKey?(ie(D,f,M),!0):v.metaKey||v.ctrlKey?(X(f),!0):(q(),V(f),!1),[D,M,ie,X,q,V]),et=c.useCallback(f=>{!h||f.length===0||(Oe.current=M??null,_e(f))},[h,M]),ne=c.useCallback(f=>{const v=Sn(D,M,f);v!==void 0&&(ie(D,v),xe.current=v,de.current=!1,P(void 0),Ie(v))},[D,M,ie]),tt=c.useCallback(()=>ne(-1),[ne]),st=c.useCallback(()=>ne(1),[ne]),nt=c.useCallback(()=>{D.length>0&&Q(D)},[D,Q]),ot=c.useCallback(f=>{const v=zi({verb:f,confirmingDelete:E!==null,hasSelection:B,junkMailboxId:ae,currentMailboxId:e,deletableMessageId:h?M:void 0});return v.kind==="openWizard"?(z(f),!0):v.kind==="confirmDelete"?(et([v.messageId]),!0):v.kind==="unavailable"?(re({severity:"warning",title:v.reason}),!0):v.kind==="withheld"},[E,h,B,ae,e,z,M,et,re]),he=c.useCallback((f,v)=>{const fe=o.find(U=>U.messageId===f)?.threadId;fe&&G({threadId:fe,messageId:f},{replace:v?.replace})},[G,o]),it=c.useCallback(()=>{M&&he(M)},[M,he]),pt=c.useCallback(f=>he(f,{replace:!0}),[he]);yn({keyboardFocusedMessageId:ze,openMessageId:t,enabled:O&&ce===0,open:pt});const Le=j.phase.kind==="escalated"?{scope:Et(u??{}),total:j.phase.total,searchQuery:u??{},run:f=>j.runAction(f),stop:j.stop}:void 0,rt=c.useCallback(f=>{if(f.length===0){_e(null);return}const v=new Set(f),fe=o.findIndex(J=>v.has(J.messageId));let U;for(let J=fe+1;J<o.length;J++)if(!v.has(o[J].messageId)){U=o[J].messageId;break}if(U===void 0){for(let J=fe-1;J>=0;J--)if(!v.has(o[J].messageId)){U=o[J].messageId;break}}h?.(f),q(),Oe.current=null,_e(null),U!==void 0&&(xe.current=U,de.current=!1,K(U),O&&he(U,{replace:!0})),O||Xe(Cn("delete",f.length,le))},[o,h,q,he,O,K,le]),xt=c.useCallback(()=>{const f=Oe.current;Oe.current=null,_e(null),f!==null&&(xe.current=f,de.current=!1,K(f))},[K]),He=c.useMemo(()=>qi(o,A,I),[I,A,o]),bt=c.useCallback(()=>{if(Le){oe();return}z("organize")},[Le,oe,z]),at=c.useCallback(f=>{h?.([f])},[h]),vt=c.useCallback((f,v)=>{ke([f],!v)},[ke]),C=c.useCallback(f=>{O||je(f)},[O,je]),H=c.useCallback(()=>{if(j.isRunning||j.phase.kind==="counting"){j.stop();return}q()},[j,q]),W=c.useCallback(()=>{j.clear()},[j]);c.useEffect(()=>{if(de.current||!O&&t)return;const f=Z>=0?Z:Se;f>=0&&ve.scrollToIndex(f,{align:"auto"})},[Z,Se,ve,O,t]),c.useEffect(()=>{t&&(de.current=!1,K(t))},[t,K]),c.useEffect(()=>{M&&(o.some(f=>f.messageId===M)||K(o[0]?.messageId))},[o,M,K]),c.useEffect(()=>{T?.({focusedMessageId:M,selectedIds:Array.from(A),hasList:be})},[M,A,be,T]);const Ot=c.useRef(T);Ot.current=T,c.useEffect(()=>()=>Ot.current?.({focusedMessageId:void 0,selectedIds:[],hasList:!1}),[]),c.useEffect(()=>{j.phase.kind!=="idle"||j.isRunning||Ge(o.map(f=>f.messageId))},[o,Ge,j.phase,j.isRunning]);const Nt=c.useRef(e);c.useEffect(()=>{Nt.current!==e&&(Nt.current=e,q())},[e,q]),In({shouldBlockFn:({action:f})=>Fi(f,B,Ce)?(q(),!0):!1,enableBeforeUnload:!1,disabled:!B||Ce!==void 0}),c.useEffect(()=>{const f=_.current;if(!f||!y||!p)return;const v=()=>{if(S)return;const{scrollTop:fe,scrollHeight:U,clientHeight:J}=f;fe+J>=U-200&&p()};return f.addEventListener("scroll",v,{passive:!0}),v(),()=>f.removeEventListener("scroll",v)},[y,S,p]),c.useEffect(()=>{const f=xe.current;if(!f)return;const v=_.current?.querySelector(`[data-message-id="${f}"]`);v&&(xe.current=null,v.focus({preventScroll:!0}))}),c.useEffect(()=>{if(R){if(!be){R.current=null;return}return R.current={focusNext:Ze,focusPrevious:Ve,focusFirst:qe,focusLast:ye,openFocused:it,toggleSelect:Ne,extendSelectDown:st,extendSelectUp:tt,selectAll:nt,clearSelection:()=>B?(q(),!0):!1,requestVerb:ot,toggleDensity:pe},()=>{R.current=null}}},[R,be,Ze,Ve,qe,ye,it,Ne,st,tt,nt,B,q,ot,pe]);const At=s?"loading":n?"error":o.length===0?"empty":"ready",us=n?Oo(i):void 0,ds=c.useCallback(()=>{const f=$s(Bs());window.open(f,"_blank","noopener,noreferrer")},[]),hs=[{id:"inbox",threads:[]}],St=D.length>0&&D.every(f=>A.has(f)),fs=Re&&y&&St&&!g&&!m&&j.phase.kind==="idle"&&!j.isRunning,ms=g||m||j.isRunning,yt=j.phase.kind==="escalated"?j.phase.total:ce,gs=j.runningAction?kn(j.runningAction.kind,j.progress?.done??0,j.progress?.total??yt):j.phase.kind==="counting"?"Counting matches…":j.phase.kind==="escalated"?Ai(u??{},j.phase.total):void 0,ps=j.phase.kind!=="escalated"&&D.length>0?{checked:St,indeterminate:ce>0&&!St,onChange:()=>We(D)}:void 0,xs=j.runningAction?{value:j.progress?.done??0,max:j.progress?.total??yt,tone:Tn(j.runningAction.kind)}:void 0,bs=(j.phase.kind==="counting"?{tone:"info",text:"",action:{label:"Stop",onClick:j.stop}}:j.phase.kind==="escalated"&&!j.isRunning?{tone:"info",text:"",action:{label:"Clear selection",onClick:W}}:fs?{tone:"info",text:"",action:{label:Ni(u??{}),onClick:j.escalate}}:void 0)??(He?{tone:"warning",text:He}:void 0),vs=r.jsx(jn,{title:L.title||b,navSlot:L.navSlot,titleMeta:L.titleMeta,searchSlot:L.searchSlot,searchField:L.searchField,idleSlot:L.makeFilterSlot,count:yt,onCancel:H,onDelete:()=>z("delete"),onMove:()=>z("move"),onOrganize:bt,onJunk:Te?()=>z("junk"):void 0,onMarkRead:()=>z("markRead"),overflowSlot:I&&e&&ce>0&&$e.length>0?r.jsx(Ao,{accountId:I,mailboxId:e,messageIds:Array.from(A)}):void 0,isBusy:ms,isCounting:j.phase.kind==="counting",selectAll:ps,statusLabel:gs,progress:xs,notice:bs}),Ss=wn(D,M),ys=c.useCallback(f=>{de.current=!0,K(f)},[K]),Cs=r.jsxs(r.Fragment,{children:[ge&&a&&r.jsx(Vo,{query:a,count:d}),r.jsxs("div",{ref:_,role:"listbox","aria-multiselectable":!0,"aria-label":b,className:"flex-1 overflow-y-auto",children:[r.jsx("div",{role:"presentation",className:"relative w-full",style:{height:`${ve.getTotalSize()}px`},children:ve.getVirtualItems().map(f=>{const v=o[f.index];return r.jsx("div",{role:"presentation","data-index":f.index,ref:ve.measureElement,className:Ae("absolute left-0 top-0 w-full border-b border-line",j.isRunning&&"pointer-events-none opacity-50"),style:{transform:`translateY(${f.start}px)`},children:r.jsx($i,{thread:v,mailboxId:e,isSelected:t===v.messageId,isFocused:M===v.messageId,isTabStop:Ss===v.messageId,onFocusRow:ys,isChecked:De(v.messageId),onToggleCheck:X,onRowSelect:gt,isMultiSelectMode:Me,onLongPress:C,isDesktop:O,onDelete:at,onToggleRead:vt,density:se})},f.key)})}),S&&r.jsx(ro,{})]})]});return r.jsxs(r.Fragment,{children:[ue&&!O&&r.jsx(ct,{tone:"success",variant:"soft",className:"m-2 rounded-md",onDismiss:()=>Xe(null),children:ue}),r.jsx(ao,{listTitle:b,listMeta:x,sections:hs,flatList:!0,listState:L.searchResults?"ready":At,searchQuery:ge?a:void 0,listFilter:w,listScopeLabel:k,errorMessage:us,onRetry:l,onReportError:ds,density:se,selectedThreadId:t,onSelectThread:f=>he(f),isDesktop:O,hideHeader:F,selectionBar:vs,listBody:L.searchResults??(At==="ready"?Cs:void 0)}),r.jsx(Mn,{isOpen:E!==null,messageIds:E??[],outcome:le,accountId:I,trashFolderLabel:b,staleFolderLabel:Be,guessedMailboxId:$,isDeleting:g,onConfirm:rt,onCancel:xt}),r.jsx(Rn,{verb:me,accountId:I,mailboxId:e,selection:mt,selectionRestriction:He?"spansAccounts":void 0,escalated:Le,escalatedProgress:j.progress,onFinished:q,onRunEnded:ft})]})},Ui=e=>Wt({path:{accountId:e}}),Qi=e=>{const o=Tt(),t=wt(),s=jt({...Ws(),onSuccess:()=>{t.recordEvent("sync.triggered"),o.invalidateQueries({queryKey:Ui(e)})}});return{trigger:()=>{s.mutate({path:{accountId:e}})},triggerAsync:()=>s.mutateAsync({path:{accountId:e}}),isPending:s.isPending,error:s.error,reset:s.reset}},Ji=({accountId:e,children:o})=>{const{triggerAsync:t,isPending:s}=Qi(e);return r.jsx(qo,{onRefresh:t,isRefreshing:s,children:o})};function Gi({accountId:e,currentMailboxId:o,candidates:t,onMove:s,children:n}){const[i,l]=c.useState(!1),a=wt(),u=Ks(),{inboxMailboxId:d}=On(e),h=Nn(e),{data:g}=ut({...Vs({path:{accountId:e}}),staleTime:1/0}),m=c.useMemo(()=>qs({mailboxes:g?.items??[],folderAppointments:h,currentMailboxId:o,translator:u}),[g?.items,h,o,u]),p=c.useMemo(()=>d||(m.find(x=>x.label.toLowerCase()==="inbox")?.id??m.find(x=>!x.isCurrent)?.id??""),[d,m]),y=c.useRef(!1);c.useEffect(()=>{y.current||(y.current=!0,An(a,t.length))},[a,t.length]);const S=c.useCallback(()=>{zn(a,t.length),l(!0)},[a,t.length]),I=c.useCallback((b,x)=>{Fn(a,{selected:b.length,total:t.length,toInbox:x===d}),s(b,x)},[a,t.length,d,s]);return r.jsxs("div",{className:"relative flex h-full min-h-0 flex-col",children:[r.jsx("div",{className:"shrink-0 px-row-inset pt-2",children:r.jsx(Uo,{count:t.length,onReview:S})}),r.jsx("div",{className:"min-h-0 flex-1",children:n}),r.jsx(oi,{open:i,candidates:t,defaultDestinationId:p,availableFolders:m,delimiter:Hs(g?.items??[]),onConfirmMove:I,onCancel:()=>l(!1)})]})}const Yi=(e,o,t,s)=>`${e??""}|${o}|${t??""}|${s??""}`,Xi=({accountId:e,mailboxId:o})=>{const t=Tt(),{pushError:s}=Bt(),{requestAppointment:n}=Us(),{trashByAccount:i}=Zt(),l=e?i.get(e):void 0,a=Yi(e,o,l?.mailboxId,l?.source),[u,d]=c.useState({scope:a});u.scope!==a&&d({scope:a});const h=u.scope===a?u:void 0,g=c.useCallback(()=>t.getQueryData(Qs())?.accounts.find(T=>T.accountId===e)?.folderAppointments.find(T=>T.role==="Trash")?.mailboxId??o,[t,e,o]),m=c.useRef(void 0),{mutateAsync:p,isPending:y}=jt({...Xs(),meta:Ys(409),onMutate:()=>(m.current=a,{scope:a,listMailboxId:g()}),onSuccess:(x,w,k)=>{k.scope===a&&d({scope:a,deletedCount:x.deletedCount})},onError:(x,w,k)=>{const T=Js(x);if(!T){s({title:"Couldn't empty Trash",detail:Gs(x),error:x});return}k?.scope===a&&d({scope:a,refusal:T})},onSettled:(x,w,k,T)=>{m.current===T?.scope&&(m.current=void 0),Io(t,ko([T?.listMailboxId??o])),e&&t.invalidateQueries({queryKey:Wt({path:{accountId:e}})})}}),S=c.useCallback(()=>e?(d({scope:a}),p({path:{accountId:e}}).then(()=>{},()=>{})):Promise.resolve(),[e,a,p]),I=c.useCallback(()=>{S()},[S]),b=c.useCallback(()=>{const x=h?.refusal;x&&n({accountId:x.accountId,role:x.role,reason:x.reason,action:{kind:"emptyTrash"},onAppointed:S})},[h,n,S]);return{emptyTrash:I,isEmptying:y&&m.current===a,deletedCount:h?.deletedCount,refusal:h?.refusal,repair:b}},Zi="We can verify this sender";function er(e){const{data:o}=ut({...Zs({path:{mailboxId:e??""},query:{senderTrust:["vip","wellknown"],dkimMismatch:!1,results:!0,limit:500}}),enabled:!!e,staleTime:6e4});return{candidates:(o?.items??[]).map(s=>({id:s.messageId,senderName:s.fromName||s.fromEmail||"Unknown sender",senderAddress:s.fromEmail??"",subject:s.subject||"(no subject)",snippet:s.snippet??"",trustReason:Zi,trustSubReason:Dn(s.senderTrust),senderTrust:s.senderTrust}))}}const tr=3,sr=({hasSearchQuery:e,freeText:o,residualTokenCount:t})=>{if(!e||t>0)return!1;const s=o.trim();return s.length===0||s.length>=tr},nr=e=>e===void 0?{kind:"unknown"}:{kind:"exact",value:e},or=6e4,ir=({mailboxId:e,criteria:o,enabled:t})=>{const s={...o,count:!0,results:!1},{data:n}=ut({queryKey:Kt({path:{mailboxId:e},query:s}),queryFn:async()=>{const{data:i}=await Vt({path:{mailboxId:e},query:s,throwOnError:!0});return i},enabled:t,staleTime:or});return t?nr(n?.count):{kind:"unknown"}},rr=e=>{const o=new Set,t=[];for(const s of e)o.has(s.threadMessageId)||(o.add(s.threadMessageId),t.push(s));return t},ar=50,ls=c.createContext(null);function ht(){const e=c.useContext(ls);if(!e)throw new Error("MailboxPane.* must be used inside <MailboxPane>");return e}function lr({mailboxId:e,thread:o,children:t}){const s=Je(),n=To(),i=Bo(),l=o?.threadId,a=o?.messageId,u=wt(),{accounts:d,searchQuery:h,onToggleIntelligence:g}=qt(),m=rn(),p=$o(h),y=p.length>0,{freeText:S,tokens:I}=an(p,m),[b,x]=c.useState("all"),[w,k]=c.useState(new Set),T=c.useMemo(()=>({category:b,attributes:w}),[b,w]),R=c.useMemo(()=>lo(T),[T]),F=y||co(T),{params:_,residual:G}=uo(I,R),O={order:"desc",...S?{query:S}:{},..._,...R},N={...O,limit:ar},me={category:N.category,unread:N.unread,starred:N.starred,attachments:N.attachments},z=F?Kt({path:{mailboxId:e},query:N}):en({path:{mailboxId:e},query:{order:"desc"}}),{data:oe,isLoading:Ce,isError:ge,error:L,refetch:$e,fetchNextPage:re,hasNextPage:M,isFetchingNextPage:Ie}=ho({queryKey:z,queryFn:async({pageParam:C})=>{if(F){const{data:W}=await Vt({path:{mailboxId:e},query:{...N,continuationToken:C},throwOnError:!0});return W}const{data:H}=await on({path:{mailboxId:e},query:{order:"desc",continuationToken:C},throwOnError:!0});return H},initialPageParam:void 0,getNextPageParam:C=>C.continuationToken,placeholderData:(C,H)=>xo(H?.queryKey,me)?C:void 0}),ze=ir({mailboxId:e,criteria:O,enabled:sr({hasSearchQuery:y,freeText:S,residualTokenCount:G.length})}),{accountId:P,isLoading:K}=_n(e),se=jo({accounts:d}),Y=fo(Ln(rr(oe?.pages.flatMap(C=>C.items??[])??[])),G,P),pe=c.useCallback(C=>{x(C)},[]),ke=c.useCallback(C=>{k(H=>{const W=new Set(H);return W.has(C)?W.delete(C):W.add(C),W})},[]),ae=c.useCallback(()=>{x("all"),k(new Set)},[]),Te=mo(b),Fe=Te?{label:Te,reach:G.length>0?"loaded-pages":go(N),onClear:ae}:void 0,le=l?Y.find(C=>C.messageId===a)??Y.find(C=>C.threadId===l):void 0,Be=Pn(l,a),$=le??Be,A=a??$?.messageId,ce=c.useMemo(()=>{if(l)return{threadId:l,mailboxId:$?.mailboxId??e,subject:$?.subject,messageId:A,authenticity:$?.authenticity}},[l,$,A,e]),B=c.useCallback(C=>{A&&C.includes(A)&&n()},[A,n]),{deleteMessages:De,isPending:X}=zt({mailboxId:e,onAfterOptimisticRemove:B}),{moveMessages:je,isPending:we}=Ft({mailboxId:e,accountId:P,onAfterOptimisticRemove:B}),ie=c.useRef(null),V=$n(),{listCommandsRef:Q,onTriageContextChange:We,focusedMessageId:Ge,selectedIds:Me}=V,E=Y.find(C=>C.messageId===Ge)??$,_e=wo({accounts:d})??null,Re=Bn({thread:$,isOpen:!0,mailboxId:e,accountId:P,onAfterOptimisticRemove:B}),{draftsMailboxId:Ye}=Wn(P),j=Ye!==void 0&&Ye===e,{archiveMailboxId:ft}=Kn(P),Ke=Vn(),Ee=tn(),q=c.useMemo(()=>sn(Ee,l,A),[Ee,l,A]),ue=c.useMemo(()=>{if(E)return C=>Ee({threadId:E.threadId,messageId:E.messageId,mode:C})},[Ee,E]),Xe=yo(),xe=nn(),de=Co(),Oe=c.useCallback(C=>C?Ke(C):[],[Ke]),{toggleStar:be}=qn({threadId:E?.threadId??"",mailboxId:e}),{toggleReadFor:ve}=Gt({mailboxId:e,accountId:P}),{junkMailboxId:Se}=Yt(P),Z=Se!=null&&Se===e,ee=Xt(Se,e),{candidates:Ze}=er(Z?Se:void 0),{moveMessages:Ve}=Ft({mailboxId:e,threadId:E?.threadId,accountId:P,onAfterOptimisticRemove:B}),{deleteMessages:qe}=zt({mailboxId:e,threadId:E?.threadId,onAfterOptimisticRemove:B}),{addressId:ye,address:Ne}=Hn(E),{updateFlags:D}=Un({addressId:ye,senderEmail:E?.fromEmail??void 0}),mt=c.useCallback(()=>ue?.("reply"),[ue]),gt=c.useCallback(()=>ue?.("reply-all"),[ue]),et=c.useCallback(()=>ue?.("forward"),[ue]),ne=c.useCallback(()=>Oe(E),[Oe,E]),tt=c.useCallback(()=>{if(Q.current?.requestVerb("delete"))return;const C=ne();C.length>0&&qe(C)},[Q,ne,qe]),st=c.useCallback(()=>{if(Q.current?.requestVerb("junk")||!ee)return;const C=ne();C.length!==0&&(Qn(u,{count:C.length,senderTrust:E?.senderTrust??"unknown",wasRescuable:E?Jn(E):!1}),Ve(C,ee))},[Q,ee,ne,Ve,u,E]),nt=c.useCallback(()=>{if(Me.length>0){const C=!(E?.hasStars??!1),H=new Set(Me);for(const W of Y)H.has(W.messageId)&&W.hasStars!==C&&be(W.messageId,W.hasStars);return}E&&be(E.messageId,E.hasStars)},[Me,Y,E,be]),ot=c.useCallback(()=>{if(Q.current?.requestVerb("markRead"))return;const C=ne();if(C.length===0)return;const H=!(E?.isRead??!1);ve(C,H)},[Q,ne,E,ve]),he=c.useCallback(()=>{if(!ye)return;const C=Ne?.flags?.muted?.value!==!0;D({muted:{value:C}})},[ye,Ne,D]),it=c.useCallback(()=>{if(!ye)return;const C=Ne?.flags?.vip?.value!==!0;D({vip:{value:C}})},[ye,Ne,D]),pt=c.useCallback(()=>{ie.current?.open()},[]),Le=j?"drafts":ft===e?"archive":Se===e?"junk":"inbox",rt=c.useRef("");c.useEffect(()=>{const C=rt.current;rt.current=p,p.length>0&&C.length===0&&u.recordEvent("search.submitted",{mailboxType:Le})},[p,Le,u]);const{goBack:xt,nextMessageId:He,previousMessageId:bt}=Gn({context:V,orderedIds:Y.map(C=>C.messageId),selectedMessageId:A,enabled:!Xe&&!xe,hasOpenThread:l!==void 0,onClose:n,handlers:{reply:mt,replyAll:gt,forward:et,delete:tt,toggleStar:nt,toggleRead:ot,muteSender:he,blockSender:$?pt:void 0,vipSender:it,markJunk:st,toggleIntelligence:$?()=>ie.current?.toggle():void 0,compose:de,goBrief:()=>i("brief"),goInbox:()=>i("brief"),goSent:()=>i("brief"),goFlagged:()=>i("flagged"),goSettings:()=>i("settings")}}),at=C=>{if(!C)return;const H=Y.find(W=>W.messageId===C);return H?{threadId:H.threadId,messageId:C}:void 0},vt={mailboxId:e,selectedMessageId:A,selectedThread:$,conversation:ce,onOpenThread:s,threads:Y,isLoading:Ce,isError:ge,error:L,mailboxAccountId:P,mailboxAccountLoading:K,mailboxName:se,unreadCount:_e,isDraftsMailbox:j,isSpamFolder:Z,rescueCandidates:Ze,filterCategory:b,filterAttributes:w,onSelectFilterCategory:pe,onToggleFilterAttribute:ke,onClearFilters:ae,listFilter:Fe,onToggleIntelligence:g,intelligenceRef:ie,handleDeselectIfRemoved:B,searchPredicate:y&&G.length===0?N:void 0,resultCount:ze,onDeleteMessages:De,onMoveMessages:je,isDeleting:X,isMoving:we,onLoadMore:re,hasMore:M,isLoadingMore:Ie,onTriageContextChange:We,listCommandsRef:Q,onRetry:()=>$e(),onReply:q,onToolbarDelete:Re.deleteThread,onToolbarStar:Re.toggleStar,isStarred:Re.isStarred,onToolbarMove:Re.moveThread,onBack:xt,nextThread:at(He),previousThread:at(bt)};return r.jsx(ls.Provider,{value:vt,children:t})}function cs(){const{mailboxId:e,selectedMessageId:o,threads:t,isLoading:s,isError:n,error:i,onDeleteMessages:l,onMoveMessages:a,isDeleting:u,isMoving:d,onLoadMore:h,hasMore:g,isLoadingMore:m,mailboxAccountId:p,mailboxName:y,unreadCount:S,isDraftsMailbox:I,isSpamFolder:b,rescueCandidates:x,onTriageContextChange:w,listCommandsRef:k,onRetry:T,filterCategory:R,filterAttributes:F,onSelectFilterCategory:_,onToggleFilterAttribute:G,onClearFilters:O,listFilter:N,searchPredicate:me,resultCount:z}=ht(),{searchQuery:oe,searchInput:Ce,accounts:ge,resultFolderIndex:L}=qt(),$e=Po(),re=Je(),M=y??"Inbox",Ie=c.useMemo(()=>to(),[]),{trashMailboxId:ze}=so(p),P=Mo({accounts:ge}),{trashByAccount:K}=Zt(),se=Xi({accountId:p,mailboxId:e}),Y=ze!=null&&ze===e,pe=c.useMemo(()=>p?[p]:[],[p]),{hasNewMail:ke}=cn(),{state:ae,errorMessage:Te,refresh:Fe}=un(pe,{onSettled:T}),le=c.useMemo(()=>r.jsx(dn,{state:ae,onRefresh:Fe,label:`Refresh ${M}`,errorMessage:Te,hasUpdate:ke(pe)}),[ae,Fe,M,Te,ke,pe]),Be=c.useMemo(()=>t.map(V=>no(V,L)),[t,L]),{hits:$,isLoading:A}=Fo({mailboxId:e,filterCategory:R}),ce=c.useMemo(()=>oo($,t.map(V=>V.threadId),L),[$,t,L]),B=c.useCallback(V=>{const Q=V.threadId??t.find(We=>We.messageId===V.id)?.threadId;Q&&re({threadId:Q,messageId:V.id},{mailboxId:V.mailboxId??e,query:Ce})},[e,re,Ce,t]);if(I&&p)return r.jsx(di,{accountId:p,selectedMessageId:o,imapThreads:t,title:y??"Drafts",unreadCount:S??void 0});const De=r.jsx(Hi,{mailboxId:e,threads:t,selectedMessageId:o,isLoading:s,isError:n,error:i,onRetry:T,searchQuery:oe,searchPredicate:me,resultCount:z,onDeleteMessages:l,isDeleting:u,isMoving:d,onLoadMore:h,hasMore:g,isLoadingMore:m,accountId:p,listTitle:M,listFilter:N,listScopeLabel:M,hideHeader:!0,onTriageContextChange:w,commandsRef:k}),X=ge[0]?.accountId,je=$e==="phone"&&X?r.jsx(Ji,{accountId:X,children:De}):De,we=b&&x.length>0&&p?r.jsx(Gi,{accountId:p,currentMailboxId:e,candidates:x,onMove:a,children:je}):je,ie=Y?r.jsx(mi,{messageCount:P,isEmptying:se.isEmptying,deletedCount:se.deletedCount,refusalReason:se.refusal?.reason,trashFolderLabel:y??void 0,staleFolderLabel:p?K.get(p)?.staleFolderPath:void 0,onEmpty:se.emptyTrash,onRepair:se.repair,children:we}):we;return r.jsx(po,{title:M,unreadCount:S,preset:Ie,selectedCategory:R,activeFilters:F,onSelectCategory:_,onToggleFilter:G,onClearFilters:O,searchResults:Be,searchLoading:s,relatedResults:ce,relatedLoading:A,onSelectSearchResult:B,searchResultsInBody:!0,refreshControl:le,children:ie})}function cr(){const{mailboxId:e,mailboxAccountId:o,mailboxAccountLoading:t,selectedThread:s,conversation:n,onReply:i,onToolbarDelete:l,onToolbarStar:a,isStarred:u,onToolbarMove:d,handleDeselectIfRemoved:h,intelligenceRef:g}=ht(),m=!!n,p=Zn(n?.threadId);es(g,p);const y=c.useRef(null),{railFits:S,openRail:I}=p;c.useEffect(()=>{if(!S)return;const x=s?.messageId??null;x&&y.current!==x&&s?.authenticity?.dkimMismatch&&(y.current=x,I())},[S,I,s?.messageId,s?.authenticity?.dkimMismatch]);const b=n?r.jsx(ts,{threadId:n.threadId,mailboxId:n.mailboxId,subject:n.subject,selectedMessageId:n.messageId,authenticity:n.authenticity,onOpenIntelligence:p.open,listOnScreen:!0}):r.jsx(ln,{});return r.jsxs(r.Fragment,{children:[r.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[r.jsx(eo,{hasThread:m,messageId:n?.messageId,intelligenceOpen:p.isShowing,canToggleIntelligence:p.canToggle,onToggleIntelligence:p.toggle,onReply:i?()=>i("reply"):void 0,onReplyAll:i?()=>i("reply-all"):void 0,onForward:i?()=>i("forward"):void 0,onDelete:m?l:void 0,onToggleStar:m?a:void 0,isStarred:u,moveContext:m&&o?{accountId:o,currentMailboxId:e,onMove:d}:void 0,moveContextLoading:t}),r.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:b})]}),r.jsx(ss,{isOpen:p.drawerOpen,onClose:p.closeDrawer,thread:s,mailboxId:e,accountId:o,onAfterOptimisticRemove:h})]})}function ur(){const{mailboxId:e,mailboxAccountId:o,selectedThread:t,onToggleIntelligence:s,handleDeselectIfRemoved:n}=ht();return r.jsx(Xn,{onClose:s,thread:t,mailboxId:e,accountId:o,onAfterOptimisticRemove:n})}function dr(){const{mailboxId:e,mailboxAccountId:o,selectedThread:t,conversation:s,onOpenThread:n,onBack:i,nextThread:l,previousThread:a,handleDeselectIfRemoved:u,intelligenceRef:d}=ht(),h=Yn(s?.threadId??null);return es(d,h),s?r.jsxs(r.Fragment,{children:[r.jsx(ts,{threadId:s.threadId,mailboxId:s.mailboxId,subject:s.subject,selectedMessageId:s.messageId,authenticity:s.authenticity,onBack:i,onOpenIntelligence:h.toggle,onSwipeNext:l?()=>n(l):void 0,onSwipePrevious:a?()=>n(a):void 0,mobileIntelligenceOpen:h.isOpen}),r.jsx(ss,{isOpen:h.isOpen,onClose:h.close,thread:t,mailboxId:e,accountId:o,onAfterOptimisticRemove:u})]}):r.jsx(cs,{})}const Fr=Object.assign(lr,{List:cs,Reading:cr,Intelligence:ur,Phone:dr});export{Fr as M};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as n,j as a,f as o}from"./index-
|
|
1
|
+
import{v as n,j as a,f as o}from"./index-Dx85_wSY.js";import{M as e}from"./menu-mBksCdgx.js";function i(){const s=n();return!s||s.showNavPane?null:a.jsx(o,{variant:"ghost",size:"sm",icon:a.jsx(e,{className:"size-4"}),onClick:s.openNav,"aria-label":"Open folders",className:"-ml-1 shrink-0"})}export{i as N};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as ie,r as t,j as e,h as ce,i as Z,o as le,aw as de,c as q,aN as K,d as ee,f as k,L as _,B as H,aO as G,ax as ue,ay as $,n as me,I as pe}from"./index-D855R0Fw.js";import{K as he}from"./kbd-Cfms0Oys.js";import{c as fe,d as xe,s as U,W as L,C as D,g as ye,e as X,f as ge,h as ve,b as Se,R as be,a as W,S as je}from"./credential-steps-SdAyOxLX.js";import{c as we}from"./account-form-helpers-DhckT_PN.js";import{M as Ce}from"./mail-D8ExCCOr.js";import{F as ke}from"./file-json-C19C1p7d.js";const Q=ie("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]),te=[{id:"icloud",label:"iCloud",username:"full-email",imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},passwordHelp:{text:"iCloud requires an app-specific password, not your Apple ID password. Generate one under Sign-In & Security → App-Specific Passwords.",url:"https://support.apple.com/en-us/102654"}},{id:"yahoo",label:"Yahoo",username:"full-email",imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},passwordHelp:{text:"Yahoo requires an app password, not your login password. Generate one under Account Security.",url:"https://help.yahoo.com/kb/generate-manage-third-party-passwords-sln15241.html"}},{id:"aol",label:"AOL",username:"full-email",imap:{host:"imap.aol.com",port:993,security:"tls"},smtp:{host:"smtp.aol.com",port:465,security:"tls"},passwordHelp:{text:"AOL requires an app password, not your login password. Generate one under Account Security.",url:"https://login.aol.com/account/security"}},{id:"fastmail",label:"Fastmail",username:"full-email",imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},passwordHelp:{text:"Fastmail requires an app password, not your login password. Create one under Settings → Privacy & Security → App passwords.",url:"https://www.fastmail.help/hc/en-us/articles/360058752854"}}];function Y(a){return te.find(d=>d.id===a)}const Ee={"icloud.com":"icloud","me.com":"icloud","mac.com":"icloud","yahoo.com":"yahoo","yahoo.co.uk":"yahoo","ymail.com":"yahoo","aol.com":"aol","fastmail.com":"fastmail","fastmail.fm":"fastmail"};function Ne(a){const d=a.indexOf("@");if(d===-1)return"";const c=a.slice(d+1).toLowerCase();return Ee[c]??""}const T=["Connector","Address","Servers","Credentials","Test","Sync"],A={connector:0,address:1,servers:2,credentials:3,test:4,sync:5},V={host:"",port:993,security:"tls"},J={host:"",port:587,security:"starttls"};function Pe({onStart:a,onImportConfig:d}){return t.useEffect(()=>{const c=p=>{p.key==="Enter"&&a()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[a]),e.jsx(L,{steps:T,activeStep:0,hideSteps:!0,title:"Welcome to Remit",subtitle:d?"Set up your first account, or bring the settings from another Reader.":"One inbox for all your mail, with context about every message.",footer:e.jsxs(e.Fragment,{children:[d?e.jsx(k,{variant:"secondary",icon:e.jsx(ke,{className:"size-4"}),onClick:d,children:"Import a config file"}):e.jsxs("span",{className:"text-2xs text-fg-subtle",children:[e.jsx(he,{children:"Enter"})," to continue"]}),e.jsx(k,{variant:"primary",onClick:a,children:"Add your first account"})]}),children:e.jsxs("div",{className:"flex flex-col items-start py-5",children:[e.jsx("span",{className:"flex size-14 items-center justify-center rounded-md bg-accent-soft",children:e.jsx(Ce,{className:"size-7 text-accent"})}),e.jsx("p",{className:"mt-5 max-w-sm text-sm leading-relaxed text-fg-muted",children:"Remit syncs your existing mailboxes and tells you who is really writing to you — sender history, authenticity checks, and similar messages, right next to every email."}),d&&e.jsx("p",{className:"mt-3 max-w-sm text-sm leading-relaxed text-fg-muted",children:"A config file carries your accounts, folder roles, rules, flagged senders and appearance from another Reader. It never carries passwords, so you sign in again here."})]})})}function Te({onContinue:a,onMicrosoft:d,onBack:c,showBack:p}){const[h,o]=t.useState("imap");t.useEffect(()=>{const y=i=>{i.key==="Enter"&&(h==="microsoft"?d():a()),i.key==="Escape"&&c()};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[a,d,c,h]);const n=()=>{h==="microsoft"?d():a()};return e.jsx(L,{steps:T,activeStep:A.connector,title:"How does this account connect?",subtitle:"Choose a sign-in method. IMAP works with any provider.",footer:e.jsxs(e.Fragment,{children:[p?e.jsx(k,{variant:"ghost",onClick:c,children:"Back"}):e.jsx("span",{}),e.jsx(k,{variant:"primary",onClick:n,children:h==="microsoft"?"Continue with Microsoft":"Continue with IMAP"})]}),children:e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[e.jsx(W,{name:"IMAP / SMTP",description:"Any mail provider — Fastmail, iCloud, your own server.",icon:e.jsx(je,{className:"size-5"}),selected:h==="imap",onSelect:()=>o("imap")}),e.jsx(W,{name:"Gmail",description:"Sign in with Google. No app passwords.",icon:e.jsx(Q,{className:"size-5"}),comingSoon:!0}),e.jsx(W,{name:"Outlook / Microsoft 365",description:"Sign in with Microsoft. Works with Outlook.com and work accounts.",icon:e.jsx(pe,{className:"size-5"}),selected:h==="microsoft",onSelect:()=>o("microsoft")})]})})}function Ae({onBack:a,onConnected:d}){const[c,p]=t.useState(""),[h,o]=t.useState(null),[n,y]=t.useState(!1),[i,g]=t.useState(!1),v=t.useRef(!0);t.useEffect(()=>(v.current=!0,()=>{v.current=!1}),[]);const E=t.useRef(new Set),{refetch:w}=q(ee()),j=Se(r=>{if(g(!1),r==="stalled"){y(!1),o(be);return}w().then(({data:u,isError:N})=>{if(!v.current)return;if(N||!u){o("Couldn't check whether the sign-in finished. Open Settings › Accounts to see whether the account is connected.");return}o(null);const C=u.accounts.find(P=>!E.current.has(P.accountId));C&&d(C.accountId)})}),S=Z({...me(),onSuccess:r=>{v.current&&(j(),y(!0),window.location.assign(r.authorizationUrl))},onError:r=>{g(!1),o(r instanceof Error?r.message:"Failed to start sign-in")}}),l=i||S.isPending,f=()=>{l||(o(null),g(!0),w().then(({data:r,isError:u})=>{if(v.current){if(u||!r){g(!1),o("Couldn't read this instance's accounts, so sign-in can't be tracked. Check your connection and try again.");return}E.current=new Set(r.accounts.map(N=>N.accountId)),S.mutate({body:{email:c.trim()||void 0}})}}))},x=t.useRef(f);return x.current=f,t.useEffect(()=>{const r=u=>{u.key==="Enter"&&x.current(),u.key==="Escape"&&a()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[a]),e.jsx(L,{steps:T,activeStep:A.connector,title:"Sign in with Microsoft",subtitle:"You'll be redirected to Microsoft to sign in securely.",footer:e.jsxs(e.Fragment,{children:[e.jsx(k,{variant:"ghost",onClick:a,children:"Back"}),e.jsx(k,{variant:"primary",onClick:f,disabled:l,icon:l?e.jsx(_,{className:"size-4 animate-spin"}):void 0,children:l?"Redirecting…":n?"Start over":"Sign in with Microsoft"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(G,{htmlFor:"microsoft-email",children:"Email address (optional)"}),e.jsx($,{id:"microsoft-email",icon:e.jsx(Q,{className:"size-4"}),placeholder:"you@outlook.com",value:c,onChange:r=>p(r.target.value),type:"email",autoComplete:"email"}),e.jsx("p",{className:"mt-1.5 text-2xs text-fg-subtle",children:"Pre-fills the Microsoft sign-in form. Leave blank to choose on the Microsoft page."})]}),n&&e.jsx(H,{tone:"info",children:"Waiting for Microsoft. Finish signing in — this window carries on the moment the account is connected, wherever you finished."}),h&&e.jsx(H,{tone:"danger",children:h})]})})}function Ie({initialEmail:a,initialDisplayName:d,onContinue:c,onBack:p}){const[h,o]=t.useState(a),[n,y]=t.useState(d),[i,g]=t.useState(!1),[v,E]=t.useState(""),[w,j]=t.useState(null),S=t.useCallback(async()=>{const l=h.trim();if(!l.includes("@")||!l.includes(".")){j("Enter a valid email address.");return}j(null),g(!0),E(ge(l));try{const f=await ve(l);c(l,n.trim(),f)}finally{g(!1)}},[h,n,c]);return t.useEffect(()=>{const l=f=>{f.key==="Enter"&&!i&&S(),f.key==="Escape"&&p()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[S,i,p]),e.jsx(L,{steps:T,activeStep:A.address,title:"What's the email address?",subtitle:"We'll detect the server settings for you.",footer:e.jsxs(e.Fragment,{children:[e.jsx(k,{variant:"ghost",onClick:p,children:"Back"}),e.jsx(k,{variant:"primary",disabled:i,onClick:()=>{S()},children:"Continue"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(G,{htmlFor:"onboarding-email",children:"Email address"}),e.jsx($,{id:"onboarding-email",icon:e.jsx(Q,{className:"size-4"}),placeholder:"you@example.com",value:h,onChange:l=>{o(l.target.value),j(null)},type:"email",autoComplete:"email"})]}),e.jsxs("div",{children:[e.jsx(G,{htmlFor:"onboarding-display-name",children:"Display name (optional)"}),e.jsx($,{id:"onboarding-display-name",placeholder:"Alice",value:n,onChange:l=>y(l.target.value)}),e.jsx("p",{className:"mt-1.5 text-2xs text-fg-subtle",children:"What to call this account in Remit. Leave blank to use a name derived from the address."})]}),i&&e.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx(_,{className:"size-3.5 animate-spin text-accent"}),v]}),w&&!i&&e.jsx("div",{className:"mt-3",children:e.jsx(H,{tone:"danger",children:w})})]})})}function Me({email:a,imapConfig:d,smtpConfig:c,discovered:p,onContinue:h,onBack:o,onChange:n}){const[y,i]=t.useState(d),[g,v]=t.useState(c),[E,w]=t.useState(()=>Ne(a)),[j,S]=t.useState(!1),[l,f]=t.useState(null),x=Y(E),r=x!==void 0&&!j,u=t.useCallback(m=>{w(m),S(!1),f(null);const s=Y(m);s&&(i({host:s.imap.host,port:s.imap.port,security:s.imap.security}),v({host:s.smtp.host,port:s.smtp.port,security:s.smtp.security}))},[]);t.useEffect(()=>{n(y,g)},[y,g,n]);const N=y.host.trim()!=="",C=t.useCallback(()=>{if(!N){f("Enter the IMAP host.");return}f(null),h()},[N,h]);t.useEffect(()=>{const m=s=>{s.key==="Enter"&&C(),s.key==="Escape"&&o()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[C,o]);const P=a.split("@")[1]??"your domain",F=x?"Pick your provider to fill in the right settings — or choose Custom to enter them by hand.":p?"Found via autodiscovery — adjust anything that looks off.":`We couldn't detect settings for ${P} — enter them manually.`,I=r?{label:"preset",tone:"neutral"}:!x&&p?{label:"detected",tone:"positive"}:void 0,M=x?.passwordHelp.url??ye(a);return e.jsx(L,{steps:T,activeStep:A.servers,title:"Confirm server settings",subtitle:F,footer:e.jsxs(e.Fragment,{children:[e.jsx(k,{variant:"ghost",onClick:o,children:"Back"}),e.jsx(k,{variant:"primary",onClick:C,children:"Continue"})]}),children:e.jsxs("div",{className:"space-y-5",children:[l&&e.jsx(H,{tone:"danger",children:l}),e.jsxs("div",{children:[e.jsx(G,{htmlFor:"provider-select",children:"Provider"}),e.jsxs(ue,{id:"provider-select",value:E,onChange:m=>u(m.target.value),children:[e.jsx("option",{value:"",children:"Custom / other"}),te.map(m=>e.jsx("option",{value:m.id,children:m.label},m.id))]}),x&&e.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:r?e.jsxs(e.Fragment,{children:["Server settings are pre-filled for ",x.label," and locked."," ",e.jsx("button",{type:"button",className:"text-accent underline",onClick:()=>S(!0),children:"Advanced"})," ","lets you edit them by hand."]}):e.jsxs(e.Fragment,{children:["Editing ",x.label,"'s settings by hand."]})})]}),e.jsx(X,{legend:"IMAP — incoming",badge:I,readOnly:r,host:y.host,port:String(y.port),security:y.security,hostPlaceholder:"imap.example.com",portPlaceholder:"993",onHostChange:m=>{i(s=>({...s,host:m})),f(null)},onPortChange:m=>i(s=>({...s,port:Number(m)})),onSecurityChange:m=>i(s=>({...s,security:m}))}),e.jsx("p",{className:"text-2xs text-fg-subtle",children:"Sending (SMTP) is optional — leave it blank to set up a receive-only account and add sending later in Settings."}),e.jsx(X,{legend:"SMTP — outgoing (optional)",badge:I,readOnly:r,host:g.host,port:String(g.port),security:g.security,hostPlaceholder:"smtp.example.com",portPlaceholder:"587",onHostChange:m=>{v(s=>({...s,host:m})),f(null)},onPortChange:m=>v(s=>({...s,port:Number(m)})),onSecurityChange:m=>v(s=>({...s,security:m}))}),x&&e.jsxs("p",{className:"text-2xs text-fg-subtle",children:[x.passwordHelp.text," ",M&&e.jsx("a",{href:M,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"Get an app password"})]})]})})}const Le=2e4;function Fe({email:a,displayName:d,imapConfig:c,smtpConfig:p,username:h,password:o,onGoToInbox:n}){const y=ce(),[i,g]=t.useState(null),[v,E]=t.useState(null),w=t.useRef(!1),j=U(c.security),S=U(p.security),l=Z({...de(),onSuccess:b=>{g(b.accountId),y.invalidateQueries({queryKey:le()})},onError:b=>{E(b instanceof Error?b.message:"Failed to create account")}});t.useEffect(()=>{if(w.current)return;w.current=!0;const b=p.host.trim()!=="",O=we({imapHost:c.host,smtpHost:p.host,smtpPort:p.port}),R=b?O??{smtpHost:p.host,smtpPort:p.port,smtpTls:S.tls,smtpStartTls:S.startTls}:null;l.mutate({body:{email:a,displayName:d||void 0,username:h!==a?h:void 0,password:o,imapHost:c.host,imapPort:c.port,imapTls:j.tls,imapStartTls:j.startTls,smtpHost:R?.smtpHost||void 0,smtpPort:R?.smtpPort||void 0,smtpTls:R?.smtpTls??!1,smtpStartTls:R?.smtpStartTls??!1}})},[]);const{data:f,isError:x}=q({...K({path:{accountId:i??""}}),enabled:!!i,refetchInterval:b=>{const O=b.state.data?.syncPhase;return O==="complete"||O==="error"?!1:2e3}}),r=f?.syncPhase==="error",{data:u}=q({...ee(),enabled:!!i&&r}),N=u?.accounts.find(b=>b.accountId===i)?.lastError,C=f?.mailboxes.find(b=>b.fullPath==="INBOX"||b.fullPath==="Inbox"),P=f?.mailboxCountTotal??0,F=f?.mailboxCountSynced??0,I=C?.messagesTotal??0,M=C?.messagesSynced??0,m=I>0?M/I:0,s=f?.syncPhase,se=r?"failed":s==="idle"||s===void 0||s==="discovering_mailboxes"?"running":P>0?"ok":"running",z=r?"failed":!s||s==="idle"||s==="discovering_mailboxes"?"pending":s==="syncing_inbox"||s==="syncing_others"?"running":"ok",B=r?"failed":!s||s==="idle"||s==="discovering_mailboxes"||s==="syncing_inbox"?"pending":s==="syncing_others"?"running":"ok",ne=M>0||C?.phase==="complete"||s==="complete"||r,[ae,oe]=t.useState(!1);t.useEffect(()=>{if(!i)return;const b=setTimeout(()=>oe(!0),Le);return()=>clearTimeout(b)},[i]);const re=!!i&&(ne||x||ae);return v?e.jsx(L,{steps:T,activeStep:A.sync,title:"Couldn't create account",subtitle:"Something went wrong saving your account.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{}),e.jsx(k,{variant:"primary",onClick:()=>{w.current=!1,E(null),l.mutate({body:{email:a,displayName:d||void 0,username:h!==a?h:void 0,password:o,imapHost:c.host,imapPort:c.port,imapTls:j.tls,imapStartTls:j.startTls,smtpHost:p.host||void 0,smtpPort:p.port||void 0,smtpTls:S.tls,smtpStartTls:S.startTls}})},children:"Retry"})]}),children:e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:v})}):e.jsx(L,{steps:T,activeStep:A.sync,title:`Syncing ${a}`,subtitle:"Newest mail first — you can start reading right away.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Sync continues in the background"}),re?e.jsx(k,{variant:"primary",onClick:()=>i&&n(i),children:"Go to inbox"}):e.jsx(k,{variant:"primary",disabled:!0,icon:e.jsx(_,{className:"size-3.5 animate-spin"}),children:"Getting your mail…"})]}),children:l.isPending?e.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-fg-muted",children:[e.jsx(_,{className:"size-4 animate-spin text-accent"}),"Creating your account…"]}):e.jsxs("div",{className:"space-y-3",children:[I>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline justify-between text-xs",children:[e.jsx("span",{className:"font-medium text-fg",children:"INBOX"}),e.jsxs("span",{className:"text-fg-subtle tabular-nums",children:[M.toLocaleString()," / ",I.toLocaleString()," ","messages"]})]}),e.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-sunken",children:e.jsx("div",{className:"h-full rounded-full bg-accent transition-all duration-500",style:{width:`${Math.max(2,m*100)}%`}})})]}),e.jsxs("div",{className:"divide-y divide-line",children:[e.jsx(D,{label:"Mailboxes discovered",detail:P>0?`${P} mailbox${P===1?"":"es"} found`:"Discovering…",state:se}),e.jsx(D,{label:"INBOX",detail:z==="ok"?`${M.toLocaleString()} messages synced`:z==="running"?"Syncing newest first…":"Queued",state:z}),F>1||s==="syncing_others"||s==="complete"?e.jsx(D,{label:"Other mailboxes",detail:B==="ok"?`${F-1} mailboxes synced`:B==="running"?"Syncing…":"Queued",state:B}):null]}),r&&e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsxs("p",{className:"text-xs text-danger",children:["Sync stalled. The account is still active —"," ",e.jsx("button",{type:"button",className:"underline",onClick:()=>{y.invalidateQueries({queryKey:K({path:{accountId:i??""}}).queryKey})},children:"retry"})]}),N&&e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:N})]})]})})}function Be({skipWelcome:a=!1,onComplete:d,onCancel:c,onImportConfig:p}){const[h,o]=t.useState(a?"connector":"welcome"),[n,y]=t.useState({email:"",displayName:"",imapConfig:V,smtpConfig:J,username:"",password:"",discoveryResult:null,discovered:!1,createdAccountId:null}),i=t.useCallback(()=>o("connector"),[]),g=t.useCallback(()=>o("address"),[]),v=t.useCallback(()=>o("microsoft-email"),[]),E=t.useCallback(()=>{a?c?.():o("welcome")},[a,c]),w=t.useCallback((x,r,u)=>{let N=V,C=J,P=!1;u&&(P=u.source!=="heuristic",N={host:u.imap.host,port:u.imap.port,security:u.imap.security},C={host:u.smtp.host,port:u.smtp.port,security:u.smtp.security}),y(F=>({...F,email:x,displayName:r,imapConfig:N,smtpConfig:C,discoveryResult:u,discovered:P,username:x})),o("servers")},[]),j=t.useCallback((x,r)=>{y(u=>({...u,imapConfig:x,smtpConfig:r}))},[]),S=t.useCallback((x,r)=>{y(u=>({...u,username:x,password:r}))},[]),l=t.useCallback(()=>o("sync"),[]),f=t.useCallback(x=>{d(x)},[d]);switch(h){case"welcome":return e.jsx(Pe,{onStart:i,onImportConfig:p});case"connector":return e.jsx(Te,{onContinue:g,onMicrosoft:v,onBack:E,showBack:!a});case"microsoft-email":return e.jsx(Ae,{onBack:()=>o("connector"),onConnected:f});case"address":return e.jsx(Ie,{initialEmail:n.email,initialDisplayName:n.displayName,onContinue:w,onBack:()=>o("connector")});case"servers":return e.jsx(Me,{email:n.email,imapConfig:n.imapConfig,smtpConfig:n.smtpConfig,discovered:n.discovered,onContinue:()=>o("credentials"),onBack:()=>o("address"),onChange:j});case"credentials":return e.jsx(xe,{steps:T,activeStep:A.credentials,title:`Sign in to ${n.email.split("@")[1]||"your mail server"}`,subtitle:"Many providers require an app password instead of your normal one.",email:n.email,username:n.username,password:n.password,onContinue:()=>o("test"),onBack:()=>o("servers"),onChange:S});case"test":return e.jsx(fe,{steps:T,activeStep:A.test,email:n.email,imapConfig:n.imapConfig,smtpConfig:n.smtpConfig,username:n.username,password:n.password,onSuccess:l,onBackToCredentials:()=>o("credentials"),onBackToServers:()=>o("servers")});case"sync":return e.jsx(Fe,{email:n.email,displayName:n.displayName,imapConfig:n.imapConfig,smtpConfig:n.smtpConfig,username:n.username,password:n.password,onGoToInbox:f})}}export{Be as O,te as P,Y as g};
|
|
1
|
+
import{e as ie,r as t,j as e,h as ce,i as Z,o as le,aw as de,c as q,aN as K,d as ee,f as k,L as _,B as H,aO as G,ax as ue,ay as $,n as me,I as pe}from"./index-Dx85_wSY.js";import{K as he}from"./kbd-C52Xn_j4.js";import{c as fe,d as xe,s as U,W as L,C as D,g as ye,e as X,f as ge,h as ve,b as Se,R as be,a as W,S as je}from"./credential-steps-oIENxJFq.js";import{c as we}from"./account-form-helpers-DhckT_PN.js";import{M as Ce}from"./mail-DGVfjm9r.js";import{F as ke}from"./file-json-BL8FH43L.js";const Q=ie("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]),te=[{id:"icloud",label:"iCloud",username:"full-email",imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},passwordHelp:{text:"iCloud requires an app-specific password, not your Apple ID password. Generate one under Sign-In & Security → App-Specific Passwords.",url:"https://support.apple.com/en-us/102654"}},{id:"yahoo",label:"Yahoo",username:"full-email",imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},passwordHelp:{text:"Yahoo requires an app password, not your login password. Generate one under Account Security.",url:"https://help.yahoo.com/kb/generate-manage-third-party-passwords-sln15241.html"}},{id:"aol",label:"AOL",username:"full-email",imap:{host:"imap.aol.com",port:993,security:"tls"},smtp:{host:"smtp.aol.com",port:465,security:"tls"},passwordHelp:{text:"AOL requires an app password, not your login password. Generate one under Account Security.",url:"https://login.aol.com/account/security"}},{id:"fastmail",label:"Fastmail",username:"full-email",imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},passwordHelp:{text:"Fastmail requires an app password, not your login password. Create one under Settings → Privacy & Security → App passwords.",url:"https://www.fastmail.help/hc/en-us/articles/360058752854"}}];function Y(a){return te.find(d=>d.id===a)}const Ee={"icloud.com":"icloud","me.com":"icloud","mac.com":"icloud","yahoo.com":"yahoo","yahoo.co.uk":"yahoo","ymail.com":"yahoo","aol.com":"aol","fastmail.com":"fastmail","fastmail.fm":"fastmail"};function Ne(a){const d=a.indexOf("@");if(d===-1)return"";const c=a.slice(d+1).toLowerCase();return Ee[c]??""}const T=["Connector","Address","Servers","Credentials","Test","Sync"],A={connector:0,address:1,servers:2,credentials:3,test:4,sync:5},V={host:"",port:993,security:"tls"},J={host:"",port:587,security:"starttls"};function Pe({onStart:a,onImportConfig:d}){return t.useEffect(()=>{const c=p=>{p.key==="Enter"&&a()};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[a]),e.jsx(L,{steps:T,activeStep:0,hideSteps:!0,title:"Welcome to Remit",subtitle:d?"Set up your first account, or bring the settings from another Reader.":"One inbox for all your mail, with context about every message.",footer:e.jsxs(e.Fragment,{children:[d?e.jsx(k,{variant:"secondary",icon:e.jsx(ke,{className:"size-4"}),onClick:d,children:"Import a config file"}):e.jsxs("span",{className:"text-2xs text-fg-subtle",children:[e.jsx(he,{children:"Enter"})," to continue"]}),e.jsx(k,{variant:"primary",onClick:a,children:"Add your first account"})]}),children:e.jsxs("div",{className:"flex flex-col items-start py-5",children:[e.jsx("span",{className:"flex size-14 items-center justify-center rounded-md bg-accent-soft",children:e.jsx(Ce,{className:"size-7 text-accent"})}),e.jsx("p",{className:"mt-5 max-w-sm text-sm leading-relaxed text-fg-muted",children:"Remit syncs your existing mailboxes and tells you who is really writing to you — sender history, authenticity checks, and similar messages, right next to every email."}),d&&e.jsx("p",{className:"mt-3 max-w-sm text-sm leading-relaxed text-fg-muted",children:"A config file carries your accounts, folder roles, rules, flagged senders and appearance from another Reader. It never carries passwords, so you sign in again here."})]})})}function Te({onContinue:a,onMicrosoft:d,onBack:c,showBack:p}){const[h,o]=t.useState("imap");t.useEffect(()=>{const y=i=>{i.key==="Enter"&&(h==="microsoft"?d():a()),i.key==="Escape"&&c()};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[a,d,c,h]);const n=()=>{h==="microsoft"?d():a()};return e.jsx(L,{steps:T,activeStep:A.connector,title:"How does this account connect?",subtitle:"Choose a sign-in method. IMAP works with any provider.",footer:e.jsxs(e.Fragment,{children:[p?e.jsx(k,{variant:"ghost",onClick:c,children:"Back"}):e.jsx("span",{}),e.jsx(k,{variant:"primary",onClick:n,children:h==="microsoft"?"Continue with Microsoft":"Continue with IMAP"})]}),children:e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[e.jsx(W,{name:"IMAP / SMTP",description:"Any mail provider — Fastmail, iCloud, your own server.",icon:e.jsx(je,{className:"size-5"}),selected:h==="imap",onSelect:()=>o("imap")}),e.jsx(W,{name:"Gmail",description:"Sign in with Google. No app passwords.",icon:e.jsx(Q,{className:"size-5"}),comingSoon:!0}),e.jsx(W,{name:"Outlook / Microsoft 365",description:"Sign in with Microsoft. Works with Outlook.com and work accounts.",icon:e.jsx(pe,{className:"size-5"}),selected:h==="microsoft",onSelect:()=>o("microsoft")})]})})}function Ae({onBack:a,onConnected:d}){const[c,p]=t.useState(""),[h,o]=t.useState(null),[n,y]=t.useState(!1),[i,g]=t.useState(!1),v=t.useRef(!0);t.useEffect(()=>(v.current=!0,()=>{v.current=!1}),[]);const E=t.useRef(new Set),{refetch:w}=q(ee()),j=Se(r=>{if(g(!1),r==="stalled"){y(!1),o(be);return}w().then(({data:u,isError:N})=>{if(!v.current)return;if(N||!u){o("Couldn't check whether the sign-in finished. Open Settings › Accounts to see whether the account is connected.");return}o(null);const C=u.accounts.find(P=>!E.current.has(P.accountId));C&&d(C.accountId)})}),S=Z({...me(),onSuccess:r=>{v.current&&(j(),y(!0),window.location.assign(r.authorizationUrl))},onError:r=>{g(!1),o(r instanceof Error?r.message:"Failed to start sign-in")}}),l=i||S.isPending,f=()=>{l||(o(null),g(!0),w().then(({data:r,isError:u})=>{if(v.current){if(u||!r){g(!1),o("Couldn't read this instance's accounts, so sign-in can't be tracked. Check your connection and try again.");return}E.current=new Set(r.accounts.map(N=>N.accountId)),S.mutate({body:{email:c.trim()||void 0}})}}))},x=t.useRef(f);return x.current=f,t.useEffect(()=>{const r=u=>{u.key==="Enter"&&x.current(),u.key==="Escape"&&a()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[a]),e.jsx(L,{steps:T,activeStep:A.connector,title:"Sign in with Microsoft",subtitle:"You'll be redirected to Microsoft to sign in securely.",footer:e.jsxs(e.Fragment,{children:[e.jsx(k,{variant:"ghost",onClick:a,children:"Back"}),e.jsx(k,{variant:"primary",onClick:f,disabled:l,icon:l?e.jsx(_,{className:"size-4 animate-spin"}):void 0,children:l?"Redirecting…":n?"Start over":"Sign in with Microsoft"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx(G,{htmlFor:"microsoft-email",children:"Email address (optional)"}),e.jsx($,{id:"microsoft-email",icon:e.jsx(Q,{className:"size-4"}),placeholder:"you@outlook.com",value:c,onChange:r=>p(r.target.value),type:"email",autoComplete:"email"}),e.jsx("p",{className:"mt-1.5 text-2xs text-fg-subtle",children:"Pre-fills the Microsoft sign-in form. Leave blank to choose on the Microsoft page."})]}),n&&e.jsx(H,{tone:"info",children:"Waiting for Microsoft. Finish signing in — this window carries on the moment the account is connected, wherever you finished."}),h&&e.jsx(H,{tone:"danger",children:h})]})})}function Ie({initialEmail:a,initialDisplayName:d,onContinue:c,onBack:p}){const[h,o]=t.useState(a),[n,y]=t.useState(d),[i,g]=t.useState(!1),[v,E]=t.useState(""),[w,j]=t.useState(null),S=t.useCallback(async()=>{const l=h.trim();if(!l.includes("@")||!l.includes(".")){j("Enter a valid email address.");return}j(null),g(!0),E(ge(l));try{const f=await ve(l);c(l,n.trim(),f)}finally{g(!1)}},[h,n,c]);return t.useEffect(()=>{const l=f=>{f.key==="Enter"&&!i&&S(),f.key==="Escape"&&p()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[S,i,p]),e.jsx(L,{steps:T,activeStep:A.address,title:"What's the email address?",subtitle:"We'll detect the server settings for you.",footer:e.jsxs(e.Fragment,{children:[e.jsx(k,{variant:"ghost",onClick:p,children:"Back"}),e.jsx(k,{variant:"primary",disabled:i,onClick:()=>{S()},children:"Continue"})]}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(G,{htmlFor:"onboarding-email",children:"Email address"}),e.jsx($,{id:"onboarding-email",icon:e.jsx(Q,{className:"size-4"}),placeholder:"you@example.com",value:h,onChange:l=>{o(l.target.value),j(null)},type:"email",autoComplete:"email"})]}),e.jsxs("div",{children:[e.jsx(G,{htmlFor:"onboarding-display-name",children:"Display name (optional)"}),e.jsx($,{id:"onboarding-display-name",placeholder:"Alice",value:n,onChange:l=>y(l.target.value)}),e.jsx("p",{className:"mt-1.5 text-2xs text-fg-subtle",children:"What to call this account in Remit. Leave blank to use a name derived from the address."})]}),i&&e.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-fg-muted",children:[e.jsx(_,{className:"size-3.5 animate-spin text-accent"}),v]}),w&&!i&&e.jsx("div",{className:"mt-3",children:e.jsx(H,{tone:"danger",children:w})})]})})}function Me({email:a,imapConfig:d,smtpConfig:c,discovered:p,onContinue:h,onBack:o,onChange:n}){const[y,i]=t.useState(d),[g,v]=t.useState(c),[E,w]=t.useState(()=>Ne(a)),[j,S]=t.useState(!1),[l,f]=t.useState(null),x=Y(E),r=x!==void 0&&!j,u=t.useCallback(m=>{w(m),S(!1),f(null);const s=Y(m);s&&(i({host:s.imap.host,port:s.imap.port,security:s.imap.security}),v({host:s.smtp.host,port:s.smtp.port,security:s.smtp.security}))},[]);t.useEffect(()=>{n(y,g)},[y,g,n]);const N=y.host.trim()!=="",C=t.useCallback(()=>{if(!N){f("Enter the IMAP host.");return}f(null),h()},[N,h]);t.useEffect(()=>{const m=s=>{s.key==="Enter"&&C(),s.key==="Escape"&&o()};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[C,o]);const P=a.split("@")[1]??"your domain",F=x?"Pick your provider to fill in the right settings — or choose Custom to enter them by hand.":p?"Found via autodiscovery — adjust anything that looks off.":`We couldn't detect settings for ${P} — enter them manually.`,I=r?{label:"preset",tone:"neutral"}:!x&&p?{label:"detected",tone:"positive"}:void 0,M=x?.passwordHelp.url??ye(a);return e.jsx(L,{steps:T,activeStep:A.servers,title:"Confirm server settings",subtitle:F,footer:e.jsxs(e.Fragment,{children:[e.jsx(k,{variant:"ghost",onClick:o,children:"Back"}),e.jsx(k,{variant:"primary",onClick:C,children:"Continue"})]}),children:e.jsxs("div",{className:"space-y-5",children:[l&&e.jsx(H,{tone:"danger",children:l}),e.jsxs("div",{children:[e.jsx(G,{htmlFor:"provider-select",children:"Provider"}),e.jsxs(ue,{id:"provider-select",value:E,onChange:m=>u(m.target.value),children:[e.jsx("option",{value:"",children:"Custom / other"}),te.map(m=>e.jsx("option",{value:m.id,children:m.label},m.id))]}),x&&e.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:r?e.jsxs(e.Fragment,{children:["Server settings are pre-filled for ",x.label," and locked."," ",e.jsx("button",{type:"button",className:"text-accent underline",onClick:()=>S(!0),children:"Advanced"})," ","lets you edit them by hand."]}):e.jsxs(e.Fragment,{children:["Editing ",x.label,"'s settings by hand."]})})]}),e.jsx(X,{legend:"IMAP — incoming",badge:I,readOnly:r,host:y.host,port:String(y.port),security:y.security,hostPlaceholder:"imap.example.com",portPlaceholder:"993",onHostChange:m=>{i(s=>({...s,host:m})),f(null)},onPortChange:m=>i(s=>({...s,port:Number(m)})),onSecurityChange:m=>i(s=>({...s,security:m}))}),e.jsx("p",{className:"text-2xs text-fg-subtle",children:"Sending (SMTP) is optional — leave it blank to set up a receive-only account and add sending later in Settings."}),e.jsx(X,{legend:"SMTP — outgoing (optional)",badge:I,readOnly:r,host:g.host,port:String(g.port),security:g.security,hostPlaceholder:"smtp.example.com",portPlaceholder:"587",onHostChange:m=>{v(s=>({...s,host:m})),f(null)},onPortChange:m=>v(s=>({...s,port:Number(m)})),onSecurityChange:m=>v(s=>({...s,security:m}))}),x&&e.jsxs("p",{className:"text-2xs text-fg-subtle",children:[x.passwordHelp.text," ",M&&e.jsx("a",{href:M,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"Get an app password"})]})]})})}const Le=2e4;function Fe({email:a,displayName:d,imapConfig:c,smtpConfig:p,username:h,password:o,onGoToInbox:n}){const y=ce(),[i,g]=t.useState(null),[v,E]=t.useState(null),w=t.useRef(!1),j=U(c.security),S=U(p.security),l=Z({...de(),onSuccess:b=>{g(b.accountId),y.invalidateQueries({queryKey:le()})},onError:b=>{E(b instanceof Error?b.message:"Failed to create account")}});t.useEffect(()=>{if(w.current)return;w.current=!0;const b=p.host.trim()!=="",O=we({imapHost:c.host,smtpHost:p.host,smtpPort:p.port}),R=b?O??{smtpHost:p.host,smtpPort:p.port,smtpTls:S.tls,smtpStartTls:S.startTls}:null;l.mutate({body:{email:a,displayName:d||void 0,username:h!==a?h:void 0,password:o,imapHost:c.host,imapPort:c.port,imapTls:j.tls,imapStartTls:j.startTls,smtpHost:R?.smtpHost||void 0,smtpPort:R?.smtpPort||void 0,smtpTls:R?.smtpTls??!1,smtpStartTls:R?.smtpStartTls??!1}})},[]);const{data:f,isError:x}=q({...K({path:{accountId:i??""}}),enabled:!!i,refetchInterval:b=>{const O=b.state.data?.syncPhase;return O==="complete"||O==="error"?!1:2e3}}),r=f?.syncPhase==="error",{data:u}=q({...ee(),enabled:!!i&&r}),N=u?.accounts.find(b=>b.accountId===i)?.lastError,C=f?.mailboxes.find(b=>b.fullPath==="INBOX"||b.fullPath==="Inbox"),P=f?.mailboxCountTotal??0,F=f?.mailboxCountSynced??0,I=C?.messagesTotal??0,M=C?.messagesSynced??0,m=I>0?M/I:0,s=f?.syncPhase,se=r?"failed":s==="idle"||s===void 0||s==="discovering_mailboxes"?"running":P>0?"ok":"running",z=r?"failed":!s||s==="idle"||s==="discovering_mailboxes"?"pending":s==="syncing_inbox"||s==="syncing_others"?"running":"ok",B=r?"failed":!s||s==="idle"||s==="discovering_mailboxes"||s==="syncing_inbox"?"pending":s==="syncing_others"?"running":"ok",ne=M>0||C?.phase==="complete"||s==="complete"||r,[ae,oe]=t.useState(!1);t.useEffect(()=>{if(!i)return;const b=setTimeout(()=>oe(!0),Le);return()=>clearTimeout(b)},[i]);const re=!!i&&(ne||x||ae);return v?e.jsx(L,{steps:T,activeStep:A.sync,title:"Couldn't create account",subtitle:"Something went wrong saving your account.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{}),e.jsx(k,{variant:"primary",onClick:()=>{w.current=!1,E(null),l.mutate({body:{email:a,displayName:d||void 0,username:h!==a?h:void 0,password:o,imapHost:c.host,imapPort:c.port,imapTls:j.tls,imapStartTls:j.startTls,smtpHost:p.host||void 0,smtpPort:p.port||void 0,smtpTls:S.tls,smtpStartTls:S.startTls}})},children:"Retry"})]}),children:e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:v})}):e.jsx(L,{steps:T,activeStep:A.sync,title:`Syncing ${a}`,subtitle:"Newest mail first — you can start reading right away.",footer:e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-2xs text-fg-subtle",children:"Sync continues in the background"}),re?e.jsx(k,{variant:"primary",onClick:()=>i&&n(i),children:"Go to inbox"}):e.jsx(k,{variant:"primary",disabled:!0,icon:e.jsx(_,{className:"size-3.5 animate-spin"}),children:"Getting your mail…"})]}),children:l.isPending?e.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-fg-muted",children:[e.jsx(_,{className:"size-4 animate-spin text-accent"}),"Creating your account…"]}):e.jsxs("div",{className:"space-y-3",children:[I>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline justify-between text-xs",children:[e.jsx("span",{className:"font-medium text-fg",children:"INBOX"}),e.jsxs("span",{className:"text-fg-subtle tabular-nums",children:[M.toLocaleString()," / ",I.toLocaleString()," ","messages"]})]}),e.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-sunken",children:e.jsx("div",{className:"h-full rounded-full bg-accent transition-all duration-500",style:{width:`${Math.max(2,m*100)}%`}})})]}),e.jsxs("div",{className:"divide-y divide-line",children:[e.jsx(D,{label:"Mailboxes discovered",detail:P>0?`${P} mailbox${P===1?"":"es"} found`:"Discovering…",state:se}),e.jsx(D,{label:"INBOX",detail:z==="ok"?`${M.toLocaleString()} messages synced`:z==="running"?"Syncing newest first…":"Queued",state:z}),F>1||s==="syncing_others"||s==="complete"?e.jsx(D,{label:"Other mailboxes",detail:B==="ok"?`${F-1} mailboxes synced`:B==="running"?"Syncing…":"Queued",state:B}):null]}),r&&e.jsxs("div",{className:"mt-2 space-y-2",children:[e.jsxs("p",{className:"text-xs text-danger",children:["Sync stalled. The account is still active —"," ",e.jsx("button",{type:"button",className:"underline",onClick:()=>{y.invalidateQueries({queryKey:K({path:{accountId:i??""}}).queryKey})},children:"retry"})]}),N&&e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:N})]})]})})}function Be({skipWelcome:a=!1,onComplete:d,onCancel:c,onImportConfig:p}){const[h,o]=t.useState(a?"connector":"welcome"),[n,y]=t.useState({email:"",displayName:"",imapConfig:V,smtpConfig:J,username:"",password:"",discoveryResult:null,discovered:!1,createdAccountId:null}),i=t.useCallback(()=>o("connector"),[]),g=t.useCallback(()=>o("address"),[]),v=t.useCallback(()=>o("microsoft-email"),[]),E=t.useCallback(()=>{a?c?.():o("welcome")},[a,c]),w=t.useCallback((x,r,u)=>{let N=V,C=J,P=!1;u&&(P=u.source!=="heuristic",N={host:u.imap.host,port:u.imap.port,security:u.imap.security},C={host:u.smtp.host,port:u.smtp.port,security:u.smtp.security}),y(F=>({...F,email:x,displayName:r,imapConfig:N,smtpConfig:C,discoveryResult:u,discovered:P,username:x})),o("servers")},[]),j=t.useCallback((x,r)=>{y(u=>({...u,imapConfig:x,smtpConfig:r}))},[]),S=t.useCallback((x,r)=>{y(u=>({...u,username:x,password:r}))},[]),l=t.useCallback(()=>o("sync"),[]),f=t.useCallback(x=>{d(x)},[d]);switch(h){case"welcome":return e.jsx(Pe,{onStart:i,onImportConfig:p});case"connector":return e.jsx(Te,{onContinue:g,onMicrosoft:v,onBack:E,showBack:!a});case"microsoft-email":return e.jsx(Ae,{onBack:()=>o("connector"),onConnected:f});case"address":return e.jsx(Ie,{initialEmail:n.email,initialDisplayName:n.displayName,onContinue:w,onBack:()=>o("connector")});case"servers":return e.jsx(Me,{email:n.email,imapConfig:n.imapConfig,smtpConfig:n.smtpConfig,discovered:n.discovered,onContinue:()=>o("credentials"),onBack:()=>o("address"),onChange:j});case"credentials":return e.jsx(xe,{steps:T,activeStep:A.credentials,title:`Sign in to ${n.email.split("@")[1]||"your mail server"}`,subtitle:"Many providers require an app password instead of your normal one.",email:n.email,username:n.username,password:n.password,onContinue:()=>o("test"),onBack:()=>o("servers"),onChange:S});case"test":return e.jsx(fe,{steps:T,activeStep:A.test,email:n.email,imapConfig:n.imapConfig,smtpConfig:n.smtpConfig,username:n.username,password:n.password,onSuccess:l,onBackToCredentials:()=>o("credentials"),onBackToServers:()=>o("servers")});case"sync":return e.jsx(Fe,{email:n.email,displayName:n.displayName,imapConfig:n.imapConfig,smtpConfig:n.smtpConfig,username:n.username,password:n.password,onGoToInbox:f})}}export{Be as O,te as P,Y as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,t as h,f as S,a2 as V,X as Y,c as K,em as Q,s as X,V as H,_ as J,r as C}from"./index-
|
|
1
|
+
import{j as e,t as h,f as S,a2 as V,X as Y,c as K,em as Q,s as X,V as H,_ as J,r as C}from"./index-Dx85_wSY.js";import{u as ee,t as se,C as te,d as ae,p as ne}from"./CalendarComposePane-BeSqVd3E.js";import{c as re,R as ie}from"./calendar-color-BqkJ6lSl.js";import{R as oe,A as le}from"./attendee-row-CSEOC_rC.js";import{C as ce}from"./clock-DOYtgwmf.js";import{G as U,M as de}from"./map-pin-CGDPnrFh.js";import{M as xe}from"./mail-DGVfjm9r.js";import{P as me}from"./pencil-D4xiQ_Vc.js";import{u as fe,c as ue,U as he}from"./useCalendars-76VW276g.js";import{c as pe}from"./useCalendarData-D3St5evd.js";import{u as ge,b as ve}from"./window-WjXllrlA.js";function v({icon:s,children:t}){return e.jsxs("div",{className:"flex items-start gap-2.5 py-1",children:[e.jsx("span",{className:"mt-0.5 shrink-0 text-fg-subtle",children:s}),e.jsx("div",{className:"min-w-0 flex-1 text-sm text-fg",children:t})]})}function be({event:s,calendar:t,whenText:n,onEdit:a,onDelete:o,onOpenThread:l,onClose:c,activeAttendee:x="",onActivateAttendee:b,renderAttendeeContext:k,touch:E=!1,chrome:D="header",className:r}){const R=re(t.color),d=e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-xl font-semibold text-fg",children:s.title}),e.jsxs("div",{className:"mt-3 flex flex-col border-b border-line pb-3",children:[e.jsx(v,{icon:e.jsx(ce,{className:"size-4"}),children:e.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[n,s.attendees.length>0&&e.jsx(oe,{rsvp:s.myRsvp})]})}),s.zoneCertainty==="ambiguous"?e.jsx(v,{icon:e.jsx(U,{className:"size-4 text-warning"}),children:e.jsx("span",{className:"text-warning",children:"The mail said a time but never a zone. Shown in your own; confirm before you travel for it."})}):s.timeZone!==""&&e.jsx(v,{icon:e.jsx(U,{className:"size-4"}),children:s.timeZone}),s.recurrenceRule!==""&&e.jsx(v,{icon:e.jsx(ie,{className:"size-4"}),children:e.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:[s.recurrenceRule,s.seriesException&&e.jsx("span",{className:"rounded-xs bg-warning-soft px-1.5 py-0.5 text-2xs text-warning",children:"Moved out of the series"})]})}),s.location!==""&&e.jsx(v,{icon:e.jsx(de,{className:"size-4"}),children:s.location})]}),s.threadId!==""&&l&&e.jsxs("button",{type:"button",onClick:l,className:"mt-3 flex w-full items-center gap-2.5 rounded-md border border-line bg-surface-sunken px-3 py-2 text-left outline-none hover:border-line-strong focus-visible:ring-2 focus-visible:ring-ring",children:[e.jsx(xe,{className:"size-4 shrink-0 text-accent-2"}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block text-2xs uppercase tracking-wider text-fg-subtle",children:"From this thread"}),e.jsx("span",{className:"block truncate text-sm text-fg",children:s.threadSubject})]})]}),s.attendees.length>0&&e.jsx(le,{attendees:s.attendees,activeEmail:x,onActivate:b,renderContext:k,touch:E,className:"mt-3"}),s.notes!==""&&e.jsx("p",{className:"mt-3 whitespace-pre-wrap text-sm text-fg-muted",children:s.notes})]});return D==="bare"?e.jsx("div",{className:h("flex flex-col",r),children:d}):e.jsxs("article",{className:h("flex h-full w-full flex-col bg-surface",r),children:[e.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[e.jsx("span",{className:h("size-2.5 shrink-0 rounded-full",R.solid)}),e.jsxs("span",{className:"min-w-0 flex-1 truncate text-xs text-fg-muted",children:[t.name," · ",t.accountLabel]}),a&&e.jsx(S,{variant:"ghost",size:"sm",icon:e.jsx(me,{className:"size-3.5"}),onClick:a,children:"Edit"}),o&&e.jsx(S,{variant:"ghost",size:"sm",icon:e.jsx(V,{className:"size-3.5"}),onClick:o,className:"text-danger",children:"Delete"}),c&&e.jsx("button",{type:"button","aria-label":"Close event",onClick:c,className:"flex size-7 items-center justify-center rounded-md text-fg-subtle outline-none hover:bg-surface-sunken hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",children:e.jsx(Y,{className:"size-4"})})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-row-inset py-3",children:d})]})}const je=[{scope:"this",label:"This event",note:"Leaves the rest of the series alone"},{scope:"following",label:"This and everything after",note:"Splits the series here"},{scope:"all",label:"The whole series",note:"Rewrites the rule itself"}];function Ne({title:s,ruleText:t,instanceText:n,onChoose:a,onCancel:o,touch:l,className:c}){return e.jsxs("div",{className:h("flex flex-col gap-3",c),children:[e.jsxs("div",{children:[e.jsxs("h2",{className:"text-md font-semibold text-fg",children:[s," repeats"]}),e.jsx("p",{className:"text-xs text-fg-muted",children:t}),e.jsxs("p",{className:"text-xs text-fg-subtle",children:["You clicked ",n,"."]})]}),e.jsx("p",{className:"text-sm text-fg",children:"What should the change apply to?"}),e.jsx("div",{className:"flex flex-col gap-1.5",children:je.map(x=>e.jsxs("button",{type:"button",onClick:()=>a(x.scope),className:h("flex flex-col rounded-md border border-line bg-surface px-3 py-2 text-left outline-none transition-colors hover:border-line-strong hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",l&&"min-h-11 justify-center"),children:[e.jsx("span",{className:"text-sm font-medium text-fg",children:x.label}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:x.note})]},x.scope))}),e.jsx(S,{variant:"ghost",size:l?"md":"sm",onClick:o,className:h("self-start",l&&"min-h-11"),children:"Cancel"})]})}const we=s=>s.replace(/\r?\n[ \t]/g,""),Z=s=>s.replace(/\\n/gi,`
|
|
2
2
|
`).replace(/\\,/g,",").replace(/\\;/g,";").replace(/\\\\/g,"\\");function Ce(s,t){let n=!1;for(let a=t.length;a<s.length;a+=1){const o=s[a];if(a===t.length&&o!==";"&&o!==":")return;if(o==='"'){n=!n;continue}if(!n&&o===":")return s.slice(a+1).trim()}}function A(s,t){for(const n of we(s).split(/\r?\n/)){if(!n.startsWith(t))continue;const a=Ce(n,t);if(a!==void 0)return a}return""}const ye=s=>A(s,"RRULE"),ke=s=>({location:Z(A(s,"LOCATION")),description:Z(A(s,"DESCRIPTION"))}),Ee=X(404);function De(s,t){const{data:n,isLoading:a,error:o,refetch:l}=K({...Q({path:{calendarObjectId:s},query:{calendarId:t}}),meta:Ee,enabled:s!==""&&t!==""});return{resource:n,isLoading:a,error:o,refetch:()=>{l()}}}const z=new Intl.DateTimeFormat(void 0,{weekday:"short",day:"numeric",month:"long"}),y=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1});function G(s){const t=new Date(s.start),n=new Date(s.end),a=z.format(t);return s.allDay?`${a}, all day`:z.format(n)===a?`${a}, ${y.format(t)} – ${y.format(n)}`:`${a}, ${y.format(t)} – ${z.format(n)}, ${y.format(n)}`}function Re({event:s,calendar:t,isOccurrence:n,problem:a="",onEdit:o,onDelete:l,onClose:c}){return!s||!t?e.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 bg-surface p-8 text-center",children:[e.jsx(H,{className:"size-8 text-fg-subtle","aria-hidden":"true"}),e.jsx("p",{className:"text-sm font-medium text-fg",children:"That event isn't on this week"}),e.jsx("p",{className:"max-w-xs text-sm text-fg-muted",children:"The address names an event the calendar doesn't have here."}),e.jsx("button",{type:"button",onClick:c,className:"rounded-md border border-line px-2.5 py-1 text-sm font-medium text-fg outline-none hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",children:"Back to the calendar"})]}):e.jsxs("div",{className:"flex h-full min-h-0 flex-col bg-surface",children:[n&&e.jsx("p",{className:"shrink-0 border-b border-line bg-surface-sunken px-row-inset py-1.5 text-2xs uppercase tracking-wider text-fg-subtle",children:"One occurrence of a repeating event"}),a!==""&&e.jsxs("div",{role:"alert",className:"flex shrink-0 items-start gap-2 border-b border-danger/40 bg-danger-soft px-row-inset py-2 text-sm",children:[e.jsx(J,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":"true"}),e.jsx("p",{className:"min-w-0 flex-1 break-words text-fg",children:a})]}),e.jsx(be,{event:s,calendar:t,whenText:G(s),onEdit:o,onDelete:l,onClose:c,className:"min-h-0 flex-1"})]})}const Te="This event changed somewhere else — over CalDAV, or in another tab. Nothing was saved. Close it and open it again to see the version that's stored now.";function Be({calendarObjectId:s,recurrenceId:t}){const{view:n,date:a,calendarIds:o}=ge(),{events:l}=pe({view:n,date:a,calendarIds:o}),{calendars:c,timeZoneByCalendarId:x}=fe(),{closeEvent:b}=ve(),{updateEvent:k,deleteEvent:E,isWriting:D}=ee(),r=l.find(i=>i.id===ue(s,t??"")),R=c.find(i=>i.id===r?.calendarId),{resource:d}=De(s,r?.calendarId??""),[I,p]=C.useState(void 0),[f,T]=C.useState(void 0),[u,j]=C.useState(void 0),[L,g]=C.useState(""),N=d?ke(d.icalData):void 0,F=d?ye(d.icalData):"",_=r&&!r.allDay?r.start.slice(11,16):"",w=F===""?"":se(F,_)??"Repeats",O=r!==void 0&&r.seriesId!==""&&t!==void 0&&t!=="",P=r!==void 0&&d!==void 0,$=(i,m)=>{if(i.kind==="written"){g(""),m();return}g(i.kind==="conflict"?Te:i.message)},M=i=>({calendarObjectId:s,calendarId:r?.calendarId??"",recurrenceId:t??"",scope:i,etag:d?.etag??""}),W=i=>{if(!r)return;const m=ae(r,{repeat:w,location:N?.location??"",notes:N?.description??""});p(void 0),T({before:m,scope:i}),j(m),g("")},B=i=>{p(void 0),E(M(i)).then(m=>$(m,b))},q=()=>{if(!f||!u)return;const i=ne(f.before,u,x[u.calendarId]??he);if(!i.ok){g(i.problem);return}k(M(f.scope),i.patch).then(m=>$(m,()=>{T(void 0),j(void 0)}))};return I!==void 0&&r?e.jsx("div",{className:"flex h-full flex-col justify-center bg-surface px-row-inset",children:e.jsx(Ne,{className:"mx-auto w-full max-w-md",title:r.title,ruleText:w===""?"It repeats":w,instanceText:G(r),onChoose:I==="edit"?W:B,onCancel:()=>p(void 0)})}):f&&u?e.jsx(te,{title:"Edit event",subtitle:f.scope==="this"?"This occurrence only":u.date,calendars:c,draft:u,onChange:j,problem:L,saveLabel:"Save",isSaving:D,repeatEditable:f.scope===void 0||f.scope==="all",calendarEditable:!1,onSave:q,onCancel:()=>{T(void 0),j(void 0),g("")}}):e.jsx(Re,{event:r&&{...r,location:N?.location??"",notes:N?.description??"",recurrenceRule:w},calendar:R,isOccurrence:t!==void 0,problem:L,onEdit:P?()=>O?p("edit"):W(void 0):void 0,onDelete:P?()=>O?p("delete"):B(void 0):void 0,onClose:b})}export{Be as O};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{aq as g,_ as w,L as C,j as s,t as b,d0 as F,a2 as _,$ as S,a8 as q,u as H,ce as U,r as x,cg as K,c as W,ac as G,C as J,T as k,dP as R,d4 as V,h as X,as as Y,cL as Z,i as v,au as y,cA as ee,cB as se}from"./index-D855R0Fw.js";import{u as te,p as ne,R as j,c as ae}from"./useSearchTokenContext-D1NKXhM6.js";import{C as I}from"./circle-check-big-PApHOS4Q.js";import{C as T}from"./clock-C5E9t_wY.js";import{R as oe}from"./row-actions-9TTs03mH.js";import{R as re}from"./rotate-ccw-CShnXVol.js";import{N as A}from"./NavMenuButton-xOndgihg.js";import{b as p,t as ie}from"./format-Cc3aS3ot.js";import{i as le,s as D}from"./outbox-status-BlKn6P0x.js";import{n as ce}from"./search-query-Cr_ZXBCp.js";import{f as de}from"./useMessageBodyContent-I6J6WaYN.js";const ue={queued:{icon:T,label:"Queued",className:"text-warning"},sending:{icon:C,label:"Sending…",className:"text-accent-2",spin:!0},sent:{icon:I,label:"Sent",className:"text-positive"},unfiled:{icon:g,label:"Sent, not filed",className:"text-warning"},failed:{icon:w,label:"Failed",className:"text-danger"},blocked:{icon:g,label:"Blocked",className:"text-warning"}};function O({status:e,iconOnly:n,className:a}){const t=ue[e],o=t.icon;return s.jsxs("span",{className:b("inline-flex items-center gap-1.5 text-xs font-medium",t.className,a),children:[s.jsx(o,{className:b("size-4",t.spin&&"animate-spin")}),!n&&t.label]})}const xe=(e,n)=>n?"bg-accent-2-soft":e==="failed"?"bg-danger-soft":e==="blocked"||e==="unfiled"?"bg-warning/10":"";function fe({recipients:e,subject:n,time:a,status:t,error:o,selected:l,onSelect:c,onRetry:r,retrying:d,onEdit:i,onDelete:f,deleting:u}){const m=t==="failed"||t==="blocked"||t==="unfiled";return s.jsxs("div",{className:b("flex items-start gap-3 border-b border-line px-4 py-3 transition-colors hover:bg-surface-raised",xe(t,l)),children:[s.jsxs("button",{type:"button",...F,onClick:c,className:"flex flex-1 min-w-0 items-start gap-3 text-left",children:[s.jsx("div",{className:"mt-0.5 shrink-0",children:s.jsx(O,{status:t,iconOnly:!0})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"truncate text-sm font-medium",children:e}),s.jsx("span",{className:"shrink-0 text-xs text-fg-muted",children:a})]}),s.jsx("div",{className:"truncate text-sm",children:n||"No subject"}),s.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[s.jsx(O,{status:t}),o&&s.jsxs("span",{className:"truncate text-xs text-fg-muted",children:["— ",o]})]})]})]}),m&&s.jsx("div",{className:"shrink-0",children:s.jsx(oe,{actions:[...t==="failed"&&r?[{label:"Retry sending",iconOnly:!0,icon:s.jsx(re,{className:"size-3.5"}),busy:d,onClick:r}]:[],...t==="unfiled"?[]:[{label:"Edit as draft",iconOnly:!0,icon:s.jsx(S,{className:"size-3.5"}),onClick:i}]],destructive:{label:"Delete message",iconOnly:!0,icon:s.jsx(_,{className:"size-3.5"}),busy:u,confirm:{prompt:"Delete this message?",confirmLabel:"Delete"},onClick:f}})})]})}function Ee(){return q({from:"/mail/outbox/draft/$outboxMessageId",shouldThrow:!1})?.outboxMessageId}function me(){const e=H(),n=U();return x.useCallback(a=>{e({to:"/mail/outbox/draft/$outboxMessageId",params:{outboxMessageId:a},search:t=>t,hash:n})},[e,n])}function he(){return K()}function be(e,n){const a=n.trim().toLowerCase();if(a.length===0)return!0;const t=[e.subject,e.fromAddress,e.fromName,...e.toAddresses??[],...e.ccAddresses??[]].filter(o=>typeof o=="string").join(" ").toLowerCase();return a.split(/\s+/).every(o=>o.length===0||t.includes(o))}function ge(e){return e.tokens.length>0&&e.freeText.trim().length===0}const L={queued:{icon:T,label:"Queued",className:"text-warning"},sending:{icon:C,label:"Sending…",className:"text-accent-2"},sent:{icon:I,label:"Sent",className:"text-positive"},unfiled:{icon:g,label:"Sent, not filed",className:"text-warning"},failed:{icon:w,label:"Failed",className:"text-danger"},blocked:{icon:g,label:"Blocked",className:"text-warning"}},pe=e=>ie(e).toDateString()===new Date().toDateString()?p(e,{hour:"numeric",minute:"2-digit"}):p(e,{month:"short",day:"numeric"}),M=e=>p(e,{dateStyle:"medium",timeStyle:"short"}),je=e=>{const n=e.toAddresses??[];return n.length===0?"No recipients":n.length===1?n[0]:`${n[0]} +${n.length-1}`},E=(e,n)=>n?"The outbox cannot filter on those terms":e?"No matching outbox messages":"No outbox messages",P=x.createContext(null);function N(){const e=x.useContext(P);if(!e)throw new Error("OutboxPane.* must be used inside <OutboxPane>");return e}function Ne({outboxMessageId:e,children:n}){const a=me(),t=he(),{data:o,isLoading:l}=W(G()),{searchQuery:c}=J(),r=te(),d=ce(c),i=ne(d,r),f=d.length>0,u=ge(i),m=x.useMemo(()=>u?[]:(o?.items??[]).filter(h=>le(h.status)).filter(h=>be(h,i.freeText)),[o,i.freeText,u]),z=x.useMemo(()=>m.find(h=>h.outboxMessageId===e),[m,e]),$={messages:m,hasQuery:f,unsupportedQuery:u,isLoading:l,selectedMessageId:e,selectedMessage:z,onOpenMessage:a,onCloseMessage:t};return s.jsx(P.Provider,{value:$,children:n})}function Q({message:e,isSelected:n,onSelect:a}){const t=X(),o=de(),{pushError:l}=Y(),c=x.useCallback(()=>{t.invalidateQueries({queryKey:Z()})},[t]),r=v({...ee(),onSuccess:c,onError:u=>{l(y("Couldn't resend message","The message wasn't sent.",u))}}),d=v({...se(),onSuccess:c,onError:u=>{l(y("Couldn't delete message","The message wasn't deleted.",u))}}),i=e.status;if(!L[i])return null;const f=D(e.status);return s.jsx(fe,{recipients:je(e),subject:e.subject||"",time:pe(e.sentAt??e.updatedAt),status:i,error:f?e.lastError??void 0:void 0,selected:n,onSelect:a,onRetry:i==="failed"?()=>r.mutate({path:{outboxMessageId:e.outboxMessageId}}):void 0,retrying:r.isPending,onEdit:()=>o(e.outboxMessageId),onDelete:()=>d.mutate({path:{outboxMessageId:e.outboxMessageId}}),deleting:d.isPending})}function B({message:e,onBack:n}){const a=e.status,t=L[a],o=t?.icon??S,l=e.sentAt?M(e.sentAt):M(e.updatedAt);return s.jsxs("div",{className:"h-full overflow-y-auto bg-canvas",children:[s.jsxs("div",{className:"border-b border-line p-4",children:[n&&s.jsxs("button",{type:"button",onClick:n,className:"mb-3 inline-flex items-center gap-1 text-sm text-fg-muted hover:text-fg",children:[s.jsx(V,{className:"size-4"}),s.jsx("span",{children:"Back"})]}),s.jsx("h1",{className:"text-xl font-semibold mb-3",children:e.subject||"(No subject)"}),s.jsxs("div",{className:"space-y-1 text-sm",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"From:"}),s.jsx("span",{className:"text-fg",children:e.fromName?`${e.fromName} <${e.fromAddress}>`:e.fromAddress})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"To:"}),s.jsx("span",{className:"text-fg",children:(e.toAddresses??[]).join(", ")})]}),e.ccAddresses&&e.ccAddresses.length>0&&s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"Cc:"}),s.jsx("span",{className:"text-fg",children:e.ccAddresses.join(", ")})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"Date:"}),s.jsx("span",{className:"text-fg",children:l})]}),t&&s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(o,{className:b("size-4",t.className,a==="sending"&&"animate-spin")}),s.jsx("span",{className:b("text-xs font-medium",t.className),children:t.label}),D(e.status)&&e.lastError&&s.jsxs("span",{className:"text-xs text-fg-muted",children:["— ",e.lastError]})]})]})]}),s.jsx("div",{className:"p-4",children:s.jsx(ae,{html:e.htmlBody,text:e.textBody})})]})}function ve(){const{messages:e,hasQuery:n,unsupportedQuery:a,isLoading:t,selectedMessageId:o,onOpenMessage:l}=N(),c=x.useRef(null);return k({containerRef:c,itemSelector:R}),t?s.jsx("div",{className:"flex h-full items-center justify-center bg-canvas",children:s.jsx("span",{className:"text-fg-muted",children:"Loading..."})}):e.length===0?s.jsx("div",{className:"flex h-full bg-surface",children:s.jsx(j,{message:E(n,a),showHints:!1})}):s.jsxs("div",{className:"h-full flex flex-col bg-canvas",children:[s.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[s.jsx(A,{}),s.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:"Outbox"}),s.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle",children:[e.length," ",e.length===1?"message":"messages"]})]}),s.jsx("div",{ref:c,className:"flex-1 overflow-y-auto",children:e.map(r=>s.jsx(Q,{message:r,isSelected:o===r.outboxMessageId,onSelect:()=>l(r.outboxMessageId)},r.outboxMessageId))})]})}function ye(){const{selectedMessage:e}=N();return s.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[s.jsx("header",{className:"flex h-pane-header shrink-0 items-center border-b border-line px-3"}),s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e?s.jsx(B,{message:e}):s.jsx(j,{message:"Select a message to read",showHints:!1})})]})}function Oe(){const{messages:e,hasQuery:n,unsupportedQuery:a,isLoading:t,selectedMessageId:o,selectedMessage:l,onOpenMessage:c,onCloseMessage:r}=N(),d=x.useRef(null);return k({containerRef:d,itemSelector:R}),t?s.jsx("div",{className:"flex h-full items-center justify-center bg-canvas",children:s.jsx("span",{className:"text-fg-muted",children:"Loading..."})}):l?s.jsx(B,{message:l,onBack:r}):e.length===0?s.jsx("div",{className:"flex h-full bg-surface",children:s.jsx(j,{message:E(n,a),showHints:!1})}):s.jsxs("div",{className:"h-full flex flex-col bg-canvas",children:[s.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[s.jsx(A,{}),s.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:"Outbox"}),s.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle",children:[e.length," ",e.length===1?"message":"messages"]})]}),s.jsx("div",{ref:d,className:"flex-1 overflow-y-auto",children:e.map(i=>s.jsx(Q,{message:i,isSelected:o===i.outboxMessageId,onSelect:()=>c(i.outboxMessageId)},i.outboxMessageId))})]})}const Pe=Object.assign(Ne,{List:ve,Reading:ye,Phone:Oe});export{Pe as O,Ee as u};
|
|
1
|
+
import{aq as g,_ as w,L as C,j as s,t as b,d0 as F,a2 as _,$ as S,a8 as q,u as H,ce as U,r as x,cg as K,c as W,ac as G,C as J,T as k,dP as R,d4 as V,h as X,as as Y,cL as Z,i as v,au as y,cA as ee,cB as se}from"./index-Dx85_wSY.js";import{u as te,p as ne,R as j,c as ae}from"./useSearchTokenContext-DshmuDOq.js";import{C as I}from"./circle-check-big-DdkGJGpC.js";import{C as T}from"./clock-DOYtgwmf.js";import{R as oe}from"./row-actions-B2DOiD0i.js";import{R as re}from"./rotate-ccw-C7qpdlSG.js";import{N as A}from"./NavMenuButton-BpJdTOUd.js";import{b as p,t as ie}from"./format-C9mypfPa.js";import{i as le,s as D}from"./outbox-status-BlKn6P0x.js";import{n as ce}from"./search-query-Cr_ZXBCp.js";import{f as de}from"./useMessageBodyContent-CeF9pGv7.js";const ue={queued:{icon:T,label:"Queued",className:"text-warning"},sending:{icon:C,label:"Sending…",className:"text-accent-2",spin:!0},sent:{icon:I,label:"Sent",className:"text-positive"},unfiled:{icon:g,label:"Sent, not filed",className:"text-warning"},failed:{icon:w,label:"Failed",className:"text-danger"},blocked:{icon:g,label:"Blocked",className:"text-warning"}};function O({status:e,iconOnly:n,className:a}){const t=ue[e],o=t.icon;return s.jsxs("span",{className:b("inline-flex items-center gap-1.5 text-xs font-medium",t.className,a),children:[s.jsx(o,{className:b("size-4",t.spin&&"animate-spin")}),!n&&t.label]})}const xe=(e,n)=>n?"bg-accent-2-soft":e==="failed"?"bg-danger-soft":e==="blocked"||e==="unfiled"?"bg-warning/10":"";function fe({recipients:e,subject:n,time:a,status:t,error:o,selected:l,onSelect:c,onRetry:r,retrying:d,onEdit:i,onDelete:f,deleting:u}){const m=t==="failed"||t==="blocked"||t==="unfiled";return s.jsxs("div",{className:b("flex items-start gap-3 border-b border-line px-4 py-3 transition-colors hover:bg-surface-raised",xe(t,l)),children:[s.jsxs("button",{type:"button",...F,onClick:c,className:"flex flex-1 min-w-0 items-start gap-3 text-left",children:[s.jsx("div",{className:"mt-0.5 shrink-0",children:s.jsx(O,{status:t,iconOnly:!0})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"truncate text-sm font-medium",children:e}),s.jsx("span",{className:"shrink-0 text-xs text-fg-muted",children:a})]}),s.jsx("div",{className:"truncate text-sm",children:n||"No subject"}),s.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[s.jsx(O,{status:t}),o&&s.jsxs("span",{className:"truncate text-xs text-fg-muted",children:["— ",o]})]})]})]}),m&&s.jsx("div",{className:"shrink-0",children:s.jsx(oe,{actions:[...t==="failed"&&r?[{label:"Retry sending",iconOnly:!0,icon:s.jsx(re,{className:"size-3.5"}),busy:d,onClick:r}]:[],...t==="unfiled"?[]:[{label:"Edit as draft",iconOnly:!0,icon:s.jsx(S,{className:"size-3.5"}),onClick:i}]],destructive:{label:"Delete message",iconOnly:!0,icon:s.jsx(_,{className:"size-3.5"}),busy:u,confirm:{prompt:"Delete this message?",confirmLabel:"Delete"},onClick:f}})})]})}function Ee(){return q({from:"/mail/outbox/draft/$outboxMessageId",shouldThrow:!1})?.outboxMessageId}function me(){const e=H(),n=U();return x.useCallback(a=>{e({to:"/mail/outbox/draft/$outboxMessageId",params:{outboxMessageId:a},search:t=>t,hash:n})},[e,n])}function he(){return K()}function be(e,n){const a=n.trim().toLowerCase();if(a.length===0)return!0;const t=[e.subject,e.fromAddress,e.fromName,...e.toAddresses??[],...e.ccAddresses??[]].filter(o=>typeof o=="string").join(" ").toLowerCase();return a.split(/\s+/).every(o=>o.length===0||t.includes(o))}function ge(e){return e.tokens.length>0&&e.freeText.trim().length===0}const L={queued:{icon:T,label:"Queued",className:"text-warning"},sending:{icon:C,label:"Sending…",className:"text-accent-2"},sent:{icon:I,label:"Sent",className:"text-positive"},unfiled:{icon:g,label:"Sent, not filed",className:"text-warning"},failed:{icon:w,label:"Failed",className:"text-danger"},blocked:{icon:g,label:"Blocked",className:"text-warning"}},pe=e=>ie(e).toDateString()===new Date().toDateString()?p(e,{hour:"numeric",minute:"2-digit"}):p(e,{month:"short",day:"numeric"}),M=e=>p(e,{dateStyle:"medium",timeStyle:"short"}),je=e=>{const n=e.toAddresses??[];return n.length===0?"No recipients":n.length===1?n[0]:`${n[0]} +${n.length-1}`},E=(e,n)=>n?"The outbox cannot filter on those terms":e?"No matching outbox messages":"No outbox messages",P=x.createContext(null);function N(){const e=x.useContext(P);if(!e)throw new Error("OutboxPane.* must be used inside <OutboxPane>");return e}function Ne({outboxMessageId:e,children:n}){const a=me(),t=he(),{data:o,isLoading:l}=W(G()),{searchQuery:c}=J(),r=te(),d=ce(c),i=ne(d,r),f=d.length>0,u=ge(i),m=x.useMemo(()=>u?[]:(o?.items??[]).filter(h=>le(h.status)).filter(h=>be(h,i.freeText)),[o,i.freeText,u]),z=x.useMemo(()=>m.find(h=>h.outboxMessageId===e),[m,e]),$={messages:m,hasQuery:f,unsupportedQuery:u,isLoading:l,selectedMessageId:e,selectedMessage:z,onOpenMessage:a,onCloseMessage:t};return s.jsx(P.Provider,{value:$,children:n})}function Q({message:e,isSelected:n,onSelect:a}){const t=X(),o=de(),{pushError:l}=Y(),c=x.useCallback(()=>{t.invalidateQueries({queryKey:Z()})},[t]),r=v({...ee(),onSuccess:c,onError:u=>{l(y("Couldn't resend message","The message wasn't sent.",u))}}),d=v({...se(),onSuccess:c,onError:u=>{l(y("Couldn't delete message","The message wasn't deleted.",u))}}),i=e.status;if(!L[i])return null;const f=D(e.status);return s.jsx(fe,{recipients:je(e),subject:e.subject||"",time:pe(e.sentAt??e.updatedAt),status:i,error:f?e.lastError??void 0:void 0,selected:n,onSelect:a,onRetry:i==="failed"?()=>r.mutate({path:{outboxMessageId:e.outboxMessageId}}):void 0,retrying:r.isPending,onEdit:()=>o(e.outboxMessageId),onDelete:()=>d.mutate({path:{outboxMessageId:e.outboxMessageId}}),deleting:d.isPending})}function B({message:e,onBack:n}){const a=e.status,t=L[a],o=t?.icon??S,l=e.sentAt?M(e.sentAt):M(e.updatedAt);return s.jsxs("div",{className:"h-full overflow-y-auto bg-canvas",children:[s.jsxs("div",{className:"border-b border-line p-4",children:[n&&s.jsxs("button",{type:"button",onClick:n,className:"mb-3 inline-flex items-center gap-1 text-sm text-fg-muted hover:text-fg",children:[s.jsx(V,{className:"size-4"}),s.jsx("span",{children:"Back"})]}),s.jsx("h1",{className:"text-xl font-semibold mb-3",children:e.subject||"(No subject)"}),s.jsxs("div",{className:"space-y-1 text-sm",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"From:"}),s.jsx("span",{className:"text-fg",children:e.fromName?`${e.fromName} <${e.fromAddress}>`:e.fromAddress})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"To:"}),s.jsx("span",{className:"text-fg",children:(e.toAddresses??[]).join(", ")})]}),e.ccAddresses&&e.ccAddresses.length>0&&s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"Cc:"}),s.jsx("span",{className:"text-fg",children:e.ccAddresses.join(", ")})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-fg-muted shrink-0 w-12",children:"Date:"}),s.jsx("span",{className:"text-fg",children:l})]}),t&&s.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[s.jsx(o,{className:b("size-4",t.className,a==="sending"&&"animate-spin")}),s.jsx("span",{className:b("text-xs font-medium",t.className),children:t.label}),D(e.status)&&e.lastError&&s.jsxs("span",{className:"text-xs text-fg-muted",children:["— ",e.lastError]})]})]})]}),s.jsx("div",{className:"p-4",children:s.jsx(ae,{html:e.htmlBody,text:e.textBody})})]})}function ve(){const{messages:e,hasQuery:n,unsupportedQuery:a,isLoading:t,selectedMessageId:o,onOpenMessage:l}=N(),c=x.useRef(null);return k({containerRef:c,itemSelector:R}),t?s.jsx("div",{className:"flex h-full items-center justify-center bg-canvas",children:s.jsx("span",{className:"text-fg-muted",children:"Loading..."})}):e.length===0?s.jsx("div",{className:"flex h-full bg-surface",children:s.jsx(j,{message:E(n,a),showHints:!1})}):s.jsxs("div",{className:"h-full flex flex-col bg-canvas",children:[s.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[s.jsx(A,{}),s.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:"Outbox"}),s.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle",children:[e.length," ",e.length===1?"message":"messages"]})]}),s.jsx("div",{ref:c,className:"flex-1 overflow-y-auto",children:e.map(r=>s.jsx(Q,{message:r,isSelected:o===r.outboxMessageId,onSelect:()=>l(r.outboxMessageId)},r.outboxMessageId))})]})}function ye(){const{selectedMessage:e}=N();return s.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[s.jsx("header",{className:"flex h-pane-header shrink-0 items-center border-b border-line px-3"}),s.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e?s.jsx(B,{message:e}):s.jsx(j,{message:"Select a message to read",showHints:!1})})]})}function Oe(){const{messages:e,hasQuery:n,unsupportedQuery:a,isLoading:t,selectedMessageId:o,selectedMessage:l,onOpenMessage:c,onCloseMessage:r}=N(),d=x.useRef(null);return k({containerRef:d,itemSelector:R}),t?s.jsx("div",{className:"flex h-full items-center justify-center bg-canvas",children:s.jsx("span",{className:"text-fg-muted",children:"Loading..."})}):l?s.jsx(B,{message:l,onBack:r}):e.length===0?s.jsx("div",{className:"flex h-full bg-surface",children:s.jsx(j,{message:E(n,a),showHints:!1})}):s.jsxs("div",{className:"h-full flex flex-col bg-canvas",children:[s.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[s.jsx(A,{}),s.jsx("h1",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:"Outbox"}),s.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle",children:[e.length," ",e.length===1?"message":"messages"]})]}),s.jsx("div",{ref:d,className:"flex-1 overflow-y-auto",children:e.map(i=>s.jsx(Q,{message:i,isSelected:o===i.outboxMessageId,onSelect:()=>c(i.outboxMessageId)},i.outboxMessageId))})]})}const Pe=Object.assign(Ne,{List:ve,Reading:ye,Phone:Oe});export{Pe as O,Ee as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as o}from"./index-Dx85_wSY.js";const n=o;export{n as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ai as m,j as o,O as p}from"./index-Dx85_wSY.js";import{a}from"./MailShell-DliaPrFT.js";import{M as r}from"./MailboxPane-DPGGYCIj.js";import{d as e}from"./search-token-index-BmcMDs9b.js";import{u as s}from"./search-mirror-C0Pt1h-G.js";import"./FullCompose-vuKBlugc.js";import"./ErrorState-DksyoH5X.js";import"./index-C1CX0WpK.js";import"./useMessageBodyContent-CeF9pGv7.js";import"./useSignature-jcBnHxI3.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DQNqGEPg.js";import"./sections-DvdIZ0pl.js";import"./format-C9mypfPa.js";import"./confirm-dialog-CQKNczRE.js";import"./useSearchTokenContext-DshmuDOq.js";import"./kbd-C52Xn_j4.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-C9hbfjgD.js";import"./circle-check-big-DdkGJGpC.js";import"./refresh-cw-COcsl_Af.js";import"./useQueries-CmJQ3O9W.js";import"./MailListHeader-k_H6Nj4H.js";import"./attachment-file-C21uro77.js";import"./mail-DGVfjm9r.js";import"./avatar-DyyOeiDP.js";import"./EmptyState-si-DpWBi.js";import"./download-DCVWa6kB.js";import"./calendar-event-chip-CEV8NQqe.js";import"./calendar-color-BqkJ6lSl.js";import"./map-pin-CGDPnrFh.js";import"./attendee-row-CSEOC_rC.js";import"./clock-DOYtgwmf.js";import"./useLayoutTier-BEYBSkpq.js";import"./shield-check-BOYjSFE9.js";import"./useFilters-B-7bJBEK.js";import"./menu-mBksCdgx.js";import"./MailViewChrome-DFEXKgDU.js";import"./NavMenuButton-BpJdTOUd.js";import"./useLabels-DzwmxI3k.js";import"./useSemanticSearch-DZwukc7P.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-BH7YA8BV.js";import"./circle-help-E11sse6u.js";import"./circle-check-DVyiwjVR.js";function oo(){const{mailboxId:t}=m.useParams(),i=e();return s({to:"/mail/$mailboxId",params:{mailboxId:t}}),o.jsx(r,{mailboxId:t,thread:i,children:o.jsx(a,{phone:o.jsx(r.Phone,{}),list:o.jsx(r.List,{}),reading:o.jsx(p,{}),intelligence:o.jsx(r.Intelligence,{}),hasThread:!!i})})}export{oo as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-Dx85_wSY.js";import{M as r}from"./MailboxPane-DPGGYCIj.js";import"./useSearchTokenContext-DshmuDOq.js";import"./kbd-C52Xn_j4.js";import"./useMessageBodyContent-CeF9pGv7.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl-C9hbfjgD.js";import"./circle-check-big-DdkGJGpC.js";import"./refresh-cw-COcsl_Af.js";import"./useQueries-CmJQ3O9W.js";import"./search-token-index-BmcMDs9b.js";import"./useLayoutTier-BEYBSkpq.js";import"./MailListHeader-k_H6Nj4H.js";import"./attachment-file-C21uro77.js";import"./mail-DGVfjm9r.js";import"./avatar-DyyOeiDP.js";import"./index-C1CX0WpK.js";import"./useSignature-jcBnHxI3.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DQNqGEPg.js";import"./sections-DvdIZ0pl.js";import"./format-C9mypfPa.js";import"./EmptyState-si-DpWBi.js";import"./ErrorState-DksyoH5X.js";import"./download-DCVWa6kB.js";import"./calendar-event-chip-CEV8NQqe.js";import"./calendar-color-BqkJ6lSl.js";import"./map-pin-CGDPnrFh.js";import"./attendee-row-CSEOC_rC.js";import"./clock-DOYtgwmf.js";import"./shield-check-BOYjSFE9.js";import"./useFilters-B-7bJBEK.js";import"./confirm-dialog-CQKNczRE.js";import"./menu-mBksCdgx.js";import"./MailViewChrome-DFEXKgDU.js";import"./NavMenuButton-BpJdTOUd.js";import"./useLabels-DzwmxI3k.js";import"./useSemanticSearch-DZwukc7P.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-BH7YA8BV.js";import"./circle-help-E11sse6u.js";import"./circle-check-DVyiwjVR.js";function S(){return o.jsx(r.Reading,{})}export{S as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-Dx85_wSY.js";import{F as r}from"./FlaggedPane-BMj3QRRB.js";import"./useSearchTokenContext-DshmuDOq.js";import"./kbd-C52Xn_j4.js";import"./useMessageBodyContent-CeF9pGv7.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-k_H6Nj4H.js";import"./search-token-index-BmcMDs9b.js";import"./useLayoutTier-BEYBSkpq.js";import"./useQueries-CmJQ3O9W.js";import"./attachment-file-C21uro77.js";import"./mail-DGVfjm9r.js";import"./avatar-DyyOeiDP.js";import"./index-C1CX0WpK.js";import"./useSignature-jcBnHxI3.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DQNqGEPg.js";import"./sections-DvdIZ0pl.js";import"./format-C9mypfPa.js";import"./EmptyState-si-DpWBi.js";import"./ErrorState-DksyoH5X.js";import"./download-DCVWa6kB.js";import"./calendar-event-chip-CEV8NQqe.js";import"./calendar-color-BqkJ6lSl.js";import"./map-pin-CGDPnrFh.js";import"./attendee-row-CSEOC_rC.js";import"./clock-DOYtgwmf.js";import"./shield-check-BOYjSFE9.js";import"./useFilters-B-7bJBEK.js";import"./confirm-dialog-CQKNczRE.js";import"./menu-mBksCdgx.js";import"./MailViewChrome-DFEXKgDU.js";import"./refresh-cw-COcsl_Af.js";import"./wizard-selection-B1bng5Jq.js";function H(){return o.jsx(r.Reading,{})}export{H as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./index-Dx85_wSY.js";import{B as o}from"./BriefPane-ChrsOiI5.js";import"./useSearchTokenContext-DshmuDOq.js";import"./kbd-C52Xn_j4.js";import"./useMessageBodyContent-CeF9pGv7.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-k_H6Nj4H.js";import"./search-token-index-BmcMDs9b.js";import"./useLayoutTier-BEYBSkpq.js";import"./useQueries-CmJQ3O9W.js";import"./attachment-file-C21uro77.js";import"./mail-DGVfjm9r.js";import"./avatar-DyyOeiDP.js";import"./index-C1CX0WpK.js";import"./useSignature-jcBnHxI3.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DQNqGEPg.js";import"./sections-DvdIZ0pl.js";import"./format-C9mypfPa.js";import"./EmptyState-si-DpWBi.js";import"./ErrorState-DksyoH5X.js";import"./download-DCVWa6kB.js";import"./calendar-event-chip-CEV8NQqe.js";import"./calendar-color-BqkJ6lSl.js";import"./map-pin-CGDPnrFh.js";import"./attendee-row-CSEOC_rC.js";import"./clock-DOYtgwmf.js";import"./shield-check-BOYjSFE9.js";import"./useFilters-B-7bJBEK.js";import"./confirm-dialog-CQKNczRE.js";import"./menu-mBksCdgx.js";import"./useRefreshControl-C9hbfjgD.js";import"./circle-check-big-DdkGJGpC.js";import"./refresh-cw-COcsl_Af.js";import"./useLabels-DzwmxI3k.js";import"./useSemanticSearch-DZwukc7P.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-B1bng5Jq.js";function L(){return r.jsx(o.Reading,{})}export{L as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as o}from"./index-Dx85_wSY.js";import{O as t}from"./OutboxPane-BFi1SiwR.js";import"./useSearchTokenContext-DshmuDOq.js";import"./kbd-C52Xn_j4.js";import"./useMessageBodyContent-CeF9pGv7.js";import"./search-scope-B5-OK3Cq.js";import"./circle-check-big-DdkGJGpC.js";import"./clock-DOYtgwmf.js";import"./row-actions-B2DOiD0i.js";import"./rotate-ccw-C7qpdlSG.js";import"./NavMenuButton-BpJdTOUd.js";import"./menu-mBksCdgx.js";import"./format-C9mypfPa.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function P(){return o.jsx(t.Reading,{})}export{P as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{en as o,j as m}from"./index-Dx85_wSY.js";import{O as e}from"./OpenCalendarEvent-LsXgRmZT.js";import"./CalendarComposePane-BeSqVd3E.js";import"./window-WjXllrlA.js";import"./ErrorState-DksyoH5X.js";import"./calendar-color-BqkJ6lSl.js";import"./attendee-row-CSEOC_rC.js";import"./avatar-DyyOeiDP.js";import"./clock-DOYtgwmf.js";import"./map-pin-CGDPnrFh.js";import"./mail-DGVfjm9r.js";import"./pencil-D4xiQ_Vc.js";import"./useCalendars-76VW276g.js";import"./useCalendarData-D3St5evd.js";import"./useQueries-CmJQ3O9W.js";function E(){const{calendarObjectId:r,recurrenceId:t}=o.useParams();return m.jsx(e,{calendarObjectId:r,recurrenceId:t})}export{E as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as o}from"./index-Dx85_wSY.js";const n=o;export{n as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as o}from"./index-Dx85_wSY.js";const n=o;export{n as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as o}from"./index-Dx85_wSY.js";const n=o;export{n as component};
|