diff --git a/docs/assets/index-CbbK33mH.js b/docs/assets/index-BDoPEOr-.js similarity index 99% rename from docs/assets/index-CbbK33mH.js rename to docs/assets/index-BDoPEOr-.js index d31f0dd..1a1d4f6 100644 --- a/docs/assets/index-CbbK33mH.js +++ b/docs/assets/index-BDoPEOr-.js @@ -2,4 +2,4 @@ var Ks=Object.defineProperty;var Nn=e=>{throw TypeError(e)};var Ws=(e,t,n)=>t in `;for(let v=0;v<=1;v+=a){const k=t+(n-t)*r(v);c+=v*100+`%{${l(k,1-k)}} `}const f=c+`100% {${l(n,1-n)}} }`,h=`__svelte_${li(f)}_${o}`,m=ps(e),{stylesheet:g,rules:_}=Nt.get(m)||ai(m,e);_[h]||(_[h]=!0,g.insertRule(`@keyframes ${h} ${f}`,g.cssRules.length));const p=e.style.animation||"";return e.style.animation=`${p?`${p}, `:""}${h} ${s}ms linear ${i}ms 1 both`,St+=1,h}function ci(e,t){const n=(e.style.animation||"").split(", "),s=n.filter(t?r=>r.indexOf(t)<0:r=>r.indexOf("__svelte")===-1),i=n.length-s.length;i&&(e.style.animation=s.join(", "),St-=i,St||ui())}function ui(){nn(()=>{St||(Nt.forEach(e=>{const{ownerNode:t}=e.stylesheet;t&&A(t)}),Nt.clear())})}let ft;function ct(e){ft=e}function on(){if(!ft)throw new Error("Function called outside component initialization");return ft}function Lt(e){on().$$.on_mount.push(e)}function rn(e){on().$$.on_destroy.push(e)}function Pe(){const e=on();return(t,n,{cancelable:s=!1}={})=>{const i=e.$$.callbacks[t];if(i){const r=hs(t,n,{cancelable:s});return i.slice().forEach(l=>{l.call(e,r)}),!r.defaultPrevented}return!0}}function _t(e,t){const n=e.$$.callbacks[t.type];n&&n.slice().forEach(s=>s.call(this,t))}const qe=[],dt=[];let We=[];const Zt=[],fi=Promise.resolve();let qt=!1;function di(){qt||(qt=!0,fi.then(ms))}function Re(e){We.push(e)}function pi(e){Zt.push(e)}const Bt=new Set;let Ve=0;function ms(){if(Ve!==0)return;const e=ft;do{try{for(;Vee.indexOf(s)===-1?t.push(s):n.push(s)),n.forEach(s=>s()),We=t}let st;function gi(){return st||(st=Promise.resolve(),st.then(()=>{st=null})),st}function Ht(e,t,n){e.dispatchEvent(hs(`${t?"intro":"outro"}${n}`))}const yt=new Set;let ke;function Le(){ke={r:0,c:[],p:ke}}function je(){ke.r||Ce(ke.c),ke=ke.p}function N(e,t){e&&e.i&&(yt.delete(e),e.i(t))}function O(e,t,n,s){if(e&&e.o){if(yt.has(e))return;yt.add(e),ke.c.push(()=>{yt.delete(e),s&&(n&&e.d(1),s())}),e.o(t)}else s&&s()}const bi={duration:0};function Qe(e,t,n,s){let r=t(e,n,{direction:"both"}),l=s?0:1,o=null,a=null,c=null,f;function h(){c&&ci(e,c)}function m(_,p){const v=_.b-l;return p*=Math.abs(v),{a:l,b:_.b,d:v,duration:p,start:_.start,end:_.start+p,group:_.group}}function g(_){const{delay:p=0,duration:v=300,easing:k=ns,tick:S=ee,css:w}=r||bi,L={start:Qs()+p,b:_};_||(L.group=ke,ke.r+=1),"inert"in e&&(_?f!==void 0&&(e.inert=f):(f=e.inert,e.inert=!0)),o||a?a=L:(w&&(h(),c=Ln(e,l,_,v,p,k,w)),_&&S(0,1),o=m(L,v),Re(()=>Ht(e,_,"start")),ei(R=>{if(a&&R>a.start&&(o=m(a,v),a=null,Ht(e,o.b,"start"),w&&(h(),c=Ln(e,l,o.b,o.duration,0,k,r.css))),o){if(R>=o.end)S(l=o.b,1-l),Ht(e,o.b,"end"),a||(o.b?h():--o.group.r||Ce(o.group.c)),o=null;else if(R>=o.start){const P=R-o.start;l=o.a+o.d*k(P/o.duration),S(l,1-l)}}return!!(o||a)}))}return{run(_){tn(r)?gi().then(()=>{r=r({direction:_?"in":"out"}),g(_)}):g(_)},end(){h(),o=a=null}}}function jn(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function vi(e,t,n){const s=e.$$.props[t];s!==void 0&&(e.$$.bound[s]=n,n(e.$$.ctx[s]))}function H(e){e&&e.c()}function J(e,t,n){const{fragment:s,after_update:i}=e.$$;s&&s.m(t,n),Re(()=>{const r=e.$$.on_mount.map(ss).filter(tn);e.$$.on_destroy?e.$$.on_destroy.push(...r):Ce(r),e.$$.on_mount=[]}),i.forEach(Re)}function B(e,t){const n=e.$$;n.fragment!==null&&(mi(n.after_update),Ce(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function _i(e,t){e.$$.dirty[0]===-1&&(qe.push(e),di(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const _=g.length?g[0]:m;return c.ctx&&i(c.ctx[h],c.ctx[h]=_)&&(!c.skip_bound&&c.bound[h]&&c.bound[h](_),f&&_i(e,h)),m}):[],c.update(),f=!0,Ce(c.before_update),c.fragment=s?s(c.ctx):!1,t.target){if(t.hydrate){const h=oi(t.target);c.fragment&&c.fragment.l(h),h.forEach(A)}else c.fragment&&c.fragment.c();t.intro&&N(e.$$.fragment),J(e,t.target,t.anchor),ms()}ct(a)}class ue{constructor(){ve(this,"$$");ve(this,"$$set")}$destroy(){B(this,1),this.$destroy=ee}$on(t,n){if(!tn(n))return ee;const s=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return s.push(n),()=>{const i=s.indexOf(n);i!==-1&&s.splice(i,1)}}$set(t){this.$$set&&!Xs(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const yi="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(yi);function Ci(e){return e<.5?4*e*e*e:.5*Math.pow(2*e-2,3)+1}function et(e,{delay:t=0,duration:n=400,easing:s=ns}={}){const i=+getComputedStyle(e).opacity;return{delay:t,duration:n,easing:s,css:r=>`opacity: ${r*i}`}}const Ue=[];function nt(e,t=ee){let n;const s=new Set;function i(o){if(le(e,o)&&(e=o,n)){const a=!Ue.length;for(const c of s)c[1](),Ue.push(c,e);if(a){for(let c=0;c{s.delete(c),s.size===0&&n&&(n(),n=null)}}return{set:i,update:r,subscribe:l}}function gs(){return!!window.localStorage}function pt(e){if(gs()&&e)return window.localStorage.getItem(e)}function jt(e,t){gs()&&e&&t&&window.localStorage.setItem(e,t)}const Yt=(()=>{const e="json-editor-preview",{subscribe:t,update:n}=nt(pt(e)!=="false");return{subscribe:t,change:s=>n(i=>i===s?i:(jt(e,s?"true":"false"),s))}})(),Pt=nt(!1),Rn=["en","ko","jp"],An={en:{preview:"Preview",data:"Data",view:"View",language:"Language",about:"About",clear:"Clear",import:"Import",importJson:"Import JSON",export:"Export",exportJson:"Export JSON",fold:"Fold tree",unfold:"Unfold tree",hidePreview:"Hide live preview",showPreview:"Show live preview",changeTheme:"Change theme",close:"Close",importTitle:"Import JSON Data",importDescription:"Bring the JSON data into the editor.
Please enter the JSON formatted text in the following input field or attach a file.",importPlaceholder:"JSON source code",jsonFile:"JSON File",getRandomCode:"Get random code",loadData:"Load data",exportTitle:"Export JSON Data",exportDescription:"The content edited in the editor can be saved as JSON data.
You can copy the JSON code or save it as a file.",exportSaveFile:"Save File",aboutDescription:'"JSON Editor" is an editor that edits JSON data in a web browser.
This program was created for those who cannot use text editing tools or to easily handle JSON data.
This editor can be used by inserting it into a web project component.',aboutInformation:"Information",languageLabel:{en:"English",ko:"Korean",jp:"Japanese"},editor:{nodeChangeSort:"Change node sort",nodeContextMenu:"Node context menu",nodeFold:"Collapse/Expand",contextChangeType:"Change type",contextInsertNode:"Insert",contextTypeObject:"Object",contextTypeArray:"Array",contextTypeString:"String",contextTypeNumber:"Number",contextTypeBoolean:"Boolean",contextTypeNull:"Null",contextDuplicate:"Duplicate",contextRemove:"Remove"}},ko:{preview:"프리뷰",data:"데이터",view:"보기",language:"언어",about:"정보",clear:"초기화",import:"가져오기",importJson:"JSON 가져오기",export:"내보내기",exportJson:"JSON 내보내기",fold:"접기",unfold:"펼치기",hidePreview:"프리뷰 숨기기",showPreview:"프리뷰 보기",changeTheme:"테마 변경하기",close:"닫기",importTitle:"JSON 데이터 가져오기",importDescription:"JSON 데이터를 에디터로 가져옵니다.
입력창에 JSON 형식의 텍스트를 입력하거나 파일을 첨부해 주세요.",importPlaceholder:"JSON 소스코드",jsonFile:"JSON 파일",getRandomCode:"무작위 코드 가져오기",loadData:"데이터 불러오기",exportTitle:"JSON 데이터 내보내기",exportDescription:"에디터에서 편집한 내용을 JSON 데이터로 저장할 수 있습니다.
JSON 코드를 복사하거나 파일로 저장할 수 있습니다.",exportSaveFile:"파일로 저장",aboutDescription:'"JSON Editor"는 웹브라우저에서 JSON 데이터를 편집하는 에디터입니다.
텍스트 편집툴을 사용할 수 없거나 JSON 데이터를 손쉽게 다루기 위하여 만들어진 프로그램 입니다.
이 에디터는 웹 프로젝트 컴포넌트에 삽입하여 사용할 수 있습니다.',aboutInformation:"정보",languageLabel:{en:"영어",ko:"한국어",jp:"일본어"},editor:{nodeChangeSort:"노드 순서변경",nodeContextMenu:"노드 메뉴",nodeFold:"접기/펼치기",contextChangeType:"타입변경",contextInsertNode:"추가",contextTypeObject:"객체",contextTypeArray:"배열",contextTypeString:"문자",contextTypeNumber:"숫자",contextTypeBoolean:"부울",contextTypeNull:"널",contextDuplicate:"복제",contextRemove:"삭제"}},jp:{preview:"プレビュー",data:"データ",view:"ビュー",language:"言語",about:"について",clear:"リセット",import:"インポート",importJson:"JSON インポート",export:"エクスポート",exportJson:"JSON エクスポート",fold:"折る",unfold:"広げる",hidePreview:"プレビューを隠す",showPreview:"プレビューを見る",changeTheme:"テーマを変更する",close:"閉じる",importTitle:"JSONデータのインポート",importDescription:"JSONデータをエディタにインポートします。
入力ウィンドウにJSON形式のテキストを入力するか、ファイルを添付してください。",importPlaceholder:"JSONソースコード",jsonFile:"JSONファイル",getRandomCode:"ランダムコードの取得",loadData:"データを読み込む",exportTitle:"JSONデータのエクスポート",exportDescription:"エディタで編集した内容をJSONデータとして保存できます。
JSONコードをコピーしたりファイルとして保存したりできます。",exportSaveFile:"ファイルに保存",aboutDescription:"「JSON Editor」は、WebブラウザでJSONデータを編集するエディタです。
テキスト編集ツールが利用できない、またはJSONデータを簡単に扱うために作成されたプログラムです。
このエディタはWebプロジェクトコンポーネントに挿入して使用できます。",aboutInformation:"情報",languageLabel:{en:"英語",ko:"韓国語",jp:"日本語"},editor:{nodeChangeSort:"ノード順序の変更",nodeContextMenu:"ノードメニュー",nodeFold:"折る/広げる",contextChangeType:"タイプ変更",contextInsertNode:"追加",contextTypeObject:"オブジェクト",contextTypeArray:"配列",contextTypeString:"文字",contextTypeNumber:"数字",contextTypeBoolean:"ブール値",contextTypeNull:"ヌル",contextDuplicate:"複製",contextRemove:"削除"}}};function bs(e){return Object.assign({},An.en,An[e])}const Be={theme:"json-editor-theme",source:"json-editor-source",language:"json-editor-language"},ht=(()=>{const e=document.querySelector("html"),t=pt(Be.theme)||e.dataset.theme||"light",n=["light","dark"],{subscribe:s,set:i,update:r}=nt(t);function l(o){e.dataset.theme=o,jt(Be.theme,o)}return l(t),{subscribe:s,change:o=>r(a=>{if(!n.includes(o)||a===o)return a;const c=document.querySelector("html");return c.classList.add("transition-theme"),setTimeout(()=>c.classList.remove("transition-theme"),160),l(o),o})}})(),mt=(()=>{let e;try{const r=pt(Be.source);e=r?JSON.parse(r):{}}catch{e={}}const t=nt(e),{subscribe:n,set:s,update:i}=t;return{subscribe:n,update:r=>i(l=>(jt(Be.source,JSON.stringify(r,null)),r)),preview:()=>JSON.stringify(os(t),null,2),existStorageData:()=>!!pt(Be.source)}})(),Rt=(()=>{const e=["en","ko","jp"];let t;try{t=pt(Be.language)||e[0]}catch{t=e[0]}const{subscribe:n,set:s,update:i}=nt(t);function r(l){document.querySelector("html").setAttribute("lang",l)}return r(t),{subscribe:n,set:s,change:l=>i(o=>!e.includes(l)||o===l?o:(jt(Be.language,l),Ae.set(bs(l)),r(l),l))}})(),Ae=nt(bs(os(Rt)));function wi(e){const t=window.getSelection(),n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}function $i(e,t="data.json"){const n=new Blob([e],{type:"application/json"}),s=window.URL.createObjectURL(n),i=document.createElement("a");i.href=s,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(s)}function it(e){return`0${e}`.slice(-2)}function ki(e,t){let n=t.replace(/\{yyyy\}/,String(e.getFullYear()));return n=n.replace(/\{MM\}/,it(e.getMonth()+1)),n=n.replace(/\{dd\}/,it(e.getDate())),n=n.replace(/\{hh\}/,it(e.getHours())),n=n.replace(/\{mm\}/,it(e.getMinutes())),n=n.replace(/\{ss\}/,it(e.getSeconds())),n}async function vs(){try{return await(await fetch("https://random-data-api.com/api/v2/beers")).json()}catch{return null}}function Ni(e){let t,n,s,i,r,l,o,a;return{c(){t=X("svg"),n=X("g"),s=X("path"),i=X("path"),r=X("path"),l=X("defs"),o=X("clipPath"),a=X("rect"),u(s,"d","M263.306 61.975L78.479 111.499C74.7429 112.5 72.5232 116.345 73.5243 120.081L81.9772 151.628C82.9783 155.364 86.8229 157.583 90.559 156.582L275.386 107.058C287.832 103.723 295.22 90.9276 291.885 78.4808C288.55 66.0341 275.754 58.6467 263.307 61.9818L263.306 61.975ZM272.065 94.6655C266.461 96.1671 260.694 92.8376 259.192 87.2335C257.691 81.6294 261.02 75.8624 266.624 74.3608C272.229 72.8592 277.995 76.1888 279.497 81.7929C280.999 87.3969 277.669 93.1639 272.065 94.6655Z"),u(s,"class","svelte-jjp1ei"),u(i,"d","M214.598 15.4259L29.7649 64.9519C26.0288 65.9529 23.8091 69.7976 24.8102 73.5336L33.2631 105.08C34.2642 108.816 38.1088 111.036 41.8449 110.035L226.678 60.509C239.125 57.1739 246.513 44.3785 243.177 31.9318C239.841 19.4782 227.045 12.0908 214.598 15.4259ZM223.358 48.1164C217.754 49.618 211.987 46.2885 210.485 40.6844C208.983 35.0803 212.313 29.3134 217.917 27.8117C223.521 26.3101 229.288 29.6397 230.79 35.2438C232.291 40.8479 228.962 46.6148 223.358 48.1164Z"),u(i,"class","svelte-jjp1ei"),u(r,"d","M221.852 132.675L37.025 182.2C33.2889 183.201 31.0692 187.045 32.0703 190.781L40.5232 222.328C41.5243 226.064 45.3689 228.284 49.105 227.283L233.932 177.759C246.378 174.424 253.766 161.628 250.431 149.181C247.096 136.735 234.3 129.347 221.853 132.682L221.852 132.675ZM230.611 165.366C225.007 166.868 219.24 163.538 217.738 157.934C216.237 152.33 219.566 146.563 225.17 145.061C230.774 143.56 236.541 146.889 238.043 152.493C239.545 158.097 236.215 163.864 230.611 165.366Z"),u(r,"class","svelte-jjp1ei"),u(n,"clip-path","url(#clip0_103_462)"),u(a,"width","280.027"),u(a,"height","161.805"),u(a,"fill","white"),u(a,"transform","translate(0.458473 72.8045) rotate(-15)"),u(o,"id","clip0_103_462"),u(t,"viewBox","0 0 313 230"),u(t,"fill","none"),u(t,"xmlns","http://www.w3.org/2000/svg"),u(t,"class","svelte-jjp1ei")},m(c,f){x(c,t,f),d(t,n),d(n,s),d(n,i),d(n,r),d(t,l),d(l,o),d(o,a)},p:ee,i:ee,o:ee,d(c){c&&A(t)}}}class _s extends ue{constructor(t){super(),ce(this,t,null,Ni,le,{})}}const xn=""+new URL("feather-sprite-BfIm3Xr9.svg",import.meta.url).href;function Mn(e){let t,n,s,i;return{c(){t=X("svg"),n=X("use"),u(n,"href",s=`${xn}#${e[0]}`),u(t,"xmlns","http://www.w3.org/2000/svg"),u(t,"width","24"),u(t,"height","24"),u(t,"fill","none"),u(t,"stroke","currentColor"),u(t,"stroke-width","2"),u(t,"stroke-linecap","round"),u(t,"stroke-linejoin","round"),u(t,"class",i=Tn(`icon icon--${e[0]}`)+" svelte-1vuos0h")},m(r,l){x(r,t,l),d(t,n)},p(r,l){l&1&&s!==(s=`${xn}#${r[0]}`)&&u(n,"href",s),l&1&&i!==(i=Tn(`icon icon--${r[0]}`)+" svelte-1vuos0h")&&u(t,"class",i)},d(r){r&&A(t)}}}function Si(e){let t,n=e[0]&&Mn(e);return{c(){n&&n.c(),t=sn()},m(s,i){n&&n.m(s,i),x(s,t,i)},p(s,[i]){s[0]?n?n.p(s,i):(n=Mn(s),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},i:ee,o:ee,d(s){s&&A(t),n&&n.d(s)}}}function Ti(e,t,n){let{name:s}=t;return e.$$set=i=>{"name"in i&&n(0,s=i.name)},[s]}class pe extends ue{constructor(t){super(),ce(this,t,Ti,Si,le,{name:0})}}function Dn(e){let t,n,s;return n=new pe({props:{name:"chevron-down"}}),{c(){t=b("i"),H(n.$$.fragment),u(t,"class","dropdown-icon svelte-h4bj7u")},m(i,r){x(i,t,r),J(n,t,null),s=!0},i(i){s||(N(n.$$.fragment,i),s=!0)},o(i){O(n.$$.fragment,i),s=!1},d(i){i&&A(t),B(n)}}}function Ei(e){let t,n,s,i,r,l,o,a;n=new pe({props:{name:e[0]}});let c=e[2]&&Dn();return{c(){t=b("i"),H(n.$$.fragment),s=j(),i=b("span"),r=re(e[1]),l=j(),c&&c.c(),o=sn(),u(t,"class","icon svelte-h4bj7u"),u(i,"class","label svelte-h4bj7u")},m(f,h){x(f,t,h),J(n,t,null),x(f,s,h),x(f,i,h),d(i,r),x(f,l,h),c&&c.m(f,h),x(f,o,h),a=!0},p(f,[h]){const m={};h&1&&(m.name=f[0]),n.$set(m),(!a||h&2)&&de(r,f[1]),f[2]?c?h&4&&N(c,1):(c=Dn(),c.c(),N(c,1),c.m(o.parentNode,o)):c&&(Le(),O(c,1,1,()=>{c=null}),je())},i(f){a||(N(n.$$.fragment,f),N(c),a=!0)},o(f){O(n.$$.fragment,f),O(c),a=!1},d(f){f&&(A(t),A(s),A(i),A(l),A(o)),B(n),c&&c.d(f)}}}function Oi(e,t,n){let{icon:s}=t,{label:i}=t,{dropdown:r=!1}=t;return e.$$set=l=>{"icon"in l&&n(0,s=l.icon),"label"in l&&n(1,i=l.label),"dropdown"in l&&n(2,r=l.dropdown)},[s,i,r]}class bt extends ue{constructor(t){super(),ce(this,t,Oi,Ei,le,{icon:0,label:1,dropdown:2})}}function Jn(e,t,n){const s=e.slice();return s[3]=t[n].key,s[4]=t[n].label,s[5]=t[n].icon,s[6]=t[n].active,s[7]=t[n].disabled,s}function Bn(e){let t,n;return t=new pe({props:{name:e[5]}}),{c(){H(t.$$.fragment)},m(s,i){J(t,s,i),n=!0},p(s,i){const r={};i&1&&(r.name=s[5]),t.$set(r)},i(s){n||(N(t.$$.fragment,s),n=!0)},o(s){O(t.$$.fragment,s),n=!1},d(s){B(t,s)}}}function Hn(e){let t,n,s,i=e[4]+"",r,l,o,a,c,f,h,m=e[5]&&Bn(e);return{c(){t=b("li"),n=b("button"),m&&m.c(),s=j(),r=re(i),a=j(),u(n,"type","button"),u(n,"data-key",l=e[3]),n.disabled=o=e[7],u(n,"class","svelte-jyag6i"),fe(n,"active",e[6]),u(t,"class","svelte-jyag6i")},m(g,_){x(g,t,_),d(t,n),m&&m.m(n,null),d(n,s),d(n,r),d(t,a),c=!0,f||(h=te(n,"click",e[1]),f=!0)},p(g,_){g[5]?m?(m.p(g,_),_&1&&N(m,1)):(m=Bn(g),m.c(),N(m,1),m.m(n,s)):m&&(Le(),O(m,1,1,()=>{m=null}),je()),(!c||_&1)&&i!==(i=g[4]+"")&&de(r,i),(!c||_&1&&l!==(l=g[3]))&&u(n,"data-key",l),(!c||_&1&&o!==(o=g[7]))&&(n.disabled=o),(!c||_&1)&&fe(n,"active",g[6])},i(g){c||(N(m),c=!0)},o(g){O(m),c=!1},d(g){g&&A(t),m&&m.d(),f=!1,h()}}}function Li(e){let t,n,s=jn(e[0]),i=[];for(let l=0;lO(i[l],1,1,()=>{i[l]=null});return{c(){t=b("menu");for(let l=0;l{"items"in l&&n(0,i=l.items)},[i,r]}class It extends ue{constructor(t){super(),ce(this,t,ji,Li,le,{items:0})}}function Ri(e){let t,n,s,i,r,l,o,a,c,f,h;return i=new pe({props:{name:"sun"}}),o=new pe({props:{name:"moon"}}),{c(){t=b("button"),n=b("span"),s=b("i"),H(i.$$.fragment),r=j(),l=b("i"),H(o.$$.fragment),u(s,"class","sun svelte-1hsu9m5"),u(l,"class","moon svelte-1hsu9m5"),u(n,"class","svelte-1hsu9m5"),u(t,"type","button"),u(t,"title",a=e[1].changeTheme),u(t,"class","switch-theme svelte-1hsu9m5"),fe(t,"switch-theme--dark",e[0]==="dark")},m(m,g){x(m,t,g),d(t,n),d(n,s),J(i,s,null),d(n,r),d(n,l),J(o,l,null),c=!0,f||(h=te(t,"click",e[2]),f=!0)},p(m,[g]){(!c||g&2&&a!==(a=m[1].changeTheme))&&u(t,"title",a),(!c||g&1)&&fe(t,"switch-theme--dark",m[0]==="dark")},i(m){c||(N(i.$$.fragment,m),N(o.$$.fragment,m),c=!0)},o(m){O(i.$$.fragment,m),O(o.$$.fragment,m),c=!1},d(m){m&&A(t),B(i),B(o),f=!1,h()}}}function Ai(e,t,n){let s,i;ie(e,ht,l=>n(0,s=l)),ie(e,Ae,l=>n(1,i=l));function r(){ht.change(s==="dark"?"light":"dark")}return[s,i,r]}class xi extends ue{constructor(t){super(),ce(this,t,Ai,Ri,le,{})}}function Mi(e){let t,n,s,i,r,l,o,a,c,f,h,m,g,_,p,v,k,S,w,L,R,P,V,Q,W,he,z,q,Z,K,ne,Y,U,M,G,$e,Ee;return i=new _s({}),f=new bt({props:{icon:"database",label:e[1].data,dropdown:!0}}),g=new It({props:{items:[{key:"new",label:e[1].clear,icon:"file"},{key:"import",label:e[1].import,icon:"download"},{key:"export",label:e[1].export,icon:"upload"}]}}),g.$on("select",e[9]),k=new bt({props:{icon:"eye",label:e[1].view,dropdown:!0}}),L=new It({props:{items:[{key:"fold",label:e[1].fold,icon:"minimize-2"},{key:"unfold",label:e[1].unfold,icon:"maximize-2"},{key:"toggle-live-preview",label:e[2]?e[1].hidePreview:e[1].showPreview,icon:"code"}]}}),L.$on("select",e[10]),Q=new bt({props:{icon:"globe",label:e[1].language,dropdown:!0}}),z=new It({props:{items:Rn.map(e[11])}}),z.$on("select",e[12]),ne=new bt({props:{icon:"cloud",label:e[1].about,dropdown:!1}}),M=new xi({}),{c(){t=b("header"),n=b("div"),s=b("h1"),H(i.$$.fragment),r=j(),l=b("nav"),o=b("menu"),a=b("li"),c=b("div"),H(f.$$.fragment),h=j(),m=b("div"),H(g.$$.fragment),_=j(),p=b("li"),v=b("div"),H(k.$$.fragment),S=j(),w=b("div"),H(L.$$.fragment),R=j(),P=b("li"),V=b("div"),H(Q.$$.fragment),W=j(),he=b("div"),H(z.$$.fragment),q=j(),Z=b("li"),K=b("button"),H(ne.$$.fragment),Y=j(),U=b("nav"),H(M.$$.fragment),u(s,"class","header__logo svelte-1w20j2o"),u(c,"data-name","data"),u(c,"class","gnb__button svelte-1w20j2o"),u(m,"class","gnb__sub svelte-1w20j2o"),u(a,"class","gnb__item svelte-1w20j2o"),fe(a,"on",e[0]==="data"),u(v,"data-name","view"),u(v,"class","gnb__button svelte-1w20j2o"),u(w,"class","gnb__sub svelte-1w20j2o"),u(p,"class","gnb__item svelte-1w20j2o"),fe(p,"on",e[0]==="view"),u(V,"data-name","language"),u(V,"class","gnb__button svelte-1w20j2o"),u(he,"class","gnb__sub svelte-1w20j2o"),u(P,"class","gnb__item svelte-1w20j2o"),fe(P,"on",e[0]==="language"),u(K,"type","button"),u(K,"class","gnb__button svelte-1w20j2o"),u(Z,"class","gnb__item svelte-1w20j2o"),u(o,"class","gnb svelte-1w20j2o"),u(l,"class","header__body"),u(U,"class","header__side svelte-1w20j2o"),u(n,"class","header__wrap svelte-1w20j2o"),u(t,"class","header svelte-1w20j2o")},m(D,be){x(D,t,be),d(t,n),d(n,s),J(i,s,null),d(n,r),d(n,l),d(l,o),d(o,a),d(a,c),J(f,c,null),d(a,h),d(a,m),J(g,m,null),d(o,_),d(o,p),d(p,v),J(k,v,null),d(p,S),d(p,w),J(L,w,null),d(o,R),d(o,P),d(P,V),J(Q,V,null),d(P,W),d(P,he),J(z,he,null),d(o,q),d(o,Z),d(Z,K),J(ne,K,null),d(n,Y),d(n,U),J(M,U,null),G=!0,$e||(Ee=[te(c,"click",e[5]),te(a,"click",vt(e[8])),te(v,"click",e[5]),te(p,"click",vt(e[7])),te(V,"click",e[5]),te(P,"click",vt(e[6])),te(K,"click",e[13])],$e=!0)},p(D,[be]){const vn={};be&2&&(vn.label=D[1].data),f.$set(vn);const _n={};be&2&&(_n.items=[{key:"new",label:D[1].clear,icon:"file"},{key:"import",label:D[1].import,icon:"download"},{key:"export",label:D[1].export,icon:"upload"}]),g.$set(_n),(!G||be&1)&&fe(a,"on",D[0]==="data");const yn={};be&2&&(yn.label=D[1].view),k.$set(yn);const Cn={};be&6&&(Cn.items=[{key:"fold",label:D[1].fold,icon:"minimize-2"},{key:"unfold",label:D[1].unfold,icon:"maximize-2"},{key:"toggle-live-preview",label:D[2]?D[1].hidePreview:D[1].showPreview,icon:"code"}]),L.$set(Cn),(!G||be&1)&&fe(p,"on",D[0]==="view");const wn={};be&2&&(wn.label=D[1].language),Q.$set(wn);const $n={};be&10&&($n.items=Rn.map(D[11])),z.$set($n),(!G||be&1)&&fe(P,"on",D[0]==="language");const kn={};be&2&&(kn.label=D[1].about),ne.$set(kn)},i(D){G||(N(i.$$.fragment,D),N(f.$$.fragment,D),N(g.$$.fragment,D),N(k.$$.fragment,D),N(L.$$.fragment,D),N(Q.$$.fragment,D),N(z.$$.fragment,D),N(ne.$$.fragment,D),N(M.$$.fragment,D),G=!0)},o(D){O(i.$$.fragment,D),O(f.$$.fragment,D),O(g.$$.fragment,D),O(k.$$.fragment,D),O(L.$$.fragment,D),O(Q.$$.fragment,D),O(z.$$.fragment,D),O(ne.$$.fragment,D),O(M.$$.fragment,D),G=!1},d(D){D&&A(t),B(i),B(f),B(g),B(k),B(L),B(Q),B(z),B(ne),B(M),$e=!1,Ce(Ee)}}}function Di(e,t,n){let s,i,r;ie(e,Ae,w=>n(1,s=w)),ie(e,Yt,w=>n(2,i=w)),ie(e,Rt,w=>n(3,r=w));const l=Pe();let o;function a(w,L){var P;let R;L&&(R=(P=L.detail)==null?void 0:P.key),l("select-menu",{main:w,sub:R}),f()}function c(w){const{name:L}=w.currentTarget.dataset;n(0,o=o===L?void 0:L)}function f(){n(0,o=void 0)}Lt(()=>{window.addEventListener("click",f)}),rn(()=>{window.removeEventListener("click",f)});function h(w){_t.call(this,e,w)}function m(w){_t.call(this,e,w)}function g(w){_t.call(this,e,w)}return[o,s,i,r,a,c,h,m,g,w=>a("data",w),w=>a("view",w),w=>({key:w,label:s.languageLabel[w],active:r===w}),w=>a("language",w),()=>a("about")]}class Ji extends ue{constructor(t){super(),ce(this,t,Di,Mi,le,{})}}const Ne=document,Tt=window,ys=Ne.documentElement,Ie=Ne.createElement.bind(Ne),Cs=Ie("div"),Ft=Ie("table"),Bi=Ie("tbody"),Pn=Ie("tr"),{isArray:At,prototype:ws}=Array,{concat:Hi,filter:ln,indexOf:$s,map:ks,push:Pi,slice:Ns,some:an,splice:Ii}=ws,Fi=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,Vi=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,Ui=/<.+>/,Zi=/^\w+$/;function cn(e,t){const n=qi(t);return!e||!n&&!He(t)&&!se(t)?[]:!n&&Vi.test(e)?t.getElementsByClassName(e.slice(1).replace(/\\/g,"")):!n&&Zi.test(e)?t.getElementsByTagName(e):t.querySelectorAll(e)}class xt{constructor(t,n){if(!t)return;if(zt(t))return t;let s=t;if(ae(t)){const i=n||Ne;if(s=Fi.test(t)&&He(i)?i.getElementById(t.slice(1).replace(/\\/g,"")):Ui.test(t)?Es(t):zt(i)?i.find(t):ae(i)?y(i).find(t):cn(t,i),!s)return}else if(Fe(t))return this.ready(t);(s.nodeType||s===Tt)&&(s=[s]),this.length=s.length;for(let i=0,r=this.length;i{for(;t.firstChild;)t.removeChild(t.firstChild)})};function Et(...e){const t=zi(e[0])?e.shift():!1,n=e.shift(),s=e.length;if(!n)return{};if(!s)return Et(t,y,n);for(let i=0;i{se(r)&&oe(n,(l,o)=>{s?t?r.classList.add(o):r.classList.remove(o):r.classList.toggle(o)})})};C.addClass=function(e){return this.toggleClass(e,!0)};C.removeAttr=function(e){const t=Mt(e);return this.each((n,s)=>{se(s)&&oe(t,(i,r)=>{s.removeAttribute(r)})})};function Wi(e,t){if(e){if(ae(e)){if(arguments.length<2){if(!this[0]||!se(this[0]))return;const n=this[0].getAttribute(e);return gt(n)?void 0:n}return ge(t)?this:gt(t)?this.removeAttr(e):this.each((n,s)=>{se(s)&&s.setAttribute(e,t)})}for(const n in e)this.attr(n,e[n]);return this}}C.attr=Wi;C.removeClass=function(e){return arguments.length?this.toggleClass(e,!1):this.attr("class","")};C.hasClass=function(e){return!!e&&an.call(this,t=>se(t)&&t.classList.contains(e))};C.get=function(e){return ge(e)?Ns.call(this):(e=Number(e),this[e<0?e+this.length:e])};C.eq=function(e){return y(this.get(e))};C.first=function(){return this.eq(0)};C.last=function(){return this.eq(-1)};function Gi(e){return ge(e)?this.get().map(t=>se(t)||Yi(t)?t.textContent:"").join(""):this.each((t,n)=>{se(n)&&(n.textContent=e)})}C.text=Gi;function Se(e,t,n){if(!se(e))return;const s=Tt.getComputedStyle(e,null);return n?s.getPropertyValue(t)||void 0:s[t]||e.style[t]}function _e(e,t){return parseInt(Se(e,t),10)||0}function In(e,t){return _e(e,`border${t?"Left":"Top"}Width`)+_e(e,`padding${t?"Left":"Top"}`)+_e(e,`padding${t?"Right":"Bottom"}`)+_e(e,`border${t?"Right":"Bottom"}Width`)}const Vt={};function Xi(e){if(Vt[e])return Vt[e];const t=Ie(e);Ne.body.insertBefore(t,null);const n=Se(t,"display");return Ne.body.removeChild(t),Vt[e]=n!=="none"?n:"block"}function Fn(e){return Se(e,"display")==="none"}function Ts(e,t){const n=e&&(e.matches||e.webkitMatchesSelector||e.msMatchesSelector);return!!n&&!!t&&n.call(e,t)}function Dt(e){return ae(e)?(t,n)=>Ts(n,e):Fe(e)?e:zt(e)?(t,n)=>e.is(n):e?(t,n)=>n===e:()=>!1}C.filter=function(e){const t=Dt(e);return y(ln.call(this,(n,s)=>t.call(n,s,n)))};function xe(e,t){return t?e.filter(t):e}C.detach=function(e){return xe(this,e).each((t,n)=>{n.parentNode&&n.parentNode.removeChild(n)}),this};const Qi=/^\s*<(\w+)[^>]*>/,eo=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,Vn={"*":Cs,tr:Bi,td:Pn,th:Pn,thead:Ft,tbody:Ft,tfoot:Ft};function Es(e){if(!ae(e))return[];if(eo.test(e))return[Ie(RegExp.$1)];const t=Qi.test(e)&&RegExp.$1,n=Vn[t]||Vn["*"];return n.innerHTML=e,y(n.childNodes).detach().get()}y.parseHTML=Es;C.has=function(e){const t=ae(e)?(n,s)=>cn(e,s).length:(n,s)=>s.contains(e);return this.filter(t)};C.not=function(e){const t=Dt(e);return this.filter((n,s)=>(!ae(e)||se(s))&&!t.call(s,n,s))};function Te(e,t,n,s){const i=[],r=Fe(t),l=s&&Dt(s);for(let o=0,a=e.length;ot.selected&&!t.disabled&&!t.parentNode.disabled),"value"):e.value||""}function to(e){return arguments.length?this.each((t,n)=>{const s=n.multiple&&n.options;if(s||Js.test(n.type)){const i=At(e)?ks.call(e,String):gt(e)?[]:[String(e)];s?oe(n.options,(r,l)=>{l.selected=i.indexOf(l.value)>=0},!0):n.checked=i.indexOf(n.value)>=0}else n.value=ge(e)||gt(e)?"":e}):this[0]&&Os(this[0])}C.val=to;C.is=function(e){const t=Dt(e);return an.call(this,(n,s)=>t.call(n,s,n))};y.guid=1;function we(e){return e.length>1?ln.call(e,(t,n,s)=>$s.call(s,t)===n):e}y.unique=we;C.add=function(e,t){return y(we(this.get().concat(y(e,t).get())))};C.children=function(e){return xe(y(we(Te(this,t=>t.children))),e)};C.parent=function(e){return xe(y(we(Te(this,"parentNode"))),e)};C.index=function(e){const t=e?y(e)[0]:this[0],n=e?this:y(t).parent().children();return $s.call(n,t)};C.closest=function(e){const t=this.filter(e);if(t.length)return t;const n=this.parent();return n.length?n.closest(e):t};C.siblings=function(e){return xe(y(we(Te(this,t=>y(t).parent().children().not(t)))),e)};C.find=function(e){return y(we(Te(this,t=>cn(e,t))))};const no=/^\s*\s*$/g,so=/^$|^module$|\/(java|ecma)script/i,io=["type","src","nonce","noModule"];function oo(e,t){const n=y(e);n.filter("script").add(n.find("script")).each((s,i)=>{if(so.test(i.type)&&ys.contains(i)){const r=Ie("script");r.text=i.textContent.replace(no,""),oe(io,(l,o)=>{i[o]&&(r[o]=i[o])}),t.head.insertBefore(r,null),t.head.removeChild(r)}})}function ro(e,t,n,s,i){s?e.insertBefore(t,n?e.firstChild:null):e.nodeName==="HTML"?e.parentNode.replaceChild(t,e):e.parentNode.insertBefore(t,n?e:e.nextSibling),i&&oo(t,e.ownerDocument)}function Me(e,t,n,s,i,r,l,o){return oe(e,(a,c)=>{oe(y(c),(f,h)=>{oe(y(t),(m,g)=>{const _=n?h:g,p=n?g:h,v=n?f:m;ro(_,v?p.cloneNode(!0):p,s,i,!v)},o)},l)},r),t}C.after=function(){return Me(arguments,this,!1,!1,!1,!0,!0)};C.append=function(){return Me(arguments,this,!1,!1,!0)};function lo(e){if(!arguments.length)return this[0]&&this[0].innerHTML;if(ge(e))return this;const t=/]/.test(e);return this.each((n,s)=>{se(s)&&(t?y(s).empty().append(e):s.innerHTML=e)})}C.html=lo;C.appendTo=function(e){return Me(arguments,this,!0,!1,!0)};C.wrapInner=function(e){return this.each((t,n)=>{const s=y(n),i=s.contents();i.length?i.wrapAll(e):s.append(e)})};C.before=function(){return Me(arguments,this,!1,!0)};C.wrapAll=function(e){let t=y(e),n=t[0];for(;n.children.length;)n=n.firstElementChild;return this.first().before(t),this.appendTo(n)};C.wrap=function(e){return this.each((t,n)=>{const s=y(e)[0];y(n).wrapAll(t?s.cloneNode(!0):s)})};C.insertAfter=function(e){return Me(arguments,this,!0,!1,!1,!1,!1,!0)};C.insertBefore=function(e){return Me(arguments,this,!0,!0)};C.prepend=function(){return Me(arguments,this,!1,!0,!0,!0,!0)};C.prependTo=function(e){return Me(arguments,this,!0,!0,!0,!1,!1,!0)};C.contents=function(){return y(we(Te(this,e=>e.tagName==="IFRAME"?[e.contentDocument]:e.tagName==="TEMPLATE"?e.content.childNodes:e.childNodes)))};C.next=function(e,t,n){return xe(y(we(Te(this,"nextElementSibling",t,n))),e)};C.nextAll=function(e){return this.next(e,!0)};C.nextUntil=function(e,t){return this.next(t,!0,e)};C.parents=function(e,t){return xe(y(we(Te(this,"parentElement",!0,t))),e)};C.parentsUntil=function(e,t){return this.parents(t,e)};C.prev=function(e,t,n){return xe(y(we(Te(this,"previousElementSibling",t,n))),e)};C.prevAll=function(e){return this.prev(e,!0)};C.prevUntil=function(e,t){return this.prev(t,!0,e)};C.map=function(e){return y(Hi.apply([],ks.call(this,(t,n)=>e.call(t,n,t))))};C.clone=function(){return this.map((e,t)=>t.cloneNode(!0))};C.offsetParent=function(){return this.map((e,t)=>{let n=t.offsetParent;for(;n&&Se(n,"position")==="static";)n=n.offsetParent;return n||ys})};C.slice=function(e,t){return y(Ns.call(this,e,t))};const ao=/-([a-z])/g;function fn(e){return e.replace(ao,(t,n)=>n.toUpperCase())}C.ready=function(e){const t=()=>setTimeout(e,0,y);return Ne.readyState!=="loading"?t():Ne.addEventListener("DOMContentLoaded",t),this};C.unwrap=function(){return this.parent().each((e,t)=>{if(t.tagName==="BODY")return;const n=y(t);n.replaceWith(n.children())}),this};C.offset=function(){const e=this[0];if(!e)return;const t=e.getBoundingClientRect();return{top:t.top+Tt.pageYOffset,left:t.left+Tt.pageXOffset}};C.position=function(){const e=this[0];if(!e)return;const t=Se(e,"position")==="fixed",n=t?e.getBoundingClientRect():this.offset();if(!t){const s=e.ownerDocument;let i=e.offsetParent||s.documentElement;for(;(i===s.body||i===s.documentElement)&&Se(i,"position")==="static";)i=i.parentNode;if(i!==e&&se(i)){const r=y(i).offset();n.top-=r.top+_e(i,"borderTopWidth"),n.left-=r.left+_e(i,"borderLeftWidth")}}return{top:n.top-_e(e,"marginTop"),left:n.left-_e(e,"marginLeft")}};const Ls={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};C.prop=function(e,t){if(e){if(ae(e))return e=Ls[e]||e,arguments.length<2?this[0]&&this[0][e]:this.each((n,s)=>{s[e]=t});for(const n in e)this.prop(n,e[n]);return this}};C.removeProp=function(e){return this.each((t,n)=>{delete n[Ls[e]||e]})};const co=/^--/;function dn(e){return co.test(e)}const Ut={},{style:uo}=Cs,fo=["webkit","moz","ms"];function po(e,t=dn(e)){if(t)return e;if(!Ut[e]){const n=fn(e),s=`${n[0].toUpperCase()}${n.slice(1)}`,i=`${n} ${fo.join(`${s} `)}${s}`.split(" ");oe(i,(r,l)=>{if(l in uo)return Ut[e]=l,!1})}return Ut[e]}const ho={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function js(e,t,n=dn(e)){return!n&&!ho[e]&&Ss(t)?`${t}px`:t}function mo(e,t){if(ae(e)){const n=dn(e);return e=po(e,n),arguments.length<2?this[0]&&Se(this[0],e,n):e?(t=js(e,t,n),this.each((s,i)=>{se(i)&&(n?i.style.setProperty(e,t):i.style[e]=t)})):this}for(const n in e)this.css(n,e[n]);return this}C.css=mo;function Rs(e,t){try{return e(t)}catch{return t}}const go=/^\s+|\s+$/;function Un(e,t){const n=e.dataset[t]||e.dataset[fn(t)];return go.test(n)?n:Rs(JSON.parse,n)}function bo(e,t,n){n=Rs(JSON.stringify,n),e.dataset[fn(t)]=n}function vo(e,t){if(!e){if(!this[0])return;const n={};for(const s in this[0].dataset)n[s]=Un(this[0],s);return n}if(ae(e))return arguments.length<2?this[0]&&Un(this[0],e):ge(t)?this:this.each((n,s)=>{bo(s,e,t)});for(const n in e)this.data(n,e[n]);return this}C.data=vo;function As(e,t){const n=e.documentElement;return Math.max(e.body[`scroll${t}`],n[`scroll${t}`],e.body[`offset${t}`],n[`offset${t}`],n[`client${t}`])}oe([!0,!1],(e,t)=>{oe(["Width","Height"],(n,s)=>{const i=`${t?"outer":"inner"}${s}`;C[i]=function(r){if(this[0])return tt(this[0])?t?this[0][`inner${s}`]:this[0].document.documentElement[`client${s}`]:He(this[0])?As(this[0],s):this[0][`${t?"offset":"client"}${s}`]+(r&&t?_e(this[0],`margin${n?"Top":"Left"}`)+_e(this[0],`margin${n?"Bottom":"Right"}`):0)}})});oe(["Width","Height"],(e,t)=>{const n=t.toLowerCase();C[n]=function(s){if(!this[0])return ge(s)?void 0:this;if(!arguments.length)return tt(this[0])?this[0].document.documentElement[`client${t}`]:He(this[0])?As(this[0],t):this[0].getBoundingClientRect()[n]-In(this[0],!e);const i=parseInt(s,10);return this.each((r,l)=>{if(!se(l))return;const o=Se(l,"boxSizing");l.style[n]=js(n,i+(o==="border-box"?In(l,!e):0))})}});const Zn="___cd";C.toggle=function(e){return this.each((t,n)=>{if(!se(n))return;const s=Fn(n);(ge(e)?s:e)?(n.style.display=n[Zn]||"",Fn(n)&&(n.style.display=Xi(n.tagName))):s||(n[Zn]=Se(n,"display"),n.style.display="none")})};C.hide=function(){return this.toggle(!1)};C.show=function(){return this.toggle(!0)};const qn="___ce",pn=".",hn={focus:"focusin",blur:"focusout"},xs={mouseenter:"mouseover",mouseleave:"mouseout"},_o=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function mn(e){return xs[e]||hn[e]||e}function gn(e){const t=e.split(pn);return[t[0],t.slice(1).sort()]}C.trigger=function(e,t){if(ae(e)){const[s,i]=gn(e),r=mn(s);if(!r)return this;const l=_o.test(r)?"MouseEvents":"HTMLEvents";e=Ne.createEvent(l),e.initEvent(r,!0,!0),e.namespace=i.join(pn),e.___ot=s}e.___td=t;const n=e.___ot in hn;return this.each((s,i)=>{n&&Fe(i[e.___ot])&&(i[`___i${e.type}`]=!0,i[e.___ot](),i[`___i${e.type}`]=!1),i.dispatchEvent(e)})};function Ms(e){return e[qn]=e[qn]||{}}function yo(e,t,n,s,i){const r=Ms(e);r[t]=r[t]||[],r[t].push([n,s,i]),e.addEventListener(t,i)}function Ds(e,t){return!t||!an.call(t,n=>e.indexOf(n)<0)}function Ot(e,t,n,s,i){const r=Ms(e);if(t)r[t]&&(r[t]=r[t].filter(([l,o,a])=>{if(i&&a.guid!==i.guid||!Ds(l,n)||s&&s!==o)return!0;e.removeEventListener(t,a)}));else for(t in r)Ot(e,t,n,s,i)}C.off=function(e,t,n){if(ge(e))this.each((s,i)=>{!se(i)&&!He(i)&&!tt(i)||Ot(i)});else if(ae(e))Fe(t)&&(n=t,t=""),oe(Mt(e),(s,i)=>{const[r,l]=gn(i),o=mn(r);this.each((a,c)=>{!se(c)&&!He(c)&&!tt(c)||Ot(c,o,l,t,n)})});else for(const s in e)this.off(s,e[s]);return this};C.remove=function(e){return xe(this,e).detach().off(),this};C.replaceWith=function(e){return this.before(e).remove()};C.replaceAll=function(e){return y(e).replaceWith(this),this};function Co(e,t,n,s,i){if(!ae(e)){for(const r in e)this.on(r,t,n,e[r],i);return this}return ae(t)||(ge(t)||gt(t)?t="":ge(n)?(n=t,t=""):(s=n,n=t,t="")),Fe(s)||(s=n,n=void 0),s?(oe(Mt(e),(r,l)=>{const[o,a]=gn(l),c=mn(o),f=o in xs,h=o in hn;c&&this.each((m,g)=>{if(!se(g)&&!He(g)&&!tt(g))return;const _=function(p){if(p.target[`___i${p.type}`])return p.stopImmediatePropagation();if(p.namespace&&!Ds(a,p.namespace.split(pn))||!t&&(h&&(p.target!==g||p.___ot===c)||f&&p.relatedTarget&&g.contains(p.relatedTarget)))return;let v=g;if(t){let S=p.target;for(;!Ts(S,t);)if(S===g||(S=S.parentNode,!S))return;v=S}Object.defineProperty(p,"currentTarget",{configurable:!0,get(){return v}}),Object.defineProperty(p,"delegateTarget",{configurable:!0,get(){return g}}),Object.defineProperty(p,"data",{configurable:!0,get(){return n}});const k=s.call(v,p,p.___td);i&&Ot(g,c,a,t,_),k===!1&&(p.preventDefault(),p.stopPropagation())};_.guid=s.guid=s.guid||y.guid++,yo(g,c,a,t,_)})}),this):this}C.on=Co;function wo(e,t,n,s){return this.on(e,t,n,s,!0)}C.one=wo;const $o=/\r?\n/g;function ko(e,t){return`&${encodeURIComponent(e)}=${encodeURIComponent(t.replace($o,`\r -`))}`}const No=/file|reset|submit|button|image/i,Js=/radio|checkbox/i;C.serialize=function(){let e="";return this.each((t,n)=>{oe(n.elements||[n],(s,i)=>{if(i.disabled||!i.name||i.tagName==="FIELDSET"||No.test(i.type)||Js.test(i.type)&&!i.checked)return;const r=Os(i);if(!ge(r)){const l=At(r)?r:[r];oe(l,(o,a)=>{e+=ko(i.name,a)})}})}),e.slice(1)};const So={live:!1,theme:"system",edit:"all",openDepth:0,node:void 0},To={open:!0,callback:void 0},T={OBJECT:"object",ARRAY:"array",STRING:"string",NUMBER:"number",BOOLEAN:"boolean",NULL:"null"},Ze={START:"pointerdown",MOVE:"pointermove",END:"pointerup.json-editor pointercancel.json-editor"},ze={CLICK:"click.json-editor-context",KEYUP:"keyup.json-editor-context"},ot={START:"drag-over-start",END:"drag-over-end",ALL:"drag-over-start drag-over-end"},Eo='',Oo='',Lo='',Bs={object:'',array:'',string:'',number:'',boolean:'',null:''};var Je,Ge,ye,Hs,Ps,Is,Fs;class jo{constructor(t,n,s=!1){De(this,ye);De(this,Je);ve(this,"el",{node:void 0,type:void 0,dialog:void 0});De(this,Ge);Oe(this,Je,t),this.el.node=y(n),Oe(this,Ge,String(this.el.node.data("type"))),this.el.type=this.el.node.find("& > .node__body > .type"),this.el.type.addClass("open"),this.el.dialog=E(this,ye,Ps).call(this,E(this,ye,Hs).call(this),I(this,Ge),s),this.el.dialog.on("click",i=>i.stopPropagation()),this.el.dialog.find("button").on("click",i=>E(this,ye,Is).call(this,i)),I(this,Je).el.wrap.get(0).dispatchEvent(new CustomEvent("context",{detail:{body:this.el.dialog.get(0),node:this.el.node.get(0),type:I(this,Ge),isRoot:s,$:y}})),this.el.type.append(this.el.dialog),y(window).on(ze.CLICK,i=>this.close(i)),y(window).on(ze.KEYUP,i=>E(this,ye,Fs).call(this,i))}close(){this.el.type.removeClass("open"),this.el.dialog.remove(),y(window).off(ze.CLICK),y(window).off(ze.KEYUP),delete I(this,Je).context}}Je=new WeakMap,Ge=new WeakMap,ye=new WeakSet,Hs=function(){const{lang:t}=I(this,Je);return[{key:"change-type",label:t.contextChangeType,children:[{key:T.OBJECT,label:t.contextTypeObject},{key:T.ARRAY,label:t.contextTypeArray},{key:T.STRING,label:t.contextTypeString},{key:T.NUMBER,label:t.contextTypeNumber},{key:T.BOOLEAN,label:t.contextTypeBoolean},{key:T.NULL,label:t.contextTypeNull}]},{key:"insert",label:t.contextInsertNode,children:[{key:T.OBJECT,label:t.contextTypeObject},{key:T.ARRAY,label:t.contextTypeArray},{key:T.STRING,label:t.contextTypeString},{key:T.NUMBER,label:t.contextTypeNumber},{key:T.BOOLEAN,label:t.contextTypeBoolean},{key:T.NULL,label:t.contextTypeNull}]},{key:"duplicate",label:t.contextDuplicate},{key:"remove",label:t.contextRemove}]},Ps=function(t,n,s=!1){function i(o,a){let c="";const{key:f,label:h,children:m}=o;if(s)switch(f){case T.STRING:case T.NUMBER:case T.BOOLEAN:case T.NULL:if(a==="change-type")return"";break;case"duplicate":case"remove":return""}let g="",_="",p="";switch(f){case"change-type":g=' class="dropdown"',p=" disabled";break;case"insert":if([T.STRING,T.NUMBER,T.BOOLEAN,T.NULL].indexOf(n)>-1)return"";g=' class="dropdown"',p=" disabled";break;case"duplicate":g=' class="duplicate"',p=' data-mode="duplicate"';break;case"remove":g=' class="remove"',p=' data-mode="remove"';break;case T.OBJECT:case T.ARRAY:case T.STRING:case T.NUMBER:case T.BOOLEAN:case T.NULL:g=' class="type"',_=`${Bs[f]}`,p=` data-mode="${a}" data-type="${f}"`,a==="change-type"&&f===n&&(p=" disabled");break}return c+=``,c+=`",(m==null?void 0:m.length)>0&&(c+='
',c+=r(m,f),c+="
"),c+="",c}function r(o,a=void 0){let c="
    ";for(let f in o)c+=i(o[f],a);return c+="
