import{a4 as E,ba as M,bb as N,bc as j,a6 as B,l as I,ag as k,bd as L,i as V,aa as D,r as P,n as R}from"./f1cbvne4.js";import{p as q,k as C,q as x,r as W,E as $,z as O,w as _,L as S,I as U,a2 as n,U as u,a3 as y,R as r,aa as w,a9 as A,u as T,ae as F,a4 as z}from"./vendor/json-editor-vue-g7zhhq6q.js";import{_ as G}from"./launch-page.vue-jvl04rwq.js";import"./vendor/unocss-hvn0t0zz.js";import"./vendor/shiki-hjqm7vcp.js";import"./nmarkdown.vue-gamlcow3.js";import"./client-etfulgf7.js";const h=new Map,X=q({__name:"IframeView",props:{tab:{}},setup(f){const m=f,c=E(),d=C(),i=x(()=>m.tab.name),e=C(),t=W(M(d));$(()=>{const o=m.tab.view,l=o.persistent!==!1,b=["clipboard-write","clipboard-read"];if(h.get(i.value)&&l)e.value=h.get(i.value),e.value.style.visibility="visible";else{e.value=document.createElement("iframe"),e.value.setAttribute("allow",b.join("; ")),e.value.setAttribute("aria-label","Nuxt Devtools"),l&&h.set(i.value,e.value),e.value.src=o.src;try{e.value.style.opacity="0.01",e.value.onload=()=>{v(),s(),e.value.style.opacity="1"}}catch{e.value.style.opacity="1"}document.body.appendChild(e.value),O(p)}setTimeout(s,100)}),_(p),_(s),_(v),S(()=>{e.value&&(e.value.style.visibility="hidden")});function s(){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=N();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=q({__name:"custom-[name]",props:{name:{}},setup(f){const m=f,c=j(),d=B(),i=x(()=>m.name??c.params.name),e=I(),t=x(()=>e.value.find(s=>s.name===i.value));return $(()=>{t.value?t.value.requireAuth&&!k.value&&L():setTimeout(()=>{t.value||d.push("/modules/overview")},2e3)}),(s,a)=>{const v=V,p=D,o=X,l=G,b=R;return t.value?t.value.requireAuth&&!T(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=>T(P).customTabAction(t.value.name,g))},null,8,["name","icon","title","description","actions"])):(n(),u(v,{key:5},{default:y(()=>[z(b,{flex:"~ col","h-full":"","items-center":"","justify-center":""},{default:y(()=>[w(" Unknown tab type "+A(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,A(i.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};
