import{d as y,ez as b,J as h,b as g,c as _,u as w}from"./outputWidgets.b43a489b.js";import{e as F,a as C,b as k}from"./icons.de9af46a.js";import{a as x}from"./asyncComputed.a42e75bb.js";import{F as d}from"./forms.83be8c86.js";import{_ as v}from"./CrudView.vue_vue_type_script_setup_true_lang.85d5e2a7.js";import{a as D}from"./ant-design.dc7acb1e.js";import"./activeRecord.2bc5cc59.js";import"./pubsub.6fd47a9d.js";import"./index.85f24c29.js";import"./Title.47040052.js";import"./Form.1797df89.js";import"./index.0279b5ff.js";import"./index.e641ddba.js";import"./index.8a60ee51.js";import"./index.9367a16c.js";import"./index.65dea612.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]="b10781e8-0cd1-4d23-8d6e-370801a0196c",a._sentryDebugIdIdentifier="sentry-dbid-b10781e8-0cd1-4d23-8d6e-370801a0196c")}catch{}})();const j=y({__name:"Forms",setup(a){const n=b(),{loading:s,result:r,refetch:m}=x(()=>d.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()),m()},p=async()=>{const e=await d.create();c({key:e.path})},u=async({key:e})=>{var o,t;await D("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()),m())},f=h(()=>{var e,o;return{columns:[{name:"Form Name"},{name:"Path"},{name:"Actions",align:"right"}],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{j as default};
//# sourceMappingURL=Forms.f1ccb348.js.map
