import{d as f,ez as b,J as y,b as D,c as w,u as g}from"./outputWidgets.d94fff8c.js";import{e as _,a as C,b as k}from"./icons.fec42461.js";import{a as v}from"./asyncComputed.6da48dd7.js";import{D as d}from"./dashes.8c8e25c6.js";import{C as x}from"./CrudView.e6c5592c.js";import{a as I}from"./ant-design.b0e50c8b.js";import"./activeRecord.4bb9e983.js";import"./pubsub.39314a92.js";import"./index.3dad0da1.js";import"./index.7d7e00b1.js";import"./Title.c70c7e79.js";import"./Form.57801503.js";import"./router.4a188c48.js";import"./url.596d80c9.js";import"./index.e7f021ad.js";import"./index.3709b59d.js";import"./index.0f14f01f.js";import"./index.209f6c1c.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new Error().stack;s&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[s]="cbaee9c9-89e8-4f8f-9037-9a5b6b6c8e5c",o._sentryDebugIdIdentifier="sentry-dbid-cbaee9c9-89e8-4f8f-9037-9a5b6b6c8e5c")}catch{}})();const q=f({__name:"Dashes",setup(o){const s=b(),{loading:r,result:n,refetch:c}=v(()=>d.list()),l=({key:e})=>s.push({name:"dashEditor",params:{dashPath:e}}),p=async({key:e})=>{var a,t;await((t=(a=n.value)==null?void 0:a.find(i=>i.path===e))==null?void 0:t.duplicate()),c()},u=async()=>{const e=await d.create();l({key:e.path})},m=async({key:e})=>{var a,t;await I("Are you sure you want to delete this dash?")&&(await((t=(a=n.value)==null?void 0:a.find(i=>i.path===e))==null?void 0:t.delete()),c())},h=y(()=>{var e,a;return{columns:[{name:"Dash Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(e=n.value)==null?void 0:e.map(t=>({key:t.path,cells:[{text:t.title,link:`/_editor/dash/${encodeURIComponent(t.path)}`},{text:t.path},{text:"",actions:[{icon:_,label:"Edit Dash",onClick:l},{icon:C,label:"Duplicate",onClick:p},{icon:k,label:"Delete",onClick:m,dangerous:!0}]}]})))!=null?a:[]}});return(e,a)=>(D(),w(x,{loading:g(r),title:"Python Dashes",description:"Create a dashboard page with charts and inputs interacting with your python code.","create-button-text":"Create Dash","empty-title":"No dashes here yet","video-url":"https://www.youtube.com/embed/oYMptrk7QNE",table:h.value,"entity-name":"Dash",onCreate:u},null,8,["loading","table"]))}});export{q as default};
//# sourceMappingURL=Dashes.3db0e788.js.map
