import{d as f,eA as y,G as b,b as D,c as w,u as g}from"./outputWidgets.427e9347.js";import{e as _,a as C,b as k}from"./icons.2a865956.js";import{a as v}from"./asyncComputed.32abd7c2.js";import{D as l}from"./dashes.c44ff20c.js";import{C as x}from"./CrudView.22a93e62.js";import{a as I}from"./ant-design.484e81b9.js";import"./activeRecord.91f10272.js";import"./pubsub.9b59356e.js";import"./runnerData.f3941ca5.js";import"./Text.31458a16.js";import"./Base.dbea8db9.js";import"./FormItem.e1548cef.js";import"./transButton.470f2fe6.js";import"./router.1a20c20c.js";import"./Title.213e158e.js";import"./index.e440fe17.js";import"./url.9044ee0d.js";import"./index.8fcd530b.js";import"./index.36e3a141.js";import"./index.3804082b.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]="9fe6d7fd-0f77-49f9-bc98-d9347c8af731",o._sentryDebugIdIdentifier="sentry-dbid-9fe6d7fd-0f77-49f9-bc98-d9347c8af731")}catch{}})();const J=f({__name:"Dashes",setup(o){const s=y(),{loading:r,result:i,refetch:d}=v(()=>l.list()),c=({key:e})=>s.push({name:"dashEditor",params:{dashPath:e}}),p=async({key:e})=>{var a,t;await((t=(a=i.value)==null?void 0:a.find(n=>n.path===e))==null?void 0:t.duplicate()),d()},m=async()=>{const e=await l.create();c({key:e.path})},u=async({key:e})=>{var a,t;await I("Are you sure you want to delete this dash?")&&(await((t=(a=i.value)==null?void 0:a.find(n=>n.path===e))==null?void 0:t.delete()),d())},h=b(()=>{var e,a;return{columns:[{name:"Dash Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(e=i.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:c},{icon:C,label:"Duplicate",onClick:p},{icon:k,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?a:[]}});return(e,a)=>(D(),w(x,{loading:g(r),title:"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:m},null,8,["loading","table"]))}});export{J as default};
//# sourceMappingURL=Dashes.6bebea7f.js.map
