import{B as e,C as t,H as n,L as r,N as i,O as a,_ as o,a as s,b as c,g as l,h as u,j as d,k as f,t as p,u as m,v as h,w as g,x as _}from"./_plugin-vue_export-helper-Cut4Z2wH.js";import{t as v}from"./JsonPanel-D8QacXqQ.js";var y={class:`view`},b={key:0,class:`placeholder`},x={key:1,class:`placeholder`},S={key:2,class:`placeholder`},C={class:`error-text`},w={key:3,class:`content-area`},T={class:`section`},E={class:`section-title`},D={class:`table-wrapper`},O={class:`data-table`},k=[`onClick`],A={class:`expand-cell`},j={class:`expand-icon`},M={class:`kid-cell`},N=[`onClick`,`title`],P={class:`mono-cell`},F={class:`mono-cell`},I={class:`mono-cell`},L={key:0,class:`detail-row`},R={colspan:6},z={class:`key-detail`},B={class:`section`},V=p(g({__name:`JwksView`,setup(p){let g=r(null),V=r(!1),H=r(``),U=r(null);async function W(){if(m.connected){V.value=!0,H.value=``;try{g.value=await s(m.baseUrl)}catch(e){H.value=e instanceof Error?e.message:`Failed to load JWKS`}finally{V.value=!1}}}a(W),i(()=>m.connected,e=>{e?W():g.value=null});let G=o(()=>g.value?.keys||[]);function K(e){U.value=U.value===e?null:e}let q=r(``);async function J(e){try{await navigator.clipboard.writeText(e),q.value=e,setTimeout(()=>{q.value=``},1500)}catch{}}return(r,i)=>(f(),_(`div`,y,[i[3]||=h(`div`,{class:`view-header`},[h(`h2`,null,`JWKS`),h(`span`,{class:`view-subtitle`},`/.well-known/jwks.json`)],-1),e(m).connected?V.value?(f(),_(`div`,x,[...i[1]||=[h(`div`,{class:`spinner`},null,-1),h(`p`,null,`Loading JWKS...`,-1)]])):H.value?(f(),_(`div`,S,[h(`p`,C,n(H.value),1),h(`button`,{class:`retry-btn`,onClick:W},`Retry`)])):g.value?(f(),_(`div`,w,[h(`section`,T,[h(`h3`,E,`Keys (`+n(G.value.length)+`)`,1),h(`div`,D,[h(`table`,O,[i[2]||=h(`thead`,null,[h(`tr`,null,[h(`th`),h(`th`,null,`Key ID (kid)`),h(`th`,null,`Algorithm (alg)`),h(`th`,null,`Key Type (kty)`),h(`th`,null,`Curve (crv)`),h(`th`,null,`Use`)])],-1),h(`tbody`,null,[(f(!0),_(l,null,d(G.value,e=>(f(),_(l,{key:e.kid},[h(`tr`,{class:`key-row`,onClick:t=>K(e.kid)},[h(`td`,A,[h(`span`,j,n(U.value===e.kid?`▼`:`▶`),1)]),h(`td`,M,[h(`span`,{class:`kid-value`,onClick:u(t=>J(e.kid),[`stop`]),title:q.value===e.kid?`Copied!`:`Click to copy`},n(e.kid),9,N)]),h(`td`,P,n(e.alg||`—`),1),h(`td`,F,n(e.kty),1),h(`td`,I,n(e.crv||`—`),1),h(`td`,null,n(e.use||`—`),1)],8,k),U.value===e.kid?(f(),_(`tr`,L,[h(`td`,R,[h(`div`,z,[t(v,{data:e,title:`Full JWK`,collapsed:!1},null,8,[`data`])])])])):c(``,!0)],64))),128))])])])]),h(`section`,B,[t(v,{data:g.value,title:`Raw JWKS`,collapsed:!0},null,8,[`data`])])])):c(``,!0):(f(),_(`div`,b,[...i[0]||=[h(`div`,{class:`placeholder-icon`},`🔑`,-1),h(`p`,null,`Connect to an ANIP service to inspect its JSON Web Key Set.`,-1)]]))]))}}),[[`__scopeId`,`data-v-325551d2`]]);export{V as default};