import{o as e}from"./rolldown-runtime-FhOqtrmT.js";import{n as t,r as n,t as r}from"./cn-BOQea7EA.js";import{hn as i}from"./vendor-core-CvqwRnws.js";import{Ki as a,Mi as o,ia as s,ra as c}from"./vendor-react-Vbe32VU9.js";var l=e(s(),1);function u(){let[e,t]=(0,l.useState)(n.getAllConnections());return(0,l.useEffect)(()=>n.listenToAllEntities((n,r)=>{t({...e,[r]:n})}),[e]),e}function d(){let e=n.calculateIdFromEntity(t),[r,i]=(0,l.useState)(n.getConnectionById(t));return(0,l.useEffect)(()=>n.listenToEntity(e,i),[e]),r}function f(){return d()}function p(){let{user:e}=f();return e?.fabricRole===`fabric_admin`||e?.fabricRole===`super_user`}function m(e){let r=t,{clusterId:i,instanceId:o}=a({strict:!1}),[s,c]=(0,l.useState)(n.getConnectionById(r??o??i));return(0,l.useEffect)(()=>n.listenToEntity(r,c),[r]),s}var h=`hover:-translate-y-1 transition duration-200`,g=`border bg-transparent border-2 text-white shadow-xs hover:bg-grey-700/40`,_=i(`inline-flex
  items-center
  justify-center
  gap-2
  whitespace-nowrap
  rounded-lg
  text-sm
  transition-[color,box-shadow]
  disabled:pointer-events-none
  disabled:opacity-50
  [&_svg]:pointer-events-none
  [&_svg:not([class*='size-'])]:size-4
  [&_svg]:shrink-0
  ring-ring/10
  dark:ring-ring/20
  dark:outline-ring/40
  outline-ring/50
  focus-visible:ring-1
  focus-visible:outline-1
  focus-visible:ring-purple-200
  aria-invalid:focus-visible:ring-0`,{variants:{variant:{default:`bg-primary text-primary-foreground shadow-sm hover:bg-primary/90`,submit:`bg-gradient-to-r from-blue-100 from-0% to-blue to-100% hover:bg-gradient-to-r hover:from-blue text-primary-foreground shadow-sm`,destructive:`bg-destructive shadow-xs hover:bg-destructive/90`,secondary:`bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-muted-foreground`,destructiveGhost:`hover:bg-accent hover:text-red`,link:`text-primary underline-offset-4 hover:underline`,positive:`bg-green text-white shadow-xs hover:bg-green/90`,warning:`bg-yellow text-white shadow-xs hover:bg-yellow/90`,outline:`${g} ${h}`,ghostOutline:`${g} ${h} border-none`,positiveOutline:`${g} ${h} border-green`,destructiveOutline:`${g} ${h} border-destructive`,defaultOutline:`${g} ${h} border-primary`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,sm:`h-8 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4 text-md`,icon:`size-9`}},defaultVariants:{variant:`default`,size:`default`}}),v=c();function y({className:e,variant:t,size:n,asChild:i=!1,...a}){return(0,v.jsx)(i?o:`button`,{"data-slot":`button`,className:r(_({variant:t,size:n,className:e})),...a})}export{d as a,m as i,p as n,u as o,f as r,y as t};
//# sourceMappingURL=button-BxVMmVxn.js.map