(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44210],{84190:(e,s,t)=>{"use strict";t.d(s,{Z:()=>n});/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,t(43349).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},44210:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>S});var n=t(67841),l=t(79477),i=t(64833),r=t(25967),a=t(47656),o=t(84190),c=t(45700);let p=(0,i.z)("div")({name:"Expander",class:"en72zbs",propsAsIs:!1});t(41362);let d=(0,i.z)("button")({name:"Header",class:"humgug",propsAsIs:!1}),h=(0,i.z)(c.E.div)({name:"Files",class:"fti3l18",propsAsIs:!0}),u=(0,i.z)(c.E.div)({name:"IconWrapper",class:"isx0cmb",propsAsIs:!0}),x=function(e){let{name:s,slug:t,isExpanded:l,onClick:i,children:r}=e;return(0,n.jsxs)("div",{children:[(0,n.jsxs)(d,{onClick:()=>i(t),children:[(0,n.jsx)(p,{}),(0,n.jsx)(u,{initial:!1,animate:{rotate:l?90:0},children:(0,n.jsx)(o.Z,{size:14})}),s]}),(0,n.jsx)(h,{initial:!1,animate:{height:l?"auto":0,opacity:l?1:0,overflow:l?void 0:"hidden"},style:{},children:r})]})};t(71292);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let f=(0,t(43349).Z)("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]),m=(0,i.z)("button")({name:"Wrapper",class:"wx2tdb1",propsAsIs:!1}),g=(0,i.z)("div")({name:"IconWrapper",class:"i1q5keel",propsAsIs:!1}),j=(0,i.z)("div")({name:"NameWrapper",class:"nguumd2",propsAsIs:!1}),y=function(e){let{file:s,slug:t,isExpanded:l,onClick:i}=e;return(0,n.jsxs)(m,{style:{"--color":s.isSelected?"hsl(50deg 100% 60%)":"inherit"},onClick:()=>i(t),tabIndex:!1===l?-1:void 0,children:[(0,n.jsx)(p,{style:{"--opacity":s.isSelected?.1:0}}),(0,n.jsx)(g,{children:(0,n.jsx)(f,{size:14,color:s.isSelected?"hsl(50deg 100% 60%)":"hsl(0deg 0% 100% / 0.5)"})}),(0,n.jsx)(j,{children:s.name})]})};t(21687);let v=e=>"file"===e.type,z=(0,i.z)("div")({name:"Wrapper",class:"wjigro0",propsAsIs:!1}),b=function(e){let{files:s,setFiles:t}=e,l=function e(s,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return s.map(s=>{let i="".concat(l,"/").concat(s.name);return v(s)?(0,n.jsx)(y,{file:s,slug:i,onClick:t.handleSelectFile,isExpanded:!!t.isExpanded},i):(0,n.jsx)(x,{slug:i,name:s.name,isExpanded:s.isExpanded,onClick:t.handleToggleDirectory,children:e(s.contents,{...t,isExpanded:s.isExpanded},i)},i)})}(s,{handleToggleDirectory:function(e){let s=e.slice(1).split("/");t(e=>(0,a.Uy)(e,e=>{let t={name:"parent",type:"directory",isExpanded:!1,contents:e};for(;s.length;){let e=s.shift();e&&(t=t.contents.find(s=>s.name===e))}t.isExpanded=!t.isExpanded}))},handleSelectFile:function(e){t(s=>(0,a.Uy)(s,s=>{!function e(s,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";s.forEach(s=>{let l="".concat(n,"/").concat(s.name);"file"===s.type?s.isSelected=t===l:e(s.contents,t,l)})}(s,e)}))}});return(0,n.jsx)(z,{children:l})};t(58518);var w=t(62867),E=t(28061);let I=(0,i.z)(w.Z)({name:"Wrapper",class:"w1yut6hb",propsAsIs:!0}),k=(0,i.z)(E.default)({name:"CodeSnippet",class:"c1esjvzp",propsAsIs:!0});t(89683);let A=(0,i.z)(r.Z)({name:"Wrapper",class:"wz6pjyl",propsAsIs:!0}),C=(0,i.z)(e=>{let{file:s,...t}=e,l=function(e){let s=e.split(".");return s[s.length-1]}(s.name);return"js"===l&&(l="jsx"),(0,n.jsx)(I,{...t,children:(0,n.jsx)(k,{lockedToColorMode:"light",includeContentStyles:!1,code:s.contents,lang:l})})})({name:"FlexedFileContent",class:"fun271e",propsAsIs:!0}),S=function(e){let{minHeight:s=420,maxHeight:t,initialFiles:i}=e,[r,a]=l.useState(i),o=function(e,s){let t=[...e];for(;t.length;){let e=t.shift();if(!e)throw Error("This should never happen (getting file)");if("file"===e.type&&s(e))return e;"directory"===e.type&&t.push(...e.contents)}throw Error("No active file selected")}(r,e=>!!v(e)&&!!e.isSelected);return(0,n.jsxs)(A,{style:{"--min-content-height":s+"px","--max-content-height":void 0===t?void 0:t+"px"},children:[(0,n.jsx)(b,{files:r,setFiles:a}),(0,n.jsx)(C,{file:o})]})};t(55775)},25967:(e,s,t)=>{"use strict";t.d(s,{Z:()=>i});var n=t(64833),l=t(21364);let i=(0,n.z)(l.Wc)({name:"Space",class:"s1hfctpl",propsAsIs:!0});t(55245)},71292:e=>{e.exports={humgug:"humgug",fti3l18:"fti3l18",isx0cmb:"isx0cmb"}},41362:e=>{e.exports={en72zbs:"en72zbs"}},21687:e=>{e.exports={wx2tdb1:"wx2tdb1",i1q5keel:"i1q5keel",nguumd2:"nguumd2"}},89683:e=>{e.exports={w1yut6hb:"w1yut6hb",c1esjvzp:"c1esjvzp"}},55775:e=>{e.exports={wz6pjyl:"wz6pjyl",fun271e:"fun271e"}},58518:e=>{e.exports={wjigro0:"wjigro0"}}}]); //# sourceMappingURL=44210.52fa86e09310e256.js.map