import{d as f,eA as k,G as y,b,c as g,u as h}from"./outputWidgets.a5fcf389.js";import{e as _,d as w}from"./icons.1a1dc210.js";import{a as H}from"./asyncComputed.b7d3265e.js";import{H as c}from"./hooks.abee2624.js";import{C}from"./CrudView.cee1047f.js";import{a as x}from"./ant-design.35ff28ee.js";import"./record.e2e84f62.js";import"./pubsub.903f7e54.js";import"./Text.d2260f67.js";import"./Base.175f3ec4.js";import"./transButton.fc314012.js";import"./router.8a74f04b.js";import"./Title.42ad4bfb.js";import"./index.39083dd8.js";import"./url.d6641ded.js";import"./index.48f4731a.js";import"./index.5b7d1aca.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="e7835b08-1461-4a62-90bb-e15376c677cc",r._sentryDebugIdIdentifier="sentry-dbid-e7835b08-1461-4a62-90bb-e15376c677cc")}catch{}})();const $=f({__name:"Hooks",setup(r){const a=k(),{loading:i,result:n,refetch:d}=H(()=>c.list()),s=({key:e})=>a.push({name:"hookEditor",params:{id:e}}),l=async()=>{const e=await c.create();s({key:e.id})},m=async({key:e})=>{var o,t;await x("Are you sure you want to delete this hook?")&&(await((t=(o=n.value)==null?void 0:o.find(u=>u.id===e))==null?void 0:t.delete()),d())},p=y(()=>{var e,o;return{columns:[{name:"Hook Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(e=n.value)==null?void 0:e.map(t=>({key:t.id,cells:[{text:t.title,link:`/_editor/hook/${encodeURIComponent(t.id)}`},{text:t.path},{text:"",actions:[{icon:_,label:"Edit Hook",onClick:s},{icon:w,label:"Delete",onClick:m,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(b(),g(C,{loading:h(i),title:"Hooks",description:"Trigger your Python scripts with a request.","create-button-text":"Create Hook","empty-title":"No hooks here yet",table:p.value,"entity-name":"Hook",onCreate:l},null,8,["loading","table"]))}});export{$ as default};
//# sourceMappingURL=Hooks.6458bdf6.js.map
