@remit/web-client-dist 0.0.127 → 0.0.129
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/{ComposeBody-h2C6k222.js → ComposeBody-Dv8GTCX-.js} +3 -3
- package/assets/{ErrorState-B7jWTPIf.js → ErrorState-C1rQsV_s.js} +1 -1
- package/assets/OnboardingWizard-fH3cV-Bt.js +1 -0
- package/assets/{account-form-helpers-xI92Dwmc.js → account-form-helpers-DCLj-gup.js} +1 -1
- package/assets/{accounts-DKfAXZjO.js → accounts-Jh962jif.js} +1 -1
- package/assets/advanced-DjXn3JWS.js +1 -0
- package/assets/appearance-BHjnZjyK.js +1 -0
- package/assets/{avatar-0qIqgsXP.js → avatar-Ca5J3d1B.js} +1 -1
- package/assets/{browser-ponyfill-BwVTtQXO.js → browser-ponyfill-jJ7MUtFS.js} +2 -2
- package/assets/{download-BwUpxXRu.js → download-DvTNYX4j.js} +1 -1
- package/assets/filter-status-By1GnPG1.js +1 -0
- package/assets/{filters-CJq3f7fG.js → filters-CWeH5zfZ.js} +1 -1
- package/assets/{flagged-BoZpfueM.js → flagged-Crikbh8F.js} +1 -1
- package/assets/{folder--nZa3AWC.js → folder-C6a40H2R.js} +1 -1
- package/assets/folders-CZHhG4Zu.js +1 -0
- package/assets/{index-Db6DEVIe.js → index-BFlORFK_.js} +1 -1
- package/assets/index-Bksf_UCT.js +1 -0
- package/assets/{index-Bma3cv5T.css → index-ChxiTmNG.css} +1 -1
- package/assets/{index-DmAjS0RP.js → index-QkIP6MIH.js} +86 -86
- package/assets/{kbd-7BCcqn6e.js → kbd-BgERypjy.js} +1 -1
- package/assets/mail-ZAxRBcsg.js +118 -0
- package/assets/onboarding-CCtmYI0E.js +1 -0
- package/assets/{rotate-ccw-DMt3woFX.js → rotate-ccw-B0a3ZBwB.js} +1 -1
- package/assets/{senders-C6xMNaU5.js → senders-Dc4mpem7.js} +1 -1
- package/assets/settings-C_ko2pwO.js +1 -0
- package/assets/{settings-screen-BCJFYn9T.js → settings-screen-R_p_AfP4.js} +1 -1
- package/assets/{suggested-vips-P2LJ2gFj.js → suggested-vips-DRsjRZaD.js} +1 -1
- package/assets/{useDebouncedValue-C1Om-LCu.js → useDebouncedValue-CV1ge_ZN.js} +1 -1
- package/assets/{useSignature-C_KrJpXy.js → useSignature-daDUU9Xi.js} +1 -1
- package/index.html +2 -2
- package/package.json +1 -1
- package/assets/OnboardingWizard-k84Sdw86.js +0 -1
- package/assets/advanced-CkqcfzJJ.js +0 -1
- package/assets/appearance-Dytafdds.js +0 -1
- package/assets/filter-status-CSIQ5QUR.js +0 -1
- package/assets/folders-Bd3b1tcw.js +0 -1
- package/assets/index-DhjmWYCG.js +0 -1
- package/assets/mail-BhCnC0zo.js +0 -118
- package/assets/onboarding-w8oC_k77.js +0 -1
- package/assets/select-BjP4w3Or.js +0 -1
- package/assets/settings-CAQOtl8y.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{bq as a,ad as r,ao as i,Z as s,r as c,j as m}from"./index-QkIP6MIH.js";import{O as l}from"./OnboardingWizard-fH3cV-Bt.js";import"./kbd-BgERypjy.js";import"./account-form-helpers-DCLj-gup.js";async function u(e){e.recordCompleted(),await e.queryClient.refetchQueries({queryKey:a()}),e.navigateToInbox()}function b(){const e=r(),o=i(),t=s(),n=c.useCallback(d=>{u({queryClient:t,recordCompleted:()=>o.recordEvent("onboarding.completed"),navigateToInbox:()=>{e({to:"/mail"})}})},[e,o,t]);return m.jsx(l,{skipWelcome:!1,onComplete:n})}export{b as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./index-
|
|
1
|
+
import{a as e}from"./index-QkIP6MIH.js";const a=e("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const t=e("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);export{a as C,t as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e,b as N,
|
|
1
|
+
import{j as e,b as N,ad as z,r as c,bF as L,x as O,bH as $,ap as I,c2 as q,Z as k,as as C,c3 as A,aP as P,B as S,S as M,aw as R,X as B}from"./index-QkIP6MIH.js";import{K as m}from"./kbd-BgERypjy.js";import{S as G,a as E}from"./settings-screen-R_p_AfP4.js";import{E as V}from"./ErrorState-C1rQsV_s.js";import{S as Q,u as F}from"./useDebouncedValue-CV1ge_ZN.js";import{c as K}from"./format-B6Elex-n.js";import"./avatar-Ca5J3d1B.js";function _({options:t,active:r,onSelect:x}){return e.jsx("div",{role:"tablist",className:N("flex shrink-0 gap-1 overflow-x-auto border-b border-line p-2","lg:w-44 lg:flex-col lg:gap-0 lg:overflow-visible lg:border-r lg:border-b-0 lg:py-2 lg:pr-2 lg:pl-3"),children:t.map(a=>{const d=a.id===r;return e.jsxs("button",{type:"button",role:"tab","aria-selected":d,onClick:()=>x(a.id),className:N("flex min-h-11 shrink-0 items-center gap-2 rounded-md px-3 text-left text-sm transition-colors lg:min-h-0 lg:px-2 lg:py-1",d?"bg-accent-2-soft font-medium text-accent-2":"text-fg-muted hover:bg-surface-sunken hover:text-fg"),children:[e.jsx("span",{className:"flex-1 truncate",children:a.label}),e.jsx("span",{className:N("text-2xs tabular-nums",d?"text-accent-2":"text-fg-subtle"),children:a.count??"—"})]},a.id)})})}const v={vip:"VIPs",muted:"Muted",blocked:"Blocked"},D=e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"VIP"})," senders get priority surface in the daily brief and notification escalation, even when an account is quiet."]}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Muted"})," senders never notify and stay out of the brief. Their mail still syncs and stays searchable."]}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Blocked"})," senders never load images and go straight to junk."]}),e.jsxs("p",{children:["Tip: flag from the keyboard on any message — ",e.jsx(m,{children:"v"})," VIP,"," ",e.jsx(m,{children:"m"})," mute, ",e.jsx(m,{children:"b"})," block. Every rule an automation creates shows up here and can be removed."]})]});function H({query:t,onCount:r}){const{data:x,isPending:a,isError:d,error:y}=I(q()),g=k(),i=C({...P(),onSettled:()=>{g.invalidateQueries({queryKey:A()})}}),l=x?.suggestions??[],p=t.trim().toLowerCase(),u=p?l.filter(n=>(n.displayName??"").toLowerCase().includes(p)||n.normalizedEmail.toLowerCase().includes(p)):l;return c.useEffect(()=>{r?.(u.length,l.length)},[r,u.length,l.length]),a?e.jsx("div",{className:"px-row-inset py-3 text-sm text-fg-subtle animate-pulse",children:"Loading VIP suggestions…"}):d?e.jsx("div",{className:"px-row-inset py-3",children:e.jsx(V,{variant:"inline",title:"Couldn't load VIP suggestions",error:y})}):l.length===0?e.jsxs("div",{className:"px-row-inset py-5 text-sm text-fg-subtle",children:["No VIP suggestions yet. As you reply to senders, they'll appear here. Press ",e.jsx(m,{children:"v"})," on any message to promote a sender to VIP."]}):u.length===0?e.jsxs("p",{className:"px-row-inset py-5 text-sm text-fg-subtle",children:["No VIPs match “",t,"”."]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-row-inset py-1 text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Suggested — promote to VIP"}),u.map(n=>e.jsx(E,{name:n.displayName??n.normalizedEmail,email:n.normalizedEmail,meta:n.replyCount>0?`${n.inboundCount} received · you replied ${n.replyCount}×`:`${n.inboundCount} received · you've never replied`,trailing:e.jsx(S,{variant:"ghost",size:"sm",icon:e.jsx(M,{className:"size-3.5"}),"aria-busy":i.isPending,onClick:()=>{i.isPending||i.mutate({path:{addressId:n.addressId},body:{flags:{vip:{value:!0,setAt:Date.now(),setBy:"user"}}}})},children:"Add VIP"})},n.addressId))]})}function U({group:t,query:r,onCount:x}){const a=F(r.trim(),300),d=k(),[y,g]=c.useState(null),i=a.length>=2,l=R({query:{q:a,limit:50}}),{data:p,isPending:u,isError:n,error:j}=I({...l,enabled:i}),h=C({...P(),onSuccess:()=>{d.invalidateQueries({queryKey:l.queryKey})}}),f=(p?.items??[]).filter(s=>t==="muted"?s.flags?.muted?.value??!1:s.flags?.blocked?.value??!1);return c.useEffect(()=>{x?.(i?f.length:0,null)},[x,i,f.length]),i?u?e.jsx("div",{className:"px-row-inset py-3 text-sm text-fg-subtle animate-pulse",children:"Searching…"}):n?e.jsx("div",{className:"px-row-inset py-3",children:e.jsx(V,{variant:"inline",title:"Search failed",error:j})}):f.length===0?e.jsxs("p",{className:"px-row-inset py-5 text-sm text-fg-subtle",children:["No ",v[t].toLowerCase()," senders matching “",a,"”."]}):e.jsx(e.Fragment,{children:f.map(s=>{const o=t==="muted"?s.flags?.muted:s.flags?.blocked,b=o?[`${t}`,o.setAt&&K(o.setAt,{month:"short",year:"numeric"})||null,o.reason?`— ${o.reason}`:null].filter(Boolean).join(" "):t,w=h.isPending&&h.variables?.path.addressId===s.addressId,T=h.isError&&y===s.addressId;return e.jsx(E,{name:s.displayName??s.normalizedEmail,email:s.normalizedEmail,danger:t==="blocked",meta:b,trailing:T?e.jsx(S,{variant:"secondary",size:"sm",onClick:()=>{g(s.addressId),h.mutate({path:{addressId:s.addressId},body:{flags:{[t]:null}}})},children:"Retry"}):e.jsx(S,{variant:"ghost",size:"sm",icon:e.jsx(B,{className:"size-3.5"}),"aria-busy":w,"aria-label":`Remove ${t} flag`,onClick:()=>{w||(g(s.addressId),h.mutate({path:{addressId:s.addressId},body:{flags:{[t]:null}}}))}})},s.addressId)})}):e.jsxs("div",{className:"px-row-inset py-5 text-sm text-fg-subtle space-y-2",children:[e.jsxs("p",{children:["Type 2+ characters to search ",v[t].toLowerCase()," ","senders by name or address."]}),e.jsxs("p",{className:"text-2xs text-fg-subtle",children:["Note: a dedicated flagged-address list endpoint is in the backlog. Press ",e.jsx(m,{children:"m"})," on any message to mute its sender; ",e.jsx(m,{children:"b"})," to block."]})]})}function te(){const t=z(),[r,x]=c.useState("vip"),[a,d]=c.useState(""),[y,g]=c.useState(!0),[i,l]=c.useState(0),[p,u]=c.useState({vip:0,muted:null,blocked:null}),n=c.useCallback((s,o)=>{l(s),u(b=>({...b,vip:o}))},[]),j=c.useCallback((s,o)=>{l(s),u(b=>({...b,[r]:s}))},[r]),h=p[r],f=s=>{const o=$[s];o&&t({to:o})};return e.jsx(G,{items:L,activeId:"senders",title:"Senders & Rules",description:"Per-sender preferences — set with one key from any message, managed here.",flush:!0,help:D,helpOpen:y,onToggleHelp:()=>g(s=>!s),onSelect:f,onBackToMail:()=>{t({to:"/mail"})},children:e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col lg:flex-row",children:[e.jsx(_,{active:r,onSelect:s=>{x(s),d("")},options:["vip","muted","blocked"].map(s=>({id:s,label:v[s],count:p[s]}))}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsx("div",{className:"border-b border-line px-row-inset py-2",children:e.jsx(O,{icon:e.jsx(Q,{className:"size-4"}),placeholder:`Filter ${v[r].toLowerCase()} by name or address`,className:"h-8 max-w-sm",value:a,onChange:s=>d(s.target.value)})}),e.jsx("div",{className:"min-h-0 flex-1 divide-y divide-line overflow-y-auto",children:r==="vip"?e.jsx(H,{query:a,onCount:n}):e.jsx(U,{group:r,query:a,onCount:j})}),e.jsxs("footer",{className:"flex items-center justify-between border-t border-line px-row-inset py-1 text-2xs text-fg-subtle",children:[e.jsx("span",{children:h!=null?`${i} of ${h} flagged senders`:`${i} flagged senders`}),e.jsxs("span",{children:[e.jsx(m,{children:"j"})," ",e.jsx(m,{children:"k"})," navigate · ",e.jsx(m,{children:"⌫"})," remove flag"]})]})]})]})})}export{te as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t,bp as o}from"./index-QkIP6MIH.js";const s=()=>t.jsx(o,{});export{s as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as z,r as g,j as e,b as m,B as x,X as j,d as S}from"./index-
|
|
1
|
+
import{a as z,r as g,j as e,b as m,B as x,X as j,d as S}from"./index-QkIP6MIH.js";import{M as B,C as N,A as w}from"./avatar-Ca5J3d1B.js";const v=z("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);function L({items:l,activeId:t,title:i,description:n,children:r,help:s,helpOpen:d=!0,flush:o,onSelect:k,onToggleHelp:f,onBackToMail:h}){const[y,c]=g.useState(!1),[u,C]=g.useState(!1),b=!!s&&d,p=e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 pt-3 pb-1 text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Settings"}),e.jsx("nav",{className:"flex-1 overflow-y-auto px-2 py-1",children:l.map(a=>e.jsxs("button",{type:"button",onClick:()=>{k?.(a.id),c(!1)},className:m("flex min-h-11 w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm transition-colors lg:min-h-0",a.id===t?"bg-accent-2-soft font-medium text-accent-2":"text-fg-muted hover:bg-surface hover:text-fg"),children:[a.icon&&e.jsx("span",{className:m("shrink-0",a.id===t?"text-accent-2":"text-fg-subtle"),children:a.icon}),a.label]},a.id))})]});return e.jsxs("div",{className:"flex h-dvh w-full overflow-hidden bg-canvas font-sans text-fg",children:[e.jsxs("aside",{className:"hidden w-60 shrink-0 flex-col border-r border-line bg-surface-sunken lg:flex",children:[e.jsx("div",{className:"flex h-pane-header shrink-0 items-center border-b border-line px-2",children:e.jsxs("button",{type:"button",onClick:h,className:"flex w-full items-center gap-2 rounded-md px-2 py-1 text-left text-sm text-fg-muted hover:bg-surface hover:text-fg",children:[e.jsx(v,{className:"size-4 text-fg-subtle"}),"Back to mail"]})}),p]}),y&&e.jsxs("div",{className:"fixed inset-0 z-50 flex lg:hidden",children:[e.jsx("button",{type:"button","aria-label":"Close menu",className:"absolute inset-0 bg-canvas/60",onClick:()=>c(!1)}),e.jsxs("aside",{className:"relative flex w-72 max-w-[85%] flex-col border-r border-line bg-surface-sunken",children:[e.jsxs("div",{className:"flex h-pane-header shrink-0 items-center justify-between border-b border-line px-2",children:[e.jsxs("button",{type:"button",onClick:()=>{h?.(),c(!1)},className:"flex items-center gap-2 rounded-md px-2 py-1 text-left text-sm text-fg-muted hover:bg-surface hover:text-fg",children:[e.jsx(v,{className:"size-4 text-fg-subtle"}),"Back to mail"]}),e.jsx(x,{variant:"ghost",size:"sm",icon:e.jsx(j,{className:"size-4"}),onClick:()=>c(!1),"aria-label":"Close menu"})]}),p]})]}),e.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsxs("header",{className:"flex h-pane-header shrink-0 items-center gap-3 border-b border-line px-3 lg:px-5",children:[e.jsx(x,{variant:"ghost",size:"sm",icon:e.jsx(B,{className:"size-4"}),className:"lg:hidden",onClick:()=>c(!0),"aria-label":"Open settings menu"}),e.jsx("h1",{className:"text-md font-semibold text-fg",children:i}),n&&e.jsx("p",{className:"hidden min-w-0 truncate text-xs text-fg-subtle lg:block",children:n}),s&&e.jsx(x,{variant:"ghost",size:"sm",icon:e.jsx(N,{className:"size-4"}),className:"ml-auto lg:hidden",onClick:()=>C(a=>!a),"aria-label":"Tips","aria-expanded":u}),s&&!b&&e.jsx(x,{variant:"ghost",size:"sm",icon:e.jsx(N,{className:"size-4"}),className:"hidden ml-auto lg:inline-flex",onClick:f,"aria-label":"Show tips"})]}),s&&u&&e.jsx("div",{className:"border-b border-line bg-surface-sunken px-row-inset py-3 text-xs leading-relaxed text-fg-muted lg:hidden",children:s}),o?e.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:r}):e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsx("div",{className:"max-w-2xl px-3 py-5 lg:px-5",children:e.jsx("div",{className:"space-y-5",children:r})})})]}),b&&e.jsxs("aside",{className:"hidden w-64 shrink-0 flex-col border-l border-line bg-surface-sunken lg:flex",children:[e.jsxs("header",{className:"flex h-pane-header shrink-0 items-center justify-between border-b border-line px-row-inset",children:[e.jsx("span",{className:"text-2xs font-semibold uppercase tracking-wider text-fg-subtle",children:"Tips & tricks"}),e.jsx(x,{variant:"ghost",size:"sm",icon:e.jsx(j,{className:"size-3.5"}),onClick:f,"aria-label":"Collapse tips"})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-row-inset py-3 text-xs leading-relaxed text-fg-muted",children:s})]})]})}function E({name:l,email:t,meta:i,caption:n,danger:r,trailing:s}){return e.jsxs("div",{className:"flex items-center gap-3 px-row-inset py-2 hover:bg-surface-sunken",children:[e.jsx("span",{className:m(r&&"rounded-full ring-2 ring-danger/40"),children:e.jsx(w,{name:l,email:t,size:"sm"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-col gap-0 sm:flex-row sm:items-baseline sm:gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium text-fg",children:l}),e.jsx("span",{className:"truncate text-2xs text-fg-subtle",children:t})]}),e.jsxs("div",{className:"text-xs text-fg-subtle",children:[i,n&&e.jsxs("span",{className:"text-fg-muted",children:[" · ",n]})]})]}),s&&e.jsx("div",{className:"shrink-0",children:s})]})}const O={healthy:{tone:"positive",label:"healthy"},error:{tone:"danger",label:"error"},muted:{tone:"neutral",label:"muted"}};function F({label:l,email:t,connector:i,syncLabel:n,state:r,errorDetail:s,trailing:d}){const o=O[r];return e.jsxs("div",{className:m("rounded-sm border border-line bg-surface",r==="muted"&&"opacity-65"),children:[e.jsxs("div",{className:"flex flex-col gap-3 px-row-inset py-3 sm:flex-row sm:items-center",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[e.jsx(w,{name:l,email:t,size:"md"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-semibold text-fg",children:l}),e.jsx(S,{tone:o.tone,dot:!0,children:o.label})]}),e.jsxs("div",{className:"truncate text-xs text-fg-subtle",children:[t," · ",i," · ",n]})]})]}),d&&e.jsx("div",{className:"shrink-0",children:d})]}),s&&e.jsx("div",{className:"border-t border-line px-row-inset py-2",children:e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s})})]})}export{F as A,L as S,E as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,
|
|
1
|
+
import{j as t,br as e}from"./index-QkIP6MIH.js";const o=()=>t.jsx(e,{to:"/settings/senders",replace:!0});export{o as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u,r as c}from"./index-
|
|
1
|
+
import{a as u,r as c}from"./index-QkIP6MIH.js";const n=u("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),i=(e,t)=>{const[r,o]=c.useState(e);return c.useEffect(()=>{const s=setTimeout(()=>o(e),t);return()=>clearTimeout(s)},[e,t]),r};export{n as S,i as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as y,j as i,B as u,b as m,
|
|
1
|
+
import{r as y,j as i,B as u,b as m,i as p,Z as x,ay as C,ap as h,ax as j,as as k,aC as L,bq as E,bu as O}from"./index-QkIP6MIH.js";const t=()=>i.jsx(p,{className:"size-3.5 animate-spin"}),f=(s,n)=>n?i.jsx("span",{className:"sr-only",children:s}):s;function S({actions:s=[],destructive:n,className:l}){const[r,o]=y.useState(!1);return r&&n?.confirm?i.jsxs("div",{className:m("flex items-center gap-2",l),children:[i.jsx("span",{className:"text-xs text-fg-muted",children:n.confirm.prompt}),i.jsx(u,{variant:"secondary",size:"sm",onClick:()=>o(!1),children:n.confirm.cancelLabel??"Cancel"}),i.jsx(u,{variant:"danger",size:"sm","aria-busy":n.busy,icon:n.busy?t():void 0,onClick:()=>{n.busy||n.onClick()},children:n.busy?n.busyLabel??"Working…":n.confirm.confirmLabel??n.label})]}):i.jsxs("div",{className:m("flex items-center gap-2",l),children:[s.map(a=>i.jsx(u,{variant:a.variant??"ghost",size:"sm","aria-busy":a.busy,"aria-label":a.iconOnly?a.label:void 0,icon:a.busy?t():a.icon,onClick:()=>{a.busy||a.onClick()},children:a.busy&&a.busyLabel?a.busyLabel:f(a.label,a.iconOnly)},a.label)),n&&i.jsx(u,{variant:"ghost",size:"sm","aria-busy":n.busy,"aria-label":n.iconOnly?n.label:void 0,icon:n.busy?t():n.icon,onClick:()=>{if(!n.busy){if(n.confirm){o(!0);return}n.onClick()}},children:n.busy&&n.busyLabel?n.busyLabel:f(n.label,n.iconOnly)})]})}const c={html:"",plainText:""},z=s=>{const n=x(),{pushError:l}=C(),{data:r}=h({...j(),staleTime:1/0}),o=y.useMemo(()=>{if(!s||!r)return c;const e=r.accounts.find(b=>b.accountId===s);return e?{html:e.signatureHtml??"",plainText:e.signaturePlainText??""}:c},[s,r]),a=k({...O(),onSuccess:()=>{n.invalidateQueries({queryKey:E()})},onError:e=>{l(L("Couldn't save signature","The signature wasn't saved.",e))}}),g=y.useCallback((e,b)=>{s&&a.mutate({path:{accountId:s},body:{signatureHtml:e,signaturePlainText:b}})},[s,a]);return{signature:o,setSignature:g,isSaving:a.isPending}};export{S as R,z as u};
|
package/index.html
CHANGED
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
} catch (_) {}
|
|
32
32
|
})();
|
|
33
33
|
</script>
|
|
34
|
-
<script type="module" crossorigin src="/assets/index-
|
|
35
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
34
|
+
<script type="module" crossorigin src="/assets/index-QkIP6MIH.js"></script>
|
|
35
|
+
<link rel="stylesheet" crossorigin href="/assets/index-ChxiTmNG.css">
|
|
36
36
|
</head>
|
|
37
37
|
<body>
|
|
38
38
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as ot,j as t,b as O,g as rt,r as c,d as ct,w as A,Y as lt,ar as V,bo as mt,br as ut,ao as X,bE as Y,aw as dt,B as N,h as W,bq as pt,i as Q,bA as ht,m as xt}from"./index-DmAjS0RP.js";import{K as ft}from"./kbd-7BCcqn6e.js";import{S as U}from"./select-BjP4w3Or.js";import{c as yt,M as gt}from"./account-form-helpers-xI92Dwmc.js";const K=ot("AtSign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]);const vt=ot("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);function bt({url:e}){return t.jsxs("p",{className:"text-2xs text-fg-subtle",children:["Stored encrypted, used only to connect to your mail server."," ",e?t.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"How to create an app password"}):t.jsx("span",{children:"Check your provider's help for app password instructions."})]})}function jt({raised:e,className:r,...s}){return t.jsx("div",{className:O("rounded-sm border border-line bg-surface",e?"bg-surface-raised shadow-sm":"",r),...s})}function I({className:e,children:r,...s}){return t.jsx("label",{className:O("mb-1 block text-xs font-medium text-fg-muted",e),...s,children:r})}function J({value:e,defaultValue:r,onValueChange:s,...a}){return s?t.jsxs(U,{value:e,onChange:n=>s(n.target.value),...a,children:[t.jsx("option",{value:"tls",children:"TLS/SSL"}),t.jsx("option",{value:"starttls",children:"STARTTLS"}),t.jsx("option",{value:"none",children:"None (insecure)"})]}):t.jsxs(U,{defaultValue:r??e,...a,children:[t.jsx("option",{value:"tls",children:"TLS/SSL"}),t.jsx("option",{value:"starttls",children:"STARTTLS"}),t.jsx("option",{value:"none",children:"None (insecure)"})]})}function D(e){return{tls:e==="tls",startTls:e==="starttls"}}function St({steps:e,activeStep:r}){return t.jsx("ol",{className:"flex items-center gap-1",children:e.map((s,a)=>{const n=a<r,o=a===r;return t.jsxs("li",{className:"flex items-center gap-1",children:[a>0&&t.jsx("span",{className:"h-px w-5 bg-line","aria-hidden":!0}),t.jsxs("span",{className:"flex items-center gap-1.5",children:[t.jsx("span",{className:O("flex size-5 items-center justify-center rounded-full text-2xs font-semibold tabular-nums",n&&"bg-accent text-accent-fg",o&&"bg-accent-soft text-accent ring-1 ring-accent",!n&&!o&&"bg-surface-sunken text-fg-subtle"),children:n?t.jsx(rt,{className:"size-3"}):a+1}),t.jsx("span",{className:O("hidden text-2xs sm:inline",o?"font-medium text-fg":"text-fg-subtle"),children:s})]})]},s)})})}function L({steps:e,activeStep:r,title:s,subtitle:a,children:n,footer:o,hideSteps:m}){return t.jsxs("div",{className:"flex min-h-dvh w-full flex-col items-center overflow-y-auto bg-canvas px-8 pb-8 pt-8 font-sans text-fg sm:pt-[30vh]",children:[!m&&t.jsx("div",{className:"mb-5 w-full max-w-xl",children:t.jsx(St,{steps:e,activeStep:r})}),t.jsxs(jt,{raised:!0,className:"w-full max-w-xl",children:[t.jsxs("div",{className:"px-5 pt-5",children:[t.jsx("h1",{className:"text-xl font-semibold text-fg",children:s}),a&&t.jsx("p",{className:"mt-1 text-sm text-fg-muted",children:a})]}),t.jsx("div",{className:"px-5 py-5",children:n}),o&&t.jsx("div",{className:"flex items-center justify-between gap-3 border-t border-line px-5 py-3",children:o})]})]})}const wt="Coming soon — use IMAP for now.";function B({name:e,description:r,icon:s,comingSoon:a,selected:n,onSelect:o}){const[m,d]=c.useState(!1),i=()=>{if(o){o();return}a&&d(!0)};return t.jsxs("div",{className:"flex flex-col gap-1.5",children:[t.jsxs("button",{type:"button",onClick:i,"aria-disabled":a||void 0,className:O("flex flex-col items-start gap-2 rounded-sm border p-3 text-left transition-colors",n?"border-accent-2 bg-accent-2-soft":"border-line bg-surface hover:border-line-strong",a&&"opacity-55"),children:[t.jsx("span",{className:O("text-fg-muted",n&&"text-accent-2"),children:s}),t.jsxs("span",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"text-sm font-semibold text-fg",children:e}),a&&t.jsx("span",{className:"rounded-full bg-surface-sunken px-1.5 py-0.5 text-2xs text-fg-subtle",children:"soon"})]}),t.jsx("span",{className:"text-xs text-fg-subtle",children:r})]}),m&&t.jsx("p",{className:"text-2xs text-fg-subtle",children:wt})]})}function Z({legend:e,badge:r,host:s,port:a,security:n,readOnly:o,onHostChange:m,onPortChange:d,onSecurityChange:i,hostPlaceholder:x,portPlaceholder:k}){const j=c.useId(),f=c.useId(),S=c.useId();return t.jsxs("fieldset",{children:[t.jsxs("legend",{className:"flex items-center gap-2 text-sm font-semibold text-fg",children:[e,r&&t.jsx(ct,{tone:r.tone,children:r.label})]}),t.jsxs("div",{className:"mt-2 grid grid-cols-1 gap-3 sm:grid-cols-[1fr_6rem_8rem] sm:gap-2",children:[t.jsxs("div",{children:[t.jsx(I,{htmlFor:j,children:"Host"}),m?t.jsx(A,{id:j,readOnly:o,value:s,onChange:h=>m(h.target.value),placeholder:x}):t.jsx(A,{id:j,readOnly:o,defaultValue:s,placeholder:x})]}),t.jsxs("div",{children:[t.jsx(I,{htmlFor:f,children:"Port"}),d?t.jsx(A,{id:f,readOnly:o,value:a,onChange:h=>d(h.target.value),placeholder:k}):t.jsx(A,{id:f,readOnly:o,defaultValue:a,placeholder:k})]}),t.jsxs("div",{children:[t.jsx(I,{htmlFor:S,children:"Security"}),i?t.jsx(J,{id:S,value:n,onValueChange:i}):t.jsx(J,{id:S,defaultValue:n})]})]})]})}function H({label:e,detail:r,state:s}){return t.jsxs("div",{className:"flex items-start gap-3 py-2",children:[t.jsxs("span",{className:O("mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full text-2xs",s==="ok"&&"bg-positive text-accent-fg",s==="failed"&&"bg-danger text-accent-fg",s==="running"&&"border border-accent text-accent",s==="pending"&&"border border-line text-fg-subtle"),children:[s==="ok"&&t.jsx(rt,{className:"size-3"}),s==="failed"&&"!",s==="running"&&t.jsx("span",{className:"size-2 animate-pulse rounded-full bg-accent"})]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:O("text-sm",s==="failed"?"font-medium text-danger":"text-fg"),children:e}),r&&t.jsx("div",{className:"mt-0.5 text-xs text-fg-subtle",children:r})]})]})}const kt={"gmail.com":{imap:{host:"imap.gmail.com",port:993,security:"tls"},smtp:{host:"smtp.gmail.com",port:587,security:"starttls"},source:"provider-table"},"googlemail.com":{imap:{host:"imap.gmail.com",port:993,security:"tls"},smtp:{host:"smtp.gmail.com",port:587,security:"starttls"},source:"provider-table"},"outlook.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"hotmail.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"live.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"msn.com":{imap:{host:"outlook.office365.com",port:993,security:"tls"},smtp:{host:"smtp.office365.com",port:587,security:"starttls"},source:"provider-table"},"icloud.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"me.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"mac.com":{imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},source:"provider-table"},"fastmail.com":{imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},source:"provider-table"},"fastmail.fm":{imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},source:"provider-table"},"yahoo.com":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"yahoo.co.uk":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"ymail.com":{imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},source:"provider-table"},"aol.com":{imap:{host:"imap.aol.com",port:993,security:"tls"},smtp:{host:"smtp.aol.com",port:465,security:"tls"},source:"provider-table"},"zoho.com":{imap:{host:"imap.zoho.com",port:993,security:"tls"},smtp:{host:"smtp.zoho.com",port:465,security:"tls"},source:"provider-table"},"gmx.com":{imap:{host:"imap.gmx.com",port:993,security:"tls"},smtp:{host:"smtp.gmx.com",port:587,security:"starttls"},source:"provider-table"},"gmx.net":{imap:{host:"imap.gmx.net",port:993,security:"tls"},smtp:{host:"mail.gmx.net",port:587,security:"starttls"},source:"provider-table"},"gmx.de":{imap:{host:"imap.gmx.net",port:993,security:"tls"},smtp:{host:"mail.gmx.net",port:587,security:"starttls"},source:"provider-table"},"web.de":{imap:{host:"imap.web.de",port:993,security:"tls"},smtp:{host:"smtp.web.de",port:587,security:"starttls"},source:"provider-table"},"mail.com":{imap:{host:"imap.mail.com",port:993,security:"tls"},smtp:{host:"smtp.mail.com",port:465,security:"tls"},source:"provider-table"},"hey.com":{imap:{host:"imap.hey.com",port:993,security:"tls"},smtp:{host:"smtp.hey.com",port:465,security:"tls"},source:"provider-table"},"tutanota.com":{imap:{host:"mail.tutanota.com",port:993,security:"tls"},smtp:{host:"mail.tutanota.com",port:465,security:"tls"},source:"provider-table"},"tuta.io":{imap:{host:"mail.tutanota.com",port:993,security:"tls"},smtp:{host:"mail.tutanota.com",port:465,security:"tls"},source:"provider-table"},"posteo.de":{imap:{host:"posteo.de",port:993,security:"tls"},smtp:{host:"posteo.de",port:465,security:"tls"},source:"provider-table"},"runbox.com":{imap:{host:"imap.runbox.com",port:993,security:"tls"},smtp:{host:"smtp.runbox.com",port:587,security:"starttls"},source:"provider-table"},"mailbox.org":{imap:{host:"imap.mailbox.org",port:993,security:"tls"},smtp:{host:"smtp.mailbox.org",port:465,security:"tls"},source:"provider-table"},"hushmail.com":{imap:{host:"imap.hushmail.com",port:993,security:"tls"},smtp:{host:"smtp.hushmail.com",port:465,security:"tls"},source:"provider-table"}},Nt={"gmail.com":"https://support.google.com/accounts/answer/185833","googlemail.com":"https://support.google.com/accounts/answer/185833","yahoo.com":"https://help.yahoo.com/kb/generate-manage-third-party-passwords-sln15241.html","icloud.com":"https://support.apple.com/en-us/102654","me.com":"https://support.apple.com/en-us/102654","mac.com":"https://support.apple.com/en-us/102654","fastmail.com":"https://www.fastmail.help/hc/en-us/articles/360058752854","fastmail.fm":"https://www.fastmail.help/hc/en-us/articles/360058752854","outlook.com":"https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9","hotmail.com":"https://support.microsoft.com/en-us/account-billing/manage-app-passwords-for-two-step-verification-d6dc8c6d-4bf7-4851-ad95-6d07799387e9","zoho.com":"https://help.zoho.com/portal/en/kb/zoho-mail/client-configuration/imap-access/articles/zoho-mail-app-passwords"};function nt(e){try{const s=new DOMParser().parseFromString(e,"application/xml");if(s.querySelector("parsererror"))return null;const a=s.querySelectorAll("incomingServer[type='imap']"),n=s.querySelectorAll("outgoingServer[type='smtp']");if(!a.length||!n.length)return null;const o=a[0],m=n[0],d=o.querySelector("hostname")?.textContent?.trim(),i=o.querySelector("port")?.textContent?.trim(),x=o.querySelector("socketType")?.textContent?.trim().toUpperCase(),k=m.querySelector("hostname")?.textContent?.trim(),j=m.querySelector("port")?.textContent?.trim(),f=m.querySelector("socketType")?.textContent?.trim().toUpperCase();if(!d||!i||!k||!j)return null;const S=h=>h==="SSL"||h==="TLS"||h==="SSL/TLS"?"tls":h==="STARTTLS"?"starttls":"none";return{imap:{host:d,port:Number.parseInt(i,10),security:S(x)},smtp:{host:k,port:Number.parseInt(j,10),security:S(f)},source:"mozilla-autoconfig"}}catch{return null}}async function Ct(e,r){try{const s=`https://autoconfig.thunderbird.net/v1.1/${e}`,a=await fetch(s,{signal:r});if(!a.ok)return null;const n=await a.text(),o=nt(n);return o||null}catch{return null}}async function Et(e,r){try{const s=`https://autoconfig.${e}/mail/config-v1.1.xml`,a=await fetch(s,{signal:r});if(!a.ok)return null;const n=await a.text(),o=nt(n);return o?{...o,source:"domain-autoconfig"}:null}catch{return null}}function Tt(e){return{imap:{host:`imap.${e}`,port:993,security:"tls"},smtp:{host:`smtp.${e}`,port:587,security:"starttls"},source:"heuristic"}}async function Pt(e,r=1500){const s=e.indexOf("@");if(s===-1)return null;const a=e.slice(s+1).toLowerCase();if(!a)return null;const n=kt[a];if(n)return n;const o=new AbortController,m=setTimeout(()=>o.abort(),r);try{const d=await Ct(a,o.signal);if(d)return d;const i=await Et(a,o.signal);if(i)return i}finally{clearTimeout(m)}return Tt(a)}function At(e){const r=e.indexOf("@");return r===-1?"Looking up server settings…":`Looking up settings for ${e.slice(r+1)}…`}function at(e){const r=e.indexOf("@");if(r===-1)return;const s=e.slice(r+1).toLowerCase();return Nt[s]}const it=[{id:"icloud",label:"iCloud",username:"full-email",imap:{host:"imap.mail.me.com",port:993,security:"tls"},smtp:{host:"smtp.mail.me.com",port:587,security:"starttls"},passwordHelp:{text:"iCloud requires an app-specific password, not your Apple ID password. Generate one under Sign-In & Security → App-Specific Passwords.",url:"https://support.apple.com/en-us/102654"}},{id:"yahoo",label:"Yahoo",username:"full-email",imap:{host:"imap.mail.yahoo.com",port:993,security:"tls"},smtp:{host:"smtp.mail.yahoo.com",port:465,security:"tls"},passwordHelp:{text:"Yahoo requires an app password, not your login password. Generate one under Account Security.",url:"https://help.yahoo.com/kb/generate-manage-third-party-passwords-sln15241.html"}},{id:"aol",label:"AOL",username:"full-email",imap:{host:"imap.aol.com",port:993,security:"tls"},smtp:{host:"smtp.aol.com",port:465,security:"tls"},passwordHelp:{text:"AOL requires an app password, not your login password. Generate one under Account Security.",url:"https://login.aol.com/account/security"}},{id:"fastmail",label:"Fastmail",username:"full-email",imap:{host:"imap.fastmail.com",port:993,security:"tls"},smtp:{host:"smtp.fastmail.com",port:465,security:"tls"},passwordHelp:{text:"Fastmail requires an app password, not your login password. Create one under Settings → Privacy & Security → App passwords.",url:"https://www.fastmail.help/hc/en-us/articles/360058752854"}}];function tt(e){return it.find(r=>r.id===e)}const It={"icloud.com":"icloud","me.com":"icloud","mac.com":"icloud","yahoo.com":"yahoo","yahoo.co.uk":"yahoo","ymail.com":"yahoo","aol.com":"aol","fastmail.com":"fastmail","fastmail.fm":"fastmail"};function Lt(e){const r=e.indexOf("@");if(r===-1)return"";const s=e.slice(r+1).toLowerCase();return It[s]??""}const M=["Connector","Address","Servers","Credentials","Test","Sync"],z={connector:0,address:1,servers:2,credentials:3,test:4,sync:5},et={host:"",port:993,security:"tls"},st={host:"",port:587,security:"starttls"};function Mt({onStart:e}){return c.useEffect(()=>{const r=s=>{s.key==="Enter"&&e()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e]),t.jsx(L,{steps:M,activeStep:0,hideSteps:!0,title:"Welcome to Remit",subtitle:"One inbox for all your mail, with context about every message.",footer:t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"text-2xs text-fg-subtle",children:[t.jsx(ft,{children:"Enter"})," to continue"]}),t.jsx(N,{variant:"primary",onClick:e,children:"Add your first account"})]}),children:t.jsxs("div",{className:"flex flex-col items-start py-5",children:[t.jsx("span",{className:"flex size-14 items-center justify-center rounded-md bg-accent-soft",children:t.jsx(gt,{className:"size-7 text-accent"})}),t.jsx("p",{className:"mt-5 max-w-sm text-sm leading-relaxed text-fg-muted",children:"Remit syncs your existing mailboxes and tells you who is really writing to you — sender history, authenticity checks, and similar messages, right next to every email."})]})})}function Ft({onContinue:e,onMicrosoft:r,onBack:s,showBack:a}){const[n,o]=c.useState("imap");c.useEffect(()=>{const d=i=>{i.key==="Enter"&&(n==="microsoft"?r():e()),i.key==="Escape"&&s()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e,r,s,n]);const m=()=>{n==="microsoft"?r():e()};return t.jsx(L,{steps:M,activeStep:z.connector,title:"How does this account connect?",subtitle:"Choose a sign-in method. IMAP works with any provider.",footer:t.jsxs(t.Fragment,{children:[a?t.jsx(N,{variant:"ghost",onClick:s,children:"Back"}):t.jsx("span",{}),t.jsx(N,{variant:"primary",onClick:m,children:n==="microsoft"?"Continue with Microsoft":"Continue with IMAP"})]}),children:t.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[t.jsx(B,{name:"IMAP / SMTP",description:"Any mail provider — Fastmail, iCloud, your own server.",icon:t.jsx(vt,{className:"size-5"}),selected:n==="imap",onSelect:()=>o("imap")}),t.jsx(B,{name:"Gmail",description:"Sign in with Google. No app passwords.",icon:t.jsx(K,{className:"size-5"}),comingSoon:!0}),t.jsx(B,{name:"Outlook / Microsoft 365",description:"Sign in with Microsoft. Works with Outlook.com and work accounts.",icon:t.jsx(xt,{className:"size-5"}),selected:n==="microsoft",onSelect:()=>o("microsoft")})]})})}function Ot({onBack:e,onRedirecting:r}){const[s,a]=c.useState(""),[n,o]=c.useState(null),m=V({...ht(),onSuccess:i=>{r(),window.location.assign(i.authorizationUrl)},onError:i=>{o(i instanceof Error?i.message:"Failed to start sign-in")}}),d=()=>{o(null),m.mutate({body:{email:s.trim()||void 0}})};return c.useEffect(()=>{const i=x=>{x.key==="Enter"&&!m.isPending&&d(),x.key==="Escape"&&e()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[e,m.isPending]),t.jsx(L,{steps:M,activeStep:z.connector,title:"Sign in with Microsoft",subtitle:"You'll be redirected to Microsoft to sign in securely.",footer:t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:e,children:"Back"}),t.jsx(N,{variant:"primary",onClick:d,disabled:m.isPending,icon:m.isPending?t.jsx(W,{className:"size-4 animate-spin"}):void 0,children:m.isPending?"Redirecting…":"Sign in with Microsoft"})]}),children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{children:[t.jsx(I,{htmlFor:"microsoft-email",children:"Email address (optional)"}),t.jsx(A,{id:"microsoft-email",icon:t.jsx(K,{className:"size-4"}),placeholder:"you@outlook.com",value:s,onChange:i=>a(i.target.value),type:"email",autoComplete:"email"}),t.jsx("p",{className:"mt-1.5 text-2xs text-fg-subtle",children:"Pre-fills the Microsoft sign-in form. Leave blank to choose on the Microsoft page."})]}),n&&t.jsx(Q,{tone:"danger",children:n})]})})}function zt({initialEmail:e,initialDisplayName:r,onContinue:s,onBack:a}){const[n,o]=c.useState(e),[m,d]=c.useState(r),[i,x]=c.useState(!1),[k,j]=c.useState(""),[f,S]=c.useState(null),h=c.useCallback(async()=>{const y=n.trim();if(!y.includes("@")||!y.includes(".")){S("Enter a valid email address.");return}S(null),x(!0),j(At(y));try{const u=await Pt(y);s(y,m.trim(),u)}finally{x(!1)}},[n,m,s]);return c.useEffect(()=>{const y=u=>{u.key==="Enter"&&!i&&h(),u.key==="Escape"&&a()};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[h,i,a]),t.jsx(L,{steps:M,activeStep:z.address,title:"What's the email address?",subtitle:"We'll detect the server settings for you.",footer:t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:a,children:"Back"}),t.jsx(N,{variant:"primary",disabled:i,onClick:()=>{h()},children:"Continue"})]}),children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(I,{htmlFor:"onboarding-email",children:"Email address"}),t.jsx(A,{id:"onboarding-email",icon:t.jsx(K,{className:"size-4"}),placeholder:"you@example.com",value:n,onChange:y=>{o(y.target.value),S(null)},type:"email",autoComplete:"email"})]}),t.jsxs("div",{children:[t.jsx(I,{htmlFor:"onboarding-display-name",children:"Display name (optional)"}),t.jsx(A,{id:"onboarding-display-name",placeholder:"Alice",value:m,onChange:y=>d(y.target.value)}),t.jsx("p",{className:"mt-1.5 text-2xs text-fg-subtle",children:"What to call this account in Remit. Leave blank to use a name derived from the address."})]}),i&&t.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-fg-muted",children:[t.jsx(W,{className:"size-3.5 animate-spin text-accent"}),k]}),f&&!i&&t.jsx("div",{className:"mt-3",children:t.jsx(Q,{tone:"danger",children:f})})]})})}function Rt({email:e,imapConfig:r,smtpConfig:s,discovered:a,onContinue:n,onBack:o,onChange:m}){const[d,i]=c.useState(r),[x,k]=c.useState(s),[j,f]=c.useState(()=>Lt(e)),[S,h]=c.useState(!1),[y,u]=c.useState(null),v=tt(j),p=v!==void 0&&!S,C=c.useCallback(l=>{f(l),h(!1),u(null);const w=tt(l);w&&(i({host:w.imap.host,port:w.imap.port,security:w.imap.security}),k({host:w.smtp.host,port:w.smtp.port,security:w.smtp.security}))},[]);c.useEffect(()=>{m(d,x)},[d,x,m]);const g=d.host.trim()!=="",b=c.useCallback(()=>{if(!g){u("Enter the IMAP host.");return}u(null),n()},[g,n]);c.useEffect(()=>{const l=w=>{w.key==="Enter"&&b(),w.key==="Escape"&&o()};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[b,o]);const T=e.split("@")[1]??"your domain",P=v?"Pick your provider to fill in the right settings — or choose Custom to enter them by hand.":a?"Found via autodiscovery — adjust anything that looks off.":`We couldn't detect settings for ${T} — enter them manually.`,F=p?{label:"preset",tone:"neutral"}:!v&&a?{label:"detected",tone:"positive"}:void 0,R=v?.passwordHelp.url??at(e);return t.jsx(L,{steps:M,activeStep:z.servers,title:"Confirm server settings",subtitle:P,footer:t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:o,children:"Back"}),t.jsx(N,{variant:"primary",onClick:b,children:"Continue"})]}),children:t.jsxs("div",{className:"space-y-5",children:[y&&t.jsx(Q,{tone:"danger",children:y}),t.jsxs("div",{children:[t.jsx(I,{htmlFor:"provider-select",children:"Provider"}),t.jsxs(U,{id:"provider-select",value:j,onChange:l=>C(l.target.value),children:[t.jsx("option",{value:"",children:"Custom / other"}),it.map(l=>t.jsx("option",{value:l.id,children:l.label},l.id))]}),v&&t.jsx("p",{className:"mt-1 text-2xs text-fg-subtle",children:p?t.jsxs(t.Fragment,{children:["Server settings are pre-filled for ",v.label," and locked."," ",t.jsx("button",{type:"button",className:"text-accent underline",onClick:()=>h(!0),children:"Advanced"})," ","lets you edit them by hand."]}):t.jsxs(t.Fragment,{children:["Editing ",v.label,"'s settings by hand."]})})]}),t.jsx(Z,{legend:"IMAP — incoming",badge:F,readOnly:p,host:d.host,port:String(d.port),security:d.security,hostPlaceholder:"imap.example.com",portPlaceholder:"993",onHostChange:l=>{i(w=>({...w,host:l})),u(null)},onPortChange:l=>i(w=>({...w,port:Number(l)})),onSecurityChange:l=>i(w=>({...w,security:l}))}),t.jsx("p",{className:"text-2xs text-fg-subtle",children:"Sending (SMTP) is optional — leave it blank to set up a receive-only account and add sending later in Settings."}),t.jsx(Z,{legend:"SMTP — outgoing (optional)",badge:F,readOnly:p,host:x.host,port:String(x.port),security:x.security,hostPlaceholder:"smtp.example.com",portPlaceholder:"587",onHostChange:l=>{k(w=>({...w,host:l})),u(null)},onPortChange:l=>k(w=>({...w,port:Number(l)})),onSecurityChange:l=>k(w=>({...w,security:l}))}),v&&t.jsxs("p",{className:"text-2xs text-fg-subtle",children:[v.passwordHelp.text," ",R&&t.jsx("a",{href:R,target:"_blank",rel:"noopener noreferrer",className:"text-accent underline",children:"Get an app password"})]})]})})}function Ht({email:e,username:r,password:s,onContinue:a,onBack:n,onChange:o}){const[m,d]=c.useState(r||e),[i,x]=c.useState(s),[k,j]=c.useState(null),f=e.split("@")[1]??"",S=at(e),h=m.trim()!==""&&i.trim()!=="";c.useEffect(()=>{o(m,i)},[m,i,o]);const y=c.useCallback(()=>{if(!h){j("Enter your username and password.");return}j(null),a()},[h,a]);return c.useEffect(()=>{const u=v=>{v.key==="Enter"&&y(),v.key==="Escape"&&n()};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[y,n]),t.jsx(L,{steps:M,activeStep:z.credentials,title:`Sign in to ${f||"your mail server"}`,subtitle:"Many providers require an app password instead of your normal one.",footer:t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:n,children:"Back"}),t.jsx(N,{variant:"primary",onClick:y,children:"Test connection"})]}),children:t.jsxs("div",{className:"space-y-3",children:[k&&t.jsx("div",{className:"rounded-md bg-danger-soft px-3 py-2 text-sm text-danger",children:k}),t.jsxs("div",{children:[t.jsx(I,{htmlFor:"credentials-username",children:"Username"}),t.jsx(A,{id:"credentials-username",value:m,onChange:u=>{d(u.target.value),j(null)},autoComplete:"username"})]}),t.jsxs("div",{children:[t.jsx(I,{htmlFor:"credentials-password",children:"Password or app password"}),t.jsx(A,{id:"credentials-password",type:"password",value:i,onChange:u=>{x(u.target.value),j(null)},autoComplete:"current-password"})]}),t.jsx(bt,{url:S})]})})}function _t({email:e,imapConfig:r,smtpConfig:s,username:a,password:n,onSuccess:o,onBackToCredentials:m,onBackToServers:d}){const[i,x]=c.useState({imapState:"running",smtpState:"pending",phase:"running"}),[k,j]=c.useState(0),f=s.host.trim()!=="",S=D(r.security),h=D(s.security),y=V({...pt()});c.useEffect(()=>{let p=!1;const C=[];return x({imapState:"running",smtpState:"pending",phase:"running"}),y.mutate({body:{username:a,password:n,imapHost:r.host,imapPort:r.port,imapTls:S.tls,imapStartTls:S.startTls,smtpHost:s.host,smtpPort:s.port,smtpTls:h.tls,smtpStartTls:h.startTls}},{onSuccess:g=>{if(p)return;const b=g.imapSuccess,T=f?g.smtpSuccess:!0;x({imapState:b?"ok":"failed",smtpState:f?"running":"ok",imapDetail:b?`Connected — ${r.host}:${r.port}`:g.imapError,phase:"running"}),C.push(window.setTimeout(()=>{if(p)return;const P=R=>{const l=R?.toLowerCase()??"";return l.includes("auth")||l.includes("login")||l.includes("535")||l.includes("credential")},F=!b&&P(g.imapError)||b&&f&&!g.smtpSuccess&&P(g.smtpError);x({imapState:b?"ok":"failed",smtpState:f?g.smtpSuccess?"ok":"failed":"ok",imapDetail:b?`Connected — ${r.host}:${r.port}`:g.imapError,smtpDetail:f?g.smtpSuccess?`Connected — ${s.host}:${s.port}`:g.smtpError:"Not set up — receive-only",rawError:b?f&&!g.smtpSuccess?g.smtpError:void 0:g.imapError,phase:b&&T?"success":F?"auth-failure":"network-failure"}),b&&T&&C.push(window.setTimeout(()=>{p||o()},800))},400))},onError:g=>{if(p)return;const b=g instanceof Error?g.message:"Connection failed";x({imapState:"failed",smtpState:"failed",imapDetail:b,smtpDetail:b,rawError:b,phase:"network-failure"})}}),()=>{p=!0;for(const g of C)window.clearTimeout(g)}},[k]);const{phase:u}=i;c.useEffect(()=>{const p=C=>{C.key==="Escape"&&(u==="auth-failure"?m():u==="network-failure"&&d())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[u,m,d]);const v=u==="auth-failure"?t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:m,children:"Back to credentials"}),t.jsx(N,{variant:"primary",onClick:()=>j(p=>p+1),children:"Retry"})]}):u==="network-failure"?t.jsxs(t.Fragment,{children:[t.jsx(N,{variant:"ghost",onClick:d,children:"Back to servers"}),t.jsx(N,{variant:"primary",onClick:()=>j(p=>p+1),children:"Retry"})]}):u==="success"?t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-2xs text-fg-subtle",children:"Connection verified"}),t.jsx(N,{variant:"primary",onClick:o,children:"Start syncing"})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-2xs text-fg-subtle",children:"Testing…"}),t.jsx("span",{})]});return t.jsx(L,{steps:M,activeStep:z.test,title:"Testing the connection",subtitle:`Checking ${e}`,footer:v,children:t.jsxs("div",{className:"divide-y divide-line",children:[t.jsx(H,{label:`IMAP — ${r.host}:${r.port}`,detail:i.imapDetail,state:i.imapState}),t.jsx(H,{label:f?`SMTP — ${s.host}:${s.port}`:"SMTP — sending",detail:f?i.smtpDetail:"Not set up — you can add sending later in Settings",state:i.smtpState}),(u==="auth-failure"||u==="network-failure")&&i.rawError&&t.jsxs("div",{className:"py-3",children:[u==="auth-failure"&&t.jsx("p",{className:"mb-2 text-xs text-fg-muted",children:"Check your password — many providers require an app password."}),t.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:i.rawError})]})]})})}function $t({email:e,displayName:r,imapConfig:s,smtpConfig:a,username:n,password:o,onGoToInbox:m}){const d=lt(),[i,x]=c.useState(null),[k,j]=c.useState(null),f=c.useRef(!1),S=D(s.security),h=D(a.security),y=V({...ut(),onSuccess:E=>{x(E.accountId),d.invalidateQueries({queryKey:mt()})},onError:E=>{j(E instanceof Error?E.message:"Failed to create account")}});c.useEffect(()=>{if(f.current)return;f.current=!0;const E=a.host.trim()!=="",_=yt({imapHost:s.host,smtpHost:a.host,smtpPort:a.port}),$=E?_??{smtpHost:a.host,smtpPort:a.port,smtpTls:h.tls,smtpStartTls:h.startTls}:null;y.mutate({body:{email:e,displayName:r||void 0,username:n!==e?n:void 0,password:o,imapHost:s.host,imapPort:s.port,imapTls:S.tls,imapStartTls:S.startTls,smtpHost:$?.smtpHost||void 0,smtpPort:$?.smtpPort||void 0,smtpTls:$?.smtpTls??!1,smtpStartTls:$?.smtpStartTls??!1}})},[]);const{data:u}=X({...Y({path:{accountId:i??""}}),enabled:!!i,refetchInterval:E=>{const _=E.state.data?.syncPhase;return _==="complete"||_==="error"?!1:2e3}}),v=u?.syncPhase==="error",{data:p}=X({...dt(),enabled:!!i&&v}),C=p?.accounts.find(E=>E.accountId===i)?.lastError,g=u?.mailboxes.find(E=>E.fullPath==="INBOX"||E.fullPath==="Inbox"),b=u?.mailboxCountTotal??0,T=u?.mailboxCountSynced??0,P=g?.messagesTotal??0,F=g?.messagesSynced??0,R=P>0?F/P:0,l=u?.syncPhase,w=v?"failed":l==="idle"||l===void 0||l==="discovering_mailboxes"?"running":b>0?"ok":"running",q=v?"failed":!l||l==="idle"||l==="discovering_mailboxes"?"pending":l==="syncing_inbox"||l==="syncing_others"?"running":"ok",G=v?"failed":!l||l==="idle"||l==="discovering_mailboxes"||l==="syncing_inbox"?"pending":l==="syncing_others"?"running":"ok";return k?t.jsx(L,{steps:M,activeStep:z.sync,title:"Couldn't create account",subtitle:"Something went wrong saving your account.",footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{}),t.jsx(N,{variant:"primary",onClick:()=>{f.current=!1,j(null),y.mutate({body:{email:e,displayName:r||void 0,username:n!==e?n:void 0,password:o,imapHost:s.host,imapPort:s.port,imapTls:S.tls,imapStartTls:S.startTls,smtpHost:a.host||void 0,smtpPort:a.port||void 0,smtpTls:h.tls,smtpStartTls:h.startTls}})},children:"Retry"})]}),children:t.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:k})}):t.jsx(L,{steps:M,activeStep:z.sync,title:`Syncing ${e}`,subtitle:"Newest mail first — you can start reading right away.",footer:t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"text-2xs text-fg-subtle",children:"Sync continues in the background"}),t.jsx(N,{variant:"primary",onClick:()=>i&&m(i),children:"Go to inbox"})]}),children:y.isPending?t.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-fg-muted",children:[t.jsx(W,{className:"size-4 animate-spin text-accent"}),"Creating your account…"]}):t.jsxs("div",{className:"space-y-3",children:[P>0&&t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-baseline justify-between text-xs",children:[t.jsx("span",{className:"font-medium text-fg",children:"INBOX"}),t.jsxs("span",{className:"text-fg-subtle tabular-nums",children:[F.toLocaleString()," / ",P.toLocaleString()," ","messages"]})]}),t.jsx("div",{className:"mt-1 h-1.5 overflow-hidden rounded-full bg-surface-sunken",children:t.jsx("div",{className:"h-full rounded-full bg-accent transition-all duration-500",style:{width:`${Math.max(2,R*100)}%`}})})]}),t.jsxs("div",{className:"divide-y divide-line",children:[t.jsx(H,{label:"Mailboxes discovered",detail:b>0?`${b} mailbox${b===1?"":"es"} found`:"Discovering…",state:w}),t.jsx(H,{label:"INBOX",detail:q==="ok"?`${F.toLocaleString()} messages synced`:q==="running"?"Syncing newest first…":"Queued",state:q}),T>1||l==="syncing_others"||l==="complete"?t.jsx(H,{label:"Other mailboxes",detail:G==="ok"?`${T-1} mailboxes synced`:G==="running"?"Syncing…":"Queued",state:G}):null]}),v&&t.jsxs("div",{className:"mt-2 space-y-2",children:[t.jsxs("p",{className:"text-xs text-danger",children:["Sync stalled. The account is still active —"," ",t.jsx("button",{type:"button",className:"underline",onClick:()=>{d.invalidateQueries({queryKey:Y({path:{accountId:i??""}}).queryKey})},children:"retry"})]}),C&&t.jsx("code",{className:"block rounded bg-surface-sunken px-2.5 py-2 text-2xs text-fg-muted",children:C})]})]})})}function Ut({skipWelcome:e=!1,onComplete:r,onCancel:s}){const[a,n]=c.useState(e?"connector":"welcome"),[o,m]=c.useState({email:"",displayName:"",imapConfig:et,smtpConfig:st,username:"",password:"",discoveryResult:null,discovered:!1,createdAccountId:null}),d=c.useCallback(()=>n("connector"),[]),i=c.useCallback(()=>n("address"),[]),x=c.useCallback(()=>n("microsoft-email"),[]),k=c.useCallback(()=>{e?s?.():n("welcome")},[e,s]),j=c.useCallback((u,v,p)=>{let C=et,g=st,b=!1;p&&(b=p.source!=="heuristic",C={host:p.imap.host,port:p.imap.port,security:p.imap.security},g={host:p.smtp.host,port:p.smtp.port,security:p.smtp.security}),m(T=>({...T,email:u,displayName:v,imapConfig:C,smtpConfig:g,discoveryResult:p,discovered:b,username:u})),n("servers")},[]),f=c.useCallback((u,v)=>{m(p=>({...p,imapConfig:u,smtpConfig:v}))},[]),S=c.useCallback((u,v)=>{m(p=>({...p,username:u,password:v}))},[]),h=c.useCallback(()=>n("sync"),[]),y=c.useCallback(u=>{r(u)},[r]);switch(a){case"welcome":return t.jsx(Mt,{onStart:d});case"connector":return t.jsx(Ft,{onContinue:i,onMicrosoft:x,onBack:k,showBack:!e});case"microsoft-email":return t.jsx(Ot,{onBack:()=>n("connector"),onRedirecting:()=>{}});case"address":return t.jsx(zt,{initialEmail:o.email,initialDisplayName:o.displayName,onContinue:j,onBack:()=>n("connector")});case"servers":return t.jsx(Rt,{email:o.email,imapConfig:o.imapConfig,smtpConfig:o.smtpConfig,discovered:o.discovered,onContinue:()=>n("credentials"),onBack:()=>n("address"),onChange:f});case"credentials":return t.jsx(Ht,{email:o.email,username:o.username,password:o.password,onContinue:()=>n("test"),onBack:()=>n("servers"),onChange:S});case"test":return t.jsx(_t,{email:o.email,imapConfig:o.imapConfig,smtpConfig:o.smtpConfig,username:o.username,password:o.password,onSuccess:h,onBackToCredentials:()=>n("credentials"),onBackToServers:()=>n("servers")});case"sync":return t.jsx($t,{email:o.email,displayName:o.displayName,imapConfig:o.imapConfig,smtpConfig:o.smtpConfig,username:o.username,password:o.password,onGoToInbox:y})}}export{Ut as O,it as P,tt as g,D as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as N,j as e,D as C,bF as v,B as n,bG as b,r as p,x,i as z,h as f,d as R,bH as g,b as T,bI as S,bJ as I,bK as A,bL as V,ac as _,bC as B,bD as D}from"./index-DmAjS0RP.js";import{S as M}from"./settings-screen-BCJFYn9T.js";import{D as y}from"./download-BwUpxXRu.js";import{R as j,C as L}from"./rotate-ccw-DMt3woFX.js";import"./avatar-0qIqgsXP.js";const U=N("CloudOff",[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5.782 5.782A7 7 0 0 0 9 19h8.5a4.5 4.5 0 0 0 1.307-.193",key:"yfwify"}],["path",{d:"M21.532 16.5A4.5 4.5 0 0 0 17.5 10h-1.79A7.008 7.008 0 0 0 10 5.07",key:"jlfiyv"}]]);const k=N("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),H=["Remit restarts. Mail stops loading for about a minute and this page will lose its connection while that happens.","Nothing is sent, deleted or moved. Your mail stays at your provider.","If the new version does not come back up, the version you are running now is restored automatically."];function E({open:s,currentVersion:t,release:a,appliesSchemaMigration:i=!1,onClose:r,onConfirm:l}){return s?e.jsx(C,{open:!0,onClose:r,title:`Install Remit ${a.version}`,children:e.jsxs("div",{className:"flex max-h-[80vh] flex-col",children:[e.jsxs("header",{className:"space-y-1 border-b border-line px-4 py-3",children:[e.jsxs("h3",{className:"text-sm font-semibold text-fg",children:["Install Remit ",a.version,"?"]}),e.jsxs("p",{className:"text-xs text-fg-muted",children:["You are on ",t,". ",a.version," was released"," ",v(a.releasedAt),"."]})]}),e.jsxs("div",{className:"flex-1 space-y-3 overflow-auto px-4 py-3",children:[e.jsx("p",{className:"text-sm text-fg-muted",children:a.summary}),e.jsxs("ul",{className:"space-y-2",children:[H.map(c=>e.jsxs("li",{className:"flex gap-2 text-sm text-fg-muted",children:[e.jsx("span",{className:"mt-1.5 size-1.5 shrink-0 rounded-full bg-fg-subtle"}),e.jsx("span",{children:c})]},c)),i&&e.jsxs("li",{className:"flex gap-2 text-sm text-fg-muted",children:[e.jsx("span",{className:"mt-1.5 size-1.5 shrink-0 rounded-full bg-fg-subtle"}),e.jsx("span",{children:"This version updates the database while Remit is offline. The step forward cannot be undone by hand, but a failed start is still rolled back to the version and data you have now."})]})]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Good moment for this: when you are not waiting on a message."})]}),e.jsxs("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line px-4 py-3",children:[e.jsx(n,{variant:"ghost",size:"sm",onClick:r,children:"Not now"}),e.jsx(b,{variant:"secondary",size:"sm",external:!0,href:a.releaseNotesUrl,icon:e.jsx(k,{className:"size-3.5"}),children:"Release notes"}),e.jsx(n,{size:"sm",icon:e.jsx(y,{className:"size-3.5"}),onClick:l,children:"Install and restart"})]})]})}):null}function d({children:s,tone:t}){return e.jsx("div",{className:T("rounded-sm border bg-surface px-row-inset py-3",t==="danger"?"border-danger/50":"border-line"),children:s})}function Y({state:s,onCheck:t,onInstall:a,onDismissResult:i,now:r=Date.now()}){const[l,c]=p.useState(null),m=s.status==="checking",o=s.status==="available",h=()=>{if(m){c("Already checking. The result appears here in a moment.");return}c(null),t()},u=()=>{if(!o&&s.status!=="rolledBack"&&s.status!=="abandoned"){c("There is no update to install. Check for updates first — if one is found it appears here.");return}c(null),a()},w=(()=>{switch(s.status){case"upToDate":return e.jsx(d,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(L,{className:"size-4 shrink-0 text-positive","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg",children:["Remit ",s.version," is the latest version.",e.jsxs("span",{className:"text-fg-subtle",children:[" ","Checked ",g(s.checkedAt,r),"."]})]})]}),e.jsx(n,{variant:"secondary",size:"sm",className:"shrink-0",onClick:h,children:"Check again"})]})});case"checking":return e.jsx(d,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(f,{className:"size-4 shrink-0 animate-spin text-fg-subtle","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["Looking for a newer version. You are on ",s.version,"."]})]}),e.jsx(n,{variant:"secondary",size:"sm",className:"shrink-0",onClick:h,children:"Check again"})]})});case"checkFailed":return e.jsx(d,{children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(U,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"text-sm text-fg",children:"Could not reach the update source."}),e.jsx("p",{className:"text-xs text-fg-muted",children:s.reason}),e.jsxs("p",{className:"text-xs text-fg-subtle",children:["You are still on ",s.version," and it keeps working.",s.lastCheckedAt!==void 0&&e.jsxs(e.Fragment,{children:[" ","Last successful check"," ",g(s.lastCheckedAt,r),"."]})]})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(n,{variant:"secondary",size:"sm",onClick:h,children:"Try again"})})]})});case"available":return e.jsx(d,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:"text-sm font-semibold text-fg",children:["Remit ",s.release.version]}),e.jsx(R,{tone:"accent",children:"update available"}),e.jsxs("span",{className:"text-2xs text-fg-subtle",children:["released ",v(s.release.releasedAt)," · you are on ",s.version]})]}),e.jsx("p",{className:"text-sm text-fg-muted",children:s.release.summary}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Installing restarts Remit, so mail stops loading for about a minute. If the new version does not come back up, the one you are running now is restored on its own."}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(n,{size:"sm",icon:e.jsx(y,{className:"size-3.5"}),onClick:u,children:["Install ",s.release.version]}),e.jsx(b,{variant:"secondary",size:"sm",external:!0,href:s.release.releaseNotesUrl,icon:e.jsx(k,{className:"size-3.5"}),children:"Release notes"})]})]})});case"applying":return e.jsx(d,{children:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(f,{className:"size-4 shrink-0 animate-spin text-accent-2","aria-hidden":!0}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["Installing Remit ",s.target,". The restart screen has the details."]})]})});case"succeeded":return e.jsx(z,{tone:"success",onDismiss:i,children:e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"font-semibold",children:["Updated to Remit ",s.version,"."]}),e.jsxs("p",{children:["You were on ",s.previousVersion,"."," ",e.jsx("a",{href:s.releaseNotesUrl,target:"_blank",rel:"noopener noreferrer",className:"underline",children:"See what changed"}),"."]})]})});case"rolledBack":return e.jsx(d,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," did not start. Remit reports that it put ",s.version," back."]}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["You are running ",s.version," again. A failed update can still have changed things on the way — the log below is the only account of what it got as far as doing."]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported as the failure"}),e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log before trying again:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(n,{variant:"secondary",size:"sm",icon:e.jsx(j,{className:"size-3.5"}),onClick:u,children:["Try ",s.attemptedVersion," again"]}),e.jsxs(n,{variant:"ghost",size:"sm",onClick:i,children:["Stay on ",s.version]})]})]})});case"unreachable":return e.jsx(d,{tone:"danger",children:e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Installing ",s.attemptedVersion," left the server unreachable."]}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Remit has answered again since, but nothing here can say what happened during the silence."})]})]}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand}),e.jsx("div",{className:"flex justify-end",children:e.jsx(n,{variant:"ghost",size:"sm",onClick:i,children:"Dismiss"})})]})});case"rollbackFailed":return e.jsx(d,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0 text-danger","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," did not start, and Remit could not put ",s.previousVersion," back."]}),e.jsx("p",{className:"text-sm text-fg-muted",children:"This is the one outcome Remit cannot resolve on its own. The server is in a half-changed state and needs you at a shell. The log below is the only account of where it stopped."})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported as the failure"}),e.jsx("code",{className:"block rounded-xs bg-danger-soft px-2 py-1 text-2xs text-danger",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log on the server:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx(n,{variant:"ghost",size:"sm",onClick:i,children:"Dismiss"})})]})});case"abandoned":return e.jsx(d,{tone:"danger",children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(x,{className:"mt-0.5 size-4 shrink-0 text-fg-subtle","aria-hidden":!0}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("p",{className:"text-sm font-semibold text-fg",children:["Remit ",s.attemptedVersion," was not installed. Nothing changed."]}),e.jsxs("p",{className:"text-sm text-fg-muted",children:["The update stopped before it altered anything. You are still running ",s.version,"."]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"What Remit reported"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.reason})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-fg-subtle",children:"Read the full log before trying again:"}),e.jsx("code",{className:"block rounded-xs bg-surface-sunken px-2 py-1 text-2xs text-fg-muted",children:s.logsCommand})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(n,{variant:"secondary",size:"sm",icon:e.jsx(j,{className:"size-3.5"}),onClick:u,children:["Try ",s.attemptedVersion," again"]}),e.jsxs(n,{variant:"ghost",size:"sm",onClick:i,children:["Stay on ",s.version]})]})]})});default:return s}})();return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsx("h2",{className:"text-sm font-semibold text-fg",children:"Updates"}),e.jsx("p",{className:"text-xs text-fg-muted",children:"This Remit runs on your own server, so it updates when you say so. Your mail lives at your provider and is never touched by an update."})]}),w,l&&e.jsx("p",{role:"status",className:"text-xs text-fg-muted",children:l})]})}function O(){const{surface:s,release:t,currentVersion:a,appliesSchemaMigration:i,onCheck:r,install:l,onDismissResult:c}=S(),[m,o]=p.useState(!1);return s.status!=="ready"?null:e.jsxs(e.Fragment,{children:[e.jsx(Y,{state:s.section,onCheck:r,onInstall:()=>o(!0),onDismissResult:c}),t&&a&&e.jsx(E,{open:m,currentVersion:a,release:t,appliesSchemaMigration:i,onClose:()=>o(!1),onConfirm:()=>{o(!1),l(t.version)}})]})}function P(s){try{return new Date(s).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return s}}function F({sha:s=A,commitUrl:t=I,buildTime:a=V}){return e.jsxs("p",{className:"text-xs text-fg-subtle",children:["Version"," ",t?e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"font-mono hover:text-fg-muted hover:underline",children:s}):e.jsx("span",{className:"font-mono",children:s})," · ",e.jsxs("span",{children:["Built ",P(a)]})]})}const G=e.jsx("div",{className:"space-y-3",children:e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Notification rules"}),", data export, and per-account diagnostics are coming in a future release."]})});function X(){const s=_(),[t,a]=p.useState(!0),i=r=>{const l=D[r];l&&s({to:l})};return e.jsxs(M,{items:B,activeId:"advanced",title:"Advanced",description:"Notification rules, export, and diagnostics.",help:G,helpOpen:t,onToggleHelp:()=>a(r=>!r),onSelect:i,onBackToMail:()=>{s({to:"/mail"})},children:[e.jsx(O,{}),e.jsx("p",{className:"text-sm text-fg-muted",children:"Notification rules, data export, and raw sync diagnostics are coming in a future release."}),e.jsxs("div",{className:"border-t border-line pt-4 mt-4",children:[e.jsx("p",{className:"text-sm font-medium text-fg mb-1",children:"About"}),e.jsx(F,{})]})]})}export{X as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,b as u,ac as g,r as h,bM as b,bC as y,bD as v,bN as S}from"./index-DmAjS0RP.js";import{S as j}from"./settings-screen-BCJFYn9T.js";import"./avatar-0qIqgsXP.js";const N={sm:"min-h-9 px-3 text-xs",md:"min-h-11 px-4 text-sm"};function f({name:l,options:a,value:r,onChange:i,size:c="md","aria-label":m}){const d=a.findIndex(s=>s.value===r);return e.jsx("div",{role:"radiogroup","aria-label":m,className:"inline-flex rounded-md border border-line bg-surface-sunken p-0.5",children:a.map((s,o)=>{const n=s.value===r,t=!n&&o<a.length-1&&d!==o+1;return e.jsxs("label",{className:u("relative flex cursor-pointer items-center justify-center rounded-[5px] font-medium transition-colors",N[c],n?"bg-surface text-fg shadow":"text-fg-muted hover:text-fg",t&&"after:pointer-events-none after:absolute after:right-0 after:top-1/4 after:h-1/2 after:w-px after:bg-line"),children:[e.jsx("input",{type:"radio",name:l,value:s.value,checked:n,onChange:()=>i(s.value),className:"sr-only"}),s.label]},s.value)})})}const x="remit.density";function T(){return typeof localStorage>"u"?"comfortable":localStorage.getItem(x)??"comfortable"}const D=e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Density"})," controls how much information fits on screen. Compact is great on smaller displays; Comfortable gives each item more breathing room."]}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Theme"})," switches between light, dark, and system-preference modes instantly. The change takes effect across the whole app immediately."]}),e.jsx("p",{className:"text-2xs text-fg-subtle",children:"Preferences are stored locally in this browser. Server-side sync is coming soon."})]});function k(){const l=g(),[a,r]=h.useState(!0),[i,c]=h.useState(T),[m,d]=h.useState(b),s=t=>{c(t),typeof localStorage<"u"&&localStorage.setItem(x,t)},o=t=>{d(t),S(t)},n=t=>{const p=v[t];p&&l({to:p})};return e.jsx(j,{items:y,activeId:"appearance",title:"Appearance",description:"Display density and colour theme — instant-apply.",help:D,helpOpen:a,onToggleHelp:()=>r(t=>!t),onSelect:n,onBackToMail:()=>{l({to:"/mail"})},children:e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"Density"}),e.jsx(f,{name:"density","aria-label":"Density",value:i,onChange:s,options:[{value:"comfortable",label:"Comfortable"},{value:"compact",label:"Compact"}]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Controls the spacing of message rows in the mail list."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-fg",children:"Theme"}),e.jsx(f,{name:"theme","aria-label":"Theme",value:m,onChange:o,options:[{value:"system",label:"System"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}]}),e.jsx("p",{className:"text-xs text-fg-subtle",children:"Applies immediately. System default follows your OS preference."})]})]})})}export{k as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ao as y,bO as v,Y as p,ar as d,bP as x,r as m,bQ as N,bR as S}from"./index-DmAjS0RP.js";const o="None",O=e=>e.moveMailboxId!==void 0&&e.moveMailboxId!==o,A=e=>({...e.anchorMessageId?{anchorMessageId:e.anchorMessageId}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:o,actionMailboxId:e.moveMailboxId??o}),F=(e,t,r)=>({name:r,scope:t==="standing"?"Standing":"Temporary",...t==="temporary"&&e.expiresAt?{expiresAt:e.expiresAt}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:o,actionMailboxId:e.moveMailboxId??o,...e.anchorMessageId?{anchorMessageId:e.anchorMessageId}:{}}),b=e=>N({path:{accountId:e}}),D=e=>{const t=y({...v({path:{accountId:e??""}}),enabled:!!e});return{filters:t.data?.items??[],isPending:t.isPending,isError:t.isError,error:t.error,refetch:t.refetch}},I=e=>{const t=p(),r=d({...S(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:b(e)})}}),{mutate:i}=r;return{createFilter:m.useCallback((a,s,l)=>{e&&i({path:{accountId:e},body:F(a,s,l)})},[e,i]),isPending:r.isPending,isSuccess:r.isSuccess,isError:r.isError,error:r.error,reset:r.reset}},E=e=>{const t=p(),r=d({...x(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:b(e)})}}),{mutate:i}=r;return{deleteFilter:m.useCallback(a=>{e&&i({path:{accountId:e,filterId:a}})},[e,i]),isPending:r.isPending,deletingFilterId:r.isPending?r.variables?.path.filterId:void 0}},$=(e,t)=>{if(e.state==="Expired")return"Expired";if(e.scope!=="Temporary"||!e.expiresAt)return"Active";const r=Date.parse(e.expiresAt);return Number.isNaN(r)?"Active":r<=t?"Expired":"Active"},P=e=>{if(!e)return;const t=Date.parse(e);if(!Number.isNaN(t))return new Date(t).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})},L=(e,t=new Date)=>{if(!e)return;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!r)return;const[,i,u,a]=r,s=new Date(Number(i),Number(u)-1,Number(a),23,59,59,0);if(Number.isNaN(s.getTime()))return;const l=-t.getTimezoneOffset(),g=l>=0?"+":"-",c=Math.abs(l),h=String(Math.floor(c/60)).padStart(2,"0"),f=String(c%60).padStart(2,"0"),n=M=>String(M).padStart(2,"0");return`${s.getFullYear()}-${n(s.getMonth()+1)}-${n(s.getDate())}T${n(s.getHours())}:${n(s.getMinutes())}:${n(s.getSeconds())}${g}${h}:${f}`};export{o as N,P as a,A as b,D as c,E as d,$ as f,O as h,L as p,I as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,bS as v,r as j,bT as C,w as S,B as A,g as E,bU as R,ac as k,ao as y,aw as L,bC as P,bD as T,Y as w,ad as _,ar as N,bo as M,bV as D,aH as F,bW as $,bX as Q,i as B,bY as H}from"./index-DmAjS0RP.js";import{S as G}from"./select-BjP4w3Or.js";import{F as K}from"./folder--nZa3AWC.js";import{S as V}from"./settings-screen-BCJFYn9T.js";import{E as O}from"./ErrorState-B7jWTPIf.js";import"./avatar-0qIqgsXP.js";const q=["inbox","drafts","sent","archive","junk","trash"],x="";function z(a){const n=a.messageCount===1?"msg":"msgs";return`${v(a.providerPath)} · ${a.messageCount} ${n}`}function Y({role:a,folders:n,appointedId:r,displayName:i,onAppoint:m,onRename:p}){const[c,d]=j.useState(i),s=n.find(l=>l.mailboxId===r)??null,t=R(a),u=s!=null&&c.trim()!==i.trim();return e.jsxs("div",{className:"flex flex-col gap-1 border-b border-line px-row-inset py-2.5 last:border-b-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"flex w-28 shrink-0 items-center gap-2 text-sm font-medium text-fg",children:[C(a),t]}),e.jsxs(G,{className:"w-56 shrink-0",value:r??x,"aria-label":`Folder for ${t}`,onChange:l=>m(a,l.target.value===x?null:l.target.value),children:[e.jsx("option",{value:x,children:"None"}),n.map(l=>e.jsx("option",{value:l.mailboxId,children:z(l)},l.mailboxId))]}),s&&e.jsxs(e.Fragment,{children:[e.jsx(S,{className:"flex-1",value:c,placeholder:t,"aria-label":`Display name for ${t}`,onChange:l=>d(l.target.value)}),u&&e.jsx(A,{variant:"ghost",size:"sm",className:"shrink-0",icon:e.jsx(E,{className:"size-4"}),"aria-label":"Save display name",onClick:()=>p(s.mailboxId,c)})]})]}),s&&e.jsxs("span",{className:"truncate pl-[7.5rem] text-2xs text-fg-subtle",title:s.providerPath,children:[s.providerPath," · ",s.messageCount," ",s.messageCount===1?"message":"messages"]})]})}function U({accountEmail:a,folders:n,appointments:r,displayNames:i={},onAppoint:m,onRename:p}){const c=new Set(Object.values(r).filter(s=>s!=null)),d=n.filter(s=>!c.has(s.mailboxId));return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("header",{className:"space-y-1",children:[e.jsxs("h2",{className:"text-sm font-semibold text-fg",children:["Folder roles — ",a]}),e.jsx("p",{className:"text-xs text-fg-muted",children:"Each role points to one folder. Pick the folder that holds the mail — the counts help you tell real folders from empty look-alikes. Appointing a folder here removes it from any other role."})]}),e.jsx("div",{className:"rounded-sm border border-line bg-surface",children:q.map(s=>{const t=r[s]??null;return e.jsx(Y,{role:s,folders:n,appointedId:t,displayName:t?i[t]??"":"",onAppoint:m,onRename:p},s)})}),d.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("h3",{className:"text-xs font-medium text-fg-muted",children:"Other folders"}),e.jsx("ul",{className:"rounded-sm border border-line bg-surface",children:d.map(s=>e.jsxs("li",{className:"flex items-center gap-2 border-b border-line px-row-inset py-2 text-sm text-fg last:border-b-0",children:[e.jsx(K,{className:"size-4 shrink-0 text-fg-subtle"}),e.jsx("span",{className:"truncate",children:v(s.providerPath)}),e.jsxs("span",{className:"ml-auto shrink-0 text-2xs text-fg-subtle",children:[s.messageCount," ",s.messageCount===1?"message":"messages"]})]},s.mailboxId))})]})]})}const W=e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:"Each canonical role — Inbox, Drafts, Sent, Archive, Spam, Trash — points at one of your account's real folders. Pick the one that actually holds the mail; the message counts tell real folders from empty look-alikes."}),e.jsx("p",{children:`Appointing a folder to a role here doesn't touch any other role, and doesn't move or rename anything on the server — it just tells Remit which folder to treat as e.g. "Drafts" everywhere (sidebar, unread badges, the compose flow).`}),e.jsxs("p",{children:[e.jsx("strong",{className:"text-fg",children:"Display name"})," renames the appointed folder for the sidebar. Leave it blank to use the role's canonical name."]})]});function X({account:a}){const n=w(),r=a.accountId,{data:i,isPending:m,isError:p,error:c,refetch:d}=y(_({path:{accountId:r}})),s=N({...D(),onSuccess:()=>{n.invalidateQueries({queryKey:M()})}}),t=N({...$(),onSuccess:()=>{n.invalidateQueries({queryKey:F({path:{accountId:r}})})}}),u=(o,h)=>{s.mutate({path:{accountId:r,role:H[o]},body:{mailboxId:h}})},l=(o,h)=>{const g=h.trim();t.mutate({path:{accountId:r,mailboxId:o},body:{displayNameOverride:g===""?null:g}})};if(m)return e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":`Loading folders for ${a.email}`});if(p)return e.jsx(O,{variant:"inline",title:`Couldn't load folders for ${a.email}`,error:c,onRetry:()=>{d()}});const I=i.items.map(o=>({mailboxId:o.mailboxId,providerPath:o.fullPath,messageCount:o.messageCount})),f={};for(const o of a.folderAppointments){const h=Q[o.role];h&&(f[h]=o.mailboxId??null)}const b={};for(const o of i.items)o.displayNameOverride&&(b[o.mailboxId]=o.displayNameOverride);return e.jsxs("div",{className:"space-y-2",children:[(s.isError||t.isError)&&e.jsx(B,{tone:"danger",variant:"soft",children:"Couldn't save that change. Please try again."}),e.jsx(U,{accountEmail:a.email,folders:I,appointments:f,displayNames:b,onAppoint:u,onRename:l})]})}function oe(){const a=k(),[n,r]=j.useState(!0),{data:i,isPending:m,isError:p,error:c,refetch:d}=y(L()),s=t=>{const u=T[t];u&&a({to:u})};return e.jsx(V,{items:P,activeId:"folders",title:"Folder roles",description:"Appoint which real folder fills each canonical role, per account.",help:W,helpOpen:n,onToggleHelp:()=>r(t=>!t),onSelect:s,onBackToMail:()=>{a({to:"/mail"})},children:m?e.jsx("div",{className:"h-24 animate-pulse rounded-sm border border-line bg-surface","aria-busy":"true","aria-label":"Loading accounts"}):p?e.jsx(O,{title:"Couldn't load accounts",error:c,onRetry:()=>{d()}}):i.accounts.length===0?e.jsx("p",{className:"py-12 text-sm text-fg-muted",children:"No accounts configured."}):e.jsx("div",{className:"space-y-8",children:i.accounts.map(t=>e.jsx(X,{account:t},t.accountId))})})}export{oe as component};
|
package/assets/index-DhjmWYCG.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,bp as o}from"./index-DmAjS0RP.js";const n=()=>t.jsx(o,{to:"/settings/accounts"});export{n as component};
|