@remit/web-client-dist 0.0.675 → 0.0.677
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-BzlqkW4r.js → BriefPane-dae720lw.js} +1 -1
- package/assets/CalendarEventEditor-D8lJfjiB.js +1 -0
- package/assets/CalendarEventPopup-qgqMLo7x.js +1 -0
- package/assets/CalendarLoadFailed-CZZrv3kl.js +1 -0
- package/assets/CalendarQuickCreate-BtDiOQnj.js +1 -0
- package/assets/CalendarSession-BSPnENrr.js +1 -0
- package/assets/DesktopChrome-wrncK03X.js +1 -0
- package/assets/{EmptyState-dD_YhGMH.js → EmptyState-DaDveift.js} +1 -1
- package/assets/{ErrorState-nA0Ptq3g.js → ErrorState-BjlNwjgd.js} +1 -1
- package/assets/{FlaggedPane-BwhUf1qN.js → FlaggedPane-BMM1CFDP.js} +1 -1
- package/assets/{FullCompose-dJ4mfUrX.js → FullCompose-C6KtKdIN.js} +1 -1
- package/assets/{LabelApplyTrigger-BA7ANeDk.js → LabelApplyTrigger-BOo72opb.js} +1 -1
- package/assets/MailShell-B8hUSN5k.js +1 -0
- package/assets/{MailViewChrome-BEx9Dr1Z.js → MailViewChrome-ByS8tz5h.js} +1 -1
- package/assets/{MailboxPane-DYgnYeOy.js → MailboxPane-CAAszcbD.js} +1 -1
- package/assets/{MessageBody-Deha778B.js → MessageBody-0P-UxriZ.js} +1 -1
- package/assets/MessageToolbar-CpGOUJZt.js +1 -0
- package/assets/NavMenuButton-lXQswWUS.js +1 -0
- package/assets/{OnboardingWizard-hfP07hpw.js → OnboardingWizard-B9A2fDSa.js} +1 -1
- package/assets/{OutboxPane-gEXLW7BJ.js → OutboxPane-C-1N19Mm.js} +1 -1
- package/assets/_calendarObjectId-DZUruQVS.js +1 -0
- package/assets/_mailboxId-BJ_K1owi.js +1 -0
- package/assets/_messageId-Bv7rw2Ee.js +1 -0
- package/assets/_messageId-CxEtXKOV.js +1 -0
- package/assets/_messageId-Dn--s-1U.js +1 -0
- package/assets/_outboxMessageId-CtKRsjsP.js +1 -0
- package/assets/_recurrenceId-BmfvBHMQ.js +1 -0
- package/assets/_threadId-CYfh6U5z.js +1 -0
- package/assets/_threadId-DR-VADHf.js +1 -0
- package/assets/_threadId-_Tp38Jjp.js +1 -0
- package/assets/_view._date-CQz1dtN-.js +1 -0
- package/assets/{account-service-status-Kz9s3jOk.js → account-service-status-Cn_S-syP.js} +1 -1
- package/assets/accounts-BBs1u3a9.js +1 -0
- package/assets/{advanced-CudHnY-7.js → advanced-NdwM48ef.js} +1 -1
- package/assets/{appearance-BTH52atO.js → appearance-CN3GLLqL.js} +1 -1
- package/assets/{avatar-vPm9XfmM.js → avatar-_Iz-lpCN.js} +1 -1
- package/assets/{bottom-sheet-BTdseD_6.js → bottom-sheet-zjs6jE40.js} +1 -1
- package/assets/brief-DxWizfDz.js +1 -0
- package/assets/{brief-DuHUqR8b.js → brief-SkDhbGUS.js} +1 -1
- package/assets/calendar-089QTsHp.js +1 -0
- package/assets/calendar-TkJ4zEO8.js +1 -0
- package/assets/calendar-event-popup-Eoorlfr8.js +1 -0
- package/assets/calendar-event-sidebar-Dy-5E4fW.js +1 -0
- package/assets/{calendar-failure-note-BUFaaizf.js → calendar-failure-note-DGOwCvAu.js} +1 -1
- package/assets/calendar-format-BwCpz-JZ.js +1 -0
- package/assets/calendar-guests-CGyi0Z1i.js +1 -0
- package/assets/calendar-suggestion-CwP3NZgH.js +1 -0
- package/assets/calendars-C-lW-6Ji.js +1 -0
- package/assets/{card-865cdsJK.js → card-BPN5dp6F.js} +1 -1
- package/assets/{checkbox-Qon94b1C.js → checkbox-CJ4cnZfk.js} +1 -1
- package/assets/{circle-check-Db07NpOC.js → circle-check-BLyY37Bq.js} +1 -1
- package/assets/{circle-check-big-CyVG6r7N.js → circle-check-big-DtREikeq.js} +1 -1
- package/assets/{circle-help-CVShnhWn.js → circle-help-BT_Dohsy.js} +1 -1
- package/assets/{clock-B9kFW89H.js → clock-rdLLgeDx.js} +1 -1
- package/assets/compose._-_outboxMessageId_-BTbEyzkW.js +1 -0
- package/assets/compose._-_outboxMessageId_-BtcobB1K.js +1 -0
- package/assets/compose._-_outboxMessageId_-CfMr_J5t.js +1 -0
- package/assets/compose._-_outboxMessageId_-CqlGCna1.js +1 -0
- package/assets/{config-import-C2ovEkHy.js → config-import-CkiEFeqC.js} +1 -1
- package/assets/{confirm-dialog-CgMAaLI3.js → confirm-dialog-DtOnF5MV.js} +1 -1
- package/assets/{copy-CIKgpUwt.js → copy--8c5mY8r.js} +1 -1
- package/assets/{credential-steps-BWguS0eW.js → credential-steps-CtTCRP2k.js} +1 -1
- package/assets/{download-A4hq8dWf.js → download-BKDG5QA1.js} +1 -1
- package/assets/draft-BeV5oY-T.js +1 -0
- package/assets/edit-BTLe8Y0F.js +1 -0
- package/assets/edit-ByggXvS8.js +1 -0
- package/assets/{external-link-DaKTW3eK.js → external-link-C55BTLfs.js} +1 -1
- package/assets/{file-json-DiHW8YBd.js → file-json-D8vlo3ob.js} +1 -1
- package/assets/{filters-1uKuLkQU.js → filters-BQo3gMJ3.js} +1 -1
- package/assets/{flagged-BIza20sq.js → flagged-BXI9KzeP.js} +1 -1
- package/assets/flagged-DJ-TC-JA.js +1 -0
- package/assets/{folders-Bd16ltK4.js → folders-CMN67g3r.js} +1 -1
- package/assets/{help-copy-N4JgEUmu.js → help-copy-z6sn-HSk.js} +1 -1
- package/assets/{import-DJptfpxt.js → import-CT3XcMFi.js} +1 -1
- package/assets/index-6I3CIFzv.js +1 -0
- package/assets/index-B03cLsmc.js +1 -0
- package/assets/index-B_Kp6tBV.js +1 -0
- package/assets/index-BqhbwSzu.js +1 -0
- package/assets/{index-C8VKP1dT.css → index-Cr6oUxXl.css} +1 -1
- package/assets/index-Cs95BuoI.js +1 -0
- package/assets/index-Cua4RHkF.js +1 -0
- package/assets/index-D_cEGMwi.js +1 -0
- package/assets/index-Dn--s-1U.js +1 -0
- package/assets/index-HzhXMggl.js +1 -0
- package/assets/{index-BWAq8iOl.js → index-IYu0bmf1.js} +4 -4
- package/assets/{index-BzL5-pGT.js → index-Q7BlLS9p.js} +84 -84
- package/assets/index-_NrXWlZY.js +1 -0
- package/assets/{kbd-B9MFmWVU.js → kbd-Bxe2zQGe.js} +1 -1
- package/assets/{labels-DeCZEWet.js → labels-B030K3QL.js} +1 -1
- package/assets/mail-BuB5wUpu.js +1 -0
- package/assets/{menu-CGw_RHKl.js → menu-BzT426Ih.js} +1 -1
- package/assets/new-CRVRIIK_.js +1 -0
- package/assets/onboarding-C65aa4Nh.js +1 -0
- package/assets/{onboarding-completion-DbgUYeRa.js → onboarding-completion-BB19AMJ-.js} +1 -1
- package/assets/outbox-DAPK8OVn.js +1 -0
- package/assets/{pencil-DOoqyGzC.js → pencil-CPbJ6Tks.js} +1 -1
- package/assets/{popover-menu-CNiMANtf.js → popover-menu-O_sOnKG9.js} +1 -1
- package/assets/{refresh-cw-D1SQy8O7.js → refresh-cw-CIoRjIJp.js} +1 -1
- package/assets/{reply-CQarAZxU.js → reply-BRbg9_Ak.js} +1 -1
- package/assets/{rich-text-DgI7vzll.js → rich-text-B5WZj9gV.js} +14 -14
- package/assets/{rich-text-spellcheck-worker-provider-paPOw9As.js → rich-text-spellcheck-worker-provider-BR2Tfepe.js} +1 -1
- package/assets/{rotate-ccw-DPB71584.js → rotate-ccw-Yghgmp4e.js} +1 -1
- package/assets/{roving-focus-Coea111y.js → roving-focus-Cj5YFxIj.js} +1 -1
- package/assets/{row-actions-CiZruXil.js → row-actions-D3zwQA9I.js} +1 -1
- package/assets/{search-mirror-_Dap9COg.js → search-mirror-CkH8xzbq.js} +1 -1
- package/assets/{search-token-index-DQHE1g7A.js → search-token-index-Box28J2l.js} +1 -1
- package/assets/{sections-C6oVXjho.js → sections-Bz9kplXE.js} +1 -1
- package/assets/{senders-DIVpkzIq.js → senders-DnVrQngr.js} +1 -1
- package/assets/settings-emdtCHOi.js +1 -0
- package/assets/{settings-screen-4md2ibPl.js → settings-screen-DlzqJ0HQ.js} +1 -1
- package/assets/{shield-check-BcUXVpR8.js → shield-check-BSecZw5t.js} +1 -1
- package/assets/{sparkles-C1l6GCPT.js → sparkles-t4_3JyEx.js} +1 -1
- package/assets/{suggested-vips-iEt-4yp9.js → suggested-vips-0F7iDlFJ.js} +1 -1
- package/assets/suggestion._suggestionId-Bz7HzxP1.js +1 -0
- package/assets/task._calendarTaskId-D7UXvB0Z.js +1 -0
- package/assets/{undo-2-DHJ6nykB.js → undo-2-Dw4FFZmo.js} +1 -1
- package/assets/useCalendarData-4TkWGBli.js +2 -0
- package/assets/useCalendarScheduling-DSmz3E5d.js +1 -0
- package/assets/useCalendarSuggestions-DHNLR9_9.js +1 -0
- package/assets/useCalendarTasks-Ch-qSnN_.js +1 -0
- package/assets/{useDebouncedValue-B7157ZPO.js → useDebouncedValue-B6s52mZt.js} +1 -1
- package/assets/{useFilters-C3bLY42W.js → useFilters-CYaLiKrQ.js} +1 -1
- package/assets/{useLabels-DYdHiHXI.js → useLabels-Ci_KO517.js} +1 -1
- package/assets/useLayoutTier-DPp2gD1F.js +1 -0
- package/assets/{useMediaQuery-7Q3jBluO.js → useMediaQuery-CXurPMbN.js} +1 -1
- package/assets/useMessageBodyContent-DJ1-V3VF.js +1 -0
- package/assets/{useQueries-Sm8S3Cgh.js → useQueries-BNgXdYau.js} +1 -1
- package/assets/{useRefreshControl-bA8HK_j-.js → useRefreshControl-BVxIaWvo.js} +1 -1
- package/assets/{useResultFolderIndex-BaqajWHb.js → useResultFolderIndex-BGDx2gSv.js} +1 -1
- package/assets/{useSignature-sxHvGfKr.js → useSignature-BtR5UuiQ.js} +1 -1
- package/assets/{warnings-ByqpxH4J.js → warnings-C4WaZxJm.js} +4 -4
- package/index.html +2 -2
- package/package.json +1 -1
- package/assets/AppFrame-R9FR9SH9.js +0 -1
- package/assets/CalendarEventEditor-BpGmPZ2Z.js +0 -1
- package/assets/CalendarEventPopup-Brcgx7tV.js +0 -1
- package/assets/CalendarQuickCreate-CwkBXqAB.js +0 -1
- package/assets/CalendarSession--XFP5lXS.js +0 -1
- package/assets/MailShell-0sTtK1xD.js +0 -1
- package/assets/MessageToolbar-5T47fDWC.js +0 -1
- package/assets/NavMenuButton-C-7-t18I.js +0 -1
- package/assets/_calendarObjectId-Dbrtihva.js +0 -1
- package/assets/_mailboxId-B587Zr5T.js +0 -1
- package/assets/_messageId-BxlZMqGk.js +0 -1
- package/assets/_messageId-CRIBYDCW.js +0 -1
- package/assets/_messageId-DTs144Nv.js +0 -1
- package/assets/_outboxMessageId-BxdPyrXI.js +0 -1
- package/assets/_recurrenceId-QBmk5dbN.js +0 -1
- package/assets/_threadId-8Y3P5szz.js +0 -1
- package/assets/_threadId-AMQdO9xw.js +0 -1
- package/assets/_threadId-mpk_WkaQ.js +0 -1
- package/assets/_view._date-BfJq9sBQ.js +0 -1
- package/assets/accounts-B5C8kCn6.js +0 -1
- package/assets/brief-BC_KN7ph.js +0 -1
- package/assets/calendar-BQjH3OHS.js +0 -1
- package/assets/calendar-LLRgZQzl.js +0 -1
- package/assets/calendar-event-popup-Mft0N_sd.js +0 -1
- package/assets/calendar-event-sidebar-D5vjFGdS.js +0 -1
- package/assets/calendar-report-CzeBcU6C.js +0 -1
- package/assets/calendar-suggestion-ClsxDTZs.js +0 -1
- package/assets/calendars-zYfPB3b8.js +0 -1
- package/assets/compose._-_outboxMessageId_-BkKmzR39.js +0 -1
- package/assets/compose._-_outboxMessageId_-BnYGu6ez.js +0 -1
- package/assets/compose._-_outboxMessageId_-C5Aukg6m.js +0 -1
- package/assets/compose._-_outboxMessageId_-Ck-eEtzy.js +0 -1
- package/assets/edit-CxVYhmi5.js +0 -1
- package/assets/edit-DXN-G3Tu.js +0 -1
- package/assets/flagged-DmSptMzm.js +0 -1
- package/assets/index-B18BvpkW.js +0 -1
- package/assets/index-B4pYEqZI.js +0 -1
- package/assets/index-B77HnSA5.js +0 -1
- package/assets/index-BZdYp7ae.js +0 -1
- package/assets/index-BiCNOLIH.js +0 -1
- package/assets/index-CoCVPZ34.js +0 -1
- package/assets/index-CroyVnhC.js +0 -1
- package/assets/index-DTs144Nv.js +0 -1
- package/assets/index-DsgtllX4.js +0 -1
- package/assets/index-DupXMcS6.js +0 -1
- package/assets/mail-CSUpbRUP.js +0 -1
- package/assets/new-DVwQ9Ia3.js +0 -1
- package/assets/onboarding-CDWqPDW8.js +0 -1
- package/assets/outbox-Ct7VdX2v.js +0 -1
- package/assets/settings-Cv257vpL.js +0 -1
- package/assets/suggestion._suggestionId-BQw9qGr-.js +0 -1
- package/assets/useCalendarData-Bz4EDHDO.js +0 -2
- package/assets/useCalendarSuggestions-DcYFtQhb.js +0 -1
- package/assets/useLayoutTier-5aJYrTut.js +0 -1
- package/assets/useMessageBodyContent-CWGtiddz.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r,r as M,o as Pe,ae as Ve,d as se,S as Rs,X as De,af as Is,ag as Ms,ah as mt,p as Os,q as Ls,ai as Us,aj as Hs,ak as te,al as zs,am as $s,an as Bs,f as Ke,ao as qs,a as ns,c as os,ap as Ws,g as he,aq as Gs,l as je,i as ht,ar as Ks,as as Ys,at as Qs,au as ve,av as Ct,L as rt,aw as _t,ax as Zs,ay as Me,az as Ae,aA as Xs,aB as it,B as at,aC as Js,aD as er,aE as Vt,m as ls,N as tr,aF as sr,aG as rr,aH as cs,aI as Pt,u as ir,aJ as ar,aK as nr,e as or,aL as Dt,aM as lr,T as cr,aN as dr}from"./index-BzL5-pGT.js";import{A as nt,g as Ft,P as ur,O as fr}from"./OnboardingWizard-hfP07hpw.js";import{f as Rt,E as mr}from"./ErrorState-nA0Ptq3g.js";import{R as hr}from"./row-actions-CiZruXil.js";import{S as pr,A as gr}from"./settings-screen-4md2ibPl.js";import{s as $e,b as ds,R as us,u as xr}from"./credential-steps-BWguS0eW.js";import{u as yr}from"./useSignature-sxHvGfKr.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-CgMAaLI3.js";import{D as jr}from"./download-A4hq8dWf.js";import{a as wr}from"./help-copy-N4JgEUmu.js";import"./checkbox-Qon94b1C.js";import"./kbd-B9MFmWVU.js";import"./file-json-DiHW8YBd.js";import"./avatar-vPm9XfmM.js";import"./menu-CGw_RHKl.js";import"./circle-help-CVShnhWn.js";import"./card-865cdsJK.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};
|
package/assets/brief-BC_KN7ph.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r,O as i}from"./index-BzL5-pGT.js";import{a as m}from"./MailShell-0sTtK1xD.js";import{B as o}from"./BriefPane-BzlqkW4r.js";import"./reply-CQarAZxU.js";import{a as p}from"./search-token-index-DQHE1g7A.js";import{u as e}from"./search-mirror-_Dap9COg.js";import"./useMessageBodyContent-CWGtiddz.js";import"./FullCompose-dJ4mfUrX.js";import"./ErrorState-nA0Ptq3g.js";import"./index-BWAq8iOl.js";import"./useSignature-sxHvGfKr.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B7157ZPO.js";import"./sections-C6oVXjho.js";import"./useMediaQuery-7Q3jBluO.js";import"./confirm-dialog-CgMAaLI3.js";import"./MessageBody-Deha778B.js";import"./kbd-B9MFmWVU.js";import"./search-scope-UI1H6AzA.js";import"./MessageToolbar-5T47fDWC.js";import"./roving-focus-Coea111y.js";import"./EmptyState-dD_YhGMH.js";import"./popover-menu-CNiMANtf.js";import"./avatar-vPm9XfmM.js";import"./useQueries-Sm8S3Cgh.js";import"./undo-2-DHJ6nykB.js";import"./download-A4hq8dWf.js";import"./calendar-suggestion-ClsxDTZs.js";import"./sparkles-C1l6GCPT.js";import"./useCalendarSuggestions-DcYFtQhb.js";import"./calendar-report-CzeBcU6C.js";import"./calendar-failure-note-BUFaaizf.js";import"./checkbox-Qon94b1C.js";import"./clock-B9kFW89H.js";import"./shield-check-BcUXVpR8.js";import"./calendar-LLRgZQzl.js";import"./useLayoutTier-5aJYrTut.js";import"./menu-CGw_RHKl.js";import"./useFilters-C3bLY42W.js";import"./useRefreshControl-bA8HK_j-.js";import"./circle-check-big-CyVG6r7N.js";import"./refresh-cw-D1SQy8O7.js";import"./LabelApplyTrigger-BA7ANeDk.js";import"./useLabels-DYdHiHXI.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{u,a as p,c as l,r as m,j as t,A as f,O as g}from"./index-BzL5-pGT.js";import{E as d}from"./ErrorState-nA0Ptq3g.js";import{A as x}from"./AppFrame-R9FR9SH9.js";import"./reply-CQarAZxU.js";import{u as h}from"./calendar-LLRgZQzl.js";import"./roving-focus-Coea111y.js";import"./useLayoutTier-5aJYrTut.js";import"./useMediaQuery-7Q3jBluO.js";function N(){const e=u(),s=h(),{data:o,isLoading:a,isError:n,error:i,refetch:c}=p({...l(),staleTime:1/0}),r=!!(o&&(o.accounts?.length??0)===0);return m.useEffect(()=>{r&&e({to:"/onboarding",replace:!0})},[r,e]),n?t.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:t.jsx(d,{title:"Couldn't load your account",error:i,onRetry:()=>{c()}})}):t.jsx(x,{hideTabBar:s,children:a||r?t.jsx(f,{}):t.jsx(g,{})})}export{N as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{K as O,r as d,u as b,J as u,cA as F,cC as E,ce as T}from"./index-BzL5-pGT.js";import{g as C}from"./reply-CQarAZxU.js";function R(e,n){if(e===void 0)return{shouldBlockFn:()=>!0,withResolver:!1};if("shouldBlockFn"in e)return e;if(typeof e=="function")return{shouldBlockFn:async()=>await e(),enableBeforeUnload:!0,withResolver:!1};const a=!!(e.condition??!0),t=e.blockerFn;return{shouldBlockFn:async()=>a&&t!==void 0?await t():a,enableBeforeUnload:a,withResolver:t===void 0}}function y(e,n){const{shouldBlockFn:a,enableBeforeUnload:t=!0,disabled:s=!1,withResolver:f=!1}=R(e),c=O(),{history:i}=c,[v,o]=d.useState({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0});return d.useEffect(()=>{const r=async m=>{function B(h){const w=c.parseLocation(h),p=c.getMatchedRoutes(w.pathname);return p.foundRoute===void 0?{routeId:"__notFound__",fullPath:w.pathname,pathname:w.pathname,params:p.routeParams,search:c.options.parseSearch(h.search)}:{routeId:p.foundRoute.id,fullPath:p.foundRoute.fullPath,pathname:w.pathname,params:p.routeParams,search:c.options.parseSearch(h.search)}}const g=B(m.currentLocation),I=B(m.nextLocation);if(g.routeId==="__notFound__"&&I.routeId!=="__notFound__")return!1;const k=await a({action:m.action,current:g,next:I});if(!f)return k;if(!k)return!1;const _=await new Promise(h=>{o({status:"blocked",current:g,next:I,action:m.action,proceed:()=>h(!1),reset:()=>h(!0)})});return o({status:"idle",current:void 0,next:void 0,action:void 0,proceed:void 0,reset:void 0}),_};return s?void 0:i.block({blockerFn:r,enableBeforeUnload:t})},[a,t,s,f,i,c]),v}const l="/calendar/$view/$date",$="/calendar/$view/$date/suggestion/$suggestionId";function j(){const e=u({from:l,shouldThrow:!1}),n=F({from:l,shouldThrow:!1}),a=e?.view??"",t=e?.date??"",s=n?.calendarId;return d.useMemo(()=>({...E({view:a,date:t},T(new Date)),calendarIds:s??[]}),[a,t,s])}function P(){const e=u({from:"/calendar/$view/$date/$calendarObjectId",shouldThrow:!1}),n=u({from:"/calendar/$view/$date/$calendarObjectId/$recurrenceId",shouldThrow:!1}),a=e?.calendarObjectId,t=n?.recurrenceId;return d.useMemo(()=>a?{calendarObjectId:a,recurrenceId:t}:void 0,[a,t])}function U(){return u({from:$,shouldThrow:!1})?.suggestionId}function S(){const e=u({from:"/calendar/$view/$date/$calendarObjectId/edit",shouldThrow:!1}),n=u({from:"/calendar/$view/$date/$calendarObjectId/$recurrenceId/edit",shouldThrow:!1}),a=e?.calendarObjectId??n?.calendarObjectId,t=n?.recurrenceId;return d.useMemo(()=>a?{calendarObjectId:a,recurrenceId:t}:void 0,[a,t])}function x(){const e=F({from:"/calendar/$view/$date/new",shouldThrow:!1}),n=e?.start,a=e?.end,t=e!==void 0;return d.useMemo(()=>t?{start:n,end:a}:void 0,[t,n,a])}function D(){const e=S(),n=u({from:"/calendar/$view/$date/new",shouldThrow:!1}),a=u({from:$,shouldThrow:!1});return n!==void 0||a!==void 0||e!==void 0}function L(){const e=b(),n=O(),a=C(),{view:t,date:s}=j(),c=P()!==void 0,i=d.useCallback(o=>{e({to:l,params:o,search:!0,hash:a})},[e,a]),v=d.useCallback(o=>n.buildLocation({to:l,params:{view:"day",date:o},search:!0,hash:a}).href,[n,a]);return d.useMemo(()=>({goToView:o=>i({view:o,date:s}),goToToday:()=>i({view:t,date:T(new Date)}),goToDate:o=>i({view:t,date:o}),setCalendarIds:o=>e({to:l,params:{view:t,date:s},search:r=>({...r,calendarId:o.length===0?void 0:[...o]}),hash:!0,replace:!0}),setAnchorDate:o=>{c||e({to:l,params:{view:t,date:o},search:!0,hash:a,replace:!0})},zoomToDay:o=>e({href:v(o)}),dayHref:v,openEvent:(o,r)=>e(r===void 0||r===""?{to:"/calendar/$view/$date/$calendarObjectId",params:{view:t,date:s,calendarObjectId:o},search:!0,hash:a,replace:c,state:{openedFromView:!0}}:{to:"/calendar/$view/$date/$calendarObjectId/$recurrenceId",params:{view:t,date:s,calendarObjectId:o,recurrenceId:r},search:!0,hash:a,replace:c,state:{openedFromView:!0}}),closeToView:()=>{if(n.state.location.state.openedFromView===!0){n.history.back();return}e({to:l,params:{view:t,date:s},search:o=>({calendarId:o.calendarId}),hash:a,replace:!0})},openNewEvent:o=>e({to:"/calendar/$view/$date/new",params:{view:t,date:s},search:r=>({...r,...o}),hash:a,replace:c,state:{openedFromView:!0}}),setNewEventBounds:o=>e({to:"/calendar/$view/$date/new",params:{view:t,date:s},search:r=>({...r,...o}),hash:!0,replace:!0,state:r=>r}),openEditor:(o,r)=>e(r===void 0||r===""?{to:"/calendar/$view/$date/$calendarObjectId/edit",params:{view:t,date:s,calendarObjectId:o},search:!0,hash:a,replace:c,state:{openedFromView:!0}}:{to:"/calendar/$view/$date/$calendarObjectId/$recurrenceId/edit",params:{view:t,date:s,calendarObjectId:o,recurrenceId:r},search:!0,hash:a,replace:c,state:{openedFromView:!0}}),changeSuggestionFirst:(o,r)=>e({to:$,params:{view:t,date:r,suggestionId:o},search:!0,hash:a})}),[i,e,v,a,t,s,n,c])}function M(){const e=b();return d.useCallback((n,a,t)=>{if(t===""){e({to:"/calendar/$view/$date/$calendarObjectId",params:{view:"day",date:n,calendarObjectId:a}});return}e({to:"/calendar/$view/$date/$calendarObjectId/$recurrenceId",params:{view:"day",date:n,calendarObjectId:a,recurrenceId:t}})},[e])}function A(){const e=b();return d.useCallback((n,a)=>{e({to:$,params:{view:"day",date:n,suggestionId:a}})},[e])}function G(e,n){const a=d.useRef(n);a.current=n,y({shouldBlockFn:({action:t})=>t!=="BACK"?!1:a.current(),enableBeforeUnload:!1,disabled:!e})}export{j as a,L as b,P as c,S as d,y as e,M as f,A as g,G as h,x as i,U as j,D as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,T as g,X as j,o as N,C as v,bX as C}from"./index-BzL5-pGT.js";import{P as y}from"./pencil-DOoqyGzC.js";import{M as k}from"./calendar-report-CzeBcU6C.js";function z({failure:s,focusRef:a}){return e.jsxs("div",{ref:a,role:"alert",tabIndex:-1,className:"flex flex-col gap-2 rounded-md border border-danger/40 bg-danger-soft p-3 text-sm outline-none",children:[e.jsx("p",{className:"text-danger",children:s.text}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{type:"button",onClick:s.onRetry,className:"rounded-md border border-line bg-surface px-3 py-1 text-sm font-medium hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",children:s.retryLabel??"Try again"}),e.jsx("a",{href:s.reportHref,target:"_blank",rel:"noreferrer",className:"text-sm font-medium text-accent hover:underline",children:"Report an issue"})]})]})}const l="flex size-9 items-center justify-center rounded-full text-fg-muted outline-none hover:bg-surface-sunken hover:text-fg focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40";function T({headingId:s,headingRef:a,title:n,color:o,when:c,location:r,calendarName:x,availability:m,onEdit:t,onDelete:i,deleting:u=!1,onClose:f,failure:d,failureRef:b,children:h}){const p=C(o);return e.jsxs("div",{className:"flex flex-col gap-3 p-3",children:[e.jsxs("div",{className:"flex justify-end gap-1",children:[t&&e.jsx("button",{type:"button","aria-label":"Edit",onClick:t,className:l,children:e.jsx(y,{className:"size-4"})}),i&&e.jsx("button",{type:"button","aria-label":"Delete",onClick:i,disabled:u,className:l,children:e.jsx(g,{className:"size-4"})}),e.jsx("button",{type:"button","aria-label":"Close",onClick:f,className:l,children:e.jsx(j,{className:"size-4"})})]}),e.jsxs("div",{className:"flex gap-3 px-2",children:[e.jsx("span",{className:N("mt-1.5 size-3.5 shrink-0 rounded-sm",p.solid),"aria-hidden":"true"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{id:s,ref:a,tabIndex:-1,className:"text-xl font-normal break-words text-fg outline-none",children:n===""?"(No title)":n}),e.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:c})]})]}),e.jsxs("dl",{className:"flex flex-col gap-2 px-2 text-sm",children:[r!==""&&e.jsxs("div",{className:"flex gap-3",children:[e.jsx("dt",{children:e.jsx(k,{className:"size-4 text-fg-subtle","aria-label":"Location"})}),e.jsx("dd",{className:"min-w-0 break-words",children:r})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("dt",{children:e.jsx(v,{className:"size-4 text-fg-subtle","aria-label":"Calendar"})}),e.jsxs("dd",{children:[x," · ",m]})]})]}),h,d&&e.jsx(z,{failure:d,focusRef:b})]})}function E({headingId:s,onClose:a,closeRef:n}){return e.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[e.jsx("h2",{id:s,className:"text-base font-medium text-fg",children:"This event was deleted or moved"}),e.jsx("button",{ref:n,type:"button",onClick:a,className:"self-end rounded-md border border-line px-3 py-1.5 text-sm font-medium hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",children:"Close"})]})}export{z as C,E as a,T as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as F,o as b,j as s,au as h,fG as C,c4 as j,fH as R,at as _,X as I}from"./index-BzL5-pGT.js";import{C as z}from"./calendar-event-popup-Mft0N_sd.js";const U=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],W=["January","February","March","April","May","June","July","August","September","October","November","December"],B=["first","second","third","fourth","last"],y="";function H(e,t){if(!/^\d{4}-\d{2}-\d{2}$/.test(e))return[];const[n,r,i]=e.split("-").map(Number),d=new Date(Date.UTC(n,r-1,i)),o=U[d.getUTCDay()],u=B[Math.min(Math.floor((i-1)/7),4)],l=t===""?"":`, ${t}`,c=d.getUTCDay()>=1&&d.getUTCDay()<=5;return[`Every day${l}`,...c?[`Every weekday${l}`]:[],`Every week on ${o}${l}`,`Every month on the ${u} ${o}${l}`,`Every year on ${i} ${W[r-1]}${l}`]}const g=({draft:e,onChange:t},n,r)=>t({...e,[n]:r});function x({label:e,children:t}){return s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:e}),t]})}function E(e){return e.date===""||e.endDate===""?!1:e.allDay?e.endDate<e.date:e.startTime===""||e.endTime===""?!1:`${e.endDate}T${e.endTime}`<`${e.date}T${e.startTime}`}function J(e,t){return t===""?{...e,date:t}:e.endDate===""?{...e,date:t,endDate:t}:e.date===""?{...e,date:t}:{...e,date:t,endDate:j(t,R(e.date,e.endDate))}}function L(e,t){const n=e.date!==""&&e.endDate===j(e.date,1)&&e.startTime!==""&&e.endTime!==""&&e.endTime<e.startTime;return t&&n?{...e,allDay:t,endDate:e.date}:!t&&e.date!==""&&e.endDate===e.date&&e.startTime!==""&&e.endTime!==""&&e.endTime<e.startTime?{...e,allDay:t,endDate:j(e.date,1)}:{...e,allDay:t}}function P({draft:e,onChange:t,touch:n}){const r=n?"min-h-11":"",i=E(e),d=F.useId(),o={"aria-invalid":i,"aria-describedby":i?d:void 0},u=b("w-40",r,i&&"border-danger/60"),l=b("w-28",r,i&&"border-danger/60");return s.jsxs("div",{className:"flex flex-col gap-1.5",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(h,{type:"date",value:e.date,"aria-label":"Date",...o,onChange:c=>t(J(e,c.target.value)),className:u}),!e.allDay&&s.jsx(h,{type:"time",value:e.startTime,"aria-label":"Start time",...o,onChange:c=>g({draft:e,onChange:t},"startTime",c.target.value),className:l}),s.jsx("span",{className:"text-sm text-fg-subtle",children:"to"}),s.jsx(h,{type:"date",value:e.endDate,"aria-label":"End date",min:e.date===""?void 0:e.date,...o,onChange:c=>g({draft:e,onChange:t},"endDate",c.target.value),className:u}),!e.allDay&&s.jsx(h,{type:"time",value:e.endTime,"aria-label":"End time",...o,onChange:c=>g({draft:e,onChange:t},"endTime",c.target.value),className:l}),s.jsxs("label",{className:"flex items-center gap-2 text-sm text-fg-muted",children:[s.jsx("input",{type:"checkbox",checked:e.allDay,onChange:c=>t(L(e,c.target.checked)),className:"size-4 accent-current"}),"All day"]})]}),i&&s.jsx("p",{id:d,className:"text-xs text-danger",role:"alert",children:e.allDay?`Ends before it starts. Move the end to ${e.date} or later.`:`Ends before it starts. Move the end past ${e.date} ${e.startTime}, or start earlier.`})]})}function G({draft:e,onChange:t,touch:n,repeatEditable:r=!0,onCustom:i}){return r?s.jsx(K,{value:e.repeat,date:e.date,startTime:e.startTime,onChange:d=>g({draft:e,onChange:t},"repeat",d),onCustom:i,className:n?"min-h-11":""}):s.jsxs("p",{className:"flex items-center gap-2 text-sm text-fg-muted",children:[s.jsx(C,{className:"size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.repeat===y?"Does not repeat":e.repeat]})}const k="__custom__";function K({value:e,date:t,startTime:n,onChange:r,onCustom:i,className:d}){const o=H(t,n),u=e===y||o.includes(e)?o:[e,...o];return s.jsxs(_,{icon:s.jsx(C,{className:"size-4"}),"aria-label":"Repeat",value:e,onChange:l=>{if(l.target.value===k){i?.();return}r(l.target.value)},className:d,children:[s.jsx("option",{value:y,children:"Does not repeat"}),u.map(l=>s.jsx("option",{value:l,children:l},l)),i&&s.jsx("option",{value:k,children:"Custom…"})]})}const X="h-9 w-full rounded-md border border-line bg-surface-sunken px-2 text-sm text-fg outline-none focus-visible:border-line-strong focus-visible:ring-2 focus-visible:ring-ring/30 disabled:opacity-60";function Q({heading:e,draft:t,onChange:n,calendars:r,calendarEditable:i,repeatEditable:d,timeZone:o,timeZones:u,onTimeZone:l,busy:c,onBusy:w,onSave:$,onCancel:N,saving:v=!1,saveLabel:S="Save",problem:f="",failure:T,failureRef:A,titleRef:M,touch:m=!1,children:O}){const p=b(X,m&&"h-11"),D=E(t);return s.jsxs("form",{"aria-label":e,"data-event-sidebar":"",className:"flex h-full min-h-0 flex-col bg-surface",onSubmit:a=>{a.preventDefault(),!v&&!D&&$()},children:[s.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-line px-4 py-2",children:[s.jsx("h2",{className:"text-base font-medium text-fg",children:e}),s.jsx("button",{type:"button","aria-label":"Close",onClick:N,className:b("flex items-center justify-center rounded-full text-fg-muted outline-none hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",m?"size-11":"size-8"),children:s.jsx(I,{className:"size-4"})})]}),s.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-4 py-4",children:[s.jsx("input",{ref:M,"aria-label":"Title",placeholder:"Add title",value:t.title,onChange:a=>n({...t,title:a.target.value}),className:"border-b-2 border-line bg-transparent pb-1 text-xl text-fg outline-none placeholder:text-fg-subtle focus:border-accent"}),s.jsx(P,{draft:t,onChange:n,touch:m}),s.jsx(x,{label:"Time zone",children:s.jsx("select",{"aria-label":"Time zone",value:o,onChange:a=>l(a.target.value),className:p,children:u.map(a=>s.jsx("option",{value:a,children:a},a))})}),s.jsx(x,{label:"Repeat",children:s.jsx(G,{draft:t,onChange:n,touch:m,repeatEditable:d})}),s.jsx(x,{label:"Calendar",children:s.jsx("select",{"aria-label":"Calendar",value:t.calendarId,disabled:!i,onChange:a=>n({...t,calendarId:a.target.value}),className:p,children:r.map(a=>s.jsx("option",{value:a.id,children:a.name},a.id))})}),s.jsx(x,{label:"Location",children:s.jsx("input",{"aria-label":"Location",placeholder:"Add location",value:t.location,onChange:a=>n({...t,location:a.target.value}),className:p})}),s.jsx(x,{label:"Show as",children:s.jsxs("select",{"aria-label":"Show as",value:c?"busy":"free",onChange:a=>w(a.target.value==="busy"),className:p,children:[s.jsx("option",{value:"busy",children:"Busy"}),s.jsx("option",{value:"free",children:"Free"})]})}),s.jsx(x,{label:"Description",children:s.jsx("textarea",{"aria-label":"Description",placeholder:"Add description",rows:5,value:t.notes,onChange:a=>n({...t,notes:a.target.value}),className:"w-full rounded-md border border-line bg-surface-sunken px-3 py-2 text-sm text-fg outline-none focus-visible:ring-2 focus-visible:ring-ring/30"})}),O]}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-2 border-t border-line px-4 py-3",children:[f!==""&&s.jsx("p",{role:"alert",className:"text-sm text-danger",children:f}),T&&s.jsx(z,{failure:T,focusRef:A}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx("button",{type:"button",onClick:N,className:b("rounded-md border border-line px-4 text-sm font-medium hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring",m?"min-h-11":"h-9"),children:"Cancel"}),s.jsx("button",{type:"submit",disabled:v||D,className:b("rounded-md bg-accent px-5 text-sm font-medium text-accent-fg hover:bg-accent-hover focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",m?"min-h-11":"h-9"),children:v?"Saving…":S})]})]})]})}export{Q as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as s,aC as i,aD as m}from"./index-BzL5-pGT.js";const D=s("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]),o=new Intl.DateTimeFormat(void 0,{weekday:"short",day:"numeric",month:"long"}),a=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hour12:!1}),c=new Intl.DateTimeFormat(void 0,{weekday:"long",day:"numeric",month:"long",timeZone:"UTC"}),f=new Intl.DateTimeFormat(void 0,{weekday:"short",day:"numeric",month:"long",timeZone:"UTC"});function l(t){return f.format(new Date(`${t}T00:00:00Z`))}function y(t){if(t.allDay)return`${l(t.start.slice(0,10))}, all day`;const n=new Date(t.start),e=new Date(t.end),r=o.format(n);return o.format(e)===r?`${r}, ${a.format(n)} – ${a.format(e)}`:`${r}, ${a.format(n)} – ${o.format(e)}, ${a.format(e)}`}function C(t){return c.format(new Date(`${t}T00:00:00Z`))}function $(t){return a.format(new Date(`1970-01-01T${t}:00`))}function w(t){return a.format(new Date(t))}function g(t){return i(m({title:`Calendar invitation: ${t}`,errorMessage:t}))}function I(t){return i(m({title:`Calendar event: ${t}`,errorMessage:t}))}export{D as M,g as a,w as b,I as c,C as d,l as e,y as f,$ as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as G,j as n,c7 as q,o as x,c8 as H,r as k,X,ah as Y,aa as T,f5 as K,e0 as J,d as z,aL as Q,ce as w,f6 as p,f7 as V,f8 as ee,f9 as $,fa as L,b_ as A}from"./index-BzL5-pGT.js";import{S as te}from"./sparkles-C1l6GCPT.js";import{N as ne}from"./reply-CQarAZxU.js";import"./useCalendarSuggestions-DcYFtQhb.js";import{b as O,e as g,f as se,g as R,d as ae}from"./calendar-report-CzeBcU6C.js";const re=G("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);function Ae({title:e,timeText:t,color:a,layout:s,density:r,rsvp:i,status:d,hasThread:h,isRecurring:b,zoneCertainty:o,selected:l,onClick:c,leading:f,trailing:v,detail:j}){const N=s==="column";return n.jsxs("button",{type:"button",onClick:c,"aria-pressed":l,className:x("group flex w-full min-w-0 text-left outline-none transition-colors","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface",N?"h-full":"items-start",f!==void 0&&"gap-2"),children:[f,n.jsx("span",{className:x(H({color:a,layout:s,density:r,rsvp:i,status:d,selected:l,stacked:j!==void 0}),"flex-1",N&&"h-full"),children:n.jsx(q,{title:e,timeText:t,layout:s,rsvp:i,hasThread:h,isRecurring:b,zoneCertainty:o,trailing:v,detail:j})})]})}const M=96,ie=6;function Oe({children:e,hasCard:t,onConfirm:a,onReject:s,blocked:r,blockedReason:i,remaining:d,confirmLabel:h="Add",emptyText:b="Nothing in your mail is waiting on a decision about time.",className:o}){const[l,c]=k.useState(0),[f,v]=k.useState(null);if(!t)return n.jsxs("div",{className:x("flex flex-col items-center gap-2 p-6 text-center",o),children:[n.jsx(te,{className:"size-6 text-fg-subtle","aria-hidden":!0}),n.jsx("p",{className:"text-sm text-fg-muted",children:b})]});const j=Math.abs(l)>M,N=l>0;return n.jsxs("div",{className:x("flex flex-col gap-3",o),children:[n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"touch-pan-y select-none",style:{transform:`translateX(${l}px) rotate(${l/40}deg)`,transition:f===null?"transform 180ms ease-out":"none"},onPointerDown:u=>{v(u.clientX)},onPointerMove:u=>{if(f===null)return;const S=u.clientX-f;Math.abs(S)>ie&&!u.currentTarget.hasPointerCapture(u.pointerId)&&u.currentTarget.setPointerCapture(u.pointerId),c(S)},onPointerUp:()=>{Math.abs(l)>M&&(l>0&&!r&&a(),l<0&&s()),v(null),c(0)},onPointerCancel:()=>{v(null),c(0)},children:e}),j&&n.jsx("span",{className:x("pointer-events-none absolute top-3 rounded-md px-2 py-1 text-xs font-semibold",N?"right-3 bg-accent-soft text-accent":"left-3 bg-danger-soft text-danger"),children:N?r?i:h:"Not this"})]}),n.jsxs("p",{className:"text-center text-2xs text-fg-subtle",children:[d," left · swipe right to accept, left to drop, or use the buttons"]})]})}const oe="Pick a clock first. The mail never said, and the reader will not choose for you.";function le(e,t){const a=e.zoneOptions;return a===void 0?{settled:!0,timeZone:""}:a.some(s=>s.timeZone===t)?{settled:!0,timeZone:t}:{settled:!1,reason:oe}}function Z(e){return e.threadSubject===""?e.sender:`${e.sender} — ${e.threadSubject}`}function ce(e){return e>=.85?"Read cleanly":e>=.6?"Read with gaps":"Barely read"}function Re({suggestion:e,whenText:t,onAdd:a,onReview:s,onDismiss:r,onOpenThread:i,busy:d=!1,addBlocked:h=!1,zoneChoice:b,onZoneChoice:o,addLabel:l="Add",touch:c,className:f}){const[v,j]=k.useState(""),[N,u]=k.useState(!1),S=k.useId(),I=b??v,W=m=>{u(!1),o?o(m):j(m)},y=le(e,I),E=m=>()=>{if(!y.settled){u(!0);return}m(y.timeZone)};return n.jsxs("article",{"aria-label":e.title,className:x("flex flex-col gap-2 rounded-lg border border-dashed border-line-strong bg-surface-sunken p-3",f),children:[n.jsxs("div",{className:"flex items-start gap-2",children:[n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsxs("span",{className:"block text-2xs uppercase tracking-wider text-fg-subtle",children:["Suggested from mail · ",ce(e.confidence)]}),n.jsx("span",{className:"block truncate text-sm font-medium text-fg",children:e.title}),n.jsx("span",{className:"block text-xs text-fg-muted",children:t}),e.location!==""&&n.jsx("span",{className:"block truncate text-xs text-fg-muted",children:e.location})]}),n.jsx("button",{type:"button","aria-label":"Dismiss suggestion",onClick:r,disabled:d,className:x("flex shrink-0 items-center justify-center rounded-md text-fg-subtle outline-none hover:bg-surface hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",c?"size-11":"size-7"),children:n.jsx(X,{className:"size-4"})})]}),e.ambiguity!==""&&n.jsxs("p",{className:"flex items-start gap-1.5 text-2xs text-warning",children:[n.jsx(Y,{className:"mt-0.5 size-3 shrink-0","aria-hidden":!0}),e.ambiguity]}),i?n.jsxs("button",{type:"button",onClick:i,className:"flex w-full min-w-0 items-center gap-1.5 rounded-sm text-left text-2xs text-accent-2 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring",children:[n.jsx(T,{className:"size-3 shrink-0"}),n.jsx("span",{className:"truncate",children:Z(e)})]}):n.jsxs("p",{className:"flex w-full min-w-0 items-center gap-1.5 text-2xs text-fg-subtle",children:[n.jsx(T,{className:"size-3 shrink-0"}),n.jsx("span",{className:"truncate",children:Z(e)})]}),e.zoneOptions&&n.jsxs("div",{className:"flex flex-col gap-1.5 rounded-md border border-warning/40 p-2",children:[n.jsxs("p",{className:"flex items-center gap-1.5 text-2xs font-semibold text-warning",children:[n.jsx(K,{className:"size-3 shrink-0","aria-hidden":!0}),"Which clock is this on?"]}),e.zoneOptions.map(m=>n.jsxs("button",{type:"button","aria-pressed":I===m.timeZone,onClick:()=>W(m.timeZone),className:x("rounded-md border px-2 py-1 text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",c&&"min-h-11",I===m.timeZone?"border-accent bg-accent-soft":"border-line bg-surface hover:border-line-strong"),children:[n.jsx("span",{className:"block text-xs font-medium text-fg",children:m.label}),n.jsx("span",{className:"block text-2xs text-fg-subtle",children:m.note})]},m.timeZone))]}),!y.settled&&n.jsx(J,{id:S,reason:y.reason,nudged:N,className:"text-2xs text-warning"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(z,{variant:"primary",size:c?"md":"sm",icon:n.jsx(Q,{className:"size-3.5"}),onClick:E(a),disabled:d||h,"aria-describedby":y.settled?void 0:S,className:x(c&&"min-h-11 flex-1",!y.settled&&"opacity-55"),children:l}),s&&n.jsx(z,{variant:"secondary",size:c?"md":"sm",icon:n.jsx(re,{className:"size-3.5"}),onClick:E(s),disabled:d,"aria-describedby":y.settled?void 0:S,className:x(c&&"min-h-11",!y.settled&&"opacity-55"),children:"Change first"})]})]})}function Me(e){return e.defaultCalendarId!==""?"ready":e.error!==null?"failed":e.isLoading?"loading":"none"}function Ze(e,t){if(e!=="ready")return e==="loading"?"Reading your calendars…":e==="failed"?n.jsxs(n.Fragment,{children:["Couldn't read your calendars, so there is nowhere to add this yet. Reload to try again."," ",n.jsx("a",{href:t,target:"_blank",rel:"noreferrer",className:"font-medium text-accent hover:underline",children:"Report an issue"})]}):n.jsxs(n.Fragment,{children:["You have no calendar yet, so there is nowhere to add this."," ",n.jsx(ne,{to:"/settings/calendars",className:"font-medium text-accent hover:underline",children:"Create a calendar"})]})}const de=24,P=7,fe=52,D=fe*7,me=e=>({from:p(e,-10),to:p(e,de),floor:p(e,-D),ceiling:p(e,D)}),ue=e=>e.from<=e.floor,xe=e=>e.to>=e.ceiling,pe=(e,t)=>e>t?e:t,he=(e,t)=>e<t?e:t,ye=e=>ue(e)?e:{...e,from:pe(p(e.from,-P),e.floor)},be=e=>xe(e)?e:{...e,to:he(p(e.to,P),e.ceiling)},_e=e=>ye({...e,floor:p(e.from,-D)}),$e=e=>be({...e,ceiling:p(e.to,D)});function Le(e,t){return t>=e.from&&t<=e.to?e:me(t)}function Pe(e){const t=new Map;for(const a of e){const s=$("week",a);t.has(s.from)||t.set(s.from,s)}return[...t.values()]}const Be=e=>$("week",e).from,ve=1440,_=e=>e.getHours()*60+e.getMinutes();function B(e,t){const a=new Set(e),s=new Map;for(const r of t){const i=new Date(r.start),d=new Date(r.end);if(Number.isNaN(i.getTime())||Number.isNaN(d.getTime())||d.getTime()<=i.getTime())continue;const h=w(i),b=w(new Date(d.getTime()-1));for(let o=h;o<=b;o=p(o,1)){if(!a.has(o))continue;const l=o===h?_(i):0,c=w(d)===o?_(d):ve;if(c<=l)continue;const f=s.get(o);f?f.push({from:l,to:c}):s.set(o,[{from:l,to:c}])}}for(const[r,i]of s)s.set(r,V(i));return s}function Fe(e,t){const a=B(e,t);return new Map(e.map(s=>[s,L(s,a.get(s)??[])]))}const Ue=e=>ee(e.from,e.to),C=30,Ne=6,F={Local:"local",Explicit:"explicit",Ambiguous:"ambiguous"},je="The invitation's time zone could not be resolved. Add opens the editor so you can set the time.",Se="The invitation's time zone could not be resolved.";function We(e){return e.method==="Cancel"?e.state==="Pending"?{state:"cancelled",rsvp:"noReply"}:void 0:e.state==="Dismissed"?{state:"dismissed",rsvp:"noReply"}:e.state==="Superseded"?{state:"superseded",rsvp:"noReply"}:e.state==="Accepted"?{state:"answered",rsvp:"accepted"}:e.state==="Declined"?{state:"answered",rsvp:"declined"}:e.state==="Tentative"?{state:"answered",rsvp:"tentative"}:{state:"pending",rsvp:"noReply"}}const ke=e=>e.source!=="TextHeuristic";function Ge(e){return e.allDay?e.dtStart.slice(0,10):w(new Date(e.dtStart))}const U=e=>e.summary===""?"Untitled event":e.summary;function qe(e){if(e.allDay){const t=e.dtStart.slice(0,10),a=e.dtEnd.slice(0,10),s=a>t?p(a,-1):t;return s===t?`${g(t)}, all day`:`${g(t)} – ${g(s)}, all day`}return se({start:e.dtStart,end:e.dtEnd,allDay:e.allDay})}function Ce(e,t){return{id:e.suggestionId,calendarId:t.calendarId,title:U(e),start:e.dtStart,end:e.dtEnd,allDay:e.allDay,location:e.location,notes:"",attendees:[],myRsvp:"noReply",threadId:t.threadId,threadSubject:t.threadSubject,timeZone:"",zoneCertainty:F[e.zoneCertainty],recurrenceRule:"",seriesId:"",seriesException:!1,status:"confirmed"}}function He(e,t,a){const s=e.organizer===""?a.senderName:e.organizer;return{id:e.suggestionId,threadId:a.threadId,proposed:Ce(e,a),organizerName:s===""?"The sender":s,organizerEmail:e.organizer,method:"ics",evidence:"",state:t,sequence:e.sequence}}function we(e){return e.zoneCertainty!=="Ambiguous"?"":e.method==="Cancel"?Se:je}function Xe(e,t){return{id:e.suggestionId,title:U(e),start:e.dtStart,end:e.dtEnd,allDay:e.allDay,location:e.location,threadId:t.threadId,threadSubject:t.threadSubject,sender:t.sender,senderAddress:e.organizer,confidence:ke(e)?1:.6,ambiguity:we(e),suggestedCalendarId:t.calendarId,timeZone:"",zoneCertainty:F[e.zoneCertainty]}}const De=(e,t)=>Date.parse(t.start)<Date.parse(e.end)&&Date.parse(t.end)>Date.parse(e.start);function Ye(e,t){return t.filter(a=>De(e,a)).map(a=>({id:`${a.start}/${a.end}`,label:`Busy ${O(a.start)} – ${O(a.end)}`}))}function Ke(e,t){const a=B([e],t).get(e)??[],s=[];for(const r of L(e,a,C))for(let i=r.startMinute;i+C<=r.endMinute&&s.length<Ne;i+=C)s.push({date:e,endDate:e,startTime:A(i),endTime:A(i+C),allDay:!1});return s}function Je(e,t,a){const s=t.filter(r=>a.includes(r.startTime)).map(r=>`${R(r.startTime)} – ${R(r.endTime)}`);return`${ae(e)}: ${s.join(", ")}`}export{Ae as C,Re as E,oe as Z,Le as a,Be as b,be as c,Ue as d,ye as e,Fe as f,$e as g,xe as h,ue as i,Oe as j,qe as k,_e as l,Ze as m,Me as n,Ge as o,ke as p,We as q,me as r,le as s,Xe as t,Ye as u,He as v,Pe as w,Ke as x,Je as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as N,j as e,at as G,r,au as C,B as j,d as f,aL as V,T as R,f as P,b1 as B,a as K,b2 as Q,g as S,aE as A,b3 as Z,b4 as W,b5 as X,s as O,e as L,b6 as T,aw as J,b7 as Y,b8 as q,b9 as ee,u as se,aK as ae,aM as te}from"./index-BzL5-pGT.js";import{S as ne}from"./settings-screen-4md2ibPl.js";import{C as I,a as F,b as z,c as E}from"./card-865cdsJK.js";import{U as w,u as U,a as re,b as ie}from"./useCalendarSuggestions-DcYFtQhb.js";import{C as $}from"./confirm-dialog-CgMAaLI3.js";import{E as de,f as M}from"./ErrorState-nA0Ptq3g.js";import{R as oe}from"./refresh-cw-D1SQy8O7.js";import{C as le}from"./copy-CIKgpUwt.js";import"./avatar-vPm9XfmM.js";import"./menu-CGw_RHKl.js";import"./circle-help-CVShnhWn.js";import"./useQueries-Sm8S3Cgh.js";const ce=N("CalendarPlus",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 13V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8",key:"3spt84"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M19 16v6",key:"tddt3s"}]]);const me=N("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);const ue=N("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);const he=N("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const pe=N("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),xe=s=>({title:`Delete ${s}?`,description:`This removes ${s} and every event in it, and any subscription address stops working. It cannot be undone.`}),be=s=>s.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64),k=Intl.supportedValuesOf("timeZone");function _({id:s,value:n,disabled:t,onChange:a}){const i=n===w||k.includes(n)?k:[n,...k];return e.jsxs(G,{id:s,value:n,disabled:t,onChange:o=>a(o.target.value),children:[e.jsx("option",{value:w,children:"None (read as UTC)"}),i.map(o=>e.jsx("option",{value:o,children:o},o))]})}function ge({isBusy:s,problem:n,onCreate:t}){const[a,i]=r.useState(""),[o,c]=r.useState(void 0),[l,m]=r.useState(w),u=r.useId(),h=r.useId(),x=r.useId(),d=r.useId(),p=o??be(a),b=a.trim()!==""&&p.trim()!=="";return e.jsxs(I,{className:"max-w-xl",role:"region","aria-labelledby":u,children:[e.jsx(F,{children:e.jsx(z,{id:u,children:"New calendar"})}),e.jsx(E,{children:e.jsxs("form",{className:"space-y-3",onSubmit:g=>{g.preventDefault(),b&&t({displayName:a.trim(),urlSegment:p.trim(),timezone:l}).then(v=>{v&&(i(""),c(void 0),m(w))})},children:[e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:h,className:"text-xs font-medium text-fg-muted",children:"Name"}),e.jsx(C,{id:h,value:a,maxLength:140,disabled:s,onChange:g=>i(g.target.value)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:x,className:"text-xs font-medium text-fg-muted",children:"Address"}),e.jsx(C,{id:x,value:p,maxLength:64,disabled:s,onChange:g=>c(g.target.value)})]}),e.jsxs("div",{className:"space-y-1 sm:col-span-2",children:[e.jsx("label",{htmlFor:d,className:"text-xs font-medium text-fg-muted",children:"Time zone"}),e.jsx(_,{id:d,value:l,disabled:s,onChange:m})]})]}),e.jsx("p",{className:"text-xs text-fg-muted",children:"The address names the calendar for CalDAV clients and cannot be changed later. The name and zone can."}),n!==""&&e.jsxs(j,{tone:"danger",variant:"soft",children:[e.jsx("p",{className:"font-medium",children:"The calendar was not added."}),e.jsx("p",{className:"mt-0.5 break-words",children:n})]}),e.jsx(f,{type:"submit",variant:"primary",size:"sm",disabled:s||!b,icon:e.jsx(V,{className:"size-3.5"}),children:s?"Adding…":"Add calendar"})]})})]})}function fe({calendarName:s,timezone:n,isBusy:t,problem:a,onSave:i,onDelete:o}){const[c,l]=r.useState(s),[m,u]=r.useState(n),[h,x]=r.useState(!1),d=r.useId(),p=r.useId(),b=c.trim(),g=b!==s||m!==n,v=xe(s);return e.jsxs(e.Fragment,{children:[e.jsxs("form",{className:"space-y-3",onSubmit:y=>{y.preventDefault(),!(!g||b==="")&&i({displayName:b,timezone:m})},children:[e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:d,className:"text-xs font-medium text-fg-muted",children:"Name"}),e.jsx(C,{id:d,value:c,maxLength:140,disabled:t,onChange:y=>l(y.target.value)})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:p,className:"text-xs font-medium text-fg-muted",children:"Time zone"}),e.jsx(_,{id:p,value:m,disabled:t,onChange:u})]})]}),a!==""&&e.jsxs(j,{tone:"danger",variant:"soft",children:[e.jsxs("p",{className:"font-medium",children:[s," was not changed."]}),e.jsx("p",{className:"mt-0.5 break-words",children:a})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(f,{type:"submit",variant:"secondary",size:"sm",disabled:t||!g||b==="",icon:e.jsx(pe,{className:"size-3.5"}),children:"Save changes"}),e.jsx(f,{type:"button",variant:"danger",size:"sm",disabled:t,icon:e.jsx(R,{className:"size-3.5"}),onClick:()=>x(!0),children:"Delete calendar"})]})]}),e.jsx($,{isOpen:h,title:v.title,description:v.description,confirmLabel:"Delete calendar",destructive:!0,onConfirm:()=>{x(!1),o()},onCancel:()=>x(!1)})]})}const ve="/feeds/calendar/",je=".ics",ye=(s,n)=>`webcal://${s}${ve}${n}${je}`;function Ce(s){const n=P(),[t,a]=r.useState(""),i=B({path:{calendarId:s}}),o=K({...Q({path:{calendarId:s}}),meta:O(404,403),retry:!1}),c=()=>{n.invalidateQueries({queryKey:i})},l=r.useRef(()=>{}),m=S({...Z(),meta:A,onMutate:()=>{l.current()},onSuccess:()=>{a(""),c()}}),u=S({...W(),meta:A,gcTime:0,onMutate:()=>{m.reset()},onSuccess:H=>{a(ye(window.location.host,H.feedToken)),c()}});l.current=u.reset;const{mutate:h,reset:x}=u,{mutate:d}=m,p=r.useCallback(()=>{h({path:{calendarId:s}})},[s,h]),b=r.useCallback(()=>{d({path:{calendarId:s}})},[s,d]),g=r.useCallback(()=>{a(""),x()},[x]),{refetch:v}=o,y=r.useCallback(()=>{v()},[v]);return{state:Ne(o),mintedUrl:t,isBusy:u.isPending||m.isPending,actionError:u.error??m.error,mint:p,revoke:b,dismissMinted:g,retry:y}}function Ne(s){return s.error?X(s.error)?{status:"absent"}:{status:"unreadable",error:s.error}:s.isPending?{status:"loading"}:s.data?{status:"active",createdAt:s.data.createdAt,rotatedAt:s.data.rotatedAt}:{status:"absent"}}const Se=s=>({title:`Replace the address for ${s}?`,description:"Every client already subscribed to the current address stops updating and has to be pointed at the new one. The new address is shown once."}),we=s=>({title:`Stop sharing ${s}?`,description:"The address stops working immediately and every client subscribed to it stops updating. Sharing again mints a different address."});function ke({calendarName:s,url:n,onDismiss:t}){const[a,i]=r.useState(!1),[o,c]=r.useState(!1),l=r.useRef(0);r.useEffect(()=>()=>window.clearTimeout(l.current),[]);const m=()=>{navigator.clipboard.writeText(n).then(()=>{c(!1),i(!0),l.current=window.setTimeout(()=>i(!1),2e3)}).catch(()=>c(!0))};return e.jsxs("div",{className:"mt-3 space-y-2 rounded-sm border border-accent-2/40 bg-accent-2/10 px-3 py-2.5",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"Subscribe with this address. It is shown once and cannot be read back."}),e.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center",children:[e.jsx("input",{readOnly:!0,value:n,"aria-label":`Subscription address for ${s}`,onFocus:u=>u.currentTarget.select(),className:"min-w-0 flex-1 rounded-sm border border-line bg-surface px-2 py-1.5 font-mono text-xs text-fg"}),e.jsx(f,{variant:"primary",size:"sm",icon:a?e.jsx(J,{className:"size-3.5"}):e.jsx(le,{className:"size-3.5"}),onClick:m,children:a?"Copied":"Copy address"})]}),o&&e.jsx(j,{tone:"warning",variant:"soft",children:"The address could not be copied to the clipboard. Select it above and copy it by hand before leaving this page."}),e.jsx("p",{className:"text-xs text-fg-muted",children:"Anyone holding this address can read every event in this calendar, without signing in. Rotate it if it reaches the wrong person."}),e.jsx(f,{variant:"ghost",size:"sm",onClick:t,children:"I've saved it"})]})}function Te({createdAt:s,rotatedAt:n,isBusy:t,onRotate:a,onRevoke:i}){return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(L,{tone:"positive",children:"shared"}),e.jsxs("span",{className:"text-xs text-fg-muted",children:["Address created ",T(s,"medium"),n>0?`, last replaced ${T(n,"medium")}`:""]})]}),e.jsx("p",{className:"text-sm text-fg-muted",children:"The address itself is not stored in readable form, so it cannot be shown again. Replace it if you no longer know where it went."}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(f,{variant:"secondary",size:"sm",disabled:t,icon:e.jsx(oe,{className:"size-3.5"}),onClick:a,children:"Replace address"}),e.jsx(f,{variant:"danger",size:"sm",disabled:t,icon:e.jsx(R,{className:"size-3.5"}),onClick:i,children:"Stop sharing"})]})]})}function Ie({calendarName:s,details:n,state:t,mintedUrl:a,isBusy:i,actionError:o,onMint:c,onRevoke:l,onDismissMinted:m,onRetry:u}){const[h,x]=r.useState("none"),d=r.useId(),p=()=>{const g=h;x("none"),g==="rotate"&&c(),g==="revoke"&&l()},b=h==="revoke"?we(s):Se(s);return e.jsxs(I,{className:"max-w-xl",role:"region","aria-labelledby":d,children:[e.jsx(F,{children:e.jsx(z,{id:d,children:s})}),e.jsxs(E,{children:[n&&e.jsx("div",{className:"mb-4 border-b border-line pb-4",children:n}),t.status==="loading"&&a===""&&e.jsx("div",{className:"h-12 animate-pulse rounded-sm bg-surface-sunken","aria-busy":"true","aria-label":`Loading the subscription address for ${s}`}),t.status==="unreadable"&&a===""&&e.jsx(de,{variant:"inline",title:`Couldn't read whether ${s} is shared`,error:t.error,onRetry:u}),t.status==="absent"&&a===""&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm text-fg-muted",children:"Give this calendar a secret address and Apple Calendar, Google Calendar, Outlook and Thunderbird can subscribe to it read-only. Nobody signs in — the address is the credential, so treat it like a password."}),e.jsx(f,{variant:"primary",size:"sm",disabled:i,icon:e.jsx(me,{className:"size-3.5"}),onClick:c,children:i?"Creating…":"Create subscription address"})]}),t.status==="active"&&e.jsx(Te,{createdAt:t.createdAt,rotatedAt:t.rotatedAt,isBusy:i,onRotate:()=>x("rotate"),onRevoke:()=>x("revoke")}),o!=null&&e.jsxs(j,{tone:"danger",variant:"soft",className:"mt-3",children:[e.jsxs("p",{className:"font-medium",children:["The subscription address for ",s," was not changed."]}),e.jsx("p",{className:"mt-0.5 break-words",children:M(o)})]}),a!==""&&e.jsx(ke,{calendarName:s,url:a,onDismiss:m})]}),e.jsx($,{isOpen:h!=="none",title:b.title,description:b.description,confirmLabel:h==="revoke"?"Stop sharing":"Replace address",destructive:!0,onConfirm:p,onCancel:()=>x("none")})]})}function Fe({calendarId:s,calendarName:n,details:t}){const a=Ce(s);return e.jsx(Ie,{calendarName:n,details:t,state:a.state,mintedUrl:a.mintedUrl,isBusy:a.isBusy,actionError:a.actionError,onMint:a.mint,onRevoke:a.revoke,onDismissMinted:a.dismissMinted,onRetry:a.retry})}function ze({calendarId:s,calendarName:n,timezone:t,subscription:a}){const{updateCalendar:i,deleteCalendar:o,isWriting:c}=U(),[l,m]=r.useState(""),u=h=>m(h.kind==="refused"?h.message:"");return e.jsx(Fe,{calendarId:s,calendarName:n,details:e.jsxs(e.Fragment,{children:[a,e.jsx(fe,{calendarName:n,timezone:t,isBusy:c,problem:l,onSave:h=>{m(""),i(s,h).then(u)},onDelete:()=>{m(""),o(s).then(u)}},`${n}\0${t}`)]})})}const Ee="Subscribe to a calendar";function Me({isBusy:s,error:n,onSubscribe:t}){const a=r.useId(),i=r.useId(),o=r.useId(),[c,l]=r.useState(""),[m,u]=r.useState(""),h=c.trim()!==""&&m.trim()!=="",x=d=>{d.preventDefault(),h&&t({displayName:c,url:m},()=>{l(""),u("")})};return e.jsxs(I,{className:"max-w-xl",role:"region","aria-labelledby":a,children:[e.jsx(F,{children:e.jsx(z,{id:a,children:Ee})}),e.jsx(E,{children:e.jsxs("form",{className:"space-y-3",onSubmit:x,children:[e.jsx("p",{className:"text-sm text-fg-muted",children:"Paste the secret iCal address from Google Calendar, a published Outlook calendar or any other feed. It shows here read-only and refreshes on its own."}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:i,className:"text-sm font-medium text-fg",children:"Calendar name"}),e.jsx(C,{id:i,value:c,onChange:d=>l(d.target.value),placeholder:"Team rota",autoComplete:"off"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:o,className:"text-sm font-medium text-fg",children:"Calendar address"}),e.jsx(C,{id:o,value:m,onChange:d=>u(d.target.value),placeholder:"https://calendar.google.com/calendar/ical/…/basic.ics",autoComplete:"off",spellCheck:!1,inputMode:"url"}),e.jsx("p",{className:"text-xs text-fg-muted",children:"For Google Calendar the address is the password to the calendar. Reader never shows it in full again."})]}),e.jsx(f,{type:"submit",variant:"primary",size:"sm",disabled:!h||s,icon:e.jsx(ce,{className:"size-3.5"}),children:s?"Subscribing…":"Subscribe"}),n!=null&&e.jsxs(j,{tone:"danger",variant:"soft",children:[e.jsx("p",{className:"font-medium",children:"The calendar was not added."}),e.jsx("p",{className:"mt-0.5 break-words",children:M(n)})]})]})})]})}const Ae=s=>URL.canParse(s)?new URL(s).host:"an iCalendar feed";function De({calendarName:s,subscriptionUrl:n,enabled:t,fetchedAt:a,error:i,isBusy:o,actionError:c,onSetEnabled:l}){return e.jsxs("div",{className:"mb-4 space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(L,{tone:t?"positive":"neutral",children:t?"subscribed":"paused"}),e.jsxs("span",{className:"text-xs text-fg-muted",children:["Read-only, from ",Ae(n),a>0?`. Last updated ${T(a,"medium")}`:""]})]}),i!==""&&e.jsxs(j,{tone:"warning",variant:"soft",children:[e.jsxs("p",{className:"font-medium",children:[s," was not refreshed."]}),e.jsx("p",{className:"mt-0.5 break-words",children:i})]}),e.jsx("p",{className:"text-sm text-fg-muted",children:t?"Events are read from the feed on a schedule and cannot be edited here.":"Updates are paused. The events already here stay until you resume or remove the calendar."}),e.jsx(f,{variant:"secondary",size:"sm",disabled:o,icon:t?e.jsx(ue,{className:"size-3.5"}):e.jsx(he,{className:"size-3.5"}),onClick:()=>l(!t),children:t?"Pause updates":"Resume updates"}),c!=null&&e.jsxs(j,{tone:"danger",variant:"soft",children:[e.jsxs("p",{className:"font-medium",children:["Updates for ",s," were not changed."]}),e.jsx("p",{className:"mt-0.5 break-words",children:M(c)})]})]})}const D=O(400,404),Re=()=>`subscribed-${crypto.randomUUID().slice(0,8)}`;function Pe(){const s=P(),n=re(),t=()=>{s.invalidateQueries({queryKey:ee()}),n()},a=S({...Y(),meta:D,onSuccess:t}),i=S({...q(),meta:D,onSuccess:t}),{mutate:o}=a,c=r.useCallback((u,h)=>{o({body:{urlSegment:Re(),displayName:u.displayName.trim(),subscriptionUrl:u.url.trim()}},{onSuccess:h})},[o]),{mutate:l}=i,m=r.useCallback((u,h)=>{l({path:{calendarId:u},body:{subscriptionEnabled:h}})},[l]);return{subscribe:c,isSubscribing:a.isPending,subscribeError:a.error,setEnabled:m,togglingCalendarId:i.isPending?i.variables?.path.calendarId??"":"",toggleFailure:{calendarId:i.variables?.path.calendarId??"",error:i.error}}}const Oe=e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Each calendar has a name, a time zone its floating times are read in, and an address CalDAV clients reach it by. The address is fixed when the calendar is added; the name and zone can change. Deleting a calendar deletes every event in it. The default calendar is where accepted invitations land, so it cannot be deleted."}),e.jsx("p",{children:"A subscription address lets Apple Calendar, Google Calendar, Outlook and Thunderbird show a calendar from here, read-only and kept up to date."}),e.jsx("p",{children:"Those clients never sign in, so the address itself is the credential. Anyone who has it can read the calendar; nobody who has it can change anything."}),e.jsx("p",{children:"Only a hash of the address is stored, so it is shown once and cannot be looked up later. Replacing it breaks every subscription built on the old one, which is how a shared address is taken back."}),e.jsx("p",{children:"Subscribing works the other way round: paste another calendar's iCal address and its events show here, read-only, refreshed on a schedule."})]});function Xe(){const s=se(),[n,t]=r.useState(!0),{calendars:a,collections:i,timeZoneByCalendarId:o,isLoading:c}=ie(),l=Pe(),{createCalendar:m,isWriting:u}=U(),[h,x]=r.useState("");return e.jsx(ne,{items:ae,activeId:"calendars",title:"Calendars",description:"Add, rename and delete calendars, subscribe to a calendar feed, and share one with any client that can subscribe to a URL.",help:Oe,helpOpen:n,onToggleHelp:()=>t(d=>!d),onSelect:d=>{const p=te[d];p&&s({to:p})},onBackToMail:()=>{s({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 calendars"}):e.jsxs("div",{className:"space-y-4",children:[a.map(d=>{const p=i.find(b=>b.calendarId===d.id);return e.jsx(ze,{calendarId:d.id,calendarName:d.name,timezone:o[d.id]??"",subscription:p?.source==="Subscribed"&&e.jsx(De,{calendarName:p.displayName,subscriptionUrl:p.subscriptionUrl,enabled:p.subscriptionEnabled,fetchedAt:p.subscriptionFetchedAt,error:p.subscriptionError,isBusy:l.togglingCalendarId===d.id,actionError:l.toggleFailure.calendarId===d.id?l.toggleFailure.error:void 0,onSetEnabled:b=>l.setEnabled(d.id,b)})},d.id)}),e.jsx(Me,{isBusy:l.isSubscribing,error:l.subscribeError,onSubscribe:l.subscribe}),e.jsx(ge,{isBusy:u,problem:h,onCreate:d=>(x(""),m(d).then(p=>p.kind==="written"?!0:(x(p.message),!1)))})]})})}export{Xe as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as o}from"./FullCompose-dJ4mfUrX.js";import"./index-BzL5-pGT.js";import"./ErrorState-nA0Ptq3g.js";import"./index-BWAq8iOl.js";import"./useMessageBodyContent-CWGtiddz.js";import"./reply-CQarAZxU.js";import"./useMediaQuery-7Q3jBluO.js";import"./useSignature-sxHvGfKr.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B7157ZPO.js";import"./sections-C6oVXjho.js";import"./confirm-dialog-CgMAaLI3.js";const F=o;export{F as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as o}from"./FullCompose-dJ4mfUrX.js";import"./index-BzL5-pGT.js";import"./ErrorState-nA0Ptq3g.js";import"./index-BWAq8iOl.js";import"./useMessageBodyContent-CWGtiddz.js";import"./reply-CQarAZxU.js";import"./useMediaQuery-7Q3jBluO.js";import"./useSignature-sxHvGfKr.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B7157ZPO.js";import"./sections-C6oVXjho.js";import"./confirm-dialog-CgMAaLI3.js";const F=o;export{F as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as o}from"./FullCompose-dJ4mfUrX.js";import"./index-BzL5-pGT.js";import"./ErrorState-nA0Ptq3g.js";import"./index-BWAq8iOl.js";import"./useMessageBodyContent-CWGtiddz.js";import"./reply-CQarAZxU.js";import"./useMediaQuery-7Q3jBluO.js";import"./useSignature-sxHvGfKr.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B7157ZPO.js";import"./sections-C6oVXjho.js";import"./confirm-dialog-CgMAaLI3.js";const F=o;export{F as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{F as o}from"./FullCompose-dJ4mfUrX.js";import"./index-BzL5-pGT.js";import"./ErrorState-nA0Ptq3g.js";import"./index-BWAq8iOl.js";import"./useMessageBodyContent-CWGtiddz.js";import"./reply-CQarAZxU.js";import"./useMediaQuery-7Q3jBluO.js";import"./useSignature-sxHvGfKr.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B7157ZPO.js";import"./sections-C6oVXjho.js";import"./confirm-dialog-CgMAaLI3.js";const F=o;export{F as component};
|
package/assets/edit-CxVYhmi5.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{fM as o,j as i}from"./index-BzL5-pGT.js";import{a as m}from"./CalendarEventEditor-BpGmPZ2Z.js";import"./confirm-dialog-CgMAaLI3.js";import"./calendar-event-popup-Mft0N_sd.js";import"./pencil-DOoqyGzC.js";import"./calendar-report-CzeBcU6C.js";import"./calendar-event-sidebar-D5vjFGdS.js";import"./useCalendarData-Bz4EDHDO.js";import"./useCalendarSuggestions-DcYFtQhb.js";import"./ErrorState-nA0Ptq3g.js";import"./useQueries-Sm8S3Cgh.js";import"./CalendarSession--XFP5lXS.js";import"./reply-CQarAZxU.js";import"./useMediaQuery-7Q3jBluO.js";import"./calendar-LLRgZQzl.js";import"./CalendarQuickCreate-CwkBXqAB.js";function O(){const{calendarObjectId:r,recurrenceId:t}=o.useParams();return i.jsx(m,{calendarObjectId:r,recurrenceId:t})}export{O as component};
|
package/assets/edit-DXN-G3Tu.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{fJ as o,j as r}from"./index-BzL5-pGT.js";import{a as i}from"./CalendarEventEditor-BpGmPZ2Z.js";import"./confirm-dialog-CgMAaLI3.js";import"./calendar-event-popup-Mft0N_sd.js";import"./pencil-DOoqyGzC.js";import"./calendar-report-CzeBcU6C.js";import"./calendar-event-sidebar-D5vjFGdS.js";import"./useCalendarData-Bz4EDHDO.js";import"./useCalendarSuggestions-DcYFtQhb.js";import"./ErrorState-nA0Ptq3g.js";import"./useQueries-Sm8S3Cgh.js";import"./CalendarSession--XFP5lXS.js";import"./reply-CQarAZxU.js";import"./useMediaQuery-7Q3jBluO.js";import"./calendar-LLRgZQzl.js";import"./CalendarQuickCreate-CwkBXqAB.js";function v(){const{calendarObjectId:t}=o.useParams();return r.jsx(i,{calendarObjectId:t})}export{v as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o,O as i}from"./index-BzL5-pGT.js";import{a as m}from"./MailShell-0sTtK1xD.js";import{F as r}from"./FlaggedPane-BwhUf1qN.js";import"./reply-CQarAZxU.js";import{a as p}from"./search-token-index-DQHE1g7A.js";import{u as e}from"./search-mirror-_Dap9COg.js";import"./useMessageBodyContent-CWGtiddz.js";import"./FullCompose-dJ4mfUrX.js";import"./ErrorState-nA0Ptq3g.js";import"./index-BWAq8iOl.js";import"./useSignature-sxHvGfKr.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B7157ZPO.js";import"./sections-C6oVXjho.js";import"./useMediaQuery-7Q3jBluO.js";import"./confirm-dialog-CgMAaLI3.js";import"./MessageBody-Deha778B.js";import"./kbd-B9MFmWVU.js";import"./search-scope-UI1H6AzA.js";import"./MessageToolbar-5T47fDWC.js";import"./roving-focus-Coea111y.js";import"./EmptyState-dD_YhGMH.js";import"./popover-menu-CNiMANtf.js";import"./avatar-vPm9XfmM.js";import"./useQueries-Sm8S3Cgh.js";import"./undo-2-DHJ6nykB.js";import"./download-A4hq8dWf.js";import"./calendar-suggestion-ClsxDTZs.js";import"./sparkles-C1l6GCPT.js";import"./useCalendarSuggestions-DcYFtQhb.js";import"./calendar-report-CzeBcU6C.js";import"./calendar-failure-note-BUFaaizf.js";import"./checkbox-Qon94b1C.js";import"./clock-B9kFW89H.js";import"./shield-check-BcUXVpR8.js";import"./calendar-LLRgZQzl.js";import"./useLayoutTier-5aJYrTut.js";import"./menu-CGw_RHKl.js";import"./useFilters-C3bLY42W.js";import"./MailViewChrome-BEx9Dr1Z.js";import"./refresh-cw-D1SQy8O7.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-B18BvpkW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{fI as o,j as r}from"./index-BzL5-pGT.js";import{C as m}from"./CalendarEventPopup-Brcgx7tV.js";import"./calendar-event-popup-Mft0N_sd.js";import"./pencil-DOoqyGzC.js";import"./calendar-report-CzeBcU6C.js";import"./useCalendarData-Bz4EDHDO.js";import"./useCalendarSuggestions-DcYFtQhb.js";import"./ErrorState-nA0Ptq3g.js";import"./useQueries-Sm8S3Cgh.js";import"./reply-CQarAZxU.js";import"./useMediaQuery-7Q3jBluO.js";import"./calendar-LLRgZQzl.js";function l(){const{calendarObjectId:t}=o.useParams();return r.jsx(m,{calendarObjectId:t})}export{l as component};
|
package/assets/index-B4pYEqZI.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BzL5-pGT.js";import{O as t}from"./OutboxPane-gEXLW7BJ.js";import"./roving-focus-Coea111y.js";import"./MessageBody-Deha778B.js";import"./kbd-B9MFmWVU.js";import"./search-scope-UI1H6AzA.js";import"./reply-CQarAZxU.js";import"./useMediaQuery-7Q3jBluO.js";import"./useMessageBodyContent-CWGtiddz.js";import"./circle-check-big-CyVG6r7N.js";import"./clock-B9kFW89H.js";import"./row-actions-CiZruXil.js";import"./rotate-ccw-DPB71584.js";import"./NavMenuButton-C-7-t18I.js";import"./menu-CGw_RHKl.js";import"./outbox-status-BlKn6P0x.js";function d(){return o.jsx(t.Reading,{})}export{d as component};
|
package/assets/index-B77HnSA5.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-BzL5-pGT.js";import{B as o}from"./BriefPane-BzlqkW4r.js";import"./MessageBody-Deha778B.js";import"./kbd-B9MFmWVU.js";import"./search-scope-UI1H6AzA.js";import"./reply-CQarAZxU.js";import"./useMediaQuery-7Q3jBluO.js";import"./useMessageBodyContent-CWGtiddz.js";import"./MessageToolbar-5T47fDWC.js";import"./roving-focus-Coea111y.js";import"./search-token-index-DQHE1g7A.js";import"./useQueries-Sm8S3Cgh.js";import"./EmptyState-dD_YhGMH.js";import"./ErrorState-nA0Ptq3g.js";import"./popover-menu-CNiMANtf.js";import"./avatar-vPm9XfmM.js";import"./index-BWAq8iOl.js";import"./useSignature-sxHvGfKr.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B7157ZPO.js";import"./sections-C6oVXjho.js";import"./undo-2-DHJ6nykB.js";import"./download-A4hq8dWf.js";import"./calendar-suggestion-ClsxDTZs.js";import"./sparkles-C1l6GCPT.js";import"./useCalendarSuggestions-DcYFtQhb.js";import"./calendar-report-CzeBcU6C.js";import"./calendar-failure-note-BUFaaizf.js";import"./checkbox-Qon94b1C.js";import"./clock-B9kFW89H.js";import"./shield-check-BcUXVpR8.js";import"./calendar-LLRgZQzl.js";import"./useLayoutTier-5aJYrTut.js";import"./menu-CGw_RHKl.js";import"./useFilters-C3bLY42W.js";import"./confirm-dialog-CgMAaLI3.js";import"./useRefreshControl-bA8HK_j-.js";import"./circle-check-big-CyVG6r7N.js";import"./refresh-cw-D1SQy8O7.js";import"./LabelApplyTrigger-BA7ANeDk.js";import"./useLabels-DYdHiHXI.js";import"./wizard-selection-zWa1qc6-.js";function S(){return r.jsx(o.Reading,{})}export{S as component};
|
package/assets/index-BZdYp7ae.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BzL5-pGT.js";import{F as r}from"./FlaggedPane-BwhUf1qN.js";import"./MessageBody-Deha778B.js";import"./kbd-B9MFmWVU.js";import"./search-scope-UI1H6AzA.js";import"./reply-CQarAZxU.js";import"./useMediaQuery-7Q3jBluO.js";import"./useMessageBodyContent-CWGtiddz.js";import"./MessageToolbar-5T47fDWC.js";import"./roving-focus-Coea111y.js";import"./search-token-index-DQHE1g7A.js";import"./useQueries-Sm8S3Cgh.js";import"./EmptyState-dD_YhGMH.js";import"./ErrorState-nA0Ptq3g.js";import"./popover-menu-CNiMANtf.js";import"./avatar-vPm9XfmM.js";import"./index-BWAq8iOl.js";import"./useSignature-sxHvGfKr.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B7157ZPO.js";import"./sections-C6oVXjho.js";import"./undo-2-DHJ6nykB.js";import"./download-A4hq8dWf.js";import"./calendar-suggestion-ClsxDTZs.js";import"./sparkles-C1l6GCPT.js";import"./useCalendarSuggestions-DcYFtQhb.js";import"./calendar-report-CzeBcU6C.js";import"./calendar-failure-note-BUFaaizf.js";import"./checkbox-Qon94b1C.js";import"./clock-B9kFW89H.js";import"./shield-check-BcUXVpR8.js";import"./calendar-LLRgZQzl.js";import"./useLayoutTier-5aJYrTut.js";import"./menu-CGw_RHKl.js";import"./useFilters-C3bLY42W.js";import"./confirm-dialog-CgMAaLI3.js";import"./MailViewChrome-BEx9Dr1Z.js";import"./refresh-cw-D1SQy8O7.js";import"./wizard-selection-zWa1qc6-.js";function M(){return o.jsx(r.Reading,{})}export{M as component};
|
package/assets/index-BiCNOLIH.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,ad as o}from"./index-BzL5-pGT.js";const n=()=>t.jsx(o,{to:"/settings/accounts"});export{n as component};
|
package/assets/index-CoCVPZ34.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{fL as t,j as m}from"./index-BzL5-pGT.js";import{C as p}from"./CalendarEventPopup-Brcgx7tV.js";import"./calendar-event-popup-Mft0N_sd.js";import"./pencil-DOoqyGzC.js";import"./calendar-report-CzeBcU6C.js";import"./useCalendarData-Bz4EDHDO.js";import"./useCalendarSuggestions-DcYFtQhb.js";import"./ErrorState-nA0Ptq3g.js";import"./useQueries-Sm8S3Cgh.js";import"./reply-CQarAZxU.js";import"./useMediaQuery-7Q3jBluO.js";import"./calendar-LLRgZQzl.js";function l(){const{calendarObjectId:r,recurrenceId:o}=t.useParams();return m.jsx(p,{calendarObjectId:r,recurrenceId:o})}export{l as component};
|
package/assets/index-CroyVnhC.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BzL5-pGT.js";import{M as i}from"./MailboxPane-DYgnYeOy.js";import"./MessageBody-Deha778B.js";import"./kbd-B9MFmWVU.js";import"./search-scope-UI1H6AzA.js";import"./reply-CQarAZxU.js";import"./useMediaQuery-7Q3jBluO.js";import"./useMessageBodyContent-CWGtiddz.js";import"./useRefreshControl-bA8HK_j-.js";import"./circle-check-big-CyVG6r7N.js";import"./refresh-cw-D1SQy8O7.js";import"./useQueries-Sm8S3Cgh.js";import"./MessageToolbar-5T47fDWC.js";import"./roving-focus-Coea111y.js";import"./search-token-index-DQHE1g7A.js";import"./EmptyState-dD_YhGMH.js";import"./ErrorState-nA0Ptq3g.js";import"./popover-menu-CNiMANtf.js";import"./avatar-vPm9XfmM.js";import"./index-BWAq8iOl.js";import"./useSignature-sxHvGfKr.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B7157ZPO.js";import"./sections-C6oVXjho.js";import"./undo-2-DHJ6nykB.js";import"./download-A4hq8dWf.js";import"./calendar-suggestion-ClsxDTZs.js";import"./sparkles-C1l6GCPT.js";import"./useCalendarSuggestions-DcYFtQhb.js";import"./calendar-report-CzeBcU6C.js";import"./calendar-failure-note-BUFaaizf.js";import"./checkbox-Qon94b1C.js";import"./clock-B9kFW89H.js";import"./shield-check-BcUXVpR8.js";import"./calendar-LLRgZQzl.js";import"./useLayoutTier-5aJYrTut.js";import"./menu-CGw_RHKl.js";import"./useFilters-C3bLY42W.js";import"./confirm-dialog-CgMAaLI3.js";import"./MailViewChrome-BEx9Dr1Z.js";import"./LabelApplyTrigger-BA7ANeDk.js";import"./useLabels-DYdHiHXI.js";import"./NavMenuButton-C-7-t18I.js";import"./bottom-sheet-BTdseD_6.js";import"./circle-help-CVShnhWn.js";import"./circle-check-Db07NpOC.js";function W(){return o.jsx(i.Reading,{})}export{W as component};
|
package/assets/index-DTs144Nv.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BzL5-pGT.js";import{M as r}from"./MailboxPane-DYgnYeOy.js";import"./MessageBody-Deha778B.js";import"./kbd-B9MFmWVU.js";import"./search-scope-UI1H6AzA.js";import"./reply-CQarAZxU.js";import"./useMediaQuery-7Q3jBluO.js";import"./useMessageBodyContent-CWGtiddz.js";import"./useRefreshControl-bA8HK_j-.js";import"./circle-check-big-CyVG6r7N.js";import"./refresh-cw-D1SQy8O7.js";import"./useQueries-Sm8S3Cgh.js";import"./MessageToolbar-5T47fDWC.js";import"./roving-focus-Coea111y.js";import"./search-token-index-DQHE1g7A.js";import"./EmptyState-dD_YhGMH.js";import"./ErrorState-nA0Ptq3g.js";import"./popover-menu-CNiMANtf.js";import"./avatar-vPm9XfmM.js";import"./index-BWAq8iOl.js";import"./useSignature-sxHvGfKr.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B7157ZPO.js";import"./sections-C6oVXjho.js";import"./undo-2-DHJ6nykB.js";import"./download-A4hq8dWf.js";import"./calendar-suggestion-ClsxDTZs.js";import"./sparkles-C1l6GCPT.js";import"./useCalendarSuggestions-DcYFtQhb.js";import"./calendar-report-CzeBcU6C.js";import"./calendar-failure-note-BUFaaizf.js";import"./checkbox-Qon94b1C.js";import"./clock-B9kFW89H.js";import"./shield-check-BcUXVpR8.js";import"./calendar-LLRgZQzl.js";import"./useLayoutTier-5aJYrTut.js";import"./menu-CGw_RHKl.js";import"./useFilters-C3bLY42W.js";import"./confirm-dialog-CgMAaLI3.js";import"./MailViewChrome-BEx9Dr1Z.js";import"./LabelApplyTrigger-BA7ANeDk.js";import"./useLabels-DYdHiHXI.js";import"./NavMenuButton-C-7-t18I.js";import"./bottom-sheet-BTdseD_6.js";import"./circle-help-CVShnhWn.js";import"./circle-check-Db07NpOC.js";function W(){return o.jsx(r.Reading,{})}export{W as component};
|
package/assets/index-DsgtllX4.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./index-BzL5-pGT.js";import{B as o}from"./BriefPane-BzlqkW4r.js";import"./MessageBody-Deha778B.js";import"./kbd-B9MFmWVU.js";import"./search-scope-UI1H6AzA.js";import"./reply-CQarAZxU.js";import"./useMediaQuery-7Q3jBluO.js";import"./useMessageBodyContent-CWGtiddz.js";import"./MessageToolbar-5T47fDWC.js";import"./roving-focus-Coea111y.js";import"./search-token-index-DQHE1g7A.js";import"./useQueries-Sm8S3Cgh.js";import"./EmptyState-dD_YhGMH.js";import"./ErrorState-nA0Ptq3g.js";import"./popover-menu-CNiMANtf.js";import"./avatar-vPm9XfmM.js";import"./index-BWAq8iOl.js";import"./useSignature-sxHvGfKr.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B7157ZPO.js";import"./sections-C6oVXjho.js";import"./undo-2-DHJ6nykB.js";import"./download-A4hq8dWf.js";import"./calendar-suggestion-ClsxDTZs.js";import"./sparkles-C1l6GCPT.js";import"./useCalendarSuggestions-DcYFtQhb.js";import"./calendar-report-CzeBcU6C.js";import"./calendar-failure-note-BUFaaizf.js";import"./checkbox-Qon94b1C.js";import"./clock-B9kFW89H.js";import"./shield-check-BcUXVpR8.js";import"./calendar-LLRgZQzl.js";import"./useLayoutTier-5aJYrTut.js";import"./menu-CGw_RHKl.js";import"./useFilters-C3bLY42W.js";import"./confirm-dialog-CgMAaLI3.js";import"./useRefreshControl-bA8HK_j-.js";import"./circle-check-big-CyVG6r7N.js";import"./refresh-cw-D1SQy8O7.js";import"./LabelApplyTrigger-BA7ANeDk.js";import"./useLabels-DYdHiHXI.js";import"./wizard-selection-zWa1qc6-.js";function Q(){return r.jsx(o.Reading,{})}export{Q as component};
|
package/assets/index-DupXMcS6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o}from"./index-BzL5-pGT.js";import{F as r}from"./FlaggedPane-BwhUf1qN.js";import"./MessageBody-Deha778B.js";import"./kbd-B9MFmWVU.js";import"./search-scope-UI1H6AzA.js";import"./reply-CQarAZxU.js";import"./useMediaQuery-7Q3jBluO.js";import"./useMessageBodyContent-CWGtiddz.js";import"./MessageToolbar-5T47fDWC.js";import"./roving-focus-Coea111y.js";import"./search-token-index-DQHE1g7A.js";import"./useQueries-Sm8S3Cgh.js";import"./EmptyState-dD_YhGMH.js";import"./ErrorState-nA0Ptq3g.js";import"./popover-menu-CNiMANtf.js";import"./avatar-vPm9XfmM.js";import"./index-BWAq8iOl.js";import"./useSignature-sxHvGfKr.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B7157ZPO.js";import"./sections-C6oVXjho.js";import"./undo-2-DHJ6nykB.js";import"./download-A4hq8dWf.js";import"./calendar-suggestion-ClsxDTZs.js";import"./sparkles-C1l6GCPT.js";import"./useCalendarSuggestions-DcYFtQhb.js";import"./calendar-report-CzeBcU6C.js";import"./calendar-failure-note-BUFaaizf.js";import"./checkbox-Qon94b1C.js";import"./clock-B9kFW89H.js";import"./shield-check-BcUXVpR8.js";import"./calendar-LLRgZQzl.js";import"./useLayoutTier-5aJYrTut.js";import"./menu-CGw_RHKl.js";import"./useFilters-C3bLY42W.js";import"./confirm-dialog-CgMAaLI3.js";import"./MailViewChrome-BEx9Dr1Z.js";import"./refresh-cw-D1SQy8O7.js";import"./wizard-selection-zWa1qc6-.js";function N(){return o.jsx(r.Reading,{})}export{N as component};
|
package/assets/mail-CSUpbRUP.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as B,r as f,j as e,o as C,p as Ee,q as Le,D as Ae,X as Fe,C as Te,S as oe,t as q,v as H,w as re,x as ie,F as ze,T as De,y as _e,M as Be,z as Ke,E as Qe,I as qe,G as le,d as P,H as ce,J as He,K as Ve,N as $e,P as ue,f as K,Q as de,R as me,U as Ue,V as We,W as Ge,Y as xe,a as fe,Z as Ye,_ as Je,$ as z,a0 as Xe,a1 as Ze,a2 as es,a3 as ss,a4 as ts,a5 as as,a6 as ns,a7 as os,a8 as rs,u as is,c as ls,a9 as cs,O as us}from"./index-BzL5-pGT.js";import{E as ds}from"./ErrorState-nA0Ptq3g.js";import{K as ms,B as xs,S as fs,u as ps,s as hs,b as gs,a as bs,c as vs,d as ys}from"./search-token-index-DQHE1g7A.js";import{K as V}from"./kbd-B9MFmWVU.js";import{u as js,l as O,a as D,m as $,b as Ns,c as Ss,N as w,d as Cs,e as ws,i as Is,f as Os}from"./reply-CQarAZxU.js";import{A as ks}from"./AppFrame-R9FR9SH9.js";import{P as Ms}from"./pencil-DOoqyGzC.js";import{u as Q,a as Rs}from"./useMessageBodyContent-CWGtiddz.js";import{c as Ps,s as Es,M as Ls}from"./MailShell-0sTtK1xD.js";import{u as As,a as Fs,R as Ts,s as zs,i as Ds,H as _s,M as Bs}from"./useRefreshControl-bA8HK_j-.js";import{M as Ks}from"./menu-CGw_RHKl.js";import{B as pe,u as Qs}from"./useResultFolderIndex-BaqajWHb.js";import{A as qs}from"./avatar-vPm9XfmM.js";import{u as Hs,P as Vs,a as $s,b as Us}from"./popover-menu-CNiMANtf.js";import{u as Ws}from"./sections-C6oVXjho.js";import{u as Gs}from"./roving-focus-Coea111y.js";import{C as Ys,A as Js}from"./account-service-status-Kz9s3jOk.js";import{S as Xs}from"./sparkles-C1l6GCPT.js";import{u as he}from"./useQueries-Sm8S3Cgh.js";import{f as Zs}from"./folder-failure-CqkVSsrb.js";import{i as et}from"./outbox-status-BlKn6P0x.js";import{u as st}from"./index-BWAq8iOl.js";import{u as ge,i as tt}from"./useLayoutTier-5aJYrTut.js";import{u as at}from"./useDebouncedValue-B7157ZPO.js";import"./search-scope-UI1H6AzA.js";import"./useMediaQuery-7Q3jBluO.js";import"./FullCompose-dJ4mfUrX.js";import"./confirm-dialog-CgMAaLI3.js";import"./circle-check-big-CyVG6r7N.js";import"./refresh-cw-D1SQy8O7.js";import"./useSignature-sxHvGfKr.js";import"./account-form-helpers-DhckT_PN.js";const be=B("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);const ve=B("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const nt=B("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 ot({email:s,onSignOut:t}){const a=f.useRef(null),{open:n,setOpen:o,containerRef:r,panelRef:i,getAnchor:u}=Hs("account-menu",()=>a.current?.focus());f.useEffect(()=>{if(!n)return;const d=requestAnimationFrame(()=>i.current?.querySelector('[role="menuitem"]')?.focus());return()=>cancelAnimationFrame(d)},[n,i]);const m=s??"Account";return e.jsxs("div",{ref:r,className:"relative",children:[e.jsx("button",{ref:a,type:"button","aria-label":"Account","aria-haspopup":"menu","aria-expanded":n,onClick:()=>o(d=>!d),className:"inline-flex min-h-11 min-w-11 items-center justify-center rounded-md p-1.5 text-fg-muted transition-colors hover:bg-surface-raised hover:text-fg",children:e.jsx(qs,{name:m,email:s??void 0,size:"sm"})}),e.jsx(Vs,{open:n,align:"end",panelRef:i,getAnchor:u,children:e.jsxs($s,{ref:i,label:m,children:[s&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"truncate px-4 py-2 text-xs text-fg-muted",title:s,"data-testid":"account-menu-email",children:s}),e.jsx("hr",{className:"my-1 h-px border-0 bg-line"})]}),e.jsx(Us,{label:"Sign out",icon:e.jsx(be,{className:"size-4"}),onSelect:()=>{o(!1),a.current?.focus(),t()}})]})})]})}function rt({leading:s,search:t,actions:a,className:n}){return e.jsxs("header",{className:C("flex min-h-pane-header w-full shrink-0 items-center gap-2 border-b border-line bg-canvas px-row-inset py-1",n),children:[s&&e.jsx("div",{className:"flex shrink-0 items-center gap-1",children:s}),e.jsx("div",{className:"flex min-w-0 flex-1 justify-start",children:e.jsx("div",{className:"w-full max-w-xs transition-[max-width] duration-150 ease-out focus-within:max-w-lg",children:t})}),a&&e.jsx("div",{className:"flex shrink-0 items-center gap-1",children:a})]})}function it({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(Ms,{className:"size-6"})})}const lt=({isOpen:s,onClose:t})=>{const a=f.useRef(null);return Ee({id:"shortcuts",open:s,answers:{back:t}}),Le(a,s),s?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx(Ae,{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:C("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(Fe,{className:"size-5"})})]}),e.jsx("div",{className:"grid gap-x-8 gap-y-6 sm:grid-cols-2",children:ms.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,i)=>e.jsxs(f.Fragment,{children:[i>0&&o.keys[0]==="g"&&e.jsx("span",{className:"text-2xs text-fg-subtle",children:"then"}),e.jsx(V,{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(V,{children:"Esc"})," to close"]})})]})]}):null},ct="button:not([disabled]), a[href]",E="outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-surface-sunken";function ut({active:s,dimmed:t,indent:a}){return C("flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors",E,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 dt({icon:s,label:t,count:a,active:n,failure:o}){return e.jsxs(e.Fragment,{children:[s&&e.jsx("span",{className:C("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:C("text-2xs tabular-nums",n?"text-accent-2":"text-fg-subtle"),children:a})]})}function I({icon:s,label:t,count:a,active:n,dimmed:o,indent:r,navId:i,linkComponent:u,ariaLabel:m,title:d,failure:h,onClick:y}){const g=ut({active:n,dimmed:o,indent:r}),c=e.jsx(dt,{icon:s,label:t,count:a,active:n,failure:h}),v=m??t,x=h?`${v} — ${h}`:v,p=h?`${d??t} — ${h}`:d;return i&&u?u({navId:i,className:g,ariaLabel:x,title:p,onClick:y,children:c}):e.jsx("button",{type:"button",onClick:y,className:g,"aria-label":h?x:m,title:p,children:c})}const U={inbox:0,flagged:1,drafts:2,sent:3,archive:4,all:5,junk:6,trash:7};function mt(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(Qe,{className:"size-4"});case"sent":return e.jsx(ie,{className:"size-4"});case"archive":return e.jsx(Ke,{className:"size-4"});case"all":return e.jsx(Be,{className:"size-4"});case"junk":return e.jsx(_e,{className:"size-4"});case"trash":return e.jsx(De,{className:"size-4"})}}const W=s=>s.role!=null,T=8,G="remit.nav.folders.open.",Y="remit.nav.account.open.";function J(s,t,a){if(typeof localStorage>"u")return a;const n=localStorage.getItem(s+t);return n===null?a:n!=="0"}function X(s,t,a){typeof localStorage>"u"||localStorage.setItem(s+t,a?"1":"0")}function xt({account:s,selectedNavId:t,onSelectNav:a,linkComponent:n}){const[o,r]=f.useState(()=>J(Y,s.id,!0)),[i,u]=f.useState(()=>J(G,s.id,!0)),[m,d]=f.useState(!1),h=()=>{r(l=>{const j=!l;return X(Y,s.id,j),j})},y=()=>{u(l=>{const j=!l;return X(G,s.id,j),j})},g=s.mailboxes.filter(W).sort((l,j)=>U[l.role]-U[j.role]),c=s.mailboxes.filter(l=>!W(l)),v=m||c.length<=T?c:c.slice(0,T),x=c.length-v.length,p=s.status??"ready",b=s.syncedServices!==void 0&&!s.syncedServices.includes("Mail"),N=p==="ready"&&g.length===0&&c.length===0;return e.jsxs("div",{className:"mt-3",children:[e.jsxs("button",{type:"button",onClick:h,"aria-expanded":o,className:C("flex w-full items-center gap-1.5 px-2 pb-1 text-left transition-colors hover:text-fg",E,s.muted&&"opacity-55"),children:[o?e.jsx(q,{className:"size-3 shrink-0 text-fg-subtle"}):e.jsx(H,{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(xs,{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(Ys,{className:"size-3 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"text-2xs text-fg-subtle",children:Js.Mail})]})]}),o&&e.jsxs(e.Fragment,{children:[p==="loading"&&e.jsx("div",{className:"px-2 py-1 text-sm text-fg-muted",children:"Loading…"}),p==="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"}),p==="ready"&&e.jsxs(e.Fragment,{children:[g.map(l=>e.jsx(I,{navId:l.id,linkComponent:n,icon:mt(l.role),label:l.name,ariaLabel:l.name,title:l.fullPath??l.name,failure:l.failure,count:l.unseen,active:t===l.id,dimmed:s.muted,onClick:()=>a?.(l.id)},l.id)),s.outboxPending!==void 0&&e.jsx(I,{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")}),c.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",onClick:y,"aria-expanded":i,className:C("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",E),children:[i?e.jsx(q,{className:"size-3 shrink-0"}):e.jsx(H,{className:"size-3 shrink-0"}),e.jsx("span",{className:"flex-1",children:"Folders"}),e.jsx("span",{className:"tabular-nums opacity-70",children:c.length})]}),i&&e.jsxs(e.Fragment,{children:[v.map(l=>e.jsx(I,{navId:l.id,linkComponent:n,icon:e.jsx(ze,{className:"size-4"}),label:l.name,ariaLabel:l.name,title:l.fullPath??l.name,failure:l.failure,count:l.unseen,active:t===l.id,dimmed:s.muted,onClick:()=>a?.(l.id)},l.id)),(x>0||m)&&c.length>T&&e.jsx("button",{type:"button",onClick:()=>d(l=>!l),className:C("ml-7 flex items-center px-2 py-1 text-2xs font-medium text-accent transition-colors hover:underline",E),children:m?"Show less":`Show all (${c.length})`})]})]})]})]})]})}function ft({accounts:s,selectedNavId:t,briefUnseen:a,onSelectNav:n,variant:o="desktop",linkComponent:r,calendarNav:i="hidden"}){const u=f.useRef(null);Gs({containerRef:u,itemSelector:ct});const m=o==="drawer",d=e.jsxs("nav",{ref:m?u:void 0,className:m?"px-2 py-2":"flex-1 overflow-y-auto px-2 py-2","aria-label":"Mailboxes",children:[e.jsx(I,{navId:"brief",linkComponent:r,icon:e.jsx(Xs,{className:"size-4"}),label:"Daily brief",ariaLabel:"Daily brief",count:a,active:t==="brief",onClick:()=>n?.("brief")}),i==="shown"&&e.jsx(I,{navId:"calendar",linkComponent:r,icon:e.jsx(Te,{className:"size-4"}),label:"Calendar",ariaLabel:"Calendar",active:t==="calendar",onClick:()=>n?.("calendar")}),e.jsx(I,{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(xt,{account:h,selectedNavId:t,onSelectNav:n,linkComponent:r},h.id))]});return m?d:e.jsx("aside",{ref:u,className:"flex h-full w-full flex-col bg-surface-sunken",children:d})}function pt(){const s=le();if(!s)return null;const t=s.showNavPane?!s.navCollapsed:!1;return e.jsx(P,{variant:"ghost",size:"sm",icon:e.jsx(Ks,{className:"size-4"}),onClick:s.toggleNav,"aria-label":t?"Hide folders":"Show folders","aria-expanded":t,title:"Folders",className:"shrink-0"})}const ht={global:"Search all mail",pending:"Search mail",scoped:"Search this folder"};function gt({search:s,onCompose:t,onReportBug:a,onOpenSettings:n,settingsAttention:o,composeShortcut:r,refreshControl:i,account:u}){return e.jsx(rt,{leading:e.jsx(pt,{}),search:e.jsx(fs,{value:s.value,onChange:s.onChange,onClear:s.onClear,onClearQuery:s.onClearQuery,chips:s.chips,onRemoveChip:s.onRemoveChip,placeholder:ht[s.scope]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(P,{variant:"ghost",size:"sm",icon:e.jsx(nt,{className:"size-4"}),title:r?`Compose (${r})`:"Compose","aria-label":"Compose",onClick:t}),e.jsx(P,{variant:"ghost",size:"sm",icon:e.jsx(pe,{className:"size-4"}),title:"Report a bug","aria-label":"Report a bug",onClick:a}),e.jsx(P,{variant:"ghost",size:"sm",icon:e.jsx(ce,{label:o,children:e.jsx(ve,{className:"size-4"})}),title:"Settings","aria-label":o?`Settings — ${o}`:"Settings",onClick:n}),i,u]})})}function bt(){const{pathname:s}=js(),t=He({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 vt(){const s=Ve(),t=D({select:d=>$(d.location.pathname)}),a=D({select:d=>Ns(d.location.search)}),[n,o]=f.useState(a),r=at(n,200),[i,u]=f.useState(t);if(i!==t){const d=Es(i,t,a);u(t),d!==void 0&&o(d)}const m=f.useCallback(d=>{u($(s.state.location.pathname)),o(d)},[s]);return{searchInput:n,committedQuery:Ps(n,r),viewKey:t,setSearchInput:m}}const yt=()=>{const s=Q();return Ss()?null:e.jsx(it,{onCompose:s})},ye=({children:s})=>{const{Account:t}=$e();return e.jsx(t,{children:s})},jt=()=>e.jsx(ye,{children:({email:s,signOut:t})=>e.jsx(ot,{email:s,onSignOut:t})});function Nt({accounts:s}){const{searchInput:t,onSearchChange:a,onSearchClear:n,onSearchClearQuery:o,resultFolderIndex:r}=ue(),i=K(),u=Ws(),m=Q(),{scope:d,clearScope:h}=ps(s),y=de(),g=d.kind==="scoped"?[{id:d.chip.id,label:d.chip.label,tone:"scope"}]:void 0,c=f.useMemo(()=>s.map(N=>N.accountId),[s]),{hasNewMail:v}=As(),{state:x,errorMessage:p,refresh:b}=Fs(c,{onSettled:()=>Ue(i,We(r.keys()))});return e.jsx(gt,{search:{value:t,scope:d.kind,chips:g,onChange:a,onClear:n,onClearQuery:o,onRemoveChip:h},onCompose:m,onReportBug:me,onOpenSettings:()=>u("accounts"),settingsAttention:y,composeShortcut:hs("compose"),refreshControl:e.jsx(Ts,{state:x,onRefresh:b,label:"Refresh all accounts",errorMessage:p,hasUpdate:v(c)}),account:e.jsx(jt,{})})}function St(){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(pe,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Report a bug"})]})}const Z=s=>/^\d/.test(s),Ct=(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 wt(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,i)=>Ct(z(r,void 0,a),z(i,void 0,a))),{system:n,labels:o}}function It(s,t,a){const n=Xe(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:Zs(s)}}function ee({accounts:s,onMailboxSelect:t,variant:a="desktop"}){const n=K(),o=bt(),{onSearchChange:r}=ue(),{t:i}=Ge("mail",{useSuspense:!1}),u=f.useCallback((x,p)=>i(x,{defaultValue:p}),[i]),m=he({queries:s.map(x=>({...xe({path:{accountId:x.accountId}}),staleTime:1/0}))}),{data:d}=fe(Ye()),h=f.useMemo(()=>(d?.items??[]).filter(x=>et(x.status)).length,[d?.items]),y=f.useMemo(()=>s.map((x,p)=>{const b=m[p],N=b?.data?.items??[],l=Je(x.folderAppointments),{system:j,labels:L}=wt(N,l,u),A=b?.isError?"error":b?.isLoading?"loading":"ready";return{id:x.accountId,label:x.email,email:x.email,muted:!!x.muted,outboxPending:h,status:A,onRetry:()=>b?.refetch(),mailboxes:[...j,...L].map(k=>It(k,l.get(k.mailboxId),u))}}),[s,m,h,u]),g=x=>{n.invalidateQueries({queryKey:Ze({path:{mailboxId:x},query:{order:"desc"}})})},c=({navId:x,className:p,ariaLabel:b,title:N,children:l,onClick:j})=>x==="brief"?e.jsx(w,{to:"/mail/brief",search:{q:void 0},activeOptions:{includeSearch:!1},onClick:()=>j?.(),className:p,"aria-label":b,title:N,children:l}):x==="calendar"?e.jsx(w,{to:"/calendar",onClick:()=>j?.(),className:p,"aria-label":b,title:N,children:l}):x==="outbox"?e.jsx(w,{to:"/mail/outbox",search:{q:void 0},onClick:()=>j?.(),className:p,"aria-label":b,title:N,children:l}):x==="flagged"?e.jsx(w,{to:"/mail/flagged",search:{q:void 0},onClick:()=>j?.(),className:p,"aria-label":b,title:N,children:l}):x==="settings"?e.jsx(w,{to:"/settings/accounts",onClick:()=>j?.(),className:p,"aria-label":b,title:N,children:l}):e.jsx(w,{to:"/mail/$mailboxId",params:{mailboxId:x},search:{q:void 0},onClick:()=>{g(x),j?.()},className:p,"aria-label":b,title:N,children:l}),v=()=>{r(""),t?.()};return e.jsx(ft,{accounts:y,selectedNavId:o,onSelectNav:v,linkComponent:c,variant:a})}function Ot({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(w,{to:"/settings/accounts",onClick:t,children:[e.jsx(ce,{label:o,children:e.jsx(ve,{className:"size-4 shrink-0"})}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Settings"})]}),e.jsx(St,{}),e.jsx(ye,{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(be,{className:"size-4 shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:"Sign out"})]})})]})]})}function kt(s){const t=he({queries:s.map(a=>({...xe({path:{accountId:a.accountId}}),staleTime:1/0}))});return f.useMemo(()=>gs(t.map(a=>a.data?.items??[])),[t])}const je="remit:intelligence-open";function Mt(){try{return localStorage.getItem(je)!=="closed"}catch{return!0}}function Rt(s){try{localStorage.setItem(je,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 i=s.filter(u=>u!=="sidebar");return i.length>0?i.includes("intelligence"):a&&n&&t}const Pt=()=>{const s=ge(),t=Cs(),a=ws(),n=t.find(Is),o=bs(),[r,i]=f.useState(Mt),u=o?`${o.threadId}/${o.messageId??""}`:null,[m,d]=f.useState(null),h={panels:t,prefersOpen:r,isDesktop:s==="desktop",hasThread:o!==void 0,openMessage:u},y=se({...h,raisedFor:m}),g=se({...h,raisedFor:null}),c=f.useCallback((b,N)=>{a([...b?["intelligence"]:[],...N?[N]:[]])},[a]),v=f.useCallback(b=>{c(g,b)},[g,c]),x=f.useCallback(()=>{if(y&&!g){d(null);return}const b=!y;Rt(b),i(b),d(null),c(b,n)},[g,y,n,c]),p=f.useCallback(()=>{d(u)},[u]);return{openOverlay:n,intelligenceOpen:y,showOverlay:v,toggleIntelligence:x,raiseIntelligence:p}};var M={exports:{}},te;function Et(){if(te)return M.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:i}=n;if(!(typeof i=="number"&&i>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${i}\` (${typeof i})`);const u=[],m=t[Symbol.iterator]();let d=!1,h=!1,y=0,g=0;const c=()=>{if(d)return;const v=m.next(),x=g;if(g++,v.done){h=!0,y===0&&o(u);return}y++,Promise.resolve(v.value).then(p=>a(p,x)).then(p=>{u[x]=p,y--,c()},p=>{d=!0,r(p)})};for(let v=0;v<i&&(c(),!h);v++);});return M.exports=s,M.exports.default=s,M.exports}var Lt=Et();const At=es(Lt),Ft=900*1e3,Tt=30,zt=(s,t)=>{if(!s)return t;const a=Number.parseInt(s,10);return Number.isFinite(a)&&a>0?a:t},Dt=30*1e3,_t=s=>Math.max(zt(s,Tt)*1e3,Dt),Ne=_t(rs().mailboxPollIntervalSeconds),R=(s=Date.now(),t=Ne)=>Ds(s)?Math.min(_s,t):t,Bt=5,_=new Set,Kt=(s,t,a=Ft)=>s.filter(n=>{const o=n.lastSyncAt;return o==null?!0:t-o>a}).map(n=>n.accountId),Qt=(s,t,a=Ne)=>s-t>=a,qt=(s,t)=>s.filter(a=>!t.has(a)),ae=(s,t)=>{if(_.delete(s),as(t)||ns(t,{softError:!0})){os(t,{softError:!0});return}console.warn("[remit] background mailbox sync failed",{accountId:s,error:t})},ne=(s,t)=>ss({path:{accountId:s},throwOnError:!0}).then(()=>{t.invalidateQueries({queryKey:ts({path:{accountId:s}})})}),Ht=s=>{const t=K(),a=f.useRef(s);a.current=s;const n=s.map(o=>o.accountId).join(",");f.useEffect(()=>{const o=Date.now(),i=Kt(a.current,o).filter(u=>!_.has(u));if(i.length!==0)for(const u of i)_.add(u),ne(u,t).catch(m=>{ae(u,m)})},[n,t]),f.useEffect(()=>{let o=Date.now(),r;const i=new Set,u=()=>{o=Date.now();const g=qt(a.current.map(c=>c.accountId),i);for(const c of g)i.add(c);At(g,c=>ne(c,t).catch(v=>{ae(c,v)}).finally(()=>{i.delete(c)}),{concurrency:Bt})},m=()=>{if(document.visibilityState==="visible"){u(),r=setTimeout(m,R());return}},d=()=>{if(document.visibilityState!=="visible")return;r!==void 0&&clearTimeout(r);const g=Date.now(),c=R(g);if(Qt(g,o,c)){u(),r=setTimeout(m,c);return}r=setTimeout(m,o+c-g)},h=()=>{document.visibilityState==="visible"&&(r!==void 0&&clearTimeout(r),o=Date.now(),r=setTimeout(m,R()))};r=setTimeout(m,R()),document.addEventListener("visibilitychange",d);const y=zs(h);return()=>{r!==void 0&&clearTimeout(r),document.removeEventListener("visibilitychange",d),y()}},[n,t])};function Sa(){const s=is(),t=ge(),a=tt(t),{openOverlay:n,intelligenceOpen:o,showOverlay:r,toggleIntelligence:i,raiseIntelligence:u}=Pt(),m=n==="shortcuts",d=n==="nav",{searchInput:h,committedQuery:y,viewKey:g,setSearchInput:c}=vt(),{data:v,isLoading:x,isError:p,error:b,refetch:N}=fe({...ls(),staleTime:1/0}),l=!!(v&&(v.accounts?.length??0)===0);f.useEffect(()=>{l&&s({to:"/onboarding",replace:!0})},[l,s]),st({enabled:!m,bindings:[{key:"?",action:"help",handler:()=>r("shortcuts"),noModifiers:!1,preventDefault:!0}]});const j=Q(),L=Rs(),A=D({select:F=>Os(F.matches)?.list==="mailbox"}),k=f.useMemo(()=>({compose:j}),[j]);vs({enabled:!A&&!L,handlers:k});const Se=f.useCallback(()=>{c("")},[c]),Ce=f.useCallback(()=>{c("")},[c]),S=v?.accounts??[],we=f.useMemo(()=>S.map(F=>F.accountId),[S]),Ie=kt(S),Oe=Qs(S).index,ke=f.useMemo(()=>ys(S),[S]);Ht(S);const Me=f.useCallback(()=>{n==="nav"&&r(void 0)},[n,r]),Re={accounts:S,mailboxNameIndex:Ie,accountNameIndex:ke,resultFolderIndex:Oe,searchQuery:y,searchInput:h,searchViewKey:g,onSearchChange:c,onSearchClear:Se,onSearchClearQuery:Ce,intelligenceOpen:o,onToggleIntelligence:i,onRaiseIntelligence:u},Pe={isSinglePane:a,isLoading:x||l,intelligenceOpen:o,nav:e.jsx(Ot,{accounts:S,onMailboxSelect:Me}),topBar:a?void 0:e.jsx(Nt,{accounts:S}),overlay:a?e.jsx(yt,{}):void 0,navOpen:d,onOpenNav:()=>r("nav"),onCloseNav:()=>r(void 0)};return e.jsx(cs.Provider,{value:Re,children:e.jsxs(Bs,{accountIds:we,children:[e.jsx(ks,{children:p?e.jsx("div",{className:"flex h-full items-center justify-center bg-canvas p-4",children:e.jsx(ds,{title:"Couldn't load your account",error:b,onRetry:()=>{N()}})}):e.jsx(Ls,{chrome:Pe,children:e.jsx(us,{})})}),e.jsx(lt,{isOpen:m,onClose:()=>r(void 0)})]})})}export{Sa as component,ue as useMailContext};
|
package/assets/new-DVwQ9Ia3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{C as o}from"./CalendarEventEditor-BpGmPZ2Z.js";import"./index-BzL5-pGT.js";import"./confirm-dialog-CgMAaLI3.js";import"./calendar-event-popup-Mft0N_sd.js";import"./pencil-DOoqyGzC.js";import"./calendar-report-CzeBcU6C.js";import"./calendar-event-sidebar-D5vjFGdS.js";import"./useCalendarData-Bz4EDHDO.js";import"./useCalendarSuggestions-DcYFtQhb.js";import"./ErrorState-nA0Ptq3g.js";import"./useQueries-Sm8S3Cgh.js";import"./CalendarSession--XFP5lXS.js";import"./reply-CQarAZxU.js";import"./useMediaQuery-7Q3jBluO.js";import"./calendar-LLRgZQzl.js";import"./CalendarQuickCreate-CwkBXqAB.js";const v=o;export{v as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n,f as i,u as a,r as m,j as s}from"./index-BzL5-pGT.js";import{O as p}from"./OnboardingWizard-hfP07hpw.js";import{c}from"./onboarding-completion-DbgUYeRa.js";import"./checkbox-Qon94b1C.js";import"./kbd-B9MFmWVU.js";import"./credential-steps-BWguS0eW.js";import"./card-865cdsJK.js";import"./account-form-helpers-DhckT_PN.js";import"./file-json-DiHW8YBd.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-BzL5-pGT.js";import{a as m}from"./MailShell-0sTtK1xD.js";import{u as p,O as t}from"./OutboxPane-gEXLW7BJ.js";import"./reply-CQarAZxU.js";import{u as s}from"./search-mirror-_Dap9COg.js";import"./useMessageBodyContent-CWGtiddz.js";import"./FullCompose-dJ4mfUrX.js";import"./ErrorState-nA0Ptq3g.js";import"./index-BWAq8iOl.js";import"./useSignature-sxHvGfKr.js";import"./account-form-helpers-DhckT_PN.js";import"./useDebouncedValue-B7157ZPO.js";import"./sections-C6oVXjho.js";import"./useMediaQuery-7Q3jBluO.js";import"./confirm-dialog-CgMAaLI3.js";import"./roving-focus-Coea111y.js";import"./MessageBody-Deha778B.js";import"./kbd-B9MFmWVU.js";import"./search-scope-UI1H6AzA.js";import"./circle-check-big-CyVG6r7N.js";import"./clock-B9kFW89H.js";import"./row-actions-CiZruXil.js";import"./rotate-ccw-DPB71584.js";import"./NavMenuButton-C-7-t18I.js";import"./menu-CGw_RHKl.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 t,O as o}from"./index-BzL5-pGT.js";const n=()=>t.jsx(o,{});export{n as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as o,X as Z,o as O,f6 as R,fb as $,f9 as v,r as u,cj as E,fK as F}from"./index-BzL5-pGT.js";import{E as L,C as W}from"./EmptyState-dD_YhGMH.js";import{C as z}from"./calendar-event-sidebar-D5vjFGdS.js";import{C as B}from"./calendar-failure-note-BUFaaizf.js";import{b as j,k as H,d as h,l as U,t as _,U as S,q as P,i as M,m as V}from"./useCalendarSuggestions-DcYFtQhb.js";import{e as w,p as q,a as G,b as K}from"./CalendarSession--XFP5lXS.js";import{f as X,a as N}from"./calendar-report-CzeBcU6C.js";import"./reply-CQarAZxU.js";import{j as Y,b as J}from"./calendar-LLRgZQzl.js";import"./calendar-event-popup-Mft0N_sd.js";import"./pencil-DOoqyGzC.js";import"./ErrorState-nA0Ptq3g.js";import"./useQueries-Sm8S3Cgh.js";import"./useMediaQuery-7Q3jBluO.js";function I({title:e,subtitle:a,onClose:r,children:s,className:i}){return o.jsxs("section",{className:O("flex h-full w-full flex-col bg-surface",i),children:[o.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-2 border-b border-line px-row-inset",children:[o.jsx("h2",{className:"shrink-0 text-xs font-medium text-fg",children:e}),a!==void 0&&a!==""&&o.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-fg-muted",children:a}),o.jsx("button",{type:"button","aria-label":"Close editor",onClick:r,className:"ml-auto flex size-7 shrink-0 items-center justify-center rounded-md text-fg-subtle outline-none hover:bg-surface-sunken hover:text-fg focus-visible:ring-2 focus-visible:ring-ring",children:o.jsx(Z,{className:"size-4"})})]}),o.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-row-inset py-5",children:o.jsx("div",{className:"mx-auto w-full max-w-2xl",children:s})})]})}function Q(e,a,r){const s={title:e.summary,location:e.location};if(e.allDay){const t=e.dtStart.slice(0,10),c=e.dtEnd.slice(0,10);return{...w(t,a),...s,allDay:!0,startTime:"",endDate:c>t?R(c,-1):t,endTime:""}}const i=t=>e.zoneCertainty==="Ambiguous"?t:$(t,r),l=i(e.dtStart),d=i(e.dtEnd);return{...w(l.slice(0,10),a),...s,startTime:l.slice(11,16),endDate:d.slice(0,10),endTime:d.slice(11,16)}}function ee(e,a,r,s){const i=q(a,r,s);if(!i.ok)return i;const d=e.zoneCertainty==="Ambiguous"||i.patch.start!==void 0?{...i.patch,...G(r,s.clock),allDay:r.allDay,timeZone:s.anchor}:i.patch;return{ok:!0,input:{calendarId:r.calendarId,event:d}}}const te=[],ae={from:"",to:""};function ne(e,a=""){const{timeZoneByCalendarId:r}=j(),s=e.date!==""&&!e.allDay&&e.endDate!==""&&e.startTime!==""&&e.endTime!==""&&`${e.endDate}T${e.endTime}`>`${e.date}T${e.startTime}`,{instances:i,isLoading:l,error:d}=H({...s?{from:v("week",e.date).from,to:v("week",e.endDate).to}:ae,calendarIds:te,enabled:s}),t=h();return u.useMemo(()=>{if(!s||l||d)return;const c=E(e.date,e.startTime,t),p=E(e.endDate,e.endTime,t),f=i.filter(m=>U(m)&&m.calendarObjectId!==a).map(m=>_(m,r[m.calendarId]??S,t));return F({start:c,end:p},f).map(m=>({id:m.id,label:`${m.title}, ${X(m)}`}))},[s,l,d,e.date,e.endDate,e.startTime,e.endTime,t,i,a,r])}const y="Add from mail",se="The invitation named a time zone nothing could resolve. The time below is as the mail wrote it — check it before adding.";function ie({suggestionId:e,onClose:a}){const{suggestion:r,isLoading:s,error:i}=P(e),l=r??void 0,[d,t]=u.useState(void 0);l!==void 0&&d===void 0&&t(l);const c=d??l;if(c!==void 0)return o.jsx(oe,{suggestion:c,onClose:a},c.suggestionId);if(i!==null){const p="Couldn't read what your mail is waiting on.";return o.jsx(I,{title:y,onClose:a,children:o.jsx(B,{text:`${p} Close this and try again.`,reportHref:N(p),className:"m-row-inset"})})}return o.jsx(I,{title:y,onClose:a,children:o.jsx(L,{message:s?"Reading the suggestion…":"This suggestion is no longer waiting on you. It was answered, or a later message replaced it."})})}function oe({suggestion:e,onClose:a}){const{calendars:r,defaultCalendarId:s,timeZoneByCalendarId:i}=j(),l=r.filter(n=>!n.readOnly),d=M(),[t]=u.useState(()=>Q(e,"",h())),[c,p]=u.useState(t),f=K()?.dispatch;u.useEffect(()=>{f?.({type:"sidebar-range",range:{date:t.date,endDate:t.endDate,startTime:t.allDay?"":t.startTime,endTime:t.allDay?"":t.endTime,allDay:t.allDay}})},[t,f]);const[m,D]=u.useState(""),[k,A]=u.useState(),b=ne(c),g=l.some(n=>n.id===s)?s:l[0]?.id??"";u.useEffect(()=>{g!==""&&p(n=>n.calendarId===""?{...n,calendarId:g}:n)},[g]);const x=()=>{const n=ee(e,t,c,{clock:h(),anchor:V(i[c.calendarId]??S)});if(!n.ok){D(n.problem);return}D(""),d.acceptEdited(e.suggestionId,n.input).then(C=>{if(C.kind==="answered"){a();return}const T=`Couldn't add this to your calendar: ${C.message}`;A({text:T,reportHref:N(T),onRetry:x})})};return o.jsx(z,{heading:y,draft:c,onChange:n=>{p(n),f?.({type:"sidebar-range",range:{date:n.date,endDate:n.endDate,startTime:n.allDay?"":n.startTime,endTime:n.allDay?"":n.endTime,allDay:n.allDay}})},calendars:l,calendarEditable:!0,repeatEditable:!1,timeZone:h(),timeZones:[h()],onTimeZone:()=>{},busy:!0,onBusy:()=>{},onSave:x,onCancel:a,saving:d.isAnswering,saveLabel:"Add",failure:k,problem:m!==""?m:e.zoneCertainty==="Ambiguous"?se:"",children:b&&o.jsx(W,{clashes:b})})}function Ce(){const e=Y(),{closeToView:a}=J();return e===void 0?null:o.jsx(ie,{suggestionId:e,onClose:a})}export{Ce as component};
|