import { For, Repeat, Show, createEffect, createMemo, createSignal, createStore, onSettled, reconcile, untrack } from "solid-js";
//#region src/styles.css?inline
var styles_default = "html[dir=\"ltr\"], [data-sonner-toaster][dir=\"ltr\"] {\n  --toast-icon-margin-start: -3px;\n  --toast-icon-margin-end: 4px;\n  --toast-svg-margin-start: -1px;\n  --toast-svg-margin-end: 0px;\n  --toast-button-margin-start: auto;\n  --toast-button-margin-end: 0;\n  --toast-close-button-start: 0;\n  --toast-close-button-end: unset;\n  --toast-close-button-transform: translate(-35%, -35%);\n}\n\nhtml[dir=\"rtl\"], [data-sonner-toaster][dir=\"rtl\"] {\n  --toast-icon-margin-start: 4px;\n  --toast-icon-margin-end: -3px;\n  --toast-svg-margin-start: 0px;\n  --toast-svg-margin-end: -1px;\n  --toast-button-margin-start: 0;\n  --toast-button-margin-end: auto;\n  --toast-close-button-start: unset;\n  --toast-close-button-end: 0;\n  --toast-close-button-transform: translate(35%, -35%);\n}\n\n[data-sonner-toaster] {\n  width: var(--width);\n  --gray1: #fcfcfc;\n  --gray2: #f8f8f8;\n  --gray3: #f3f3f3;\n  --gray4: #ededed;\n  --gray5: #e8e8e8;\n  --gray6: #e2e2e2;\n  --gray7: #dbdbdb;\n  --gray8: #c7c7c7;\n  --gray9: #8f8f8f;\n  --gray10: #858585;\n  --gray11: #6f6f6f;\n  --gray12: #171717;\n  --border-radius: 8px;\n  box-sizing: border-box;\n  z-index: 999999999;\n  outline: none;\n  margin: 0;\n  padding: 0;\n  font-family: 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;\n  list-style: none;\n  transition: transform .4s;\n  position: fixed;\n}\n\n@media (hover: none) and (pointer: coarse) {\n  [data-sonner-toaster][data-lifted=\"true\"] {\n    transform: none;\n  }\n}\n\n[data-sonner-toaster][data-x-position=\"right\"] {\n  right: var(--offset-right);\n}\n\n[data-sonner-toaster][data-x-position=\"left\"] {\n  left: var(--offset-left);\n}\n\n[data-sonner-toaster][data-x-position=\"center\"] {\n  left: 50%;\n  transform: translateX(-50%);\n}\n\n[data-sonner-toaster][data-y-position=\"top\"] {\n  top: var(--offset-top);\n}\n\n[data-sonner-toaster][data-y-position=\"bottom\"] {\n  bottom: var(--offset-bottom);\n}\n\n[data-sonner-toast] {\n  --y: translateY(100%);\n  --lift-amount: calc(var(--lift) * var(--gap));\n  z-index: var(--z-index);\n  opacity: 0;\n  transform: var(--y);\n  touch-action: none;\n  box-sizing: border-box;\n  overflow-wrap: anywhere;\n  outline: none;\n  transition: transform .4s, opacity .4s, height .4s, box-shadow .2s;\n  position: absolute;\n}\n\n[data-sonner-toast][data-styled=\"true\"] {\n  background: var(--normal-bg);\n  border: 1px solid var(--normal-border);\n  color: var(--normal-text);\n  border-radius: var(--border-radius);\n  width: var(--width);\n  align-items: center;\n  gap: 6px;\n  padding: 16px;\n  font-size: 13px;\n  display: flex;\n  box-shadow: 0 4px 12px #0000001a;\n}\n\n[data-sonner-toast]:focus-visible {\n  box-shadow: 0 4px 12px #0000001a, 0 0 0 2px #0003;\n}\n\n[data-sonner-toast][data-y-position=\"top\"] {\n  --y: translateY(-100%);\n  --lift: 1;\n  --lift-amount: calc(1 * var(--gap));\n  top: 0;\n}\n\n[data-sonner-toast][data-y-position=\"bottom\"] {\n  --y: translateY(100%);\n  --lift: -1;\n  --lift-amount: calc(var(--lift) * var(--gap));\n  bottom: 0;\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-description] {\n  color: #3f3f3f;\n  font-weight: 400;\n  line-height: 1.4;\n}\n\n[data-rich-colors=\"true\"][data-sonner-toast][data-styled=\"true\"] [data-description] {\n  color: inherit;\n}\n\n[data-sonner-toaster][data-sonner-theme=\"dark\"] [data-description] {\n  color: #e8e8e8;\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-title] {\n  color: inherit;\n  font-weight: 500;\n  line-height: 1.5;\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-icon] {\n  width: 16px;\n  height: 16px;\n  margin-left: var(--toast-icon-margin-start);\n  margin-right: var(--toast-icon-margin-end);\n  flex-shrink: 0;\n  justify-content: flex-start;\n  align-items: center;\n  display: flex;\n  position: relative;\n}\n\n[data-sonner-toast][data-promise=\"true\"] [data-icon] > svg {\n  opacity: 0;\n  transform-origin: center;\n  animation: .3s forwards sonner-fade-in;\n  transform: scale(.8);\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-icon] > * {\n  flex-shrink: 0;\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-icon] svg {\n  margin-left: var(--toast-svg-margin-start);\n  margin-right: var(--toast-svg-margin-end);\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-content] {\n  flex-direction: column;\n  flex: 1;\n  gap: 2px;\n  min-width: 0;\n  display: flex;\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-button] {\n  height: 24px;\n  color: var(--normal-bg);\n  background: var(--normal-text);\n  margin-left: var(--toast-button-margin-start);\n  margin-right: var(--toast-button-margin-end);\n  cursor: pointer;\n  border: none;\n  border-radius: 4px;\n  outline: none;\n  flex-shrink: 0;\n  align-items: center;\n  padding-left: 8px;\n  padding-right: 8px;\n  font-size: 12px;\n  font-weight: 500;\n  transition: opacity .4s, box-shadow .2s;\n  display: flex;\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-button]:focus-visible {\n  box-shadow: 0 0 0 2px #0006;\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-button]:first-of-type {\n  margin-left: var(--toast-button-margin-start);\n  margin-right: var(--toast-button-margin-end);\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-cancel] {\n  color: var(--normal-text);\n  background: #00000014;\n}\n\n[data-sonner-toaster][data-sonner-theme=\"dark\"] [data-sonner-toast][data-styled=\"true\"] [data-cancel] {\n  background: #ffffff4d;\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-close-button] {\n  left: var(--toast-close-button-start);\n  right: var(--toast-close-button-end);\n  width: 20px;\n  height: 20px;\n  color: var(--normal-text);\n  background: var(--normal-bg);\n  border: 1px solid var(--normal-border);\n  transform: var(--toast-close-button-transform);\n  cursor: pointer;\n  z-index: 1;\n  border-radius: 50%;\n  justify-content: center;\n  align-items: center;\n  padding: 0;\n  transition: opacity .1s, background .2s, border-color .2s;\n  display: flex;\n  position: absolute;\n  top: 0;\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-close-button]:focus-visible {\n  box-shadow: 0 4px 12px #0000001a, 0 0 0 2px #0003;\n}\n\n[data-sonner-toast][data-styled=\"true\"] [data-disabled=\"true\"] {\n  cursor: not-allowed;\n}\n\n[data-sonner-toast][data-styled=\"true\"]:hover [data-close-button]:hover {\n  background: var(--gray2);\n  border-color: var(--gray5);\n}\n\n[data-sonner-toast][data-swiping=\"true\"]:before {\n  content: \"\";\n  z-index: -1;\n  height: 100%;\n  position: absolute;\n  left: -100%;\n  right: -100%;\n}\n\n[data-sonner-toast][data-y-position=\"top\"][data-swiping=\"true\"]:before {\n  bottom: 50%;\n  transform: scaleY(3) translateY(50%);\n}\n\n[data-sonner-toast][data-y-position=\"bottom\"][data-swiping=\"true\"]:before {\n  top: 50%;\n  transform: scaleY(3) translateY(-50%);\n}\n\n[data-sonner-toast][data-swiping=\"false\"][data-removed=\"true\"]:before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  transform: scaleY(2);\n}\n\n[data-sonner-toast][data-expanded=\"true\"]:after {\n  content: \"\";\n  height: calc(var(--gap) + 1px);\n  width: 100%;\n  position: absolute;\n  bottom: 100%;\n  left: 0;\n}\n\n[data-sonner-toast][data-mounted=\"true\"] {\n  --y: translateY(0);\n  opacity: 1;\n}\n\n[data-sonner-toast][data-expanded=\"false\"][data-front=\"false\"] {\n  --scale: var(--toasts-before) * .05 + 1;\n  --y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));\n  height: var(--front-toast-height);\n}\n\n[data-sonner-toast] > * {\n  transition: opacity .4s;\n}\n\n[data-sonner-toast][data-x-position=\"right\"] {\n  right: 0;\n}\n\n[data-sonner-toast][data-x-position=\"left\"] {\n  left: 0;\n}\n\n[data-sonner-toast][data-expanded=\"false\"][data-front=\"false\"][data-styled=\"true\"] > * {\n  opacity: 0;\n}\n\n[data-sonner-toast][data-visible=\"false\"] {\n  opacity: 0;\n  pointer-events: none;\n}\n\n[data-sonner-toast][data-mounted=\"true\"][data-expanded=\"true\"] {\n  --y: translateY(calc(var(--lift) * var(--offset)));\n  height: var(--initial-height);\n}\n\n[data-sonner-toast][data-removed=\"true\"][data-front=\"true\"][data-swipe-out=\"false\"] {\n  --y: translateY(calc(var(--lift) * -100%));\n  opacity: 0;\n}\n\n[data-sonner-toast][data-removed=\"true\"][data-front=\"false\"][data-swipe-out=\"false\"][data-expanded=\"true\"] {\n  --y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));\n  opacity: 0;\n}\n\n[data-sonner-toast][data-removed=\"true\"][data-front=\"false\"][data-swipe-out=\"false\"][data-expanded=\"false\"] {\n  --y: translateY(40%);\n  opacity: 0;\n  transition: transform .5s, opacity .2s;\n}\n\n[data-sonner-toast][data-removed=\"true\"][data-front=\"false\"]:before {\n  height: calc(var(--initial-height) + 20%);\n}\n\n[data-sonner-toast][data-swiping=\"true\"] {\n  transform: var(--y) translateY(var(--swipe-amount-y, 0px)) translateX(var(--swipe-amount-x, 0px));\n  transition: none;\n}\n\n[data-sonner-toast][data-swiped=\"true\"] {\n  -webkit-user-select: none;\n  user-select: none;\n}\n\n[data-sonner-toast][data-swipe-out=\"true\"][data-y-position=\"bottom\"], [data-sonner-toast][data-swipe-out=\"true\"][data-y-position=\"top\"] {\n  animation-duration: .2s;\n  animation-timing-function: ease-out;\n  animation-fill-mode: forwards;\n}\n\n[data-sonner-toast][data-swipe-out=\"true\"][data-swipe-direction=\"left\"] {\n  animation-name: swipe-out-left;\n}\n\n[data-sonner-toast][data-swipe-out=\"true\"][data-swipe-direction=\"right\"] {\n  animation-name: swipe-out-right;\n}\n\n[data-sonner-toast][data-swipe-out=\"true\"][data-swipe-direction=\"up\"] {\n  animation-name: swipe-out-up;\n}\n\n[data-sonner-toast][data-swipe-out=\"true\"][data-swipe-direction=\"down\"] {\n  animation-name: swipe-out-down;\n}\n\n@keyframes swipe-out-left {\n  from {\n    transform: var(--y) translateX(var(--swipe-amount-x));\n    opacity: 1;\n  }\n\n  to {\n    transform: var(--y) translateX(calc(var(--swipe-amount-x) - 100%));\n    opacity: 0;\n  }\n}\n\n@keyframes swipe-out-right {\n  from {\n    transform: var(--y) translateX(var(--swipe-amount-x));\n    opacity: 1;\n  }\n\n  to {\n    transform: var(--y) translateX(calc(var(--swipe-amount-x) + 100%));\n    opacity: 0;\n  }\n}\n\n@keyframes swipe-out-up {\n  from {\n    transform: var(--y) translateY(var(--swipe-amount-y));\n    opacity: 1;\n  }\n\n  to {\n    transform: var(--y) translateY(calc(var(--swipe-amount-y) - 100%));\n    opacity: 0;\n  }\n}\n\n@keyframes swipe-out-down {\n  from {\n    transform: var(--y) translateY(var(--swipe-amount-y));\n    opacity: 1;\n  }\n\n  to {\n    transform: var(--y) translateY(calc(var(--swipe-amount-y) + 100%));\n    opacity: 0;\n  }\n}\n\n@media (width <= 600px) {\n  [data-sonner-toaster] {\n    right: var(--mobile-offset-right);\n    left: var(--mobile-offset-left);\n    width: 100%;\n    position: fixed;\n  }\n\n  [data-sonner-toaster][dir=\"rtl\"] {\n    left: calc(var(--mobile-offset-left) * -1);\n  }\n\n  [data-sonner-toaster] [data-sonner-toast] {\n    width: calc(100% - var(--mobile-offset-left) * 2);\n    left: 0;\n    right: 0;\n  }\n\n  [data-sonner-toaster][data-x-position=\"left\"] {\n    left: var(--mobile-offset-left);\n  }\n\n  [data-sonner-toaster][data-y-position=\"bottom\"] {\n    bottom: var(--mobile-offset-bottom);\n  }\n\n  [data-sonner-toaster][data-y-position=\"top\"] {\n    top: var(--mobile-offset-top);\n  }\n\n  [data-sonner-toaster][data-x-position=\"center\"] {\n    left: var(--mobile-offset-left);\n    right: var(--mobile-offset-right);\n    transform: none;\n  }\n}\n\n[data-sonner-toaster][data-sonner-theme=\"light\"] {\n  --normal-bg: #fff;\n  --normal-border: var(--gray4);\n  --normal-text: var(--gray12);\n  --success-bg: #ecfdf3;\n  --success-border: #bffcd9;\n  --success-text: #008a2e;\n  --info-bg: #f0f8ff;\n  --info-border: #dde7fd;\n  --info-text: #0973dc;\n  --warning-bg: #fffcf0;\n  --warning-border: #fbeeb1;\n  --warning-text: #dc7609;\n  --error-bg: #fff0f0;\n  --error-border: #ffe0e1;\n  --error-text: #e60000;\n}\n\n[data-sonner-toaster][data-sonner-theme=\"light\"] [data-sonner-toast][data-invert=\"true\"] {\n  --normal-bg: #000;\n  --normal-border: #333;\n  --normal-text: var(--gray1);\n}\n\n[data-sonner-toaster][data-sonner-theme=\"dark\"] [data-sonner-toast][data-invert=\"true\"] {\n  --normal-bg: #fff;\n  --normal-border: var(--gray3);\n  --normal-text: var(--gray12);\n}\n\n[data-sonner-toaster][data-sonner-theme=\"dark\"] {\n  --normal-bg: #000;\n  --normal-bg-hover: #1f1f1f;\n  --normal-border: #333;\n  --normal-border-hover: #404040;\n  --normal-text: var(--gray1);\n  --success-bg: #001f0f;\n  --success-border: #003d1c;\n  --success-text: #59f3a6;\n  --info-bg: #000d1f;\n  --info-border: #19233e;\n  --info-text: #5896f3;\n  --warning-bg: #1d1f00;\n  --warning-border: #2e2e00;\n  --warning-text: #f3cf58;\n  --error-bg: #2d0607;\n  --error-border: #4d0408;\n  --error-text: #ff9ea1;\n}\n\n[data-sonner-toaster][data-sonner-theme=\"dark\"] [data-sonner-toast] [data-close-button] {\n  background: var(--normal-bg);\n  border-color: var(--normal-border);\n  color: var(--normal-text);\n}\n\n[data-sonner-toaster][data-sonner-theme=\"dark\"] [data-sonner-toast] [data-close-button]:hover {\n  background: var(--normal-bg-hover);\n  border-color: var(--normal-border-hover);\n}\n\n[data-rich-colors=\"true\"][data-sonner-toast][data-type=\"success\"], [data-rich-colors=\"true\"][data-sonner-toast][data-type=\"success\"] [data-close-button] {\n  background: var(--success-bg);\n  border-color: var(--success-border);\n  color: var(--success-text);\n}\n\n[data-rich-colors=\"true\"][data-sonner-toast][data-type=\"info\"], [data-rich-colors=\"true\"][data-sonner-toast][data-type=\"info\"] [data-close-button] {\n  background: var(--info-bg);\n  border-color: var(--info-border);\n  color: var(--info-text);\n}\n\n[data-rich-colors=\"true\"][data-sonner-toast][data-type=\"warning\"], [data-rich-colors=\"true\"][data-sonner-toast][data-type=\"warning\"] [data-close-button] {\n  background: var(--warning-bg);\n  border-color: var(--warning-border);\n  color: var(--warning-text);\n}\n\n[data-rich-colors=\"true\"][data-sonner-toast][data-type=\"error\"], [data-rich-colors=\"true\"][data-sonner-toast][data-type=\"error\"] [data-close-button] {\n  background: var(--error-bg);\n  border-color: var(--error-border);\n  color: var(--error-text);\n}\n\n.sonner-loading-wrapper {\n  --size: 16px;\n  height: var(--size);\n  width: var(--size);\n  z-index: 10;\n  position: absolute;\n  inset: 0;\n}\n\n.sonner-loading-wrapper[data-visible=\"false\"] {\n  transform-origin: center;\n  animation: .2s forwards sonner-fade-out;\n}\n\n.sonner-spinner {\n  height: var(--size);\n  width: var(--size);\n  position: relative;\n  top: 50%;\n  left: 50%;\n}\n\n.sonner-loading-bar {\n  background: var(--gray11);\n  border-radius: 6px;\n  width: 24%;\n  height: 8%;\n  animation: 1.2s linear infinite sonner-spin;\n  position: absolute;\n  top: -3.9%;\n  left: -10%;\n}\n\n.sonner-loading-bar:first-child {\n  animation-delay: -1.2s;\n  transform: rotate(.0001deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(2) {\n  animation-delay: -1.1s;\n  transform: rotate(30deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(3) {\n  animation-delay: -1s;\n  transform: rotate(60deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(4) {\n  animation-delay: -.9s;\n  transform: rotate(90deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(5) {\n  animation-delay: -.8s;\n  transform: rotate(120deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(6) {\n  animation-delay: -.7s;\n  transform: rotate(150deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(7) {\n  animation-delay: -.6s;\n  transform: rotate(180deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(8) {\n  animation-delay: -.5s;\n  transform: rotate(210deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(9) {\n  animation-delay: -.4s;\n  transform: rotate(240deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(10) {\n  animation-delay: -.3s;\n  transform: rotate(270deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(11) {\n  animation-delay: -.2s;\n  transform: rotate(300deg) translate(146%);\n}\n\n.sonner-loading-bar:nth-child(12) {\n  animation-delay: -.1s;\n  transform: rotate(330deg) translate(146%);\n}\n\n@keyframes sonner-fade-in {\n  0% {\n    opacity: 0;\n    transform: scale(.8);\n  }\n\n  100% {\n    opacity: 1;\n    transform: scale(1);\n  }\n}\n\n@keyframes sonner-fade-out {\n  0% {\n    opacity: 1;\n    transform: scale(1);\n  }\n\n  100% {\n    opacity: 0;\n    transform: scale(.8);\n  }\n}\n\n@keyframes sonner-spin {\n  0% {\n    opacity: 1;\n  }\n\n  100% {\n    opacity: .15;\n  }\n}\n\n@media (prefers-reduced-motion) {\n  [data-sonner-toast], [data-sonner-toast] > *, .sonner-loading-bar {\n    transition: none !important;\n    animation: none !important;\n  }\n}\n\n.sonner-loader {\n  transform-origin: center;\n  transition: opacity .2s, transform .2s;\n  position: absolute;\n  top: 50%;\n  left: 50%;\n  transform: translate(-50%, -50%);\n}\n\n.sonner-loader[data-visible=\"false\"] {\n  opacity: 0;\n  transform: scale(.8) translate(-50%, -50%);\n}\n";
//#endregion
//#region src/assets.tsx
function Loader(props) {
	return <div class={["sonner-loading-wrapper", props.class ?? props.className].filter(Boolean).join(" ")} data-visible={String(props.visible)}>
      <div class="sonner-spinner">
        <Repeat count={12}>{(i) => <div class="sonner-loading-bar" data-index={i} />}</Repeat>
      </div>
    </div>;
}
function SuccessIcon() {
	return <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20">
      <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd" />
    </svg>;
}
function WarningIcon() {
	return <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" height="20" width="20">
      <path fill-rule="evenodd" d="M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z" clip-rule="evenodd" />
    </svg>;
}
function InfoIcon() {
	return <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20">
      <path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd" />
    </svg>;
}
function ErrorIcon() {
	return <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20">
      <path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd" />
    </svg>;
}
function getAsset(type) {
	switch (type) {
		case "success": return <SuccessIcon />;
		case "info": return <InfoIcon />;
		case "warning": return <WarningIcon />;
		case "error": return <ErrorIcon />;
		default: return null;
	}
}
function CloseIcon() {
	return <svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
      <line x1="18" y1="6" x2="6" y2="18" />
      <line x1="6" y1="6" x2="18" y2="18" />
    </svg>;
}
//#endregion
//#region src/primitives.ts
function useIsDocumentHidden() {
	const [isDocumentHidden, setIsDocumentHidden] = createSignal(typeof document !== "undefined" ? document.hidden : false);
	onSettled(() => {
		const callback = () => {
			setIsDocumentHidden(document.hidden);
		};
		document.addEventListener("visibilitychange", callback);
		return () => {
			document.removeEventListener("visibilitychange", callback);
		};
	});
	return isDocumentHidden;
}
//#endregion
//#region src/state.ts
let toastsCounter = 1;
const MAX_HISTORY_SIZE = 100;
function getToastId(data) {
	return typeof data?.id === "number" || typeof data?.id === "string" && data.id.length > 0 ? data.id : toastsCounter++;
}
var Observer = class {
	subscribers;
	toasts;
	dismissedToasts;
	pendingDismissals;
	constructor() {
		this.subscribers = [];
		this.toasts = [];
		this.dismissedToasts = /* @__PURE__ */ new Set();
		this.pendingDismissals = /* @__PURE__ */ new Map();
	}
	subscribe = (subscriber) => {
		this.subscribers.push(subscriber);
		this.getActiveToasts().forEach((toast) => subscriber(toast));
		return () => {
			const index = this.subscribers.indexOf(subscriber);
			this.subscribers.splice(index, 1);
		};
	};
	publish = (data) => {
		this.subscribers.forEach((subscriber) => subscriber(data));
	};
	addToast = (data) => {
		this.publish(data);
		this.toasts = [...this.toasts, data];
		this.trimHistory();
	};
	trimHistory = () => {
		let toRemove = this.toasts.length - MAX_HISTORY_SIZE;
		if (toRemove <= 0) return;
		this.toasts = this.toasts.filter((toast) => {
			if (toRemove > 0 && this.dismissedToasts.has(toast.id)) {
				this.dismissedToasts.delete(toast.id);
				toRemove--;
				return false;
			}
			return true;
		});
	};
	create = (data) => {
		const { message, ...rest } = data;
		const id = getToastId(data);
		const pendingDismissal = this.pendingDismissals.get(id);
		if (pendingDismissal !== void 0) {
			cancelAnimationFrame(pendingDismissal);
			this.pendingDismissals.delete(id);
			this.dismissedToasts.delete(id);
		}
		const wasDismissed = this.dismissedToasts.has(id);
		const dismissible = data.dismissible === void 0 ? true : data.dismissible;
		if (wasDismissed) {
			this.dismissedToasts.delete(id);
			this.toasts = this.toasts.filter((toast) => toast.id !== id);
		}
		if (wasDismissed ? void 0 : this.toasts.find((toast) => {
			return toast.id === id;
		})) this.toasts = this.toasts.map((toast) => {
			if (toast.id === id) {
				this.publish({
					...toast,
					...data,
					id,
					title: message,
					dismissible
				});
				return {
					...toast,
					...data,
					id,
					dismissible,
					title: message
				};
			}
			return toast;
		});
		else this.addToast({
			title: message,
			...rest,
			dismissible,
			id
		});
		return id;
	};
	dismiss = (id) => {
		if (id === void 0 || id === null) {
			this.getActiveToasts().forEach((toast) => {
				this.dismissedToasts.add(toast.id);
				this.subscribers.forEach((subscriber) => subscriber({
					id: toast.id,
					dismiss: true
				}));
			});
			return id;
		}
		this.dismissedToasts.add(id);
		const alreadyPending = this.pendingDismissals.get(id);
		if (alreadyPending !== void 0) cancelAnimationFrame(alreadyPending);
		this.pendingDismissals.set(id, requestAnimationFrame(() => {
			this.pendingDismissals.delete(id);
			this.subscribers.forEach((subscriber) => subscriber({
				id,
				dismiss: true
			}));
		}));
		return id;
	};
	message = (message, data) => {
		return this.create({
			...data,
			message,
			type: void 0
		});
	};
	error = (message, data) => {
		return this.create({
			...data,
			message,
			type: "error"
		});
	};
	success = (message, data) => {
		return this.create({
			...data,
			type: "success",
			message
		});
	};
	info = (message, data) => {
		return this.create({
			...data,
			type: "info",
			message
		});
	};
	warning = (message, data) => {
		return this.create({
			...data,
			type: "warning",
			message
		});
	};
	loading = (message, data) => {
		return this.create({
			...data,
			type: "loading",
			message
		});
	};
	promise = (promise, data) => {
		if (!data) return;
		let id;
		if (data.loading !== void 0) id = this.create({
			...data,
			promise,
			type: "loading",
			message: data.loading,
			description: typeof data.description !== "function" ? data.description : void 0
		});
		const p = Promise.resolve(typeof promise === "function" ? promise() : promise);
		let shouldDismiss = id !== void 0;
		let result;
		const originalPromise = p.then(async (response) => {
			result = ["resolve", response];
			if (isValidElement(response)) {
				shouldDismiss = false;
				this.create({
					id,
					type: "default",
					message: response
				});
			} else if (isHttpResponse(response) && !response.ok) {
				shouldDismiss = false;
				const promiseData = typeof data.error === "function" ? await data.error(`HTTP error! status: ${response.status}`) : data.error;
				const description = typeof data.description === "function" ? await data.description(`HTTP error! status: ${response.status}`) : data.description;
				const toastSettings = isExtendedResult(promiseData) ? promiseData : { message: promiseData };
				this.create({
					id,
					type: "error",
					description,
					...toastSettings
				});
			} else if (response instanceof Error) {
				shouldDismiss = false;
				const promiseData = typeof data.error === "function" ? await data.error(response) : data.error;
				const description = typeof data.description === "function" ? await data.description(response) : data.description;
				const toastSettings = isExtendedResult(promiseData) ? promiseData : { message: promiseData };
				this.create({
					id,
					type: "error",
					description,
					...toastSettings
				});
			} else if (data.success !== void 0) {
				shouldDismiss = false;
				const promiseData = typeof data.success === "function" ? await data.success(response) : data.success;
				const description = typeof data.description === "function" ? await data.description(response) : data.description;
				const toastSettings = isExtendedResult(promiseData) ? promiseData : { message: promiseData };
				this.create({
					id,
					type: "success",
					description,
					...toastSettings
				});
			}
		}).catch(async (error) => {
			result = ["reject", error];
			if (data.error !== void 0) {
				shouldDismiss = false;
				const promiseData = typeof data.error === "function" ? await data.error(error) : data.error;
				const description = typeof data.description === "function" ? await data.description(error) : data.description;
				const toastSettings = isExtendedResult(promiseData) ? promiseData : { message: promiseData };
				this.create({
					id,
					type: "error",
					description,
					...toastSettings
				});
			}
		}).finally(() => {
			if (shouldDismiss) {
				this.dismiss(id);
				id = void 0;
			}
			data.finally?.();
		});
		const unwrap = () => new Promise((resolve, reject) => {
			originalPromise.then(() => {
				if (result[0] === "reject") reject(result[1]);
				else resolve(result[1]);
			}).catch(reject);
		});
		if (typeof id !== "string" && typeof id !== "number") return { unwrap };
		return Object.assign(id, { unwrap });
	};
	custom = (jsx, data) => {
		const id = getToastId(data);
		this.create({
			...data,
			jsx: jsx(id),
			id,
			type: void 0
		});
		return id;
	};
	getActiveToasts = () => {
		return this.toasts.filter((toast) => !this.dismissedToasts.has(toast.id));
	};
};
function isHttpResponse(data) {
	return data && typeof data === "object" && "ok" in data && typeof data.ok === "boolean" && "status" in data && typeof data.status === "number";
}
function isExtendedResult(value) {
	return typeof value === "object" && value !== null && "message" in value;
}
function isValidElement(value) {
	return typeof Node !== "undefined" && value instanceof Node;
}
const ToastState = new Observer();
function toastFunction(message, data) {
	return ToastState.message(message, data);
}
const basicToast = toastFunction;
const getHistory = () => ToastState.toasts;
const getToasts = () => ToastState.getActiveToasts();
const toast = Object.assign(basicToast, {
	success: ToastState.success,
	info: ToastState.info,
	warning: ToastState.warning,
	error: ToastState.error,
	custom: ToastState.custom,
	message: ToastState.message,
	promise: ToastState.promise,
	dismiss: ToastState.dismiss,
	loading: ToastState.loading
}, {
	getHistory,
	getToasts
});
//#endregion
//#region src/types.ts
function isAction(action) {
	return typeof action === "object" && action !== null && "label" in action;
}
//#endregion
//#region src/index.tsx
/*!
* Original code by Emil Kowalski
* MIT Licensed, Copyright 2023 Emil Kowalski, see https://github.com/emilkowalski/sonner/blob/main/LICENSE.md for details
*
* Credits:
* https://github.com/emilkowalski/sonner/blob/main/src/index.tsx
*/
if (typeof document !== "undefined" && !document.querySelector("style[data-sonner]")) {
	const styleTag = document.createElement("style");
	styleTag.setAttribute("data-sonner", "");
	styleTag.textContent = styles_default;
	document.head.appendChild(styleTag);
}
const VISIBLE_TOASTS_AMOUNT = 3;
const VIEWPORT_OFFSET = "24px";
const MOBILE_VIEWPORT_OFFSET = "16px";
const TOAST_LIFETIME = 4e3;
const TOAST_WIDTH = 356;
const GAP = 14;
const SWIPE_THRESHOLD = 45;
const TIME_BEFORE_UNMOUNT = 200;
function cn(...classes) {
	return classes.filter(Boolean).join(" ");
}
function boolAttr(value) {
	return value === void 0 ? void 0 : String(value);
}
function resolveContent(content) {
	return typeof content === "function" ? content() : content;
}
function getDefaultSwipeDirections(position) {
	const [y, x] = position.split("-");
	const directions = [];
	if (y) directions.push(y);
	if (x) directions.push(x);
	return directions;
}
function measureUnstackedHeight(element) {
	const originalHeight = element.style.height;
	element.style.height = "auto";
	const height = Number.parseFloat(window.getComputedStyle(element).height) || element.getBoundingClientRect().height;
	element.style.height = originalHeight;
	return height;
}
function getDocumentDirection() {
	if (typeof window === "undefined" || typeof document === "undefined") return "ltr";
	const dirAttribute = document.documentElement.getAttribute("dir");
	if (dirAttribute === "auto" || !dirAttribute) return window.getComputedStyle(document.documentElement).direction;
	return dirAttribute;
}
function assignOffset(defaultOffset, mobileOffset) {
	const styles = {};
	[defaultOffset, mobileOffset].forEach((offset, index) => {
		const isMobile = index === 1;
		const prefix = isMobile ? "--mobile-offset" : "--offset";
		const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
		const assignAll = (value) => {
			for (const key of [
				"top",
				"right",
				"bottom",
				"left"
			]) styles[`${prefix}-${key}`] = typeof value === "number" ? `${value}px` : value;
		};
		if (typeof offset === "number" || typeof offset === "string") {
			assignAll(offset);
			return;
		}
		if (typeof offset === "object" && offset !== null) {
			for (const key of [
				"top",
				"right",
				"bottom",
				"left"
			]) {
				const value = offset[key];
				styles[`${prefix}-${key}`] = value === void 0 ? defaultValue : typeof value === "number" ? `${value}px` : value;
			}
			return;
		}
		assignAll(defaultValue);
	});
	return styles;
}
function mergeClassNames(classNames, legacy) {
	return classNames ?? legacy;
}
function mergeDescriptionClassName(descriptionClassName, legacy) {
	return descriptionClassName ?? legacy ?? "";
}
function mergeClassName(className, legacy) {
	return className ?? legacy ?? "";
}
function useSonner() {
	const [activeToasts, setActiveToasts] = createSignal([]);
	onSettled(() => ToastState.subscribe((toastItem) => {
		if (toastItem.dismiss) {
			requestAnimationFrame(() => {
				setActiveToasts((toasts) => toasts.filter((t) => t.id !== toastItem.id));
			});
			return;
		}
		const nextToast = toastItem;
		setActiveToasts((toasts) => {
			const indexOfExistingToast = toasts.findIndex((t) => t.id === nextToast.id);
			if (indexOfExistingToast !== -1) return [
				...toasts.slice(0, indexOfExistingToast),
				{
					...toasts[indexOfExistingToast],
					...nextToast
				},
				...toasts.slice(indexOfExistingToast + 1)
			];
			return [nextToast, ...toasts];
		});
	}));
	return { toasts: activeToasts };
}
function createToastTheme(theme) {
	return theme !== "system" ? theme : typeof window !== "undefined" && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
}
function Toast(props) {
	const [mounted, setMounted] = createSignal(false);
	const [removed, setRemoved] = createSignal(false);
	const [swiping, setSwiping] = createSignal(false);
	const [swipeOut, setSwipeOut] = createSignal(false);
	const [isSwiped, setIsSwiped] = createSignal(false);
	const [swipeOutDirection, setSwipeOutDirection] = createSignal(null);
	const [offsetBeforeRemove, setOffsetBeforeRemove] = createSignal(0);
	const [initialHeight, setInitialHeight] = createSignal(0);
	let toastRef;
	let dragStartTime = null;
	let closeTimerStartTimeRef = 0;
	let lastCloseTimerStartTimeRef = 0;
	let remainingTime = TOAST_LIFETIME;
	let pointerStart = null;
	let swipeDirection = null;
	const isFront = () => props.index === 0;
	const isVisible = () => props.index + 1 <= props.visibleToasts;
	const toastType = () => props.toast.type;
	const dismissible = () => props.toast.dismissible !== false;
	const classNames = () => mergeClassNames(props.classNames, props.classes);
	const className = () => mergeClassName(props.className, props.class);
	const descriptionClassName = () => mergeDescriptionClassName(props.descriptionClassName, props.descriptionClass);
	const toastClassName = () => mergeClassName(props.toast.className, props.toast.class);
	const toastDescriptionClassName = () => mergeDescriptionClassName(props.toast.descriptionClassName, props.toast.descriptionClass);
	const toastClassNames = () => mergeClassNames(props.toast.classNames, props.toast.classes);
	const closeButton = () => props.toast.closeButton ?? props.closeButton;
	const duration = () => props.toast.duration ?? props.duration ?? TOAST_LIFETIME;
	const invert = () => props.toast.invert ?? props.invert;
	const disabled = () => toastType() === "loading";
	const toastTypeKey = () => toastType() ?? "default";
	const swipeDirections = () => props.swipeDirections ?? getDefaultSwipeDirections(props.position);
	const y = createMemo(() => props.position.split("-")[0]);
	const x = createMemo(() => props.position.split("-")[1]);
	const heightIndex = createMemo(() => Math.max(0, props.heights.findIndex((height) => height.toastId === props.toast.id)));
	const toastsHeightBefore = createMemo(() => {
		return props.heights.reduce((prev, curr, reducerIndex) => {
			if (reducerIndex >= heightIndex()) return prev;
			return prev + curr.height;
		}, 0);
	});
	const offset = createMemo(() => heightIndex() * (props.gap ?? GAP) + toastsHeightBefore());
	const isDocumentHidden = useIsDocumentHidden();
	const title = createMemo(() => resolveContent(props.toast.title));
	const description = createMemo(() => resolveContent(props.toast.description));
	createEffect(duration, (value) => {
		remainingTime = value;
	});
	function deleteToast() {
		setRemoved(true);
		setOffsetBeforeRemove(offset());
		props.setHeights((heights) => heights.filter((height) => height.toastId !== props.toast.id));
		window.setTimeout(() => {
			props.removeToast(props.toast);
		}, TIME_BEFORE_UNMOUNT);
	}
	function getLoadingIcon() {
		if (props.icons?.loading) return <div class={cn(classNames()?.loader, toastClassNames()?.loader, "sonner-loader")} data-visible={boolAttr(toastType() === "loading")}>
          {props.icons.loading}
        </div>;
		return <Loader class={cn(classNames()?.loader, toastClassNames()?.loader)} visible={toastType() === "loading"} />;
	}
	const icon = () => props.toast.icon ?? props.icons?.[toastType()] ?? getAsset(toastType());
	const heightEntry = () => ({
		toastId: props.toast.id,
		toasterId: props.toast.toasterId,
		position: props.toast.position
	});
	createEffect(heightEntry, (entry) => {
		setMounted(true);
		if (!toastRef) return;
		const height = measureUnstackedHeight(toastRef);
		setInitialHeight(height);
		props.setHeights((h) => [{
			...entry,
			height
		}, ...h]);
		return () => {
			props.setHeights((h) => h.filter((height) => height.toastId !== entry.toastId));
		};
	});
	createEffect(() => {
		title();
		description();
		return mounted() ? heightEntry() : void 0;
	}, (entry) => {
		if (!entry || !toastRef) return;
		const nextHeight = measureUnstackedHeight(toastRef);
		setInitialHeight(nextHeight);
		props.setHeights((heights) => {
			if (!heights.some((height) => height.toastId === entry.toastId)) return [{
				...entry,
				height: nextHeight
			}, ...heights];
			return heights.map((height) => height.toastId === entry.toastId ? {
				...height,
				height: nextHeight
			} : height);
		});
	});
	createEffect(() => ({
		shouldPause: props.expanded || props.interacting || (props.pauseWhenPageIsHidden ?? true) && isDocumentHidden(),
		hasTimer: toastType() !== "loading" && props.toast.duration !== Number.POSITIVE_INFINITY,
		duration: duration()
	}), ({ shouldPause, hasTimer }) => {
		if (!hasTimer) return;
		if (shouldPause) {
			if (lastCloseTimerStartTimeRef < closeTimerStartTimeRef) {
				const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef;
				remainingTime -= elapsedTime;
			}
			lastCloseTimerStartTimeRef = (/* @__PURE__ */ new Date()).getTime();
			return;
		}
		if (remainingTime === Number.POSITIVE_INFINITY) return;
		closeTimerStartTimeRef = (/* @__PURE__ */ new Date()).getTime();
		const timeoutId = setTimeout(() => {
			props.toast.onAutoClose?.(props.toast);
			deleteToast();
		}, remainingTime);
		return () => clearTimeout(timeoutId);
	});
	createEffect(() => props.toast.delete, (shouldDelete) => {
		if (!shouldDelete) return;
		untrack(() => {
			deleteToast();
			props.toast.onDismiss?.(props.toast);
		});
	});
	return <li tabindex={0} ref={(el) => toastRef = el} class={cn(className(), toastClassName(), classNames()?.toast, toastClassNames()?.toast, classNames()?.[toastTypeKey()], toastClassNames()?.[toastTypeKey()])} data-sonner-toast="" data-rich-colors={boolAttr(props.toast.richColors ?? props.defaultRichColors)} data-styled={boolAttr(!(props.toast.jsx || props.toast.unstyled || props.unstyled))} data-mounted={boolAttr(mounted())} data-promise={boolAttr(Boolean(props.toast.promise))} data-swiped={boolAttr(isSwiped())} data-removed={boolAttr(removed())} data-visible={boolAttr(isVisible())} data-y-position={y()} data-x-position={x()} data-index={props.index} data-front={boolAttr(isFront())} data-swiping={boolAttr(swiping())} data-dismissible={boolAttr(dismissible())} data-type={toastType()} data-invert={boolAttr(invert())} data-swipe-out={boolAttr(swipeOut())} data-swipe-direction={swipeOutDirection()} data-expanded={boolAttr(Boolean(props.expanded || props.expandByDefault && mounted()))} data-testid={props.toast.testId} style={{
		"--index": props.index,
		"--toasts-before": props.index,
		"--z-index": props.toasts.length - props.index,
		"--offset": `${removed() ? offsetBeforeRemove() : offset()}px`,
		"--initial-height": props.expandByDefault ? "auto" : `${initialHeight()}px`,
		...props.style,
		...props.toast.style
	}} onDragEnd={() => {
		setSwiping(false);
		swipeDirection = null;
		pointerStart = null;
	}} onPointerDown={(event) => {
		if (event.button === 2) return;
		if (disabled() || !dismissible()) return;
		if (event.target.closest("button")) return;
		dragStartTime = /* @__PURE__ */ new Date();
		setOffsetBeforeRemove(offset());
		event.currentTarget.setPointerCapture(event.pointerId);
		setSwiping(true);
		pointerStart = {
			x: event.clientX,
			y: event.clientY
		};
	}} onPointerUp={() => {
		if (swipeOut() || !dismissible()) return;
		pointerStart = null;
		const swipeAmountX = Number(toastRef?.style.getPropertyValue("--swipe-amount-x").replace("px", "") || 0);
		const swipeAmountY = Number(toastRef?.style.getPropertyValue("--swipe-amount-y").replace("px", "") || 0);
		const timeTaken = Math.max(1, (/* @__PURE__ */ new Date()).getTime() - (dragStartTime?.getTime() ?? 0));
		const swipeAmount = swipeDirection === "x" ? swipeAmountX : swipeAmountY;
		const velocity = Math.abs(swipeAmount) / timeTaken;
		if ((swipeDirection === "x" ? swipeDirections().includes(swipeAmountX > 0 ? "right" : "left") : swipeDirections().includes(swipeAmountY > 0 ? "bottom" : "top")) && (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > .11)) {
			setOffsetBeforeRemove(offset());
			props.toast.onDismiss?.(props.toast);
			if (swipeDirection === "x") setSwipeOutDirection(swipeAmountX > 0 ? "right" : "left");
			else setSwipeOutDirection(swipeAmountY > 0 ? "down" : "up");
			deleteToast();
			setSwipeOut(true);
			return;
		}
		toastRef?.style.setProperty("--swipe-amount-x", "0px");
		toastRef?.style.setProperty("--swipe-amount-y", "0px");
		setIsSwiped(false);
		setSwiping(false);
		swipeDirection = null;
	}} onPointerMove={(event) => {
		if (!pointerStart || !dismissible()) return;
		if ((window.getSelection()?.toString().length ?? 0) > 0) return;
		const yDelta = event.clientY - pointerStart.y;
		const xDelta = event.clientX - pointerStart.x;
		if (!swipeDirection && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) swipeDirection = Math.abs(xDelta) > Math.abs(yDelta) ? "x" : "y";
		const swipeAmount = {
			x: 0,
			y: 0
		};
		const getDampening = (delta) => {
			return 1 / (1.5 + Math.abs(delta) / 20);
		};
		if (swipeDirection === "y") {
			if (swipeDirections().includes("top") || swipeDirections().includes("bottom")) {
				if (swipeDirections().includes("top") && yDelta < 0 || swipeDirections().includes("bottom") && yDelta > 0) swipeAmount.y = yDelta;
				else {
					const dampenedDelta = yDelta * getDampening(yDelta);
					swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
				}
			}
		} else if (swipeDirection === "x") {
			if (swipeDirections().includes("left") || swipeDirections().includes("right")) {
				if (swipeDirections().includes("left") && xDelta < 0 || swipeDirections().includes("right") && xDelta > 0) swipeAmount.x = xDelta;
				else {
					const dampenedDelta = xDelta * getDampening(xDelta);
					swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
				}
			}
		}
		if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) setIsSwiped(true);
		toastRef?.style.setProperty("--swipe-amount-x", `${swipeAmount.x}px`);
		toastRef?.style.setProperty("--swipe-amount-y", `${swipeAmount.y}px`);
	}}>
      <Show when={closeButton() && !props.toast.jsx && toastType() !== "loading"}>
        <button aria-label={props.closeButtonAriaLabel ?? "Close toast"} data-disabled={boolAttr(disabled())} data-close-button onPointerDown={(event) => event.stopPropagation()} onPointerUp={(event) => event.stopPropagation()} onClick={() => {
		if (disabled() || !dismissible()) return;
		deleteToast();
		props.toast.onDismiss?.(props.toast);
	}} class={cn(classNames()?.closeButton, toastClassNames()?.closeButton)}>
          {props.icons?.close ?? <CloseIcon />}
        </button>
      </Show>

      <Show when={(toastType() || props.toast.icon || props.toast.promise) && props.toast.icon !== null && (props.icons?.[toastType()] !== null || props.toast.icon)}>
        <div data-icon="" class={cn(classNames()?.icon, toastClassNames()?.icon)}>
          {}
          {toastType() === "loading" ? props.toast.icon || getLoadingIcon() : props.toast.promise ? getLoadingIcon() : null}
          {toastType() !== "loading" ? icon() : null}
        </div>
      </Show>

      <div data-content="" class={cn(classNames()?.content, toastClassNames()?.content)}>
        <div data-title="" class={cn(classNames()?.title, toastClassNames()?.title)}>
          {props.toast.jsx ? props.toast.jsx : title()}
        </div>
        <Show when={props.toast.description}>
          <div data-description="" class={cn(descriptionClassName(), toastDescriptionClassName(), classNames()?.description, toastClassNames()?.description)}>
            {description()}
          </div>
        </Show>
      </div>

      <Show when={props.toast.cancel}>
        {(cancel) => <Show when={!isAction(cancel())} fallback={<button data-button data-cancel style={props.toast.cancelButtonStyle ?? props.cancelButtonStyle} onClick={(event) => {
		const currentCancel = cancel();
		if (!dismissible()) return;
		currentCancel.onClick?.(event);
		deleteToast();
	}} class={cn(classNames()?.cancelButton, toastClassNames()?.cancelButton)}>
                {cancel().label}
              </button>}>
            {cancel()}
          </Show>}
      </Show>

      <Show when={props.toast.action}>
        {(action) => <Show when={!isAction(action())} fallback={<button data-button data-action style={props.toast.actionButtonStyle ?? props.actionButtonStyle} onClick={(event) => {
		action().onClick?.(event);
		if (event.defaultPrevented) return;
		deleteToast();
	}} class={cn(classNames()?.actionButton, toastClassNames()?.actionButton)}>
                {action().label}
              </button>}>
            {action()}
          </Show>}
      </Show>
    </li>;
}
function Toaster(props) {
	const documentDirection = getDocumentDirection();
	const position = () => props.position ?? "bottom-right";
	const hotkey = () => props.hotkey ?? ["altKey", "KeyT"];
	const theme = () => props.theme ?? "light";
	const gap = () => props.gap ?? GAP;
	const visibleToasts = () => props.visibleToasts ?? VISIBLE_TOASTS_AMOUNT;
	const dir = () => props.dir ?? documentDirection;
	const containerAriaLabel = () => props.containerAriaLabel ?? "Notifications";
	const [toastsStore, setToastsStore] = createStore({ oldestFirst: [] });
	const filteredToasts = createMemo(() => {
		const toasts = toastsStore.oldestFirst;
		return (props.id ? toasts.filter((toast) => toast.toasterId === props.id) : toasts.filter((toast) => !toast.toasterId)).reverse();
	});
	const possiblePositions = createMemo(() => {
		return Array.from(/* @__PURE__ */ new Set([position(), ...filteredToasts().filter((toast) => toast.position).map((toast) => toast.position)]));
	});
	const [heights, setHeights] = createSignal([]);
	const [expanded, setExpanded] = createSignal(false);
	const [interacting, setInteracting] = createSignal(false);
	const [actualTheme, setActualTheme] = createSignal(() => createToastTheme(theme()));
	let lastFocusedElement = null;
	let isFocusWithin = false;
	let listRef;
	const hotkeyLabel = () => hotkey().join("+").replace(/Key/g, "").replace(/Digit/g, "");
	const className = () => mergeClassName(props.className, props.class);
	const toastOptions = () => props.toastOptions;
	const toastClassNames = () => mergeClassNames(toastOptions()?.classNames, toastOptions()?.classes);
	const toastDescriptionClassName = () => mergeDescriptionClassName(toastOptions()?.descriptionClassName, toastOptions()?.descriptionClass);
	const toastClassName = () => mergeClassName(toastOptions()?.className, toastOptions()?.class);
	const removeToast = (toastToRemove) => {
		setToastsStore((draft) => {
			const index = draft.oldestFirst.findIndex((toast) => toast.id === toastToRemove.id);
			if (index === -1) return;
			if (!draft.oldestFirst[index].delete) ToastState.dismiss(toastToRemove.id);
			draft.oldestFirst.splice(index, 1);
		});
	};
	onSettled(() => ToastState.subscribe((toastItem) => {
		if (toastItem.dismiss) {
			requestAnimationFrame(() => {
				setToastsStore((draft) => {
					for (const toast of draft.oldestFirst) if (toast.id === toastItem.id) toast.delete = true;
				});
			});
			return;
		}
		const nextToast = toastItem;
		queueMicrotask(() => setToastsStore((draft) => {
			const existing = draft.oldestFirst.find((toast) => toast.id === nextToast.id);
			if (existing) reconcile(nextToast)(existing);
			else draft.oldestFirst.push(nextToast);
		}));
	}));
	createEffect(theme, (current) => {
		if (current !== "system") return;
		const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
		const updateTheme = ({ matches }) => {
			setActualTheme(matches ? "dark" : "light");
		};
		try {
			darkMediaQuery.addEventListener("change", updateTheme);
			return () => darkMediaQuery.removeEventListener("change", updateTheme);
		} catch {
			darkMediaQuery.addListener(updateTheme);
			return () => darkMediaQuery.removeListener(updateTheme);
		}
	});
	createEffect(() => filteredToasts().length <= 1, (collapse) => {
		if (collapse) setExpanded(false);
	});
	onSettled(() => {
		const handleKeyDown = (event) => {
			if (hotkey().length > 0 && hotkey().every((key) => event[key] || event.code === key)) {
				setExpanded(true);
				listRef?.focus();
			}
			if (event.code === "Escape" && (document.activeElement === listRef || listRef?.contains(document.activeElement))) setExpanded(false);
		};
		document.addEventListener("keydown", handleKeyDown);
		return () => document.removeEventListener("keydown", handleKeyDown);
	});
	createEffect(() => filteredToasts().length > 0, (hasToasts) => {
		if (!hasToasts) return;
		return () => {
			if (lastFocusedElement) {
				lastFocusedElement.focus({ preventScroll: true });
				lastFocusedElement = null;
				isFocusWithin = false;
			}
		};
	});
	return <section aria-label={props.customAriaLabel ?? `${containerAriaLabel()} ${hotkeyLabel()}`} tabindex={-1} aria-live="polite" aria-relevant="additions text" aria-atomic="false" data-react-aria-top-layer>
      <For each={possiblePositions()}>
        {(position, index) => {
		const [y, x] = position.split("-");
		const toastsByPosition = createMemo(() => filteredToasts().filter((toast) => !toast.position && index() === 0 || toast.position === position));
		const heightsByPosition = createMemo(() => {
			const byToastId = new Map(heights().map((height) => [height.toastId, height]));
			return toastsByPosition().flatMap((toast) => byToastId.get(toast.id) ?? []);
		});
		return <Show when={filteredToasts().length > 0}>
              <ol tabindex={-1} ref={(el) => listRef = el} dir={dir() === "auto" ? getDocumentDirection() : dir()} class={className()} data-sonner-toaster data-sonner-theme={actualTheme()} data-y-position={y} data-x-position={x} style={{
			"--front-toast-height": `${heightsByPosition()[0]?.height ?? 0}px`,
			"--width": `${TOAST_WIDTH}px`,
			"--gap": `${gap()}px`,
			...props.style,
			...assignOffset(props.offset, props.mobileOffset)
		}} onFocusOut={(event) => {
			if (isFocusWithin && !event.currentTarget.contains(event.relatedTarget)) {
				isFocusWithin = false;
				if (lastFocusedElement) {
					lastFocusedElement.focus({ preventScroll: true });
					lastFocusedElement = null;
				}
			}
		}} onFocusIn={(event) => {
			if (event.target instanceof HTMLElement && event.target.dataset.dismissible === "false") return;
			if (!isFocusWithin) {
				isFocusWithin = true;
				lastFocusedElement = event.relatedTarget;
			}
		}} onMouseEnter={() => setExpanded(true)} onMouseMove={() => setExpanded(true)} onMouseLeave={() => {
			if (!interacting()) setExpanded(false);
		}} onDragEnd={() => setExpanded(false)} onPointerDown={(event) => {
			if (event.target instanceof HTMLElement && event.target.dataset.dismissible === "false") return;
			setInteracting(true);
		}} onPointerUp={() => setInteracting(false)}>
                <For each={toastsByPosition()}>
                  {(toastItem, toastIndex) => <Toast icons={props.icons} index={toastIndex()} toast={toastItem} defaultRichColors={props.richColors} duration={toastOptions()?.duration ?? props.duration} class={toastClassName()} descriptionClassName={toastDescriptionClassName()} invert={Boolean(props.invert)} visibleToasts={visibleToasts()} closeButton={toastOptions()?.closeButton ?? props.closeButton ?? false} interacting={interacting()} position={position} style={toastOptions()?.style} unstyled={toastOptions()?.unstyled} classNames={toastClassNames()} cancelButtonStyle={toastOptions()?.cancelButtonStyle} actionButtonStyle={toastOptions()?.actionButtonStyle} closeButtonAriaLabel={toastOptions()?.closeButtonAriaLabel} removeToast={removeToast} toasts={toastsByPosition()} heights={heightsByPosition()} setHeights={setHeights} expandByDefault={Boolean(props.expand)} gap={gap()} expanded={expanded()} swipeDirections={props.swipeDirections} pauseWhenPageIsHidden={props.pauseWhenPageIsHidden} />}
                </For>
              </ol>
            </Show>;
	}}
      </For>
    </section>;
}
//#endregion
export { Toaster, toast, useSonner };
