@remit/web-client-dist 0.0.697 → 0.0.698
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-BQx5RRpb.js → BriefPane-OvZiBDtW.js} +1 -1
- package/assets/{CalendarEventEditor-B3bVY-Oc.js → CalendarEventEditor-JBfO_GQa.js} +1 -1
- package/assets/{CalendarEventPopup-D6PNfUfu.js → CalendarEventPopup-U6Ndkn2v.js} +1 -1
- package/assets/{CalendarLoadFailed-Cm6trTQZ.js → CalendarLoadFailed-CNaVKDtW.js} +1 -1
- package/assets/{CalendarQuickCreate-B_n983kv.js → CalendarQuickCreate-C-yc6zce.js} +1 -1
- package/assets/{CalendarSession-BosFoHg2.js → CalendarSession-C_XnZoOI.js} +1 -1
- package/assets/{CollectionPane-BzktgIp0.js → CollectionPane-C6EYtyWc.js} +1 -1
- package/assets/{DesktopChrome-GxTHTvqD.js → DesktopChrome-DXIJ6wUA.js} +1 -1
- package/assets/{DropdownMenu-C2J8u8zN.js → DropdownMenu-DsxemHc4.js} +1 -1
- package/assets/{EmptyState-BJU14tbt.js → EmptyState-Dv8xCRkX.js} +1 -1
- package/assets/{ErrorState-BTHOmsYP.js → ErrorState-BptbbJAv.js} +1 -1
- package/assets/{FullCompose-DiZNltCL.js → FullCompose-BGLjrGst.js} +1 -1
- package/assets/{LabelApplyTrigger-P8IoLKME.js → LabelApplyTrigger-DzgVUcax.js} +1 -1
- package/assets/{MailShell-tKLYT5hn.js → MailShell-DE0ZN2ct.js} +1 -1
- package/assets/{MailViewChrome-CLgaFbe-.js → MailViewChrome-DoBZYTxQ.js} +1 -1
- package/assets/MailboxPane-CxaGFC0R.js +135 -0
- package/assets/{MessageBody-jG4Dhul6.js → MessageBody-BYYCZieC.js} +1 -1
- package/assets/MessageToolbar-CnhMX7Ap.js +1 -0
- package/assets/{NavMenuButton-CLp6InRG.js → NavMenuButton-B28Nb9kR.js} +1 -1
- package/assets/{OnboardingWizard-BSlPpmI5.js → OnboardingWizard-dQ9c99Ni.js} +1 -1
- package/assets/{OutboxPane-B6UfixBP.js → OutboxPane-ByJt4RDv.js} +1 -1
- package/assets/{ReportLink-BELrQR40.js → ReportLink-D0tCso5T.js} +1 -1
- package/assets/_calendarObjectId-DA9THlEZ.js +1 -0
- package/assets/_labelId-QQEJSaaH.js +1 -0
- package/assets/_mailboxId-CjHcitFP.js +1 -0
- package/assets/_messageId-BR_TgwKr.js +1 -0
- package/assets/_messageId-CAxQBVFC.js +1 -0
- package/assets/_messageId-CO7AhNVu.js +1 -0
- package/assets/_messageId-D0sfforj.js +1 -0
- package/assets/_outboxMessageId-CuYUqctH.js +1 -0
- package/assets/_recurrenceId-CLQuwNQw.js +1 -0
- package/assets/{_slotId-DQqfctAf.js → _slotId-BgSRkGdw.js} +1 -1
- package/assets/_threadId-BGKDrxuA.js +1 -0
- package/assets/_threadId-Ba8E2aAx.js +1 -0
- package/assets/_threadId-Br_FU4M4.js +1 -0
- package/assets/_threadId-D9ge4hnK.js +1 -0
- package/assets/_view._date-BCOouUgc.js +1 -0
- package/assets/{account-service-status-DsLvRU-X.js → account-service-status-C6hq8flJ.js} +1 -1
- package/assets/{accounts-D0rPQMGH.js → accounts-B2HAE5Mp.js} +1 -1
- package/assets/{advanced-q_hG98BB.js → advanced-BBWKSR4H.js} +1 -1
- package/assets/{agenda-time-D0yU-H44.js → agenda-time-C9jExuVe.js} +1 -1
- package/assets/{app-chrome-BfyGOiSA.js → app-chrome-CS-vT-4r.js} +1 -1
- package/assets/{appearance-DM1k2Ta7.js → appearance-oUeDfZvm.js} +1 -1
- package/assets/{avatar-Bq7beWCy.js → avatar-B60PZejm.js} +1 -1
- package/assets/{badge-BB80tGxy.js → badge-DYFkBshe.js} +1 -1
- package/assets/{bottom-sheet-DKF_Dkid.js → bottom-sheet-B0y_-mKC.js} +1 -1
- package/assets/brief--Wmhw18k.js +1 -0
- package/assets/{brief-8diVJSZ9.js → brief-DBLwMpYO.js} +1 -1
- package/assets/{calendar-BqFIadRy.js → calendar-Cf7D8za1.js} +1 -1
- package/assets/{calendar-Ds9kgvU8.js → calendar-DON3hXqq.js} +1 -1
- package/assets/{calendar-event-popup-Cr_LW8IP.js → calendar-event-popup-BqE6svk6.js} +1 -1
- package/assets/{calendar-event-sidebar-B_eR1h5J.js → calendar-event-sidebar-BGvCPmWa.js} +1 -1
- package/assets/{calendar-failure-note-C4gNXDQV.js → calendar-failure-note-sEjmPcbo.js} +1 -1
- package/assets/{calendar-guests-Cay9Ub8h.js → calendar-guests-CuFcAD3k.js} +1 -1
- package/assets/{calendar-suggestion-EosZrXZC.js → calendar-suggestion-CZ6ssHct.js} +1 -1
- package/assets/calendars-9OZeuRv6.js +1 -0
- package/assets/{card-CLJYKox8.js → card-13z0qC0r.js} +1 -1
- package/assets/{checkbox-CYOm-zGr.js → checkbox-ZdvWSWRN.js} +1 -1
- package/assets/{chevron-down-De4wQzka.js → chevron-down-wpFtElCn.js} +1 -1
- package/assets/{chevron-left-CUHU8UT9.js → chevron-left-HeNgNNR2.js} +1 -1
- package/assets/{circle-check-DlR8I4Hf.js → circle-check-Q9IHsvBp.js} +1 -1
- package/assets/{circle-check-big-CMsxQSjY.js → circle-check-big-C2cm1OoH.js} +1 -1
- package/assets/{circle-question-mark-DhNa_A16.js → circle-question-mark-CYsyue28.js} +1 -1
- package/assets/{classification-BgDJ1gwK.js → classification-BxsZLEnC.js} +1 -1
- package/assets/{clock-Dds4zv6u.js → clock-D8a14yMJ.js} +1 -1
- package/assets/{cloud-off-BYulqayx.js → cloud-off-I2wH-wZi.js} +1 -1
- package/assets/compose._-_outboxMessageId_-BGkih4eY.js +1 -0
- package/assets/compose._-_outboxMessageId_-CivLnC_Q.js +1 -0
- package/assets/compose._-_outboxMessageId_-DhaK6pb5.js +1 -0
- package/assets/compose._-_outboxMessageId_-cX-iEK_S.js +1 -0
- package/assets/compose._-_outboxMessageId_-nFk2BCjJ.js +1 -0
- package/assets/{config-import-VTZQj3gU.js → config-import-DTqOa38a.js} +1 -1
- package/assets/{confirm-dialog-XvccFJdE.js → confirm-dialog-CsttDS5u.js} +1 -1
- package/assets/{copy-BokIobZ4.js → copy-V6gKiItu.js} +1 -1
- package/assets/{credential-steps-O1OzlOow.js → credential-steps-BPun50HH.js} +1 -1
- package/assets/{download-DEuAIIIQ.js → download-CHIm9QMw.js} +1 -1
- package/assets/{draft-BEiHkDpm.js → draft-CUl68Y86.js} +1 -1
- package/assets/edit-CO4QGWtB.js +1 -0
- package/assets/edit-DRr0H801.js +1 -0
- package/assets/{external-link-L7NXOTeQ.js → external-link-DinDD_TS.js} +1 -1
- package/assets/{file-braces-BN8-S---.js → file-braces-DSnr6-a7.js} +1 -1
- package/assets/filters-BOpD_izN.js +1 -0
- package/assets/flagged-BLzcJrUz.js +1 -0
- package/assets/{flagged-B-j-3yRr.js → flagged-Cj4ARwpT.js} +1 -1
- package/assets/folder-failure-BphZCUyZ.js +1 -0
- package/assets/{folder-input-B0q8wLhf.js → folder-input-BqAxe_6s.js} +1 -1
- package/assets/folders-NwCVYN5L.js +1 -0
- package/assets/{help-copy-DUjzIPXf.js → help-copy-EtAi1Aq7.js} +1 -1
- package/assets/{import-DLM5VFnJ.js → import-DJMjk1Ri.js} +1 -1
- package/assets/index-6MdUWIJB.js +1 -0
- package/assets/index-B3pRGruo.js +1 -0
- package/assets/index-BDF8UTpu.js +1 -0
- package/assets/{index-Caon2n2j.js → index-BQ2vE6gp.js} +4 -4
- package/assets/index-BoKIe_Hw.js +1 -0
- package/assets/index-CKFdaY9c.js +222 -0
- package/assets/index-CO7AhNVu.js +1 -0
- package/assets/index-CR5Op_4t.js +1 -0
- package/assets/index-D0sfforj.js +1 -0
- package/assets/index-DLuz5acm.js +1 -0
- package/assets/index-DqCcXbbs.js +1 -0
- package/assets/index-GZXGsbCN.js +1 -0
- package/assets/index-PBPFqVVA.js +1 -0
- package/assets/index-h2rbe_XB.js +1 -0
- package/assets/{kbd-jzPSd-a2.js → kbd-qpWA48X9.js} +1 -1
- package/assets/{label-chip-DtBVyALF.js → label-chip-zwUAXSWu.js} +1 -1
- package/assets/labels-CwGUliq_.js +1 -0
- package/assets/list-pages-BCUbyyea.js +1 -0
- package/assets/mail-B-_K5JCo.js +1 -0
- package/assets/{mail-BzFJWQZy.js → mail-Bsgov7FY.js} +1 -1
- package/assets/{menu-Bh94jr77.js → menu-CKmdL0us.js} +1 -1
- package/assets/{nav-link-ed0mFCCx.js → nav-link-YOSchPy9.js} +1 -1
- package/assets/new-DKJdGwfE.js +1 -0
- package/assets/{onboarding-completion-qKzJSmsI.js → onboarding-completion-cX9HM-aL.js} +1 -1
- package/assets/onboarding-pnezHKXj.js +1 -0
- package/assets/outbox-CLnMeXYO.js +1 -0
- package/assets/{pencil-BDbmS56C.js → pencil-C6KO5975.js} +1 -1
- package/assets/{people-eWwwIt4_.js → people-BhhvdCU4.js} +1 -1
- package/assets/{plus-D5-2sA5v.js → plus-DsSkq30M.js} +1 -1
- package/assets/{popover-menu-DhcuKv1N.js → popover-menu-DP-hyKpu.js} +1 -1
- package/assets/{refresh-cw-Cu9_I3cT.js → refresh-cw-CCcTeH3S.js} +1 -1
- package/assets/{reply-CXuSMyqp.js → reply-SkF_KCOk.js} +1 -1
- package/assets/{rich-text-Ds4rQc2o.js → rich-text-By6rXXKy.js} +1 -1
- package/assets/{rich-text-spellcheck-worker-provider-ChKzrvjg.js → rich-text-spellcheck-worker-provider-DQbI8hMR.js} +1 -1
- package/assets/{rotate-ccw-hQhPZwrx.js → rotate-ccw-lh0BmpDo.js} +1 -1
- package/assets/{roving-focus-DZX7IpN4.js → roving-focus-DlzLpO4G.js} +1 -1
- package/assets/{row-actions-BDfQKXdD.js → row-actions-0g39M7ib.js} +1 -1
- package/assets/{search-mirror-B2xnwy77.js → search-mirror-D9nwr5km.js} +1 -1
- package/assets/{search-scope-B-3MTDpD.js → search-scope-DNDpRNp9.js} +1 -1
- package/assets/{search-token-index-BYKMNlJD.js → search-token-index-cy3uaYXm.js} +1 -1
- package/assets/{sections-DpRVKuXF.js → sections-ZsRsk30_.js} +1 -1
- package/assets/{segmented-control-BwvsufVp.js → segmented-control-CeqFpYfk.js} +1 -1
- package/assets/{select-TYdrgtW5.js → select-yGv73aji.js} +1 -1
- package/assets/{senders-vh4OQfD0.js → senders-lMWjFLIX.js} +1 -1
- package/assets/settings-C8z99CK0.js +1 -0
- package/assets/{settings-screen-DTYVWAkg.js → settings-screen-C8z8YwuM.js} +1 -1
- package/assets/{shield-check-C-tOrPEx.js → shield-check-CIZoP3AE.js} +1 -1
- package/assets/spam-D6paxCM2.js +1 -0
- package/assets/{suggest-list-BCqr1j26.js → suggest-list-czu9q5H4.js} +1 -1
- package/assets/{suggested-vips--pG2iuOT.js → suggested-vips-DXCCMmOn.js} +1 -1
- package/assets/suggestion._suggestionId-zlbObxkn.js +1 -0
- package/assets/{switch-CyAtRlCz.js → switch-BezKd3gx.js} +1 -1
- package/assets/task._calendarTaskId-CgBc-n43.js +1 -0
- package/assets/{undo-2-D1IMLq7c.js → undo-2-CgG5m84e.js} +1 -1
- package/assets/{useCalendarData-DFG3pzeG.js → useCalendarData-CgRGDHYQ.js} +1 -1
- package/assets/{useCalendarScheduling-B_INtO-h.js → useCalendarScheduling-BhFuxgru.js} +1 -1
- package/assets/useCalendarSuggestions-BaIFwYBZ.js +1 -0
- package/assets/{useCalendarTasks-b_UNFPQH.js → useCalendarTasks-CnP7DfUR.js} +1 -1
- package/assets/{useClassificationSettings-DBRecrmp.js → useClassificationSettings-Bk89yu99.js} +1 -1
- package/assets/{useCollectionThreads-DgofDKen.js → useCollectionThreads-BMsppZhN.js} +1 -1
- package/assets/{useDebouncedValue-CFZ4EPXW.js → useDebouncedValue-BpDHcfPe.js} +1 -1
- package/assets/{useFilters-DHWZEIQe.js → useFilters-Cv2IfE4J.js} +1 -1
- package/assets/{useInfiniteQuery-B-vOuANs.js → useInfiniteQuery-DwTTxcsy.js} +1 -1
- package/assets/{useJunkMailboxIds-CW7aI25D.js → useJunkMailboxIds-CDFS8XJA.js} +1 -1
- package/assets/useLabels-BIArT792.js +1 -0
- package/assets/{useLayoutTier-BNUKvwJD.js → useLayoutTier-Y7Z9Nnsm.js} +1 -1
- package/assets/{useMediaQuery-Hy81MQ2M.js → useMediaQuery-CjE8xNMz.js} +1 -1
- package/assets/{useMessageBodyContent-CpTD2HGg.js → useMessageBodyContent-D5mskS3v.js} +1 -1
- package/assets/{useQueries-DPH-PeHV.js → useQueries-CQ_R-NWg.js} +1 -1
- package/assets/{useRefreshControl-DdbTrGxq.js → useRefreshControl-DwtRYeei.js} +1 -1
- package/assets/{useResultFolderIndex-BVyfzXH5.js → useResultFolderIndex-ZNSoZByc.js} +1 -1
- package/assets/{useSignature-W9HBbZ_n.js → useSignature-CnLh1XFv.js} +1 -1
- package/assets/{warnings-B2sNE31D.js → warnings-zZSUr-_I.js} +1 -1
- package/index.html +2 -2
- package/package.json +1 -1
- package/assets/MailboxPane-BxNCkl6s.js +0 -135
- package/assets/MessageToolbar-DeDUhCvg.js +0 -1
- package/assets/_calendarObjectId-BiaBDCEt.js +0 -1
- package/assets/_labelId-DLeWLaow.js +0 -1
- package/assets/_mailboxId-DWvQ-9gi.js +0 -1
- package/assets/_messageId-BB9xOwfs.js +0 -1
- package/assets/_messageId-C2YSZxRF.js +0 -1
- package/assets/_messageId-CPvSvBZB.js +0 -1
- package/assets/_messageId-DbVH08AL.js +0 -1
- package/assets/_outboxMessageId-BFgW_k_u.js +0 -1
- package/assets/_recurrenceId-96pqeQMh.js +0 -1
- package/assets/_threadId-Bm7b75jN.js +0 -1
- package/assets/_threadId-CCwEReI2.js +0 -1
- package/assets/_threadId-Db39B53v.js +0 -1
- package/assets/_threadId-Dht02PUZ.js +0 -1
- package/assets/_view._date-BQeaBjoE.js +0 -1
- package/assets/brief-CFBkxoDK.js +0 -1
- package/assets/calendars-52NaEZbX.js +0 -1
- package/assets/compose._-_outboxMessageId_-BY1Sf-7o.js +0 -1
- package/assets/compose._-_outboxMessageId_-ByGI1c-o.js +0 -1
- package/assets/compose._-_outboxMessageId_-CvOAO1iL.js +0 -1
- package/assets/compose._-_outboxMessageId_-EZpX9L3H.js +0 -1
- package/assets/compose._-_outboxMessageId_-urlj3DLH.js +0 -1
- package/assets/edit-B9dhadKH.js +0 -1
- package/assets/edit-vn6fIBd6.js +0 -1
- package/assets/filters-VSaDpnX3.js +0 -1
- package/assets/flagged-BZJepVc-.js +0 -1
- package/assets/folder-failure-CqkVSsrb.js +0 -1
- package/assets/folders-CTNX9Hcm.js +0 -1
- package/assets/index-B--m5QrT.js +0 -1
- package/assets/index-BuawSiTp.js +0 -1
- package/assets/index-C2YSZxRF.js +0 -1
- package/assets/index-CO1X8-aP.js +0 -1
- package/assets/index-CPvSvBZB.js +0 -1
- package/assets/index-ChWo5_90.js +0 -1
- package/assets/index-DGb7Ls8y.js +0 -1
- package/assets/index-DLRo9M2D.js +0 -1
- package/assets/index-DemsYVll.js +0 -1
- package/assets/index-Dylwxpr-.js +0 -1
- package/assets/index-YwusJB4d.js +0 -1
- package/assets/index-Zfii_-4V.js +0 -1
- package/assets/index-fsuIswbe.js +0 -213
- package/assets/labels-CUXsONgB.js +0 -1
- package/assets/mail-BodKXw3C.js +0 -1
- package/assets/new-DlRrHbU8.js +0 -1
- package/assets/onboarding-8O2rW7qq.js +0 -1
- package/assets/outbox-nrXvnMTk.js +0 -1
- package/assets/settings-MlHARJWl.js +0 -1
- package/assets/spam-CecFwFHS.js +0 -1
- package/assets/suggestion._suggestionId-DiMWWP0r.js +0 -1
- package/assets/task._calendarTaskId-D-wpEifQ.js +0 -1
- package/assets/useCalendarSuggestions-DXbA0boT.js +0 -1
- package/assets/useLabels-k1VKuQrr.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as f,j as e,ar as h,B as b,T as y,u as N,af as C,a as L,c as I,d as S}from"./index-fsuIswbe.js";import{L as D}from"./label-chip-DtBVyALF.js";import{S as g}from"./select-TYdrgtW5.js";import{b as v,u as w,c as $,d as E,a as k}from"./useLabels-k1VKuQrr.js";import{a as R}from"./sections-DpRVKuXF.js";import{S as O}from"./settings-screen-DTYVWAkg.js";import{E as j}from"./ErrorState-BTHOmsYP.js";import{C as B}from"./confirm-dialog-XvccFJdE.js";import"./chevron-down-De4wQzka.js";import"./avatar-Bq7beWCy.js";import"./badge-BB80tGxy.js";import"./chevron-left-CUHU8UT9.js";import"./menu-Bh94jr77.js";import"./circle-question-mark-DhNa_A16.js";function P({labels:n,onRename:i,onRecolor:l,onDelete:u,deletingLabelId:c}){const[d,r]=f.useState(),[o,m]=f.useState("");if(n.length===0)return e.jsx("p",{className:"py-6 text-sm text-fg-muted",children:"No labels yet. Create one below, then use it in a filter or apply it to mail directly."});const a=t=>{const s=o.trim();s!==""&&i(t,s),r(void 0)};return e.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:n.map(t=>e.jsxs("li",{className:"flex items-center gap-3 px-3 py-2.5",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[d===t.labelId?e.jsx(h,{autoFocus:!0,value:o,onChange:s=>m(s.target.value),onBlur:()=>a(t.labelId),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),a(t.labelId)),s.key==="Escape"&&(s.preventDefault(),r(void 0))},"aria-label":`Rename label ${t.name}`}):e.jsx("button",{type:"button",onClick:()=>{r(t.labelId),m(t.name)},"aria-label":`Rename label ${t.name}`,className:"flex items-center gap-2 rounded-sm text-left hover:opacity-80",children:e.jsx(D,{label:t})}),e.jsx("p",{className:"mt-0.5 text-xs text-fg-subtle",children:t.filterCount===0?"Not used in any filter":`Used in ${t.filterCount} ${t.filterCount===1?"filter":"filters"}`})]}),e.jsx(g,{"aria-label":`Color for ${t.name}`,value:t.color,onChange:s=>l(t.labelId,s.target.value),className:"w-28 shrink-0",children:v.map(s=>e.jsx("option",{value:s,children:s},s))}),e.jsx(b,{variant:"ghost",size:"sm",icon:e.jsx(y,{className:"size-4 text-danger"}),onClick:()=>u(t),disabled:c===t.labelId,"aria-label":`Delete label ${t.name}`})]},t.labelId))})}const T=(n,i)=>{if(i===0)return{title:`Delete the "${n}" label?`};const l=i===1?"filter":"filters";return{title:`Delete the "${n}" label?`,description:`This also deletes ${i} ${l} that ${i===1?"applies":"apply"} it — they can't be recovered.`}},H=e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Labels mark mail without moving it — a message can carry any number of them alongside whichever folder it lives in."}),e.jsx("p",{children:"Use a label in a filter's action to have new (and existing) mail label itself automatically, or apply one to a selection directly from the mailbox."}),e.jsx("p",{children:"Deleting a label removes it from every message, and deletes every filter that applies it — the confirmation names how many."})]});function U({accountId:n}){const{createLabel:i,isPending:l,isError:u}=k(n),[c,d]=f.useState(""),[r,o]=f.useState("Default"),m=()=>{const a=c.trim();a!==""&&i(a,r).then(()=>{d(""),o("Default")})};return e.jsxs("div",{className:"space-y-2 rounded-sm border border-line bg-surface p-3",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"New label"}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-end",children:[e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Name"}),e.jsx(h,{value:c,onChange:a=>d(a.target.value),placeholder:"e.g. Receipts","aria-label":"Label name",onKeyDown:a=>{a.key==="Enter"&&(a.preventDefault(),m())}})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Color"}),e.jsx(g,{value:r,onChange:a=>o(a.target.value),"aria-label":"Label color",className:"w-28",children:v.map(a=>e.jsx("option",{value:a,children:a},a))})]}),e.jsx(b,{variant:"primary",onClick:m,disabled:l||c.trim()==="",children:l?"Creating…":"Create label"})]}),u&&e.jsx(S,{tone:"danger",variant:"soft",children:"Couldn't create that label. Please try again."})]})}function z({account:n}){const i=n.accountId,{labels:l,isPending:u,isError:c,error:d,refetch:r}=w(i),{updateLabel:o}=$(i),{deleteLabel:m,deletingLabelId:a}=E(i),[t,s]=f.useState();return e.jsxs("section",{className:"space-y-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:n.email}),u?e.jsx("div",{className:"h-16 animate-pulse rounded-md border border-line bg-surface","aria-busy":"true","aria-label":`Loading labels for ${n.email}`}):c?e.jsx(j,{variant:"inline",title:`Couldn't load labels for ${n.email}`,error:d,onRetry:()=>{r()}}):e.jsx(P,{labels:l,onRename:(p,x)=>o(p,{name:x}),onRecolor:(p,x)=>o(p,{color:x}),onDelete:s,deletingLabelId:a}),e.jsx(U,{accountId:i}),t&&(()=>{const p=T(t.name,t.filterCount);return e.jsx(B,{isOpen:!0,title:p.title,description:p.description,confirmLabel:"Delete label",destructive:!0,isBusy:a===t.labelId,onConfirm:()=>{m(t.labelId),s(void 0)},onCancel:()=>s(void 0)})})()]})}function ee(){const n=N(),i=C(),l=R(),[u,c]=f.useState(!0),{data:d,isPending:r,isError:o,error:m,refetch:a}=L(I());return e.jsx(O,{items:i,activeId:"labels",title:"Labels",description:"Mark mail without moving it, per account.",help:H,helpOpen:u,onToggleHelp:()=>c(t=>!t),onSelect:l,onBackToMail:()=>{n({to:"/mail"})},children:r?e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):o?e.jsx(j,{title:"Couldn't load accounts",error:m,onRetry:()=>{a()}}):d.accounts.length===0?e.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No accounts configured."}):e.jsx("div",{className:"space-y-8",children:d.accounts.map(t=>e.jsx(z,{account:t},t.accountId))})})}export{ee as component};
|
package/assets/mail-BodKXw3C.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as De,j as e,r as x,n as _e,o as Be,D as $e,X as Ke,p as E,S as Qe,C as qe,q as je,t as ae,v as He,w as Ve,x as V,y as ye,z as Ne,F as Ue,T as We,E as Ye,M as Ge,G as Xe,H as Je,I as Ze,B as q,J as Se,K as ne,N as es,P as Ce,e as se,Q as Ie,R as we,U as ss,V as ts,W as as,Y as Oe,a as Me,Z as ns,_ as os,$ as X,a0 as rs,a1 as is,a2 as ls,a3 as cs,a4 as us,a5 as ds,a6 as ms,a7 as xs,a8 as fs,u as ps,c as hs,a9 as gs,O as bs}from"./index-fsuIswbe.js";import{l as B,u as J,m as oe,a as vs,b as js,c as ys}from"./reply-CXuSMyqp.js";import{A as Ns,S as ke,a as Ss,c as Cs,L as Is,b as ws,D as Os,d as Ms}from"./DesktopChrome-GxTHTvqD.js";import{u as ks,N as P,a as Es,b as Rs,i as Ls}from"./nav-link-ed0mFCCx.js";import{u as te,a as Ps}from"./useMessageBodyContent-CpTD2HGg.js";import{P as Fs}from"./pencil-BDbmS56C.js";import{c as Ts,s as As,M as zs}from"./MailShell-tKLYT5hn.js";import{u as Ds,a as _s,R as Bs,s as $s,i as Ks,H as Qs,M as qs}from"./useRefreshControl-DdbTrGxq.js";import{K as Hs,B as Vs,S as Us,u as Ws,s as Ys,b as Gs,a as Xs,c as Js,d as Zs}from"./search-token-index-BYKMNlJD.js";import{u as et}from"./sections-DpRVKuXF.js";import{u as Ee}from"./search-scope-B-3MTDpD.js";import{M as st}from"./menu-Bh94jr77.js";import{B as Re,u as tt}from"./useResultFolderIndex-BVyfzXH5.js";import{u as Le}from"./useQueries-DPH-PeHV.js";import{u as at}from"./useCollectionThreads-DgofDKen.js";import{l as re,i as nt,u as ot}from"./useLabels-k1VKuQrr.js";import{f as rt}from"./folder-failure-CqkVSsrb.js";import{i as it}from"./outbox-status-BlKn6P0x.js";import{u as lt}from"./roving-focus-DZX7IpN4.js";import{C as ct,A as ut}from"./account-service-status-DsLvRU-X.js";import{C as U}from"./chevron-down-De4wQzka.js";import{u as dt}from"./index-Caon2n2j.js";import{u as Pe,i as mt}from"./useLayoutTier-BNUKvwJD.js";import{u as xt}from"./useDebouncedValue-CFZ4EPXW.js";import{E as ft}from"./ErrorState-BTHOmsYP.js";import{K as ie}from"./kbd-jzPSd-a2.js";import"./avatar-Bq7beWCy.js";import"./popover-menu-DhcuKv1N.js";import"./mail-BzFJWQZy.js";import"./app-chrome-BfyGOiSA.js";import"./useMediaQuery-Hy81MQ2M.js";import"./FullCompose-DiZNltCL.js";import"./confirm-dialog-XvccFJdE.js";import"./circle-check-big-CMsxQSjY.js";import"./refresh-cw-Cu9_I3cT.js";import"./useInfiniteQuery-B-vOuANs.js";import"./useSignature-W9HBbZ_n.js";import"./account-form-helpers-DhckT_PN.js";import"./suggest-list-BCqr1j26.js";const Fe={name:"square-pen",size:24,node:[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aliases:["pen-box","edit","pen-square"]};Fe.node;const pt=De(Fe);function ht({onCompose:s}){return e.jsx("button",{type:"button",onClick:s,"aria-label":"Compose new message",className:"lg:hidden fixed right-4 z-30 h-14 w-14 rounded-full bg-accent text-accent-fg shadow-lg flex items-center justify-center hover:opacity-90 active:scale-95 transition-all",style:{bottom:"calc(var(--app-tab-bar, 0px) + env(safe-area-inset-bottom, 0px) + 1rem)"},children:e.jsx(Fs,{className:"size-6"})})}const gt=({isOpen:s,onClose:t})=>{const a=x.useRef(null);return _e({id:"shortcuts",open:s,answers:{back:t}}),Be(a,s),s?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx($e,{label:"Dismiss keyboard shortcuts",onDismiss:t,className:"backdrop-blur-sm"}),e.jsxs("div",{ref:a,role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",tabIndex:-1,className:E("relative z-10 max-h-[85vh] w-full max-w-2xl overflow-y-auto","rounded-lg border border-line bg-surface shadow-lg","p-6"),children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Keyboard shortcuts"}),e.jsx("button",{type:"button",onClick:t,className:"p-1 text-fg-muted transition-colors hover:text-fg","aria-label":"Close",children:e.jsx(Ke,{className:"size-5"})})]}),e.jsx("div",{className:"grid gap-x-8 gap-y-6 sm:grid-cols-2",children:Hs.map(n=>e.jsxs("div",{children:[e.jsx("h3",{className:"mb-3 text-sm font-medium text-fg-muted",children:n.title}),e.jsx("div",{className:"space-y-2",children:n.hints.map(o=>e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{className:"text-sm",children:o.description}),e.jsx("span",{className:"flex shrink-0 items-center gap-1",children:o.keys.map((i,l)=>e.jsxs(x.Fragment,{children:[l>0&&o.keys[0]==="g"&&e.jsx("span",{className:"text-2xs text-fg-subtle",children:"then"}),e.jsx(ie,{children:i})]},i))})]},`${o.action}-${o.keys.join("+")}`))})]},n.title))}),e.jsx("div",{className:"mt-6 border-t border-line pt-4",children:e.jsxs("p",{className:"text-center text-xs text-fg-muted",children:["Press ",e.jsx(ie,{children:"Esc"})," to close"]})})]})]}):null},bt="button:not([disabled]), a[href]",$="outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface-sunken";function vt({active:s,dimmed:t,indent:a}){return E("flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors",$,a&&"pl-7",s?"bg-accent-2-soft font-medium text-accent-2":"text-fg-muted hover:bg-surface hover:text-fg",t&&"opacity-55")}function jt({icon:s,label:t,count:a,active:n,failure:o}){return e.jsxs(e.Fragment,{children:[s&&e.jsx("span",{className:E("shrink-0",n?"text-accent-2":"text-fg-subtle"),children:s}),e.jsx("span",{className:"flex-1 truncate",children:t}),o&&e.jsx(ye,{className:"size-3.5 shrink-0 text-danger","aria-hidden":"true"}),a!=null&&a>0&&e.jsx("span",{className:E("text-2xs tabular-nums",n?"text-accent-2":"text-fg-subtle"),children:a})]})}function A({icon:s,label:t,count:a,active:n,dimmed:o,indent:i,navId:l,linkComponent:u,ariaLabel:f,title:c,failure:b,onClick:m}){const g=vt({active:n,dimmed:o,indent:i}),d=e.jsx(jt,{icon:s,label:t,count:a,active:n,failure:b}),v=f??t,I=b?`${v} — ${b}`:v,j=b?`${c??t} — ${b}`:c;return l&&u?u({navId:l,className:g,ariaLabel:I,title:j,onClick:m,children:d}):e.jsx("button",{type:"button",onClick:m,className:g,"aria-label":b?I:f,title:j,children:d})}const le={inbox:0,flagged:1,drafts:2,sent:3,archive:4,all:5,junk:6,trash:7};function yt(s){switch(s){case"inbox":return e.jsx(Ze,{className:"size-4"});case"flagged":return e.jsx(je,{className:"size-4"});case"drafts":return e.jsx(Je,{className:"size-4"});case"sent":return e.jsx(Ne,{className:"size-4"});case"archive":return e.jsx(Xe,{className:"size-4"});case"all":return e.jsx(Ge,{className:"size-4"});case"junk":return e.jsx(Ye,{className:"size-4"});case"trash":return e.jsx(We,{className:"size-4"})}}function Nt(s){const t=nt(s)?re[s]:re.Default;return e.jsx("span",{className:"flex size-4 items-center justify-center",children:e.jsx("span",{className:E("size-2.5 rounded-full",t)})})}const ce=s=>s.role!=null,W=8,ue="remit.nav.folders.open.",de="remit.nav.account.open.",me="remit.nav.folder.open.";function Y(s,t,a){try{const n=localStorage.getItem(s+t);return n===null?a:n!=="0"}catch{return a}}function G(s,t,a){try{localStorage.setItem(s+t,a?"1":"0")}catch{}}function St({account:s,selectedNavId:t,onSelectNav:a,linkComponent:n}){const[o,i]=x.useState(()=>Y(de,s.id,!0)),[l,u]=x.useState(()=>Y(ue,s.id,!0)),[f,c]=x.useState(!1),[b,m]=x.useState({}),g=r=>b[r]??Y(me,r,!0),d=r=>{const N=!g(r);G(me,r,N),m(T=>({...T,[r]:N}))},v=()=>{i(r=>{const N=!r;return G(de,s.id,N),N})},I=()=>{u(r=>{const N=!r;return G(ue,s.id,N),N})},j=s.mailboxes.filter(ce).sort((r,N)=>le[r.role]-le[N.role]),y=s.mailboxes.filter(r=>!ce(r)),M=s.hierarchyDelimiter,F=new Map(y.map(r=>[r.id,r])),k=y.map(r=>({id:r.id,label:r.name,path:r.fullPath??r.name})),D=new Set(k.map(r=>r.path)),p=new Set(k.flatMap(r=>ae(r.path,M).filter(N=>D.has(N)))),S=k.find(r=>r.id===t),C=new Set(S?ae(S.path,M):[]),O=new Set(k.filter(r=>C.has(r.path)||g(r.id)).map(r=>r.path)),h=He(Ve(k,M),O,M).flatMap(r=>{const N=F.get(r.folder.id);return N?[{...r,mailbox:N}]:[]}),w=f||h.length<=W?h:h.slice(0,W),R=h.length-w.length,L=s.status??"ready",_=s.syncedServices!==void 0&&!s.syncedServices.includes("Mail"),z=L==="ready"&&j.length===0&&y.length===0;return e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{type:"button",onClick:v,"aria-expanded":o,className:E("flex w-full items-center gap-1.5 px-2 pb-1 text-left transition-colors hover:text-fg",$,s.muted&&"opacity-55"),children:[o?e.jsx(U,{className:"size-3 shrink-0 text-fg-subtle"}):e.jsx(V,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"truncate text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:s.label}),s.muted&&e.jsxs(e.Fragment,{children:[e.jsx(Vs,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:"muted"})]}),_&&e.jsxs(e.Fragment,{children:[e.jsx(ct,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:ut.Mail})]})]}),o&&e.jsxs(e.Fragment,{children:[L==="loading"&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"Loading…"}),L==="error"&&e.jsxs("div",{role:"alert",className:"mx-2 my-1 flex items-start gap-2 rounded-md border border-danger/40 bg-danger-soft px-2 py-1.5 text-sm",children:[e.jsx(ye,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":"true"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx("p",{className:"font-medium text-danger",children:"Couldn't load mailboxes"})}),s.onRetry&&e.jsx("button",{type:"button",onClick:s.onRetry,className:"shrink-0 text-sm font-medium text-accent hover:underline",children:"Retry"})]}),z&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"No mailboxes"}),L==="ready"&&e.jsxs(e.Fragment,{children:[j.map(r=>e.jsx(A,{navId:r.id,linkComponent:n,icon:yt(r.role),label:r.name,ariaLabel:r.name,title:r.fullPath??r.name,failure:r.failure,count:r.unseen,active:t===r.id,dimmed:s.muted,onClick:()=>a?.(r.id)},r.id)),s.outboxPending!==void 0&&e.jsx(A,{navId:"outbox",linkComponent:n,icon:e.jsx(Ne,{className:"size-4"}),label:"Outbox",ariaLabel:"Outbox",count:s.outboxPending>0?s.outboxPending:void 0,active:t==="outbox",dimmed:s.muted,onClick:()=>a?.("outbox")}),y.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:I,"aria-expanded":l,className:E("mt-1 flex w-full items-center gap-1 px-2 py-1 text-left text-2xs font-semibold uppercase tracking-wider text-fg-subtle transition-colors hover:text-fg",$),children:[l?e.jsx(U,{className:"size-3 shrink-0"}):e.jsx(V,{className:"size-3 shrink-0"}),e.jsx("span",{className:"flex-1",children:"Folders"}),e.jsx("span",{className:"tabular-nums opacity-70",children:y.length})]}),l&&e.jsxs(e.Fragment,{children:[w.map(({mailbox:r,folder:N,depth:T,expanded:H})=>e.jsxs("div",{className:"flex items-center",style:{paddingLeft:`${T*.75}rem`},children:[p.has(N.path)?e.jsx("button",{type:"button",onClick:()=>d(r.id),"aria-expanded":H,"aria-label":`${H?"Collapse":"Expand"} ${r.name}`,className:E("flex size-5 shrink-0 items-center justify-center rounded text-fg-subtle transition-colors hover:text-fg",$),children:H?e.jsx(U,{className:"size-3"}):e.jsx(V,{className:"size-3"})}):e.jsx("span",{className:"size-5 shrink-0"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(A,{navId:r.id,linkComponent:n,icon:e.jsx(Ue,{className:"size-4"}),label:r.name,ariaLabel:r.name,title:r.fullPath??r.name,failure:r.failure,count:r.unseen,active:t===r.id,dimmed:s.muted,onClick:()=>a?.(r.id)})})]},r.id)),(R>0||f)&&h.length>W&&e.jsx("button",{type:"button",onClick:()=>c(r=>!r),className:E("ml-7 flex items-center px-2 py-1 text-2xs font-medium text-accent transition-colors hover:underline",$),children:f?"Show less":`Show all (${h.length})`})]})]})]})]})]})}function Ct({accounts:s,selectedNavId:t,briefUnseen:a,onSelectNav:n,variant:o="desktop",linkComponent:i,labels:l=[],calendarNav:u="hidden"}){const f=x.useRef(null);lt({containerRef:f,itemSelector:bt});const c=o==="drawer",b=e.jsxs("nav",{ref:c?f:void 0,className:c?"px-2 py-2":"flex-1 overflow-y-auto px-2 py-2","aria-label":"Mailboxes",children:[e.jsx(A,{navId:"brief",linkComponent:i,icon:e.jsx(Qe,{className:"size-4"}),label:"Daily brief",ariaLabel:"Daily brief",count:a,active:t==="brief",onClick:()=>n?.("brief")}),l.map(m=>e.jsx(A,{navId:m.id,linkComponent:i,icon:Nt(m.color),label:m.name,ariaLabel:m.name,count:m.unseen,active:t===m.id,onClick:()=>n?.(m.id)},m.id)),u==="shown"&&e.jsx(A,{navId:"calendar",linkComponent:i,icon:e.jsx(qe,{className:"size-4"}),label:"Calendar",ariaLabel:"Calendar",active:t==="calendar",onClick:()=>n?.("calendar")}),e.jsx(A,{navId:"flagged",linkComponent:i,icon:e.jsx(je,{className:"size-4"}),label:"Starred",ariaLabel:"Starred",active:t==="flagged",onClick:()=>n?.("flagged")}),s.length===0?e.jsx("div",{className:"px-2 py-4 text-center text-sm text-fg-muted",children:"No accounts configured"}):s.map(m=>e.jsx(St,{account:m,selectedNavId:t,onSelectNav:n,linkComponent:i},m.id))]});return c?b:e.jsx("aside",{ref:f,className:"flex h-full w-full flex-col bg-surface-sunken",children:b})}function It(){const s=Ee();if(!s)return null;const t=s.showNavPane?!s.navCollapsed:!1;return e.jsx(q,{variant:"ghost",size:"sm",icon:e.jsx(st,{className:"size-4"}),onClick:s.toggleNav,"aria-label":t?"Hide folders":"Show folders","aria-expanded":t,title:"Folders",className:"shrink-0"})}const wt={global:"Search all mail",pending:"Search mail",scoped:"Search this folder"};function Ot({search:s,onCompose:t,onReportBug:a,onOpenSettings:n,settingsAttention:o,composeShortcut:i,refreshControl:l,account:u}){return e.jsx(Ns,{leading:e.jsx(It,{}),search:e.jsx(Us,{value:s.value,onChange:s.onChange,onClear:s.onClear,onClearQuery:s.onClearQuery,chips:s.chips,onRemoveChip:s.onRemoveChip,placeholder:wt[s.scope]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(q,{variant:"ghost",size:"sm",icon:e.jsx(pt,{className:"size-4"}),title:i?`Compose (${i})`:"Compose","aria-label":"Compose",onClick:t}),e.jsx(q,{variant:"ghost",size:"sm",icon:e.jsx(Re,{className:"size-4"}),title:"Report a bug","aria-label":"Report a bug",onClick:a}),e.jsx(q,{variant:"ghost",size:"sm",icon:e.jsx(Se,{label:o,children:e.jsx(ke,{className:"size-4"})}),title:"Settings","aria-label":o?`Settings — ${o}`:"Settings",onClick:n}),l,u]})})}const Z="label:";function Te(s){return`${Z}${s}`}function Mt(s){return s.startsWith(Z)?s.slice(Z.length):void 0}function kt(){const{pathname:s}=ks(),t=ne({from:"/mail/$mailboxId",shouldThrow:!1}),a=ne({from:"/mail/label/$labelId",shouldThrow:!1});return B(s,"/settings")?"settings":B(s,"/calendar")?"calendar":B(s,"/mail/outbox")?"outbox":B(s,"/mail/flagged")?"flagged":B(s,"/mail/brief")?"brief":a?.labelId?Te(a.labelId):t?.mailboxId??""}function Et(){const s=es(),t=J({select:c=>oe(c.location.pathname)}),a=J({select:c=>vs(c.location.search)}),[n,o]=x.useState(a),i=xt(n,200),[l,u]=x.useState(t);if(l!==t){const c=As(l,t,a);u(t),c!==void 0&&o(c)}const f=x.useCallback(c=>{u(oe(s.state.location.pathname)),o(c)},[s]);return{searchInput:n,committedQuery:Ts(n,i),viewKey:t,setSearchInput:f}}const Rt=()=>{const s=te();return js()?null:e.jsx(ht,{onCompose:s})};function xe({accounts:s}){const{searchInput:t,onSearchChange:a,onSearchClear:n,onSearchClearQuery:o,resultFolderIndex:i}=Ce(),l=se(),u=et(),f=te(),{scope:c,clearScope:b}=Ws(s),m=Ie(),g=c.kind==="scoped"?[{id:c.chip.id,label:c.chip.label,tone:"scope"}]:void 0,d=x.useMemo(()=>s.map(M=>M.accountId),[s]),{hasNewMail:v}=Ds(),{state:I,errorMessage:j,refresh:y}=_s(d,{onSettled:()=>ss(l,ts(i.keys()))});return e.jsx(Ot,{search:{value:t,scope:c.kind,chips:g,onChange:a,onClear:n,onClearQuery:o,onRemoveChip:b},onCompose:f,onReportBug:we,onOpenSettings:()=>u("accounts"),settingsAttention:m,composeShortcut:Ys("compose"),refreshControl:e.jsx(Bs,{state:I,onRefresh:y,label:"Refresh all accounts",errorMessage:j,hasUpdate:v(d)}),account:e.jsx(Ss,{})})}function Lt(){return e.jsxs("button",{type:"button",onClick:we,className:"flex w-full items-center gap-2 rounded-md px-2 py-1 text-sm text-fg-muted transition-colors hover:bg-surface hover:text-fg",children:[e.jsx(Re,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Report a bug"})]})}const Pt=({fullPath:s,hierarchyDelimiter:t})=>s.split(t).slice(0,-1).join(t);function Ft(s,t){const a=new Set(t.flatMap(o=>o.folders.flatMap(i=>i.state==="Missing"?[]:[i.mailboxId]))),n=new Set(s.filter(o=>a.has(o.mailboxId)).map(Pt));return s.filter(o=>!a.has(o.mailboxId)&&!n.has(o.fullPath))}const fe=s=>/^\d/.test(s),Tt=(s,t)=>{const a=fe(s),n=fe(t);return a&&!n?-1:!a&&n?1:s.localeCompare(t,void 0,{sensitivity:"base",numeric:!0})};function At(s,t,a){const n=[],o=[];for(const i of s)t.has(i.mailboxId)?n.push(i):o.push(i);return o.sort((i,l)=>Tt(X(i,void 0,a),X(l,void 0,a))),{system:n,labels:o}}function zt(s,t,a){const n=rs(t)&&s.unseenCount>0;return{id:s.mailboxId,name:X(s,t,a),unseen:n?s.unseenCount:void 0,role:t,fullPath:s.fullPath,failure:rt(s)}}function Dt(s,t){return s.map(a=>{const n=t.get(a.labelId)??0;return{id:Te(a.labelId),name:a.name,color:a.color,unseen:n>0?n:void 0}})}function pe({accounts:s,onMailboxSelect:t,variant:a="desktop"}){const n=se(),o=kt(),{onSearchChange:i}=Ce(),{t:l}=as("mail",{useSuspense:!1}),u=x.useCallback((p,S)=>l(p,{defaultValue:S}),[l]),f=Le({queries:s.map(p=>({...Oe({path:{accountId:p.accountId}}),staleTime:1/0}))}),{labels:c,isPending:b,isError:m}=ot(s[0]?.accountId),g=!b||m,d=x.useMemo(()=>c.map(p=>p.labelId),[c]),v=at(d),I=x.useMemo(()=>Dt(c,v),[c,v]),{data:j}=Me(ns()),y=x.useMemo(()=>(j?.items??[]).filter(p=>it(p.status)).length,[j?.items]),M=x.useMemo(()=>s.map((p,S)=>{const C=f[S],O=C?.data?.items??[],h=Ft(O,c),w=os(p.folderAppointments),{system:R,labels:L}=At(h,w,u),_=C?.isError?"error":C?.isLoading||!g?"loading":"ready";return{id:p.accountId,label:p.email,email:p.email,hierarchyDelimiter:O[0]?.hierarchyDelimiter??"",muted:!!p.muted,outboxPending:y,status:_,onRetry:()=>C?.refetch(),mailboxes:[...R,...L].map(z=>zt(z,w.get(z.mailboxId),u))}}),[s,f,y,u,c,g]),F=p=>{n.invalidateQueries({queryKey:is({path:{mailboxId:p},query:{order:"desc"}})})},k=({navId:p,className:S,ariaLabel:C,title:O,children:h,onClick:w})=>{if(p==="brief")return e.jsx(P,{to:"/mail/brief",search:{q:void 0},activeOptions:{includeSearch:!1},onClick:()=>w?.(),className:S,"aria-label":C,title:O,children:h});if(p==="calendar")return e.jsx(P,{to:"/calendar",onClick:()=>w?.(),className:S,"aria-label":C,title:O,children:h});if(p==="outbox")return e.jsx(P,{to:"/mail/outbox",search:{q:void 0},onClick:()=>w?.(),className:S,"aria-label":C,title:O,children:h});if(p==="flagged")return e.jsx(P,{to:"/mail/flagged",search:{q:void 0},onClick:()=>w?.(),className:S,"aria-label":C,title:O,children:h});const R=Mt(p);return R?e.jsx(P,{to:"/mail/label/$labelId",params:{labelId:R},search:{q:void 0},onClick:()=>w?.(),className:S,"aria-label":C,title:O,children:h}):p==="settings"?e.jsx(P,{to:"/settings/accounts",onClick:()=>w?.(),className:S,"aria-label":C,title:O,children:h}):e.jsx(P,{to:"/mail/$mailboxId",params:{mailboxId:p},search:{q:void 0},onClick:()=>{F(p),w?.()},className:S,"aria-label":C,title:O,children:h})},D=()=>{i(""),t?.()};return e.jsx(Ct,{accounts:M,labels:I,selectedNavId:o,onSelectNav:D,linkComponent:k,variant:a})}function _t({accounts:s,onMailboxSelect:t}){const n=Ee()?.showNavPane??!0,o=Ie();return n?e.jsx(pe,{accounts:s}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx(pe,{accounts:s,onMailboxSelect:t,variant:"drawer"})}),e.jsxs("div",{className:"border-t border-line px-2 py-2",children:[e.jsxs(P,{to:"/settings/accounts",onClick:t,children:[e.jsx(Se,{label:o,children:e.jsx(ke,{className:"size-4 shrink-0"})}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Settings"})]}),e.jsx(Lt,{}),e.jsx(Cs,{children:({signOut:i})=>e.jsxs("button",{type:"button",onClick:()=>{t?.(),i()},className:"flex min-h-11 w-full items-center gap-2 rounded-md px-2 py-1 text-sm text-fg-muted transition-colors hover:bg-surface hover:text-fg","data-testid":"sign-out-button",children:[e.jsx(Is,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Sign out"})]})})]})]})}function Bt(s){const t=Le({queries:s.map(a=>({...Oe({path:{accountId:a.accountId}}),staleTime:1/0}))});return x.useMemo(()=>Gs(t.map(a=>a.data?.items??[])),[t])}const Ae="remit:intelligence-open";function $t(){try{return localStorage.getItem(Ae)!=="closed"}catch{return!0}}function Kt(s){try{localStorage.setItem(Ae,s?"open":"closed")}catch{}}function he({panels:s,prefersOpen:t,isDesktop:a,hasThread:n,raisedFor:o,openMessage:i}){if(o!==null&&o===i)return!0;const l=s.filter(u=>u!=="sidebar");return l.length>0?l.includes("intelligence"):a&&n&&t}const Qt=()=>{const s=Pe(),t=Es(),a=Rs(),n=t.find(Ls),o=Xs(),[i,l]=x.useState($t),u=o?`${o.threadId}/${o.messageId??""}`:null,[f,c]=x.useState(null),b={panels:t,prefersOpen:i,isDesktop:s==="desktop",hasThread:o!==void 0,openMessage:u},m=he({...b,raisedFor:f}),g=he({...b,raisedFor:null}),d=x.useCallback((y,M)=>{a([...y?["intelligence"]:[],...M?[M]:[]])},[a]),v=x.useCallback(y=>{d(g,y)},[g,d]),I=x.useCallback(()=>{if(m&&!g){c(null);return}const y=!m;Kt(y),l(y),c(null),d(y,n)},[g,m,n,d]),j=x.useCallback(()=>{c(u)},[u]);return{openOverlay:n,intelligenceOpen:m,showOverlay:v,toggleIntelligence:I,raiseIntelligence:j}};var K={exports:{}},ge;function qt(){if(ge)return K.exports;ge=1;const s=(t,a,n)=>new Promise((o,i)=>{if(n=Object.assign({concurrency:1/0},n),typeof a!="function")throw new TypeError("Mapper function is required");const{concurrency:l}=n;if(!(typeof l=="number"&&l>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${l}\` (${typeof l})`);const u=[],f=t[Symbol.iterator]();let c=!1,b=!1,m=0,g=0;const d=()=>{if(c)return;const v=f.next(),I=g;if(g++,v.done){b=!0,m===0&&o(u);return}m++,Promise.resolve(v.value).then(j=>a(j,I)).then(j=>{u[I]=j,m--,d()},j=>{c=!0,i(j)})};for(let v=0;v<l&&(d(),!b);v++);});return K.exports=s,K.exports.default=s,K.exports}var Ht=qt();const Vt=ls(Ht),Ut=900*1e3,Wt=30,Yt=(s,t)=>{if(!s)return t;const a=Number.parseInt(s,10);return Number.isFinite(a)&&a>0?a:t},Gt=30*1e3,Xt=s=>Math.max(Yt(s,Wt)*1e3,Gt),ze=Xt(fs().mailboxPollIntervalSeconds),Q=(s=Date.now(),t=ze)=>Ks(s)?Math.min(Qs,t):t,Jt=5,ee=new Set,Zt=(s,t,a=Ut)=>s.filter(n=>{const o=n.lastSyncAt;return o==null?!0:t-o>a}).map(n=>n.accountId),ea=(s,t,a=ze)=>s-t>=a,sa=(s,t)=>s.filter(a=>!t.has(a)),be=(s,t)=>{if(ee.delete(s),ds(t)||ms(t,{softError:!0})){xs(t,{softError:!0});return}console.warn("[remit] background mailbox sync failed",{accountId:s,error:t})},ve=(s,t)=>cs({path:{accountId:s},throwOnError:!0}).then(()=>{t.invalidateQueries({queryKey:us({path:{accountId:s}})})}),ta=s=>{const t=se(),a=x.useRef(s);a.current=s;const n=s.map(o=>o.accountId).join(",");x.useEffect(()=>{const o=Date.now(),l=Zt(a.current,o).filter(u=>!ee.has(u));if(l.length!==0)for(const u of l)ee.add(u),ve(u,t).catch(f=>{be(u,f)})},[n,t]),x.useEffect(()=>{let o=Date.now(),i;const l=new Set,u=()=>{o=Date.now();const g=sa(a.current.map(d=>d.accountId),l);for(const d of g)l.add(d);Vt(g,d=>ve(d,t).catch(v=>{be(d,v)}).finally(()=>{l.delete(d)}),{concurrency:Jt})},f=()=>{if(document.visibilityState==="visible"){u(),i=setTimeout(f,Q());return}},c=()=>{if(document.visibilityState!=="visible")return;i!==void 0&&clearTimeout(i);const g=Date.now(),d=Q(g);if(ea(g,o,d)){u(),i=setTimeout(f,d);return}i=setTimeout(f,o+d-g)},b=()=>{document.visibilityState==="visible"&&(i!==void 0&&clearTimeout(i),o=Date.now(),i=setTimeout(f,Q()))};i=setTimeout(f,Q()),document.addEventListener("visibilitychange",c);const m=$s(b);return()=>{i!==void 0&&clearTimeout(i),document.removeEventListener("visibilitychange",c),m()}},[n,t])};function Ka(){const s=ps(),t=Pe(),a=mt(t),{openOverlay:n,intelligenceOpen:o,showOverlay:i,toggleIntelligence:l,raiseIntelligence:u}=Qt(),f=n==="shortcuts",c=n==="nav",{searchInput:b,committedQuery:m,viewKey:g,setSearchInput:d}=Et(),{data:v,isLoading:I,isError:j,error:y,refetch:M}=Me({...hs(),staleTime:1/0}),F=!!(v&&(v.accounts?.length??0)===0);x.useEffect(()=>{F&&s({to:"/onboarding",replace:!0})},[F,s]),dt({enabled:!f,bindings:[{key:"?",action:"help",handler:()=>i("shortcuts"),noModifiers:!1,preventDefault:!0}]});const k=te(),D=Ps(),p=J({select:T=>ys(T.matches)?.list==="mailbox"}),S=x.useMemo(()=>({compose:k}),[k]);Js({enabled:!p&&!D,handlers:S});const C=x.useCallback(()=>{d("")},[d]),O=x.useCallback(()=>{d("")},[d]),h=v?.accounts??[],w=x.useMemo(()=>h.map(T=>T.accountId),[h]),R=Bt(h),L=tt(h).index,_=x.useMemo(()=>Zs(h),[h]);ta(h);const z=x.useCallback(()=>{n==="nav"&&i(void 0)},[n,i]),r={accounts:h,mailboxNameIndex:R,accountNameIndex:_,resultFolderIndex:L,searchQuery:m,searchInput:b,searchViewKey:g,onSearchChange:d,onSearchClear:C,onSearchClearQuery:O,intelligenceOpen:o,onToggleIntelligence:l,onRaiseIntelligence:u},N={isSinglePane:a,isLoading:I||F,intelligenceOpen:o,nav:e.jsx(_t,{accounts:h,onMailboxSelect:z}),topBar:a?void 0:e.jsx(xe,{accounts:h}),appBar:t==="phone"?void 0:e.jsx(Ms,{}),overlay:a?e.jsx(Rt,{}):void 0,navOpen:c,onOpenNav:()=>i("nav"),onCloseNav:()=>i(void 0)};return e.jsx(gs.Provider,{value:r,children:e.jsxs(qs,{accountIds:w,children:[e.jsx(ws,{children:j?e.jsx(Os,{topBar:e.jsx(xe,{accounts:h}),children:e.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:e.jsx(ft,{title:"Couldn't load your account",error:y,onRetry:()=>{M()}})})}):e.jsx(zs,{chrome:N,children:e.jsx(bs,{})})}),e.jsx(gt,{isOpen:f,onClose:()=>i(void 0)})]})})}export{Ka as component,Ce as useMailContext};
|
package/assets/new-DlRrHbU8.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as o}from"./CalendarEventEditor-B3bVY-Oc.js";import"./index-fsuIswbe.js";import"./draft-BEiHkDpm.js";import"./agenda-time-D0yU-H44.js";import"./calendar-guests-Cay9Ub8h.js";import"./calendar-event-popup-Cr_LW8IP.js";import"./useCalendarSuggestions-DXbA0boT.js";import"./ErrorState-BTHOmsYP.js";import"./useQueries-DPH-PeHV.js";import"./pencil-BDbmS56C.js";import"./circle-question-mark-DhNa_A16.js";import"./useCalendarData-DFG3pzeG.js";import"./useCalendarTasks-b_UNFPQH.js";import"./useCalendarScheduling-B_INtO-h.js";import"./useDebouncedValue-CFZ4EPXW.js";import"./calendar-format-BwCpz-JZ.js";import"./nav-link-ed0mFCCx.js";import"./useMediaQuery-Hy81MQ2M.js";import"./calendar-Ds9kgvU8.js";import"./reply-CXuSMyqp.js";import"./CalendarQuickCreate-B_n983kv.js";import"./CalendarSession-BosFoHg2.js";import"./calendar-event-sidebar-B_eR1h5J.js";import"./select-TYdrgtW5.js";import"./chevron-down-De4wQzka.js";import"./confirm-dialog-XvccFJdE.js";const u=o;export{u as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as i,e as n,u as a,r as m,j as p}from"./index-fsuIswbe.js";import{O as s}from"./OnboardingWizard-BSlPpmI5.js";import{c}from"./onboarding-completion-qKzJSmsI.js";import"./credential-steps-O1OzlOow.js";import"./select-TYdrgtW5.js";import"./chevron-down-De4wQzka.js";import"./badge-BB80tGxy.js";import"./card-CLJYKox8.js";import"./account-form-helpers-DhckT_PN.js";import"./mail-BzFJWQZy.js";import"./file-braces-BN8-S---.js";import"./kbd-jzPSd-a2.js";import"./checkbox-CYOm-zGr.js";function k(){const o=i(),t=n(),e=a(),r=m.useCallback(l=>{c({queryClient:t,recordCompleted:()=>o.recordEvent("onboarding.completed"),navigateToInbox:()=>{window.location.assign("/mail")}})},[o,t]);return p.jsx(s,{skipWelcome:!1,onComplete:r,onImportConfig:()=>{e({to:"/import"})}})}export{k as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o,O as i}from"./index-fsuIswbe.js";import{a as m}from"./MailShell-tKLYT5hn.js";import{u as p,O as t}from"./OutboxPane-B6UfixBP.js";import"./nav-link-ed0mFCCx.js";import"./reply-CXuSMyqp.js";import{u as s}from"./search-mirror-B2xnwy77.js";import"./useMessageBodyContent-CpTD2HGg.js";import"./FullCompose-DiZNltCL.js";import"./index-Caon2n2j.js";import"./useSignature-W9HBbZ_n.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-CFZ4EPXW.js";import"./suggest-list-BCqr1j26.js";import"./sections-DpRVKuXF.js";import"./useMediaQuery-Hy81MQ2M.js";import"./chevron-down-De4wQzka.js";import"./ErrorState-BTHOmsYP.js";import"./confirm-dialog-XvccFJdE.js";import"./search-scope-B-3MTDpD.js";import"./app-chrome-BfyGOiSA.js";import"./MessageBody-jG4Dhul6.js";import"./kbd-jzPSd-a2.js";import"./outbox-status-BlKn6P0x.js";import"./NavMenuButton-CLp6InRG.js";import"./menu-Bh94jr77.js";import"./roving-focus-DZX7IpN4.js";import"./circle-check-big-CMsxQSjY.js";import"./clock-Dds4zv6u.js";import"./row-actions-BDfQKXdD.js";import"./rotate-ccw-hQhPZwrx.js";function C(){const r=p();return s({to:"/mail/outbox"}),o.jsx(t,{outboxMessageId:r,children:o.jsx(m,{phone:o.jsx(t.Phone,{}),list:o.jsx(t.List,{}),reading:o.jsx(i,{})})})}export{C as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,O as o}from"./index-fsuIswbe.js";const n=()=>t.jsx(o,{});export{n as component};
|
package/assets/spam-CecFwFHS.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,p as g,r as f,a as j,b_ as E,c as M,b$ as y,c0 as P,c1 as D,c2 as C,c3 as R,c4 as A,a5 as F,c5 as T,c6 as w,s as W,c7 as _,u as z,af as B}from"./index-fsuIswbe.js";import{F as $,u as q}from"./useClassificationSettings-DBRecrmp.js";import{u as U}from"./useJunkMailboxIds-CW7aI25D.js";import{u as V}from"./useLabels-k1VKuQrr.js";import{N as u}from"./nav-link-ed0mFCCx.js";import"./reply-CXuSMyqp.js";import{L as Y}from"./label-chip-DtBVyALF.js";import{f as v}from"./ErrorState-BTHOmsYP.js";import{S as G}from"./segmented-control-BwvsufVp.js";import{a as H}from"./sections-DpRVKuXF.js";import{S as J}from"./settings-screen-DTYVWAkg.js";import"./useMediaQuery-Hy81MQ2M.js";import"./avatar-Bq7beWCy.js";import"./badge-BB80tGxy.js";import"./chevron-left-CUHU8UT9.js";import"./menu-Bh94jr77.js";import"./circle-question-mark-DhNa_A16.js";const K={warning:{moved:"bg-warning",warned:"bg-warning/35"},danger:{moved:"bg-danger",warned:"bg-danger/35"}},Q=s=>`${s.date}: ${s.moved} moved, ${s.warned} warned`;function I({title:s,tone:t,days:a}){const n=Math.max(1,...a.map(l=>l.moved+l.warned)),c=K[t],m=a[0],r=a[a.length-1];return e.jsxs("figure",{className:"min-w-0",children:[e.jsx("figcaption",{className:"text-xs font-semibold text-fg",children:s}),e.jsx("ul",{className:"mt-2 flex h-24 list-none items-end gap-px border-b border-line",children:a.map(l=>e.jsx("li",{className:"h-full min-w-0 flex-1",children:e.jsxs("span",{role:"img","aria-label":Q(l),className:"flex h-full flex-col justify-end",children:[e.jsx("span",{className:g("w-full rounded-t-sm",c.warned),style:{height:`${l.warned/n*100}%`}}),e.jsx("span",{className:g("w-full",c.moved),style:{height:`${l.moved/n*100}%`}})]})},l.date))}),m&&r&&e.jsxs("div",{"aria-hidden":"true",className:"mt-1 flex justify-between text-2xs text-fg-subtle tabular-nums",children:[e.jsx("span",{children:m.date}),e.jsx("span",{children:r.date})]})]})}const k=30,b=s=>String(s).padStart(2,"0"),O=s=>`${s.getFullYear()}-${b(s.getMonth()+1)}-${b(s.getDate())}`,X=s=>{const t=-s.getTimezoneOffset(),a=t>=0?"+":"-",n=Math.abs(t);return`${a}${b(Math.floor(n/60))}:${b(n%60)}`},Z=(s,t=k)=>{const a=new Date(s.getFullYear(),s.getMonth(),s.getDate()-(t-1));return`${O(a)}T00:00:00${X(a)}`},ee=(s,t=k)=>Array.from({length:t},(a,n)=>O(new Date(s.getFullYear(),s.getMonth(),s.getDate()-(t-1-n)))),se=(s,t)=>{const a=r=>t.map(l=>{const x=i=>s.spamByDay.filter(o=>o.date===l&&o.kind===r&&o.action===i).reduce((o,p)=>o+p.count,0);return{date:l,moved:x("Junk"),warned:x("Warn")}}),n=a("Spam"),c=a("Phishing"),m=r=>[...n,...c].reduce((l,x)=>l+r(x),0);return{checkedAny:s.spamScoreBands.some(r=>r.count>0),moved:m(r=>r.moved),warned:m(r=>r.warned),spam:n,phishing:c}},te="text-xs font-semibold uppercase tracking-wider text-fg-subtle",N=W(400,403,404),L=10;function d({title:s,children:t,aside:a}){const n=f.useId();return e.jsxs("section",{"aria-labelledby":n,className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[e.jsx("h2",{id:n,className:te,children:s}),a]}),t]})}function h({className:s}){return e.jsx("div",{"aria-hidden":"true",className:g("animate-pulse rounded-md bg-surface-sunken",s)})}function S({title:s,error:t,onRetry:a,skeleton:n}){if(F(t))return n;const c=v(t);return e.jsx($,{title:s,message:c,reportHref:T(s,c),onRetry:a})}function ae(){const[s]=f.useState(()=>new Date),t=j({...E({query:{since:Z(s)}}),meta:N}),a=e.jsxs(e.Fragment,{children:[e.jsx(h,{className:"h-4 w-64"}),e.jsxs("div",{className:"grid gap-6 sm:grid-cols-2",children:[e.jsx(h,{className:"h-32"}),e.jsx(h,{className:"h-32"})]})]});if(t.isPending)return e.jsx(d,{title:"Last 30 days",children:a});if(t.isError)return e.jsx(d,{title:"Last 30 days",children:e.jsx(S,{title:"Couldn't count the last 30 days",error:t.error,onRetry:()=>{t.refetch()},skeleton:a})});const n=se(t.data,ee(s));return n.checkedAny?e.jsxs(d,{title:"Last 30 days",children:[e.jsx("p",{className:"text-sm text-fg tabular-nums",children:`Reached Spam ${n.moved} · Warned ${n.warned}`}),e.jsxs("div",{className:"grid gap-6 sm:grid-cols-2",children:[e.jsx(I,{title:"Spam",tone:"warning",days:n.spam}),e.jsx(I,{title:"Phishing",tone:"danger",days:n.phishing})]}),e.jsxs("ul",{className:"flex list-none flex-wrap gap-x-4 gap-y-1 text-2xs text-fg-muted",children:[e.jsxs("li",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"size-2 rounded-sm bg-fg-muted","aria-hidden":"true"}),"Reached the Move to Spam threshold"]}),e.jsxs("li",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"size-2 rounded-sm bg-fg-muted/35","aria-hidden":"true"}),"Warned"]})]})]}):e.jsx(d,{title:"Last 30 days",children:e.jsxs("div",{className:"rounded-md border border-line px-4 py-6 text-center",children:[e.jsx("p",{className:"font-medium text-fg",children:"Remit has not checked any mail yet"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"Counts appear here once new mail arrives."})]})})}const ne=async s=>{const{data:t}=await _({query:{labelId:s,order:"desc",limit:L},throwOnError:!0});return t.items??[]};function re(){const s=U(),t=j({...M(),staleTime:1/0}),a=V(t.data?.accounts[0]?.accountId),n=a.labels.find(i=>i.name==="Spam"),c=a.labels.find(i=>i.name==="Phishing"),m=[n,c].flatMap(i=>i?[i.labelId]:[]),r=j({queryKey:["spam-settings","latest-flagged",...m],queryFn:async()=>(await Promise.all(m.map(ne))).flat().filter(i=>!i.spamCleared&&y(i.labels)!==void 0).sort((i,o)=>o.sentDate-i.sentDate).slice(0,L),enabled:a.isSuccess,meta:N}),l=e.jsx("div",{className:"space-y-2",children:["a","b","c","d"].map(i=>e.jsx(h,{className:"h-10"},i))}),x=t.isError?{error:t.error,retry:()=>{t.refetch()}}:a.isError?{error:a.error,retry:()=>{a.refetch()}}:r.isError?{error:r.error,retry:()=>{r.refetch()}}:void 0;return x?e.jsx(d,{title:"Latest flagged",children:e.jsx(S,{title:"Couldn't load the latest flagged mail",error:x.error,onRetry:x.retry,skeleton:l})}):r.isSuccess?r.data.length===0?e.jsx(d,{title:"Latest flagged",children:e.jsx("p",{className:"text-sm text-fg-muted",children:"Nothing flagged yet."})}):e.jsx(d,{title:"Latest flagged",aside:e.jsxs("span",{className:"flex gap-4 text-sm",children:[n&&e.jsx(u,{to:"/mail/label/$labelId",params:{labelId:n.labelId},variant:"inline",children:"Review all in Spam"}),c&&e.jsx(u,{to:"/mail/label/$labelId",params:{labelId:c.labelId},variant:"inline",children:"Open Phishing"})]}),children:e.jsx("div",{className:"overflow-x-auto rounded-md border border-line",children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"border-b border-line text-2xs uppercase tracking-wide text-fg-subtle",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-3 py-2 font-medium",children:"Sender"}),e.jsx("th",{className:"px-3 py-2 font-medium",children:"Subject and top reason"}),e.jsx("th",{className:"px-3 py-2 font-medium",children:"Date"}),e.jsx("th",{className:"px-3 py-2 font-medium",children:"Label"}),e.jsx("th",{className:"px-3 py-2 font-medium",children:"Action"})]})}),e.jsx("tbody",{className:"divide-y divide-line",children:r.data.map(i=>{const o=y(i.labels);if(!o)return null;const p=P(i.spamVerdict);return e.jsxs("tr",{className:"hover:bg-surface-sunken",children:[e.jsx("td",{className:"px-3 py-2 align-top text-fg",children:i.fromName??i.fromEmail??"Unknown"}),e.jsxs("td",{className:"px-3 py-2 align-top",children:[e.jsx(u,{to:"/mail/label/$labelId/$threadId/$messageId",params:{labelId:o.labelId,threadId:i.threadId,messageId:i.messageId},variant:"inline",className:"text-fg",children:i.subject??"(No subject)"}),p&&e.jsx("p",{className:"text-xs text-fg-muted",children:D(p.reasons)})]}),e.jsx("td",{className:"whitespace-nowrap px-3 py-2 align-top text-fg-muted tabular-nums",children:C(i.sentDate)}),e.jsx("td",{className:"px-3 py-2 align-top",children:e.jsx(Y,{label:o})}),e.jsx("td",{className:"px-3 py-2 align-top text-fg-muted",children:s.has(i.mailboxId)?"Moved":"Warned"})]},i.messageId)})})]})})}):e.jsx(d,{title:"Latest flagged",children:l})}function ie({spam:s}){const{thresholds:t}=s;return e.jsxs(d,{title:"Thresholds",children:[t.state==="Set"?e.jsxs("dl",{className:"flex flex-wrap gap-x-8 gap-y-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("dt",{className:"text-fg-muted",children:"Warn from"}),e.jsx("dd",{className:"font-medium text-fg tabular-nums",children:w(t.cleanBelow)})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-fg-muted",children:"Move to Spam from"}),e.jsx("dd",{className:"font-medium text-fg tabular-nums",children:w(t.spamAt)})]})]}):e.jsx("p",{className:"text-sm text-fg",children:"The spam service applies its own thresholds."}),e.jsx("p",{className:"text-xs text-fg-muted",children:"Scores run from 0 to 1. The deployment sets these values, and they apply to mail arriving from now on. Check again in any list updates older mail."})]})}const le=[{value:"WarnOnly",label:"Warn only"},{value:"MoveToSpam",label:"Move to Spam"}];function ce({spam:s}){const t=q(),[a,n]=f.useState(""),c=f.useId(),m=[{field:"spamPlacementSpam",label:"Spam",value:s.spamPlacement},{field:"spamPlacementPhishing",label:"Phishing",value:s.phishingPlacement}];return e.jsxs(d,{title:"Per label",children:[e.jsx("div",{className:"space-y-2",children:m.map(r=>e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"w-20 text-sm text-fg",children:r.label}),e.jsx(G,{name:`${c}-${r.field}`,"aria-label":`${r.label} label`,size:"sm",options:le,value:r.value,onChange:l=>{n(""),t.mutate({body:{[r.field]:l}},{onSuccess:()=>n("Saved")})}})]},r.field))}),e.jsx("p",{className:"text-xs text-fg-muted",children:"Warn only keeps the message where it arrived, under the warning banner."}),t.isError&&e.jsx($,{title:"The label setting was not saved",message:v(t.error),reportHref:T("The label setting was not saved",v(t.error)),onRetry:()=>t.variables&&t.mutate(t.variables)}),e.jsx("p",{"aria-live":"polite",className:"text-xs text-positive",children:a})]})}function de(){const s=j({...R(),meta:N}),t=e.jsxs(e.Fragment,{children:[e.jsx(d,{title:"Thresholds",children:e.jsx(h,{className:"h-11 w-64"})}),e.jsxs(d,{title:"Per label",children:[e.jsx(h,{className:"h-9 w-48"}),e.jsx(h,{className:"h-9 w-48"})]})]});return s.isPending?t:s.isError?e.jsx(d,{title:"Thresholds",children:e.jsx(S,{title:"Couldn't load the spam settings",error:s.error,onRetry:()=>{s.refetch()},skeleton:t})}):e.jsxs(e.Fragment,{children:[e.jsx(ie,{spam:s.data.spam}),e.jsx(ce,{spam:s.data.spam})]})}function oe(){const s=[{title:"Never in Spam",hint:"Their mail skips the spam check.",group:"neverSpam"},{title:"Reported",hint:"Their mail goes straight to Spam.",group:"blocked"}];return e.jsx(d,{title:"Senders",children:e.jsx("ul",{className:"list-none divide-y divide-line rounded-md border border-line",children:s.map(t=>e.jsxs("li",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:t.title}),e.jsx("p",{className:"text-xs text-fg-muted",children:t.hint})]}),e.jsx(u,{to:"/settings/senders",search:{group:t.group},variant:"inline",className:g(A({variant:"secondary"}),"min-h-11 hover:no-underline"),"aria-label":`Manage ${t.title}`,children:"Manage"})]},t.title))})})}function me(){return e.jsxs("div",{className:"max-w-3xl space-y-8",children:[e.jsx(ae,{}),e.jsx(re,{}),e.jsx(de,{}),e.jsx(oe,{})]})}function Oe(){const s=z(),t=B(),a=H();return e.jsx(J,{items:t,activeId:"spam",title:"Spam & phishing",description:"What Remit flagged, and when it acts.",onSelect:a,onBackToMail:()=>{s({to:"/mail"})},children:e.jsx(me,{})})}export{Oe as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as i,X as Z,p as O,f3 as R,f5 as $,f4 as v,r as u,cl as E}from"./index-fsuIswbe.js";import{b as S,n as F,f as h,o as L,t as W,U as j,y as z,l as k,k as B,p as H}from"./useCalendarSuggestions-DXbA0boT.js";import{e as w,p as U,a as _}from"./draft-BEiHkDpm.js";import{f as P}from"./calendar-format-BwCpz-JZ.js";import{t as M}from"./agenda-time-D0yU-H44.js";import{a as V}from"./CalendarSession-BosFoHg2.js";import{C as G}from"./calendar-failure-note-C4gNXDQV.js";import{E as X,C as Y}from"./EmptyState-BJU14tbt.js";import{C as q}from"./calendar-event-sidebar-B_eR1h5J.js";import"./nav-link-ed0mFCCx.js";import{k as J,b as K}from"./calendar-Ds9kgvU8.js";import"./reply-CXuSMyqp.js";import"./ErrorState-BTHOmsYP.js";import"./useQueries-DPH-PeHV.js";import"./calendar-guests-Cay9Ub8h.js";import"./calendar-event-popup-Cr_LW8IP.js";import"./pencil-BDbmS56C.js";import"./circle-question-mark-DhNa_A16.js";import"./select-TYdrgtW5.js";import"./chevron-down-De4wQzka.js";import"./useMediaQuery-Hy81MQ2M.js";function I({title:e,subtitle:a,onClose:r,children:s,className:o}){return i.jsxs("section",{className:O("flex h-full w-full flex-col bg-surface",o),children:[i.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[i.jsx("h2",{className:"shrink-0 text-xs font-medium text-fg",children:e}),a!==void 0&&a!==""&&i.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-fg-muted",children:a}),i.jsx("button",{type:"button","aria-label":"Close editor",onClick:r,className:"ml-auto flex size-7 shrink-0 items-center justify-center rounded-md text-fg-subtle outline-none hover:bg-surface-sunken hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",children:i.jsx(Z,{className:"size-4"})})]}),i.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-row-inset py-5",children:i.jsx("div",{className:"mx-auto w-full max-w-2xl",children:s})})]})}function Q(e,a,r){const s={title:e.summary,location:e.location};if(e.allDay){const t=e.dtStart.slice(0,10),c=e.dtEnd.slice(0,10);return{...w(t,a),...s,allDay:!0,startTime:"",endDate:c>t?R(c,-1):t,endTime:""}}const o=t=>e.zoneCertainty==="Ambiguous"?t:$(t,r),l=o(e.dtStart),d=o(e.dtEnd);return{...w(l.slice(0,10),a),...s,startTime:l.slice(11,16),endDate:d.slice(0,10),endTime:d.slice(11,16)}}function ee(e,a,r,s){const o=U(a,r,s);if(!o.ok)return o;const d=e.zoneCertainty==="Ambiguous"||o.patch.start!==void 0?{...o.patch,..._(r,s.clock),allDay:r.allDay,timeZone:s.anchor}:o.patch;return{ok:!0,input:{calendarId:r.calendarId,event:d}}}const te=[],ae={from:"",to:""};function ne(e,a=""){const{timeZoneByCalendarId:r}=S(),s=e.date!==""&&!e.allDay&&e.endDate!==""&&e.startTime!==""&&e.endTime!==""&&`${e.endDate}T${e.endTime}`>`${e.date}T${e.startTime}`,{instances:o,isLoading:l,error:d}=F({...s?{from:v("week",e.date).from,to:v("week",e.endDate).to}:ae,calendarIds:te,enabled:s}),t=h();return u.useMemo(()=>{if(!s||l||d)return;const c=E(e.date,e.startTime,t),p=E(e.endDate,e.endTime,t),f=o.filter(m=>L(m)&&m.calendarObjectId!==a).map(m=>W(m,r[m.calendarId]??j,t));return M({start:c,end:p},f).map(m=>({id:m.id,label:`${m.title}, ${P(m)}`}))},[s,l,d,e.date,e.endDate,e.startTime,e.endTime,t,o,a,r])}const y="Add from mail",se="The invitation named a time zone nothing could resolve. The time below is as the mail wrote it — check it before adding.";function oe({suggestionId:e,onClose:a}){const{suggestion:r,isLoading:s,error:o}=z(e),l=r??void 0,[d,t]=u.useState(void 0);l!==void 0&&d===void 0&&t(l);const c=d??l;if(c!==void 0)return i.jsx(ie,{suggestion:c,onClose:a},c.suggestionId);if(o!==null){const p="Couldn't read what your mail is waiting on.";return i.jsx(I,{title:y,onClose:a,children:i.jsx(G,{text:`${p} Close this and try again.`,reportHref:k(p),className:"m-row-inset"})})}return i.jsx(I,{title:y,onClose:a,children:i.jsx(X,{message:s?"Reading the suggestion…":"This suggestion is no longer waiting on you. It was answered, or a later message replaced it."})})}function ie({suggestion:e,onClose:a}){const{calendars:r,defaultCalendarId:s,timeZoneByCalendarId:o}=S(),l=r.filter(n=>!n.readOnly),d=B(),[t]=u.useState(()=>Q(e,"",h())),[c,p]=u.useState(t),f=V()?.dispatch;u.useEffect(()=>{f?.({type:"sidebar-range",range:{date:t.date,endDate:t.endDate,startTime:t.allDay?"":t.startTime,endTime:t.allDay?"":t.endTime,allDay:t.allDay}})},[t,f]);const[m,D]=u.useState(""),[N,A]=u.useState(),x=ne(c),g=l.some(n=>n.id===s)?s:l[0]?.id??"";u.useEffect(()=>{g!==""&&p(n=>n.calendarId===""?{...n,calendarId:g}:n)},[g]);const C=()=>{const n=ee(e,t,c,{clock:h(),anchor:H(o[c.calendarId]??j)});if(!n.ok){D(n.problem);return}D(""),d.acceptEdited(e.suggestionId,n.input).then(b=>{if(b.kind==="answered"){a();return}const T=`Couldn't add this to your calendar: ${b.message}`;A({text:T,reportHref:k(T),onRetry:C})})};return i.jsx(q,{heading:y,draft:c,onChange:n=>{p(n),f?.({type:"sidebar-range",range:{date:n.date,endDate:n.endDate,startTime:n.allDay?"":n.startTime,endTime:n.allDay?"":n.endTime,allDay:n.allDay}})},calendars:l,calendarEditable:!0,repeatEditable:!1,timeZone:h(),timeZones:[h()],onTimeZone:()=>{},busy:!0,onBusy:()=>{},onSave:C,onCancel:a,saving:d.isAnswering,saveLabel:"Add",failure:N,problem:m!==""?m:e.zoneCertainty==="Ambiguous"?se:"",children:x&&i.jsx(Y,{clashes:x})})}function je(){const e=J(),{closeToView:a}=K();return e===void 0?null:i.jsx(oe,{suggestionId:e,onClose:a})}export{je as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as w,r as d,j as e,T as E,X as $,p as q,C as B,f5 as L,cl as F,fw as P}from"./index-fsuIswbe.js";import{b as V,f as Z,c as _}from"./useCalendarSuggestions-DXbA0boT.js";import{b as H,C as j,u as K}from"./useCalendarTasks-b_UNFPQH.js";import"./nav-link-ed0mFCCx.js";import{b as S}from"./calendar-Ds9kgvU8.js";import"./reply-CXuSMyqp.js";import{C as M}from"./CalendarLoadFailed-Cm6trTQZ.js";import{C as A}from"./calendar-event-popup-Cr_LW8IP.js";import"./ErrorState-BTHOmsYP.js";import"./useQueries-DPH-PeHV.js";import"./useMediaQuery-Hy81MQ2M.js";import"./pencil-BDbmS56C.js";const I={name:"square",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};I.node;const O=w(I);const R={name:"square-check-big",size:24,node:[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],aliases:["check-square"]};R.node;const W=w(R),D="flex size-9 items-center justify-center rounded-full text-fg-muted outline-none hover:bg-surface-sunken hover:text-fg focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40",v="h-9 w-full rounded-md border border-line bg-surface-sunken px-2 text-sm text-fg outline-none focus-visible:ring-2 focus-visible:ring-ring/30";function U({headingId:s,headingRef:i,fields:l,dueText:r,listName:u,completed:c,onToggle:f,onSave:p,onDelete:g,onClose:x,busy:m=!1,failure:h}){const[t,o]=d.useState(null);return e.jsxs("div",{className:"flex flex-col gap-3 p-3",children:[e.jsxs("div",{className:"flex justify-end gap-1",children:[t===null&&e.jsx("button",{type:"button",onClick:()=>o(l),className:"rounded-md px-3 text-sm font-medium text-accent hover:bg-accent-soft focus-visible:ring-2 focus-visible:ring-ring",children:"Edit"}),e.jsx("button",{type:"button","aria-label":"Delete",onClick:g,disabled:m,className:D,children:e.jsx(E,{className:"size-4"})}),e.jsx("button",{type:"button","aria-label":"Close",onClick:x,className:D,children:e.jsx($,{className:"size-4"})})]}),t===null?e.jsxs("div",{className:"flex flex-col gap-2 px-2",children:[e.jsx("h2",{id:s,ref:i,tabIndex:-1,className:q("text-xl font-normal break-words text-fg outline-none",c&&"text-fg-muted line-through"),children:l.title===""?"(No title)":l.title}),e.jsx("p",{className:"text-sm text-fg-muted",children:r}),e.jsxs("p",{className:"flex items-center gap-2 text-sm",children:[e.jsx(B,{className:"size-4 text-fg-subtle","aria-label":"List"}),u]}),l.description!==""&&e.jsx("p",{className:"text-sm whitespace-pre-wrap break-words",children:l.description})]}):e.jsxs("form",{className:"flex flex-col gap-2 px-2",onSubmit:n=>{n.preventDefault(),p(t),o(null)},children:[e.jsx("h2",{id:s,className:"sr-only",children:"Edit task"}),e.jsx("input",{"aria-label":"Title",value:t.title,onChange:n=>o({...t,title:n.target.value}),className:v}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"date","aria-label":"Due date",value:t.dueDate,onChange:n=>n.target.value!==""&&o({...t,dueDate:n.target.value}),className:v}),e.jsx("input",{type:"time","aria-label":"Due time",value:t.dueTime,onChange:n=>o({...t,dueTime:n.target.value}),className:v})]}),e.jsx("textarea",{"aria-label":"Description",rows:3,value:t.description,onChange:n=>o({...t,description:n.target.value}),className:"w-full rounded-md border border-line bg-surface-sunken px-2 py-1 text-sm"}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{type:"button",onClick:()=>o(null),className:"h-9 rounded-md border border-line px-3 text-sm font-medium",children:"Cancel"}),e.jsx("button",{type:"submit",disabled:m,className:"h-9 rounded-md bg-accent px-4 text-sm font-medium text-accent-fg disabled:opacity-50",children:"Save"})]})]}),h&&e.jsx(A,{failure:h}),t===null&&e.jsx("div",{className:"flex justify-end px-2",children:e.jsxs("button",{type:"button",onClick:f,disabled:m,className:"inline-flex h-9 items-center gap-2 rounded-md border border-line px-3 text-sm font-medium hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",children:[c?e.jsx(O,{className:"size-4","aria-hidden":"true"}):e.jsx(W,{className:"size-4","aria-hidden":"true"}),c?"Mark not done":"Mark done"]})})]})}const X=(s,i)=>{const l=new Date(`${s.slice(0,10)}T00:00:00Z`),r=new Intl.DateTimeFormat(void 0,{weekday:"long",day:"numeric",month:"long",timeZone:"UTC"}).format(l);return i?`Due ${r}`:`Due ${r} · ${s.slice(11,16)}`};function G({calendarTaskId:s}){const i=H(s),{closeToView:l}=S(),r=d.useId(),u=d.useRef(null),c=i.kind==="gone";return d.useEffect(()=>{c&&u.current?.focus()},[c]),i.kind==="loading"?null:i.kind==="found"?e.jsx(J,{task:i.task}):i.kind==="failed"?e.jsx(j,{anchor:null,anchorKey:"failed",labelledBy:r,children:e.jsx("div",{id:r,className:"p-4",children:e.jsx(M,{title:"Couldn't open this task",error:i.error,onRetry:i.retry,compact:!0})})}):e.jsx(j,{anchor:null,anchorKey:"gone",labelledBy:r,children:e.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[e.jsx("h2",{id:r,className:"text-base font-medium text-fg",children:"This task was deleted or moved"}),e.jsx("button",{ref:u,type:"button",onClick:l,className:"self-end rounded-md border border-line px-3 py-1.5 text-sm font-medium hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",children:"Close"})]})})}function J({task:s}){const{taskLists:i}=V(),{closeToView:l}=S(),{updateTask:r,deleteTask:u,isWriting:c}=K(),f=d.useId(),p=d.useRef(null),[g,x]=d.useState(),[m,h]=d.useState(null),{calendarTaskId:t}=s;d.useLayoutEffect(()=>{h(document.querySelector(`[data-task-id="${CSS.escape(t)}"]`))},[t]),d.useEffect(()=>{p.current?.focus()},[]);const o=Z(),n=s.allDay?s.due:L(s.due,o),z={title:s.summary,dueDate:n.slice(0,10),dueTime:s.allDay?"":n.slice(11,16),description:s.description},b=a=>N=>{if(N.kind==="written"){x(void 0);return}const T=`Couldn't save the task: ${N.message}`;x({text:T,reportHref:_(T),onRetry:a})},y=()=>{r(s,{completed:!s.completed}).then(b(y))},k=a=>{r(s,{summary:a.title,description:a.description,allDay:a.dueTime==="",due:a.dueTime===""?a.dueDate:F(a.dueDate,a.dueTime,o)}).then(b(()=>k(a)))},C=()=>{u(s).then(a=>{if(a.kind==="written"){l();return}b(C)(a)})};return e.jsx(j,{anchor:m,anchorKey:`${t}:${m?"chip":"none"}`,labelledBy:f,children:e.jsx(U,{headingId:f,headingRef:p,fields:z,dueText:X(n,s.allDay),listName:i.find(a=>a.id===s.calendarId)?.name??"Tasks",completed:s.completed,onToggle:y,onSave:k,onDelete:C,onClose:l,busy:c,failure:g})})}function ce(){const{calendarTaskId:s}=P.useParams();return e.jsx(G,{calendarTaskId:s})}export{ce as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as ee,az as Q,aA as B,f5 as N,a as C,f6 as te,r as d,e as v,s as b,f as m,f7 as ne,f8 as ae,f9 as se,aS as A,b2 as re,b0 as oe,b1 as ie,fa as ce,cj as w,fb as h,f4 as de,co as le,fc as ue,fd as fe,fe as ge,ff as pe,fg as me,fh as Ce,fi as be,fj as ye}from"./index-fsuIswbe.js";import{f as I}from"./ErrorState-BTHOmsYP.js";import{u as G}from"./useQueries-DPH-PeHV.js";const z={name:"map-pin",size:24,node:[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]};z.node;const Fe=ee(z),Ee={"cal-1":{solid:"bg-cal-1",soft:"bg-cal-1-soft",text:"text-cal-1",border:"border-cal-1",rail:"border-l-cal-1"},"cal-2":{solid:"bg-cal-2",soft:"bg-cal-2-soft",text:"text-cal-2",border:"border-cal-2",rail:"border-l-cal-2"},"cal-3":{solid:"bg-cal-3",soft:"bg-cal-3-soft",text:"text-cal-3",border:"border-cal-3",rail:"border-l-cal-3"},"cal-4":{solid:"bg-cal-4",soft:"bg-cal-4-soft",text:"text-cal-4",border:"border-cal-4",rail:"border-l-cal-4"},"cal-5":{solid:"bg-cal-5",soft:"bg-cal-5-soft",text:"text-cal-5",border:"border-cal-5",rail:"border-l-cal-5"},"cal-6":{solid:"bg-cal-6",soft:"bg-cal-6-soft",text:"text-cal-6",border:"border-cal-6",rail:"border-l-cal-6"}};function We(e){return Ee[e]}function Ue(e){return Q(B({title:`Calendar invitation: ${e}`,errorMessage:e}))}function $e(e){return Q(B({title:`Calendar event: ${e}`,errorMessage:e}))}const K=()=>Intl.DateTimeFormat().resolvedOptions().timeZone,x="";function Qe(e){if(e!==x)return e;const t=K();return Intl.supportedValuesOf("timeZone").includes(t)?t:x}const Oe={Cal1:"cal-1",Cal2:"cal-2",Cal3:"cal-3",Cal4:"cal-4",Cal5:"cal-5",Cal6:"cal-6"},Z={Unscheduled:"accepted",Organizer:"accepted",Accepted:"accepted",Tentative:"tentative",Declined:"declined",NeedsAction:"noReply"},Be=e=>Z[e],he={Local:"local",Explicit:"explicit",Ambiguous:"ambiguous"},H="#";function Se(e,t){return t===""?e:`${e}${H}${t}`}function P(e){const t=e.indexOf(H);return t===-1?{calendarObjectId:e,recurrenceId:""}:{calendarObjectId:e.slice(0,t),recurrenceId:e.slice(t+1)}}const V=(e,t)=>{const n=[...e].sort((a,r)=>Date.parse(a.start)-Date.parse(r.start));return n.find(a=>Date.parse(a.end)>Date.parse(t))??n[0]};function we(e,t,n){const a=V(e.filter(r=>{const o=P(r.id);return o.calendarObjectId===t&&o.recurrenceId!==""}),n);return a?P(a.id):void 0}function q(e,t,n,a){const r=V(e.filter(o=>o.calendarObjectId===t&&Ae(o)).map(o=>ve(o,"",a)),n);if(r)return{...P(r.id),calendarId:r.calendarId,date:r.start.slice(0,10)}}function j(e){return{id:e.calendarId,accountId:e.accountConfigId,accountLabel:"",name:e.displayName,color:Oe[e.color]??"cal-1",...e.source==="Subscribed"?{readOnly:!0,sync:e.subscriptionEnabled?"live":"paused",syncError:e.subscriptionError}:{}}}function ve(e,t,n){return{id:Se(e.calendarObjectId,e.recurrenceId),calendarId:e.calendarId,title:e.summary,start:e.allDay?e.start.slice(0,10):N(e.start,n),end:e.allDay?e.end.slice(0,10):N(e.end,n),allDay:e.allDay,location:"",notes:"",attendees:[],myRsvp:Z[e.participation],threadId:"",threadSubject:"",timeZone:t,zoneCertainty:he[e.zoneCertainty]??"explicit",recurrenceRule:e.hasRecurrence?"Repeats":"",seriesId:e.hasRecurrence?e.icalUid:"",seriesException:!1,status:e.status==="Tentative"?"tentative":"confirmed"}}const Ae=e=>e.status!=="Cancelled";function Ge(){const{data:e,isLoading:t,error:n,refetch:a}=C(te());return d.useMemo(()=>{const r=e?.items??[],o=r.filter(i=>i.componentSet!=="VtodoOnly"),l=o.map(j),s=r.filter(i=>i.componentSet==="VtodoOnly").map(j);return{calendars:l,taskLists:s,collections:r,colorByCalendarId:Object.fromEntries(l.map(i=>[i.id,i.color])),timeZoneByCalendarId:Object.fromEntries(r.map(i=>[i.calendarId,i.timezone])),defaultCalendarId:(o.find(i=>i.source==="Default")??o[0])?.calendarId??"",isLoading:t,error:n??null,retry:()=>{a()}}},[e,t,n,a])}const D=b(400,404,412),Ie=new Set(["calendarEventOperationsListCalendarEvents","calendarEventDetailOperationsGetCalendarEvent","calendarFreeBusyOperationsListCalendarFreeBusy","calendarTaskOperationsListCalendarTasks","calendarTaskDetailOperationsGetCalendarTask"]),F=e=>A(e)===412?{kind:"conflict"}:{kind:"refused",message:I(e)},ke={this:"This",following:"Following",all:"All"};function Y(){const e=v();return d.useCallback(()=>{e.invalidateQueries({predicate:t=>{const n=t.queryKey[0];if(typeof n!="object"||n===null)return!1;const a=n._id;return typeof a=="string"&&Ie.has(a)}})},[e])}const W=({scope:e,recurrenceId:t})=>e===void 0?{}:{scope:ke[e],recurrenceId:t};function ze(){const e=Y(),t=m({...ne(),meta:D,onSuccess:e}),n=m({...ae(),meta:D,onSuccess:e}),a=m({...se(),meta:D,onSuccess:e}),r=d.useCallback(s=>t.mutateAsync({body:s}).then(i=>({kind:"created",calendarObjectId:i.calendarObjectId,sends:i.sends})).catch(i=>A(i)===412?{kind:"conflict"}:{kind:"refused",message:I(i)}),[t]),o=d.useCallback((s,i)=>n.mutateAsync({path:{calendarObjectId:s.calendarObjectId},query:{calendarId:s.calendarId,...W(s)},headers:{"If-Match":s.etag},body:i}).then(f=>({kind:"written",sends:f.sends})).catch(F),[n]),l=d.useCallback(s=>a.mutateAsync({path:{calendarObjectId:s.calendarObjectId},query:{calendarId:s.calendarId,...W(s)},headers:{"If-Match":s.etag}}).then(i=>({kind:"written",sends:i.sends})).catch(F),[a]);return d.useMemo(()=>({createEvent:r,updateEvent:o,deleteEvent:l,isWriting:t.isPending||n.isPending||a.isPending}),[r,o,l,t.isPending,n.isPending,a.isPending])}const M=b(400,404),L={kind:"written"},R=e=>({kind:"refused",message:I(e)});function Ke(){const e=v(),t=Y(),n=d.useCallback(()=>e.invalidateQueries({queryKey:re()}),[e]),a=d.useCallback(()=>(t(),n()),[t,n]),r=m({...oe(),meta:M,onSuccess:n}),o=m({...ie(),meta:M,onSuccess:a}),l=m({...ce(),meta:M,onSuccess:a}),s=d.useCallback(c=>r.mutateAsync({body:c}).then(()=>L).catch(R),[r]),i=d.useCallback((c,g)=>o.mutateAsync({path:{calendarId:c},body:g}).then(()=>L).catch(R),[o]),f=d.useCallback(c=>l.mutateAsync({path:{calendarId:c}}).then(()=>L).catch(R),[l]);return d.useMemo(()=>({createCalendar:s,updateCalendar:i,deleteCalendar:f,isWriting:r.isPending||o.isPending||l.isPending}),[s,i,f,r.isPending,o.isPending,l.isPending])}const De=b(404);function Ze(e,t){const{data:n,isLoading:a,error:r,refetch:o}=C({...w({path:{calendarObjectId:e},query:{calendarId:t}}),meta:De,enabled:e!==""&&t!==""});return{resource:n,isLoading:a,error:r,refetch:()=>{o()}}}const J=b(400,404),k=5*6e4,T=({from:e,to:t,calendarIds:n})=>({query:n.length===0?{from:e,to:t}:{from:e,to:t,calendarId:[...n]}});function He(e){const{data:t,isLoading:n,error:a,refetch:r}=C({...h(T(e)),meta:J,staleTime:k,enabled:e.enabled??!0});return{instances:t?.items??[],isLoading:n,error:a,refetch:()=>{r()}}}function Ve(e,t,n){const a=G({queries:e.map(c=>({...h(T({...c,calendarIds:t})),meta:J,staleTime:k,enabled:n}))}),r=e.map(c=>c.from).join("|"),o=a.map(c=>c.data),l=a.map(c=>c.isPending).join("|"),s=a.find(c=>c.error)?.error??null,i=d.useMemo(()=>o.flatMap(c=>c?.items??[]),[r,l]),f=d.useMemo(()=>{const c=new Set;return e.forEach((g,u)=>{a[u]?.isPending&&c.add(g.from)}),c},[r,l]);return{instances:i,pendingWindows:f,error:s,refetch:()=>{for(const c of a)c.error&&c.refetch()}}}function Ye(e,t,n,a){const r=v(),o=[...n].join(",");d.useEffect(()=>{if(!a)return;const l=o===""?[]:o.split(",");for(const s of[-1,1]){const i=de(e,le(t,e,s));r.prefetchQuery({...h(T({...i,calendarIds:l})),staleTime:k})}},[r,e,t,o,a])}const Me=b(400,404);function Je(e){const t=G({queries:e.map(s=>({...ue({query:{from:s.from,to:s.to}}),meta:Me,staleTime:k}))}),n=e.map(s=>s.from).join("|"),a=t.map(s=>s.data),r=t.map(s=>s.isPending).join("|"),o=d.useMemo(()=>a.flatMap(s=>s?.items??[]),[n,r]),l=d.useMemo(()=>{const s=new Set;return e.forEach((i,f)=>{t[f]?.isPending&&s.add(i.from)}),s},[n,r]);return{spans:o,pendingWindows:l,error:t.find(s=>s.error)?.error??null,refetch:()=>{for(const s of t)s.error&&s.refetch()}}}const U=365*24*60*6e4,Le=1440*6e4,$=b(),Re=b(404),S=e=>new Date(e).toISOString().replace(/\.\d{3}Z$/,"+00:00"),Pe=e=>{const t=e instanceof Error&&e.message!==""?e.message:"no reason given",n=A(e);return n===void 0?t:`${t} (HTTP ${n})`};function Xe(e,t){const[n]=d.useState(()=>Date.now()),a=K(),r=new Date(n).toISOString(),o=C({...h({query:{from:S(n),to:S(n+U),calendarObjectId:e}}),meta:$,retry:!1,enabled:t}),l=o.data?q(o.data.items,e,r,a):void 0,s=C({...w({path:{calendarObjectId:e}}),meta:Re,retry:!1,enabled:t&&o.data!==void 0&&l===void 0}),i=Date.parse(s.data?.dtStart??""),f=s.data!==void 0&&Number.isNaN(i),c=Number.isNaN(i)?0:i-Le,g=C({...h({query:{from:S(c),to:S(c+U),calendarObjectId:e}}),meta:$,retry:!1,enabled:t&&s.data!==void 0&&!f}),u=g.data?q(g.data.items,e,r,a):void 0;if(!t)return{kind:"Idle"};if(l)return{kind:"Found",jump:l};if(u)return{kind:"Found",jump:u};const p=A(s.error)===404,_=[o.error,p?null:s.error,g.error].find(X=>X!==null);return _!==void 0?{kind:"Failed",reason:Pe(_)}:p?{kind:"Deleted"}:f?{kind:"Failed",reason:`the stored event names no readable start (${s.data?.dtStart??""})`}:g.data!==void 0?{kind:"NoOccurrenceFound"}:{kind:"Searching"}}const y=b(400,404),Te=new Set(["calendarSuggestionOperationsListCalendarSuggestions","messageCalendarSuggestionOperationsListMessageCalendarSuggestions","calendarEventOperationsListCalendarEvents","calendarEventDetailOperationsGetCalendarEvent","calendarFreeBusyOperationsListCalendarFreeBusy","filterOperationsListFilters"]),_e=e=>e.invalidateQueries({predicate:t=>{const n=t.queryKey[0];if(typeof n!="object"||n===null)return!1;const a=n._id;return typeof a=="string"&&Te.has(a)}});function et(e){const{data:t,isLoading:n,error:a}=C({...fe({path:{messageId:e}}),meta:y});return{suggestions:t?.items??[],isLoading:n,error:a??null}}function tt(){const{data:e,isLoading:t,error:n}=C({...be({query:{state:"Pending"}}),meta:y});return{suggestions:e?.items??[],isLoading:t,error:n??null}}const Ne=async(e,t)=>{let n;do{const{data:a}=await ye({query:{state:"Pending",continuationToken:n},signal:t,throwOnError:!0}),r=a.items.find(o=>o.suggestionId===e);if(r)return r;n=a.continuationToken}while(n);return null};function nt(e){const{data:t,isLoading:n,error:a}=C({queryKey:[{_id:"calendarSuggestionOperationsListCalendarSuggestions",suggestionId:e}],queryFn:({signal:r})=>Ne(e,r),meta:y});return{suggestion:t,isLoading:n,error:a??null}}const E={kind:"answered"},O=e=>({kind:"refused",message:I(e)});function at(){const e=v(),t=d.useCallback(()=>_e(e),[e]),n=m({...ge(),meta:y,onSuccess:t}),a=m({...pe(),meta:y,onSuccess:t}),r=m({...me(),meta:y,onSuccess:t}),o=m({...Ce(),meta:y,onSuccess:t}),l=d.useCallback((u,p)=>n.mutateAsync({path:{suggestionId:u},body:{calendarId:p}}).then(()=>E).catch(O),[n]),s=d.useCallback((u,p)=>n.mutateAsync({path:{suggestionId:u},body:{calendarId:p,answer:"Tentative"}}).then(()=>E).catch(O),[n]),i=d.useCallback((u,p)=>n.mutateAsync({path:{suggestionId:u},body:p}).then(()=>E).catch(O),[n]),f=d.useCallback(u=>a.mutateAsync({path:{suggestionId:u}}).then(()=>E).catch(O),[a]),c=d.useCallback((u,p)=>r.mutateAsync({path:{suggestionId:u},body:{muteSender:p}}).then(()=>E).catch(O),[r]),g=d.useCallback(u=>o.mutateAsync({path:{suggestionId:u}}).then(()=>E).catch(O),[o]);return d.useMemo(()=>({accept:l,tentative:s,acceptEdited:i,decline:f,dismiss:c,reopen:g,isAnswering:n.isPending||a.isPending||r.isPending||o.isPending}),[l,s,i,f,c,g,n.isPending,a.isPending,r.isPending,o.isPending])}export{D as C,Fe as M,x as U,Y as a,Ge as b,$e as c,We as d,ze as e,K as f,Ve as g,Je as h,Se as i,tt as j,at as k,Ue as l,et as m,He as n,Ae as o,Qe as p,Ye as q,P as r,Ze as s,ve as t,Ke as u,we as v,Xe as w,Be as x,nt as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as d,d7 as g,e as i,f as o,d8 as y,r as u,d9 as p,da as L,db as c}from"./index-fsuIswbe.js";const f={Default:"bg-fg-subtle",Red:"bg-red-500",Orange:"bg-orange-500",Yellow:"bg-yellow-500",Green:"bg-green-500",Teal:"bg-teal-500",Blue:"bg-blue-500",Purple:"bg-purple-500",Gray:"bg-gray-500"},O=["Default","Red","Orange","Yellow","Green","Teal","Blue","Purple","Gray"],m=e=>Object.hasOwn(f,e),l=e=>g({path:{accountId:e}}),h=async e=>{const t=[];let a;do{const{data:s}=await c({path:{accountId:e},query:{continuationToken:a},throwOnError:!0});t.push(...s.items),a=s.continuationToken}while(a);return t},P=[],q=e=>{const t=d({queryKey:l(e??""),queryFn:()=>h(e??""),enabled:!!e});return{labels:t.data??P,isSuccess:t.isSuccess,isPending:t.isPending,isError:t.isError,error:t.error,refetch:t.refetch}},w=e=>{const t=i(),a=o({...y(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:l(e)})}}),{mutateAsync:s}=a;return{createLabel:u.useCallback((r,n="Default")=>e?s({path:{accountId:e},body:{name:r,color:n}}):Promise.reject(new Error("No account")),[e,s]),isPending:a.isPending,isError:a.isError,error:a.error,reset:a.reset}},D=e=>{const t=i(),a=o({...p(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:l(e)})}}),{mutate:s}=a;return{updateLabel:u.useCallback((r,n)=>{e&&s({path:{accountId:e,labelId:r},body:n})},[e,s]),isPending:a.isPending,updatingLabelId:a.isPending?a.variables?.path.labelId:void 0}},E=e=>{const t=i(),a=o({...L(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:l(e)})}}),{mutate:s}=a;return{deleteLabel:u.useCallback(r=>{e&&s({path:{accountId:e,labelId:r}})},[e,s]),isPending:a.isPending,deletingLabelId:a.isPending?a.variables?.path.labelId:void 0}};export{w as a,O as b,D as c,E as d,m as i,f as l,q as u};
|