import{d as f,ex as b,H as y,b as D,c as w,u as _}from"./registerWidgets.4340e287.js";import{e as g,a as k,b as C}from"./icons.da02f7f7.js";import{a as x}from"./asyncComputed.a4cc4ebe.js";import{D as l}from"./dashes.8416a46d.js";import{_ as v}from"./CrudView.vue_vue_type_script_setup_true_lang.e9f57b5e.js";import{a as I}from"./ant-design.56df7a71.js";import"./activeRecord.c40ac301.js";import"./pubsub.3290d859.js";import"./index.bdeb3c9e.js";import"./index.f58e2ef8.js";import"./Title.4165770a.js";import"./Form.7b78c348.js";import"./index.17a2edf7.js";import"./index.7bc7e814.js";import"./index.d24f6130.js";import"./index.9aade351.js";import"./index.c13b703c.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]="e3546e54-9d73-4fba-a897-7c13ab2bc587",o._sentryDebugIdIdentifier="sentry-dbid-e3546e54-9d73-4fba-a897-7c13ab2bc587")}catch{}})();const z=f({__name:"Dashes",setup(o){const s=b(),{loading:r,result:n,refetch:c}=x(()=>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()},m=async()=>{const e=await l.create();d({key:e.path})},u=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:g,label:"Edit Dash",onClick:d},{icon:k,label:"Duplicate",onClick:p},{icon:C,label:"Delete",onClick:u,dangerous:!0}]}]})))!=null?a:[]}});return(e,a)=>(D(),w(v,{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{z as default};
//# sourceMappingURL=Dashes.bba23500.js.map
