<base target="_parent">

<style>
  :not(.sb-show-main) > .sb-main,
  :not(.sb-show-nopreview) > .sb-nopreview,
  :not(.sb-show-errordisplay) > .sb-errordisplay {
    display: none;
  }

  .sb-show-main.sb-main-centered {
    margin: 0;
    display: flex;
    align-items: center;
    min-height: 100vh;
  }

  .sb-show-main.sb-main-centered #root {
    box-sizing: border-box;
    margin: auto;
    padding: 1rem;
    max-height: 100%; /* Hack for centering correctly in IE11 */
  }

  /* Vertical centering fix for IE11 */
  @media screen and (-ms-high-contrast: none), (-ms-high-contrast: active) {
    .sb-show-main.sb-main-centered:after {
      content: '';
      min-height: inherit;
      font-size: 0;
    }
  }

  .sb-show-main.sb-main-fullscreen {
    margin: 0;
    padding: 0;
    display: block;
  }

  .sb-show-main.sb-main-padded {
    margin: 0;
    padding: 1rem;
    display: block;
  }

  .sb-wrapper {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    font-family: "Nunito Sans", -apple-system, ".SFNSText-Regular", "San Francisco", BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow: auto;
  }

  .sb-heading {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.2px;
    margin: 10px 0;
    padding-right: 25px;
  }

  .sb-nopreview {
    display: flex;
    align-content: center;
    justify-content: center;
  }

  .sb-nopreview_main {
    margin: auto;
    padding: 30px;
    border-radius: 10px;
    background: rgba(0,0,0,0.03);
  }

  .sb-nopreview_heading {
    text-align: center;
  }

  .sb-errordisplay {
    border: 20px solid rgb(187, 49, 49);
    background: #222;
    color: #fff;
    z-index: 999999;
  }

  .sb-errordisplay_code {
    padding: 10px;
    background: #000;
    color: #eee;
    font-family: "Operator Mono", "Fira Code Retina", "Fira Code", "FiraCode-Retina", "Andale Mono", "Lucida Console", Consolas, Monaco, monospace;
  }

  .sb-errordisplay pre {
    white-space: pre-wrap;
  }
</style>

<script>
  /* globals window */
  /* eslint-disable no-underscore-dangle */
  try {
    if (window.top !== window) {
      window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.top.__REACT_DEVTOOLS_GLOBAL_HOOK__;
      window.__VUE_DEVTOOLS_GLOBAL_HOOK__ = window.top.__VUE_DEVTOOLS_GLOBAL_HOOK__;
      window.top.__VUE_DEVTOOLS_CONTEXT__ = window.document;
    }
  } catch (e) {
    // eslint-disable-next-line no-console
    console.warn('unable to connect to top frame for connecting dev tools');
  }

  window.onerror = function onerror(message, source, line, column, err) {
    if (window.CONFIG_TYPE !== 'DEVELOPMENT') return;
    // eslint-disable-next-line no-var, vars-on-top
    var xhr = new window.XMLHttpRequest();
    xhr.open('POST', '/runtime-error');
    xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');
    xhr.send(
      JSON.stringify({
        /* eslint-disable object-shorthand */
        message: message,
        source: source,
        line: line,
        column: column,
        error: err && { message: err.message, name: err.name, stack: err.stack },
        origin: 'preview',
        /* eslint-enable object-shorthand */
      })
    );
  };
</script>
