import{S as q,$ as M,a0 as V,a1 as j,l as B,a2 as E,a3 as k,a4 as W,c as D,r as I,W as L,a5 as P}from"./howhlbef.js";import{k as $,b as C,l as x,r as R,x as N,n as S,w as b,G as O,U,R as n,N as u,a0 as y,u as A,a8 as F,V as r,a7 as w,a6 as T,a1 as G}from"./vendor/json-editor-vue-gplv2x2n.js";import{_ as X}from"./launch-page.vue-mornrj02.js";import"./vendor/unocss-fbcdcfn2.js";import"./vendor/shiki-enrzjv18.js";import"./nmarkdown.vue-h4mq92u9.js";import"./client-e80cnnsl.js";const h=new Map,z=$({__name:"IframeView",props:{tab:{}},setup(f){const m=f,c=q(),d=C(),s=x(()=>m.tab.name),e=C(),t=R(M(d));N(()=>{const o=m.tab.view,l=o.persistent!==!1,_=["clipboard-write","clipboard-read"];if(h.get(s.value)&&l)e.value=h.get(s.value),e.value.style.visibility="visible";else{e.value=document.createElement("iframe"),e.value.setAttribute("allow",_.join("; ")),e.value.setAttribute("aria-label","Nuxt Devtools"),l&&h.set(s.value,e.value),e.value.src=o.src;try{e.value.style.opacity="0.01",e.value.onload=()=>{v(),i(),e.value.style.opacity="1"}}catch{e.value.style.opacity="1"}document.body.appendChild(e.value),S(p)}setTimeout(i,100)}),b(p),b(i),b(v),O(()=>{e.value&&(e.value.style.visibility="hidden")});function i(){if(!(!e.value||!e.value.contentWindow))try{const o=e.value.contentWindow.document.querySelector("html");o?.classList.toggle("dark",c.value==="dark"),o?.classList.toggle("light",c.value==="dark"),new MutationObserver(()=>{c.value=e.value?.contentWindow?.document.querySelector("html")?.classList.contains("dark")?"dark":"light"}).observe(o,{attributes:!0,attributeFilter:["class"]})}catch{}}const a=V();function v(){if(!(!e.value||!e.value.contentWindow))try{e.value.contentWindow.__NUXT_DEVTOOLS__=a.value}catch{}}function p(){e.value&&Object.assign(e.value.style,{position:"fixed",left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`,outline:"none"})}return(o,l)=>(n(),U("div",{ref_key:"anchor",ref:d,"h-full":"","w-full":""},null,512))}}),H={flex:"~ col gap2",mxa:"","items-center":""},J={"text-xl":""},K={"text-rose":""},ne=$({__name:"custom-[name]",props:{name:{}},setup(f){const m=f,c=j(),d=B(),s=x(()=>m.name??c.params.name),e=E(),t=x(()=>e.value.find(i=>i.name===s.value));return N(()=>{t.value?t.value.requireAuth&&!k.value&&W():setTimeout(()=>{t.value||d.push("/modules/overview")},2e3)}),(i,a)=>{const v=D,p=P,o=z,l=X,_=L;return t.value?t.value.requireAuth&&!A(k)?(n(),u(p,{key:1})):t.value.view.type==="iframe"?(n(),u(o,{key:2,tab:t.value},null,8,["tab"])):t.value.view.type==="vnode"?(n(),u(F(t.value.view.vnode),{key:3})):t.value.view.type==="launch"?(n(),u(l,{key:4,name:`custom-${t.value.name}`,icon:t.value.view.icon||t.value.icon,title:t.value.view.title||t.value.title,description:t.value.view.description,actions:t.value.view.actions,onAction:a[0]||(a[0]=g=>A(I).customTabAction(t.value.name,g))},null,8,["name","icon","title","description","actions"])):(n(),u(v,{key:5},{default:y(()=>[G(_,{flex:"~ col","h-full":"","items-center":"","justify-center":""},{default:y(()=>[w(" Unknown tab type "+T(t.value.view),1)]),_:1})]),_:1})):(n(),u(v,{key:0},{default:y(()=>[r("div",H,[a[3]||(a[3]=r("div",{"i-carbon-queued":"",mb2:"","text-5xl":"",op50:""},null,-1)),r("p",J,[a[1]||(a[1]=w(" Tab ")),r("code",K,T(s.value),1),a[2]||(a[2]=w(" not found "))]),a[4]||(a[4]=r("p",{op50:""}," It might because the module contributing this tab is not installed or enabled ",-1)),a[5]||(a[5]=r("p",{mt8:"","animate-pulse":""}," Redirecting to overview page... ",-1))])]),_:1}))}}});export{ne as default};
