@remit/web-client-dist 0.0.310 → 0.0.312

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.
Files changed (98) hide show
  1. package/assets/BriefPane-CyCnqfV1.js +1 -0
  2. package/assets/{ErrorState-DiX_zNTK.js → ErrorState-CN4Cwb5A.js} +1 -1
  3. package/assets/FlaggedPane-MgcE5bKj.js +1 -0
  4. package/assets/MailListHeader-DX7_Cewa.js +52 -0
  5. package/assets/MailViewChrome-9cKXCycT.js +1 -0
  6. package/assets/MailboxPane-Db0hba1S.js +1 -0
  7. package/assets/NavMenuButton-3t-xq8p6.js +1 -0
  8. package/assets/{OnboardingWizard-r-N3eGPg.js → OnboardingWizard-BFkNhodP.js} +1 -1
  9. package/assets/OutboxPane-O18gKLgX.js +1 -0
  10. package/assets/_mailboxId-DbcIOfsr.js +1 -0
  11. package/assets/{account-form-helpers-BHUowns0.js → account-form-helpers-D3tfbITU.js} +1 -1
  12. package/assets/accounts-J2omBETN.js +1 -0
  13. package/assets/advanced-Cb-Yw4fX.js +1 -0
  14. package/assets/appearance-BXwFGVL1.js +1 -0
  15. package/assets/avatar-DTwl3jb1.js +1 -0
  16. package/assets/bottom-sheet-Bw79dNtH.js +1 -0
  17. package/assets/brief-Cj9RHZn4.js +1 -0
  18. package/assets/brief-CrERI6Q7.js +1 -0
  19. package/assets/browser-ponyfill-Dfl9dHmO.js +2 -0
  20. package/assets/circle-check-DizPpF0Y.js +1 -0
  21. package/assets/circle-check-big-ChA18R4j.js +1 -0
  22. package/assets/circle-help-DPkDkgdF.js +1 -0
  23. package/assets/clock-uuvA1em-.js +1 -0
  24. package/assets/confirm-dialog-BTyZAw5R.js +1 -0
  25. package/assets/conversation-target-B0jE-e47.js +1 -0
  26. package/assets/{download-Bg6cLSAV.js → download-B3EpkLuL.js} +1 -1
  27. package/assets/enums-CCxx0t2v.js +1 -0
  28. package/assets/filters-Dk1yDjyQ.js +1 -0
  29. package/assets/{flagged-CuV2oZw_.js → flagged-CHfuc_hl.js} +1 -1
  30. package/assets/flagged-CZrDrTDc.js +1 -0
  31. package/assets/folders-B8orXsv8.js +1 -0
  32. package/assets/{format-CKZmh-Ru.js → format-De9HZKjg.js} +1 -1
  33. package/assets/index-BHkaa_C4.js +1 -0
  34. package/assets/index-CdMOAANs.js +1 -0
  35. package/assets/index-DDXDeP1_.js +1 -0
  36. package/assets/index-DjZFLwif.js +294 -0
  37. package/assets/index-O_DYWmDx.js +1 -0
  38. package/assets/index-lDYTJ6Ao.js +1 -0
  39. package/assets/intelligence-pref-C6lFpj6U.js +1 -0
  40. package/assets/{kbd-C00o9L4B.js → kbd-C0TyJDqO.js} +1 -1
  41. package/assets/labels-BzM1g0fg.js +1 -0
  42. package/assets/mail-oqxsK0QY.js +1 -0
  43. package/assets/menu-Cpsp0ZMZ.js +1 -0
  44. package/assets/move-options-CdaX2x7F.js +1 -0
  45. package/assets/onboarding-BAPCDoFw.js +1 -0
  46. package/assets/outbox-DQtIjp3h.js +1 -0
  47. package/assets/outbox-status-CPfNHfUQ.js +1 -0
  48. package/assets/pencil-Cm8cWZKn.js +1 -0
  49. package/assets/{rich-text-CoTs3nIc.js → rich-text-CGn1MSzM.js} +2 -2
  50. package/assets/rotate-ccw-oQ2bjkRm.js +1 -0
  51. package/assets/row-actions-CN3rJN24.js +1 -0
  52. package/assets/search-query-Cr_ZXBCp.js +1 -0
  53. package/assets/search-scope-CFN-gjTv.js +1 -0
  54. package/assets/search-token-index-CxMDhXuP.js +1 -0
  55. package/assets/search-view-ClRhrhjK.js +1 -0
  56. package/assets/senders-C-f6yU99.js +1 -0
  57. package/assets/settings-BbNYlJXs.js +1 -0
  58. package/assets/settings-screen-DBHgQU-S.js +1 -0
  59. package/assets/shield-check-BG5lmiwu.js +1 -0
  60. package/assets/{suggested-vips-BQoY6-Yl.js → suggested-vips-D0nhcuze.js} +1 -1
  61. package/assets/{useDebouncedValue-Ck8McJvG.js → useDebouncedValue-BFCY668u.js} +1 -1
  62. package/assets/useFilters-CxQU6LTN.js +1 -0
  63. package/assets/useLabels-DdQPlRo8.js +1 -0
  64. package/assets/useMediaQuery-fUhUpE77.js +1 -0
  65. package/assets/useRefreshControl-BsKYVbfM.js +1 -0
  66. package/assets/useSearchMirror-HHNbELBF.js +1 -0
  67. package/assets/useSearchTokenContext-D5dvdLSW.js +67 -0
  68. package/assets/useSignature-C6SBu3ql.js +1 -0
  69. package/index.html +1 -1
  70. package/package.json +1 -1
  71. package/assets/_mailboxId-DtqBFgK5.js +0 -1
  72. package/assets/accounts-B4-7wVt4.js +0 -1
  73. package/assets/advanced-Dlyjnb6l.js +0 -1
  74. package/assets/appearance-Drfetqy5.js +0 -1
  75. package/assets/avatar-Ci3CMhdo.js +0 -1
  76. package/assets/browser-ponyfill-BhnZT7aq.js +0 -2
  77. package/assets/circle-check-BM6iE_RP.js +0 -1
  78. package/assets/confirm-dialog-F7nDmx5t.js +0 -1
  79. package/assets/filters-CsWlycJW.js +0 -1
  80. package/assets/flagged-DtqBFgK5.js +0 -1
  81. package/assets/folders-Dg7RilCS.js +0 -1
  82. package/assets/index-BSJKHoKS.js +0 -1
  83. package/assets/index-DtqBFgK5.js +0 -1
  84. package/assets/index-dsr8I39S.js +0 -1
  85. package/assets/index-xOALrEh8.js +0 -294
  86. package/assets/labels-pEUVx_Ue.js +0 -1
  87. package/assets/mail-Chm12_Xz.js +0 -118
  88. package/assets/move-options-B2c-WWEl.js +0 -1
  89. package/assets/onboarding-DKy8Q5MV.js +0 -1
  90. package/assets/outbox-DtqBFgK5.js +0 -1
  91. package/assets/pencil-CZK87pI9.js +0 -1
  92. package/assets/senders-p6LBrcYb.js +0 -1
  93. package/assets/settings-C2TANSwS.js +0 -1
  94. package/assets/settings-screen-C7xmJsXG.js +0 -1
  95. package/assets/shield-check-CdES_QdC.js +0 -1
  96. package/assets/useFilters-DMt8Gx-P.js +0 -1
  97. package/assets/useLabels-oSXOt6KZ.js +0 -1
  98. package/assets/useSignature-BQN3IL24.js +0 -1
