import{$ as e,C as t,Ct as n,E as r,F as i,H as a,Mt as o,V as s,W as c,dt as l,g as u,h as d,lt as f,m as p,tn as m,v as h,w as g,xt as _}from"./vendor/json-editor-vue-eojr4v24.js";import{_ as v,g as y}from"./ready-dadbdj5i.js";import"./utils-jupbrzo6.js";import{T as b,l as x,s as S,t as C}from"./client-nwyjxodt.js";import{i as w,r as T}from"./dev-auth-he0eye7r.js";import"./vendor/shiki-lqo1hg2n.js";import"./storage-options-nzog3hhp.js";import"./nuxt-link-bumooa9d.js";import"./nicon-m1crov2l.js";import"./nbutton-gygn07c2.js";import{t as E}from"./ncard-ludmyw2u.js";import"./telemetry-c77tnag3.js";import{r as D}from"./state-tabs-mtxv3h6t.js";import{t as O}from"./npanel-grids-onrho735.js";import"./ntext-input-e8iut2en.js";import{a as k}from"#entry";import"./client-im47u3kz.js";import{t as A}from"./composables-b2ccklz4.js";import"./nmarkdown-ciogo2e3.js";import{t as j}from"./launch-page-h3hu9uqw.js";var M=new Map,N=r({__name:`IframeView`,props:{tab:{}},setup(e){let t=e,r=C(),o=n(),l=p(()=>t.tab.name),u=n(),d=_(b(o));s(()=>{let e=t.tab.view,n=e.persistent!==!1,r=[`clipboard-write`,`clipboard-read`,...e.permissions||[]];if(M.get(l.value)&&n)u.value=M.get(l.value),u.value.style.visibility=`visible`;else{u.value=document.createElement(`iframe`),u.value.setAttribute(`allow`,r.join(`; `)),u.value.setAttribute(`aria-label`,`Nuxt Devtools`),n&&M.set(l.value,u.value),u.value.src=e.src;try{u.value.style.opacity=`0.01`,u.value.onload=()=>{v(),m(),u.value.style.opacity=`1`}}catch{u.value.style.opacity=`1`}document.body.appendChild(u.value),i(y)}setTimeout(m,100)}),f(y),f(m),f(v),a(()=>{u.value&&(u.value.style.visibility=`hidden`)});function m(){if(!(!u.value||!u.value.contentWindow))try{let e=u.value.contentWindow.document.querySelector(`html`);e?.classList.toggle(`dark`,r.value===`dark`),e?.classList.toggle(`light`,r.value===`dark`),new MutationObserver(()=>{r.value=u.value?.contentWindow?.document.querySelector(`html`)?.classList.contains(`dark`)?`dark`:`light`}).observe(e,{attributes:!0,attributeFilter:[`class`]})}catch{}}let g=S();function v(){if(!(!u.value||!u.value.contentWindow))try{u.value.contentWindow.__NUXT_DEVTOOLS__=g.value}catch{}}function y(){u.value&&Object.assign(u.value.style,{position:`fixed`,left:`${d.left}px`,top:`${d.top}px`,width:`${d.width}px`,height:`${d.height}px`,outline:`none`})}return(e,t)=>(c(),h(`div`,{ref_key:`anchor`,ref:o,"h-full":``,"w-full":``},null,512))}}),P=Object.assign(N,{__name:`IframeView`}),F={flex:`~ col gap2`,mxa:``,"items-center":``},I={"text-xl":``},L={"text-rose":``},R=r({__name:`custom-[name]`,props:{name:{}},setup(n){let r=n;A({layout:`full`});let i=y(),a=v(),f=p(()=>r.name??i.params.name),h=D(),_=p(()=>h.value.find(e=>e.name===f.value));return s(()=>{_.value?_.value.requireAuth&&!T.value&&w():setTimeout(()=>{_.value||a.push(`/modules/overview`)},2e3)}),(n,r)=>{let i=O,a=k,s=P,p=j,h=E;return _.value?_.value.requireAuth&&!o(T)?(c(),u(a,{key:1})):_.value.view.type===`iframe`?(c(),u(s,{key:2,tab:_.value},null,8,[`tab`])):_.value.view.type===`vnode`?(c(),u(e(_.value.view.vnode),{key:3})):_.value.view.type===`launch`?(c(),u(p,{key:4,name:`custom-${_.value.name}`,icon:_.value.view.icon||_.value.icon,title:_.value.view.title||_.value.title,description:_.value.view.description,actions:_.value.view.actions,onAction:r[0]||=e=>o(x).customTabAction(_.value.name,e)},null,8,[`name`,`icon`,`title`,`description`,`actions`])):(c(),u(i,{key:5},{default:l(()=>[g(h,{flex:`~ col`,"h-full":``,"items-center":``,"justify-center":``},{default:l(()=>[t(` Unknown tab type `+m(_.value.view),1)]),_:1})]),_:1})):(c(),u(i,{key:0},{default:l(()=>[d(`div`,F,[r[3]||=d(`div`,{"i-carbon-queued":``,mb2:``,"text-5xl":``,op50:``},null,-1),d(`p`,I,[r[1]||=t(` Tab `,-1),d(`code`,L,m(f.value),1),r[2]||=t(` not found `,-1)]),r[4]||=d(`p`,{op50:``},` It might because the module contributing this tab is not installed or enabled `,-1),r[5]||=d(`p`,{mt8:``,"animate-pulse":``},` Redirecting to overview page... `,-1)])]),_:1}))}}});export{R as default};