import{d as m,H as y,K as b,b as D,t as w,z as g}from"./registerWidgets.7afd6438.js";import{f as _,g as k,h as C}from"./icons.0ae396f2.js";import{a as v}from"./asyncComputed.b60ddd9a.js";import{D as l}from"./dashes.e2e2b65e.js";import{R as x}from"./RuntimeList.9752755f.js";import"./activeRecord.e140ff8e.js";import"./pubsub.9805d82b.js";import"./runnerData.7369dff0.js";import"./DropdownMenu.90d44aab.js";import"./CircularLoading.283e573b.js";import"./lottie.36f8e1f2.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]="64fcef59-1219-4469-82e9-17ff0f325db9",o._sentryDebugIdIdentifier="sentry-dbid-64fcef59-1219-4469-82e9-17ff0f325db9")}catch{}})();const L=m({__name:"Dashes",setup(o){const s=y(),{loading:r,result:n,refetch:c}=v(()=>l.list()),d=({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 l.create();d({key:e.path})},h=async({key:e})=>{var a,t;confirm("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())},f=b(()=>{var e,a;return{columns:[{name:"Dash Name"},{name:"Path"},{name:"Dash Actions"}],rows:(a=(e=n.value)==null?void 0:e.map(t=>({key:t.path,cells:[{text:t.title,classes:["title","centered"],link:`/_editor/dash/${encodeURIComponent(t.path)}`},{text:t.path},{text:"",classes:["centered"],actions:[{icon:_,label:"Delete",onClick:h,dangerous:!0},{icon:k,label:"Edit Dash",onClick:d},{icon:C,label:"Duplicate",onClick:p}]}]})))!=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:f.value,onCreate:u},null,8,["loading","table"]))}});export{L as default};
//# sourceMappingURL=Dashes.c70d6134.js.map
