1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[51827],{82183:function(e,n,t){t.d(n,{Gj:function(){return tf},_V:function(){return nR},oT:function(){return e4},sp:function(){return nD},uR:function(){return eE}});var r,o,i,s,a,l,c,d,u,p,f,v,m,h,g,b,x,y=t(85893),w=t(67294),$=t(67839),j=t(38471),C=t(58672),k=t(32286),S=t(34790),N=t(45383),O=t(59119),E=t(78120),M=t(47421),F=t(9665),L=t(48120),A=t(82261),R=t(122),I=t(35524),D=t(1458),T=t(68699),H=t(26961),P=function(){return(P=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};function B(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>n.indexOf(r)&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)0>n.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]]);return t}function J(e,n,t,r){return new(t||(t=Promise))(function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):((n=e.value)instanceof t?n:new t(function(e){e(n)})).then(s,a)}l((r=r.apply(e,n||[])).next())})}function z(e,n){var t,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(t)throw TypeError("Generator is already executing.");for(;s;)try{if(t=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=n.call(e,s)}catch(e){i=[6,e],r=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function U(e,n,t){if(t||2==arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}var Z=function(e){return(0,y.jsx)("svg",P({fill:"currentColor",height:"16",viewBox:"0 0 16 16",width:"16",xmlns:"http://www.w3.org/2000/svg"},e),void 0)},W=function(){return(0,y.jsxs)(Z,P({viewBox:"0 0 48 48"},{children:[(0,y.jsx)("title",{children:"Sign in"},void 0),(0,y.jsx)("path",{d:"M9 42q-1.2 0-2.1-.9Q6 40.2 6 39V9q0-1.2.9-2.1Q7.8 6 9 6h14.55v3H9v30h14.55v3Zm24.3-9.25-2.15-2.15 5.1-5.1h-17.5v-3h17.4l-5.1-5.1 2.15-2.15 8.8 8.8Z"},void 0)]}),void 0)},V=function(){return(0,y.jsxs)(Z,P({viewBox:"0 0 48 48"},{children:[(0,y.jsx)("title",{children:"Sign out"},void 0),(0,y.jsx)("path",{d:"M9 42q-1.2 0-2.1-.9Q6 40.2 6 39V9q0-1.2.9-2.1Q7.8 6 9 6h14.55v3H9v30h14.55v3Zm24.3-9.25-2.15-2.15 5.1-5.1h-17.5v-3h17.4l-5.1-5.1 2.15-2.15 8.8 8.8Z"},void 0)]}),void 0)},_=function(){return(0,y.jsxs)(Z,P({fill:"none",stroke:"currentColor"},{children:[(0,y.jsx)("title",{children:"Restart script"},void 0),(0,y.jsx)("path",{d:"M8 2C4.68629 2 2 4.68629 2 8C2 10.0946 3.07333 11.9385 4.7 13.0118",strokeLinecap:"round"},void 0),(0,y.jsx)("path",{d:"M14.0005 7.9998C14.0005 5.82095 12.8391 3.91335 11.1016 2.8623",strokeLinecap:"round"},void 0),(0,y.jsx)("path",{d:"M14.0003 2.3335H11.167C10.8908 2.3335 10.667 2.55735 10.667 2.8335V5.66683",strokeLinecap:"round"},void 0),(0,y.jsx)("path",{d:"M1.99967 13.6665L4.83301 13.6665C5.10915 13.6665 5.33301 13.4426 5.33301 13.1665L5.33301 10.3332",strokeLinecap:"round"},void 0),(0,y.jsx)("path",{d:"M10 10L12 12L10 14",strokeLinecap:"round",strokeLinejoin:"round"},void 0),(0,y.jsx)("path",{d:"M14.667 14L12.667 14",strokeLinecap:"round",strokeLinejoin:"round"},void 0)]}),void 0)},Y=function(){return(0,y.jsxs)(Z,{children:[(0,y.jsx)("title",{children:"Run sandbox"},void 0),(0,y.jsx)("path",{d:"M11.0792 8.1078C11.2793 8.25007 11.27 8.55012 11.0616 8.67981L6.02535 11.8135C5.79638 11.956 5.5 11.7913 5.5 11.5216L5.5 8.40703L5.5 4.80661C5.5 4.52735 5.81537 4.36463 6.04296 4.52647L11.0792 8.1078Z"},void 0)]},void 0)},G=function(){return(0,y.jsxs)(Z,{children:[(0,y.jsx)("title",{children:"Click to go back"},void 0),(0,y.jsx)("path",{d:"M9.64645 12.3536C9.84171 12.5488 10.1583 12.5488 10.3536 12.3536C10.5488 12.1583 10.5488 11.8417 10.3536 11.6464L9.64645 12.3536ZM10.3536 4.35355C10.5488 4.15829 10.5488 3.84171 10.3536 3.64644C10.1583 3.45118 9.84171 3.45118 9.64645 3.64644L10.3536 4.35355ZM6.07072 7.92929L5.71716 7.57573L6.07072 7.92929ZM10.3536 11.6464L6.42427 7.71716L5.71716 8.42426L9.64645 12.3536L10.3536 11.6464ZM6.42427 8.28284L10.3536 4.35355L9.64645 3.64644L5.71716 7.57573L6.42427 8.28284ZM6.42427 7.71716C6.58048 7.87337 6.58048 8.12663 6.42427 8.28284L5.71716 7.57573C5.48285 7.81005 5.48285 8.18995 5.71716 8.42426L6.42427 7.71716Z"},void 0)]},void 0)},q=function(){return(0,y.jsxs)(Z,{children:[(0,y.jsx)("title",{children:"Click to go forward"},void 0),(0,y.jsx)("path",{d:"M6.35355 3.64645C6.15829 3.45118 5.84171 3.45118 5.64645 3.64645C5.45118 3.84171 5.45118 4.15829 5.64645 4.35355L6.35355 3.64645ZM5.64645 11.6464C5.45118 11.8417 5.45118 12.1583 5.64645 12.3536C5.84171 12.5488 6.15829 12.5488 6.35355 12.3536L5.64645 11.6464ZM9.92929 8.07071L10.2828 8.42426L9.92929 8.07071ZM5.64645 4.35355L9.57574 8.28284L10.2828 7.57574L6.35355 3.64645L5.64645 4.35355ZM9.57574 7.71716L5.64645 11.6464L6.35355 12.3536L10.2828 8.42426L9.57574 7.71716ZM9.57574 8.28284C9.41952 8.12
1663 9.41953 7.87337 9.57574 7.71716L10.2828 8.42426C10.5172 8.18995 10.5172 7.81005 10.2828 7.57574L9.57574 8.28284Z"},void 0)]},void 0)},X=function(){return(0,y.jsxs)(Z,{children:[(0,y.jsx)("title",{children:"Refresh preview"},void 0),(0,y.jsx)("path",{clipRule:"evenodd",d:"M3.83325 7.99992C3.83325 5.69867 5.69853 3.83325 7.99934 3.83325C9.81246 3.83325 11.3563 4.99195 11.9285 6.61097C11.9396 6.6425 11.9536 6.67221 11.97 6.69992H8.80005C8.52391 6.69992 8.30005 6.92378 8.30005 7.19992C8.30005 7.47606 8.52391 7.69992 8.80005 7.69992H12.5667C12.8981 7.69992 13.1667 7.43129 13.1667 7.09992V3.33325C13.1667 3.05711 12.9429 2.83325 12.6667 2.83325C12.3906 2.83325 12.1667 3.05711 12.1667 3.33325V4.94608C11.2268 3.66522 9.7106 2.83325 7.99934 2.83325C5.14613 2.83325 2.83325 5.14651 2.83325 7.99992C2.83325 10.8533 5.14613 13.1666 7.99934 13.1666C9.91218 13.1666 11.5815 12.1266 12.474 10.5836C12.6123 10.3446 12.5306 10.0387 12.2915 9.90044C12.0525 9.76218 11.7466 9.84387 11.6084 10.0829C10.8873 11.3296 9.54072 12.1666 7.99934 12.1666C5.69853 12.1666 3.83325 10.3012 3.83325 7.99992Z",fillRule:"evenodd"},void 0)]},void 0)},Q=function(){return(0,y.jsxs)(Z,P({fill:"none",stroke:"currentColor"},{children:[(0,y.jsx)("title",{children:"Clean"},void 0),(0,y.jsx)("circle",{cx:"7.99998",cy:"8.00004",r:"4.66667",strokeLinecap:"round"},void 0),(0,y.jsx)("path",{d:"M4.66669 4.66663L11.3334 11.3333"},void 0)]}),void 0)},K=function(){return(0,y.jsxs)(Z,P({fill:"none",stroke:"currentColor"},{children:[(0,y.jsx)("title",{children:"Open on CodeSandbox"},void 0),(0,y.jsx)("path",{d:"M6.66665 3.33337H4.33331C3.78103 3.33337 3.33331 3.78109 3.33331 4.33337V11.6667C3.33331 12.219 3.78103 12.6667 4.33331 12.6667H11.6666C12.2189 12.6667 12.6666 12.219 12.6666 11.6667V9.33337",strokeLinecap:"round"},void 0),(0,y.jsx)("path",{d:"M10 3.33337H12.5667C12.6219 3.33337 12.6667 3.37815 12.6667 3.43337V6.00004",strokeLinecap:"round"},void 0),(0,y.jsx)("path",{d:"M7.33331 8.66668L12.5333 3.46667",strokeLinecap:"round"},void 0)]}),void 0)},ee=function(){return jsxs(Z,{children:[jsx("title",{children:"Directory"},void 0),jsx("path",{d:"M12.5526 12.6667H3.66675C3.2922 12.6667 2.96575 12.4608 2.79442 12.156L3.81072 8.0908C3.92201 7.64563 4.32199 7.33333 4.78086 7.33333H13.386C14.0365 7.33333 14.5139 7.94472 14.3561 8.57587L13.5228 11.9092C13.4115 12.3544 13.0115 12.6667 12.5526 12.6667Z",fill:"currentColor"},void 0),jsx("path",{d:"M13.3334 6.63333V6.33333C13.3334 5.78105 12.8857 5.33333 12.3334 5.33333H8.30286C8.10543 5.33333 7.91242 5.2749 7.74816 5.16538L6.25201 4.16795C6.08774 4.05844 5.89473 4 5.69731 4H3.66675C3.11446 4 2.66675 4.44772 2.66675 5L2.66675 11.6667C2.66675 12.219 3.11446 12.6667 3.66675 12.6667H12.5526C13.0115 12.6667 13.4115 12.3544 13.5228 11.9092L14.3561 8.57587C14.5139 7.94472 14.0365 7.33333 13.386 7.33333H4.78086C4.32199 7.33333 3.92201 7.64563 3.81072 8.0908L2.75008 12.3333",fill:"none",stroke:"currentColor",strokeLinecap:"round"},void 0)]},void 0)},en=function(){return jsxs(Z,{children:[jsx("title",{children:"Directory"},void 0),jsx("path",{d:"M12.3334 12.6667H3.66675C3.11446 12.6667 2.66675 12.219 2.66675 11.6667V5C2.66675 4.44772 3.11446 4 3.66675 4H5.69731C5.89473 4 6.08774 4.05844 6.25201 4.16795L7.74816 5.16538C7.91242 5.2749 8.10543 5.33333 8.30286 5.33333H12.3334C12.8857 5.33333 13.3334 5.78105 13.3334 6.33333V11.6667C13.3334 12.219 12.8857 12.6667 12.3334 12.6667Z",fill:"currentColor",stroke:"currentColor",strokeLinecap:"round"},void 0)]},void 0)},et=function(){return jsxs(Z,P({fill:"currentColor"},{children:[jsx("title",{children:"File"},void 0),jsx("path",{clipRule:"evenodd",d:"M4.5 4.33325C4.5 4.05711 4.72386 3.83325 5 3.83325H8.16675V6.56659C8.16675 6.89795 8.43538 7.16658 8.76675 7.16658H11.5V12.3333C11.5 12.6094 11.2761 12.8333 11 12.8333H5C4.72386 12.8333 4.5 12.6094 4.5 12.3333V4.33325ZM12.5 6.67568C12.5001 6.67265 12.5001 6.66962 12.5001 6.66658C12.5001 6.66355 12.5001 6.66052 12.5 6.65749V6.41413C12.5 6.01631 12.342 5.63478 12.0607 5.35347L9.97978 3.27259C9.69848 2.99129 9.31694 2.83325 8.91912 2.83325H8.66675H5C4.17157 2.83325 3.5 3.50483 3.5 4.33325V12.3333C3.5 13.1617 4.17157 13.8333 5 13.8333H11C11.8284 13.8333 12.5 13.1617 12.5 12.3333V6.67568ZM9.16675 3.89888C9.20518 3.92078 9.24085 3.94787 9.27267 3.9797L11.3536 6.06058C11.3854 6.09243 11.4125 6.12813 11.4344 6.16658H9.16675V3.89888Z",fillRule:"evenodd"},void 0)]}),void 0)},er=function(){return(0,y.jsxs)(Z,P({stroke:"currentColor"},{children:[(0,y.jsx)("title",{children:"Close file"},void 0),(0,y.jsx)("path",{d:"M12 4L4 12",strokeLinecap:"round"},void 0),(0,y.jsx)("path",{d:"M4 4L12 12",strokeLinecap:"round"},void 0)]}),void 0)},eo=function(){return(0,y.jsxs)(Z,{children:[(0,y.jsx)("title",{children:"Open browser console"},void 0),(0,y.jsx)("path",{d:"M5.65871 3.62037C5.44905 3.44066 5.1334 3.46494 4.95368 3.6746C4.77397 3.88427 4.79825 4.19992 5.00792 4.37963L5.65871 3.62037ZM5.00792 11.6204C4.79825 11.8001 4.77397 12.1157 4.95368 12.3254C5.1334 12.5351 5.44905 12.5593 5.65871 12.3796L5.00792 11.6204ZM9.9114 7.92407L10.2368 7.54445L9.9114 7.92407ZM5.00
1792 4.37963L9.586 8.3037L10.2368 7.54445L5.65871 3.62037L5.00792 4.37963ZM9.586 7.6963L5.00792 11.6204L5.65871 12.3796L10.2368 8.45555L9.586 7.6963ZM9.586 8.3037C9.39976 8.14407 9.39976 7.85594 9.586 7.6963L10.2368 8.45555C10.5162 8.2161 10.5162 7.7839 10.2368 7.54445L9.586 8.3037Z"},void 0),(0,y.jsx)("path",{d:"M10 11.5C9.72386 11.5 9.5 11.7239 9.5 12C9.5 12.2761 9.72386 12.5 10 12.5V11.5ZM14.6667 12.5C14.9428 12.5 15.1667 12.2761 15.1667 12C15.1667 11.7239 14.9428 11.5 14.6667 11.5V12.5ZM10 12.5H14.6667V11.5H10V12.5Z"},void 0)]},void 0)},ei={colors:{surface1:"#ffffff",surface2:"#EFEFEF",surface3:"#F3F3F3",disabled:"#C5C5C5",base:"#323232",clickable:"#808080",hover:"#4D4D4D",accent:"#3973E0",error:"#EA3323",errorSurface:"#FCF1F0",warning:"#6A4516",warningSurface:"#FEF2C0"},syntax:{plain:"#151515",comment:{color:"#999",fontStyle:"italic"},keyword:"#7C5AE3",tag:"#0971F1",punctuation:"#3B3B3B",definition:"#85A600",property:"#3B3B3B",static:"#3B3B3B",string:"#2E6BD0"},font:{body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'"Fira Mono", "DejaVu Sans Mono", Menlo, Consolas, "Liberation Mono", Monaco, "Lucida Console", monospace',size:"13px",lineHeight:"20px"}},es={colors:{surface1:"#151515",surface2:"#252525",surface3:"#2F2F2F",disabled:"#4D4D4D",base:"#808080",clickable:"#999999",hover:"#C5C5C5",accent:"#E5E5E5",error:"#FFB4A6",errorSurface:"#690000",warning:"#E7C400",warningSurface:"#3A3000"},syntax:{plain:"#FFFFFF",comment:{color:"#757575",fontStyle:"italic"},keyword:"#77B7D7",tag:"#DFAB5C",punctuation:"#ffffff",definition:"#86D9CA",property:"#77B7D7",static:"#C64640",string:"#977CDC"},font:{body:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',mono:'"Fira Mono", "DejaVu Sans Mono", Menlo, Consolas, "Liberation Mono", Monaco, "Lucida Console", monospace',size:"13px",lineHeight:"20px"}},ea={light:ei,dark:es,auto:"undefined"!=typeof window&&(null===(o=null==window?void 0:window.matchMedia)||void 0===o?void 0:o.call(window,"(prefers-color-scheme: dark)").matches)?es:ei},el=function(e){var n=e.lastIndexOf("/");return e.slice(n+1)},ec=function(e,n){var t=("/"===e[0]?e.slice(1):e).split("/"),r=[];if(1===t.length)r.unshift(t[0]);else for(var o=0;o<n.length;o++)for(var i=n[o].split("/"),s=1;s<=t.length;s++){var a=t[t.length-s],l=i[i.length-s];if(r.length<s&&r.unshift(a),a!==l)break}return r.length<t.length&&r.unshift(".."),r.join("/")},ed=function(e){var n=0,t=0,r=0;if(e.startsWith("#")){if(e.length<7)return!0;n=parseInt(e.substr(1,2),16),t=parseInt(e.substr(3,2),16),r=parseInt(e.substr(5,2),16)}else{var o=e.replace("rgb(","").replace("rgba(","").replace(")","").split(",");if(o.length<3)return!0;n=parseInt(o[0],10),t=parseInt(o[1],10),r=parseInt(o[2],10)}return(299*n+587*t+114*r)/1e3<128},eu=0,ep=function(){return(+(Date.now().toString(10).substr(0,4)+eu++)).toString(16)},ef=function(){return""},ev=Object.getOwnPropertyDescriptors({toString:ef});Object.defineProperties(ef,ev);var em=(i=(0,$.Th)({prefix:"sp"})).createTheme,eh=i.css,eg=(i.getCssText,i.keyframes),eb={space:Array(11).fill(" ").reduce(function(e,n,t){var r;return P(P({},e),((r={})[t+1]=(t+1)*4+"px",r))},{}),border:{radius:"4px"},layout:{height:"300px",headerHeight:"40px"},transitions:{default:"150ms ease"},zIndices:{base:"1",overlay:"2",top:"3"}},ex=function(e){var n=Object.entries(e.syntax).reduce(function(e,n){var t,r=n[0],o=n[1],i=((t={})["color-"+r]=o,t);return"object"==typeof o&&(i=Object.entries(o).reduce(function(e,n){var t,o=n[0],i=n[1];return P(P({},e),((t={})[o+"-"+r]=i,t))},{})),P(P({},e),i)},{});return P(P({},eb),{colors:e.colors,font:e.font,syntax:n})},ey=function(e){if(void 0===e&&(e="light"),"string"==typeof e){var n,t,r,o,i,s=ea[e];if(!s)throw Error("[sandpack-react]: invalid theme '"+e+"' provided.");return{theme:s,id:e,mode:ed(s.colors.surface1)?"dark":"light"}}var a=ed(null!==(t=null===(n=null==e?void 0:e.colors)||void 0===n?void 0:n.surface1)&&void 0!==t?t:ei.colors.surface1)?"dar
1k":"light",l="dark"===a?es:ei,c={colors:P(P({},l.colors),null!==(r=null==e?void 0:e.colors)&&void 0!==r?r:{}),syntax:P(P({},l.syntax),null!==(o=null==e?void 0:e.syntax)&&void 0!==o?o:{}),font:P(P({},l.font),null!==(i=null==e?void 0:e.font)&&void 0!==i?i:{})},d=e?ew(JSON.stringify(c)):"default";return{theme:c,id:"sp-"+d,mode:a}},ew=function(e){for(var n=0,t=0;t<e.length;n&=n)n=31*n+e.charCodeAt(t++);return Math.abs(n)},e$=function(){return""};e$.toString=e$;var ej=(0,w.createContext)({}),eC=function(e){var n=e.children,t=e.classes;return(0,y.jsx)(ej.Provider,P({value:t||{}},{children:n}),void 0)},ek=function(){var e=(0,w.useContext)(ej);return function(n,t){void 0===t&&(t=[]);var r="sp-"+n;return eS.apply(void 0,U(U([],t,!1),[r,e[r]],!1))}},eS=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.filter(Boolean).join(" ")},eN=eh({all:"initial",fontSize:"$font$size",fontFamily:"$font$body",display:"block",boxSizing:"border-box",textRendering:"optimizeLegibility",WebkitTapHighlightColor:"transparent",WebkitFontSmoothing:"subpixel-antialiased",variants:{variant:{dark:{colorScheme:"dark"},light:{colorScheme:"light"}}},"@media screen and (min-resolution: 2dppx)":{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"},"*":{boxSizing:"border-box"},".sp-wrapper:focus":{outline:"0"}}),eO=w.createContext({theme:ei,id:"light",mode:"light"}),eE=function(e){var n=e.theme,t=e.children,r=e.className,o=B(e,["theme","children","className"]),i=ey(n),s=i.theme,a=i.id,l=i.mode,c=ek(),d=w.useMemo(function(){return em(a,ex(s))},[s,a]);return(0,y.jsx)(eO.Provider,P({value:{theme:s,id:a,mode:l}},{children:(0,y.jsx)("div",P({className:c("wrapper",[d,eN({variant:l}),r])},o,{children:t}),void 0)}),void 0)};eO.Consumer;var eM={"/styles.css":{code:"body {\n font-family: sans-serif;\n -webkit-font-smoothing: auto;\n -moz-font-smoothing: auto;\n -moz-osx-font-smoothing: grayscale;\n font-smoothing: auto;\n text-rendering: optimizeLegibility;\n font-smooth: always;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n}\n\nh1 {\n font-size: 1.5rem;\n}"}},eF={files:{"/src/styles.css":eM["/styles.css"],"/src/pages/index.astro":{code:'---\nimport "../styles.css";\nconst data = "world";\n---\n\n<h1>Hello {data}</h1>\n\n<style>\n h1 {\n font-size: 1.5rem;\n }\n</style>'},".env":{code:'ASTRO_TELEMETRY_DISABLED="1"'},"/package.json":{code:JSON.stringify({dependencies:{astro:"^1.6.12","esbuild-wasm":"^0.15.16"},scripts:{dev:"astro dev",start:"astro dev",build:"astro build",preview:"astro preview",astro:"astro"}})}},main:"/src/pages/index.astro",environment:"node"},eL={files:P(P({},eM),{"/pages/_app.js":{code:"import '../styles.css'\n\nexport default function MyApp({ Component, pageProps }) {\n return <Component {...pageProps} />\n}"},"/pages/index.js":{code:'export default function Home({ data }) {\n return (\n <div>\n <h1>Hello {data}</h1>\n </div>\n );\n}\n \nexport function getServerSideProps() {\n return {\n props: { data: "world" },\n }\n}\n'},"/next.config.js":{code:"/** @type {import('next').NextConfig} */\nconst nextConfig = {\n reactStrictMode: true,\n swcMinify: true,\n}\n\nmodule.exports = nextConfig\n"},"/package.json":{code:JSON.stringify({name:"my-app",version:"0.1.0",private:!0,scripts:{dev:"NEXT_TELEMETRY_DISABLED=1 next dev",build:"next build",start:"next start",lint:"next lint"},dependencies:{next:"12.1.6",react:"18.2.0","react-dom":"18.2.0","@next/swc-wasm-nodejs":"12.1.6"}})}}),main:"/pages/index.js",environment:"node"},eA={files:{"/index.js":{code:"const http = require('http');\n\nconst hostname = '127.0.0.1';\nconst port = 3000;\n\nconst server = http.createServer((req, res) => {\n res.statusCode = 200;\n res.setHeader('Content-Type', 'text/html');\n res.end('Hello world');\n});\n\nserver.listen(port, hostname, () => {\n console.log(`Server running at http://${hostname}:${port}/`);\n});"},"/package.json":{code:JSON.stringify({dependencies:{},scripts:{start:"node index.js"},main:"index.js"})}},main:"/index.js",environment:"node"},eR={files:P(P({},eM),{"/index.js":{code:'import "./styles.css";\n\ndocument.getElementById("app").innerHTML = `\n<h1>
1Hello world</h1>\n`;\n'},"/index.html":{code:'<!DOCTYPE html>\n<html lang="en">\n <head>\n <meta charset="UTF-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n <title>Vite App</title>\n </head>\n <body>\n <div id="app"></div>\n <script type="module" src="/index.js"></script>\n </body>\n</html>\n'},"/package.json":{code:JSON.stringify({scripts:{dev:"vite",build:"vite build",preview:"vite preview"},devDependencies:{vite:"4.1.4","esbuild-wasm":"0.17.12"}})}}),main:"/index.js",environment:"node"},eI={files:P(P({},eM),{"/App.jsx":{code:'export default function App() {\n const data = "world"\n\n return <h1>Hello {data}</h1>\n}\n'},"/index.jsx":{code:'import { StrictMode } from "react";\nimport { createRoot } from "react-dom/client";\nimport "./styles.css";\n\nimport App from "./App";\n\nconst root = createRoot(document.getElementById("root"));\nroot.render(\n <StrictMode>\n <App />\n </StrictMode>\n);'},"/index.html":{code:'<!DOCTYPE html>\n<html lang="en">\n <head>\n <meta charset="UTF-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n <title>Vite App</title>\n </head>\n <body>\n <div id="root"></div>\n <script type="module" src="/index.jsx"></script>\n </body>\n</html>\n'},"/package.json":{code:JSON.stringify({scripts:{dev:"vite",build:"vite build",preview:"vite preview"},dependencies:{react:"^18.2.0","react-dom":"^18.2.0"},devDependencies:{"@vitejs/plugin-react":"3.1.0",vite:"4.1.4","esbuild-wasm":"0.17.12"}})},"/vite.config.js":{code:'import { defineConfig } from "vite";\nimport react from "@vitejs/plugin-react";\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [react()],\n});\n'}}),main:"/App.jsx",environment:"node"},eD={files:P(P({},eM),{"/App.tsx":{code:'export default function App() {\n const data: string = "world"\n\n return <h1>Hello {data}</h1>\n}\n'},"/index.tsx":{code:'import { StrictMode } from "react";\nimport { createRoot } from "react-dom/client";\nimport "./styles.css";\n\nimport App from "./App";\nimport React from "react";\n\nconst root = createRoot(document.getElementById("root") as HTMLElement);\nroot.render(\n <StrictMode>\n <App />\n </StrictMode>\n);\n'},"/index.html":{code:'<!DOCTYPE html>\n<html lang="en">\n <head>\n <meta charset="UTF-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n <title>Vite App</title>\n </head>\n <body>\n <div id="root"></div>\n <script type="module" src="/index.tsx"></script>\n </body>\n</html>\n'},"/tsconfig.json":{code:JSON.stringify({compilerOptions:{target:"ESNext",useDefineForClassFields:!0,lib:["DOM","DOM.Iterable","ESNext"],allowJs:!1,skipLibCheck:!0,esModuleInterop:!1,allowSyntheticDefaultImports:!0,strict:!0,forceConsistentCasingInFileNames:!0,module:"ESNext",moduleResolution:"Node",resolveJsonModule:!0,isolatedModules:!0,noEmit:!0,jsx:"react-jsx"},include:["src"],references:[{path:"./tsconfig.node.json"}]},null,2)},"/tsconfig.node.json":{code:JSON.stringify({compilerOptions:{composite:!0,module:"ESNext",moduleResolution:"Node",allowSyntheticDefaultImports:!0},include:["vite.config.ts"]},null,2)},"/package.json":{code:JSON.stringify({scripts:{dev:"vite",build:"tsc && vite build",preview:"vite preview"},dependencies:{react:"^18.2.0","react-dom":"^18.2.0"},devDependencies:{"@types/react":"^18.0.28","@types/react-dom":"^18.0.11","@vitejs/plugin-react":"^3.1.0",typescript:"^4.9.5",vite:"4.1.4","esbuild-wasm":"^0.17.12"}},null,2)},"/vite-env.d.ts":{code:'/// <reference types="vite/client" />'},"/vite.config.ts":{code:"import { defineConfig } from 'vite'\nimport react from '@vitejs/plugin-react'\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [react()],\n})\n"}}),main:"/App.tsx",environment:"node"},eT={files:{"/src/styles.css":eM["/styles.css"],"/src/App.svelte":{code:'<script>\nconst data = "world";\n</script>\n\n<h1>Hello {data}</h1>\n\n<style>\nh1 {\n font-size: 1.5rem;\n}\n</style>'},"/src/main.js":{code:"import App from './App.svelte'\nimport \"./styles.css\"\n\nconst app = new App({\n target: document.getElementById('app'),\n})\n\nexport default app"},"/index.html":{code:'<!DOCTYPE html>\n<html lang="en">\n <head>\n <meta charset="UTF-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n <title>Vite App</title>\n </head>\n <body>\n <div id="app"></div>\n <script type="module" src="/src/main.js"></script>\n </body>\n</html>\n'},"/vite.config.js":{code:"import { defineConfig } from 'vite'\nimport { svelte } from '@sveltejs/vite-plugin-svelte'\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [svelte()],\n})"},"/package.json":{code:JSON.stringify({type:"module",scripts:{dev:"vite"},devDependencies:{"@sveltejs/vite-plugin-svelte":"^2.0.2",svelte:"^3.55.1",vite:"4.0.4","esbuild-wasm":"^0.17.12"}})}},main:"/src/App.svelte",environment:"node"},eH={files:{"/src/styles.css":eM["/styles.css"],"/src/App.svelte":{code:'<script lang="ts">\nconst data: string = "world";\n</script>\n\n<h1>Hello {data}</h1>\n\n<style>\nh1 {\n font-size: 1.5rem;\n}\n</style>'},"/src/main.ts":{code:"import App from './App.svelte'\nimport \"./styles.css\"\n\nconst app = new App({\n target: document.getElementById('app'),\n})\n\nexport default app"},"/index.html":{code:'<!DOCTYPE html>\n<html lang="en">\n <head>\n <meta charset="UTF-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n <title>Vite App</title>\n </head>\n <body>\n <div id="app"></div>\n <script type="module" src="/src/main.ts"></script>\n </body>\n</html>\n'},"/vite-env.d.ts":{code:'/// <reference types="svelte" />\n/// <reference types="vite/client" />'},"svelte.config.js":{code:"import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'\n\nexport default {\n // Consult https://svelte.dev/docs#compile-time-svelte-preprocess\n // for more information about preprocessors\n preprocess: vitePreprocess(),\n}\n"},"/vite.config.ts":{code:"import { defineConfig } from 'vite'\nimport { svelte } from '@sveltejs/vite-plugin-svelte'\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [svelte()],\n})"},"tsconfig.json":{code:JSON.stringify({extends:"@tsconfig/svelte/tsconfig.json",compilerOptions:{target:"ESNext",useDefineForClassFields:!0,module:"ESNext",resolveJsonModule:!0,allowJs:!0,checkJs:!0,isolatedModules:!0},include:["src/**/*.d.ts","src/**/*.ts","src/**/*.js","src/**/*.svelte"],references:[{path:"./tsconfig.node.json"}]},null,2)},"tsconfig.node.json":{code:JSON.stringify({compilerOptions:{composite:!0,module:"ESNext",moduleResolution:"Node"},include:["vite.config.ts"]},null,2)},"/package.json":{code:JSON.stringify({type:"module",scripts:{dev:"vite"},devDependencies:{"@sveltejs/vite-plugin-svelte":"^2.0.2","@tsconfig/svelte":"^3.0.0",svelte:"^3.55.1","svelte-check":"^2.10.3",tslib:"^2.5.0",vite:"4.1.4","esbuild-wasm":"^0.17.12"}},null,2)}},main:"/src/App.svelte",environment:"node"},eP={files:{"/src/styles.css":eM["/styles.css"],"/src/App.vue":{code:'<script setup>\nimport { ref } from "vue";\n\nconst data = ref("world");\n</script>\n\n<template>\n <h1>Hello {{ data }}</h1>\n</template>\n\n<style>\nh1 {\n font-size: 1.5rem;\n}\n</style>'},"/src/main.js":{code:"import { createApp } from 'vue'\nimport App from './App.vue'\nimport \"./styles.css\"\n \ncreateApp(App).mount('#app') \n"},"/index.html":{code:'<!DOCTYPE html>\n<html lang="en">\n <head>\n <meta charset="UTF-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n <title>Vite App</title>\n </head>\n <body>\n <div id="app"></div>\n <script type="module" src="/src/main.js"></script>\n </body>\n</html>\n'},"/vite.config.js":{code:"import { defineConfig } from 'vite'\nimport vue from '@vitejs/plugin-vue'\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [vue()]\n})\n"},"/package.json":{code:JSON.stringify({scripts:{dev:"vite",build:"vite build",preview:"vite preview"},dependencies:{vue:"^3.2.45"},devDependencies:{"@vitejs/plugin-vue":"3.2.0",vite:"4.1.4","esbuild-wasm":"0.17.12"}})}},main:"/src/App.vue",environment:"node"},eB={files:{"/src/styles.css":eM["/styles.css"],"/src/App.vue":{code:'<script setup lang="ts">\nimport { ref } from "vue";\n\nconst data = ref<string>("world");\n</script>\n\n<template>\n <h1>Hello {{ data }}</h1>\n</template>\n\n<style>\nh1 {\n font-size: 1.5rem;\n}\n</style>'},"/src/main.ts":{code:"import { createApp } from 'vue'\nimport App from './App.vue'\nimport \"./styles.css\"\n\ncreateApp(App).mount('#app')\n"},"/index.html":{code:'<!DOCTYPE html>\n<html lang="en">\n <head>\n <meta charset="UTF-8" />\n <meta name="viewport" content="width=device-width, initial-scale=1.0" />\n <title>Vite App</title>\n </head>\n <body>\n <div id="app"></div>\n <script type="module" src="/src/main.ts"></script>\n </body>\n</html>\n'},"/vite-env.d.ts":{code:'/// <reference types="vite/client" />'},"/vite.config.ts":{code:"import { defineConfig } from 'vite'\nimport vue from '@vitejs/plugin-vue'\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n plugins: [vue()]\n})\n"},"tsconfig.json":{code:JSON.stringify({compilerOptions:{target:"ESNext",useDefineForClassFields:!0,module:"ESNext",moduleResolution:"Node",strict:!0,jsx:"preserve",resolveJsonModule:!0,isolatedModules:!0,esModuleInterop:!0,lib:["ESNext","DOM"],skipLibCheck:!0,noEmit:!0},include:["src/**/*.ts","src/**/*.d.ts","src/**/*.tsx","src/**/*.vue"],references:[{path:"./tsconfig.node.json"}]},null,2)},"tsconfig.node.json":{code:JSON.stringify({compilerOptions:{composite:!0,module:"ESNext",moduleResolution:"Node",allowSyntheticDefaultImports:!0},include:["vite.config.ts"]},null,2)},"/package.json":{code:JSON.stringify({scripts:{dev:"vite",build:"tsc && vite build",preview:"vite preview"},dependencies:{vue:"^3.2.47"},devDependencies:{"@vitejs/plugin-vue":"^4.0.0",vite:"4.1.4","vue-tsc":"^1.2.0",typescript:"^4.9.5","esbuild-wasm":"^0.17.12"}},null,2)}},main:"/src/App.vue",environment:"node"},eJ={files:{"/src/app/app.component.css":eM["/styles.css"],"/src/app/app.component.html":{code:"<div>\n<h1>{{ helloWorld }}</h1>\n</div> \n"},"/src/app/app.component.ts":{code:'import { Component } from "@angular/core";\n\n@Component({\n selector: "app-root",\n templateUrl: "./app.component.html",\n styleUrls: ["./app.component.css"]\n})\nexport class AppComponent {\n helloWorld = "Hello world";\n} \n'},"/src/app/app.module.ts":{code:'import { BrowserModule } from "@angular/platform-browser";\nimport { NgModule } from "@angular/core";\n \nimport { AppComponent } from "./app.component";\n \n@NgModule({\n declarations: [AppComponent],\n imports: [BrowserModule],\n providers: [],\n bootstrap: [AppComponent]\n})\nexport class AppModule {} \n'},"/src/index.html":{code:'<!doctype html>\n<html lang="en">\n \n<head>\n <meta charset="utf-8">\n <title>Angular</title>\n <base href="/">
1\n \n <meta name="viewport" content="width=device-width, initial-scale=1">\n <link rel="icon" type="image/x-icon" href="favicon.ico">\n</head>\n \n<body>\n <app-root></app-root>\n</body>\n \n</html>\n'},"/src/main.ts":{code:'import { enableProdMode } from "@angular/core";\nimport { platformBrowserDynamic } from "@angular/platform-browser-dynamic";\n \nimport { AppModule } from "./app/app.module"; \n\nplatformBrowserDynamic()\n .bootstrapModule(AppModule)\n .catch(err => console.log(err));\n \n'},"/src/polyfills.ts":{code:'import "core-js/proposals/reflect-metadata"; \n import "zone.js/dist/zone";\n'},"/package.json":{code:JSON.stringify({dependencies:{"@angular/core":"^11.2.0","@angular/platform-browser":"^11.2.0","@angular/platform-browser-dynamic":"^11.2.0","@angular/common":"^11.2.0","@angular/compiler":"^11.2.0","zone.js":"0.11.3","core-js":"3.8.3",rxjs:"6.6.3"},main:"/src/main.ts"})}},main:"/src/app/app.component.ts",environment:"angular-cli"},ez={files:P(P({},eM),{"/App.js":{code:"export default function App() {\n return <h1>Hello world</h1>\n}\n"},"/index.js":{code:'import React, { StrictMode } from "react";\nimport { createRoot } from "react-dom/client";\nimport "./styles.css";\n\nimport App from "./App";\n\nconst root = createRoot(document.getElementById("root"));\nroot.render(\n <StrictMode>\n <App />\n </StrictMode>\n);'},"/public/index.html":{code:'<!DOCTYPE html>\n<html lang="en">\n <head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <title>Document</title>\n </head>\n <body>\n <div id="root"></div>\n </body>\n</html>'},"/package.json":{code:JSON.stringify({dependencies:{react:"^18.0.0","react-dom":"^18.0.0","react-scripts":"^5.0.0"},main:"/index.js"})}}),main:"/App.js",environment:"create-react-app"},eU={files:P(P({},eM),{"tsconfig.json":{code:'{\n "include": [\n "./**/*"\n ],\n "compilerOptions": {\n "strict": true,\n "esModuleInterop": true,\n "lib": [ "dom", "es2015" ],\n "jsx": "react-jsx"\n }\n}'},"/App.tsx":{code:"export default function App(): JSX.Element {\n return <h1>Hello world</h1>\n}\n"},"/index.tsx":{code:'import React, { StrictMode } from "react";\nimport { createRoot } from "react-dom/client";\nimport "./styles.css";\n\nimport App from "./App";\n\nconst root = createRoot(document.getElementById("root"));\nroot.render(\n <StrictMode>\n <App />\n </StrictMode>\n);'},"/public/index.html":{code:'<!DOCTYPE html>\n<html lang="en">\n <head>\n <meta charset="UTF-8">\n <meta name="viewport" content="width=device-width, initial-scale=1.0">\n <title>Document</title>\n </head>\n <body>\n <div id="root"></div>\n </body>\n</html>'},"/package.json":{code:JSON.stringify({dependencies:{react:"^18.0.0","react-dom":"^18.0.0","react-scripts":"^4.0.0"},devDependencies:{"@types/react":"^18.0.0","@types/react-dom":"^18.0.0",typescript:"^4.0.0"},main:"/index.tsx"})}}),main:"/App.tsx",environment:"create-react-app"},eZ={files:P(P({},eM),{"/App.tsx":{code:'import { Component } from "solid-js";\n\nconst App: Component = () => {\n return <h1>Hello world</h1>\n};\n\nexport default App;'},"/index.tsx":{code:'import { render } from "solid-js/web";\nimport App from "./App";\n\nimport "./styles.css";\n\nrender(() => <App />, document.getElementById("app"));'},"/index.html":{code:'<html>\n<head>\n <title>Parcel Sandbox</title>\n <meta charset="UTF-8" />\n</head>\n<body>\n <div id="app"></div>\n <script src="src/index.tsx"></script>\n</body>\n</html>'},"/package.json":{code:JSON.stringify({dependencies:{"solid-js":"1.3.15"},main:"/index.tsx"})}}),main:"/App.tsx",environment:"solid"},eW={files:P(P({},eM),{"/App.svelte":{code:"<style>\n h1 {\n font-size: 1.5rem;\n }\n</style>\n\n<script>\n let name = 'world';\n</script>\n\n<main>\n <h1>Hello {name}</h1>\n</main>"},"/index.js":{code:'import App from "./App.svelte";\nimport "./styles.css";\n\nconst app = new App({\n target: document.body\n});\n\nexport default app;\n '},"/public/index.html":{code:'<!DOCTYPE html>\n<html>\n <head>\n <meta charset="utf8" />\n <meta name="viewport" content="width=device-width" />\n\n <title>Svelte app</title>\n\n <link rel="stylesheet" href="public/bundle.css" />\n </head>\n\n <body>\n <script src="bundle.js"></script>\n </body>\n</html>'},"/package.json":{code:JSON.stringify({dependencies:{svelte:"^3.0.0"},main:"/index.js"})}}),main:"/App.svelte",environment:"svelte"},eV={files:{"tsconfig.json":{code:'{\n "include": [\n "./**/*"\n ],\n "compilerOptions": {\n "strict": true,\n "esModuleInterop": true,\n "lib": [ "dom", "es2015" ],\n "jsx": "react-jsx"\n }\n}'},"/add.ts":{code:"export const add = (a: number, b: number): number => a + b;"},"/add.test.ts":{code:"import { add } from './add';\n\ndescribe('add', () => {\n test('Commutative Law of Addition', () => {\n expect(add(1, 2)).toBe(add(2, 1));\n });\n});"},"package.json":{code:JSON.stringify({dependencies:{},devDependencies:{typescript:"^4.0.0"},main:"/add.ts"})}},main:"/add.test.ts",environment:"parcel",mode:"tests"},e_={files:P(P({},eM),{"/index.js":{code:'import "./styles.css";\n\ndocument.getElementById("app").innerHTML = `\n<h1>
1Hello world</h1>\n`;\n'},"/index.html":{code:'<!DOCTYPE html>\n<html>\n\n<head>\n <title>Parcel Sandbox</title>\n <meta charset="UTF-8" />\n</head>\n\n<body>\n <div id="app"></div>\n\n <script src="index.js">\n </script>\n</body>\n\n</html>'},"/package.json":{code:JSON.stringify({dependencies:{},main:"/index.js"})}}),main:"/index.js",environment:"parcel"},eY={files:P(P({},eM),{"tsconfig.json":{code:'{\n "compilerOptions": {\n "strict": true,\n "module": "commonjs",\n "jsx": "preserve",\n "esModuleInterop": true,\n "sourceMap": true,\n "allowJs": true,\n "lib": [\n "es6",\n "dom"\n ],\n "rootDir": "src",\n "moduleResolution": "node"\n }\n}'},"/index.ts":{code:'import "./styles.css";\n\ndocument.getElementById("app").innerHTML = `\n<h1>Hello world</h1>\n`;\n'},"/index.html":{code:'<!DOCTYPE html>\n<html>\n\n<head>\n <title>Parcel Sandbox</title>\n <meta charset="UTF-8" />\n</head>\n\n<body>\n <div id="app"></div>\n\n <script src="index.ts">\n </script>\n</body>\n\n</html>'},"/package.json":{code:JSON.stringify({dependencies:{},devDependencies:{typescript:"^4.0.0"},main:"/index.ts"})}}),main:"/index.ts",environment:"parcel"},eG={files:{"/src/styles.css":eM["/styles.css"],"/src/App.vue":{code:"<template>\n <h1>Hello {{ msg }}</h1>\n</template>\n\n<script setup>\nimport { ref } from 'vue';\nconst msg = ref('world');\n</script>"},"/src/main.js":{code:"import { createApp } from 'vue'\nimport App from './App.vue'\nimport \"./styles.css\";\n\ncreateApp(App).mount('#app')\n"},"/public/index.html":{code:'<!DOCTYPE html>\n<html lang="en">\n <head>\n <meta charset="utf-8" />\n <meta http-equiv="X-UA-Compatible" content="IE=edge" />\n <meta name="viewport" content="width=device-width,initial-scale=1.0" />\n <title>codesandbox</title>\n </head>\n <body>\n <noscript>\n <strong\n >We\'re sorry but codesandbox doesn\'t work properly without JavaScript\n enabled. Please enable it to continue.</strong\n >\n </noscript>\n <div id="app"></div>\n <!-- built files will be auto injected -->\n </body>\n</html>\n'},"/package.json":{code:JSON.stringify({name:"vue3",version:"0.1.0",private:!0,main:"/src/main.js",scripts:{serve:"vue-cli-service serve",build:"vue-cli-service build"},dependencies:{"core-js":"^3.26.1",vue:"^3.2.45"},devDependencies:{"@vue/cli-plugin-babel":"^5.0.8","@vue/cli-service":"^5.0.8"}})}},main:"/src/App.vue",environment:"vue-cli"},eq={files:{"/src/styles.css":eM["/styles.css"],"/src/App.vue":{code:"<template>\n <h1>Hello {{ msg }}</h1>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref } from 'vue';\nconst msg = ref<string>('world');\n</script>"},"/src/main.ts":{code:"import { createApp } from 'vue'\nimport App from './App.vue'\nimport \"./styles.css\";\n\ncreateApp(App).mount('#app')\n"},"/src/shims-vue.d.ts":'/* eslint-disable */\ndeclare module "*.vue" {\n import type { DefineComponent } from "vue";\n const component: DefineComponent<{}, {}, any>;\n export default component;\n}',"/public/index.html":{code:'<!DOCTYPE html>\n<html lang="en">\n <head>\n <meta charset="utf-8" />\n <meta http-equiv="X-UA-Compatible" content="IE=edge" />\n <meta name="viewport" content="width=device-width,initial-scale=1.0" />\n <title>codesandbox</title>\n </head>\n <body>\n <noscript>\n <strong\n >We\'re sorry but codesandbox doesn\'t work properly without JavaScript\n enabled. Please enable it to continue.</strong\n >\n </noscript>\n <div id="app"></div>\n <!-- built files will be auto injected -->\n </body>\n</html>\n'},"/package.json":{code:JSON.stringify({name:"vue3-ts",version:"0.1.0",private:!0,main:"/src/main.ts",scripts:{serve:"vue-cli-service serve",build:"vue-cli-service build"},dependencies:{"core-js":"^3.26.1",vue:"^3.2.45"},devDependencies:{"@vue/cli-plugin-babel":"^5.0.8","@vue/cli-plugin-typescript":"^5.0.8","@vue/cli-service":"^5.0.8",typescript:"^4.9.3"}})},"/tsconfig.json":{code:JSON.stringify({compilerOptions:{target:"esnext",module:"esnext",strict:!0,jsx:"preserve",moduleResolution:"node",experimentalDecorators:!0,skipLibCheck:!0,esModuleInterop:!0,allowSyntheticDefaultImports:!0,forceConsistentCasingInFileNames:!0,useDefineForClassFields:!0,sourceMap:!1,baseUrl:".",types:["webpack-env"],paths:{"@/*":["src/*"]},lib:["esnext","dom","dom.iterable","scripthost"]},include:["src/**/*.ts","src/**/*.tsx","src/**/*.vue","tests/**/*.ts","tests/**/*.tsx"],exclude:["node_modules"]})}},main:"/src/App.vue",environment:"vue-cli"},eX={static:{files:P(P({},eM),{"/index.html":{code:'<!DOCTYPE html>\n<html>\n\n<head>\n <title>Parcel Sandbox</title>\n <meta charset="UTF-8" />\n <link rel="stylesheet" href="/styles.css" />\n</head>\n\n<body>\n <h1>
1Hello world</h1>\n</body>\n\n</html>'},"/package.json":{code:JSON.stringify({dependencies:{},main:"/index.html"})}}),main:"/index.html",environment:"static"},angular:eJ,react:ez,"react-ts":eU,solid:eZ,svelte:eW,"test-ts":eV,"vanilla-ts":eY,vanilla:e_,vue:eG,"vue-ts":eq,node:eA,nextjs:eL,vite:eR,"vite-react":eI,"vite-react-ts":eD,"vite-vue":eP,"vite-vue-ts":eB,"vite-svelte":eT,"vite-svelte-ts":eH,astro:eF},eQ=function(e){var n,t,r,o,i,s,a=(0,C.f)(e.files),l=e0({template:e.template,customSetup:e.customSetup,files:a}),c=(0,C.f)(null!==(t=null===(n=e.options)||void 0===n?void 0:n.visibleFiles)&&void 0!==t?t:[]),d=(null===(r=e.options)||void 0===r?void 0:r.activeFile)?eK(null===(o=e.options)||void 0===o?void 0:o.activeFile,l.files):void 0;0===c.length&&a&&Object.keys(a).forEach(function(e){var n=a[e];if("string"==typeof n){c.push(e);return}!d&&n.active&&(d=e,!0===n.hidden&&c.push(e)),n.hidden||c.push(e)}),0===c.length&&(c=[l.main]),l.entry&&!l.files[l.entry]&&(l.entry=eK(l.entry,l.files)),!d&&l.main&&(d=l.main),d&&l.files[d]||(d=c[0]),c.includes(d)||c.push(d);var u=(0,C.d)(l.files,null!==(i=l.dependencies)&&void 0!==i?i:{},null!==(s=l.devDependencies)&&void 0!==s?s:{},l.entry);return{visibleFiles:c.filter(function(e){return u[e]}),activeFile:d,files:u,environment:l.environment,shouldUpdatePreview:!0}},eK=function(e,n){var t=(0,C.f)(n),r=(0,C.f)(e);if(r in t)return r;if(!e)return null;for(var o=null,i=0,s=[".js",".jsx",".ts",".tsx"];!o&&i<s.length;){var a=""+r.split(".")[0]+s[i];void 0!==t[a]&&(o=a),i++}return o},e0=function(e){var n=e.files,t=e.template,r=e.customSetup;if(!t){if(!r){var o=eX.vanilla;return P(P({},o),{files:P(P({},o.files),e1(n))})}if(!n||0===Object.keys(n).length)throw Error("[sandpack-react]: without a template, you must pass at least one file");return P(P({},r),{files:e1(n)})}var i=eX[t];if(!i)throw Error('[sandpack-react]: invalid template "'+t+'" provided');return r||n?{files:e1(P(P({},i.files),n)),dependencies:P(P({},i.dependencies),null==r?void 0:r.dependencies),devDependencies:P(P({},i.devDependencies),null==r?void 0:r.devDependencies),entry:(0,C.f)(null==r?void 0:r.entry),main:i.main,environment:(null==r?void 0:r.environment)||i.environment}:i},e1=function(e){return e?Object.keys(e).reduce(function(n,t){return"string"==typeof e[t]?n[t]={code:e[t]}:n[t]=e[t],n},{}):{}},e3=function(e,n){var t=(0,w.useState)({editorState:"pristine",teamId:e.teamId}),r=t[0],o=t[1],i=eQ(e),s=(0,j.J)(i.files,n)?"pristine":"dirty";return s!==r.editorState&&o(function(e){return P(P({},e),{editorState:s})}),r},e2=function(e,n){var t,r,o,i=e.options,s=e.customSetup,a=e.teamId;null!=i||(i={}),null!=s||(s={});var l=(null==i?void 0:i.initMode)||"lazy",c=(0,w.useState)({startRoute:null==i?void 0:i.startRoute,bundlerState:void 0,error:null,initMode:l,reactDevTools:void 0,status:null===(t=null==i?void 0:i.autorun)||void 0===t||t?"initial":"idle"}),d=c[0],u=c[1],p=(0,w.useRef)(null),f=(0,w.useRef)(null),v=(0,w.useRef)({}),m=(0,w.useRef)({}),h=(0,w.useRef)(null),g=(0,w.useRef)({}),b=(0,w.useRef)(),x=(0,w.useRef)({global:{}}),y=(0,w.useRef)(),$=(0,w.useRef)(n.environment),j=(0,w.useCallback)(function(e,t,r){return J(void 0,void 0,void 0,function(){var o,l,c,p,f;return z(this,function(v){switch(v.label){case 0:return m.current[t]&&m.current[t].destroy(),null!=i||(i={}),null!=s||(s={}),o=null!==(c=null==i?void 0:i.bundlerTimeOut)&&void 0!==c?c:4e4,h.current&&clearTimeout(h.current),"function"!=typeof b.current&&(h.current=setTimeout(function(){S(),u(function(e){return P(P({},e),{status:"timeout"})})},o)),[4,(0,k.sF)(e,{files:n.files,template:n.environment},{externalResources:i.externalResources,bundlerURL:i.bundlerURL,startRoute:null!==(p=null==r?void 0:r.startRoute)&&void 0!==p?p:i.startRoute,fileResolver:i.fileResolver,skipEval:null!==(f=i.skipEval)&&void 0!==f&&f,logLevel:i.logLevel,showOpenInCodeSandbox:!1,showErrorScreen:!0,showLoadingScreen:!1,reactDevTools:d.reactDevTools,customNpmRegistries:null==s?void 0:s.npmRegistries,teamId:a})];case 1:return l=v.sent(),"function"!=typeof b.current&&(b.current=l.listen(F)),g.current[t]=g.current[t]||{}
1,x.current[t]&&(Object.keys(x.current[t]).forEach(function(e){var n=x.current[t][e],r=l.listen(n);g.current[t][e]=r}),x.current[t]={}),Object.entries(x.current.global).forEach(function(e){var n=e[0],r=e[1],o=l.listen(r);g.current[t][n]=o}),m.current[t]=l,[2]}})})},[n.environment,n.files,d.reactDevTools]),S=(0,w.useCallback)(function(){Object.keys(m.current).map(M),"function"==typeof b.current&&(b.current(),b.current=void 0)},[]),N=(0,w.useCallback)(function(){return J(void 0,void 0,void 0,function(){return z(this,function(e){switch(e.label){case 0:return[4,Promise.all(Object.entries(v.current).map(function(e){var n=e[0],t=e[1],r=t.iframe,o=t.clientPropsOverride,i=void 0===o?{}:o;return J(void 0,void 0,void 0,function(){return z(this,function(e){switch(e.label){case 0:return[4,j(r,n,i)];case 1:return e.sent(),[2]}})})}))];case 1:return e.sent(),u(function(e){return P(P({},e),{error:null,status:"running"})}),[2]}})})},[j]),O=(0,w.useCallback)(function(){if(null===(e=null==i?void 0:i.autorun)||void 0===e||e){var e,n,t,r=null!==(n=null==i?void 0:i.initModeObserverOptions)&&void 0!==n?n:{rootMargin:"1000px 0px"};p.current&&f.current&&(null===(t=p.current)||void 0===t||t.unobserve(f.current)),f.current&&"lazy"===d.initMode?(p.current=new IntersectionObserver(function(e){var n;e.some(function(e){return e.isIntersecting})&&(N(),f.current&&(null===(n=p.current)||void 0===n||n.unobserve(f.current)))},r),p.current.observe(f.current)):f.current&&"user-visible"===d.initMode?(p.current=new IntersectionObserver(function(e){e.some(function(e){return e.isIntersecting})?N():(Object.keys(m.current).map(M),S())},r),p.current.observe(f.current)):N()}},[null==i?void 0:i.autorun,null==i?void 0:i.initModeObserverOptions,N,d.initMode,S]),E=(0,w.useCallback)(function(e,n,t){return J(void 0,void 0,void 0,function(){return z(this,function(r){switch(r.label){case 0:if(v.current[n]={iframe:e,clientPropsOverride:t},"running"!==d.status)return[3,2];return[4,j(e,n,t)];case 1:r.sent(),r.label=2;case 2:return[2]}})})},[j,d.status]),M=function(e){var n,t,r=m.current[e];r&&(r.destroy(),null===(n=r.iframe.contentWindow)||void 0===n||n.location.replace("about:blank"),r.iframe.removeAttribute("src"),delete m.current[e]),delete v.current[e],h.current&&clearTimeout(h.current),Object.values(null!==(t=g.current[e])&&void 0!==t?t:{}).forEach(function(e){Object.values(e).forEach(function(e){return e()})});var o=Object.keys(m.current).length>0?"running":"idle";u(function(e){return P(P({},e),{status:o})})},F=function(e){"start"===e.type?u(function(e){return P(P({},e),{error:null})}):"state"===e.type?u(function(n){return P(P({},n),{bundlerState:e.state})}):("done"!==e.type||e.compilatonError)&&"connected"!==e.type?"action"===e.type&&"show-error"===e.action?u(function(n){return P(P({},n),{error:(0,C.e)(e)})}):"action"===e.type&&"notification"===e.action&&"error"===e.notificationType&&u(function(n){return P(P({},n),{error:{message:e.title}})}):(h.current&&clearTimeout(h.current),u(function(e){return P(P({},e),{error:null})}))},L=null!==(r=null==i?void 0:i.recompileMode)&&void 0!==r?r:"delayed",A=null!==(o=null==i?void 0:i.recompileDelay)&&void 0!==o?o:500;return(0,w.useEffect)(function(){if("running"===d.status&&n.shouldUpdatePreview){if($.current!==n.environment&&($.current=n.environment,Object.entries(m.current).forEach(function(e){var n=e[0];E(e[1].iframe,n)})),"immediate"===L&&Object.values(m.current).forEach(function(e){"done"===e.status&&e.updateSandbox({files:n.files,template:n.environment})}),"delayed"===L){if("undefined"==typeof window)return;window.clearTimeout(y.current),y.current=window.setTimeout(function(){Object.values(m.current).forEach(function(e){"done"===e.status&&e.updateSandbox({files:n.files,template:n.environment})})},A)}return function(){window.clearTimeout(y.current)}}},[n.files,n.environment,n.shouldUpdatePreview,A,L,E,d.status]),(0,w.useEffect)(function(){l!==d.initMode&&(u(function(e){return P(P({},e),{initMode:l})}),O())},[l,O,d.initMode]),(0,w.useEffect)(function(){return function(){"function"==typeof b.current&&b.current(),h.current&&clearTimeout(h.current),y.current&&clearTimeout(y.current),p.current&&p.current.disconnect()}},[]),[d,{clients:m.current,initializeSandpackIframe:O,runSandpack:N,registerBundler:E,unregisterBundler:M,registerReactDevTools:function(e){u(function(n){return P(P({},n),{reactDevTools:e})})},addListener:function(e,n){if(n){if(m.current[n]){var t=m.current[n].listen(e);return t}var r=ep();x.current[n]=x.current[n]||{},g.current[n]=g.current[n]||{},x.current[n][r]=e;var t=function(){x.current[n][r]?delete x.current[n][r]:g.current[n][r]&&(g.current[n][r](),delete g.current[n][r])};return t}var o=ep();x.current.global[o]=e;var i=Object.values(m.current).map(function(n){return n.listen(e)}
1),t=function(){i.forEach(function(e){return e()}),delete x.current.global[o],Object.values(g.current).forEach(function(e){var n;null===(n=null==e?void 0:e[o])||void 0===n||n.call(e)})};return t},dispatchMessage:function(e,n){if("running"!==d.status){console.warn("[sandpack-react]: dispatch cannot be called while in idle mode");return}n?m.current[n].dispatch(e):Object.values(m.current).forEach(function(n){n.dispatch(e)})},lazyAnchorRef:f,unsubscribeClientListenersRef:g,queuedListenersRef:x}]},e6=function(e){var n=eQ(e),t=(0,w.useState)(n),r=t[0],o=t[1],i=(0,w.useRef)(!1);(0,w.useEffect)(function(){i.current?o(eQ(e)):i.current=!0},[e.files,e.customSetup,e.template]);var s=function(e,n,t){void 0===t&&(t=!0),o(function(r){var o,i=r.files;return"string"==typeof e&&"string"==typeof n?i=P(P({},i),((o={})[e]={code:n},o)):"object"==typeof e&&(i=P(P({},i),e1(e))),P(P({},r),{files:(0,C.f)(i),shouldUpdatePreview:t})})};return[P(P({},r),{visibleFilesFromProps:n.visibleFiles}),{openFile:function(e){o(function(n){var t=n.visibleFiles,r=B(n,["visibleFiles"]),o=t.includes(e)?t:U(U([],t,!0),[e],!1);return P(P({},r),{activeFile:e,visibleFiles:o})})},resetFile:function(e){o(function(t){var r;return P(P({},t),{files:P(P({},t.files),((r={})[e]=n.files[e],r))})})},resetAllFiles:function(){o(function(e){return P(P({},e),{files:n.files})})},setActiveFile:function(e){r.files[e]&&o(function(n){return P(P({},n),{activeFile:e})})},updateCurrentFile:function(e,n){void 0===n&&(n=!0),s(r.activeFile,e,n)},updateFile:s,addFile:s,closeFile:function(e){1!==r.visibleFiles.length&&o(function(n){var t=n.visibleFiles,r=n.activeFile,o=B(n,["visibleFiles","activeFile"]),i=t.indexOf(e),s=t.filter(function(n){return n!==e});return P(P({},o),{activeFile:e===r?0===i?t[1]:t[i-1]:r,visibleFiles:s})})},deleteFile:function(e,n){void 0===n&&(n=!0),o(function(t){var r=t.visibleFiles,o=t.files,i=t.activeFile,s=B(t,["visibleFiles","files","activeFile"]),a=P({},o);delete a[e];var l=r.filter(function(n){return n!==e});if(0===l.length){var c=Object.keys(o)[Object.keys(o).length-1];return P(P({},s),{visibleFiles:[c],activeFile:c,files:a,shouldUpdatePreview:n})}return P(P({},s),{visibleFiles:l,activeFile:e===i?l[l.length-1]:i,files:a,shouldUpdatePreview:n})})}}]},e5=w.createContext(null),e4=function(e){var n,t,r=e.children,o=e.options,i=e.style,s=e.className,a=e.theme,l=e6(e),c=l[0],d=l[1],u=e2(e,c),p=u[0],f=u[1],v=f.dispatchMessage,m=f.addListener,h=B(f,["dispatchMessage","addListener"]),g=e3(e,c.files);return w.useEffect(function(){h.initializeSandpackIframe()},[]),(0,y.jsx)(e5.Provider,P({value:P(P(P(P(P(P({},c),p),g),d),h),{autoReload:null===(t=null===(n=e.options)||void 0===n?void 0:n.autoReload)||void 0===t||t,listen:m,dispatch:v})},{children:(0,y.jsx)(eC,P({classes:null==o?void 0:o.classes},{children:(0,y.jsx)(eE,P({className:s,style:i,theme:a},{children:r}),void 0)}),void 0)}),void 0)};function e8(){var e=w.useContext(e5);if(null===e)throw Error('[sandpack-react]: "useSandpack" must be wrapped by a "SandpackProvider"');var n=e.dispatch,t=e.listen;return{sandpack:P({},B(e,["dispatch","listen"])),dispatch:n,listen:t}}e5.Consumer;var e7=function(){var e,n,t,r=e8().sandpack;return{code:null===(e=r.files[r.activeFile])||void 0===e?void 0:e.code,readOnly:null!==(t=null===(n=r.files[r.activeFile])||void 0===n?void 0:n.readOnly)&&void 0!==t&&t,updateCode:r.updateCurrentFile}},e9=eh({svg:{margin:"auto"}}),ne=eh(((s={appearance:"none",outline:"none",display:"flex",alignItems:"center",fontSize:"inherit",fontFamily:"inherit",backgroundColor:"transparent",transition:"color $default, background $default",cursor:"pointer",color:"$colors$clickable",border:0,textDecoration:"none","&:disabled":{color:"$colors$disabled"},"&:hover:not(:disabled,[data-active='true'])":{color:"$colors$hover"},'&[data-active="true"]':{color:"$colors$accent"},svg:{minWidth:"$space$4",width:"$space$4",height:"$space$4"}})["&."+e9]={padding:"$space$1",height:"$space$7",display:"flex"},s["&."+e9+"&:not(:has(span))"]={width:"$space$7"},s["&."+e9+"&:has(svg + span)"]={paddingRight:"$space$3",paddingLeft:"$space$2",gap:"$space$1"},s)),nn=eh({backgroundColor:"$colors$surface2",borderRadius:"99999px",border:"1px solid $colors$surface3",'&[data-active="true"]':{color:"$colors$surface1",background:"$colors$accent"},"&:hover:not(:disabled,[data-active='true'])":{backgroundColor:"$colors$surface3"}}),nt=eh({padding:0}),nr=eg({"0%":{opacity:0}
1,"100%":{opacity:1}}),no=eh({position:"absolute",bottom:"0",left:"0",right:"0",top:"0",margin:"0",overflow:"auto",height:"100%",zIndex:"$top"}),ni=eh(((a={whiteSpace:"pre-wrap",padding:"$space$10",backgroundColor:"$colors$surface1",display:"flex",gap:"$space$2",flexDirection:"column"})["."+ne]={width:"auto",gap:"$space$2",padding:"0 $space$3 0 $space$2",marginTop:"$space$1"},a.variants={solidBg:{true:{backgroundColor:"$colors$errorSurface"}}},a)),ns=eh(((l={padding:"$space$10",backgroundColor:"$colors$surface1"})["."+ne]={marginTop:"$space$6",width:"auto",gap:"$space$2",padding:"0 $space$3 0 $space$2"},l)),na=eh({animation:nr+" 150ms ease",color:"$colors$error",display:"flex",flexDirection:"column",gap:"$space$3",variants:{errorCode:{true:{fontFamily:"$font$mono"}}},a:{color:"inherit"},p:{margin:0}}),nl=eh({borderBottom:"1px solid $colors$surface2",background:"$colors$surface1"}),nc=eh({padding:"0 $space$2",overflow:"auto",display:"flex",flexWrap:"nowrap",alignItems:"stretch",minHeight:"40px",marginBottom:"-1px"}),nd=eh({padding:"0 $space$1 0 $space$1",borderRadius:"$border$radius",marginLeft:"$space$1",width:"$space$5",visibility:"hidden",svg:{width:"$space$3",height:"$space$3",display:"block",position:"relative",top:1}}),nu=eh(((c={padding:"0 $space$2",height:"$layout$headerHeight",whiteSpace:"nowrap","&:focus":{outline:"none"}})["&:hover > ."+nd]={visibility:"unset"},c)),np=function(e){var n=e.closableTabs,t=e.className,r=B(e,["closableTabs","className"]),o=e8().sandpack,i=ek(),s=o.activeFile,a=o.visibleFiles,l=o.setActiveFile,c=function(e){e.stopPropagation();var n=e.target.closest("[data-active]"),t=null==n?void 0:n.getAttribute("title");t&&o.closeFile(t)},d=function(e){var n=el(e),t=a.reduce(function(t,r){return r===e||el(r)===n&&t.push(r),t},[]);return 0===t.length?n:ec(e,t)};return(0,y.jsx)("div",P({className:i("tabs",[nl,t]),translate:"no"},r,{children:(0,y.jsx)("div",P({"aria-label":"Select active file",className:i("tabs-scrollable-container",[nc]),role:"tablist"},{children:a.map(function(e){return(0,y.jsxs)("button",P({"aria-selected":e===s,className:i("tab-button",[ne,nu]),"data-active":e===s,onClick:function(){return l(e)},role:"tab",title:e,type:"button"},{children:[d(e),n&&a.length>1&&(0,y.jsx)("span",P({className:i("close-button",[nd]),onClick:c},{children:(0,y.jsx)(er,{},void 0)}),void 0)]}),e)})}),void 0)}),void 0)},nf=function(e){var n=e.onClick,t=e.className,r=e.children,o=ek();return(0,y.jsx)("button",P({className:o("button",[o("icon-standalone"),ne,e9,nn,t]),onClick:n,type:"button"},{children:r}),void 0)},nv=eh({position:"absolute",bottom:"$space$2",right:"$space$2",paddingRight:"$space$3"}),nm=function(e){e.className;var n=e.onClick,t=B(e,["className","onClick"]),r=e8().sandpack;return(0,y.jsxs)(nf,P({className:nv.toString(),onClick:function(e){r.runSandpack(),null==n||n(e)}},t,{children:[(0,y.jsx)(Y,{},void 0),(0,y.jsx)("span",{children:"Run"},void 0)]}),void 0)},nh=eh(((d={display:"flex",flexDirection:"column",width:"100%",position:"relative",backgroundColor:"$colors$surface1",gap:1})["&:has(.sp-stack)"]={backgroundColor:"$colors$surface2"},d)),ng=function(e){var n=e.className,t=B(e,["className"]),r=ek();return(0,y.jsx)("div",P({className:r("stack",[nh,n])},t),void 0)},nb=function(){var e=w.useContext(eO);return{theme:e.theme,themeId:e.id,themeMode:e.mode}},nx=function(e,n){if(e.length!==n.length)return!1;for(var t=!0,r=0;r<e.length;r++)if(e[r]!==n[r]){t=!1;break}return t},ny=function(e,n){var t=n.line,r=n.column;return e.line(t).from+(null!=r?r:0)-1},nw=function(e){return"sp-syntax-"+e},n$=function(e,n,t){if(!e&&!n)return"javascript";var r=n;if(!r&&e){var o=e.lastIndexOf(".");r=e.slice(o+1)}for(var i=0;i<t.length;i++){var s=t[i];if(r===s.name||s.extensions.includes(r||""))return s.name}switch(r){case"ts":case"tsx":return"typescript";case"html":case"svelte":case"vue":case"astro":return"html";case"css":case"less":case"scss":return"css";default:return"javascript"}},nj=function(e,n){for(var t=0;t<n.length;t++){var r=n[t];if(e===r.name)return r.language}return({javascript:(0,R.eJ)({jsx:!0,typescript:!1}),typescript:(0,R.eJ)({jsx:!0,typescript:!0}),html:(0,A.dy)(),css:(0,L.iv)()})[e]},nC=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return w.useCallback(function(n){return e.forEach(function(e){if(e){if("function"==typeof e)return e(n);e.current=n}})},e)},nk=M.p.line({attributes:{class:"cm-errorLine"}}),nS=M.lg.fromClass(function(){function e(){this.decorations=M.p.none}return e.prototype.update=function(e){var n=this;e.transactions.forEach(function(t){var r=t.annotation("show-error");
1if(void 0!==r){var o=ny(e.view.state.doc,{line:r})+1;n.decorations=M.p.set([nk.range(o)])}else t.annotation("remove-errors")&&(n.decorations=M.p.none)})},e}(),{decorations:function(e){return e.decorations}}),nN=eh({margin:"0",display:"block",fontFamily:"$font$mono",fontSize:"$font$size",color:"$syntax$color$plain",lineHeight:"$font$lineHeight"}),nO=eh(["string","plain","comment","keyword","definition","punctuation","property","tag","static"].reduce(function(e,n){var t;return P(P({},e),((t={})["."+nw(n)]={color:"$syntax$color$"+n,fontStyle:"$syntax$fontStyle$"+n},t))},{})),nE=eh(((u={flex:1,position:"relative",overflow:"auto",background:"$colors$surface1",".cm-scroller":{padding:"$space$4 0"}})["."+nN]={padding:"$space$4 0"},u["@media screen and (max-width: 768px)"]={"@supports (-webkit-overflow-scrolling: touch)":{".cm-content":{fontSize:"16px"}}},u)),nM=eh({margin:"0",outline:"none",height:"100%"}),nF=eh(((p={fontFamily:"$font$mono",fontSize:"0.8em",position:"absolute",right:"$space$2",bottom:"$space$2",zIndex:"$top",color:"$colors$clickable",backgroundColor:"$colors$surface2",borderRadius:"99999px",padding:"calc($space$1 / 2) $space$2"})["& + ."+ne]={right:"calc($space$11 * 2)"},p)),nL=function(e){var n=e.langSupport,t=e.highlightTheme,r=e.code,o=void 0===r?"":r,i=n.language.parser.parse(o),s=0,a=[],l=function(e,n){if(e>s){var t=o.slice(s,e);a.push(n?(0,w.createElement)("span",{children:t,className:n,key:""+e+s}):t),s=e}};return(0,I.bW)(i,t,function(e,n,t){l(e,""),l(n,t)}),s<o.length&&(null==o?void 0:o.includes("\n"))&&a.push("\n\n"),a},nA=w.forwardRef(function(e,n){var t=e.code,r=void 0===t?"":t,o=e.filePath,i=e.fileType,s=e.onCodeUpdate,a=e.showLineNumbers,l=void 0!==a&&a,c=e.showInlineErrors,d=void 0!==c&&c,u=e.wrapContent,p=void 0!==u&&u,f=e.editorState,v=void 0===f?"pristine":f,m=e.readOnly,h=void 0!==m&&m,g=e.showReadOnly,b=e.decorators,x=e.initMode,$=void 0===x?"lazy":x,j=e.extensions,C=void 0===j?[]:j,k=e.extensionsKeymap,L=void 0===k?[]:k,A=e.additionalLanguages,R=void 0===A?[]:A,D=w.useRef(null),T=nC(D,n),H=w.useRef(),B=nb(),J=B.theme,z=B.themeId,Z=w.useState(r),W=Z[0],V=Z[1],_=w.useState("immediate"===$),Y=_[0],G=_[1],q=ek(),X=e8().listen,Q=w.useRef([]),K=w.useRef([]),ee=(0,F.Z)(D,{rootMargin:"600px 0px",threshold:.2}).isIntersecting;w.useImperativeHandle(n,function(){return{getCodemirror:function(){return H.current}}}),w.useEffect(function(){("lazy"===$||"user-visible"===$)&&ee&&G(!0)},[$,ee]);var en=n$(o,i,R),et=nj(en,R),er=O.Qf.define([{tag:I.pJ.link,textDecoration:"underline"},{tag:I.pJ.emphasis,fontStyle:"italic"},{tag:I.pJ.strong,fontWeight:"bold"},{tag:I.pJ.keyword,class:nw("keyword")},{tag:[I.pJ.atom,I.pJ.number,I.pJ.bool],class:nw("static")},{tag:I.pJ.variableName,class:nw("plain")},{tag:I.pJ.standard(I.pJ.tagName),class:nw("tag")},{tag:[I.pJ.function(I.pJ.variableName),I.pJ.definition(I.pJ.function(I.pJ.variableName)),I.pJ.tagName],class:nw("definition")},{tag:I.pJ.propertyName,class:nw("property")},{tag:[I.pJ.literal,I.pJ.inserted],class:nw(J.syntax.string?"string":"static")},{tag:I.pJ.punctuation,class:nw("punctuation")},{tag:[I.pJ.comment,I.pJ.quote],class:nw("comment")}]),eo=nL({langSupport:et,highlightTheme:er,code:r}),ei=w.useMemo(function(){return b?b.sort(function(e,n){return e.line-n.line}):b},[b]);w.useEffect(function(){if(D.current&&Y){var e=[{key:"Tab",run:function(e){(0,N.at)(e);var n,t,r=L.find(function(e){return"Tab"===e.key});return null===(t=null===(n=null==r?void 0:r.run)||void 0===n?void 0:n.call(r,e))||void 0===t||t}},{key:"Shift-Tab",run:function(e){var n,t,r=e.state,o=e.dispatch;(0,N.xi)({state:r,dispatch:o});var i=L.find(function(e){return"Shift-Tab"===e.key});return null===(t=null===(n=null==i?void 0:i.run)||void 0===n?void 0:n.call(i,a))||void 0===t||t}},{key:"Escape",run:function(){return!!h||(D.current&&D.current.focus(),!0)}},{key:"mod-Backspace",run:N.fE}],n=U(U([(0,M.AE)(),(0,N.m8)(),(0,S.vQ)()],C,!0),[M.$f.of(U(U(U(U(U([],S.GA,!0),N.wQ,!0),N.f$,!0),e,!0),L,!0)),et,M.tk.theme({"&":{backgroundColor:"var(--sp-colors-surface1)",color:"var(--sp-syntax-color-plain)",height:"100%"},".cm-matchingBracket, .cm-nonmatchingBracket, &.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{color:"inherit",backgroundColor:"rgba(128,128,128,.25)",backgroundBlendMode:"difference"},"&.cm-editor.cm-focused":{outline:"none"},".cm-activeLine":{backgroundColor:"var(--sp-colors-surface3)",borderRadius:"var(--sp-border-radius)"},".cm-errorLine":{backgroundColor:"var(--sp-colors-errorSurface)",borderRadius:"var(--sp-border-radius)"},".cm-content":{caretColor:"var(--sp-colors-accent)",padding:"0 var(--sp-space-4)"},".cm-scroller":{fontFamily:"var(--sp-font-mono)",lineHeight:"var(--sp-font-lineHeight)"},".cm-gutters":{backgroundColor:"var(--sp-colors-surface1)",color:"var(--sp-colors-disabled)",border:"none",paddingLeft:"var(--sp-space-1)"},".cm-gutter.cm-lineNumbers":{fontSize:".6em"},".cm-lineNumbers .cm-gutterElement":{lineHeight:"var(--sp-font-lineHeight)",minWidth:"var(--sp-space-5)"},".cm-content .cm-line":{paddingLeft:"var(--sp-space-1)"},".cm-content.cm-readonly .cm-line":{paddingLeft:0}}),(0,O.nF)(er)],!1);h?(n.push(E.yy.readOnly.of(!0)),n.push(M.tk.editable.of(!1))):(n.push((0,O.n$)()),n.push((0,M.ZO)())),ei&&n.push(M.lg.fromClass(function(){function e(e){this.decorations=this.getDecoration(e)}return e.prototype.update=function(e){},e.prototype.getDecoration=function(e){if(!ei)return M.p.none;var n=ei.map(function(n){var t,r,o,i=M.p.line({attributes:{class:null!==(t=n.className)&&void 0!==t?t:""}}),s=M.p.mark({class:null!==(r=n.className)&&void 0!==r?r:"",attributes:null!==(o=n.elementAttributes)&&void 0!==o?o:void 0}),a=ny(e.state.doc,{line:n.line,column:n.startColumn})+1;if(n.startColumn&&n.endColumn){var l=ny(e.state.doc,{line:n.line,column:n.endColumn})+1;return s.range(a,l)}return i.range(a)});return M.p.set(n)},e}(),{decorations:function(e){return e.decorations}})),p&&n.push(M.tk.lineWrapping),l&&n.push((0,M.Eu)()),d&&n.push(nS);var t=D.current,i=t.querySelector(".sp-pre-placeholder");i&&t.removeChild(i);var a=new M.tk({doc:r,extensions:n,parent:t,dispatch:function(e){if(a.update([e]),e.docChanged){var n=e.newDoc.sliceString(0,e.newDoc.length);V(n),null==s||s(n)}}});return a.contentDOM.setAttribute("data-gramm","false"),a.contentDOM.setAttribute("data-lt-active","false"),a.contentDOM.setAttribute("aria-label",o?"Code Editor for "+el(o):"Code Editor"),h?a.contentDOM.classList.add("cm-readonly"):a.contentDOM.setAttribute("tabIndex","-1"),H.current=a,function(){var e;null===(e=H.current)||void 0===e||e.destroy()}}},[Y,l,p,z,ei,h]),w.useEffect(function(){var e=H.current,n=!nx(C,Q.current)||!nx(L,K.current);e&&n&&(e.dispatch({effects:E.Py.appendConfig.of(C)}),e.dispatch({effects:E.Py.appendConfig.of(M.$f.of(U([],L,!0)))}),Q.current=C,K.current=L)},[C,L]),w.useEffect(function(){H.current&&"dirty"===v&&window.matchMedia("(min-width: 768px)").matches&&H.current.contentDOM.focus()},[]),w.useEffect(function(){if(H.current&&"string"==typeof r&&r!==W){var e=H.current,n=e.state.selection.ranges.some(function(e){var n=e.to,t=e.from;return n>r.length||t>r.length})?E.jT.cursor(r.length):e.state.selection,t={from:0,to:e.state.doc.length,insert:r};e.dispatch({changes:t,selection:n})}},[r]),w.useEffect(function(){if(d){var e=X(function(e){var n=H.current;"success"===e.type?null==n||n.dispatch({annotations:[new E.q6("remove-errors",!0)]}):"action"===e.type&&"show-error"===e.action&&e.path===o&&e.line&&(null==n||n.dispatch({annotations:[new E.q6("show-error",e.line)]}))});return function(){return e()}}},[X,d]);var es=function(){var e=4;return l&&(e+=6),h||(e+=1),"var(--sp-space-"+e+")"};return h?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("pre",P({ref:T,className:q("cm",[q(v),q(en),nM,nO]),translate:"no"},{children:(0,y.jsx)("code",P({className:q("pre-placeholder",[nN]),style:{marginLeft:es()}},{children:eo}),void 0)}),void 0),h&&(void 0===g||g)&&(0,y.jsx)("span",P({className:q("read-only",[nF])},{},{children:"Read-only"}),void 0)]},void 0):(0,y.jsx)("div",P({ref:T,"aria-autocomplete":"list","aria-label":o?"Code Editor for "+el(o):"Code Editor","aria-multiline":"true",className:q("cm",[q(v),q(en),nM,nO]),onKeyDown:function(e){"Enter"===e.key&&H.current&&(e.preventDefault(),H.current.contentDOM.focus())},role:"textbox",tabIndex:0,translate:"no",suppressHydrationWarning:!0},{children:(0,y.jsx)("pre",P({className:q("pre-placeholder",[nN]),style:{marginLeft:es()}},{children:eo}),void 0)}),void 0)}),nR=(0,w.forwardRef)(function(e,n){var t=e.showTabs,r=e.showLineNumbers,o=e.showInlineErrors,i=e.showRunButton,s=e.wrapContent,a=e.closableTabs,l=e.initMode,c=e.extensions,d=e.extensionsKeymap,u=e.readOnly,p=e.showReadOnly,f=e.additionalLanguages,v=e.className,m=B(e,["showTabs","showLineNumbers","showInlineErrors","showRunButton","wrapContent","closableTabs","initMode","extensions","extensionsKeymap","readOnly","showReadOnly","additionalLanguages","className"]),h=e8().sandpack,g=e7(),b=g.code,x=g.updateCode,w=g.readOnly,$=h.activeFile,j=h.status,C=h.editorState,k=null!=t?t:h.visibleFiles.length>1,S=ek(),N=function(e,n){void 0===n&&(n=!0),x(e,n)};return(0,y.jsxs)(ng,P({className:S("editor",[v])},m,{children:[k&&(0,y.jsx)(np,{closableTabs:void 0!==a&&a},void 0),(0,y.jsxs)("div",P({className:S("code-editor",[nE])},{children:[(0,y.jsx)(nA,{ref:n,additionalLanguages:f,code:b,editorState:C,extensions:c,extensionsKeymap:d,filePath:$,initMode:l||h.initMode,onCodeUpdate:function(e){var n;return N(e,null===(n=h.autoReload)||void 0===n||n)},readOnly:u||w,showInlineErrors:void 0!==o&&o,showLineNumbers:void 0!==r&&r,showReadOnly:p,wrapContent:void 0!==s&&s}
1,$),(void 0===i||i)&&(!h.autoReload||"idle"===j)?(0,y.jsx)(nm,{},void 0):null]}),void 0)]}),void 0)});w.forwardRef(function(e,n){var t=e.showTabs,r=e.showLineNumbers,o=e.decorators,i=e.code,s=e.initMode,a=e.wrapContent,l=e.additionalLanguages,c=B(e,["showTabs","showLineNumbers","decorators","code","initMode","wrapContent","additionalLanguages"]),d=e8().sandpack,u=e7().code,p=ek(),f=null!=t?t:d.visibleFiles.length>1;return(0,y.jsxs)(ng,P({className:p("editor-viewer")},c,{children:[f?(0,y.jsx)(np,{},void 0):null,(0,y.jsx)("div",P({className:p("code-editor",[nE])},{children:(0,y.jsx)(nA,{ref:n,additionalLanguages:l,code:null!=i?i:u,decorators:o,filePath:d.activeFile,initMode:s||d.initMode,showLineNumbers:r,showReadOnly:!1,wrapContent:a,readOnly:!0},void 0)}),void 0),"idle"===d.status?(0,y.jsx)(nm,{},void 0):null]}),void 0)});var nI=eh(((f={border:"1px solid $colors$surface2",display:"flex",flexWrap:"wrap",alignItems:"stretch",borderRadius:"$border$radius",overflow:"hidden",position:"relative",backgroundColor:"$colors$surface2",gap:1})["> ."+nh]={flexGrow:1,flexShrink:1,flexBasis:"0",height:"$layout$height",overflow:"hidden","@media print":{height:"auto",display:"block"},"@media screen and (max-width: 768px)":((v={})["&:not(.sp-preview, .sp-editor, .sp-preset-column)"]={height:"calc($layout$height / 2)"},v.minWidth="100%;",v)},f["> .sp-file-explorer"]={flex:.2,minWidth:200,"@media screen and (max-width: 768px)":{flex:1}},f)),nD=w.forwardRef(function(e,n){var t=e.children,r=e.className,o=B(e,["children","className"]),i=e8().sandpack,s=ek(),a=nC(i.lazyAnchorRef,n);return(0,y.jsx)("div",P({ref:a,className:s("layout",[nI,r])},o,{children:t}),void 0)}),nT=function(){var e,n=e8().sandpack.error;return null!==(e=null==n?void 0:n.message)&&void 0!==e?e:null},nH=function(e,n){var t=e8(),r=t.sandpack,o=t.listen,i=w.useState("LOADING"),s=i[0],a=i[1];return(w.useEffect(function(){var n=o(function(e){"start"===e.type&&!0===e.firstLoad&&a("LOADING"),"done"===e.type&&a(function(e){return"LOADING"===e?"PRE_FADING":"HIDDEN"})},e);return function(){n()}},[e,"idle"===r.status]),w.useEffect(function(){var e;return"PRE_FADING"!==s||n?"FADING"===s&&(e=setTimeout(function(){return a("HIDDEN")},200)):a("FADING"),function(){clearTimeout(e)}},[s,n]),"timeout"===r.status)?"TIMEOUT":"running"!==r.status?"HIDDEN":s},nP=function(e){var n=e8().dispatch;return{refresh:function(){return n({type:"refresh"},e)},back:function(){return n({type:"urlback"},e)},forward:function(){return n({type:"urlforward"},e)}}},nB=function(e){var n=e8(),t=n.sandpack,r=n.listen,o=n.dispatch,i=w.useRef(null),s=w.useRef(ep());return w.useEffect(function(){var n=i.current,r=s.current;return null!==n&&t.registerBundler(n,r,e),function(){return t.unregisterBundler(r)}},[]),{sandpack:t,getClient:function(){return t.clients[s.current]||null},clientId:s.current,iframe:i,listen:function(e){return r(e,s.current)},dispatch:function(e){return o(e,s.current)}}},nJ=function(e){var n=e8().dispatch;return{restart:function(){return n({type:"shell/restart"},e)},openPreview:function(){return n({type:"shell/openPreview"},e)}}},nz=function(e,n){var t;switch(e.state){case"downloading_manifest":return"[1/3] Downloading manifest";case"downloaded_module":return"[2/3] Downloaded "+e.name+" ("+(n-e.totalPending)+"/"+n+")";case"starting_command":return"[3/3] Starting command";case"command_running":return'[3/3] Running "'+(null===(t=e.command)||void 0===t?void 0:t.trim())+'"'}},nU=function(e){var n=w.useState(!1),t=n[0],r=n[1],o=w.useState(),i=o[0],s=o[1],a=w.useState(null),l=a[0],c=a[1],d=null==e?void 0:e.timeout,u=null==e?void 0:e.clientId,p=e8().listen;return w.useEffect(function(){var e,n=p(function(n){"start"===n.type&&n.firstLoad&&r(!1),d&&(e=setTimeout(function(){c(null)},d)),"shell/progress"!==n.type||t||(i||"downloaded_module"!==n.data.state||s(n.data.totalPending),void 0!==i&&c(nz(n.data,i))),"done"===n.type&&!1===n.compilatonError&&(c(null),r(!0),clearTimeout(e))},u);return function(){e&&clearTimeout(e),n()}},[u,t,i,d]),l},nZ=function(e){var n=e.clientId,t=e.maxMessageCount,r=void 0===t?800:t;e.resetOnPreviewRestart;var o=w.useState([]),i=o[0],s=o[1],a=e8().listen;return w.useEffect(function(){return a(function(e){"start"===e.type?s([]):"stdout"===e.type&&e.payload.data&&e.payload.data.trim()&&s(function(n){for(var t=U(U([],n,!0),[{data:e.payload.data,id:ep()}],!1);t.length>r;)t.shift();return t})},n)},[r,n]),{logs:i,reset:function(){return s([])}}},nW=function(e){var n=e.replace("[sandpack-client]: ","");if(/process.exit/.test(n)){var t=n.match(/process.exit\((\d+)\)/);return t?0===Number(t[1])?"Server is not running, would you like to start it again?":"Server has crashed with status code "+t[1]+", would you like to restart the server?":n}return n},nV=function(e){var n=e.children,t=e.className,r=B(e,["children","className"]),o=nT(),i=nJ().restart,s=ek(),a=e8().sandpack,l=a.runSandpack,c=a.teamId,d=e8().dispatch;if(!o&&!n)return null;var u=null==o?void 0:o.startsWith("[sandpack-client]");return(null==o?void 0:o.includes("NPM_REGISTRY_UNAUTHENTICATED_REQUEST"))?(0,y.jsxs)("div",P({className:s("overlay",[s("error"),no,ns,t])},e,{children:[(0,y.jsx)("p",P({className:s("error-message",[na])},{children:(0,y.jsx)("strong",{children:"Unable to fetch required dependency."},void 0)}),void 0),(0,y.jsx)("div",P({className:s("error-message",[na])},{children:(0,y.jsxs)("p",{children:["Authentication required. Please sign in to your account (make sure to allow pop-ups to this page) and try again. If the issue persists, contact"," ",(0,y.jsx)("a",P({href:"mailto:[email protected]?subject=Sandpack Timeout Error"},{children:"support"}),void 0)," ","for further assistance."]},void 0)}),void 0),(0,y.jsx)("div",{children:(0,y.jsxs)("button",P({className:s("button",[ne,e9,nn]),onClick:function(){c&&d({type:"sign-in",teamId:c})}},{children:[(0,y.jsx)(W,{},void 0),(0,y.jsx)("span",{children:"Sign in"},void 0)]}),void 0)},void 0)]}),void 0):u&&o?(0,y.jsx)("div",P({className:s("overlay",[s("error"),no,ns,t])},r,{children:(0,y.jsxs)("div",P({className:s("error-message",[na])},{children:[(0,y.jsx)("p",P({className:s("error-title",[eh({fontWeight:"bold"})])},{children:"Couldn't connect to server"}),void 0),(0,y.jsx)("p",{children:nW(o)},void 0),(0,y.jsx)("div",{children:(0,y.jsxs)("button",P({className:s("button",[s("icon-standalone"),ne,e9,nn]),onClick:function(){i(),l()},title:"Restart script",type:"button"},{children:[(0,y.jsx)(_,{},void 0)," ",(0,y.jsx)("span",{children:"Restart"},void 0)]}),void 0)},void 0)]}),void 0)}),void 0):(0,y.jsxs)("div",P({className:s("overlay",[s("error"),no,ni({solidBg:!0}),t]),translate:"no"},r,{children:[(0,y.jsx)("p",P({className:s("error-message",[na])},{children:(0,y.jsx)("strong",{children:"Something went wrong"},void 0)}),void 0),(0,y.jsx)("p",P({className:s("error-message",[na({errorCode:!0})])},{children:o||n}),void 0)]}),void 0)};function n_(e,n,t,r){var o,i,s=n?null:function(e){var n={};switch(e.bg&&(n.backgroundColor="rgb("+e.bg+")"),e.fg&&(n.color="rgb("+e.fg+")"),e.decoration){case"bold":n.fontWeight="bold";break;
1case"dim":n.opacity="0.5";break;case"italic":n.fontStyle="italic";break;case"hidden":n.visibility="hidden";break;case"strikethrough":n.textDecoration="line-through";break;case"underline":n.textDecoration="underline";break;case"blink":n.textDecoration="blink"}return n}(t),a=n?(o="",(t.bg&&(o+=t.bg+"-bg "),t.fg&&(o+=t.fg+"-fg "),t.decoration&&(o+="ansi-"+t.decoration+" "),""===o)?null:o=o.substring(0,o.length-1)):null;if(!e)return w.createElement("span",{style:s,key:r,className:a},t.content);for(var l=[],c=/(\s|^)(https?:\/\/(?:www\.|(?!www))[^\s.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/g,d=0;null!==(i=c.exec(t.content));){var u=i[1],p=i[2],f=i.index+u.length;f>d&&l.push(t.content.substring(d,f));var v=p.startsWith("www.")?"http://"+p:p;l.push(w.createElement("a",{key:d,href:v,target:"_blank"},""+p)),d=c.lastIndex}return d<t.content.length&&l.push(t.content.substring(d)),w.createElement("span",{style:s,key:r,className:a},l)}function nY(e){var n,t,r=e.className,o=e.useClasses,i=e.children,s=e.linkify;return w.createElement("code",{className:r},(n=null!=i?i:"",void 0===(t=null!=o&&o)&&(t=!1),n=(0,T.escapeCarriageReturn)(function(e){var n=e;do n=(e=n).replace(/[^\n]\x08/gm,"");while(n.length<e.length);return e}(n)),D.ansiToJson(n,{json:!0,remove_empty:!0,use_classes:t})).map(n_.bind(null,null!=s&&s,null!=o&&o)))}var nG=function(e){var n=e.data,t=ek();return(0,y.jsx)(y.Fragment,{children:n.map(function(e){var n=e.data,r=e.id;return(0,y.jsx)("div",P({className:t("console-item",[nq])},{children:(0,y.jsx)(nY,{children:n},void 0)}),r)})},void 0)},nq=eh({width:"100%",padding:"$space$3 $space$2",fontSize:".85em",position:"relative",whiteSpace:"pre","&:not(:first-child):after":{content:"",position:"absolute",top:0,left:0,right:0,height:1,background:"$colors$surface3"}}),nX="https://codesandbox.io/api/v1/sandboxes/define",nQ=function(e,n){var t,r=Object.keys(e).reduce(function(n,t){var r,o=t.replace("/",""),i={content:e[t].code,isBinary:!1};return P(P({},n),((r={})[o]=i,r))},{});return t=P({files:r},n?{template:n}:null),H.compressToBase64(JSON.stringify(t)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},nK=function(e){var n,t,r,o=e.children,i=B(e,["children"]),s=e8().sandpack,a=w.useRef(null),l=w.useState(),c=l[0],d=l[1];return(w.useEffect(function(){var e=setTimeout(function(){var e=nQ(s.files,s.environment);d(new URLSearchParams({parameters:e,query:new URLSearchParams({file:s.activeFile,utm_medium:"sandpack"}).toString()}))},600);return function(){clearTimeout(e)}},[s.activeFile,s.environment,s.files]),(null!==(r=null===(t=null===(n=null==c?void 0:c.get)||void 0===n?void 0:n.call(c,"parameters"))||void 0===t?void 0:t.length)&&void 0!==r?r:0)>1500)?(0,y.jsxs)("button",P({onClick:function(){var e;return null===(e=a.current)||void 0===e?void 0:e.submit()},title:"Open in CodeSandbox",type:"button"},i,{children:[(0,y.jsxs)("form",P({ref:a,action:nX,method:"POST",style:{visibility:"hidden"},target:"_blank"},{children:[(0,y.jsx)("input",{name:"environment",type:"hidden",value:"node"===s.environment?"server":s.environment},void 0),Array.from(c,function(e){var n=e[0],t=e[1];return(0,y.jsx)("input",{name:n,type:"hidden",value:t},n)})]}),void 0),o]}),void 0):(0,y.jsx)("a",P({href:nX+"?"+(null==c?void 0:c.toString())+"&environment="+("node"===s.environment?"server":s.environment),rel:"noreferrer noopener",target:"_blank",title:"Open in CodeSandbox"},i,{children:o}),void 0)},n0=function(){var e=ek();return(0,y.jsxs)(nK,P({className:e("button",[e("icon-standalone"),ne,e9,nn])},{children:[(0,y.jsx)(K,{},void 0),(0,y.jsx)("span",{children:"Open Sandbox"},void 0)]}),void 0)},n1=eh({transform:"translate(-4px, 9px) scale(0.13, 0.13)","*":{position:"absolute",width:"96px",height:"96px"}}),n3=eh(((m={position:"absolute",right:"$space$2",bottom:"$space$2",zIndex:"$top",width:"32px",height:"32px",borderRadius:"$border$radius"})["."+n1]={display:"flex"},m[".sp-button."+ne]={display:"none"},m["&:hover .sp-button."+ne]={display:"flex"},m["&:hover .sp-button."+ne+" > span"]={display:"none"},m["&:hover ."+n1]={display:"none"},m)),n2=eh({animation:eg({"0%":{transform:"rotateX(-25.5deg) rotateY(45deg)"},"100%":{transform:"rotateX(-25.5deg) rotateY(405deg)"}})+" 1s linear infinite",animationFillMode:"forwards",transformStyle:"preserve-3d",transform:"rotateX(-25.5deg) rotateY(45deg)","*":{border:"10px solid $colors$clickable",borderRadius:"8px",background:"$colors$surface1"},".top":{transform:"rotateX(90deg) translateZ(44px)",transformOrigin:"50% 50%"},".bottom":{transform:"rotateX(-90deg) translateZ(44px)",transformOrigin:"50% 50%"},".front":{transform:"rotateY(0deg) translateZ(44px)",transformOrigin:"50% 50%"},".back":{transform:"rotateY(-180deg) translateZ(44px)",transformOrigin:"50% 50%"}
1,".left":{transform:"rotateY(-90deg) translateZ(44px)",transformOrigin:"50% 50%"},".right":{transform:"rotateY(90deg) translateZ(44px)",transformOrigin:"50% 50%"}}),n6=function(e){var n=e.className,t=e.showOpenInCodeSandbox,r=B(e,["className","showOpenInCodeSandbox"]),o=ek();return(0,y.jsxs)("div",P({className:o("cube-wrapper",[n3,n]),title:"Open in CodeSandbox"},r,{children:[t&&(0,y.jsx)(n0,{},void 0),(0,y.jsx)("div",P({className:o("cube",[n1])},{children:(0,y.jsxs)("div",P({className:o("sides",[n2])},{children:[(0,y.jsx)("div",{className:"top"},void 0),(0,y.jsx)("div",{className:"right"},void 0),(0,y.jsx)("div",{className:"bottom"},void 0),(0,y.jsx)("div",{className:"left"},void 0),(0,y.jsx)("div",{className:"front"},void 0),(0,y.jsx)("div",{className:"back"},void 0)]}),void 0)}),void 0)]}),void 0)},n5=eh({backgroundColor:"$colors$surface1"}),n4=function(e){var n=e.clientId,t=e.loading,r=e.className,o=e.style,i=e.showOpenInCodeSandbox,s=B(e,["clientId","loading","className","style","showOpenInCodeSandbox"]),a=ek(),l=e8().sandpack,c=l.runSandpack,d=l.environment,u=w.useState(!1),p=u[0],f=u[1],v=nH(n,t),m=nU({clientId:n}),h=nZ({clientId:n}).logs;return(w.useEffect(function(){var e;return(null==m?void 0:m.includes("Running"))&&(e=setTimeout(function(){f(!0)},3e3)),function(){e&&clearTimeout(e)}},[m]),"HIDDEN"===v)?null:"TIMEOUT"===v?(0,y.jsx)("div",P({className:a("overlay",[a("error"),no,ni,ns,r])},s,{children:(0,y.jsxs)("div",P({className:a("error-message",[na])},{children:[(0,y.jsx)("p",P({className:a("error-title",[eh({fontWeight:"bold"})])},{children:"Couldn't connect to server"}),void 0),(0,y.jsx)("div",P({className:a("error-message",[na])},{children:(0,y.jsxs)("p",{children:["This means sandpack cannot connect to the runtime or your network is having some issues. Please check the network tab in your browser and try again. If the problem persists, report it via"," ",(0,y.jsx)("a",P({href:"mailto:[email protected]?subject=Sandpack Timeout Error"},{children:"email"}),void 0)," ","or submit an issue on"," ",(0,y.jsx)("a",P({href:"https://github.com/codesandbox/sandpack/issues",rel:"noreferrer noopener",target:"_blank"},{children:"GitHub."}),void 0)]},void 0)}),void 0),(0,y.jsxs)("p",P({className:a("error-message",[na({errorCode:!0})])},{children:["ENV: ",d,(0,y.jsx)("br",{},void 0),"ERROR: TIME_OUT"]}),void 0),(0,y.jsx)("div",{children:(0,y.jsxs)("button",P({className:a("button",[a("icon-standalone"),ne,e9,nn]),onClick:c,title:"Restart script",type:"button"},{children:[(0,y.jsx)(_,{},void 0)," ",(0,y.jsx)("span",{children:"Try again"},void 0)]}),void 0)},void 0)]}),void 0)}),void 0):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",P({className:a("overlay",[a("loading"),no,n5,r]),style:P(P({},o),{opacity:"LOADING"===v||"PRE_FADING"===v?1:0,transition:"opacity 200ms ease-out"})},s,{children:[p&&(0,y.jsx)("div",P({className:n8.toString()},{children:(0,y.jsx)(nG,{data:h},void 0)}),void 0),(0,y.jsx)(n6,{showOpenInCodeSandbox:i},void 0)]}),void 0),m&&(0,y.jsx)("div",P({className:n7.toString()},{children:(0,y.jsx)("p",{children:m},void 0)}),void 0)]},void 0)},n8=eh({position:"absolute",left:0,right:0,bottom:"$space$8",overflow:"auto",opacity:.5,overflowX:"hidden"}),n7=eh({position:"absolute",left:"$space$5",bottom:"$space$4",zIndex:"$top",color:"$colors$clickable",animation:nr+" 150ms ease",fontFamily:"$font$mono",fontSize:".8em",width:"75%",p:{whiteSpace:"nowrap",margin:0,textOverflow:"ellipsis",overflow:"hidden"}}),n9=function(e){var n=nU({timeout:3e3,clientId:e.clientId});return n?(0,y.jsx)("div",P({className:te.toString()},{children:(0,y.jsx)("p",{children:n},void 0)}),void 0):null},te=eh({position:"absolute",left:"$space$5",bottom:"$space$4",zIndex:"$top",color:"$colors$clickable",animation:nr+" 150ms ease",fontFamily:"$font$mono",fontSize:".8em",width:"75%",p:{whiteSpace:"nowrap",margin:0,textOverflow:"ellipsis",overflow:"hidden"}}),tn=eh({borderRadius:"0",width:"100%",padding:0,marginBottom:"$space$2",span:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},svg:{marginRight:"$space$1"}}),tt=function(e){var n=e.selectFile,t=e.path,r=e.active,o=e.onClick,i=e.depth,s=e.isDirOpen,a=ek(),l=t.split("/").filter(
1Boolean).pop();return jsxs("button",P({className:a("button",[a("explorer"),ne,tn]),"data-active":r,onClick:function(e){n&&n(t),null==o||o(e)},style:{paddingLeft:18*i+"px"},title:l,type:"button"},{children:[n?jsx(et,{},void 0):s?jsx(ee,{},void 0):jsx(en,{},void 0),jsx("span",{children:l},void 0)]}),void 0)},tr=function(e){var n=e.prefixedPath,t=e.files,r=e.selectFile,o=e.activeFile,i=e.depth,s=e.autoHiddenFiles,a=e.visibleFiles,l=e.initialCollapsedFolder,c=React.useState(!(null==l?void 0:l.includes(n))),d=c[0],u=c[1];return jsxs("div",{children:[jsx(tt,{depth:i,isDirOpen:d,onClick:function(){return u(function(e){return!e})},path:n+"/"},void 0),d&&jsx(ti,{activeFile:o,autoHiddenFiles:s,depth:i+1,files:t,initialCollapsedFolder:l,prefixedPath:n,selectFile:r,visibleFiles:a},void 0)]},n)},to=function(e){var n=e.autoHiddenFiles,t=e.visibleFiles,r=e.files,o=e.prefixedPath,i=t.length>0,s=n&&!i,a=n&&!!i,l=Object.keys(r).filter(function(e){var n,i=e.startsWith(o);return a?i&&t.includes(e):s?i&&!(null===(n=r[e])||void 0===n?void 0:n.hidden):i}).map(function(e){return e.substring(o.length)}),c=new Set(l.filter(function(e){return e.includes("/")}).map(function(e){return""+o+e.split("/")[0]+"/"})),d=l.filter(function(e){return!e.includes("/")}).map(function(e){return""+o+e});return{directories:Array.from(c),modules:d}},ti=function(e){var n=e.depth,t=void 0===n?0:n,r=e.activeFile,o=e.selectFile,i=e.prefixedPath,s=e.files,a=e.autoHiddenFiles,l=e.visibleFiles,c=e.initialCollapsedFolder,d=to({visibleFiles:l,autoHiddenFiles:a,prefixedPath:i,files:s}),u=d.directories,p=d.modules;return jsxs("div",{children:[u.map(function(e){return jsx(tr,{activeFile:r,autoHiddenFiles:a,depth:t,files:s,initialCollapsedFolder:c,prefixedPath:e,selectFile:o,visibleFiles:l},e)}),p.map(function(e){return jsx(tt,{active:r===e,depth:t,path:e,selectFile:o},e)})]},void 0)};eh({padding:"$space$3",overflow:"auto",height:"100%"});var ts=function(e){var n=e.match(/(https?:\/\/.*?)\//);return n&&n[1]?[n[1],e.replace(n[1],"")]:[e,"/"]},ta=eh({display:"flex",alignItems:"center",height:"$layout$headerHeight",borderBottom:"1px solid $colors$surface2",padding:"$space$3 $space$2",background:"$colors$surface1"}),tl=eh({backgroundColor:"$colors$surface2",color:"$colors$clickable",padding:"$space$1 $space$3",borderRadius:"99999px",border:"1px solid $colors$surface2",height:"24px",lineHeight:"24px",fontSize:"inherit",outline:"none",flex:1,marginLeft:"$space$4",width:"0",transition:"background $transitions$default","&:hover":{backgroundColor:"$colors$surface3"},"&:focus":{backgroundColor:"$surface1",border:"1px solid $colors$accent",color:"$colors$base"}}),tc=function(e){var n,t=e.clientId,r=e.onURLChange,o=e.className,i=e.startRoute,s=B(e,["clientId","onURLChange","className","startRoute"]),a=w.useState(""),l=a[0],c=a[1],d=e8(),u=d.sandpack,p=d.dispatch,f=d.listen,v=w.useState(null!==(n=null!=i?i:u.startRoute)&&void 0!==n?n:"/"),m=v[0],h=v[1],g=w.useState(!1),b=g[0],x=g[1],$=w.useState(!1),j=$[0],C=$[1],k=ek();w.useEffect(function(){var e=f(function(e){if("urlchange"===e.type){var n=e.url,t=e.back,r=e.forward,o=ts(n),i=o[0],s=o[1];c(i),h(s),x(t),C(r)}},t);return function(){return e()}},[]);var S=k("button",[k("icon"),ne,nt,eh({minWidth:"$space$6",justifyContent:"center"})]);return(0,y.jsxs)("div",P({className:k("navigator",[ta,o])},s,{children:[(0,y.jsx)("button",P({"aria-label":"Go back one page",className:S,disabled:!b,onClick:function(){p({type:"urlback"})},type:"button"},{children:(0,y.jsx)(G,{},void 0)}),void 0),(0,y.jsx)("button",P({"aria-label":"Go forward one page",className:S,disabled:!j,onClick:function(){p({type:"urlforward"})},type:"button"},{children:(0,y.jsx)(q,{},void 0)}),void 0),(0,y.jsx)("button",P({"aria-label":"Refresh page",className:S,onClick:function(){p({type:"refresh"})},type:"button"},{children:(0,y.jsx)(X,{},void 0)}),void 0),(0,y.jsx)("input",{"aria-label":"Current Sandpack URL",className:k("input",[tl]),name:"Current Sandpack URL",onChange:function(e){h(e.target.value.startsWith("/")?e.target.value:"/"+e.target.value)},onKeyDown:function(e){"Enter"===e.code&&(e.preventDefault(),e.stopPropagation(),"function"==typeof r&&r(l+e.currentTarget.value))},type:"text",value:m},void 0)]}),void 0)},td=eh(((h={flex:1,display:"flex",flexDirection:"column",background:"white",overflow:"auto",position:"relative"})[".sp-bridge-frame"]={border:0,position:"absolute",left:"$space$2",bottom:"$space$2",zIndex:"$top",height:12,width:"30%",mixBlendMode:"multiply",pointerEvents:"none"},h)),tu=eh({border:"0",outline:"0",width:"100%",height:"100%",minHeight:"160px",maxHeight:"2000px",flex:1}),tp=eh({display:"flex",position:"absolute",bottom:"$space$2",right:"$space$2",zIndex:"$overlay",gap:"$space$2"}),tf=w.forwardRef(function(e,n){var t=e.showNavigator,r=void 0!==t&&t,o=e.showRefreshButton,i=e.showOpenInCodeSandbox,s=void 0===i||i,a=e.showSandpackErrorOverlay;e.showOpenNewtab;var l=e.showRestartButton,c=e.actionsChildren,d=void 0===c?(0,y.jsx)(y.Fragment,{},void 0):c,u=e.children,p=e.className,f=e.startRoute,v=void 0===f?"/":f,m=B(e,["showNavigator","showRefreshButton","showOpenInCodeSandbox","showSandpackErrorOverlay","showOpenNewtab","showRestartButton","actionsChildren","children","className","startRoute"]),h=nB({startRoute:v}),g=h.sandpack,b=h.listen,x=h.iframe,$=h.getClient,j=h.clientId,C=h.dispatch,k=w.useState(null),S=k[0],N=k[1],O=g.status,E=nP(j).refresh,M=nJ(j).restart,F=ek();return w.useEffect(function(){return b(function(e){"resize"===e.type&&N(e.height)})},[]),w.useImperativeHandle(n,function(){return{clientId:j,getClient:$}},[$,j]),(0,y.jsxs)(ng,P({className:F("preview",[p])},m,{children:[r&&(0,y.jsx)(tc,{clientId:j,onURLChange:function(e){x.current&&(x.current.src=e)},startRoute:v},void 0),(0,y.jsxs)("div",P({className:F("preview-container",[td])},{children:[(0,y.jsx)("iframe",{ref:x,className:F("preview-iframe",[tu]),style:{height:S||void 0},title:"Sandpack Preview"},void 0),(0,y.jsxs)("div",P({className:F("preview-actions",[tp])},{children:[d,(void 0===l||l)&&"node"===g.environment&&(0,y.jsx)(nf,P({onClick:M},{children:(0,y.jsx)(_,{},void 0)}),void 0),!r&&(void 0===o||o)&&"running"===O&&(0,y.jsx)(nf,P({onClick:E},{children:(0,y.jsx)(X,{},void 0)}),void 0),g.teamId&&(0,y.jsx)("button",P({className:F("button",[F("icon-standalone"),ne,e9,nn]),onClick:function(){return C({type:"sign-out"})},title:"Sign out",type:"button"},{children:(0,y.jsx)(V,{},void 0)}),void 0),s&&(0,y.jsx)(n0,{},void 0)]}),void 0),(0,y.jsx)(n4,{clientId:j,showOpenInCodeSandbox:s},void 0),(void 0===a||a)&&(0,y.jsx)(nV,{},void 0),u]}),void 0)]}),void 0)});eh(((g={display:"flex",flexDirection:"column",width:"100%",position:"relative",overflow:"auto",minHeight:"160px",flex:1})[".sp-stack"]={height:"100%"},g)),eh({justifyContent:"space-between",borderBottom:"1px solid $colors$surface2",padding:"0 $space$2",fontFamily:"$font$mono",height:"$layout$headerHeight",minHeight:"$layout$headerHeight",overflowX:"auto",whiteSpace:"nowrap"}),eh({display:"flex",flexDirection:"row",alignItems:"center",gap:"$space$2"});var tv=eh({variants:{status:{pass:{color:"var(--test-pass)"},fail:{color:"var(--test-fail)"},skip:{color:"var(--test-skip)"},title:{color:"var(--test-title)"}}}});tv({status:"pass"}
1),tv({status:"fail"}),tv({status:"skip"}),tv({status:"title"});var tm=eh({variants:{status:{pass:{background:"var(--test-pass)",color:"$colors$surface1"},fail:{background:"var(--test-fail)",color:"$colors$surface1"},run:{background:"var(--test-run)",color:"$colors$surface1"}}}});tm({status:"run"}),tm({status:"pass"}),tm({status:"fail"}),eh({marginLeft:"$space$4"}),eh({marginBottom:"$space$2",color:"$colors$clickable"}),eh({marginBottom:"$space$2",color:"$colors$hover"}),eh({marginLeft:"$space$2"}),eh({marginRight:"$space$2"}),eh({color:"$colors$hover",marginBottom:"$space$2"}),eh({marginLeft:"$space$4"}),eh({color:"$colors$hover",fontSize:"$font$size",padding:"$space$2",whiteSpace:"pre-wrap"}),eh({display:"flex",flexDirection:"row",alignItems:"center",marginBottom:"$space$2"}),eh({marginBottom:"$space$2"}),eh({fontWeight:"bold"}),eh({borderRadius:"calc($border$radius / 2)"}),eh({padding:"$space$1 $space$2",fontFamily:"$font$mono",textTransform:"uppercase",marginRight:"$space$2"}),eh({fontFamily:"$font$mono",cursor:"pointer",display:"inline-block"}),eh({color:"$colors$clickable",textDecorationStyle:"dotted",textDecorationLine:"underline"}),eh({color:"$colors$hover",fontWeight:"bold",textDecorationStyle:"dotted",textDecorationLine:"underline"}),eh({marginBottom:"$space$2"}),eh({fontWeight:"bold",color:"$colors$hover",whiteSpace:"pre-wrap"}),eh({fontWeight:"bold",color:"$colors$clickable"}),eh({display:"flex",position:"absolute",bottom:"$space$2",right:"$space$2",zIndex:"$overlay","> *":{marginLeft:"$space$2"}}),eh({padding:"$space$4",height:"100%",overflow:"auto",display:"flex",flexDirection:"column",position:"relative",fontFamily:"$font$mono"}),eh({fontWeight:"bold",color:"$colors$base"});var th=["SyntaxError: ","Error in sandbox:"],tg={id:"random",method:"clear",data:["Console was cleared"]},tb=(0,eval)("this"),tx="function"==typeof ArrayBuffer,ty="function"==typeof Map,tw="function"==typeof Set;(r=b||(b={}
1))[r.infinity=0]="infinity",r[r.minusInfinity=1]="minusInfinity",r[r.minusZero=2]="minusZero";var t$={Arithmetic:function(e){return e===b.infinity?1/0:e===b.minusInfinity?-1/0:e===b.minusZero?-0:e},HTMLElement:function(e){var n=document.implementation.createHTMLDocument("sandbox");try{var t=n.createElement(e.tagName);t.innerHTML=e.innerHTML;for(var r=0,o=Object.keys(e.attributes);r<o.length;r++){var i=o[r];try{t.setAttribute(i,e.attributes[i])}catch(e){}}return t}catch(n){return e}},Function:function(e){var n=function(){};return Object.defineProperty(n,"toString",{value:function(){return"function "+e.name+"() {"+e.body+"}"}}),n},"[[NaN]]":function(){return NaN},"[[undefined]]":function(){},"[[Date]]":function(e){var n=new Date;return n.setTime(e),n},"[[RegExp]]":function(e){return new RegExp(e.src,e.flags)},"[[Error]]":function(e){var n=new(tb[e.name]||Error)(e.message);return n.stack=e.stack,n},"[[ArrayBuffer]]":function(e){if(tx){var n=new ArrayBuffer(e.length);return new Int8Array(n).set(e),n}return e},"[[TypedArray]]":function(e){return"function"==typeof tb[e.ctorName]?new tb[e.ctorName](e.arr):e.arr},"[[Map]]":function(e){if(ty){for(var n=new Map,t=0;t<e.length;t+=2)n.set(e[t],e[t+1]);return n}for(var r=[],o=0;o<e.length;o+=2)r.push([e[t],e[t+1]]);return r},"[[Set]]":function(e){if(tw){for(var n=new Set,t=0;t<e.length;t++)n.add(e[t]);return n}return e}},tj=function(e){if("string"==typeof e||"number"==typeof e||null===e);else if(Array.isArray(e))return e.map(tj);else if("object"==typeof e&&"@t"in e)return(0,t$[e["@t"]])(e.data);return e},tC=function(e,n,t){var r="Object"!==e.constructor.name?e.constructor.name+" ":"";if(t>2)return r;var o=Object.entries(e);return r+"{ "+Object.entries(e).reduce(function(e,r,i){var s=r[0],a=r[1],l=o.length>10?"\n ":"",c=tk(a,n,t);return 400===i?e+l+"...":i>400?e:e+(0===i?"":", ")+l+s+": "+c},"")+(o.length>10?"\n":" ")+"}"},tk=function(e,n,t){void 0===t&&(t=0);try{var r,o=tj(e);if(Array.isArray(o))return r=t+1,"["+o.reduce(function(e,t,o){return""+e+(o?", ":"")+tk(t,n,r)},"")+"]";switch(typeof o){case"string":return('"'+o+'"').slice(0,1e4);case"number":case"function":case"symbol":return o.toString();case"boolean":return String(o);case"undefined":return"undefined";default:if(o instanceof RegExp||o instanceof Error||o instanceof Date)return o.toString();if(null===o)return String(null);if(o instanceof HTMLElement)return o.outerHTML.slice(0,1e4);if(0===Object.entries(o).length)return"{}";if("@r"in o){if(t>2)return"Unable to print information";var i=n[o["@r"]];return tk(i,n,t+1)}return tC(o,n,t+1)}}catch(e){return"Unable to print information"}},tS=function(e){switch(e){case"warn":return"warning";case"clear":return"clear";case"error":return"error";default:return"info"}},tN=function(e){var n=e.data,t=ek();return(0,y.jsx)(y.Fragment,{children:n.map(function(e,n,r){var o=e.data,i=e.id,s=e.method;return o&&Array.isArray(o)?(0,y.jsx)(w.Fragment,{children:o.map(function(e,o){var a=r.slice(n,r.length);return(0,y.jsx)("div",P({className:t("console-item",[tO({variant:tS(s)})])},{children:(0,y.jsx)(nA,{code:"clear"===s?e:tk(e,a),fileType:"js",initMode:"user-visible",showReadOnly:!1,readOnly:!0,wrapContent:!0},void 0)}),i+"-"+o)})},i):null})},void 0)},tO=eh(((x={width:"100%",padding:"$space$3 $space$2",fontSize:".8em",position:"relative","&:not(:first-child):after":{content:"",position:"absolute",top:0,left:0,right:0,height:1,background:"$colors$surface3"},".sp-cm":{padding:0},".cm-editor":{background:"none"},".cm-content":{padding:0}})[".sp-pre-placeholder"]={margin:"0 !important",fontSize:"1em"},x.variants={variant:{error:{color:"$colors$error",background:"$colors$errorSurface","&:not(:first-child):after":{background:"$colors$error",opacity:.07}},warning:{color:"$colors$warning",background:"$colors$warningSurface","&:not(:first-child):after":{background:"$colors$warning",opacity:.07}},clear:{fontStyle:"italic"},info:{}}},x)),tE=eh({justifyContent:"space-between",borderBottom:"1px solid $colors$surface2",padding:"0 $space$2",fontFamily:"$font$mono",height:"$layout$headerHeight",minHeight:"$layout$headerHeight",overflowX:"auto",whiteSpace:"nowrap"}),tM=eh({display:"flex",flexDirection:"row",alignItems:"center",gap:"$space$2"}),tF=function(e){var n=e.currentTab,t=e.setCurrentTab,r=e.node,o=ek(),i=o("console-header-button",[ne,nn,eh({padding:"$space$1 $space$3"})]);
1return(0,y.jsxs)("div",P({className:o("console-header",[tE,tM])},{children:[(0,y.jsxs)("p",P({className:o("console-header-title",[eh({lineHeight:1,margin:0,color:"$colors$base",fontSize:"$font$size",display:"flex",alignItems:"center",gap:"$space$2"})])},{children:[(0,y.jsx)(eo,{},void 0),(0,y.jsx)("span",{children:"Terminal"},void 0)]}),void 0),r&&(0,y.jsxs)("div",P({className:o("console-header-actions",[tM])},{children:[(0,y.jsx)("button",P({className:i,"data-active":"server"===n,onClick:function(){return t("server")},type:"button"},{children:"Server"}),void 0),(0,y.jsx)("button",P({className:i,"data-active":"client"===n,onClick:function(){return t("client")},type:"button"},{children:"Client"}),void 0)]}),void 0)]}),void 0)},tL=function(e){var n=e.clientId,t=e.maxMessageCount,r=void 0===t?800:t,o=e.showSyntaxError,i=void 0!==o&&o,s=e.resetOnPreviewRestart,a=void 0!==s&&s,l=w.useState([]),c=l[0],d=l[1],u=e8().listen;return w.useEffect(function(){return u(function(e){if(a&&"start"===e.type)d([]);else if("console"===e.type&&e.codesandbox){var n=Array.isArray(e.log)?e.log:[e.log];if(n.find(function(e){return"clear"===e.method}))return d([tg]);var t=i?n:n.filter(function(e){var n,t,r;return(null!==(r=null===(t=null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.filter)||void 0===t?void 0:t.call(n,function(e){return"string"!=typeof e||0===th.filter(function(n){return e.startsWith(n)}).length}))&&void 0!==r?r:[]).length>0});if(!t)return;d(function(e){for(var n=U(U([],e,!0),t,!0).filter(function(e,n,t){return n===t.findIndex(function(n){return n.id===e.id})});n.length>r;)n.shift();return n})}},n)},[i,r,n,a]),{logs:c,reset:function(){return d([])}}};w.forwardRef(function(e,n){var t,r=e.showHeader,o=e.showSyntaxError,i=e.maxMessageCount,s=e.onLogsChange,a=e.className;e.showSetupProgress;var l=e.resetOnPreviewRestart,c=void 0!==l&&l,d=e.actionsChildren,u=void 0===d?(0,y.jsx)(y.Fragment,{},void 0):d,p=e.standalone,f=void 0!==p&&p,v=B(e,["showHeader","showSyntaxError","maxMessageCount","onLogsChange","className","showSetupProgress","resetOnPreviewRestart","actionsChildren","standalone"]),m=e8().sandpack.environment,h=nB(),g=h.iframe,b=h.clientId,x=nJ().restart,$=w.useState("node"===m?"server":"client"),j=$[0],C=$[1],k=f?b:void 0,S=tL({maxMessageCount:i,showSyntaxError:void 0!==o&&o,resetOnPreviewRestart:c,clientId:k}),N=S.logs,O=S.reset,E=nZ({maxMessageCount:i,resetOnPreviewRestart:c,clientId:k}),M=E.logs,F=E.reset,L=w.useRef(null);w.useEffect(function(){null==s||s(N),L.current&&(L.current.scrollTop=L.current.scrollHeight)},[s,N,M,j]);var A="server"===j,R="node"===m;w.useImperativeHandle(n,function(){return{reset:function(){O(),F()}}});var I=ek();return(0,y.jsxs)(ng,P({className:I("console",[eh(((t={height:"100%",background:"$surface1",iframe:{display:"none"}})[".sp-bridge-frame"]={display:"block",border:0,position:"absolute",left:"$space$2",bottom:"$space$2",zIndex:"$top",height:12,width:"30%",mixBlendMode:"multiply",pointerEvents:"none"},t)),a])},v,{children:[(void 0===r||r)&&R&&(0,y.jsx)(tF,{currentTab:j,node:R,setCurrentTab:C},void 0),(0,y.jsx)("div",P({ref:L,className:I("console-list",[eh({overflow:"auto",scrollBehavior:"smooth"})])},{children:A?(0,y.jsx)(nG,{data:M},void 0):(0,y.jsx)(tN,{data:N},void 0)}),void 0),(0,y.jsxs)("div",P({className:I("console-actions",[eh({position:"absolute",bottom:"$space$2",right:"$space$2",display:"flex",gap:"$space$2"})])},{children:[u,A&&(0,y.jsx)(nf,P({onClick:function(){x(),O(),F()}},{children:(0,y.jsx)(_,{},void 0)}),void 0),(0,y.jsx)(nf,P({onClick:function(){"client"===j?O():F()}},{children:(0,y.jsx)(Q,{},void 0)}),void 0)]}),void 0),f&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(n9,{clientId:k},void 0),(0,y.jsx)("iframe",{ref:g},void 0)]},void 0)]}),void 0)}),eh({position:"absolute",zIndex:"$top",variants:{direction:{vertical:{right:0,left:0,height:10,cursor:"ns-resize"},horizontal:{top:0,bottom:0,width:10,cursor:"ew-resize"}}},"@media screen and (max-width: 768px)":{display:"none"}}),eh({position:"relative",strong:{background:"$colors$clickable",color:"$colors$surface1",minWidth:12,height:12,padding:"0 2px",borderRadius:12,fontSize:8,lineHeight:"12px",position:"absolute",top:0,right:0,fontWeight:"normal"}}),eh({width:"100%",overflow:"hidden"}),eh({flexDirection:"row-reverse","@media screen and (max-width: 768px)":{flexFlow:"wrap-reverse !important",flexDirection:"initial"}})}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.