import{d as b,ez as k,J as y,b as h,c as _,u as g}from"./outputWidgets.17392370.js";import{e as w,a as H,b as C}from"./icons.baa5f07a.js";import{a as I}from"./asyncComputed.76849272.js";import{H as d}from"./hooks.5364daac.js";import{_ as x}from"./CrudView.vue_vue_type_script_setup_true_lang.c4e89a02.js";import{a as D}from"./ant-design.9c3ff8a2.js";import"./activeRecord.84b679f6.js";import"./pubsub.fc739490.js";import"./index.8d8985c7.js";import"./Title.bc3ff086.js";import"./Form.e398e550.js";import"./index.56ff0f0c.js";import"./index.fffd13c2.js";import"./index.8c91651f.js";import"./index.1fd97730.js";import"./index.ba0ff767.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="47096c42-d0eb-411f-9d09-b00b0ae9c82b",a._sentryDebugIdIdentifier="sentry-dbid-47096c42-d0eb-411f-9d09-b00b0ae9c82b")}catch{}})();const j=b({__name:"Hooks",setup(a){const n=k(),{loading:s,result:i,refetch:c}=I(()=>d.list()),l=({key:e})=>n.push({path:`/_editor/hook/${encodeURIComponent(e)}`}),p=async({key:e})=>{var o,t;await((t=(o=i.value)==null?void 0:o.find(r=>r.path===e))==null?void 0:t.duplicate()),c()},u=async()=>{const e=await d.create();l({key:e.path})},m=async({key:e})=>{var o,t;await D("Are you sure you want to delete this hook?")&&(await((t=(o=i.value)==null?void 0:o.find(r=>r.path===e))==null?void 0:t.delete()),c())},f=y(()=>{var e,o;return{columns:[{name:"Hook Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(e=i.value)==null?void 0:e.map(t=>({key:t.path,cells:[{text:t.title,link:`/_editor/hook/${encodeURIComponent(t.path)}`},{text:t.path},{text:"",actions:[{icon:w,label:"Edit Hook",onClick:l},{icon:H,label:"Duplicate",onClick:p},{icon:C,label:"Delete",onClick:m,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(h(),_(x,{loading:g(s),title:"Python Hooks",description:"Trigger your Python scripts with a request.","create-button-text":"Create Hook","empty-title":"No hooks here yet",table:f.value,"entity-name":"Hook",onCreate:u},null,8,["loading","table"]))}});export{j as default};
//# sourceMappingURL=Hooks.c588c9b3.js.map
