import"./DsnmJJEf.js";import{i as W}from"./zNh6Oe5P.js";import{f as S,j as t,k as p,r as a,t as L,v as _,c as u,z as N,D as A,p as X,u as T,n as P,d as Y}from"./sWNKMed7.js";import{p as s,i as I}from"./Ccl3fNd2.js";import{s as Z,h as $,B as F,d as B,c as ee}from"./D30EsFKH.js";import{D as te,G as ae,a as se}from"./I29fo47B.js";import{E as le}from"./DHJFrtJ4.js";import{S as G}from"./CE4EvFNL.js";var ne=S('<div class="flex-shrink-0"><!></div>'),ie=S('<div class="mt-4 sm:mt-0 flex space-x-3"><!> <!></div>'),re=S('<div class="bg-white dark:bg-gray-800 shadow rounded-lg"><div class="px-4 py-5 sm:p-6"><div class="sm:flex sm:items-center sm:justify-between"><div class="flex items-center space-x-3"><!> <div><h1> </h1> <p class="text-sm text-gray-500 dark:text-gray-400"> </p></div></div> <!></div></div></div>');function ge(j,e){let n=s(e,"title",8),E=s(e,"subtitle",8),b=s(e,"forgeIcon",8,""),f=s(e,"onEdit",8,null),h=s(e,"onDelete",8,null),k=s(e,"editLabel",8,"Edit"),z=s(e,"deleteLabel",8,"Delete"),g=s(e,"titleClass",8,"");var c=re(),v=t(c),m=t(v),y=t(m),C=t(y);{var H=i=>{var r=ne(),w=t(r);$(w,b),a(r),u(i,r)};I(C,i=>{b()&&i(H)})}var l=p(C,2),D=t(l),V=t(D,!0);a(D);var M=p(D,2),R=t(M,!0);a(M),a(l),a(y);var q=p(y,2);{var J=i=>{var r=ie(),w=t(r);{var K=o=>{F(o,{variant:"secondary",size:"md",icon:"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z'/>",$$events:{click(...d){f()?.apply(this,d)}},children:(d,U)=>{N();var x=A();L(()=>_(x,k())),u(d,x)},$$slots:{default:!0}})};I(w,o=>{f()&&o(K)})}var O=p(w,2);{var Q=o=>{F(o,{variant:"danger",size:"md",icon:"<path stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16'/>",$$events:{click(...d){h()?.apply(this,d)}},children:(d,U)=>{N();var x=A();L(()=>_(x,z())),u(d,x)},$$slots:{default:!0}})};I(O,o=>{h()&&o(Q)})}a(r),u(i,r)};I(q,i=>{(f()||h())&&i(J)})}a(m),a(v),a(c),L(()=>{Z(D,1,`text-2xl font-bold text-gray-900 dark:text-white ${g()??""}`),_(V,n()),_(R,E())}),u(j,c)}var oe=S('<div class="bg-white dark:bg-gray-800 shadow rounded-lg"><div class="px-4 py-5 sm:p-6"><div class="flex items-center justify-between mb-4"><h2 class="text-lg font-medium text-gray-900 dark:text-white"> </h2> <a class="text-sm text-blue-600 dark:text-blue-400 hover:text-blue-500 dark:hover:text-blue-300">View all instances</a></div> <!></div></div>');function ye(j,e){X(e,!1);let n=s(e,"instances",8),E=s(e,"entityType",8),b=s(e,"onDeleteInstance",8);const f=[{key:"name",title:"Name",cellComponent:le,cellProps:{entityType:"instance",nameField:"name"}},{key:"status",title:"Status",cellComponent:G,cellProps:{statusType:"instance",statusField:"status"}},{key:"runner_status",title:"Runner Status",cellComponent:G,cellProps:{statusType:"instance",statusField:"runner_status"}},{key:"created",title:"Created",cellComponent:ae,cellProps:{field:"created_at",type:"date"}},{key:"actions",title:"Actions",align:"right",cellComponent:se,cellProps:{actions:[{type:"delete",label:"Delete",title:"Delete instance",ariaLabel:"Delete instance",action:"delete"}]}}],h={entityType:"instance",primaryText:{field:"name",isClickable:!0,href:"/instances/{name}"},secondaryText:{field:"provider_id"},badges:[{type:"status",field:"status"}],actions:[{type:"delete",handler:l=>k(l)}]};function k(l){b()(l)}function z(l){k(l.detail.item)}W();var g=oe(),c=t(g),v=t(c),m=t(v),y=t(m);a(m);var C=p(m,2);a(v);var H=p(v,2);te(H,{get columns(){return f},get data(){return n()},loading:!1,error:"",searchTerm:"",showSearch:!1,showPagination:!1,currentPage:1,get perPage(){return P(n()),T(()=>n().length)},totalPages:1,get totalItems(){return P(n()),T(()=>n().length)},itemName:"instances",emptyTitle:"No instances running",get emptyMessage(){return`No instances running for this ${E()??""}.`},emptyIconType:"cog",get mobileCardConfig(){return h},$$events:{delete:z}}),a(c),a(g),L(l=>{_(y,`Instances (${P(n()),T(()=>n().length)??""})`),ee(C,"href",l)},[()=>(P(B),T(()=>B("/instances")))]),u(j,g),Y()}export{ge as D,ye as I};
