import{d as b,ex as y,F as h,b as g,u as w,bu as _}from"./registerWidgets.751c4cc6.js";import{e as F,f as C,g as k}from"./icons.839289ff.js";import{a as v}from"./asyncComputed.4ba8b2d8.js";import{F as m}from"./forms.bb29688a.js";import{R as x}from"./RuntimeList.7f256299.js";import"./activeRecord.91f4e05e.js";import"./pubsub.87f27d54.js";import"./DropdownMenu.3730f8d7.js";import"./CircularLoading.7ae0ffc2.js";import"./lottie.2da9cd67.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]="a491feb1-03cb-4b43-a112-0a0363fc00a4",a._sentryDebugIdIdentifier="sentry-dbid-a491feb1-03cb-4b43-a112-0a0363fc00a4")}catch{}})();const G=b({__name:"Forms",setup(a){const n=y(),{loading:i,result:r,refetch:c}=v(()=>m.list()),l=({key:e})=>n.push({path:`/_editor/form/${encodeURIComponent(e)}`}),d=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()),c()},u=async()=>{const e=await m.create();l({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()),c())},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:l},{icon:k,label:"Duplicate",onClick:d}]}]})))!=null?o:[]}});return(e,o)=>(g(),w(x,{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/tN7SRGmVPwc",table:f.value,onCreate:u},null,8,["loading","table"]))}});export{G as default};
//# sourceMappingURL=Forms.61ce07ed.js.map