@@ -1 +0,0 @@
1
- import{af as E,aK as S,av as I,aN as L,aC as _,cW as D,r as b,bb as x,aH as A,aw as T,cX as p,aI as k}from"./index-xOALrEh8.js";const w={synced:"synced",failed:"failed"},W={uncategorized:"uncategorized",personal:"personal",newsletter:"newsletter",marketing:"marketing",automated:"automated",transactional:"transactional",social:"social"},Z={Lookalike:"Lookalike",Unrelated:"Unrelated"},j={MoveToInbox:"MoveToInbox",MoveToJunk:"MoveToJunk"},ee={Attachment:"attachment"},N=3e4,F=1e3,R="The folder couldn't be created on the mail server. Please try again.",$="The folder was created but the mail server hasn't confirmed it yet, so nothing was attached to it. It's in your folder list — try again in a moment.",B=(e,t)=>new Promise((a,o)=>{if(t?.aborted){o(t.reason);return}const n=setTimeout(()=>{t?.removeEventListener("abort",i),a()},e),i=()=>{clearTimeout(n),o(t?.reason)};t?.addEventListener("abort",i,{once:!0})});async function X({fetchMailboxes:e,mailboxId:t,signal:a,timeoutMs:o=N,pollIntervalMs:n=F,delay:i=B,now:l=Date.now}){const s=l()+o;for(;;){a?.throwIfAborted();const c=(await e()).find(u=>u.mailboxId===t);if(c?.syncStatus===w.synced)return c;if(c?.syncStatus===w.failed)throw new Error(R);if(l()>=s)throw new Error($);await i(n,a)}}function C(e,t){const a=e.trim();return t?`${t.fullPath}${t.hierarchyDelimiter}${a}`:a}const P=(e,t)=>{const a=e.split(t);return a[0]?.toLowerCase()==="inbox"&&(a[0]="INBOX"),a.join(t)};function Y({name:e,delimiter:t,parent:a,existingPaths:o}){const n=e.trim();if(n==="")return"Enter a folder name.";if(n.includes(t))return`A folder name can't contain "${t}".`;const i=P(C(n,a),t);if(o.some(s=>P(s,t)===i))return"A folder with that name already exists."}function te(e){const t=E(),{data:a}=S({...I({path:{accountId:e??""}}),enabled:!!e}),o=L({...D(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:_({path:{accountId:e}})})}}),n=b.useRef(new Map),i=b.useCallback(async(s,r,c)=>{if(!e)throw new Error("No account to create the folder in. Pick messages from a single account first.");const u=a?.items??[],d=r?u.find(h=>h.fullPath===r):void 0;if(r&&!d)throw new Error(`Couldn't find the folder "${r}" to create this one inside.`);const y=d?{fullPath:d.fullPath,hierarchyDelimiter:d.hierarchyDelimiter}:void 0,f=C(s,y);let m=n.current.get(f);if(!m){const h=y?.hierarchyDelimiter??u[0]?.hierarchyDelimiter??"/",v=Y({name:s,delimiter:h,parent:y,existingPaths:u.map(O=>O.fullPath)});if(v)throw new Error(v);m=(await o.mutateAsync({path:{accountId:e},body:{fullPath:f,namespaceType:"personal"}})).mailboxId,n.current.set(f,m)}const M=await X({mailboxId:m,signal:c,fetchMailboxes:async()=>(await t.fetchQuery({...I({path:{accountId:e}}),staleTime:0})).items??[]});return n.current.delete(f),{id:M.mailboxId,label:x(M.fullPath),path:M.fullPath}},[o,e,a,t]);return{createFolder:b.useCallback((s,r)=>i(s,"",r),[i]),createFolderIn:i,mutation:o}}const ae=()=>{const{t:e}=A("mail",{useSuspense:!1});return b.useCallback((t,a)=>e(t,{defaultValue:a}),[e])},oe=100,z=e=>e.trim().toLowerCase()==="inbox",Q=(e,t)=>{const a=`${e.fullPath}${e.hierarchyDelimiter}`;return t.some(o=>o.mailboxId!==e.mailboxId&&o.fullPath.startsWith(a))},U=(e,t)=>t.find(a=>a.mailboxId!=null&&a.mailboxId===e)?.role;function ne(e,t,a){if(z(e.fullPath))return{deletable:!1,reason:"inbox",message:"The inbox can't be deleted."};const o=U(e.mailboxId,a);return o?{deletable:!1,reason:"role",message:`This folder is your ${o} folder. Reassign that role before deleting it.`}:Q(e,t)?{deletable:!1,reason:"children",message:"This folder has subfolders. Delete them first."}:{deletable:!0}}function K(e,t){return e.filter(a=>a.mailboxId!==t)}function ie(e){return{total:e,moved:0,phase:e===0?"moved":"moving"}}function re(e,t){if(e.phase!=="moving")return e;const a=Math.min(e.total,e.moved+Math.max(0,t));return{...e,moved:a,phase:a>=e.total?"moved":"moving"}}function se(e,t){return{...e,phase:"failed",error:t}}function le(e){return`Moved ${e.moved} of ${e.total}`}function ce(e){return e>0?"choose-fate":"confirm-empty"}const V=new Set(["outbox","postvak uit","boîte d'envoi","postausgang","buzón de salida","posta in uscita","送信トレイ","送件匣","发件箱","skrzynka nadawcza"]),q=e=>{const t=x(e.fullPath).trim().toLowerCase();return V.has(t)},g=p.length,G=(e,t)=>{const a=T(t);return[...e.filter(n=>{const i=a.get(n.mailboxId);return i==="drafts"||i==="sent"?!1:!q(n)})].sort((n,i)=>{const l=a.has(n.mailboxId)?p.indexOf(a.get(n.mailboxId)??"inbox"):g,s=a.has(i.mailboxId)?p.indexOf(a.get(i.mailboxId)??"inbox"):g;return l!==s?l-s:x(n.fullPath).localeCompare(x(i.fullPath),void 0,{sensitivity:"base",numeric:!0})})},ue=e=>e[0]?.hierarchyDelimiter??"/",de=({mailboxes:e,folderAppointments:t,currentMailboxId:a,excludeMailboxId:o,translator:n})=>{const i=G(e,t),l=T(t);return(o?K(i,o):i).map(r=>({id:r.mailboxId,label:k(r,l.get(r.mailboxId),n),path:r.fullPath,isCurrent:r.mailboxId===a}))};export{ee as C,Z as D,W as M,j as P,te as a,de as b,ie as c,se as d,re as e,ue as f,oe as g,ne as h,ce as i,le as m,ae as u};
@@ -1 +0,0 @@
1
- import{c3 as t,aB as r,af as a,r as i,j as s}from"./index-xOALrEh8.js";import{O as c}from"./OnboardingWizard-r-N3eGPg.js";import"./kbd-C00o9L4B.js";import"./account-form-helpers-BHUowns0.js";async function l(e){e.recordCompleted(),await e.queryClient.refetchQueries({queryKey:t()}),e.navigateToInbox()}function y(){const e=r(),o=a(),n=i.useCallback(m=>{l({queryClient:o,recordCompleted:()=>e.recordEvent("onboarding.completed"),navigateToInbox:()=>{window.location.assign("/mail")}})},[e,o]);return s.jsx(c,{skipWelcome:!1,onComplete:n})}export{y as component};
@@ -1 +0,0 @@
1
- const n=()=>null;export{n as component};
@@ -1 +0,0 @@
1
- import{a}from"./index-xOALrEh8.js";const c=a("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);export{c as P};
@@ -1 +0,0 @@
1
- import{j as e,d as N,au as z,r as c,cn as L,cc as O,w as $,cp as q,aK as I,d2 as A,af as k,aN as C,d3 as M,bd as P,B as S,S as R,aR as B,X as G}from"./index-xOALrEh8.js";import{K as m}from"./kbd-C00o9L4B.js";import{S as K,a as E}from"./settings-screen-C7xmJsXG.js";import{E as V}from"./ErrorState-DiX_zNTK.js";import{u as Q}from"./useDebouncedValue-Ck8McJvG.js";import{d as _}from"./format-CKZmh-Ru.js";import"./avatar-Ci3CMhdo.js";function D({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"},F=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(A()),g=k(),i=C({...P(),onSettled:()=>{g.invalidateQueries({queryKey:M()})}}),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(R,{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=Q(r.trim(),300),d=k(),[y,g]=c.useState(null),i=a.length>=2,l=B({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&&_(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(G,{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=q[s];o&&t({to:o})};return e.jsx(K,{items:L,activeId:"senders",title:"Senders & Rules",description:"Per-sender preferences — set with one key from any message, managed here.",flush:!0,help:F,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(D,{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($,{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};
@@ -1 +0,0 @@
1
- import{j as t,c2 as o}from"./index-xOALrEh8.js";const n=()=>t.jsx(o,{});export{n as component};
@@ -1 +0,0 @@
1
- import{a as z,r as j,j as e,d as f,B as i,X as N,e as S}from"./index-xOALrEh8.js";import{M as B,C as v,A as w}from"./avatar-Ci3CMhdo.js";const h=z("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);function L({items:l,activeId:t,title:c,description:n,children:r,help:s,helpOpen:d=!0,flush:o,onSelect:k,onToggleHelp:u,onBackToMail:m}){const[y,x]=j.useState(!1),[b,C]=j.useState(!1),g=!!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),x(!1)},className:f("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:f("shrink-0",a.id===t?"text-accent-2":"text-fg-subtle"),children:a.icon}),a.label]},a.id))})]});return e.jsxs("div",{className:"safe-area-frame 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:m,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(h,{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:()=>x(!1)}),e.jsxs("aside",{className:"safe-area-frame 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:()=>{m?.(),x(!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(h,{className:"size-4 text-fg-subtle"}),"Back to mail"]}),e.jsx(i,{variant:"ghost",size:"sm",icon:e.jsx(N,{className:"size-4"}),onClick:()=>x(!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:[m&&e.jsx(i,{variant:"ghost",size:"sm",icon:e.jsx(h,{className:"size-4"}),className:"-ml-1 lg:hidden",onClick:m,"aria-label":"Back to mail"}),e.jsx(i,{variant:"ghost",size:"sm",icon:e.jsx(B,{className:"size-4"}),className:"lg:hidden",onClick:()=>x(!0),"aria-label":"Open settings menu"}),e.jsx("h1",{className:"text-md font-semibold text-fg",children:c}),n&&e.jsx("p",{className:"hidden min-w-0 truncate text-xs text-fg-subtle lg:block",children:n}),s&&e.jsx(i,{variant:"ghost",size:"sm",icon:e.jsx(v,{className:"size-4"}),className:"ml-auto lg:hidden",onClick:()=>C(a=>!a),"aria-label":"Tips","aria-expanded":b}),s&&!g&&e.jsx(i,{variant:"ghost",size:"sm",icon:e.jsx(v,{className:"size-4"}),className:"hidden ml-auto lg:inline-flex",onClick:u,"aria-label":"Show tips"})]}),s&&b&&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})})})]}),g&&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(i,{variant:"ghost",size:"sm",icon:e.jsx(N,{className:"size-3.5"}),onClick:u,"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:c,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:f(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:[c,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:c,syncLabel:n,state:r,errorDetail:s,trailing:d}){const o=O[r];return e.jsxs("div",{className:f("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," · ",c," · ",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 +0,0 @@
1
- import{a as e}from"./index-xOALrEh8.js";const c=e("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);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"}]]);const o=e("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);export{c as C,t as R,o as S};
@@ -1 +0,0 @@
1
- import{r as c,j as M,d as I,aN as y,cG as F,aK as E,cH as z,bC as _,cI as k,cJ as R,af as D,cK as Y,cL as $,cM as j}from"./index-xOALrEh8.js";const J=320,H="cubic-bezier(0.32, 0.9, 0.3, 1)",K=.5,U=.4,B=360;function Q(e){return Math.sign(e)*Math.sqrt(Math.abs(e))*4}function ue({open:e,onClose:t,children:r,dismissLabel:s="Dismiss"}){const i=c.useRef(null),[n,a]=c.useState(B),[l,m]=c.useState(null);c.useLayoutEffect(()=>{const o=i.current;if(!o)return;const p=()=>a(o.offsetHeight);p();const v=new ResizeObserver(p);return v.observe(o),()=>v.disconnect()},[]);const u=c.useRef(null),f=c.useCallback(o=>{o.currentTarget.setPointerCapture(o.pointerId),u.current={startY:o.clientY,lastY:o.clientY,lastT:o.timeStamp,velocity:0,moved:!1},m(0)},[]),b=c.useCallback(o=>{const p=u.current;if(!p)return;const v=o.timeStamp-p.lastT;v>0&&(p.velocity=(o.clientY-p.lastY)/v),p.lastY=o.clientY,p.lastT=o.timeStamp;const S=o.clientY-p.startY;Math.abs(S)>4&&(p.moved=!0);const T=S<0?Q(S):S;m(T)},[]),d=c.useCallback(()=>{const o=u.current;if(u.current=null,!o)return;const p=o.lastY-o.startY,S=o.velocity>K||p>n*U;m(null),S&&t()},[n,t]),h=l!==null,g=e?l??0:n,C=Math.min(Math.max(1-g/n,0),1),O=h?"none":`transform ${J}ms ${H}`;return M.jsxs("div",{className:I("absolute inset-0 z-40 select-none overflow-hidden",e||h?"":"pointer-events-none"),children:[M.jsx("button",{type:"button","aria-label":s,tabIndex:-1,onClick:t,className:I("absolute inset-0 bg-black/40",C>0?"pointer-events-auto":"pointer-events-none"),style:{opacity:C*.6,transition:O.replace("transform","opacity")}}),M.jsxs("div",{ref:i,className:"absolute inset-x-0 bottom-0 flex max-h-[92%] flex-col rounded-t-3xl border-t border-line bg-surface pb-[env(safe-area-inset-bottom,0px)] shadow-2xl shadow-black/30",style:{transform:`translateY(${g}px)`,transition:O},children:[M.jsx("div",{role:"slider","aria-label":"Drag down to dismiss","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(C*100),tabIndex:0,onPointerDown:f,onPointerMove:b,onPointerUp:d,onPointerCancel:d,className:"flex cursor-grab touch-none justify-center pb-1 pt-2.5 active:cursor-grabbing",children:M.jsx("div",{className:"h-1 w-10 rounded-full bg-fg-subtle/40"})}),M.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:r})]})]})}const W=1024,q=`(min-width: ${W}px) and (not ((orientation: portrait) and (pointer: coarse)))`,G=e=>{const[t,r]=c.useState(()=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches);return c.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const s=window.matchMedia(e),i=n=>r(n.matches);return r(s.matches),s.addEventListener("change",i),()=>s.removeEventListener("change",i)},[e]),t},de=()=>G(q),me=(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"},fe=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"})},N=(e,t=new Date)=>{if(!e)return;const r=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!r)return;const[,s,i,n]=r,a=new Date(Number(s),Number(i)-1,Number(n),23,59,59,0);if(Number.isNaN(a.getTime()))return;const l=-t.getTimezoneOffset(),m=l>=0?"+":"-",u=Math.abs(l),f=String(Math.floor(u/60)).padStart(2,"0"),b=String(u%60).padStart(2,"0"),d=h=>String(h).padStart(2,"0");return`${a.getFullYear()}-${d(a.getMonth()+1)}-${d(a.getDate())}T${d(a.getHours())}:${d(a.getMinutes())}:${d(a.getSeconds())}${m}${f}:${b}`},x="None",pe=e=>!e.literalClauses.some(t=>t.field==="HasWords"),P=e=>({...e.anchorMessageId?{anchorMessageId:e.anchorMessageId}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??x,actionMailboxId:e.moveMailboxId??x}),he=({mode:e,ruleScope:t})=>t==="standing"?"standing":t==="until"?"temporary":e==="selected"?"just-these":"all-like-these",ge=({mode:e,ruleScope:t,anchorMessageId:r,clauses:s,matchOperator:i,moveMailboxId:n,until:a})=>({...e==="similar"&&r?{anchorMessageId:r}:{},matchOperator:i==="all"?"And":"Or",literalClauses:s.map(l=>({field:l.field,value:l.value})),moveMailboxId:n,expiresAt:t==="until"?N(a??""):void 0}),w=(e,t,r)=>({name:r,scope:t==="standing"?"Standing":"Temporary",...t==="temporary"&&e.expiresAt?{expiresAt:e.expiresAt}:{},matchOperator:e.matchOperator,literalClauses:e.literalClauses,actionLabelId:e.labelId??x,actionMailboxId:e.moveMailboxId??x,...e.anchorMessageId?{anchorMessageId:e.anchorMessageId}:{}}),V=new Set(["Complete","Failed"]),A=e=>e!==void 0&&V.has(e),X=1e3,Z=15e3,ee=e=>{const t=Math.max(0,e),r=X*2**t;return Math.min(r,Z)},te=(e,t,r)=>{if(e)return{kind:r?"restartFailed":"startFailed",error:e};if(t)return{kind:"statusUnreadable",error:t}},be=e=>{const[t,r]=c.useState(),s=y({...F(),onSuccess:g=>r(g.organizeJobId)}),{mutate:i}=s,n=E({...z({path:{accountId:e??"",organizeJobId:t??""}}),enabled:!!e&&!!t,refetchInterval:g=>{const C=g.state.data?.state;return A(C)?!1:ee(g.state.dataUpdateCount)}}),a=c.useCallback(g=>{e&&i({path:{accountId:e},body:P(g)})},[e,i]),{refetch:l}=n,m=c.useCallback(()=>{l()},[l]),u=n.data,f=s.isPending?void 0:u,b=f?.state??s.data?.state,d=A(f?.state),h={state:b,matchedCount:f?.matchedCount??0,appliedCount:f?.appliedCount??0,failedCount:f?.failedCount??0,errorMessage:f?.errorMessage??""};return{start:a,refreshStatus:m,progress:h,isStarting:s.isPending,isRunning:!!t&&!d,isDone:d,failure:te(s.error,n.error,!!u)}},ve=["From","Subject","HasWords","ListId","FromDomain"],re=e=>{const t=e.trim(),r=t.match(/<([^>]+)>/);return(r?r[1]:t).trim().toLowerCase()},Se=(e,t)=>e==="ListId"?re(t):t.trim(),se=e=>e==="all"?"And":"Or",ne=(e,t)=>{const r=e.widen!==void 0&&!e.widen.inactive,s=e.clauses.map(i=>({field:i.field,value:i.value}));return{...r&&t?{anchorMessageId:t}:{},matchOperator:se(e.matchOperator),literalClauses:s}},ae=e=>e.anchorMessageId!==void 0||!e.literalClauses.some(t=>t.field==="HasWords"),ie=e=>JSON.stringify({anchor:e.anchorMessageId??null,operator:e.matchOperator,clauses:e.literalClauses.map(t=>`${t.field} ${t.value}`)}),Me=(e,t)=>{const r=ne(e,t);return{...r.anchorMessageId?{anchorMessageId:r.anchorMessageId}:{},matchOperator:r.matchOperator,literalClauses:r.literalClauses,moveMailboxId:e.moveMailboxId,labelId:e.labelId,expiresAt:e.scope==="until"?N(e.until??""):void 0}},oe=(e,t)=>e.error!==void 0&&e.errorSignature===t?{status:"error",reason:e.error}:e.count===void 0?{status:"loading"}:e.previewedSignature===t?{status:"ready",count:e.count}:{status:"ready",count:e.count,stale:!0},ce=350,Ce=(e,t,r)=>{const s=y(_()),{mutateAsync:i}=s,n=ie(t),[a,l]=c.useState(()=>({})),m=c.useRef(t);m.current=t;const u=c.useRef(n),f=ae(t);return c.useEffect(()=>{if(!e||!f||n===a.previewedSignature||n===a.errorSignature)return;const b=setTimeout(()=>{const d=n;u.current=d,i({path:{accountId:e},body:P({...m.current})}).then(h=>{u.current===d&&l({count:h.matchedCount,matchedIds:h.messageIds,previewedSignature:d})}).catch(h=>{u.current===d&&l(g=>({...g,error:h instanceof Error?h.message:"Couldn't count matches.",errorSignature:d}))})},ce);return()=>clearTimeout(b)},[e,f,n,a.previewedSignature,a.errorSignature,i]),f?{count:oe(a,n),matchedIds:a.previewedSignature===n?a.matchedIds??[]:[]}:{count:{status:"error",reason:k},matchedIds:[]}},L=e=>$({path:{accountId:e}}),xe=e=>{const t=E({...R({path:{accountId:e??""}}),enabled:!!e});return{filters:t.data?.items??[],isPending:t.isPending,isError:t.isError,error:t.error,refetch:t.refetch}},ye=e=>{const t=D(),r=y({...j(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:L(e)})}}),{mutate:s,mutateAsync:i}=r,n=c.useCallback((l,m,u)=>{e&&s({path:{accountId:e},body:w(l,m,u)})},[e,s]),a=c.useCallback(async(l,m,u)=>e?i({path:{accountId:e},body:w(l,m,u)}).then(()=>!0,()=>!1):!1,[e,i]);return{createFilter:n,createFilterAsync:a,isPending:r.isPending,isSuccess:r.isSuccess,isError:r.isError,error:r.error,reset:r.reset}},Oe=e=>{const t=D(),r=y({...Y(),onSuccess:()=>{e&&t.invalidateQueries({queryKey:L(e)})}}),{mutate:s}=r;return{deleteFilter:c.useCallback(n=>{e&&s({path:{accountId:e,filterId:n}})},[e,s]),isPending:r.isPending,deletingFilterId:r.isPending?r.variables?.path.filterId:void 0}};export{ue as B,q as D,x as N,ve as S,G as a,P as b,Ce as c,be as d,ye as e,ge as f,pe as g,L as h,Me as i,me as j,fe as k,xe as l,Oe as m,Se as n,he as o,N as p,ne as r,de as u};
@@ -1 +0,0 @@
1
- import{aK as d,cZ as L,af as n,aN as l,c_ as p,r as o,c$ as y,d0 as c,d1 as g}from"./index-xOALrEh8.js";const u=e=>y({path:{accountId:e}}),P=e=>{const a=d({...L({path:{accountId:e??""}}),enabled:!!e});return{labels:a.data?.items??[],isPending:a.isPending,isError:a.isError,error:a.error,refetch:a.refetch}},m=e=>{const a=n(),t=l({...p(),onSuccess:()=>{e&&a.invalidateQueries({queryKey:u(e)})}}),{mutateAsync:r}=t;return{createLabel:o.useCallback((s,i="Default")=>e?r({path:{accountId:e},body:{name:s,color:i}}):Promise.reject(new Error("No account")),[e,r]),isPending:t.isPending,isError:t.isError,error:t.error,reset:t.reset}},h=e=>{const a=n(),t=l({...c(),onSuccess:()=>{e&&a.invalidateQueries({queryKey:u(e)})}}),{mutate:r}=t;return{updateLabel:o.useCallback((s,i)=>{e&&r({path:{accountId:e,labelId:s},body:i})},[e,r]),isPending:t.isPending,updatingLabelId:t.isPending?t.variables?.path.labelId:void 0}},C=e=>{const a=n(),t=l({...g(),onSuccess:()=>{e&&a.invalidateQueries({queryKey:u(e)})}}),{mutate:r}=t;return{deleteLabel:o.useCallback(s=>{e&&r({path:{accountId:e,labelId:s}})},[e,r]),isPending:t.isPending,deletingLabelId:t.isPending?t.variables?.path.labelId:void 0}};export{m as a,h as b,C as c,P as u};
@@ -1 +0,0 @@
1
- import{r as y,j as i,B as u,d as m,L as p,af as x,aT as C,aK as h,aS as j,aN as L,aY as k,c3 as T,c8 as E}from"./index-xOALrEh8.js";const b=()=>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?b():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?b():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?b():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:""},N=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(t=>t.accountId===s);return e?{html:e.signatureHtml??"",plainText:e.signaturePlainText??""}:c},[s,r]),a=L({...E(),onSuccess:()=>{n.invalidateQueries({queryKey:T()})},onError:e=>{l(k("Couldn't save signature","The signature wasn't saved.",e))}}),g=y.useCallback((e,t)=>{s&&a.mutate({path:{accountId:s},body:{signatureHtml:e,signaturePlainText:t}})},[s,a]);return{signature:o,setSignature:g,isSaving:a.isPending}};export{S as R,N as u};