import{d as w,eA as b,G as g,b as h,c as F,u as _}from"./outputWidgets.6c6bbcfd.js";import{F as c}from"./forms.dc173d09.js";import{e as x,d as C}from"./icons.89c226d3.js";import{a as k}from"./asyncComputed.77186ed9.js";import{a as d}from"./ant-design.ff909c2a.js";import{C as v}from"./CrudView.520a43a0.js";import"./record.5aef9f17.js";import"./pubsub.ccb56b51.js";import"./transButton.2945a1d9.js";import"./Text.51d0b007.js";import"./Base.d198dcc9.js";import"./router.98f12fd8.js";import"./Title.307e6445.js";import"./index.d102918e.js";import"./url.bf2db6c1.js";import"./index.9883e2bc.js";import"./index.0e6e05b9.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},a=new Error().stack;a&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[a]="98f3c951-2c0f-4cf3-9a73-e52575492341",o._sentryDebugIdIdentifier="sentry-dbid-98f3c951-2c0f-4cf3-9a73-e52575492341")}catch{}})();const j=w({__name:"Forms",setup(o){const a=b(),{loading:i,result:n,refetch:l}=k(()=>c.list()),s=({key:e})=>a.push({name:"formEditor",params:{id:e}}),u=async()=>{const e=await c.create();s({key:e.id})},p=async({key:e})=>{var t,m;const r=await d("Do you want to delete the .py file associated with this form?",{okText:"Yes",cancelText:"No"});await d("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(r)),l())},f=g(()=>{var e,r;return{columns:[{name:"Form Name"},{name:"Path"},{name:"File"},{name:"Actions",align:"right"}],rows:(r=(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?r:[]}});return(e,r)=>(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{j as default};
//# sourceMappingURL=Forms.bb7ec004.js.map
