import{I as F}from"./IdnodeGrid-U6EqXqja.js";import{d as O,u as z,o as K,e as _,f as b,g as A,i as $,t as j,h as e,I as P,F as q,bj as H,bk as J,r as Q,_ as W}from"./index-D92x6h1h.js";import{A as X}from"./ActionMenu-B3aKIJFu.js";import{u as Y}from"./useEditorMode-DvyB-mon.js";import{u as Z}from"./useBulkAction-UV8yZtrd.js";import{u as ee}from"./useIdnodeMove-BsPTueJd.js";import{b as te}from"./dvrToolbarHelpers-C5M0Cokf.js";import{B as T}from"./BooleanCell-BFiLlZVv.js";import{E as k}from"./EnumNameCell-BjJ4chu_.js";const oe={class:"esfilter-grid__empty"},L="-class,index",ie=O({__name:"EsfilterGridView",props:{apiBase:{},entityClass:{},storeKey:{},columns:{},entityLabel:{},countLabel:{}},setup(t){const{t:o}=z(),C=t,x=Q(L),{editingUuid:y,editingUuids:B,creatingBase:I,gridRef:g,editorLevel:S,editorList:M,openEditor:h,openCreate:V,closeEditor:N,flipToEdit:R}=Y({createBase:C.apiBase,editList:x,createList:L,urlSync:!1}),U=Z({endpoint:"idnode/delete",confirmText:o("Do you really want to delete the selected entries?"),confirmSeverity:"danger",failPrefix:o("Failed to delete")}),{moveInflight:v,moveSelected:w,canMove:E}=ee(g);function D(i,p){return[...te({selection:i,clearSelection:p,remove:U,onAdd:V,onEdit:h,addTooltip:o("Add a new {0} rule",C.entityLabel.toLowerCase())}),{id:"moveup",label:o("Move up"),tooltip:o("Move selected entries up"),icon:H,disabled:i.length===0||v.value||!E(i,"up"),onClick:()=>w("up",i)},{id:"movedown",label:o("Move down"),tooltip:o("Move selected entries down"),icon:J,disabled:i.length===0||v.value||!E(i,"down"),onClick:()=>w("down",i)}]}return(i,p)=>(K(),_(q,null,[b(F,{ref_key:"gridRef",ref:g,endpoint:`${t.apiBase}/grid`,"entity-class":t.entityClass,"help-page":`class/${t.entityClass}`,"notification-class":"esfilter",columns:t.columns,"store-key":t.storeKey,"default-sort":{key:"index",dir:"ASC"},"virtual-scroller-options":{itemSize:36,lazy:!1},"count-label":t.countLabel,"lock-level":"expert","edit-mode":"cell",class:"esfilter-grid__grid",onRowDblclick:p[0]||(p[0]=f=>e(h)([f]))},{empty:A(()=>[$("p",oe,j(e(o)("No {0} rules. Add one to filter elementary streams of this type per service.",t.entityLabel.toLowerCase())),1)]),toolbarActions:A(({selection:f,clearSelection:G})=>[b(X,{actions:D(f,G)},null,8,["actions"])]),_:1},8,["endpoint","entity-class","help-page","columns","store-key","count-label"]),b(P,{uuid:e(y),uuids:e(B),"create-base":e(I),level:e(S),list:e(M),title:e(y)?e(o)("Edit {0}",t.entityLabel):e(o)("Add {0}",t.entityLabel),onClose:e(N),onCreated:e(R)},null,8,["uuid","uuids","create-base","level","list","title","onClose","onCreated"])],64))}}),ye=W(ie,[["__scopeId","data-v-717a600e"]]),le={type:"api",uri:"language/locale"},ne={type:"api",uri:"service/list",params:{enum:1}},l={field:"enabled",sortable:!0,filterType:"boolean",width:100,minVisible:"phone",phoneOrder:1,cellComponent:T,editable:!0},n={field:"type",sortable:!0,filterType:"string",width:200,minVisible:"phone",phoneRole:"primary",editable:!0},u={field:"language",sortable:!0,filterType:"string",width:140,cellComponent:k,enumSource:le,editable:!0},se={field:"CAid",sortable:!0,filterType:"string",width:140,editable:!0},re={field:"CAprovider",sortable:!0,filterType:"string",width:160,editable:!0},s={field:"service",sortable:!0,filterType:"string",width:240,minVisible:"phone",phoneOrder:99,cellComponent:k,enumSource:ne,editable:!0},m={field:"sindex",sortable:!0,filterType:"numeric",width:120,editable:!0},r={field:"pid",sortable:!0,filterType:"numeric",width:100,editable:!0},a={field:"action",sortable:!0,filterType:"string",width:140,minVisible:"phone",phoneOrder:2,editable:!0},d={field:"log",sortable:!0,filterType:"boolean",width:80,cellComponent:T,editable:!0},c={field:"comment",sortable:!0,filterType:"string",width:280,editable:!0},ge=[l,n,u,s,m,r,a,d,c],he=[l,n,u,s,m,r,a,d,c],ve=[l,n,u,s,m,r,a,d,c],we=[l,n,u,s,m,r,a,d,c],Ee=[l,n,se,re,s,m,r,a,d,c],Ae=[l,n,u,s,r,a,d,c];export{ye as E,he as a,Ee as c,Ae as o,we as s,ve as t,ge as v};
