@pg-boss/dashboard 1.1.0 → 1.1.2
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 +25 -173
- package/build/client/assets/MenuTrigger-CoRd-BqL.js +1 -0
- package/build/client/assets/{_index-Bcg_-XSd.js → _index-BTx7NRR8.js} +1 -1
- package/build/client/assets/{badge-Cd8v3tl3.js → badge-DBD4CzAv.js} +1 -1
- package/build/client/assets/{button-BaXUPm8v.js → button-Ba8FWhqs.js} +1 -1
- package/build/client/assets/{chevron-down-xu6Uceu-.js → chevron-down-CYa4FYmp.js} +1 -1
- package/build/client/assets/chunk-UVKPFVEO-YfSfkVr_.js +26 -0
- package/build/client/assets/{createLucideIcon-BXGwbdrh.js → createLucideIcon-Bt-yXILq.js} +1 -1
- package/build/client/assets/db-link-CU7IJqbq.js +1 -0
- package/build/client/assets/dialog-Dkx42Rkd.js +1 -0
- package/build/client/assets/{entry.client-COnaNoy-.js → entry.client-DXZUROTm.js} +4 -4
- package/build/client/assets/{error-card-DmoxS3Ao.js → error-card-D-uZRy_l.js} +1 -1
- package/build/client/assets/{filter-select-mMC79WOR.js → filter-select-Tk_CBvrn.js} +1 -1
- package/build/client/assets/{index-DhMkYPMa.js → index-DuhoQwUK.js} +1 -1
- package/build/client/assets/{jobs-DtmTCs8I.js → jobs-ouYjIGAi.js} +1 -1
- package/build/client/assets/manifest-72f6b3e9.js +1 -0
- package/build/client/assets/{pagination-NfhvsUbp.js → pagination-BItl293Q.js} +1 -1
- package/build/client/assets/{queues._index-Cw1B49mg.js → queues._index-_ID9kaow.js} +1 -1
- package/build/client/assets/{queues._name-D0cG_qDX.js → queues._name-DwdbQND-.js} +1 -1
- package/build/client/assets/{queues._name.jobs._jobId-uJ3dfM3J.js → queues._name.jobs._jobId-DrgG3VBb.js} +1 -1
- package/build/client/assets/{queues.create-BGXDhJ3m.js → queues.create-CmVW5UVm.js} +1 -1
- package/build/client/assets/root-Bpb4WtY4.css +1 -0
- package/build/client/assets/{root-NWrBrGvr.js → root-DDqOT0vL.js} +1 -1
- package/build/client/assets/{schedules-DzgBEayh.js → schedules-B6ixYsvz.js} +1 -1
- package/build/client/assets/{schedules._name._key-i42S9kw2.js → schedules._name._key-CXTVKoOc.js} +1 -1
- package/build/client/assets/{schedules.new-Dt78KptL.js → schedules.new-Dmasri9v.js} +1 -1
- package/build/client/assets/{send-0eWgiWNl.js → send-CqR34Z50.js} +1 -1
- package/build/client/assets/{table-CTo0I5HG.js → table-Au2E5mnP.js} +1 -1
- package/build/client/assets/useOpenInteractionType-mgYMZAa8.js +12 -0
- package/build/client/assets/{warnings-BhQM6lFV.js → warnings-Dj3qacgN.js} +1 -1
- package/build/server/assets/server-build.js +417 -79
- package/package.json +18 -18
- package/build/client/assets/MenuTrigger-SThQHnlb.js +0 -1
- package/build/client/assets/chunk-JZWAC4HX-DC8i-F7r.js +0 -26
- package/build/client/assets/db-link-CtPnIrIr.js +0 -1
- package/build/client/assets/dialog-Bl8T588f.js +0 -1
- package/build/client/assets/manifest-25954681.js +0 -1
- package/build/client/assets/root-DJRlbyb5.css +0 -1
- package/build/client/assets/useOpenInteractionType-C_L8nZ_l.js +0 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a,p as e,q as ne,t as ae,v as oe,w as ie,x as de,y as le,z as ce,A as ue,B as me,M as he,L as fe,S as ge,C as xe,O as be,i as pe}from"./chunk-JZWAC4HX-DC8i-F7r.js";import{c as d,u as L,m as E,a as ve,D as ye}from"./db-link-CtPnIrIr.js";import{c as M}from"./createLucideIcon-BXGwbdrh.js";import{M as z,a as H,b as P,c as D,d as q,e as S}from"./MenuTrigger-SThQHnlb.js";import"./useOpenInteractionType-C_L8nZ_l.js";import"./index-DhMkYPMa.js";const we=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],je=M("monitor",we);const ke=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],R=M("moon",ke);const Ne=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Se=M("panel-left",Ne);const Me=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],T=M("sun",Me),A=["emerald","teal","cyan","sky","blue","indigo","violet","purple"],Ce={emerald:"#059669",teal:"#0d9488",cyan:"#0891b2",sky:"#0284c7",blue:"#2563eb",indigo:"#4f46e5",violet:"#7c3aed",purple:"#9333ea"},V=a.createContext(void 0),$="pg-boss-theme",G="pg-boss-color-theme";function C(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function I(){if(typeof window>"u")return"system";const t=localStorage.getItem($);return t==="light"||t==="dark"||t==="system"?t:"system"}function Le(){if(typeof window>"u")return"violet";const t=localStorage.getItem(G);return t&&A.includes(t)?t:"violet"}function Ee({children:t}){const[s,r]=a.useState(I),[n,i]=a.useState(()=>{const o=I();return o==="system"?C():o}),[l,m]=a.useState(Le);a.useEffect(()=>{const o=s==="system"?C():s;i(o);const u=document.documentElement;u.classList.remove("light","dark"),u.classList.add(o)},[s]),a.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),u=()=>{if(s==="system"){const b=C();i(b),document.documentElement.classList.remove("light","dark"),document.documentElement.classList.add(b)}};return o.addEventListener("change",u),()=>o.removeEventListener("change",u)},[s]),a.useEffect(()=>{document.documentElement.dataset.colorTheme=l;const u=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect width="32" height="32" rx="6" fill="${Ce[l]}"/><text x="16" y="22" text-anchor="middle" font-family="system-ui,sans-serif" font-size="14" font-weight="bold" fill="white">PG</text></svg>`,b=encodeURIComponent(u);let f=document.querySelector('link[rel="icon"]');f?f.href=`data:image/svg+xml,${b}`:(f=document.createElement("link"),f.rel="icon",f.type="image/svg+xml",f.href=`data:image/svg+xml,${b}`,document.head.appendChild(f))},[l]);const x=o=>{r(o),localStorage.setItem($,o)},h=o=>{m(o),localStorage.setItem(G,o)};return e.jsx(V.Provider,{value:{theme:s,setTheme:x,resolvedTheme:n,colorTheme:l,setColorTheme:h},children:t})}function W(){const t=a.useContext(V);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t}const Re={light:"Light",dark:"Dark",system:"System"};function Te(){const{theme:t,setTheme:s,resolvedTheme:r}=W();return e.jsxs(z,{children:[e.jsxs(H,{className:d("flex items-center gap-2 rounded-md p-2 w-full cursor-pointer","text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent","focus:outline-none","transition-colors"),"aria-label":"Toggle theme",children:[r==="dark"?e.jsx(R,{className:"h-5 w-5 shrink-0"}):e.jsx(T,{className:"h-5 w-5 shrink-0"}),e.jsx("span",{className:"text-sm group-data-[state=collapsed]:hidden",children:Re[t]})]}),e.jsx(P,{container:typeof document<"u"?document.body:void 0,children:e.jsx(D,{className:"z-[100]",children:e.jsxs(q,{className:d("min-w-[8rem] rounded-md border p-1 shadow-md z-[100]","bg-white border-gray-200","dark:bg-gray-900 dark:border-gray-800","animate-in fade-in-0 zoom-in-95"),children:[e.jsxs(S,{className:d("flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer","outline-none transition-colors","text-gray-700 data-highlighted:bg-gray-100","dark:text-gray-300 dark:data-highlighted:bg-gray-800",t==="light"&&"bg-gray-100 dark:bg-gray-800"),onClick:()=>s("light"),children:[e.jsx(T,{className:"h-4 w-4"}),"Light"]}),e.jsxs(S,{className:d("flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer","outline-none transition-colors","text-gray-700 data-highlighted:bg-gray-100","dark:text-gray-300 dark:data-highlighted:bg-gray-800",t==="dark"&&"bg-gray-100 dark:bg-gray-800"),onClick:()=>s("dark"),children:[e.jsx(R,{className:"h-4 w-4"}),"Dark"]}),e.jsxs(S,{className:d("flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer","outline-none transition-colors","text-gray-700 data-highlighted:bg-gray-100","dark:text-gray-300 dark:data-highlighted:bg-gray-800",t==="system"&&"bg-gray-100 dark:bg-gray-800"),onClick:()=>s("system"),children:[e.jsx(je,{className:"h-4 w-4"}),"System"]})]})})})]})}const _={emerald:"bg-emerald-500",teal:"bg-teal-500",cyan:"bg-cyan-500",sky:"bg-sky-500",blue:"bg-blue-500",indigo:"bg-indigo-500",violet:"bg-violet-500",purple:"bg-purple-500"},B={emerald:"Emerald",teal:"Teal",cyan:"Cyan",sky:"Sky",blue:"Blue",indigo:"Indigo",violet:"Violet",purple:"Purple"};function Ie(){const{colorTheme:t,setColorTheme:s}=W();return e.jsxs(z,{children:[e.jsxs(H,{className:d("flex items-center gap-2 rounded-md p-2 w-full cursor-pointer","text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent","focus:outline-none","transition-colors"),"aria-label":"Change color theme",children:[e.jsx("span",{className:d("h-5 w-5 rounded-full shrink-0",_[t])}),e.jsx("span",{className:"text-sm group-data-[state=collapsed]:hidden",children:B[t]})]}),e.jsx(P,{container:typeof document<"u"?document.body:void 0,children:e.jsx(D,{className:"z-[100]",children:e.jsx(q,{className:d("rounded-md border p-2 shadow-md z-[100]","bg-white border-gray-200","dark:bg-gray-900 dark:border-gray-800","animate-in fade-in-0 zoom-in-95"),children:e.jsx("div",{className:"grid grid-cols-4 gap-1.5",children:A.map(r=>e.jsx(S,{className:d("w-7 h-7 rounded-full cursor-pointer transition-all","outline-none","hover:scale-110",_[r],t===r&&"ring-2 ring-offset-2 ring-gray-900 dark:ring-white dark:ring-offset-gray-900"),onClick:()=>s(r),"aria-label":r,title:B[r]},r))})})})})]})}function _e({content:t,children:s,side:r="right",align:n="center"}){const[i,l]=a.useState(!1),[m,x]=a.useState({top:0,left:0}),h=a.useRef(null),o=a.useRef(null),u=a.useCallback(()=>{if(!h.current||!o.current)return;const c=h.current.getBoundingClientRect(),g=o.current.getBoundingClientRect();let y=0,j=0;switch(r){case"top":y=c.top-g.height-8,j=c.left+(c.width-g.width)/2;break;case"right":y=c.top+(c.height-g.height)/2,j=c.right+8;break;case"bottom":y=c.bottom+8,j=c.left+(c.width-g.width)/2;break;case"left":y=c.top+(c.height-g.height)/2,j=c.left-g.width-8;break}r==="top"||r==="bottom"?n==="start"?j=c.left:n==="end"&&(j=c.right-g.width):n==="start"?y=c.top:n==="end"&&(y=c.bottom-g.height),x({top:y,left:j})},[r,n]);a.useEffect(()=>{if(i)return u(),window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),()=>{window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u)}},[i,u]);const b=()=>{l(!0)},f=()=>{l(!1)},w=a.Children.only(s),k=a.cloneElement(w,{ref:c=>{c&&(h.current=c);const g=w.ref;typeof g=="function"?g(c):g&&(g.current=c)},onMouseEnter:c=>{b(),w.props?.onMouseEnter?.(c)},onMouseLeave:c=>{f(),w.props?.onMouseLeave?.(c)}});return e.jsxs(e.Fragment,{children:[k,i&&e.jsx("div",{ref:o,role:"tooltip",style:{position:"fixed",top:m.top,left:m.left,zIndex:9999},className:d("px-3 py-1.5 text-sm font-medium text-white bg-gray-900 dark:bg-gray-700 rounded-md shadow-lg","pointer-events-none animate-in fade-in-0 zoom-in-95","whitespace-nowrap"),children:t})]})}const Be="sidebar:state",Oe=3600*24*7,ze="16rem",He="3rem",Pe="b",K=a.createContext(null);function N(){const t=a.useContext(K);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}const Z=a.forwardRef(({defaultOpen:t=!0,open:s,onOpenChange:r,className:n,style:i,children:l,...m},x)=>{const[h,o]=a.useState(!1),[u,b]=a.useState(t),f=s??u,w=a.useCallback(p=>{const v=typeof p=="function"?p(f):p;r?r(v):b(v),document.cookie=`${Be}=${v}; path=/; max-age=${Oe}`},[r,f]),k=a.useCallback(()=>w(p=>!p),[w]),[c,g]=a.useState(!1);a.useEffect(()=>{const p=window.matchMedia("(max-width: 768px)"),v=()=>g(p.matches);return v(),p.addEventListener("change",v),()=>p.removeEventListener("change",v)},[]),a.useEffect(()=>{const p=v=>{v.key===Pe&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),k())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[k]);const y=f?"expanded":"collapsed",j=a.useMemo(()=>({state:y,open:f,setOpen:w,isMobile:c,openMobile:h,setOpenMobile:o,toggleSidebar:k}),[y,f,w,c,h,o,k]);return e.jsx(K.Provider,{value:j,children:e.jsx("div",{style:{"--sidebar-width":ze,"--sidebar-width-icon":He,...i},className:d("group/sidebar-wrapper flex min-h-screen w-full has-[[data-variant=inset]]:bg-sidebar",n),ref:x,...m,children:l})})});Z.displayName="SidebarProvider";const U=a.forwardRef(({side:t="left",variant:s="sidebar",collapsible:r="offcanvas",className:n,children:i,...l},m)=>{const{isMobile:x,state:h,openMobile:o,setOpenMobile:u}=N();return r==="none"?e.jsx("div",{className:d("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",n),ref:m,...l,children:i}):x?e.jsxs(e.Fragment,{children:[o&&e.jsx("div",{className:"fixed inset-0 z-50 bg-black/50",onClick:()=>u(!1)}),e.jsx("div",{ref:m,className:d("fixed inset-y-0 z-50 flex h-full w-[--sidebar-width-mobile] flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground transition-transform duration-200 ease-in-out",t==="left"?"left-0":"right-0",o?"translate-x-0":t==="left"?"-translate-x-full":"translate-x-full",n),...l,children:i})]}):e.jsx("div",{ref:m,"data-state":h,className:d("group peer hidden md:flex fixed inset-y-0 left-0 z-30 flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground overflow-y-auto overflow-x-hidden","transition-[width] duration-200 ease-linear",h==="expanded"?"w-[--sidebar-width]":"w-[--sidebar-width-icon]",n),...l,children:i})});U.displayName="Sidebar";const F=a.forwardRef(({className:t,onClick:s,...r},n)=>{const{toggleSidebar:i,isMobile:l,openMobile:m,setOpenMobile:x}=N();return e.jsxs("button",{ref:n,onClick:h=>{s?.(h),l?x(!m):i()},className:d("inline-flex items-center justify-center rounded-md p-2 cursor-pointer","text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...r,children:[e.jsx(Se,{className:"h-5 w-5"}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});F.displayName="SidebarTrigger";const Q=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("flex flex-col gap-2 p-2 overflow-hidden",t),...s}));Q.displayName="SidebarHeader";const J=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("flex flex-col gap-2 p-2 overflow-hidden",t),...s}));J.displayName="SidebarFooter";const Y=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("flex min-h-0 flex-1 flex-col gap-2 overflow-auto",t),...s}));Y.displayName="SidebarContent";const X=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("relative flex w-full min-w-0 flex-col p-2",t),...s}));X.displayName="SidebarGroup";const De=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("px-2 text-xs font-medium text-sidebar-foreground/70",t),...s}));De.displayName="SidebarGroupLabel";const ee=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("w-full text-sm",t),...s}));ee.displayName="SidebarGroupContent";const te=a.forwardRef(({className:t,...s},r)=>e.jsx("ul",{ref:r,className:d("flex w-full min-w-0 flex-col gap-1",t),...s}));te.displayName="SidebarMenu";const se=a.forwardRef(({className:t,...s},r)=>e.jsx("li",{ref:r,className:d("group/menu-item relative",t),...s}));se.displayName="SidebarMenuItem";const qe=ve("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 cursor-pointer group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 group-data-[state=collapsed]:justify-center",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[state=collapsed]:!h-8"}},defaultVariants:{variant:"default",size:"default"}}),re=a.forwardRef(({render:t,isActive:s=!1,variant:r="default",size:n="default",tooltip:i,className:l,...m},x)=>{const{state:h}=N(),o=L({defaultTagName:"button",render:t,props:E({"data-sidebar":"menu-button","data-active":s,className:d(qe({variant:r,size:n}),s&&"bg-sidebar-accent font-medium text-sidebar-accent-foreground",l)},m),ref:x});return h==="collapsed"&&i&&typeof i=="string"?e.jsx(_e,{content:i,children:o}):o});re.displayName="SidebarMenuButton";const Ae=a.forwardRef(({className:t,render:s,showOnHover:r=!1,...n},i)=>L({defaultTagName:"button",render:s,props:E({"data-sidebar":"menu-action",className:d("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-hover/menu-button:text-sidebar-accent-foreground",r&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",t)},n),ref:i}));Ae.displayName="SidebarMenuAction";const Ve=a.forwardRef(({className:t,...s},r)=>e.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:d("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5",t),...s}));Ve.displayName="SidebarMenuSub";const $e=a.forwardRef(({...t},s)=>e.jsx("li",{ref:s,...t}));$e.displayName="SidebarMenuSubItem";const Ge=a.forwardRef(({render:t,size:s="md",isActive:r,className:n,...i},l)=>L({defaultTagName:"a",render:t,props:E({"data-sidebar":"menu-sub-button","data-size":s,"data-active":r,className:d("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",s==="sm"&&"text-xs",s==="md"&&"text-sm",n)},i),ref:l}));Ge.displayName="SidebarMenuSubButton";const We=[{name:"Overview",href:"/",icon:Ke},{name:"Jobs",href:"/jobs",icon:Ze},{name:"Queues",href:"/queues",icon:Ue},{name:"Schedules",href:"/schedules",icon:Fe},{name:"Warnings",href:"/warnings",icon:Qe}];function Ke({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"})})}function Ze({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z"})})}function Ue({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 0 1 0 3.75H5.625a1.875 1.875 0 0 1 0-3.75Z"})})}function Fe({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})}function Qe({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})})}function O({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})})}function Je({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})}function Ye({databases:t,currentDb:s,onSelect:r}){const[n,i]=a.useState(!1);return t.length<=1?null:e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>i(!n),className:d("w-full flex items-center justify-between px-3 py-2 text-sm rounded-lg transition-colors cursor-pointer","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(O,{className:"w-4 h-4 flex-shrink-0"}),e.jsx("span",{className:"font-medium truncate",children:s.name})]}),e.jsx(Je,{className:d("w-4 h-4 flex-shrink-0 transition-transform",n&&"rotate-180")})]}),n&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),e.jsx("div",{className:d("absolute left-0 right-0 mt-1 rounded-lg shadow-lg z-20 py-1","bg-sidebar-accent border border-sidebar-border"),children:t.map(l=>e.jsxs("button",{type:"button",onClick:()=>{r(l),i(!1)},className:d("w-full flex items-center gap-2 px-3 py-2 text-sm text-left transition-colors cursor-pointer",l.id===s.id?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[e.jsx(O,{className:d("w-4 h-4 flex-shrink-0")}),e.jsx("span",{className:"truncate",children:l.name}),l.schema!=="pgboss"&&e.jsxs("span",{className:"ml-auto text-xs opacity-70",children:["(",l.schema,")"]})]},l.id))})]})]})}function Xe(){const t=ne("root"),[s]=ae(),r=oe(),{setOpenMobile:n}=N(),i=t?.databases||[],l=t?.currentDb,m=s.get("db"),x=o=>{const u=new URLSearchParams(s);o.id===i[0]?.id?u.delete("db"):u.set("db",o.id);const b=u.toString();r({pathname:window.location.pathname,search:b?`?${b}`:""})},h=o=>m?`${o}?db=${m}`:o;return e.jsxs(U,{children:[e.jsxs(Q,{children:[e.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary-600 flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-white font-bold text-sm",children:"PG"})}),e.jsx("span",{className:"font-semibold text-sidebar-foreground group-data-[state=collapsed]:hidden",children:"pg-boss"})]}),i&&l&&i.length>1&&e.jsx("div",{className:"group-data-[state=collapsed]:hidden",children:e.jsx(Ye,{databases:i,currentDb:l,onSelect:x})})]}),e.jsx(Y,{children:e.jsx(X,{children:e.jsx(ee,{children:e.jsx(te,{children:We.map(o=>e.jsx(se,{children:e.jsx(ie,{to:h(o.href),end:o.href==="/",onClick:()=>n(!1),children:({isActive:u})=>e.jsxs(re,{isActive:u,tooltip:o.name,children:[e.jsx(o.icon,{className:"h-5 w-5 flex-shrink-0"}),e.jsx("span",{className:"group-data-[state=collapsed]:hidden",children:o.name})]})})},o.name))})})})}),e.jsx(J,{children:e.jsxs("div",{className:"flex flex-col px-2",children:[e.jsx("p",{className:"px-2 mb-1 text-xs font-medium text-sidebar-foreground/50 uppercase tracking-wider group-data-[state=collapsed]:hidden",children:"Theme"}),e.jsx(Te,{}),e.jsx(Ie,{})]})})]})}function et(){return de().state==="loading"?e.jsx("div",{className:"fixed top-0 left-0 right-0 z-50 h-1 bg-gray-200 dark:bg-gray-800",children:e.jsx("div",{className:"h-full bg-primary-600 dark:bg-primary-400 animate-loading-bar"})}):null}function tt(){le();const s=ce().pathname.split("/").filter(Boolean);if(s.length===0)return null;const r=[];if(s[0]==="queues"){if(r.push({label:"Queues",href:"/queues"}),s.length>1&&s[1]!=="queues"){const n=decodeURIComponent(s[1]);if(r.push({label:n,href:`/queues/${encodeURIComponent(n)}`}),s.length>2&&s[2]==="jobs"&&s[3]){const i=s[3];r.push({label:`${i.slice(0,8)}...`})}}}else if(s[0]==="schedules"){if(r.push({label:"Schedules",href:"/schedules"}),s.length>1&&s[1]==="new")r.push({label:"New Schedule"});else if(s.length>1){const n=decodeURIComponent(s[1]);r.push({label:n})}}else s[0]==="jobs"?r.push({label:"Jobs"}):s[0]==="warnings"?r.push({label:"Warnings"}):s[0]==="send"&&(r.push({label:"Queues",href:"/queues"}),r.push({label:"Send Job"}));return r.length===0?null:e.jsx("div",{className:"flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400",children:r.map((n,i)=>{const l=i===r.length-1;return e.jsxs("div",{className:"flex items-center gap-2",children:[i>0&&e.jsx("span",{children:"/"}),n.href&&!l?e.jsx(ye,{to:n.href,className:"hover:text-gray-700 dark:hover:text-gray-300",children:n.label}):e.jsx("span",{className:l?"text-gray-900 dark:text-gray-100 font-medium":"",children:n.label})]},i)})})}function st({children:t}){const{open:s,isMobile:r,state:n}=N();return e.jsxs("main",{className:d("flex-1 min-w-0 overflow-x-hidden bg-gray-50 dark:bg-black transition-[padding] duration-200 ease-linear",!r&&(n==="expanded"?"md:pl-32":"md:pl-12")),children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-2",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(F,{}),e.jsx(tt,{})]}),!s&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-primary-600 flex items-center justify-center md:hidden",children:e.jsx("span",{className:"text-white font-bold text-xs",children:"PG"})}),e.jsx("span",{className:"font-semibold text-sidebar-foreground md:hidden",children:"pg-boss"})]})]}),e.jsx("div",{className:"px-6 pb-6 lg:px-8 lg:pb-8",children:t})]})}const rt=`
|
|
1
|
+
import{a,p as e,q as ne,t as ae,v as oe,w as ie,x as de,y as le,z as ce,A as ue,B as me,M as he,L as fe,S as ge,C as xe,O as be,i as pe}from"./chunk-UVKPFVEO-YfSfkVr_.js";import{c as d,u as L,m as E,a as ve,D as ye}from"./db-link-CU7IJqbq.js";import{c as M}from"./createLucideIcon-Bt-yXILq.js";import{M as z,a as H,b as P,c as D,d as q,e as S}from"./MenuTrigger-CoRd-BqL.js";import"./useOpenInteractionType-mgYMZAa8.js";import"./index-DuhoQwUK.js";const we=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],je=M("monitor",we);const ke=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],R=M("moon",ke);const Ne=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Se=M("panel-left",Ne);const Me=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],T=M("sun",Me),A=["emerald","teal","cyan","sky","blue","indigo","violet","purple"],Ce={emerald:"#059669",teal:"#0d9488",cyan:"#0891b2",sky:"#0284c7",blue:"#2563eb",indigo:"#4f46e5",violet:"#7c3aed",purple:"#9333ea"},V=a.createContext(void 0),$="pg-boss-theme",G="pg-boss-color-theme";function C(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function I(){if(typeof window>"u")return"system";const t=localStorage.getItem($);return t==="light"||t==="dark"||t==="system"?t:"system"}function Le(){if(typeof window>"u")return"violet";const t=localStorage.getItem(G);return t&&A.includes(t)?t:"violet"}function Ee({children:t}){const[s,r]=a.useState(I),[n,i]=a.useState(()=>{const o=I();return o==="system"?C():o}),[l,m]=a.useState(Le);a.useEffect(()=>{const o=s==="system"?C():s;i(o);const u=document.documentElement;u.classList.remove("light","dark"),u.classList.add(o)},[s]),a.useEffect(()=>{const o=window.matchMedia("(prefers-color-scheme: dark)"),u=()=>{if(s==="system"){const b=C();i(b),document.documentElement.classList.remove("light","dark"),document.documentElement.classList.add(b)}};return o.addEventListener("change",u),()=>o.removeEventListener("change",u)},[s]),a.useEffect(()=>{document.documentElement.dataset.colorTheme=l;const u=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><rect width="32" height="32" rx="6" fill="${Ce[l]}"/><text x="16" y="22" text-anchor="middle" font-family="system-ui,sans-serif" font-size="14" font-weight="bold" fill="white">PG</text></svg>`,b=encodeURIComponent(u);let f=document.querySelector('link[rel="icon"]');f?f.href=`data:image/svg+xml,${b}`:(f=document.createElement("link"),f.rel="icon",f.type="image/svg+xml",f.href=`data:image/svg+xml,${b}`,document.head.appendChild(f))},[l]);const x=o=>{r(o),localStorage.setItem($,o)},h=o=>{m(o),localStorage.setItem(G,o)};return e.jsx(V.Provider,{value:{theme:s,setTheme:x,resolvedTheme:n,colorTheme:l,setColorTheme:h},children:t})}function W(){const t=a.useContext(V);if(t===void 0)throw new Error("useTheme must be used within a ThemeProvider");return t}const Re={light:"Light",dark:"Dark",system:"System"};function Te(){const{theme:t,setTheme:s,resolvedTheme:r}=W();return e.jsxs(z,{children:[e.jsxs(H,{className:d("flex items-center gap-2 rounded-md p-2 w-full cursor-pointer","text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent","focus:outline-none","transition-colors"),"aria-label":"Toggle theme",children:[r==="dark"?e.jsx(R,{className:"h-5 w-5 shrink-0"}):e.jsx(T,{className:"h-5 w-5 shrink-0"}),e.jsx("span",{className:"text-sm group-data-[state=collapsed]:hidden",children:Re[t]})]}),e.jsx(P,{container:typeof document<"u"?document.body:void 0,children:e.jsx(D,{className:"z-[100]",children:e.jsxs(q,{className:d("min-w-[8rem] rounded-md border p-1 shadow-md z-[100]","bg-white border-gray-200","dark:bg-gray-900 dark:border-gray-800","animate-in fade-in-0 zoom-in-95"),children:[e.jsxs(S,{className:d("flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer","outline-none transition-colors","text-gray-700 data-highlighted:bg-gray-100","dark:text-gray-300 dark:data-highlighted:bg-gray-800",t==="light"&&"bg-gray-100 dark:bg-gray-800"),onClick:()=>s("light"),children:[e.jsx(T,{className:"h-4 w-4"}),"Light"]}),e.jsxs(S,{className:d("flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer","outline-none transition-colors","text-gray-700 data-highlighted:bg-gray-100","dark:text-gray-300 dark:data-highlighted:bg-gray-800",t==="dark"&&"bg-gray-100 dark:bg-gray-800"),onClick:()=>s("dark"),children:[e.jsx(R,{className:"h-4 w-4"}),"Dark"]}),e.jsxs(S,{className:d("flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm cursor-pointer","outline-none transition-colors","text-gray-700 data-highlighted:bg-gray-100","dark:text-gray-300 dark:data-highlighted:bg-gray-800",t==="system"&&"bg-gray-100 dark:bg-gray-800"),onClick:()=>s("system"),children:[e.jsx(je,{className:"h-4 w-4"}),"System"]})]})})})]})}const _={emerald:"bg-emerald-500",teal:"bg-teal-500",cyan:"bg-cyan-500",sky:"bg-sky-500",blue:"bg-blue-500",indigo:"bg-indigo-500",violet:"bg-violet-500",purple:"bg-purple-500"},B={emerald:"Emerald",teal:"Teal",cyan:"Cyan",sky:"Sky",blue:"Blue",indigo:"Indigo",violet:"Violet",purple:"Purple"};function Ie(){const{colorTheme:t,setColorTheme:s}=W();return e.jsxs(z,{children:[e.jsxs(H,{className:d("flex items-center gap-2 rounded-md p-2 w-full cursor-pointer","text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent","focus:outline-none","transition-colors"),"aria-label":"Change color theme",children:[e.jsx("span",{className:d("h-5 w-5 rounded-full shrink-0",_[t])}),e.jsx("span",{className:"text-sm group-data-[state=collapsed]:hidden",children:B[t]})]}),e.jsx(P,{container:typeof document<"u"?document.body:void 0,children:e.jsx(D,{className:"z-[100]",children:e.jsx(q,{className:d("rounded-md border p-2 shadow-md z-[100]","bg-white border-gray-200","dark:bg-gray-900 dark:border-gray-800","animate-in fade-in-0 zoom-in-95"),children:e.jsx("div",{className:"grid grid-cols-4 gap-1.5",children:A.map(r=>e.jsx(S,{className:d("w-7 h-7 rounded-full cursor-pointer transition-all","outline-none","hover:scale-110",_[r],t===r&&"ring-2 ring-offset-2 ring-gray-900 dark:ring-white dark:ring-offset-gray-900"),onClick:()=>s(r),"aria-label":r,title:B[r]},r))})})})})]})}function _e({content:t,children:s,side:r="right",align:n="center"}){const[i,l]=a.useState(!1),[m,x]=a.useState({top:0,left:0}),h=a.useRef(null),o=a.useRef(null),u=a.useCallback(()=>{if(!h.current||!o.current)return;const c=h.current.getBoundingClientRect(),g=o.current.getBoundingClientRect();let y=0,j=0;switch(r){case"top":y=c.top-g.height-8,j=c.left+(c.width-g.width)/2;break;case"right":y=c.top+(c.height-g.height)/2,j=c.right+8;break;case"bottom":y=c.bottom+8,j=c.left+(c.width-g.width)/2;break;case"left":y=c.top+(c.height-g.height)/2,j=c.left-g.width-8;break}r==="top"||r==="bottom"?n==="start"?j=c.left:n==="end"&&(j=c.right-g.width):n==="start"?y=c.top:n==="end"&&(y=c.bottom-g.height),x({top:y,left:j})},[r,n]);a.useEffect(()=>{if(i)return u(),window.addEventListener("scroll",u,!0),window.addEventListener("resize",u),()=>{window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",u)}},[i,u]);const b=()=>{l(!0)},f=()=>{l(!1)},w=a.Children.only(s),k=a.cloneElement(w,{ref:c=>{c&&(h.current=c);const g=w.ref;typeof g=="function"?g(c):g&&(g.current=c)},onMouseEnter:c=>{b(),w.props?.onMouseEnter?.(c)},onMouseLeave:c=>{f(),w.props?.onMouseLeave?.(c)}});return e.jsxs(e.Fragment,{children:[k,i&&e.jsx("div",{ref:o,role:"tooltip",style:{position:"fixed",top:m.top,left:m.left,zIndex:9999},className:d("px-3 py-1.5 text-sm font-medium text-white bg-gray-900 dark:bg-gray-700 rounded-md shadow-lg","pointer-events-none animate-in fade-in-0 zoom-in-95","whitespace-nowrap"),children:t})]})}const Be="sidebar:state",Oe=3600*24*7,ze="16rem",He="3rem",Pe="b",K=a.createContext(null);function N(){const t=a.useContext(K);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}const Z=a.forwardRef(({defaultOpen:t=!0,open:s,onOpenChange:r,className:n,style:i,children:l,...m},x)=>{const[h,o]=a.useState(!1),[u,b]=a.useState(t),f=s??u,w=a.useCallback(p=>{const v=typeof p=="function"?p(f):p;r?r(v):b(v),document.cookie=`${Be}=${v}; path=/; max-age=${Oe}`},[r,f]),k=a.useCallback(()=>w(p=>!p),[w]),[c,g]=a.useState(!1);a.useEffect(()=>{const p=window.matchMedia("(max-width: 768px)"),v=()=>g(p.matches);return v(),p.addEventListener("change",v),()=>p.removeEventListener("change",v)},[]),a.useEffect(()=>{const p=v=>{v.key===Pe&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),k())};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[k]);const y=f?"expanded":"collapsed",j=a.useMemo(()=>({state:y,open:f,setOpen:w,isMobile:c,openMobile:h,setOpenMobile:o,toggleSidebar:k}),[y,f,w,c,h,o,k]);return e.jsx(K.Provider,{value:j,children:e.jsx("div",{style:{"--sidebar-width":ze,"--sidebar-width-icon":He,...i},className:d("group/sidebar-wrapper flex min-h-screen w-full has-[[data-variant=inset]]:bg-sidebar",n),ref:x,...m,children:l})})});Z.displayName="SidebarProvider";const U=a.forwardRef(({side:t="left",variant:s="sidebar",collapsible:r="offcanvas",className:n,children:i,...l},m)=>{const{isMobile:x,state:h,openMobile:o,setOpenMobile:u}=N();return r==="none"?e.jsx("div",{className:d("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",n),ref:m,...l,children:i}):x?e.jsxs(e.Fragment,{children:[o&&e.jsx("div",{className:"fixed inset-0 z-50 bg-black/50",onClick:()=>u(!1)}),e.jsx("div",{ref:m,className:d("fixed inset-y-0 z-50 flex h-full w-[--sidebar-width-mobile] flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground transition-transform duration-200 ease-in-out",t==="left"?"left-0":"right-0",o?"translate-x-0":t==="left"?"-translate-x-full":"translate-x-full",n),...l,children:i})]}):e.jsx("div",{ref:m,"data-state":h,className:d("group peer hidden md:flex fixed inset-y-0 left-0 z-30 flex-col border-r border-sidebar-border bg-sidebar text-sidebar-foreground overflow-y-auto overflow-x-hidden","transition-[width] duration-200 ease-linear",h==="expanded"?"w-[--sidebar-width]":"w-[--sidebar-width-icon]",n),...l,children:i})});U.displayName="Sidebar";const F=a.forwardRef(({className:t,onClick:s,...r},n)=>{const{toggleSidebar:i,isMobile:l,openMobile:m,setOpenMobile:x}=N();return e.jsxs("button",{ref:n,onClick:h=>{s?.(h),l?x(!m):i()},className:d("inline-flex items-center justify-center rounded-md p-2 cursor-pointer","text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...r,children:[e.jsx(Se,{className:"h-5 w-5"}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});F.displayName="SidebarTrigger";const Q=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("flex flex-col gap-2 p-2 overflow-hidden",t),...s}));Q.displayName="SidebarHeader";const J=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("flex flex-col gap-2 p-2 overflow-hidden",t),...s}));J.displayName="SidebarFooter";const Y=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("flex min-h-0 flex-1 flex-col gap-2 overflow-auto",t),...s}));Y.displayName="SidebarContent";const X=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("relative flex w-full min-w-0 flex-col p-2",t),...s}));X.displayName="SidebarGroup";const De=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("px-2 text-xs font-medium text-sidebar-foreground/70",t),...s}));De.displayName="SidebarGroupLabel";const ee=a.forwardRef(({className:t,...s},r)=>e.jsx("div",{ref:r,className:d("w-full text-sm",t),...s}));ee.displayName="SidebarGroupContent";const te=a.forwardRef(({className:t,...s},r)=>e.jsx("ul",{ref:r,className:d("flex w-full min-w-0 flex-col gap-1",t),...s}));te.displayName="SidebarMenu";const se=a.forwardRef(({className:t,...s},r)=>e.jsx("li",{ref:r,className:d("group/menu-item relative",t),...s}));se.displayName="SidebarMenuItem";const qe=ve("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 cursor-pointer group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 group-data-[state=collapsed]:justify-center",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[state=collapsed]:!h-8"}},defaultVariants:{variant:"default",size:"default"}}),re=a.forwardRef(({render:t,isActive:s=!1,variant:r="default",size:n="default",tooltip:i,className:l,...m},x)=>{const{state:h}=N(),o=L({defaultTagName:"button",render:t,props:E({"data-sidebar":"menu-button","data-active":s,className:d(qe({variant:r,size:n}),s&&"bg-sidebar-accent font-medium text-sidebar-accent-foreground",l)},m),ref:x});return h==="collapsed"&&i&&typeof i=="string"?e.jsx(_e,{content:i,children:o}):o});re.displayName="SidebarMenuButton";const Ae=a.forwardRef(({className:t,render:s,showOnHover:r=!1,...n},i)=>L({defaultTagName:"button",render:s,props:E({"data-sidebar":"menu-action",className:d("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-hover/menu-button:text-sidebar-accent-foreground",r&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",t)},n),ref:i}));Ae.displayName="SidebarMenuAction";const Ve=a.forwardRef(({className:t,...s},r)=>e.jsx("ul",{ref:r,"data-sidebar":"menu-sub",className:d("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5",t),...s}));Ve.displayName="SidebarMenuSub";const $e=a.forwardRef(({...t},s)=>e.jsx("li",{ref:s,...t}));$e.displayName="SidebarMenuSubItem";const Ge=a.forwardRef(({render:t,size:s="md",isActive:r,className:n,...i},l)=>L({defaultTagName:"a",render:t,props:E({"data-sidebar":"menu-sub-button","data-size":s,"data-active":r,className:d("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",s==="sm"&&"text-xs",s==="md"&&"text-sm",n)},i),ref:l}));Ge.displayName="SidebarMenuSubButton";const We=[{name:"Overview",href:"/",icon:Ke},{name:"Jobs",href:"/jobs",icon:Ze},{name:"Queues",href:"/queues",icon:Ue},{name:"Schedules",href:"/schedules",icon:Fe},{name:"Warnings",href:"/warnings",icon:Qe}];function Ke({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"})})}function Ze({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z"})})}function Ue({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 0 1 0 3.75H5.625a1.875 1.875 0 0 1 0-3.75Z"})})}function Fe({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})}function Qe({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})})}function O({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})})}function Je({className:t}){return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})}function Ye({databases:t,currentDb:s,onSelect:r}){const[n,i]=a.useState(!1);return t.length<=1?null:e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>i(!n),className:d("w-full flex items-center justify-between px-3 py-2 text-sm rounded-lg transition-colors cursor-pointer","hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(O,{className:"w-4 h-4 flex-shrink-0"}),e.jsx("span",{className:"font-medium truncate",children:s.name})]}),e.jsx(Je,{className:d("w-4 h-4 flex-shrink-0 transition-transform",n&&"rotate-180")})]}),n&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>i(!1)}),e.jsx("div",{className:d("absolute left-0 right-0 mt-1 rounded-lg shadow-lg z-20 py-1","bg-sidebar-accent border border-sidebar-border"),children:t.map(l=>e.jsxs("button",{type:"button",onClick:()=>{r(l),i(!1)},className:d("w-full flex items-center gap-2 px-3 py-2 text-sm text-left transition-colors cursor-pointer",l.id===s.id?"bg-sidebar-accent text-sidebar-accent-foreground font-medium":"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"),children:[e.jsx(O,{className:d("w-4 h-4 flex-shrink-0")}),e.jsx("span",{className:"truncate",children:l.name}),l.schema!=="pgboss"&&e.jsxs("span",{className:"ml-auto text-xs opacity-70",children:["(",l.schema,")"]})]},l.id))})]})]})}function Xe(){const t=ne("root"),[s]=ae(),r=oe(),{setOpenMobile:n}=N(),i=t?.databases||[],l=t?.currentDb,m=s.get("db"),x=o=>{const u=new URLSearchParams(s);o.id===i[0]?.id?u.delete("db"):u.set("db",o.id);const b=u.toString();r({pathname:window.location.pathname,search:b?`?${b}`:""})},h=o=>m?`${o}?db=${m}`:o;return e.jsxs(U,{children:[e.jsxs(Q,{children:[e.jsxs("div",{className:"flex items-center gap-2 px-2 py-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg bg-primary-600 flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-white font-bold text-sm",children:"PG"})}),e.jsx("span",{className:"font-semibold text-sidebar-foreground group-data-[state=collapsed]:hidden",children:"pg-boss"})]}),i&&l&&i.length>1&&e.jsx("div",{className:"group-data-[state=collapsed]:hidden",children:e.jsx(Ye,{databases:i,currentDb:l,onSelect:x})})]}),e.jsx(Y,{children:e.jsx(X,{children:e.jsx(ee,{children:e.jsx(te,{children:We.map(o=>e.jsx(se,{children:e.jsx(ie,{to:h(o.href),end:o.href==="/",onClick:()=>n(!1),children:({isActive:u})=>e.jsxs(re,{isActive:u,tooltip:o.name,children:[e.jsx(o.icon,{className:"h-5 w-5 flex-shrink-0"}),e.jsx("span",{className:"group-data-[state=collapsed]:hidden",children:o.name})]})})},o.name))})})})}),e.jsx(J,{children:e.jsxs("div",{className:"flex flex-col px-2",children:[e.jsx("p",{className:"px-2 mb-1 text-xs font-medium text-sidebar-foreground/50 uppercase tracking-wider group-data-[state=collapsed]:hidden",children:"Theme"}),e.jsx(Te,{}),e.jsx(Ie,{})]})})]})}function et(){return de().state==="loading"?e.jsx("div",{className:"fixed top-0 left-0 right-0 z-50 h-1 bg-gray-200 dark:bg-gray-800",children:e.jsx("div",{className:"h-full bg-primary-600 dark:bg-primary-400 animate-loading-bar"})}):null}function tt(){le();const s=ce().pathname.split("/").filter(Boolean);if(s.length===0)return null;const r=[];if(s[0]==="queues"){if(r.push({label:"Queues",href:"/queues"}),s.length>1&&s[1]!=="queues"){const n=decodeURIComponent(s[1]);if(r.push({label:n,href:`/queues/${encodeURIComponent(n)}`}),s.length>2&&s[2]==="jobs"&&s[3]){const i=s[3];r.push({label:`${i.slice(0,8)}...`})}}}else if(s[0]==="schedules"){if(r.push({label:"Schedules",href:"/schedules"}),s.length>1&&s[1]==="new")r.push({label:"New Schedule"});else if(s.length>1){const n=decodeURIComponent(s[1]);r.push({label:n})}}else s[0]==="jobs"?r.push({label:"Jobs"}):s[0]==="warnings"?r.push({label:"Warnings"}):s[0]==="send"&&(r.push({label:"Queues",href:"/queues"}),r.push({label:"Send Job"}));return r.length===0?null:e.jsx("div",{className:"flex items-center gap-2 text-sm text-gray-500 dark:text-gray-400",children:r.map((n,i)=>{const l=i===r.length-1;return e.jsxs("div",{className:"flex items-center gap-2",children:[i>0&&e.jsx("span",{children:"/"}),n.href&&!l?e.jsx(ye,{to:n.href,className:"hover:text-gray-700 dark:hover:text-gray-300",children:n.label}):e.jsx("span",{className:l?"text-gray-900 dark:text-gray-100 font-medium":"",children:n.label})]},i)})})}function st({children:t}){const{open:s,isMobile:r,state:n}=N();return e.jsxs("main",{className:d("flex-1 min-w-0 overflow-x-hidden bg-gray-50 dark:bg-black transition-[padding] duration-200 ease-linear",!r&&(n==="expanded"?"md:pl-32":"md:pl-12")),children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-2",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(F,{}),e.jsx(tt,{})]}),!s&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg bg-primary-600 flex items-center justify-center md:hidden",children:e.jsx("span",{className:"text-white font-bold text-xs",children:"PG"})}),e.jsx("span",{className:"font-semibold text-sidebar-foreground md:hidden",children:"pg-boss"})]})]}),e.jsx("div",{className:"px-6 pb-6 lg:px-8 lg:pb-8",children:t})]})}const rt=`
|
|
2
2
|
(function() {
|
|
3
3
|
const stored = localStorage.getItem('pg-boss-theme');
|
|
4
4
|
let theme = stored || 'system';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as b,B as f,t as P,p as e}from"./chunk-
|
|
1
|
+
import{A as b,B as f,t as P,p as e}from"./chunk-UVKPFVEO-YfSfkVr_.js";import{D as c,e as l}from"./db-link-CU7IJqbq.js";import{B as N,C as k,a as S,b as T,c as w}from"./button-Ba8FWhqs.js";import{T as B,a as E,b as d,c as r,d as v,e as s}from"./table-Au2E5mnP.js";import{P as D}from"./pagination-BItl293Q.js";import{E as R}from"./error-card-D-uZRy_l.js";const I=f(function(){return e.jsx(R,{title:"Failed to load schedules"})}),K=b(function({loaderData:x}){const{schedules:o,totalCount:n,page:h,totalPages:m,hasNextPage:j,hasPrevPage:p}=x,[g,y]=P(),u=a=>{const t=new URLSearchParams(g);t.set("page",a.toString()),y(t)};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Schedules"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:"Cron-based job schedules"})]}),e.jsx(c,{to:"/schedules/new",children:e.jsx(N,{variant:"primary",size:"md",className:"cursor-pointer",children:"Schedule Job"})})]}),e.jsxs(k,{children:[e.jsx(S,{children:e.jsxs(T,{children:["Schedules",n!==null&&` (${n.toLocaleString()})`]})}),e.jsx(w,{className:"p-0",children:e.jsxs(B,{children:[e.jsx(E,{children:e.jsxs(d,{children:[e.jsx(r,{children:"Queue"}),e.jsx(r,{children:"Key"}),e.jsx(r,{children:"Cron"}),e.jsx(r,{children:"Timezone"}),e.jsx(r,{children:"Created"}),e.jsx(r,{children:"Updated"})]})}),e.jsx(v,{children:o.length===0?e.jsx(d,{children:e.jsx(s,{className:"text-center text-gray-500 dark:text-gray-400 py-8",colSpan:6,children:"No schedules found"})}):o.map(a=>{const t=a.key||"__default__",C=`/schedules/${encodeURIComponent(a.name)}/${encodeURIComponent(t)}`;return e.jsxs(d,{children:[e.jsx(s,{children:e.jsx(c,{to:C,className:"font-medium text-gray-900 dark:text-gray-100",children:a.name})}),e.jsx(s,{children:a.key}),e.jsx(s,{children:e.jsx("code",{className:"text-xs bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded text-gray-700 dark:text-gray-300",children:a.cron})}),e.jsx(s,{children:a.timezone||e.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"—"})}),e.jsx(s,{children:l(new Date(a.createdOn))}),e.jsx(s,{children:l(new Date(a.updatedOn))})]},`${a.name}:${a.key}`)})})]})}),n>0&&e.jsx(D,{page:h,totalPages:m,hasNextPage:j,hasPrevPage:p,onPageChange:u})]})]})});export{I as ErrorBoundary,K as default};
|
package/build/client/assets/{schedules._name._key-i42S9kw2.js → schedules._name._key-CXTVKoOc.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as h,B as g,a as y,p as e}from"./chunk-
|
|
1
|
+
import{A as h,B as g,a as y,p as e}from"./chunk-UVKPFVEO-YfSfkVr_.js";import{D as u,e as c}from"./db-link-CU7IJqbq.js";import{B as s,C as a,a as d,b as n,c as i}from"./button-Ba8FWhqs.js";import{D as j,a as p,b as f,c as k,d as N,e as b}from"./dialog-Dkx42Rkd.js";import{E as v}from"./error-card-D-uZRy_l.js";import"./createLucideIcon-Bt-yXILq.js";import"./useOpenInteractionType-mgYMZAa8.js";import"./index-DuhoQwUK.js";const T=g(function(){return e.jsx(v,{title:"Failed to load schedule",backTo:{href:"/schedules",label:"Back to Schedules"}})}),U=h(function({loaderData:o,actionData:l}){const{schedule:r}=o,[m,t]=y.useState(!1);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsx("div",{children:e.jsxs("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:[r.name,r.key&&e.jsxs("span",{className:"font-normal text-gray-500 dark:text-gray-400",children:[" (",r.key,")"]})]})}),e.jsx(s,{variant:"danger",size:"md",className:"cursor-pointer",onClick:()=>t(!0),children:"Unschedule"})]}),l?.error&&e.jsx("div",{className:"rounded-lg bg-red-50 dark:bg-red-950 border border-red-200 dark:border-red-800 p-4",children:e.jsx("p",{className:"text-sm text-red-800 dark:text-red-200",children:l.error})}),e.jsxs("div",{className:"grid gap-6",children:[e.jsxs(a,{children:[e.jsx(d,{children:e.jsx(n,{children:"Schedule Configuration"})}),e.jsxs(i,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Queue"}),e.jsx("dd",{className:"mt-1",children:e.jsx(u,{to:`/queues/${encodeURIComponent(r.name)}`,className:"text-sm text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300",children:r.name})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Key"}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:r.key||e.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"—"})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Cron Expression"}),e.jsx("dd",{className:"mt-1",children:e.jsx("code",{className:"text-sm bg-gray-100 dark:bg-gray-800 px-2 py-1 rounded text-gray-700 dark:text-gray-300",children:r.cron})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Timezone"}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:r.timezone||e.jsx("span",{className:"text-gray-400 dark:text-gray-500",children:"Default"})})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Created"}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:c(new Date(r.createdOn))})]}),e.jsxs("div",{children:[e.jsx("dt",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:"Updated"}),e.jsx("dd",{className:"mt-1 text-sm text-gray-900 dark:text-gray-100",children:c(new Date(r.updatedOn))})]})]})]}),r.data&&e.jsxs(a,{children:[e.jsx(d,{children:e.jsx(n,{children:"Data"})}),e.jsx(i,{children:e.jsx("pre",{className:"text-xs bg-gray-50 dark:bg-gray-900 p-4 rounded overflow-auto text-gray-700 dark:text-gray-300",children:JSON.stringify(r.data,null,2)})})]}),r.options&&e.jsxs(a,{children:[e.jsx(d,{children:e.jsx(n,{children:"Options"})}),e.jsx(i,{children:e.jsx("pre",{className:"text-xs bg-gray-50 dark:bg-gray-900 p-4 rounded overflow-auto text-gray-700 dark:text-gray-300",children:JSON.stringify(r.options,null,2)})})]})]}),e.jsx(j,{open:m,onOpenChange:t,children:e.jsx(p,{hideCloseButton:!0,className:"w-[28rem] max-w-[calc(100vw-2rem)]",children:e.jsxs("form",{method:"post",children:[e.jsx("input",{type:"hidden",name:"intent",value:"unschedule"}),e.jsxs(f,{children:[e.jsx(k,{children:"Unschedule Job"}),e.jsx(N,{className:"mt-2",children:"Are you sure you want to unschedule? This will stop the recurring job from being created."})]}),e.jsxs(b,{className:"mt-6 flex justify-end gap-3",children:[e.jsx(s,{type:"button",variant:"outline",size:"sm",className:"cursor-pointer",onClick:()=>t(!1),children:"Cancel"}),e.jsx(s,{type:"submit",variant:"danger",size:"sm",className:"cursor-pointer",children:"Unschedule"})]})]})})})]})});export{T as ErrorBoundary,U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as N,B as v,D as w,x as S,a as s,G as C,p as e}from"./chunk-
|
|
1
|
+
import{A as N,B as v,D as w,x as S,a as s,G as C,p as e}from"./chunk-UVKPFVEO-YfSfkVr_.js";import{c as a,D}from"./db-link-CU7IJqbq.js";import{B as m,C as E,a as F,b as B,c as L}from"./button-Ba8FWhqs.js";import{E as z}from"./error-card-D-uZRy_l.js";const U=v(function(){return e.jsx(z,{title:"Failed to load schedule creation",backTo:{href:"/schedules",label:"Back to Schedules"}})}),P=N(function({loaderData:h,actionData:A}){const l=w(),t=S().state==="submitting",{queues:b}=h,[x,u]=s.useState(""),[n,f]=s.useState(""),[k,o]=s.useState(!1),[i,c]=s.useState(!1),y=b.filter(r=>r.name.toLowerCase().includes(x.toLowerCase())),j=r=>{f(r),u(r),o(!1),c(!0)},g=C(({currentLocation:r,nextLocation:d})=>i&&!t&&r.pathname!==d.pathname);return s.useEffect(()=>{const r=d=>{i&&!t&&(d.preventDefault(),d.returnValue="")};return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[i,t]),e.jsxs("div",{className:"space-y-6",children:[g.state==="blocked"&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:e.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow-lg p-6 max-w-md mx-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-2",children:"Unsaved Changes"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:"You have unsaved changes. Are you sure you want to leave this page?"}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx(m,{type:"button",variant:"outline",size:"sm",onClick:()=>g.reset(),children:"Stay"}),e.jsx(m,{type:"button",variant:"danger",size:"sm",onClick:()=>g.proceed(),children:"Leave"})]})]})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"New Schedule"}),e.jsxs(E,{children:[e.jsx(F,{children:e.jsx(B,{children:"Details"})}),e.jsx(L,{children:e.jsxs("form",{method:"post",className:"space-y-5",onChange:()=>c(!0),onSubmit:()=>c(!1),children:[l&&"error"in l&&e.jsx("div",{className:a("rounded-lg border px-4 py-3 text-sm","bg-red-50 border-red-200 text-red-700","dark:bg-red-950 dark:border-red-800 dark:text-red-400"),children:l.error}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Queue Name ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",id:"queueSearch",value:x,onChange:r=>{u(r.target.value),o(!0)},onFocus:()=>o(!0),onBlur:()=>setTimeout(()=>o(!1),200),placeholder:"Search for a queue...",autoComplete:"off",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("input",{type:"hidden",name:"name",value:n,required:!0}),k&&y.length>0&&e.jsx("div",{className:"absolute z-10 w-full mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",children:y.map(r=>e.jsx("button",{type:"button",onClick:()=>j(r.name),className:"w-full text-left px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-900 dark:text-gray-100 cursor-pointer text-sm",children:r.name},r.name))})]}),n&&e.jsxs("p",{className:"mt-1 text-xs text-green-600 dark:text-green-400",children:["Selected: ",n]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"key",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Schedule Key"}),e.jsx("input",{type:"text",id:"key",name:"key",placeholder:"Optional unique key",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"cron",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Cron Expression ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",id:"cron",name:"cron",required:!0,placeholder:"0 8 * * *",className:a("w-full rounded-lg border px-3 py-2 text-sm font-mono","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Format: minute hour day month weekday"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"timezone",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Timezone"}),e.jsx("input",{type:"text",id:"timezone",name:"timezone",placeholder:"UTC",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Optional: IANA timezone (e.g. UTC, America/New_York)"})]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"data",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Data"}),e.jsx("textarea",{id:"data",name:"data",rows:4,placeholder:'{"key": "value"}',className:a("w-full rounded-lg border px-3 py-2 text-sm font-mono","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Optional: JSON object to pass as job data"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"priority",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Priority"}),e.jsx("input",{type:"number",id:"priority",name:"priority",placeholder:"0",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"retryLimit",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Retry Limit"}),e.jsx("input",{type:"number",id:"retryLimit",name:"retryLimit",min:"0",placeholder:"0",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"expireInSeconds",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Expire In Seconds"}),e.jsx("input",{type:"number",id:"expireInSeconds",name:"expireInSeconds",min:"1",placeholder:"Default",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]})]}),e.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[e.jsx(m,{type:"submit",disabled:t,className:"cursor-pointer",children:t?"Creating...":"Schedule Job"}),e.jsx(D,{to:"/schedules",className:"text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300",children:"Cancel"})]})]})})]})]})});export{U as ErrorBoundary,P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as N,B as S,t as C,D,x as E,a as s,G as B,p as e}from"./chunk-
|
|
1
|
+
import{A as N,B as S,t as C,D,x as E,a as s,G as B,p as e}from"./chunk-UVKPFVEO-YfSfkVr_.js";import{c as a,D as L}from"./db-link-CU7IJqbq.js";import{B as u,C as F,a as q,b as Q,c as A}from"./button-Ba8FWhqs.js";import{E as I}from"./error-card-D-uZRy_l.js";const O=S(function(){return e.jsx(I,{title:"Failed to load job sending page",backTo:{href:"/queues",label:"Back to Queues"}})}),R=N(function({loaderData:h}){const{queues:f}=h,[k]=C(),n=D(),t=E().state==="submitting",[l,i]=s.useState(!1),x=k.get("queue")||"",[m,y]=s.useState(x),[c,j]=s.useState(x),[v,o]=s.useState(!1),p=f.filter(r=>r.name.toLowerCase().includes(m.toLowerCase())),w=r=>{j(r),y(r),o(!1),i(!0)},g=B(({currentLocation:r,nextLocation:d})=>l&&!t&&r.pathname!==d.pathname);return s.useEffect(()=>{const r=d=>{l&&!t&&(d.preventDefault(),d.returnValue="")};return window.addEventListener("beforeunload",r),()=>window.removeEventListener("beforeunload",r)},[l,t]),e.jsxs("div",{className:"space-y-6",children:[g.state==="blocked"&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:e.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow-lg p-6 max-w-md mx-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100 mb-2",children:"Unsaved Changes"}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-6",children:"You have unsaved changes. Are you sure you want to leave this page?"}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx(u,{type:"button",variant:"outline",size:"sm",onClick:()=>g.reset(),children:"Stay"}),e.jsx(u,{type:"button",variant:"danger",size:"sm",onClick:()=>g.proceed(),children:"Leave"})]})]})}),e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Send Job"}),e.jsxs(F,{children:[e.jsx(q,{children:e.jsx(Q,{children:"Job Details"})}),e.jsx(A,{children:e.jsxs("form",{method:"post",className:"space-y-5",onChange:()=>i(!0),onSubmit:()=>i(!1),children:[n&&"error"in n&&e.jsx("div",{className:a("rounded-lg border px-4 py-3 text-sm","bg-red-50 border-red-200 text-red-700","dark:bg-red-950 dark:border-red-800 dark:text-red-400"),children:n.error}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"queueSearch",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:["Queue Name ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"text",id:"queueSearch",value:m,onChange:r=>{y(r.target.value),o(!0)},onFocus:()=>o(!0),onBlur:()=>setTimeout(()=>o(!1),200),placeholder:"Search for a queue...",autoComplete:"off",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("input",{type:"hidden",name:"queueName",value:c,required:!0}),v&&p.length>0&&e.jsx("div",{className:"absolute z-10 w-full mt-1 bg-white dark:bg-gray-900 border border-gray-300 dark:border-gray-700 rounded-md shadow-lg max-h-60 overflow-auto",children:p.map(r=>e.jsx("button",{type:"button",onClick:()=>w(r.name),className:"w-full text-left px-3 py-2 hover:bg-gray-100 dark:hover:bg-gray-800 text-gray-900 dark:text-gray-100 cursor-pointer text-sm",children:r.name},r.name))})]}),c&&e.jsxs("p",{className:"mt-1 text-xs text-green-600 dark:text-green-400",children:["Selected: ",c]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"data",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Data"}),e.jsx("textarea",{id:"data",name:"data",rows:6,placeholder:'{"key": "value"}',className:a("w-full rounded-lg border px-3 py-2 text-sm font-mono","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")}),e.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:"Optional: JSON object to pass as job data"})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"priority",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Priority"}),e.jsx("input",{type:"number",id:"priority",name:"priority",placeholder:"0",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"startAfter",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Start After"}),e.jsx("input",{type:"text",id:"startAfter",name:"startAfter",placeholder:"e.g. 2025-01-01T00:00:00Z or 5 minutes",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"singletonKey",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Singleton Key"}),e.jsx("input",{type:"text",id:"singletonKey",name:"singletonKey",placeholder:"Optional unique key",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"retryLimit",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Retry Limit"}),e.jsx("input",{type:"number",id:"retryLimit",name:"retryLimit",min:"0",placeholder:"0",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"expireInSeconds",className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Expire In Seconds"}),e.jsx("input",{type:"number",id:"expireInSeconds",name:"expireInSeconds",min:"1",placeholder:"Default",className:a("w-full rounded-lg border px-3 py-2 text-sm","bg-white border-gray-300 text-gray-900 placeholder-gray-400","dark:bg-gray-900 dark:border-gray-700 dark:text-gray-100 dark:placeholder-gray-500","focus:outline-none focus:ring-2 focus:ring-primary-600 focus:border-transparent")})]})]}),e.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[e.jsx(u,{type:"submit",disabled:t,children:t?"Sending...":"Send Job"}),e.jsx(L,{to:"/queues",className:"text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300",children:"Cancel"})]})]})})]})]})});export{O as ErrorBoundary,R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as r}from"./chunk-
|
|
1
|
+
import{p as r}from"./chunk-UVKPFVEO-YfSfkVr_.js";import{c as t}from"./db-link-CU7IJqbq.js";function o({children:a,className:e}){return r.jsx("div",{className:t("overflow-x-auto",e),children:r.jsx("table",{className:"min-w-full divide-y divide-gray-200 dark:divide-gray-800",children:a})})}function n({children:a,className:e}){return r.jsx("thead",{className:t("bg-gray-50 dark:bg-gray-900",e),children:a})}function c({children:a,className:e}){return r.jsx("tbody",{className:t("divide-y divide-gray-200 bg-white","dark:divide-gray-800 dark:bg-gray-950",e),children:a})}function l({children:a,className:e,onClick:s}){return r.jsx("tr",{className:t(s&&"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-900 transition-colors",e),onClick:s,children:a})}function x({children:a,className:e}){return r.jsx("th",{scope:"col",className:t("px-6 py-3 text-left text-xs font-semibold text-gray-500 uppercase tracking-wider","dark:text-gray-400",e),children:a})}function g({children:a,className:e,colSpan:s}){return r.jsx("td",{className:t("px-6 py-4 whitespace-nowrap text-sm",e),colSpan:s,children:a})}export{o as T,n as a,l as b,x as c,c as d,g as e};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import{a as d,I as kn,p as re,r as In}from"./chunk-UVKPFVEO-YfSfkVr_.js";import{j as ke,g as On,m as Ar,l as zt,E as Me,i as Mr,h as Xt,n as Pn,N as An}from"./db-link-CU7IJqbq.js";import{a as $t}from"./index-DuhoQwUK.js";const ii=500,ai=500,ci={style:{transition:"none"}},Lr="data-base-ui-click-trigger",ui={fallbackAxisSide:"none"},li={fallbackAxisSide:"end"},Nr={clipPath:"inset(50%)",position:"fixed",top:0,left:0};let je=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Dr={[je.startingStyle]:""},Fr={[je.endingStyle]:""},fi={transitionStatus(e){return e==="starting"?Dr:e==="ending"?Fr:null}};let Yt=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=je.startingStyle]="startingStyle",e[e.endingStyle=je.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),Zt=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const Wr={[Zt.popupOpen]:"",[Zt.pressed]:""},Vr={[Yt.open]:""},_r={[Yt.closed]:""},Br={[Yt.anchorHidden]:""},di={open(e){return e?Wr:null}},pi={open(e){return e?Vr:_r},anchorHidden(e){return e?Br:null}},Jt="trigger-press",jr="trigger-hover",gi="trigger-focus",Mn="outside-press",hi="item-press",mi="close-press",Ln="focus-out",Hr="escape-key",bi="list-navigation",yi="cancel-open",Ei="sibling-open",vi="imperative-action",ht=kn[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],$r=ht&&ht!==d.useLayoutEffect?ht:e=>e();function G(e){const t=ke(Yr).current;return t.next=e,$r(t.effect),t.trampoline}function Yr(){const e={next:void 0,callback:Gr,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function Gr(){}function ft(){return typeof window<"u"}function $e(e){return Gt(e)?(e.nodeName||"").toLowerCase():"#document"}function ue(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Kr(e){var t;return(t=(Gt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Gt(e){return ft()?e instanceof Node||e instanceof ue(e).Node:!1}function be(e){return ft()?e instanceof Element||e instanceof ue(e).Element:!1}function ie(e){return ft()?e instanceof HTMLElement||e instanceof ue(e).HTMLElement:!1}function He(e){return!ft()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ue(e).ShadowRoot}function Ye(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=dt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function Si(e){return/^(table|td|th)$/.test($e(e))}function Ur(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const qr=/transform|translate|scale|rotate|perspective|filter/,zr=/paint|layout|strict|content/,Te=e=>!!e&&e!=="none";let mt;function Xr(e){const t=be(e)?dt(e):e;return Te(t.transform)||Te(t.translate)||Te(t.scale)||Te(t.rotate)||Te(t.perspective)||!Nn()&&(Te(t.backdropFilter)||Te(t.filter))||qr.test(t.willChange||"")||zr.test(t.contain||"")}function wi(e){let t=nt(e);for(;ie(t)&&!_e(t);){if(Xr(t))return t;if(Ur(t))return null;t=nt(t)}return null}function Nn(){return mt==null&&(mt=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),mt}function _e(e){return/^(html|body|#document)$/.test($e(e))}function dt(e){return ue(e).getComputedStyle(e)}function Ri(e){return be(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function nt(e){if($e(e)==="html")return e;const t=e.assignedSlot||e.parentNode||He(e)&&e.host||Kr(e);return He(t)?t.host:t}function Dn(e){const t=nt(e);return _e(t)?e.ownerDocument?e.ownerDocument.body:e.body:ie(t)&&Ye(t)?t:Dn(t)}function Qt(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Dn(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=ue(o);if(s){const a=Zr(i);return t.concat(i,i.visualViewport||[],Ye(o)?o:[],a&&n?Qt(a):[])}else return t.concat(o,Qt(o,[],n))}function Zr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Jr={...kn},Qr=()=>{},j=typeof document<"u"?d.useLayoutEffect:Qr,eo=d.createContext(void 0);function to(e=!1){const t=d.useContext(eo);if(t===void 0&&!e)throw new Error(On(16));return t}function no(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:o=0,isNativeButton:s}=e,i=r&&t!==!1,a=r&&t===!1;return{props:d.useMemo(()=>{const c={onKeyDown(p){n&&t&&p.key!=="Tab"&&p.preventDefault()}};return r||(c.tabIndex=o,!s&&n&&(c.tabIndex=t?o:-1)),(s&&(t||i)||!s&&n)&&(c["aria-disabled"]=n),s&&(!t||a)&&(c.disabled=n),c},[r,n,t,i,a,s,o])}}function Ti(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0,composite:s}=e,i=d.useRef(null),a=to(!0),l=s??a!==void 0,{props:c}=no({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:o}),p=d.useCallback(()=>{const g=i.current;bt(g)&&l&&t&&c.disabled===void 0&&g.disabled&&(g.disabled=!1)},[t,c.disabled,l]);j(p,[p]);const u=d.useCallback((g={})=>{const{onClick:v,onMouseDown:h,onKeyUp:y,onKeyDown:R,onPointerDown:S,...N}=g;return Ar({type:o?"button":void 0,onClick(m){if(t){m.preventDefault();return}v?.(m)},onMouseDown(m){t||h?.(m)},onKeyDown(m){if(t||(zt(m),R?.(m),m.baseUIHandlerPrevented))return;const I=m.target===m.currentTarget,O=m.currentTarget,C=bt(O),M=!o&&ro(O),Y=I&&(o?C:!M),H=m.key==="Enter",D=m.key===" ",T=O.getAttribute("role"),$=T?.startsWith("menuitem")||T==="option"||T==="gridcell";if(I&&l&&D){if(m.defaultPrevented&&$)return;m.preventDefault(),M||o&&C?(O.click(),m.preventBaseUIHandler()):Y&&(v?.(m),m.preventBaseUIHandler());return}Y&&(!o&&(D||H)&&m.preventDefault(),!o&&H&&v?.(m))},onKeyUp(m){if(!t){if(zt(m),y?.(m),m.target===m.currentTarget&&o&&l&&bt(m.currentTarget)&&m.key===" "){m.preventDefault();return}m.baseUIHandlerPrevented||m.target===m.currentTarget&&!o&&!l&&m.key===" "&&v?.(m)}},onPointerDown(m){if(t){m.preventDefault();return}S?.(m)}},o?void 0:{role:"button"},c,N)},[t,c,l,o]),b=G(g=>{i.current=g,p()});return{getButtonProps:u,buttonRef:b}}function bt(e){return ie(e)&&e.tagName==="BUTTON"}function ro(e){return!!(e?.tagName==="A"&&e?.href)}const De=typeof navigator<"u",yt=so(),Fn=ao(),Wn=io(),Vn=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),_n=yt.platform==="MacIntel"&&yt.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(yt.platform),oo=De&&/apple/i.test(navigator.vendor),Mt=De&&/android/i.test(Fn)||/android/i.test(Wn),Ci=De&&Fn.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,Bn=Wn.includes("jsdom/");function so(){if(!De)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function io(){if(!De)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function ao(){if(!De)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}let en=0;function co(e,t="mui"){const[n,r]=d.useState(e),o=e||n;return d.useEffect(()=>{n==null&&(en+=1,r(`${t}-${en}`))},[n,t]),o}const tn=Jr.useId;function Ge(e,t){if(tn!==void 0){const n=tn();return e??(t?`${t}-${n}`:n)}return co(e,t)}function xi(e){return Ge(e,"base-ui")}function Ae(e,t,n,r){let o=!1,s=!1;const i=Me;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){s=!0},get isCanceled(){return o},get isPropagationAllowed(){return s},trigger:n,...i}}const uo=[];function jn(e){d.useEffect(e,uo)}const ze=null;class lo{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Xe=new lo;class ce{static create(){return new ce}static request(t){return Xe.request(t)}static cancel(t){return Xe.cancel(t)}currentId=ze;request(t){this.cancel(),this.currentId=Xe.request(()=>{this.currentId=ze,t()})}cancel=()=>{this.currentId!==ze&&(Xe.cancel(this.currentId),this.currentId=ze)};disposeEffect=()=>this.cancel}function Hn(){const e=ke(ce.create).current;return jn(e.disposeEffect),e}function fo(e,t=!1,n=!1){const[r,o]=d.useState(e&&t?"idle":void 0),[s,i]=d.useState(e);return e&&!s&&(i(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),j(()=>{if(!e&&s&&r!=="ending"&&n){const a=ce.request(()=>{o("ending")});return()=>{ce.cancel(a)}}},[e,s,r,n]),j(()=>{if(!e||t)return;const a=ce.request(()=>{o(void 0)});return()=>{ce.cancel(a)}},[t,e]),j(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const a=ce.request(()=>{o("idle")});return()=>{ce.cancel(a)}},[t,e,s,o,r]),d.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:r}),[s,r])}function de(e){return e==null?e:"current"in e?e.current:e}function po(e,t=!1,n=!0){const r=Hn();return G((o,s=null)=>{r.cancel();function i(){$t.flushSync(o)}const a=de(e);if(a==null)return;const l=a;if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)o();else{let c=function(){const u=je.startingStyle;if(!l.hasAttribute(u)){r.request(p);return}const b=new MutationObserver(()=>{l.hasAttribute(u)||(b.disconnect(),p())});b.observe(l,{attributes:!0,attributeFilter:[u]}),s?.addEventListener("abort",()=>b.disconnect(),{once:!0})},p=function(){Promise.all(l.getAnimations().map(u=>u.finished)).then(()=>{s?.aborted||i()}).catch(()=>{const u=l.getAnimations();if(n){if(s?.aborted)return;i()}else u.length>0&&u.some(b=>b.pending||b.playState!=="finished")&&p()})};if(t){c();return}r.request(p)}})}function go(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=G(o),i=po(r,n,!1);d.useEffect(()=>{if(!t)return;const a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,n,s,i])}const We=0;class xe{static create(){return new xe}currentId=We;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=We,n()},t)}isStarted(){return this.currentId!==We}clear=()=>{this.currentId!==We&&(clearTimeout(this.currentId),this.currentId=We)};disposeEffect=()=>this.clear}function rt(){const e=ke(xe.create).current;return jn(e.disposeEffect),e}const Lt="data-base-ui-focusable",$n="active",Yn="selected",ho="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Et="ArrowLeft",vt="ArrowRight",mo="ArrowUp",bo="ArrowDown";function Ce(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function _(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&He(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function ki(e,t){if(!be(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(_(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function pe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function oe(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function yo(e){return e.matches("html,body")}function Gn(e){return ie(e)&&e.matches(ho)}function nn(e){return e?e.getAttribute("role")==="combobox"&&Gn(e):!1}function Ii(e){if(!e||Bn)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Nt(e){return e?e.hasAttribute(Lt)?e:e.querySelector(`[${Lt}]`)||e:null}function Le(e,t,n=!0){return e.filter(o=>o.parentId===t&&(!n||o.context?.open)).flatMap(o=>[o,...Le(e,o.id,n)])}function rn(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function tt(e){e.preventDefault(),e.stopPropagation()}function Eo(e){return"nativeEvent"in e}function vo(e){return e.pointerType===""&&e.isTrusted?!0:Mt&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function So(e){return Bn?!1:!Mt&&e.width===0&&e.height===0||Mt&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Oi(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function wo(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const Pi=["top","right","bottom","left"],Ro=Math.min,To=Math.max,Ai=Math.round,St=Math.floor,Mi=e=>({x:e,y:e}),Co={left:"right",right:"left",bottom:"top",top:"bottom"};function Li(e,t,n){return To(e,Ro(t,n))}function Ni(e,t){return typeof e=="function"?e(t):e}function Kn(e){return e.split("-")[0]}function Un(e){return e.split("-")[1]}function xo(e){return e==="x"?"y":"x"}function ko(e){return e==="y"?"height":"width"}function Io(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Oo(e){return xo(Io(e))}function Di(e,t,n){n===void 0&&(n=!1);const r=Un(e),o=Oo(e),s=ko(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Ft(i)),[i,Ft(i)]}function Fi(e){const t=Ft(e);return[Dt(e),t,Dt(t)]}function Dt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const on=["left","right"],sn=["right","left"],Po=["top","bottom"],Ao=["bottom","top"];function Mo(e,t,n){switch(e){case"top":case"bottom":return n?t?sn:on:t?on:sn;case"left":case"right":return t?Po:Ao;default:return[]}}function Wi(e,t,n,r){const o=Un(e);let s=Mo(Kn(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Dt)))),s}function Ft(e){const t=Kn(e);return Co[t]+e.slice(t.length)}function Lo(e){return{top:0,right:0,bottom:0,left:0,...e}}function Vi(e){return typeof e!="number"?Lo(e):{top:e,right:e,bottom:e,left:e}}function _i(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Ze(e,t,n){return Math.floor(e/t)!==n}function an(e,t){return t<0||t>=e.current.length}function Bi(e,t){return se(e,{disabledIndices:t})}function ji(e,t){return se(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function se(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let s=t;do s+=n?-o:o;while(s>=0&&s<=e.current.length-1&&Wt(e,s,r));return s}function Hi(e,{event:t,orientation:n,loopFocus:r,rtl:o,cols:s,disabledIndices:i,minIndex:a,maxIndex:l,prevIndex:c,stopEvent:p=!1}){let u=c,b;if(t.key===mo?b="up":t.key===bo&&(b="down"),b){const g=[],v=[];let h=!1,y=0;{let C=null,M=-1;e.current.forEach((Y,H)=>{if(Y==null)return;y+=1;const D=Y.closest('[role="row"]');D&&(h=!0),(D!==C||M===-1)&&(C=D,M+=1,g[M]=[]),g[M].push(H),v[H]=M})}let R=!1,S=0;if(h)for(const C of g){const M=C.length;M>S&&(S=M),M!==s&&(R=!0)}const N=R&&y<e.current.length,w=S||s,m=C=>{if(!R||c===-1)return;const M=v[c];if(M==null)return;const Y=g[M].indexOf(c),H=C==="up"?-1:1;for(let D=M+H,T=0;T<g.length;T+=1,D+=H){if(D<0||D>=g.length){if(!r||N)return;D=D<0?g.length-1:0}const $=g[D];for(let z=Math.min(Y,$.length-1);z>=0;z-=1){const U=$[z];if(!Wt(e,U,i))return U}}},I=C=>{if(!N||c===-1)return;const M=c%w,Y=C==="up"?-w:w,H=l-l%w,D=St(l/w)+1;for(let T=c-M+Y,$=0;$<D;$+=1,T+=Y){if(T<0||T>l){if(!r)return;T=T<0?H:0}const z=Math.min(T+w-1,l);for(let U=Math.min(T+M,z);U>=T;U-=1)if(!Wt(e,U,i))return U}};p&&tt(t);const O=m(b)??I(b);if(O!==void 0)u=O;else if(c===-1)u=b==="up"?l:a;else if(u=se(e,{startingIndex:c,amount:w,decrement:b==="up",disabledIndices:i}),r){if(b==="up"&&(c-w<a||u<0)){const C=c%w,M=l%w,Y=l-(M-C);M===C?u=l:u=M>C?Y:Y-w}b==="down"&&c+w>l&&(u=se(e,{startingIndex:c%w-w,amount:w,disabledIndices:i}))}an(e,u)&&(u=c)}if(n==="both"){const g=St(c/s);t.key===(o?Et:vt)&&(p&&tt(t),c%s!==s-1?(u=se(e,{startingIndex:c,disabledIndices:i}),r&&Ze(u,s,g)&&(u=se(e,{startingIndex:c-c%s-1,disabledIndices:i}))):r&&(u=se(e,{startingIndex:c-c%s-1,disabledIndices:i})),Ze(u,s,g)&&(u=c)),t.key===(o?vt:Et)&&(p&&tt(t),c%s!==0?(u=se(e,{startingIndex:c,decrement:!0,disabledIndices:i}),r&&Ze(u,s,g)&&(u=se(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i}))):r&&(u=se(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i})),Ze(u,s,g)&&(u=c));const v=St(l/s)===g;an(e,u)&&(r&&v?u=t.key===(o?vt:Et)?l:se(e,{startingIndex:c-c%s-1,disabledIndices:i}):u=c)}return u}function $i(e,t,n){const r=[];let o=0;return e.forEach(({width:s,height:i},a)=>{let l=!1;for(;!l;){const c=[];for(let p=0;p<s;p+=1)for(let u=0;u<i;u+=1)c.push(o+p+u*t);o%t+s<=t&&c.every(p=>r[p]==null)?(c.forEach(p=>{r[p]=a}),l=!0):o+=1}}),[...r]}function Yi(e,t,n,r,o){if(e===-1)return-1;const s=n.indexOf(e),i=t[e];switch(o){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*r:s;case"br":return n.lastIndexOf(e);default:return-1}}function Gi(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function Wt(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const o=e.current[t];return o?qn(o)?!n&&(o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"):!0:!1}function qn(e){return dt(e).display!=="none"}var No=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],ot=No.join(","),zn=typeof Element>"u",Ne=zn?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,st=!zn&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},it=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):it(t.parentNode));return i},Do=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Xn=function(t,n,r){if(it(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(ot));return n&&Ne.call(t,ot)&&o.unshift(t),o=o.filter(r),o},at=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!it(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,c=at(l,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{var p=Ne.call(i,ot);p&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var u=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),b=!it(u,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(u&&b){var g=at(u===!0?i.children:u.children,!0,r);r.flatten?o.push.apply(o,g):o.push({scopeParent:i,candidates:g})}else s.unshift.apply(s,i.children)}}return o},Zn=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Jn=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Do(t))&&!Zn(t)?0:t.tabIndex},Fo=function(t,n){var r=Jn(t);return r<0&&n&&!Zn(t)?0:r},Wo=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Qn=function(t){return t.tagName==="INPUT"},Vo=function(t){return Qn(t)&&t.type==="hidden"},_o=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Bo=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},jo=function(t){if(!t.name)return!0;var n=t.form||st(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=Bo(o,t.form);return!s||s===t},Ho=function(t){return Qn(t)&&t.type==="radio"},$o=function(t){return Ho(t)&&!jo(t)},Yo=function(t){var n,r=t&&st(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,a,l;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var c,p,u;r=st(o),o=(c=r)===null||c===void 0?void 0:c.host,s=!!((p=o)!==null&&p!==void 0&&(u=p.ownerDocument)!==null&&u!==void 0&&u.contains(o))}}return s},cn=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},Go=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=Ne.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(Ne.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var c=t.parentElement,p=st(t);if(c&&!c.shadowRoot&&o(c)===!0)return cn(t);t.assignedSlot?t=t.assignedSlot:!c&&p!==t.ownerDocument?t=p.host:t=c}t=l}if(Yo(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return cn(t);return!1},Ko=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Ne.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Vt=function(t,n){return!(n.disabled||Vo(n)||Go(n,t)||_o(n)||Ko(n))},_t=function(t,n){return!($o(n)||Jn(n)<0||!Vt(t,n))},Uo=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},er=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,l=Fo(a,i),c=i?er(o.candidates):a;l===0?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:c})}),r.sort(Wo).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Ke=function(t,n){n=n||{};var r;return n.getShadowRoot?r=at([t],n.includeContainer,{filter:_t.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Uo}):r=Xn(t,n.includeContainer,_t.bind(null,n)),er(r)},qo=function(t,n){n=n||{};var r;return n.getShadowRoot?r=at([t],n.includeContainer,{filter:Vt.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Xn(t,n.includeContainer,Vt.bind(null,n)),r},tr=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Ne.call(t,ot)===!1?!1:_t(n,t)};function q(e){return e?.ownerDocument||document}const Fe=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function nr(e,t){const n=Ke(e,Fe()),r=n.length;if(r===0)return;const o=Ce(q(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function rr(e){return nr(q(e).body,1)||e}function or(e){return nr(q(e).body,-1)||e}function sr(e,t){if(!e)return null;const n=Ke(q(e).body,Fe()),r=n.length;if(r===0)return null;const o=n.indexOf(e);if(o===-1)return null;const s=(o+t+r)%r;return n[s]}function Ki(e){return sr(e,1)}function Ui(e){return sr(e,-1)}function Be(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!_(n,r)}function zo(e){Ke(e,Fe()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function un(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function wt(e){const t=ke(Xo,e).current;return t.next=e,j(t.effect),t}function Xo(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const Zo={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Jo={...Zo,position:"fixed",top:0,left:0},ct=d.forwardRef(function(t,n){const[r,o]=d.useState();j(()=>{oo&&o("button")},[]);const s={tabIndex:0,role:r};return re.jsx("span",{...t,ref:n,style:Jo,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});function ut(e){return`data-base-ui-${e}`}let ln=0;function Rt(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(ln);const s=()=>e?.focus({preventScroll:n});o?s():ln=requestAnimationFrame(s)}const Tt={inert:new WeakMap,"aria-hidden":new WeakMap},fn="data-base-ui-inert",Bt={inert:new WeakSet,"aria-hidden":new WeakSet};let Ve=new WeakMap,Ct=0;function Qo(e){return Bt[e]}function ir(e){return e?He(e)?e.host:ir(e.parentNode):null}const xt=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=ir(n);return e.contains(r)?r:null}).filter(n=>n!=null),dn=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},pn=(e,t,n)=>{const r=[],o=s=>{!s||n.has(s)||Array.from(s.children).forEach(i=>{$e(i)!=="script"&&(t.has(i)?o(i):r.push(i))})};return o(e),r};function es(e,t,n,r,{mark:o=!0,markerIgnoreElements:s=[]}){const i=r?"inert":n?"aria-hidden":null;let a=null,l=null;const c=xt(t,e),p=o?xt(t,s):[],u=new Set(p),b=o?pn(t,dn(c),new Set(c)).filter(h=>!u.has(h)):[],g=[],v=[];if(i){const h=Tt[i],y=Qo(i);l=y,a=h;const R=xt(t,Array.from(t.querySelectorAll("[aria-live]"))),S=c.concat(R);pn(t,dn(S),new Set(S)).forEach(w=>{const m=w.getAttribute(i),I=m!==null&&m!=="false",O=(h.get(w)||0)+1;h.set(w,O),g.push(w),O===1&&I&&y.add(w),I||w.setAttribute(i,i==="inert"?"":"true")})}return o&&b.forEach(h=>{const y=(Ve.get(h)||0)+1;Ve.set(h,y),v.push(h),y===1&&h.setAttribute(fn,"")}),Ct+=1,()=>{a&&g.forEach(h=>{const R=(a.get(h)||0)-1;a.set(h,R),R||(!l?.has(h)&&i&&h.removeAttribute(i),l?.delete(h))}),o&&v.forEach(h=>{const y=(Ve.get(h)||0)-1;Ve.set(h,y),y||h.removeAttribute(fn)}),Ct-=1,Ct||(Tt.inert=new WeakMap,Tt["aria-hidden"]=new WeakMap,Bt.inert=new WeakSet,Bt["aria-hidden"]=new WeakSet,Ve=new WeakMap)}}function gn(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:o=!0,markerIgnoreElements:s=[]}=t,i=q(e[0]).body;return es(e,i,n,r,{mark:o,markerIgnoreElements:s})}const ar=d.createContext(null),cr=()=>d.useContext(ar),ts=ut("portal");function ns(e={}){const{ref:t,container:n,componentProps:r=Me,elementProps:o}=e,s=Ge(),a=cr()?.portalNode,[l,c]=d.useState(null),[p,u]=d.useState(null),b=G(y=>{y!==null&&u(y)}),g=d.useRef(null);j(()=>{if(n===null){g.current&&(g.current=null,u(null),c(null));return}if(s==null)return;const y=(n&&(Gt(n)?n:n.current))??a??document.body;if(y==null){g.current&&(g.current=null,u(null),c(null));return}g.current!==y&&(g.current=y,u(null),c(y))},[n,a,s]);const v=Mr("div",r,{ref:[t,b],props:[{id:s,[ts]:""},o]});return{portalNode:p,portalSubtree:l&&v?$t.createPortal(v,l):null}}const qi=d.forwardRef(function(t,n){const{children:r,container:o,className:s,render:i,renderGuards:a,...l}=t,{portalNode:c,portalSubtree:p}=ns({container:o,ref:n,componentProps:t,elementProps:l}),u=d.useRef(null),b=d.useRef(null),g=d.useRef(null),v=d.useRef(null),[h,y]=d.useState(null),R=h?.modal,S=h?.open,N=typeof a=="boolean"?a:!!h&&!h.modal&&h.open&&!!c;d.useEffect(()=>{if(!c||R)return;function m(I){c&&I.relatedTarget&&Be(I)&&(I.type==="focusin"?un:zo)(c)}return c.addEventListener("focusin",m,!0),c.addEventListener("focusout",m,!0),()=>{c.removeEventListener("focusin",m,!0),c.removeEventListener("focusout",m,!0)}},[c,R]),d.useEffect(()=>{!c||S||un(c)},[S,c]);const w=d.useMemo(()=>({beforeOutsideRef:u,afterOutsideRef:b,beforeInsideRef:g,afterInsideRef:v,portalNode:c,setFocusManagerState:y}),[c]);return re.jsxs(d.Fragment,{children:[p,re.jsxs(ar.Provider,{value:w,children:[N&&c&&re.jsx(ct,{"data-type":"outside",ref:u,onFocus:m=>{if(Be(m,c))g.current?.focus();else{const I=h?h.domReference:null;or(I)?.focus()}}}),N&&c&&re.jsx("span",{"aria-owns":c.id,style:Nr}),c&&$t.createPortal(r,c),N&&c&&re.jsx(ct,{"data-type":"outside",ref:b,onFocus:m=>{if(Be(m,c))v.current?.focus();else{const I=h?h.domReference:null;rr(I)?.focus(),h?.closeOnFocusOut&&h?.onOpenChange(!1,Ae(Ln,m.nativeEvent))}}})]})]})});function ur(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class rs{nodesRef={current:[]};events=ur();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const lr=d.createContext(null),fr=d.createContext(null),pt=()=>d.useContext(lr)?.id||null,Kt=e=>{const t=d.useContext(fr);return e??t};function zi(e){const t=Ge(),n=Kt(e),r=pt();return j(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function Xi(e){const{children:t,id:n}=e,r=pt();return re.jsx(lr.Provider,{value:d.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Zi(e){const{children:t,externalTree:n}=e,r=ke(()=>n??new rs).current;return re.jsx(fr.Provider,{value:r,children:t})}function os(e,t){const n=ue(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const hn=20;let ye=[];function Ut(){ye=ye.filter(e=>e.deref()?.isConnected)}function ss(e){Ut(),e&&$e(e)!=="body"&&(ye.push(new WeakRef(e)),ye.length>hn&&(ye=ye.slice(-hn)))}function kt(){return Ut(),ye[ye.length-1]?.deref()}function is(e){if(!e)return null;const t=Fe();return tr(e,t)?e:Ke(e,t)[0]||e}function as(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():qn(e)}function mn(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Fe(),o=qo(e,n).filter(i=>{const a=i.getAttribute("data-tabindex")||"";return tr(i,n)||i.hasAttribute("data-tabindex")&&!a.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||o.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Ji(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:a=!0,closeOnFocusOut:l=!0,openInteractionType:c="",nextFocusableElement:p,previousFocusableElement:u,beforeContentFocusGuardRef:b,externalTree:g,getInsideElements:v}=e,h="rootStore"in t?t.rootStore:t,y=h.useState("open"),R=h.useState("domReferenceElement"),S=h.useState("floatingElement"),{events:N,dataRef:w}=h.context,m=G(()=>w.current.floatingContext?.nodeId),I=o===!1,O=nn(R)&&I,C=d.useRef(["content"]),M=wt(o),Y=wt(s),H=wt(c),D=Kt(g),T=cr(),$=d.useRef(!1),z=d.useRef(!1),U=d.useRef(!1),Ie=d.useRef(-1),Oe=d.useRef(""),Ee=d.useRef(""),Pe=d.useRef(null),V=d.useRef(null),ae=Xt(Pe,b,T?.beforeInsideRef),ve=Xt(V,T?.afterInsideRef),Se=rt(),ge=rt(),he=Hn(),ne=T!=null,L=Nt(S),le=G((k=L)=>k?Ke(k,Fe()):[]),te=G(()=>v?.().filter(k=>k!=null)??[]),we=G(k=>{const F=le(k);return C.current.map(()=>F).filter(Boolean).flat()});d.useEffect(()=>{if(r||!a)return;function k(B){B.key==="Tab"&&_(L,Ce(q(L)))&&le().length===0&&!O&&tt(B)}const F=q(L);return F.addEventListener("keydown",k),()=>{F.removeEventListener("keydown",k)}},[r,R,L,a,C,O,le,we]),d.useEffect(()=>{if(r||!y)return;const k=q(L);function F(){U.current=!1}function B(P){const A=pe(P),J=te(),x=_(S,A)||_(R,A)||_(T?.portalNode,A)||J.some(f=>f===A||_(f,A));U.current=!x,Ee.current=P.pointerType||"keyboard",A?.closest(`[${Lr}]`)&&(z.current=!0)}function Z(){Ee.current="keyboard"}return k.addEventListener("pointerdown",B,!0),k.addEventListener("pointerup",F,!0),k.addEventListener("pointercancel",F,!0),k.addEventListener("keydown",Z,!0),()=>{k.removeEventListener("pointerdown",B,!0),k.removeEventListener("pointerup",F,!0),k.removeEventListener("pointercancel",F,!0),k.removeEventListener("keydown",Z,!0)}},[r,S,R,L,y,T,te]),d.useEffect(()=>{if(r||!l)return;const k=q(L);function F(){z.current=!0,ge.start(0,()=>{z.current=!1})}function B(x){const f=pe(x),W=le().indexOf(f);W!==-1&&(Ie.current=W)}function Z(x){const f=x.relatedTarget,E=x.currentTarget,W=pe(x);queueMicrotask(()=>{const Q=m(),me=h.context.triggerElements,qe=te(),Re=f?.hasAttribute(ut("focus-guard"))&&[Pe.current,V.current,T?.beforeInsideRef.current,T?.afterInsideRef.current,T?.beforeOutsideRef.current,T?.afterOutsideRef.current,de(u),de(p)].includes(f),gt=!(_(R,f)||_(S,f)||_(f,S)||_(T?.portalNode,f)||qe.some(ee=>ee===f||_(ee,f))||f!=null&&me.hasElement(f)||me.hasMatchingElement(ee=>_(ee,f))||Re||D&&(Le(D.nodesRef.current,Q).find(ee=>_(ee.context?.elements.floating,f)||_(ee.context?.elements.domReference,f))||rn(D.nodesRef.current,Q).find(ee=>[ee.context?.elements.floating,Nt(ee.context?.elements.floating)].includes(f)||ee.context?.elements.domReference===f)));if(E===R&&L&&mn(L,C),i&&E!==R&&!as(W)&&Ce(k)===k.body){if(ie(L)&&(L.focus(),i==="popup")){he.request(()=>{L.focus()});return}const ee=Ie.current,X=le(),fe=X[ee]||X[X.length-1]||L;ie(fe)&&fe.focus()}if(w.current.insideReactTree){w.current.insideReactTree=!1;return}(O||!a)&&f&>&&!z.current&&(O||f!==kt())&&($.current=!0,h.setOpen(!1,Ae(Ln,x)))})}function P(){U.current||(w.current.insideReactTree=!0,Se.start(0,()=>{w.current.insideReactTree=!1}))}const A=ie(R)?R:null,J=[];if(!(!S&&!A))return A&&(A.addEventListener("focusout",Z),A.addEventListener("pointerdown",F),J.push(()=>{A.removeEventListener("focusout",Z),A.removeEventListener("pointerdown",F)})),S&&(S.addEventListener("focusin",B),S.addEventListener("focusout",Z),T&&(S.addEventListener("focusout",P,!0),J.push(()=>{S.removeEventListener("focusout",P,!0)})),J.push(()=>{S.removeEventListener("focusin",B),S.removeEventListener("focusout",Z)})),()=>{J.forEach(x=>{x()})}},[r,R,S,L,a,D,T,h,l,i,le,O,m,C,w,Se,ge,he,p,u,te]),d.useEffect(()=>{if(r||!S||!y)return;const k=Array.from(T?.portalNode?.querySelectorAll(`[${ut("portal")}]`)||[]),B=(D?rn(D.nodesRef.current,m()):[]).find(f=>nn(f.context?.elements.domReference||null))?.context?.elements.domReference,P=[...[S,...k,Pe.current,V.current,T?.beforeOutsideRef.current,T?.afterOutsideRef.current,...te()],B,de(u),de(p),O?R:null].filter(f=>f!=null),A=gn(P,{ariaHidden:a||O,mark:!1}),J=[S,...k].filter(f=>f!=null),x=gn(J);return()=>{x(),A()}},[y,r,R,S,a,C,T,O,D,m,p,u,te]),j(()=>{if(!y||r||!ie(L))return;const k=q(L),F=Ce(k);queueMicrotask(()=>{const B=we(L),Z=M.current,P=typeof Z=="function"?Z(H.current||""):Z;if(P===void 0||P===!1)return;let A;P===!0||P===null?A=B[0]||L:A=de(P),A=A||B[0]||L,!_(L,F)&&Rt(A,{preventScroll:A===L})})},[r,y,L,I,we,M,H]),j(()=>{if(r||!L)return;const k=q(L),F=Ce(k);ss(F);function B(P){if(P.open||(Oe.current=os(P.nativeEvent,Ee.current)),P.reason===jr&&P.nativeEvent.type==="mouseleave"&&($.current=!0),P.reason===Mn)if(P.nested)$.current=!1;else if(vo(P.nativeEvent)||So(P.nativeEvent))$.current=!1;else{let A=!1;document.createElement("div").focus({get preventScroll(){return A=!0,!1}}),A?$.current=!1:$.current=!0}}N.on("openchange",B);function Z(){const P=Y.current;let A=typeof P=="function"?P(Oe.current):P;if(A===void 0||A===!1)return null;if(A===null&&(A=!0),typeof A=="boolean"){const x=R||kt();return x&&x.isConnected?x:null}const J=R||kt();return de(A)||J||null}return()=>{N.off("openchange",B);const P=Ce(k),A=te(),J=_(S,P)||A.some(f=>f===P||_(f,P))||D&&Le(D.nodesRef.current,m(),!1).some(f=>_(f.context?.elements.floating,P)),x=Z();queueMicrotask(()=>{const f=is(x),E=typeof Y.current!="boolean";Y.current&&!$.current&&ie(f)&&(!(!E&&f!==P&&P!==k.body)||J)&&f.focus({preventScroll:!0}),$.current=!1})}},[r,S,L,Y,w,N,D,R,m,te]),j(()=>{if(!Vn||y||!S)return;const k=Ce(q(S));!ie(k)||!Gn(k)||_(S,k)&&k.blur()},[y,S]),j(()=>{if(!(r||!T))return T.setFocusManagerState({modal:a,closeOnFocusOut:l,open:y,onOpenChange:h.setOpen,domReference:R}),()=>{T.setFocusManagerState(null)}},[r,T,a,y,h,l,R]),j(()=>{if(!(r||!L))return mn(L,C),()=>{queueMicrotask(Ut)}},[r,L,C]);const Ue=!r&&(a?!O:!0)&&(ne||a);return re.jsxs(d.Fragment,{children:[Ue&&re.jsx(ct,{"data-type":"inside",ref:ae,onFocus:k=>{if(a){const F=we();Rt(F[F.length-1])}else T?.portalNode&&($.current=!1,Be(k,T.portalNode)?rr(R)?.focus():de(u??T.beforeOutsideRef)?.focus())}}),n,Ue&&re.jsx(ct,{"data-type":"inside",ref:ve,onFocus:k=>{a?Rt(we()[0]):T?.portalNode&&(l&&($.current=!0),Be(k,T.portalNode)?or(R)?.focus():de(p??T.afterOutsideRef)?.focus())}})]})}const cs={intentional:"onClick",sloppy:"onPointerDown"};function us(){return!1}function ls(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function Qi(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingElement"),{dataRef:s}=n.context,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="sloppy",referencePress:p=us,referencePressEvent:u="sloppy",bubbles:b,externalTree:g}=t,v=Kt(g),h=G(typeof l=="function"?l:()=>!1),y=typeof l=="function"?h:l,R=y!==!1,S=G(()=>c),N=d.useRef(!1),w=d.useRef(!1),m=d.useRef(!1),{escapeKey:I,outsidePress:O}=ls(b),C=d.useRef(null),M=rt(),Y=rt(),H=G(()=>{Y.clear(),s.current.insideReactTree=!1}),D=d.useRef(!1),T=d.useRef(""),$=G(p),z=G(V=>{if(!r||!i||!a||V.key!=="Escape"||D.current)return;const ae=s.current.floatingContext?.nodeId,ve=v?Le(v.nodesRef.current,ae):[];if(!I&&ve.length>0){let he=!0;if(ve.forEach(ne=>{ne.context?.open&&!ne.context.dataRef.current.__escapeKeyBubbles&&(he=!1)}),!he)return}const Se=Eo(V)?V.nativeEvent:V,ge=Ae(Hr,Se);n.setOpen(!1,ge),!I&&!ge.isPropagationAllowed&&V.stopPropagation()}),U=G(()=>{s.current.insideReactTree=!0,Y.start(0,H)});d.useEffect(()=>{if(!r||!i)return;s.current.__escapeKeyBubbles=I,s.current.__outsidePressBubbles=O;const V=new xe,ae=new xe;function ve(){V.clear(),D.current=!0}function Se(){V.start(Nn()?5:0,()=>{D.current=!1})}function ge(){m.current=!0,ae.start(0,()=>{m.current=!1})}function he(){N.current=!1,w.current=!1}function ne(){const f=T.current,E=f==="pen"||!f?"mouse":f,W=S(),Q=typeof W=="function"?W():W;return typeof Q=="string"?Q:Q[E]}function L(f){const E=ne();return E==="intentional"&&f.type!=="click"||E==="sloppy"&&f.type==="click"}function le(f){const E=s.current.floatingContext?.nodeId,W=v&&Le(v.nodesRef.current,E).some(Q=>oe(f,Q.context?.elements.floating));return oe(f,n.select("floatingElement"))||oe(f,n.select("domReferenceElement"))||W}function te(f){if(L(f)){H();return}if(s.current.insideReactTree){H();return}const E=pe(f),W=`[${ut("inert")}]`;let Q=Array.from(q(n.select("floatingElement")).querySelectorAll(W));const me=be(E)?E.getRootNode():null;He(me)&&(Q=Q.concat(Array.from(me.querySelectorAll(W))));const qe=n.context.triggerElements;if(E&&(qe.hasElement(E)||qe.hasMatchingElement(X=>_(X,E))))return;let Re=be(E)?E:null;for(;Re&&!_e(Re);){const X=nt(Re);if(_e(X)||!be(X))break;Re=X}if(Q.length&&be(E)&&!yo(E)&&!_(E,n.select("floatingElement"))&&Q.every(X=>!_(Re,X)))return;if(ie(E)&&!("touches"in f)){const X=_e(E),fe=dt(E),qt=/auto|scroll/,Tr=X||qt.test(fe.overflowX),Cr=X||qt.test(fe.overflowY),xr=Tr&&E.clientWidth>0&&E.scrollWidth>E.clientWidth,kr=Cr&&E.clientHeight>0&&E.scrollHeight>E.clientHeight,Ir=fe.direction==="rtl",Or=kr&&(Ir?f.offsetX<=E.offsetWidth-E.clientWidth:f.offsetX>E.clientWidth),Pr=xr&&f.offsetY>E.clientHeight;if(Or||Pr)return}if(le(f))return;if(ne()==="intentional"&&m.current){ae.clear(),m.current=!1;return}if(typeof y=="function"&&!y(f))return;const gt=s.current.floatingContext?.nodeId,ee=v?Le(v.nodesRef.current,gt):[];if(ee.length>0){let X=!0;if(ee.forEach(fe=>{fe.context?.open&&!fe.context.dataRef.current.__outsidePressBubbles&&(X=!1)}),!X)return}n.setOpen(!1,Ae(Mn,f)),H()}function we(f){ne()!=="sloppy"||f.pointerType==="touch"||!n.select("open")||!i||oe(f,n.select("floatingElement"))||oe(f,n.select("domReferenceElement"))||te(f)}function Ue(f){if(ne()!=="sloppy"||!n.select("open")||!i||oe(f,n.select("floatingElement"))||oe(f,n.select("domReferenceElement")))return;const E=f.touches[0];E&&(C.current={startTime:Date.now(),startX:E.clientX,startY:E.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},M.start(1e3,()=>{C.current&&(C.current.dismissOnTouchEnd=!1,C.current.dismissOnMouseDown=!1)}))}function k(f){T.current="touch";const E=pe(f);function W(){Ue(f),E?.removeEventListener(f.type,W)}E?.addEventListener(f.type,W)}function F(f){if(M.clear(),f.type==="pointerdown"&&(T.current=f.pointerType),f.type==="mousedown"&&C.current&&!C.current.dismissOnMouseDown)return;const E=pe(f);function W(){f.type==="pointerdown"?we(f):te(f),E?.removeEventListener(f.type,W)}E?.addEventListener(f.type,W)}function B(f){if(!N.current)return;const E=w.current;if(he(),ne()==="intentional"){if(f.type==="pointercancel"){E&&ge();return}if(!le(f)){if(E){ge();return}typeof y=="function"&&!y(f)||(ae.clear(),m.current=!0,H())}}}function Z(f){if(ne()!=="sloppy"||!C.current||oe(f,n.select("floatingElement"))||oe(f,n.select("domReferenceElement")))return;const E=f.touches[0];if(!E)return;const W=Math.abs(E.clientX-C.current.startX),Q=Math.abs(E.clientY-C.current.startY),me=Math.sqrt(W*W+Q*Q);me>5&&(C.current.dismissOnTouchEnd=!0),me>10&&(te(f),M.clear(),C.current=null)}function P(f){const E=pe(f);function W(){Z(f),E?.removeEventListener(f.type,W)}E?.addEventListener(f.type,W)}function A(f){ne()!=="sloppy"||!C.current||oe(f,n.select("floatingElement"))||oe(f,n.select("domReferenceElement"))||(C.current.dismissOnTouchEnd&&te(f),M.clear(),C.current=null)}function J(f){const E=pe(f);function W(){A(f),E?.removeEventListener(f.type,W)}E?.addEventListener(f.type,W)}const x=q(o);return a&&(x.addEventListener("keydown",z),x.addEventListener("compositionstart",ve),x.addEventListener("compositionend",Se)),R&&(x.addEventListener("click",F,!0),x.addEventListener("pointerdown",F,!0),x.addEventListener("pointerup",B,!0),x.addEventListener("pointercancel",B,!0),x.addEventListener("mousedown",F,!0),x.addEventListener("mouseup",B,!0),x.addEventListener("touchstart",k,!0),x.addEventListener("touchmove",P,!0),x.addEventListener("touchend",J,!0)),()=>{a&&(x.removeEventListener("keydown",z),x.removeEventListener("compositionstart",ve),x.removeEventListener("compositionend",Se)),R&&(x.removeEventListener("click",F,!0),x.removeEventListener("pointerdown",F,!0),x.removeEventListener("pointerup",B,!0),x.removeEventListener("pointercancel",B,!0),x.removeEventListener("mousedown",F,!0),x.removeEventListener("mouseup",B,!0),x.removeEventListener("touchstart",k,!0),x.removeEventListener("touchmove",P,!0),x.removeEventListener("touchend",J,!0)),V.clear(),ae.clear(),he(),m.current=!1}},[s,o,a,R,y,r,i,I,O,z,H,S,v,n,M]),d.useEffect(H,[y,H]);const Ie=d.useMemo(()=>({onKeyDown:z,[cs[u]]:V=>{$()&&n.setOpen(!1,Ae(Jt,V.nativeEvent))},...u!=="intentional"&&{onClick(V){$()&&n.setOpen(!1,Ae(Jt,V.nativeEvent))}}}),[z,n,u,$]),Oe=G(V=>{if(!r||!i||V.button!==0)return;const ae=pe(V.nativeEvent);_(n.select("floatingElement"),ae)&&(N.current||(N.current=!0,w.current=!1))}),Ee=G(V=>{!r||!i||(V.defaultPrevented||V.nativeEvent.defaultPrevented)&&N.current&&(w.current=!0)}),Pe=d.useMemo(()=>({onKeyDown:z,onPointerDown:Ee,onMouseDown:Ee,onClickCapture:U,onMouseDownCapture(V){U(),Oe(V)},onPointerDownCapture(V){U(),Oe(V)},onMouseUpCapture:U,onTouchEndCapture:U,onTouchMoveCapture:U}),[z,U,Oe,Ee]);return d.useMemo(()=>i?{reference:Ie,floating:Pe,trigger:Ie}:{},[i,Ie,Pe])}var lt=Symbol("NOT_FOUND");function fs(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function ds(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function ps(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var bn=e=>Array.isArray(e)?e:[e];function gs(e){const t=Array.isArray(e[0])?e[0]:e;return ps(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function hs(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}function ms(e){let t;return{get(n){return t&&e(t.key,n)?t.value:lt},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function bs(e,t){let n=[];function r(a){const l=n.findIndex(c=>t(a,c.key));if(l>-1){const c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return lt}function o(a,l){r(a)===lt&&(n.unshift({key:a,value:l}),n.length>e&&n.pop())}function s(){return n}function i(){n=[]}return{get:r,put:o,getEntries:s,clear:i}}var ys=(e,t)=>e===t;function Es(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:o}=n;for(let s=0;s<o;s++)if(!e(n[s],r[s]))return!1;return!0}}function vs(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=ys,maxSize:o=1,resultEqualityCheck:s}=n,i=Es(r);let a=0;const l=o<=1?ms(i):bs(o,i);function c(){let p=l.get(arguments);if(p===lt){if(p=e.apply(null,arguments),a++,s){const b=l.getEntries().find(g=>s(g.value,p));b&&(p=b.value,a!==0&&a--)}l.put(arguments,p)}return p}return c.clearCache=()=>{l.clear(),c.resetResultsCount()},c.resultsCount=()=>a,c.resetResultsCount=()=>{a=0},c}var Ss=class{constructor(e){this.value=e}deref(){return this.value}},ws=typeof WeakRef<"u"?WeakRef:Ss,Rs=0,yn=1;function Je(){return{s:Rs,v:void 0,o:null,p:null}}function dr(e,t={}){let n=Je();const{resultEqualityCheck:r}=t;let o,s=0;function i(){let a=n;const{length:l}=arguments;for(let u=0,b=l;u<b;u++){const g=arguments[u];if(typeof g=="function"||typeof g=="object"&&g!==null){let v=a.o;v===null&&(a.o=v=new WeakMap);const h=v.get(g);h===void 0?(a=Je(),v.set(g,a)):a=h}else{let v=a.p;v===null&&(a.p=v=new Map);const h=v.get(g);h===void 0?(a=Je(),v.set(g,a)):a=h}}const c=a;let p;if(a.s===yn)p=a.v;else if(p=e.apply(null,arguments),s++,r){const u=o?.deref?.()??o;u!=null&&r(u,p)&&(p=u,s!==0&&s--),o=typeof p=="object"&&p!==null||typeof p=="function"?new ws(p):p}return c.s=yn,c.v=p,p}return i.clearCache=()=>{n=Je(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function pr(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let s=0,i=0,a,l={},c=o.pop();typeof c=="object"&&(l=c,c=o.pop()),fs(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const p={...n,...l},{memoize:u,memoizeOptions:b=[],argsMemoize:g=dr,argsMemoizeOptions:v=[]}=p,h=bn(b),y=bn(v),R=gs(o),S=u(function(){return s++,c.apply(null,arguments)},...h),N=g(function(){i++;const m=hs(R,arguments);return a=S.apply(null,m),a},...y);return Object.assign(N,{resultFunc:c,memoizedResultFunc:S,dependencies:R,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>a,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:u,argsMemoize:g})};return Object.assign(r,{withTypes:()=>r}),r}var Ts=pr(dr),Cs=Object.assign((e,t=Ts)=>{ds(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((i,a,l)=>(i[n[l]]=a,i),{}))},{withTypes:()=>Cs});pr({memoize:vs,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const K=(e,t,n,r,o,s,...i)=>{if(i.length>0)throw new Error(On(1));let a;if(e)a=e;else throw new Error("Missing arguments");return a};var It={exports:{}},Ot={};var En;function xs(){if(En)return Ot;En=1;var e=In();function t(u,b){return u===b&&(u!==0||1/u===1/b)||u!==u&&b!==b}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(u,b){var g=b(),v=r({inst:{value:g,getSnapshot:b}}),h=v[0].inst,y=v[1];return s(function(){h.value=g,h.getSnapshot=b,l(h)&&y({inst:h})},[u,g,b]),o(function(){return l(h)&&y({inst:h}),u(function(){l(h)&&y({inst:h})})},[u]),i(g),g}function l(u){var b=u.getSnapshot;u=u.value;try{var g=b();return!n(u,g)}catch{return!0}}function c(u,b){return b()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Ot.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Ot}var vn;function gr(){return vn||(vn=1,It.exports=xs()),It.exports}var hr=gr(),Pt={exports:{}},At={};var Sn;function ks(){if(Sn)return At;Sn=1;var e=In(),t=gr();function n(c,p){return c===p&&(c!==0||1/c===1/p)||c!==c&&p!==p}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;return At.useSyncExternalStoreWithSelector=function(c,p,u,b,g){var v=s(null);if(v.current===null){var h={hasValue:!1,value:null};v.current=h}else h=v.current;v=a(function(){function R(I){if(!S){if(S=!0,N=I,I=b(I),g!==void 0&&h.hasValue){var O=h.value;if(g(O,I))return w=O}return w=I}if(O=w,r(N,I))return O;var C=b(I);return g!==void 0&&g(O,C)?(N=I,O):(N=I,w=C)}var S=!1,N,w,m=u===void 0?null:u;return[function(){return R(p())},m===null?void 0:function(){return R(m())}]},[p,u,b,g]);var y=o(c,v[0],v[1]);return i(function(){h.hasValue=!0,h.value=y},[y]),l(y),y},At}var wn;function Is(){return wn||(wn=1,Pt.exports=ks()),Pt.exports}var Os=Is();const jt=[];let Ht;function Ps(){return Ht}function As(e){jt.push(e)}function Ms(e){const t=(n,r)=>{const o=ke(Ls).current;let s;try{Ht=o;for(const i of jt)i.before(o);s=e(n,r);for(const i of jt)i.after(o);o.didInitialize=!0}finally{Ht=void 0}return s};return t.displayName=e.displayName||e.name,t}function ea(e){return d.forwardRef(Ms(e))}function Ls(){return{didInitialize:!1}}const Ns=Pn(19),Ds=Ns?Ws:Vs;function mr(e,t,n,r,o){return Ds(e,t,n,r,o)}function Fs(e,t,n,r,o){const s=d.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return hr.useSyncExternalStore(e.subscribe,s,s)}As({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],o=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,o))&&(t=!0,r.value=o,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const o of e.syncHooks)n.add(o.store);const r=[];for(const o of n)r.push(o.subscribe(t));return()=>{for(const o of r)o()}}),hr.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Ws(e,t,n,r,o){const s=Ps();if(!s)return Fs(e,t,n,r,o);const i=s.syncIndex;s.syncIndex+=1;let a;return s.didInitialize?(a=s.syncHooks[i],(a.store!==e||a.selector!==t||!Object.is(a.a1,n)||!Object.is(a.a2,r)||!Object.is(a.a3,o))&&(a.store!==e&&(s.didChangeStore=!0),a.store=e,a.selector=t,a.a1=n,a.a2=r,a.a3=o,a.didChange=!0)):(a={store:e,selector:t,a1:n,a2:r,a3:o,value:t(e.getSnapshot(),n,r,o),didChange:!1},s.syncHooks.push(a)),a.value}function Vs(e,t,n,r,o){return Os.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class _s{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,o){return mr(this,t,n,r,o)}}class Bs extends _s{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){d.useDebugValue(t),j(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;j(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);j(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){d.useDebugValue(t);const r=n!==void 0;j(()=>{r&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,r])}select(t,n,r,o){const s=this.selectors[t];return s(this.state,n,r,o)}useState(t,n,r,o){return d.useDebugValue(t),mr(this,this.selectors[t],n,r,o)}useContextCallback(t,n){d.useDebugValue(t);const r=G(n??An);this.context[t]=r}useStateSetter(t){const n=d.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(s=>{const i=r(s);if(!Object.is(o,i)){const a=o;o=i,n(i,a,this)}})}}const js={open:K(e=>e.open),domReferenceElement:K(e=>e.domReferenceElement),referenceElement:K(e=>e.positionReference??e.referenceElement),floatingElement:K(e=>e.floatingElement),floatingId:K(e=>e.floatingId)};class br extends Bs{constructor(t){const{nested:n,noEmit:r,onOpenChange:o,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:ur(),nested:n,noEmit:r,triggerElements:s},js)}setOpen=(t,n)=>{if((!t||!this.state.open||wo(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)}this.context.onOpenChange?.(t,n)}}function Hs(e,t){const n=d.useRef(null),r=d.useRef(null);return d.useCallback(o=>{if(e!==void 0){if(n.current!==null){const s=n.current,i=r.current,a=t.context.triggerElements.getById(s);i&&a===i&&t.context.triggerElements.delete(s),n.current=null,r.current=null}o!==null&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o))}},[t,e])}function ta(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=Hs(e,n),i=G(a=>{if(s(a),!a||!n.select("open"))return;const l=n.select("activeTriggerId");if(l===e){n.update({activeTriggerElement:a,...r});return}l==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...r})});return j(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:i,isMountedByThisTrigger:o}}function na(e){const t=e.useState("open");j(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,o]=n.value;e.update({activeTriggerId:r,activeTriggerElement:o})}}},[t,e])}function ra(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=fo(e);t.useSyncedValues({mounted:r,transitionStatus:s});const i=G(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return go({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:s}}class $s{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function Ys(){return new br({open:!1,floatingElement:null,referenceElement:null,triggerElements:new $s,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function oa(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:Ys(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Me,inactiveTriggerProps:Me,popupProps:Me}}const Qe=K(e=>e.triggerIdProp??e.activeTriggerId),sa={open:K(e=>e.openProp??e.open),mounted:K(e=>e.mounted),transitionStatus:K(e=>e.transitionStatus),floatingRootContext:K(e=>e.floatingRootContext),preventUnmountingOnClose:K(e=>e.preventUnmountingOnClose),payload:K(e=>e.payload),activeTriggerId:Qe,activeTriggerElement:K(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:K((e,t)=>t!==void 0&&Qe(e)===t),isOpenedByTrigger:K((e,t)=>t!==void 0&&Qe(e)===t&&e.open),isMountedByTrigger:K((e,t)=>t!==void 0&&Qe(e)===t&&e.mounted),triggerProps:K((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:K(e=>e.popupProps),popupElement:K(e=>e.popupElement),positionerElement:K(e=>e.positionerElement)};function ia(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:o}=e,s=Ge(),i=pt()!=null,a=t.useState("open"),l=t.useState("activeTriggerElement"),c=t.useState(r?"popupElement":"positionerElement"),p=t.context.triggerElements,u=ke(()=>new br({open:a,referenceElement:l,floatingElement:c,triggerElements:p,onOpenChange:o,floatingId:s,nested:i,noEmit:n})).current;return j(()=>{const b={open:a,floatingId:s,referenceElement:l,floatingElement:c};be(l)&&(b.domReferenceElement=l),u.state.positionReference===u.state.referenceElement&&(b.positionReference=l),u.update(b)},[a,s,l,c,u]),u.context.onOpenChange=o,u.context.nested=i,u.context.noEmit=n,u}function aa(e=[]){const t=e.map(c=>c?.reference),n=e.map(c=>c?.floating),r=e.map(c=>c?.item),o=e.map(c=>c?.trigger),s=d.useCallback(c=>et(c,e,"reference"),t),i=d.useCallback(c=>et(c,e,"floating"),n),a=d.useCallback(c=>et(c,e,"item"),r),l=d.useCallback(c=>et(c,e,"trigger"),o);return d.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:a,getTriggerProps:l}),[s,i,a,l])}function et(e,t,n){const r=new Map,o=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[Lt]="");for(const i in e)o&&e&&(i===$n||i===Yn)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let a;const l=t[i]?.[n];typeof l=="function"?a=e?l(e):null:a=l,a&&Rn(s,a,o,r)}return Rn(s,e,o,r),s}function Rn(e,t,n,r){for(const o in t){const s=t[o];n&&(o===$n||o===Yn)||(o.startsWith("on")?(r.has(o)||r.set(o,[]),typeof s=="function"&&(r.get(o)?.push(s),e[o]=(...i)=>r.get(o)?.map(a=>a(...i)).find(a=>a!==void 0))):e[o]=s)}}const Gs=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function ca(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),o=n.useState("floatingId"),s=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{role:a="dialog"}=t,l=Ge(),c=s?.id||l,p=d.useMemo(()=>Nt(i)?.id||o,[i,o]),u=Gs.get(a)??a,g=pt()!=null,v=d.useMemo(()=>u==="tooltip"||a==="label"?Me:{"aria-haspopup":u==="alertdialog"?"dialog":u,"aria-expanded":"false",...u==="listbox"&&{role:"combobox"},...u==="menu"&&g&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[u,g,a]),h=d.useMemo(()=>u==="tooltip"||a==="label"?{[`aria-${a==="label"?"labelledby":"describedby"}`]:r?p:void 0}:{...v,"aria-expanded":r?"true":"false","aria-controls":r?p:void 0,...u==="menu"&&{id:c}},[u,p,r,c,a,v]),y=d.useMemo(()=>{const S={id:p,...u&&{role:u}};return u==="tooltip"||a==="label"?S:{...S,...u==="menu"&&{"aria-labelledby":c}}},[u,p,c,a]),R=d.useCallback(({active:S,selected:N})=>{const w={role:"option",...S&&{id:`${p}-fui-option`}};switch(a){case"select":case"combobox":return{...w,"aria-selected":N}}return{}},[p,a]);return d.useMemo(()=>({reference:h,floating:y,item:R,trigger:v}),[h,y,v,R])}const yr="ArrowUp",Er="ArrowDown",vr="ArrowLeft",Sr="ArrowRight",wr="Home",Rr="End",Ks=new Set([vr,Sr]),Us=new Set([yr,Er]),qs=new Set([...Ks,...Us]);[...qs];const ua=new Set([yr,Er,vr,Sr,wr,Rr]);function la(e){return Pn(19)?e:e?"true":void 0}const fa=d.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const i=r?.getBoundingClientRect();s=`polygon(
|
|
2
|
+
0% 0%,
|
|
3
|
+
100% 0%,
|
|
4
|
+
100% 100%,
|
|
5
|
+
0% 100%,
|
|
6
|
+
0% 0%,
|
|
7
|
+
${i.left}px ${i.top}px,
|
|
8
|
+
${i.left}px ${i.bottom}px,
|
|
9
|
+
${i.right}px ${i.bottom}px,
|
|
10
|
+
${i.right}px ${i.top}px,
|
|
11
|
+
${i.left}px ${i.top}px
|
|
12
|
+
)`}return re.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});function da(e){const t=d.useRef(!0);t.current&&(t.current=!1,e())}let Tn={},Cn={},xn="";function zs(e){if(typeof document>"u")return!1;const t=q(e);return ue(t).innerWidth-t.documentElement.clientWidth>0}function Xs(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=q(e),r=n.documentElement,o=n.body,s=Ye(r)?r:o,i=s.style.overflowY,a=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const l=s.offsetWidth;s.style.overflowY="hidden";const c=s.offsetWidth;return s.style.overflowY=i,r.style.scrollbarGutter=a,l===c}function Zs(e){const t=q(e),n=t.documentElement,r=t.body,o=Ye(n)?n:r,s={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,s)}}function Js(e){const t=q(e),n=t.documentElement,r=t.body,o=ue(n);let s=0,i=0,a=!1;const l=ce.create();if(Vn&&(o.visualViewport?.scale??1)!==1)return()=>{};function c(){const b=o.getComputedStyle(n),g=o.getComputedStyle(r),y=(b.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,Tn={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},xn=n.style.scrollBehavior,Cn={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const R=n.scrollHeight>n.clientHeight,S=n.scrollWidth>n.clientWidth,N=b.overflowY==="scroll"||g.overflowY==="scroll",w=b.overflowX==="scroll"||g.overflowX==="scroll",m=Math.max(0,o.innerWidth-r.clientWidth),I=Math.max(0,o.innerHeight-r.clientHeight),O=parseFloat(g.marginTop)+parseFloat(g.marginBottom),C=parseFloat(g.marginLeft)+parseFloat(g.marginRight),M=Ye(n)?n:r;if(a=Xs(e),a){n.style.scrollbarGutter=y,M.style.overflowY="hidden",M.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:y,overflowY:"hidden",overflowX:"hidden"}),(R||N)&&(n.style.overflowY="scroll"),(S||w)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:O||I?`calc(100dvh - ${O+I}px)`:"100dvh",width:C||m?`calc(100vw - ${C+m}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function p(){Object.assign(n.style,Tn),Object.assign(r.style,Cn),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=xn)}function u(){p(),l.request(c)}return c(),o.addEventListener("resize",u),()=>{l.cancel(),p(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",u)}}class Qs{lockCount=0;restore=null;timeoutLock=xe.create();timeoutUnlock=xe.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const r=q(t).documentElement,o=ue(r).getComputedStyle(r).overflowY;if(o==="hidden"||o==="clip"){this.restore=An;return}const s=_n||!zs(t);this.restore=s?Zs(t):Js(t)}}const ei=new Qs;function pa(e=!0,t=null){j(()=>{if(e)return ei.acquire(t)},[e,t])}function ti(e){const t=d.useRef(""),n=d.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:d.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o?e(o,o.pointerType):e(o,t.current),t.current=""},[e]),onPointerDown:n}}function ni(e,t){const n=d.useRef(e),r=G(t);j(()=>{n.current!==e&&r(n.current)},[e,r]),j(()=>{n.current=e},[e])}function ga(e){const[t,n]=d.useState(null),r=G((i,a)=>{e||n(a||(_n?"touch":""))});ni(e,i=>{i&&!e&&n(null)});const{onClick:o,onPointerDown:s}=ti(r);return d.useMemo(()=>({openMethod:t,triggerProps:{onClick:o,onPointerDown:s}}),[t,o,s])}export{Kt as $,ko as A,Li as B,xo as C,Qt as D,be as E,Kr as F,Mi as G,ue as H,Zr as I,dt as J,St as K,ie as L,Ai as M,Nn as N,Ur as O,nt as P,_e as Q,Si as R,Xr as S,wi as T,$e as U,Ye as V,Ri as W,Ge as X,pt as Y,br as Z,$s as _,hi as a,na as a$,ut as a0,Ce as a1,_ as a2,ki as a3,gi as a4,pe as a5,Ii as a6,q as a7,oo as a8,Hr as a9,So as aA,mo as aB,qn as aC,ci as aD,go as aE,Mn as aF,Ji as aG,pi as aH,fi as aI,ua as aJ,qi as aK,ui as aL,po as aM,li as aN,fa as aO,la as aP,Xi as aQ,Ei as aR,Bs as aS,sa as aT,rs as aU,oa as aV,K as aW,Ms as aX,da as aY,zi as aZ,ga as a_,jn as aa,ho as ab,xe as ac,G as ad,jr as ae,Le as af,wt as ag,Nt as ah,nn as ai,Rt as aj,an as ak,Bi as al,ji as am,tt as an,bi as ao,$i as ap,Wt as aq,Hi as ar,Yi as as,bo as at,Et as au,vt as av,Gi as aw,se as ax,Ln as ay,vo as az,j as b,ra as b0,pa as b1,vi as b2,ia as b3,Qi as b4,ca as b5,ii as b6,aa as b7,Zi as b8,to as b9,ea as ba,ta as bb,yi as bc,Ui as bd,Be as be,Ki as bf,rr as bg,di as bh,ct as bi,ai as bj,mi as bk,Yt as bl,xi as c,Oi as d,Hn as e,rt as f,wo as g,Ae as h,Ci as i,Gn as j,Ni as k,Kn as l,Io as m,Ft as n,Fi as o,Wi as p,Di as q,Un as r,Ro as s,Jt as t,Ti as u,To as v,Oo as w,Vi as x,_i as y,Pi as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as f,B as N,t as P,p as a}from"./chunk-
|
|
1
|
+
import{A as f,B as N,t as P,p as a}from"./chunk-UVKPFVEO-YfSfkVr_.js";import{C as u,a as T,b,c as w}from"./button-Ba8FWhqs.js";import{B as C}from"./badge-DBD4CzAv.js";import{T as S,a as E,b as l,c as o,d as W,e as r}from"./table-Au2E5mnP.js";import{P as B}from"./pagination-BItl293Q.js";import{F as R}from"./filter-select-Tk_CBvrn.js";import{E as k}from"./error-card-D-uZRy_l.js";import{o as A,p as _,q as D,W as F,b as I}from"./db-link-CU7IJqbq.js";const M=N(function(){return a.jsx(k,{title:"Failed to load warnings",backTo:{href:"/",label:"Back to Dashboard"}})}),V=f(function({loaderData:p}){const{warnings:d,totalCount:x,page:i,totalPages:m,typeFilter:c}=p,[h,g]=P(),j=(e,s)=>{const n=new URLSearchParams(h);s?n.set(e,s):n.delete(e),n.delete("page"),g(n)},y=e=>{const s=new URLSearchParams(h);s.set("page",e.toString()),g(s)};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Warnings"}),a.jsxs("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:[x.toLocaleString()," warning",x!==1?"s":""," recorded"]})]}),a.jsxs(u,{children:[a.jsxs(T,{className:"flex flex-row items-center justify-between",children:[a.jsx(b,{children:"Warning History"}),a.jsx(R,{value:c,options:A,onChange:e=>j("type",e)})]}),a.jsx(w,{className:"p-0",children:a.jsxs(S,{children:[a.jsx(E,{children:a.jsxs(l,{children:[a.jsx(o,{children:"Type"}),a.jsx(o,{children:"Message"}),a.jsx(o,{children:"Details"}),a.jsx(o,{children:"Time"})]})}),a.jsx(W,{children:d.length===0?a.jsx(l,{children:a.jsx(r,{className:"text-center text-gray-500 dark:text-gray-400 py-8",colSpan:4,children:c?`No ${c.replace("_"," ")} warnings found`:"No warnings recorded. Enable persistWarnings in pg-boss config to capture warnings."})}):d.map(e=>a.jsxs(l,{children:[a.jsx(r,{children:a.jsx(L,{type:e.type})}),a.jsx(r,{className:"text-gray-900 dark:text-gray-100 max-w-md truncate",children:e.message}),a.jsx(r,{className:"font-mono text-xs text-gray-500 dark:text-gray-400 max-w-xs truncate",children:_(e.data)}),a.jsx(r,{className:"text-gray-500 dark:text-gray-400 whitespace-nowrap",children:D(new Date(e.createdOn))})]},e.id))})]})}),a.jsx(B,{page:i,totalPages:m,hasNextPage:i<m,hasPrevPage:i>1,onPageChange:y})]})]})});function L({type:t}){return a.jsx(C,{variant:I[t],size:"sm",children:F[t]})}export{M as ErrorBoundary,V as default};
|