const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CookieFormDialog-ChrFztqp.js","./vue-3bs2-dMU.js","./rolldown-runtime-B0Z9INg1.js","./vue-BKb5tX_4.css","./stores-DmetsdTd.js","./preload-helper-HclGiUj8.js","./vuetify-gGrfRH2I.js","./vuetify-Pk2Sm9cw.css","./CookieImportDialog-BVM_GH1C.js"])))=>i.map(i=>d[i]);
import{$ as e,B as t,Bt as n,F as r,G as i,L as a,M as o,N as s,Q as c,R as l,T as u,Tt as d,Ut as f,bt as p,c as m,j as h,ot as g,p as _,qt as v,y,z as b}from"./vue-3bs2-dMU.js";import{It as x,K as S,W as C,h as w,p as T}from"./stores-DmetsdTd.js";import{t as E}from"./preload-helper-HclGiUj8.js";import{C as D,Ft as O,K as k,et as A,h as j,ht as M,o as N,rt as P,tt as F}from"./vuetify-gGrfRH2I.js";i(),d(),f(),y();var I={class:`pa-3`},L={class:`d-flex align-center`},R={class:`text-headline-medium ml-2`},z={class:`d-flex justify-end`},B={class:`d-flex align-center flex-gap`},V=t({__name:`CookiesManager`,setup(t){let{height:i}=O(),d=m(),{t:f}=S(),y=T(),{cookies:V}=_(y),H=C(),U=w(),W=h(()=>i.value-64-24-48),G=h(()=>[{title:f(`cookiesManager.table.domain`),key:`domain`},{title:f(`cookiesManager.table.path`),key:`path`},{title:f(`cookiesManager.table.name`),key:`name`},{title:f(`cookiesManager.table.value`),key:`value`,cellProps:{class:`wrap-anywhere`}},{title:f(`cookiesManager.table.expiration_date`),key:`expirationDate`},{key:`actions`,sortable:!1,nowrap:!0}]);function K(e){H.createDialog(b(()=>E(()=>import(`./CookieFormDialog-ChrFztqp.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url)),{initialCookie:e},()=>void y.cookiesFetchTask.perform())}function q(){H.createDialog(b(()=>E(()=>import(`./CookieImportDialog-BVM_GH1C.js`),__vite__mapDeps([8,1,2,3,4,5,6,7]),import.meta.url)),{},()=>void y.cookiesFetchTask.perform())}function J(e){H.confirmAction({title:f(`dialogs.confirm.deleteCookie`),text:`Domain: ${e.domain}\nPath: ${e.path}\nName: ${e.name}`,yesColor:`error`,onConfirm:async()=>{await y.removeCookie(e,!0)}})}function Y(){H.confirmAction({title:f(`dialogs.confirm.clearCookies`),yesColor:`error`,onConfirm:async()=>{await y.clearCookies(!0)}})}function X(){d.push({name:`dashboard`})}function Z(e){if(H.hasActiveDialog)return!1;e.key===`Escape`&&(e.preventDefault(),X())}return c(()=>{document.addEventListener(`keydown`,Z),y.cookiesFetchTask.perform()}),e(()=>{document.removeEventListener(`keydown`,Z)}),(e,t)=>(g(),r(`div`,I,[o(`div`,L,[o(`div`,R,v(n(f)(`cookiesManager.title`)),1),l(M),o(`div`,z,[l(k,{icon:`mdi-close`,variant:`plain`,onClick:X})])]),n(V).length?(g(),s(A,{key:1},{default:p(()=>[l(P,null,{default:p(()=>[o(`div`,B,[l(M),l(k,{color:`accent`,"prepend-icon":`mdi-plus`,text:n(f)(`cookiesManager.create`),onClick:t[2]||=e=>K()},null,8,[`text`]),l(k,{color:`accent`,"prepend-icon":`mdi-import`,text:n(f)(`cookiesManager.import`),onClick:t[3]||=e=>q()},null,8,[`text`]),l(k,{color:`error`,"prepend-icon":`mdi-delete`,text:n(f)(`cookiesManager.clear`),onClick:t[4]||=e=>Y()},null,8,[`text`])])]),_:1}),l(F,{class:`my-3`}),l(P,{class:`text-select`},{default:p(()=>[l(j,{"header-props":{class:`text-no-wrap`},mobile:null,headers:G.value,items:n(V),"multi-sort":``,"footer-props":{itemsPerPageOptions:[10,25,50,100,-1]}},{"item.expirationDate":p(({value:e})=>[a(v(n(x)(e,n(U).dateFormat)),1)]),"item.actions":p(({item:e})=>[l(k,{icon:`mdi-pencil`,variant:`text`,density:`compact`,onClick:u(t=>K(e),[`stop`])},null,8,[`onClick`]),l(k,{color:`red`,icon:`mdi-delete`,variant:`text`,density:`compact`,onClick:u(t=>J(e),[`stop`])},null,8,[`onClick`])]),_:2},1032,[`headers`,`items`])]),_:1})]),_:1})):(g(),s(D,{key:0,height:W.value},{default:p(()=>[l(N,{title:n(f)(`cookiesManager.empty.value`),color:`accent`,icon:`mdi-cookie-off`},{actions:p(()=>[l(k,{text:n(f)(`cookiesManager.create`),color:`accent`,"prepend-icon":`mdi-plus`,onClick:t[0]||=e=>K()},null,8,[`text`]),l(k,{text:n(f)(`cookiesManager.import`),color:`accent`,"prepend-icon":`mdi-import`,onClick:t[1]||=e=>q()},null,8,[`text`])]),_:1},8,[`title`])]),_:1},8,[`height`]))]))}});export{V as default};