import{d as D,ao as j,r as A,a as x,aA as q,aB as B,as as $,aC as E,aD as b,aE as M,aF as N,m as I,o as s,aG as L,P,aH as V,aI as C,aJ as W,f as a,h as c,j as y,az as O,A as R,k as u,v as w,t as T,L as S,i as F,at as U,aK as G}from"./CAAfHP_R.js";import{_ as z}from"./DMzajkAN.js";import"./Cd70Y59n.js";import"./BlojwbTG.js";const g=new Map,H=D({__name:"IframeView",props:{tab:{}},setup(f){const m=f,r=j(),v=A(),i=x(()=>m.tab.name),e=A(),t=q(B(v));$(()=>{const o=m.tab.view,l=o.persistent!==!1,h=["clipboard-write","clipboard-read"];if(g.get(i.value)&&l)e.value=g.get(i.value),e.value.style.visibility="visible";else{e.value=document.createElement("iframe"),e.value.setAttribute("allow",h.join("; ")),e.value.setAttribute("aria-label","Nuxt Devtools"),l&&g.set(i.value,e.value),e.value.src=o.src;try{e.value.style.opacity="0.01",e.value.onload=()=>{d(),n(),e.value.style.opacity="1"}}catch{e.value.style.opacity="1"}document.body.appendChild(e.value),E(_)}setTimeout(n,100)}),b(_),b(n),b(d),M(()=>{e.value&&(e.value.style.visibility="hidden")});function n(){if(!(!e.value||!e.value.contentWindow))try{const o=e.value.contentWindow.document.querySelector("html");o?.classList.toggle("dark",r.value==="dark"),o?.classList.toggle("light",r.value==="dark"),new MutationObserver(()=>{r.value=e.value?.contentWindow?.document.querySelector("html")?.classList.contains("dark")?"dark":"light"}).observe(o,{attributes:!0,attributeFilter:["class"]})}catch{}}const p=N();function d(){if(!(!e.value||!e.value.contentWindow))try{e.value.contentWindow.__NUXT_DEVTOOLS__=p.value}catch{}}function _(){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)=>(s(),I("div",{ref_key:"anchor",ref:v,"h-full":"","w-full":""},null,512))}}),J={flex:"~ col gap2",mxa:"","items-center":""},K=u("div",{"i-carbon-queued":"",mb2:"","text-5xl":"",op50:""},null,-1),X={"text-xl":""},Q={"text-rose":""},Y=u("p",{op50:""}," It might because the module contributing this tab is not installed or enabled ",-1),Z=u("p",{mt8:"","animate-pulse":""}," Redirecting to overview page... ",-1),ne=D({__name:"custom-[name]",props:{name:{}},setup(f){const m=f,r=L(),v=P(),i=x(()=>m.name??r.params.name),e=V(),t=x(()=>e.value.find(n=>n.name===i.value));return $(()=>{t.value?t.value.requireAuth&&!C.value&&W():setTimeout(()=>{t.value||v.push("/modules/overview")},2e3)}),(n,p)=>{const d=R,_=G,o=H,l=z,h=U;return a(t)?a(t).requireAuth&&!("isDevAuthed"in n?n.isDevAuthed:a(C))?(s(),c(_,{key:1})):a(t).view.type==="iframe"?(s(),c(o,{key:2,tab:a(t)},null,8,["tab"])):a(t).view.type==="vnode"?(s(),c(O(a(t).view.vnode),{key:3})):a(t).view.type==="launch"?(s(),c(l,{key:4,name:`custom-${a(t).name}`,icon:a(t).view.icon||a(t).icon,title:a(t).view.title||a(t).title,description:a(t).view.description,actions:a(t).view.actions,onAction:p[0]||(p[0]=k=>("rpc"in n?n.rpc:a(S)).customTabAction(a(t).name,k))},null,8,["name","icon","title","description","actions"])):(s(),c(d,{key:5},{default:y(()=>[F(h,{flex:"~ col","h-full":"","items-center":"","justify-center":""},{default:y(()=>[w(" Unknown tab type "+T(a(t).view),1)]),_:1})]),_:1})):(s(),c(d,{key:0},{default:y(()=>[u("div",J,[K,u("p",X,[w(" Tab "),u("code",Q,T(a(i)),1),w(" not found ")]),Y,Z])]),_:1}))}}});export{ne as default};
