import{d as b,ey as y,H as h,b as g,c as w,u as _}from"./outputWidgets.a8447bcb.js";import{e as C,a as F,b as k}from"./icons.6de7af10.js";import{a as x}from"./asyncComputed.6c2627ea.js";import{F as c}from"./forms.2a06fab8.js";import{C as v}from"./CrudView.996cd8b2.js";import{a as D}from"./ant-design.1bcd10c9.js";import"./activeRecord.52c1b6f8.js";import"./pubsub.3b516de1.js";import"./Text.722e2789.js";import"./Title.4127a4b4.js";import"./transButton.26020e2e.js";import"./router.8be149da.js";import"./Form.a869b3cf.js";import"./index.41d49230.js";import"./url.0a1547fb.js";import"./index.ee9a096e.js";import"./index.c058ebd2.js";import"./index.823e1eed.js";import"./index.71f713cd.js";import"./index.5fa32c06.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]="6aee003e-e2bb-4f5f-b0e3-63162ffb7348",a._sentryDebugIdIdentifier="sentry-dbid-6aee003e-e2bb-4f5f-b0e3-63162ffb7348")}catch{}})();const J=b({__name:"Forms",setup(a){const r=y(),{loading:s,result:n,refetch:m}=x(()=>c.list()),l=({key:e})=>r.push({path:`/_editor/form/${encodeURIComponent(e)}`}),p=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()},d=async()=>{const e=await c.create();l({key:e.path})},u=async({key:e})=>{var o,t;await D("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=h(()=>{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:l},{icon:F,label:"Duplicate",onClick:p},{icon:k,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(g(),w(v,{loading:_(s),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,"entity-name":"Form",onCreate:d},null,8,["loading","table"]))}});export{J as default};
//# sourceMappingURL=Forms.e5eba97d.js.map
