import{d as y,ez as w,G as g,b as h,c as F,u as _}from"./outputWidgets.3acae187.js";import{F as m}from"./forms.9608acc5.js";import{e as x,d as C}from"./icons.238cb834.js";import{a as k}from"./asyncComputed.4acb40f3.js";import{a as l}from"./ant-design.0486e70d.js";import{C as v}from"./CrudView.ad3897c2.js";import"./record.8667ddd6.js";import"./pubsub.bc590f31.js";import"./index.ea121cf6.js";import"./Title.b0254e64.js";import"./Form.01134ed5.js";import"./router.330b5ee2.js";import"./index.30e21000.js";import"./index.d2e87b7c.js";import"./url.ba80c662.js";import"./index.a63dba09.js";import"./index.72042afd.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new Error().stack;r&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[r]="58a1c431-2178-4dbb-96ef-f5dad8ed538b",o._sentryDebugIdIdentifier="sentry-dbid-58a1c431-2178-4dbb-96ef-f5dad8ed538b")}catch{}})();const $=y({__name:"Forms",setup(o){const r=w(),{loading:i,result:n,refetch:c}=k(()=>m.list()),s=({key:e})=>r.push({name:"formEditor",params:{id:e}}),u=async()=>{const e=await m.create();s({key:e.id})},p=async({key:e})=>{var t,d;const a=await l("Do you want to delete the .py file associated with this form?",{okText:"Yes",cancelText:"No"});await l("Are you sure you want to delete this form?")&&(await((d=(t=n.value)==null?void 0:t.find(b=>b.id===e))==null?void 0:d.delete(a)),c())},f=g(()=>{var e,a;return{columns:[{name:"Form Name"},{name:"Path"},{name:"File"},{name:"Actions",align:"right"}],rows:(a=(e=n.value)==null?void 0:e.map(t=>({key:t.id,cells:[{text:t.title,link:`/_editor/form/${encodeURIComponent(t.id)}`},{text:t.path},{text:t.file},{text:"",actions:[{icon:x,label:"Edit Form",onClick:s},{icon:C,label:"Delete",onClick:p,dangerous:!0}]}]})))!=null?a:[]}});return(e,a)=>(h(),F(v,{loading:_(i),title:"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:u},null,8,["loading","table"]))}});export{$ as default};
//# sourceMappingURL=Forms.51f928db.js.map
