import{d as f,ey as y,H as b,b as D,c as w,u as g}from"./outputWidgets.7bdcec0a.js";import{e as _,a as C,b as k}from"./icons.6934ad19.js";import{a as v}from"./asyncComputed.cfb98789.js";import{D as d}from"./dashes.a2ed9201.js";import{C as x}from"./CrudView.82a1bc5a.js";import{a as I}from"./ant-design.b9d9c398.js";import"./activeRecord.84d52553.js";import"./pubsub.c455bec9.js";import"./runnerData.9bca67ea.js";import"./Text.94a8ea41.js";import"./Title.9c0d0c5f.js";import"./Form.f84b91b7.js";import"./router.3986149f.js";import"./index.15e46fc6.js";import"./url.5caacc63.js";import"./index.fa2fc691.js";import"./index.125aa6b3.js";import"./index.d2a75d88.js";import"./index.a9a6d5a2.js";import"./index.a2310446.js";import"./index.23129d61.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},i=new Error().stack;i&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[i]="a096eb41-0710-4163-a325-285a388afa11",o._sentryDebugIdIdentifier="sentry-dbid-a096eb41-0710-4163-a325-285a388afa11")}catch{}})();const K=f({__name:"Dashes",setup(o){const i=y(),{loading:r,result:s,refetch:p}=v(()=>d.list()),l=({key:t})=>i.push({name:"dashEditor",params:{dashPath:t}}),c=async({key:t})=>{var a,e;await((e=(a=s.value)==null?void 0:a.find(n=>n.path===t))==null?void 0:e.duplicate()),p()},m=async()=>{const t=await d.create();l({key:t.path})},u=async({key:t})=>{var a,e;await I("Are you sure you want to delete this dash?")&&(await((e=(a=s.value)==null?void 0:a.find(n=>n.path===t))==null?void 0:e.delete()),p())},h=b(()=>{var t,a;return{columns:[{name:"Dash Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(t=s.value)==null?void 0:t.map(e=>({key:e.path,cells:[{text:e.title,link:`/_editor/dash/${encodeURIComponent(e.path)}`},{text:e.path},{text:"",actions:[{icon:_,label:"Edit Dash",onClick:l},{icon:C,label:"Duplicate",onClick:c},{icon:k,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?a:[]}});return(t,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:m},null,8,["loading","table"]))}});export{K as default};
//# sourceMappingURL=Dashes.eed12bde.js.map
