import{d as f,ez as y,J as b,b as D,c as w,u as _}from"./outputWidgets.b13a87c2.js";import{e as g,a as k,b as C}from"./icons.76c1fe8b.js";import{a as v}from"./asyncComputed.02afd50e.js";import{D as d}from"./dashes.4926394c.js";import{_ as x}from"./CrudView.vue_vue_type_script_setup_true_lang.cf244ae9.js";import{a as I}from"./ant-design.b9e555b3.js";import"./activeRecord.f5a2d19d.js";import"./pubsub.dab46576.js";import"./index.98e61e8e.js";import"./index.957937c4.js";import"./Title.6f86755a.js";import"./Form.e21e0d73.js";import"./index.fbf04eaa.js";import"./index.24360d49.js";import"./index.1b5bc05c.js";import"./index.73746068.js";import"./index.55a2786b.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]="58fb1558-3a48-4188-9ba0-19c362aa5aca",o._sentryDebugIdIdentifier="sentry-dbid-58fb1558-3a48-4188-9ba0-19c362aa5aca")}catch{}})();const q=f({__name:"Dashes",setup(o){const s=y(),{loading:r,result:n,refetch:c}=v(()=>d.list()),l=({key:t})=>s.push({name:"dashEditor",params:{dashPath:t}}),p=async({key:t})=>{var a,e;await((e=(a=n.value)==null?void 0:a.find(i=>i.path===t))==null?void 0:e.duplicate()),c()},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=n.value)==null?void 0:a.find(i=>i.path===t))==null?void 0:e.delete()),c())},h=b(()=>{var t,a;return{columns:[{name:"Dash Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(t=n.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:g,label:"Edit Dash",onClick:l},{icon:k,label:"Duplicate",onClick:p},{icon:C,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?a:[]}});return(t,a)=>(D(),w(x,{loading:_(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{q as default};
//# sourceMappingURL=Dashes.cab3e387.js.map
