import{d as w,u as g,r as C,c as V,a as c,b as e,t as l,w as D,v as N,n as F,M as y,o as n,p as P,e as I,_ as j,F as k,f as T,g as B,h as H,i as S,j as f,k as x,l as E,m as $,q as z,s as O,D as A}from"./index-c1637869.js";const L=o=>(P("data-v-b99ddb7a"),o=o(),I(),o),R={class:""},q={class:"mb-3"},U={class:"d-flex text-start input mb-2"},G={class:"info"},J={key:0},K={key:1,class:"text-placeholder"},Q=L(()=>e("i",{class:"bi bi-folder"},null,-1)),W=[Q],X={class:"d-flex text-start input"},Y={class:"info"},Z={class:"flex-grow-1 value text-dim"},ee={class:"d-flex mt-2"},te=L(()=>e("div",{class:"flex-grow-1"},null,-1)),se=w({__name:"Create",emits:["cancel","create"],setup(o,{emit:s}){const r=g(),p=s,d=C(""),_=C(""),u=V(()=>d.value!=""&&_.value!="");function m(t){t&&(d.value=t)}function v(){r.showModal(y.FOLDERSELECTION,{callback:m,mode:"create"})}return(t,i)=>(n(),c("div",R,[e("h3",q,l(t.$t("main.home.create_title")),1),e("div",U,[e("div",G,l(t.$t("main.home.label.folder")),1),e("div",{class:"flex-grow-1 value text-dim",style:{cursor:"pointer"},onClick:v},[d.value!=""?(n(),c("span",J,l(d.value),1)):(n(),c("span",K,l(t.$t("main.home.label.path_placeholder")),1))]),e("div",{class:"folder",style:{cursor:"pointer"},onClick:v},W)]),e("div",X,[e("div",Y,l(t.$t("main.home.label.name")),1),e("div",Z,[D(e("input",{type:"text","onUpdate:modelValue":i[0]||(i[0]=a=>_.value=a),placeholder:"project_name",style:{width:"100%"}},null,512),[[N,_.value]])])]),e("div",ee,[te,e("div",{class:"btn-grey hover-grey",onClick:i[1]||(i[1]=a=>p("cancel"))},l(t.$t("main.home.label.cancel")),1),e("div",{class:F(["ms-2",u.value?"btn-blue":"btn-grey text-dim"]),onClick:i[2]||(i[2]=a=>p("create",{path:d.value,name:_.value}))},l(t.$t("main.home.label.create")),3)])]))}});const oe=j(se,[["__scopeId","data-v-b99ddb7a"]]),M=o=>(P("data-v-3db3d89b"),o=o(),I(),o),ae={class:"create-option d-flex"},ne=M(()=>e("div",{class:"flex-grow-1"},[e("h6",{class:"create-title m-0"},"Créer un nouveau projet"),e("span",{class:"create-explanation"},"Créer un nouveau projet panotpic dans un dossier.")],-1)),ie=M(()=>e("div",{class:"flex-grow-1"},[e("h6",{class:"create-title m-0"},"Importer un projet"),e("span",{class:"create-explanation"},"Choisissez un dossier Panoptic existant.")],-1)),le=w({__name:"Options",emits:["create","import"],setup(o,{emit:s}){const r=g(),p=s;function d(u){u&&p("import",u)}function _(){r.showModal(y.FOLDERSELECTION,{callback:d,mode:"import"})}return(u,m)=>(n(),c(k,null,[e("div",ae,[ne,e("div",{class:"create-btn highlight",onClick:m[0]||(m[0]=v=>p("create"))},"Créer")]),e("div",{class:"create-option d-flex"},[ie,e("div",{class:"create-btn",onClick:_},"Importer")])],64))}});const ce=j(le,[["__scopeId","data-v-3db3d89b"]]),h=o=>(P("data-v-784dc1f1"),o=o(),I(),o),de={class:"window d-flex"},re={key:0,class:"project-menu"},_e={class:"d-flex"},pe=["onClick"],ue={class:"m-0"},me={class:"m-0 p-0 text-wrap text-break dimmed-2",style:{"font-size":"13px"}},ve={class:"project-option flex-shrink-0"},he=h(()=>e("i",{class:"bi bi-three-dots-vertical"},null,-1)),fe={class:"text-start"},be=["onClick"],xe=h(()=>e("i",{class:"bi bi-trash me-1"},null,-1)),$e={class:"main-menu flex-grow-1"},Ce=h(()=>e("div",{class:"icon"},"👀",-1)),ke=h(()=>e("h1",{class:"m-0 p-0"},"Panoptic",-1)),we=h(()=>e("h6",{class:"dimmed-2"},"Version pre-2.0",-1)),ge={class:"create-menu mt-5 pt-5"},ye={class:"plugin-preview mt-5"},Pe={class:"ps-1"},Ie=["onClick"],je=w({__name:"HomeView",setup(o){const s=g();T();const r=C(0),p=V(()=>Array.isArray(s.data.status.projects)&&s.data.status.projects.length>0);function d(t){return t.replaceAll("-","‑")}function _(t){t.path&&t.name&&s.createProject(t.path,t.name)}function u(t){s.importProject(t)}function m(t){s.delPlugin(t)}function v(){s.showModal(y.FOLDERSELECTION,{mode:"create",callback:s.addPlugin})}return B(()=>{s.isProjectLoaded&&H.push("/view")}),(t,i)=>(n(),c("div",de,[p.value?(n(),c("div",re,[(n(!0),c(k,null,S(f(s).data.status.projects,a=>(n(),c("div",_e,[e("div",{class:"project flex-grow-1 overflow-hidden",onClick:b=>f(s).loadProject(a.path)},[e("h5",ue,l(a.name),1),e("div",me,l(d(a.path)),1)],8,pe),e("div",ve,[z(A,null,{button:O(()=>[he]),popup:O(({hide:b})=>[e("div",fe,[e("div",{onClick:Se=>{f(s).deleteProject(a.path),b()},class:"m-1 base-hover p-1"},[xe,$("delete")],8,be)])]),_:2},1024)])]))),256))])):x("",!0),e("div",$e,[Ce,ke,we,e("div",ge,[r.value==0?(n(),E(ce,{key:0,onCreate:i[0]||(i[0]=a=>r.value=1),onImport:u})):x("",!0),r.value==1?(n(),E(oe,{key:1,onCancel:i[1]||(i[1]=a=>r.value=0),onCreate:_})):x("",!0),e("div",ye,[e("h5",{class:"text-center"},[$(" Plugins "),e("span",{class:"sb bi bi-plus",style:{position:"relative",top:"1px"},onClick:v})]),(n(!0),c(k,null,S(f(s).data.plugins,a=>(n(),c("div",Pe,[e("span",{onClick:b=>m(a),class:"bi bi-x base-hover"},null,8,Ie),$(" "+l(a),1)]))),256))])])])]))}});const Oe=j(je,[["__scopeId","data-v-784dc1f1"]]);export{Oe as default};
