PageSourceSearch

https://scio3-prod-branding.pages.dev/assets/MicrosoftCalendarSection-CJw3HMra.js

js scio3-prod-branding.pages.dev collected 2026-10-03 05:57:21 UTC 4,228 bytes, 1 lines download raw bytes

1import{r as s,j as e}from"./vendor-core-CSqf0onn.js";import{bX as y,bY as D,B as N,bZ as O,b_ as R,bW as S,a6 as k}from"./index-BLvPBB0_.js";import{m as u}from"./auth-connection-api-dg-P0dwa.js";import{u as E}from"./useOAuthPopup-zy_ggD7b.js";import{O as b}from"./types-BXTKU5e4.js";import{C as M,S as I}from"./ConnectionList-BnRoGYaX.js";import{E as L}from"./EditConnectionDialog-qjxSI0QB.js";import{u as _}from"./vendor-i18n-CsG5WAan.js";import{L as T,s as P,aC as U,aD as W}from"./vendor-icons-DiwvYKnv.js";import"./vendor-posthog-DjDKwFVN.js";import"./vendor-router-bax5p2Kx.js";import"./vendor-firebase-B4mX4twW.js";import"./VirtualList-C8PN4Zpo.js";import"./index-B8AlBU93.js";import"./useScrollViewport-BXwtlhab.js";import"./IntegrationsPage-2KjSvXIb.js";import"./useBroadcasts-VidcBSCH.js";import"./broadcast-types-BRemRDS8.js";import"./schemas-BwjzwFM0.js";function F(){const[i,n]=s.useState([]),[f,p]=s.useState(!0),[m,v]=s.useState(0),h=s.useRef(!0),{authorize:x,isAuthenticating:A,teamParams:o}=E();s.useEffect(()=>{let t=!1;return h.current&&p(!0),u.list(o).then(l=>{t||(h.current=!1,n(l??[]))}).catch(()=>{t||n([])}).finally(()=>{t||p(!1)}),()=>{t=!0}},[m,o]);const r=s.useCallback(()=>{v(t=>t+1)},[]),c=s.useCallback(async(t,l,a)=>{try{await x(t,u,{connectionId:l,options:a})&&r()}catch{}},[x,r]),C=s.useCallback(async t=>{await u.save(t)},[]),w=s.useCallback(async t=>{try{return await u.revoke(t,o),r(),!0}catch{return!1}},[r,o]),g=s.useCallback(async t=>{try{return await u.remove(t),r(),!0}catch{return!1}},[r]),d=s.useCallback(async t=>{try{return await u.whereUsed(t,o)??[]}catch{return[]}},[o]);return{connections:i,loading:f,authorize:c,save:C,revoke:w,remove:g,fetchWhereUsed:d,refetch:r,isAuthenticating:A}}const z="grid grid-cols-[40px_1fr_130px_130px_90px_100px] items-center gap-4 px-4";function B({provider:i}){const{t:n}=_();return i===b.MICROSOFT_CALENDAR_WORK?e.jsx(U,{className:"h-4 w-4 text-primary","aria-label":n("Work")}):e.jsx(W,{className:"h-4 w-4 text-primary","aria-label":n("Personal")})}function ce({isActive:i}){const{t:n}=_(),{connections:f,loading:p,authorize:m,save:v,revoke:h,remove:x,fetchWhereUsed:A,refetch:o,isAuthenticating:r}=F(),[c,C]=s.useState({open:!1,connection:null}),[w,g]=s.useState(!1),d=c.connection?f.find(a=>
1a._id===c.connection?._id)??c.connection:null;async function t(a){if(c.connection){g(!0);try{await v({_id:c.connection._id,name:a}),o()}catch(j){console.error("Failed to save Microsoft Calendar connection:",j),k.error(n("Failed to save connection"))}finally{g(!1)}}}const l=s.useRef(i);return s.useEffect(()=>{i&&!l.current&&o(),l.current=i},[i,o]),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[e.jsxs("div",{className:"mb-4 flex flex-wrap items-center justify-between gap-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:n("Microsoft Calendar Auth Connections")}),e.jsxs(y,{children:[e.jsx(D,{asChild:!0,children:e.jsxs(N,{"data-testid":"mscal-add-btn",disabled:r,children:[r&&e.jsx(T,{className:"animate-spin"}),n("Add Connection")]})}),e.jsxs(O,{align:"end",children:[e.jsx(R,{"data-testid":"mscal-account-option-personal",onClick:()=>m(b.MICROSOFT_CALENDAR_PERSONAL),children:n("Personal Account")}),e.jsx(R,{"data-testid":"mscal-account-option-work",onClick:()=>m(b.MICROSOFT_CALENDAR_WORK),children:n("Work Account")})]})]})]}),e.jsx(M,{connections:f,loading:p,gridHeaders:[n("Type"),n("Name"),n("Created At"),n("Last Updated"),n("Status")],gridClassName:z,rowTestId:"ms-calendar-row",renderInfo:a=>e.jsxs(e.Fragment,{children:[e.jsx(B,{provider:a.provider}),e.jsx("span",{className:"truncate text-sm font-medium",children:a.name}),e.jsx("span",{className:"text-sm text-muted-foreground",children:S(a.createdAt)}),e.jsx("span",{className:"text-sm text-muted-foreground",children:S(a.lastUpdatedDate)}),e.jsx("span",{children:e.jsx(I,{status:a.status})})]}),primaryActions:[{label:n("Edit"),icon:e.jsx(P,{}),onAction:a=>C({open:!0,connection:a})}],menuActions:{revoke:h,whereUsed:A,delete:x},children:d&&e.jsx(L,{open:c.open,onOpenChange:a=>{a||C(j=>({...j,open:!1}))},connection:d,onSave:t,onReauthorize:()=>m(d.provider,d._id,{allowSelectAccount:!0}),isAuthenticating:r,saving:w})})]})}export{ce as default};

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.