import{d as y,ex as b,H as h,b as _,c as g,u as w}from"./registerWidgets.ca57da3e.js";import{e as F,a as C,b as k}from"./icons.1efe7950.js";import{a as x}from"./asyncComputed.ae0b6a3c.js";import{F as m}from"./forms.5015911b.js";import{_ as v}from"./CrudView.vue_vue_type_script_setup_true_lang.7b5510ae.js";import"./activeRecord.f8743cd4.js";import"./pubsub.277d05a3.js";import"./Modal.db45c3f3.js";import"./Title.e5d7f1b0.js";import"./transButton.a2961478.js";import"./index.b0c465bd.js";import"./Text.1f2709b6.js";import"./index.e15362b2.js";import"./index.9943ced7.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]="0c7e501c-6272-48d5-a54d-6dade3b59d2d",a._sentryDebugIdIdentifier="sentry-dbid-0c7e501c-6272-48d5-a54d-6dade3b59d2d")}catch{}})();const T=y({__name:"Forms",setup(a){const n=b(),{loading:s,result:r,refetch:d}=x(()=>m.list()),c=({key:e})=>n.push({path:`/_editor/form/${encodeURIComponent(e)}`}),l=async({key:e})=>{var o,t;await((t=(o=r.value)==null?void 0:o.find(i=>i.path===e))==null?void 0:t.duplicate()),d()},p=async()=>{const e=await m.create();c({key:e.path})},u=async({key:e})=>{var o,t;confirm("Are you sure you want to delete this form?")&&(await((t=(o=r.value)==null?void 0:o.find(i=>i.path===e))==null?void 0:t.delete()),d())},f=h(()=>{var e,o;return{columns:[{name:"Form Name"},{name:"Path"},{name:"Form Actions"}],rows:(o=(e=r.value)==null?void 0:e.map(t=>({key:t.path,cells:[{text:t.title,link:`/_editor/form/${encodeURIComponent(t.path)}`},{text:t.path},{text:"",actions:[{icon:F,label:"Edit Form",onClick:c},{icon:C,label:"Duplicate",onClick:l},{icon:k,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(_(),g(v,{loading:w(s),title:"Dynamic Python forms",description:"Create forms with advanced logic, easy integrations and custom branding.","create-button-text":"Create Form","empty-title":"No forms here yet","video-url":"https://www.youtube.com/embed/p6xf8PxL2Yg",table:f.value,"entity-name":"Form",onCreate:p},null,8,["loading","table"]))}});export{T as default};
//# sourceMappingURL=Forms.5ecf1446.js.map
