import{p as R,a as c,f as o,i as L,e as s,t as i,l as h,n as d,r as T,h as S,j as U,g as r,m as f,c as x,o as V,y as W}from"./index-BPc98LNf.js";var X=o("<span> </span>"),Y=o('<div class="json-row svelte-z13g04"><span class="json-key svelte-z13g04"> </span> <span class="json-sep svelte-z13g04">:</span> <div class="json-value"><!></div></div>'),Z=o('<details><summary class="svelte-z13g04"> </summary> <div class="json-children svelte-z13g04"></div></details>'),$=o("<span> </span>"),ee=o("<div><!></div>");function ae(w,a){R(a,!0);let p=c(a,"expandLevel",3,2),z=c(a,"sortKeys",3,!1),b=c(a,"theme",3,"light"),A=c(a,"level",3,0);const O=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),g=e=>Array.isArray(e),_=x(()=>{if(O(a.data)){const e=Object.keys(a.data);return z()&&e.sort(),e.map(t=>[t,a.data[t]])}return g(a.data)?a.data.map((e,t)=>[String(t),e]):[]});var m=ee(),N=s(m);{var q=e=>{var t=Z(),y=s(t),u=s(y),C=S(y,2);U(C,21,()=>r(_),V,(j,D)=>{var k=x(()=>W(r(D),2));let E=()=>r(k)[0],l=()=>r(k)[1];var J=Y(),K=s(J),F=s(K),G=S(K,4),H=s(G);{var I=v=>{{let n=x(()=>A()+1);ae(v,{get data(){return l()},get expandLevel(){return p()},get sortKeys(){return z()},get theme(){return b()},get level(){return r(n)}})}},M=v=>{var n=X(),P=s(n);i(Q=>{h(n,1,`json-primitive type-${typeof l()}`,"svelte-z13g04"),f(P,Q)},[()=>JSON.stringify(l())]),d(v,n)};L(H,v=>{typeof l()=="object"&&l()!==null?v(I):v(M,!1)})}i(()=>f(F,E())),d(j,J)}),i(j=>{t.open=A()<p(),f(u,j)},[()=>g(a.data)?`Array(${r(_).length})`:`Object(${r(_).length})`]),d(e,t)},B=e=>{var t=$(),y=s(t);i(u=>{h(t,1,`json-primitive type-${typeof a.data}`,"svelte-z13g04"),f(y,u)},[()=>JSON.stringify(a.data)]),d(e,t)};L(N,e=>{O(a.data)||g(a.data)?e(q):e(B,!1)})}i(()=>h(m,1,`json-viewer ${b()}`,"svelte-z13g04")),d(w,m),T()}export{ae as default};
