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