import{d as y,ex as b,H as h,b as g,c as w,u as _}from"./registerWidgets.e46eca28.js";import{a as F,e as C,b as k}from"./icons.db549bc5.js";import{a as x}from"./asyncComputed.15fd30e0.js";import{F as l}from"./forms.e1efaa71.js";import{R as v}from"./RuntimeList.972c6970.js";import"./activeRecord.d83b1b14.js";import"./pubsub.8f2ecd1e.js";import"./DropdownMenu.dd15f4e3.js";import"./CircularLoading.484aa2f6.js";import"./lottie.2b81658b.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]="0287d2a7-80a3-4d4d-8209-55cfddad9095",a._sentryDebugIdIdentifier="sentry-dbid-0287d2a7-80a3-4d4d-8209-55cfddad9095")}catch{}})();const $=y({__name:"Forms",setup(a){const n=b(),{loading:i,result:r,refetch:d}=x(()=>l.list()),c=({key:e})=>n.push({path:`/_editor/form/${encodeURIComponent(e)}`}),m=async({key:e})=>{var o,t;await((t=(o=r.value)==null?void 0:o.find(s=>s.path===e))==null?void 0:t.duplicate()),d()},u=async()=>{const e=await l.create();c({key:e.path})},p=async({key:e})=>{var o,t;confirm("Are you sure you want to delete this form?")&&(await((t=(o=r.value)==null?void 0:o.find(s=>s.path===e))==null?void 0:t.delete()),d())},f=h(()=>{var e,o;return{columns:[{name:"Form Name"},{name:"Path"},{name:"Form Actions"}],rows:(o=(e=r.value)==null?void 0:e.map(t=>({key:t.path,cells:[{text:t.title,classes:["title","centered"],link:`/_editor/form/${encodeURIComponent(t.path)}`},{text:t.path},{text:"",classes:["centered"],actions:[{icon:F,label:"Delete",onClick:p,dangerous:!0},{icon:C,label:"Edit Form",onClick:c},{icon:k,label:"Duplicate",onClick:m}]}]})))!=null?o:[]}});return(e,o)=>(g(),w(v,{loading:_(i),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,onCreate:u},null,8,["loading","table"]))}});export{$ as default};
//# sourceMappingURL=Forms.60cb5718.js.map
