@remit/web-client-dist 0.0.683 → 0.0.685
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/BriefPane-BfKwBxLe.js +1 -0
- package/assets/{CalendarEventEditor-CorHNzvG.js → CalendarEventEditor-Bsugk6rT.js} +1 -1
- package/assets/{CalendarEventPopup-D-SdDSgQ.js → CalendarEventPopup-C-BVvxfV.js} +1 -1
- package/assets/{CalendarLoadFailed-fjYDcNBn.js → CalendarLoadFailed-DcrF_lyr.js} +1 -1
- package/assets/{CalendarQuickCreate-BNdOcecP.js → CalendarQuickCreate-_ki0X3rq.js} +1 -1
- package/assets/{CalendarSession-DVmvDWU4.js → CalendarSession-CK-EC1yK.js} +1 -1
- package/assets/{DesktopChrome-BTELS57y.js → DesktopChrome-BfOVbUXt.js} +1 -1
- package/assets/{DropdownMenu-CMRvH2nc.js → DropdownMenu-B4qvRStt.js} +1 -1
- package/assets/{EmptyState-D9VF8IjN.js → EmptyState-BYR2eIr2.js} +1 -1
- package/assets/{ErrorState-94ifepAa.js → ErrorState-BXxvOnci.js} +1 -1
- package/assets/FlaggedPane-F0FM2UJN.js +1 -0
- package/assets/{FullCompose-D0r-tiQo.js → FullCompose-DEhDpjci.js} +1 -1
- package/assets/{LabelApplyTrigger-C03Hgfzy.js → LabelApplyTrigger-C4ode0Y9.js} +1 -1
- package/assets/{MailShell-CtmFFRYB.js → MailShell-DvQDMygz.js} +1 -1
- package/assets/{MailViewChrome-Dsvhd_KV.js → MailViewChrome-D66Dcy3c.js} +1 -1
- package/assets/{MailboxPane-CZB7l_UU.js → MailboxPane-BDYnlpr2.js} +2 -2
- package/assets/{MessageBody-D3iuMLwF.js → MessageBody-CDTfM1lc.js} +3 -3
- package/assets/MessageToolbar-BW852rJj.js +1 -0
- package/assets/{NavMenuButton-DSOpFRST.js → NavMenuButton-BZWw6TBA.js} +1 -1
- package/assets/{OnboardingWizard-B59qf55_.js → OnboardingWizard-Bppp1CPR.js} +1 -1
- package/assets/{OutboxPane-BUI6ugaL.js → OutboxPane-B_ihIEGn.js} +1 -1
- package/assets/ReportLink-CwxUgr_7.js +1 -0
- package/assets/_calendarObjectId-CSwodc6y.js +1 -0
- package/assets/_mailboxId-BlTWUSb1.js +1 -0
- package/assets/_messageId-BaqNxGqi.js +1 -0
- package/assets/_messageId-DNtVsPPW.js +1 -0
- package/assets/_messageId-ciVFKEzn.js +1 -0
- package/assets/_outboxMessageId-LLqtF8cH.js +1 -0
- package/assets/_recurrenceId-G4qPwsrp.js +1 -0
- package/assets/_slotId-D9HVYRDd.js +1 -0
- package/assets/_threadId-BAVZ7S8M.js +1 -0
- package/assets/_threadId-DL34NZT4.js +1 -0
- package/assets/_threadId-qmAQ7RKu.js +1 -0
- package/assets/_view._date-DCmCYHjG.js +1 -0
- package/assets/{account-service-status-DcgJfCAF.js → account-service-status-D-hGpg9e.js} +1 -1
- package/assets/accounts-BcJ04H8d.js +1 -0
- package/assets/{advanced-BK0dqfFu.js → advanced-DnA-3VCS.js} +1 -1
- package/assets/{agenda-time-BuLpxvQJ.js → agenda-time-O7rJVIvd.js} +1 -1
- package/assets/{app-chrome-Do6quK12.js → app-chrome-DvUymvcE.js} +1 -1
- package/assets/{appearance-BLw-N7mB.js → appearance-CypE55tV.js} +1 -1
- package/assets/{avatar-LbufyW4K.js → avatar-BgqBWztU.js} +1 -1
- package/assets/{badge-C9PbkapD.js → badge-CfQoDkmE.js} +1 -1
- package/assets/{bottom-sheet-CGUsHUE9.js → bottom-sheet-Dhk1Aqz2.js} +1 -1
- package/assets/brief-DcbZ7jHO.js +1 -0
- package/assets/{brief-CcMmKq4G.js → brief-DgC2R0u5.js} +1 -1
- package/assets/{calendar-C-SC0LmB.js → calendar-BJu4Vl-g.js} +1 -1
- package/assets/{calendar-CZgZil9h.js → calendar-Ix1rbLDg.js} +1 -1
- package/assets/{calendar-event-popup--BJKBvHu.js → calendar-event-popup-B4-Dpgb6.js} +1 -1
- package/assets/{calendar-event-sidebar-s-VGamZ2.js → calendar-event-sidebar-DZum-8WN.js} +1 -1
- package/assets/{calendar-failure-note-CEYH2UEH.js → calendar-failure-note-DK-uzvky.js} +1 -1
- package/assets/{calendar-guests-BaqdXc5Z.js → calendar-guests-Diti9JO5.js} +1 -1
- package/assets/calendar-suggestion-C8kx9fKn.js +1 -0
- package/assets/{calendars-BB8BOIZF.js → calendars-ne1Oj2RW.js} +1 -1
- package/assets/{card-D7vOetR8.js → card-B-YLocTg.js} +1 -1
- package/assets/{checkbox-BG_wsoD6.js → checkbox-DL0pObJW.js} +1 -1
- package/assets/chevron-down-BWbeCM3N.js +1 -0
- package/assets/chevron-left-CliOUq1O.js +1 -0
- package/assets/{circle-check-DTYzt_6O.js → circle-check-OUBTwy71.js} +1 -1
- package/assets/{circle-check-big-Bm7lzv-i.js → circle-check-big-Czqmzl9y.js} +1 -1
- package/assets/{circle-help-BbeOW2US.js → circle-help-DJ-Mtycd.js} +1 -1
- package/assets/classification-DLUltDdR.js +1 -0
- package/assets/{clock-BzJ_fFzJ.js → clock-Bw2dEIoB.js} +1 -1
- package/assets/compose._-_outboxMessageId_-CAx_e1OV.js +1 -0
- package/assets/compose._-_outboxMessageId_-CnWaV_IX.js +1 -0
- package/assets/compose._-_outboxMessageId_-Dmj8hyvT.js +1 -0
- package/assets/compose._-_outboxMessageId_-z980Xa6X.js +1 -0
- package/assets/{config-import-C8-amzAu.js → config-import-B6tjROvg.js} +1 -1
- package/assets/{confirm-dialog-CJxHNbgP.js → confirm-dialog-sa45Xnmn.js} +1 -1
- package/assets/{copy-BXsMQRiH.js → copy-9W6V4dQI.js} +1 -1
- package/assets/{credential-steps-rbRE-sDX.js → credential-steps-P9fRg1pE.js} +1 -1
- package/assets/{download-BfBVKcRB.js → download-O3cdl6IV.js} +1 -1
- package/assets/{draft-DNq8lw24.js → draft-QkjvtbSZ.js} +1 -1
- package/assets/edit-B31QMGS3.js +1 -0
- package/assets/edit-DjkZZFBG.js +1 -0
- package/assets/{external-link-BJSinsZe.js → external-link-BYIIFw9_.js} +1 -1
- package/assets/{file-json-BQnHw6MM.js → file-json-vVOzTp-u.js} +1 -1
- package/assets/filters-DohRSViK.js +1 -0
- package/assets/{flagged-CKVThblv.js → flagged-BHlMmpp_.js} +1 -1
- package/assets/flagged-DIi4rqg8.js +1 -0
- package/assets/{folder-input-ByfaQaN_.js → folder-input-hVRteCio.js} +1 -1
- package/assets/folders-BFfd-sur.js +1 -0
- package/assets/{help-copy-CiMWKARn.js → help-copy-_K3IfQdg.js} +1 -1
- package/assets/{import-Bp-nuO1l.js → import-ByOg30ul.js} +1 -1
- package/assets/index-BIhlBhBD.js +1 -0
- package/assets/index-BaqNxGqi.js +1 -0
- package/assets/{index-CKflMWYU.js → index-Bn8n_AsE.js} +55 -55
- package/assets/index-C53Z5hF_.js +1 -0
- package/assets/index-CRnDeQMw.js +1 -0
- package/assets/{index-CMNnsfzR.css → index-CqMlmBtY.css} +1 -1
- package/assets/index-CzbtDE1H.js +1 -0
- package/assets/index-DNtVsPPW.js +1 -0
- package/assets/index-DR2Joq7n.js +1 -0
- package/assets/index-DbyBl7Lq.js +1 -0
- package/assets/index-cVALleyU.js +1 -0
- package/assets/index-ciVFKEzn.js +1 -0
- package/assets/{index-Dd-3T--b.js → index-k6LzEquX.js} +4 -4
- package/assets/{kbd-BncXAFDO.js → kbd-PiHV4odS.js} +1 -1
- package/assets/{label-chip-WqxiwOiU.js → label-chip-BnNtXrWd.js} +1 -1
- package/assets/{labels-Dg7TTcGv.js → labels-BQe-BkCj.js} +1 -1
- package/assets/mail-BFIBAL7w.js +1 -0
- package/assets/{mail-D6kMQxBk.js → mail-CPplAOgE.js} +1 -1
- package/assets/{menu-DoDMKB2j.js → menu-znX-3dzE.js} +1 -1
- package/assets/{nav-link-D4-gc9H1.js → nav-link-CtuHya9S.js} +1 -1
- package/assets/new-psckzAFd.js +1 -0
- package/assets/onboarding-B_l5ow67.js +1 -0
- package/assets/{onboarding-completion-CidQapv1.js → onboarding-completion-CKAiaYkS.js} +1 -1
- package/assets/outbox-BTiQbMrW.js +1 -0
- package/assets/{pencil-DWPNxo1l.js → pencil-DA21sF5f.js} +1 -1
- package/assets/people-BQjKSotc.js +1 -0
- package/assets/{plus-BQ1_1L0j.js → plus-6ss9YFRF.js} +1 -1
- package/assets/{popover-menu-CNRLhp3y.js → popover-menu-iCbmrU-E.js} +1 -1
- package/assets/{refresh-cw-BmzOf0Tw.js → refresh-cw-CUyjBEl4.js} +1 -1
- package/assets/{reply-CM_F5zLS.js → reply-DmpF7cgR.js} +1 -1
- package/assets/{rich-text-DGbE9Son.js → rich-text-Cppy56p_.js} +1 -1
- package/assets/{rich-text-spellcheck-worker-provider-CIgyTxax.js → rich-text-spellcheck-worker-provider-Bk2_kAe9.js} +1 -1
- package/assets/{rotate-ccw-BGcFG-wN.js → rotate-ccw-Dtkxt0CH.js} +1 -1
- package/assets/{roving-focus-5GpSESqn.js → roving-focus-CzX6YmR4.js} +1 -1
- package/assets/{row-actions-Cj5ovPiM.js → row-actions-Cn7bQ_Ks.js} +1 -1
- package/assets/{search-mirror-C3jFbnCg.js → search-mirror-BSzHMUcd.js} +1 -1
- package/assets/{search-scope-4mzoV4f2.js → search-scope-Cl87snrn.js} +1 -1
- package/assets/{search-token-index-CjZf08nc.js → search-token-index-BSaB7qLo.js} +1 -1
- package/assets/{sections-HylxNewe.js → sections-DwdsQ0ad.js} +1 -1
- package/assets/{segmented-control-DIfCqJPe.js → segmented-control-68-bWTGV.js} +1 -1
- package/assets/{select-DBBB1VI8.js → select-Cc2Vc4qL.js} +1 -1
- package/assets/{senders-CjRXvk8z.js → senders-DwOfiVHu.js} +1 -1
- package/assets/settings-BdeAbD2h.js +1 -0
- package/assets/{settings-screen-83hRChID.js → settings-screen-IjQOks0s.js} +1 -1
- package/assets/{shield-check-BtDXLNzB.js → shield-check-jkVgxi6o.js} +1 -1
- package/assets/{suggest-list-B3YTezx4.js → suggest-list-FaY4DThZ.js} +1 -1
- package/assets/{suggested-vips-DeXMjfai.js → suggested-vips-BLlvjvH5.js} +1 -1
- package/assets/suggestion._suggestionId-CL7hLrk-.js +1 -0
- package/assets/switch-a7x-CFTd.js +1 -0
- package/assets/{task._calendarTaskId--_XtqsMj.js → task._calendarTaskId-CkPsJj-a.js} +1 -1
- package/assets/{undo-2-CG4e15mN.js → undo-2-CnxBm8gd.js} +1 -1
- package/assets/{useCalendarData-CjjJgU5o.js → useCalendarData-RUYA8D_t.js} +2 -2
- package/assets/{useCalendarScheduling-BgRBx6lW.js → useCalendarScheduling-CO3VOpcB.js} +1 -1
- package/assets/{useCalendarSuggestions--U0GEAn1.js → useCalendarSuggestions-Bb4PGHae.js} +1 -1
- package/assets/{useCalendarTasks-vfDCVCeh.js → useCalendarTasks-RmI_Ij1j.js} +1 -1
- package/assets/{useDebouncedValue-DjJaY9PG.js → useDebouncedValue-I0sDLoIF.js} +1 -1
- package/assets/{useFilters-CfG8A2Tp.js → useFilters-DT8SxgF4.js} +1 -1
- package/assets/useLabels-DO4UWjpG.js +1 -0
- package/assets/{useLayoutTier-4MDmjdnr.js → useLayoutTier-Cn3SwiV2.js} +1 -1
- package/assets/{useMediaQuery-B1PJEoqh.js → useMediaQuery-C00TiD5k.js} +1 -1
- package/assets/{useMessageBodyContent-B0iiI3OV.js → useMessageBodyContent-lqVkO1fM.js} +1 -1
- package/assets/{useQueries-DVcMuKhn.js → useQueries-Bs7-L_2j.js} +1 -1
- package/assets/useRefreshControl-Bt-oDRnY.js +1 -0
- package/assets/{useResultFolderIndex-DkgVg9nE.js → useResultFolderIndex-CALTzfWS.js} +1 -1
- package/assets/{useSignature-DR9rEETd.js → useSignature-DRFIcifS.js} +1 -1
- package/assets/{warnings-BM1pwMF7.js → warnings-ClaUoDQx.js} +3 -3
- package/index.html +2 -2
- package/package.json +1 -1
- package/assets/BriefPane-B3D5-BM0.js +0 -1
- package/assets/FlaggedPane-CpXIW-t2.js +0 -1
- package/assets/MessageToolbar-BEI90gj6.js +0 -1
- package/assets/_calendarObjectId-BY50J2hr.js +0 -1
- package/assets/_mailboxId-0i2eghj0.js +0 -1
- package/assets/_messageId-BQqk5gfw.js +0 -1
- package/assets/_messageId-BqO-NhQa.js +0 -1
- package/assets/_messageId-Cmg2GAfD.js +0 -1
- package/assets/_outboxMessageId-BDvXTrQM.js +0 -1
- package/assets/_recurrenceId-CMVJw-Ue.js +0 -1
- package/assets/_slotId-CFujBWsH.js +0 -1
- package/assets/_threadId-BSlijLpe.js +0 -1
- package/assets/_threadId-BiFfo-Au.js +0 -1
- package/assets/_threadId-CvKjrqYT.js +0 -1
- package/assets/_view._date-BZkjct9_.js +0 -1
- package/assets/accounts-CEI9HlTN.js +0 -1
- package/assets/brief-ZZJ3nfgH.js +0 -1
- package/assets/calendar-suggestion-hiP6smEM.js +0 -1
- package/assets/chevron-down-Np6EEMl-.js +0 -1
- package/assets/chevron-left-CpG9UDY6.js +0 -1
- package/assets/compose._-_outboxMessageId_-BqsxhT9K.js +0 -1
- package/assets/compose._-_outboxMessageId_-CproJqKO.js +0 -1
- package/assets/compose._-_outboxMessageId_-D4ti_AhM.js +0 -1
- package/assets/compose._-_outboxMessageId_-DUOU8Jn4.js +0 -1
- package/assets/edit-BHhIau_f.js +0 -1
- package/assets/edit-DgebsJae.js +0 -1
- package/assets/filters-PWUZK_ek.js +0 -1
- package/assets/flagged-CXvEvVrc.js +0 -1
- package/assets/folders-CN4VErkf.js +0 -1
- package/assets/index-B9liPKRG.js +0 -1
- package/assets/index-BQqk5gfw.js +0 -1
- package/assets/index-BxeM8f0P.js +0 -1
- package/assets/index-C8IkDmiU.js +0 -1
- package/assets/index-CGpfssJ_.js +0 -1
- package/assets/index-Cmg2GAfD.js +0 -1
- package/assets/index-CnG5iabp.js +0 -1
- package/assets/index-CsYB5imQ.js +0 -1
- package/assets/index-Dzu-4vEF.js +0 -1
- package/assets/index-ddvd0V_o.js +0 -1
- package/assets/mail-BXR9_JRf.js +0 -1
- package/assets/new-cj3Hd_mI.js +0 -1
- package/assets/onboarding-DVmfGdcY.js +0 -1
- package/assets/outbox-FTmGdqfa.js +0 -1
- package/assets/people-aWk5_IT2.js +0 -1
- package/assets/settings-BLU5tEtD.js +0 -1
- package/assets/sparkles-DxQ7dXLC.js +0 -1
- package/assets/suggestion._suggestionId-BFy5c2Ae.js +0 -1
- package/assets/useLabels-QIv6Xivl.js +0 -1
- package/assets/useRefreshControl-CY786xTG.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{j as s,
|
|
1
|
+
import{j as s,aB as T,B as d,aI as C,bm as j,bk as N,d as $,ad as k,a7 as A,bC as E,bX as f,bY as _,bZ as M,a as P,c as W,r as l,a2 as z,aw as x,ax as p,u as O,ac as B}from"./index-Bn8n_AsE.js";import{B as h,u as L}from"./useResultFolderIndex-CALTzfWS.js";import{B as y}from"./badge-CfQoDkmE.js";import{C as S}from"./circle-check-OUBTwy71.js";import{C as q}from"./copy-9W6V4dQI.js";import{E as D}from"./external-link-BYIIFw9_.js";import{f as U}from"./ErrorState-BXxvOnci.js";import{a as F}from"./sections-DwdsQ0ad.js";import{w as G}from"./help-copy-_K3IfQdg.js";import{S as H}from"./settings-screen-IjQOks0s.js";import"./useQueries-Bs7-L_2j.js";import"./kbd-PiHV4odS.js";import"./avatar-BgqBWztU.js";import"./chevron-left-CliOUq1O.js";import"./menu-znX-3dzE.js";import"./circle-help-DJ-Mtycd.js";function Q({report:e,onClose:t,issueUrl:n,onCopy:a}){return e===null?null:s.jsx(T,{open:!0,onClose:t,title:"Report this message",children:s.jsxs("div",{className:"flex max-h-[80vh] flex-col",children:[s.jsxs("header",{className:"space-y-1 border-b border-line px-4 py-3",children:[s.jsx("h3",{className:"text-sm font-semibold text-fg",children:"Report this message"}),s.jsx("p",{className:"text-xs text-fg-muted",children:"This is everything the report contains. It describes what went wrong with the message — never its contents, addresses, subject, attachment names, folder name, or the parser's own error text."})]}),s.jsx("pre",{className:"flex-1 overflow-auto bg-surface-sunken px-4 py-3 text-2xs leading-relaxed whitespace-pre-wrap text-fg-muted",children:e}),s.jsxs("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line px-4 py-3",children:[s.jsx(d,{variant:"ghost",size:"sm",onClick:t,children:"Cancel"}),s.jsx(d,{variant:"secondary",size:"sm",icon:s.jsx(q,{className:"size-3.5"}),onClick:()=>a(e),children:"Copy report"}),s.jsx(C,{external:!0,size:"sm",href:n,icon:s.jsx(D,{className:"size-3.5"}),children:"Open on GitHub"})]})]})})}const V={BodyParse:"The message is built in a way Remit could not read."};function Y(e){return V[e]}function R(e){return e.split(";")[0].trim()}const b=/^[A-Za-z0-9!#$%&'*+._-]+$/,v=/^[A-Za-z0-9!#$%&'*+._-]+\/[A-Za-z0-9!#$%&'*+._-]+$/;function m(e,t){return t.test(e)?`\`${e}\``:`\`${JSON.stringify(e).replace(/`/g,"\\u0060")}\` (malformed)`}function Z(e){const t=R(e);return v.test(t)?t:JSON.stringify(t)}const g="_not read_";function J(e){return e.length===0?["(no MIME structure was read)"]:e.map(t=>`${" ".repeat(t.depth)}- ${Z(t.contentType)}`)}const K="_No message content, addresses, subject, attachment names or parser output are included._";function w(e){return{head:[`### Message quarantined at \`${e.failureStage}\``,"",`- **Failure**: \`${e.failureCode}\``,`- **Folder role**: ${e.mailboxRole??"_none appointed_"}`,`- **Failing part**: ${e.failurePartPath==null?"_whole message_":`\`${e.failurePartPath}\``}`,`- **Attempts before quarantine**: ${e.attempts}`,`- **Worker build**: ${e.workerVersion}`,`- **Message-ID hash**: ${e.messageIdHash==null?"_none declared_":`\`${e.messageIdHash}\``}`,"","#### Message shape","",`- **Content-Type**: ${e.contentType==null?g:m(R(e.contentType),v)}`,`- **Content-Transfer-Encoding**: ${e.transferEncoding==null?g:m(e.transferEncoding,b)}`,`- **Charset**: ${e.charset==null?"_not declared_":m(e.charset,b)}`,`- **Size**: ${e.sizeBytes==null?g:`${e.sizeBytes} bytes`}`,"","MIME structure:"].join(`
|
|
2
2
|
`),structure:J(e.structure).join(`
|
|
3
3
|
`),disclaimer:K}}function X(e){const{head:t,structure:n,disclaimer:a}=w(e);return[t,"","```",n,"```","",a].join(`
|
|
4
|
-
`)}function ee(e){return`Message quarantined: ${e.failureCode} at ${e.failureStage}`}function se(e){return new Date(e).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function te({entry:e,onCutBug:t}){return s.jsxs("li",{className:"flex flex-col gap-2 border-b border-line px-row-inset py-3 last:border-b-0 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("p",{className:"text-sm text-fg",children:Y(e.failureStage)}),s.jsx("p",{className:"truncate text-xs text-fg-muted",title:e.failureMessage,children:e.failureMessage}),s.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-fg-subtle",children:[e.mailboxRole&&s.jsx(y,{tone:"warning",children:j(e.mailboxRole)}),s.jsx("span",{className:"truncate",title:e.mailboxPath,children:N(e.mailboxPath,e.mailboxDelimiter)}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`uid ${e.uid}`}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:se(e.quarantinedAt)}),e.attempts>1&&s.jsxs(s.Fragment,{children:[s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`${e.attempts} attempts`})]})]})]}),s.jsx(d,{variant:"secondary",size:"sm",className:"shrink-0",icon:s.jsx(h,{className:"size-3.5"}),onClick:()=>t(e),children:"Cut a bug"})]})}function ne({entries:e,onCutBug:t}){return s.jsxs("section",{className:"space-y-3",children:[s.jsxs("header",{className:"space-y-1",children:[s.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Messages set aside"}),s.jsx("p",{className:"text-xs text-fg-muted",children:"Mail Remit could not read is set aside here instead of being skipped, so nothing goes missing quietly. The rest of the folder keeps syncing. Recovering a set-aside message is a re-sync, not a per-row action."})]}),e.length===0&&s.jsxs("div",{className:"flex items-center gap-2 rounded-sm border border-line bg-surface px-row-inset py-3",children:[s.jsx(S,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),s.jsx("p",{className:"text-sm text-fg-muted",children:"Every message has been read successfully. Nothing is set aside."})]}),e.length>1&&s.jsx($,{tone:"warning",children:s.jsxs("p",{className:"flex items-start gap-2",children:[s.jsx(
|
|
5
|
-
`)}function le(e){return`Message failed to sync: ${e.state} at ${e.stage}`}function ce(e){return new Date(e).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function de({entry:e,onReport:t}){const n=e.state==="GaveUp";return s.jsxs("li",{className:"flex flex-col gap-2 border-b border-line px-row-inset py-3 last:border-b-0 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("p",{className:"text-sm text-fg",children:re(e)}),s.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-fg-subtle",children:[s.jsx(y,{tone:n?"danger":"warning",children:n?"Gave up":"Retrying"}),s.jsx("span",{className:"truncate",children:e.folderLabel}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`uid ${e.uid}`}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`since ${ce(e.createdAt)}`}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`${e.attempts} attempts`})]})]}),s.jsx(d,{variant:"secondary",size:"sm",className:"shrink-0",icon:s.jsx(h,{className:"size-3.5"}),onClick:()=>t(e),children:"Cut a bug"})]})}function ue({entries:e,total:t,onReport:n}){return s.jsxs("section",{className:"space-y-3",children:[s.jsxs("header",{className:"space-y-1",children:[s.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Messages that failed to sync"}),s.jsx("p",{className:"text-xs text-fg-muted",children:"A message shows here after three failed rounds and leaves on its own once it syncs. The rest of the folder keeps syncing."})]}),e.length===0&&s.jsxs("div",{className:"flex items-center gap-2 rounded-sm border border-line bg-surface px-row-inset py-3",children:[s.jsx(S,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),s.jsx("p",{className:"text-sm text-fg-muted",children:"Every message is syncing. Nothing has failed."})]}),t>e.length&&s.jsx("p",{className:"text-xs text-fg-muted",children:`Showing the ${e.length} newest of ${t} messages that failed to sync.`}),e.length>0&&s.jsx("ul",{className:"rounded-sm border border-line bg-surface",children:e.map(a=>s.jsx(de,{entry:a,onReport:n},a.syncWarningId))})]})}function me(){const{Account:e}=
|
|
4
|
+
`)}function ee(e){return`Message quarantined: ${e.failureCode} at ${e.failureStage}`}function se(e){return new Date(e).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function te({entry:e,onCutBug:t}){return s.jsxs("li",{className:"flex flex-col gap-2 border-b border-line px-row-inset py-3 last:border-b-0 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("p",{className:"text-sm text-fg",children:Y(e.failureStage)}),s.jsx("p",{className:"truncate text-xs text-fg-muted",title:e.failureMessage,children:e.failureMessage}),s.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-fg-subtle",children:[e.mailboxRole&&s.jsx(y,{tone:"warning",children:j(e.mailboxRole)}),s.jsx("span",{className:"truncate",title:e.mailboxPath,children:N(e.mailboxPath,e.mailboxDelimiter)}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`uid ${e.uid}`}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:se(e.quarantinedAt)}),e.attempts>1&&s.jsxs(s.Fragment,{children:[s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`${e.attempts} attempts`})]})]})]}),s.jsx(d,{variant:"secondary",size:"sm",className:"shrink-0",icon:s.jsx(h,{className:"size-3.5"}),onClick:()=>t(e),children:"Cut a bug"})]})}function ne({entries:e,onCutBug:t}){return s.jsxs("section",{className:"space-y-3",children:[s.jsxs("header",{className:"space-y-1",children:[s.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Messages set aside"}),s.jsx("p",{className:"text-xs text-fg-muted",children:"Mail Remit could not read is set aside here instead of being skipped, so nothing goes missing quietly. The rest of the folder keeps syncing. Recovering a set-aside message is a re-sync, not a per-row action."})]}),e.length===0&&s.jsxs("div",{className:"flex items-center gap-2 rounded-sm border border-line bg-surface px-row-inset py-3",children:[s.jsx(S,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),s.jsx("p",{className:"text-sm text-fg-muted",children:"Every message has been read successfully. Nothing is set aside."})]}),e.length>1&&s.jsx($,{tone:"warning",children:s.jsxs("p",{className:"flex items-start gap-2",children:[s.jsx(k,{className:"mt-0.5 size-4 shrink-0","aria-hidden":!0}),s.jsxs("span",{children:[s.jsx("span",{className:"font-semibold",children:`${e.length} messages could not be read.`})," ","More than one means something is wrong with how Remit reads mail, not with the mail. Reporting one of these gets it fixed."]})]})}),e.length>0&&s.jsx("ul",{className:"rounded-sm border border-line bg-surface",children:e.map(n=>s.jsx(te,{entry:n,onCutBug:t},n.quarantineId))})]})}const ae={Retrying:"The message could not be synced. Remit tries again every sync.",GaveUp:"The message body could not be downloaded. Remit has stopped trying."};function re(e){return ae[e.state]}const ie="_No message content, addresses, subject, folder name or error text are included._";function oe(e){return[`### Message failed to sync at \`${e.stage}\``,"",`- **State**: \`${e.state}\``,`- **Attempts**: ${e.attempts}`,"",ie].join(`
|
|
5
|
+
`)}function le(e){return`Message failed to sync: ${e.state} at ${e.stage}`}function ce(e){return new Date(e).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function de({entry:e,onReport:t}){const n=e.state==="GaveUp";return s.jsxs("li",{className:"flex flex-col gap-2 border-b border-line px-row-inset py-3 last:border-b-0 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("p",{className:"text-sm text-fg",children:re(e)}),s.jsxs("p",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-fg-subtle",children:[s.jsx(y,{tone:n?"danger":"warning",children:n?"Gave up":"Retrying"}),s.jsx("span",{className:"truncate",children:e.folderLabel}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`uid ${e.uid}`}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`since ${ce(e.createdAt)}`}),s.jsx("span",{"aria-hidden":!0,children:"·"}),s.jsx("span",{children:`${e.attempts} attempts`})]})]}),s.jsx(d,{variant:"secondary",size:"sm",className:"shrink-0",icon:s.jsx(h,{className:"size-3.5"}),onClick:()=>t(e),children:"Cut a bug"})]})}function ue({entries:e,total:t,onReport:n}){return s.jsxs("section",{className:"space-y-3",children:[s.jsxs("header",{className:"space-y-1",children:[s.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Messages that failed to sync"}),s.jsx("p",{className:"text-xs text-fg-muted",children:"A message shows here after three failed rounds and leaves on its own once it syncs. The rest of the folder keeps syncing."})]}),e.length===0&&s.jsxs("div",{className:"flex items-center gap-2 rounded-sm border border-line bg-surface px-row-inset py-3",children:[s.jsx(S,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),s.jsx("p",{className:"text-sm text-fg-muted",children:"Every message is syncing. Nothing has failed."})]}),t>e.length&&s.jsx("p",{className:"text-xs text-fg-muted",children:`Showing the ${e.length} newest of ${t} messages that failed to sync.`}),e.length>0&&s.jsx("ul",{className:"rounded-sm border border-line bg-surface",children:e.map(a=>s.jsx(de,{entry:a,onReport:n},a.syncWarningId))})]})}function me(){const{Account:e}=A();return s.jsx(e,{children:({signOut:t})=>s.jsx("button",{type:"button",onClick:()=>t(),className:"rounded-md border border-line px-2.5 py-1 text-sm font-medium text-fg outline-none hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",children:"Sign in again"})})}function ge(e,t){return{quarantineId:e.quarantineId,accountId:e.accountId,mailboxId:e.mailboxId,uidValidity:e.uidValidity,uid:e.uid,mailboxRole:e.mailboxRole?E[e.mailboxRole]:void 0,mailboxPath:e.mailboxPath,mailboxDelimiter:t,failureStage:e.failureStage,failureCode:e.failureCode,failureMessage:e.failureMessage,failurePartPath:e.failurePartPath,quarantinedAt:e.quarantinedAt,attempts:e.attempts,sizeBytes:e.sizeBytes,contentType:e.contentType,transferEncoding:e.transferEncoding,charset:e.charset,structure:e.structure,messageIdHash:e.messageIdHash,workerVersion:e.workerVersion}}const xe=3,pe=(e,t)=>e===_.Body&&t>=xe?f.GaveUp:f.Retrying,he="A folder no longer listed";function fe(e){return e?.role?j(e.role):e?.providerPath?N(e.providerPath,e.hierarchyDelimiter):he}function be(e,t){return{syncWarningId:e.syncWarningId,uid:e.uid,stage:e.stage,state:pe(e.stage,e.attempts),attempts:e.attempts,createdAt:e.createdAt,folderLabel:fe(t)}}const je=[],Ne=[];function ye(e){window.open(e,"_blank","noopener,noreferrer")}function Se(e){return{report:X(e),issueUrl:x(p({quarantine:w(e),title:ee(e)}))}}function Re(e){const t=oe(e);return{report:t,issueUrl:x(p({syncWarning:t,title:le(e)}))}}function ve({signIn:e}){return s.jsx("section",{role:"alert",className:"space-y-3",children:s.jsxs("div",{className:"space-y-2 rounded-sm border border-danger/40 bg-danger-soft px-row-inset py-3",children:[s.jsx("p",{className:"text-sm font-medium text-danger",children:"Your session has ended."}),s.jsx("p",{className:"text-sm text-fg-muted",children:"Sign in again to see the messages that failed to sync or were set aside."}),e]})})}function we({error:e}){return s.jsx("section",{role:"alert",className:"space-y-3",children:s.jsxs("div",{className:"space-y-2 rounded-sm border border-danger/40 bg-danger-soft px-row-inset py-3",children:[s.jsx("p",{className:"text-sm font-medium text-danger",children:"The warnings could not be read."}),s.jsx("p",{className:"break-words text-sm text-fg-muted",children:U(e)}),s.jsx("p",{className:"text-xs text-fg-muted",children:"Mail may still be failing to sync or have been set aside — this page cannot say either way until it can read the list. Reporting this gets it fixed."}),s.jsx(d,{variant:"secondary",size:"sm",icon:s.jsx(h,{className:"size-3.5"}),onClick:()=>ye(x(p())),children:"Report this"})]})})}function Ie({read:e,signIn:t}){const[n,a]=l.useState(null),[o,r]=l.useState(!1);if(e.kind==="Pending")return s.jsx("p",{className:"animate-pulse text-sm text-fg-subtle",children:"Checking for warnings…"});if(e.kind==="SignedOut")return s.jsx(ve,{signIn:t});if(e.kind==="Failed")return s.jsx(we,{error:e.error});const u=i=>{navigator.clipboard.writeText(i).then(()=>{r(!1),a(null)},()=>{r(!0),a(null)})};return s.jsxs("div",{className:"space-y-6",children:[o&&s.jsx("p",{role:"alert",className:"text-sm text-danger",children:"The report was not copied — this browser refused clipboard access. Cut the bug again and use Open on GitHub, which needs no clipboard."}),s.jsx(ue,{entries:e.warnings,total:e.warningsTotal,onReport:i=>a(Re(i))}),s.jsx(ne,{entries:e.quarantine,onCutBug:i=>a(Se(i))}),s.jsx(Q,{report:n?.report??null,issueUrl:n?.issueUrl??"",onClose:()=>a(null),onCopy:u})]})}function Te(e,t){return e.get(t)?.hierarchyDelimiter??""}function Ce(){const e=M(),t=P(W()),n=l.useMemo(()=>t.data?.accounts??[],[t.data]),a=L(n),o=e.data?.entries??je,r=e.data?.warnings??Ne,u=l.useMemo(()=>o.map(c=>ge(c,Te(a.index,c.mailboxId))),[o,a.index]),i=l.useMemo(()=>r.map(c=>be(c,a.index.get(c.mailboxId))),[r,a.index]),I=$e(e.error??t.error??a.error,e.isPending||t.isPending||a.isPending,{kind:"Ready",quarantine:u,warnings:i,warningsTotal:e.data?.warningsTotal??0});return s.jsx(Ie,{read:I,signIn:s.jsx(me,{})})}function $e(e,t,n){return z(e)?{kind:"SignedOut"}:e?{kind:"Failed",error:e}:t?{kind:"Pending"}:n}function He(){const e=O(),t=B(),n=F(),[a,o]=l.useState(!0);return s.jsx(H,{items:t,activeId:"warnings",title:"Warnings",description:"Messages that failed to sync, and messages set aside.",help:G,helpOpen:a,onToggleHelp:()=>o(r=>!r),onSelect:n,onBackToMail:()=>{e({to:"/mail"})},children:s.jsx(Ce,{})})}export{He as component};
|
package/index.html
CHANGED
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
} catch (_) {}
|
|
36
36
|
})();
|
|
37
37
|
</script>
|
|
38
|
-
<script type="module" crossorigin src="/assets/index-
|
|
39
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
38
|
+
<script type="module" crossorigin src="/assets/index-Bn8n_AsE.js"></script>
|
|
39
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CqMlmBtY.css">
|
|
40
40
|
</head>
|
|
41
41
|
<body>
|
|
42
42
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r,L as Mt,eG as ne,d_ as re,r as a,a as Ke,H as ie,cV as jt,R as kt,dz as Et,eH as Ot,t as Ue,eI as At}from"./index-CKflMWYU.js";import{a5 as Ft,y as Nt,A as Bt,an as Lt,ao as qt,ap as _t,aq as Dt,ar as _e,as as Pt,at as Qt,au as zt,av as Wt,aw as Ht,ag as Gt,M as Kt,aj as Ut,ax as Vt,ah as $t,ay as Yt,az as Jt,f as Zt,p as Xt,ak as es,m as ts,S as ss,G as os,K as De,J as ns,H as rs,e as as,V as is,W as xe,X as cs,Z as Ve,_ as $e,$ as ls,a0 as ds,a1 as us}from"./MessageToolbar-BEI90gj6.js";import"./nav-link-D4-gc9H1.js";import{a as fs}from"./useMessageBodyContent-B0iiI3OV.js";import{o as ms,e as hs,f as gs}from"./search-token-index-CjZf08nc.js";import{d as ps,g as xs,r as Is}from"./reply-CM_F5zLS.js";import{u as Ye}from"./sections-HylxNewe.js";import{u as ae}from"./useQueries-DVcMuKhn.js";import{t as Je,s as ys,r as vs,L as bs}from"./LabelApplyTrigger-C03Hgfzy.js";import{u as Ss,a as Ts,R as Cs,b as ws,c as Rs}from"./useRefreshControl-CY786xTG.js";import{a as Ms}from"./useLabels-QIv6Xivl.js";import{u as js}from"./useLayoutTier-4MDmjdnr.js";import{u as ks}from"./useMediaQuery-B1PJEoqh.js";import{r as Ze,n as Es,o as Xe,w as et,u as Os,p as As,R as Fs}from"./MessageBody-D3iuMLwF.js";import{d as Ns,w as Bs}from"./wizard-selection-zWa1qc6-.js";import{R as Ls}from"./refresh-cw-BmzOf0Tw.js";import{S as qs}from"./sparkles-DxQ7dXLC.js";function _s({sync:e}){return e?r.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 py-12 text-center px-4",role:"status","aria-live":"polite",children:[r.jsx(Mt,{className:"size-8 animate-spin text-fg-subtle","aria-hidden":"true"}),r.jsx("p",{className:"text-sm font-medium text-fg",children:"Still syncing your mail"}),r.jsx("p",{className:"text-xs text-fg-subtle",children:Ds(e)})]}):r.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 py-12 text-center px-4",children:[r.jsx(qs,{className:"size-8 text-fg-subtle","aria-hidden":"true"}),r.jsx("p",{className:"text-sm font-medium text-fg",children:"You're caught up"}),r.jsx("p",{className:"text-xs text-fg-subtle",children:"Nothing needs attention."})]})}function Ds({synced:e,total:t}){return t>0?`${e.toLocaleString()} of ${t.toLocaleString()} messages downloaded. This list fills in as they arrive.`:"Downloading your messages. This list fills in as they arrive."}const tt=[{id:"unread",name:"is",value:"unread"},{id:"attachment",name:"has",value:"attachment"}],st="category",Ps={unclassified:"uncategorized"},H=e=>Es(e).map(t=>t.raw),W=e=>e.join(" "),Ie=e=>{const t=Xe(e);if(t)return tt.find(s=>s.name===t.name&&s.value===t.value.toLowerCase())?.id},ye=e=>{const t=Xe(e);if(!t||t.name!==st)return;const s=t.value.toLowerCase(),n=Ps[s];if(n)return n;if(!(!et(s)||s==="all"))return s},ot=e=>tt.find(t=>t.id===e),nt=e=>ot(e)!==void 0,Qs=e=>{const t=new Set;for(const s of H(e)){const n=Ie(s);n&&t.add(n)}return t},zs=e=>{let t="all";for(const s of H(e)){const n=ye(s);n&&(t=n)}return t},Ws=(e,t)=>{const s=ot(t);if(!s)return;const n=H(e),i=n.filter(d=>Ie(d)!==t);return i.length<n.length?W(i):W([...n,Ze(s.name,s.value)])},Hs=(e,t)=>{const s=H(e).filter(n=>!ye(n));return W(t==="all"?s:[...s,Ze(st,t)])},Gs=e=>W(H(e).filter(t=>!Ie(t)&&!ye(t))),rt=e=>e.trim().length>0,Pe=e=>{if(!rt(e.query))return e.ownFilters;const t=new Set(Qs(e.query));for(const s of e.ownFilters)nt(s)||t.add(s);return t},Qe=e=>rt(e.query)?zs(e.query):e.ownCategory,ze=6e4,Ks=3e4,Us={kind:"unknown"},We=e=>(t,s)=>Ft(s?.queryKey,e)?t:void 0,Vs=(e,t,s)=>({...e,category:[t],limit:s,order:"desc"}),$s=(e,t)=>({...e,category:[t],order:"desc",count:!0,results:!1}),He=(e,t)=>({category:[t],...e.unread!==void 0?{unread:e.unread}:{},...e.starred!==void 0?{starred:e.starred}:{},...e.attachments!==void 0?{attachments:e.attachments}:{},...e.accountId!==void 0?{accountId:e.accountId}:{},...e.muted!==void 0?{muted:e.muted}:{}});function Ys({categories:e,criteria:t,limit:s,counted:n}){const i=ae({queries:e.map(c=>{const h=Vs(t,c,s),u=He(t,c);return{queryKey:re({query:h}),queryFn:async()=>{const{data:v}=await ne({query:h,throwOnError:!0});return v},placeholderData:We(u),staleTime:ze}})}),d=ae({queries:e.map(c=>{const h=$s(t,c),u=He(t,c);return{queryKey:re({query:h}),queryFn:async()=>{const{data:v}=await ne({query:h,throwOnError:!0});return v},enabled:n,placeholderData:We(u),staleTime:ze}})}),m=a.useMemo(()=>e.map((c,h)=>{const u=i[h],v=d[h],p=u?.data?.items??[];return{category:c,rows:p,atCap:p.length>=s,total:n?Je(v?.data?.count):Us,loading:u?.isPending??!0,failed:u?.isError??!1,retry:()=>{u?.refetch(),n&&v?.refetch()}}}),[e,i,d,n,s]),l=a.useCallback(()=>{for(const c of i)c.refetch();for(const c of d)c.refetch()},[i,d]);return{sections:m,isLoading:i.length>0&&i.every(c=>c.isPending),isError:i.length>0&&i.every(c=>c.isError),refetch:l}}function Js(e,t,s){const n={...e,limit:t,order:"desc"},{data:i,isLoading:d,isError:m,refetch:l}=Ke({queryKey:re({query:n}),queryFn:async()=>{const{data:h}=await ne({query:n,throwOnError:!0});return h},enabled:s,staleTime:Ks});return{rows:a.useMemo(()=>s?i?.items??[]:[],[i,s]),isLoading:s&&d,isError:s&&m,refetch:a.useCallback(()=>{l()},[l])}}const Zs=3e4,Xs={kind:"unknown"},eo=(e,t)=>({...e,mailboxId:t,order:"desc",count:!0,results:!1});function to({criteria:e,junkMailboxIds:t,enabled:s}){const n=ae({queries:t.map(i=>{const d=eo(e,i);return{queryKey:re({query:d}),queryFn:async()=>{const{data:m}=await ne({query:d,throwOnError:!0});return m},enabled:s,staleTime:Zs}})});return a.useMemo(()=>t.map((i,d)=>({mailboxId:i,count:s?Je(n[d]?.data?.count):Xs,failed:s?n[d]?.isError??!1:!1})),[t,n,s])}const so=(e,t)=>e.createdAt!==t.createdAt?e.createdAt-t.createdAt:e.accountId.localeCompare(t.accountId),oo=e=>[...e].sort(so),no=["from","subject","category","unread","starred","attachments"],at=["contacts","today"],ro=e=>new Set(at.filter(t=>e.has(t))),ao=(e,t,s,n)=>{const i=Nt({category:e,attributes:t}),{params:d,residual:m}=Bt(s,i,no),l={...d,...i},c={muted:!1};return l.from!==void 0&&(c.from=l.from),l.subject!==void 0&&(c.subject=l.subject),l.unread!==void 0&&(c.unread=l.unread),l.starred!==void 0&&(c.starred=l.starred),l.attachments!==void 0&&(c.attachments=l.attachments),n!==void 0&&(c.accountId=n),{criteria:c,residual:m}},io=({residual:e,attributes:t})=>e.length===0&&!at.some(s=>t.has(s)),se=e=>e.count.kind==="exact"&&e.count.value>0?3:e.pageRows>0?2:e.count.kind==="unknown"?1:0,oe=e=>e.count.kind==="exact"?e.count.value:0,co=(e,t)=>se(e)!==se(t)?se(e)>se(t):oe(e)!==oe(t)?oe(e)>oe(t):e.pageRows>t.pageRows;function lo(e,{pageRowsByMailbox:t}){const s=e.map(u=>({...u,pageRows:t.get(u.mailboxId)??0}));for(const[u,v]of t)v<=0||s.some(p=>p.mailboxId===u)||s.push({mailboxId:u,count:{kind:"unknown"},failed:!1,pageRows:v});const n=s[0];if(!n)return;let i=0,d=!0,m=n;for(const u of s)u.count.kind==="unknown"?d=!1:i+=u.count.value,co(u,m)&&(m=u);const l=s.some(u=>u.pageRows>0),c=s.some(u=>u.failed);if(i===0&&!l&&(d||!c))return;const h=d&&i===0&&l;return{mailboxId:m.mailboxId,count:d&&!h?{kind:"exact",value:i}:{kind:"unknown"}}}const uo=50,fo=200,mo=[],Ge=()=>r.jsx("div",{className:"animate-pulse",children:Array.from({length:3}).map((e,t)=>r.jsxs("div",{className:"flex items-start gap-3 py-2 pl-5 pr-4 border-b border-line",children:[r.jsx("div",{className:"size-7 rounded-full bg-surface-sunken shrink-0 mt-0.5"}),r.jsxs("div",{className:"flex-1 space-y-1.5",children:[r.jsxs("div",{className:"flex justify-between gap-2",children:[r.jsx("div",{className:"h-3.5 bg-surface-sunken rounded w-28"}),r.jsx("div",{className:"h-3 bg-surface-sunken rounded w-12"})]}),r.jsx("div",{className:"h-3.5 bg-surface-sunken rounded w-48"}),r.jsx("div",{className:"h-3 bg-surface-sunken rounded w-full"})]})]},t))}),ho=({accountEmail:e})=>{const t=Ye();return r.jsxs("div",{className:"flex items-center gap-2 px-row-inset py-2 border-b border-line bg-danger-soft/40 text-xs text-danger",children:[r.jsx(Ue,{className:"size-3.5 shrink-0"}),r.jsxs("span",{className:"flex-1 truncate",children:[e," can't connect"]}),r.jsx("button",{type:"button",onClick:()=>t("accounts"),className:"shrink-0 underline text-danger hover:opacity-80",children:"Reconnect"})]})},go=(e,t)=>{if(t.size===0)return{};const s=e.filter(d=>t.has(d.id)),n=vs(s.map(d=>d.accountId));if(n.restriction)return n;const i=new Set;for(const d of s)d.mailboxId&&i.add(d.mailboxId);return i.size>1?{accountId:n.accountId,restriction:"spansFolders",moveDisabledHint:`Move only works within one folder — this selection spans ${i.size} folders`}:{accountId:n.accountId,mailboxId:i.size===1?[...i][0]:void 0}};function po({header:e,rows:t,wizard:s,children:n}){const{selectedIds:i,selectedCount:d,exitSelection:m,orderedIds:l,allSelected:c,toggleAllLoaded:h}=Jt(),u=a.useMemo(()=>go(t,i),[t,i]),{junkMailboxId:v}=Zt(u.accountId),{labels:p}=Ms(u.accountId),b=a.useMemo(()=>Array.from(i),[i]),L=a.useMemo(()=>Bs(t,i),[t,i]),x=Xt(v,u.mailboxId),S=a.useMemo(()=>l.length>0?{checked:c,indeterminate:d>0&&!c,onChange:h}:void 0,[l.length,c,d,h]),F=u.moveDisabledHint?{tone:"warning",text:u.moveDisabledHint}:void 0,T=R=>r.jsx(ss,{title:R.title,navSlot:R.navSlot,titleMeta:R.titleMeta,searchSlot:R.searchSlot,searchField:R.searchField,idleSlot:R.makeFilterSlot,count:d,onCancel:m,onDelete:()=>s.start("delete"),onMove:()=>s.start("move"),onOrganize:()=>s.start("organize"),onJunk:x?()=>s.start("junk"):void 0,onMarkRead:()=>s.start("markRead"),overflowSlot:u.accountId&&u.mailboxId&&d>0&&p.length>0?r.jsx(bs,{accountId:u.accountId,mailboxId:u.mailboxId,messageIds:b}):void 0,selectAll:S,notice:F});return r.jsx(es,{...e,selectionBar:T,paneOverlay:r.jsx(ts,{verb:s.verb,accountId:u.accountId,mailboxId:u.mailboxId,selection:L,selectionRestriction:u.restriction,onFinished:m}),children:n})}function xo({accounts:e,selectedMessageId:t,onOpenThread:s,commandsRef:n,onTriageContextChange:i,onDeleteMessages:d}){const{searchQuery:m,searchInput:l,resultFolderIndex:c,onSearchChange:h}=ie(),u=Os(),v=ks(),p=js(),b=jt(),L=ms(),x=a.useMemo(()=>oo(e.filter(o=>!o.muted?.value)),[e]),[S,F]=a.useState("all"),[T,R]=a.useState("all"),[N,q]=a.useState(new Set),[le,M]=a.useState(!1),_=a.useCallback(o=>{q(f=>{const g=new Set(f);return g.has(o)?g.delete(o):g.add(o),g})},[]),G=a.useCallback(()=>q(new Set),[]),E=l.trim().length>0,{freeText:w,tokens:D}=As(m.trim().toLowerCase(),u),y=w.length>0,P=a.useMemo(()=>Pe({query:l,ownFilters:N}),[l,N]),Q=a.useMemo(()=>Qe({query:l,ownCategory:T}),[l,T]),A=a.useMemo(()=>Pe({query:m,ownFilters:N}),[m,N]),C=a.useMemo(()=>Qe({query:m,ownCategory:T}),[m,T]),I=a.useCallback(o=>{if(!E||!nt(o)){_(o);return}const f=Ws(l,o);f!==void 0&&h(f)},[E,l,h,_]),j=a.useCallback(o=>{if(!E){R(o);return}h(Hs(l,o))},[E,l,h]),de=a.useMemo(()=>C==="all"&&!y?o=>{et(o)&&j(o)}:void 0,[C,y,j]),ue=a.useCallback(()=>{R("all"),F("all"),G(),E&&h(Gs(l))},[E,l,h,G]),K=ae({queries:x.map(o=>({...kt({path:{accountId:o.accountId}}),staleTime:1/0,meta:{softError:!0}}))}),U=a.useMemo(()=>{const o=new Map;for(let f=0;f<x.length;f++){const g=x[f].accountId,te=(K[f]?.data?.items??[]).reduce((O,Rt)=>O+(Rt.unseenCount??0),0);o.set(g,te)}return o},[x,K]),lt=a.useMemo(()=>x.filter((o,f)=>{const g=K[f];return g?.isError?!Et(g.error):!1}),[x,K]),{criteria:fe,residual:V}=a.useMemo(()=>ao(C,A,D,S==="all"?void 0:S),[C,A,D,S]),dt=a.useMemo(()=>C==="all"?[...Lt]:[C],[C]),ve=a.useMemo(()=>({...fe,query:w,...C==="all"?{}:{category:[C]}}),[fe,w,C]),be=io({residual:V,attributes:A}),{sections:$,isLoading:ut,isError:ft,refetch:Se}=Ys({categories:y?mo:dt,criteria:fe,limit:C==="all"?Yt:uo,counted:be}),{rows:Te,isLoading:mt,isError:ht,refetch:Ce}=Js(ve,fo,y),me=y?mt:ut,we=y?ht:ft,Re=a.useCallback(()=>{if(y){Ce();return}Se()},[y,Ce,Se]),Me=a.useMemo(()=>ro(A),[A]),Y=a.useCallback(o=>Ns(o).map(qt).filter(f=>_t(f,Me)&&Dt(f,V)),[Me,V]),J=a.useMemo(()=>$.map(o=>({category:o.category,total:o.total,atCap:o.atCap,loading:o.loading,failed:o.failed,rows:Y(o.rows)})),[$,Y]),Z=a.useMemo(()=>Y(Te),[Te,Y]),gt=a.useCallback(o=>{$.find(f=>f.category===o)?.retry()},[$]),k=a.useMemo(()=>y?Z:J.flatMap(o=>o.rows),[y,Z,J]),pt=a.useMemo(()=>Ot(c),[c]),je=to({criteria:ve,junkMailboxIds:pt,enabled:be&&ys({hasSearchQuery:y,freeText:w,residualTokenCount:V.length})}),{spamIds:he,briefSpamOffer:X}=a.useMemo(()=>{const o={spamIds:void 0,briefSpamOffer:void 0};if(!w)return o;const f=k.map(O=>_e(O,c)),{spam:g}=Pt(f),B=new Map;for(const O of g)O.mailboxId&&B.set(O.mailboxId,(B.get(O.mailboxId)??0)+1);const te=lo(je,{pageRowsByMailbox:B});return g.length===0&&!te?o:{spamIds:g.length>0?new Set(g.map(O=>O.id)):void 0,briefSpamOffer:te}},[k,w,c,je]),ke=a.useMemo(()=>{const o=f=>he===void 0?f:f.filter(g=>!he.has(g.id));return y?[{id:"matches",threads:o(Z)}]:Qt(J.map(f=>({...f,rows:o(f.rows)})))},[y,Z,J,he]),Ee=a.useCallback((o,f)=>{const g=k.find(B=>B.id===o)?.threadId;g&&s?.({threadId:g,messageId:o},f)},[k,s]),xt=a.useCallback(o=>{const f=o.threadId??k.find(g=>g.id===o.id)?.threadId;f&&s?.({threadId:f,messageId:o.id})},[k,s]),ge=a.useMemo(()=>x.length<=1?[]:[{id:"all",label:"All",active:S==="all"},...x.map(o=>({id:o.accountId,label:o.email.split("@")[0]??o.email,count:U.get(o.accountId),active:S===o.accountId}))],[x,U,S]),z=a.useMemo(()=>e.filter(o=>o.muted?.value).length,[e]),It=a.useMemo(()=>Array.from(U.values()).reduce((o,f)=>o+f,0),[U]),pe=a.useMemo(()=>x.map(o=>o.accountId),[x]),{hasNewMail:Oe}=Ss(),{state:Ae,errorMessage:Fe,refresh:Ne}=Ts(pe,{onSettled:()=>Re()}),yt=a.useMemo(()=>r.jsx(Cs,{state:Ae,onRefresh:Ne,label:"Refresh daily brief",errorMessage:Fe,hasUpdate:Oe(pe)}),[Ae,Ne,Fe,Oe,pe]),vt=a.useMemo(()=>k.map(o=>_e(o,c)),[k,c]),bt=a.useMemo(()=>{const o=zt(ge.map(f=>({id:f.id,label:f.label,count:f.count,active:f.active})));return{categories:o.categories,filters:o.filters,sources:o.sources,sourcesNote:z>0?`+${z} muted`:void 0,selectedCategory:Q,activeFilters:P,expanded:le,onExpandedChange:M,onSelectCategory:f=>j(f),onSelectSource:F,onToggleFilter:f=>I(f),onClear:ue}},[ge,z,Q,P,le,I,j,ue]),Be=ke.length===0&&S==="all"&&w.length===0&&D.length===0,St=a.useMemo(()=>x.map(o=>o.accountId),[x]),Tt=a.useMemo(()=>x.some(o=>ws(o.syncPhase)),[x]),ee=Rs(St,Be||Tt),Le=r.jsxs("div",{className:"h-full overflow-y-auto",children:[r.jsx(Ge,{}),r.jsx(Ge,{})]}),qe=!me&&!we&&!Be,Ct=Wt({tier:p,hasLiveInput:E,hasCommittedQuery:m.trim().length>0,bodyRendersCommittedResults:!0}),wt=qe?r.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[X&&r.jsx(Ht,{count:X.count,onScopeToSpam:()=>L(X.mailboxId,m)}),r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(Gt,{sections:ke,briefCategory:Q,Row:Kt,selectedThreadId:t,onSelectThread:Ee,onShowAllSection:de,onRetrySection:gt,flat:y,onSelectBriefCategory:j,sources:ge,sourcesNote:z>0?`+${z} muted`:void 0,onSelectSource:F,activeFilters:P,onToggleFilter:I,onClearFilters:ue})})]}):me?Le:we?r.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 py-12 text-sm text-fg-muted",children:[r.jsx(Ue,{className:"size-8 text-danger"}),r.jsx("p",{children:"Couldn't load your messages"}),r.jsxs("button",{type:"button",onClick:()=>Re(),className:"flex items-center gap-1 text-accent underline text-xs",children:[r.jsx(Ls,{className:"size-3.5"}),"Try again"]})]}):ee.resolved?r.jsx(_s,{sync:ee.syncing?{synced:ee.synced,total:ee.total}:void 0}):Le;return r.jsx(Ut,{hasSheet:qe&&!Ct,children:r.jsx(Vt,{selectedMessageId:t,rows:k,onOpen:Ee,onDeleteMessages:d,onSelectionVerb:b.start,commandsRef:n,onTriageContextChange:i,children:r.jsx(po,{wizard:b,header:{title:"Daily brief",unreadCount:It,footer:v?r.jsx($t,{}):void 0,searchFilter:bt,searchResults:vt,searchLoading:me,onSelectSearchResult:xt,spamOffer:X,searchResultsInBody:!0,refreshControl:yt},rows:k,children:r.jsxs("div",{className:"flex h-full flex-col",children:[lt.map(o=>r.jsx(ho,{accountEmail:o.email,accountId:o.accountId},o.accountId)),r.jsx("div",{className:"min-h-0 flex-1",children:wt})]})})})})}const it=a.createContext(null);function ce(){const e=a.useContext(it);if(!e)throw new Error("BriefPane.* must be used inside <BriefPane>");return e}function Io({thread:e,children:t}){const s=hs(),n=gs(),i=Ye(),{searchInput:d}=ie(),m=e?.threadId,l=e?.messageId,{data:c}=Ke({...At(),staleTime:6e4}),h=a.useMemo(()=>c?.items??[],[c]),u=a.useMemo(()=>{if(m)return h.find(I=>I.messageId===l)??h.find(I=>I.threadId===m)},[h,m,l]),v=os(m,l),p=u??v,b=l??p?.messageId,L=a.useMemo(()=>{if(m)return{threadId:m,mailboxId:p?.mailboxId??"",subject:p?.subject,messageId:b,authenticity:p?.authenticity}},[m,p,b]),x=a.useCallback((I,j)=>{s(I,{replace:j?.replace,query:d})},[s,d]),S=a.useCallback(I=>{b&&I.includes(b)&&n()},[b,n]),F=De({thread:p,isOpen:!0,onAfterOptimisticRemove:S}),T=ns(),{deleteMessages:R}=rs({mailboxId:p?.mailboxId??"",messages:h,onAfterOptimisticRemove:S}),{toggleReadFor:N}=as({mailboxId:p?.mailboxId??"",messages:h}),q=T.focusedMessageId,M=a.useMemo(()=>h.find(I=>I.messageId===q),[h,q])??p,_=De({thread:M,isOpen:M?.messageId===b}),G=fs(),E=ps(),w=xs(),D=a.useMemo(()=>Is(w,m,b),[w,m,b]),y=a.useMemo(()=>{if(M)return I=>w({threadId:M.threadId,messageId:M.messageId,mode:I})},[w,M]),{nextMessageId:P,previousMessageId:Q}=is({context:T,orderedIds:T.orderedIds,selectedMessageId:b,enabled:!G&&!E,hasOpenThread:m!==void 0,onClose:n,handlers:{reply:()=>y?.("reply"),replyAll:()=>y?.("reply-all"),forward:()=>y?.("forward"),delete:()=>{T.listCommandsRef.current?.requestVerb("delete")||_.deleteThread()},toggleStar:_.toggleStar,toggleRead:()=>{T.listCommandsRef.current?.requestVerb("markRead")||M&&N([M.messageId],!M.isRead)},goFlagged:()=>i("flagged"),goSettings:()=>i("settings")}}),A=a.useCallback(I=>{if(!I)return;const j=h.find(de=>de.messageId===I);return j?{threadId:j.threadId,messageId:I}:void 0},[h]),C={selectedMessageId:b,selectedThread:p,conversation:L,onOpenThread:x,onCloseThread:n,nextThread:A(P),previousThread:A(Q),actions:F,onReply:D,triage:T,onDeleteMessages:R,handleDeselectIfRemoved:S};return r.jsx(it.Provider,{value:C,children:t})}function ct(){const{selectedMessageId:e,onOpenThread:t,triage:s,onDeleteMessages:n}=ce(),{accounts:i}=ie();return r.jsx(xo,{accounts:i,selectedMessageId:e,onOpenThread:t,commandsRef:s.listCommandsRef,onTriageContextChange:s.onTriageContextChange,onDeleteMessages:n})}function yo(){const e=xe(),{conversation:t,selectedThread:s,actions:n,onReply:i,handleDeselectIfRemoved:d,onOpenThread:m}=ce(),l=!!t,c=ds(t?.threadId);return r.jsxs(r.Fragment,{children:[r.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[r.jsx(us,{hasThread:l,intelligenceOpen:c.isShowing,canToggleIntelligence:c.canToggle,onToggleIntelligence:c.toggle,onReply:i?()=>i("reply"):void 0,onReplyAll:i?()=>i("reply-all"):void 0,onForward:i?()=>i("forward"):void 0,onDelete:l?n.deleteThread:void 0,onToggleStar:l?n.toggleStar:void 0,isStarred:n.isStarred,moveContext:l&&n.accountId&&n.mailboxId?{accountId:n.accountId,currentMailboxId:n.mailboxId,onMove:n.moveThread}:void 0}),r.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:t?r.jsx(Ve,{threadId:t.threadId,mailboxId:t.mailboxId,subject:t.subject,selectedMessageId:t.messageId,authenticity:t.authenticity,onOpenIntelligence:c.open,listOnScreen:!0}):r.jsx(Fs,{})})]}),r.jsx($e,{isOpen:c.drawerOpen,onClose:c.closeDrawer,thread:s,accountId:s?.accountId,onAfterOptimisticRemove:d,onReplyWithText:e,onOpenThread:m})]})}function vo(){const e=xe(),{selectedThread:t,handleDeselectIfRemoved:s,onOpenThread:n}=ce(),{onToggleIntelligence:i}=ie();return r.jsx(ls,{onClose:i,thread:t,accountId:t?.accountId,onAfterOptimisticRemove:s,onReplyWithText:e,onOpenThread:n})}function bo(){const e=xe(),{selectedThread:t,conversation:s,onOpenThread:n,onCloseThread:i,nextThread:d,previousThread:m,handleDeselectIfRemoved:l}=ce(),c=cs(s?.threadId??null);return s?r.jsxs(r.Fragment,{children:[r.jsx(Ve,{threadId:s.threadId,mailboxId:s.mailboxId,subject:s.subject,selectedMessageId:s.messageId,authenticity:s.authenticity,onBack:i,onOpenIntelligence:c.toggle,onSwipeNext:d?()=>n(d):void 0,onSwipePrevious:m?()=>n(m):void 0,mobileIntelligenceOpen:c.isOpen}),r.jsx($e,{isOpen:c.isOpen,onClose:c.close,thread:t,accountId:t?.accountId,onAfterOptimisticRemove:l,onReplyWithText:e,onOpenThread:n})]}):r.jsx("div",{className:"h-full",children:r.jsx(ct,{})})}const Do=Object.assign(Io,{List:ct,Reading:yo,Intelligence:vo,Phone:bo});export{Do as B};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{eG as J,r as n,d_ as X,a as le,H,cV as ce,av as ue,aw as ge,j as r}from"./index-CKflMWYU.js";import{y as he,A as me,ao as pe,aq as fe,aA as xe,ar as Ie,d as Te,M as ye,ax as ve,aB as be,az as Re,m as Ce,G as Se,K as _,J as we,H as je,e as Fe,V as Me,W as V,X as Oe,Z,_ as $,$ as ke,a0 as Pe,a1 as Le}from"./MessageToolbar-BEI90gj6.js";import{u as Ae,l as Ne,b as De,a as qe}from"./MailViewChrome-Dsvhd_KV.js";import"./nav-link-D4-gc9H1.js";import{a as Ee}from"./useMessageBodyContent-B0iiI3OV.js";import{e as Be,f as We}from"./search-token-index-CjZf08nc.js";import{d as Qe,g as He,r as Ve}from"./reply-CM_F5zLS.js";import{u as ze}from"./sections-HylxNewe.js";import{u as Ge}from"./useMediaQuery-B1PJEoqh.js";import{u as Ke,p as U,R as _e}from"./MessageBody-D3iuMLwF.js";import{d as Ue,w as Je}from"./wizard-selection-zWa1qc6-.js";import{f as Xe}from"./ErrorState-94ifepAa.js";const z=t=>({...t,starred:!0,order:"desc"}),Ze=(t={})=>X({query:z(t)});function Y(t={}){const{data:e,isLoading:s,isError:a,error:i,refetch:f,fetchNextPage:l,hasNextPage:g,isFetchingNextPage:o}=Ae({queryKey:Ze(t),queryFn:async({pageParam:x})=>{const{data:u}=await J({query:{...z(t),continuationToken:x},throwOnError:!0});return u},initialPageParam:void 0,getNextPageParam:x=>x.continuationToken,staleTime:6e4});return{threads:n.useMemo(()=>(e?.pages??[]).flatMap(x=>x.items??[]),[e]),isLoading:s,isError:a,error:i,refetch:f,fetchNextPage:l,hasNextPage:g,isFetchingNextPage:o}}function $e(t={}){const e={...z(t),unread:!0,count:!0,results:!1},{data:s}=le({queryKey:X({query:e}),queryFn:async()=>{const{data:a}=await J({query:e,throwOnError:!0});return a},staleTime:6e4});return s?.count}const Ye=["from","subject","category","unread","starred","attachments"],et=(t,e)=>{const s=he(t),{params:a,residual:i}=me(e,{...s,starred:!0},Ye);return{criteria:{...a,...s},residual:i}};function tt({rows:t,verb:e}){const{selectedIds:s,exitSelection:a}=Re(),i=n.useMemo(()=>Je(t,s),[t,s]);return r.jsx(Ce,{verb:e,selection:i,selectionRestriction:"spansAccounts",onFinished:a})}function st({selectedMessageId:t,onOpenThread:e,commandsRef:s,onTriageContextChange:a,onDeleteMessages:i}){const{searchQuery:f,resultFolderIndex:l,onSearchClearQuery:g}=H(),o=Ke(),k=Ge(),x=ce(),[u,h]=n.useState("all"),[v,P]=n.useState(new Set),S=n.useCallback(d=>{P(C=>{const I=new Set(C);return I.has(d)?I.delete(d):I.add(d),I})},[]),w=n.useCallback(()=>{h("all"),P(new Set)},[]),T=n.useCallback(()=>{w(),g()},[w,g]),{freeText:j,tokens:b}=U(f.trim().toLowerCase(),o),L=U(f.trim(),o).freeText,{criteria:A,residual:m}=n.useMemo(()=>et({category:u,attributes:v},b),[u,v,b]),F=n.useMemo(()=>j?{...A,query:j}:A,[A,j]),{threads:N,isLoading:D,isError:y,error:E,refetch:M,fetchNextPage:B,hasNextPage:W,isFetchingNextPage:O}=Y(F),p=n.useMemo(()=>Ue(N).map(pe).filter(d=>fe(d,m)),[N,m]),c=n.useCallback((d,C)=>{const I=p.find(de=>de.id===d)?.threadId;I&&e?.({threadId:I,messageId:d},C)},[p,e]),R=n.useCallback(d=>{const C=d.threadId??p.find(I=>I.id===d.id)?.threadId;C&&e?.({threadId:C,messageId:d.id})},[p,e]),Q=n.useMemo(()=>xe(),[]),se=n.useMemo(()=>p.map(d=>Ie(d,l)),[p,l]),ae=$e(F)??null,re=n.useMemo(()=>b.filter(d=>d.type!=="isStarred"),[b]),oe=Ne({chips:{category:u,attributes:v},tokens:re,reach:m.length>0?"loaded-pages":"whole-folder",onClear:T}),G=D?"loading":y?"error":p.length===0?"empty":"ready",ne=n.useCallback(()=>{const d=ue(ge());window.open(d,"_blank","noopener,noreferrer")},[]),K=Te(),ie=r.jsx("div",{className:"flex h-full min-h-0 flex-col",children:r.jsxs("div",{className:"flex-1 overflow-y-auto",children:[r.jsx("div",{className:"divide-y divide-line",children:p.map(d=>r.jsx(ye,{thread:d,active:d.id===t,onClick:()=>c(d.id)},d.id))}),W?r.jsx("button",{type:"button",className:"w-full py-3 text-sm text-muted hover:text-fg disabled:opacity-50",onClick:()=>B(),disabled:O,children:O?"Loading…":"Load more"}):null]})});return r.jsx(De,{title:"Starred",unreadCount:ae,preset:Q,selectedCategory:u,activeFilters:v,onSelectCategory:h,onToggleFilter:S,onClearFilters:w,searchResults:se,searchLoading:D,onSelectSearchResult:R,searchResultsInBody:!0,children:r.jsxs(ve,{selectedMessageId:t,rows:p,onOpen:c,onDeleteMessages:i,onSelectionVerb:x.start,commandsRef:s,onTriageContextChange:a,children:[r.jsx(qe,{listTitle:"Starred",sections:[{id:"flagged",threads:p}],flatList:!0,hideHeader:!0,listState:K.searchResults?"ready":G,listFilter:oe,listScopeLabel:"Starred",searchQuery:L||void 0,errorMessage:y?Xe(E):void 0,onRetry:()=>M(),onReportError:ne,selectedThreadId:t,onSelectThread:c,isDesktop:k,selectionBar:r.jsx(be,{title:"Starred"}),listBody:K.searchResults??(G==="ready"?ie:void 0)}),r.jsx(tt,{rows:p,verb:x.verb})]})})}const ee=n.createContext(null);function q(){const t=n.useContext(ee);if(!t)throw new Error("FlaggedPane.* must be used inside <FlaggedPane>");return t}function at({thread:t,children:e}){const s=Be(),a=We(),i=ze(),{searchInput:f}=H(),l=t?.threadId,g=t?.messageId,{threads:o}=Y(),k=n.useMemo(()=>{if(l)return o.find(c=>c.messageId===g)??o.find(c=>c.threadId===l)},[o,l,g]),x=Se(l,g),u=k??x,h=g??u?.messageId,v=n.useMemo(()=>{if(l)return{threadId:l,mailboxId:u?.mailboxId??"",subject:u?.subject,messageId:h,authenticity:u?.authenticity}},[l,u,h]),P=n.useCallback((c,R)=>{s(c,{replace:R?.replace,query:f})},[s,f]),S=n.useCallback(c=>{h&&c.includes(h)&&a()},[h,a]),w=_({thread:u,isOpen:!0,onAfterOptimisticRemove:S}),T=we(),{deleteMessages:j}=je({mailboxId:u?.mailboxId??"",messages:o,onAfterOptimisticRemove:S}),{toggleReadFor:b}=Fe({mailboxId:u?.mailboxId??"",messages:o}),L=T.focusedMessageId,m=n.useMemo(()=>o.find(c=>c.messageId===L),[o,L])??u,F=_({thread:m,isOpen:m?.messageId===h}),N=Ee(),D=Qe(),y=He(),E=n.useMemo(()=>Ve(y,l,h),[y,l,h]),M=n.useMemo(()=>{if(m)return c=>y({threadId:m.threadId,messageId:m.messageId,mode:c})},[y,m]),{nextMessageId:B,previousMessageId:W}=Me({context:T,orderedIds:T.orderedIds,selectedMessageId:h,enabled:!N&&!D,hasOpenThread:l!==void 0,onClose:a,handlers:{reply:()=>M?.("reply"),replyAll:()=>M?.("reply-all"),forward:()=>M?.("forward"),delete:()=>{T.listCommandsRef.current?.requestVerb("delete")||F.deleteThread()},toggleStar:F.toggleStar,toggleRead:()=>{T.listCommandsRef.current?.requestVerb("markRead")||m&&b([m.messageId],!m.isRead)},goBrief:()=>i("brief"),goSettings:()=>i("settings")}}),O=n.useCallback(c=>{if(!c)return;const R=o.find(Q=>Q.messageId===c);return R?{threadId:R.threadId,messageId:c}:void 0},[o]),p={selectedMessageId:h,selectedThread:u,conversation:v,onOpenThread:P,onCloseThread:a,nextThread:O(B),previousThread:O(W),actions:w,onReply:E,triage:T,onDeleteMessages:j,handleDeselectIfRemoved:S};return r.jsx(ee.Provider,{value:p,children:e})}function te(){const{selectedMessageId:t,onOpenThread:e,triage:s,onDeleteMessages:a}=q();return r.jsx(st,{selectedMessageId:t,onOpenThread:e,commandsRef:s.listCommandsRef,onTriageContextChange:s.onTriageContextChange,onDeleteMessages:a})}function rt(){const t=V(),{conversation:e,selectedThread:s,actions:a,onReply:i,handleDeselectIfRemoved:f,onOpenThread:l}=q(),g=!!e,o=Pe(e?.threadId);return r.jsxs(r.Fragment,{children:[r.jsxs("section",{className:"flex h-full w-full min-w-0 flex-col bg-canvas",children:[r.jsx(Le,{hasThread:g,intelligenceOpen:o.isShowing,canToggleIntelligence:o.canToggle,onToggleIntelligence:o.toggle,onReply:i?()=>i("reply"):void 0,onReplyAll:i?()=>i("reply-all"):void 0,onForward:i?()=>i("forward"):void 0,onDelete:g?a.deleteThread:void 0,onToggleStar:g?a.toggleStar:void 0,isStarred:a.isStarred,moveContext:g&&a.accountId&&a.mailboxId?{accountId:a.accountId,currentMailboxId:a.mailboxId,onMove:a.moveThread}:void 0}),r.jsx("div",{className:"min-h-0 flex-1 overflow-hidden",children:e?r.jsx(Z,{threadId:e.threadId,mailboxId:e.mailboxId,subject:e.subject,selectedMessageId:e.messageId,authenticity:e.authenticity,onOpenIntelligence:o.open,listOnScreen:!0}):r.jsx(_e,{})})]}),r.jsx($,{isOpen:o.drawerOpen,onClose:o.closeDrawer,thread:s,accountId:s?.accountId,onAfterOptimisticRemove:f,onReplyWithText:t,onOpenThread:l})]})}function ot(){const t=V(),{selectedThread:e,handleDeselectIfRemoved:s,onOpenThread:a}=q(),{onToggleIntelligence:i}=H();return r.jsx(ke,{onClose:i,thread:e,accountId:e?.accountId,onAfterOptimisticRemove:s,onReplyWithText:t,onOpenThread:a})}function nt(){const t=V(),{selectedThread:e,conversation:s,onCloseThread:a,onOpenThread:i,nextThread:f,previousThread:l,handleDeselectIfRemoved:g}=q(),o=Oe(s?.threadId??null);return s?r.jsxs(r.Fragment,{children:[r.jsx(Z,{threadId:s.threadId,mailboxId:s.mailboxId,subject:s.subject,selectedMessageId:s.messageId,authenticity:s.authenticity,onBack:a,onOpenIntelligence:o.toggle,onSwipeNext:f?()=>i(f):void 0,onSwipePrevious:l?()=>i(l):void 0,mobileIntelligenceOpen:o.isOpen}),r.jsx($,{isOpen:o.isOpen,onClose:o.close,thread:e,accountId:e?.accountId,onAfterOptimisticRemove:g,onReplyWithText:t,onOpenThread:i})]}):r.jsx("div",{className:"h-full",children:r.jsx(te,{})})}const Tt=Object.assign(at,{List:te,Reading:rt,Intelligence:ot,Phone:nt});export{Tt as F};
|