1import{b1 as F,p as N,o as b,aH as L}from"./weAkk1de.js";import{_ as S}from"./lh64Fc8i.js";import{_ as $}from"./CdSlfsK1.js";import{d as D,x as z,v as E,aP as H,aq as I,c as _,E as m,D as r,F as l,P as n,h as e,V as u,M as Q,N as R,C as U,H as j,Z as q,Y as M}from"./DlFYsrWP.js";import"./BB9DC0K4.js";const O={class:""},T={class:"flex justify-between items-center mb-4"},W={class:"grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-2"},Y={key:0,class:"min-h-36 grid place-content-center"},se=D({__name:"index",async setup(Z){let a,d;const{isAdmin:g}=z();F();const f=E(),y={cursor:"",category:"",search:"",per_page:10,direction:"desc",type:"main"},{values:i,setFieldValue:v,setValues:G}=N({formOptions:{initialValues:y},onLoadingData:()=>B(),onBeforeSetQueryItems:(c,t)=>{if(c.cursor===t.cursor)return{cursor:""}}}),{data:p,status:h,error:x,execute:B}=([a,d]=H(async()=>I("prompter-list",async()=>(await f.prompter.categories.index({...i}))._data,{default:()=>[],server:!1})),a=await a,d(),a),o=_(()=>p.value?.data||[]),C=_(()=>p.value.meta);return(c,t)=>{const V=b,w=S,P=$,A=q,k=L;return r(),m("div",O,[l("div",T,[t[2]||(t[2]=l("div",{class:""},null,-1)),n(V,{modelValue:e(i).search,"onUpdate:modelValue":t[0]||(t[0]=s=>e(i).search=s),icon:"search",size:"sm",clear:"","custom-input-classes":"bg-white",placeholder:"Start typing...",class:"lg:max-w-sm",name:"search"},null,8,["modelValue"])]),n(w,{class:"my-4"}),n(k,{"static-slot":"",navigation:e(C),"show-not-found":e(o)&&!e(o).length,status:e(h),items:e(o),errors:e(x),"page-items":"","page-key":"per_page",onSetPage:t[1]||(t[1]=s=>e(v)("cursor",s))},{empty:u(()=>[e(g)?(r(),m("div",Y,[n(A,{icon:"add",color:"primary",to:"/prompt-central/app/categories/add"},{default:u(()=>[...t[3]||(t[3]=[M(" Add Category ",-1)])]),_:1})])):j("",!0)]),default:u(()=>[l("div",W,[(r(!0),m(Q,null,R(e(o),s=>(r(),U(P,{key:s?.id,cat:s},null,8,["cat"]))),128))])]),_:1},8,["navigation","show-not-found","status","items","errors"])])}}});export{se as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.