PageSourceSearch

https://app.fyxer.com/assets/ActionsWorkspace-hhnkHZt8.js

js fyxer.com collected 2026-10-03 23:49:10 UTC 95,731 bytes, 7 lines download raw bytes

1import{r as h,j as e,L as Hn}from"./vendor-react-Bq0AAjM7.js";import{I as w,l as j,bM as js,bN as Un,bO as vs,J as G,cq as X,$ as Wn,a0 as Kn,a3 as Gn,fp as Xn,fq as Vn,bu as Yn,ab as xt,a2 as qn,aJ as st,fe as Qn,ea as Jn,ax as be,e as Zn,E as ie,z as pt,dI as fe,bK as er,ai as tr,ct as sr,aj as nr,C as rr,cB as ar,aN as B,aO as H,aP as U,aQ as W,aR as K,b2 as Ns,hy as Jt,hz as or,an as ir,hA as ks,cu as lr,hB as cr,c1 as Zt,c2 as es,d1 as nt,aV as dr,aW as ur,aX as mr,aY as hr,aZ as br,a_ as xr,a$ as pr,d5 as fr,hC as gr,aM as yr,aL as jr,dB as ws,bz as ts,aS as me,d_ as Es,gX as vr}from"./main-D49UUfSD.js";import{E as Nr}from"./ErrorBoundary-ilVjDrsx.js";import{g as kr,a as wr,t as Er,f as ft,u as Is,b as Ir,c as Sr,d as Cr,e as Rr,h as Tr,A as Dr,i as Ar,R as _r,L as pe,j as rt}from"./WebHub-vJVxubae.js";import{R as L,n as Ss,o as Ae,p as ye,q as Or,r as Cs,d as $e,f as Fe,s as Lr,g as Mr,t as Pr,j as zr,v as $r,w as ss,b as Fr,h as Br}from"./WebHubTourProvider-BIOFdQl4.js";import{t as P,s as Be,x as Hr,v as Ur,X as ct,c4 as Wr,bZ as Kr,o as gt,a5 as Gr,a3 as Rs,b$ as Xr}from"./vendor-misc-DMccS2Mw.js";import{P as le,a as je,b as ve}from"./popover-4HcJ00FV.js";import{D as Pe}from"./dropdownClassNames-Dga6WU27.js";import{T as Ts}from"./textarea-Csiq-Gmc.js";import{D as Ds}from"./DayPickerCalendar-DaVNY0Ht.js";import{c as Vr,i as Yr,a as qr,d as Qr,e as Jr}from"./inboxThreadGrouping-B_NLmvs1.js";import{d as Zr}from"./utils-BRCZESoD.js";import{s as ea}from"./stripHtml-D5Ih8A3w.js";import{u as ta}from"./radarSourceCalendarEvent-DDPacrb-.js";import{g as sa}from"./avatarStyle-Bfvt7XCu.js";import{d as na,l as yt,a as ra}from"./ThreadEmailBody-CTynW_Qw.js";import{c as As,S as aa,M as oa,o as at}from"./EmailAttachments-Cu1UzU20.js";import{s as _s}from"./splitQuotedReply-CL_z_qIA.js";import{g as ia}from"./InboxSearch-D2zc1csV.js";import{s as Os,d as Ls}from"./splitIntoRuns-yMTu_WIW.js";import{f as la}from"./formatMilliseconds-DYnuwbCa.js";import{a as ca}from"./getRadarMeetingNotesPath-CwLWEHrK.js";import{i as da}from"./navigation-DEc9nuPi.js";import{S as Ms,a as Ps,b as zs}from"./search-bar-CQkSk4Df.js";import{u as ua}from"./useCallRecordings-fhI5azc0.js";import{P as _e}from"./ProviderConnectButton-DkDt69Df.js";import{C as xe}from"./CardIconButton-CX0NUJFQ.js";import{u as ma,S as ha}from"./SeatLocked-w6BrO7Hk.js";import{R as ns}from"./WebHubOrganisationLayout-D9vlIJ3g.js";import{t as $s}from"./tokens-DaqiVV3J.js";import{m as ba}from"./proxy-DAl5xTRT.js";import{P as xa}from"./progress-1_6MsTuc.js";import{T as pa}from"./ThreadRadio-41PHdMNV.js";import{u as fa}from"./useOrganisationActions-BVWeZ-8E.js";import{S as ga,a as ya,b as ja,c as va,d as Na,f as ka}from"./sheet-Bh4sUrct.js";import{A as rs}from"./index-BdXXo1LO.js";import{M as wa}from"./useWebHubRouteTour-yAtdp2mO.js";import"./vendor-runtime-DG-GlVKR.js";import"./index-Dl4pFCyo.js";import"./vendor-icons-DePtd98t.js";import"./vendor-ui-HM9MEgw-.js";import"./vendor-analytics-DaFEZfd9.js";import"./vendor-sentry-BBJkNfRx.js";import"./useConnectCalendar-EZEGwiGH.js";import"./useIntegrationAccessGuard-WuM0inPC.js";import"./usePaidIntegrationBlockReason-V3k2bmNX.js";import"./pricing2026Copy-B9umRD-S.js";import"./connectedMailboxLimit-DW5QMT-u.js";import"./getLimit-C0UR8BUV.js";import"./useManagedSettingHelpers-DU1ArCmY.js";import"./integrationSettingKey-DoJ8kxoa.js";import"./useSignInProvider-iuhx0BUw.js";import"./useConnectEmail-Crth_OLA.js";import"./useIsOutsideDashboardOnboardingWindow-BWuWvSLB.js";import"./useEmailForwardingConnections-BLaDD6g6.js";import"./emailForwardingConnectionsQueryRoot-f2XcGuCb.js";import"./ChatMessageList-XyEXIlgf.js";import"./useCalendarConnections-D3MiHFd6.js";import"./DocumentUpload-_o4WqiFm.js";import"./FyxerThinking-CB08HK5n.js";import"./useHasDocumentAccess-B59dXvXv.js";import"./formatTimeRange-CDkyP71v.js";import"./mermaid-3ZIDBTTL-BTdJrOGe.js";import"./index-DirJCEvl.js";import"./marked.esm-arQYK1KV.js";import"./ChatToolUsage-C9HStSZv.js";/* empty css               */import"./copyText-0_NNZNe-.js";import"./getBrowserTimezone-s91SEF56.js";import"./index-Dh4PUTGt.js";import"./index-mg-HgWsm.js";import"./index-BJfBsrKE.js";import"./getFirstName-Bqv6JhkD.js";import"./webHubTracking-BQYOgCiB.js";import"./UserPersona-DymmjSgw.js";import"./chatSuggestions-Td41LgWs.js";import"./useShowUpgradeToast-HzPIOzxI.js";import"./askAdminToUpgradeCopy-DJ5QaKnM.js";import"./LoadFailed-USmzVBxQ.js";import"./useLabels-ChBCopz-.js";import"./labelPresentationalData-CPNvrinP.js";import"./formatTimestampLabel-R9Kn71XV.js";import"./ActionItem-Dq1aVDKK.js";import"./useEmailSetup-BXUuRRrC.js";import"./useInboxSetupPrompt-D2QefxaP.js";import"./AnnouncementDialog-DGy6pe-B.js";import"./ThreadStepDots-CkX8036c.js";import"./inboxDeepLink-Bzbd4n1H.js";import"./updateCalendarEventNotetaker-Cv9Ckv_X.js";import"./useAccessibleSpaces-CQ2K9Xs8.js";import"./UpgradeAction-BTdZVCbp.js";import"./webinar-DYX0OzT3.js";import"./CalendarEvent-CErJ0TeH.js";import"./useIsSpacesEnabled-CtwbGBox.js";import"./webHubTourStorage-DyoTGtrU.js";import"./EmailConversationBadge--PYbn4eL.js";import"./useChatHistory-C-YuryVz.js";import"./isChatThreadUnread-JMnT_CMJ.js";import"./getPlainTextFromMarkdown-Du6FUcz6.js";import"./ChatThreadPanel-BmlQGrdb.js";import"./useChatThreadModeSelection-C4mtEwYo.js";import"./ChatInput-LhdmIzRh.js";import"./index-D3nCXTpj.js";import"./index-NniXEa6m.js";import"./useHidePlainChat-CgB1uSRE.js";import"./PendingFlowQuestionnairePanel-XWWFTWBo.js";import"./use-reduced-motion-dfwgEwLS.js";import"./index-D2UeztMp.js";import"./useChatAccountsAndMode-C4XkFhHH.js";import"./useStartChat-BZn2Sppc.js";import"./TourTooltipCard-Dwe5K3W2.js";import"./groupBy-Cp1aJ2BK.js";import"./formatTimeAgo-ZL4xsmDE.js";import"./spaceCompanyLogo-BlOu6AF8.js";import"./Space-gD2pE8f9.js";
1import"./input-group-DJNqLKaG.js";import"./Drawer-DvSV0I9s.js";import"./tabs-Bz7BswTQ.js";import"./ThreadUnreadDot-D_aBtxhK.js";import"./chunkArray-B4GsduDf.js";import"./useFlowAccess-Bo-NPwgn.js";import"./useSpaceInvitesQuery-BokVFtR7.js";import"./useSpaceUserPreferences-CKmOlYTt.js";import"./useSuggestedSpacesQuery-D6QhqqZe.js";import"./useRecentSpaces-1capDSVt.js";import"./isFyxer1Organisation-BwqJT8KB.js";import"./isEnterpriseOrganisation-Fjb8mzJZ.js";import"./PriorityVisualization-CboE8PTJ.js";import"./classifyTermsDocumentForOrganisation-CMvC-vzO.js";import"./trials-8KUt_9DV.js";import"./stringifyLocale-CGN90IVL.js";try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="9dd0353d-8770-40ed-90f3-4a2c5e5f7bbb",t._sentryDebugIdIdentifier="sentry-dbid-9dd0353d-8770-40ed-90f3-4a2c5e5f7bbb")}catch{}const jt="flex h-11 w-11 items-center justify-center rounded-lg text-rb-sec transition-colors hover:bg-rb-parchment focus-visible:ring-2 focus-visible:ring-rb-gray-hovered focus-visible:outline-hidden focus-visible:ring-inset motion-reduce:transition-none",He={[L.ALREADY_COMPLETED]:"Already done",[L.NOT_MY_ACTION]:"Not mine",[L.NOT_RELEVANT]:"Not needed",[L.INCORRECT_DETAILS]:"Wrong details",[L.OTHER]:"Other"},Fs=[L.ALREADY_COMPLETED,L.NOT_MY_ACTION,L.NOT_RELEVANT,L.INCORRECT_DETAILS,L.OTHER],Bs=500,Hs=6,Us=t=>{const s=t===void 0?NaN:new Date(t).getTime();return Number.isNaN(s)?void 0:new Date(s)},Ea=({attentionBy:t,now:s})=>{const n=Us(t);if(!n)return;const r=P(n,"EEE d MMM"),a=Be(n,s);return a<0?{label:`${-a}d late`,full:r,tone:"late"}:a===0?{label:"Today",full:r,tone:n<s?"late":"today"}:a===1?{label:"Tomorrow",full:r,tone:"plain"}:a<=Hs?{label:P(n,"EEE"),full:r,tone:"plain"}:{label:r,full:r,tone:"plain"}},Ws=({date:t,now:s})=>{const n=Us(t);if(!n)return;const r=Be(s,n);return r===0?"Today":r===1?"Yesterday":r>1&&r<=Hs?P(n,"EEE"):P(n,"d MMM")},Ia={[Ae.COMPLETED]:{text:"Cleared by Fyxer",tone:"ok"},[Ae.STALE]:{text:"No longer needed",tone:"muted"},[Ae.SUPERSEDED]:{text:"Replaced",tone:"muted"},[Ae.EXPIRED]:{text:"Expired",tone:"muted"}},Sa={text:"Done",tone:"muted"},Ks=t=>[...t.events].reverse().find(s=>s.type===Ss.RESOLVED),vt=t=>{var s;return((s=Ks(t))==null?void 0:s.at)??t.materiallyChangedAt},Nt=t=>t.resolution?Ia[t.resolution]:Sa,Ca=({item:t,now:s})=>{const n=Nt(t),r=Ws({date:vt(t),now:s});return{text:r?`${n.text} · ${r}`:n.text,tone:n.tone}},Gs=t=>{var s;return((s=[...t.events].reverse().find(n=>n.type===Ss.DISMISSED))==null?void 0:s.at)??t.materiallyChangedAt},Ra=({item:t,now:s})=>{const n=t.status===ye.RESOLVED,r=n?Nt(t).text:t.dismissalReason?He[t.dismissalReason]:"Dismissed",a=Ws({date:n?vt(t):Gs(t),now:s});return a?`${r} · ${a}`:r},Ta=({onSubmit:t,className:s})=>{const[n,r]=h.useState(""),a=n.trim(),o=()=>{a&&t(a)};return e.jsxs("span",{className:j("flex items-center gap-1",s),children:[e.jsx("input",{type:"text",value:n,autoFocus:!0,maxLength:Bs,placeholder:"What’s off about it?","aria-label":"Why was this not needed?",onChange:l=>r(l.target.value),onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),o())},className:"h-7 min-w-0 flex-1 rounded-md border border-rb-gray-neutral bg-rb-white px-2 text-body-sm text-rb-darkbtn placeholder:text-rb-disabled focus:border-rb-gray-hovered focus:outline-hidden focus-visible:ring-1 focus-visible:ring-rb-gray-hovered"}),e.jsx("button",{type:"button",onClick:o,disabled:!a,"aria-label":"Send note",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-rb-darkbtn transition-colors duration-150 hover:bg-rb-parchment focus-visible:ring-2 focus-visible:ring-rb-gray-hovered focus-visible:outline-hidden disabled:opacity-40 motion-reduce:transition-none",children:e.jsx(w,{name:"ArrowRight",size:14,className:"text-current"})})]})},Da=({onPick:t,className:s})=>e.jsxs("span",{role:"group","aria-label":"Why was this not needed?",className:j("flex flex-wrap items-center gap-1",s),children:[e.jsx("span",{className:"mr-0.5 text-label text-rb-secondary-dark",children:"Why?"}),Fs.map(n=>e.jsx("button",{type:"button",onClick:()=>t(n),className:"h-6 rounded-full border border-rb-gray-neutral bg-rb-white px-2 text-label font-medium whitespace-nowrap text-rb-darkbtn transition-colors duration-150 hover:border-rb-gray-hovered hover:bg-rb-parchment-light focus-visible:ring-2 focus-visible:ring-rb-gray-hovered focus-visible:ring-offset-0 focus-visible:outline-hidden motion-reduce:transition-none",children:He[n]},n))]}),Xs=6,Ue=({date:t,now:s})=>{const n=Be(s,t);return n===0?P(t,"HH:mm"):n>0&&n<=Xs?P(t,"EEE HH:mm"):P(t,Hr(t,s)?"d MMM":"d MMM yyyy")},Vs=({date:t,now:s})=>{const n=Be(s,t);return n===0?`Today ${P(t,"HH:mm")}`:n>0&&n<=Xs?P(t,"EEE HH:mm"):P(t,"d MMM HH:mm")},Aa={ok:"success",you:"neutral",muted:"muted"},Ys=({icon:t,tone:s,title:n,detail:r,action:a,children:o})=>e.jsxs(js,{variant:Aa[s],className:"mx-5 mt-5 w-auto sm:mx-6",children:[e.jsx(w,{name:t}),e.jsx(Un,{children:n}),r?e.jsx(vs,{children:r}):null,o?e.jsx("div",{className:"group-has-[>svg]/alert:col-start-2",children:o}):null,e.jsx("div",{className:"mt-2 group-has-[>svg]/alert:col-start-2",children:e.jsx(G,{size:"sm",onClick:a.onClick,children:a.label})})]}),_a=({item:t,now:s})=>{const n=Vs({date:Gs(t),now:s}),r=t.dismissalReason;return r?{icon:"X",tone:"muted",title:r===L.OTHER?`You dismissed this · ${n}`:`You said ${He[r].toLowerCase()} · ${n}`,detail:t.dismissalNote||"Fyxer will bear that in mind next time.",asksWhy:!1}:{icon:"X",tone:"muted",title:`You dismissed this · ${n}`,detail:void 0,asksWhy:!0}},Oa=({item:t,now:s})=>{var a;if(t.status===ye.DISMISSED)return _a({item:t,now:s});const n=Vs({date:vt(t),now:s});if(!t.resolution)return{icon:"Check",tone:"you",title:`You ticked this off · ${n}`,detail:"Reopen it if it slipped and it goes back on the list.",asksWhy:!1};const r=Nt(t);
1return{icon:kr(t)==="dismissed"?"X":"CheckCircle",tone:r.tone==="ok"?"ok":"muted",title:`${r.text} · ${n}`,detail:((a=Ks(t))==null?void 0:a.reason)||"Reopen it if Fyxer got this wrong.",asksWhy:!1}},La=({item:t,now:s,onReopen:n,onResolve:r,onExplainDismissal:a})=>{const o=Oa({item:t,now:s}),[l,i]=h.useState(!1),m=c=>{if(c===L.ALREADY_COMPLETED)return r();if(c===L.OTHER)return i(!0);a({reason:c})};return e.jsx(Ys,{icon:o.icon,tone:o.tone,title:o.title,detail:o.detail,action:{label:"Reopen",onClick:n},children:o.asksWhy?l?e.jsx(Ta,{className:"mt-1.5",onSubmit:c=>a({reason:L.OTHER,note:c})}):e.jsx(Da,{className:"mt-1.5",onPick:m}):null})},dt=j(Pe.item,"hover:bg-rb-parchment focus-visible:bg-rb-parchment"),kt="pointer-events-auto relative flex size-7 items-center justify-center rounded-md text-rb-secondary-dark transition-colors duration-150 hover:bg-rb-parchment-dark hover:text-rb-darkbtn focus-visible:ring-2 focus-visible:ring-rb-gray-hovered focus-visible:outline-hidden data-popup-open:bg-rb-parchment-dark data-popup-open:text-rb-darkbtn motion-reduce:transition-none",wt="text-[#f4b400] hover:text-[#f4b400]",Ma=Fs.filter(t=>t!==L.OTHER),qs=({placement:t,label:s="Dismiss",onDismiss:n,onOpenChange:r})=>{const[a,o]=h.useState(!1),[l,i]=h.useState(!1),[m,c]=h.useState(""),u=m.trim(),d=y=>{o(y),r==null||r(y),!y&&(i(!1),c(""))},p=y=>{d(!1),n(y)},g=()=>{u&&p({reason:L.OTHER,note:u})};return e.jsxs(le,{open:a,onOpenChange:d,children:[e.jsx(X,{label:"Dismiss",children:e.jsx(je,{render:e.jsx("button",{type:"button","aria-label":s,className:t==="bar"?jt:kt,children:e.jsx(w,{name:"Trash",size:t==="bar"?20:15,className:"text-current"})})})}
1),e.jsxs(ve,{align:"end",sideOffset:4,className:j("gap-0.5 p-1.5","w-auto min-w-[232px] p-1.5 text-rb-darkbtn outline-hidden"),children:[e.jsx("div",{className:"px-2 pt-1 pb-1.5 text-label font-medium text-rb-secondary-dark",children:"Dismiss because"}),Ma.map(y=>e.jsx("button",{type:"button",onClick:()=>p({reason:y}),className:dt,children:He[y]},y)),e.jsx("div",{className:"my-0.5 border-t border-rb-gray-neutral"}),l?e.jsxs("div",{className:"flex items-center gap-1.5 py-0.5 pr-0.5 pl-1",children:[e.jsx("input",{type:"text",value:m,autoFocus:!0,maxLength:Bs,placeholder:"What’s off about it?","aria-label":"Why dismiss this?",onChange:y=>c(y.target.value),onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),g())},className:"h-8 min-w-0 flex-1 rounded-md border border-rb-gray-neutral bg-rb-white px-2 text-body-sm text-rb-darkbtn placeholder:text-rb-disabled focus:border-rb-gray-hovered focus:outline-hidden"}),e.jsx(G,{variant:"brand",size:"sm",disabled:!u,onClick:g,children:"Dismiss"})]}):e.jsx("button",{type:"button",onClick:()=>i(!0),className:dt,children:"Something else…"})]})]})},Pa="Add a description: what needs doing, for whom, and by when.",as="text-body-sm text-pretty whitespace-pre-wrap",za=({detail:t,startsInEditor:s,onChange:n})=>{const r=t??"",[a,o]=h.useState(),l=h.useRef(),i=h.useRef(n);i.current=n;const m=d=>{l.current=d,o(d)},c=()=>{var p,g;const d=(p=l.current)==null?void 0:p.trim();m(void 0),d!==void 0&&d!==r&&((g=i.current)==null||g.call(i,d))};return h.useEffect(()=>()=>{var p,g;const d=(p=l.current)==null?void 0:p.trim();d!==void 0&&((g=i.current)==null||g.call(i,d))},[]),n?a!==void 0||s&&r===""?e.jsx(Ts,{rows:3,autoFocus:a!==void 0,value:a??"",maxLength:Or,placeholder:Pa,"aria-label":"Description",onFocus:d=>d.target.setSelectionRange(d.target.value.length,d.target.value.length),onChange:d=>m(d.target.value),onKeyDown:d=>{d.key==="Enter"&&!d.shiftKey&&(d.preventDefault(),c()),d.key==="Escape"&&(d.preventDefault(),d.stopPropagation(),m(void 0))},onBlur:c,className:"mt-1.5 min-h-[72px] resize-none text-body-sm"}):e.jsx("button",{type:"button",onClick:()=>m(r),"aria-label":r?"Edit description":"Add a description",className:j("-mx-2 mt-0.5 rounded-lg px-2 py-1 text-left transition-colors duration-150","hover:bg-rb-parchment focus-visible:ring-2 focus-visible:ring-rb-gray-hovered focus-visible:outline-hidden motion-reduce:transition-none",as,r?"text-rb-sec":"text-rb-disabled"),children:r||"Add a description"}):r?e.jsx("p",{className:j("mt-0.5 text-rb-sec",as),children:r}):null},ze=t=>j("inline-flex items-center gap-1.5 rounded-md text-body-sm text-rb-secondary-dark",t&&"-mx-1.5 -my-0.5 px-1.5 py-0.5 transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-rb-gray-hovered hover:bg-rb-parchment motion-reduce:transition-none"),$a=t=>P(t,"EEE d MMM"),Fa=t=>Wr(t),Ba=t=>[{label:"Today",day:t},{label:"Tomorrow",day:ct(t,1)},{label:"In a week",day:ct(t,7)}],Ha=({attentionBy:t,now:s,onChange:n})=>{const[r,a]=h.useState(!1),o=!t&&n!==void 0,l=t?$a(t):n?"Set due date":"No due date",i=e.jsxs(e.Fragment,{children:[e.jsx(w,{name:o?"Plus":"CalendarBlank",size:o?11:13,color:"secondary-dark",className:o?"text-rb-disabled":void 0}),l]});if(!n)return e.jsx("span",{className:ze(!1),children:i});const m=c=>{n(c?Fa(c):void 0),a(!1)};return e.jsxs(le,{open:r,onOpenChange:a,children:[e.jsx(je,{render:e.jsx("button",{type:"button","aria-label":t?`Due date: ${l}. Change`:"Set due date",className:j(ze(!0),o&&"mx-0 border border-dashed border-rb-gray-hovered text-rb-disabled hover:border-rb-secondary-dark hover:text-rb-secondary-dark"),children:i})}
1),e.jsxs(ve,{align:"start",sideOffset:4,className:j("gap-0.5 p-1.5","w-auto p-2 text-rb-darkbtn outline-hidden"),children:[e.jsxs("div",{className:"flex flex-wrap gap-1 border-b border-rb-gray-neutral pb-2",children:[Ba(s).map(c=>e.jsx("button",{type:"button",onClick:()=>m(c.day),className:j(Pe.item,"w-auto",t&&Ur(t,c.day)&&"bg-rb-parchment","hover:bg-rb-parchment"),children:c.label},c.label)),t?e.jsx("button",{type:"button",onClick:()=>m(void 0),className:j(Pe.item,"w-auto text-rb-sec","hover:bg-rb-parchment"),children:"Remove due date"}):null]}),e.jsx(Ds,{mode:"single",selected:t,defaultMonth:t??s,onSelect:c=>m(c??t),className:"p-1"})]})]})},Qs=["HIGH","MEDIUM","LOW"],Ua=t=>Qs.some(s=>s===t),ot=({urgency:t})=>{const s=Cs[t];return e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":"true",className:j("h-2 w-2 rounded-full",s.dotClassName)}),s.label]})},Wa=({urgency:t,onChange:s})=>s?e.jsxs(Wn,{modal:!1,children:[e.jsx(Kn,{render:e.jsx("button",{type:"button","aria-label":`Urgency: ${Cs[t].label}. Change`,className:ze(!0),children:e.jsx(ot,{urgency:t})})}),e.jsx(Gn,{align:"start",children:e.jsx(Xn,{value:t,onValueChange:n=>{Ua(n)&&s(n)},children:Qs.map(n=>e.jsx(Vn,{value:n,children:e.jsx(ot,{urgency:n})},n))})})]}):e.jsx("span",{className:ze(!1),children:e.jsx(ot,{urgency:t})}),Ka=({item:t,now:s,onSetUrgency:n,onSetAttentionBy:r,onSetDetail:a})=>{const o=h.useRef(null);return h.useEffect(()=>{var i;const l=window.document.activeElement;return(i=o.current)==null||i.focus({preventScroll:!0}),()=>{const m=window.document.activeElement;(m===null||m===window.document.body)&&l instanceof HTMLElement&&l.isConnected&&l.focus({preventScroll:!0})}},[]),e.jsxs("header",{className:"flex shrink-0 flex-col gap-1.5 border-b border-rb-gray-neutral bg-rb-parchment-light px-5 pt-5 pb-4 sm:px-6",children:[e.jsx("h2",{ref:o,tabIndex:-1,className:"text-title-sm leading-[1.35] font-medium tracking-[-0.01em] text-rb-darkbtn outline-hidden",children:t.title}),e.jsxs("p",{className:"flex flex-wrap items-center gap-2 text-body-sm text-rb-secondary-dark",children:[e.jsx(Ha,{attentionBy:t.attentionBy,now:s,onChange:r}),e.jsx("span",{"aria-hidden":"true",className:"text-rb-disabled",children:"·"}),e.jsx(Wa,{urgency:t.urgency,onChange:n})]}),e.jsx(za,{detail:t.detail,startsInEditor:t.origin==="USER",onChange:a})]})},os=j(dt,"justify-between gap-4"),Js=({item:t,now:s,placement:n,onSnooze:r,onOpenChange:a})=>{const[o,l]=h.useState(!1),[i,m]=h.useState(!1),[c,u]=h.useState(s),d=wr({now:c,attentionBy:t.attentionBy}),p=Kr(ct(c,1)),g=b=>{l(b),a==null||a(b),b?u(new Date):m(!1)},y=b=>{g(!1),r(b)};return e.jsxs(le,{open:o,onOpenChange:g,children:[e.jsx(X,{label:"Snooze",children:e.jsx(je,{render:e.jsx("button",{type:"button","aria-label":"Snooze",className:n==="bar"?jt:kt,children:e.jsx(w,{name:"Clock",size:n==="bar"?20:15,className:"text-current"})})})}),e.jsx(ve,{align:"end",sideOffset:4,className:j("gap-0.5 p-1.5","w-auto min-w-[232px] p-1.5 text-rb-darkbtn outline-hidden"),children:i?e.jsx(Ds,{mode:"single",autoFocus:!0,defaultMonth:p,disabled:{before:p},onSelect:b=>b&&y({until:Er(b),preset:"custom"}),className:"p-1"}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-2 pt-1 pb-1.5 text-label font-medium text-rb-secondary-dark",children:"Snooze until"}),d.map(b=>e.jsxs("button",{type:"button",onClick:()=>y({until:b.until,preset:b.preset}),className:os,children:[e.jsx("span",{children:b.label}),e.jsx("span",{className:"text-rb-secondary-dark tabular-nums",children:ft({until:b.until,now:c})})]},b.preset)),e.jsx("div",{className:"my-0.5 border-t border-rb-gray-neutral"}),e.jsxs("button",{type:"button",onClick:()=>m(!0),className:os,children:[e.jsx("span",{children:"Pick a date…"}),e.jsx("span",{className:"text-rb-secondary-dark",children:"09:00"})]})]})})]})},Ga=({until:t,now:s,onUnsnooze:n})=>e.jsx(Ys,{icon:"Clock",tone:"muted",title:`Snoozed until ${ft({until:t,now:s})}`,detail:"It comes back to your list, unread.",action:{label:"Bring back now",onClick:n}}),ee=t=>t.trim().toLowerCase(),We=()=>{const{user:t}=Yn(),{emailConnections:s,calendarConnections:n}=xt(),r=[...s,...n].flatMap(a=>{const o=a.data().metadata.email;
1return typeof o=="string"?[ee(o)]:[]});return{addresses:new Set([ee(t.email),...r]),names:new Set(t.name?[ee(t.name)]:[])}},Xa=({person:t,own:s})=>t.address!==void 0?s.addresses.has(ee(t.address)):t.name!==void 0&&s.names.has(ee(t.name)),te=t=>{var s,n;return((s=t.name)==null?void 0:s.trim())||((n=t.address)==null?void 0:n.trim())||""},Ne=({people:t,own:s})=>{const n=new Set;return t.filter(r=>{const a=ee(r.address??"")||ee(r.name??"");return!a||n.has(a)||Xa({person:r,own:s})?!1:(n.add(a),!0)})},Va=t=>{var s;return(((s=t.name)==null?void 0:s.trim().split(/\s+/).length)??0)>=2},Ya=3,is="flex size-6 items-center justify-center rounded-full border-2 border-rb-white text-[8px] font-semibold",qa=({people:t,icon:s})=>{const n=t.filter(Va);if(n.length===0)return e.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-rb-parchment text-rb-secondary-dark",children:e.jsx(w,{name:s,size:13,className:"text-current"})});const r=n.slice(0,Ya),a=n.length-r.length;return e.jsxs("span",{className:"relative mr-1 inline-flex shrink-0 items-center","aria-hidden":"true",children:[r.map((o,l)=>e.jsx("span",{className:j(is,sa(te(o)),l>0&&"-ml-1.5"),children:qn(te(o))},o.address??o.name)),a>0?e.jsxs("span",{className:j(is,"-ml-1.5 bg-rb-parchment font-medium text-rb-secondary-dark"),children:["+",a]}):null,e.jsx("span",{className:"absolute -right-1.5 -bottom-1 flex size-[15px] items-center justify-center rounded-full border-2 border-rb-white bg-rb-darkbtn text-rb-white",children:e.jsx(w,{name:s,size:8,filled:!0,className:"text-current"})})]})},ut="rounded text-label text-rb-secondary-dark underline-offset-2 transition-colors hover:text-rb-darkbtn hover:underline focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-rb-gray-hovered focus-visible:ring-offset-1 motion-reduce:transition-none",Qa=({link:t,className:s})=>t.isExternal?e.jsx("a",{href:t.href,onClick:t.onOpen,target:"_blank",rel:"noopener noreferrer",className:j(ut,s),children:t.label}):e.jsx(Hn,{to:t.href,state:t.state,onClick:t.onOpen,className:j(ut,s),children:t.label}),ge=({label:t})=>e.jsxs("div",{className:"space-y-2",role:"status","aria-label":t,children:[e.jsx(st,{className:"h-3 w-full rounded"}),e.jsx(st,{className:"h-3 w-11/12 rounded"}),e.jsx(st,{className:"h-3 w-3/5 rounded"})]}),M=({title:t,detail:s,icon:n,onRetry:r})=>e.jsxs("div",{className:"flex items-start gap-2.5 rounded-[10px] border border-rb-warning/25 bg-rb-warning/10 px-3 py-2.5",children:[e.jsx("span",{className:"flex size-[22px] shrink-0 items-center justify-center rounded-full border border-rb-warning/25 bg-rb-white",children:e.jsx(w,{name:n??(r?"ArrowClockwise":"Info"),size:12,className:"text-rb-warning"})}),e.jsxs("div",{className:"min-w-0 text-label text-rb-sec",children:[e.jsx("p",{className:"text-body-sm font-medium text-rb-darkbtn",children:t}),s||r?e.jsxs("p",{children:[s,s&&r?" ":null,r?e.jsx("button",{type:"button",onClick:r,className:j(ut,"font-medium text-rb-warning underline hover:text-rb-warning"),children:"Try again"}):null]}):null]})]}),se="whitespace-pre-wrap break-words text-body-sm text-rb-sec",ke=({icon:t,people:s,title:n,subtitle:r,occurredAt:a,onOccurredAt:o,link:l,isOpen:i,onToggle:m,children:c})=>{const u=a==null?void 0:a.getTime();return h.useEffect(()=>{o(u===void 0?void 0:new Date(u))},[u,o]),e.jsxs("article",{className:"border-b border-rb-gray-neutral last:border-b-0",children:[e.jsxs("div",{className:j("flex items-center gap-2.5 px-5 sm:px-6",i?"pt-3.5 pb-2":"py-3.5 transition-colors hover:bg-rb-parchment-light motion-reduce:transition-none"),children:[e.jsxs("button",{type:"button","aria-expanded":i,onClick:m,className:"flex min-w-0 flex-1 items-center gap-2.5 rounded text-left focus-visible:ring-2 focus-visible:ring-rb-gray-hovered focus-visible:ring-offset-2 focus-visible:outline-hidden",children:[e.jsx(qa,{people:s,icon:t}),e.jsxs("span",{className:"flex min-w-0 flex-1 flex-col gap-px",children:[e.jsx("span",{className:j("truncate text-body font-medium",i?"text-rb-darkbtn":"text-rb-sec"),children:n}),r?e.jsx("span",{className:"truncate text-label text-rb-secondary-dark",children:r}):null]})]}),l?e.jsx(Qa,{link:l,className:"shrink-0 whitespace-nowrap"}):null]}),i?e.jsx("div",{className:"px-5 pb-4 sm:px-6",children:c}):null]})},ls=3,Ja=t=>t.isAllDay?"All day":`${P(t.startsAt,"HH:mm")} – ${P(t.endsAt,"HH:mm")}`,Za=t=>{var s;
1return[Ja(t),(s=t.location)==null?void 0:s.trim()].filter(Boolean).join(" · ")},eo=t=>{if(t.length===0)return;const s=t.slice(0,ls).join(", "),n=t.length-ls;return n>0?`With ${s} +${n}`:`With ${s}`},to=t=>t!=null&&t.trim()?(/<[a-z][\s\S]*>/i.test(t)?ea(t):t).replace(/\r\n/g,`
2`).split(`
3`).map(n=>n.trimEnd()).join(`
4`).trim():"",so=t=>Jn(t)===be.CALENDAR?Qn[t].displayName:void 0,no=({document:t,reference:s,isOpen:n,onToggle:r,onOccurredAt:a})=>{var R,S;const o=t.data,l=ta({organisationId:o.organisationId,userId:o.userId,reference:s}),{calendarConnections:i}=xt(),m=We(),c=$e(o.organisationId),u=(R=l.event)==null?void 0:R.data,d=u?i.find(I=>I.id===u.connectionId):void 0,p=d==null?void 0:d.data().metadata.email,g=Ne({people:((u==null?void 0:u.attendees)??[]).filter(I=>!I.isResource).map(I=>({name:I.name,address:I.email})),own:m}),y=to(u==null?void 0:u.description),b=u?so(u.integration):void 0,x=u&&typeof p=="string"?Vr({calendarEvent:u,calendarEmail:p}):void 0,f=x&&b?{href:x,label:`Open in ${b}`,isExternal:!0,onOpen:()=>c({radarItemId:t.id,source_type:"calendar_event",destination:(u==null?void 0:u.integration)===Zn.GOOGLE_CALENDAR?"google_calendar":"outlook_calendar",intent:"open_event"})}:void 0,k=u&&!u.isCancelled?{href:Zr({organisationId:o.organisationId,connectionId:u.connectionId,providerId:u.providerId,startsAt:u.startsAt}),label:"Open in Calendar",isExternal:!1,onOpen:()=>c({radarItemId:t.id,source_type:"calendar_event",destination:"calendar",intent:"open_event"})}:void 0,E=(()=>{if(l.isPending)return e.jsx(ge,{label:"Loading event"});if(l.isError)return e.jsx(M,{title:"Couldn’t load this event",onRetry:l.retry});if(l.isMissing||!u)return e.jsx(M,{title:"This event is no longer in your calendar",detail:"It may have been deleted or moved since this action was raised."});const I=eo(g.map(te));return e.jsxs("div",{className:"flex flex-col gap-2",children:[u.isCancelled?e.jsx(M,{title:"This event was canceled"}):null,I?e.jsx("p",{className:"text-body-sm text-rb-secondary-dark",children:I}):null,y?e.jsx("p",{className:se,children:y}):null,!I&&!y&&s.relevance?e.jsx("p",{className:se,children:s.relevance}):null]})})();return e.jsx(ke,{icon:"CalendarBlank",people:g,title:((S=u==null?void 0:u.title)==null?void 0:S.trim())||s.label||"Calendar event",subtitle:u?Za(u):s.relevance,occurredAt:u==null?void 0:u.startsAt,onOccurredAt:a,link:k??f,isOpen:n,onToggle:()=>r("calendar_event"),children:E})},Zs=({label:t,onOpen:s,className:n})=>e.jsx("button",{type:"button",onClick:s,className:j("block w-full rounded py-1 text-left text-label text-rb-disabled transition-colors hover:text-rb-darkbtn focus-visible:ring-2 focus-visible:ring-rb-gray-hovered focus-visible:outline-hidden motion-reduce:transition-none",n),children:t}),en=({text:t,ranges:s,className:n})=>{const r=na(s);if(r.length===0)return e.jsx("p",{className:n,children:t});const a=r.flatMap((o,l)=>[t.slice(l===0?0:r[l-1].end,o.start),e.jsx("mark",{className:"-mx-0.5 rounded bg-rb-orange-neutral/20 box-decoration-clone px-1 py-0.5 text-rb-darkbtn",children:t.slice(o.start,o.end)},o.start)]);return e.jsxs("p",{className:n,children:[a,t.slice(r[r.length-1].end)]})},ro=404,ao=280,cs=3,oo=t=>{const s=_s({body:t.body,bodyHtml:t.bodyHtml}).bodyHtml;return s!=null&&s.trim()?s:void 0},io=t=>_s({body:t.body,bodyHtml:void 0}).body.replace(/\r\n/g,`
5`).split(`
6`).map(s=>s.trimEnd()).join(`
7`).trim(),ds=({message:t,excerpts:s})=>{const n=io(t),r=s.filter(a=>a.internetMessageId?a.internetMessageId===t.internetMessageId:yt({text:n,excerpt:a.text})!==void 0);return{message:t,html:oo(t),text:n,quotes:r}},lo=t=>[t.from,...t.to,...t.cc],tn=t=>{const s=t.slice(0,cs).join(", "),n=t.length-cs;return n>0?`${s} +${n}`:s},co=({message:t,now:s})=>e.jsxs("div",{className:"flex items-baseline gap-3 text-label text-rb-secondary-dark",children:[e.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[As(t),t.from.name?e.jsxs("span",{className:"text-rb-disabled",children:[" · ",t.from.address]}):null]}),e.jsx("span",{className:"shrink-0 text-rb-disabled",children:Ue({date:t.sentAt,now:s})})]}),uo=({content:t,title:s})=>{const n=t.quotes.map(a=>a.text);if(t.html)return e.jsx(ra,{html:t.html,title:s,highlightExcerpts:n,keepEmailStyles:!0});const r=n.flatMap(a=>yt({text:t.text,excerpt:a})??[]);return e.jsx(en,{text:t.text,ranges:r,className:se})},mo=({content:t,title:s,now:n})=>e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(co,{message:t.message,now:n}),e.jsx(uo,{content:t,title:t.message.subject||s})]}),ho=({contents:t,title:s,now:n})=>{const[r,a]=h.useState(()=>new Set),o=t.some(c=>
7c.quotes.length>0),l=t[t.length-1],i=Os({entries:t,isShown:c=>r.has(c.message.providerEmailId)||(o?c.quotes.length>0:c===l),toKey:c=>c.message.providerEmailId}),m=c=>a(u=>new Set([...u,...c.map(d=>d.message.providerEmailId)]));return e.jsx("div",{className:"flex flex-col gap-4",children:i.map(c=>c.type==="shown"?e.jsx(mo,{content:c.entry,title:s,now:n},c.entry.message.providerEmailId):e.jsx(Zs,{label:Ls({count:c.entries.length,position:c.position,noun:"message"}),onOpen:()=>m(c.entries)},c.key))})},bo=({organisationId:t,target:s,message:n,isOpen:r})=>{const a=pt();return gt({...Yr({organisationId:t,thread:{connectionId:(s==null?void 0:s.connectionId)??"",providerEmailId:(n==null?void 0:n.providerEmailId)??"",threadId:s==null?void 0:s.threadId},fetchThread:o=>a.organisations.id(t).inbox.thread(o)}),enabled:r&&!!(s&&n)})},xo=({contents:t,isTruncated:s,own:n,now:r})=>{const a=Ne({people:t.flatMap(c=>lo(c.message)),own:n}),o=t[t.length-1],l=`${t.length}${s?"+":""} ${t.length===1?"message":"messages"}`,i=o?`, last ${Ue({date:o.message.sentAt,now:r})}`:"",m=tn(a.map(te));return{people:a,subtitle:m?`${m} · ${l}${i}`:`${l}${i}`}},po=({document:t,reference:s,now:n,isOpen:r,onToggle:a,onOccurredAt:o})=>{var F;const l=t.data,i=Is({item:l,radarItemId:t.id,reference:s}),m=We(),c=$e(l.organisationId),u=Fe(l.organisationId),d=h.useMemo(()=>i.message?{...i.message,internetMessageId:s.internetMessageId}:void 0,[i.message,s.internetMessageId]),p=Lr(s),g=(d==null?void 0:d.threadId)||s.threadId,y=d&&i.inboxTarget&&g?{connectionId:i.inboxTarget.connectionId,threadId:g}:void 0,b=bo({organisationId:l.organisationId,target:y,message:d,isOpen:r}),x=h.useMemo(()=>d?ds({message:d,excerpts:p}):void 0,[d,p]),f=h.useMemo(()=>{var _;return(((_=b.data)==null?void 0:_.messages)??[]).filter(O=>!O.isDraft).map(O=>ds({message:O,excerpts:p}))},[b.data,p]),k=f.length>0?f:x?[x]:[],E=d==null?void 0:d.providerEmailId,R=x!=null&&x.html?"html":"text",S=h.useMemo(()=>x?p.filter(_=>!_.internetMessageId||_.internetMessageId===x.message.internetMessageId).map(_=>{var O;return((O=yt({text:x.text,excerpt:_.text}))==null?void 0:O.kind)??"none"}):[],[x,p]),I=h.useRef(void 0);h.useEffect(()=>
7{!E||S.length===0||I.current===E||(I.current=E,S.forEach(_=>u(ie.RADAR_ACTION_EXCERPT_CHECKED,{radarItemId:t.id,body_kind:R,match:_})))},[R,t.id,S,E,u]);const C=(d==null?void 0:d.subject)||s.label||"Email",z=xo({contents:k,isTruncated:((F=b.data)==null?void 0:F.isTruncated)??!1,own:m,now:n}),T=d?f.length>0?z.subtitle:`${As(d)} · to ${tn(Ne({people:[...d.to,...d.cc],own:m}).map(te))||"you"}`:s.relevance,D=i.providerMessageLink,$=d&&i.previewEmail?{selectedEmail:{...i.previewEmail,snippet:i.previewEmail.snippet.slice(0,ao)},selectedThreadKey:ia(i.previewEmail),selectedProviderEmailId:i.previewEmail.providerEmailId,openedFrom:"action"}:void 0,N=D!=null&&D.url?{href:D.url,label:`Open in ${D.providerLabel}`,isExternal:!0,onOpen:()=>c({radarItemId:t.id,source_type:"email",destination:Mr(D.providerLabel),intent:"read_thread"})}:$?{href:`/org/${l.organisationId}/inbox`,state:$,label:"Open in Inbox",isExternal:!1,onOpen:()=>c({radarItemId:t.id,source_type:"email",destination:"inbox",intent:"read_thread"})}:void 0,A=(()=>{var _;return i.isPending?e.jsx(ge,{label:"Loading email"}):i.errorStatus===ro||!d&&!i.isError&&!i.source?e.jsx(M,{icon:"Lock",title:i.source?"This email is no longer in your inbox":"This email isn’t in a connected inbox",detail:i.source?"It may have been deleted or moved since this action was raised.":"Connect the inbox it arrived in to read it here."}):i.isError||!d||!x?e.jsx(M,{title:"Couldn’t load this email",onRetry:i.retry}):e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(ho,{contents:k,title:C,now:n}),y&&b.isPending?e.jsx(ge,{label:"Loading the rest of the thread"}):null,y&&b.isError?e.jsx(M,{title:"Couldn’t load the rest of the thread",onRetry:()=>void b.refetch()}):null,(_=b.data)!=null&&_.isTruncated?e.jsx(M,{title:"Older messages in this thread are not shown"}):null]})})();return e.jsx(ke,{icon:"Envelope",people:z.people,title:C,subtitle:T,occurredAt:d==null?void 0:d.sentAt,onOccurredAt:o,link:N,isOpen:r,onToggle:()=>a("email"),children:A})},us=t=>`recording-${t}`,sn=t=>`task-${t}`,fo=(t,s)=>{switch(t.type){case"EMAIL_THREAD":return`email-${t.threadId}-${t.internetMessageId??s}`;case"CALENDAR_EVENT":return`event-${t.providerEventId}`;case"CONTEXT_ITEM":return`context-${t.contextItemId}`;default:return fe(t)}},go=({references:t,tasks:s})=>{const n=new Map,r=[];return t.forEach((a,o)=>{if(a.type!=="ACTION_ITEM"){if(a.type!=="CALL_RECORDING"){r.push({kind:"reference",key:fo(a,o),index:o,reference:a});return}n.has(a.callRecordingId)||n.set(a.callRecordingId,{kind:"meeting",key:us(a.callRecordingId),index:o,meeting:{callRecordingId:a.callRecordingId,actionItemIds:[],anchorStartsMs:[],label:a.label,relevance:a.relevance}})}}),t.forEach((a,o)=>{var c;if(a.type!=="ACTION_ITEM")return;const l=(c=s.find(u=>u.actionItemId===a.actionItemId))==null?void 0:c.task;if(!l)return;if(!l.callRecordingId){r.push({kind:"task",key:sn(a.actionItemId),index:o,reference:a,task:l});return}const i=l.startMs===void 0?[]:[l.startMs],m=n.get(l.callRecordingId);if(m){n.set(l.callRecordingId,{...m,index:Math.min(m.index,o),meeting:{...m.meeting,actionItemIds:[...m.meeting.actionItemIds,a.actionItemId],anchorStartsMs:[...m.meeting.anchorStartsMs,...i]}});return}n.set(l.callRecordingId,{kind:"meeting",key:us(l.callRecordingId),index:o,meeting:{callRecordingId:l.callRecordingId,actionItemIds:[a.actionItemId],anchorStartsMs:i,label:a.label,relevance:a.relevance}})}),[...r,...n.values()]},yo=({callRecordingId:t})=>{const s=gt({queryKey:["radar-source-transcript",t??""],enabled:!!t,retry:(n,r)=>n<2&&!da(r),queryFn:async()=>(await er(tr(rr[ar.TRANSCRIPT_SEGMENT],nr("callRecordingId","==",t??""),sr("startMs","asc")))).docs.map(r=>{const a=r.data();return{id:r.id,speaker:a.speaker,startMs:a.startMs,endMs:a.endMs,text:a.text}})});return{turns:s.data??[],isPending:!!t&&s.isPending,isError:s.isError,retry:()=>{s.refetch()}}},jo=3,vo=1,ms=3,No=({turns:t,anchorStartMs:s})=>{const n=[...t].reverse().findIndex(r=>r.startMs<=s);return n<0?void 0:t.length-1-n},ko=({turns:t,anchorStartsMs:s})=>new Set(s.flatMap(n=>{const r=No({turns:t,anchorStartMs:n});return r===void 0?[]:[r]})),wo=t=>{const s=t.slice(0,ms).join(", "),n=t.length-ms;return n>0?`${s} +${n}`:s},Eo=({turn:t,isAnchor:s})=>e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-baseline gap-3 text-label text-rb-secondary-dark",children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:t.speaker||"Speaker"}),e.jsx("span",{className:"shrink-0 font-mono text-rb-disabled",children:la(t.startMs)})]}),e.jsx(en,{text:t.text,ranges:s?[{start:0,end:t.text.length}]:[],className:se})]}),Io=({turns:t,anchorIndices:s})=>{const[n,r]=h.useState(()=>new Set),a=i=>s.size===0?i<jo:[...s].some(m=>Math.abs(i-m)<=vo),o=Os({entries:t.map((i,m)=>({turn:i,index:m})),isShown:({turn:i,index:m})=>n.has(i.id)||a(m),toKey:({turn:i})=>i.id}),l=i=>r(m=>new Set([...m,...i.map(c=>c.turn.id)]));return e.jsx("div",{className:"flex flex-col gap-4",children:o.map(i=>i.type==="shown"?e.jsx(Eo,{turn:i.entry.turn,isAnchor:s.has(i.entry.index)},i.entry.turn.id):e.jsx(Zs,{label:Ls({count:i.entries.length,position:i.position,noun:"turn"}),onOpen:()=>l(i.entries)},i.key))})},So=({document:t,group:s,now:n,isOpen:r,onToggle:a,onOccurredAt:o})=>{const l=t.data,{callRecordingId:i,anchorStartsMs:m,label:c,relevance:u}=s,d=Ir({item:l,reference:{type:"CALL_RECORDING",callRecordingId:i,providerEventId:void 0,label:c,relevance:u}}),p=We(),g=!d.isPending&&!d.isMissing&&!d.isError,y=yo({callRecordingId:g&&r?i:void 0}),b=$e(l.organisationId),x=ko({turns:y.turns,anchorStartsMs:m}),f=[...x].map(C=>y.turns[C].startMs).concat(m).sort((C,z)=>C-z)[0],k=Ne({people:d.attendees,own:p}),E=wo(k.map(te)),R=d.occurredAt?Ue({date:d.occurredAt,now:n}
7):void 0,S=[E,R].filter(Boolean).join(" · ")||u,I=d.isPending||y.isPending?e.jsx(ge,{label:"Loading transcript"}):d.isMissing?e.jsx(M,{icon:"Lock",title:"This meeting isn’t available to you",detail:"It may have been deleted, or not shared with you."}):d.isError?e.jsx(M,{title:"Couldn’t load this meeting",onRetry:d.retry}):y.isError?e.jsx(M,{title:"Couldn’t load the transcript",onRetry:y.retry}):y.turns.length===0?u?e.jsx("p",{className:se,children:u}):e.jsx(M,{title:"No transcript was captured for this meeting"}):e.jsx(Io,{turns:y.turns,anchorIndices:x});return e.jsx(ke,{icon:"Notepad",people:k,title:d.title,subtitle:S,occurredAt:d.occurredAt,onOccurredAt:o,link:g?{href:ca({organisationId:l.organisationId,callRecordingId:i,startMs:f}),label:"Open transcript",isExternal:!1,onOpen:()=>b({radarItemId:t.id,source_type:"meeting",destination:"meeting_transcript",intent:"read_transcript"})}:void 0,isOpen:r,onToggle:()=>a("meeting"),children:I})},Co=({icon:t,title:s,relevance:n,isOpen:r,onToggle:a,onOccurredAt:o})=>e.jsx(ke,{icon:t,people:[],title:s,subtitle:void 0,occurredAt:void 0,onOccurredAt:o,link:void 0,isOpen:r,onToggle:()=>a("context"),children:n?e.jsx("p",{className:se,children:n}):null}),Ro=({document:t,reference:s,task:n,isOpen:r,onToggle:a,onOccurredAt:o})=>{const l=t.data,i=Sr({organisationId:l.organisationId,spaceIds:n.spaceIds,actionItemId:s.actionItemId}),m=$e(l.organisationId),c=We(),u=Ne({people:n.assigneeNames.map(g=>({name:g})),own:c}),d=[i.name,u.map(te).join(", ")].filter(Boolean).join(" · "),p=(()=>{if(n.isPending)return e.jsx(ge,{label:"Loading task"});if(n.isMissing)return e.jsx(M,{icon:"Lock",title:"This task isn’t available to you",detail:"It may have been deleted, or not shared with you."});if(n.isError)return e.jsx(M,{title:"Couldn’t load this task"});const g=n.description||s.relevance;return g?e.jsx("p",{className:se,children:g}):null})();return e.jsx(ke,{icon:"ListChecks",people:u,title:n.content||s.label||"Task",subtitle:d||s.relevance,occurredAt:void 0,onOccurredAt:o,link:i.path?{href:i.path,label:"Open task",isExternal:!1,onOpen:()=>m({radarItemId:t.id,source_type:"task",destination:"space",intent:"open_task"})}:void 0,isOpen:r,onToggle:()=>a("task"),children:p})},To=({document:t,entry:s,now:n,block:r})=>{switch(s.kind){case"meeting":return e.jsx(So,{document:t,group:s.meeting,now:n,...r});case"task":return e.jsx(Ro,{document:t,reference:s.reference,task:s.task,...r});case"reference":{const a=s.reference;switch(a.type){case"EMAIL_THREAD":return e.jsx(po,{document:t,reference:a,now:n,...r});case"CALENDAR_EVENT":return e.jsx(no,{document:t,reference:a,...r});case"CONTEXT_ITEM":{const o=Pr(a.type);return e.jsx(Co,{icon:o.icon,title:a.label||o.label,relevance:a.relevance,...r})}default:return fe(a)}}default:return fe(s)}},Do=()=>{const[t,s]=h.useState({}),n=h.useCallback((r,a)=>s(o=>{const l=a==null?void 0:a.getTime();return o[r]===l?o:{...o,[r]:l}}),[]);return{occurredAtByKey:t,report:n}},Ao=({document:t,entry:s,now:n,isOpen:r,onToggle:a,onOccurredAt:o})=>{const l=h.useCallback(i=>o(s.key,i),[s.key,o]);return e.jsx(To,{document:t,entry:s,now:n,block:{isOpen:r,onToggle:a,onOccurredAt:l}})},_o=({document:t,now:s})=>{var b;const n=t.data.references,r=Cr({references:n.flatMap(x=>x.type==="ACTION_ITEM"?[x]:[])}),{occurredAtByKey:a,report:o}=Do(),[l,i]=h.useState({}),m=Fe(t.data.organisationId);if(n.length===0)return e.jsx("p",{className:"px-5 py-4 text-body-sm text-rb-secondary-dark sm:px-6",children:"This action is not tied to an email or meeting yet."});const c=go({references:n,tasks:r}).sort((x,f)=>{const k=a[x.key]??Number.POSITIVE_INFINITY,E=a[f.key]??Number.POSITIVE_INFINITY;return k-E||x.index-f.index}),u=c.filter(x=>a[x.key]!==void 0),d=(b=u[u.length-1]??c[c.length-1])==null?void 0:b.key,p=x=>l[x.key]??(x.kind==="meeting"?x.meeting.actionItemIds.map(f=>l[sn(f)]).find(f=>f!==void 0):void 0),g=x=>p(x)??x.key===d,y=(x,f)=>{const k=!g(x);i(Object.fromEntries(c.map(E=>[E.key,E===x?k:g(E)]))),m(ie.RADAR_ACTION_SOURCE_TOGGLED,{radarItemId:t.id,source_type:f,is_open:k})};return e.jsx("div",{className:"flex flex-col",children:c.map(x=>e.jsx(Ao,{document:t,entry:x,now:s,isOpen:g(x),onToggle:f=>y(x,f),onOccurredAt:o},x.key))})},hs=6,Oo=t=>{var s;return((s=t.name)==null?void 0:s.trim())||t.address},Lo=({organisationId:t})=>{var g,y;const s=pt(),n=h.useRef(s);n.current=s;const{hasActiveEmailConnection:r}=xt(),[a,o]=h.useState(""),[l,i]=h.useState("");h.useEffect(()=>{const b=window.setTimeout(()=>i(a.trim()),aa);return()=>window.clearTimeout(b)},[a]);const m=l.length>=oa?l:"",c=Gr({...zr({filters:{organisationId:t,query:m,connectionIds:[],dateRange:"all",hasAttachments:!1},searchInbox:b=>n.current.organisations.id(t).inbox.search(b)}),enabled:r&&!!t,placeholderData:Rs}),u=ua({query:m,pageSize:hs,fetchFullRecordings:!1}),d=qr(((g=c.data)==null?void 0:g.pages.flatMap(b=>b.results))??[]).sort((b,x)=>at(x.sentAt).getTime()-at(b.sentAt).getTime()).slice(0,hs).map(b=>({key:`email-${b.connectionId}-${b.threadId??b.providerEmailId}`,kind:"email",title:b.subject||"(No subject)",subtitle:Oo(b.from),sortedAt:at(b.sentAt),reference:{type:"EMAIL_THREAD",connectionId:b.connectionId,providerEmailId:b.providerEmailId,threadId:b.threadId??b.providerEmailId,label:b.subject||void 0}})),p=(((y=u.data)==null?void 0:y.items)??[]).map(b=>{const x=Rr({hit:b});return{key:`meeting-${b.objectID}`,kind:"meeting",title:x.title,subtitle:x.subtitle,sortedAt:x.sortedAt,reference:{type:"CALL_RECORDING",callRecordingId:b.objectID,label:x.title}}});return{query:a,setQuery:o,candidates:[...d,...p].sort((b,x)=>x.sortedAt.getTime()-b.sortedAt.getTime()),isSearching:a.trim()!==l||c.isFetching||u.isFetching,hasError:(!r||c.isError)&&u.isError}},Mo={email:"Envelope",meeting:"Notepad"},Po=({candidate:t,now:s,onTie:n})=>e.jsx("li",{children:e.jsxs("button",{type:"button",onClick:n,className:j("flex w-full items-center gap-2.5 rounded-lg px-2 py-1.5 text-left transition-colors duration-150","hover:bg-rb-parchment focus-visible:ring-2 focus-visible:ring-rb-gray-hovered focus-visible:outline-hidden focu
7s-visible:ring-inset motion-reduce:transition-none"),children:[e.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-rb-parchment text-rb-secondary-dark",children:e.jsx(w,{name:Mo[t.kind],size:14,className:"text-current"})}),e.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[e.jsx("span",{className:"truncate text-body-sm font-medium text-rb-darkbtn",children:t.title}),e.jsx("span",{className:"truncate text-label text-rb-secondary-dark",children:t.subtitle})]}),e.jsx("span",{className:"shrink-0 text-label text-rb-secondary-dark tabular-nums",children:Ue({date:t.sortedAt,now:s})})]})}),zo=({organisationId:t,now:s,onTie:n})=>{const r=Lo({organisationId:t});return e.jsxs("section",{"aria-labelledby":"tie-to-source-title",className:"flex flex-col gap-2 px-5 py-4 sm:px-6",children:[e.jsxs("div",{children:[e.jsx("h3",{id:"tie-to-source-title",className:"text-body-sm font-medium text-rb-darkbtn",children:"Tie it to a thread or meeting?"}),e.jsx("p",{className:"mt-0.5 text-body-sm text-rb-secondary-dark",children:"Then Fyxer can watch for the reply and clear it for you. Leave it loose and only you can tick it off."})]}),e.jsxs(Ms,{className:"w-full",searching:r.isSearching,children:[e.jsx(Ps,{value:r.query,onChange:a=>r.setQuery(a.target.value),placeholder:"Search emails and meetings","aria-label":"Search emails and meetings"}),r.query?e.jsx(zs,{onClick:()=>r.setQuery("")}):null]}),r.candidates.length>0?e.jsx("ul",{className:j("-mx-2 flex list-none flex-col transition-opacity duration-150 motion-reduce:transition-none",r.isSearching&&"opacity-50"),"aria-busy":r.isSearching,children:r.candidates.map(a=>e.jsx(Po,{candidate:a,now:s,onTie:()=>n(a.reference)},a.key))}):e.jsx("p",{className:"px-2 py-1.5 text-body-sm text-rb-secondary-dark",children:r.isSearching?"Searching…":r.hasError?"Couldn’t search right now. Try again in a moment.":"Nothing matches. Try a name or a subject."})]})},$o=t=>t instanceof HTMLElement&&(t.isContentEditable||["INPUT","TEXTAREA","SELECT"].includes(t.tagName)),Fo=()=>document.querySelector('[role="dialog"][data-open], [role="alertdialog"]')!==null,Bo=({isActive:t,onClose:s})=>{h.useEffect(()=>{if(!t)return;const n=r=>{r.key!=="Escape"||r.defaultPrevented||$o(r.target)||Fo()||s()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t,s])},Oe=({icon:t,label:s,filled:n,onClick:r})=>e.jsx(X,{label:s,children:e.jsx("button",{type:"button","aria-label":s,onClick:r,className:jt,children:e.jsx(w,{name:t,size:20,filled:n,className:j(n&&wt)})})}),Ho=({document:t,now:s,onClose:n,onResolve:r,onReopen:a,onDismiss:o,onStar:l,onUnstar:i,onSnooze:m})=>{const c=t.data,u=c.status===ye.OPEN;return e.jsxs("div",{className:"flex h-12 shrink-0 items-center border-b border-rb-gray-neutral px-1",children:[e.jsx(Oe,{icon:"ArrowLeft",label:"Back to the list",onClick:n}),e.jsx("div",{className:"flex-1"}),u?e.jsxs(e.Fragment,{children:[e.jsx(Oe,{icon:"Star",label:c.isPinned?"Unstar":"Star",filled:!!c.isPinned,onClick:()=>c.isPinned?i(t.id):l(t.id)}),e.jsx(Js,{item:c,now:s,placement:"bar",onSnooze:d=>m(t.id,d)}),e.jsx(qs,{placement:"bar",onDismiss:d=>o(t.id,d)}),e.jsx(Oe,{icon:"Check",label:"Mark as done",onClick:()=>r(t.id)})]}):e.jsx(Oe,{icon:"ArrowsClockwise",label:"Reopen",onClick:()=>a(t.id)})]})},Uo=({document:t,onChatAboutThis:s})=>{const n=t.data,r=n.references.find(o=>o.type==="EMAIL_THREAD"),a=Is({item:n,radarItemId:t.id,reference:r});return e.jsxs(G,{size:"md",onClick:()=>{var o,l;return s(Tr({item:n,emailReference:r,emailSubject:(o=a.message)==null?void 0:o.subject,emailConnectionId:((l=a.inboxTarget)==null?void 0:l.connectionId)??a.emailConnectionId}))},className:j("absolute right-5 bottom-5 z-10 w-auto rounded-full px-3.5 shadow-rb-shadow-soft-lg","max-sm:fixed max-sm:right-4 max-sm:bottom-[calc(env(safe-area-inset-bottom,0px)+12px)]"),children:[e.jsx(w,{name:"Sparkle",color:"current","data-icon":"inline-start"}),"Ask Fyxer"]})},Wo=()=>e.jsx(B,{className:"m-auto",children:e.jsxs(H,{children:[e.jsx(U,{children:e.jsx(w,{name:"ListChecks"})}),e.jsx(W,{children:"Nothing open"}),e.jsx(K,{children:"Pick an action to see where it came from and why it’s here."})]})}),Ko=()=>
7e.jsx(B,{className:"m-auto",children:e.jsxs(H,{children:[e.jsx(U,{children:e.jsx(w,{name:"Warning"})}),e.jsx(W,{children:"Couldn’t show this action"}),e.jsx(K,{children:"Something in it could not be displayed. Pick another row or reload the page."})]})}),Go=({document:t,now:s,onReopen:n,onResolve:r,onUnsnooze:a,onExplainDismissal:o,onSetUrgency:l,onSetAttentionBy:i,onSetDetail:m,onTie:c,onChatAboutThis:u})=>{const d=t.data,p=d.status===ye.OPEN,g=p&&d.snoozedUntil&&d.snoozedUntil>s?d.snoozedUntil:void 0,y=!p||g!==void 0,b=d.origin==="USER",x=d.references.length===0;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto pb-20",children:[e.jsx(Ka,{item:d,now:s,onSetUrgency:p?f=>l(t.id,f):void 0,onSetAttentionBy:p?f=>i(t.id,f):void 0,onSetDetail:p?f=>m(t.id,f):void 0}),p?null:e.jsx(La,{item:d,now:s,onReopen:()=>n(t.id),onResolve:()=>r(t.id),onExplainDismissal:f=>o({itemId:t.id,...f})}),g?e.jsx(Ga,{until:g,now:s,onUnsnooze:()=>a(t.id)}):null,e.jsx("div",{className:j(y&&"mt-3"),children:b&&x&&p?e.jsx(zo,{organisationId:d.organisationId,now:s,onTie:f=>c(t.id,f)}):e.jsx(_o,{document:t,now:s})})]}),e.jsx(Uo,{document:t,onChatAboutThis:u})]})},Xo=({document:t,now:s,className:n,onClose:r,onResolve:a,onReopen:o,onDismiss:l,onStar:i,onUnstar:m,onExplainDismissal:c,onSetUrgency:u,onSetAttentionBy:d,onSetDetail:p,onTie:g,onChatAboutThis:y,onSnooze:b,onUnsnooze:x,showsBar:f})=>(Bo({isActive:t!==null,onClose:r}),e.jsx("section",{"aria-label":"Action details",className:j("relative flex min-h-0 flex-col bg-rb-white",n),children:t?e.jsxs(e.Fragment,{children:[f?e.jsx(Ho,{document:t,now:s,onClose:r,onResolve:a,onReopen:o,onDismiss:l,onStar:i,onUnstar:m,onSnooze:b}):null,e.jsx(Nr,{fallback:e.jsx(Ko,{}),children:e.jsx(Go,{document:t,now:s,onReopen:o,onResolve:a,onUnsnooze:x,onExplainDismissal:c,onSetUrgency:u,onSetAttentionBy:d,onSetDetail:p,onTie:g,onChatAboutThis:y})},t.id)]}):e.jsx(Wo,{})})),bs={HIGH:{idle:"border-rb-error",checked:"border-rb-error bg-rb-error"},MEDIUM:{idle:"border-rb-warning",checked:"border-rb-warning bg-rb-warning"},LOW:{idle:"border-rb-gray-hovered",checked:"border-rb-secondary-dark bg-rb-secondary-dark"}},Vo={late:"font-medium text-rb-error",today:"font-medium text-rb-warning",plain:"text-rb-secondary-dark"},Yo={comfortable:"h-14",compact:"h-12 sm:h-10"},qo=({isSelected:t,isUnread:s})=>t?"bg-rb-parchment-dark before:absolute before:inset-y-0 before:left-0 before:w-0.5 before:bg-rb-darkbtn before:content-['']":s?"bg-rb-white hover:bg-rb-parchment-light":"bg-rb-parchment hover:bg-rb-parchment-dark/60",Qo="focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-rb-gray-hovered focus-visible:ring-offset-1",Jo=({title:t,description:s,urgency:n,attentionBy:r,now:a,dateCell:o,density:l,isStarred:i,isChecked:m,isSelected:c,isUnread:u,onToggleChecked:d,onToggleStarred:p,onDismiss:g,onSnooze:y,onSelect:b})=>{const x=l==="comfortable"&&!!s,[f,k]=h.useState(!1),[E,R]=h.useState(!1),S=f||E;return e.jsxs("div",{className:j("group relative grid grid-cols-[28px_minmax(0,1fr)] items-center gap-x-1 border-b border-rb-gray-neutral px-3 sm:grid-cols-[24px_minmax(0,1fr)]","transition-colors duration-150 motion-reduce:transition-none",Yo[l],qo({isSelected:c,isUnread:u})),children:[e.jsx(X,{label:m?"Mark as not done":"Mark as done",children:e.jsx("button",{type:"button",role:"checkbox","aria-checked":m,"aria-label":m?`Mark “${t}” as not done`:`Mark “${t}” as done`,onClick:d,className:j("relative z-10 flex size-4 items-center justify-center justify-self-center rounded-full border bg-rb-white shadow-rb-shadow-soft-sm","transition-colors duration-150 motion-reduce:transition-none",$s,Qo,m?bs[n].checked:j(bs[n].idle,"hover:bg-rb-parchment")),children:e.jsx(w,{name:"Check",size:10,color:"primary-white",className:j("transition-opacity duration-150 motion-reduce:transition-none",m?"opacity-100":"opacity-0")})})}),e.jsxs("button",{type:"button",onClick:b,"aria-current":c?"true":void 0,className:j("flex min-w-0 flex-col justify-center gap-0.5 pr-24 pl-1 text-left sm:pr-28","after:absolute after:inset-0 after:content-[''] focus-visible:outline-hidden focu
7s-visible:after:ring-2 focus-visible:after:ring-rb-gray-hovered focus-visible:after:ring-inset"),children:[e.jsxs("span",{className:j("min-w-0 truncate text-body tracking-[0.01em]","transition-colors duration-150 motion-reduce:transition-none",m?"text-rb-disabled line-through":u?"font-medium text-rb-darkbtn":c?"text-rb-darkbtn":"text-rb-sec group-hover:text-rb-darkbtn"),children:[t,u?e.jsx("span",{className:"sr-only",children:" (unread)"}):null]}),x?e.jsx("span",{className:j("truncate text-label",m?"text-rb-disabled line-through":"text-rb-secondary-dark"),children:s}):null]}),e.jsxs("div",{className:"pointer-events-none absolute top-1/2 right-2 z-10 flex -translate-y-1/2 items-center gap-0.5",children:[e.jsxs("div",{className:"grid items-center justify-items-end",children:[o?e.jsx(X,{label:o.full,children:e.jsx("span",{onClick:b,className:j("pointer-events-auto col-start-1 row-start-1 mr-1.5 text-label whitespace-nowrap tabular-nums","sm:group-focus-within:invisible sm:group-hover:invisible",S&&"sm:invisible",m?"text-rb-disabled":j(Vo[o.tone],u&&o.tone==="plain"&&"text-rb-darkbtn")),children:o.label})}):null,e.jsxs("div",{className:j("col-start-1 row-start-1 hidden items-center gap-0.5 sm:invisible sm:flex sm:group-focus-within:visible sm:group-hover:visible",S&&"sm:visible"),children:[e.jsx(qs,{placement:"row",label:`Dismiss “${t}”`,onDismiss:g,onOpenChange:k}),e.jsx(Js,{item:{attentionBy:r},now:a,placement:"row",onSnooze:y,onOpenChange:R})]})]}),e.jsx(X,{label:i?"Unstar":"Star",children:e.jsx("button",{type:"button","aria-pressed":i,"aria-label":i?`Unstar “${t}”`:`Star “${t}”`,onClick:p,className:j(kt,"hover:bg-transparent",m?"text-rb-gray-neutral hover:text-rb-gray-neutral":i?wt:"text-rb-gray-hovered hover:text-rb-secondary-dark"),children:e.jsx(w,{name:"Star",size:16,filled:i,className:"text-current"})})})]})]})},mt=({row:t,direction:s})=>{const n=s==="next"?t.nextElementSibling:t.previousElementSibling;if(n)return n.querySelector("button")??mt({row:n,direction:s})},Zo=t=>{var s;!t||!t.contains(document.activeElement)||(s=mt({row:t,direction:"next"})??mt({row:t,direction:"previous"}))==null||s.focus()},ei=250,ti=({isChecked:t,onCommit:s})=>{const[n,r]=h.useState(!1),a=h.useRef(),o=h.useRef(!1),l=h.useRef(s);l.current=s;const i=()=>{window.clearTimeout(a.current),o.current=!1},m=()=>{o.current&&(i(),l.current())},c=h.useRef(t);return h.useEffect(()=>{c.current!==t&&(c.current=t,i(),r(!1))},[t]),h.useEffect(()=>()=>m(),[]),{isChecked:n?!t:t,toggle:()=>{if(n){i(),r(!1);return}r(!0),o.current=!0,a.current=window.setTimeout(m,ei)}}},si=t=>t.detail?t.detail:t.origin==="USER"?"Added by you":void 0,nn=h.forwardRef(({document:t,now:s,density:n,animatesLayout:r,isSelected:a,isUnread:o,onResolve:l,onDismiss:i,onStar:m,onUnstar:c,onSnooze:u,onSelect:d},p)=>{const g=t.data,{isChecked:y,toggle:b}=ti({isChecked:g.status===ye.RESOLVED,onCommit:()=>l(t.id)}),x=h.useRef(null);h.useLayoutEffect(()=>()=>Zo(x.current),[]);const f=k=>{x.current=k,typeof p=="function"?p(k):p&&(p.current=k)};return e.jsx(ba.li,{ref:f,layout:r?"position":!1,initial:{opacity:0}
7,animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"shrink-0 list-none",children:e.jsx(Jo,{title:g.title,description:si(g),urgency:g.urgency,attentionBy:g.attentionBy,now:s,dateCell:Ea({attentionBy:g.attentionBy,now:s}),density:n,isStarred:!!g.isPinned,isChecked:y,isSelected:a,isUnread:o,onToggleChecked:b,onToggleStarred:()=>g.isPinned?c(t.id):m(t.id),onDismiss:k=>i(t.id,k),onSnooze:k=>u(t.id,k),onSelect:()=>d(t.id)})})});nn.displayName="ActionListItem";const ni="flex h-10 w-full items-center px-3 text-label font-medium text-rb-darkbtn underline underline-offset-2 transition-colors duration-150 hover:bg-rb-parchment-light focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-rb-gray-hovered disabled:cursor-not-allowed disabled:text-rb-disabled motion-reduce:transition-none",rn={snoozed:{heading:"Snoozed",reopenTooltip:"Bring back now",reopenLabel:t=>`Bring “${t}” back now`},completed:{heading:"Completed",reopenTooltip:"Mark as not done",reopenLabel:t=>`Mark “${t}” as not done`},dismissed:{heading:"Dismissed",reopenTooltip:"Put back on the list",reopenLabel:t=>`Put “${t}” back on the list`}},ri=({variant:t})=>{switch(t){case"snoozed":return e.jsx(w,{name:"Clock",size:10,color:"secondary-dark"});case"completed":return e.jsx(w,{name:"Check",size:10,color:"primary-white"});case"dismissed":return e.jsx(w,{name:"X",size:10,color:"secondary-dark"});default:return fe(t)}},ai=({variant:t,item:s,now:n})=>{switch(t){case"snoozed":return{text:s.snoozedUntil?`Until ${ft({until:s.snoozedUntil,now:n})}`:"",tone:"muted"};case"completed":return Ca({item:s,now:n});case"dismissed":return{text:Ra({item:s,now:n}),tone:"muted"};default:return fe(t)}},oi=({variant:t,document:s,now:n,isSelected:r,onSelect:a,onReopen:o})=>{const l=s.data,i=rn[t],m=ai({variant:t,item:l,now:n});return e.jsxs("li",{className:j("group relative grid h-12 grid-cols-[28px_minmax(0,1fr)_auto] items-center gap-x-1 border-b border-rb-gray-neutral px-3 sm:h-10 sm:grid-cols-[24px_minmax(0,1fr)_auto] sm:gap-x-0.5","transition-colors duration-150 motion-reduce:transition-none",r?"bg-rb-parchment-dark":"hover:bg-rb-parchment-light"),children:[e.jsx(X,{label:i.reopenTooltip,children:e.jsx("button",{type:"button",role:t==="completed"?"checkbox":void 0,"aria-checked":t==="completed"?!0:void 0,"aria-label":i.reopenLabel(l.title),onClick:()=>
7o(s.id),className:j("relative z-10 flex size-4 items-center justify-center justify-self-center rounded-full border shadow-rb-shadow-soft-sm","transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-rb-gray-hovered focus-visible:ring-offset-1 focus-visible:outline-hidden motion-reduce:transition-none",t==="completed"?"border-rb-darkbtn bg-rb-darkbtn hover:border-rb-sec hover:bg-rb-sec":"border-rb-gray-neutral bg-rb-parchment hover:border-rb-gray-hovered hover:bg-rb-gray-neutral",$s),children:e.jsx(ri,{variant:t})})}),e.jsx("button",{type:"button",onClick:()=>a(s.id),"aria-current":r?"true":void 0,className:j("min-w-0 truncate pl-1.5 text-left text-body-sm tracking-[0.01em] after:absolute after:inset-0 after:content-[''] focus-visible:outline-hidden focus-visible:after:ring-2 focus-visible:after:ring-rb-gray-hovered focus-visible:after:ring-inset",t==="snoozed"?"text-rb-secondary-dark":"text-rb-disabled",t==="completed"&&"line-through"),children:l.title}),e.jsx("span",{className:j("px-1.5 text-label whitespace-nowrap tabular-nums",m.tone==="ok"?"text-rb-success":"text-rb-disabled"),children:m.text})]})},it=({variant:t,items:s,totalLabel:n,page:r,now:a,isOpen:o,selectedItemId:l,onToggle:i,onSelect:m,onReopen:c,onLoadNextPage:u})=>e.jsxs("div",{className:"flex min-h-10 shrink flex-col border-t border-rb-gray-neutral",children:[e.jsxs("button",{type:"button","aria-expanded":o,onClick:i,className:"flex h-10 w-full shrink-0 items-center gap-1.5 px-3 text-body-sm font-medium text-rb-secondary-dark transition-colors duration-150 hover:bg-rb-parchment-light focus-visible:ring-2 focus-visible:ring-rb-gray-hovered focus-visible:outline-hidden focus-visible:ring-inset motion-reduce:transition-none",children:[e.jsx(w,{name:"CaretRight",size:12,color:"secondary-dark",className:j("transition-transform duration-150 motion-reduce:transition-none",o&&"rotate-90")}),rn[t].heading,e.jsx("span",{className:"text-rb-disabled tabular-nums",children:n})]}),o?e.jsxs("ul",{className:"min-h-0 list-none overflow-y-auto border-t border-rb-gray-neutral p-0 xl:overscroll-contain",children:[s.map(d=>e.jsx(oi,{variant:t,document:d,now:a,isSelected:d.id===l,onSelect:m,onReopen:c},d.id)),r.hasUnloadedPage?e.jsx("li",{children:e.jsx("button",{type:"button",onClick:u,disabled:r.isLoadingPage,"aria-busy":r.isLoadingPage,className:ni,children:"Show older"})}):null]}):null]}),ii=({onSubmit:t,onCancel:s})=>{const[n,r]=h.useState(""),[a,o]=h.useState(!1),l=h.useRef(),i=n.trim(),m=async()=>{if(!(!i||l.current)){o(!0),l.current=t({title:i,attentionBy:void 0});try{await l.current,r(""),s()}catch{}finally{l.current=void 0,o(!1)}}};return e.jsxs("div",{className:j("grid h-12 shrink-0 items-center gap-x-2 border-b border-rb-gray-neutral bg-rb-parchment-light px-3 sm:h-10","grid-cols-[28px_minmax(0,1fr)] sm:grid-cols-[24px_minmax(0,1fr)_auto]"),children:[e.jsx("span",{"aria-hidden":"true",className:"size-4 justify-self-center rounded-full border border-rb-gray-hovered bg-rb-white shadow-rb-shadow-soft-sm"}
7),e.jsx("input",{autoFocus:!0,type:"text",value:n,maxLength:$r,placeholder:"What do you need to do?","aria-label":"New action",disabled:a,onChange:c=>r(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),m()),c.key==="Escape"&&(c.preventDefault(),s())},className:"h-8 min-w-0 bg-transparent pl-1.5 text-body tracking-[0.01em] text-rb-darkbtn outline-hidden placeholder:text-rb-secondary-dark disabled:text-rb-disabled"}),e.jsx("span",{className:"hidden text-label whitespace-nowrap text-rb-disabled sm:inline",children:"↵ add · esc cancel"})]})},li=[{widthClassName:"w-[62%]",opacityClassName:"opacity-70"},{widthClassName:"w-[48%]",opacityClassName:"opacity-50"},{widthClassName:"w-[70%]",opacityClassName:"opacity-30"}],ci="rounded bg-rb-orange-neutral/20 px-0.5 text-rb-darkbtn",di={HIGH:"border-rb-error",MEDIUM:"border-rb-warning"},lt=({urgency:t})=>e.jsx("span",{"aria-hidden":"true",className:j("size-3.5 shrink-0 rounded-full border bg-rb-white",di[t])}),ui=()=>e.jsxs("div",{"aria-hidden":"true",className:"relative h-[172px] w-full shrink-0 overflow-hidden",children:[e.jsxs("div",{className:"absolute top-[28px] left-1/2 w-[340px] max-w-[calc(100%-32px)] [transform:translateX(calc(-50%-78px))_rotate(-6deg)] rounded-[10px] border border-rb-gray-neutral bg-rb-white px-3.5 py-3 opacity-35 shadow-[0_8px_24px_rgba(0,0,0,0.06)]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(lt,{urgency:"MEDIUM"}),e.jsx("span",{className:"text-[12.5px] text-rb-darkbtn",children:"Send Omar the Q4 deck before the call"})]}),e.jsx("div",{className:"mt-1.5 ml-[22px] text-[11.5px] text-rb-secondary-dark",children:"From Omar’s email, 08:05 · due tomorrow"})]}),e.jsxs("div",{className:"absolute top-[46px] left-1/2 w-[340px] max-w-[calc(100%-32px)] [transform:translateX(calc(-50%+66px))_rotate(4deg)] rounded-[10px] border border-rb-gray-neutral bg-rb-white px-3.5 py-3 opacity-60 shadow-[0_8px_24px_rgba(0,0,0,0.06)]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(lt,{urgency:"HIGH"}),e.jsx("span",{className:"text-[12.5px] text-rb-darkbtn",children:"Send Yusuf the renewal quote"})]}),e.jsx("div",{className:"mt-1.5 ml-[22px] text-[11.5px] text-rb-secondary-dark",children:"You said it on the Brightline call, Tue 11:14"})]}),e.jsxs("div",{className:"absolute top-[66px] left-1/2 w-[340px] max-w-[calc(100%-32px)] -translate-x-1/2 rounded-[10px] border border-rb-gray-neutral bg-rb-white px-3.5 py-3 shadow-[0_12px_32px_rgba(0,0,0,0.08)]",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(lt,{urgency:"HIGH"}),e.jsx("span",{className:"text-[12.5px] text-rb-darkbtn",children:"Reply to Lena at Kite on the renewal terms"}),e.jsx("span",{className:"flex-1"}),e.jsx("span",{className:"text-[11.5px] font-medium text-rb-error",children:"2d late"})]}),e.jsxs("div",{className:"mt-2 ml-[22px] text-[11.5px] leading-[1.5] text-rb-sec",children:["“",e.jsx("mark",{className:ci,children:"Could you confirm whether the 3-year tier includes the onboarding credits"}),", and what the notice period is?”"]})]}),e.jsx("div",{className:"absolute inset-0 bg-[linear-gradient(180deg,transparent_55%,color-mix(in_srgb,var(--color-rb-white)_80%,transparent)_85%,var(--color-rb-white)_100%)]"})]}),mi=()=>e.jsxs("div",{className:"shrink-0 px-[18px] pt-[22px] pb-2.5",role:"status","aria-live":"polite",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("span",{"aria-hidden":"true",className:"size-2 rounded-full bg-rb-orange-neutral"}),e.jsx("span",{className:"text-[13.5px] font-medium text-rb-darkbtn",children:"Reading your inbox and meetings"})]}),e.jsx(xa,{value:null,"aria-hidden":!0,className:"mt-2.5 ml-[18px] w-auto **:data-[slot=progress-indicator]:bg-primary! **:data-[slot=progress-indicator]:bg-none! *:data-[slot=progress-track]:h-1"}),e.jsx("p",{className:"mt-2 ml-[18px] text-[12.5px] leading-[1.45] text-rb-secondary-dark",children:"Your first actions appear here as they’re found. This usually takes a couple of minutes."})]}),hi=()=>e.jsx("ul",{"aria-hidden":"true",className:"flex list-none flex-col p-0",children:li.map(t=>e.jsxs("li",{className:j("grid h-12 grid-cols-[24px_minmax(0,1fr)] items-center gap-x-2 border-b border-rb-gray-neutral px-3 sm:h-10",t.opacityClassName),children:[e.jsx("span",{className:"size-4 justify-self-center rounded-full border border-rb-gray-neutral bg-rb-white"}),e.jsx("span",{className:j("h-2.5 rounded-full bg-rb-parchment",t.widthClassName)})]},t.widthClassName))}),bi=()=>e.jsxs("div",{className:"flex flex-1 flex-col items-center justify-start pt-0 pb-6",children:[e.jsx(ui,{}),e.jsxs("div",{className:"px-8 pt-0.5 text-center",children:[e.jsx("h3",{className:"text-title font-medium tracking-[-0.01em] text-rb-darkbtn",children:"Nothing you said slips"}),e.jsx("p",{className:"mx-auto mt-2 max-w-[400px] text-[13.5px] leading-[1.55] text-pretty text-rb-secondary-dark",children:"Fyxer reads your email and meetings, finds what you owe people and what they owe you, and clears each one when it’s done."})]})]}),an=t=>Xr.string().email().safeParse(t).success,xi=6e4,pi=({organisationId:t,exclusions:s})=>{const n=pt(),r=[...new Set(s.map(a=>`${a.kind}:${a.value.toLowerCase()}`))].sort();return gt({queryKey:["radar-exclusion-preview",t,r],queryFn:()=>n.organisations.id(t).radarItems.exclusions.preview(s),staleTime:xi,placeholderData:Rs})},fi=8,ht=[{value:"domain",label:"Domain",shortLabel:"Domain",icon:"Buildings"},{value:"email",label:"Email address",shortLabel:"Email",icon:"User"},{value:"subject",label:"Emails with subject containing",shortLabel:"Subject containing",icon:"Notepad"}],gi={domain:"newsletters.example.com",email:"[email protected]",subject:"e.g. Weekly digest"},yi={domain:"Domain to leave out",email:"Email address to leave out",subject:"Subject phrase to leave out"},ji={domain:"Enter a domain such as example.com.",email:"Enter a full email address.",subject:`Enter at least ${ks} characters.`},he=t=>`${t.kind}:${t.value.toLowerCase()}`,vi=t=>{const s=t.replace(/^@+/,"");if(s.includes("@")&&!an(s))return;const n=lr(s.slice(s.lastIndexOf("@")+1));return cr(n)?n:void 0},Ni=({kind:t,raw:s})=>{const n=s.trim();if(n)return t==="email"?an(n)?n.toLowerCase():void 0:t==="subject"?n.length>
7=ks?n:void 0:vi(n)},on=t=>t.kind==="domain"?`@${t.value}`:t.kind==="subject"?`“${t.value}”`:t.value,Et=t=>ht.find(s=>s.value===t)??ht[0],bt=(t,s)=>n=>n.key!=="Escape"||!t?!1:(n.preventDefault(),s(),!0),ki=({kind:t,onSelect:s})=>{const[n,r]=h.useState(!1),a=Et(t),o=bt(n,()=>r(!1));return e.jsxs(le,{open:n,onOpenChange:r,modal:!1,children:[e.jsx(je,{render:e.jsxs("button",{type:"button",onKeyDown:o,className:j("inline-flex shrink-0 items-center gap-1 rounded-full border border-rb-gray-neutral bg-rb-parchment py-1 pr-1.5 pl-2 text-label font-medium text-rb-black transition-colors","hover:border-rb-gray-hovered hover:bg-rb-white disabled:text-rb-disabled",{"border-rb-black bg-rb-white":n}),"aria-label":"What to leave out by","aria-haspopup":"listbox",children:[e.jsx(w,{name:a.icon,size:12,className:"shrink-0"}),e.jsx("span",{children:a.shortLabel}),e.jsx(w,{name:n?"CaretUp":"CaretDown",size:12,color:"secondary-dark"})]})}),e.jsx(ve,{role:"listbox",align:"start",side:"bottom",sideOffset:4,className:"z-100 min-w-[240px] p-1",onKeyDown:o,initialFocus:!1,finalFocus:!1,children:ht.map(l=>{const i=l.value===t;return e.jsxs("button",{type:"button",role:"option","aria-selected":i,onClick:()=>{s(l.value),r(!1)},className:j("flex w-full items-center gap-1.5 rounded-sm px-2 py-1.5 text-left text-label font-medium text-rb-black transition-colors",i?"bg-rb-parchment":"hover:bg-rb-parchment"),children:[e.jsx(w,{name:l.icon,size:12,className:"shrink-0"}),e.jsx("span",{className:"min-w-0 flex-1",children:l.label}),i?e.jsx(w,{name:"Check",size:12,className:"shrink-0"}):null]},l.value)})})]})},wi=t=>{const s=new Map;return t.forEach(n=>{const r=n.address.slice(n.address.lastIndexOf("@")+1);r&&s.set(r,(s.get(r)??0)+n.count)}),s},Ei=({kind:t,senders:s,query:n})=>{if(t==="subject")return[];const r=n.trim().toLowerCase();return(t==="domain"?[...wi(s)].map(([o,l])=>({kind:t,value:o,title:`@${o}`,count:l})):s.map(o=>({kind:t,value:o.address,title:o.name||o.address,count:o.count}))).filter(o=>!r||`${o.title} ${o.value}`.toLowerCase().includes(r)).sort((o,l)=>l.count-o.count||o.value.localeCompare(l.value))},xs=t=>`${t} ${t===1?"email":"emails"} this week`,Ii=()=>e.jsxs("div",{className:"flex h-4 items-center gap-2","aria-hidden":"true",children:[e.jsx("div",{className:"h-px min-w-0 flex-1 bg-rb-gray-neutral"}),e.jsx("span",{className:"shrink-0 text-label leading-none font-medium text-rb-secondary-dark",children:"or"}),e.jsx("div",{className:"h-px min-w-0 flex-1 bg-rb-gray-neutral"})]}),Si=({exclusion:t,onRemove:s})=>{const n=Et(t.kind);return e.jsxs("div",{className:"flex h-8 items-center gap-2 px-3",children:[e.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 text-label font-medium text-rb-secondary-dark",children:[e.jsx(w,{name:n.icon,size:12,className:"shrink-0"}),n.shortLabel]}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-body font-medium text-rb-black",children:on(t)}),e.jsx("button",{type:"button",onClick:s,"aria-label":`Remove ${n.shortLabel} ${t.value}`,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-sm text-rb-secondary-dark transition-colors hover:bg-rb-parchment hover:text-rb-black disabled:text-rb-disabled",children:e.jsx(w,{name:"X",size:12})})]})},Ci=t=>{if(t.consideredCount===0)return t.isPartial?"Fyxer couldn’t count last week’s emails yet, so there are no suggestions.":`No emails from the last ${t.windowDays} days to count yet.`;const s=t.consideredCount===1?"email":"emails";return t.isPartial?`These rules would have left out ${t.leftOutCount} of the ${t.consideredCount} ${s} we could count from the last ${t.windowDays} days.`:`These rules would have left out ${t.leftOutCount} of ${t.consideredCount} ${s} from the last ${t.windowDays} days.`},Ri=({exclusions:t,onChange:s,inputId:n,hintId:r})=>{var $;const{organisationId:a}=Ns(),[o,l]=h.useState("domain"),[i,m]=h.useState(""),[c,u]=h.useState(!1),[d,p]=h.useState(!1),g=h.useRef(null),y=h.useRef(null),b=pi({organisationId:a,exclusions:t}),x=N=>t.some(A=>he(A)===he(N)),f=Ni({kind:o,raw:i}),k=f!==void 0&&!x({kind:o,value:f}),E=Ei({kind:o,senders:(($=b.data)==null?void 0:$.senders)??[],query:i}).filter(N=>!x(N)&&N.value!==f).slice(0,fi),R=t.length>=Jt,S=d&&!R&&(E.length>0||k),I=N=>{R||(x(N)||s([...t,N]),m(""),u(!1),p(!1))},C=()=>
7{if(f!==void 0){I({kind:o,value:f});return}if(E.length===1){I(E[0]);return}u(!0)},z=N=>{var A;I({kind:N.kind,value:N.value}),(A=g.current)==null||A.focus()},T=N=>s(t.filter(A=>he(A)!==he(N))),D=N=>{l(N),m(""),u(!1),p(!1)};return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs(le,{open:S,onOpenChange:(N,A)=>{var _;const F=A.event.target;if(A.reason==="outside-press"&&F instanceof Node&&((_=y.current)!=null&&_.contains(F))){A.cancel();return}p(N)},modal:!1,children:[e.jsxs("div",{ref:y,className:j("flex items-center gap-2 rounded-lg border bg-rb-white px-2 py-1.5 shadow-rb-shadow-soft-xs transition-[border-color,box-shadow]",c?"border-rb-error":"border-rb-gray-neutral focus-within:border-rb-darkbtn"),children:[e.jsx(ki,{kind:o,onSelect:D}),e.jsx("input",{ref:g,id:n,"aria-label":yi[o],"aria-describedby":r,maxLength:or,value:i,placeholder:gi[o],autoComplete:"off",spellCheck:!1,onChange:N=>{m(N.target.value),u(!1),p(!0)},onFocus:()=>p(!0),onKeyDown:N=>{if(!bt(S,()=>p(!1))(N)){if(N.key==="ArrowDown"){N.preventDefault(),p(!0);return}N.key==="Enter"&&(N.preventDefault(),C())}},className:"h-7 min-w-0 flex-1 border-none bg-transparent p-0 text-body text-rb-black outline-hidden placeholder:text-rb-secondary-dark disabled:text-rb-disabled"}),e.jsx(G,{size:"sm",disabled:!i.trim()||R,onMouseDown:N=>N.preventDefault(),onClick:C,children:"Add"})]}),e.jsx(ir,{anchor:y,role:"listbox",className:"z-100 w-(--anchor-width) max-w-[calc(100vw-48px)] p-0",align:"start",onKeyDown:bt(S,()=>p(!1)),initialFocus:!1,finalFocus:!1,children:e.jsxs("div",{className:"max-h-[280px] overflow-y-auto overscroll-contain p-1",children:[E.length>0?e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"px-3 pt-2 pb-1 text-label font-medium text-rb-secondary-dark",children:o==="domain"?"Domains that emailed you this week":"People who emailed you this week"}),E.map(N=>e.jsxs("button",{type:"button",onMouseDown:A=>A.preventDefault(),onClick:()=>z(N),className:"flex w-full cursor-pointer items-center gap-3 rounded-lg px-3 py-2 text-left outline-hidden hover:bg-rb-parchment",children:[e.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-rb-parchment",children:e.jsx(w,{name:N.kind==="domain"?"Buildings":"User",size:16,color:"secondary-dark"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"m-0 truncate text-body font-medium text-rb-black",children:N.title}),e.jsx("p",{className:"m-0 truncate text-label text-rb-secondary-dark",children:N.kind==="domain"?`Anyone @${N.value} · ${xs(N.count)}`:`Only ${N.value} · ${xs(N.count)}`})]})]},N.value))]}):null,k&&f!==void 0?e.jsxs("button",{type:"button",onMouseDown:N=>N.preventDefault(),onClick:C,className:"flex w-full cursor-pointer items-center gap-3 rounded-lg px-3 py-2 text-left outline-hidden hover:bg-rb-parchment",children:[e.jsx("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-rb-parchment",children:e.jsx(w,{name:Et(o).icon,size:16,color:"secondary-dark"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("p",{className:"m-0 truncate text-body font-medium text-rb-black",children:["Add ",on({kind:o,value:f})]}),o==="subject"?e.jsx("p",{className:"m-0 truncate text-label text-rb-secondary-dark",children:"Any email whose subject contains this"}):null]})]}):null]})})]}),c?e.jsx("label",{className:"text-label text-rb-error",children:ji[o]}):null,R?e.jsxs("label",{className:"text-label text-rb-secondary-dark",children:["You can have up to ",Jt," rules. Remove one to add another."]}):null,t.length>0?e.jsx("ul",{className:"m-0 flex list-none flex-col overflow-hidden rounded-lg border border-rb-gray-neutral bg-rb-white p-0 py-2",children:t.map((N,A)=>e.jsxs("li",{className:"flex flex-col",children:[A>0?e.jsx(Ii,{}):null,e.jsx(Si,{exclusion:N,onRemove:()=>T(N)})]},he(N)))}):null,e.jsx("label",{className:"text-label text-rb-secondary-dark",children:b.data?Ci(b.data):b.isPending?"Counting last week’s emails…":""})]})},Ti="e.g. Anything a client or candidate is waiting on comes first. Internal admin can wait. Don’t track newsletters or booking confirmations.",Di=100,Ai=[],_i=t=>{const s=gr.safeParse(t);return s.success?[s.data]:[]},Oi=(t,s)=>t.length===s.length&&t.every((n,r)=>n.kind===s[r].kind&&n.value===s[r].value),Li=()=>document.querySelector('[role="listbox"][data-open]')!==null,Mi=({open:t,onOpenChange:s})=>{var z;const{userMembership:n}=Ns(),{updateMembershipRadarSettings:r}=fa(),a=Fe(),o=((z=n.data().radar)==null?void 0:z.instructions)??"",l=h.useMemo(()=>{var T;return(((T=n.data().radar)==null?void 0:T.exclusions)??Ai).flatMap(_i)},[n]),[i,m]=h.useState(o),[c,u]=h.useState(l),[d,p]=h.useState(!1),[g,y]=h.useState(!1),b=h.useId(),x=h.useId(),f=h.useId(),k=h.useId(),E=h.useRef({instructions:o,exclusions:l});E.current={instructions:o,exclusions:l},h.useEffect(()=>{t&&(m(E.current.instructions),u(E.current.exclusions),y(!1))},[t]);const R=i.trim()!==o.trim()||!Oi(c,l),S=ss-i.length,I=(T,D)=>{if(!d){if((D==null?void 0:D.reason)==="escape-key"&&Li()){D.cancel();return}if(T||!R){s(T);return}y(!0)}},C=async()=>{p(!0);const T=i.trim();try{await r({instructions:T,exclusions:c}),a(ie.RADAR_SETTINGS_SAVED,{has_instructions:T.length>0,instructions_length:T.length,exclusion_count:c.length,exclusion_kinds:[...new Set(c.map(D=>D.kind))]}),yr.success({title:"Settings saved",description:"Fyxer follows them from its next check."}),s(!1)}catch{jr({action:"save your settings",onRetry:()=>void C()})}finally{p(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(ga,{open:t,onOpenChange:I,children:e.jsxs(ya,{side:"right",className:"sm:max-w-[480px]!",children:[e.jsx(ja,{children:e.jsx(va,{children:"Action item settings"})}),e.jsxs(Na,{className:"flex flex-col gap-3",children:[e.jsxs(Zt,{children:[e.jsx(es,{htmlFor:b,children:"How Fyxer judges your actions"}),e.jsx(nt,{id:x,children:"What belongs on your list and what comes first. Fyxer reads this every time it checks your inbox and meetings."}),e.jsx(Ts,{id:b,"aria-describedby":x,rows:6,value:i,disabled:d,maxLength:ss,placeholder:Ti,onChange:T=>m(T.target.value)}),S<=Di?e.jsxs(nt,{className:"text-right",children:[S," characters left"]}):null]}),e.jsxs(Zt,{className:"mt-3",children:[e.jsx(es,{htmlFor:f,children:"Emails to leave out"}),e.jsx(nt,{id:k,children:"Fyxer skips these when it looks for actions. Actions already on your list stay until you tick or dismiss them."}),e.jsx("fieldset",{disabled:d,className:"contents",children:e.jsx(Ri,{exclusions:c,onChange:u,inputId:f,hintId:k})})]})]}),e.jsxs(ka,{children:[e.jsx(G,{size:"md",disabled:d,onClick:()=>I(!1),children:"Cancel"}),e.jsx(G,{variant:"brand",size:"md",disabled:!R||d,onClick:()=>void C(),children:d?"Saving…":"Save"})]})]})}),e.jsx(dr,{open:g,onOpenChange:y,children:e.jsxs(ur,{children:[e.jsxs(mr,{children:[e.jsx(hr,{children:"Discard unsaved changes?"}),e.jsx(br,{children:"What you typed will be lost if you close this panel."})]}),e.jsxs(xr,{children:[e.jsx(pr,{children:"Keep editing"}),e.jsx(fr,{onClick:()=>{y(!1),s(!1)},children:"Discard changes"})]})]})})]})},ln=j(Pe.item,"group/radio gap-2.5 hover:bg-rb-parchment-light focus-visible:ring-2 focus-visible:ring-rb-gray-hovered"),Pi={comfortable:"Comfortable",compact:"Compact"},ps=({label:t,options:s})=>{const n=h.useId();return e.jsxs("div",{role:"radiogroup","aria-labelledby":n,className:"flex flex-col gap-0.5",children:[e.jsx("span",{id:n,className:"px-2 pt-1.5 pb-1 text-caption font-medium tracking-[0.04em] text-rb-secondary-dark uppercase",children:t}),s.map(r=>e.jsxs("button",{type:"button",role:"radio","aria-checked":r.checked,onClick:r.onSelect,className:ln,children:[e.jsx(pa,{checked:r.checked}),r.label]},r.label))]})}
7,zi=({viewOptions:t,canChooseReadingPane:s,onChange:n})=>{const[r,a]=h.useState(!1),[o,l]=h.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(Mi,{open:o,onOpenChange:l}),e.jsxs(le,{open:r,onOpenChange:a,children:[e.jsx(je,{render:e.jsx(xe,{icon:"Sliders",iconColor:"secondary-dark",label:"View options",size:"big","aria-expanded":r,className:j(r&&"bg-rb-parchment-light")})}),e.jsxs(ve,{align:"end",sideOffset:6,className:j("w-56"),children:[s?e.jsx(ps,{label:"Reading pane",options:[{label:"Right of the list",checked:t.readingPane,onSelect:()=>n({readingPane:!0})},{label:"Off",checked:!t.readingPane,onSelect:()=>{n({readingPane:!1}),a(!1)}}]}):null,e.jsx(ps,{label:"Density",options:Dr.map(i=>({label:Pi[i],checked:t.density===i,onSelect:()=>n({density:i})}))}),e.jsx("div",{className:"my-0.5 border-t border-rb-gray-neutral"}),e.jsxs("button",{type:"button",className:ln,onClick:()=>{a(!1),l(!0)},children:[e.jsx(w,{name:"Gear",size:16,className:"text-current"}),"Action item settings…"]})]})]})]})},$i=600,Fi="flex h-10 w-full items-center border-b border-rb-gray-neutral px-3 text-label font-medium text-rb-darkbtn underline underline-offset-2 transition-colors duration-150 hover:bg-rb-parchment-light focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-rb-gray-hovered disabled:cursor-not-allowed disabled:text-rb-disabled motion-reduce:transition-none",Le=({document:t,query:s})=>s===""||t.data.title.toLowerCase().includes(s),Me=h.forwardRef(({children:t},s)=>e.jsx("li",{ref:s,className:"flex h-7 shrink-0 items-center gap-1.5 border-b border-rb-gray-neutral bg-rb-parchment-light px-3 text-label font-medium text-rb-secondary-dark",children:t}));Me.displayName="GroupCaption";const fs=({variant:t,icon:s,message:n,actionLabel:r,onAction:a,onDismiss:o})=>e.jsxs(js,{variant:t,className:"shrink-0 rounded-none border-x-0 border-t-0",children:[e.jsx(w,{name:s}),e.jsx(vs,{children:n}),a?e.jsx("div",{className:"mt-2 group-has-[>svg]/alert:col-start-2",children:e.jsx(G,{size:"sm",onClick:a,children:r})}):null,o?e.jsx(vr,{children:e.jsx(Es,{icon:"X",label:"Dismiss message",variant:"ghost",onClick:o})}):null]}),Bi=({variant:t})=>e.jsx(B,{children:e.jsxs(H,{children:[e.jsx(U,{children:e.jsx(w,{name:"ListChecks"})}),e.jsx(W,{children:t==="all_caught_up"?"You’re all caught up":"All clear"}),e.jsx(K,{children:t==="all_caught_up"?"As emails and meetings come in, the actions you can’t afford to miss will show up here.":"Nice work. You’re done with the most important priorities for today."})]})}),Hi=({openItems:t,openPage:s,resolvedItems:n,resolvedPage:r,dismissedItems:a,dismissedPage:o,snoozedItems:l,selectedItemId:i,isItemUnread:m,now:c,requiresInboxConnection:u,areItemsLoading:d,errorMessage:p,onRetry:g,onDismissError:y,onLoadNextOpenPage:b,onLoadNextResolvedPage:x,onLoadNextDismissedPage:f,onResolve:k,onReopen:E,onDismiss:R,onStar:S,onUnstar:I,onSnooze:C,onUnsnooze:z,onOpenContext:T,hasEmailConnection:D,hasCalendarConnection:$,hasActiveCalendarConnection:N,hasNeverHadActions:A,hasForwardingConnection:F,isForwardingStatusUnresolved:_,emailConnectionIssue:O,onViewPlans:It,onReconnectInbox:St,onReconnectCalendar:cn,emailIntegration:Ct,calendarIntegration:Rt,redirectingEmailIntegration:Tt,redirectingCalendarIntegration:Dt,onConnectEmail:At,onConnectCalendar:_t,isSweeping:we,isOnCooldown:dn,refreshOffersUpgrade:un,onTriggerSweep:mn,onCreate:hn,isPreparingPriorities:ce,didPreparationFail:Ke,showProductIntro:Ot,viewOptions:de,canChooseReadingPane:bn,onChangeViewOptions:xn,className:pn,style:fn})=>{const gn=Fr("topPriorities"),{isSeatLocked:yn}=ma("emailConnection"),ue=Fe(),ne=ws(),[re,Lt]=h.useState(""),[Ge,Mt]=h.useState(!1),[Xe,Pt]=h.useState(!1),[zt,jn]=h.useState([]),[$t,Ft]=h.useState(),[vn,Nn]=h.useState(!1),[kn,wn]=h.useState(!1),[En,In]=h.useState(!1),Ve=h.useRef(),Bt=h.useRef(de.density),Sn=Bt.current!==de.density;h.useEffect(()=>{Bt.current=de.density});const V=re.trim().toLowerCase(),Y=V!=="",q=t.filter(v=>Le({document:v,query:V})),Ht=[...$t?t.filter(v=>v.data.origin==="USER"&&!$t.includes(v.id)&&!zt.includes(v.id)).map(v=>v.id):[],...zt],Ye=Ht.flatMap(v=>q.find(Z=>Z.id===v)??[]),Ut=q.filter(v=>!Ht.includes(v.id)),qe=Ut.filter(v=>v.data.isPinned),Wt=Ut.filter(v=>!v.data.isPinned),Ee=n.filter(v=>Le({document:v,query:V})),Ie=a.filter(v=>Le({document:v,query:V})),Se=l.filter(v=>Le({document:v,query:V})),Qe=Se.length+Ee.length+Ie.length,Cn=!ne||Ge,ae=D||$||F||_,Kt=!!O&&!(F||_),Je=Kt&&t.length===0,Q=ae&&!Je&&!u,Rn=ae&&!O&&!u&&!ce,Tn=Ke&&we,Ce=!p&&t.length===0&&(ce||d||Tn),Ze=!N&&(D||F)&&!p&&!d&&t.length===0,J=!p&&!d&&!ce&&!Ke&&!u&&!Ze&&!O&&t.length===0?A?"all_caught_up":"all_clear":void 0,et=Q&&!Ce,Dn=ce&&!p&&ae&&!u&&!O,An=et&&Se.length>0,_n=et&&(Y?Ee.length>0||r.hasUnloadedPage:n.length>0),On=et&&(Y?Ie.length>0||o.hasUnloadedPage:a.length>0),Ln=`${(Y?Ee:n).length}${r.hasUnloadedPage?"+":""}`,Mn=`${(Y?Ie:a).length}${o.hasUnloadedPage?"+":""}`,oe=Y&&q.length===0,Gt=vn||oe,Xt=kn||oe,Vt=En||oe;h.useEffect(()=>{if(!J){Ve.current=void 0;return}Ve.current!==J&&(Ve.current=J,ue(ie.RADAR_ACTION_EMPTY_VIEWED,{variant:J}))},[J,ue]);const Yt=q.length+Qe;h.useEffect(()=>{if(!Y)return;const v=window.setTimeout(()=>ue(ie.RADAR_ACTION_FILTERED,{query_length:Br(V.length),match_count:Yt}),$i);return()=>window.clearTimeout(v)},[Y,ue,Yt,V]);const tt=v=>ue(ie.RADAR_ACTION_LIST_VIEWED,{status:v,open_count:t.length,snoozed_count:l.length,resolved_count:n.length,dismissed_count:a.length}),Pn=()=>
7{if(oe)return;const v=!Gt;Nn(v),tt(v?"snoozed":"open")},zn=()=>{if(oe)return;const v=!Xt;wn(v),tt(v?"completed":"open")},$n=()=>{if(oe)return;const v=!Vt;In(v),tt(v?"dismissed":"open")},Re=()=>{Lt(""),Mt(!1)},qt=e.jsxs(Ms,{className:j(ne?"flex-1":"w-56"),children:[e.jsx(Ps,{value:re,onChange:v=>Lt(v.target.value),placeholder:"Filter actions","aria-label":"Filter actions by title",autoFocus:!0,onKeyDown:v=>{v.key==="Escape"&&(v.preventDefault(),Re())},onBlur:v=>{var De;const Z=((De=v.currentTarget.parentElement)==null?void 0:De.contains(v.relatedTarget))??!1;!ne&&re===""&&!Z&&Re()}}),re||!ne?e.jsx(zs,{onClick:Re}):null]}),Te=v=>e.jsx(nn,{document:v,now:c,density:de.density,animatesLayout:!Sn,isSelected:v.id===i,isUnread:m(v),onResolve:k,onDismiss:R,onStar:S,onUnstar:I,onSnooze:C,onSelect:T},v.id),Fn=v=>(Ft(t.map(Z=>Z.id)),hn(v).then(Z=>jn(De=>[Z,...De])).finally(()=>Ft(void 0))),Qt=O?e.jsx(Qr,{issue:O,onAction:O===ts.PAUSED?It:St}):null,Bn=ae?Je?Qt:u?e.jsxs(B,{className:"flex-1",children:[e.jsxs(H,{children:[e.jsx(U,{children:e.jsx(w,{name:"Envelope"})}),e.jsx(W,{children:"Connect your inbox"}),e.jsx(K,{children:"Connect an inbox so Fyxer can surface conversations that need your attention."})]}),e.jsx(me,{children:e.jsx(_e,{serviceType:be.EMAIL,integration:Ct,redirectingIntegration:Tt,onConnect:At,variant:"brand"})})]}
7):Ze&&$?e.jsxs(B,{className:"flex-1",children:[e.jsxs(H,{children:[e.jsx(U,{children:e.jsx(w,{name:"CalendarBlank"})}),e.jsx(W,{children:"Reconnect your calendar"}),e.jsx(K,{children:"Reconnect to see the latest action items from your meetings alongside your inbox."})]}),e.jsx(me,{children:e.jsx(G,{size:"md",onClick:cn,children:"Reconnect"})})]}):Ze?e.jsxs(B,{className:"flex-1",children:[e.jsxs(H,{children:[e.jsx(U,{children:e.jsx(w,{name:"CalendarBlank"})}),e.jsx(W,{children:"Get action items from every meeting"}),e.jsx(K,{children:"Connect your Google or Outlook calendar so Fyxer can surface what needs you next, across your inbox and meetings."})]}),e.jsx(me,{children:e.jsx(_e,{serviceType:be.CALENDAR,integration:Rt,redirectingIntegration:Dt,onConnect:_t,variant:"brand"})})]}):Dn?e.jsxs(e.Fragment,{children:[e.jsx(mi,{}),q.length>0?e.jsx("ul",{className:"relative flex shrink-0 list-none flex-col p-0",children:e.jsx(rs,{mode:"popLayout",initial:!1,children:q.map(Te)})}):null,e.jsx(hi,{}),e.jsx(bi,{})]}):Ce?e.jsx("div",{className:"px-3 py-4 sm:px-4",children:e.jsx(Ar,{hasCalendarConnection:$,title:ce?Ot?ns.loadingBar.title:"Finding what matters across every conversation.":void 0,description:Ot?ns.loadingBar.description:void 0})}):t.length>0?q.length>0?e.jsxs("ul",{className:"relative flex shrink-0 list-none flex-col p-0",children:[e.jsxs(rs,{mode:"popLayout",initial:!1,children:[Ye.length>0?e.jsx(Me,{children:"Just created"},"just-created-caption"):null,Ye.map(Te),qe.length>0?e.jsxs(Me,{children:[e.jsx(w,{name:"Star",size:12,filled:!0,className:wt}),"Starred"]},"starred-caption"):null,qe.map(Te),(Ye.length>0||qe.length>0)&&Wt.length>0?e.jsx(Me,{children:"Others"},"others-caption"):null,Wt.map(Te)]}),s.hasUnloadedPage?e.jsx("li",{children:e.jsx("button",{type:"button",onClick:b,disabled:s.isLoadingPage,"aria-busy":s.isLoadingPage,className:Fi,children:"Show older"})}):null]}):e.jsx(B,{children:e.jsxs(H,{children:[e.jsx(U,{children:e.jsx(w,{name:"MagnifyingGlass"})}),e.jsx(W,{children:Qe>0?"No open matches":"No matches"}),e.jsx(K,{children:Qe>0?`Only snoozed or cleared actions match “${re.trim()}”. They are in the folds below.`:`Nothing open matches “${re.trim()}”.`})]})}
7):p?null:Ke?e.jsxs(B,{className:"flex-1",children:[e.jsxs(H,{children:[e.jsx(U,{children:e.jsx(w,{name:"Clock"})}),e.jsx(W,{children:"This is taking longer than usual"}),e.jsx(K,{children:"We couldn’t finish preparing your priorities. Try again to start a fresh run."})]}),e.jsx(me,{children:e.jsx(G,{size:"md",onClick:g,children:"Try again"})})]}):J?e.jsx(Bi,{variant:J}):null:Qt??e.jsxs(B,{className:"flex-1",children:[e.jsxs(H,{children:[e.jsx(U,{children:e.jsx(w,{name:"ListChecks"})}),e.jsx(W,{children:"See what needs you, in one place"}),e.jsx(K,{children:"Connect your inbox and calendar to get actions from both, so nothing falls through the cracks."})]}),e.jsxs(me,{children:[e.jsx(_e,{serviceType:be.EMAIL,integration:Ct,redirectingIntegration:Tt,onConnect:At,variant:"brand",className:"w-auto px-4"}),e.jsx(_e,{serviceType:be.CALENDAR,integration:Rt,redirectingIntegration:Dt,onConnect:_t,className:"w-auto px-4"})]})]});return e.jsxs("section",{"aria-labelledby":"top-priorities-title",className:j("flex min-h-0 flex-col overflow-hidden bg-rb-white",!ae&&"min-h-[440px] xl:min-h-0",pn),style:fn,children:[e.jsxs("header",{className:"flex h-12 shrink-0 items-center gap-2 border-b border-rb-gray-neutral px-3 sm:px-4",children:[e.jsx("h2",{id:"top-priorities-title",ref:gn,className:"text-body-lg font-medium text-rb-darkbtn",children:"Top priorities"}),Q&&!Ce?e.jsxs("span",{className:"text-body-sm font-medium text-rb-secondary-dark tabular-nums",children:[t.length,s.hasUnloadedPage?"+":""]}):null,e.jsx("div",{className:"flex-1"}),Q&&!ne&&Ge?qt:null,Q&&!Ge?e.jsx(xe,{icon:"MagnifyingGlass",iconColor:"secondary-dark",label:"Filter actions",size:"big",onClick:()=>Mt(!0)}):null,Q&&!Ce?e.jsx(xe,{icon:"Plus",iconColor:"secondary-dark",label:Xe?"Close the new action row":"Add an action",size:"big","aria-pressed":Xe,onClick:()=>Pt(v=>!v)}):null,Rn?yn?e.jsx(ha,{feature:"emailConnection",children:e.jsx(xe,{icon:"ArrowsClockwise",iconColor:"secondary-dark",label:"Refresh your priorities",size:"big",disabled:!0})}):e.jsx(X,{label:un?_r:dn?"You can only refresh once every 5 minutes":"Refresh your priorities",children:e.jsx(xe,{icon:"ArrowsClockwise",iconColor:"secondary-dark",label:"Refresh your priorities",size:"big",disabled:we,"aria-busy":we,onClick:mn,loading:we})}):null,Q?e.jsx(zi,{viewOptions:de,canChooseReadingPane:bn,onChange:xn}):null]}),Q&&ne&&Cn?e.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b border-rb-gray-neutral px-3 py-2",children:[qt,e.jsx(Es,{icon:"X",label:"Close filter",variant:"ghost",size:"md",onClick:Re})]}):null,O&&Kt&&!Je?e.jsx(fs,{variant:"warning",icon:"Envelope",...Jr(O),onAction:O===ts.PAUSED?It:St}):null,p&&ae&&!u?e.jsx(fs,{variant:"destructive",icon:"Warning",message:p,actionLabel:"Try again",onAction:g,onDismiss:y}):null,e.jsxs(wa,{reducedMotion:"user",children:[e.jsx("div",{className:"relative flex min-h-0 flex-1 flex-col",children:e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto xl:overscroll-contain",children:[Xe?e.jsx(ii,{onSubmit:Fn,onCancel:()=>Pt(!1)}):null,Bn]})}),An?e.jsx(it,{variant:"snoozed",items:Se,totalLabel:`${Se.length}${s.hasUnloadedPage?"+":""}`,page:s,now:c,isOpen:Gt,selectedItemId:i,onToggle:Pn,onSelect:T,onReopen:z,onLoadNextPage:b}):null,_n?e.jsx(it,{variant:"completed",items:Ee,totalLabel:Ln,page:r,now:c,isOpen:Xt,selectedItemId:i,onToggle:zn,onSelect:T,onReopen:E,onLoadNextPage:x}):null,On?e.jsx(it,{variant:"dismissed",items:Ie,totalLabel:Mn,page:o,now:c,isOpen:Vt,selectedItemId:i,onToggle:$n,onSelect:T,onReopen:E,onLoadNextPage:f}):null]})]})},gs=16,Ui=500,Wi=({width:t,maxWidth:s,onResize:n,onResizeEnd:r,onResizeCancel:a})=>{const[o,l]=h.useState(),i=h.useRef(void 0),m=h.useRef(r);m.current=r;const c=()=>{i.current&&clearTimeout(i.current.timer),i.current=void 0},u=()=>{const f=i.current;f&&(c(),m.current(f.width))};h.useEffect(()=>()=>u(),[]);const d=f=>{c(),f.currentTarget.setPointerCapture(f.pointerId),l({pointerX:f.clientX,startWidth:t})},p=f=>{o&&n(rt(o.startWidth+f.clientX-o.pointerX))},g=f=>{o&&(l(void 0),r(rt(o.startWidth+f.clientX-o.pointerX)))},y=()=>{o&&(l(void 0),a())},b=()=>{c(),r(pe.default)},x=f=>{const k=f.key==="ArrowLeft"?-gs:f.key==="ArrowRight"?gs:0;if(k===0){(f.key==="Home"||f.key==="Enter")&&(f.preventDefault(),b());return}f.preventDefault();const E=rt(t+k);c(),n(E),i.current={width:E,timer:setTimeout(u,Ui)}};return e.jsx("div",{role:"separator","aria-label":"Resize the list","aria-orientation":"vertical","aria-valuemin":pe.min,"aria-valuemax":s,"aria-valuenow":t,tabIndex:0,title:"Drag to resize · double-click to reset",onPointerDown:d,onPointerMove:p,onPointerUp:g,onPointerCancel:y,onLostPointerCapture:y,onDoubleClick:b,onKeyDown:x,onBlur:u,className:j("group/divider relative z-10 w-0 shrink-0 cursor-col-resize touch-none outline-hidden","before:absolute before:inset-y-0 before:-left-1 before:w-2 before:content-['']","after:absolute after:inset-y-0 after:-left-px after:w-0.5 after:transition-colors after:duration-150 after:content-[''] motion-reduce:after:transition-none","hover:after:bg-rb-gray-hovered focus-visible:after:bg-rb-gray-hovered",o&&"after:bg-rb-gray-hovered"),children:e.jsx("span",{"aria-hidden":"true",className:j("absolute top-1/2 -left-[3px] h-9 w-1.5 -translate-y-1/2 roun
7ded-[3px] bg-rb-gray-neutral opacity-0 transition-opacity duration-150 motion-reduce:transition-none","group-hover/divider:opacity-100 group-focus-visible/divider:opacity-100",o&&"opacity-100")})})},Ki=1280,ys=360,Gi=t=>{const[s,n]=h.useState();return h.useLayoutEffect(()=>{const r=t.current;if(!r)return;const a=new ResizeObserver(([o])=>n(o.contentRect.width));return a.observe(r),n(r.getBoundingClientRect().width),()=>a.disconnect()},[t]),s},gd=({selectedDocument:t,onCloseContext:s,onExplainDismissal:n,onSetUrgency:r,onSetAttentionBy:a,onSetDetail:o,onTie:l,onChatAboutThis:i,className:m,...c})=>{const u=t!==null,d=!ws(Ki),p=h.useRef(null),g=Gi(p),y=g===void 0||g>=pe.min+ys,b=d&&y,x=b&&c.viewOptions.readingPane,[f,k]=h.useState(),E=g===void 0?pe.max:g-ys,R=Math.min(f??c.viewOptions.listWidth,E),S=t==null?void 0:t.id;h.useEffect(()=>{var C;!S||x||(C=p.current)==null||C.scrollIntoView({block:"start"})},[x,S]);const I=C=>{k(void 0),c.onChangeViewOptions({listWidth:C})};return e.jsxs("div",{ref:p,className:j("flex min-h-0 overflow-hidden rounded-2xl border border-rb-gray-neutral bg-rb-white",m),children:[e.jsx(Hi,{...c,canChooseReadingPane:b,className:j("min-h-0 flex-1",x&&"flex-none border-r border-rb-gray-neutral",u&&!x&&"hidden"),style:x?{width:R}:void 0,onOpenContext:C=>C===c.selectedItemId?s():c.onOpenContext(C)}),x?e.jsx(Wi,{width:R,maxWidth:Math.min(pe.max,E),onResize:k,onResizeEnd:I,onResizeCancel:()=>k(void 0)}):null,e.jsx(Xo,{document:t,now:c.now,showsBar:!x,className:j("min-h-0 min-w-0 flex-1",!u&&!x&&"hidden"),onClose:s,onResolve:c.onResolve,onReopen:c.onReopen,onDismiss:c.onDismiss,onStar:c.onStar,onUnstar:c.onUnstar,onExplainDismissal:n,onSetUrgency:r,onSetDetail:o,onTie:l,onSetAttentionBy:a,onChatAboutThis:i,onSnooze:c.onSnooze,onUnsnooze:c.onUnsnooze})]})};export{gd as ActionsWorkspace};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.