",c}let l=`",y(l)},Is=function(t){const n=y(t.currentTarget),s=n.data("mode");let i=String(n.data("type"));i=i==="undefined"?"":i,this.close(),this.selectItem&&typeof this.selectItem=="function"&&this.selectItem(this.el.node,s,i)},Fs=function(t){t.code==="Escape"&&this.close()};function Yn(e){return e==null?"null":Array.isArray(e)?"array":typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="boolean"?"boolean":"object"}function Ro(e){try{return typeof e=="string"?JSON.parse(e):Array.isArray(e)?Object.assign([],e):y.isPlainObject(e)?Object.assign({},e):{}}catch(t){console.error("error",t.message)}}function Ao(e){return Array.isArray(e)?e.length:y.isPlainObject(e)?Object.keys(e).length:0}function zn(e){if(e.ctrlKey||e.metaKey)switch(e.code){case"KeyB":case"KeyI":case"KeyU":return!0}return!1}function Kn(e){e.preventDefault();const t=e.currentTarget,n=document.createRange();n.selectNodeContents(t);const s=window.getSelection();s.removeAllRanges(),s.addRange(n)}function Wn(e){e.preventDefault();let n=(e.originalEvent||e).clipboardData.getData("text/plain");document.execCommand("insertText",!1,n)}const xo={nodeChangeSort:"Change node sort",nodeContextMenu:"Node context menu",nodeFold:"Collapse/Expand",contextChangeType:"Change type",contextInsertNode:"Insert",contextTypeObject:"Object",contextTypeArray:"Array",contextTypeString:"String",contextTypeNumber:"Number",contextTypeBoolean:"Boolean",contextTypeNull:"Null",contextDuplicate:"Duplicate",contextRemove:"Remove"};var F,Xe,$,Vs,Wt,Ct,Us,Zs,wt,rt,Gt,me,Xt,lt,Qt,en,at,$t,kt,qs,Ys,zs;class Kt{constructor(t,n={}){De(this,$);ve(this,"$");ve(this,"el",{wrap:null,body:null,tree:null});ve(this,"options");ve(this,"context");De(this,F);De(this,Xe,!1);ve(this,"lang",xo);this.$=y,this.el.wrap=y(t),this.el.body=y('
'),this.options=new Proxy(Object.assign({},So,n),{get:(s,i)=>s[i],set:E(this,$,Vs).bind(this)}),this.updateLanguage(),this.el.wrap.append(this.el.body),E(this,$,Wt).call(this,this.options.theme),E(this,$,Qt).call(this,this.options.edit),this.replace(n.node||{},{},!1),E(this,$,en).call(this,n.openDepth)}addNode(t,n,s={},i=!0,r=!0){s={...To,...s};const{open:l,callback:o}=s;t=y(t);const a=n.type===void 0?Yn(n.value):n.type,c=E(this,$,Ct).call(this,a,!1);E(this,$,wt).call(this,c,{...n,open:l,type:a,depth:t.data("depth")+1}),E(this,$,at).call(this,c),t.find("& > .node__children > ul").append(c),r&&E(this,$,lt).call(this,t),(a===T.ARRAY||a===T.OBJECT)&&o&&typeof o=="function"&&o(c.get(0),n.value),i&&E(this,$,me).call(this)}removeNode(t,n=!0){t=y(t);const s=t.parent().closest(".node");t.remove(),E(this,$,lt).call(this,s),n&&E(this,$,me).call(this)}changeType(t,n,s=!0){const i=y(t),r={key:i.find("& > .node__body .key").text(),value:E(this,$,Gt).call(this,i),type:n,open:i.hasClass("open"),depth:i.data("depth")},l=i.find("& > .node__children > .tree").html(),o=i.hasClass("root");i.empty(),i.html(E(this,$,Ct).call(this,n,o).html()),l&&i.find("& > .node__children > .tree").html(l),E(this,$,wt).call(this,i,r),E(this,$,at).call(this,i),i.attr("data-type",n),s&&E(this,$,me).call(this)}changeKey(t,n){y(t).find(".key > div").text(n),E(this,$,me).call(this)}changeValue(t,n){y(t).find(".value > div").text(n),E(this,$,me).call(this)}duplicate(t,n=!0){t=y(t);const s=y(t.get(0).outerHTML);E(this,$,at).call(this,s),t.after(s),E(this,$,lt).call(this,t.parent().closest(".node")),n&&E(this,$,me).call(this)}fold(t,n){t=y(t),n===void 0?t.toggleClass("open"):n===!0?t.addClass("open"):t.removeClass("open")}clear(){this.el.tree&&(this.el.body.empty(),this.replace({},{},!1),E(this,$,me).call(this))}destroy(){y(window).off(Ze.END).off(ze.CLICK).off(ze.KEYUP),this.el.wrap.empty()}replace(t,n={},s=!0){this.el.body.empty(),t=Ro(t);const i=E(this,$,Us).call(this,t);this.import(i,t,!1,!1),s&&E(this,$,me).call(this),n!=null&&n.openDepth&&E(this,$,en).call(this,n==null?void 0:n.openDepth)}import(t,n,s=!0,i=!0){t=y(t),y.each(n,(r,l)=>{const o={key:r,value:l},a={open:!1,callback:(c,f)=>this.import(c,f,!1,!1)};this.addNode(t,o,a,!1,!1)}),i&&E(this,$,lt).call(this,t),s&&E(this,$,me).call(this)}export(t=void 0,n,s=2){let i=E(this,$,Xt).call(this,t);if(n){let r=2;return s===!0?r=" ":typeof s===T.NUMBER&&(r=s),JSON.stringify(i,null,r)}else return i}updateLanguage(){}}F=new WeakMap,Xe=new WeakMap,$=new WeakSet,Vs=function(t,n,s){switch(t[n]=s,n){case"theme":E(this,$,Wt).call(this,s);break;case"edit":E(this,$,Qt).call(this,s);break}return!0},Wt=function(t){t=["system","light","dark"].indexOf(t)>-1?t:"system",this.el.body.attr("data-theme",t)},Ct=function(t,n=!1){const{lang:s}=this;let i=`
  • `;return i+='
    ',n||(i+=`
    ${Lo}
    `),i+=`
    `,(t===T.OBJECT||t===T.ARRAY)&&(i+=``),n||(i+='
    '),i+='',n||(i+='
    '),i+="
    ",i+='
      ',i+="
    • ",y(i)},Us=function(t){const n=Yn(t),s=E(this,$,Ct).call(this,n,!0);return E(this,$,wt).call(this,s,{key:void 0,value:t,type:n,open:!0,depth:0}),E(this,$,at).call(this,s),this.el.tree=y("
        "),this.el.tree.append(s),this.el.body.append(this.el.tree),s},Zs=function(t,n,s){switch(n){case"change-type":this.changeType(t,s);break;case"insert":this.fold(t,!0),this.addNode(t,{key:"",value:"",type:s});break;case"duplicate":this.duplicate(t);break;case"remove":this.removeNode(t);break}},wt=function(t,n){const{key:s,value:i,type:r,open:l,depth:o}=n,a=t.hasClass("root"),c=t.children(".node__body");if(c.find(".type > button").html(`${Bs[r]}`),(r===T.OBJECT||r===T.ARRAY)&&this.fold(t,l),o!==void 0&&t.attr("data-depth",o),!a){c.find(".key").html(`
        ${s}
        `);const f=c.find(".value");let h;switch(r){case T.STRING:f.html(`
        ${String(i)}
        `);break;case T.NUMBER:h=Number(i),isNaN(h)&&(h=0),f.html(``);break;case T.BOOLEAN:h=i==="false"?!1:!!i,f.html(``);break;case T.NULL:f.html('NULL');break}}if(r===T.OBJECT||r===T.ARRAY){const f=Ao(i);isNaN(f)||c.find(".count").text(f)}},rt=function(t){return String(t.data("type"))},Gt=function(t){const n=E(this,$,rt).call(this,t),s=t.find("& > .node__body > .value");switch(n){case T.OBJECT:case T.ARRAY:return"";case T.STRING:return s.children(".type-string").get(0).innerText||"";case T.NUMBER:return Number(s.children(".type-number").val());case T.BOOLEAN:return s.children(".type-boolean").data("value");case T.NULL:return null}},me=function(){this.options.live&&this.el.wrap.get(0).dispatchEvent(new CustomEvent("update",{detail:E(this,$,Xt).call(this)}))},Xt=function(t){const n=(r,l)=>{let o=l===T.ARRAY?[]:{};return r.find("& > .node__children > ul > li").each((c,f)=>{if(!(l===T.ARRAY||l===T.OBJECT))return!0;f=y(f);const h=E(this,$,rt).call(this,f);switch(h){case T.OBJECT:case T.ARRAY:switch(l){case T.ARRAY:o.push(n(f,h));break;case T.OBJECT:const g=f.find("& > .node__body > .key").text();g&&(o[g]=n(f,h));break}break;case T.STRING:case T.NUMBER:case T.BOOLEAN:case T.NULL:const m=E(this,$,Gt).call(this,f);switch(l){case T.ARRAY:o.push(m);break;case T.OBJECT:const g=f.find("& > .node__body > .key").text();g&&(o[g]=m);break}break}}),o};t=y(t);const s=(t==null?void 0:t.length)>0?t:this.el.tree.children(".node"),i=E(this,$,rt).call(this,s);if([T.OBJECT,T.ARRAY].includes(i))return n(s,i)},lt=function(t){t=y(t);const n=E(this,$,rt).call(this,t);if(!(n==="object"||n==="array"))return;const s=t.find("& > .node__children > ul > li").length;isNaN(s)||t.find("& > .node__body > .count").text(s)},Qt=function(t){t==="all"?this.el.body.removeAttr("data-edit"):this.el.body.attr("data-edit",t)},en=function(t=0){if(!(t>0))return;this.el.body.find(".node:not(.root)").each((s,i)=>{y(i).data("depth") button").on("click",async o=>{if(o.stopPropagation(),this.options.edit!=="all")return;const a=y(o.currentTarget);if(a.parent().hasClass("open"))this.context&&this.context.close();else{this.context&&this.context.close();const c=a.closest(".node").hasClass("root");this.context=new jo(this,a.closest(".node"),c),this.context.selectItem=(f,h,m)=>E(this,$,Zs).call(this,f,h,m)}}),t.find(".fold").on("click",o=>{const c=y(o.currentTarget).closest(".node");this.fold(c)});const s=t.find(".key > .label-field");s.length&&(s.on("keydown",o=>{if(this.options.edit==="all"&&(o.code==="Enter"||zn(o)))return o.preventDefault()}).on("input",o=>E(this,$,$t).call(this,o)).on("blur",o=>E(this,$,kt).call(this,o)),this.options.edit!=="all"?s.on("dblclick",Kn):s.on("paste",Wn));const i=t.find(".value > .type-string");i.length&&(i.on("keydown",o=>{if(this.options.edit!=="none"&&zn(o))return o.preventDefault()}).on("input",o=>E(this,$,$t).call(this,o)).on("blur",o=>E(this,$,kt).call(this,o)),this.options.edit==="none"?i.on("dblclick",Kn):i.on("paste",Wn));const r=t.find(".value > .type-number");r.length&&r.on("keydown",o=>{this.options.edit==="none"&&o.preventDefault()}).on("input",o=>E(this,$,$t).call(this,o)).on("blur",o=>E(this,$,kt).call(this,o));const l=t.find(".value > .type-boolean");l.length&&l.on("click",o=>{if(this.options.edit==="none")return;const a=y(o.currentTarget),c=!a.data("value");a.data("value",c).find("i").text(c.toString().toUpperCase()),E(this,$,me).call(this)})},$t=function(){Oe(this,Xe,!0)},kt=function(){I(this,Xe)&&(E(this,$,me).call(this),Oe(this,Xe,!1))},qs=function(t){if(Oe(this,F,{}),I(this,F).$node=y(t.currentTarget).closest(".node"),I(this,F).$area=I(this,F).$node.parent(),I(this,F).$nodes=I(this,F).$area.children(".node"),I(this,F).$nodes.length<2){Oe(this,F,void 0);return}I(this,F).$nodes.on(Ze.MOVE,E(this,$,Ys).bind(this)),y(window).on(Ze.END,E(this,$,zs).bind(this))},Ys=function(t){let n;if(t.pointerType==="touch"){const{clientX:o,clientY:a}=t,c=document.elementFromPoint(o,a).closest(".node");if(!I(this,F).$nodes.get().includes(c))return;n=y(c)}else n=y(t.currentTarget);const s=n.children(".node__body");if(!(s.length>0))return;const{y:i,height:r}=s.get(0).getBoundingClientRect(),l=r*.5n(5,s=v)),ie(e,ht,v=>n(6,i=v)),ie(e,Ae,v=>n(7,r=v)),ie(e,Rt,v=>n(1,l=v));const o=Pe();let a,c;ht.subscribe(v=>{c&&(c.options.theme=v)});function f({detail:v}){mt.update(v),o("update",{src:v})}function h({detail:{body:v,node:k,type:S,isRoot:w,$:L}}){if(!["object","array"].includes(S))return;const R=[{key:"import",label:r.importJson},{key:"export",label:r.exportJson}],P=L(R.map(V=>`
      • `).join(""));P.find("button").on("click",V=>{c.context.close();const Q=V.currentTarget.dataset.mode;o("action",{main:"editor",sub:Q,node:k})}),w?L(v).find("& > ol").append(P):L(v).find("& > ol > .remove").before(P)}function m(){Kt.prototype.updateLanguage=function(){Object.assign(this.lang,r.editor)},c=new Kt(a,{live:!0,theme:i}),c.replace(s,{},!1),a.addEventListener("update",f),a.addEventListener("context",h),o("init",{instance:c})}function g(){c&&(c.destroy(),c=void 0,a.removeEventListener("update",f),a.removeEventListener("context",h))}function _(){a&&(g(),m())}Lt(()=>m()),rn(()=>g());function p(v){dt[v?"unshift":"push"](()=>{a=v,n(0,a)})}return e.$$.update=()=>{e.$$.dirty&2&&_()},[a,l,p]}class Jo extends ue{constructor(t){super(),ce(this,t,Do,Mo,le,{})}}function Bo(e){let t,n,s,i,r,l,o,a=e[1].preview+"",c,f,h,m,g,_;return r=new pe({props:{name:"code"}}),{c(){t=b("article"),n=b("div"),s=b("header"),i=b("h1"),H(r.$$.fragment),l=j(),o=b("span"),c=re(a),f=j(),h=b("div"),m=b("pre"),g=re(e[0]),u(i,"class","svelte-1wub0nx"),u(s,"class","preview__header svelte-1wub0nx"),u(m,"class","svelte-1wub0nx"),u(h,"class","preview__body scroll-area svelte-1wub0nx"),u(n,"class","preview__wrap svelte-1wub0nx"),u(t,"class","preview svelte-1wub0nx")},m(p,v){x(p,t,v),d(t,n),d(n,s),d(s,i),J(r,i,null),d(i,l),d(i,o),d(o,c),d(n,f),d(n,h),d(h,m),d(m,g),_=!0},p(p,[v]){(!_||v&2)&&a!==(a=p[1].preview+"")&&de(c,a),(!_||v&1)&&de(g,p[0])},i(p){_||(N(r.$$.fragment,p),_=!0)},o(p){O(r.$$.fragment,p),_=!1},d(p){p&&A(t),B(r)}}}function Ho(e,t,n){let s,i,r;return ie(e,mt,l=>n(2,i=l)),ie(e,Ae,l=>n(1,r=l)),e.$$.update=()=>{e.$$.dirty&4&&n(0,s=JSON.stringify(i,null,2))},[s,r,i]}class Po extends ue{constructor(t){super(),ce(this,t,Ho,Bo,le,{})}}function Io(e){let t,n,s,i;const r=e[5].default,l=rs(r,e,e[4],null);return{c(){t=b("button"),l&&l.c(),u(t,"type",e[0]),t.disabled=e[1],u(t,"class","button svelte-pnoqr8"),fe(t,"button--color-key",e[2]==="key")},m(o,a){x(o,t,a),l&&l.m(t,null),n=!0,s||(i=te(t,"click",e[3]),s=!0)},p(o,[a]){l&&l.p&&(!n||a&16)&&cs(l,r,o,o[4],n?as(r,o[4],a,null):us(o[4]),null),(!n||a&1)&&u(t,"type",o[0]),(!n||a&2)&&(t.disabled=o[1]),(!n||a&4)&&fe(t,"button--color-key",o[2]==="key")},i(o){n||(N(l,o),n=!0)},o(o){O(l,o),n=!1},d(o){o&&A(t),l&&l.d(o),s=!1,i()}}}function Fo(e,t,n){let{$$slots:s={},$$scope:i}=t;const r=Pe();let{type:l="button"}=t,{disabled:o=!1}=t,{color:a=void 0}=t;function c(f){r("click",{nativeEvent:f})}return e.$$set=f=>{"type"in f&&n(0,l=f.type),"disabled"in f&&n(1,o=f.disabled),"color"in f&&n(2,a=f.color),"$$scope"in f&&n(4,i=f.$$scope)},[l,o,a,c,i,s]}class ut extends ue{constructor(t){super(),ce(this,t,Fo,Io,le,{type:0,disabled:1,color:2})}}function Gn(e){let t,n,s,i,r,l;return n=new pe({props:{name:"alert-circle"}}),{c(){t=b("div"),H(n.$$.fragment),s=j(),i=b("p"),r=re(e[2]),u(i,"class","svelte-vfkenl"),u(t,"class","help-message svelte-vfkenl")},m(o,a){x(o,t,a),J(n,t,null),d(t,s),d(t,i),d(i,r),l=!0},p(o,a){(!l||a&4)&&de(r,o[2])},i(o){l||(N(n.$$.fragment,o),l=!0)},o(o){O(n.$$.fragment,o),l=!1},d(o){o&&A(t),B(n)}}}function Vo(e){let t,n,s,i=e[3].jsonFile+"",r,l;return t=new pe({props:{name:"upload"}}),{c(){H(t.$$.fragment),n=j(),s=b("span"),r=re(i)},m(o,a){J(t,o,a),x(o,n,a),x(o,s,a),d(s,r),l=!0},p(o,a){(!l||a&8)&&i!==(i=o[3].jsonFile+"")&&de(r,i)},i(o){l||(N(t.$$.fragment,o),l=!0)},o(o){O(t.$$.fragment,o),l=!1},d(o){o&&(A(n),A(s)),B(t,o)}}}function Uo(e){let t,n,s,i=e[3].getRandomCode+"",r,l;return t=new pe({props:{name:"upload"}}),{c(){H(t.$$.fragment),n=j(),s=b("span"),r=re(i)},m(o,a){J(t,o,a),x(o,n,a),x(o,s,a),d(s,r),l=!0},p(o,a){(!l||a&8)&&i!==(i=o[3].getRandomCode+"")&&de(r,i)},i(o){l||(N(t.$$.fragment,o),l=!0)},o(o){O(t.$$.fragment,o),l=!1},d(o){o&&(A(n),A(s)),B(t,o)}}}function Zo(e){let t,n,s,i=e[3].loadData+"",r,l;return t=new pe({props:{name:"check"}}),{c(){H(t.$$.fragment),n=j(),s=b("span"),r=re(i)},m(o,a){J(t,o,a),x(o,n,a),x(o,s,a),d(s,r),l=!0},p(o,a){(!l||a&8)&&i!==(i=o[3].loadData+"")&&de(r,i)},i(o){l||(N(t.$$.fragment,o),l=!0)},o(o){O(t.$$.fragment,o),l=!1},d(o){o&&(A(n),A(s)),B(t,o)}}}function qo(e){let t,n,s,i,r=e[3].importTitle+"",l,o,a,c=e[3].importDescription+"",f,h,m,g,_,p,v,k,S,w,L,R,P,V,Q,W,he,z,q,Z,K,ne,Y=e[2]&&Gn(e);return V=new ut({props:{type:"button",$$slots:{default:[Vo]},$$scope:{ctx:e}}}),V.$on("click",e[5]),W=new ut({props:{type:"button",$$slots:{default:[Uo]},$$scope:{ctx:e}}}),W.$on("click",e[7]),q=new ut({props:{type:"submit",color:"key",$$slots:{default:[Zo]},$$scope:{ctx:e}}}),{c(){t=b("article"),n=b("div"),s=b("header"),i=b("h1"),l=re(r),o=j(),a=b("p"),f=j(),h=b("form"),m=b("fieldset"),g=b("legend"),g.textContent="source code field",_=j(),p=b("textarea"),k=j(),Y&&Y.c(),S=j(),w=b("nav"),L=b("div"),R=b("input"),P=j(),H(V.$$.fragment),Q=j(),H(W.$$.fragment),he=j(),z=b("div"),H(q.$$.fragment),u(i,"class","svelte-vfkenl"),u(a,"class","svelte-vfkenl"),u(s,"class","data__header svelte-vfkenl"),u(g,"class","svelte-vfkenl"),u(p,"placeholder",v=e[3].importPlaceholder),u(p,"class","scroll-area svelte-vfkenl"),u(m,"class","source-input svelte-vfkenl"),u(R,"type","file"),u(R,"accept","application/json"),u(R,"class","json-uploader__file svelte-vfkenl"),u(L,"class","json-uploader svelte-vfkenl"),u(z,"class","svelte-vfkenl"),u(w,"class","nav-submit svelte-vfkenl"),u(h,"class","form svelte-vfkenl"),u(n,"class","data__wrap svelte-vfkenl"),u(t,"class","data svelte-vfkenl")},m(U,M){x(U,t,M),d(t,n),d(n,s),d(s,i),d(i,l),d(s,o),d(s,a),a.innerHTML=c,d(n,f),d(n,h),d(h,m),d(m,g),d(m,_),d(m,p),Ye(p,e[0]),d(m,k),Y&&Y.m(m,null),d(h,S),d(h,w),d(w,L),d(L,R),e[10](R),d(L,P),J(V,L,null),d(L,Q),J(W,L,null),d(w,he),d(w,z),J(q,z,null),Z=!0,K||(ne=[te(p,"input",e[9]),te(p,"keydown",e[4]),te(R,"change",e[6]),te(h,"submit",ii(e[8]))],K=!0)},p(U,[M]){(!Z||M&8)&&r!==(r=U[3].importTitle+"")&&de(l,r),(!Z||M&8)&&c!==(c=U[3].importDescription+"")&&(a.innerHTML=c),(!Z||M&8&&v!==(v=U[3].importPlaceholder))&&u(p,"placeholder",v),M&1&&Ye(p,U[0]),U[2]?Y?(Y.p(U,M),M&4&&N(Y,1)):(Y=Gn(U),Y.c(),N(Y,1),Y.m(m,null)):Y&&(Le(),O(Y,1,1,()=>{Y=null}),je());const G={};M&4104&&(G.$$scope={dirty:M,ctx:U}),V.$set(G);const $e={};M&4104&&($e.$$scope={dirty:M,ctx:U}),W.$set($e);const Ee={};M&4104&&(Ee.$$scope={dirty:M,ctx:U}),q.$set(Ee)},i(U){Z||(N(Y),N(V.$$.fragment,U),N(W.$$.fragment,U),N(q.$$.fragment,U),Z=!0)},o(U){O(Y),O(V.$$.fragment,U),O(W.$$.fragment,U),O(q.$$.fragment,U),Z=!1},d(U){U&&A(t),Y&&Y.d(),e[10](null),B(V),B(W),B(q),K=!1,Ce(ne)}}}function Yo(e,t,n){let s;ie(e,Ae,p=>n(3,s=p));const i=Pe();let r,l="",{source:o=""}=t;function a(p){p.metaKey&&p.key==="Enter"&&m()}function c(){r.click()}function f(p){const v=p.target,k=p.target.files[0];if(!(k&&k.type==="application/json")){alert("The file is not a valid JSON.");return}const S=new FileReader;S.onload=w=>{try{const L=String(w.target.result);JSON.parse(L),n(0,o=L)}catch{alert("The data is not valid JSON.")}v.value=""},S.onerror=w=>{alert("File read error."),v.value=""},S.readAsText(k)}async function h(){try{const p=await vs();if(!p)throw new Error("There is no data.");n(0,o=JSON.stringify(p,null,2))}catch(p){alert(p.message),console.error(p)}}function m(){try{if(!o){n(2,l="Please input data.");return}i("submit",{source:o}),n(2,l="")}catch(p){n(2,l=p.message)}}function g(){o=this.value,n(0,o)}function _(p){dt[p?"unshift":"push"](()=>{r=p,n(1,r)})}return e.$$set=p=>{"source"in p&&n(0,o=p.source)},[o,r,l,s,a,c,f,h,m,g,_]}class zo extends ue{constructor(t){super(),ce(this,t,Yo,qo,le,{source:0})}}function Ko(e){let t,n,s,i=e[2].close+"",r,l;return t=new pe({props:{name:"x"}}),{c(){H(t.$$.fragment),n=j(),s=b("span"),r=re(i)},m(o,a){J(t,o,a),x(o,n,a),x(o,s,a),d(s,r),l=!0},p(o,a){(!l||a&4)&&i!==(i=o[2].close+"")&&de(r,i)},i(o){l||(N(t.$$.fragment,o),l=!0)},o(o){O(t.$$.fragment,o),l=!1},d(o){o&&(A(n),A(s)),B(t,o)}}}function Wo(e){let t,n,s,i=e[2].exportSaveFile+"",r,l;return t=new pe({props:{name:"save"}}),{c(){H(t.$$.fragment),n=j(),s=b("span"),r=re(i)},m(o,a){J(t,o,a),x(o,n,a),x(o,s,a),d(s,r),l=!0},p(o,a){(!l||a&4)&&i!==(i=o[2].exportSaveFile+"")&&de(r,i)},i(o){l||(N(t.$$.fragment,o),l=!0)},o(o){O(t.$$.fragment,o),l=!1},d(o){o&&(A(n),A(s)),B(t,o)}}}function Go(e){let t,n,s,i,r=e[2].exportTitle+"",l,o,a,c=e[2].exportDescription+"",f,h,m,g,_,p,v,k,S,w,L,R,P,V,Q,W,he,z,q,Z,K,ne,Y,U;return W=new pe({props:{name:"chevron-down"}}),q=new ut({props:{type:"button",$$slots:{default:[Ko]},$$scope:{ctx:e}}}),q.$on("click",e[8]),K=new ut({props:{type:"button",color:"key",$$slots:{default:[Wo]},$$scope:{ctx:e}}}),K.$on("click",e[5]),{c(){t=b("article"),n=b("div"),s=b("header"),i=b("h1"),l=re(r),o=j(),a=b("p"),f=j(),h=b("div"),m=b("pre"),g=re(e[1]),_=j(),p=b("nav"),v=b("div"),k=b("label"),S=b("select"),w=b("option"),w.textContent="2 Space",L=b("option"),L.textContent="4 Space",R=b("option"),R.textContent="Tab",P=b("option"),P.textContent="Minify",V=j(),Q=b("i"),H(W.$$.fragment),he=j(),z=b("div"),H(q.$$.fragment),Z=j(),H(K.$$.fragment),u(i,"class","svelte-vfkenl"),u(a,"class","svelte-vfkenl"),u(s,"class","data__header svelte-vfkenl"),u(m,"class","svelte-vfkenl"),u(h,"class","source-result scroll-area svelte-vfkenl"),w.__value="2space",Ye(w,w.__value),L.__value="4space",Ye(L,L.__value),R.__value="tab",Ye(R,R.__value),P.__value="minify",Ye(P,P.__value),u(S,"class","svelte-vfkenl"),e[0]===void 0&&Re(()=>e[7].call(S)),u(Q,"class","svelte-vfkenl"),u(k,"class","select-code-style svelte-vfkenl"),u(v,"class","svelte-vfkenl"),u(z,"class","svelte-vfkenl"),u(p,"class","nav-submit svelte-vfkenl"),u(n,"class","data__wrap svelte-vfkenl"),u(t,"class","data svelte-vfkenl")},m(M,G){x(M,t,G),d(t,n),d(n,s),d(s,i),d(i,l),d(s,o),d(s,a),a.innerHTML=c,d(n,f),d(n,h),d(h,m),d(m,g),d(n,_),d(n,p),d(p,v),d(v,k),d(k,S),d(S,w),d(S,L),d(S,R),d(S,P),On(S,e[0],!0),d(k,V),d(k,Q),J(W,Q,null),d(p,he),d(p,z),J(q,z,null),d(z,Z),J(K,z,null),ne=!0,Y||(U=[te(h,"click",e[4]),te(S,"change",e[7])],Y=!0)},p(M,[G]){(!ne||G&4)&&r!==(r=M[2].exportTitle+"")&&de(l,r),(!ne||G&4)&&c!==(c=M[2].exportDescription+"")&&(a.innerHTML=c),(!ne||G&2)&&de(g,M[1]),G&1&&On(S,M[0]);const $e={};G&516&&($e.$$scope={dirty:G,ctx:M}),q.$set($e);const Ee={};G&516&&(Ee.$$scope={dirty:G,ctx:M}),K.$set(Ee)},i(M){ne||(N(W.$$.fragment,M),N(q.$$.fragment,M),N(K.$$.fragment,M),ne=!0)},o(M){O(W.$$.fragment,M),O(q.$$.fragment,M),O(K.$$.fragment,M),ne=!1},d(M){M&&A(t),B(W),B(q),B(K),Y=!1,Ce(U)}}}function Xo(e,t){switch(t){case"2space":return JSON.stringify(e,null,2);case"4space":return JSON.stringify(e,null,4);case"tab":return JSON.stringify(e,null," ");case"minify":return JSON.stringify(e,null)}}function Qo(e,t,n){let s,i;ie(e,Ae,m=>n(2,i=m));const r=Pe();let{source:l={foo:"bar"}}=t,o="2space";function a(m){wi(m.currentTarget.children[0])}function c(){confirm("Do you really want to download this data as a file?")&&$i(s,`data-${ki(new Date,"{yyyy}{MM}{dd}-{hh}{mm}{ss}")}.json`)}function f(){o=ri(this),n(0,o)}const h=()=>r("close");return e.$$set=m=>{"source"in m&&n(6,l=m.source)},e.$$.update=()=>{e.$$.dirty&65&&n(1,s=Xo(l,o))},[o,s,i,r,a,c,l,f,h]}class er extends ue{constructor(t){super(),ce(this,t,Qo,Go,le,{source:6})}}const tr="@redgoose/json-editor",nr="Easy editing JSON data",sr="redgoose ",ir="1.2.0",or=["json","editor","library","tool"],rr="MIT",lr="./lib/json-editor.js",ar="./lib/json-editor.d.ts",cr=["lib"],ur={".":{module:"./lib/json-editor.js",default:"./lib/json-editor.js",types:"./lib/json-editor.d.ts"},"./css":"./lib/json-editor.css","./umd":"./lib/json-editor.umd.cjs"},fr={type:"git",url:"git+https://github.com/redgoose-dev/json-editor.git"},dr={url:"https://github.com/redgoose-dev/json-editor/issues"},pr="https://redgoose-dev.github.io/json-editor",hr="module",mr={dev:"vite --config vite.config/dev.js",docs:"vite --config vite.config/docs.js",prebuild:"rm -rf docs && rm -rf lib",build:"node vite.config/lib.js"},gr=["> 1%","last 2 versions"],br={node:">=20"},vr={"@sveltejs/vite-plugin-svelte":"^3.1.1","cash-dom":"^8.1.5","feather-icons":"^4.29.2",sass:"^1.77.5",svelte:"^4.2.18",vite:"^5.3.1"},_r={name:tr,description:nr,author:sr,version:ir,keywords:or,license:rr,main:lr,types:ar,files:cr,exports:ur,repository:fr,bugs:dr,homepage:pr,type:hr,scripts:mr,browserslist:gr,engines:br,devDependencies:vr};function yr(e){let t,n,s,i,r,l,o,a,c,f,h;return{c(){t=X("svg"),n=X("path"),s=X("path"),i=X("path"),r=X("path"),l=X("path"),o=X("path"),a=X("path"),c=X("path"),f=X("path"),h=X("path"),u(n,"d","M27.1654 34.4985C26.7923 36.3093 26.1007 37.9836 25.0998 39.4941C24.0898 41.0137 22.6975 42.2604 20.8958 43.2522C19.1032 44.235 16.7828 44.7264 13.9438 44.7264C10.395 44.7264 7.43762 43.8073 5.07175 41.9783C2.70587 40.1402 1.13165 37.7925 0.339996 34.908L9.27573 31.896C9.54871 32.9971 10.0492 33.8888 10.7862 34.5531C11.5142 35.2265 12.4151 35.554 13.4797 35.554C15.1358 35.554 16.2278 34.9808 16.7646 33.8433C17.2924 32.6968 17.5654 31.2045 17.5654 29.3482V1.7402H27.7387V29.2936C27.7387 30.9497 27.5476 32.6877 27.1745 34.4985H27.1654Z"),u(n,"fill","currentColor"),u(s,"d","M55.2829 12.6232C54.4185 11.5222 53.281 10.6395 51.8797 9.99348C50.4784 9.34741 49.1316 9.01983 47.8304 9.01983C47.157 9.01983 46.4837 9.07442 45.7921 9.19272C45.1006 9.31101 44.4818 9.5385 43.9267 9.87518C43.3717 10.2119 42.9076 10.6395 42.5345 11.1764C42.1614 11.7042 41.9703 12.3867 41.9703 13.2147C41.9703 13.9245 42.1159 14.5159 42.4162 14.9891C42.7165 15.4623 43.1442 15.8718 43.7174 16.2357C44.2907 16.5906 44.9732 16.9182 45.7557 17.2094C46.5474 17.5097 47.43 17.81 48.4128 18.1284C49.8323 18.6016 51.3064 19.1203 52.8534 19.6936C54.3912 20.2668 55.7925 21.0221 57.0482 21.9684C58.304 22.9148 59.3595 24.0886 60.1876 25.49C61.0156 26.8913 61.4251 28.6384 61.4251 30.7222C61.4251 33.1245 60.9792 35.2083 60.0966 36.9645C59.2048 38.7207 58.0128 40.1675 56.5205 41.314C55.019 42.4606 53.3083 43.3068 51.3792 43.8528C49.4501 44.4079 47.4573 44.6809 45.4008 44.6809C42.4071 44.6809 39.5044 44.1531 36.7108 43.1157C33.9081 42.0693 31.5878 40.5861 29.7315 38.6479L36.3559 31.9051C37.3842 33.17 38.7309 34.2255 40.4052 35.0718C42.0795 35.918 43.7447 36.3457 45.4008 36.3457C46.147 36.3457 46.875 36.2638 47.5938 36.1091C48.3036 35.9544 48.9224 35.6905 49.4592 35.3447C49.9961 34.999 50.4147 34.5167 50.7332 33.9252C51.0516 33.3338 51.2063 32.624 51.2063 31.7959C51.2063 30.9679 51.0061 30.34 50.6149 29.7849C50.2236 29.2299 49.6594 28.7294 48.9315 28.2744C48.2035 27.8194 47.2935 27.41 46.2107 27.0369C45.1279 26.6638 43.8903 26.2543 42.5163 25.8266C41.1787 25.3899 39.8592 24.8803 38.5853 24.2888C37.3023 23.6974 36.1557 22.9421 35.1548 22.0139C34.1538 21.0858 33.344 19.9666 32.7343 18.638C32.1246 17.3186 31.8153 15.708 31.8153 13.8153C31.8153 11.4858 32.2884 9.493 33.2348 7.83689C34.1811 6.18077 35.4278 4.82495 36.9565 3.7603C38.4943 2.69566 40.2323 1.9131 42.1614 1.42172C44.0905 0.930349 46.0469 0.684662 48.0124 0.684662C50.3783 0.684662 52.7897 1.12144 55.2556 1.98589C57.7216 2.85035 59.8782 4.13338 61.7345 5.82589L55.292 12.6323L55.2829 12.6232Z"),u(s,"fill","currentColor"),u(i,"d","M108.815 22.4962C108.815 25.8085 108.242 28.8386 107.105 31.5776C105.958 34.3165 104.375 36.6642 102.346 38.6206C100.316 40.5679 97.896 42.0784 95.1024 43.1431C92.2998 44.2077 89.2696 44.7355 85.9938 44.7355C82.718 44.7355 79.6969 44.2077 76.9125 43.1431C74.1371 42.0784 71.7258 40.5679 69.6966 38.6206C67.6674 36.6642 66.075 34.3256 64.9375 31.5776C63.791 28.8386 63.2268 25.8085 63.2268 22.4962C63.2268 19.184 63.8001 16.1175 64.9375 13.4149C66.0841 10.7123 67.6674 8.41927 69.6966 6.52657C71.7258 4.63387 74.1371 3.17794 76.9125 2.1497C79.6969 1.12145 82.718 0.611877 85.9938 0.611877C89.2696 0.611877 92.2998 1.12145 95.1024 2.1497C97.9051 3.17794 100.316 4.63387 102.346 6.52657C104.375 8.41927 105.967 10.7123 107.105 13.4149C108.251 16.1175 108.815 19.1385 108.815 22.4962ZM97.9961 22.4962C97.9961 20.6854 97.7049 18.9838 97.1134 17.4096C96.522 15.8354 95.703 14.4796 94.6566 13.3603C93.6101 12.232 92.3453 11.3493 90.8712 10.7032C89.397 10.0481 87.7682 9.7296 85.9938 9.7296C84.2194 9.7296 82.5997 10.0572 81.1438 10.7032C79.6878 11.3493 78.423 12.2411 77.3584 13.3603C76.2937 14.4796 75.4748 15.8354 74.9015 17.4096C74.3282 18.9838 74.0461 20.6854 74.0461 22.4962C74.0461 24.307 74.3464 26.136 74.9379 27.7285C75.5294 29.3209 76.3483 30.6949 77.3948 31.8414C78.4412 32.988 79.6878 33.8797 81.1529 34.5349C82.6088 35.181 84.2285 35.5086 86.0029 35.5086C87.7773 35.5086 89.397 35.181 90.853 34.5349C92.3089 33.8888 93.5737 32.988 94.6384 31.8414C95.703 30.6949 96.5311 29.33 97.1225 27.7285C97.714 26.1269 98.0052 24.3889 98.0052 22.4962H97.9961Z"),u(i,"fill","currentColor"),u(r,"d","M139.153 43.6071L122.301 16.2266H122.119L122.356 43.6071H112.537V1.7402H124.066L140.864 29.0661H141.046L140.809 1.7402H150.628V43.6071H139.153Z"),u(r,"fill","currentColor"),u(l,"d","M168.135 43.6071V1.7402H196.289V10.2483H177.899V18.1739H195.288V26.2816H177.899V34.9717H197.354V43.6071H168.135Z"),u(l,"fill","currentColor"),u(o,"d","M240.176 22.5508C240.176 26.2179 239.494 29.3846 238.138 32.0416C236.782 34.6987 234.98 36.8917 232.751 38.6024C230.522 40.3131 228.01 41.5779 225.207 42.3878C222.405 43.1976 219.566 43.598 216.69 43.598H201.076V1.7402H216.217C219.174 1.7402 222.095 2.08599 224.971 2.77755C227.846 3.46911 230.412 4.60655 232.66 6.20807C234.908 7.80049 236.718 9.94797 238.101 12.6232C239.485 15.3076 240.176 18.6198 240.176 22.5599V22.5508ZM229.648 22.5508C229.648 20.1849 229.266 18.2285 228.492 16.6634C227.728 15.1074 226.7 13.8608 225.417 12.9417C224.134 12.0136 222.678 11.3584 221.04 10.958C219.402 10.5667 217.719 10.3666 215.981 10.3666H210.958V34.8534H215.744C217.555 34.8534 219.302 34.6441 220.976 34.2346C222.65 33.816 224.134 33.1427 225.417 32.1963C226.7 31.25 227.728 29.9851 228.492 28.4109C229.266 26.8367 229.648 24.8803 229.648 22.5508Z"),u(o,"fill","currentColor"),u(a,"d","M243.898 43.6071V1.7402H254.071V43.6071H243.898Z"),u(a,"fill","currentColor"),u(c,"d","M277.666 10.3666V43.6071H267.548V10.3666H255.718V1.7402H289.486V10.3666H277.657H277.666Z"),u(c,"fill","currentColor"),u(f,"d","M333.028 22.4962C333.028 25.8085 332.454 28.8386 331.317 31.5776C330.17 34.3165 328.587 36.6642 326.558 38.6206C324.529 40.5679 322.108 42.0784 319.315 43.1431C316.512 44.2077 313.482 44.7355 310.206 44.7355C306.93 44.7355 303.909 44.2077 301.125 43.1431C298.349 42.0784 295.938 40.5679 293.909 38.6206C291.88 36.6642 290.287 34.3256 289.15 31.5776C288.003 28.8386 287.439 25.8085 287.439 22.4962C287.439 19.184 288.012 16.1175 289.15 13.4149C290.296 10.7123 291.88 8.41927 293.909 6.52657C295.938 4.63387 298.349 3.17794 301.125 2.1497C303.909 1.12145 306.93 0.611877 310.206 0.611877C313.482 0.611877 316.512 1.12145 319.315 2.1497C322.117 3.17794 324.529 4.63387 326.558 6.52657C328.587 8.41927 330.18 10.7123 331.317 13.4149C332.464 16.1175 333.028 19.1385 333.028 22.4962ZM322.208 22.4962C322.208 20.6854 321.917 18.9838 321.326 17.4096C320.734 15.8354 319.915 14.4796 318.869 13.3603C317.822 12.232 316.558 11.3493 315.083 10.7032C313.609 10.0481 311.98 9.7296 310.206 9.7296C308.432 9.7296 306.812 10.0572 305.356 10.7032C303.9 11.3493 302.635 12.2411 301.571 13.3603C300.506 14.4796 299.687 15.8354 299.114 17.4096C298.54 18.9838 298.258 20.6854 298.258 22.4962C298.258 24.307 298.559 26.136 299.15 27.7285C299.742 29.3209 300.561 30.6949 301.607 31.8414C302.653 32.988 303.9 33.8797 305.365 34.5349C306.821 35.181 308.441 35.5086 310.215 35.5086C311.99 35.5086 313.609 35.181 315.065 34.5349C316.521 33.8888 317.786 32.988 318.851 31.8414C319.915 30.6949 320.743 29.33 321.335 27.7285C321.926 26.1269 322.217 24.3889 322.217 22.4962H322.208Z"),u(f,"fill","currentColor"),u(h,"d","M359.171 43.6071L350.08 26.9914H346.631V43.6071H336.758V1.7402H352.728C354.739 1.7402 356.705 1.94949 358.616 2.35897C360.526 2.77755 362.246 3.46911 363.757 4.46096C365.267 5.45281 366.487 6.74494 367.397 8.36466C368.307 9.98437 368.762 11.9954 368.762 14.3976C368.762 17.2367 367.988 19.6208 366.45 21.559C364.912 23.4881 362.783 24.8712 360.062 25.6993L371 43.6162H359.171V43.6071ZM358.752 14.5705C358.752 13.5878 358.543 12.787 358.124 12.1774C357.706 11.5677 357.178 11.0945 356.523 10.7578C355.867 10.4211 355.14 10.1937 354.321 10.0754C353.502 9.95707 352.728 9.89338 351.973 9.89338H346.568V19.6481H351.381C352.209 19.6481 353.065 19.5753 353.938 19.4388C354.812 19.3023 355.604 19.0566 356.313 18.7017C357.023 18.3468 357.615 17.8373 358.07 17.1639C358.525 16.4905 358.752 15.6261 358.752 14.5614V14.5705Z"),u(h,"fill","currentColor"),u(t,"viewBox","0 0 371 45"),u(t,"fill","none"),u(t,"xmlns","http://www.w3.org/2000/svg"),u(t,"class","svelte-fc8vwx")},m(m,g){x(m,t,g),d(t,n),d(t,s),d(t,i),d(t,r),d(t,l),d(t,o),d(t,a),d(t,c),d(t,f),d(t,h)},p:ee,i:ee,o:ee,d(m){m&&A(t)}}}class Cr extends ue{constructor(t){super(),ce(this,t,null,yr,le,{})}}function wr(e){let t,n,s,i,r,l,o,a,c,f,h=e[0].aboutDescription+"",m,g,_,p=e[0].aboutInformation+"",v,k,S,w,L,R,P,V,Q,W,he,z,q;return r=new _s({}),a=new Cr({}),{c(){t=b("article"),n=b("div"),s=b("h1"),i=b("i"),H(r.$$.fragment),l=j(),o=b("i"),H(a.$$.fragment),c=j(),f=b("p"),m=j(),g=b("section"),_=b("h2"),v=re(p),k=j(),S=b("ul"),w=b("li"),w.innerHTML='GitHub: https://github.com/redgoose-dev/json-editor',L=j(),R=b("li"),P=re("Version: "),V=b("strong"),V.textContent=`${e[1]}`,Q=j(),W=b("li"),W.innerHTML='Author: https://redgoose.me',he=j(),z=b("li"),z.innerHTML='Feedback: https://github.com/redgoose-dev/json-editor/issues',u(i,"class","symbol svelte-l0njzv"),u(o,"class","label svelte-l0njzv"),u(s,"class","about__logo svelte-l0njzv"),u(f,"class","about__description svelte-l0njzv"),u(_,"class","svelte-l0njzv"),u(S,"class","svelte-l0njzv"),u(g,"class","information svelte-l0njzv"),u(n,"class","about__wrap svelte-l0njzv"),u(t,"class","about svelte-l0njzv")},m(Z,K){x(Z,t,K),d(t,n),d(n,s),d(s,i),J(r,i,null),d(s,l),d(s,o),J(a,o,null),d(n,c),d(n,f),f.innerHTML=h,d(n,m),d(n,g),d(g,_),d(_,v),d(g,k),d(g,S),d(S,w),d(S,L),d(S,R),d(R,P),d(R,V),d(S,Q),d(S,W),d(S,he),d(S,z),q=!0},p(Z,[K]){(!q||K&1)&&h!==(h=Z[0].aboutDescription+"")&&(f.innerHTML=h),(!q||K&1)&&p!==(p=Z[0].aboutInformation+"")&&de(v,p)},i(Z){q||(N(r.$$.fragment,Z),N(a.$$.fragment,Z),q=!0)},o(Z){O(r.$$.fragment,Z),O(a.$$.fragment,Z),q=!1},d(Z){Z&&A(t),B(r),B(a)}}}function $r(e,t,n){let s;ie(e,Ae,r=>n(0,s=r));const i=_r.version;return[s,i]}class kr extends ue{constructor(t){super(),ce(this,t,$r,wr,le,{})}}function Nr(e){let t,n,s,i,r,l,o,a;const c=e[2].default,f=rs(c,e,e[1],null);return r=new pe({props:{name:"x"}}),{c(){t=b("div"),n=b("div"),f&&f.c(),s=j(),i=b("button"),H(r.$$.fragment),u(i,"type","button"),u(i,"class","modal__close svelte-1mk0jit"),u(n,"class","modal__wrap svelte-1mk0jit"),u(t,"class","modal svelte-1mk0jit")},m(h,m){x(h,t,m),d(t,n),f&&f.m(n,null),d(n,s),d(n,i),J(r,i,null),l=!0,o||(a=[te(i,"click",e[0]),te(n,"click",vt(e[3])),te(t,"click",e[0])],o=!0)},p(h,[m]){f&&f.p&&(!l||m&2)&&cs(f,c,h,h[1],l?as(c,h[1],m,null):us(h[1]),null)},i(h){l||(N(f,h),N(r.$$.fragment,h),l=!0)},o(h){O(f,h),O(r.$$.fragment,h),l=!1},d(h){h&&A(t),f&&f.d(h),B(r),o=!1,Ce(a)}}}function Sr(e,t,n){let{$$slots:s={},$$scope:i}=t;const r=Pe();function l(){r("close")}function o(c){c.key==="Escape"&&l()}Lt(()=>{document.querySelector("html").classList.add("opened-modal"),addEventListener("keyup",o)}),rn(()=>{document.querySelector("html").classList.remove("opened-modal"),removeEventListener("keyup",o)});function a(c){_t.call(this,e,c)}return e.$$set=c=>{"$$scope"in c&&n(1,i=c.$$scope)},[l,i,s,a]}class bn extends ue{constructor(t){super(),ce(this,t,Sr,Nr,le,{})}}function Xn(e){let t,n,s;return n=new Po({}),{c(){t=b("div"),H(n.$$.fragment),u(t,"class","layout__preview svelte-1beoswq")},m(i,r){x(i,t,r),J(n,t,null),s=!0},i(i){s||(N(n.$$.fragment,i),s=!0)},o(i){O(n.$$.fragment,i),s=!1},d(i){i&&A(t),B(n)}}}function Qn(e){let t,n,s,i;return n=new bn({props:{$$slots:{default:[Tr]},$$scope:{ctx:e}}}),n.$on("close",e[10]),{c(){t=b("div"),H(n.$$.fragment),u(t,"class","modal-data svelte-1beoswq")},m(r,l){x(r,t,l),J(n,t,null),i=!0},p(r,l){e=r;const o={};l&131073&&(o.$$scope={dirty:l,ctx:e}),n.$set(o)},i(r){i||(N(n.$$.fragment,r),r&&Re(()=>{i&&(s||(s=Qe(t,et,e[4],!0)),s.run(1))}),i=!0)},o(r){O(n.$$.fragment,r),r&&(s||(s=Qe(t,et,e[4],!1)),s.run(0)),i=!1},d(r){r&&A(t),B(n),r&&s&&s.end()}}}function Tr(e){let t,n,s;function i(l){e[8](l)}let r={};return e[0].source!==void 0&&(r.source=e[0].source),t=new zo({props:r}),dt.push(()=>vi(t,"source",i)),t.$on("submit",e[6]),t.$on("close",e[9]),{c(){H(t.$$.fragment)},m(l,o){J(t,l,o),s=!0},p(l,o){const a={};!n&&o&1&&(n=!0,a.source=l[0].source,pi(()=>n=!1)),t.$set(a)},i(l){s||(N(t.$$.fragment,l),s=!0)},o(l){O(t.$$.fragment,l),s=!1},d(l){B(t,l)}}}function es(e){let t,n,s,i;return n=new bn({props:{$$slots:{default:[Er]},$$scope:{ctx:e}}}),n.$on("close",e[12]),{c(){t=b("div"),H(n.$$.fragment),u(t,"class","modal-data svelte-1beoswq")},m(r,l){x(r,t,l),J(n,t,null),i=!0},p(r,l){e=r;const o={};l&131074&&(o.$$scope={dirty:l,ctx:e}),n.$set(o)},i(r){i||(N(n.$$.fragment,r),r&&Re(()=>{i&&(s||(s=Qe(t,et,e[4],!0)),s.run(1))}),i=!0)},o(r){O(n.$$.fragment,r),r&&(s||(s=Qe(t,et,e[4],!1)),s.run(0)),i=!1},d(r){r&&A(t),B(n),r&&s&&s.end()}}}function Er(e){let t,n;return t=new er({props:{source:e[1].source}}),t.$on("close",e[11]),{c(){H(t.$$.fragment)},m(s,i){J(t,s,i),n=!0},p(s,i){const r={};i&2&&(r.source=s[1].source),t.$set(r)},i(s){n||(N(t.$$.fragment,s),n=!0)},o(s){O(t.$$.fragment,s),n=!1},d(s){B(t,s)}}}function ts(e){let t,n,s,i;return n=new bn({props:{$$slots:{default:[Or]},$$scope:{ctx:e}}}),n.$on("close",e[13]),{c(){t=b("div"),H(n.$$.fragment),u(t,"class","modal-about svelte-1beoswq")},m(r,l){x(r,t,l),J(n,t,null),i=!0},p(r,l){e=r;const o={};l&131072&&(o.$$scope={dirty:l,ctx:e}),n.$set(o)},i(r){i||(N(n.$$.fragment,r),r&&Re(()=>{i&&(s||(s=Qe(t,et,e[4],!0)),s.run(1))}),i=!0)},o(r){O(n.$$.fragment,r),r&&(s||(s=Qe(t,et,e[4],!1)),s.run(0)),i=!1},d(r){r&&A(t),B(n),r&&s&&s.end()}}}function Or(e){let t,n;return t=new kr({}),{c(){H(t.$$.fragment)},m(s,i){J(t,s,i),n=!0},i(s){n||(N(t.$$.fragment,s),n=!0)},o(s){O(t.$$.fragment,s),n=!1},d(s){B(t,s)}}}function Lr(e){let t,n,s,i,r,l,o,a,c,f,h,m;s=new Ji({}),s.$on("select-menu",e[5]),l=new Jo({}),l.$on("init",e[7]),l.$on("update",jr),l.$on("action",e[5]);let g=e[3]&&Xn(),_=e[0].visible&&Qn(e),p=e[1].visible&&es(e),v=e[2]&&ts(e);return{c(){t=b("div"),n=b("div"),H(s.$$.fragment),i=j(),r=b("div"),H(l.$$.fragment),o=j(),g&&g.c(),a=j(),_&&_.c(),c=j(),p&&p.c(),f=j(),v&&v.c(),h=sn(),u(n,"class","layout__header svelte-1beoswq"),u(r,"class","layout__editor svelte-1beoswq"),u(t,"class","layout svelte-1beoswq"),fe(t,"layout--preview",e[3])},m(k,S){x(k,t,S),d(t,n),J(s,n,null),d(t,i),d(t,r),J(l,r,null),d(t,o),g&&g.m(t,null),x(k,a,S),_&&_.m(k,S),x(k,c,S),p&&p.m(k,S),x(k,f,S),v&&v.m(k,S),x(k,h,S),m=!0},p(k,[S]){k[3]?g?S&8&&N(g,1):(g=Xn(),g.c(),N(g,1),g.m(t,null)):g&&(Le(),O(g,1,1,()=>{g=null}),je()),(!m||S&8)&&fe(t,"layout--preview",k[3]),k[0].visible?_?(_.p(k,S),S&1&&N(_,1)):(_=Qn(k),_.c(),N(_,1),_.m(c.parentNode,c)):_&&(Le(),O(_,1,1,()=>{_=null}),je()),k[1].visible?p?(p.p(k,S),S&2&&N(p,1)):(p=es(k),p.c(),N(p,1),p.m(f.parentNode,f)):p&&(Le(),O(p,1,1,()=>{p=null}),je()),k[2]?v?(v.p(k,S),S&4&&N(v,1)):(v=ts(k),v.c(),N(v,1),v.m(h.parentNode,h)):v&&(Le(),O(v,1,1,()=>{v=null}),je())},i(k){m||(N(s.$$.fragment,k),N(l.$$.fragment,k),N(g),N(_),N(p),N(v),m=!0)},o(k){O(s.$$.fragment,k),O(l.$$.fragment,k),O(g),O(_),O(p),O(v),m=!1},d(k){k&&(A(t),A(a),A(c),A(f),A(h)),B(s),B(l),g&&g.d(),_&&_.d(k),p&&p.d(k),v&&v.d(k)}}}function jr(e){e.detail}function Rr(e,t,n){let s,i,r;ie(e,Pt,w=>n(2,s=w)),ie(e,Yt,w=>n(3,i=w)),ie(e,mt,w=>n(16,r=w));let l,o={source:"",visible:!1,node:void 0},a={source:void 0,visible:!1,node:void 0};const c={duration:160,easing:Ci};function f(w){const{main:L,sub:R,node:P}=w.detail;let V;switch(L){case"data":switch(R){case"new":l.clear();break;case"import":n(0,o.source="",o),n(0,o.node=void 0,o),n(0,o.visible=!0,o);break;case"export":n(1,a.source=Object.assign({},r),a),n(1,a.node=void 0,a),n(1,a.visible=!0,a);break}break;case"view":switch(R){case"fold":case"unfold":V=l.el.tree.children().find(".node[data-type=object],.node[data-type=array]"),l.fold(V,R==="unfold");break;case"toggle-live-preview":Yt.change(!i);break}break;case"language":Rt.change(R);break;case"theme":ht.change(R);break;case"about":En(Pt,s=!0,s);break;case"editor":switch(R){case"import":n(0,o.source="",o),n(0,o.node=P,o),n(0,o.visible=!0,o);break;case"export":n(1,a.source=l.export(P,!1),a),n(1,a.node=P,a),n(1,a.visible=!0,a);break}break}}function h(w){const{source:L}=w.detail;try{let R=JSON.parse(L);n(0,o.visible=!1,o),o.node?(l.fold(o.node,!0),l.import(o.node,R)):l.replace(R)}catch{alert("Failed import JSON data.")}}function m(w){const{instance:L}=w.detail;l=L,l.$}Lt(async()=>{if(!mt.existStorageData()){const w=await vs();w&&l.replace(w)}});function g(w){e.$$.not_equal(o.source,w)&&(o.source=w,n(0,o))}return[o,a,s,i,c,f,h,m,g,()=>{n(0,o.visible=!1,o)},()=>{n(0,o.visible=!1,o)},()=>n(1,a.visible=!1,a),()=>{n(1,a.visible=!1,a)},()=>En(Pt,s=!1,s)]}class Ar extends ue{constructor(t){super(),ce(this,t,Rr,Lr,le,{})}}new Ar({target:document.getElementById("app"),props:{}}); +`))}`}const No=/file|reset|submit|button|image/i,Js=/radio|checkbox/i;C.serialize=function(){let e="";return this.each((t,n)=>{oe(n.elements||[n],(s,i)=>{if(i.disabled||!i.name||i.tagName==="FIELDSET"||No.test(i.type)||Js.test(i.type)&&!i.checked)return;const r=Os(i);if(!ge(r)){const l=At(r)?r:[r];oe(l,(o,a)=>{e+=ko(i.name,a)})}})}),e.slice(1)};const So={live:!1,theme:"system",edit:"all",openDepth:0,node:void 0},To={open:!0,callback:void 0},T={OBJECT:"object",ARRAY:"array",STRING:"string",NUMBER:"number",BOOLEAN:"boolean",NULL:"null"},Ze={START:"pointerdown",MOVE:"pointermove",END:"pointerup.json-editor pointercancel.json-editor"},ze={CLICK:"click.json-editor-context",KEYUP:"keyup.json-editor-context"},ot={START:"drag-over-start",END:"drag-over-end",ALL:"drag-over-start drag-over-end"},Eo='',Oo='',Lo='',Bs={object:'',array:'',string:'',number:'',boolean:'',null:''};var Je,Ge,ye,Hs,Ps,Is,Fs;class jo{constructor(t,n,s=!1){De(this,ye);De(this,Je);ve(this,"el",{node:void 0,type:void 0,dialog:void 0});De(this,Ge);Oe(this,Je,t),this.el.node=y(n),Oe(this,Ge,String(this.el.node.data("type"))),this.el.type=this.el.node.find("& > .node__body > .type"),this.el.type.addClass("open"),this.el.dialog=E(this,ye,Ps).call(this,E(this,ye,Hs).call(this),I(this,Ge),s),this.el.dialog.on("click",i=>i.stopPropagation()),this.el.dialog.find("button").on("click",i=>E(this,ye,Is).call(this,i)),I(this,Je).el.wrap.get(0).dispatchEvent(new CustomEvent("context",{detail:{body:this.el.dialog.get(0),node:this.el.node.get(0),type:I(this,Ge),isRoot:s,$:y}})),this.el.type.append(this.el.dialog),y(window).on(ze.CLICK,i=>this.close(i)),y(window).on(ze.KEYUP,i=>E(this,ye,Fs).call(this,i))}close(){this.el.type.removeClass("open"),this.el.dialog.remove(),y(window).off(ze.CLICK),y(window).off(ze.KEYUP),delete I(this,Je).context}}Je=new WeakMap,Ge=new WeakMap,ye=new WeakSet,Hs=function(){const{lang:t}=I(this,Je);return[{key:"change-type",label:t.contextChangeType,children:[{key:T.OBJECT,label:t.contextTypeObject},{key:T.ARRAY,label:t.contextTypeArray},{key:T.STRING,label:t.contextTypeString},{key:T.NUMBER,label:t.contextTypeNumber},{key:T.BOOLEAN,label:t.contextTypeBoolean},{key:T.NULL,label:t.contextTypeNull}]},{key:"insert",label:t.contextInsertNode,children:[{key:T.OBJECT,label:t.contextTypeObject},{key:T.ARRAY,label:t.contextTypeArray},{key:T.STRING,label:t.contextTypeString},{key:T.NUMBER,label:t.contextTypeNumber},{key:T.BOOLEAN,label:t.contextTypeBoolean},{key:T.NULL,label:t.contextTypeNull}]},{key:"duplicate",label:t.contextDuplicate},{key:"remove",label:t.contextRemove}]},Ps=function(t,n,s=!1){function i(o,a){let c="";const{key:f,label:h,children:m}=o;if(s)switch(f){case T.STRING:case T.NUMBER:case T.BOOLEAN:case T.NULL:if(a==="change-type")return"";break;case"duplicate":case"remove":return""}let g="",_="",p="";switch(f){case"change-type":g=' class="dropdown"',p=" disabled";break;case"insert":if([T.STRING,T.NUMBER,T.BOOLEAN,T.NULL].indexOf(n)>-1)return"";g=' class="dropdown"',p=" disabled";break;case"duplicate":g=' class="duplicate"',p=' data-mode="duplicate"';break;case"remove":g=' class="remove"',p=' data-mode="remove"';break;case T.OBJECT:case T.ARRAY:case T.STRING:case T.NUMBER:case T.BOOLEAN:case T.NULL:g=' class="type"',_=`${Bs[f]}`,p=` data-mode="${a}" data-type="${f}"`,a==="change-type"&&f===n&&(p=" disabled");break}return c+=``,c+=`",(m==null?void 0:m.length)>0&&(c+='
        ',c+=r(m,f),c+="
        "),c+="",c}function r(o,a=void 0){let c="
          ";for(let f in o)c+=i(o[f],a);return c+="
        ",c}let l=`",y(l)},Is=function(t){const n=y(t.currentTarget),s=n.data("mode");let i=String(n.data("type"));i=i==="undefined"?"":i,this.close(),this.selectItem&&typeof this.selectItem=="function"&&this.selectItem(this.el.node,s,i)},Fs=function(t){t.code==="Escape"&&this.close()};function Yn(e){return e==null?"null":Array.isArray(e)?"array":typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="boolean"?"boolean":"object"}function Ro(e){try{return typeof e=="string"?JSON.parse(e):Array.isArray(e)?Object.assign([],e):y.isPlainObject(e)?Object.assign({},e):{}}catch(t){console.error("error",t.message)}}function Ao(e){return Array.isArray(e)?e.length:y.isPlainObject(e)?Object.keys(e).length:0}function zn(e){if(e.ctrlKey||e.metaKey)switch(e.code){case"KeyB":case"KeyI":case"KeyU":return!0}return!1}function Kn(e){e.preventDefault();const t=e.currentTarget,n=document.createRange();n.selectNodeContents(t);const s=window.getSelection();s.removeAllRanges(),s.addRange(n)}function Wn(e){e.preventDefault();let n=(e.originalEvent||e).clipboardData.getData("text/plain");document.execCommand("insertText",!1,n)}const xo={nodeChangeSort:"Change node sort",nodeContextMenu:"Node context menu",nodeFold:"Collapse/Expand",contextChangeType:"Change type",contextInsertNode:"Insert",contextTypeObject:"Object",contextTypeArray:"Array",contextTypeString:"String",contextTypeNumber:"Number",contextTypeBoolean:"Boolean",contextTypeNull:"Null",contextDuplicate:"Duplicate",contextRemove:"Remove"};var F,Xe,$,Vs,Wt,Ct,Us,Zs,wt,rt,Gt,me,Xt,lt,Qt,en,at,$t,kt,qs,Ys,zs;class Kt{constructor(t,n={}){De(this,$);ve(this,"$");ve(this,"el",{wrap:null,body:null,tree:null});ve(this,"options");ve(this,"context");De(this,F);De(this,Xe,!1);ve(this,"lang",xo);this.$=y,this.el.wrap=y(t),this.el.body=y('
        '),this.options=new Proxy(Object.assign({},So,n),{get:(s,i)=>s[i],set:E(this,$,Vs).bind(this)}),this.updateLanguage(),this.el.wrap.append(this.el.body),E(this,$,Wt).call(this,this.options.theme),E(this,$,Qt).call(this,this.options.edit),this.replace(n.node||{},{},!1),E(this,$,en).call(this,n.openDepth)}addNode(t,n,s={},i=!0,r=!0){s={...To,...s};const{open:l,callback:o}=s;t=y(t);const a=n.type===void 0?Yn(n.value):n.type,c=E(this,$,Ct).call(this,a,!1);E(this,$,wt).call(this,c,{...n,open:l,type:a,depth:t.data("depth")+1}),E(this,$,at).call(this,c),t.find("& > .node__children > ul").append(c),r&&E(this,$,lt).call(this,t),(a===T.ARRAY||a===T.OBJECT)&&o&&typeof o=="function"&&o(c.get(0),n.value),i&&E(this,$,me).call(this)}removeNode(t,n=!0){t=y(t);const s=t.parent().closest(".node");t.remove(),E(this,$,lt).call(this,s),n&&E(this,$,me).call(this)}changeType(t,n,s=!0){const i=y(t),r={key:i.find("& > .node__body .key").text(),value:E(this,$,Gt).call(this,i),type:n,open:i.hasClass("open"),depth:i.data("depth")},l=i.find("& > .node__children > .tree").html(),o=i.hasClass("root");i.empty(),i.html(E(this,$,Ct).call(this,n,o).html()),l&&i.find("& > .node__children > .tree").html(l),E(this,$,wt).call(this,i,r),E(this,$,at).call(this,i),i.attr("data-type",n),s&&E(this,$,me).call(this)}changeKey(t,n){y(t).find(".key > div").text(n),E(this,$,me).call(this)}changeValue(t,n){y(t).find(".value > div").text(n),E(this,$,me).call(this)}duplicate(t,n=!0){t=y(t);const s=y(t.get(0).outerHTML);E(this,$,at).call(this,s),t.after(s),E(this,$,lt).call(this,t.parent().closest(".node")),n&&E(this,$,me).call(this)}fold(t,n){t=y(t),n===void 0?t.toggleClass("open"):n===!0?t.addClass("open"):t.removeClass("open")}clear(){this.el.tree&&(this.el.body.empty(),this.replace({},{},!1),E(this,$,me).call(this))}destroy(){y(window).off(Ze.END).off(ze.CLICK).off(ze.KEYUP),this.el.wrap.empty()}replace(t,n={},s=!0){this.el.body.empty(),t=Ro(t);const i=E(this,$,Us).call(this,t);this.import(i,t,!1,!1),s&&E(this,$,me).call(this),n!=null&&n.openDepth&&E(this,$,en).call(this,n==null?void 0:n.openDepth)}import(t,n,s=!0,i=!0){t=y(t),y.each(n,(r,l)=>{const o={key:r,value:l},a={open:!1,callback:(c,f)=>this.import(c,f,!1,!1)};this.addNode(t,o,a,!1,!1)}),i&&E(this,$,lt).call(this,t),s&&E(this,$,me).call(this)}export(t=void 0,n,s=2){let i=E(this,$,Xt).call(this,t);if(n){let r=2;return s===!0?r=" ":typeof s===T.NUMBER&&(r=s),JSON.stringify(i,null,r)}else return i}updateLanguage(){}}F=new WeakMap,Xe=new WeakMap,$=new WeakSet,Vs=function(t,n,s){switch(t[n]=s,n){case"theme":E(this,$,Wt).call(this,s);break;case"edit":E(this,$,Qt).call(this,s);break}return!0},Wt=function(t){t=["system","light","dark"].indexOf(t)>-1?t:"system",this.el.body.attr("data-theme",t)},Ct=function(t,n=!1){const{lang:s}=this;let i=`
      • `;return i+='
        ',n||(i+=`
        ${Lo}
        `),i+=`
        `,(t===T.OBJECT||t===T.ARRAY)&&(i+=``),n||(i+='
        '),i+='',n||(i+='
        '),i+="
        ",i+='
          ',i+="
        • ",y(i)},Us=function(t){const n=Yn(t),s=E(this,$,Ct).call(this,n,!0);return E(this,$,wt).call(this,s,{key:void 0,value:t,type:n,open:!0,depth:0}),E(this,$,at).call(this,s),this.el.tree=y("
            "),this.el.tree.append(s),this.el.body.append(this.el.tree),s},Zs=function(t,n,s){switch(n){case"change-type":this.changeType(t,s);break;case"insert":this.fold(t,!0),this.addNode(t,{key:"",value:"",type:s});break;case"duplicate":this.duplicate(t);break;case"remove":this.removeNode(t);break}},wt=function(t,n){const{key:s,value:i,type:r,open:l,depth:o}=n,a=t.hasClass("root"),c=t.children(".node__body");if(c.find(".type > button").html(`${Bs[r]}`),(r===T.OBJECT||r===T.ARRAY)&&this.fold(t,l),o!==void 0&&t.attr("data-depth",o),!a){c.find(".key").html(`
            ${s}
            `);const f=c.find(".value");let h;switch(r){case T.STRING:f.html(`
            ${String(i)}
            `);break;case T.NUMBER:h=Number(i),isNaN(h)&&(h=0),f.html(``);break;case T.BOOLEAN:h=i==="false"?!1:!!i,f.html(``);break;case T.NULL:f.html('NULL');break}}if(r===T.OBJECT||r===T.ARRAY){const f=Ao(i);isNaN(f)||c.find(".count").text(f)}},rt=function(t){return String(t.data("type"))},Gt=function(t){const n=E(this,$,rt).call(this,t),s=t.find("& > .node__body > .value");switch(n){case T.OBJECT:case T.ARRAY:return"";case T.STRING:return s.children(".type-string").get(0).innerText||"";case T.NUMBER:return Number(s.children(".type-number").val());case T.BOOLEAN:return s.children(".type-boolean").data("value");case T.NULL:return null}},me=function(){this.options.live&&this.el.wrap.get(0).dispatchEvent(new CustomEvent("update",{detail:E(this,$,Xt).call(this)}))},Xt=function(t){const n=(r,l)=>{let o=l===T.ARRAY?[]:{};return r.find("& > .node__children > ul > li").each((c,f)=>{if(!(l===T.ARRAY||l===T.OBJECT))return!0;f=y(f);const h=E(this,$,rt).call(this,f);switch(h){case T.OBJECT:case T.ARRAY:switch(l){case T.ARRAY:o.push(n(f,h));break;case T.OBJECT:const g=f.find("& > .node__body > .key").text();g&&(o[g]=n(f,h));break}break;case T.STRING:case T.NUMBER:case T.BOOLEAN:case T.NULL:const m=E(this,$,Gt).call(this,f);switch(l){case T.ARRAY:o.push(m);break;case T.OBJECT:const g=f.find("& > .node__body > .key").text();g&&(o[g]=m);break}break}}),o};t=y(t);const s=(t==null?void 0:t.length)>0?t:this.el.tree.children(".node"),i=E(this,$,rt).call(this,s);if([T.OBJECT,T.ARRAY].includes(i))return n(s,i)},lt=function(t){t=y(t);const n=E(this,$,rt).call(this,t);if(!(n==="object"||n==="array"))return;const s=t.find("& > .node__children > ul > li").length;isNaN(s)||t.find("& > .node__body > .count").text(s)},Qt=function(t){t==="all"?this.el.body.removeAttr("data-edit"):this.el.body.attr("data-edit",t)},en=function(t=0){if(!(t>0))return;this.el.body.find(".node:not(.root)").each((s,i)=>{y(i).data("depth") button").on("click",async o=>{if(o.stopPropagation(),this.options.edit!=="all")return;const a=y(o.currentTarget);if(a.parent().hasClass("open"))this.context&&this.context.close();else{this.context&&this.context.close();const c=a.closest(".node").hasClass("root");this.context=new jo(this,a.closest(".node"),c),this.context.selectItem=(f,h,m)=>E(this,$,Zs).call(this,f,h,m)}}),t.find(".fold").on("click",o=>{const c=y(o.currentTarget).closest(".node");this.fold(c)});const s=t.find(".key > .label-field");s.length&&(s.on("keydown",o=>{if(this.options.edit==="all"&&(o.code==="Enter"||zn(o)))return o.preventDefault()}).on("input",o=>E(this,$,$t).call(this,o)).on("blur",o=>E(this,$,kt).call(this,o)),this.options.edit!=="all"?s.on("dblclick",Kn):s.on("paste",Wn));const i=t.find(".value > .type-string");i.length&&(i.on("keydown",o=>{if(this.options.edit!=="none"&&zn(o))return o.preventDefault()}).on("input",o=>E(this,$,$t).call(this,o)).on("blur",o=>E(this,$,kt).call(this,o)),this.options.edit==="none"?i.on("dblclick",Kn):i.on("paste",Wn));const r=t.find(".value > .type-number");r.length&&r.on("keydown",o=>{this.options.edit==="none"&&o.preventDefault()}).on("input",o=>E(this,$,$t).call(this,o)).on("blur",o=>E(this,$,kt).call(this,o));const l=t.find(".value > .type-boolean");l.length&&l.on("click",o=>{if(this.options.edit==="none")return;const a=y(o.currentTarget),c=!a.data("value");a.data("value",c).find("i").text(c.toString().toUpperCase()),E(this,$,me).call(this)})},$t=function(){Oe(this,Xe,!0)},kt=function(){I(this,Xe)&&(E(this,$,me).call(this),Oe(this,Xe,!1))},qs=function(t){if(Oe(this,F,{}),I(this,F).$node=y(t.currentTarget).closest(".node"),I(this,F).$area=I(this,F).$node.parent(),I(this,F).$nodes=I(this,F).$area.children(".node"),I(this,F).$nodes.length<2){Oe(this,F,void 0);return}I(this,F).$nodes.on(Ze.MOVE,E(this,$,Ys).bind(this)),y(window).on(Ze.END,E(this,$,zs).bind(this))},Ys=function(t){let n;if(t.pointerType==="touch"){const{clientX:o,clientY:a}=t,c=document.elementFromPoint(o,a).closest(".node");if(!I(this,F).$nodes.get().includes(c))return;n=y(c)}else n=y(t.currentTarget);const s=n.children(".node__body");if(!(s.length>0))return;const{y:i,height:r}=s.get(0).getBoundingClientRect(),l=r*.5n(5,s=v)),ie(e,ht,v=>n(6,i=v)),ie(e,Ae,v=>n(7,r=v)),ie(e,Rt,v=>n(1,l=v));const o=Pe();let a,c;ht.subscribe(v=>{c&&(c.options.theme=v)});function f({detail:v}){mt.update(v),o("update",{src:v})}function h({detail:{body:v,node:k,type:S,isRoot:w,$:L}}){if(!["object","array"].includes(S))return;const R=[{key:"import",label:r.importJson},{key:"export",label:r.exportJson}],P=L(R.map(V=>`
          • `).join(""));P.find("button").on("click",V=>{c.context.close();const Q=V.currentTarget.dataset.mode;o("action",{main:"editor",sub:Q,node:k})}),w?L(v).find("& > ol").append(P):L(v).find("& > ol > .remove").before(P)}function m(){Kt.prototype.updateLanguage=function(){Object.assign(this.lang,r.editor)},c=new Kt(a,{live:!0,theme:i,node:s,openDepth:3}),a.addEventListener("update",f),a.addEventListener("context",h),o("init",{instance:c})}function g(){c&&(c.destroy(),c=void 0,a.removeEventListener("update",f),a.removeEventListener("context",h))}function _(){a&&(g(),m())}Lt(()=>m()),rn(()=>g());function p(v){dt[v?"unshift":"push"](()=>{a=v,n(0,a)})}return e.$$.update=()=>{e.$$.dirty&2&&_()},[a,l,p]}class Jo extends ue{constructor(t){super(),ce(this,t,Do,Mo,le,{})}}function Bo(e){let t,n,s,i,r,l,o,a=e[1].preview+"",c,f,h,m,g,_;return r=new pe({props:{name:"code"}}),{c(){t=b("article"),n=b("div"),s=b("header"),i=b("h1"),H(r.$$.fragment),l=j(),o=b("span"),c=re(a),f=j(),h=b("div"),m=b("pre"),g=re(e[0]),u(i,"class","svelte-1wub0nx"),u(s,"class","preview__header svelte-1wub0nx"),u(m,"class","svelte-1wub0nx"),u(h,"class","preview__body scroll-area svelte-1wub0nx"),u(n,"class","preview__wrap svelte-1wub0nx"),u(t,"class","preview svelte-1wub0nx")},m(p,v){x(p,t,v),d(t,n),d(n,s),d(s,i),J(r,i,null),d(i,l),d(i,o),d(o,c),d(n,f),d(n,h),d(h,m),d(m,g),_=!0},p(p,[v]){(!_||v&2)&&a!==(a=p[1].preview+"")&&de(c,a),(!_||v&1)&&de(g,p[0])},i(p){_||(N(r.$$.fragment,p),_=!0)},o(p){O(r.$$.fragment,p),_=!1},d(p){p&&A(t),B(r)}}}function Ho(e,t,n){let s,i,r;return ie(e,mt,l=>n(2,i=l)),ie(e,Ae,l=>n(1,r=l)),e.$$.update=()=>{e.$$.dirty&4&&n(0,s=JSON.stringify(i,null,2))},[s,r,i]}class Po extends ue{constructor(t){super(),ce(this,t,Ho,Bo,le,{})}}function Io(e){let t,n,s,i;const r=e[5].default,l=rs(r,e,e[4],null);return{c(){t=b("button"),l&&l.c(),u(t,"type",e[0]),t.disabled=e[1],u(t,"class","button svelte-pnoqr8"),fe(t,"button--color-key",e[2]==="key")},m(o,a){x(o,t,a),l&&l.m(t,null),n=!0,s||(i=te(t,"click",e[3]),s=!0)},p(o,[a]){l&&l.p&&(!n||a&16)&&cs(l,r,o,o[4],n?as(r,o[4],a,null):us(o[4]),null),(!n||a&1)&&u(t,"type",o[0]),(!n||a&2)&&(t.disabled=o[1]),(!n||a&4)&&fe(t,"button--color-key",o[2]==="key")},i(o){n||(N(l,o),n=!0)},o(o){O(l,o),n=!1},d(o){o&&A(t),l&&l.d(o),s=!1,i()}}}function Fo(e,t,n){let{$$slots:s={},$$scope:i}=t;const r=Pe();let{type:l="button"}=t,{disabled:o=!1}=t,{color:a=void 0}=t;function c(f){r("click",{nativeEvent:f})}return e.$$set=f=>{"type"in f&&n(0,l=f.type),"disabled"in f&&n(1,o=f.disabled),"color"in f&&n(2,a=f.color),"$$scope"in f&&n(4,i=f.$$scope)},[l,o,a,c,i,s]}class ut extends ue{constructor(t){super(),ce(this,t,Fo,Io,le,{type:0,disabled:1,color:2})}}function Gn(e){let t,n,s,i,r,l;return n=new pe({props:{name:"alert-circle"}}),{c(){t=b("div"),H(n.$$.fragment),s=j(),i=b("p"),r=re(e[2]),u(i,"class","svelte-vfkenl"),u(t,"class","help-message svelte-vfkenl")},m(o,a){x(o,t,a),J(n,t,null),d(t,s),d(t,i),d(i,r),l=!0},p(o,a){(!l||a&4)&&de(r,o[2])},i(o){l||(N(n.$$.fragment,o),l=!0)},o(o){O(n.$$.fragment,o),l=!1},d(o){o&&A(t),B(n)}}}function Vo(e){let t,n,s,i=e[3].jsonFile+"",r,l;return t=new pe({props:{name:"upload"}}),{c(){H(t.$$.fragment),n=j(),s=b("span"),r=re(i)},m(o,a){J(t,o,a),x(o,n,a),x(o,s,a),d(s,r),l=!0},p(o,a){(!l||a&8)&&i!==(i=o[3].jsonFile+"")&&de(r,i)},i(o){l||(N(t.$$.fragment,o),l=!0)},o(o){O(t.$$.fragment,o),l=!1},d(o){o&&(A(n),A(s)),B(t,o)}}}function Uo(e){let t,n,s,i=e[3].getRandomCode+"",r,l;return t=new pe({props:{name:"upload"}}),{c(){H(t.$$.fragment),n=j(),s=b("span"),r=re(i)},m(o,a){J(t,o,a),x(o,n,a),x(o,s,a),d(s,r),l=!0},p(o,a){(!l||a&8)&&i!==(i=o[3].getRandomCode+"")&&de(r,i)},i(o){l||(N(t.$$.fragment,o),l=!0)},o(o){O(t.$$.fragment,o),l=!1},d(o){o&&(A(n),A(s)),B(t,o)}}}function Zo(e){let t,n,s,i=e[3].loadData+"",r,l;return t=new pe({props:{name:"check"}}),{c(){H(t.$$.fragment),n=j(),s=b("span"),r=re(i)},m(o,a){J(t,o,a),x(o,n,a),x(o,s,a),d(s,r),l=!0},p(o,a){(!l||a&8)&&i!==(i=o[3].loadData+"")&&de(r,i)},i(o){l||(N(t.$$.fragment,o),l=!0)},o(o){O(t.$$.fragment,o),l=!1},d(o){o&&(A(n),A(s)),B(t,o)}}}function qo(e){let t,n,s,i,r=e[3].importTitle+"",l,o,a,c=e[3].importDescription+"",f,h,m,g,_,p,v,k,S,w,L,R,P,V,Q,W,he,z,q,Z,K,ne,Y=e[2]&&Gn(e);return V=new ut({props:{type:"button",$$slots:{default:[Vo]},$$scope:{ctx:e}}}),V.$on("click",e[5]),W=new ut({props:{type:"button",$$slots:{default:[Uo]},$$scope:{ctx:e}}}),W.$on("click",e[7]),q=new ut({props:{type:"submit",color:"key",$$slots:{default:[Zo]},$$scope:{ctx:e}}}),{c(){t=b("article"),n=b("div"),s=b("header"),i=b("h1"),l=re(r),o=j(),a=b("p"),f=j(),h=b("form"),m=b("fieldset"),g=b("legend"),g.textContent="source code field",_=j(),p=b("textarea"),k=j(),Y&&Y.c(),S=j(),w=b("nav"),L=b("div"),R=b("input"),P=j(),H(V.$$.fragment),Q=j(),H(W.$$.fragment),he=j(),z=b("div"),H(q.$$.fragment),u(i,"class","svelte-vfkenl"),u(a,"class","svelte-vfkenl"),u(s,"class","data__header svelte-vfkenl"),u(g,"class","svelte-vfkenl"),u(p,"placeholder",v=e[3].importPlaceholder),u(p,"class","scroll-area svelte-vfkenl"),u(m,"class","source-input svelte-vfkenl"),u(R,"type","file"),u(R,"accept","application/json"),u(R,"class","json-uploader__file svelte-vfkenl"),u(L,"class","json-uploader svelte-vfkenl"),u(z,"class","svelte-vfkenl"),u(w,"class","nav-submit svelte-vfkenl"),u(h,"class","form svelte-vfkenl"),u(n,"class","data__wrap svelte-vfkenl"),u(t,"class","data svelte-vfkenl")},m(U,M){x(U,t,M),d(t,n),d(n,s),d(s,i),d(i,l),d(s,o),d(s,a),a.innerHTML=c,d(n,f),d(n,h),d(h,m),d(m,g),d(m,_),d(m,p),Ye(p,e[0]),d(m,k),Y&&Y.m(m,null),d(h,S),d(h,w),d(w,L),d(L,R),e[10](R),d(L,P),J(V,L,null),d(L,Q),J(W,L,null),d(w,he),d(w,z),J(q,z,null),Z=!0,K||(ne=[te(p,"input",e[9]),te(p,"keydown",e[4]),te(R,"change",e[6]),te(h,"submit",ii(e[8]))],K=!0)},p(U,[M]){(!Z||M&8)&&r!==(r=U[3].importTitle+"")&&de(l,r),(!Z||M&8)&&c!==(c=U[3].importDescription+"")&&(a.innerHTML=c),(!Z||M&8&&v!==(v=U[3].importPlaceholder))&&u(p,"placeholder",v),M&1&&Ye(p,U[0]),U[2]?Y?(Y.p(U,M),M&4&&N(Y,1)):(Y=Gn(U),Y.c(),N(Y,1),Y.m(m,null)):Y&&(Le(),O(Y,1,1,()=>{Y=null}),je());const G={};M&4104&&(G.$$scope={dirty:M,ctx:U}),V.$set(G);const $e={};M&4104&&($e.$$scope={dirty:M,ctx:U}),W.$set($e);const Ee={};M&4104&&(Ee.$$scope={dirty:M,ctx:U}),q.$set(Ee)},i(U){Z||(N(Y),N(V.$$.fragment,U),N(W.$$.fragment,U),N(q.$$.fragment,U),Z=!0)},o(U){O(Y),O(V.$$.fragment,U),O(W.$$.fragment,U),O(q.$$.fragment,U),Z=!1},d(U){U&&A(t),Y&&Y.d(),e[10](null),B(V),B(W),B(q),K=!1,Ce(ne)}}}function Yo(e,t,n){let s;ie(e,Ae,p=>n(3,s=p));const i=Pe();let r,l="",{source:o=""}=t;function a(p){p.metaKey&&p.key==="Enter"&&m()}function c(){r.click()}function f(p){const v=p.target,k=p.target.files[0];if(!(k&&k.type==="application/json")){alert("The file is not a valid JSON.");return}const S=new FileReader;S.onload=w=>{try{const L=String(w.target.result);JSON.parse(L),n(0,o=L)}catch{alert("The data is not valid JSON.")}v.value=""},S.onerror=w=>{alert("File read error."),v.value=""},S.readAsText(k)}async function h(){try{const p=await vs();if(!p)throw new Error("There is no data.");n(0,o=JSON.stringify(p,null,2))}catch(p){alert(p.message),console.error(p)}}function m(){try{if(!o){n(2,l="Please input data.");return}i("submit",{source:o}),n(2,l="")}catch(p){n(2,l=p.message)}}function g(){o=this.value,n(0,o)}function _(p){dt[p?"unshift":"push"](()=>{r=p,n(1,r)})}return e.$$set=p=>{"source"in p&&n(0,o=p.source)},[o,r,l,s,a,c,f,h,m,g,_]}class zo extends ue{constructor(t){super(),ce(this,t,Yo,qo,le,{source:0})}}function Ko(e){let t,n,s,i=e[2].close+"",r,l;return t=new pe({props:{name:"x"}}),{c(){H(t.$$.fragment),n=j(),s=b("span"),r=re(i)},m(o,a){J(t,o,a),x(o,n,a),x(o,s,a),d(s,r),l=!0},p(o,a){(!l||a&4)&&i!==(i=o[2].close+"")&&de(r,i)},i(o){l||(N(t.$$.fragment,o),l=!0)},o(o){O(t.$$.fragment,o),l=!1},d(o){o&&(A(n),A(s)),B(t,o)}}}function Wo(e){let t,n,s,i=e[2].exportSaveFile+"",r,l;return t=new pe({props:{name:"save"}}),{c(){H(t.$$.fragment),n=j(),s=b("span"),r=re(i)},m(o,a){J(t,o,a),x(o,n,a),x(o,s,a),d(s,r),l=!0},p(o,a){(!l||a&4)&&i!==(i=o[2].exportSaveFile+"")&&de(r,i)},i(o){l||(N(t.$$.fragment,o),l=!0)},o(o){O(t.$$.fragment,o),l=!1},d(o){o&&(A(n),A(s)),B(t,o)}}}function Go(e){let t,n,s,i,r=e[2].exportTitle+"",l,o,a,c=e[2].exportDescription+"",f,h,m,g,_,p,v,k,S,w,L,R,P,V,Q,W,he,z,q,Z,K,ne,Y,U;return W=new pe({props:{name:"chevron-down"}}),q=new ut({props:{type:"button",$$slots:{default:[Ko]},$$scope:{ctx:e}}}),q.$on("click",e[8]),K=new ut({props:{type:"button",color:"key",$$slots:{default:[Wo]},$$scope:{ctx:e}}}),K.$on("click",e[5]),{c(){t=b("article"),n=b("div"),s=b("header"),i=b("h1"),l=re(r),o=j(),a=b("p"),f=j(),h=b("div"),m=b("pre"),g=re(e[1]),_=j(),p=b("nav"),v=b("div"),k=b("label"),S=b("select"),w=b("option"),w.textContent="2 Space",L=b("option"),L.textContent="4 Space",R=b("option"),R.textContent="Tab",P=b("option"),P.textContent="Minify",V=j(),Q=b("i"),H(W.$$.fragment),he=j(),z=b("div"),H(q.$$.fragment),Z=j(),H(K.$$.fragment),u(i,"class","svelte-vfkenl"),u(a,"class","svelte-vfkenl"),u(s,"class","data__header svelte-vfkenl"),u(m,"class","svelte-vfkenl"),u(h,"class","source-result scroll-area svelte-vfkenl"),w.__value="2space",Ye(w,w.__value),L.__value="4space",Ye(L,L.__value),R.__value="tab",Ye(R,R.__value),P.__value="minify",Ye(P,P.__value),u(S,"class","svelte-vfkenl"),e[0]===void 0&&Re(()=>e[7].call(S)),u(Q,"class","svelte-vfkenl"),u(k,"class","select-code-style svelte-vfkenl"),u(v,"class","svelte-vfkenl"),u(z,"class","svelte-vfkenl"),u(p,"class","nav-submit svelte-vfkenl"),u(n,"class","data__wrap svelte-vfkenl"),u(t,"class","data svelte-vfkenl")},m(M,G){x(M,t,G),d(t,n),d(n,s),d(s,i),d(i,l),d(s,o),d(s,a),a.innerHTML=c,d(n,f),d(n,h),d(h,m),d(m,g),d(n,_),d(n,p),d(p,v),d(v,k),d(k,S),d(S,w),d(S,L),d(S,R),d(S,P),On(S,e[0],!0),d(k,V),d(k,Q),J(W,Q,null),d(p,he),d(p,z),J(q,z,null),d(z,Z),J(K,z,null),ne=!0,Y||(U=[te(h,"click",e[4]),te(S,"change",e[7])],Y=!0)},p(M,[G]){(!ne||G&4)&&r!==(r=M[2].exportTitle+"")&&de(l,r),(!ne||G&4)&&c!==(c=M[2].exportDescription+"")&&(a.innerHTML=c),(!ne||G&2)&&de(g,M[1]),G&1&&On(S,M[0]);const $e={};G&516&&($e.$$scope={dirty:G,ctx:M}),q.$set($e);const Ee={};G&516&&(Ee.$$scope={dirty:G,ctx:M}),K.$set(Ee)},i(M){ne||(N(W.$$.fragment,M),N(q.$$.fragment,M),N(K.$$.fragment,M),ne=!0)},o(M){O(W.$$.fragment,M),O(q.$$.fragment,M),O(K.$$.fragment,M),ne=!1},d(M){M&&A(t),B(W),B(q),B(K),Y=!1,Ce(U)}}}function Xo(e,t){switch(t){case"2space":return JSON.stringify(e,null,2);case"4space":return JSON.stringify(e,null,4);case"tab":return JSON.stringify(e,null," ");case"minify":return JSON.stringify(e,null)}}function Qo(e,t,n){let s,i;ie(e,Ae,m=>n(2,i=m));const r=Pe();let{source:l={foo:"bar"}}=t,o="2space";function a(m){wi(m.currentTarget.children[0])}function c(){confirm("Do you really want to download this data as a file?")&&$i(s,`data-${ki(new Date,"{yyyy}{MM}{dd}-{hh}{mm}{ss}")}.json`)}function f(){o=ri(this),n(0,o)}const h=()=>r("close");return e.$$set=m=>{"source"in m&&n(6,l=m.source)},e.$$.update=()=>{e.$$.dirty&65&&n(1,s=Xo(l,o))},[o,s,i,r,a,c,l,f,h]}class er extends ue{constructor(t){super(),ce(this,t,Qo,Go,le,{source:6})}}const tr="@redgoose/json-editor",nr="Easy editing JSON data",sr="redgoose ",ir="1.2.2",or=["json","editor","library","tool"],rr="MIT",lr="./lib/json-editor.js",ar="./lib/json-editor.d.ts",cr=["lib"],ur={".":{module:"./lib/json-editor.js",default:"./lib/json-editor.js",types:"./lib/json-editor.d.ts"},"./css":"./lib/json-editor.css","./umd":"./lib/json-editor.umd.cjs"},fr={type:"git",url:"git+https://github.com/redgoose-dev/json-editor.git"},dr={url:"https://github.com/redgoose-dev/json-editor/issues"},pr="https://redgoose-dev.github.io/json-editor",hr="module",mr={dev:"vite --config vite.config/dev.js",docs:"vite --config vite.config/docs.js",prebuild:"rm -rf docs && rm -rf lib",build:"node vite.config/lib.js"},gr=["> 1%","last 2 versions"],br={node:">=20"},vr={"@sveltejs/vite-plugin-svelte":"^3.1.1","cash-dom":"^8.1.5","feather-icons":"^4.29.2",sass:"^1.77.5",svelte:"^4.2.18",vite:"^5.3.1"},_r={name:tr,description:nr,author:sr,version:ir,keywords:or,license:rr,main:lr,types:ar,files:cr,exports:ur,repository:fr,bugs:dr,homepage:pr,type:hr,scripts:mr,browserslist:gr,engines:br,devDependencies:vr};function yr(e){let t,n,s,i,r,l,o,a,c,f,h;return{c(){t=X("svg"),n=X("path"),s=X("path"),i=X("path"),r=X("path"),l=X("path"),o=X("path"),a=X("path"),c=X("path"),f=X("path"),h=X("path"),u(n,"d","M27.1654 34.4985C26.7923 36.3093 26.1007 37.9836 25.0998 39.4941C24.0898 41.0137 22.6975 42.2604 20.8958 43.2522C19.1032 44.235 16.7828 44.7264 13.9438 44.7264C10.395 44.7264 7.43762 43.8073 5.07175 41.9783C2.70587 40.1402 1.13165 37.7925 0.339996 34.908L9.27573 31.896C9.54871 32.9971 10.0492 33.8888 10.7862 34.5531C11.5142 35.2265 12.4151 35.554 13.4797 35.554C15.1358 35.554 16.2278 34.9808 16.7646 33.8433C17.2924 32.6968 17.5654 31.2045 17.5654 29.3482V1.7402H27.7387V29.2936C27.7387 30.9497 27.5476 32.6877 27.1745 34.4985H27.1654Z"),u(n,"fill","currentColor"),u(s,"d","M55.2829 12.6232C54.4185 11.5222 53.281 10.6395 51.8797 9.99348C50.4784 9.34741 49.1316 9.01983 47.8304 9.01983C47.157 9.01983 46.4837 9.07442 45.7921 9.19272C45.1006 9.31101 44.4818 9.5385 43.9267 9.87518C43.3717 10.2119 42.9076 10.6395 42.5345 11.1764C42.1614 11.7042 41.9703 12.3867 41.9703 13.2147C41.9703 13.9245 42.1159 14.5159 42.4162 14.9891C42.7165 15.4623 43.1442 15.8718 43.7174 16.2357C44.2907 16.5906 44.9732 16.9182 45.7557 17.2094C46.5474 17.5097 47.43 17.81 48.4128 18.1284C49.8323 18.6016 51.3064 19.1203 52.8534 19.6936C54.3912 20.2668 55.7925 21.0221 57.0482 21.9684C58.304 22.9148 59.3595 24.0886 60.1876 25.49C61.0156 26.8913 61.4251 28.6384 61.4251 30.7222C61.4251 33.1245 60.9792 35.2083 60.0966 36.9645C59.2048 38.7207 58.0128 40.1675 56.5205 41.314C55.019 42.4606 53.3083 43.3068 51.3792 43.8528C49.4501 44.4079 47.4573 44.6809 45.4008 44.6809C42.4071 44.6809 39.5044 44.1531 36.7108 43.1157C33.9081 42.0693 31.5878 40.5861 29.7315 38.6479L36.3559 31.9051C37.3842 33.17 38.7309 34.2255 40.4052 35.0718C42.0795 35.918 43.7447 36.3457 45.4008 36.3457C46.147 36.3457 46.875 36.2638 47.5938 36.1091C48.3036 35.9544 48.9224 35.6905 49.4592 35.3447C49.9961 34.999 50.4147 34.5167 50.7332 33.9252C51.0516 33.3338 51.2063 32.624 51.2063 31.7959C51.2063 30.9679 51.0061 30.34 50.6149 29.7849C50.2236 29.2299 49.6594 28.7294 48.9315 28.2744C48.2035 27.8194 47.2935 27.41 46.2107 27.0369C45.1279 26.6638 43.8903 26.2543 42.5163 25.8266C41.1787 25.3899 39.8592 24.8803 38.5853 24.2888C37.3023 23.6974 36.1557 22.9421 35.1548 22.0139C34.1538 21.0858 33.344 19.9666 32.7343 18.638C32.1246 17.3186 31.8153 15.708 31.8153 13.8153C31.8153 11.4858 32.2884 9.493 33.2348 7.83689C34.1811 6.18077 35.4278 4.82495 36.9565 3.7603C38.4943 2.69566 40.2323 1.9131 42.1614 1.42172C44.0905 0.930349 46.0469 0.684662 48.0124 0.684662C50.3783 0.684662 52.7897 1.12144 55.2556 1.98589C57.7216 2.85035 59.8782 4.13338 61.7345 5.82589L55.292 12.6323L55.2829 12.6232Z"),u(s,"fill","currentColor"),u(i,"d","M108.815 22.4962C108.815 25.8085 108.242 28.8386 107.105 31.5776C105.958 34.3165 104.375 36.6642 102.346 38.6206C100.316 40.5679 97.896 42.0784 95.1024 43.1431C92.2998 44.2077 89.2696 44.7355 85.9938 44.7355C82.718 44.7355 79.6969 44.2077 76.9125 43.1431C74.1371 42.0784 71.7258 40.5679 69.6966 38.6206C67.6674 36.6642 66.075 34.3256 64.9375 31.5776C63.791 28.8386 63.2268 25.8085 63.2268 22.4962C63.2268 19.184 63.8001 16.1175 64.9375 13.4149C66.0841 10.7123 67.6674 8.41927 69.6966 6.52657C71.7258 4.63387 74.1371 3.17794 76.9125 2.1497C79.6969 1.12145 82.718 0.611877 85.9938 0.611877C89.2696 0.611877 92.2998 1.12145 95.1024 2.1497C97.9051 3.17794 100.316 4.63387 102.346 6.52657C104.375 8.41927 105.967 10.7123 107.105 13.4149C108.251 16.1175 108.815 19.1385 108.815 22.4962ZM97.9961 22.4962C97.9961 20.6854 97.7049 18.9838 97.1134 17.4096C96.522 15.8354 95.703 14.4796 94.6566 13.3603C93.6101 12.232 92.3453 11.3493 90.8712 10.7032C89.397 10.0481 87.7682 9.7296 85.9938 9.7296C84.2194 9.7296 82.5997 10.0572 81.1438 10.7032C79.6878 11.3493 78.423 12.2411 77.3584 13.3603C76.2937 14.4796 75.4748 15.8354 74.9015 17.4096C74.3282 18.9838 74.0461 20.6854 74.0461 22.4962C74.0461 24.307 74.3464 26.136 74.9379 27.7285C75.5294 29.3209 76.3483 30.6949 77.3948 31.8414C78.4412 32.988 79.6878 33.8797 81.1529 34.5349C82.6088 35.181 84.2285 35.5086 86.0029 35.5086C87.7773 35.5086 89.397 35.181 90.853 34.5349C92.3089 33.8888 93.5737 32.988 94.6384 31.8414C95.703 30.6949 96.5311 29.33 97.1225 27.7285C97.714 26.1269 98.0052 24.3889 98.0052 22.4962H97.9961Z"),u(i,"fill","currentColor"),u(r,"d","M139.153 43.6071L122.301 16.2266H122.119L122.356 43.6071H112.537V1.7402H124.066L140.864 29.0661H141.046L140.809 1.7402H150.628V43.6071H139.153Z"),u(r,"fill","currentColor"),u(l,"d","M168.135 43.6071V1.7402H196.289V10.2483H177.899V18.1739H195.288V26.2816H177.899V34.9717H197.354V43.6071H168.135Z"),u(l,"fill","currentColor"),u(o,"d","M240.176 22.5508C240.176 26.2179 239.494 29.3846 238.138 32.0416C236.782 34.6987 234.98 36.8917 232.751 38.6024C230.522 40.3131 228.01 41.5779 225.207 42.3878C222.405 43.1976 219.566 43.598 216.69 43.598H201.076V1.7402H216.217C219.174 1.7402 222.095 2.08599 224.971 2.77755C227.846 3.46911 230.412 4.60655 232.66 6.20807C234.908 7.80049 236.718 9.94797 238.101 12.6232C239.485 15.3076 240.176 18.6198 240.176 22.5599V22.5508ZM229.648 22.5508C229.648 20.1849 229.266 18.2285 228.492 16.6634C227.728 15.1074 226.7 13.8608 225.417 12.9417C224.134 12.0136 222.678 11.3584 221.04 10.958C219.402 10.5667 217.719 10.3666 215.981 10.3666H210.958V34.8534H215.744C217.555 34.8534 219.302 34.6441 220.976 34.2346C222.65 33.816 224.134 33.1427 225.417 32.1963C226.7 31.25 227.728 29.9851 228.492 28.4109C229.266 26.8367 229.648 24.8803 229.648 22.5508Z"),u(o,"fill","currentColor"),u(a,"d","M243.898 43.6071V1.7402H254.071V43.6071H243.898Z"),u(a,"fill","currentColor"),u(c,"d","M277.666 10.3666V43.6071H267.548V10.3666H255.718V1.7402H289.486V10.3666H277.657H277.666Z"),u(c,"fill","currentColor"),u(f,"d","M333.028 22.4962C333.028 25.8085 332.454 28.8386 331.317 31.5776C330.17 34.3165 328.587 36.6642 326.558 38.6206C324.529 40.5679 322.108 42.0784 319.315 43.1431C316.512 44.2077 313.482 44.7355 310.206 44.7355C306.93 44.7355 303.909 44.2077 301.125 43.1431C298.349 42.0784 295.938 40.5679 293.909 38.6206C291.88 36.6642 290.287 34.3256 289.15 31.5776C288.003 28.8386 287.439 25.8085 287.439 22.4962C287.439 19.184 288.012 16.1175 289.15 13.4149C290.296 10.7123 291.88 8.41927 293.909 6.52657C295.938 4.63387 298.349 3.17794 301.125 2.1497C303.909 1.12145 306.93 0.611877 310.206 0.611877C313.482 0.611877 316.512 1.12145 319.315 2.1497C322.117 3.17794 324.529 4.63387 326.558 6.52657C328.587 8.41927 330.18 10.7123 331.317 13.4149C332.464 16.1175 333.028 19.1385 333.028 22.4962ZM322.208 22.4962C322.208 20.6854 321.917 18.9838 321.326 17.4096C320.734 15.8354 319.915 14.4796 318.869 13.3603C317.822 12.232 316.558 11.3493 315.083 10.7032C313.609 10.0481 311.98 9.7296 310.206 9.7296C308.432 9.7296 306.812 10.0572 305.356 10.7032C303.9 11.3493 302.635 12.2411 301.571 13.3603C300.506 14.4796 299.687 15.8354 299.114 17.4096C298.54 18.9838 298.258 20.6854 298.258 22.4962C298.258 24.307 298.559 26.136 299.15 27.7285C299.742 29.3209 300.561 30.6949 301.607 31.8414C302.653 32.988 303.9 33.8797 305.365 34.5349C306.821 35.181 308.441 35.5086 310.215 35.5086C311.99 35.5086 313.609 35.181 315.065 34.5349C316.521 33.8888 317.786 32.988 318.851 31.8414C319.915 30.6949 320.743 29.33 321.335 27.7285C321.926 26.1269 322.217 24.3889 322.217 22.4962H322.208Z"),u(f,"fill","currentColor"),u(h,"d","M359.171 43.6071L350.08 26.9914H346.631V43.6071H336.758V1.7402H352.728C354.739 1.7402 356.705 1.94949 358.616 2.35897C360.526 2.77755 362.246 3.46911 363.757 4.46096C365.267 5.45281 366.487 6.74494 367.397 8.36466C368.307 9.98437 368.762 11.9954 368.762 14.3976C368.762 17.2367 367.988 19.6208 366.45 21.559C364.912 23.4881 362.783 24.8712 360.062 25.6993L371 43.6162H359.171V43.6071ZM358.752 14.5705C358.752 13.5878 358.543 12.787 358.124 12.1774C357.706 11.5677 357.178 11.0945 356.523 10.7578C355.867 10.4211 355.14 10.1937 354.321 10.0754C353.502 9.95707 352.728 9.89338 351.973 9.89338H346.568V19.6481H351.381C352.209 19.6481 353.065 19.5753 353.938 19.4388C354.812 19.3023 355.604 19.0566 356.313 18.7017C357.023 18.3468 357.615 17.8373 358.07 17.1639C358.525 16.4905 358.752 15.6261 358.752 14.5614V14.5705Z"),u(h,"fill","currentColor"),u(t,"viewBox","0 0 371 45"),u(t,"fill","none"),u(t,"xmlns","http://www.w3.org/2000/svg"),u(t,"class","svelte-fc8vwx")},m(m,g){x(m,t,g),d(t,n),d(t,s),d(t,i),d(t,r),d(t,l),d(t,o),d(t,a),d(t,c),d(t,f),d(t,h)},p:ee,i:ee,o:ee,d(m){m&&A(t)}}}class Cr extends ue{constructor(t){super(),ce(this,t,null,yr,le,{})}}function wr(e){let t,n,s,i,r,l,o,a,c,f,h=e[0].aboutDescription+"",m,g,_,p=e[0].aboutInformation+"",v,k,S,w,L,R,P,V,Q,W,he,z,q;return r=new _s({}),a=new Cr({}),{c(){t=b("article"),n=b("div"),s=b("h1"),i=b("i"),H(r.$$.fragment),l=j(),o=b("i"),H(a.$$.fragment),c=j(),f=b("p"),m=j(),g=b("section"),_=b("h2"),v=re(p),k=j(),S=b("ul"),w=b("li"),w.innerHTML='GitHub: https://github.com/redgoose-dev/json-editor',L=j(),R=b("li"),P=re("Version: "),V=b("strong"),V.textContent=`${e[1]}`,Q=j(),W=b("li"),W.innerHTML='Author: https://redgoose.me',he=j(),z=b("li"),z.innerHTML='Feedback: https://github.com/redgoose-dev/json-editor/issues',u(i,"class","symbol svelte-l0njzv"),u(o,"class","label svelte-l0njzv"),u(s,"class","about__logo svelte-l0njzv"),u(f,"class","about__description svelte-l0njzv"),u(_,"class","svelte-l0njzv"),u(S,"class","svelte-l0njzv"),u(g,"class","information svelte-l0njzv"),u(n,"class","about__wrap svelte-l0njzv"),u(t,"class","about svelte-l0njzv")},m(Z,K){x(Z,t,K),d(t,n),d(n,s),d(s,i),J(r,i,null),d(s,l),d(s,o),J(a,o,null),d(n,c),d(n,f),f.innerHTML=h,d(n,m),d(n,g),d(g,_),d(_,v),d(g,k),d(g,S),d(S,w),d(S,L),d(S,R),d(R,P),d(R,V),d(S,Q),d(S,W),d(S,he),d(S,z),q=!0},p(Z,[K]){(!q||K&1)&&h!==(h=Z[0].aboutDescription+"")&&(f.innerHTML=h),(!q||K&1)&&p!==(p=Z[0].aboutInformation+"")&&de(v,p)},i(Z){q||(N(r.$$.fragment,Z),N(a.$$.fragment,Z),q=!0)},o(Z){O(r.$$.fragment,Z),O(a.$$.fragment,Z),q=!1},d(Z){Z&&A(t),B(r),B(a)}}}function $r(e,t,n){let s;ie(e,Ae,r=>n(0,s=r));const i=_r.version;return[s,i]}class kr extends ue{constructor(t){super(),ce(this,t,$r,wr,le,{})}}function Nr(e){let t,n,s,i,r,l,o,a;const c=e[2].default,f=rs(c,e,e[1],null);return r=new pe({props:{name:"x"}}),{c(){t=b("div"),n=b("div"),f&&f.c(),s=j(),i=b("button"),H(r.$$.fragment),u(i,"type","button"),u(i,"class","modal__close svelte-1mk0jit"),u(n,"class","modal__wrap svelte-1mk0jit"),u(t,"class","modal svelte-1mk0jit")},m(h,m){x(h,t,m),d(t,n),f&&f.m(n,null),d(n,s),d(n,i),J(r,i,null),l=!0,o||(a=[te(i,"click",e[0]),te(n,"click",vt(e[3])),te(t,"click",e[0])],o=!0)},p(h,[m]){f&&f.p&&(!l||m&2)&&cs(f,c,h,h[1],l?as(c,h[1],m,null):us(h[1]),null)},i(h){l||(N(f,h),N(r.$$.fragment,h),l=!0)},o(h){O(f,h),O(r.$$.fragment,h),l=!1},d(h){h&&A(t),f&&f.d(h),B(r),o=!1,Ce(a)}}}function Sr(e,t,n){let{$$slots:s={},$$scope:i}=t;const r=Pe();function l(){r("close")}function o(c){c.key==="Escape"&&l()}Lt(()=>{document.querySelector("html").classList.add("opened-modal"),addEventListener("keyup",o)}),rn(()=>{document.querySelector("html").classList.remove("opened-modal"),removeEventListener("keyup",o)});function a(c){_t.call(this,e,c)}return e.$$set=c=>{"$$scope"in c&&n(1,i=c.$$scope)},[l,i,s,a]}class bn extends ue{constructor(t){super(),ce(this,t,Sr,Nr,le,{})}}function Xn(e){let t,n,s;return n=new Po({}),{c(){t=b("div"),H(n.$$.fragment),u(t,"class","layout__preview svelte-1beoswq")},m(i,r){x(i,t,r),J(n,t,null),s=!0},i(i){s||(N(n.$$.fragment,i),s=!0)},o(i){O(n.$$.fragment,i),s=!1},d(i){i&&A(t),B(n)}}}function Qn(e){let t,n,s,i;return n=new bn({props:{$$slots:{default:[Tr]},$$scope:{ctx:e}}}),n.$on("close",e[10]),{c(){t=b("div"),H(n.$$.fragment),u(t,"class","modal-data svelte-1beoswq")},m(r,l){x(r,t,l),J(n,t,null),i=!0},p(r,l){e=r;const o={};l&131073&&(o.$$scope={dirty:l,ctx:e}),n.$set(o)},i(r){i||(N(n.$$.fragment,r),r&&Re(()=>{i&&(s||(s=Qe(t,et,e[4],!0)),s.run(1))}),i=!0)},o(r){O(n.$$.fragment,r),r&&(s||(s=Qe(t,et,e[4],!1)),s.run(0)),i=!1},d(r){r&&A(t),B(n),r&&s&&s.end()}}}function Tr(e){let t,n,s;function i(l){e[8](l)}let r={};return e[0].source!==void 0&&(r.source=e[0].source),t=new zo({props:r}),dt.push(()=>vi(t,"source",i)),t.$on("submit",e[6]),t.$on("close",e[9]),{c(){H(t.$$.fragment)},m(l,o){J(t,l,o),s=!0},p(l,o){const a={};!n&&o&1&&(n=!0,a.source=l[0].source,pi(()=>n=!1)),t.$set(a)},i(l){s||(N(t.$$.fragment,l),s=!0)},o(l){O(t.$$.fragment,l),s=!1},d(l){B(t,l)}}}function es(e){let t,n,s,i;return n=new bn({props:{$$slots:{default:[Er]},$$scope:{ctx:e}}}),n.$on("close",e[12]),{c(){t=b("div"),H(n.$$.fragment),u(t,"class","modal-data svelte-1beoswq")},m(r,l){x(r,t,l),J(n,t,null),i=!0},p(r,l){e=r;const o={};l&131074&&(o.$$scope={dirty:l,ctx:e}),n.$set(o)},i(r){i||(N(n.$$.fragment,r),r&&Re(()=>{i&&(s||(s=Qe(t,et,e[4],!0)),s.run(1))}),i=!0)},o(r){O(n.$$.fragment,r),r&&(s||(s=Qe(t,et,e[4],!1)),s.run(0)),i=!1},d(r){r&&A(t),B(n),r&&s&&s.end()}}}function Er(e){let t,n;return t=new er({props:{source:e[1].source}}),t.$on("close",e[11]),{c(){H(t.$$.fragment)},m(s,i){J(t,s,i),n=!0},p(s,i){const r={};i&2&&(r.source=s[1].source),t.$set(r)},i(s){n||(N(t.$$.fragment,s),n=!0)},o(s){O(t.$$.fragment,s),n=!1},d(s){B(t,s)}}}function ts(e){let t,n,s,i;return n=new bn({props:{$$slots:{default:[Or]},$$scope:{ctx:e}}}),n.$on("close",e[13]),{c(){t=b("div"),H(n.$$.fragment),u(t,"class","modal-about svelte-1beoswq")},m(r,l){x(r,t,l),J(n,t,null),i=!0},p(r,l){e=r;const o={};l&131072&&(o.$$scope={dirty:l,ctx:e}),n.$set(o)},i(r){i||(N(n.$$.fragment,r),r&&Re(()=>{i&&(s||(s=Qe(t,et,e[4],!0)),s.run(1))}),i=!0)},o(r){O(n.$$.fragment,r),r&&(s||(s=Qe(t,et,e[4],!1)),s.run(0)),i=!1},d(r){r&&A(t),B(n),r&&s&&s.end()}}}function Or(e){let t,n;return t=new kr({}),{c(){H(t.$$.fragment)},m(s,i){J(t,s,i),n=!0},i(s){n||(N(t.$$.fragment,s),n=!0)},o(s){O(t.$$.fragment,s),n=!1},d(s){B(t,s)}}}function Lr(e){let t,n,s,i,r,l,o,a,c,f,h,m;s=new Ji({}),s.$on("select-menu",e[5]),l=new Jo({}),l.$on("init",e[7]),l.$on("update",jr),l.$on("action",e[5]);let g=e[3]&&Xn(),_=e[0].visible&&Qn(e),p=e[1].visible&&es(e),v=e[2]&&ts(e);return{c(){t=b("div"),n=b("div"),H(s.$$.fragment),i=j(),r=b("div"),H(l.$$.fragment),o=j(),g&&g.c(),a=j(),_&&_.c(),c=j(),p&&p.c(),f=j(),v&&v.c(),h=sn(),u(n,"class","layout__header svelte-1beoswq"),u(r,"class","layout__editor svelte-1beoswq"),u(t,"class","layout svelte-1beoswq"),fe(t,"layout--preview",e[3])},m(k,S){x(k,t,S),d(t,n),J(s,n,null),d(t,i),d(t,r),J(l,r,null),d(t,o),g&&g.m(t,null),x(k,a,S),_&&_.m(k,S),x(k,c,S),p&&p.m(k,S),x(k,f,S),v&&v.m(k,S),x(k,h,S),m=!0},p(k,[S]){k[3]?g?S&8&&N(g,1):(g=Xn(),g.c(),N(g,1),g.m(t,null)):g&&(Le(),O(g,1,1,()=>{g=null}),je()),(!m||S&8)&&fe(t,"layout--preview",k[3]),k[0].visible?_?(_.p(k,S),S&1&&N(_,1)):(_=Qn(k),_.c(),N(_,1),_.m(c.parentNode,c)):_&&(Le(),O(_,1,1,()=>{_=null}),je()),k[1].visible?p?(p.p(k,S),S&2&&N(p,1)):(p=es(k),p.c(),N(p,1),p.m(f.parentNode,f)):p&&(Le(),O(p,1,1,()=>{p=null}),je()),k[2]?v?(v.p(k,S),S&4&&N(v,1)):(v=ts(k),v.c(),N(v,1),v.m(h.parentNode,h)):v&&(Le(),O(v,1,1,()=>{v=null}),je())},i(k){m||(N(s.$$.fragment,k),N(l.$$.fragment,k),N(g),N(_),N(p),N(v),m=!0)},o(k){O(s.$$.fragment,k),O(l.$$.fragment,k),O(g),O(_),O(p),O(v),m=!1},d(k){k&&(A(t),A(a),A(c),A(f),A(h)),B(s),B(l),g&&g.d(),_&&_.d(k),p&&p.d(k),v&&v.d(k)}}}function jr(e){e.detail}function Rr(e,t,n){let s,i,r;ie(e,Pt,w=>n(2,s=w)),ie(e,Yt,w=>n(3,i=w)),ie(e,mt,w=>n(16,r=w));let l,o={source:"",visible:!1,node:void 0},a={source:void 0,visible:!1,node:void 0};const c={duration:160,easing:Ci};function f(w){const{main:L,sub:R,node:P}=w.detail;let V;switch(L){case"data":switch(R){case"new":l.clear();break;case"import":n(0,o.source="",o),n(0,o.node=void 0,o),n(0,o.visible=!0,o);break;case"export":n(1,a.source=Object.assign({},r),a),n(1,a.node=void 0,a),n(1,a.visible=!0,a);break}break;case"view":switch(R){case"fold":case"unfold":V=l.el.tree.children().find(".node[data-type=object],.node[data-type=array]"),l.fold(V,R==="unfold");break;case"toggle-live-preview":Yt.change(!i);break}break;case"language":Rt.change(R);break;case"theme":ht.change(R);break;case"about":En(Pt,s=!0,s);break;case"editor":switch(R){case"import":n(0,o.source="",o),n(0,o.node=P,o),n(0,o.visible=!0,o);break;case"export":n(1,a.source=l.export(P,!1),a),n(1,a.node=P,a),n(1,a.visible=!0,a);break}break}}function h(w){const{source:L}=w.detail;try{let R=JSON.parse(L);n(0,o.visible=!1,o),o.node?(l.fold(o.node,!0),l.import(o.node,R)):l.replace(R)}catch{alert("Failed import JSON data.")}}function m(w){const{instance:L}=w.detail;l=L,l.$}Lt(async()=>{if(!mt.existStorageData()){const w=await vs();w&&l.replace(w)}});function g(w){e.$$.not_equal(o.source,w)&&(o.source=w,n(0,o))}return[o,a,s,i,c,f,h,m,g,()=>{n(0,o.visible=!1,o)},()=>{n(0,o.visible=!1,o)},()=>n(1,a.visible=!1,a),()=>{n(1,a.visible=!1,a)},()=>En(Pt,s=!1,s)]}class Ar extends ue{constructor(t){super(),ce(this,t,Rr,Lr,le,{})}}new Ar({target:document.getElementById("app"),props:{}}); diff --git a/docs/index.html b/docs/index.html index 4e42765..0b48310 100644 --- a/docs/index.html +++ b/docs/index.html @@ -17,7 +17,7 @@ - + diff --git a/package.json b/package.json index 4d22d41..383dbbe 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@redgoose/json-editor", "description": "Easy editing JSON data", "author": "redgoose ", - "version": "1.2.1", + "version": "1.2.2", "keywords": [ "json", "editor", "library", "tool" ], "license": "MIT", "main": "./lib/json-editor.js", diff --git a/src/docs/components/editor/index.svelte b/src/docs/components/editor/index.svelte index 6a37d7f..c331a86 100644 --- a/src/docs/components/editor/index.svelte +++ b/src/docs/components/editor/index.svelte @@ -60,8 +60,9 @@ function setupJsonEditor() editor = new JsonEditor(_editor, { live: true, theme: $theme, + node: $source, + openDepth: 3, }) - editor.replace($source, {}, false) _editor.addEventListener('update', updateSource) _editor.addEventListener('context', customContext) dispatch('init', { instance: editor }) @@ -80,7 +81,6 @@ function restartJsonEditor() { if (!_editor) return destroyJsonEditor() - // TODO: 언어변경 setupJsonEditor() }