@aracreate/arm-ui 3.12.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -27
- package/dist/big-calendar-overrides.css +9 -4
- package/dist/chunk-UTKQHNA3.mjs +2 -0
- package/dist/chunk-UTKQHNA3.mjs.map +1 -0
- package/dist/chunk-Z6WRPM3Z.js +2 -0
- package/dist/chunk-Z6WRPM3Z.js.map +1 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +142 -121
- package/dist/index.d.ts +142 -121
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/preset.d.mts +2 -2
- package/dist/preset.d.ts +2 -2
- package/dist/preset.js +2 -2
- package/dist/preset.js.map +1 -1
- package/dist/preset.mjs +2 -2
- package/dist/preset.mjs.map +1 -1
- package/dist/style.css +2 -1
- package/dist/tokens.css +9 -4
- package/package.json +2 -11
- package/dist/chunk-LGJWNA6J.mjs +0 -2
- package/dist/chunk-LGJWNA6J.mjs.map +0 -1
- package/dist/chunk-TD6NGM5I.js +0 -2
- package/dist/chunk-TD6NGM5I.js.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as fo,b as D,c as _t}from"./chunk-LGJWNA6J.mjs";import{Box as _l,Flex as Vl,Grid as Wl,Container as $l,Section as Ul,Inset as Gl,AspectRatio as Kl,ScrollArea as Yl,Separator as jl,Text as ql,Heading as Xl,Blockquote as Zl,Code as Ql,Em as Jl,Kbd as ec,Link as rc,Quote as tc,Strong as ac,Button as oc,IconButton as nc,TextField as ic,TextArea as sc,Checkbox as lc,CheckboxGroup as cc,CheckboxCards as dc,Radio as pc,RadioGroup as gc,RadioCards as uc,Select as mc,Slider as fc,Switch as vc,SegmentedControl as yc,Dialog as hc,AlertDialog as bc,DropdownMenu as xc,ContextMenu as Cc,Popover as wc,HoverCard as Tc,Tooltip as Sc,Portal as Rc,Avatar as kc,Badge as Dc,Callout as Ac,Card as Ic,DataList as Pc,Progress as Ec,Spinner as Nc,Table as Bc,Tabs as Mc,TabNav as zc,AccessibleIcon as Lc,Slot as Fc,Slottable as Hc,VisuallyHidden as Oc}from"@radix-ui/themes";import{jsx as yo}from"react/jsx-runtime";function vo({width:e="100%",height:r="var(--space-4)",radius:t="var(--radius-2)",circle:a=!1,mb:o,className:n,style:i}){return yo("div",{className:["skeleton",n].filter(Boolean).join(" "),"aria-hidden":"true",style:{width:e,height:r,borderRadius:a?"50%":t,marginBottom:o,...i}})}import*as We from"react";import*as le from"@radix-ui/react-accordion";import{ChevronDownIcon as ho}from"@radix-ui/react-icons";import{jsx as Be,jsxs as bo}from"react/jsx-runtime";var Vt=We.forwardRef(({className:e="",...r},t)=>Be(le.Root,{ref:t,className:`arm-accordion ${e}`,...r}));Vt.displayName="Accordion";var Wt=We.forwardRef(({className:e="",...r},t)=>Be(le.Item,{ref:t,className:`arm-accordion__item ${e}`,...r}));Wt.displayName="AccordionItem";var $t=We.forwardRef(({className:e="",children:r,...t},a)=>Be(le.Header,{className:"arm-accordion__header",children:bo(le.Trigger,{ref:a,className:`arm-accordion__trigger ${e}`,...t,children:[r,Be(ho,{"aria-hidden":!0,className:"arm-accordion__chevron"})]})}));$t.displayName="AccordionTrigger";var Ut=We.forwardRef(({className:e="",children:r,...t},a)=>Be(le.Content,{ref:a,className:`arm-accordion__content ${e}`,...t,children:Be("div",{className:"arm-accordion__body",children:r})}));Ut.displayName="AccordionContent";import*as cr from"react";import*as N from"@radix-ui/react-dialog";import{Cross2Icon as xo}from"@radix-ui/react-icons";import{jsx as we,jsxs as ko}from"react/jsx-runtime";var Co=N.Root,wo=N.Trigger,To=N.Close,Gt=cr.forwardRef(({className:e="",side:r="right",size:t="md",children:a,...o},n)=>ko(N.Portal,{children:[we(N.Overlay,{className:"arm-drawer__overlay"}),we(N.Content,{ref:n,"data-side":r,"data-size":t,className:`arm-drawer ${e}`,...o,children:a})]}));Gt.displayName="DrawerContent";var So=({className:e="",children:r,...t})=>we("div",{className:`arm-drawer__header ${e}`,...t,children:r}),Kt=cr.forwardRef(({className:e="",...r},t)=>we(N.Title,{ref:t,className:`arm-drawer__title ${e}`,...r}));Kt.displayName="DrawerTitle";var Yt=cr.forwardRef(({className:e="",...r},t)=>we(N.Description,{ref:t,className:`arm-drawer__description ${e}`,...r}));Yt.displayName="DrawerDescription";var Ro=()=>we(N.Close,{"aria-label":"Close",className:"arm-drawer__close",children:we(xo,{"aria-hidden":!0,className:"arm-drawer__close-icon"})});import{Box as jt,Flex as Do,Text as Ao}from"@radix-ui/themes";import{jsx as Lr,jsxs as Xt}from"react/jsx-runtime";function qt({title:e,trailing:r,style:t}){let a=typeof e=="string"||typeof e=="number"?Lr(Ao,{size:"3",weight:"medium",style:{color:"var(--accent-contrast)"},children:e}):e;return Xt(Do,{align:"center",justify:"between",gap:"3",px:"4",style:{background:"var(--accent-9)",minHeight:"var(--space-7)",...t},children:[a,r]})}function Io({title:e,trailing:r,children:t,bodyPadding:a="4",style:o}){return Xt(jt,{style:{background:"var(--color-panel-solid)",borderRadius:"var(--radius-5)",overflow:"hidden",boxShadow:"var(--shadow-card)",...o},children:[Lr(qt,{title:e,trailing:r}),Lr(jt,{p:a,children:t})]})}import{AlertDialog as Te,Button as Zt}from"@radix-ui/themes";var x={contentMax:"calc(15 * var(--space-9) + var(--space-5))",accountCardW:"calc(3 * var(--space-9) + var(--space-8))",accountCardMinH:"calc(2 * var(--space-9) - var(--space-2))",monthTitleMinW:"calc(3 * var(--space-9) - var(--space-1))",bigCalendarH:"calc(10 * var(--space-9))",sidebarColBasis:"calc(4 * var(--space-9) - var(--space-2))",sidebarColMin:"calc(3 * var(--space-9) + var(--space-6))",syncColMin:"calc(5 * var(--space-9))",syncColWide:"calc(7 * var(--space-9) + var(--space-6))",dialogSm:"calc(6 * var(--space-9) - var(--space-2))",dialogBody:"calc(5 * var(--space-9) + var(--space-7))",authFormMax:"calc(6 * var(--space-9) + var(--space-8))",brandLogoMax:"calc(6 * var(--space-9) + var(--space-8) - var(--space-1))",connectedAccountCardH:"calc(var(--space-9) - var(--space-1))",dialogMd:"calc(6 * var(--space-9) + var(--space-6))",dialogLg:"calc(7 * var(--space-9) - var(--space-1))",emptyStateMax:"calc(10 * var(--space-9))",emptyStateCopyMax:"calc(6 * var(--space-9))",providerChooserMax:"calc(6 * var(--space-9) + var(--space-6))",auditColTime:"calc(var(--space-9) + var(--space-2))",auditColAction:"calc(var(--space-9) + var(--space-5) + var(--space-1))",searchFieldW:"calc(3 * var(--space-9) + var(--space-5) + var(--space-1))",settingsGridMin:"calc(5 * var(--space-9) + var(--space-5))",placeholderMd:"calc(6 * var(--space-9) + var(--space-4))"};import{Flex as Po}from"@radix-ui/themes";import{jsx as Eo}from"react/jsx-runtime";function J({children:e,justify:r="end",noTopMargin:t,pad:a="var(--space-5)",radius:o="var(--radius-5)"}){return Eo(Po,{justify:r,style:{margin:`${t?"0":"var(--space-5)"} calc(-1 * ${a}) calc(-1 * ${a})`,padding:`var(--space-4) ${a}`,alignItems:"center",background:"var(--gray-2)",borderTop:"1px solid var(--gray-5)",borderRadius:`0 0 ${o} ${o}`},children:e})}import{jsx as Se,jsxs as Fr}from"react/jsx-runtime";function Hr({title:e,description:r,confirmLabel:t="Yes",cancelLabel:a="Cancel",onConfirm:o,trigger:n,open:i,onOpenChange:l}){return Fr(Te.Root,{open:i,onOpenChange:l,children:[n?Se(Te.Trigger,{children:n}):null,Fr(Te.Content,{maxWidth:x.dialogSm,children:[Se(Te.Title,{size:"5",mb:"1",style:{fontFamily:"var(--heading-font-family)",fontWeight:"var(--font-weight-medium)"},children:e}),Se(Te.Description,{size:"2",color:"gray",mb:"5",children:r}),Fr(J,{justify:"between",noTopMargin:!0,children:[Se(Te.Cancel,{children:Se(Zt,{size:"2",variant:"outline",color:"gray",children:a})}),Se(Te.Action,{children:Se(Zt,{size:"2",className:"btn-amber-primary",onClick:o,children:t})})]})]})]})}import{PauseIcon as No}from"@radix-ui/react-icons";function h(e){return{width:`var(${e})`,height:`var(${e})`}}import{jsx as Qt,jsxs as Bo}from"react/jsx-runtime";function Or({label:e="Paused",style:r}){return Bo("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--space-1)",height:"calc(var(--space-4) + var(--space-1))",padding:"var(--space-1) var(--space-2)",border:"1px solid var(--color-paused)",borderRadius:999,background:"var(--color-panel-solid)",color:"var(--color-paused)",fontSize:"var(--font-size-1)",fontWeight:600,lineHeight:1,whiteSpace:"nowrap",...r},children:[Qt("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-3)",height:"var(--space-3)",flexShrink:0,borderRadius:"50%",border:"1px solid var(--color-paused)"},children:Qt(No,{style:h("--space-2")})}),e]})}import{Avatar as Mo,Box as Jt,DropdownMenu as Me,Flex as ea,IconButton as zo,Text as ra}from"@radix-ui/themes";import{DotsVerticalIcon as Lo,PauseIcon as Fo,PlayIcon as Ho,TrashIcon as Oo}from"@radix-ui/react-icons";import{jsx as G,jsxs as ce}from"react/jsx-runtime";function _o({name:e,email:r,avatarSrc:t,paused:a=!1,onPause:o,onResume:n,onDelete:i,onClick:l,badge:s,accentColor:c,style:g}){let p=G(ra,{as:l?"span":"p",size:"3",weight:"medium",truncate:!0,style:{color:"var(--gray-12)",minWidth:0},children:e});return ce(Jt,{onClick:l,style:{width:x.accountCardW,minHeight:x.accountCardMinH,padding:"var(--space-3)",background:"var(--color-panel-solid)",borderRadius:"var(--radius-4)",boxShadow:"var(--shadow-card)",cursor:l?"pointer":void 0,...g},children:[ce(ea,{align:"center",justify:"between",gap:"2",mb:"3",children:[ce(ea,{align:"center",gap:"2",style:{minWidth:0},children:[ce("div",{style:{position:"relative",flexShrink:0},children:[G(Mo,{size:"3",radius:"full",src:t,fallback:e.charAt(0).toUpperCase()||"?",style:c?{background:c,color:"white"}:void 0}),s&&G("span",{style:{position:"absolute",right:"calc(-1 * var(--space-1))",bottom:"calc(-1 * var(--space-1))",width:"var(--space-4)",height:"var(--space-4)",borderRadius:"50%",background:"var(--color-panel-solid)",border:"1px solid var(--gray-4)",display:"inline-flex",alignItems:"center",justifyContent:"center",transform:"scale(0.72)"},children:s})]}),a&&G(Or,{})]}),ce(Me.Root,{children:[G(Me.Trigger,{children:G(zo,{variant:"ghost",color:"gray","aria-label":"Account actions",style:{flexShrink:0},onClick:u=>u.stopPropagation(),children:G(Lo,{})})}),ce(Me.Content,{align:"end",onClick:u=>u.stopPropagation(),children:[a?ce(Me.Item,{onSelect:n,children:[G(Ho,{})," Resume"]}):ce(Me.Item,{onSelect:o,children:[G(Fo,{})," Pause"]}),ce(Me.Item,{color:"red",onSelect:i,children:[G(Oo,{})," Delete"]})]})]})]}),ce(Jt,{style:{minWidth:0},children:[l?G("button",{type:"button",className:"card-title-button",onClick:u=>{u.stopPropagation(),l()},children:p}):p,G(ra,{as:"p",size:"1",color:"gray",truncate:!0,children:r})]})]})}import{Box as ta,Flex as aa,Heading as Vo,IconButton as oa,Text as na}from"@radix-ui/themes";import{ChevronLeftIcon as Wo,ChevronRightIcon as $o}from"@radix-ui/react-icons";var O={h1:"6",h2:"5",h3:"4",h4:"3"};import{Fragment as Zo,jsx as L,jsxs as Vr}from"react/jsx-runtime";var Uo=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],_r="var(--space-9)",Go="var(--space-8)",ia="var(--space-2)",Ko=new Intl.DateTimeFormat("en-US",{month:"long",year:"numeric"}),Yo=new Intl.DateTimeFormat("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"});function jo(e,r){return e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function sa(e){return(e+6)%7}function qo(e){let r=e.getMonth(),t=e.getFullYear(),a=new Date(t,r,1),o=new Date(t,r+1,0),n=sa(a.getDay()),i=6-sa(o.getDay()),l=new Date(t,r,1-n),s=n+o.getDate()+i;return Array.from({length:s},(c,g)=>{let p=new Date(l.getFullYear(),l.getMonth(),l.getDate()+g);return{date:p,inCurrentMonth:p.getMonth()===r}})}function la(e,r){return new Date(e.getFullYear(),e.getMonth()+r,1)}function Xo({month:e,onMonthChange:r,events:t=[],dayDots:a,today:o,onSelectDay:n,style:i}){let l=o??new Date,s=qo(e),c=new Set(t.map(g=>g.toDateString()));return Vr(aa,{direction:"column",align:"center",gap:"4",style:i,children:[Vr(aa,{align:"center",gap:"2",children:[L(oa,{type:"button",variant:"ghost",color:"gray","aria-label":"Previous month",onClick:()=>r?.(la(e,-1)),children:L(Wo,{style:h("--space-4")})}),L(Vo,{as:"h2",size:O.h2,weight:"medium",style:{minWidth:x.monthTitleMinW,textAlign:"center"},children:Ko.format(e)}),L(oa,{type:"button",variant:"ghost",color:"gray","aria-label":"Next month",onClick:()=>r?.(la(e,1)),children:L($o,{style:h("--space-4")})})]}),L(ta,{style:{display:"grid",gridTemplateColumns:`repeat(7, ${_r})`,gap:ia},children:Uo.map(g=>L(na,{size:"2",align:"center",style:{color:"var(--gray-11)"},children:g},g))}),L(ta,{style:{display:"grid",gridTemplateColumns:`repeat(7, ${_r})`,gap:ia},children:s.map(({date:g,inCurrentMonth:p})=>{let u=jo(g,l),b=a?.get(g.toDateString()),y=c.has(g.toDateString()),f={position:"relative",width:_r,height:Go,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:p?u?"var(--color-panel-solid)":"transparent":"var(--gray-2)",border:u?"1.5px solid var(--accent-9)":"none",borderRadius:u?"var(--radius-3)":p?void 0:"var(--radius-2)",padding:0,font:"inherit",cursor:n?"pointer":void 0},S=Vr(Zo,{children:[b&&b.length>0?L("span",{"aria-hidden":"true",style:{position:"absolute",bottom:"var(--space-1)",left:0,right:0,display:"flex",justifyContent:"center",gap:"2px"},children:b.slice(0,3).map((X,ie)=>L("span",{style:{width:"var(--space-1)",height:"var(--space-1)",borderRadius:"50%",background:X}},ie))}):y&&L("span",{"aria-hidden":"true",style:{position:"absolute",top:"var(--space-1)",right:"var(--space-2)",width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:"var(--accent-9)"}}),L(na,{size:"3",style:{color:p?"var(--gray-12)":"var(--gray-11)",fontWeight:u?600:400},children:g.getDate()})]}),E=g.toISOString();return n?L("button",{type:"button",onClick:()=>n(g),"aria-label":Yo.format(g),style:f,children:S},E):L("div",{style:f,children:S},E)})})]})}import{useEffect as Qo}from"react";import{Callout as Wr}from"@radix-ui/themes";import{CheckCircledIcon as Jo,ExclamationTriangleIcon as en}from"@radix-ui/react-icons";import{jsx as $e,jsxs as rn}from"react/jsx-runtime";function $r({msg:e,color:r="green",onDone:t,durationMs:a=3e3}){return Qo(()=>{let o=setTimeout(t,a);return()=>clearTimeout(o)},[t,a]),$e("div",{style:{position:"fixed",bottom:"var(--space-5)",right:"var(--space-5)",zIndex:1e4,maxWidth:x.dialogBody,pointerEvents:"none"},children:rn(Wr.Root,{color:r,variant:"soft",size:"1",children:[$e(Wr.Icon,{children:r==="red"?$e(en,{}):$e(Jo,{})}),$e(Wr.Text,{children:e})]})})}import{jsx as tn}from"react/jsx-runtime";function B({children:e,size:r="var(--space-7)"}){return tn("div",{style:{width:r,height:r,borderRadius:"var(--radius-4)",background:"var(--color-panel-solid)",border:"1px solid var(--gray-5)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e})}import{Box as an,Flex as on,Text as ca}from"@radix-ui/themes";import{LockClosedIcon as nn}from"@radix-ui/react-icons";import{jsx as da,jsxs as Ur}from"react/jsx-runtime";function sn({title:e,time:r,detail:t,color:a,locked:o}){return Ur(on,{align:"center",justify:"between",style:{background:a,borderRadius:"var(--radius-3)",padding:"var(--space-3)",color:"white"},children:[Ur(an,{style:{minWidth:0},children:[da(ca,{as:"p",size:"2",weight:"medium",style:{color:"white"},truncate:!0,children:e}),Ur(ca,{as:"p",size:"1",style:{color:"rgba(255,255,255,0.85)"},truncate:!0,children:[r,t?` \xB7 ${t}`:""]})]}),o&&da(nn,{style:{flexShrink:0,color:"rgba(255,255,255,0.85)"}})]})}import{Box as ln}from"@radix-ui/themes";import{jsx as cn}from"react/jsx-runtime";function Gr({children:e,style:r,showBorder:t=!1,onActivate:a,selected:o=!1,className:n,"aria-label":i}){let l=!!a;function s(c){a&&(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),a())}return cn(ln,{role:l?"button":void 0,tabIndex:l?0:void 0,"aria-label":i,onClick:a,onKeyDown:l?s:void 0,className:["data-table-row",l&&"data-table-row--interactive",l&&o&&"data-table-row--selected",n].filter(Boolean).join(" "),style:{borderTop:t?"1px solid var(--gray-3)":void 0,...r},children:e})}import{useId as dn}from"react";import{Card as pn,Flex as Kr,Text as Yr}from"@radix-ui/themes";import{jsx as de,jsxs as ze}from"react/jsx-runtime";function gn({label:e,value:r,delta:t,deltaDir:a,goodDirection:o,statusColor:n,sparkline:i}){return de(pn,{className:"metric-card",children:ze(Kr,{direction:"column",p:"1",children:[ze(Kr,{align:"center",justify:"between",mb:"3",children:[de(Yr,{as:"span",className:"ds-section-label",children:e}),de("div",{style:{width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:n,flexShrink:0}})]}),de(Yr,{as:"p",className:"metric-card-value",children:r}),ze(Kr,{align:"end",justify:"between",children:[ze(Yr,{size:"1",style:{color:a==="flat"?"var(--gray-11)":a===o?"var(--green-11)":"var(--red-11)",lineHeight:1.4},children:[a==="up"?"\u2191 ":a==="down"?"\u2193 ":"",t]}),de(un,{data:i,color:n})]})]})})}function un({data:e,color:r}){let o=Math.min(...e),i=Math.max(...e)-o||1,l=e.map((u,b)=>({x:b/(e.length-1)*72,y:28-(u-o)/i*28*.75-28*.1})),s=l.map((u,b)=>`${b===0?"M":"L"} ${u.x.toFixed(1)} ${u.y.toFixed(1)}`).join(" "),c=["M 0 28",...l.map(u=>`L ${u.x.toFixed(1)} ${u.y.toFixed(1)}`),"L 72 28 Z"].join(" "),p=`spk${dn().replace(/[^a-zA-Z0-9_-]/g,"")}`;return ze("svg",{width:72,height:28,viewBox:"0 0 72 28","aria-hidden":!0,style:{overflow:"visible",flexShrink:0},children:[de("defs",{children:ze("linearGradient",{id:p,x1:"0",y1:"0",x2:"0",y2:"1",children:[de("stop",{offset:"0%",stopColor:r,stopOpacity:"0.18"}),de("stop",{offset:"100%",stopColor:r,stopOpacity:"0"})]})}),de("path",{d:c,fill:`url(#${p})`}),de("path",{d:s,fill:"none",stroke:r,strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round"})]})}import{Link as mn}from"react-router-dom";import{Badge as fn,Button as vn,Card as yn,Flex as pa,Text as ga}from"@radix-ui/themes";import{ArrowRightIcon as hn}from"@radix-ui/react-icons";import{jsx as Re,jsxs as dr}from"react/jsx-runtime";function bn({href:e,icon:r,name:t,description:a,badge:o}){return dr(yn,{style:{height:"100%",display:"flex",flexDirection:"column"},children:[dr(pa,{direction:"column",gap:"3",p:"1",flexGrow:"1",children:[dr(pa,{align:"center",gap:"3",minWidth:"0",children:[Re(B,{children:r}),Re(ga,{size:"4",weight:"medium",style:{color:"var(--gray-12)",fontFamily:"var(--font-poppins)"},truncate:!0,children:t}),o&&Re(fn,{color:"gray",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:o})]}),Re(ga,{size:"2",style:{color:"var(--gray-11)",fontFamily:"var(--font-poppins)",lineHeight:1.5},children:a})]}),Re(J,{pad:"var(--space-3)",radius:"var(--radius-4)",children:Re(vn,{size:"2",className:"btn-amber-primary",asChild:!0,children:dr(mn,{to:e,children:["Open",Re(hn,{style:h("--space-3")})]})})})]})}import{Text as Ue}from"@radix-ui/themes";import{jsx as jr,jsxs as qr}from"react/jsx-runtime";function xn({tag:e,tagColor:r,msg:t,actor:a,timeAgo:o,timestamp:n,showBorder:i}){return qr(Gr,{showBorder:i,style:{display:"flex",alignItems:"center",gap:"var(--space-3)",paddingBlock:"var(--space-2)",paddingInline:"var(--space-4)"},children:[jr(Ue,{as:"span",size:"1",weight:"medium",className:"data-mono",style:{color:r,minWidth:"var(--space-6)",letterSpacing:"0.06em",flexShrink:0},children:e}),qr(Ue,{as:"span",size:"2",style:{flex:1,color:"var(--gray-11)",lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[t,a&&qr(Ue,{as:"span",size:"1",style:{color:"var(--gray-11)",marginLeft:"var(--space-2)"},children:["by ",a]})]}),o&&jr(Ue,{as:"span",size:"1",color:"gray",style:{whiteSpace:"nowrap",flexShrink:0},children:o}),jr(Ue,{as:"span",size:"1",className:"data-mono",style:{color:"var(--gray-11)",whiteSpace:"nowrap",flexShrink:0,minWidth:"var(--space-7)",textAlign:"right"},children:n})]})}import{Button as Cn,Card as wn,Flex as Tn,Text as Sn}from"@radix-ui/themes";import{ExclamationTriangleIcon as Rn}from"@radix-ui/react-icons";import{jsx as Ge,jsxs as Dn}from"react/jsx-runtime";function kn({onRetry:e,message:r="Couldn't load your dashboard."}){return Ge(wn,{children:Dn(Tn,{direction:"column",align:"center",justify:"center",py:"9",gap:"3",children:[Ge(B,{children:Ge(Rn,{style:{...h("--space-5"),color:"var(--gray-7)"}})}),Ge(Sn,{size:"2",color:"gray",children:r}),Ge(Cn,{size:"2",color:"amber",variant:"solid",className:"btn-amber-primary",onClick:e,children:"Retry"})]})})}import{useMemo as An}from"react";import{Button as In,Flex as Pn,IconButton as pr,Text as En}from"@radix-ui/themes";import{ChevronLeftIcon as Nn,ChevronRightIcon as Bn,DoubleArrowLeftIcon as Mn,DoubleArrowRightIcon as zn}from"@radix-ui/react-icons";import{jsx as ee,jsxs as Hn}from"react/jsx-runtime";var Le="\u2026";function Ln(e,r,t){let a=t*2+5;if(r<=a)return Array.from({length:r},(c,g)=>g+1);let o=Math.max(e-t,1),n=Math.min(e+t,r),i=o>2,l=n<r-1;if(!i&&l)return[...Array.from({length:3+t*2},(g,p)=>p+1),Le,r];if(i&&!l){let c=3+t*2,g=Array.from({length:c},(p,u)=>r-c+u+1);return[1,Le,...g]}let s=Array.from({length:n-o+1},(c,g)=>o+g);return[1,Le,...s,Le,r]}function Fn({currentPage:e,totalPages:r,onPageChange:t,siblingCount:a=1,showFirstLast:o=!1,size:n="2"}){let i=An(()=>Ln(e,r,a),[e,r,a]),l=e<=1,s=e>=r;return ee(Pn,{asChild:!0,align:"center",gap:"1",children:Hn("nav",{"aria-label":"Pagination",children:[o&&ee(pr,{size:n,variant:"soft",color:"gray","aria-label":"First page",disabled:l,onClick:()=>t(1),children:ee(Mn,{})}),ee(pr,{size:n,variant:"soft",color:"gray","aria-label":"Previous page",disabled:l,onClick:()=>t(e-1),children:ee(Nn,{})}),i.map((c,g)=>c===Le?ee(En,{size:n,color:"gray","aria-hidden":!0,style:{paddingInline:"var(--space-1)"},children:Le},`ellipsis-${g}`):ee(In,{size:n,"aria-label":`Page ${c}`,"aria-current":c===e?"page":void 0,variant:c===e?"solid":"soft",color:c===e?void 0:"gray",className:c===e?"btn-amber-primary":void 0,onClick:()=>c!==e&&t(c),children:c},c)),ee(pr,{size:n,variant:"soft",color:"gray","aria-label":"Next page",disabled:s,onClick:()=>t(e+1),children:ee(Bn,{})}),o&&ee(pr,{size:n,variant:"soft",color:"gray","aria-label":"Last page",disabled:s,onClick:()=>t(r),children:ee(zn,{})})]})})}var gr={admin:{label:"Admin",color:"amber"},operator:{label:"Operator",color:"blue"},user:{label:"Platform User",color:"gray"}},On={admin:gr.admin.label,operator:gr.operator.label,user:gr.user.label},_n={active:{label:"Active",color:"var(--color-success)"},inactive:{label:"Inactive",color:"var(--gray-11)"},suspended:{label:"Suspended",color:"var(--color-danger)"}},Vn={ok:"var(--green-9)",warn:"var(--orange-9)",error:"var(--red-9)"},Wn={auth:{tag:"AUTH",color:"var(--gray-11)"},sync:{tag:"SYNC",color:"var(--blue-11)"},role:{tag:"ROLE",color:"var(--violet-11)"},provision:{tag:"PROV",color:"var(--green-11)"},health:{tag:"HLTH",color:"var(--teal-11)"},error:{tag:"ERR!",color:"var(--red-11)"}},ua={USER_UPDATED:{label:"User updated",tag:"UPD",badge:"amber",color:"var(--amber-11)"},USER_DISABLED:{label:"User disabled",tag:"DIS",badge:"red",color:"var(--red-11)"},USER_ENABLED:{label:"User enabled",tag:"ENA",badge:"green",color:"var(--teal-11)"},USER_APPROVED:{label:"User approved",tag:"APPR",badge:"green",color:"var(--green-11)"},USER_REJECTED:{label:"User rejected",tag:"REJ",badge:"red",color:"var(--red-11)"},SIGNUP_NOTIFICATIONS_ON:{label:"Signup notifications on",tag:"NOTF",badge:"gray",color:"var(--gray-11)"},SIGNUP_NOTIFICATIONS_OFF:{label:"Signup notifications off",tag:"NOTF",badge:"gray",color:"var(--gray-11)"},APPROVAL_EMAIL_RESENT:{label:"Approval email resent",tag:"MAIL",badge:"amber",color:"var(--amber-11)"},USER_DELETED:{label:"User deleted",tag:"DEL",badge:"yellow",color:"var(--red-11)"},ADMIN_GRANTED:{label:"Admin granted",tag:"ADMN",badge:"gray",color:"var(--violet-11)"},ADMIN_REVOKED:{label:"Admin revoked",tag:"ADMN",badge:"gray",color:"var(--orange-11)"},ADMIN_ROLE_CHANGED:{label:"Role changed",tag:"ROLE",badge:"amber",color:"var(--violet-11)"},SESSION_REVOKED:{label:"Session revoked",tag:"SESS",badge:"gray",color:"var(--gray-11)"},APP_GRANTED:{label:"App access granted",tag:"APP",badge:"green",color:"var(--green-11)"},APP_REVOKED:{label:"App access revoked",tag:"APP",badge:"red",color:"var(--orange-11)"},BUNDLE_GRANTED:{label:"Bundle access granted",tag:"BNDL",badge:"green",color:"var(--green-11)"},BUNDLE_REVOKED:{label:"Bundle access revoked",tag:"BNDL",badge:"red",color:"var(--orange-11)"},APP_VALIDATED:{label:"App repo checked",tag:"CHK",badge:"gray",color:"var(--gray-11)"},APP_DEPLOY_REQUESTED:{label:"App deploy requested",tag:"DPLY",badge:"amber",color:"var(--amber-11)"},APP_DEPLOYED:{label:"App deployed",tag:"LIVE",badge:"green",color:"var(--green-11)"},APP_DEPLOY_FAILED:{label:"App deploy failed",tag:"FAIL",badge:"red",color:"var(--red-11)"},APP_REVERTED:{label:"App deploy reverted",tag:"RVRT",badge:"red",color:"var(--orange-11)"},APP_ROLLED_BACK:{label:"App rolled back",tag:"RBCK",badge:"amber",color:"var(--orange-11)"},APP_REMOVED:{label:"App undeployed",tag:"UNDP",badge:"red",color:"var(--red-11)"},APP_DEPLOY_GRANTS_FAILED:{label:"Deploy grants failed",tag:"GRNT",badge:"red",color:"var(--red-11)"},ADMIN_CHANGE_ROLLED_BACK:{label:"Admin change rolled back",tag:"UNDO",badge:"amber",color:"var(--amber-11)"},AUDIT_EXPORTED:{label:"Audit log exported",tag:"EXPT",badge:"gray",color:"var(--gray-11)"},SESSIONS_LISTED:{label:"Sessions viewed",tag:"VIEW",badge:"gray",color:"var(--gray-11)"}};function $n(e){return ua[e]??{label:e,tag:e.slice(0,4).toUpperCase(),badge:"gray",color:"var(--gray-11)"}}import{jsx as ma}from"react/jsx-runtime";function Xr(){return ma("div",{className:"auth-art-card",children:ma("img",{src:"/arm-logo-inverted.svg",alt:"araMetrics",style:{width:"56%",maxWidth:x.brandLogoMax,display:"block",userSelect:"none"},draggable:!1})})}import{jsx as ur,jsxs as Gn}from"react/jsx-runtime";function Un({children:e}){return Gn("div",{style:{minHeight:"100vh",display:"flex",background:"var(--surface-content)",padding:"var(--space-5)",gap:"var(--space-5)"},children:[ur("div",{className:"auth-card-left",style:{width:"47%",flexShrink:0,position:"sticky",top:"var(--space-5)",height:"calc(100vh - var(--space-8))"},children:ur(Xr,{})}),ur("div",{className:"auth-card-right",style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:"calc(100vh - var(--space-8))",padding:"var(--space-7) var(--space-5)"},children:ur("main",{style:{maxWidth:x.authFormMax,width:"100%",marginLeft:"auto",marginRight:"auto",background:"var(--color-panel-solid)",borderRadius:"var(--radius-5)",boxShadow:"var(--shadow-card)",padding:"var(--space-7) var(--space-5)"},children:e})})]})}import{jsx as mr,jsxs as Kn}from"react/jsx-runtime";function Zr(){return Kn("svg",{width:18,height:18,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[mr("path",{d:"M15.68 8.18c0-.57-.05-1.11-.14-1.64H8v3.1h4.3a3.68 3.68 0 0 1-1.6 2.42v2h2.58c1.51-1.39 2.4-3.44 2.4-5.88Z",fill:"#4285F4"}),mr("path",{d:"M8 16c2.16 0 3.97-.71 5.3-1.94l-2.59-2a4.88 4.88 0 0 1-7.27-2.56H0.9v2.07A8 8 0 0 0 8 16Z",fill:"#34A853"}),mr("path",{d:"M3.44 9.5A4.8 4.8 0 0 1 3.19 8c0-.52.09-1.03.25-1.5V4.43H.9A8 8 0 0 0 0 8c0 1.29.31 2.51.9 3.57L3.44 9.5Z",fill:"#FBBC05"}),mr("path",{d:"M8 3.18c1.22 0 2.31.42 3.17 1.24l2.37-2.37A7.94 7.94 0 0 0 8 0 8 8 0 0 0 .9 4.43L3.44 6.5A4.77 4.77 0 0 1 8 3.18Z",fill:"#EA4335"})]})}import{jsx as fr,jsxs as Yn}from"react/jsx-runtime";function Qr(){return Yn("svg",{width:18,height:18,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[fr("rect",{x:"0",y:"0",width:"7.6",height:"7.6",fill:"#F25022"}),fr("rect",{x:"8.4",y:"0",width:"7.6",height:"7.6",fill:"#7FBA00"}),fr("rect",{x:"0",y:"8.4",width:"7.6",height:"7.6",fill:"#00A4EF"}),fr("rect",{x:"8.4",y:"8.4",width:"7.6",height:"7.6",fill:"#FFB900"})]})}import{useRef as jn}from"react";import{TextField as qn}from"@radix-ui/themes";import{jsx as fa}from"react/jsx-runtime";function Jr({value:e,onChange:r,disabled:t}){let a=jn([]);function o(s,c){let g=c.target.value.replace(/\D/g,"").slice(-1),p=Array.from({length:4},(u,b)=>e[b]??"");p[s]=g,r(p.join("")),g&&s<3&&a.current[s+1]?.focus()}function n(s,c){let g=Array.from({length:4},(p,u)=>e[u]??"");c.key==="Backspace"?!g[s]&&s>0&&(g[s-1]="",r(g.join("")),a.current[s-1]?.focus()):c.key==="ArrowLeft"&&s>0?a.current[s-1]?.focus():c.key==="ArrowRight"&&s<3&&a.current[s+1]?.focus()}function i(s){let c=s.clipboardData.getData("text").replace(/\D/g,"").slice(0,4);c&&(s.preventDefault(),r(c),a.current[Math.min(c.length,3)]?.focus())}let l=Array.from({length:4},(s,c)=>e[c]??"");return fa("div",{style:{display:"flex",gap:"var(--space-3)",justifyContent:"center"},children:l.map((s,c)=>fa(qn.Root,{ref:g=>{a.current[c]=g},type:"text",inputMode:"numeric",maxLength:1,value:s,onChange:g=>o(c,g),onKeyDown:g=>n(c,g),onPaste:i,disabled:t,className:"otp-box","aria-label":`Digit ${c+1}`,autoComplete:c===0?"one-time-code":"off"},c))})}import{Button as et,Callout as Ke,Heading as Xn,Text as rt}from"@radix-ui/themes";import{ExclamationTriangleIcon as Zn}from"@radix-ui/react-icons";import{Fragment as va,jsx as K,jsxs as ue}from"react/jsx-runtime";function Qn({email:e,title:r,subtitle:t,code:a,onCodeChange:o,otpDevHint:n,error:i,errorAction:l,busy:s,otpExpiresAt:c,otpSecondsLeft:g,resendCooldown:p,onResend:u,onUseDifferentEmail:b}){return ue(va,{children:[ue("div",{style:{marginBottom:"var(--space-6)",textAlign:"center"},children:[K(Xn,{as:"h1",size:O.h1,style:{color:"var(--ink-strong)",marginBottom:"var(--space-3)"},children:r}),ue(rt,{as:"p",size:"2",style:{color:"var(--ink-mid)",lineHeight:1.55},children:[t," ",K("span",{style:{fontWeight:600,color:"var(--ink-strong)"},children:e}),"."]})]}),n&&K(Ke.Root,{color:"gray",variant:"surface",size:"1",style:{marginBottom:"var(--space-5)"},children:ue(Ke.Text,{style:{fontFamily:"var(--font-poppins)"},children:["Dev hint \u2014 code is ",K("strong",{children:n})]})}),i&&ue(Ke.Root,{color:"red",variant:"surface",size:"2",style:{marginBottom:"var(--space-5)"},children:[K(Ke.Icon,{children:K(Zn,{})}),ue(Ke.Text,{style:{fontFamily:"var(--font-poppins)"},children:[i,l&&ue(va,{children:[" ",K(et,{type:"button",variant:"ghost",size:"1",onClick:l.onClick,style:{fontWeight:600,textDecoration:"underline",height:"auto",padding:0},children:l.label})]})]})]}),ue("div",{children:[K(Jr,{value:a,onChange:o,disabled:s||g<=0}),s?K(rt,{as:"p",size:"1",style:{color:"var(--ink-mid)",marginTop:"var(--space-3)",textAlign:"center"},children:"Checking code\u2026"}):c&&g<=0?K(rt,{as:"p",size:"1",style:{color:"var(--red-11)",marginTop:"var(--space-3)",textAlign:"center"},children:"Code expired \u2014 resend to get a new one."}):null]}),ue("div",{style:{marginTop:"var(--space-5)",display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--space-3)"},children:[K(et,{type:"button",variant:"ghost",size:"2",disabled:p>0||s,onClick:u,style:{fontWeight:500,color:p>0?"rgba(85, 85, 85, 0.4)":"var(--ink-strong)",textDecoration:p>0?"none":"underline"},children:p>0?`Resend email (${p}s)`:"Resend email"}),K(et,{type:"button",variant:"ghost",size:"2",className:"auth-underline-link",disabled:s,onClick:b,style:{fontWeight:500,color:"var(--ink-strong)"},children:"Use a Different Email"})]})]})}import{jsx as ya}from"react/jsx-runtime";function _({provider:e}){return e==="microsoft"?ya(Qr,{}):ya(Zr,{})}var Jn={google:"Google",microsoft:"Microsoft"};import{useEffect as ei,useRef as ha,useState as tt}from"react";import{Link as Sa,useLocation as ri}from"react-router-dom";import{Avatar as ba,Badge as Ra,DropdownMenu as me,IconButton as xa,Text as je,Tooltip as vr}from"@radix-ui/themes";import{ChevronDownIcon as ti,ChevronLeftIcon as ai,ChevronRightIcon as Ca,Cross1Icon as oi,DotFilledIcon as ka,DotsVerticalIcon as ni,ExitIcon as ii,GearIcon as wa,QuestionMarkCircledIcon as si}from"@radix-ui/react-icons";import{Fragment as st,jsx as m,jsxs as A}from"react/jsx-runtime";var yr="var(--space-9)",Ye=e=>"items"in e,ot=e=>e.badge?`${e.label} \xB7 ${e.badge}`:e.label;function li(e){if(!e)return{};try{let r=JSON.parse(localStorage.getItem(e)??"{}");return!r||typeof r!="object"||Array.isArray(r)?{}:Object.fromEntries(Object.entries(r).filter(t=>typeof t[1]=="boolean"))}catch{return{}}}function ci(e,r){if(e)try{localStorage.setItem(e,JSON.stringify(r))}catch{}}var di="calc(4 * var(--space-9))",pi="calc(var(--space-9) + var(--space-6))",gi="calc(4 * var(--space-9) + var(--space-5))",ui="var(--space-8)",nt="var(--space-5)",it="var(--space-5)",Da="calc(var(--space-5) + var(--space-3))",mi="var(--space-3)",fi=e=>e?"opacity 130ms ease 80ms":"opacity 90ms ease",Ta="opacity 200ms ease";function vi({collapsed:e,onToggle:r,onClose:t,items:a,persistKey:o,utilityHrefs:n,user:i,onSignOut:l,hasCalendarAccounts:s=!1,brandLogoExpandedSrc:c="/expand.svg",brandLogoCollapsedSrc:g="/shrink.svg",helpHref:p,devRoles:u,onDevRoleSelect:b,showDevRoles:y=!1}){let f=ri().pathname,[S,E]=tt(!1),[X,ie]=tt(null),R=()=>ie(null),F=ha(null),H=ha(null),pe=()=>{H.current={back:!0},R()},v=!!t,w=!e||v,$=v?gi:e?pi:di,Z=d=>!d.roles||!!i&&d.roles.includes(i.role),Q=d=>{if(!Z(d))return[];if(!d.bundle||!d.children)return[d];let C=d.children.flatMap(Q);return C.length>0?[{...d,children:C}]:[]},se=a.flatMap(d=>{if(!Ye(d))return Q(d);let C=d.items.flatMap(Q);return C.length>0?[{...d,items:C}]:[]}),Ce=se.filter(d=>!Ye(d)),so=se.flatMap(d=>Ye(d)?d.items:[d]),[Nt,lo]=tt(()=>li(o)),Bt=d=>Nt[d.id]??!!d.defaultCollapsed;function co(d){let C={...Nt,[d.id]:!Bt(d)};lo(C),ci(o,C)}let Mt=new Set(n),po=se.filter(d=>Ye(d)||!Mt.has(d.href)),zt=Ce.find(d=>d.href==="/settings"),Er=Ce.filter(d=>Mt.has(d.href)&&d.href!=="/settings");function sr(d){return d.root??d.href}function Lt(d){return!!d.children?.length&&(sr(d)!=="/calendar"||s)}function Nr(d){let C=sr(d);return f===C||f===d.href||f.startsWith(C+"/")?!0:!!d.bundle&&!!d.children?.some(Nr)}let lr=[];for(let d=so;;){let C=d.find(U=>Lt(U)&&Nr(U));if(!C)break;lr.push(C),d=C.children}let Br=X?.path===f?Math.min(X.depth,lr.length):lr.length,ge=Br>0?lr[Br-1]:void 0,go=()=>{ge&&(H.current={row:ge.href}),ie({path:f,depth:Br-1})};ei(()=>{let d=H.current,C=F.current;if(!d||!C)return;H.current=null,("back"in d?C.querySelector("[data-nav-back]"):Array.from(C.querySelectorAll("[data-nav-href]")).find(Ne=>Ne.dataset.navHref===d.row))?.focus()},[ge?.href]);function Mr(d,C){return d==="/home"||C?f===d:f===d||f.startsWith(d+"/")}function zr(d){return Ft(d,!0)}function Ft(d,C){let U=d.bundle?Nr(d):Mr(sr(d),d.end),Ne=Lt(d),Ot=m(at,{item:d,active:U,expanded:w,uppercase:C,showChevron:Ne,onClick:Ne?pe:void 0},d.href);return w?Ot:m(vr,{content:ot(d),side:"right",delayDuration:300,children:Ot},d.href)}function uo(d){let C=`nav-group-${d.id}`;if(!w)return A("div",{role:"group","aria-label":d.label,children:[m("div",{"aria-hidden":"true",style:{height:1,background:"var(--gray-4)",margin:`var(--space-2) ${nt}`}}),d.items.map(zr)]},C);let U=Bt(d);return A("div",{style:{display:"flex",flexDirection:"column",marginTop:"var(--space-3)"},children:[m(yi,{label:d.label,folded:U,holdsActive:U&&d.items.some(Ne=>Mr(sr(Ne))),controls:C,onToggle:()=>co(d)}),m("div",{id:C,role:"group","aria-label":d.label,hidden:U,children:d.items.map(zr)})]},C)}let mo=f.startsWith("/admin")&&(i?.role==="admin"||i?.role==="operator"),Ht=i?.name?.split(" ").map(d=>d[0]).join("").slice(0,2)||"?";return A("aside",{ref:F,style:{position:"relative",width:$,height:"100%",minHeight:"100vh",background:"var(--shell-surface)",borderRight:"1px solid var(--gray-6)",flexShrink:0,transition:v?"none":"width 200ms ease",zIndex:2},children:[A("div",{style:{width:"100%",height:"100%",minHeight:"100vh",display:"flex",flexDirection:"column",overflow:"hidden"},children:[A("div",{style:{height:yr,flexShrink:0,position:"relative",overflow:"hidden",borderBottom:"1px solid var(--border-hairline)"},children:[m("img",{src:c,alt:"",height:40,style:{display:"block",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",transition:Ta,opacity:w?1:0,pointerEvents:"none",userSelect:"none"}}),m("img",{src:g,alt:"",height:40,style:{display:"block",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",transition:Ta,opacity:w?0:1,pointerEvents:"none",userSelect:"none"}}),v&&m(xa,{variant:"ghost",color:"gray",size:"1",onClick:t,"aria-label":"Close menu",style:{position:"absolute",right:"var(--space-2)",top:"50%",transform:"translateY(-50%)"},children:m(oi,{style:h("--space-3")})})]}),m("nav",{"aria-label":"Main navigation",style:{flex:1,overflowY:"auto",overflowX:"hidden",paddingTop:"var(--space-5)",display:"flex",flexDirection:"column"},children:ge?A(st,{children:[(()=>{let d=m(at,{item:{label:ge.label,href:"#",Icon:ai},active:!1,expanded:w,uppercase:!0,asButton:!0,onClick:go});return w?d:m(vr,{content:ge.label,side:"right",delayDuration:300,children:d})})(),ge.children.map(d=>Ft(d,!!ge.bundle))]}):po.map(d=>Ye(d)?uo(d):zr(d))}),!ge&&Er.length>0&&m("nav",{"aria-label":"Utility navigation",style:{flexShrink:0,borderTop:"1px solid var(--gray-4)",paddingTop:"var(--space-2)",paddingBottom:"var(--space-2)",display:"flex",flexDirection:"column"},children:Er.map(d=>{let C=Mr(d.href),U=m(at,{item:d,active:C,expanded:w,uppercase:!0,showChevron:!!d.children,onClick:d.children?pe:void 0},d.href);return w?U:m(vr,{content:ot(d),side:"right",delayDuration:300,children:U},d.href)})}),A("div",{style:{borderTop:Er.length>0?"none":"1px solid var(--gray-4)",padding:w?"var(--space-2) var(--space-4)":"var(--space-2) 0",flexShrink:0,display:"flex",flexDirection:"column",gap:"var(--space-2)"},children:[w&&mo&&A(Ra,{color:"gray",variant:"soft",highContrast:!0,size:"1",radius:"full",style:{alignSelf:"flex-start"},children:[m(ka,{style:h("--space-2")}),"Administering platform"]}),A("div",{style:{display:"flex",flexDirection:w?"row":"column",alignItems:"center",justifyContent:w?"space-between":"center",gap:"var(--space-2)"},children:[w?A("div",{className:"shell-profile-chip",style:{display:"flex",alignItems:"center",gap:"var(--space-2)",minWidth:0,flex:1,padding:"var(--space-1)",borderRadius:"var(--radius-3)"},children:[m(ba,{size:"2",radius:"full",src:i?.avatarSrc,fallback:Ht,color:"gray",variant:"soft",style:{flexShrink:0}}),m(je,{as:"p",size:"2",weight:"medium",truncate:!0,style:{color:"var(--shell-ink-strong)"},children:i?.name})]}):m(vr,{content:i?.name??"Account",side:"right",delayDuration:300,children:m(ba,{size:"3",radius:"full",src:i?.avatarSrc,fallback:Ht,color:"gray",variant:"soft"})}),A(me.Root,{children:[m(me.Trigger,{children:m(xa,{variant:"ghost",color:"gray","aria-label":"Account menu",className:"sidebar-icon-btn",style:{flexShrink:0},children:m(ni,{style:h("--space-4")})})}),A(me.Content,{align:w?"end":"start",side:w?"top":"right",style:{minWidth:200},children:[zt&&m(me.Item,{asChild:!0,children:A(Sa,{to:zt.href,onClick:R,children:[m(wa,{}),"Settings"]})}),p&&A(me.Item,{onClick:()=>window.open(p,"_blank","noopener,noreferrer"),children:[m(si,{}),"Help"]}),m(me.Separator,{}),A(me.Item,{color:"red",onClick:()=>E(!0),children:[m(ii,{}),"Log Out"]}),y&&u&&u.length>0&&A(st,{children:[m(me.Separator,{}),m("div",{style:{padding:"var(--space-1) var(--space-3)"},children:m(je,{size:"1",style:{fontFamily:"monospace",color:"var(--gray-11)",letterSpacing:"0.04em",textTransform:"uppercase"},children:"Dev \xB7 switch role"})}),u.map(d=>A(me.Item,{onClick:()=>b?.(d.email),disabled:i?.role===d.role,children:[m(wa,{}),d.label,A(je,{size:"1",color:"gray",style:{marginLeft:"auto"},children:[d.role,"@"]})]},d.role))]})]})]})]})]})]}),!v&&m("button",{onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",className:"sidebar-collapse-btn",style:{top:"calc(var(--space-9) / 2)",transform:"translateY(-50%)",right:"calc(-1 * var(--space-3))"},children:m(hi,{flipped:e})}),m(Hr,{open:S,onOpenChange:E,title:"Confirm Logout",description:"Are you sure you want to log out?",onConfirm:l})]})}function at({item:e,active:r,expanded:t,onClick:a,asButton:o,showChevron:n,uppercase:i}){let l={position:"relative",textDecoration:"none",display:"flex",alignItems:"center",height:ui,flexShrink:0,paddingLeft:Da,paddingRight:t?`calc(${it} + var(--space-1))`:0,gap:t?mi:0,color:r?"var(--shell-ink-strong)":"var(--shell-ink-mid)",cursor:"pointer"},s=A(st,{children:[r&&m("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:0,width:"var(--space-1)",height:"100%",background:"var(--accent-9)",borderRadius:"0 var(--radius-1) var(--radius-1) 0"}}),m("span",{"aria-hidden":"true",className:"nav-pill",style:{position:"absolute",top:0,bottom:0,left:nt,right:t?it:nt,borderRadius:"var(--radius-3)",background:r?"var(--accent-9)":"transparent",transition:"background 80ms ease"}}),m(e.Icon,{width:20,height:20,style:{position:"relative",flexShrink:0}}),A("span",{style:{position:"relative",display:"flex",alignItems:"center",gap:"var(--space-1)",minWidth:0,overflow:"hidden",maxWidth:t?void 0:0,opacity:t?1:0,transition:fi(t)},children:[m(je,{as:"span",size:"3",weight:r?"medium":"regular",style:{lineHeight:1.3,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0,textTransform:i?"uppercase":void 0},children:e.label}),e.badge&&m(Ra,{color:"gray",variant:r?"solid":"soft",highContrast:r,size:"1",radius:"full",style:{flexShrink:0,paddingInline:"var(--space-1)",textTransform:i?"uppercase":void 0},children:e.badge})]}),n&&t&&(r?m("span",{style:{position:"relative",marginLeft:"auto",marginRight:"var(--space-1)",flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-5)",height:"var(--space-5)",background:"var(--color-panel-solid)",borderRadius:"var(--radius-2)",boxShadow:"0 1px 2px rgba(0,0,0,0.12)"},children:m(Ca,{style:{...h("--space-4"),color:"var(--gray-11)"}})}):m(Ca,{style:{...h("--space-4"),position:"relative",marginLeft:"auto",color:"var(--shell-ink-mid)",flexShrink:0}}))]});return o?m("button",{type:"button",onClick:a,"data-nav-back":"",className:"shell-nav-item",style:{...l,background:"none",border:"none",width:"100%",textAlign:"left",font:"inherit"},children:s}):m(Sa,{to:e.href,onClick:a,className:"shell-nav-item","data-nav-href":e.href,"data-active":r?"true":void 0,"aria-current":r?"page":void 0,title:t?ot(e):void 0,style:l,children:s})}function yi({label:e,folded:r,holdsActive:t,controls:a,onToggle:o}){return A("button",{type:"button",onClick:o,"aria-expanded":!r,"aria-controls":a,className:"shell-nav-group","data-holds-active":t?"true":void 0,style:{display:"flex",alignItems:"center",gap:"var(--space-1)",height:"var(--space-6)",flexShrink:0,width:"100%",paddingLeft:Da,paddingRight:`calc(${it} + var(--space-1))`,background:"none",border:"none",font:"inherit",textAlign:"left",cursor:"pointer",color:t?"var(--shell-ink-strong)":"var(--shell-ink-mid)"},children:[m(je,{as:"span",size:"1",weight:"medium",style:{textTransform:"uppercase",letterSpacing:"0.04em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:e}),t&&m(ka,{"aria-hidden":"true",style:{...h("--space-3"),color:"var(--accent-9)",flexShrink:0}}),m(ti,{"aria-hidden":"true",style:{...h("--space-4"),marginLeft:"auto",flexShrink:0,transform:r?"rotate(-90deg)":void 0,transition:"transform 120ms ease"}})]})}function hi({flipped:e}){return A("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{transform:e?"scaleX(-1)":void 0},children:[m("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5",stroke:"currentColor"}),m("path",{d:"M5.5 2.5v11",stroke:"currentColor"}),m("path",{d:"M11 5.5 8.5 8l2.5 2.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]})}import{Link as bi,useLocation as xi}from"react-router-dom";import{HamburgerMenuIcon as Ci,MagnifyingGlassIcon as wi,BellIcon as Ti}from"@radix-ui/react-icons";import{Flex as Si,Heading as Ri,IconButton as ki,Text as Aa,Tooltip as Di}from"@radix-ui/themes";import{Fragment as Ni,jsx as V,jsxs as hr}from"react/jsx-runtime";var Ai=[["/home","Home","/home","Home"],["/calendar/syncs","Calendar","/calendar/syncs","Manage Syncs"],["/calendar/view","Calendar","/calendar/syncs","My Calendar"],["/calendar","Calendar","/calendar/syncs","Manage Syncs"],["/settings/account","Settings","/settings/account","Account"],["/settings/linked","Settings","/settings/account","Linked Account"],["/settings","Settings","/settings/account","Settings"]],Ii=[["/admin/overview","Overview"],["/admin/users","Users"],["/admin/monitoring","Monitoring"],["/admin/calendar-ops","Calendar Ops"],["/admin/logs","Logs"],["/admin/security","Security"],["/admin/audit","Audit Log"]];function Pi(e,r,t){if(e==="/admin"||e.startsWith("/admin/")){let l=t.find(([s])=>e===s||e.startsWith(s+"/"));return{section:"Admin Portal",sectionHref:"/admin/overview",page:l?l[1]:"Admin Portal"}}if(e==="/calendar/syncs/new")return{section:"Calendar",sectionHref:"/calendar/syncs",page:"New Sync"};if(/^\/calendar\/syncs\/[^/]+$/.test(e))return{section:"Calendar",sectionHref:"/calendar/syncs",page:"Edit Sync"};let a=r.find(([l,,,,s])=>s?e===l:e===l||e.startsWith(l+"/"));if(!a)return{section:"Home",sectionHref:"/home",page:"Home"};let[,o,n,i]=a;return{section:o,sectionHref:n,page:i}}function Ei({onSearchOpen:e,onMenuOpen:r,showMenu:t,titles:a=Ai,adminTitles:o=Ii}){let n=xi().pathname;return hr("header",{style:{height:yr,background:"var(--accent-9)",borderBottom:"1px solid var(--border-hairline)",flexShrink:0,display:"flex",alignItems:"center",padding:"0 var(--space-6)",gap:"var(--space-4)"},children:[t&&V(ki,{variant:"ghost",size:"1",onClick:r,"aria-label":"Open navigation",style:{marginRight:"var(--space-1)",color:"var(--shell-ink-strong)"},children:V(Ci,{style:h("--space-4")})}),(()=>{let{section:i,sectionHref:l,page:s}=Pi(n,a,o);return hr(Si,{align:"baseline",gap:"2",style:{minWidth:0,overflow:"hidden"},children:[i!==s&&hr(Ni,{children:[V(Aa,{asChild:!0,size:"3",weight:"regular",children:V(bi,{to:l,style:{color:"var(--shell-ink-mid)",whiteSpace:"nowrap",textDecoration:"none",overflow:"hidden",textOverflow:"ellipsis",flexShrink:0},className:"topbar-breadcrumb-link",children:i})}),V(Aa,{size:"3",weight:"regular",className:"topbar-breadcrumb-sep",style:{color:"var(--shell-ink-mid)",flexShrink:0},children:"/"})]}),V(Ri,{as:"h1",size:O.h1,weight:"medium",style:{color:"var(--shell-ink-strong)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:s})]})})(),V("div",{style:{flex:1}}),hr("button",{className:"topbar-search",onClick:e,"aria-label":"Search (\u2318K)",children:[V(wi,{width:16,height:16,style:{color:"var(--shell-ink-strong)",flexShrink:0}}),V("span",{className:"topbar-search-placeholder",children:"Search for something"})]}),V(Di,{content:"Coming soon",children:V("span",{children:V("button",{className:"topbar-icon-circle","aria-label":"Notifications (coming soon)",disabled:!0,children:V(Ti,{style:h("--space-4")})})})})]})}import{useEffect as Ia,useRef as Pa,useState as lt}from"react";import{Dialog as ct,Flex as Ea,Spinner as Bi,Text as re,TextField as Mi,VisuallyHidden as zi}from"@radix-ui/themes";import{CalendarIcon as Li,MagnifyingGlassIcon as Fi,PersonIcon as Hi,ReaderIcon as Oi}from"@radix-ui/react-icons";import{Fragment as Gi,jsx as T,jsxs as Y}from"react/jsx-runtime";var _i={app:Li,people:Hi,page:Oi},Vi={app:"Apps",people:"People",page:"Pages"};function Wi(e){let r=["app","people","page"],t=[],a=0;for(let o of r){let n=e.filter(i=>i.type===o);n.length>0&&(t.push({type:o,label:Vi[o],items:n,startIdx:a}),a+=n.length)}return t}function $i({open:e,onClose:r,results:t,onSelectResult:a,title:o="Search",placeholder:n="Search\u2026"}){return T(ct.Root,{open:e,onOpenChange:i=>!i&&r(),children:T(ct.Content,{"aria-describedby":void 0,style:{padding:0,maxWidth:"calc(9 * var(--space-9) + var(--space-2))",overflow:"hidden",boxShadow:"0 4px 8px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.10), 0 0 0 1px var(--gray-5)"},children:T(Ui,{onClose:r,resultPool:t,onSelectResult:a,title:o,placeholder:n})})})}function Ui({onClose:e,resultPool:r,onSelectResult:t,title:a,placeholder:o}){let[n,i]=lt(""),[l,s]=lt(null),[c,g]=lt(-1),p=Pa(null),u=Pa(null),b=!!l&&l.q===n,y=b?l.items:[],f=n.trim()?b?y.length?"results":"no-match":"searching":"prompt";Ia(()=>{if(!n.trim())return;let R=setTimeout(()=>{let F=n.toLowerCase(),H=r.filter(pe=>pe.title.toLowerCase().includes(F)||pe.subtitle.toLowerCase().includes(F));s({q:n,items:H}),g(-1)},320);return()=>clearTimeout(R)},[n,r]),Ia(()=>{if(c<0||!u.current)return;u.current.querySelector(`[data-idx="${c}"]`)?.scrollIntoView({block:"nearest"})},[c]);function S(R){R.key==="Escape"?e():R.key==="ArrowDown"?(R.preventDefault(),g(F=>Math.min(F+1,y.length-1))):R.key==="ArrowUp"?(R.preventDefault(),g(F=>Math.max(F-1,0))):R.key==="Enter"&&(R.preventDefault(),c>=0&&y[c]&&(t(y[c]),e()))}function E(R){t(R),e()}let X=Wi(y),ie="calc(2 * var(--space-9) + var(--space-6))";return Y(Gi,{children:[T(zi,{children:T(ct.Title,{children:a})}),Y("div",{style:{display:"flex",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-3) var(--space-4)",borderBottom:"1px solid var(--gray-5)"},children:[f==="searching"?T(Bi,{size:"1",style:{flexShrink:0}}):T(Fi,{width:16,height:16,style:{color:"var(--gray-9)",flexShrink:0}}),T(Mi.Root,{ref:p,autoFocus:!0,type:"text",placeholder:o,value:n,onChange:R=>i(R.target.value),onKeyDown:S,className:"search-overlay-input",style:{flex:1,border:"none",outline:"none",background:"transparent",boxShadow:"none","--text-field-selection-color":"unset"}}),T("kbd",{style:{color:"var(--gray-11)",background:"var(--gray-3)",border:"1px solid var(--gray-5)",borderRadius:"var(--radius-1)",padding:"var(--space-1) var(--space-2)",flexShrink:0},children:T(re,{size:"1",as:"span",children:"Esc"})})]}),Y("div",{ref:u,style:{minHeight:ie,maxHeight:"calc(6 * var(--space-9) + var(--space-7))",overflowY:"auto"},children:[f==="prompt"&&T(Ea,{align:"center",justify:"center",style:{height:ie},children:T(re,{size:"2",color:"gray",children:"Type to search\u2026"})}),f==="no-match"&&T(Ea,{align:"center",justify:"center",style:{height:ie},children:Y("div",{style:{textAlign:"center"},children:[Y(re,{size:"2",color:"gray",as:"p",children:["No results for \u201C",n,"\u201D"]}),T(re,{size:"1",color:"gray",as:"p",mt:"1",children:"Try searching with different keywords"})]})}),f==="results"&&T("div",{style:{padding:"var(--space-2)"},children:X.map(R=>{let F=_i[R.type];return Y("div",{style:{marginBottom:"var(--space-1)"},children:[T("div",{style:{padding:"var(--space-2) var(--space-3) var(--space-1)",display:"flex",alignItems:"center",gap:"var(--space-2)"},children:T(re,{size:"1",style:{color:"var(--gray-11)",fontWeight:500,letterSpacing:"0.04em",textTransform:"uppercase",fontFamily:"var(--font-poppins)"},children:R.label})}),R.items.map((H,pe)=>{let v=R.startIdx+pe,w=c===v;return Y("button",{"data-idx":v,onClick:()=>E(H),onMouseEnter:()=>g(v),className:"search-result-item",style:{width:"100%",display:"flex",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-2) var(--space-3)",borderRadius:"var(--radius-2)",border:"none",cursor:"pointer",textAlign:"left",background:w?"var(--gray-3)":"transparent"},children:[T("div",{style:{width:"var(--space-6)",height:"var(--space-6)",borderRadius:"var(--radius-1)",background:w?"var(--accent-a3)":"var(--gray-3)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"background 100ms ease"},children:T(F,{width:12,height:12,style:{color:w?"var(--accent-11)":"var(--gray-9)"}})}),Y("div",{style:{flex:1,minWidth:0},children:[T(re,{as:"p",size:"2",weight:"medium",style:{color:w?"var(--gray-12)":"var(--gray-11)",lineHeight:1.3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:H.title}),T(re,{as:"p",size:"1",style:{color:"var(--gray-11)",lineHeight:1.3,marginTop:"1px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:H.subtitle})]}),w&&T("kbd",{style:{color:"var(--gray-9)",background:"var(--gray-4)",border:"1px solid var(--gray-5)",borderRadius:"var(--radius-1)",padding:"var(--space-1)",flexShrink:0},children:T(re,{size:"1",as:"span",className:"data-mono",children:"\u21B5"})})]},H.id)})]},R.type)})})]}),f!=="prompt"&&Y("div",{style:{borderTop:"1px solid var(--gray-4)",padding:"var(--space-2) var(--space-4)",display:"flex",gap:"var(--space-4)"},children:[Y(re,{as:"span",size:"1",color:"gray",children:[T("kbd",{className:"data-mono",children:"\u2191\u2193"})," navigate"]}),Y(re,{as:"span",size:"1",color:"gray",children:[T("kbd",{className:"data-mono",children:"\u21B5"})," open"]}),Y(re,{as:"span",size:"1",color:"gray",children:[T("kbd",{className:"data-mono",children:"Esc"})," close"]})]})]})}function j(e,r){for(let t of e){let a=t.calendars.find(o=>o.id===r);if(a)return{account:t,calendar:a}}}import dt from"dayjs";import{Flex as Na,Text as Ba}from"@radix-ui/themes";import{jsx as pt,jsxs as Ki}from"react/jsx-runtime";function gt({date:e,today:r=new Date}){let t=dt(e).isSame(r,"day");return Ki(Na,{direction:"column",align:"center",gap:"1",py:"1",children:[pt(Ba,{size:"1",weight:"medium",color:"gray",style:{letterSpacing:"0.04em"},children:dt(e).format("ddd").toUpperCase()}),pt(Na,{align:"center",justify:"center",style:{width:"var(--space-6)",height:"var(--space-6)",borderRadius:"50%",background:t?"var(--accent-9)":"transparent",lineHeight:1},children:pt(Ba,{size:"3",weight:t?"medium":"regular",style:{color:t?"var(--accent-contrast)":"var(--gray-12)",lineHeight:1},children:dt(e).format("D")})})]})}import{Box as qe,Checkbox as Yi,Flex as ji,RadioGroup as Ma,Text as Xe}from"@radix-ui/themes";import{jsx as M,jsxs as La}from"react/jsx-runtime";function qi(e){return e.flatMap(r=>r.calendars.map(t=>({calendarId:t.id,calendarName:t.name,email:r.email,provider:r.provider})))}function Xi({provider:e}){return M("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-5)",height:"var(--space-5)",flexShrink:0},children:M(_,{provider:e})})}function za({row:e,control:r,selected:t,disabled:a,disabledLabel:o}){return La(Xe,{as:"label",size:"2",style:{display:"flex",alignItems:"center",gap:"var(--space-3)",width:"100%",paddingBlock:"var(--space-3)",paddingInline:"var(--space-4)",cursor:a?"not-allowed":"pointer",opacity:a?.45:1,background:t?"var(--accent-2)":"transparent",color:"var(--gray-12)"},children:[M(Xi,{provider:e.provider}),La(ji,{direction:"column",gap:"0",style:{minWidth:0,flex:1},children:[M(Xe,{size:"2",weight:"medium",truncate:!0,style:{color:"var(--gray-12)"},children:e.calendarName}),M(Xe,{size:"1",color:"gray",truncate:!0,children:e.email})]}),o?M(Xe,{size:"1",color:"gray",style:{flexShrink:0},children:o}):null,M(qe,{style:{flexShrink:0,display:"flex",alignItems:"center"},children:r})]})}function Zi({accounts:e,mode:r,sourceCalendarIds:t,targetCalendarId:a,takenSourceIds:o,onToggleSource:n,onSelectTarget:i,fill:l=!1}){let s=qi(e),g=r==="sources"&&s.length>0&&s.every(p=>p.calendarId===a||o.has(p.calendarId))?M(qe,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",background:"var(--color-panel-solid)",padding:"var(--space-4)",...l?{flex:1,minHeight:0}:{}},children:M(Xe,{as:"p",size:"2",color:"gray",align:"center",children:"All your calendars are already used as sources in other syncs, or set as this sync's target. Remove a calendar from another sync to make it available here."})}):M(qe,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",background:"var(--color-panel-solid)",...l?{flex:1,minHeight:0,overflowY:"auto"}:{overflow:"hidden"}},children:s.map((p,u)=>{if(r==="sources"){let f=p.calendarId===a,S=o.has(p.calendarId),E=f||S,X=t.includes(p.calendarId);return M(qe,{style:{borderTop:u>0?"1px solid var(--gray-4)":void 0},children:M(za,{row:p,selected:X,disabled:E,disabledLabel:f?"Target":S?"In use":void 0,control:M(Yi,{checked:X,disabled:E,onCheckedChange:()=>{E||n(p.calendarId)}})})},p.calendarId)}let b=t.includes(p.calendarId),y=p.calendarId===a;return M(qe,{style:{borderTop:u>0?"1px solid var(--gray-4)":void 0},children:M(za,{row:p,selected:y,disabled:b,disabledLabel:b?"Source":void 0,control:M(Ma.Item,{value:p.calendarId,disabled:b})})},p.calendarId)})});return r==="target"?M(Ma.Root,{value:a??"",onValueChange:p=>{p&&i(p)},style:l?{flex:1,minHeight:0,display:"flex",flexDirection:"column"}:void 0,children:g}):g}import{Button as Fa,Flex as ut,Heading as Qi,IconButton as Ha}from"@radix-ui/themes";import{ChevronLeftIcon as Ji,ChevronRightIcon as es}from"@radix-ui/react-icons";import{Navigate as mt}from"react-big-calendar";import{jsx as ye,jsxs as Oa}from"react/jsx-runtime";function ft({label:e,view:r,onNavigate:t,onView:a}){return Oa(ut,{align:"center",justify:"between",gap:"3",wrap:"wrap",className:"calendar-toolbar",children:[Oa(ut,{align:"center",gap:"2",children:[ye(Ha,{size:"2",variant:"soft",color:"gray",radius:"full","aria-label":"Previous",onClick:()=>t(mt.PREVIOUS),children:ye(Ji,{})}),ye(Fa,{size:"2",variant:"soft",color:"gray",onClick:()=>t(mt.TODAY),children:"Today"}),ye(Ha,{size:"2",variant:"soft",color:"gray",radius:"full","aria-label":"Next",onClick:()=>t(mt.NEXT),children:ye(es,{})})]}),ye(Qi,{as:"h2",size:O.h2,weight:"medium",style:{color:"var(--gray-12)"},children:e}),ye(ut,{gap:"1",style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",padding:"var(--space-1)",background:"var(--gray-2)"},children:["week","month"].map(o=>ye(Fa,{size:"2",variant:r===o?"solid":"soft",className:r===o?"btn-amber-primary":void 0,color:r===o?void 0:"gray",onClick:()=>a(o),style:r===o?void 0:{background:"transparent"},children:o==="week"?"Week":"Month"},o))})]})}import{Button as rs,Flex as br,Spinner as ts,Text as vt}from"@radix-ui/themes";import{ChevronRightIcon as as,ExclamationTriangleIcon as os}from"@radix-ui/react-icons";import{jsx as te,jsxs as Ze}from"react/jsx-runtime";var Fe={google:{label:"Google Calendar",description:"Connect a Google account calendar"},microsoft:{label:"Outlook Calendar",description:"Connect an Outlook account calendar"}},ns=["google","microsoft"];function yt({connectingProvider:e,failedProvider:r,exhausted:t=!1,onConnect:a}){return te(br,{direction:"column",gap:"3",style:{width:"100%",textAlign:"left"},children:ns.map(o=>{let n=Fe[o],i=e===o;return Ze("div",{children:[Ze("button",{type:"button",className:"provider-choice",onClick:()=>a(o),disabled:e!==null,"data-connecting":i?"true":void 0,"aria-busy":i||void 0,"aria-label":`Connect ${n.label}`,children:[te(B,{children:te(_,{provider:o})}),Ze(br,{direction:"column",className:"provider-choice__copy",gap:"1",children:[te(vt,{size:"3",weight:"medium",truncate:!0,style:{color:"var(--gray-12)"},children:n.label}),te(vt,{size:"2",color:"gray",truncate:!0,children:n.description})]}),te("span",{className:"provider-choice__chevron","aria-hidden":!0,children:i?te(ts,{size:"2"}):te(as,{style:h("--space-5")})})]}),r===o&&Ze(br,{align:"center",justify:"between",gap:"3",mt:"2",px:"1",children:[Ze(br,{align:"center",gap:"2",children:[te(os,{style:{...h("--space-4"),color:"var(--red-9)",flexShrink:0}}),te(vt,{size:"2",style:{color:"var(--red-11)"},children:t?`No more ${n.label} accounts available to connect.`:`Couldn't connect ${n.label}. Please try again.`})]}),!t&&te(rs,{variant:"ghost",size:"1",onClick:()=>a(o),children:"Retry"})]})]},o)})})}import{Badge as _a,Box as is,DropdownMenu as Qe,Flex as Va,IconButton as ss,Text as Wa}from"@radix-ui/themes";import{DotsVerticalIcon as ls,ReloadIcon as cs,TrashIcon as ds}from"@radix-ui/react-icons";import{jsx as q,jsxs as ke}from"react/jsx-runtime";function ps({account:e,onRemove:r,onReconnect:t,onClick:a}){let o=e.authStatus==="reauth",n=e.authStatus==="failed",i=q(Wa,{size:"2",weight:"medium",truncate:!0,style:{color:"var(--gray-12)"},children:e.displayName});return ke(is,{onClick:a,style:{width:"100%",minWidth:0,height:x.connectedAccountCardH,boxSizing:"border-box",padding:"var(--space-3)",background:"var(--color-panel-solid)",border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",display:"flex",alignItems:"center",gap:"var(--space-3)",cursor:a?"pointer":void 0},children:[q(B,{size:"var(--space-6)",children:q(_,{provider:e.provider})}),ke(Va,{direction:"column",style:{flex:1,minWidth:0},children:[ke(Va,{align:"center",gap:"2",style:{minWidth:0},children:[a?q("button",{type:"button",className:"card-title-button",onClick:l=>{l.stopPropagation(),a()},children:i}):i,o&&q(_a,{color:"amber",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Needs reconnect"}),n&&q(_a,{color:"red",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Connection failed"})]}),q(Wa,{size:"1",color:"gray",truncate:!0,children:e.email})]}),ke(Qe.Root,{children:[q(Qe.Trigger,{children:q(ss,{variant:"ghost",color:"gray",size:"1","aria-label":`${e.displayName} actions`,onClick:l=>l.stopPropagation(),children:q(ls,{})})}),ke(Qe.Content,{align:"end",onClick:l=>l.stopPropagation(),children:[(o||n)&&t&&ke(Qe.Item,{onSelect:t,children:[q(cs,{})," Reconnect"]}),ke(Qe.Item,{color:"red",onSelect:r,children:[q(ds,{})," Remove account"]})]})]})]})}import{Flex as gs,Text as us,Heading as ms}from"@radix-ui/themes";import{jsx as ht,jsxs as vs}from"react/jsx-runtime";function fs({icon:e,title:r,description:t,action:a,headingAs:o="h2"}){return vs(gs,{direction:"column",align:"center",gap:"3",style:{width:"100%",paddingTop:"var(--space-9)",textAlign:"center"},children:[ht(B,{size:"var(--space-8)",children:e}),ht(ms,{as:o,size:O[o],weight:"medium",align:"center",children:r}),t&&ht(us,{size:"2",color:"gray",align:"center",style:{maxWidth:x.emptyStateCopyMax},children:t}),a]})}import{useState as ys}from"react";import{Dialog as Je,Flex as hs,Text as xr,Checkbox as bs,Button as $a}from"@radix-ui/themes";import{Fragment as Cs,jsx as W,jsxs as bt}from"react/jsx-runtime";function De({account:e,onOpenChange:r,onImport:t,initiallySelectedIds:a,disabledIds:o,disabledReason:n,title:i="Calendars",description:l="Choose which calendars you want to import.",confirmLabel:s="Import Calendars"}){let c=e?`${e.id}:${(a??e.calendars.map(g=>g.id)).join(",")}`:"closed";return W(Je.Root,{open:!!e,onOpenChange:r,children:W(Je.Content,{maxWidth:x.dialogMd,onInteractOutside:g=>g.preventDefault(),children:e&&W(xs,{account:e,initiallySelectedIds:a,disabledIds:o,disabledReason:n,title:i,description:l,confirmLabel:s,onImport:t},c)})})}function xs({account:e,initiallySelectedIds:r,disabledIds:t,disabledReason:a,title:o,description:n,confirmLabel:i,onImport:l}){let[s,c]=ys(()=>new Set(r??e.calendars.map(u=>u.id))),g=new Set(t??[]);function p(u){g.has(u)||c(b=>{let y=new Set(b);return y.has(u)?y.delete(u):y.add(u),y})}return bt(Cs,{children:[W(Je.Title,{size:"5",weight:"medium",mb:"1",children:o}),W(Je.Description,{size:"2",color:"gray",mb:"2",children:n}),W(xr,{as:"p",size:"2",weight:"medium",mb:"5",style:{color:"var(--gray-12)"},children:e.email}),W(hs,{direction:"column",gap:"3",mb:"5",children:e.calendars.map(u=>{let b=s.has(u.id),y=g.has(u.id);return bt(xr,{as:"label",size:"3",className:"calendar-picker-row","data-selected":b||void 0,"data-disabled":y?"true":void 0,style:{display:"flex",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-4)",cursor:y?"default":"pointer"},children:[W(bs,{checked:b,disabled:y,onCheckedChange:()=>p(u.id)}),W(xr,{weight:"medium",truncate:!0,style:{flex:1,minWidth:0,color:"var(--gray-12)"},children:u.name}),y&&a&&W(xr,{size:"1",color:"gray",style:{flexShrink:0},children:a})]},u.id)})}),bt(J,{justify:"between",noTopMargin:!0,pad:"var(--space-5)",radius:"var(--radius-4)",children:[W(Je.Close,{children:W($a,{size:"2",variant:"outline",color:"gray",children:"Cancel"})}),W($a,{size:"2",className:"btn-amber-primary",disabled:s.size===0,onClick:()=>l(Array.from(s)),children:i})]})]})}import{Box as er,Flex as ws,Text as ae}from"@radix-ui/themes";import{jsx as z,jsxs as Cr}from"react/jsx-runtime";function Ts(e){let r=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!r)return"white";let t=parseInt(r[1],16),a=n=>{let i=n/255;return i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)};return .2126*a(t>>16&255)+.7152*a(t>>8&255)+.0722*a(t&255)>.45?"black":"white"}function Ua({tone:e,title:r,meta:t,accentColor:a}){let o=e==="synced"?a||"var(--accent-9)":"var(--blue-11)",n=e==="synced"?a?Ts(a):"var(--accent-contrast)":"white";return Cr(er,{style:{background:o,borderRadius:"var(--radius-2)",padding:"var(--space-2) var(--space-3)"},children:[z(ae,{as:"p",size:"2",weight:"medium",style:{color:n},children:r}),t?z(ae,{as:"p",size:"1",style:{color:n},children:t}):null]})}var Ss="Busy",Rs={title:"Gym",time:"10:00 AM",location:"Flex Gym on 16th Ave",description:"Workout notes"};function ks({hasSources:e,hasTarget:r,sourceLabel:t,targetLabel:a,showTitle:o,showDescription:n,showLocation:i,tagLabel:l,accentColor:s,sampleEvent:c=Rs}){let g=c.title,p=[c.time,c.location].filter(Boolean).join(" \xB7 "),u=l?.trim()||Ss,b=o?`${c.title} - (${u})`:u,y=[c.time].filter(Boolean);i&&c.location&&y.push(c.location),n&&c.description&&y.push(c.description);let f=y.join(" \xB7 ");return Cr(ws,{direction:"column",gap:"4",style:{padding:"var(--space-4)"},children:[z(ae,{as:"p",className:"ds-section-label",style:{textAlign:"center"},children:"Sync Preview"}),z(ae,{as:"p",size:"1",color:"gray",style:{textAlign:"center",marginTop:"calc(-1 * var(--space-2))"},children:"Example event \u2014 not from your calendars."}),Cr(er,{children:[z(ae,{as:"p",size:"1",color:"gray",mb:"1",children:"Sources"}),z(ae,{as:"p",size:"1",weight:"medium",mb:"2",truncate:!0,style:{color:"var(--gray-12)"},children:e?t||"Selected sources":"\u2014"}),z(er,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-2)",padding:"var(--space-2)",background:"var(--gray-2)"},children:z(Ua,{tone:"source",title:g,meta:p})})]}),Cr(er,{children:[z(ae,{as:"p",size:"1",color:"gray",mb:"1",children:"Target"}),z(ae,{as:"p",size:"1",weight:"medium",mb:"2",truncate:!0,style:{color:"var(--gray-12)"},children:r?a||"Selected target":"\u2014"}),z(er,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-2)",padding:"var(--space-2)",background:"var(--gray-2)"},children:r?z(Ua,{tone:"synced",title:b,meta:f,...s?{accentColor:s}:{}}):z(ae,{as:"p",size:"2",color:"gray",children:"Pick one target calendar"})})]}),!e||!r?z(ae,{as:"p",size:"1",color:"gray",style:{textAlign:"center"},children:"Select one or more sources, then one target"}):z(ae,{as:"p",size:"1",color:"gray",style:{textAlign:"center"},children:"Only the highlighted block is posted to the target"})]})}import{Flex as xt,Text as Ct}from"@radix-ui/themes";import{CheckIcon as Ds}from"@radix-ui/react-icons";import{jsx as He,jsxs as Ga}from"react/jsx-runtime";function wt({steps:e,current:r}){return He("div",{role:"list","aria-label":"Wizard progress",style:{display:"flex",flexWrap:"wrap",width:"100%",flexShrink:0,marginBottom:0,border:"1px solid var(--gray-5)",borderRadius:"var(--radius-4)",background:"var(--color-panel-solid)",overflow:"hidden"},children:e.map((t,a)=>{let o=a+1,n=o===r,i=o<r;return Ga(xt,{align:"start",gap:"3",role:"listitem","aria-current":n?"step":void 0,style:{flex:"1 1 calc(3 * var(--space-9) + var(--space-6))",minWidth:"calc(3 * var(--space-9) + var(--space-6))",paddingTop:"var(--space-4)",paddingBottom:"var(--space-4)",paddingLeft:"var(--space-4)",paddingRight:"var(--space-4)",marginBottom:"-1px",borderBottom:n?"2px solid var(--accent-9)":"2px solid transparent"},children:[He(xt,{align:"center",justify:"center",style:{width:"var(--space-6)",height:"var(--space-6)",borderRadius:"50%",flexShrink:0,marginTop:"var(--space-1)",background:i?"var(--green-9)":n?"var(--accent-9)":"var(--gray-3)",color:i?"white":n?"var(--accent-contrast)":"var(--gray-11)"},children:i?He(Ds,{style:h("--space-3")}):He(Ct,{size:"1",weight:"medium",children:t.n})}),Ga(xt,{direction:"column",gap:"1",style:{minWidth:0,flex:1,paddingTop:"var(--space-1)"},children:[He(Ct,{size:"2",weight:"medium",style:{color:n||i?"var(--gray-12)":"var(--gray-10)",lineHeight:"var(--line-height-2)"},children:t.title}),He(Ct,{size:"1",color:"gray",style:{lineHeight:"var(--line-height-1)"},children:t.description})]})]},t.n)})})}import{jsx as Ya}from"react/jsx-runtime";var As=[{n:"01",title:"Connect",description:"Connect your calendar account"},{n:"02",title:"Calendars",description:"Import at least 2 calendars"},{n:"03",title:"Sync",description:"Set up your first sync"}];function Ka({current:e}){return Ya(wt,{steps:As,current:e})}function Is({current:e,total:r=3}){return Ya(Ka,{current:e})}import Tt from"dayjs";import{Flex as ja,Grid as qa,IconButton as Xa,Text as Za}from"@radix-ui/themes";import{ChevronLeftIcon as Ps,ChevronRightIcon as Es}from"@radix-ui/react-icons";import{jsx as fe,jsxs as St}from"react/jsx-runtime";var Ns=["S","M","T","W","T","F","S"];function Rt({cursor:e,onSelect:r,today:t=new Date}){let a=Tt(e).startOf("month"),o=a.startOf("week"),n=Array.from({length:42},(i,l)=>o.add(l,"day"));return St("div",{children:[St(ja,{align:"center",justify:"between",mb:"2",children:[fe(Za,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:a.format("MMMM YYYY")}),St(ja,{gap:"1",children:[fe(Xa,{size:"1",variant:"ghost",color:"gray","aria-label":"Previous month",onClick:()=>r(Tt(e).subtract(1,"month").toDate()),children:fe(Ps,{})}),fe(Xa,{size:"1",variant:"ghost",color:"gray","aria-label":"Next month",onClick:()=>r(Tt(e).add(1,"month").toDate()),children:fe(Es,{})})]})]}),fe(qa,{columns:"7",gap:"1",mb:"1",children:Ns.map((i,l)=>fe(Za,{size:"1",color:"gray",align:"center",children:i},l))}),fe(qa,{columns:"7",gap:"1",justify:"center",align:"center",style:{justifyItems:"center"},children:n.map(i=>{let l=i.isSame(t,"day"),s=i.isSame(e,"day"),c=!i.isSame(a,"month");return fe("button",{type:"button",onClick:()=>r(i.toDate()),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-5)",height:"var(--space-5)",boxSizing:"border-box",flexShrink:0,padding:0,borderRadius:"50%",border:l&&!s?"1.5px solid var(--accent-9)":"none",cursor:"pointer",background:s?"var(--accent-9)":"transparent",color:s?"var(--accent-contrast)":c?"var(--gray-11)":l?"var(--accent-11)":"var(--gray-12)",fontWeight:l||s?500:400,fontSize:"var(--font-size-1)",fontFamily:"var(--font-poppins)"},children:i.format("D")},i.format("YYYY-MM-DD"))})})]})}import{useState as Bs}from"react";import{Dialog as rr,Flex as tr,Text as wr,Button as kt,IconButton as Ms,Badge as Qa,Separator as zs,Box as Ja}from"@radix-ui/themes";import{Cross2Icon as Ls,PlusIcon as Fs,ReloadIcon as Hs}from"@radix-ui/react-icons";import{Fragment as eo,jsx as I,jsxs as oe}from"react/jsx-runtime";function Os({account:e,catalog:r,onOpenChange:t,onRemoveCalendar:a,onSaveCalendars:o,onReconnect:n}){let[i,l]=Bs(!1),s=e?.authStatus==="reauth",c=e?.authStatus==="failed";function g(p){if(!e||!r)return;let u=new Set(p);o(e,r.calendars.filter(b=>u.has(b.id))),l(!1)}return oe(eo,{children:[I(rr.Root,{open:!!e&&!i,onOpenChange:p=>{p||t(!1)},children:I(rr.Content,{maxWidth:x.dialogMd,children:e&&oe(eo,{children:[oe(tr,{align:"center",gap:"3",mb:"1",children:[I(B,{size:"var(--space-6)",children:I(_,{provider:e.provider})}),oe(Ja,{style:{minWidth:0,flex:1},children:[oe(tr,{align:"center",gap:"2",mb:"1",style:{minWidth:0},children:[I(rr.Title,{size:"4",weight:"medium",mb:"0",truncate:!0,style:{minWidth:0},children:e.displayName}),s&&I(Qa,{color:"amber",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Needs reconnect"}),c&&I(Qa,{color:"red",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Connection failed"})]}),I(rr.Description,{size:"2",color:"gray",mb:"0",children:e.email})]})]}),(s||c)&&n&&oe(kt,{size:"2",variant:"soft",color:c?"red":"amber",mt:"3",onClick:()=>n(e.id),children:[I(Hs,{}),"Reconnect"]}),I(zs,{size:"4",my:"4"}),oe(tr,{align:"center",justify:"between",gap:"3",mb:"3",children:[I(wr,{as:"p",className:"ds-section-label",mb:"0",children:"Calendars"}),r&&r.calendars.length>0&&oe(kt,{size:"1",variant:"soft",color:"gray",onClick:()=>l(!0),children:[I(Fs,{style:h("--space-3")}),"Change calendars"]})]}),I(tr,{direction:"column",style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",overflow:"hidden",background:"var(--color-panel-solid)"},children:e.calendars.length===0?I(wr,{size:"2",color:"gray",style:{padding:"var(--space-4)"},children:"No calendars imported."}):e.calendars.map((p,u)=>oe(tr,{align:"center",gap:"3",className:"data-table-row",style:{padding:"var(--space-3) var(--space-4)",minHeight:"var(--space-7)",borderTop:u>0?"1px solid var(--gray-4)":void 0},children:[I(Ja,{"aria-hidden":!0,style:{width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:p.colorToken,flexShrink:0}}),oe(wr,{size:"2",truncate:!0,style:{flex:1,minWidth:0,color:"var(--gray-12)"},children:[p.name,p.isPrimary&&oe(wr,{size:"1",color:"gray",children:[" ","\xB7 Primary"]})]}),I(Ms,{variant:"ghost",color:"gray",size:"1","aria-label":`Remove ${p.name}`,onClick:()=>a(e,p),children:I(Ls,{})})]},p.id))}),I(J,{justify:"end",children:I(rr.Close,{children:I(kt,{size:"2",variant:"soft",color:"gray",children:"Close"})})})]})})}),I(De,{account:i&&r?r:null,initiallySelectedIds:e?.calendars.map(p=>p.id),title:"Change calendars",description:"Choose which calendars to keep on this account.",confirmLabel:"Save calendars",onOpenChange:p=>{p||l(!1)},onImport:g})]})}import{useMemo as _s}from"react";import Rr from"dayjs";import{Calendar as Vs,dayjsLocalizer as Ws,Views as ar}from"react-big-calendar";import"react-big-calendar/lib/css/react-big-calendar.css";import{Text as Tr}from"@radix-ui/themes";import{jsx as Oe,jsxs as Sr}from"react/jsx-runtime";var $s=Ws(Rr),Us=new Date(1970,0,1,8,0,0);function Dt({blocks:e,view:r,onViewChange:t,date:a,onNavigate:o,accounts:n,today:i=new Date}){let l=_s(()=>e.map(s=>{let c=new Date(s.date);c.setHours(s.startHour,s.startMinute,0,0);let g=new Date(s.date);return g.setHours(s.endHour,s.endMinute,0,0),{id:s.id,title:s.title,start:c,end:g,resource:s}}),[e]);return Oe("div",{className:"rbc-radix-scope",style:{height:"100%",containerType:"inline-size"},children:Oe(Vs,{localizer:$s,events:l,view:r==="week"?ar.WEEK:ar.MONTH,onView:s=>t(s===ar.MONTH?"month":"week"),date:a,onNavigate:o,views:[ar.WEEK,ar.MONTH],toolbar:!0,popup:!0,scrollToTime:Us,enableAutoScroll:!0,getNow:()=>i,tooltipAccessor:null,eventPropGetter:s=>{let g=j(n,s.resource.calendarId)?.calendar.colorToken??"var(--gray-8)";return r==="month"?{style:{background:"transparent",border:"none",boxShadow:"none"}}:{style:{backgroundColor:g,border:"none"}}},components:{toolbar:ft,week:{header:s=>Oe(gt,{...s,today:i}),event:({event:s})=>{let c=(s.end.getTime()-s.start.getTime())/6e4,g=c>=60,p=c>=30;return Sr("div",{children:[Oe(Tr,{size:"1",weight:"medium",style:{color:"white",display:"block"},truncate:!0,children:s.title}),p&&Sr(Tr,{size:"1",style:{color:"rgba(255,255,255,0.85)",display:"block"},truncate:!0,children:[Rr(s.start).format("h:mm A")," \u2013 ",Rr(s.end).format("h:mm A")]}),g&&s.resource.location&&Oe(Tr,{size:"1",style:{color:"rgba(255,255,255,0.85)",display:"block"},truncate:!0,children:s.resource.location})]})}},month:{event:({event:s})=>{let g=j(n,s.resource.calendarId)?.calendar.colorToken??"var(--gray-8)";return Sr(Tr,{size:"1",style:{display:"flex",alignItems:"center",gap:"var(--space-1)",color:"var(--gray-12)",background:`color-mix(in srgb, ${g} 28%, transparent)`,borderRadius:"var(--radius-2)",padding:"var(--space-1) var(--space-2)"},truncate:!0,children:[Oe("span",{"aria-hidden":!0,style:{width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:g,flexShrink:0}}),Sr("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[Rr(s.start).format("H:mm")," ",s.title]})]})}}}})})}import{Dialog as or,Flex as Ae,Text as Ie,Button as ro,Separator as Gs,Badge as Ks}from"@radix-ui/themes";import{Fragment as js,jsx as k,jsxs as be}from"react/jsx-runtime";var to={synced:{label:"Synced",color:"green"},syncing:{label:"Syncing\u2026",color:"amber"},error:{label:"Error",color:"red"}};function Ys({sync:e,accounts:r,onOpenChange:t,onEdit:a}){let o=e?(()=>{let n=e.sourceCalendarIds.map(l=>j(r,l)?.calendar.name).filter(l=>!!l),i=j(r,e.targetCalendarId)?.calendar.name??"\u2014";return`${n.join(", ")||"\u2014"} \u2192 ${i}`})():"";return k(or.Root,{open:!!e,onOpenChange:t,children:k(or.Content,{maxWidth:x.dialogMd,children:e&&be(js,{children:[be(Ae,{align:"center",justify:"between",mb:"1",children:[k(or.Title,{size:"4",mb:"0",children:e.name}),k(Ks,{color:to[e.status].color,variant:"soft",size:"1",radius:"full",children:to[e.status].label})]}),k(or.Description,{size:"2",color:"gray",mb:"4",children:"Sync configuration"}),be(Ae,{direction:"column",gap:"3",children:[k(he,{label:"Calendars",children:o}),k(he,{label:"Sources",children:k(Ae,{direction:"column",gap:"1",align:"end",children:e.sourceCalendarIds.map(n=>{let i=j(r,n);return i?be(Ae,{direction:"column",align:"end",children:[k(Ie,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:i.calendar.name}),k(Ie,{size:"1",color:"gray",children:i.account.email})]},n):null})||"\u2014"})}),k(he,{label:"Target",children:(()=>{let n=j(r,e.targetCalendarId);return n?be(Ae,{direction:"column",align:"end",children:[k(Ie,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:n.calendar.name}),k(Ie,{size:"1",color:"gray",children:n.account.email})]}):"\u2014"})()}),k(he,{label:"Last synced",children:e.lastSyncedLabel??"\u2014"})]}),k(Gs,{size:"4",my:"4"}),k(Ie,{as:"p",size:"1",weight:"medium",color:"gray",mb:"3",style:{letterSpacing:"0.04em"},children:"WHAT TO SHOW"}),be(Ae,{direction:"column",gap:"3",children:[k(he,{label:"Tag",children:e.tagLabel?.trim()||"Busy"}),k(he,{label:"Event titles",children:e.showTitle?"Shown":"Hidden"}),k(he,{label:"Event description",children:e.showDescription?"Shown":"Hidden"}),k(he,{label:"Event location",children:e.showLocation?"Shown":"Hidden"})]}),be(J,{justify:"between",children:[k(or.Close,{children:k(ro,{size:"2",variant:"soft",color:"gray",children:"Close"})}),k(ro,{size:"2",className:"btn-amber-primary",onClick:()=>a(e.id),children:"Edit sync"})]})]})})})}function he({label:e,children:r}){return be(Ae,{align:"baseline",justify:"between",gap:"4",children:[k(Ie,{size:"2",color:"gray",style:{flexShrink:0},children:e}),k(Ie,{size:"2",weight:"medium",align:"right",style:{color:"var(--gray-12)"},children:r})]})}import{useState as kr}from"react";function nr({accounts:e,connectProvider:r,onAccountAdded:t,onImported:a}){let[o,n]=kr(null),[i,l]=kr(null),[s,c]=kr(null),[g,p]=kr(!1);function u(y){if(o)return;c(null),p(!1),n(y);let f=e.map(S=>S.id);r(y,f).then(S=>{n(null),S?l(S):(c(y),p(!0))}).catch(()=>{n(null),c(y),p(!1)})}function b(y){if(!i)return;let f=new Set(y);t({...i,calendars:i.calendars.filter(S=>f.has(S.id))}),l(null),a?.()}return{connectingProvider:o,pendingAccount:i,failedProvider:s,exhausted:g,connect:u,confirmImport:b,cancelImport:()=>l(null),dismissError:()=>c(null)}}import{Box as qs,DropdownMenu as Dr,Button as Xs,Flex as Zs,Text as ao}from"@radix-ui/themes";import{PlusIcon as oo}from"@radix-ui/react-icons";import{Fragment as Js,jsx as ne,jsxs as _e}from"react/jsx-runtime";function Qs({variant:e="button",trigger:r,accounts:t,connectProvider:a,onAccountAdded:o,onImported:n}){let{pendingAccount:i,failedProvider:l,exhausted:s,connect:c,confirmImport:g,cancelImport:p,dismissError:u}=nr({accounts:t,connectProvider:a,onAccountAdded:o,onImported:n}),b=["google","microsoft"],y=e==="tile"?_e("button",{type:"button",className:"connect-account-tile","aria-label":"Connect Account",children:[ne(oo,{style:h("--space-4")}),"Connect Account"]}):_e(Xs,{size:"2",className:"btn-amber-primary",children:[ne(oo,{style:h("--space-4")}),"Connect Account"]}),f=_e(Dr.Root,{children:[ne(Dr.Trigger,{children:r??y}),ne(Dr.Content,{align:"start",style:{width:"max-content",minWidth:"max-content"},children:b.map(S=>{let E=Fe[S];return _e(Dr.Item,{onSelect:()=>c(S),style:{height:"auto",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-2) var(--space-3)"},children:[ne(B,{size:"var(--space-6)",children:ne(_,{provider:S})}),_e(Zs,{direction:"column",gap:"1",style:{flexShrink:0},children:[ne(ao,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:E.label}),ne(ao,{size:"1",color:"gray",children:E.description})]})]},S)})})]});return _e(Js,{children:[e==="tile"&&!r?ne(qs,{style:{width:"100%",minWidth:0},children:f}):f,ne(De,{account:i,onOpenChange:S=>!S&&p(),onImport:g}),l&&ne($r,{msg:s?`No more ${Fe[l].label} accounts available to connect.`:`Couldn't connect ${Fe[l].label}. Please try again.`,color:"red",onDone:u})]})}import{Card as el,Flex as At,Text as rl,Heading as tl}from"@radix-ui/themes";import{CalendarIcon as al}from"@radix-ui/react-icons";import{jsx as xe,jsxs as no}from"react/jsx-runtime";function ol({accounts:e,connectProvider:r,onAccountAdded:t,onImported:a}){let{connectingProvider:o,pendingAccount:n,failedProvider:i,exhausted:l,connect:s,confirmImport:c,cancelImport:g}=nr({accounts:e,connectProvider:r,onAccountAdded:t,onImported:a});return no(At,{direction:"column",align:"center",justify:"center",style:{width:"100%",flex:1,minHeight:0},children:[xe(el,{style:{width:"100%",maxWidth:x.providerChooserMax},children:no(At,{direction:"column",align:"center",justify:"center",gap:"3",py:"6",px:"3",style:{width:"100%",textAlign:"center"},children:[xe(B,{children:xe(al,{style:{...h("--space-5"),color:"var(--gray-7)"}})}),xe(tl,{as:"h2",size:O.h2,weight:"medium",children:e.length>0?"Connect another account":"Connect your first account"}),xe(rl,{as:"p",size:"2",color:"gray",children:e.length>0?"Add another Google or Microsoft account, then choose which calendars to import.":"Connect a Google or Microsoft account to import calendars for sync."}),xe(At,{direction:"column",style:{width:"100%"},mt:"3",children:xe(yt,{connectingProvider:o,failedProvider:i,exhausted:l,onConnect:s})})]})}),xe(De,{account:n,onOpenChange:p=>!p&&g(),onImport:c})]})}import{useEffect as nl,useMemo as It,useState as Ar}from"react";import{Link as il}from"react-router-dom";import{Box as Pt,Checkbox as io,Flex as ir,Separator as Et,Text as Pe}from"@radix-ui/themes";import{ChevronDownIcon as sl,GearIcon as ll,HamburgerMenuIcon as cl}from"@radix-ui/react-icons";import{jsx as P,jsxs as ve}from"react/jsx-runtime";function dl({accounts:e,view:r,setView:t,hideClones:a,setHideClones:o,mergedCalendarIds:n,visibleCalendarIds:i,toggleCalendarVisible:l,getVisibleBlocksInRange:s,manageAccountsHref:c,today:g=new Date}){let[p,u]=Ar(g),[b,y]=Ar(new Set),[f,S]=Ar(()=>typeof window<"u"&&window.innerWidth<900),[E,X]=Ar(!1);nl(()=>{function v(){S(window.innerWidth<900)}return window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[]);let ie=It(()=>{let v=new Date(p);return v.setDate(v.getDate()-42),v},[p]),R=It(()=>{let v=new Date(p);return v.setDate(v.getDate()+42),v},[p]),F=s(ie,R),H=It(()=>{let v=[],w=new Map;for(let $ of n){let Z=j(e,$);if(!Z)continue;let Q=w.get(Z.account.id);Q===void 0&&(Q=v.length,w.set(Z.account.id,Q),v.push({accountId:Z.account.id,calendarIds:[]})),v[Q].calendarIds.push($)}return v},[n,e]);function pe(v){y(w=>{let $=new Set(w);return $.has(v)?$.delete(v):$.add(v),$})}return ve(ir,{gap:"5",align:"start",direction:f?"column":"row",flexGrow:"1",minHeight:"0",height:"100%",children:[(!f||E)&&ve(Pt,{minWidth:f?void 0:x.sidebarColMin,p:"4",maxHeight:"100%",style:{flex:f?"1 1 100%":`0 0 ${x.sidebarColBasis}`,border:"1px solid var(--gray-5)",borderRadius:"var(--radius-4)",background:"var(--color-panel-solid)",boxShadow:"var(--shadow-card)",overflow:"auto"},children:[P(Rt,{cursor:p,onSelect:u,today:g}),P(Et,{size:"4",my:"3"}),P(Pe,{as:"p",size:"1",weight:"medium",color:"gray",mb:"3",style:{letterSpacing:"0.04em"},children:"CALENDARS"}),P(ir,{direction:"column",gap:"1",mb:"4",children:H.map(({accountId:v,calendarIds:w},$)=>{let Z=e.find(se=>se.id===v);if(!Z)return null;let Q=b.has(v);return ve("div",{style:{paddingTop:$>0?"var(--space-2)":void 0,borderTop:$>0?"1px solid var(--gray-3)":void 0},children:[ve(ir,{align:"center",gap:"2",mb:"2",py:"1",className:"calendar-legend-account-row",style:{cursor:"pointer",borderRadius:"var(--radius-2)"},onClick:()=>pe(v),children:[P(sl,{style:{...h("--space-3"),color:"var(--gray-9)",transform:Q?"rotate(-90deg)":void 0,transition:"transform 120ms ease",flexShrink:0}}),P(_,{provider:Z.provider}),P(Pe,{size:"2",weight:"medium",truncate:!0,title:Z.email,style:{color:"var(--gray-12)",minWidth:0},children:Z.email})]}),!Q&&P(ir,{direction:"column",gap:"1",pl:"5",children:w.map(se=>{let Ce=j(e,se);return Ce?ve(Pe,{as:"label",size:"2",className:"calendar-legend-row",style:{display:"flex",alignItems:"center",gap:"var(--space-2)",cursor:"pointer",borderRadius:"var(--radius-2)",padding:"var(--space-1) var(--space-2)",marginLeft:"calc(var(--space-2) * -1)"},children:[ve(ir,{align:"center",gap:"1",children:[P(io,{checked:i.has(se),onCheckedChange:()=>l(se)}),P("span",{"aria-hidden":!0,style:{width:"var(--space-3)",height:"var(--space-3)",borderRadius:"50%",background:Ce.calendar.colorToken,flexShrink:0}})]}),P(Pe,{size:"2",truncate:!0,style:{color:"var(--gray-12)"},title:Ce.calendar.name,children:Ce.calendar.name})]},se):null})})]},v)})}),P(Et,{size:"4",mb:"3"}),ve(Pe,{as:"label",size:"2",style:{display:"flex",alignItems:"center",gap:"var(--space-2)",cursor:"pointer"},mb:"3",children:[P(io,{checked:a,onCheckedChange:v=>o(!!v)}),"Hide synced events"]}),P(Et,{size:"4",mb:"3"}),ve(il,{to:c,style:{display:"flex",alignItems:"center",gap:"var(--space-2)",color:"var(--gray-11)",textDecoration:"none"},children:[P(ll,{style:h("--space-3")}),P(Pe,{size:"2",children:"Manage accounts"})]}),P(Pe,{as:"p",size:"1",color:"gray",mt:"4",children:"On your target calendars, others see only what each sync is set to share. Full detail stays in araMetrics."})]}),ve(Pt,{width:f?"100%":void 0,minHeight:x.bigCalendarH,height:"100%",style:{flex:f?"1 1 100%":`1 1 ${x.syncColWide}`,minWidth:f?0:x.syncColMin,display:"flex",flexDirection:"column",alignSelf:"stretch"},children:[f&&P("button",{type:"button",className:"sidebar-icon-btn","aria-label":E?"Hide calendars":"Show calendars",style:{alignSelf:"flex-start",marginBottom:"var(--space-3)"},onClick:()=>X(v=>!v),children:P(cl,{style:h("--space-4")})}),P(Pt,{flexGrow:"1",minHeight:"0",height:"100%",children:P(Dt,{blocks:F,view:r,onViewChange:t,date:p,onNavigate:u,accounts:e,today:g})})]})]})}import{clsx as pl}from"clsx";import{twMerge as gl}from"tailwind-merge";function Ee(...e){return gl(pl(e))}function ul(e,r="solid"){return D.variants[e]?.[r]||D.variants.primary[r]}function ml(e){let r=D.sizes[e]||D.sizes.md;return`${r.text} ${r.padding} ${r.height}`}function fl(){return Ee(D.base.transition,D.base.focus,D.base.disabled,D.accessibility.reducedMotion)}function vl(){return Ee(D.base.interactive,D.accessibility.focusTrap,D.accessibility.touchTarget)}function yl(e={}){return Ee(e.focusVisible&&D.accessibility.focusTrap,e.highContrast&&D.accessibility.highContrast,e.reducedMotion&&D.accessibility.reducedMotion)}function hl(e,r=""){return typeof e=="string"?`${r}${e}`:typeof e=="object"&&e!==null?Object.entries(e).map(([t,a])=>a===void 0?"":`${t==="xs"?"":`${t}:`}${r}${a}`).filter(Boolean).join(" "):""}function bl(e,r="gap"){let t=D.spacing[e]||D.spacing.md;switch(r){case"margin":return t.replace("gap-","m-");case"padding":return t.replace("gap-","p-");default:return t}}function xl(e){return D.radius[e]||D.radius.md}function Cl(e){return D.typography[e]||D.typography.base}function wl(e,r=500){return`bg-${e}-${r}`}function Tl(e,r=500){return`text-${e}-${r}`}function Sl(e,r=500){return`border-${e}-${r}`}function Rl(e,r=500){return`hover:bg-${e}-${r}`}function kl(e,r=500){return`hover:text-${e}-${r}`}function Dl(e,r=500){return`focus:ring-${e}-${r}`}function Al(e){let r=D.animations[e];return typeof r=="string"?r:""}function Il(e,r,t){return a=>{let o=e;return Object.entries(r).forEach(([n,i])=>{let l=a[n];l&&i[l]&&(o+=` ${i[l]}`)}),t?.forEach(({conditions:n,className:i})=>{Object.entries(n).every(([s,c])=>a[s]===c)&&(o+=` ${i}`)}),Ee(o)}}function Pl(e){return function(t){let{className:a,...o}=t,n={...e.defaultVariants,...o},i=e.base||"";return e.variants&&Object.entries(e.variants).forEach(([l,s])=>{let c=n[l];c&&s[c]&&(i+=` ${s[c]}`)}),e.compoundVariants?.forEach(({conditions:l,className:s})=>{Object.entries(l).every(([g,p])=>n[g]===p)&&(i+=` ${s}`)}),Ee(i,a)}}function El(e,r){let t={...e};return Object.keys(r).forEach(a=>{let o=r[a],n=e[a];a==="className"?t[a]=Ee(n,o):typeof o=="object"&&typeof n=="object"&&o!==null&&n!==null&&!Array.isArray(o)&&!Array.isArray(n)?t[a]={...n,...o}:t[a]=o}),t}function Nl(e,r,t){return e?r:t&&e===!1?t:""}function Bl(e){let r=["button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","a[href]",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]'].join(", ");return Array.from(e.querySelectorAll(r))}function Ml(e,r,t,a={}){let{loop:o=!0,orientation:n="both"}=a,i=t;switch(e.key){case"ArrowDown":(n==="vertical"||n==="both")&&(i=t+1,i>=r.length&&(i=o?0:r.length-1));break;case"ArrowUp":(n==="vertical"||n==="both")&&(i=t-1,i<0&&(i=o?r.length-1:0));break;case"ArrowRight":(n==="horizontal"||n==="both")&&(i=t+1,i>=r.length&&(i=o?0:r.length-1));break;case"ArrowLeft":(n==="horizontal"||n==="both")&&(i=t-1,i<0&&(i=o?r.length-1:0));break;case"Home":i=0;break;case"End":i=r.length-1;break}return i!==t&&(e.preventDefault(),r[i]?.focus()),i}import{Theme as zl}from"@radix-ui/themes";import"@radix-ui/themes/styles.css";import{jsx as Fl}from"react/jsx-runtime";function Ll({children:e,appearance:r="light",radius:t="none",scaling:a="100%",accentColor:o="amber",grayColor:n="gray",panelBackground:i="solid",className:l=""}){return Fl(zl,{accentColor:o,grayColor:n,radius:t,scaling:a,panelBackground:i,appearance:r,className:l,children:e})}import*as Ir from"react";function Ef({value:e,defaultValue:r,onChange:t}){let[a,o]=Ir.useState(r),n=e!==void 0,i=n?e:a,l=Ir.useCallback(s=>{let c=typeof s=="function"?s(i):s;n||o(c),t?.(c)},[n,i,t]);return[i,l]}import*as Ve from"react";function Bf(e=!1){let[r,t]=Ve.useState(e),a=Ve.useCallback(()=>t(!0),[]),o=Ve.useCallback(()=>t(!1),[]),n=Ve.useCallback(()=>t(i=>!i),[]);return{isOpen:r,open:a,close:o,toggle:n,onOpen:a,onClose:o,onToggle:n}}import*as Pr from"react";function zf(e,r=!0){let t=Pr.useRef(null);return Pr.useEffect(()=>{if(!r)return;let a=o=>{t.current&&!t.current.contains(o.target)&&e()};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[e,r]),t}export*from"@radix-ui/react-icons";export{Wn as ACTIVITY_META,ua as AUDIT_ACTION_META,Io as AccentCard,qt as AccentHeader,Lc as AccessibleIcon,Vt as Accordion,Ut as AccordionContent,Wt as AccordionItem,$t as AccordionTrigger,Os as AccountCalendarsDialog,_o as AccountCard,xn as ActivityRow,Qs as AddAccountMenu,bc as AlertDialog,bn as AppCard,Kl as AspectRatio,Un as AuthCard,kc as Avatar,Dc as Badge,Dt as BigCalendarView,Zl as Blockquote,_l as Box,Xr as BrandPanel,oc as Button,gt as CalendarDayHeader,dl as CalendarMergedView,Zi as CalendarPickList,ft as CalendarToolbar,Ac as Callout,Ic as Card,J as CardFooter,lc as Checkbox,dc as CheckboxCards,cc as CheckboxGroup,Ql as Code,Hr as ConfirmDialog,yt as ConnectProviderList,ol as ConnectProviderRows,ps as ConnectedAccountCard,$l as Container,Cc as ContextMenu,kn as DashboardErrorCard,Pc as DataList,Gr as DataTableRow,hc as Dialog,Co as Drawer,To as DrawerClose,Gt as DrawerContent,Ro as DrawerDefaultClose,Yt as DrawerDescription,So as DrawerHeader,Kt as DrawerTitle,wo as DrawerTrigger,xc as DropdownMenu,Jl as Em,fs as EmptyCard,sn as EventBlock,Vl as Flex,Zr as GoogleIcon,Wl as Grid,Xl as Heading,Tc as HoverCard,nc as IconButton,B as IconTile,De as ImportCalendarsDialog,Gl as Inset,ec as Kbd,Vn as METRIC_STATUS_COLOR,gn as MetricCard,Qr as MicrosoftIcon,Rt as MiniMonthPicker,Xo as MonthGrid,Is as OnboardingStepDots,Ka as OnboardingStepper,Jr as OtpInput,Qn as OtpVerifyStep,Jn as PROVIDER_LABEL,Fe as PROVIDER_META,Fn as Pagination,Or as PausedBadge,wc as Popover,Rc as Portal,Ec as Progress,_ as ProviderIcon,tc as Quote,On as ROLE_LABELS,gr as ROLE_META,pc as Radio,uc as RadioCards,gc as RadioGroup,yr as SHELL_HEADER_H,_n as STATUS_META,Yl as ScrollArea,$i as SearchOverlay,Ul as Section,yc as SegmentedControl,mc as Select,jl as Separator,vi as Sidebar,vo as Skeleton,fc as Slider,Fc as Slot,Hc as Slottable,Nc as Spinner,ac as Strong,vc as Switch,Ys as SyncDetailsDialog,ks as SyncPreviewRail,zc as TabNav,Bc as Table,Mc as Tabs,ql as Text,sc as TextArea,ic as TextField,rc as TextLink,$r as Toast,Sc as Tooltip,Ei as Topbar,Ll as UIProvider,Oc as VisuallyHidden,wt as WizardStepper,$n as auditActionMeta,Ee as cn,fo as colors,Nl as conditionalClass,Il as createCompoundVariants,Pl as createVariantGenerator,j as findCalendar,yl as getAccessibilityStyles,Al as getAnimationClass,fl as getBaseStyles,wl as getBgClass,Sl as getBorderClass,_t as getColor,Dl as getFocusRingClass,Bl as getFocusableElements,Rl as getHoverBgClass,kl as getHoverTextClass,vl as getInteractiveStyles,xl as getRadiusClass,hl as getResponsiveClasses,ml as getSizeStyles,bl as getSpacingClass,Tl as getTextClass,Cl as getTypographyClass,ul as getVariantStyles,Ml as handleArrowNavigation,O as headingSize,x as layout,El as mergeProps,D as theme,zf as useClickOutside,nr as useConnectAccount,Ef as useControllableState,Bf as useDisclosure};
|
|
1
|
+
import{a as va,b as k,c as $t}from"./chunk-UTKQHNA3.mjs";import{Box as jl,Flex as Kl,Grid as Yl,Container as ql,Section as Xl,Inset as Zl,AspectRatio as Jl,ScrollArea as Ql,Separator as ec,Text as rc,Heading as tc,Blockquote as oc,Code as ac,Em as nc,Kbd as ic,Link as sc,Quote as lc,Strong as cc,Button as dc,IconButton as pc,TextField as gc,TextArea as uc,Checkbox as mc,CheckboxGroup as fc,CheckboxCards as hc,Radio as vc,RadioGroup as yc,RadioCards as bc,Select as xc,Slider as _c,Switch as wc,SegmentedControl as Cc,Dialog as Tc,AlertDialog as Rc,DropdownMenu as kc,ContextMenu as Sc,Popover as Dc,HoverCard as Ac,Tooltip as Ic,Portal as Pc,Avatar as Ec,Badge as Nc,Callout as Bc,Card as zc,DataList as Lc,Progress as Mc,Spinner as Fc,Table as Oc,Tabs as Hc,TabNav as $c,AccessibleIcon as Wc,Slot as Uc,Slottable as Vc,VisuallyHidden as Gc}from"@radix-ui/themes";import{jsx as ba}from"react/jsx-runtime";function ya({width:e="100%",height:r="var(--space-4)",radius:t="var(--radius-2)",circle:o=!1,mb:n,className:a,style:i}){return ba("div",{className:["skeleton",a].filter(Boolean).join(" "),"aria-hidden":"true",style:{width:e,height:r,borderRadius:o?"50%":t,marginBottom:n,...i}})}import*as We from"react";import*as le from"@radix-ui/react-accordion";import{ChevronDownIcon as xa}from"@radix-ui/react-icons";import{jsx as Ne,jsxs as _a}from"react/jsx-runtime";var Wt=We.forwardRef(({className:e="",...r},t)=>Ne(le.Root,{ref:t,className:`arm-accordion ${e}`,...r}));Wt.displayName="Accordion";var Ut=We.forwardRef(({className:e="",...r},t)=>Ne(le.Item,{ref:t,className:`arm-accordion__item ${e}`,...r}));Ut.displayName="AccordionItem";var Vt=We.forwardRef(({className:e="",children:r,...t},o)=>Ne(le.Header,{className:"arm-accordion__header",children:_a(le.Trigger,{ref:o,className:`arm-accordion__trigger ${e}`,...t,children:[r,Ne(xa,{"aria-hidden":!0,className:"arm-accordion__chevron"})]})}));Vt.displayName="AccordionTrigger";var Gt=We.forwardRef(({className:e="",children:r,...t},o)=>Ne(le.Content,{ref:o,className:`arm-accordion__content ${e}`,...t,children:Ne("div",{className:"arm-accordion__body",children:r})}));Gt.displayName="AccordionContent";import*as lr from"react";import*as P from"@radix-ui/react-dialog";import{Cross2Icon as wa}from"@radix-ui/react-icons";import{jsx as _e,jsxs as Da}from"react/jsx-runtime";var Ca=P.Root,Ta=P.Trigger,Ra=P.Close,jt=lr.forwardRef(({className:e="",side:r="right",size:t="md",children:o,...n},a)=>Da(P.Portal,{children:[_e(P.Overlay,{className:"arm-drawer__overlay"}),_e(P.Content,{ref:a,"data-side":r,"data-size":t,className:`arm-drawer ${e}`,...n,children:o})]}));jt.displayName="DrawerContent";var ka=({className:e="",children:r,...t})=>_e("div",{className:`arm-drawer__header ${e}`,...t,children:r}),Kt=lr.forwardRef(({className:e="",...r},t)=>_e(P.Title,{ref:t,className:`arm-drawer__title ${e}`,...r}));Kt.displayName="DrawerTitle";var Yt=lr.forwardRef(({className:e="",...r},t)=>_e(P.Description,{ref:t,className:`arm-drawer__description ${e}`,...r}));Yt.displayName="DrawerDescription";var Sa=()=>_e(P.Close,{"aria-label":"Close",className:"arm-drawer__close",children:_e(wa,{"aria-hidden":!0,className:"arm-drawer__close-icon"})});import{Box as qt,Flex as Aa,Text as Ia}from"@radix-ui/themes";import{jsx as Mr,jsxs as Zt}from"react/jsx-runtime";function Xt({title:e,trailing:r,style:t}){let o=typeof e=="string"||typeof e=="number"?Mr(Ia,{size:"3",weight:"medium",style:{color:"var(--accent-contrast)"},children:e}):e;return Zt(Aa,{align:"center",justify:"between",gap:"3",px:"4",style:{background:"var(--accent-9)",minHeight:"var(--space-7)",...t},children:[o,r]})}function Pa({title:e,trailing:r,children:t,bodyPadding:o="4",style:n}){return Zt(qt,{style:{background:"var(--color-panel-solid)",borderRadius:"var(--radius-5)",overflow:"hidden",boxShadow:"var(--shadow-card)",...n},children:[Mr(Xt,{title:e,trailing:r}),Mr(qt,{p:o,children:t})]})}import{AlertDialog as we,Button as Jt}from"@radix-ui/themes";var b={content_max:"calc(15 * var(--space-9) + var(--space-5))",account_card_w:"calc(3 * var(--space-9) + var(--space-8))",account_card_min_h:"calc(2 * var(--space-9) - var(--space-2))",month_title_min_w:"calc(3 * var(--space-9) - var(--space-1))",big_calendar_h:"calc(10 * var(--space-9))",sidebar_col_basis:"calc(4 * var(--space-9) - var(--space-2))",sidebar_col_min:"calc(3 * var(--space-9) + var(--space-6))",sync_col_min:"calc(5 * var(--space-9))",sync_col_wide:"calc(7 * var(--space-9) + var(--space-6))",dialog_sm:"calc(6 * var(--space-9) - var(--space-2))",dialog_body:"calc(5 * var(--space-9) + var(--space-7))",auth_form_max:"calc(6 * var(--space-9) + var(--space-8))",brand_logo_max:"calc(6 * var(--space-9) + var(--space-8) - var(--space-1))",connected_account_card_h:"calc(var(--space-9) - var(--space-1))",dialog_md:"calc(6 * var(--space-9) + var(--space-6))",dialog_lg:"calc(7 * var(--space-9) - var(--space-1))",empty_state_max:"calc(10 * var(--space-9))",empty_state_copy_max:"calc(6 * var(--space-9))",provider_chooser_max:"calc(6 * var(--space-9) + var(--space-6))",audit_col_time:"calc(var(--space-9) + var(--space-2))",audit_col_action:"calc(var(--space-9) + var(--space-5) + var(--space-1))",search_field_w:"calc(3 * var(--space-9) + var(--space-5) + var(--space-1))",settings_grid_min:"calc(5 * var(--space-9) + var(--space-5))",placeholder_md:"calc(6 * var(--space-9) + var(--space-4))"};import{Flex as Ea}from"@radix-ui/themes";import{jsx as Na}from"react/jsx-runtime";function ee({children:e,justify:r="end",noTopMargin:t,pad:o="var(--space-5)",radius:n="var(--radius-5)"}){return Na(Ea,{justify:r,style:{margin:`${t?"0":"var(--space-5)"} calc(-1 * ${o}) calc(-1 * ${o})`,padding:`var(--space-4) ${o}`,alignItems:"center",background:"var(--gray-2)",borderTop:"1px solid var(--gray-5)",borderRadius:`0 0 ${n} ${n}`},children:e})}import{jsx as Ce,jsxs as Fr}from"react/jsx-runtime";function Or({title:e,description:r,confirmLabel:t="Yes",cancelLabel:o="Cancel",onConfirm:n,trigger:a,open:i,onOpenChange:l}){return Fr(we.Root,{open:i,onOpenChange:l,children:[a?Ce(we.Trigger,{children:a}):null,Fr(we.Content,{maxWidth:b.dialog_sm,children:[Ce(we.Title,{size:"5",mb:"1",style:{fontFamily:"var(--heading-font-family)",fontWeight:"var(--font-weight-medium)"},children:e}),Ce(we.Description,{size:"2",color:"gray",mb:"5",children:r}),Fr(ee,{justify:"between",noTopMargin:!0,children:[Ce(we.Cancel,{children:Ce(Jt,{size:"2",variant:"outline",color:"gray",children:o})}),Ce(we.Action,{children:Ce(Jt,{size:"2",className:"btn-amber-primary",onClick:n,children:t})})]})]})]})}import{PauseIcon as Ba}from"@radix-ui/react-icons";function v(e){return{width:`var(${e})`,height:`var(${e})`}}import{jsx as Qt,jsxs as za}from"react/jsx-runtime";function Hr({label:e="Paused",style:r}){return za("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--space-1)",height:"calc(var(--space-4) + var(--space-1))",padding:"var(--space-1) var(--space-2)",border:"1px solid var(--color-paused)",borderRadius:999,background:"var(--color-panel-solid)",color:"var(--color-paused)",fontSize:"var(--font-size-1)",fontWeight:600,lineHeight:1,whiteSpace:"nowrap",...r},children:[Qt("span",{"aria-hidden":"true",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-3)",height:"var(--space-3)",flexShrink:0,borderRadius:"50%",border:"1px solid var(--color-paused)"},children:Qt(Ba,{style:v("--space-2")})}),e]})}import{Avatar as La,Box as eo,DropdownMenu as Be,Flex as ro,IconButton as Ma,Text as to}from"@radix-ui/themes";import{DotsVerticalIcon as Fa,PauseIcon as Oa,PlayIcon as Ha,TrashIcon as $a}from"@radix-ui/react-icons";import{jsx as j,jsxs as ce}from"react/jsx-runtime";function Wa({name:e,email:r,avatarSrc:t,paused:o=!1,onPause:n,onResume:a,onDelete:i,onClick:l,badge:s,accentColor:c,style:g}){let p=j(to,{as:l?"span":"p",size:"3",weight:"medium",truncate:!0,style:{color:"var(--gray-12)",minWidth:0},children:e});return ce(eo,{onClick:l,style:{width:b.account_card_w,minHeight:b.account_card_min_h,padding:"var(--space-3)",background:"var(--color-panel-solid)",borderRadius:"var(--radius-4)",boxShadow:"var(--shadow-card)",cursor:l?"pointer":void 0,...g},children:[ce(ro,{align:"center",justify:"between",gap:"2",mb:"3",children:[ce(ro,{align:"center",gap:"2",style:{minWidth:0},children:[ce("div",{style:{position:"relative",flexShrink:0},children:[j(La,{size:"3",radius:"full",src:t,fallback:e.charAt(0).toUpperCase()||"?",style:c?{background:c,color:"white"}:void 0}),s&&j("span",{style:{position:"absolute",right:"calc(-1 * var(--space-1))",bottom:"calc(-1 * var(--space-1))",width:"var(--space-4)",height:"var(--space-4)",borderRadius:"50%",background:"var(--color-panel-solid)",border:"1px solid var(--gray-4)",display:"inline-flex",alignItems:"center",justifyContent:"center",transform:"scale(0.72)"},children:s})]}),o&&j(Hr,{})]}),ce(Be.Root,{children:[j(Be.Trigger,{children:j(Ma,{variant:"ghost",color:"gray","aria-label":"Account actions",style:{flexShrink:0},onClick:u=>u.stopPropagation(),children:j(Fa,{})})}),ce(Be.Content,{align:"end",onClick:u=>u.stopPropagation(),children:[o?ce(Be.Item,{onSelect:a,children:[j(Ha,{})," Resume"]}):ce(Be.Item,{onSelect:n,children:[j(Oa,{})," Pause"]}),ce(Be.Item,{color:"red",onSelect:i,children:[j($a,{})," Delete"]})]})]})]}),ce(eo,{style:{minWidth:0},children:[l?j("button",{type:"button",className:"card-title-button",onClick:u=>{u.stopPropagation(),l()},children:p}):p,j(to,{as:"p",size:"1",color:"gray",truncate:!0,children:r})]})]})}import{Box as oo,Flex as ao,Heading as Ua,IconButton as no,Text as io}from"@radix-ui/themes";import{ChevronLeftIcon as Va,ChevronRightIcon as Ga}from"@radix-ui/react-icons";var O={h1:"6",h2:"5",h3:"4",h4:"3"};import{Fragment as Qa,jsx as M,jsxs as Wr}from"react/jsx-runtime";var ja=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],$r="var(--space-9)",Ka="var(--space-8)",so="var(--space-2)",Ya=new Intl.DateTimeFormat("en-US",{month:"long",year:"numeric"}),qa=new Intl.DateTimeFormat("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"});function Xa(e,r){return e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function lo(e){return(e+6)%7}function Za(e){let r=e.getMonth(),t=e.getFullYear(),o=new Date(t,r,1),n=new Date(t,r+1,0),a=lo(o.getDay()),i=6-lo(n.getDay()),l=new Date(t,r,1-a),s=a+n.getDate()+i;return Array.from({length:s},(c,g)=>{let p=new Date(l.getFullYear(),l.getMonth(),l.getDate()+g);return{date:p,inCurrentMonth:p.getMonth()===r}})}function co(e,r){return new Date(e.getFullYear(),e.getMonth()+r,1)}function Ja({month:e,onMonthChange:r,events:t=[],dayDots:o,today:n,onSelectDay:a,style:i}){let l=n??new Date,s=Za(e),c=new Set(t.map(g=>g.toDateString()));return Wr(ao,{direction:"column",align:"center",gap:"4",style:i,children:[Wr(ao,{align:"center",gap:"2",children:[M(no,{type:"button",variant:"ghost",color:"gray","aria-label":"Previous month",onClick:()=>r?.(co(e,-1)),children:M(Va,{style:v("--space-4")})}),M(Ua,{as:"h2",size:O.h2,weight:"medium",style:{minWidth:b.month_title_min_w,textAlign:"center"},children:Ya.format(e)}),M(no,{type:"button",variant:"ghost",color:"gray","aria-label":"Next month",onClick:()=>r?.(co(e,1)),children:M(Ga,{style:v("--space-4")})})]}),M(oo,{style:{display:"grid",gridTemplateColumns:`repeat(7, ${$r})`,gap:so},children:ja.map(g=>M(io,{size:"2",align:"center",style:{color:"var(--gray-11)"},children:g},g))}),M(oo,{style:{display:"grid",gridTemplateColumns:`repeat(7, ${$r})`,gap:so},children:s.map(({date:g,inCurrentMonth:p})=>{let u=Xa(g,l),y=o?.get(g.toDateString()),h=c.has(g.toDateString()),x={position:"relative",width:$r,height:Ka,display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",background:p?u?"var(--color-panel-solid)":"transparent":"var(--gray-2)",border:u?"1.5px solid var(--accent-9)":"none",borderRadius:u?"var(--radius-3)":p?void 0:"var(--radius-2)",padding:0,font:"inherit",cursor:a?"pointer":void 0},w=Wr(Qa,{children:[y&&y.length>0?M("span",{"aria-hidden":"true",style:{position:"absolute",bottom:"var(--space-1)",left:0,right:0,display:"flex",justifyContent:"center",gap:"2px"},children:y.slice(0,3).map((Z,se)=>M("span",{style:{width:"var(--space-1)",height:"var(--space-1)",borderRadius:"50%",background:Z}},se))}):h&&M("span",{"aria-hidden":"true",style:{position:"absolute",top:"var(--space-1)",right:"var(--space-2)",width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:"var(--accent-9)"}}),M(io,{size:"3",style:{color:p?"var(--gray-12)":"var(--gray-11)",fontWeight:u?600:400},children:g.getDate()})]}),I=g.toISOString();return a?M("button",{type:"button",onClick:()=>a(g),"aria-label":qa.format(g),style:x,children:w},I):M("div",{style:x,children:w},I)})})]})}import{useEffect as en}from"react";import{Callout as Ur}from"@radix-ui/themes";import{CheckCircledIcon as rn,ExclamationTriangleIcon as tn}from"@radix-ui/react-icons";import{jsx as Ue,jsxs as on}from"react/jsx-runtime";function Vr({msg:e,color:r="green",onDone:t,durationMs:o=3e3}){return en(()=>{let n=setTimeout(t,o);return()=>clearTimeout(n)},[t,o]),Ue("div",{style:{position:"fixed",bottom:"var(--space-5)",right:"var(--space-5)",zIndex:1e4,maxWidth:b.dialog_body,pointerEvents:"none"},children:on(Ur.Root,{color:r,variant:"soft",size:"1",children:[Ue(Ur.Icon,{children:r==="red"?Ue(tn,{}):Ue(rn,{})}),Ue(Ur.Text,{children:e})]})})}import{jsx as an}from"react/jsx-runtime";function E({children:e,size:r="var(--space-7)"}){return an("div",{style:{width:r,height:r,borderRadius:"var(--radius-4)",background:"var(--color-panel-solid)",border:"1px solid var(--gray-5)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:e})}import{Box as nn,Flex as sn,Text as po}from"@radix-ui/themes";import{LockClosedIcon as ln}from"@radix-ui/react-icons";import{jsx as go,jsxs as Gr}from"react/jsx-runtime";function cn({title:e,time:r,detail:t,color:o,locked:n}){return Gr(sn,{align:"center",justify:"between",style:{background:o,borderRadius:"var(--radius-3)",padding:"var(--space-3)",color:"white"},children:[Gr(nn,{style:{minWidth:0},children:[go(po,{as:"p",size:"2",weight:"medium",style:{color:"white"},truncate:!0,children:e}),Gr(po,{as:"p",size:"1",style:{color:"rgba(255,255,255,0.85)"},truncate:!0,children:[r,t?` \xB7 ${t}`:""]})]}),n&&go(ln,{style:{flexShrink:0,color:"rgba(255,255,255,0.85)"}})]})}import{Box as dn}from"@radix-ui/themes";import{jsx as pn}from"react/jsx-runtime";function jr({children:e,style:r,showBorder:t=!1,onActivate:o,selected:n=!1,className:a,"aria-label":i}){let l=!!o;function s(c){o&&(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),o())}return pn(dn,{role:l?"button":void 0,tabIndex:l?0:void 0,"aria-label":i,onClick:o,onKeyDown:l?s:void 0,className:["data-table-row",l&&"data-table-row--interactive",l&&n&&"data-table-row--selected",a].filter(Boolean).join(" "),style:{borderTop:t?"1px solid var(--gray-3)":void 0,...r},children:e})}import{useId as gn}from"react";import{Card as un,Flex as Kr,Text as Yr}from"@radix-ui/themes";import{jsx as de,jsxs as ze}from"react/jsx-runtime";function mn({label:e,value:r,delta:t,deltaDir:o,goodDirection:n,statusColor:a,sparkline:i}){return de(un,{className:"metric-card",children:ze(Kr,{direction:"column",p:"1",children:[ze(Kr,{align:"center",justify:"between",mb:"3",children:[de(Yr,{as:"span",className:"ds-section-label",children:e}),de("div",{style:{width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:a,flexShrink:0}})]}),de(Yr,{as:"p",className:"metric-card-value",children:r}),ze(Kr,{align:"end",justify:"between",children:[ze(Yr,{size:"1",style:{color:o==="flat"?"var(--gray-11)":o===n?"var(--green-11)":"var(--red-11)",lineHeight:1.4},children:[o==="up"?"\u2191 ":o==="down"?"\u2193 ":"",t]}),de(fn,{data:i,color:a})]})]})})}function fn({data:e,color:r}){let n=Math.min(...e),i=Math.max(...e)-n||1,l=e.map((u,y)=>({x:y/(e.length-1)*72,y:28-(u-n)/i*28*.75-28*.1})),s=l.map((u,y)=>`${y===0?"M":"L"} ${u.x.toFixed(1)} ${u.y.toFixed(1)}`).join(" "),c=["M 0 28",...l.map(u=>`L ${u.x.toFixed(1)} ${u.y.toFixed(1)}`),"L 72 28 Z"].join(" "),p=`spk${gn().replace(/[^a-zA-Z0-9_-]/g,"")}`;return ze("svg",{width:72,height:28,viewBox:"0 0 72 28","aria-hidden":!0,style:{overflow:"visible",flexShrink:0},children:[de("defs",{children:ze("linearGradient",{id:p,x1:"0",y1:"0",x2:"0",y2:"1",children:[de("stop",{offset:"0%",stopColor:r,stopOpacity:"0.18"}),de("stop",{offset:"100%",stopColor:r,stopOpacity:"0"})]})}),de("path",{d:c,fill:`url(#${p})`}),de("path",{d:s,fill:"none",stroke:r,strokeWidth:"1.5",strokeLinejoin:"round",strokeLinecap:"round"})]})}import{Link as hn}from"react-router-dom";import{Badge as vn,Button as yn,Card as bn,Flex as uo,Text as mo}from"@radix-ui/themes";import{ArrowRightIcon as xn}from"@radix-ui/react-icons";import{jsx as Te,jsxs as cr}from"react/jsx-runtime";function _n({href:e,icon:r,name:t,description:o,badge:n}){return cr(bn,{style:{height:"100%",display:"flex",flexDirection:"column"},children:[cr(uo,{direction:"column",gap:"3",p:"1",flexGrow:"1",children:[cr(uo,{align:"center",gap:"3",minWidth:"0",children:[Te(E,{children:r}),Te(mo,{size:"4",weight:"medium",style:{color:"var(--gray-12)",fontFamily:"var(--font-poppins)"},truncate:!0,children:t}),n&&Te(vn,{color:"gray",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:n})]}),Te(mo,{size:"2",style:{color:"var(--gray-11)",fontFamily:"var(--font-poppins)",lineHeight:1.5},children:o})]}),Te(ee,{pad:"var(--space-3)",radius:"var(--radius-4)",children:Te(yn,{size:"2",className:"btn-amber-primary",asChild:!0,children:cr(hn,{to:e,children:["Open",Te(xn,{style:v("--space-3")})]})})})]})}import{Text as Ve}from"@radix-ui/themes";import{jsx as qr,jsxs as Xr}from"react/jsx-runtime";function wn({tag:e,tagColor:r,msg:t,actor:o,timeAgo:n,timestamp:a,showBorder:i}){return Xr(jr,{showBorder:i,style:{display:"flex",alignItems:"center",gap:"var(--space-3)",paddingBlock:"var(--space-2)",paddingInline:"var(--space-4)"},children:[qr(Ve,{as:"span",size:"1",weight:"medium",className:"data-mono",style:{color:r,minWidth:"var(--space-6)",letterSpacing:"0.06em",flexShrink:0},children:e}),Xr(Ve,{as:"span",size:"2",style:{flex:1,color:"var(--gray-11)",lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[t,o&&Xr(Ve,{as:"span",size:"1",style:{color:"var(--gray-11)",marginLeft:"var(--space-2)"},children:["by ",o]})]}),n&&qr(Ve,{as:"span",size:"1",color:"gray",style:{whiteSpace:"nowrap",flexShrink:0},children:n}),qr(Ve,{as:"span",size:"1",className:"data-mono",style:{color:"var(--gray-11)",whiteSpace:"nowrap",flexShrink:0,minWidth:"var(--space-7)",textAlign:"right"},children:a})]})}import{Button as Cn,Card as Tn,Flex as Rn,Text as kn}from"@radix-ui/themes";import{ExclamationTriangleIcon as Sn}from"@radix-ui/react-icons";import{jsx as Ge,jsxs as An}from"react/jsx-runtime";function Dn({onRetry:e,message:r="Couldn't load your dashboard."}){return Ge(Tn,{children:An(Rn,{direction:"column",align:"center",justify:"center",py:"9",gap:"3",children:[Ge(E,{children:Ge(Sn,{style:{...v("--space-5"),color:"var(--gray-7)"}})}),Ge(kn,{size:"2",color:"gray",children:r}),Ge(Cn,{size:"2",color:"amber",variant:"solid",className:"btn-amber-primary",onClick:e,children:"Retry"})]})})}import{useMemo as In}from"react";import{Button as Pn,Flex as En,IconButton as dr,Text as Nn}from"@radix-ui/themes";import{ChevronLeftIcon as Bn,ChevronRightIcon as zn,DoubleArrowLeftIcon as Ln,DoubleArrowRightIcon as Mn}from"@radix-ui/react-icons";import{jsx as re,jsxs as Hn}from"react/jsx-runtime";var Le="\u2026";function Fn(e,r,t){let o=t*2+5;if(r<=o)return Array.from({length:r},(c,g)=>g+1);let n=Math.max(e-t,1),a=Math.min(e+t,r),i=n>2,l=a<r-1;if(!i&&l)return[...Array.from({length:3+t*2},(g,p)=>p+1),Le,r];if(i&&!l){let c=3+t*2,g=Array.from({length:c},(p,u)=>r-c+u+1);return[1,Le,...g]}let s=Array.from({length:a-n+1},(c,g)=>n+g);return[1,Le,...s,Le,r]}function On({currentPage:e,totalPages:r,onPageChange:t,siblingCount:o=1,showFirstLast:n=!1,size:a="2"}){let i=In(()=>Fn(e,r,o),[e,r,o]),l=e<=1,s=e>=r;return re(En,{asChild:!0,align:"center",gap:"1",children:Hn("nav",{"aria-label":"Pagination",children:[n&&re(dr,{size:a,variant:"soft",color:"gray","aria-label":"First page",disabled:l,onClick:()=>t(1),children:re(Ln,{})}),re(dr,{size:a,variant:"soft",color:"gray","aria-label":"Previous page",disabled:l,onClick:()=>t(e-1),children:re(Bn,{})}),i.map((c,g)=>c===Le?re(Nn,{size:a,color:"gray","aria-hidden":!0,style:{paddingInline:"var(--space-1)"},children:Le},`ellipsis-${g}`):re(Pn,{size:a,"aria-label":`Page ${c}`,"aria-current":c===e?"page":void 0,variant:c===e?"solid":"soft",color:c===e?void 0:"gray",className:c===e?"btn-amber-primary":void 0,onClick:()=>c!==e&&t(c),children:c},c)),re(dr,{size:a,variant:"soft",color:"gray","aria-label":"Next page",disabled:s,onClick:()=>t(e+1),children:re(zn,{})}),n&&re(dr,{size:a,variant:"soft",color:"gray","aria-label":"Last page",disabled:s,onClick:()=>t(r),children:re(Mn,{})})]})})}var pr={admin:{label:"Admin",color:"amber"},operator:{label:"Operator",color:"blue"},user:{label:"Platform User",color:"gray"}},$n={admin:pr.admin.label,operator:pr.operator.label,user:pr.user.label},Wn={active:{label:"Active",color:"var(--color-success)"},inactive:{label:"Inactive",color:"var(--gray-11)"},suspended:{label:"Suspended",color:"var(--color-danger)"}},Un={ok:"var(--green-9)",warn:"var(--orange-9)",error:"var(--red-9)"},Vn={auth:{tag:"AUTH",color:"var(--gray-11)"},sync:{tag:"SYNC",color:"var(--blue-11)"},role:{tag:"ROLE",color:"var(--violet-11)"},provision:{tag:"PROV",color:"var(--green-11)"},health:{tag:"HLTH",color:"var(--teal-11)"},error:{tag:"ERR!",color:"var(--red-11)"}},fo={USER_UPDATED:{label:"User updated",tag:"UPD",badge:"amber",color:"var(--amber-11)"},USER_DISABLED:{label:"User disabled",tag:"DIS",badge:"red",color:"var(--red-11)"},USER_ENABLED:{label:"User enabled",tag:"ENA",badge:"green",color:"var(--teal-11)"},USER_APPROVED:{label:"User approved",tag:"APPR",badge:"green",color:"var(--green-11)"},USER_REJECTED:{label:"User rejected",tag:"REJ",badge:"red",color:"var(--red-11)"},SIGNUP_NOTIFICATIONS_ON:{label:"Signup notifications on",tag:"NOTF",badge:"gray",color:"var(--gray-11)"},SIGNUP_NOTIFICATIONS_OFF:{label:"Signup notifications off",tag:"NOTF",badge:"gray",color:"var(--gray-11)"},APPROVAL_EMAIL_RESENT:{label:"Approval email resent",tag:"MAIL",badge:"amber",color:"var(--amber-11)"},USER_DELETED:{label:"User deleted",tag:"DEL",badge:"yellow",color:"var(--red-11)"},ADMIN_GRANTED:{label:"Admin granted",tag:"ADMN",badge:"gray",color:"var(--violet-11)"},ADMIN_REVOKED:{label:"Admin revoked",tag:"ADMN",badge:"gray",color:"var(--orange-11)"},ADMIN_ROLE_CHANGED:{label:"Role changed",tag:"ROLE",badge:"amber",color:"var(--violet-11)"},SESSION_REVOKED:{label:"Session revoked",tag:"SESS",badge:"gray",color:"var(--gray-11)"},APP_GRANTED:{label:"App access granted",tag:"APP",badge:"green",color:"var(--green-11)"},APP_REVOKED:{label:"App access revoked",tag:"APP",badge:"red",color:"var(--orange-11)"},BUNDLE_GRANTED:{label:"Bundle access granted",tag:"BNDL",badge:"green",color:"var(--green-11)"},BUNDLE_REVOKED:{label:"Bundle access revoked",tag:"BNDL",badge:"red",color:"var(--orange-11)"},APP_VALIDATED:{label:"App repo checked",tag:"CHK",badge:"gray",color:"var(--gray-11)"},APP_DEPLOY_REQUESTED:{label:"App deploy requested",tag:"DPLY",badge:"amber",color:"var(--amber-11)"},APP_DEPLOYED:{label:"App deployed",tag:"LIVE",badge:"green",color:"var(--green-11)"},APP_DEPLOY_FAILED:{label:"App deploy failed",tag:"FAIL",badge:"red",color:"var(--red-11)"},APP_REVERTED:{label:"App deploy reverted",tag:"RVRT",badge:"red",color:"var(--orange-11)"},APP_ROLLED_BACK:{label:"App rolled back",tag:"RBCK",badge:"amber",color:"var(--orange-11)"},APP_REMOVED:{label:"App undeployed",tag:"UNDP",badge:"red",color:"var(--red-11)"},APP_DEPLOY_GRANTS_FAILED:{label:"Deploy grants failed",tag:"GRNT",badge:"red",color:"var(--red-11)"},ADMIN_CHANGE_ROLLED_BACK:{label:"Admin change rolled back",tag:"UNDO",badge:"amber",color:"var(--amber-11)"},AUDIT_EXPORTED:{label:"Audit log exported",tag:"EXPT",badge:"gray",color:"var(--gray-11)"},SESSIONS_LISTED:{label:"Sessions viewed",tag:"VIEW",badge:"gray",color:"var(--gray-11)"}};function Gn(e){return fo[e]??{label:e,tag:e.slice(0,4).toUpperCase(),badge:"gray",color:"var(--gray-11)"}}import{jsx as ho}from"react/jsx-runtime";function Zr(){return ho("div",{className:"auth-art-card",children:ho("img",{src:"/arm-logo-inverted.svg",alt:"araMetrics",style:{width:"56%",maxWidth:b.brand_logo_max,display:"block",userSelect:"none"},draggable:!1})})}import{jsx as gr,jsxs as Kn}from"react/jsx-runtime";function jn({children:e}){return Kn("div",{style:{minHeight:"100vh",display:"flex",background:"var(--surface-content)",padding:"var(--space-5)",gap:"var(--space-5)"},children:[gr("div",{className:"auth-card-left",style:{width:"47%",flexShrink:0,position:"sticky",top:"var(--space-5)",height:"calc(100vh - var(--space-8))"},children:gr(Zr,{})}),gr("div",{className:"auth-card-right",style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",justifyContent:"center",minHeight:"calc(100vh - var(--space-8))",padding:"var(--space-7) var(--space-5)"},children:gr("main",{style:{maxWidth:b.auth_form_max,width:"100%",marginLeft:"auto",marginRight:"auto",background:"var(--color-panel-solid)",borderRadius:"var(--radius-5)",boxShadow:"var(--shadow-card)",padding:"var(--space-7) var(--space-5)"},children:e})})]})}import{jsx as ur,jsxs as Yn}from"react/jsx-runtime";function Jr(){return Yn("svg",{width:18,height:18,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[ur("path",{d:"M15.68 8.18c0-.57-.05-1.11-.14-1.64H8v3.1h4.3a3.68 3.68 0 0 1-1.6 2.42v2h2.58c1.51-1.39 2.4-3.44 2.4-5.88Z",fill:"#4285F4"}),ur("path",{d:"M8 16c2.16 0 3.97-.71 5.3-1.94l-2.59-2a4.88 4.88 0 0 1-7.27-2.56H0.9v2.07A8 8 0 0 0 8 16Z",fill:"#34A853"}),ur("path",{d:"M3.44 9.5A4.8 4.8 0 0 1 3.19 8c0-.52.09-1.03.25-1.5V4.43H.9A8 8 0 0 0 0 8c0 1.29.31 2.51.9 3.57L3.44 9.5Z",fill:"#FBBC05"}),ur("path",{d:"M8 3.18c1.22 0 2.31.42 3.17 1.24l2.37-2.37A7.94 7.94 0 0 0 8 0 8 8 0 0 0 .9 4.43L3.44 6.5A4.77 4.77 0 0 1 8 3.18Z",fill:"#EA4335"})]})}import{jsx as mr,jsxs as qn}from"react/jsx-runtime";function Qr(){return qn("svg",{width:18,height:18,viewBox:"0 0 16 16",fill:"none","aria-hidden":!0,children:[mr("rect",{x:"0",y:"0",width:"7.6",height:"7.6",fill:"#F25022"}),mr("rect",{x:"8.4",y:"0",width:"7.6",height:"7.6",fill:"#7FBA00"}),mr("rect",{x:"0",y:"8.4",width:"7.6",height:"7.6",fill:"#00A4EF"}),mr("rect",{x:"8.4",y:"8.4",width:"7.6",height:"7.6",fill:"#FFB900"})]})}import{useRef as Xn}from"react";import{TextField as Zn}from"@radix-ui/themes";import{jsx as vo}from"react/jsx-runtime";function et({value:e,onChange:r,disabled:t}){let o=Xn([]);function n(s,c){let g=c.target.value.replace(/\D/g,"").slice(-1),p=Array.from({length:4},(u,y)=>e[y]??"");p[s]=g,r(p.join("")),g&&s<3&&o.current[s+1]?.focus()}function a(s,c){let g=Array.from({length:4},(p,u)=>e[u]??"");c.key==="Backspace"?!g[s]&&s>0&&(g[s-1]="",r(g.join("")),o.current[s-1]?.focus()):c.key==="ArrowLeft"&&s>0?o.current[s-1]?.focus():c.key==="ArrowRight"&&s<3&&o.current[s+1]?.focus()}function i(s){let c=s.clipboardData.getData("text").replace(/\D/g,"").slice(0,4);c&&(s.preventDefault(),r(c),o.current[Math.min(c.length,3)]?.focus())}let l=Array.from({length:4},(s,c)=>e[c]??"");return vo("div",{style:{display:"flex",gap:"var(--space-3)",justifyContent:"center"},children:l.map((s,c)=>vo(Zn.Root,{ref:g=>{o.current[c]=g},type:"text",inputMode:"numeric",maxLength:1,value:s,onChange:g=>n(c,g),onKeyDown:g=>a(c,g),onPaste:i,disabled:t,className:"otp-box","aria-label":`Digit ${c+1}`,autoComplete:c===0?"one-time-code":"off"},c))})}import{Button as rt,Callout as je,Heading as Jn,Text as tt}from"@radix-ui/themes";import{ExclamationTriangleIcon as Qn}from"@radix-ui/react-icons";import{Fragment as yo,jsx as K,jsxs as ue}from"react/jsx-runtime";function ei({email:e,title:r,subtitle:t,code:o,onCodeChange:n,otpDevHint:a,error:i,errorAction:l,busy:s,otpExpiresAt:c,otpSecondsLeft:g,resendCooldown:p,onResend:u,onUseDifferentEmail:y}){return ue(yo,{children:[ue("div",{style:{marginBottom:"var(--space-6)",textAlign:"center"},children:[K(Jn,{as:"h1",size:O.h1,style:{color:"var(--ink-strong)",marginBottom:"var(--space-3)"},children:r}),ue(tt,{as:"p",size:"2",style:{color:"var(--ink-mid)",lineHeight:1.55},children:[t," ",K("span",{style:{fontWeight:600,color:"var(--ink-strong)"},children:e}),"."]})]}),a&&K(je.Root,{color:"gray",variant:"surface",size:"1",style:{marginBottom:"var(--space-5)"},children:ue(je.Text,{style:{fontFamily:"var(--font-poppins)"},children:["Dev hint \u2014 code is ",K("strong",{children:a})]})}),i&&ue(je.Root,{color:"red",variant:"surface",size:"2",style:{marginBottom:"var(--space-5)"},children:[K(je.Icon,{children:K(Qn,{})}),ue(je.Text,{style:{fontFamily:"var(--font-poppins)"},children:[i,l&&ue(yo,{children:[" ",K(rt,{type:"button",variant:"ghost",size:"1",onClick:l.onClick,style:{fontWeight:600,textDecoration:"underline",height:"auto",padding:0},children:l.label})]})]})]}),ue("div",{children:[K(et,{value:o,onChange:n,disabled:s||g<=0}),s?K(tt,{as:"p",size:"1",style:{color:"var(--ink-mid)",marginTop:"var(--space-3)",textAlign:"center"},children:"Checking code\u2026"}):c&&g<=0?K(tt,{as:"p",size:"1",style:{color:"var(--red-11)",marginTop:"var(--space-3)",textAlign:"center"},children:"Code expired \u2014 resend to get a new one."}):null]}),ue("div",{style:{marginTop:"var(--space-5)",display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--space-3)"},children:[K(rt,{type:"button",variant:"ghost",size:"2",disabled:p>0||s,onClick:u,style:{fontWeight:500,color:p>0?"rgba(85, 85, 85, 0.4)":"var(--ink-strong)",textDecoration:p>0?"none":"underline"},children:p>0?`Resend email (${p}s)`:"Resend email"}),K(rt,{type:"button",variant:"ghost",size:"2",className:"auth-underline-link",disabled:s,onClick:y,style:{fontWeight:500,color:"var(--ink-strong)"},children:"Use a Different Email"})]})]})}import{jsx as bo}from"react/jsx-runtime";function H({provider:e}){return e==="microsoft"?bo(Qr,{}):bo(Jr,{})}var ri={google:"Google",microsoft:"Microsoft"};import{useEffect as ti,useRef as xo,useState as ot}from"react";import{Link as ko,useLocation as oi}from"react-router-dom";import{Avatar as _o,Badge as So,DropdownMenu as me,IconButton as wo,Text as Ye,Tooltip as fr}from"@radix-ui/themes";import{ChevronDownIcon as ai,ChevronLeftIcon as ni,ChevronRightIcon as Co,Cross1Icon as ii,DotFilledIcon as Do,DotsVerticalIcon as si,ExitIcon as li,GearIcon as To,QuestionMarkCircledIcon as ci}from"@radix-ui/react-icons";import{Fragment as lt,jsx as m,jsxs as S}from"react/jsx-runtime";var hr="var(--space-9)",Ke=e=>"items"in e,nt=e=>e.badge?`${e.label} \xB7 ${e.badge}`:e.label;function di(e){if(!e)return{};try{let r=JSON.parse(localStorage.getItem(e)??"{}");return!r||typeof r!="object"||Array.isArray(r)?{}:Object.fromEntries(Object.entries(r).filter(t=>typeof t[1]=="boolean"))}catch{return{}}}function pi(e,r){if(e)try{localStorage.setItem(e,JSON.stringify(r))}catch{}}var gi="calc(4 * var(--space-9))",ui="calc(var(--space-9) + var(--space-6))",mi="calc(4 * var(--space-9) + var(--space-5))",fi="var(--space-8)",it="var(--space-5)",st="var(--space-5)",Ao="calc(var(--space-5) + var(--space-3))",hi="var(--space-3)",vi=e=>e?"opacity 130ms ease 80ms":"opacity 90ms ease",Ro="opacity 200ms ease";function yi({collapsed:e,onToggle:r,onClose:t,items:o,persistKey:n,utilityHrefs:a,user:i,onSignOut:l,brandLogoExpandedSrc:s="/expand.svg",brandLogoCollapsedSrc:c="/shrink.svg",helpHref:g,devRoles:p,onDevRoleSelect:u,showDevRoles:y=!1}){let h=oi().pathname,[x,w]=ot(!1),[I,Z]=ot(null),se=()=>Z(null),T=xo(null),B=xo(null),J=()=>{B.current={back:!0},se()},U=!!t,f=!e||U,L=U?mi:e?ui:gi,V=d=>!d.roles||!!i&&d.roles.includes(i.role),F=d=>{if(!V(d))return[];if(!d.bundle||!d.children)return[d];let _=d.children.flatMap(F);return _.length>0?[{...d,children:_}]:[]},Q=o.flatMap(d=>{if(!Ke(d))return F(d);let _=d.items.flatMap(F);return _.length>0?[{...d,items:_}]:[]}),pe=Q.filter(d=>!Ke(d)),Pe=Q.flatMap(d=>Ke(d)?d.items:[d]),[Nt,pa]=ot(()=>di(n)),Bt=d=>Nt[d.id]??!!d.default_collapsed;function ga(d){let _={...Nt,[d.id]:!Bt(d)};pa(_),pi(n,_)}let zt=new Set(a),ua=Q.filter(d=>Ke(d)||!zt.has(d.href)),Lt=pe.find(d=>d.href==="/settings"),Pr=pe.filter(d=>zt.has(d.href)&&d.href!=="/settings");function Er(d){return d.root??d.href}function Mt(d){return!!d.children?.length&&(d.drillable??!0)}function Nr(d){let _=Er(d);return h===_||h===d.href||h.startsWith(_+"/")?!0:!!d.bundle&&!!d.children?.some(Nr)}let sr=[];for(let d=Pe;;){let _=d.find(G=>Mt(G)&&Nr(G));if(!_)break;sr.push(_),d=_.children}let Br=I?.path===h?Math.min(I.depth,sr.length):sr.length,ge=Br>0?sr[Br-1]:void 0,ma=()=>{ge&&(B.current={row:ge.href}),Z({path:h,depth:Br-1})};ti(()=>{let d=B.current,_=T.current;if(!d||!_)return;B.current=null,("back"in d?_.querySelector("[data-nav-back]"):Array.from(_.querySelectorAll("[data-nav-href]")).find(Ee=>Ee.dataset.navHref===d.row))?.focus()},[ge?.href]);function zr(d,_){return d==="/home"||_?h===d:h===d||h.startsWith(d+"/")}function Lr(d){return Ft(d,!0)}function Ft(d,_){let G=d.bundle?Nr(d):zr(Er(d),d.end),Ee=Mt(d),Ht=m(at,{item:d,active:G,expanded:f,uppercase:_,showChevron:Ee,onClick:Ee?J:void 0},d.href);return f?Ht:m(fr,{content:nt(d),side:"right",delayDuration:300,children:Ht},d.href)}function fa(d){let _=`nav-group-${d.id}`;if(!f)return S("div",{role:"group","aria-label":d.label,children:[m("div",{"aria-hidden":"true",style:{height:1,background:"var(--gray-4)",margin:`var(--space-2) ${it}`}}),d.items.map(Lr)]},_);let G=Bt(d);return S("div",{style:{display:"flex",flexDirection:"column",marginTop:"var(--space-3)"},children:[m(bi,{label:d.label,folded:G,holdsActive:G&&d.items.some(Ee=>zr(Er(Ee))),controls:_,onToggle:()=>ga(d)}),m("div",{id:_,role:"group","aria-label":d.label,hidden:G,children:d.items.map(Lr)})]},_)}let ha=h.startsWith("/admin")&&(i?.role==="admin"||i?.role==="operator"),Ot=i?.name?.split(" ").map(d=>d[0]).join("").slice(0,2)||"?";return S("aside",{ref:T,style:{position:"relative",width:L,height:"100%",minHeight:"100vh",background:"var(--shell-surface)",borderRight:"1px solid var(--gray-6)",flexShrink:0,transition:U?"none":"width 200ms ease",zIndex:2},children:[S("div",{style:{width:"100%",height:"100%",minHeight:"100vh",display:"flex",flexDirection:"column",overflow:"hidden"},children:[S("div",{style:{height:hr,flexShrink:0,position:"relative",overflow:"hidden",borderBottom:"1px solid var(--border-hairline)"},children:[m("img",{src:s,alt:"",height:40,style:{display:"block",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",transition:Ro,opacity:f?1:0,pointerEvents:"none",userSelect:"none"}}),m("img",{src:c,alt:"",height:40,style:{display:"block",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",transition:Ro,opacity:f?0:1,pointerEvents:"none",userSelect:"none"}}),U&&m(wo,{variant:"ghost",color:"gray",size:"1",onClick:t,"aria-label":"Close menu",style:{position:"absolute",right:"var(--space-2)",top:"50%",transform:"translateY(-50%)"},children:m(ii,{style:v("--space-3")})})]}),m("nav",{"aria-label":"Main navigation",style:{flex:1,overflowY:"auto",overflowX:"hidden",paddingTop:"var(--space-5)",display:"flex",flexDirection:"column"},children:ge?S(lt,{children:[(()=>{let d=m(at,{item:{label:ge.label,href:"#",Icon:ni},active:!1,expanded:f,uppercase:!0,asButton:!0,onClick:ma});return f?d:m(fr,{content:ge.label,side:"right",delayDuration:300,children:d})})(),ge.children.map(d=>Ft(d,!!ge.bundle))]}):ua.map(d=>Ke(d)?fa(d):Lr(d))}),!ge&&Pr.length>0&&m("nav",{"aria-label":"Utility navigation",style:{flexShrink:0,borderTop:"1px solid var(--gray-4)",paddingTop:"var(--space-2)",paddingBottom:"var(--space-2)",display:"flex",flexDirection:"column"},children:Pr.map(d=>{let _=zr(d.href),G=m(at,{item:d,active:_,expanded:f,uppercase:!0,showChevron:!!d.children,onClick:d.children?J:void 0},d.href);return f?G:m(fr,{content:nt(d),side:"right",delayDuration:300,children:G},d.href)})}),S("div",{style:{borderTop:Pr.length>0?"none":"1px solid var(--gray-4)",padding:f?"var(--space-2) var(--space-4)":"var(--space-2) 0",flexShrink:0,display:"flex",flexDirection:"column",gap:"var(--space-2)"},children:[f&&ha&&S(So,{color:"gray",variant:"soft",highContrast:!0,size:"1",radius:"full",style:{alignSelf:"flex-start"},children:[m(Do,{style:v("--space-2")}),"Administering platform"]}),S("div",{style:{display:"flex",flexDirection:f?"row":"column",alignItems:"center",justifyContent:f?"space-between":"center",gap:"var(--space-2)"},children:[f?S("div",{className:"shell-profile-chip",style:{display:"flex",alignItems:"center",gap:"var(--space-2)",minWidth:0,flex:1,padding:"var(--space-1)",borderRadius:"var(--radius-3)"},children:[m(_o,{size:"2",radius:"full",src:i?.avatar_src,fallback:Ot,color:"gray",variant:"soft",style:{flexShrink:0}}),m(Ye,{as:"p",size:"2",weight:"medium",truncate:!0,style:{color:"var(--shell-ink-strong)"},children:i?.name})]}):m(fr,{content:i?.name??"Account",side:"right",delayDuration:300,children:m(_o,{size:"3",radius:"full",src:i?.avatar_src,fallback:Ot,color:"gray",variant:"soft"})}),S(me.Root,{children:[m(me.Trigger,{children:m(wo,{variant:"ghost",color:"gray","aria-label":"Account menu",className:"sidebar-icon-btn",style:{flexShrink:0},children:m(si,{style:v("--space-4")})})}),S(me.Content,{align:f?"end":"start",side:f?"top":"right",style:{minWidth:200},children:[Lt&&m(me.Item,{asChild:!0,children:S(ko,{to:Lt.href,onClick:se,children:[m(To,{}),"Settings"]})}),g&&S(me.Item,{onClick:()=>window.open(g,"_blank","noopener,noreferrer"),children:[m(ci,{}),"Help"]}),m(me.Separator,{}),S(me.Item,{color:"red",onClick:()=>w(!0),children:[m(li,{}),"Log Out"]}),y&&p&&p.length>0&&S(lt,{children:[m(me.Separator,{}),m("div",{style:{padding:"var(--space-1) var(--space-3)"},children:m(Ye,{size:"1",style:{fontFamily:"monospace",color:"var(--gray-11)",letterSpacing:"0.04em",textTransform:"uppercase"},children:"Dev \xB7 switch role"})}),p.map(d=>S(me.Item,{onClick:()=>u?.(d.email),disabled:i?.role===d.role,children:[m(To,{}),d.label,S(Ye,{size:"1",color:"gray",style:{marginLeft:"auto"},children:[d.role,"@"]})]},d.role))]})]})]})]})]})]}),!U&&m("button",{onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",className:"sidebar-collapse-btn",style:{top:"calc(var(--space-9) / 2)",transform:"translateY(-50%)",right:"calc(-1 * var(--space-3))"},children:m(xi,{flipped:e})}),m(Or,{open:x,onOpenChange:w,title:"Confirm Logout",description:"Are you sure you want to log out?",onConfirm:l})]})}function at({item:e,active:r,expanded:t,onClick:o,asButton:n,showChevron:a,uppercase:i}){let l={position:"relative",textDecoration:"none",display:"flex",alignItems:"center",height:fi,flexShrink:0,paddingLeft:Ao,paddingRight:t?`calc(${st} + var(--space-1))`:0,gap:t?hi:0,color:r?"var(--shell-ink-strong)":"var(--shell-ink-mid)",cursor:"pointer"},s=S(lt,{children:[r&&m("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:0,width:"var(--space-1)",height:"100%",background:"var(--accent-9)",borderRadius:"0 var(--radius-1) var(--radius-1) 0"}}),m("span",{"aria-hidden":"true",className:"nav-pill",style:{position:"absolute",top:0,bottom:0,left:it,right:t?st:it,borderRadius:"var(--radius-3)",background:r?"var(--accent-9)":"transparent",transition:"background 80ms ease"}}),m(e.Icon,{width:20,height:20,style:{position:"relative",flexShrink:0}}),S("span",{style:{position:"relative",display:"flex",alignItems:"center",gap:"var(--space-1)",minWidth:0,overflow:"hidden",maxWidth:t?void 0:0,opacity:t?1:0,transition:vi(t)},children:[m(Ye,{as:"span",size:"3",weight:r?"medium":"regular",style:{lineHeight:1.3,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0,textTransform:i?"uppercase":void 0},children:e.label}),e.badge&&m(So,{color:"gray",variant:r?"solid":"soft",highContrast:r,size:"1",radius:"full",style:{flexShrink:0,paddingInline:"var(--space-1)",textTransform:i?"uppercase":void 0},children:e.badge})]}),a&&t&&(r?m("span",{style:{position:"relative",marginLeft:"auto",marginRight:"var(--space-1)",flexShrink:0,display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-5)",height:"var(--space-5)",background:"var(--color-panel-solid)",borderRadius:"var(--radius-2)",boxShadow:"0 1px 2px rgba(0,0,0,0.12)"},children:m(Co,{style:{...v("--space-4"),color:"var(--gray-11)"}})}):m(Co,{style:{...v("--space-4"),position:"relative",marginLeft:"auto",color:"var(--shell-ink-mid)",flexShrink:0}}))]});return n?m("button",{type:"button",onClick:o,"data-nav-back":"",className:"shell-nav-item",style:{...l,background:"none",border:"none",width:"100%",textAlign:"left",font:"inherit"},children:s}):m(ko,{to:e.href,onClick:o,className:"shell-nav-item","data-nav-href":e.href,"data-active":r?"true":void 0,"aria-current":r?"page":void 0,title:t?nt(e):void 0,style:l,children:s})}function bi({label:e,folded:r,holdsActive:t,controls:o,onToggle:n}){return S("button",{type:"button",onClick:n,"aria-expanded":!r,"aria-controls":o,className:"shell-nav-group","data-holds-active":t?"true":void 0,style:{display:"flex",alignItems:"center",gap:"var(--space-1)",height:"var(--space-6)",flexShrink:0,width:"100%",paddingLeft:Ao,paddingRight:`calc(${st} + var(--space-1))`,background:"none",border:"none",font:"inherit",textAlign:"left",cursor:"pointer",color:t?"var(--shell-ink-strong)":"var(--shell-ink-mid)"},children:[m(Ye,{as:"span",size:"1",weight:"medium",style:{textTransform:"uppercase",letterSpacing:"0.04em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:e}),t&&m(Do,{"aria-hidden":"true",style:{...v("--space-3"),color:"var(--accent-9)",flexShrink:0}}),m(ai,{"aria-hidden":"true",style:{...v("--space-4"),marginLeft:"auto",flexShrink:0,transform:r?"rotate(-90deg)":void 0,transition:"transform 120ms ease"}})]})}function xi({flipped:e}){return S("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{transform:e?"scaleX(-1)":void 0},children:[m("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5",stroke:"currentColor"}),m("path",{d:"M5.5 2.5v11",stroke:"currentColor"}),m("path",{d:"M11 5.5 8.5 8l2.5 2.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]})}import{Link as _i,useLocation as wi}from"react-router-dom";import{HamburgerMenuIcon as Ci,MagnifyingGlassIcon as Ti,BellIcon as Ri}from"@radix-ui/react-icons";import{Flex as ki,Heading as Si,IconButton as Di,Text as Io,Tooltip as Ai}from"@radix-ui/themes";import{Fragment as Bi,jsx as $,jsxs as vr}from"react/jsx-runtime";var Ii=[["/home","Home","/home","Home"],["/settings/account","Settings","/settings/account","Account"],["/settings/linked","Settings","/settings/account","Linked Account"],["/settings","Settings","/settings/account","Settings"]];function Pi(e,r,t){let o=r.split("/"),n=e.split("/");return(t?n.length!==o.length:n.length<o.length)?!1:o.every((a,i)=>a.startsWith(":")?n[i]!=="":a===n[i])}function Ei(e,r){let t=r.find(([i,,,,l])=>Pi(e,i,l));if(!t)return{section:"Home",sectionHref:"/home",page:"Home"};let[,o,n,a]=t;return{section:o,sectionHref:n,page:a}}function Ni({onSearchOpen:e,onMenuOpen:r,showMenu:t,titles:o=Ii}){let n=wi().pathname;return vr("header",{style:{height:hr,background:"var(--accent-9)",borderBottom:"1px solid var(--border-hairline)",flexShrink:0,display:"flex",alignItems:"center",padding:"0 var(--space-6)",gap:"var(--space-4)"},children:[t&&$(Di,{variant:"ghost",size:"1",onClick:r,"aria-label":"Open navigation",style:{marginRight:"var(--space-1)",color:"var(--shell-ink-strong)"},children:$(Ci,{style:v("--space-4")})}),(()=>{let{section:a,sectionHref:i,page:l}=Ei(n,o);return vr(ki,{align:"baseline",gap:"2",style:{minWidth:0,overflow:"hidden"},children:[a!==l&&vr(Bi,{children:[$(Io,{asChild:!0,size:"3",weight:"regular",children:$(_i,{to:i,style:{color:"var(--shell-ink-mid)",whiteSpace:"nowrap",textDecoration:"none",overflow:"hidden",textOverflow:"ellipsis",flexShrink:0},className:"topbar-breadcrumb-link",children:a})}),$(Io,{size:"3",weight:"regular",className:"topbar-breadcrumb-sep",style:{color:"var(--shell-ink-mid)",flexShrink:0},children:"/"})]}),$(Si,{as:"h1",size:O.h1,weight:"medium",style:{color:"var(--shell-ink-strong)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},children:l})]})})(),$("div",{style:{flex:1}}),vr("button",{className:"topbar-search",onClick:e,"aria-label":"Search (\u2318K)",children:[$(Ti,{width:16,height:16,style:{color:"var(--shell-ink-strong)",flexShrink:0}}),$("span",{className:"topbar-search-placeholder",children:"Search for something"})]}),$(Ai,{content:"Coming soon",children:$("span",{children:$("button",{className:"topbar-icon-circle","aria-label":"Notifications (coming soon)",disabled:!0,children:$(Ri,{style:v("--space-4")})})})})]})}import{useEffect as Po,useRef as Eo,useState as ct}from"react";import{Dialog as dt,Flex as No,Spinner as zi,Text as te,TextField as Li,VisuallyHidden as Mi}from"@radix-ui/themes";import{CalendarIcon as Fi,MagnifyingGlassIcon as Oi,PersonIcon as Hi,ReaderIcon as $i}from"@radix-ui/react-icons";import{Fragment as Ki,jsx as C,jsxs as Y}from"react/jsx-runtime";var Wi={app:Fi,people:Hi,page:$i},Ui={app:"Apps",people:"People",page:"Pages"};function Vi(e){let r=["app","people","page"],t=[],o=0;for(let n of r){let a=e.filter(i=>i.type===n);a.length>0&&(t.push({type:n,label:Ui[n],items:a,startIdx:o}),o+=a.length)}return t}function Gi({open:e,onClose:r,results:t,onSelectResult:o,title:n="Search",placeholder:a="Search\u2026"}){return C(dt.Root,{open:e,onOpenChange:i=>!i&&r(),children:C(dt.Content,{"aria-describedby":void 0,style:{padding:0,maxWidth:"calc(9 * var(--space-9) + var(--space-2))",overflow:"hidden",boxShadow:"0 4px 8px rgba(0,0,0,0.06), 0 12px 32px rgba(0,0,0,0.10), 0 0 0 1px var(--gray-5)"},children:C(ji,{onClose:r,resultPool:t,onSelectResult:o,title:n,placeholder:a})})})}function ji({onClose:e,resultPool:r,onSelectResult:t,title:o,placeholder:n}){let[a,i]=ct(""),[l,s]=ct(null),[c,g]=ct(-1),p=Eo(null),u=Eo(null),y=!!l&&l.q===a,h=y?l.items:[],x=a.trim()?y?h.length?"results":"no-match":"searching":"prompt";Po(()=>{if(!a.trim())return;let T=setTimeout(()=>{let B=a.toLowerCase(),J=r.filter(U=>U.title.toLowerCase().includes(B)||U.subtitle.toLowerCase().includes(B));s({q:a,items:J}),g(-1)},320);return()=>clearTimeout(T)},[a,r]),Po(()=>{if(c<0||!u.current)return;u.current.querySelector(`[data-idx="${c}"]`)?.scrollIntoView({block:"nearest"})},[c]);function w(T){T.key==="Escape"?e():T.key==="ArrowDown"?(T.preventDefault(),g(B=>Math.min(B+1,h.length-1))):T.key==="ArrowUp"?(T.preventDefault(),g(B=>Math.max(B-1,0))):T.key==="Enter"&&(T.preventDefault(),c>=0&&h[c]&&(t(h[c]),e()))}function I(T){t(T),e()}let Z=Vi(h),se="calc(2 * var(--space-9) + var(--space-6))";return Y(Ki,{children:[C(Mi,{children:C(dt.Title,{children:o})}),Y("div",{style:{display:"flex",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-3) var(--space-4)",borderBottom:"1px solid var(--gray-5)"},children:[x==="searching"?C(zi,{size:"1",style:{flexShrink:0}}):C(Oi,{width:16,height:16,style:{color:"var(--gray-9)",flexShrink:0}}),C(Li.Root,{ref:p,autoFocus:!0,type:"text",placeholder:n,value:a,onChange:T=>i(T.target.value),onKeyDown:w,className:"search-overlay-input",style:{flex:1,border:"none",outline:"none",background:"transparent",boxShadow:"none","--text-field-selection-color":"unset"}}),C("kbd",{style:{color:"var(--gray-11)",background:"var(--gray-3)",border:"1px solid var(--gray-5)",borderRadius:"var(--radius-1)",padding:"var(--space-1) var(--space-2)",flexShrink:0},children:C(te,{size:"1",as:"span",children:"Esc"})})]}),Y("div",{ref:u,style:{minHeight:se,maxHeight:"calc(6 * var(--space-9) + var(--space-7))",overflowY:"auto"},children:[x==="prompt"&&C(No,{align:"center",justify:"center",style:{height:se},children:C(te,{size:"2",color:"gray",children:"Type to search\u2026"})}),x==="no-match"&&C(No,{align:"center",justify:"center",style:{height:se},children:Y("div",{style:{textAlign:"center"},children:[Y(te,{size:"2",color:"gray",as:"p",children:["No results for \u201C",a,"\u201D"]}),C(te,{size:"1",color:"gray",as:"p",mt:"1",children:"Try searching with different keywords"})]})}),x==="results"&&C("div",{style:{padding:"var(--space-2)"},children:Z.map(T=>{let B=Wi[T.type];return Y("div",{style:{marginBottom:"var(--space-1)"},children:[C("div",{style:{padding:"var(--space-2) var(--space-3) var(--space-1)",display:"flex",alignItems:"center",gap:"var(--space-2)"},children:C(te,{size:"1",style:{color:"var(--gray-11)",fontWeight:500,letterSpacing:"0.04em",textTransform:"uppercase",fontFamily:"var(--font-poppins)"},children:T.label})}),T.items.map((J,U)=>{let f=T.startIdx+U,L=c===f;return Y("button",{"data-idx":f,onClick:()=>I(J),onMouseEnter:()=>g(f),className:"search-result-item",style:{width:"100%",display:"flex",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-2) var(--space-3)",borderRadius:"var(--radius-2)",border:"none",cursor:"pointer",textAlign:"left",background:L?"var(--gray-3)":"transparent"},children:[C("div",{style:{width:"var(--space-6)",height:"var(--space-6)",borderRadius:"var(--radius-1)",background:L?"var(--accent-a3)":"var(--gray-3)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transition:"background 100ms ease"},children:C(B,{width:12,height:12,style:{color:L?"var(--accent-11)":"var(--gray-9)"}})}),Y("div",{style:{flex:1,minWidth:0},children:[C(te,{as:"p",size:"2",weight:"medium",style:{color:L?"var(--gray-12)":"var(--gray-11)",lineHeight:1.3,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:J.title}),C(te,{as:"p",size:"1",style:{color:"var(--gray-11)",lineHeight:1.3,marginTop:"1px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:J.subtitle})]}),L&&C("kbd",{style:{color:"var(--gray-9)",background:"var(--gray-4)",border:"1px solid var(--gray-5)",borderRadius:"var(--radius-1)",padding:"var(--space-1)",flexShrink:0},children:C(te,{size:"1",as:"span",className:"data-mono",children:"\u21B5"})})]},J.id)})]},T.type)})})]}),x!=="prompt"&&Y("div",{style:{borderTop:"1px solid var(--gray-4)",padding:"var(--space-2) var(--space-4)",display:"flex",gap:"var(--space-4)"},children:[Y(te,{as:"span",size:"1",color:"gray",children:[C("kbd",{className:"data-mono",children:"\u2191\u2193"})," navigate"]}),Y(te,{as:"span",size:"1",color:"gray",children:[C("kbd",{className:"data-mono",children:"\u21B5"})," open"]}),Y(te,{as:"span",size:"1",color:"gray",children:[C("kbd",{className:"data-mono",children:"Esc"})," close"]})]})]})}function q(e,r){for(let t of e){let o=t.calendars.find(n=>n.id===r);if(o)return{account:t,calendar:o}}}import pt from"dayjs";import{Flex as Bo,Text as zo}from"@radix-ui/themes";import{jsx as gt,jsxs as Yi}from"react/jsx-runtime";function ut({date:e,today:r=new Date}){let t=pt(e).isSame(r,"day");return Yi(Bo,{direction:"column",align:"center",gap:"1",py:"1",children:[gt(zo,{size:"1",weight:"medium",color:"gray",style:{letterSpacing:"0.04em"},children:pt(e).format("ddd").toUpperCase()}),gt(Bo,{align:"center",justify:"center",style:{width:"var(--space-6)",height:"var(--space-6)",borderRadius:"50%",background:t?"var(--accent-9)":"transparent",lineHeight:1},children:gt(zo,{size:"3",weight:t?"medium":"regular",style:{color:t?"var(--accent-contrast)":"var(--gray-12)",lineHeight:1},children:pt(e).format("D")})})]})}import{Box as qe,Checkbox as qi,Flex as Xi,RadioGroup as Lo,Text as Xe}from"@radix-ui/themes";import{jsx as N,jsxs as Fo}from"react/jsx-runtime";function Zi(e){return e.flatMap(r=>r.calendars.map(t=>({calendarId:t.id,calendarName:t.name,email:r.email,provider:r.provider})))}function Ji({provider:e}){return N("span",{"aria-hidden":!0,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-5)",height:"var(--space-5)",flexShrink:0},children:N(H,{provider:e})})}function Mo({row:e,control:r,selected:t,disabled:o,disabledLabel:n}){return Fo(Xe,{as:"label",size:"2",style:{display:"flex",alignItems:"center",gap:"var(--space-3)",width:"100%",paddingBlock:"var(--space-3)",paddingInline:"var(--space-4)",cursor:o?"not-allowed":"pointer",opacity:o?.45:1,background:t?"var(--accent-2)":"transparent",color:"var(--gray-12)"},children:[N(Ji,{provider:e.provider}),Fo(Xi,{direction:"column",gap:"0",style:{minWidth:0,flex:1},children:[N(Xe,{size:"2",weight:"medium",truncate:!0,style:{color:"var(--gray-12)"},children:e.calendarName}),N(Xe,{size:"1",color:"gray",truncate:!0,children:e.email})]}),n?N(Xe,{size:"1",color:"gray",style:{flexShrink:0},children:n}):null,N(qe,{style:{flexShrink:0,display:"flex",alignItems:"center"},children:r})]})}function Qi({accounts:e,mode:r,sourceCalendarIds:t,targetCalendarId:o,takenSourceIds:n,onToggleSource:a,onSelectTarget:i,fill:l=!1}){let s=Zi(e),g=r==="sources"&&s.length>0&&s.every(p=>p.calendarId===o||n.has(p.calendarId))?N(qe,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",background:"var(--color-panel-solid)",padding:"var(--space-4)",...l?{flex:1,minHeight:0}:{}},children:N(Xe,{as:"p",size:"2",color:"gray",align:"center",children:"All your calendars are already used as sources in other syncs, or set as this sync's target. Remove a calendar from another sync to make it available here."})}):N(qe,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",background:"var(--color-panel-solid)",...l?{flex:1,minHeight:0,overflowY:"auto"}:{overflow:"hidden"}},children:s.map((p,u)=>{if(r==="sources"){let x=p.calendarId===o,w=n.has(p.calendarId),I=x||w,Z=t.includes(p.calendarId);return N(qe,{style:{borderTop:u>0?"1px solid var(--gray-4)":void 0},children:N(Mo,{row:p,selected:Z,disabled:I,disabledLabel:x?"Target":w?"In use":void 0,control:N(qi,{checked:Z,disabled:I,onCheckedChange:()=>{I||a(p.calendarId)}})})},p.calendarId)}let y=t.includes(p.calendarId),h=p.calendarId===o;return N(qe,{style:{borderTop:u>0?"1px solid var(--gray-4)":void 0},children:N(Mo,{row:p,selected:h,disabled:y,disabledLabel:y?"Source":void 0,control:N(Lo.Item,{value:p.calendarId,disabled:y})})},p.calendarId)})});return r==="target"?N(Lo.Root,{value:o??"",onValueChange:p=>{p&&i(p)},style:l?{flex:1,minHeight:0,display:"flex",flexDirection:"column"}:void 0,children:g}):g}import{Button as Oo,Flex as mt,Heading as es,IconButton as Ho}from"@radix-ui/themes";import{ChevronLeftIcon as rs,ChevronRightIcon as ts}from"@radix-ui/react-icons";import{Navigate as ft}from"react-big-calendar";import{jsx as ve,jsxs as $o}from"react/jsx-runtime";function ht({label:e,view:r,onNavigate:t,onView:o}){return $o(mt,{align:"center",justify:"between",gap:"3",wrap:"wrap",className:"calendar-toolbar",children:[$o(mt,{align:"center",gap:"2",children:[ve(Ho,{size:"2",variant:"soft",color:"gray",radius:"full","aria-label":"Previous",onClick:()=>t(ft.PREVIOUS),children:ve(rs,{})}),ve(Oo,{size:"2",variant:"soft",color:"gray",onClick:()=>t(ft.TODAY),children:"Today"}),ve(Ho,{size:"2",variant:"soft",color:"gray",radius:"full","aria-label":"Next",onClick:()=>t(ft.NEXT),children:ve(ts,{})})]}),ve(es,{as:"h2",size:O.h2,weight:"medium",style:{color:"var(--gray-12)"},children:e}),ve(mt,{gap:"1",style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",padding:"var(--space-1)",background:"var(--gray-2)"},children:["week","month"].map(n=>ve(Oo,{size:"2",variant:r===n?"solid":"soft",className:r===n?"btn-amber-primary":void 0,color:r===n?void 0:"gray",onClick:()=>o(n),style:r===n?void 0:{background:"transparent"},children:n==="week"?"Week":"Month"},n))})]})}import{Button as os,Flex as yr,Spinner as as,Text as vt}from"@radix-ui/themes";import{ChevronRightIcon as ns,ExclamationTriangleIcon as is}from"@radix-ui/react-icons";import{jsx as oe,jsxs as Ze}from"react/jsx-runtime";var Me={google:{label:"Google Calendar",description:"Connect a Google account calendar"},microsoft:{label:"Outlook Calendar",description:"Connect an Outlook account calendar"}},ss=["google","microsoft"];function yt({connectingProvider:e,failedProvider:r,exhausted:t=!1,onConnect:o}){return oe(yr,{direction:"column",gap:"3",style:{width:"100%",textAlign:"left"},children:ss.map(n=>{let a=Me[n],i=e===n;return Ze("div",{children:[Ze("button",{type:"button",className:"provider-choice",onClick:()=>o(n),disabled:e!==null,"data-connecting":i?"true":void 0,"aria-busy":i||void 0,"aria-label":`Connect ${a.label}`,children:[oe(E,{children:oe(H,{provider:n})}),Ze(yr,{direction:"column",className:"provider-choice__copy",gap:"1",children:[oe(vt,{size:"3",weight:"medium",truncate:!0,style:{color:"var(--gray-12)"},children:a.label}),oe(vt,{size:"2",color:"gray",truncate:!0,children:a.description})]}),oe("span",{className:"provider-choice__chevron","aria-hidden":!0,children:i?oe(as,{size:"2"}):oe(ns,{style:v("--space-5")})})]}),r===n&&Ze(yr,{align:"center",justify:"between",gap:"3",mt:"2",px:"1",children:[Ze(yr,{align:"center",gap:"2",children:[oe(is,{style:{...v("--space-4"),color:"var(--red-9)",flexShrink:0}}),oe(vt,{size:"2",style:{color:"var(--red-11)"},children:t?`No more ${a.label} accounts available to connect.`:`Couldn't connect ${a.label}. Please try again.`})]}),!t&&oe(os,{variant:"ghost",size:"1",onClick:()=>o(n),children:"Retry"})]})]},n)})})}import{Badge as Wo,Box as ls,DropdownMenu as Je,Flex as Uo,IconButton as cs,Text as Vo}from"@radix-ui/themes";import{DotsVerticalIcon as ds,ReloadIcon as ps,TrashIcon as gs}from"@radix-ui/react-icons";import{jsx as X,jsxs as Re}from"react/jsx-runtime";function us({account:e,onRemove:r,onReconnect:t,onClick:o}){let n=e.auth_status==="reauth",a=e.auth_status==="failed",i=X(Vo,{size:"2",weight:"medium",truncate:!0,style:{color:"var(--gray-12)"},children:e.display_name});return Re(ls,{onClick:o,style:{width:"100%",minWidth:0,height:b.connected_account_card_h,boxSizing:"border-box",padding:"var(--space-3)",background:"var(--color-panel-solid)",border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",display:"flex",alignItems:"center",gap:"var(--space-3)",cursor:o?"pointer":void 0},children:[X(E,{size:"var(--space-6)",children:X(H,{provider:e.provider})}),Re(Uo,{direction:"column",style:{flex:1,minWidth:0},children:[Re(Uo,{align:"center",gap:"2",style:{minWidth:0},children:[o?X("button",{type:"button",className:"card-title-button",onClick:l=>{l.stopPropagation(),o()},children:i}):i,n&&X(Wo,{color:"amber",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Needs reconnect"}),a&&X(Wo,{color:"red",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Connection failed"})]}),X(Vo,{size:"1",color:"gray",truncate:!0,children:e.email})]}),Re(Je.Root,{children:[X(Je.Trigger,{children:X(cs,{variant:"ghost",color:"gray",size:"1","aria-label":`${e.display_name} actions`,onClick:l=>l.stopPropagation(),children:X(ds,{})})}),Re(Je.Content,{align:"end",onClick:l=>l.stopPropagation(),children:[(n||a)&&t&&Re(Je.Item,{onSelect:t,children:[X(ps,{})," Reconnect"]}),Re(Je.Item,{color:"red",onSelect:r,children:[X(gs,{})," Remove account"]})]})]})]})}import{Flex as ms,Text as fs,Heading as hs}from"@radix-ui/themes";import{jsx as bt,jsxs as ys}from"react/jsx-runtime";function vs({icon:e,title:r,description:t,action:o,headingAs:n="h2"}){return ys(ms,{direction:"column",align:"center",gap:"3",style:{width:"100%",paddingTop:"var(--space-9)",textAlign:"center"},children:[bt(E,{size:"var(--space-8)",children:e}),bt(hs,{as:n,size:O[n],weight:"medium",align:"center",children:r}),t&&bt(fs,{size:"2",color:"gray",align:"center",style:{maxWidth:b.empty_state_copy_max},children:t}),o]})}import{useState as bs}from"react";import{Dialog as Qe,Flex as xs,Text as br,Checkbox as _s,Button as Go}from"@radix-ui/themes";import{Fragment as Cs,jsx as W,jsxs as xt}from"react/jsx-runtime";function ke({account:e,onOpenChange:r,onImport:t,initiallySelectedIds:o,disabledIds:n,disabledReason:a,title:i="Calendars",description:l="Choose which calendars you want to import.",confirmLabel:s="Import Calendars"}){let c=e?`${e.id}:${(o??e.calendars.map(g=>g.id)).join(",")}`:"closed";return W(Qe.Root,{open:!!e,onOpenChange:r,children:W(Qe.Content,{maxWidth:b.dialog_md,onInteractOutside:g=>g.preventDefault(),children:e&&W(ws,{account:e,initiallySelectedIds:o,disabledIds:n,disabledReason:a,title:i,description:l,confirmLabel:s,onImport:t},c)})})}function ws({account:e,initiallySelectedIds:r,disabledIds:t,disabledReason:o,title:n,description:a,confirmLabel:i,onImport:l}){let[s,c]=bs(()=>new Set(r??e.calendars.map(u=>u.id))),g=new Set(t??[]);function p(u){g.has(u)||c(y=>{let h=new Set(y);return h.has(u)?h.delete(u):h.add(u),h})}return xt(Cs,{children:[W(Qe.Title,{size:"5",weight:"medium",mb:"1",children:n}),W(Qe.Description,{size:"2",color:"gray",mb:"2",children:a}),W(br,{as:"p",size:"2",weight:"medium",mb:"5",style:{color:"var(--gray-12)"},children:e.email}),W(xs,{direction:"column",gap:"3",mb:"5",children:e.calendars.map(u=>{let y=s.has(u.id),h=g.has(u.id);return xt(br,{as:"label",size:"3",className:"calendar-picker-row","data-selected":y||void 0,"data-disabled":h?"true":void 0,style:{display:"flex",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-4)",cursor:h?"default":"pointer"},children:[W(_s,{checked:y,disabled:h,onCheckedChange:()=>p(u.id)}),W(br,{weight:"medium",truncate:!0,style:{flex:1,minWidth:0,color:"var(--gray-12)"},children:u.name}),h&&o&&W(br,{size:"1",color:"gray",style:{flexShrink:0},children:o})]},u.id)})}),xt(ee,{justify:"between",noTopMargin:!0,pad:"var(--space-5)",radius:"var(--radius-4)",children:[W(Qe.Close,{children:W(Go,{size:"2",variant:"outline",color:"gray",children:"Cancel"})}),W(Go,{size:"2",className:"btn-amber-primary",disabled:s.size===0,onClick:()=>l(Array.from(s)),children:i})]})]})}import{Box as er,Flex as Ts,Text as ae}from"@radix-ui/themes";import{jsx as z,jsxs as xr}from"react/jsx-runtime";function Rs(e){let r=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!r)return"white";let t=parseInt(r[1],16),o=a=>{let i=a/255;return i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4)};return .2126*o(t>>16&255)+.7152*o(t>>8&255)+.0722*o(t&255)>.45?"black":"white"}function jo({tone:e,title:r,meta:t,accentColor:o}){let n=e==="synced"?o||"var(--accent-9)":"var(--blue-11)",a=e==="synced"?o?Rs(o):"var(--accent-contrast)":"white";return xr(er,{style:{background:n,borderRadius:"var(--radius-2)",padding:"var(--space-2) var(--space-3)"},children:[z(ae,{as:"p",size:"2",weight:"medium",style:{color:a},children:r}),t?z(ae,{as:"p",size:"1",style:{color:a},children:t}):null]})}var ks="Busy",Ss={title:"Gym",time:"10:00 AM",location:"Flex Gym on 16th Ave",description:"Workout notes"};function Ds({hasSources:e,hasTarget:r,sourceLabel:t,targetLabel:o,showTitle:n,showDescription:a,showLocation:i,tagLabel:l,accentColor:s,sampleEvent:c=Ss}){let g=c.title,p=[c.time,c.location].filter(Boolean).join(" \xB7 "),u=l?.trim()||ks,y=n?`${c.title} - (${u})`:u,h=[c.time].filter(Boolean);i&&c.location&&h.push(c.location),a&&c.description&&h.push(c.description);let x=h.join(" \xB7 ");return xr(Ts,{direction:"column",gap:"4",style:{padding:"var(--space-4)"},children:[z(ae,{as:"p",className:"ds-section-label",style:{textAlign:"center"},children:"Sync Preview"}),z(ae,{as:"p",size:"1",color:"gray",style:{textAlign:"center",marginTop:"calc(-1 * var(--space-2))"},children:"Example event \u2014 not from your calendars."}),xr(er,{children:[z(ae,{as:"p",size:"1",color:"gray",mb:"1",children:"Sources"}),z(ae,{as:"p",size:"1",weight:"medium",mb:"2",truncate:!0,style:{color:"var(--gray-12)"},children:e?t||"Selected sources":"\u2014"}),z(er,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-2)",padding:"var(--space-2)",background:"var(--gray-2)"},children:z(jo,{tone:"source",title:g,meta:p})})]}),xr(er,{children:[z(ae,{as:"p",size:"1",color:"gray",mb:"1",children:"Target"}),z(ae,{as:"p",size:"1",weight:"medium",mb:"2",truncate:!0,style:{color:"var(--gray-12)"},children:r?o||"Selected target":"\u2014"}),z(er,{style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-2)",padding:"var(--space-2)",background:"var(--gray-2)"},children:r?z(jo,{tone:"synced",title:y,meta:x,...s?{accentColor:s}:{}}):z(ae,{as:"p",size:"2",color:"gray",children:"Pick one target calendar"})})]}),!e||!r?z(ae,{as:"p",size:"1",color:"gray",style:{textAlign:"center"},children:"Select one or more sources, then one target"}):z(ae,{as:"p",size:"1",color:"gray",style:{textAlign:"center"},children:"Only the highlighted block is posted to the target"})]})}import{Flex as _t,Text as wt}from"@radix-ui/themes";import{CheckIcon as As}from"@radix-ui/react-icons";import{jsx as Fe,jsxs as Ko}from"react/jsx-runtime";function Ct({steps:e,current:r}){return Fe("div",{role:"list","aria-label":"Wizard progress",style:{display:"flex",flexWrap:"wrap",width:"100%",flexShrink:0,marginBottom:0,border:"1px solid var(--gray-5)",borderRadius:"var(--radius-4)",background:"var(--color-panel-solid)",overflow:"hidden"},children:e.map((t,o)=>{let n=o+1,a=n===r,i=n<r;return Ko(_t,{align:"start",gap:"3",role:"listitem","aria-current":a?"step":void 0,style:{flex:"1 1 calc(3 * var(--space-9) + var(--space-6))",minWidth:"calc(3 * var(--space-9) + var(--space-6))",paddingTop:"var(--space-4)",paddingBottom:"var(--space-4)",paddingLeft:"var(--space-4)",paddingRight:"var(--space-4)",marginBottom:"-1px",borderBottom:a?"2px solid var(--accent-9)":"2px solid transparent"},children:[Fe(_t,{align:"center",justify:"center",style:{width:"var(--space-6)",height:"var(--space-6)",borderRadius:"50%",flexShrink:0,marginTop:"var(--space-1)",background:i?"var(--green-9)":a?"var(--accent-9)":"var(--gray-3)",color:i?"white":a?"var(--accent-contrast)":"var(--gray-11)"},children:i?Fe(As,{style:v("--space-3")}):Fe(wt,{size:"1",weight:"medium",children:t.n})}),Ko(_t,{direction:"column",gap:"1",style:{minWidth:0,flex:1,paddingTop:"var(--space-1)"},children:[Fe(wt,{size:"2",weight:"medium",style:{color:a||i?"var(--gray-12)":"var(--gray-10)",lineHeight:"var(--line-height-2)"},children:t.title}),Fe(wt,{size:"1",color:"gray",style:{lineHeight:"var(--line-height-1)"},children:t.description})]})]},t.n)})})}import{jsx as qo}from"react/jsx-runtime";var Is=[{n:"01",title:"Connect",description:"Connect your calendar account"},{n:"02",title:"Calendars",description:"Import at least 2 calendars"},{n:"03",title:"Sync",description:"Set up your first sync"}];function Yo({current:e}){return qo(Ct,{steps:Is,current:e})}function Ps({current:e,total:r=3}){return qo(Yo,{current:e})}import Tt from"dayjs";import{Flex as Xo,Grid as Zo,IconButton as Jo,Text as Qo}from"@radix-ui/themes";import{ChevronLeftIcon as Es,ChevronRightIcon as Ns}from"@radix-ui/react-icons";import{jsx as fe,jsxs as Rt}from"react/jsx-runtime";var Bs=["S","M","T","W","T","F","S"];function kt({cursor:e,onSelect:r,today:t=new Date}){let o=Tt(e).startOf("month"),n=o.startOf("week"),a=Array.from({length:42},(i,l)=>n.add(l,"day"));return Rt("div",{children:[Rt(Xo,{align:"center",justify:"between",mb:"2",children:[fe(Qo,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:o.format("MMMM YYYY")}),Rt(Xo,{gap:"1",children:[fe(Jo,{size:"1",variant:"ghost",color:"gray","aria-label":"Previous month",onClick:()=>r(Tt(e).subtract(1,"month").toDate()),children:fe(Es,{})}),fe(Jo,{size:"1",variant:"ghost",color:"gray","aria-label":"Next month",onClick:()=>r(Tt(e).add(1,"month").toDate()),children:fe(Ns,{})})]})]}),fe(Zo,{columns:"7",gap:"1",mb:"1",children:Bs.map((i,l)=>fe(Qo,{size:"1",color:"gray",align:"center",children:i},l))}),fe(Zo,{columns:"7",gap:"1",justify:"center",align:"center",style:{justifyItems:"center"},children:a.map(i=>{let l=i.isSame(t,"day"),s=i.isSame(e,"day"),c=!i.isSame(o,"month");return fe("button",{type:"button",onClick:()=>r(i.toDate()),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"var(--space-5)",height:"var(--space-5)",boxSizing:"border-box",flexShrink:0,padding:0,borderRadius:"50%",border:l&&!s?"1.5px solid var(--accent-9)":"none",cursor:"pointer",background:s?"var(--accent-9)":"transparent",color:s?"var(--accent-contrast)":c?"var(--gray-11)":l?"var(--accent-11)":"var(--gray-12)",fontWeight:l||s?500:400,fontSize:"var(--font-size-1)",fontFamily:"var(--font-poppins)"},children:i.format("D")},i.format("YYYY-MM-DD"))})})]})}import{useState as zs}from"react";import{Dialog as rr,Flex as tr,Text as _r,Button as St,IconButton as Ls,Badge as ea,Separator as Ms,Box as ra}from"@radix-ui/themes";import{Cross2Icon as Fs,PlusIcon as Os,ReloadIcon as Hs}from"@radix-ui/react-icons";import{Fragment as ta,jsx as D,jsxs as ne}from"react/jsx-runtime";function $s({account:e,catalog:r,onOpenChange:t,onRemoveCalendar:o,onSaveCalendars:n,onReconnect:a}){let[i,l]=zs(!1),s=e?.auth_status==="reauth",c=e?.auth_status==="failed";function g(p){if(!e||!r)return;let u=new Set(p);n(e,r.calendars.filter(y=>u.has(y.id))),l(!1)}return ne(ta,{children:[D(rr.Root,{open:!!e&&!i,onOpenChange:p=>{p||t(!1)},children:D(rr.Content,{maxWidth:b.dialog_md,children:e&&ne(ta,{children:[ne(tr,{align:"center",gap:"3",mb:"1",children:[D(E,{size:"var(--space-6)",children:D(H,{provider:e.provider})}),ne(ra,{style:{minWidth:0,flex:1},children:[ne(tr,{align:"center",gap:"2",mb:"1",style:{minWidth:0},children:[D(rr.Title,{size:"4",weight:"medium",mb:"0",truncate:!0,style:{minWidth:0},children:e.display_name}),s&&D(ea,{color:"amber",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Needs reconnect"}),c&&D(ea,{color:"red",variant:"soft",size:"1",radius:"full",style:{flexShrink:0},children:"Connection failed"})]}),D(rr.Description,{size:"2",color:"gray",mb:"0",children:e.email})]})]}),(s||c)&&a&&ne(St,{size:"2",variant:"soft",color:c?"red":"amber",mt:"3",onClick:()=>a(e.id),children:[D(Hs,{}),"Reconnect"]}),D(Ms,{size:"4",my:"4"}),ne(tr,{align:"center",justify:"between",gap:"3",mb:"3",children:[D(_r,{as:"p",className:"ds-section-label",mb:"0",children:"Calendars"}),r&&r.calendars.length>0&&ne(St,{size:"1",variant:"soft",color:"gray",onClick:()=>l(!0),children:[D(Os,{style:v("--space-3")}),"Change calendars"]})]}),D(tr,{direction:"column",style:{border:"1px solid var(--gray-5)",borderRadius:"var(--radius-3)",overflow:"hidden",background:"var(--color-panel-solid)"},children:e.calendars.length===0?D(_r,{size:"2",color:"gray",style:{padding:"var(--space-4)"},children:"No calendars imported."}):e.calendars.map((p,u)=>ne(tr,{align:"center",gap:"3",className:"data-table-row",style:{padding:"var(--space-3) var(--space-4)",minHeight:"var(--space-7)",borderTop:u>0?"1px solid var(--gray-4)":void 0},children:[D(ra,{"aria-hidden":!0,style:{width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:p.color_token,flexShrink:0}}),ne(_r,{size:"2",truncate:!0,style:{flex:1,minWidth:0,color:"var(--gray-12)"},children:[p.name,p.is_primary&&ne(_r,{size:"1",color:"gray",children:[" ","\xB7 Primary"]})]}),D(Ls,{variant:"ghost",color:"gray",size:"1","aria-label":`Remove ${p.name}`,onClick:()=>o(e,p),children:D(Fs,{})})]},p.id))}),D(ee,{justify:"end",children:D(rr.Close,{children:D(St,{size:"2",variant:"soft",color:"gray",children:"Close"})})})]})})}),D(ke,{account:i&&r?r:null,initiallySelectedIds:e?.calendars.map(p=>p.id),title:"Change calendars",description:"Choose which calendars to keep on this account.",confirmLabel:"Save calendars",onOpenChange:p=>{p||l(!1)},onImport:g})]})}import{useMemo as Ws}from"react";import Tr from"dayjs";import{Calendar as Us,dayjsLocalizer as Vs,Views as or}from"react-big-calendar";import"react-big-calendar/lib/css/react-big-calendar.css";import{Text as wr}from"@radix-ui/themes";import{jsx as Oe,jsxs as Cr}from"react/jsx-runtime";var Gs=Vs(Tr),js=new Date(1970,0,1,8,0,0);function Dt({blocks:e,view:r,onViewChange:t,date:o,onNavigate:n,accounts:a,today:i=new Date}){let l=Ws(()=>e.map(s=>{let c=new Date(s.date);c.setHours(s.start_hour,s.start_minute,0,0);let g=new Date(s.date);return g.setHours(s.end_hour,s.end_minute,0,0),{id:s.id,title:s.title,start:c,end:g,resource:s}}),[e]);return Oe("div",{className:"rbc-radix-scope",style:{height:"100%",containerType:"inline-size"},children:Oe(Us,{localizer:Gs,events:l,view:r==="week"?or.WEEK:or.MONTH,onView:s=>t(s===or.MONTH?"month":"week"),date:o,onNavigate:n,views:[or.WEEK,or.MONTH],toolbar:!0,popup:!0,scrollToTime:js,enableAutoScroll:!0,getNow:()=>i,tooltipAccessor:null,eventPropGetter:s=>{let g=q(a,s.resource.calendar_id)?.calendar.color_token??"var(--gray-8)";return r==="month"?{style:{background:"transparent",border:"none",boxShadow:"none"}}:{style:{backgroundColor:g,border:"none"}}},components:{toolbar:ht,week:{header:s=>Oe(ut,{...s,today:i}),event:({event:s})=>{let c=(s.end.getTime()-s.start.getTime())/6e4,g=c>=60,p=c>=30;return Cr("div",{children:[Oe(wr,{size:"1",weight:"medium",style:{color:"white",display:"block"},truncate:!0,children:s.title}),p&&Cr(wr,{size:"1",style:{color:"rgba(255,255,255,0.85)",display:"block"},truncate:!0,children:[Tr(s.start).format("h:mm A")," \u2013 ",Tr(s.end).format("h:mm A")]}),g&&s.resource.location&&Oe(wr,{size:"1",style:{color:"rgba(255,255,255,0.85)",display:"block"},truncate:!0,children:s.resource.location})]})}},month:{event:({event:s})=>{let g=q(a,s.resource.calendar_id)?.calendar.color_token??"var(--gray-8)";return Cr(wr,{size:"1",style:{display:"flex",alignItems:"center",gap:"var(--space-1)",color:"var(--gray-12)",background:`color-mix(in srgb, ${g} 28%, transparent)`,borderRadius:"var(--radius-2)",padding:"var(--space-1) var(--space-2)"},truncate:!0,children:[Oe("span",{"aria-hidden":!0,style:{width:"var(--space-2)",height:"var(--space-2)",borderRadius:"50%",background:g,flexShrink:0}}),Cr("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[Tr(s.start).format("H:mm")," ",s.title]})]})}}}})})}import{Dialog as ar,Flex as Se,Text as De,Button as oa,Separator as Ks,Badge as Ys}from"@radix-ui/themes";import{Fragment as Xs,jsx as R,jsxs as be}from"react/jsx-runtime";var aa={synced:{label:"Synced",color:"green"},syncing:{label:"Syncing\u2026",color:"amber"},error:{label:"Error",color:"red"}};function qs({sync:e,accounts:r,onOpenChange:t,onEdit:o}){let n=e?(()=>{let a=e.source_calendar_ids.map(l=>q(r,l)?.calendar.name).filter(l=>!!l),i=q(r,e.target_calendar_id)?.calendar.name??"\u2014";return`${a.join(", ")||"\u2014"} \u2192 ${i}`})():"";return R(ar.Root,{open:!!e,onOpenChange:t,children:R(ar.Content,{maxWidth:b.dialog_md,children:e&&be(Xs,{children:[be(Se,{align:"center",justify:"between",mb:"1",children:[R(ar.Title,{size:"4",mb:"0",children:e.name}),R(Ys,{color:aa[e.status].color,variant:"soft",size:"1",radius:"full",children:aa[e.status].label})]}),R(ar.Description,{size:"2",color:"gray",mb:"4",children:"Sync configuration"}),be(Se,{direction:"column",gap:"3",children:[R(ye,{label:"Calendars",children:n}),R(ye,{label:"Sources",children:R(Se,{direction:"column",gap:"1",align:"end",children:e.source_calendar_ids.map(a=>{let i=q(r,a);return i?be(Se,{direction:"column",align:"end",children:[R(De,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:i.calendar.name}),R(De,{size:"1",color:"gray",children:i.account.email})]},a):null})||"\u2014"})}),R(ye,{label:"Target",children:(()=>{let a=q(r,e.target_calendar_id);return a?be(Se,{direction:"column",align:"end",children:[R(De,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:a.calendar.name}),R(De,{size:"1",color:"gray",children:a.account.email})]}):"\u2014"})()}),R(ye,{label:"Last synced",children:e.last_synced_label??"\u2014"})]}),R(Ks,{size:"4",my:"4"}),R(De,{as:"p",size:"1",weight:"medium",color:"gray",mb:"3",style:{letterSpacing:"0.04em"},children:"WHAT TO SHOW"}),be(Se,{direction:"column",gap:"3",children:[R(ye,{label:"Tag",children:e.tag_label?.trim()||"Busy"}),R(ye,{label:"Event titles",children:e.show_title?"Shown":"Hidden"}),R(ye,{label:"Event description",children:e.show_description?"Shown":"Hidden"}),R(ye,{label:"Event location",children:e.show_location?"Shown":"Hidden"})]}),be(ee,{justify:"between",children:[R(ar.Close,{children:R(oa,{size:"2",variant:"soft",color:"gray",children:"Close"})}),R(oa,{size:"2",className:"btn-amber-primary",onClick:()=>o(e.id),children:"Edit sync"})]})]})})})}function ye({label:e,children:r}){return be(Se,{align:"baseline",justify:"between",gap:"4",children:[R(De,{size:"2",color:"gray",style:{flexShrink:0},children:e}),R(De,{size:"2",weight:"medium",align:"right",style:{color:"var(--gray-12)"},children:r})]})}import{useState as Rr}from"react";function nr({accounts:e,connectProvider:r,onAccountAdded:t,onImported:o}){let[n,a]=Rr(null),[i,l]=Rr(null),[s,c]=Rr(null),[g,p]=Rr(!1);function u(h){if(n)return;c(null),p(!1),a(h);let x=e.map(w=>w.id);r(h,x).then(w=>{a(null),w?l(w):(c(h),p(!0))}).catch(()=>{a(null),c(h),p(!1)})}function y(h){if(!i)return;let x=new Set(h);t({...i,calendars:i.calendars.filter(w=>x.has(w.id))}),l(null),o?.()}return{connecting_provider:n,pending_account:i,failed_provider:s,exhausted:g,connect:u,confirm_import:y,cancel_import:()=>l(null),dismiss_error:()=>c(null)}}import{Box as Zs,DropdownMenu as kr,Button as Js,Flex as Qs,Text as na}from"@radix-ui/themes";import{PlusIcon as ia}from"@radix-ui/react-icons";import{Fragment as rl,jsx as ie,jsxs as He}from"react/jsx-runtime";function el({variant:e="button",trigger:r,accounts:t,connectProvider:o,onAccountAdded:n,onImported:a}){let{pending_account:i,failed_provider:l,exhausted:s,connect:c,confirm_import:g,cancel_import:p,dismiss_error:u}=nr({accounts:t,connectProvider:o,onAccountAdded:n,onImported:a}),y=["google","microsoft"],h=e==="tile"?He("button",{type:"button",className:"connect-account-tile","aria-label":"Connect Account",children:[ie(ia,{style:v("--space-4")}),"Connect Account"]}):He(Js,{size:"2",className:"btn-amber-primary",children:[ie(ia,{style:v("--space-4")}),"Connect Account"]}),x=He(kr.Root,{children:[ie(kr.Trigger,{children:r??h}),ie(kr.Content,{align:"start",style:{width:"max-content",minWidth:"max-content"},children:y.map(w=>{let I=Me[w];return He(kr.Item,{onSelect:()=>c(w),style:{height:"auto",alignItems:"center",gap:"var(--space-3)",padding:"var(--space-2) var(--space-3)"},children:[ie(E,{size:"var(--space-6)",children:ie(H,{provider:w})}),He(Qs,{direction:"column",gap:"1",style:{flexShrink:0},children:[ie(na,{size:"2",weight:"medium",style:{color:"var(--gray-12)"},children:I.label}),ie(na,{size:"1",color:"gray",children:I.description})]})]},w)})})]});return He(rl,{children:[e==="tile"&&!r?ie(Zs,{style:{width:"100%",minWidth:0},children:x}):x,ie(ke,{account:i,onOpenChange:w=>!w&&p(),onImport:g}),l&&ie(Vr,{msg:s?`No more ${Me[l].label} accounts available to connect.`:`Couldn't connect ${Me[l].label}. Please try again.`,color:"red",onDone:u})]})}import{Card as tl,Flex as At,Text as ol,Heading as al}from"@radix-ui/themes";import{CalendarIcon as nl}from"@radix-ui/react-icons";import{jsx as xe,jsxs as sa}from"react/jsx-runtime";function il({accounts:e,connectProvider:r,onAccountAdded:t,onImported:o}){let{connecting_provider:n,pending_account:a,failed_provider:i,exhausted:l,connect:s,confirm_import:c,cancel_import:g}=nr({accounts:e,connectProvider:r,onAccountAdded:t,onImported:o});return sa(At,{direction:"column",align:"center",justify:"center",style:{width:"100%",flex:1,minHeight:0},children:[xe(tl,{style:{width:"100%",maxWidth:b.provider_chooser_max},children:sa(At,{direction:"column",align:"center",justify:"center",gap:"3",py:"6",px:"3",style:{width:"100%",textAlign:"center"},children:[xe(E,{children:xe(nl,{style:{...v("--space-5"),color:"var(--gray-7)"}})}),xe(al,{as:"h2",size:O.h2,weight:"medium",children:e.length>0?"Connect another account":"Connect your first account"}),xe(ol,{as:"p",size:"2",color:"gray",children:e.length>0?"Add another Google or Microsoft account, then choose which calendars to import.":"Connect a Google or Microsoft account to import calendars for sync."}),xe(At,{direction:"column",style:{width:"100%"},mt:"3",children:xe(yt,{connectingProvider:n,failedProvider:i,exhausted:l,onConnect:s})})]})}),xe(ke,{account:a,onOpenChange:p=>!p&&g(),onImport:c})]})}import{useEffect as sl,useMemo as It,useState as Sr}from"react";import{Link as ll}from"react-router-dom";import{Box as Pt,Checkbox as la,Flex as ir,Separator as Et,Text as Ae}from"@radix-ui/themes";import{ChevronDownIcon as cl,GearIcon as dl,HamburgerMenuIcon as pl}from"@radix-ui/react-icons";import{jsx as A,jsxs as he}from"react/jsx-runtime";function gl({accounts:e,view:r,setView:t,hideClones:o,setHideClones:n,mergedCalendarIds:a,visibleCalendarIds:i,toggleCalendarVisible:l,getVisibleBlocksInRange:s,manageAccountsHref:c,today:g=new Date}){let[p,u]=Sr(g),[y,h]=Sr(new Set),[x,w]=Sr(()=>typeof window<"u"&&window.innerWidth<900),[I,Z]=Sr(!1);sl(()=>{function f(){w(window.innerWidth<900)}return window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]);let se=It(()=>{let f=new Date(p);return f.setDate(f.getDate()-42),f},[p]),T=It(()=>{let f=new Date(p);return f.setDate(f.getDate()+42),f},[p]),B=s(se,T),J=It(()=>{let f=[],L=new Map;for(let V of a){let F=q(e,V);if(!F)continue;let Q=L.get(F.account.id);Q===void 0&&(Q=f.length,L.set(F.account.id,Q),f.push({accountId:F.account.id,calendarIds:[]})),f[Q].calendarIds.push(V)}return f},[a,e]);function U(f){h(L=>{let V=new Set(L);return V.has(f)?V.delete(f):V.add(f),V})}return he(ir,{gap:"5",align:"start",direction:x?"column":"row",flexGrow:"1",minHeight:"0",height:"100%",children:[(!x||I)&&he(Pt,{minWidth:x?void 0:b.sidebar_col_min,p:"4",maxHeight:"100%",style:{flex:x?"1 1 100%":`0 0 ${b.sidebar_col_basis}`,border:"1px solid var(--gray-5)",borderRadius:"var(--radius-4)",background:"var(--color-panel-solid)",boxShadow:"var(--shadow-card)",overflow:"auto"},children:[A(kt,{cursor:p,onSelect:u,today:g}),A(Et,{size:"4",my:"3"}),A(Ae,{as:"p",size:"1",weight:"medium",color:"gray",mb:"3",style:{letterSpacing:"0.04em"},children:"CALENDARS"}),A(ir,{direction:"column",gap:"1",mb:"4",children:J.map(({accountId:f,calendarIds:L},V)=>{let F=e.find(pe=>pe.id===f);if(!F)return null;let Q=y.has(f);return he("div",{style:{paddingTop:V>0?"var(--space-2)":void 0,borderTop:V>0?"1px solid var(--gray-3)":void 0},children:[he(ir,{align:"center",gap:"2",mb:"2",py:"1",className:"calendar-legend-account-row",style:{cursor:"pointer",borderRadius:"var(--radius-2)"},onClick:()=>U(f),children:[A(cl,{style:{...v("--space-3"),color:"var(--gray-9)",transform:Q?"rotate(-90deg)":void 0,transition:"transform 120ms ease",flexShrink:0}}),A(H,{provider:F.provider}),A(Ae,{size:"2",weight:"medium",truncate:!0,title:F.email,style:{color:"var(--gray-12)",minWidth:0},children:F.email})]}),!Q&&A(ir,{direction:"column",gap:"1",pl:"5",children:L.map(pe=>{let Pe=q(e,pe);return Pe?he(Ae,{as:"label",size:"2",className:"calendar-legend-row",style:{display:"flex",alignItems:"center",gap:"var(--space-2)",cursor:"pointer",borderRadius:"var(--radius-2)",padding:"var(--space-1) var(--space-2)",marginLeft:"calc(var(--space-2) * -1)"},children:[he(ir,{align:"center",gap:"1",children:[A(la,{checked:i.has(pe),onCheckedChange:()=>l(pe)}),A("span",{"aria-hidden":!0,style:{width:"var(--space-3)",height:"var(--space-3)",borderRadius:"50%",background:Pe.calendar.color_token,flexShrink:0}})]}),A(Ae,{size:"2",truncate:!0,style:{color:"var(--gray-12)"},title:Pe.calendar.name,children:Pe.calendar.name})]},pe):null})})]},f)})}),A(Et,{size:"4",mb:"3"}),he(Ae,{as:"label",size:"2",style:{display:"flex",alignItems:"center",gap:"var(--space-2)",cursor:"pointer"},mb:"3",children:[A(la,{checked:o,onCheckedChange:f=>n(!!f)}),"Hide synced events"]}),A(Et,{size:"4",mb:"3"}),he(ll,{to:c,style:{display:"flex",alignItems:"center",gap:"var(--space-2)",color:"var(--gray-11)",textDecoration:"none"},children:[A(dl,{style:v("--space-3")}),A(Ae,{size:"2",children:"Manage accounts"})]}),A(Ae,{as:"p",size:"1",color:"gray",mt:"4",children:"On your target calendars, others see only what each sync is set to share. Full detail stays in araMetrics."})]}),he(Pt,{width:x?"100%":void 0,minHeight:b.big_calendar_h,height:"100%",style:{flex:x?"1 1 100%":`1 1 ${b.sync_col_wide}`,minWidth:x?0:b.sync_col_min,display:"flex",flexDirection:"column",alignSelf:"stretch"},children:[x&&A("button",{type:"button",className:"sidebar-icon-btn","aria-label":I?"Hide calendars":"Show calendars",style:{alignSelf:"flex-start",marginBottom:"var(--space-3)"},onClick:()=>Z(f=>!f),children:A(pl,{style:v("--space-4")})}),A(Pt,{flexGrow:"1",minHeight:"0",height:"100%",children:A(Dt,{blocks:B,view:r,onViewChange:t,date:p,onNavigate:u,accounts:e,today:g})})]})]})}import{clsx as ul}from"clsx";import{twMerge as ml}from"tailwind-merge";function Ie(...e){return ml(ul(e))}function fl(e,r="solid"){return k.variants[e]?.[r]||k.variants.primary[r]}function hl(e){let r=k.sizes[e]||k.sizes.md;return`${r.text} ${r.padding} ${r.height}`}function vl(){return Ie(k.base.transition,k.base.focus,k.base.disabled,k.accessibility.reduced_motion)}function yl(){return Ie(k.base.interactive,k.accessibility.focus_trap,k.accessibility.touch_target)}function bl(e={}){return Ie(e.focus_visible&&k.accessibility.focus_trap,e.high_contrast&&k.accessibility.high_contrast,e.reduced_motion&&k.accessibility.reduced_motion)}function xl(e,r=""){return typeof e=="string"?`${r}${e}`:typeof e=="object"&&e!==null?Object.entries(e).map(([t,o])=>o===void 0?"":`${t==="xs"?"":`${t}:`}${r}${o}`).filter(Boolean).join(" "):""}function _l(e,r="gap"){let t=k.spacing[e]||k.spacing.md;switch(r){case"margin":return t.replace("gap-","m-");case"padding":return t.replace("gap-","p-");default:return t}}function wl(e){return k.radius[e]||k.radius.md}function Cl(e){return k.typography[e]||k.typography.base}function Tl(e,r=500){return`bg-${e}-${r}`}function Rl(e,r=500){return`text-${e}-${r}`}function kl(e,r=500){return`border-${e}-${r}`}function Sl(e,r=500){return`hover:bg-${e}-${r}`}function Dl(e,r=500){return`hover:text-${e}-${r}`}function Al(e,r=500){return`focus:ring-${e}-${r}`}function Il(e){let r=k.animations[e];return typeof r=="string"?r:""}function Pl(e,r,t){return o=>{let n=e;return Object.entries(r).forEach(([a,i])=>{let l=o[a];l&&i[l]&&(n+=` ${i[l]}`)}),t?.forEach(({conditions:a,class_name:i})=>{Object.entries(a).every(([s,c])=>o[s]===c)&&(n+=` ${i}`)}),Ie(n)}}function El(e){return function(t){let{class_name:o,...n}=t,a={...e.default_variants,...n},i=e.base||"";return e.variants&&Object.entries(e.variants).forEach(([l,s])=>{let c=a[l];c&&s[c]&&(i+=` ${s[c]}`)}),e.compound_variants?.forEach(({conditions:l,class_name:s})=>{Object.entries(l).every(([g,p])=>a[g]===p)&&(i+=` ${s}`)}),Ie(i,o)}}function Nl(e,r){let t={...e};return Object.keys(r).forEach(o=>{let n=r[o],a=e[o];o==="className"?t[o]=Ie(a,n):typeof n=="object"&&typeof a=="object"&&n!==null&&a!==null&&!Array.isArray(n)&&!Array.isArray(a)?t[o]={...a,...n}:t[o]=n}),t}function Bl(e,r,t){return e?r:t&&e===!1?t:""}function zl(e){let r=["button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","a[href]",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]'].join(", ");return Array.from(e.querySelectorAll(r))}function Ll(e,r,t,o={}){let{loop:n=!0,orientation:a="both"}=o,i=t;switch(e.key){case"ArrowDown":(a==="vertical"||a==="both")&&(i=t+1,i>=r.length&&(i=n?0:r.length-1));break;case"ArrowUp":(a==="vertical"||a==="both")&&(i=t-1,i<0&&(i=n?r.length-1:0));break;case"ArrowRight":(a==="horizontal"||a==="both")&&(i=t+1,i>=r.length&&(i=n?0:r.length-1));break;case"ArrowLeft":(a==="horizontal"||a==="both")&&(i=t-1,i<0&&(i=n?r.length-1:0));break;case"Home":i=0;break;case"End":i=r.length-1;break}return i!==t&&(e.preventDefault(),r[i]?.focus()),i}import{Theme as Ml}from"@radix-ui/themes";import"@radix-ui/themes/styles.css";import{jsx as Ol}from"react/jsx-runtime";function Fl({children:e,appearance:r="light",radius:t="none",scaling:o="100%",accentColor:n="amber",grayColor:a="gray",panelBackground:i="solid",className:l=""}){return Ol(Ml,{accentColor:n,grayColor:a,radius:t,scaling:o,panelBackground:i,appearance:r,className:l,children:e})}var ca="arm.shell.v1",da=/^[a-z][a-z0-9-]{0,31}(\.[a-z][a-z0-9-]{0,31})+$/;function Dr(e,r=[]){if(e===null||typeof e=="string"||typeof e=="boolean")return!0;if(typeof e=="number")return Number.isFinite(e);if(typeof e!="object"||r.includes(e))return!1;let t=[...r,e];if(Array.isArray(e))return e.every(n=>Dr(n,t));let o=Object.getPrototypeOf(e);return o!==Object.prototype&&o!==null?!1:Object.values(e).every(n=>Dr(n,t))}function Hl(e){if(typeof e!="object"||e===null)return!1;let{v:r,id:t,type:o,payload:n}=e;return r===1&&typeof t=="string"&&t!==""&&typeof o=="string"&&da.test(o)&&Dr(n)}function $l(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function Wl(){let e=new Map,r=new Set,t;function o(a){if(!r.has(a.id)){r.add(a.id),r.size>256&&r.delete(r.values().next().value);for(let i of[...e.get(a.type)??[]])i(a.payload)}}function n(){return t===void 0&&(t=typeof BroadcastChannel>"u"?null:new BroadcastChannel(ca),t?.addEventListener("message",a=>{Hl(a.data)&&o(a.data)})),t}return{emit(a,i){if(!da.test(a))throw new TypeError(`shell.events: "${a}" is not an "<app>.<event>" type`);if(!Dr(i))throw new TypeError(`shell.events: the payload of "${a}" is not plain JSON`);let l={v:1,id:$l(),type:a,payload:i};n()?.postMessage(l),o(l)},on(a,i){n();let l=e.get(a)??new Set;e.set(a,l);let s=i;return l.add(s),()=>{l.delete(s)}}}}var Ul={events:Wl()};import*as Ar from"react";function Ff({value:e,default_value:r,on_change:t}){let[o,n]=Ar.useState(r),a=e!==void 0,i=a?e:o,l=Ar.useCallback(s=>{let c=typeof s=="function"?s(i):s;a||n(c),t?.(c)},[a,i,t]);return[i,l]}import*as $e from"react";function Hf(e=!1){let[r,t]=$e.useState(e),o=$e.useCallback(()=>t(!0),[]),n=$e.useCallback(()=>t(!1),[]),a=$e.useCallback(()=>t(i=>!i),[]);return{is_open:r,open:o,close:n,toggle:a,on_open:o,on_close:n,on_toggle:a}}import*as Ir from"react";function Wf(e,r=!0){let t=Ir.useRef(null);return Ir.useEffect(()=>{if(!r)return;let o=n=>{t.current&&!t.current.contains(n.target)&&e()};return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[e,r]),t}export*from"@radix-ui/react-icons";export{Vn as ACTIVITY_META,fo as AUDIT_ACTION_META,Pa as AccentCard,Xt as AccentHeader,Wc as AccessibleIcon,Wt as Accordion,Gt as AccordionContent,Ut as AccordionItem,Vt as AccordionTrigger,$s as AccountCalendarsDialog,Wa as AccountCard,wn as ActivityRow,el as AddAccountMenu,Rc as AlertDialog,_n as AppCard,Jl as AspectRatio,jn as AuthCard,Ec as Avatar,Nc as Badge,Dt as BigCalendarView,oc as Blockquote,jl as Box,Zr as BrandPanel,dc as Button,ut as CalendarDayHeader,gl as CalendarMergedView,Qi as CalendarPickList,ht as CalendarToolbar,Bc as Callout,zc as Card,ee as CardFooter,mc as Checkbox,hc as CheckboxCards,fc as CheckboxGroup,ac as Code,Or as ConfirmDialog,yt as ConnectProviderList,il as ConnectProviderRows,us as ConnectedAccountCard,ql as Container,Sc as ContextMenu,Dn as DashboardErrorCard,Lc as DataList,jr as DataTableRow,Tc as Dialog,Ca as Drawer,Ra as DrawerClose,jt as DrawerContent,Sa as DrawerDefaultClose,Yt as DrawerDescription,ka as DrawerHeader,Kt as DrawerTitle,Ta as DrawerTrigger,kc as DropdownMenu,nc as Em,vs as EmptyCard,cn as EventBlock,Kl as Flex,Jr as GoogleIcon,Yl as Grid,tc as Heading,Ac as HoverCard,pc as IconButton,E as IconTile,ke as ImportCalendarsDialog,Zl as Inset,ic as Kbd,Un as METRIC_STATUS_COLOR,mn as MetricCard,Qr as MicrosoftIcon,kt as MiniMonthPicker,Ja as MonthGrid,Ps as OnboardingStepDots,Yo as OnboardingStepper,et as OtpInput,ei as OtpVerifyStep,ri as PROVIDER_LABEL,Me as PROVIDER_META,On as Pagination,Hr as PausedBadge,Dc as Popover,Pc as Portal,Mc as Progress,H as ProviderIcon,lc as Quote,$n as ROLE_LABELS,pr as ROLE_META,vc as Radio,bc as RadioCards,yc as RadioGroup,ca as SHELL_CHANNEL,hr as SHELL_HEADER_H,Wn as STATUS_META,Ql as ScrollArea,Gi as SearchOverlay,Xl as Section,Cc as SegmentedControl,xc as Select,ec as Separator,yi as Sidebar,ya as Skeleton,_c as Slider,Uc as Slot,Vc as Slottable,Fc as Spinner,cc as Strong,wc as Switch,qs as SyncDetailsDialog,Ds as SyncPreviewRail,$c as TabNav,Oc as Table,Hc as Tabs,rc as Text,uc as TextArea,gc as TextField,sc as TextLink,Vr as Toast,Ic as Tooltip,Ni as Topbar,Fl as UIProvider,Gc as VisuallyHidden,Ct as WizardStepper,Gn as audit_action_meta,Ie as cn,va as colors,Bl as conditional_class,Pl as create_compound_variants,El as create_variant_generator,q as find_calendar,bl as get_accessibility_styles,Il as get_animation_class,vl as get_base_styles,Tl as get_bg_class,kl as get_border_class,$t as get_color,Al as get_focus_ring_class,zl as get_focusable_elements,Sl as get_hover_bg_class,Dl as get_hover_text_class,yl as get_interactive_styles,wl as get_radius_class,xl as get_responsive_classes,hl as get_size_styles,_l as get_spacing_class,Rl as get_text_class,Cl as get_typography_class,fl as get_variant_styles,Ll as handle_arrow_navigation,O as heading_size,b as layout,Nl as merge_props,Ul as shell,k as theme,Wf as useClickOutside,nr as useConnectAccount,Ff as useControllableState,Hf as useDisclosure};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|