import { template, spread, effect, delegateEvents, setAttribute, insert, createComponent, classList, Portal, addEventListener, memo } from "solid-js/web";
import { splitProps, createSignal, createEffect, Show, For, untrack, createRoot, onCleanup, lazy, Suspense, batch } from "solid-js";
import { createStore, unwrap } from "solid-js/store";
import { Uri, editor } from "monaco-editor";
var tailwind = `/*! tailwindcss v2.2.7 | MIT License | https://tailwindcss.com *//*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */

/*
Document
========
*/

/**
Use a better box model (opinionated).
*/

*,
::before,
::after {
	box-sizing: border-box;
}

/**
Use a more readable tab size (opinionated).
*/

html {
	-moz-tab-size: 4;
	-o-tab-size: 4;
	   tab-size: 4;
}

/**
1. Correct the line height in all browsers.
2. Prevent adjustments of font size after orientation changes in iOS.
*/

html {
	line-height: 1.15; /* 1 */
	-webkit-text-size-adjust: 100%; /* 2 */
}

/*
Sections
========
*/

/**
Remove the margin in all browsers.
*/

body {
	margin: 0;
}

/**
Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
*/

body {
	font-family:
		system-ui,
		-apple-system, /* Firefox supports this but not yet \`system-ui\` */
		'Segoe UI',
		Roboto,
		Helvetica,
		Arial,
		sans-serif,
		'Apple Color Emoji',
		'Segoe UI Emoji';
}

/*
Grouping content
================
*/

/**
1. Add the correct height in Firefox.
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
*/

hr {
	height: 0; /* 1 */
	color: inherit; /* 2 */
}

/*
Text-level semantics
====================
*/

/**
Add the correct text decoration in Chrome, Edge, and Safari.
*/

abbr[title] {
	-webkit-text-decoration: underline dotted;
	        text-decoration: underline dotted;
}

/**
Add the correct font weight in Edge and Safari.
*/

b,
strong {
	font-weight: bolder;
}

/**
1. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
2. Correct the odd 'em' font sizing in all browsers.
*/

code,
kbd,
samp,
pre {
	font-family:
		ui-monospace,
		SFMono-Regular,
		Consolas,
		'Liberation Mono',
		Menlo,
		monospace; /* 1 */
	font-size: 1em; /* 2 */
}

/**
Add the correct font size in all browsers.
*/

small {
	font-size: 80%;
}

/**
Prevent 'sub' and 'sup' elements from affecting the line height in all browsers.
*/

sub,
sup {
	font-size: 75%;
	line-height: 0;
	position: relative;
	vertical-align: baseline;
}

sub {
	bottom: -0.25em;
}

sup {
	top: -0.5em;
}

/*
Tabular data
============
*/

/**
1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
*/

table {
	text-indent: 0; /* 1 */
	border-color: inherit; /* 2 */
}

/*
Forms
=====
*/

/**
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
*/

button,
input,
optgroup,
select,
textarea {
	font-family: inherit; /* 1 */
	font-size: 100%; /* 1 */
	line-height: 1.15; /* 1 */
	margin: 0; /* 2 */
}

/**
Remove the inheritance of text transform in Edge and Firefox.
1. Remove the inheritance of text transform in Firefox.
*/

button,
select { /* 1 */
	text-transform: none;
}

/**
Correct the inability to style clickable types in iOS and Safari.
*/

button,
[type='button'],
[type='reset'],
[type='submit'] {
	-webkit-appearance: button;
}

/**
Remove the inner border and padding in Firefox.
*/

::-moz-focus-inner {
	border-style: none;
	padding: 0;
}

/**
Restore the focus styles unset by the previous rule.
*/

:-moz-focusring {
	outline: 1px dotted ButtonText;
}

/**
Remove the additional ':invalid' styles in Firefox.
See: https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737
*/

:-moz-ui-invalid {
	box-shadow: none;
}

/**
Remove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers.
*/

legend {
	padding: 0;
}

/**
Add the correct vertical alignment in Chrome and Firefox.
*/

progress {
	vertical-align: baseline;
}

/**
Correct the cursor style of increment and decrement buttons in Safari.
*/

::-webkit-inner-spin-button,
::-webkit-outer-spin-button {
	height: auto;
}

/**
1. Correct the odd appearance in Chrome and Safari.
2. Correct the outline style in Safari.
*/

[type='search'] {
	-webkit-appearance: textfield; /* 1 */
	outline-offset: -2px; /* 2 */
}

/**
Remove the inner padding in Chrome and Safari on macOS.
*/

::-webkit-search-decoration {
	-webkit-appearance: none;
}

/**
1. Correct the inability to style clickable types in iOS and Safari.
2. Change font properties to 'inherit' in Safari.
*/

::-webkit-file-upload-button {
	-webkit-appearance: button; /* 1 */
	font: inherit; /* 2 */
}

/*
Interactive
===========
*/

/*
Add the correct display in Chrome and Safari.
*/

summary {
	display: list-item;
}/**
 * Manually forked from SUIT CSS Base: https://github.com/suitcss/base
 * A thin layer on top of normalize.css that provides a starting point more
 * suitable for web applications.
 */

/**
 * Removes the default spacing and border for appropriate elements.
 */

blockquote,
dl,
dd,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
figure,
p,
pre {
  margin: 0;
}

button {
  background-color: transparent;
  background-image: none;
}

fieldset {
  margin: 0;
  padding: 0;
}

ol,
ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/**
 * Tailwind custom reset styles
 */

/**
 * 1. Use the user's configured \`sans\` font-family (with Tailwind's default
 *    sans-serif font stack as a fallback) as a sane default.
 * 2. Use Tailwind's default "normal" line-height so the user isn't forced
 *    to override it to ensure consistency even when using the default theme.
 */

html {
  font-family: Gordita, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; /* 1 */
  line-height: 1.5; /* 2 */
}


/**
 * Inherit font-family and line-height from \`html\` so users can set them as
 * a class directly on the \`html\` element.
 */

body {
  font-family: inherit;
  line-height: inherit;
}

/**
 * 1. Prevent padding and border from affecting element width.
 *
 *    We used to set this in the html element and inherit from
 *    the parent element for everything else. This caused issues
 *    in shadow-dom-enhanced elements like <details> where the content
 *    is wrapped by a div with box-sizing set to \`content-box\`.
 *
 *    https://github.com/mozdevs/cssremedy/issues/4
 *
 *
 * 2. Allow adding a border to an element by just adding a border-width.
 *
 *    By default, the way the browser specifies that an element should have no
 *    border is by setting it's border-style to \`none\` in the user-agent
 *    stylesheet.
 *
 *    In order to easily add borders to elements by just setting the \`border-width\`
 *    property, we change the default border-style for all elements to \`solid\`, and
 *    use border-width to hide them instead. This way our \`border\` utilities only
 *    need to set the \`border-width\` property instead of the entire \`border\`
 *    shorthand, making our border utilities much more straightforward to compose.
 *
 *    https://github.com/tailwindcss/tailwindcss/pull/116
 */

*,
::before,
::after {
  box-sizing: border-box; /* 1 */
  border-width: 0; /* 2 */
  border-style: solid; /* 2 */
  border-color: currentColor; /* 2 */
}

/*
 * Ensure horizontal rules are visible by default
 */

hr {
  border-top-width: 1px;
}

/**
 * Undo the \`border-style: none\` reset that Normalize applies to images so that
 * our \`border-{width}\` utilities have the expected effect.
 *
 * The Normalize reset is unnecessary for us since we default the border-width
 * to 0 on all elements.
 *
 * https://github.com/tailwindcss/tailwindcss/issues/362
 */

img {
  border-style: solid;
}

textarea {
  resize: vertical;
}

input::-moz-placeholder, textarea::-moz-placeholder {
  opacity: 1;
  color: #a1a1aa;
}

input:-ms-input-placeholder, textarea:-ms-input-placeholder {
  opacity: 1;
  color: #a1a1aa;
}

input::placeholder,
textarea::placeholder {
  opacity: 1;
  color: #a1a1aa;
}

button,
[role="button"] {
  cursor: pointer;
}

table {
  border-collapse: collapse;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

/**
 * Reset links to optimize for opt-in styling instead of
 * opt-out.
 */

a {
  color: inherit;
  text-decoration: inherit;
}

/**
 * Reset form element properties that are easy to forget to
 * style explicitly so you don't inadvertently introduce
 * styles that deviate from your design system. These styles
 * supplement a partial reset that is already applied by
 * normalize.css.
 */

button,
input,
optgroup,
select,
textarea {
  padding: 0;
  line-height: inherit;
  color: inherit;
}

/**
 * Use the configured 'mono' font family for elements that
 * are expected to be rendered with a monospace font, falling
 * back to the system monospace stack if there is no configured
 * 'mono' font family.
 */

pre,
code,
kbd,
samp {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/**
 * 1. Make replaced elements \`display: block\` by default as that's
 *    the behavior you want almost all of the time. Inspired by
 *    CSS Remedy, with \`svg\` added as well.
 *
 *    https://github.com/mozdevs/cssremedy/issues/14
 * 
 * 2. Add \`vertical-align: middle\` to align replaced elements more
 *    sensibly by default when overriding \`display\` by adding a
 *    utility like \`inline\`.
 *
 *    This can trigger a poorly considered linting error in some
 *    tools but is included by design.
 * 
 *    https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210
 */

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block; /* 1 */
  vertical-align: middle; /* 2 */
}

/**
 * Constrain images and videos to the parent width and preserve
 * their intrinsic aspect ratio.
 *
 * https://github.com/mozdevs/cssremedy/issues/14
 */

img,
video {
  max-width: 100%;
  height: auto;
}

/**
 * Ensure the default browser behavior of the \`hidden\` attribute.
 */

[hidden] {
  display: none;
}

*, ::before, ::after {
	--tw-translate-x: 0;
	--tw-translate-y: 0;
	--tw-rotate: 0;
	--tw-skew-x: 0;
	--tw-skew-y: 0;
	--tw-scale-x: 1;
	--tw-scale-y: 1;
	--tw-transform: translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
	--tw-border-opacity: 1;
	border-color: rgba(228, 228, 231, var(--tw-border-opacity));
	--tw-ring-offset-shadow: 0 0 #0000;
	--tw-ring-shadow: 0 0 #0000;
	--tw-shadow: 0 0 #0000;
	--tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);
	--tw-ring-offset-width: 0px;
	--tw-ring-offset-color: #fff;
	--tw-ring-color: rgba(59, 130, 246, 0.5);
	--tw-ring-offset-shadow: 0 0 #0000;
	--tw-ring-shadow: 0 0 #0000;
	--tw-shadow: 0 0 #0000;
}

[type='text'],[type='email'],[type='url'],[type='password'],[type='number'],[type='date'],[type='datetime-local'],[type='month'],[type='search'],[type='tel'],[type='time'],[type='week'],[multiple],textarea,select {
	-webkit-appearance: none;
	   -moz-appearance: none;
	        appearance: none;
	background-color: #fff;
	border-color: #71717a;
	border-width: 1px;
	border-radius: 0px;
	padding-top: 0.5rem;
	padding-right: 0.75rem;
	padding-bottom: 0.5rem;
	padding-left: 0.75rem;
	font-size: 1rem;
	line-height: 1.5rem;
}

[type='text']:focus, [type='email']:focus, [type='url']:focus, [type='password']:focus, [type='number']:focus, [type='date']:focus, [type='datetime-local']:focus, [type='month']:focus, [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='week']:focus, [multiple]:focus, textarea:focus, select:focus {
	outline: 2px solid transparent;
	outline-offset: 2px;
	--tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);
	--tw-ring-offset-width: 0px;
	--tw-ring-offset-color: #fff;
	--tw-ring-color: #2563eb;
	--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
	--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
	box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
	border-color: #2563eb;
}

input::-moz-placeholder, textarea::-moz-placeholder {
	color: #71717a;
	opacity: 1;
}

input:-ms-input-placeholder, textarea:-ms-input-placeholder {
	color: #71717a;
	opacity: 1;
}

input::placeholder,textarea::placeholder {
	color: #71717a;
	opacity: 1;
}

::-webkit-datetime-edit-fields-wrapper {
	padding: 0;
}

::-webkit-date-and-time-value {
	min-height: 1.5em;
}

select {
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2371717a' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
	background-position: right 0.5rem center;
	background-repeat: no-repeat;
	background-size: 1.5em 1.5em;
	padding-right: 2.5rem;
	-webkit-print-color-adjust: exact;
	        color-adjust: exact;
}

[multiple] {
	background-image: initial;
	background-position: initial;
	background-repeat: unset;
	background-size: initial;
	padding-right: 0.75rem;
	-webkit-print-color-adjust: unset;
	        color-adjust: unset;
}

[type='checkbox'],[type='radio'] {
	-webkit-appearance: none;
	   -moz-appearance: none;
	        appearance: none;
	padding: 0;
	-webkit-print-color-adjust: exact;
	        color-adjust: exact;
	display: inline-block;
	vertical-align: middle;
	background-origin: border-box;
	-webkit-user-select: none;
	   -moz-user-select: none;
	    -ms-user-select: none;
	        user-select: none;
	flex-shrink: 0;
	height: 1rem;
	width: 1rem;
	color: #2563eb;
	background-color: #fff;
	border-color: #71717a;
	border-width: 1px;
}

[type='checkbox'] {
	border-radius: 0px;
}

[type='radio'] {
	border-radius: 100%;
}

[type='checkbox']:focus,[type='radio']:focus {
	outline: 2px solid transparent;
	outline-offset: 2px;
	--tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);
	--tw-ring-offset-width: 2px;
	--tw-ring-offset-color: #fff;
	--tw-ring-color: #2563eb;
	--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
	--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);
	box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}

[type='checkbox']:checked,[type='radio']:checked {
	border-color: transparent;
	background-color: currentColor;
	background-size: 100% 100%;
	background-position: center;
	background-repeat: no-repeat;
}

[type='checkbox']:checked {
	background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
}

[type='radio']:checked {
	background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");
}

[type='checkbox']:checked:hover,[type='checkbox']:checked:focus,[type='radio']:checked:hover,[type='radio']:checked:focus {
	border-color: transparent;
	background-color: currentColor;
}

[type='checkbox']:indeterminate {
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");
	border-color: transparent;
	background-color: currentColor;
	background-size: 100% 100%;
	background-position: center;
	background-repeat: no-repeat;
}

[type='checkbox']:indeterminate:hover,[type='checkbox']:indeterminate:focus {
	border-color: transparent;
	background-color: currentColor;
}

[type='file'] {
	background: unset;
	border-color: inherit;
	border-width: 0;
	border-radius: 0;
	padding: 0;
	font-size: unset;
	line-height: inherit;
}

[type='file']:focus {
	outline: 1px auto -webkit-focus-ring-color;
}\r
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}\r
.pointer-events-none {
	pointer-events: none;
}\r
.visible {
	visibility: visible;
}\r
.fixed {
	position: fixed;
}\r
.absolute {
	position: absolute;
}\r
.relative {
	position: relative;
}\r
.bottom-10 {
	bottom: 2.5rem;
}\r
.left-10 {
	left: 2.5rem;
}\r
.right-10 {
	right: 2.5rem;
}\r
.top-1 {
	top: 0.25rem;
}\r
.right-1 {
	right: 0.25rem;
}\r
.top-\\[7px\\] {
	top: 7px;
}\r
.left-\\[2px\\] {
	left: 2px;
}\r
.top-\\[53px\\] {
	top: 53px;
}\r
.right-\\[10px\\] {
	right: 10px;
}\r
.z-10 {
	z-index: 10;
}\r
.z-40 {
	z-index: 40;
}\r
.col-span-3 {
	grid-column: span 3 / span 3;
}\r
.col-start-2 {
	grid-column-start: 2;
}\r
.row-start-1 {
	grid-row-start: 1;
}\r
.row-start-3 {
	grid-row-start: 3;
}\r
.row-start-2 {
	grid-row-start: 2;
}\r
.row-start-4 {
	grid-row-start: 4;
}\r
.row-end-3 {
	grid-row-end: 3;
}\r
.m-0 {
	margin: 0px;
}\r
.mx-auto {
	margin-left: auto;
	margin-right: auto;
}\r
.-mb-1 {
	margin-bottom: -0.25rem;
}\r
.ml-4 {
	margin-left: 1rem;
}\r
.-mb-0\\.5 {
	margin-bottom: -0.125rem;
}\r
.-mb-0 {
	margin-bottom: 0px;
}\r
.mt-1 {
	margin-top: 0.25rem;
}\r
.mr-auto {
	margin-right: auto;
}\r
.mr-\\[10px\\] {
	margin-right: 10px;
}\r
.mt-2 {
	margin-top: 0.5rem;
}\r
.mt-4 {
	margin-top: 1rem;
}\r
.block {
	display: block;
}\r
.inline-block {
	display: inline-block;
}\r
.flex {
	display: flex;
}\r
.inline-flex {
	display: inline-flex;
}\r
.grid {
	display: grid;
}\r
.hidden {
	display: none;
}\r
.h-6 {
	height: 1.5rem;
}\r
.h-full {
	height: 100%;
}\r
.h-\\[28px\\] {
	height: 28px;
}\r
.h-4 {
	height: 1rem;
}\r
.h-5 {
	height: 1.25rem;
}\r
.h-screen {
	height: 100vh;
}\r
.h-\\[22px\\] {
	height: 22px;
}\r
.max-h-screen {
	max-height: 100vh;
}\r
.w-full {
	width: 100%;
}\r
.w-0 {
	width: 0px;
}\r
.w-8 {
	width: 2rem;
}\r
.w-\\[fit-content\\] {
	width: -webkit-fit-content;
	width: -moz-fit-content;
	width: fit-content;
}\r
.w-6 {
	width: 1.5rem;
}\r
.w-\\[22px\\] {
	width: 22px;
}\r
.max-w-2xl {
	max-width: 42rem;
}\r
.max-w-sm {
	max-width: 24rem;
}\r
.flex-1 {
	flex: 1 1 0%;
}\r
.transform {
	transform: var(--tw-transform);
}\r
@-webkit-keyframes pulse {

	50% {
		opacity: .5;
	}
}\r
@keyframes pulse {

	50% {
		opacity: .5;
	}
}\r
.animate-pulse {
	-webkit-animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
	        animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}\r
.cursor-pointer {
	cursor: pointer;
}\r
.resize {
	resize: both;
}\r
.list-none {
	list-style-type: none;
}\r
.grid-cols-1 {
	grid-template-columns: repeat(1, minmax(0, 1fr));
}\r
.flex-row {
	flex-direction: row;
}\r
.flex-col {
	flex-direction: column;
}\r
.flex-wrap {
	flex-wrap: wrap;
}\r
.items-start {
	align-items: flex-start;
}\r
.items-center {
	align-items: center;
}\r
.justify-end {
	justify-content: flex-end;
}\r
.justify-center {
	justify-content: center;
}\r
.justify-between {
	justify-content: space-between;
}\r
.space-x-2 > :not([hidden]) ~ :not([hidden]) {
	--tw-space-x-reverse: 0;
	margin-right: calc(0.5rem * var(--tw-space-x-reverse));
	margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
}\r
.space-y-1 > :not([hidden]) ~ :not([hidden]) {
	--tw-space-y-reverse: 0;
	margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));
	margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
}\r
.space-x-4 > :not([hidden]) ~ :not([hidden]) {
	--tw-space-x-reverse: 0;
	margin-right: calc(1rem * var(--tw-space-x-reverse));
	margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
}\r
.divide-y > :not([hidden]) ~ :not([hidden]) {
	--tw-divide-y-reverse: 0;
	border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
	border-bottom-width: calc(1px * var(--tw-divide-y-reverse));
}\r
.divide-y-2 > :not([hidden]) ~ :not([hidden]) {
	--tw-divide-y-reverse: 0;
	border-top-width: calc(2px * calc(1 - var(--tw-divide-y-reverse)));
	border-bottom-width: calc(2px * var(--tw-divide-y-reverse));
}\r
.divide-blueGray-200 > :not([hidden]) ~ :not([hidden]) {
	--tw-divide-opacity: 1;
	border-color: rgba(226, 232, 240, var(--tw-divide-opacity));
}\r
.overflow-auto {
	overflow: auto;
}\r
.overflow-hidden {
	overflow: hidden;
}\r
.whitespace-pre-line {
	white-space: pre-line;
}\r
.whitespace-pre-wrap {
	white-space: pre-wrap;
}\r
.rounded {
	border-radius: 0.25rem;
}\r
.rounded-lg {
	border-radius: 0.5rem;
}\r
.rounded-none {
	border-radius: 0px;
}\r
.border {
	border-width: 1px;
}\r
.border-0 {
	border-width: 0px;
}\r
.border-t-2 {
	border-top-width: 2px;
}\r
.border-b-2 {
	border-bottom-width: 2px;
}\r
.border-l {
	border-left-width: 1px;
}\r
.border-r {
	border-right-width: 1px;
}\r
.border-solid {
	border-style: solid;
}\r
.border-red-400 {
	--tw-border-opacity: 1;
	border-color: rgba(248, 113, 113, var(--tw-border-opacity));
}\r
.border-blueGray-200 {
	--tw-border-opacity: 1;
	border-color: rgba(226, 232, 240, var(--tw-border-opacity));
}\r
.border-transparent {
	border-color: transparent;
}\r
.border-brand-default {
	--tw-border-opacity: 1;
	border-color: rgba(44, 79, 124, var(--tw-border-opacity));
}\r
.border-white {
	--tw-border-opacity: 1;
	border-color: rgba(255, 255, 255, var(--tw-border-opacity));
}\r
.border-blue-400 {
	--tw-border-opacity: 1;
	border-color: rgba(96, 165, 250, var(--tw-border-opacity));
}\r
.border-opacity-5 {
	--tw-border-opacity: 0.05;
}\r
.border-opacity-90 {
	--tw-border-opacity: 0.9;
}\r
.bg-red-200 {
	--tw-bg-opacity: 1;
	background-color: rgba(254, 202, 202, var(--tw-bg-opacity));
}\r
.bg-blueGray-50 {
	--tw-bg-opacity: 1;
	background-color: rgba(248, 250, 252, var(--tw-bg-opacity));
}\r
.bg-transparent {
	background-color: transparent;
}\r
.bg-white {
	--tw-bg-opacity: 1;
	background-color: rgba(255, 255, 255, var(--tw-bg-opacity));
}\r
.bg-blueGray-500 {
	--tw-bg-opacity: 1;
	background-color: rgba(100, 116, 139, var(--tw-bg-opacity));
}\r
.bg-brand-default {
	--tw-bg-opacity: 1;
	background-color: rgba(44, 79, 124, var(--tw-bg-opacity));
}\r
.bg-blue-200 {
	--tw-bg-opacity: 1;
	background-color: rgba(191, 219, 254, var(--tw-bg-opacity));
}\r
.bg-blue-800 {
	--tw-bg-opacity: 1;
	background-color: rgba(30, 64, 175, var(--tw-bg-opacity));
}\r
.bg-opacity-0 {
	--tw-bg-opacity: 0;
}\r
.bg-none {
	background-image: none;
}\r
.fill-current {
	fill: currentColor;
}\r
.p-2 {
	padding: 0.5rem;
}\r
.p-0 {
	padding: 0px;
}\r
.p-5 {
	padding: 1.25rem;
}\r
.p-1 {
	padding: 0.25rem;
}\r
.px-6 {
	padding-left: 1.5rem;
	padding-right: 1.5rem;
}\r
.py-4 {
	padding-top: 1rem;
	padding-bottom: 1rem;
}\r
.px-2 {
	padding-left: 0.5rem;
	padding-right: 0.5rem;
}\r
.py-3 {
	padding-top: 0.75rem;
	padding-bottom: 0.75rem;
}\r
.py-1 {
	padding-top: 0.25rem;
	padding-bottom: 0.25rem;
}\r
.py-2 {
	padding-top: 0.5rem;
	padding-bottom: 0.5rem;
}\r
.px-3 {
	padding-left: 0.75rem;
	padding-right: 0.75rem;
}\r
.px-\\[1\\.63px\\] {
	padding-left: 1.63px;
	padding-right: 1.63px;
}\r
.py-0 {
	padding-top: 0px;
	padding-bottom: 0px;
}\r
.text-left {
	text-align: left;
}\r
.font-sans {
	font-family: Gordita, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}\r
.text-xs {
	font-size: 0.75rem;
	line-height: 1rem;
}\r
.text-xl {
	font-size: 1.25rem;
	line-height: 1.75rem;
}\r
.text-sm {
	font-size: 0.875rem;
	line-height: 1.25rem;
}\r
.font-semibold {
	font-weight: 600;
}\r
.uppercase {
	text-transform: uppercase;
}\r
.leading-none {
	line-height: 1;
}\r
.leading-snug {
	line-height: 1.375;
}\r
.tracking-widest {
	letter-spacing: 0.1em;
}\r
.tracking-wide {
	letter-spacing: 0.025em;
}\r
.text-red-800 {
	--tw-text-opacity: 1;
	color: rgba(153, 27, 27, var(--tw-text-opacity));
}\r
.text-blueGray-600 {
	--tw-text-opacity: 1;
	color: rgba(71, 85, 105, var(--tw-text-opacity));
}\r
.text-blue-700 {
	--tw-text-opacity: 1;
	color: rgba(29, 78, 216, var(--tw-text-opacity));
}\r
.text-red-700 {
	--tw-text-opacity: 1;
	color: rgba(185, 28, 28, var(--tw-text-opacity));
}\r
.text-blueGray-900 {
	--tw-text-opacity: 1;
	color: rgba(15, 23, 42, var(--tw-text-opacity));
}\r
.text-brand-default {
	--tw-text-opacity: 1;
	color: rgba(44, 79, 124, var(--tw-text-opacity));
}\r
.text-blueGray-400 {
	--tw-text-opacity: 1;
	color: rgba(148, 163, 184, var(--tw-text-opacity));
}\r
.text-green-900 {
	--tw-text-opacity: 1;
	color: rgba(20, 83, 45, var(--tw-text-opacity));
}\r
.text-white {
	--tw-text-opacity: 1;
	color: rgba(255, 255, 255, var(--tw-text-opacity));
}\r
.text-black {
	--tw-text-opacity: 1;
	color: rgba(0, 0, 0, var(--tw-text-opacity));
}\r
.text-green-100 {
	--tw-text-opacity: 1;
	color: rgba(220, 252, 231, var(--tw-text-opacity));
}\r
.text-blue-200 {
	--tw-text-opacity: 1;
	color: rgba(191, 219, 254, var(--tw-text-opacity));
}\r
.opacity-60 {
	opacity: 0.6;
}\r
.opacity-80 {
	opacity: 0.8;
}\r
.shadow {
	--tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
	box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}\r
.shadow-md {
	--tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}\r
.outline-none {
	outline: 2px solid transparent;
	outline-offset: 2px;
}\r
\r
@font-face {\r
  font-family: 'Gordita';\r
  src: url('__VITE_ASSET__95e99928__') format('woff');\r
  font-weight: normal;\r
  font-style: normal;\r
}\r
\r
@font-face {\r
  font-family: 'Gordita';\r
  src: url('__VITE_ASSET__958a9bd0__') format('woff');\r
  font-weight: bold;\r
  font-style: normal;\r
}\r
\r
div[contenteditable='true']:focus {\r
  outline: none !important;\r
}\r
\r
.wrapper,\r
.wrapper--forced {\r
  grid-template-rows: auto minmax(0, 1fr) auto minmax(0, 1fr);\r
  grid-template-columns: 1fr;\r
}\r
\r
.column-resizer {
	position: relative;
	z-index: 50;
}\r
\r
.column-resizer:hover::after {\r
  content: '';\r
  position: absolute;\r
  top: 0px;\r
  left: -6px;\r
  right: -6px;\r
  height: 100%;\r
  --tw-bg-opacity: 1;\r
  background-color: rgba(44, 79, 124, var(--tw-bg-opacity));\r
}\r
\r
@media (min-width: 768px) {\r
  .wrapper {\r
    --left: minmax(0, 1fr);\r
    --right: minmax(0, 1fr);\r
\r
    grid-template-rows: auto minmax(0, 1fr);\r
    grid-template-columns: minmax(0, var(--left)) 2px minmax(0, var(--right));\r
  }\r
}\r
\r
.tabs {
	position: relative;
}\r
\r
.tabs::after {\r
  content: '';\r
  height: 2px;\r
  position: absolute;\r
  left: 0px;\r
  bottom: 0px;\r
  z-index: 0;\r
  width: 100%;\r
  --tw-bg-opacity: 1;\r
  background-color: rgba(226, 232, 240, var(--tw-bg-opacity));\r
}\r
\r
.dark .tabs::after {
	--tw-bg-opacity: 1;
	background-color: rgba(51, 65, 85, var(--tw-bg-opacity));
}\r
\r
textarea.monaco-mouse-cursor-text:focus {\r
  box-shadow: unset;\r
}\r
\r
.hover\\:border-white:hover {
	--tw-border-opacity: 1;
	border-color: rgba(255, 255, 255, var(--tw-border-opacity));
}\r
\r
.hover\\:border-opacity-100:hover {
	--tw-border-opacity: 1;
}\r
\r
.hover\\:border-opacity-10:hover {
	--tw-border-opacity: 0.1;
}\r
\r
.hover\\:bg-gray-300:hover {
	--tw-bg-opacity: 1;
	background-color: rgba(212, 212, 216, var(--tw-bg-opacity));
}\r
\r
.hover\\:bg-blue-900:hover {
	--tw-bg-opacity: 1;
	background-color: rgba(30, 58, 138, var(--tw-bg-opacity));
}\r
\r
.hover\\:bg-opacity-5:hover {
	--tw-bg-opacity: 0.05;
}\r
\r
.hover\\:text-red-900:hover {
	--tw-text-opacity: 1;
	color: rgba(127, 29, 29, var(--tw-text-opacity));
}\r
\r
.hover\\:text-blueGray-800:hover {
	--tw-text-opacity: 1;
	color: rgba(30, 41, 59, var(--tw-text-opacity));
}\r
\r
.hover\\:text-blue-900:hover {
	--tw-text-opacity: 1;
	color: rgba(30, 58, 138, var(--tw-text-opacity));
}\r
\r
.hover\\:opacity-100:hover {
	opacity: 1;
}\r
\r
.focus\\:outline-none:focus {
	outline: 2px solid transparent;
	outline-offset: 2px;
}\r
\r
.focus\\:ring-1:focus {
	--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
	--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
	box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}\r
\r
.focus\\:ring-0:focus {
	--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
	--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);
	box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}\r
\r
@-webkit-keyframes spin {

	to {
		transform: rotate(360deg);
	}
}\r
\r
@keyframes spin {

	to {
		transform: rotate(360deg);
	}
}\r
\r
.active\\:animate-spin:active {
	-webkit-animation: spin 1s linear infinite;
	        animation: spin 1s linear infinite;
}\r
\r
.active\\:bg-gray-300:active {
	--tw-bg-opacity: 1;
	background-color: rgba(212, 212, 216, var(--tw-bg-opacity));
}\r
\r
.active\\:outline-none:active {
	outline: 2px solid transparent;
	outline-offset: 2px;
}\r
\r
.disabled\\:cursor-not-allowed:disabled {
	cursor: not-allowed;
}\r
\r
.disabled\\:opacity-25:disabled {
	opacity: 0.25;
}\r
\r
.dark .dark\\:divide-blueGray-500 > :not([hidden]) ~ :not([hidden]) {
	--tw-divide-opacity: 1;
	border-color: rgba(100, 116, 139, var(--tw-divide-opacity));
}\r
\r
.dark .dark\\:border-blueGray-700 {
	--tw-border-opacity: 1;
	border-color: rgba(51, 65, 85, var(--tw-border-opacity));
}\r
\r
.dark .dark\\:border-gray-200 {
	--tw-border-opacity: 1;
	border-color: rgba(228, 228, 231, var(--tw-border-opacity));
}\r
\r
.dark .dark\\:border-opacity-5 {
	--tw-border-opacity: 0.05;
}\r
\r
.dark .dark\\:border-opacity-90 {
	--tw-border-opacity: 0.9;
}\r
\r
.dark .dark\\:bg-other {
	--tw-bg-opacity: 1;
	background-color: rgba(30, 30, 30, var(--tw-bg-opacity));
}\r
\r
.dark .dark\\:bg-blueGray-800 {
	--tw-bg-opacity: 1;
	background-color: rgba(30, 41, 59, var(--tw-bg-opacity));
}\r
\r
.dark .dark\\:text-gray-300 {
	--tw-text-opacity: 1;
	color: rgba(212, 212, 216, var(--tw-text-opacity));
}\r
\r
.dark .dark\\:text-blueGray-50 {
	--tw-text-opacity: 1;
	color: rgba(248, 250, 252, var(--tw-text-opacity));
}\r
\r
.dark .dark\\:text-white {
	--tw-text-opacity: 1;
	color: rgba(255, 255, 255, var(--tw-text-opacity));
}\r
\r
.dark .dark\\:hover\\:border-opacity-10:hover {
	--tw-border-opacity: 0.1;
}\r
\r
@media (min-width: 768px) {

	.md\\:sr-only {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border-width: 0;
	}

	.md\\:col-span-2 {
		grid-column: span 2 / span 2;
	}

	.md\\:col-span-3 {
		grid-column: span 3 / span 3;
	}

	.md\\:col-start-3 {
		grid-column-start: 3;
	}

	.md\\:row-start-1 {
		grid-row-start: 1;
	}

	.md\\:row-start-2 {
		grid-row-start: 2;
	}

	.md\\:-mb-0\\.5 {
		margin-bottom: -0.125rem;
	}

	.md\\:-mb-0 {
		margin-bottom: 0px;
	}

	.md\\:block {
		display: block;
	}

	.md\\:flex {
		display: flex;
	}

	.md\\:hidden {
		display: none;
	}

	.md\\:flex-row {
		flex-direction: row;
	}

	.md\\:items-center {
		align-items: center;
	}

	.md\\:space-x-2 > :not([hidden]) ~ :not([hidden]) {
		--tw-space-x-reverse: 0;
		margin-right: calc(0.5rem * var(--tw-space-x-reverse));
		margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse)));
	}

	.md\\:border-t-0 {
		border-top-width: 0px;
	}

	.md\\:px-3 {
		padding-left: 0.75rem;
		padding-right: 0.75rem;
	}

	.md\\:text-sm {
		font-size: 0.875rem;
		line-height: 1.25rem;
	}

	.md\\:leading-tight {
		line-height: 1.25;
	}

	.md\\:text-white {
		--tw-text-opacity: 1;
		color: rgba(255, 255, 255, var(--tw-text-opacity));
	}
}\r
`;
const _tmpl$$5 = template(`<svg viewBox="0 0 24 24"></svg>`, 2);
const Icon = (props) => {
  const [internal, external] = splitProps(props, ["path"]);
  return (() => {
    const _el$ = _tmpl$$5.cloneNode(true);
    spread(_el$, external, true, false);
    effect((_p$) => {
      const _v$ = internal.path.outline ? "none" : "currentColor", _v$2 = internal.path.outline ? "currentColor" : "none", _v$3 = internal.path.path;
      _v$ !== _p$._v$ && _el$.style.setProperty("fill", _p$._v$ = _v$);
      _v$2 !== _p$._v$2 && _el$.style.setProperty("stroke", _p$._v$2 = _v$2);
      _v$3 !== _p$._v$3 && (_el$.innerHTML = _p$._v$3 = _v$3);
      return _p$;
    }, {
      _v$: void 0,
      _v$2: void 0,
      _v$3: void 0
    });
    return _el$;
  })();
};
const checkCircle = { path: `<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>`, outline: true };
const clipboardCheck = { path: `<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"/>`, outline: true };
const clipboard = { path: `<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"/>`, outline: true };
const code = { path: `<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"/>`, outline: true };
const refresh = { path: `<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"/>`, outline: true };
const x = { path: `<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>`, outline: true };
const chevronDown = { path: `<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"/>`, outline: false };
const chevronRight = { path: `<path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd"/>`, outline: false };
const _tmpl$$4 = template(`<ul class="text-xs overflow-auto px-2 divide-y"></ul>`, 2), _tmpl$2$1 = template(`<div style="grid-template-rows: 1fr auto"><iframe title="Solid REPL" class="overflow-auto p-2 w-full h-full dark:bg-other" sandbox="allow-popups-to-escape-sandbox allow-scripts allow-popups allow-forms allow-pointer-lock allow-top-navigation allow-modals allow-same-origin"></iframe><div class="grid border-t-2 border-blueGray-200 dark:border-blueGray-700 border-solid dark:bg-blueGray-800 text-blueGray-600 dark:text-gray-300"><div class="flex justify-between items-start w-full"><button type="button" class="relative text-left font-semibold uppercase text-xs md:text-sm px-2 py-3 focus:outline-none -mb-1 md:-mb-0.5 leading-none md:leading-tight"><span class="ml-4">Console (<!>)</span></button><button type="button" class="uppercase text-xs md:text-sm px-2 py-3 focus:outline-none -mb-1 md:-mb-0.5 leading-none md:leading-tight hover:text-blueGray-800">Clear</button></div></div></div>`, 15), _tmpl$3$1 = template(`<li class="py-1"><code class="whitespace-pre-wrap"></code></li>`, 4);
const Preview = (props) => {
  const [internal, external] = splitProps(props, ["code", "class", "reloadSignal"]);
  let iframe;
  const [showLogs, setShowLogs] = createSignal(false);
  const [logs, setLogs] = createSignal([]);
  const [isIframeReady, setIframeReady] = createSignal(false);
  let latestCode;
  const CODE_UPDATE = "CODE_UPDATE";
  createEffect(() => {
    const isNotDom = internal.code.includes("getNextElement") || internal.code.includes("getHydrationKey");
    const isEmpty = !internal.code;
    if (isNotDom || isEmpty || !isIframeReady())
      return;
    setLogs([]);
    latestCode = internal.code.replace("render(", "window.dispose = render(");
    iframe.contentWindow.postMessage({
      event: CODE_UPDATE,
      code: latestCode
    }, "*");
  });
  createEffect(() => {
    if (!internal.reloadSignal)
      return;
    setIframeReady(false);
    iframe.contentWindow.postMessage({
      event: "RELOAD"
    }, "*");
  });
  function attachToIframe() {
    setIframeReady(true);
    iframe.contentWindow.addEventListener("message", ({
      data
    }) => {
      if (data.event === "LOG") {
        const {
          level,
          args
        } = data;
        setLogs([...logs(), {
          level,
          args
        }]);
      }
      if (data.event === "RELOADED") {
        setLogs([]);
        iframe.contentWindow.postMessage({
          event: CODE_UPDATE,
          code: latestCode
        }, "*");
      }
    });
  }
  const html = `
    <!doctype html>
    <html>
      <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />

        <!-- Ressource hints -->
        <link rel="dns-prefetch" href="//unpkg.com">
        <link href="https://unpkg.com" rel="preconnect" crossorigin>
        <link rel="preload" href="https://unpkg.com/modern-normalize@1.1.0/modern-normalize.css" as="style">
        <link href="https://unpkg.com/modern-normalize@1.1.0/modern-normalize.css" rel="stylesheet">

        <style>
          html, body {
            position: relative;
            width: 100%;
            height: 100%;
          }

          body {
            color: #333;
            margin: 0;
            padding: 8px;
            box-sizing: border-box;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
            max-width: 100%;
          }

          input, button, select, textarea {
            padding: 0.4em;
            margin: 0 0 0.5em 0;
            box-sizing: border-box;
            border: 1px solid #ccc;
            border-radius: 2px;
          }

          button {
            color: #333;
            background-color: #f4f4f4;
            outline: none;
          }

          button:disabled {
            color: #999;
          }

          button:not(:disabled):active {
            background-color: #ddd;
          }

          button:focus {
            border-color: #666;
          }
		    </style>

        <script type="module" id="setup">
          const url = new URL(location.href);
          const fakeConsole = {};

          function formatArgs(args) {
            return args
              .map((arg) => {
                if (arg instanceof Element) {
                  return arg.outerHTML;
                }

                return typeof arg === 'object' 
                  ? JSON.stringify(arg, null, 2)
                  : '"' + String(arg) + '"';
              })
              .join(' ')
          }

          
          for (const level of ['log', 'error', 'warn']) {
            fakeConsole[level] = console[level];

            console[level] = (...args) => {
              fakeConsole[level](...args);
              window.postMessage({ event: 'LOG', level, args: formatArgs(args) }, '*');
            }
          }

          window.addEventListener('message', ({ data }) => {
            try {
              const { event, code } = data;

              if (event === 'RELOAD') {
                url.searchParams.set('reload', '1');
                return location.href = url.toString(); 
              }

              if (event !== 'CODE_UPDATE') return;

              window?.dispose?.();
              window.dispose = undefined;

              let app = document.getElementById('app');
              if (app) {
                app.remove();
                app = document.createElement('div');
                app.id = 'app';
                document.body.prepend(app);
              }

              const encodedCode = encodeURIComponent(code);
              const dataUri = 'data:text/javascript;charset=utf-8,' + encodedCode;
              import(dataUri);
  
              const load = document.getElementById('load');
              if (code && load) load.remove();
            } catch (e) {
              console.error(e)
            }
          })
              
          if (url.searchParams.get('reload')) {
            window.postMessage({ event: 'RELOADED' }, '*');
          }
        <\/script>
      </head>
      
      <body>
        <div id="load" style="display: flex; height: 80vh; align-items: center; justify-content: center;">
          <p style="font-size: 1.5rem">Loading the playground...</p>
        </div>
        <div id="app"></div>
      </body>
    </html>
  `;
  return (() => {
    const _el$ = _tmpl$2$1.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$9 = _el$7.nextSibling;
    _el$9.nextSibling;
    const _el$10 = _el$5.nextSibling;
    spread(_el$, external, false, true);
    _el$2.addEventListener("load", attachToIframe);
    const _ref$ = iframe;
    typeof _ref$ === "function" ? _ref$(_el$2) : iframe = _el$2;
    setAttribute(_el$2, "srcdoc", html);
    _el$5.$$click = () => setShowLogs(!showLogs());
    insert(_el$5, createComponent(Icon, {
      "class": "h-[28px] absolute top-[7px] left-[2px]",
      get path() {
        return showLogs() ? chevronDown : chevronRight;
      }
    }), _el$6);
    insert(_el$6, () => logs().length, _el$9);
    _el$10.$$click = setLogs;
    _el$10.$$clickData = [];
    insert(_el$3, createComponent(Show, {
      get when() {
        return showLogs();
      },
      get children() {
        const _el$11 = _tmpl$$4.cloneNode(true);
        insert(_el$11, createComponent(For, {
          get each() {
            return logs();
          },
          children: (log) => (() => {
            const _el$12 = _tmpl$3$1.cloneNode(true), _el$13 = _el$12.firstChild;
            insert(_el$13, () => log.args);
            effect((_p$) => {
              const _v$3 = log.level === "log", _v$4 = log.level === "warn", _v$5 = log.level === "error";
              _v$3 !== _p$._v$3 && _el$12.classList.toggle("text-blue-700", _p$._v$3 = _v$3);
              _v$4 !== _p$._v$4 && _el$12.classList.toggle("text-yello-700", _p$._v$4 = _v$4);
              _v$5 !== _p$._v$5 && _el$12.classList.toggle("text-red-700", _p$._v$5 = _v$5);
              return _p$;
            }, {
              _v$3: void 0,
              _v$4: void 0,
              _v$5: void 0
            });
            return _el$12;
          })()
        }));
        return _el$11;
      }
    }), null);
    effect((_p$) => {
      const _v$ = `grid relative ${internal.class}`, _v$2 = `1fr ${showLogs() ? "minmax(auto, 20vh)" : "0px"}`;
      _v$ !== _p$._v$ && (_el$.className = _p$._v$ = _v$);
      _v$2 !== _p$._v$2 && _el$3.style.setProperty("grid-template-rows", _p$._v$2 = _v$2);
      return _p$;
    }, {
      _v$: void 0,
      _v$2: void 0
    });
    return _el$;
  })();
};
delegateEvents(["click"]);
const _tmpl$$3 = template(`<li></li>`, 2);
const TabItem = (props) => {
  return (() => {
    const _el$ = _tmpl$$3.cloneNode(true);
    insert(_el$, () => props.children);
    effect((_p$) => {
      const _v$ = `relative z-10 inline-flex text-sm font-sans leading-snug items-center bg-blueGray-500 bg-opacity-0 hover:bg-opacity-5 overflow-hidden space-x-2 border-solid border-brand-default dark:border-gray-200 border-opacity-5 dark:border-opacity-5 border-b-2 ${props.class || ""}`, _v$2 = {
        "border-opacity-90 dark:border-opacity-90 hover:border-opacity-100": props.active || false,
        "hover:border-opacity-10 dark:hover:border-opacity-10": !props.active
      };
      _v$ !== _p$._v$ && (_el$.className = _p$._v$ = _v$);
      _p$._v$2 = classList(_el$, _v$2, _p$._v$2);
      return _p$;
    }, {
      _v$: void 0,
      _v$2: void 0
    });
    return _el$;
  })();
};
const _tmpl$$2 = template(`<ul></ul>`, 2);
const TabList = (props) => {
  return (() => {
    const _el$ = _tmpl$$2.cloneNode(true);
    insert(_el$, () => props.children);
    effect(() => _el$.className = `flex tabs flex-wrap items-center list-none bg-white dark:bg-blueGray-800 m-0 ${props.class || ""}`);
    return _el$;
  })();
};
const _tmpl$$1 = template(`<pre class="bg-red-200 text-red-800 border border-red-400 rounded shadow px-6 py-4 z-10 max-w-2xl whitespace-pre-line"><button title="close" type="button" class="absolute top-1 right-1 hover:text-red-900"></button><code></code></pre>`, 6);
const Error = (props) => {
  const mount = document.getElementById("error");
  return createComponent(Portal, {
    mount,
    get children() {
      const _el$ = _tmpl$$1.cloneNode(true), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
      addEventListener(_el$2, "click", props.onDismiss, true);
      insert(_el$2, createComponent(Icon, {
        path: x,
        "class": "h-6 "
      }));
      effect(() => _el$3.innerText = props.message);
      return _el$;
    }
  });
};
delegateEvents(["click"]);
function debounce(callback, wait) {
  let timeout;
  return (...args) => {
    clearTimeout(timeout);
    timeout = window.setTimeout(() => callback(...args), wait);
  };
}
const throttle = (fn, wait) => {
  let previouslyRun;
  let queuedToRun;
  return function invokeFn(...args) {
    const now = Date.now();
    clearTimeout(queuedToRun);
    queuedToRun = void 0;
    if (!previouslyRun || now - previouslyRun >= wait) {
      fn(...args);
      previouslyRun = now;
    } else {
      queuedToRun = window.setTimeout(() => invokeFn(...args), wait - (now - previouslyRun));
    }
  };
};
function formatMs(ms) {
  return `${ms}ms`;
}
const keyedMap = (props) => {
  const key = props.by;
  const mapFn = props.children;
  const disposers = new Map();
  let prev = new Map();
  onCleanup(() => {
    for (const disposer of disposers.values())
      disposer();
  });
  return createEffect(() => {
    const list = props.each || [];
    const newNodes = new Map();
    return untrack(() => {
      for (let i = 0; i < list.length; i++) {
        const listItem = list[i];
        const keyValue = key(listItem);
        const lookup = prev.get(keyValue);
        if (!lookup) {
          createRoot((dispose) => {
            disposers.set(keyValue, dispose);
            const item = createSignal(listItem);
            const result = mapFn(item[0]);
            newNodes.set(keyValue, { item, result });
            return result;
          });
        } else {
          lookup.item[1](listItem);
          newNodes.set(keyValue, lookup);
        }
      }
      for (const old of prev.keys()) {
        if (!newNodes.has(old))
          disposers.get(old)();
      }
      prev = newNodes;
    });
  });
};
const MonacoTabs = (props) => {
  const fileUri = Uri.parse(`file:///output_dont_import.tsx`);
  const model = editor.createModel("", "typescript", fileUri);
  createEffect(() => {
    model.setValue(props.compiled.replace(/(https:\/\/cdn.skypack.dev\/)|(@[0-9][0-9.\-a-z]+)/g, ""));
  });
  onCleanup(() => model.dispose());
  keyedMap({
    by: (tab) => `${tab.name}.${tab.type}`,
    get each() {
      return props.tabs;
    },
    children: (tab) => {
      const uri = Uri.parse(`file:///${tab().name}.${tab().type}`);
      const model2 = editor.createModel(tab().source, tab().type === "tsx" ? "typescript" : "css", uri);
      let first = true;
      createEffect(() => {
        const source = tab().source;
        if (!first && model2.getValue() !== source)
          model2.setValue(source);
        else
          first = false;
      });
      onCleanup(() => model2.dispose());
    }
  });
  return [];
};
const _tmpl$ = template(`<li class="inline-flex items-center m-0 border-b-2 border-transparent"><button type="button" class="focus:outline-none" title="Add a new tab"><span class="sr-only">Add a new tab</span><svg viewBox="0 0 24 24" style="stroke: currentColor; fill: none;" class="h-5 text-brand-default dark:text-blueGray-50"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6"></path></svg></button></li>`, 10), _tmpl$2 = template(`<button type="button" title="Refresh the page" class="py-2 px-3 disabled:cursor-not-allowed disabled:opacity-25 active:animate-spin"><span class="sr-only">Refresh the page</span></button>`, 4), _tmpl$3 = template(`<button type="button" class="w-full focus:outline-none -mb-0.5 py-2 px-3">Result</button>`, 2), _tmpl$4 = template(`<button type="button" class="w-full focus:outline-none -mb-0.5 py-2 px-3">Output</button>`, 2), _tmpl$5 = template(`<div class="column-resizer h-full w-full row-start-1 row-end-3 col-start-2 hidden" style="cursor: col-resize"><div class="h-full border-blueGray-200 dark:border-blueGray-700 border-l border-r rounded-lg mx-auto w-0"></div></div>`, 4), _tmpl$6 = template(`<section class="h-full max-h-screen bg-white dark:bg-blueGray-800 grid focus:outline-none row-start-4 relative divide-y-2 divide-blueGray-200 dark:divide-blueGray-500" style="grid-template-rows: minmax(0, 1fr) auto"><div class="bg-white dark:bg-blueGray-800 p-5 hidden md:block"><label class="font-semibold text-sm uppercase">Compile mode</label><div class="mt-1 space-y-1 text-sm"><label class="block mr-auto cursor-pointer space-x-2"><input value="DOM" class="text-brand-default" type="radio" name="dom" id="dom"><span>Client side rendering</span></label><label class="block mr-auto cursor-pointer space-x-2"><input value="SSR" class="text-brand-default" type="radio" name="dom" id="dom"><span>Server side rendering</span></label><label class="block mr-auto cursor-pointer space-x-2"><input value="HYDRATABLE" class="text-brand-default" type="radio" name="dom" id="dom"><span>Client side rendering with hydration</span></label></div></div></section>`, 23), _tmpl$7 = template(`<div class="relative grid bg-blueGray-50 h-full overflow-hidden text-blueGray-900 dark:text-blueGray-50 font-sans"></div>`, 2), _tmpl$8 = template(`<select class="bg-none p-0"><option value="tsx">.tsx</option><option value="css">.css</option></select>`, 6), _tmpl$9 = template(`<button type="button" class="cursor-pointer focus:outline-none -mb-0.5 py-2 px-3"><span class="outline-none"></span></button>`, 4), _tmpl$10 = template(`<button type="button" class="border-0 bg-transparent cursor-pointer focus:outline-none -mb-0.5"><span class="sr-only">Delete this tab</span><svg style="stroke: currentColor; fill: none;" class="h-4 opacity-60" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></button>`, 8), _tmpl$11 = template(`<span>.</span>`, 2), _tmpl$12 = template(`<div class="row-start-2 col-span-3 flex items-center justify-center h-full"><p class="animate-pulse text-xl font-sans">Loading the playground...</p></div>`, 4);
const Editor = lazy(() => import("./index3.js"));
const compileMode = {
  SSR: {
    generate: "ssr",
    hydratable: true
  },
  DOM: {
    generate: "dom",
    hydratable: false
  },
  HYDRATABLE: {
    generate: "dom",
    hydratable: true
  }
};
const id = (tab) => `${tab.name}.${tab.type}`;
const Repl = (props) => {
  const {
    compiler,
    formatter
  } = props;
  let now;
  const tabRefs = new Map();
  const [store, setStore] = createStore({
    error: "",
    compiled: "",
    mode: "DOM",
    isCompiling: false,
    get compileMode() {
      return compileMode[this.mode];
    }
  });
  const actions = {
    resetError: () => setStore("error", ""),
    setCurrentTab: (current) => {
      const idx = props.tabs.findIndex((tab) => id(tab) === current);
      if (idx < 0)
        return;
      props.setCurrent(current);
    },
    setCompiled(compiled) {
      setStore({
        compiled,
        isCompiling: false
      });
    },
    setTabName(id1, name) {
      const idx = props.tabs.findIndex((tab) => id(tab) === id1);
      if (idx < 0)
        return;
      const tabs = props.tabs;
      tabs[idx] = {
        ...tabs[idx],
        name
      };
      batch(() => {
        props.setTabs(tabs);
        if (props.current === id1) {
          props.setCurrent(id(tabs[idx]));
        }
      });
    },
    setTabType(id1, type) {
      const idx = props.tabs.findIndex((tab) => id(tab) === id1);
      if (idx < 0)
        return;
      const tabs = props.tabs;
      tabs[idx] = {
        ...tabs[idx],
        type
      };
      batch(() => {
        props.setTabs(tabs);
        if (props.current === id1) {
          props.setCurrent(id(tabs[idx]));
        }
      });
    },
    removeTab(id1) {
      const tabs = props.tabs;
      const idx = tabs.findIndex((tab2) => id(tab2) === id1);
      const tab = tabs[idx];
      if (!tab)
        return;
      const confirmDeletion = confirm(`Are you sure you want to delete ${tab.name}.${tab.type}?`);
      if (!confirmDeletion)
        return;
      batch(() => {
        props.setTabs([...tabs.slice(0, idx), ...tabs.slice(idx + 1)]);
        if (props.current === id1) {
          props.setCurrent(id(tabs[idx - 1]));
        }
      });
    },
    getCurrentSource() {
      const idx = props.tabs.findIndex((tab) => id(tab) === props.current);
      if (idx < 0)
        return;
      return props.tabs[idx].source;
    },
    setCurrentSource(source) {
      const idx = props.tabs.findIndex((tab) => id(tab) === props.current);
      if (idx < 0)
        return;
      const tabs = props.tabs;
      tabs[idx].source = source;
    },
    addTab() {
      const newTab = {
        name: `tab${props.tabs.length}`,
        type: "tsx",
        source: ""
      };
      batch(() => {
        props.setTabs(props.tabs.concat(newTab));
        props.setCurrent(id(newTab));
      });
    }
  };
  const [edit, setEdit] = createSignal(-1);
  const [showPreview, setShowPreview] = createSignal(true);
  createEffect(() => showPreview() && setStore("mode", "DOM"));
  compiler.addEventListener("message", ({
    data
  }) => {
    const {
      event,
      result
    } = data;
    if (event === "RESULT") {
      const [error, compiled] = result;
      if (error)
        return setStore({
          error
        });
      if (!compiled)
        return;
      actions.setCompiled(compiled);
      console.log("Compilation took:", formatMs(performance.now() - now));
    }
  });
  const applyCompilation = debounce((tabs, compileOpts, solidVersion) => {
    setStore("isCompiling", true);
    now = performance.now();
    compiler.postMessage({
      event: "COMPILE",
      tabs,
      compileOpts,
      solidVersion
    });
  }, 250);
  createEffect(() => {
    for (const tab of props.tabs)
      tab.source;
    applyCompilation(unwrap(props.tabs), unwrap(compileMode[store.mode]), props.version);
  });
  const handleDocChange = (source) => {
    actions.setCurrentSource(source);
    setStore({
      error: ""
    });
  };
  const [left, setLeft] = createSignal(1.25);
  const [isDragging, setIsDragging] = createSignal(false);
  const onMouseMove = throttle((e) => {
    const percentage = e.clientX / (document.body.offsetWidth / 2);
    if (percentage < 0.5 || percentage > 1.5)
      return;
    setLeft(percentage);
  }, 10);
  const onMouseUp = () => setIsDragging(false);
  createEffect(() => {
    if (isDragging()) {
      window.addEventListener("mousemove", onMouseMove);
      window.addEventListener("mouseup", onMouseUp);
    } else {
      window.removeEventListener("mousemove", onMouseMove);
      window.removeEventListener("mouseup", onMouseUp);
    }
  });
  const [reloadSignal, reload] = createSignal(false, {
    equals: false
  });
  return (() => {
    const _el$ = _tmpl$7.cloneNode(true);
    insert(_el$, createComponent(TabList, {
      "class": "row-start-1 space-x-2",
      get children() {
        return [createComponent(For, {
          get each() {
            return props.tabs;
          },
          children: (tab, index) => createComponent(TabItem, {
            get active() {
              return props.current === id(tab);
            },
            get children() {
              return [(() => {
                const _el$19 = _tmpl$9.cloneNode(true), _el$20 = _el$19.firstChild;
                _el$19.$$dblclick = () => {
                  var _a;
                  if (index() <= 0 || !props.interactive)
                    return;
                  setEdit(index());
                  (_a = tabRefs.get(id(tab))) == null ? void 0 : _a.focus();
                };
                _el$19.$$click = () => actions.setCurrentTab(id(tab));
                _el$20.$$keydown = (e) => {
                  if (e.code === "Space")
                    e.preventDefault();
                  if (e.code !== "Enter")
                    return;
                  setEdit(-1);
                  actions.setTabName(id(tab), e.currentTarget.textContent);
                };
                ((el) => tabRefs.set(id(tab), el))(_el$20);
                insert(_el$20, () => tab.name);
                insert(_el$19, (() => {
                  const _c$ = memo(() => props.current === id(tab), true);
                  return createComponent(Show, {
                    get when() {
                      return _c$() && edit() >= 0;
                    },
                    get fallback() {
                      return (() => {
                        const _el$23 = _tmpl$11.cloneNode(true);
                        _el$23.firstChild;
                        insert(_el$23, () => tab.type, null);
                        return _el$23;
                      })();
                    },
                    get children() {
                      const _el$21 = _tmpl$8.cloneNode(true);
                      _el$21.addEventListener("change", (e) => {
                        setEdit(-1);
                        actions.setTabType(id(tab), e.currentTarget.value);
                      });
                      effect(() => _el$21.value = tab.type);
                      return _el$21;
                    }
                  });
                })(), null);
                effect(() => setAttribute(_el$20, "contenteditable", props.current === id(tab) && edit() >= 0));
                return _el$19;
              })(), createComponent(Show, {
                get when() {
                  return index() > 0;
                },
                get children() {
                  const _el$22 = _tmpl$10.cloneNode(true);
                  _el$22.$$click = () => {
                    if (!props.interactive)
                      return;
                    actions.removeTab(id(tab));
                  };
                  effect(() => _el$22.disabled = !props.interactive);
                  return _el$22;
                }
              })];
            }
          })
        }), createComponent(Show, {
          get when() {
            return props.editableTabs;
          },
          get children() {
            const _el$2 = _tmpl$.cloneNode(true), _el$3 = _el$2.firstChild;
            addEventListener(_el$3, "click", props.interactive ? actions.addTab : void 0, true);
            effect(() => _el$3.disabled = !props.interactive);
            return _el$2;
          }
        })];
      }
    }), null);
    insert(_el$, createComponent(TabList, {
      get ["class"]() {
        return `row-start-3 border-t-2 border-blueGray-200 ${props.isHorizontal ? "" : "md:row-start-1 md:col-start-3 md:border-t-0"}`;
      },
      get children() {
        return [createComponent(TabItem, {
          get children() {
            const _el$4 = _tmpl$2.cloneNode(true);
            _el$4.firstChild;
            _el$4.$$click = reload;
            _el$4.$$clickData = true;
            insert(_el$4, createComponent(Icon, {
              path: refresh,
              "class": "h-5"
            }), null);
            effect(() => _el$4.disabled = !showPreview());
            return _el$4;
          }
        }), createComponent(TabItem, {
          "class": "flex-1",
          get active() {
            return showPreview();
          },
          get children() {
            const _el$6 = _tmpl$3.cloneNode(true);
            _el$6.$$click = setShowPreview;
            _el$6.$$clickData = true;
            return _el$6;
          }
        }), createComponent(TabItem, {
          "class": "flex-1",
          get active() {
            return !showPreview();
          },
          get children() {
            const _el$7 = _tmpl$4.cloneNode(true);
            _el$7.$$click = setShowPreview;
            _el$7.$$clickData = false;
            return _el$7;
          }
        })];
      }
    }), null);
    insert(_el$, createComponent(Suspense, {
      get fallback() {
        return _tmpl$12.cloneNode(true);
      },
      get children() {
        return [createComponent(MonacoTabs, {
          get tabs() {
            return props.tabs;
          },
          get compiled() {
            return store.compiled;
          }
        }), createComponent(Editor, {
          get url() {
            return `file:///${props.current}`;
          },
          onDocChange: handleDocChange,
          "class": "h-full focus:outline-none bg-blueGray-50 dark:bg-blueGray-800 row-start-2",
          styles: {
            backgroundColor: "#F8FAFC"
          },
          get disabled() {
            return !props.interactive;
          },
          canCopy: true,
          canFormat: true,
          formatter,
          get isDark() {
            return props.dark;
          },
          withMinimap: false,
          get showActionBar() {
            return props.actionBar;
          },
          ref(r$) {
            const _ref$ = props.onEditorReady;
            typeof _ref$ === "function" ? _ref$(r$) : props.onEditorReady = r$;
          }
        }), (() => {
          const _el$8 = _tmpl$5.cloneNode(true);
          _el$8.$$mousedown = setIsDragging;
          _el$8.$$mousedownData = true;
          effect((_$p) => classList(_el$8, {
            "md:block": !props.isHorizontal
          }, _$p));
          return _el$8;
        })(), createComponent(Show, {
          get when() {
            return !showPreview();
          },
          get children() {
            const _el$9 = _tmpl$6.cloneNode(true), _el$10 = _el$9.firstChild, _el$11 = _el$10.firstChild, _el$12 = _el$11.nextSibling, _el$13 = _el$12.firstChild, _el$14 = _el$13.firstChild, _el$15 = _el$13.nextSibling, _el$16 = _el$15.firstChild, _el$17 = _el$15.nextSibling, _el$18 = _el$17.firstChild;
            insert(_el$9, createComponent(Editor, {
              url: "file:///output_dont_import.tsx",
              "class": "h-full focus:outline-none",
              styles: {
                backgroundColor: "#fff"
              },
              get isDark() {
                return props.dark;
              },
              disabled: true,
              canCopy: true,
              withMinimap: false,
              get showActionBar() {
                return props.actionBar;
              }
            }), _el$10);
            _el$14.addEventListener("change", (e) => setStore("mode", e.currentTarget.value));
            _el$16.addEventListener("change", (e) => setStore("mode", e.currentTarget.value));
            _el$18.addEventListener("change", (e) => setStore("mode", e.currentTarget.value));
            effect((_p$) => {
              const _v$ = {
                "md:row-start-2": !props.isHorizontal
              }, _v$2 = store.mode === "DOM", _v$3 = store.mode === "SSR", _v$4 = store.mode === "HYDRATABLE";
              _p$._v$ = classList(_el$9, _v$, _p$._v$);
              _v$2 !== _p$._v$2 && (_el$14.checked = _p$._v$2 = _v$2);
              _v$3 !== _p$._v$3 && (_el$16.checked = _p$._v$3 = _v$3);
              _v$4 !== _p$._v$4 && (_el$18.checked = _p$._v$4 = _v$4);
              return _p$;
            }, {
              _v$: void 0,
              _v$2: void 0,
              _v$3: void 0,
              _v$4: void 0
            });
            return _el$9;
          }
        }), createComponent(Show, {
          get when() {
            return showPreview();
          },
          get children() {
            return createComponent(Preview, {
              get reloadSignal() {
                return reloadSignal();
              },
              get code() {
                return store.compiled;
              },
              get ["class"]() {
                return `h-full w-full bg-white row-start-4 ${props.isHorizontal ? "" : "md:row-start-2"}`;
              },
              get classList() {
                return {
                  "pointer-events-none": isDragging()
                };
              }
            });
          }
        })];
      }
    }), null);
    insert(_el$, createComponent(Show, {
      get when() {
        return store.error;
      },
      get children() {
        return createComponent(Error, {
          get onDismiss() {
            return actions.resetError;
          },
          get message() {
            return store.error;
          }
        });
      }
    }), null);
    effect((_p$) => {
      const _v$5 = props.isHorizontal, _v$6 = !props.isHorizontal, _v$7 = `${left()}fr`, _v$8 = `${2 - left()}fr`;
      _v$5 !== _p$._v$5 && _el$.classList.toggle("wrapper--forced", _p$._v$5 = _v$5);
      _v$6 !== _p$._v$6 && _el$.classList.toggle("wrapper", _p$._v$6 = _v$6);
      _v$7 !== _p$._v$7 && _el$.style.setProperty("--left", _p$._v$7 = _v$7);
      _v$8 !== _p$._v$8 && _el$.style.setProperty("--right", _p$._v$8 = _v$8);
      return _p$;
    }, {
      _v$5: void 0,
      _v$6: void 0,
      _v$7: void 0,
      _v$8: void 0
    });
    return _el$;
  })();
};
delegateEvents(["click", "mousedown", "dblclick", "keydown"]);
function processImport({ files }) {
  return files.map((file) => {
    var _a;
    return {
      name: file.name,
      type: (_a = file == null ? void 0 : file.type) != null ? _a : "tsx",
      source: Array.isArray(file.content) ? file.content.join("\n") : file.content
    };
  });
}
const createTabList = (initialTabs) => {
  let sourceSignals = {};
  const mapTabs = (tabs2) => {
    const oldSignals = sourceSignals;
    sourceSignals = {};
    return tabs2.map((tab) => {
      const id2 = `${tab.name}.${tab.type}`;
      sourceSignals[id2] = oldSignals[id2] || createSignal(tab.source);
      if (oldSignals[id2])
        oldSignals[id2][1](tab.source);
      return {
        name: tab.name,
        type: tab.type,
        get source() {
          return sourceSignals[id2][0]();
        },
        set source(source) {
          sourceSignals[id2][1](source);
        }
      };
    });
  };
  const [tabs, trueSetTabs] = createSignal(mapTabs(initialTabs), { equals: false });
  return [tabs, (tabs2) => batch(() => trueSetTabs(mapTabs(tabs2)))];
};
const defaultTabs = [
  {
    name: "main",
    type: "tsx",
    source: 'import { render } from "solid-js/web";\nimport { createSignal } from "solid-js";\n\nfunction Counter() {\n  const [count, setCount] = createSignal(0);\n  const increment = () => setCount(count() + 1);\n\n  return (\n    <button type="button" onClick={increment}>\n      {count()}\n    </button>\n  );\n}\n\nrender(() => <Counter />, document.getElementById("app"));\n'
  }
];
export { Icon as I, Repl as R, code as a, clipboardCheck as b, checkCircle as c, clipboard as d, defaultTabs as e, createTabList as f, processImport as p };
