import{d as y,eA as b,G as g,b as h,c as w,u as _}from"./outputWidgets.562826ac.js";import{e as C,a as F,b as k}from"./icons.63405824.js";import{a as x}from"./asyncComputed.df2d9552.js";import{F as l}from"./forms.5ca19b70.js";import{C as v}from"./CrudView.6f7097f4.js";import{a as I}from"./ant-design.1ee2ab2c.js";import"./activeRecord.6bb1bd7f.js";import"./pubsub.7185b91b.js";import"./Text.712cfc26.js";import"./Base.bf8dc0b1.js";import"./FormItem.fc4e7da8.js";import"./transButton.17480f27.js";import"./router.e5ce2c0b.js";import"./Title.f7aaa881.js";import"./index.82606edc.js";import"./url.5a1383d2.js";import"./index.01bf1f2c.js";import"./index.583cd440.js";import"./index.9cdd1b35.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new Error().stack;r&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[r]="5b1a56c9-88ac-4cf7-99a3-63560731d983",a._sentryDebugIdIdentifier="sentry-dbid-5b1a56c9-88ac-4cf7-99a3-63560731d983")}catch{}})();const H=y({__name:"Forms",setup(a){const r=b(),{loading:s,result:n,refetch:m}=x(()=>l.list()),c=({key:e})=>r.push({path:`/_editor/form/${encodeURIComponent(e)}`}),d=async({key:e})=>{var o,t;await((t=(o=n.value)==null?void 0:o.find(i=>i.path===e))==null?void 0:t.duplicate()),m()},p=async()=>{const e=await l.create();c({key:e.path})},u=async({key:e})=>{var o,t;await I("Are you sure you want to delete this form?")&&(await((t=(o=n.value)==null?void 0:o.find(i=>i.path===e))==null?void 0:t.delete()),m())},f=g(()=>{var e,o;return{columns:[{name:"Form Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(e=n.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:C,label:"Edit Form",onClick:c},{icon:F,label:"Duplicate",onClick:d},{icon:k,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(h(),w(v,{loading:_(s),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:p},null,8,["loading","table"]))}});export{H as default};
//# sourceMappingURL=Forms.c12a7ac2.js.map
