import{d as b,ez as w,G as g,b as h,c as F,u as _}from"./outputWidgets.723dbd35.js";import{F as d}from"./forms.f3fa32b1.js";import{e as x,d as C}from"./icons.d199659e.js";import{a as k}from"./asyncComputed.6087fd05.js";import{a as l}from"./ant-design.64772334.js";import{C as v}from"./CrudView.ca2cf6ee.js";import"./record.c3c42720.js";import"./pubsub.97441533.js";import"./index.c827a0f6.js";import"./Title.ad9727d9.js";import"./Form.71a7af16.js";import"./router.c09623bf.js";import"./index.b41dfd0a.js";import"./index.d0473694.js";import"./url.c8598ea1.js";import"./index.4913d787.js";import"./index.f91ebf4c.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]="49aa6109-4ab4-4f5e-86fc-0cbd8ef29811",o._sentryDebugIdIdentifier="sentry-dbid-49aa6109-4ab4-4f5e-86fc-0cbd8ef29811")}catch{}})();const $=b({__name:"Forms",setup(o){const r=w(),{loading:i,result:n,refetch:c}=k(()=>d.list()),s=({key:e})=>r.push({name:"formEditor",params:{id:e}}),u=async()=>{const e=await d.create();s({key:e.id})},p=async({key:e})=>{var t,m;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((m=(t=n.value)==null?void 0:t.find(y=>y.id===e))==null?void 0:m.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.0fff10cc.js.map
