@remit/web-client-dist 0.0.655 → 0.0.657

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.
Files changed (158) hide show
  1. package/assets/{BriefPane-Bs89y0lU.js → BriefPane-DSaOlf0F.js} +1 -1
  2. package/assets/{CalendarComposePane-RIGLHEKc.js → CalendarComposePane-BU_sayZB.js} +1 -1
  3. package/assets/{CalendarComposeSeed-O0lmR5xH.js → CalendarComposeSeed-B3HKxMFT.js} +1 -1
  4. package/assets/{CalendarShell-refNUS-9.js → CalendarShell-D9HK76un.js} +1 -1
  5. package/assets/{EmptyState-KNDNyfvT.js → EmptyState-1soLLrUm.js} +1 -1
  6. package/assets/{ErrorState-DLtcLFLq.js → ErrorState-DPzwHis8.js} +1 -1
  7. package/assets/{FlaggedPane-DAMAdoUk.js → FlaggedPane-C6qW3NPH.js} +1 -1
  8. package/assets/{FullCompose-D5RGCLg7.js → FullCompose-rxgtwgLT.js} +1 -1
  9. package/assets/MailListHeader-BFFGRKyg.js +1 -0
  10. package/assets/{MailNav-De6DYmQz.js → MailNav-DJlI7RmG.js} +1 -1
  11. package/assets/{MailShell-CpfkjAiH.js → MailShell-DWiQS--r.js} +1 -1
  12. package/assets/{MailViewChrome-DCS7j8vw.js → MailViewChrome-HO-DgTY5.js} +1 -1
  13. package/assets/{MailboxPane-j-fLB3Ye.js → MailboxPane-hAP08rcM.js} +1 -1
  14. package/assets/{NavMenuButton-BIiSSMjn.js → NavMenuButton-DLvNMRhx.js} +1 -1
  15. package/assets/{OnboardingWizard-IYzlV8gT.js → OnboardingWizard-BwiBwlF7.js} +1 -1
  16. package/assets/{OpenCalendarEvent-xuyLG0yl.js → OpenCalendarEvent-BnGbsK2W.js} +1 -1
  17. package/assets/{OutboxPane-CJGasuMb.js → OutboxPane-BoLQds66.js} +1 -1
  18. package/assets/_calendarObjectId-Dk6ypYk-.js +1 -0
  19. package/assets/_mailboxId-BI2fCYSk.js +1 -0
  20. package/assets/_messageId-BojdkbIt.js +1 -0
  21. package/assets/_messageId-Br63cxHP.js +1 -0
  22. package/assets/_messageId-CElscOOg.js +1 -0
  23. package/assets/_outboxMessageId-B-LOsBw2.js +1 -0
  24. package/assets/_recurrenceId-CVQPBnfp.js +1 -0
  25. package/assets/_threadId-CBcvsEMo.js +1 -0
  26. package/assets/_threadId-DYIW9tHx.js +1 -0
  27. package/assets/_threadId-DbH9GuNd.js +1 -0
  28. package/assets/{_view._date-pfHyamYp.js → _view._date-DzTM5JlS.js} +1 -1
  29. package/assets/{accounts-CWQMjjjw.js → accounts-Dvrx4IYM.js} +1 -1
  30. package/assets/{advanced-B9ESEu8P.js → advanced-CJg3p5Bv.js} +1 -1
  31. package/assets/{appearance-CiHhA7B_.js → appearance-C5blyz0O.js} +1 -1
  32. package/assets/{attendee-row-B6tvnsNs.js → attendee-row-CvGDzdA4.js} +1 -1
  33. package/assets/{avatar-DlirA5AD.js → avatar-Bb8ScTir.js} +1 -1
  34. package/assets/{bell-off-CNej-tyT.js → bell-off-CS6Duk18.js} +1 -1
  35. package/assets/{bottom-sheet-CgDm7M7f.js → bottom-sheet-B5cf6MWK.js} +1 -1
  36. package/assets/brief-BFYTJF86.js +1 -0
  37. package/assets/{brief-BUtoJ-S9.js → brief-sKxBiyAp.js} +1 -1
  38. package/assets/{browser-ponyfill-DXG4VBth.js → browser-ponyfill-GPT1caT6.js} +1 -1
  39. package/assets/{bug-BxKBPCAb.js → bug-BZRMWJ8e.js} +1 -1
  40. package/assets/{calendar-CcwoHW3D.js → calendar-Bkx3aBLi.js} +1 -1
  41. package/assets/{calendar-clash-strip-BkYBh2Wc.js → calendar-clash-strip-BFmDAwFK.js} +1 -1
  42. package/assets/{calendar-format-Vcjfhlhl.js → calendar-format-Dl_kGdpq.js} +1 -1
  43. package/assets/{calendar-report-CBxPXQ5J.js → calendar-report-Dq8_JMmG.js} +1 -1
  44. package/assets/{calendar-suggestion-BifH_0f9.js → calendar-suggestion-CRkDiioj.js} +1 -1
  45. package/assets/{calendars-Ci1uQYPb.js → calendars-DbaCmJpW.js} +1 -1
  46. package/assets/{card-C3xvNh4f.js → card-BrGvFBtQ.js} +1 -1
  47. package/assets/{checkbox-Djhcc-aN.js → checkbox-7X0zR8En.js} +1 -1
  48. package/assets/chevron-left-BLnMK6Hm.js +1 -0
  49. package/assets/{circle-check-8zY_9fxi.js → circle-check-BAFZLxGj.js} +1 -1
  50. package/assets/{circle-check-big-CxFmEow9.js → circle-check-big-BpsV2KD8.js} +1 -1
  51. package/assets/{circle-help-DjzlhQI0.js → circle-help-BizC7pb0.js} +1 -1
  52. package/assets/{clock-CCGR0KuX.js → clock-CPsIZ6zJ.js} +1 -1
  53. package/assets/compose._-_outboxMessageId_-BmM1JqAv.js +1 -0
  54. package/assets/compose._-_outboxMessageId_-CXeMohJi.js +1 -0
  55. package/assets/compose._-_outboxMessageId_-ColAL-TU.js +1 -0
  56. package/assets/compose._-_outboxMessageId_-RC8PrqCU.js +1 -0
  57. package/assets/{config-import-D5LcCSdy.js → config-import-Dx5GIogE.js} +1 -1
  58. package/assets/{confirm-dialog-4-i7dCp5.js → confirm-dialog-Cv8nzgk0.js} +1 -1
  59. package/assets/{copy-C9vgpFVi.js → copy-CkXIeeHD.js} +1 -1
  60. package/assets/{credential-steps-DwaEJc6L.js → credential-steps-BZUL46-x.js} +1 -1
  61. package/assets/{download-CB58NRUV.js → download-C4etwdLI.js} +1 -1
  62. package/assets/{file-json-BbcIndXX.js → file-json-DqsJ4xJs.js} +1 -1
  63. package/assets/{filters-oms3fU12.js → filters-vQ_2-kyd.js} +1 -1
  64. package/assets/{flagged-BaJtxdoG.js → flagged-DRgV59IG.js} +1 -1
  65. package/assets/flagged-DseDsjLu.js +1 -0
  66. package/assets/{folders-CsI3jXEb.js → folders-DyTauiz9.js} +1 -1
  67. package/assets/{help-copy-BjGa7WTX.js → help-copy-tJC0-ZMl.js} +1 -1
  68. package/assets/{import-CKkWJtPs.js → import-CELB-bnR.js} +1 -1
  69. package/assets/index-B9DvuvdG.js +1 -0
  70. package/assets/index-BK6Ub1jz.js +1 -0
  71. package/assets/{index-aDMmeBcR.js → index-BLTKJWNr.js} +4 -4
  72. package/assets/index-BWg_f2zC.js +1 -0
  73. package/assets/{index-CDsYDTwV.js → index-BhjCjLJw.js} +1 -1
  74. package/assets/index-BojdkbIt.js +1 -0
  75. package/assets/index-CElscOOg.js +1 -0
  76. package/assets/index-DQGwT3GV.js +1 -0
  77. package/assets/index-DXKcs-mY.js +1 -0
  78. package/assets/index-KSHhd0R1.js +1 -0
  79. package/assets/index-_GSqQaV3.js +1 -0
  80. package/assets/{index-1mxX3_QN.js → index-owcFTp8Y.js} +49 -49
  81. package/assets/{kbd-Dp9xZFPh.js → kbd-lTvecOmZ.js} +1 -1
  82. package/assets/{labels-DNZ1e7DT.js → labels-DiA2JGmB.js} +1 -1
  83. package/assets/{mail-DxOUbZYP.js → mail-BxwAAW5X.js} +1 -1
  84. package/assets/{mail-n896QM6q.js → mail-CBC7EsCL.js} +1 -1
  85. package/assets/{map-pin-DT0APb7b.js → map-pin-D6VMw4yS.js} +1 -1
  86. package/assets/{menu-DDTDmbUg.js → menu-BQKKG_dY.js} +1 -1
  87. package/assets/minus-6qNWLdn9.js +1 -0
  88. package/assets/{new-hy2SkKdJ.js → new-CJ6kSPRF.js} +1 -1
  89. package/assets/onboarding-GJtMi48D.js +1 -0
  90. package/assets/{onboarding-completion-fANvE1aI.js → onboarding-completion-BbqmDbx7.js} +1 -1
  91. package/assets/outbox-B0H34lHj.js +1 -0
  92. package/assets/{pane-header-svjIOKfC.js → pane-header-Ca09EcL8.js} +1 -1
  93. package/assets/{pencil-ExQ6Smdq.js → pencil-DiRy6H7l.js} +1 -1
  94. package/assets/{popover-menu-CfA_guqF.js → popover-menu-B4BMf6LK.js} +1 -1
  95. package/assets/{refresh-cw-DYBLAWnZ.js → refresh-cw-Bot6vhqM.js} +1 -1
  96. package/assets/{rich-text-BFUWi7Nd.js → rich-text-BUR-C2Q6.js} +1 -1
  97. package/assets/{rich-text-spellcheck-worker-provider-DIMyFE6K.js → rich-text-spellcheck-worker-provider-CQ8rF4WA.js} +1 -1
  98. package/assets/{rotate-ccw-DSWQif2k.js → rotate-ccw-gjLXKk9W.js} +1 -1
  99. package/assets/{roving-focus-DlpDivMm.js → roving-focus-C3VQzsoq.js} +1 -1
  100. package/assets/{row-actions-QTX5H6T6.js → row-actions-_wAkj89Q.js} +1 -1
  101. package/assets/{search-mirror-EZkVoSiC.js → search-mirror-a3wl8YKf.js} +1 -1
  102. package/assets/{search-token-index-BRB-CGkj.js → search-token-index-BwY3fr3v.js} +1 -1
  103. package/assets/{sections-CcfWIv_w.js → sections-DKODQMWX.js} +1 -1
  104. package/assets/{senders-BRquTrmV.js → senders-Dpwg8Gn7.js} +1 -1
  105. package/assets/settings-CasU94x9.js +1 -0
  106. package/assets/{settings-screen-BPxMwZwZ.js → settings-screen-3GaT_yCl.js} +1 -1
  107. package/assets/{shield-check-DyrepgYg.js → shield-check-t1RKp08F.js} +1 -1
  108. package/assets/{suggested-vips-D9cfCwkN.js → suggested-vips-CAHDehKY.js} +1 -1
  109. package/assets/{suggestion._suggestionId-DUw3AAsS.js → suggestion._suggestionId-DSs2aOE3.js} +1 -1
  110. package/assets/{undo-2-BoTZN3H5.js → undo-2-CjsdasNX.js} +1 -1
  111. package/assets/{useCalendarData-C_jHapm8.js → useCalendarData-BNg59BCE.js} +1 -1
  112. package/assets/{useCalendarFreeBusy-BSwjpsWR.js → useCalendarFreeBusy-ClOpmxzB.js} +1 -1
  113. package/assets/{useCalendarWrites-pK8TUq_F.js → useCalendarWrites-onNcOsh0.js} +1 -1
  114. package/assets/{useCalendars-DOYXyUkA.js → useCalendars-LZefvRrA.js} +1 -1
  115. package/assets/{useDebouncedValue-DilE1ojx.js → useDebouncedValue-WWRLD9R5.js} +1 -1
  116. package/assets/{useFilters-BZyGJA1T.js → useFilters-1hN5d4xr.js} +1 -1
  117. package/assets/{useLabels-D34hpu4A.js → useLabels-C955uVg_.js} +1 -1
  118. package/assets/{useLayoutTier-rR-Jln8Q.js → useLayoutTier-A889tOk-.js} +1 -1
  119. package/assets/{useMessageBodyContent-D-AqdxBK.js → useMessageBodyContent-C6R-iTkz.js} +1 -1
  120. package/assets/{useQueries-CbWwzRRY.js → useQueries-jIdAkC8e.js} +1 -1
  121. package/assets/{useRefreshControl--3V0DtqJ.js → useRefreshControl-DT4gm04X.js} +1 -1
  122. package/assets/{useResultFolderIndex-D3dcov_9.js → useResultFolderIndex-CTrDyucm.js} +1 -1
  123. package/assets/{useSearchTokenContext-WrbDthen.js → useSearchTokenContext-CDbE53C_.js} +1 -1
  124. package/assets/{useSemanticSearch-DVkDVaeI.js → useSemanticSearch-CX-jW79N.js} +1 -1
  125. package/assets/{useSignature-DeCpWiaN.js → useSignature-BqhqHAev.js} +1 -1
  126. package/index.html +1 -1
  127. package/package.json +1 -1
  128. package/assets/MailListHeader-BSfcf-IH.js +0 -1
  129. package/assets/_calendarObjectId-B8_AN3Bn.js +0 -1
  130. package/assets/_mailboxId-BlL4k3EG.js +0 -1
  131. package/assets/_messageId-DNpLxhrh.js +0 -1
  132. package/assets/_messageId-hao7lbIn.js +0 -1
  133. package/assets/_messageId-yeL7wWhd.js +0 -1
  134. package/assets/_outboxMessageId-B6CcnXNb.js +0 -1
  135. package/assets/_recurrenceId-DrkGdj4p.js +0 -1
  136. package/assets/_threadId-B9g3Td57.js +0 -1
  137. package/assets/_threadId-SLBw3uKx.js +0 -1
  138. package/assets/_threadId-ug537Hn6.js +0 -1
  139. package/assets/brief-CbhnsM9g.js +0 -1
  140. package/assets/chevron-left-D5AYy_RP.js +0 -1
  141. package/assets/compose._-_outboxMessageId_-B5OcVfGt.js +0 -1
  142. package/assets/compose._-_outboxMessageId_-BeyuF_dY.js +0 -1
  143. package/assets/compose._-_outboxMessageId_-CljpRAaq.js +0 -1
  144. package/assets/compose._-_outboxMessageId_-Mrz7s9Vh.js +0 -1
  145. package/assets/flagged-Dcv9ngH7.js +0 -1
  146. package/assets/index-BcBtoNYg.js +0 -1
  147. package/assets/index-CSuGKSPO.js +0 -1
  148. package/assets/index-CtV0MWP7.js +0 -1
  149. package/assets/index-DNpLxhrh.js +0 -1
  150. package/assets/index-DxBX22wB.js +0 -1
  151. package/assets/index-RCzGf3-N.js +0 -1
  152. package/assets/index-uNpkWH7c.js +0 -1
  153. package/assets/index-x5-XjHud.js +0 -1
  154. package/assets/index-yeL7wWhd.js +0 -1
  155. package/assets/minus-BuYcA1Hp.js +0 -1
  156. package/assets/onboarding-DE5r6wOh.js +0 -1
  157. package/assets/outbox-CKS-pjfb.js +0 -1
  158. package/assets/settings-BAeuWCVE.js +0 -1
