@remit/web-client-dist 0.0.677 → 0.0.679
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-dae720lw.js → BriefPane-IZ_xj1Lk.js} +1 -1
- package/assets/CalendarEventEditor-DUg5gUNR.js +1 -0
- package/assets/{CalendarEventPopup-qgqMLo7x.js → CalendarEventPopup-BbBoaCKG.js} +1 -1
- package/assets/{CalendarLoadFailed-CZZrv3kl.js → CalendarLoadFailed-DL8u-JFQ.js} +1 -1
- package/assets/{CalendarQuickCreate-BtDiOQnj.js → CalendarQuickCreate-DVjhHPuJ.js} +1 -1
- package/assets/{CalendarSession-BSPnENrr.js → CalendarSession-BMeYMexj.js} +1 -1
- package/assets/DesktopChrome-CKI3QDy9.js +1 -0
- package/assets/DropdownMenu-pEN-d7K3.js +1 -0
- package/assets/{EmptyState-DaDveift.js → EmptyState-CP5Vn2LS.js} +1 -1
- package/assets/{ErrorState-BjlNwjgd.js → ErrorState-BmfRU6e6.js} +1 -1
- package/assets/{FlaggedPane-BMM1CFDP.js → FlaggedPane-CGZ_AxBh.js} +1 -1
- package/assets/{FullCompose-C6KtKdIN.js → FullCompose-YhsG0MQv.js} +1 -1
- package/assets/LabelApplyTrigger-19lK6vLg.js +1 -0
- package/assets/{MailShell-B8hUSN5k.js → MailShell-C3h8o0Po.js} +1 -1
- package/assets/{MailViewChrome-ByS8tz5h.js → MailViewChrome-bMtbpNoZ.js} +1 -1
- package/assets/{MailboxPane-CAAszcbD.js → MailboxPane-BO_DmR1T.js} +1 -1
- package/assets/{MessageBody-0P-UxriZ.js → MessageBody-Dw2SMxor.js} +4 -4
- package/assets/MessageToolbar-C4ylsZ_k.js +1 -0
- package/assets/{NavMenuButton-lXQswWUS.js → NavMenuButton-BLH-0IxV.js} +1 -1
- package/assets/{OnboardingWizard-B9A2fDSa.js → OnboardingWizard-DADGyMEc.js} +1 -1
- package/assets/{OutboxPane-C-1N19Mm.js → OutboxPane-DuQ45_dm.js} +1 -1
- package/assets/_calendarObjectId-Bu1gEdx4.js +1 -0
- package/assets/_mailboxId-DfmkdvY1.js +1 -0
- package/assets/_messageId-C16gKcH0.js +1 -0
- package/assets/_messageId-_anK-ruA.js +1 -0
- package/assets/_messageId-uhJG8cXc.js +1 -0
- package/assets/_outboxMessageId-CaSX9ZOS.js +1 -0
- package/assets/_recurrenceId-C3Qcwwvr.js +1 -0
- package/assets/_threadId-CstWlugv.js +1 -0
- package/assets/_threadId-DXKO9oGh.js +1 -0
- package/assets/_threadId-DwOOZ66z.js +1 -0
- package/assets/{_view._date-CQz1dtN-.js → _view._date-Cp0fmpb2.js} +1 -1
- package/assets/{account-service-status-Cn_S-syP.js → account-service-status-DbTLkFuz.js} +1 -1
- package/assets/accounts-gJO9pQry.js +1 -0
- package/assets/advanced-UrNGfD9P.js +1 -0
- package/assets/appearance-BbURt4Vo.js +1 -0
- package/assets/{avatar-_Iz-lpCN.js → avatar-CxJjt5__.js} +1 -1
- package/assets/{bottom-sheet-zjs6jE40.js → bottom-sheet-BX4KSkk6.js} +1 -1
- package/assets/{brief-SkDhbGUS.js → brief-BudFNiO7.js} +1 -1
- package/assets/brief-D2JSdiJk.js +1 -0
- package/assets/calendar-BlTUf0bx.js +1 -0
- package/assets/{calendar-TkJ4zEO8.js → calendar-D6a4XfwP.js} +1 -1
- package/assets/{calendar-event-popup-Eoorlfr8.js → calendar-event-popup-BuR0xhCL.js} +1 -1
- package/assets/{calendar-event-sidebar-Dy-5E4fW.js → calendar-event-sidebar-DhwwreFW.js} +1 -1
- package/assets/{calendar-failure-note-DGOwCvAu.js → calendar-failure-note-CJWF9Bm9.js} +1 -1
- package/assets/{calendar-guests-CGyi0Z1i.js → calendar-guests-D5tYwBA8.js} +1 -1
- package/assets/{calendar-suggestion-CwP3NZgH.js → calendar-suggestion-DRPyaTm4.js} +1 -1
- package/assets/{calendars-C-lW-6Ji.js → calendars-tQGYwNBq.js} +1 -1
- package/assets/{card-BPN5dp6F.js → card-BsZT3k9v.js} +1 -1
- package/assets/{checkbox-CJ4cnZfk.js → checkbox-C3Yttn2a.js} +1 -1
- package/assets/{circle-check-BLyY37Bq.js → circle-check-Doz35Q_M.js} +1 -1
- package/assets/{circle-check-big-DtREikeq.js → circle-check-big-D9Wjhdx-.js} +1 -1
- package/assets/{circle-help-BT_Dohsy.js → circle-help-B5DNH9Yv.js} +1 -1
- package/assets/{clock-rdLLgeDx.js → clock-D8iwoylV.js} +1 -1
- package/assets/cloud-off-B3IezOXr.js +1 -0
- package/assets/compose._-_outboxMessageId_-BPU3iogA.js +1 -0
- package/assets/compose._-_outboxMessageId_-BgVnlkG4.js +1 -0
- package/assets/compose._-_outboxMessageId_-BnsIRMLA.js +1 -0
- package/assets/compose._-_outboxMessageId_-CpaquYol.js +1 -0
- package/assets/{config-import-CkiEFeqC.js → config-import-CwIr-NJ5.js} +1 -1
- package/assets/{confirm-dialog-DtOnF5MV.js → confirm-dialog-DhdN2rki.js} +1 -1
- package/assets/{copy--8c5mY8r.js → copy-CtEwcw6R.js} +1 -1
- package/assets/{credential-steps-CtTCRP2k.js → credential-steps-dUNvV52R.js} +1 -1
- package/assets/{download-BKDG5QA1.js → download-vcht0JNA.js} +1 -1
- package/assets/{draft-BeV5oY-T.js → draft-Cn-cGLa8.js} +1 -1
- package/assets/edit-B-28N5ki.js +1 -0
- package/assets/edit-OALDWD3A.js +1 -0
- package/assets/{external-link-C55BTLfs.js → external-link-D5RMYJCY.js} +1 -1
- package/assets/{file-json-D8vlo3ob.js → file-json-d4ZS8Wws.js} +1 -1
- package/assets/filters-DrX3DsrZ.js +1 -0
- package/assets/{flagged-BXI9KzeP.js → flagged-BfctmA4r.js} +1 -1
- package/assets/flagged-CU6IaMWI.js +1 -0
- package/assets/{folders-CMN67g3r.js → folders-0XOIE3da.js} +1 -1
- package/assets/{help-copy-z6sn-HSk.js → help-copy-PBpM2Nt-.js} +1 -1
- package/assets/{import-CT3XcMFi.js → import-BTQvBLt4.js} +1 -1
- package/assets/index-BHtOQW8x.js +1 -0
- package/assets/index-BoRZwOaB.js +1 -0
- package/assets/index-C0jxJ9rz.js +1 -0
- package/assets/index-C15-ASoN.js +1 -0
- package/assets/index-C16gKcH0.js +1 -0
- package/assets/{index-Cr6oUxXl.css → index-CNLnhDIy.css} +1 -1
- package/assets/{index-IYu0bmf1.js → index-D9rVZImU.js} +4 -4
- package/assets/index-DefW0u5m.js +1 -0
- package/assets/index-Dg1Qx5Zn.js +1 -0
- package/assets/index-IUjWbCxV.js +1 -0
- package/assets/{index-Q7BlLS9p.js → index-JcHkcLZl.js} +75 -75
- package/assets/index-fTiw_j5r.js +1 -0
- package/assets/index-uhJG8cXc.js +1 -0
- package/assets/{kbd-Bxe2zQGe.js → kbd-Ba8uOP5b.js} +1 -1
- package/assets/labels-7qLNnQ4p.js +1 -0
- package/assets/mail-DfXdcXsx.js +1 -0
- package/assets/{menu-BzT426Ih.js → menu-B9EpNfSt.js} +1 -1
- package/assets/new-CQLfecpu.js +1 -0
- package/assets/{onboarding-completion-BB19AMJ-.js → onboarding-completion-epwWc7r3.js} +1 -1
- package/assets/onboarding-u4F7mHOL.js +1 -0
- package/assets/outbox-CQ-KfDPo.js +1 -0
- package/assets/{pencil-CPbJ6Tks.js → pencil-CnNCN6P1.js} +1 -1
- package/assets/people-Bp5zi0j-.js +1 -0
- package/assets/{popover-menu-O_sOnKG9.js → popover-menu-2YIsUsHr.js} +1 -1
- package/assets/{refresh-cw-CIoRjIJp.js → refresh-cw-Cr0O1tfh.js} +1 -1
- package/assets/{reply-BRbg9_Ak.js → reply-Dh35Hqag.js} +1 -1
- package/assets/{rich-text-B5WZj9gV.js → rich-text-BlVMVJea.js} +14 -14
- package/assets/{rich-text-spellcheck-worker-provider-BR2Tfepe.js → rich-text-spellcheck-worker-provider-Bh7g2S3c.js} +1 -1
- package/assets/{rotate-ccw-Yghgmp4e.js → rotate-ccw-fZQtnzhi.js} +1 -1
- package/assets/{roving-focus-Cj5YFxIj.js → roving-focus-Di2-_Bi5.js} +1 -1
- package/assets/{row-actions-D3zwQA9I.js → row-actions-FzEmQlCI.js} +1 -1
- package/assets/{search-mirror-CkH8xzbq.js → search-mirror-Rg0rkpEY.js} +1 -1
- package/assets/{search-token-index-Box28J2l.js → search-token-index-DKhKuetV.js} +1 -1
- package/assets/{sections-Bz9kplXE.js → sections-DPhyxq2e.js} +1 -1
- package/assets/senders-iDSnpdnW.js +1 -0
- package/assets/settings-C4JJ05jn.js +1 -0
- package/assets/{settings-screen-DlzqJ0HQ.js → settings-screen-B4Stef9n.js} +1 -1
- package/assets/shield-check-DPCURbcU.js +1 -0
- package/assets/{sparkles-t4_3JyEx.js → sparkles-CKGM5ogH.js} +1 -1
- package/assets/{suggested-vips-0F7iDlFJ.js → suggested-vips-CEDSSHCK.js} +1 -1
- package/assets/{suggestion._suggestionId-Bz7HzxP1.js → suggestion._suggestionId-B9utmB_0.js} +1 -1
- package/assets/{task._calendarTaskId-D7UXvB0Z.js → task._calendarTaskId-COR3DmT4.js} +1 -1
- package/assets/{undo-2-Dw4FFZmo.js → undo-2-91d41Gxr.js} +1 -1
- package/assets/{useCalendarData-4TkWGBli.js → useCalendarData-D4cVUO0c.js} +1 -1
- package/assets/{useCalendarScheduling-DSmz3E5d.js → useCalendarScheduling-BjOsYgtF.js} +1 -1
- package/assets/{useCalendarSuggestions-DHNLR9_9.js → useCalendarSuggestions-DVLnDR0Q.js} +1 -1
- package/assets/{useCalendarTasks-Ch-qSnN_.js → useCalendarTasks-vU39_Pqu.js} +1 -1
- package/assets/{useDebouncedValue-B6s52mZt.js → useDebouncedValue-CCQodc3r.js} +1 -1
- package/assets/{useFilters-CYaLiKrQ.js → useFilters-bWTIYb6Z.js} +1 -1
- package/assets/{useLabels-Ci_KO517.js → useLabels-ymrfdmw5.js} +1 -1
- package/assets/useLayoutTier-BUzxktUV.js +1 -0
- package/assets/{useMediaQuery-CXurPMbN.js → useMediaQuery-eKKtffrD.js} +1 -1
- package/assets/{useMessageBodyContent-DJ1-V3VF.js → useMessageBodyContent-BwiAK6tQ.js} +1 -1
- package/assets/useQueries-eyXujaLS.js +1 -0
- package/assets/{useRefreshControl-BVxIaWvo.js → useRefreshControl-DMEs8u4b.js} +1 -1
- package/assets/{useResultFolderIndex-BGDx2gSv.js → useResultFolderIndex-Cn4PEyDR.js} +1 -1
- package/assets/{useSignature-BtR5UuiQ.js → useSignature-bFJVFu89.js} +1 -1
- package/assets/{warnings-C4WaZxJm.js → warnings-D0W4PYa1.js} +3 -3
- package/index.html +2 -2
- package/package.json +1 -1
- package/assets/CalendarEventEditor-D8lJfjiB.js +0 -1
- package/assets/DesktopChrome-wrncK03X.js +0 -1
- package/assets/LabelApplyTrigger-BOo72opb.js +0 -1
- package/assets/MessageToolbar-CpGOUJZt.js +0 -1
- package/assets/_calendarObjectId-DZUruQVS.js +0 -1
- package/assets/_mailboxId-BJ_K1owi.js +0 -1
- package/assets/_messageId-Bv7rw2Ee.js +0 -1
- package/assets/_messageId-CxEtXKOV.js +0 -1
- package/assets/_messageId-Dn--s-1U.js +0 -1
- package/assets/_outboxMessageId-CtKRsjsP.js +0 -1
- package/assets/_recurrenceId-BmfvBHMQ.js +0 -1
- package/assets/_threadId-CYfh6U5z.js +0 -1
- package/assets/_threadId-DR-VADHf.js +0 -1
- package/assets/_threadId-_Tp38Jjp.js +0 -1
- package/assets/accounts-BBs1u3a9.js +0 -1
- package/assets/advanced-NdwM48ef.js +0 -1
- package/assets/appearance-CN3GLLqL.js +0 -1
- package/assets/brief-DxWizfDz.js +0 -1
- package/assets/calendar-089QTsHp.js +0 -1
- package/assets/compose._-_outboxMessageId_-BTbEyzkW.js +0 -1
- package/assets/compose._-_outboxMessageId_-BtcobB1K.js +0 -1
- package/assets/compose._-_outboxMessageId_-CfMr_J5t.js +0 -1
- package/assets/compose._-_outboxMessageId_-CqlGCna1.js +0 -1
- package/assets/edit-BTLe8Y0F.js +0 -1
- package/assets/edit-ByggXvS8.js +0 -1
- package/assets/filters-BQo3gMJ3.js +0 -1
- package/assets/flagged-DJ-TC-JA.js +0 -1
- package/assets/index-6I3CIFzv.js +0 -1
- package/assets/index-B03cLsmc.js +0 -1
- package/assets/index-B_Kp6tBV.js +0 -1
- package/assets/index-BqhbwSzu.js +0 -1
- package/assets/index-Cs95BuoI.js +0 -1
- package/assets/index-Cua4RHkF.js +0 -1
- package/assets/index-D_cEGMwi.js +0 -1
- package/assets/index-Dn--s-1U.js +0 -1
- package/assets/index-HzhXMggl.js +0 -1
- package/assets/index-_NrXWlZY.js +0 -1
- package/assets/labels-B030K3QL.js +0 -1
- package/assets/mail-BuB5wUpu.js +0 -1
- package/assets/new-CRVRIIK_.js +0 -1
- package/assets/onboarding-C65aa4Nh.js +0 -1
- package/assets/outbox-DAPK8OVn.js +0 -1
- package/assets/senders-DnVrQngr.js +0 -1
- package/assets/settings-emdtCHOi.js +0 -1
- package/assets/shield-check-BSecZw5t.js +0 -1
- package/assets/useLayoutTier-DPp2gD1F.js +0 -1
- package/assets/useQueries-BNgXdYau.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r,r as M,q as Pe,af as Ve,B as se,S as Rs,X as De,ag as Is,ah as Ms,ai as mt,o as Os,p as Ls,aj as Us,ak as Hs,al as te,am as zs,an as $s,ao as Bs,f as Ke,ap as qs,a as ns,c as os,aq as Ws,g as he,ar as Gs,l as je,i as ht,as as Ks,at as Ys,au as Qs,av as ve,aw as Ct,L as rt,ax as _t,ay as Zs,az as Me,aA as Ae,aB as Xs,aC as it,d as at,aD as Js,aE as er,aF as Vt,m as ls,aa as tr,aG as sr,aH as rr,aI as cs,aJ as Pt,u as ir,aK as ar,aL as nr,e as or,aM as Dt,aN as lr,T as cr,aO as dr}from"./index-Q7BlLS9p.js";import{A as nt,g as Ft,P as ur,O as fr}from"./OnboardingWizard-B9A2fDSa.js";import{f as Rt,E as mr}from"./ErrorState-BjlNwjgd.js";import{R as hr}from"./row-actions-D3zwQA9I.js";import{S as pr,A as gr}from"./settings-screen-DlzqJ0HQ.js";import{s as $e,b as ds,R as us,u as xr}from"./credential-steps-CtTCRP2k.js";import{u as yr}from"./useSignature-BtR5UuiQ.js";import{c as vr,a as It,d as br}from"./account-form-helpers-DhckT_PN.js";import{C as Sr}from"./confirm-dialog-DtOnF5MV.js";import{D as jr}from"./download-BKDG5QA1.js";import{a as wr}from"./help-copy-z6sn-HSk.js";import"./checkbox-CJ4cnZfk.js";import"./kbd-Bxe2zQGe.js";import"./file-json-D8vlo3ob.js";import"./avatar-_Iz-lpCN.js";import"./menu-BzT426Ih.js";import"./circle-help-BT_Dohsy.js";import"./card-BPN5dp6F.js";const Nr={Mail:"Mail already in Remit stays, and you can keep reading it.",Calendar:"Events already in Remit stay on your calendar."},Ar={Mail:"New mail stops arriving until you turn it back on.",Calendar:"Changes stop arriving until you turn it back on."},Tr={Mail:"mail",Calendar:"calendar"};function kr(e,s){const t=Tr[e.service];return e.kind==="enable"?{title:`Sign in with ${s} to add ${t}?`,description:`This account was never asked for ${t} access. Remit sends you to ${s} to ask for it, and brings you back here when you are done. Nothing changes until you get back.`,confirmLabel:`Continue to ${s}`,cancelLabel:"Cancel",destructive:!1}:e.kind==="last"?{title:`${e.service} is the only thing this account syncs`,description:`An account has to sync something. To stop this one entirely, remove the account — that deletes what Remit stored for it, which switching ${t} off never does.`,confirmLabel:"Remove account",cancelLabel:`Keep syncing ${t}`,destructive:!0}:{title:`Stop syncing ${t} for this account?`,description:`${Nr[e.service]} ${Ar[e.service]} Nothing is deleted.`,confirmLabel:`Stop syncing ${t}`,cancelLabel:"Cancel",destructive:!1}}function Er({change:e,providerName:s,onConfirm:t,onCancel:a,isBusy:n}){if(e===null)return null;const c=kr(e,s);return r.jsx(Sr,{isOpen:!0,title:c.title,description:c.description,confirmLabel:c.confirmLabel,cancelLabel:c.cancelLabel,destructive:c.destructive,isBusy:n??!1,onConfirm:t,onCancel:a})}function Cr({checked:e,label:s,describedBy:t,disabled:a,onToggle:n}){return r.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":s,"aria-describedby":t,disabled:a,onClick:n,className:Pe("relative inline-flex h-6 w-11 shrink-0 items-center rounded-full border transition-colors","outline-none disabled:cursor-not-allowed disabled:opacity-60 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface",e?"border-positive bg-positive":"border-line-strong bg-surface-sunken"),children:r.jsx("span",{"aria-hidden":!0,className:Pe("size-4 rounded-full bg-canvas transition-transform",e?"translate-x-6":"translate-x-1")})})}function _r({providerName:e,offered:s,enabled:t,consented:a,disabled:n=!1,onRequestChange:c}){const o=M.useId(),u=nt.filter(b=>s.includes(b.id));return u.length<2?null:r.jsxs("fieldset",{children:[r.jsx("legend",{className:"text-sm font-semibold text-fg",children:"What this account syncs"}),r.jsx("div",{className:"mt-1 divide-y divide-line",children:u.map(b=>{const w=t.includes(b.id),T=`${o}-${b.id}`,_=!w&&!a.includes(b.id);return r.jsxs("div",{className:"flex min-h-11 items-center gap-3 py-2 text-left",children:[r.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[r.jsx("span",{className:"text-sm text-fg",children:b.label}),r.jsx("span",{id:T,className:"text-xs text-fg-subtle",children:_?`${b.description} Turning this on means signing in with ${e} again.`:b.description})]}),r.jsx(Cr,{checked:w,label:`Sync ${b.label.toLowerCase()}`,describedBy:T,disabled:n,onToggle:()=>c(b.id,w?"off":"on")})]},b.id)})})]})}const Vr=e=>{const s=new Set(e.map(Is));return Ms.map(t=>t.tag).filter(t=>!s.has(t)).sort((t,a)=>Ve(t).localeCompare(Ve(a)))},Pr=({value:e,onChange:s,busy:t=!1})=>{const a=Vr(e);return r.jsxs("div",{className:"space-y-2","data-testid":"compose-language-setting",children:[r.jsx("ul",{className:"space-y-1",children:e.map((n,c)=>r.jsxs("li",{"data-testid":`compose-language-row-${n}`,className:"flex items-center gap-2 rounded-md border border-line bg-surface-sunken px-3 py-1.5",children:[r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm text-fg",lang:n,children:Ve(n)}),c===0?r.jsx("span",{className:"shrink-0 text-2xs uppercase tracking-wider text-fg-subtle",children:"Default"}):r.jsx(se,{variant:"ghost",size:"sm",icon:r.jsx(Rs,{className:"size-3.5"}),disabled:t,"aria-label":`Write new messages in ${Ve(n)} by default`,onClick:()=>s([n,...e.filter(o=>o!==n)]),children:"Default"}),r.jsx(se,{variant:"ghost",size:"sm",icon:r.jsx(De,{className:"size-3.5"}),disabled:t||e.length===1,"aria-label":`Remove ${Ve(n)}`,onClick:()=>s(e.filter(o=>o!==n))})]},n))}),r.jsxs("select",{"aria-label":"Add a language",value:"",disabled:t||a.length===0,onChange:n=>{n.target.value!==""&&s([...e,n.target.value])},className:"w-full rounded-md border border-line bg-surface-sunken px-3 py-2 text-sm text-fg outline-none transition-colors focus-within:border-line-strong focus-within:ring-2 focus-within:ring-ring/30",children:[r.jsx("option",{value:"",children:"Add a language…"}),a.map(n=>r.jsx("option",{value:n,children:Ve(n)},n))]}),r.jsx("p",{className:"text-xs text-fg-muted",children:"A message is tagged with the language you write it in, picked from this list. Your browser, not this app, decides which dictionaries it spellchecks against — add the language there too to get its underlines."})]})};function Dr({title:e,description:s,action:t}){return r.jsxs("div",{className:"rounded-sm border border-danger/50",children:[r.jsxs("div",{className:"flex items-center gap-2 border-b border-danger/30 bg-danger-soft px-row-inset py-2",children:[r.jsx(mt,{className:"size-4 text-danger"}),r.jsx("h2",{className:"text-sm font-semibold text-danger",children:"Danger zone"})]}),r.jsxs("div",{className:"flex flex-col gap-3 px-row-inset py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-sm font-medium text-fg",children:e}),r.jsx("p",{className:"text-xs text-fg-muted",children:s})]}),r.jsx("div",{className:"shrink-0",children:t})]})]})}function Mt({isOpen:e,onClose:s,title:t,children:a,footer:n}){Os({id:"slide-panel",open:e,answers:{back:s}});const c=M.useRef(null);return Ls(c,e),r.jsxs(r.Fragment,{children:[r.jsx("div",{className:Pe("fixed inset-0 z-40 bg-black/30 transition-opacity",e?"opacity-100":"pointer-events-none opacity-0"),onClick:s,"aria-hidden":"true"}),r.jsxs("div",{ref:c,className:Pe("safe-area-frame fixed top-0 right-0 z-50 flex h-full w-full flex-col border-l border-line bg-canvas shadow-xl sm:w-[400px] sm:max-w-[90vw]","transform transition-transform duration-200 ease-out",e?"translate-x-0":"pointer-events-none translate-x-full"),role:"dialog","aria-modal":"true","aria-hidden":!e,inert:!e,"aria-labelledby":"slide-panel-title",tabIndex:-1,children:[r.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between border-b border-line px-4",children:[r.jsx("h2",{id:"slide-panel-title",className:"font-semibold",children:t}),r.jsx("button",{type:"button",onClick:s,className:"rounded-md p-1.5 transition-colors hover:bg-surface-raised","aria-label":"Close",children:r.jsx(De,{className:"size-5"})})]}),r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[r.jsx("div",{className:"flex-1 overflow-auto p-4",children:a}),n&&r.jsx("div",{className:"flex justify-end gap-3 border-t border-line bg-canvas p-4",children:n})]})]})]})}function Ot(e){return Us(Hs,e)}var Ue=e=>e.type==="checkbox",we=e=>e instanceof Date,Q=e=>e==null;const pt=e=>typeof e=="object";var z=e=>!Q(e)&&!Array.isArray(e)&&pt(e)&&!we(e),Fr=e=>z(e)&&e.target?Ue(e.target)?e.target.checked:e.target.value:e,Rr=(e,s)=>s.split(".").some((t,a,n)=>!isNaN(Number(t))&&e.has(n.slice(0,a).join("."))),fs=e=>{const s=e.constructor&&e.constructor.prototype;return z(s)&&s.hasOwnProperty("isPrototypeOf")},Ye=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function B(e){if(e instanceof Date)return new Date(e);const s=typeof FileList<"u"&&e instanceof FileList;if(Ye&&(e instanceof Blob||s))return e;const t=Array.isArray(e);if(!t&&!(z(e)&&fs(e)))return e;const a=t?[]:Object.create(Object.getPrototypeOf(e));for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=B(e[n]));return a}const Ce={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},ue={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},de={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},ms="root",gt=["__proto__","constructor","prototype"],Ir=/^\w*$/;var He=e=>Ir.test(e),L=e=>e===void 0;const Mr=/[.[\]'"]/;var Qe=e=>e.split(Mr).filter(Boolean),y=(e,s,t)=>{if(!s||!z(e))return t;const a=He(s)?[s]:Qe(s);if(a.some(c=>gt.includes(c)))return t;const n=a.reduce((c,o)=>Q(c)?void 0:c[o],e);return L(n)||n===e?L(e[s])?t:e[s]:n},fe=e=>typeof e=="boolean",le=e=>typeof e=="function",O=(e,s,t)=>{let a=-1;const n=He(s)?[s]:Qe(s),c=n.length,o=c-1;for(;++a<c;){const u=n[a];let b=t;if(a!==o){const w=e[u];b=z(w)||Array.isArray(w)?w:isNaN(+n[a+1])?{}:[]}if(gt.includes(u))return;e[u]=b,e=e[u]}};const Or=te.createContext(null);Or.displayName="HookFormControlContext";var Lr=(e,s,t,a=!0)=>{const n={};for(const c in e)Object.defineProperty(n,c,{get:()=>{const o=c;return s._proxyFormState[o]!==ue.all&&(s._proxyFormState[o]=!a||ue.all),e[o]}});return n};const Ur=Ye?te.useLayoutEffect:te.useEffect;var Z=e=>typeof e=="string",Hr=(e,s,t,a,n)=>Z(e)?(a&&s.watch.add(e),y(t,e,n)):Array.isArray(e)?e.map(c=>(a&&s.watch.add(c),y(t,c))):(a&&(s.watchAll=!0),t),ot=e=>Q(e)||!pt(e);const Lt=(e,s)=>s.length===0&&!Array.isArray(e)&&!fs(e);function me(e,s,t=new WeakMap){if(e===s)return!0;if(ot(e)||ot(s))return Object.is(e,s);if(we(e)&&we(s))return Object.is(e.getTime(),s.getTime());const a=Object.keys(e),n=Object.keys(s);if(a.length!==n.length)return!1;if(Lt(e,a)||Lt(s,n))return Object.is(e,s);if(!a.length&&Array.isArray(e)!==Array.isArray(s))return!1;const c=t.get(e);if(c&&c.has(s))return!0;if(c)c.add(s);else{const o=new WeakSet;o.add(s),t.set(e,o)}for(const o of a){const u=e[o];if(!(o in s))return!1;if(o!=="ref"){const b=s[o];if(we(u)&&we(b)||(z(u)||Array.isArray(u))&&(z(b)||Array.isArray(b))?!me(u,b,t):!Object.is(u,b))return!1}}return!0}var Be=e=>({isOnSubmit:!e||e===ue.onSubmit,isOnBlur:e===ue.onBlur,isOnChange:e===ue.onChange,isOnAll:e===ue.all,isOnTouch:e===ue.onTouched}),et=(e,s,t)=>{if(t)return!1;if(s.watchAll||s.watch.has(e))return!0;for(const a of s.watch)if(e.startsWith(a)&&e.charAt(a.length)===".")return!0;return!1};const Le=(e,s,t,a)=>{for(const n of t||Object.keys(e)){const c=y(e,n);if(c){const{_f:o,...u}=c;if(o){if(o.refs&&o.refs[0]&&s(o.refs[0],n)&&!a)return!0;if(o.ref&&s(o.ref,o.name)&&!a)return!0;if(Le(u,s))break}else if(z(u)&&Le(u,s))break}}};var Ut=(e,s,t)=>{const a=y(e,t),n=Array.isArray(a)?a:[];return O(n,ms,s[t]),O(e,t,n),e},Y=e=>z(e)&&!Object.keys(e).length,xt=e=>e.type==="file",We=e=>{if(!Ye)return!1;const s=e?e.ownerDocument:0;return e instanceof(s&&s.defaultView?s.defaultView.HTMLElement:HTMLElement)},yt=e=>e.type==="radio",Ge=e=>e instanceof RegExp,vt=(e,s,t,a,n)=>s?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[a]:n||!0}}:{};const Ht={value:!1,isValid:!1},zt={value:!0,isValid:!0};var hs=e=>{if(Array.isArray(e)){if(e.length>1){const s=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:s,isValid:!!s.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!L(e[0].attributes.value)?L(e[0].value)||e[0].value===""?zt:{value:e[0].value,isValid:!0}:zt:Ht}return Ht};const $t={isValid:!1,value:null};var ps=e=>Array.isArray(e)?e.reduce((s,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:s,$t):$t;function Bt(e,s,t="validate"){if(Z(e)||Array.isArray(e)&&e.every(Z)||fe(e)&&!e)return{type:t,message:Z(e)?e:"",ref:s}}var _e=e=>z(e)&&!Ge(e)?e:{value:e,message:""},qt=async(e,s,t,a,n,c)=>{const{ref:o,refs:u,required:b,maxLength:w,minLength:T,min:_,max:H,pattern:p,validate:S,name:k,valueAsNumber:A,mount:oe}=e._f,V=y(t,k);if(!oe||s.has(k))return{};const P=u?u[0]:o,C=F=>{if(n&&P.reportValidity){const D=fe(F)?"":F||"";u?u.forEach(R=>R.setCustomValidity(D)):P.setCustomValidity(D),P.reportValidity()}},E={},X=yt(o),W=Ue(o),ae=X||W,re=(A||xt(o))&&L(o.value)&&L(V)||We(o)&&o.value===""||V===""||Array.isArray(V)&&!V.length,ce=vt.bind(null,k,a,E),pe=(F,D,R,$=de.maxLength,K=de.minLength)=>{const G=F?D:R;E[k]={type:F?$:K,message:G,ref:o,...ce(F?$:K,G)}};if(c?!Array.isArray(V)||!V.length:b&&(!ae&&(re||Q(V))||fe(V)&&!V||W&&!hs(u).isValid||X&&!ps(u).isValid)){const{value:F,message:D}=Z(b)?{value:!!b,message:b}:_e(b);if(F&&(E[k]={type:de.required,message:D,ref:P,...ce(de.required,D)},!a))return C(D),E}if(!re&&(!Q(_)||!Q(H))){let F,D;const R=_e(H),$=_e(_);if(!Q(V)&&!isNaN(V)){const K=o.valueAsNumber||V&&+V;Q(R.value)||(F=K>R.value),Q($.value)||(D=K<$.value)}else{const K=o.valueAsDate||new Date(V),G=ie=>new Date(new Date().toDateString()+" "+ie),be=o.type=="time",j=o.type=="week";Z(R.value)&&V&&(F=be?G(V)>G(R.value):j?V>R.value:K>new Date(R.value)),Z($.value)&&V&&(D=be?G(V)<G($.value):j?V<$.value:K<new Date($.value))}if((F||D)&&(pe(!!F,R.message,$.message,de.max,de.min),!a))return C(E[k].message),E}if((w||T)&&!re&&(Z(V)||c&&Array.isArray(V))){const F=_e(w),D=_e(T),R=!Q(F.value)&&V.length>+F.value,$=!Q(D.value)&&V.length<+D.value;if((R||$)&&(pe(R,F.message,D.message),!a))return C(E[k].message),E}if(p&&!re&&Z(V)){const{value:F,message:D}=_e(p);if(Ge(F)&&!V.match(F)&&(E[k]={type:de.pattern,message:D,ref:o,...ce(de.pattern,D)},!a))return C(D),E}if(S){if(le(S)){const F=await S(V,t),D=Bt(F,P);if(D&&(E[k]={...D,...ce(de.validate,D.message)},!a))return C(D.message),E}else if(z(S)){let F={};for(const D in S){if(!Y(F)&&!a)break;const R=Bt(await S[D](V,t),P,D);R&&(F={...R,...ce(D,R.message)},C(R.message),a&&(E[k]=F))}if(!Y(F)&&(E[k]={ref:P,...F},!a))return E}}return C(!0),E},qe=e=>Array.isArray(e)?e:[e],gs=e=>Array.isArray(e)?e.filter(Boolean):[];function zr(e,s){const t=s.slice(0,-1).length;let a=0;for(;a<t;){if(Q(e)){e=void 0;break}e=e[s[a]],a++}return e}function $r(e){for(const s in e)if(e.hasOwnProperty(s)&&!L(e[s]))return!1;return!0}function q(e,s){if(Z(s)&&Object.prototype.hasOwnProperty.call(e,s))return delete e[s],e;const t=Array.isArray(s)?s:He(s)?[s]:Qe(s);if(t.some(o=>gt.includes(String(o))))return e;const a=t.length===1?e:zr(e,t),n=t.length-1,c=t[n];return a&&delete a[c],n!==0&&(z(a)&&Y(a)||Array.isArray(a)&&$r(a))&&q(e,t.slice(0,-1)),e}const xs=e=>{const s={};for(const t of Object.keys(e))if(pt(e[t])&&e[t]!==null&&!we(e[t])){const a=xs(e[t]);for(const n of Object.keys(a))s[`${t}.${n}`]=a[n]}else s[t]=e[t];return s},Br=te.createContext(null);Br.displayName="HookFormContext";var Wt=()=>{let e=[];return{get observers(){return e},next:n=>{for(const c of e)c.next&&c.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(c=>c!==n)}}),unsubscribe:()=>{e=[]}}};function ys(e,s){const t={};for(const a in e)if(e.hasOwnProperty(a)){const n=e[a],c=s[a];if(n&&z(n)&&c){const o=ys(n,c);z(o)&&(t[a]=o)}else e[a]&&(t[a]=c)}return t}var vs=e=>e.type==="select-multiple",qr=e=>yt(e)||Ue(e),tt=e=>We(e)&&e.isConnected,Wr=e=>{for(const s in e)if(le(e[s]))return!0;return!1};function bs(e){return Array.isArray(e)||z(e)&&!Wr(e)}function Ss(e){return!!(e&&"_f"in e)}function js(e){return Array.isArray(e)?!e.some(s=>!L(s)):!Object.keys(e).length}function lt(e,s){Array.isArray(e)?e[s]=void 0:delete e[s]}function ct(e,s={},t){for(const a in e){const n=e[a],c=t&&t[a];bs(n)&&(!Array.isArray(n)||!Ss(c))?(s[a]=Array.isArray(n)?[]:{},ct(n,s[a],c),js(s[a])&<(s,a)):L(n)||(s[a]=!0)}return s}function Te(e,s,t,a){t||(t=ct(s,{},a));for(const n in e){const c=e[n],o=a&&a[n];bs(c)&&(!Array.isArray(c)||!Ss(o))?(L(s)||ot(t[n])?t[n]=ct(c,Array.isArray(c)?[]:{},o):Te(c,Q(s)?{}:s[n],t[n],o),js(t[n])&<(t,n)):me(c,s[n])?lt(t,n):t[n]=!0}return t}var ws=(e,{valueAsNumber:s,valueAsDate:t,setValueAs:a})=>L(e)?e:s?e===""?NaN:e&&+e:t&&Z(e)?new Date(e):a?a(e):e;function Gt(e){const s=e.ref;return xt(s)?s.files:yt(s)?ps(e.refs).value:vs(s)?[...s.selectedOptions].map(({value:t})=>t):Ue(s)?hs(e.refs).value:ws(L(s.value)?e.ref.value:s.value,e)}var Gr=(e,s,t,a)=>{const n={};for(const c of e){const o=y(s,c);o&&O(n,c,o._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:a}},Oe=e=>L(e)?e:Ge(e)?e.source:z(e)?Ge(e.value)?e.value.source:e.value:e;const Kt="AsyncFunction";var Kr=e=>{if(!e||!e.validate)return!1;if(le(e.validate))return e.validate.constructor.name===Kt;if(z(e.validate)){for(const s in e.validate)if(e.validate[s].constructor.name===Kt)return!0}return!1},Yr=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Yt(e,s,t){const a=y(e,t);if(a||He(t))return{error:a,name:t};const n=t.split(".");for(;n.length;){const c=n.join("."),o=y(s,c),u=y(e,c);if(o&&!Array.isArray(o)&&t!==c)return{name:t};if(u&&u.type)return{name:c,error:u};if(u&&u.root&&u.root.type)return{name:`${c}.root`,error:u.root};n.pop()}return{name:t}}var Qr=(e,s,t,a)=>{t(e);const{name:n,...c}=e,o=Object.keys(c);return!o.length||a&&o.length>=Object.keys(s).length||o.find(u=>s[u]===(!a||ue.all))},Zr=(e,s,t)=>!e||!s||e===s||qe(e).some(a=>a&&(t?a===s||a.startsWith(s+"."):a.startsWith(s)||s.startsWith(a))),Xr=(e,s,t,a,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(s||e):(t?a.isOnBlur:n.isOnBlur)?!e:(t?a.isOnChange:n.isOnChange)?e:!0,Jr=(e,s)=>!gs(y(e,s)).length&&q(e,s);const ei={mode:ue.onSubmit,reValidateMode:ue.onChange,shouldFocusError:!0},st="form",Ns={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function ti(e={}){let s={...ei,...e},t={...B(Ns),isLoading:le(s.defaultValues),errors:s.errors||{},disabled:s.disabled||!1},a={},n=z(s.defaultValues)||z(s.values)?B(s.defaultValues||s.values)||{}:{},c=s.shouldUnregister?{}:B(n),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set};const b={},w={};let T=0,_=Be(s.mode),H=Be(s.reValidateMode);const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},S={...p};let k={...S};const A={array:Wt(),state:Wt()};let oe=0;const V=s.criteriaMode===ue.all,P=(i,l)=>d=>{clearTimeout(w[i]),w[i]=setTimeout(l,d)},C=async i=>{if(!o.keepIsValid&&!s.disabled&&(S.isValid||k.isValid||i)){const l=++oe;let d;s.resolver?(d=Y((await R()).errors),l===oe&&E()):d=await G({fields:a,onlyCheckValid:!0,eventType:Ce.VALID}),l===oe&&d!==t.isValid&&A.state.next({isValid:d})}},E=(i,l)=>{!s.disabled&&(S.isValidating||S.validatingFields||k.isValidating||k.validatingFields)&&((i||Array.from(u.mount)).forEach(d=>{d&&(l?O(t.validatingFields,d,l):q(t.validatingFields,d))}),A.state.next({validatingFields:t.validatingFields,isValidating:!Y(t.validatingFields)}))},X=()=>{t.dirtyFields=Te(n,c,void 0,a)},W=(i,l=[],d,f,m=!0,x=!0)=>{if(f&&d&&!s.disabled){if(o.action=!0,x&&Array.isArray(y(a,i))){const g=d(y(a,i),f.argA,f.argB);m&&O(a,i,g)}if(x&&Array.isArray(y(t.errors,i))){const g=d(y(t.errors,i),f.argA,f.argB);m&&O(t.errors,i,g),Jr(t.errors,i)}if((S.touchedFields||k.touchedFields)&&x&&Array.isArray(y(t.touchedFields,i))){const g=d(y(t.touchedFields,i),f.argA,f.argB);m&&O(t.touchedFields,i,g)}(S.dirtyFields||k.dirtyFields)&&X(),A.state.next({name:i,isDirty:j(i,l),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else O(c,i,l)},ae=(i,l)=>{O(t.errors,i,l),t.errors={...t.errors},A.state.next({errors:t.errors})},re=i=>{t.errors=i,A.state.next({errors:t.errors,isValid:!1})},ce=i=>{const l=He(i)?[i]:Qe(i);let d=c,f=n;for(let m=0;m<l.length-1;m++){const x=l[m];if(d=Q(d)?d:d[x],f=Q(f)?f:f[x],d===null&&f!==null)return!0}return!1},pe=(i,l,d,f)=>{const m=y(a,i);if(m){if(ce(i))return;const x=L(y(c,i)),g=y(c,i,L(d)?y(n,i):d);L(g)||f&&f.defaultChecked||l?O(c,i,l?g:Gt(m._f)):Ne(i,g),o.mount&&!o.action&&(C(),x&&t.isDirty&&(S.isDirty||k.isDirty)&&(j()||(t.isDirty=!1,A.state.next({...t}))),e.shouldUnregister&&x&&!L(y(c,i))&&et(i,u)&&(o.watch=!0))}},F=(i,l,d,f,m)=>{let x=!1,g=!1;const v={name:i};if(!s.disabled||f===!0){if(!d||f){const N=me(y(n,i),l);(S.isDirty||k.isDirty)&&(g=t.isDirty,t.isDirty=v.isDirty=!N||j(),x=g!==v.isDirty),g=!!y(t.dirtyFields,i),N!==t.isDirty?t.dirtyFields=Te(n,c,void 0,a):N?q(t.dirtyFields,i):O(t.dirtyFields,i,!0),v.dirtyFields=t.dirtyFields,x=x||(S.dirtyFields||k.dirtyFields)&&g!==!N}if(d){const N=y(t.touchedFields,i);N||(O(t.touchedFields,i,d),v.touchedFields=t.touchedFields,x=x||(S.touchedFields||k.touchedFields)&&N!==d)}x&&m&&A.state.next(v)}return x?v:{}},D=(i,l,d,f)=>{const m=y(t.errors,i),x=(S.isValid||k.isValid)&&fe(l)&&t.isValid!==l;if(s.delayError&&d?(b[i]=P(i,()=>ae(i,d)),b[i](s.delayError)):(clearTimeout(w[i]),delete b[i],d?O(t.errors,i,d):q(t.errors,i),t.errors={...t.errors}),(d?!me(m,d):m)||!Y(f)||x){const g={...f,...x&&fe(l)?{isValid:l}:{},errors:t.errors,name:i};t={...t,...g},A.state.next(g)}},R=async i=>(E(i,!0),await s.resolver(c,s.context,Gr(i||u.mount,a,s.criteriaMode,s.shouldUseNativeValidation))),$=async i=>{const{errors:l}=await R(i);if(E(i),i){for(const d of i){const f=y(l,d);f?u.array.has(d)&&z(f)&&!Object.keys(f).some(m=>!Number.isNaN(Number(m)))?Ut(t.errors,{[d]:f},d):O(t.errors,d,f):q(t.errors,d)}t.errors={...t.errors}}else t.errors=l;return l},K=async({name:i,eventType:l})=>{if(e.validate){const d=await e.validate({formValues:c,formState:t,name:i,eventType:l});if(z(d))for(const f in d){const m=d[f];m&&ze(`${st}.${f}`,{message:Z(m.message)?m.message:"",type:m.type||de.validate})}else Z(d)||!d?ze(st,{message:d||"",type:de.validate}):St(st);return d}return!0},G=async({fields:i,onlyCheckValid:l,name:d,eventType:f,context:m={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(m.runRootValidation=!0,!await K({name:d,eventType:f})&&(m.valid=!1,l)))return m.valid;for(const x in i){const g=i[x];if(g){const{_f:v,...N}=g;if(v){const U=u.array.has(v.name),ee=g._f&&Kr(g._f),xe=S.validatingFields||S.isValidating||k.validatingFields||k.isValidating;ee&&xe&&E([v.name],!0);const ye=await qt(g,u.disabled,c,V,s.shouldUseNativeValidation&&!l,U);if(ee&&xe&&E([v.name]),ye[v.name]&&(m.valid=!1,l)||(!l&&(y(ye,v.name)?U?Ut(t.errors,ye,v.name):O(t.errors,v.name,ye[v.name]):q(t.errors,v.name)),e.shouldUseNativeValidation&&ye[v.name]))break}!Y(N)&&await G({context:m,onlyCheckValid:l,fields:N,name:x,eventType:f})}}return m.valid},be=()=>{for(const i of u.unMount){const l=y(a,i);l&&(l._f.refs?l._f.refs.every(d=>!tt(d)):!tt(l._f.ref))&&Ze(i)}u.unMount=new Set},j=(i,l)=>(i&&l&&O(c,i,l),!me(o.mount?c:n,n)),ie=(i,l,d)=>Hr(i,u,{...o.mount?c:L(l)?n:Z(i)?{[i]:l}:l},d,l),ke=i=>gs(y(o.mount?c:n,i,s.shouldUnregister?y(n,i,[]):[])),Ne=(i,l,d={},f=!1,m=!1)=>{const x=y(a,i);let g=l;if(x){const v=x._f;v&&(!v.disabled&&O(c,i,ws(l,v)),g=We(v.ref)&&Q(l)?"":l,vs(v.ref)?[...v.ref.options].forEach(N=>N.selected=g.includes(N.value)):v.refs?Ue(v.ref)?v.refs.forEach(N=>{(!N.defaultChecked||!N.disabled)&&(Array.isArray(g)?N.checked=!!g.find(U=>U===N.value):N.checked=g===N.value||!!g)}):v.refs.forEach(N=>N.checked=N.value===g):xt(v.ref)?v.ref.value="":(v.ref.value=g,!v.ref.type&&!m&&A.state.next({name:i,values:f?c:B(c)})))}(d.shouldDirty||d.shouldTouch)&&F(i,g,d.shouldTouch,d.shouldDirty,!m),d.shouldValidate&&Ee(i,{delayError:d.delayError})},h=(i,l,d,f=!1,m=!1)=>{for(const x in l){if(!l.hasOwnProperty(x))return;const g=l[x],v=i+"."+x,N=y(a,v);(u.array.has(i)||z(g)||N&&!N._f)&&!we(g)?h(v,g,d,f,m):Ne(v,g,d,f,m)}},I=(i,l,d,f,m=!1)=>{const x=y(a,i),g=u.array.has(i),v=f?l:B(l),N=y(c,i),U=me(N,v);if(U||O(c,i,v),g)A.array.next({name:i,values:f?c:B(c)}),(S.isDirty||S.dirtyFields||k.isDirty||k.dirtyFields)&&d.shouldDirty&&(X(),m||A.state.next({name:i,dirtyFields:t.dirtyFields,isDirty:j(i,v)}));else{const ee=Array.isArray(v)&&!v.length||Y(v);!x||x._f||Q(v)||ee?Ne(i,v,d,f,m):h(i,v,d,f,m)}if(!U&&!m){const ee=et(i,u),xe=f?c:B(c);A.state.next({...ee&&t,name:o.mount||ee?i:void 0,values:xe})}},J=(i,l,d={})=>I(i,l,d,!1),ne=(i,l={})=>{const d=le(i)?i(c):i;if(!me(c,d)){c={...c,...d};const f=xs(d);for(const m of u.mount)m in f&&I(m,f[m],l,!0,!0);A.state.next({...t,name:void 0,type:void 0,...T?{values:c}:{}}),l.shouldValidate&&C()}},ge=async i=>{o.mount=!0;const l=i.target;let d=l.name,f=!0;const m=y(a,d),x=g=>{f=Number.isNaN(g)||we(g)&&isNaN(g.getTime())||me(g,y(c,d,g))};if(m){let g,v;const N=l.type?Gt(m._f):Fr(i),U=i.type===Ce.BLUR||i.type===Ce.FOCUS_OUT,ee=!Yr(m._f)&&!e.validate&&!s.resolver&&!y(t.errors,d)&&!m._f.deps,xe=ee||Xr(U,y(t.touchedFields,d),t.isSubmitted,H,_),ye=et(d,u,U);if(O(c,d,N),U){if(!l||!l.readOnly){m._f.onBlur&&m._f.onBlur(i);const Ie=b[d];Ie&&Ie(0)}}else m._f.onChange&&m._f.onChange(i);const Re=F(d,N,U),Ds=!Y(Re)||ye;if(!U&&A.state.next({name:d,type:i.type,...T?{values:B(c)}:{}}),xe)return(!ee||!t.isValid)&&(S.isValid||k.isValid)&&(s.mode==="onBlur"?U&&C():U||C()),Ds&&A.state.next({name:d,...ye?{}:Re});if(!s.resolver&&e.validate&&await K({name:d,eventType:i.type}),!U&&ye&&A.state.next({...t}),s.resolver){const{errors:Ie}=await R([d]);if(E([d]),x(N),!f){!Y(Re)&&A.state.next(Re);return}const Fs=Yt(t.errors,a,d),Et=Yt(Ie,a,Fs.name||d);g=Et.error,d=Et.name,v=Y(Ie)}else E([d],!0),g=(await qt(m,u.disabled,c,V,s.shouldUseNativeValidation))[d],E([d]),x(N),f&&(g?v=!1:(S.isValid||k.isValid)&&(v=await G({fields:a,onlyCheckValid:!0,name:d,eventType:i.type})));f&&(m._f.deps&&(!Array.isArray(m._f.deps)||m._f.deps.length>0)&&Ee(m._f.deps),D(d,v,g,Re))}},Se=(i,l)=>{if(y(t.errors,l)&&i.focus)return i.focus(),1},Ee=async(i,l={})=>{let d,f;const m=qe(i);if(s.resolver){const x=await $(L(i)?i:m);d=Y(x),f=i?!m.some(g=>y(x,g)):d}else i?(f=(await Promise.all(m.map(async x=>{const g=y(a,x);return await G({fields:g&&g._f?{[x]:g}:g,eventType:Ce.TRIGGER})}))).every(Boolean),!(!f&&!t.isValid)&&C()):f=d=await G({fields:a,name:i,eventType:Ce.TRIGGER});if(l.delayError&&s.delayError&&Z(i)){const x=y(t.errors,i);x?(q(t.errors,i),b[i]=P(i,()=>ae(i,x)),b[i](s.delayError)):(clearTimeout(w[i]),delete b[i])}return A.state.next({...!Z(i)||(S.isValid||k.isValid)&&d!==t.isValid?{}:{name:i},...s.resolver||!i?{isValid:d}:{},errors:t.errors}),l.shouldFocus&&!f&&Le(a,Se,i?m:u.mount),f},Fe=(i,l)=>{let d={...o.mount?c:n};return l&&(d=ys(l.dirtyFields?t.dirtyFields:t.touchedFields,d)),L(i)?d:Z(i)?y(d,i):i.map(f=>y(d,f))},bt=(i,l)=>({invalid:!!y((l||t).errors,i),isDirty:!!y((l||t).dirtyFields,i),error:y((l||t).errors,i),isValidating:!!y(t.validatingFields,i),isTouched:!!y((l||t).touchedFields,i)}),St=i=>{const l=i?qe(i):void 0;l?.forEach(d=>q(t.errors,d)),l?l.forEach(d=>{A.state.next({name:d,errors:t.errors})}):A.state.next({errors:{}})},ze=(i,l,d)=>{const f=(y(a,i,{_f:{}})._f||{}).ref,m=y(t.errors,i)||{},{ref:x,message:g,type:v,...N}=m;O(t.errors,i,{...N,...l,ref:f}),A.state.next({name:i,errors:t.errors,isValid:!1}),d&&d.shouldFocus&&f&&f.focus&&f.focus()},ks=(i,l)=>{if(le(i)){T++;const{unsubscribe:d}=A.state.subscribe({next:m=>"values"in m&&i(m.values||ie(void 0,l),m)});let f=!1;return{unsubscribe:()=>{f||(f=!0,T--,d())}}}return ie(i,l,!0)},jt=i=>{var l;const d=!!(!((l=i.formState)===null||l===void 0)&&l.values);d&&T++;const{unsubscribe:f}=A.state.subscribe({next:x=>{if(Zr(i.name,x.name,i.exact)&&Qr(x,i.formState||S,Ps,i.reRenderRoot)){const g={...c};i.callback({values:g,...t,...x,defaultValues:n})}}});if(!d)return f;let m=!1;return()=>{m||(m=!0,T--,f())}},Es=i=>(o.mount=!0,k={...k,...i.formState},jt({...i,formState:{...p,...i.formState}})),Ze=(i,l={})=>{for(const d of i?qe(i):u.mount)u.mount.delete(d),u.array.delete(d),l.keepValue||(q(a,d),q(c,d)),!l.keepError&&q(t.errors,d),!l.keepDirty&&q(t.dirtyFields,d),!l.keepTouched&&q(t.touchedFields,d),!l.keepIsValidating&&q(t.validatingFields,d),!s.shouldUnregister&&!l.keepDefaultValue&&q(n,d);A.state.next({values:B(c)}),A.state.next({...t,...l.keepDirty?{isDirty:j()}:{}}),!l.keepIsValid&&C()},wt=({disabled:i,name:l})=>{if(fe(i)&&o.mount||i||u.disabled.has(l)){const m=u.disabled.has(l)!==!!i;i?u.disabled.add(l):u.disabled.delete(l),m&&o.mount&&!o.action&&C()}},Xe=(i,l={})=>{let d=y(a,i);const f=fe(l.disabled)||fe(s.disabled),m=!u.registerName.has(i)&&d&&d._f&&!d._f.mount;return O(a,i,{...d||{},_f:{...d&&d._f?d._f:{ref:{name:i}},name:i,mount:!0,...l}}),u.mount.add(i),d&&!m?wt({disabled:fe(l.disabled)?l.disabled:s.disabled,name:i}):pe(i,!0,l.value),{...f?{disabled:l.disabled||s.disabled}:{},...s.progressive?{required:!!l.required,min:Oe(l.min),max:Oe(l.max),minLength:Oe(l.minLength),maxLength:Oe(l.maxLength),pattern:Oe(l.pattern)}:{},name:i,onChange:ge,onBlur:ge,ref:x=>{if(x){u.registerName.add(i),Xe(i,l),u.registerName.delete(i),d=y(a,i);const g=L(x.value)&&x.querySelectorAll&&x.querySelectorAll("input,select,textarea")[0]||x,v=qr(g),N=d._f.refs||[];if(v?N.find(U=>U===g):g===d._f.ref)return;O(a,i,{_f:{...d._f,...v?{refs:[...N.filter(tt),g,...Array.isArray(y(n,i))?[{}]:[]],ref:{type:g.type,name:i}}:{ref:g}}}),pe(i,!1,void 0,g)}else d=y(a,i,{}),d._f&&(d._f.mount=!1),(s.shouldUnregister||l.shouldUnregister)&&!(Rr(u.array,i)&&o.action)&&u.unMount.add(i)}}},Je=()=>s.shouldFocusError&&!s.shouldUseNativeValidation&&Le(a,Se,u.mount),Cs=i=>{fe(i)&&(A.state.next({disabled:i}),Le(a,(l,d)=>{const f=y(a,d);f&&(l.disabled=f._f.disabled||i,Array.isArray(f._f.refs)&&f._f.refs.forEach(m=>{m.disabled=f._f.disabled||i}))},0,!1))},Nt=(i,l)=>async d=>{let f;d&&(d.preventDefault&&d.preventDefault(),d.persist&&d.persist());let m=B(c);if(A.state.next({isSubmitting:!0}),s.resolver){const{errors:x,values:g}=await R();E(),t.errors=x,m=B(g)}else await G({fields:a,eventType:Ce.SUBMIT});if(u.disabled.size)for(const x of u.disabled)q(m,x);if(q(t.errors,ms),Y(t.errors)){A.state.next({errors:{}});try{await i(m,d)}catch(x){f=x}}else l&&await l({...t.errors},d),Je(),setTimeout(Je);if(A.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Y(t.errors)&&!f,submitCount:t.submitCount+1,errors:t.errors}),f)throw f},_s=(i,l={})=>{y(a,i)&&(L(l.defaultValue)?J(i,B(y(n,i))):(J(i,l.defaultValue),O(n,i,B(l.defaultValue))),l.keepTouched||q(t.touchedFields,i),l.keepDirty||(q(t.dirtyFields,i),t.isDirty=l.defaultValue?j(i,B(y(n,i))):j()),l.keepError||(q(t.errors,i),S.isValid&&C()),A.state.next({...t}))},At=(i,l={})=>{const d=i?B(i):n,f=B(d),m=Y(i),x=f,g=a;if(l.keepDefaultValues||(n=d),!l.keepValues){if(l.keepDirtyValues){const v=new Set([...u.mount,...Object.keys(Te(n,c,void 0,g))]);for(const N of Array.from(v)){const U=y(t.dirtyFields,N),ee=y(c,N),xe=y(x,N);U&&!L(ee)?O(x,N,ee):!U&&!L(xe)&&J(N,xe)}}else{if(Ye&&L(i))for(const v of u.mount){const N=y(a,v);if(N&&N._f){const U=Array.isArray(N._f.refs)?N._f.refs[0]:N._f.ref;if(We(U)){const ee=U.closest("form");if(ee){ee.reset();break}}}}if(l.keepFieldsRef)for(const v of u.mount)J(v,y(x,v));else a={}}if(s.shouldUnregister){if(c=l.keepDefaultValues?B(n):{},l.keepFieldsRef)for(const v of u.mount)O(c,v,y(x,v))}else c=B(x);A.array.next({values:{...x}}),A.state.next({name:void 0,type:void 0,values:{...x}})}u={mount:l.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!S.isValid||!!l.keepIsValid||!!l.keepDirtyValues||!s.shouldUnregister&&!Y(x),o.watch=!!s.shouldUnregister,o.keepIsValid=!!l.keepIsValid,o.action=!1,l.keepErrors||(t.errors={}),A.state.next({submitCount:l.keepSubmitCount?t.submitCount:0,isDirty:m?!1:l.keepDirty?t.isDirty:l.keepValues?j():!!(l.keepDefaultValues&&!me(i,n)),isSubmitted:l.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:m?{}:l.keepDirtyValues?l.keepDefaultValues&&c?Te(n,c,void 0,g):t.dirtyFields:l.keepDefaultValues&&i?Te(n,i,void 0,g):l.keepDirty?t.dirtyFields:{},touchedFields:l.keepTouched?t.touchedFields:{},errors:l.keepErrors?t.errors:{},isSubmitSuccessful:l.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:n})},Tt=(i,l)=>At(le(i)?i(c):i,{...s.resetOptions,...l}),Vs=(i,l={})=>{const d=y(a,i),f=d&&d._f;if(f){const m=f.refs?f.refs[0]:f.ref;m.focus&&setTimeout(()=>{m.focus(),l.shouldSelect&&le(m.select)&&m.select()})}},Ps=i=>{const{name:l,type:d,values:f,...m}=i;t={...t,...m}},kt={control:{register:Xe,unregister:Ze,getFieldState:bt,handleSubmit:Nt,setError:ze,_subscribe:jt,_runSchema:R,_updateIsValidating:E,_focusError:Je,_getWatch:ie,_getDirty:j,_setValid:C,_setFieldArray:W,_setDisabledField:wt,_setErrors:re,_getFieldArray:ke,_reset:At,_resetDefaultValues:()=>le(s.defaultValues)&&s.defaultValues().then(i=>{Tt(i,s.resetOptions),A.state.next({isLoading:!1})}),_removeUnmounted:be,_disableForm:Cs,_subjects:A,_proxyFormState:S,get _fields(){return a},get _formValues(){return c},get _state(){return o},set _state(i){o=i},get _defaultValues(){return n},get _names(){return u},set _names(i){u=i},get _formState(){return t},get _options(){return s},set _options(i){s={...s,...i},_=Be(s.mode),H=Be(s.reValidateMode)}},subscribe:Es,trigger:Ee,register:Xe,handleSubmit:Nt,watch:ks,setValue:J,setValues:ne,getValues:Fe,reset:Tt,resetField:_s,resetDefaultValues:(i,l={})=>{if(n=B(i),!l.keepDirty){const d=Te(n,c,void 0,a);t.dirtyFields=d,t.isDirty=!Y(d)}l.keepIsValid||C(),A.state.next({...t,defaultValues:n})},clearErrors:St,unregister:Ze,setError:ze,setFocus:Vs,getFieldState:bt};return{...kt,formControl:kt}}function si(e={}){const s=te.useRef(void 0),t=te.useRef(void 0),a=te.useRef(e.formControl),[n,c]=te.useState(()=>({...B(Ns),isLoading:le(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:le(e.defaultValues)?void 0:e.defaultValues}));if(!s.current||e.formControl&&a.current!==e.formControl)if(a.current=e.formControl,e.formControl)s.current={...e.formControl,formState:n},e.defaultValues&&!le(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:u,...b}=ti(e);s.current={...b,formState:n}}const o=s.current.control;return o._options=e,Ur(()=>{const u=o._subscribe({formState:o._proxyFormState,callback:()=>c({...o._formState,defaultValues:o._defaultValues}),reRenderRoot:!0});return c(b=>({...b,isReady:!0})),o._formState.isReady=!0,u},[o]),te.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),te.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),te.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),te.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),te.useEffect(()=>{if(o._proxyFormState.isDirty){const u=o._getDirty();u!==n.isDirty&&o._subjects.state.next({isDirty:u})}},[o,n.isDirty]),te.useEffect(()=>{var u;e.values&&!me(e.values,t.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((u=o._options.resetOptions)===null||u===void 0)&&u.keepIsValid||o._setValid(),t.current=e.values,c(b=>({...b}))):o._resetDefaultValues()},[o,e.values]),te.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),s.current.formState=te.useMemo(()=>Lr(n,o),[o,n]),s.current}const Qt=(e,s,t)=>{if(e&&"reportValidity"in e){const a=y(t,s);e.setCustomValidity(a&&a.message||""),e.reportValidity()}},dt=(e,s)=>{for(const t in s.fields){const a=s.fields[t];a&&a.ref&&"reportValidity"in a.ref?Qt(a.ref,t,e):a&&a.refs&&a.refs.forEach(n=>Qt(n,t,e))}},Zt=(e,s)=>{s.shouldUseNativeValidation&&dt(e,s);const t={};for(const a in e){const n=y(s.fields,a),c=Object.assign(e[a]||{},{ref:n&&n.ref});if(ri(s.names||Object.keys(e),a)){const o=Object.assign({},y(t,a));O(o,"root",c),O(t,a,o)}else O(t,a,c)}return t},ri=(e,s)=>{const t=Xt(s).replace(/[.*+?^${}()|\\]/g,"\\$&");return e.some(a=>Xt(a).match(`^${t}\\.\\d+`))};function Xt(e){return e.replace(/[\[\]]/g,"")}function ut(){return ut=Object.assign?Object.assign.bind():function(e){for(var s=1;s<arguments.length;s++){var t=arguments[s];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},ut.apply(null,arguments)}function Jt(e,s){try{var t=e()}catch(a){return s(a)}return t&&t.then?t.then(void 0,s):t}function ii(e,s){for(var t={};e.length;){var a=e[0],n=a.code,c=a.message,o=a.path.join(".");if(!t[o])if("unionErrors"in a){var u=a.unionErrors[0].errors[0];t[o]={message:u.message,type:u.code}}else t[o]={message:c,type:n};if("unionErrors"in a&&a.unionErrors.forEach(function(T){return T.errors.forEach(function(_){return e.push(_)})}),s){var b=t[o].types,w=b&&b[a.code];t[o]=vt(o,s,t,n,w?[].concat(w,a.message):a.message)}e.shift()}return t}function ai(e,s){for(var t={},a=function(){var n=e[0],c=n.code,o=n.message,u=n.path.join(".");if(!t[u])if(n.code==="invalid_union"&&n.errors.length>0){var b=n.errors[0][0];t[u]={message:b.message,type:b.code}}else t[u]={message:o,type:c};if(n.code==="invalid_union"&&n.errors.forEach(function(_){return _.forEach(function(H){return e.push(ut({},H,{path:[].concat(n.path,H.path)}))})}),s){var w=t[u].types,T=w&&w[n.code];t[u]=vt(u,s,t,c,T?[].concat(T,n.message):n.message)}e.shift()};e.length;)a();return t}function ni(e,s,t){if(t===void 0&&(t={}),(function(a){return"_def"in a&&typeof a._def=="object"&&"typeName"in a._def})(e))return function(a,n,c){try{return Promise.resolve(Jt(function(){return Promise.resolve(e[t.mode==="sync"?"parse":"parseAsync"](a,s)).then(function(o){return c.shouldUseNativeValidation&&dt({},c),{errors:{},values:t.raw?Object.assign({},a):o}})},function(o){if((function(u){return Array.isArray(u?.issues)})(o))return{values:{},errors:Zt(ii(o.errors,!c.shouldUseNativeValidation&&c.criteriaMode==="all"),c)};throw o}))}catch(o){return Promise.reject(o)}};if((function(a){return"_zod"in a&&typeof a._zod=="object"})(e))return function(a,n,c){try{return Promise.resolve(Jt(function(){return Promise.resolve((t.mode==="sync"?zs:$s)(e,a,s)).then(function(o){return c.shouldUseNativeValidation&&dt({},c),{errors:{},values:t.raw?Object.assign({},a):o}})},function(o){if((function(u){return u instanceof Bs})(o))return{values:{},errors:Zt(ai(o.issues,!c.shouldUseNativeValidation&&c.criteriaMode==="all"),c)};throw o}))}catch(o){return Promise.reject(o)}};throw new Error("Invalid input: not a Zod schema")}const oi=e=>{const s=Ke(),{pushError:t}=qs(),{data:a}=ns({...os(),staleTime:1/0}),n=a?.accounts.find(b=>b.accountId===e)?.composeLanguages,c=M.useMemo(()=>n&&n.length>0?[...n]:Ws(navigator.languages),[n]),o=he({...ht(),onSuccess:()=>{s.invalidateQueries({queryKey:je()})},onError:b=>{t(Gs("Couldn't save languages","The writing languages weren't saved.",b))}}),u=M.useCallback(b=>{e&&o.mutate({path:{accountId:e},body:{composeLanguages:b}})},[e,o]);return{languages:c,setLanguages:u,isSaving:o.isPending}},li=e=>e.authType==="oauthMicrosoft",ci=e=>{const s=e.smtpUsername?.trim();return s?s!==e.username:!1},di=Zs({email:Xs(),displayName:Ae().optional(),username:Ae().optional(),password:Ae().optional(),imapHost:Ae().min(1,"IMAP host is required"),imapPort:Ot().int().min(1).max(65535),imapTls:Me(),imapStartTls:Me(),smtpHost:Ae().optional(),smtpPort:Ot().int().min(1).max(65535).optional(),smtpTls:Me().optional(),smtpStartTls:Me().optional(),smtpUsername:Ae().optional(),smtpPassword:Ae().optional(),useDifferentSmtpCreds:Me().optional()}),ui=({isOpen:e,onClose:s,account:t,focusSmtp:a})=>{const n=Ke(),c=!!t,[o,u]=M.useState(""),[b,w]=M.useState(!1),T=Ft(o),_=!!T&&!b,H=M.useRef(null),p=si({resolver:ni(di),defaultValues:{email:"",displayName:"",username:"",password:"",imapHost:"",imapPort:993,imapTls:!0,imapStartTls:!1,smtpHost:"",smtpPort:587,smtpTls:!1,smtpStartTls:!0,useDifferentSmtpCreds:!1}});M.useEffect(()=>{if(t){const h=ci(t);p.reset({email:t.email,displayName:t.displayName||"",username:t.username||"",password:"",imapHost:t.imapHost,imapPort:t.imapPort,imapTls:t.imapTls,imapStartTls:t.imapStartTls,smtpHost:t.smtpHost||"",smtpPort:t.smtpPort||587,smtpTls:t.smtpTls||!1,smtpStartTls:t.smtpStartTls||!0,smtpUsername:h&&t.smtpUsername||"",smtpPassword:"",useDifferentSmtpCreds:h})}else p.reset({email:"",displayName:"",username:"",password:"",imapHost:"",imapPort:993,imapTls:!0,imapStartTls:!1,smtpHost:"",smtpPort:587,smtpTls:!1,smtpStartTls:!0,useDifferentSmtpCreds:!1})},[t,p]);const S=he({...Ks()}),k=he({...Ys(),onSuccess:()=>{n.invalidateQueries({queryKey:je()}),s()}}),A=he({...ht(),onSuccess:()=>{n.invalidateQueries({queryKey:je()}),s()}}),oe=()=>{const h=p.getValues(),I=c&&!h.password;S.mutate({body:{accountId:I?t?.accountId:void 0,username:h.username||h.email,password:I?void 0:h.password||void 0,imapHost:h.imapHost,imapPort:Number(h.imapPort),imapTls:h.imapTls,imapStartTls:h.imapStartTls}})},V=()=>{const h=p.getValues(),I=c&&!h.password;S.mutate({body:{accountId:I?t?.accountId:void 0,username:h.username||h.email,password:I?void 0:h.password||void 0,imapHost:h.imapHost,imapPort:Number(h.imapPort),imapTls:h.imapTls,imapStartTls:h.imapStartTls,smtpHost:h.smtpHost||void 0,smtpPort:h.smtpPort?Number(h.smtpPort):void 0,smtpTls:h.smtpTls,smtpStartTls:h.smtpStartTls,smtpUsername:h.useDifferentSmtpCreds?h.smtpUsername:void 0,smtpPassword:h.useDifferentSmtpCreds?h.smtpPassword:void 0}})},P=p.handleSubmit(h=>{if(!c&&!h.password){p.setError("password",{message:"Password is required"});return}const I=vr({imapHost:h.imapHost,smtpHost:h.smtpHost,smtpPort:h.smtpPort,smtpTls:h.smtpTls,smtpStartTls:h.smtpStartTls});I&&(p.setValue("smtpHost",I.smtpHost),p.setValue("smtpPort",I.smtpPort),p.setValue("smtpTls",I.smtpTls),p.setValue("smtpStartTls",I.smtpStartTls));const J=I?.smtpHost??h.smtpHost,ne=I?.smtpPort??h.smtpPort,ge=I?.smtpTls??h.smtpTls,Se=I?.smtpStartTls??h.smtpStartTls,Ee={email:h.email,displayName:h.displayName?.trim()||void 0,username:h.username||void 0,imapHost:h.imapHost,imapPort:Number(h.imapPort),imapTls:h.imapTls,imapStartTls:h.imapStartTls,smtpHost:J||void 0,smtpPort:ne?Number(ne):void 0,smtpTls:ge,smtpStartTls:Se,smtpUsername:h.useDifferentSmtpCreds&&h.smtpUsername||void 0,smtpPassword:h.useDifferentSmtpCreds&&h.smtpPassword||void 0};if(c&&t){const Fe={...Ee,password:h.password||void 0};A.mutate({path:{accountId:t.accountId},body:Fe})}else{const Fe={...Ee,password:h.password};k.mutate({body:Fe})}}),C=k.isPending||A.isPending,{signature:E,setSignature:X,isSaving:W}=yr(t?.accountId),[ae,re]=M.useState(E.plainText),{languages:ce,setLanguages:pe,isSaving:F}=oi(t?.accountId),D=r.jsxs("section",{children:[r.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider mb-3",children:"Writing languages"}),r.jsx(Pr,{value:ce,onChange:pe,busy:F})]});M.useEffect(()=>{re(E.plainText)},[E.plainText]),M.useEffect(()=>{if(!e||!a)return;const h=H.current;if(!h)return;const I=window.setTimeout(()=>{h.scrollIntoView({behavior:"smooth",block:"start"})},250);return()=>window.clearTimeout(I)},[e,a]);const R=M.useCallback(()=>{ae!==E.plainText&&X(ae,ae)},[ae,E.plainText,X]),$=h=>{const{tls:I,startTls:J}=$e(h);p.setValue("imapTls",I),p.setValue("imapStartTls",J);const ne=p.getValues("imapPort");(ne===993||ne===143)&&p.setValue("imapPort",h==="tls"?993:143)},K=h=>{const{tls:I,startTls:J}=$e(h);p.setValue("smtpTls",I),p.setValue("smtpStartTls",J);const ne=p.getValues("smtpPort");if(ne===465||ne===587||ne===25){const Se=h==="tls"?465:h==="starttls"?587:25;p.setValue("smtpPort",Se)}},G=()=>{const h=p.getValues("imapHost");p.setValue("smtpHost",br(h)),p.setValue("smtpTls",!1),p.setValue("smtpStartTls",!0),p.setValue("smtpPort",587)},be=h=>{u(h),w(!1);const I=Ft(h);if(!I)return;const J=$e(I.imap.security);p.setValue("imapHost",I.imap.host),p.setValue("imapPort",I.imap.port),p.setValue("imapTls",J.tls),p.setValue("imapStartTls",J.startTls);const ne=$e(I.smtp.security);p.setValue("smtpHost",I.smtp.host),p.setValue("smtpPort",I.smtp.port),p.setValue("smtpTls",ne.tls),p.setValue("smtpStartTls",ne.startTls);const ge=p.getValues("email").trim(),Se=p.getValues("username")?.trim();ge&&!Se&&p.setValue("username",ge)},j=T?.passwordHelp.text,ie=It(S.data?.imapError,j),ke=It(S.data?.smtpError,j);return(t?li(t):!1)&&c?r.jsx(Mt,{isOpen:e,onClose:s,title:"Edit Account",footer:r.jsx(se,{type:"button",variant:"secondary",onClick:s,children:"Close"}),children:r.jsxs("div",{className:"space-y-6",children:[r.jsxs("section",{children:[r.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider mb-3",children:"Microsoft 365 Account"}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{className:"rounded-md border border-line bg-surface-sunken px-3 py-2.5 text-sm text-fg-muted",children:[r.jsx("span",{className:"block text-2xs font-medium uppercase tracking-wider text-fg-subtle mb-1",children:"Email"}),r.jsx("span",{className:"text-fg",children:t?.email})]}),r.jsxs("div",{className:"rounded-md border border-line bg-surface-sunken px-3 py-2.5 text-sm text-fg-muted",children:[r.jsx("span",{className:"block text-2xs font-medium uppercase tracking-wider text-fg-subtle mb-1",children:"Authentication"}),r.jsx("span",{className:"text-fg",children:"Microsoft OAuth (XOAUTH2)"})]}),r.jsx("p",{className:"text-xs text-fg-muted",children:"Server settings are managed automatically for Microsoft 365 accounts. To update credentials, use the Reconnect button."})]})]}),c&&r.jsxs("section",{children:[r.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider mb-3",children:"Signature"}),r.jsx("div",{className:"space-y-3",children:r.jsxs("div",{children:[r.jsx("label",{htmlFor:"email-sig-view",className:"text-sm font-medium mb-1.5 block",children:"Email Signature"}),r.jsx("textarea",{id:"email-sig-view",value:ae,onChange:h=>re(h.target.value),onBlur:R,rows:5,className:"w-full px-3 py-2 border border-line rounded-md bg-surface-sunken text-sm text-fg placeholder:text-fg-subtle focus-within:border-line-strong focus-within:ring-2 focus-within:ring-ring/30 transition-colors resize-y outline-none",placeholder:"Enter your email signature..."}),r.jsx("p",{className:"text-xs text-fg-muted mt-1",children:W?"Saving signature...":"This signature will be appended to new emails."})]})})]}),c&&D]})}):r.jsx(Mt,{isOpen:e,onClose:s,title:c?"Edit Account":"Add Account",footer:r.jsxs(r.Fragment,{children:[r.jsx(se,{type:"button",variant:"secondary",onClick:s,children:"Cancel"}),r.jsx(se,{type:"submit",form:"account-form",variant:"primary",disabled:C,children:C?"Saving...":"Save Account"})]}),children:r.jsxs("form",{id:"account-form",onSubmit:P,className:"space-y-6",children:[r.jsxs("section",{children:[r.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider mb-3",children:"Account Information"}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"account-provider",className:"text-sm font-medium mb-1.5 block",children:"Provider"}),r.jsxs(Qs,{id:"account-provider",value:o,onChange:h=>be(h.target.value),children:[r.jsx("option",{value:"",children:"Custom / other"}),ur.map(h=>r.jsx("option",{value:h.id,children:h.label},h.id))]}),r.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"Pick your email provider to fill in server settings automatically, or choose Custom to enter them by hand."})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"account-email",className:"text-sm font-medium mb-1.5 block",children:"Email Address"}),r.jsx(ve,{id:"account-email",...p.register("email"),placeholder:"alice@example.com"}),p.formState.errors.email&&r.jsx("p",{className:"text-sm text-danger mt-1",children:p.formState.errors.email.message})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"account-displayName",className:"text-sm font-medium mb-1.5 block",children:"Display name (optional)"}),r.jsx(ve,{id:"account-displayName",...p.register("displayName"),placeholder:"Alice"}),r.jsx("p",{className:"text-xs text-fg-muted mt-1",children:"What to call this account in Remit. Leave blank to use a name derived from the address."})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"account-username",className:"text-sm font-medium mb-1.5 block",children:"Username"}),r.jsx(ve,{id:"account-username",...p.register("username"),placeholder:"Same as email if empty"})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"account-password",className:"text-sm font-medium mb-1.5 block",children:"Password"}),r.jsx(Ct,{id:"account-password",...p.register("password"),placeholder:c?"Leave empty to keep current":""}),p.formState.errors.password&&r.jsx("p",{className:"text-sm text-danger mt-1",children:p.formState.errors.password.message}),T&&r.jsxs("p",{className:"text-xs text-fg-muted mt-1",children:[T.passwordHelp.text," ",r.jsx("a",{href:T.passwordHelp.url,target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:"Get an app password"})]})]})]})]}),r.jsxs("section",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider",children:"Incoming Mail (IMAP)"}),T&&r.jsx("button",{type:"button",onClick:()=>w(h=>!h),className:"text-xs text-fg-muted hover:text-fg transition-colors",children:b?"Use preset settings":"Advanced"})]}),_&&r.jsxs("p",{className:"text-xs text-fg-muted mb-3",children:["Server settings are pre-filled for ",T?.label," and locked. Choose Advanced to edit them by hand."]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"imap-host",className:"text-sm font-medium mb-1.5 block",children:"Server"}),r.jsx(ve,{id:"imap-host",...p.register("imapHost"),readOnly:_,placeholder:"imap.example.com"}),p.formState.errors.imapHost&&r.jsx("p",{className:"text-sm text-danger mt-1",children:p.formState.errors.imapHost.message})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"imap-port",className:"text-sm font-medium mb-1.5 block",children:"Port"}),r.jsx(ve,{id:"imap-port",...p.register("imapPort"),readOnly:_,type:"number"})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-sm font-medium mb-1.5 block",children:"Security"}),r.jsxs("div",{className:"space-y-1.5 mt-2",children:[r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"radio",disabled:_,checked:p.watch("imapTls"),onChange:()=>$("tls")}),"TLS (Port 993)"]}),r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"radio",disabled:_,checked:!p.watch("imapTls")&&p.watch("imapStartTls"),onChange:()=>$("starttls")}),"STARTTLS (Port 143)"]}),r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"radio",disabled:_,checked:!p.watch("imapTls")&&!p.watch("imapStartTls"),onChange:()=>$("none")}),"None (Unencrypted)"]})]})]})]}),r.jsx(se,{type:"button",variant:"secondary",onClick:oe,disabled:S.isPending,className:"w-full",icon:S.isPending?r.jsx(rt,{className:"size-4 animate-spin"}):void 0,children:S.isPending?"Testing...":"Test IMAP Connection"}),S.data&&r.jsxs("div",{className:Pe("p-2 rounded-md text-sm",S.data.imapSuccess?"bg-positive/10 text-positive":"bg-danger-soft text-danger"),children:[S.data.imapSuccess?r.jsx(_t,{className:"inline size-4 mr-1"}):r.jsx(De,{className:"inline size-4 mr-1"}),S.data.imapSuccess?"IMAP Connected":ie]})]})]}),r.jsxs("section",{ref:H,"data-testid":"smtp-section",children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider",children:"Outgoing Mail (SMTP)"}),!_&&r.jsx("button",{type:"button",onClick:G,disabled:!p.watch("imapHost"),className:"text-xs text-fg-muted hover:text-fg transition-colors disabled:opacity-50",children:"Pre-fill from IMAP"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"smtp-host",className:"text-sm font-medium mb-1.5 block",children:"Server"}),r.jsx(ve,{id:"smtp-host",...p.register("smtpHost"),readOnly:_,placeholder:"smtp.example.com"})]}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"smtp-port",className:"text-sm font-medium mb-1.5 block",children:"Port"}),r.jsx(ve,{id:"smtp-port",...p.register("smtpPort"),readOnly:_,type:"number"})]}),r.jsxs("div",{children:[r.jsx("span",{className:"text-sm font-medium mb-1.5 block",children:"Security"}),r.jsxs("div",{className:"space-y-1.5 mt-2",children:[r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"radio",disabled:_,checked:p.watch("smtpTls")===!0,onChange:()=>K("tls")}),"TLS (Port 465)"]}),r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"radio",disabled:_,checked:!p.watch("smtpTls")&&p.watch("smtpStartTls")===!0,onChange:()=>K("starttls")}),"STARTTLS (Port 587)"]}),r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"radio",disabled:_,checked:!p.watch("smtpTls")&&!p.watch("smtpStartTls"),onChange:()=>K("none")}),"None (Unencrypted)"]})]})]})]}),r.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[r.jsx("input",{type:"checkbox",...p.register("useDifferentSmtpCreds")}),"Use different credentials for SMTP"]}),p.watch("useDifferentSmtpCreds")&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"smtp-username",className:"text-sm font-medium mb-1.5 block",children:"SMTP Username"}),r.jsx(ve,{id:"smtp-username",...p.register("smtpUsername")})]}),r.jsxs("div",{children:[r.jsx("label",{htmlFor:"smtp-password",className:"text-sm font-medium mb-1.5 block",children:"SMTP Password"}),r.jsx(Ct,{id:"smtp-password",...p.register("smtpPassword")})]})]}),r.jsx(se,{type:"button",variant:"secondary",onClick:V,disabled:S.isPending||!p.watch("smtpHost"),className:"w-full",icon:S.isPending?r.jsx(rt,{className:"size-4 animate-spin"}):void 0,children:S.isPending?"Testing...":"Test SMTP Connection"}),S.data?.smtpSuccess!==void 0&&r.jsxs("div",{className:Pe("p-2 rounded-md text-sm",S.data.smtpSuccess?"bg-positive/10 text-positive":"bg-danger-soft text-danger"),children:[S.data.smtpSuccess?r.jsx(_t,{className:"inline size-4 mr-1"}):r.jsx(De,{className:"inline size-4 mr-1"}),S.data.smtpSuccess?"SMTP Connected":ke]})]})]}),c&&r.jsxs("section",{children:[r.jsx("h3",{className:"text-2xs font-semibold text-fg-subtle uppercase tracking-wider mb-3",children:"Signature"}),r.jsx("div",{className:"space-y-3",children:r.jsxs("div",{children:[r.jsx("label",{htmlFor:"email-sig-edit",className:"text-sm font-medium mb-1.5 block",children:"Email Signature"}),r.jsx("textarea",{id:"email-sig-edit",value:ae,onChange:h=>re(h.target.value),onBlur:R,rows:5,className:"w-full px-3 py-2 border border-line rounded-md bg-surface-sunken text-sm text-fg placeholder:text-fg-subtle focus-within:border-line-strong focus-within:ring-2 focus-within:ring-ring/30 transition-colors resize-y outline-none",placeholder:"Enter your email signature..."}),r.jsx("p",{className:"text-xs text-fg-muted mt-1",children:W?"Saving signature...":"This signature will be appended to new emails."})]})})]}),c&&D]})})},fi="https://graph.microsoft.com/",mi={[it.Mail]:["https://outlook.office.com/IMAP.AccessAsUser.All","https://outlook.office.com/SMTP.Send"],[it.Calendar]:[`${fi}Calendars.Read`]},hi=e=>{const s=new Set(e.map(t=>t.toLowerCase()));return Object.values(it).filter(t=>mi[t].every(a=>s.has(a.toLowerCase())))},ft=e=>`Couldn't turn ${e.service.toLowerCase()} ${e.intent}`,pi=e=>Js(er({title:`Bug: ${ft(e)}`,errorMessage:`${ft(e)} — ${e.message}`}));function gi({providerName:e,offered:s,enabled:t,consented:a,disabled:n,refusal:c,onRequestChange:o}){return s.length<2?null:r.jsxs("section",{className:"space-y-2 rounded-sm border border-line bg-surface px-row-inset py-3",children:[r.jsx(_r,{providerName:e,offered:s,enabled:t,consented:a,disabled:n,onRequestChange:o}),c&&r.jsxs(at,{tone:"danger",variant:"soft",children:[r.jsx("p",{className:"font-medium",children:ft(c)}),r.jsx("p",{className:"mt-0.5 break-words text-fg-muted",children:c.message}),r.jsx("a",{href:pi(c),target:"_blank",rel:"noopener noreferrer",className:"mt-1 inline-block font-medium text-accent hover:underline",children:"Report an issue"})]})]})}const As=["Mail","Calendar"],es="Microsoft",ts=e=>e.authType==="oauthMicrosoft",ss=(e,s)=>As.filter(t=>t===s||e.includes(t));function xi({account:e,onRemoveAccount:s}){const t=Ke(),[a,n]=M.useState(null),[c,o]=M.useState(null),[u,b]=M.useState(null),w=he({...ht(),meta:Vt,onSuccess:()=>t.invalidateQueries({queryKey:je()})}),T=he({...ls(),meta:Vt}),_=ds(P=>{const C=u;b(null),!(P!=="stalled"||C===null)&&o({service:C,intent:"on",message:us})}),H=w.isPending&&w.variables?.body.syncedServices?w.variables.body.syncedServices:e.syncedServices,p=ts(e)?As:["Mail"],S=ts(e)?hi(e.grantedScopes):p,k=(P,C,E)=>{o(null),w.mutate({path:{accountId:e.accountId},body:{syncedServices:P}},{onError:X=>o({service:C,intent:E,message:Rt(X)})})},A=P=>{o(null),T.mutate({body:{email:e.email,services:ss(H,P)}},{onSuccess:C=>{b(P),_(),window.location.assign(C.authorizationUrl)},onError:C=>o({service:P,intent:"on",message:Rt(C)})})},oe=(P,C)=>{if(C==="off"){n({kind:H.length===1?"last":"disable",service:P});return}if(!S.includes(P)){n({kind:"enable",service:P});return}k(ss(H,P),P,"on")},V=()=>{const P=a;if(n(null),P!==null){if(P.kind==="last"){s();return}if(P.kind==="enable"){A(P.service);return}k(H.filter(C=>C!==P.service),P.service,"off")}};return r.jsxs(r.Fragment,{children:[r.jsx(gi,{providerName:es,offered:p,enabled:H,consented:S,disabled:w.isPending||T.isPending||u!==null,refusal:c,onRequestChange:oe}),r.jsx(Er,{change:a,providerName:es,onConfirm:V,onCancel:()=>n(null)})]})}function rs({open:e,onClose:s,accountEmail:t,signOut:a}){const[n,c]=M.useState(""),[o,u]=M.useState(!1),[b,w]=M.useState(!1),T=he({...sr(),onSuccess:()=>{w(!0),setTimeout(()=>a(),2e3)}}),_=he(rr()),H=()=>{T.isPending||(c(""),u(!1),w(!1),T.reset(),_.reset(),s())},p=()=>{if(n.trim().toLowerCase()!==t.toLowerCase()){u(!0);return}u(!1),T.mutate({body:{confirmEmail:n.trim()}})};return r.jsxs(cs,{open:e,onClose:H,title:"Delete your Remit account",children:[r.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[r.jsx(mt,{className:"size-4 shrink-0 text-danger"}),r.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:"Delete your Remit account"}),r.jsx(se,{variant:"ghost",size:"sm",icon:r.jsx(De,{className:"size-3.5"}),onClick:H,"aria-label":"Cancel"})]}),b?r.jsxs("div",{className:"px-5 py-6 text-sm text-fg-muted",children:[r.jsx("p",{className:"font-medium text-fg",children:"Account deletion scheduled."}),r.jsx("p",{className:"mt-1",children:"Your data will be erased shortly. Signing you out…"})]}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"space-y-4 px-5 py-4 text-sm text-fg-muted",children:[r.jsx("p",{children:"This permanently erases everything Remit holds for you:"}),r.jsxs("ul",{className:"space-y-1.5 text-xs",children:[r.jsxs("li",{className:"flex gap-2",children:[r.jsx("span",{className:"text-danger",children:"•"}),"All connected accounts disconnected and access tokens revoked."]}),r.jsxs("li",{className:"flex gap-2",children:[r.jsx("span",{className:"text-danger",children:"•"}),"Synced mail cache and search index."]}),r.jsxs("li",{className:"flex gap-2",children:[r.jsx("span",{className:"text-danger",children:"•"}),"AI history and insights."]}),r.jsxs("li",{className:"flex gap-2",children:[r.jsx("span",{className:"text-danger",children:"•"}),"Preferences and rules."]})]}),r.jsxs("div",{className:"rounded-sm border border-line bg-surface-sunken px-3 py-2 text-xs",children:[r.jsx("strong",{className:"text-fg",children:"Your mail at Gmail / IMAP is not deleted."})," ","This only removes Remit's copy and its access — the mail stays in your provider mailboxes."]}),r.jsxs("div",{className:"text-xs",children:[r.jsxs("button",{type:"button",onClick:()=>_.mutate({}),"aria-busy":_.isPending,className:"inline-flex items-center gap-1.5 font-medium text-accent hover:underline",children:[r.jsx(jr,{className:"size-3.5"}),_.isPending?"Requesting export…":"Export my data first"]}),_.isSuccess&&r.jsx("p",{className:"mt-1.5 text-fg-muted",role:"status",children:"Export requested. We'll prepare a ZIP of your mail — find it under your data exports when it's ready."}),_.isError&&r.jsx("p",{className:"mt-1.5 text-danger",role:"alert",children:"Couldn't start the export. Please try again."})]}),r.jsxs("div",{children:[r.jsxs("label",{htmlFor:"confirm-remit-email",className:"mb-1 block text-xs font-medium text-fg",children:["Type"," ",r.jsx("span",{className:"font-mono text-fg-muted",children:t})," ","to confirm"]}),r.jsx(ve,{id:"confirm-remit-email",type:"email",placeholder:t,value:n,onChange:S=>{c(S.target.value),o&&u(!1),T.isError&&T.reset()},autoComplete:"off"}),o&&r.jsx("p",{className:"mt-1.5 text-xs text-danger",role:"alert",children:"That doesn't match your account email. Type it exactly to confirm."}),T.isError&&r.jsx("p",{className:"mt-1.5 text-xs text-danger",role:"alert",children:T.error instanceof Error?T.error.message:"Something went wrong. Please try again."})]})]}),r.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[r.jsx(se,{variant:"secondary",size:"sm",onClick:H,children:"Cancel"}),r.jsx(se,{variant:"danger",size:"sm",onClick:p,"aria-busy":T.isPending,children:T.isPending?"Deleting…":"Delete everything"})]})]})]})}function yi(e){const{Account:s}=tr();return r.jsx(s,{fallback:r.jsx(rs,{...e,accountEmail:"",signOut:()=>{}}),children:({email:t,signOut:a})=>r.jsx(rs,{...e,accountEmail:t??"",signOut:a})})}function vi(){const[e,s]=M.useState(!1);return r.jsxs("section",{className:"mt-8 border-t border-line pt-6",children:[r.jsx(Dr,{title:"Delete your Remit account",description:"Disconnects every account and erases Remit's copy of your mail, insights and preferences. Your mail at the providers is untouched.",action:r.jsx(se,{variant:"danger",size:"sm",onClick:()=>s(!0),children:"Delete your Remit account"})}),r.jsx(yi,{open:e,onClose:()=>s(!1)})]})}function Ts(e){const s=e.toLowerCase();return s==="access_denied"?"You cancelled the sign-in.":s==="scope_not_granted"?"Microsoft did not grant access to every service you picked. Sign in again and accept each permission Microsoft asks for.":s==="consent_required"||s.includes("admin_consent")||s.includes("interaction_required")?"Your organisation's admin needs to approve Remit. Ask your IT admin to grant the required permissions.":s.includes("imap_disabled")||s.includes("imap disabled")?"IMAP is disabled for this account. Ask your admin to enable IMAP access in the Microsoft 365 admin centre.":`Sign-in failed: ${e}. Please try again.`}const bi=e=>e.length>1?`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`:e[0]??"";function Si(e,s){const t=(e.missingServices??"").split(","),a=nt.filter(w=>t.includes(w.id)),n=e.oauthEmail,c=n?s.find(w=>w.authType==="oauthMicrosoft"&&w.email.toLowerCase()===n.toLowerCase()):void 0,o=bi(a.map(w=>w.label)),u=a.length===0?Ts("scope_not_granted"):`Microsoft did not grant access to ${o}. Sign in again and accept the ${o} ${a.length>1?"permissions":"permission"} when Microsoft asks.`,b=c?nt.filter(w=>c.syncedServices.includes(w.id)||a.some(T=>T.id===w.id)).map(w=>w.id):void 0;return{kind:"refused",message:u,email:n,services:b,reconnect:!!c}}function ji(e){const s=e.split("@")[0]??"";return s?s.split(/[._-]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" "):e}function wi(e){const s=e.displayName?.trim();return s||ji(e.email)}function Ni(e){if(!e.lastSyncAt)return"never synced";const s=dr(e.lastSyncAt);return s?`synced ${s}`:"never synced"}function is(e){return e.muted?.value?"muted":e.lastError?"error":e.connectionState==="authenticated"?"healthy":"error"}function as(e){return e.connectionState==="reauth_required"}function Ai(e){return e.connectionState==="credentials_missing"}const Ti=()=>r.jsx("div",{className:"space-y-3",role:"status","aria-busy":"true","aria-label":"Loading accounts",children:["skeleton-0","skeleton-1"].map(e=>r.jsx("div",{className:"rounded-sm border border-line bg-surface animate-pulse p-4",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"size-10 rounded-full bg-surface-sunken"}),r.jsxs("div",{className:"flex-1 space-y-2",children:[r.jsx("div",{className:"h-4 bg-surface-sunken rounded w-1/3"}),r.jsx("div",{className:"h-3 bg-surface-sunken rounded w-2/3"})]})]})},e))});function Gi(){const e=Pt.useSearch(),s=ir({from:Pt.fullPath}),[t,a]=M.useState(!0),[n,c]=M.useState(!1),[o,u]=M.useState(!1),[b,w]=M.useState(void 0),[T,_]=M.useState(null),[H,p]=M.useState(!1),[S,k]=M.useState(null),[A,oe]=M.useState(null),[V,P]=M.useState(null),[C,E]=M.useState(null),X=Ke(),{data:W,isPending:ae,isError:re,error:ce,refetch:pe}=ns(os());M.useEffect(()=>{e.editAccountId&&(_(e.editAccountId),p(!!e.focusSmtp),s({search:{editAccountId:void 0,focusSmtp:void 0,connected:e.connected,oauthError:e.oauthError,oauthEmail:e.oauthEmail,missingServices:e.missingServices},replace:!0}))},[e.editAccountId,e.focusSmtp,s,e.connected,e.oauthError,e.oauthEmail,e.missingServices]),M.useEffect(()=>{e.connected&&(w({kind:"connected",accountId:e.connected}),u(!0),X.invalidateQueries({queryKey:je()}),s({search:{connected:void 0,oauthError:void 0,editAccountId:void 0,focusSmtp:void 0},replace:!0}))},[e.connected,s,X]),M.useEffect(()=>{if(!e.oauthError)return;const j=e.oauthError==="scope_not_granted";j&&!W&&!re||(E(null),j?(w(Si({oauthEmail:e.oauthEmail,missingServices:e.missingServices},W?.accounts??[])),u(!0)):P(Ts(e.oauthError)),s({search:{oauthError:void 0,connected:void 0,editAccountId:void 0,focusSmtp:void 0},replace:!0}))},[e.oauthError,e.oauthEmail,e.missingServices,W,re,s]),xr(C!==null,()=>{X.invalidateQueries({queryKey:je()})}),M.useEffect(()=>{if(!C||!W)return;const j=W.accounts.find(ie=>ie.accountId===C);(!j||!as(j))&&E(null)},[W,C]);const F=ds(j=>{E(null),j==="stalled"&&P(us)}),D=he({...ls(),onSuccess:j=>{F(),window.location.assign(j.authorizationUrl)},onError:j=>{P(j instanceof Error?j.message:"Failed to start reconnect"),E(null)}}),R=he({...ar(),onSuccess:()=>{X.invalidateQueries({queryKey:je()}),k(null)}}),$=W?.accounts.find(j=>j.accountId===S),K=W?.accounts.find(j=>j.accountId===T),G=()=>{c(!1),u(!1),_(null),p(!1)},be=j=>{const ie=lr[j];ie&&s({to:ie})};return r.jsxs(pr,{items:nr,activeId:"accounts",title:"Accounts",description:"Every account keeps syncing — muted ones just stay out of unified views.",help:wr,helpOpen:t,onToggleHelp:()=>a(j=>!j),onSelect:be,onBackToMail:()=>{s({to:"/mail"})},children:[A&&r.jsx(at,{tone:"success",variant:"soft","data-testid":"oauth-success-banner",onDismiss:()=>oe(null),children:A}),V&&r.jsx(at,{tone:"danger",variant:"soft","data-testid":"oauth-error-banner",onDismiss:()=>P(null),children:V}),r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(or,{tone:"neutral",children:ae||re?"accounts":`${W.accounts.length} ${W.accounts.length===1?"account":"accounts"}`}),r.jsx(se,{variant:"primary",size:"sm",icon:r.jsx(Dt,{className:"size-3.5"}),onClick:()=>u(!0),children:"Add account"})]}),ae?r.jsx(Ti,{}):re?r.jsx(mr,{title:"Couldn't load accounts",error:ce,onRetry:()=>{pe()}}):W.accounts.length===0?r.jsxs("div",{className:"py-12 text-sm text-fg-muted","data-testid":"accounts-empty",children:[r.jsx("p",{className:"mb-3",children:"No accounts configured."}),r.jsx(se,{variant:"primary",size:"sm",icon:r.jsx(Dt,{className:"size-3.5"}),onClick:()=>u(!0),children:"Add your first account"})]}):r.jsx("div",{className:"space-y-3",children:W.accounts.map(j=>{const ie=as(j),ke=Ai(j),Ne=j.authType==="oauthMicrosoft",h=C===j.accountId,I=ie&&Ne?{label:"Reconnect",variant:"secondary",busy:h,busyLabel:"Redirecting…",onClick:()=>{E(j.accountId),D.mutate({body:{email:j.email,services:j.syncedServices}})}}:ke?{label:"Enter password",variant:"secondary",onClick:()=>_(j.accountId)}:is(j)==="error"?{label:"Reconnect",variant:"secondary",onClick:()=>_(j.accountId)}:{label:"Manage",variant:"ghost",onClick:()=>_(j.accountId)},J=r.jsx(hr,{actions:[I],destructive:{label:"Delete account",iconOnly:!0,icon:r.jsx(cr,{className:"size-3.5"}),onClick:()=>k(j.accountId)}});return r.jsxs("div",{className:"space-y-2",children:[r.jsx(gr,{label:wi(j),email:j.email,connector:Ne?"Microsoft 365":"IMAP",syncLabel:Ni(j),state:is(j),errorDetail:ie?j.lastError??"Re-authentication required":ke?"Imported from a config file, which carries no password. Enter one to start syncing.":j.lastError,trailing:J}),r.jsx(xi,{account:j,onRemoveAccount:()=>k(j.accountId)})]},j.accountId)})}),o&&r.jsx("div",{className:"fixed inset-0 z-40 overflow-auto bg-canvas",children:r.jsx(fr,{skipWelcome:!0,microsoftReturn:b,onComplete:()=>{b?.kind==="connected"&&oe("Account connected successfully."),u(!1),w(void 0),X.invalidateQueries({queryKey:je()})},onCancel:()=>{u(!1),w(void 0)}})}),r.jsx(ui,{isOpen:n||!!T,account:K,focusSmtp:H,onClose:G}),r.jsxs(cs,{open:!!S,onClose:()=>k(null),title:"Delete account",children:[r.jsxs("header",{className:"flex items-center gap-2 border-b border-line px-5 py-3",children:[r.jsx(mt,{className:"size-4 shrink-0 text-danger"}),r.jsx("span",{className:"flex-1 text-sm font-semibold text-fg",children:"Delete account"}),r.jsx(se,{variant:"ghost",size:"sm",icon:r.jsx(De,{className:"size-3.5"}),onClick:()=>k(null),"aria-label":"Cancel"})]}),r.jsxs("div",{className:"space-y-3 px-5 py-4 text-sm text-fg-muted",children:[r.jsx("p",{className:"text-center text-lg font-medium text-fg",children:"Are you sure?"}),$&&r.jsx("p",{className:"text-center",children:$.email}),r.jsxs("ul",{className:"list-inside list-disc space-y-1",children:[r.jsx("li",{children:"Remove the account from your settings"}),r.jsx("li",{children:"Stop syncing mail for this account"}),r.jsx("li",{children:"Delete all associated data (within 24 hours)"})]})]}),r.jsxs("footer",{className:"flex items-center justify-end gap-2 border-t border-line px-5 py-3",children:[r.jsx(se,{variant:"secondary",size:"sm",onClick:()=>k(null),children:"Cancel"}),r.jsx(se,{variant:"danger",size:"sm","aria-busy":R.isPending,icon:R.isPending?r.jsx(rt,{className:"size-3.5 animate-spin"}):void 0,onClick:()=>{R.isPending||S&&R.mutate({path:{accountId:S}})},children:R.isPending?"Deleting…":"Delete account"})]})]}),r.jsx(vi,{})]})}export{Gi as component,Ts as mapOauthError,Si as scopeRefusalReturn};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,aI as T,aR as y,B as l,aS as j,r as h,ai as u,d as S,L as g,e as k,aT as p,q as I,f as A,aU as L,aV as U,a7 as w,aW as D,aX as O,aY as B,u as E,aL as V,aN as _}from"./index-Q7BlLS9p.js";import{S as M}from"./settings-screen-DlzqJ0HQ.js";import{e as Y}from"./config-import-CkiEFeqC.js";import"./reply-BRbg9_Ak.js";import{u as F}from"./sections-Bz9kplXE.js";import{C as H,a as P,b as G,c as J}from"./card-BPN5dp6F.js";import{D as N}from"./download-BKDG5QA1.js";import{F as W}from"./file-json-D8vlo3ob.js";import{E as C}from"./external-link-C55BTLfs.js";import{R as v}from"./rotate-ccw-Yghgmp4e.js";import{C as b}from"./circle-check-BLyY37Bq.js";import{C as q,S as Q}from"./shield-check-BSecZw5t.js";import{C as $}from"./clock-rdLLgeDx.js";import{b as X}from"./help-copy-z6sn-HSk.js";import"./avatar-_Iz-lpCN.js";import"./menu-BzT426Ih.js";import"./circle-help-BT_Dohsy.js";import"./useMediaQuery-CXurPMbN.js";import"./kbd-Bxe2zQGe.js";const K=["Remit restarts. Mail stops loading for about a minute and this page will lose its connection while that happens.","Nothing is sent, deleted or moved. Your mail stays at your provider.","If the new version does not come back up, the version you are running now is restored automatically."];function Z({open:s,currentVersion:n,release:a,appliesSchemaMigration:t=!1,onClose:i,onConfirm:r}){return s?e.jsx(T,{open:!0,onClose:i,title:`Install Remit ${a.version}`,children:e.jsxs("div",{className:"flex max-h-[80vh] flex-col",children:[e.jsxs("header",{className:"space-y-1 border-b border-line px-4 py-3",children:[e.jsxs("h3",{className:"text-sm font-semibold text-fg",children:["Install Remit ",a.version,"?"]}),e.jsxs("p",{className:"text-xs text-fg-muted",children:["You are on ",n,". ",a.version," was released"," ",y(a.releasedAt),"."]})]}),e.jsxs("div",{className:"flex-1 space-y-3 overflow-auto px-4 py-3",children:[e.jsx("p",{className:"text-sm text-fg-muted",children:a.summary}),e.jsxs("ul",{className:"space-y-2",children:[K.map(c=>e.jsxs("li",{className:"flex gap-2 text-sm text-fg-muted",children:[e.jsx("span",{className:"mt-1.5 size-1.5 shrink-0 rounded-full bg-fg-subtle"}),e.jsx("span",{children:c})]},c)),t&&e.jsxs("li",{className:"flex gap-2 text-sm text-fg-muted",children:[e.jsx("span",{className:"mt-1.5 size-1.5 shrink-0 rounded-full bg-fg-subtle"}),e.jsx("span",{children:"This version updates the database while Remit is offline. The step forward cannot be undone by hand, but a failed start is still rolled back to the version and data you have now."})]})]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Good moment for this: when you are not waiting on a message."})]}),e.jsxs("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line px-4 py-3",children:[e.jsx(l,{variant:"ghost",size:"sm",onClick:i,children:"Not now"}),e.jsx(j,{variant:"secondary",size:"sm",external:!0,href:a.releaseNotesUrl,icon:e.jsx(C,{className:"size-3.5"}),children:"Release notes"}),e.jsx(l,{size:"sm",icon:e.jsx(N,{className:"size-3.5"}),onClick:r,children:"Install and restart"})]})]})}):null}function o({children:s,tone:n}){return e.jsx("div",{className:I("rounded-sm border bg-surface px-row-inset py-3",n==="danger"?"border-danger/50":"border-line"),children:s})}function ee({state:s,onCheck:n,onInstall:a,onDismissResult:t,now:i=Date.now()}){const[r,c]=h.useState(null),m=s.status==="checking",d=s.status==="available",x=()=>{if(m){c("Already checking. The result appears here in a moment.");return}c(null),n()},z=()=>{t(),x()},f=()=>{if(!d&&s.status!=="rolledBack"&&s.status!=="abandoned"){c("There is no update to install. Check for updates first — if one is found it appears here.");return}c(null),a()},R=(()=>{switch(s.status){case"upToDate":return e.jsx(o,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(b,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg",children:["Remit ",s.version," is the latest version.",e.jsxs("span",{className:"text-fg-subtle",children:[" ","Checked ",p(s.checkedAt,i),"."]})]})]}),e.jsx(l,{variant:"secondary",size:"sm",className:"shrink-0",onClick:x,children:"Check again"})]})});case"checking":return e.jsx(o,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(g,{className:"size-4 shrink-0 animate-spin text-fg-subtle","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["Looking for a newer version. You are on ",s.version,"."]})]}),e.jsx(l,{variant:"secondary",size:"sm",className:"shrink-0",onClick:x,children:"Check again"})]})});case"neverChecked":return e.jsx(o,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-2",children:[e.jsx($,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["No update check has run yet. Remit checks for updates on its own in the background.",s.lastCheckedAt!==void 0&&e.jsxs("span",{className:"text-fg-subtle",children:[" ","Last checked"," ",p(s.lastCheckedAt,i),"."]})]})]}),e.jsx(l,{variant:"secondary",size:"sm",className:"shrink-0",onClick:x,children:"Check now"})]})});case"checkFailed":return e.jsx(o,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(q,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"text-sm text-fg",children:"Could not reach the update source."}),e.jsx("p",{className:"text-xs text-fg-muted",children:s.reason}),e.jsxs("p",{className:"text-xs text-fg-subtle",children:["You are still on ",s.version," and it keeps working.",s.lastCheckedAt!==void 0&&e.jsxs(e.Fragment,{children:[" ","Last successful check"," ",p(s.lastCheckedAt,i),"."]})]})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(l,{variant:"secondary",size:"sm",onClick:x,children:"Try again"})})]})});case"available":return e.jsx(o,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"text-sm font-semibold text-fg",children:["Remit ",s.release.version]}),e.jsx(k,{tone:"accent",children:"update available"}),e.jsxs("span",{className:"text-2xs text-fg-subtle",children:["released ",y(s.release.releasedAt)," · you are on ",s.version]})]}),e.jsx("p",{className:"text-sm text-fg-muted",children:s.release.summary}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Installing restarts Remit, so mail stops loading for about a minute. If the new version does not come back up, the one you are running now is restored on its own."}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(l,{size:"sm",icon:e.jsx(N,{className:"size-3.5"}),onClick:f,children:["Install ",s.release.version]}),e.jsx(j,{variant:"secondary",size:"sm",external:!0,href:s.release.releaseNotesUrl,icon:e.jsx(C,{className:"size-3.5"}),children:"Release notes"})]})]})});case"applying":return e.jsx(o,{children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(g,{className:"size-4 shrink-0 animate-spin text-accent-2","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["Installing Remit ",s.target,". The restart screen has the details."]})]})});case"succeeded":return e.jsxs(e.Fragment,{children:[e.jsx(S,{tone:"success",onDismiss:t,children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"font-semibold",children:["Updated to Remit ",s.version,"."]}),e.jsxs("p",{children:["You were on ",s.previousVersion,"."," ",e.jsx("a",{href:s.releaseNotesUrl,target:"_blank",rel:"noopener noreferrer",className:"underline",children:"See what changed"}),"."]})]})}),e.jsx(o,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(b,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg",children:["Remit ",s.version," is running."]})]}),e.jsx(l,{variant:"secondary",size:"sm",className:"shrink-0",onClick:z,children:"Check for updates"})]})})]});case"rolledBack":return e.jsx(o,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(u,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," did not start. Remit reports that it put ",s.version," back."]}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["You are running ",s.version," again. A failed update can still have changed things on the way — the log below is the only account of what it got as far as doing."]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported as the failure"}),e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log before trying again:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(l,{variant:"secondary",size:"sm",icon:e.jsx(v,{className:"size-3.5"}),onClick:f,children:["Try ",s.attemptedVersion," again"]}),e.jsxs(l,{variant:"ghost",size:"sm",onClick:t,children:["Stay on ",s.version]})]})]})});case"unreachable":return e.jsx(o,{tone:"danger",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(u,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Installing ",s.attemptedVersion," left the server unreachable."]}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Remit has answered again since, but nothing here can say what happened during the silence."})]})]}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand}),e.jsx("div",{className:"flex justify-end",children:e.jsx(l,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})})]})});case"rollbackFailed":return e.jsx(o,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(u,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," did not start, and Remit could not put ",s.previousVersion," back."]}),e.jsx("p",{className:"text-sm text-fg-muted",children:"This is the one outcome Remit cannot resolve on its own. The server is in a half-changed state and needs you at a shell. The log below is the only account of where it stopped."})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported as the failure"}),e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log on the server:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(l,{variant:"ghost",size:"sm",onClick:t,children:"Dismiss"})})]})});case"abandoned":return e.jsx(o,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(u,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," was not installed. Nothing changed."]}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["The update stopped before it altered anything. You are still running ",s.version,"."]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log before trying again:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(l,{variant:"secondary",size:"sm",icon:e.jsx(v,{className:"size-3.5"}),onClick:f,children:["Try ",s.attemptedVersion," again"]}),e.jsxs(l,{variant:"ghost",size:"sm",onClick:t,children:["Stay on ",s.version]})]})]})});default:return s}})();return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Updates"}),e.jsx("p",{className:"text-xs text-fg-muted",children:"This Remit runs on your own server, so it updates when you say so. Your mail lives at your provider and is never touched by an update."})]}),R,r&&e.jsx("p",{role:"status",className:"text-xs text-fg-muted",children:r})]})}function se({fileName:s,state:n="ready",error:a,onDownload:t,onImport:i}){const r=n==="downloading";return e.jsxs(H,{className:"max-w-xl",children:[e.jsx(P,{children:e.jsx(G,{children:"Configuration file"})}),e.jsxs(J,{children:[e.jsx("p",{className:"text-sm text-fg-muted",children:"One versioned JSON document carrying every setting this instance holds: accounts and their servers, folder roles, rules, labels, flagged senders and appearance. No passwords and no OAuth tokens — you sign in again wherever you import it."}),n==="failed"&&e.jsxs("div",{className:"mt-3 space-y-2 rounded-sm border border-danger/40 bg-danger-soft px-3 py-2.5",children:[e.jsx("p",{className:"text-sm font-medium text-danger",children:"The config file could not be written."}),e.jsxs("p",{className:"text-xs text-fg-muted",children:["Nothing was downloaded. Try again — if it keeps failing, use"," ",e.jsx("code",{className:"rounded bg-surface-sunken px-1 py-0.5",children:"remit config save"})," ","on the host in the meantime."]}),a&&e.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:a})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[e.jsx(l,{variant:"secondary",size:"sm",disabled:r,icon:r?e.jsx(g,{className:"size-3.5 animate-spin"}):e.jsx(N,{className:"size-3.5"}),onClick:t,children:r?"Preparing…":`Download ${s}`}),e.jsx(k,{tone:"neutral",children:"no passwords"})]}),e.jsxs("p",{className:"mt-3 text-2xs text-fg-subtle",children:["On the host, the same file comes from"," ",e.jsxs("code",{className:"rounded bg-surface-sunken px-1 py-0.5",children:["remit config save ~/",s]}),"."]}),e.jsxs("div",{className:"mt-5 border-t border-line pt-4",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"Import a config file"}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:"Read a file from another Reader into this one. It shows what will change before anything is written, and asks for each account's credentials afterwards."}),e.jsx(l,{className:"mt-3",variant:"secondary",size:"sm",icon:e.jsx(W,{className:"size-3.5"}),onClick:i,children:"Import a config file"})]})]})]})}const ae=(s,n)=>{const a=URL.createObjectURL(new Blob([JSON.stringify(n,null,2)],{type:"application/json"})),t=document.createElement("a");t.href=a,t.download=s,t.click(),URL.revokeObjectURL(a)};function te(){const s=A(),n=F(),[a,t]=h.useState("ready"),[i,r]=h.useState(void 0),c=Y(new Date),m=()=>{a!=="downloading"&&(t("downloading"),r(void 0),s.fetchQuery(L()).then(d=>{ae(c,d.document),t("ready")}).catch(d=>{t("failed"),r(d instanceof Error?d.message:"GET /config/export did not answer with a configuration.")}))};return e.jsx(se,{fileName:c,state:a,error:i,onDownload:m,onImport:()=>n("importConfig")})}function ne(){const{surface:s,release:n,currentVersion:a,appliesSchemaMigration:t,onCheck:i,install:r,onDismissResult:c}=U(),[m,d]=h.useState(!1);return s.status!=="ready"?null:e.jsxs(e.Fragment,{children:[e.jsx(ee,{state:s.section,onCheck:i,onInstall:()=>d(!0),onDismissResult:c}),n&&a&&e.jsx(Z,{open:m,currentVersion:a,release:n,appliesSchemaMigration:t,onClose:()=>d(!1),onConfirm:()=>{d(!1),r(n.version)}})]})}function ie(){return w().tlsMode!=="internal"?null:e.jsxs("div",{className:"border-t border-line pt-4 mt-4",children:[e.jsx("p",{className:"text-sm font-medium text-fg mb-1",children:"TLS root certificate"}),e.jsx("p",{className:"text-sm text-fg-muted mb-2",children:"This deployment signs its own certificate. Import it into the trust store of each device you browse from, and the browser warning stops for good."}),e.jsx(j,{href:"/tls-root-ca.crt",download:!0,variant:"secondary",size:"sm",icon:e.jsx(Q,{className:"size-3.5"}),children:"Download root certificate"})]})}function re(s){try{return new Date(s).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}}function le({sha:s=O,commitUrl:n=D,buildTime:a=B}){return e.jsxs("p",{className:"text-xs text-fg-subtle",children:["Version"," ",n?e.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"font-mono hover:text-fg-muted hover:underline",children:s}):e.jsx("span",{className:"font-mono",children:s})," · ",e.jsxs("span",{children:["Built ",re(a)]})]})}function Te(){const s=E(),[n,a]=h.useState(!0),t=i=>{const r=_[i];r&&s({to:r})};return e.jsxs(M,{items:V,activeId:"advanced",title:"Advanced",description:"Notification rules, export, and diagnostics.",help:X,helpOpen:n,onToggleHelp:()=>a(i=>!i),onSelect:t,onBackToMail:()=>{s({to:"/mail"})},children:[w().updateMode==="self"&&e.jsx(ne,{}),e.jsx("div",{className:"mt-6 border-t border-line pt-4",children:e.jsx(te,{})}),e.jsx("div",{className:"mt-6 border-t border-line pt-4",children:e.jsx("p",{className:"text-sm text-fg-muted",children:"Notification rules are coming in a future release."})}),e.jsx(ie,{}),e.jsxs("div",{className:"border-t border-line pt-4 mt-4",children:[e.jsx("p",{className:"text-sm font-medium text-fg mb-1",children:"About"}),e.jsx(le,{})]})]})}export{Te as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as x,r as a,a$ as g,j as e,aL as S,b0 as n,aN as y,b1 as T}from"./index-Q7BlLS9p.js";import{S as b}from"./settings-screen-DlzqJ0HQ.js";import{c as v}from"./help-copy-z6sn-HSk.js";import"./avatar-_Iz-lpCN.js";import"./menu-BzT426Ih.js";import"./circle-help-BT_Dohsy.js";import"./kbd-Bxe2zQGe.js";const o="remit.density";function N(){return typeof localStorage>"u"?"comfortable":localStorage.getItem(o)??"comfortable"}function H(){const s=x(),[i,r]=a.useState(!0),[c,m]=a.useState(N),[p,d]=a.useState(g),h=t=>{m(t),typeof localStorage<"u"&&localStorage.setItem(o,t)},f=t=>{d(t),T(t)},u=t=>{const l=y[t];l&&s({to:l})};return e.jsx(b,{items:S,activeId:"appearance",title:"Appearance",description:"Display density and colour theme — instant-apply.",help:v,helpOpen:i,onToggleHelp:()=>r(t=>!t),onSelect:u,onBackToMail:()=>{s({to:"/mail"})},children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"Density"}),e.jsx(n,{name:"density","aria-label":"Density",value:c,onChange:h,options:[{value:"comfortable",label:"Comfortable"},{value:"compact",label:"Compact"}]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Controls the spacing of message rows in the mail list."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"Theme"}),e.jsx(n,{name:"theme","aria-label":"Theme",value:p,onChange:f,options:[{value:"system",label:"System"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Applies immediately. System default follows your OS preference."})]})]})})}export{H as component};
|
package/assets/brief-DxWizfDz.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r,O as i}from"./index-Q7BlLS9p.js";import{a as m}from"./MailShell-B8hUSN5k.js";import{B as o}from"./BriefPane-dae720lw.js";import"./reply-BRbg9_Ak.js";import{a as p}from"./search-token-index-Box28J2l.js";import{u as e}from"./search-mirror-CkH8xzbq.js";import"./useMessageBodyContent-DJ1-V3VF.js";import"./FullCompose-C6KtKdIN.js";import"./ErrorState-BjlNwjgd.js";import"./index-IYu0bmf1.js";import"./useSignature-BtR5UuiQ.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B6s52mZt.js";import"./sections-Bz9kplXE.js";import"./useMediaQuery-CXurPMbN.js";import"./confirm-dialog-DtOnF5MV.js";import"./MessageBody-0P-UxriZ.js";import"./kbd-Bxe2zQGe.js";import"./search-scope-UI1H6AzA.js";import"./MessageToolbar-CpGOUJZt.js";import"./roving-focus-Cj5YFxIj.js";import"./EmptyState-DaDveift.js";import"./popover-menu-O_sOnKG9.js";import"./avatar-_Iz-lpCN.js";import"./useQueries-BNgXdYau.js";import"./undo-2-Dw4FFZmo.js";import"./download-BKDG5QA1.js";import"./calendar-suggestion-CwP3NZgH.js";import"./sparkles-t4_3JyEx.js";import"./useCalendarSuggestions-DHNLR9_9.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-failure-note-DGOwCvAu.js";import"./checkbox-CJ4cnZfk.js";import"./clock-rdLLgeDx.js";import"./shield-check-BSecZw5t.js";import"./calendar-TkJ4zEO8.js";import"./useLayoutTier-DPp2gD1F.js";import"./menu-BzT426Ih.js";import"./useFilters-CYaLiKrQ.js";import"./useRefreshControl-BVxIaWvo.js";import"./circle-check-big-DtREikeq.js";import"./refresh-cw-CIoRjIJp.js";import"./LabelApplyTrigger-BOo72opb.js";import"./useLabels-Ci_KO517.js";import"./wizard-selection-zWa1qc6-.js";function _(){const t=p();return e({to:"/mail/brief"}),r.jsx(o,{thread:t,children:r.jsx(m,{phone:r.jsx(o.Phone,{}),list:r.jsx(o.List,{}),reading:r.jsx(i,{}),intelligence:r.jsx(o.Intelligence,{}),hasThread:!!t})})}export{_ as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,B as l,u as m,a as f,c as x,r as g,A as j,O as d}from"./index-Q7BlLS9p.js";import{E as h}from"./ErrorState-BjlNwjgd.js";import{A as S,S as B,a as A,D as r,b as E}from"./DesktopChrome-wrncK03X.js";import"./reply-BRbg9_Ak.js";import{u as v}from"./sections-Bz9kplXE.js";import{u as y}from"./calendar-TkJ4zEO8.js";import"./useLayoutTier-DPp2gD1F.js";import"./useMediaQuery-CXurPMbN.js";import"./avatar-_Iz-lpCN.js";import"./popover-menu-O_sOnKG9.js";import"./roving-focus-Cj5YFxIj.js";function a(){const s=v();return t.jsx(S,{search:null,actions:t.jsxs(t.Fragment,{children:[t.jsx(l,{variant:"ghost",size:"sm",icon:t.jsx(B,{className:"size-4"}),title:"Settings","aria-label":"Settings",onClick:()=>s("accounts")}),t.jsx(A,{})]})})}function L(){const s=m(),n=y(),{data:e,isLoading:i,isError:c,error:u,refetch:p}=f({...x(),staleTime:1/0}),o=!!(e&&(e.accounts?.length??0)===0);return g.useEffect(()=>{o&&s({to:"/onboarding",replace:!0})},[o,s]),c?t.jsx(r,{topBar:t.jsx(a,{}),children:t.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:t.jsx(h,{title:"Couldn't load your account",error:u,onRetry:()=>{p()}})})}):t.jsx(E,{hideTabBar:n,children:t.jsx(r,{topBar:t.jsx(a,{}),children:i||o?t.jsx(j,{}):t.jsx(d,{})})})}export{L as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as o}from"./FullCompose-C6KtKdIN.js";import"./index-Q7BlLS9p.js";import"./ErrorState-BjlNwjgd.js";import"./index-IYu0bmf1.js";import"./useMessageBodyContent-DJ1-V3VF.js";import"./reply-BRbg9_Ak.js";import"./useMediaQuery-CXurPMbN.js";import"./useSignature-BtR5UuiQ.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B6s52mZt.js";import"./sections-Bz9kplXE.js";import"./confirm-dialog-DtOnF5MV.js";const F=o;export{F as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as o}from"./FullCompose-C6KtKdIN.js";import"./index-Q7BlLS9p.js";import"./ErrorState-BjlNwjgd.js";import"./index-IYu0bmf1.js";import"./useMessageBodyContent-DJ1-V3VF.js";import"./reply-BRbg9_Ak.js";import"./useMediaQuery-CXurPMbN.js";import"./useSignature-BtR5UuiQ.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B6s52mZt.js";import"./sections-Bz9kplXE.js";import"./confirm-dialog-DtOnF5MV.js";const F=o;export{F as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as o}from"./FullCompose-C6KtKdIN.js";import"./index-Q7BlLS9p.js";import"./ErrorState-BjlNwjgd.js";import"./index-IYu0bmf1.js";import"./useMessageBodyContent-DJ1-V3VF.js";import"./reply-BRbg9_Ak.js";import"./useMediaQuery-CXurPMbN.js";import"./useSignature-BtR5UuiQ.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B6s52mZt.js";import"./sections-Bz9kplXE.js";import"./confirm-dialog-DtOnF5MV.js";const F=o;export{F as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as o}from"./FullCompose-C6KtKdIN.js";import"./index-Q7BlLS9p.js";import"./ErrorState-BjlNwjgd.js";import"./index-IYu0bmf1.js";import"./useMessageBodyContent-DJ1-V3VF.js";import"./reply-BRbg9_Ak.js";import"./useMediaQuery-CXurPMbN.js";import"./useSignature-BtR5UuiQ.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B6s52mZt.js";import"./sections-Bz9kplXE.js";import"./confirm-dialog-DtOnF5MV.js";const F=o;export{F as component};
|
package/assets/edit-BTLe8Y0F.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{fR as o,j as r}from"./index-Q7BlLS9p.js";import{a as i}from"./CalendarEventEditor-D8lJfjiB.js";import"./confirm-dialog-DtOnF5MV.js";import"./calendar-event-popup-Eoorlfr8.js";import"./pencil-CPbJ6Tks.js";import"./useCalendarSuggestions-DHNLR9_9.js";import"./ErrorState-BjlNwjgd.js";import"./useQueries-BNgXdYau.js";import"./calendar-event-sidebar-Dy-5E4fW.js";import"./calendar-guests-CGyi0Z1i.js";import"./circle-help-BT_Dohsy.js";import"./useCalendarData-4TkWGBli.js";import"./useCalendarTasks-Ch-qSnN_.js";import"./draft-BeV5oY-T.js";import"./useCalendarScheduling-DSmz3E5d.js";import"./useDebouncedValue-B6s52mZt.js";import"./calendar-format-BwCpz-JZ.js";import"./reply-BRbg9_Ak.js";import"./useMediaQuery-CXurPMbN.js";import"./calendar-TkJ4zEO8.js";import"./CalendarQuickCreate-BtDiOQnj.js";import"./CalendarSession-BSPnENrr.js";function g(){const{calendarObjectId:t}=o.useParams();return r.jsx(i,{calendarObjectId:t})}export{g as component};
|
package/assets/edit-ByggXvS8.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{fV as o,j as i}from"./index-Q7BlLS9p.js";import{a as m}from"./CalendarEventEditor-D8lJfjiB.js";import"./confirm-dialog-DtOnF5MV.js";import"./calendar-event-popup-Eoorlfr8.js";import"./pencil-CPbJ6Tks.js";import"./useCalendarSuggestions-DHNLR9_9.js";import"./ErrorState-BjlNwjgd.js";import"./useQueries-BNgXdYau.js";import"./calendar-event-sidebar-Dy-5E4fW.js";import"./calendar-guests-CGyi0Z1i.js";import"./circle-help-BT_Dohsy.js";import"./useCalendarData-4TkWGBli.js";import"./useCalendarTasks-Ch-qSnN_.js";import"./draft-BeV5oY-T.js";import"./useCalendarScheduling-DSmz3E5d.js";import"./useDebouncedValue-B6s52mZt.js";import"./calendar-format-BwCpz-JZ.js";import"./reply-BRbg9_Ak.js";import"./useMediaQuery-CXurPMbN.js";import"./calendar-TkJ4zEO8.js";import"./CalendarQuickCreate-BtDiOQnj.js";import"./CalendarSession-BSPnENrr.js";function g(){const{calendarObjectId:r,recurrenceId:t}=o.useParams();return i.jsx(m,{calendarObjectId:r,recurrenceId:t})}export{g as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,aZ as te,f as se,g as ae,bb as ne,bc as ie,r as f,bd as re,be as oe,bf as le,L as G,B as S,aI as ce,e as de,bg as ue,T as me,aD as Q,aE as J,a as V,W as pe,bh as xe,Z as fe,_ as ge,bi as he,bj as be,u as ve,c as je,aL as ye,aN as Ne}from"./index-Q7BlLS9p.js";import{E as U,f as Ce}from"./ErrorState-BjlNwjgd.js";import{S as Se}from"./settings-screen-DlzqJ0HQ.js";import{B as Fe}from"./bottom-sheet-zjs6jE40.js";import{u as Ie}from"./useMediaQuery-CXurPMbN.js";import{u as Me,a as ke}from"./useLabels-Ci_KO517.js";import{b as we,N as I,p as Ee,u as Re,r as Te,a as Z,S as H,c as De,n as Oe,f as Le,d as Ae,e as $e,g as ze,h as Pe,i as Ue}from"./useFilters-CYaLiKrQ.js";import{C as _}from"./circle-check-BLyY37Bq.js";import"./avatar-_Iz-lpCN.js";import"./menu-BzT426Ih.js";import"./circle-help-BT_Dohsy.js";const _e=e=>{const s=te(e);return s!==void 0&&s>=400&&s<500};function B({title:e,error:s,onRetry:n,reportHref:i}){return t.jsxs("div",{className:"space-y-1",children:[t.jsx(U,{variant:"inline",title:e,error:s,onRetry:_e(s)?void 0:n}),t.jsx("a",{href:i(Ce(s)),target:"_blank",rel:"noreferrer",className:"text-xs text-accent hover:underline",children:"Report an issue"})]})}const He=(e,s)=>{const n=se(),i=ae({...ie(),onSuccess:()=>{e&&(n.invalidateQueries({queryKey:we(e)}),s&&n.invalidateQueries({queryKey:ne({path:{accountId:e,filterId:s}})}))}}),{mutate:d}=i;return{updateFilter:f.useCallback(g=>{!e||!s||d({path:{accountId:e,filterId:s},body:g})},[e,s,d]),isPending:i.isPending,isSuccess:i.isSuccess,isError:i.isError,error:i.error,reset:i.reset}},Be=e=>({clauses:e.literalClauses.map((n,i)=>({id:`clause-${i}`,field:n.field,value:n.value})),matchOperator:e.matchOperator==="And"?"all":"any",moveMailboxId:e.actionMailboxId!==I?e.actionMailboxId:void 0,labelId:e.actionLabelId!==I?e.actionLabelId:void 0,scope:e.scope==="Temporary"?"until":"standing",until:e.scope==="Temporary"?qe(e.expiresAt):void 0,name:e.name}),qe=e=>{if(!e)return"";const s=Date.parse(e);if(Number.isNaN(s))return"";const n=new Date(s),i=d=>String(d).padStart(2,"0");return`${n.getFullYear()}-${i(n.getMonth()+1)}-${i(n.getDate())}`},q=e=>JSON.stringify({clauses:e.clauses.map(s=>[s.field,s.value]),operator:e.matchOperator,move:e.moveMailboxId??null,label:e.labelId??null}),W=(e,s)=>q(e)!==q(s),K=e=>JSON.stringify({scope:e.scope==="until"?"until":"standing",until:e.scope==="until"?e.until??"":""}),Y=(e,s)=>K(e)!==K(s),Ke=(e,s)=>{const n={},i=(e.name??"").trim();return i!==(s.name??"").trim()&&(n.name=i),W(e,s)&&(n.matchOperator=e.matchOperator==="all"?"And":"Or",n.literalClauses=e.clauses.map(d=>({field:d.field,value:d.value})),n.actionMailboxId=e.moveMailboxId??I,n.actionLabelId=e.labelId??I),Y(e,s)&&(n.scope=e.scope==="until"?"Temporary":"Standing",e.scope==="until"&&(n.expiresAt=Ee(e.until??""))),n};function Ge({accountId:e,filter:s,folders:n,delimiter:i,labels:d,onClose:u}){const g=f.useMemo(()=>Be(s),[s]),[m,h]=f.useState(g),[l,p]=f.useState(),[k,r]=f.useState(!1),N=f.useRef(0),{count:b}=Re(e,Te(m)),x=He(e,s.filterId),j=Z(e),{createFolderIn:M}=re(e),{createLabel:v}=Me(e),y=async o=>{const a=await v(o);return{id:a.labelId,name:a.name,color:a.color}},C=()=>p({mode:"add",draft:{field:H[0],value:""}}),w=o=>{const a=m.clauses.find(F=>F.id===o);a&&p({mode:"edit",clauseId:o,draft:{field:a.field,value:a.value}})},E=o=>p(a=>a&&{...a,draft:{...a.draft,field:o}}),R=o=>p(a=>a&&{...a,draft:{...a.draft,value:o}}),D=()=>{if(!l)return;const o=l.draft.field,a=Oe(o,l.draft.value);a!==""&&(h(F=>l.mode==="edit"&&l.clauseId?{...F,clauses:F.clauses.map(P=>P.id===l.clauseId?{id:P.id,field:o,value:a}:P)}:(N.current+=1,{...F,clauses:[...F.clauses,{id:`new-${N.current}`,field:o,value:a}]})),p(void 0))},T=o=>h(a=>({...a,clauses:a.clauses.filter(F=>F.id!==o)})),A=o=>h(a=>({...a,matchOperator:o})),O=o=>h(a=>({...a,moveMailboxId:o||void 0})),$=o=>h(a=>({...a,labelId:o||void 0})),c=o=>h(a=>({...a,name:o})),L=o=>h(a=>({...a,scope:o,until:o==="until"?a.until:void 0})),z=o=>h(a=>({...a,until:o})),X=()=>{const o=W(m,g)||Y(m,g),a=Ke(m,g);if(Object.keys(a).length===0){u();return}r(o),x.updateFilter(a)},ee=()=>j.start(De(m));return j.isStarting||j.isRunning||j.isDone?t.jsx(Ze,{progress:j.progress,isDone:j.isDone,onClose:u}):x.isPending?t.jsx(Qe,{}):x.isError?t.jsx(We,{onRetry:x.reset,onClose:u}):x.isSuccess?k?t.jsx(Ve,{preview:oe(b),blocked:b.status!=="ready"||b.stale===!0,onReapply:ee,onClose:u}):t.jsx(Je,{onClose:u}):t.jsx(le,{rule:m,folders:n,delimiter:i,labels:d,preview:b,clauseFields:H,persisted:!0,clauseEdit:l,onStartAddClause:C,onStartEditClause:w,onRemoveClause:T,onChangeDraftField:E,onChangeDraftValue:R,onSubmitClause:D,onCancelClause:()=>p(void 0),onChangeMatchOperator:A,onChangeMove:O,onCreateFolder:M,onChangeLabel:$,onCreateLabel:y,onChangeName:c,onChangeScope:L,onChangeUntil:z,onCommit:X,onCancel:u})}function Qe(){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[t.jsx(G,{className:"size-8 animate-spin text-accent-2"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Saving changes…"})]})}function Je({onClose:e}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx(_,{className:"size-8 text-positive"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Filter updated"}),t.jsx(S,{variant:"primary",onClick:e,className:"mt-2",children:"Done"})]})}function Ve({preview:e,blocked:s,onReapply:n,onClose:i}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx(_,{className:"size-8 text-positive"}),t.jsx("p",{className:"text-sm font-medium text-fg",children:"Rule saved"}),t.jsxs("p",{className:"max-w-xs text-xs text-fg-muted",children:["New mail follows the rule automatically. ",e," — move the mail already in your mailbox too?"]}),t.jsxs("div",{className:"mt-2 flex gap-2",children:[t.jsx(S,{variant:"primary",onClick:n,disabled:s,children:"Move existing mail"}),t.jsx(S,{variant:"ghost",onClick:i,children:"Not now"})]})]})}function Ze({progress:e,isDone:s,onClose:n}){const i=e.state==="Failed";return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[s?i?t.jsx("span",{className:"text-sm font-semibold text-danger",children:"Move failed"}):t.jsx(_,{className:"size-8 text-positive"}):t.jsx(G,{className:"size-8 animate-spin text-accent-2"}),!s&&t.jsx("p",{className:"text-sm font-medium text-fg",children:"Moving existing mail…"}),s&&!i&&t.jsxs("div",{className:"text-sm text-fg",children:[t.jsx("p",{className:"font-medium",children:"Done"}),t.jsxs("p",{className:"mt-1 text-xs text-fg-muted",children:[e.appliedCount," of ",e.matchedCount," moved",e.failedCount>0?` · ${e.failedCount} failed`:"","."]})]}),s&&i&&t.jsx("p",{className:"max-w-xs text-xs text-fg-muted",children:e.errorMessage||"Something went wrong. Please try again."}),s&&t.jsx(S,{variant:"primary",onClick:n,className:"mt-2",children:"Done"})]})}function We({onRetry:e,onClose:s}){return t.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-8 text-center",children:[t.jsx("p",{className:"text-sm font-medium text-danger",children:"Couldn't save changes"}),t.jsx("p",{className:"max-w-xs text-xs text-fg-muted",children:"Please try again."}),t.jsxs("div",{className:"mt-2 flex gap-2",children:[t.jsx(S,{variant:"primary",onClick:e,children:"Try again"}),t.jsx(S,{variant:"ghost",onClick:s,children:"Not now"})]})]})}function Ye({accountId:e,filter:s,folders:n,delimiter:i,labels:d,onClose:u}){const g=Ie(),m=t.jsx(Ge,{accountId:e,filter:s,folders:n,delimiter:i,labels:d,onClose:u});return g?t.jsx(ce,{open:!0,onClose:u,title:"Filter rule",children:m}):t.jsx(Fe,{open:!0,onClose:u,label:"Filter rule",dismissLabel:"Dismiss filter rule",children:m})}const Xe=e=>{switch(e.kind){case"queuing":case"running":return"Running over the inbox…";case"done":return e.matched===0?"Done. Nothing in the inbox matched.":`Done. Filed ${e.applied} of ${e.matched} matching messages in the inbox.`;case"failed":return}};function et({filters:e,mailboxName:s,labelById:n,onEdit:i,onDelete:d,deletingFilterId:u,onToggle:g,togglingFilterId:m,onRunNow:h,runFilterId:l,runStatus:p,now:k=Date.now()}){return e.length===0?t.jsx("p",{className:"py-6 text-sm text-fg-muted",children:"No filters yet. Select a few messages in the inbox and choose Organize to make one."}):t.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:e.map(r=>{const N=Le(r,k),b=N==="Expired",x=N==="Disabled",j=x?Ae(r):void 0,M=r.actionMailboxId!==I?s(r.actionMailboxId):void 0,v=r.actionLabelId!==I?n.get(r.actionLabelId):void 0,y=$e(r.expiresAt),C=l===r.filterId?p:void 0,w=C?.kind==="queuing"||C?.kind==="running",E=C?Xe(C):void 0,R=N==="Active"&&(r.actionMailboxId!==I||r.actionLabelId!==I);return t.jsxs("li",{className:"flex items-start gap-3 px-3 py-2.5",children:[t.jsxs("button",{type:"button",onClick:()=>i(r.filterId),"aria-label":`Edit filter ${r.name}`,className:"min-w-0 flex-1 rounded-sm text-left hover:opacity-80",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:`truncate text-sm font-medium ${b||x?"text-fg-muted":"text-fg"}`,children:r.name}),t.jsx(de,{tone:b?"neutral":x?"warning":"positive",dot:!0,children:N})]}),t.jsxs("p",{className:"mt-0.5 text-xs text-fg-subtle",children:[M?`Moves matches to ${M}`:"No move action",r.scope==="Temporary"&&y?b?` · expired ${y}`:` · until ${y}`:r.scope==="Standing"?" · always":""]}),j&&t.jsx("p",{className:"mt-0.5 text-xs text-warning",children:j}),E&&t.jsx("p",{role:"status",className:"mt-0.5 text-xs text-fg-muted",children:E}),v&&t.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1.5",children:t.jsx(ue,{label:{labelId:v.id,name:v.name,color:v.color}})})]}),R&&t.jsx(S,{variant:"ghost",size:"sm",onClick:()=>h(r.filterId),disabled:w,"aria-label":`Run now: filter ${r.name}`,children:w?"Running…":"Run now"}),!b&&t.jsx(S,{variant:"ghost",size:"sm",onClick:()=>g(r.filterId,x),disabled:m===r.filterId,"aria-label":`${x?"Turn on":"Turn off"} filter ${r.name}`,children:x?"Turn on":"Turn off"}),t.jsx(S,{variant:"ghost",size:"sm",icon:t.jsx(me,{className:"size-4 text-danger"}),onClick:()=>d(r.filterId),disabled:u===r.filterId,"aria-label":`Delete filter ${r.name}`})]},r.filterId)})})}function tt(e){return Q(J({title:`Filter toggle: ${e}`,errorMessage:e}))}function st(e){return Q(J({title:`Filter run now: ${e}`,errorMessage:e}))}const at=e=>{if(e.failure)return{kind:"failed",error:e.failure.error};if(e.isStarting)return{kind:"queuing"};if(e.isDone)return e.progress.state==="Failed"?{kind:"failed",error:new Error(e.progress.errorMessage||"The run over the inbox failed.")}:{kind:"done",matched:e.progress.matchedCount,applied:e.progress.appliedCount};if(e.isRunning)return{kind:"running"}},nt=t.jsxs("div",{className:"space-y-3",children:[t.jsxs("p",{children:["Filters are the standing rules Organize creates. A"," ",t.jsx("strong",{children:"Standing"})," filter keeps working on new mail; a"," ",t.jsx("strong",{children:"Temporary"})," one stops on its own at the date you picked."]}),t.jsx("p",{children:"An expired filter isn't deleted the instant it lapses — it stays here, marked Expired, so you can see what it did and when it stopped."}),t.jsx("p",{children:"A filter that can't do its job turns itself off and says why, for example when its folder no longer exists. Turn it back on once that is fixed."})]});function it({account:e}){const s=e.accountId,{filters:n,isPending:i,isError:d,error:u,refetch:g}=ze(s),{deleteFilter:m,deletingFilterId:h}=Pe(s),l=Ue(s),p=Z(s),{startForFilter:k}=p,[r,N]=f.useState(),b=f.useCallback(c=>{N(c),k(c)},[k]),x=at(p),[j,M]=f.useState(),{data:v}=V({...pe({path:{accountId:s}}),staleTime:1/0}),y=xe(),C=f.useMemo(()=>fe(e.folderAppointments),[e.folderAppointments]),w=f.useCallback(c=>{const L=v?.items.find(z=>z.mailboxId===c);if(L)return ge(L,C.get(c),y)},[v?.items,C,y]),E=f.useMemo(()=>he({mailboxes:v?.items??[],folderAppointments:e.folderAppointments,translator:y}),[v?.items,e.folderAppointments,y]),R=be(v?.items??[]),{labels:D}=ke(s),T=f.useMemo(()=>D.map(c=>({id:c.labelId,name:c.name,color:c.color})),[D]),A=f.useMemo(()=>new Map(T.map(c=>[c.id,c])),[T]),O=n.find(c=>c.filterId===j),$=n.find(c=>c.filterId===r)?.name;return t.jsxs("section",{className:"space-y-2",children:[t.jsx("h2",{className:"text-sm font-semibold text-fg",children:e.email}),O&&t.jsx(Ye,{accountId:s,filter:O,folders:E,delimiter:R,labels:T,onClose:()=>M(void 0)}),i?t.jsx("div",{className:"h-16 animate-pulse rounded-md border border-line bg-surface","aria-busy":"true","aria-label":`Loading filters for ${e.email}`}):d?t.jsx(U,{variant:"inline",title:`Couldn't load filters for ${e.email}`,error:u,onRetry:()=>{g()}}):t.jsxs(t.Fragment,{children:[l.isError&&t.jsx(B,{title:l.enabling?"Couldn't turn the filter on":"Couldn't turn the filter off",error:l.error,onRetry:l.retry,reportHref:tt}),r&&x?.kind==="failed"&&t.jsx(B,{title:`Couldn't run ${$??"the filter"} over the inbox`,error:x.error,onRetry:p.failure?.kind==="statusUnreadable"?p.refreshStatus:()=>b(r),reportHref:st}),t.jsx(et,{filters:n,mailboxName:w,labelById:A,onEdit:M,onDelete:m,deletingFilterId:h,onToggle:l.toggleFilter,togglingFilterId:l.togglingFilterId,onRunNow:b,runFilterId:r,runStatus:x})]})]})}function ht(){const e=ve(),[s,n]=f.useState(!0),{data:i,isPending:d,isError:u,error:g,refetch:m}=V(je()),h=l=>{const p=Ne[l];p&&e({to:p})};return t.jsx(Se,{items:ye,activeId:"filters",title:"Filters",description:"Standing and temporary rules created by Organize, per account.",help:nt,helpOpen:s,onToggleHelp:()=>n(l=>!l),onSelect:h,onBackToMail:()=>{e({to:"/mail"})},children:d?t.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):u?t.jsx(U,{title:"Couldn't load accounts",error:g,onRetry:()=>{m()}}):i.accounts.length===0?t.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No accounts configured."}):t.jsx("div",{className:"space-y-8",children:i.accounts.map(l=>t.jsx(it,{account:l},l.accountId))})})}export{it as AccountFilters,ht as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o,O as i}from"./index-Q7BlLS9p.js";import{a as m}from"./MailShell-B8hUSN5k.js";import{F as r}from"./FlaggedPane-BMM1CFDP.js";import"./reply-BRbg9_Ak.js";import{a as p}from"./search-token-index-Box28J2l.js";import{u as e}from"./search-mirror-CkH8xzbq.js";import"./useMessageBodyContent-DJ1-V3VF.js";import"./FullCompose-C6KtKdIN.js";import"./ErrorState-BjlNwjgd.js";import"./index-IYu0bmf1.js";import"./useSignature-BtR5UuiQ.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B6s52mZt.js";import"./sections-Bz9kplXE.js";import"./useMediaQuery-CXurPMbN.js";import"./confirm-dialog-DtOnF5MV.js";import"./MessageBody-0P-UxriZ.js";import"./kbd-Bxe2zQGe.js";import"./search-scope-UI1H6AzA.js";import"./MessageToolbar-CpGOUJZt.js";import"./roving-focus-Cj5YFxIj.js";import"./EmptyState-DaDveift.js";import"./popover-menu-O_sOnKG9.js";import"./avatar-_Iz-lpCN.js";import"./useQueries-BNgXdYau.js";import"./undo-2-Dw4FFZmo.js";import"./download-BKDG5QA1.js";import"./calendar-suggestion-CwP3NZgH.js";import"./sparkles-t4_3JyEx.js";import"./useCalendarSuggestions-DHNLR9_9.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-failure-note-DGOwCvAu.js";import"./checkbox-CJ4cnZfk.js";import"./clock-rdLLgeDx.js";import"./shield-check-BSecZw5t.js";import"./calendar-TkJ4zEO8.js";import"./useLayoutTier-DPp2gD1F.js";import"./menu-BzT426Ih.js";import"./useFilters-CYaLiKrQ.js";import"./MailViewChrome-ByS8tz5h.js";import"./refresh-cw-CIoRjIJp.js";import"./wizard-selection-zWa1qc6-.js";function X(){const t=p();return e({to:"/mail/flagged"}),o.jsx(r,{thread:t,children:o.jsx(m,{phone:o.jsx(r.Phone,{}),list:o.jsx(r.List,{}),reading:o.jsx(i,{}),intelligence:o.jsx(r.Intelligence,{}),hasThread:!!t})})}export{X as component};
|
package/assets/index-6I3CIFzv.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,ae as o}from"./index-Q7BlLS9p.js";const n=()=>t.jsx(o,{to:"/settings/accounts"});export{n as component};
|
package/assets/index-B03cLsmc.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-Q7BlLS9p.js";import{M as i}from"./MailboxPane-CAAszcbD.js";import"./MessageBody-0P-UxriZ.js";import"./kbd-Bxe2zQGe.js";import"./search-scope-UI1H6AzA.js";import"./reply-BRbg9_Ak.js";import"./useMediaQuery-CXurPMbN.js";import"./useMessageBodyContent-DJ1-V3VF.js";import"./useRefreshControl-BVxIaWvo.js";import"./circle-check-big-DtREikeq.js";import"./refresh-cw-CIoRjIJp.js";import"./useQueries-BNgXdYau.js";import"./MessageToolbar-CpGOUJZt.js";import"./roving-focus-Cj5YFxIj.js";import"./search-token-index-Box28J2l.js";import"./EmptyState-DaDveift.js";import"./ErrorState-BjlNwjgd.js";import"./popover-menu-O_sOnKG9.js";import"./avatar-_Iz-lpCN.js";import"./index-IYu0bmf1.js";import"./useSignature-BtR5UuiQ.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B6s52mZt.js";import"./sections-Bz9kplXE.js";import"./undo-2-Dw4FFZmo.js";import"./download-BKDG5QA1.js";import"./calendar-suggestion-CwP3NZgH.js";import"./sparkles-t4_3JyEx.js";import"./useCalendarSuggestions-DHNLR9_9.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-failure-note-DGOwCvAu.js";import"./checkbox-CJ4cnZfk.js";import"./clock-rdLLgeDx.js";import"./shield-check-BSecZw5t.js";import"./calendar-TkJ4zEO8.js";import"./useLayoutTier-DPp2gD1F.js";import"./menu-BzT426Ih.js";import"./useFilters-CYaLiKrQ.js";import"./confirm-dialog-DtOnF5MV.js";import"./MailViewChrome-ByS8tz5h.js";import"./LabelApplyTrigger-BOo72opb.js";import"./useLabels-Ci_KO517.js";import"./NavMenuButton-lXQswWUS.js";import"./bottom-sheet-zjs6jE40.js";import"./circle-help-BT_Dohsy.js";import"./circle-check-BLyY37Bq.js";function W(){return o.jsx(i.Reading,{})}export{W as component};
|
package/assets/index-B_Kp6tBV.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{fQ as o,j as r}from"./index-Q7BlLS9p.js";import{C as m}from"./CalendarEventPopup-qgqMLo7x.js";import"./confirm-dialog-DtOnF5MV.js";import"./calendar-event-popup-Eoorlfr8.js";import"./pencil-CPbJ6Tks.js";import"./useCalendarSuggestions-DHNLR9_9.js";import"./ErrorState-BjlNwjgd.js";import"./useQueries-BNgXdYau.js";import"./calendar-guests-CGyi0Z1i.js";import"./circle-help-BT_Dohsy.js";import"./useCalendarTasks-Ch-qSnN_.js";import"./useCalendarData-4TkWGBli.js";import"./calendar-format-BwCpz-JZ.js";import"./reply-BRbg9_Ak.js";import"./useMediaQuery-CXurPMbN.js";import"./calendar-TkJ4zEO8.js";import"./CalendarSession-BSPnENrr.js";function P(){const{calendarObjectId:t}=o.useParams();return r.jsx(m,{calendarObjectId:t})}export{P as component};
|
package/assets/index-BqhbwSzu.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{fU as t,j as m}from"./index-Q7BlLS9p.js";import{C as p}from"./CalendarEventPopup-qgqMLo7x.js";import"./confirm-dialog-DtOnF5MV.js";import"./calendar-event-popup-Eoorlfr8.js";import"./pencil-CPbJ6Tks.js";import"./useCalendarSuggestions-DHNLR9_9.js";import"./ErrorState-BjlNwjgd.js";import"./useQueries-BNgXdYau.js";import"./calendar-guests-CGyi0Z1i.js";import"./circle-help-BT_Dohsy.js";import"./useCalendarTasks-Ch-qSnN_.js";import"./useCalendarData-4TkWGBli.js";import"./calendar-format-BwCpz-JZ.js";import"./reply-BRbg9_Ak.js";import"./useMediaQuery-CXurPMbN.js";import"./calendar-TkJ4zEO8.js";import"./CalendarSession-BSPnENrr.js";function P(){const{calendarObjectId:r,recurrenceId:o}=t.useParams();return m.jsx(p,{calendarObjectId:r,recurrenceId:o})}export{P as component};
|
package/assets/index-Cs95BuoI.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-Q7BlLS9p.js";import{F as r}from"./FlaggedPane-BMM1CFDP.js";import"./MessageBody-0P-UxriZ.js";import"./kbd-Bxe2zQGe.js";import"./search-scope-UI1H6AzA.js";import"./reply-BRbg9_Ak.js";import"./useMediaQuery-CXurPMbN.js";import"./useMessageBodyContent-DJ1-V3VF.js";import"./MessageToolbar-CpGOUJZt.js";import"./roving-focus-Cj5YFxIj.js";import"./search-token-index-Box28J2l.js";import"./useQueries-BNgXdYau.js";import"./EmptyState-DaDveift.js";import"./ErrorState-BjlNwjgd.js";import"./popover-menu-O_sOnKG9.js";import"./avatar-_Iz-lpCN.js";import"./index-IYu0bmf1.js";import"./useSignature-BtR5UuiQ.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B6s52mZt.js";import"./sections-Bz9kplXE.js";import"./undo-2-Dw4FFZmo.js";import"./download-BKDG5QA1.js";import"./calendar-suggestion-CwP3NZgH.js";import"./sparkles-t4_3JyEx.js";import"./useCalendarSuggestions-DHNLR9_9.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-failure-note-DGOwCvAu.js";import"./checkbox-CJ4cnZfk.js";import"./clock-rdLLgeDx.js";import"./shield-check-BSecZw5t.js";import"./calendar-TkJ4zEO8.js";import"./useLayoutTier-DPp2gD1F.js";import"./menu-BzT426Ih.js";import"./useFilters-CYaLiKrQ.js";import"./confirm-dialog-DtOnF5MV.js";import"./MailViewChrome-ByS8tz5h.js";import"./refresh-cw-CIoRjIJp.js";import"./wizard-selection-zWa1qc6-.js";function N(){return o.jsx(r.Reading,{})}export{N as component};
|
package/assets/index-Cua4RHkF.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-Q7BlLS9p.js";import{O as t}from"./OutboxPane-C-1N19Mm.js";import"./roving-focus-Cj5YFxIj.js";import"./MessageBody-0P-UxriZ.js";import"./kbd-Bxe2zQGe.js";import"./search-scope-UI1H6AzA.js";import"./reply-BRbg9_Ak.js";import"./useMediaQuery-CXurPMbN.js";import"./useMessageBodyContent-DJ1-V3VF.js";import"./circle-check-big-DtREikeq.js";import"./clock-rdLLgeDx.js";import"./row-actions-D3zwQA9I.js";import"./rotate-ccw-Yghgmp4e.js";import"./NavMenuButton-lXQswWUS.js";import"./menu-BzT426Ih.js";import"./outbox-status-BlKn6P0x.js";function d(){return o.jsx(t.Reading,{})}export{d as component};
|
package/assets/index-D_cEGMwi.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-Q7BlLS9p.js";import{B as o}from"./BriefPane-dae720lw.js";import"./MessageBody-0P-UxriZ.js";import"./kbd-Bxe2zQGe.js";import"./search-scope-UI1H6AzA.js";import"./reply-BRbg9_Ak.js";import"./useMediaQuery-CXurPMbN.js";import"./useMessageBodyContent-DJ1-V3VF.js";import"./MessageToolbar-CpGOUJZt.js";import"./roving-focus-Cj5YFxIj.js";import"./search-token-index-Box28J2l.js";import"./useQueries-BNgXdYau.js";import"./EmptyState-DaDveift.js";import"./ErrorState-BjlNwjgd.js";import"./popover-menu-O_sOnKG9.js";import"./avatar-_Iz-lpCN.js";import"./index-IYu0bmf1.js";import"./useSignature-BtR5UuiQ.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B6s52mZt.js";import"./sections-Bz9kplXE.js";import"./undo-2-Dw4FFZmo.js";import"./download-BKDG5QA1.js";import"./calendar-suggestion-CwP3NZgH.js";import"./sparkles-t4_3JyEx.js";import"./useCalendarSuggestions-DHNLR9_9.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-failure-note-DGOwCvAu.js";import"./checkbox-CJ4cnZfk.js";import"./clock-rdLLgeDx.js";import"./shield-check-BSecZw5t.js";import"./calendar-TkJ4zEO8.js";import"./useLayoutTier-DPp2gD1F.js";import"./menu-BzT426Ih.js";import"./useFilters-CYaLiKrQ.js";import"./confirm-dialog-DtOnF5MV.js";import"./useRefreshControl-BVxIaWvo.js";import"./circle-check-big-DtREikeq.js";import"./refresh-cw-CIoRjIJp.js";import"./LabelApplyTrigger-BOo72opb.js";import"./useLabels-Ci_KO517.js";import"./wizard-selection-zWa1qc6-.js";function S(){return r.jsx(o.Reading,{})}export{S as component};
|
package/assets/index-Dn--s-1U.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-Q7BlLS9p.js";import{M as r}from"./MailboxPane-CAAszcbD.js";import"./MessageBody-0P-UxriZ.js";import"./kbd-Bxe2zQGe.js";import"./search-scope-UI1H6AzA.js";import"./reply-BRbg9_Ak.js";import"./useMediaQuery-CXurPMbN.js";import"./useMessageBodyContent-DJ1-V3VF.js";import"./useRefreshControl-BVxIaWvo.js";import"./circle-check-big-DtREikeq.js";import"./refresh-cw-CIoRjIJp.js";import"./useQueries-BNgXdYau.js";import"./MessageToolbar-CpGOUJZt.js";import"./roving-focus-Cj5YFxIj.js";import"./search-token-index-Box28J2l.js";import"./EmptyState-DaDveift.js";import"./ErrorState-BjlNwjgd.js";import"./popover-menu-O_sOnKG9.js";import"./avatar-_Iz-lpCN.js";import"./index-IYu0bmf1.js";import"./useSignature-BtR5UuiQ.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B6s52mZt.js";import"./sections-Bz9kplXE.js";import"./undo-2-Dw4FFZmo.js";import"./download-BKDG5QA1.js";import"./calendar-suggestion-CwP3NZgH.js";import"./sparkles-t4_3JyEx.js";import"./useCalendarSuggestions-DHNLR9_9.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-failure-note-DGOwCvAu.js";import"./checkbox-CJ4cnZfk.js";import"./clock-rdLLgeDx.js";import"./shield-check-BSecZw5t.js";import"./calendar-TkJ4zEO8.js";import"./useLayoutTier-DPp2gD1F.js";import"./menu-BzT426Ih.js";import"./useFilters-CYaLiKrQ.js";import"./confirm-dialog-DtOnF5MV.js";import"./MailViewChrome-ByS8tz5h.js";import"./LabelApplyTrigger-BOo72opb.js";import"./useLabels-Ci_KO517.js";import"./NavMenuButton-lXQswWUS.js";import"./bottom-sheet-zjs6jE40.js";import"./circle-help-BT_Dohsy.js";import"./circle-check-BLyY37Bq.js";function W(){return o.jsx(r.Reading,{})}export{W as component};
|
package/assets/index-HzhXMggl.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-Q7BlLS9p.js";import{F as r}from"./FlaggedPane-BMM1CFDP.js";import"./MessageBody-0P-UxriZ.js";import"./kbd-Bxe2zQGe.js";import"./search-scope-UI1H6AzA.js";import"./reply-BRbg9_Ak.js";import"./useMediaQuery-CXurPMbN.js";import"./useMessageBodyContent-DJ1-V3VF.js";import"./MessageToolbar-CpGOUJZt.js";import"./roving-focus-Cj5YFxIj.js";import"./search-token-index-Box28J2l.js";import"./useQueries-BNgXdYau.js";import"./EmptyState-DaDveift.js";import"./ErrorState-BjlNwjgd.js";import"./popover-menu-O_sOnKG9.js";import"./avatar-_Iz-lpCN.js";import"./index-IYu0bmf1.js";import"./useSignature-BtR5UuiQ.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B6s52mZt.js";import"./sections-Bz9kplXE.js";import"./undo-2-Dw4FFZmo.js";import"./download-BKDG5QA1.js";import"./calendar-suggestion-CwP3NZgH.js";import"./sparkles-t4_3JyEx.js";import"./useCalendarSuggestions-DHNLR9_9.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-failure-note-DGOwCvAu.js";import"./checkbox-CJ4cnZfk.js";import"./clock-rdLLgeDx.js";import"./shield-check-BSecZw5t.js";import"./calendar-TkJ4zEO8.js";import"./useLayoutTier-DPp2gD1F.js";import"./menu-BzT426Ih.js";import"./useFilters-CYaLiKrQ.js";import"./confirm-dialog-DtOnF5MV.js";import"./MailViewChrome-ByS8tz5h.js";import"./refresh-cw-CIoRjIJp.js";import"./wizard-selection-zWa1qc6-.js";function M(){return o.jsx(r.Reading,{})}export{M as component};
|
package/assets/index-_NrXWlZY.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-Q7BlLS9p.js";import{B as o}from"./BriefPane-dae720lw.js";import"./MessageBody-0P-UxriZ.js";import"./kbd-Bxe2zQGe.js";import"./search-scope-UI1H6AzA.js";import"./reply-BRbg9_Ak.js";import"./useMediaQuery-CXurPMbN.js";import"./useMessageBodyContent-DJ1-V3VF.js";import"./MessageToolbar-CpGOUJZt.js";import"./roving-focus-Cj5YFxIj.js";import"./search-token-index-Box28J2l.js";import"./useQueries-BNgXdYau.js";import"./EmptyState-DaDveift.js";import"./ErrorState-BjlNwjgd.js";import"./popover-menu-O_sOnKG9.js";import"./avatar-_Iz-lpCN.js";import"./index-IYu0bmf1.js";import"./useSignature-BtR5UuiQ.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B6s52mZt.js";import"./sections-Bz9kplXE.js";import"./undo-2-Dw4FFZmo.js";import"./download-BKDG5QA1.js";import"./calendar-suggestion-CwP3NZgH.js";import"./sparkles-t4_3JyEx.js";import"./useCalendarSuggestions-DHNLR9_9.js";import"./calendar-format-BwCpz-JZ.js";import"./calendar-failure-note-DGOwCvAu.js";import"./checkbox-CJ4cnZfk.js";import"./clock-rdLLgeDx.js";import"./shield-check-BSecZw5t.js";import"./calendar-TkJ4zEO8.js";import"./useLayoutTier-DPp2gD1F.js";import"./menu-BzT426Ih.js";import"./useFilters-CYaLiKrQ.js";import"./confirm-dialog-DtOnF5MV.js";import"./useRefreshControl-BVxIaWvo.js";import"./circle-check-big-DtREikeq.js";import"./refresh-cw-CIoRjIJp.js";import"./LabelApplyTrigger-BOo72opb.js";import"./useLabels-Ci_KO517.js";import"./wizard-selection-zWa1qc6-.js";function Q(){return r.jsx(o.Reading,{})}export{Q as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as f,j as e,av as h,bg as y,au as b,bH as g,B as v,T as N,u as C,a as L,c as I,aL as D,aN as S,d as w}from"./index-Q7BlLS9p.js";import{C as E}from"./confirm-dialog-DtOnF5MV.js";import{E as j}from"./ErrorState-BjlNwjgd.js";import{S as $}from"./settings-screen-DlzqJ0HQ.js";import{a as T,b as k,c as R,u as O}from"./useLabels-Ci_KO517.js";import"./avatar-_Iz-lpCN.js";import"./menu-BzT426Ih.js";import"./circle-help-BT_Dohsy.js";function B({labels:l,onRename:i,onRecolor:n,onDelete:m,deletingLabelId:c}){const[u,r]=f.useState(),[o,d]=f.useState("");if(l.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 t=a=>{const s=o.trim();s!==""&&i(a,s),r(void 0)};return e.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:l.map(a=>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:[u===a.labelId?e.jsx(h,{autoFocus:!0,value:o,onChange:s=>d(s.target.value),onBlur:()=>t(a.labelId),onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),t(a.labelId)),s.key==="Escape"&&(s.preventDefault(),r(void 0))},"aria-label":`Rename label ${a.name}`}):e.jsx("button",{type:"button",onClick:()=>{r(a.labelId),d(a.name)},"aria-label":`Rename label ${a.name}`,className:"flex items-center gap-2 rounded-sm text-left hover:opacity-80",children:e.jsx(y,{label:a})}),e.jsx("p",{className:"mt-0.5 text-xs text-fg-subtle",children:a.filterCount===0?"Not used in any filter":`Used in ${a.filterCount} ${a.filterCount===1?"filter":"filters"}`})]}),e.jsx(b,{"aria-label":`Color for ${a.name}`,value:a.color,onChange:s=>n(a.labelId,s.target.value),className:"w-28 shrink-0",children:g.map(s=>e.jsx("option",{value:s,children:s},s))}),e.jsx(v,{variant:"ghost",size:"sm",icon:e.jsx(N,{className:"size-4 text-danger"}),onClick:()=>m(a),disabled:c===a.labelId,"aria-label":`Delete label ${a.name}`})]},a.labelId))})}const P=(l,i)=>{if(i===0)return{title:`Delete the "${l}" label?`};const n=i===1?"filter":"filters";return{title:`Delete the "${l}" label?`,description:`This also deletes ${i} ${n} 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 _({accountId:l}){const{createLabel:i,isPending:n,isError:m}=O(l),[c,u]=f.useState(""),[r,o]=f.useState("Default"),d=()=>{const t=c.trim();t!==""&&i(t,r).then(()=>{u(""),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:t=>u(t.target.value),placeholder:"e.g. Receipts","aria-label":"Label name",onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),d())}})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-xs text-fg-muted",children:"Color"}),e.jsx(b,{value:r,onChange:t=>o(t.target.value),"aria-label":"Label color",className:"w-28",children:g.map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsx(v,{variant:"primary",onClick:d,disabled:n||c.trim()==="",children:n?"Creating…":"Create label"})]}),m&&e.jsx(w,{tone:"danger",variant:"soft",children:"Couldn't create that label. Please try again."})]})}function A({account:l}){const i=l.accountId,{labels:n,isPending:m,isError:c,error:u,refetch:r}=T(i),{updateLabel:o}=k(i),{deleteLabel:d,deletingLabelId:t}=R(i),[a,s]=f.useState();return e.jsxs("section",{className:"space-y-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:l.email}),m?e.jsx("div",{className:"h-16 animate-pulse rounded-md border border-line bg-surface","aria-busy":"true","aria-label":`Loading labels for ${l.email}`}):c?e.jsx(j,{variant:"inline",title:`Couldn't load labels for ${l.email}`,error:u,onRetry:()=>{r()}}):e.jsx(B,{labels:n,onRename:(p,x)=>o(p,{name:x}),onRecolor:(p,x)=>o(p,{color:x}),onDelete:s,deletingLabelId:t}),e.jsx(_,{accountId:i}),a&&(()=>{const p=P(a.name,a.filterCount);return e.jsx(E,{isOpen:!0,title:p.title,description:p.description,confirmLabel:"Delete label",destructive:!0,isBusy:t===a.labelId,onConfirm:()=>{d(a.labelId),s(void 0)},onCancel:()=>s(void 0)})})()]})}function q(){const l=C(),[i,n]=f.useState(!0),{data:m,isPending:c,isError:u,error:r,refetch:o}=L(I()),d=t=>{const a=S[t];a&&l({to:a})};return e.jsx($,{items:D,activeId:"labels",title:"Labels",description:"Mark mail without moving it, per account.",help:H,helpOpen:i,onToggleHelp:()=>n(t=>!t),onSelect:d,onBackToMail:()=>{l({to:"/mail"})},children:c?e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):u?e.jsx(j,{title:"Couldn't load accounts",error:r,onRetry:()=>{o()}}):m.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:m.accounts.map(t=>e.jsx(A,{account:t},t.accountId))})})}export{q as component};
|
package/assets/mail-BuB5wUpu.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as Me,j as e,r as p,o as Ee,p as Pe,D as Le,X as Te,q as I,C as Fe,S as oe,t as Q,v as q,w as re,x as ie,F as Ae,T as ze,y as De,M as _e,z as Be,E as Ke,I as Qe,G as le,B as E,H as ce,J as qe,K as He,N as ue,f as B,P as de,Q as me,R as $e,U as Ve,V as Ue,W as xe,a as fe,Y as We,Z as Ge,_ as z,$ as Ye,a0 as Je,a1 as Xe,a2 as Ze,a3 as es,a4 as ss,a5 as ts,a6 as as,a7 as ns,u as os,c as rs,a8 as is,O as ls}from"./index-Q7BlLS9p.js";import{E as cs}from"./ErrorState-BjlNwjgd.js";import{K as us,B as ds,S as ms,u as xs,s as fs,b as ps,a as hs,c as gs,d as bs}from"./search-token-index-Box28J2l.js";import{K as H}from"./kbd-Bxe2zQGe.js";import{u as vs,l as O,a as D,m as $,b as ys,c as js,N as C,d as Ns,e as Ss,i as Cs,f as Is}from"./reply-BRbg9_Ak.js";import{A as ws,S as pe,a as Os,c as ks,L as Rs,b as Ms,D as Es,d as Ps}from"./DesktopChrome-wrncK03X.js";import{P as Ls}from"./pencil-CPbJ6Tks.js";import{u as K,a as Ts}from"./useMessageBodyContent-DJ1-V3VF.js";import{c as Fs,s as As,M as zs}from"./MailShell-B8hUSN5k.js";import{u as Ds,a as _s,R as Bs,s as Ks,i as Qs,H as qs,M as Hs}from"./useRefreshControl-BVxIaWvo.js";import{M as $s}from"./menu-BzT426Ih.js";import{B as he,u as Vs}from"./useResultFolderIndex-BGDx2gSv.js";import{u as Us}from"./sections-Bz9kplXE.js";import{u as Ws}from"./roving-focus-Cj5YFxIj.js";import{C as Gs,A as Ys}from"./account-service-status-Cn_S-syP.js";import{S as Js}from"./sparkles-t4_3JyEx.js";import{u as ge}from"./useQueries-BNgXdYau.js";import{f as Xs}from"./folder-failure-CqkVSsrb.js";import{i as Zs}from"./outbox-status-BlKn6P0x.js";import{u as et}from"./index-IYu0bmf1.js";import{u as be,i as st}from"./useLayoutTier-DPp2gD1F.js";import{u as tt}from"./useDebouncedValue-B6s52mZt.js";import"./search-scope-UI1H6AzA.js";import"./useMediaQuery-CXurPMbN.js";import"./avatar-_Iz-lpCN.js";import"./popover-menu-O_sOnKG9.js";import"./FullCompose-C6KtKdIN.js";import"./confirm-dialog-DtOnF5MV.js";import"./circle-check-big-DtREikeq.js";import"./refresh-cw-CIoRjIJp.js";import"./useSignature-BtR5UuiQ.js";import"./account-form-helpers-DhckT_PN.js";const at=Me("SquarePen",[["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"}]]);function nt({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(Ls,{className:"size-6"})})}const ot=({isOpen:s,onClose:t})=>{const a=p.useRef(null);return Ee({id:"shortcuts",open:s,answers:{back:t}}),Pe(a,s),s?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(Le,{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:I("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(Te,{className:"size-5"})})]}),e.jsx("div",{className:"grid gap-x-8 gap-y-6 sm:grid-cols-2",children:us.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((r,c)=>e.jsxs(p.Fragment,{children:[c>0&&o.keys[0]==="g"&&e.jsx("span",{className:"text-2xs text-fg-subtle",children:"then"}),e.jsx(H,{children:r})]},r))})]},`${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(H,{children:"Esc"})," to close"]})})]})]}):null},rt="button:not([disabled]), a[href]",P="outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface-sunken";function it({active:s,dimmed:t,indent:a}){return I("flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors",P,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 lt({icon:s,label:t,count:a,active:n,failure:o}){return e.jsxs(e.Fragment,{children:[s&&e.jsx("span",{className:I("shrink-0",n?"text-accent-2":"text-fg-subtle"),children:s}),e.jsx("span",{className:"flex-1 truncate",children:t}),o&&e.jsx(re,{className:"size-3.5 shrink-0 text-danger","aria-hidden":"true"}),a!=null&&a>0&&e.jsx("span",{className:I("text-2xs tabular-nums",n?"text-accent-2":"text-fg-subtle"),children:a})]})}function w({icon:s,label:t,count:a,active:n,dimmed:o,indent:r,navId:c,linkComponent:u,ariaLabel:x,title:d,failure:h,onClick:y}){const g=it({active:n,dimmed:o,indent:r}),l=e.jsx(lt,{icon:s,label:t,count:a,active:n,failure:h}),v=x??t,m=h?`${v} — ${h}`:v,f=h?`${d??t} — ${h}`:d;return c&&u?u({navId:c,className:g,ariaLabel:m,title:f,onClick:y,children:l}):e.jsx("button",{type:"button",onClick:y,className:g,"aria-label":h?m:x,title:f,children:l})}const V={inbox:0,flagged:1,drafts:2,sent:3,archive:4,all:5,junk:6,trash:7};function ct(s){switch(s){case"inbox":return e.jsx(Qe,{className:"size-4"});case"flagged":return e.jsx(oe,{className:"size-4"});case"drafts":return e.jsx(Ke,{className:"size-4"});case"sent":return e.jsx(ie,{className:"size-4"});case"archive":return e.jsx(Be,{className:"size-4"});case"all":return e.jsx(_e,{className:"size-4"});case"junk":return e.jsx(De,{className:"size-4"});case"trash":return e.jsx(ze,{className:"size-4"})}}const U=s=>s.role!=null,A=8,W="remit.nav.folders.open.",G="remit.nav.account.open.";function Y(s,t,a){if(typeof localStorage>"u")return a;const n=localStorage.getItem(s+t);return n===null?a:n!=="0"}function J(s,t,a){typeof localStorage>"u"||localStorage.setItem(s+t,a?"1":"0")}function ut({account:s,selectedNavId:t,onSelectNav:a,linkComponent:n}){const[o,r]=p.useState(()=>Y(G,s.id,!0)),[c,u]=p.useState(()=>Y(W,s.id,!0)),[x,d]=p.useState(!1),h=()=>{r(i=>{const j=!i;return J(G,s.id,j),j})},y=()=>{u(i=>{const j=!i;return J(W,s.id,j),j})},g=s.mailboxes.filter(U).sort((i,j)=>V[i.role]-V[j.role]),l=s.mailboxes.filter(i=>!U(i)),v=x||l.length<=A?l:l.slice(0,A),m=l.length-v.length,f=s.status??"ready",b=s.syncedServices!==void 0&&!s.syncedServices.includes("Mail"),N=f==="ready"&&g.length===0&&l.length===0;return e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{type:"button",onClick:h,"aria-expanded":o,className:I("flex w-full items-center gap-1.5 px-2 pb-1 text-left transition-colors hover:text-fg",P,s.muted&&"opacity-55"),children:[o?e.jsx(Q,{className:"size-3 shrink-0 text-fg-subtle"}):e.jsx(q,{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(ds,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:"muted"})]}),b&&e.jsxs(e.Fragment,{children:[e.jsx(Gs,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:Ys.Mail})]})]}),o&&e.jsxs(e.Fragment,{children:[f==="loading"&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"Loading…"}),f==="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(re,{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"})]}),N&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"No mailboxes"}),f==="ready"&&e.jsxs(e.Fragment,{children:[g.map(i=>e.jsx(w,{navId:i.id,linkComponent:n,icon:ct(i.role),label:i.name,ariaLabel:i.name,title:i.fullPath??i.name,failure:i.failure,count:i.unseen,active:t===i.id,dimmed:s.muted,onClick:()=>a?.(i.id)},i.id)),s.outboxPending!==void 0&&e.jsx(w,{navId:"outbox",linkComponent:n,icon:e.jsx(ie,{className:"size-4"}),label:"Outbox",ariaLabel:"Outbox",count:s.outboxPending>0?s.outboxPending:void 0,active:t==="outbox",dimmed:s.muted,onClick:()=>a?.("outbox")}),l.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:y,"aria-expanded":c,className:I("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",P),children:[c?e.jsx(Q,{className:"size-3 shrink-0"}):e.jsx(q,{className:"size-3 shrink-0"}),e.jsx("span",{className:"flex-1",children:"Folders"}),e.jsx("span",{className:"tabular-nums opacity-70",children:l.length})]}),c&&e.jsxs(e.Fragment,{children:[v.map(i=>e.jsx(w,{navId:i.id,linkComponent:n,icon:e.jsx(Ae,{className:"size-4"}),label:i.name,ariaLabel:i.name,title:i.fullPath??i.name,failure:i.failure,count:i.unseen,active:t===i.id,dimmed:s.muted,onClick:()=>a?.(i.id)},i.id)),(m>0||x)&&l.length>A&&e.jsx("button",{type:"button",onClick:()=>d(i=>!i),className:I("ml-7 flex items-center px-2 py-1 text-2xs font-medium text-accent transition-colors hover:underline",P),children:x?"Show less":`Show all (${l.length})`})]})]})]})]})]})}function dt({accounts:s,selectedNavId:t,briefUnseen:a,onSelectNav:n,variant:o="desktop",linkComponent:r,calendarNav:c="hidden"}){const u=p.useRef(null);Ws({containerRef:u,itemSelector:rt});const x=o==="drawer",d=e.jsxs("nav",{ref:x?u:void 0,className:x?"px-2 py-2":"flex-1 overflow-y-auto px-2 py-2","aria-label":"Mailboxes",children:[e.jsx(w,{navId:"brief",linkComponent:r,icon:e.jsx(Js,{className:"size-4"}),label:"Daily brief",ariaLabel:"Daily brief",count:a,active:t==="brief",onClick:()=>n?.("brief")}),c==="shown"&&e.jsx(w,{navId:"calendar",linkComponent:r,icon:e.jsx(Fe,{className:"size-4"}),label:"Calendar",ariaLabel:"Calendar",active:t==="calendar",onClick:()=>n?.("calendar")}),e.jsx(w,{navId:"flagged",linkComponent:r,icon:e.jsx(oe,{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(h=>e.jsx(ut,{account:h,selectedNavId:t,onSelectNav:n,linkComponent:r},h.id))]});return x?d:e.jsx("aside",{ref:u,className:"flex h-full w-full flex-col bg-surface-sunken",children:d})}function mt(){const s=le();if(!s)return null;const t=s.showNavPane?!s.navCollapsed:!1;return e.jsx(E,{variant:"ghost",size:"sm",icon:e.jsx($s,{className:"size-4"}),onClick:s.toggleNav,"aria-label":t?"Hide folders":"Show folders","aria-expanded":t,title:"Folders",className:"shrink-0"})}const xt={global:"Search all mail",pending:"Search mail",scoped:"Search this folder"};function ft({search:s,onCompose:t,onReportBug:a,onOpenSettings:n,settingsAttention:o,composeShortcut:r,refreshControl:c,account:u}){return e.jsx(ws,{leading:e.jsx(mt,{}),search:e.jsx(ms,{value:s.value,onChange:s.onChange,onClear:s.onClear,onClearQuery:s.onClearQuery,chips:s.chips,onRemoveChip:s.onRemoveChip,placeholder:xt[s.scope]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(E,{variant:"ghost",size:"sm",icon:e.jsx(at,{className:"size-4"}),title:r?`Compose (${r})`:"Compose","aria-label":"Compose",onClick:t}),e.jsx(E,{variant:"ghost",size:"sm",icon:e.jsx(he,{className:"size-4"}),title:"Report a bug","aria-label":"Report a bug",onClick:a}),e.jsx(E,{variant:"ghost",size:"sm",icon:e.jsx(ce,{label:o,children:e.jsx(pe,{className:"size-4"})}),title:"Settings","aria-label":o?`Settings — ${o}`:"Settings",onClick:n}),c,u]})})}function pt(){const{pathname:s}=vs(),t=qe({from:"/mail/$mailboxId",shouldThrow:!1});return O(s,"/settings")?"settings":O(s,"/calendar")?"calendar":O(s,"/mail/outbox")?"outbox":O(s,"/mail/flagged")?"flagged":O(s,"/mail/brief")?"brief":t?.mailboxId??""}function ht(){const s=He(),t=D({select:d=>$(d.location.pathname)}),a=D({select:d=>ys(d.location.search)}),[n,o]=p.useState(a),r=tt(n,200),[c,u]=p.useState(t);if(c!==t){const d=As(c,t,a);u(t),d!==void 0&&o(d)}const x=p.useCallback(d=>{u($(s.state.location.pathname)),o(d)},[s]);return{searchInput:n,committedQuery:Fs(n,r),viewKey:t,setSearchInput:x}}const gt=()=>{const s=K();return js()?null:e.jsx(nt,{onCompose:s})};function X({accounts:s}){const{searchInput:t,onSearchChange:a,onSearchClear:n,onSearchClearQuery:o,resultFolderIndex:r}=ue(),c=B(),u=Us(),x=K(),{scope:d,clearScope:h}=xs(s),y=de(),g=d.kind==="scoped"?[{id:d.chip.id,label:d.chip.label,tone:"scope"}]:void 0,l=p.useMemo(()=>s.map(N=>N.accountId),[s]),{hasNewMail:v}=Ds(),{state:m,errorMessage:f,refresh:b}=_s(l,{onSettled:()=>$e(c,Ve(r.keys()))});return e.jsx(ft,{search:{value:t,scope:d.kind,chips:g,onChange:a,onClear:n,onClearQuery:o,onRemoveChip:h},onCompose:x,onReportBug:me,onOpenSettings:()=>u("accounts"),settingsAttention:y,composeShortcut:fs("compose"),refreshControl:e.jsx(Bs,{state:m,onRefresh:b,label:"Refresh all accounts",errorMessage:f,hasUpdate:v(l)}),account:e.jsx(Os,{})})}function bt(){return e.jsxs("button",{type:"button",onClick:me,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(he,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Report a bug"})]})}const Z=s=>/^\d/.test(s),vt=(s,t)=>{const a=Z(s),n=Z(t);return a&&!n?-1:!a&&n?1:s.localeCompare(t,void 0,{sensitivity:"base",numeric:!0})};function yt(s,t,a){const n=[],o=[];for(const r of s)t.has(r.mailboxId)?n.push(r):o.push(r);return o.sort((r,c)=>vt(z(r,void 0,a),z(c,void 0,a))),{system:n,labels:o}}function jt(s,t,a){const n=Ye(t)&&s.unseenCount>0;return{id:s.mailboxId,name:z(s,t,a),unseen:n?s.unseenCount:void 0,role:t,fullPath:s.fullPath,failure:Xs(s)}}function ee({accounts:s,onMailboxSelect:t,variant:a="desktop"}){const n=B(),o=pt(),{onSearchChange:r}=ue(),{t:c}=Ue("mail",{useSuspense:!1}),u=p.useCallback((m,f)=>c(m,{defaultValue:f}),[c]),x=ge({queries:s.map(m=>({...xe({path:{accountId:m.accountId}}),staleTime:1/0}))}),{data:d}=fe(We()),h=p.useMemo(()=>(d?.items??[]).filter(m=>Zs(m.status)).length,[d?.items]),y=p.useMemo(()=>s.map((m,f)=>{const b=x[f],N=b?.data?.items??[],i=Ge(m.folderAppointments),{system:j,labels:L}=yt(N,i,u),T=b?.isError?"error":b?.isLoading?"loading":"ready";return{id:m.accountId,label:m.email,email:m.email,muted:!!m.muted,outboxPending:h,status:T,onRetry:()=>b?.refetch(),mailboxes:[...j,...L].map(k=>jt(k,i.get(k.mailboxId),u))}}),[s,x,h,u]),g=m=>{n.invalidateQueries({queryKey:Je({path:{mailboxId:m},query:{order:"desc"}})})},l=({navId:m,className:f,ariaLabel:b,title:N,children:i,onClick:j})=>m==="brief"?e.jsx(C,{to:"/mail/brief",search:{q:void 0},activeOptions:{includeSearch:!1},onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):m==="calendar"?e.jsx(C,{to:"/calendar",onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):m==="outbox"?e.jsx(C,{to:"/mail/outbox",search:{q:void 0},onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):m==="flagged"?e.jsx(C,{to:"/mail/flagged",search:{q:void 0},onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):m==="settings"?e.jsx(C,{to:"/settings/accounts",onClick:()=>j?.(),className:f,"aria-label":b,title:N,children:i}):e.jsx(C,{to:"/mail/$mailboxId",params:{mailboxId:m},search:{q:void 0},onClick:()=>{g(m),j?.()},className:f,"aria-label":b,title:N,children:i}),v=()=>{r(""),t?.()};return e.jsx(dt,{accounts:y,selectedNavId:o,onSelectNav:v,linkComponent:l,variant:a})}function Nt({accounts:s,onMailboxSelect:t}){const n=le()?.showNavPane??!0,o=de();return n?e.jsx(ee,{accounts:s}):e.jsxs("div",{className:"flex h-full flex-col",children:[e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsx(ee,{accounts:s,onMailboxSelect:t,variant:"drawer"})}),e.jsxs("div",{className:"border-t border-line px-2 py-2",children:[e.jsxs(C,{to:"/settings/accounts",onClick:t,children:[e.jsx(ce,{label:o,children:e.jsx(pe,{className:"size-4 shrink-0"})}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Settings"})]}),e.jsx(bt,{}),e.jsx(ks,{children:({signOut:r})=>e.jsxs("button",{type:"button",onClick:()=>{t?.(),r()},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(Rs,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Sign out"})]})})]})]})}function St(s){const t=ge({queries:s.map(a=>({...xe({path:{accountId:a.accountId}}),staleTime:1/0}))});return p.useMemo(()=>ps(t.map(a=>a.data?.items??[])),[t])}const ve="remit:intelligence-open";function Ct(){try{return localStorage.getItem(ve)!=="closed"}catch{return!0}}function It(s){try{localStorage.setItem(ve,s?"open":"closed")}catch{}}function se({panels:s,prefersOpen:t,isDesktop:a,hasThread:n,raisedFor:o,openMessage:r}){if(o!==null&&o===r)return!0;const c=s.filter(u=>u!=="sidebar");return c.length>0?c.includes("intelligence"):a&&n&&t}const wt=()=>{const s=be(),t=Ns(),a=Ss(),n=t.find(Cs),o=hs(),[r,c]=p.useState(Ct),u=o?`${o.threadId}/${o.messageId??""}`:null,[x,d]=p.useState(null),h={panels:t,prefersOpen:r,isDesktop:s==="desktop",hasThread:o!==void 0,openMessage:u},y=se({...h,raisedFor:x}),g=se({...h,raisedFor:null}),l=p.useCallback((b,N)=>{a([...b?["intelligence"]:[],...N?[N]:[]])},[a]),v=p.useCallback(b=>{l(g,b)},[g,l]),m=p.useCallback(()=>{if(y&&!g){d(null);return}const b=!y;It(b),c(b),d(null),l(b,n)},[g,y,n,l]),f=p.useCallback(()=>{d(u)},[u]);return{openOverlay:n,intelligenceOpen:y,showOverlay:v,toggleIntelligence:m,raiseIntelligence:f}};var R={exports:{}},te;function Ot(){if(te)return R.exports;te=1;const s=(t,a,n)=>new Promise((o,r)=>{if(n=Object.assign({concurrency:1/0},n),typeof a!="function")throw new TypeError("Mapper function is required");const{concurrency:c}=n;if(!(typeof c=="number"&&c>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${c}\` (${typeof c})`);const u=[],x=t[Symbol.iterator]();let d=!1,h=!1,y=0,g=0;const l=()=>{if(d)return;const v=x.next(),m=g;if(g++,v.done){h=!0,y===0&&o(u);return}y++,Promise.resolve(v.value).then(f=>a(f,m)).then(f=>{u[m]=f,y--,l()},f=>{d=!0,r(f)})};for(let v=0;v<c&&(l(),!h);v++);});return R.exports=s,R.exports.default=s,R.exports}var kt=Ot();const Rt=Xe(kt),Mt=900*1e3,Et=30,Pt=(s,t)=>{if(!s)return t;const a=Number.parseInt(s,10);return Number.isFinite(a)&&a>0?a:t},Lt=30*1e3,Tt=s=>Math.max(Pt(s,Et)*1e3,Lt),ye=Tt(ns().mailboxPollIntervalSeconds),M=(s=Date.now(),t=ye)=>Qs(s)?Math.min(qs,t):t,Ft=5,_=new Set,At=(s,t,a=Mt)=>s.filter(n=>{const o=n.lastSyncAt;return o==null?!0:t-o>a}).map(n=>n.accountId),zt=(s,t,a=ye)=>s-t>=a,Dt=(s,t)=>s.filter(a=>!t.has(a)),ae=(s,t)=>{if(_.delete(s),ss(t)||ts(t,{softError:!0})){as(t,{softError:!0});return}console.warn("[remit] background mailbox sync failed",{accountId:s,error:t})},ne=(s,t)=>Ze({path:{accountId:s},throwOnError:!0}).then(()=>{t.invalidateQueries({queryKey:es({path:{accountId:s}})})}),_t=s=>{const t=B(),a=p.useRef(s);a.current=s;const n=s.map(o=>o.accountId).join(",");p.useEffect(()=>{const o=Date.now(),c=At(a.current,o).filter(u=>!_.has(u));if(c.length!==0)for(const u of c)_.add(u),ne(u,t).catch(x=>{ae(u,x)})},[n,t]),p.useEffect(()=>{let o=Date.now(),r;const c=new Set,u=()=>{o=Date.now();const g=Dt(a.current.map(l=>l.accountId),c);for(const l of g)c.add(l);Rt(g,l=>ne(l,t).catch(v=>{ae(l,v)}).finally(()=>{c.delete(l)}),{concurrency:Ft})},x=()=>{if(document.visibilityState==="visible"){u(),r=setTimeout(x,M());return}},d=()=>{if(document.visibilityState!=="visible")return;r!==void 0&&clearTimeout(r);const g=Date.now(),l=M(g);if(zt(g,o,l)){u(),r=setTimeout(x,l);return}r=setTimeout(x,o+l-g)},h=()=>{document.visibilityState==="visible"&&(r!==void 0&&clearTimeout(r),o=Date.now(),r=setTimeout(x,M()))};r=setTimeout(x,M()),document.addEventListener("visibilitychange",d);const y=Ks(h);return()=>{r!==void 0&&clearTimeout(r),document.removeEventListener("visibilitychange",d),y()}},[n,t])};function ba(){const s=os(),t=be(),a=st(t),{openOverlay:n,intelligenceOpen:o,showOverlay:r,toggleIntelligence:c,raiseIntelligence:u}=wt(),x=n==="shortcuts",d=n==="nav",{searchInput:h,committedQuery:y,viewKey:g,setSearchInput:l}=ht(),{data:v,isLoading:m,isError:f,error:b,refetch:N}=fe({...rs(),staleTime:1/0}),i=!!(v&&(v.accounts?.length??0)===0);p.useEffect(()=>{i&&s({to:"/onboarding",replace:!0})},[i,s]),et({enabled:!x,bindings:[{key:"?",action:"help",handler:()=>r("shortcuts"),noModifiers:!1,preventDefault:!0}]});const j=K(),L=Ts(),T=D({select:F=>Is(F.matches)?.list==="mailbox"}),k=p.useMemo(()=>({compose:j}),[j]);gs({enabled:!T&&!L,handlers:k});const je=p.useCallback(()=>{l("")},[l]),Ne=p.useCallback(()=>{l("")},[l]),S=v?.accounts??[],Se=p.useMemo(()=>S.map(F=>F.accountId),[S]),Ce=St(S),Ie=Vs(S).index,we=p.useMemo(()=>bs(S),[S]);_t(S);const Oe=p.useCallback(()=>{n==="nav"&&r(void 0)},[n,r]),ke={accounts:S,mailboxNameIndex:Ce,accountNameIndex:we,resultFolderIndex:Ie,searchQuery:y,searchInput:h,searchViewKey:g,onSearchChange:l,onSearchClear:je,onSearchClearQuery:Ne,intelligenceOpen:o,onToggleIntelligence:c,onRaiseIntelligence:u},Re={isSinglePane:a,isLoading:m||i,intelligenceOpen:o,nav:e.jsx(Nt,{accounts:S,onMailboxSelect:Oe}),topBar:a?void 0:e.jsx(X,{accounts:S}),appBar:t==="phone"?void 0:e.jsx(Ps,{}),overlay:a?e.jsx(gt,{}):void 0,navOpen:d,onOpenNav:()=>r("nav"),onCloseNav:()=>r(void 0)};return e.jsx(is.Provider,{value:ke,children:e.jsxs(Hs,{accountIds:Se,children:[e.jsx(Ms,{children:f?e.jsx(Es,{topBar:e.jsx(X,{accounts:S}),children:e.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:e.jsx(cs,{title:"Couldn't load your account",error:b,onRetry:()=>{N()}})})}):e.jsx(zs,{chrome:Re,children:e.jsx(ls,{})})}),e.jsx(ot,{isOpen:x,onClose:()=>r(void 0)})]})})}export{ba as component,ue as useMailContext};
|
package/assets/new-CRVRIIK_.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as o}from"./CalendarEventEditor-D8lJfjiB.js";import"./index-Q7BlLS9p.js";import"./confirm-dialog-DtOnF5MV.js";import"./calendar-event-popup-Eoorlfr8.js";import"./pencil-CPbJ6Tks.js";import"./useCalendarSuggestions-DHNLR9_9.js";import"./ErrorState-BjlNwjgd.js";import"./useQueries-BNgXdYau.js";import"./calendar-event-sidebar-Dy-5E4fW.js";import"./calendar-guests-CGyi0Z1i.js";import"./circle-help-BT_Dohsy.js";import"./useCalendarData-4TkWGBli.js";import"./useCalendarTasks-Ch-qSnN_.js";import"./draft-BeV5oY-T.js";import"./useCalendarScheduling-DSmz3E5d.js";import"./useDebouncedValue-B6s52mZt.js";import"./calendar-format-BwCpz-JZ.js";import"./reply-BRbg9_Ak.js";import"./useMediaQuery-CXurPMbN.js";import"./calendar-TkJ4zEO8.js";import"./CalendarQuickCreate-BtDiOQnj.js";import"./CalendarSession-BSPnENrr.js";const h=o;export{h as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n,f as i,u as a,r as m,j as s}from"./index-Q7BlLS9p.js";import{O as p}from"./OnboardingWizard-B9A2fDSa.js";import{c}from"./onboarding-completion-BB19AMJ-.js";import"./checkbox-CJ4cnZfk.js";import"./kbd-Bxe2zQGe.js";import"./credential-steps-CtTCRP2k.js";import"./card-BPN5dp6F.js";import"./account-form-helpers-DhckT_PN.js";import"./file-json-D8vlo3ob.js";function O(){const o=n(),e=i(),t=a(),r=m.useCallback(l=>{c({queryClient:e,recordCompleted:()=>o.recordEvent("onboarding.completed"),navigateToInbox:()=>{window.location.assign("/mail")}})},[o,e]);return s.jsx(p,{skipWelcome:!1,onComplete:r,onImportConfig:()=>{t({to:"/import"})}})}export{O as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o,O as i}from"./index-Q7BlLS9p.js";import{a as m}from"./MailShell-B8hUSN5k.js";import{u as p,O as t}from"./OutboxPane-C-1N19Mm.js";import"./reply-BRbg9_Ak.js";import{u as s}from"./search-mirror-CkH8xzbq.js";import"./useMessageBodyContent-DJ1-V3VF.js";import"./FullCompose-C6KtKdIN.js";import"./ErrorState-BjlNwjgd.js";import"./index-IYu0bmf1.js";import"./useSignature-BtR5UuiQ.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B6s52mZt.js";import"./sections-Bz9kplXE.js";import"./useMediaQuery-CXurPMbN.js";import"./confirm-dialog-DtOnF5MV.js";import"./roving-focus-Cj5YFxIj.js";import"./MessageBody-0P-UxriZ.js";import"./kbd-Bxe2zQGe.js";import"./search-scope-UI1H6AzA.js";import"./circle-check-big-DtREikeq.js";import"./clock-rdLLgeDx.js";import"./row-actions-D3zwQA9I.js";import"./rotate-ccw-Yghgmp4e.js";import"./NavMenuButton-lXQswWUS.js";import"./menu-BzT426Ih.js";import"./outbox-status-BlKn6P0x.js";function w(){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{w as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,q as N,f as I,r as c,bI as z,a as C,g as k,bJ as P,bK as A,B as S,X as O,u as T,aL as $,av as q,bL as M,aN as R,bM as D,bN as G,S as K}from"./index-Q7BlLS9p.js";import{E}from"./ErrorState-BjlNwjgd.js";import{K as f}from"./kbd-Bxe2zQGe.js";import{a as V,S as Q}from"./settings-screen-DlzqJ0HQ.js";import{u as B}from"./useDebouncedValue-B6s52mZt.js";import{s as _}from"./help-copy-z6sn-HSk.js";import"./avatar-_Iz-lpCN.js";import"./menu-BzT426Ih.js";import"./circle-help-BT_Dohsy.js";function F({options:t,active:r,onSelect:m}){return e.jsx("div",{role:"tablist",className:N("flex shrink-0 gap-1 overflow-x-auto border-b border-line p-2","lg:w-44 lg:flex-col lg:gap-0 lg:overflow-visible lg:border-r lg:border-b-0 lg:py-2 lg:pr-2 lg:pl-3"),children:t.map(n=>{const d=n.id===r;return e.jsxs("button",{type:"button",role:"tab","aria-selected":d,onClick:()=>m(n.id),className:N("flex min-h-11 shrink-0 items-center gap-2 rounded-md px-3 text-left text-sm transition-colors lg:min-h-0 lg:px-2 lg:py-1",d?"bg-accent-2-soft font-medium text-accent-2":"text-fg-muted hover:bg-surface-sunken hover:text-fg"),children:[e.jsx("span",{className:"flex-1 truncate",children:n.label}),e.jsx("span",{className:N("text-2xs tabular-nums",d?"text-accent-2":"text-fg-subtle"),children:n.count??"—"})]},n.id)})})}const y={vip:"VIPs",muted:"Muted",blocked:"Blocked"};function H({query:t,onCount:r}){const{data:m,isPending:n,isError:d,error:b}=C(D()),g=I(),i=k({...P(),onSettled:()=>{g.invalidateQueries({queryKey:G()})}}),l=m?.suggestions??[],p=t.trim().toLowerCase(),u=p?l.filter(a=>(a.displayName??"").toLowerCase().includes(p)||a.normalizedEmail.toLowerCase().includes(p)):l;return c.useEffect(()=>{r?.(u.length,l.length)},[r,u.length,l.length]),n?e.jsx("div",{className:"px-row-inset py-3 text-sm text-fg-subtle animate-pulse",children:"Loading VIP suggestions…"}):d?e.jsx("div",{className:"px-row-inset py-3",children:e.jsx(E,{variant:"inline",title:"Couldn't load VIP suggestions",error:b})}):l.length===0?e.jsxs("div",{className:"px-row-inset py-5 text-sm text-fg-subtle",children:["No VIP suggestions yet. As you reply to senders, they'll appear here. Press ",e.jsx(f,{children:"v"})," on any message to promote a sender to VIP."]}):u.length===0?e.jsxs("p",{className:"px-row-inset py-5 text-sm text-fg-subtle",children:["No VIPs match “",t,"”."]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-row-inset py-1 text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Suggested — promote to VIP"}),u.map(a=>e.jsx(V,{name:a.displayName??a.normalizedEmail,email:a.normalizedEmail,meta:a.replyCount>0?`${a.inboundCount} received · you replied ${a.replyCount}×`:`${a.inboundCount} received · you've never replied`,trailing:e.jsx(S,{variant:"ghost",size:"sm",icon:e.jsx(K,{className:"size-3.5"}),"aria-busy":i.isPending,onClick:()=>{i.isPending||i.mutate({path:{addressId:a.addressId},body:{flags:{vip:{value:!0,setAt:Date.now(),setBy:"user"}}}})},children:"Add VIP"})},a.addressId))]})}function J({group:t,query:r,onCount:m}){const n=B(r.trim(),300),d=I(),[b,g]=c.useState(null),i=n.length>=2,l=z({query:{q:n,limit:50}}),{data:p,isPending:u,isError:a,error:j}=C({...l,enabled:i}),x=k({...P(),onSuccess:()=>{d.invalidateQueries({queryKey:l.queryKey})}}),h=(p?.items??[]).filter(s=>t==="muted"?s.flags?.muted?.value??!1:s.flags?.blocked?.value??!1);return c.useEffect(()=>{m?.(i?h.length:0,null)},[m,i,h.length]),i?u?e.jsx("div",{className:"px-row-inset py-3 text-sm text-fg-subtle animate-pulse",children:"Searching…"}):a?e.jsx("div",{className:"px-row-inset py-3",children:e.jsx(E,{variant:"inline",title:"Search failed",error:j})}):h.length===0?e.jsxs("p",{className:"px-row-inset py-5 text-sm text-fg-subtle",children:["No ",y[t].toLowerCase()," senders matching “",n,"”."]}):e.jsx(e.Fragment,{children:h.map(s=>{const o=t==="muted"?s.flags?.muted:s.flags?.blocked,v=o?[`${t}`,o.setAt&&A(o.setAt,{month:"short",year:"numeric"})||null,o.reason?`— ${o.reason}`:null].filter(Boolean).join(" "):t,w=x.isPending&&x.variables?.path.addressId===s.addressId,L=x.isError&&b===s.addressId;return e.jsx(V,{name:s.displayName??s.normalizedEmail,email:s.normalizedEmail,danger:t==="blocked",meta:v,trailing:L?e.jsx(S,{variant:"secondary",size:"sm",onClick:()=>{g(s.addressId),x.mutate({path:{addressId:s.addressId},body:{flags:{[t]:{value:!1,setAt:Date.now()}}}})},children:"Retry"}):e.jsx(S,{variant:"ghost",size:"sm",icon:e.jsx(O,{className:"size-3.5"}),"aria-busy":w,"aria-label":`Remove ${t} flag`,onClick:()=>{w||(g(s.addressId),x.mutate({path:{addressId:s.addressId},body:{flags:{[t]:{value:!1,setAt:Date.now()}}}}))}})},s.addressId)})}):e.jsxs("div",{className:"px-row-inset py-5 text-sm text-fg-subtle space-y-2",children:[e.jsxs("p",{children:["Type 2+ characters to search ",y[t].toLowerCase()," ","senders by name or address."]}),e.jsxs("p",{className:"text-2xs text-fg-subtle",children:["Note: a dedicated flagged-address list endpoint is in the backlog. Press ",e.jsx(f,{children:"m"})," on any message to mute its sender; ",e.jsx(f,{children:"b"})," to block."]})]})}function ne(){const t=T(),[r,m]=c.useState("vip"),[n,d]=c.useState(""),[b,g]=c.useState(!0),[i,l]=c.useState(0),[p,u]=c.useState({vip:0,muted:null,blocked:null}),a=c.useCallback((s,o)=>{l(s),u(v=>({...v,vip:o}))},[]),j=c.useCallback((s,o)=>{l(s),u(v=>({...v,[r]:s}))},[r]),x=p[r],h=s=>{const o=R[s];o&&t({to:o})};return e.jsx(Q,{items:$,activeId:"senders",title:"Senders & Rules",description:"Per-sender preferences — set with one key from any message, managed here.",flush:!0,help:_,helpOpen:b,onToggleHelp:()=>g(s=>!s),onSelect:h,onBackToMail:()=>{t({to:"/mail"})},children:e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col lg:flex-row",children:[e.jsx(F,{active:r,onSelect:s=>{m(s),d("")},options:["vip","muted","blocked"].map(s=>({id:s,label:y[s],count:p[s]}))}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsx("div",{className:"border-b border-line px-row-inset py-2",children:e.jsx(q,{icon:e.jsx(M,{className:"size-4"}),placeholder:`Filter ${y[r].toLowerCase()} by name or address`,className:"h-8 max-w-sm",value:n,onChange:s=>d(s.target.value)})}),e.jsx("div",{className:"min-h-0 flex-1 divide-y divide-line overflow-y-auto",children:r==="vip"?e.jsx(H,{query:n,onCount:a}):e.jsx(J,{group:r,query:n,onCount:j})}),e.jsxs("footer",{className:"flex items-center justify-between border-t border-line px-row-inset py-1 text-2xs text-fg-subtle",children:[e.jsx("span",{children:x!=null?`${i} of ${x} flagged senders`:`${i} flagged senders`}),e.jsxs("span",{children:[e.jsx(f,{children:"j"})," ",e.jsx(f,{children:"k"})," navigate · ",e.jsx(f,{children:"⌫"})," remove flag"]})]})]})]})})}export{J as SearchGroupPane,ne as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,O as o}from"./index-Q7BlLS9p.js";const n=()=>t.jsx(o,{});export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as e}from"./index-Q7BlLS9p.js";const d=e("CloudOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]]);const h=e("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);export{d as C,h as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./index-Q7BlLS9p.js";import{a as s,D as e}from"./useMediaQuery-CXurPMbN.js";const i=768,a=t=>t!=="desktop",p=()=>{const t=s(`(min-width: ${i}px)`);return s(e)?"desktop":t?"tablet":"phone"};export{a as i,p as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d7 as Q,d8 as y,d9 as S,da as w,db as C,f as k,dc as q,dd as x,r as p,de as M,df as H,dg as L,dh as P,di as O,dj as B,dk as A}from"./index-Q7BlLS9p.js";function R(r,e){const s=new Set(e);return r.filter(t=>!s.has(t))}function T(r,e,s){const t=r.slice(0);return t[e]=s,t}var j=class extends Q{#i;#e;#n;#r;#s;#t;#o;#u;#h;#a=[];constructor(r,e,s){super(),this.#i=r,this.#r=s,this.#n=[],this.#s=[],this.#e=[],this.setQueries(e)}onSubscribe(){this.listeners.size===1&&this.#s.forEach(r=>{r.subscribe(e=>{this.#f(r,e)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#s.forEach(r=>{r.destroy()})}setQueries(r,e){this.#n=r,this.#r=e,y.batch(()=>{const s=this.#s,t=this.#d(this.#n);t.forEach(o=>o.observer.setOptions(o.defaultedQueryOptions));const i=t.map(o=>o.observer),n=i.map(o=>o.getCurrentResult()),u=s.length!==i.length,c=i.some((o,f)=>o!==s[f]),d=u||c,b=d?!0:n.some((o,f)=>{const g=this.#e[f];return!g||!S(o,g)});!d&&!b||(d&&(this.#a=t,this.#s=i),this.#e=n,this.hasListeners()&&(d&&(R(s,i).forEach(o=>{o.destroy()}),R(i,s).forEach(o=>{o.subscribe(f=>{this.#f(o,f)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#s.map(r=>r.getCurrentQuery())}getObservers(){return this.#s}getOptimisticResult(r,e){const s=this.#d(r),t=s.map(n=>n.observer.getOptimisticResult(n.defaultedQueryOptions)),i=s.map(n=>n.defaultedQueryOptions.queryHash);return[t,n=>this.#l(n??t,e,i),()=>this.#c(t,s)]}#c(r,e){return e.map((s,t)=>{const i=r[t];return s.defaultedQueryOptions.notifyOnChangeProps?i:s.observer.trackResult(i,n=>{e.forEach(u=>{u.observer.trackProp(n)})})})}#l(r,e,s){if(e){const t=this.#h,i=s!==void 0&&t!==void 0&&(t.length!==s.length||s.some((n,u)=>n!==t[u]));return(!this.#t||this.#e!==this.#u||i||e!==this.#o)&&(this.#o=e,this.#u=this.#e,s!==void 0&&(this.#h=s),this.#t=w(this.#t,e(r))),this.#t}return r}#b(){return this.#r?.combine!==void 0&&this.#s.some((r,e)=>r.options.suspense&&this.#e[e]?.data===void 0)}#d(r){const e=new Map;this.#s.forEach(t=>{const i=t.options.queryHash;if(!i)return;const n=e.get(i);n?n.push(t):e.set(i,[t])});const s=[];return r.forEach(t=>{const i=this.#i.defaultQueryOptions(t),u=e.get(i.queryHash)?.shift()??new C(this.#i,i);s.push({defaultedQueryOptions:i,observer:u})}),s}#f(r,e){const s=this.#s.indexOf(r);s!==-1&&(this.#e=T(this.#e,s,e),this.#p())}#p(){if(this.hasListeners()){const r=this.#c(this.#e,this.#a),e=this.#b(),s=this.#t,t=e?s:this.#l(r,this.#r?.combine);(e||s!==t)&&y.batch(()=>{this.listeners.forEach(i=>{i(this.#e)})})}}};function I({queries:r,...e},s){const t=k(),i=q(),n=x(),u=p.useMemo(()=>r.map(h=>{const a=t.defaultQueryOptions(h);return a._optimisticResults=i?"isRestoring":"optimistic",a}),[r,t,i]);u.forEach(h=>{M(h);const a=t.getQueryCache().get(h.queryHash);H(h,n,a)}),L(n);const[c]=p.useState(()=>new j(t,u,e)),[d,b,o]=c.getOptimisticResult(u,e.combine),f=!i&&e.subscribed!==!1;p.useSyncExternalStore(p.useCallback(h=>f?c.subscribe(y.batchCalls(h)):P,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),p.useEffect(()=>{c.setQueries(u,e)},[u,e,c]);const m=d.some((h,a)=>O(u[a],h))?d.flatMap((h,a)=>{const l=u[a];if(l&&O(l,h)){const E=new C(t,l);return B(l,E,n)}return[]}):[];if(m.length>0)throw Promise.all(m);const v=d.find((h,a)=>{const l=u[a];return l&&A({result:h,errorResetBoundary:n,throwOnError:l.throwOnError,query:t.getQueryCache().get(l.queryHash),suspense:l.suspense})});if(v?.error)throw v.error;return b(o())}export{I as u};
|