@@ -1 +0,0 @@
1
- import{dh as or,e as ce,r as l,j as t,_ as De,$ as pt,L as Mn,t as E,a0 as ir,g as ye,di as lr,dj as Tn,dk as An,dl as Ls,a7 as cr,f as Q,X as qe,a3 as ds,aB as Ds,Y as dr,b9 as ur,dg as Os,dm as En,Z as He,dn as mr,dp as fr,dq as hr,W as Qe,dr as Fn,bJ as gt,ds as pr,bs as gr,dt as xr,du as br,dv as vr,dw as yr,dx as Ln,d9 as jr,aM as kr,dy as Cr,B as Dn,dz as Nr,dA as wr,dB as Sr,dC as Ir,dD as Rr,dE as Mr,w as Tr,cH as On,d4 as zn,c as se,d as We,K as us,dF as Ar,dG as Er,dH as zs,h as ue,at as be,i as pe,E as Ce,F as Ne,Q as ms,cy as we,dI as Ps,dJ as is,aJ as Fr,dK as fs,dL as Se,dM as hs,dN as ps,dO as gs,dP as Lr,dQ as Dr,dR as Pt,cF as Or,s as Pn,dS as zr,dT as Pr,dU as _r,b6 as Br,cp as Ur,G as _s,c_ as _n,c$ as $r,dV as Kr,bq as xt,bt as Bn,bn as Un,bu as $n,bv as Kn,bw as qr,dW as Qr,ab as qn,cO as Hr,dX as ls,dY as Wr,aH as Gr,aI as Vr,dZ as Jr,bf as Qn,d_ as Yr,d$ as Hn,e0 as Zr,H as Wn,e1 as Xr,bR as bt,e2 as eo,cQ as Ge,e3 as _t,e4 as Gn,bT as so,e5 as et,e6 as to,bS as no,S as ao,q as ro,ah as Vn,J as oo,e7 as io,e8 as lo,e9 as co,d3 as Bt,bD as uo,ea as mo,eb as fo,av as ho,cS as po,d1 as go,ec as xo,ai as bo,d2 as vo,ed as yo,ee as jo,ef as ko,eg as Co,C as xs,eh as No,ei as wo,ej as Ut,ek as So,el as Io,em as Ro,en as Mo,v as Jn,df as To,eo as vt,ep as Ao,eq as Eo,cq as Fo,cn as Lo,er as Do,bU as Oo,es as Yn,cr as zo}from"./index-1mxX3_QN.js";import{u as Po,L as _o,a as Bo}from"./roving-focus-DlpDivMm.js";import{j as Uo,S as Zn,f as $o,a as Ko,t as ns,c as qo,k as Qo,l as Ho,m as Wo,u as Go}from"./search-token-index-BRB-CGkj.js";import{K as Vo}from"./kbd-Dp9xZFPh.js";import{c as Xn,P as Jo,E as Yo}from"./popover-menu-CfA_guqF.js";import{M as Zo}from"./mail-DxOUbZYP.js";import{A as cs}from"./avatar-DlirA5AD.js";import{M as Xo,a as ei,b as ea,c as si,s as sa,d as ta,e as ti,f as ni,S as $t,g as na,u as aa,p as ai,r as ri}from"./useSearchTokenContext-WrbDthen.js";import{P as Bs,f as oi,C as ii,D as $e,s as li,a as ci,e as Kt,b as di,c as ui,d as mi,g as qt,i as fi,u as hi}from"./index-aDMmeBcR.js";import{E as ra}from"./EmptyState-KNDNyfvT.js";import{E as Le}from"./ErrorState-DLtcLFLq.js";import{U as pi}from"./undo-2-BoTZN3H5.js";import{D as gi}from"./download-CB58NRUV.js";import{s as xi,b as bi,Z as vi,E as yi,C as ji,e as ki,u as Ci,d as Ni}from"./useCalendarFreeBusy-BSwjpsWR.js";import{C as ot,m as wi,j as Si,n as Ii,o as Qt,k as Ht,p as Ri,s as Wt,q as Mi,v as Ti,t as Ai,x as Ei}from"./calendar-suggestion-BifH_0f9.js";import{c as Fi,t as Li,v as Di,x as Oi,y as zi,z as Gt}from"./calendar-format-Vcjfhlhl.js";import{R as Pi}from"./attendee-row-B6tvnsNs.js";import{C as _i}from"./calendar-clash-strip-BkYBh2Wc.js";import{C as oa}from"./clock-CCGR0KuX.js";import{M as Bi}from"./map-pin-DT0APb7b.js";import{B as ia}from"./bell-off-CNej-tyT.js";import{S as Ui,C as la}from"./shield-check-DyrepgYg.js";import{u as $i,a as Ki,i as qi,t as Qi,d as Hi,r as Wi}from"./useCalendars-DOYXyUkA.js";import{c as Gi}from"./calendar-report-CBxPXQ5J.js";import{u as ca}from"./useDebouncedValue-DilE1ojx.js";import{j as Vt,u as Vi,a as Ji,k as Yi,n as Zi,o as Xi,l as el,S as sl}from"./useFilters-BZyGJA1T.js";import{u as yt}from"./useQueries-CbWwzRRY.js";import{C as tl}from"./checkbox-Djhcc-aN.js";import{C as Ns}from"./confirm-dialog-4-i7dCp5.js";import{u as nl,i as al}from"./useLayoutTier-rR-Jln8Q.js";import{r as rl,a as ol}from"./search-scope-B5-OK3Cq.js";import{M as il}from"./menu-DDTDmbUg.js";function ll(...e){return(...s)=>{for(let n of e)typeof n=="function"&&n(...s)}}let it=new Map;typeof FinalizationRegistry<"u"&&new FinalizationRegistry(e=>{it.delete(e)});function cl(e,s){if(e===s)return e;let n=it.get(e);if(n)return n.forEach(r=>r.current=s),s;let a=it.get(s);return a?(a.forEach(r=>r.current=e),e):s}function dl(...e){return e.length===1&&e[0]?e[0]:s=>{let n=!1;const a=e.map(r=>{const o=Jt(r,s);return n||=typeof o=="function",o});if(n)return()=>{a.forEach((r,o)=>{typeof r=="function"?r():Jt(e[o],null)})}}}function Jt(e,s){if(typeof e=="function")return e(s);e!=null&&(e.current=s)}function da(...e){let s={...e[0]};for(let n=1;n<e.length;n++){let a=e[n];for(let r in a){let o=s[r],i=a[r];typeof o=="function"&&typeof i=="function"&&r[0]==="o"&&r[1]==="n"&&r.charCodeAt(2)>=65&&r.charCodeAt(2)<=90?s[r]=ll(o,i):(r==="className"||r==="UNSAFE_className")&&typeof o=="string"&&typeof i=="string"?s[r]=or(o,i):r==="id"&&o&&i?s.id=cl(o,i):r==="ref"&&o&&i?s.ref=dl(o,i):s[r]=i!==void 0?i:o}}return s}const Us=ce("BadgeCheck",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const ul=ce("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const ml=ce("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);const ua=ce("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const ma=ce("Forward",[["polyline",{points:"15 17 20 12 15 7",key:"1w3sku"}],["path",{d:"M4 18v-2a4 4 0 0 1 4-4h12",key:"jmiej9"}]]);const fl=ce("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);const hl=ce("MailCheck",[["path",{d:"M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8",key:"12jkf8"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]]);const jt=ce("MailOpen",[["path",{d:"M21.2 8.4c.5.38.8.97.8 1.6v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V10a2 2 0 0 1 .8-1.6l8-6a2 2 0 0 1 2.4 0l8 6Z",key:"1jhwl8"}],["path",{d:"m22 10-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 10",key:"1qfld7"}]]);const fa=ce("ReplyAll",[["polyline",{points:"7 17 2 12 7 7",key:"t83bqg"}],["polyline",{points:"12 17 7 12 12 7",key:"1g4ajm"}],["path",{d:"M22 18v-2a4 4 0 0 0-4-4H7",key:"1fcyog"}]]);const kt=ce("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);const Ve=ce("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);const pl=ce("ShieldQuestion",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const gl=ce("ShieldX",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]]);const xl=ce("TextSearch",[["path",{d:"M21 6H3",key:"1jwq7v"}],["path",{d:"M10 12H3",key:"1ulcyk"}],["path",{d:"M10 18H3",key:"13769t"}],["circle",{cx:"17",cy:"15",r:"3",key:"1upz2a"}],["path",{d:"m21 19-1.9-1.9",key:"dwi7p8"}]]),bl=({address:e,showTrustedBadge:s=!1})=>{const n=s?t.jsx(Us,{className:"inline-block size-4 ml-1 -mt-0.5 text-positive","aria-label":"Trusted sender","data-testid":"trusted-sender-badge"}):null;return e.displayName?t.jsxs("span",{children:[t.jsx("span",{className:"text-fg",children:e.displayName}),t.jsxs("span",{className:"text-fg-muted",children:[" ","<",e.normalizedEmail,">"]}),n]}):t.jsxs("span",{className:"text-fg",children:[e.normalizedEmail,n]})},vl=({label:e,addresses:s,showTrustedBadge:n=!1})=>{const[a,r]=l.useState(!1);if(s.length===0)return null;const o=s.length>3,i=c=>{const u=n&&c.flags?.trusted?.value===!0;return t.jsx(bl,{address:c,showTrustedBadge:u})};return t.jsxs("div",{className:"flex gap-2 text-sm",children:[t.jsxs("span",{className:"text-fg-muted shrink-0 w-12",children:[e,":"]}),t.jsx("div",{className:"flex-1 min-w-0",children:a?t.jsx("div",{className:"flex flex-wrap gap-1",children:s.map((c,u)=>t.jsxs("span",{children:[i(c),u<s.length-1&&", "]},u))}):t.jsx("div",{className:"truncate",children:s.map((c,u)=>t.jsxs("span",{children:[i(c),u<s.length-1&&", "]},u))})}),o&&t.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),r(!a)},className:"shrink-0 text-fg-muted hover:text-fg transition-colors","aria-label":a?"Collapse":"Expand",children:a?t.jsx(De,{className:"h-4 w-4"}):t.jsx(pt,{className:"h-4 w-4"})})]})};function yl({state:e,onRetry:s}){return t.jsxs("div",{role:"alert","data-testid":"attachment-error",className:"flex items-start gap-2 border-t border-danger/30 bg-danger-soft px-2 py-2 text-xs",children:[t.jsx(ir,{className:"mt-0.5 size-3.5 shrink-0 text-danger","aria-hidden":!0}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"font-medium text-danger",children:e.title}),t.jsx("p",{className:"mt-0.5 text-fg-muted",children:e.detail})]}),t.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[t.jsx("button",{type:"button",onClick:s,className:"font-medium text-accent hover:underline",children:"Try again"}),e.reportUrl&&t.jsx("a",{href:e.reportUrl,target:"_blank",rel:"noreferrer",className:"font-medium text-accent hover:underline",children:"Report this"})]})]})}function jl({attachments:e,onDownload:s,hasUnlistedAttachment:n=!1,className:a}){return e.length===0&&!n?null:t.jsxs("section",{"aria-label":"Attachments","data-testid":"attachment-list",className:E("space-y-1.5",a),children:[t.jsxs("h3",{className:"flex items-center gap-1.5 text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:[t.jsx(Bs,{className:"size-3","aria-hidden":!0}),e.length===0?"Attachment":e.length===1?"1 attachment":`${e.length} attachments`]}),e.length>0&&t.jsx("ul",{className:"overflow-hidden rounded-sm border border-line bg-surface",children:e.map(r=>{const o=r.download.status==="downloading";return t.jsxs("li",{className:"border-t border-line first:border-t-0",children:[t.jsxs("button",{type:"button",onClick:()=>s(r.attachmentId),disabled:o,"data-testid":"attachment-download","aria-label":`Download ${r.filename}`,className:"flex w-full items-center gap-2 px-2 py-2 text-left transition-colors hover:bg-surface-sunken disabled:cursor-progress disabled:opacity-60",children:[t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsx("bdi",{className:"block truncate text-sm text-fg",title:r.filename,children:r.filename}),t.jsxs("span",{className:"block truncate text-2xs text-fg-subtle",children:[r.typeLabel," ·"," ",oi(r.sizeOctets)]})]}),o?t.jsx(Mn,{className:"size-4 shrink-0 animate-spin text-fg-subtle","aria-hidden":!0}):t.jsx(gi,{className:"size-4 shrink-0 text-fg-subtle","aria-hidden":!0})]}),r.download.status==="failed"&&t.jsx(yl,{state:r.download,onRetry:()=>s(r.attachmentId)})]},r.attachmentId)})}),n&&t.jsx("p",{role:"alert","data-testid":"attachment-unlisted",className:"rounded-sm border border-line bg-surface px-2 py-2 text-xs text-fg-muted",children:"The mail server says this message carries an attachment, but none of its parts describe one. Re-sync the account from Settings; if the attachment still does not appear, the message is worth reporting."})]})}function kl({label:e,onUndo:s,undoLabel:n="Undo",filtersHref:a,className:r}){return t.jsxs(ye,{tone:"accent",className:E("py-1 text-xs",r),children:[t.jsx(pi,{className:"size-3.5 shrink-0","aria-hidden":!0}),t.jsx("span",{children:e}),s&&t.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),s()},className:"font-semibold underline decoration-dotted underline-offset-2 hover:decoration-solid",children:n}),a&&t.jsx("a",{href:a,onClick:o=>{o.stopPropagation()},className:"font-semibold underline decoration-dotted underline-offset-2 hover:decoration-solid",children:"Manage filter"})]})}const Yt=10,Cl={kind:"unknown"},st=e=>e.toLocaleString();function Nl({section:e,Row:s,selectedThreadId:n,initialExpanded:a=!1,initialCollapsed:r=!1,onShowAll:o,onRetry:i,onSelectThread:c}){const[u,b]=l.useState(a),[v,j]=l.useState(r),g=e.threads,p=e.loading===!0,m=e.error===!0,f=g.length>Yt,h=!u&&f?g.slice(0,Yt):g,y=e.total??Cl,x=y.kind==="exact"&&(g.length>0||p)&&!m?st(y.value):void 0,k=y.kind==="exact"?y.value>h.length:e.atCap===!0,C=o!==void 0&&h.length>0&&k?y.kind==="exact"?`Show all ${st(y.value)}`:"Show all":void 0,I=g.length-h.length;return t.jsxs("div",{children:[e.label&&t.jsxs("button",{type:"button","data-section-header":"","aria-expanded":!v,onClick:()=>j(M=>!M),className:"sticky top-0 z-10 flex h-section-row w-full items-center gap-1.5 border-b border-line bg-surface-sunken px-row-inset text-left outline-none transition-colors hover:bg-surface focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",children:[t.jsx("span",{className:"flex-1 text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:e.label}),x!==void 0&&t.jsx("span",{className:"text-2xs text-fg-subtle tabular-nums",children:x}),t.jsx(De,{className:E("size-3 shrink-0 text-fg-subtle transition-transform duration-200",v?"rotate-0":"rotate-180")})]}),!v&&t.jsxs(t.Fragment,{children:[g.length===0?m?t.jsxs("div",{className:"flex flex-col items-center gap-1 border-b border-line px-row-inset py-4 text-center text-2xs text-danger",children:[t.jsx("span",{children:`Couldn't load ${e.label??"these messages"}`}),i&&t.jsx("button",{type:"button",onClick:i,className:"font-medium text-accent underline outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"Try again"})]}):p?t.jsx("div",{className:"animate-pulse divide-y divide-line",children:[0,1,2].map(M=>t.jsx("div",{className:"px-row-inset py-3",children:t.jsx("div",{className:"h-3 w-2/3 rounded bg-surface-sunken"})},M))}):t.jsx("p",{className:"border-b border-line px-row-inset py-4 text-center text-2xs text-fg-subtle",children:e.label?`No ${e.label} mail in this brief.`:"No mail in this brief."}):t.jsx("div",{className:"divide-y divide-line",children:h.map(M=>t.jsx(s,{thread:M,active:M.id===n,onClick:()=>c?.(M.id)},M.id))}),C!==void 0?t.jsxs("button",{type:"button",onClick:o,className:"flex w-full items-center justify-center border-b border-line px-row-inset py-1.5 text-2xs font-medium text-accent outline-none transition-colors hover:bg-surface focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",children:[C,t.jsx(pt,{className:"ml-1 size-3"})]}):f&&t.jsxs("button",{type:"button",onClick:()=>b(M=>!M),className:"flex w-full items-center justify-center border-b border-line px-row-inset py-1.5 text-2xs font-medium text-accent outline-none transition-colors hover:bg-surface focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",children:[u?"Show less":`Show ${st(I)} more`,!u&&t.jsx(De,{className:"ml-1 size-3"})]})]})]})}function Nf({sections:e,briefCategory:s="all",selectedThreadId:n,Row:a,keyboard:r,onSelectThread:o,onShowAllSection:i,onRetrySection:c,flat:u=!1,onSelectBriefCategory:b,sources:v,sourcesNote:j,onSelectSource:g,activeFilters:p,onToggleFilter:m,onClearFilters:f,hideChrome:d,defaultExpanded:h=!1}){const[y,x]=l.useState(h),k=l.useRef(null);Po({containerRef:k,itemSelector:_o,enabled:!lr(r)});const C=!u&&(s==="all"||e.some(A=>A.total!==void 0)),I=e.filter(A=>A.threads.length>0||A.total!==void 0||A.loading===!0||A.error===!0),M=e.flatMap(A=>A.threads),w=An,N=C?I.length===0:M.length===0,T=t.jsxs("div",{ref:k,children:[C?I.map(A=>t.jsx(Nl,{section:A,Row:a,selectedThreadId:n,onSelectThread:o,onShowAll:i?()=>i(A.id):void 0,onRetry:c?()=>c(A.id):void 0},A.id)):t.jsx("div",{className:"divide-y divide-line",children:M.map(A=>t.jsx(a,{thread:A,active:A.id===n,onClick:()=>o?.(A.id)},A.id))}),N&&t.jsx("div",{className:"px-row-inset py-6 text-center text-2xs text-fg-subtle",children:"No threads match these filters."})]});return t.jsx(Tn,{categories:[...Ls],filters:w,sources:v,sourcesNote:j,selectedCategory:s,activeFilters:p,expanded:y,onExpandedChange:x,onSelectCategory:A=>b?.(A),onSelectSource:g,onToggleFilter:A=>m(A),onClear:f,hideChrome:d,children:T})}const wl={ics:"Attached invitation",markup:"Structured markup",pattern:"Read from the words"},Sl={ics:cr,markup:ml,pattern:xl},Il={ics:"border-positive/50 text-positive",markup:"border-accent-2/50 text-accent-2",pattern:"border-warning/50 text-warning"};function Rl({method:e,className:s}){const n=Sl[e];return t.jsxs("span",{className:E("inline-flex items-center gap-1 rounded-sm border px-1.5 py-0.5 text-2xs font-medium",Il[e],s),children:[t.jsx(n,{className:"size-3","aria-hidden":!0}),wl[e]]})}const Ml=["accepted","tentative","declined","noReply"],Tl={accepted:"coming",tentative:"maybe",declined:"not coming",noReply:"no reply"},Al=(e,s)=>e==="dismissed"?"You dismissed this":s==="declined"?"You declined":"On your calendar";function El({invite:e,whenText:s,calendarName:n,color:a,clashes:r,rsvp:o,onAdd:i,onTentative:c,onDecline:u,onReopen:b,onOfferOtherTimes:v,mute:j,onRemove:g,onOpenNewer:p,guests:m,busy:f=!1,failure:d="",reportHref:h,addBlocked:y,touch:x,className:k}){const C=Fi(a),I=e.state==="superseded"||e.state==="cancelled",M=e.proposed.attendees,w=Ml.map(N=>({state:N,count:M.filter(T=>T.rsvp===N).length})).filter(N=>N.count>0).map(N=>`${N.count} ${Tl[N.state]}`).join(" · ");return t.jsxs("section",{className:E("flex flex-col gap-3 rounded-lg border border-line bg-surface-raised p-3",k),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:E("size-2.5 shrink-0 rounded-full",C.solid)}),t.jsxs("span",{className:"min-w-0 flex-1 truncate text-2xs uppercase tracking-wider text-fg-subtle",children:["Invitation from ",e.organizerName," · ",n]}),t.jsx(Rl,{method:e.method})]}),t.jsxs("div",{className:E(I&&"opacity-60"),children:[t.jsx("h3",{className:"text-md font-semibold text-fg",children:e.proposed.title}),t.jsxs("p",{className:"mt-1 flex items-center gap-2 text-sm text-fg",children:[t.jsx(oa,{className:"size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),s]}),e.proposed.location!==""&&t.jsxs("p",{className:"mt-1 flex items-center gap-2 text-sm text-fg-muted",children:[t.jsx(Bi,{className:"size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.proposed.location]})]}),e.state==="superseded"&&t.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-warning/40 bg-warning-soft p-2",children:[t.jsx(fl,{className:"mt-0.5 size-4 shrink-0 text-warning","aria-hidden":!0}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("p",{className:"text-xs font-semibold text-warning",children:[e.organizerName," has sent a newer version of this."]}),t.jsxs("p",{className:"mt-1 text-xs text-fg",children:["This one is revision ",e.sequence," and is out of date. The newer message carries the one to answer."]}),p&&t.jsx(Q,{variant:"secondary",size:x?"md":"sm",onClick:p,className:E("mt-2",x&&"min-h-11"),children:"Open the newer invitation"})]})]}),e.state==="cancelled"&&t.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft p-2",children:[t.jsx(qe,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsxs("p",{className:"text-xs font-semibold text-danger",children:[e.organizerName," cancelled this."]}),t.jsx("p",{className:"mt-1 text-xs text-fg",children:"It is still on your calendar. Nothing comes off it until you say so."}),g&&t.jsxs("div",{className:E("mt-2 flex gap-2",x&&"flex-wrap"),children:[t.jsx(Q,{variant:"primary",size:x?"md":"sm",icon:t.jsx(ds,{className:"size-3.5"}),onClick:g,disabled:f||y!==void 0,className:E(x&&"min-h-11 flex-1"),children:"Remove from calendar"}),b&&t.jsx(Q,{variant:"secondary",size:x?"md":"sm",onClick:b,disabled:f,className:E(x&&"min-h-11 flex-1"),children:"Keep it"})]})]})]}),!I&&t.jsx(_i,{clashes:r}),m??(M.length>0&&t.jsxs("p",{className:"text-2xs uppercase tracking-wider text-fg-subtle",children:[M.length," guests",w===""?"":` · ${w}`]})),d!==""&&t.jsx(ot,{text:d,reportHref:h}),y!==void 0&&t.jsx("div",{className:"rounded-md border border-warning/40 bg-warning-soft p-2 text-xs text-fg",children:y}),!I&&(o==="noReply"&&e.state!=="dismissed"?t.jsxs("div",{className:"flex flex-col gap-2 border-t border-line pt-3",children:[t.jsxs("div",{className:E("flex gap-2",x&&"flex-wrap"),children:[t.jsx(Q,{variant:"primary",size:x?"md":"sm",icon:t.jsx(ul,{className:"size-3.5"}),onClick:i,disabled:f||y!==void 0,className:E(x&&"min-h-11 flex-1"),children:"Add to calendar"}),c&&t.jsx(Q,{variant:"secondary",size:x?"md":"sm",onClick:c,disabled:f||y!==void 0,className:E(x&&"min-h-11 flex-1"),children:"Maybe"}),t.jsx(Q,{variant:"secondary",size:x?"md":"sm",icon:t.jsx(qe,{className:"size-3.5"}),onClick:u,disabled:f,className:E(x&&"min-h-11 flex-1"),children:"Decline"})]}),t.jsx(Q,{variant:"ghost",size:x?"md":"sm",onClick:v,className:E("self-start",x&&"min-h-11 w-full"),children:"Offer other times"}),j&&t.jsx(Q,{variant:"ghost",size:x?"md":"sm",icon:t.jsx(ia,{className:"size-3.5"}),onClick:j.onMute,disabled:f,className:E("self-start",x&&"min-h-11 w-full"),children:`Stop offering invitations from ${j.sender}`}),t.jsxs("p",{className:"text-2xs text-fg-subtle",children:[e.organizerName," is not notified. Reader writes this to your calendar and sends no reply — tell them in the thread."]})]}):t.jsxs("div",{className:"flex flex-col gap-2 border-t border-line pt-3",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[t.jsxs("span",{className:"flex items-center gap-1.5 text-sm text-fg",children:[Al(e.state,o),e.state!=="dismissed"&&t.jsx(Pi,{rsvp:o})]}),b&&t.jsx(Q,{variant:"ghost",size:x?"md":"sm",onClick:b,disabled:f,className:x?"min-h-11":"",children:"Change"}),o==="declined"&&t.jsx(Q,{variant:"secondary",size:x?"md":"sm",onClick:v,className:x?"min-h-11":"",children:"Offer other times"})]}),t.jsxs("p",{className:"flex items-start gap-1.5 text-2xs text-fg-subtle",children:[t.jsx(Ds,{className:"mt-0.5 size-3 shrink-0","aria-hidden":!0}),e.organizerName," was not notified."]})]}))]})}function Fl({slots:e,picked:s,onToggle:n,emptyText:a="Nothing free that day at this length.",touch:r,scroll:o,className:i}){return e.length===0?t.jsx("p",{className:E("text-xs text-fg-muted",i),children:a}):t.jsx("div",{className:E("flex gap-2",o?"overflow-x-auto pb-1":"flex-wrap",i),children:e.map(c=>{const u=s.has(c.startTime);return t.jsxs("button",{type:"button","aria-pressed":u,onClick:()=>n(c),className:E("shrink-0 rounded-md border px-2 text-xs tabular-nums outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",r?"min-h-11 px-3":"h-7",u?"border-accent bg-accent-soft font-semibold text-accent":"border-line bg-surface text-fg-muted hover:border-line-strong hover:text-fg"),children:[c.startTime," – ",c.endTime]},c.startTime)})})}function xe({label:e,children:s,className:n}){return t.jsxs("section",{className:E("border-b border-line px-row-inset py-3",n),children:[t.jsx("h3",{className:"text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:e}),t.jsx("div",{className:"mt-2",children:s})]})}function Ll({data:e,actions:s,selectedEventId:n="",touch:a,className:r}){const{invite:o,prose:i,suggestions:c,day:u,dayLabel:b,suggestionsBusy:v=!1,failure:j="",suggestionsFailure:g="",reportHref:p,addBlocked:m}=e,{onReviewSuggestion:f,onOpenThread:d}=s,[h,y]=l.useState({}),x=c[0],k=x===void 0?"":h[x.suggestion.id]??"",C=x===void 0?void 0:xi(x.suggestion,k),I=new Set(i?.picked??[]);return j===""&&o===void 0&&i===void 0&&c.length===0&&u.length===0?t.jsxs("div",{className:E("flex flex-1 flex-col items-center justify-center gap-2 px-row-inset py-10 text-center",r),children:[t.jsx(dr,{className:"size-6 text-fg-subtle","aria-hidden":!0}),t.jsx("p",{className:"text-sm text-fg-muted",children:"Nothing in this message is about a time."}),t.jsx("p",{className:"text-2xs text-fg-subtle",children:"An invitation, a booking or a thread proposing hours would show up here, with the day it lands on."})]}):t.jsxs("div",{className:E("flex flex-col",r),children:[j!==""&&t.jsx(ot,{text:j,reportHref:p,className:"mx-row-inset mt-3"}),o&&t.jsx(xe,{label:"Invitation",children:t.jsx(El,{invite:o.invite,whenText:o.whenText,calendarName:o.calendarName,color:o.color,clashes:o.clashes,rsvp:o.rsvp,busy:o.busy,failure:o.failure,reportHref:o.reportHref,addBlocked:o.addBlocked,mute:s.onMuteInvite&&o.sender?{sender:o.sender,onMute:s.onMuteInvite}:void 0,onAdd:s.onAddInvite,onTentative:s.onTentativeInvite,onDecline:s.onDeclineInvite,onReopen:s.onReopenInvite,onOfferOtherTimes:s.onOfferOtherTimes,onRemove:s.onRemoveInvite,onOpenNewer:s.onOpenNewerInvite,touch:a})}),i&&t.jsxs(xe,{label:i.proposals.length>0?`Times named · ${i.dayLabel}`:`Other times · ${i.dayLabel}`,children:[t.jsx("ul",{className:E("flex flex-col gap-1",i.proposals.length===0&&"hidden"),children:i.proposals.map(w=>t.jsxs("li",{className:"flex items-baseline gap-2 text-xs",children:[t.jsx("span",{className:"w-24 shrink-0 truncate tabular-nums text-fg",children:w.phrase}),w.clashTitle===""?t.jsx("span",{className:"min-w-0 flex-1 truncate text-positive",children:"Nothing booked"}):t.jsxs("span",{className:"min-w-0 flex-1 truncate text-danger",children:[w.clashTitle," is already there"]})]},w.id))}),t.jsx("p",{className:"mt-3 pb-1.5 text-2xs uppercase tracking-wider text-fg-subtle",children:"Free, half an hour each"}),t.jsx(Fl,{slots:i.slots,picked:I,onToggle:s.onToggleSlot,touch:a,scroll:!0}),s.onReplyWithSlots?t.jsxs("div",{className:"mt-2 flex flex-col gap-1.5",children:[t.jsx(Q,{variant:"secondary",size:a?"md":"sm",icon:t.jsx(kt,{className:"size-3.5"}),onClick:s.onReplyWithSlots,disabled:I.size===0,className:E("self-start",a&&"min-h-11"),children:"Reply with these times"}),t.jsx("p",{className:"text-2xs text-fg-subtle",children:"Picked slots go into the reply as plain text. Nothing is booked."})]}):t.jsx("p",{className:"mt-1.5 text-2xs text-fg-subtle",children:"Picked slots go into the reply as plain text. Nothing is booked."})]}),c.length>0&&t.jsxs(xe,{label:"Read out of this thread",children:[t.jsx(bi,{hasCard:x!==void 0,remaining:c.length,blocked:C!==void 0&&!C.settled,blockedReason:vi,onConfirm:()=>{x&&C?.settled&&m===void 0&&s.onAddSuggestion(x.suggestion.id,C.timeZone)},onReject:()=>{x&&s.onDismissSuggestion(x.suggestion.id)},children:x&&t.jsx(yi,{suggestion:x.suggestion,whenText:x.whenText,addLabel:"Add to calendar",zoneChoice:k,onZoneChoice:w=>y(N=>({...N,[x.suggestion.id]:w})),onAdd:w=>s.onAddSuggestion(x.suggestion.id,w),onReview:f&&(w=>f(x.suggestion.id,w)),onDismiss:()=>s.onDismissSuggestion(x.suggestion.id),onOpenThread:d&&(()=>d(x.suggestion.threadId)),busy:v,addBlocked:m!==void 0,touch:a})}),m!==void 0&&t.jsx("div",{className:"mt-2 rounded-md border border-warning/40 bg-warning-soft p-2 text-xs text-fg",children:m}),g!==""&&t.jsx(ot,{text:g,reportHref:p,className:"mt-2"}),t.jsx("p",{className:"mt-2 text-2xs text-fg-subtle",children:"None of this is on your calendar, and none of it will be until you say so."})]}),u.length>0&&t.jsx(xe,{label:b,className:"border-b-0",children:t.jsx("ul",{className:"flex flex-col gap-1",children:u.map(w=>t.jsx("li",{children:t.jsx(ji,{title:w.event.title,timeText:w.timeText,color:w.color,layout:"row",density:"compact",rsvp:w.event.myRsvp,status:w.event.status,hasThread:w.event.threadId!=="",isRecurring:w.event.recurrenceRule!=="",zoneCertainty:w.event.zoneCertainty,selected:w.event.id===n,onClick:()=>s.onSelectEvent(w.event.id)})},w.event.id))})})]})}const Dl=[{value:"sender",label:"Sender"},{value:"calendar",label:"Calendar"}],Ol={unknown:{label:"Unknown sender",tone:"neutral"},wellknown:{label:"Known sender",tone:"positive"},vip:{label:"VIP",tone:"accent"}};function zl({sender:e}){const s=Ol[e.trust],n=e.inboundCount==null?null:(e.replyCount??0)>0?`${e.inboundCount} received · you replied ${e.replyCount}×`:`${e.inboundCount} received · you've never replied`;return t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(cs,{name:e.name,email:e.email,size:"md"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"truncate text-sm font-semibold text-fg",children:e.name}),t.jsx("div",{className:"truncate text-2xs text-fg-subtle",children:e.email})]})]}),t.jsx("div",{className:"mt-2 flex items-center gap-2",children:e.addressUnverified?t.jsx(ye,{tone:"danger",dot:!0,children:"Address couldn't be verified"}):t.jsx(ye,{tone:s.tone,dot:!0,children:s.label})}),t.jsxs("p",{className:"mt-2 text-xs text-fg-muted",children:["First seen ",e.firstSeenLabel,n?` · ${n}`:""]})]})}function Pl({auth:e,onShowSimilar:s}){if(e.verdict==="aligned")return t.jsxs("div",{className:"flex items-start gap-2 text-xs text-fg-muted",children:[t.jsx(Ui,{className:"mt-0.5 size-3.5 shrink-0 text-positive"}),t.jsx("span",{children:e.summary})]});if(e.verdict==="caution")return t.jsxs("div",{className:"flex items-start gap-2 rounded-md bg-warning/10 p-3 text-warning",children:[t.jsx(pl,{className:"mt-0.5 size-4 shrink-0"}),t.jsx("p",{className:"text-xs leading-relaxed",children:e.summary})]});const n=e.addressUnreadable?"This sender can't be verified":"This message may be impersonating someone";return t.jsxs("div",{className:"rounded-md bg-danger-soft p-3",children:[t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx(Ve,{className:"mt-0.5 size-4 shrink-0 text-danger"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm font-semibold text-danger",children:n}),t.jsx("p",{className:"mt-1 text-xs leading-relaxed text-fg",children:e.summary}),!e.addressUnreadable&&e.dkimDomain&&t.jsxs("p",{className:"mt-1 text-2xs text-fg-muted",children:["Sent from"," ",t.jsx("code",{className:"rounded bg-surface px-1 py-0.5",children:e.dkimDomain}),", claims to be"," ",t.jsx("code",{className:"rounded bg-surface px-1 py-0.5",children:e.fromDomain})]})]})]}),e.similarCount!=null&&e.similarCount>0&&t.jsxs(Q,{variant:"secondary",size:"sm",className:"mt-2 w-full border-danger/30 text-danger hover:bg-danger-soft",onClick:s,children:[e.similarCount," similar messages"]})]})}function ws({icon:e,label:s,active:n,danger:a,onClick:r,pending:o}){const i=r===void 0||o===!0;return t.jsxs("button",{type:"button",onClick:r,disabled:i,className:E("flex items-center gap-2 rounded-md border px-2 py-1 text-xs transition-colors",n?"border-accent-2 bg-accent-2-soft text-accent-2":"border-line text-fg-muted hover:border-line-strong hover:text-fg",a&&!n&&"text-danger hover:bg-danger-soft",i&&"cursor-not-allowed opacity-50 hover:border-line"),children:[e,s]})}const _l={sender:"matched: sender",recipient:"matched: recipient",subject:"matched: subject",attachment:"matched: attachment",body:"matched: body",entities:"matched: entities"};function ha({data:e,onClose:s,onShowSimilar:n,actions:a,similarState:r="ready",similarLinkComponent:o,className:i,hideCloseButton:c=!1,reportSpamPending:u=!1,notSpamPending:b=!1,calendar:v,tab:j,onTabChange:g,defaultTab:p="sender",touch:m}){const{sender:f,authenticity:d,category:h,flags:y={},similar:x}=e,[k,C]=l.useState(p),I=l.useId(),M=j??k,w=v!==void 0&&M==="calendar"?v:void 0;return t.jsxs("aside",{className:E("flex w-76 shrink-0 flex-col overflow-y-auto border-l border-line bg-surface",i),children:[t.jsxs("header",{className:"flex h-pane-header shrink-0 items-center justify-between border-b border-line px-row-inset",children:[t.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Intelligence"}),!c&&t.jsx(Q,{variant:"ghost",size:"sm",icon:t.jsx(qe,{className:"size-3.5"}),onClick:s,"aria-label":"Collapse intelligence sidebar"})]}),v&&t.jsx("div",{className:"flex shrink-0 justify-center border-b border-line px-row-inset py-2",children:t.jsx(ur,{name:I,"aria-label":"What this panel is showing",size:"sm",options:Dl,value:M,onChange:N=>{j===void 0&&C(N),g?.(N)}})}),w&&t.jsx(Ll,{data:w.data,actions:w.actions,selectedEventId:w.selectedEventId,touch:m}),w===void 0&&t.jsxs(t.Fragment,{children:[t.jsx(xe,{label:"Sender",children:t.jsx(zl,{sender:f})}),t.jsx(xe,{label:"Authenticity",children:t.jsx(Pl,{auth:d,onShowSimilar:n})}),t.jsx(xe,{label:"Category",children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ye,{tone:En[h.value],children:Os[h.value]}),h.overridden&&t.jsx("span",{className:"text-2xs text-fg-subtle",children:"your override"}),t.jsx("button",{type:"button",className:E("ml-auto text-2xs text-accent hover:underline",!a?.onReclassify&&"cursor-not-allowed opacity-50 hover:no-underline"),disabled:!a?.onReclassify,onClick:a?.onReclassify,children:"reclassify"})]})}),t.jsxs(xe,{label:"Quick actions",children:[t.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[t.jsx(ws,{icon:t.jsx(He,{className:"size-3.5"}),label:"VIP",active:y.vip,onClick:a?.onToggleVip}),t.jsx(ws,{icon:t.jsx(ia,{className:"size-3.5"}),label:"Mute",active:y.muted,onClick:a?.onToggleMute}),a?.onNotSpam&&t.jsx(ws,{icon:t.jsx(hl,{className:"size-3.5"}),label:b?"Undoing…":"Not spam",active:!0,onClick:a.onNotSpam,pending:b}),a?.onReportSpam&&t.jsx(ws,{icon:t.jsx(gl,{className:"size-3.5"}),label:u?"Reporting…":"Report spam",danger:!0,onClick:a.onReportSpam,pending:u})]}),a?.onNotSpam&&t.jsx("p",{className:"mt-1.5 text-2xs text-fg-subtle",children:"You reported this message as spam"})]}),(r!=="ready"||x.length>0)&&t.jsx(xe,{label:"Similar messages",children:r==="loading"?t.jsx("div",{className:"animate-pulse space-y-2",children:Array.from({length:3}).map((N,T)=>t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{className:"h-3 w-3/4 rounded bg-surface-sunken"}),t.jsx("div",{className:"h-2.5 w-1/2 rounded bg-surface-sunken"})]},T))}):r==="error"?t.jsx("p",{className:"text-xs text-fg-subtle",children:"Similarity search unavailable"}):r==="off"?t.jsxs("div",{className:"space-y-1.5 text-xs text-fg-subtle",children:[t.jsx("p",{className:"text-fg-muted",children:mr}),t.jsx("p",{children:fr}),t.jsxs("p",{children:["Run"," ",t.jsx("code",{className:"rounded bg-surface-sunken px-1 py-px text-2xs text-fg-muted",children:hr})," ","on the server."]})]}):t.jsx("ul",{className:"-mx-1 space-y-1",children:x.map(N=>{const T="block w-full rounded-md px-1 py-1 text-left hover:bg-surface-sunken",A=`Open message from ${N.fromName||"unknown sender"}: ${N.subject}`,K=t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[t.jsx("span",{className:"truncate text-xs font-medium text-fg",children:N.fromName}),t.jsx("span",{className:"shrink-0 text-2xs text-fg-subtle tabular-nums",children:N.timeLabel})]}),t.jsx("div",{className:"truncate text-xs text-fg-muted",children:N.subject}),t.jsx("span",{className:"mt-1 inline-block rounded-full bg-surface-sunken px-1.5 py-px text-2xs text-fg-subtle",children:_l[N.matched]})]});return t.jsx("li",{children:o?o({mailboxId:N.mailboxId,threadId:N.threadId,messageId:N.id,className:T,ariaLabel:A,children:K}):t.jsx("div",{className:T,children:K})},N.id)})})}),t.jsx(xe,{label:"Coming soon",className:"border-b-0 opacity-70",children:t.jsxs("div",{className:"space-y-2",children:[t.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-dashed border-line p-2",children:[t.jsx(Qe,{className:"mt-0.5 size-3.5 shrink-0 text-fg-subtle"}),t.jsxs("div",{children:[t.jsx("div",{className:"text-xs font-medium text-fg-muted",children:"Suggested actions"}),t.jsx("div",{className:"text-2xs text-fg-subtle",children:'"Create a filter for messages like this" — on-device model'})]})]}),t.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-dashed border-line p-2",children:[t.jsx(Qe,{className:"mt-0.5 size-3.5 shrink-0 text-fg-subtle"}),t.jsxs("div",{children:[t.jsx("div",{className:"text-xs font-medium text-fg-muted",children:"Thread summary"}),t.jsx("div",{className:"text-2xs text-fg-subtle",children:"One-paragraph digest — Bedrock"})]})]})]})})]})]})}function Bl({open:e=!1,enabled:s=!0,onToggle:n,className:a}){return t.jsx(Q,{variant:"ghost",size:"sm",icon:t.jsx(Fn,{className:"size-4"}),title:"Intelligence","aria-label":e?"Hide intelligence sidebar":"Show intelligence sidebar","aria-pressed":e,disabled:!s,onClick:n,className:E(e&&"bg-accent-2-soft text-accent-2",a)})}function wf({hints:e=Uo,className:s}){return e.length===0?null:t.jsx("footer",{className:E("flex items-center gap-2 border-t border-line px-row-inset py-1 text-2xs text-fg-subtle",s),children:e.map(n=>t.jsx(Ul,{hint:n},n.label))})}function Ul({hint:e}){return t.jsxs("span",{className:"flex items-center gap-1",children:[e.keys.map(s=>t.jsx(Vo,{children:s},s)),t.jsx("span",{children:e.label})]})}function $l({hasThread:e,onUnavailable:s,unavailableHint:n,isStarred:a,showTriage:r=!0,onReply:o,onReplyAll:i,onForward:c,onDelete:u,onToggleStar:b,moveSlot:v,onMove:j,replyTitle:g="Reply (r)",replyAllTitle:p="Reply all (a)",forwardTitle:m="Forward (f)",deleteTitle:f="Move to Trash (#)",flagTitle:d="Star (s)",children:h,className:y}){const x=(k,C)=>()=>{if(!e||!C){s?.(k);return}C()};return t.jsxs("div",{className:"relative",children:[t.jsxs("header",{className:E("flex h-pane-header shrink-0 items-center gap-1 border-b border-line bg-surface px-3",y),children:[t.jsx(Q,{variant:"ghost",size:"sm",icon:t.jsx(kt,{className:"size-4"}),title:g,"aria-label":"Reply",onClick:x("reply",o)}),t.jsx(Q,{variant:"ghost",size:"sm",icon:t.jsx(fa,{className:"size-4"}),title:p,"aria-label":"Reply all",onClick:x("replyAll",i)}),t.jsx(Q,{variant:"ghost",size:"sm",icon:t.jsx(ma,{className:"size-4"}),title:m,"aria-label":"Forward",onClick:x("forward",c)}),r&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-1 h-4 w-px bg-line","aria-hidden":!0}),t.jsx(Q,{variant:"ghost",size:"sm",icon:t.jsx(ds,{className:"size-4"}),title:f,"aria-label":"Move to Trash",onClick:x("delete",u)}),v??t.jsx(Q,{variant:"ghost",size:"sm",icon:t.jsx(gt,{className:"size-4"}),title:"Move to mailbox","aria-label":"Move to mailbox",onClick:x("move",j)}),t.jsx(Q,{variant:"ghost",size:"sm",icon:t.jsx(He,{className:E("size-4",a&&"fill-warning text-warning")}),title:d,"aria-label":"Star","aria-pressed":a,onClick:x("flag",b)})]}),t.jsx("div",{className:"flex-1"}),h]}),n&&t.jsx("p",{role:"status",className:"border-b border-line bg-surface-sunken px-3 py-1 text-2xs text-fg-subtle",children:n})]})}const lt=e=>({shiftKey:e.shiftKey,metaKey:e.metaKey,ctrlKey:e.ctrlKey}),Zt=e=>e.shiftKey||e.metaKey||e.ctrlKey,Kl=e=>e.shiftKey?"range":e.metaKey||e.ctrlKey?"toggle":"open",ql=(e,s)=>!s&&e>0,Ql=(e,s,n)=>{const a=e.indexOf(n);if(a===-1)return[];const r=s===void 0?-1:e.indexOf(s);if(r===-1)return[n];const o=Math.min(r,a),i=Math.max(r,a);return e.slice(o,i+1)},Hl=(e,s,n,a)=>s!==void 0&&e.includes(s)?s:n!==void 0&&e.includes(n)?n:a,Wl=(e,s)=>{const n=new Set(s),a=new Set;for(const r of e)n.has(r)&&a.add(r);return a},Gl=(e,s,n)=>{if(e.length===0)return;const a=s===void 0?-1:e.indexOf(s);if(a===-1)return n>0?e[0]:e[e.length-1];const r=Math.min(Math.max(a+n,0),e.length-1);return e[r]},Vl=e=>{const[s,n]=l.useState(()=>new Set(e?.initialSelectedIds)),[a,r]=l.useState(void 0),o=l.useCallback(f=>s.has(f),[s]),i=l.useCallback(f=>{r(f),n(d=>{const h=new Set(d);return h.has(f)?h.delete(f):h.add(f),h})},[]),c=l.useCallback(f=>{r(f),n(d=>{if(d.has(f))return d;const h=new Set(d);return h.add(f),h})},[]),u=l.useCallback(f=>{n(d=>{if(!d.has(f))return d;const h=new Set(d);return h.delete(f),h})},[]),b=l.useCallback(f=>{n(new Set(f))},[]),v=l.useCallback(()=>{r(void 0),n(new Set)},[]),j=l.useCallback(f=>{n(d=>f.every(y=>d.has(y))?new Set:new Set(f))},[]),g=l.useCallback(f=>{r(f)},[]),p=l.useCallback(f=>{n(d=>{if(d.size===0)return d;const h=Wl(d,f);return h.size===d.size?d:h})},[]),m=l.useCallback((f,d,h)=>{const y=Hl(f,a,h,d);n(x=>{const k=Ql(f,y,d);if(k.length===0)return x;const C=new Set(x);for(const I of k)C.add(I);return C}),r(y)},[a]);return{selectedIds:s,selectedCount:s.size,hasSelection:s.size>0,isSelected:o,toggle:i,select:c,deselect:u,selectAll:b,clearSelection:v,toggleAll:j,selectRange:m,setAnchor:g,anchorId:a,intersectWith:p}},As={delete_failed:{label:"Not deleted",title:"This message was not deleted",detail:"Remit removed it here first, then refused to finish the delete on the mail server — most often because the Trash folder it was headed for is not there any more. The message is back in this folder because that is where the server still has it.",retryLabel:"Delete again",retryPendingLabel:"Deleting…"},move_failed:{label:"Not moved",title:"This message was not moved",detail:"Remit filed it here first, then could not finish the move on the mail server and stopped trying. The message is back in this folder because that is where the server still has it. The folder you picked is not recorded, so moving it again means choosing one.",retryLabel:"Move again",retryPendingLabel:"Moving…"}};function pa({settlement:e,className:s}){const n=As[e];return t.jsxs(ye,{tone:"danger",className:E("shrink-0",s),title:n.title,"data-settlement":e,children:[t.jsx(la,{className:"size-3 shrink-0","aria-hidden":!0}),t.jsx("span",{children:n.label})]})}function Jl({settlement:e,onRetry:s,action:n,retryPending:a,reportHref:r,className:o}){const i=As[e];return t.jsxs("div",{role:"alert","data-testid":"message-settlement-notice","data-settlement":e,className:E("flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-3 py-2 text-sm",o),children:[t.jsx(la,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"font-medium text-danger",children:i.title}),t.jsx("p",{className:"mt-1 break-words text-fg-muted",children:i.detail}),t.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-3",children:[n,s&&t.jsx("button",{type:"button",onClick:s,disabled:a,className:"font-medium text-accent hover:underline disabled:opacity-50",children:a?i.retryPendingLabel:i.retryLabel}),r&&t.jsx("a",{href:r,target:"_blank",rel:"noreferrer",className:"font-medium text-accent hover:underline",children:"Report an issue"})]})]})]})}const ga="outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",xa=({active:e,focused:s})=>E("relative flex h-8 w-full items-center gap-2 px-row-inset text-left",ga,e?"bg-accent-2-soft":s?"bg-surface-sunken":"hover:bg-surface-sunken",s&&!e&&"before:absolute before:inset-y-0 before:left-0 before:w-0.5 before:bg-accent-2"),Ct=({active:e,focused:s})=>E("relative flex w-full items-start gap-3 py-2 pl-5 pr-row-inset text-left transition-colors",ga,e?"bg-accent-2-soft":s?"bg-surface-sunken":"hover:bg-surface-sunken",s&&!e&&"before:absolute before:inset-y-0 before:left-0 before:w-0.5 before:bg-accent-2");function ba({thread:e}){const s=!e.isRead;return t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"flex w-4 shrink-0 items-center justify-center",children:e.suspicious?t.jsx(Ve,{className:"size-3.5 text-danger"}):e.starred?t.jsx(He,{className:"size-3 fill-warning text-warning"}):s?t.jsx("span",{className:"size-1.5 rounded-full bg-accent"}):null}),t.jsx("span",{className:E("w-36 shrink-0 truncate text-xs",s?"font-semibold text-fg":"text-fg-muted"),children:e.fromName}),t.jsxs("span",{className:"min-w-0 flex-1 truncate text-xs",children:[t.jsx("span",{className:E(s?"font-medium text-fg":"text-fg-muted"),children:e.subject}),t.jsxs("span",{className:"text-fg-subtle",children:[" — ",e.snippet]})]}),e.hasAttachment&&t.jsx(Bs,{className:"size-3 shrink-0 text-fg-subtle",role:"img","aria-label":"Has an attachment"}),e.settlement&&t.jsx(pa,{settlement:e.settlement}),t.jsx("span",{className:"w-11 shrink-0 text-right text-2xs text-fg-subtle tabular-nums",children:e.timeLabel})]})}function Xt(e,s){const n=s?.trim();if(!n)return e;const a=e.toLowerCase(),r=n.toLowerCase(),o=[];let i=0,c=a.indexOf(r,i),u=0;for(;c!==-1;)c>i&&o.push(e.slice(i,c)),o.push(t.jsx("mark",{className:"bg-transparent font-semibold text-fg",children:e.slice(c,c+r.length)},u++)),i=c+r.length,c=a.indexOf(r,i);return i<e.length&&o.push(e.slice(i)),o}function Yl({thread:e,badge:s,highlightQuery:n}){const a=!e.isRead;return t.jsxs("span",{className:"min-w-0 flex-1",children:[t.jsxs("span",{className:"flex items-baseline justify-between gap-2",children:[t.jsxs("span",{className:E("flex min-w-0 items-center gap-1.5 truncate text-sm",a?"font-semibold text-fg":"font-medium text-fg-muted"),children:[e.trust==="vip"&&t.jsx("span",{className:"size-1.5 shrink-0 rounded-full bg-accent-2"}),t.jsx("span",{className:"truncate",children:e.fromName}),e.messageCount!=null&&e.messageCount>1&&t.jsx("span",{className:"shrink-0 text-2xs font-normal text-fg-subtle",children:e.messageCount})]}),t.jsx("span",{className:"shrink-0 text-2xs text-fg-subtle tabular-nums",children:e.timeLabel})]}),t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:E("truncate text-sm",a?"text-fg":"text-fg-muted"),children:Xt(e.subject,n)}),e.suspicious&&t.jsx(Ve,{className:"size-3.5 shrink-0 text-danger"}),e.starred&&t.jsx(He,{className:"size-3 shrink-0 fill-warning text-warning"}),e.hasAttachment&&t.jsx(Bs,{className:"size-3 shrink-0 text-fg-subtle",role:"img","aria-label":"Has an attachment"})]}),t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:"line-clamp-1 min-w-0 flex-1 text-xs text-fg-subtle",children:Xt(e.snippet,n)}),e.category&&e.category!=="personal"&&t.jsx(ye,{tone:En[e.category],className:"shrink-0",children:pr(e.category)}),e.labels?.map(r=>t.jsx(gr,{label:r,className:"max-w-20"},r.labelId)),e.settlement&&t.jsx(pa,{settlement:e.settlement}),s]})]})}function Zl({thread:e,selection:s}){if(!s)return t.jsx(cs,{name:e.fromName,email:e.fromEmail,size:"sm"});const{checked:n,alwaysVisible:a}=s;return t.jsxs("span",{className:"relative size-7 shrink-0",children:[t.jsx(cs,{name:e.fromName,email:e.fromEmail,size:"sm",className:E("absolute inset-0 transition-opacity sm:group-hover:opacity-0",(n||a)&&"opacity-0")}),t.jsx("span",{role:"button",tabIndex:-1,onClick:s.onToggle,onKeyDown:r=>{r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),r.stopPropagation(),s.onToggle(r))},className:E("absolute inset-0 size-7 items-center justify-center rounded-full border transition-opacity",a?"flex":"hidden sm:flex",n?"bg-accent border-accent text-accent-fg opacity-100":a?"border-fg-subtle/40 bg-canvas opacity-100":"border-fg-subtle/40 bg-canvas opacity-0 group-hover:opacity-100"),"aria-label":n?"Deselect message":"Select message",children:n&&t.jsx(Ds,{className:"size-3"})})]})}function Nt({thread:e,selection:s,badge:n,highlightQuery:a}){const r=!e.isRead;return t.jsxs(t.Fragment,{children:[r&&t.jsx("span",{className:"absolute left-1.5 top-1/2 size-1.5 -translate-y-1/2 rounded-full bg-accent"}),t.jsx(Zl,{thread:e,selection:s}),t.jsx(Yl,{thread:e,badge:n,highlightQuery:a})]})}const va=e=>({...Bo,[xr]:"","data-message-id":e.id});function Sf({thread:e,active:s,focused:n,tabIndex:a,onClick:r}){return t.jsx("button",{type:"button",...va(e),tabIndex:a,onClick:r,className:xa({active:s,focused:n}),children:t.jsx(ba,{thread:e})})}function If({thread:e,active:s,focused:n,tabIndex:a,selection:r,onClick:o}){return t.jsx("button",{type:"button",...va(e),tabIndex:a,onClick:o,className:E("group",Ct({active:s,focused:n})),children:t.jsx(Nt,{thread:e,selection:r})})}let Ke;const ya=5e3;function ja(e){e.preventDefault(),Es()}function Es(){Ke!==void 0&&(clearTimeout(Ke),Ke=void 0,document.removeEventListener("contextmenu",ja,!0),document.removeEventListener("pointerup",Es,!0))}function Xl(){Ke===void 0?(document.addEventListener("contextmenu",ja,!0),document.addEventListener("pointerup",Es,!0)):clearTimeout(Ke),Ke=setTimeout(Es,ya)}let Ts;function ka(e){e.preventDefault(),e.stopPropagation(),rs()}function rs(){Ts!==void 0&&(clearTimeout(Ts),Ts=void 0,document.removeEventListener("click",ka,!0),document.removeEventListener("pointerdown",rs,!0))}function ec(){rs(),document.addEventListener("click",ka,!0),document.addEventListener("pointerdown",rs,!0),Ts=setTimeout(rs,ya)}const sc=500,tc=36,nc=e=>({delay:e,threshold:tc,triggerAllEvents:!0,pointer:{keys:!1}}),ac=e=>e.event.type==="pointerdown"&&e.first,rc={onPointerDown:e=>{e.pointerType!=="touch"&&e.pointerType!=="pen"||Xl()}};function oc({onLongPress:e,isDisabled:s,delayMs:n=sc,accessibilityDescription:a}){const r=br(o=>{ac(o)&&(ec(),e())},{...nc(n),enabled:!s});return{longPressProps:da(r(),rc,{"aria-description":a})}}const as="min-h-11 min-w-11 px-0";function Ca({hasThread:e,onReply:s,onReplyAll:n,onForward:a,isStarred:r,onToggleStar:o,onDelete:i,isRead:c,onToggleRead:u,moveSlot:b,overflowItems:v=[],onUnavailable:j,unavailableHint:g,className:p}){const m=(d,h)=>()=>{if(!e){j?.(d);return}h?.()},f=u?[{key:"toggle-read",label:c?"Mark as unread":"Mark as read",icon:c?t.jsx(Zo,{className:"size-4"}):t.jsx(jt,{className:"size-4"}),onSelect:m("toggleRead",u)}]:[];return t.jsxs("div",{className:E("relative",p),children:[t.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-0.5 bg-canvas px-1",children:[s&&t.jsx(Q,{variant:"ghost",size:"sm",icon:t.jsx(kt,{className:"size-5"}),onClick:m("reply",s),"aria-label":"Reply",title:"Reply",className:as}),n&&t.jsx(Q,{variant:"ghost",size:"sm",icon:t.jsx(fa,{className:"size-5"}),onClick:m("replyAll",n),"aria-label":"Reply all",title:"Reply all",className:as}),a&&t.jsx(Q,{variant:"ghost",size:"sm",icon:t.jsx(ma,{className:"size-5"}),onClick:m("forward",a),"aria-label":"Forward",title:"Forward",className:as}),t.jsx("div",{className:"flex-1"}),o&&t.jsx(Q,{variant:"ghost",size:"sm",icon:t.jsx(He,{className:E("size-5",r&&"fill-warning text-warning")}),onClick:m("star",o),"aria-label":r?"Unstar":"Star","aria-pressed":r,title:r?"Unstar":"Star",className:as}),b,i&&t.jsx(Q,{variant:"ghost",size:"sm",icon:t.jsx(ds,{className:"size-5"}),onClick:m("delete",i),"aria-label":"Move to Trash",title:"Move to Trash",className:as}),t.jsx(Xn,{triggerLabel:"More actions",items:[...f,...v]})]}),!e&&g&&t.jsx("p",{role:"status",className:"bg-surface-sunken px-3 py-1 text-2xs text-fg-subtle",children:g})]})}function Na({message:e,onClick:s,isFocused:n,isUnread:a,trailing:r}){const o=t.jsxs(t.Fragment,{children:[t.jsx(pt,{className:"size-3.5 shrink-0 text-fg-subtle"}),t.jsxs("div",{className:"relative shrink-0",children:[t.jsx(cs,{name:e.fromName,email:e.fromEmail,size:"md"}),a&&t.jsx("span",{className:"absolute -top-0.5 -right-0.5 size-2 rounded-full border border-canvas bg-accent"})]}),t.jsx("span",{className:E("w-36 shrink-0 truncate text-sm",a?"font-semibold text-fg":"font-medium text-fg-muted"),children:e.fromName}),t.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-fg-subtle",children:e.snippet}),r??t.jsx("span",{className:"shrink-0 text-2xs text-fg-subtle tabular-nums",children:e.dateLabel})]}),i=E("group flex h-section-row w-full items-center gap-3 border-b border-line px-2 text-left transition-colors hover:bg-surface-sunken lg:px-4",n&&"bg-surface-sunken ring-1 ring-inset ring-accent/30");return s?t.jsx("div",{role:"button",tabIndex:0,"aria-expanded":!1,onClick:s,onKeyDown:c=>{vr(c)&&(c.preventDefault(),s())},className:E(i,"cursor-pointer"),children:o}):t.jsx("div",{className:i,children:o})}function wa({message:e,warning:s,onHeaderClick:n,isFocused:a,senderBadge:r,trailing:o,to:i,indicators:c,actionMenu:u,actionBar:b,body:v}){const j=t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-baseline justify-between gap-2",children:[t.jsxs("span",{className:"text-sm font-semibold text-fg",children:[e.fromName,r]}),o??t.jsx("span",{className:"text-2xs text-fg-subtle",children:e.dateLabel})]}),t.jsx("div",{className:"text-xs text-fg-subtle",children:e.fromEmail}),i!==null&&t.jsx("div",{className:"text-xs text-fg-subtle",children:i??t.jsxs(t.Fragment,{children:["to ",e.toLabel]})})]});return t.jsxs("div",{className:"px-2 py-3 lg:px-4",children:[t.jsxs("div",{className:E("-mx-2 -my-1 flex items-start gap-3 rounded-sm px-2 py-1",a&&"ring-1 ring-inset ring-accent/30"),children:[n?t.jsx("button",{type:"button",onClick:n,"aria-expanded":!0,"aria-label":"Collapse message",className:"mt-1 shrink-0 text-fg-subtle transition-colors hover:text-fg",children:t.jsx(De,{className:"size-3.5"})}):t.jsx(De,{className:"mt-1 size-3.5 shrink-0 text-fg-subtle"}),t.jsx(cs,{name:e.fromName,email:e.fromEmail,size:"md"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[n?t.jsx("button",{type:"button",onClick:n,className:"w-full text-left",children:j}):j,c]}),u&&t.jsx("div",{className:"shrink-0",children:u})]}),s&&t.jsxs("div",{className:"mt-3 flex items-start gap-3 rounded-md bg-danger-soft p-3",children:[t.jsx(Ve,{className:"mt-0.5 size-4 shrink-0 text-danger"}),t.jsxs("div",{className:"text-sm text-fg",children:[t.jsx("span",{className:"font-semibold text-danger",children:"Caution: "}),s," ",t.jsx("button",{type:"button",className:"text-accent underline",children:"Why?"})]})]}),b&&t.jsx("div",{className:"mt-3 -mx-2 lg:-mx-4",children:b}),t.jsx(Xo,{children:v??t.jsx(ei,{className:"mt-3",html:e.bodyHtml,category:e.framed?"newsletter":"personal",allowImages:!0})})]})}function ic({thread:e,onBack:s,intelligence:n,intelligenceOpen:a,onToggleIntelligence:r,actions:o,children:i,onSwipeNext:c,onSwipePrevious:u}){const b=yr({onSwipeLeft:c,onSwipeRight:u}),[v,j]=l.useState(!1),g=r!==void 0,p=g?a??!1:v,m=!!n||g,f=()=>{if(g){r?.();return}j(h=>!h)},d=()=>{if(g){p&&r?.();return}j(!1)};return t.jsxs("article",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[t.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line bg-surface px-row-inset",children:[t.jsx(Q,{variant:"ghost",size:"sm",icon:t.jsx(Ln,{className:"size-4"}),onClick:s,"aria-label":"Back to messages",className:"-ml-1 shrink-0"}),t.jsx("h2",{className:"min-w-0 flex-1 truncate text-sm font-semibold text-fg",children:e.subject}),m&&t.jsx(Q,{variant:"ghost",size:"sm",icon:t.jsx(Fn,{className:"size-4"}),onClick:f,"aria-label":p?"Hide intelligence panel":"Show intelligence panel","aria-pressed":p,title:"Intelligence",className:E("shrink-0",p&&"bg-accent-2-soft text-accent-2")})]}),t.jsx(jr.Provider,{value:b.enabled,children:t.jsx("div",{ref:b.ref,className:"flex-1 overflow-y-auto",style:{touchAction:b.touchAction},...b.bind(),children:i??[...e.messages].reverse().map(h=>{const y=x=>x?()=>x(h.id):void 0;return h.expanded?t.jsx(wa,{message:h,warning:e.warning,onHeaderClick:y(o?.onToggleExpand),actionBar:t.jsx(Ca,{hasThread:!0,onReply:y(o?.onReply),onReplyAll:y(o?.onReplyAll),onForward:y(o?.onForward),onToggleStar:y(o?.onToggleStar),onDelete:y(o?.onDelete),onToggleRead:y(o?.onToggleRead),moveSlot:o?.moveSlot?.(h.id)})},h.id):t.jsx(Na,{message:h,onClick:y(o?.onToggleExpand)},h.id)})})}),n&&!g&&t.jsx(kr,{open:p,onClose:d,title:"Intelligence",anchor:"right",className:"p-0",children:t.jsx(ha,{data:n,onClose:d,className:"h-full w-full border-l-0"})})]})}function lc(e){return{id:e.id,fromName:e.sender,fromEmail:e.senderEmail??e.sender,subject:e.subject,snippet:e.snippet,timeLabel:e.date,isRead:!e.unread,starred:e.flagged,...e.mailboxId?{mailboxId:e.mailboxId}:{}}}function cc({result:e,onClick:s,query:n,showFolder:a=!0}){const r=a&&e.folder?Cr(e.folder):void 0;return t.jsx("button",{type:"button",onClick:s,className:E("group",Ct({}),"border-b border-line"),children:t.jsx(Nt,{thread:lc(e),highlightQuery:n,badge:t.jsxs(t.Fragment,{children:[r&&t.jsx(ye,{tone:"neutral",className:"shrink-0",children:r}),e.category&&t.jsx(ye,{tone:e.category.tone??"neutral",className:"shrink-0",children:e.category.label}),e.matchedChunkLabel&&t.jsx(ye,{tone:"neutral",className:"shrink-0",children:`matched: ${e.matchedChunkLabel}`}),e.score!=null&&t.jsx("span",{className:"shrink-0 text-2xs text-fg-subtle tabular-nums",children:e.score.toFixed(2)})]})})})}const dc=e=>e===1?"result":"results";function uc({count:e,onScopeToSpam:s}){return t.jsx(Dn,{tone:"info",variant:"soft",className:"items-center justify-between gap-3 rounded-none border-b border-line",children:t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("p",{className:"min-w-0 text-xs text-fg-muted",children:e.kind==="exact"?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"font-semibold text-fg tabular-nums",children:e.value.toLocaleString()})," ",`${dc(e.value)} from Spam`]}):"Results from Spam"}),t.jsx(Q,{variant:"ghost",size:"sm",onClick:s,className:"shrink-0 text-accent",children:"Go to Spam"})]})})}const en=6,mc={kind:"global"},sn={kind:"unknown"},fc=e=>e.kind==="folder"&&e.role==="junk",hc=e=>e.folder?.role==="junk";function pc(e){const s=[],n=[];for(const a of e)hc(a)?n.push(a):s.push(a);return{kept:s,spam:n}}function Sa({onClick:e,blockedReason:s}){const n=l.useId(),[a,r]=l.useState(!1);return t.jsxs("div",{className:"border-b border-line px-row-inset py-1.5",children:[t.jsxs("button",{type:"button",onClick:()=>{if(s){r(!0);return}e()},"aria-describedby":s?n:void 0,className:E("flex w-full items-center gap-1.5 rounded-md px-2 py-1.5 text-left text-xs font-medium transition-colors",s?"text-fg-subtle opacity-55":"text-accent hover:bg-surface-sunken"),children:[t.jsx(Nr,{className:"size-3.5 shrink-0","aria-hidden":"true"}),t.jsx("span",{children:"Make this a filter"})]}),s&&t.jsx(wr,{id:n,reason:s,nudged:a,className:"px-2 pt-1 text-2xs text-warning"})]})}function gc({section:e,query:s,onSelectResult:n,showFolder:a}){const[r,o]=l.useState(e.initialCollapsed??!1),[i,c]=l.useState(!1),u=e.results.length>en,v=!i&&u?e.results.slice(0,en):e.results,j=e.results.length-v.length;return t.jsxs("div",{children:[t.jsxs("button",{type:"button","aria-expanded":!r,onClick:()=>o(g=>!g),className:"sticky top-0 z-10 flex h-section-row w-full items-center gap-1.5 border-b border-line bg-surface-sunken px-row-inset text-left transition-colors hover:bg-surface",children:[t.jsx("span",{className:"flex-1 text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:e.label}),t.jsx("span",{className:"text-2xs text-fg-subtle tabular-nums",children:e.results.length}),t.jsx(De,{className:E("size-3 shrink-0 text-fg-subtle transition-transform duration-200",r?"rotate-0":"rotate-180")})]}),!r&&t.jsxs(t.Fragment,{children:[v.map(g=>t.jsx(cc,{result:g,query:s,showFolder:a,onClick:n?()=>n(g):void 0},g.id)),u&&t.jsxs("button",{type:"button",onClick:()=>c(g=>!g),className:"flex w-full items-center justify-center border-b border-line px-row-inset py-1.5 text-2xs font-medium text-accent transition-colors hover:bg-surface",children:[i?"Show less":`Show ${j} more`,!i&&t.jsx(De,{className:"ml-1 size-3"})]})]})]})}function Ia({value:e,recentSearches:s,onPickRecent:n,sections:a,loading:r,onSelectResult:o,tokens:i,scope:c=mc,makeFilter:u}){if(!(e.trim().length>0))return s&&s.length>0?t.jsxs("div",{className:"flex flex-col",children:[t.jsx("h3",{className:"px-row-inset pb-1 pt-3 text-2xs font-semibold uppercase tracking-wide text-fg-subtle",children:"Recent searches"}),s.map(N=>t.jsxs("button",{type:"button",onClick:()=>n?.(N),className:"flex w-full items-center gap-2.5 border-b border-line px-row-inset py-2.5 text-left transition-colors hover:bg-surface-sunken",children:[t.jsx(oa,{className:"size-4 shrink-0 text-fg-subtle"}),t.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-fg-muted",children:N})]},N))]}):t.jsx("p",{className:"px-row-inset py-6 text-center text-sm text-fg-subtle",children:"Search across your mail by sender, subject or words in the message."});const v=i&&i.length>0&&t.jsx(Sr,{tokens:i}),j=u&&t.jsx(Sa,{...u});if(r)return t.jsxs("div",{className:"flex flex-col",children:[j,v,t.jsx("div",{className:"flex flex-col gap-3 px-row-inset py-4",children:[0,1,2,3].map(N=>t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsx("div",{className:"h-3 w-1/3 animate-pulse rounded bg-surface-sunken"}),t.jsx("div",{className:"h-3 w-2/3 animate-pulse rounded bg-surface-sunken"}),t.jsx("div",{className:"h-2.5 w-1/2 animate-pulse rounded bg-surface-sunken"})]},N))})]});const g=c.kind==="global",p=fc(c)||c.kind==="collection",m=g||c.kind==="collection",f=(a??[]).map(N=>{if(p)return{section:N,spam:[]};const{kept:T,spam:A}=pc(N.results);return{section:{...N,results:T},spam:A}}),d=f.map(N=>N.section),h=f.reduce((N,T)=>N+T.spam.length,0),x=(c.kind==="global"?c.spamCount:void 0)??sn,k=h>0||x.kind==="exact"&&x.value>0,I=x.kind==="exact"&&x.value===0&&h>0?sn:x,M=c.kind==="global"&&k&&c.onScopeToSpam!==void 0?t.jsx(uc,{count:I,onScopeToSpam:c.onScopeToSpam}):void 0;return d.some(N=>N.results.length>0)?t.jsxs("div",{className:"flex flex-col",children:[j,v,M,d.filter(N=>N.results.length>0).map(N=>t.jsx(gc,{section:N,query:e,showFolder:m,onSelectResult:o},N.id))]}):t.jsxs("div",{className:"flex flex-col",children:[j,v,M,t.jsxs("div",{className:"px-row-inset py-10 text-center",children:[t.jsxs("p",{className:"text-sm font-medium text-fg",children:["No matches for “",e,"”"]}),t.jsx("p",{className:"mt-1 text-xs text-fg-subtle",children:"Try a different word, or adjust the filters above."})]})]})}function xc({value:e,onChange:s,onClear:n,onCancel:a,filter:r,recentSearches:o,onPickRecent:i,sections:c,loading:u,onSelectResult:b,tokens:v,chips:j,onRemoveChip:g,scope:p,makeFilter:m,suggest:f,suggestList:d}){const h=t.jsx(Ia,{value:e,recentSearches:o,onPickRecent:i,sections:c,loading:u,onSelectResult:b,tokens:v,scope:p,makeFilter:m});return t.jsxs("article",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[t.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line bg-surface px-row-inset",children:[t.jsx("div",{className:"min-w-0 flex-1",children:t.jsx(Zn,{value:e,onChange:s,onClear:n,chips:j,onRemoveChip:g,globalFocusKey:!1,showClearButton:!1,suggest:f})}),t.jsx(Q,{variant:"ghost",size:"sm",icon:t.jsx(qe,{className:"size-4"}),onClick:a,"aria-label":"Clear and close search",className:"-mr-1 shrink-0"})]}),d,r&&e.trim().length===0?t.jsx(Ir,{children:t.jsx(Tn,{...r,children:h})}):t.jsx("div",{className:"flex-1 overflow-y-auto",children:h})]})}const tn=e=>e.toLocaleString();function nn({selectAll:e,selecting:s,className:n}){return t.jsx(tl,{className:n,checked:e.checked,indeterminate:e.indeterminate,onChange:e.onChange,label:t.jsx("span",{className:"font-medium text-accent",children:e.checked&&s?"Deselect all":"Select all"})})}function bc({title:e,count:s,onCancel:n,onDelete:a,onMove:r,onOrganize:o,onJunk:i,onMarkRead:c,navSlot:u,titleMeta:b,searchSlot:v,searchField:j,idleSlot:g,overflowSlot:p,isBusy:m=!1,isCounting:f=!1,selectAll:d,statusLabel:h,progress:y,notice:x}){const k=s>0||f,C=d?.checked?`All ${tn(s)} loaded selected`:`${tn(s)} ${s===1?"message":"messages"} selected`,I=[];return i&&!m&&!f&&I.push({key:"junk",label:"Junk",icon:t.jsx(Ve,{className:"size-4"}),onSelect:i}),c&&!m&&!f&&I.push({key:"mark-read",label:"Mark read",icon:t.jsx(jt,{className:"size-4"}),onSelect:c}),t.jsxs("header",{"data-selection-bar":"",className:"flex shrink-0 flex-col border-b border-line bg-surface-sunken",children:[t.jsxs("div",{"data-selection-bar-row":"actions",className:"flex h-pane-header items-center gap-1 px-row-inset",children:[k?t.jsx(Q,{variant:"ghost",size:"touch",icon:t.jsx(Ln,{className:"size-5"}),onClick:n,"aria-label":"Cancel selection",className:"-ml-2 shrink-0"}):u,d&&t.jsx(nn,{selectAll:d,selecting:k,className:"hidden shrink-0 pr-2 md:flex"}),k?t.jsx("span",{"data-selection-count":"",className:"min-w-0 flex-1 truncate px-1 text-sm font-medium text-fg",role:"status","aria-live":"polite",children:h??C}):j?t.jsx("div",{className:"flex min-w-0 flex-1 items-center gap-1",children:j}):t.jsxs(t.Fragment,{children:[t.jsx("h1",{className:"min-w-0 flex-1 truncate px-1 text-sm font-semibold text-fg",children:e}),b,v]}),k&&!f&&t.jsxs(t.Fragment,{children:[t.jsx(Q,{variant:"ghost",size:"touch",icon:m?t.jsx(Mn,{className:"size-5 animate-spin"}):t.jsx(ds,{className:"size-5 text-danger"}),onClick:m?void 0:a,"aria-label":"Move selected messages to Trash","aria-busy":m||void 0,className:"shrink-0"}),!m&&r&&t.jsx(Q,{variant:"ghost",size:"touch",icon:t.jsx(gt,{className:"size-5"}),onClick:r,"aria-label":"Move selected messages",className:"shrink-0"}),!m&&o&&t.jsx(Q,{variant:"ghost",size:"touch",icon:t.jsx(Qe,{className:"size-5"}),onClick:o,"aria-label":"Organize selected messages",className:"shrink-0"})]}),k&&t.jsx(Xn,{triggerLabel:"More actions",items:I,className:"shrink-0",children:!m&&!f&&p})]}),!k&&g,k&&d&&t.jsx("div",{"data-selection-bar-row":"select-all",className:"px-row-inset pb-2 md:hidden",children:t.jsx(nn,{selectAll:d,selecting:k,className:"w-full"})}),y&&t.jsx("div",{className:"px-row-inset pb-2",children:t.jsx(Rr,{value:y.value,max:y.max,tone:y.tone})}),x&&t.jsx(Dn,{"data-selection-notice":"",tone:x.tone,variant:"soft",role:"status","aria-live":"polite",className:"mx-row-inset mb-2",children:t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[x.text&&t.jsx("span",{children:x.text}),x.action&&t.jsx(Q,{variant:"ghost",size:"md",onClick:x.action.onClick,className:"-my-1 min-h-11 shrink-0",children:x.action.label})]})})]})}const Ra={id:"unread",label:"Unread"},vc={id:"flagged",label:"Starred"},Ma={id:"attachment",label:"Has attachment"};function yc(e){if(!(e.length<=1))return e.map(s=>({id:s.id,label:s.label,count:s.count,active:s.active}))}function Rf(e=[]){return{categories:[...Ls],filters:An,sources:yc(e)}}function Mf(){return{categories:[...Ls],filters:[Ra,vc,Ma]}}function Tf(){return{categories:[...Ls],filters:[Ra,Ma]}}function jc(e,s){return e.endsWith(s)?e.length===s.length||e[e.length-s.length-1]===".":!1}function kc(e,s){const n=e.length-s.length-2,a=e.lastIndexOf(".",n);return a===-1?e:e.slice(a+1)}function Cc(e,s,n){if(n.validHosts!==null){const r=n.validHosts;for(const o of r)if(jc(s,o))return o}let a=0;if(s.startsWith("."))for(;a<s.length&&s[a]===".";)a+=1;return e.length===s.length-a?null:kc(s,e)}const tt=/[\t\n\r]/g;let ct=!1;function an(e){return e>=97&&e<=122||e>=48&&e<=57||e>127||e>=65&&e<=90||e===45||e===95}function rn(e,s,n){const a=n-s,r=e.charCodeAt(s)|32;if(a===2)return r===119&&(e.charCodeAt(s+1)|32)===115?1:0;if(a===3){const o=e.charCodeAt(s+1)|32,i=e.charCodeAt(s+2)|32;return r===119&&o===115&&i===115||r===102&&o===116&&i===112?1:0}else if(a===4){const o=e.charCodeAt(s+1)|32,i=e.charCodeAt(s+2)|32,c=e.charCodeAt(s+3)|32;return r===104&&o===116&&i===116&&c===112?1:r===102&&o===105&&i===108&&c===101?2:0}else if(a===5)return r===104&&(e.charCodeAt(s+1)|32)===116&&(e.charCodeAt(s+2)|32)===116&&(e.charCodeAt(s+3)|32)===112&&(e.charCodeAt(s+4)|32)===115?1:0;return 0}function os(e,s,n=!1){let a=0,r=e.length,o=!1,i=!1;if(ct=!1,!s){if(e.startsWith("data:"))return null;for(;a<e.length&&e.charCodeAt(a)<=32;)a+=1;for(;r>a+1&&e.charCodeAt(r-1)<=32;)r-=1;if(e.charCodeAt(a)===47&&e.charCodeAt(a+1)===47)a+=2;else{const d=e.indexOf(":/",a);if(d!==-1){const h=rn(e,a,d);if(h===1)for(i=!0,a=d+2;e.charCodeAt(a)===47||e.charCodeAt(a)===92;)a+=1;else if(h===2){i=!0,a=d+1;let y=0;for(;(e.charCodeAt(a)===47||e.charCodeAt(a)===92)&&y<2;)a+=1,y+=1;if(y<2)return null}else{for(let y=a;y<d;y+=1){const x=e.charCodeAt(y)|32;if(!(x>=97&&x<=122||x>=48&&x<=57||x===46||x===45||x===43)){const k=e.charCodeAt(y);return k===9||k===10||k===13?os(e.replace(tt,""),s,n):null}}if(e.charCodeAt(d+2)===47)a=d+3;else return null}}else if(e.charCodeAt(a)!==91){let h=-1;for(let y=a;y<r;y+=1){const x=e.charCodeAt(y);if(x===9||x===10||x===13)return os(e.replace(tt,""),s,n);if(x===58){h=y;break}if(x===47||x===92||x===63||x===35)break}if(h!==-1){let y=!1;for(let x=h+1;x<r;x+=1){const k=e.charCodeAt(x);if(k===47||k===92||k===63||k===35)break;if(k===64){y=!0;break}}if(!y){let x=!0,k=h+1;for(;k<r;k+=1){const C=e.charCodeAt(k);if(C===47||C===92||C===63||C===35)break;if(C<48||C>57){x=!1;break}}if(k===h+1&&(x=!1),!x){const C=rn(e,a,h);if(C===0){let I=!1;for(let M=h+1;M<r;M+=1){const w=e.charCodeAt(M);if(w===47||w===92||w===63||w===35)break;if(w===58){I=!0;break}}if(!I)return null}else if(i=!0,a=h+1,C===2){let I=0;for(;(e.charCodeAt(a)===47||e.charCodeAt(a)===92)&&I<2;)a+=1,I+=1;if(I<2)return null}else for(;e.charCodeAt(a)===47||e.charCodeAt(a)===92;)a+=1}}}}}let u=-1,b=-1,v=-1,j=-1,g=!1,p=n,m=a-1,f=-1;if(n&&a<r){const d=e.charCodeAt(a);(!(an(d)||d===46||d===95)||d===45)&&(p=!1)}for(let d=a;d<r;d+=1){const h=e.charCodeAt(d);if(h<64)if(h===47||h===35||h===63){r=d;break}else h===58?(j===-1&&(j=d),v=d):h===9||h===10||h===13?g=!0:n&&(h===46?((d-m>64||f===46||f===45)&&(p=!1),m=d):(h<48||h>57)&&(h!==45||f===46)&&(p=!1));else if(i&&h===92){r=d;break}else h===64?(u=d,j=-1):h===93?b=d:h>=65&&h<=90?o=!0:n&&!an(h)&&(p=!1);n&&(f=h)}if(g)return os(e.replace(tt,""),s,n);if(u!==-1&&u>=a&&u<r&&(a=u+1),e.charCodeAt(a)===91)return b!==-1?e.slice(a+1,b).toLowerCase():null;if(v!==-1&&v>a&&v<r&&j===v&&(r=v),a>=r)return null;n&&p&&u===-1&&v===-1&&b===-1&&e.charCodeAt(r-1)!==46&&r-a<=255&&r-m-1<=63&&f!==45&&(ct=!0)}for(;r>a+1&&e.charCodeAt(r-1)===46;)r-=1;const c=a!==0||r!==e.length?e.slice(a,r):e;return o?c.toLowerCase():c}function Nc(e){if(e.length<7||e.length>15)return!1;let s=0;for(let n=0;n<e.length;n+=1){const a=e.charCodeAt(n);if(a===46)s+=1;else if(a<48||a>57)return!1}return s===3&&e.charCodeAt(0)!==46&&e.charCodeAt(e.length-1)!==46}function wc(e){if(e.length<3)return!1;let s=e.startsWith("[")?1:0,n=e.length;if(e[n-1]==="]"&&(n-=1),n-s>39)return!1;let a=!1;for(;s<n;s+=1){const r=e.charCodeAt(s);if(r===58)a=!0;else if(!(r>=48&&r<=57||r>=97&&r<=102||r>=65&&r<=70))return!1}return a}function Sc(e){return wc(e)||Nc(e)}function on(e){return e>=97&&e<=122||e>=48&&e<=57||e>127}function ln(e){if(e.length>255||e.length===0||!on(e.charCodeAt(0))&&e.charCodeAt(0)!==46&&e.charCodeAt(0)!==95)return!1;let s=-1,n=-1;const a=e.length;for(let r=0;r<a;r+=1){const o=e.charCodeAt(r);if(o===46){if(r-s>64||n===46||n===45)return!1;s=r}else if(!(on(o)||o===45||o===95)||o===45&&n===46)return!1;n=o}return a-s-1<=63&&n!==45}function Ic({allowIcannDomains:e=!0,allowPrivateDomains:s=!1,detectIp:n=!0,detectSpecialUse:a=!1,extractHostname:r=!0,mixedInputs:o=!0,validHosts:i=null,validateHostname:c=!0}){return{allowIcannDomains:e,allowPrivateDomains:s,detectIp:n,detectSpecialUse:a,extractHostname:r,mixedInputs:o,validHosts:i,validateHostname:c}}const Rc=Ic({});function Mc(e){return Rc}function Tc(){return{domain:null,domainWithoutSuffix:null,hostname:null,isIcann:null,isIp:null,isPrivate:null,isSpecialUse:null,publicSuffix:null,subdomain:null}}function Ac(e){e.domain=null,e.domainWithoutSuffix=null,e.hostname=null,e.isIcann=null,e.isIp=null,e.isPrivate=null,e.isSpecialUse=null,e.publicSuffix=null,e.subdomain=null}function Ec(e,s,n,a,r){const o=Mc();if(typeof e!="string")return r;let i=!1;return o.extractHostname?o.mixedInputs?(i=ln(e),r.hostname=os(e,i,o.validateHostname)):r.hostname=os(e,!1,o.validateHostname):r.hostname=e,o.detectIp&&r.hostname!==null&&(r.isIp=Sc(r.hostname),r.isIp)?r:o.validateHostname&&o.extractHostname&&r.hostname!==null&&!(i&&r.hostname===e)&&!ct&&!ln(r.hostname)?(r.hostname=null,r):(r.hostname===null||(n(r.hostname,o,r),r.publicSuffix===null)||(r.domain=Cc(r.publicSuffix,r.hostname,o)),r)}const cn=Tc();function Fc(e,s){return Ac(cn),Ec(e,3,Mr,s,cn).domain}const $s=e=>{const s=new Set,n=[];for(const a of e){const r=a.trim();if(r==="")continue;const o=r.toLowerCase();s.has(o)||(s.add(o),n.push(r))}return n},Lc=e=>{const s=e.lastIndexOf("@");return s>=0?e.slice(s+1):e},Ta=e=>Fc(Lc(e.trim())),Dc=e=>{const s=$s(e);if(s.length<2)return null;let n=null;for(const a of s){const r=Ta(a);if(r===null)return null;if(n===null)n=r;else if(n!==r)return null}return n},Oc=e=>{const s=Dc(e);return s!==null?[{field:"FromDomain",value:s}]:$s(e).map(n=>({field:"From",value:n}))},zc=e=>{const s=new Map;for(const r of e){const o=r.normalizedEmail.trim().toLowerCase();if(o==="")continue;const i=s.get(o);i?i.count+=1:s.set(o,{sender:r,count:1})}let n,a=0;for(const{sender:r,count:o}of s.values())o<=a||(n=r,a=o);return n},Aa=e=>e.displayName?.trim()||e.normalizedEmail,Pc=/^\s*(?:(?:re|aw|fwd?|vs|sv|antw|res|enc|tr)\s*(?:\[\d+\])?\s*:|\[[^\]]{1,32}\])\s*/i,_c=e=>{let s=e.replace(/\s+/g," ").trim();for(;;){const n=s.replace(Pc,"");if(n===s)return s.trim();s=n}},Bc=new Set(["a","an","and","are","as","at","be","by","for","from","has","have","in","is","it","me","my","new","of","on","or","our","the","this","to","was","we","with","you","your"]),Uc=3,nt=e=>e.split(" ").filter(s=>s!==""),dn=e=>e.length===0||e.join(" ").length<Uc?!1:e.some(s=>!Bc.has(s.toLowerCase())),$c=(e,s)=>e.findIndex((n,a)=>s.every((r,o)=>e[a+o]?.toLowerCase()===r.toLowerCase())),Kc=e=>{const s=e.map(_c).filter(o=>o!=="");if(s.length===0)return;const[n,...a]=s;if(a.length===0)return dn(nt(n))?n:void 0;const r=nt(n);for(let o=r.length;o>0;o-=1)for(let i=0;i+o<=r.length;i+=1){const c=r.slice(i,i+o);if(dn(c)&&a.every(u=>$c(nt(u),c)>=0))return c.join(" ")}},wt=(e,s)=>{const n=Oc(e);if($s(e).length===1||n.length===1&&n[0].field==="FromDomain")return n;const a=Kc(s);return a!==void 0?[{field:"Subject",value:a}]:n},qc=({match:e,sender:s,folder:n})=>{const a=e??s;return a?n?`${a} → ${n}`:e?`Mail matching ${e}`:`Mail from ${a}`:n?`Mail to ${n}`:""},Qc=e=>e.clauses.length>0,Hc=e=>({scopedOutFolder:e.scopedOut?.label,droppedFacets:e.droppedFacets.map(s=>s.label),droppedSemantic:e.droppedSemantic}),Wc=({orderedIds:e,isDesktop:s,initialFocusedId:n,initialSelectedIds:a,onExitSelection:r})=>{const[o,i]=l.useState(n),[c,u]=l.useState(),b=l.useCallback(F=>{u(z=>z===F?z:void 0),i(F)},[]),v=Vl({initialSelectedIds:a}),{selectedCount:j,toggle:g,clearSelection:p,selectRange:m,setAnchor:f,selectAll:d}=v,h=ql(j,s),y=l.useRef(null),x=l.useRef(!1),k=l.useCallback(()=>{r?.(),p()},[p,r]),C=l.useMemo(()=>o?e.indexOf(o):-1,[e,o]),I=l.useCallback(F=>{if(F<0||F>=e.length)return;const z=e[F];if(h){g(z);return}y.current=z,x.current=!1,u(z),i(z)},[e,h,g]),M=l.useCallback(()=>{e.length!==0&&I(C<0?0:Math.min(C+1,e.length-1))},[e.length,C,I]),w=l.useCallback(()=>{e.length!==0&&I(C<=0?0:C-1)},[e.length,C,I]),N=l.useCallback(()=>I(0),[I]),T=l.useCallback(()=>I(e.length-1),[I,e.length]),A=l.useCallback(()=>{o&&g(o)},[o,g]),K=l.useCallback((F,z)=>{const _=Kl(z);return _==="range"?(m(e,F,o),!0):_==="toggle"?(g(F),!0):(k(),f(F),!1)},[e,o,m,g,k,f]),L=l.useCallback(F=>{const z=Gl(e,o,F);z!==void 0&&(m(e,z),y.current=z,x.current=!1,u(void 0),i(z))},[e,o,m]),W=l.useCallback(()=>L(-1),[L]),P=l.useCallback(()=>L(1),[L]),$=l.useCallback(()=>{e.length>0&&d(e)},[e,d]);return{focusedMessageId:o,setFocusedMessageId:b,keyboardFocusedMessageId:c,focusIndex:C,pendingDomFocusRef:y,cursorMovedByPointerRef:x,selection:v,isMultiSelectMode:h,exitSelection:k,moveFocusToIndex:I,focusNext:M,focusPrevious:w,focusFirst:N,focusLast:T,toggleFocusedSelection:A,extendRangeUp:W,extendRangeDown:P,selectAllLoaded:$,handleRowSelect:K}};function Gc(e,s){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in e)return e;if(typeof e=="function")return{shouldBlockFn:async()=>await e(),enableBeforeUnload:!0,withResolver:!1};const n=!!(e.condition??!0),a=e.blockerFn;return{shouldBlockFn:async()=>n&&a!==void 0?await a():n,enableBeforeUnload:n,withResolver:a===void 0}}function Vc(e,s){const{shouldBlockFn:n,enableBeforeUnload:a=!0,disabled:r=!1,withResolver:o=!1}=Gc(e),i=Tr(),{history:c}=i,[u,b]=l.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return l.useEffect(()=>{const v=async j=>{function g(h){const y=i.parseLocation(h),x=i.getMatchedRoutes(y.pathname);return x.foundRoute===void 0?{routeId:"__notFound__",fullPath:y.pathname,pathname:y.pathname,params:x.routeParams,search:i.options.parseSearch(h.search)}:{routeId:x.foundRoute.id,fullPath:x.foundRoute.fullPath,pathname:y.pathname,params:x.routeParams,search:i.options.parseSearch(h.search)}}const p=g(j.currentLocation),m=g(j.nextLocation);if(p.routeId==="__notFound__"&&m.routeId!=="__notFound__")return!1;const f=await n({action:j.action,current:p,next:m});if(!o)return f;if(!f)return!1;const d=await new Promise(h=>{b({status:"blocked",current:p,next:m,action:j.action,proceed:()=>h(!1),reset:()=>h(!0)})});return b({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),d};return r?void 0:c.block({blockerFn:v,enableBeforeUnload:a})},[n,a,r,o,c,i]),u}function Af(){const{insertIntoOpenReply:e}=On(),s=zn();return l.useCallback((n,a)=>{e(n.messageId,a)||s({...n,mode:"reply"},{body:a})},[e,s])}const Ks=e=>{const{data:s,isLoading:n}=se({...We(),staleTime:1/0,enabled:!!e}),a=l.useMemo(()=>(s?.accounts??[]).map(c=>c.accountId),[s?.accounts]),r=yt({queries:a.map(c=>({...us({path:{accountId:c}}),staleTime:1/0,enabled:!!e}))}),o=n||r.some(c=>c.isLoading);return{accountId:l.useMemo(()=>{if(e){for(let c=0;c<a.length;c++)if((r[c].data?.items??[]).some(v=>v.mailboxId===e))return a[c]}},[e,a,r]),isLoading:o}},Jc=({surface:e})=>{const s=Ar(),n=Er(),{registerOpenReply:a}=On(),[r,o]=l.useState(),i=l.useCallback(g=>o(p=>({version:(p?.version??0)+1,text:g})),[]),c=e.sourceMessageId;l.useEffect(()=>a(c,i),[c,i,a]);const{data:u}=se({...zs({path:{messageId:e.sourceMessageId}})}),{data:b}=se({...We(),staleTime:1/0}),{accountId:v}=Ks(u?.message.mailboxId),j=b?.accounts?.find(g=>g.accountId===v);return t.jsx("div",{className:"border-b border-line bg-canvas",children:t.jsx(ii,{layout:"flow",mode:e.mode,account:j,sourceMessage:u,outboxMessageId:e.outboxMessageId,seed:e.seed,insertion:r,onDraftCreated:s,onClose:n},e.sourceMessageId)})},Yc=3e3,Zc=(e,s,n)=>{if(e.length===0)return()=>{};const a=setTimeout(()=>n(e),s);return()=>clearTimeout(a)},St=(e,s,n)=>{const a=new Map(s.map(o=>[o.messageId,o.mailboxId])),r=new Set;for(const o of e)r.add(a.get(o)??n);return[...r]},Fs=(e,s,n)=>e.map(a=>s.has(a.messageId)?{...a,isRead:n}:a),Xc=(e,s,n,a)=>e.filter(r=>!r.isRead&&s.has(r.threadMessageId)&&!n.has(r.messageId)&&!a.has(r.messageId)).map(r=>r.messageId),ed=({messages:e,expandedIds:s,threadId:n,mailboxId:a,accountId:r})=>{const o=ue(),{pushError:i}=be(),c=l.useRef(new Set),u=l.useRef(new Set),{mutate:b}=pe({...Ps(),meta:Fr,onMutate:async g=>{const p=new Set(g.body.messageIds??[]),m=g.body.isRead??!0,f=Se({path:{threadId:n}}),d=Ne(St(p,e,a));await Promise.all([o.cancelQueries({queryKey:f}),hs(o,d)]);const h=o.getQueriesData({queryKey:f}).filter(x=>x[1]!==void 0).map(([x,k])=>({queryKey:x,data:k})),y=ps(o,d);return o.setQueriesData({queryKey:f},x=>x&&{...x,items:Fs(x.items,p,m)}),gs(o,d,x=>Fs(x,p,m)),{threadMessagesPrefix:f,listPrefixes:d,previousThreadMessages:h,previousThreadsList:y}},onSuccess:(g,p)=>{const m=p.body.messageIds??[];for(const f of m)c.current.add(f),u.current.delete(f)},onError:(g,p,m)=>{const f=p.body.messageIds??[];for(const h of f)u.current.delete(h);if(m){for(const h of m.previousThreadMessages)o.setQueryData(h.queryKey,h.data);fs(o,m.previousThreadsList)}const d=p.body.isRead??!0;i({title:d?"Couldn't mark as read":"Couldn't mark as unread",detail:we(g),error:g})},onSettled:(g,p,m,f)=>{f&&(o.invalidateQueries({queryKey:f.threadMessagesPrefix}),Ce(o,f.listPrefixes),r&&o.invalidateQueries({queryKey:ms({path:{accountId:r}})}))}}),v=l.useCallback(g=>{const p=g.filter(m=>!c.current.has(m)&&!u.current.has(m));if(p.length!==0){for(const m of p)u.current.add(m);b({body:{messageIds:p,isRead:!0}})}},[b]),j=l.useMemo(()=>Xc(e,s,c.current,u.current),[e,s]);l.useEffect(()=>Zc(j,Yc,v),[j,v]),l.useEffect(()=>{c.current.clear(),u.current.clear()},[n])},Ef=e=>{const{mailboxId:s,accountId:n,messages:a}=e,r=ue(),{pushError:o}=be(),{mutateAsync:i,isPending:c}=pe({...Ps(),onError:(b,v)=>{const j=v.body.isRead??!0;o({title:j?"Couldn't mark as read":"Couldn't mark as unread",detail:we(b),error:b})},onSettled:(b,v,j)=>{Ce(r,Ne(St(j.body.messageIds??[],a??[],s))),n&&r.invalidateQueries({queryKey:ms({path:{accountId:n}})})}});return{toggleReadFor:l.useCallback((b,v)=>{b.length!==0&&is(b,j=>i({body:{messageIds:j,isRead:v}}))},[i]),isPending:c}},sd=(e,s,n)=>s?.find(a=>a.messageId===e)?.mailboxId??n,un=(e,s,n)=>e.map(a=>a.messageId===s?{...a,hasStars:n}:a),Ea=({threadId:e,mailboxId:s,messages:n})=>{const a=ue(),{pushError:r}=be(),{mutate:o,isPending:i,variables:c}=pe({...Dr(),onMutate:async b=>{const v=b.path.messageId,j=b.body.isStarred??!1,g=Se({path:{threadId:e}}),p=Ne([sd(v,n,s)]);await Promise.all([a.cancelQueries({queryKey:g}),hs(a,p)]);const m=a.getQueriesData({queryKey:g}).filter(d=>d[1]!==void 0).map(([d,h])=>({queryKey:d,data:h})),f=ps(a,p);return a.setQueriesData({queryKey:g},d=>Lr(d,h=>un(h,v,j))),gs(a,p,d=>un(d,v,j)),{threadMessagesPrefix:g,listPrefixes:p,previousThreadMessages:m,previousThreadsList:f}},onError:(b,v,j)=>{if(j){for(const p of j.previousThreadMessages)a.setQueryData(p.queryKey,p.data);fs(a,j.previousThreadsList)}const g=v.body.isStarred??!1;r({title:g?"Couldn't star message":"Couldn't unstar message",detail:we(b),error:b})},onSettled:(b,v,j,g)=>{g&&(a.invalidateQueries({queryKey:g.threadMessagesPrefix}),Ce(a,g.listPrefixes))}});return{toggleStar:(b,v)=>{o({path:{messageId:b},body:{isStarred:!v}})},isPending:i,pendingMessageId:i?c?.path.messageId:void 0}};function mn({authenticity:e,onOpenIntelligence:s}){return e.dkimMismatch?t.jsxs("div",{className:"flex items-start gap-2 rounded-none border-b border-danger/20 bg-danger-soft px-5 py-2.5 text-sm",children:[t.jsx(Ve,{className:"mt-0.5 size-4 shrink-0 text-danger"}),t.jsxs("p",{className:"flex-1 leading-snug text-fg",children:["This message claims to be from"," ",t.jsx("span",{className:"font-semibold",children:e.fromDomain})," but was sent",e.dkimDomain?` via ${e.dkimDomain}`:" from a different domain","."," ",s&&t.jsx("button",{type:"button",onClick:s,className:"font-medium text-danger hover:underline",children:"Why?"})]})]}):null}function Fa(e){return e===void 0?"uncategorized":e}const td={inbox:"Inbox",junk:"Junk"},It=e=>e.destinationMailboxId!==void 0,nd=(e,s)=>{if(It(e))return`Moved from ${s??"another folder"} by Remit`;const n=e.fromPlacement??"";return`Moved from ${td[n]??"another folder"} by Remit`},ad=(e,s)=>{if(e===Pt.MoveToInbox)return s.inboxMailboxId;if(e===Pt.MoveToJunk)return s.junkMailboxId},rd=(e,s,n)=>{if(!e||!s)return!1;const a=It(e)?e.destinationMailboxId:ad(e.action,n);return a!==void 0&&a===s},od="Reported as spam",id=(e,s)=>{if(e){if(It(e))return e.fromMailboxId;if(e.fromPlacement==="inbox")return s.inboxMailboxId;if(e.fromPlacement==="junk")return s.junkMailboxId}},bs=(e,s)=>{const{data:n,isLoading:a}=se({...We(),staleTime:1/0,enabled:!!e});return{mailboxId:l.useMemo(()=>e?n?.accounts.find(i=>i.accountId===e)?.folderAppointments.find(i=>i.role===s)?.mailboxId:void 0,[n,e,s]),isLoading:a}},Ff=e=>{const{mailboxId:s,isLoading:n}=bs(e,"Archive");return{archiveMailboxId:s,isLoading:n}},Lf=e=>{const{mailboxId:s,isLoading:n}=bs(e,"Drafts");return{draftsMailboxId:s,isLoading:n}},La=e=>{const{mailboxId:s,isLoading:n}=bs(e,"Inbox");return{inboxMailboxId:s,isLoading:n}},Da=e=>{const{mailboxId:s,isLoading:n}=bs(e,"Junk");return{junkMailboxId:s,isLoading:n}},Df=e=>{const{mailboxId:s,isLoading:n}=bs(e,"Trash");return{trashMailboxId:s,isLoading:n}},ld=()=>{const{data:e,isError:s}=se({...We(),staleTime:1/0});return{trashByAccount:l.useMemo(()=>{const a=new Map;for(const r of e?.accounts??[]){const o=r.folderAppointments.find(i=>i.role==="Trash");a.set(r.accountId,{mailboxId:o?.mailboxId,source:o?.source??"None",staleFolderPath:o?.staleAppointmentPath})}return a},[e]),hasAppointments:e!==void 0,isError:s}},Oa=e=>{const{data:s}=se({...We(),staleTime:1/0,enabled:!!e});return l.useMemo(()=>s?.accounts.find(n=>n.accountId===e)?.folderAppointments??[],[s,e])},cd=new Set(["in_flight"]),fn=(e,s)=>{const n=e?.[s];return typeof n=="string"?n:void 0},za=e=>{const s=Or(e);if(s?.code!=="message_placement_unsettled")return;const{details:n}=s;if(!n)return;const a=fn(n,"reason"),r=fn(n,"messageId");if(!(!a||!cd.has(a)||!r))return{reason:a,messageId:r}},Pa=(e,s,n)=>({severity:"warning",title:s>1?`Couldn't ${n} ${s} messages yet`:`Couldn't ${n} this message yet`,detail:"It is still being moved on the mail server. Try again in a moment."}),hn=(e,s)=>e.filter(n=>!s.has(n.messageId)),vs=({mailboxId:e,threadId:s,accountId:n,onAfterOptimisticRemove:a})=>{const r=ue(),{pushError:o}=be(),{mutateAsync:i,isPending:c,isError:u}=pe({...zr(),meta:Pn(409),onMutate:async v=>{const j=new Set(v.body.messageIds??[]),g=s?Se({path:{threadId:s}}):[],p=Ne([e,v.body.destinationMailboxId]);await Promise.all([...s?[r.cancelQueries({queryKey:g})]:[],hs(r,p)]);const m=s?r.getQueriesData({queryKey:g}).filter(d=>d[1]!==void 0).map(([d,h])=>({queryKey:d,data:h})):[],f=ps(r,p);return s&&r.setQueriesData({queryKey:g},d=>d&&{...d,items:hn(d.items,j)}),gs(r,p,d=>hn(d,j)),a?.(Array.from(j)),{threadMessagesPrefix:g,listPrefixes:p,previousThreadMessages:m,previousThreadsList:f}},onError:(v,j,g)=>{if(g){for(const f of g.previousThreadMessages)r.setQueryData(f.queryKey,f.data);fs(r,g.previousThreadsList)}const p=j.body.messageIds?.length??0,m=za(v);if(m){o(Pa(m,p,"move"));return}o({title:p>1?`Couldn't move ${p} messages`:"Couldn't move this message",detail:we(v),error:v})},onSettled:(v,j,g,p)=>{p&&(s&&r.invalidateQueries({queryKey:p.threadMessagesPrefix}),Ce(r,p.listPrefixes),n&&r.invalidateQueries({queryKey:ms({path:{accountId:n}})}))}});return{moveMessages:l.useCallback((v,j)=>{v.length!==0&&is(v,g=>i({body:{messageIds:g,destinationMailboxId:j}}))},[i]),isPending:c,isError:u}},dd="This message could not be processed. Please try again. If it keeps failing, report it.",ud=(e,s)=>e.replace(`Message ${s}'s`,"This message's"),pn=e=>{if(e.failureCount===0)return;const s=e.failures?.[0],n=s?.reason??dd,a=s?ud(n,s.messageId):n;throw new Br(a,422)};function _a({mailboxId:e,threadId:s,accountId:n,onAfterOptimisticRemove:a}){const r=ue(),{pushError:o}=be(),i=Ne([e]),c=s?Se({path:{threadId:s}}):[],u=()=>{s&&r.invalidateQueries({queryKey:c}),Ce(r,i),n&&r.invalidateQueries({queryKey:ms({path:{accountId:n}})})},b=()=>(f,d)=>{u(),a?.(d.body.messageIds)},v=f=>(d,h)=>{o({title:f(h.body.messageIds.length),detail:we(d),error:d})},j=pe({mutationFn:async f=>{const{data:d}=await Pr({...f,throwOnError:!0});return pn(d),d},meta:{softError:!0},onSuccess:b(),onError:v(f=>f>1?`Couldn't report ${f} messages as spam`:"Couldn't report this message as spam")}),g=pe({mutationFn:async f=>{const{data:d}=await _r({...f,throwOnError:!0});return pn(d),d},meta:{softError:!0},onSuccess:b(),onError:v(f=>f>1?`Couldn't undo the spam report for ${f} messages`:"Couldn't undo the spam report")}),p=l.useCallback(f=>{f.length!==0&&is(f,d=>j.mutateAsync({body:{messageIds:d}}))},[j.mutateAsync]),m=l.useCallback(f=>{f.length!==0&&is(f,d=>g.mutateAsync({body:{messageIds:d}}))},[g.mutateAsync]);return{reportSpam:p,notSpam:m,isReporting:j.isPending,isRestoring:g.isPending}}const md=({accountId:e,messageId:s,threadId:n,mailboxId:a,autoMoved:r,spamReport:o})=>{const{inboxMailboxId:i}=La(e),{junkMailboxId:c}=Da(e),{moveMessages:u,isPending:b}=vs({mailboxId:a,threadId:n,accountId:e}),{notSpam:v,isRestoring:j}=_a({mailboxId:a,threadId:n,accountId:e}),{data:g}=se({...us({path:{accountId:e??""}}),staleTime:1/0,enabled:!!e&&r?.fromMailboxId!==void 0}),p={inboxMailboxId:i,junkMailboxId:c},m=id(r,p),f=l.useCallback(()=>{m&&u([s],m)},[u,s,m]),d=l.useCallback(()=>{v([s])},[v,s]);if(o)return{show:!0,label:od,onUndo:d,isUndoing:j};if(!rd(r,a,p)||!r)return{show:!1,label:"",isUndoing:!1};const y=r.fromMailboxId?g?.items.filter(x=>x.mailboxId===r.fromMailboxId).map(x=>Ur(x))[0]:void 0;return{show:!0,label:nd(r,y),onUndo:m?f:void 0,isUndoing:b,...r.filterId?{filtersHref:"/settings/filters"}:{}}};function fd({accountId:e,messageId:s,threadId:n,mailboxId:a,autoMoved:r,spamReport:o}){const i=md({accountId:e,messageId:s,threadId:n,mailboxId:a,autoMoved:r,spamReport:o});return i.show?t.jsx(kl,{label:i.label,onUndo:i.onUndo,undoLabel:i.isUndoing?"Undoing…":"Undo",filtersHref:i.filtersHref}):null}const hd=({trigger:e,children:s,align:n="right"})=>{const[a,r]=l.useState(!1),o=l.useRef(null),i=l.useCallback(c=>{o.current&&!o.current.contains(c.target)&&r(!1)},[]);return _s({id:"dropdown-menu",open:a,answers:{back:()=>r(!1)}}),l.useEffect(()=>(a&&document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)),[a,i]),t.jsxs("div",{ref:o,className:"relative",children:[t.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),r(!a)},className:E("p-1.5 min-h-11 min-w-11 inline-flex items-center justify-center rounded-md transition-colors","hover:bg-surface-raised text-fg-muted hover:text-fg"),children:e}),a&&t.jsx("div",{className:E("absolute z-50 mt-1 min-w-[180px] py-1","bg-surface border border-line rounded-md shadow-lg",n==="right"?"right-0":"left-0"),children:s})]})},Ss=({onClick:e,disabled:s,destructive:n,children:a})=>t.jsx("button",{type:"button",onClick:r=>{r.stopPropagation(),s||e()},disabled:s,className:E("w-full px-3 py-2 text-left text-sm transition-colors","flex items-center gap-2",s&&"opacity-50 cursor-not-allowed",!s&&"hover:bg-surface-raised",n&&"text-danger hover:text-danger"),children:a}),pd=()=>t.jsx("div",{className:"my-1 h-px bg-line"}),gn=(e,s)=>e.filter(n=>!s.has(n.messageId)),Of=e=>e.filter(s=>s.isDeleted!==!0),qs=({mailboxId:e,threadId:s,accountId:n,messages:a,onAfterOptimisticRemove:r})=>{const o=ue(),{pushError:i}=be(),{requestAppointment:c}=_n(),u=l.useRef([]),b=l.useRef(async()=>{}),{mutateAsync:v,isPending:j}=pe({...Kr(),meta:Pn(409),onMutate:async m=>{const f=new Set(m.body.messageIds??[]),d=s?Se({path:{threadId:s}}):[],h=Ne(St(f,a??[],e));await Promise.all([o.cancelQueries({queryKey:d}),hs(o,h)]);const y=s?o.getQueriesData({queryKey:d}).filter(k=>k[1]!==void 0).map(([k,C])=>({queryKey:k,data:C})):[],x=ps(o,h);return s&&o.setQueriesData({queryKey:d},k=>k&&{...k,items:gn(k.items,f)}),gs(o,h,k=>gn(k,f)),r?.(Array.from(f)),{threadMessagesPrefix:d,listPrefixes:h,previousThreadMessages:y,previousThreadsList:x}},onSuccess:(m,f)=>{const d=m?.failureCount??0;if(d===0)return;const h=f.body.messageIds?.length??0;i({severity:"warning",title:d>1?`Couldn't delete ${d} of ${h} messages yet`:"Couldn't delete this message yet",detail:"Something else moved it while the delete was being prepared. It is back where it now sits — try again."})},onError:(m,f,d)=>{if(d){for(const k of d.previousThreadMessages)o.setQueryData(k.queryKey,k.data);fs(o,d.previousThreadsList)}const h=$r(m);if(h){const k=u.current;c({accountId:h.accountId,role:h.role,reason:h.reason,action:{kind:"delete",count:k.length},onAppointed:()=>b.current(k)});return}const y=f.body.messageIds?.length??0,x=za(m);if(x){i(Pa(x,y,"delete"));return}i({title:y>1?`Couldn't delete ${y} messages`:"Couldn't delete this message",detail:we(m),error:m})},onSettled:(m,f,d,h)=>{h&&(s&&o.invalidateQueries({queryKey:h.threadMessagesPrefix}),Ce(o,h.listPrefixes),n&&o.invalidateQueries({queryKey:ms({path:{accountId:n}})}))}}),g=l.useCallback(m=>is(m,f=>v({body:{messageIds:f}})),[v]);return l.useEffect(()=>{b.current=g},[g]),{deleteMessages:l.useCallback(m=>{m.length!==0&&(u.current=m,g(m))},[g]),isPending:j}},Ba="inline-flex items-center justify-center transition-colors",gd=E(Ba,"min-h-11 min-w-11 rounded hover:bg-surface-raised"),xd=E(Ba,"min-h-11 gap-1.5 px-3 rounded text-sm font-medium hover:bg-surface-raised"),Qs=({accountId:e,currentMailboxId:s,onMove:n,disabled:a=!1,disabledHint:r,variant:o="icon-only",label:i,defaultOpen:c=!1})=>{const[u,b]=l.useState(c),[v,j]=l.useState(),g=xt(),p=l.useRef(null),m=l.useRef(null),f=l.useRef(null),d=i??"Move to folder",h=l.useId(),y=Bn(),{data:x,isLoading:k,isError:C,error:I,refetch:M}=se({...us({path:{accountId:e}}),staleTime:1/0,enabled:u}),w=Oa(e),{createFolderIn:N}=Un(e),T=l.useMemo(()=>$n({mailboxes:x?.items??[],folderAppointments:w,currentMailboxId:s,translator:y}),[x?.items,w,s,y]),A=Kn(x?.items??[]),K=T.find(B=>B.id===v),L=l.useCallback(()=>{b(!1),j(void 0);const B=document.activeElement;B&&m.current?.contains(B)&&f.current?.focus()},[]),W=l.useCallback(()=>{K&&(L(),n(K.id))},[K,L,n]);_s({id:"move-to",open:u,answers:{back:L}}),l.useEffect(()=>{if(!u||!g)return;const B=J=>{const U=J.target;p.current?.contains(U)||m.current?.contains(U)||L()};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[u,g,L]);const P=()=>p.current?.getBoundingClientRect()??null,$=a||!!r,F=t.jsxs("button",{type:"button",ref:f,onClick:B=>{B.stopPropagation(),!$&&b(J=>!J)},"aria-label":d,"aria-haspopup":g?"tree":"dialog","aria-expanded":u,"aria-controls":u?h:void 0,title:r,className:o==="icon-only"?gd:xd,children:[t.jsx(gt,{className:o==="icon-only"?"size-5":"size-4"}),o==="compact"&&t.jsx("span",{className:"hidden sm:inline",children:"Move"})]}),z=k?t.jsx("div",{className:"px-3 py-5 text-sm text-fg-muted",children:"Loading folders…"}):C?t.jsx("div",{className:"p-3",children:t.jsx(Le,{variant:"inline",title:"Couldn't load folders",error:I,onRetry:()=>M()})}):t.jsx(qr,{folders:T,selectedId:v,delimiter:A,onSelect:j,onCreateFolder:N,onCancel:L,autoFocusFilter:g,labels:{filterPlaceholder:"Filter folders…",filterAriaLabel:"Filter folders"}}),_=K&&t.jsx("div",{className:"shrink-0 border-t border-line p-2",children:t.jsx(Q,{variant:"primary",onClick:W,className:"h-11 w-full font-semibold",children:`Move to ${K.label}`})});return g?t.jsxs("div",{ref:p,className:"relative inline-block",children:[F,t.jsx(Jo,{open:u,align:"end",panelRef:m,getAnchor:P,children:t.jsxs("div",{id:h,ref:m,className:E("w-72 max-h-96 flex flex-col","bg-surface border border-line rounded-md shadow-lg"),children:[z,_]})})]}):t.jsxs(t.Fragment,{children:[F,t.jsx($e.Root,{open:u,onOpenChange:B=>B?b(!0):L(),children:t.jsxs($e.Portal,{children:[t.jsx($e.Overlay,{className:"fixed inset-0 z-40 bg-black/40"}),t.jsxs($e.Content,{className:"fixed inset-x-0 bottom-0 z-50 flex flex-col rounded-t-lg bg-canvas pb-[env(safe-area-inset-bottom,0px)]",style:{maxHeight:"85dvh"},id:h,children:[t.jsx($e.Handle,{className:"mx-auto mt-2 mb-1 h-1.5 w-12 rounded-full bg-fg-subtle/30"}),t.jsx($e.Title,{className:"px-4 py-2 text-base font-semibold border-b border-line",children:"Move to folder"}),t.jsx("div",{className:"flex min-h-0 flex-1 overflow-hidden",children:z}),_]})]})})]})},bd=({messageId:e,threadId:s,mailboxId:n,isRead:a,accountId:r,fromAddressId:o,isTrusted:i=!1,showRaw:c=!1,onToggleRaw:u})=>{const b=ue(),v=$o(),{pushError:j}=be(),g=Ko()?.messageId,{mutate:p,isPending:m}=pe({...Ps(),onMutate:async P=>{const $=P.body.isRead??!0,F=new Set(P.body.messageIds??[]),z=Se({path:{threadId:s}}),_=Ne([n]);await Promise.all([b.cancelQueries({queryKey:z}),hs(b,_)]);const B=b.getQueriesData({queryKey:z}).filter(U=>U[1]!==void 0).map(([U,Y])=>({queryKey:U,data:Y})),J=ps(b,_);return b.setQueriesData({queryKey:z},U=>U&&{...U,items:Fs(U.items,F,$)}),gs(b,_,U=>Fs(U,F,$)),{threadMessagesPrefix:z,listPrefixes:_,previousThreadMessages:B,previousThreadsList:J}},onError:(P,$,F)=>{if(F){for(const _ of F.previousThreadMessages)b.setQueryData(_.queryKey,_.data);fs(b,F.previousThreadsList)}const z=$.body.isRead??!0;j({title:z?"Couldn't mark as read":"Couldn't mark as unread",detail:we(P),error:P})},onSettled:(P,$,F,z)=>{z&&(b.invalidateQueries({queryKey:z.threadMessagesPrefix}),Ce(b,z.listPrefixes))}}),f=l.useCallback(P=>{g&&P.includes(g)&&v()},[g,v]),{deleteMessages:d,isPending:h}=qs({mailboxId:n,threadId:s,onAfterOptimisticRemove:f}),{moveMessages:y,isPending:x}=vs({mailboxId:n,threadId:s,accountId:r,onAfterOptimisticRemove:f}),{toggleTrusted:k,isPending:C,error:I,reset:M}=ea({messageId:e}),w=()=>{p({body:{messageIds:[e],isRead:!1}})},N=()=>{d([e])},T=()=>{o&&k(o,i)},A=m||h||x||C,K=A||!o,L=l.useCallback(P=>{y([e],P)},[y,e]),W=o?void 0:"Sender has no parseable address";return t.jsxs("div",{className:"flex flex-col items-end gap-1",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[r&&t.jsx(Qs,{accountId:r,currentMailboxId:n,onMove:L,disabled:A,label:"Move this message"}),t.jsxs(hd,{trigger:t.jsx(Yo,{className:"size-4"}),children:[t.jsxs(Ss,{onClick:T,disabled:K,children:[i?t.jsx(Us,{className:"size-4 text-positive"}):t.jsx(Ds,{className:"size-4 opacity-0"}),t.jsx("span",{title:W,children:"Trusted sender"})]}),a&&t.jsxs(Ss,{onClick:w,disabled:A,children:[t.jsx(jt,{className:"size-4"}),"Mark as unread"]}),u&&t.jsxs(Ss,{onClick:u,children:[t.jsx(ua,{className:"size-4"}),c?"Show formatted":"Show raw email"]}),t.jsx(pd,{}),t.jsxs(Ss,{onClick:N,disabled:A,destructive:!0,children:[t.jsx(ds,{className:"size-4"}),"Delete"]})]})]}),I&&t.jsx("div",{className:"w-64",children:t.jsx(Le,{variant:"inline",title:"Couldn't update trust",error:I,onRetry:()=>{M(),T()}})})]})},vd=e=>{const s=e.toUpperCase();return s==="OCTET-STREAM"?"FILE":s},yd=e=>{const s=e.toLowerCase().replace(/[^a-z0-9]/g,"");return s.length>0?`attachment.${s}`:"attachment"},xn=e=>e.filter(s=>!s.isMultipart&&s.disposition===Qr.Attachment&&s.contentUrl.length>0).map(s=>({bodyPartId:s.bodyPartId,filename:li(s.dispositionFilename??"",yd(s.mediaSubtype)),typeLabel:vd(s.mediaSubtype),sizeOctets:s.sizeOctets,contentUrl:s.contentUrl})),bn={status:"idle"},jd=({messageId:e,bodyParts:s,hasAttachment:n=!1,className:a})=>{const{getToken:r}=qn(),o=ue(),[i,c]=l.useState({}),u=l.useMemo(()=>xn(s??[]),[s]),b=Hr({path:{messageId:e}}),v=m=>qt(m.contentUrl,r).catch(f=>{if(!fi(Kt(f)))throw f;return o.refetchQueries({queryKey:b}).then(()=>{const d=o.getQueryData(b),h=d?xn(d.bodyParts).find(y=>y.bodyPartId===m.bodyPartId):void 0;return qt(h?.contentUrl??m.contentUrl,r)})}),j=(m,f)=>c(d=>({...d,[m]:f})),g=m=>{const f=u.find(d=>d.bodyPartId===m);if(!f)throw new Error(`No attachment part ${m} on message ${e}`);j(m,{status:"downloading"}),v(f).then(d=>{ci(d,f.filename),j(m,bn)}).catch(d=>{const h=Kt(d),y=di(d),{title:x,detail:k}=ui(h,f.filename,y);j(m,{status:"failed",title:x,detail:k,reportUrl:mi(h,f.filename,y)})})},p=n&&s!==void 0&&u.length===0;return t.jsx(jl,{className:a,attachments:u.map(m=>({attachmentId:m.bodyPartId,filename:m.filename,typeLabel:m.typeLabel,sizeOctets:m.sizeOctets,download:i[m.bodyPartId]??bn})),onDownload:g,hasUnlistedAttachment:p})},Ua=e=>e.syncStatus===Wr.abandoned?e.abandonedMutation:ls.none;function kd({threadMessage:e,accountId:s,className:n}){const a=Ua(e),r=a===ls.delete?"delete_failed":a===ls.move?"move_failed":void 0,{accountId:o}=Ks(r==="move_failed"&&!s?e.mailboxId:void 0),i=s??o,{deleteMessages:c,isPending:u}=qs({mailboxId:e.mailboxId,threadId:e.threadId,accountId:i,messages:[e]}),{moveMessages:b,isPending:v}=vs({mailboxId:e.mailboxId,threadId:e.threadId,accountId:i}),j=l.useCallback(()=>{c([e.messageId])},[c,e.messageId]),g=l.useCallback(m=>{b([e.messageId],m)},[b,e.messageId]),p=l.useMemo(()=>r?Gr(Vr({title:As[r].title,errorMessage:`Message ${e.messageId}: status=${e.status} syncStatus=${e.syncStatus} abandonedMutation=${e.abandonedMutation}`})):void 0,[r,e.messageId,e.status,e.syncStatus,e.abandonedMutation]);return r?t.jsx(Jl,{settlement:r,onRetry:r==="delete_failed"?j:void 0,action:r==="move_failed"&&i?t.jsx(Qs,{accountId:i,currentMailboxId:e.mailboxId,onMove:g,disabled:v,variant:"compact",label:As.move_failed.retryLabel}):void 0,retryPending:r==="delete_failed"?u:v,reportHref:p,className:n}):null}const Cd=({messageId:e,threadId:s,mailboxId:n,accountId:a,isRead:r,isStarred:o,onToggleStar:i,fromAddressId:c,isTrusted:u,showRaw:b,onToggleRaw:v,onReply:j,onReplyAll:g,onForward:p})=>{const m=ue(),{deleteMessages:f}=qs({mailboxId:n,threadId:s}),{moveMessages:d}=vs({mailboxId:n,threadId:s,accountId:a}),{toggleTrusted:h}=ea({messageId:e}),{mutate:y}=pe({...Ps(),onSettled:()=>{m.invalidateQueries({queryKey:Se({path:{threadId:s}})}),Ce(m,Ne([n]))}}),x=l.useCallback(M=>{d([e],M)},[d,e]),k=l.useCallback(()=>{f([e])},[f,e]),C=l.useCallback(()=>{y({body:{messageIds:[e],isRead:!r}})},[y,e,r]),I=[];return c&&I.push({key:"trusted",label:u?"Trusted sender":"Mark sender trusted",icon:u?t.jsx(Us,{className:"size-4 text-positive"}):t.jsx(Ds,{className:"size-4"}),onSelect:()=>h(c,u)}),v&&I.push({key:"raw",label:b?"Show formatted":"Show raw email",icon:t.jsx(ua,{className:"size-4"}),onSelect:v}),t.jsx(Ca,{hasThread:!0,onReply:j,onReplyAll:g,onForward:p,isStarred:o,onToggleStar:i,onDelete:k,isRead:r,onToggleRead:C,overflowItems:I,moveSlot:a?t.jsx(Qs,{accountId:a,currentMailboxId:n,onMove:x,label:"Move this message"}):void 0})},Nd=()=>t.jsxs("div",{className:"animate-pulse space-y-2",role:"status","aria-label":"Loading raw email",children:[t.jsx("div",{className:"h-4 bg-surface-sunken rounded w-full"}),t.jsx("div",{className:"h-4 bg-surface-sunken rounded w-11/12"}),t.jsx("div",{className:"h-4 bg-surface-sunken rounded w-5/6"}),t.jsx("div",{className:"h-4 bg-surface-sunken rounded w-3/4"})]}),wd=({messageId:e,enabled:s=!0})=>{const{data:n,isLoading:a,isError:r,error:o,refetch:i}=se({...Jr({path:{messageId:e}}),enabled:s});if(a)return t.jsx("div",{className:"message-body",children:t.jsx(Nd,{})});if(r)return t.jsx("div",{className:"message-body",children:t.jsx(Le,{variant:"inline",title:"Couldn't load the raw email",error:o,onRetry:()=>i()})});const c=n?.raw??"";return c===""?t.jsx("div",{className:"message-body",children:t.jsx("p",{className:"text-fg-muted text-sm italic",children:"No raw source available for this message."})}):t.jsx("div",{className:"message-body",children:t.jsx("pre",{className:"email-text whitespace-pre-wrap break-words text-sm leading-relaxed bg-surface-sunken rounded-md p-3 max-h-[32rem] overflow-auto",children:c})})},Sd=()=>t.jsx(Us,{className:"inline-block size-4 ml-1 -mt-0.5 text-positive align-middle","aria-label":"Trusted sender","data-testid":"trusted-sender-badge"}),$a=(e,s)=>({id:e.messageId,fromName:e.fromName??e.fromEmail??"?",fromEmail:e.fromEmail??"",toLabel:"",dateLabel:s,snippet:e.snippet||"",bodyHtml:""}),Ka=({isStarred:e,onToggleStar:s,isStarPending:n,hoverReveal:a})=>t.jsx("button",{type:"button",onClick:r=>{r.stopPropagation(),s()},disabled:n,"aria-label":e?"Remove star":"Add star",className:E("shrink-0 p-0.5 rounded transition-colors",e?"text-warning":E("text-fg-subtle hover:text-warning",a&&"opacity-0 group-hover:opacity-100 focus:opacity-100"),n&&"opacity-50"),children:t.jsx(He,{className:E("size-3.5",e&&"fill-current")})}),Id=({threadMessage:e,isFocused:s,onToggle:n,onToggleStar:a,isStarPending:r})=>{const o=Qn(e.sentDate,"datetime"),i=$a(e,o);return t.jsx(Na,{message:i,onClick:n,isFocused:s,isUnread:!e.isRead,trailing:t.jsxs(t.Fragment,{children:[e.hasAttachment&&t.jsx(Bs,{className:"size-3 shrink-0 text-fg-subtle",role:"img","aria-label":"Has an attachment"}),t.jsx(Ka,{isStarred:e.hasStars,onToggleStar:a,isStarPending:r,hoverReveal:!0}),t.jsx("span",{"data-testid":"message-date",className:"shrink-0 text-2xs text-fg-subtle tabular-nums",children:o})]})})},Rd=({threadMessage:e,messageData:s,isLoading:n,isError:a,error:r,onRetry:o,isFocused:i,onToggle:c,onToggleStar:u,isStarPending:b,accountId:v,showRaw:j,onToggleRaw:g,mobile:p,onReply:m,onReplyAll:f,onForward:d})=>{const h=Qn(e.sentDate,"long"),y=!e.isRead,x=s?.envelope.from[0]?.flags?.trusted?.value===!0,k=s?.envelope.from[0]?.flags?.blocked?.value===!0,C=s?.envelope.from[0]?.addressId,I=$a(e,h),M=e.autoMoved||e.spamReport?t.jsx(fd,{accountId:v,messageId:e.messageId,threadId:e.threadId,mailboxId:e.mailboxId,autoMoved:e.autoMoved,spamReport:e.spamReport}):null;return t.jsx(wa,{message:I,isFocused:p?!1:i,onHeaderClick:c,senderBadge:x&&!k?t.jsx(Sd,{}):void 0,trailing:t.jsx("span",{"data-testid":"message-date",className:"text-2xs text-fg-subtle",children:h}),to:s?t.jsx(vl,{label:"To",addresses:s.envelope.to}):null,indicators:M||!p?t.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mt-0.5",children:[M,!p&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"flex items-center justify-end gap-1",children:t.jsx(Ka,{isStarred:e.hasStars,onToggleStar:u,isStarPending:b})}),y&&t.jsx("span",{className:"size-1.5 rounded-full bg-accent","aria-label":"Unread"})]})]}):void 0,actionMenu:p?void 0:t.jsx(bd,{messageId:e.messageId,threadId:e.threadId,mailboxId:e.mailboxId,isRead:e.isRead,accountId:v,fromAddressId:C,isTrusted:x,showRaw:j,onToggleRaw:g}),actionBar:p?t.jsx(Cd,{messageId:e.messageId,threadId:e.threadId,mailboxId:e.mailboxId,accountId:v,isRead:e.isRead,isStarred:e.hasStars,onToggleStar:u,fromAddressId:C,isTrusted:x,showRaw:j,onToggleRaw:g,onReply:m,onReplyAll:f,onForward:d}):void 0,body:t.jsxs(t.Fragment,{children:[t.jsx(kd,{threadMessage:e,accountId:v,className:"mt-3"}),n?t.jsxs("div",{className:"mt-3 animate-pulse space-y-2",children:[t.jsx("div",{className:"h-4 bg-surface-sunken rounded w-full"}),t.jsx("div",{className:"h-4 bg-surface-sunken rounded w-3/4"}),t.jsx("div",{className:"h-4 bg-surface-sunken rounded w-1/2"})]}):a&&Yr(r)?t.jsx("div",{className:"mt-3",children:t.jsx(ra,{message:"This message has been deleted"})}):a?t.jsx("div",{className:"mt-3",children:t.jsx(Le,{variant:"inline",title:"Couldn't load this message",error:r,onRetry:o})}):j?t.jsx("div",{className:"mt-3",children:t.jsx(wd,{messageId:e.messageId})}):t.jsxs("div",{className:"mt-3",children:[t.jsx(si,{bodyParts:s?.bodyParts,messageId:e.messageId,fromAddressId:s?.envelope.from[0]?.addressId,isTrusted:x,isBlocked:k,category:Fa(e.category)}),t.jsx(jd,{messageId:e.messageId,bodyParts:s?.bodyParts,hasAttachment:e.hasAttachment,className:"mt-4"})]})]})})},Md=({threadMessage:e,isExpanded:s,isFocused:n,onToggle:a,onToggleStar:r,isStarPending:o,accountId:i,mobile:c,onReply:u,onReplyAll:b,onForward:v})=>{const[j,g]=l.useState(!1),{data:p,isLoading:m,isError:f,error:d,refetch:h}=se({...zs({path:{messageId:e.messageId}}),enabled:s,meta:{softError:!0}});return s?t.jsx(Rd,{threadMessage:e,messageData:p,isLoading:m,isError:f,error:d,onRetry:()=>h(),isFocused:n,onToggle:a,onToggleStar:r,isStarPending:o,accountId:i,showRaw:j,onToggleRaw:()=>g(y=>!y),mobile:c,onReply:u,onReplyAll:b,onForward:v}):t.jsx(Id,{threadMessage:e,isFocused:n,onToggle:a,onToggleStar:r,isStarPending:o})},Td=()=>t.jsxs("div",{className:"animate-pulse p-4",children:[t.jsx("div",{className:"h-6 bg-surface-sunken rounded w-3/4 mb-5"}),t.jsx("div",{className:"space-y-4",children:Array.from({length:2}).map((e,s)=>t.jsxs("div",{className:"flex gap-3 py-3",children:[t.jsx("div",{className:"size-10 bg-surface-sunken rounded-full shrink-0"}),t.jsxs("div",{className:"flex-1",children:[t.jsx("div",{className:"h-4 bg-surface-sunken rounded w-32 mb-2"}),t.jsx("div",{className:"h-3 bg-surface-sunken rounded w-48"})]})]},s))})]}),zf=({threadId:e,mailboxId:s,subject:n,selectedMessageId:a,authenticity:r,onOpenIntelligence:o,onBack:i,onSwipeNext:c,onSwipePrevious:u,mobileIntelligenceOpen:b,listOnScreen:v=!1})=>{const j=xt(),{accountId:g}=Ks(s),{data:p,isLoading:m,isError:f,error:d,refetch:h}=se({...Hn({path:{threadId:e}})}),y=l.useMemo(()=>p?.items??[],[p?.items]),x=y[y.length-1],k=l.useMemo(()=>[...y].reverse(),[y]),C=l.useRef(new Map),[I,M]=l.useState(new Set),[w,N]=l.useState(null),[T,A]=l.useState(0);l.useEffect(()=>{if(y.length>0&&e!==w){N(e);const R=new Set([y[y.length-1].threadMessageId]);if(a){const O=y.find(V=>V.messageId===a);O&&R.add(O.threadMessageId)}M(R),A(0)}},[e,y,w,a]);const K=l.useCallback(R=>{M(O=>{const V=new Set(O);return V.has(R)?V.delete(R):V.add(R),V})},[]),L=l.useCallback(R=>{const O=k[R];if(!O)return;C.current.get(O.threadMessageId)?.scrollIntoView({behavior:"smooth",block:"nearest"})},[k]),W=l.useCallback(()=>{if(k.length===0)return;const R=Math.min(T+1,k.length-1);A(R),L(R)},[k.length,T,L]),P=l.useCallback(()=>{if(k.length===0)return;const R=Math.max(T-1,0);A(R),L(R)},[k.length,T,L]),$=l.useCallback(()=>{const R=k[T];R&&K(R.threadMessageId)},[k,T,K]);ed({messages:y,expandedIds:I,threadId:e,mailboxId:s,accountId:g});const{toggleStar:F,isPending:z,pendingMessageId:_}=Ea({threadId:e,mailboxId:s,messages:y}),B=Zr(),J=zn(),U=a??x?.messageId,Y=l.useCallback((R,O)=>{O&&J({threadId:e,messageId:O,mode:R})},[J,e]),te=l.useCallback(()=>Y("reply",U),[Y,U]),ae=l.useCallback(()=>Y("reply-all",U),[Y,U]),Z=l.useCallback(()=>Y("forward",U),[Y,U]),ne=l.useRef(null),X=B?.kind==="reply"?`${B.mode}:${B.sourceMessageId}`:void 0;if(l.useEffect(()=>{X&&ne.current?.scrollIntoView({behavior:"smooth",block:"start"})},[X]),hi({enabled:!m&&y.length>0&&B===void 0,bindings:[...v?[]:[{key:"j",action:"focusNext",handler:W,preventDefault:!0},{key:"ArrowDown",action:"focusNext",handler:W,preventDefault:!0},{key:"k",action:"focusPrevious",handler:P,preventDefault:!0},{key:"ArrowUp",action:"focusPrevious",handler:P,preventDefault:!0},{key:"Enter",action:"openFocused",handler:$,preventDefault:!0},{key:"o",action:"openFocused",handler:$,preventDefault:!0}],{key:"r",action:"reply",handler:te,preventDefault:!0},{key:"R",action:"replyAll",handler:ae,noModifiers:!1,preventDefault:!0},{key:"f",action:"forward",handler:Z,preventDefault:!0}]}),m)return t.jsx(Td,{});if(f)return t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(Le,{title:B?"Couldn't load this conversation, so there is nothing to answer":"Couldn't load this conversation",error:d,onRetry:()=>h()})});if(y.length===0)return t.jsx("div",{className:"flex h-full items-center justify-center p-4",children:B?t.jsx(Le,{variant:"inline",title:"There is nothing here to answer",error:"This conversation has no messages left. Another mail client may have moved or deleted them."}):t.jsx(ra,{message:"No messages in this thread"})});const de=n||y[0]?.subject||"(No subject)",fe=y.length,me=R=>t.jsx("div",{"data-testid":"conversation-messages",children:k.map((O,V)=>t.jsx("div",{ref:he=>{he&&C.current.set(O.threadMessageId,he)},children:t.jsx(Md,{threadMessage:O,isExpanded:I.has(O.threadMessageId),isFocused:V===T,onToggle:()=>K(O.threadMessageId),onToggleStar:()=>F(O.messageId,O.hasStars),isStarPending:z&&_===O.messageId,accountId:g,mobile:R,onReply:R?()=>Y("reply",O.messageId):void 0,onReplyAll:R?()=>Y("reply-all",O.messageId):void 0,onForward:R?()=>Y("forward",O.messageId):void 0})},O.threadMessageId))}),re=B&&t.jsx("div",{ref:ne,children:B.kind==="reply"?t.jsx(Jc,{surface:B}):t.jsx("div",{className:"border-b border-line bg-canvas p-4",children:t.jsx(Le,{variant:"inline",title:"That is not a way to answer a message",error:`"${B.segment}" is not reply, reply-all or forward.`})})}),q=t.jsxs("header",{className:"border-b border-line px-5 pt-5 pb-3",children:[t.jsx("h1",{className:"max-w-2xl text-lg font-semibold leading-snug text-fg",children:de}),t.jsxs("p",{className:"mt-1 text-2xs text-fg-subtle",children:[fe," ",fe===1?"message":"messages"]})]});return j?t.jsxs("article",{className:"h-full flex flex-col",children:[q,r?.dkimMismatch&&t.jsx(mn,{authenticity:r,onOpenIntelligence:o}),t.jsxs("div",{className:"min-h-0 flex-1 overflow-auto",children:[re,me(!1)]})]}):t.jsxs(ic,{thread:{subject:de,messages:[]},onBack:i??(()=>{}),intelligenceOpen:b,onToggleIntelligence:o,onSwipeNext:c,onSwipePrevious:u,children:[r?.dkimMismatch&&t.jsx(mn,{authenticity:r,onOpenIntelligence:o}),re,me(!0)]})},Ad=e=>{switch(Ua(e)){case ls.delete:return{settlement:"delete_failed"};case ls.move:return{settlement:"move_failed"};default:return{}}},Ed=({isOpen:e,onClose:s,children:n,ariaLabel:a="Navigation",side:r="left",widthClassName:o="w-[80vw] max-w-[320px]",answers:i})=>{const c=l.useRef(null);if(_s({id:"drawer",open:e,answers:{back:s,...i}}),Wn(c,e),l.useEffect(()=>{if(!e)return;const b=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=b}},[e]),!e)return null;const u=r==="left"?"left-0 border-r animate-in slide-in-from-left duration-150":"right-0 border-l animate-in slide-in-from-right duration-150";return t.jsxs("div",{className:"fixed inset-0 z-50",role:"dialog","aria-modal":"true","aria-label":a,children:[t.jsx("button",{type:"button","aria-label":"Close menu",onClick:s,className:"absolute inset-0 bg-black/40 animate-in fade-in duration-150 cursor-default"}),t.jsxs("div",{ref:c,tabIndex:-1,className:E("safe-area-frame absolute top-0 bottom-0 bg-canvas border-line shadow-xl flex flex-col",o,u),children:[t.jsx("div",{className:"flex items-center justify-end h-12 px-2 border-b border-line shrink-0",children:t.jsx("button",{type:"button",onClick:s,className:"p-2 rounded-md hover:bg-surface-raised transition-colors min-h-11 min-w-11 inline-flex items-center justify-center","aria-label":"Close menu",children:t.jsx(qe,{className:"size-5"})})}),t.jsx("div",{className:"flex-1 overflow-y-auto",children:n})]})]})},Is=e=>({messageId:e,tab:void 0,offering:!1,picked:[],answering:"",failure:{suggestionId:"",text:""}}),Fd=(e,s)=>{const n=+(s.state==="Pending")-+(e.state==="Pending");return n!==0?n:s.sequence-e.sequence},Ld=(e,s)=>s.kind==="refused"?`Couldn't ${e}: ${s.message} Try again, or answer from your calendar app.`:"";function Dd(e,s,n){const a=e.messageId,{suggestions:r,isLoading:o,error:i}=wi(a),c=$i(),{calendars:u,defaultCalendarId:b,colorByCalendarId:v,timeZoneByCalendarId:j}=c,g=ki(c),p=Si(),m=Li(),f=Di(),[d,h]=l.useState(()=>Is(a)),y=d.messageId===a?d:Is(a),x=l.useRef(a);x.current=a;const k=R=>{x.current===a&&h(O=>({...O.messageId===a?O:Is(a),...R}))},C=l.useMemo(()=>r.filter(Ii).filter(R=>Qt(R)!==void 0).sort(Fd)[0],[r]),I=r.filter(R=>R!==C&&R.state==="Pending"),M=C??I[0],w=M?Ht(M):"",N=Ki(w===""?"1970-01-01":w,1),T=Oi({...N,calendarIds:[],enabled:w!==""}),A=Ci(w===""?[]:[N]),K={threadId:e.threadId,threadSubject:e.subject??"",calendarId:b},L=e.fromName??e.fromEmail??"",W=Gi(y.failure.text||"the invitations in a message could not be read"),P=Ni(g,W),$=(R,O,V)=>{k({answering:R,failure:{suggestionId:R,text:""}}),V().then(he=>k({answering:"",failure:{suggestionId:R,text:Ld(O,he)}}))},F=C?.suggestionId??"",z=y.failure.suggestionId===F?y.failure.text:"",_=y.failure.suggestionId===F?"":y.failure.text,B=C?Qt(C):void 0,J=C&&B?{invite:Mi(C,B.state,{...K,senderName:L}),whenText:Wt(C),calendarName:u.find(R=>R.id===b)?.name??"Calendar",color:v[b]??"cal-1",clashes:B.state==="pending"?Ri({start:C.dtStart,end:C.dtEnd},A.spans):[],rsvp:B.rsvp,busy:y.answering===C.suggestionId,failure:z,reportHref:W,addBlocked:P,sender:L}:void 0,U=w===""?[]:Ti(w,A.spans),Y=T.instances.filter(qi).filter(R=>!R.allDay).sort((R,O)=>R.start.localeCompare(O.start)).map(R=>({event:Qi(R,j[R.calendarId]??"",Hi()),timeText:zi(R.start),color:v[R.calendarId]??"cal-1"})),te=I.map(R=>({suggestion:Ai(R,{...K,sender:L}),whenText:Wt(R)})),ae=i===null?"":"Couldn't read the invitations in this message. Reopen it to try again.",Z=C?.method==="Cancel",ne=R=>{const O=r.find(V=>V.suggestionId===R);O&&f(Ht(O),R)},X=R=>{const O=r.find(V=>V.suggestionId===R);return O?.zoneCertainty==="Ambiguous"&&O.method!=="Cancel"},de=w===""?"":Ei(w,U,y.picked),fe=C!==void 0&&C.answerOvertakenBy!==Xr.None,me={onAddInvite:()=>{if(X(F)){ne(F);return}$(F,"add this to your calendar",()=>p.accept(F,b))},onTentativeInvite:Z?void 0:()=>$(F,"add this as a maybe",()=>p.tentative(F,b)),onDeclineInvite:()=>$(F,"decline this",()=>p.decline(F)),onMuteInvite:()=>$(F,"stop these invitations",()=>p.dismiss(F,!0)),onRemoveInvite:Z?()=>$(F,"take this off your calendar",()=>p.accept(F,b)):void 0,onReopenInvite:Z?()=>$(F,"keep this on your calendar",()=>p.dismiss(F,!1)):fe?void 0:()=>$(F,"take this answer back",()=>p.reopen(F)),onOpenNewerInvite:n&&C&&C.supersededByThreadId!==""?()=>n({threadId:C.supersededByThreadId,messageId:C.supersededByMessageId}):void 0,onOfferOtherTimes:()=>k({offering:!0}),onToggleSlot:R=>k({picked:y.picked.includes(R.startTime)?y.picked.filter(O=>O!==R.startTime):[...y.picked,R.startTime]}),onReplyWithSlots:s?()=>s({threadId:e.threadId,messageId:a},de):void 0,onAddSuggestion:R=>{if(X(R)){ne(R);return}$(R,"add this to your calendar",()=>p.accept(R,b))},onReviewSuggestion:I[0]?.method==="Cancel"?void 0:ne,onDismissSuggestion:R=>$(R,"dismiss this",()=>p.dismiss(R,!1)),onSelectEvent:R=>{const{calendarObjectId:O,recurrenceId:V}=Wi(R);m(w,O,V)}},re=J!==void 0||te.length>0||i!==null,q=y.tab!==void 0;return l.useEffect(()=>{o||q||h(R=>R.messageId===a&&R.tab!==void 0?R:{...R.messageId===a?R:Is(a),tab:re?"calendar":"sender"})},[o,q,re,a]),{surface:{data:{invite:J,prose:y.offering&&w!==""?{dayLabel:Gt(w),proposals:[],slots:U,picked:y.picked}:void 0,suggestions:te,day:Y,dayLabel:w===""?"":Gt(w),suggestionsBusy:y.answering!==""&&!J?.busy,failure:ae,suggestionsFailure:_,reportHref:W,addBlocked:P},actions:me},tab:y.tab??"sender",onTabChange:R=>k({tab:R})}}const qa=()=>{const{data:e}=se({...We(),staleTime:1/0});return e?.semanticSearchEnabled},Od=10,Qa=e=>({q:e?.toLowerCase()??"",limit:Od}),zd=(e,s)=>{if(!s)return;const n=s.toLowerCase();return e?.find(a=>a.normalizedEmail===n)};function Pd(e){const s=new Date(e),n=new Date;return s.toDateString()===n.toDateString()?"today":so(s,{month:"short",year:"numeric"})}function Ha(e){if(!e)return!0;const[,s]=e.split("@");return s?!s.includes("."):!0}const _d="We can't verify the sender of this email, which could mean it's from an insecure source.",Bd="We couldn't read this sender's address, so we can't confirm who really sent this message.";function Ud(e,s){const n=e.category??"personal";return{value:Gn(n)?n:"uncategorized",overridden:s?.flags?.category?.value!=null&&s.flags.category.value!==e.category}}function $d(e,s){return{name:e.fromName??e.fromEmail??"Unknown",email:e.fromEmail??"",trust:e.senderTrust,firstSeenLabel:s?Pd(s.createdAt):"unknown",inboundCount:s?.inboundCount,replyCount:s?.replyCount,addressUnverified:Ha(e.fromEmail)}}function Kd(e){return e?.flags?{vip:e.flags.vip?.value===!0,muted:e.flags.muted?.value===!0,blocked:e.flags.blocked?.value===!0}:{}}function vn(e){if(e.fromName&&e.fromName!==e.fromEmail)return e.fromName}function qd(e){return e.length===1?e[0]:`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function Qd(e,s){const n=[],a=e.displayNameCorrespondence;s&&(a===et.Unrelated?n.push(`The name it shows, "${s}", has nothing to do with ${e.fromDomain}.`):a===et.Lookalike?n.push(`The name it shows, "${s}", only looks like ${e.fromDomain}.`):a===et.ForeignAddress&&n.push(`The name it shows, "${s}", is an address ${e.fromDomain} cannot send from.`));const r=Hd(e.offDomainLinkDomains);return r.length>0&&n.push(`Its links go to ${qd(r.slice(0,3))}.`),n}function Hd(e){return Array.isArray(e)?e.filter(s=>typeof s=="string"&&s.length>0):[]}function Wd(e,s){const n=s>0?s:void 0;if(Ha(e.fromEmail))return{verdict:"mismatch",fromDomain:"",addressUnreadable:!0,summary:Bd,similarCount:n};const a=e.authenticity;if(!a)return{verdict:"caution",fromDomain:e.fromEmail?.split("@")[1]??"",summary:_d};if(!a.dkimMismatch){const b=vn(e),v=Qd(a,b);return v.length>0?{verdict:"caution",fromDomain:a.fromDomain,dkimDomain:a.dkimDomain,claimedBrand:b,summary:v.join(" ")}:{verdict:"aligned",fromDomain:a.fromDomain,dkimDomain:a.dkimDomain,summary:a.dkimDomain?`This message was signed by ${a.dkimDomain}.`:"Nothing looks unusual about this sender."}}const r=a.fromDomain,o=a.dkimDomain,i=vn(e),c=o?`it was actually sent from ${o}`:"its signature failed to verify",u=i?`The display name claims "${i}", but ${c}${o?` — not ${r}`:""}. Real senders use their own address.`:`This message claims to be from ${r}, but ${c}.`;return{verdict:"mismatch",fromDomain:r,dkimDomain:o,claimedBrand:i,summary:u,similarCount:n}}function Gd(e,s){const n=e?.fromEmail??null,a=e?.subject??"",{data:r,error:o}=se({...bt({query:Qa(n??void 0)}),enabled:!!n,staleTime:3e4}),i=zd(r?.items,n??void 0),c=qa(),u=[a,n].filter(Boolean).join(" "),{data:b,isLoading:v,error:j}=se({...eo({query:{query:u,limit:5}}),enabled:!!(e&&u.length>3)&&c===!0,staleTime:6e4,retry:1});return{data:l.useMemo(()=>{if(!e)return null;const p=(b?.items??[]).filter(y=>y.messageId!==e.messageId).map(y=>({id:y.messageId,threadId:y.threadId,mailboxId:s!=null&&y.mailboxIds.includes(s)?s:y.mailboxIds[0]??"",fromName:y.fromName??"",subject:y.subject??"(No subject)",timeLabel:y.sentDate!=null?Ge(y.sentDate*1e3):"",matched:y.matchedChunkType})),m=$d(e,i),f=Wd(e,p.length),d=Ud(e,i),h=Kd(i);return{sender:m,authenticity:f,category:d,flags:h,similar:p}},[e,i,b,s]),isSimilarLoading:v,similarError:j,similarErrorIsFatal:_t(j),semanticEnabled:c,addressErrorIsFatal:_t(o),addressId:i?.addressId,address:i}}function Vd(e,s,n=[]){const a={...e??{}};for(const[r,o]of Object.entries(s))o==null?delete a[r]:a[r]={...o,setAt:o.setAt??Date.now()};for(const r of n)delete a[r];return a}function Jd({addressId:e,senderEmail:s}){const n=ue(),{pushError:a}=be(),r=to({query:Qa(s)}),{mutate:o,isPending:i}=pe({...no(),onMutate:async v=>{const j=v.body.flags??{},g=v.body.clearFlags??[];await n.cancelQueries({queryKey:r});const p=n.getQueryData(r);return n.setQueryData(r,m=>m&&{...m,items:m.items.map(f=>f.addressId===v.path.addressId?{...f,flags:Vd(f.flags,j,g)}:f)}),{previous:p}},onError:(v,j,g)=>{g?.previous!==void 0&&n.setQueryData(r,g.previous),a({title:"Couldn't update sender preference",detail:we(v),error:v})},onSettled:()=>{n.invalidateQueries({queryKey:r})}}),c=l.useCallback(v=>{if(!e){ao(new Error(`Quick action fired but the sender's address record did not resolve (sender: ${s??"unknown"}). This should never happen — the address row exists.`));return}o({path:{addressId:e},body:v})},[e,o,s]),u=l.useCallback(v=>c({flags:v}),[c]),b=l.useCallback(v=>c({clearFlags:v}),[c]);return{updateFlags:u,clearFlags:b,isPending:i}}const Pf=e=>e==="vip"?"A sender you know":e==="wellknown"?"You've emailed them before":"Passed authentication",Yd=e=>e.senderTrust!=="vip"&&e.senderTrust!=="wellknown"?!1:e.authenticity?.dkimMismatch!==!0;function _f(e,s){e.recordEvent("rescue.candidates_surfaced",{count:String(s)})}function Bf(e,s){e.recordEvent("rescue.flow_opened",{count:String(s)})}function Uf(e,s){e.recordEvent("rescue.committed",{selected:String(s.selected),total:String(s.total),destination:s.toInbox?"inbox":"other"})}function Zd(e,s){e.recordEvent("rescue.sent_to_junk",{count:String(s.count),senderTrust:s.senderTrust,wasRescuable:String(s.wasRescuable)})}const Xd=e=>e!=="uncategorized",eu=io.map(e=>e.category).filter(Xd),su=e=>e.spamReport?"notSpam":"reportSpam",tu=e=>{const{similarError:s,similarErrorIsFatal:n,isSimilarLoading:a,semanticEnabled:r}=e;return r===!1?"off":s&&!n?"error":a?"loading":"ready"};function nu(){return t.jsxs("aside",{className:"flex h-full w-full flex-col bg-surface-sunken",children:[t.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-1.5 border-b border-line px-row-inset",children:[t.jsx(Qe,{className:"size-3.5 text-fg-subtle"}),t.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Intelligence"})]}),t.jsxs("div",{className:"flex-1 animate-pulse space-y-4 p-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"h-2.5 rounded bg-surface w-1/4"}),t.jsxs("div",{className:"flex gap-3",children:[t.jsx("div",{className:"size-10 rounded-full bg-surface shrink-0"}),t.jsxs("div",{className:"flex-1 space-y-1.5",children:[t.jsx("div",{className:"h-3 rounded bg-surface w-3/4"}),t.jsx("div",{className:"h-2.5 rounded bg-surface w-1/2"})]})]})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"h-2.5 rounded bg-surface w-1/4"}),t.jsx("div",{className:"h-8 rounded bg-surface"})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("div",{className:"h-2.5 rounded bg-surface w-1/4"}),t.jsx("div",{className:"flex gap-1.5 flex-wrap",children:Array.from({length:5}).map((e,s)=>t.jsx("div",{className:"h-6 w-16 rounded bg-surface"},s))})]})]})]})}function au({isOpen:e,current:s,hasOverride:n,onSelect:a,onClear:r,onCancel:o}){const i=l.useRef(null);return Wn(i,e),e?t.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[t.jsx(oo,{label:"Dismiss reclassify sender",onDismiss:o,className:"backdrop-blur-sm"}),t.jsxs("div",{ref:i,role:"dialog","aria-modal":"true","aria-label":"Reclassify sender",tabIndex:-1,className:"relative z-10 w-full max-w-sm rounded-sm border border-line bg-surface p-6 shadow-lg",children:[t.jsx("h2",{className:"text-lg font-semibold",children:"Reclassify this sender"}),t.jsx("p",{className:"mt-2 text-sm text-fg-muted",children:"Set a category override for future messages from this sender."}),t.jsxs("div",{className:"mt-4 flex flex-col gap-1",children:[eu.map(c=>t.jsxs("button",{type:"button",onClick:()=>a(c),className:`flex min-h-11 items-center justify-between rounded px-3 text-left text-sm transition-colors hover:bg-surface-raised ${c===s?"font-semibold text-accent":"text-fg"}`,children:[Os[c],c===s&&t.jsx("span",{className:"text-2xs text-fg-subtle",children:"current"})]},c)),n&&t.jsx("button",{type:"button",onClick:r,className:"mt-1 flex min-h-11 items-center rounded border-t border-line px-3 text-left text-sm text-fg transition-colors hover:bg-surface-raised",children:"Remove override — classify automatically again"})]}),t.jsx("div",{className:"mt-6 flex justify-end",children:t.jsx("button",{type:"button",onClick:o,className:"inline-flex min-h-11 items-center justify-center rounded border border-line px-4 text-sm font-medium transition-colors hover:bg-surface-raised",children:"Cancel"})})]})]}):null}function ru({thread:e,onClose:s,mailboxId:n,accountId:a,hideCloseButton:r,onAfterOptimisticRemove:o,onReplyWithText:i,onOpenThread:c}){const{data:u,address:b,addressId:v,isSimilarLoading:j,similarError:g,similarErrorIsFatal:p,semanticEnabled:m}=Gd(e,n),f=Dd(e,i,c),[d,h]=l.useState(!1),y=e.fromEmail??void 0,{updateFlags:x,clearFlags:k}=Jd({addressId:v,senderEmail:y}),{reportSpam:C,notSpam:I,isReporting:M,isRestoring:w}=_a({mailboxId:e.mailboxId,threadId:e.threadId,accountId:a,onAfterOptimisticRemove:o}),N=ro(),T=su(e),A=l.useCallback(()=>{I([e.messageId])},[I,e.messageId]),K=l.useCallback(()=>{Zd(N,{count:1,senderTrust:e.senderTrust,wasRescuable:Yd(e)}),C([e.messageId])},[C,e,N]),L=l.useCallback(()=>{},[]),W=l.useCallback(()=>{const U=u?.flags?.vip!==!0;x({vip:{value:U}})},[u?.flags?.vip,x]),P=l.useCallback(()=>{const U=u?.flags?.muted!==!0;x({muted:{value:U}})},[u?.flags?.muted,x]),$=l.useCallback(U=>{h(!1),x({category:{value:U}})},[x]),F=l.useCallback(()=>{h(!1),k(["category"])},[k]),z=v!==void 0,_={onToggleVip:z?W:void 0,onToggleMute:z?P:void 0,onReclassify:z?()=>h(!0):void 0,onNotSpam:T==="notSpam"?A:void 0,onReportSpam:T==="reportSpam"?K:void 0},B=({mailboxId:U,threadId:Y,messageId:te,className:ae,ariaLabel:Z,children:ne})=>t.jsx(Vn,{to:"/mail/$mailboxId/$threadId/$messageId",params:{mailboxId:U,threadId:Y,messageId:te},search:X=>X,variant:"row",className:ae,"aria-label":Z,children:ne});if(!u)return t.jsx(nu,{});const J=tu({similarError:g,similarErrorIsFatal:p,isSimilarLoading:j,semanticEnabled:m});return t.jsxs(t.Fragment,{children:[t.jsx(ha,{data:u,calendar:f.surface,tab:f.tab,onTabChange:f.onTabChange,onClose:s,hideCloseButton:r,onShowSimilar:L,actions:_,similarState:J,similarLinkComponent:B,reportSpamPending:M,notSpamPending:w,className:"border-l-0 h-full w-full"}),t.jsx(au,{isOpen:d,current:u.category.value,hasOverride:b?.flags?.category?.value!=null,onSelect:$,onClear:F,onCancel:()=>h(!1)})]})}const ou=({onClose:e,thread:s,mailboxId:n,accountId:a,hideCloseButton:r,onAfterOptimisticRemove:o,onReplyWithText:i,onOpenThread:c})=>s?t.jsx(ru,{thread:s,onClose:e,mailboxId:n,accountId:a,hideCloseButton:r,onAfterOptimisticRemove:o,onReplyWithText:i,onOpenThread:c}):t.jsxs("aside",{className:"flex h-full w-full flex-col bg-surface-sunken",children:[t.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-1.5 border-b border-line px-row-inset",children:[t.jsx(Qe,{className:"size-3.5 text-fg-subtle"}),t.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Intelligence"})]}),t.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center px-row-inset text-center",children:[t.jsx(Qe,{className:"size-8 text-fg-subtle"}),t.jsx("p",{className:"mt-3 text-sm text-fg-muted",children:"Intelligence"}),t.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:"Sender trust, authenticity and similar messages will appear here."})]})]});function $f({isOpen:e,onClose:s,thread:n,mailboxId:a,accountId:r,onAfterOptimisticRemove:o,onReplyWithText:i,onOpenThread:c}){return t.jsx(Ed,{isOpen:e,onClose:s,ariaLabel:"Message details",side:"right",answers:{toggleIntelligence:s},children:t.jsx(ou,{onClose:s,thread:n,mailboxId:a,accountId:r,hideCloseButton:!0,onAfterOptimisticRemove:o,onReplyWithText:i,onOpenThread:c})})}const iu=e=>{const{trashByAccount:s,hasAppointments:n,isError:a}=ld();return l.useMemo(()=>{const r=lo({targets:e,trashByAccount:s,hasAppointments:n,isError:a}),o=i=>i.accountId?s.get(i.accountId):void 0;return{outcome:r,staleFolderLabel:e.map(o).find(i=>i?.source==="Stale")?.staleFolderPath,guessedMailboxId:r==="unconfirmed"?e.find(i=>o(i)?.mailboxId===i.mailboxId)?.mailboxId:void 0}},[e,s,n,a])},lu=100,cu=({mailboxId:e,mailboxLabel:s,accountId:n,enabled:a,predicateKey:r,searchQuery:o,reportEnding:i})=>{const[c,u]=l.useState({kind:"idle"}),b=l.useRef(void 0),{run:v,start:j,stop:g}=co(),{pushError:p}=be(),m=v?.mailboxId===e?v:void 0,f=m!==void 0,d=l.useRef(!1);d.current=f,l.useEffect(()=>{b.current?.abort(),u({kind:"idle"})},[a,r]);const h=l.useRef(o);h.current=o;const y=l.useCallback(N=>async(T,A)=>{const{data:K}=await Bt({path:{mailboxId:e},query:{...N,continuationToken:T,limit:lu},signal:A,throwOnError:!0});return{ids:(K.items??[]).map(L=>L.messageId),continuationToken:K.continuationToken}},[e]),x=l.useCallback(async N=>{const{data:T}=await Bt({path:{mailboxId:e},query:{...h.current,count:!0,results:!1},signal:N,throwOnError:!0});if(T.count===void 0)throw new Error("the search returned no count for the selection");return T.count},[e]),k=l.useCallback(N=>async(T,A)=>{if(N.kind==="move"){const{data:L}=await uo({body:{messageIds:T,destinationMailboxId:N.destinationMailboxId},signal:A,throwOnError:!0});return L}if(N.kind==="markRead"){const{data:L}=await mo({body:{messageIds:T,isRead:!0},signal:A,throwOnError:!0});return L}const{data:K}=await fo({body:{messageIds:T},signal:A,throwOnError:!0});return K},[]),C=l.useCallback(()=>{const N=new AbortController;b.current=N,u({kind:"counting"}),x(N.signal).then(T=>{if(N.signal.aborted){u({kind:"idle"});return}u({kind:"escalated",total:T})},T=>{if(N.signal.aborted){u({kind:"idle"});return}p(ho("Couldn't count matching messages","The count didn't finish.",T)),u({kind:"idle"})})},[x,p]),I=l.useCallback(()=>{b.current?.abort(),d.current&&g(e)},[g,e]),M=l.useCallback(()=>{d.current||(b.current?.abort(),u({kind:"idle"}))},[]),w=l.useCallback(async(N,T,A)=>{const K=T?.length??(c.kind==="escalated"?c.total:0),L=T!==void 0?{kind:"targets",targets:T}:{kind:"predicate",fetchPage:y(h.current)},W=await j({action:N,mailboxId:e,mailboxLabel:s,accountId:n,matched:K,source:L,applyBatch:k(N),reportEnding:i,claimEnding:A});return W.kind==="ran"&&u({kind:"idle"}),W},[k,y,c,e,s,n,i,j]);return{phase:c,escalate:C,stop:I,clear:M,isRunning:f,runningAction:m?.action,progress:m?.progress,runAction:w}},du=120,uu=({keyboardFocusedMessageId:e,openMessageId:s,enabled:n,open:a,delayMs:r=du})=>{const o=l.useRef(a);o.current=a;const i=l.useRef(void 0);l.useEffect(()=>{const c=e;if(!n){i.current=c;return}if(c===void 0||c===s)return;if(c===i.current){i.current=void 0;return}const u=setTimeout(()=>o.current(c),r);return()=>clearTimeout(u)},[n,e,s,r])},Wa="This account has no Junk folder appointed, so there is nowhere to file these. Appoint one under Settings › Folder roles.",mu="These are already in Junk, so there is nowhere to file them.",fu=(e,s)=>e!==void 0&&e!==s?e:void 0,Kf=(e,s)=>{if(fu(e,s)===void 0)return e===void 0?Wa:mu};function hu(e,s){if(e.length!==0)return s!==void 0&&e.includes(s)?s:e[0]}const pu={title:"",navSlot:null,titleMeta:null,searchSlot:null,searchField:null,searchResults:null,makeFilterSlot:null},dt=l.createContext(pu),gu=()=>l.useContext(dt),xu=({isOpen:e,messageIds:s,outcome:n,accountId:a,trashFolderLabel:r,staleFolderLabel:o,guessedMailboxId:i,isDeleting:c=!1,onConfirm:u,onCancel:b})=>{const{Account:v}=qn(),{requestAppointment:j}=_n(),g=s.length,p=()=>u([...s]),m=po(g,n,{trashFolderLabel:r,staleFolderLabel:o});if(n==="noTrash"||n==="staleTrash"||n==="unconfirmed"){const f=n==="noTrash"?"none":n==="staleTrash"?"stale":"unconfirmed";return t.jsx(Ns,{isOpen:e,...m,onConfirm:()=>{if(!a)return p();const d=[...s];b(),j({accountId:a,role:"Trash",reason:f,action:{kind:"delete",count:g},staleFolderLabel:o,trashFolderLabel:r,guessedMailboxId:i,onAppointed:async()=>u(d)})},onCancel:b})}return n==="unavailable"?t.jsx(v,{fallback:t.jsx(Ns,{isOpen:e,...m,confirmLabel:"Reload reader",onConfirm:()=>window.location.reload(),onCancel:b}),children:({signOut:f})=>t.jsx(Ns,{isOpen:e,...m,onConfirm:()=>f(),onCancel:b})}):t.jsx(Ns,{isOpen:e,...m,destructive:!0,isBusy:c||n==="unknown",onConfirm:p,onCancel:b})},Ga=8,Va=e=>e==="From"||e==="FromDomain",bu=e=>({value:e.email,label:e.displayName??e.email,...e.displayName?{hint:e.email}:{},...e.fromSelection?{source:"selected"}:{}}),vu=e=>{const s=Ta(e.email);if(s!==null)return{value:s,...e.fromSelection?{source:"selected"}:{}}},yu=(e,s)=>e.value.toLowerCase().includes(s)||(e.label??"").toLowerCase().includes(s),ju=(e,s,n)=>{if(!Va(e))return[];const a=s.trim().toLowerCase(),r=new Set,o=[];for(const i of n){if(i.email.trim()==="")continue;const c=e==="From"?bu(i):vu(i);if(!c)continue;const u=c.value.toLowerCase();if(!(u===""||r.has(u))&&(r.add(u),u!==a&&!(a!==""&&!yu(c,a))&&(o.push(c),o.length===Ga)))break}return o},ku=250,Cu=2,Nu=(e,s,n)=>{const a=s.trim(),r=ca(a,ku),o=e!==void 0&&Va(e),{data:i}=se({...bt({query:{q:r,limit:Ga}}),enabled:o&&r.length>=Cu});if(!o||e===void 0)return[];const c=[...n.map(u=>({email:u,fromSelection:!0})),...(i?.items??[]).map(u=>({email:u.normalizedEmail,...u.displayName?{displayName:u.displayName}:{}}))];return ju(e,a,c)},Ja=12,wu=e=>{const{envelope:s}=e,n=s.from[0];return{id:s.messageId,sender:n?Aa({normalizedEmail:n.normalizedEmail,displayName:n.displayName}):"Unknown",subject:s.subject??"(No subject)",date:Ge(s.date)}},Su=(e,s)=>{const n=e!==void 0&&s!==void 0,{data:a,isLoading:r}=se({...go({path:{mailboxId:e??""},query:{...s,limit:Ja}}),enabled:n,staleTime:3e4});return{messages:(a?.items??[]).map(Iu),isPending:n&&r}},Iu=e=>({id:e.messageId,sender:e.fromName||e.fromEmail||"Unknown",subject:e.subject??"(No subject)",date:Ge(e.sentDate)}),Ru=e=>yt({queries:e.slice(0,Ja).map(s=>({...zs({path:{messageId:s}}),staleTime:Number.POSITIVE_INFINITY})),combine:s=>({messages:s.map(n=>n.data).filter(n=>n!==void 0).map(wu),isPending:s.some(n=>n.isPending)})}),Mu=(e,s)=>({matchOperator:"Or",literalClauses:wt(e,s)}),Tu=(e,s,n,a)=>{const r=pe(xo()),{mutate:o,reset:i}=r,[c,u]=l.useState(!1),b=l.useMemo(()=>$s(n),[n]),v=l.useMemo(()=>wt(b,a),[b,a]),j=l.useCallback(()=>{!e||!s||(u(!1),o({path:{accountId:e},body:Vt({anchorMessageId:s,matchOperator:"And",literalClauses:[]})}))},[e,s,o]),g=l.useCallback(()=>{u(!1),i()},[i]),p=r.data,m=p?.semanticUnavailable===!0&&!c&&v.length>0;l.useEffect(()=>{!m||!e||(u(!0),o({path:{accountId:e},body:Vt(Mu(b,a))}))},[m,e,b,a,o]);const f=c||(p?.semanticUnavailable??!1),d=r.isPending||m,h=c?{matchOperator:"Or",literalClauses:v}:{...s?{anchorMessageId:s}:{},matchOperator:"And",literalClauses:[]};return{preview:j,reset:g,matchedCount:d?void 0:p?.matchedCount,messageIds:d?void 0:p?.messageIds,semanticUnavailable:f,senderFallback:c,senders:b,matchPredicate:h,isPending:d,isError:r.isError,error:r.error}},Au=()=>[bo({path:{mailboxId:""}}),vo({path:{mailboxId:""}}),yo()].map(e=>[{_id:e[0]._id}]),Eu=e=>jo(e)?e.pages:ko(e)?[e]:[],Fu=e=>typeof e=="object"&&e!==null&&typeof e.messageId=="string",Lu=(e,s)=>{const n=new Set(s),a=new Map;for(const r of e)for(const o of Eu(r))for(const i of o.items){if(!Fu(i)||!n.has(i.messageId))continue;const c=i.subject?.trim();c&&a.set(i.messageId,c)}return s.map(r=>a.get(r)).filter(r=>r!==void 0)},Du=e=>{const s=ue(),n=e.join("\0");return l.useMemo(()=>{const a=Au().flatMap(r=>s.getQueriesData({queryKey:r}).map(([,o])=>o));return Lu(a,e)},[s,n])},Ou=new Set(["hasAttachment","isUnread","isRead","isStarred","category","before","after"]),zu=e=>Ou.has(e),Pu=(e,{searchHadSemanticReach:s})=>{const n=[],a=[];let r,o;for(const u of e.tokens){if(u.type==="from"){n.push({field:"From",value:u.value});continue}if(u.type==="subject"){n.push({field:"Subject",value:u.value});continue}if(u.type==="in"){r={mailboxId:u.mailboxId,label:u.value};continue}if(u.type==="account"){o=u.accountId;continue}zu(u.type)&&a.push({type:u.type,label:sa(u)})}const i=e.freeText.trim(),c=i.length>0;return c&&n.push({field:"HasWords",value:i}),{clauses:n,matchOperator:"all",scopedOut:r,droppedFacets:a,targetAccountId:o,keptTerms:c,droppedSemantic:c&&s}},_u=(e,s,n)=>e.targetAccountId??s??n[0]?.accountId,ut=l.createContext(void 0),Bu=()=>l.useContext(ut),yn={matched:0,applied:0,failed:0,failedIds:[]},Uu=({matched:e,outcome:s,failureReason:n,progressDone:a})=>{if(n!==void 0)return{...yn,state:"commitFailed",failureReason:n};if(!s)return{state:"backApplyRunning",matched:Math.max(e,a),applied:a,failed:0,failedIds:[]};if(!s.cancelled&&s.error===void 0)return{state:"backApplyComplete",matched:Math.max(e,s.done),applied:s.done,failed:0,failedIds:[]};if(!s.cancelled&&s.done===0)return{...yn,state:"commitFailed"};const r=s.failedIds.length>0?s.failedIds.length:Math.max(e-s.done,1);return{state:"runStopped",matched:Math.max(e,s.done),applied:s.done,failed:r,failedIds:s.failedIds}},$u=({failure:e,isStarting:s,isRunning:n,isDone:a,failedCount:r,ruleSaved:o})=>e?.kind==="restartFailed"?"backApplyRestartFailed":e?.kind==="startFailed"?o?"backApplyStartFailed":"commitFailed":a?r>0?"backApplyFailed":"backApplyComplete":e?.kind==="statusUnreadable"?"statusUnknown":s||n?"backApplyRunning":"saving",Ku=e=>{if(e.runState==="statusUnknown")return{kind:"refreshStatus"};if(e.isEscalated)return{kind:"rerunEscalated"};if(e.committedScope==="standing"||e.committedScope==="temporary")return e.createFilterFailed?{kind:"resetAndResend"}:e.backApplyPending?{kind:"startBackApply"}:{kind:"waitOnJob"};if(e.committedScope==="all-like-these"&&e.widenRunsAsJob)return{kind:"resend"};const s=new Set(e.failedIds);return{kind:"rerunBulk",targets:s.size>0?e.sent.filter(n=>s.has(n.id)):e.sent}},qu=e=>e!==void 0&&e.outcome===void 0&&e.failureReason===void 0,Qu=(e,s)=>{if(e){e.stop();return}s()},Hu=(e,s)=>e==="run"?s.dismiss:s.cancel,Wu={clauses:[],matchOperator:"any"},Gu={clauses:[],matchOperator:"all",droppedFacets:[],keptTerms:!1,droppedSemantic:!1},Vu=[],Ju=(e,s,n)=>({verb:"organize",accountId:_u(e,s.accountId,n),selection:Vu,selectionRestriction:void 0,escalated:void 0,searchConversion:e}),Rs={state:"saving",matched:0,applied:0,failed:0,failures:[]},jn=(e,s)=>e.map((n,a)=>({...n,id:`${s}-${a}`})),kn=(e,s,n)=>{if(e==="delete")return{kind:"delete"};if(e==="markRead")return{kind:"markRead"};const a=e==="junk"?n:s;return a?{kind:"move",destinationMailboxId:a}:void 0},at=e=>e==="move"||e==="junk"||e==="organize",Cn=e=>e==="junk"?Wa:"No destination was chosen, so there is nowhere to file these. Go back and pick a folder.";function Yu({verb:e,accountId:s,mailboxId:n,mailboxLabel:a,selection:r,selectionRestriction:o,escalated:i,escalatedProgress:c,searchConversion:u,onFinished:b,onRunEnded:v,step:j,goToStep:g,goBack:p,closeWizard:m}){const[f]=l.useState(()=>u),[d]=l.useState(()=>i),h=f!==void 0,[y,x]=l.useState(h?"properties":"selected"),k=d?"escalated":y,[C,I]=l.useState(()=>f?{clauses:jn(f.clauses,"search"),matchOperator:f.matchOperator}:Wu),[M,w]=l.useState(void 0),[N,T]=l.useState(void 0),[A,K]=l.useState(!1),[L,W]=l.useState(void 0),[P,$]=l.useState(void 0),F=l.useRef(!1),z=l.useMemo(()=>r.map(S=>S.id),[r]),_=l.useMemo(()=>r.map(S=>({id:S.id,accountId:S.accountId})),[r]),B=l.useMemo(()=>r.map(S=>S.email).filter(Boolean),[r]),J=z[0],U=Du(z),{junkMailboxId:Y}=Da(s),{inboxMailboxId:te}=La(s),ae=l.useMemo(()=>te?r.filter(S=>S.mailboxId!==void 0&&S.mailboxId!==te).map(S=>({id:S.id,accountId:S.accountId})):[],[r,te]),Z=Tu(d?void 0:s,J,B,U),{preview:ne}=Z;l.useEffect(()=>{ne()},[ne]);const X=k==="similar"||k==="properties",de=l.useMemo(()=>({matchOperator:C.matchOperator==="all"?"And":"Or",literalClauses:C.clauses.map(S=>({field:S.field,value:S.value}))}),[C.clauses,C.matchOperator]),fe=k==="similar"?Z.matchPredicate:de,{count:me,matchedIds:re}=Vi(X?s:void 0,fe),q=Ru(X?re:[]),R=Su(d?n:void 0,d?.searchQuery),O=d?{status:"ready",count:d.total}:X?me:{status:"ready",count:r.length},{data:V}=se({...us({path:{accountId:s??""}}),enabled:!!s,staleTime:Number.POSITIVE_INFINITY}),he=Oa(s),Oe=Bn(),Ie=l.useMemo(()=>$n({mailboxes:V?.items??[],folderAppointments:he,currentMailboxId:n,translator:Oe}),[V?.items,he,n,Oe]),{createFolderIn:Je}=Un(s),Hs=Ie.find(S=>S.id===C.moveMailboxId)?.label,ze=zc(r.map(S=>({normalizedEmail:S.email,displayName:S.sender}))),Ye=qc({match:k==="properties"&&C.clauses[0]?.value.trim()||void 0,sender:ze?Aa(ze):void 0,folder:Hs}),H=l.useMemo(()=>({...C,name:C.name??Ye}),[C,Ye]),ys=Nu(M?.draft.field,M?.draft.value??"",B),Re=l.useRef(void 0),je=l.useCallback(S=>{Re.current?.(),Re.current=S},[]);l.useEffect(()=>()=>{Re.current?.(),Re.current=void 0},[]);const oe=Ji(s),ge=Yi(s),Pe=cu({mailboxId:n??"",mailboxLabel:a,accountId:s,enabled:!1,predicateKey:"selection-wizard",searchQuery:{},reportEnding:v}),{runAction:_e}=Pe,ie=wo({verb:e,mode:k,scope:C.scope,fromSearch:h}),ee=ie[Ut(ie,j)],Me=So(s,o),Te=Io(k,Me),ke=(S=>{if(S==="folder")return Me.destination;if(S==="rule")return H.scope==="standing"||H.scope==="until"?Te:void 0})(ee)??Ro(ee,H,O),Ae=l.useCallback(()=>jn(wt(B,U),"seed"),[B,U]),js=l.useCallback(S=>{x(S),I(D=>({...D,widen:S==="similar"&&J?{anchorCount:Math.max(r.length,1)}:void 0,...S==="properties"&&D.clauses.length===0?{clauses:Ae()}:{}}))},[J,r.length,Ae]),Be=l.useCallback(()=>{K(!0),x("properties"),I(S=>({...S,widen:void 0,clauses:Ae(),matchOperator:"any"})),g("properties")},[Ae,g]),Ee=qa()===!1,Ue=Ee||Z.semanticUnavailable||Z.isError;l.useEffect(()=>{ee==="match"&&(k!=="similar"||!Ue||A||Be())},[ee,k,Ue,A,Be]);const ks=l.useCallback(()=>{w({mode:"add",draft:{field:"From",value:""}})},[]),Ze=l.useCallback(S=>{const D=C.clauses.find(G=>G.id===S);D&&w({mode:"edit",clauseId:S,draft:{field:D.field,value:D.value}})},[C.clauses]),Xe=l.useCallback(S=>{I(D=>({...D,clauses:D.clauses.filter(G=>G.id!==S)}))},[]),es=l.useCallback(S=>{w(D=>D&&{...D,draft:S})},[]),le=l.useCallback(()=>{w(S=>{if(!S)return;const D=Zi(S.draft.field,S.draft.value),G={...S.draft,value:D};I(ts=>({...ts,clauses:S.clauseId?ts.clauses.map(Xs=>Xs.id===S.clauseId?{...Xs,...G}:Xs):[...ts.clauses,{id:crypto.randomUUID(),...G}]}))})},[]),ve=l.useCallback(()=>{if(ke){T(ee);return}T(void 0);const S=ie[Ut(ie,ee)+1];S&&g(S)},[ke,ee,ie,g]),ss=l.useCallback(async S=>{const D=kn(e,H.moveMailboxId,Y);if(!D){$({matched:S.length,sent:S,failureReason:Cn(e)});return}$({matched:S.length,sent:S});const G=await _e(D,S,je);$({matched:S.length,sent:S,outcome:G.kind==="ran"?G.outcome:void 0,failureReason:G.kind==="refused"?G.reason:void 0})},[e,H.moveMailboxId,Y,_e,je]),Gs=l.useCallback(async()=>{if(!d)return;const S=kn(e,H.moveMailboxId,Y);if(!S){$({matched:d.total,sent:[],failureReason:Cn(e)});return}$({matched:d.total,sent:[]});const D=await d.run(S,je);$({matched:d.total,sent:[],outcome:D.kind==="ran"?D.outcome:void 0,failureReason:D.kind==="refused"?D.reason:void 0})},[d,e,H.moveMailboxId,Y,je]),{start:Tt,watch:At}=oe,{createFilterAsync:Et}=ge,Cs=l.useCallback(()=>{if(d){Gs();return}const S=Xi({mode:y,ruleScope:H.scope}),D=el({mode:y,ruleScope:H.scope,anchorMessageId:J,clauses:H.clauses,matchOperator:H.matchOperator,moveMailboxId:H.moveMailboxId,until:H.until});if(W(S),S==="standing"||S==="temporary"){Et(D,S,(H.name??"").trim()).then(G=>{G&&(At(G.organizeJobId),ae.length>0&&ss(ae))});return}if(S==="all-like-these"&&at(e)){Tt(D);return}ss(S==="just-these"?_:re.map(G=>({id:G,accountId:s})))},[d,Gs,y,H,J,e,s,_,re,Et,At,ae,Tt,ss]),tr=l.useCallback(()=>{if(ke){T(ee);return}F.current||(F.current=!0,g("run"),Cs())},[ke,ee,g,Cs]),Ft=l.useCallback(S=>{const D=oe.progress,G=$u({failure:oe.failure,isStarting:oe.isStarting,isRunning:oe.isRunning,isDone:oe.isDone,failedCount:D.failedCount,ruleSaved:S});return G==="saving"||G==="commitFailed"||G==="backApplyStartFailed"?{...Rs,state:G}:{state:G,matched:D.matchedCount,applied:D.appliedCount,failed:G==="backApplyFailed"||G==="backApplyRestartFailed"?D.failedCount:0,failures:[]}},[oe]),Lt=l.useMemo(()=>{const S=new Map;for(const D of[...r,...q.messages,...R.messages])S.set(D.id,D);return S},[r,q.messages,R.messages]),Dt=d?c:Pe.progress,Vs=l.useCallback(()=>{if(!P)return Rs;const S=Uu({matched:P.matched,outcome:P.outcome,failureReason:P.failureReason,progressDone:Dt?.done??0});return{state:S.state,matched:S.matched,applied:S.applied,failed:S.failed,failures:S.failedIds.map(D=>Lt.get(D)).filter(D=>D!==void 0),failureReason:S.failureReason}},[P,Dt,Lt]),Js=ge.data,Ot=P!==void 0&&(P.failureReason!==void 0||(P.outcome?.failedIds.length??0)>0),Fe=d?Vs():L==="standing"||L==="temporary"?ge.isError?{...Rs,state:"commitFailed"}:ge.isSuccess?Ot?Vs():Ft(!0):Rs:L==="all-like-these"&&at(e)?Ft(!1):Vs(),nr=()=>{if((L==="standing"||L==="temporary")&&Ot&&P){const G=new Set(P.outcome?.failedIds??[]);ss(G.size>0?P.sent.filter(ts=>G.has(ts.id)):P.sent);return}const D=Ku({runState:Fe.state,isEscalated:d!==void 0,committedScope:L,createFilterFailed:ge.isError,backApplyPending:Js!==void 0,widenRunsAsJob:at(e),failedIds:P?.outcome?.failedIds??[],sent:P?.sent??_});switch(D.kind){case"refreshStatus":oe.refreshStatus();return;case"rerunEscalated":Gs();return;case"resetAndResend":ge.reset(),Cs();return;case"resend":Cs();return;case"startBackApply":Js&&oe.startForFilter(Js.filterId);return;case"waitOnJob":return;case"rerunBulk":ss(D.targets);return}},ar=l.useCallback(()=>{m(ie,ee)},[m,ie,ee]),Ys=l.useCallback(()=>{m(ie,ee),b()},[m,ie,ee,b]),{stop:zt}=Pe,rr=l.useCallback(()=>{Qu(d,zt)},[d,zt]);Vc({shouldBlockFn:({action:S})=>S!=="BACK"?!1:(Ys(),!0),enableBeforeUnload:!1,disabled:ee!=="run"});const Zs={messages:d?R.messages:X?q.messages:r,count:O,label:k==="selected"?"Your selection":"A sample of what matches",emptyReason:k==="similar"&&Ue?"notIndexed":"noMatch",loading:d?R.isPending:X&&(O.status==="loading"||q.isPending)};return t.jsx(Mo,{verb:e,steps:ie,step:ee,blockedReason:ke,nudged:N===ee,onBack:p,onExit:Hu(ee,{dismiss:Ys,cancel:ar}),onContinue:ve,onCommit:tr,match:{selectedCount:r.length,mode:k,accountId:Me.accountId,onModeChange:js,semanticUnavailable:Ue,semanticOff:Ee,semanticErrorDetail:Z.error instanceof Error?Z.error.message:void 0,semanticFallbackTaken:A,onSemanticFallback:Be,escalatedScope:d?.scope,sample:Zs},properties:{clauses:H.clauses,matchOperator:H.matchOperator,onMatchOperatorChange:S=>I(D=>({...D,matchOperator:S})),clauseEdit:M,onStartAddClause:ks,onStartEditClause:Ze,onRemoveClause:Xe,onChangeDraft:es,onSubmitClause:le,onCancelClause:()=>w(void 0),clauseFields:sl,clauseSuggestions:ys,conversionNotice:f?Hc(f):void 0,semanticFallbackTaken:A,sample:{...Zs,label:"What this matches"}},folder:{folders:Ie,mailboxId:H.moveMailboxId,delimiter:Kn(V?.items??[]),onSelect:S=>I(D=>({...D,moveMailboxId:S})),onCreateFolder:s?Je:void 0,restriction:Me.destination},rule:{draft:H,onScopeChange:S=>I(D=>({...D,scope:S})),onUntilChange:S=>I(D=>({...D,until:S})),restriction:Te},name:{name:H.name??"",onNameChange:S=>I(D=>({...D,name:S})),nudged:N===ee},review:{verb:e,mode:k,selectedCount:r.length,clauses:H.clauses,matchOperator:H.matchOperator,folder:Hs,scope:H.scope,until:H.until,ruleName:ie.includes("name")?H.name:void 0,escalatedScope:d?.scope,sample:Zs},run:{state:Fe.state,verb:e,scope:H.scope,matched:Fe.matched,applied:Fe.applied,failedCount:Fe.failed,failures:Fe.failures,failureReason:Fe.failureReason,onRetry:nr,onDismiss:Ys,onCancelRun:qu(P)?rr:void 0}})}function qf(e){const s=Co()==="search",n=Bu(),{accounts:a}=xs(),{step:r,goToStep:o,goBack:i,closeWizard:c}=No(s?"properties":"match");if(_s({id:"selection-wizard",open:r!==void 0}),!r)return null;const u=s?n??Gu:void 0;return t.jsx(Yu,{...e,...u?Ju(u,e,a):{},step:r,goToStep:o,goBack:i,closeWizard:c})}const Zu=[],Rt=l.createContext(null),Xu=e=>{const s=l.useContext(Rt);return s?s.rowInteraction(e):null},em=()=>{const e=l.useContext(Rt);if(!e)throw new Error("useThreadListSelection must be used inside <ThreadListInteraction>");return e},sm="[data-message-id]",tm=e=>Array.from(e.querySelectorAll(sm)).map(s=>s.dataset.messageId).filter(s=>s!==void 0),nm=(e,s)=>e.length===s.length&&e.every((n,a)=>n===s[a]),am=e=>{const[s,n]=l.useState([]);return l.useEffect(()=>{const a=e.current;if(!a)return;const r=()=>{const i=tm(a);n(c=>nm(c,i)?c:i)};r();const o=new MutationObserver(r);return o.observe(a,{childList:!0,subtree:!0}),()=>o.disconnect()},[e]),s};function Qf({selectedMessageId:e,rows:s,onOpen:n,onDeleteMessages:a,onSelectionVerb:r,isDeleting:o=!1,commandsRef:i,onTriageContextChange:c,children:u}){const b=xt(),{pushError:v}=be(),j=l.useRef(null),g=am(j),p=Wc({orderedIds:g,isDesktop:b,initialFocusedId:e}),{focusedMessageId:m,setFocusedMessageId:f,pendingDomFocusRef:d,cursorMovedByPointerRef:h,selection:y,isMultiSelectMode:x,exitSelection:k,handleRowSelect:C}=p,{selectedIds:I,selectedCount:M,isSelected:w,toggle:N,select:T,toggleAll:A}=y,K=g.length>0&&g.every(q=>I.has(q)),L=l.useCallback(()=>{g.length>0&&A(g)},[g,A]),{intersectWith:W}=y;l.useEffect(()=>{W(g)},[W,g]),l.useEffect(()=>{const q=d.current;q!==null&&(d.current=null,j.current?.querySelector(`[data-message-id="${q}"]`)?.focus())});const P=l.useCallback(q=>{h.current=!0,f(q)},[h,f]),$=l.useCallback(q=>{b||T(q)},[b,T]),F=l.useCallback(()=>{m&&n(m)},[m,n]),z=l.useCallback(q=>n(q,{replace:!0}),[n]);uu({keyboardFocusedMessageId:p.keyboardFocusedMessageId,openMessageId:e,enabled:b&&M===0,open:z});const[_,B]=l.useState(null),{outcome:J,staleFolderLabel:U,guessedMailboxId:Y}=iu(_?.targets??Zu),te=l.useCallback(q=>{if(_!==null)return!0;if(M>0)return r(q),!0;if(q!=="delete"||!m)return!1;const R=s.find(O=>O.id===m);return!R?.mailboxId||!R.accountId?(v({title:"Couldn't delete this message",detail:"This list has lost track of which account and folder it is in, so reader can't tell whether deleting it would move it to Trash or erase it. Nothing was deleted.",action:{label:"Reload the list",href:window.location.href}}),!0):(B({ids:[m],targets:[{accountId:R.accountId,mailboxId:R.mailboxId}]}),!0)},[_,M,r,m,s,v]),ae=l.useCallback(q=>{q.length!==0&&(a(q),B(null),k())},[a,k]),Z=l.useCallback(()=>B(null),[]),ne=l.useCallback(()=>M===0?!1:(k(),!0),[M,k]),X=g.length>0;l.useEffect(()=>{if(i){if(!X){i.current=null;return}return i.current={focusNext:p.focusNext,focusPrevious:p.focusPrevious,focusFirst:p.focusFirst,focusLast:p.focusLast,openFocused:F,toggleSelect:p.toggleFocusedSelection,extendSelectDown:p.extendRangeDown,extendSelectUp:p.extendRangeUp,selectAll:p.selectAllLoaded,clearSelection:ne,requestVerb:te,toggleDensity:()=>{}},()=>{i.current=null}}},[i,X,p.focusNext,p.focusPrevious,p.focusFirst,p.focusLast,p.toggleFocusedSelection,p.extendRangeDown,p.extendRangeUp,p.selectAllLoaded,F,ne,te]);const de=l.useMemo(()=>Array.from(I),[I]),fe=_!==null;l.useEffect(()=>{c?.({focusedMessageId:m,selectedIds:de,orderedIds:g,hasList:X})},[c,m,de,g,X]);const me=hu(g,m),re=l.useMemo(()=>({selectedIds:I,selectedCount:M,exitSelection:k,startSelectionVerb:r,orderedIds:g,allSelected:K,toggleAllLoaded:L,rowInteraction:q=>({focused:q===m,isTabStop:q===me,isDesktop:b,onFocusRow:P,selection:{isChecked:w(q),onToggleCheck:N,onRowSelect:C,isMultiSelectMode:x,onLongPress:$}})}),[I,M,k,r,g,K,L,m,me,b,P,w,N,C,x,$]);return t.jsxs(Rt.Provider,{value:re,children:[t.jsx("div",{ref:j,className:"contents",children:u}),t.jsx(xu,{isOpen:fe,messageIds:_?.ids??[],outcome:J,accountId:_?.targets[0]?.accountId,staleFolderLabel:U,guessedMailboxId:Y,isDeleting:o,onConfirm:ae,onCancel:Z})]})}function Hf({title:e,isDeleting:s}){const n=gu(),{selectedCount:a,exitSelection:r,startSelectionVerb:o,orderedIds:i,allSelected:c,toggleAllLoaded:u}=em();return t.jsx(bc,{title:n.title||e,navSlot:n.navSlot,titleMeta:n.titleMeta,searchSlot:n.searchSlot,searchField:n.searchField,idleSlot:n.makeFilterSlot,count:a,onCancel:r,onDelete:()=>o("delete"),onMarkRead:()=>o("markRead"),isBusy:s,selectAll:i.length>0?{checked:c,indeterminate:a>0&&!c,onChange:u}:void 0})}const rt=e=>{e.preventDefault(),e.stopPropagation()},rm=(e,s)=>{const n=l.useRef(!1),a=l.useCallback(i=>{if(n.current=!1,i.button!==0)return;const c=lt(i);Zt(c)&&s?.(e,c)&&(rt(i),n.current=!0,i.currentTarget.focus(),c.shiftKey&&window.getSelection()?.removeAllRanges())},[s,e]),r=l.useCallback(i=>{!i.ctrlKey||!s||i.preventDefault()},[s]),o=l.useCallback(i=>{if(n.current)return n.current=!1,rt(i),!0;const c=lt(i);return!Zt(c)||!s?.(e,c)?!1:(rt(i),c.shiftKey&&window.getSelection()?.removeAllRanges(),!0)},[s,e]);return{onMouseDown:a,onContextMenu:r,claimClick:o}},om=({thread:e,active:s=!1,focused:n,isTabStop:a,density:r="comfortable",isDesktop:o,badge:i,selection:c,inListbox:u=!1,link:b,onClick:v,onFocusRow:j})=>{const g=ue(),p=e.id,m=Xu(p),f=n??m?.focused??!1,d=a??m?.isTabStop??!1,h=c??m?.selection,y=j??m?.onFocusRow,x=o??m?.isDesktop??!0,k=h?.isChecked??!1,C=h?.isMultiSelectMode??!1,I=h?.onToggleCheck,M=h?.onRowSelect,w=h?.onLongPress,N=l.useCallback(_=>{_.preventDefault(),_.stopPropagation(),I?.(p)},[I,p]),T=rm(p,M),A=l.useCallback(_=>{if(!T.claimClick(_)){if(!x){if(C){_.preventDefault(),_.stopPropagation(),I?.(p);return}v?.();return}M?.(p,lt(_)),v?.()}},[T,x,C,I,M,v,p]),K=l.useCallback(()=>{w?.(p)},[w,p]),{longPressProps:L}=oc({onLongPress:K,accessibilityDescription:k?"Deselect message":"Select message"}),W=l.useCallback(()=>{g.prefetchQuery(zs({path:{messageId:p}}))},[g,p]),P=l.useCallback(()=>{W(),y?.(p)},[W,y,p]),$=da({"data-list-row":"","data-message-row":!0,"data-message-id":p,...u?{role:"option","aria-selected":k}:{},tabIndex:d?0:-1,onClick:A,onMouseDown:T.onMouseDown,onContextMenu:T.onContextMenu,onMouseEnter:W,onFocus:P},x||!h?{}:L),F=E(r==="compact"?xa({active:s,focused:f}):E("group",Ct({active:s,focused:f})),"outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-inset",k&&"bg-accent-soft",!x&&"min-h-11 select-none [-webkit-touch-callout:none]"),z=r==="compact"?t.jsx(ba,{thread:e}):t.jsx(Nt,{thread:e,badge:i,selection:h?{checked:k,alwaysVisible:C,onToggle:N}:void 0});return b===void 0?t.jsx("button",{type:"button",...$,className:F,children:z}):t.jsx(Vn,{to:"/mail/$mailboxId/$threadId/$messageId",params:{...b,messageId:p},search:_=>_,variant:"row",...$,className:F,children:z})},Wf=l.memo(om),im="Open a message first",lm="This conversation hasn't loaded yet",cm="The mailbox list hasn't loaded yet",dm="Couldn't find this mailbox's account — reload to try again",um={reply:"Reply",replyAll:"Reply all",forward:"Forward",delete:"Move to Trash",move:"Move to mailbox",flag:"Star"},Gf=({hasThread:e,messageId:s,intelligenceOpen:n,canToggleIntelligence:a,onToggleIntelligence:r,onReply:o,onReplyAll:i,onForward:c,onDelete:u,onToggleStar:b,isStarred:v,moveContext:j,moveContextLoading:g})=>{const[p,m]=l.useState(null),f=s??null,d=w=>e?w==="move"?j?null:g?cm:dm:{reply:o,replyAll:i,forward:c,delete:u,flag:b}[w]?null:lm:im,h=p&&p.messageId===f?p:null,y=h?d(h.action):null,x=h?.action==="move"&&h.overThread&&!!j,k=y??(h&&!x?`${um[h.action]} is ready — press it again`:null),C=w=>m({action:w,messageId:f,overThread:e}),I=w=>()=>C(w),M=(w,N)=>N?()=>{m(null),N()}:I(w);return t.jsx($l,{hasThread:e,isStarred:v,onUnavailable:C,unavailableHint:k,replyTitle:`Reply ${ns("reply")}`,replyAllTitle:`Reply all ${ns("replyAll")}`,forwardTitle:`Forward ${ns("forward")}`,deleteTitle:`Move to Trash ${ns("delete")}`,flagTitle:`Star ${ns("toggleStar")}`,onReply:M("reply",o),onReplyAll:M("replyAll",i),onForward:M("forward",c),onDelete:M("delete",u),onToggleStar:M("flag",b),onMove:I("move"),moveSlot:j?t.jsx(Qs,{accountId:j.accountId,currentMailboxId:j.currentMailboxId,onMove:j.onMove,label:"Move to mailbox",defaultOpen:x}):void 0,children:t.jsx(Bl,{open:n,enabled:a,onToggle:r})})};function mm(e){const[s,n]=l.useState(null);s!==null&&s!==e&&n(null);const a=e!==null&&s===e,r=l.useCallback(()=>n(null),[]),o=l.useCallback(()=>n(e),[e]),i=l.useCallback(()=>n(a?null:e),[a,e]);return{isOpen:a,open:o,close:r,toggle:i}}const Vf=e=>{const{intelligenceOpen:s,onToggleIntelligence:n,onRaiseIntelligence:a}=xs(),r=Jn()?.showIntelligencePane??!1,o=e??null,i=mm(o),c=!r&&i.isOpen,{open:u,toggle:b}=i,v=l.useCallback(()=>{if(r){n();return}b()},[r,n,b]),j=l.useCallback(()=>{!r||s||a()},[r,s,a]),g=l.useCallback(()=>{if(!r){u();return}j()},[r,u,j]);return{canToggle:o!==null,isShowing:o!==null&&(r?s:c),toggle:v,open:g,drawerOpen:c,closeDrawer:i.close,railFits:r,openRail:j}},Jf=(e,{toggle:s,open:n})=>{l.useEffect(()=>(e.current={toggle:s,open:n},()=>{e.current=null}),[e,s,n])},fm=()=>{const e=ue();return l.useCallback(s=>{const n=Se({path:{threadId:s.threadId}}),r=e.getQueriesData({queryKey:n}).flatMap(([,o])=>o?.items.map(i=>i.messageId)??[]);return r.length>0?r:[s.messageId]},[e])},hm=[],Ya=e=>{const{data:s}=se({...Hn({path:{threadId:e??""}}),enabled:!!e});return s?.items??hm},Yf=(e,s)=>{const n=Ya(e),a=s?n.find(o=>o.messageId===s):void 0,r=n.length>0?n[n.length-1]:void 0;return a??r},Zf=({thread:e,isOpen:s=!1,mailboxId:n,accountId:a,onAfterOptimisticRemove:r})=>{const o=n??e?.mailboxId,i=a??e?.accountId,{accountId:c}=Ks(i?void 0:o),u=i??c,b=fm(),{deleteMessages:v}=qs({mailboxId:o??"",threadId:e?.threadId,accountId:u,onAfterOptimisticRemove:r}),{moveMessages:j}=vs({mailboxId:o??"",threadId:e?.threadId,accountId:u,onAfterOptimisticRemove:r}),g=Ya(s?e?.threadId:void 0),m=g.find(x=>x.messageId===e?.messageId)?.hasStars??e?.hasStars,{toggleStar:f}=Ea({threadId:e?.threadId??"",mailboxId:o??"",messages:g}),d=l.useCallback(()=>{e&&v(b(e))},[e,b,v]),h=l.useCallback(x=>{e&&j(b(e),x)},[e,b,j]),y=l.useCallback(()=>{e&&f(e.messageId,m??!1)},[e,m,f]);return{mailboxId:o,accountId:u,isStarred:m,deleteThread:d,moveThread:h,toggleStar:y}},Nn=(e,s,n)=>{if(!s)return null;const a=e.indexOf(s);if(a===-1)return null;const r=n==="next"?a+1:a-1;return r<0||r>=e.length?null:e[r]},Xf=()=>{const[e,s]=l.useState(void 0),[n,a]=l.useState([]),[r,o]=l.useState([]),i=l.useRef(null),[c,u]=l.useState(!1),b=l.useCallback(v=>{s(v.focusedMessageId),a(v.selectedIds),v.orderedIds&&o(v.orderedIds),u(v.hasList)},[]);return{listCommandsRef:i,onTriageContextChange:b,focusedMessageId:e,selectedIds:n,orderedIds:r,hasList:c}},eh=({context:e,orderedIds:s,selectedMessageId:n,enabled:a=!0,onClose:r,handlers:o,hasOpenThread:i=!1})=>{const{listCommandsRef:c,hasList:u}=e,b=l.useCallback(()=>{c.current?.clearSelection()||n&&r()},[c,n,r]),{reply:v,replyAll:j,forward:g,...p}=o;return qo({enabled:a,handlers:{...u?{focusNext:()=>c.current?.focusNext(),focusPrevious:()=>c.current?.focusPrevious(),focusFirst:()=>c.current?.focusFirst(),focusLast:()=>c.current?.focusLast(),openFocused:()=>c.current?.openFocused(),toggleSelect:()=>c.current?.toggleSelect(),extendSelectDown:()=>c.current?.extendSelectDown(),extendSelectUp:()=>c.current?.extendSelectUp(),selectAll:()=>c.current?.selectAll(),toggleDensity:()=>c.current?.toggleDensity()}:{},back:b,...p,...i?{}:{reply:v,replyAll:j,forward:g}}}),{goBack:b,nextMessageId:Nn(s,n,"next")??void 0,previousMessageId:Nn(s,n,"previous")??void 0}},pm={unread:"unread",flagged:"starred",attachment:"attachments"},gm=new Set(Object.values(To)),Za=e=>gm.has(e),sh=e=>Za(e.category)||e.attributes.size>0,th=e=>{const s={};Za(e.category)&&(s.category=[e.category]);for(const n of e.attributes){const a=pm[n];a&&(s[a]=!0)}return s},nh=e=>(e.senderTrust?.length??0)>0||e.dkimMismatch!==void 0?"loaded-pages":"whole-folder",xm=["category","unread","starred","attachments","accountId","muted"],wn=e=>JSON.stringify(xm.map(s=>e?.[s]??null)),bm=e=>{if(!Array.isArray(e))return;const[s]=e;if(typeof s!="object"||s===null)return;const n=s.query;if(!(typeof n!="object"||n===null))return n},ah=(e,s)=>{const n=bm(e);return n?wn(n)===wn(s):!1},rh=e=>Gn(e)?Os[e]:void 0,vm={sender:"sender",recipient:"recipient",subject:"subject",attachment:"attachment",body:"body",entities:"entities"};function ym(e){return vm[e]??e}function oh(e,s){const{folder:n}=vt(s,[e.mailboxId]);return{id:e.messageId,sender:e.fromName??e.fromEmail??"Unknown",...e.fromEmail?{senderEmail:e.fromEmail}:{},subject:e.subject??"(No subject)",snippet:e.snippet??"",date:Ge(e.sentDate),unread:!e.isRead,flagged:e.hasStars===!0,threadId:e.threadId,mailboxId:e.mailboxId,...n?{folder:n}:{}}}function ih(e,s){const{folder:n}=vt(s,e.mailboxId?[e.mailboxId]:[]);return{id:e.id,sender:e.fromName,...e.fromEmail?{senderEmail:e.fromEmail}:{},subject:e.subject,snippet:e.snippet,date:e.timeLabel,unread:!e.isRead,flagged:e.starred===!0,...e.threadId?{threadId:e.threadId}:{},...e.mailboxId?{mailboxId:e.mailboxId}:{},...n?{folder:n}:{}}}function jm(e,s){const{mailboxId:n,folder:a}=vt(s,e.mailboxIds);return{id:e.messageId,sender:e.fromName??"Unknown",subject:e.subject??"(No subject)",snippet:"",date:e.sentDate!=null?Ge(e.sentDate*1e3):"",threadId:e.threadId,matchedChunkLabel:ym(e.matchedChunkType),score:e.score,...n?{mailboxId:n}:{},...a?{folder:a}:{}}}function lh(e,s,n){const a=new Set(s),r=[];for(const o of[...e].sort((i,c)=>c.score-i.score))a.has(o.threadId)||(a.add(o.threadId),r.push(jm(o,n)));return r}function km(e){const s=e.authenticity?.dkimMismatch===!0;return{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:Ge(e.sentDate),sentDate:e.sentDate,isRead:e.isRead,hasAttachment:e.hasAttachment,starred:e.hasStars===!0,trust:e.senderTrust,category:Fa(e.category),suspicious:s,...Ad(e)}}const Cm=Ao;function ch(e){const s=new Map(e.map(a=>[a.category,a])),n=[];for(const a of Cm){const r=s.get(a);!r||!(r.loading||r.failed||r.rows.length>0||r.total.kind==="exact"&&r.total.value>0)||n.push({id:a,label:Os[a],threads:r.rows,total:r.total,atCap:r.atCap,loading:r.loading,error:r.failed})}return n}function Nm(e,s){return s.every(n=>{switch(n.type){case"from":{const a=n.value.toLowerCase();return e.fromEmail.toLowerCase().includes(a)||e.fromName.toLowerCase().includes(a)}case"subject":return e.subject.toLowerCase().includes(n.value.toLowerCase());case"category":return(e.category??"uncategorized")===n.category;case"hasAttachment":return e.hasAttachment===!0;case"isUnread":return!e.isRead;case"isRead":return e.isRead===!0;case"isStarred":return e.starred===!0;case"after":return e.sentDate!=null&&e.sentDate>=n.epochSeconds*1e3;case"before":return e.sentDate!=null&&e.sentDate<n.epochSeconds*1e3;case"in":return e.mailboxId===n.mailboxId;case"account":return e.accountId===n.accountId;default:return!1}})}const wm=["from","subject","category","unread","starred","attachments"],Ms=e=>e[0],Sm=e=>{const s=Ms(e.filter(c=>c.type==="from").map(c=>c.value)),n=Ms(e.filter(c=>c.type==="subject").map(c=>c.value)),a=Ms(e.filter(c=>c.type==="category").map(c=>c.category)),r=Ms(e.filter(c=>c.type==="isUnread"||c.type==="isRead").map(c=>c.type==="isUnread")),o=e.some(c=>c.type==="isStarred")?!0:void 0,i=e.some(c=>c.type==="hasAttachment")?!0:void 0;return{...s!==void 0?{from:s}:{},...n!==void 0?{subject:n}:{},...a!==void 0?{category:[a]}:{},...r!==void 0?{unread:r}:{},...o!==void 0?{starred:o}:{},...i!==void 0?{attachments:i}:{}}},Im=(e,s)=>{switch(s.type){case"from":return e.from?.toLowerCase()===s.value.toLowerCase();case"subject":return e.subject?.toLowerCase()===s.value.toLowerCase();case"category":return e.category?.length===1&&e.category[0]===s.category;case"isUnread":return e.unread===!0;case"isRead":return e.unread===!1;case"isStarred":return e.starred===!0;case"hasAttachment":return e.attachments===!0;case"before":case"after":case"in":case"account":return!1}},Sn=(e,s)=>Object.fromEntries(Object.entries(e).filter(([n])=>s.includes(n)));function dh(e,s={},n=wm){const a=Sn(Sm(e),n),r={...a,...Sn(s,n)};return{params:a,residual:e.filter(o=>!Im(r,o))}}function uh(e,s,n){if(s.length===0)return e;const a=[...s];return e.filter(r=>{const o=km(r);return Nm({...o,accountId:o.accountId??n},a)})}const Xa=8;function Mt(e,s){const n=Math.max(0,Math.min(s,e.length)),a=ti(e).find(o=>n>=o.start&&n<=o.end);if(!a)return{start:n,end:n,raw:""};const r=ni(a.raw);return r?{start:a.start,end:a.end,raw:a.raw,name:r.name,value:r.value}:{start:a.start,end:a.end,raw:a.raw}}function Rm(e,s){const n=Mt(e,s);if(n.name===void 0)return{kind:"token",query:n.raw};const a=ta(n.name);if(a)return{kind:"value",token:a.name,source:a.values,query:n.value??""}}const Mm={mailbox:"mailboxes",account:"accounts",contact:"contacts"},Tm=(e,s)=>{if(e.values==="fixed")return e.options??[];const n=Mm[e.values];return n?s[n]??[]:[]},Am=(e,s)=>{if(s==="")return 1;const n=e.toLowerCase();return n.startsWith(s)?0:n.includes(s)?1:-1},mt=(e,...s)=>{let n=-1;for(const a of s){if(a===void 0)continue;const r=Am(a,e);r<0||(n<0||r<n)&&(n=r)}return n},er=e=>{const s=new Set;return e.filter(n=>n.rank>=0).sort((n,a)=>n.rank-a.rank).filter(n=>{const a=n.suggestion.value.toLowerCase();return s.has(a)?!1:(s.add(a),!0)}).slice(0,Xa).map(n=>n.suggestion)},In=e=>({value:`${e.name}:`,label:`${e.name}:`,hint:e.label});function Em(e){const s=e.trim().toLowerCase();if(s==="")return $t.map(In);const n=[];for(const a of $t)if(n.push({rank:mt(s,`${a.name}:`,a.label),suggestion:In(a)}),a.values==="fixed")for(const r of a.options??[]){const o=na(a.name,r.value);n.push({rank:mt(s,o,r.label),suggestion:{value:o,label:r.label??o,hint:o}})}return er(n)}function Fm(e,s,n){const a=s.trim().toLowerCase(),r=Tm(e,n).map(o=>({rank:mt(a,o.value,o.label),suggestion:{value:na(e.name,o.value),label:o.label??o.value,...o.hint?{hint:o.hint}:{}}}));return er(r)}function Lm(e,s,n={}){const a=Mt(e,s);if(a.name===void 0)return Em(a.raw);const r=ta(a.name);return r?Fm(r,a.value??"",n):[]}function Dm(e,s,n){const a=Mt(e,s),r=!n.value.endsWith(":"),o=/\s/.test(e.slice(a.end,a.end+1)),i=r&&!o?`${n.value} `:n.value;return{query:e.slice(0,a.start)+i+e.slice(a.end),cursor:a.start+i.length+(r&&o?1:0)}}const Om=e=>({value:e.normalizedEmail,...e.displayName?{label:e.displayName,hint:e.normalizedEmail}:{}}),zm=250,Pm=2;function _m({query:e,cursor:s,enabled:n}){const{accounts:a}=xs(),{mailboxesByName:r}=aa(),o=r!==void 0,i=n?Rm(e,s):void 0,c=i?.source==="contact"?i.query.trim():"",u=ca(c,zm),{data:b}=se({...bt({query:{q:u,limit:Xa}}),enabled:u.length>=Pm}),v=yt({queries:a.map(m=>({...us({path:{accountId:m.accountId}}),staleTime:1/0}))}),j=l.useMemo(()=>o?Qo(v.map(m=>m.data?.items??[]),a):[],[o,v,a]),g=l.useMemo(()=>Ho(a),[a]),p=l.useMemo(()=>(b?.items??[]).map(Om),[b]);return l.useMemo(()=>{if(!n)return[];const m=Lm(e,s,{mailboxes:j,accounts:g,contacts:p});return o?m:m.filter(f=>f.value!=="in:")},[n,e,s,j,g,p,o])}const sr="remit.recentSearches",Bm=5;function ft(){try{const e=localStorage.getItem(sr);if(!e)return[];const s=JSON.parse(e);return Array.isArray(s)?s.filter(n=>typeof n=="string"):[]}catch{return[]}}function Rn(e){const s=e.trim();if(!s)return ft();const n=[s,...ft().filter(a=>a!==s)].slice(0,Bm);try{localStorage.setItem(sr,JSON.stringify(n))}catch{return n}return n}const Um=e=>e.tier!=="phone"&&e.hasLiveInput&&!(e.bodyRendersCommittedResults&&e.hasCommittedQuery),ht=l.createContext(null);function $m(){const e=l.useContext(ht),{searchInput:s,onSearchChange:n,onSearchClear:a}=xs();if(!e)throw new Error("ListHeaderSearchField rendered outside MailListHeader's HeaderSearchContext provider");return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"min-w-0 flex-1",children:t.jsx(Zn,{value:s,onChange:n,onClear:a,globalFocusKey:!1,showClearButton:!1,suggest:e.suggest})}),t.jsx(Q,{variant:"ghost",size:"touch",icon:t.jsx(qe,{className:"size-5"}),onClick:e.onClose,"aria-label":"Close search",className:"shrink-0"}),t.jsx(Yn,{})]})}function mh({title:e,unreadCount:s,children:n,selectionBar:a,paneOverlay:r,footer:o,searchFilter:i,searchResults:c,searchLoading:u,relatedResults:b,relatedLoading:v,onSelectSearchResult:j,searchResultsLabel:g="Top matches",relatedResultsLabel:p="Related",searchResultsInBody:m=!1,spamOffer:f,refreshControl:d}){const{accounts:h,resultFolderIndex:y,searchQuery:x,searchInput:k,onSearchChange:C,onSearchClear:I,searchViewKey:M}=xs(),w=aa(),N=Wo(),T=Jn(),A=nl(),[K,L]=l.useState(!1),[W,P]=l.useState(ft),$=Eo(),F=l.useRef(M);l.useEffect(()=>{F.current!==M&&(F.current=M,L(!1))},[M]);const[z,_]=l.useState(0),[B,J]=l.useState(!1),[U,Y]=l.useState(void 0),te=_m({query:k,cursor:z,enabled:B&&k.trim().length>0}),ae=l.useCallback(le=>{const ve=Dm(k,z,le);C(ve.query),Y({cursor:ve.cursor})},[k,z,C]),Z=Fo({count:te.length,onAccept:le=>{const ve=te[le];ve&&ae(ve)}}),{comboboxProps:ne,handleKeyDown:X}=Z,de=l.useMemo(()=>({comboboxProps:ne,onKeyDown:X,onCaretChange:_,onFocusChange:J,...U?{caret:U}:{}}),[ne,X,U]),fe=l.useCallback(()=>{I(),L(!1)},[I]),me=l.useMemo(()=>({suggest:de,onClose:fe}),[de,fe]),re=Z.open?t.jsx(zo,{id:Z.listId,suggestions:te,activeIndex:Z.activeIndex,optionId:Z.optionId,onPick:ae,onHighlight:Z.setActiveIndex,label:"Search suggestions",className:"mx-row-inset mt-1 shrink-0"}):null,q=k.trim().length>0,{mailboxesByName:R,accountsByName:O}=w,V=l.useMemo(()=>ai(k,{mailboxesByName:R,accountsByName:O}),[k,R,O]),he=l.useMemo(()=>V.tokens.map(le=>({label:sa(le),onRemove:()=>C(ri(k,le))})),[V,k,C]),Oe=l.useMemo(()=>c??[],[c]),Ie=l.useMemo(()=>b??[],[b]),Je=l.useMemo(()=>q?[{id:"top",label:g,results:Oe},{id:"related",label:p,results:Ie}]:[],[q,g,p,Oe,Ie]),ze=!(Oe.length+Ie.length>0)&&(u===!0||v===!0),{scope:Ye}=Go(h),H=Lo(),ys=rl(H),Re=ys?y.get(ys)?.role:void 0,je=l.useMemo(()=>ol(H,Ye,Re),[H,Ye,Re]),oe=je.kind==="global"?f:void 0,ge=l.useMemo(()=>oe?{kind:"global",spamCount:oe.count,onScopeToSpam:()=>N(oe.mailboxId,x)}:je,[oe,je,N,x]),Pe=Ie.length>0,_e=l.useMemo(()=>Pu(V,{searchHadSemanticReach:Pe}),[V,Pe]),ie=q?_e:void 0,ee=l.useCallback(()=>{L(!1),$("properties","search")},[$]),Me=Qc(_e)?void 0:Do(_e.droppedFacets.map(le=>le.label)),Te=l.useMemo(()=>q?{onClick:ee,blockedReason:Me}:void 0,[q,Me,ee]),Ws=l.useMemo(()=>Te?t.jsx(Sa,{...Te}):null,[Te]),ke=Um({tier:A,hasLiveInput:q,hasCommittedQuery:x.trim().length>0,bodyRendersCommittedResults:m}),Ae=l.useCallback(le=>{P(Rn(k)),j?.(le)},[k,j]),js=l.useMemo(()=>t.jsx(Ia,{value:k,sections:Je,loading:ze,onSelectResult:Ae,tokens:he,scope:ge}),[k,Je,ze,Ae,he,ge]),Be=a===void 0,Ee=l.useMemo(()=>ke?t.jsx("div",{className:"h-full overflow-y-auto",children:js}):null,[ke,js]),Ue=Ee&&!Be?Ee:n,ks=Ee&&Be?Ee:null,Ze=al(A),Xe=Ze&&(K||q),es=l.useMemo(()=>({title:e,searchResults:ks,makeFilterSlot:Ws,navSlot:T&&!T.showNavPane&&t.jsx(Q,{variant:"ghost",size:"touch",icon:t.jsx(il,{className:"size-5"}),onClick:()=>T.openNav(),"aria-label":"Menu",className:"-ml-2 shrink-0"}),titleMeta:t.jsxs(t.Fragment,{children:[s===null?null:t.jsxs("span",{className:"shrink-0 text-2xs text-fg-subtle",children:[s.toLocaleString()," unread"]}),t.jsx(Yn,{}),d]}),searchSlot:Ze&&!Xe&&t.jsx(Q,{variant:"ghost",size:"touch",icon:t.jsx(Oo,{className:"size-5"}),onClick:()=>L(!0),"aria-label":"Search",className:"shrink-0"}),searchField:Xe&&t.jsx($m,{})}),[e,s,T,Ze,Xe,ks,Ws,d]);if(A==="phone"&&K){const le=ve=>{P(Rn(k)),L(!1),j?.(ve)};return t.jsx(ht.Provider,{value:me,children:t.jsx(ut.Provider,{value:ie,children:t.jsxs(dt.Provider,{value:es,children:[t.jsx(xc,{value:k,onChange:C,onClear:I,onCancel:()=>{L(!1),I()},filter:i,recentSearches:W,onPickRecent:C,makeFilter:Te,sections:Je,loading:ze,onSelectResult:le,tokens:he,scope:ge,suggest:de,suggestList:re}),r]})})})}return t.jsx(ht.Provider,{value:me,children:t.jsx(ut.Provider,{value:ie,children:t.jsx(dt.Provider,{value:es,children:t.jsxs("section",{className:"relative flex h-full w-full flex-col bg-surface",children:[a?.(es),re,t.jsx("div",{className:"min-h-0 flex-1",children:Ue}),o,r]})})})})}export{zf as $,sh as A,dh as B,Yl as C,xu as D,Ks as E,uh as F,Of as G,nh as H,Yf as I,qs as J,vs as K,Xf as L,Wf as M,Zf as N,Lf as O,Ff as P,fm as Q,Ea as R,bc as S,Gd as T,Jd as U,Zd as V,Yd as W,eh as X,Af as Y,mm as Z,Jf as _,gu as a,$f as a0,ou as a1,Vf as a2,Gf as a3,Mf as a4,Df as a5,oh as a6,lh as a7,ah as a8,da as a9,Tf as aA,Hf as aB,jt as aa,rc as ab,nc as ac,sc as ad,ac as ae,ec as af,lt as ag,Sf as ah,If as ai,Nf as aj,wf as ak,rh as al,mh as am,St as an,Cm as ao,km as ap,Nm as aq,ih as ar,pc as as,ch as at,Rf as au,Um as av,uc as aw,Qf as ax,Yt as ay,em as az,Ef as b,Ct as c,Da as d,iu as e,Vl as f,cu as g,uu as h,Vc as i,Kf as j,hu as k,qf as l,ql as m,Gl as n,fu as o,La as p,Oa as q,Ad as r,_f as s,Fa as t,rm as u,Bf as v,Uf as w,ld as x,Pf as y,th as z};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-1mxX3_QN.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{aj as m,j as o,O as p}from"./index-1mxX3_QN.js";import{a}from"./MailShell-CpfkjAiH.js";import{M as r}from"./MailboxPane-j-fLB3Ye.js";import{a as e}from"./search-token-index-BRB-CGkj.js";import{u as s}from"./search-mirror-EZkVoSiC.js";import"./FullCompose-D5RGCLg7.js";import"./ErrorState-DLtcLFLq.js";import"./index-aDMmeBcR.js";import"./useMessageBodyContent-D-AqdxBK.js";import"./useSignature-DeCpWiaN.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DilE1ojx.js";import"./sections-CcfWIv_w.js";import"./confirm-dialog-4-i7dCp5.js";import"./useSearchTokenContext-WrbDthen.js";import"./kbd-Dp9xZFPh.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl--3V0DtqJ.js";import"./circle-check-big-CxFmEow9.js";import"./refresh-cw-DYBLAWnZ.js";import"./useQueries-CbWwzRRY.js";import"./MailListHeader-BSfcf-IH.js";import"./roving-focus-DlpDivMm.js";import"./popover-menu-CfA_guqF.js";import"./mail-DxOUbZYP.js";import"./avatar-DlirA5AD.js";import"./EmptyState-KNDNyfvT.js";import"./undo-2-BoTZN3H5.js";import"./download-CB58NRUV.js";import"./useCalendarFreeBusy-BSwjpsWR.js";import"./calendar-format-Vcjfhlhl.js";import"./useCalendars-DOYXyUkA.js";import"./map-pin-DT0APb7b.js";import"./calendar-suggestion-BifH_0f9.js";import"./attendee-row-B6tvnsNs.js";import"./minus-BuYcA1Hp.js";import"./clock-CCGR0KuX.js";import"./calendar-clash-strip-BkYBh2Wc.js";import"./bell-off-CNej-tyT.js";import"./shield-check-DyrepgYg.js";import"./calendar-report-CBxPXQ5J.js";import"./useFilters-BZyGJA1T.js";import"./checkbox-Djhcc-aN.js";import"./useLayoutTier-rR-Jln8Q.js";import"./menu-DDTDmbUg.js";import"./MailViewChrome-DCS7j8vw.js";import"./pane-header-svjIOKfC.js";import"./NavMenuButton-BIiSSMjn.js";import"./useLabels-D34hpu4A.js";import"./useSemanticSearch-DVkDVaeI.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-CgDm7M7f.js";import"./circle-help-DjzlhQI0.js";import"./circle-check-8zY_9fxi.js";function no(){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{no as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-1mxX3_QN.js";import{M as r}from"./MailboxPane-j-fLB3Ye.js";import"./useSearchTokenContext-WrbDthen.js";import"./kbd-Dp9xZFPh.js";import"./useMessageBodyContent-D-AqdxBK.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl--3V0DtqJ.js";import"./circle-check-big-CxFmEow9.js";import"./refresh-cw-DYBLAWnZ.js";import"./useQueries-CbWwzRRY.js";import"./MailListHeader-BSfcf-IH.js";import"./roving-focus-DlpDivMm.js";import"./search-token-index-BRB-CGkj.js";import"./popover-menu-CfA_guqF.js";import"./mail-DxOUbZYP.js";import"./avatar-DlirA5AD.js";import"./index-aDMmeBcR.js";import"./useSignature-DeCpWiaN.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DilE1ojx.js";import"./sections-CcfWIv_w.js";import"./EmptyState-KNDNyfvT.js";import"./ErrorState-DLtcLFLq.js";import"./undo-2-BoTZN3H5.js";import"./download-CB58NRUV.js";import"./useCalendarFreeBusy-BSwjpsWR.js";import"./calendar-format-Vcjfhlhl.js";import"./useCalendars-DOYXyUkA.js";import"./map-pin-DT0APb7b.js";import"./calendar-suggestion-BifH_0f9.js";import"./attendee-row-B6tvnsNs.js";import"./minus-BuYcA1Hp.js";import"./clock-CCGR0KuX.js";import"./calendar-clash-strip-BkYBh2Wc.js";import"./bell-off-CNej-tyT.js";import"./shield-check-DyrepgYg.js";import"./calendar-report-CBxPXQ5J.js";import"./useFilters-BZyGJA1T.js";import"./checkbox-Djhcc-aN.js";import"./confirm-dialog-4-i7dCp5.js";import"./useLayoutTier-rR-Jln8Q.js";import"./menu-DDTDmbUg.js";import"./MailViewChrome-DCS7j8vw.js";import"./pane-header-svjIOKfC.js";import"./NavMenuButton-BIiSSMjn.js";import"./useLabels-D34hpu4A.js";import"./useSemanticSearch-DVkDVaeI.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-CgDm7M7f.js";import"./circle-help-DjzlhQI0.js";import"./circle-check-8zY_9fxi.js";function $(){return o.jsx(r.Reading,{})}export{$ as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-1mxX3_QN.js";import{F as r}from"./FlaggedPane-DAMAdoUk.js";import"./useSearchTokenContext-WrbDthen.js";import"./kbd-Dp9xZFPh.js";import"./useMessageBodyContent-D-AqdxBK.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-BSfcf-IH.js";import"./roving-focus-DlpDivMm.js";import"./search-token-index-BRB-CGkj.js";import"./useQueries-CbWwzRRY.js";import"./popover-menu-CfA_guqF.js";import"./mail-DxOUbZYP.js";import"./avatar-DlirA5AD.js";import"./index-aDMmeBcR.js";import"./useSignature-DeCpWiaN.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DilE1ojx.js";import"./sections-CcfWIv_w.js";import"./EmptyState-KNDNyfvT.js";import"./ErrorState-DLtcLFLq.js";import"./undo-2-BoTZN3H5.js";import"./download-CB58NRUV.js";import"./useCalendarFreeBusy-BSwjpsWR.js";import"./calendar-format-Vcjfhlhl.js";import"./useCalendars-DOYXyUkA.js";import"./map-pin-DT0APb7b.js";import"./calendar-suggestion-BifH_0f9.js";import"./attendee-row-B6tvnsNs.js";import"./minus-BuYcA1Hp.js";import"./clock-CCGR0KuX.js";import"./calendar-clash-strip-BkYBh2Wc.js";import"./bell-off-CNej-tyT.js";import"./shield-check-DyrepgYg.js";import"./calendar-report-CBxPXQ5J.js";import"./useFilters-BZyGJA1T.js";import"./checkbox-Djhcc-aN.js";import"./confirm-dialog-4-i7dCp5.js";import"./useLayoutTier-rR-Jln8Q.js";import"./menu-DDTDmbUg.js";import"./MailViewChrome-DCS7j8vw.js";import"./refresh-cw-DYBLAWnZ.js";import"./wizard-selection-zWa1qc6-.js";function S(){return o.jsx(r.Reading,{})}export{S as component};
@@ -1 +0,0 @@
1
- import{j as r}from"./index-1mxX3_QN.js";import{B as o}from"./BriefPane-Bs89y0lU.js";import"./useSearchTokenContext-WrbDthen.js";import"./kbd-Dp9xZFPh.js";import"./useMessageBodyContent-D-AqdxBK.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-BSfcf-IH.js";import"./roving-focus-DlpDivMm.js";import"./search-token-index-BRB-CGkj.js";import"./useQueries-CbWwzRRY.js";import"./popover-menu-CfA_guqF.js";import"./mail-DxOUbZYP.js";import"./avatar-DlirA5AD.js";import"./index-aDMmeBcR.js";import"./useSignature-DeCpWiaN.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DilE1ojx.js";import"./sections-CcfWIv_w.js";import"./EmptyState-KNDNyfvT.js";import"./ErrorState-DLtcLFLq.js";import"./undo-2-BoTZN3H5.js";import"./download-CB58NRUV.js";import"./useCalendarFreeBusy-BSwjpsWR.js";import"./calendar-format-Vcjfhlhl.js";import"./useCalendars-DOYXyUkA.js";import"./map-pin-DT0APb7b.js";import"./calendar-suggestion-BifH_0f9.js";import"./attendee-row-B6tvnsNs.js";import"./minus-BuYcA1Hp.js";import"./clock-CCGR0KuX.js";import"./calendar-clash-strip-BkYBh2Wc.js";import"./bell-off-CNej-tyT.js";import"./shield-check-DyrepgYg.js";import"./calendar-report-CBxPXQ5J.js";import"./useFilters-BZyGJA1T.js";import"./checkbox-Djhcc-aN.js";import"./confirm-dialog-4-i7dCp5.js";import"./useLayoutTier-rR-Jln8Q.js";import"./menu-DDTDmbUg.js";import"./useRefreshControl--3V0DtqJ.js";import"./circle-check-big-CxFmEow9.js";import"./refresh-cw-DYBLAWnZ.js";import"./useSemanticSearch-DVkDVaeI.js";import"./useLabels-D34hpu4A.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-zWa1qc6-.js";function W(){return r.jsx(o.Reading,{})}export{W as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-1mxX3_QN.js";import{O as t}from"./OutboxPane-CJGasuMb.js";import"./roving-focus-DlpDivMm.js";import"./useSearchTokenContext-WrbDthen.js";import"./kbd-Dp9xZFPh.js";import"./useMessageBodyContent-D-AqdxBK.js";import"./search-scope-B5-OK3Cq.js";import"./circle-check-big-CxFmEow9.js";import"./clock-CCGR0KuX.js";import"./row-actions-QTX5H6T6.js";import"./rotate-ccw-DSWQif2k.js";import"./pane-header-svjIOKfC.js";import"./NavMenuButton-BIiSSMjn.js";import"./menu-DDTDmbUg.js";import"./outbox-status-BlKn6P0x.js";import"./search-query-Cr_ZXBCp.js";function R(){return o.jsx(t.Reading,{})}export{R as component};
@@ -1 +0,0 @@
1
- import{fa as o,j as m}from"./index-1mxX3_QN.js";import{O as p}from"./OpenCalendarEvent-xuyLG0yl.js";import"./CalendarComposePane-RIGLHEKc.js";import"./calendar-format-Vcjfhlhl.js";import"./useQueries-CbWwzRRY.js";import"./useCalendars-DOYXyUkA.js";import"./calendar-clash-strip-BkYBh2Wc.js";import"./attendee-row-B6tvnsNs.js";import"./avatar-DlirA5AD.js";import"./minus-BuYcA1Hp.js";import"./clock-CCGR0KuX.js";import"./map-pin-DT0APb7b.js";import"./mail-DxOUbZYP.js";import"./pencil-ExQ6Smdq.js";import"./useCalendarWrites-pK8TUq_F.js";import"./ErrorState-DLtcLFLq.js";import"./useCalendarData-C_jHapm8.js";import"./calendar-report-CBxPXQ5J.js";import"./calendar-subscription-B-aAc2Gy.js";function P(){const{calendarObjectId:r,recurrenceId:t}=o.useParams();return m.jsx(p,{calendarObjectId:r,recurrenceId:t})}export{P as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-1mxX3_QN.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-1mxX3_QN.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{O as o}from"./index-1mxX3_QN.js";const n=o;export{n as component};
@@ -1 +0,0 @@
1
- import{j as r,O as i}from"./index-1mxX3_QN.js";import{a as m}from"./MailShell-CpfkjAiH.js";import{B as o}from"./BriefPane-Bs89y0lU.js";import{a as p}from"./search-token-index-BRB-CGkj.js";import{u as e}from"./search-mirror-EZkVoSiC.js";import"./FullCompose-D5RGCLg7.js";import"./ErrorState-DLtcLFLq.js";import"./index-aDMmeBcR.js";import"./useMessageBodyContent-D-AqdxBK.js";import"./useSignature-DeCpWiaN.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DilE1ojx.js";import"./sections-CcfWIv_w.js";import"./confirm-dialog-4-i7dCp5.js";import"./useSearchTokenContext-WrbDthen.js";import"./kbd-Dp9xZFPh.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-BSfcf-IH.js";import"./roving-focus-DlpDivMm.js";import"./popover-menu-CfA_guqF.js";import"./mail-DxOUbZYP.js";import"./avatar-DlirA5AD.js";import"./EmptyState-KNDNyfvT.js";import"./undo-2-BoTZN3H5.js";import"./download-CB58NRUV.js";import"./useCalendarFreeBusy-BSwjpsWR.js";import"./calendar-format-Vcjfhlhl.js";import"./useQueries-CbWwzRRY.js";import"./useCalendars-DOYXyUkA.js";import"./map-pin-DT0APb7b.js";import"./calendar-suggestion-BifH_0f9.js";import"./attendee-row-B6tvnsNs.js";import"./minus-BuYcA1Hp.js";import"./clock-CCGR0KuX.js";import"./calendar-clash-strip-BkYBh2Wc.js";import"./bell-off-CNej-tyT.js";import"./shield-check-DyrepgYg.js";import"./calendar-report-CBxPXQ5J.js";import"./useFilters-BZyGJA1T.js";import"./checkbox-Djhcc-aN.js";import"./useLayoutTier-rR-Jln8Q.js";import"./menu-DDTDmbUg.js";import"./useRefreshControl--3V0DtqJ.js";import"./circle-check-big-CxFmEow9.js";import"./refresh-cw-DYBLAWnZ.js";import"./useSemanticSearch-DVkDVaeI.js";import"./useLabels-D34hpu4A.js";import"./search-query-Cr_ZXBCp.js";import"./wizard-selection-zWa1qc6-.js";function tr(){const t=p();return e({to:"/mail/brief"}),r.jsx(o,{thread:t,children:r.jsx(m,{phone:r.jsx(o.Phone,{}),list:r.jsx(o.List,{}),reading:r.jsx(i,{}),intelligence:r.jsx(o.Intelligence,{}),hasThread:!!t})})}export{tr as component};
@@ -1 +0,0 @@
1
- import{e}from"./index-1mxX3_QN.js";const t=e("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);export{t as C};
@@ -1 +0,0 @@
1
- import{F as o}from"./FullCompose-D5RGCLg7.js";import"./index-1mxX3_QN.js";import"./ErrorState-DLtcLFLq.js";import"./index-aDMmeBcR.js";import"./useMessageBodyContent-D-AqdxBK.js";import"./useSignature-DeCpWiaN.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DilE1ojx.js";import"./sections-CcfWIv_w.js";import"./confirm-dialog-4-i7dCp5.js";const c=o;export{c as component};
@@ -1 +0,0 @@
1
- import{F as o}from"./FullCompose-D5RGCLg7.js";import"./index-1mxX3_QN.js";import"./ErrorState-DLtcLFLq.js";import"./index-aDMmeBcR.js";import"./useMessageBodyContent-D-AqdxBK.js";import"./useSignature-DeCpWiaN.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DilE1ojx.js";import"./sections-CcfWIv_w.js";import"./confirm-dialog-4-i7dCp5.js";const c=o;export{c as component};
@@ -1 +0,0 @@
1
- import{F as o}from"./FullCompose-D5RGCLg7.js";import"./index-1mxX3_QN.js";import"./ErrorState-DLtcLFLq.js";import"./index-aDMmeBcR.js";import"./useMessageBodyContent-D-AqdxBK.js";import"./useSignature-DeCpWiaN.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DilE1ojx.js";import"./sections-CcfWIv_w.js";import"./confirm-dialog-4-i7dCp5.js";const c=o;export{c as component};
@@ -1 +0,0 @@
1
- import{F as o}from"./FullCompose-D5RGCLg7.js";import"./index-1mxX3_QN.js";import"./ErrorState-DLtcLFLq.js";import"./index-aDMmeBcR.js";import"./useMessageBodyContent-D-AqdxBK.js";import"./useSignature-DeCpWiaN.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DilE1ojx.js";import"./sections-CcfWIv_w.js";import"./confirm-dialog-4-i7dCp5.js";const c=o;export{c as component};
@@ -1 +0,0 @@
1
- import{j as o,O as i}from"./index-1mxX3_QN.js";import{a as m}from"./MailShell-CpfkjAiH.js";import{F as r}from"./FlaggedPane-DAMAdoUk.js";import{a as p}from"./search-token-index-BRB-CGkj.js";import{u as e}from"./search-mirror-EZkVoSiC.js";import"./FullCompose-D5RGCLg7.js";import"./ErrorState-DLtcLFLq.js";import"./index-aDMmeBcR.js";import"./useMessageBodyContent-D-AqdxBK.js";import"./useSignature-DeCpWiaN.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DilE1ojx.js";import"./sections-CcfWIv_w.js";import"./confirm-dialog-4-i7dCp5.js";import"./useSearchTokenContext-WrbDthen.js";import"./kbd-Dp9xZFPh.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-BSfcf-IH.js";import"./roving-focus-DlpDivMm.js";import"./popover-menu-CfA_guqF.js";import"./mail-DxOUbZYP.js";import"./avatar-DlirA5AD.js";import"./EmptyState-KNDNyfvT.js";import"./undo-2-BoTZN3H5.js";import"./download-CB58NRUV.js";import"./useCalendarFreeBusy-BSwjpsWR.js";import"./calendar-format-Vcjfhlhl.js";import"./useQueries-CbWwzRRY.js";import"./useCalendars-DOYXyUkA.js";import"./map-pin-DT0APb7b.js";import"./calendar-suggestion-BifH_0f9.js";import"./attendee-row-B6tvnsNs.js";import"./minus-BuYcA1Hp.js";import"./clock-CCGR0KuX.js";import"./calendar-clash-strip-BkYBh2Wc.js";import"./bell-off-CNej-tyT.js";import"./shield-check-DyrepgYg.js";import"./calendar-report-CBxPXQ5J.js";import"./useFilters-BZyGJA1T.js";import"./checkbox-Djhcc-aN.js";import"./useLayoutTier-rR-Jln8Q.js";import"./menu-DDTDmbUg.js";import"./MailViewChrome-DCS7j8vw.js";import"./refresh-cw-DYBLAWnZ.js";import"./wizard-selection-zWa1qc6-.js";function _(){const t=p();return e({to:"/mail/flagged"}),o.jsx(r,{thread:t,children:o.jsx(m,{phone:o.jsx(r.Phone,{}),list:o.jsx(r.List,{}),reading:o.jsx(i,{}),intelligence:o.jsx(r.Intelligence,{}),hasThread:!!t})})}export{_ as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-1mxX3_QN.js";import{F as r}from"./FlaggedPane-DAMAdoUk.js";import"./useSearchTokenContext-WrbDthen.js";import"./kbd-Dp9xZFPh.js";import"./useMessageBodyContent-D-AqdxBK.js";import"./search-scope-B5-OK3Cq.js";import"./MailListHeader-BSfcf-IH.js";import"./roving-focus-DlpDivMm.js";import"./search-token-index-BRB-CGkj.js";import"./useQueries-CbWwzRRY.js";import"./popover-menu-CfA_guqF.js";import"./mail-DxOUbZYP.js";import"./avatar-DlirA5AD.js";import"./index-aDMmeBcR.js";import"./useSignature-DeCpWiaN.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DilE1ojx.js";import"./sections-CcfWIv_w.js";import"./EmptyState-KNDNyfvT.js";import"./ErrorState-DLtcLFLq.js";import"./undo-2-BoTZN3H5.js";import"./download-CB58NRUV.js";import"./useCalendarFreeBusy-BSwjpsWR.js";import"./calendar-format-Vcjfhlhl.js";import"./useCalendars-DOYXyUkA.js";import"./map-pin-DT0APb7b.js";import"./calendar-suggestion-BifH_0f9.js";import"./attendee-row-B6tvnsNs.js";import"./minus-BuYcA1Hp.js";import"./clock-CCGR0KuX.js";import"./calendar-clash-strip-BkYBh2Wc.js";import"./bell-off-CNej-tyT.js";import"./shield-check-DyrepgYg.js";import"./calendar-report-CBxPXQ5J.js";import"./useFilters-BZyGJA1T.js";import"./checkbox-Djhcc-aN.js";import"./confirm-dialog-4-i7dCp5.js";import"./useLayoutTier-rR-Jln8Q.js";import"./menu-DDTDmbUg.js";import"./MailViewChrome-DCS7j8vw.js";import"./refresh-cw-DYBLAWnZ.js";import"./wizard-selection-zWa1qc6-.js";function Q(){return o.jsx(r.Reading,{})}export{Q as component};
@@ -1 +0,0 @@
1
- import{j as t,an as o}from"./index-1mxX3_QN.js";const n=()=>t.jsx(o,{to:"/settings/accounts"});export{n as component};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-1mxX3_QN.js";import{M as i}from"./MailboxPane-j-fLB3Ye.js";import"./useSearchTokenContext-WrbDthen.js";import"./kbd-Dp9xZFPh.js";import"./useMessageBodyContent-D-AqdxBK.js";import"./search-scope-B5-OK3Cq.js";import"./useRefreshControl--3V0DtqJ.js";import"./circle-check-big-CxFmEow9.js";import"./refresh-cw-DYBLAWnZ.js";import"./useQueries-CbWwzRRY.js";import"./MailListHeader-BSfcf-IH.js";import"./roving-focus-DlpDivMm.js";import"./search-token-index-BRB-CGkj.js";import"./popover-menu-CfA_guqF.js";import"./mail-DxOUbZYP.js";import"./avatar-DlirA5AD.js";import"./index-aDMmeBcR.js";import"./useSignature-DeCpWiaN.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-DilE1ojx.js";import"./sections-CcfWIv_w.js";import"./EmptyState-KNDNyfvT.js";import"./ErrorState-DLtcLFLq.js";import"./undo-2-BoTZN3H5.js";import"./download-CB58NRUV.js";import"./useCalendarFreeBusy-BSwjpsWR.js";import"./calendar-format-Vcjfhlhl.js";import"./useCalendars-DOYXyUkA.js";import"./map-pin-DT0APb7b.js";import"./calendar-suggestion-BifH_0f9.js";import"./attendee-row-B6tvnsNs.js";import"./minus-BuYcA1Hp.js";import"./clock-CCGR0KuX.js";import"./calendar-clash-strip-BkYBh2Wc.js";import"./bell-off-CNej-tyT.js";import"./shield-check-DyrepgYg.js";import"./calendar-report-CBxPXQ5J.js";import"./useFilters-BZyGJA1T.js";import"./checkbox-Djhcc-aN.js";import"./confirm-dialog-4-i7dCp5.js";import"./useLayoutTier-rR-Jln8Q.js";import"./menu-DDTDmbUg.js";import"./MailViewChrome-DCS7j8vw.js";import"./pane-header-svjIOKfC.js";import"./NavMenuButton-BIiSSMjn.js";import"./useLabels-D34hpu4A.js";import"./useSemanticSearch-DVkDVaeI.js";import"./search-query-Cr_ZXBCp.js";import"./bottom-sheet-CgDm7M7f.js";import"./circle-help-DjzlhQI0.js";import"./circle-check-8zY_9fxi.js";function $(){return o.jsx(i.Reading,{})}export{$ as component};